1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6024],{88565:function(e,i,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/extend-rides",function(){return t(24279)}])},30888:function(e,i,t){"use strict";t.d(i,{Z:function(){return global_SlideUpPanel}});var l=t(85893),s=t(73074),d=t(54923),r=t(9228),n=t(61730),a=t(98814),o=t(41352),c=t(67294),u=t(44176),m=t(53798);let Drawer=e=>{let{shouldScaleBackground:i=!0,...t}=e;return(0,l.jsx)(m.d.Root,{shouldScaleBackground:i,...t})};Drawer.displayName="Drawer";let v=m.d.Trigger,f=m.d.Portal,p=m.d.Close,x=c.forwardRef((e,i)=>{let{className:t,...d}=e;return(0,l.jsx)(m.d.Overlay,{ref:i,className:(0,s.cn)("fixed inset-0 z-50 bg-black/80",t),...d})});x.displayName=m.d.Overlay.displayName;let h=c.forwardRef((e,i)=>{let{className:t,children:d,...r}=e;return(0,l.jsxs)(f,{children:[(0,l.jsx)(x,{}),(0,l.jsxs)(m.d.Content,{ref:i,className:(0,s.cn)("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",t),...r,children:[(0,l.jsx)("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),d]})]})});h.displayName="DrawerContent";let DrawerHeader=e=>{let{className:i,...t}=e;return(0,l.jsx)("div",{className:(0,s.cn)("grid gap-1.5 p-4 text-center sm:text-left",i),...t})};DrawerHeader.displayName="DrawerHeader";let DrawerFooter=e=>{let{className:i,...t}=e;return(0,l.jsx)("div",{className:(0,s.cn)("mt-auto flex flex-col gap-2 p-4",i),...t})};DrawerFooter.displayName="DrawerFooter";let g=c.forwardRef((e,i)=>{let{className:t,...d}=e;return(0,l.jsx)(m.d.Title,{ref:i,className:(0,s.cn)("text-lg font-semibold leading-none tracking-tight",t),...d})});g.displayName=m.d.Title.displayName;let j=c.forwardRef((e,i)=>{let{className:t,...d}=e;return(0,l.jsx)(m.d.Description,{ref:i,className:(0,s.cn)("text-sm text-muted-foreground",t),...d})});j.displayName=m.d.Description.displayName;var N=t(60802),w=t(12854),global_SlideUpPanel=e=>{let{open:i,disabled:t=!1,trigger:c,title:m,description:f,content:x,footerAction:b,footerClose:D,contentClassName:k,headerClassName:y,showBackButton:S,disableClose:R=!1,disableAutoFocus:F=!1,showDialog:I=!1,onBack:M,onOpenChange:Z}=e,C=(0,n.Z)(r.r.breakpoints.up("sm"));return(0,d.U)(),C||I?(0,l.jsxs)(u.Vq,{open:!t&&i,onOpenChange:R?void 0:Z,children:[c&&(0,l.jsx)(u.hg,{className:(0,s.cn)(t&&"cursor-not-allowed","w-full"),children:c}),(0,l.jsxs)(u.cZ,{className:(0,s.cn)("sm:max-w-[425px] items-start",k),disableClose:R,onOpenAutoFocus:F?e=>e.preventDefault():void 0,children:[(0,l.jsxs)(u.fK,{className:(0,s.cn)(y),children:[(0,l.jsx)(u.$N,{children:m}),f&&(0,l.jsx)(u.Be,{children:f})]}),x,b&&(0,l.jsx)(u.cN,{children:b}),D&&(0,l.jsx)("div",{className:"flex sm:justify-end",children:(0,l.jsx)(w.GG,{children:D})})]})]}):(0,l.jsxs)(Drawer,{open:i,onOpenChange:R?void 0:Z,children:[c&&(0,l.jsx)(v,{className:"w-full",onClick:e=>e.stopPropagation(),children:c}),(0,l.jsxs)(h,{onOpenAutoFocus:F?e=>e.preventDefault():void 0,children:[(0,l.jsxs)(DrawerHeader,{children:[(0,l.jsx)(g,{children:(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)(N.z,{variant:"ghost",size:"icon",onClick:M,className:(0,s.cn)("absolute top-1 left-1 invisible rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",S&&"visible"),children:[(0,l.jsx)(a.Z,{}),(0,l.jsx)("span",{className:"sr-only",children:"Back"})]}),(0,l.jsx)("div",{className:"text-center flex-grow",children:m}),(0,l.jsx)(p,{children:(0,l.jsxs)(N.z,{variant:"ghost",size:"icon",className:(0,s.cn)("absolute top-1 right-1 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",R&&"hidden"),children:[(0,l.jsx)(o.Z,{}),(0,l.jsx)("span",{className:"sr-only",children:"Close"})]})})]})}),f&&(0,l.jsx)(j,{children:f})]}),x,b&&(0,l.jsx)(DrawerFooter,{children:b}),D&&(0,l.jsx)(p,{className:"pb-4 px-4",children:D})]})]})}},1666:function(e,i,t){"use strict";var l=t(85893),s=t(44176),d=t(78193),r=t(98456),n=t(56989),a=t(27484),o=t.n(a),c=t(90512);i.Z=e=>{var i,t,a,u,m,v,f;
1let{pricings:p,riders:x,dates:h,showDetails:g=!0,finalPriceIncludesTollCharges:j=!1,showEstimatedTollCharges:N=!0,showTollCharges:w=!0}=e,{data:b,isLoading:D,refetch:k}=(0,d.p)(!1),y=(()=>{if(!(null==h?void 0:h.length))return"";let e=h.length;if(1===e)return"1 ride on ".concat(o()(h[0]).format("MMM DD"));let i=[...h].sort((e,i)=>o()(e).diff(o()(i)));return"".concat(e," rides from ").concat(o()(i[0]).format("MMM DD")," to ").concat(o()(i[i.length-1]).format("MMM DD"))})(),S=[...p].sort((e,i)=>{var t,l;return(null!==(t=i.finalRidePrice)&&void 0!==t?t:0)-(null!==(l=e.finalRidePrice)&&void 0!==l?l:0)})[0],R=[...p].sort((e,i)=>{var t,l;return(null!==(t=e.finalRidePrice)&&void 0!==t?t:0)-(null!==(l=i.finalRidePrice)&&void 0!==l?l:0)})[0],F=x.length>1?x.length-1:0,I=(null!==(u=null==S?void 0:S.finalRidePrice)&&void 0!==u?u:0)+F*(null!==(m=null==R?void 0:R.finalRidePrice)&&void 0!==m?m:0),M=null!==(f=null!==(v=null==p?void 0:null===(t=p[0])||void 0===t?void 0:null===(i=t.tollInfo)||void 0===i?void 0:i.estimatedPrice)&&void 0!==v?v:null==p?void 0:null===(a=p[0])||void 0===a?void 0:a.tollCharges)&&void 0!==f?f:null;console.log("tollNote",M);let lineItemValue=(e,i)=>{let t=0;return null==i||i.forEach(i=>{i.title===e&&i.entries.forEach(e=>t+=e.value||0)}),t};return(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[null==p?void 0:p.map((e,i)=>{var t;let d=e.adjustment||0,a=(null!==(t=e.calculatedRidePrice)&&void 0!==t?t:0)+(d>0?d:0),o=lineItemValue("Discount",e.lineItems)+(d<0?d:0),u=(null==e?void 0:e.tollCharges)||0,m=e.finalRidePrice;return!(w&&!N)&&j&&u&&(m=(m-u).toFixed(2)),(0,l.jsxs)("div",{className:(0,c.Z)("flex flex-col gap-3",(null==h?void 0:h.length)&&"border-b pb-4"),children:[p.length>1&&(0,l.jsx)("div",{className:"font-medium text-sm",children:0===i?"First rider":"Additional rider"}),(0,l.jsxs)("div",{className:"flex justify-between text-sm text-muted-foreground",children:[(0,l.jsx)("span",{children:"Ride price"}),(0,l.jsxs)("span",{children:["$",a.toFixed(2)]})]}),!!o&&(0,l.jsxs)("div",{className:"flex justify-between text-sm text-muted-foreground",children:[(0,l.jsx)("span",{children:"Discount"}),(0,l.jsxs)("span",{children:["$",o.toFixed(2)]})]}),!!lineItemValue("Service Fee",e.lineItems)&&(0,l.jsxs)("div",{className:"flex justify-between text-sm text-muted-foreground",children:[(0,l.jsxs)("div",{className:"flex items-center gap-1",children:["Service fee",(0,l.jsxs)(s.Vq,{onOpenChange:e=>e&&k(),children:[(0,l.jsx)(s.hg,{asChild:!0,children:(0,l.jsx)(n.Z,{size:14,className:"text-darkGray cursor-pointer"})}),(0,l.jsxs)(s.cZ,{children:[(0,l.jsx)(s.fK,{children:(0,l.jsx)(s.$N,{children:"Service Fee"})}),D?(0,l.jsx)("div",{className:"text-center py-4",children:(0,l.jsx)(r.Z,{size:20})}):(0,l.jsx)("div",{className:"text-sm",children:null==b?void 0:b.serviceFee})]})]})]}),(0,l.jsxs)("span",{children:["$",lineItemValue("Service Fee",e.lineItems).toFixed(2)]})]}),!!w&&!!u&&!N&&(0,l.jsxs)("div",{className:"flex justify-between text-sm text-muted-foreground",children:[(0,l.jsx)("span",{children:"Toll Charges"}),(0,l.jsxs)("span",{children:["$",u.toFixed(2)]})]}),(0,l.jsxs)("div",{className:"flex justify-between text-sm font-medium",children:[(0,l.jsx)("span",{children:"Total"}),(0,l.jsxs)("span",{children:["$",m]}
1)]})]},i)}),!!(null==h?void 0:h.length)&&(0,l.jsxs)("div",{className:"text-sm leading-5",children:["For ",y,", you will be paying"," ",(0,l.jsxs)("span",{className:"font-semibold text-primary",children:["$",(h.length*I).toFixed(2)]})]}),!!w&&!!N&&(!!(null==M?void 0:M.length)||!!M)&&(0,l.jsxs)("div",{className:"text-sm font-light",children:["Estimated toll ",M?"of $".concat(M.toFixed(2)):""," will be additionally applied to each ride."]})]})}},27564:function(e,i,t){"use strict";t.d(i,{J2:function(){return n},xo:function(){return a},yk:function(){return o}});var l=t(85893),s=t(67294),d=t(86419),r=t(73074);let n=d.fC,a=d.xz,o=s.forwardRef((e,i)=>{let{className:t,align:s="center",sideOffset:n=4,...a}=e;return(0,l.jsx)(d.VY,{ref:i,align:s,sideOffset:n,className:(0,r.cn)("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...a})});o.displayName=d.VY.displayName},24279:function(e,i,t){"use strict";t.r(i),t.d(i,{default:function(){return extend_rides}});var l=t(85893),s=t(6783),d=t(60802),r=t(13474),n=t(73074),a=t(76235),o=t(20567),c=t(65958),u=t(37957),m=t(54923),v=t(48228),f=t(92311);let p=["extend-ride"],useExtendRide=()=>(0,v.D)(p,e=>f.Z.extendRide(e));var x=t(23577),h=t(90015),g=t(19680),j=t(78193),N=t(11689),w=t(32874),b=t(72269),D=t(27123),k=t(54539),y=t(9228),S=t(36599),R=t(36270),F=t(9601),I=t(51221),M=t(72162),Z=t(61730),C=t(98456),E=t(9526),P=t(27484),T=t.n(P),_=t(70178),z=t.n(_),q=t(50316),L=t(54976),A=t(11163),O=t(67294),$=t(4480),H=t(89128),V=t.n(H),Y=t(35526),B=t(1666),U=t(63964),G=t(74302),K=t(30888),J=t(29387),W=t.n(J);T().extend(z()),T().extend(W());var extend_rides_ExtendRideForm=()=>{var e,i,t,s,v,f,p,P,_,z,H,J,W,X,Q,ee,ei,et,el,es,ed,er,en,ea,eo,ec,eu,em;let[ev,ef]=(0,O.useState)(!1),[ep,ex]=(0,O.useState)([]),[eh,eg]=(0,O.useState)(!1),[ej,eN]=(0,O.useState)([]),[ew,eb]=(0,O.useState)({0:new Set([]),1:new Set([]),2:new Set([]),3:new Set([]),4:new Set([]),5:new Set([]),6:new Set([]),7:new Set([]),8:new Set([]),9:new Set([]),10:new Set([]),11:new Set([])}),[eD,ek]=(0,O.useState)(!1),[ey,eS]=(0,O.useState)(null),[eR,eF]=(0,O.useState)(!1),eI=(0,$.sJ)(a.SK),eM=(0,$.Zl)(a.$3),[eZ,eC]=(0,$.FV)(a.aM),eE=(0,$.rb)(a.aM),eP=(0,Z.Z)(y.r.breakpoints.up("md")),eT=(0,m.U)(),e_=(0,A.useRouter)(),{toast:ez}=(0,r.pm)(),{data:eq}=(0,N.A)();(0,O.useEffect)(()=>{eI.length&&eN(eI)},[eI]);let{data:eL}=(0,j.p)(!1),{data:{pricing:eA}={pricing:[],abandonLogIds:[],firstWeekCharge:0},mutate:eO,isLoading:e$}=(0,w.d)(),{mutate:eH,isLoading:eV}=useExtendRide(),{data:eY,mutate:eB,isLoading:eU}=(0,x.G)(null!==(em=null==eZ?void 0:null===(i=eZ.riders)||void 0===i?void 0:null===(e=i[0])||void 0===e?void 0:e.requestId)&&void 0!==em?em:0),{mutate:eG}=(0,D._)(),{data:eK}=(0,b.p)(),{data:eJ}=(0,g.j)(),{data:eW,refetch:eX,isFetching:eQ}=(0,h.T)(),{mutate:e0,isLoading:e1}=(0,k.E)(),e2=(0,O.useMemo)(()=>null==eW?void 0:eW.find(e=>e.defaultPaymentMethod),[eW]),getFormattedRequests=async()=>{eg(!0);let e=[],i=!1;for(let c=0;c<eZ.riders.length;c++){var t,l,s,d,r,n,a,o;i=!1;let m=eZ.riders[c];if(console.log("PUSHING",m,eZ),(null===(t=m.pickup)||void 0===t?void 0:t.address)&&(null===(l=m.dropoff)||void 0===l?void 0:l.address)){i=!0;let t=V()(null===(s=m.pickup)||void 0===s?void 0:s.lat,null===(d=m.pickup)||void 0===d?void 0:d.lng),l=T()("".concat(T()().format("YYYY-MM-DD")," ").concat(m.pickupTime),"YYYY-MM-DD HH:mm:ss");(null===(n=m.ride)||void 0===n?void 0:null===(r=n.priceBreakdown)||void 0===r?void 0:r.tollCharges)&&eS(m.ride.priceBreakdown.tollCharges);let c=m.dates.map(e=>T()(e).set("h",l.get("h")).set("m",l.get("m")).set("s",0).set("ms",0).local().format());e.push({...m,timezone:t,localTime:m.pickupTime,pickup:{...m.pickup,uploadedImage:await (0,u.V)(m.pickup.uploadedImage)},dropoff:{...m.dropoff,uploadedImage:await (0,u.V)(m.dropoff.uploadedImage)},weekdays:null,dates:c,time:l.format("HH:mm:ss"),utcTime:l.utc().format("HH:mm:ss"),type:"pickup",signIn:Number(m.signIn),signOut:Number(m.signOut),distance:m.distance,lowerDuration:null===(a=m.ride)||void 0===a?void 0:a.lowerDuration,upperDuration:null===(o=m.ride)||void 0===o?void 0:o.upperDuration})}else break}return ex(e),eg(!1),[e,i]},handleSubmitRequest=async()=>{var e,i,t,l,s,d,r;if(!ej.length){ez({description:"Please select at least 1 date",variant:"destructive"}),ek(!0);return}if((null==eZ?void 0:null===(e=eZ.riders[0])||void 0===e?void 0:e.pickupTime)&&(null==ep?void 0:null===(i=ep[0])||void 0===i?void 0:i.distance)){ef(!0);let e=V()(null===(l=eZ.riders[0].ride)||void 0===l?void 0:null===(t=l.pickup)||void 0===t?void 0:t.lat,null===(d=eZ.r
1iders[0].ride)||void 0===d?void 0:null===(s=d.pickup)||void 0===s?void 0:s.lng),i=null===(r=eZ.riders[0])||void 0===r?void 0:r.pickupTime;eH({rides:ep.map(e=>{var i;return{rideId:null===(i=e.ride)||void 0===i?void 0:i.rideId,lowerDuration:e.lowerDuration,upperDuration:e.upperDuration,distance:e.distance}}),rideExtensions:ej.map(t=>({localDate:T()(t).format("YYYY-MM-DD"),localTime:i,timezone:e}))},{onSuccess:()=>{var e;eM(eZ.riders[0].ride.rideId),e_.push(o.NU.RIDES),ez({description:"Successfully added new rides"});let i=null==eK?void 0:null===(e=eK.statusMessage.find(e=>300===e.status))||void 0===e?void 0:e.message,t=eZ.riders.map(e=>{var t,l,s,d,r;return{userId:null==e?void 0:null===(t=e.rider)||void 0===t?void 0:t.userId,message:null!==(r=null==i?void 0:null===(d=i.replace("${customer}",eJ.fullName))||void 0===d?void 0:null===(s=d.replace("${rider}",e.rider.fullName))||void 0===s?void 0:null===(l=s.replace(/\s*\$\{[^}]+\}\s*/g,""))||void 0===l?void 0:l.trim())&&void 0!==r?r:""}});eG({messages:t})},onError:e=>{console.log(e),ez({description:"Something went wrong. Please try again",variant:"destructive"})},onSettled:()=>ef(!1)})}},handleNewRequestPricing=async()=>{let[e,i]=await getFormattedRequests();i&&eO({requests:e.map(e=>({color:e.color,dates:e.dates,localDates:e.localDates,localTime:e.localTime,distance:e.distance,pickup:e.pickup,dropoff:e.dropoff,rider:e.rider,signIn:e.signIn,signOut:e.signOut,time:e.time,timezone:e.timezone,type:e.type,utcTime:e.utcTime,lowerDuration:e.lowerDuration,upperDuration:e.upperDuration,adjustment:0,timeAdjustment:0})),fetchTimeItems:!1},{onError:e=>{ez({description:"Something went wrong. Please try again",variant:"destructive"}),e_.back()}})};return(0,O.useEffect)(()=>(console.log("NEW REq",eZ),eB(),()=>{eE()}),[]),(0,O.useEffect)(()=>{handleNewRequestPricing()},[eZ]),(0,O.useEffect)(()=>{ej.length&&ek(!1)},[ej]),(0,l.jsxs)("div",{className:(0,n.cn)("p-4 w-full md:p-8 md:flex flex-col col-span-5 h-[calc(75vh-112px)] md:h-[calc(75vh-80px)] xl:h-full overflow-scroll",eT&&"h-[calc(75vh-145px)]"),children:[(0,l.jsxs)("div",{className:"text-xl",children:["Add ride",eZ.riders.length>1&&"s"," for"," ",(0,c.t)(eZ.riders.map(e=>{var i;return null===(i=e.rider)||void 0===i?void 0:i.fullName}))," ",(0,l.jsxs)("span",{className:"text-sm",children:["(Original rides from"," ",T()(null===(t=eZ.riders[0])||void 0===t?void 0:t.dateFrom).local().format("MMM DD")," to"," ",T()(null===(s=eZ.riders[0])||void 0===s?void 0:s.dateTo).local().format("MMM DD"),")"]})]}),eU||eh?(0,l.jsx)("div",{className:"flex items-center justify-center mt-8",children:(0,l.jsx)(C.Z,{})}):(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"text-sm text-muted-foreground mt-1 mb-4",children:["Selected date",ej.length>1&&"s"," for the new rides"]}),(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)("div",{className:(0,n.cn)(eP?"flex-1":"w-full"),children:(0,l.jsx)(Y.Z,{fromDate:Math.abs(T()().diff(T()(eZ.riders[0].dateFrom).local(),"h"))>24?T()().isBefore(T()(eZ.riders[0].dateFrom).local())?T()(eZ.riders[0].dateFrom).local().toDate():T()().toDate():T()().isBefore(T()(eZ.riders[0].dateFrom).local())?T()(eZ.riders[0].dateFrom).local().add(1,"d").toDate():T()().add(1,"d").toDate(),toDate:T()(eZ.riders[0].dateTo).local().add(Number(null==eq?void 0:eq["max-future-date"]),"d").toDate(),selected:ej,selectedDays:ew,setSelected:eN,disabled:e=>{let i=null==eq?void 0:eq.blockRideCalendarFrom,t=null==eq?void 0:eq.blockRideCalendarTo,l=T()(e);return!!(l.isAfter(T()(i),"date")&&l.isBefore(T()(t),"date"))||null==eY||!eY.length||!!eY.find(i=>T()(e).isSame(T()(i.date),"D"))},className:(0,n.cn)("pointer-events-none cursor-not-allowed text-muted-foreground",eD&&"border-destructive")}
1)}),(0,l.jsxs)(S.Z,{className:"px-2.5 -mb-4",children:[(0,l.jsxs)(R.Z,{className:"before:hidden",children:[(0,l.jsxs)(F.Z,{children:[(0,l.jsx)(q.Z,{className:"stroke-primary",size:16}),(0,l.jsx)(I.Z,{className:"bg-gradient-to-b from-primary to-orange"})]}),(0,l.jsxs)(M.Z,{className:"py-0 pr-0 ml-2",children:[(0,l.jsxs)("div",{className:"w-full flex items-center gap-1",children:[(0,l.jsx)("div",{className:"max-w-[70vw] overflow-hidden whitespace-nowrap text-ellipsis",children:"Pickup at"}),(null===(f=eZ.riders[0])||void 0===f?void 0:null===(v=f.ride)||void 0===v?void 0:v.pickupTime)&&T()().set("h",parseInt(null===(P=eZ.riders[0])||void 0===P?void 0:null===(p=P.ride)||void 0===p?void 0:p.pickupTime.slice(0,2))).set("m",parseInt(null===(z=eZ.riders[0])||void 0===z?void 0:null===(_=z.ride)||void 0===_?void 0:_.pickupTime.slice(3,5))).format("hh:mm A")]}),(0,l.jsx)("div",{className:"text-sm font-light",children:null===(W=eZ.riders[0])||void 0===W?void 0:null===(J=W.ride)||void 0===J?void 0:null===(H=J.pickup)||void 0===H?void 0:H.address})]})]}),(0,l.jsxs)(R.Z,{className:"before:hidden flex-none",children:[(0,l.jsx)(L.Z,{className:"stroke-orange",size:16}),(0,l.jsxs)(M.Z,{className:"py-0 pr-0 ml-2",children:[(0,l.jsx)("div",{className:"flex items-center gap-1",children:(0,l.jsx)("div",{className:"max-w-[70vw] overflow-hidden whitespace-nowrap text-ellipsis",children:(0,l.jsxs)("div",{className:"flex items-center gap-x-2",children:["Dropoff"," ",e$?(0,l.jsx)(E.Z,{className:"w-[40px] h-10"}):!!(null===(X=ep[0])||void 0===X?void 0:X.upperDuration)&&"at ".concat((null===(ee=eZ.riders[0])||void 0===ee?void 0:null===(Q=ee.ride)||void 0===Q?void 0:Q.pickupTime)&&(null===(ei=ep[0])||void 0===ei?void 0:ei.upperDuration)&&T()().set("h",parseInt(null===(el=eZ.riders[0])||void 0===el?void 0:null===(et=el.ride)||void 0===et?void 0:et.pickupTime.slice(0,2))).set("m",parseInt(null===(er=eZ.riders[0])||void 0===er?void 0:null===(ed=er.ride)||void 0===ed?void 0:null===(es=ed.pickupTime)||void 0===es?void 0:es.slice(3,5))).add(null===(en=ep[0])||void 0===en?void 0:en.upperDuration,"m").format("hh:mm A"))]})})}),(0,l.jsx)("div",{className:"text-sm font-light",children:null===(ec=eZ.riders[0])||void 0===ec?void 0:null===(eo=ec.ride)||void 0===eo?void 0:null===(ea=eo.dropoff)||void 0===ea?void 0:ea.address})]})]})]}),e$?(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)(E.Z,{className:"w-1/2 h-10"}),(0,l.jsx)(E.Z,{className:"w-1/4 h-10"})]}):!!(null==eA?void 0:eA.length)&&(null===(eu=eA[0])||void 0===eu?void 0:eu.finalRidePrice)&&(0,l.jsx)(B.Z,{pricings:eA,riders:eZ.riders,dates:ej}),!!(null==eA?void 0:eA.length)&&!!ey&&(0,l.jsxs)("div",{className:"text-sm font-light",children:["Estimated toll of $",ey.toFixed(2)," will be applied to the ride."]}),!!(null==eA?void 0:eA.length)&&(null==eL?void 0:eL.requestCreation)&&(0,l.jsxs)("div",{className:"text-sm font-light",children:["Note: ",null==eL?void 0:eL.requestCreation]}),!!(null==eA?void 0:eA.length)&&e2&&(0,l.jsx)(U.Z,{paymentMethod:e2}),(0,l.jsxs)("div",{className:"flex flex-col-reverse md:flex-row gap-4",children:[(0,l.jsx)(d.z,{className:"flex-1",variant:"secondary",onClick:()=>e_.replace(o.NU.RIDES),children:"Back"}),(0,l.jsx)(d.z,{className:"flex-1",onClick:()=>{e2?handleSubmitRequest():eF(!0)},loading:ev||eQ,disabled:e$||eQ,children:e2?"Submit":"Add Payment Method"})]})]})]}),(0,l.jsx)(K.Z,{contentClassName:"sm:max-w-[467px]",open:eR,onOpenChange:eF,title:"Add Payment Method",content:(0,l.jsx)("div",{className:"p-4 max-h-[75dvh] overflow-x-clip overflow-y-auto md:p-0 md:h-fit",children:(0,l.jsx)(G.Z,{onSuccess:e=>{e0(e),eF(!1),eX()}})})})]})},X=t(20488),extend_rides=()=>{let[e,i]=(0,O.useState)([]),[t,d]=(0,O.useState)(!0),[r,n]=(0,$.FV)(a.aM),c=(0,A.useRouter)(),u=(0,O.useMemo)(()=>{var e,i,t,l,s,d;if(!(null===(t=window.google)||void 0===t?void 0:null===(i=t.maps)||void 0===i?void 0:null===(e=i.geometry)||void 0===e?void 0:e.encoding))return[];let n=null===(s=r.riders[0])||void 0===s?void 0:null===(l=s.ride)||void 0===l?void 0:l.suggestedPolyline;return n?[{path:window.google.maps.geometry.encoding.decodePath(n),color:null===(d=r.riders[0])||void 0===d?void 0:d.color}]:[]},[r.riders[0]]),generateIcon=e=>(0,l.jsxs)(X.qE,{title:"".concat(e.fullName,"'s image"),className:"w-8 h-8 border border-black",children:[(0,l.jsx)(X.F$,{src:e.photoLinkPath,alt:"".concat(e.fullName,"'s image")}),(0,l.jsx)(X.Q5,{className:"uppercase",children:e.fullName.split(" ").reduce((e,i)=>e+i[0],"")})]}),generateInfo=(e,i)=>{var t,s;return(0,l.jsxs)(l.Fragment,{children:[!!i&&"pickup"===e&&(0,l.jsxs)("div",{className:"text-sm font-semibold",children:[(0,l.jsx)("span",{className:"capitalize",children:e})," at"," ",T()(i.ride.pickupTime,"HH:mm:ss").format("h:mm A")]}),!!i&&"dropoff"===e&&(0,l.jsx)("div",{className:"text-sm font-semibold",children:(0,l.jsx)("span",{className:"capitalize",children:e})}),r.riders.map((e,i)=>(0,l.jsx)("div",{children:(0,l.jsx)("div",{className:"space-y-1",children:(0,l.jsx)("div",{className:"text-sm font-semibold",children:e.rider.fullName})})},i)),(0,l.jsx)("div",{className:"text-sm mt-2",children:"pickup"===e?null===(t=i.pickup)||void 0===t?void 0:t.address:null===(s=i.dropoff)||void 0===s?void 0:s.address})]})},markLocations=async()=>{let e=Array(2*r.riders.length).fill(void 0);for(let i=0;i<r.riders.length;i++){var t,l,s,d;if(r.riders[i].pickup&&(null===(t=r.riders[i].pickup)||void 0===t?void 0:t.lat)&&(null===(l=r.riders[i].pickup)||void 0===l?void 0:l.lng)){let t=new window.google.maps.LatLng(r.riders[i].pickup.lat,r.riders[i].pickup.lng);e[2*i]={latLng:t,rider:r.riders[i].rider,icon:generateIcon(r.riders[i].rider),info:generateInfo("pickup",r.riders[i])}}if(r.riders[i].dropoff&&(null===(s=r.riders[i].dropoff)||void 0===s?void 0:s.lat)&&(null===(d=r.riders[i].dropoff)||void 0===d?void 0:d.lng)){let t=new window.google.maps.LatLng(r.riders[i].dropoff.lat,r.riders[i].dropoff.lng);e[2*i+1]={latLng:t,rider:r.riders[i].rider,icon:generateIcon(r.riders[i].rider),info:generateInfo("dropoff",r.riders[i])}}}i(e)};return(0,O.useEffect)(()=>{var e,i;if(!(null===(i=r.riders)||void 0===i?void 0:null===(e=i[0])||void 0===e?void 0:e.requestId)){c.replace(o.NU.RIDES);return}let unloadCallback=e=>(e.preventDefault(),e.returnValue="","");return window.addEventListener("beforeunload",unloadCallback),d(!1),()=>window.removeEventListener("beforeunload",unloadCallback)},[]),(0,O.useEffect)(()=>{markLocations()},[r.riders]),t?(0,l.jsx)("div",{className:"flex flex-col items-center justify-center h-full",children:(0,l.jsx)(C.Z,{})}):(0,l.jsxs)("div",{className:"flex flex-col-reverse xl:grid md:grid-cols-12 md:h-full",children:[(0,l.jsx)(extend_rides_ExtendRideForm,{}),(0,l.jsx)("div",{className:"h-[25vh] xl:h-full xl:col-span-7",children:(0,l.jsx)(s.Z,{markers:e,polylines:u,options:{gestureHandling:"greedy",disableDefaultUI:!0}})})]})}},65958:function(e,i,t){"use strict";t.d(i,{t:function(){return formatNameList}});let formatNameList=e=>{let i=Array.from(new Set(e.filter(Boolean)));return 0===i.length?"":1===i.length?i[0]:2===i.length?"".concat(i[0]," and ").concat(i[1]):"".concat(i.slice(0,-1).join(", "),", and ").concat(i[i.length-1])}},37957:function(e,i,t){"use strict";t.d(i,{V:function(){return toFile},s:function(){return toBase64}});let toBase64=e=>new Promise((i,t)=>{let l=new FileReader;
1l.readAsDataURL(e),l.onload=()=>l.result?i(l.result):t(),l.onerror=t}),toFile=e=>fetch(e).then(e=>e.blob()).then(e=>new File([e],"/index.js",{type:"image/jpeg"}))},23577:function(e,i,t){"use strict";t.d(i,{G:function(){return useFetchRideDates}});var l=t(48228),s=t(92311);let d=["ride-dates"],useFetchRideDates=e=>(0,l.D)(d,()=>s.Z.fetchRideDates(e))},11689:function(e,i,t){"use strict";t.d(i,{A:function(){return useGetMetaData}});var l=t(36492),s=t(45856);let d=["meta-data"],useGetMetaData=()=>(0,l.a)(d,()=>s.Z.getMetaData())},72269:function(e,i,t){"use strict";t.d(i,{p:function(){return useRequestStatusMessages}});var l=t(36492),s=t(45856);let d=["request-status-messages"],useRequestStatusMessages=()=>(0,l.a)(d,()=>s.Z.getRequestStatusMessages())}},function(e){e.O(0,[2746,8808,9809,3272,3414,6639,6535,5026,9774,2888,179],function(){return e(e.s=88565)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.