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