1 line
71 KiB
JavaScript
1 line
71 KiB
JavaScript
"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[2851],{22851:(e,o,r)=>{r.r(o),r.d(o,{default:()=>Be});var t=r(89379),i=r(85571),n=r(8881),l=r(24513),s=r(36256),d=r(9950),c=r(4159),a=r.n(c),h=r(26910),x=r(14857),u=r(31222),p=r(51778),g=r(36150),f=r(60010),v=r(2235),A=r(41413),b=r(47223),m=r(55158),j=r(60899),w=r(93230),S=r(82053),y=r(77922),W=r(25277),C=r(29925),k=r(16491),R=r(1320),z=r(93038),D=r(25333),P=r(15769),I=r(69780),L=r(9213),M=r(21671),Y=r(34075),T=r(83274),F=r(33738),E=r(17239),K=r(23266),O=r(96583),N=r(28170),H=r(82223),B=r(40033),J=r(79739),q=r(37476),G=r(56712),Z=r(81417),U=r(96600),V=r(53132),Q=r(94289),X=r(57326),_=r(50624),$=r(55916),ee=r(52351),oe=r(67562),re=r(49883),te=r(81425),ie=r(56311),ne=r(20466),le=r(96646),se=r(59212),de=r(58691),ce=r(27001),ae=r(36803),he=r(23787),xe=r(44414),ue=r(36220);a().extend(ue);const pe=14,ge=10,fe="0 1px 3px rgba(15, 23, 42, 0.06)",ve="0 12px 32px rgba(15, 23, 42, 0.12)",Ae="#0f172a",be="#64748b",me="#94a3b8",je="#e2e8f0",we="#cbd5e1",Se="#f1f5f9",ye="#ffffff",We="#f8fafc",Ce="#662582",ke=(e,o)=>"".concat(e).concat(o),Re=e=>ke(e,"08"),ze=e=>ke(e,"18"),De=e=>ke(e,"26"),Pe=e=>ke(e,"55"),Ie=()=>({cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:ge+"px",bgcolor:ye,fontWeight:600,color:Ae,paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s","& fieldset":{borderColor:je,borderWidth:1},"&:hover fieldset":{borderColor:we},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(De(Ce))},"&.Mui-focused fieldset":{borderColor:Ce,borderWidth:1.5}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:me}}),Le={pending:{label:"Pending",color:"#f59e0b",icon:u.tX0},accepted:{label:"Accepted",color:"#6366f1",icon:u.Azs},arrived:{label:"Arrived",color:"#06b6d4",icon:u.gwi},picked:{label:"Picked",color:"#8b5cf6",icon:u.gsJ},active:{label:"Active",color:"#14b8a6",icon:u.pk7},skipped:{label:"Skipped",color:"#f97316",icon:u.ivF},delivered:{label:"Delivered",color:"#10b981",icon:u.mU9},cancelled:{label:"Cancelled",color:"#ef4444",icon:u.uDv}},Me=[{status:"pending",countKey:"uncoveredLength"},{status:"accepted",countKey:"assignedLength"},{status:"arrived",countKey:"arrivedLength"},{status:"picked",countKey:"pickedLength"},{status:"active",countKey:"activeLength"},{status:"skipped",countKey:"skippedLength"},{status:"delivered",countKey:"coveredLength"},{status:"cancelled",countKey:"cancelLength"}],Ye=[{key:"created",label:"Created Orders",color:"#0ea5e9",icon:u.HU2},{key:"pending",label:"Pending Orders",color:"#f59e0b",icon:u.G6c},{key:"delivered",label:"Delivered Orders",color:"#10b981",icon:u.cAP},{key:"cancelled",label:"Cancelled Orders",color:"#ef4444",icon:u.qiG}],Te=[{id:"all",label:"All Batches",range:"Across the day",color:"#7c3aed",iconKey:"all"},{id:"morning",label:"Morning Batch",range:"12 AM to 8 AM",color:"#0ea5e9",iconKey:"morning",startHour:0,endHour:8},{id:"afternoon",label:"Afternoon Batch",range:"9 AM to 12:30 PM",color:"#f59e0b",iconKey:"afternoon",startHour:9,endHour:12.5},{id:"evening",label:"Evening Batch",range:"4 PM to 7 PM",color:"#6366f1",iconKey:"evening",startHour:16,endHour:19}],Fe={all:u.lB9,morning:u.N3N,afternoon:u.aSE,evening:u.giK},Ee=()=>{const e=a()(),o=e.hour()+e.minute()/60;for(const r of Te)if("all"!==r.id&&o>=r.startHour&&o<r.endHour)return r.id;return"all"},Ke=["assigntime"],Oe=e=>{let o=null;for(const n of Ke)if(null!==e&&void 0!==e&&e[n]){o=e[n];break}if(!o)return null;const r=String(o).trim();if(/^\d{4}-\d{2}-\d{2}$/.test(r))return null;const t=a()(o);if(!t.isValid())return null;const i=t.hour()+t.minute()/60;for(const n of Te)if("all"!==n.id&&i>=n.startHour&&i<n.endHour)return n.id;return null},Ne=e=>(0,xe.jsx)(v.A,(0,t.A)((0,t.A)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:ve,border:"1px solid",borderColor:"divider",overflow:"hidden"}})),He=e=>{let{color:o,selected:r,size:t=24,children:i}=e;return(0,xe.jsx)(A.A,{sx:{width:t,height:t,bgcolor:r?o:ze(o),color:r?"#fff":o,transition:"background-color 0.15s, color 0.15s"},children:i})},Be=()=>{const e=localStorage.getItem("userid"),o=(0,x.A)(),r=(0,b.A)(o.breakpoints.down("md")),c=(0,d.useRef)(),ue=(0,d.useRef)(),[ke,Ke]=(0,d.useState)([]),[Be,Je]=(0,d.useState)(!1),[qe,Ge]=(0,d.useState)("All"),[Ze,Ue]=(0,d.useState)(0),[Ve,Qe]=(0,d.useState)(a()().format("YYYY-MM-DD")),[Xe,_e]=(0,d.useState)(a()().format("YYYY-MM-DD")),[$e,eo]=(0,d.useState)("Pending"),[oo,ro]=(0,d.useState)(0),[to,io]=(0,d.useState)(!1),[no,lo]=(0,d.useState)("Today"),[so,co]=(0,d.useState)(""),[ao,ho]=(0,d.useState)(),[xo,uo]=(0,d.useState)(),[po,go]=(0,d.useState)(""),[fo,vo]=(0,d.useState)({}),[Ao,bo]=(0,d.useState)(""),[mo,jo]=(0,d.useState)(""),[wo,So]=(0,d.useState)("pending"),[yo,Wo]=(0,d.useState)("delivered"),Co=(0,d.useRef)(null),ko=(0,d.useRef)(null),[Ro,zo]=d.useState(0),[Do,Po]=d.useState(50),[Io,Lo]=d.useState(),[Mo,Yo]=(0,d.useState)(null),[To,Fo]=(0,d.useState)(null),[Eo,Ko]=(0,d.useState)(""),[Oo,No]=(0,d.useState)(""),[Ho,Bo]=d.useState(null),[Jo,qo]=(0,d.useState)(null),[Go,Zo]=(0,d.useState)(!1),[Uo,Vo]=d.useState(null),[Qo,Xo]=(0,d.useState)(""),[_o,$o]=(0,d.useState)(!1),[er,or]=(0,d.useState)(!1),[rr,tr]=(0,d.useState)(""),[ir,nr]=(0,d.useState)(null),[lr,sr]=(0,d.useState)(0),[dr,cr]=(0,d.useState)(0),[ar,hr]=(0,d.useState)(null),[xr,ur]=(0,d.useState)(null),[pr,gr]=(0,d.useState)(0),[fr,vr]=(0,d.useState)(Ee),Ar=localStorage.getItem("roleid");(0,d.useEffect)((()=>{sr(0),hr(null),cr(0),ur(null)}),[Ze]),(0,d.useEffect)((()=>{cr(0),ur(null)}),[lr]);const br=Boolean(Ho),mr=(e,o)=>{qo(o),console.log("selectedRow",o),Bo(e.currentTarget)},jr=()=>{Bo(null)},{mutate:wr}=(0,p.n)({mutationFn:e=>{let{selectedRow:o,cancelFeed:r}=e;return(0,te.zF)(o,r)},onSuccess:()=>{Lr("Delivery Cancelled Successfully","success"),$o(!1),ot(),Kr(),qr()},onError:e=>{Lr(e.message,"error")}}),{data:Sr,isLoading:yr,isError:Wr,error:Cr}=(0,g.I)({queryKey:["tenantlist",Ze],queryFn:()=>(0,te.Mn)(Ze),enabled:0!==Ze}),{data:kr,isLoading:Rr,isError:zr,error:Dr}=(0,g.I)({queryKey:["gettenantlocations",lr],queryFn:()=>(0,te.DL)(lr),enabled:0!==lr}),Pr=(0,p.n)({mutationFn:te.k3,onSuccess:()=>{(0,n.M8)("Notification sent Successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})},onError:e=>{(0,n.M8)(e.message,{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})}}),Ir=(0,p.n)({mutationFn:e=>{let{selectedRider:o,selectedRow:r}=e;return(0,te.R_)(o,r)},onSuccess:(e,o)=>{let{selectedRider:r,selectedRow:t}=o;Zo(!1),or(!1),"Success"===e.data.message&&(i.A.info("Rider changed successfully for order ID ".concat(null===t||void 0===t?void 0:t.orderid,". New Rider: ").concat(null===r||void 0===r?void 0:r.firstname," ").concat(null===r||void 0===r?void 0:r.lastname)),Lr("Rider Changed Successfully","success")),ot(),Kr(),qr(),Pr.mutate(r.userfcmtoken)},onError:(e,o)=>{let{selectedRider:r,selectedRow:t}=o;i.A.error("Failed to change rider for order ID ".concat(null===t||void 0===t?void 0:t.orderid,":"),e),Lr(e.message,"error"),Zo(!1)}}),Lr=(e,o)=>{(0,n.M8)(e,{variant:o,anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})},{data:Mr}=(0,g.I)({queryKey:["orderdetails",To],queryFn:()=>(0,te.z3)(To),enabled:!!To}),Yr=()=>{Je(!1)},{isLoading:Tr,isError:Fr,error:Er,refetch:Kr}=(0,f.q)({queryKey:["fetchdeliveries",Ze,e,wo,Ve,Xe,Do,Oo,lr,dr,pr],queryFn:te.tL,getNextPageParam:e=>{var o;return null!==(o=e.nextPage)&&void 0!==o?o:void 0}}),{data:Or,fetchNextPage:Nr,hasNextPage:Hr,isFetchingNextPage:Br,isLoading:Jr,refetch:qr}=(0,f.q)({queryKey:["fetchdeliveries-batchcounts",Ze,e,"all",Ve,Xe,200,"",lr,dr,pr],queryFn:te.tL,getNextPageParam:e=>{var o;return null!==(o=e.nextPage)&&void 0!==o?o:void 0}}),Gr=(0,d.useMemo)((()=>((null===Or||void 0===Or?void 0:Or.pages)||[]).flatMap((e=>e.rows||[]))),[Or]);(0,d.useEffect)((()=>{Hr&&!Br&&Nr()}),[Hr,Br,Nr,Gr.length]);const Zr=Hr||Br,Ur=(0,d.useMemo)((()=>{const e=String(wo||"").toLowerCase(),o=String(Oo||"").trim().toLowerCase();return Gr.filter((r=>{if("all"!==fr&&Oe(r)!==fr)return!1;const t=String(r.orderstatus||"").toLowerCase();if(e&&t!==e)return!1;if(o){if(![r.deliverycustomer,r.deliveryaddress,r.deliverysuburb,r.pickupcustomer,r.pickupaddress,r.pickupsuburb,r.orderid,r.tenantname,r.ridername,r.username].map((e=>String(e||"").toLowerCase())).join(" ").includes(o))return!1}return!0}))}),[Gr,fr,wo,Oo]),Vr=(0,d.useMemo)((()=>{const e={uncoveredLength:0,assignedLength:0,arrivedLength:0,pickedLength:0,activeLength:0,skippedLength:0,coveredLength:0,cancelLength:0};return Gr.forEach((o=>{if("all"!==fr&&Oe(o)!==fr)return;switch(String(o.orderstatus||"").toLowerCase()){case"pending":e.uncoveredLength+=1;break;case"accepted":case"assigned":e.assignedLength+=1;break;case"arrived":e.arrivedLength+=1;break;case"picked":e.pickedLength+=1;break;case"active":e.activeLength+=1;break;case"skipped":e.skippedLength+=1;break;case"delivered":e.coveredLength+=1;break;case"cancelled":case"canceled":e.cancelLength+=1}})),e}),[Gr,fr]),Qr=(0,d.useMemo)((()=>{const e={all:0};return Te.forEach((o=>{"all"!==o.id&&(e[o.id]=0)})),Gr.forEach((o=>{const r=Oe(o);r&&(e[r]=(e[r]||0)+1,e.all+=1)})),e}),[Gr]);(0,d.useEffect)((()=>{if(!Hr)return;const e=new IntersectionObserver((e=>{e[0].isIntersecting&&Nr()}),{root:document.querySelector(".MuiTableContainer-root"),rootMargin:"0px",threshold:1});return c.current&&e.observe(c.current),()=>{c.current&&e.unobserve(c.current)}}),[Hr,Nr]);const{data:Xr={},isLoading:_r,isError:$r,error:et,refetch:ot}=(0,g.I)({queryKey:["fetchCountData",Ze,e,Ve,Xe,Do,Oo,lr,dr,pr,$e],queryFn:()=>(0,te.qB)(Ze,e,Ve,Xe,Do,Oo,lr,dr,pr)});(0,d.useEffect)((()=>{console.log("countData",Xr),0===oo&&Xr&&Lo(Xr.uncoveredLength)}),[Xr]);const{data:rt=[],isLoading:tt,isError:it,error:nt}=(0,g.I)({queryKey:["ridersList",Ze],queryFn:te.Sd,enabled:Boolean(Ze),onError:e=>{(0,ne.k)(e.message,"error",2e3)}}),lt=(0,p.n)({mutationFn:e=>(0,te.wT)(e),onSuccess:e=>{console.log(e),e.data.status&&(Lr("Updated Successfully","success"),uo(""),go(""),Je(!1),Kr(),ot(),qr())},onError:e=>{console.log(e),Lr(e.message,"success")}}),st=Fr?"Error fetching deliveries: ".concat(null===Er||void 0===Er?void 0:Er.message):$r?"Error fetching count summary: ".concat(null===et||void 0===et?void 0:et.message):it?"Error fetching riders: ".concat(null===nt||void 0===nt?void 0:nt.message):Wr?"Error tenant list: ".concat(null===Cr||void 0===Cr?void 0:Cr.message):zr?"Error location list: ".concat(null===Dr||void 0===Dr?void 0:Dr.message):null;return st?(console.log("errorMessage",st),(0,ne.k)(st,"error",2e3),null):(0,xe.jsxs)(xe.Fragment,{children:[(_r||Jr||yr||Rr||tt)&&(0,xe.jsx)(xe.Fragment,{children:(0,xe.jsx)(ee.A,{})}),(0,xe.jsx)(m.A,{sx:{color:"#fff",zIndex:e=>e.zIndex.drawer+1},open:_r||Tr||yr||Rr||tt}),(0,xe.jsx)(ce.A,{title:"Deliveries",subtitle:"Live \xb7 ".concat(qe||"All Zones"),live:!0,action:(0,xe.jsx)(se.A,{ref:Co,locaName:qe,setAppId:Ue,setLocoName:Ge,setPage:zo,pill:!0,accentColor:"#662582",icon:(0,xe.jsx)(u.HPi,{size:14}),placeholder:"Select Zone",paperComponent:Ne,sx:{width:{xs:"100%",sm:280},zIndex:100}})}),(0,xe.jsx)(j.Ay,{container:!0,spacing:{xs:2,md:2.5},sx:{mb:{xs:1.5,md:2}},children:[(0,t.A)((0,t.A)({},Ye[0]),{},{value:Qr.all,percentage:null}),(0,t.A)((0,t.A)({},Ye[1]),{},{value:null===Xr||void 0===Xr?void 0:Xr.uncoveredLength,percentage:null!==Xr&&void 0!==Xr&&Xr.total?Math.round(Xr.uncoveredLength/Xr.total*100):0}),(0,t.A)((0,t.A)({},Ye[2]),{},{value:null===Xr||void 0===Xr?void 0:Xr.coveredLength,percentage:null!==Xr&&void 0!==Xr&&Xr.total?Math.round(Xr.coveredLength/Xr.total*100):0}),(0,t.A)((0,t.A)({},Ye[3]),{},{value:null===Xr||void 0===Xr?void 0:Xr.cancelLength,percentage:null!==Xr&&void 0!==Xr&&Xr.total?Math.round(Xr.cancelLength/Xr.total*100):0})].map((e=>{var o;const r=e.icon,t="number"===typeof e.percentage?e.percentage:Number(e.percentage),i=!Number.isNaN(t)&&void 0!==e.percentage&&null!==e.percentage;return(0,xe.jsx)(j.Ay,{item:!0,xs:6,sm:6,md:3,children:(0,xe.jsx)(ae.A,{title:e.label,value:null!==(o=e.value)&&void 0!==o?o:0,icon:(0,xe.jsx)(r,{size:20}),color:e.color,loading:_r,caption:i?"".concat(Math.abs(t),"% of total"):void 0})},e.key)}))}),(0,xe.jsxs)(v.A,{elevation:0,sx:{mt:{xs:1.5,md:2},mb:{xs:1.5,md:2},p:{xs:1.5,md:2},borderRadius:pe/8,border:"1px solid",borderColor:je,background:"#fff",boxShadow:fe},children:[(0,xe.jsxs)(w.A,{direction:"row",alignItems:"center",spacing:1,sx:{mb:{xs:1,md:1.5},color:be},children:[(0,xe.jsx)(A.A,{sx:{width:28,height:28,bgcolor:ze("#662582"),color:"#662582"},children:(0,xe.jsx)(u.MiI,{size:16})}),(0,xe.jsx)(S.A,{variant:"caption",sx:{fontWeight:800,letterSpacing:.6,textTransform:"uppercase",color:be},children:"Filters"})]}),(0,xe.jsxs)(w.A,{direction:"row",justifyContent:"space-between",alignItems:"center",gap:1.25,sx:{flexWrap:"wrap"},children:[(0,xe.jsxs)(w.A,{direction:"row",flexWrap:"wrap",gap:1.5,alignItems:"center",children:[(()=>{const e=Te.find((e=>e.id===fr))||Te[0],o=Fe[e.iconKey]||u.VP9;return(0,xe.jsx)(y.A,{disableClearable:!0,size:"small",openOnFocus:!0,selectOnFocus:!0,filterOptions:e=>e,options:Te,value:e,onChange:(e,o)=>o&&vr(o.id),getOptionLabel:e=>e.label,isOptionEqualToValue:(e,o)=>e.id===o.id,PaperComponent:Ne,ListboxProps:{sx:{py:0,maxHeight:360}},renderOption:(e,o,r)=>{var i;let{selected:n}=r;const l=Fe[o.iconKey]||u.VP9,s=null!==(i=Qr[o.id])&&void 0!==i?i:0;return(0,d.createElement)("li",(0,t.A)((0,t.A)({},e),{},{key:o.id,style:{display:"flex",alignItems:"center",gap:12,padding:"10px 14px",borderBottom:"1px solid #f1f5f9",backgroundColor:n?"".concat(o.color,"10"):"transparent",transition:"background-color 0.15s"}}),(0,xe.jsx)(A.A,{sx:{width:36,height:36,bgcolor:n?o.color:"".concat(o.color,"18"),color:n?"#fff":o.color,transition:"background-color 0.15s, color 0.15s"},children:(0,xe.jsx)(l,{size:20})}),(0,xe.jsxs)(w.A,{direction:"column",spacing:0,flex:1,minWidth:0,children:[(0,xe.jsx)(S.A,{variant:"body2",fontWeight:700,color:"#0f172a",noWrap:!0,children:o.label}),(0,xe.jsx)(S.A,{variant:"caption",color:"text.secondary",noWrap:!0,children:o.range})]}),(0,xe.jsx)(W.A,{size:"small",label:s,sx:{minWidth:36,height:22,fontWeight:800,fontSize:11,bgcolor:s>0?"".concat(o.color,"18"):"#f1f5f9",color:s>0?o.color:"#94a3b8",border:"1px solid ".concat(s>0?o.color+"55":"#e2e8f0"),"& .MuiChip-label":{px:.75}}}),n&&(0,xe.jsx)(A.A,{sx:{width:22,height:22,bgcolor:o.color,color:"#fff"},children:(0,xe.jsx)(u.g9_,{size:14})}))},renderInput:r=>{var i;return(0,xe.jsx)(C.A,(0,t.A)((0,t.A)({},r),{},{placeholder:"Batch",inputProps:(0,t.A)((0,t.A)({},r.inputProps),{},{readOnly:!0,style:(0,t.A)((0,t.A)({},(null===(i=r.inputProps)||void 0===i?void 0:i.style)||{}),{},{cursor:"pointer",caretColor:"transparent"})}),InputProps:(0,t.A)((0,t.A)({},r.InputProps),{},{startAdornment:(0,xe.jsx)(w.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,xe.jsx)(A.A,{sx:{width:24,height:24,bgcolor:"".concat(e.color,"18"),color:e.color},children:(0,xe.jsx)(o,{size:14})})})}),sx:{minWidth:{xs:180,sm:220,md:240},cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"10px",bgcolor:"#ffffff",fontWeight:600,color:"#0f172a",paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s","& fieldset":{borderColor:"#e2e8f0",borderWidth:1},"&:hover fieldset":{borderColor:"#cbd5e1"},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(De("#662582"))},"&.Mui-focused fieldset":{borderColor:"#662582",borderWidth:1.5}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:"#94a3b8"}}}))}})})(),Ve&&Xe&&(0,xe.jsxs)(w.A,{direction:"row",alignItems:"center",spacing:.75,onClick:()=>io(!0),sx:{pl:.5,pr:1.25,py:.5,borderRadius:"10px",cursor:"pointer",bgcolor:"#ffffff",border:"1px solid #e2e8f0",transition:"border-color 0.15s","&:hover":{borderColor:"#cbd5e1"}},children:[(0,xe.jsx)(He,{color:"#94a3b8",children:(0,xe.jsx)(u.tjE,{size:14})}),(0,xe.jsxs)(S.A,{variant:"caption",sx:{fontWeight:600,color:"#475569",whiteSpace:"nowrap"},children:[a()(Ve).format("DD MMM")," \u2013 ",a()(Xe).format("DD MMM")]})]})]}),(0,xe.jsx)(y.A,{disablePortal:!0,options:Sr||[],value:ar,PaperComponent:Ne,sx:{flex:{xs:"1 1 100%",sm:"1 1 180px"},minWidth:{xs:"100%",sm:180}},onOpen:e=>{Ze||(e.preventDefault(),(0,ne.k)("Please select your zone first!","warning",3e3),setTimeout((()=>{var e;return null===(e=Co.current)||void 0===e?void 0:e.focus()}),0))},onChange:(e,o,r)=>{"clear"===r?(sr(0),hr(null),cr(0),ur(null)):(sr((null===o||void 0===o?void 0:o.tenantid)||0),hr(o),cr(0),ur(null))},renderInput:e=>(0,xe.jsx)(C.A,(0,t.A)((0,t.A)({},e),{},{inputRef:ko,placeholder:"Select Tenant",InputProps:(0,t.A)((0,t.A)({},e.InputProps),{},{startAdornment:(0,xe.jsx)(w.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,xe.jsx)(He,{color:"#94a3b8",children:(0,xe.jsx)(u.gl1,{size:14})})})}),sx:Ie()}))}),(0,xe.jsx)(y.A,{disablePortal:!0,options:kr||[],getOptionLabel:e=>"".concat(e.locationname," (").concat(e.suburb,")")||0,value:xr,PaperComponent:Ne,sx:{flex:{xs:"1 1 100%",sm:"1 1 180px"},minWidth:{xs:"100%",sm:180}},onOpen:e=>{Ze||lr?lr||(e.preventDefault(),(0,ne.k)("Please select your Tenant first!","warning",3e3),setTimeout((()=>{var e;return null===(e=ko.current)||void 0===e?void 0:e.focus()}),0)):(e.preventDefault(),(0,ne.k)("Please select your Zone and Tenant first!","warning",3e3),setTimeout((()=>{var e;return null===(e=Co.current)||void 0===e?void 0:e.focus()}),0))},onChange:(e,o,r)=>{"clear"===r?(cr(0),ur(null)):(cr(o.locationid||0),ur(o))},renderInput:e=>(0,xe.jsx)(C.A,(0,t.A)((0,t.A)({},e),{},{placeholder:"Select Location",InputProps:(0,t.A)((0,t.A)({},e.InputProps),{},{startAdornment:(0,xe.jsx)(w.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,xe.jsx)(He,{color:"#94a3b8",children:(0,xe.jsx)(u.gwi,{size:14})})})}),sx:Ie()}))}),(0,xe.jsx)(y.A,{disabled:tt,options:rt,PaperComponent:Ne,getOptionLabel:e=>"".concat(e.firstname," ").concat(e.lastname," (").concat(e.contactno,")"),sx:{flex:{xs:"1 1 100%",sm:"1 1 180px"},minWidth:{xs:"100%",sm:180}},onChange:(e,o,r)=>{gr("clear"===r?0:o.userid)},onOpen:e=>{Ze||(e.preventDefault(),(0,ne.k)("Please select your zone first!","warning",3e3),setTimeout((()=>{var e;return null===(e=Co.current)||void 0===e?void 0:e.focus()}),0))},renderInput:e=>(0,xe.jsx)(C.A,(0,t.A)((0,t.A)({},e),{},{placeholder:"Choose Rider",InputProps:(0,t.A)((0,t.A)({},e.InputProps),{},{startAdornment:(0,xe.jsx)(w.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,xe.jsx)(He,{color:"#94a3b8",children:(0,xe.jsx)(u.bsz,{size:14})})})}),sx:Ie()}))})]})]}),(0,xe.jsx)(v.A,{elevation:0,sx:{p:{xs:1,md:1.5},borderTopLeftRadius:pe/8,borderTopRightRadius:pe/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:je,borderBottom:0,background:"#fff"},children:(0,xe.jsxs)(w.A,{direction:"row",alignItems:"center",justifyContent:"space-between",gap:1.5,sx:{flexWrap:"wrap-reverse"},children:[(0,xe.jsx)(w.A,{direction:"row",spacing:.75,sx:{flex:1,overflowX:"auto",py:.5,px:.25,"&::-webkit-scrollbar":{height:6},"&::-webkit-scrollbar-thumb":{backgroundColor:je,borderRadius:4}},children:Me.map(((e,o)=>{var r;const t=Le[e.status],i=t.icon,n=oo===o,l=null!==(r=Vr[e.countKey])&&void 0!==r?r:0;return(0,xe.jsxs)(k.A,{onClick:e=>{return r=o,zo(0),ro(r),Po(50),0===r&&(eo("Pending"),So("pending"),Lo(null===Xr||void 0===Xr?void 0:Xr.uncoveredLength)),1===r&&(eo("Assigned"),So("accepted"),Lo(null===Xr||void 0===Xr?void 0:Xr.assignedLength)),2===r&&(eo("Arrived"),So("arrived"),Lo(null===Xr||void 0===Xr?void 0:Xr.arrivedLength)),3===r&&(eo("Picked"),So("picked"),Lo(null===Xr||void 0===Xr?void 0:Xr.pickedLength)),4===r&&(eo("Active"),So("active"),Lo(null===Xr||void 0===Xr?void 0:Xr.activeLength)),5===r&&(eo("Skipped"),So("skipped"),Lo(null===Xr||void 0===Xr?void 0:Xr.skippedLength)),6===r&&(eo("Delivered"),So("delivered"),Lo(null===Xr||void 0===Xr?void 0:Xr.coveredLength)),7===r&&(eo("Cancelled"),So("cancelled"),Lo(null===Xr||void 0===Xr?void 0:Xr.cancelLength)),console.log(r),void Ko("");var r},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:ge+"px",border:"1px solid ".concat(n?t.color:je),bgcolor:n?t.color:ye,color:n?"#fff":be,fontWeight:600,boxShadow:"none",transition:"background-color 0.15s, border-color 0.15s, color 0.15s","&:hover":{borderColor:n?t.color:we,bgcolor:n?t.color:We}},children:[(0,xe.jsx)(A.A,{sx:{width:{xs:20,md:22},height:{xs:20,md:22},bgcolor:n?"rgba(255,255,255,0.22)":ze(t.color),color:n?"#fff":t.color},children:(0,xe.jsx)(i,{size:12})}),(0,xe.jsx)(S.A,{variant:"caption",sx:{fontWeight:600,fontSize:{xs:11.5,md:13},lineHeight:1},children:t.label}),(0,xe.jsx)(k.A,{sx:{minWidth:{xs:20,md:24},height:{xs:18,md:20},px:.625,display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:999,fontSize:{xs:10,md:11},fontWeight:700,bgcolor:n?"rgba(255,255,255,0.22)":We,color:n?"#fff":be,border:"none"},children:l})]},e.status)}))}),(0,xe.jsx)(k.A,{sx:{width:{xs:"100%",sm:240,lg:280},flex:{xs:"1 1 100%",sm:"0 0 auto"}},children:(0,xe.jsx)(ie.A,{value:Eo,onChange:Ko,onDebouncedChange:No,sx:{m:0,width:"100%",borderRadius:ge+"px",bgcolor:ye,"& fieldset":{borderColor:je,borderWidth:1},"&:hover fieldset":{borderColor:we},"&.Mui-focused fieldset":{borderColor:Ce,borderWidth:1.5},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(De(Ce))}}})})]})}),(0,xe.jsx)(v.A,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:pe/8,borderBottomRightRadius:pe/8,border:"1px solid",borderColor:je,overflow:"hidden",background:"#fff"},children:(0,xe.jsx)(R.A,{ref:ue,onScroll:e=>{const{scrollTop:o,scrollHeight:r,clientHeight:t}=e.currentTarget;o+t>=r-50&&Hr&&!Br&&Nr()},sx:{maxHeight:{xs:"calc(100vh - 220px)",md:"calc(100vh - 190px)"},overflow:"auto",overflowX:"auto","&::-webkit-scrollbar":{width:"10px",height:"10px",cursor:"pointer"},"&::-webkit-scrollbar-thumb":{backgroundColor:Pe("#662582"),borderRadius:"8px",cursor:"pointer","&:hover":{backgroundColor:"#662582"}},"&::-webkit-scrollbar-track":{backgroundColor:We}},children:((e,o,i,n,s,h)=>{const x="Cancelled"!==$e&&"Delivered"!==$e,p="Created"==$e,g=15+(x?1:0)+(p?1:0);return r?(0,xe.jsxs)(he.nV,{sx:{p:1.25},children:[0===Ur.length&&!Go&&!Zr&&(0,xe.jsxs)(w.A,{alignItems:"center",spacing:1.5,sx:{py:6},children:[(0,xe.jsx)(A.A,{sx:{width:64,height:64,bgcolor:ze("#94a3b8"),color:me},children:(0,xe.jsx)(u.gsJ,{size:28})}),(0,xe.jsx)(S.A,{variant:"subtitle1",sx:{fontWeight:700,color:Ae},children:"No deliveries to show"}),(0,xe.jsx)(S.A,{variant:"caption",sx:{color:be,textAlign:"center",px:2},children:"all"===fr?"No ".concat(((null===(e=Le[wo])||void 0===e?void 0:e.label)||$e).toLowerCase()," orders for this filter."):"No ".concat(((null===(o=Le[wo])||void 0===o?void 0:o.label)||$e).toLowerCase()," orders in ").concat((null===(i=Te.find((e=>e.id===fr)))||void 0===i?void 0:i.label)||"this batch",".")})]}),0===Ur.length&&Zr&&(0,xe.jsxs)(w.A,{alignItems:"center",sx:{py:6},children:[(0,xe.jsx)(de.A,{}),(0,xe.jsx)(S.A,{variant:"caption",color:"text.secondary",sx:{mt:1},children:"Loading deliveries\u2026"})]}),Ur.map(((e,o)=>{var r,i,n,s,d,c,h,g;const f=Le[String(e.orderstatus||"").toLowerCase()]||{label:e.orderstatus||"\u2014",color:"#94a3b8",icon:u.bfP},v=f.icon,A=!!ke.find((o=>o.orderheaderid==e.orderheaderid)),b=(null===Mo||void 0===Mo?void 0:Mo.orderid)===(null===e||void 0===e?void 0:e.orderid),m=e=>({display:"inline-flex",alignItems:"center",justifyContent:"center",color:e,fontWeight:700,fontSize:12,whiteSpace:"nowrap"});return(0,xe.jsxs)(he.pg,{accent:f.color,selected:A,header:(0,xe.jsxs)(w.A,{spacing:1.25,children:[(0,xe.jsxs)(w.A,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,children:[(0,xe.jsxs)(w.A,{direction:"row",alignItems:"center",spacing:.75,sx:{minWidth:0},children:[p&&(0,xe.jsx)(z.A,{size:"small",sx:{p:.25},onChange:o=>{if(o.target.checked){let o=ke;o.push((0,t.A)((0,t.A)({},e),{},{sno:ke.length+1})),Ke([...o])}else{let o=ke.find((o=>o.orderheaderid==e.orderheaderid));if(o){let e=ke;e.splice(o.sno-1,1),e.map(((e,o)=>{e.sno=o+1})),Ke([...e])}}},checked:!!ke.find((o=>o.orderheaderid==e.orderheaderid))}),(0,xe.jsx)(S.A,{variant:"caption",sx:{fontWeight:700,color:me},children:String(Ro*Do+o+1).padStart(2,"0")}),(0,xe.jsxs)(w.A,{direction:"row",alignItems:"center",spacing:.5,sx:{display:"inline-flex",pl:.5,pr:1,py:.25,borderRadius:999,bgcolor:Re(f.color),border:"1px solid ".concat(Pe(f.color)),color:f.color},children:[(0,xe.jsx)(He,{color:f.color,size:18,children:(0,xe.jsx)(v,{size:11})}),(0,xe.jsx)(S.A,{variant:"caption",sx:{fontWeight:800,fontSize:10.5,lineHeight:1},children:f.label})]})]}),(0,xe.jsxs)(w.A,{direction:"row",spacing:.75,sx:{flexShrink:0},children:["C"==e.deliverytype&&(0,xe.jsx)(D.A,{size:"small",onClick:()=>{(null===Mo||void 0===Mo?void 0:Mo.orderid)===e.orderid?(Yo(null),Fo(null)):(Yo(e),Fo(e.orderheaderid))},sx:{borderRadius:999,bgcolor:Re("#06b6d4"),color:"#06b6d4",border:"1px solid ".concat(Pe("#06b6d4")),"&:hover":{bgcolor:ze("#06b6d4")}},children:b?(0,xe.jsx)(oe.A,{fontSize:"small"}):(0,xe.jsx)(re.A,{fontSize:"small"})}),x&&(0,xe.jsx)(D.A,{size:"small",onClick:o=>mr(o,e),sx:{borderRadius:999,bgcolor:Re("#662582"),color:"#662582",border:"1px solid ".concat(Pe("#662582")),"&:hover":{bgcolor:ze("#662582")}},children:(0,xe.jsx)(l.A,{})})]})]}),(0,xe.jsxs)(k.A,{sx:{minWidth:0},children:[(0,xe.jsx)(S.A,{sx:{fontWeight:800,color:Ae,fontSize:15},noWrap:!0,children:e.tenantname}),(0,xe.jsx)(S.A,{variant:"caption",sx:{color:be},noWrap:!0,children:[e.tenantsuburb,e.applocation].filter(Boolean).join(" \xb7 ")||"\u2014"})]})]}),children:[(0,xe.jsxs)(he.FG,{children:[(0,xe.jsxs)(he.pY,{label:"Order / Location",full:!0,children:[(0,xe.jsx)(S.A,{sx:{fontSize:13,fontWeight:600,color:Ae},noWrap:!0,children:"".concat(e.locationname,"-(").concat(e.locationsuburb,")")}),(0,xe.jsxs)(S.A,{variant:"caption",sx:{color:be},children:[e.orderid," \xb7 ",e.deliveryid]})]}),(0,xe.jsxs)(he.pY,{label:"Pickup",children:[(0,xe.jsx)(S.A,{sx:{fontSize:13,fontWeight:600,color:Ae},noWrap:!0,children:e.pickupcustomer||"\u2014"}),(0,xe.jsx)(S.A,{variant:"caption",sx:{color:be},noWrap:!0,children:e.pickupcontactno})]}),(0,xe.jsxs)(he.pY,{label:"Drop",children:[(0,xe.jsx)(S.A,{sx:{fontSize:13,fontWeight:600,color:Ae},noWrap:!0,children:e.deliverycustomer||"\u2014"}),(0,xe.jsx)(S.A,{variant:"caption",sx:{color:be},noWrap:!0,children:e.deliverycontactno})]}),(0,xe.jsx)(he.pY,{label:"Rider",full:!0,children:e.ridername?(0,xe.jsxs)(w.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,xe.jsx)(He,{color:"#8b5cf6",size:24,children:(0,xe.jsx)(u.bsz,{size:13})}),(0,xe.jsxs)(w.A,{sx:{minWidth:0},children:[(0,xe.jsx)(S.A,{sx:{fontSize:13,fontWeight:700,color:Ae},noWrap:!0,children:e.ridername}),(0,xe.jsxs)(S.A,{variant:"caption",sx:{color:be},noWrap:!0,children:["ID #",e.userid," \xb7 ",e.ridercontact||"\u2014"]})]})]}):(0,xe.jsx)(S.A,{variant:"caption",sx:{color:me,fontWeight:600},children:"Unassigned"})}),(0,xe.jsx)(he.pY,{label:"ETA",value:e.expecteddeliverytime?a()(e.expecteddeliverytime).format("hh:mm A"):"\u2014"}),(0,xe.jsx)(he.pY,{label:"Transit",children:(0,xe.jsxs)(k.A,{sx:m("#06b6d4"),children:[e.transitminutes||0,"m"]})}),(0,xe.jsx)(he.pY,{label:"Kms \xb7 plan / act",children:(0,xe.jsxs)(w.A,{direction:"row",spacing:.5,flexWrap:"wrap",useFlexGap:!0,children:[(0,xe.jsxs)(k.A,{sx:m("#ef4444"),children:[e.kms||0," km"]}),(0,xe.jsxs)(k.A,{sx:m("#10b981"),children:[e.cumulativekms||0," km"]})]})}),(0,xe.jsx)(he.pY,{label:"Amount \xb7 chg / amt",children:(0,xe.jsxs)(w.A,{direction:"row",spacing:.5,flexWrap:"wrap",useFlexGap:!0,children:[(0,xe.jsxs)(k.A,{sx:m("#ef4444"),children:["\u20b9 ",null!==(i=null===(n=e.deliverycharges)||void 0===n?void 0:n.toFixed(2))&&void 0!==i?i:"0.00"]}),(0,xe.jsxs)(k.A,{sx:m("#10b981"),children:["\u20b9 ",null!==(s=null===(d=e.deliveryamt)||void 0===d?void 0:d.toFixed(2))&&void 0!==s?s:"0.00"]})]})}),(0,xe.jsx)(he.pY,{label:"Qty",value:e.Quantity||"\u2014"}),(0,xe.jsx)(he.pY,{label:"COD",children:(0,xe.jsx)(S.A,{sx:{fontSize:13,fontWeight:800,color:e.collectionamt?"#ef4444":me},children:e.collectionamt?"\u20b9 ".concat(e.collectionamt.toFixed(2)):"\u2014"})}),(0,xe.jsx)(he.pY,{label:"Step",children:e.step?(0,xe.jsx)(k.A,{sx:(0,t.A)((0,t.A)({},m("#662582")),{},{minWidth:30,fontWeight:800}),children:e.step}):(0,xe.jsx)(S.A,{variant:"caption",sx:{color:me},children:"\u2014"})}),e.notes&&(0,xe.jsx)(he.pY,{label:"Notes",full:!0,children:(0,xe.jsx)(S.A,{variant:"caption",sx:{color:be},children:e.notes})})]}),b&&(0,xe.jsxs)(k.A,{sx:{mt:1.5,p:1.25,borderRadius:2,bgcolor:We,border:"1px solid ".concat(Se)},children:[(0,xe.jsxs)(w.A,{direction:"row",alignItems:"center",spacing:1,sx:{mb:1},children:[(0,xe.jsx)(He,{color:"#662582",size:22,children:(0,xe.jsx)(u.gsJ,{size:12})}),(0,xe.jsx)(S.A,{variant:"caption",sx:{fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#662582"},children:"Product Details"})]}),(0,xe.jsxs)(w.A,{spacing:1,children:[null===Mr||void 0===Mr||null===(c=Mr.details)||void 0===c?void 0:c.map(((e,o)=>(0,xe.jsxs)(w.A,{direction:"row",alignItems:"center",spacing:1.25,sx:{p:1,borderRadius:1.5,bgcolor:"#fff",border:"1px solid ".concat(Se)},children:[(0,xe.jsx)(k.A,{component:"img",src:(null===e||void 0===e?void 0:e.productimage)||"https://via.placeholder.com/40",alt:null===e||void 0===e?void 0:e.productname,sx:{width:36,height:36,objectFit:"cover",borderRadius:1.5,border:"1px solid ".concat(Se),flexShrink:0}}),(0,xe.jsxs)(w.A,{sx:{minWidth:0,flex:1},children:[(0,xe.jsx)(S.A,{variant:"body2",sx:{fontWeight:600,color:Ae},noWrap:!0,children:(null===e||void 0===e?void 0:e.productname)||"Unnamed"}),(0,xe.jsxs)(S.A,{variant:"caption",sx:{color:be},children:["Qty ",(null===e||void 0===e?void 0:e.orderqty)||0," \xb7 \u20b9 ",(null===e||void 0===e?void 0:e.price)||0]})]}),(0,xe.jsxs)(S.A,{variant:"body2",sx:{fontWeight:800,color:Ae,flexShrink:0},children:["\u20b9 ",((null===e||void 0===e?void 0:e.productsumprice)+(null===e||void 0===e?void 0:e.taxamount)).toFixed(2)||0]})]},o))),(0,xe.jsxs)(w.A,{direction:"row",justifyContent:"space-between",sx:{pt:.5},children:[(0,xe.jsx)(S.A,{variant:"caption",sx:{fontWeight:700,color:be},children:"Total Amount"}),(0,xe.jsxs)(S.A,{variant:"body2",sx:{fontWeight:800,color:"#10b981"},children:["\u20b9 ",null===Mr||void 0===Mr||null===(h=Mr.pricedetails)||void 0===h||null===(g=h.orderamount)||void 0===g?void 0:g.toFixed(2)]})]})]})]})]},null!==(r=e.orderheaderid)&&void 0!==r?r:"".concat(e.tenantname,"-").concat(o))})),0!=(null===Gr||void 0===Gr?void 0:Gr.length)&&(0,xe.jsx)("div",{ref:c,style:{height:40,textAlign:"center"},children:Br||Hr?(0,xe.jsx)(de.A,{}):(0,xe.jsx)(S.A,{variant:"caption",sx:{color:me,fontWeight:600},children:"\xb7 End of list \xb7"})})]}):(0,xe.jsxs)(P.A,{stickyHeader:!0,sx:{minWidth:{xs:1100,lg:1300,xl:1400}},children:[(0,xe.jsx)(I.A,{children:(0,xe.jsxs)(L.A,{sx:{"& th":{backgroundColor:We,color:be,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(je),py:{xs:1,md:1.25},px:{xs:1,md:2}}},children:[p&&(0,xe.jsx)(M.A,{sx:{whiteSpace:"nowrap"},children:(0,xe.jsx)(z.A,{indeterminate:ke.length>0&&ke.length!=Ur.length,onChange:e=>{e.target.checked?Ke([...Ur]):Ke([])},checked:ke.length>0&&ke.length==Ur.length})}),(0,xe.jsx)(M.A,{children:"#"}),(0,xe.jsx)(M.A,{children:"Status"}),(0,xe.jsx)(M.A,{children:"Tenant"}),(0,xe.jsx)(M.A,{children:"Order / Location"}),(0,xe.jsx)(M.A,{children:"Pickup"}),(0,xe.jsx)(M.A,{children:"Drop"}),(0,xe.jsx)(M.A,{children:"Rider"}),(0,xe.jsx)(M.A,{children:"ETA"}),(0,xe.jsx)(M.A,{children:"Transit"}),(0,xe.jsx)(M.A,{children:"Kms"}),(0,xe.jsx)(M.A,{children:"Amount"}),(0,xe.jsx)(M.A,{children:"Notes"}),(0,xe.jsx)(M.A,{children:"Step"}),(0,xe.jsx)(M.A,{children:"Qty"}),(0,xe.jsx)(M.A,{children:"COD"}),x&&(0,xe.jsx)(M.A,{align:"right",children:"Action"})]})}),(Go||Jr)&&(0,xe.jsx)(le.r,{col:8}),(0,xe.jsxs)(Y.A,{children:[0==Ur.length&&!Go&&!Zr&&(0,xe.jsx)(L.A,{children:(0,xe.jsx)(M.A,{colSpan:g,sx:{py:6},children:(0,xe.jsxs)(w.A,{alignItems:"center",spacing:1.5,children:[(0,xe.jsx)(A.A,{sx:{width:64,height:64,bgcolor:ze("#94a3b8"),color:me},children:(0,xe.jsx)(u.gsJ,{size:28})}),(0,xe.jsx)(S.A,{variant:"subtitle1",sx:{fontWeight:700,color:Ae},children:"No deliveries to show"}),(0,xe.jsx)(S.A,{variant:"caption",sx:{color:be},children:"all"===fr?"No ".concat(((null===(n=Le[wo])||void 0===n?void 0:n.label)||$e).toLowerCase()," orders for this filter."):"No ".concat(((null===(s=Le[wo])||void 0===s?void 0:s.label)||$e).toLowerCase()," orders in ").concat((null===(h=Te.find((e=>e.id===fr)))||void 0===h?void 0:h.label)||"this batch",".")})]})})}),0==Ur.length&&Zr&&(0,xe.jsx)(L.A,{children:(0,xe.jsxs)(M.A,{colSpan:g,sx:{textAlign:"center",py:6},children:[(0,xe.jsx)(de.A,{}),(0,xe.jsx)(S.A,{variant:"caption",color:"text.secondary",sx:{display:"block",mt:1},children:"Loading deliveries\u2026"})]})}),Ur.map(((e,o)=>{var r,i,n,s,c,h,x,p;const f=Le[String(e.orderstatus||"").toLowerCase()]||{label:e.orderstatus||"\u2014",color:"#94a3b8",icon:u.bfP},A=f.icon,b=!!ke.find((o=>o.orderheaderid==e.orderheaderid));return(0,xe.jsxs)(d.Fragment,{children:[(0,xe.jsxs)(L.A,{role:"checkbox",tabIndex:-1,sx:{cursor:"pointer",transition:"background-color 0.15s","& td":{borderBottom:"1px solid ".concat(Se),py:{xs:1,md:1.5},px:{xs:1,md:2}},backgroundColor:b?ze("#8b5cf6"):"transparent","&:hover":{backgroundColor:b?ze("#8b5cf6"):We}},children:["Created"==$e&&(0,xe.jsx)(M.A,{children:(0,xe.jsx)(z.A,{onChange:o=>{if(o.target.checked){let o=ke;o.push((0,t.A)((0,t.A)({},e),{},{sno:ke.length+1})),Ke([...o])}else{if(ke.find((o=>o.orderheaderid==e.orderheaderid))){let o=ke,r=ke.find((o=>o.orderheaderid==e.orderheaderid));o.splice(r.sno-1,1),o.map(((e,o)=>{e.sno=o+1})),Ke([...o])}}console.log("list",ke)},checked:ke.find((o=>o.orderheaderid==e.orderheaderid))})}),(0,xe.jsx)(M.A,{children:(0,xe.jsx)(S.A,{variant:"caption",sx:{fontWeight:700,color:me},children:String(Ro*Do+o+1).padStart(2,"0")})}),(0,xe.jsx)(M.A,{children:(0,xe.jsxs)(w.A,{direction:"row",alignItems:"center",spacing:.5,sx:{display:"inline-flex",pl:.5,pr:1,py:.25,borderRadius:999,bgcolor:Re(f.color),border:"1px solid ".concat(Pe(f.color)),color:f.color},children:[(0,xe.jsx)(He,{color:f.color,size:20,children:(0,xe.jsx)(A,{size:12})}),(0,xe.jsx)(S.A,{variant:"caption",sx:{fontWeight:800,fontSize:11,lineHeight:1},children:f.label})]})}),(0,xe.jsx)(M.A,{children:(0,xe.jsx)(T.A,{title:e.tenantadress,children:(0,xe.jsxs)(w.A,{children:[(0,xe.jsx)(S.A,{noWrap:!0,variant:"subtitle2",sx:{fontWeight:700,color:Ae},children:e.tenantname}),(0,xe.jsx)(S.A,{noWrap:!0,variant:"caption",sx:{color:be},children:e.tenantsuburb}),(0,xe.jsx)(S.A,{noWrap:!0,variant:"caption",sx:{color:me},children:e.applocation})]})})}),(0,xe.jsxs)(M.A,{align:"left",children:[(0,xe.jsx)(T.A,{title:"Location Name-Suburb",placement:"top",children:(0,xe.jsx)(S.A,{variant:"subtitle1",noWrap:!0,children:"".concat(e.locationname,"-(").concat(e.locationsuburb,")")})}),(0,xe.jsxs)(w.A,{display:"flex",flexDirection:"row",gap:3,children:[(0,xe.jsxs)(w.A,{children:[(0,xe.jsx)(T.A,{title:"Order Id",placement:"top",children:(0,xe.jsx)(S.A,{variant:"body2",noWrap:!0,children:e.orderid})}),(0,xe.jsxs)(T.A,{title:"Ordered date",placement:"top",children:[(0,xe.jsx)(S.A,{noWrap:!0,sx:{fontSize:"12px"},children:a()(e.orderdate).utc().format("DD/MM/YYYY")}),(0,xe.jsx)(S.A,{noWrap:!0,sx:{fontSize:"11px"},children:a()(e.orderdate).utc().format("hh:mm A")})]})]}),"-",(0,xe.jsxs)(w.A,{children:[(0,xe.jsx)(T.A,{title:"Delivery Id",placement:"top",children:(0,xe.jsx)(S.A,{variant:"body2",noWrap:!0,children:e.deliveryid})}),(0,xe.jsxs)(T.A,{title:"Delivery date",placement:"top",children:[(0,xe.jsx)(S.A,{noWrap:!0,sx:{fontSize:"12px"},children:a()(e.deliverydate).utc().format("DD/MM/YYYY")}),(0,xe.jsx)(S.A,{noWrap:!0,sx:{fontSize:"11px"},children:a()(e.deliverydate).utc().format("hh:mm A")})]})]})]})]}),(0,xe.jsx)(M.A,{align:"left",children:(0,xe.jsxs)(w.A,{children:[(0,xe.jsx)(S.A,{variant:"subtitle2",sx:{fontWeight:700,color:Ae,whiteSpace:"nowrap"},children:e.pickupcustomer}),(0,xe.jsx)(S.A,{variant:"caption",sx:{color:be},children:e.pickupcontactno}),(0,xe.jsx)(T.A,{title:e.Pickupaddress,sx:{whiteSpace:"nowrap"},children:(0,xe.jsx)(S.A,{variant:"caption",sx:{color:me},children:e.pickuplocation||(e.Pickupaddress?e.Pickupaddress.slice(0,14)+"\u2026":"\u2014")})})]})}),(0,xe.jsx)(M.A,{align:"left",children:(0,xe.jsxs)(w.A,{children:[(0,xe.jsx)(S.A,{variant:"subtitle2",sx:{fontWeight:700,color:Ae,whiteSpace:"nowrap"},children:e.deliverycustomer}),(0,xe.jsx)(S.A,{variant:"caption",sx:{color:be},children:e.deliverycontactno}),(0,xe.jsx)(T.A,{title:e.deliveryaddress,children:(0,xe.jsx)(S.A,{variant:"caption",sx:{color:me,whiteSpace:"nowrap"},children:e.deliverylocation||(e.deliveryaddress?e.deliveryaddress.slice(0,14)+"\u2026":"\u2014")})})]})}),(0,xe.jsx)(M.A,{children:e.ridername?(0,xe.jsxs)(w.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,xe.jsx)(He,{color:"#8b5cf6",size:28,children:(0,xe.jsx)(u.bsz,{size:14})}),(0,xe.jsxs)(w.A,{children:[(0,xe.jsx)(S.A,{variant:"subtitle2",sx:{fontWeight:700,color:Ae},noWrap:!0,children:e.ridername}),(0,xe.jsxs)(S.A,{variant:"caption",sx:{color:be},children:["ID #",e.userid," \xb7 ",e.ridercontact||"\u2014"]})]})]}):(0,xe.jsx)(S.A,{variant:"caption",sx:{color:me,fontWeight:600},children:"Unassigned"})}),(0,xe.jsx)(M.A,{align:"left",children:(0,xe.jsx)(S.A,{variant:"subtitle2",sx:{fontWeight:700,color:Ae,whiteSpace:"nowrap"},children:e.expecteddeliverytime?a()(e.expecteddeliverytime).format("hh:mm A"):"\u2014"})}),(0,xe.jsx)(M.A,{align:"left",children:(0,xe.jsxs)(k.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.5,borderRadius:999,bgcolor:Re("#06b6d4"),color:"#06b6d4",fontWeight:700,fontSize:12,border:"1px solid ".concat(Pe("#06b6d4"))},children:[e.transitminutes||0,"m"]})}),(0,xe.jsx)(M.A,{children:(0,xe.jsxs)(w.A,{direction:"column",spacing:.5,alignItems:"flex-start",children:[(0,xe.jsx)(T.A,{title:"Planned KMS",placement:"top",children:(0,xe.jsxs)(k.A,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",px:1.25,py:.375,borderRadius:999,bgcolor:Re("#ef4444"),color:"#ef4444",fontWeight:700,fontSize:11,border:"1px solid ".concat(Pe("#ef4444")),whiteSpace:"nowrap",minWidth:75},children:[e.kms||0," km"]})}),(0,xe.jsx)(T.A,{title:"Actual KMS",placement:"top",children:(0,xe.jsxs)(k.A,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",px:1.25,py:.375,borderRadius:999,bgcolor:Re("#10b981"),color:"#10b981",fontWeight:700,fontSize:11,border:"1px solid ".concat(Pe("#10b981")),whiteSpace:"nowrap",minWidth:75},children:[e.cumulativekms||0," km"]})})]})}),(0,xe.jsx)(M.A,{align:"left",children:(0,xe.jsxs)(w.A,{direction:"column",spacing:.5,alignItems:"flex-start",children:[(0,xe.jsx)(T.A,{title:"Delivery Charge",placement:"top",children:(0,xe.jsxs)(k.A,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",px:1.25,py:.375,borderRadius:999,bgcolor:Re("#ef4444"),color:"#ef4444",fontWeight:700,fontSize:11,border:"1px solid ".concat(Pe("#ef4444")),whiteSpace:"nowrap",minWidth:85},children:["\u20b9 ",null!==(i=null===(n=e.deliverycharges)||void 0===n?void 0:n.toFixed(2))&&void 0!==i?i:"0.00"]})}),(0,xe.jsx)(T.A,{title:"Delivery Amount",placement:"top",children:(0,xe.jsxs)(k.A,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",px:1.25,py:.375,borderRadius:999,bgcolor:Re("#10b981"),color:"#10b981",fontWeight:700,fontSize:11,border:"1px solid ".concat(Pe("#10b981")),whiteSpace:"nowrap",minWidth:85},children:["\u20b9 ",null!==(s=null===(c=e.deliveryamt)||void 0===c?void 0:c.toFixed(2))&&void 0!==s?s:"0.00"]})})]})}),(0,xe.jsx)(M.A,{children:e.notes?(0,xe.jsx)(T.A,{title:e.notes,children:(0,xe.jsx)(S.A,{variant:"caption",sx:{color:be,maxWidth:160,display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.notes})}):(0,xe.jsx)(S.A,{variant:"caption",sx:{color:me},children:"\u2014"})}),(0,xe.jsx)(M.A,{align:"center",children:e.step?(0,xe.jsx)(k.A,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:30,height:24,px:.875,borderRadius:999,bgcolor:Re("#662582"),border:"1px solid ".concat(Pe("#662582")),color:"#662582",fontWeight:800,fontSize:11},children:e.step}):(0,xe.jsx)(S.A,{variant:"caption",sx:{color:me},children:"\u2014"})}),(0,xe.jsx)(M.A,{children:(0,xe.jsx)(S.A,{variant:"subtitle2",sx:{fontWeight:700,color:e.Quantity?Ae:me,whiteSpace:"nowrap"},children:e.Quantity||"\u2014"})}),(0,xe.jsx)(M.A,{children:(0,xe.jsx)(S.A,{variant:"subtitle2",sx:{fontWeight:800,color:e.collectionamt?"#ef4444":me,whiteSpace:"nowrap"},children:e.collectionamt?"\u20b9 ".concat(e.collectionamt.toFixed(2)):"\u2014"})}),"Cancelled"!==$e&&"Delivered"!==$e&&(0,xe.jsx)(M.A,{align:"right",children:(0,xe.jsxs)(w.A,{direction:"row",justifyContent:"flex-end",spacing:.75,children:["C"==e.deliverytype&&(0,xe.jsx)(T.A,{title:"Product details",placement:"top",children:(0,xe.jsx)(D.A,{size:"small",onClick:()=>{(null===Mo||void 0===Mo?void 0:Mo.orderid)===e.orderid?(Yo(null),Fo(null)):(Yo(e),Fo(e.orderheaderid))},sx:{borderRadius:999,bgcolor:Re("#06b6d4"),color:"#06b6d4",border:"1px solid ".concat(Pe("#06b6d4")),"&:hover":{bgcolor:ze("#06b6d4")}},children:(null===Mo||void 0===Mo?void 0:Mo.orderid)===e.orderid?(0,xe.jsx)(oe.A,{fontSize:"small"}):(0,xe.jsx)(re.A,{fontSize:"small"})})}),(0,xe.jsx)(T.A,{title:"Actions",placement:"top",children:(0,xe.jsx)(D.A,{size:"small",onClick:o=>mr(o,e),sx:{borderRadius:999,bgcolor:Re("#662582"),color:"#662582",border:"1px solid ".concat(Pe("#662582")),"&:hover":{bgcolor:ze("#662582")}},children:(0,xe.jsx)(l.A,{})})})]})})]}),(null===Mo||void 0===Mo?void 0:Mo.orderid)===(null===e||void 0===e?void 0:e.orderid)&&(0,xe.jsx)(L.A,{children:(0,xe.jsx)(M.A,{colSpan:g,sx:{p:0,border:0,backgroundColor:We},children:(0,xe.jsx)(F.A,{in:!0,timeout:"auto",unmountOnExit:!0,children:(0,xe.jsx)(k.A,{sx:{width:"100%",p:2.5},children:(0,xe.jsxs)(v.A,{elevation:0,sx:{borderRadius:2,border:"1px solid",borderColor:je,overflow:"hidden",background:"#fff"},children:[(0,xe.jsxs)(w.A,{direction:"row",alignItems:"center",spacing:1,sx:{px:2,py:1.25,borderBottom:"1px solid ".concat(Se),bgcolor:Re("#662582")},children:[(0,xe.jsx)(He,{color:"#662582",children:(0,xe.jsx)(u.gsJ,{size:14})}),(0,xe.jsx)(S.A,{variant:"caption",sx:{fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#662582"},children:"Product Details"})]}),(0,xe.jsxs)(P.A,{size:"small",sx:{minWidth:800},children:[(0,xe.jsx)(I.A,{children:(0,xe.jsxs)(L.A,{sx:{"& th":{fontSize:11,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:be,borderBottom:"1px solid ".concat(Se)},"&:hover":{backgroundColor:"transparent !important"}},children:[(0,xe.jsx)(M.A,{children:"#"}),(0,xe.jsx)(M.A,{children:"Product"}),(0,xe.jsx)(M.A,{children:"Description"}),(0,xe.jsx)(M.A,{align:"right",children:"Qty"}),(0,xe.jsx)(M.A,{align:"right",children:"Cost"}),(0,xe.jsx)(M.A,{align:"right",children:"Price"}),(0,xe.jsx)(M.A,{align:"right",children:"Tax"}),(0,xe.jsx)(M.A,{align:"right",children:"Amount"})]})}),(0,xe.jsxs)(Y.A,{children:[null===Mr||void 0===Mr||null===(h=Mr.details)||void 0===h?void 0:h.map(((e,o)=>{var r,t;return(0,xe.jsxs)(L.A,{sx:{"&:hover":{backgroundColor:We+" !important"}},children:[(0,xe.jsx)(M.A,{sx:{color:me,fontWeight:700},children:String(o+1).padStart(2,"0")}),(0,xe.jsx)(M.A,{children:(0,xe.jsxs)(w.A,{direction:"row",spacing:1.25,alignItems:"center",children:[(0,xe.jsx)(k.A,{component:"img",src:(null===e||void 0===e?void 0:e.productimage)||"https://via.placeholder.com/40",alt:null===e||void 0===e?void 0:e.productname,sx:{width:36,height:36,objectFit:"cover",borderRadius:1.5,border:"1px solid ".concat(Se)}}),(0,xe.jsx)(S.A,{variant:"body2",sx:{fontWeight:600,color:Ae},noWrap:!0,children:(null===e||void 0===e?void 0:e.productname)||"Unnamed"})]})}),(0,xe.jsx)(M.A,{sx:{color:be},children:(null===e||void 0===e?void 0:e.productdescription)||"-"}),(0,xe.jsx)(M.A,{align:"right",sx:{fontWeight:700},children:(null===e||void 0===e?void 0:e.orderqty)||0}),(0,xe.jsxs)(M.A,{align:"right",children:["\u20b9 ",(null===e||void 0===e?void 0:e.price)||0]}),(0,xe.jsxs)(M.A,{align:"right",children:["\u20b9 ",(null!==(r=null===e||void 0===e?void 0:e.productsumprice)&&void 0!==r?r:0).toFixed(2)]}),(0,xe.jsxs)(M.A,{align:"right",children:["\u20b9 ",(null!==(t=null===e||void 0===e?void 0:e.taxamount)&&void 0!==t?t:0).toFixed(2)]}),(0,xe.jsxs)(M.A,{align:"right",sx:{fontWeight:800,color:Ae},children:["\u20b9 ",((null===e||void 0===e?void 0:e.productsumprice)+(null===e||void 0===e?void 0:e.taxamount)).toFixed(2)||0]})]},o)})),(0,xe.jsxs)(L.A,{sx:{"&:hover":{backgroundColor:"transparent !important"}},children:[(0,xe.jsx)(M.A,{align:"right",colSpan:7,sx:{fontWeight:700,color:be,borderTop:"1px solid ".concat(Se)},children:"Total Amount"}),(0,xe.jsxs)(M.A,{align:"right",sx:{fontWeight:800,color:"#10b981",borderTop:"1px solid ".concat(Se)},children:["\u20b9 ",null===Mr||void 0===Mr||null===(x=Mr.pricedetails)||void 0===x||null===(p=x.orderamount)||void 0===p?void 0:p.toFixed(2)]})]})]})]})]})})})})})]},null!==(r=e.orderheaderid)&&void 0!==r?r:"".concat(e.tenantname,"-").concat(o))})),0!=(null===Gr||void 0===Gr?void 0:Gr.length)&&(0,xe.jsx)(L.A,{children:(0,xe.jsx)(M.A,{colSpan:g,rowSpan:3,children:(0,xe.jsx)("div",{ref:c,style:{height:40,textAlign:"center"},children:Br||Hr?(0,xe.jsx)(de.A,{}):(0,xe.jsx)(S.A,{variant:"caption",sx:{color:me,fontWeight:600},children:"\xb7 End of list \xb7"})})})})]})]})})()})}),(0,xe.jsxs)(E.A,{anchorEl:Ho,open:br,onClose:jr,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},PaperProps:{elevation:0,sx:{minWidth:220,borderRadius:2,mt:.75,border:"1px solid",borderColor:je,boxShadow:ve,overflow:"hidden","& .MuiMenuItem-root":{fontSize:13,fontWeight:600,py:1.1,px:1.5,gap:1,transition:"background-color 0.15s","&:hover":{bgcolor:We}}}},children:["delivered"!==(null===Jo||void 0===Jo?void 0:Jo.orderstatus)&&(0,xe.jsxs)(K.A,{onClick:()=>{Pr.mutate(Jo.userfcmtoken),jr()},children:[(0,xe.jsx)(He,{color:"#0ea5e9",size:22,children:(0,xe.jsx)(u.q53,{size:13})}),"Notify Rider"]}),["pending","accepted","arrived"].includes(null===Jo||void 0===Jo?void 0:Jo.orderstatus)&&(0,xe.jsxs)(K.A,{onClick:()=>{var e;if(!Ze)return Lr("Please select a location first!","warning"),void(null===(e=Co.current)||void 0===e||e.focus());or(!0),jr()},children:[(0,xe.jsx)(He,{color:"#8b5cf6",size:22,children:(0,xe.jsx)(u.bsz,{size:13})}),"Change Rider"]}),(1==Ar||2==Ar)&&(0,xe.jsxs)(K.A,{onClick:()=>{co(Jo.kms),ho(Jo.cumulativekms),bo(Jo.droplat),jo(Jo.droplon),go(Jo.notes),uo(Jo.deliveryamount),Wo(Jo.orderstatus||"delivered"),vo(Jo),Je(!0),jr()},children:[(0,xe.jsx)(He,{color:"#10b981",size:22,children:(0,xe.jsx)(u.mU9,{size:13})}),"Update Status"]}),"cancelled"!==(null===Jo||void 0===Jo?void 0:Jo.orderstatus)&&"delivered"!==(null===Jo||void 0===Jo?void 0:Jo.orderstatus)&&(0,xe.jsxs)(K.A,{sx:{color:"#ef4444 !important"},onClick:()=>{$o(!0),jr()},children:[(0,xe.jsx)(He,{color:"#ef4444",size:22,children:(0,xe.jsx)(u.uDv,{size:13})}),"Cancel Delivery"]})]}),(0,xe.jsxs)(O.A,{open:_o,onClose:()=>$o(!1),maxWidth:"xs",fullWidth:!0,PaperProps:{elevation:0,sx:{borderRadius:3,border:"1px solid",borderColor:je,boxShadow:ve,overflow:"hidden"}},children:[(0,xe.jsx)(k.A,{sx:{height:4,background:"linear-gradient(90deg, #ef4444 0%, ".concat(ze("#ef4444")," 100%)")}}),(0,xe.jsx)(N.A,{sx:{p:3.5},children:(0,xe.jsxs)(w.A,{alignItems:"center",spacing:2.5,children:[(0,xe.jsx)(A.A,{sx:{width:64,height:64,bgcolor:ze("#ef4444"),color:"#ef4444"},children:(0,xe.jsx)(s.A,{style:{fontSize:28}})}),(0,xe.jsxs)(w.A,{spacing:.5,alignItems:"center",children:[(0,xe.jsx)(S.A,{variant:"h4",sx:{fontWeight:800,color:Ae},children:"Cancel Delivery?"}),(0,xe.jsx)(S.A,{variant:"caption",sx:{color:be,textAlign:"center",px:1},children:"This action will cancel the delivery and notify the rider. Please share a brief reason."})]}),(0,xe.jsx)(C.A,{fullWidth:!0,placeholder:"Reason for cancellation",multiline:!0,minRows:2,maxRows:4,onChange:e=>tr(e.target.value),sx:{"& .MuiOutlinedInput-root":{borderRadius:2,bgcolor:We,"& fieldset":{borderColor:je},"&:hover fieldset":{borderColor:"#ef4444"},"&.Mui-focused fieldset":{borderColor:"#ef4444",borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(De("#ef4444"))}}}}),(0,xe.jsxs)(w.A,{direction:"row",spacing:1.5,sx:{width:1},children:[(0,xe.jsx)(H.A,{fullWidth:!0,onClick:()=>$o(!1),variant:"outlined",sx:{borderRadius:999,py:1.1,fontWeight:700,borderColor:je,color:be,"&:hover":{borderColor:me,bgcolor:We}},children:"Keep Delivery"}),(0,xe.jsx)(H.A,{fullWidth:!0,variant:"contained",onClick:()=>{""==rr?Lr("Enter FeedBack","error"):wr({selectedRow:Jo,cancelFeed:rr}),(async()=>{console.log("cancelridernotification",Jo);try{return(await h.A.post("".concat("https://jupiter.nearle.app/live/api/v1","/utils/notifyuser"),{token:Jo.userfcmtoken,notification:{title:"NearleXpress",body:"".concat(Jo.orderid," have been Cancelled"),sound:"ring",image:""},data:{type:"cancel"}})).data}catch(e){Lr(e.message,"error",2e3),console.log(e)}})()},autoFocus:!0,sx:{borderRadius:999,py:1.1,fontWeight:800,bgcolor:"#ef4444",boxShadow:"0 6px 18px ".concat(De("#ef4444")),"&:hover":{bgcolor:"#dc2626"}},children:"Yes, Cancel"})]})]})})]}),(0,xe.jsxs)(O.A,{open:er,onClose:()=>or(!1),maxWidth:"sm",fullWidth:!0,TransitionComponent:q.s,PaperProps:{elevation:0,sx:{borderRadius:3,border:"1px solid",borderColor:je,boxShadow:ve,overflow:"hidden"}},children:[(0,xe.jsx)(k.A,{sx:{height:4,background:"linear-gradient(90deg, #8b5cf6 0%, ".concat(ze("#8b5cf6")," 100%)")}}),(0,xe.jsx)(B.A,{sx:{p:3,pb:1.5},children:(0,xe.jsxs)(w.A,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,xe.jsx)(A.A,{sx:{width:44,height:44,bgcolor:ze("#8b5cf6"),color:"#8b5cf6"},children:(0,xe.jsx)(u.bsz,{size:22})}),(0,xe.jsxs)(w.A,{children:[(0,xe.jsx)(S.A,{variant:"h4",sx:{fontWeight:800,color:Ae},children:"Change Rider"}),(0,xe.jsx)(S.A,{variant:"caption",sx:{color:be},children:"Assign this delivery to a different rider"})]})]})}),(0,xe.jsx)(N.A,{sx:{p:3,pt:2},children:(0,xe.jsx)(y.A,{fullWidth:!0,options:rt,PaperComponent:Ne,getOptionLabel:e=>"".concat(e.firstname," ").concat(e.lastname," (").concat(e.contactno,")"),onChange:(e,o)=>{nr(o),i.A.debug("Rider selected in dropdown:",o?"".concat(o.firstname," ").concat(o.lastname):"None")},renderInput:e=>(0,xe.jsx)(C.A,(0,t.A)((0,t.A)({},e),{},{placeholder:"Choose Rider",InputProps:(0,t.A)((0,t.A)({},e.InputProps),{},{startAdornment:(0,xe.jsx)(w.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,xe.jsx)(He,{color:"#8b5cf6",children:(0,xe.jsx)(u.bsz,{size:14})})})}),sx:Ie()}))})}),(0,xe.jsx)(J.A,{sx:{p:3,pt:1},children:(0,xe.jsxs)(w.A,{direction:"row",spacing:1.5,sx:{width:1},children:[(0,xe.jsx)(H.A,{fullWidth:!0,variant:"outlined",onClick:()=>or(!1),sx:{borderRadius:999,py:1.1,fontWeight:700,borderColor:je,color:be,"&:hover":{borderColor:me,bgcolor:We}},children:"Cancel"}),(0,xe.jsx)(H.A,{fullWidth:!0,variant:"contained",onClick:()=>{Zo(!0),i.A.info("Initiating rider assignment change for order ID ".concat(null===Jo||void 0===Jo?void 0:Jo.orderid," to rider: ").concat(null===ir||void 0===ir?void 0:ir.firstname," ").concat(null===ir||void 0===ir?void 0:ir.lastname)),Ir.mutate({selectedRider:ir,selectedRow:Jo})},sx:{borderRadius:999,py:1.1,fontWeight:800,bgcolor:"#8b5cf6",boxShadow:"0 6px 18px ".concat(De("#8b5cf6")),"&:hover":{bgcolor:"#7c3aed"}},children:"Change Rider"})]})})]}),(0,xe.jsxs)(O.A,{open:to,onClose:()=>io(!1),fullScreen:r,PaperProps:{elevation:0,sx:{borderRadius:{xs:0,sm:3},border:"1px solid",borderColor:je,boxShadow:ve,overflow:"hidden"}},children:[(0,xe.jsx)(k.A,{sx:{height:4,background:"linear-gradient(90deg, #f59e0b 0%, ".concat(ze("#f59e0b")," 100%)")}}),(0,xe.jsx)(B.A,{align:"left",sx:{p:3,pb:1.5},children:(0,xe.jsxs)(w.A,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,xe.jsx)(A.A,{sx:{width:44,height:44,bgcolor:ze("#f59e0b"),color:"#f59e0b"},children:(0,xe.jsx)(u.tjE,{size:22})}),(0,xe.jsxs)(w.A,{children:[(0,xe.jsx)(S.A,{variant:"h4",sx:{fontWeight:800,color:Ae},children:"Date Range"}),(0,xe.jsx)(S.A,{variant:"caption",sx:{color:be},children:"Pick a window to filter the deliveries"})]})]})}),(0,xe.jsx)(N.A,{sx:{width:"100%"},className:"datedialog",children:(0,xe.jsx)($.U,{open:to,toggle:()=>io(!to),id:"daterange1",onChange:e=>{"All"===e.label?(Qe(""),_e(""),io(!1)):(Qe(a()(e.startDate).format("YYYY-MM-DD")),_e(a()(e.endDate).format("YYYY-MM-DD")),e.label?lo(e.label):lo("")),console.log(e)},definedRanges:[{label:"Today",startDate:new Date,endDate:new Date},{label:"Yesterday",startDate:(0,G.A)(new Date,-1),endDate:(0,G.A)(new Date,-1)},{label:"Tomorrow",startDate:(0,G.A)(new Date,1),endDate:(0,G.A)(new Date,1)},{label:"This Week",startDate:(0,Z.A)(new Date),endDate:(0,U.A)(new Date)},{label:"Last Week",startDate:(0,Z.A)((0,V.A)(new Date,-1)),endDate:(0,U.A)((0,V.A)(new Date,-1))},{label:"Last 7 Days",startDate:(0,V.A)(new Date,-1),endDate:new Date},{label:"This Month",startDate:(0,Q.A)(new Date),endDate:(0,X.A)(new Date)},{label:"Last Month",startDate:(0,Q.A)((0,_.A)(new Date,-1)),endDate:(0,X.A)((0,_.A)(new Date,-1))}]})}),(0,xe.jsx)(w.A,{direction:"row",justifyContent:"flex-end",sx:{width:"100%",p:2.5,pt:1},children:(0,xe.jsx)(H.A,{variant:"contained",onClick:()=>{io(!1)},sx:{borderRadius:999,px:3,py:1,fontWeight:800,bgcolor:"#f59e0b",boxShadow:"0 6px 18px ".concat(De("#f59e0b")),"&:hover":{bgcolor:"#d97706"}},children:"Apply"})})]}),(0,xe.jsxs)(O.A,{fullWidth:!0,open:Be,onClose:Yr,scroll:"paper",maxWidth:"sm",fullScreen:r,TransitionComponent:q.s,PaperProps:{elevation:0,sx:{borderRadius:{xs:0,sm:3},border:"1px solid",borderColor:je,boxShadow:ve,overflow:"hidden"}},children:[(0,xe.jsx)(k.A,{sx:{height:4,background:"linear-gradient(90deg, #10b981 0%, ".concat(ze("#10b981")," 100%)")}}),(0,xe.jsx)(B.A,{sx:{p:3,pb:1.5},children:(0,xe.jsxs)(w.A,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,xe.jsx)(A.A,{sx:{width:44,height:44,bgcolor:ze("#10b981"),color:"#10b981"},children:(0,xe.jsx)(u.mU9,{size:22})}),(0,xe.jsxs)(w.A,{children:[(0,xe.jsx)(S.A,{variant:"h4",sx:{fontWeight:800,color:Ae},children:"Update Delivery Status"}),(0,xe.jsx)(S.A,{variant:"caption",sx:{color:be},children:null!==fo&&void 0!==fo&&fo.orderid?"Order #".concat(fo.orderid):"Modify delivery details"})]})]})}),(0,xe.jsx)(N.A,{dividers:!0,sx:{p:3,bgcolor:We},children:(0,xe.jsxs)(j.Ay,{container:!0,spacing:2,children:[[{label:"KMs",value:so,set:e=>co(e),color:"#ef4444"},{label:"Actual KMs",value:ao,set:e=>ho(+e),color:"#10b981"},{label:"Delivery Latitude",value:Ao,set:e=>bo(e),color:"#06b6d4"},{label:"Delivery Longitude",value:mo,set:e=>jo(e),color:"#06b6d4"}].map((e=>(0,xe.jsxs)(j.Ay,{item:!0,xs:12,sm:6,children:[(0,xe.jsx)(S.A,{variant:"caption",sx:{fontWeight:700,color:be,letterSpacing:.5,textTransform:"uppercase"},children:e.label}),(0,xe.jsx)(C.A,{fullWidth:!0,value:e.value,type:"number",onChange:o=>e.set(o.target.value),sx:{mt:.5,"& .MuiOutlinedInput-root":{borderRadius:2,bgcolor:"#fff","& fieldset":{borderColor:je},"&:hover fieldset":{borderColor:e.color},"&.Mui-focused fieldset":{borderColor:e.color,borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(De(e.color))}}}})]},e.label))),(0,xe.jsxs)(j.Ay,{item:!0,xs:12,children:[(0,xe.jsx)(S.A,{variant:"caption",sx:{fontWeight:700,color:be,letterSpacing:.5,textTransform:"uppercase"},children:"Amount"}),(0,xe.jsx)(C.A,{fullWidth:!0,type:"number",value:xo,onChange:e=>uo(+e.target.value),sx:{mt:.5,"& .MuiOutlinedInput-root":{borderRadius:2,bgcolor:"#fff","& fieldset":{borderColor:je},"&:hover fieldset":{borderColor:"#10b981"},"&.Mui-focused fieldset":{borderColor:"#10b981",borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(De("#10b981"))}}}})]}),(0,xe.jsxs)(j.Ay,{item:!0,xs:12,children:[(0,xe.jsx)(S.A,{variant:"caption",sx:{fontWeight:700,color:be,letterSpacing:.5,textTransform:"uppercase"},children:"Status"}),(0,xe.jsx)(C.A,{select:!0,fullWidth:!0,value:yo,onChange:e=>Wo(e.target.value),SelectProps:{MenuProps:{PaperProps:{sx:{borderRadius:2,mt:.5,boxShadow:ve}}}},sx:{mt:.5,"& .MuiOutlinedInput-root":{borderRadius:2,bgcolor:"#fff","& fieldset":{borderColor:je},"&:hover fieldset":{borderColor:"#662582"},"&.Mui-focused fieldset":{borderColor:"#662582",borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(De("#662582"))}}},children:["pending","accepted","started","arrived","delivered","cancelled"].map((e=>{const o=Le[e]||{label:e,color:"#662582",icon:u.bfP},r=o.icon;return(0,xe.jsxs)(K.A,{value:e,sx:{gap:1},children:[(0,xe.jsx)(He,{color:o.color,size:22,children:(0,xe.jsx)(r,{size:13})}),o.label]},e)}))})]}),(0,xe.jsxs)(j.Ay,{item:!0,xs:12,children:[(0,xe.jsx)(S.A,{variant:"caption",sx:{fontWeight:700,color:be,letterSpacing:.5,textTransform:"uppercase"},children:"Notes"}),(0,xe.jsx)(C.A,{value:po,fullWidth:!0,multiline:!0,minRows:2,onChange:e=>go(e.target.value),sx:{mt:.5,"& .MuiOutlinedInput-root":{borderRadius:2,bgcolor:"#fff","& fieldset":{borderColor:je},"&:hover fieldset":{borderColor:"#662582"},"&.Mui-focused fieldset":{borderColor:"#662582",borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(De("#662582"))}}}})]})]})}),(0,xe.jsx)(J.A,{sx:{p:3},children:(0,xe.jsxs)(w.A,{direction:"row",spacing:1.5,sx:{width:1},children:[(0,xe.jsx)(H.A,{fullWidth:!0,variant:"outlined",onClick:Yr,sx:{borderRadius:999,py:1.1,fontWeight:700,borderColor:je,color:be,"&:hover":{borderColor:me,bgcolor:We}},children:"Close"}),(0,xe.jsx)(H.A,{fullWidth:!0,variant:"contained",onClick:()=>{so?ao?Ao?mo?xo?lt.mutate({deliveryid:fo.deliveryid,orderheaderid:fo.orderheaderid,orderstatus:yo,deliverytime:a()().format("YYYY-MM-DD HH:mm:ss"),deliverylat:Ao,deliverylong:mo,kms:so,cumulativekms:ao,deliveryamt:parseFloat(xo),notes:po,userid:+Jo.userid}):Lr("Fill Delivery Amount","warning"):Lr("Fill Delivery Longitude","warning"):Lr("Fill Delivery Latitude","warning"):Lr("Fill Actual Kms","warning"):Lr("Fill Kms","warning")},sx:{borderRadius:999,py:1.1,fontWeight:800,bgcolor:"#10b981",boxShadow:"0 6px 18px ".concat(De("#10b981")),"&:hover":{bgcolor:"#059669"}},children:"Update"})]})})]})]})}},23787:(e,o,r)=>{r.d(o,{FG:()=>u,nV:()=>h,pY:()=>p,pg:()=>x});var t=r(89379),i=r(80045),n=r(93230),l=r(2235),s=r(16491),d=r(82053),c=r(44414);const a=["children","scroll","onScroll","sx"],h=e=>{let{children:o,scroll:r=!1,onScroll:l,sx:s}=e,d=(0,i.A)(e,a);return(0,c.jsx)(n.A,(0,t.A)((0,t.A)({spacing:1.25,onScroll:l,sx:(0,t.A)((0,t.A)({p:1.5},r&&{maxHeight:"calc(100vh - 220px)",overflowY:"auto",overflowX:"hidden"}),s)},d),{},{children:o}))},x=e=>{let{accent:o="#662582",header:r,footer:i,selected:n=!1,onClick:d,children:a,sx:h}=e;return(0,c.jsxs)(l.A,{elevation:0,onClick:d,sx:(0,t.A)({position:"relative",overflow:"hidden",flexShrink:0,borderRadius:2.5,border:"1px solid",borderColor:n?o:"#e2e8f0",background:n?"".concat(o,"0a"):"#fff",boxShadow:"0 4px 14px rgba(15,23,42,0.05)",transition:"border-color 0.15s, box-shadow 0.15s"},h),children:[(0,c.jsx)(s.A,{sx:{position:"absolute",left:0,top:0,bottom:0,width:3,bgcolor:o}}),(0,c.jsxs)(s.A,{sx:{p:1.5,pl:2},children:[r,a,i]})]})},u=e=>{let{children:o,columns:r=2,sx:i}=e;return(0,c.jsx)(s.A,{sx:(0,t.A)({display:"grid",gridTemplateColumns:"repeat(".concat(r,", minmax(0, 1fr))"),gap:1,mt:1.25},i),children:o})},p=e=>{let{label:o,value:r,children:t,full:i=!1,align:n="left"}=e;return(0,c.jsxs)(s.A,{sx:{gridColumn:i?"1 / -1":"auto",minWidth:0,textAlign:n},children:[(0,c.jsx)(d.A,{sx:{fontSize:9.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#94a3b8",lineHeight:1.4},children:o}),(0,c.jsx)(s.A,{sx:{mt:.25,minWidth:0},children:void 0!==t?t:(0,c.jsx)(d.A,{sx:{fontSize:13,fontWeight:600,color:"#0f172a"},noWrap:!0,children:null!==r&&void 0!==r?r:"\u2014"})})]})}},27001:(e,o,r)=>{r.d(o,{A:()=>s});var t=r(93230),i=r(16491),n=r(82053),l=r(44414);function s(e){let{title:o,subtitle:r,live:s=!1,action:d}=e;return(0,l.jsxs)(t.A,{direction:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},spacing:1.5,sx:{mb:{xs:2,md:2.5}},children:[(0,l.jsxs)(i.A,{sx:{minWidth:0},children:[(0,l.jsx)(n.A,{variant:"h3",sx:{fontWeight:700,letterSpacing:"-0.02em",color:"grey.800"},children:o}),r&&(0,l.jsxs)(t.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[s&&(0,l.jsx)(i.A,{sx:{width:7,height:7,borderRadius:"50%",bgcolor:"success.main",boxShadow:"0 0 0 3px rgba(16,185,129,0.18)"}}),(0,l.jsx)(n.A,{variant:"caption",sx:{color:"text.secondary",fontWeight:500},children:r})]})]}),d&&(0,l.jsx)(i.A,{sx:{flexShrink:0,width:{xs:"100%",sm:"auto"}},children:d})]})}},36803:(e,o,r)=>{r.d(o,{A:()=>h});var t=r(48089),i=r(50704),n=r(93230),l=r(16491),s=r(82053),d=r(82917),c=r(41413),a=r(44414);function h(e){let{title:o,value:r,icon:h,color:x="#662582",caption:u,loading:p=!1}=e;return(0,a.jsx)(t.A,{sx:{height:"100%"},children:(0,a.jsx)(i.A,{sx:{p:{xs:1.75,md:2},"&:last-child":{pb:{xs:1.75,md:2}}},children:(0,a.jsxs)(n.A,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:1,children:[(0,a.jsxs)(l.A,{sx:{minWidth:0,flex:1},children:[(0,a.jsx)(s.A,{variant:"body2",sx:{fontWeight:500,color:"text.secondary",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o}),p?(0,a.jsx)(d.A,{variant:"rounded",sx:{width:72,height:30,mt:.5},animation:"wave"}):(0,a.jsx)(s.A,{sx:{mt:.25,fontWeight:700,letterSpacing:"-0.015em",color:"grey.800",lineHeight:1.15,fontSize:{xs:"1.375rem",md:"1.5rem"},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r}),u&&(0,a.jsx)(s.A,{variant:"caption",sx:{display:"block",mt:.5,color:"text.secondary"},children:u})]}),h&&(0,a.jsx)(c.A,{variant:"rounded",sx:{width:42,height:42,borderRadius:2,bgcolor:"".concat(x,"14"),color:x,flexShrink:0},children:h})]})})})}},56311:(e,o,r)=>{r.d(o,{A:()=>u});var t=r(89379),i=r(9950),n=r(2660),l=r(2046),s=r(83274),d=r(25333),c=r(97125),a=r(7762),h=r(52097),x=r(44414);const u=e=>{let{value:o,onChange:r,onDebouncedChange:u,debounceTime:p=500,placeholder:g="Search (ctrl+k)",sx:f}=e;const v=(0,i.useRef)(null),[A]=(0,h.d7)(o,p);return(0,i.useEffect)((()=>{u&&u(A)}),[A,u]),(0,i.useEffect)((()=>{const e=e=>{var o;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(o=v.current)||void 0===o||o.focus());"Escape"===e.key&&document.activeElement===v.current&&v.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,x.jsx)(n.A,{sx:(0,t.A)({},f),inputRef:v,placeholder:g,autoComplete:"off",value:o,fullWidth:!0,onChange:e=>r(e.target.value),startAdornment:(0,x.jsx)(l.A,{position:"start",sx:{mr:-.5},children:(0,x.jsx)(c.A,{})}),endAdornment:(0,x.jsx)(s.A,{title:"Clear",children:(0,x.jsx)(d.A,{sx:{visibility:o?"visible":"hidden"},onClick:()=>r(""),children:(0,x.jsx)(a.A,{})})})})}},58691:(e,o,r)=>{r.d(o,{A:()=>s});r(9950);var t=r(16491),i=r(46639),n=r(62217),l=r(44414);function s(e){let{size:o=70,imgSize:r=40,alt:s="loader"}=e;return(0,l.jsxs)(t.A,{position:"relative",display:"inline-flex",justifyContent:"center",alignItems:"center",children:[(0,l.jsx)(i.A,{size:o}),(0,l.jsx)(t.A,{position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",sx:{width:r,height:r},children:(0,l.jsx)("img",{src:n,alt:s,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"contain"}})})]})}},59212:(e,o,r)=>{r.d(o,{A:()=>x});var t=r(89379),i=r(9950),n=r(93230),l=r(41413),s=r(77922),d=r(29925),c=r(26910),a=r(31222),h=r(44414);const x=(0,i.forwardRef)(((e,o)=>{let{setAppId:r,setLocoName:x,setPage:u,sx:p,textfeildSx:g,textfieldSx:f,pill:v=!1,accentColor:A="#6366f1",icon:b,placeholder:m="Select Zone",paperComponent:j}=e;const[w,S]=(0,i.useState)(JSON.parse(localStorage.getItem("applocations")||"[]"));(0,i.useEffect)((()=>{0===w.length&&(async()=>{try{const e=localStorage.getItem("userid");if(!e)return;const o=await c.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(e));if(o.data.status){const e=[...o.data.details,{locationname:"All",applocationid:0}];localStorage.setItem("applocations",JSON.stringify(e)),S(e)}}catch(e){console.error("Error fetching locations in LocationAutocomplete:",e)}})()}),[w.length]);const y=e=>"".concat(A).concat(e),W=y("26"),C=y("18"),k=v?{cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"10px",bgcolor:"#ffffff",fontWeight:600,color:"#0f172a",paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s","& fieldset":{borderColor:"#e2e8f0",borderWidth:1},"&:hover fieldset":{borderColor:"#cbd5e1"},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(W)},"&.Mui-focused fieldset":{borderColor:A,borderWidth:1.5}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:"#94a3b8"}}:{},R=v&&(0,h.jsx)(n.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,h.jsx)(l.A,{sx:{width:24,height:24,bgcolor:C,color:A,transition:"background-color 0.15s, color 0.15s"},children:b||(0,h.jsx)(a.HPi,{size:14})})});return(0,h.jsx)(s.A,{id:"location-autocomplete",options:w||[],getOptionLabel:e=>{var o;return null!==(o=null===e||void 0===e?void 0:e.locationname)&&void 0!==o?o:""},PaperComponent:j,sx:(0,t.A)({},p),onChange:(e,o,t)=>{"clear"===t?(null===r||void 0===r||r(0),null===x||void 0===x||x(""),null===u||void 0===u||u(0)):o&&(null===r||void 0===r||r(o.applocationid),null===x||void 0===x||x(o.locationname),null===u||void 0===u||u(0))},renderInput:e=>v?(0,h.jsx)(d.A,(0,t.A)((0,t.A)({},e),{},{inputRef:o,placeholder:m,InputProps:(0,t.A)((0,t.A)({},e.InputProps),{},{startAdornment:R}),sx:(0,t.A)((0,t.A)({},k),f||g||{})})):(0,h.jsx)(d.A,(0,t.A)((0,t.A)({},e),{},{inputRef:o,label:"Select Zones",sx:(0,t.A)({},f||g||{})}))})}))},62217:e=>{e.exports="data:image/png;base64,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"},96646:(e,o,r)=>{r.d(o,{r:()=>d});var t=r(9213),i=r(21671),n=r(82917),l=r(93230),s=r(44414);const d=e=>{let{rowsPerPage:o=5,col:r=1}=e;return(0,s.jsx)(s.Fragment,{children:Array.from(new Array(o)).map(((e,o)=>(0,s.jsxs)(t.A,{children:[(0,s.jsx)(i.A,{children:(0,s.jsx)(n.A,{variant:"circular",width:24,height:24})}),(0,s.jsx)(i.A,{children:(0,s.jsx)(n.A,{variant:"text",width:30})}),Array.from({length:r}).map(((e,o)=>(0,s.jsx)(i.A,{children:(0,s.jsxs)(l.A,{spacing:.5,children:[(0,s.jsx)(n.A,{variant:"text",width:100}),(0,s.jsx)(n.A,{variant:"text",width:80})]})},o))),(0,s.jsx)(i.A,{children:(0,s.jsx)(n.A,{variant:"text",width:150})}),(0,s.jsx)(i.A,{children:(0,s.jsx)(n.A,{variant:"rounded",width:60,height:24})}),(0,s.jsx)(i.A,{align:"center",children:(0,s.jsxs)(l.A,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,s.jsx)(n.A,{variant:"circular",width:28,height:28}),(0,s.jsx)(n.A,{variant:"circular",width:28,height:28})]})})]},o)))})}}}]); |