1 line
28 KiB
JavaScript
1 line
28 KiB
JavaScript
"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[8597],{68597:function(e,r,n){n.r(r),n.d(r,{default:function(){return ye}});var o=n(74165),i=n(15861),t=n(29439),a=n(47313),s=n(56573),l=n(41962),c=n(48119),d=n(61113),x=n(57829),u=n(70501),p=n(42832),h=n(61689),g=n(9019),f=n(84488),m=n(54882),Z=n(47131),j=n(51629),b=n(66835),v=n(23477),w=n(24076),y=n(67478),D=n(57861),k=n(65033),S=n(19536),C=n(94469),W=n(96467),z=n(69099),M=n(22539),R=n(10658),P=n.n(R),B=n(25223),Y=n(99004),I=n(59376),T=n(34605),A=n(78392),N=n(41156),F=n(98589),L=n(79254),E=n(11577),K=n(19860),H=n(71049),O=n(46417),_=n(91635);P().extend(_);var U=16,X="0 14px 40px rgba(15, 23, 42, 0.10)",q="0 8px 24px rgba(15, 23, 42, 0.08)",V="#0f172a",G="#64748b",Q="#94a3b8",J="#e2e8f0",$="#f1f5f9",ee="#f8fafc",re=function(e,r){return"".concat(e).concat(r)},ne=function(e){return re(e,"08")},oe=function(e){return re(e,"18")},ie=function(e){return re(e,"26")},te=function(e){return re(e,"55")},ae="#662582",se="#9255AB",le="#f59e0b",ce="#0ea5e9",de="#6366f1",xe="#06b6d4",ue="#8b5cf6",pe="#14b8a6",he="#f97316",ge="#ef4444",fe="#10b981",me="#f59e0b",Ze="#ef4444",je="#10b981",be=function(e){var r=e.color,n=e.selected,o=e.size,i=void 0===o?24:o,t=e.children;return(0,O.jsx)(c.Z,{sx:{width:i,height:i,bgcolor:n?r:oe(r),color:n?"#fff":r,transition:"background-color 0.15s, color 0.15s"},children:t})},ve=function(e){var r=e.value,n=e.color,o=e.icon,i=e.isMoney,t=void 0!==i&&i,a=e.minWidth,s=Number(r),l=t?we(s):Number.isFinite(s)?s:r||0;return!Number.isFinite(s)||0===s?(0,O.jsx)(d.Z,{variant:"caption",sx:{color:Q,fontWeight:700},children:l}):(0,O.jsxs)(x.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:.875,py:.25,borderRadius:999,bgcolor:ne(n),border:"1px solid ".concat(te(n)),color:n,fontSize:12,fontWeight:800,whiteSpace:"nowrap",minWidth:a},children:[o,l]})};function we(e){return new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",minimumFractionDigits:2}).format(e||0)}function ye(){(0,K.Z)();var e=localStorage.getItem("tenantid"),r=(0,a.useState)(P()().format("YYYY-MM-DD")),n=(0,t.Z)(r,2),R=n[0],_=n[1],re=(0,a.useState)(P()().format("YYYY-MM-DD")),ye=(0,t.Z)(re,2),De=ye[0],ke=ye[1],Se=(0,a.useState)(!1),Ce=(0,t.Z)(Se,2),We=Ce[0],ze=Ce[1],Me=(0,a.useState)("Today"),Re=(0,t.Z)(Me,2),Pe=Re[0],Be=Re[1],Ye=(0,a.useState)(0),Ie=(0,t.Z)(Ye,2),Te=Ie[0],Ae=Ie[1],Ne=(0,a.useState)([]),Fe=(0,t.Z)(Ne,2),Le=Fe[0],Ee=Fe[1],Ke=(0,a.useState)(null),He=(0,t.Z)(Ke,2),Oe=He[0],_e=He[1],Ue=(0,a.useState)(""),Xe=(0,t.Z)(Ue,2),qe=Xe[0],Ve=Xe[1],Ge=(0,a.useState)(""),Qe=(0,t.Z)(Ge,2),Je=Qe[0],$e=Qe[1],er=(0,a.useRef)(null);(0,a.useEffect)((function(){var e=setTimeout((function(){return $e(qe)}),350);return function(){return clearTimeout(e)}}),[qe]),(0,a.useEffect)((function(){var e=function(e){"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),er.current&&er.current.focus()),"Escape"===e.key&&document.activeElement===er.current&&er.current.blur()};return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}}),[]);var rr=(0,l.a)({queryKey:[e,R,De],queryFn:H.RQ}),nr=rr.isLoading,or=rr.isError,ir=rr.data,tr=rr.error;(0,a.useEffect)((function(){if(ir){var e=0;ir.forEach((function(r){e+=Number(r.Deliveryamt||r.deliveryamt||0)})),Ae(e)}}),[ir]);var ar=function(){var r=(0,i.Z)((0,o.Z)().mark((function r(n){var i;return(0,o.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,s.Z.get("".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getriderlocationreportsummary/?&fromdate=").concat(R,"&todate=").concat(De,"&userid=").concat(n,"&tenantid=").concat(e));case 3:i=r.sent,Ee(i.data.details||[]),r.next=10;break;case 7:r.prev=7,r.t0=r.catch(0),console.log("tenantRes",r.t0);case 10:case"end":return r.stop()}}),r,null,[[0,7]])})));return function(e){return r.apply(this,arguments)}}();if(or)return"An error has occurred:(isErrorReports) "+tr.message;var sr=(ir||[]).filter((function(e){var r=Je.trim().toLowerCase();return!r||(String(e.firstname||"").toLowerCase().includes(r)||String(e.lastname||"").toLowerCase().includes(r)||String(e.userid||"").toLowerCase().includes(r))})),lr=sr.reduce((function(e,r){return e.deliveries+=Number(r.totalorders||0),e.pending+=Number(r.pending||0),e.delivered+=Number(r.delivered||0),e.charges+=Number(r.deliveryamt||0),e}),{deliveries:0,pending:0,delivered:0,charges:0}),cr=[{key:"riders",label:"Riders",color:ae,icon:M.te,value:sr.length},{key:"deliveries",label:"Deliveries",color:ce,icon:M.ili,value:lr.deliveries},{key:"pending",label:"Pending",color:le,icon:M.Ley,value:lr.pending},{key:"delivered",label:"Delivered",color:fe,icon:M.ZSR,value:lr.delivered},{key:"charges",label:"Total Charges",color:ae,icon:M.Rtn,value:lr.charges,isMoney:!0}];return(0,O.jsxs)(O.Fragment,{children:[nr&&(0,O.jsx)(E.Z,{}),(0,O.jsx)(u.Z,{elevation:0,sx:{mb:{xs:1.5,md:2},p:{xs:1.5,sm:2,md:2.5},borderRadius:U/8,border:"1px solid",borderColor:J,background:"linear-gradient(135deg, ".concat(ne(ae)," 0%, ").concat(ne(se)," 100%)"),boxShadow:q},children:(0,O.jsxs)(p.Z,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1.5,sm:2},children:[(0,O.jsxs)(p.Z,{direction:"row",alignItems:"center",spacing:{xs:1.25,sm:1.75},children:[(0,O.jsx)(c.Z,{sx:{width:{xs:40,sm:48},height:{xs:40,sm:48},bgcolor:ae,color:"#fff",boxShadow:"0 6px 18px ".concat(ie(ae))},children:(0,O.jsx)(M.te,{size:22})}),(0,O.jsxs)(p.Z,{children:[(0,O.jsx)(d.Z,{variant:"h3",sx:{fontWeight:800,color:V,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:"Riders Summary"}),(0,O.jsxs)(p.Z,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[(0,O.jsx)(x.Z,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 4px rgba(16,185,129,0.18)"}}),(0,O.jsxs)(d.Z,{variant:"caption",sx:{color:G,fontWeight:600},children:["Live \xb7 ",sr.length," riders \xb7 ",Pe]})]})]})]}),(0,O.jsx)(h.Z,{title:"Date Filter",children:(0,O.jsxs)(x.Z,{onClick:function(){return ze(!0)},sx:{display:"inline-flex",alignItems:"center",gap:.75,px:1.5,py:.875,borderRadius:999,cursor:"pointer",bgcolor:"#fff",border:"1.5px solid ".concat(te("#f59e0b")),color:"#f59e0b",fontWeight:800,fontSize:12,transition:"all 0.18s","&:hover":{borderColor:"#f59e0b",boxShadow:"0 0 0 3px ".concat(ie("#f59e0b"))}},children:[(0,O.jsx)(M.sHf,{size:14}),R&&De?"".concat(P()(R).format("DD/MM/YY")," \u2013 ").concat(P()(De).format("DD/MM/YY")):"All time"]})})]})}),(0,O.jsx)(g.ZP,{container:!0,spacing:{xs:1.25,sm:1.5,md:2},children:cr.map((function(e){var r=e.icon;return(0,O.jsx)(g.ZP,{item:!0,xs:6,sm:6,md:"charges"===e.key?4:2,children:(0,O.jsxs)(u.Z,{elevation:0,sx:{position:"relative",overflow:"hidden",p:{xs:1.25,sm:1.75,md:2.25},borderRadius:U/8,border:"1px solid",borderColor:J,background:"#fff",transition:"transform 0.2s, box-shadow 0.2s, border-color 0.2s","&:hover":{transform:"translateY(-3px)",boxShadow:q,borderColor:te(e.color)}},children:[(0,O.jsx)(x.Z,{sx:{position:"absolute",top:0,left:0,right:0,height:3,background:"linear-gradient(90deg, ".concat(e.color," 0%, ").concat(oe(e.color)," 100%)")}}),(0,O.jsxs)(p.Z,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,O.jsxs)(p.Z,{spacing:.5,sx:{minWidth:0,flex:1},children:[(0,O.jsx)(d.Z,{variant:"caption",sx:{color:G,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:{xs:10,sm:11},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.label}),(0,O.jsx)(d.Z,{sx:{fontWeight:800,color:V,lineHeight:1.1,fontSize:{xs:"1.1rem",sm:"1.35rem",md:"1.55rem"}},children:nr?(0,O.jsx)(f.Z,{sx:{width:40},animation:"wave"}):e.isMoney?we(e.value):e.value})]}),(0,O.jsx)(c.Z,{sx:{width:{xs:32,sm:38,md:44},height:{xs:32,sm:38,md:44},bgcolor:oe(e.color),color:e.color,boxShadow:"inset 0 0 0 1px ".concat(te(e.color)),flexShrink:0},children:(0,O.jsx)(r,{size:18})})]})]})},e.key)}))}),(0,O.jsx)(u.Z,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1.25,md:1.75},borderRadius:U/8,border:"1px solid",borderColor:J,background:"#fff",boxShadow:X},children:(0,O.jsxs)(p.Z,{direction:{xs:"column",md:"row"},spacing:1.25,alignItems:{xs:"stretch",md:"center"},justifyContent:"space-between",children:[(0,O.jsx)(x.Z,{sx:{width:{xs:"100%",md:360}},children:(0,O.jsxs)(x.Z,{sx:{display:"flex",alignItems:"center",gap:.75,px:1.25,py:.5,borderRadius:999,bgcolor:ne(ae),border:"1.5px solid ".concat(te(ae)),transition:"all 0.18s","&:focus-within":{borderColor:ae,boxShadow:"0 0 0 3px ".concat(ie(ae))}},children:[(0,O.jsx)(M.vU7,{size:16,style:{color:ae,flexShrink:0}}),(0,O.jsx)(m.ZP,{inputRef:er,placeholder:"Search rider name (ctrl+k)",value:qe,onChange:function(e){return Ve(e.target.value)},autoComplete:"off",sx:{flex:1,fontSize:13,fontWeight:600,color:V,"& input::placeholder":{color:Q,opacity:1}}}),qe&&(0,O.jsx)(Z.Z,{size:"small",onClick:function(){return Ve("")},sx:{p:.25,color:ae},children:(0,O.jsx)(M.lUB,{size:14})})]})}),(0,O.jsxs)(p.Z,{direction:"row",spacing:1,alignItems:"center",flexWrap:"wrap",useFlexGap:!0,children:[(0,O.jsxs)(x.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.5,borderRadius:999,bgcolor:ne(ae),border:"1px solid ".concat(te(ae)),color:ae,fontSize:11,fontWeight:800},children:[(0,O.jsx)(M.VHP,{size:12})," Orders \xb7 ",Pe]}),R&&De&&(0,O.jsxs)(x.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.5,borderRadius:999,bgcolor:ne("#f59e0b"),border:"1px solid ".concat(te("#f59e0b")),color:"#f59e0b",fontSize:11,fontWeight:800},children:[(0,O.jsx)(M.dKE,{size:12})," ",P()(R).format("DD/MM/YY")," \u2013 ",P()(De).format("DD/MM/YY")]})]})]})}),(0,O.jsxs)(u.Z,{elevation:0,sx:{mt:{xs:1.5,md:2},borderRadius:U/8,border:"1px solid",borderColor:J,overflow:"hidden",background:"#fff"},children:[(0,O.jsx)(j.Z,{sx:{overflow:"auto","&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-thumb":{backgroundColor:te(ae),borderRadius:8,"&:hover":{backgroundColor:ae}},"&::-webkit-scrollbar-track":{backgroundColor:ee}},children:(0,O.jsxs)(b.Z,{sx:{minWidth:1300},children:[(0,O.jsx)(v.Z,{children:(0,O.jsxs)(w.Z,{sx:{"& th":{backgroundColor:ee,color:G,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(J),py:{xs:1,md:1.25},px:{xs:1,md:1.5}}},children:[(0,O.jsx)(y.Z,{children:"#"}),(0,O.jsx)(y.Z,{children:"Rider"}),(0,O.jsx)(y.Z,{align:"center",children:"Deliveries"}),(0,O.jsx)(y.Z,{align:"center",sx:{color:"".concat(le," !important")},children:"Pending"}),(0,O.jsx)(y.Z,{align:"center",sx:{color:"".concat(ce," !important")},children:"Assigned"}),(0,O.jsx)(y.Z,{align:"center",sx:{color:"".concat(de," !important")},children:"Accepted"}),(0,O.jsx)(y.Z,{align:"center",sx:{color:"".concat(xe," !important")},children:"Arrived"}),(0,O.jsx)(y.Z,{align:"center",sx:{color:"".concat(ue," !important")},children:"Picked"}),(0,O.jsx)(y.Z,{align:"center",sx:{color:"".concat(pe," !important")},children:"Active"}),(0,O.jsx)(y.Z,{align:"center",sx:{color:"".concat(he," !important")},children:"Skipped"}),(0,O.jsx)(y.Z,{align:"center",sx:{color:"".concat(ge," !important")},children:"Cancelled"}),(0,O.jsx)(y.Z,{align:"center",sx:{color:"".concat(fe," !important")},children:"Delivered"}),(0,O.jsx)(y.Z,{align:"center",children:"Kms"}),(0,O.jsx)(y.Z,{align:"center",children:"COD / PLA"}),(0,O.jsx)(y.Z,{align:"right",children:"Charges"}),(0,O.jsx)(y.Z,{align:"center",children:"Action"})]})}),(0,O.jsxs)(D.Z,{children:[nr&&0===sr.length&&[0,1,2,3,4].map((function(e,r){return(0,O.jsx)(w.Z,{children:Array.from({length:16}).map((function(e,r){return(0,O.jsx)(y.Z,{sx:{borderBottom:"1px solid ".concat($)},children:(0,O.jsx)(f.Z,{animation:"wave"})},r)}))},"sk-".concat(r))})),!nr&&0===sr.length&&(0,O.jsx)(w.Z,{children:(0,O.jsx)(y.Z,{colSpan:16,sx:{py:6,borderBottom:"none"},children:(0,O.jsxs)(p.Z,{alignItems:"center",spacing:1.5,children:[(0,O.jsx)(c.Z,{sx:{width:64,height:64,bgcolor:oe("#94a3b8"),color:Q},children:(0,O.jsx)(M.te,{size:28})}),(0,O.jsx)(d.Z,{variant:"subtitle1",sx:{fontWeight:700,color:V},children:"No riders to show"}),(0,O.jsx)(d.Z,{variant:"caption",sx:{color:G},children:qe?"Try a different rider name.":"Adjust the date range above."})]})})}),sr.map((function(e,r){return(0,O.jsxs)(a.Fragment,{children:[(0,O.jsxs)(w.Z,{sx:{cursor:"pointer",transition:"background-color 0.15s","& td":{borderBottom:"1px solid ".concat($),py:{xs:1,md:1.25},px:{xs:1,md:1.5}},backgroundColor:Oe===e.userid?ne(ae):"transparent","&:hover":{backgroundColor:Oe===e.userid?oe(ae):ee}},children:[(0,O.jsx)(y.Z,{children:(0,O.jsx)(d.Z,{sx:{fontWeight:700,color:G},children:r+1})}),(0,O.jsx)(y.Z,{children:(0,O.jsxs)(p.Z,{direction:"row",alignItems:"center",spacing:1,children:[(0,O.jsx)(be,{color:ae,size:32,selected:!0,children:String(e.firstname||"?").charAt(0).toUpperCase()}),(0,O.jsxs)(p.Z,{children:[(0,O.jsxs)(d.Z,{variant:"subtitle2",sx:{fontWeight:700,color:V},noWrap:!0,children:[e.firstname," ",e.lastname]}),(0,O.jsxs)(d.Z,{variant:"caption",sx:{color:Q},children:["Id : ",e.userid]})]})]})}),(0,O.jsx)(y.Z,{align:"center",children:(0,O.jsx)(ve,{value:e.totalorders,color:ae,icon:(0,O.jsx)(M.ByW,{size:11})})}),(0,O.jsx)(y.Z,{align:"center",children:(0,O.jsx)(ve,{value:e.pending,color:le,icon:(0,O.jsx)(M.Ley,{size:11})})}),(0,O.jsx)(y.Z,{align:"center",children:(0,O.jsx)(ve,{value:e.assigned,color:ce,icon:(0,O.jsx)(M.Z5O,{size:11})})}),(0,O.jsx)(y.Z,{align:"center",children:(0,O.jsx)(ve,{value:e.accepted,color:de,icon:(0,O.jsx)(M.ZSR,{size:11})})}),(0,O.jsx)(y.Z,{align:"center",children:(0,O.jsx)(ve,{value:e.arrived,color:xe,icon:(0,O.jsx)(M.ZSR,{size:11})})}),(0,O.jsx)(y.Z,{align:"center",children:(0,O.jsx)(ve,{value:e.picked,color:ue,icon:(0,O.jsx)(M.ili,{size:11})})}),(0,O.jsx)(y.Z,{align:"center",children:(0,O.jsx)(ve,{value:e.active,color:pe,icon:(0,O.jsx)(M.ili,{size:11})})}),(0,O.jsx)(y.Z,{align:"center",children:(0,O.jsx)(ve,{value:e.skipped,color:he,icon:(0,O.jsx)(M.B4e,{size:11})})}),(0,O.jsx)(y.Z,{align:"center",children:(0,O.jsx)(ve,{value:e.cancelled,color:ge,icon:(0,O.jsx)(M.B4e,{size:11})})}),(0,O.jsx)(y.Z,{align:"center",children:(0,O.jsx)(ve,{value:e.delivered,color:fe,icon:(0,O.jsx)(M.ZSR,{size:11})})}),(0,O.jsx)(y.Z,{align:"center",children:(0,O.jsx)(h.Z,{title:"Cumulative Kms",placement:"top",children:(0,O.jsx)(x.Z,{sx:{display:"inline-block"},children:(0,O.jsx)(ve,{value:e.cumulativekms?Number(parseFloat(e.cumulativekms).toFixed(2)):0,color:me,icon:(0,O.jsx)(M.v93,{size:11})})})})}),(0,O.jsx)(y.Z,{align:"center",children:(0,O.jsxs)(p.Z,{direction:"row",spacing:.5,justifyContent:"center",children:[(0,O.jsx)(h.Z,{title:"Pay on Delivery",children:(0,O.jsx)(x.Z,{sx:{display:"inline-block"},children:(0,O.jsx)(ve,{value:e.payondelivery,color:Ze,icon:(0,O.jsx)(M.vCl,{size:11}),isMoney:!0})})}),(0,O.jsx)(h.Z,{title:"Pay Later",children:(0,O.jsx)(x.Z,{sx:{display:"inline-block"},children:(0,O.jsx)(ve,{value:e.Paylater,color:je,icon:(0,O.jsx)(M.vCl,{size:11}),isMoney:!0})})})]})}),(0,O.jsx)(y.Z,{align:"right",children:(0,O.jsx)(h.Z,{title:"Total Charges",placement:"top",children:(0,O.jsx)(x.Z,{sx:{display:"inline-block"},children:(0,O.jsx)(ve,{value:e.deliveryamt,color:ae,icon:(0,O.jsx)(M.vCl,{size:11}),isMoney:!0})})})}),(0,O.jsx)(y.Z,{align:"center",children:(0,O.jsx)(h.Z,{title:Oe===e.userid?"Collapse locations":"View locations",children:(0,O.jsx)(Z.Z,{size:"small",onClick:function(){ar(e.userid),_e(Oe===e.userid?null:e.userid)},sx:{bgcolor:Oe===e.userid?ae:ne(ae),border:"1px solid ".concat(Oe===e.userid?ae:te(ae)),color:Oe===e.userid?"#fff":ae,borderRadius:999,p:.75,transition:"all 0.18s","&:hover":{bgcolor:Oe===e.userid?ae:oe(ae),borderColor:ae,boxShadow:"0 0 0 3px ".concat(ie(ae))}},children:Oe===e.userid?(0,O.jsx)(M.rWj,{size:14}):(0,O.jsx)(M.Ix0,{size:14})})})})]}),Oe===e.userid&&(0,O.jsx)(w.Z,{children:(0,O.jsx)(y.Z,{colSpan:16,sx:{p:0,borderBottom:"1px solid ".concat($),bgcolor:ee},children:(0,O.jsx)(k.Z,{in:Oe===e.userid,timeout:"auto",unmountOnExit:!0,children:(0,O.jsxs)(x.Z,{sx:{p:{xs:1.5,md:2}},children:[(0,O.jsxs)(p.Z,{direction:"row",alignItems:"center",spacing:1,sx:{mb:1.25},children:[(0,O.jsx)(be,{color:ae,size:22,selected:!0,children:(0,O.jsx)(M.c7Z,{size:12})}),(0,O.jsxs)(d.Z,{variant:"subtitle2",sx:{fontWeight:800,color:V},children:["Locations \xb7 ",e.firstname," ",e.lastname]})]}),(0,O.jsx)(u.Z,{elevation:0,sx:{borderRadius:2,border:"1px solid",borderColor:J,overflow:"hidden",background:"#fff"},children:(0,O.jsxs)(b.Z,{size:"small",children:[(0,O.jsx)(v.Z,{children:(0,O.jsxs)(w.Z,{sx:{"& th":{backgroundColor:ne(ae),color:ae,fontSize:10.5,fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(te(ae)),py:.75}},children:[(0,O.jsx)(y.Z,{align:"center",children:"#"}),(0,O.jsx)(y.Z,{children:"Location"}),(0,O.jsx)(y.Z,{align:"center",children:"All"}),(0,O.jsx)(y.Z,{align:"center",children:"Pending"}),(0,O.jsx)(y.Z,{align:"center",children:"Completed"}),(0,O.jsx)(y.Z,{align:"center",children:"Cancelled"}),(0,O.jsx)(y.Z,{align:"center",children:"Kms"}),(0,O.jsx)(y.Z,{align:"center",children:"COD / PLA"}),(0,O.jsx)(y.Z,{align:"right",children:"Amount"})]})}),(0,O.jsx)(D.Z,{children:Le&&Le.length>0?Le.map((function(e,r){return(0,O.jsxs)(w.Z,{sx:{"& td":{borderBottom:"1px solid ".concat($),py:.875,px:1},"&:hover":{backgroundColor:ee}},children:[(0,O.jsx)(y.Z,{align:"center",children:(0,O.jsx)(d.Z,{sx:{fontWeight:700,color:G,fontSize:12},children:r+1})}),(0,O.jsx)(y.Z,{children:(0,O.jsxs)(p.Z,{children:[(0,O.jsx)(d.Z,{variant:"caption",sx:{fontWeight:700,color:V},noWrap:!0,children:e.locationname}),(0,O.jsxs)(d.Z,{variant:"caption",sx:{color:Q,fontSize:10},children:["Id : ",e.locationid]})]})}),(0,O.jsx)(y.Z,{align:"center",children:(0,O.jsx)(ve,{value:e.totalorders,color:ae,icon:(0,O.jsx)(M.ByW,{size:10})})}),(0,O.jsx)(y.Z,{align:"center",children:(0,O.jsx)(ve,{value:e.deliveriespending,color:le,icon:(0,O.jsx)(M.Ley,{size:10})})}),(0,O.jsx)(y.Z,{align:"center",children:(0,O.jsx)(ve,{value:e.deliveriescompleted,color:fe,icon:(0,O.jsx)(M.ZSR,{size:10})})}),(0,O.jsx)(y.Z,{align:"center",children:(0,O.jsx)(ve,{value:e.deliveriescancelled,color:ge,icon:(0,O.jsx)(M.B4e,{size:10})})}),(0,O.jsx)(y.Z,{align:"center",children:(0,O.jsx)(ve,{value:e.cumulativekms?Number(parseFloat(e.cumulativekms).toFixed(2)):0,color:me,icon:(0,O.jsx)(M.v93,{size:10})})}),(0,O.jsx)(y.Z,{align:"center",children:(0,O.jsxs)(p.Z,{direction:"row",spacing:.5,justifyContent:"center",children:[(0,O.jsx)(h.Z,{title:"Pay on Delivery",children:(0,O.jsx)(x.Z,{sx:{display:"inline-block"},children:(0,O.jsx)(ve,{value:e.payondelivery,color:Ze,icon:(0,O.jsx)(M.vCl,{size:10}),isMoney:!0})})}),(0,O.jsx)(h.Z,{title:"Pay Later",children:(0,O.jsx)(x.Z,{sx:{display:"inline-block"},children:(0,O.jsx)(ve,{value:e.paylater,color:je,icon:(0,O.jsx)(M.vCl,{size:10}),isMoney:!0})})})]})}),(0,O.jsx)(y.Z,{align:"right",children:(0,O.jsx)(ve,{value:e.charges,color:ae,icon:(0,O.jsx)(M.vCl,{size:10}),isMoney:!0})})]},"".concat(e.locationid,"-").concat(r))})):(0,O.jsx)(w.Z,{children:(0,O.jsx)(y.Z,{colSpan:9,sx:{py:3,borderBottom:"none"},children:(0,O.jsxs)(p.Z,{alignItems:"center",spacing:1,children:[(0,O.jsx)(c.Z,{sx:{width:40,height:40,bgcolor:oe("#94a3b8"),color:Q},children:(0,O.jsx)(M.c7Z,{size:18})}),(0,O.jsx)(d.Z,{variant:"caption",sx:{color:G,fontWeight:700},children:"No location data for this rider"})]})})})})]})})]})})})})]},"".concat(e.userid,"-").concat(r))}))]})]})}),(0,O.jsx)(S.Z,{}),sr.length>0&&(0,O.jsx)(p.Z,{direction:{xs:"column",sm:"row"},spacing:1.25,alignItems:"center",justifyContent:"flex-end",sx:{p:{xs:1.25,md:1.75},background:"linear-gradient(135deg, ".concat(ne(ae)," 0%, ").concat(ne(se)," 100%)"),borderTop:"1px solid ".concat(te(ae))},children:(0,O.jsxs)(x.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.75,px:1.25,py:.5,borderRadius:999,bgcolor:"#fff",border:"1.5px solid ".concat(te(ae)),color:ae,fontWeight:800,fontSize:13},children:[(0,O.jsx)(M.Rtn,{size:13})," Total Amount \xb7 ",we(Te)]})})]}),(0,O.jsxs)(C.Z,{open:We,onClose:function(){return ze(!1)},PaperProps:{sx:{borderRadius:3}},children:[(0,O.jsx)(x.Z,{sx:{p:2.5,background:"linear-gradient(135deg, ".concat(ne(ae)," 0%, ").concat(ne(se)," 100%)"),borderBottom:"1px solid ".concat(J)},children:(0,O.jsxs)(p.Z,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,O.jsx)(c.Z,{sx:{bgcolor:ae,color:"#fff",width:40,height:40,boxShadow:"0 6px 18px ".concat(ie(ae))},children:(0,O.jsx)(M.sHf,{size:20})}),(0,O.jsxs)(p.Z,{children:[(0,O.jsx)(d.Z,{variant:"h5",sx:{fontWeight:800,color:V},children:"Select Date Range"}),(0,O.jsx)(d.Z,{variant:"caption",sx:{color:G,fontWeight:600},children:"Filter rider activity by a date range or preset"})]})]})}),(0,O.jsx)(W.Z,{sx:{width:"100%"},className:"datedialog",children:(0,O.jsx)(B.D,{open:We,toggle:function(){return ze(!We)},id:"daterange1",onChange:function(e){"All"===e.label?(_(""),ke(""),Be("All"),ze(!1)):(_(P()(e.startDate).format("YYYY-MM-DD")),ke(P()(e.endDate).format("YYYY-MM-DD")),Be(e.label||""))},definedRanges:[{label:"Today",startDate:new Date,endDate:new Date},{label:"Yesterday",startDate:(0,Y.Z)(new Date,-1),endDate:(0,Y.Z)(new Date,-1)},{label:"Tomorrow",startDate:(0,Y.Z)(new Date,1),endDate:(0,Y.Z)(new Date,1)},{label:"This Week",startDate:(0,I.Z)(new Date),endDate:(0,T.Z)(new Date)},{label:"Last Week",startDate:(0,I.Z)((0,A.Z)(new Date,-1)),endDate:(0,T.Z)((0,A.Z)(new Date,-1))},{label:"Last 7 Days",startDate:(0,A.Z)(new Date,-1),endDate:new Date},{label:"This Month",startDate:(0,N.Z)(new Date),endDate:(0,F.Z)(new Date)},{label:"Last Month",startDate:(0,N.Z)((0,L.Z)(new Date,-1)),endDate:(0,F.Z)((0,L.Z)(new Date,-1))},{label:"All",startDate:new Date,endDate:(0,Y.Z)(new Date,-1)}]})}),(0,O.jsxs)(p.Z,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{width:"100%",p:2,borderTop:"1px solid ".concat($)},children:[(0,O.jsx)(z.Z,{variant:"outlined",onClick:function(){return ze(!1)},sx:{borderRadius:999,px:2.5,borderColor:J,color:G,fontWeight:700,"&:hover":{borderColor:G,bgcolor:ee}},children:"Cancel"}),(0,O.jsx)(z.Z,{variant:"contained",onClick:function(){return ze(!1)},sx:{borderRadius:999,px:3,bgcolor:ae,fontWeight:700,boxShadow:"0 6px 18px ".concat(ie(ae)),"&:hover":{bgcolor:"#4D1C61"}},children:"Apply"})]})]})]})}},96467:function(e,r,n){n.d(r,{Z:function(){return Z}});var o=n(4942),i=n(63366),t=n(87462),a=n(47313),s=n(83061),l=n(21921),c=n(17592),d=n(77342),x=n(77430),u=n(32298);function p(e){return(0,u.Z)("MuiDialogContent",e)}(0,x.Z)("MuiDialogContent",["root","dividers"]);var h=n(93174),g=n(46417),f=["className","dividers"],m=(0,c.ZP)("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:function(e,r){var n=e.ownerState;return[r.root,n.dividers&&r.dividers]}})((function(e){var r=e.theme,n=e.ownerState;return(0,t.Z)({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px"},n.dividers?{padding:"16px 24px",borderTop:"1px solid ".concat((r.vars||r).palette.divider),borderBottom:"1px solid ".concat((r.vars||r).palette.divider)}:(0,o.Z)({},".".concat(h.Z.root," + &"),{paddingTop:0}))})),Z=a.forwardRef((function(e,r){var n=(0,d.Z)({props:e,name:"MuiDialogContent"}),o=n.className,a=n.dividers,c=void 0!==a&&a,x=(0,i.Z)(n,f),u=(0,t.Z)({},n,{dividers:c}),h=function(e){var r=e.classes,n={root:["root",e.dividers&&"dividers"]};return(0,l.Z)(n,p,r)}(u);return(0,g.jsx)(m,(0,t.Z)({className:(0,s.Z)(h.root,o),ownerState:u,ref:r},x))}))},93174:function(e,r,n){n.d(r,{a:function(){return t}});var o=n(77430),i=n(32298);function t(e){return(0,i.Z)("MuiDialogTitle",e)}var a=(0,o.Z)("MuiDialogTitle",["root"]);r.Z=a},94469:function(e,r,n){var o=n(4942),i=n(63366),t=n(87462),a=n(47313),s=n(83061),l=n(21921),c=n(28334),d=n(91615),x=n(10387),u=n(32530),p=n(70501),h=n(77342),g=n(17592),f=n(85560),m=n(63909),Z=n(91554),j=n(19860),b=n(46417),v=["aria-describedby","aria-labelledby","BackdropComponent","BackdropProps","children","className","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClose","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps"],w=(0,g.ZP)(Z.Z,{name:"MuiDialog",slot:"Backdrop",overrides:function(e,r){return r.backdrop}})({zIndex:-1}),y=(0,g.ZP)(x.Z,{name:"MuiDialog",slot:"Root",overridesResolver:function(e,r){return r.root}})({"@media print":{position:"absolute !important"}}),D=(0,g.ZP)("div",{name:"MuiDialog",slot:"Container",overridesResolver:function(e,r){var n=e.ownerState;return[r.container,r["scroll".concat((0,d.Z)(n.scroll))]]}})((function(e){var r=e.ownerState;return(0,t.Z)({height:"100%","@media print":{height:"auto"},outline:0},"paper"===r.scroll&&{display:"flex",justifyContent:"center",alignItems:"center"},"body"===r.scroll&&{overflowY:"auto",overflowX:"hidden",textAlign:"center","&:after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}})})),k=(0,g.ZP)(p.Z,{name:"MuiDialog",slot:"Paper",overridesResolver:function(e,r){var n=e.ownerState;return[r.paper,r["scrollPaper".concat((0,d.Z)(n.scroll))],r["paperWidth".concat((0,d.Z)(String(n.maxWidth)))],n.fullWidth&&r.paperFullWidth,n.fullScreen&&r.paperFullScreen]}})((function(e){var r=e.theme,n=e.ownerState;return(0,t.Z)({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},"paper"===n.scroll&&{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},"body"===n.scroll&&{display:"inline-block",verticalAlign:"middle",textAlign:"left"},!n.maxWidth&&{maxWidth:"calc(100% - 64px)"},"xs"===n.maxWidth&&(0,o.Z)({maxWidth:"px"===r.breakpoints.unit?Math.max(r.breakpoints.values.xs,444):"".concat(r.breakpoints.values.xs).concat(r.breakpoints.unit)},"&.".concat(f.Z.paperScrollBody),(0,o.Z)({},r.breakpoints.down(Math.max(r.breakpoints.values.xs,444)+64),{maxWidth:"calc(100% - 64px)"})),n.maxWidth&&"xs"!==n.maxWidth&&(0,o.Z)({maxWidth:"".concat(r.breakpoints.values[n.maxWidth]).concat(r.breakpoints.unit)},"&.".concat(f.Z.paperScrollBody),(0,o.Z)({},r.breakpoints.down(r.breakpoints.values[n.maxWidth]+64),{maxWidth:"calc(100% - 64px)"})),n.fullWidth&&{width:"calc(100% - 64px)"},n.fullScreen&&(0,o.Z)({margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0},"&.".concat(f.Z.paperScrollBody),{margin:0,maxWidth:"100%"}))})),S=a.forwardRef((function(e,r){var n=(0,h.Z)({props:e,name:"MuiDialog"}),o=(0,j.Z)(),x={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},g=n["aria-describedby"],Z=n["aria-labelledby"],S=n.BackdropComponent,C=n.BackdropProps,W=n.children,z=n.className,M=n.disableEscapeKeyDown,R=void 0!==M&&M,P=n.fullScreen,B=void 0!==P&&P,Y=n.fullWidth,I=void 0!==Y&&Y,T=n.maxWidth,A=void 0===T?"sm":T,N=n.onBackdropClick,F=n.onClose,L=n.open,E=n.PaperComponent,K=void 0===E?p.Z:E,H=n.PaperProps,O=void 0===H?{}:H,_=n.scroll,U=void 0===_?"paper":_,X=n.TransitionComponent,q=void 0===X?u.Z:X,V=n.transitionDuration,G=void 0===V?x:V,Q=n.TransitionProps,J=(0,i.Z)(n,v),$=(0,t.Z)({},n,{disableEscapeKeyDown:R,fullScreen:B,fullWidth:I,maxWidth:A,scroll:U}),ee=function(e){var r=e.classes,n=e.scroll,o=e.maxWidth,i=e.fullWidth,t=e.fullScreen,a={root:["root"],container:["container","scroll".concat((0,d.Z)(n))],paper:["paper","paperScroll".concat((0,d.Z)(n)),"paperWidth".concat((0,d.Z)(String(o))),i&&"paperFullWidth",t&&"paperFullScreen"]};return(0,l.Z)(a,f.D,r)}($),re=a.useRef(),ne=(0,c.Z)(Z),oe=a.useMemo((function(){return{titleId:ne}}),[ne]);return(0,b.jsx)(y,(0,t.Z)({className:(0,s.Z)(ee.root,z),closeAfterTransition:!0,components:{Backdrop:w},componentsProps:{backdrop:(0,t.Z)({transitionDuration:G,as:S},C)},disableEscapeKeyDown:R,onClose:F,open:L,ref:r,onClick:function(e){re.current&&(re.current=null,N&&N(e),F&&F(e,"backdropClick"))},ownerState:$},J,{children:(0,b.jsx)(q,(0,t.Z)({appear:!0,in:L,timeout:G,role:"presentation"},Q,{children:(0,b.jsx)(D,{className:(0,s.Z)(ee.container),onMouseDown:function(e){re.current=e.target===e.currentTarget},ownerState:$,children:(0,b.jsx)(k,(0,t.Z)({as:K,elevation:24,role:"dialog","aria-describedby":g,"aria-labelledby":ne},O,{className:(0,s.Z)(ee.paper,O.className),ownerState:$,children:(0,b.jsx)(m.Z.Provider,{value:oe,children:W})}))})}))}))}));r.Z=S},63909:function(e,r,n){var o=n(47313).createContext({});r.Z=o},85560:function(e,r,n){n.d(r,{D:function(){return t}});var o=n(77430),i=n(32298);function t(e){return(0,i.Z)("MuiDialog",e)}var a=(0,o.Z)("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]);r.Z=a},41962:function(e,r,n){n.d(r,{a:function(){return t}});var o=n(18948),i=n(51695);function t(e,r){return(0,i.r)(e,o.z,r)}}}]); |