Your IP : 18.188.178.1


Current Path : /home/ncdcgo/admin.ncdc.go.ug/static/js/
Upload File :
Current File : /home/ncdcgo/admin.ncdc.go.ug/static/js/863.2ad56bb9.chunk.js

(self.webpackChunkpanel=self.webpackChunkpanel||[]).push([[863],{223:function(e,t,n){"use strict";n(2791);var a=n(3504),r=n(2506),i=n(184);t.Z=function(e){var t=e.routes;return(0,i.jsx)("nav",{className:"flex bg-white border border-gray-200 p-2 rounded-full px-4 mt-4","aria-label":"Breadcrumb",children:(0,i.jsxs)("ol",{className:"inline-flex items-center space-x-1 md:space-x-3",children:[(0,i.jsx)("li",{className:"inline-flex items-center text-gray-800",children:(0,i.jsxs)(a.rU,{to:"/app",className:"inline-flex items-center text-sm  text-gray-800 hover:text-gray-900 dark:text-gray-800 dark:hover:text-gray-200",children:[(0,i.jsx)("svg",{className:"w-4 h-4 mr-2",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("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"})}),"Home"]})}),null===t||void 0===t?void 0:t.map((function(e,t){return(0,i.jsxs)("li",{className:"inline-flex items-center",children:[(0,i.jsx)(r.Z,{size:10,className:"mr-4"}),(0,i.jsx)(a.rU,{to:e.path,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",children:e.name})]},t)}))]})})}},1863:function(e,t,n){"use strict";n.r(t),n.d(t,{ApplicationsRoutes:function(){return Z}});var a=n(6871),r=n(885),i=n(9630),s=n(5528),o=n(2412),l=n(77),c=n(8592),d=n(4802),u=n(2791),p=n(1413),f=n(4165),m=n(5861),x=n(6771),h=n(1933),v=function(){var e=(0,m.Z)((0,f.Z)().mark((function e(t){var n;return(0,f.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.applicationId,e.next=3,x.o.get("/applications/".concat(n));case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),g=n(184),j=function(){var e=function(e){var t=e.applicationId,n=e.config;return(0,h.useQuery)((0,p.Z)((0,p.Z)({},n),{},{queryKey:["application",t],queryFn:function(){return v({applicationId:t})}}))}({applicationId:(0,a.UO)().applicationId}),t=(0,u.useState)(!1),n=(0,r.Z)(t,2),f=n[0],m=n[1];(0,u.useEffect)((function(){e.data&&m("".concat(l.tC,"/applications/").concat(e.data.resume)),console.log(f)}),[e.data,f]);return e.isLoading?(0,g.jsx)("div",{className:"w-full h-48 flex justify-center items-center",children:(0,g.jsx)(i.$j,{size:"lg"})}):e.data?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(s.F,{title:e.data.firstName}),(0,g.jsxs)(o.D,{title:e.data.firstName,children:[(0,g.jsx)("span",{className:"text-xs text-gray-500 font-bold",children:(0,c.p)(e.data.createdAt)}),(0,g.jsx)("div",{className:"mt-6 flex flex-col space-y-16",children:(0,g.jsx)("div",{children:(0,g.jsx)("div",{className:"bg-white dark:bg-gray-700 shadow overflow-hidden sm:rounded-lg",children:(0,g.jsxs)("div",{className:"px-4 py-5 border-b border-gray-800 sm:px-6",children:[(0,g.jsx)("div",{className:"-ml-4 -mt-2 flex items-center justify-between flex-wrap sm:flex-no-wrap",children:(0,g.jsxs)("div",{className:"ml-4 mt-2",children:[(0,g.jsx)("h3",{className:"text-lg leading-6 font-bold text-gray-900",children:"First Name"}),(0,g.jsx)("p",{className:"mt-1 text-base leading-6 text-gray-400",children:e.data.firstName})]})}),(0,g.jsx)("hr",{className:"my-4"}),(0,g.jsx)("div",{className:"-ml-4 -mt-2 flex items-center justify-between flex-wrap sm:flex-no-wrap",children:(0,g.jsxs)("div",{className:"ml-4 mt-2",children:[(0,g.jsx)("h3",{className:"text-lg leading-6 font-bold text-gray-900",children:"Last Name"}),(0,g.jsx)("p",{className:"mt-1 text-base leading-6 text-gray-400",children:e.data.lastName})]})}),(0,g.jsx)("hr",{className:"my-4"}),(0,g.jsx)("div",{className:"-ml-4 -mt-2 flex items-center justify-between flex-wrap sm:flex-no-wrap",children:(0,g.jsxs)("div",{className:"ml-4 mt-2",children:[(0,g.jsx)("h3",{className:"text-lg leading-6 font-bold text-gray-900",children:"Email"}),(0,g.jsx)("p",{className:"mt-1 text-base leading-6 text-gray-400",children:e.data.email})]})}),(0,g.jsx)("hr",{className:"my-4"}),(0,g.jsx)("div",{className:"-ml-4 -mt-2 flex items-center justify-between flex-wrap sm:flex-no-wrap",children:(0,g.jsxs)("div",{className:"ml-4 mt-2",children:[(0,g.jsx)("h3",{className:"text-lg leading-6 font-bold text-gray-900",children:"Resume"}),(0,g.jsx)("p",{className:"mt-2 text-base leading-6 text-gray-400",children:(0,g.jsx)(i.zx,{variant:"create",onClick:function(e){e.preventDefault(),(0,d.saveAs)(f,"resume.pdf")},children:"Download Resume"})})]})})]})})})})]})]}):null},y=n(223),w=function(){return x.o.get("/applications")},b=n(4430),N=n(3777),k=n(7889),A=n(2007),E=function(e){var t=e.applicationId;return x.o.delete("/applications/".concat(t))};E.propTypes={applicationId:n.n(A)().string.isRequired};var L=function(e){var t=e.id,n=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).config,t=(0,k.G)().addNotification;return(0,h.useMutation)((0,p.Z)((0,p.Z)({onMutate:function(){var e=(0,m.Z)((0,f.Z)().mark((function e(t){var n;return(0,f.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,N.E.cancelQueries("applications");case 2:return n=N.E.getQueryData("applications"),N.E.setQueryData("applications",null===n||void 0===n?void 0:n.filter((function(e){return e.id!==t.applicationId}))),e.abrupt("return",{previousApplications:n});case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),onError:function(e,t,n){null!==n&&void 0!==n&&n.previousApplications&&N.E.setQueryData("applications",n.previousApplications)},onSuccess:function(){N.E.invalidateQueries("applications"),t({type:"success",title:"Application Deleted"})}},e),{},{mutationFn:E}))}();return n.isLoading?(0,g.jsx)("div",{id:"loading-screen",className:"w-full h-full fixed block top-0 left-0 bg-black opacity-75 z-50",children:(0,g.jsx)("span",{className:"opacity-75 top-1/2 my-0 mx-auto block relative w-0 h-0",children:(0,g.jsx)(i.$j,{size:"sm"})})}):(0,g.jsx)(b._n,{allowedRoles:[b.K$.ADMIN],children:(0,g.jsx)(i.U6,{icon:"danger",title:"Delete Application",body:"Are you sure you want to delete this Application?",triggerButton:(0,g.jsx)("button",{children:"Remove"}),confirmButton:(0,g.jsx)(i.zx,{isLoading:n.isLoading,type:"button",className:"bg-red-600",onClick:(0,m.Z)((0,f.Z)().mark((function e(){return(0,f.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.mutateAsync({applicationId:t});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),children:"Delete Application"})})})},O=function(){var e=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).config;return(0,h.useQuery)((0,p.Z)((0,p.Z)({},e),{},{queryKey:["applications"],queryFn:function(){return w()}}))}();return e.isLoading?(0,g.jsx)("div",{className:"w-full h-48 flex justify-center items-center",children:(0,g.jsx)(i.$j,{size:"lg"})}):(console.log(e.data),e.data?(0,g.jsx)(i.iA,{data:e.data,columns:[{title:"Name",field:"firstName",Cell:function(e){var t=e.entry,n=t.firstName,a=t.lastName,r=t.createdAt;return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("span",{children:n}),(0,g.jsx)("span",{className:"mx-1",children:a}),(0,g.jsx)("br",{}),(0,g.jsx)("span",{className:"text-xs text-gray-200",children:(0,c.p)(r)})]})}},{title:"",field:"_id",Cell:function(e){var t=e.entry._id;return(0,g.jsx)(g.Fragment,{children:(0,g.jsxs)("div",{className:"flex flex-row justify-center items-center gap-5",children:[(0,g.jsx)(i.rU,{to:"./".concat(t),className:"mr-2  text-black dark:text-gray-200 hover:text-green-400",children:"View"})," ",(0,g.jsx)(L,{id:t})]})})}}]}):null)},R=function(){return(0,g.jsxs)(o.D,{title:"Applications",children:[(0,g.jsx)(y.Z,{routes:[{name:"Applications",path:""}]}),(0,g.jsx)("div",{className:"mt-4",children:(0,g.jsx)(O,{})})]})},Z=function(){return(0,g.jsxs)(a.Z5,{children:[(0,g.jsx)(a.AW,{path:"",element:(0,g.jsx)(R,{})}),(0,g.jsx)(a.AW,{path:":applicationId",element:(0,g.jsx)(j,{})}),(0,g.jsx)(a.AW,{path:"*",element:(0,g.jsx)(a.Fg,{to:"."})})]})}},4802:function(e,t,n){var a,r,i;r=[],a=function(){"use strict";function t(e,t){return"undefined"==typeof t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}function a(e,t,n){var a=new XMLHttpRequest;a.open("GET",e),a.responseType="blob",a.onload=function(){l(a.response,t,n)},a.onerror=function(){console.error("could not download file")},a.send()}function r(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function i(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(a){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var s="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n.g&&n.g.global===n.g?n.g:void 0,o=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=s.saveAs||("object"!=typeof window||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(e,t,n){var o=s.URL||s.webkitURL,l=document.createElement("a");t=t||e.name||"download",l.download=t,l.rel="noopener","string"==typeof e?(l.href=e,l.origin===location.origin?i(l):r(l.href)?a(e,t,n):i(l,l.target="_blank")):(l.href=o.createObjectURL(e),setTimeout((function(){o.revokeObjectURL(l.href)}),4e4),setTimeout((function(){i(l)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,n,s){if(n=n||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(t(e,s),n);else if(r(e))a(e,n,s);else{var o=document.createElement("a");o.href=e,o.target="_blank",setTimeout((function(){i(o)}))}}:function(e,t,n,r){if((r=r||open("","_blank"))&&(r.document.title=r.document.body.innerText="downloading..."),"string"==typeof e)return a(e,t,n);var i="application/octet-stream"===e.type,l=/constructor/i.test(s.HTMLElement)||s.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||i&&l||o)&&"undefined"!=typeof FileReader){var d=new FileReader;d.onloadend=function(){var e=d.result;e=c?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=e:location=e,r=null},d.readAsDataURL(e)}else{var u=s.URL||s.webkitURL,p=u.createObjectURL(e);r?r.location=p:location.href=p,r=null,setTimeout((function(){u.revokeObjectURL(p)}),4e4)}});s.saveAs=l.saveAs=l,e.exports=l},void 0===(i="function"===typeof a?a.apply(t,r):a)||(e.exports=i)},2506:function(e,t,n){"use strict";var a=n(2791),r=n(2007),i=n.n(r);function s(){return s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},s.apply(this,arguments)}function o(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=(0,a.forwardRef)((function(e,t){var n=e.color,r=void 0===n?"currentColor":n,i=e.size,l=void 0===i?24:i,c=o(e,["color","size"]);return a.createElement("svg",s({ref:t,xmlns:"http://www.w3.org/2000/svg",width:l,height:l,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},c),a.createElement("polyline",{points:"9 18 15 12 9 6"}))}));l.propTypes={color:i().string,size:i().oneOfType([i().string,i().number])},l.displayName="ChevronRight",t.Z=l}}]);
//# sourceMappingURL=863.2ad56bb9.chunk.js.map