Files
dailygrubs_console_build/build/static/js/8675.21f5beff.chunk.js

1 line
38 KiB
JavaScript

"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[8675],{7519:function(e,t,o){o.d(t,{ZZ:function(){return x}});var r=o(1413),n=(o(47313),o(17592)),i=o(61689),l=o(69099),c=o(85281),s=o(42832),a=o(36287),d=o(53245),u=o(6986),h=o(46417),x=((0,n.ZP)("div")((function(e){var t=e.theme,o=e.x,r=e.y;return{color:t.palette.text.secondary,position:"fixed",pointerEvents:"none",left:12,top:24,transform:"translate(".concat(o,"px, ").concat(r,"px)"),opacity:.6}})),function(e){var t=e.data,o=e.filename,n=e.headers,s=e.label,a=e.style,x=e.btnLoading,p=e.onClick;return(0,h.jsx)(d.CSVLink,{data:t,filename:o,headers:n,children:(0,h.jsx)(i.Z,{title:"CSV Export",children:(0,h.jsx)(l.Z,{startIcon:!x&&(0,h.jsx)(u.Z,{}),variant:x?"outlined":"contained",sx:(0,r.Z)({},a),disabled:x,onClick:function(e){null===p||void 0===p||p(e)},children:x?(0,h.jsx)(c.Z,{size:20,thickness:5}):s||"Download"})})})});(0,n.ZP)(s.Z)((function(e){var t=e.theme;return{height:"400px","& .ant-empty-img-1":{fill:t.palette.mode===a.hY.DARK?t.palette.secondary[200]:t.palette.secondary[400]},"& .ant-empty-img-2":{fill:t.palette.secondary.light},"& .ant-empty-img-3":{fill:t.palette.mode===a.hY.DARK?t.palette.secondary.A200:t.palette.secondary[200]},"& .ant-empty-img-4":{fill:t.palette.mode===a.hY.DARK?t.palette.secondary.A300:t.palette.secondary.A100},"& .ant-empty-img-5":{fillOpacity:t.palette.mode===a.hY.DARK?"0.09":"0.95",fill:t.palette.mode===a.hY.DARK?t.palette.secondary.darker:t.palette.secondary.light}}}))},78457:function(e,t,o){o.r(t),o.d(t,{default:function(){return Oe}});var r=o(74165),n=o(15861),i=o(4942),l=o(29439),c=o(1413),s=o(47313),a=o(56573),d=o(25963),u=o(41962),h=o(19860),x=(o(90842),o(70501)),p=o(48119),f=o(57829),g=o(61113),m=o(42832),b=o(61689),v=o(69099),Z=o(9019),j=o(84488),y=o(76088),S=o(16783),w=o(54882),k=o(47131),A=o(51629),C=o(66835),D=o(23477),W=o(24076),z=o(67478),P=o(57861),R=o(85281),E=o(79601),I=o(70024),_=o(94469),M=o(96467),T=o(22539),L=o(10658),Y=o.n(L),O=o(25223),H=o(99004),B=o(59376),K=o(34605),N=o(78392),F=o(41156),V=o(98589),U=o(79254),q=o(71049),G=o(7519),J=o(11577),X=o(93433),Q=o(74580),$=o(88153),ee=o(39062),te=o(73999),oe=o(98817),re=o(87248),ne=o.n(re),ie=(o(63331),o(66212)),le=o(16132),ce=o(5049),se=o(46417),ae=o(91635);Y().extend(ae);var de=new(ne().Icon)({iconUrl:"https://cdn.rawgit.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-green.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]}),ue=new(ne().Icon)({iconUrl:"https://cdn.rawgit.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-red.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]}),he=function(e){var t=e.coordinates,o=e.additionalProps,r=e.order,n=e.setMapOpen;console.log("setMapOpen:",typeof n),console.log("coordinates",t),console.log(o.riderStart),console.log(o.riderEnd),console.log("order",r);var i=(0,s.useRef)(null);le.u;(0,s.useEffect)((function(){if(i.current&&t.length>0){var e=l(t);i.current.fitBounds(e)}}),[t]);var l=function(e){var t=e.map((function(e){return e.lat})),o=e.map((function(e){return e.lng})),r=Math.min.apply(Math,(0,X.Z)(t)),n=Math.max.apply(Math,(0,X.Z)(t));return[[r,Math.min.apply(Math,(0,X.Z)(o))],[n,Math.max.apply(Math,(0,X.Z)(o))]]},c=t.length,a=Math.round(t.length/2),d=t[0],u=t[c-1],h=t[a],x=function(e,t){return(0,se.jsxs)(m.Z,{direction:"row",spacing:1,alignItems:"center",children:[(0,se.jsxs)(g.Z,{variant:"h5",color:"text.primary",sx:{fontSize:13},children:[e,":"]}),(0,se.jsx)(ie.Z,{label:t||"N/A",color:"primary",variant:"combined",size:"small",sx:{fontWeight:1e3,fontSize:14}})]})};return t&&t.length>0&&(0,se.jsxs)("div",{id:"map",style:{width:"100%",height:"90vh",margin:"0 auto",position:"relative"},children:[(0,se.jsx)(ie.Z,{label:"close",color:"primary",variant:"combined",onClick:function(){return n(!1)},size:"large",sx:{position:"absolute",top:8,right:8,zIndex:1e3,"&:hover":{},cursor:"pointer"},icon:(0,se.jsx)(ce.Z,{})}),(0,se.jsxs)(m.Z,{direction:"row",gap:2,flexWrap:"wrap",alignItems:"center",justifyContent:"flex-start",sx:{position:"absolute",bottom:0,zIndex:1e3,left:0,right:0,px:{xs:1,custom500:2,custom700:2},py:{xs:1,custom500:2,custom900:4},backgroundColor:"rgba(255, 255, 255, 0.95)",maxWidth:"100%",width:"auto",boxShadow:function(e){return e.shadows[3]}},children:[x("Tenant",null===r||void 0===r?void 0:r.tenantname),x("Rider",null===r||void 0===r?void 0:r.ridername),x("Pickup",null===r||void 0===r?void 0:r.pickupcustomer),x("Drop",null===r||void 0===r?void 0:r.deliverycustomer),x("Kms",null===r||void 0===r?void 0:r.kms),x("Actual kms",null===r||void 0===r?void 0:r.actualkms),x("Rider kms",null===r||void 0===r?void 0:r.riderkms)]}),(0,se.jsxs)(Q.h,{center:h,zoom:15,scrollWheelZoom:!1,style:{height:"100%",width:"100%"},ref:i,children:[(0,se.jsx)($.I,{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),(0,se.jsx)(ee.J,{position:d,icon:de,children:(0,se.jsx)(te.u,{direction:"bottom",children:(0,se.jsx)("span",{children:"Pickup Point: ".concat(Y()(o.riderStart).utc().format("DD-MM-YYYY")," (").concat(Y()(o.riderStart).utc().format("hh:mm A"),")")})})}),(0,se.jsx)(ee.J,{position:u,icon:ue,children:(0,se.jsx)(te.u,{direction:"bottom",children:(0,se.jsx)("span",{children:"Drop Point: ".concat(Y()(o.riderEnd).utc().format("DD-MM-YYYY")," (").concat(Y()(o.riderEnd).utc().format("hh:mm A"),")")})})}),(0,se.jsx)(oe.a,{pathOptions:{color:"blue",weight:8,dashArray:"4 4"},positions:t})]})]})},xe=o(91635);Y().extend(xe);var pe=999,fe="0 14px 40px rgba(15, 23, 42, 0.10)",ge="0 8px 24px rgba(15, 23, 42, 0.08)",me="0 18px 50px rgba(15, 23, 42, 0.18)",be="#0f172a",ve="#64748b",Ze="#94a3b8",je="#e2e8f0",ye="#f1f5f9",Se="#f8fafc",we=function(e,t){return"".concat(e).concat(t)},ke=function(e){return we(e,"08")},Ae=function(e){return we(e,"18")},Ce=function(e){return we(e,"26")},De=function(e){return we(e,"55")},We="#662582",ze="#9255AB",Pe={created:{label:"Created",color:"#3b82f6",icon:T.ili},pending:{label:"Pending",color:"#f59e0b",icon:T.Ley},accepted:{label:"Accepted",color:"#6366f1",icon:T.Z5O},arrived:{label:"Arrived",color:"#06b6d4",icon:T.ZSR},picked:{label:"Picked",color:"#8b5cf6",icon:T.ili},active:{label:"Active",color:"#0ea5e9",icon:T.ili},processing:{label:"Processing",color:"#3b82f6",icon:T.dKE},onhold:{label:"On Hold",color:"#8b5cf6",icon:T.Y8K},"on hold":{label:"On Hold",color:"#8b5cf6",icon:T.Y8K},delivered:{label:"Delivered",color:"#10b981",icon:T.ZSR},skipped:{label:"Skipped",color:"#f97316",icon:T.B4e},failed:{label:"Failed",color:"#991b1b",icon:T.B4e},cancelled:{label:"Cancelled",color:"#ef4444",icon:T.B4e}},Re=[{id:0,status:"All",statusLow:"All",color:We,icon:T.YgO},{id:1,status:"Pending",statusLow:"pending",color:"#f59e0b",icon:T.Ley},{id:2,status:"Accepted",statusLow:"accepted",color:"#6366f1",icon:T.Z5O},{id:3,status:"Arrived",statusLow:"arrived",color:"#06b6d4",icon:T.ZSR},{id:4,status:"Picked",statusLow:"picked",color:"#8b5cf6",icon:T.ili},{id:5,status:"Active",statusLow:"active",color:"#14b8a6",icon:T.ili},{id:6,status:"Delivered",statusLow:"delivered",color:"#10b981",icon:T.ZSR},{id:7,status:"Skipped",statusLow:"skipped",color:"#f97316",icon:T.B4e},{id:8,status:"Cancelled",statusLow:"cancelled",color:"#ef4444",icon:T.B4e}],Ee=function(e){return(0,se.jsx)(x.Z,(0,c.Z)((0,c.Z)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:me,border:"1px solid",borderColor:"divider",overflow:"hidden"}}))},Ie=function(e){var t=e.color,o=e.selected,r=e.size,n=void 0===r?24:r,i=e.children;return(0,se.jsx)(p.Z,{sx:{width:n,height:n,bgcolor:o?t:Ae(t),color:o?"#fff":t,transition:"background-color 0.15s, color 0.15s"},children:i})},_e=function(e){return{"& .MuiOutlinedInput-root":{borderRadius:pe+"px",bgcolor:ke(e),fontWeight:600,"& fieldset":{borderColor:De(e),borderWidth:1.5},"&:hover fieldset":{borderColor:e},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(Ce(e))},"&.Mui-focused fieldset":{borderColor:e,borderWidth:2}}}},Me=function(e){var t=e.status,o=Pe[String(t||"").toLowerCase()]||{label:t||"\u2014",color:Ze,icon:T.Y8K},r=o.icon;return(0,se.jsxs)(f.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1.125,py:.375,borderRadius:999,bgcolor:o.color,color:"#fff",fontSize:11,fontWeight:700,letterSpacing:.2,whiteSpace:"nowrap",minWidth:86,justifyContent:"center",boxShadow:"0 1px 2px ".concat(Ce(o.color))},children:[(0,se.jsx)(r,{size:12})," ",o.label]})},Te=function(e){var t=e.value,o=e.color,r=e.icon,n=e.isMoney,i=void 0!==n&&n,l=Number(t),c=i?Ye(l):Number.isFinite(l)?l:t||0;return!Number.isFinite(l)||0===l?(0,se.jsx)(g.Z,{variant:"caption",sx:{color:Ze,fontWeight:700},children:c}):(0,se.jsxs)(f.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:.875,py:.25,borderRadius:999,bgcolor:ke(o),border:"1px solid ".concat(De(o)),color:o,fontSize:12,fontWeight:800,whiteSpace:"nowrap"},children:[r,c]})},Le=function(e){var t=e.value;return t?(0,se.jsxs)(m.Z,{spacing:0,sx:{lineHeight:1.1},children:[(0,se.jsx)(g.Z,{sx:{fontSize:12.5,fontWeight:800,color:be,letterSpacing:.1,lineHeight:1.15},noWrap:!0,children:Y()(t).format("hh:mm A")}),(0,se.jsx)(g.Z,{sx:{fontSize:10.5,fontWeight:600,color:Ze,lineHeight:1.2},noWrap:!0,children:Y()(t).format("DD MMM YYYY")})]}):(0,se.jsx)(g.Z,{sx:{fontSize:12,color:Ze,fontWeight:700},children:"\u2014"})};function Ye(e){return new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",minimumFractionDigits:2}).format(e||0)}function Oe(){(0,h.Z)();var e,t,o=localStorage.getItem("tenantid"),L=(0,s.useRef)(null),X=(0,s.useRef)(),Q=(0,s.useRef)(),$=(0,s.useState)(Y()().format("YYYY-MM-DD")),ee=(0,l.Z)($,2),te=ee[0],oe=ee[1],re=(0,s.useState)(Y()().format("YYYY-MM-DD")),ne=(0,l.Z)(re,2),ie=ne[0],le=ne[1],ce=(0,s.useState)(!1),ae=(0,l.Z)(ce,2),de=ae[0],ue=ae[1],xe=(0,s.useState)("Today"),pe=(0,l.Z)(xe,2),we=pe[0],Pe=pe[1],Oe=(0,s.useState)(0),He=(0,l.Z)(Oe,2),Be=(He[0],He[1]),Ke=(0,s.useState)(0),Ne=(0,l.Z)(Ke,2),Fe=(Ne[0],Ne[1]),Ve=(0,s.useState)(""),Ue=(0,l.Z)(Ve,2),qe=Ue[0],Ge=Ue[1],Je=(0,s.useState)((function(){try{return localStorage.getItem("ordersDetails.density")||"compact"}catch(e){return"compact"}})),Xe=(0,l.Z)(Je,2),Qe=Xe[0],$e=Xe[1],et="compact"===Qe,tt=et?.5:1;(0,s.useEffect)((function(){try{localStorage.setItem("ordersDetails.density",Qe)}catch(e){}}),[Qe]);var ot=[{key:"index",label:"#",group:"Core",required:!0,defaultVisible:!0,width:36},{key:"location",label:"Location / Order",group:"Core",required:!0,defaultVisible:!0,minWidth:150},{key:"pickup",label:"Pickup",group:"Core",defaultVisible:!0,minWidth:140},{key:"drop",label:"Drop",group:"Core",defaultVisible:!0,minWidth:140},{key:"status",label:"Status",group:"Core",required:!0,defaultVisible:!0,width:110},{key:"assigned",label:"Assigned",group:"Lifecycle",defaultVisible:!0,minWidth:110},{key:"accepted",label:"Accepted",group:"Lifecycle",defaultVisible:!1,minWidth:90},{key:"arrived",label:"Arrived",group:"Lifecycle",defaultVisible:!1,minWidth:90},{key:"picked",label:"Picked",group:"Lifecycle",defaultVisible:!0,minWidth:90},{key:"delivered",label:"Delivered",group:"Lifecycle",defaultVisible:!0,minWidth:90},{key:"cancelled",label:"Cancelled",group:"Lifecycle",defaultVisible:!1,minWidth:90},{key:"kms",label:"Kms",group:"Metrics",defaultVisible:!0,width:70,align:"center"}],rt=ot.reduce((function(e,t){return(0,c.Z)((0,c.Z)({},e),{},(0,i.Z)({},t.key,t.defaultVisible))}),{}),nt=(0,s.useState)((function(){try{var e=JSON.parse(localStorage.getItem("ordersDetails.cols")||"null");return e&&"object"===typeof e?(0,c.Z)((0,c.Z)({},rt),e):rt}catch(t){return rt}})),it=(0,l.Z)(nt,2),lt=it[0],ct=it[1];(0,s.useEffect)((function(){try{localStorage.setItem("ordersDetails.cols",JSON.stringify(lt))}catch(e){}}),[lt]);var st=function(e){var t=ot.find((function(t){return t.key===e}));return(null===t||void 0===t?void 0:t.required)||!1!==lt[e]},at=ot.filter((function(e){return st(e.key)})).length,dt=ot.length-at,ut=(0,s.useState)(null),ht=(0,l.Z)(ut,2),xt=ht[0],pt=ht[1],ft=function(e){return ct((function(t){return(0,c.Z)((0,c.Z)({},t),{},(0,i.Z)({},e,!(!1!==t[e])))}))},gt=ot.every((function(e){return st(e.key)===!!e.defaultVisible})),mt=(0,s.useState)([]),bt=(0,l.Z)(mt,2),vt=bt[0],Zt=(bt[1],(0,s.useState)()),jt=(0,l.Z)(Zt,2),yt=jt[0],St=(jt[1],(0,s.useState)()),wt=(0,l.Z)(St,2),kt=wt[0],At=(wt[1],(0,s.useState)(!1)),Ct=(0,l.Z)(At,2),Dt=Ct[0],Wt=Ct[1],zt=(0,s.useState)({}),Pt=(0,l.Z)(zt,2),Rt=Pt[0],Et=(Pt[1],(0,s.useState)("All")),It=(0,l.Z)(Et,2),_t=It[0],Mt=It[1],Tt=(0,s.useState)(0),Lt=(0,l.Z)(Tt,2),Yt=Lt[0],Ot=Lt[1],Ht=(0,s.useState)(Re[0]),Bt=(0,l.Z)(Ht,2),Kt=Bt[0],Nt=Bt[1],Ft=(0,s.useState)([]),Vt=(0,l.Z)(Ft,2),Ut=Vt[0],qt=Vt[1],Gt=(0,s.useState)(0),Jt=(0,l.Z)(Gt,2),Xt=Jt[0],Qt=Jt[1],$t=(0,s.useState)("All Locations"),eo=(0,l.Z)($t,2),to=eo[0],oo=eo[1],ro=(0,s.useState)(null),no=(0,l.Z)(ro,2),io=no[0],lo=no[1],co=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,o=(0,s.useState)(e),r=(0,l.Z)(o,2),n=r[0],i=r[1];return(0,s.useEffect)((function(){var o=setTimeout((function(){i(e)}),t);return function(){return clearTimeout(o)}}),[e,t]),n}(qe,500),so=function(){var e=(0,n.Z)((0,r.Z)().mark((function e(t){var o;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,a.Z.get("".concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"https://mock-data-api-nextjs.vercel.app/",REACT_APP_AUTH0_CLIENT_ID:"",REACT_APP_AUTH0_DOMAIN:"",REACT_APP_AWS_APP_CLIENT_ID:"",REACT_APP_AWS_POOL_ID:"",REACT_APP_FIREBASE_API_KEY:"",REACT_APP_FIREBASE_APP_ID:"",REACT_APP_FIREBASE_AUTH_DOMAIN:"",REACT_APP_FIREBASE_MEASUREMENT_ID:"",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"",REACT_APP_FIREBASE_PROJECT_ID:"",REACT_APP_FIREBASE_STORAGE_BUCKET:"",REACT_APP_GOOGLE_MAPS_API_KEY:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_URL,"/tenants/gettenantlocations/?tenantid=").concat(t));case 3:o=e.sent,qt(o.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,s.useEffect)((function(){so(o)}),[]);(0,s.useEffect)((function(){var e=function(e){"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),L.current&&L.current.focus()),"Escape"===e.key&&document.activeElement===L.current&&L.current.blur()};return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}}),[]);var ao=(0,d.N)({queryKey:[te,ie,_t,Xt,co],queryFn:q.$w,getNextPageParam:function(e){return e.nextPage}}),uo=ao.data,ho=ao.isError,xo=ao.error,po=ao.fetchNextPage,fo=ao.isLoading,go=ao.hasNextPage,mo=ao.isFetchingNextPage,bo=(null===uo||void 0===uo?void 0:uo.pages.flatMap((function(e){return e.details})))||[];(0,s.useEffect)((function(){if(go){var e=new IntersectionObserver((function(e){e[0].isIntersecting&&po()}),{root:null,rootMargin:"0px 0px 400px 0px",threshold:0});return X.current&&e.observe(X.current),function(){X.current&&e.unobserve(X.current)}}}),[go,po]);var vo=(0,u.a)({queryKey:["deliverycount",te,ie,_t,Xt],queryFn:q.Vf}).data;if((0,s.useEffect)((function(){var e,t={All:null===vo||void 0===vo?void 0:vo.total,pending:null===vo||void 0===vo?void 0:vo.pending,accepted:null===vo||void 0===vo?void 0:vo.accepted,arrived:null===vo||void 0===vo?void 0:vo.arrived,picked:null===vo||void 0===vo?void 0:vo.picked,active:null===vo||void 0===vo?void 0:vo.active,delivered:null===vo||void 0===vo?void 0:vo.delivered,cancelled:null===vo||void 0===vo?void 0:vo.cancelled};Ot(null!==(e=t[_t])&&void 0!==e?e:0)}),[_t,vo]),(0,s.useEffect)((function(){var e=0,t=0;bo&&bo.forEach((function(o){e+=o.deliverycharges,t+=o.deliveryamt})),Be(e),Fe(t)}),[bo]),ho)return"An error has occurred:(isErrorOrderDetails) "+xo.message;var Zo=bo.map((function(e){return{tenantname:e.tenantname,tenantcity:e.tenantcity,tenantcontactno:e.tenantcontactno,rider:e.rider,orderid:e.orderid,orderdate:e.orderdate,deliverydate:e.deliverydate,orderstatus:e.orderstatus,deliverystatus:e.deliverystatus,ordernotes:e.ordernotes,kms:e.kms,actualkms:e.actualkms,assigntime:e.assigntime,starttime:e.starttime,arrivaltime:e.arrivaltime,pickuptime:e.pickuptime,deliverytime:e.deliverytime,canceltime:e.canceltime,deliverycharge:e.deliverycharge,deliveryamt:e.deliveryamt,pickupcustomer:e.pickupcustomer,pickupcontactno:e.pickupcontactno,pickupaddress:e.pickupaddress,pickupsuburb:e.pickupsuburb,pickupcity:e.pickupcity,pickuplat:e.pickuplat,pickuplong:e.pickuplong,deliverycustomer:e.deliverycustomer,deliverycontactno:e.deliverycontactno,deliveryaddress:e.deliveryaddress,deliverysuburb:e.deliverysuburb,deliverylat:e.deliverylat,deliverylong:e.deliverylong,locationname:e.locationname,locationsuburb:e.locationsuburb,locationcity:e.locationcity,locationcontactno:e.locationcontactno}})),jo=[{key:"total",label:"".concat("All"===_t?"Total":_t," Orders"),color:We,icon:T.YgO,value:Yt,hint:"Orders matching the current filters."},{key:"pending",label:"Pending",color:"#f59e0b",icon:T.Ley,value:null!==(e=null===vo||void 0===vo?void 0:vo.pending)&&void 0!==e?e:0,hint:"Orders awaiting rider assignment or pickup."},{key:"delivered",label:"Delivered",color:"#10b981",icon:T.ZSR,value:null!==(t=null===vo||void 0===vo?void 0:vo.delivered)&&void 0!==t?t:0,hint:"Successfully delivered orders."}];return(0,se.jsxs)(se.Fragment,{children:[fo&&(0,se.jsx)(J.Z,{}),(0,se.jsx)(x.Z,{elevation:0,sx:{mb:{xs:1,md:1.25},px:{xs:1.5,sm:2},py:{xs:1,sm:1.25},borderRadius:2,border:"1px solid",borderColor:je,background:"linear-gradient(135deg, ".concat(ke(We)," 0%, ").concat(ke(ze)," 100%)"),boxShadow:ge},children:(0,se.jsxs)(m.Z,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1,sm:1.5},children:[(0,se.jsxs)(m.Z,{direction:"row",alignItems:"center",spacing:1.25,children:[(0,se.jsx)(p.Z,{variant:"rounded",sx:{width:36,height:36,bgcolor:We,color:"#fff",borderRadius:1.5,boxShadow:"0 4px 12px ".concat(Ce(We))},children:(0,se.jsx)(T.VHP,{size:19})}),(0,se.jsxs)(m.Z,{spacing:.125,children:[(0,se.jsx)(g.Z,{variant:"h3",sx:{fontWeight:800,color:be,lineHeight:1.1,fontSize:{xs:"1.1rem",sm:"1.25rem",md:"1.375rem"}},children:"Orders Details"}),(0,se.jsxs)(m.Z,{direction:"row",alignItems:"center",spacing:.75,children:[(0,se.jsx)(f.Z,{sx:{width:7,height:7,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 3px rgba(16,185,129,0.18)"}}),(0,se.jsxs)(g.Z,{sx:{fontSize:11.5,color:ve,fontWeight:600},children:["Live \xb7 ",to," \xb7 ",we]})]})]})]}),(0,se.jsxs)(m.Z,{direction:"row",alignItems:"center",spacing:.75,flexWrap:"wrap",useFlexGap:!0,children:[(0,se.jsx)(b.Z,{title:et?"Switch to comfortable density":"Switch to compact density",arrow:!0,children:(0,se.jsx)(v.Z,{onClick:function(){return $e((function(e){return"compact"===e?"comfortable":"compact"}))},disableElevation:!0,variant:"outlined",size:"small",startIcon:(0,se.jsx)(T.VK0,{size:15,style:{transform:et?"none":"scaleY(1.4)"}}),sx:{height:32,px:1.25,borderRadius:1.5,textTransform:"none",fontSize:12.5,fontWeight:700,bgcolor:"#fff",borderColor:je,color:be,"&:hover":{bgcolor:"#fff",borderColor:We,color:We,boxShadow:"0 0 0 3px ".concat(Ce(We))}},children:et?"Compact":"Comfortable"})}),(0,se.jsx)(b.Z,{title:"Show or hide columns",arrow:!0,children:(0,se.jsx)(v.Z,{onClick:function(e){return pt(e.currentTarget)},disableElevation:!0,variant:"outlined",size:"small",startIcon:(0,se.jsx)(T.Dx,{size:15}),endIcon:dt>0?(0,se.jsxs)(f.Z,{component:"span",sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:30,height:18,px:.5,borderRadius:999,bgcolor:Ae(We),color:We,fontSize:10.5,fontWeight:800,lineHeight:1},children:[at,"/",ot.length]}):null,sx:{height:32,px:1.25,borderRadius:1.5,textTransform:"none",fontSize:12.5,fontWeight:700,bgcolor:dt>0?ke(We):"#fff",borderColor:dt>0?De(We):je,color:dt>0?We:be,"&:hover":{bgcolor:dt>0?ke(We):"#fff",borderColor:We,color:We,boxShadow:"0 0 0 3px ".concat(Ce(We))}},children:"Columns"})}),(0,se.jsx)(b.Z,{title:"Filter by date range",arrow:!0,children:(0,se.jsx)(v.Z,{onClick:function(){return ue(!0)},disableElevation:!0,variant:"outlined",size:"small",startIcon:(0,se.jsx)(T.sHf,{size:15}),sx:{height:32,px:1.25,borderRadius:1.5,textTransform:"none",fontSize:12.5,fontWeight:700,letterSpacing:.1,bgcolor:"#fff",borderColor:je,color:be,"&:hover":{bgcolor:"#fff",borderColor:We,color:We,boxShadow:"0 0 0 3px ".concat(Ce(We))},"&:focus-visible":{boxShadow:"0 0 0 3px ".concat(Ce(We))}},children:te&&ie?"".concat(Y()(te).format("DD MMM")," \u2013 ").concat(Y()(ie).format("DD MMM")):"All time"})}),(0,se.jsx)(f.Z,{sx:{display:"inline-flex","& a":{textDecoration:"none",lineHeight:0}},children:(0,se.jsx)(G.ZZ,{data:Zo,filename:"Orders_Detail_".concat(Y()().format("YYYY-MM-DD_HHmmss"),".csv"),label:"Download",style:{height:32,minHeight:32,px:1.5,borderRadius:1.5,bgcolor:We,color:"#fff",textTransform:"none",fontSize:12.5,fontWeight:700,letterSpacing:.1,boxShadow:"0 2px 6px ".concat(Ce(We)),"&:hover":{bgcolor:ze,boxShadow:"0 4px 12px ".concat(Ce(We))},"&:focus-visible":{boxShadow:"0 0 0 3px ".concat(Ce(We))},"& .MuiButton-startIcon":{mr:.75,"& svg":{fontSize:16}}}})})]})]})}),(0,se.jsx)(Z.ZP,{container:!0,spacing:{xs:1,sm:1.25,md:1.5},children:jo.map((function(e){var t,o=e.icon;return(0,se.jsx)(Z.ZP,{item:!0,xs:6,sm:4,md:4,children:(0,se.jsx)(b.Z,{title:e.hint||"",placement:"top",arrow:!0,children:(0,se.jsxs)(x.Z,{elevation:0,sx:{position:"relative",overflow:"hidden",px:{xs:1.25,sm:1.5},py:{xs:.875,sm:1.125},borderRadius:2,border:"1px solid",borderColor:je,background:"#fff",transition:"transform 0.15s, box-shadow 0.15s, border-color 0.15s","&:hover":{transform:"translateY(-1px)",boxShadow:ge,borderColor:De(e.color)}},children:[(0,se.jsx)(f.Z,{sx:{position:"absolute",top:0,left:0,bottom:0,width:3,background:e.color}}),(0,se.jsxs)(m.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,sx:{pl:.5},children:[(0,se.jsxs)(m.Z,{spacing:.125,sx:{minWidth:0,flex:1},children:[(0,se.jsx)(g.Z,{sx:{color:ve,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:10.5,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",lineHeight:1.2},children:e.label}),(0,se.jsx)(g.Z,{sx:{fontWeight:800,color:be,lineHeight:1.15,fontSize:{xs:"0.95rem",sm:"1.1rem",md:"1.2rem"}},noWrap:!0,children:fo&&!e.value?(0,se.jsx)(j.Z,{sx:{width:40},animation:"wave"}):e.isMoney?Ye(e.value):null!==(t=e.value)&&void 0!==t?t:0})]}),(0,se.jsx)(p.Z,{variant:"rounded",sx:{width:30,height:30,bgcolor:Ae(e.color),color:e.color,borderRadius:1.25,flexShrink:0},children:(0,se.jsx)(o,{size:15})})]})]})})},e.key)}))}),(0,se.jsx)(x.Z,{elevation:0,sx:{mt:{xs:1,md:1.25},p:{xs:1,md:1.125},borderRadius:2,border:"1px solid",borderColor:je,background:"#fff",boxShadow:fe},children:(0,se.jsxs)(Z.ZP,{container:!0,spacing:1,alignItems:"center",children:[(0,se.jsx)(Z.ZP,{item:!0,xs:12,sm:6,md:4,children:1===Ut.length?(0,se.jsxs)(f.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.75,px:1.5,py:.875,borderRadius:999,bgcolor:ke(We),border:"1.5px solid ".concat(De(We)),color:We,fontWeight:800,fontSize:13,width:"100%"},children:[(0,se.jsx)(T.x$F,{size:14})," ",Ut[0].locationname]}):(0,se.jsx)(y.Z,{fullWidth:!0,options:Ut||[],value:io,getOptionLabel:function(e){return e?"".concat(e.locationname," (").concat(e.suburb||"",")"):""},PaperComponent:Ee,onChange:function(e,t,o){t&&(lo(t),Qt(t.locationid),oo(t.locationname)),"clear"===o&&(lo(null),Qt(0),oo("All Locations"))},renderInput:function(e){return(0,se.jsx)(S.Z,(0,c.Z)((0,c.Z)({},e),{},{placeholder:"All Locations",size:"small",sx:_e("#10b981"),InputProps:(0,c.Z)((0,c.Z)({},e.InputProps),{},{startAdornment:(0,se.jsx)(m.Z,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5},children:(0,se.jsx)(Ie,{color:"#10b981",size:22,selected:!0,children:(0,se.jsx)(T.c7Z,{size:13})})})})}))}})}),(0,se.jsx)(Z.ZP,{item:!0,xs:12,sm:6,md:4,children:(0,se.jsx)(y.Z,{fullWidth:!0,options:Re,value:Kt,getOptionLabel:function(e){return(null===e||void 0===e?void 0:e.status)||""},PaperComponent:Ee,onChange:function(e,t,o){"clear"===o?(Mt("All"),Nt(Re[0])):(Mt(t.statusLow),Nt(t))},renderInput:function(e){return(0,se.jsx)(S.Z,(0,c.Z)((0,c.Z)({},e),{},{placeholder:"Status",size:"small",sx:_e((null===Kt||void 0===Kt?void 0:Kt.color)||We),InputProps:(0,c.Z)((0,c.Z)({},e.InputProps),{},{startAdornment:(0,se.jsx)(m.Z,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5},children:(0,se.jsx)(Ie,{color:(null===Kt||void 0===Kt?void 0:Kt.color)||We,size:22,selected:!0,children:null!==Kt&&void 0!==Kt&&Kt.icon?s.createElement(Kt.icon,{size:13}):(0,se.jsx)(T.VK0,{size:13})})})})}))}})}),(0,se.jsx)(Z.ZP,{item:!0,xs:12,sm:12,md:4,children:(0,se.jsxs)(f.Z,{sx:{display:"flex",alignItems:"center",gap:.75,px:1.25,py:.75,borderRadius:999,bgcolor:ke(We),border:"1.5px solid ".concat(De(We)),transition:"all 0.18s","&:focus-within":{borderColor:We,boxShadow:"0 0 0 3px ".concat(Ce(We))}},children:[(0,se.jsx)(T.vU7,{size:16,style:{color:We,flexShrink:0}}),(0,se.jsx)(w.ZP,{inputRef:L,placeholder:"Search (ctrl+k)",value:qe,onChange:function(e){return Ge(e.target.value)},autoComplete:"off",sx:{flex:1,fontSize:13,fontWeight:600,color:be,"& input::placeholder":{color:Ze,opacity:1}}}),qe&&(0,se.jsx)(k.Z,{size:"small",onClick:function(){return Ge("")},sx:{p:.25,color:We},children:(0,se.jsx)(T.lUB,{size:14})})]})})]})}),(0,se.jsx)(x.Z,{elevation:0,sx:{mt:{xs:1,md:1.25},borderRadius:2,border:"1px solid",borderColor:je,overflow:"hidden",background:"#fff"},children:(0,se.jsx)(A.Z,{ref:Q,onScroll:function(e){var t=e.currentTarget,o=t.scrollTop,r=t.scrollHeight;o+t.clientHeight>=r-50&&go&&!mo&&po()},sx:{overflowX:"auto",overflowY:"visible","&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-thumb":{backgroundColor:De(We),borderRadius:8,"&:hover":{backgroundColor:We}},"&::-webkit-scrollbar-track":{backgroundColor:Se}},children:(0,se.jsxs)(C.Z,{stickyHeader:!0,size:"small",sx:{minWidth:ot.filter((function(e){return st(e.key)})).reduce((function(e,t){return e+(t.width||t.minWidth||100)}),0),tableLayout:"auto"},children:[(0,se.jsx)(D.Z,{children:(0,se.jsxs)(W.Z,{sx:{"& th":{backgroundColor:Se,color:ve,fontSize:10.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(je),py:.75,px:1}},children:[st("index")&&(0,se.jsx)(z.Z,{sx:{width:36},children:"#"}),st("location")&&(0,se.jsx)(z.Z,{sx:{minWidth:150},children:"Location / Order"}),st("pickup")&&(0,se.jsx)(z.Z,{sx:{minWidth:140},children:"Pickup"}),st("drop")&&(0,se.jsx)(z.Z,{sx:{minWidth:140},children:"Drop"}),st("status")&&(0,se.jsx)(z.Z,{sx:{width:110},children:"Status"}),st("assigned")&&(0,se.jsx)(z.Z,{sx:{minWidth:110},children:"Assigned"}),st("accepted")&&(0,se.jsx)(z.Z,{sx:{minWidth:90},children:"Accepted"}),st("arrived")&&(0,se.jsx)(z.Z,{sx:{minWidth:90},children:"Arrived"}),st("picked")&&(0,se.jsx)(z.Z,{sx:{minWidth:90},children:"Picked"}),st("delivered")&&(0,se.jsx)(z.Z,{sx:{minWidth:90},children:"Delivered"}),st("cancelled")&&(0,se.jsx)(z.Z,{sx:{minWidth:90},children:"Cancelled"}),st("kms")&&(0,se.jsx)(z.Z,{align:"center",sx:{width:70},children:"Kms"})]})}),(0,se.jsxs)(P.Z,{children:[0===(null===bo||void 0===bo?void 0:bo.length)&&!fo&&(0,se.jsx)(W.Z,{children:(0,se.jsx)(z.Z,{colSpan:at,sx:{py:7,borderBottom:"none"},children:(0,se.jsxs)(m.Z,{alignItems:"center",spacing:1.25,children:[(0,se.jsx)(p.Z,{sx:{width:56,height:56,bgcolor:Ae("#94a3b8"),color:Ze,borderRadius:2},variant:"rounded",children:(0,se.jsx)(T.VHP,{size:26})}),(0,se.jsx)(g.Z,{sx:{fontWeight:700,color:be,fontSize:14},children:"No orders match these filters"}),(0,se.jsx)(g.Z,{sx:{color:ve,fontSize:12},children:qe?"Try a different keyword or clear the search.":"Adjust the location, status, or date range above."}),qe&&(0,se.jsx)(v.Z,{size:"small",onClick:function(){return Ge("")},sx:{mt:.5,height:28,textTransform:"none",fontSize:12,fontWeight:700,color:We,borderRadius:1.25,"&:hover":{bgcolor:ke(We)}},startIcon:(0,se.jsx)(T.lUB,{size:14}),children:"Clear search"})]})})}),fo&&0===bo.length&&Array.from({length:10}).map((function(e,t){return(0,se.jsx)(W.Z,{children:Array.from({length:at}).map((function(e,t){return(0,se.jsx)(z.Z,{sx:{borderBottom:"1px solid ".concat(ye),py:.625,px:1},children:(0,se.jsx)(j.Z,{animation:"wave",height:20})},t)}))},"sk-".concat(t))})),bo.map((function(e,t){return(0,se.jsxs)(W.Z,{sx:{cursor:"pointer",transition:"background-color 0.12s, box-shadow 0.12s","& td":{borderBottom:"1px solid ".concat(ye),py:tt,px:1,verticalAlign:"top"},"&:hover":{backgroundColor:ke(We),boxShadow:"inset 3px 0 0 ".concat(We)}},children:[st("index")&&(0,se.jsx)(z.Z,{children:(0,se.jsx)(g.Z,{sx:{fontWeight:700,fontSize:12,color:Ze},children:t+1})}),st("location")&&(0,se.jsxs)(z.Z,{children:[(0,se.jsx)(g.Z,{sx:{fontSize:12.5,fontWeight:700,color:be,lineHeight:1.25},noWrap:!0,children:e.locationname}),(0,se.jsx)(b.Z,{title:"Order Id",children:(0,se.jsx)(g.Z,{sx:{fontSize:11,color:ve,fontWeight:600,lineHeight:1.3},noWrap:!0,children:e.orderid})}),(0,se.jsx)(b.Z,{title:"Delivery Date",children:(0,se.jsxs)(m.Z,{direction:"row",alignItems:"center",spacing:.5,sx:{mt:.125},children:[(0,se.jsx)(T.dKE,{size:10,style:{color:Ze,flexShrink:0}}),(0,se.jsx)(g.Z,{sx:{fontSize:10.5,color:ve,fontWeight:700},noWrap:!0,children:Y()(e.deliverydate).utc().format("hh:mm A")}),(0,se.jsxs)(g.Z,{sx:{fontSize:10.5,color:Ze,fontWeight:600},noWrap:!0,children:["\xb7 ",Y()(e.deliverydate).utc().format("DD MMM YY")]})]})})]}),st("pickup")&&(0,se.jsx)(z.Z,{children:(0,se.jsxs)(m.Z,{spacing:.125,children:[(0,se.jsx)(g.Z,{sx:{fontSize:12.5,fontWeight:700,color:be,lineHeight:1.25},noWrap:!0,children:e.pickupcustomer}),(0,se.jsx)(g.Z,{sx:{fontSize:11,color:ve,fontWeight:600,lineHeight:1.3},noWrap:!0,children:e.pickupcontactno}),(0,se.jsx)(b.Z,{title:e.Pickupaddress||e.pickupaddress,children:(0,se.jsx)(g.Z,{sx:{fontSize:10.5,color:Ze,fontWeight:600,lineHeight:1.3},noWrap:!0,children:e.pickupsuburb||e.pickuplocation||(e.Pickupaddress?"".concat(e.Pickupaddress.slice(0,20),"\u2026"):"\u2014")})})]})}),st("drop")&&(0,se.jsx)(z.Z,{children:(0,se.jsxs)(m.Z,{spacing:.125,children:[(0,se.jsx)(g.Z,{sx:{fontSize:12.5,fontWeight:700,color:be,lineHeight:1.25},noWrap:!0,children:e.deliverycustomer}),(0,se.jsx)(g.Z,{sx:{fontSize:11,color:ve,fontWeight:600,lineHeight:1.3},noWrap:!0,children:e.deliverycontactno}),(0,se.jsx)(b.Z,{title:e.deliveryaddress,children:(0,se.jsx)(g.Z,{sx:{fontSize:10.5,color:Ze,fontWeight:600,lineHeight:1.3},noWrap:!0,children:e.deliverysuburb||e.deliverylocation||(e.deliveryaddress?"".concat(e.deliveryaddress.slice(0,20),"\u2026"):"\u2014")})})]})}),st("status")&&(0,se.jsx)(z.Z,{children:(0,se.jsx)(Me,{status:e.orderstatus})}),st("assigned")&&(0,se.jsx)(z.Z,{children:(0,se.jsxs)(m.Z,{spacing:.25,children:[e.ridername&&(0,se.jsx)(g.Z,{sx:{fontSize:11,fontWeight:800,color:We},noWrap:!0,children:e.ridername}),(0,se.jsx)(Le,{value:e.assigntime})]})}),st("accepted")&&(0,se.jsx)(z.Z,{children:(0,se.jsx)(Le,{value:e.starttime})}),st("arrived")&&(0,se.jsx)(z.Z,{children:(0,se.jsx)(Le,{value:e.arrivaltime})}),st("picked")&&(0,se.jsx)(z.Z,{children:(0,se.jsx)(Le,{value:e.pickuptime})}),st("delivered")&&(0,se.jsx)(z.Z,{children:(0,se.jsx)(Le,{value:e.deliverytime})}),st("cancelled")&&(0,se.jsx)(z.Z,{children:(0,se.jsx)(Le,{value:e.canceltime})}),st("kms")&&(0,se.jsx)(z.Z,{align:"center",children:(0,se.jsx)(Te,{value:"cancelled"===e.orderstatus||""===e.kms?0:Number(parseFloat(e.kms||0).toFixed(1)),color:"#f59e0b",icon:(0,se.jsx)(T.v93,{size:11})})})]},"".concat(e.orderid,"-").concat(t))})),0!==bo.length&&(0,se.jsx)(W.Z,{sx:{"&:hover":{backgroundColor:"transparent !important"}},children:(0,se.jsx)(z.Z,{colSpan:at,sx:{borderBottom:"none",py:1,bgcolor:Se},children:(0,se.jsx)(m.Z,{ref:X,direction:"row",alignItems:"center",justifyContent:"center",spacing:1,sx:{minHeight:32},children:mo||go?(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(R.Z,{size:14,sx:{color:We}}),(0,se.jsx)(g.Z,{sx:{fontSize:11.5,color:ve,fontWeight:700},children:"Loading more orders\u2026"})]}):(0,se.jsxs)(g.Z,{sx:{fontSize:11.5,color:Ze,fontWeight:700,letterSpacing:.3},children:[bo.length," order",1===bo.length?"":"s"," \xb7 End of list"]})})})})]})]})})}),(0,se.jsxs)(E.Z,{anchorEl:xt,open:Boolean(xt),onClose:function(){return pt(null)},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{mt:.75,width:300,borderRadius:2.5,border:"1px solid ".concat(je),boxShadow:me,overflow:"hidden"}}},MenuListProps:{sx:{py:0}},children:[(0,se.jsxs)(f.Z,{sx:{px:1.5,pt:1.25,pb:1.125,background:"linear-gradient(135deg, ".concat(ke(We)," 0%, ").concat(ke(ze)," 100%)"),borderBottom:"1px solid ".concat(je)},children:[(0,se.jsx)(m.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,children:(0,se.jsxs)(m.Z,{direction:"row",alignItems:"center",spacing:1,children:[(0,se.jsx)(p.Z,{variant:"rounded",sx:{width:28,height:28,bgcolor:We,color:"#fff",borderRadius:1.25},children:(0,se.jsx)(T.Dx,{size:15})}),(0,se.jsxs)(m.Z,{spacing:0,children:[(0,se.jsx)(g.Z,{sx:{fontSize:13,fontWeight:800,color:be,lineHeight:1.15},children:"Columns"}),(0,se.jsxs)(g.Z,{sx:{fontSize:10.5,fontWeight:700,color:ve,lineHeight:1.2},children:[at," of ",ot.length," shown"]})]})]})}),(0,se.jsxs)(m.Z,{direction:"row",spacing:.75,sx:{mt:1.125},children:[(0,se.jsx)(v.Z,{size:"small",onClick:function(){return ct(ot.reduce((function(e,t){return(0,c.Z)((0,c.Z)({},e),{},(0,i.Z)({},t.key,!0))}),{}))},disabled:0===dt,startIcon:(0,se.jsx)(T.smy,{size:13}),sx:{flex:1,height:28,px:1,fontSize:11.5,fontWeight:800,textTransform:"none",borderRadius:1.25,color:We,bgcolor:"#fff",border:"1px solid ".concat(De(We)),"&:hover":{bgcolor:ke(We),borderColor:We},"&.Mui-disabled":{color:Ze,bgcolor:"#fff",borderColor:je,opacity:.7}},children:"Show all"}),(0,se.jsx)(v.Z,{size:"small",onClick:function(){return ct(rt)},disabled:gt,startIcon:(0,se.jsx)(T.zq9,{size:14}),sx:{flex:1,height:28,px:1,fontSize:11.5,fontWeight:800,textTransform:"none",borderRadius:1.25,color:ve,bgcolor:"#fff",border:"1px solid ".concat(je),"&:hover":{bgcolor:Se,borderColor:Ze,color:be},"&.Mui-disabled":{color:Ze,bgcolor:"#fff",borderColor:je,opacity:.7}},children:"Reset"})]})]}),(0,se.jsx)(f.Z,{sx:{maxHeight:340,overflowY:"auto",py:.5},children:["Core","Lifecycle","Metrics"].map((function(e){var t=ot.filter((function(t){return t.group===e})),o=t.filter((function(e){return st(e.key)})).length;return(0,se.jsxs)(f.Z,{sx:{px:.5,pb:.25},children:[(0,se.jsxs)(m.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{px:1,pt:.875,pb:.375},children:[(0,se.jsx)(g.Z,{sx:{fontSize:10,fontWeight:800,color:Ze,letterSpacing:.7,textTransform:"uppercase"},children:e}),(0,se.jsxs)(g.Z,{sx:{fontSize:10,fontWeight:700,color:Ze},children:[o,"/",t.length]})]}),t.map((function(e){var t=st(e.key),o=!!e.required;return(0,se.jsxs)(f.Z,{onClick:function(){return!o&&ft(e.key)},sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,mx:.5,px:1,py:.375,borderRadius:1.5,cursor:o?"default":"pointer",bgcolor:t?ke(We):"transparent",border:"1px solid ".concat(t?De(We):"transparent"),transition:"background-color 0.15s, border-color 0.15s","&:hover":{bgcolor:o?t?ke(We):"transparent":Ae(We)}},children:[(0,se.jsxs)(m.Z,{direction:"row",alignItems:"center",spacing:.625,sx:{minWidth:0},children:[(0,se.jsx)(g.Z,{noWrap:!0,sx:{fontSize:13,fontWeight:700,color:t?be:ve},children:e.label}),o&&(0,se.jsx)(b.Z,{title:"Always visible",arrow:!0,children:(0,se.jsx)(f.Z,{sx:{display:"inline-flex",color:Ze},children:(0,se.jsx)(T.Tmq,{size:11})})})]}),(0,se.jsx)(I.Z,{size:"small",checked:t,disabled:o,onClick:function(e){return e.stopPropagation()},onChange:function(){return!o&&ft(e.key)},sx:{"& .MuiSwitch-switchBase.Mui-checked":{color:We},"& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track":{backgroundColor:We,opacity:1},"& .MuiSwitch-switchBase.Mui-disabled.Mui-checked":{color:ze},"& .MuiSwitch-switchBase.Mui-disabled.Mui-checked + .MuiSwitch-track":{backgroundColor:ze,opacity:.6}}})]},e.key)}))]},e)}))})]}),(0,se.jsxs)(_.Z,{open:de,onClose:function(){return ue(!1)},PaperProps:{sx:{borderRadius:3}},children:[(0,se.jsx)(f.Z,{sx:{p:2.5,background:"linear-gradient(135deg, ".concat(ke(We)," 0%, ").concat(ke(ze)," 100%)"),borderBottom:"1px solid ".concat(je)},children:(0,se.jsxs)(m.Z,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,se.jsx)(p.Z,{sx:{bgcolor:We,color:"#fff",width:40,height:40,boxShadow:"0 6px 18px ".concat(Ce(We))},children:(0,se.jsx)(T.sHf,{size:20})}),(0,se.jsxs)(m.Z,{children:[(0,se.jsx)(g.Z,{variant:"h5",sx:{fontWeight:800,color:be},children:"Select Date Range"}),(0,se.jsx)(g.Z,{variant:"caption",sx:{color:ve,fontWeight:600},children:"Filter the order details by a date range or preset"})]})]})}),(0,se.jsx)(M.Z,{sx:{width:"100%"},className:"datedialog",children:(0,se.jsx)(O.D,{open:de,toggle:function(){return ue(!de)},id:"daterange1",onChange:function(e){"All"===e.label?(oe(""),le(""),Pe("All"),ue(!1)):(oe(Y()(e.startDate).format("YYYY-MM-DD")),le(Y()(e.endDate).format("YYYY-MM-DD")),Pe(e.label||""))},definedRanges:[{label:"Today",startDate:new Date,endDate:new Date},{label:"Yesterday",startDate:(0,H.Z)(new Date,-1),endDate:(0,H.Z)(new Date,-1)},{label:"Tomorrow",startDate:(0,H.Z)(new Date,1),endDate:(0,H.Z)(new Date,1)},{label:"This Week",startDate:(0,B.Z)(new Date),endDate:(0,K.Z)(new Date)},{label:"Last Week",startDate:(0,B.Z)((0,N.Z)(new Date,-1)),endDate:(0,K.Z)((0,N.Z)(new Date,-1))},{label:"Last 7 Days",startDate:(0,N.Z)(new Date,-1),endDate:new Date},{label:"This Month",startDate:(0,F.Z)(new Date),endDate:(0,V.Z)(new Date)},{label:"Last Month",startDate:(0,F.Z)((0,U.Z)(new Date,-1)),endDate:(0,V.Z)((0,U.Z)(new Date,-1))},{label:"All",startDate:new Date,endDate:(0,H.Z)(new Date,-1)}]})}),(0,se.jsxs)(m.Z,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{width:"100%",p:2,borderTop:"1px solid ".concat(ye)},children:[(0,se.jsx)(v.Z,{variant:"outlined",onClick:function(){return ue(!1)},sx:{borderRadius:999,px:2.5,borderColor:je,color:ve,fontWeight:700,"&:hover":{borderColor:ve,bgcolor:Se}},children:"Cancel"}),(0,se.jsx)(v.Z,{variant:"contained",onClick:function(){return ue(!1)},sx:{borderRadius:999,px:3,bgcolor:We,fontWeight:700,boxShadow:"0 6px 18px ".concat(Ce(We)),"&:hover":{bgcolor:"#4D1C61"}},children:"Apply"})]})]}),(0,se.jsx)(_.Z,{open:Dt,onClose:function(){return Wt(!1)},maxWidth:"lg",fullWidth:!0,PaperProps:{sx:{borderRadius:3,overflow:"hidden"}},children:vt&&(0,se.jsx)(f.Z,{children:(0,se.jsx)(he,{coordinates:vt,additionalProps:{riderStart:yt,riderEnd:kt},order:Rt,setMapOpen:Wt})})})]})}}}]);