Files
Express_console_build/build/static/js/5535.4f053f1f.chunk.js

1 line
42 KiB
JavaScript

"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[5535],{10181:(e,t,r)=>{r.r(t),r.d(t,{default:()=>me});var o=r(22555),n=r(85672),i=r(66157),l=r(68320),s=r(55235),a=r(97043),c=r(23440),d=r(48738),x=r(2866),h=r(69039),u=r(76264),p=r(1939),m=r(71392),f=r(11969),g=r(1150),j=r(58571),A=r(83209),b=r(72486),v=r(54016),w=r(50755),y=r(1596),S=r(81802),k=r(81062),z=r(58689),C=r(5670),D=r(48952),M=r(46077),W=r.n(M),I=r(81425),R=r(52351),N=r(35678),Y=r(59212),P=r(56311),T=r(27001),L=r(36803),F=r(96646),O=r(38965),B=r(43e3),K=r(69191),H=r(91001),E=r(87),U=r(19283),$=r(73413),X=r.n($),V=(r(98443),r(12010)),G=r(65908);const Q={width:"100%",height:"100%"},Z=(e,t)=>{const r=t?38:32,o=t?"#4D1C61":"#662582",n=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="'.concat(r,'" height="').concat(r,'">')+'<circle cx="16" cy="16" r="14" fill="'.concat(o,'" stroke="white" stroke-width="3"/>')+'<text x="16" y="21" text-anchor="middle" font-family="Arial,sans-serif" font-size="14" font-weight="700" fill="white">'.concat(e,"</text>")+"</svg>");return new(X().Icon)({iconUrl:"data:image/svg+xml;charset=UTF-8,".concat(n),iconSize:[r,r],iconAnchor:[r/2,r/2]})},_=e=>{let{dropPath:t}=e;const r=(0,O.ko)();return(0,n.useEffect)((()=>{t.length&&(1===t.length?r.setView(t[0],14):r.fitBounds(t,{padding:[48,48]}))}),[t,r]),null};function q(e){let{details:t,loading:r,riderName:o,dateRange:i,onClose:l}=e;const[s,a]=(0,n.useState)(null),[c,h]=(0,n.useState)([]),[u,p]=(0,n.useState)(!1),g=(0,n.useMemo)((()=>(t||[]).map((e=>[e.dropLat,e.dropLng]))),[t]);(0,n.useEffect)((()=>{if(g.length<2)return void h([]);let e=!1;return(async()=>{p(!0);try{var t;const r=g.map((e=>{let[t,r]=e;return"".concat(r,",").concat(t)})).join(";"),o="https://router.project-osrm.org/route/v1/driving/".concat(r,"?overview=full&geometries=geojson"),n=await fetch(o),i=await n.json();if(!e&&null!==(t=i.routes)&&void 0!==t&&t.length){const e=i.routes[0].geometry.coordinates.map((e=>{let[t,r]=e;return[r,t]}));h(e)}else e||h([])}catch(r){console.warn("OSRM route error:",r),e||h([])}finally{e||p(!1)}})(),()=>{e=!0}}),[g]);const j=(0,G.jsxs)(m.A,{direction:"row",alignItems:"center",spacing:1.5,sx:{px:2,py:1.25,borderBottom:"1px solid rgba(15, 23, 42, 0.08)",background:"linear-gradient(135deg, #662582 0%, #9255AB 100%)",color:"#fff",flexShrink:0},children:[(0,G.jsx)(D.pk7,{size:20}),(0,G.jsxs)(m.A,{sx:{flex:1,minWidth:0},children:[(0,G.jsxs)(x.A,{sx:{fontWeight:700,fontSize:15,lineHeight:1.2},children:["Planned route",o?" \u2014 ".concat(o):""]}),i&&(0,G.jsx)(x.A,{sx:{fontSize:12,opacity:.85},children:i})]}),t&&t.length>0&&(0,G.jsxs)(x.A,{sx:{fontSize:12,opacity:.9,fontWeight:600},children:[t.length," ",1===t.length?"stop":"stops",u?" \xb7 resolving route\u2026":""]}),l&&(0,G.jsx)(f.A,{size:"small",onClick:l,sx:{color:"#fff"},"aria-label":"Close",children:(0,G.jsx)(D.m6K,{})})]});return r?(0,G.jsxs)(d.A,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[j,(0,G.jsxs)(m.A,{alignItems:"center",justifyContent:"center",sx:{flex:1,gap:1.5},children:[(0,G.jsx)(V.A,{size:32}),(0,G.jsx)(x.A,{sx:{color:"#64748b",fontSize:13},children:"Loading planned route\u2026"})]})]}):t&&0!==t.length?(0,G.jsxs)(d.A,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[j,(0,G.jsx)(d.A,{sx:{flex:1,minHeight:0},children:(0,G.jsxs)(B.W,{center:g[0],zoom:14,style:Q,zoomControl:!1,children:[(0,G.jsx)(K.e,{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:"\xa9 OpenStreetMap contributors"}),(0,G.jsx)(_,{dropPath:g}),c.length>0?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(H.R,{positions:c,pathOptions:{color:"#662582",opacity:.25,weight:8}}),(0,G.jsx)(H.R,{positions:c,pathOptions:{color:"#662582",opacity:.95,weight:4}})]}):(0,G.jsx)(H.R,{positions:g,pathOptions:{color:"#662582",opacity:.6,weight:3,dashArray:"2 10",lineCap:"round"}}),t.map(((e,t)=>{const r=e.step||t+1,o=s===e.deliveryid;return(0,G.jsx)(E.p,{position:[e.dropLat,e.dropLng],icon:Z(r,o),eventHandlers:{click:()=>a(o?null:e.deliveryid)},zIndexOffset:o?1e3:r,children:(0,G.jsx)(U.z,{onClose:()=>a(null),children:(0,G.jsxs)(d.A,{sx:{minWidth:180,fontFamily:"inherit"},children:[(0,G.jsxs)(x.A,{sx:{fontWeight:800,fontSize:13,color:"#0f172a"},children:["Step ",r," \xb7 ",e.customer]}),e.address&&(0,G.jsx)(x.A,{sx:{fontSize:12,color:"#475569",mt:.5},children:e.address}),e.expectedTime&&(0,G.jsxs)(x.A,{sx:{fontSize:12,color:"#64748b",mt:.5},children:["ETA ",String(e.expectedTime).slice(11,16)||e.expectedTime]}),e.orderid&&(0,G.jsxs)(x.A,{sx:{fontSize:11,color:"#94a3b8",mt:.5},children:["Order #",e.orderid]})]})})},"step-".concat(e.deliveryid||e.orderid||t))}))]})})]}):(0,G.jsxs)(d.A,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[j,(0,G.jsxs)(m.A,{alignItems:"center",justifyContent:"center",sx:{flex:1,gap:1,p:3},children:[(0,G.jsx)(x.A,{sx:{color:"#1e293b",fontWeight:700,fontSize:16},children:"No planned route for this rider"}),(0,G.jsx)(x.A,{sx:{color:"#64748b",fontSize:13,textAlign:"center",maxWidth:360},children:"There are no deliveries with drop coordinates assigned to this rider for the selected date range."})]})]})}var J=r(20466),ee=r(23787),te=r(22686);W().extend(te);const re={radiusPill:999,radiusCard:14,shadowSoft:"0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.05)",shadowMd:"0 1px 3px rgba(15, 23, 42, 0.06)",shadowPop:"0 12px 32px rgba(15, 23, 42, 0.12)",textPrimary:"#0f172a",textSecondary:"#64748b",textMuted:"#94a3b8",borderSubtle:"#e2e8f0",divider:"#f1f5f9",surface:"#ffffff",surfaceAlt:"#f8fafc"},oe=(e,t)=>"".concat(e).concat(t),ne=e=>oe(e,"08"),ie=e=>oe(e,"18"),le=e=>oe(e,"26"),se=e=>oe(e,"55"),ae="#662582",ce="#9255AB",de=e=>(0,G.jsx)(s.A,(0,o.A)((0,o.A)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:re.shadowPop,border:"1px solid",borderColor:"divider",overflow:"hidden"}})),xe=e=>{let{color:t,selected:r,size:o=24,children:n}=e;return(0,G.jsx)(a.A,{sx:{width:o,height:o,bgcolor:r?t:ie(t),color:r?"#fff":t,transition:"background-color 0.15s, color 0.15s"},children:n})},he=e=>{let{color:t,icon:r,label:o,tooltip:n,minWidth:i=80}=e;return(0,G.jsx)(c.A,{title:n||"",placement:"top",children:(0,G.jsxs)(d.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:"#ffffff",border:"1px solid ".concat(se(t)),color:t,fontSize:11,fontWeight:800,minWidth:i,justifyContent:"center",whiteSpace:"nowrap"},children:[r,o]})})},ue=e=>{let{value:t,color:r="#ef4444",icon:o}=e;const n=Number(t)||0;return 0===n?(0,G.jsx)(x.A,{variant:"caption",sx:{color:re.textMuted,fontWeight:700},children:"0"}):(0,G.jsxs)(d.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:.875,py:.25,borderRadius:999,bgcolor:"#ffffff",border:"1px solid ".concat(se(r)),color:r,fontSize:12,fontWeight:800,minWidth:36,justifyContent:"center"},children:[o,n]})};function pe(e){return new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",minimumFractionDigits:2}).format(Number(e)||0)}function me(){const e=(0,h.A)(),t=(0,u.A)(e.breakpoints.down("md")),[r,o]=(0,n.useState)(W()().format("YYYY-MM-DD")),[M,O]=(0,n.useState)(W()().format("YYYY-MM-DD")),[B,K]=(0,n.useState)("All"),[H,E]=(0,n.useState)(!1),[U,$]=(0,n.useState)("Today"),[X,V]=(0,n.useState)([]),[Q,Z]=(0,n.useState)(null),[_,te]=(0,n.useState)(0),[oe,me]=(0,n.useState)(!1),[fe,ge]=(0,n.useState)(!1),[je,Ae]=(0,n.useState)(null),[be,ve]=(0,n.useState)(null),[we,ye]=(0,n.useState)(!1),[Se,ke]=(0,n.useState)(""),[ze,Ce]=(0,n.useState)(""),{isLoading:De,data:Me}=(0,l.I)({queryKey:["ridersummary",_,r,M],queryFn:I.KN}),We=(0,n.useMemo)((()=>{if(!Me)return[];if(!ze)return Me;const e=ze.toLowerCase().trim();return Me.filter((t=>["".concat(t.firstname||""," ").concat(t.lastname||""),String(t.userid)].filter(Boolean).some((t=>String(t).toLowerCase().includes(e)))))}),[Me,ze]),Ie=(0,n.useMemo)((()=>Me&&0!==Me.length?Me.reduce(((e,t)=>(e.riders+=1,e.orders+=Number(t.totalorders)||0,e.delivered+=Number(t.delivered)||0,e.amount+=Math.max(Number(t.charges)||0,Number(t.deliveryamt)||0),e)),{riders:0,orders:0,delivered:0,amount:0}):{riders:0,orders:0,delivered:0,amount:0}),[Me]),Re=async e=>{me(!0);try{const t=await i.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getreportsummary/?&fromdate=").concat(r,"&todate=").concat(M,"&userid=").concat(e));V(t.data.details)}catch(t){console.log("tenantRes",t)}finally{me(!1)}},Ne=async e=>{ye(!0);try{var t;const o="undefined"!==typeof window&&localStorage.getItem("userid")||0,n=0===_?"appuserid=".concat(o):"applocationid=".concat(_),l="".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getdeliveries/")+"?".concat(n)+"&status=all"+"&fromdate=".concat(r)+"&todate=".concat(M)+"&pageno=1&pagesize=200&keyword=&tenantid=&locationid="+"&userid=".concat(e),s=await i.A.get(l),a=(null===s||void 0===s||null===(t=s.data)||void 0===t?void 0:t.details)||[],c=e=>{const t=Number(e);return Number.isFinite(t)?t:null},d=a.map((e=>{var t,r,o,n,i;const l=c(null!==(t=e.droplat)&&void 0!==t?t:e.deliverylat),s=c(null!==(r=e.droplon)&&void 0!==r?r:e.deliverylong),a=c(null!==(o=e.pickuplat)&&void 0!==o?o:e.pickuplatitude),d=c(null!==(n=null!==(i=e.pickuplon)&&void 0!==i?i:e.pickuplong)&&void 0!==n?n:e.picklongitude);return null==l||null==s?null:{step:Number(e.step)||0,orderid:e.orderid,deliveryid:e.deliveryid,customer:e.deliverycustomer||e.customername||"Order ".concat(e.orderid),address:e.deliveryaddress||e.deliverysuburb||"",dropLat:l,dropLng:s,pickLat:null!==a&&void 0!==a?a:null,pickLng:null!==d&&void 0!==d?d:null,expectedTime:e.expecteddeliverytime||null}})).filter(Boolean).sort(((e,t)=>e.step-t.step));Ae(d)}catch(o){(0,J.k)(null===o||void 0===o?void 0:o.message,"error",2e3),Ae([])}finally{ye(!1)}},Ye=(0,n.useMemo)((()=>Me?Me.reduce(((e,t)=>e+(Number(t.deliveryamt)||0)),0):0),[Me]),Pe=[{key:"riders",label:"Active Riders",color:ae,icon:D.bsz,value:Ie.riders},{key:"orders",label:"Total Orders",color:"#0ea5e9",icon:D.HU2,value:Ie.orders},{key:"delivered",label:"Delivered",color:"#10b981",icon:D.cAP,value:Ie.delivered},{key:"amount",label:"Total Amount",color:"#f59e0b",icon:D.S75,value:pe(Ye)}];return(0,G.jsxs)(G.Fragment,{children:[(De||oe)&&(0,G.jsx)(R.A,{}),(0,G.jsx)(T.A,{title:"Riders Summary",subtitle:"Live \xb7 ".concat(B||"All Zones"," \xb7 ").concat(U),live:!0,action:(0,G.jsx)(Y.A,{locaName:B,setAppId:te,setLocoName:K,pill:!0,accentColor:ae,icon:(0,G.jsx)(D.HPi,{size:14}),placeholder:"Select Zone",paperComponent:de,sx:{width:{xs:"100%",sm:280},zIndex:100}})}),(0,G.jsx)(p.Ay,{container:!0,spacing:{xs:2,md:2.5},sx:{mb:{xs:1.5,md:2}},children:Pe.map((e=>{var t;const r=e.icon;return(0,G.jsx)(p.Ay,{item:!0,xs:6,sm:6,md:3,children:(0,G.jsx)(L.A,{title:e.label,value:null!==(t=e.value)&&void 0!==t?t:0,icon:(0,G.jsx)(r,{size:20}),color:e.color,loading:De})},e.key)}))}),(0,G.jsx)(s.A,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1,md:1.5},borderTopLeftRadius:re.radiusCard/8,borderTopRightRadius:re.radiusCard/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:re.borderSubtle,borderBottom:0,background:"#fff"},children:(0,G.jsxs)(m.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"stretch",sm:"center"},justifyContent:"space-between",spacing:1.25,children:[(0,G.jsxs)(m.A,{direction:"row",alignItems:"center",spacing:1.25,flexWrap:"wrap",children:[(0,G.jsx)(xe,{color:ae,size:32,children:(0,G.jsx)(D.bsz,{size:18})}),(0,G.jsxs)(m.A,{children:[(0,G.jsxs)(x.A,{variant:"caption",sx:{fontWeight:800,color:re.textSecondary,letterSpacing:.6,textTransform:"uppercase"},children:["Orders \xb7 ",U]}),(0,G.jsxs)(x.A,{variant:"body2",sx:{color:re.textPrimary,fontWeight:700},children:[We.length," riders \xb7 ",Ie.orders," orders"]})]}),(0,G.jsx)(c.A,{title:"Date Filter",placement:"top",children:(0,G.jsxs)(d.A,{onClick:()=>E(!0),sx:{display:"inline-flex",alignItems:"center",gap:.75,px:1.25,py:.75,borderRadius:999,cursor:"pointer",bgcolor:ne("#f59e0b"),border:"1.5px solid ".concat(se("#f59e0b")),color:"#f59e0b",fontWeight:800,fontSize:12,ml:1,transition:"all 0.18s","&:hover":{borderColor:"#f59e0b",boxShadow:"0 0 0 3px ".concat(le("#f59e0b"))}},children:[(0,G.jsx)(D.Ki0,{size:14}),W()(r).format("DD/MM/YY")," \u2013 ",W()(M).format("DD/MM/YY")]})})]}),(0,G.jsx)(d.A,{sx:{width:{xs:"100%",sm:280,lg:340},flex:{xs:"1 1 100%",sm:"0 0 auto"}},children:(0,G.jsx)(P.A,{value:Se,onChange:ke,onDebouncedChange:Ce,placeholder:"Search riders (ctrl+k)",sx:{m:0,width:"100%",borderRadius:999,bgcolor:"#ffffff","& fieldset":{borderColor:"#e2e8f0",borderWidth:1},"&:hover fieldset":{borderColor:"#cbd5e1"},"&.Mui-focused fieldset":{borderColor:"#662582",borderWidth:1.5},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(le(ae))}}})})]})}),(0,G.jsxs)(s.A,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:re.radiusCard/8,borderBottomRightRadius:re.radiusCard/8,border:"1px solid",borderColor:re.borderSubtle,overflow:"hidden",background:"#fff"},children:[t?(0,G.jsxs)(ee.nV,{scroll:!0,children:[De&&(0,G.jsx)(m.A,{alignItems:"center",sx:{py:4},children:(0,G.jsx)(x.A,{variant:"caption",sx:{color:re.textMuted,fontWeight:700},children:"Loading riders\u2026"})}),We&&0!==We.length||De?We.map(((e,t)=>{const r=Q===e.userid,o=Math.max(Number(e.charges)||0,Number(e.deliveryamt)||0),n="".concat((null===e||void 0===e?void 0:e.firstname)||""," ").concat((null===e||void 0===e?void 0:e.lastname)||"").trim()||"\u2014";return(0,G.jsxs)(ee.pg,{accent:ae,selected:r,header:(0,G.jsxs)(m.A,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,children:[(0,G.jsxs)(m.A,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0},children:[(0,G.jsx)(xe,{color:ae,size:36,children:(0,G.jsx)(D.LTk,{size:18})}),(0,G.jsxs)(m.A,{sx:{minWidth:0},children:[(0,G.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:re.textPrimary},noWrap:!0,children:n}),(0,G.jsxs)(x.A,{variant:"caption",sx:{color:re.textSecondary},children:["#",String(t+1).padStart(2,"0")," \xb7 ID #",e.userid]})]})]}),(0,G.jsxs)(m.A,{direction:"row",spacing:.75,sx:{flexShrink:0},children:[(0,G.jsx)(c.A,{title:"View planned route",placement:"top",children:(0,G.jsx)(f.A,{size:"small",onClick:()=>{ve({userid:null===e||void 0===e?void 0:e.userid,name:"".concat((null===e||void 0===e?void 0:e.firstname)||""," ").concat((null===e||void 0===e?void 0:e.lastname)||"").trim()||"Rider ".concat(null===e||void 0===e?void 0:e.userid)}),Ae(null),ge(!0),Ne(null===e||void 0===e?void 0:e.userid)},sx:{bgcolor:ie("#0ea5e9"),color:"#0ea5e9",border:"1px solid ".concat(se("#0ea5e9")),"&:hover":{bgcolor:"#0ea5e9",color:"#fff"}},children:(0,G.jsx)(D.Cd7,{size:14})})}),(0,G.jsx)(c.A,{title:r?"Collapse breakdown":"Expand breakdown",placement:"top",children:(0,G.jsx)(f.A,{size:"small",onClick:()=>{const t=!r;Z(t?e.userid:null),t&&Re(e.userid)},sx:{bgcolor:r?ae:ie(ae),color:r?"#fff":ae,border:"1px solid ".concat(se(ae)),"&:hover":{bgcolor:ae,color:"#fff"}},children:r?(0,G.jsx)(D.Xbk,{size:16}):(0,G.jsx)(D.j1Q,{size:16})})})]})]}),children:[(0,G.jsxs)(ee.FG,{columns:2,children:[(0,G.jsx)(ee.pY,{label:"Orders",children:(0,G.jsx)(ue,{value:e.totalorders,color:ae,icon:(0,G.jsx)(D.F6S,{size:11})})}),(0,G.jsx)(ee.pY,{label:"Delivered",children:(0,G.jsx)(ue,{value:e.delivered,color:"#10b981",icon:(0,G.jsx)(D.mU9,{size:11})})}),(0,G.jsx)(ee.pY,{label:"Pending",children:(0,G.jsx)(ue,{value:e.pending,color:"#f59e0b",icon:(0,G.jsx)(D.tX0,{size:11})})}),(0,G.jsx)(ee.pY,{label:"Cancelled",children:(0,G.jsx)(ue,{value:e.cancelled,color:"#ef4444",icon:(0,G.jsx)(D.uDv,{size:11})})}),(0,G.jsx)(ee.pY,{label:"KMS",children:(0,G.jsx)(he,{color:"#ef4444",icon:(0,G.jsx)(D.xI$,{size:11}),label:"".concat(Number(e.kms||0).toFixed(2)," km"),tooltip:"KMS"})}),(0,G.jsx)(ee.pY,{label:"Actual KMS",children:(0,G.jsx)(he,{color:"#10b981",icon:(0,G.jsx)(D.xI$,{size:11}),label:"".concat(Number(e.cumulativekms||0).toFixed(2)," km"),tooltip:"Actual KMS"})}),(0,G.jsx)(ee.pY,{label:"Amount",full:!0,children:(0,G.jsx)(he,{color:ae,icon:(0,G.jsx)(D.YHz,{size:11}),label:pe(o).replace("\u20b9","").trim(),tooltip:"Total Amount",minWidth:100})})]}),r&&(0,G.jsx)(g.A,{in:r,timeout:"auto",unmountOnExit:!0,children:(0,G.jsxs)(s.A,{elevation:0,sx:{mt:1.25,borderRadius:re.radiusCard/8,border:"1px solid",borderColor:re.borderSubtle,overflow:"hidden",boxShadow:re.shadowSoft},children:[(0,G.jsxs)(m.A,{direction:"row",alignItems:"center",spacing:1,sx:{px:1.5,py:1,background:"#ffffff",borderBottom:"1px solid ".concat(re.borderSubtle)},children:[(0,G.jsx)(xe,{color:ae,size:24,selected:!0,children:(0,G.jsx)(D.Itr,{size:12})}),(0,G.jsx)(x.A,{variant:"caption",sx:{fontWeight:800,color:re.textPrimary,letterSpacing:.6,textTransform:"uppercase"},children:"Tenant Breakdown"})]}),(0,G.jsxs)(m.A,{divider:(0,G.jsx)(j.A,{}),children:[oe&&(0,G.jsx)(x.A,{variant:"caption",sx:{color:re.textMuted,textAlign:"center",py:2},children:"Loading\u2026"}),oe||X&&0!==X.length?null===X||void 0===X?void 0:X.map(((e,t)=>(0,G.jsxs)(d.A,{sx:{p:1.5},children:[(0,G.jsxs)(m.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mb:1},children:[(0,G.jsx)(xe,{color:"#0ea5e9",size:24,children:(0,G.jsx)(D.Itr,{size:12})}),(0,G.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:re.textPrimary},noWrap:!0,children:e.tenantname||"\u2014"})]}),(0,G.jsxs)(ee.FG,{columns:2,children:[(0,G.jsx)(ee.pY,{label:"All",children:(0,G.jsx)(ue,{value:e.totalorders,color:ae,icon:(0,G.jsx)(D.F6S,{size:10})})}),(0,G.jsx)(ee.pY,{label:"Completed",children:(0,G.jsx)(ue,{value:e.deliveriescompleted,color:"#10b981",icon:(0,G.jsx)(D.mU9,{size:10})})}),(0,G.jsx)(ee.pY,{label:"Pending",children:(0,G.jsx)(ue,{value:e.deliveriespending,color:"#f59e0b",icon:(0,G.jsx)(D.tX0,{size:10})})}),(0,G.jsx)(ee.pY,{label:"Cancelled",children:(0,G.jsx)(ue,{value:e.deliveriescancelled,color:"#ef4444",icon:(0,G.jsx)(D.uDv,{size:10})})}),(0,G.jsx)(ee.pY,{label:"KMS",children:(0,G.jsx)(he,{color:"#ef4444",icon:(0,G.jsx)(D.xI$,{size:10}),label:"".concat(Number(e.kms||0).toFixed(2)," km"),tooltip:"KMS"})}),(0,G.jsx)(ee.pY,{label:"Actual KMS",children:(0,G.jsx)(he,{color:"#10b981",icon:(0,G.jsx)(D.xI$,{size:10}),label:"".concat(Number(e.cumulativekms||0).toFixed(2)," km"),tooltip:"Actual KMS"})}),(0,G.jsx)(ee.pY,{label:"Amount",full:!0,children:(0,G.jsx)(he,{color:ae,icon:(0,G.jsx)(D.YHz,{size:10}),label:pe(Math.max(Number(e.charges)||0,Number(e.deliveryamt)||0)).replace("\u20b9","").trim(),tooltip:"Total Amount",minWidth:100})})]})]},"".concat(e.tenantname,"-").concat(t)))):(0,G.jsx)(x.A,{variant:"caption",sx:{color:re.textMuted,textAlign:"center",py:2},children:"No tenant breakdown available."})]})]})})]},e.userid||t)})):(0,G.jsxs)(m.A,{alignItems:"center",spacing:1.5,sx:{py:6},children:[(0,G.jsx)(a.A,{sx:{width:64,height:64,bgcolor:ie("#94a3b8"),color:re.textMuted},children:(0,G.jsx)(D.bsz,{size:28})}),(0,G.jsx)(x.A,{variant:"subtitle1",sx:{fontWeight:700,color:re.textPrimary},children:"No riders to show"}),(0,G.jsx)(x.A,{variant:"caption",sx:{color:re.textSecondary},children:Se?"Try a different keyword.":"Pick a zone or date range to load the summary."})]})]}):(0,G.jsx)(A.A,{sx:{maxHeight:{xs:"calc(100vh - 220px)",md:"calc(100vh - 190px)"},"&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-thumb":{backgroundColor:se(ae),borderRadius:8,"&:hover":{backgroundColor:ae}},"&::-webkit-scrollbar-track":{backgroundColor:re.surfaceAlt}},children:(0,G.jsxs)(b.A,{stickyHeader:!0,sx:{minWidth:{xs:880,md:1080}},children:[(0,G.jsx)(v.A,{children:(0,G.jsxs)(w.A,{sx:{"& th":{backgroundColor:re.surfaceAlt,color:re.textSecondary,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(re.borderSubtle),py:{xs:1,md:1.25},px:{xs:1,md:2}}},children:[(0,G.jsx)(y.A,{children:"#"}),(0,G.jsx)(y.A,{children:"Rider"}),(0,G.jsx)(y.A,{align:"center",children:"Orders"}),(0,G.jsx)(y.A,{align:"center",children:"Pending"}),(0,G.jsx)(y.A,{align:"center",children:"Cancelled"}),(0,G.jsx)(y.A,{align:"center",children:"Delivered"}),(0,G.jsx)(y.A,{align:"center",children:"KMS"}),(0,G.jsx)(y.A,{align:"center",children:"Amount"}),(0,G.jsx)(y.A,{align:"right",children:"Action"})]})}),(0,G.jsxs)(S.A,{children:[De&&(0,G.jsx)(F.r,{col:5}),We&&0!==We.length||De?We.map(((e,t)=>{const r=Q===e.userid,o=Math.max(Number(e.charges)||0,Number(e.deliveryamt)||0);return(0,G.jsxs)(n.Fragment,{children:[(0,G.jsxs)(w.A,{sx:{transition:"background-color 0.15s","& td":{borderBottom:r?"none":"1px solid ".concat(re.divider),py:{xs:1,md:1.5},px:{xs:1,md:2}},"&:hover":{backgroundColor:r?"#fff":re.surfaceAlt},bgcolor:r?ne(ae):"transparent"},children:[(0,G.jsx)(y.A,{children:(0,G.jsx)(x.A,{variant:"caption",sx:{fontWeight:700,color:re.textMuted},children:String(t+1).padStart(2,"0")})}),(0,G.jsx)(y.A,{children:(0,G.jsxs)(m.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,G.jsx)(xe,{color:ae,size:36,children:(0,G.jsx)(D.LTk,{size:18})}),(0,G.jsxs)(m.A,{children:[(0,G.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:re.textPrimary,whiteSpace:"nowrap"},children:"".concat((null===e||void 0===e?void 0:e.firstname)||""," ").concat((null===e||void 0===e?void 0:e.lastname)||"").trim()||"\u2014"}),(0,G.jsxs)(x.A,{variant:"caption",sx:{color:re.textSecondary},children:["ID #",e.userid]})]})]})}),(0,G.jsx)(y.A,{align:"center",children:(0,G.jsx)(ue,{value:e.totalorders,color:ae,icon:(0,G.jsx)(D.F6S,{size:11})})}),(0,G.jsx)(y.A,{align:"center",children:(0,G.jsx)(ue,{value:e.pending,color:"#f59e0b",icon:(0,G.jsx)(D.tX0,{size:11})})}),(0,G.jsx)(y.A,{align:"center",children:(0,G.jsx)(ue,{value:e.cancelled,color:"#ef4444",icon:(0,G.jsx)(D.uDv,{size:11})})}),(0,G.jsx)(y.A,{align:"center",children:(0,G.jsx)(ue,{value:e.delivered,color:"#10b981",icon:(0,G.jsx)(D.mU9,{size:11})})}),(0,G.jsx)(y.A,{align:"center",children:(0,G.jsxs)(m.A,{direction:"column",spacing:.5,alignItems:"center",children:[(0,G.jsx)(he,{color:"#ef4444",icon:(0,G.jsx)(D.xI$,{size:11}),label:"".concat(Number(e.kms||0).toFixed(2)," km"),tooltip:"KMS"}),(0,G.jsx)(he,{color:"#10b981",icon:(0,G.jsx)(D.xI$,{size:11}),label:"".concat(Number(e.cumulativekms||0).toFixed(2)," km"),tooltip:"Actual KMS"})]})}),(0,G.jsx)(y.A,{align:"center",children:(0,G.jsx)(he,{color:ae,icon:(0,G.jsx)(D.YHz,{size:11}),label:pe(o).replace("\u20b9","").trim(),tooltip:"Total Amount",minWidth:100})}),(0,G.jsx)(y.A,{align:"right",children:(0,G.jsxs)(m.A,{direction:"row",spacing:.75,justifyContent:"flex-end",children:[(0,G.jsx)(c.A,{title:"View planned route",placement:"top",children:(0,G.jsx)(f.A,{size:"small",onClick:()=>{ve({userid:null===e||void 0===e?void 0:e.userid,name:"".concat((null===e||void 0===e?void 0:e.firstname)||""," ").concat((null===e||void 0===e?void 0:e.lastname)||"").trim()||"Rider ".concat(null===e||void 0===e?void 0:e.userid)}),Ae(null),ge(!0),Ne(null===e||void 0===e?void 0:e.userid)},sx:{bgcolor:ie("#0ea5e9"),color:"#0ea5e9",border:"1px solid ".concat(se("#0ea5e9")),"&:hover":{bgcolor:"#0ea5e9",color:"#fff"}},children:(0,G.jsx)(D.Cd7,{size:14})})}),(0,G.jsx)(c.A,{title:r?"Collapse breakdown":"Expand breakdown",placement:"top",children:(0,G.jsx)(f.A,{size:"small",onClick:()=>{const t=!r;Z(t?e.userid:null),t&&Re(e.userid)},sx:{bgcolor:r?ae:ie(ae),color:r?"#fff":ae,border:"1px solid ".concat(se(ae)),"&:hover":{bgcolor:ae,color:"#fff"}},children:r?(0,G.jsx)(D.Xbk,{size:16}):(0,G.jsx)(D.j1Q,{size:16})})})]})})]}),r&&(0,G.jsx)(w.A,{children:(0,G.jsx)(y.A,{colSpan:9,sx:{p:0,borderBottom:"1px solid ".concat(re.divider),bgcolor:ne(ae)},children:(0,G.jsx)(g.A,{in:r,timeout:"auto",unmountOnExit:!0,children:(0,G.jsx)(d.A,{sx:{p:{xs:1,md:2}},children:(0,G.jsxs)(s.A,{elevation:0,sx:{borderRadius:re.radiusCard/8,border:"1px solid",borderColor:re.borderSubtle,overflow:"hidden",boxShadow:re.shadowSoft},children:[(0,G.jsxs)(m.A,{direction:"row",alignItems:"center",spacing:1,sx:{px:2,py:1.25,background:"#ffffff",borderBottom:"1px solid ".concat(re.borderSubtle)},children:[(0,G.jsx)(xe,{color:ae,size:28,selected:!0,children:(0,G.jsx)(D.Itr,{size:14})}),(0,G.jsxs)(x.A,{variant:"caption",sx:{fontWeight:800,color:re.textPrimary,letterSpacing:.6,textTransform:"uppercase"},children:["Tenant Breakdown \xb7 ","".concat((null===e||void 0===e?void 0:e.firstname)||""," ").concat((null===e||void 0===e?void 0:e.lastname)||"").trim()]})]}),(0,G.jsxs)(b.A,{size:"small",children:[(0,G.jsx)(v.A,{children:(0,G.jsxs)(w.A,{sx:{"& th":{backgroundColor:re.surfaceAlt,color:re.textSecondary,fontSize:10,fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(re.borderSubtle),py:1,px:1.5}},children:[(0,G.jsx)(y.A,{children:"#"}),(0,G.jsx)(y.A,{children:"Client"}),(0,G.jsx)(y.A,{align:"center",children:"All"}),(0,G.jsx)(y.A,{align:"center",children:"Pending"}),(0,G.jsx)(y.A,{align:"center",children:"Completed"}),(0,G.jsx)(y.A,{align:"center",children:"Cancelled"}),(0,G.jsx)(y.A,{align:"center",children:"KMS"}),(0,G.jsx)(y.A,{align:"center",children:"Amount"})]})}),(0,G.jsxs)(S.A,{children:[oe&&(0,G.jsx)(F.r,{col:4}),oe||X&&0!==X.length?null===X||void 0===X?void 0:X.map(((e,t)=>(0,G.jsxs)(w.A,{sx:{"& td":{borderBottom:"1px solid ".concat(re.divider),py:1,px:1.5},"&:hover":{backgroundColor:re.surfaceAlt}},children:[(0,G.jsx)(y.A,{children:(0,G.jsx)(x.A,{variant:"caption",sx:{fontWeight:700,color:re.textMuted},children:String(t+1).padStart(2,"0")})}),(0,G.jsx)(y.A,{children:(0,G.jsxs)(m.A,{direction:"row",alignItems:"center",spacing:.75,children:[(0,G.jsx)(xe,{color:"#0ea5e9",size:24,children:(0,G.jsx)(D.Itr,{size:12})}),(0,G.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:re.textPrimary,whiteSpace:"nowrap"},children:e.tenantname||"\u2014"})]})}),(0,G.jsx)(y.A,{align:"center",children:(0,G.jsx)(ue,{value:e.totalorders,color:ae,icon:(0,G.jsx)(D.F6S,{size:10})})}),(0,G.jsx)(y.A,{align:"center",children:(0,G.jsx)(ue,{value:e.deliveriespending,color:"#f59e0b",icon:(0,G.jsx)(D.tX0,{size:10})})}),(0,G.jsx)(y.A,{align:"center",children:(0,G.jsx)(ue,{value:e.deliveriescompleted,color:"#10b981",icon:(0,G.jsx)(D.mU9,{size:10})})}),(0,G.jsx)(y.A,{align:"center",children:(0,G.jsx)(ue,{value:e.deliveriescancelled,color:"#ef4444",icon:(0,G.jsx)(D.uDv,{size:10})})}),(0,G.jsx)(y.A,{align:"center",children:(0,G.jsxs)(m.A,{direction:"column",spacing:.5,alignItems:"center",children:[(0,G.jsx)(he,{color:"#ef4444",icon:(0,G.jsx)(D.xI$,{size:10}),label:"".concat(Number(e.kms||0).toFixed(2)," km"),tooltip:"KMS"}),(0,G.jsx)(he,{color:"#10b981",icon:(0,G.jsx)(D.xI$,{size:10}),label:"".concat(Number(e.cumulativekms||0).toFixed(2)," km"),tooltip:"Actual KMS"})]})}),(0,G.jsx)(y.A,{align:"center",children:(0,G.jsx)(he,{color:ae,icon:(0,G.jsx)(D.YHz,{size:10}),label:pe(Math.max(Number(e.charges)||0,Number(e.deliveryamt)||0)).replace("\u20b9","").trim(),tooltip:"Total Amount",minWidth:100})})]},"".concat(e.tenantname,"-").concat(t)))):(0,G.jsx)(w.A,{children:(0,G.jsx)(y.A,{colSpan:8,sx:{py:3},children:(0,G.jsx)(x.A,{variant:"caption",sx:{color:re.textMuted,textAlign:"center",display:"block"},children:"No tenant breakdown available."})})})]})]})]})})})})})]},e.userid||t)})):(0,G.jsx)(w.A,{children:(0,G.jsx)(y.A,{colSpan:9,sx:{py:6},children:(0,G.jsxs)(m.A,{alignItems:"center",spacing:1.5,children:[(0,G.jsx)(a.A,{sx:{width:64,height:64,bgcolor:ie("#94a3b8"),color:re.textMuted},children:(0,G.jsx)(D.bsz,{size:28})}),(0,G.jsx)(x.A,{variant:"subtitle1",sx:{fontWeight:700,color:re.textPrimary},children:"No riders to show"}),(0,G.jsx)(x.A,{variant:"caption",sx:{color:re.textSecondary},children:Se?"Try a different keyword.":"Pick a zone or date range to load the summary."})]})})})]})]})}),We.length>0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(j.A,{}),(0,G.jsxs)(m.A,{direction:"row",alignItems:"center",justifyContent:"flex-end",spacing:1.5,sx:{px:2,py:1.5,background:"#ffffff"},children:[(0,G.jsx)(x.A,{variant:"caption",sx:{fontWeight:800,color:re.textSecondary,letterSpacing:.6,textTransform:"uppercase"},children:"Grand Total"}),(0,G.jsx)(k.A,{label:pe(Ye),sx:{fontWeight:800,fontSize:13,color:"#fff",background:"linear-gradient(135deg, ".concat(ae," 0%, ").concat(ce," 100%)"),boxShadow:"0 6px 16px ".concat(le(ae))}})]})]})]}),(0,G.jsx)(z.A,{maxWidth:"xl",fullScreen:!0,open:fe,onClose:()=>{ge(!1),Ae(null),ve(null)},children:(0,G.jsx)(C.A,{sx:{p:0,height:"100vh"},children:(0,G.jsx)(q,{details:je,loading:we,riderName:null===be||void 0===be?void 0:be.name,dateRange:"".concat(W()(r).format("DD/MM/YY")," \u2013 ").concat(W()(M).format("DD/MM/YY")),onClose:()=>{ge(!1),Ae(null),ve(null)}})})}),(0,G.jsx)(N.A,{open:H,onClose:()=>E(!1),onSelect:e=>{o(e.startDate),O(e.endDate),$(e.label)}})]})}},12010:(e,t,r)=>{r.d(t,{A:()=>R});var o=r(57528),n=r(84849),i=r(27326),l=r(85672),s=r(72574),a=r(25234),c=r(8913),d=r(16775),x=r(38009),h=r(60308),u=r(37300),p=r(10644);function m(e){return(0,p.Ay)("MuiCircularProgress",e)}(0,u.A)("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);var f,g,j,A,b=r(65908);const v=["className","color","disableShrink","size","style","thickness","value","variant"];let w,y,S,k;const z=44,C=(0,c.i7)(w||(w=f||(f=(0,o.A)(["\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n"])))),D=(0,c.i7)(y||(y=g||(g=(0,o.A)(["\n 0% {\n stroke-dasharray: 1px, 200px;\n stroke-dashoffset: 0;\n }\n\n 50% {\n stroke-dasharray: 100px, 200px;\n stroke-dashoffset: -15px;\n }\n\n 100% {\n stroke-dasharray: 100px, 200px;\n stroke-dashoffset: -125px;\n }\n"])))),M=(0,h.Ay)("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],t["color".concat((0,d.A)(r.color))]]}})((e=>{let{ownerState:t,theme:r}=e;return(0,i.A)({display:"inline-block"},"determinate"===t.variant&&{transition:r.transitions.create("transform")},"inherit"!==t.color&&{color:(r.vars||r).palette[t.color].main})}),(e=>{let{ownerState:t}=e;return"indeterminate"===t.variant&&(0,c.AH)(S||(S=j||(j=(0,o.A)(["\n animation: "," 1.4s linear infinite;\n "]))),C)})),W=(0,h.Ay)("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),I=(0,h.Ay)("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.circle,t["circle".concat((0,d.A)(r.variant))],r.disableShrink&&t.circleDisableShrink]}})((e=>{let{ownerState:t,theme:r}=e;return(0,i.A)({stroke:"currentColor"},"determinate"===t.variant&&{transition:r.transitions.create("stroke-dashoffset")},"indeterminate"===t.variant&&{strokeDasharray:"80px, 200px",strokeDashoffset:0})}),(e=>{let{ownerState:t}=e;return"indeterminate"===t.variant&&!t.disableShrink&&(0,c.AH)(k||(k=A||(A=(0,o.A)(["\n animation: "," 1.4s ease-in-out infinite;\n "]))),D)})),R=l.forwardRef((function(e,t){const r=(0,x.b)({props:e,name:"MuiCircularProgress"}),{className:o,color:l="primary",disableShrink:c=!1,size:h=40,style:u,thickness:p=3.6,value:f=0,variant:g="indeterminate"}=r,j=(0,n.A)(r,v),A=(0,i.A)({},r,{color:l,disableShrink:c,size:h,thickness:p,value:f,variant:g}),w=(e=>{const{classes:t,variant:r,color:o,disableShrink:n}=e,i={root:["root",r,"color".concat((0,d.A)(o))],svg:["svg"],circle:["circle","circle".concat((0,d.A)(r)),n&&"circleDisableShrink"]};return(0,a.A)(i,m,t)})(A),y={},S={},k={};if("determinate"===g){const e=2*Math.PI*((z-p)/2);y.strokeDasharray=e.toFixed(3),k["aria-valuenow"]=Math.round(f),y.strokeDashoffset="".concat(((100-f)/100*e).toFixed(3),"px"),S.transform="rotate(-90deg)"}return(0,b.jsx)(M,(0,i.A)({className:(0,s.A)(w.root,o),style:(0,i.A)({width:h,height:h},S,u),ownerState:A,ref:t,role:"progressbar"},k,j,{children:(0,b.jsx)(W,{className:w.svg,ownerState:A,viewBox:"".concat(22," ").concat(22," ").concat(z," ").concat(z),children:(0,b.jsx)(I,{className:w.circle,style:y,ownerState:A,cx:z,cy:z,r:(z-p)/2,fill:"none",strokeWidth:p})})}))}))},19283:(e,t,r)=>{r.d(t,{z:()=>s});var o=r(91323),n=r(81501),i=r(73413),l=r(85672);const s=(0,o.wk)((function(e,t){const r=new i.Popup(e,t.overlayContainer);return(0,n.Q)(r,t)}),(function(e,t,r,o){let{position:n}=r;(0,l.useEffect)((function(){const{instance:r}=e;function i(e){e.popup===r&&(r.update(),o(!0))}function l(e){e.popup===r&&o(!1)}return t.map.on({popupopen:i,popupclose:l}),null==t.overlayContainer?(null!=n&&r.setLatLng(n),r.openOn(t.map)):t.overlayContainer.bindPopup(r),function(){var e;t.map.off({popupopen:i,popupclose:l}),null===(e=t.overlayContainer)||void 0===e||e.unbindPopup(),t.map.removeLayer(r)}}),[e,t,o,n])}))},23787:(e,t,r)=>{r.d(t,{FG:()=>u,nV:()=>x,pY:()=>p,pg:()=>h});var o=r(22555),n=r(53986),i=r(71392),l=r(55235),s=r(48738),a=r(2866),c=r(65908);const d=["children","scroll","onScroll","sx"],x=e=>{let{children:t,scroll:r=!1,onScroll:l,sx:s}=e,a=(0,n.A)(e,d);return(0,c.jsx)(i.A,(0,o.A)((0,o.A)({spacing:1.25,onScroll:l,sx:(0,o.A)((0,o.A)({p:1.5},r&&{maxHeight:"calc(100vh - 220px)",overflowY:"auto",overflowX:"hidden"}),s)},a),{},{children:t}))},h=e=>{let{accent:t="#662582",header:r,footer:n,selected:i=!1,onClick:a,children:d,sx:x}=e;return(0,c.jsxs)(l.A,{elevation:0,onClick:a,sx:(0,o.A)({position:"relative",overflow:"hidden",flexShrink:0,borderRadius:2.5,border:"1px solid",borderColor:i?t:"#e2e8f0",background:i?"".concat(t,"0a"):"#fff",boxShadow:"0 4px 14px rgba(15,23,42,0.05)",transition:"border-color 0.15s, box-shadow 0.15s"},x),children:[(0,c.jsx)(s.A,{sx:{position:"absolute",left:0,top:0,bottom:0,width:3,bgcolor:t}}),(0,c.jsxs)(s.A,{sx:{p:1.5,pl:2},children:[r,d,n]})]})},u=e=>{let{children:t,columns:r=2,sx:n}=e;return(0,c.jsx)(s.A,{sx:(0,o.A)({display:"grid",gridTemplateColumns:"repeat(".concat(r,", minmax(0, 1fr))"),gap:1,mt:1.25},n),children:t})},p=e=>{let{label:t,value:r,children:o,full:n=!1,align:i="left"}=e;return(0,c.jsxs)(s.A,{sx:{gridColumn:n?"1 / -1":"auto",minWidth:0,textAlign:i},children:[(0,c.jsx)(a.A,{sx:{fontSize:9.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#94a3b8",lineHeight:1.4},children:t}),(0,c.jsx)(s.A,{sx:{mt:.25,minWidth:0},children:void 0!==o?o:(0,c.jsx)(a.A,{sx:{fontSize:13,fontWeight:600,color:"#0f172a"},noWrap:!0,children:null!==r&&void 0!==r?r:"\u2014"})})]})}},27001:(e,t,r)=>{r.d(t,{A:()=>s});var o=r(71392),n=r(48738),i=r(2866),l=r(65908);function s(e){let{title:t,subtitle:r,live:s=!1,action:a}=e;return(0,l.jsxs)(o.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)(n.A,{sx:{minWidth:0},children:[(0,l.jsx)(i.A,{variant:"h3",sx:{fontWeight:700,letterSpacing:"-0.02em",color:"grey.800"},children:t}),r&&(0,l.jsxs)(o.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[s&&(0,l.jsx)(n.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)(i.A,{variant:"caption",sx:{color:"text.secondary",fontWeight:500},children:r})]})]}),a&&(0,l.jsx)(n.A,{sx:{flexShrink:0,width:{xs:"100%",sm:"auto"}},children:a})]})}},35678:(e,t,r)=>{r.d(t,{A:()=>v});var o=r(85672),n=r(58689),i=r(19619),l=r(2866),s=r(5670),a=r(71392),c=r(80911),d=r(36117),x=r(46077),h=r.n(x),u=r(36738),p=r(80959),m=r(33090),f=r(52994),g=r(33323),j=r(75732),A=r(43962),b=r(65908);const v=e=>{let{open:t,onClose:r,onSelect:x}=e;const[v,w]=(0,o.useState)(null);return(0,b.jsxs)(n.A,{open:t,onClose:r,children:[(0,b.jsx)(i.A,{align:"left",children:(0,b.jsx)(l.A,{variant:"h4",children:"Select Filter Options"})}),(0,b.jsx)(s.A,{sx:{width:"100%"},className:"datedialog",children:(0,b.jsx)(d.U,{open:t,toggle:r,id:"daterange1",onChange:e=>{w({startDate:h()(e.startDate).format("YYYY-MM-DD"),endDate:h()(e.endDate).format("YYYY-MM-DD"),label:e.label||"custom"})},definedRanges:[{label:"Today",startDate:new Date,endDate:new Date},{label:"Yesterday",startDate:(0,u.A)(new Date,-1),endDate:(0,u.A)(new Date,-1)},{label:"Tomorrow",startDate:(0,u.A)(new Date,1),endDate:(0,u.A)(new Date,1)},{label:"This Week",startDate:(0,p.A)(new Date),endDate:(0,m.A)(new Date)},{label:"Last Week",startDate:(0,p.A)((0,f.A)(new Date,-1)),endDate:(0,m.A)((0,f.A)(new Date,-1))},{label:"Last 7 Days",startDate:(0,f.A)(new Date,-1),endDate:new Date},{label:"This Month",startDate:(0,g.A)(new Date),endDate:(0,j.A)(new Date)},{label:"Last Month",startDate:(0,g.A)((0,A.A)(new Date,-1)),endDate:(0,j.A)((0,A.A)(new Date,-1))}]})}),(0,b.jsx)(a.A,{direction:"row",justifyContent:"flex-end",sx:{width:"100%",p:2},children:(0,b.jsx)(c.A,{variant:"contained",size:"small",onClick:()=>{v?(x(v),r()):r()},children:"OK"})})]})}},36803:(e,t,r)=>{r.d(t,{A:()=>x});var o=r(84007),n=r(75953),i=r(71392),l=r(48738),s=r(2866),a=r(91834),c=r(97043),d=r(65908);function x(e){let{title:t,value:r,icon:x,color:h="#662582",caption:u,loading:p=!1}=e;return(0,d.jsx)(o.A,{sx:{height:"100%"},children:(0,d.jsx)(n.A,{sx:{p:{xs:1.75,md:2},"&:last-child":{pb:{xs:1.75,md:2}}},children:(0,d.jsxs)(i.A,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:1,children:[(0,d.jsxs)(l.A,{sx:{minWidth:0,flex:1},children:[(0,d.jsx)(s.A,{variant:"body2",sx:{fontWeight:500,color:"text.secondary",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t}),p?(0,d.jsx)(a.A,{variant:"rounded",sx:{width:72,height:30,mt:.5},animation:"wave"}):(0,d.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,d.jsx)(s.A,{variant:"caption",sx:{display:"block",mt:.5,color:"text.secondary"},children:u})]}),x&&(0,d.jsx)(c.A,{variant:"rounded",sx:{width:42,height:42,borderRadius:2,bgcolor:"".concat(h,"14"),color:h,flexShrink:0},children:x})]})})})}},38965:(e,t,r)=>{r.d(t,{ko:()=>n});var o=r(12414);r(85672);function n(){return(0,o.U$)().map}},56311:(e,t,r)=>{r.d(t,{A:()=>u});var o=r(22555),n=r(85672),i=r(29776),l=r(43318),s=r(23440),a=r(11969),c=r(80795),d=r(51808),x=r(93811),h=r(65908);const u=e=>{let{value:t,onChange:r,onDebouncedChange:u,debounceTime:p=500,placeholder:m="Search (ctrl+k)",sx:f}=e;const g=(0,n.useRef)(null),[j]=(0,x.d7)(t,p);return(0,n.useEffect)((()=>{u&&u(j)}),[j,u]),(0,n.useEffect)((()=>{const e=e=>{var t;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(t=g.current)||void 0===t||t.focus());"Escape"===e.key&&document.activeElement===g.current&&g.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,h.jsx)(i.A,{sx:(0,o.A)({},f),inputRef:g,placeholder:m,autoComplete:"off",value:t,fullWidth:!0,onChange:e=>r(e.target.value),startAdornment:(0,h.jsx)(l.A,{position:"start",sx:{mr:-.5},children:(0,h.jsx)(c.A,{})}),endAdornment:(0,h.jsx)(s.A,{title:"Clear",children:(0,h.jsx)(a.A,{sx:{visibility:t?"visible":"hidden"},onClick:()=>r(""),children:(0,h.jsx)(d.A,{})})})})}},59212:(e,t,r)=>{r.d(t,{A:()=>h});var o=r(22555),n=r(85672),i=r(71392),l=r(97043),s=r(17488),a=r(86270),c=r(66157),d=r(48952),x=r(65908);const h=(0,n.forwardRef)(((e,t)=>{let{setAppId:r,setLocoName:h,setPage:u,sx:p,textfeildSx:m,textfieldSx:f,pill:g=!1,accentColor:j="#6366f1",icon:A,placeholder:b="Select Zone",paperComponent:v}=e;const[w,y]=(0,n.useState)(JSON.parse(localStorage.getItem("applocations")||"[]"));(0,n.useEffect)((()=>{0===w.length&&(async()=>{try{const e=localStorage.getItem("userid");if(!e)return;const t=await c.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(e));if(t.data.status){const e=[...t.data.details,{locationname:"All",applocationid:0}];localStorage.setItem("applocations",JSON.stringify(e)),y(e)}}catch(e){console.error("Error fetching locations in LocationAutocomplete:",e)}})()}),[w.length]);const S=e=>"".concat(j).concat(e),k=S("26"),z=S("18"),C=g?{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(k)},"&.Mui-focused fieldset":{borderColor:j,borderWidth:1.5}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:"#94a3b8"}}:{},D=g&&(0,x.jsx)(i.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,x.jsx)(l.A,{sx:{width:24,height:24,bgcolor:z,color:j,transition:"background-color 0.15s, color 0.15s"},children:A||(0,x.jsx)(d.HPi,{size:14})})});return(0,x.jsx)(s.A,{id:"location-autocomplete",options:w||[],getOptionLabel:e=>{var t;return null!==(t=null===e||void 0===e?void 0:e.locationname)&&void 0!==t?t:""},PaperComponent:v,sx:(0,o.A)({},p),onChange:(e,t,o)=>{"clear"===o?(null===r||void 0===r||r(0),null===h||void 0===h||h(""),null===u||void 0===u||u(0)):t&&(null===r||void 0===r||r(t.applocationid),null===h||void 0===h||h(t.locationname),null===u||void 0===u||u(0))},renderInput:e=>g?(0,x.jsx)(a.A,(0,o.A)((0,o.A)({},e),{},{inputRef:t,placeholder:b,InputProps:(0,o.A)((0,o.A)({},e.InputProps),{},{startAdornment:D}),sx:(0,o.A)((0,o.A)({},C),f||m||{})})):(0,x.jsx)(a.A,(0,o.A)((0,o.A)({},e),{},{inputRef:t,label:"Select Zones",sx:(0,o.A)({},f||m||{})}))})}))},68320:(e,t,r)=>{r.d(t,{I:()=>i});var o=r(48149),n=r(59363);function i(e,t){return(0,n.t)(e,o.$,t)}},91001:(e,t,r)=>{r.d(t,{R:()=>c});var o=r(53986),n=r(91323),i=r(81501),l=r(12414),s=r(73413);const a=["positions"],c=(0,n.Lt)((function(e,t){let{positions:r}=e,n=(0,o.A)(e,a);const c=new s.Polyline(r,n);return(0,i.Q)(c,(0,l.W4)(t,{overlayContainer:c}))}),(function(e,t,r){t.positions!==r.positions&&e.setLatLngs(t.positions)}))},96646:(e,t,r)=>{r.d(t,{r:()=>a});var o=r(50755),n=r(1596),i=r(91834),l=r(71392),s=r(65908);const a=e=>{let{rowsPerPage:t=5,col:r=1}=e;return(0,s.jsx)(s.Fragment,{children:Array.from(new Array(t)).map(((e,t)=>(0,s.jsxs)(o.A,{children:[(0,s.jsx)(n.A,{children:(0,s.jsx)(i.A,{variant:"circular",width:24,height:24})}),(0,s.jsx)(n.A,{children:(0,s.jsx)(i.A,{variant:"text",width:30})}),Array.from({length:r}).map(((e,t)=>(0,s.jsx)(n.A,{children:(0,s.jsxs)(l.A,{spacing:.5,children:[(0,s.jsx)(i.A,{variant:"text",width:100}),(0,s.jsx)(i.A,{variant:"text",width:80})]})},t))),(0,s.jsx)(n.A,{children:(0,s.jsx)(i.A,{variant:"text",width:150})}),(0,s.jsx)(n.A,{children:(0,s.jsx)(i.A,{variant:"rounded",width:60,height:24})}),(0,s.jsx)(n.A,{align:"center",children:(0,s.jsxs)(l.A,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,s.jsx)(i.A,{variant:"circular",width:28,height:28}),(0,s.jsx)(i.A,{variant:"circular",width:28,height:28})]})})]},t)))})}}}]);