1 line
37 KiB
JavaScript
1 line
37 KiB
JavaScript
"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[8222],{38215:function(e,t,r){r.d(t,{Z:function(){return s}});var n=r(17592),o=r(85281),i=r(46417),a=(0,n.ZP)("div")((function(){return{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:2001,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255, 255, 255, 0.7)",padding:"20px",borderRadius:"10px"}})),c=(0,n.ZP)("div")((function(){return{position:"absolute",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center"}})),s=function(){return(0,i.jsxs)(a,{children:[(0,i.jsx)(o.Z,{color:"primary",size:80,thickness:6}),(0,i.jsx)(c,{children:(0,i.jsx)("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAA+CAYAAABzwahEAAAPnUlEQVR4AdVae3AU9R3/7d4jdyGQQKAhECBAJBSmEAtFSQUjqPgAHGlhRm0lDkWY6Tg+O9qiErR26h8WR8ZWqTMN1ur4qMpDrTyjtDwDJloeCYiBvAgkaZ53l7vb3X4/v9vfZS/Zu9uFwLSfmb3d293f7u/z+z5/399K7CphdW5JrupgBZosZ0ialmu8pklSjUOTamRJbvvjqTUV7CpAYlcIj+SWZHQ55WJZlm7UNK2IXpRhpZ3GWJskSWXUZrPD4Sp77eSva9gVwIATXz35+SJNYWs1phWxAYDEpDKVaZv+fOrZUjaAGDDiK695rpgetpYOc82upw72sMycdJbz/SzmHeKl/ynRay31bbS1s7rjTczXGYj3ihrShnUDNQCXTXzlNS8UyExdbybhSdeNYwXz81nBzflE2pKms7oT51ntiSa276NKVn3wrNktNcGQelNpTUkNuwxcFvFV+S88rKnKy8ZzkOz84uvYvOJZ/PhyAE3Y/+HXbN+HFVwjjJAlR8lr1WueY9wt2MclEYfj8rnkj+nwRnHOLuGWhnbmpfuMKh/3Xn0Atm74IuY8OcGPFYk99kbVM98xm7BFnDyttHLyb3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EY9rSQqOTHAmP91TFdNGChJsyPTdlelztqcMu6i+XvNiIkBQRHlcPHGv6sUbHIKzo56J1AZBkvR5cSFhUVBR2CbD69bIpysvLecdoAHqINOytm0ijJt9J3r+TVBLHXfrGkwsiJRIMLF1i76MBEue7qE0XqTPadYiNnFen3j6Ad5HGYSDwTcslkQYGamVULLrLpH7y6dOnuY1TGctFFR0hcYfhvujinQ6eaNBgYc6sEHm+0WAKqatEWJkwYYI6depUjYhbtuWrBW775GGd1FEXFQA8FFsR8+HRMdFBKocgPrTvRkgnh4l70ijPxtwAzpLnCLpDvSztvFqQ9C8PuAPEINDeTdpgjADYjOFQhESn3s6hP+OKr9dfSUhCaiIcYjNIMur52f850f95/BfoYlARf1CQvwAAAABJRU5ErkJggg==",alt:"Logo",style:{width:"100%",height:"100%"}})})]})}},78222:function(e,t,r){r.r(t),r.d(t,{default:function(){return Se}});var n=r(74165),o=r(15861),i=r(29439),a=r(1413),c=r(47313),s=r(90842),l=r(10658),d=r.n(l),u=r(56573),x=r(19860),h=r(70501),p=r(48119),f=r(57829),g=r(61113),Z=r(42832),b=r(76088),m=r(16783),v=r(9019),j=r(84488),S=r(61689),w=r(54882),y=r(47131),k=r(66835),C=r(23477),D=r(24076),R=r(67478),W=r(57861),P=r(85281),Y=r(94469),M=r(96467),z=r(69099),A=r(22539),T=r(51629),N=r(11577),I=r(33604),L=r(4117),B=r(25223),J=r(99004),F=r(59376),K=r(34605),O=r(78392),H=r(41156),G=r(98589),E=r(79254),q=r(46417);function V(e){var t=e.open,r=e.onClose,n=e.onApply,o=[{label:"Today",startDate:new Date,endDate:new Date},{label:"Yesterday",startDate:(0,J.Z)(new Date,-1),endDate:(0,J.Z)(new Date,-1)},{label:"Tomorrow",startDate:(0,J.Z)(new Date,1),endDate:(0,J.Z)(new Date,1)},{label:"This Week",startDate:(0,F.Z)(new Date),endDate:(0,K.Z)(new Date)},{label:"Last Week",startDate:(0,F.Z)((0,O.Z)(new Date,-1)),endDate:(0,K.Z)((0,O.Z)(new Date,-1))},{label:"Last 7 Days",startDate:(0,J.Z)(new Date,-7),endDate:new Date},{label:"This Month",startDate:(0,H.Z)(new Date),endDate:(0,G.Z)(new Date)},{label:"Last Month",startDate:(0,H.Z)((0,E.Z)(new Date,-1)),endDate:(0,G.Z)((0,E.Z)(new Date,-1))}];return(0,q.jsxs)(Y.Z,{open:t,onClose:function(){return onclose()},fullWidth:!0,maxWidth:"sm",children:[(0,q.jsx)(I.Z,{disableTypography:!0,children:(0,q.jsx)(Z.Z,{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",sx:{width:"100%"},children:(0,q.jsx)(g.Z,{variant:"h4",children:"Select Date Range"})})}),(0,q.jsx)(M.Z,{sx:{"& .MuiPaper-root":{boxShadow:"none !important"}},children:(0,q.jsx)(B.D,{open:t,toggle:r,definedRanges:o,onChange:function(e){null!==e&&void 0!==e&&e.startDate&&null!==e&&void 0!==e&&e.endDate&&(n({startDate:d()(e.startDate).format("YYYY-MM-DD"),endDate:d()(e.endDate).format("YYYY-MM-DD"),label:e.label||""}),r())},closeOnClickOutside:!1})}),(0,q.jsx)(L.Z,{children:(0,q.jsx)(z.Z,{variant:"contained",onClick:r,sx:{cursor:"pointer"},children:"Close"})})]})}var U=r(38215),Q=r(25963),X=r(91635);d().extend(X);var _=999,$=16,ee="0 14px 40px rgba(15, 23, 42, 0.10)",te="0 8px 24px rgba(15, 23, 42, 0.08)",re="0 18px 50px rgba(15, 23, 42, 0.18)",ne="#0f172a",oe="#64748b",ie="#94a3b8",ae="#e2e8f0",ce="#f1f5f9",se="#f8fafc",le=function(e,t){return"".concat(e).concat(t)},de=function(e){return le(e,"08")},ue=function(e){return le(e,"18")},xe=function(e){return le(e,"26")},he=function(e){return le(e,"55")},pe="#662582",fe=function(e){return(0,q.jsx)(h.Z,(0,a.Z)((0,a.Z)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:re,border:"1px solid",borderColor:"divider",overflow:"hidden"}}))},ge=function(e){var t=e.color,r=e.selected,n=e.size,o=void 0===n?24:n,i=e.children;return(0,q.jsx)(p.Z,{sx:{width:o,height:o,bgcolor:r?t:ue(t),color:r?"#fff":t,transition:"background-color 0.15s, color 0.15s"},children:i})},Ze=function(e){return{"& .MuiOutlinedInput-root":{borderRadius:_+"px",bgcolor:de(e),fontWeight:600,"& fieldset":{borderColor:he(e),borderWidth:1.5},"&:hover fieldset":{borderColor:e},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(xe(e))},"&.Mui-focused fieldset":{borderColor:e,borderWidth:2}}}},be={created:{label:"Created",color:"#0ea5e9",icon:A.ili},pending:{label:"Pending",color:"#f59e0b",icon:A.Ley},processing:{label:"Processing",color:pe,icon:A.dKE},modified:{label:"Confirmed",color:"#10b981",icon:A.ZSR},confirmed:{label:"Confirmed",color:"#10b981",icon:A.ZSR},ready:{label:"Accepted",color:"#6366f1",icon:A.ZSR},active:{label:"Picked",color:"#8b5cf6",icon:A.ili},closed:{label:"Closed",color:"#06b6d4",icon:A.ZSR},delivered:{label:"Delivered",color:"#10b981",icon:A.ZSR},cancelled:{label:"Cancelled",color:"#ef4444",icon:A.B4e}},me=[{idx:0,status:"created",label:"Created",color:pe,icon:A.ili,countKey:"created"},{idx:1,status:"pending",label:"Pending",color:"#f59e0b",icon:A.Ley,countKey:"pending"},{idx:2,status:"delivered",label:"Delivered",color:"#10b981",icon:A.ZSR,countKey:"delivered"},{idx:3,status:"cancelled",label:"Cancelled",color:"#ef4444",icon:A.B4e,countKey:"cancelled"}],ve=function(e){var t=e.status,r=be[String(t||"").toLowerCase()]||{label:t||"\u2014",color:ie,icon:A.Y8K},n=r.icon;return(0,q.jsxs)(f.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:de(r.color),border:"1px solid ".concat(he(r.color)),color:r.color,fontSize:11,fontWeight:800,whiteSpace:"nowrap"},children:[(0,q.jsx)(n,{size:12})," ",r.label]})},je=function(e){var t=e.value,r=e.color,n=e.icon,o=e.isMoney,i=void 0!==o&&o,a=Number(t),c=i?"\u20b9".concat(Number.isFinite(a)?a.toFixed(2):"0.00"):Number.isFinite(a)?a:t||0;return!Number.isFinite(a)||0===a?(0,q.jsx)(g.Z,{variant:"caption",sx:{color:ie,fontWeight:700},children:c}):(0,q.jsxs)(f.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:.875,py:.25,borderRadius:999,bgcolor:de(r),border:"1px solid ".concat(he(r)),color:r,fontSize:12,fontWeight:800,whiteSpace:"nowrap"},children:[n,c]})},Se=function(){var e=localStorage.getItem("tenantid"),t=localStorage.getItem("tenantid"),r=(0,c.useRef)(),l=(0,c.useRef)(),I=(0,c.useState)(0),L=(0,i.Z)(I,2),B=L[0],J=L[1],F=(0,c.useState)(10),K=(0,i.Z)(F,2),O=K[0],H=K[1],G=(0,c.useState)(0),E=(0,i.Z)(G,2),X=(E[0],E[1]),_=(0,c.useState)("0"),re=(0,i.Z)(_,2),le=re[0],be=re[1],Se=(0,c.useState)("0"),we=(0,i.Z)(Se,2),ye=we[0],ke=we[1],Ce=(0,c.useState)("0"),De=(0,i.Z)(Ce,2),Re=De[0],We=De[1],Pe=(0,c.useState)("0"),Ye=(0,i.Z)(Pe,2),Me=Ye[0],ze=Ye[1],Ae=(0,c.useState)([]),Te=(0,i.Z)(Ae,2),Ne=Te[0],Ie=Te[1],Le=(0,c.useState)(""),Be=(0,i.Z)(Le,2),Je=Be[0],Fe=Be[1],Ke=(0,c.useState)(""),Oe=(0,i.Z)(Ke,2),He=Oe[0],Ge=Oe[1],Ee=(0,c.useState)(""),qe=(0,i.Z)(Ee,2),Ve=qe[0],Ue=qe[1],Qe=(0,c.useState)(""),Xe=(0,i.Z)(Qe,2),_e=Xe[0],$e=Xe[1],et=(0,c.useState)(!1),tt=(0,i.Z)(et,2),rt=tt[0],nt=tt[1],ot=((0,x.Z)(),(0,c.useState)(0)),it=(0,i.Z)(ot,2),at=it[0],ct=it[1],st=(0,c.useState)("Created"),lt=(0,i.Z)(st,2),dt=lt[0],ut=lt[1],xt=(0,c.useState)("created"),ht=(0,i.Z)(xt,2),pt=ht[0],ft=ht[1],gt=(0,c.useState)(),Zt=(0,i.Z)(gt,2),bt=Zt[0],mt=Zt[1],vt=(0,c.useState)(),jt=(0,i.Z)(vt,2),St=jt[0],wt=jt[1],yt=(0,c.useState)(),kt=(0,i.Z)(yt,2),Ct=kt[0],Dt=kt[1],Rt=(0,c.useState)(),Wt=(0,i.Z)(Rt,2),Pt=Wt[0],Yt=Wt[1],Mt=(0,c.useState)(!1),zt=(0,i.Z)(Mt,2),At=zt[0],Tt=zt[1],Nt=(0,c.useState)(""),It=(0,i.Z)(Nt,2),Lt=It[0],Bt=It[1],Jt=(0,c.useState)(0),Ft=(0,i.Z)(Jt,2),Kt=Ft[0],Ot=Ft[1],Ht=(0,c.useState)("All Locations"),Gt=(0,i.Z)(Ht,2),Et=Gt[0],qt=Gt[1],Vt=(0,c.useState)(!1),Ut=(0,i.Z)(Vt,2),Qt=Ut[0],Xt=Ut[1],_t=(0,c.useState)("Today"),$t=(0,i.Z)(_t,2),er=$t[0],tr=$t[1],rr=(0,c.useState)(d()().format("YYYY-MM-DD")),nr=(0,i.Z)(rr,2),or=nr[0],ir=nr[1],ar=(0,c.useState)(d()().format("YYYY-MM-DD")),cr=(0,i.Z)(ar,2),sr=cr[0],lr=cr[1],dr=(0,c.useState)(""),ur=(0,i.Z)(dr,2),xr=ur[0],hr=ur[1],pr=(0,c.useState)(""),fr=(0,i.Z)(pr,2),gr=fr[0],Zr=fr[1];(0,c.useEffect)((function(){var e=setTimeout((function(){Zr(xr)}),400);return function(){return clearTimeout(e)}}),[xr]);var br={created:bt,pending:St,delivered:Ct,cancelled:Pt},mr=(0,c.useRef)(null);!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"k";(0,c.useEffect)((function(){if(null!==e&&void 0!==e&&e.current){var r=function(r){var n;r.key.toLowerCase()===t.toLowerCase()&&(r.metaKey||r.ctrlKey)&&(r.preventDefault(),null===(n=e.current)||void 0===n||n.focus()),"Escape"===r.key&&document.activeElement===e.current&&e.current.blur()};return document.addEventListener("keydown",r),function(){return document.removeEventListener("keydown",r)}}}),[e,t])}(mr,"k");var vr=function(){var e=(0,o.Z)((0,n.Z)().mark((function e(){return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return nt(!0),e.next=3,u.Z.put("".concat("https://jupiter.nearle.app/live/api/v1","/orders/updateorder"),{orderheaderid:Lt,orderstatus:"cancelled",cancelled:d()().format("YYYY-MM-DD HH:mm:ss")}).then((function(e){e.data.status&&((0,s.yv)("Order Cancelled Successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),Rr(),Yr(),Tt(!1)),nt(!1)})).catch((function(e){console.log(e),nt(!1)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),jr=function(){var t=(0,o.Z)((0,n.Z)().mark((function t(r){var o,i,a;return(0,n.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=r.pageParam,i=void 0===o?1:o,t.next=3,u.Z.get("".concat("https://jupiter.nearle.app/live/api/v1","/orders/tenant/getorders/?tenantid=").concat(e,"&locationid=").concat(Kt,"&status=").concat(pt,"&fromdate=").concat(or,"&todate=").concat(sr,"&pageno=").concat(i,"&pagesize=").concat(O,"&keyword=").concat(gr));case 3:return a=t.sent,t.abrupt("return",{data:a.data.details,nextPage:a.data.details.length===O?i+1:void 0});case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Sr=(0,Q.N)({queryKey:[dt,or,sr,B,O,gr,Kt],queryFn:jr,getNextPageParam:function(e){return e.nextPage}}),wr=Sr.data,yr=Sr.fetchNextPage,kr=Sr.isLoading,Cr=Sr.hasNextPage,Dr=Sr.isFetchingNextPage,Rr=Sr.refetch,Wr=wr?wr.pages.flatMap((function(e){return e.data})):[];(0,c.useEffect)((function(){if(Cr){var e=new IntersectionObserver((function(e){e[0].isIntersecting&&yr()}),{root:document.querySelector(".MuiTableContainer-root"),rootMargin:"0px",threshold:1});return r.current&&e.observe(r.current),function(){r.current&&e.unobserve(r.current)}}}),[Cr,yr]);var Pr=function(){var t=(0,o.Z)((0,n.Z)().mark((function t(){return(0,n.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return nt(!0),t.prev=1,t.next=4,u.Z.get("".concat("https://jupiter.nearle.app/live/api/v1","/orders/getordersummary/?tenantid=").concat(e)).then((function(e){Fe(e.data.details.delivered.toString()),Ue(e.data.details.cancelled.toString()),Ge(e.data.details.pending.toString()),$e(e.data.details.created.toString()),be((Math.round(e.data.details.created/e.data.details.total*100)||0).toString()),We((Math.round(e.data.details.delivered/e.data.details.total*100)||0).toString()),ze((Math.round(e.data.details.cancelled/e.data.details.total*100)||0).toString()),ke((Math.round(e.data.details.pending/e.data.details.total*100)||0).toString()),nt(!1)})).catch((function(e){console.log(e),nt(!1)}));case 4:t.next=10;break;case 6:t.prev=6,t.t0=t.catch(1),console.log(t.t0),nt(!1);case 10:case"end":return t.stop()}}),t,null,[[1,6]])})));return function(){return t.apply(this,arguments)}}();(0,c.useEffect)((function(){Pr()}),[]);var Yr=function(){var t=(0,o.Z)((0,n.Z)().mark((function t(){return(0,n.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return nt(!0),t.prev=1,t.next=4,u.Z.get("".concat("https://jupiter.nearle.app/live/api/v1","/orders/getordersummary/?tenantid=").concat(e,"&locationid=").concat(Kt,"&fromdate=").concat(or,"&todate=").concat(sr)).then((function(e){mt(e.data.details.created),wt(e.data.details.pending),Dt(e.data.details.delivered),Yt(e.data.details.cancelled),0===at&&X(e.data.details.created),1===at&&X(e.data.details.pending),2===at&&X(e.data.details.delivered),3===at&&X(e.data.details.cancelled),nt(!1)})).catch((function(e){console.log(e),nt(!1)}));case 4:t.next=10;break;case 6:t.prev=6,t.t0=t.catch(1),console.log(t.t0),nt(!1);case 10:case"end":return t.stop()}}),t,null,[[1,6]])})));return function(){return t.apply(this,arguments)}}();(0,c.useEffect)((function(){Yr()}),[at,Kt,or,sr]);var Mr=function(){var e=(0,o.Z)((0,n.Z)().mark((function e(t){var r;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,u.Z.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenantlocations/?tenantid=").concat(t));case 3:r=e.sent,Ie(r.data.details||[]),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.log("gettenantlocations",e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}();(0,c.useEffect)((function(){Mr(t)}),[]);var zr=[{key:"created",label:"Created Orders",color:pe,icon:A.ili,value:_e,percentage:le},{key:"pending",label:"Pending Orders",color:"#f59e0b",icon:A.Ley,value:He,percentage:ye},{key:"delivered",label:"Delivered Orders",color:"#10b981",icon:A.ZSR,value:Je,percentage:Re},{key:"cancelled",label:"Cancelled Orders",color:"#ef4444",icon:A.B4e,value:Ve,percentage:Me}];return(0,q.jsxs)(c.Fragment,{children:[rt&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(N.Z,{}),(0,q.jsx)(U.Z,{})]}),(0,q.jsx)(h.Z,{elevation:0,sx:{mb:{xs:1.5,md:2},p:{xs:1.5,sm:2,md:2.5},borderRadius:$/8,border:"1px solid",borderColor:ae,background:"linear-gradient(135deg, ".concat(de(pe)," 0%, ").concat(de("#9255AB")," 100%)"),boxShadow:te},children:(0,q.jsxs)(Z.Z,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1.5,sm:2},children:[(0,q.jsxs)(Z.Z,{direction:"row",alignItems:"center",spacing:{xs:1.25,sm:1.75},children:[(0,q.jsx)(p.Z,{sx:{width:{xs:40,sm:48},height:{xs:40,sm:48},bgcolor:pe,color:"#fff",boxShadow:"0 6px 18px ".concat(xe(pe))},children:(0,q.jsx)(A.ili,{size:22})}),(0,q.jsxs)(Z.Z,{children:[(0,q.jsx)(g.Z,{variant:"h3",sx:{fontWeight:800,color:ne,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:"Orders"}),(0,q.jsxs)(Z.Z,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[(0,q.jsx)(f.Z,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 4px rgba(16,185,129,0.18)"}}),(0,q.jsxs)(g.Z,{variant:"caption",sx:{color:oe,fontWeight:600},children:["Live \xb7 ",Et," \xb7 ",er]})]})]})]}),1===Ne.length?(0,q.jsxs)(f.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.75,px:1.5,py:.75,borderRadius:999,bgcolor:de(pe),border:"1.5px solid ".concat(he(pe)),color:pe,fontWeight:800,fontSize:13},children:[(0,q.jsx)(A.x$F,{size:14})," ",Ne[0].locationname]}):(0,q.jsx)(b.Z,{options:Ne||[],getOptionLabel:function(e){return e?"".concat(e.locationname," (").concat(e.suburb||"",")"):""},PaperComponent:fe,onChange:function(e,t,r){t&&(Ot(t.locationid),qt(t.locationname)),"clear"===r&&(Ot(0),qt("All Locations"))},renderInput:function(e){return(0,q.jsx)(m.Z,(0,a.Z)((0,a.Z)({},e),{},{placeholder:"Select Location",size:"small",sx:(0,a.Z)((0,a.Z)({},Ze(pe)),{},{width:{xs:"100%",sm:260}}),InputProps:(0,a.Z)((0,a.Z)({},e.InputProps),{},{startAdornment:(0,q.jsx)(Z.Z,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5},children:(0,q.jsx)(ge,{color:pe,size:22,selected:!0,children:(0,q.jsx)(A.x$F,{size:13})})})})}))},sx:{width:{xs:"100%",sm:280}}})]})}),(0,q.jsx)(v.ZP,{container:!0,spacing:{xs:1.25,sm:1.5,md:2},children:zr.map((function(e){var t=e.icon;return(0,q.jsx)(v.ZP,{item:!0,xs:6,sm:6,md:3,children:(0,q.jsxs)(h.Z,{elevation:0,sx:{position:"relative",overflow:"hidden",p:{xs:1.25,sm:1.75,md:2.25},borderRadius:$/8,border:"1px solid",borderColor:ae,background:"#fff",transition:"transform 0.2s, box-shadow 0.2s, border-color 0.2s","&:hover":{transform:"translateY(-3px)",boxShadow:te,borderColor:he(e.color)}},children:[(0,q.jsx)(f.Z,{sx:{position:"absolute",top:0,left:0,right:0,height:3,background:"linear-gradient(90deg, ".concat(e.color," 0%, ").concat(ue(e.color)," 100%)")}}),(0,q.jsxs)(Z.Z,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,q.jsxs)(Z.Z,{spacing:.5,sx:{minWidth:0,flex:1},children:[(0,q.jsx)(g.Z,{variant:"caption",sx:{color:oe,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:{xs:10,sm:11},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.label}),(0,q.jsx)(g.Z,{sx:{fontWeight:800,color:ne,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:""===e.value?(0,q.jsx)(j.Z,{sx:{width:40},animation:"wave"}):e.value}),null!=e.percentage&&(0,q.jsxs)(g.Z,{variant:"caption",sx:{color:oe,fontWeight:700},children:[e.percentage,"%"]})]}),(0,q.jsx)(p.Z,{sx:{width:{xs:36,sm:42,md:48},height:{xs:36,sm:42,md:48},bgcolor:ue(e.color),color:e.color,boxShadow:"inset 0 0 0 1px ".concat(he(e.color)),flexShrink:0},children:(0,q.jsx)(t,{size:20})})]})]})},e.key)}))}),(0,q.jsx)(h.Z,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1.25,md:1.75},borderRadius:$/8,border:"1px solid",borderColor:ae,background:"#fff",boxShadow:ee},children:(0,q.jsxs)(Z.Z,{direction:{xs:"column",md:"row"},spacing:1.25,alignItems:{xs:"stretch",md:"center"},justifyContent:{xs:"flex-start",md:"space-between"},children:[(0,q.jsxs)(Z.Z,{direction:"row",spacing:1,alignItems:"center",flexWrap:"wrap",useFlexGap:!0,children:[(0,q.jsx)(S.Z,{title:"Date Filter",placement:"top",children:(0,q.jsxs)(f.Z,{onClick:function(){return Xt(!0)},sx:{display:"inline-flex",alignItems:"center",gap:.75,px:1.25,py:.75,borderRadius:999,cursor:"pointer",bgcolor:de("#f59e0b"),border:"1.5px solid ".concat(he("#f59e0b")),color:"#f59e0b",fontWeight:800,fontSize:12,transition:"all 0.18s","&:hover":{borderColor:"#f59e0b",boxShadow:"0 0 0 3px ".concat(xe("#f59e0b"))}},children:[(0,q.jsx)(A.sHf,{size:14}),d()(or).format("DD/MM/YY")," \u2013 ",d()(sr).format("DD/MM/YY")]})}),(0,q.jsxs)(f.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.5,borderRadius:999,bgcolor:de(pe),border:"1px solid ".concat(he(pe)),color:pe,fontSize:11,fontWeight:800},children:[(0,q.jsx)(A.VHP,{size:12})," ",er]})]}),Ne.length>1&&(0,q.jsx)(b.Z,{options:Ne||[],getOptionLabel:function(e){return e?"".concat(e.locationname," (").concat(e.suburb||"",")"):""},PaperComponent:fe,onChange:function(e,t,r){t&&(Ot(t.locationid),qt(t.locationname)),"clear"===r&&(Ot(0),qt("All Locations"))},renderInput:function(e){return(0,q.jsx)(m.Z,(0,a.Z)((0,a.Z)({},e),{},{placeholder:"Select Location",size:"small",sx:Ze("#10b981"),InputProps:(0,a.Z)((0,a.Z)({},e.InputProps),{},{startAdornment:(0,q.jsx)(Z.Z,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5},children:(0,q.jsx)(ge,{color:"#10b981",size:22,selected:!0,children:(0,q.jsx)(A.c7Z,{size:13})})})})}))},sx:{width:{xs:"100%",md:320}}})]})}),(0,q.jsx)(h.Z,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1,md:1.5},borderTopLeftRadius:$/8,borderTopRightRadius:$/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:ae,borderBottom:0,background:"#fff"},children:(0,q.jsxs)(Z.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",gap:1.5,sx:{flexWrap:"wrap-reverse"},children:[(0,q.jsx)(Z.Z,{direction:"row",spacing:.75,sx:{flex:1,overflowX:"auto",py:.5,px:.25,"&::-webkit-scrollbar":{height:6},"&::-webkit-scrollbar-thumb":{backgroundColor:ae,borderRadius:4}},children:me.map((function(e){var t,r=e.icon,n=at===e.idx,o=null!==(t=br[e.countKey])&&void 0!==t?t:0;return(0,q.jsxs)(f.Z,{onClick:function(t){return function(e,t){hr(""),H(10),ct(t);var r=me[t];ut(r.label),ft(r.status),J(0)}(0,e.idx)},sx:{display:"inline-flex",alignItems:"center",gap:{xs:.625,md:.875},pl:.5,pr:{xs:1,md:1.25},py:.5,flexShrink:0,cursor:"pointer",borderRadius:999,border:"1.5px solid ".concat(n?e.color:he(e.color)),bgcolor:n?e.color:de(e.color),color:n?"#fff":e.color,fontWeight:700,boxShadow:n?"0 6px 18px ".concat(xe(e.color)):"none",transition:"all 0.18s","&:hover":{borderColor:e.color,boxShadow:n?"0 6px 18px ".concat(xe(e.color)):"0 0 0 3px ".concat(xe(e.color))}},children:[(0,q.jsx)(p.Z,{sx:{width:{xs:22,md:26},height:{xs:22,md:26},bgcolor:n?"rgba(255,255,255,0.22)":ue(e.color),color:n?"#fff":e.color},children:(0,q.jsx)(r,{size:13})}),(0,q.jsx)(g.Z,{variant:"caption",sx:{fontWeight:800,fontSize:{xs:11.5,md:13},lineHeight:1},children:e.label}),(0,q.jsx)(f.Z,{sx:{minWidth:{xs:22,md:26},height:{xs:18,md:22},px:.625,display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:999,fontSize:{xs:10,md:11},fontWeight:800,bgcolor:n?"rgba(255,255,255,0.22)":"#fff",color:n?"#fff":e.color,border:n?"none":"1px solid ".concat(he(e.color))},children:null!==o&&void 0!==o?o:0})]},e.status)}))}),(0,q.jsx)(f.Z,{sx:{width:{xs:"100%",sm:240,lg:280},flex:{xs:"1 1 100%",sm:"0 0 auto"}},children:(0,q.jsxs)(f.Z,{sx:{display:"flex",alignItems:"center",gap:.75,px:1.25,py:.5,borderRadius:999,bgcolor:de(pe),border:"1.5px solid ".concat(he(pe)),transition:"all 0.18s","&:focus-within":{borderColor:pe,boxShadow:"0 0 0 3px ".concat(xe(pe))}},children:[(0,q.jsx)(A.vU7,{size:16,style:{color:pe,flexShrink:0}}),(0,q.jsx)(w.ZP,{inputRef:mr,placeholder:"Search (ctrl+k)",value:xr,onChange:function(e){return hr(e.target.value)},autoComplete:"off",sx:{flex:1,fontSize:13,fontWeight:600,color:ne,"& input::placeholder":{color:ie,opacity:1}}}),xr&&(0,q.jsx)(y.Z,{size:"small",onClick:function(){hr(""),Rr(),Yr()},sx:{p:.25,color:pe},children:(0,q.jsx)(A.lUB,{size:14})})]})})]})}),(0,q.jsx)(h.Z,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:$/8,borderBottomRightRadius:$/8,border:"1px solid",borderColor:ae,overflow:"hidden",background:"#fff"},children:(0,q.jsx)(T.Z,{onScroll:function(e){var t=e.currentTarget,r=t.scrollTop,n=t.scrollHeight;r+t.clientHeight>=n-50&&Cr&&!Dr&&yr()},ref:l,sx:{maxHeight:{xs:"calc(100vh - 220px)",md:"calc(100vh - 190px)"},overflow:"auto","&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-thumb":{backgroundColor:he(pe),borderRadius:8,"&:hover":{backgroundColor:pe}},"&::-webkit-scrollbar-track":{backgroundColor:se}},children:(0,q.jsxs)(k.Z,{stickyHeader:!0,sx:{minWidth:{xs:960,md:1180}},children:[(0,q.jsx)(C.Z,{children:(0,q.jsxs)(D.Z,{sx:{"& th":{backgroundColor:se,color:oe,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(ae),py:{xs:1,md:1.25},px:{xs:1,md:1.5}}},children:[(0,q.jsx)(R.Z,{children:"#"}),(0,q.jsx)(R.Z,{children:"Order Location"}),(0,q.jsx)(R.Z,{children:"Pickup"}),(0,q.jsx)(R.Z,{children:"Drop"}),(0,q.jsx)(R.Z,{align:"center",children:"Qty"}),(0,q.jsx)(R.Z,{align:"right",children:"COD"}),(0,q.jsx)(R.Z,{align:"center",children:"Kms"}),(0,q.jsx)(R.Z,{align:"right",children:"Charges"}),(0,q.jsx)(R.Z,{children:"Notes"}),(0,q.jsx)(R.Z,{children:"Status"}),"created"===pt&&(0,q.jsx)(R.Z,{align:"right",children:"Actions"})]})}),(0,q.jsxs)(W.Z,{children:[(kr||rt)&&0===Wr.length&&[0,1,2,3,4,5].map((function(e,t){return(0,q.jsx)(D.Z,{children:Array.from({length:"created"===pt?11:10}).map((function(e,t){return(0,q.jsx)(R.Z,{sx:{borderBottom:"1px solid ".concat(ce)},children:(0,q.jsx)(j.Z,{animation:"wave"})},t)}))},"sk-".concat(t))})),!kr&&0===Wr.length&&(0,q.jsx)(D.Z,{children:(0,q.jsx)(R.Z,{colSpan:"created"===pt?11:10,sx:{py:6,borderBottom:"none"},children:(0,q.jsxs)(Z.Z,{alignItems:"center",spacing:1.5,children:[(0,q.jsx)(p.Z,{sx:{width:64,height:64,bgcolor:ue("#94a3b8"),color:ie},children:(0,q.jsx)(A.ili,{size:28})}),(0,q.jsxs)(g.Z,{variant:"subtitle1",sx:{fontWeight:700,color:ne},children:["No ",pt," orders"]}),(0,q.jsx)(g.Z,{variant:"caption",sx:{color:oe},children:xr?"Try a different keyword.":"Adjust the filters above to load orders."})]})})}),Wr.map((function(e,t){var r;return(0,q.jsxs)(D.Z,{sx:{cursor:"pointer",transition:"background-color 0.15s","& td":{borderBottom:"1px solid ".concat(ce),py:{xs:1,md:1.25},px:{xs:1,md:1.5}},"&:hover":{backgroundColor:se}},children:[(0,q.jsx)(R.Z,{children:(0,q.jsx)(g.Z,{sx:{fontWeight:700,color:oe},children:B*O+t+1})}),(0,q.jsxs)(R.Z,{children:[(0,q.jsxs)(g.Z,{variant:"subtitle2",sx:{fontWeight:700,color:ne},noWrap:!0,children:[e.locationname,e.locationsuburb&&" - ".concat(e.locationsuburb)]}),(0,q.jsx)(S.Z,{title:"Order Id",children:(0,q.jsx)(g.Z,{variant:"caption",sx:{color:oe},noWrap:!0,children:e.orderid})}),(0,q.jsxs)(Z.Z,{direction:"row",spacing:.75,alignItems:"center",sx:{mt:.25},children:[(0,q.jsx)(A.dKE,{size:11,style:{color:ie}}),(0,q.jsxs)(g.Z,{sx:{fontSize:11,color:oe,fontWeight:600},noWrap:!0,children:[d()(e.pickupslot).format("DD/MM/YYYY")," \xb7 ",d()(e.pickupslot).format("hh:mm A")]})]})]}),(0,q.jsx)(R.Z,{children:(0,q.jsxs)(Z.Z,{direction:"column",children:[(0,q.jsx)(g.Z,{variant:"subtitle2",sx:{fontWeight:700,color:ne},noWrap:!0,children:e.pickupcustomer}),(0,q.jsx)(g.Z,{variant:"caption",sx:{color:oe},children:e.pickupcontactno}),(0,q.jsx)(S.Z,{title:e.pickupaddress,children:(0,q.jsx)(g.Z,{variant:"caption",sx:{color:ie},noWrap:!0,children:e.pickupsuburb||(e.pickupaddress?"".concat(e.pickupaddress.slice(0,20),"\u2026"):"\u2014")})})]})}),(0,q.jsx)(R.Z,{children:(0,q.jsxs)(Z.Z,{direction:"column",children:[(0,q.jsx)(g.Z,{variant:"subtitle2",sx:{fontWeight:700,color:ne},noWrap:!0,children:e.deliverycustomer}),(0,q.jsx)(g.Z,{variant:"caption",sx:{color:oe},children:e.deliverycontactno}),(0,q.jsx)(S.Z,{title:e.deliveryaddress,children:(0,q.jsx)(g.Z,{variant:"caption",sx:{color:ie},noWrap:!0,children:e.deliverysuburb||((null===(r=e.deliveryaddress)||void 0===r?void 0:r.length)>20?"".concat(e.deliveryaddress.slice(0,20),"\u2026"):e.deliveryaddress||"\u2014")})})]})}),(0,q.jsx)(R.Z,{align:"center",children:(0,q.jsx)(je,{value:e.quantity,color:"#0ea5e9",icon:(0,q.jsx)(A.ByW,{size:11})})}),(0,q.jsx)(R.Z,{align:"right",children:(0,q.jsx)(je,{value:e.collectionamt,color:"#10b981",icon:(0,q.jsx)(A.vCl,{size:11}),isMoney:!0})}),(0,q.jsx)(R.Z,{align:"center",children:(0,q.jsx)(je,{value:e.kms,color:"#f59e0b",icon:(0,q.jsx)(A.v93,{size:11})})}),(0,q.jsx)(R.Z,{align:"right",children:(0,q.jsx)(je,{value:e.deliverycharge,color:pe,icon:(0,q.jsx)(A.vCl,{size:11}),isMoney:!0})}),(0,q.jsx)(R.Z,{children:e.ordernotes?(0,q.jsxs)(Z.Z,{direction:"row",spacing:.5,alignItems:"center",sx:{color:oe},children:[(0,q.jsx)(A.Dri,{size:12,style:{color:ie,flexShrink:0}}),(0,q.jsx)(g.Z,{variant:"caption",sx:{maxWidth:140,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontWeight:600},children:e.ordernotes})]}):(0,q.jsx)(g.Z,{variant:"caption",sx:{color:ie},children:"\u2014"})}),(0,q.jsx)(R.Z,{children:(0,q.jsx)(ve,{status:e.orderstatus})}),"created"===pt&&(0,q.jsx)(R.Z,{align:"right",children:"created"===e.orderstatus&&(0,q.jsx)(S.Z,{title:"Cancel Order",children:(0,q.jsx)(y.Z,{size:"small",onClick:function(t){t.stopPropagation(),Bt(e.orderheaderid),Tt(!0)},sx:{bgcolor:de("#ef4444"),border:"1px solid ".concat(he("#ef4444")),color:"#ef4444",borderRadius:999,p:.75,"&:hover":{bgcolor:ue("#ef4444"),borderColor:"#ef4444"}},children:(0,q.jsx)(A.FU5,{size:14})})})})]},"".concat(e.orderheaderid,"-").concat(t))})),0!==Wr.length&&(0,q.jsx)(D.Z,{children:(0,q.jsx)(R.Z,{colSpan:15,rowSpan:3,sx:{borderBottom:"none"},children:(0,q.jsx)("div",{ref:r,style:{height:40,textAlign:"center"},children:Dr||Cr?(0,q.jsx)(P.Z,{size:20,sx:{color:pe}}):(0,q.jsx)(g.Z,{variant:"caption",sx:{color:ie,fontWeight:700},children:"No more orders"})})})})]})]})})}),(0,q.jsxs)(Y.Z,{open:At,onClose:function(){return Tt(!1)},maxWidth:"xs",PaperProps:{sx:{borderRadius:3}},children:[(0,q.jsx)(f.Z,{sx:{p:2.5,background:"linear-gradient(135deg, ".concat(de("#ef4444")," 0%, ").concat(de("#f59e0b")," 100%)"),borderBottom:"1px solid ".concat(ae)},children:(0,q.jsxs)(Z.Z,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,q.jsx)(p.Z,{sx:{bgcolor:"#ef4444",color:"#fff",width:40,height:40},children:(0,q.jsx)(A.F1H,{size:20})}),(0,q.jsx)(g.Z,{variant:"h5",sx:{fontWeight:800,color:ne},children:"Cancel Order"})]})}),(0,q.jsx)(M.Z,{sx:{pt:3},children:(0,q.jsxs)(Z.Z,{alignItems:"center",spacing:3,children:[(0,q.jsx)(g.Z,{variant:"body1",align:"center",sx:{color:oe,fontWeight:600},children:"Are you sure you want to cancel this order? This action cannot be undone."}),(0,q.jsxs)(Z.Z,{direction:"row",spacing:1.5,sx:{width:1},children:[(0,q.jsx)(z.Z,{fullWidth:!0,onClick:function(){return Tt(!1)},variant:"outlined",sx:{borderRadius:999,py:1,borderColor:ae,color:oe,fontWeight:700,"&:hover":{borderColor:oe,bgcolor:se}},children:"No"}),(0,q.jsx)(z.Z,{fullWidth:!0,variant:"contained",onClick:vr,autoFocus:!0,sx:{borderRadius:999,py:1,bgcolor:"#ef4444",fontWeight:700,boxShadow:"0 6px 18px ".concat(xe("#ef4444")),"&:hover":{bgcolor:"#dc2626"}},children:"Yes, Cancel"})]})]})})]}),(0,q.jsx)(V,{open:Qt,onClose:function(){return Xt(!1)},onApply:function(e){var t=e.startDate,r=e.endDate,n=e.label;ir(t),lr(r),tr(n)}})]})}},4117:function(e,t,r){r.d(t,{Z:function(){return g}});var n=r(63366),o=r(87462),i=r(47313),a=r(83061),c=r(21921),s=r(17592),l=r(77342),d=r(77430),u=r(32298);function x(e){return(0,u.Z)("MuiDialogActions",e)}(0,d.Z)("MuiDialogActions",["root","spacing"]);var h=r(46417),p=["className","disableSpacing"],f=(0,s.ZP)("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:function(e,t){var r=e.ownerState;return[t.root,!r.disableSpacing&&t.spacing]}})((function(e){var t=e.ownerState;return(0,o.Z)({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},!t.disableSpacing&&{"& > :not(:first-of-type)":{marginLeft:8}})})),g=i.forwardRef((function(e,t){var r=(0,l.Z)({props:e,name:"MuiDialogActions"}),i=r.className,s=r.disableSpacing,d=void 0!==s&&s,u=(0,n.Z)(r,p),g=(0,o.Z)({},r,{disableSpacing:d}),Z=function(e){var t=e.classes,r={root:["root",!e.disableSpacing&&"spacing"]};return(0,c.Z)(r,x,t)}(g);return(0,h.jsx)(f,(0,o.Z)({className:(0,a.Z)(Z.root,i),ownerState:g,ref:t},u))}))},33604:function(e,t,r){var n=r(87462),o=r(63366),i=r(47313),a=r(83061),c=r(21921),s=r(61113),l=r(17592),d=r(77342),u=r(93174),x=r(63909),h=r(46417),p=["className","id"],f=(0,l.ZP)(s.Z,{name:"MuiDialogTitle",slot:"Root",overridesResolver:function(e,t){return t.root}})({padding:"16px 24px",flex:"0 0 auto"}),g=i.forwardRef((function(e,t){var r=(0,d.Z)({props:e,name:"MuiDialogTitle"}),s=r.className,l=r.id,g=(0,o.Z)(r,p),Z=r,b=function(e){var t=e.classes;return(0,c.Z)({root:["root"]},u.a,t)}(Z),m=i.useContext(x.Z).titleId,v=void 0===m?l:m;return(0,h.jsx)(f,(0,n.Z)({component:"h2",className:(0,a.Z)(b.root,s),ownerState:Z,ref:t,variant:"h6",id:null!=l?l:v},g))}));t.Z=g},25963:function(e,t,r){r.d(t,{N:function(){return p}});var n=r(1413),o=r(15671),i=r(43144),a=r(11752),c=r(61120),s=r(60136),l=r(27277),d=r(18948),u=r(52100),x=function(e){(0,s.Z)(r,e);var t=(0,l.Z)(r);function r(e,n){return(0,o.Z)(this,r),t.call(this,e,n)}return(0,i.Z)(r,[{key:"bindMethods",value:function(){(0,a.Z)((0,c.Z)(r.prototype),"bindMethods",this).call(this),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}},{key:"setOptions",value:function(e,t){(0,a.Z)((0,c.Z)(r.prototype),"setOptions",this).call(this,(0,n.Z)((0,n.Z)({},e),{},{behavior:(0,u.Gm)()}),t)}},{key:"getOptimisticResult",value:function(e){return e.behavior=(0,u.Gm)(),(0,a.Z)((0,c.Z)(r.prototype),"getOptimisticResult",this).call(this,e)}},{key:"fetchNextPage",value:function(e){return this.fetch((0,n.Z)((0,n.Z)({},e),{},{meta:{fetchMore:{direction:"forward"}}}))}},{key:"fetchPreviousPage",value:function(e){return this.fetch((0,n.Z)((0,n.Z)({},e),{},{meta:{fetchMore:{direction:"backward"}}}))}},{key:"createResult",value:function(e,t){var o,i,s,l,d=e.state,x=(0,a.Z)((0,c.Z)(r.prototype),"createResult",this).call(this,e,t),h=x.isFetching,p=x.isRefetching,f=h&&"forward"===(null===(o=d.fetchMeta)||void 0===o||null===(i=o.fetchMore)||void 0===i?void 0:i.direction),g=h&&"backward"===(null===(s=d.fetchMeta)||void 0===s||null===(l=s.fetchMore)||void 0===l?void 0:l.direction);return(0,n.Z)((0,n.Z)({},x),{},{fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:(0,u.Qy)(t,d.data),hasPreviousPage:(0,u.ZF)(t,d.data),isFetchingNextPage:f,isFetchingPreviousPage:g,isRefetching:p&&!f&&!g})}}]),r}(d.z),h=r(51695);function p(e,t){return(0,h.r)(e,x,t)}}}]); |