"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8801],{14247:(e,t,n)=>{n.d(t,{A:()=>p});var i=n(37876);n(14232);var l=n(64397),o=n(68421),r=n(9388),s=n(56557),a=n.n(s),d=n(74441);let p=e=>{let{value:t,handleDateChange:n,height:s,sx:p}=e;return(0,i.jsx)(o.$,{dateAdapter:l.R,children:(0,i.jsx)(r.K,{value:a()(t),minDateTime:a()().subtract(10,"minute"),className:"custom-date-picker",sx:{"& .MuiInputBase-root":{height:s||"auto"},"& .MuiSvgIcon-root":{color:e=>(0,d.X4)(e.palette.neutral[400],.5)},...p},timeSteps:{minutes:1},onChange:n,slotProps:{desktopPaper:{sx:{maxHeight:"45vh",overflowY:"auto"}}}})})}},19886:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(1992),l=n(64907),o=n(77165),r=n(60398);let s=async(e,t,n)=>{if(t){let{data:i}=await r.A.get("".concat(l.lI,"?origin_lat=").concat(null==e?void 0:e.lat,"&origin_lng=").concat(null==e?void 0:e.lng,"&destination_lat=").concat(t.lat?t.lat:null==t?void 0:t.latitude,"&destination_lng=").concat(t.lng?t.lng:null==t?void 0:t.longitude,"&mode=").concat(n||"WALK"));return i}};function a(e,t,n){return(0,i.useQuery)(["distance",e,t],()=>s(e,t,n),{enabled:!1,onError:o.P1})}},55785:(e,t,n)=>{n.d(t,{A:()=>k});var i=n(37876),l=n(14232),o=n(42224),r=n(58582),s=n(1912),a=n(74441),d=n(39467),p=n(66703),x=n(35003),c=n(80963),u=n(97481),h=n(48677),g=n(60999),m=n(7579),f=n(60795),j=n(38388),v=n(88409),A=n(45140),C=n(82),b=n(88687),w=n(66908),y=n(35502),L=n(39172),M=n(66807);let _=e=>{let{lat:t,lng:n,isSelected:l}=e;return(0,i.jsx)(j.A,{children:(0,i.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:l?"16":"12",height:l?"16":"12",viewBox:"0 0 12 12",fill:"none",style:{transition:"all 0.2s ease-in-out"},children:[(0,i.jsxs)("g",{clipPath:"url(#clip0_9510_31981)",children:[(0,i.jsx)("path",{d:"M3.00885 6.36475H2.4707C2.32953 6.36475 2.20209 6.44879 2.14624 6.57825L0.656494 10.0471L4.19446 8.24011C3.77094 7.65408 3.3519 7.00772 3.00885 6.36475Z",fill:"#152e6e"}),(0,i.jsx)("path",{d:"M9.85367 6.57825C9.79791 6.44879 9.67038 6.36475 9.5293 6.36475H8.99115C8.34332 7.57874 7.39951 8.83328 6.7991 9.5235C6.37686 10.0078 5.62265 10.0073 5.20105 9.5235C5.15793 9.47397 4.9328 9.21332 4.62271 8.8125L3.98486 9.13843L6.39764 11.5465L10.9694 9.17642L9.85367 6.57825Z",fill:"#152e6e"}),(0,i.jsx)("path",{d:"M0.221282 11.0611L0.0288379 11.5093C-0.0707715 11.7412 0.0998828 12.0002 0.353209 12.0002H5.53409C5.5665 11.9761 5.56686 11.9776 5.74081 11.8874L3.32446 9.47607L0.221282 11.0611Z",fill:"#152e6e"}),(0,i.jsx)("path",{d:"M11.9712 11.509L11.2483 9.82568L7.05444 11.9999H11.6468C11.8996 11.9999 12.071 11.7413 11.9712 11.509Z",fill:"#152e6e"}),(0,i.jsx)("path",{d:"M6.26639 9.03791C6.38522 8.9015 9.17639 5.6728 9.17639 3.45338C9.17639 -1.12316 2.82373 -1.17901 2.82373 3.45338C2.82373 5.6728 5.6149 8.9015 5.73373 9.03791C5.87445 9.19932 6.12595 9.19914 6.26639 9.03791ZM4.94125 3.17167C4.94125 2.58903 5.41623 2.11506 6.00006 2.11506C6.5838 2.11506 7.05878 2.58903 7.05878 3.17167C7.05878 3.75422 6.5838 4.22819 6.00006 4.22819C5.41623 4.22819 4.94125 3.75422 4.94125 3.17167Z",fill:"#152e6e"})]}),(0,i.jsx)("defs",{children:(0,i.jsx)("clipPath",{id:"clip0_9510_31981",children:(0,i.jsx)("rect",{width:"12",height:"12",fill:"white"})})})]})})};n(30941);var I=n(54427);let S=e=>{let{handleMouseDownRecentAddresses:t,recentlyAddress:n,fromHome:o,setOpenMap:s}=e,d=(0,p.A)(),{t:S}=(0,C.Bd)(),{refetch:k,data:T}=(0,b.A)(()=>{});(0,l.useEffect)(()=>{k()},[k]);let B=(e,n)=>{t(e,n)},{coords:O}=(0,M.L)({positionOptions:{enableHighAccuracy:!1},userDecisionTimeout:5e3,isGeolocationEnabled:!0}),{data:P,isFetching:R}=(0,I.A)({lat:null==O?void 0:O.latitude,lng:null==O?void 0:O.longitude}),z=null==n?void 0:n.filter((e,t,n)=>t===(null==n?void 0:n.findIndex(t=>t.location_name===e.location_name))&&(e.latitude&&e.longitude||e.lat&&e.lng)),Z=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&0!==e.length?e.map((e,n)=>(0,i.jsxs)(c.Ay,{sx:{padding:"5px 0px",cursor:"pointer",display:"grid",gridTemplateColumns:"28px auto 1fr",gap:"10px"},onClick:n=>{B(n,t?e:{address:null==e?void 0:e.location_name,latitude:(null==e?void 0:e.latitude)||(null==e?void 0:e.lat),longitude:(null==e?void 0:e.longitude)||(null==e?void 0:e.lng)})},children:[(0,i.jsx)(u.A,{sx:{border:"1px solid",borderColor:d.palette.neutral[300],padding:"5px",borderRadius:"5px",marginRight:"0px"},children:t&&(null==e?void 0:e.address_type)==="home"?(0,i.jsx)(w.A,{sx:{color:d.palette.neutral[400],fontSize:"16px"}}):t?(0,i.jsx)(A.A,{sx:{color:d.palette.neutral[400],fontSize:"16px"}}):(0,i.jsx)(v.A,{sx:{color:d.palette.neutral[400],fontSize:"18px"}})}),(0,i.jsx)(h.A,{sx:{".MuiTypography-root":{fontSize:"12px !important",textTransform:"capitalize"}},primary:t?null==e?void 0:e.address_type:null==e?void 0:e.location_name}),t&&(0,i.jsx)(h.A,{sx:{".MuiTypography-root":{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontSize:"12px !important",color:d.palette.neutral[400]}},primary:null==e?void 0:e.address})]},n)):(0,i.jsx)(x.A,{variant:"body2",color:"text.secondary",sx:{padding:"10px"},children:S(t?"No saved addresses found.":"No recent address found.")})};return(0,i.jsxs)(r.A,{sx:{borderRadius:"0 0 4px 4px",padding:"16px",boxShadow:"0px 2px 5px 0px rgba(71, 71, 71, 0.07)",top:"10px",zIndex:99999,position:"absolute",width:"100%",maxHeight:"35vh",overflowY:"auto"},children:[(0,i.jsx)(x.A,{fontSize:"12px",fontWeight:"500",color:"text.secondary",children:S("Recent address")}),(0,i.jsx)(g.A,{sx:{marginTop:"10px",padding:0,marginBottom:"10px"},children:Z(z)}),(0,y.g)()&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(m.A,{sx:{marginTop:"10px"}}),(0,i.jsx)(x.A,{fontSize:"12px",fontWeight:"500",color:"text.secondary",sx:{marginTop:"10px"},children:S("My address")}),(0,i.jsx)(g.A,{sx:{marginTop:"10px",padding:0},children:Z((null==T?void 0:T.addresses)||[],!0)})]}),o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(m.A,{sx:{marginTop:"10px"}}),(0,i.jsxs)(f.A,{onClick:()=>s(!0),flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:"10px",mt:1.5,sx:{cursor:"pointer"},children:[(0,i.jsx)(j.A,{sx:{border:"1px solid ",borderRadius:"8px",padding:"5px 10px 5px 10px",borderColor:(0,a.X4)(d.palette.neutral[400],.3)},children:(0,i.jsx)(_,{})}),(0,i.jsx)(x.A,{fontWeight:600,color:d.palette.primary.main,children:S("Location From Map")})]})]}),(0,i.jsxs)(f.A,{onClick:e=>{var t;B(e,{latitude:null==O?void 0:O.latitude,longitude:null==O?void 0:O.longitude,address:null==(t=P.results[0])?void 0:t.formatted_address,isCurrent:"current"})},flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:"10px",mt:1,sx:{cursor:"pointer"},children:[(0,i.jsx)(j.A,{sx:{border:"1px solid ",borderRadius:"8px",padding:"5px 5px 0px 5px",borderColor:(0,a.X4)(d.palette.neutral[400],.3)},children:(0,i.jsx)(L.A,{sx:{color:d.palette.primary.main}})}),(0,i.jsx)(x.A,{fontWeight:600,color:d.palette.primary.main,children:S("Use Current Location")})]})]})},k=e=>{let t,{HandleChangeForSearch:n,predictions:p,handleChange:x,label:c,onFocus:u,value:h,endIcon:g,pickLocationFormAddress:m,height:f="45px",width:j=350,result:v,getCurrentLocation:A,fromHome:C,setOpenMap:b,focusedField:w}=e,[y,L]=(0,l.useState)(!1),M=(0,l.useRef)(null);(0,l.useEffect)(()=>()=>{M.current&&clearTimeout(M.current)},[]);let _=(e,t)=>{e.stopPropagation(),(null==t?void 0:t.isCurrent)==="current"?null==A||A(t):t&&(null==m||m(t),L(!1))};return t=JSON.parse(localStorage.getItem("destination_location")),(0,i.jsx)(o.A,{fullWidth:!0,disabled:!1===v,defaultValue:(null==h?void 0:h.description)||[],value:h||[],options:p||[],getOptionLabel:e=>e.description||"",onChange:(e,t)=>x(e,t),isOptionEqualToValue:(e,t)=>e.description===(null==t?void 0:t.description),clearOnBlur:!1,open:y,onOpen:()=>L(!0),onClose:(e,t)=>{(null==h?void 0:h.description)&&L(!1)},sx:{width:j,maxWidth:"100%"},PaperComponent:e=>(0,i.jsx)(i.Fragment,{children:(null==h?void 0:h.description)||"destination"!==w?(0,i.jsx)(r.A,{sx:{borderRadius:"0 0 4px 4px"},...e}):(0,i.jsx)("div",{children:(0,i.jsx)(S,{pickLocationFormAddress:m,handleMouseDownRecentAddresses:_,recentlyAddress:t,fromHome:C,setOpenMap:b})})}),renderInput:e=>(0,i.jsx)(s.A,{...e,onFocus:u,label:c,placeholder:c,onChange:e=>n(e),onBlur:()=>{M.current=setTimeout(()=>{L(!1)},300)},sx:{"& .MuiOutlinedInput-root":{height:f,padding:"5.5px 4px 7.5px 6px",paddingRight:"10px !important","& fieldset":{border:"1px solid ".concat(e=>e.palette.neutral[300])},"&:hover fieldset":{borderColor:"#888"},"&.Mui-focused fieldset":{border:"1px solid",borderColor:e=>(0,a.X4)(e.palette.primary.main,.4)}},"& .MuiInputLabel-root":{padding:"0 4px",transform:"translate(14px, -6px) scale(0.75)"}},InputProps:{...e.InputProps,endAdornment:g?(0,i.jsx)(d.A,{position:"end",children:g}):null},InputLabelProps:{shrink:!0}})})}},90092:(e,t,n)=>{n.d(t,{A:()=>u});var i=n(37876);n(14232);var l=n(87701),o=n(80553),r=n(35003),s=n(67906),a=n(84812),d=n(16226),p=n(97914),x=n(28343);let c=()=>(0,i.jsxs)("svg",{width:"78",height:"78",viewBox:"0 0 78 78",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("path",{d:"M52.9187 19.3625C49.3843 15.7672 44.6921 14 39.9999 14C35.3077 14 30.6155 15.7672 27.0812 19.3625C19.9515 26.4922 19.9515 38.0703 27.0812 45.2L39.9999 57.875L52.9187 45.2C60.0483 38.0703 60.0483 26.4922 52.9187 19.3625Z",fill:"#99A3AB",fillOpacity:"0.5"}),(0,i.jsx)("path",{d:"M39.9999 38.8016C43.7019 38.8016 46.703 35.8005 46.703 32.0984C46.703 28.3964 43.7019 25.3953 39.9999 25.3953C36.2978 25.3953 33.2968 28.3964 33.2968 32.0984C33.2968 35.8005 36.2978 38.8016 39.9999 38.8016Z",fill:"white"}),(0,i.jsx)("path",{d:"M18.9999 16.3245L55.5134 52.8379L56.8066 51.5447L20.2932 15.0312C20.4933 16.0849 20.0536 16.5246 18.9999 16.3245Z",fill:"#99A3AB"}),(0,i.jsx)("ellipse",{cx:"38.5",cy:"61.5312",rx:"16.5",ry:"1.5",fill:"#99A3AB",fillOpacity:"0.4"})]}),u=e=>{let{handleCloseLocation:t,openLocation:n,isGeolocationEnabled:u}=e;return(0,i.jsxs)(l.A,{open:n,onClose:t,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[(0,i.jsx)(o.A,{children:!u&&(0,i.jsxs)(x.jB,{gap:"10px",alignItems:"center",maxWidth:"500px",textAlign:"center",padding:{xs:"0 10px",sm:"0 40px",md:"0 60px"},children:[(0,i.jsx)(c,{}),(0,i.jsx)(r.A,{fontSize:{xs:"14px",sm:"16px",md:"18px"},fontWeight:500,children:(0,p.t)("Please allow browser location permission")}),(0,i.jsx)(d.JZ,{children:(0,p.t)("Your browser location track permission is off. Please turn on the location permission to detect current location")})]})}),(0,i.jsx)(s.A,{children:(0,i.jsx)(x.jB,{direction:"row",alignItems:"center",justifyContent:"center",spacing:2,paddingBottom:"35px",children:(0,i.jsx)(a.A,{onClick:()=>t(),variant:"contained",children:(0,p.t)("Okay")})})})]})}}}]);