"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7212],{1468:(e,t,r)=>{r.d(t,{A:()=>s});var i=r(37876),n=r(35003),l=r(95062),o=r.n(l),a=r(82),d=r(51707);let p=e=>{let{text:t,textAlign:r,textTransform:l,fontWeight:o,...p}=e,{t:s}=(0,a.Bd)();return(0,i.jsx)(n.A,{textAlign:r||"center",fontWeight:o||"700",lineHeight:(0,d.u)()?"10px":"30px",sx:{fontSize:{xs:"15px",md:"22px"}},textTransform:l,...p,children:s(t)})};p.propTypes={text:o().string.isRequired};let s=p},19608:(e,t,r)=>{r.d(t,{A:()=>p});var i=r(60398),n=r(64907),l=r(1992),o=r(77165),a=r(35502);let d=async(e,t,r)=>{let l=(0,a.g)();try{let o=l?"?order_id=".concat(e):"?order_id=".concat(e,"&guest_id=").concat(r,"&contact_number=").concat(t),{data:a}=await i.A.get("".concat(n.oT).concat(o));return a}catch(e){throw e}};function p(e,t,r,i,n){return(0,l.useQuery)(["track-order-data",e],()=>d(e,t,r),{onSuccess:n,enabled:!1,retry:1,onError:e=>{var t,r,n;null==i||i(!1),null==e||null==(n=e.response)||null==(r=n.data)||null==(t=r.errors)||t.forEach(e=>{(0,o.nG)(e)})}})}},38390:(e,t,r)=>{r.d(t,{S:()=>a});var i=r(35268),n=r(62148),l=r(74441),o=r(89037);(0,i.Ay)(o.A)(()=>({padding:"40px 0px 40px 0px",width:"100%"}));let a=(0,i.Ay)(n.A)(e=>{let{theme:t,width:r,height:i,border:n,color:o,marginLeft:a,marginTop:d,connectorHeight:p,parcel:s}=e;return{"& .MuiStepConnector-line":{height:p||"30px",borderColor:(0,l.X4)(t.palette.primary.main,.2),marginLeft:"true"===s&&"20px",marginBottom:"true"===s&&"-43px",[t.breakpoints.down("sm")]:{marginLeft:"true"===s&&"12px"}},"& .MuiStepConnector-root.Mui-active .MuiStepConnector-line":{borderColor:t.palette.primary.main,height:p||"30px"},"& .MuiStepConnector-root.Mui-completed .MuiStepConnector-line":{borderColor:t.palette.primary.main,height:p||"30px"},"& .MuiStepLabel-iconContainer .Mui-active":{marginTop:"0px",width:r||"10px",height:i||"10px",borderRadius:"50%",color:o||t.palette.neutral[100]},"& .MuiStepLabel-iconContainer .Mui-completed":{width:"32px",height:"20px",borderColor:t.palette.primary.main},"& .MuiStepContent-root":{},"& .MuiStepLabel-label":{color:o,fontSize:"13px",marginBottom:"4px",marginLeft:a||"0px",marginTop:d||"0px"},"& .MuiStepLabel-label.Mui-active":{color:o,fontSize:"13px",fontWeight:400},"& .MuiStepLabel-iconContainer ":{width:"32px",height:"20px",borderColor:t.palette.primary.main},"& .MuiStepConnector-root ":{color:t.palette.primary.main,marginLeft:"3px","& .MuiStepConnector-line":{borderLeftWidth:"true"===s?"1px dash":"3px",color:"true"===s?t.palette.neutral[400]:t.palette.primary.main,marginTop:"true"===s?"-18px":"-11px",[t.breakpoints.down("sm")]:{marginTop:"true"===s?"-31px":"-11px"}}},"& .MuiSvgIcon-root":{width:r||"10px",height:i||"10px",color:o||t.palette.neutral[100],border:n||"2px solid",borderColor:t.palette.primary.main,borderRadius:"50%"},"& .MuiStepLabel-root":{padding:"0px"}}})},95377:(e,t,r)=>{r.d(t,{A:()=>N});var i=r(37876),n=r(14232),l=r(50864),o=r(28343),a=r(74441),d=r(6995),p=r(35003),s=r(84812),u=r(62712),c=r(93892),x=r(21459),h=r(89037),m=r(82179),A=r(21398),g=r(39501),v=r(65853),j=r(45485),f=r(97914),b=r(71733),y=r(92705),M=r(48109),S=r(50882),_=r(51105),C=r(74695),w=r(11849),L=r(35502),B=r(97685),k=r(89099);let W=(0,x.A)(o.jB)(e=>{let{theme:t}=e;return{background:(0,a.X4)(t.palette.primary.main,.2),padding:"20px 24px",marginTop:"10px",justifyContent:"space-between"}}),z=(0,x.A)(b.A)(e=>{let{theme:t}=e;return{background:t.palette.neutral[100],padding:"11px",borderRadius:"50%"}}),R=e=>{let{deliveryManInfo:t}=e,r=(0,A.u)(),n=(0,k.useRouter)(),{configData:l}=(0,C.d4)(e=>e.configData),o=(0,a.X4)(r.palette.moduleTheme.food,.5),d="".concat(null==t?void 0:t.f_name," ").concat(null==t?void 0:t.l_name);return(0,i.jsxs)(W,{direction:"row",children:[(0,i.jsxs)(m.A,{direction:"row",spacing:1.5,children:[(0,i.jsx)(y.A,{src:null==t?void 0:t.image_full_url}),(0,i.jsxs)(m.A,{children:[(0,i.jsx)(p.A,{children:d}),(0,i.jsxs)(p.A,{fontSize:"13px",color:r.palette.neutral[500],children:[(0,i.jsx)("span",{style:{paddingRight:"2px"},children:(0,i.jsx)(_.A,{style:{width:"14px",height:"14px",color:o}})}),null==t?void 0:t.avg_rating]})]})]}),(0,i.jsxs)(m.A,{direction:"row",spacing:1.5,children:[(0,i.jsx)(w.A,{phone:null==t?void 0:t.phone,children:(0,i.jsx)(z,{children:(0,i.jsx)(M.A,{color:"primary",style:{width:"20px",height:"20px"}})})}),(0,i.jsx)(z,{onClick:()=>{if((0,L.g)()){var e,r;n.push({pathname:"/profile",query:{page:"inbox",type:"delivery_man",id:null==t?void 0:t.id,routeName:"delivery_man_id",chatFrom:"true",deliveryman_name:null==(e=deliveryManData)?void 0:e.f_name,deliveryManData_image:null==(r=deliveryManData)?void 0:r.image}})}else B.Ay.error("uyrttgr")},children:(0,i.jsx)(S.A,{style:{width:"20px",height:"20px",color:o}})})]})]})};r(38390);var D=r(62148),E=r(38595),I=r(3218),T=r(10841),O=r.n(T);let U=(0,x.A)(D.A)(e=>{let{theme:t}=e;return{"& .MuiStepConnector-root ":{"& .MuiStepConnector-line":{borderLeftWidth:"2px"}},"& .MuiStepConnector-line":{height:"28px",marginLeft:"-6px",marginBottom:"-11px",marginTop:"-10px"},"& .MuiSvgIcon-root ":{width:"14px",height:"14px",color:t.palette.neutral[100],border:"3px solid",borderColor:t.palette.neutral[400],borderRadius:"50%"},"& .Mui-completed":{borderColor:t.palette.primary.main},"& .MuiStepLabel-label.Mui-completed":{color:t.palette.primary.main},"& .MuiStepConnector-root.Mui-active .MuiStepConnector-line":{borderColor:t.palette.neutral[400]},"& .MuiStepConnector-root.Mui-completed .MuiStepConnector-line":{borderColor:t.palette.primary.main}}}),X=e=>{let{steps:t,activeStep:r}=e;return(0,i.jsx)(U,{orientation:"vertical",activeStep:r,children:null==t?void 0:t.map((e,t)=>(0,i.jsx)(E.A,{children:(0,i.jsx)(I.A,{children:(0,i.jsxs)(m.A,{direction:"row",justifyContent:"space-between",children:[(0,i.jsx)(p.A,{fontSize:"12px",fontWeight:"400",children:null==e?void 0:e.label}),(0,i.jsx)(p.A,{fontSize:"12px",children:(null==e?void 0:e.time)&&O()(null==e?void 0:e.time).format("D MMM, h:mm A")})]})})},t))})};var H=r(19608),J=r(22185),F=r(31450);let G={src:"/_next/static/media/empty.fb5e331e.png",height:400,width:400,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAP1BMVEV9fX3AwMBBQUF2dnZhYWFfX1+CgoK8vLy9vb1zc3M5OTmOjo6JiYmOjo5kZGSGhoaFhYWpqamamppoaGjHx8edLKrGAAAAEXRSTlMB8ac6jIHf/V4Ob3pXVtb+/rB7sYQAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAA7SURBVHicHcZJFsAgCMDQOAJ2BL3/WftqNj9QRs6jgK6YM5aislMs+ft4MtDu0RWgidRfrNX72gfnwQdKyQHKD2HIJwAAAABJRU5ErkJggg==",blurWidth:8,blurHeight:8};var Q=r(58898),V=r(37376),Y=r(56462);let K=(0,x.A)(h.A)(e=>{let{theme:t}=e;return{borderLeft:"1px dashed",borderColor:(0,a.X4)(t.palette.neutral[500],.5),height:"81px",marginLeft:"8px"}}),N=e=>{var t,r,a,x,h,b,y,M,S,_;let w=(0,A.u)(),B=(0,k.useRouter)(),W=(0,C.wA)();(0,d.A)(w.breakpoints.down("sm"));let[z,D]=(0,n.useState)(null),{sideDrawerOpen:E,orderId:I,setSideDrawerOpen:T,phoneOrEmail:O}=e,[U,N]=(0,n.useState)(1),q=(0,L.W)(),{error:Z,refetch:P,data:$,isLoading:ee,isRefetching:et}=(0,H.A)(I,O,q,e=>{D(e)});(0,n.useEffect)(()=>{I&&P()},[I]),(0,n.useEffect)(()=>{$&&D($)},[$,I]),(0,n.useEffect)(()=>{let e=setInterval(()=>{I&&z&&(null==z?void 0:z.order_status)!=="delivered"&&P()},1e4);return()=>{clearInterval(e)}},[P]),(0,n.useEffect)(()=>{(null==$?void 0:$.order_status)==="pending"?N(1):(null==$?void 0:$.order_status)==="confirmed"?N(2):(null==$?void 0:$.order_status)==="picked_up"?N(3):(null==$?void 0:$.order_status)==="delivered"&&N(4)},[U,$,I]);let er=[{label:"Order Placed",time:null==$?void 0:$.pending},{label:"Order Confirmed",time:null==$?void 0:$.confirmed},{label:"On the Way",time:null==$?void 0:$.picked_up},{label:"Delivered",time:null==$?void 0:$.delivered}],ei=()=>{D(null),T(!1)};return(0,i.jsxs)(l.A,{anchor:"right",open:E,onClose:ei,variant:"temporary",maxWidth:"420px",width:"100%",height:"100vh",sx:{position:"relative"},children:[(0,i.jsx)(m.A,{direction:"row",spacing:1,alignItems:"center",sx:{position:"absolute",top:"1rem",right:".5rem"},children:(0,i.jsx)(Q.$G,{onClick:ei,children:(0,i.jsx)(V.A,{fontSize:"16px"})})}),z&&!ee&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(o.jB,{padding:"30px 24px 0px 24px",children:[(0,i.jsx)(m.A,{justifyContent:"space-between",direction:"row",alignItems:"center",mb:"10px",children:(0,i.jsxs)(p.A,{fontSize:"16px",fontWeight:"600",textAlign:"center",children:["Order ID:"," ",(0,i.jsx)(p.A,{component:"span",fontSize:"16px",fontWeight:"600",children:null==$?void 0:$.id})]})}),(0,i.jsxs)(o.jB,{sx:{position:"relative"},children:[(0,i.jsx)(c.A,{latitude:null==$||null==(t=$.delivery_address)?void 0:t.latitude,longitude:null==$||null==(r=$.delivery_address)?void 0:r.longitude,deliveryManLat:(null==$?void 0:$.order_status)==="picked_up"?null==$||null==(a=$.delivery_man)?void 0:a.lat:null==$||null==(x=$.receiver_details)?void 0:x.latitude,deliveryManLng:(null==$?void 0:$.order_status)==="picked_up"?null==$||null==(h=$.delivery_man)?void 0:h.lng:null==$||null==(b=$.receiver_details)?void 0:b.longitude,defaultControl:!0}),(0,i.jsx)(m.A,{position:"absolute",bottom:"-80px",width:"280px",left:{xs:"5%",sm:"8%",md:"16%"},children:(0,i.jsx)(o.WU,{padding:"10px",children:(0,i.jsxs)(o.jB,{spacing:1.5,direction:"row",alignItems:"center",pl:"10px",children:[(0,i.jsxs)(m.A,{children:[(0,i.jsx)(v.A,{style:{height:"20px",width:"16px"}}),(0,i.jsx)(K,{}),(0,i.jsx)(g.A,{style:{height:"20px",width:"16px"}})]}),(0,i.jsxs)(m.A,{spacing:1,children:[(0,i.jsxs)(m.A,{children:[(0,i.jsx)(p.A,{fontSize:"12px",color:w.palette.primary.main,children:(0,f.t)("Sender")}),(0,i.jsx)(p.A,{fontSize:"16px",children:null==$||null==(y=$.delivery_address)?void 0:y.contact_person_name}),(0,i.jsx)(p.A,{fontSize:"12px",color:w.palette.neutral[400],children:null==$||null==(M=$.delivery_address)?void 0:M.address})]}),(0,i.jsxs)(m.A,{children:[(0,i.jsx)(p.A,{fontSize:"12px",color:w.palette.primary.main,children:(0,f.t)("Receiver")}),(0,i.jsx)(p.A,{fontSize:"16px",children:null==$||null==(S=$.receiver_details)?void 0:S.contact_person_name}),(0,i.jsx)(p.A,{fontSize:"12px",color:w.palette.neutral[400],children:null==$||null==(_=$.receiver_details)?void 0:_.address}),"/profile"!==B.pathname&&(0,i.jsx)(s.A,{onClick:()=>{W((0,Y.iv)({contact_person_number:O})),B.push({pathname:"/profile",query:{orderId:null==$?void 0:$.id,page:"my-orders",phone:O}},void 0,{shallow:!0})},children:(0,f.t)("View Details")})]})]})]})})})]}),(0,i.jsx)(m.A,{mt:"100px",width:"100%",justifyContent:"center",pl:"50px",pr:"50px",mb:"20px",children:(0,i.jsx)(X,{steps:er,activeStep:U})}),(0,i.jsx)(j.A,{border:"1px"}),(0,i.jsxs)(o.jB,{justifyContent:"space-between",direction:"row",mt:"10px",children:[(0,i.jsx)(p.A,{fontWeight:"700",color:w.palette.primary.main,children:(0,f.t)("Total")}),(0,i.jsx)(p.A,{fontWeight:"700",color:w.palette.primary.main,children:(0,F.Yi)(null==$?void 0:$.order_amount)})]})]}),(null==$?void 0:$.delivery_man)&&(0,L.g)()&&(0,i.jsx)(R,{deliveryManInfo:null==$?void 0:$.delivery_man})]}),ee&&(0,i.jsx)(o.jB,{padding:"70px 24px 0px 24px",children:(0,i.jsx)(u.A,{variant:"rectangular",width:"100%",height:"350px"})}),!z&&Z&&(0,i.jsx)(o.jB,{padding:"100px 24px 0px 24px",children:(0,i.jsx)(J.A,{image:G,label:"Order not found",height:"100px",width:"100px"})})]})}}}]);