Current Path : /home/ncdcgo/admin.ncdc.go.ug/static/js/ |
Current File : /home/ncdcgo/admin.ncdc.go.ug/static/js/164.afc87541.chunk.js.map |
{"version":3,"file":"static/js/164.afc87541.chunk.js","mappings":"2IA+CA,IA3CoB,SAAC,GAAgB,IAAdA,EAAa,EAAbA,OACrB,OACE,gBACEC,UAAU,kEACV,aAAW,aAFb,UAIE,gBAAIA,UAAU,kDAAd,WACE,eAAIA,UAAU,yCAAd,UACE,UAAC,KAAD,CACEC,GAAG,OACHD,UAAU,kHAFZ,WAIE,gBACEA,UAAU,eACVE,KAAK,eACLC,QAAQ,YACRC,MAAM,6BAJR,UAME,iBAAMC,EAAE,uMAVZ,YAFJ,OAiBGN,QAjBH,IAiBGA,OAjBH,EAiBGA,EAAQO,KAAI,SAACC,EAAOC,GACnB,OACE,gBAAIR,UAAU,2BAAd,WACE,SAAC,IAAD,CAAcS,KAAM,GAAIT,UAAU,UAClC,SAAC,KAAD,CACEC,GAAIM,EAAMG,KACVV,UAAU,gIAFZ,SAIGO,EAAMI,SANmCH,EAUjD,QAIR,C,kLCxCYI,EAAS,yCAAG,iGAASC,EAAT,EAASA,WAAT,SACVC,EAAAA,EAAAA,IAAA,mBAAsBD,IADZ,mFAAH,sDAITE,EAAY,SAAC,GAA4B,IAA1BF,EAAyB,EAAzBA,WAAYG,EAAa,EAAbA,OACtC,OAAOC,EAAAA,EAAAA,WAAS,kBACXD,GADU,IAEbE,SAAU,CAAC,SAAUL,GACrBM,QAAS,kBAAMP,EAAU,CAAEC,WAAAA,GAAlB,IAEZ,E,8ECPYO,EAAe,SAAC,GAA0B,IAAxBC,EAAuB,EAAvBA,KAAMR,EAAiB,EAAjBA,WACnC,OAAOC,EAAAA,EAAAA,MAAA,mBAAwBD,GAAcQ,EAAM,CACjDC,QAAS,CACP,eAAgB,wBAGrB,EAEDF,EAAaG,UAAY,CACvBF,KAAMG,IAAAA,MAAgB,CACpBC,MAAOD,IAAAA,OAAAA,WACPE,KAAMF,IAAAA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AAuB,IAAfD,EAAwB,eAAiBA,EACjDE,EAAYJ,EAAKxI,KACjBA,OAAqB,IAAd4I,EAAuB,GAAKA,EACnCC,EAAOhB,EAAyBW,EAAM,CAAC,QAAS,SAEpD,OAAoBM,EAAAA,cAAoB,MAAO/B,EAAS,CACtD0B,IAAKA,EACL9I,MAAO,6BACPoJ,MAAO/I,EACPgJ,OAAQhJ,EACRN,QAAS,YACTD,KAAM,OACNwJ,OAAQN,EACRO,YAAa,IACbC,cAAe,QACfC,eAAgB,SACfP,GAAoBC,EAAAA,cAAoB,WAAY,CACrDO,OAAQ,mBAEX,IACDf,EAAaxH,UAAY,CACvB6H,MAAO5H,IAAAA,OACPf,KAAMe,IAAAA,UAAoB,CAACA,IAAAA,OAAkBA,IAAAA,UAE/CuH,EAAagB,YAAc,eAC3B,K,qCCjBA,IAAMC,EAAaT,EAAAA,YAhBnB,SAAkBU,EAAOC,GACvB,OAAoBX,EAAAA,cAAoB,MAAO9B,OAAOC,OAAO,CAC3DtH,MAAO,6BACPF,KAAM,OACNC,QAAS,YACTwJ,YAAa,EACbD,OAAQ,eACR,cAAe,OACfR,IAAKgB,GACJD,GAAqBV,EAAAA,cAAoB,OAAQ,CAClDK,cAAe,QACfC,eAAgB,QAChBxJ,EAAG,mBAEN,IAGD,K,qCCLA,IAAM2J,EAAaT,EAAAA,YAZnB,SAAoBU,EAAOC,GACzB,OAAoBX,EAAAA,cAAoB,MAAO9B,OAAOC,OAAO,CAC3DtH,MAAO,6BACPD,QAAS,YACTD,KAAM,eACN,cAAe,OACfgJ,IAAKgB,GACJD,GAAqBV,EAAAA,cAAoB,OAAQ,CAClDlJ,EAAG,4HAEN,IAGD,K","sources":["components/Layout/Breadcrumbs.jsx","features/notices/api/getNotice.js","features/notices/api/updateNotice.js","features/notices/components/UpdateNotice.jsx","features/notices/routes/Notice.jsx","features/notices/api/createNotice.js","features/notices/components/CreateNotice.jsx","features/notices/api/getNotices.js","features/notices/api/deleteNotice.js","features/notices/components/DeleteNotice.jsx","features/notices/components/NoticesList.jsx","features/notices/routes/Notices.jsx","features/notices/routes/index.jsx","../node_modules/react-feather/dist/icons/chevron-right.js","../node_modules/@heroicons/react/outline/esm/PlusIcon.js","../node_modules/@heroicons/react/solid/esm/PencilIcon.js"],"sourcesContent":["import React from \"react\";\nimport { Link } from \"react-router-dom\";\nimport { ChevronRight } from \"react-feather\";\n\nconst Breadcrumbs = ({ routes }) => {\n return (\n <nav\n className=\"flex bg-white border border-gray-200 p-2 rounded-full px-4 mt-4\"\n aria-label=\"Breadcrumb\"\n >\n <ol className=\"inline-flex items-center space-x-1 md:space-x-3\">\n <li className=\"inline-flex items-center text-gray-800\">\n <Link\n to=\"/app\"\n className=\"inline-flex items-center text-sm text-gray-800 hover:text-gray-900 dark:text-gray-800 dark:hover:text-gray-200\"\n >\n <svg\n className=\"w-4 h-4 mr-2\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z\"></path>\n </svg>\n Home\n </Link>\n </li>\n {routes?.map((route, index) => {\n return (\n <li className=\"inline-flex items-center\" key={index}>\n <ChevronRight size={10} className=\"mr-4\" />\n <Link\n to={route.path}\n className=\"inline-flex items-center text-sm font-extrabold text-gray-700 hover:text-gray-900 dark:text-gray-800 dark:hover:text-gray-200\"\n >\n {route.name}\n </Link>\n </li>\n );\n })}\n </ol>\n </nav>\n );\n};\n\nBreadcrumbs.propTypes = {};\n\nexport default Breadcrumbs;\n","import { axios } from 'lib/axios';\nimport { useQuery } from 'react-query';\n\nexport const getNotice = async ({ noticeSlug }) => {\n return await axios.get(`/notices/${noticeSlug}`);\n};\n\nexport const useNotice = ({ noticeSlug, config }) => {\n return useQuery({\n ...config,\n queryKey: ['notice', noticeSlug],\n queryFn: () => getNotice({ noticeSlug }),\n });\n};\n","import { axios } from 'lib/axios';\nimport { queryClient } from 'lib/react-query';\nimport { useNotificationStore } from 'stores/notifications';\nimport PropTypes from 'prop-types';\nimport { useMutation } from 'react-query';\n\nexport const updateNotice = ({ data, noticeSlug }) => {\n return axios.patch(`/notices/${noticeSlug}`, data, {\n headers: {\n 'Content-Type': 'multipart/form-data',\n },\n });\n};\n\nupdateNotice.propTypes = {\n data: PropTypes.shape({\n title: PropTypes.string.isRequired,\n desc: PropTypes.string.isRequired,\n }).isRequired,\n noticeSlug: PropTypes.string.isRequired,\n};\n\nexport const useUpdateNotice = ({ config } = {}) => {\n const { addNotification } = useNotificationStore();\n\n return useMutation({\n onMutate: async (updatingNotice) => {\n await queryClient.cancelQueries(['notice', updatingNotice?.noticeSlug]);\n\n const previousNotice = queryClient.getQueryData[('notice', updatingNotice?.noticeSlug)];\n\n queryClient.setQueryData(['notice', updatingNotice?.noticeSlug], {\n ...previousNotice,\n ...updatingNotice.data,\n slug: updatingNotice.noticeSlug,\n });\n\n return { previousNotice };\n },\n onError: (_, __, context) => {\n if (context?.previousNotice) {\n queryClient.setQueryData(['notice', context.previousNotice.slug], context.previousNotice);\n }\n },\n onSuccess: (data) => {\n queryClient.refetchQueries(['notice', data.slug]);\n addNotification({\n type: 'success',\n title: 'Notice Updated',\n });\n },\n ...config,\n mutationFn: updateNotice,\n });\n};\n","import { Button, Spinner } from \"components/Elements\";\nimport {\n Form,\n FormDrawer,\n InputField,\n TextAreaField,\n} from \"components/Form\";\nimport { Authorization, ROLES } from \"lib/authorization\";\nimport { PencilIcon } from \"@heroicons/react/solid\";\nimport PropTypes from \"prop-types\";\nimport * as z from \"zod\";\n\nimport { useNotice } from \"../api/getNotice\";\nimport { useUpdateNotice } from \"../api/updateNotice\";\n\nconst schema = z.object({\n title: z.string().min(1, \"Required\"),\n desc: z.string().min(1, \"Required\"),\n});\n\nexport const UpdateNotice = ({ noticeSlug }) => {\n const noticeQuery = useNotice({ noticeSlug });\n const updateNoticeMutation = useUpdateNotice();\n\n if (updateNoticeMutation.isLoading) {\n return (\n <div\n id=\"loading-screen\"\n className=\"w-full h-full fixed block top-0 left-0 bg-black opacity-75 z-50\"\n >\n <span className=\"opacity-75 top-1/2 my-0 mx-auto block relative w-0 h-0\">\n <Spinner size=\"sm\" />\n </span>\n </div>\n );\n }\n\n return (\n <Authorization allowedRoles={[ROLES.ADMIN]}>\n <FormDrawer\n size=\"sm\"\n isDone={updateNoticeMutation.isSuccess}\n triggerButton={\n <Button\n variant=\"create\"\n startIcon={<PencilIcon className=\"h-4 w-4\" />}\n size=\"sm\"\n >\n Update\n </Button>\n }\n title=\"Update Notice\"\n submitButton={\n <Button\n form=\"update-notice\"\n type=\"submit\"\n size=\"sm\"\n isLoading={updateNoticeMutation.isLoading}\n >\n Submit\n </Button>\n }\n >\n <Form\n id=\"update-notice\"\n encType=\"multipart/form-data\"\n onSubmit={async (values) => {\n const { title, desc} = values;\n const bodyFormData = new FormData();\n bodyFormData.append(\"title\", title);\n bodyFormData.append(\"desc\", desc);\n await updateNoticeMutation.mutateAsync({\n data: bodyFormData,\n noticeSlug,\n });\n }}\n options={{\n defaultValues: {\n title: noticeQuery.data?.title,\n desc: noticeQuery.data?.desc,\n \n },\n }}\n schema={schema}\n >\n {({ register, formState, watch, setValue }) => (\n <>\n <InputField\n label=\"Title\"\n error={formState.errors[\"title\"]}\n registration={register(\"title\")}\n />\n <TextAreaField\n label=\"Content\"\n error={formState.errors[\"desc\"]}\n editorContent={watch(\"desc\")}\n setValue={setValue}\n value=\"desc\"\n />\n \n \n </>\n )}\n </Form>\n </FormDrawer>\n </Authorization>\n );\n};\n\nUpdateNotice.propTypes = {\n noticeSlug: PropTypes.string.isRequired,\n};\n","import { Spinner, MDPreview } from \"components/Elements\";\nimport { Head } from \"components/Head\";\nimport { ContentLayout } from \"components/Layout\";\nimport { formatDate } from \"utils/format\";\nimport { useParams } from \"react-router-dom\";\n\nimport { useNotice } from \"../api/getNotice\";\nimport { UpdateNotice } from \"../components/UpdateNotice\";\nimport Breadcrumbs from \"components/Layout/Breadcrumbs\";\n\nexport const Notice = () => {\n const { noticeSlug } = useParams();\n\n const noticeQuery = useNotice({ noticeSlug });\n\n const routes = [\n {\n name: \"Notices\",\n path: \"/app/notices\",\n },\n {\n name: noticeQuery.data?.title,\n path: \"\",\n },\n ];\n\n if (noticeQuery.isLoading) {\n return (\n <div className=\"w-full h-48 flex justify-center items-center\">\n <Spinner size=\"lg\" />\n </div>\n );\n }\n\n if (!noticeQuery.data) return null;\n\n return (\n <>\n <Head title={noticeQuery.data.title} />\n <ContentLayout\n title={noticeQuery.data.title}\n button={<UpdateNotice noticeSlug={noticeSlug} />}\n >\n <span className=\"text-xs text-gray-500 font-bold\">\n {formatDate(noticeQuery.data.createdAt)}\n </span>\n <Breadcrumbs routes={routes} />\n <div className=\"mt-6 flex flex-col space-y-16\">\n <div>\n <div className=\"px-4 py-5 sm:px-6 \">\n <div className=\"mt-1 text-sm text-gray-500\">\n <MDPreview value={noticeQuery.data.desc} />\n </div>\n </div>\n </div>\n </div>\n </ContentLayout>\n </>\n );\n};\n","import { axios } from 'lib/axios';\nimport { queryClient } from 'lib/react-query';\nimport { useNotificationStore } from 'stores/notifications';\nimport PropTypes from 'prop-types';\nimport { useMutation } from 'react-query';\n\nexport const createNotice = ({ data }) => {\n return axios.post(`/notices`, data);\n};\n\ncreateNotice.propTypes = {\n data: PropTypes.shape({\n title: PropTypes.string.isRequired,\n desc: PropTypes.string.isRequired,\n }).isRequired,\n};\n\nexport const useCreateNotice = ({ config } = {}) => {\n const { addNotification } = useNotificationStore();\n return useMutation({\n onMutate: async (newNotice) => {\n await queryClient.cancelQueries('notices');\n\n const previousNotices = queryClient.getQueryData('notices');\n\n queryClient.setQueryData('notices', [...(previousNotices || []), newNotice.data]);\n\n return { previousNotices };\n },\n onError: (_, __, context) => {\n if (context?.previousNotices) {\n queryClient.setQueryData('notices', context.previousNotices);\n }\n },\n onSuccess: () => {\n queryClient.invalidateQueries('notices');\n addNotification({\n type: 'success',\n title: 'Notice Created',\n });\n },\n ...config,\n mutationFn: createNotice,\n });\n};\n","import { Button } from 'components/Elements';\nimport { Form, FormDrawer, InputField, TextAreaField } from 'components/Form';\nimport { Authorization, ROLES } from 'lib/authorization';\nimport { PlusIcon } from '@heroicons/react/outline';\nimport * as z from 'zod';\n\nimport { useCreateNotice } from '../api/createNotice';\n\nconst schema = z.object({\n title: z.string().min(1, 'Required'),\n desc: z.string().min(1, 'Required'),\n});\n\nexport const CreateNotice = () => {\n const createNoticeMutation = useCreateNotice();\n\n return (\n <Authorization allowedRoles={[ROLES.ADMIN]}>\n <FormDrawer\n size=\"sm\"\n isDone={createNoticeMutation.isSuccess}\n triggerButton={\n <Button variant=\"create\" size=\"sm\" startIcon={<PlusIcon className=\"h-4 w-4\" />}>\n Create Notice\n </Button>\n }\n title=\"Create Notice\"\n submitButton={\n <Button\n form=\"create-notice\"\n type=\"submit\"\n size=\"sm\"\n isLoading={createNoticeMutation.isLoading}\n >\n Submit\n </Button>\n }\n >\n <Form\n id=\"create-notice\"\n onSubmit={async (values) => {\n await createNoticeMutation.mutateAsync({ data: values });\n }}\n schema={schema}\n >\n {({ register, formState, watch, setValue }) => (\n <>\n <InputField\n label=\"Title\"\n error={formState.errors['title']}\n registration={register('title')}\n />\n\n <TextAreaField\n label=\"Description\"\n error={formState.errors['desc']}\n editorContent={watch('desc')}\n setValue={setValue}\n value=\"desc\"\n />\n </>\n )}\n </Form>\n </FormDrawer>\n </Authorization>\n );\n};\n","import { axios } from 'lib/axios';\nimport { useQuery } from 'react-query';\n\nexport const getNotices = () => {\n return axios.get('/notices');\n};\n\nexport const useNotices = ({ config } = {}) => {\n return useQuery({\n ...config,\n queryKey: ['notices'],\n queryFn: () => getNotices(),\n });\n};\n","import { axios } from 'lib/axios';\nimport { queryClient } from 'lib/react-query';\nimport { useNotificationStore } from 'stores/notifications';\nimport PropTypes from 'prop-types';\nimport { useMutation } from 'react-query';\n\nexport const deleteNotice = ({ noticeId }) => {\n return axios.delete(`/notices/${noticeId}`);\n};\n\ndeleteNotice.propTypes = {\n noticeId: PropTypes.string.isRequired,\n};\n\nexport const useDeleteNotice = ({ config } = {}) => {\n const { addNotification } = useNotificationStore();\n\n return useMutation({\n onMutate: async (deletedNotice) => {\n await queryClient.cancelQueries('notices');\n\n const previousNotices = queryClient.getQueryData('notices');\n\n queryClient.setQueryData(\n 'notices',\n previousNotices?.filter((notice) => notice.id !== deletedNotice.noticeId)\n );\n\n return { previousNotices };\n },\n onError: (_, __, context) => {\n if (context?.previousNotices) {\n queryClient.setQueryData('notices', context.previousNotices);\n }\n },\n onSuccess: () => {\n queryClient.invalidateQueries('notices');\n addNotification({\n type: 'success',\n title: 'Notice Deleted',\n });\n },\n ...config,\n mutationFn: deleteNotice,\n });\n};\n","import { Button, ConfirmationDialog, Spinner } from \"components/Elements\";\nimport { Authorization, ROLES } from \"lib/authorization\";\nimport PropTypes from \"prop-types\";\n\nimport { useDeleteNotice } from \"../api/deleteNotice\";\n\nexport const DeleteNotice = ({ id }) => {\n const deleteNoticeMutation = useDeleteNotice();\n\n if (deleteNoticeMutation.isLoading) {\n return (\n <div\n id=\"loading-screen\"\n className=\"w-full h-full fixed block top-0 left-0 bg-black opacity-75 z-50\"\n >\n <span className=\"opacity-75 top-1/2 my-0 mx-auto block relative w-0 h-0\">\n <Spinner size=\"sm\" />\n </span>\n </div>\n );\n }\n\n return (\n\t\t<Authorization allowedRoles={[ROLES.ADMIN]}>\n\t\t\t<ConfirmationDialog\n\t\t\t\ticon=\"danger\"\n\t\t\t\ttitle=\"Delete Notice\"\n\t\t\t\tbody=\"Are you sure you want to permanently remove this Notice?\"\n\t\t\t\ttriggerButton={<button>Remove</button>}\n\t\t\t\tconfirmButton={\n\t\t\t\t\t<Button\n\t\t\t\t\t\tisLoading={deleteNoticeMutation.isLoading}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclassName=\"bg-red-600\"\n\t\t\t\t\t\tonClick={async () =>\n\t\t\t\t\t\t\tawait deleteNoticeMutation.mutateAsync({ noticeId: id })\n\t\t\t\t\t\t}>\n\t\t\t\t\t\tDelete Notice\n\t\t\t\t\t</Button>\n\t\t\t\t}\n\t\t\t/>\n\t\t</Authorization>\n\t);\n};\n\nDeleteNotice.propTypes = {\n id: PropTypes.string.isRequired,\n};\n","import { Table, Spinner, Link } from \"components/Elements\";\nimport { formatDate } from \"utils/format\";\n\nimport { useNotices } from \"../api/getNotices\";\n\nimport { DeleteNotice } from \"./DeleteNotice\";\n\nexport const NoticesList = () => {\n const noticesQuery = useNotices();\n\n if (noticesQuery.isLoading) {\n return (\n <div className=\"w-full h-48 flex justify-center items-center\">\n <Spinner size=\"lg\" />\n </div>\n );\n }\n\n if (!noticesQuery.data) return null;\n\n return (\n <Table\n data={noticesQuery.data}\n className=\"text-gray-400\"\n columns={[\n {\n title: \"Notices\",\n field: \"title\",\n Cell({ entry: { title, createdAt } }) {\n return (\n <>\n <span className=\"text-lg\">{title}</span>\n <br />\n <span className=\"text-xs\">\n Created at {formatDate(createdAt)}\n </span>\n </>\n );\n },\n },\n {\n title: \"\",\n field: \"slug\",\n Cell({ entry: { slug, _id } }) { \n return (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<div className=\"flex flex-row justify-center items-center gap-5\">\n\t\t\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\t\t\tto={`./${slug}`}\n\t\t\t\t\t\t\t\t\t\tclassName=\"mr-2 text-black dark:text-gray-200 hover:text-green-400\">\n\t\t\t\t\t\t\t\t\t\tView\n\t\t\t\t\t\t\t\t\t</Link>{\" \"}\n\t\t\t\t\t\t\t\t\t<DeleteNotice id={_id} />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t);\n },\n },\n \n ]}\n />\n );\n};\n","import { ContentLayout } from \"components/Layout\";\nimport Breadcrumbs from \"components/Layout/Breadcrumbs\";\n\nimport { CreateNotice } from \"../components/CreateNotice\";\nimport { NoticesList } from \"../components/NoticesList\";\n\nexport const Notices = () => {\n const routes = [\n {\n name: \"Notices\",\n path: \".\",\n },\n ];\n return (\n <ContentLayout title=\"Notice\" button={<CreateNotice />}>\n <Breadcrumbs routes={routes} />\n <div className=\"mt-4\">\n <NoticesList /> \n </div>\n </ContentLayout>\n );\n}; \n","import { Navigate, Route, Routes } from 'react-router-dom';\n\nimport { Notice } from './Notice';\nimport { Notices } from './Notices';\n\nexport const NoticesRoutes = () => {\n return (\n <Routes>\n <Route path=\"\" element={<Notices />} />\n <Route path=\":noticeSlug\" element={<Notice />} />\n <Route path=\"*\" element={<Navigate to=\".\" />} />\n </Routes>\n );\n};\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React, { forwardRef } from 'react';\nimport PropTypes from 'prop-types';\nvar ChevronRight = forwardRef(function (_ref, ref) {\n var _ref$color = _ref.color,\n color = _ref$color === void 0 ? 'currentColor' : _ref$color,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 24 : _ref$size,\n rest = _objectWithoutProperties(_ref, [\"color\", \"size\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n ref: ref,\n xmlns: \"http://www.w3.org/2000/svg\",\n width: size,\n height: size,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: color,\n strokeWidth: \"2\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }, rest), /*#__PURE__*/React.createElement(\"polyline\", {\n points: \"9 18 15 12 9 6\"\n }));\n});\nChevronRight.propTypes = {\n color: PropTypes.string,\n size: PropTypes.oneOfType([PropTypes.string, PropTypes.number])\n};\nChevronRight.displayName = 'ChevronRight';\nexport default ChevronRight;","import * as React from \"react\";\n\nfunction PlusIcon(props, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n strokeWidth: 2,\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\",\n ref: svgRef\n }, props), /*#__PURE__*/React.createElement(\"path\", {\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n d: \"M12 4v16m8-8H4\"\n }));\n}\n\nconst ForwardRef = React.forwardRef(PlusIcon);\nexport default ForwardRef;","import * as React from \"react\";\n\nfunction PencilIcon(props, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\",\n ref: svgRef\n }, props), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z\"\n }));\n}\n\nconst ForwardRef = React.forwardRef(PencilIcon);\nexport default ForwardRef;"],"names":["routes","className","to","fill","viewBox","xmlns","d","map","route","index","size","path","name","getNotice","noticeSlug","axios","useNotice","config","useQuery","queryKey","queryFn","updateNotice","data","headers","propTypes","PropTypes","title","desc","isRequired","schema","z","min","UpdateNotice","noticeQuery","updateNoticeMutation","addNotification","useNotificationStore","useMutation","onMutate","updatingNotice","queryClient","previousNotice","slug","onError","_","__","context","onSuccess","type","mutationFn","useUpdateNotice","isLoading","id","allowedRoles","ROLES","Form","isDone","isSuccess","triggerButton","variant","startIcon","PencilIcon","submitButton","form","encType","onSubmit","values","bodyFormData","FormData","append","mutateAsync","options","defaultValues","register","formState","watch","setValue","label","error","errors","registration","editorContent","value","Notice","useParams","Head","button","formatDate","createdAt","Breadcrumbs","createNotice","CreateNotice","createNoticeMutation","newNotice","previousNotices","useCreateNotice","PlusIcon","getNotices","deleteNotice","noticeId","DeleteNotice","deleteNoticeMutation","deletedNotice","filter","notice","useDeleteNotice","icon","body","confirmButton","onClick","NoticesList","noticesQuery","useNotices","columns","field","Cell","entry","_id","Notices","NoticesRoutes","element","_extends","Object","assign","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","this","_objectWithoutProperties","excluded","sourceKeys","keys","indexOf","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","propertyIsEnumerable","ChevronRight","forwardRef","_ref","ref","_ref$color","color","_ref$size","rest","React","width","height","stroke","strokeWidth","strokeLinecap","strokeLinejoin","points","displayName","ForwardRef","props","svgRef"],"sourceRoot":""}