1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7251],{54976:function(e,t,s){s.d(t,{Z:function(){return a}});var l=s(84297);let a=(0,l.Z)("MapPin",[["path",{d:"M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z",key:"2oe9fu"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]])},43777:function(e,t,s){s.d(t,{Z:function(){return a}});var l=s(84297);let a=(0,l.Z)("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]])},87808:function(e,t,s){s.d(t,{M:function(){return f}});var l,a=s(85893),r=s(54479),n=s(26982),i=s(67294),d=s(44674);let o=e=>{let{className:t}=e;return(0,a.jsx)("svg",{className:(0,r.cn)("h-5 w-5 text-gray-500",t),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M13.5 21v-7.5a.75.75 0 01.75-.75h3a.75.75 0 01.75.75V21m-4.5 0H2.36m11.14 0H18m0 0h3.64m-1.39 0V9.349m-16.5 11.65V9.35m0 0a3.001 3.001 0 003.75-.615A2.993 2.993 0 009.75 9.75c.896 0 1.7-.393 2.25-1.016a2.993 2.993 0 002.25 1.016c.896 0 1.7-.393 2.25-1.016a3.001 3.001 0 003.75.614m-16.5 0a3.004 3.004 0 01-.621-4.72L4.318 3.44A1.5 1.5 0 015.378 3h13.243a1.5 1.5 0 011.06.44l1.19 1.189a3 3 0 01-.621 4.72m-13.5 8.65h3.75a.75.75 0 00.75-.75V13.5a.75.75 0 00-.75-.75H6.75a.75.75 0 00-.75.75v3.75c0 .415.336.75.75.75z"})})},c=()=>(0,a.jsx)("svg",{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-500",fill:"currentColor",viewBox:"0 0 20 20",children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})}),u=(e,t)=>{let s=n.ZP.t("BranchSwitchConfirmModal:".concat(e),t);return String(s)},m=e=>[...e.droppedGroupNames,...e.droppedChildNames].join(", "),x=e=>e.droppedGroupNames.length>0||e.droppedChildNames.length>0,p=e=>{let{droppedModifiers:t}=e;return(0,a.jsx)("ul",{className:"max-h-24 space-y-1 overflow-y-auto",children:t.map((e,t)=>{var s;return(0,a.jsxs)(i.Fragment,{children:[x(e)&&(0,a.jsx)("li",{className:"text-xs text-gray-500",children:u("droppedModifiersForProduct",{productName:e.productName,names:m(e)})}),(null!==(l=null===(s=e.trimmedChildNames)||void 0===s?void 0:s.length)&&void 0!==l?l:0)>0&&(0,a.jsx)("li",{className:"text-xs text-gray-500",children:u("trimmedModifiersForProduct",{productName:e.productName,names:e.trimmedChildNames.join(", ")})})]},"".concat(e.productName,"-").concat(t))})})},h=e=>{let{currentBranchName:t,destinationBranchName:s,unavailableItems:l,keptItemsCount:r,priceChanges:n,droppedModifiers:i,itemsNeedingModifiers:m,onConfirm:h,onCancel:f}=e,g=r>0,v=l.length>0,b=n.length>0,j=i.length>0,y=m.length>0,N=!g&&v,M=g&&!v&&!b&&j;return(0,a.jsxs)("div",{className:"flex flex-col gap-3 overflow-hidden",children:[(0,a.jsx)("h2",{className:"line-clamp-2 pr-8 text-xl font-semibold text-gray-900",children:u("title",{destinationBranchName:s})}),(0,a.jsxs)("div",{className:"flex items-center justify-center gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center gap-1",children:[(0,a.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full border border-gray-200 bg-gray-50",children:(0,a.jsx)(o,{})}),(0,a.jsx)("span",{className:"max-w-[100px] truncate text-xs text-gray-600",children:t})]}),(0,a.jsx)("span",{className:"text-lg text-gray-400",children:"â"}),(0,a.jsxs)("div",{className:"flex flex-col items-center gap-1",children:[(0,a.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full border-2 border-primary bg-primary-100",children:(0,a.jsx)(o,{className:"text-primary"})}),(0,a.jsx)("span",{className:"max-w-[100px] truncate text-xs font-bold text-primary",children:s})]})]}),g&&v&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-start gap-2 rounded-lg bg-amber-50 px-3 py-2",children:[(0,a.jsx)(c,{}),(0,a.jsxs)("p",{className:"break-words text-sm text-amber-800",children:[u(1===l.length?"partialMatchOne":"partialMatchOther",{count:l.length,destinationBranchName:s})," ",u(1===r?"partialKeptOne":"partialKeptOther",{count:r})]})]}),(0,a.jsx)("ul",{className:"max-h-36 space-y-1 overflow-y-auto",children:l.map(e=>(0,a.jsxs)("li",{className:"text-sm text-gray-400 line-through",children:[e.count,"x ",e.product.name]},e.hash))}),j&&(0,a.jsx)(p,{droppedModifiers:i})]}),g&&!v&&b&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-start gap-2 rounded-lg bg-amber-50 px-3 py-2",children:[(0,a.jsx)(c,{}),(0,a.jsx)("p",{className:"text-sm text-amber-800",children:u("priceChangeWarning")})]}),(0,a.jsx)("ul",{className:"max-h-36 space-y-1 overflow-y-auto",children:n.map(e=>(0,a.jsxs)("li",{className:"flex items-center justify-between text-sm",children:[(0,a.jsx)("span",{className:"text-gray-700",children:e.productName}),(0,a.jsxs)("span",{className:"shrink-0 text-gray-500",children:[(0,a.jsx)("span",{className:"line-through",children:(0,d.T4)(e.oldPrice)})," â ",(0,a.jsx)("span",{className:"font-medium text-gray-900",children:(0,d.T4)(e.newPrice)})]})]},e.productName))}),j&&(0,a.jsx)(p,{droppedModifiers:i})]}),M&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-start gap-2 rounded-lg bg-amber-50 px-3 py-2",children:[(0,a.jsx)(c,{}),(0,a.jsx)("p",{className:"text-sm text-amber-800",children:u(i.some(x)?"droppedModifiersWarning":"trimmedModifiersWarning",{destinationBranchName:s})})]}),(0,a.jsx)(p,{droppedModifiers:i})]}),N&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-start gap-2 rounded-lg bg-amber-50 px-3 py-2",children:[(0,a.jsx)(c,{}),(0,a.jsx)("p",{className:"text-sm text-amber-800",children:u("fullClearWarning",{destinationBranchName:s})})]}),(0,a.jsx)("ul",{className:"max-h-36 space-y-1 overflow-y-auto",children:l.map(e=>(0,a.jsxs)("li",{className:"text-sm text-gray-400 line-through",children:[e.count,"x ",e.product.name]},e.hash))})]}),y&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-start gap-2 rounded-lg bg-amber-50 px-3 py-2",children:[(0,a.jsx)(c,{}),(0,a.jsx)("p",{className:"break-words text-sm text-amber-800",children:u(1===m.length?"needsModifiersOne":"needsModifiersOther",{count:m.length,destinationBranchName:s})})]}),(0,a.jsx)("ul",{className:"max-h-36 space-y-1 overflow-y-auto",children:m.map(e=>(0,a.jsxs)("li",{className:"text-sm text-gray-700",children:[e.count,"x ",e.product.name]},e.hash))})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("button",{type:"button",onClick:f,className:"w-full rounded-lg !bg-primary px-4 py-2.5 text-sm font-title font-medium text-white hover:opacity-90",children:(0,a.jsx)("span",{className:"block truncate",children:u("cancel",{currentBranchName:t})})}),(0,a.jsx)("button",{type:"button",onClick:h,className:"w-full rounded-lg border border-gray-200 py-2.5 text-sm font-title font-medium text-gray-500 hover:bg-gray-50",children:u(N?"confirmAndClear":"confirmSwitch")})]})]})},f=e=>{let{isOpen:t,currentBranchName:s,destinationBranchName:l,unavailableItems:n,keptItemsCount:i,priceChanges:d,droppedModifiers:o,itemsNeedingModifiers:c,onConfirm:u,onCancel:m}=e;return(0,a.jsx)(r.Vq,{open:t,onOpenChange:e=>!e&&m(),children:(0,a.jsx)(r.cZ,{className:"!max-w-sm rounded-xl p-6 !z-[60] bg-white",children:(0,a.jsx)(h,{currentBranchName:s,destinationBranchName:l,unavailableItems:n,keptItemsCount:i,priceChanges:d,droppedModifiers:o,itemsNeedingModifiers:c,onConfirm:u,onCancel:m})})})}},7163:function(e,t,s){s.d(t,{Z:function(){return o}});var l=s(85893),a=s(54479),r=s(67294),n=s(1293),i=s(95642);let d=e=>{let{selectedAddres:t,google:s,setSelectedAddress:a,isConfirmed:d=!1}=e,[o,c]=(0,r.useState)({lat:null==t?void 0:t.latitude,lng:null==t?void 0:t.longitude});return(0,r.useEffect)(()=>{d&&t&&c({lat:t.latitude,lng:t.longitude})},[d,t]),(0,l.jsx)("div",{className:"h-full w-full overflow-hidden relative",children:(0,l.jsx)(i.Map,{center:o,google:s,zoom:17,disableDefaultUI:!0,zoomControl:!0,children:(0,l.jsx)(i.Marker,{draggable:!d,position:{lat:null==t?void 0:t.latitude,lng:null==t?void 0:t.longitude},onDragend:(e,s)=>{let{position:l}=s;(0,n.pb)({location:{lat:l.lat(),lng:l.lng()}},e=>{a({...t,latitude:l.lat(),longitude:l.lng(),placeId:e.placeId})})}})})})};var o=function(e){let{selectedAddress:t,setSelectedAddress:s,google:r,isConfirmed:n}=e;return(0,l.jsx)("div",{className:"gap-4 h-full",children:(0,l.jsx)("div",{className:(0,a.cn)("w-full gap-4 h-full"),children:(0,l.jsx)(d,{selectedAddres:t,google:r,setSelectedAddress:s,isConfirmed:n})})})}},17251:function(e,t,s){s.d(t,{Q:function(){return _}});var l=s(85893);s(71020),s(519);var a=s(26982),r=s(31955),n=s(54976),i=s(84297);let d=(0,i.Z)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);var o=s(11163),c=s(67294),u=s(26628),m=s(41350),x=s(18672),p=s(82586),h=s(83765),f=s(2919),g=s(4122),v=s(4376),b=s(19034),j=s(31842),y=s(18413),N=s(43872),M=s(6728),C=s(1293),w=s(57650),P=s(87808),k=s(7163),Z=s(92852),D=s(82892),S=s(83664),I=s(80006),A=s(74134),E=s(29215),O=s(92182),z=s(51942),T=s(5625),V=s(63253),L=s(43777),R=s(23019);function K(e){let{store:t,selected:s,onSelect:r}=e,i=(0,R.v)(t);return(0,l.jsxs)("div",{"data-testid":"pickup-store-".concat(t.id),className:"grid grid-cols-[minmax(0,1fr)_auto] overflow-hidden rounded-xl border transition-colors ".concat(s?"!bg-primary-100 border-primary":"border-line-subtle !bg-surface-subtle hover:border-line"),children:[(0,l.jsxs)("button",{type:"button","data-testid":"dispatch-store-".concat(t.id),"aria-pressed":s,onClick:r,className:"min-w-0 px-4 py-3 text-left",children:[(0,l.jsx)("span",{className:"block truncate font-semibold text-content",children:t.name}),t.textAddress&&(0,l.jsx)("span",{className:"mt-0.5 block truncate text-xs text-content-muted",children:t.textAddress}),t.pickUpWaitTime>0&&(0,l.jsxs)("span",{className:"mt-1 flex items-center gap-1 text-xs text-content-tertiary",children:[(0,l.jsx)(L.Z,{size:14,className:"shrink-0"}),a.ZP.t("DispatchMethodModal:waitTime",{time:t.pickUpWaitTime})]})]}),i&&(0,l.jsxs)("a",{href:i,target:"_blank",rel:"noopener noreferrer","data-testid":"store-map-link-".concat(t.id),"aria-label":a.ZP.t("V2Menu:storeMap",{storeName:t.name}),className:"flex w-[92px] flex-col items-center justify-center gap-1 !bg-surface-muted px-2 text-center text-xs font-medium text-content-tertiary transition-colors hover:!bg-surface-strong",children:[(0,l.jsx)(n.Z,{size:18,className:"shrink-0"}),a.ZP.t("DispatchMethodModal:showMap")]})]})}function U(e){let{address:t,onSelect:s}=e;return(0,l.jsxs)("button",{type:"button",onClick:s,className:"flex w-full items-center gap-3 rounded-xl border border-line-subtle px-3 py-2.5 text-left transition-colors hover:border-line-strong",children:[(0,l.jsx)(n.Z,{size:16,className:"shrink-0 text-content-subtle"}),(0,l.jsx)("span",{className:"min-w-0 truncate text-sm text-content-secondary",children:(0,z.c)(t.textAddress)})]})}function _(){var e,t,s,i,L,R,_,F,W,Y;let B=(0,u.I0)(),{push:q}=(0,o.useRouter)(),{google:H,isLoaded:G,load:Q}=(0,O.j)(),$=!!(0,u.v9)(e=>e.modal["".concat(v.ee.DELIVERY_OR_PICKUP,"ModalIsOpen")]),{dispatchType:J,currentSubsidiary:X,pickUpOptions:ee,deliveryOptions:et}=(0,u.v9)(e=>e.searchStore),es=(0,u.v9)(e=>e.searchStore.deliveryOptionsLoading),el=(0,u.v9)(e=>e.auth.address)||{},{current:ea}=el,er=el.history,en=(0,u.v9)(e=>e.searchStore.userAddresses),{tenant:ei}=(0,u.v9)(e=>e.core.settings),ed=(0,u.v9)(e=>{var t;
1return(null===(t=e.order)||void 0===t?void 0:t.tip)||0}),eo=(0,u.v9)(e=>{var t;return null===(t=e.pages)||void 0===t?void 0:t.builderPages})||[],ec=r.Z.get(p.r.accessToken),eu=!!ea&&!ea.isStoreAddress,[em,ex]=(0,c.useState)(J||x.CK.DELIVERY),[ep,eh]=(0,c.useState)(eu?ea.textAddress:""),[ef,eg]=(0,c.useState)(eu?ea:null),[ev,eb]=(0,c.useState)(eu),[ej,ey]=(0,c.useState)((null==ea?void 0:ea.apartmentDetails)||""),[eN,eM]=(0,c.useState)((null==ea?void 0:ea.dispatchNote)||""),[eC,ew]=(0,c.useState)(!1),[eP,ek]=(0,c.useState)(eu?ea:null),[eZ,eD]=(0,c.useState)(null!==(s=null==X?void 0:X.id)&&void 0!==s?s:null),[eS,eI]=(0,c.useState)([]),[eA,eE]=(0,c.useState)(!1),eO=(0,c.useRef)(null),[ez,eT]=(0,c.useState)(!1);(0,c.useEffect)(()=>{J&&ex(J)},[J]),(0,c.useEffect)(()=>{if($&&(eu&&(eh(ea.textAddress),eg(ea),ek(ea),ew(!1),eb(!0),ey(ea.apartmentDetails||""),eM(ea.dispatchNote||"")),ec&&B(j.default.getUserAddress()),eu&&B(j.default.getStoreDeliveryOptions({lat:null==ea?void 0:ea.latitude,lng:null==ea?void 0:ea.longitude})),!(0,y.Ip)(ee))){let e=eu?ea:null;B(j.default.getStorePickUpOptions((null==e?void 0:e.latitude)?{lat:e.latitude,lng:e.longitude}:void 0))}},[$]),(0,c.useEffect)(()=>{$&&Q()},[$,Q]);let eV=(0,c.useCallback)(e=>{eh(e),eb(!1),e.length>=m.Tf?(eE(!0),eO.current||(eO.current=(0,T.x)()),(0,T.I)(e,D.N.isoCountry,eO.current).then(e=>eI(e))):(eI([]),eE(!1))},[]),eL=(0,c.useCallback)(e=>{eO.current=null,(0,C.pb)({placeId:e.placeId,location:null},e=>{eh(e.textAddress),eg(e),ek(e),ew(!1),eb(!0),eI([]),eE(!1),B(j.default.getStoreDeliveryOptions({lat:e.latitude,lng:e.longitude}))})},[B]),eR=(0,c.useCallback)(e=>{eh(e.textAddress),eg(e),ek(e),ew(!1),eb(!0),ey(e.apartmentDetails||""),eM(e.dispatchNote||""),eI([]),eE(!1),B(j.default.getStoreDeliveryOptions({lat:e.latitude,lng:e.longitude}))},[B]),eK=(0,c.useCallback)(()=>{navigator.geolocation&&navigator.geolocation.getCurrentPosition(e=>{(0,C.pb)({location:e.coords,placeId:null},e=>{eh(e.textAddress),eg(e),ek(e),ew(!1),eb(!0),eI([]),eE(!1),B(j.default.getStoreDeliveryOptions({lat:e.latitude,lng:e.longitude}))})})},[B]),eU=()=>{eh(""),eg(null),ek(null),ew(!1),eb(!1),eI([]),eE(!1)},e_=(0,u.v9)(e=>{var t;return(null===(t=e.cart)||void 0===t?void 0:t.cart)||[]}),eF=(0,u.v9)(e=>{var t;return null!==(i=null===(t=e.cart)||void 0===t?void 0:t.cartStoreId)&&void 0!==i?i:null}),eW=null==X?void 0:X.id,[eY,eB]=(0,c.useState)(!1),[eq,eH]=(0,c.useState)(!1),[eG,eQ]=(0,c.useState)([]),[e$,eJ]=(0,c.useState)(null),eX=()=>{let e=em===x.CK.DELIVERY,t=e?null:(null==ee?void 0:ee.find(e=>e.id===eZ))||X,s=null;if(e)s={...ef,apartmentDetails:ej,dispatchNote:eN};else if(t){var l;let e=null!==(l=t.textAddress)&&void 0!==l?l:"",{latitude:a,longitude:r}=t;s={textAddress:e,latitude:"string"==typeof a?parseFloat(a):Number(a),longitude:"string"==typeof r?parseFloat(r):Number(r),hasStreetNumber:!0,city:t.commune,description:e,isStoreAddress:!0}}let a=e?null==et?void 0:et.store:t;return{address:s,store:a}},e0=async(e,t,s)=>{eT(!0),B(f.ZP.setStoreSwitchInProgress(!0));let l=em===x.CK.DELIVERY;l?B(b.default.setTip(ed)):B(b.default.setTip(0)),t.id!==eW&&B(f.ZP.removeCoupon()),B(j.default.setDispatchType(em)),await new Promise(e=>{B(j.default.getStoreData({id:t.id,dispatchType:em},{onSuccess:()=>e(),onFailure:()=>e()}))}),B(g.default.setMenuPreview(!1)),s&&(B(f.ZP.setCart(s,{storeId:t.id})),B(V.ZP.closeModal(v.ee.UNAVAILABLE_PRODUCTS))),B(h.default.setAddress(e)),B(f.ZP.setStoreSwitchInProgress(!1));let a=null!=s?s:e_,r=a.some(e=>e.addedByCoupon||!(0,M.g$)(e));r&&B(f.ZP.checkCart({dispatchType:em,suppressUnavailableModal:!0})),Z.Z.submitShippingInfo({dispatchMethod:em,store:t,tenant:ei,address:e}),"in_store"===em?Z.Z.pickupConfirmed({tenant:ei}):Z.Z.deliveryConfirmed({tenant:ei}),B(V.ZP.closeModal(v.ee.DELIVERY_OR_PICKUP)),eT(!1)},e1=async()=>{let{address:e,store:t}=eX();if(!e||!t)return;let s=!(0,w.l)(t.id,null!=eF?eF:eW);if(s&&e_.length>0){eB(!0);let s=await (0,N.n)(e_,t.id,em,{menuId:t.menuId,tenant:ei});if(eB(!1),null===s){eJ({address:e,store:t}),eQ(e_),eH(!0);return}let{rebuiltCart:l,unmatchedItems:a,priceChanges:r,droppedModifiers:n,itemsNeedingModifiers:i}=s;if(0===a.length&&0===r.length&&0===n.length&&0===i.length){await e0(e,t,l);return}eJ({address:e,store:t,rebuiltCart:l,priceChanges:r,droppedModifiers:n,itemsNeedingModifiers:i}),eQ(a),eH(!0);return}await e0(e,t)},e2=async()=>
1{if(eH(!1),e$){var e;let t=null!==(e=e$.rebuiltCart)&&void 0!==e?e:[];if(await e0(e$.address,e$.store,t),0===t.length){let e=(0,S.LI)(eo);q((null==e?void 0:e.url)||"/")}eJ(null)}},e5=em===x.CK.DELIVERY,e3=e5?null==et?void 0:et.store:X,e7=!e5||(null==et?void 0:et.hasDelivery),e4=!e5||!!(null==ef?void 0:ef.hasStreetNumber)||!!(null==ef?void 0:ef.streetNumber),e9=e5?ev&&e7&&e3&&e4:!!eZ;return $?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(P.M,{isOpen:eq,currentBranchName:null!==(L=null==X?void 0:X.name)&&void 0!==L?L:"",destinationBranchName:null!==(R=null==e$?void 0:null===(e=e$.store)||void 0===e?void 0:e.name)&&void 0!==R?R:"",unavailableItems:eG,keptItemsCount:null!==(_=null==e$?void 0:null===(t=e$.rebuiltCart)||void 0===t?void 0:t.length)&&void 0!==_?_:0,priceChanges:null!==(F=null==e$?void 0:e$.priceChanges)&&void 0!==F?F:[],droppedModifiers:null!==(W=null==e$?void 0:e$.droppedModifiers)&&void 0!==W?W:[],itemsNeedingModifiers:null!==(Y=null==e$?void 0:e$.itemsNeedingModifiers)&&void 0!==Y?Y:[],onConfirm:e2,onCancel:()=>{eH(!1),eJ(null)}}),(0,l.jsx)(I.u_,{open:$,onClose:()=>{ex(J||x.CK.DELIVERY),ew(!1),eu?(eh(ea.textAddress),eg(ea),ek(ea),eb(!0)):eU(),B(f.ZP.clearPendingAddToCart()),B(V.ZP.closeModal(v.ee.DELIVERY_OR_PICKUP))},title:a.ZP.t("DispatchMethodModal:howDoYouWantToOrderToday"),maxWidth:"md",fullHeight:!0,footer:e5&&eC?(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,l.jsx)(A.z,{fullWidth:!0,size:"lg",variant:"secondary",onClick:()=>{ek(ef),ew(!1)},children:a.ZP.t("DispatchMethodModal:cancel")}),(0,l.jsx)(A.z,{fullWidth:!0,size:"lg","data-testid":"dispatch-confirm-pin",onClick:()=>{eP&&(eg(eP),eh(eP.textAddress),B(j.default.getStoreDeliveryOptions({lat:eP.latitude,lng:eP.longitude}))),ew(!1)},children:a.ZP.t("DispatchMethodModal:confirmPin")})]}):(0,l.jsx)(A.z,{fullWidth:!0,size:"lg","data-testid":"dispatch-confirm",disabled:!e9||ez||eY,loading:ez||eY,onClick:e1,children:a.ZP.t("DispatchMethodModal:confirm")}),children:(0,l.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,l.jsxs)("div",{className:"flex rounded-full bg-surface-muted p-1",children:[(0,l.jsx)("button",{type:"button","data-testid":"dispatch-tab-pickup",onClick:()=>ex(x.CK.PICKUP),className:"flex-1 rounded-full py-2.5 text-center text-sm font-semibold transition-all ".concat(e5?"text-content-muted":"!bg-primary text-content-inverse shadow-sm"),children:a.ZP.t("DispatchMethodModal:pickUp")}),(0,l.jsx)("button",{type:"button","data-testid":"dispatch-tab-delivery",onClick:()=>ex(x.CK.DELIVERY),className:"flex-1 rounded-full py-2.5 text-center text-sm font-semibold transition-all ".concat(e5?"!bg-primary text-content-inverse shadow-sm":"text-content-muted"),children:a.ZP.t("DispatchMethodModal:delivery")})]}),e5&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)(d,{size:18,className:"absolute left-3 top-1/2 -translate-y-1/2 text-content-subtle","aria-hidden":"true"}),(0,l.jsx)("input",{type:"text",value:ev?(0,z.c)(ep):ep,onChange:e=>eV(e.target.value),placeholder:a.ZP.t("DispatchMethodModal:insertAddress"),className:"w-full rounded-xl border border-line bg-surface-subtle py-3 pl-10 pr-20 text-base text-content outline-none focus:border-primary focus:ring-1 focus:ring-primary","aria-label":a.ZP.t("DispatchMethodModal:deliveryAddress")}),ev&&(0,l.jsx)("button",{type:"button",onClick:eU,className:"absolute right-3 top-1/2 -translate-y-1/2 text-sm font-semibold text-primary",children:a.ZP.t("V2Common:change")})]}),!ev&&(0,l.jsxs)("button",{type:"button",onClick:eK,className:"mt-2 flex items-center gap-1 text-sm font-semibold text-primary",children:[(0,l.jsx)(n.Z,{size:16}),a.ZP.t("DispatchMethodModal:useMyLocation")]}),eA&&eS.length>0&&(0,l.jsx)("div",{className:"mt-2 max-h-[180px] space-y-1.5 overflow-y-auto",children:eS.map(e=>(0,l.jsxs)("button",{type:"button",onClick:()=>eL(e),className:"hover:bg-primary/5 flex w-full items-center gap-2 rounded-lg border border-line-subtle px-3 py-2 text-left text-sm text-content-secondary transition-colors hover:border-primary",children:[(0,l.jsx)(n.Z,{size:14,className:"shrink-0 text-content-subtle"}),(0,l.jsx)("span",{className:"min-w-0 truncate",children:e.fullText||e.primaryText})]},e.placeId))}
1),!ev&&!eA&&(0,y.Ip)(en)&&(0,l.jsxs)("div",{className:"mt-3",children:[(0,l.jsx)("p",{className:"mb-2 text-xs font-medium text-content-muted",children:a.ZP.t("DispatchMethodModal:storedAddress")}),(0,l.jsx)("div",{className:"space-y-1.5",children:en.map(e=>(0,l.jsx)(U,{address:e,onSelect:()=>eR(e)},e.id))})]}),!ev&&!eA&&!(0,y.Ip)(en)&&(0,y.Ip)(er)&&(0,l.jsxs)("div",{className:"mt-3",children:[(0,l.jsx)("p",{className:"mb-2 text-xs font-medium text-content-muted",children:a.ZP.t("DispatchMethodModal:recentAddresses",{defaultValue:"Direcciones recientes"})}),(0,l.jsx)("div",{className:"space-y-1.5",children:er.slice(0,5).map((e,t)=>(0,l.jsx)(U,{address:e,onSelect:()=>eR(e)},e.id||t))})]})]}),ev&&ef&&G&&H&&(0,l.jsxs)("div",{className:"relative h-56 w-full overflow-hidden rounded-xl",children:[eC?(0,l.jsx)("span",{className:"absolute left-1/2 top-2 z-10 -translate-x-1/2 rounded bg-surface-inverse px-4 py-2 text-xs font-medium text-content-inverse shadow-md",children:a.ZP.t("DispatchMethodModal:movePin")}):(0,l.jsxs)("button",{type:"button",onClick:()=>ew(!0),className:"!bg-primary absolute left-1/2 top-2 z-10 flex -translate-x-1/2 items-center gap-1 rounded-full px-4 py-2 text-xs text-content-inverse shadow-md",children:[(0,l.jsx)("span",{children:a.ZP.t("DispatchMethodModal:locationPrecise")}),(0,l.jsx)("span",{className:"font-bold underline",children:a.ZP.t("DispatchMethodModal:adjust")})]}),(0,l.jsx)(k.Z,{selectedAddress:eP,setSelectedAddress:ek,google:H,isConfirmed:!eC})]}),ev&&(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"mb-1 block text-sm font-medium text-content-secondary",children:a.ZP.t("DispatchMethodModal:apartmentDetails")}),(0,l.jsx)("input",{type:"text",value:ej,onChange:e=>ey(e.target.value),placeholder:"Apt 4B, Suite 200, 3er piso...",className:"w-full rounded-xl border border-line bg-surface-subtle px-3 py-2.5 text-base text-content outline-none focus:border-primary focus:ring-1 focus:ring-primary"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"mb-1 block text-sm font-medium text-content-secondary",children:a.ZP.t("DispatchMethodModal:dispatchNote")}),(0,l.jsx)("textarea",{value:eN,onChange:e=>eM(e.target.value),placeholder:"Dejar en la puerta, no tocar el timbre...",rows:3,className:"w-full rounded-xl border border-line bg-surface-subtle px-3 py-2.5 text-base text-content outline-none focus:border-primary focus:ring-1 focus:ring-primary"})]})]}),ev&&es&&(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(E.O,{className:"h-4 w-32"}),(0,l.jsx)(E.O,{className:"h-4 w-48"})]}),ev&&!es&&e3&&e7&&(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-sm font-semibold text-content",children:a.ZP.t("DispatchMethodModal:fromStore")}),(0,l.jsx)("p",{className:"text-sm text-content-secondary",children:e3.name})]}),ev&&!e4&&(0,l.jsx)("div",{className:"rounded-xl border border-warning/30 bg-warning-soft px-4 py-3",children:(0,l.jsx)("p",{className:"text-sm font-medium text-warning-strong",children:a.ZP.t("DispatchMethodModal:needStreetNumber",{defaultValue:"Agrega el n\xfamero de tu direcci\xf3n para continuar."})})}),ev&&!es&&!e7&&(0,l.jsxs)("div",{className:"rounded-xl border border-error/40 bg-error-soft px-4 py-3",children:[(0,l.jsx)("p",{className:"text-sm font-medium text-error-emphasis",children:a.ZP.t("DispatchMethodModal:outsideDeliveryZone")}),(0,l.jsxs)("button",{type:"button",onClick:()=>ex(x.CK.PICKUP),className:"mt-1 text-sm font-semibold text-primary underline",children:[a.ZP.t("DispatchMethodModal:changeDispatchMethod")," ",a.ZP.t("DispatchMethodModal:pickUpMethod")]})]})]}),!e5&&(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-sm font-semibold text-content",children:a.ZP.t("DispatchMethodModal:selectStore")}),(0,y.Ip)(ee)?(0,l.jsx)("div",{className:"mt-2 space-y-2",children:ee.map(e=>(0,l.jsx)(K,{store:e,selected:eZ===e.id,onSelect:()=>eD(e.id)},e.id))}):(0,l.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,l.jsx)(E.O,{className:"h-16 w-full",rounded:"lg"}),(0,l.jsx)(E.O,{className:"h-16 w-full",rounded:"lg"})]})]})]})})]}):null}}}]);
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.