PageSourceSearch

https://store.teganandsara.com/cdn/shopifycloud/checkout-web/asset…/components-DeliveryTransition.Dys1ZJbh.js

js teganandsara.com collected 2026-09-24 18:56:04 UTC 112,677 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["component-ShopPayVerificationSwitch.B07D3lXw.js","esnext-vendor.BBoIVOQW.js","addresses-is-address-empty.ZJ1ThpFy.js","app.CUBUOQtX.js","assets/app.Sxsz5knT.css","assets/is-address-empty.DJksNKpk.css","hydrate.Tsur0pib.js","shared-permissions.DW7FOCqf.js","hooks-useShopPayExternalAppContext.YLtTu3k6.js","assets/previous.BfF3jg9W.css","BillingAddressForm.BMqAGUql.js","localization-index.P2wbDjPJ.js","assets/index.BAKORI_U.css","shipping-methods-grouping.S_i1LuzE.js","amazon-pay-useAmazonPayPaymentLine.CMgi35Fb.js","PhoneField.D8EvZ0Pm.js","hooks-useSuppressShopPayModalOnLoad.CwH45iIp.js","assets/PhoneField.uZEuHncj.css","components-RedirectionNotice.module.qsrQCJ0v.js","assets/RedirectionNotice.DG0OZ1cz.css","AddressPresenter.Ce4uWLSc.js","Choice.18syyoW7.js","shop-pay-installments-types._vopm3yK.js","Checkbox.dqdh-9I_.js","assets/Checkbox.SrYMuQu4.css","assets/Choice.aPApdPe_.css","assets/BillingAddressForm.BdwN7V1K.css","hooks-useShopPayNewSignupLoginExperiment.CXtCCSeF.js","hooks-useForceShopPayUrl.z4AJBm7B.js","utilities-publishMessage.C9heL0Ox.js","graphql-PaymentSessionMutation.KqKA7ogg.js","useShopPayButtonClassName.BGKzXWjH.js","shared-shop-theme.Bl1CDyC7.js","hooks-useShowShopPayOptin.BPTq9EIX.js","hooks-useShouldRevealCustomization.1KSlt0eq.js","assets/useShopPayButtonClassName.CpHF4L7Q.css","useAuthorizeUrl-index.DGzVLmtU.js","dist-v4.EwEgHOG0.js","assets/ShopPayVerificationSwitch.WW3cs_z5.css","component-ApplePayButton.FD3NxrjC.js","TransitionHeight.BCpWGRvL.js","assets/TransitionHeight.CuRoM9zv.css","hooks-useWalletsTimeout.BmMXm9Gc.js","Page.B9pV9lua.js","assets/Page.BYM12A8B.css","ChangeCompanyLocationLink.a6EWibK9.js","ImpressionEventCapture.IVS9ZWTI.js","ShopPayLogo.DdN9PLvG.js","cross-border-hooks.BN4C-Hww.js","shop-pay-installments-monorail.wQxzDho3.js","IncentiveBadge.DttARc72.js","assets/IncentiveBadge.Dlnp55te.css","Section-SectionStyleOverride.DC78UZTk.js","AutocompleteField-hooks.Cs2Bn4N3.js","PendingShipping.B15tiX3F.js","assets/ApplePayButton.CTcryfIc.css","component-amazonWalletLazy.CerghXi9.js","hooks-useStableHostMethodsReferences.DJyLKxes.js","WalletsSandbox-WalletSandbox.Y0YrDRHu.js","assets/WalletSandbox.BoV0vp4z.css","negotiated-findSelectedDeliveryMethod.DhxHslog.js","amazon-constants.BYv714i3.js","assets/amazonWalletLazy.D78LrA7v.css","component-PickupPoint.SsasjJEn.js","Map.B8mpIgyz.js","assets/Map.cbVP6Hp_.css","utilities-dates.ChO2GdxN.js","assets/PickupPoint.3rHQv8Px.css","assets/delivery-method-transitions.S-FSTp4Y.css"])))=>i.map(i=>d[i]);
2import{f as L,_ as Gn,u as n,h as K,p as Me,T as se,d as mn,r as Kn,e as ue,A as te,k as le,q as j,i as Y,n as We,S as X,g as Pe,l as de,Q as go,X as _o,x as fo,a as bo,j as Po,s as Bn,G as Fn,o as bt,ad as ko}from"./esnext-vendor.BBoIVOQW.js";import{F as qt,a as Co}from"./localization-index.P2wbDjPJ.js";import{T as y,W as $,aj as vn,id as So,b8 as Io,aq as qn,be as Lo,I as $e,a5 as ce,iZ as Ne,eE as jt,bm as Yt,bn as jn,bo as cn,d9 as Ao,bZ as Mo,db as Eo,b$ as To,ap as Ze,ag as Te,cy as Xt,ah as Yn,i_ as wo,i$ as No,cx as yn,aN as Jt,j0 as Do,eX as Oo,j1 as xo,as as Ae,cw as Bo,b3 as Qt,j2 as Fo,j3 as Ro,ao as Vo,j4 as Pt,d2 as Ho,bf as Ke,fV as Xn,ay as Zt,iT as Uo,j5 as zo,fT as Fe,am as ea,j6 as na,du as en,j7 as Wo,j8 as $o,H as Rn,eI as Go,dE as Ko,eH as qo,K as jo,j9 as Yo,ja as kt,cF as Xo,eJ as Jo,eM as Qo,a$ as Zo,l as ei,n as ni,cG as ta,dw as Jn,bE as aa,jb as oa,jc as ti,cI as ai,i8 as oi,jd as ii,ak as ia,je as si,jf as Ct}from"./addresses-is-address-empty.ZJ1ThpFy.js";import{cS as sa,aX as Qn,d as ri,f as ke,a5 as gn,aH as He,P as Ee,k as I,dl as li,ce as Zn,I as oe,j as ye,hb as ci,b1 as ra,o as ui,fx as wn,ex as un,C as _n,a as De,ax as la,l as O,gl as ca,F as fn,bw as bn,G as ge,T as ua,a8 as dn,gj as di,S as et,L as me,hc as pi,bx as hi,h2 as mi,cE as Pn,cj as vi,ga as yi,a4 as gi,f4 as _i,n as Ge,bi as kn,B as G,ah as fi,aN as bi,bU as Pi,u as ki,X as da,Z as Ue,Y as ze,hd as Ci,q as xe,he as Si,cO as nt,M as Ii,U as Be,b as pa,bk as ha,hf as Li,W as qe,A as nn,D as Ai,b8 as ma,b7 as Vn,ca as tn,eo as Mi,hg as va,cf as Ei,hh as je,bD as Cn,hi as ya,cg as ga,ch as _a,ai as pe,ep as Sn,c8 as fa,eB as ba,eC as Ti,g0 as wi,K as Pa,cb as ka,bC as tt,cc as Ca,hj as Je,hk as Ni,hl as Di,aA as Oi,bV as xi,av as Bi,hm as Fi,aJ as Ri,ak as Vi,bc as St,hn as Hi,ay as Sa,V as at,dA as Ia,dB as La,dU as Ui,_ as zi,bX as Wi,bL as $i,ho as Gi,fc as Ki,g_ as qi,hp as ji,hq as Yi}from"./hydrate.Tsur0pib.js";import{a as ot,v as Hn,c as Xi,S as Ji}from"./useShopPayButtonClassName.BGKzXWjH.js";import{p as Qi,a as Zi,A as es}from"./shop-pay-installments-types._vopm3yK.js";import{b as it,c as ns,d as ts,e as as,i as Aa,f as os}from"./hooks-useForceShopPayUrl.z4AJBm7B.js";import{u as is,A as Ma}from"./AddressPresenter.Ce4uWLSc.js";import{S as ss,u as rs,a as ls,A as cs}from"./ChangeCompanyLocationLink.a6EWibK9.js";import{C as st}from"./Checkbox.dqdh-9I_.js";import{P as us,u as ds,F as ps}from"./PhoneField.D8EvZ0Pm.js";import{_ as an,h as hs}from"./app.CUBUOQtX.js";import{I as Ea}from"./ImpressionEventCapture.IVS9ZWTI.js";import{S as ms,u as vs,G as ys}from"./ShopPayLogo.DdN9PLvG.js";
2import{a as be,c as Un,d as gs,e as _s,f as fs,h as Ta,u as bs}from"./cross-border-hooks.BN4C-Hww.js";import{e as Ps,h as ks,S as It}from"./Page.B9pV9lua.js";import{g as Cs,P as Ss,h as Lt}from"./hooks-useWalletsTimeout.BmMXm9Gc.js";import{S as Is}from"./shared-shop-theme.Bl1CDyC7.js";import{a as Ls}from"./hooks-useShouldRevealCustomization.1KSlt0eq.js";import{a as As}from"./shop-pay-installments-monorail.wQxzDho3.js";import{M as Ms}from"./hooks-useShopPayNewSignupLoginExperiment.CXtCCSeF.js";import{C as In,b as Es,a as Ts}from"./Choice.18syyoW7.js";import{C as rt}from"./IncentiveBadge.DttARc72.js";import{S as wa}from"./Section-SectionStyleOverride.DC78UZTk.js";import{T as ws}from"./TransitionHeight.BCpWGRvL.js";import{u as Ns}from"./AutocompleteField-hooks.Cs2Bn4N3.js";import{a as Ds,s as Os,M as xs}from"./BillingAddressForm.BMqAGUql.js";import{P as Bs}from"./PendingShipping.B15tiX3F.js";import{P as Fs}from"./components-RedirectionNotice.module.qsrQCJ0v.js";function Rs(){const{i18n:e,shop:t,shopPay:a}=y(),{shippingAddress:o}=$(),i=vn();return L(()=>{const s=o.fields.countryCode.value,r=(s&&t.countrySpecific[s]?.contactInfoOptions)??t.contactInfoOptions;return i.value||a.user.isUnauthenticatedUser.value||!r.includes("PHONE")?e.translate("field_errors.email_blank"):e.translate("field_errors.email_or_phone_blank")})}function Na(){const{shop:e,checkout:t}=y(),{shippingAddress:a,billingAddress:o}=$(),i=sa(),s=e.hasFlagEnabled(So);return L(()=>{if(!s)return null;const r=Qi({isShippingRequired:t.isShippingRequired.value,isPickupSelected:i.value,shippingCountryCode:a.fields.countryCode.value,billingCountryCode:o.fields.countryCode.value});return Zi(e,r)})}function Vs(){const{shop:e,source:t,checkout:a}=y(),o=Qn(),i=$(),s=sa(),r=ri(),l=Na();return L(()=>{const c=i.phone.value,u=i.email.value,d=a.identity.current.value;let p=!!l.value||e.smsMarketing!=="OFF";(d==="shopPay"||d==="businessCustomer")&&(p=!1);let h;if(!a.configuration.visibility.showSmsMarketing||!p||o?.smsMarketingEnabled===!1||Io(t))h="none";else{const v=c&&!u;let m;v?m="contact":s.value||!a.isShippingRequired.value?m="billing":m="delivery",r.value[m]?h="root":h=m}return{isNone:h==="none",isContact:h==="contact",isDelivery:h==="delivery",isBilling:h==="billing",isRoot:h==="root"}})}function Da({origin:e="contact_info_page"}){const{acceptEmailMarketing:t}=$(),{negotiate:a}=ke(),{emailMarketingOptInShownSignal:o}=qn(),{i18n:i,userEvents:s,checkout:r,source:{checkoutSessionIdentifier:l,sourceId:c},shop:{id:u,myshopifyDomain:d}}=y(),p=r.configuration.layout.isOnePage.value;Gn(()=>{o.value=!0},[o]);function h(m){t.value=m,a({}),s.monorailEvent({schemaId:"checkout_email_marketing_optin_ui_interaction/1.0",payload:{checkoutToken:l||c,shopId:Number($e(u)),shopifyDomain:d,action:m?"click_email_opt_in":"unclick_email_opt_in",origin:e,checkoutVersion:p?"checkout_one_redesign":"checkout_one"}})}const v=Lo("marketing.disclaimer.description_html",i)?n(Ee,{type:"small",color:"subdued",children:n(gn,{children:i.translate("marketing.disclaimer.description_html",{privacy_policy_link:n(He,{handle:"privacy-policy",tone:"monochrome"}),terms_of_service_link:n(He,{handle:"terms-of-service",tone:"monochrome"})})})}):null;return n(I,{gap:"small-200",children:[n(st,{id:"marketing_opt_in",name:"marketing_opt_in",checked:t.value,onChange:h,label:Hs({identity:r.identity,i18n:i})}),v]})}function Hs({identity:e,i18n:t}){switch(e.current.value){case"shopPay":case"buyWithPrime":return t.translate("marketing.accept_shop_pay_marketing_checkbox_label");default:return t.translate("marketing.accept_marketing_checkbox_label")}}Da.displayName="MarketingOptIn";const Us=/<a\b(?<attributes>[^>]*)>(?<text>.*?)<\/a>/gi,zs=/data-policy-handle=(["'])(?<handle>privacy-policy|terms-of-service)\1/i,At=/<\/?[a-z][\s\S]*>/i;function Mt(e){return n(gn,{dangerouslySetInnerHTML:{__html:e}})}function Et(e,t){return n("span",{dangerouslySetInnerHTML:{__html:e}},t)}function Ws(e){const t=[];let a=0,o=!1;for(const s of e.matchAll(Us)){const r=s.index,l=$s(s);if(r==null||!l)continue;const c=e.slice(a,r);if(At.test(c))return Mt(e);c&&t.push(Et(c,`text-before-${r}`)),t.push(n(He,{handle:l,tone:"monochrome"},`${l}-${r}`)),a=r+s[0].length,o=!0}const i=e.slice(a);return!o||At.test(i)?Mt(e):(i&&t.push(Et(i,"trailing-text")),n(gn,{children:t}))}function $s(e){const a=(e.groups?.attributes??"").match(zs)?.groups?.handle;return a==="privacy-policy"?"privacy-policy":a==="terms-of-service"?"terms-of-service":null}function Tt(e){return e?.label&&e.disclaimerHtml.trim()?e:void 0}function Gs(e){return e?JSON.stringify([e.label,e.disclaimerHtml]):null}function Oa(){const{i18n:e,shop:t,checkout:a,embed:o}=y(),{marketingPhoneInputError:i,previousPhoneMarketingDisclosureKeySignal:s,smsMarketingOptInShownSignal:r}=qn(),{phone:l,acceptSmsMarketing:c,smsMarketingPhone:u,shippingAddress:d}=$(),p=it(),h=Na(),v=h.value,m=Tt(v),g=!v&&t.smsMarketing!=="OFF",_=m?.label??(g?e.translate("marketing.accept_sms_checkbox_label"):void 0),C=!!_;Gn(()=>{C&&(r.value=!0)},[C,r]);const A=ce(),{handleSmsMarketingConsent:f}=ns(),b=L(()=>A.buyerIdentity.value?.customerProfile),w=L(()=>!l.value&&!a.proposal.negotiated.fields.availableDeliveryAddresses.value?.length),k=L(()=>!l.value),M=L(()=>o?.isFlagshipPartner||b.value?!1:!k.value);K(()=>
2{if(!u.value){const P=w.value?d.fields.phone.value:l.value;u.value=P??""}},[]),Me(()=>{const P=d.fields.phone.value;w.value&&!Tt(h.value)&&t.smsMarketing==="OFF"&&(u.value=P||"")}),ts(),Me(()=>{const P=Gs(h.value),S=s.peek();s.value=P,S!=null&&P!=null&&S!==P&&c.value&&(c.value=!1)});function z(P){i.value=void 0,f(P)}Me(()=>{l.value&&!b.value&&(u.value=l.value)});const F=e.translate("field_errors.sms_marketing_phone_invalid"),T=as(F),R=se(()=>({state:{phone:u},errors:{phone:i}}),[i,u]);if(!_)return null;const V=m?n(Ee,{type:"small",color:"subdued",children:Ws(m.disclaimerHtml)}):n(Ee,{type:"small",color:"subdued",children:n(gn,{children:e.translate("marketing.sms.disclaimer.description_html",{privacy_policy_link:n(He,{handle:"privacy-policy",tone:"monochrome"}),terms_of_service_link:n(He,{handle:"terms-of-service",tone:"monochrome"})})})});return n(Zn,{...R,children:n(li,{id:"smsMarketingOptInDisclosure",open:c.value,summary:n(st,{id:"sms_marketing_opt_in",name:"sms_marketing_opt_in",label:_,checked:c.value,onChange:z,"aria-controls":"smsMarketingOptInDisclosure"}),content:n(I,{gap:"base",paddingBlockStart:"base",children:[n(us,{countryCode:p.value??"",label:e.translate("marketing.sms.mobile_phone_number"),disabled:M.value,caretPosition:0,prefillCountryCode:!0,icon:"mobile",...c.value?T:{}}),V]})})})}Oa.displayName="PhoneMarketingOptIn";const xa=mn({displayName:"ShopPayVerificationSwitch",load:()=>Kn(()=>an(()=>import("./component-ShopPayVerificationSwitch.B07D3lXw.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38])))}),Ks="rdvNk",qs={MobilePhoneIcon:Ks};function js({onClick:e}){const{i18n:t}=y();return n(ye,{variant:"primary",accessibilityLabel:t.translate("account_management.verification_toggle"),onClick:e,segment:"end",children:n("div",{className:qs.MobilePhoneIcon,children:n(oe,{type:"mobile",size:"large"})})})}function Ba(){const e=ci({key:"india_phone_autofill",variants:[Ne.Control,Ne.Treatment]}),t=Fa()===Ne.Treatment;return e||(t?Ne.Treatment:Ne.Control)}function Ys(){const e=Fa();return e===Ne.Control||e===Ne.Treatment}function Fa(){const{client:e}=y();return e.unstable_getSerialization("experiments")?.find(({clientHandle:t})=>t===hs)?.variant}function Xs(e,t,a="PHONE"){const{phone:o}=$(),{observability:i,checkout:{validation:{contactErrors:{phoneInputError:s,emailInputError:r}},wallets:l}}=y(),c=l.activeSession.value;ra(p=>{if(a!=="EMAIL"&&p.type==="error"){for(const h of p.violations)if(!(h.__typename!=="UnprocessableTermViolation"||!jt.has(h.code)||Aa(h.target)))if(h.code==="BUYER_IDENTITY_EMAIL_REQUIRED"){const v=h.localizedMessage??h.nonLocalizedMessage;s.value=v}else{const v=t||(h.localizedMessage??h.nonLocalizedMessage);s.value=v,r.value=void 0}}});const u=ue(void 0),d=c?u:s;return Yt(o,d,p=>
2{if(c){i.leaveErrorBreadcrumb("[useValidatedPhoneField] Not validating phone - wallet session active");return}if(a==="EMAIL"){i.leaveErrorBreadcrumb("[useValidatedPhoneField] Skipping phone validation - input type is EMAIL");return}return i.leaveErrorBreadcrumb("[useValidatedPhoneField] Validating phone number"),e(p)},jn.InvalidContactMethod),cn(o,d,a==="PHONE"?e:void 0)}function Js(){return document.cookie.includes("_tracking_consent=")}function Qs(){const{email:e}=$();Me(()=>{ot(e.value,"invalid")==="invalid"||Js()})}function Ra(){const{paymentMethods:e,buyerIdentity:t}=ce(),{router:a,source:{type:o},mobileCheckoutSdk:i,embed:s,checkout:r,shop:l}=y(),c=a.currentUrl,u=r.proposal.proposed.paymentLines,d=l.hasFlagEnabled(Ao),p=Mo(),h=ui(),v=o==="simulated",m=i.variant.isStandard()||!!s?.isCheckoutKit();return L(()=>{const g=e.value?.some(w=>w.type==="wallet"&&w.name==="SHOP_PAY"),_=t.value?.purchasingCompany,{currentDetour:C}=h.value,A=C!=null&&["stockProblems"].includes(C.type),f=Eo(c.value.searchParams),b=d&&!!To(u.value);return!!(!v&&g&&!f&&!p.value&&!m&&!A&&!_&&!b)})}function Va({emailInput:e,email:t,isShopPayUnauthenticatedUser:a}){const{shopPay:o}=y(),i=te(""),s=a?un.C1ModalShopPay:void 0,[r,l]=le(s),[c,u]=le(!1),[d,p]=le(!1),h=t.trim(),v=j((m,g)=>{g&&(i.current=g),a||p(!m),u(m)},[a,i]);return Me(()=>{const m=o.session.verificationTrigger.value;m&&(v(!0),o.session.unstable_updateVerificationTrigger(null),a&&[wn.LoginLink,wn.ErrorModalClearEmail].includes(m.source)&&(l(un.C1ModalShopPaySignIn),m.source===wn.ErrorModalClearEmail&&window.dispatchEvent(new Event("shop_pay_verification_reset"))))}),K(()=>{h!==i.current&&(p(!1),u(!1))},[h,i]),K(()=>{p(!1)},[e]),{modalUrlOrigin:s,modalUpdatedOrigin:r,shopPayVerificationVisible:c,showShopPayVerificationToggle:d,showShopPayVerification:v,setModalUpdatedOrigin:l,setShowShopPayVerificationToggle:p}}const Zs="iWrC7",er="aDczq",nr="oMR3v",Nn={AccessoryContainer:Zs,TooltipTriggerHidden:er,SavedLabel:nr},tr=fn("EmailFieldAccessory");function ar({saved:e}){const{i18n:t}=y(),a=_n(void 0,tr),o=t.translate("contact.field_saved_label"),[i,s]=le(!1);return K(()=>{if(e)return De({content:o,role:"status"})},[e,o]),n("span",{className:Nn.AccessoryContainer,children:[n(la,{className:e?Nn.TooltipTriggerHidden:void 0,accessibilityLabel:t.translate("contact.field_tooltip_accessibility_label"),accessibilityVisibility:e&&!i?"hidden":"visible",onFocus:()=>s(!0),onBlur:()=>s(!1),interestFor:a,children:n(oe,{type:"question"})}),e?n("span",{className:Nn.SavedLabel,"aria-hidden":!0,children:n(O,{type:"small",tone:"neutral",children:o})}):null,n(ca,{id:a,children:t.translate("contact.field_tooltip_helper_text")})]})}const or=2e3;function wt(e){return(e??"").trim().toLowerCase()}function ir(e,t){const a=se(()=>wt(e),[e]),o=se(()=>wt(t),[t]),[i,s]=le(!1),r=te(a!==""&&o===a);return K(()=>{const l=a!==""&&o===a,c=l&&!r.current;if(r.current=l,!l){s(!1);return}if(!c)return;s(!0);const u=setTimeout(()=>s(!1),or);return()=>clearTimeout(u)},[a,o]),i}function sr({fieldProps:e,countryCode:t,combinedFieldRendered:a,fieldIsEmpty:o}){const i=bn(),s=Ba(),r=Ys(),l=t==="IN"&&a,c=te(void 0),u=te(void 0);l&&(c.current??=e.autocomplete??"none",u.current??=o);const d=te(!1);function p(h){const v=e.autocomplete??"none",m=!!e.error;return[`variant:${s}`,`assigned:${r}`,`autocomplete:${c.current??v}`,`autocomplete_at_impression:${v}`,`untouched_at_first_paint:${u.current??o}`,`country:${t}`,`field_has_error:${m}`,`trigger:${h}`]}return{isEnabled:l,impressionFeatures:p("seen"),fieldProps:l?{...e,onFocus:()=>{e.onFocus?.(),!d.current&&(d.current=!0,i("impression",{impressionType:"contact_autocomplete_hint",impressionFeatures:p("focus"),timestamp:new Date}))}}:e}}const Ha="contact-information-text-field-container",rr=`#${Ha}`;function lr({onInputTypeChange:e,onInlineEmailValidation:t,onInlinePhoneValidation:a}){const o=Ze(),{inMemoryPayPalParts:{accountStatus:i}}=Te(),{i18n:s,observability:r,shop:{contactInfoOptions:l,countrySpecific:c},shopPay:u,checkout:d,source:p}=y(),h=u.user.isUnauthenticatedUser.value,v=vn(),m=it(),{email:g,phone:_,smsMarketingPhone:C}=$(),A=g.value,f=_.value,[b,w]=le(g.peek()??""),[k,M]=le(_.peek()!==""&&(g.peek()===""||!g.peek())&&!h?"PHONE":"EMAIL"),[z,F]=le(0),T=s.translate("contact.email_or_phone_label"),R=s.translate("field_errors.email_or_phone_invalid"),V=Xs(a,R,k),P=(m.value?c[m.value]?.contactInfoOptions:void 0)??l,S=v.value||h||!P.includes("PHONE"),D=Ba(),W=b===""&&!A,U=D===Ne.Treatment&&m.value==="IN"&&!S&&W?"tel":"email";function ie(he,ve){if(k==="EMAIL"&&(w(he),h&&Q(un.C1ModalShopPay)),!S)if(ve!=null&&F(ve),he==="")M("EMAIL"),We(()=>{_.value="",g.value="",k==="PHONE"&&(C.value="")}
2),r?.leaveErrorBreadcrumb("[ContactInformation] Input type reset to EMAIL (both fields empty)");else{const Ie=/([A-Za-z]|\.|@)/.test(he);Ie&&k!=="EMAIL"?(r.leaveErrorBreadcrumb("[ContactInformation] Input type changed to EMAIL"),We(()=>{_.value="",g.value=he,C.value=""}),M("EMAIL")):!Ie&&k!=="PHONE"&&(r.leaveErrorBreadcrumb("[ContactInformation] Input type changed to PHONE"),g.value="",_.value=he,M("PHONE"))}}K(()=>{r.leaveErrorBreadcrumb("[ContactInformation] Component mounted")},[r]),K(()=>{e&&e(k)},[e,k]),K(function(){if(S)return;const ve=A!=null&&A!=="",Ie=f!=null&&f!=="";if(!ve&&!Ie&&k!=="EMAIL"){r.leaveErrorBreadcrumb("[ContactInformation] Input type reset to EMAIL from empty proposed contact info"),M("EMAIL");return}if(ve&&k!=="EMAIL"){r.leaveErrorBreadcrumb("[ContactInformation] Input type synced to EMAIL from proposed contact info"),M("EMAIL");return}!ve&&Ie&&k!=="PHONE"&&(r.leaveErrorBreadcrumb("[ContactInformation] Input type synced to PHONE from proposed contact info"),M("PHONE"))},[A,k,r,S,f]);const re=te(!0);K(function(){const ve=re.current;re.current=!1,(!P.includes("PHONE")||h)&&k!=="EMAIL"&&(M("EMAIL"),A===""&&f!==""&&(_.value="",ve||(g.value=f)))},[P]),Xt(async({reason:he,parts:ve})=>he!=="progression"?{behavior:"allow"}:{behavior:"allow",perform(){const Ie=ve.phone.peek();Ie!==""&&ve.deliveryLines.peek().forEach(_t=>{const ft=_t.peek();_t.value={...ft,deliveryMethodOptions:{...ft.deliveryMethodOptions,phone:Ie}}})}});const J=Ra(),{modalUrlOrigin:N,modalUpdatedOrigin:B,shopPayVerificationVisible:H,showShopPayVerificationToggle:ee,showShopPayVerification:x,setModalUpdatedOrigin:Q,setShowShopPayVerificationToggle:q}=Va({emailInput:b,email:g.value,isShopPayUnauthenticatedUser:h}),Ce=te(null),ae=pr(S?void 0:R,k==="PHONE"?cr:t,k),fe=Yn().current.value.contactInfo?.email,ne=ir(A??"",fe),Se=p.isAbandonedCheckoutSupported&&k==="EMAIL"&&!(J.value&&ee)?n(ar,{saved:ne}):void 0,En=ds({countryCode:m.value??"",label:T,onInputValueChange:ie,caretPosition:z,inputMode:"text",disableFormatting:!0,required:!0,...V}),Ye=S?void 0:{label:T,type:"text",caretPosition:z,inputMode:"text"},Tn=ur({email:ae,ref:Ce,addressType:d.isShippingRequired.value?"shipping":"billing",disabled:i.value.status==="loading",required:!0,accessory:Se,contactAutocompleteType:U,...Ye,onInputValueChange:ie}),E=k==="PHONE"?En:Tn,Re=k==="PHONE"?f==null||f==="":W,{isEnabled:on,impressionFeatures:sn,fieldProps:Xe}=sr({fieldProps:E,countryCode:m.value,combinedFieldRendered:!S,fieldIsEmpty:Re}),yt=J.value&&ee?n(js,{onClick:()=>{x(!0),h&&Q(un.C1ModalShopPay)}}):null,vo=J.value?n(Y,{when:o,children:n(xa,{popoverActivator:Ce,popoverAnchorSelector:rr,email:b,onSetEmail:he=>{ae.onInput(he),ie(he),ae.onChange(he)},open:H,showPopover:x,showToggle:q,urlOrigin:N,updatedOrigin:B})}):null,gt=k==="PHONE"?"phone":"email",yo=n(I,{gap:"small-400",children:[n(ge,{id:Ha,gridTemplateColumns:"minmax(0, 1fr) auto",gap:"none",children:[n(ua,{...Xe,id:gt,error:!!Xe.error,segment:yt?"start":void 0}),yt]}),typeof Xe.error=="string"&&Xe.error?n(dn,{controlID:gt,children:Xe.error}):null]});return n("div",{children:[n(Ea,{impressionType:"contact_autocomplete_hint",impressionFeatures:sn,enabled:on,children:yo}),vo]})}function cr(){}function ur({ref:e,email:t,addressType:a="shipping",contactAutocompleteType:o="email",disabled:i,label:s,onInputValueChange:r,caretPosition:l,inputMode:c,type:u="email",required:d,accessory:p}){const{i18n:h,shopPay:v}=y();K(()=>{if(l!==void 0&&e.current&&t?.value&&l<t.value.length)try{e.current.setSelectionRange(l,l)}catch{}},[t.value,l,e]),Qs();function m(){return v.userVerification.value.status==="loading"?n(et,{size:"small"}):p}return{label:s??h.translate("contact.email_label"),id:"email",name:"email",type:u,ref:e,autocomplete:di([a,o]),disabled:i,inputMode:c,...t,onInput:async g=>{const _=g.trim();t.onInput(_),r?.(_,dr(e.current)??0)},error:t.error,autoCapitalize:u==="text"?"off":void 0,accessoryEnd:m(),required:d}}function dr(e){try{return e?.selectionStart}catch{}}function pr(e,t,a="EMAIL"){const{email:o}=$(),{i18n:i,checkout:{validation:{contactErrors:{emailInputError:s,phoneInputError:r}},wallets:l},observability:c}
2=y(),{inMemoryApplePayParts:{asPaymentMethod:u,isLoadingPaymentSheet:d},inMemoryPayPalParts:{isLoadingPaymentSheet:p}}=Te();ra(m=>{if(a==="PHONE"){c.leaveErrorBreadcrumb("[ContactInformation] Journey listener skipped - input type is PHONE");return}if(m.type!=="error"){c.leaveErrorBreadcrumb(`[ContactInformation] Journey listener skipped - event type: ${m.type}`);return}if(l.activeSession.value&&!u.value){c.leaveErrorBreadcrumb("[ContactInformation] Journey listener skipped - wallet active without Apple Pay");return}if(m.negotiationStage==="negotiation"&&!d.value&&!p.value){c.leaveErrorBreadcrumb("[ContactInformation] Journey listener skipped - negotiation stage without wallet validation");return}c.leaveErrorBreadcrumb(`[ContactInformation] Processing ${m.violations.length} violations`);for(const g of m.violations){if(g.__typename!=="UnprocessableTermViolation"||!jt.has(g.code)||Aa(g.target))continue;const _=e||(g.localizedMessage??g.nonLocalizedMessage);s.value=_,r.value=void 0}});const h=ue(void 0),v=l.activeSession.value?h:s;return Yt(o,v,m=>{if(l.activeSession.value){c.leaveErrorBreadcrumb("[ContactInformation] Not val
2idating email - wallet session active");return}if(t)return c.leaveErrorBreadcrumb("[ContactInformation] Using custom email validation"),t(m);c.leaveErrorBreadcrumb("[ContactInformation] Using default email validation");const g=Hn(m,i.translate("field_errors.email_blank")),_=ot(m,i.translate("field_errors.email_invalid"));return g||_},jn.InvalidContactMethod),cn(o,v,a==="EMAIL"?t:void 0)}const hr="•";function Ua({showLogoutLink:e,logoutUrl:t}){const{i18n:a,shopPay:o,observability:i,source:s}=y(),r=ce().buyerIdentity.value,{firstName:l,lastName:c,email:u,phone:d}=r?.customerProfile??{},p=r?.purchasingCompany?.company.name,h=Ra(),v=s.type==="simulated",m=l||c,{phone:g}=$(),_=u??d,C=!p&&_?` (${_})`:"",{modalUrlOrigin:A,modalUpdatedOrigin:f,shopPayVerificationVisible:b,showShopPayVerification:w}=Va({isShopPayUnauthenticatedUser:o.user.isUnauthenticatedUser.value,email:u||""});return K(()=>{i.leaveErrorBreadcrumb(`[CustomerCard] Rendered - hasEmail: ${!!u}, hasPhone: ${!!d}`),r?.purchasingCompany||(g.value="")},[]),n(X,{children:[n(I,{direction:"inline",alignItems:"center",gap:"base",children:n(I,{gap:"small-400",children:[n(O,{children:m?`${a.translate("general.display_name",{firstName:l??"",lastName:c??""})}${C}`:C}),p?n(I,{direction:"inline",gap:"small-400",children:[n(O,{color:"subdued",type:"small",children:p}),u&&n(X,{children:[n(O,{color:"subdued",type:"small",children:hr}),n(O,{color:"subdued",type:"small",children:u})]})]}):null,e&&!v?n(I,{direction:"inline",gap:"base",children:n(me,{href:t,children:a.translate("customer_account.sign_out_link_label")})}):null]})}),u&&h.value&&n(xa,{email:u,open:b,showPopover:w,urlOrigin:A,updatedOrigin:f})]})}Ua.displayName="CustomerCard";function mr(){const{i18n:e}=y();return n(O,{color:"subdued",size:"small",accessibilityLive:"polite",children:e.translate("marketing.sms.disclaimer.description_transactional_html",{privacy_policy_modal_link:n(He,{handle:"privacy-policy",tone:"monochrome"}),terms_of_service_modal_link:n(He,{handle:"terms-of-service",tone:"monochrome"})})})}const vr="ZZ";function Bu({hideAllOptIns:e=!1,hideContactInfoEntry:t=!1,showEmailMarketingOptIn:a=!0,onValidateEmailInput:o}){const i=ce(),s=i.buyerIdentity.value?.customerProfile,r=pi().value,c=Qn()?.smsMarketingEnabled===!1,{client:u,checkout:d,i18n:p,checkout:{validation:{contactErrors:{emailInputError:h,phoneInputError:v}},wallets:m},shop:g}=y(),{emailMarketing:_,contactInfoOptions:C}=g,A=u.unstable_getSerialization("logoutUrl")||"",{isContact:f}=Vs().value,{showEmailMarketing:b}=d.configuration.visibility,w=g.hasFlagEnabled(wo),{value:k}=i.buyerIdentity,M=k?.countryCode,[z,F]=le(a&&Nt({emailMarketing:_,inputType:"EMAIL",hideNonEuropeMarketingOptInFlagEnabled:w,buyerCountryCode:M,customerProfile:s,showEmailMarketing:b})),[T,R]=le(!1),V=it(),{validatePhoneNumber:P}=is(),{negotiate:S}=ke(),D=j(ae=>{F(a&&Nt({emailMarketing:_,inputType:ae,hideNonEuropeMarketingOptInFlagEnabled:w,buyerCountryCode:M,showEmailMarketing:b})),R(!1)},[_,w,M,a,b]),W=Rs(),U=j(ae=>{const _e=Hn(ae,W.value),fe=ot(ae,p.translate("field_errors.email_invalid"));return _e||fe||o?.(ae)},[W,o,p]),ie=j(ae=>{const _e=Hn(ae,p.translate("field_errors.email_or_phone_blank"));if(_e)return R(!_e),_e;const fe=P(ae,V.value??vr)?void 0:p.translate("field_errors.address_phone_blank");return R(!fe),fe},[p,P,V]),re=bn(),J=hi(),N=j(({contact:ae})=>{m.activeSession.value||S({silenceViolations:["all"],include:[],fieldsToResolve:[...mi]}),ae.value=!0,re("sectionComplete",{section:"contact",timestamp:new Date}),J({type:"section_complete",section:"contact"})},[m,S,re,J]),B=j(({contact:ae})=>{ae.value=!1},[]),{email:H,phone:ee}=$(),x=se(()=>({state:{phone:ee,email:H},errors:{phone:v,email:h}}),[H,h,ee,v]),q=vn().value||!C.includes("PHONE"),Ce=!s?.email&&!s?.phone||q&&!s?.email;return n(qt,{children:n(Pn,{target:"cart.buyerIdentity",children:[s&&n(Ua,{showLogoutLink:r,logoutUrl:A}),!t&&Ce&&n(Zn,{...x,children:n(ss,{onValid:N,onInvalid:B,children:n(lr,{onInputTypeChange:D,onInlineEmailValidation:U,onInlinePhoneValidation:ie})})}),!e&&n(X,{children:[T&&!c?n(mr,{}):null,z?n(Da,{}):null,f&&n(Oa,{})]})]})})}
2function Nt(e){const{emailMarketing:t,inputType:a,hideNonEuropeMarketingOptInFlagEnabled:o,buyerCountryCode:i,customerProfile:s,showEmailMarketing:r}=e,l=o&&!No(i);return r&&t!=="OFF"&&a==="EMAIL"&&!l&&!s?.acceptsEmailMarketing}function za(){const e=vi(),{editorSetShopPaySignal:t}=qn(),a=j(o=>t.value?.setShopPay(o),[t]);return{setEditorShopPay:e&&t.value?a:void 0}}function yr(e){return t=>t?e[t]:void 0}function gr(){const{checkout:e}=y(),t=rs();return L(()=>t.value&&e.configuration.visibility.showExpressCheckout.value)}function _r(){const e=yi(),t=gr();return L(()=>e.value?"wallets":t.value?"skeleton":"hidden")}const fr="vT2w7",br="f1x20",Pr="hKWGx",Dt={ApplePayButton:fr,dark:br,light:Pr},kr=mn({displayName:"ApplePayButton",suspense:!1,renderLoading:e=>n(Sr,{...e}),useError:Ir,load:()=>Kn(()=>an(async()=>{const{ApplePayButton:e}=await import("./component-ApplePayButton.FD3NxrjC.js");return{ApplePayButton:e}},__vite__mapDeps([39,1,2,3,4,5,6,7,8,9,40,41,42,43,44,11,12,31,32,33,20,34,35,22,28,45,10,13,14,15,16,17,18,19,21,23,24,25,26,46,47,48,49,27,50,51,52,53,54,55])).then(({ApplePayButton:e})=>e))});function Cr(e){const{source:t}=y(),{buttonStatus:a,sessionLoadFailed:o}=Te().inMemoryApplePayParts;return Ps("ApplePay",t.type!=="simulated"&&a.value.status==="not_rendered"&&!o.value),n(kr,{...e})}function Sr({color:e}){const{i18n:t}=y();return n("button",{className:Pe(Dt.ApplePayButton,Dt[e],Jt.borderRadius,yn({focusRing:"base"})),lang:t.locale,disabled:!0,type:"button","aria-label":t.translate("brand.apple_pay")})}function Ir(e){const{observability:t}=y(),{buttonStatus:a}=Te().inMemoryApplePayParts;K(()=>{e&&(a.value={status:"error"},t.leaveErrorBreadcrumb("Apple Pay button chunk failed to load",{wallet:be.ApplePay,errorName:e.name,errorMessage:e.message}),t.counter({name:"checkout_wallet_button_rendered",value:1,attributes:{wallet_name:be.ApplePay,status:"error",reason:"chunk_load_error",isPaymentMethodFlow:!1}}))},[a,e,t])}const Lr=mn({displayName:"PortableWalletsPCIButtonContent",load:()=>an(()=>import("./component-amazonWalletLazy.CerghXi9.js"),__vite__mapDeps([56,1,6,2,3,4,5,7,8,9,57,14,58,59,60,61,62])).then(e=>e.PortableWalletsPCIButtonContent),useError:ls});function Ar(e){return n(Lr,{...e})}const Mr="Xicuw",Ot={Button:Mr,"Button--contrast":"oHCaH"},Er="shop-pay-button";function Tr(){const{shopPay:e,observability:t,checkout:{wallets:a}}=y(),o=e.app.config,i=As(be.ShopifyPay),s=Xi({foregroundColor:Is}),r=Ls(),l=Do(o,r),c=os(Oo.DirectCheckoutCheckout),u=gi(),d=_i(be.ShopifyPay),{setEditorShopPay:p}=za();K(()=>{t.counter({name:"checkout_wallet_button_rendered",value:1,attributes:{wallet_name:"SHOP_PAY",status:"success"}})},[t]);const h=j(()=>{i(Un.Success),d(),a.setActiveSession({newValue:"SHOP_PAY",asPaymentMethod:!1}),a.clearActiveSession({invokingWallet:"SHOP_PAY"})},[a,d,i]),v=j(g=>{if(p){g.preventDefault(),p(!0);return}h()},[h,p]),m=Pe(Ot.Button,{[Ot["Button--contrast"]]:!s&&!l},Jt.borderRadius,yn({focusRing:"base"}));return n("a",{id:Er,href:c,ref:u("shop_pay"),className:m,onClick:v,children:e.logoBrand==="shop"?n(Ji,{size:"medium"}):n(ms,{size:"medium"})})}function wr(){const e=Te();return L(()=>xo.some(t=>Nr(e,t)))}function Nr(e,t){const a=!!e.acceleratedWalletPaymentMethods.value.find(i=>i.name===t),o=(()=>{switch(t){case"APPLE_PAY":{const{buttonStatus:i,sessionLoadFailed:s}=e.inMemoryApplePayParts;return s.value?void 0:i.value}case"PAYPAL_EXPRESS":return e.inMemoryPayPalParts.acceleratedCheckoutButtonStatus.value;case"VENMO":return e.inMemoryVenmoParts.buttonStatus.value;case"GOOGLE_PAY":return e.inMemoryGooglePayParts.buttonStatus.value;case Ae.AmazonPay:return e.inMemoryAmazonPayParts.buttonStatus.value;case Ae.BuyWithPrime:return e.inMemoryAmazonPayParts.buyWithPrimeButtonStatus.value;default:return}})();return a&&o?.status==="not_rendered"}function Dr(){const{source:e}=y(),t=wr(),a=e.type==="simulated";return L(()=>!a&&t.value)}function Or(){const{i18n:e}=y();return n(kn,{open:!0,blocking:!0,accessibilityLabel:e.translate("wallets.payment_in_progress_title"),padding:"none",children:n(I,{gap:"large-200",padding:"large-200",children:[n(Ge,{level:1,children:e.translate("wallets.payment_in_progress_t
2itle")}),n(O,{children:e.translate("wallets.payment_in_progress_body")})]})})}const xr="o1z23",Br="_4aXW0",Fr="DUnBb",Rr="kTI19",Vr="JH5oc",Hr="Athif",Ur="pUo2R",zr="_5SdgT",Wr="RKgRy",$r="iRnuh",Gr="QKTth",Kr="Pnahu",qr="OTERX",jr="WTXfy",Yr="qLVAT",Xr="XHLFs",Jr="xBRI9",Z={Header:xr,Text:Br,Layout:Fr,StackWrapper:Rr,SkeletonWrapper:Vr,SkeletonExited:Hr,ButtonWrapper:Ur,loading:zr,subsequentLoad:Wr,Stack:$r,SimulatedWalletStack:Gr,ShopPayEmphasis:Kr,Container:qr,DrawerLink:jr,InnerDrawerLink:Yr,DrawerHideButtons:Xr,walletItem:Jr},lt="express-checkout-heading";function Wa({buttonCount:e,footer:t,children:a}){const{i18n:o}=y();return n(G,{className:Z.Container,"data-count":e,children:[n("div",{className:Z.Header,children:n(es,{id:lt,className:Z.Text,children:o.translate("alternative_payment_method_banner.express_checkout")})}),n("div",{className:Z.StackWrapper,children:[n("div",{className:Z.Layout,children:a}),t]})]})}function $a({count:e,transition:t,shopPayEmphasis:a=!1,hideWallets:o=!1}){const{client:i}=y(),s=i.unstable_getSerialization("workerVersion")!=="fast";return n("div",{className:Pe(Z.Stack,Z.SkeletonWrapper,{[Z.SkeletonExited]:t==="exited",[Z.ShopPayEmphasis]:a,[Z.DrawerHideButtons]:o}),children:[...Array(e).keys()].map(r=>n(fi,{delay:s},r))})}const Qr="express-checkout-wallets-wrapper",Zr=/(iPhone|iPod|iPad|Mac OS)/i,el=/((iPhone|iPod|iPad).*AppleWebKit(?!.*(Safari|instagram|FBAV|FB_IAB)))/i,nl=/(ShopifyCheckoutSDK|CheckoutSheetProtocol|ShopifyCheckoutKit)/i;function tl(){const{client:{userAgent:e},embed:t}=y(),a=el.test(e),o=Zr.test(e)&&nl.test(e),i=t!==void 0&&(t.platform==="SWIFT"||t.platform==="REACT_NATIVE_SWIFT");return!(o||a||i)}function al(){const{source:e}=y(),t=e.type==="simulated",{inMemoryApplePayParts:{buttonStatus:a,sessionLoadFailed:o},inMemoryPayPalParts:{acceleratedCheckoutButtonStatus:i},inMemoryVenmoParts:{buttonStatus:s},inMemoryGooglePayParts:{buttonStatus:r},inMemoryAmazonPayParts:{buttonStatus:l,buyWithPrimeButtonStatus:c},inMemoryShopPayParts:{buttonStatus:u},acceleratedWalletPaymentMethods:d}=Te(),p=d.value;return se(()=>p.flatMap(h=>{switch(h.name){case"PAYPAL_EXPRESS":return Ve(i,be.PayPalV6);case"VENMO":return Ve(s,be.Venmo);case"GOOGLE_PAY":return Ve(r,be.GooglePay);case"SHOP_PAY":return Ve(u,be.ShopifyPay);case Ae.AmazonPay:return Ve(l,Ae.AmazonPay);case Ae.BuyWithPrime:return Ve(c,Ae.BuyWithPrime);case"APPLE_PAY":return Ve(a,be.ApplePay,()=>!t&&!o.value);default:return[]}}),[a,o,p,l,c,r,t,i,u,s])}function Ve(e,t,a){return{walletName:t,isRendered:()=>e.value?.status==="rendered",isLoading:()=>e.value?.status==="not_rendered"&&(a?.()??!0),onTimeout:()=>{e.value={status:"error"}}}}function ol(e){const{observability:t}=y(),a=te(performance.now()),o=se(()=>e.filter(({walletName:r})=>r!==be.ShopifyPay),[e]),i=te(new Set),s=de(o);Me(()=>{s.value.forEach(r=>{r.isRendered()&&!i.current.has(r.walletName)&&(i.current.add(r.walletName),t.histogram({name:"wallet_express_button_ready_time",value:performance.now()-a.current,unit:"ms",attributes:{wallet_name:r.walletName,isPaymentMethodFlow:!1}}))})})}function il({buttonCount:e,children:t,walletPaymentMethods:a}){const[o,i]=le(performance.now()),[s,r]=le(!0),l=tl(),c=Ze(),{inMemoryApplePayParts:{paymentSheetError:u}}=Te(),d=Dr().value,p=al();Cs(p),ol(p);const h=ce().managedByMarketsPro,v=bi(d,"base"),[m,g]=le(!1),_=vn(),{checkout:C,i18n:A,shop:{id:f},source:b,observability:w,userEvents:k}=y(),M=Pi(),z=L(()=>c.value&&Bo({hasSubscription:Qt({checkout:C}),isApplePayAvailable:a.value.some(({name:S})=>S==="APPLE_PAY"),variant:M})==="full_express_agreement"),F=gs();_s(a.value,e);const T=j((S,D)=>{const W=parseInt($e(f),10),U=fs({state:D,shopId:W,nascarData:{...S,walletsRenderedCount:e},paymentMethods:a.value});U&&k.monorailEvent(U)},[f,k,e,a]),V=a.value.some(S=>S.name==="SHOP_PAY")&&l;!d&&!m&&(g(!0),i(S=>performance.now()-S)),K(()=>{m&&w.histogram({name:"wallets_container_render_time",value:o})},[m,w,o]);const P=te(!1);return K(()=>{b.type!=="simulated"&&v==="exited"&&!P.current&&(P.current=!0,performance.mark(Fo))},[b,v]),n(X,{children:[n(Wa,{buttonCount:e,footer:n(X,{children:[n("div",{className:Z.DrawerLink,children:n(me,{accessibilityLive:"polite",textDecoration:"none",onClick:()=>{s?(r(!1),T(F.value,Un.NascarDrawerOpen)):(r(!0),T(F.value,Un.NascarDrawerClose))},children:n("div",{className:Z.InnerDrawerLink,children:[n(O,{children:s?A.translate("alternative_payment_method_banner.show_more_options"):A.translate("alternative_payment_method_banner.hide_more_options")}),n(oe,{type:s?"chevron-down":"chevron-up",size:"small-200"})]})})}),n(Y,{when:_,children:n(Ss,{isForExpressCheckout:!0,showFullSubscriptionConsent:z})}),n(Y,{when:h,children:n(I,{gap:"base",padding:"large-100 none none none",children:n(Ms,{textProps:{color:"subdued",size:"small"}})})})]}
2),children:[n($a,{count:Math.min(e,4),transition:v,shopPayEmphasis:V,hideWallets:s}),n("ul",{id:Qr,role:"list",className:Pe(Z.Stack,Z.ButtonWrapper,{[Z.loading]:d,[Z.subsequentLoad]:d&&m,[Z.DrawerHideButtons]:s,[Z.ShopPayEmphasis]:V}),children:c.value&&t})]}),u?.value?.type==="payment_cancelled_while_processing"&&n(Or,{})]})}function Ga(){const{i18n:e}=y(),{divider:{borderStyle:t,borderWidth:a}}=ki(),{main:{divider:{borderStyle:o=t,borderWidth:i=a}={},section:s,spacing:r}}=da(),l=Ro(s);return n(G,{padding:l?`@media (inline-size >= extraSmall) ${r?Pt(r):"large-200"} none, ${r?Pt(r):"base"} none`:"large-100 none large-300 none",children:n(Ue,{borderStyle:o,borderWidth:Vo(i),children:n(Ee,{textAlign:"center",children:n(O,{color:"subdued",children:e.translate("alternative_payment_method_banner.or")})})})})}const xt=3;function sl(){return n(X,{children:[n(ze,{accessibilityLabelledBy:lt,children:n(Wa,{buttonCount:xt,children:n($a,{count:xt,shopPayEmphasis:!0})})}),n(Ga,{})]})}const rl="_2SmAP",ll="eFu6h",Ka={MessageWrapper:rl,SimulatedWalletWrapper:ll},cl=e=>e,Fu=go(function(){const{i18n:t,source:a}=y(),o=a.type==="simulated",{acceleratedWalletPaymentMethods:i,buttonCount:s}=Te(),r=Ci(),l=_r(),{setEditorShopPay:c}=za(),{expressCheckout:{button:{cornerRadius:u}={}}}=da(),d=xe("Checkout::Dynamic::Render","WALLETS1"),p=Si(),h=o&&p.value&&!i.value.length;switch(l.value){case"hidden":return null;case"skeleton":return n(sl,{})}const v=n("li",{className:Z.walletItem,children:n(G,{padding:"large-200",borderRadius:"base",blockAlignment:"center",inlineAlignment:"center",minInlineSize:"100%",className:Ka.MessageWrapper,children:n(O,{color:"subdued",children:t.translate("payment.simulated_express_checkout")})})});return n("div",{style:{...dl(u)},children:[n(ze,{accessibilityLabelledBy:lt,children:n(nt,{sectionId:"expressCheckout",children:n(Ii,{section:"expressCheckout",children:[n(Be,{customizations:d,gap:"large-200",render:cl}),d.length>0&&n(pa,{blockSize:"large-200"}),n(il,{buttonCount:h?1:s,walletPaymentMethods:i,children:h?v:n(ul,{paymentMethods:i.value,triggerProgression:r.value,isSimulated:o,preserveShopPay:!!c})})]})})}),n(Ga,{})]})});function ul({paymentMethods:e,triggerProgression:t,isSimulated:a,preserveShopPay:o}){const i=ha(),s=vs();return n(X,{children:e.map(r=>{if(a&&r.name==="VENMO")return null;const l=a&&r.name==="SHOP_PAY"&&o;return n("li",{className:Z.walletItem,children:a&&!l?n(G,{className:Ka.SimulatedWalletWrapper,children:n(G,{className:Pe([Z.walletButton,Z.Stack,Z.SimulatedWalletStack]),inert:!0,children:n(Bt,{method:r,triggerProgression:t})})}):n(Bt,{method:r,triggerProgression:t})},`${r.name}-${i}-${s.value}`)})})}function dl(e){return e&&{"--x-express-checkout-button-border-radius":yr(Ho.borderRadius)(e)}}function Bt({method:e,triggerProgression:t}){const a=ha();switch(e.name){case"APPLE_PAY":return n(Cr,{supportedNetworks:e.supportedNetworks,color:a});case"PAYPAL_EXPRESS":return n(Lt,{progressToNextPage:t});case"VENMO":return n(Lt,{fundingSource:"venmo",buttonColor:"blue",progressToNextPage:t});case"SHOP_PAY":return n(Tr,{});case"GOOGLE_PAY":return n(ys,{});case Ae.AmazonPay:return n(cs,{});case Ae.BuyWithPrime:return n(Ar,{wallet:Ae.BuyWithPrime});default:return null}}const pl=["ApplePay","GooglePay","PayPal","Venmo"];function Ru({id:e}){return ks({id:e,stage:({pendingComponents:t})=>pl.some(o=>t.has(o))?It.Usable:It.Complete}),null}function Vu(){const e=ce(),t=e.buyerIdentity.value?.customerProfile,{i18n:a}=y(),o=Li().value,{value:i}=e.buyerIdentity,s=$().rememberMe,r=!!i?.rememberMe||s.value,l=ue(r),{negotiate:c}=ke(),d=Qn()?.saveShippingAddressCheckboxEnabled??!0,p=!!t,h=$().shippingAddress.value,v=!o&&d&&!p&&!h.oneTimeUse,m=j(g=>{l.value=g,s.value=g,c({})},[c,s,l]);return v?n(st,{id:"save_shipping_information",name:"save_shipping_information",checked:l.value,onChange:m,label:a.translate("customer_account.save_my_information_label")}):null}function hl(e,t){return t.some(a=>e.includes(a))}function ml({options:e,selected:t,select:a}){const{i18n:o,source:i}=y(),s=i.type==="simulated",r=ce(),l=r.deliveryNext,c=r.paymentLines,u=Ke("deliveryNext"),d=L(()=>{const p=Xn(l.value,"ONE_TIME_PURCHASE"),h=Zt(c?.value?.lines,"APPLE_PAY")!==void 0,v=p?.status==="available"&&!u.value&&p.hasDeliveryLineChange;return!h&&v});return n(X,{children:[n(Y,{when:d,children:()=>n(qe,{tone:"warning",errorType:nn.DeliveryError,children:o.translate("shipping_errors.shipping_method")})}),s&&e.map(p=>n(nt,{sectionId:`deliveryMethods-${p.id}`},p.id)),n(rt,{name:"delivery_strategies",title:o.translate("general.choose_delivery_strategy"),titleHidden:!0,values:t,onChange:a,children:e.map(p=>n(In,{value:p.id,accessibilityLabel:p.label,secondaryContent:n(oe,{type:p.icon,tone:hl(t,p.value)?"accent":void 0}),children:p.label},p.id))})]})}const qa=_o(null);function vl(){return fo(qa)}var Le={Fieldset:"_16tpi2ma _1fragemeg _1fragemdw _1fragemf0 _1fragemdc _1fragemqt _1fragemsm _1fragemp0 _1fragemuf _1fragem11h",Legend:"_16tpi2mb _1fragemnh",Segments:"_16tpi2me _16tpi2md _1fragemws _1fragem6t _1fragemx7",ChoiceSegmented:"_16tpi2m3 _16tpi2m2 _1fragem7n _1fragem9g _1fragemq4 _1fragemob _1fragemtb _1fragemri _1fragemyl _1fragem12z _1fragemyd _1fragem64 _1fragem73 _1fragem19 _1fragembj _1fragem124 _1fragemzi",ChoiceSegmentedSelected:"_16tpi2mc _1fragemy6",PrimaryContent:"_16tpi2m4 _1fragem7s _1fragem9l _1fragem64 _1fragem19 _1fragembj",contentDirectionVariant:{auto:"_16tpi2m7",inline:"_16tpi2m8 _16tpi2m5 _1fragem78",block:"_16tpi2m9 _16tpi2m6 _1fragem73"},Input:"_16tpi2m1 _1fragem121",inert:"_16tpi2mf _1fragemz0 _1fragem11v"};function yl({name:e,label:t,labelAccessibilityVisibility:a="visible",contentDirection:o="auto",selected:i,onChange:s,children:r}){const l=j(p=>s(p),[s]),c=se(()=>({name:e,selected:i,select:l,contentDirection:o}),[e,i,l,o]);let u;t&&a==="exclusive"?u=n("legend",{className:yn({screenReaders:"only"}),children:t}):t&&(u=n("legend",{className:Le.Legend,children:n(Ge,{level:3,accessibilityRole:"presentation",children:t})}));const d=n("div",{className:Le.Segments,"data-choice-list-segmented-part":"control",children:r});return n(qa.Provider,{value:c,children:t?n("fieldset",{className:Le.Fieldset,children:[u,d]}):d})}function gl({value:e,children:t,icon:a,secondaryContent:o,accessibilityLabel:i}){const s=vl(),r=Ai();if(!s)return console.warn(`Unable to render ChoiceSegmented (value: "${e}"). Verify it is a child of ChoiceListSegmented.`),null;const{name:l,selected:c,select:u,contentDirection:d}=s,p=c===e;return n("label",{className:Pe(Le.ChoiceSegmented,p&&Le.ChoiceSegmentedSelected,r&&Le.inert),"data-choice-list-segmented-part":"segment",children:[n("input",{id:`${l}-${e}`,type:"radio",name:l,value:e,checked:p,disabled:r,"aria-label":i,"aria-hidden":r?!0:void 0,tabIndex:r?-1:void 0,className:Le.Input,onChange:()=>u(e)}),n("span",{className:Pe(Le.PrimaryContent,Le.contentDirectionVariant[d]),children:[a&&n(oe,{type:a,color:"strong"}),n(O,{type:"strong",children:t})]}),o&&n(O,{color:"subdued",children:o})]})}function _l(){const{i18n:e}=y(),t=ce(),a=Ke("deliveryNext").value,o=Xn(t.deliveryNext.value,"ONE_TIME_PURCHASE"),i=t.paymentLines?.value?.lines,s=Zt(i,"APPLE_PAY")!==void 0,r=o?.status==="available"&&!a&&o?.hasDeliveryLineChange;return!s&&r?n(qe,{tone:"warning",errorType:nn.DeliveryError,children:e.translate("shipping_errors.shipping_method")}):null}const fl="qX6SV",bl={Wrapper:fl},Dn="PICK_UP_AND_SHIP";function Pl(e,t){switch(e){case"PICK_UP":return t.translate("split_delivery.pickup_all_items");case"SHIPPING":return t.translate("split_delivery.ship_all_items");default:bo(e)}}function kl(e){return e.id==="PICK_UP"||e.id==="SHIPPING"}function Cl({options:e,selectedIndex:t,select:a}){const{i18n:o,observability:i}=y(),s=j(c=>{c!==Dn&&a([c])},[a]),r=e.filter(kl),l=te(!1);if(!l.current&&r.length<e.length){l.current=!0;
2const c=e.filter(({id:u})=>u!=="PICK_UP"&&u!=="SHIPPING").map(({id:u})=>u).join(", ");i.log("split_ship_pickup_delivery_method_selector","Unexpected delivery method options for split ship/pickup selector",{optionIds:c})}return n("div",{className:Pe(bl.Wrapper,yn({colorLayer:"control"})),style:{"--option-count":e.length,"--selected-index":t},children:n(ma,{name:"delivery_strategies",value:Dn,onChange:s,children:[n(Vn,{value:Dn,children:o.translate("split_delivery.pickup_and_ship")}),r.map(({id:c})=>n(Vn,{value:c,children:Pl(c,o)},c))]})})}function Sl(e){const{source:t,userEvents:a,shop:{id:o},checkout:{identity:i}}=y(),s=i.current.value==="shopPay",r=ce().buyerIdentity.value?.customerProfile;function l(c){let u;switch(c){case"SHIPPING":u="checkout_shipping_tab_clicked";break;case"PICK_UP":u="checkout_pickup_tab_clicked";break;case"PICKUP_POINT":u="checkout_pickup_point_tab_clicked";break}if(!u)return;const d=e&&"methods"in e?e?.methods.length:void 0;a.monorailEvent({schemaId:"local_pickup_checkout/3.1",payload:{checkoutToken:t.checkoutSessionIdentifier||"",eventType:u,shopId:parseInt($e(o),10),numberLocationsFound:d,userId:r?.id?parseInt($e(r.id),10):void 0,checkoutSurface:s?"shop_pay":"guest_checkout"}})}return{deliveryMethodSelectorClickEvent:l}}const Il="SnB3D",Ll="_207IL",Al="wvTT8",On={Entrance:Il,SplitCollapse:Ll,PillViewTransition:Al},Ml=16;function El({options:e,selected:t,select:a,showChangedBanner:o=!0}){const{i18n:i,source:s}=y(),r=s.type==="simulated",l=ce(),{value:c}=l.deliveryNext,u=tn(),d=Xn(c,"ONE_TIME_PURCHASE"),{deliveryMethodSelectorClickEvent:p}=Sl(d),h=L(()=>!u.value),v=ue(!1);Gn(()=>{let f=u.peek();return Po(()=>{const b=u.value;f&&!b&&(v.value=!0),f=b})},[u,v]);const m=j(()=>{v.value=!1},[v]),g=j(([f])=>{if(!f||t.value.includes(f))return;const b=e.value.findIndex(M=>M.id===t.value[0]),k=e.value.findIndex(M=>M.id===f)>b?"delivery-slide-end":"delivery-slide-start";Uo(()=>{a([f])},[k]),p(f)},[a,t,p,e]),_=L(()=>e.value.findIndex(f=>f.id===t.value[0])),C=L(()=>e.value.length),A=L(()=>e.value.some(f=>f.label.length>Ml));return n("div",{className:On.Entrance,children:[o&&n(_l,{}),r&&n(Bn,{each:e,getKey:f=>f.id,children:f=>n(nt,{sectionId:`deliveryMethods-${f.id}`})}),n(Y,{when:h,fallback:n(Cl,{options:e.value,selectedIndex:_.value,select:a}),children:n("div",{style:{"--selected-index":_.value,"--option-count":C.value},className:Pe(On.PillViewTransition,{[On.SplitCollapse]:v.value}),onAnimationEnd:m,children:n(yl,{name:"delivery_method",label:i.translate("general.choose_delivery_strategy"),labelAccessibilityVisibility:"exclusive",selected:t.value[0],onChange:f=>g([f]),contentDirection:A.value?"block":"auto",children:n(Bn,{each:e,getKey:f=>f.id,children:({id:f,label:b,icon:w})=>n(gl,{value:f,icon:w,children:b})})})})})]})}function Hu(){const e=Mi();if(!e)return null;const{variant:t,...a}=e;return t==="next"?n(El,{...a}):n(ml,{options:a.options.value,selected:a.selected.value,select:a.select})}function Tl(e,t,a){function o(i){const s=t[i]??[];return a.some(r=>s.includes(r))}return e.flatMap(i=>i.lineComponents.length>0?i.lineComponents.filter(s=>!o(s.stableId)):o(i.stableId)?[]:[i])}function wl(e,t){return e.length===0?!1:t==="PICK_UP"?e.every(a=>a==="SHIPPING"||a==="LOCAL"):e.every(a=>a==="PICK_UP")}function Nl({violationLines:e,deliveryMethodType:t,proposedDeliveryLines:a,proposedMerchandiseLines:o}){const i=new Set(a.filter(r=>wl(r.value.deliveryMethodTypes,t)).flatMap(r=>r.value.targetMerchandiseLines??[]).map(r=>r.stableId)),s=o.length>0;return e.filter(r=>{const l=zo(o,r.stableId),c=l?.stableId??r.stableId;return!(i.has(r.stableId)||i.has(c)||s&&l==null)})}const Dl=["DELIVERY_NO_DELIVERY_STRATEGY_AVAILABLE_FOR_MERCHANDISE_LINE","MERCHANDISE_OUT_OF_STOCK_IN_CONTEXT"];function ja(e){const{shop:{shipPickupInOneOrderEnabled:t}}=y(),{allViolations:a,merchandiseLines:o,deliveryNext:i}=ce(),s=Fe(),r=tn(),{deliveryLines:l,merchandiseLines:c}=$();return L(()=>{const u=!!(i.value&&"supportsSplitDeliveryMethod"in i.value&&i.value.supportsSplitDeliveryMethod),d={allViolations:a.value,deliveryMethodsByMerchandise:s.value.deliveryMethodsByMerchandise,isSplitShipAndPickup:r.value,negotiatedMerchandiseLines:o.value,proposedDeliveryLines:l.value,proposedMerchandiseLines:c.value},p=t&&u;return e.mode==="localPickup"?Ol({canUseDeliveryMethodScopedViolations:p,state:d}):p?xl({deliveryMethodType:e.deliveryMethodType,state:d}):zn()})}function zn(){return{merchandiseLines:[],allowAlternativeAction:!1}}function Ol({canUseDeliveryMethodScopedViolations:e,state:t}){if(e){const a=Wn({deliveryMethodType:"PICK_UP",suppressUnscopedPickupViolations:t.isSplitShipAndPickup,state:t});if(a.length>0)return{merchandiseLines:a,allowAlternativeAction:!0}
2}return t.isSplitShipAndPickup||!Bl(t.negotiatedMerchandiseLines)?zn():{merchandiseLines:Wn({deliveryMethodType:"PICK_UP",suppressUnscopedPickupViolations:!1,state:t}),allowAlternativeAction:!1}}function xl({deliveryMethodType:e,state:t}){return{merchandiseLines:Wn({deliveryMethodType:e,suppressUnscopedPickupViolations:e==="PICK_UP"&&t.isSplitShipAndPickup,state:t}),allowAlternativeAction:!0}}function Bl(e){return(e?.lines.filter(({requiresShipping:a})=>a).length??0)>1}function Wn({deliveryMethodType:e,suppressUnscopedPickupViolations:t,state:{allViolations:a,deliveryMethodsByMerchandise:o,negotiatedMerchandiseLines:i,proposedDeliveryLines:s,proposedMerchandiseLines:r}}){const l=a&&i?va(a,i,Dl)??[]:[],c=Tl(l,o,[e]),u=t?c.filter(d=>(o[d.stableId]??[]).length>0):c;return Nl({violationLines:u,deliveryMethodType:e,proposedDeliveryLines:s,proposedMerchandiseLines:r})}const ct={MILES:100,KILOMETERS:200},Fl=100;function ut(e,t){const a=t&&(t.unit==="MILES"?"mi":"km"),o=t&&t.value<Fl?1:0;return[t&&e.numberFormatter({minimumFractionDigits:0,maximumFractionDigits:o}).format(t.value),a].join(" ").trim()}function pn(e){const{pickupLocation:t}=e;return t&&"distanceFromBuyer"in t?t.distanceFromBuyer:void 0}const Rl=e=>e.every(t=>{const a=pn(t);return a?.value&&a.value>ct[a.unit]}),Vl=e=>e.every(t=>pn(t)?.unit==="MILES");function Hl({postalCode:e,city:t,zoneCode:a}){const o=["address2","company","firstName","lastName","phone"];return e?[...o,"zoneCode","city","address1","countryCode"]:t?[...o,"zoneCode","address1","countryCode"]:a?[...o,"zoneCode"]:[...o,"address1"]}function Ya(e,t){const a=e.lastIndexOf(",");if(a===-1)return e.length>t?`${e.slice(0,t)}...`:e;const o=e.slice(0,a),i=e.slice(a);return o.length>t?`${o.slice(0,t)}...${i}`:e}function we(){const{locationAddress:e}=$(),t=e.peek(),{countryCode:a,postalCode:o,city:i}=t,s=!!(a&&!o&&!i),{details:r}=ea(a);return{isOnlyCountryAvailable:s,fullCountryName:r?.name||void 0,formattedAddress:Ei(t,{hiddenFields:Hl(t),multiline:!1,countryFormat:"explicit"})}}const Ul=13;function Xa({onClick:e,commandFor:t}){const{i18n:a}=y(),{formattedAddress:o}=we(),i=a.translate("local_pickup.toggle_location");return n(ye,{variant:"plain",textDecoration:"none",inlineAlignment:"start",accessibilityLabel:o?`${i}, ${o}`:i,onClick:e,commandFor:t,children:o?n(I,{direction:"inline",gap:"small-500",alignItems:"center",children:[n(oe,{type:"geolocation",size:"small-100"}),n(O,{children:Ya(o,Ul)})]}):n(O,{children:i})})}const zl="qIyj1",Wl="oCDzB",Ft={Distance:zl,FromLocation:Wl};function dt({itemCount:e,methods:t,onChangeLocationClick:a}){const{i18n:o}=y(),{isOnlyCountryAvailable:i,formattedAddress:s}=we(),r=je({methods:t});if(K(()=>{i||r("pickup_long_distance_banner_rendered")},[r,i]),i)return null;const l=Vl(t)?"MILES":"KILOMETERS",c=ut(o,{value:ct[l],unit:l}),u=n("span",{className:Ft.FromLocation,children:s});function d(){r("pickup_long_distance_banner_change_location_click"),a?.()}return n(Cn,{children:n(O,{children:s?o.translate("local_pickup.all_stores_far_away.title_with_item",{distance:n("span",{className:Ft.Distance,children:c}),location:a?n(me,{tone:"monochrome",onClick:d,children:u}):u,count:e}):o.translate("local_pickup.all_stores_far_away.title",{distance:c})})})}function pt(){const{i18n:e}=y();return n(qe,{autoFocus:!0,tone:"warning",errorType:nn.DeliveryError,heading:e.translate("local_pickup.selected_pickup_option_no_longer_available.title"),children:n(O,{children:e.translate("local_pickup.selected_pickup_option_no_longer_available.description")})})}function ht({allLocationsFarAway:e,selectedPickupOptionNoLongerAvailable:t}){const a=Ke("deliveryNext");return L(()=>e.value&&!t.value&&!a.value)}function Ja(){const{negotiate:e}=ke(),{deliveryLines:t,merchandiseLines:a,discountLines:o}=$();return i=>{na({deliveryLines:t,merchandiseLines:a,merchandiseStableIds:i,discountLines:o}),e({include:["deliveryNext","merchandiseLines"]})}}function $l({allLinesAlternativeEligible:e,isPickupBanner:t,variantIds:a}){const{userEvents:o,shop:i,source:s,checkout:{identity:r}}=y(),{merchandiseLines:l}=ce();let c="remove_only";e&&(c=t?"remove_or_switch_to_shipping":"remove_or_switch_to_pickup");const u=t?"pick-up":"shipping",d=a.join(","),p=se(()=>a.map(h=>{if(h)try{return parseInt($e(h),10)}catch{return}}).filter(h=>h!==void 0),[d]);return j(h=>{const v={schemaId:"checkout_inventory_split_buyer_decision/2.0",payload:{shopId:parseInt($e(i.id),10),checkoutToken:s.checkoutSessionIdentifier??"",productVariantIds:p,bannerType:c,buyerAction:h,deliveryMethodType:u,checkoutSurface:Gl(r),sourceName:"checkout_one",checkoutProductVariantsCount:l.value?.lines.length}};o.monorailEvent(v)},[c,u,r,l,o,p,i,s])}function Gl(e){return e.current.value==="shopPay"?"shop_pay":"guest_checkout"}function Rt(e){requestAnimationFrame(()=>{De({content:e,role:"status"})})}function $n({merchandiseLines:e,bannerType:t,allowAlternativeAction:a}){const{i18n:o}=y(),i=ya(),s=Ja(),r=Fe(),l=Ta(),c=t==="pickup",u=Array.from(new Map(e.value.map(P=>[P.stableId,P])).values()),d=u.map(({stableId:P})=>P),p=new Map;for(const P of u){const S=p.get(P.digest);S?p.set(P.digest,{...S,quantity:S.quantity+P.quantity}):p.set(P.digest,P)}const h=Array.from(p.values()),v=u.reduce((P,{quantity:S})=>P+Math.max(1,S),0),m=c?"SHIPPING":"PICK_UP",{deliveryMethodsByMerchandise:g}=r.value,_=u.filter(({stableId:P})=>g[P]?.includes(m)),C=_.map(({stableId:P})=>P),A=_.reduce((P,{quantity:S})=>P+Math.max(1,S),0),f=(a?.value??!0)&&!l.value&&C.length===d.length&&A>0,b=$l({allLinesAlternativeEligible:f,isPickupBanner:c,variantIds:u.map(P=>P.variantId)});if(u.length===0)return null;const w=c?o.translate("split_delivery.inventory_issue_banner.heading.cannot_be_picked_up",{count:v}):o.translate("split_delivery.inventory_issue_banner.heading.cannot_be_shipped",{count:v}),k=f?o.translate("split_delivery.inventory_issue_banner.remove_item",{count:v}):o.translate("split_delivery.inventory_issue_banner.remove_item_only",{count:v}),M=c?o.translate("split_delivery.inventory_issue_banner.ship_separately",{count:A}):o.translate("split_delivery.inventory_issue_banner.pick_them_up_in_store",{count:A}),z=h.map(({title:P,subtitle:S,quantity:D})=>{const W=S?`${P} / ${S}`:P;return D>1?o.translate("split_delivery.inventory_issue_banner.merchandise_line_with_quantity",{title:W,quantity:D}):W}).join(", "),F=()=>
2{b("remove_items"),s(d),Rt(o.translate("split_delivery.accessibility.status.remove_items",{items:z}))},T=()=>{b("switch_delivery_method"),i({targetDeliveryMethodType:m,merchandiseStableIds:C}),Rt(c?o.translate("split_delivery.accessibility.status.ship_separately",{items:z}):o.translate("split_delivery.accessibility.status.pickup_in_store",{items:z}))},R=n(me,{onClick:F,children:k});let V=R;if(f){const P=n(me,{onClick:T,children:M});V=c?n(X,{children:o.translate("split_delivery.inventory_issue_banner.remove_items_or_ship",{ship_separately_link:P,remove_items_link:R})}):n(X,{children:o.translate("split_delivery.inventory_issue_banner.remove_items_or_pickup",{pickup_in_store_link:P,remove_items_link:R})})}return n(qe,{tone:"critical",errorType:nn.DeliveryError,heading:w,children:n(I,{gap:"small-300",children:[n(ga,{gap:"small-300",children:h.map(({stableId:P,title:S,subtitle:D,quantity:W})=>{const U=D?`${S} / ${D}`:S;return n(_a,{children:W>1?o.translate("split_delivery.inventory_issue_banner.merchandise_line_with_quantity",{title:U,quantity:W}):U},P)})}),n(O,{children:V})]})})}function Ln({hideText:e,singleItem:t}){const{i18n:a}=y(),i=en().value?.methods??[],s=t?1:i.length||2,r=Array.from({length:s},(l,c)=>`LocationSkeleton${(c+1).toString()}`);return n(X,{children:[e?null:n(I,{gap:"base",padding:"small-400 none base none",children:n(pe,{size:"extraSmall",children:a.translate("shipping.waiting_on_pickup_location_notice")})}),n(Es,{border:"none",background:"transparent",children:n(Ts,{name:"skeleton-loading",variant:"block",hideRadioControl:r.length===1,children:r.map(l=>n(In,{disabled:!0,value:l,accessibilityLabel:a.translate("general.loading"),secondaryContent:n(I,{gap:"small-400",alignItems:"end",children:[n(pe,{inlineSize:"small",size:"small"}),n(pe,{inlineSize:"base",size:"small"})]}),children:n(I,{gap:"small-400",children:[n(pe,{inlineSize:"small",size:"small"}),n(pe,{inlineSize:"base",size:"small"})]})},l))})})]})}const Kl={timeout:8e3,enableHighAccuracy:!0};class ql extends Error{constructor(){super(...arguments),this.name="PermissionsUnsupportedError"}}function jl(){const{observability:e}=y();return j(t=>Xl(t,Yl,e),[e])}const Yl=e=>new Promise(t=>{"geolocation"in navigator&&navigator.geolocation?navigator.geolocation.getCurrentPosition(a=>t({reason:"granted",position:a}),a=>t({reason:Jl(a),error:a}),e):t({reason:"unsupported"})}),Xl=async(e=Kl,t,a)=>{if("permissions"in navigator)try{switch((await navigator.permissions.query({name:"geolocation"})).state){case"granted":case"prompt":return t(e);case"denied":return Promise.resolve({reason:"denied"});default:throw new ql('"geolocation" permission is not supported in this browser')}}catch{a.log("geolocation_permission_supported",'"geolocation" permission is supported in this browser. Using navigator.geolocation.getCurrentPosition instead.')}return t(e)};function Jl(e){switch(e.code){case 1:return"denied";case 2:return"unavailable";case 3:return"timeout";default:return"unsupported"}}function Vt({disabled:e,displayAsLink:t,onSuccess:a,onError:o,onLocateStart:i,options:s,sharingNotAllowedError:r}){const{i18n:l}=y(),c=jl(),u=ue(!1),d=ue(void 0),p=l.translate("pickup_point.geolocation.shared_location_button"),h=l.translate("pickup_point.geolocation.errors.unsuported_by_browser"),v=r||l.translate("pickup_point.geolocation.errors.permission_not_allowed"),m=l.translate("pickup_point.geolocation.errors.permission_denied");async function g(){d.value=void 0,u.value=!0,i?.();const _=await c(s);switch(u.value=!1,_.reason){case"granted":a(_.position);break;case"denied":d.value=v;break;case"timeout":case"unavailable":d.value=m;break;case"unsupported":d.value=h;break}"error"in _&&typeof _.error<"u"&&o?.(_.error)}return n(X,{children:[u.value&&t?n(I,{direction:"inline",gap:"small-400",children:[n(et,{}),n(O,{color:"subdued",children:p})]}):n(ye,{disabled:e,inlineSize:t?void 0:"fill",onClick:g,loading:u.value,variant:t?"plain":void 0,textDecoration:t?"none":void 0,children:n(I,{direction:"inline",alignItems:"center",gap:"small-400",children:[n(oe,{type:"geolocation"}),n(Ee,{children:p})]})}),n(Y,{when:d,children:n(dn,{children:d})})]})}function An({heading:e,tryDifferentLocationOnClick:t}){const{i18n:a}=y(),o=Sn(),i=Fe(),s=L(()=>
2Wo(i.value.enabledDeliveryMethods)),r=L(()=>s.value.length>0),l=de(t),c=L(()=>r.value||!!l.value),u=en(),d=je({methods:u.value?.methods||[],selectedDeliveryMethodHandle:u.value?.selectedDeliveryMethodHandle});K(()=>{d("pickup_no_location_banner_rendered")},[d]);function p(){d("pickup_no_location_banner_ship_items_click"),o.setSelectedMethodTypes(s.value)}const h=n(me,{tone:"monochrome",onClick:p,children:a.translate("local_pickup.pickup_unavailable_banner_body.ship_items")});function v(){d("pickup_no_location_banner_search_click"),t?.()}const m=t?n(me,{tone:"monochrome",onClick:v,children:a.translate("local_pickup.pickup_unavailable_banner_body.search_elsewhere")}):a.translate("local_pickup.pickup_unavailable_banner_body.search_elsewhere"),g=t?n(me,{tone:"monochrome",onClick:v,children:a.translate("local_pickup.pickup_unavailable_banner_body.search_elsewhere_standalone")}):a.translate("local_pickup.pickup_unavailable_banner_body.search_elsewhere_standalone");return n(qe,{tone:"critical",errorType:nn.DeliveryError,heading:e,children:n(Y,{when:c,children:n(Ee,{children:n(Y,{when:r,fallback:g,children:a.translate("local_pickup.pickup_unavailable_banner_body.ship_items_or_search_elsewhere",{ship_items:h,search_elsewhere:m})})})})})}function Mn(){const{shop:e}=y();return!e.hasFlagEnabled($o)}function Ql(){const{shippingAddress:e}=$(),{shop:t}=y(),a=tn();return{syncShippingFromPickup:j(i=>{if(!a.value||!i)return;const s=e.value;s.countryCode===i||s.postalCode||s.address1||s.address2||s.city||!t.shippingCountries.some(l=>l.value===i)||(e.value={...s,countryCode:i,zoneCode:void 0,coordinates:void 0})},[a,e,t])}}const Zl=fn("AutocompleteSingleAddressField");function Ht({address:e,onSelect:t,value:a,country:o,hiddenFields:i=["firstName","lastName","company","zoneCode","countryCode","phone"],addressType:s,...r}){const{value:l,setValue:c}=Ns({addressType:s,countryCode:o.code,initialAddressQuery:e.coordinates?Rn(e,o,i):a});function u(d){c(Rn(d,o,i)),t&&t(d)}return n(Ds,{addressType:s,id:_n(void 0,Zl),onSelect:u,value:l,countryCode:o.code,...r})}const ec="_9uTul",nc="_3zLFw",tc="_9rPCU",ac="FayGq",rn={SelectWrapper:ec,focus:nc,FlagIcon:tc,Select:ac};function oc({pickupCountries:e,selectedCountry:t,onCountryChange:a}){const{i18n:o}=y(),[i,s]=le(!1);return n(G,{border:"base",borderWidth:"base",borderRadius:"base",blockAlignment:"center",padding:"none small-200",className:Pe(rn.SelectWrapper,i&&rn.focus),children:n(I,{direction:"inline",alignItems:"center",children:[n("div",{className:rn.FlagIcon,children:n(ps,{countryCode:t.code.toLowerCase(),accessibilityLabel:t.name})}),n(oe,{type:"chevron-down",size:"small-200",tone:i?"accent":void 0}),n("select",{"aria-label":o.translate("contact.country_label"),className:rn.Select,value:t.code,onBlur:()=>s(!1),onFocus:()=>s(!0),name:"phone_country_select",onChange:r=>{a(r.target.value)},children:e.map(({label:r,value:l})=>n("option",{value:l,children:r},l))})]})})}const ic=fn("AutocompleteSingleAddressField");function sc({onSearch:e,onBeforeCountryChange:t,onAfterCountryChange:a,sharedLocationAddress:o,searchOnSelect:i,pickupCountries:s,addressAutoFocus:r,onAddressBlur:l}){const c=ue(""),{i18n:u,observability:d}=y(),{geolocation:p}=fa(),{locationAddress:h}=$(),v=h.peek(),m=te(v),g=Go(),_=Mn(),C=se(()=>Ko(cc(v,p.country.code,s,g),{extendedAddressMode:null}),[]),A=se(()=>qo({countryCode:void 0,address:void 0}),[]),f=cn(C.fields.countryCode,A.countryCode),b=cn(C.fields.postalCode,A.address),{details:w,loading:k}=ea(f.value),M=se(()=>w??p.country,[w,p.country]),z=A.address.value,F=se(()=>s?.length?s:[{value:M.code,label:M.name}],[s,M.code,M.name]),T=j(E=>Rn(E,M,["company","firstName","lastName","phone","countryCode","zoneCode"]),[M]),R=M.zones,V=C.value,P=c.value,S=f.value?Os(f.value):!1;lc(C,A);const D=ba(C),W=bn(),U=()=>{(f.error||b.error)&&(f.clearError(),b.clearError())};Me(()=>{const E=o?.value;E?.countryCode&&Fn(()=>{We(()=>{D({countryCode:E.countryCode}),c.value="",U()})})}),Me(()=>{const E=h.value;E!==m.current&&(m.current=E,E?.coordinates&&Fn(()=>{We(()=>{D(jo(E)),c.value=T(E),U()})}))}),K(()=>{const E=C.value;S?c.value=T(E):c.value=T({postalCode:E.postalCode})},[C,S,T,c]);const ie=(E=V)=>{E.coordinates?(R.length||(E.zoneCode=void 0),e(E)):A.address.value=u.translate("local_pickup.could_not_resolve_address")},re=E=>{const Re=()=>{a?.(E),D({countryCode:E}),f.onChange(E),U(),g("user-input",E,"pickup")};t?t({countryCode:E},Re):Re()},J=E=>{V.coordinates&&D({countryCode:f.value}),c.value=E,U()},N=E=>{!E.coordinates&&E.address1&&d.leaveErrorBreadcrumb("Autocomplete address missing coordinates",{countryCode:E.countryCode||f.value,hasAddress1:!!E.address1,hasPostalCode:!!E.postalCode});
2const Re=Jo(E.countryCode),on=!!(E.countryCode&&!Re);on&&d.leaveErrorBreadcrumb("Discarded invalid autocomplete countryCode",{invalidCountryCode:E.countryCode,fallbackCountryCode:f.value});const sn=on?{...E,countryCode:f.value}:{...E,countryCode:Re};D(sn),i&&ie(sn),_&&W("click",{element:{tagName:"button",textContent:"local_pickup_autosuggestion_search"},section:"delivery",timestamp:new Date})},B=i&&!_?{source:"magnify",position:"end"}:void 0,H=S&&i,ee=!V.coordinates||!P.length,x=H?null:n(ye,{variant:"primary",disabled:ee,onClick:ie,loading:k,children:u.translate("local_pickup.search_button")}),Q={errors:A,state:{countryCode:C.fields.countryCode,address:S?c:C.fields.postalCode}},q=Yo(z)?z.message:z,Ce=S?"location address":"postalCode",ae=_n(void 0,ic),_e=_?u.translate("local_pickup.location_address_search_placeholder",{postal_code_label:M.labels.postalCode}):u.translate("local_pickup.location_address_search_label"),fe=_||!!x;let ne;fe?ne=q?!0:void 0:ne=q;const Se={addressType:"pickup",country:M,address:V,error:ne,field:"address1",value:P,icon:B,autoFocus:r,onBlur:l,autocomplete:S?"shipping street-address":"shipping postal-code",label:S?_e:M.labels.postalCode,name:Ce,id:ae},En=S?n(Ht,{...Se,onSelect:N,onInput:J}):n(Ht,{...Se,onSelect:E=>{D(E),c.value=T(E)},required:!0,readOnly:k,onInput:E=>{E?U():c.value=""},onChange:E=>{c.value=E},allowAllCountries:!0}),Ye=n(G,{children:[n(rc,{autocomplete:Se.autocomplete,label:Se.label,name:Se.name}),En]}),Tn=Ti()?.checkoutProfile.hasOverrides.value;return n(Pn,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(Zn,{...Q,children:_?n(I,{gap:"small-300",children:[n(ge,{gap:"small-400 small-300",gridTemplateColumns:"minmax(auto, max-content) minmax(0, 1fr) minmax(auto, max-content)",gridAutoColumns:"1fr",gridTemplateRows:"minmax(auto, max-content)",gridAutoRows:"minmax(auto, max-content)",children:[n(oc,{pickupCountries:F,selectedCountry:M,onCountryChange:re}),Ye,n(ye,{variant:"primary",onClick:ie,disabled:ee,"data-event-name":"local_pickup_search_button",accessibilityLabel:u.translate("local_pickup.search_button"),children:n(oe,{type:"search"})})]}),q?n(dn,{controlID:ae,children:kt(q)?q.textValue:q}):null]}):n(qt,{children:[n(Co,{children:n(xs,{interactive:!Tn,children:n(ma,{name:"countryCode",label:M.labels.country,required:!0,autocomplete:"shipping country-name",readOnly:k,value:M.code,onChange:E=>re(E),children:F.map(E=>n(Vn,{value:E.value,children:E.label},E.value))})})}),x?n(I,{gap:"small-300",children:[n(ge,{gap:"small-400 base",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content)",gridAutoColumns:"1fr",gridTemplateRows:"minmax(auto, max-content)",gridAutoRows:"minmax(auto, max-content)",children:[Ye,x]}),q?n(dn,{controlID:ae,children:kt(q)?q.textValue:q}):null]}):Ye]})})})}function rc({autocomplete:e,label:t,name:a}){const o=wi(),i=o?.nested?o.id:void 0;return n(G,{accessibilityVisibility:"exclusive",children:n("input",{type:"text",tabIndex:-1,"aria-hidden":!0,id:"autofill_localPickupAddress",name:a,autoComplete:e,form:i,"aria-label":t})})}function lc(e,t){const{i18n:a,observability:o,checkout:{wallets:i}}=y(),{inMemoryApplePayParts:{asPaymentMethod:s,isLoadingPaymentSheet:r},inMemoryPayPalParts:{isLoadingPaymentSheet:l}}=Te();Xt(async({reason:c})=>{if(c==="negotiation"&&!r.value&&!l.value)return{behavior:"allow"};if(i.activeSession.value&&!s.value)return{behavior:"allow"};const u=e.peek(),d=new Map;return u.coordinates||d.set("address",a.translate("field_errors.address_address1_blank")),Xo(u.countryCode)||d.set("countryCode",a.translate("field_errors.address_country_blank")),d.size?(o.leaveErrorBreadcrumb("Blocking address errors",{errors:Array.from(d).map(([,p])=>p)}),{behavior:"block",reason:jn.InvalidLocalPickupAddress,perform:()=>{We(()=>{for(const[p,h]of d)t[p].value=h})}}):{behavior:"allow"}})}function cc(e,t,a,o){const i=!!(e.address1||e.postalCode||e.countryCode),s=a?.some(l=>l.value===e.countryCode),r=a?.some(l=>l.value===t);return i&&s?e:r||a.length===0?(o("auto-selected",t,"pickup"),{countryCode:t}):(o("auto-selected",a[0].value,"pickup"),{countryCode:a[0].value})}function Qa({locationFormVisible:e,toggleLocationFormVisibility:t,children:a,onLocationChange:o,pickupCountries:i}){const s=y().checkout.identity.current.value==="shopPay",r=()=>t(!1);return s?n(X,{children:[a,n(uc,{open:e,onModalClose:r,onLocationChange:o,pickupCountries:i})]}):e?n(mt,{onLocationChange:o,pickupCountries:i}):a}function uc({open:e,onModalClose:t,onLocationChange:a,pickupCountries:o}){const{i18n:i}=y();return n(kn,{heading:i.translate("local_pickup.toggle_location"),open:e,onHide:t,children:n(Pa,{section:"delivery",children:[n(mt,{onLocationChange:a,changeLocationOnSelect:!0,pickupCountries:o}),n(G,{minBlockSize:"@media (inline-size >= small) 120px, 320px"}),n(ye,{onClick:t,inlineSize:"fill",variant:"plain",size:"extraLarge",children:i.translate("local_pickup.cancel")})]})})}const mt=({onLocationChange:e,onBeforeLocationChange:t,changeLocationOnSelect:a,hideFormOnGeoCoordinatesShare:o,pickupCountries:i,addressAutoFocus:s,onAddressBlur:r})=>{const{geolocation:l}=fa(),{locationAddress:c}=$(),u=ba(c),{i18n:d}=y(),p=ue(!0),h=ue(),v=ue(void 0),m=Mn(),{syncShippingFromPickup:g}=Ql(),_=(b,w)=>{const k=()=>{g(b.countryCode),w()};t?t(b,k):k()},C=b=>{if(o&&(p.value=!1),!Qo(b)){h.value=d.translate("pickup_point.could_not_resolve_address");return}h.value=void 0;const w={zoneCode:l.zone?.code,countryCode:l.country.code,coordinates:{latitude:b.coords.latitude,longitude:b.coords.longitude}};_({countryCode:l.country.code},()=>{u(w),v.value=w,e(b)})},A=b=>{_(b,()=>{u(b),e(b)})};return n(I,{gap:m?"small-300":"base",children:[m?null:n(Vt,{onSuccess:C}),n(Y,{when:p,fallback:n(ye,{inlineAlignment:"start",variant:"plain",onClick:()=>{p.value=!0},children:d.translate("shipping.local_pickup.search_address")}),children:n(I,{gap:"base",children:[m?null:n(ge,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content) minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",alignItems:"center",alignContent:"center",children:[n(Ue,{direction:"inline"}),n(G,{padding:"none base",children:n(O,{color:"subdued",children:d.translate("local_pickup.or")}
2)}),n(Ue,{direction:"inline"})]}),n(sc,{sharedLocationAddress:v,searchOnSelect:a,onSearch:A,onBeforeCountryChange:t,onAfterCountryChange:g,pickupCountries:i,addressAutoFocus:s,onAddressBlur:r}),n(Y,{when:h,children:b=>n(I,{gap:"base",padding:"small-200 none none none",children:n(An,{heading:b})})})]})}),m&&n(Vt,{onSuccess:C,displayAsLink:!0,sharingNotAllowedError:d.translate("local_pickup.geolocation.permission_not_allowed")})]})},dc={id:"82df6c2dc2bed8371d068138beb16fa3f49623a334766ea9cb4e0932a8fed20b",type:"query",name:"PickupCountries",source:""},Za=Zo(({graphql:{coreGraphql:e},router:t,shop:a},{sellableDeliveryMethods:o})=>{const i=bt(()=>t.currentUrl.value.pathname.endsWith("/throttle")),s=e.query(dc,{skip:()=>i.value}),r=bt(()=>{const l=s.data.value?.shop?.pickupCountries,{enabledDeliveryMethods:c,deliveryMethodsByMerchandise:u}=o.value;if(!(Object.keys(u).length>0&&hc(c))||!l)return l;const h=[...l],v=new Set(h.map(({value:m})=>m));for(const m of a.shippingCountries)v.has(m.value)||(h.push(m),v.add(m.value));return h});return{error:s.error,loading:s.loading,pickupCountries:r}}),pc=["SHIPPING","LOCAL"];function hc(e){const t=e.includes("PICK_UP"),a=e.some(o=>pc.includes(o));return t&&!a}function mc(e,t){return e.amount===0?{amount:t.translate("shipping.free_rate_label"),letterCase:"uppercase"}:{amount:t.formatCurrency(e.amount,{currency:e.currencyCode}),letterCase:void 0}}const eo=e=>e.every(({pickupLocation:t})=>{const a=t&&"distanceFromBuyer"in t?t.distanceFromBuyer:void 0;return a?.value&&a.value>ct[a.unit]});function vc(e,t){const a=e.map(s=>pn(s)?.value).filter(s=>s!==void 0);if(a.length===0)return!0;const o=e.find(({handle:s})=>s===t),i=o?pn(o)?.value:void 0;return i===void 0?!0:i<=Math.min(...a)}const yc=(e,t,a,o,i={})=>{const s=e.length;return t?Oe(a,{oneItem:()=>o.translate("local_pickup.location_information_far_away_one_item",{count:s}),otherItems:()=>o.translate("local_pickup.location_information_far_away_other_items",{count:s})}):i.allLocationsFarAway?Oe(a,{oneItem:()=>o.translate("local_pickup.location_far_away_one_item",{count:s}),otherItems:()=>o.translate("local_pickup.location_far_away_other_items",{count:s})}):s===1?Oe(a,{oneItem:()=>o.translate("local_pickup.location_nearby_short_one_item",{count:s}),otherItems:()=>o.translate("local_pickup.location_nearby_short_other_items",{count:s})}):vc(e,i.selectedDeliveryMethodHandle)?Oe(a,{oneItem:()=>o.translate("local_pickup.location_closest_one_item"),otherItems:()=>o.translate("local_pickup.location_closest_other_items")}):o.translate("local_pickup.location_selected")};function Oe(e,t){return e===1?t.oneItem():t.otherItems()}const gc="KHJ3S",_c={Details:gc};function fc({distanceLabel:e,instructions:t}){return!e&&!t?null:n(I,{className:_c.Details,direction:"inline",rowGap:"small-400",columnGap:"small-200",alignItems:"center",paddingBlockStart:"small-400",children:[e&&n(I,{direction:"inline",gap:"small-400",alignItems:"center",children:[n(O,{color:"subdued",children:n(oe,{type:"location",size:"small"})}),n(O,{fonts:"secondary",type:"small",children:e})]}),t&&n(I,{direction:"inline",gap:"small-400",alignItems:"center",children:[n(O,{color:"subdued",children:n(oe,{type:"clock",size:"small"})}),n(O,{fonts:"secondary",type:"small",children:t})]})]})}function bc(){const{checkout:e,shop:t}=y(),{deliveryNext:a,merchandiseLines:o}=ce(),i=L(()=>{const s=ei(o.value?.lines).filter(r=>!!r.sellingPlan?.subscriptionDetails);return a.value&&"lines"in a.value&&a.value.lines?a.value.lines.some(r=>r.type!=="SUBSCRIPTION"?!1:ni(r)?.methodType==="PICK_UP"&&r.targetMerchandiseLines?.some(c=>s.some(u=>u.stableId===c.stableId))):!1});return L(()=>t.shipPickupInOneOrderEnabled?i.value:Qt({checkout:e}))}function no({variant:e="text"}){const{i18n:t}=y(),a=bc(),o=t.translate("delivery_options.subscription_pickup_information");return n(Y,{when:a,children:e==="banner"?n(Cn,{tone:"info",children:o}):n(Ee,{children:o})})}function to({method:e,subscriptionBanner:t}){const{i18n:a}=y(),{isOnlyCountryAvailable:o}=we(),{cost:i,pickupLocation:s}=e,{name:r,address:l,distanceFromBuyer:c}=s,u=s.instructions.trim(),d=mc(i,a),h=!o&&c?ut(a,c):void 0;return n(I,{direction:"block",gap:"small-400",children:[n(I,{children:[n(ge,{gap:"small-400",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content)",alignItems:"baseline",children:[n(O,{type:"strong",children:r}),n(O,{type:"strong",letterCase:d.letterCase,children:d.amount})]}),n(Ma,{address:l,hiddenFields:["postalCode","countryCode","phone"]}),n(fc,{distanceLabel:h,instructions:u})]}),t?n(no,{variant:"banner"}):null]})}function Pc({methods:e,selectedDeliveryMethodHandle:t,setSelectedDeliveryMethodHandle:a}){const o=se(()=>t?[t]:[],[t]),i=j(([r=""])=>a?.(r),[a]),s=xe("purchase.checkout.pickup-location-option-item.render-after");return n(rt,{name:"local_pickup_methods",values:o,onChange:i,hideRadioControl:e.length===1,children:e.map(r=>n(kc,{method:r,extensions:s},r.handle))})}function kc({method:e,extensions:t}){const a=e.handle,o=se(()=>({handle:a}),[a]);return n(In,{value:a,children:[n(to,{method:e,subscriptionBanner:!1}),n(Be,{marginBlockStart:"small100",customizations:t,options:o})]},a)}const Cc="pickup-locations-modal";function Sc({addressFocus:e,...t}){const a=ue(!1);return n(Ic,{addressFocus:e??a,...t})}function Ic({methods:e,open:t,type:a,addressFocus:o,onClose:i}){const{i18n:s,shop:r}=y(),[l,c]=ka({type:a,deliveryMethodType:"PICK_UP"}),u=ta(),{negotiate:d}=ke(),p=ce().merchandiseLines,h=de(tt(Jn).hasViolations),{fullCountryName:v,isOnlyCountryAvailable:m}=we(),g=ue(l),_=ue(!1),C=ue(!1),{setInverseGroupDeliveryMethodHandle:A,getInverseGroupDeliveryMethodHandle:f}=Ca(e||[],a||"ONE_TIME_PURCHASE"),b=Fe(),{pickupCountries:w,loading:k}=aa(Za,{sellableDeliveryMethods:b}),{deliveryLines:M,merchandiseLines:z,discountLines:F,shippingAddress:T}
2=$(),R=M.value,V=en(),{shouldGateCrossBorder:P,crossBorderGate:S}=bs(),D=de(!!(e&&eo(e))),W=ht({allLocationsFarAway:D,selectedPickupOptionNoLongerAvailable:h}),U=(x,Q)=>{const q=x.countryCode;if(!q||!P(q)){Q();return}i(),S(()=>{T.fields.zoneCode.value=void 0,T.fields.coordinates.value=void 0,T.fields.countryCode.value=q})},ie=Je(p.value?.lines),re=v?s.translate("local_pickup.pickup_unavailable_banner_title_with_country",{country:v,count:ie}):s.translate("local_pickup.pickup_unavailable_banner_title",{count:ie});K(()=>{(!_.value&&C.value||l!==void 0&&l!==g.value)&&(C.value&&(C.value=!1),g.value=l)},[_.value,l,C.value]);const J=()=>{!r.shipPickupInOneOrderEnabled||oa(M.value).some(({requiresShipping:Q})=>Q)||We(()=>{ti({deliveryLines:M,merchandiseLines:z.value,deliveryMethodTypes:["PICK_UP"]})&&ai(F)})},N=()=>{const x=g.value;if(x!==l){if(c(x),u.value&&x){const Q=f(x);A(Q)}J(),d({include:["deliveryNext"]})}o.value=!1,i()},B=()=>{_.value=!0,C.value=!0,J();const x=R.find(Q=>{const q=Q.peek().id;return q&&q===V.value?.id});x&&(x.fields.deliveryMethodHandle.value=void 0),d({include:["deliveryNext"],fieldsToResolve:["deliveryNext"],onComplete:()=>{_.value=!1}})},H=j(x=>{g.value=x},[g]),ee=()=>{if(C.value)return n(Ln,{hideText:!0});if(e){const x=Je(V.value?.targetMerchandiseLines),Q=m||D.value?Oe(x,{oneItem:()=>s.translate("local_pickup.location_information_far_away_one_item",{count:e.length}),otherItems:()=>s.translate("local_pickup.location_information_far_away_other_items",{count:e.length})}):Oe(x,{oneItem:()=>s.translate("local_pickup.location_nearby_one_item",{count:e.length}),otherItems:()=>s.translate("local_pickup.location_nearby_other_items",{count:e.length})});return n(X,{children:[n(Y,{when:W,children:n(dt,{itemCount:x,methods:e,onChangeLocationClick:()=>{o.value=!0}})}),h.value&&n(pt,{}),n(O,{color:"subdued",children:Q}),n(Pc,{selectedDeliveryMethodHandle:g.value,setSelectedDeliveryMethodHandle:H,methods:e})]})}return n(An,{heading:re,tryDifferentLocationOnClick:()=>{o.value=!0}})};return n(kn,{id:Cc,onHide:N,open:t,heading:s.translate("delivery_options.pick_up_locations"),primaryAction:n(Di,{handleSubmit:N,submitText:s.translate("payment.add_credit_card_modal.save")}),children:n(Pa,{section:"delivery",children:n(Ni,{children:n(I,{gap:"base",children:[n(Y,{when:()=>k.value?null:w.value,children:x=>n(mt,{onLocationChange:B,onBeforeLocationChange:U,changeLocationOnSelect:!0,pickupCountries:x,addressAutoFocus:o.value,onAddressBlur:()=>{o.value=!1}})}),ee()]})})})})}const vt="split-delivery-merchandise-modal",Lc=6;function ao(e){return e.filter(t=>t.requiresShipping)}function Ut(e){return new Set(e.map(t=>t.digest)).size}function oo(e){return ao(ii(e))}function io(e){return ao(oa(e))}function Ac(e,t){return t==="PICK_UP"?oo(e):io(e)}function Mc(e){return Ut(oo(e))+Ut(io(e))}function Ec(e){return e.filter(t=>t.requiresShipping).reduce((t,a)=>t+a.quantity,0)}function Tc(e){return Ec(e.filter(oi).flatMap(t=>t.lineComponents.length>0?t.lineComponents:[t]))}function so({targetMerchandiseLines:e,merchandiseLines:t}){const a=Oi(e),o=Tc(t);return{targetMerchandiseQuantity:a,isAllItems:a===o}}function ro(){const{deliveryLines:e}=$(),t=L(()=>Mc(e.value)),a=L(()=>t.value>=Lc);return{physicalDeliveryTargetMerchandiseCount:t,shouldOpenModal:a}}function Qe(e){const{deliveryLines:t}=$();return L(()=>Ac(t.value,e))}function wc(e){const{merchandiseLines:t}=$(),a=Ke("deliveryNext"),o=L(()=>{const r=e.value,l=so({targetMerchandiseLines:r,merchandiseLines:t.value});if(l.targetMerchandiseQuantity!==0)return{merchandiseLines:r,totalItemCount:l.targetMerchandiseQuantity,isAllItems:l.isAllItems}}),i=te(),s=L(()=>{const r=o.value;return r?(i.current=r,r):i.current});return{currentSummary:o,visibleSummary:s,isNegotiating:a}}const Nc="HoMMS",Dc="_5tEP0",Oc="g9aTP",xc="eWR8C",ln={TriggerButton:Nc,TriggerChevron:Dc,TriggerButtonText:Oc,MenuOptionButton:xc},lo="split-delivery-method-menu";function co(e,t){return`${lo}-${encodeURIComponent(e)}-${t}`}function Bc(e,t){return`${co(e,t)}-trigger`}function Fc(e){return`[id^="${lo}-${encodeURIComponent(e)}-"][id$="-trigger"]`}function uo(e,t){if(e!==0)return t>=0?t:0}function Rc({activeIndex:e,isOpen:t,menuOptionsLength:a,selectedOptionIndex:o,wasOpenRef:i}){return K(()=>
2{if(!t){e.value=void 0,i.current=!1;return}if(!i.current){e.value===void 0&&(e.value=uo(a,o)),i.current=!0;return}e.value!==void 0&&e.value>=a&&(e.value=a===0?void 0:a-1)},[e,t,a,o,i]),K(()=>()=>{e.value=void 0,i.current=!1},[e,i]),null}function zt(e){requestAnimationFrame(()=>{De({content:e,role:"status"})})}function Vc(e){const{getInteraction:t}=Bi(),a=t(e);return a?.type==="command"&&a.kind==="overlay"&&a.active}function Hc({merchandiseStableIds:e,onMoveMerchandise:t,onRemoveMerchandise:a,selectedDeliveryMethodType:o,productTitle:i}){const s=ko(),{i18n:r}=y(),l=Fe(),c=ya(),u=Ja(),d=de(t??c),p=de(a??u),h=de(xi().hideOverlay),v=te(null),m=te(!1),g=e[0],_=co(g,s),C=Bc(g,s),A=Vc(_),f=de(A),b=ue(void 0),w=de(o),k=de(i),M=de(e),z=L(()=>{const N={SHIPPING:{label:r.translate("delivery_options.ship"),value:"SHIPPING",icon:"package-delivery",onClick:()=>B("SHIPPING")},PICK_UP:{label:r.translate("delivery_options.pickup"),value:"PICK_UP",icon:"location",onClick:()=>B("PICK_UP")}},B=H=>{h.value(_),H!==w.value&&(d.value({targetDeliveryMethodType:H,merchandiseStableIds:M.value}),zt(H==="SHIPPING"?r.translate("split_delivery.accessibility.status.ship_separately",{items:k.value}):r.translate("split_delivery.accessibility.status.pickup_in_store",{items:k.value})))};return N}),F=L(()=>z.value[w.value].label),T=L(()=>{const{deliveryMethodsByMerchandise:N}=l.value,B=M.value.map(x=>N[x]);if(B.length===0||B.some(x=>!x))return[];const[H,...ee]=B;return ee.reduce((x,Q)=>x.filter(q=>Q.includes(q)),H)}),R=L(()=>{const N=T.value,B=N.map(H=>({...z.value[H],selected:H===w.value})).sort((H,ee)=>Number(ee.selected)-Number(H.selected));return N.length===1&&B.push({label:r.translate("stock.remove"),value:"remove",icon:"delete",selected:!1,onClick:()=>{h.value(_),p.value(M.value),zt(r.translate("split_delivery.accessibility.status.remove_items",{items:k.value}))}}),B}),V=L(()=>R.value.length),P=L(()=>R.value.findIndex(N=>N.selected)),S=N=>{const B=V.value;if(B===0||b.value===void 0)return;const H=Math.min(b.value,B-1);b.value=(H+N+B)%B},D=()=>{b.value=uo(V.value,P.value)},W=()=>{A||D()},U=()=>{requestAnimationFrame(()=>{document.querySelector(Fc(g))?.focus()})},ie=N=>{N&&(N.onClick(),U())},re=N=>{if(!A){(N.key==="ArrowDown"||N.key==="ArrowUp")&&(N.preventDefault(),D(),v.current?.click());return}switch(N.key){case"ArrowDown":N.preventDefault(),S(1);break;case"ArrowUp":N.preventDefault(),S(-1);break;case"Home":N.preventDefault(),b.value=0;break;case"End":N.preventDefault(),b.value=V.value-1;break;case"Enter":case" ":N.preventDefault(),b.value!==void 0&&ie(R.value[b.value]);break;case"Tab":N.stopPropagation(),h.value(_);break}},J=L(()=>f.value&&b.value!==void 0&&R.value[b.value]!==void 0?`${_}-option-${b.value}`:void 0);return n(Y,{when:V,children:N=>n(X,{children:[n(Rc,{activeIndex:b,isOpen:A,menuOptionsLength:N,selectedOptionIndex:P.value,wasOpenRef:m}),n(la,{ref:v,id:C,command:"--toggle",commandFor:_,background:"base",padding:"small-300",paddingInlineStart:"small-200",borderRadius:"base",className:ln.TriggerButton,accessibilityLabel:`${i}, ${r.translate("review.blocks.change_delivery_method_link_label")}`,onClick:W,role:"combobox",onKeyDown:re,"aria-haspopup":"listbox","aria-autocomplete":"none","aria-activedescendant":J.value,children:n(I,{direction:"inline",gap:"small-500",alignItems:"center",children:[n("span",{className:ln.TriggerButtonText,children:F}),n("span",{className:ln.TriggerChevron,children:n(oe,{type:"chevron-down",size:"small-200",tone:"accent"})})]})}),n(Fs,{id:_,connector:"none",padding:"none",positionArea:"block-end span-inline-start",children:n("div",{role:"listbox","aria-labelledby":C,children:n(Bn,{each:R,getKey:B=>B.value,children:(B,H)=>{const ee=b.value===H;return n("button",{id:`${_}-option-${H}`,type:"button",role:"option",tabIndex:-1,"aria-selected":B.selected,"data-active":ee||void 0,className:ln.MenuOptionButton,onClick:()=>{ie(B)},onMouseOver:()=>{b.value=H},children:n(I,{direction:"inline",gap:"small-400",alignItems:"center",children:[n(oe,{type:B.icon,tone:ee?"accent":"auto"}),n(O,{type:"small",tone:B.value==="remove"?"critical":"auto",children:B.label})]})})}})})})]})})}function hn({onMoveMerchandise:e,onRemoveMerchandise:t,title:a,selectedDeliveryMethodType:o}){const s=Qe(o).value,r=se(()=>{const u=new Map;for(const d of s){const p=d.digest,h=u.get(p);if(h){if(h.stableIds.includes(d.stableId))continue;h.stableIds.push(d.stableId),h.totalQuantity+=d.quantity}else u.set(p,{line:d,stableIds:[d.stableId],totalQuantity:d.quantity})}return Array.from(u.values())},[s]),l=Fi(r.map(({line:u})=>u.stableId)),c=Hi(o);return n(X,{children:n(I,{accessibilityRole:"unordered-list",accessibilityLabel:a,gap:"small-100",children:r.map(({line:{stableId:u,image:d,title:p,subtitle:h,sellingPlan:v},stableIds:m,totalQuantity:g})=>
2{const _=[h,v?.name].filter(Boolean).join(` ${Ri} `),C=l.has(u);return n(G,{accessibilityRole:"list-item",className:C?c:void 0,children:n(ge,{gridAutoFlow:"column",gridTemplateColumns:"minmax(auto, max-content) minmax(0, 1fr) minmax(auto, max-content)",gridTemplateRows:"minmax(0, 1fr)",gap:"base",alignItems:"center",alignContent:"center",children:[n(Vi,{alt:d?.altText,size:"small",src:d?.url,totalItems:g>1?g:void 0}),n(G,{minInlineSize:"0px",maxInlineSize:"100%",overflow:"hidden",children:[n(O,{size:"base",children:n(St,{children:p})}),_&&n(O,{color:"subdued",size:"small",children:n(St,{children:_})})]}),n(G,{inlineAlignment:"end",children:n(Hc,{merchandiseStableIds:m,onMoveMerchandise:e,onRemoveMerchandise:t,selectedDeliveryMethodType:o,productTitle:p})})]})},u)})})})}function po(){const{i18n:e}=y(),t=tn(),a=te(null),o=Qe("PICK_UP"),{shouldOpenModal:i}=ro(),{currentSummary:s,visibleSummary:r,isNegotiating:l}=wc(o),c=L(()=>s.value?.totalItemCount===1),u=L(()=>{const v=r.value;return v?v.isAllItems?e.translate("split_delivery.pickup_all_items"):e.translate("split_delivery.pickup_items_count",{count:v.totalItemCount}):""}),d=L(()=>{const v=e.translate("review.blocks.change_delivery_method_link_label");return u.value?`${u.value}, ${v}`:v}),p=L(()=>u.value||e.translate("split_delivery.items_for_pickup")),h=ue(Fn(()=>i.value||!c.value&&!t.value));return Me(()=>{h.value=i.value||!c.value&&!t.value}),n(G,{children:n(ws,{children:n(Y,{when:h,fallback:n("div",{ref:a,tabIndex:-1,children:n(hn,{title:e.translate("split_delivery.items_for_pickup"),selectedDeliveryMethodType:"PICK_UP"})}),children:n(ye,{variant:"plain",tone:"monochrome",inlineSize:"fill",inlineAlignment:"start",textDecoration:"none",accessibilityLabel:i.value?d.value:p.value,command:i.value?"--show":void 0,commandFor:i.value?vt:void 0,"aria-expanded":i.value?void 0:!1,disabled:l.value,onClick:i.value?void 0:()=>{h.value=!1,requestAnimationFrame(()=>{a.current?.focus()})},children:n(ge,{gridAutoFlow:"column",gridTemplateColumns:"minmax(auto, max-content) minmax(0, 1fr) minmax(auto, max-content)",alignItems:"center",gap:"small-200",children:[n(Sa,{variant:"fan-legacy",sortByPrice:!0,merchandise:r.value?.merchandiseLines??[],size:"small",useImageAltTexts:!1}),n(Y,{when:()=>!l.value&&r.value!==void 0,fallback:n(pe,{inlineSize:"base"}),children:n(O,{children:u})}),n(oe,{type:"pen",size:"base",tone:"neutral"})]})})})})})}function ho(){const{shop:e}=y(),t=Fe(),{deliveryNext:a}=ce(),o=tn(),i=Ta();return L(()=>{if(!e.shipPickupInOneOrderEnabled||!(a.value&&"supportsSplitDeliveryMethod"in a.value?a.value.supportsSplitDeliveryMethod:!1))return!1;const{enabledDeliveryMethods:r,deliveryMethodsByMerchandise:l}=t.value,c=r.includes("SHIPPING"),u=r.includes("PICK_UP");if(!c||!u||!o.value&&i.value)return!1;const d=Object.values(l);if(d.length<2)return!1;if(d.some(m=>m.includes("SHIPPING")&&m.includes("PICK_UP")))return!0;const h=d.some(m=>m.includes("SHIPPING")&&!m.includes("PICK_UP")),v=d.some(m=>m.includes("PICK_UP")&&!m.includes("SHIPPING"));return h&&v})}function Uc({localPickupDeliveryLine:e,onShowModal:t}){const{i18n:a,shop:o}=y(),i=ho(),s=o.hasFlagEnabled(ia),{methods:r,selectedDeliveryMethodHandle:l}=e,c=r.find(_=>_.handle===l),u=r.length-1,d=je({methods:r,selectedDeliveryMethodHandle:l}),p=xe("purchase.checkout.pickup-location-option-item.render-after"),h=c?.handle??"",v=se(()=>({handle:h}),[h]);if(!c)return null;function m(){t(),d("checkout_pickup_buyer_reveal_more")}const g=n(X,{children:[n(Y,{when:i,children:n(X,{children:[n(G,{padding:"base",children:n(po,{})}),n(Ue,{accessibilityRole:"presentation"})]})}),n(G,{padding:"base",children:[n(to,{method:c,subscriptionBanner:!0}),n(Be,{marginBlockStart:"small100",customizations:p,options:v})]}),u>0?n(I,{children:[n(Ue,{accessibilityRole:"presentation"}),n(G,{padding:"base",children:n(ye,{variant:"plain",inlineSize:"fill",textDecoration:"none",inlineAlignment:"start",onClick:m,children:n(I,{direction:"inline",gap:"small-200",alignItems:"center",justifyContent:"space-between",children:[n(O,{type:"strong",children:a.translate("local_pickup.toggle_more_locations",{count:u})}),n(oe,{type:"chevron-right",size:"small-200"})]})})})]}):null]});return n(I,{gap:"base",children:s?n(wa,{target:"edgeToEdgeCard",children:n(ze,{accessibilityRole:"presentation",children:g})}):n(G,{border:"base",borderRadius:"large",children:g})})}function xn(){const{shop:e}=y(),t=ho(),a=e.hasFlagEnabled(ia),o=n(X,{children:[n(Y,{when:t,children:[n(G,{padding:"base",children:n(po,{})}),n(Ue,{accessibilityRole:"presentation"})]}),n(G,{padding:"base",children:n(I,{direction:"block",gap:"small-400",children:n(I,{children:[n(ge,{gap:"small-400",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content)",alignItems:"baseline",children:[n(pe,{}),n(pe,{inlineSize:"small"})]}),n(pe,{inlineSize:"large"}),n(G,{paddingBlockStart:"small-500",children:n(pe,{size:"small"})})]})})}),n(Ue,{accessibilityRole:"presentation"}),n(G,{padding:"base",children:n(pe,{inlineSize:"small"})})]});return n(I,{gap:"base",children:[n(I,{direction:"inline",gap:"small-200",justifyContent:"space-between",children:[n(pe,{inlineSize:"large"}),n(pe,{inlineSize:"small"})]}),a?n(wa,{target:"edgeToEdgeCard",children:n(ze,{accessibilityRole:"presentation",children:o})}):n(G,{border:"base",borderRadius:"large",children:o})]})}function zc({onShowModal:e,showLocationButton:t=!0}){const{i18n:a}=y(),{value:o}=ce().merchandiseLines;at({active:!0});const{fullCountryName:i,isOnlyCountryAvailable:s}=we(),r=je({methods:[],selectedDeliveryMethodHandle:void 0}),l=Je(o?.lines),c=i?a.translate("local_pickup.pickup_unavailable_banner_title_with_country",{country:i,count:l}):a.translate("local_pickup.pickup_unavailable_banner_title",{count:l});return n(I,{gap:"small",children:[t&&n(Xa,{onClick:()=>{e(),r(s?"checkout_pickup_geoselector_clicked_country_grain":"checkout_pickup_geoselector_clicked_other_grain")}}),n(An,{heading:c,tryDifferentLocationOnClick:()=>e(!0)})]})}const Wt={isLocationFormVisible:!1};function Uu(){const{i18n:e}=y(),{negotiating:t}=Sn(),a=en(),o=Ze(),i=Ke("deliveryNext"),{value:s}=Ia().value,{value:r}=La().value,l=!!(s||r),c=de(tt(Jn).hasViolations),u=ja({mode:"localPickup"}),d=L(()=>u.value.merchandiseLines),p=L(()=>u.value.allowAlternativeAction),h=L(()=>u.value.merchandiseLines.length>0),{isOnlyCountryAvailable:v}=we(),m=L(()=>{const T=a.value?.methods??[];return T.length>0&&eo(T)}),g=ht({allLocationsFarAway:m,selectedPickupOptionNoLongerAvailable:c}),_=je({methods:a.value?.methods||[],selectedDeliveryMethodHandle:a.value?.selectedDeliveryMethodHandle}
2),[C,A]=le(!1),f=ue(!1),b=xe("Checkout::PickupLocations::RenderBefore"),w=xe("Checkout::PickupLocations::RenderAfter"),k=T=>{A(!0),f.value=T??!1},M=()=>{A(!1),f.value=!1},z=()=>{k(),_(v?"checkout_pickup_geoselector_clicked_country_grain":"checkout_pickup_geoselector_clicked_other_grain")},F=(()=>{const T=a.value,R=T?.methods.find(S=>S.handle===T.selectedDeliveryMethodHandle);if(!o.value||C)return n(xn,{});if(t.value&&!R)return n(xn,{});if(l)return n(Y,{when:h,fallback:n(zc,{onShowModal:k}),children:n(X,{children:[n($n,{bannerType:"pickup",merchandiseLines:d,allowAlternativeAction:p}),n(Wc,{})]})});if(!T)return n(xn,{});const{methods:V}=T,P=Je(T.targetMerchandiseLines);return n(I,{gap:"base",children:[n(Y,{when:h,children:n($n,{bannerType:"pickup",merchandiseLines:d,allowAlternativeAction:p})}),n(Y,{when:c,children:n(pt,{})}),n(Y,{when:g,children:n(dt,{itemCount:P,methods:T.methods,onChangeLocationClick:k})}),n(I,{direction:"inline",gap:"small-200",justifyContent:"space-between",children:[n(Y,{when:i,fallback:n(O,{color:"subdued",children:yc(V,v,P,e,{selectedDeliveryMethodHandle:T.selectedDeliveryMethodHandle,allLocationsFarAway:m.value})}),children:n(pe,{inlineSize:"base"})}),n(Xa,{onClick:z})]}),n(Be,{customizations:b,options:Wt}),n(Uc,{localPickupDeliveryLine:T,onShowModal:k}),n(Be,{customizations:w,options:Wt})]})})();return n(Pn,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(ze,{accessibilityLabel:e.translate("local_pickup.pick_up_location"),children:[F,n(Sc,{methods:a.value?.methods,type:a.value?.type,open:C,onClose:M,addressFocus:f})]})})}function Wc(){return at({active:!0}),null}const $t=5;function $c(e,t){const a=je({methods:e,selectedDeliveryMethodHandle:t}),[o,i]=le($t),s=se(()=>e.slice(0,o),[e,o]);K(()=>{const u=e.findIndex(p=>p.handle===t);u>=o&&i(u+1)},[e,o,t]);const r=e.length-s.length,l=s.length>=e.length;return{revealedMethods:s,amountLeft:r,allRevealed:l,revealMore:()=>{l||(i(u=>u+$t),a("checkout_pickup_buyer_reveal_more"))}}}const Gc=13;function zu(){const{i18n:e}=y(),[t,a]=le(!1),{formattedAddress:o}=we(),i=o?n(I,{direction:"inline",gap:"small-500",alignItems:"center",children:[n(oe,{type:"geolocation",size:"small-100"}),n(O,{children:Ya(o,Gc)})]}):e.translate("local_pickup.toggle_location");return n(Pn,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(ze,{accessibilityLabel:e.translate("delivery_options.pick_up_locations"),children:n(I,{gap:"small-500",children:[n(ge,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content)",gridTemplateRows:"minmax(0, 1fr)",alignItems:"baseline",children:[n(Ge,{level:2,children:e.translate("delivery_options.pick_up_locations")}),n(me,{id:"change-pickup-location-button",textDecoration:"none",onClick:()=>a(s=>!s),accessibilityLabel:t?e.translate("local_pickup.cancel"):e.translate("local_pickup.toggle_location"),children:t?e.translate("local_pickup.cancel"):i})]}),n(Kc,{isLocationFormVisible:t,setIsLocationFormVisible:a})]})})})}function Kc({isLocationFormVisible:e,setIsLocationFormVisible:t}){const a=Ze(),{i18n:o}=y(),{negotiating:i}=Sn(),s=en(),r=Ke("deliveryNext"),{value:l}=La().value,c=!!l,{isOnlyCountryAvailable:u}=we(),d=Mn(),{deliveryLines:p}=$(),h=p.value,{negotiate:v}=ke(),m=Ui(),g=xe("Checkout::PickupLocations::RenderBefore"),_=xe("Checkout::PickupLocations::RenderAfter"),C=se(()=>({isLocationFormVisible:e}),[e]),A=()=>t(!1),f=()=>t(F=>!F),b=()=>{A();const F=h.find(T=>{const R=T.peek().id;return R&&R===s.value?.id});F&&(F.fields.deliveryMethodHandle.value=void 0),v({include:["deliveryNext"],fieldsToResolve:["deliveryNext"]})},w=Fe(),{pickupCountries:k,loading:M}=aa(Za,{sellableDeliveryMethods:w}),z=L(()=>!!(s.value&&Rl(s.value.methods)));if(c)return n(Gt,{isLocationFormVisible:e,setFormVisibilityFalse:A,handleLocationChange:b,pickupCountries:k.value??[],onToggleLocationFormClick:f});if(i.value||!a.value||M.value||!k.value)return n(Ln,{});if(s.value){const{methods:F,type:T}=s.value,R=m.value.PICK_UP??0,V=z.value&&d&&!u,P=u?Oe(R,{oneItem:()=>o.translate("local_pickup.location_information_far_away_one_item",{count:F.length}),otherItems:()=>o.translate("local_pickup.location_information_far_away_other_items",{count:F.length})}):Oe(R,{oneItem:()=>
2o.translate("local_pickup.location_nearby_one_item",{count:F.length}),otherItems:()=>o.translate("local_pickup.location_nearby_other_items",{count:F.length})});return n(I,{gap:"base",children:[n(no,{}),n(Be,{customizations:g,options:C}),n(ge,{gap:"@media (inline-size >= medium) large-500, none",gridTemplateColumns:"@media (inline-size >= medium) 'minmax(0, 1fr) minmax(auto, max-content)', 'minmax(0, 1fr)'",gridAutoColumns:"@media (inline-size >= medium) 'minmax(0, 1fr) minmax(auto, max-content)', 'minmax(0, 1fr)'",justifyItems:"start",justifyContent:"start",alignItems:"start",alignContent:"start",gridTemplateRows:"minmax(auto, max-content)",gridAutoRows:"minmax(auto, max-content)",children:!V&&n(Ee,{color:"subdued",children:d?P:o.translate("local_pickup.location_information",{count:F.length})})}),n(Qa,{locationFormVisible:e,toggleLocationFormVisibility:A,onLocationChange:b,pickupCountries:k.value,children:n(Yc,{itemCount:R,methods:F,type:T,allLocationsFarAway:z,loading:r.value,onToggleLocationFormClick:f})}),n(Be,{customizations:_,options:C})]})}return n(Gt,{isLocationFormVisible:e,setFormVisibilityFalse:A,handleLocationChange:b,pickupCountries:k.value,onToggleLocationFormClick:f})}function Gt({isLocationFormVisible:e,setFormVisibilityFalse:t,handleLocationChange:a,pickupCountries:o,onToggleLocationFormClick:i}){const{value:s,loading:r}=Ia().value,l=ce().merchandiseLines,{i18n:c}=y(),{locationAddress:u}
2=$(),d=u.peek(),p=o.find(m=>m.value===d.countryCode)?.label,h=Je(l.value?.lines),v=p?c.translate("order_summary.pickup_unavailable_banner_title_with_country",{count:h,country:p}):c.translate("order_summary.pickup_unavailable_banner_title",{count:h});return!r&&s?n(I,{gap:"base",children:[n(Qa,{locationFormVisible:e,toggleLocationFormVisibility:t,onLocationChange:a,pickupCountries:o,children:n(An,{heading:v,tryDifferentLocationOnClick:i})}),n(qc,{})]}):n(Ln,{})}function qc(){return at({active:!0}),null}function Kt({instructions:e}){return n(G,{maxInlineSize:"200px",children:n(Ee,{type:"small",children:e})})}function jc({handle:e,address:t,secondaryLabel:a,letterCase:o,showInstructionsLeft:i,showInstructionsRight:s,instructions:r,nameLabel:l,itemRenderAfterCustomizations:c}){const u=se(()=>({handle:e}),[e]);return n(In,{value:e,details:n(X,{children:[n(Ma,{address:t,textSize:"small",hiddenFields:["phone"]}),i&&r&&n(Kt,{instructions:r})]}),secondaryContent:n(X,{children:[n(O,{type:"strong",letterCase:o,children:n("span",{style:{display:"flex",justifyContent:"flex-end"},children:a})}),s&&r&&n(Kt,{instructions:r})]}),tertiaryContent:c?.length>0&&n(Be,{customizations:c,options:u,render:d=>n(I,{padding:"small-100 none none none",gap:"small-100",children:d})}),children:n(O,{type:"strong",children:l})})}function Yc({itemCount:e,methods:t,allLocationsFarAway:a,type:o,loading:i,onToggleLocationFormClick:s}){const{i18n:r,checkout:{identity:l}}=y(),c=l.current.value==="shopPay",{negotiate:u}=ke(),d=ta(),{isOnlyCountryAvailable:p}=we(),h=Mn(),v=Ze(),m=zi({base:!0,medium:!1}),g=v.value?m??!1:!0,[_,C]=ka({type:o,deliveryMethodType:"PICK_UP"}),{revealedMethods:A,amountLeft:f,allRevealed:b,revealMore:w}=$c(t,_),{setInverseGroupDeliveryMethodHandle:k,getInverseGroupDeliveryMethodHandle:M}=Ca(t,o),z=j(([D=""])=>{if(C(D),d.value){const W=M(D);k(W)}u({include:["deliveryNext"]})},[C,d,u,M,k]),F=xe("purchase.checkout.pickup-location-option-item.render-after"),T=de(tt(Jn).hasViolations),R=ht({allLocationsFarAway:a,selectedPickupOptionNoLongerAvailable:T}),V=se(()=>_?[_]:[],[_]);if(i)return n(Ln,{hideText:!0});const P=(D,W)=>D===0?r.translate("shipping.free_rate_label"):r.formatCurrency(D,{currency:W}),S=({name:D="",proximityLabel:W,distance:U})=>{if(!(!p&&(U||W)))return D;const re=W||`(${ut(r,U)})`;return n(X,{children:[D," ",n(O,{color:"subdued",children:re})]})};return n(I,{gap:"base",children:[n(Y,{when:R,children:n(dt,{itemCount:e,methods:t,onChangeLocationClick:s})}),T.value&&n(pt,{}),n(rt,{name:"local_pickup_methods",values:V,onChange:z,hideRadioControl:!c&&A.length===1,children:A.map(({handle:D,cost:{amount:W,currencyCode:U},pickupLocation:ie})=>{const{address:re,instructions:J,name:N,distanceFromBuyer:B,proximityLabel:H}=ie,ee=P(W,U),x=S({name:N,distance:B,proximityLabel:h?void 0:H}),Q=ee===r.translate("shipping.free_rate_label")?"uppercase":void 0;return n(jc,{handle:D,address:re,secondaryLabel:ee,letterCase:Q,showInstructionsLeft:!!(J&&(c||g)),showInstructionsRight:!!(J&&!c&&!g),instructions:J,nameLabel:x,itemRenderAfterCustomizations:F},D)})}),!b&&n(G,{inlineAlignment:"end",children:n(me,{onClick:w,children:r.translate("local_pickup.reveal_more_label",{count:f})})})]})}function Xc({heading:e="auto"}){const{i18n:t}=y(),a=t.translate("pickup_point.title");return n(ze,{accessibilityLabel:a,children:n(I,{gap:"small-400",children:[e==="auto"&&n(Ge,{level:2,children:a}),n(pa,{blockSize:"small-500"}),n(Bs,{text:t.translate("pickup_point.waiting_on_pickup_point_location_notice")})]})})}const Wu=mn({displayName:"PickupPoint",load:()=>Kn(()=>an(()=>import("./component-PickupPoint.SsasjJEn.js"),__vite__mapDeps([63,1,6,2,3,4,5,7,8,9,54,50,21,22,23,24,25,11,12,51,10,13,14,15,16,17,18,19,20,26,64,33,57,65,66,34,31,32,35,28,45,46,47,42,43,44,48,49,27,52,40,41,53,67]))),renderLoading:e=>n(Xc,{...e})});function $u({selectedDeliveryMethodType:e}){const{i18n:t}=y(),{merchandiseLines:a}=$(),o=Qe(e),{shouldOpenModal:i}=ro(),s=L(()=>{const l=so({targetMerchandiseLines:o.value,merchandiseLines:a.value});return l.isAllItems?e==="PICK_UP"?t.translate("split_delivery.pickup_all_items"):t.translate("split_delivery.ship_all_items"):e==="PICK_UP"?t.translate("split_delivery.pickup_items_count",{count:l.targetMerchandiseQuantity}):t.translate("split_delivery.ship_items_count",{count:l.targetMerchandiseQuantity})}),r=L(()=>`${s.value}, ${t.translate("review.blocks.change_delivery_method_link_label")}`);return i.value?n(ye,{variant:"plain",tone:"monochrome",inlineSize:"fill",inlineAlignment:"start",textDecoration:"none",accessibilityLabel:r.value,command:"--show",commandFor:vt,children:n(ge,{gridAutoFlow:"column",gridTemplateColumns:"minmax(auto, max-content) minmax(0, 1fr) minmax(auto, max-content)",alignItems:"center",gap:"small-200",children:[n(Sa,{variant:"fan-legacy",sortByPrice:!0,merchandise:o.value,size:"small",useImageAltTexts:!1}),n(O,{children:s}
2),n(oe,{type:"pen",size:"base",tone:"neutral"})]})}):n(hn,{title:e==="PICK_UP"?t.translate("split_delivery.items_for_pickup"):t.translate("split_delivery.items_for_shipping"),selectedDeliveryMethodType:e})}function Jc({onClose:e}={}){const{negotiate:t}=ke(),{i18n:a}=y(),o=Wi(),{deliveryLines:i,merchandiseLines:s,discountLines:r}=$(),l=Fe(),c=te(!1),u=j(({targetDeliveryMethodType:h,merchandiseStableIds:v})=>{const{orphanedRemovedFromCartStableIds:m}=si({deliveryLines:i,merchandiseLines:s,targetDeliveryMethodType:h,merchandiseStableIds:v,sellableDeliveryMethodsByStableId:l.value.deliveryMethodsByMerchandise,discountLines:r});m.length>0&&(c.current=!0)},[i,s,l,r]),d=j(h=>{na({deliveryLines:i,merchandiseLines:s,merchandiseStableIds:h,discountLines:r})},[i,s,r]),p=j(()=>{e?.(),t({include:["deliveryNext","merchandiseLines"]}),c.current&&(c.current=!1,o(a.translate("stock.removed_from_cart_notice")))},[t,e,o,a]);return{moveMerchandise:u,removeMerchandise:d,saveAndClose:p}}function Gu({id:e=vt,open:t}){const{i18n:a}=y(),o=Qe("PICK_UP"),i=Qe("SHIPPING"),{moveMerchandise:s,removeMerchandise:r,saveAndClose:l}=Jc(),c=a.translate("delivery_options.pickup"),u=a.translate("delivery_options.ship_to_address");return n(kn,{id:e,open:t,accessibilityLabel:a.translate("split_delivery.delivery_method"),onHide:l,primaryAction:n(ye,{command:"--hide",commandFor:e,inlineSize:"fill",variant:"primary",children:a.translate("payment.add_credit_card_modal.save")}),children:n(I,{gap:"large-300",children:[o.value.length>0&&n(I,{gap:"base",children:[n(I,{direction:"inline",gap:"small-400",alignItems:"center",children:[n(oe,{type:"marker"}),n(Ge,{level:2,children:c})]}),n(G,{border:"base",borderRadius:"large",padding:"base",children:n(hn,{onMoveMerchandise:s,onRemoveMerchandise:r,selectedDeliveryMethodType:"PICK_UP",title:c})})]}),i.value.length>0&&n(I,{gap:"base",children:[n(I,{direction:"inline",gap:"small-400",alignItems:"center",children:[n(oe,{type:"package-delivery"}),n(Ge,{level:2,children:u})]}),n(G,{border:"base",borderRadius:"large",padding:"base",children:n(hn,{onMoveMerchandise:s,onRemoveMerchandise:r,selectedDeliveryMethodType:"SHIPPING",title:u})})]})]})})}function Qc(){const[e,t]=le(!1),a=Yn(),o=te(0);K(()=>{Date.now()<o.current||t(!1)},[a.lastNegotiation.value]);function i(){o.current=Date.now()+1e3,t(!0)}return{cartUpdated:e,setCartUpdated:i}}function Zc(e){return e==="LOCAL"?"SHIPPING":e}function eu(e){const t=new Set(e.map(Zc));return t.size===1?t.has("SHIPPING")||t.has("PICK_UP")||t.has("PICKUP_POINT"):t.size===2&&t.has("SHIPPING")&&t.has("PICK_UP")}function Ku(){const{violations:e}=$i(Ct),{client:t,i18n:a,shop:o,source:i,observability:s,url:r,embed:l,checkout:c}=y(),{merchandiseLines:u,shippingAddress:d}=$(),{countryName:p,loading:h}=Gi(d.value),{value:v}=ce().merchandiseLines,{negotiate:m}=ke(),g=Ki(),{negotiating:_,methods:C}=Sn(),{loading:A}=Yn(),f=te(g.peek()),b=te(A.peek().has("deliveryNext")),k=L(()=>{const ne=A.value.has("deliveryNext"),Se=b.current&&!ne;return g.value?f.current=!0:Se&&(f.current=!1),b.current=ne,f.current}).value,{cartUpdated:M,setCartUpdated:z}=Qc(),F=bn(),[T,R]=le(void 0),V=!!l;K(()=>{e.size>0&&R(p)},[e]);const P=ja({deliveryMethodType:"SHIPPING",mode:"deliveryMethodScoped"}),S=L(()=>P.value.merchandiseLines),D=L(()=>P.value.merchandiseLines.length>0);if(!v||v.lines.length===0||h||T!==p||k)return null;if(M)return n(Cn,{heading:a.translate("merchandise_unavailable_in_buyer_location.cart_updated"),tone:"info"});if(e.size===0||o.shipPickupInOneOrderEnabled&&_.value&&eu(C.value))return null;const U=va(Array.from(e),v,Array.from(Ct)),ie=U?.map(({stableId:ne})=>ne),re=u.value.filter(({stableId:ne})=>!ie?.includes(ne)),J=re.length===0,N=n($n,{bannerType:"shipping",merchandiseLines:S});if(U==null)return D.value?N:null;const B=Array.from(e).some(({code:ne})=>ne==="MERCHANDISE_PRODUCT_NOT_PUBLISHED_IN_BUYER_LOCATION")?p??a.translate("merchandise_unavailable_in_buyer_location.missing_country_fallback"):a.translate("merchandise_unavailable_in_buyer_location.indeterminate_location_fallback");let H=null;J&&U.length===1?H=a.translate("merchandise_unavailable_in_buyer_location.banner_title.all_products_one",{location_name:B}):J?H=a.translate("merchandise_unavailable_in_buyer_location.banner_title.all_products_other",{location_name:B}):U.length===1?H=a.translate("merchandise_unavailable_in_buyer_location.banner_title.some_products_one",{location_name:B}):H=a.translate("merchandise_unavailable_in_buyer_location.banner_title.some_products_other",{location_name:B});const ee=J?null:n(ga,{children:U.map(ne=>n(_a,{children:ne.subtitle?a.translate("merchandise_unavailable_in_buyer_location.unavailable_line_item",{product_name:ne.title,variant_label:ne.subt
2itle}):ne.title},ne.stableId))}),x=U.length===1?a.translate("merchandise_unavailable_in_buyer_location.remove_items_action.one"):a.translate("merchandise_unavailable_in_buyer_location.remove_items_action.other"),Q=a.translate("merchandise_unavailable_in_buyer_location.empty_cart_action");function q(){F("click",{element:{tagName:"a",textContent:Q},section:"delivery",timestamp:new Date}),s.log("redirect_to_storefront","[UnavailableInBuyerLocationBanner] Empty cart and redirect to storefront",{allItemsUnavailable:J,redirectSuccess:o.hasStorefront}),qi({client:t,url:r,source:i,configuration:c.configuration})}function Ce(){F("click",{element:{tagName:"a",textContent:x},section:"delivery",timestamp:new Date}),u.value=re,m({onComplete:z})}const _e=n(O,{children:J?J&&(V||!o.hasStorefront)?a.translate("merchandise_unavailable_in_buyer_location.change_address_only"):a.translate("merchandise_unavailable_in_buyer_location.change_address_or_remove",{remove_action:n(me,{onClick:q,children:Q})}):a.translate("merchandise_unavailable_in_buyer_location.change_address_or_remove",{remove_action:n(me,{onClick:Ce,children:x})})}),fe=n(Ea,{impressionType:"unavailable_in_buyer_location",impressionFeatures:Array.from(e).map(({code:ne})=>ne),children:n(qe,{heading:H,tone:"critical",children:n(I,{gap:"base",children:[ee,_e]})})});return n(Y,{when:D,fallback:fe,children:N})}function nu({taxId:e}){const{negotiate:t}=ke(),a=ji(),o=()=>{t({identifier:Symbol.for("vat-id-validation"),force:!0})},i=l=>{e.format.validate(l)&&(o(),a({vatId:l}))};K(()=>{e.validated.status===null&&i(e.value)},[]);const s=l=>{e.set(l),i(l)},r=()=>{e.value===e.validated.taxId&&e.validated.status||(o(),a({vatId:e.value}))};return{value:e.value,status:e.status,loading:e.status.type==="pending",onBlur:r,onInput:s}}function tu({status:e}){const{i18n:t}=y(),{shippingAddress:a}=$(),o=de(e);return L(()=>{const i=a.value.countryCode?.toLowerCase(),s=o.value;return s.type==="invalid_format"&&i?{code:"invalid_format",details:{country:i},message:t.translate("taxes.vat_number.status.invalid_format",{scope:i})}:s.type==="resolved"&&s.validationStatus==="INVALID"&&i?{code:"invalid_number",details:{country:i},message:t.translate("taxes.vat_number.status.invalid_number",{scope:i})}:s.type==="resolved"&&s.validationStatus==="SERVICE_ERROR"?{code:"service_error",message:t.translate("taxes.vat_number.status.service_error")}:s.type==="resolved"&&s.validationStatus==="SERVICE_UNAVAILABLE"?{code:"service_unavailable",message:t.translate("taxes.vat_number.status.service_unavailable")}:null})}function au(e,t){const a=te(e.type),o=te(t);K(()=>{o.current=t},[t]);const i=e.type;K(()=>{const s=a.current;a.current=i,s==="pending"&&i==="resolved"&&o.current()},[i])}const ou=fn("VatNumberFieldInfoTooltip");function iu({status:e}){const{i18n:t}=y();return e.type==="pending"?n(et,{size:"small",accessibilityLabel:t.translate("taxes.vat_number.accessibility.status.validating")}):e.type==="invalid_format"?n(mo,{}):n(su,{status:e})}function su({status:{validationStatus:e}}){const{i18n:t}=y();return e==="VALID"?n(X,{children:[n(oe,{tone:"success",size:"small",type:"check-circle"}),n(O,{accessibilityVisibility:"exclusive",children:t.translate("taxes.vat_number.accessibility.status.valid")})]}):n(mo,{})}function mo(){const{i18n:e}=y(),t=_n(void 0,ou);return n(X,{children:[n(oe,{size:"small",type:"question-circle",interestFor:t}),n(ca,{id:t,children:e.translate("taxes.vat_number.field.tooltip")})]})}function qu({taxId:e,applied:t,inputRef:a}){const{i18n:o}=y(),i=nu({taxId:e}),s=tu(i),r=L(()=>s.value&&{type:"warning",value:s.value.message}),l=e.warnings.includes("DOMESTIC_NOT_APPLICABLE");return au(i.status,()=>{if(i.status.type==="resolved"&&i.status.validationStatus==="VALID"&&t)return De({content:o.translate("taxes.vat_number.accessibility.status.applied"),role:"alert"});if(l)return De({content:o.translate("taxes.vat_number.accessibility.status.domestic"),role:"status"});const c=s.value;if(c)switch(c.code){case"invalid_number":return De({content:o.translate("taxes.vat_number.accessibility.status.invalid_number"),role:"alert"});case"service_error":return De({content:o.translate("taxes.vat_number.accessibility.status.service_error"),role:"alert"});case"service_unavailable":return De({content:o.translate("taxes.vat_number.accessibility.status.service_unavailable"),role:"alert"})}}),n(I,{direction:"block",gap:"base",children:[n("div",{"aria-busy":i.loading,children:n(ua,{ref:a,name:"vatNumber",label:o.translate("taxes.vat_number.field.label"),autocomplete:"off",inputMode:"text",accessoryEnd:n(iu,{status:i.status}),error:r.value,...i})}),l&&n(Cn,{tone:"info",children:o.translate("taxes.vat_number.domestic_order")})]})}function ju({name:e,variant:t="content",children:a}){return Yi(()=>an(()=>Promise.resolve({}),__vite__mapDeps([68]))),n("div",{className:`delivery-transition-${t}
2`,style:e?{"--delivery-view-transition-name":e}:void 0,children:a})}export{Da as $,Ht as A,yc as B,Bu as C,Hu as D,Fu as E,dt as F,Xa as G,Sc as H,$n as I,bc as J,ut as K,Pc as L,Cc as M,fc as N,El as O,Oa as P,oo as Q,io as R,no as S,wc as T,Ku as U,qu as V,Mc as W,Lc as X,vt as Y,hn as Z,_l as _,ja as a,Ln as b,zc as c,pt as d,Vu as e,ho as f,Wu as g,ju as h,Gu as i,Mn as j,Uu as k,zu as l,$u as m,Ru as n,_r as o,Vt as p,An as q,za as r,Dt as s,Ar as t,Vs as u,Ra as v,xa as w,we as x,Rl as y,ht as z};

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.