Files
Express_console_build/build/static/js/181.e4ee10d3.chunk.js

1 line
26 KiB
JavaScript

"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[181],{10181:(e,t,r)=>{r.r(t),r.d(t,{default:()=>ee});var o=r(89379),n=r(9950),i=r(26910),s=r(36150),a=r(2235),l=r(41413),c=r(83274),d=r(16491),x=r(82053),h=r(93230),u=r(60899),p=r(1320),A=r(15769),m=r(69780),g=r(9213),j=r(21671),b=r(34075),f=r(25333),v=r(33738),S=r(74745),w=r(25277),C=r(96583),y=r(28170),_=r(31222),R=r(4159),P=r.n(R),D=r(81425),k=r(52351),E=r(35678),I=r(59212),T=r(56311),z=r(96646),M=r(10523),W=r(44414);const L={width:"100%",height:"100%"};function N(e){let{details:t}=e;const r=(0,n.useRef)(null),{isLoaded:o}=(0,M.KD)({googleMapsApiKey:{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_STAFF_TOKEN:"",REACT_APP_URL:"https://jupiter.nearle.app/live/api/v1",REACT_APP_URL2:"https://jupiter.nearle.app/live/api/v2",REACT_APP_URL3:"https://jupiter.nearle.app/live/api/v3",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_GOOGLE_MAPS_KEY}),i=(0,n.useMemo)((()=>null===t||void 0===t?void 0:t.map((e=>({lat:Number(e.latitude),lng:Number(e.longitude)})))),[t]),s={path:"M12 2c-2.2 0-4 1.8-4 4v3H5l-1 2h2l3.6 7.59c.34.58.96.94 1.64.94h2.52c.68 0 1.3-.36 1.64-.94L19 11h2l-1-2h-3V6c0-2.2-1.8-4-4-4z",fillColor:"#9c27b0",fillOpacity:1,strokeWeight:0,scale:1.4,anchor:new window.google.maps.Point(12,24)};return(0,n.useEffect)((()=>{if(!r.current||0===i.length)return;const e=new window.google.maps.LatLngBounds;i.forEach((t=>e.extend(t))),r.current.fitBounds(e)}),[i]),o?(0,W.jsxs)(M.u6,{mapContainerStyle:L,onLoad:e=>r.current=e,center:i[0],zoom:16,children:[(0,W.jsx)(M.Ro,{path:i,options:{strokeColor:"#196fd2",strokeOpacity:.9,strokeWeight:5}}),(0,W.jsx)(M.pH,{position:i[0],icon:{url:"http://maps.google.com/mapfiles/ms/icons/green-dot.png"}}),(0,W.jsx)(M.pH,{position:i[i.length-1],icon:s})]}):(0,W.jsx)("div",{children:"Loading map..."})}var O=r(20466),Y=r(36220);P().extend(Y);const F={radiusPill:999,radiusCard:16,shadowSoft:"0 14px 40px rgba(15, 23, 42, 0.10)",shadowMd:"0 8px 24px rgba(15, 23, 42, 0.08)",shadowPop:"0 18px 50px rgba(15, 23, 42, 0.18)",textPrimary:"#0f172a",textSecondary:"#64748b",textMuted:"#94a3b8",borderSubtle:"#e2e8f0",divider:"#f1f5f9",surface:"#ffffff",surfaceAlt:"#f8fafc"},B=(e,t)=>"".concat(e).concat(t),K=e=>B(e,"08"),H=e=>B(e,"18"),U=e=>B(e,"26"),G=e=>B(e,"55"),V="#662582",q="#9255AB",X=e=>(0,W.jsx)(a.A,(0,o.A)((0,o.A)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:F.shadowPop,border:"1px solid",borderColor:"divider",overflow:"hidden"}})),Z=e=>{let{color:t,selected:r,size:o=24,children:n}=e;return(0,W.jsx)(l.A,{sx:{width:o,height:o,bgcolor:r?t:H(t),color:r?"#fff":t,transition:"background-color 0.15s, color 0.15s"},children:n})},$=e=>{let{color:t,icon:r,label:o,tooltip:n,minWidth:i=80}=e;return(0,W.jsx)(c.A,{title:n||"",placement:"top",children:(0,W.jsxs)(d.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:K(t),border:"1px solid ".concat(G(t)),color:t,fontSize:11,fontWeight:800,minWidth:i,justifyContent:"center",whiteSpace:"nowrap"},children:[r,o]})})},J=e=>{let{value:t,color:r="#ef4444",icon:o}=e;const n=Number(t)||0;return 0===n?(0,W.jsx)(x.A,{variant:"caption",sx:{color:F.textMuted,fontWeight:700},children:"0"}):(0,W.jsxs)(d.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:.875,py:.25,borderRadius:999,bgcolor:K(r),border:"1px solid ".concat(G(r)),color:r,fontSize:12,fontWeight:800,minWidth:36,justifyContent:"center"},children:[o,n]})};function Q(e){return new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",minimumFractionDigits:2}).format(Number(e)||0)}function ee(){const[e,t]=(0,n.useState)(P()().format("YYYY-MM-DD")),[r,o]=(0,n.useState)(P()().format("YYYY-MM-DD")),[R,M]=(0,n.useState)("All"),[L,Y]=(0,n.useState)(!1),[B,ee]=(0,n.useState)("Today"),[te,re]=(0,n.useState)([]),[oe,ne]=(0,n.useState)(null),[ie,se]=(0,n.useState)(0),[ae,le]=(0,n.useState)(!1),[ce,de]=(0,n.useState)(!1),[xe,he]=(0,n.useState)(null),[ue,pe]=(0,n.useState)(""),[Ae,me]=(0,n.useState)(""),{isLoading:ge,data:je}=(0,s.I)({queryKey:["ridersummary",ie,e,r],queryFn:D.KN}),be=(0,n.useMemo)((()=>{if(!je)return[];if(!Ae)return je;const e=Ae.toLowerCase().trim();return je.filter((t=>["".concat(t.firstname||""," ").concat(t.lastname||""),String(t.userid)].filter(Boolean).some((t=>String(t).toLowerCase().includes(e)))))}),[je,Ae]),fe=(0,n.useMemo)((()=>je&&0!==je.length?je.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}),[je]),ve=(0,n.useMemo)((()=>je?je.reduce(((e,t)=>e+(Number(t.deliveryamt)||0)),0):0),[je]),Se=[{key:"riders",label:"Active Riders",color:V,icon:_.bsz,value:fe.riders},{key:"orders",label:"Total Orders",color:"#0ea5e9",icon:_.F6S,value:fe.orders},{key:"delivered",label:"Delivered",color:"#10b981",icon:_.mU9,value:fe.delivered},{key:"amount",label:"Total Amount",color:"#f59e0b",icon:_.YHz,value:Q(ve)}];return(0,W.jsxs)(W.Fragment,{children:[(ge||ae)&&(0,W.jsx)(k.A,{}),(0,W.jsx)(a.A,{elevation:0,sx:{mb:{xs:1.5,md:2},p:{xs:1.5,sm:2,md:2.5},borderRadius:F.radiusCard/8,border:"1px solid",borderColor:F.borderSubtle,background:"linear-gradient(135deg, ".concat(K(V)," 0%, ").concat(K(q)," 100%)"),boxShadow:F.shadowMd},children:(0,W.jsxs)(h.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1.5,sm:2},children:[(0,W.jsxs)(h.A,{direction:"row",alignItems:"center",spacing:{xs:1.25,sm:1.75},children:[(0,W.jsx)(l.A,{sx:{width:{xs:40,sm:48},height:{xs:40,sm:48},bgcolor:V,color:"#fff",boxShadow:"0 6px 18px ".concat(U(V))},children:(0,W.jsx)(_.bsz,{size:22})}),(0,W.jsxs)(h.A,{children:[(0,W.jsx)(x.A,{variant:"h3",sx:{fontWeight:800,color:F.textPrimary,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:"Riders Summary"}),(0,W.jsxs)(h.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[(0,W.jsx)(d.A,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 4px rgba(16,185,129,0.18)"}}),(0,W.jsxs)(x.A,{variant:"caption",sx:{color:F.textSecondary,fontWeight:600},children:["Live \xb7 ",R||"All Zones"," \xb7 ",B]})]})]})]}),(0,W.jsx)(I.A,{locaName:R,setAppId:se,setLocoName:M,pill:!0,accentColor:V,icon:(0,W.jsx)(_.HPi,{size:14}),placeholder:"Select Zone",paperComponent:X,sx:{width:{xs:"100%",sm:280},zIndex:100}})]})}),(0,W.jsx)(u.Ay,{container:!0,spacing:{xs:1.25,sm:1.5,md:2},sx:{mt:"1px"},children:Se.map((e=>{const t=e.icon;return(0,W.jsx)(u.Ay,{item:!0,xs:6,sm:6,md:3,children:(0,W.jsxs)(a.A,{elevation:0,sx:{position:"relative",overflow:"hidden",p:{xs:1.25,sm:1.75,md:2.25},borderRadius:F.radiusCard/8,border:"1px solid",borderColor:F.borderSubtle,background:"#fff",transition:"transform 0.2s, box-shadow 0.2s, border-color 0.2s","&:hover":{transform:"translateY(-3px)",boxShadow:F.shadowMd,borderColor:G(e.color)}},children:[(0,W.jsx)(d.A,{sx:{position:"absolute",top:0,left:0,right:0,height:3,background:"linear-gradient(90deg, ".concat(e.color," 0%, ").concat(H(e.color)," 100%)")}}),(0,W.jsxs)(h.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,W.jsxs)(h.A,{spacing:.5,sx:{minWidth:0,flex:1},children:[(0,W.jsx)(x.A,{variant:"caption",sx:{color:F.textSecondary,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:{xs:10,sm:11},whiteSpace:"nowrap"},children:e.label}),(0,W.jsx)(x.A,{sx:{fontWeight:800,color:F.textPrimary,lineHeight:1.1,fontSize:{xs:"1.1rem",sm:"1.4rem",md:"1.6rem"},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.value})]}),(0,W.jsx)(l.A,{sx:{width:{xs:36,sm:42,md:48},height:{xs:36,sm:42,md:48},bgcolor:H(e.color),color:e.color,boxShadow:"inset 0 0 0 1px ".concat(G(e.color)),flexShrink:0},children:(0,W.jsx)(t,{size:20})})]})]})},e.key)}))}),(0,W.jsx)(a.A,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1,md:1.5},borderTopLeftRadius:F.radiusCard/8,borderTopRightRadius:F.radiusCard/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:F.borderSubtle,borderBottom:0,background:"#fff"},children:(0,W.jsxs)(h.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"stretch",sm:"center"},justifyContent:"space-between",spacing:1.25,children:[(0,W.jsxs)(h.A,{direction:"row",alignItems:"center",spacing:1.25,flexWrap:"wrap",children:[(0,W.jsx)(Z,{color:V,size:32,children:(0,W.jsx)(_.bsz,{size:18})}),(0,W.jsxs)(h.A,{children:[(0,W.jsxs)(x.A,{variant:"caption",sx:{fontWeight:800,color:F.textSecondary,letterSpacing:.6,textTransform:"uppercase"},children:["Orders \xb7 ",B]}),(0,W.jsxs)(x.A,{variant:"body2",sx:{color:F.textPrimary,fontWeight:700},children:[be.length," riders \xb7 ",fe.orders," orders"]})]}),(0,W.jsx)(c.A,{title:"Date Filter",placement:"top",children:(0,W.jsxs)(d.A,{onClick:()=>Y(!0),sx:{display:"inline-flex",alignItems:"center",gap:.75,px:1.25,py:.75,borderRadius:999,cursor:"pointer",bgcolor:K("#f59e0b"),border:"1.5px solid ".concat(G("#f59e0b")),color:"#f59e0b",fontWeight:800,fontSize:12,ml:1,transition:"all 0.18s","&:hover":{borderColor:"#f59e0b",boxShadow:"0 0 0 3px ".concat(U("#f59e0b"))}},children:[(0,W.jsx)(_.Ki0,{size:14}),P()(e).format("DD/MM/YY")," \u2013 ",P()(r).format("DD/MM/YY")]})})]}),(0,W.jsx)(d.A,{sx:{width:{xs:"100%",sm:280,lg:340},flex:{xs:"1 1 100%",sm:"0 0 auto"}},children:(0,W.jsx)(T.A,{value:ue,onChange:pe,onDebouncedChange:me,placeholder:"Search riders (ctrl+k)",sx:{m:0,width:"100%",borderRadius:999,bgcolor:K(V),"& fieldset":{borderColor:G(V),borderWidth:1.5},"&:hover fieldset":{borderColor:V},"&.Mui-focused fieldset":{borderColor:V,borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(U(V))}}})})]})}),(0,W.jsxs)(a.A,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:F.radiusCard/8,borderBottomRightRadius:F.radiusCard/8,border:"1px solid",borderColor:F.borderSubtle,overflow:"hidden",background:"#fff"},children:[(0,W.jsx)(p.A,{sx:{maxHeight:{xs:"calc(100vh - 220px)",md:"calc(100vh - 190px)"},"&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-thumb":{backgroundColor:G(V),borderRadius:8,"&:hover":{backgroundColor:V}},"&::-webkit-scrollbar-track":{backgroundColor:F.surfaceAlt}},children:(0,W.jsxs)(A.A,{stickyHeader:!0,sx:{minWidth:{xs:880,md:1080}},children:[(0,W.jsx)(m.A,{children:(0,W.jsxs)(g.A,{sx:{"& th":{backgroundColor:F.surfaceAlt,color:F.textSecondary,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(F.borderSubtle),py:{xs:1,md:1.25},px:{xs:1,md:2}}},children:[(0,W.jsx)(j.A,{children:"#"}),(0,W.jsx)(j.A,{children:"Rider"}),(0,W.jsx)(j.A,{align:"center",children:"Orders"}),(0,W.jsx)(j.A,{align:"center",children:"Pending"}),(0,W.jsx)(j.A,{align:"center",children:"Cancelled"}),(0,W.jsx)(j.A,{align:"center",children:"Delivered"}),(0,W.jsx)(j.A,{align:"center",children:"KMS"}),(0,W.jsx)(j.A,{align:"center",children:"Amount"}),(0,W.jsx)(j.A,{align:"right",children:"Action"})]})}),(0,W.jsxs)(b.A,{children:[ge&&(0,W.jsx)(z.r,{col:5}),be&&0!==be.length||ge?be.map(((t,o)=>{const s=oe===t.userid,l=Math.max(Number(t.charges)||0,Number(t.deliveryamt)||0);return(0,W.jsxs)(n.Fragment,{children:[(0,W.jsxs)(g.A,{sx:{transition:"background-color 0.15s","& td":{borderBottom:s?"none":"1px solid ".concat(F.divider),py:{xs:1,md:1.5},px:{xs:1,md:2}},"&:hover":{backgroundColor:s?"#fff":F.surfaceAlt},bgcolor:s?K(V):"transparent"},children:[(0,W.jsx)(j.A,{children:(0,W.jsx)(x.A,{variant:"caption",sx:{fontWeight:700,color:F.textMuted},children:String(o+1).padStart(2,"0")})}),(0,W.jsx)(j.A,{children:(0,W.jsxs)(h.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,W.jsx)(Z,{color:V,size:36,children:(0,W.jsx)(_.LTk,{size:18})}),(0,W.jsxs)(h.A,{children:[(0,W.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:F.textPrimary,whiteSpace:"nowrap"},children:"".concat((null===t||void 0===t?void 0:t.firstname)||""," ").concat((null===t||void 0===t?void 0:t.lastname)||"").trim()||"\u2014"}),(0,W.jsxs)(x.A,{variant:"caption",sx:{color:F.textSecondary},children:["ID #",t.userid]})]})]})}),(0,W.jsx)(j.A,{align:"center",children:(0,W.jsx)(J,{value:t.totalorders,color:V,icon:(0,W.jsx)(_.F6S,{size:11})})}),(0,W.jsx)(j.A,{align:"center",children:(0,W.jsx)(J,{value:t.pending,color:"#f59e0b",icon:(0,W.jsx)(_.tX0,{size:11})})}),(0,W.jsx)(j.A,{align:"center",children:(0,W.jsx)(J,{value:t.cancelled,color:"#ef4444",icon:(0,W.jsx)(_.uDv,{size:11})})}),(0,W.jsx)(j.A,{align:"center",children:(0,W.jsx)(J,{value:t.delivered,color:"#10b981",icon:(0,W.jsx)(_.mU9,{size:11})})}),(0,W.jsx)(j.A,{align:"center",children:(0,W.jsxs)(h.A,{direction:"column",spacing:.5,alignItems:"center",children:[(0,W.jsx)($,{color:"#ef4444",icon:(0,W.jsx)(_.xI$,{size:11}),label:"".concat(Number(t.kms||0).toFixed(2)," km"),tooltip:"KMS"}),(0,W.jsx)($,{color:"#10b981",icon:(0,W.jsx)(_.xI$,{size:11}),label:"".concat(Number(t.cumulativekms||0).toFixed(2)," km"),tooltip:"Actual KMS"})]})}),(0,W.jsx)(j.A,{align:"center",children:(0,W.jsx)($,{color:V,icon:(0,W.jsx)(_.YHz,{size:11}),label:Q(l).replace("\u20b9","").trim(),tooltip:"Total Amount",minWidth:100})}),(0,W.jsx)(j.A,{align:"right",children:(0,W.jsxs)(h.A,{direction:"row",spacing:.75,justifyContent:"flex-end",children:[(0,W.jsx)(c.A,{title:"View route",placement:"top",children:(0,W.jsx)(f.A,{size:"small",onClick:()=>{de(!0),(async e=>{try{const t=await i.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getuserdeliverylogs/?userid=").concat(e,"&fromdate=2026-01-28&todate=2026-01-28 "));he(t.data.details)}catch(t){(0,O.k)(null===t||void 0===t?void 0:t.message,"error",2e3)}})(null===t||void 0===t?void 0:t.userid)},sx:{bgcolor:H("#0ea5e9"),color:"#0ea5e9",border:"1px solid ".concat(G("#0ea5e9")),"&:hover":{bgcolor:"#0ea5e9",color:"#fff"}},children:(0,W.jsx)(_.Cd7,{size:14})})}),(0,W.jsx)(c.A,{title:s?"Collapse breakdown":"Expand breakdown",placement:"top",children:(0,W.jsx)(f.A,{size:"small",onClick:()=>{const o=!s;ne(o?t.userid:null),o&&(async t=>{le(!0);try{const o=await i.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getreportsummary/?&fromdate=").concat(e,"&todate=").concat(r,"&userid=").concat(t));re(o.data.details)}catch(o){console.log("tenantRes",o)}finally{le(!1)}})(t.userid)},sx:{bgcolor:s?V:H(V),color:s?"#fff":V,border:"1px solid ".concat(G(V)),"&:hover":{bgcolor:V,color:"#fff"}},children:s?(0,W.jsx)(_.Xbk,{size:16}):(0,W.jsx)(_.j1Q,{size:16})})})]})})]}),s&&(0,W.jsx)(g.A,{children:(0,W.jsx)(j.A,{colSpan:9,sx:{p:0,borderBottom:"1px solid ".concat(F.divider),bgcolor:K(V)},children:(0,W.jsx)(v.A,{in:s,timeout:"auto",unmountOnExit:!0,children:(0,W.jsx)(d.A,{sx:{p:{xs:1,md:2}},children:(0,W.jsxs)(a.A,{elevation:0,sx:{borderRadius:F.radiusCard/8,border:"1px solid",borderColor:F.borderSubtle,overflow:"hidden",boxShadow:F.shadowSoft},children:[(0,W.jsxs)(h.A,{direction:"row",alignItems:"center",spacing:1,sx:{px:2,py:1.25,background:"linear-gradient(135deg, ".concat(K(V)," 0%, ").concat(K(q)," 100%)"),borderBottom:"1px solid ".concat(F.borderSubtle)},children:[(0,W.jsx)(Z,{color:V,size:28,selected:!0,children:(0,W.jsx)(_.Itr,{size:14})}),(0,W.jsxs)(x.A,{variant:"caption",sx:{fontWeight:800,color:F.textPrimary,letterSpacing:.6,textTransform:"uppercase"},children:["Tenant Breakdown \xb7 ","".concat((null===t||void 0===t?void 0:t.firstname)||""," ").concat((null===t||void 0===t?void 0:t.lastname)||"").trim()]})]}),(0,W.jsxs)(A.A,{size:"small",children:[(0,W.jsx)(m.A,{children:(0,W.jsxs)(g.A,{sx:{"& th":{backgroundColor:F.surfaceAlt,color:F.textSecondary,fontSize:10,fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(F.borderSubtle),py:1,px:1.5}},children:[(0,W.jsx)(j.A,{children:"#"}),(0,W.jsx)(j.A,{children:"Client"}),(0,W.jsx)(j.A,{align:"center",children:"All"}),(0,W.jsx)(j.A,{align:"center",children:"Pending"}),(0,W.jsx)(j.A,{align:"center",children:"Completed"}),(0,W.jsx)(j.A,{align:"center",children:"Cancelled"}),(0,W.jsx)(j.A,{align:"center",children:"KMS"}),(0,W.jsx)(j.A,{align:"center",children:"Amount"})]})}),(0,W.jsxs)(b.A,{children:[ae&&(0,W.jsx)(z.r,{col:4}),ae||te&&0!==te.length?null===te||void 0===te?void 0:te.map(((e,t)=>(0,W.jsxs)(g.A,{sx:{"& td":{borderBottom:"1px solid ".concat(F.divider),py:1,px:1.5},"&:hover":{backgroundColor:F.surfaceAlt}},children:[(0,W.jsx)(j.A,{children:(0,W.jsx)(x.A,{variant:"caption",sx:{fontWeight:700,color:F.textMuted},children:String(t+1).padStart(2,"0")})}),(0,W.jsx)(j.A,{children:(0,W.jsxs)(h.A,{direction:"row",alignItems:"center",spacing:.75,children:[(0,W.jsx)(Z,{color:"#0ea5e9",size:24,children:(0,W.jsx)(_.Itr,{size:12})}),(0,W.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:F.textPrimary,whiteSpace:"nowrap"},children:e.tenantname||"\u2014"})]})}),(0,W.jsx)(j.A,{align:"center",children:(0,W.jsx)(J,{value:e.totalorders,color:V,icon:(0,W.jsx)(_.F6S,{size:10})})}),(0,W.jsx)(j.A,{align:"center",children:(0,W.jsx)(J,{value:e.deliveriespending,color:"#f59e0b",icon:(0,W.jsx)(_.tX0,{size:10})})}),(0,W.jsx)(j.A,{align:"center",children:(0,W.jsx)(J,{value:e.deliveriescompleted,color:"#10b981",icon:(0,W.jsx)(_.mU9,{size:10})})}),(0,W.jsx)(j.A,{align:"center",children:(0,W.jsx)(J,{value:e.deliveriescancelled,color:"#ef4444",icon:(0,W.jsx)(_.uDv,{size:10})})}),(0,W.jsx)(j.A,{align:"center",children:(0,W.jsxs)(h.A,{direction:"column",spacing:.5,alignItems:"center",children:[(0,W.jsx)($,{color:"#ef4444",icon:(0,W.jsx)(_.xI$,{size:10}),label:"".concat(Number(e.kms||0).toFixed(2)," km"),tooltip:"KMS"}),(0,W.jsx)($,{color:"#10b981",icon:(0,W.jsx)(_.xI$,{size:10}),label:"".concat(Number(e.cumulativekms||0).toFixed(2)," km"),tooltip:"Actual KMS"})]})}),(0,W.jsx)(j.A,{align:"center",children:(0,W.jsx)($,{color:V,icon:(0,W.jsx)(_.YHz,{size:10}),label:Q(Math.max(Number(e.charges)||0,Number(e.deliveryamt)||0)).replace("\u20b9","").trim(),tooltip:"Total Amount",minWidth:100})})]},"".concat(e.tenantname,"-").concat(t)))):(0,W.jsx)(g.A,{children:(0,W.jsx)(j.A,{colSpan:8,sx:{py:3},children:(0,W.jsx)(x.A,{variant:"caption",sx:{color:F.textMuted,textAlign:"center",display:"block"},children:"No tenant breakdown available."})})})]})]})]})})})})})]},t.userid||o)})):(0,W.jsx)(g.A,{children:(0,W.jsx)(j.A,{colSpan:9,sx:{py:6},children:(0,W.jsxs)(h.A,{alignItems:"center",spacing:1.5,children:[(0,W.jsx)(l.A,{sx:{width:64,height:64,bgcolor:H("#94a3b8"),color:F.textMuted},children:(0,W.jsx)(_.bsz,{size:28})}),(0,W.jsx)(x.A,{variant:"subtitle1",sx:{fontWeight:700,color:F.textPrimary},children:"No riders to show"}),(0,W.jsx)(x.A,{variant:"caption",sx:{color:F.textSecondary},children:ue?"Try a different keyword.":"Pick a zone or date range to load the summary."})]})})})]})]})}),be.length>0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(S.A,{}),(0,W.jsxs)(h.A,{direction:"row",alignItems:"center",justifyContent:"flex-end",spacing:1.5,sx:{px:2,py:1.5,background:"linear-gradient(135deg, ".concat(K(V)," 0%, ").concat(K(q)," 100%)")},children:[(0,W.jsx)(x.A,{variant:"caption",sx:{fontWeight:800,color:F.textSecondary,letterSpacing:.6,textTransform:"uppercase"},children:"Grand Total"}),(0,W.jsx)(w.A,{label:Q(ve),sx:{fontWeight:800,fontSize:13,color:"#fff",background:"linear-gradient(135deg, ".concat(V," 0%, ").concat(q," 100%)"),boxShadow:"0 6px 16px ".concat(U(V))}})]})]})]}),(0,W.jsx)(C.A,{maxWidth:"xl",fullScreen:!0,open:ce,onClose:()=>{de(!1)},children:(0,W.jsx)(y.A,{children:xe&&(0,W.jsx)(N,{details:xe})})}),(0,W.jsx)(E.A,{open:L,onClose:()=>Y(!1),onSelect:e=>{t(e.startDate),o(e.endDate),ee(e.label)}})]})}},35678:(e,t,r)=>{r.d(t,{A:()=>v});var o=r(9950),n=r(96583),i=r(40033),s=r(82053),a=r(28170),l=r(93230),c=r(82223),d=r(55916),x=r(4159),h=r.n(x),u=r(56712),p=r(81417),A=r(96600),m=r(53132),g=r(94289),j=r(57326),b=r(50624),f=r(44414);const v=e=>{let{open:t,onClose:r,onSelect:x}=e;const[v,S]=(0,o.useState)(null);return(0,f.jsxs)(n.A,{open:t,onClose:r,children:[(0,f.jsx)(i.A,{align:"left",children:(0,f.jsx)(s.A,{variant:"h4",children:"Select Filter Options"})}),(0,f.jsx)(a.A,{sx:{width:"100%"},className:"datedialog",children:(0,f.jsx)(d.U,{open:t,toggle:r,id:"daterange1",onChange:e=>{S({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,A.A)(new Date)},{label:"Last Week",startDate:(0,p.A)((0,m.A)(new Date,-1)),endDate:(0,A.A)((0,m.A)(new Date,-1))},{label:"Last 7 Days",startDate:(0,m.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,b.A)(new Date,-1)),endDate:(0,j.A)((0,b.A)(new Date,-1))}]})}),(0,f.jsx)(l.A,{direction:"row",justifyContent:"flex-end",sx:{width:"100%",p:2},children:(0,f.jsx)(c.A,{variant:"contained",size:"small",onClick:()=>{v?(x(v),r()):r()},children:"OK"})})]})}},56311:(e,t,r)=>{r.d(t,{A:()=>u});var o=r(89379),n=r(9950),i=r(2660),s=r(2046),a=r(83274),l=r(25333),c=r(97125),d=r(7762),x=r(52097),h=r(44414);const u=e=>{let{value:t,onChange:r,onDebouncedChange:u,debounceTime:p=500,placeholder:A="Search (ctrl+k)",sx:m}=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)({},m),inputRef:g,placeholder:A,autoComplete:"off",value:t,fullWidth:!0,onChange:e=>r(e.target.value),startAdornment:(0,h.jsx)(s.A,{position:"start",sx:{mr:-.5},children:(0,h.jsx)(c.A,{})}),endAdornment:(0,h.jsx)(a.A,{title:"Clear",children:(0,h.jsx)(l.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(89379),n=r(9950),i=r(93230),s=r(41413),a=r(77922),l=r(29925),c=r(26910),d=r(31222),x=r(44414);const h=(0,n.forwardRef)(((e,t)=>{let{setAppId:r,setLocoName:h,setPage:u,sx:p,textfeildSx:A,textfieldSx:m,pill:g=!1,accentColor:j="#6366f1",icon:b,placeholder:f="Select Zone",paperComponent:v}=e;const[S,w]=(0,n.useState)(JSON.parse(localStorage.getItem("applocations")||"[]"));(0,n.useEffect)((()=>{0===S.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)),w(e)}}catch(e){console.error("Error fetching locations in LocationAutocomplete:",e)}})()}),[S.length]);const C=e=>"".concat(j).concat(e),y=C("08"),_=C("26"),R=C("55"),P=C("18"),D=g?{cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"999px",bgcolor:y,fontWeight:600,color:"#0f172a",paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:R,borderWidth:1.5},"&:hover fieldset":{borderColor:j},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(_)},"&.Mui-focused fieldset":{borderColor:j,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:j}}:{},k=g&&(0,x.jsx)(i.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,x.jsx)(s.A,{sx:{width:24,height:24,bgcolor:P,color:j,transition:"background-color 0.15s, color 0.15s"},children:b||(0,x.jsx)(d.HPi,{size:14})})});return(0,x.jsx)(a.A,{id:"location-autocomplete",options:S||[],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)(l.A,(0,o.A)((0,o.A)({},e),{},{inputRef:t,placeholder:f,InputProps:(0,o.A)((0,o.A)({},e.InputProps),{},{startAdornment:k}),sx:(0,o.A)((0,o.A)({},D),m||A||{})})):(0,x.jsx)(l.A,(0,o.A)((0,o.A)({},e),{},{inputRef:t,label:"Select Zones",sx:(0,o.A)({},m||A||{})}))})}))},96646:(e,t,r)=>{r.d(t,{r:()=>l});var o=r(9213),n=r(21671),i=r(82917),s=r(93230),a=r(44414);const l=e=>{let{rowsPerPage:t=5,col:r=1}=e;return(0,a.jsx)(a.Fragment,{children:Array.from(new Array(t)).map(((e,t)=>(0,a.jsxs)(o.A,{children:[(0,a.jsx)(n.A,{children:(0,a.jsx)(i.A,{variant:"circular",width:24,height:24})}),(0,a.jsx)(n.A,{children:(0,a.jsx)(i.A,{variant:"text",width:30})}),Array.from({length:r}).map(((e,t)=>(0,a.jsx)(n.A,{children:(0,a.jsxs)(s.A,{spacing:.5,children:[(0,a.jsx)(i.A,{variant:"text",width:100}),(0,a.jsx)(i.A,{variant:"text",width:80})]})},t))),(0,a.jsx)(n.A,{children:(0,a.jsx)(i.A,{variant:"text",width:150})}),(0,a.jsx)(n.A,{children:(0,a.jsx)(i.A,{variant:"rounded",width:60,height:24})}),(0,a.jsx)(n.A,{align:"center",children:(0,a.jsxs)(s.A,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,a.jsx)(i.A,{variant:"circular",width:28,height:28}),(0,a.jsx)(i.A,{variant:"circular",width:28,height:28})]})})]},t)))})}}}]);