(this["webpackJsonpcustomer-portal"]=this["webpackJsonpcustomer-portal"]||[]).push([[0],{295:function(e,t,n){},363:function(e,t,n){},364:function(e,t,n){},488:function(e,t,n){},490:function(e,t,n){"use strict";n.r(t),t.default=n.p+"static/media/medatech-logo.d9b936ff.png"},491:function(e,t,n){"use strict";n.r(t);var a=n(0),c=n.n(a),r=n(34),i=n.n(r),s=(n(363),n(364),n(5)),o=n(4),l=n(18),u=n(6),d=n(322),j=n(625),b=n(602),O=n(618),h=n(626),m=n(631),x=n(627),f=n(629),g=n(200),p=n(589),S=n(628),v=n(630),E=n(616),T=n(320),C=n.n(T),A=n(321),y=n.n(A),k=n(610),D=n(585),w=n(587),P=n(300),I=n.n(P),N=n(306),R=n.n(N),U=n(44),L=n(61),F=n(70),M=n(20),B=n.n(M),_=n(296),W=new(function(){function e(){Object(L.a)(this,e)}return Object(F.a)(e,[{key:"login",value:function(e){return B.a.post("/customer_portal/login",e)}},{key:"logout",value:function(){localStorage.removeItem("token"),window.location.reload()}},{key:"getCurrentUser",value:function(){var e=localStorage.getItem("token");if(e)var t=Object(_.a)(e);return t}},{key:"changePassword",value:function(e){return B.a.post("/customer_portal/changePassword",e)}},{key:"forgotPassword",value:function(e){return B.a.post("/customer_portal/forgotPassword",e)}}]),e}()),G=["title","titleId"];function z(){return z=Object.assign||function(e){for(var t=1;t=0||(c[n]=e[n]);return c}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(c[n]=e[n])}return c}function V(e,t){var n=e.title,c=e.titleId,r=Y(e,G);return a.createElement("svg",z({viewBox:"0 0 24 24",width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":c},r),n?a.createElement("title",{id:c},n):null,a.createElement("path",{d:"M15.7,16.6c-0.2,0.2 -0.6,0.3 -0.8,0.4c-0.5,0.2 -1,0.2 -1.7,0.1c-1.2,-0.1 -1.3,-0.4 -2,-0.3c-0.8,0.1 -1.5,0.5 -1.5,0.4c0,-0.1 0.3,-0.3 0.8,-0.8c0.4,-0.5 0.9,-1.1 0.8,-1.9c0,-0.4 -0.1,-0.9 -0.1,-1.1l2.3,0l0,-1.8l-3,0c-0.1,-0.1 -0.5,-0.9 -0.7,-1.7c-0.2,-1.1 0,-1.6 0.1,-1.9c0.3,-0.7 1,-1.3 1.9,-1.3c0.3,0 0.639,0.049 0.839,0.149c0.2,0.1 0.42,0.22 0.635,0.396c0.384,0.314 0.457,0.641 0.626,1.055c0.056,0.137 0.1,0.6 0.1,0.7l2.7,0c0.1,-0.8 -0.5,-2.3 -1.2,-3c-0.8,-0.8 -1.7,-1.2 -2.1,-1.4c-1.7,-0.6 -4.1,-0.4 -5.6,1.2c-0.2,0.2 -1.2,1.3 -1.2,2.9c0,0.5 0.2,1 0.5,1.9c0.1,0.3 0.2,0.6 0.3,0.9l-0.9,0l0,1.8l1.7,0c0.2,0.4 0.3,0.8 0.3,1.3c0,0.2 -0.1,1.6 -1,2.4c-0.3,0.3 -0.7,0.4 -0.9,0.6l1.6,2c0.6,-0.2 1.1,-1 2.2,-0.8c2.1,0.4 2.9,1.2 4.6,0.7c0.5,-0.1 1,-0.4 1.8,-0.7c0.4,-0.2 0.5,-0.3 0.6,-0.4l-1.7,-1.8Z",style:{fillRule:"nonzero",fill:"rgb(128, 128, 128)"}}))}var q=a.forwardRef(V),X=(n.p,n(304)),Q=n.n(X),K=n(305),H=n.n(K),Z=n(302),J=n.n(Z),$=n(301),ee=n.n($),te=n(1),ne=Object(te.jsx)("div",{children:W.getCurrentUser()?Object(te.jsxs)(te.Fragment,{children:[Object(te.jsxs)(k.a,{button:!0,component:U.b,to:"/dashboard",children:[Object(te.jsx)(D.a,{children:Object(te.jsx)(I.a,{})}),Object(te.jsx)(w.a,{primary:"Dashboard"})]}),Object(te.jsxs)(k.a,{button:!0,component:U.b,to:"/dashboard/invoices",children:[Object(te.jsx)(D.a,{children:Object(te.jsx)(q,{})}),Object(te.jsx)(w.a,{primary:"Invoices"})]}),Object(te.jsxs)(k.a,{button:!0,component:U.b,to:"/dashboard/statements",children:[Object(te.jsx)(D.a,{children:Object(te.jsx)(ee.a,{})}),Object(te.jsx)(w.a,{primary:"Statements"})]}),Object(te.jsxs)(k.a,{button:!0,component:U.b,to:"/dashboard/kanban",children:[Object(te.jsx)(D.a,{children:Object(te.jsx)(J.a,{})}),Object(te.jsx)(w.a,{primary:"Kanban Board"})]}),Object(te.jsx)(p.a,{}),Object(te.jsxs)(k.a,{button:!0,component:U.b,to:"/dashboard/servicecalls",children:[Object(te.jsx)(D.a,{children:Object(te.jsx)(Q.a,{})}),Object(te.jsx)(w.a,{primary:"Service Calls"})]}),Object(te.jsxs)(k.a,{button:!0,component:U.b,to:"/dashboard/createservicecall",children:[Object(te.jsx)(D.a,{children:Object(te.jsx)(H.a,{})}),Object(te.jsx)(w.a,{primary:"Create Service Call"})]})]}):Object(te.jsx)(te.Fragment,{children:Object(te.jsxs)(k.a,{button:!0,component:U.b,to:"/login",children:[Object(te.jsx)(D.a,{children:Object(te.jsx)(R.a,{})}),Object(te.jsx)(w.a,{primary:"Login"})]})})}),ae=n(639),ce=n(643),re=n(638),ie=n(642),se=n(612),oe=n(637),le=n(330);function ue(){var e=localStorage.getItem("token");return e?{"x-access-token":e}:{}}var de=new(function(){function e(){Object(L.a)(this,e)}return Object(F.a)(e,[{key:"getItemsForSale",value:function(){return B.a.get("/customer_portal/itemsForSale",{headers:ue()})}},{key:"getOrders",value:function(){return B.a.get("/customer_portal/orders",{headers:ue()})}},{key:"getCustomerOrders",value:function(){return B.a.get("/customer_portal/customerOrders",{headers:ue()})}},{key:"getOrderItems",value:function(e){return B.a.get("/customer_portal/orderItems/".concat(e),{headers:ue()})}},{key:"getShipments",value:function(){return B.a.get("/customer_portal/shipments",{headers:ue()})}},{key:"getCustomerShipments",value:function(){return B.a.get("/customer_portal/customerShipments",{headers:ue()})}},{key:"getShipmentItems",value:function(e,t){return B.a.get("/customer_portal/shipmentItems/".concat(e,"/").concat(t),{headers:ue()})}},{key:"getInvoices",value:function(){return B.a.get("/customer_portal/invoices",{headers:ue()})}},{key:"getCustomerInfo",value:function(e){return B.a.get("/customer_portal/getCustomerInfo",{headers:ue()})}},{key:"getCustomerInvoices",value:function(){return B.a.get("/customer_portal/customerInvoices",{headers:ue()})}},{key:"getInvoiceItems",value:function(e,t,n){return B.a.get("/customer_portal/invoiceItems/".concat(e,"/").concat(t,"/").concat(n),{headers:ue()})}},{key:"getInvoiceStatus",value:function(e){return B.a.get("/customer_portal/invoiceStatus/".concat(e),{headers:ue()})}},{key:"getCustomerParts",value:function(){return B.a.get("/customer_portal/customerParts",{headers:ue()})}},{key:"createOrder",value:function(e){return B.a.post("/customer_portal/createOrder",e,{headers:ue()})}},{key:"getUserNotifications",value:function(){return B.a.get("/customer_portal/userNotifications",{headers:ue()})}},{key:"setNotificationRead",value:function(e){return B.a.post("/customer_portal/userNotifications",e,{headers:ue()})}},{key:"createTask",value:function(e){return B.a.post("/customer_portal/createTask",e,{headers:ue()})}},{key:"updateTask",value:function(e){return B.a.patch("/customer_portal/updateTask",e,{headers:ue()})}},{key:"getServiceCalls",value:function(){return B.a.get("/customer_portal/servicecalls",{headers:ue()})}},{key:"getServiceCall",value:function(e){return B.a.get("/customer_portal/servicecall/".concat(e),{headers:ue()})}},{key:"getServiceCallExternalRemarks",value:function(e){return B.a.get("/customer_portal/servicecall/remarks/".concat(e),{headers:ue()})}},{key:"getTaskExplanation",value:function(e){return B.a.get("/customer_portal/taskExplanation/".concat(e),{headers:ue()})}},{key:"getTaskAttachments",value:function(e){return B.a.get("/customer_portal/taskAttachments/".concat(e),{headers:ue()})}},{key:"getCallStatuses",value:function(){return B.a.get("/customer_portal/callStatuses",{headers:ue()})}},{key:"getStatusLang2",value:function(e){return B.a.get("/customer_portal/statusLang2/".concat(e),{headers:ue()})}},{key:"getCallTypes",value:function(){return B.a.get("/customer_portal/callTypes",{headers:ue()})}},{key:"getCallSeverities",value:function(){return B.a.get("/customer_portal/callSeverities",{headers:ue()})}},{key:"getCustomerContacts",value:function(){return B.a.get("/customer_portal/customerContacts",{headers:ue()})}},{key:"getUserProjects",value:function(){return B.a.get("/customer_portal/userProjects",{headers:ue()})}},{key:"getProjectTasks",value:function(e){return B.a.get("/customer_portal/projectTasks/".concat(e),{headers:ue()})}},{key:"getProjectWBS",value:function(e){return B.a.get("/customer_portal/projectWBS/".concat(e),{headers:ue()})}},{key:"getGanttWBS",value:function(e){return B.a.get("/customer_portal/ganttWBS/".concat(e),{headers:ue()})}},{key:"getSCAttachments",value:function(e){return B.a.get("/customer_portal/scAttachments/".concat(e),{headers:ue()})}},{key:"getTaskStatuses",value:function(){return B.a.get("/customer_portal/taskStatuses",{headers:ue()})}},{key:"getTaskTypes",value:function(){return B.a.get("/customer_portal/taskTypes",{headers:ue()})}},{key:"getTaskSizes",value:function(){return B.a.get("/customer_portal/taskSizes",{headers:ue()})}},{key:"getUsers",value:function(){return B.a.get("/customer_portal/users",{headers:ue()})}},{key:"getCustomerStatements",value:function(){return B.a.get("/customer_portal/customerStatements",{headers:ue()})}},{key:"addServiceCallComment",value:function(e){return B.a.post("/customer_portal/addServiceCallComment",e,{headers:ue()})}},{key:"updateServiceCall",value:function(e){return B.a.patch("/customer_portal/updateServiceCall",e,{headers:ue()})}},{key:"updateCallStatus",value:function(e){return B.a.post("/customer_portal/updateCallStatus",e,{headers:ue()})}},{key:"changeTaskStatus",value:function(e){return B.a.patch("/customer_portal/changeTaskStatus",e,{headers:ue()})}},{key:"CreateServiceCall",value:function(e){return B.a.post("/customer_portal/createServiceCall",e,{headers:ue()})}},{key:"addServiceCallAttachment",value:function(e){return B.a.post("/customer_portal/addServiceCallAttachment",e,{headers:ue()})}},{key:"getCustomerSignup",value:function(e){return B.a.get("/customer_portal/CustomerSignup/".concat(e))}},{key:"checkContact",value:function(e){return B.a.get("/customer_portal/check_contact/".concat(e))}},{key:"checkUser",value:function(e){return B.a.get("/customer_portal/check_user/".concat(e))}},{key:"createContact",value:function(e){return B.a.post("/customer_portal/CreateContact/",e)}},{key:"createUser",value:function(e){return B.a.post("/customer_portal/CreateUser/",e)}},{key:"downloadOrderPdf",value:function(e){return B()({url:"/customer_portal/downloadOrderPdf",method:"POST",responseType:"blob",headers:ue(),data:{ORDNAME:e}})}},{key:"downloadInvoicePdf",value:function(e){return B()({url:"/customer_portal/downloadInvoicePdf",method:"POST",responseType:"blob",headers:ue(),data:{IVNUM:e}})}},{key:"downloadShipmentPdf",value:function(e){return B()({url:"/customer_portal/downloadShipmentPdf",method:"POST",responseType:"blob",headers:ue(),data:{DOCNO:e}})}},{key:"downloadStatementPdf",value:function(e){return B()({url:"/customer_portal/downloadStatementPdf",method:"POST",responseType:"blob",headers:ue(),data:{STATEMENTNO:e}})}}]),e}()),je=n(21),be=n(634),Oe=n(619),he=function(){return Object(te.jsxs)(te.Fragment,{children:[Object(te.jsx)(be.a,{}),Object(te.jsx)(Oe.a,{variant:"rectangular",height:50,style:{marginBottom:10}}),Object(je.a)(Array(25)).map((function(e,t){return Object(te.jsx)(Oe.a,{variant:"rectangular",height:25,style:{marginBottom:5}},t)}))]})},me=n(93),xe=n.n(me),fe=n(33),ge=n(501);function pe(e,t,n){return t[n]e[n]?1:0}function Se(e,t){return"desc"===e?function(e,n){return pe(e,n,t)}:function(e,n){return-pe(e,n,t)}}function ve(e,t){var n=e.map((function(e,t){return[e,t]}));return n.sort((function(e,n){var a=t(e[0],n[0]);return 0!==a?a:e[1]-n[1]})),n.map((function(e){return e[0]}))}var Ee=n(636),Te=n(620),Ce=n(591);function Ae(e){var t=e.order,n=e.orderBy,a=e.onRequestSort;return Object(te.jsx)(Ee.a,{children:Object(te.jsxs)(oe.a,{children:[Object(te.jsx)(re.a,{}),e.headCells.map((function(e){return Object(te.jsx)(re.a,{align:"center",padding:e.disablePadding?"none":"normal",sortDirection:n===e.id&&t,children:Object(te.jsxs)(Te.a,{active:n===e.id,direction:n===e.id?t:"asc",onClick:(c=e.id,function(e){return a(e,c)}),children:[Object(te.jsx)("b",{children:e.label}),n===e.id?Object(te.jsx)(h.a,{component:"span",sx:Ce.a,children:"desc"===t?"sorted descending":"sorted ascending"}):null]})},e.id);var c}))]})})}var ye=function(e){var t=e.title;return Object(te.jsx)(x.a,{sx:{pl:{sm:2},pr:{xs:1,sm:1}},children:Object(te.jsx)(g.a,{sx:{flex:"1 1 100%"},variant:"h6",id:"tableTitle",component:"div",children:t})})},ke=n(308),De=n.n(ke),we=n(622),Pe=[{id:"IVDATE",numeric:!1,disablePadding:!0,label:"Date",align:"center"},{id:"IVNUM",numeric:!0,disablePadding:!1,label:"Invoice No.",align:"center"},{id:"TOTPRICE",numeric:!0,disablePadding:!1,label:"Total Price",align:"center"},{id:"REFERENCE",numeric:!0,disablePadding:!1,label:"Cust. P.O.",align:"center"},{id:"PAYDATE",numeric:!1,disablePadding:!0,label:"Due Date",align:"center"},{id:"ACTION",numeric:!0,disablePadding:!1,label:"PDF",align:"center"}];function Ie(e){var t=e.row,n=Object(a.useState)(!1),r=Object(s.a)(n,2),i=(r[0],r[1],Object(a.useState)([])),o=Object(s.a)(i,2),l=(o[0],o[1],Object(a.useState)(!0)),u=Object(s.a)(l,2),d=(u[0],u[1],Object(fe.b)()),j=d.enqueueSnackbar;d.closeSnackbar;return Object(te.jsx)(c.a.Fragment,{children:Object(te.jsxs)(oe.a,{sx:{"& > *":{borderBottom:"unset"}},children:[Object(te.jsx)(re.a,{}),Object(te.jsx)(re.a,{component:"th",scope:"row",align:"center",children:new Date(t.IVDATE).toLocaleDateString("en-GB")}),Object(te.jsx)(re.a,{align:"center",children:t.IVNUM}),Object(te.jsxs)(re.a,{align:"center",children:[t.CODE," ",Number(t.TOTPRICE).toFixed(2)]}),Object(te.jsx)(re.a,{align:"center",children:t.REFERENCE}),Object(te.jsx)(re.a,{component:"th",scope:"row",align:"center",children:new Date(t.PAYDATE).toLocaleDateString("en-GB")}),Object(te.jsx)(re.a,{align:"center",children:Object(te.jsx)(S.a,{onClick:function(){return e=t.IVNUM,void de.downloadInvoicePdf(e).then((function(t){var n=window.URL.createObjectURL(new Blob([t.data])),a=document.createElement("a");a.href=n,a.setAttribute("download","".concat(e,".pdf")),document.body.appendChild(a),a.click()})).catch((function(e){console.log(e.response),j("File not found. Please contact system manager.",{variant:"error"})}));var e},children:Object(te.jsx)(xe.a,{})})})]})})}function Ne(){var e=Object(a.useState)("asc"),t=Object(s.a)(e,2),n=t[0],c=t[1],r=Object(a.useState)("calories"),i=Object(s.a)(r,2),o=i[0],l=i[1],u=Object(a.useState)([]),d=Object(s.a)(u,2),j=d[0],b=d[1],O=Object(a.useState)(0),m=Object(s.a)(O,2),x=m[0],f=m[1],g=Object(a.useState)(5),p=Object(s.a)(g,2),S=p[0],v=p[1],E=Object(a.useState)([]),T=Object(s.a)(E,2),C=T[0],A=T[1],y=Object(a.useState)([]),k=Object(s.a)(y,2),D=k[0],w=k[1],P=Object(a.useState)(!1),I=Object(s.a)(P,2),N=I[0],R=I[1],U=Object(a.useState)(""),L=Object(s.a)(U,2),F=L[0],M=L[1];Object(a.useEffect)((function(){de.getCustomerInvoices().then((function(e){A(e.data.value),w(e.data.value),void 0!==e.data.value&&null!==e.data.value&&R(!0)})).catch((function(e){console.log(e)}))}),[]);return N?Object(te.jsx)(h.a,{sx:{width:"100%"},children:Object(te.jsxs)(le.a,{sx:{width:"100%",mb:2},children:[Object(te.jsx)(ae.a,{children:Object(te.jsxs)(oe.a,{children:[Object(te.jsx)(re.a,{children:Object(te.jsx)(ye,{title:"Invoices"})}),Object(te.jsx)(re.a,{children:Object(te.jsx)(ge.a,{id:"search-bar",className:"text",value:F,onChange:function(e){var t=e.target.value;if(M(t),""!==t){var n;n=C.filter((function(e){return e.IVNUM.toLowerCase().includes(t.toLowerCase())})),A(n)}else A(D)},label:"Invoice Search",variant:"outlined",placeholder:"Invoice Number...",InputProps:{startAdornment:Object(te.jsx)(we.a,{position:"start",children:Object(te.jsx)(De.a,{})})},style:{height:"60px"}})})]})}),Object(te.jsx)(ie.a,{children:Object(te.jsxs)(ae.a,{sx:{minWidth:750},"aria-labelledby":"tableTitle",size:"medium",children:[Object(te.jsx)(Ae,{numSelected:j.length,order:n,orderBy:o,onSelectAllClick:function(e){if(e.target.checked){var t=C.map((function(e){return e.name}));b(t)}else b([])},onRequestSort:function(e,t){c(o===t&&"asc"===n?"desc":"asc"),l(t)},rowCount:C.length,headCells:Pe}),Object(te.jsx)(ce.a,{children:C.slice().sort(Se(n,o)).slice(x*S,x*S+S).map((function(e,t){return Object(te.jsx)(Ie,{row:e},t)}))})]})}),Object(te.jsx)(se.a,{rowsPerPageOptions:[5,10,25],component:"div",count:C.length,rowsPerPage:S,page:x,onPageChange:function(e,t){f(t)},onRowsPerPageChange:function(e){v(parseInt(e.target.value,10)),f(0)}})]})}):Object(te.jsx)(he,{})}var Re=function(){return Object(te.jsx)(v.a,{maxWidth:"lg",sx:{mt:4,mb:4},children:Object(te.jsx)(E.a,{item:!0,xs:12,children:Object(te.jsx)(Ne,{})})})},Ue=n(122),Le=n.n(Ue),Fe=n(121),Me=n.n(Fe),Be=n(644),_e=n(645),We=n(623),Ge=[{id:"CURDATE",numeric:!1,disablePadding:!0,label:"Date"},{id:"ORDNAME",numeric:!0,disablePadding:!1,label:"Order No."},{id:"REFERENCE",numeric:!0,disablePadding:!1,label:"Cust. P.O."},{id:"QPRICE",numeric:!0,disablePadding:!1,label:"Price ex. VAT"},{id:"TOTPRICE",numeric:!0,disablePadding:!1,label:"Total Price"},{id:"ORDSTATUSDES",numeric:!0,disablePadding:!1,label:"Order Status"},{id:"NAME",numeric:!1,disablePadding:!0,label:"Contact"},{id:"ACTION",numeric:!0,disablePadding:!1,label:"PDF"}];function ze(e){var t=e.row,n=Object(a.useState)(!1),r=Object(s.a)(n,2),i=r[0],o=r[1],l=Object(a.useState)([]),u=Object(s.a)(l,2),d=u[0],j=u[1],b=Object(a.useState)(!0),O=Object(s.a)(b,2),m=O[0],x=O[1],f=Object(fe.b)(),p=f.enqueueSnackbar,v=(f.closeSnackbar,function(){i?o(!i):(x(!1),de.getOrderItems(t.ORDNAME).then((function(e){j(e.data.value),x(!0),o(!i)})).catch((function(e){console.log(e)})))});return Object(te.jsxs)(c.a.Fragment,{children:[Object(te.jsxs)(oe.a,{sx:{"& > *":{borderBottom:"unset"}},children:[Object(te.jsx)(re.a,{children:m?Object(te.jsx)(S.a,{"aria-label":"expand row",size:"small",onClick:v,children:i?Object(te.jsx)(Me.a,{}):Object(te.jsx)(Le.a,{})}):Object(te.jsx)(Be.a,{size:28})}),Object(te.jsx)(re.a,{component:"th",scope:"row",children:new Date(t.CURDATE).toLocaleDateString("en-GB")}),Object(te.jsx)(re.a,{align:"center",children:t.ORDNAME}),Object(te.jsx)(re.a,{align:"center",children:t.REFERENCE}),Object(te.jsxs)(re.a,{align:"center",children:[t.CODE," ",t.QPRICE.toLocaleString()]}),Object(te.jsxs)(re.a,{align:"center",children:[t.CODE," ",t.TOTPRICE.toLocaleString()]}),Object(te.jsx)(re.a,{align:"center",children:Object(te.jsx)(We.a,{style:{color:function(e){switch(e){case"Draft":return"#00ff00";case"Confirmed":return"#fe9e00";case"In Progress":return"#5ab963";case"Completed":return"#80ffff";case"Assm Opened":case"Partial Assm":case"Assembled":return"#ff80ff";case"Paid":return"#ffff00";case"Canceled":return"#ff0000";default:return"black"}}(t.ORDSTATUSDES)},label:t.ORDSTATUSDES})}),Object(te.jsx)(re.a,{align:"center",children:t.NAME}),Object(te.jsx)(re.a,{align:"center",children:Object(te.jsx)(S.a,{onClick:function(){return e=t.ORDNAME,void de.downloadOrderPdf(e).then((function(t){var n=window.URL.createObjectURL(new Blob([t.data])),a=document.createElement("a");a.href=n,a.setAttribute("download","".concat(e,".pdf")),document.body.appendChild(a),a.click()})).catch((function(e){console.log(e.response),p("File not found. Please contact system manager.",{variant:"error"})}));var e},children:Object(te.jsx)(xe.a,{})})})]}),Object(te.jsx)(oe.a,{children:Object(te.jsx)(re.a,{style:{paddingBottom:0,paddingTop:0,paddingLeft:100,backgroundColor:"#F8F8F8"},colSpan:8,children:Object(te.jsx)(_e.a,{in:i,timeout:"auto",unmountOnExit:!0,onClick:v,children:Object(te.jsxs)(h.a,{sx:{margin:1},children:[Object(te.jsx)(g.a,{variant:"h6",gutterBottom:!0,component:"div",children:"Order Items"}),m?Object(te.jsxs)(ae.a,{size:"small","aria-label":"order-items",children:[Object(te.jsx)(Ee.a,{children:Object(te.jsxs)(oe.a,{children:[Object(te.jsx)(re.a,{children:Object(te.jsx)("b",{children:"Part No."})}),Object(te.jsx)(re.a,{children:Object(te.jsx)("b",{children:"Part Name"})}),Object(te.jsx)(re.a,{align:"right",children:Object(te.jsx)("b",{children:"Quantity"})}),Object(te.jsx)(re.a,{align:"right",children:Object(te.jsx)("b",{children:"Balance"})}),Object(te.jsx)(re.a,{align:"right",children:Object(te.jsx)("b",{children:"Price"})}),Object(te.jsx)(re.a,{align:"right",children:Object(te.jsx)("b",{children:"Total Price ex. VAT"})}),Object(te.jsx)(re.a,{align:"right",children:Object(te.jsx)("b",{children:"Total Price"})})]})}),Object(te.jsx)(ce.a,{children:d.map((function(e,t){return Object(te.jsxs)(oe.a,{children:[Object(te.jsx)(re.a,{component:"th",scope:"row",children:e.PARTNAME}),Object(te.jsx)(re.a,{children:e.PDES}),Object(te.jsx)(re.a,{align:"right",children:e.TQUANT}),Object(te.jsx)(re.a,{align:"right",children:e.TBALANCE}),Object(te.jsxs)(re.a,{align:"right",children:[e.CODE," ",e.PRICE]}),Object(te.jsxs)(re.a,{align:"right",children:[e.CODE," ",e.QPRICE]}),Object(te.jsxs)(re.a,{align:"right",children:[e.CODE," ",e.VATPRICE]})]},t)}))})]}):Object(te.jsx)(Be.a,{})]})})})})]})}function Ye(){var e=Object(a.useState)("asc"),t=Object(s.a)(e,2),n=t[0],c=t[1],r=Object(a.useState)("calories"),i=Object(s.a)(r,2),o=i[0],l=i[1],u=Object(a.useState)([]),d=Object(s.a)(u,2),j=d[0],b=(d[1],Object(a.useState)(0)),O=Object(s.a)(b,2),m=O[0],x=O[1],f=Object(a.useState)(5),g=Object(s.a)(f,2),p=g[0],S=g[1],v=Object(a.useState)([]),E=Object(s.a)(v,2),T=E[0],C=E[1],A=Object(a.useState)(!1),y=Object(s.a)(A,2),k=y[0],D=y[1];Object(a.useEffect)((function(){de.getCustomerOrders().then((function(e){C(e.data.value),D(!0)})).catch((function(e){console.log(e)}))}),[]);return k?Object(te.jsx)(h.a,{sx:{width:"100%"},children:Object(te.jsxs)(le.a,{sx:{width:"100%",mb:2},children:[Object(te.jsx)(ye,{title:"Orders"}),Object(te.jsx)(ie.a,{children:Object(te.jsxs)(ae.a,{sx:{minWidth:750},"aria-labelledby":"tableTitle",size:"medium",children:[Object(te.jsx)(Ae,{numSelected:j.length,order:n,orderBy:o,onRequestSort:function(e,t){c(o===t&&"asc"===n?"desc":"asc"),l(t)},rowCount:T.length,headCells:Ge}),Object(te.jsx)(ce.a,{children:T.slice().sort(Se(n,o)).slice(m*p,m*p+p).map((function(e,t){return Object(te.jsx)(ze,{row:e},t)}))})]})}),Object(te.jsx)(se.a,{rowsPerPageOptions:[5,10,25],component:"div",count:T.length,rowsPerPage:p,page:m,onPageChange:function(e,t){x(t)},onRowsPerPageChange:function(e){S(parseInt(e.target.value,10)),x(0)}})]})}):Object(te.jsx)(he,{})}var Ve=function(){return Object(te.jsx)(v.a,{maxWidth:"lg",sx:{mt:4,mb:4},children:Object(te.jsx)(E.a,{item:!0,xs:12,children:Object(te.jsx)(Ye,{})})})},qe=[{id:"CURDATE",numeric:!1,disablePadding:!0,label:"Date"},{id:"DOCNO",numeric:!0,disablePadding:!1,label:"Shipment No."},{id:"REFERENCE",numeric:!0,disablePadding:!1,label:"Cust. P.O."},{id:"QPRICE",numeric:!0,disablePadding:!1,label:"Price ex. VAT"},{id:"TOTPRICE",numeric:!0,disablePadding:!1,label:"Total Price"},{id:"STATDES",numeric:!0,disablePadding:!1,label:"Shipment Status"},{id:"ACTION",numeric:!0,disablePadding:!1,label:"PDF"}];function Xe(e){var t=e.row,n=Object(a.useState)(!1),r=Object(s.a)(n,2),i=r[0],o=r[1],l=Object(a.useState)([]),u=Object(s.a)(l,2),d=u[0],j=u[1],b=Object(a.useState)(!0),O=Object(s.a)(b,2),m=O[0],x=O[1],f=Object(fe.b)(),p=f.enqueueSnackbar,v=(f.closeSnackbar,function(){i?o(!i):(x(!1),de.getShipmentItems(t.DOCNO,t.TYPE).then((function(e){j(e.data.value),x(!0),o(!i)})).catch((function(e){console.log(e)})))});return Object(te.jsxs)(c.a.Fragment,{children:[Object(te.jsxs)(oe.a,{sx:{"& > *":{borderBottom:"unset"}},children:[Object(te.jsx)(re.a,{children:m?Object(te.jsx)(S.a,{"aria-label":"expand row",size:"small",onClick:v,children:i?Object(te.jsx)(Me.a,{}):Object(te.jsx)(Le.a,{})}):Object(te.jsx)(Be.a,{size:28})}),Object(te.jsx)(re.a,{component:"th",scope:"row",children:new Date(t.CURDATE).toLocaleDateString("en-GB")}),Object(te.jsx)(re.a,{align:"center",children:t.DOCNO}),Object(te.jsx)(re.a,{align:"center",children:t.REFERENCE}),Object(te.jsxs)(re.a,{align:"center",children:[t.CODE," ",t.QPRICE.toLocaleString()]}),Object(te.jsxs)(re.a,{align:"center",children:[t.CODE," ",t.TOTPRICE.toLocaleString()]}),Object(te.jsx)(re.a,{align:"center",children:Object(te.jsx)(We.a,{style:{color:function(e){switch(e){case"Draft":return"#00ff00";case"Final":return"#ffd233";case"Canceled":return"#f56b62";default:return"black"}}(t.STATDES)},label:t.STATDES})}),Object(te.jsx)(re.a,{align:"center",children:Object(te.jsx)(S.a,{onClick:function(){return e=t.DOCNO,void de.downloadShipmentPdf(e).then((function(t){var n=window.URL.createObjectURL(new Blob([t.data])),a=document.createElement("a");a.href=n,a.setAttribute("download","".concat(e,".pdf")),document.body.appendChild(a),a.click()})).catch((function(e){console.log(e.response),p("File not found. Please contact system manager.",{variant:"error"})}));var e},children:Object(te.jsx)(xe.a,{})})})]}),Object(te.jsx)(oe.a,{children:Object(te.jsx)(re.a,{style:{paddingBottom:0,paddingTop:0,paddingLeft:100,backgroundColor:"#F8F8F8"},colSpan:8,children:Object(te.jsx)(_e.a,{in:i,timeout:"auto",unmountOnExit:!0,onClick:v,children:Object(te.jsxs)(h.a,{sx:{margin:1},children:[Object(te.jsx)(g.a,{variant:"h6",gutterBottom:!0,component:"div",children:"Shipped Items"}),m?Object(te.jsxs)(ae.a,{size:"small","aria-label":"purchases",children:[Object(te.jsx)(Ee.a,{children:Object(te.jsxs)(oe.a,{children:[Object(te.jsx)(re.a,{children:Object(te.jsx)("b",{children:"Part No."})}),Object(te.jsx)(re.a,{children:Object(te.jsx)("b",{children:"Part Name"})}),Object(te.jsx)(re.a,{align:"right",children:Object(te.jsx)("b",{children:"Quantity"})}),Object(te.jsx)(re.a,{align:"right",children:Object(te.jsx)("b",{children:"Price"})}),Object(te.jsx)(re.a,{align:"right",children:Object(te.jsx)("b",{children:"Total Price ex. VAT"})})]})}),Object(te.jsx)(ce.a,{children:d.map((function(e,t){return Object(te.jsxs)(oe.a,{children:[Object(te.jsx)(re.a,{component:"th",scope:"row",children:e.PARTNAME}),Object(te.jsx)(re.a,{children:e.PDES}),Object(te.jsx)(re.a,{align:"right",children:e.TQUANT}),Object(te.jsxs)(re.a,{align:"right",children:[e.CODE," ",e.PRICE]}),Object(te.jsxs)(re.a,{align:"right",children:[e.CODE," ",e.QPRICE]})]},t)}))})]}):Object(te.jsx)(Be.a,{})]})})})})]})}function Qe(){var e=Object(a.useState)("asc"),t=Object(s.a)(e,2),n=t[0],c=t[1],r=Object(a.useState)("calories"),i=Object(s.a)(r,2),o=i[0],l=i[1],u=Object(a.useState)([]),d=Object(s.a)(u,2),j=d[0],b=d[1],O=Object(a.useState)(0),m=Object(s.a)(O,2),x=m[0],f=m[1],g=Object(a.useState)(5),p=Object(s.a)(g,2),S=p[0],v=p[1],E=Object(a.useState)([]),T=Object(s.a)(E,2),C=T[0],A=T[1],y=Object(a.useState)(!1),k=Object(s.a)(y,2),D=k[0],w=k[1];Object(a.useEffect)((function(){de.getCustomerShipments().then((function(e){A(e.data.value),w(!0)})).catch((function(e){console.log(e)}))}),[]);return D?Object(te.jsx)(h.a,{sx:{width:"100%"},children:Object(te.jsxs)(le.a,{sx:{width:"100%",mb:2},children:[Object(te.jsx)(ye,{title:"Shipments"}),Object(te.jsx)(ie.a,{children:Object(te.jsxs)(ae.a,{sx:{minWidth:750},"aria-labelledby":"tableTitle",size:"medium",children:[Object(te.jsx)(Ae,{numSelected:j.length,order:n,orderBy:o,onSelectAllClick:function(e){if(e.target.checked){var t=C.map((function(e){return e.name}));b(t)}else b([])},onRequestSort:function(e,t){c(o===t&&"asc"===n?"desc":"asc"),l(t)},rowCount:C.length,headCells:qe}),Object(te.jsx)(ce.a,{children:C.slice().sort(Se(n,o)).slice(x*S,x*S+S).map((function(e,t){return Object(te.jsx)(Xe,{row:e},t)}))})]})}),Object(te.jsx)(se.a,{rowsPerPageOptions:[5,10,25],component:"div",count:C.length,rowsPerPage:S,page:x,onPageChange:function(e,t){f(t)},onRowsPerPageChange:function(e){v(parseInt(e.target.value,10)),f(0)}})]})}):Object(te.jsx)(he,{})}var Ke=function(){return Object(te.jsx)(v.a,{maxWidth:"lg",sx:{mt:4,mb:4},children:Object(te.jsx)(E.a,{item:!0,xs:12,children:Object(te.jsx)(Qe,{})})})},He=n(40),Ze=n(613),Je=n(331),$e=n(614),et=n(609),tt=n(124),nt=n.n(tt),at=n(492),ct=n(646),rt=n(123),it=n.n(rt),st=n(309),ot=n.n(st),lt=n(310),ut=n.n(lt);function dt(e){return Number.parseFloat(e).toFixed(2)}var jt=[{id:"PARTDES",numeric:!1,disablePadding:!0,label:"Item Description"},{id:"PARTNAME",numeric:!0,disablePadding:!1,label:"Item Number"},{id:"BASEPLPRICE",numeric:!0,disablePadding:!1,label:"Price"},{id:"VAT Price",numeric:!0,disablePadding:!1,label:"VAT Price"},{id:"QUANTITY",numeric:!0,disablePadding:!1,label:"Quantity"},{id:"total-price",numeric:!0,disablePadding:!1,label:"Total Price"}];function bt(e){var t=e.order,n=e.orderBy,a=e.onRequestSort;return Object(te.jsx)(Ee.a,{children:Object(te.jsxs)(oe.a,{children:[Object(te.jsx)(re.a,{padding:"checkbox"}),jt.map((function(e){return Object(te.jsx)(re.a,{align:e.numeric?"right":"left",padding:e.disablePadding?"none":"normal",sortDirection:n===e.id&&t,children:Object(te.jsxs)(Te.a,{active:n===e.id,direction:n===e.id?t:"asc",onClick:(c=e.id,function(e){a(e,c)}),children:[Object(te.jsx)("b",{children:e.label}),n===e.id?Object(te.jsx)(h.a,{component:"span",sx:Ce.a,children:"desc"===t?"sorted descending":"sorted ascending"}):null]})},e.id);var c}))]})})}var Ot=function(e){var t=e.numSelected;return Object(te.jsxs)(x.a,{sx:Object(l.a)({pl:{sm:2},pr:{xs:1,sm:1}},t>0&&{bgcolor:function(e){return Object(at.a)(e.palette.primary.main,e.palette.action.activatedOpacity)}}),children:[t>0?Object(te.jsxs)(g.a,{sx:{flex:"1 1 100%"},color:"inherit",variant:"subtitle1",component:"div",children:[t," selected"]}):Object(te.jsx)(g.a,{sx:{flex:"1 1 100%"},variant:"h6",id:"tableTitle",component:"div",children:"Items in Order"}),t>0?Object(te.jsx)(ct.a,{title:"Delete",children:Object(te.jsx)(S.a,{onClick:e.onDelete,children:Object(te.jsx)(it.a,{})})}):Object(te.jsx)(ct.a,{title:"Filter list",children:Object(te.jsx)(S.a,{children:Object(te.jsx)(ot.a,{})})})]})};function ht(e){var t=a.useState("asc"),n=Object(s.a)(t,2),c=n[0],r=n[1],i=a.useState("calories"),o=Object(s.a)(i,2),l=o[0],u=o[1],d=a.useState([]),j=Object(s.a)(d,2),b=j[0],O=j[1],m=e.items;return Object(te.jsx)(h.a,{sx:{width:"100%"},children:Object(te.jsxs)(le.a,{sx:{width:"100%",mb:2},children:[Object(te.jsx)(Ot,{}),Object(te.jsx)(ie.a,{children:Object(te.jsxs)(ae.a,{sx:{minWidth:750},"aria-labelledby":"tableTitle",size:"medium",children:[Object(te.jsx)(bt,{numSelected:b.length,order:c,orderBy:l,onSelectAllClick:function(e){if(e.target.checked){var t=m.map((function(e){return e.PARTNAME}));O(t)}else O([])},onRequestSort:function(e,t){r(l===t&&"asc"===c?"desc":"asc"),u(t)},rowCount:m.length}),Object(te.jsxs)(ce.a,{children:[ve(m,Se(c,l)).map((function(t,n){var a,c=(a=t.PARTNAME,-1!==b.indexOf(a)),r="enhanced-table-checkbox-".concat(n);return Object(te.jsxs)(oe.a,{hover:!0,role:"checkbox","aria-checked":c,tabIndex:-1,selected:c,children:[Object(te.jsx)(re.a,{padding:"checkbox"}),Object(te.jsx)(re.a,{component:"th",id:r,scope:"row",padding:"none",children:t.PARTDES}),Object(te.jsx)(re.a,{align:"right",children:t.PARTNAME}),Object(te.jsxs)(re.a,{align:"right",children:[t.BASEPLCODE," ",dt(t.BASEPLPRICE)]}),Object(te.jsxs)(re.a,{align:"right",children:[t.BASEPLCODE," ",dt(t.VATPRICE)]}),Object(te.jsxs)(re.a,{align:"right",children:[Object(te.jsx)(S.a,{onClick:function(n){return e.onDecrement(t,n)},children:Object(te.jsx)(ut.a,{})}),t.QUANTITY,Object(te.jsx)(S.a,{onClick:function(n){return e.onIncrement(t,n)},children:Object(te.jsx)(nt.a,{})})]}),Object(te.jsxs)(re.a,{align:"right",children:[t.BASEPLCODE," ",dt(t.VATPRICE*t.QUANTITY)]})]},n)})),Object(te.jsxs)(oe.a,{children:[Object(te.jsx)(re.a,{colSpan:6,align:"right",children:Object(te.jsx)("b",{children:"Total Price"})}),Object(te.jsx)(re.a,{align:"right",children:function(){for(var e=0,t=0;t0){var n=p.findIndex((function(e){return e.PARTNAME===u.PARTNAME}));console.log(u.PARTNAME),n>-1?(t[n].QUANTITY=parseInt(u.QUANTITY)+parseInt(O),S(t)):(u.QUANTITY=O,S((function(e){return[].concat(Object(je.a)(e),[u])})))}else console.log("Quantity must be greater than 0.")},children:"Add"})}),Object(te.jsx)(E.a,{item:!0,md:12,children:Object(te.jsx)(ht,{items:p,onDecrement:function(e){var t=Object(je.a)(p),n=p.findIndex((function(t){return t.PARTNAME===e.PARTNAME}));1===t[n].QUANTITY?t.splice(n,1):t[n].QUANTITY-=1,S(t)},onIncrement:function(e){var t=Object(je.a)(p),n=p.findIndex((function(t){return t.PARTNAME===e.PARTNAME}));t[n].QUANTITY=parseInt(t[n].QUANTITY)+1,S(t)}})}),Object(te.jsx)(E.a,{item:!0,md:12,children:Object(te.jsx)(Je.a,{disabled:0===p.length,onClick:function(){console.log(p);for(var e=Object(je.a)(p),t=[],n=0;n0?r.map((function(e,t){return Object(te.jsxs)(ft.a,{onClick:function(){return 0===e.READ?function(e,t){de.setNotificationRead({ID:e}).then((function(e){var n=Object(je.a)(r);n[t].READ=1,i(n),console.log(r)})).catch((function(e){console.log(e)}))}(e.ID,t):null},selected:0===e.READ,children:[Object(te.jsx)(D.a,{children:Object(te.jsx)(It.a,{fontSize:"small"})}),Object(te.jsxs)(w.a,{children:[e.ORDNAME," has been changed to ",e.ORDSTATUSDES," ",x.format(new Date(e.DATE))]})]},t)})):Object(te.jsx)(g.a,{children:"No notifications."})})]}):Object(te.jsx)(Be.a,{})}var Lt=n(28),Ft=n.n(Lt),Mt=n(42),Bt=n(647),_t=n(648),Wt=n(125),Gt=n(99),zt=n.n(Gt),Yt=n(181),Vt=n.n(Yt),qt=n(43),Xt=(n(223),n(295),n(128)),Qt=n(504);function Kt(){var e=c.a.useState(!0),t=Object(s.a)(e,2),n=t[0];t[1];return Object(te.jsx)("div",{children:Object(te.jsx)(Qt.a,{sx:{color:"#fff",zIndex:function(e){return e.zIndex.drawer+1}},open:n,children:Object(te.jsx)(Be.a,{color:"inherit"})})})}var Ht=function(e){return{sx:{bgcolor:Jt(e),fontSize:16,width:30,height:30},children:Zt(e)}},Zt=function(e){var t=e.charAt(0),n=e.charAt(e.length-1);return t.toUpperCase()+n.toUpperCase()},Jt=function(e){var t,n=0;for(t=0;t>8*t&255).toString(16)).slice(-2)}return a},$t=function(e){return new Date(e).toLocaleDateString("en-GB",{month:"short",day:"numeric"})},en=function(e){return new Promise((function(t,n){return function(e,t){var n=new FileReader;n.readAsDataURL(e),n.onload=function(){return t(n.result)},n.onerror=function(e){}}(e,(function(e){return t({data:{link:e}})}))}))},tn=function(e,t,n){var a=document.createElement("a");a.href=e,a.download=t+"."+n,a.click()},nn=n(312),an=n.n(nn),cn=function(e){return Object(te.jsx)(E.a,{item:!0,md:3,children:Object(te.jsx)(Bt.a,{children:Object(te.jsx)(_t.a,{children:Object(te.jsxs)(g.a,{sx:{fontSize:14},gutterBottom:!0,children:[Object(te.jsxs)("b",{children:[e.subject,":"]})," ",e.info]})})})})},rn=function(){var e,t=Object(fe.b)(),n=t.enqueueSnackbar,r=(t.closeSnackbar,Object(a.useState)(!1)),i=Object(s.a)(r,2),o=i[0],l=i[1],u=Object(He.h)().docno,d=Object(a.useState)(null),j=Object(s.a)(d,2),b=j[0],O=j[1],h=Object(a.useState)(null),m=Object(s.a)(h,2),x=m[0],f=m[1],p=Object(a.useState)(!0),T=Object(s.a)(p,2),C=T[0],A=T[1],y=Object(a.useState)(0),k=Object(s.a)(y,2),D=(k[0],k[1],Object(a.useState)(W.getCurrentUser().name)),w=Object(s.a)(D,2),P=w[0],I=(w[1],Object(a.useState)([])),N=Object(s.a)(I,2),R=N[0],U=N[1],L=Object(Xt.a)({accept:"*",readAs:"DataURL"}),F=Object(s.a)(L,2),M=F[0],B=F[1],_=(B.plainFiles,B.filesContent),G=B.clear,z=Object(a.useState)([]),Y=Object(s.a)(z,2),V=Y[0],q=Y[1],X=Object(a.useState)(!0),Q=Object(s.a)(X,2),K=(Q[0],Q[1],Object(a.useState)(!1)),H=Object(s.a)(K,2),Z=H[0],J=H[1],$=function(e){console.info(_[0]),G(),U([])},ee=(qt.EditorState.createEmpty(),c.a.useState()),ne=Object(s.a)(ee,2),ae=ne[0],ce=ne[1],re=function(){var e=Object(Mt.a)(Ft.a.mark((function e(){var t,n,a,c;return Ft.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,de.getServiceCall(u);case 2:if(1!==(t=e.sent.data).value.length){e.next=21;break}return e.next=6,de.getStatusLang2(t.value[0].CALLSTATUSCODE);case 6:return n=e.sent.data,e.next=9,de.getSCAttachments(u);case 9:return a=e.sent.data.value,t.ESTATDES=n.value[0].ESTATDES,t.CHANGEFLAG=n.value[0].CHANGEFLAG,O(t),e.next=15,de.getServiceCallExternalRemarks(u);case 15:c=e.sent.data,f(c),q(a),A(!1),e.next=22;break;case 21:J(!0);case 22:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();Object(a.useEffect)(Object(Mt.a)(Ft.a.mark((function e(){return Ft.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:re();case 1:case"end":return e.stop()}}),e)}))),[C]),Object(a.useEffect)((function(){if(_){var e=_;U((function(t){return t.concat(e)}))}}),[_]);return Object(te.jsx)(te.Fragment,{children:C&&!1===Z?Object(te.jsx)(Kt,{}):Z?Object(te.jsx)("div",{children:Object(te.jsx)("p",{children:Object(te.jsx)(et.a,{severity:"error",children:Object(te.jsx)("b",{children:"Sorry!..Invalid Service Call Number"})})})}):Object(te.jsxs)(v.a,{maxWidth:"lg",sx:{mt:4,mb:4},children:[Object(te.jsxs)(E.a,{container:!0,spacing:1,direction:"row",alignItems:"center",children:[Object(te.jsx)(cn,{subject:"Ticket Number",info:b.value[0].DOCNO}),Object(te.jsx)(cn,{subject:"Subject",info:b.value[0].ZEMG_SVC_DETAILS}),Object(te.jsx)(cn,{subject:"Customer",info:b.value[0].CDES}),Object(te.jsx)(cn,{subject:"Contact",info:b.value[0].NAME}),Object(te.jsx)(cn,{subject:"Type of Call ",info:b.value[0].CALLTYPECODE}),Object(te.jsx)(cn,{subject:"Cust. Reference",info:b.value[0].REFERENCE}),Object(te.jsx)(cn,{subject:"Status",info:null!==(e=b.value[0].ESTATDES)&&void 0!==e?e:b.value[0].CALLSTATUSCODE})]}),"Y"===b.CHANGEFLAG?Object(te.jsxs)(te.Fragment,{children:[Object(te.jsx)(Bt.a,{sx:{mt:2,mb:2},children:Object(te.jsxs)(_t.a,{children:[Object(te.jsxs)("div",{sx:{display:"flex",flexDirection:"row"},children:[Object(te.jsx)(g.a,{sx:{fontSize:14},gutterBottom:!0,children:Object(te.jsx)("b",{children:"Add a Comment"})}),Object(te.jsx)(S.a,{children:Object(te.jsx)(an.a,{})})]}),Object(te.jsx)(Wt.Editor,{wrapperClassName:"wrapperClassName",editorState:ae,editorStyle:{overflow:"hidden",minHeight:"20vh"},onEditorStateChange:function(e){ce(e)},toolbar:{image:{uploadCallback:en,previewImage:!0}}})]})}),Object(te.jsx)(Je.a,{onClick:function(){return M()},variant:"outlined",startIcon:Object(te.jsx)(Vt.a,{}),children:"Add File"}),Object(te.jsx)(Je.a,{variant:"contained",sx:{marginLeft:"77.5%"},onClick:function(){if(1===Object(qt.convertToRaw)(ae.getCurrentContent()).blocks.length&""===Object(qt.convertToRaw)(ae.getCurrentContent()).blocks[0].text)n("You can not submit an empty comment.",{variant:"error"});else{l(!0);var e=qt.EditorState.createEmpty();ce(e);var t,a=(new Date).toLocaleString("en-GB"),c=[];for(var r in _){var i={EXTFILEDES:_[r].name.split(".")[0],EXTFILENAME:_[r].content};"msg"===_[r].name.split(".")[1]&&(i.SUFFIX=".msg"),"lic"===_[r].name.split(".")[1]&&(i.SUFFIX=".lic"),c.push(i)}t=0!==c.length?a+zt()(Object(qt.convertToRaw)(ae.getCurrentContent()))+"
"+c.length+" files attached.
"+"

".concat(P,"


"):a+zt()(Object(qt.convertToRaw)(ae.getCurrentContent()))+"

".concat(P,"


");b.CALLSTATUSCODE;var s={DOCNO:u,TEXT:t,APPEND:!0,SIGNATURE:!1,EXTFILES:c};de.updateServiceCall(s).then((function(e){n("Service call updated succesfully.",{variant:"success"}),l(!1),$(),A(!0)})).catch((function(e){n("Error updating service call.",{variant:"error"}),l(!1),$(),A(!0)}))}},children:"Update Ticket"})]}):null,0!=(null===R||void 0===R?void 0:R.length)?Object(te.jsx)(S.a,{color:"error","aria-label":"delete",component:"label",children:Object(te.jsx)(it.a,{onClick:$})}):Object(te.jsx)(te.Fragment,{}),null===R||void 0===R?void 0:R.map((function(e,t){return Object(te.jsx)(We.a,{label:e.name})})),1==C||1==o?Object(te.jsx)(Kt,{}):null,Object(te.jsx)(Bt.a,{sx:{mt:2},children:Object(te.jsxs)(_t.a,{children:[Object(te.jsx)(g.a,{sx:{fontSize:14},gutterBottom:!0,children:Object(te.jsx)("b",{children:"Description"})}),Object(te.jsx)("div",{style:{overflow:"auto"},dangerouslySetInnerHTML:{__html:x.TEXT.replaceAll("../../system/mail/","https://priority.medatecherp.co.uk/primail/")}})]})}),Object(te.jsx)(Bt.a,{sx:{mt:2},children:Object(te.jsxs)(_t.a,{children:[Object(te.jsx)(g.a,{sx:{fontSize:14},gutterBottom:!0,children:Object(te.jsx)("b",{children:"Attachments"})}),null===V||void 0===V?void 0:V.map((function(e,t){return Object(te.jsx)(We.a,{label:e.EXTFILEDES+"."+e.SUFFIX,color:"primary",size:"small",sx:{mr:1,mb:1},onClick:function(){return tn(e.EXTFILENAME,e.EXTFILEDES,e.SUFFIX)}},t)}))]})})]})})},sn=(n(484),n(485),n(486),n(487),n(14)),on=n(324),ln=n(83),un=n(97),dn=n(313),jn=(n(488),n(649)),bn=n(608),On=function(){var e=Object(a.useState)(null),t=Object(s.a)(e,2),n=t[0],c=t[1],r=Object(a.useState)(null),i=Object(s.a)(r,2),o=i[0],u=i[1],d=Object(a.useState)(!0),j=Object(s.a)(d,2),b=j[0],O=j[1],h=Object(a.useState)({global:{value:null,matchMode:sn.a.CONTAINS},DOCNO:{operator:sn.b.AND,constraints:[{value:null,matchMode:sn.a.STARTS_WITH}]},ZEMG_SVC_DETAILS:{operator:sn.b.AND,constraints:[{value:null,matchMode:sn.a.STARTS_WITH}]},REFERENCE:{operator:sn.b.AND,constraints:[{value:null,matchMode:sn.a.STARTS_WITH}]},NAME:{operator:sn.b.AND,constraints:[{value:null,matchMode:sn.a.STARTS_WITH}]},STARTDATE:{operator:sn.b.AND,constraints:[{value:null,matchMode:sn.a.DATE_IS}]},CALLTYPECODE:{operator:sn.b.AND,constraints:[{value:null,matchMode:sn.a.EQUALS}]},CDES:{operator:sn.b.OR,constraints:[{value:null,matchMode:sn.a.EQUALS}]},CALLSTATUSCODE:{operator:sn.b.AND,constraints:[{value:null,matchMode:sn.a.EQUALS}]},STATUSDATE:{operator:sn.b.AND,constraints:[{value:null,matchMode:sn.a.DATE_IS}]}}),m=Object(s.a)(h,2),x=m[0],f=m[1],g=Object(a.useState)(""),p=Object(s.a)(g,2),S=p[0],v=p[1],E=Object(a.useState)(!0),T=Object(s.a)(E,2),C=T[0],A=T[1];Object(a.useEffect)((function(){console.log("Use effect"),de.getServiceCalls().then((function(e){u(y(e.data.value)),de.getCallStatuses().then((function(e){c(e.data.value),A(!1)})).catch((function(e){console.log(e)}))})).catch((function(e){console.log(e)}))}),[]);var y=function(e){return Object(je.a)(e||[]).map((function(e){return e.STARTDATE=new Date(e.STARTDATE),e.STATUSDATE=new Date(e.STATUSDATE),e}))},k=function(e){return e.toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"numeric"})},D=function(e){var t=e.target.value,n=Object(l.a)({},x);n.global.value=t,f(n),v(t)},w=function(e){return Object(te.jsx)(dn.a,{value:e.value,onChange:function(t){return e.filterCallback(t.value,e.index)},dateFormat:"dd/mm/yy",placeholder:"dd/mm/yyyy",mask:"99/99/9999"})},P=function(e){O(e.target.checked)},I=Object(te.jsxs)(te.Fragment,{children:[Object(te.jsx)("h5",{className:"m-0",children:"Service Calls"}),Object(te.jsx)(jn.a,{control:Object(te.jsx)(bn.a,{onChange:P,checked:b,name:"gilad"}),label:"Show Only Active Tickets"})," ",Object(te.jsxs)("span",{className:"p-input-icon-left",children:[Object(te.jsx)("i",{className:"pi pi-search"}),Object(te.jsx)(un.a,{value:S,onChange:D,placeholder:"Keyword Search"})]})]});return C?Object(te.jsx)(he,{}):Object(te.jsx)("div",{className:"datatable-doc-demo",children:Object(te.jsx)("div",{className:"card",children:Object(te.jsxs)(on.a,{value:function(e,t){return(b?e.filter((function(e){return"Y"===e.ACTIVEFLAG})):e).map((function(e){var n=t.find((function(t){return t.CODE===e.CALLSTATUSCODE}));return n&&n.ESTATDES?Object(l.a)(Object(l.a)({},e),{},{CALLSTATUSCODE:n.ESTATDES}):e}))}(o,n),paginator:!0,className:"p-datatable-customers",header:I,rows:10,breakpoint:"960px",paginatorTemplate:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown",rowsPerPageOptions:[10,25,50],dataKey:"id",rowHover:!0,filters:x,filterDisplay:"menu",loading:C,responsiveLayout:"stack",globalFilterFields:["DOCNO","ZEMG_SVC_DETAILS","REFERENCE","NAME","STARTDATE","ZEMG_SEVDES","CALLTYPECODE","CALLSTATUSCODE","STATUSDATE"],emptyMessage:"No service calls found.",currentPageReportTemplate:"Showing {first} to {last} of {totalRecords} entries",children:[Object(te.jsx)(ln.a,{field:"DOCNO",header:"Ticket ID",filterField:"DOCNO",sortable:!0,body:function(e){return Object(te.jsx)(U.b,{style:{textDecoration:"none",color:"blue"},to:"/dashboard/servicecall/".concat(e.DOCNO),sx:{mt:3},children:e.DOCNO})},filter:!0,filterPlaceholder:"Search by Ticket ID"}),Object(te.jsx)(ln.a,{field:"ZEMG_SVC_DETAILS",header:"Subject",sortable:!0,filter:!0,filterPlaceholder:"Search by Subject"}),Object(te.jsx)(ln.a,{field:"REFERENCE",header:"Cust. Ref",sortable:!0,filter:!0,filterPlaceholder:"Search by Reference"}),Object(te.jsx)(ln.a,{field:"NAME",header:"Contact",sortable:!0,filter:!0,filterPlaceholder:"Search by Contact"}),Object(te.jsx)(ln.a,{field:"STARTDATE",header:"Open Date",sortable:!0,filterField:"STARTDATE",dataType:"date",body:function(e){return k(e.STARTDATE)},filter:!0,filterPlaceholder:"Search by Open Date",filterElement:w}),Object(te.jsx)(ln.a,{field:"CALLTYPECODE",header:"Classification",sortable:!0,filter:!0,filterPlaceholder:"Search by Classification"}),Object(te.jsx)(ln.a,{field:"ZEMG_SEVDES",header:"Call Severity",sortable:!0,filter:!0,filterPlaceholder:"Search by Call Severity"}),Object(te.jsx)(ln.a,{field:"CALLSTATUSCODE",header:"Status",sortable:!0,filter:!0,filterPlaceholder:"Search by Status"}),Object(te.jsx)(ln.a,{field:"STATUSDATE",header:"Update Date",sortable:!0,filterField:"STATUSDATE",dataType:"date",body:function(e){return k(e.STATUSDATE)},filter:!0,filterPlaceholder:"Search by Update Date",filterElement:w})]})})})},hn=function(){return Object(te.jsx)(v.a,{maxWidth:!1,sx:{mt:4,mb:4},children:Object(te.jsx)(On,{})})};function mn(e){var t=e.items,n=e.onChange,c=e.labelname,r=e.title,i=e.description,o=e.required,u=e.disabled,d=a.useState(!1),j=Object(s.a)(d,2),b=j[0],O=j[1],h=b&&0===t.length;return Object(te.jsx)(Ze.a,{sx:{m:1},disabled:u,fullWidth:!0,open:b,onOpen:function(){O(!0)},onClose:function(){O(!1)},onChange:n,isOptionEqualToValue:function(e,t){return""===c?e===t:e[c]===t[c]},getOptionLabel:function(e){return""===c?e+(i?": "+e[i]:""):e[c]+(i?": "+e[i]:"")},options:t,loading:h,renderInput:function(e){return Object(te.jsx)(ge.a,Object(l.a)(Object(l.a)({required:o},e),{},{label:r,InputProps:Object(l.a)(Object(l.a)({},e.InputProps),{},{endAdornment:Object(te.jsxs)(a.Fragment,{children:[h?Object(te.jsx)(Be.a,{color:"inherit",size:20}):null,e.InputProps.endAdornment]})})}))}})}var xn=function(e){var t=Object(a.useState)(!0),n=Object(s.a)(t,2),c=n[0],r=n[1],i=Object(a.useState)(""),o=Object(s.a)(i,2),l=o[0],u=o[1],d=Object(a.useState)([]),j=Object(s.a)(d,2),b=j[0],O=j[1],h=Object(a.useState)([]),m=Object(s.a)(h,2),x=m[0],f=m[1],p=Object(a.useState)([]),T=Object(s.a)(p,2),C=T[0],A=T[1],y=Object(a.useState)(),k=Object(s.a)(y,2),D=k[0],w=k[1],P=Object(fe.b)(),I=P.enqueueSnackbar,N=(P.closeSnackbar,qt.EditorState.createEmpty()),R=Object(a.useState)(""),U=Object(s.a)(R,2),L=U[0],F=U[1],M=Object(a.useState)(N),B=Object(s.a)(M,2),_=B[0],G=B[1],z=Object(a.useState)(W.getCurrentUser().name),Y=Object(s.a)(z,2),V=Y[0],q=(Y[1],Object(Xt.a)({accept:"*",readAs:"DataURL"})),X=Object(s.a)(q,2),Q=X[0],K=X[1],H=K.plainFiles,Z=K.filesContent,J=K.clear,$=Object(a.useState)(!1),ee=Object(s.a)($,2),ne=ee[0],ae=ee[1],ce=Object(a.useState)(""),re=Object(s.a)(ce,2),ie=re[0],se=re[1];Object(a.useEffect)((function(){var e=function(){var e=Object(Mt.a)(Ft.a.mark((function e(){var t,n;return Ft.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,de.getCallSeverities();case 2:t=e.sent,n=t.data.value.filter((function(e){return"Undefined"!==e.SEVDES})),O(n);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),t=function(){var e=Object(Mt.a)(Ft.a.mark((function e(){var t;return Ft.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,de.getCustomerContacts();case 2:t=e.sent,f(t.data.value);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();t().catch(console.error),e().catch(console.error),r(!1)}),[c]);return Object(te.jsxs)(v.a,{maxWidth:"lg",sx:{mt:4,mb:4},children:[""!=ie?Object(te.jsx)(He.a,{to:"/dashboard/servicecall/".concat(ie)}):null,1==c||1==ne?Object(te.jsx)(Kt,{}):null,Object(te.jsxs)(E.a,{container:!0,spacing:2,children:[Object(te.jsx)(E.a,{item:!0,md:8,children:Object(te.jsx)(ge.a,{sx:{m:1},fullWidth:!0,required:!0,onChange:function(e){return F(e.target.value)},label:"Subject",inputProps:{maxLength:48}})}),Object(te.jsx)(E.a,{item:!0,md:4,children:Object(te.jsx)(ge.a,{sx:{m:1},fullWidth:!0,onChange:function(e){return u(e.target.value)},label:"Customer's Reference",inputProps:{maxLength:12}})}),Object(te.jsx)(E.a,{item:!0,md:4,children:Object(te.jsx)(mn,{required:!0,title:"Call Severity",labelname:"SEVDES",items:b,onChange:function(e,t){return w(t)}})}),Object(te.jsx)(E.a,{item:!0,md:4,children:Object(te.jsx)(mn,{required:!0,title:"Contact",labelname:"NAME",items:x,onChange:function(e,t){return A(t)}})}),Object(te.jsxs)(E.a,{item:!0,md:12,children:[Object(te.jsx)(Bt.a,{sx:{mt:2},children:Object(te.jsxs)(_t.a,{children:[Object(te.jsx)(g.a,{sx:{fontSize:14},gutterBottom:!0,children:Object(te.jsx)("b",{children:"Details"})}),Object(te.jsx)(Wt.Editor,{wrapperClassName:"wrapperClassName",editorStyle:{overflow:"hidden",minHeight:"40vh"},editorState:_,onEditorStateChange:function(e){G(e)},toolbar:{image:{uploadCallback:en,previewImage:!0}}})]})}),Object(te.jsx)("p",{}),Object(te.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[Object(te.jsx)(Je.a,{onClick:function(){return Q()},variant:"outlined",startIcon:Object(te.jsx)(Vt.a,{}),children:"Add File"}),Object(te.jsx)(Je.a,{variant:"contained",onClick:function(){if(1===Object(qt.convertToRaw)(_.getCurrentContent()).blocks.length&""===Object(qt.convertToRaw)(_.getCurrentContent()).blocks[0].text)I("You can not submit an empty comment.",{variant:"error"});else if(/^ *$/.test(L))I("Please fill out the Subject field.",{variant:"error"});else if(void 0!=(null===D||void 0===D?void 0:D.SEV))if(void 0!=(null===C||void 0===C?void 0:C.NAME)){ae(!0);var e,t=(new Date).toLocaleString("en-GB"),n=[];for(var a in Z){var c={EXTFILEDES:Z[a].name.split(".")[0],EXTFILENAME:Z[a].content};"msg"===Z[a].name.split(".")[1]&&(c.SUFFIX=".msg"),"lic"===Z[a].name.split(".")[1]&&(c.SUFFIX=".lic"),n.push(c)}e=0!==n.length?t+zt()(Object(qt.convertToRaw)(_.getCurrentContent()))+"
"+n.length+" files attached.
"+"

".concat(V,"


"):t+zt()(Object(qt.convertToRaw)(_.getCurrentContent()))+"

".concat(V,"


");var i={DETAILS:L,CALLTYPECODE:"From Portal",ZEMG_SEVNAME:null===D||void 0===D?void 0:D.SEVNAME,TEXT:e,APPEND:!0,SIGNATURE:!1,REFERENCE:l,NAME:null===C||void 0===C?void 0:C.NAME,EXTFILES:n};de.CreateServiceCall(i).then((function(e){void 0!=e.data.DOCNO?(I("Service Call ".concat(e.data.DOCNO," successfully created!"),{variant:"success"}),J(),r(!0),se(e.data.DOCNO)):(I("Error creating service call.",{variant:"error"}),ae(!1))})).catch((function(e){e.response.data.message?I(e.response.data.message,{variant:"error"}):I("Error creating service call.",{variant:"error"}),ae(!1)}))}else I("Please select a Contact.",{variant:"error"});else I("Please select a Call Severity.",{variant:"error"})},children:"Submit"})]}),0!=H.length?Object(te.jsx)(S.a,{color:"error","aria-label":"delete",component:"label",children:Object(te.jsx)(it.a,{onClick:function(e){J()}})}):Object(te.jsx)(te.Fragment,{}),H.map((function(e,t){return Object(te.jsx)(We.a,{label:e.name})}))]})]})]})},fn=n(600),gn=n(650),pn=n(500),Sn=n(233),vn=n(506),En=n(505),Tn=n(185),Cn=n.n(Tn),An=n(314),yn=n.n(An),kn=n(191),Dn=n(598),wn=n(183);function Pn(e){var t=e.open,n=e.description,c=e.loading,r=e.attachments,i=e.handleClose,o=(e.refreshTasks,e.handleTaskStatusChange),u=e.task,d=u.SUBJECT,j=u.STATDES,b=u.USERLOGIN,O=(u.CUSTNOTETYPEDES,u.CUSTNOTE),h=(u.EXTFILEFLAG,u.CURDATE),m=u.TILLDATE,x=u.STIME,f=u.ETIME,p=u.WBS,v=u.ACTDES,E=[b,u.USERLOGIN2,u.USERLOGIN3,u.USERLOGIN4,u.USERLOGIN5,u.USERLOGIN6,u.USERLOGIN7,u.USERLOGIN8],T=Object(kn.a)("div")({marginBottom:16}),C=Object(a.useState)(!1),A=Object(s.a)(C,2),y=A[0],k=A[1],D=Object(fe.b)(),w=(D.enqueueSnackbar,D.closeSnackbar,Object(wn.b)());return Object(te.jsx)("div",{children:Object(te.jsxs)(pn.a,{open:t,onClose:i,scroll:"paper","aria-labelledby":"scroll-dialog-title","aria-describedby":"scroll-dialog-description",children:[Object(te.jsx)("div",{children:Object(te.jsxs)(En.a,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",fontWeight:"bold"},id:"scroll-dialog-title",children:[null!==d&&void 0!==d?d:"Task Subject",Object(te.jsx)(ct.a,{placement:"right",title:"Cancel task.",children:Object(te.jsx)(S.a,{disabled:y,onClick:function(){w({description:"This will cancel the task."}).then((function(){k(!0),o(j,"Cancelled",O),i()})).catch((function(){console.log("Confirmation declined.")}))},color:"error","aria-label":"cancel-task",component:"label",children:Object(te.jsx)(Dn.a,{})})})]})}),c?Object(te.jsx)(be.a,{}):null,Object(te.jsxs)(Sn.a,{dividers:!c,sx:{minHeight:"50vh",minWidth:"30vw"},children:[Object(te.jsxs)(T,{children:[Object(te.jsx)(g.a,{variant:"subtitle2",children:"Members"}),Object(te.jsx)("div",{style:{display:"flex",flexDirection:"row"},children:null===E||void 0===E?void 0:E.filter((function(e){return e})).map((function(e,t){return Object(te.jsx)(ct.a,{style:{marginRight:8},title:e,children:Object(te.jsx)(gt.a,Object(l.a)({},Ht(e)))},t)}))})]}),p?Object(te.jsxs)(T,{children:[Object(te.jsx)(g.a,{variant:"subtitle2",children:"WBS"}),Object(te.jsx)(g.a,{children:p+": "+v})]}):null,Object(te.jsxs)(T,{children:[Object(te.jsx)(g.a,{variant:"subtitle2",children:"Dates"}),Object(te.jsx)(ct.a,{placement:"left",title:"Start and end date.",children:Object(te.jsx)(We.a,{icon:Object(te.jsx)(yn.a,{}),size:"small",label:$t(h)+" - "+$t(m)})}),Object(te.jsx)(ct.a,{sx:{ml:1},placement:"right",title:"Start and end time.",children:Object(te.jsx)(We.a,{icon:Object(te.jsx)(Cn.a,{}),size:"small",label:x+" - "+f})})]}),Object(te.jsxs)(T,{children:[Object(te.jsx)(g.a,{variant:"subtitle2",children:"Description"}),Object(te.jsx)(vn.a,{id:"scroll-dialog-description",tabIndex:-1,children:c?Object(te.jsx)(Oe.a,{}):Object(te.jsx)("div",{dangerouslySetInnerHTML:{__html:n}})})]})]}),r.length>0?Object(te.jsxs)(Sn.a,{dividers:!0,children:[Object(te.jsx)(g.a,{children:"Attachments"}),null===r||void 0===r?void 0:r.map((function(e,t){return Object(te.jsx)(We.a,{label:e.EXTFILEDES+"."+e.SUFFIX,color:"primary",size:"small",sx:{mr:1,mb:1},onClick:function(){return tn(e.EXTFILENAME,e.EXTFILEDES,e.SUFFIX)}},t)}))]}):null]})})}var In=n(315),Nn=n.n(In),Rn=function(e){var t,n=e.task,c=n.SUBJECT,r=n.USERLOGIN,i=n.CUSTNOTETYPEDES,o=n.CUSTNOTE,u=n.EXTFILEFLAG,d=n.CURDATE,j=n.TILLDATE,b=n.ACTDES,O=(n.STIME,n.ETIME,n.WBS),h=n.USERLOGIN2,m=n.USERLOGIN3,x=n.USERLOGIN4,f=n.USERLOGIN5,p=n.USERLOGIN6,S=n.USERLOGIN7,v=n.USERLOGIN8,E=n.ZMED_TASKSIZENAME,T=e.refreshTasks,C=e.handleTaskStatusChange,A=[r,h,m,x,f,p,S,v],y=Object(a.useState)(!1),k=Object(s.a)(y,2),D=k[0],w=k[1],P=Object(a.useState)("There is no description."),I=Object(s.a)(P,2),N=I[0],R=I[1],U=Object(a.useState)([]),L=Object(s.a)(U,2),F=L[0],M=L[1],B=Object(a.useState)(!1),_=Object(s.a)(B,2),W=_[0],G=_[1],z=function(){G(!0),de.getTaskExplanation(o).then((function(e){e.data.hasOwnProperty("error")?(console.log(e.data),R("There is no description."),G(!1)):(R(e.data.TEXT),console.log(e.data),G(!1))})).catch((function(e){console.log(e),G(!1)}))},Y=function(){de.getTaskAttachments(o).then((function(e){e.data.hasOwnProperty("error")?console.log(e.data):(console.log(e.data),M(e.data.value))})).catch((function(e){console.log(e)}))};return Object(te.jsxs)(Bt.a,{onClick:function(){D||(z(),"Y"===u&&Y(),w(!0))},sx:{mb:2},children:[Object(te.jsx)(Pn,{open:D,description:N,handleClose:function(){w(!1)},task:e.task,loading:W,attachments:F,refreshTasks:T,handleTaskStatusChange:C}),Object(te.jsxs)(_t.a,{sx:{display:"flex",flexDirection:"column"},children:[Object(te.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Object(te.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[i?Object(te.jsx)(ct.a,{enterDelay:500,placement:"top",title:"Task type.",children:Object(te.jsx)(We.a,{label:i,color:"primary",size:"small",sx:{bgcolor:Jt(i),mr:1}})}):null,E?Object(te.jsx)(ct.a,{enterDelay:500,placement:"top",title:"Task size.",children:Object(te.jsx)(We.a,{label:E,color:"primary",size:"small",sx:{bgcolor:(t=E,"S"===t?"#00FF00":"M"===t?"#FFA500":"L"===t?"#FF0000":"XL"===t?"#8b0000":void 0)}})}):null]}),u?Object(te.jsx)(ct.a,{enterDelay:500,placement:"top",title:"Includes attachments.",children:Object(te.jsx)(Nn.a,{color:"disabled"})}):null]}),Object(te.jsx)(g.a,{sx:{fontWeight:"bold",mt:1},component:"div",children:null!==c&&void 0!==c?c:"Task Subject"}),Object(te.jsx)(g.a,{sx:{mb:1},variant:"subtitle2",children:null!=O?O+": "+b:null}),Object(te.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Object(te.jsx)(ct.a,{enterDelay:500,title:"Start and end date.",children:Object(te.jsx)(We.a,{icon:Object(te.jsx)(Cn.a,{}),size:"small",label:$t(d)+" - "+$t(j)})}),Object(te.jsx)(gn.a,{sx:{"& .MuiAvatar-root":{width:30,height:30,fontSize:16}},max:2,children:null===A||void 0===A?void 0:A.filter((function(e){return e})).map((function(e,t){return Object(te.jsx)(ct.a,{title:e,children:Object(te.jsx)(gt.a,Object(l.a)({},Ht(e)))},t)}))})]})]})]})},Un=n(126),Ln=n(507),Fn=n(603),Mn=n(325),Bn=n(227),_n=n(73),Wn=n.n(_n),Gn=n(599);function zn(e){var t=e.disabled,n=e.taskTypes,c=e.taskSizes,r=e.users,i=e.projectWBS,o=e.project,u=e.handleUpdateTasks,d=e.STATDES,j=Object(a.useState)(!1),b=Object(s.a)(j,2),O=b[0],h=b[1],m=Object(a.useState)(!1),x=Object(s.a)(m,2),f=x[0],p=x[1],E=Object(a.useState)(),T=Object(s.a)(E,2),C=T[0],A=T[1],y=Object(a.useState)(),k=Object(s.a)(y,2),D=k[0],w=k[1],P=Object(a.useState)(),I=Object(s.a)(P,2),N=I[0],R=I[1],U=Object(a.useState)(),L=Object(s.a)(U,2),F=L[0],M=L[1],B=Object(a.useState)(),_=Object(s.a)(B,2),W=_[0],G=_[1],z=Object(a.useState)(Wn()()),Y=Object(s.a)(z,2),V=Y[0],q=Y[1],X=Object(a.useState)(Wn()()),Q=Object(s.a)(X,2),K=Q[0],H=Q[1],Z=Object(fe.b)(),J=Z.enqueueSnackbar,$=(Z.closeSnackbar,qt.EditorState.createEmpty()),ee=Object(a.useState)($),ne=Object(s.a)(ee,2),ae=ne[0],ce=ne[1],re=Object(Xt.a)({accept:"*",readAs:"DataURL"}),ie=Object(s.a)(re,2),se=ie[0],oe=ie[1],ue=oe.plainFiles,je=oe.filesContent,be=oe.clear,Oe=function(){h(!1)},he=function(){M(),A(),w(),R(),Oe(),p(!1)};return Object(te.jsxs)(te.Fragment,{children:[Object(te.jsx)(Je.a,{disabled:t,size:"small",variant:"contained",startIcon:Object(te.jsx)(nt.a,{}),color:"inherit",onClick:function(){h(!0)},children:"Add a Task"}),Object(te.jsx)("div",{children:Object(te.jsxs)(pn.a,{open:O,onClose:Oe,children:[Object(te.jsx)(En.a,{children:"Add a Task"}),Object(te.jsxs)(Sn.a,{children:[Object(te.jsx)(ge.a,{autoFocus:!0,margin:"dense",id:"subject",label:"Subject",type:"subject",fullWidth:!0,variant:"standard",autoComplete:"off",value:C,onChange:function(e){return A(e.target.value)},sx:{mb:2}}),Object(te.jsxs)(v.a,{maxWidth:!1,sx:{display:"flex"},disableGutters:!0,children:[Object(te.jsx)(mn,{required:!0,title:"Assigned To",labelname:"USERLOGIN",items:r,onChange:function(e,t){return M(t)}}),Object(te.jsx)(mn,{title:"WBS",labelname:"WBS",items:i,onChange:function(e,t){return G(t)},description:"ACTDES"})]}),Object(te.jsxs)(v.a,{maxWidth:!1,sx:{display:"flex"},disableGutters:!0,children:[Object(te.jsx)(mn,{title:"Task Type",labelname:"CUSTNOTETYPEDES",items:n,onChange:function(e,t){return w(t)}}),Object(te.jsx)(mn,{title:"Task Size",labelname:"SIZENAME",items:c,onChange:function(e,t){return R(t)},description:"SIZEDES"})]}),Object(te.jsx)(Mn.a,{dateAdapter:Bn.a,children:Object(te.jsxs)(v.a,{maxWidth:!1,sx:{display:"flex"},disableGutters:!0,children:[Object(te.jsx)(Fn.a,{disablePast:!0,ampm:!1,label:"Start Date & Time",value:V,onChange:function(e){return q(e)},renderInput:function(e){return Object(te.jsx)(ge.a,Object(l.a)({fullWidth:!0,sx:{m:1}},e))}}),Object(te.jsx)(Fn.a,{disablePast:!0,ampm:!1,label:"End Date & Time",value:K,onChange:function(e){return H(e)},renderInput:function(e){return Object(te.jsx)(ge.a,Object(l.a)({fullWidth:!0,sx:{m:1}},e))}})]})}),Object(te.jsxs)(v.a,{maxWidth:!1,sx:{mt:1},children:[Object(te.jsx)(g.a,{variant:"subtitle",children:"Explanation of Task"}),Object(te.jsx)(le.a,{children:Object(te.jsx)(Wt.Editor,{editorStyle:{height:"150px"},editorState:ae,onEditorStateChange:function(e){ce(e)},toolbar:{image:{uploadCallback:en,previewImage:!0}}})})]}),Object(te.jsxs)(v.a,{maxWidth:!1,sx:{display:"flex",flexWrap:"wrap",gap:"3px",mt:1},children:[0!=ue.length?Object(te.jsx)(S.a,{color:"error","aria-label":"delete",component:"label",children:Object(te.jsx)(Dn.a,{onClick:function(e){be()}})}):Object(te.jsx)(te.Fragment,{}),ue.map((function(e,t){return Object(te.jsx)(We.a,{label:e.name})}))]})]}),Object(te.jsxs)(Ln.a,{children:[Object(te.jsx)(Je.a,{onClick:function(){return se()},variant:"outlined",startIcon:Object(te.jsx)(Gn.a,{}),children:"Add File"}),Object(te.jsx)(Je.a,{onClick:Oe,children:"Cancel"}),Object(te.jsx)(Je.a,{disabled:f,onClick:function(){var e,t,n;if(1===Object(qt.convertToRaw)(ae.getCurrentContent()).blocks.length&""===Object(qt.convertToRaw)(ae.getCurrentContent()).blocks[0].text)J("The task must have an explanation.",{variant:"error"});else if(C)if(void 0!==F){p(!0);var a=[];for(var c in je){var r={EXTFILEDES:je[c].name.split(".")[0],EXTFILENAME:je[c].content};a.push(r)}console.log(a);var i={SUBJECT:C,CUSTNOTETYPEDES:null!==(e=null===D||void 0===D?void 0:D.CUSTNOTETYPEDES)&&void 0!==e?e:"",ZMED_TASKSIZENAME:null!==(t=null===N||void 0===N?void 0:N.SIZENAME)&&void 0!==t?t:"",USERLOGIN:null===F||void 0===F?void 0:F.USERLOGIN,CURDATE:V.format("YYYY-MM-DD"),TILLDATE:K.format("YYYY-MM-DD"),STIME:V.format("HH:mm"),ETIME:K.format("HH:mm"),PROJDOCNO:o.DOCNO,WBS:null!==(n=null===W||void 0===W?void 0:W.WBS)&&void 0!==n?n:"",STATDES:d,TEXT:zt()(Object(qt.convertToRaw)(null===ae||void 0===ae?void 0:ae.getCurrentContent())),CUSTNOTEEXTFILES:a};console.log(i),de.createTask(i).then((function(e){J("Task created succesfully.",{variant:"success"}),u(e.data),he(),console.log(e)})).catch((function(e){J("Error creating task.",{variant:"error"}),he(),console.log(e)}))}else J("Please select an Assigned To.",{variant:"error"});else J("Please fill out the Subject field.",{variant:"error"})},children:"Add"})]})]})})]})}var Yn=Object(fn.a)(le.a)({marginLeft:15,padding:8,display:"flex",flexDirection:"column",top:0,bottom:0,maxHeight:"75vh",width:250,minWidth:250,background:"#ebecf0",overflow:"auto",position:"relative"}),Vn=function(e){var t=e.title,n=e.tasks,a=e.project,c=e.taskTypes,r=e.taskSizes,i=e.users,s=e.projectWBS,o=e.handleUpdateTasks,u=e.refreshTasks,d=e.handleTaskStatusChange;return Object(te.jsx)(Un.c,{droppableId:t,type:"COLUMN",children:function(e,j){return Object(te.jsx)("div",Object(l.a)(Object(l.a)({},e.droppableProps),{},{ref:e.innerRef,children:Object(te.jsxs)(Yn,{children:[Object(te.jsx)(g.a,{component:"h2",variant:"h6",color:"inherit",gutterBottom:!0,children:t||"Title"}),Object(te.jsx)("div",{style:{overflowY:"auto"},children:null===n||void 0===n?void 0:n.map((function(e,t){return Object(te.jsx)(Un.b,{draggableId:e.CUSTNOTE.toString(),index:t,type:"TASK",children:function(t,n){return Object(te.jsx)("div",Object(l.a)(Object(l.a)(Object(l.a)({ref:t.innerRef},t.draggableProps),t.dragHandleProps),{},{children:Object(te.jsx)(Rn,{task:e,refreshTasks:u,handleTaskStatusChange:d},e.CUSTNOTE)}))}},e.CUSTNOTE.toString())}))}),e.placeholder,Object(te.jsx)(zn,{disabled:""===a,taskTypes:c,taskSizes:r,users:i,project:a,projectWBS:s,handleUpdateTasks:o,STATDES:t})]})}))}})},qn=function(){return Object(te.jsx)(te.Fragment,{children:Object(je.a)(Array(6)).map((function(e,t){return Object(te.jsx)(Oe.a,{sx:{marginLeft:2,padding:8,display:"flex",flexDirection:"column"},variant:"rectangular",width:250,height:"75vh",style:{marginBottom:5}},t)}))})},Xn=function(){var e=Object(a.useState)([]),t=Object(s.a)(e,2),n=t[0],c=t[1],r=Object(a.useState)(""),i=Object(s.a)(r,2),o=i[0],u=i[1],d=Object(a.useState)([]),j=Object(s.a)(d,2),b=j[0],O=j[1],h=Object(a.useState)(!0),m=Object(s.a)(h,2),x=m[0],f=m[1],g=Object(fe.b)(),p=g.enqueueSnackbar,S=(g.closeSnackbar,Object(a.useState)()),E=Object(s.a)(S,2),T=E[0],C=E[1],A=Object(a.useState)([]),y=Object(s.a)(A,2),k=y[0],D=y[1],w=Object(a.useState)([]),P=Object(s.a)(w,2),I=P[0],N=P[1],R=Object(a.useState)([]),U=Object(s.a)(R,2),L=U[0],F=U[1],M=Object(a.useState)([]),B=Object(s.a)(M,2),_=B[0],W=B[1],G=Object(a.useState)(Wn()()),z=Object(s.a)(G,2),Y=(z[0],z[1],Object(a.useState)(Wn()())),V=Object(s.a)(Y,2),q=(V[0],V[1],Object(a.useMemo)((function(){if(!T)return b;var e=b.map((function(e){var t,n=null===e||void 0===e||null===(t=e.TASKS)||void 0===t?void 0:t.filter((function(e){var t=!0;for(var n in T)if(T[n]&&(void 0===e[n]||e[n]!==T[n])){t=!1;break}return t}));return Object(l.a)(Object(l.a)({},e),{},{TASKS:n})}));return e}),[T,b]));function X(e,t){return t.forEach((function(t){var n=e.find((function(e){return e.STATDES===t.STATDES}));void 0!==n&&(n.TASKS||(n.TASKS=[]),n.TASKS.push(Object.assign({},t)))})),e}var Q=function(e){if(!e)return[];var t=new Set;return e.forEach((function(e){e.TASKS&&e.TASKS.forEach((function(e){e.USERLOGIN&&t.add(e.USERLOGIN),e.USERLOGIN2&&t.add(e.USERLOGIN2),e.USERLOGIN3&&t.add(e.USERLOGIN3),e.USERLOGIN4&&t.add(e.USERLOGIN4),e.USERLOGIN5&&t.add(e.USERLOGIN5),e.USERLOGIN6&&t.add(e.USERLOGIN6),e.USERLOGIN7&&t.add(e.USERLOGIN7),e.USERLOGIN8&&t.add(e.USERLOGIN8)}))})),Object(je.a)(t)};function K(e,t){return e.filter((function(e){return void 0!==t.find((function(t){return t.STATDES===e.STATDES}))}))}Object(a.useEffect)(Object(Mt.a)(Ft.a.mark((function e(){var t,n,a,r,i,o;return Ft.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.all([de.getTaskStatuses(),de.getUserProjects()]);case 3:t=e.sent,n=Object(s.a)(t,2),a=n[0],r=n[1],i=a.data.value,o=i.push({STATDES:"Cancelled"}),console.log(o),O(i),c(r.data.value),f(!1),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),console.log(e.t0);case 18:case"end":return e.stop()}}),e,null,[[0,15]])}))),[]),Object(a.useEffect)(Object(Mt.a)(Ft.a.mark((function e(){var t,n,a,c,r;return Ft.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.all([de.getTaskTypes(),de.getTaskSizes(),de.getUsers()]);case 3:t=e.sent,n=Object(s.a)(t,3),a=n[0],c=n[1],r=n[2],D(a.data.value),N(c.data.value),F(r.data.value),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(0),console.log(e.t0);case 16:case"end":return e.stop()}}),e,null,[[0,13]])}))),[]);var H=function(e){o&&Z(e,o)},Z=function(){var e=Object(Mt.a)(Ft.a.mark((function e(t,n){return Ft.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null!==n&&(f(!0),u(n),void 0!=b&&O(((t=b).forEach((function(e){e.TASKS&&delete e.TASKS})),t)),de.getProjectTasks(n.DOCNO).then((function(e){var t=K(e.data.value,b),n=X(b,t);O(n),console.log(n),console.log(Q(n)),f(!1)})).catch((function(e){console.log(e)})),de.getProjectWBS(n.DOCNO).then((function(e){W(e.data.value)})).catch((function(e){console.log(e)})));case 1:case"end":return e.stop()}var t}),e)})));return function(t,n){return e.apply(this,arguments)}}(),J=function(){var e=Object(Mt.a)(Ft.a.mark((function e(t,n){return Ft.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:de.changeTaskStatus({CUSTNOTE:t,STATDES:n}).then((function(e){console.log(e)})).catch((function(e){p("Error updating task status in Priority.",{variant:"error"}),console.log(e)}));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),$=function(e,t,n){var a=function(e,t,n,a){var c=e.find((function(e){return e.STATDES===t}));if(!c||!c.TASKS)return null;var r=c.TASKS.findIndex((function(e){return e.CUSTNOTE===a}));if(-1===r)return null;var i=c.TASKS.splice(r,1),o=Object(s.a)(i,1)[0],l=e.find((function(e){return e.STATDES===n}));if(!l)return null;l.TASKS||(l.TASKS=[]);return l.TASKS.push(o),e}(Object(je.a)(b),e,t,n);J(n,t),O(a)},ee=function(){var e=Object(Mt.a)(Ft.a.mark((function e(t){var n,a,c;return Ft.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.destination){e.next=2;break}return e.abrupt("return");case 2:n=t.source.droppableId,a=t.destination.droppableId,c=parseInt(t.draggableId),$(n,a,c);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();var ne=function(e){var t=X(Object(je.a)(b),[e]);O(t)};return Object(te.jsxs)(te.Fragment,{children:[Object(te.jsx)(v.a,{maxWidth:!1,sx:{display:"flex"},children:Object(te.jsx)(Je.a,{disabled:!o||x,onClick:H,sx:{m:1},size:"small",variant:"contained",children:"Refresh Tasks"})}),Object(te.jsxs)(v.a,{maxWidth:!1,sx:{display:"flex"},children:[Object(te.jsx)(mn,{title:"Project",labelname:"DOCNO",items:n,onChange:Z,description:"PROJDES"}),Object(te.jsx)(mn,{disabled:""===o,title:"Assigned To",labelname:"",items:Q(b),onChange:function(e,t){return C(Object(l.a)(Object(l.a)({},T),{},{USERLOGIN:t}))}}),Object(te.jsx)(mn,{disabled:""===o,title:"WBS",labelname:"",items:function(e){if(!e)return[];var t=new Set;return e.forEach((function(e){e.TASKS&&e.TASKS.forEach((function(e){e.WBS&&t.add(e.WBS)}))})),Object(je.a)(t)}(b),onChange:function(e,t){return C(Object(l.a)(Object(l.a)({},T),{},{WBS:t}))}}),Object(te.jsx)(mn,{disabled:""===o,title:"Task Type",labelname:"",items:function(e){if(!e)return[];var t=new Set;return e.forEach((function(e){e.TASKS&&e.TASKS.forEach((function(e){e.CUSTNOTETYPEDES&&t.add(e.CUSTNOTETYPEDES)}))})),Object(je.a)(t)}(b),onChange:function(e,t){return C(Object(l.a)(Object(l.a)({},T),{},{CUSTNOTETYPEDES:t}))}})]}),Object(te.jsx)(Un.a,{onDragEnd:ee,children:Object(te.jsx)(v.a,{maxWidth:!1,sx:{display:"flex",mt:2,mb:4},children:x?Object(te.jsx)(qn,{}):null===q||void 0===q?void 0:q.filter((function(e){return"Cancelled"!==e.STATDES})).map((function(e){return Object(te.jsx)(Vn,{title:e.STATDES,tasks:e.TASKS,project:o,taskTypes:k,taskSizes:I,users:L,projectWBS:_,handleUpdateTasks:ne,refreshTasks:H,handleTaskStatusChange:$},e.DOCSTATUSSORT)}))})})]})},Qn=n(100);var Kn=function(e){return Object(te.jsx)(g.a,{component:"h2",variant:"h6",color:"primary",gutterBottom:!0,children:e.children})},Hn=n(624),Zn=n(651),Jn=n(652),$n=n(601);function ea(e){var t=e.title,n=e.data,r=e.statusLabel,i=n.hasOwnProperty("value"),o=Object(a.useState)([]),l=Object(s.a)(o,2),u=l[0],d=l[1];return Object(a.useEffect)((function(){i&&r&&d(function(){var e,t={},a=Object(Qn.a)(n.value);try{for(a.s();!(e=a.n()).done;){var c=e.value[r];t[c]?t[c]+=1:t[c]=1}}catch(i){a.e(i)}finally{a.f()}return t}())}),[n]),Object(te.jsxs)(c.a.Fragment,{children:[Object(te.jsxs)(le.a,{sx:{p:2,display:"flex",flexDirection:"column",minHeight:120},children:[Object(te.jsx)(Kn,{children:t}),i?Object(te.jsxs)(g.a,{component:"p",variant:"h4",children:[n.value.length," ",t]}):Object(te.jsx)(be.a,{})]}),Object(te.jsxs)(Hn.a,{disabled:0===u.length,children:[Object(te.jsx)(Zn.a,{expandIcon:Object(te.jsx)($n.a,{}),"aria-controls":"panel1a-content",id:"panel1a-header",children:Object(te.jsx)(g.a,{children:"Status Breakdown"})}),Object(te.jsx)(Jn.a,{children:Object(te.jsx)("div",{children:Object.entries(u).map((function(e){var t=Object(s.a)(e,2),n=t[0],a=t[1];return Object(te.jsxs)(g.a,{color:"text.secondary",sx:{flex:1},children:[n,": ",a]},n)}))})})]})]})}var ta=n(187),na=[{type:"string",label:"Task ID"},{type:"string",label:"Task Name"},{type:"string",label:"Resource"},{type:"date",label:"Start Date"},{type:"date",label:"End Date"},{type:"number",label:"Duration"},{type:"number",label:"Percent Complete"},{type:"string",label:"Dependencies"}],aa={height:750,annotations:{style:"line",items:[{id:"Today",type:"line",mode:"horizontal",scaleID:"x",value:(new Date).toISOString(),style:{stroke:"red",strokeWidth:10}}]},gantt:{criticalPathEnabled:!1,defaultStartDateMillis:new Date,sortTasks:!1,innerGridHorizLine:{stroke:"#ffe0b2",strokeWidth:2},arrow:{angle:100,width:2,color:"green",radius:0}}};var ca=function(){var e=function(e){return e.map((function(e){return[e.WBS,"".concat(e.WBS,": ").concat(e.ACTDES," ").concat(100===e.EXECPERCENT?"\u2705":""),e.WBS.substring(0,1),new Date(e.STARTDATE),new Date(e.ENDDATE),(t=new Date(e.ENDDATE)-new Date(e.STARTDATE),24*t*60*60*1e3/864e5+1),e.EXECPERCENT,e.PROJACTPRED_SUBFORM.filter((function(t){return t.WBS!==e.WBS})).map((function(e){return e.WBS})).join(", ")];var t}))},t=Object(a.useState)([]),n=Object(s.a)(t,2),c=n[0],r=n[1],i=Object(a.useState)(""),o=Object(s.a)(i,2),l=o[0],u=o[1],d=Object(a.useState)([]),j=Object(s.a)(d,2),b=j[0],O=j[1],h=[na].concat(Object(je.a)(e(b)));return Object(a.useEffect)(Object(Mt.a)(Ft.a.mark((function e(){return Ft.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:de.getUserProjects().then((function(e){r(e.data.value)})).catch((function(e){console.log(e)}));case 1:case"end":return e.stop()}}),e)}))),[]),Object(a.useEffect)((function(){l&&de.getGanttWBS(l.DOCNO).then((function(t){var n=t.data.value[0].PROJACTS_SUBFORM;n[0].STARTDATE=new Date,n[0].ENDDATE=new Date,console.log(e(n)),console.log(n),O(n),aa.height=42*t.data.value[0].PROJACTS_SUBFORM.length})).catch((function(e){console.log(e)}))}),[l]),Object(te.jsxs)(te.Fragment,{children:[Object(te.jsx)(v.a,{maxWidth:!1,sx:{mt:2,display:"flex",maxWidth:500},children:Object(te.jsx)(mn,{title:"Project",labelname:"DOCNO",items:c,onChange:function(e,t){return u(t)},description:"PROJDES"})}),Object(te.jsx)(v.a,{maxWidth:!1,sx:{mt:2,display:"flex"},children:0!==b.length?Object(te.jsx)(ta.a,{chartType:"Gantt",width:"100%",height:"50%",data:h,options:aa,chartEvents:[{callback:function(e){e.chartWrapper,e.google;!function(){for(var e=document.querySelectorAll("[id^=reactgooglegraph]")[0],t=e.getElementsByTagName("svg")[0].getElementsByTagName("g")[1].getElementsByTagName("text"),n=Number(t[0].getAttribute("y"))-25,a=0;a *":{borderBottom:"unset"}},children:[Object(te.jsx)(re.a,{}),Object(te.jsx)(re.a,{align:"center",component:"th",scope:"row",children:new Date(t.QUEUETIME).toLocaleDateString("en-GB")}),Object(te.jsx)(re.a,{align:"center",children:t.AUTO_DOC_DES}),Object(te.jsx)(re.a,{align:"center",children:Object(te.jsx)(S.a,{onClick:function(){return e=t.FILENAME,b=e.substring(0,e.length-4),void de.downloadStatementPdf(b).then((function(e){var t=window.URL.createObjectURL(new Blob([e.data])),n=document.createElement("a");n.href=t,n.setAttribute("download","".concat(b,".pdf")),document.body.appendChild(n),n.click()})).catch((function(e){console.log(e.response),j("File not found. Please contact system manager.",{variant:"error"})}));var e},children:Object(te.jsx)(xe.a,{})})})]}),Object(te.jsx)(oe.a,{children:Object(te.jsx)(re.a,{style:{paddingBottom:0,paddingTop:0,paddingLeft:100,backgroundColor:"#F8F8F8"},colSpan:8})})]})}function ja(){var e=Object(a.useState)("asc"),t=Object(s.a)(e,2),n=t[0],c=t[1],r=Object(a.useState)("calories"),i=Object(s.a)(r,2),o=i[0],l=i[1],u=Object(a.useState)([]),d=Object(s.a)(u,2),j=d[0],b=d[1],O=Object(a.useState)(0),m=Object(s.a)(O,2),x=m[0],f=m[1],g=Object(a.useState)(5),p=Object(s.a)(g,2),S=p[0],v=p[1],E=Object(a.useState)([]),T=Object(s.a)(E,2),C=T[0],A=T[1],y=Object(a.useState)(!1),k=Object(s.a)(y,2),D=k[0],w=k[1];Object(a.useEffect)((function(){de.getCustomerStatements().then((function(e){var t=e.data.value.filter((function(e){return"Customer Statements"===e.AUTO_DOC_DES}));A(t),void 0!==e.data.value&&null!==e.data.value&&w(!0)})).catch((function(e){console.log(e)}))}),[]);return D?Object(te.jsx)(h.a,{sx:{width:"100%"},children:Object(te.jsxs)(le.a,{sx:{width:"100%",mb:2},children:[Object(te.jsx)(ye,{title:"Customer Statements"}),Object(te.jsx)(ie.a,{children:Object(te.jsxs)(ae.a,{sx:{minWidth:750},"aria-labelledby":"tableTitle",size:"medium",children:[Object(te.jsx)(Ae,{numSelected:j.length,order:n,orderBy:o,onSelectAllClick:function(e){if(e.target.checked){var t=C.map((function(e){return e.name}));b(t)}else b([])},onRequestSort:function(e,t){c(o===t&&"asc"===n?"desc":"asc"),l(t)},rowCount:C.length,headCells:ua}),Object(te.jsx)(ce.a,{children:C.slice().sort(Se(n,o)).slice(x*S,x*S+S).map((function(e,t){return Object(te.jsx)(da,{row:e},t)}))})]})}),Object(te.jsx)(se.a,{rowsPerPageOptions:[5,10,25],component:"div",count:C.length,rowsPerPage:S,page:x,onPageChange:function(e,t){f(t)},onRowsPerPageChange:function(e){v(parseInt(e.target.value,10)),f(0)}})]})}):Object(te.jsx)(he,{})}var ba=function(){return Object(te.jsx)(v.a,{maxWidth:"lg",sx:{mt:4,mb:4},children:Object(te.jsx)(E.a,{item:!0,xs:12,children:Object(te.jsx)(ja,{})})})};function Oa(e){return Object(te.jsxs)(g.a,Object(l.a)(Object(l.a)({variant:"body2",color:"text.secondary",align:"center"},e),{},{children:["Copyright \xa9 ",Object(te.jsx)("a",{href:"https://www.medatechuk.com/",children:"Medatech UK"})," ",(new Date).getFullYear(),"."]}))}var ha=Object(u.a)(m.a,{shouldForwardProp:function(e){return"open"!==e}})((function(e){var t=e.theme,n=e.open;return Object(l.a)({zIndex:t.zIndex.drawer+1,transition:t.transitions.create(["width","margin"],{easing:t.transitions.easing.sharp,duration:t.transitions.duration.leavingScreen})},n&&{marginLeft:240,width:"calc(100% - ".concat(240,"px)"),transition:t.transitions.create(["width","margin"],{easing:t.transitions.easing.sharp,duration:t.transitions.duration.enteringScreen})})})),ma=Object(u.a)(O.a,{shouldForwardProp:function(e){return"open"!==e}})((function(e){var t=e.theme,n=e.open;return{"& .MuiDrawer-paper":Object(l.a)({position:"relative",whiteSpace:"nowrap",width:240,transition:t.transitions.create("width",{easing:t.transitions.easing.sharp,duration:t.transitions.duration.enteringScreen}),boxSizing:"border-box"},!n&&Object(o.a)({overflowX:"hidden",transition:t.transitions.create("width",{easing:t.transitions.easing.sharp,duration:t.transitions.duration.leavingScreen}),width:t.spacing(7)},t.breakpoints.up("sm"),{width:t.spacing(9)}))}})),xa=function(){var e=Object(a.useState)([]),t=Object(s.a)(e,2),n=(t[0],t[1]),c=Object(a.useState)([]),r=Object(s.a)(c,2),i=(r[0],r[1]),o=Object(a.useState)([]),l=Object(s.a)(o,2),u=l[0],d=l[1],j=Object(a.useState)([]),b=Object(s.a)(j,2),O=b[0],h=b[1],m=Object(a.useState)([]),x=Object(s.a)(m,2),f=x[0],g=x[1],p=Object(a.useState)(!1),S=Object(s.a)(p,2),T=(S[0],S[1]),C=Object(a.useState)([]),A=Object(s.a)(C,2),y=(A[0],A[1]);return Object(a.useEffect)((function(){de.getCustomerOrders().then((function(e){n(e.data),T(!0)})).catch((function(e){console.log(e)})),de.getCustomerShipments().then((function(e){i(e.data)})).catch((function(e){console.log(e)})),de.getCustomerInvoices().then((function(e){d(e.data)})).catch((function(e){console.log(e)})),de.getUserProjects().then((function(e){h(e.data)})).catch((function(e){console.log(e)})),de.getServiceCalls().then((function(e){g(e.data)})).catch((function(e){console.log(e)})),de.getCustomerStatements().then((function(e){var t=e.data.value.filter((function(e){return"Customer Statements"===e.AUTO_DOC_DES}));y(t)})).catch((function(e){console.log(e)}))}),[]),Object(a.useEffect)((function(){if(0!==f.length){var e=f.value.filter((function(e){return"Y"===e.ACTIVEFLAG})),t={"@odata.context":f["@odata.context"],value:e};g(t)}}),[f]),Object(te.jsxs)(v.a,{maxWidth:"lg",sx:{mt:4,mb:4},children:[Object(te.jsx)(la,{}),Object(te.jsxs)(E.a,{container:!0,spacing:3,alignItems:"stretch",children:[Object(te.jsx)(E.a,{item:!0,xs:12,md:4,lg:4,children:Object(te.jsx)(ea,{title:"Service Calls",statusLabel:"CALLSTATUSCODE",data:f})}),Object(te.jsx)(E.a,{item:!0,xs:12,md:4,lg:4,children:Object(te.jsx)(ea,{title:"Invoices",statusLabel:"STATDES",data:u})}),Object(te.jsx)(E.a,{item:!0,xs:12,md:4,lg:4,children:Object(te.jsx)(ea,{title:"Projects",statusLabel:"STATDES",data:O})})]}),Object(te.jsx)(Oa,{sx:{pt:4}})]})},fa=Object(d.a)(),ga=function(e){var t=c.a.useState(!0),a=Object(s.a)(t,2),r=a[0],i=a[1],o=c.a.useState(W.getCurrentUser()),u=Object(s.a)(o,2),d=u[0],O=(u[1],function(){i(!r)});return Object(te.jsx)(j.a,{theme:fa,children:Object(te.jsxs)(h.a,{sx:{display:"flex"},children:[Object(te.jsx)(b.a,{}),Object(te.jsx)(ha,{position:"absolute",open:r,children:Object(te.jsxs)(x.a,{sx:{pr:"24px"},children:[Object(te.jsx)(S.a,{edge:"start",color:"inherit","aria-label":"open drawer",onClick:O,sx:Object(l.a)({marginRight:"36px"},r&&{display:"none"}),children:Object(te.jsx)(C.a,{})}),Object(te.jsx)("img",{style:{maxWidth:50},src:n(490).default,alt:"logo"}),Object(te.jsx)(g.a,{component:"h1",variant:"h6",color:"inherit",noWrap:!0,sx:{ml:1,flexGrow:1},children:"Customer Portal"}),Object(te.jsx)(Ut,{}),d?Object(te.jsx)(Tt,{user:d}):null]})}),Object(te.jsxs)(ma,{variant:"permanent",open:r,children:[Object(te.jsx)(x.a,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",px:[1]},children:Object(te.jsx)(S.a,{onClick:O,children:Object(te.jsx)(y.a,{})})}),Object(te.jsx)(p.a,{}),Object(te.jsx)(f.a,{children:ne}),Object(te.jsx)(p.a,{})]}),Object(te.jsxs)(h.a,{component:"main",sx:{backgroundColor:function(e){return"light"===e.palette.mode?e.palette.grey[100]:e.palette.grey[900]},flexGrow:1,height:"100vh",overflow:"auto"},children:[Object(te.jsx)(x.a,{}),Object(te.jsxs)(He.d,{children:[Object(te.jsx)(yt,{exact:!0,path:"/dashboard",component:xa}),Object(te.jsx)(yt,{path:"/dashboard/projects",component:ia}),Object(te.jsx)(yt,{path:"/dashboard/orders",component:Ve}),Object(te.jsx)(yt,{path:"/dashboard/shipments",component:Ke}),Object(te.jsx)(yt,{path:"/dashboard/invoices",component:Re}),Object(te.jsx)(yt,{path:"/dashboard/statements",component:ba})," ",Object(te.jsx)(yt,{path:"/dashboard/createorder",component:mt}),Object(te.jsx)(yt,{path:"/dashboard/createservicecall",component:xn}),Object(te.jsx)(yt,{path:"/dashboard/servicecalls",component:hn}),Object(te.jsx)(yt,{path:"/dashboard/servicecall/:docno",component:rn}),Object(te.jsx)(yt,{path:"/dashboard/kanban",component:Xn}),Object(te.jsx)(yt,{path:"/dashboard/gantt",component:ca}),Object(te.jsx)(yt,{path:"/dashboard/customerinfo",component:sa}),Object(te.jsx)(yt,{component:xa})]})]})]})})},pa=n(632),Sa=n(188),va=n.n(Sa),Ea=n.p+"static/media/logo_medatech_large.e3523329.jpg",Ta=n.p+"static/media/Support-Portal-Banner-Logo.c20b496f.png";function Ca(e){return Object(te.jsxs)(g.a,Object(l.a)(Object(l.a)({variant:"body2",color:"text.secondary",align:"center"},e),{},{children:["Copyright \xa9 ",Object(te.jsx)(pa.a,{color:"inherit",href:"https://medatechuk.com/",children:"Medatech UK"})," ",(new Date).getFullYear(),"."]}))}var Aa=Object(d.a)({});function ya(){var e,t=Object(fe.b)(),n=t.enqueueSnackbar,c=t.closeSnackbar,r=Object(a.useState)(!1),i=Object(s.a)(r,2),o=i[0],l=i[1],u=Object(a.useState)(""),d=Object(s.a)(u,2),O=d[0],m=d[1],x=Object(a.useState)(""),f=Object(s.a)(x,2),p=f[0],S=f[1],v=Object(a.useState)(""),T=Object(s.a)(v,2),C=T[0],A=T[1],y=Object(a.useState)(!1),k=Object(s.a)(y,2),D=k[0],w=k[1],P=Object(a.useState)(""),I=Object(s.a)(P,2),N=I[0],R=I[1],U=Object(a.useState)(""),L=Object(s.a)(U,2),F=L[0],M=L[1],B=Object(a.useState)(""),_=Object(s.a)(B,2),W=_[0],G=_[1],z=Object(a.useState)(""),Y=Object(s.a)(z,2),V=Y[0],q=Y[1],X=Object(a.useState)(""),Q=Object(s.a)(X,2),K=Q[0],H=Q[1],Z=Object(a.useState)(!1),J=Object(s.a)(Z,2),$=J[0],ee=J[1],ne=Object(a.useState)("UserName"),ae=Object(s.a)(ne,2);ae[0],ae[1];Object(a.useEffect)((function(){!0===D&&(n("Please enter CustomerID and Company Code",{variant:"error"}),w(!1))}),[D]);var ce=function(t){de.checkUser(K).then((function(a){0!==a.data.value.length?(c(e),n("User Already Exist",{variant:"error"})):function(t){var a={CUSTNAME:O,USERNAME:K,NAME:t,GENPASSWORD:"Y",ACTIVE:"Y"};de.createUser(a).then((function(t){200!==t.status&&201!==t.status||(c(e),n("User successfully created.Please check your email for login credentials",{variant:"success"}),l(!1),ee(!0),m(""),A(""))})).catch((function(e){console.log("error:",e)}))}(t)})).catch((function(e){console.log("error:",e)}))};return Object(te.jsxs)(j.a,{theme:Aa,children:[$&&Object(te.jsx)(wa,{}),Object(te.jsx)("div",{className:"banner-container",children:Object(te.jsx)("div",{className:"banner-background",children:Object(te.jsxs)("div",{className:"banner-content",children:[Object(te.jsx)("img",{src:Ta,alt:"Medatech Logo",className:"logo"}),Object(te.jsx)("a",{onClick:function(){return window.open("https://www.medatechuk.com/training-courses","_blank")},className:"banner-text",children:"Training courses now available, click here to view available dates and topics"})]})})}),Object(te.jsxs)(E.a,{container:!0,component:"main",sx:{height:"100vh"},children:[Object(te.jsx)(b.a,{}),Object(te.jsx)(E.a,{item:!0,xs:!1,sm:4,md:7,sx:{backgroundImage:"url(".concat(Ea,")"),backgroundRepeat:"no-repeat",backgroundColor:function(e){return"light"===e.palette.mode?e.palette.grey[50]:e.palette.grey[900]},backgroundSize:"60%",backgroundPosition:"center"}}),Object(te.jsx)(E.a,{item:!0,xs:12,sm:8,md:5,component:le.a,elevation:6,square:!0,children:Object(te.jsxs)(h.a,{sx:{my:8,mx:4,display:"flex",flexDirection:"column",alignItems:"center"},children:[Object(te.jsx)(gt.a,{sx:{m:1,bgcolor:"primary.main"},children:Object(te.jsx)(va.a,{})}),!0!==o?Object(te.jsxs)(te.Fragment,{children:[Object(te.jsx)(g.a,{component:"h1",variant:"h5",children:"User Sign Up"}),Object(te.jsxs)(h.a,{component:"form",noValidate:!0,sx:{mt:1},children:[Object(te.jsx)(ge.a,{margin:"normal",required:!0,fullWidth:!0,id:"customernumber",label:"Customer Number",name:"customernumber",autoComplete:"customernumber",inputProps:{maxLength:48},value:O,onChange:function(e){m(e.target.value)}}),Object(te.jsx)(ge.a,{margin:"normal",required:!0,fullWidth:!0,id:"companycode",label:"Company Code",name:"companycode",autoComplete:"companycode",inputProps:{maxLength:6},value:C,onChange:function(e){A(e.target.value)}}),Object(te.jsx)(Je.a,{type:"submit",fullWidth:!0,onClick:function(t){t.preventDefault(),""===O&&""===C?w(!0):(e=n("Verification is in Progress..",{variant:"warning"}),de.getCustomerSignup(O).then((function(t){var a,r;t.data.value.length>0?(a=t.data.value[0].ZMED_COMPANYCODE,r=t.data.value[0].CUSTDES,a===C?(c(e),n("Verification success.Please enter the user details",{variant:"success"}),l(!0),S(r)):(c(e),n("Invalid Company Code. Verification Failed",{variant:"error"}))):(c(e),n("Customer ID Not Exist",{variant:"error"}))})).catch((function(e){console.log("error:",e)})))},variant:"contained",sx:{mt:3,mb:2},children:"Verify Company"}),Object(te.jsx)(Ca,{sx:{mt:1}})]})," "]}):Object(te.jsx)(te.Fragment,{}),o?Object(te.jsxs)(te.Fragment,{children:[Object(te.jsx)(g.a,{component:"h1",variant:"h5",children:"User Sign Up"}),Object(te.jsxs)(h.a,{component:"form",noValidate:!0,sx:{mt:1},children:[Object(te.jsx)(ge.a,{margin:"normal",required:!0,fullWidth:!0,id:"firstname",label:"Firstname",name:"firstname",autoComplete:"firstname",inputProps:{maxLength:16},onChange:function(e){return R(e.target.value)},autoFocus:!0}),Object(te.jsx)(ge.a,{margin:"normal",required:!0,fullWidth:!0,id:"lastname",label:"Lastname",name:"lastname",autoComplete:"lastname",inputProps:{maxLength:20},onChange:function(e){return M(e.target.value)},autoFocus:!0}),Object(te.jsx)(ge.a,{margin:"normal",required:!0,fullWidth:!0,id:"email",label:"Email",name:"email",autoComplete:"email",onChange:function(e){q(e.target.value),H(e.target.value)},autoFocus:!0}),Object(te.jsx)(ge.a,{margin:"normal",fullWidth:!0,id:"phone",label:"Phone",name:"phone",autoComplete:"phone",onChange:function(e){return G(e.target.value)},autoFocus:!0}),Object(te.jsx)(Je.a,{type:"submit",fullWidth:!0,sx:{mt:3,backgroundColor:"#C00932",color:"white","&:hover":{backgroundColor:"#C00932"}},disabled:""===N||""===F||""===V||""===K,onClick:function(t){e=n("User Signup is in progress...",{variant:"warning"}),t.preventDefault();var a=N+" "+F;de.checkContact(a).then((function(e){0===e.data.value.length?function(){var e={FIRSTNAME:N,LASTNAME:F,EMAIL:V,FIRM:p,PHONENUM:W,CUSTNAME:O};de.createContact(e).then((function(e){200===e.status||201===e.status?ce(e.data.NAME):n("Contact Creation Failed",{variant:"error"})})).catch((function(e){console.log("error:",e)}))}():ce(a)})).catch((function(e){console.log("error:",e)}))},children:"Sign up"}),Object(te.jsx)(Ca,{sx:{mt:1}})]})]}):Object(te.jsx)(te.Fragment,{})," "]})})]})]})}function ka(e){return Object(te.jsxs)(g.a,Object(l.a)(Object(l.a)({variant:"body2",color:"text.secondary",align:"center"},e),{},{children:["Copyright \xa9 ",Object(te.jsx)(pa.a,{color:"inherit",href:"https://medatechuk.com/",children:"Medatech UK"})," ",(new Date).getFullYear(),"."]}))}Aa=Object(d.a)(Aa,{palette:{red:Aa.palette.augmentColor({color:{main:"#C00932"},name:"red"})}});var Da=Object(d.a)();function wa(){var e=Object(fe.b)(),t=e.enqueueSnackbar,n=(e.closeSnackbar,c.a.useState(!1)),a=Object(s.a)(n,2),r=a[0],i=a[1],u=c.a.useState(!1),d=Object(s.a)(u,2),O=d[0],m=d[1],x=c.a.useState({}),f=Object(s.a)(x,2),p=f[0],S=f[1],v=c.a.useState(!1),T=Object(s.a)(v,2),C=T[0],A=T[1],y=function(e){return S((function(t){return Object(l.a)(Object(l.a)({},t),{},Object(o.a)({},e.target.name,e.target.value))}))};return Object(te.jsxs)(j.a,{theme:Da,children:[r?Object(te.jsx)(He.a,{to:"/dashboard"}):null,C?Object(te.jsx)(ya,{}):Object(te.jsxs)(te.Fragment,{children:[Object(te.jsx)("div",{className:"banner-container",children:Object(te.jsx)("div",{className:"banner-background",children:Object(te.jsxs)("div",{className:"banner-content",children:[Object(te.jsx)("img",{src:Ta,alt:"Medatech Logo",className:"logo"}),Object(te.jsx)("a",{onClick:function(){return window.open("https://www.medatechuk.com/training-courses","_blank")},className:"banner-text",children:"Training courses now available, click here to view available dates and topics"})]})})}),Object(te.jsxs)(E.a,{container:!0,component:"main",sx:{height:"100vh"},children:[Object(te.jsx)(b.a,{}),Object(te.jsx)(E.a,{item:!0,xs:!1,sm:4,md:7,sx:{backgroundImage:"url(".concat(Ea,")"),backgroundRepeat:"no-repeat",backgroundColor:function(e){return"light"===e.palette.mode?e.palette.grey[50]:e.palette.grey[900]},backgroundSize:"60%",backgroundPosition:"center"}}),Object(te.jsx)(E.a,{item:!0,xs:12,sm:8,md:5,component:le.a,elevation:6,square:!0,children:Object(te.jsxs)(h.a,{sx:{my:8,mx:4,display:"flex",flexDirection:"column",alignItems:"center"},children:[Object(te.jsx)(gt.a,{sx:{m:1,bgcolor:"primary.main"},children:Object(te.jsx)(va.a,{})}),Object(te.jsx)(g.a,{component:"h1",variant:"h5",children:O?"Change Password":"Sign in"}),Object(te.jsxs)(h.a,{component:"form",noValidate:!0,onSubmit:function(e){e.preventDefault();var n=new FormData(e.currentTarget);O?n.get("password")==n.get("confirmpassword")?W.changePassword(n).then((function(e){200==e.status?(t("Successfully changed password! Please login.",{variant:"success"}),m(!1)):t("Problem occurred changing password.",{variant:"error"})})):t("Passwords do not match.",{variant:"warning"}):W.login(n).then((function(e){1==e.data.newUser?(t("Please change your password.",{variant:"warning"}),m(!0)):(t("Successfully logged in!",{variant:"success"}),localStorage.setItem("token",e.data.token),i(!0),window.location.reload())})).catch((function(e){t(e.response.data.message,{variant:"error"})}))},sx:{mt:1},children:[Object(te.jsx)(ge.a,{margin:"normal",required:!0,fullWidth:!0,id:"username",label:"Username",name:"username",autoComplete:"username",onChange:y,sx:{pointerEvents:O?"none":"auto"},autoFocus:!0}),Object(te.jsx)(ge.a,{margin:"normal",required:!0,fullWidth:!0,name:"password",label:O?"New Password":"Password",type:"password",id:"password",autoComplete:"current-password",onChange:y}),O?Object(te.jsx)(ge.a,{margin:"normal",required:!0,fullWidth:!0,name:"confirmpassword",label:"Confirm Password",type:"password",id:"confirmpassword",onChange:y}):null,O?Object(te.jsx)(Je.a,{type:"submit",fullWidth:!0,variant:"contained",sx:{mt:3,mb:2},children:"Change Password"}):Object(te.jsxs)(te.Fragment,{children:[Object(te.jsx)(Je.a,{type:"submit",fullWidth:!0,variant:"contained",sx:{mt:3},children:"Sign In"}),Object(te.jsx)(Je.a,{type:"submit",fullWidth:!0,onClick:function(e){e.preventDefault(),A(!0)},sx:{mt:1},children:"Sign Up"}),Object(te.jsx)(Je.a,{onClick:function(e){console.log(p),W.forgotPassword(p).then((function(e){t("Email has been sent to the contact",{variant:"success"})})).catch((function(e){t("User not exist",{variant:"error"})}))},fullWidth:!0,sx:{mt:3},children:"Forgot password?"})]}),Object(te.jsx)(ka,{sx:{mt:1}})]})]})})]})]})]})}var Pa=function(){return Object(te.jsx)("div",{className:"App",children:Object(te.jsx)(wn.a,{children:Object(te.jsx)(fe.a,{children:Object(te.jsx)(U.a,{children:Object(te.jsxs)(He.d,{children:[Object(te.jsx)(yt,{exact:!0,path:"/",children:Object(te.jsx)(He.a,{to:"/dashboard"})}),Object(te.jsx)(yt,{path:"/dashboard",component:ga}),Object(te.jsx)(He.b,{exact:!0,path:"/login",component:wa}),Object(te.jsx)(yt,{component:ga})]})})})})})},Ia=function(e){e&&e instanceof Function&&n.e(3).then(n.bind(null,653)).then((function(t){var n=t.getCLS,a=t.getFID,c=t.getFCP,r=t.getLCP,i=t.getTTFB;n(e),a(e),c(e),r(e),i(e)}))};i.a.render(Object(te.jsx)(c.a.StrictMode,{children:Object(te.jsx)(Pa,{})}),document.getElementById("root")),Ia()}},[[491,1,2]]]); //# sourceMappingURL=main.9da31bf6.chunk.js.map