1 line
22 KiB
JavaScript
1 line
22 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 we}});var i=n(74165),o=n(15861),t=n(29439),s=n(47313),c=n(56573),l=n(41962),a=n(48119),d=n(61113),x=n(57829),h=n(70501),u=n(42832),g=n(61689),j=n(69099),p=n(9019),f=n(84488),Z=n(54882),m=n(47131),b=n(51629),v=n(66835),w=n(23477),y=n(24076),D=n(67478),S=n(57861),k=n(65033),z=n(19536),C=n(94469),R=n(96467),W=n(22539),M=n(10658),I=n.n(M),A=n(25223),Y=n(99004),L=n(59376),T=n(34605),B=n(78392),P=n(41156),N=n(98589),F=n(79254),E=n(11577),H=n(19860),K=n(71049),O=n(46417),U=n(91635);I().extend(U);var _="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",X="#f1f5f9",$="#f8fafc",ee=function(e,r){return"".concat(e).concat(r)},re=function(e){return ee(e,"08")},ne=function(e){return ee(e,"18")},ie=function(e){return ee(e,"26")},oe=function(e){return ee(e,"55")},te="#662582",se="#9255AB",ce="#f59e0b",le="#0ea5e9",ae="#6366f1",de="#06b6d4",xe="#8b5cf6",he="#14b8a6",ue="#f97316",ge="#ef4444",je="#10b981",pe="#f59e0b",fe="#ef4444",Ze="#10b981",me=function(e){var r=e.color,n=e.selected,i=e.size,o=void 0===i?24:i,t=e.children;return(0,O.jsx)(a.Z,{sx:{width:o,height:o,bgcolor:n?r:ne(r),color:n?"#fff":r,transition:"background-color 0.15s, color 0.15s"},children:t})},be=function(e){var r=e.value,n=e.color,i=e.icon,o=e.isMoney,t=void 0!==o&&o,s=e.minWidth,c=Number(r),l=t?ve(c):Number.isFinite(c)?c:r||0;return!Number.isFinite(c)||0===c?(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:re(n),border:"1px solid ".concat(oe(n)),color:n,fontSize:12,fontWeight:800,whiteSpace:"nowrap",minWidth:s},children:[i,l]})};function ve(e){return new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",minimumFractionDigits:2}).format(e||0)}function we(){(0,H.Z)();var e=localStorage.getItem("tenantid"),r=(0,s.useState)(I()().format("YYYY-MM-DD")),n=(0,t.Z)(r,2),M=n[0],U=n[1],ee=(0,s.useState)(I()().format("YYYY-MM-DD")),we=(0,t.Z)(ee,2),ye=we[0],De=we[1],Se=(0,s.useState)(!1),ke=(0,t.Z)(Se,2),ze=ke[0],Ce=ke[1],Re=(0,s.useState)("Today"),We=(0,t.Z)(Re,2),Me=We[0],Ie=We[1],Ae=(0,s.useState)(0),Ye=(0,t.Z)(Ae,2),Le=Ye[0],Te=Ye[1],Be=(0,s.useState)([]),Pe=(0,t.Z)(Be,2),Ne=Pe[0],Fe=Pe[1],Ee=(0,s.useState)(null),He=(0,t.Z)(Ee,2),Ke=He[0],Oe=He[1],Ue=(0,s.useState)(""),_e=(0,t.Z)(Ue,2),qe=_e[0],Ve=_e[1],Ge=(0,s.useState)(""),Qe=(0,t.Z)(Ge,2),Je=Qe[0],Xe=Qe[1],$e=(0,s.useRef)(null);(0,s.useEffect)((function(){var e=setTimeout((function(){return Xe(qe)}),350);return function(){return clearTimeout(e)}}),[qe]),(0,s.useEffect)((function(){var e=function(e){"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),$e.current&&$e.current.focus()),"Escape"===e.key&&document.activeElement===$e.current&&$e.current.blur()};return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}}),[]);var er=(0,l.a)({queryKey:[e,M,ye],queryFn:K.RQ}),rr=er.isLoading,nr=er.isError,ir=er.data,or=er.error;(0,s.useEffect)((function(){if(ir){var e=0;ir.forEach((function(r){e+=Number(r.Deliveryamt||r.deliveryamt||0)})),Te(e)}}),[ir]);var tr=function(){var r=(0,o.Z)((0,i.Z)().mark((function r(n){var o;return(0,i.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,c.Z.get("".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getriderlocationreportsummary/?&fromdate=").concat(M,"&todate=").concat(ye,"&userid=").concat(n,"&tenantid=").concat(e));case 3:o=r.sent,Fe(o.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(nr)return"An error has occurred:(isErrorReports) "+or.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))})),cr=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}),lr=[{key:"riders",label:"Riders",color:te,icon:W.te,value:sr.length},{key:"deliveries",label:"Deliveries",color:le,icon:W.ili,value:cr.deliveries},{key:"pending",label:"Pending",color:ce,icon:W.Ley,value:cr.pending},{key:"delivered",label:"Delivered",color:je,icon:W.ZSR,value:cr.delivered},{key:"charges",label:"Total Charges",color:te,icon:W.Rtn,value:cr.charges,isMoney:!0}];return(0,O.jsxs)(O.Fragment,{children:[rr&&(0,O.jsx)(E.Z,{}),(0,O.jsx)(h.Z,{elevation:0,sx:{mb:{xs:1,md:1.25},px:{xs:1.5,sm:2},py:{xs:1,sm:1.25},borderRadius:2,border:"1px solid",borderColor:J,background:"linear-gradient(135deg, ".concat(re(te)," 0%, ").concat(re(se)," 100%)"),boxShadow:q},children:(0,O.jsxs)(u.Z,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1,sm:1.5},children:[(0,O.jsxs)(u.Z,{direction:"row",alignItems:"center",spacing:1.25,children:[(0,O.jsx)(a.Z,{variant:"rounded",sx:{width:36,height:36,bgcolor:te,color:"#fff",borderRadius:1.5,boxShadow:"0 4px 12px ".concat(ie(te))},children:(0,O.jsx)(W.te,{size:19})}),(0,O.jsxs)(u.Z,{spacing:.125,children:[(0,O.jsx)(d.Z,{variant:"h3",sx:{fontWeight:800,color:V,lineHeight:1.1,fontSize:{xs:"1.1rem",sm:"1.25rem",md:"1.375rem"}},children:"Riders Summary"}),(0,O.jsxs)(u.Z,{direction:"row",alignItems:"center",spacing:.75,children:[(0,O.jsx)(x.Z,{sx:{width:7,height:7,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 3px rgba(16,185,129,0.18)"}}),(0,O.jsxs)(d.Z,{sx:{fontSize:11.5,color:G,fontWeight:600},children:["Live \xb7 ",sr.length," riders \xb7 ",Me]})]})]})]}),(0,O.jsx)(g.Z,{title:"Filter by date range",arrow:!0,children:(0,O.jsx)(j.Z,{onClick:function(){return Ce(!0)},disableElevation:!0,variant:"outlined",size:"small",startIcon:(0,O.jsx)(W.sHf,{size:15}),sx:{height:32,px:1.25,borderRadius:1.5,textTransform:"none",fontSize:12.5,fontWeight:700,letterSpacing:.1,bgcolor:"#fff",borderColor:J,color:V,"&:hover":{bgcolor:"#fff",borderColor:te,color:te,boxShadow:"0 0 0 3px ".concat(ie(te))}},children:M&&ye?"".concat(I()(M).format("DD MMM")," \u2013 ").concat(I()(ye).format("DD MMM")):"All time"})})]})}),(0,O.jsx)(p.ZP,{container:!0,spacing:{xs:1,sm:1.25,md:1.5},children:lr.map((function(e){var r=e.icon;return(0,O.jsx)(p.ZP,{item:!0,xs:6,sm:6,md:"charges"===e.key?4:2,children:(0,O.jsxs)(h.Z,{elevation:0,sx:{position:"relative",overflow:"hidden",px:{xs:1.25,sm:1.5},py:{xs:.875,sm:1.125},borderRadius:2,border:"1px solid",borderColor:J,background:"#fff",transition:"transform 0.15s, box-shadow 0.15s, border-color 0.15s","&:hover":{transform:"translateY(-1px)",boxShadow:q,borderColor:oe(e.color)}},children:[(0,O.jsx)(x.Z,{sx:{position:"absolute",top:0,left:0,bottom:0,width:3,background:e.color}}),(0,O.jsxs)(u.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,sx:{pl:.5},children:[(0,O.jsxs)(u.Z,{spacing:.125,sx:{minWidth:0,flex:1},children:[(0,O.jsx)(d.Z,{sx:{color:G,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:10.5,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",lineHeight:1.2},children:e.label}),(0,O.jsx)(d.Z,{sx:{fontWeight:800,color:V,lineHeight:1.15,fontSize:{xs:"0.95rem",sm:"1.1rem",md:"1.2rem"}},noWrap:!0,children:rr?(0,O.jsx)(f.Z,{sx:{width:40},animation:"wave"}):e.isMoney?ve(e.value):e.value})]}),(0,O.jsx)(a.Z,{variant:"rounded",sx:{width:30,height:30,bgcolor:ne(e.color),color:e.color,borderRadius:1.25,flexShrink:0},children:(0,O.jsx)(r,{size:15})})]})]})},e.key)}))}),(0,O.jsx)(h.Z,{elevation:0,sx:{mt:{xs:1,md:1.25},p:{xs:1,md:1.125},borderRadius:2,border:"1px solid",borderColor:J,background:"#fff",boxShadow:_},children:(0,O.jsxs)(u.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:re(te),border:"1.5px solid ".concat(oe(te)),transition:"all 0.18s","&:focus-within":{borderColor:te,boxShadow:"0 0 0 3px ".concat(ie(te))}},children:[(0,O.jsx)(W.vU7,{size:16,style:{color:te,flexShrink:0}}),(0,O.jsx)(Z.ZP,{inputRef:$e,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)(m.Z,{size:"small",onClick:function(){return Ve("")},sx:{p:.25,color:te},children:(0,O.jsx)(W.lUB,{size:14})})]})}),(0,O.jsxs)(u.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:re(te),border:"1px solid ".concat(oe(te)),color:te,fontSize:11,fontWeight:800},children:[(0,O.jsx)(W.VHP,{size:12})," Orders \xb7 ",Me]}),M&&ye&&(0,O.jsxs)(x.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.5,borderRadius:999,bgcolor:re("#f59e0b"),border:"1px solid ".concat(oe("#f59e0b")),color:"#f59e0b",fontSize:11,fontWeight:800},children:[(0,O.jsx)(W.dKE,{size:12})," ",I()(M).format("DD/MM/YY")," \u2013 ",I()(ye).format("DD/MM/YY")]})]})]})}),(0,O.jsxs)(h.Z,{elevation:0,sx:{mt:{xs:1,md:1.25},borderRadius:2,border:"1px solid",borderColor:J,overflow:"hidden",background:"#fff"},children:[(0,O.jsx)(b.Z,{sx:{minHeight:320,maxHeight:{xs:"calc(100vh - 320px)",md:"calc(100vh - 300px)"},overflow:"auto","&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-thumb":{backgroundColor:oe(te),borderRadius:8,"&:hover":{backgroundColor:te}},"&::-webkit-scrollbar-track":{backgroundColor:$}},children:(0,O.jsxs)(v.Z,{stickyHeader:!0,size:"small",sx:{minWidth:1300},children:[(0,O.jsx)(w.Z,{children:(0,O.jsxs)(y.Z,{sx:{"& th":{backgroundColor:$,color:G,fontSize:10.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(J),py:.75,px:1}},children:[(0,O.jsx)(D.Z,{children:"#"}),(0,O.jsx)(D.Z,{children:"Rider"}),(0,O.jsx)(D.Z,{align:"center",children:"Deliveries"}),(0,O.jsx)(D.Z,{align:"center",sx:{color:"".concat(ce," !important")},children:"Pending"}),(0,O.jsx)(D.Z,{align:"center",sx:{color:"".concat(le," !important")},children:"Assigned"}),(0,O.jsx)(D.Z,{align:"center",sx:{color:"".concat(ae," !important")},children:"Accepted"}),(0,O.jsx)(D.Z,{align:"center",sx:{color:"".concat(de," !important")},children:"Arrived"}),(0,O.jsx)(D.Z,{align:"center",sx:{color:"".concat(xe," !important")},children:"Picked"}),(0,O.jsx)(D.Z,{align:"center",sx:{color:"".concat(he," !important")},children:"Active"}),(0,O.jsx)(D.Z,{align:"center",sx:{color:"".concat(ue," !important")},children:"Skipped"}),(0,O.jsx)(D.Z,{align:"center",sx:{color:"".concat(ge," !important")},children:"Cancelled"}),(0,O.jsx)(D.Z,{align:"center",sx:{color:"".concat(je," !important")},children:"Delivered"}),(0,O.jsx)(D.Z,{align:"center",children:"Kms"}),(0,O.jsx)(D.Z,{align:"center",children:"COD / PLA"}),(0,O.jsx)(D.Z,{align:"right",children:"Charges"}),(0,O.jsx)(D.Z,{align:"center",children:"Action"})]})}),(0,O.jsxs)(S.Z,{children:[rr&&0===sr.length&&Array.from({length:10}).map((function(e,r){return(0,O.jsx)(y.Z,{children:Array.from({length:16}).map((function(e,r){return(0,O.jsx)(D.Z,{sx:{borderBottom:"1px solid ".concat(X),py:.625,px:1},children:(0,O.jsx)(f.Z,{animation:"wave",height:20})},r)}))},"sk-".concat(r))})),!rr&&0===sr.length&&(0,O.jsx)(y.Z,{children:(0,O.jsx)(D.Z,{colSpan:16,sx:{py:7,borderBottom:"none"},children:(0,O.jsxs)(u.Z,{alignItems:"center",spacing:1.25,children:[(0,O.jsx)(a.Z,{variant:"rounded",sx:{width:56,height:56,bgcolor:ne("#94a3b8"),color:Q,borderRadius:2},children:(0,O.jsx)(W.te,{size:26})}),(0,O.jsx)(d.Z,{sx:{fontWeight:700,color:V,fontSize:14},children:"No riders to show"}),(0,O.jsx)(d.Z,{sx:{color:G,fontSize:12},children:qe?"Try a different rider name or clear the search.":"Adjust the date range above."}),qe&&(0,O.jsx)(j.Z,{size:"small",onClick:function(){return Ve("")},sx:{mt:.5,height:28,textTransform:"none",fontSize:12,fontWeight:700,color:te,borderRadius:1.25,"&:hover":{bgcolor:re(te)}},startIcon:(0,O.jsx)(W.lUB,{size:14}),children:"Clear search"})]})})}),sr.map((function(e,r){return(0,O.jsxs)(s.Fragment,{children:[(0,O.jsxs)(y.Z,{sx:{cursor:"pointer",transition:"background-color 0.12s, box-shadow 0.12s","& td":{borderBottom:"1px solid ".concat(X),py:.625,px:1,verticalAlign:"middle"},backgroundColor:Ke===e.userid?re(te):"transparent",boxShadow:Ke===e.userid?"inset 3px 0 0 ".concat(te):"none","&:hover":{backgroundColor:Ke===e.userid?ne(te):re(te),boxShadow:"inset 3px 0 0 ".concat(te)}},children:[(0,O.jsx)(D.Z,{children:(0,O.jsx)(d.Z,{sx:{fontWeight:700,fontSize:12,color:Q},children:r+1})}),(0,O.jsx)(D.Z,{children:(0,O.jsxs)(u.Z,{direction:"row",alignItems:"center",spacing:1,children:[(0,O.jsx)(me,{color:te,size:28,selected:!0,children:String(e.firstname||"?").charAt(0).toUpperCase()}),(0,O.jsxs)(u.Z,{spacing:.125,children:[(0,O.jsxs)(d.Z,{sx:{fontSize:12.5,fontWeight:700,color:V,lineHeight:1.25},noWrap:!0,children:[e.firstname," ",e.lastname]}),(0,O.jsxs)(d.Z,{sx:{fontSize:10.5,fontWeight:600,color:Q,lineHeight:1.3},children:["Id : ",e.userid]})]})]})}),(0,O.jsx)(D.Z,{align:"center",children:(0,O.jsx)(be,{value:e.totalorders,color:te,icon:(0,O.jsx)(W.ByW,{size:11})})}),(0,O.jsx)(D.Z,{align:"center",children:(0,O.jsx)(be,{value:e.pending,color:ce,icon:(0,O.jsx)(W.Ley,{size:11})})}),(0,O.jsx)(D.Z,{align:"center",children:(0,O.jsx)(be,{value:e.assigned,color:le,icon:(0,O.jsx)(W.Z5O,{size:11})})}),(0,O.jsx)(D.Z,{align:"center",children:(0,O.jsx)(be,{value:e.accepted,color:ae,icon:(0,O.jsx)(W.ZSR,{size:11})})}),(0,O.jsx)(D.Z,{align:"center",children:(0,O.jsx)(be,{value:e.arrived,color:de,icon:(0,O.jsx)(W.ZSR,{size:11})})}),(0,O.jsx)(D.Z,{align:"center",children:(0,O.jsx)(be,{value:e.picked,color:xe,icon:(0,O.jsx)(W.ili,{size:11})})}),(0,O.jsx)(D.Z,{align:"center",children:(0,O.jsx)(be,{value:e.active,color:he,icon:(0,O.jsx)(W.ili,{size:11})})}),(0,O.jsx)(D.Z,{align:"center",children:(0,O.jsx)(be,{value:e.skipped,color:ue,icon:(0,O.jsx)(W.B4e,{size:11})})}),(0,O.jsx)(D.Z,{align:"center",children:(0,O.jsx)(be,{value:e.cancelled,color:ge,icon:(0,O.jsx)(W.B4e,{size:11})})}),(0,O.jsx)(D.Z,{align:"center",children:(0,O.jsx)(be,{value:e.delivered,color:je,icon:(0,O.jsx)(W.ZSR,{size:11})})}),(0,O.jsx)(D.Z,{align:"center",children:(0,O.jsx)(g.Z,{title:"Cumulative Kms",placement:"top",children:(0,O.jsx)(x.Z,{sx:{display:"inline-block"},children:(0,O.jsx)(be,{value:e.cumulativekms?Number(parseFloat(e.cumulativekms).toFixed(2)):0,color:pe,icon:(0,O.jsx)(W.v93,{size:11})})})})}),(0,O.jsx)(D.Z,{align:"center",children:(0,O.jsxs)(u.Z,{direction:"row",spacing:.5,justifyContent:"center",children:[(0,O.jsx)(g.Z,{title:"Pay on Delivery",children:(0,O.jsx)(x.Z,{sx:{display:"inline-block"},children:(0,O.jsx)(be,{value:e.payondelivery,color:fe,icon:(0,O.jsx)(W.vCl,{size:11}),isMoney:!0})})}),(0,O.jsx)(g.Z,{title:"Pay Later",children:(0,O.jsx)(x.Z,{sx:{display:"inline-block"},children:(0,O.jsx)(be,{value:e.Paylater,color:Ze,icon:(0,O.jsx)(W.vCl,{size:11}),isMoney:!0})})})]})}),(0,O.jsx)(D.Z,{align:"right",children:(0,O.jsx)(g.Z,{title:"Total Charges",placement:"top",children:(0,O.jsx)(x.Z,{sx:{display:"inline-block"},children:(0,O.jsx)(be,{value:e.deliveryamt,color:te,icon:(0,O.jsx)(W.vCl,{size:11}),isMoney:!0})})})}),(0,O.jsx)(D.Z,{align:"center",children:(0,O.jsx)(g.Z,{title:Ke===e.userid?"Collapse locations":"View locations",children:(0,O.jsx)(m.Z,{size:"small",onClick:function(){tr(e.userid),Oe(Ke===e.userid?null:e.userid)},sx:{bgcolor:Ke===e.userid?te:re(te),border:"1px solid ".concat(Ke===e.userid?te:oe(te)),color:Ke===e.userid?"#fff":te,borderRadius:999,p:.75,transition:"all 0.18s","&:hover":{bgcolor:Ke===e.userid?te:ne(te),borderColor:te,boxShadow:"0 0 0 3px ".concat(ie(te))}},children:Ke===e.userid?(0,O.jsx)(W.rWj,{size:14}):(0,O.jsx)(W.Ix0,{size:14})})})})]}),Ke===e.userid&&(0,O.jsx)(y.Z,{children:(0,O.jsx)(D.Z,{colSpan:16,sx:{p:0,borderBottom:"1px solid ".concat(X),bgcolor:$},children:(0,O.jsx)(k.Z,{in:Ke===e.userid,timeout:"auto",unmountOnExit:!0,children:(0,O.jsxs)(x.Z,{sx:{p:{xs:1.5,md:2}},children:[(0,O.jsxs)(u.Z,{direction:"row",alignItems:"center",spacing:1,sx:{mb:1.25},children:[(0,O.jsx)(me,{color:te,size:22,selected:!0,children:(0,O.jsx)(W.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)(h.Z,{elevation:0,sx:{borderRadius:2,border:"1px solid",borderColor:J,overflow:"hidden",background:"#fff"},children:(0,O.jsxs)(v.Z,{size:"small",children:[(0,O.jsx)(w.Z,{children:(0,O.jsxs)(y.Z,{sx:{"& th":{backgroundColor:re(te),color:te,fontSize:10.5,fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(oe(te)),py:.75}},children:[(0,O.jsx)(D.Z,{align:"center",children:"#"}),(0,O.jsx)(D.Z,{children:"Location"}),(0,O.jsx)(D.Z,{align:"center",children:"All"}),(0,O.jsx)(D.Z,{align:"center",children:"Pending"}),(0,O.jsx)(D.Z,{align:"center",children:"Completed"}),(0,O.jsx)(D.Z,{align:"center",children:"Cancelled"}),(0,O.jsx)(D.Z,{align:"center",children:"Kms"}),(0,O.jsx)(D.Z,{align:"center",children:"COD / PLA"}),(0,O.jsx)(D.Z,{align:"right",children:"Amount"})]})}),(0,O.jsx)(S.Z,{children:Ne&&Ne.length>0?Ne.map((function(e,r){return(0,O.jsxs)(y.Z,{sx:{"& td":{borderBottom:"1px solid ".concat(X),py:.5,px:1},"&:hover":{backgroundColor:re(te),boxShadow:"inset 3px 0 0 ".concat(te)}},children:[(0,O.jsx)(D.Z,{align:"center",children:(0,O.jsx)(d.Z,{sx:{fontWeight:700,color:G,fontSize:12},children:r+1})}),(0,O.jsx)(D.Z,{children:(0,O.jsxs)(u.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)(D.Z,{align:"center",children:(0,O.jsx)(be,{value:e.totalorders,color:te,icon:(0,O.jsx)(W.ByW,{size:10})})}),(0,O.jsx)(D.Z,{align:"center",children:(0,O.jsx)(be,{value:e.deliveriespending,color:ce,icon:(0,O.jsx)(W.Ley,{size:10})})}),(0,O.jsx)(D.Z,{align:"center",children:(0,O.jsx)(be,{value:e.deliveriescompleted,color:je,icon:(0,O.jsx)(W.ZSR,{size:10})})}),(0,O.jsx)(D.Z,{align:"center",children:(0,O.jsx)(be,{value:e.deliveriescancelled,color:ge,icon:(0,O.jsx)(W.B4e,{size:10})})}),(0,O.jsx)(D.Z,{align:"center",children:(0,O.jsx)(be,{value:e.cumulativekms?Number(parseFloat(e.cumulativekms).toFixed(2)):0,color:pe,icon:(0,O.jsx)(W.v93,{size:10})})}),(0,O.jsx)(D.Z,{align:"center",children:(0,O.jsxs)(u.Z,{direction:"row",spacing:.5,justifyContent:"center",children:[(0,O.jsx)(g.Z,{title:"Pay on Delivery",children:(0,O.jsx)(x.Z,{sx:{display:"inline-block"},children:(0,O.jsx)(be,{value:e.payondelivery,color:fe,icon:(0,O.jsx)(W.vCl,{size:10}),isMoney:!0})})}),(0,O.jsx)(g.Z,{title:"Pay Later",children:(0,O.jsx)(x.Z,{sx:{display:"inline-block"},children:(0,O.jsx)(be,{value:e.paylater,color:Ze,icon:(0,O.jsx)(W.vCl,{size:10}),isMoney:!0})})})]})}),(0,O.jsx)(D.Z,{align:"right",children:(0,O.jsx)(be,{value:e.charges,color:te,icon:(0,O.jsx)(W.vCl,{size:10}),isMoney:!0})})]},"".concat(e.locationid,"-").concat(r))})):(0,O.jsx)(y.Z,{children:(0,O.jsx)(D.Z,{colSpan:9,sx:{py:3,borderBottom:"none"},children:(0,O.jsxs)(u.Z,{alignItems:"center",spacing:1,children:[(0,O.jsx)(a.Z,{sx:{width:40,height:40,bgcolor:ne("#94a3b8"),color:Q},children:(0,O.jsx)(W.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)(z.Z,{}),sr.length>0&&(0,O.jsx)(u.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(re(te)," 0%, ").concat(re(se)," 100%)"),borderTop:"1px solid ".concat(oe(te))},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(oe(te)),color:te,fontWeight:800,fontSize:13},children:[(0,O.jsx)(W.Rtn,{size:13})," Total Amount \xb7 ",ve(Le)]})})]}),(0,O.jsxs)(C.Z,{open:ze,onClose:function(){return Ce(!1)},PaperProps:{sx:{borderRadius:3}},children:[(0,O.jsx)(x.Z,{sx:{p:2.5,background:"linear-gradient(135deg, ".concat(re(te)," 0%, ").concat(re(se)," 100%)"),borderBottom:"1px solid ".concat(J)},children:(0,O.jsxs)(u.Z,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,O.jsx)(a.Z,{sx:{bgcolor:te,color:"#fff",width:40,height:40,boxShadow:"0 6px 18px ".concat(ie(te))},children:(0,O.jsx)(W.sHf,{size:20})}),(0,O.jsxs)(u.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)(R.Z,{sx:{width:"100%"},className:"datedialog",children:(0,O.jsx)(A.D,{open:ze,toggle:function(){return Ce(!ze)},id:"daterange1",onChange:function(e){"All"===e.label?(U(""),De(""),Ie("All"),Ce(!1)):(U(I()(e.startDate).format("YYYY-MM-DD")),De(I()(e.endDate).format("YYYY-MM-DD")),Ie(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,L.Z)(new Date),endDate:(0,T.Z)(new Date)},{label:"Last Week",startDate:(0,L.Z)((0,B.Z)(new Date,-1)),endDate:(0,T.Z)((0,B.Z)(new Date,-1))},{label:"Last 7 Days",startDate:(0,B.Z)(new Date,-1),endDate:new Date},{label:"This Month",startDate:(0,P.Z)(new Date),endDate:(0,N.Z)(new Date)},{label:"Last Month",startDate:(0,P.Z)((0,F.Z)(new Date,-1)),endDate:(0,N.Z)((0,F.Z)(new Date,-1))},{label:"All",startDate:new Date,endDate:(0,Y.Z)(new Date,-1)}]})}),(0,O.jsxs)(u.Z,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{width:"100%",p:2,borderTop:"1px solid ".concat(X)},children:[(0,O.jsx)(j.Z,{variant:"outlined",onClick:function(){return Ce(!1)},sx:{borderRadius:999,px:2.5,borderColor:J,color:G,fontWeight:700,"&:hover":{borderColor:G,bgcolor:$}},children:"Cancel"}),(0,O.jsx)(j.Z,{variant:"contained",onClick:function(){return Ce(!1)},sx:{borderRadius:999,px:3,bgcolor:te,fontWeight:700,boxShadow:"0 6px 18px ".concat(ie(te)),"&:hover":{bgcolor:"#4D1C61"}},children:"Apply"})]})]})]})}}}]); |