PageSourceSearch

https://shop.realfaith.com/cdn/shopifycloud/checkout-web/assets/c1/components-DeliveryTransition.BjmsXjx9.js

js realfaith.com collected 2026-09-24 10:56:55 UTC 112,686 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["component-ShopPayVerificationSwitch.V4dm7i6D.js","esnext-vendor.D7ldIee_.js","addresses-is-address-empty.-MuOhIyI.js","app.A60-IfPs.js","assets/app.Sxsz5knT.css","assets/is-address-empty.DJksNKpk.css","hydrate.ByRIsqvd.js","constants.DowbVE6J.js","hooks-useReplaceShopPayInHistory.Cz4PqGkk.js","assets/previous.ClThmeCv.css","stopwatch.wWgdKLTI.js","components-RedirectionNotice.module.CqgkZHXB.js","assets/RedirectionNotice.B8v_QGNW.css","BillingAddressForm.DHpCPcqC.js","localization-index.DBksi22x.js","assets/index.BAKORI_U.css","hooks-useSuppressShopPayModalOnLoad.CI5bzdLE.js","PhoneField.BapDvZfY.js","hooks-useUnauthenticatedErrorModal.CzvtLqeY.js","assets/PhoneField.uZEuHncj.css","Popover.BNecjV8x.js","assets/Popover.Bi1nHaU-.css","hooks-useCanChangeCompanyLocation.Bk004VMP.js","Choice.Dywz6_Fr.js","Checkbox.Cby2hWUV.js","assets/Checkbox.SrYMuQu4.css","assets/Choice.aPApdPe_.css","assets/BillingAddressForm.BdwN7V1K.css","hooks-useForceShopPayUrl.MIxsBkT_.js","models-ShopPayBuyerDetails.model.CahX79UU.js","shop-pay-normalizeBuyerDetails.BcEhgoK7.js","context-CheckoutSheetProtocolClient.CNLSBD5p.js","utilities-publishMessage.fqiR55Tb.js","useAuthorizeUrl-index.B4Pj7zGU.js","dist-v4.EwEgHOG0.js","assets/ShopPayVerificationSwitch.WW3cs_z5.css","component-ApplePayButton.J4DlVkoC.js","apple-pay-errors.CcNuwNMC.js","TransitionHeight.C0wKTnZA.js","assets/TransitionHeight.CuRoM9zv.css","hooks-useWalletsTimeout.DIL_pXhM.js","useShopPayButtonClassName.DeL41vx0.js","shared-shop-theme.BJKdwdMa.js","hooks-useShouldRevealCustomization.C_GYHzzt.js","assets/useShopPayButtonClassName.CpHF4L7Q.css","ChangeCompanyLocationLink.Ba8IeUdU.js","ImpressionEventCapture.CIEEzh6Z.js","ShopPayLogo.Dh-KQvuu.js","Monorail-monorailMetric-wallets.C3kHkAxp.js","shop-pay-installments-monorail.cv2DVyY3.js","MarketsProDisclaimer.wV7aMZTc.js","IncentiveBadge.D66zssvS.js","assets/IncentiveBadge.Dlnp55te.css","shipping-methods-grouping.DDWlTvqo.js","Section-SectionStyleOverride.Dli5IR65.js","AutocompleteField-hooks.YzxHOgXJ.js","PendingShipping.TwutGJMj.js","assets/ApplePayButton.CTcryfIc.css","component-amazonWalletLazy.B2JRtcsq.js","hooks-useStableHostMethodsReferences.C4W1cetV.js","WalletsSandbox-WalletSandbox.1h2TYCnJ.js","assets/WalletSandbox.BoV0vp4z.css","amazon-constants.D1uChO-s.js","assets/amazonWalletLazy.D78LrA7v.css","component-PickupPoint.iWjeoIDl.js","Map.B2LN1-dp.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 A,_ as Gn,u as n,h as K,p as Me,T as se,d as mn,r as Kn,e as ce,A as te,k as le,q,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 ft,ad as ko}from"./esnext-vendor.D7ldIee_.js";import{h as Co,F as Kt,a as So}from"./localization-index.DBksi22x.js";import{N as g,O as $,ae as vn,j6 as Io,b2 as Lo,a0 as ke,an as jn,B as $e,$ as ue,jk as Ne,bi as jt,eP as qt,bj as Yt,bk as qn,bl as cn,dj as Ao,b_ as Mo,aa as Eo,dl as To,c0 as wo,gc as wn,am as Ze,ab as Te,cE as Xt,ac as Yn,jl as No,jm as Do,cC as yn,aE as Qt,jn as Oo,f8 as xo,jo as Bo,ap as Ae,cB as Fo,aV as Jt,jp as Ro,jq as Vo,al as Ho,jr as bt,dd as Uo,bb as Ke,g8 as Zt,av as ea,je as zo,js as Wo,g6 as Fe,jt as na,ah as ta,ju as aa,dC as en,jv as $o,jw as Go,A as Rn,eS as Ko,dO as jo,eR as qo,D as Yo,jx as Xo,jy as Pt,cR as Qo,eT as Jo,eW as Zo,bB as ei,k as ni,n as ti,cS as oa,dF as Xn,bF as ia,jz as sa,jA as ai,cU as oi,j0 as ii,jB as si,bc as ri,af as ra,aj as Qn,jC as li,jD as kt}from"./addresses-is-address-empty.-MuOhIyI.js";import{cV as la,ba as Jn,d as ci,a8 as gn,P as Ee,k as I,dm as ui,ck as Zn,I as oe,i as ye,h0 as di,eu as un,F as _n,a as De,az as ca,l as B,ga as ua,M as fn,bG as bn,G as ge,T as da,ab as dn,g8 as pi,S as et,L as me,h1 as hi,bH as mi,gT as vi,cH as Pn,cp as yi,g0 as gi,a7 as _i,eY as fi,n as Ge,bt as kn,B as G,ak as bi,b2 as Pi,c1 as ki,u as Ci,_ as pa,a0 as He,$ as ze,h2 as Si,s as xe,h3 as Ii,cR as nt,Q as Li,U as Be,b as ha,bv as ma,h4 as Ai,W as je,D as nn,J as Mi,bj as va,bi as Vn,cg as tn,el as Ei,cl as Ti,h5 as qe,bN as Cn,h6 as ya,cm as ga,cn as _a,al as pe,em as Sn,ce as fa,ez as ba,eA as wi,fT as Ni,O as Pa,aE as ka,ch as Ca,bM as tt,ci as Sa,h7 as Qe,h8 as Di,h9 as Oi,aC as xi,c2 as Bi,ax as Fi,ha as Ri,an as Vi,bn as Ct,hb as Hi,aA as Ia,dA as La,dB as Aa,dS as Ui,a1 as zi,c3 as Wi,bV as $i,hc as Gi,f6 as Ki,gP as ji,hd as qi,he as Yi}from"./hydrate.ByRIsqvd.js";import{a as at,v as Hn,b as Xi,S as Qi}from"./useShopPayButtonClassName.DeL41vx0.js";import{p as Ji,e as Zi,u as ot}from"./models-ShopPayBuyerDetails.model.CahX79UU.js";import{L as Ue,u as es}from"./hooks-useCanChangeCompanyLocation.Bk004VMP.js";import{S as ns,u as ts,a as as,A as os}from"./ChangeCompanyLocationLink.Ba8IeUdU.js";import{C as it}from"./Checkbox.Cby2hWUV.js";import{b as is,c as ss,d as rs,i as Ma,e as ls}from"./hooks-useForceShopPayUrl.MIxsBkT_.js";import{P as cs,u as us,F as ds}from"./PhoneField.BapDvZfY.js";import{_ as an,I as ps}from"./app.A60-IfPs.js";import{I as Ea}from"./ImpressionEventCapture.CIEEzh6Z.js";import{S as hs,u as ms,G as vs}from"./ShopPayLogo.Dh-KQvuu.js";
2import{a as be,c as Un,u as ys,d as gs,e as _s}from"./Monorail-monorailMetric-wallets.C3kHkAxp.js";import{a as fs,e as bs,S as St}from"./components-RedirectionNotice.module.CqgkZHXB.js";import{g as Ps,P as ks,h as It}from"./hooks-useWalletsTimeout.DIL_pXhM.js";import{S as Cs}from"./shared-shop-theme.BJKdwdMa.js";import{a as Ss}from"./hooks-useShouldRevealCustomization.C_GYHzzt.js";import{a as Is}from"./shop-pay-installments-monorail.cv2DVyY3.js";import{M as Ls}from"./MarketsProDisclaimer.wV7aMZTc.js";import{A as As}from"./hooks-useUnauthenticatedErrorModal.CzvtLqeY.js";import{C as In,b as Ms,a as Es}from"./Choice.Dywz6_Fr.js";import{C as st}from"./IncentiveBadge.D66zssvS.js";import{c as Ta,u as Ts}from"./shipping-methods-grouping.DDWlTvqo.js";import{S as wa}from"./Section-SectionStyleOverride.Dli5IR65.js";import{T as ws}from"./TransitionHeight.C0wKTnZA.js";import{u as Ns}from"./AutocompleteField-hooks.YzxHOgXJ.js";import{a as Ds,s as Os,M as xs}from"./BillingAddressForm.DHpCPcqC.js";import{P as Bs}from"./PendingShipping.TwutGJMj.js";import{P as Fs}from"./Popover.BNecjV8x.js";function Rs(){const{i18n:e,shop:t,shopPay:a}=g(),{shippingAddress:o}=$(),i=vn();return A(()=>{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}=g(),{shippingAddress:a,billingAddress:o}=$(),i=la(),s=e.hasFlagEnabled(Io);return A(()=>{if(!s)return null;const r=Ji({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}=g(),o=Jn(),i=$(),s=la(),r=ci(),l=Na();return A(()=>{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||Lo(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}=jn(),{i18n:i,userEvents:s,checkout:r,source:{checkoutSessionIdentifier:l,sourceId:c},shop:{id:u,myshopifyDomain:d}}=g(),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=Co("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(Ue,{handle:"privacy-policy",tone:"monochrome"}),terms_of_service_link:n(Ue,{handle:"terms-of-service",tone:"monochrome"})})})}):null;return n(I,{gap:"small-200",children:[n(it,{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,Lt=/<\/?[a-z][\s\S]*>/i;function At(e){return n(gn,{dangerouslySetInnerHTML:{__html:e}})}function Mt(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(Lt.test(c))return At(e);c&&t.push(Mt(c,`text-before-${r}`)),t.push(n(Ue,{handle:l,tone:"monochrome"},`${l}-${r}`)),a=r+s[0].length,o=!0}const i=e.slice(a);return!o||Lt.test(i)?At(e):(i&&t.push(Mt(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 Et(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}=g(),{marketingPhoneInputError:i,previousPhoneMarketingDisclosureKeySignal:s,smsMarketingOptInShownSignal:r}=jn(),{phone:l,acceptSmsMarketing:c,smsMarketingPhone:u,shippingAddress:d}=$(),p=ot(),h=Na(),v=h.value,m=Et(v),y=!v&&t.smsMarketing!=="OFF",_=m?.label??(y?e.translate("marketing.accept_sms_checkbox_label"):void 0),k=!!_;Gn(()=>{k&&(r.value=!0)},[k,r]);const M=ue(),{handleSmsMarketingConsent:L}=is(),b=A(()=>M.buyerIdentity.value?.customerProfile),w=A(()=>!l.value&&!a.proposal.negotiated.fields.availableDeliveryAddresses.value?.length),C=A(()=>!l.value),f=A(()=>o?.isFlagshipPartner||b.value?!1:!C.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&&!Et(h.value)&&t.smsMarketing==="OFF"&&(u.value=P||"")}),ss(),Me(()=>{const P=Gs(h.value),S=s.peek();s.value=P,S!=null&&P!=null&&S!==P&&c.value&&(c.value=!1)});function R(P){i.value=void 0,L(P)}Me(()=>{l.value&&!b.value&&(u.value=l.value)});const O=e.translate("field_errors.sms_marketing_phone_invalid"),T=rs(O),N=se(()=>({state:{phone:u},errors:{phone:i}}),[i,u]);if(!_)return null;const H=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(Ue,{handle:"privacy-policy",tone:"monochrome"}),terms_of_service_link:n(Ue,{handle:"terms-of-service",tone:"monochrome"})})})});return n(Zn,{...N,children:n(ui,{id:"smsMarketingOptInDisclosure",open:c.value,summary:n(it,{id:"sms_marketing_opt_in",name:"sms_marketing_opt_in",label:_,checked:c.value,onChange:R,"aria-controls":"smsMarketingOptInDisclosure"}),content:n(I,{gap:"base",paddingBlockStart:"base",children:[n(cs,{countryCode:p.value??"",label:e.translate("marketing.sms.mobile_phone_number"),disabled:f.value,caretPosition:0,prefillCountryCode:!0,icon:"mobile",...c.value?T:{}}),H]})})})}Oa.displayName="PhoneMarketingOptIn";const xa=mn({displayName:"ShopPayVerificationSwitch",load:()=>Kn(()=>an(()=>import("./component-ShopPayVerificationSwitch.V4dm7i6D.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])))}),Ks="rdvNk",js={MobilePhoneIcon:Ks};function qs({onClick:e}){const{i18n:t}=g();return n(ye,{variant:"primary",accessibilityLabel:t.translate("account_management.verification_toggle"),onClick:e,segment:"end",children:n("div",{className:js.MobilePhoneIcon,children:n(oe,{type:"mobile",size:"large"})})})}function Ba(){const e=di({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}=g();return e.unstable_getSerialization("experiments")?.find(({clientHandle:t})=>t===ps)?.variant}function Xs(e,t,a="PHONE"){const{phone:o}=$(),{observability:i,checkout:{validation:{contactErrors:{phoneInputError:s,emailInputError:r}},wallets:l}}=g(),c=l.activeSession.value;jt(p=>{if(a!=="EMAIL"&&p.type==="error"){for(const h of p.violations)if(!(h.__typename!=="UnprocessableTermViolation"||!qt.has(h.code)||Ma(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=ce(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)},qn.InvalidContactMethod),cn(o,d,a==="PHONE"?e:void 0)}function Qs(){return document.cookie.includes("_tracking_consent=")}function Js(){const{email:e}=$();Me(()=>{at(e.value,"invalid")==="invalid"||Qs()})}function Ra(){const{paymentMethods:e,buyerIdentity:t}=ue(),{router:a,source:{type:o},mobileCheckoutSdk:i,embed:s,checkout:r,shop:l}=g(),c=a.currentUrl,u=r.proposal.proposed.paymentLines,d=l.hasFlagEnabled(Ao),p=Mo(),h=Eo(),v=o==="simulated",m=i.variant.isStandard()||!!s?.isCheckoutKit();return A(()=>{const y=e.value?.some(w=>w.type==="wallet"&&w.name==="SHOP_PAY"),_=t.value?.purchasingCompany,{currentDetour:k}=h.value,M=k!=null&&["stockProblems"].includes(k.type),L=To(c.value.searchParams),b=d&&!!wo(u.value);return!!(!v&&y&&!L&&!p.value&&!m&&!M&&!_&&!b)})}function Va({emailInput:e,email:t,isShopPayUnauthenticatedUser:a}){const{shopPay:o}=g(),i=te(""),s=a?un.C1ModalShopPay:void 0,[r,l]=le(s),[c,u]=le(!1),[d,p]=le(!1),h=t.trim(),v=q((m,y)=>{y&&(i.current=y),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}=g(),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(ca,{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(B,{type:"small",tone:"neutral",children:o})}):null,n(ua,{id:a,children:t.translate("contact.field_tooltip_helper_text")})]})}const or=2e3;function Tt(e){return(e??"").trim().toLowerCase()}function ir(e,t){const a=se(()=>Tt(e),[e]),o=se(()=>Tt(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}=g(),h=u.user.isUnauthenticatedUser.value,v=vn(),m=ot(),{email:y,phone:_,smsMarketingPhone:k}=$(),M=y.value,L=_.value,[b,w]=le(y.peek()??""),[C,f]=le(_.peek()!==""&&(y.peek()===""||!y.peek())&&!h?"PHONE":"EMAIL"),[R,O]=le(0),T=s.translate("contact.email_or_phone_label"),N=s.translate("field_errors.email_or_phone_invalid"),H=Xs(a,N,C),P=(m.value?c[m.value]?.contactInfoOptions:void 0)??l,S=v.value||h||!P.includes("PHONE"),x=Ba(),W=b===""&&!M,z=x===Ne.Treatment&&m.value==="IN"&&!S&&W?"tel":"email";function ie(he,ve){if(C==="EMAIL"&&(w(he),h&&J(un.C1ModalShopPay)),!S)if(ve!=null&&O(ve),he==="")f("EMAIL"),We(()=>{_.value="",y.value="",C==="PHONE"&&(k.value="")}
2),r?.leaveErrorBreadcrumb("[ContactInformation] Input type reset to EMAIL (both fields empty)");else{const Ie=/([A-Za-z]|\.|@)/.test(he);Ie&&C!=="EMAIL"?(r.leaveErrorBreadcrumb("[ContactInformation] Input type changed to EMAIL"),We(()=>{_.value="",y.value=he,k.value=""}),f("EMAIL")):!Ie&&C!=="PHONE"&&(r.leaveErrorBreadcrumb("[ContactInformation] Input type changed to PHONE"),y.value="",_.value=he,f("PHONE"))}}K(()=>{r.leaveErrorBreadcrumb("[ContactInformation] Component mounted")},[r]),K(()=>{e&&e(C)},[e,C]),K(function(){if(S)return;const ve=M!=null&&M!=="",Ie=L!=null&&L!=="";if(!ve&&!Ie&&C!=="EMAIL"){r.leaveErrorBreadcrumb("[ContactInformation] Input type reset to EMAIL from empty proposed contact info"),f("EMAIL");return}if(ve&&C!=="EMAIL"){r.leaveErrorBreadcrumb("[ContactInformation] Input type synced to EMAIL from proposed contact info"),f("EMAIL");return}!ve&&Ie&&C!=="PHONE"&&(r.leaveErrorBreadcrumb("[ContactInformation] Input type synced to PHONE from proposed contact info"),f("PHONE"))},[M,C,r,S,L]);const re=te(!0);K(function(){const ve=re.current;re.current=!1,(!P.includes("PHONE")||h)&&C!=="EMAIL"&&(f("EMAIL"),M===""&&L!==""&&(_.value="",ve||(y.value=L)))},[P]),Xt(async({reason:he,parts:ve})=>he!=="progression"?{behavior:"allow"}:{behavior:"allow",perform(){const Ie=ve.phone.peek();Ie!==""&&ve.deliveryLines.peek().forEach(gt=>{const _t=gt.peek();gt.value={..._t,deliveryMethodOptions:{..._t.deliveryMethodOptions,phone:Ie}}})}});const Q=Ra(),{modalUrlOrigin:D,modalUpdatedOrigin:V,shopPayVerificationVisible:U,showShopPayVerificationToggle:ee,showShopPayVerification:F,setModalUpdatedOrigin:J,setShowShopPayVerificationToggle:j}=Va({emailInput:b,email:y.value,isShopPayUnauthenticatedUser:h}),Ce=te(null),ae=pr(S?void 0:N,C==="PHONE"?cr:t,C),fe=Yn().current.value.contactInfo?.email,ne=ir(M??"",fe),Se=p.isAbandonedCheckoutSupported&&C==="EMAIL"&&!(Q.value&&ee)?n(ar,{saved:ne}):void 0,En=us({countryCode:m.value??"",label:T,onInputValueChange:ie,caretPosition:R,inputMode:"text",disableFormatting:!0,required:!0,...H}),Ye=S?void 0:{label:T,type:"text",caretPosition:R,inputMode:"text"},Tn=ur({email:ae,ref:Ce,addressType:d.isShippingRequired.value?"shipping":"billing",disabled:i.value.status==="loading",required:!0,accessory:Se,contactAutocompleteType:z,...Ye,onInputValueChange:ie}),E=C==="PHONE"?En:Tn,Re=C==="PHONE"?L==null||L==="":W,{isEnabled:on,impressionFeatures:sn,fieldProps:Xe}=sr({fieldProps:E,countryCode:m.value,combinedFieldRendered:!S,fieldIsEmpty:Re}),vt=Q.value&&ee?n(qs,{onClick:()=>{F(!0),h&&J(un.C1ModalShopPay)}}):null,vo=Q.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:U,showPopover:F,showToggle:j,urlOrigin:D,updatedOrigin:V})}):null,yt=C==="PHONE"?"phone":"email",yo=n(I,{gap:"small-400",children:[n(ge,{id:Ha,gridTemplateColumns:"minmax(0, 1fr) auto",gap:"none",children:[n(da,{...Xe,id:yt,error:!!Xe.error,segment:vt?"start":void 0}),vt]}),typeof Xe.error=="string"&&Xe.error?n(dn,{controlID:yt,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}=g();K(()=>{if(l!==void 0&&e.current&&t?.value&&l<t.value.length)try{e.current.setSelectionRange(l,l)}catch{}},[t.value,l,e]),Js();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:pi([a,o]),disabled:i,inputMode:c,...t,onInput:async y=>{const _=y.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=g(),{inMemoryApplePayParts:{asPaymentMethod:u,isLoadingPaymentSheet:d},inMemoryPayPalParts:{isLoadingPaymentSheet:p}}=Te();jt(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 y of m.violations){if(y.__typename!=="UnprocessableTermViolation"||!qt.has(y.code)||Ma(y.target))continue;const _=e||(y.localizedMessage??y.nonLocalizedMessage);s.value=_,r.value=void 0}});const h=ce(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 y=Hn(m,i.translate("field_errors.email_blank")),_=at(m,i.translate("field_errors.email_invalid"));return y||_},qn.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}=g(),r=ue().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:y}=$(),_=u??d,k=!p&&_?` (${_})`:"",{modalUrlOrigin:M,modalUpdatedOrigin:L,shopPayVerificationVisible:b,showShopPayVerification:w}=Va({isShopPayUnauthenticatedUser:o.user.isUnauthenticatedUser.value,email:u||""});return K(()=>{i.leaveErrorBreadcrumb(`[CustomerCard] Rendered - hasEmail: ${!!u}, hasPhone: ${!!d}`),r?.purchasingCompany||(y.value="")},[]),n(X,{children:[n(I,{direction:"inline",alignItems:"center",gap:"base",children:n(I,{gap:"small-400",children:[n(B,{children:m?`${a.translate("general.display_name",{firstName:l??"",lastName:c??""})}${k}`:k}),p?n(I,{direction:"inline",gap:"small-400",children:[n(B,{color:"subdued",type:"small",children:p}),u&&n(X,{children:[n(B,{color:"subdued",type:"small",children:hr}),n(B,{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:M,updatedOrigin:L})]})}Ua.displayName="CustomerCard";function mr(){const{i18n:e}=g();return n(B,{color:"subdued",size:"small",accessibilityLive:"polite",children:e.translate("marketing.sms.disclaimer.description_transactional_html",{privacy_policy_modal_link:n(Ue,{handle:"privacy-policy",tone:"monochrome"}),terms_of_service_modal_link:n(Ue,{handle:"terms-of-service",tone:"monochrome"})})})}const vr="ZZ";function Fu({hideAllOptIns:e=!1,hideContactInfoEntry:t=!1,showEmailMarketingOptIn:a=!0,onValidateEmailInput:o}){const i=ue(),s=i.buyerIdentity.value?.customerProfile,r=hi().value,c=Jn()?.smsMarketingEnabled===!1,{client:u,checkout:d,i18n:p,checkout:{validation:{contactErrors:{emailInputError:h,phoneInputError:v}},wallets:m},shop:y}=g(),{emailMarketing:_,contactInfoOptions:k}=y,M=u.unstable_getSerialization("logoutUrl")||"",{isContact:L}=Vs().value,{showEmailMarketing:b}=d.configuration.visibility,w=y.hasFlagEnabled(No),{value:C}=i.buyerIdentity,f=C?.countryCode,[R,O]=le(a&&wt({emailMarketing:_,inputType:"EMAIL",hideNonEuropeMarketingOptInFlagEnabled:w,buyerCountryCode:f,customerProfile:s,showEmailMarketing:b})),[T,N]=le(!1),H=ot(),{validatePhoneNumber:P}=es(),{negotiate:S}=ke(),x=q(ae=>{O(a&&wt({emailMarketing:_,inputType:ae,hideNonEuropeMarketingOptInFlagEnabled:w,buyerCountryCode:f,showEmailMarketing:b})),N(!1)},[_,w,f,a,b]),W=Rs(),z=q(ae=>{const _e=Hn(ae,W.value),fe=at(ae,p.translate("field_errors.email_invalid"));return _e||fe||o?.(ae)},[W,o,p]),ie=q(ae=>{const _e=Hn(ae,p.translate("field_errors.email_or_phone_blank"));if(_e)return N(!_e),_e;const fe=P(ae,H.value??vr)?void 0:p.translate("field_errors.address_phone_blank");return N(!fe),fe},[p,P,H]),re=bn(),Q=mi(),D=q(({contact:ae})=>{m.activeSession.value||S({silenceViolations:["all"],include:[],fieldsToResolve:[...vi]}),ae.value=!0,re("sectionComplete",{section:"contact",timestamp:new Date}),Q({type:"section_complete",section:"contact"})},[m,S,re,Q]),V=q(({contact:ae})=>{ae.value=!1},[]),{email:U,phone:ee}=$(),F=se(()=>({state:{phone:ee,email:U},errors:{phone:v,email:h}}),[U,h,ee,v]),j=vn().value||!k.includes("PHONE"),Ce=!s?.email&&!s?.phone||j&&!s?.email;return n(Kt,{children:n(Pn,{target:"cart.buyerIdentity",children:[s&&n(Ua,{showLogoutLink:r,logoutUrl:M}),!t&&Ce&&n(Zn,{...F,children:n(ns,{onValid:D,onInvalid:V,children:n(lr,{onInputTypeChange:x,onInlineEmailValidation:z,onInlinePhoneValidation:ie})})}),!e&&n(X,{children:[T&&!c?n(mr,{}):null,R?n(Da,{}):null,L&&n(Oa,{})]})]})})}
2function wt(e){const{emailMarketing:t,inputType:a,hideNonEuropeMarketingOptInFlagEnabled:o,buyerCountryCode:i,customerProfile:s,showEmailMarketing:r}=e,l=o&&!Do(i);return r&&t!=="OFF"&&a==="EMAIL"&&!l&&!s?.acceptsEmailMarketing}function za(){const e=yi(),{editorSetShopPaySignal:t}=jn(),a=q(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}=g(),t=ts();return A(()=>t.value&&e.configuration.visibility.showExpressCheckout.value)}function _r(){const e=gi(),t=gr();return A(()=>e.value?"wallets":t.value?"skeleton":"hidden")}const fr="vT2w7",br="f1x20",Pr="hKWGx",Nt={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.J4DlVkoC.js");return{ApplePayButton:e}},__vite__mapDeps([36,1,2,3,4,5,6,7,8,9,37,38,39,40,11,12,14,15,41,42,43,44,29,30,31,22,45,13,16,17,18,19,20,21,23,24,25,26,27,28,46,47,48,49,50,51,52,53,54,55,56,57])).then(({ApplePayButton:e})=>e))});function Cr(e){const{source:t}=g(),{buttonStatus:a,sessionLoadFailed:o}=Te().inMemoryApplePayParts;return fs("ApplePay",t.type!=="simulated"&&a.value.status==="not_rendered"&&!o.value),n(kr,{...e})}function Sr({color:e}){const{i18n:t}=g();return n("button",{className:Pe(Nt.ApplePayButton,Nt[e],Qt.borderRadius,yn({focusRing:"base"})),lang:t.locale,disabled:!0,type:"button","aria-label":t.translate("brand.apple_pay")})}function Ir(e){const{observability:t}=g(),{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.B2JRtcsq.js"),__vite__mapDeps([58,1,6,2,3,4,5,7,8,9,59,60,61,62,63])).then(e=>e.PortableWalletsPCIButtonContent),useError:as});function Ar(e){return n(Lr,{...e})}const Mr="Xicuw",Dt={Button:Mr,"Button--contrast":"oHCaH"},Er="shop-pay-button";function Tr(){const{shopPay:e,observability:t,checkout:{wallets:a}}=g(),o=e.app.config,i=Is(be.ShopifyPay),s=Xi({foregroundColor:Cs}),r=Ss(),l=Oo(o,r),c=ls(xo.DirectCheckoutCheckout),u=_i(),d=fi(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=q(()=>{i(Un.Success),d(),a.setActiveSession({newValue:"SHOP_PAY",asPaymentMethod:!1}),a.clearActiveSession({invokingWallet:"SHOP_PAY"})},[a,d,i]),v=q(y=>{if(p){y.preventDefault(),p(!0);return}h()},[h,p]),m=Pe(Dt.Button,{[Dt["Button--contrast"]]:!s&&!l},Qt.borderRadius,yn({focusRing:"base"}));return n("a",{id:Er,href:c,ref:u("shop_pay"),className:m,onClick:v,children:e.logoBrand==="shop"?n(Qi,{size:"medium"}):n(hs,{size:"medium"})})}function wr(){const e=Te();return A(()=>Bo.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}=g(),t=wr(),a=e.type==="simulated";return A(()=>!a&&t.value)}function Or(){const{i18n:e}=g();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(B,{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",jr="OTERX",qr="WTXfy",Yr="qLVAT",Xr="XHLFs",Qr="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:jr,DrawerLink:qr,InnerDrawerLink:Yr,DrawerHideButtons:Xr,walletItem:Qr},rt="express-checkout-heading";function Wa({buttonCount:e,footer:t,children:a}){const{i18n:o}=g();return n(G,{className:Z.Container,"data-count":e,children:[n("div",{className:Z.Header,children:n(As,{id:rt,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}=g(),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(bi,{delay:s},r))})}const Jr="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}=g(),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}=g(),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}=g(),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();Ps(p),ol(p);const h=ue().managedByMarketsPro,v=Pi(d,"base"),[m,y]=le(!1),_=vn(),{checkout:k,i18n:M,shop:{id:L},source:b,observability:w,userEvents:C}=g(),f=ki(),R=A(()=>c.value&&Fo({hasSubscription:Jt({checkout:k}),isApplePayAvailable:a.value.some(({name:S})=>S==="APPLE_PAY"),variant:f})==="full_express_agreement"),O=ys();gs(a.value,e);const T=q((S,x)=>{const W=parseInt($e(L),10),z=_s({state:x,shopId:W,nascarData:{...S,walletsRenderedCount:e},paymentMethods:a.value});z&&C.monorailEvent(z)},[L,C,e,a]),H=a.value.some(S=>S.name==="SHOP_PAY")&&l;!d&&!m&&(y(!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(Ro))},[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(O.value,Un.NascarDrawerOpen)):(r(!0),T(O.value,Un.NascarDrawerClose))},children:n("div",{className:Z.InnerDrawerLink,children:[n(B,{children:s?M.translate("alternative_payment_method_banner.show_more_options"):M.translate("alternative_payment_method_banner.hide_more_options")}),n(oe,{type:s?"chevron-down":"chevron-up",size:"small-200"})]})})}),n(Y,{when:_,children:n(ks,{isForExpressCheckout:!0,showFullSubscriptionConsent:R})}),n(Y,{when:h,children:n(I,{gap:"base",padding:"large-100 none none none",children:n(Ls,{textProps:{color:"subdued",size:"small"}})})})]}
2),children:[n($a,{count:Math.min(e,4),transition:v,shopPayEmphasis:H,hideWallets:s}),n("ul",{id:Jr,role:"list",className:Pe(Z.Stack,Z.ButtonWrapper,{[Z.loading]:d,[Z.subsequentLoad]:d&&m,[Z.DrawerHideButtons]:s,[Z.ShopPayEmphasis]:H}),children:c.value&&t})]}),u?.value?.type==="payment_cancelled_while_processing"&&n(Or,{})]})}function Ga(){const{i18n:e}=g(),{divider:{borderStyle:t,borderWidth:a}}=Ci(),{main:{divider:{borderStyle:o=t,borderWidth:i=a}={},section:s,spacing:r}}=pa(),l=Vo(s);return n(G,{padding:l?`@media (inline-size >= extraSmall) ${r?bt(r):"large-200"} none, ${r?bt(r):"base"} none`:"large-100 none large-300 none",children:n(He,{borderStyle:o,borderWidth:Ho(i),children:n(Ee,{textAlign:"center",children:n(B,{color:"subdued",children:e.translate("alternative_payment_method_banner.or")})})})})}const Ot=3;function sl(){return n(X,{children:[n(ze,{accessibilityLabelledBy:rt,children:n(Wa,{buttonCount:Ot,children:n($a,{count:Ot,shopPayEmphasis:!0})})}),n(Ga,{})]})}const rl="_2SmAP",ll="eFu6h",Ka={MessageWrapper:rl,SimulatedWalletWrapper:ll},cl=e=>e,Ru=go(function(){const{i18n:t,source:a}=g(),o=a.type==="simulated",{acceleratedWalletPaymentMethods:i,buttonCount:s}=Te(),r=Si(),l=_r(),{setEditorShopPay:c}=za(),{expressCheckout:{button:{cornerRadius:u}={}}}=pa(),d=xe("Checkout::Dynamic::Render","WALLETS1"),p=Ii(),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(B,{color:"subdued",children:t.translate("payment.simulated_express_checkout")})})});return n("div",{style:{...dl(u)},children:[n(ze,{accessibilityLabelledBy:rt,children:n(nt,{sectionId:"expressCheckout",children:n(Li,{section:"expressCheckout",children:[n(Be,{customizations:d,gap:"large-200",render:cl}),d.length>0&&n(ha,{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=ma(),s=ms();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(xt,{method:r,triggerProgression:t})})}):n(xt,{method:r,triggerProgression:t})},`${r.name}-${i}-${s.value}`)})})}function dl(e){return e&&{"--x-express-checkout-button-border-radius":yr(Uo.borderRadius)(e)}}function xt({method:e,triggerProgression:t}){const a=ma();switch(e.name){case"APPLE_PAY":return n(Cr,{supportedNetworks:e.supportedNetworks,color:a});case"PAYPAL_EXPRESS":return n(It,{progressToNextPage:t});case"VENMO":return n(It,{fundingSource:"venmo",buttonColor:"blue",progressToNextPage:t});case"SHOP_PAY":return n(Tr,{});case"GOOGLE_PAY":return n(vs,{});case Ae.AmazonPay:return n(os,{});case Ae.BuyWithPrime:return n(Ar,{wallet:Ae.BuyWithPrime});default:return null}}const pl=["ApplePay","GooglePay","PayPal","Venmo"];function Vu({id:e}){return bs({id:e,stage:({pendingComponents:t})=>pl.some(o=>t.has(o))?St.Usable:St.Complete}),null}function Hu(){const e=ue(),t=e.buyerIdentity.value?.customerProfile,{i18n:a}=g(),o=Ai().value,{value:i}=e.buyerIdentity,s=$().rememberMe,r=!!i?.rememberMe||s.value,l=ce(r),{negotiate:c}=ke(),d=Jn()?.saveShippingAddressCheckboxEnabled??!0,p=!!t,h=$().shippingAddress.value,v=!o&&d&&!p&&!h.oneTimeUse,m=q(y=>{l.value=y,s.value=y,c({})},[c,s,l]);return v?n(it,{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}=g(),s=i.type==="simulated",r=ue(),l=r.deliveryNext,c=r.paymentLines,u=Ke("deliveryNext"),d=A(()=>{const p=Zt(l.value,"ONE_TIME_PURCHASE"),h=ea(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(je,{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(st,{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 ja=_o(null);function vl(){return fo(ja)}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=q(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(ja.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=Mi();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"}
2),n(B,{type:"strong",children:t})]}),o&&n(B,{color:"subdued",children:o})]})}const _l="qX6SV",fl={Wrapper:_l},Dn="PICK_UP_AND_SHIP";function bl(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 Pl(e){return e.id==="PICK_UP"||e.id==="SHIPPING"}function kl({options:e,selectedIndex:t,select:a}){const{i18n:o,observability:i}=g(),s=q(c=>{c!==Dn&&a([c])},[a]),r=e.filter(Pl),l=te(!1);if(!l.current&&r.length<e.length){l.current=!0;const 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(fl.Wrapper,yn({colorLayer:"control"})),style:{"--option-count":e.length,"--selected-index":t},children:n(va,{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:bl(c,o)},c))]})})}function Cl(e){const{source:t,userEvents:a,shop:{id:o},checkout:{identity:i}}=g(),s=i.current.value==="shopPay",r=ue().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 Sl="SnB3D",Il="_207IL",Ll="wvTT8",On={Entrance:Sl,SplitCollapse:Il,PillViewTransition:Ll},Al=16;function Ml({options:e,selected:t,select:a}){const{i18n:o,source:i}=g(),s=i.type==="simulated",r=ue(),{value:l}=r.deliveryNext,c=tn(),u=Ke("deliveryNext").value,d=Zt(l,"ONE_TIME_PURCHASE"),{deliveryMethodSelectorClickEvent:p}=Cl(d),h=r.paymentLines?.value?.lines,v=ea(h,"APPLE_PAY")!==void 0,m=d?.status==="available"&&!u&&d?.hasDeliveryLineChange,y=!v&&m,_=A(()=>!c.value),k=ce(!1);Gn(()=>{let f=c.peek();return Po(()=>{const R=c.value;f&&!R&&(k.value=!0),f=R})},[c,k]);const M=q(()=>{k.value=!1},[k]),L=q(([f])=>{if(!f||t.value.includes(f))return;const R=e.value.findIndex(N=>N.id===t.value[0]),T=e.value.findIndex(N=>N.id===f)>R?"delivery-slide-end":"delivery-slide-start";zo(()=>{a([f])},[T]),p(f)},[a,t,p,e]),b=A(()=>e.value.findIndex(f=>f.id===t.value[0])),w=A(()=>e.value.length),C=A(()=>e.value.some(f=>f.label.length>Al));return n("div",{className:On.Entrance,children:[y?n(je,{tone:"warning",errorType:nn.DeliveryError,children:o.translate("shipping_errors.shipping_method")}):null,s&&n(Bn,{each:e,getKey:f=>f.id,children:f=>n(nt,{sectionId:`deliveryMethods-${f.id}`})}),n(Y,{when:_,fallback:n(kl,{options:e.value,selectedIndex:b.value,select:a}),children:n("div",{style:{"--selected-index":b.value,"--option-count":w.value},className:Pe(On.PillViewTransition,{[On.SplitCollapse]:k.value}),onAnimationEnd:M,children:n(yl,{name:"delivery_method",label:o.translate("general.choose_delivery_strategy"),labelAccessibilityVisibility:"exclusive",selected:t.value[0],onChange:f=>L([f]),contentDirection:C.value?"block":"auto",children:n(Bn,{each:e,getKey:f=>f.id,children:({id:f,label:R,icon:O})=>n(gl,{value:f,icon:O,children:R})})})})})]})}function Uu(){const e=Ei();if(!e)return null;const{variant:t,...a}=e;return t==="next"?n(Ml,{...a}
2):n(ml,{options:a.options.value,selected:a.selected.value,select:a.select})}function El(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 Tl(e,t){return e.length===0?!1:t==="PICK_UP"?e.every(a=>a==="SHIPPING"||a==="LOCAL"):e.every(a=>a==="PICK_UP")}function wl({violationLines:e,deliveryMethodType:t,proposedDeliveryLines:a,proposedMerchandiseLines:o}){const i=new Set(a.filter(r=>Tl(r.value.deliveryMethodTypes,t)).flatMap(r=>r.value.targetMerchandiseLines??[]).map(r=>r.stableId)),s=o.length>0;return e.filter(r=>{const l=Wo(o,r.stableId),c=l?.stableId??r.stableId;return!(i.has(r.stableId)||i.has(c)||s&&l==null)})}const Nl=["DELIVERY_NO_DELIVERY_STRATEGY_AVAILABLE_FOR_MERCHANDISE_LINE","MERCHANDISE_OUT_OF_STOCK_IN_CONTEXT"];function qa(e){const{shop:{shipPickupInOneOrderEnabled:t}}=g(),{allViolations:a,merchandiseLines:o,deliveryNext:i}=ue(),s=Fe(),r=tn(),{deliveryLines:l,merchandiseLines:c}=$();return A(()=>{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"?Dl({canUseDeliveryMethodScopedViolations:p,state:d}):p?Ol({deliveryMethodType:e.deliveryMethodType,state:d}):zn()})}function zn(){return{merchandiseLines:[],allowAlternativeAction:!1}}function Dl({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}}return t.isSplitShipAndPickup||!xl(t.negotiatedMerchandiseLines)?zn():{merchandiseLines:Wn({deliveryMethodType:"PICK_UP",suppressUnscopedPickupViolations:!1,state:t}),allowAlternativeAction:!1}}function Ol({deliveryMethodType:e,state:t}){return{merchandiseLines:Wn({deliveryMethodType:e,suppressUnscopedPickupViolations:e==="PICK_UP"&&t.isSplitShipAndPickup,state:t}),allowAlternativeAction:!0}}function xl(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?na(a,i,Nl)??[]:[],c=El(l,o,[e]),u=t?c.filter(d=>(o[d.stableId]??[]).length>0):c;return wl({violationLines:u,deliveryMethodType:e,proposedDeliveryLines:s,proposedMerchandiseLines:r})}const lt={MILES:100,KILOMETERS:200},Bl=100;function ct(e,t){const a=t&&(t.unit==="MILES"?"mi":"km"),o=t&&t.value<Bl?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 Fl=e=>e.every(t=>{const a=pn(t);return a?.value&&a.value>lt[a.unit]}),Rl=e=>e.every(t=>pn(t)?.unit==="MILES");function Vl({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}=ta(a);return{isOnlyCountryAvailable:s,fullCountryName:r?.name||void 0,formattedAddress:Ti(t,{hiddenFields:Vl(t),multiline:!1,countryFormat:"explicit"})}}const Hl=13;function Xa({onClick:e,commandFor:t}){const{i18n:a}=g(),{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(B,{children:Ya(o,Hl)})]}):n(B,{children:i})})}const Ul="qIyj1",zl="oCDzB",Bt={Distance:Ul,FromLocation:zl};function ut({itemCount:e,methods:t,onChangeLocationClick:a}){const{i18n:o}=g(),{isOnlyCountryAvailable:i,formattedAddress:s}=we(),r=qe({methods:t});if(K(()=>{i||r("pickup_long_distance_banner_rendered")},[r,i]),i)return null;const l=Rl(t)?"MILES":"KILOMETERS",c=ct(o,{value:lt[l],unit:l}),u=n("span",{className:Bt.FromLocation,children:s});function d(){r("pickup_long_distance_banner_change_location_click"),a?.()}return n(Cn,{children:n(B,{children:s?o.translate("local_pickup.all_stores_far_away.title_with_item",{distance:n("span",{className:Bt.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 dt(){const{i18n:e}=g();return n(je,{autoFocus:!0,tone:"warning",errorType:nn.DeliveryError,heading:e.translate("local_pickup.selected_pickup_option_no_longer_available.title"),children:n(B,{children:e.translate("local_pickup.selected_pickup_option_no_longer_available.description")})})}function pt({allLocationsFarAway:e,selectedPickupOptionNoLongerAvailable:t}){const a=Ke("deliveryNext");return A(()=>e.value&&!t.value&&!a.value)}function Qa(){const{negotiate:e}=ke(),{deliveryLines:t,merchandiseLines:a,discountLines:o}=$();return i=>{aa({deliveryLines:t,merchandiseLines:a,merchandiseStableIds:i,discountLines:o}),e({include:["deliveryNext","merchandiseLines"]})}}function Wl({allLinesAlternativeEligible:e,isPickupBanner:t,variantIds:a}){const{userEvents:o,shop:i,source:s,checkout:{identity:r}}=g(),{merchandiseLines:l}=ue();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 q(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:$l(r),sourceName:"checkout_one",checkoutProductVariantsCount:l.value?.lines.length}};o.monorailEvent(v)},[c,u,r,l,o,p,i,s])}function $l(e){return e.current.value==="shopPay"?"shop_pay":"guest_checkout"}function Ft(e){requestAnimationFrame(()=>{De({content:e,role:"status"})})}function $n({merchandiseLines:e,bannerType:t,allowAlternativeAction:a}){const{i18n:o}=g(),i=ya(),s=Qa(),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:y}=r.value,_=u.filter(({stableId:P})=>y[P]?.includes(m)),k=_.map(({stableId:P})=>P),M=_.reduce((P,{quantity:S})=>P+Math.max(1,S),0),L=(a?.value??!0)&&!l.value&&k.length===d.length&&M>0,b=Wl({allLinesAlternativeEligible:L,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}),C=L?o.translate("split_delivery.inventory_issue_banner.remove_item",{count:v}):o.translate("split_delivery.inventory_issue_banner.remove_item_only",{count:v}),f=c?o.translate("split_delivery.inventory_issue_banner.ship_separately",{count:M}):o.translate("split_delivery.inventory_issue_banner.pick_them_up_in_store",{count:M}),R=h.map(({title:P,subtitle:S,quantity:x})=>{const W=S?`${P} / ${S}`:P;return x>1?o.translate("split_delivery.inventory_issue_banner.merchandise_line_with_quantity",{title:W,quantity:x}):W}).join(", "),O=()=>{b("remove_items"),s(d),Ft(o.translate("split_delivery.accessibility.status.remove_items",{items:R}))},T=()=>{b("switch_delivery_method"),i({targetDeliveryMethodType:m,merchandiseStableIds:k}),Ft(c?o.translate("split_delivery.accessibility.status.ship_separately",{items:R}):o.translate("split_delivery.accessibility.status.pickup_in_store",{items:R}))},N=n(me,{onClick:O,children:C});let H=N;
2if(L){const P=n(me,{onClick:T,children:f});H=c?n(X,{children:o.translate("split_delivery.inventory_issue_banner.remove_items_or_ship",{ship_separately_link:P,remove_items_link:N})}):n(X,{children:o.translate("split_delivery.inventory_issue_banner.remove_items_or_pickup",{pickup_in_store_link:P,remove_items_link:N})})}return n(je,{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:x,quantity:W})=>{const z=x?`${S} / ${x}`:S;return n(_a,{children:W>1?o.translate("split_delivery.inventory_issue_banner.merchandise_line_with_quantity",{title:z,quantity:W}):z},P)})}),n(B,{children:H})]})})}function Ln({hideText:e,singleItem:t}){const{i18n:a}=g(),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(Ms,{border:"none",background:"transparent",children:n(Es,{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 Gl={timeout:8e3,enableHighAccuracy:!0};class Kl extends Error{constructor(){super(...arguments),this.name="PermissionsUnsupportedError"}}function jl(){const{observability:e}=g();return q(t=>Yl(t,ql,e),[e])}const ql=e=>new Promise(t=>{"geolocation"in navigator&&navigator.geolocation?navigator.geolocation.getCurrentPosition(a=>t({reason:"granted",position:a}),a=>t({reason:Xl(a),error:a}),e):t({reason:"unsupported"})}),Yl=async(e=Gl,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 Kl('"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 Xl(e){switch(e.code){case 1:return"denied";case 2:return"unavailable";case 3:return"timeout";default:return"unsupported"}}function Rt({disabled:e,displayAsLink:t,onSuccess:a,onError:o,onLocateStart:i,options:s,sharingNotAllowedError:r}){const{i18n:l}=g(),c=jl(),u=ce(!1),d=ce(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 y(){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(B,{color:"subdued",children:p})]}):n(ye,{disabled:e,inlineSize:t?void 0:"fill",onClick:y,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}=g(),o=Sn(),i=Fe(),s=A(()=>$o(i.value.enabledDeliveryMethods)),r=A(()=>s.value.length>0),l=de(t),c=A(()=>r.value||!!l.value),u=en(),d=qe({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")}
2):a.translate("local_pickup.pickup_unavailable_banner_body.search_elsewhere"),y=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(je,{tone:"critical",errorType:nn.DeliveryError,heading:e,children:n(Y,{when:c,children:n(Ee,{children:n(Y,{when:r,fallback:y,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}=g();return!e.hasFlagEnabled(Go)}function Ql(){const{shippingAddress:e}=$(),{shop:t}=g(),a=tn();return{syncShippingFromPickup:q(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 Jl=fn("AutocompleteSingleAddressField");function Vt({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,Jl),onSelect:u,value:l,countryCode:o.code,...r})}const Zl="_9uTul",ec="_3zLFw",nc="_9rPCU",tc="FayGq",rn={SelectWrapper:Zl,focus:ec,FlagIcon:nc,Select:tc};function ac({pickupCountries:e,selectedCountry:t,onCountryChange:a}){const{i18n:o}=g(),[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(ds,{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 oc=fn("AutocompleteSingleAddressField");function ic({onSearch:e,onBeforeCountryChange:t,onAfterCountryChange:a,sharedLocationAddress:o,searchOnSelect:i,pickupCountries:s,addressAutoFocus:r,onAddressBlur:l}){const c=ce(""),{i18n:u,observability:d}=g(),{geolocation:p}=fa(),{locationAddress:h}=$(),v=h.peek(),m=te(v),y=Ko(),_=Mn(),k=se(()=>jo(lc(v,p.country.code,s,y),{extendedAddressMode:null}),[]),M=se(()=>qo({countryCode:void 0,address:void 0}),[]),L=cn(k.fields.countryCode,M.countryCode),b=cn(k.fields.postalCode,M.address),{details:w,loading:C}=ta(L.value),f=se(()=>w??p.country,[w,p.country]),R=M.address.value,O=se(()=>s?.length?s:[{value:f.code,label:f.name}],[s,f.code,f.name]),T=q(E=>Rn(E,f,["company","firstName","lastName","phone","countryCode","zoneCode"]),[f]),N=f.zones,H=k.value,P=c.value,S=L.value?Os(L.value):!1;rc(k,M);const x=ba(k),W=bn(),z=()=>{(L.error||b.error)&&(L.clearError(),b.clearError())};Me(()=>{const E=o?.value;E?.countryCode&&Fn(()=>{We(()=>{x({countryCode:E.countryCode}),c.value="",z()})})}),Me(()=>{const E=h.value;E!==m.current&&(m.current=E,E?.coordinates&&Fn(()=>{We(()=>{x(Yo(E)),c.value=T(E),z()})}))}),K(()=>{const E=k.value;S?c.value=T(E):c.value=T({postalCode:E.postalCode})},[k,S,T,c]);const ie=(E=H)=>{E.coordinates?(N.length||(E.zoneCode=void 0),e(E)):M.address.value=u.translate("local_pickup.could_not_resolve_address")},re=E=>{const Re=()=>{a?.(E),x({countryCode:E}),L.onChange(E),z(),y("user-input",E,"pickup")};t?t({countryCode:E},Re):Re()},Q=E=>{H.coordinates&&x({countryCode:L.value}),c.value=E,z()},D=E=>{!E.coordinates&&E.address1&&d.leaveErrorBreadcrumb("Autocomplete address missing coordinates",{countryCode:E.countryCode||L.value,hasAddress1:!!E.address1,hasPostalCode:!!E.postalCode});const Re=Jo(E.countryCode),on=!!(E.countryCode&&!Re);
2on&&d.leaveErrorBreadcrumb("Discarded invalid autocomplete countryCode",{invalidCountryCode:E.countryCode,fallbackCountryCode:L.value});const sn=on?{...E,countryCode:L.value}:{...E,countryCode:Re};x(sn),i&&ie(sn),_&&W("click",{element:{tagName:"button",textContent:"local_pickup_autosuggestion_search"},section:"delivery",timestamp:new Date})},V=i&&!_?{source:"magnify",position:"end"}:void 0,U=S&&i,ee=!H.coordinates||!P.length,F=U?null:n(ye,{variant:"primary",disabled:ee,onClick:ie,loading:C,children:u.translate("local_pickup.search_button")}),J={errors:M,state:{countryCode:k.fields.countryCode,address:S?c:k.fields.postalCode}},j=Xo(R)?R.message:R,Ce=S?"location address":"postalCode",ae=_n(void 0,oc),_e=_?u.translate("local_pickup.location_address_search_placeholder",{postal_code_label:f.labels.postalCode}):u.translate("local_pickup.location_address_search_label"),fe=_||!!F;let ne;fe?ne=j?!0:void 0:ne=j;const Se={addressType:"pickup",country:f,address:H,error:ne,field:"address1",value:P,icon:V,autoFocus:r,onBlur:l,autocomplete:S?"shipping street-address":"shipping postal-code",label:S?_e:f.labels.postalCode,name:Ce,id:ae},En=S?n(Vt,{...Se,onSelect:D,onInput:Q}):n(Vt,{...Se,onSelect:E=>{x(E),c.value=T(E)},required:!0,readOnly:C,onInput:E=>{E?z():c.value=""},onChange:E=>{c.value=E},allowAllCountries:!0}),Ye=n(G,{children:[n(sc,{autocomplete:Se.autocomplete,label:Se.label,name:Se.name}),En]}),Tn=wi()?.checkoutProfile.hasOverrides.value;return n(Pn,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(Zn,{...J,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(ac,{pickupCountries:O,selectedCountry:f,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"})})]}),j?n(dn,{controlID:ae,children:Pt(j)?j.textValue:j}):null]}):n(Kt,{children:[n(So,{children:n(xs,{interactive:!Tn,children:n(va,{name:"countryCode",label:f.labels.country,required:!0,autocomplete:"shipping country-name",readOnly:C,value:f.code,onChange:E=>re(E),children:O.map(E=>n(Vn,{value:E.value,children:E.label},E.value))})})}),F?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,F]}),j?n(dn,{controlID:ae,children:Pt(j)?j.textValue:j}):null]}):Ye]})})})}function sc({autocomplete:e,label:t,name:a}){const o=Ni(),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 rc(e,t){const{i18n:a,observability:o,checkout:{wallets:i}}=g(),{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")),Qo(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:qn.InvalidLocalPickupAddress,perform:()=>{We(()=>{for(const[p,h]of d)t[p].value=h})}}):{behavior:"allow"}})}function lc(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 Ja({locationFormVisible:e,toggleLocationFormVisibility:t,children:a,onLocationChange:o,pickupCountries:i}
2){const s=g().checkout.identity.current.value==="shopPay",r=()=>t(!1);return s?n(X,{children:[a,n(cc,{open:e,onModalClose:r,onLocationChange:o,pickupCountries:i})]}):e?n(ht,{onLocationChange:o,pickupCountries:i}):a}function cc({open:e,onModalClose:t,onLocationChange:a,pickupCountries:o}){const{i18n:i}=g();return n(kn,{heading:i.translate("local_pickup.toggle_location"),open:e,onHide:t,children:n(Pa,{section:"delivery",children:[n(ht,{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 ht=({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}=g(),p=ce(!0),h=ce(),v=ce(void 0),m=Mn(),{syncShippingFromPickup:y}=Ql(),_=(b,w)=>{const C=()=>{y(b.countryCode),w()};t?t(b,C):C()},k=b=>{if(o&&(p.value=!1),!Zo(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)})},M=b=>{_(b,()=>{u(b),e(b)})};return n(I,{gap:m?"small-300":"base",children:[m?null:n(Rt,{onSuccess:k}),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(He,{direction:"inline"}),n(G,{padding:"none base",children:n(B,{color:"subdued",children:d.translate("local_pickup.or")})}),n(He,{direction:"inline"})]}),n(ic,{sharedLocationAddress:v,searchOnSelect:a,onSearch:M,onBeforeCountryChange:t,onAfterCountryChange:y,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(Rt,{onSuccess:k,displayAsLink:!0,sharingNotAllowedError:d.translate("local_pickup.geolocation.permission_not_allowed")})]})},uc={id:"82df6c2dc2bed8371d068138beb16fa3f49623a334766ea9cb4e0932a8fed20b",type:"query",name:"PickupCountries",source:""},Za=ei(({graphql:{coreGraphql:e},router:t,shop:a},{sellableDeliveryMethods:o})=>{const i=ft(()=>t.currentUrl.value.pathname.endsWith("/throttle")),s=e.query(uc,{skip:()=>i.value}),r=ft(()=>{const l=s.data.value?.shop?.pickupCountries,{enabledDeliveryMethods:c,deliveryMethodsByMerchandise:u}=o.value;if(!(Object.keys(u).length>0&&pc(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}}),dc=["SHIPPING","LOCAL"];function pc(e){const t=e.includes("PICK_UP"),a=e.some(o=>dc.includes(o));return t&&!a}function hc(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>lt[a.unit]});function mc(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 vc=(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:()=>
2o.translate("local_pickup.location_nearby_short_one_item",{count:s}),otherItems:()=>o.translate("local_pickup.location_nearby_short_other_items",{count:s})}):mc(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 yc="KHJ3S",gc={Details:yc};function _c({distanceLabel:e,instructions:t}){return!e&&!t?null:n(I,{className:gc.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(B,{color:"subdued",children:n(oe,{type:"location",size:"small"})}),n(B,{fonts:"secondary",type:"small",children:e})]}),t&&n(I,{direction:"inline",gap:"small-400",alignItems:"center",children:[n(B,{color:"subdued",children:n(oe,{type:"clock",size:"small"})}),n(B,{fonts:"secondary",type:"small",children:t})]})]})}function fc(){const{checkout:e,shop:t}=g(),{deliveryNext:a,merchandiseLines:o}=ue(),i=A(()=>{const s=ni(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:ti(r)?.methodType==="PICK_UP"&&r.targetMerchandiseLines?.some(c=>s.some(u=>u.stableId===c.stableId))):!1});return A(()=>t.shipPickupInOneOrderEnabled?i.value:Jt({checkout:e}))}function no({variant:e="text"}){const{i18n:t}=g(),a=fc(),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}=g(),{isOnlyCountryAvailable:o}=we(),{cost:i,pickupLocation:s}=e,{name:r,address:l,distanceFromBuyer:c}=s,u=s.instructions.trim(),d=hc(i,a),h=!o&&c?ct(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(B,{type:"strong",children:r}),n(B,{type:"strong",letterCase:d.letterCase,children:d.amount})]}),n(ka,{address:l,hiddenFields:["postalCode","countryCode","phone"]}),n(_c,{distanceLabel:h,instructions:u})]}),t?n(no,{variant:"banner"}):null]})}function bc({methods:e,selectedDeliveryMethodHandle:t,setSelectedDeliveryMethodHandle:a}){const o=se(()=>t?[t]:[],[t]),i=q(([r=""])=>a?.(r),[a]),s=xe("purchase.checkout.pickup-location-option-item.render-after");return n(st,{name:"local_pickup_methods",values:o,onChange:i,hideRadioControl:e.length===1,children:e.map(r=>n(Pc,{method:r,extensions:s},r.handle))})}function Pc({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 kc="pickup-locations-modal";function Cc({addressFocus:e,...t}){const a=ce(!1);return n(Sc,{addressFocus:e??a,...t})}function Sc({methods:e,open:t,type:a,addressFocus:o,onClose:i}){const{i18n:s,shop:r}=g(),[l,c]=Ca({type:a,deliveryMethodType:"PICK_UP"}),u=oa(),{negotiate:d}=ke(),p=ue().merchandiseLines,h=de(tt(Xn).hasViolations),{fullCountryName:v,isOnlyCountryAvailable:m}=we(),y=ce(l),_=ce(!1),k=ce(!1),{setInverseGroupDeliveryMethodHandle:M,getInverseGroupDeliveryMethodHandle:L}=Sa(e||[],a||"ONE_TIME_PURCHASE"),b=Fe(),{pickupCountries:w,loading:C}=ia(Za,{sellableDeliveryMethods:b}),{deliveryLines:f,merchandiseLines:R,discountLines:O,shippingAddress:T}=$(),N=f.value,H=en(),{shouldGateCrossBorder:P,crossBorderGate:S}=Ts(),x=de(!!(e&&eo(e))),W=pt({allLocationsFarAway:x,selectedPickupOptionNoLongerAvailable:h}),z=(F,J)=>{const j=F.countryCode;if(!j||!P(j)){J();return}i(),S(()=>{T.fields.zoneCode.value=void 0,T.fields.coordinates.value=void 0,T.fields.countryCode.value=j})},ie=Qe(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&&k.value||l!==void 0&&l!==y.value)&&(k.value&&(k.value=!1),y.value=l)},[_.value,l,k.value]);const Q=()=>{!r.shipPickupInOneOrderEnabled||sa(f.value).some(({requiresShipping:J})=>J)||We(()=>{ai({deliveryLines:f,merchandiseLines:R.value,deliveryMethodTypes:["PICK_UP"]})&&oi(O)})},D=()=>{const F=y.value;if(F!==l){if(c(F),u.value&&F){const J=L(F);M(J)}Q(),d({include:["deliveryNext"]})}o.value=!1,i()},V=()=>{_.value=!0,k.value=!0,Q();const F=N.find(J=>{const j=J.peek().id;return j&&j===H.value?.id});F&&(F.fields.deliveryMethodHandle.value=void 0),d({include:["deliveryNext"],fieldsToResolve:["deliveryNext"],onComplete:()=>{_.value=!1}})},U=q(F=>{y.value=F},[y]),ee=()=>{if(k.value)return n(Ln,{hideText:!0});if(e){const F=Qe(H.value?.targetMerchandiseLines),J=m||x.value?Oe(F,{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(F,{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(ut,{itemCount:F,methods:e,onChangeLocationClick:()=>{o.value=!0}})}),h.value&&n(dt,{}),n(B,{color:"subdued",children:J}),n(bc,{selectedDeliveryMethodHandle:y.value,setSelectedDeliveryMethodHandle:U,methods:e})]})}return n(An,{heading:re,tryDifferentLocationOnClick:()=>{o.value=!0}})};return n(kn,{id:kc,onHide:D,open:t,heading:s.translate("delivery_options.pick_up_locations"),primaryAction:n(Oi,{handleSubmit:D,submitText:s.translate("payment.add_credit_card_modal.save")}),children:n(Pa,{section:"delivery",children:n(Di,{children:n(I,{gap:"base",children:[n(Y,{when:()=>C.value?null:w.value,children:F=>n(ht,{onLocationChange:V,onBeforeLocationChange:z,changeLocationOnSelect:!0,pickupCountries:F,addressAutoFocus:o.value,onAddressBlur:()=>{o.value=!1}})}),ee()]})})})})}const mt="split-delivery-merchandise-modal",Ic=6;function ao(e){return e.filter(t=>t.requiresShipping)}function Ht(e){return new Set(e.map(t=>t.digest)).size}function oo(e){return ao(si(e))}function io(e){return ao(sa(e))}function Lc(e,t){return t==="PICK_UP"?oo(e):io(e)}function Ac(e){return Ht(oo(e))+Ht(io(e))}function Mc(e){return e.filter(t=>t.requiresShipping).reduce((t,a)=>t+a.quantity,0)}
2function Ec(e){return Mc(e.filter(ii).flatMap(t=>t.lineComponents.length>0?t.lineComponents:[t]))}function so({targetMerchandiseLines:e,merchandiseLines:t}){const a=xi(e),o=Ec(t);return{targetMerchandiseQuantity:a,isAllItems:a===o}}function ro(){const{deliveryLines:e}=$(),t=A(()=>Ac(e.value)),a=A(()=>t.value>=Ic);return{physicalDeliveryTargetMerchandiseCount:t,shouldOpenModal:a}}function Je(e){const{deliveryLines:t}=$();return A(()=>Lc(t.value,e))}function Tc(e){const{merchandiseLines:t}=$(),a=Ke("deliveryNext"),o=A(()=>{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=A(()=>{const r=o.value;return r?(i.current=r,r):i.current});return{currentSummary:o,visibleSummary:s,isNegotiating:a}}const wc="HoMMS",Nc="_5tEP0",Dc="g9aTP",Oc="eWR8C",ln={TriggerButton:wc,TriggerChevron:Nc,TriggerButtonText:Dc,MenuOptionButton:Oc},lo="split-delivery-method-menu";function co(e,t){return`${lo}-${encodeURIComponent(e)}-${t}`}function xc(e,t){return`${co(e,t)}-trigger`}function Bc(e){return`[id^="${lo}-${encodeURIComponent(e)}-"][id$="-trigger"]`}function uo(e,t){if(e!==0)return t>=0?t:0}function Fc({activeIndex:e,isOpen:t,menuOptionsLength:a,selectedOptionIndex:o,wasOpenRef:i}){return K(()=>{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 Ut(e){requestAnimationFrame(()=>{De({content:e,role:"status"})})}function Rc(e){const{getInteraction:t}=Fi(),a=t(e);return a?.type==="command"&&a.kind==="overlay"&&a.active}function Vc({merchandiseStableIds:e,onMoveMerchandise:t,onRemoveMerchandise:a,selectedDeliveryMethodType:o,productTitle:i}){const s=ko(),{i18n:r}=g(),l=Fe(),c=ya(),u=Qa(),d=de(t??c),p=de(a??u),h=de(Bi().hideOverlay),v=te(null),m=te(!1),y=e[0],_=co(y,s),k=xc(y,s),M=Rc(_),L=de(M),b=ce(void 0),w=de(o),C=de(i),f=de(e),R=A(()=>{const D={SHIPPING:{label:r.translate("delivery_options.ship"),value:"SHIPPING",icon:"package-delivery",onClick:()=>V("SHIPPING")},PICK_UP:{label:r.translate("delivery_options.pickup"),value:"PICK_UP",icon:"location",onClick:()=>V("PICK_UP")}},V=U=>{h.value(_),U!==w.value&&(d.value({targetDeliveryMethodType:U,merchandiseStableIds:f.value}),Ut(U==="SHIPPING"?r.translate("split_delivery.accessibility.status.ship_separately",{items:C.value}):r.translate("split_delivery.accessibility.status.pickup_in_store",{items:C.value})))};return D}),O=A(()=>R.value[w.value].label),T=A(()=>{const{deliveryMethodsByMerchandise:D}=l.value,V=f.value.map(F=>D[F]);if(V.length===0||V.some(F=>!F))return[];const[U,...ee]=V;return ee.reduce((F,J)=>F.filter(j=>J.includes(j)),U)}),N=A(()=>{const D=T.value,V=D.map(U=>({...R.value[U],selected:U===w.value})).sort((U,ee)=>Number(ee.selected)-Number(U.selected));return D.length===1&&V.push({label:r.translate("stock.remove"),value:"remove",icon:"delete",selected:!1,onClick:()=>{h.value(_),p.value(f.value),Ut(r.translate("split_delivery.accessibility.status.remove_items",{items:C.value}))}}),V}),H=A(()=>N.value.length),P=A(()=>N.value.findIndex(D=>D.selected)),S=D=>{const V=H.value;if(V===0||b.value===void 0)return;const U=Math.min(b.value,V-1);b.value=(U+D+V)%V},x=()=>{b.value=uo(H.value,P.value)},W=()=>{M||x()},z=()=>{requestAnimationFrame(()=>{document.querySelector(Bc(y))?.focus()})},ie=D=>{D&&(D.onClick(),z())},re=D=>{if(!M){(D.key==="ArrowDown"||D.key==="ArrowUp")&&(D.preventDefault(),x(),v.current?.click());return}switch(D.key){case"ArrowDown":D.preventDefault(),S(1);break;case"ArrowUp":D.preventDefault(),S(-1);break;case"Home":D.preventDefault(),b.value=0;break;case"End":D.preventDefault(),b.value=H.value-1;break;case"Enter":case" ":D.preventDefault(),b.value!==void 0&&ie(N.value[b.value]);break;case"Tab":D.stopPropagation(),h.value(_);break}},Q=A(()=>L.value&&b.value!==void 0&&N.value[b.value]!==void 0?`${_}-option-${b.value}`:void 0);return n(Y,{when:H,children:D=>n(X,{children:[n(Fc,{activeIndex:b,isOpen:M,menuOptionsLength:D,selectedOptionIndex:P.value,wasOpenRef:m}),n(ca,{ref:v,id:k,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":Q.value,children:n(I,{direction:"inline",gap:"small-500",alignItems:"center",children:[n("span",{className:ln.TriggerButtonText,children:O}),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-e
2nd span-inline-start",children:n("div",{role:"listbox","aria-labelledby":k,children:n(Bn,{each:N,getKey:V=>V.value,children:(V,U)=>{const ee=b.value===U;return n("button",{id:`${_}-option-${U}`,type:"button",role:"option",tabIndex:-1,"aria-selected":V.selected,"data-active":ee||void 0,className:ln.MenuOptionButton,onClick:()=>{ie(V)},onMouseOver:()=>{b.value=U},children:n(I,{direction:"inline",gap:"small-400",alignItems:"center",children:[n(oe,{type:V.icon,tone:ee?"accent":"auto"}),n(B,{type:"small",tone:V.value==="remove"?"critical":"auto",children:V.label})]})})}})})})]})})}function hn({onMoveMerchandise:e,onRemoveMerchandise:t,title:a,selectedDeliveryMethodType:o}){const s=Je(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=Ri(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:y})=>{const _=[h,v?.name].filter(Boolean).join(` ${ri} `),k=l.has(u);return n(G,{accessibilityRole:"list-item",className:k?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:y>1?y:void 0}),n(G,{minInlineSize:"0px",maxInlineSize:"100%",overflow:"hidden",children:[n(B,{size:"base",children:n(Ct,{children:p})}),_&&n(B,{color:"subdued",size:"small",children:n(Ct,{children:_})})]}),n(G,{inlineAlignment:"end",children:n(Vc,{merchandiseStableIds:m,onMoveMerchandise:e,onRemoveMerchandise:t,selectedDeliveryMethodType:o,productTitle:p})})]})},u)})})})}function po(){const{i18n:e}=g(),t=tn(),a=te(null),o=Je("PICK_UP"),{shouldOpenModal:i}=ro(),{currentSummary:s,visibleSummary:r,isNegotiating:l}=Tc(o),c=A(()=>s.value?.totalItemCount===1),u=A(()=>{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=A(()=>{const v=e.translate("review.blocks.change_delivery_method_link_label");return u.value?`${u.value}, ${v}`:v}),p=A(()=>u.value||e.translate("split_delivery.items_for_pickup")),h=ce(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?mt: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(Ia,{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(B,{children:u})}),n(oe,{type:"pen",size:"base",tone:"neutral"})]})})})})})}function ho(){const{shop:e}=g(),t=Fe(),{deliveryNext:a}=ue(),o=tn(),i=Ta();return A(()=>{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 Hc({localPickupDeliveryLine:e,onShowModal:t}){const{i18n:a,shop:o}=g(),i=ho(),s=o.hasFlagEnabled(ra),{methods:r,selectedDeliveryMethodHandle:l}=e,c=r.find(_=>_.handle===l),u=r.length-1,d=qe({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 y=n(X,{children:[n(Y,{when:i,children:n(X,{children:[n(G,{padding:"base",children:n(po,{})}),n(He,{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(He,{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(B,{t
2ype:"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:y})}):n(G,{border:"base",borderRadius:"large",children:y})})}function xn(){const{shop:e}=g(),t=ho(),a=e.hasFlagEnabled(ra),o=n(X,{children:[n(Y,{when:t,children:[n(G,{padding:"base",children:n(po,{})}),n(He,{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(He,{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 Uc({onShowModal:e,showLocationButton:t=!0}){const{i18n:a}=g(),{value:o}=ue().merchandiseLines;Qn({active:!0});const{fullCountryName:i,isOnlyCountryAvailable:s}=we(),r=qe({methods:[],selectedDeliveryMethodHandle:void 0}),l=Qe(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 zt={isLocationFormVisible:!1};function zu(){const{i18n:e}=g(),{negotiating:t}=Sn(),a=en(),o=Ze(),i=Ke("deliveryNext"),{value:s}=La().value,{value:r}=Aa().value,l=!!(s||r),c=de(tt(Xn).hasViolations),u=qa({mode:"localPickup"}),d=A(()=>u.value.merchandiseLines),p=A(()=>u.value.allowAlternativeAction),h=A(()=>u.value.merchandiseLines.length>0),{isOnlyCountryAvailable:v}=we(),m=A(()=>{const T=a.value?.methods??[];return T.length>0&&eo(T)}),y=pt({allLocationsFarAway:m,selectedPickupOptionNoLongerAvailable:c}),_=qe({methods:a.value?.methods||[],selectedDeliveryMethodHandle:a.value?.selectedDeliveryMethodHandle}),[k,M]=le(!1),L=ce(!1),b=xe("Checkout::PickupLocations::RenderBefore"),w=xe("Checkout::PickupLocations::RenderAfter"),C=T=>{M(!0),L.value=T??!1},f=()=>{M(!1),L.value=!1},R=()=>{C(),_(v?"checkout_pickup_geoselector_clicked_country_grain":"checkout_pickup_geoselector_clicked_other_grain")},O=(()=>{const T=a.value,N=T?.methods.find(S=>S.handle===T.selectedDeliveryMethodHandle);if(!o.value||k)return n(xn,{});if(t.value&&!N)return n(xn,{});if(l)return n(Y,{when:h,fallback:n(Uc,{onShowModal:C}),children:n(X,{children:[n($n,{bannerType:"pickup",merchandiseLines:d,allowAlternativeAction:p}),n(zc,{})]})});if(!T)return n(xn,{});const{methods:H}=T,P=Qe(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(dt,{})}),n(Y,{when:y,children:n(ut,{itemCount:P,methods:T.methods,onChangeLocationClick:C})}),n(I,{direction:"inline",gap:"small-200",justifyContent:"space-between",children:[n(Y,{when:i,fallback:n(B,{color:"subdued",children:vc(H,v,P,e,{selectedDeliveryMethodHandle:T.selectedDeliveryMethodHandle,allLocationsFarAway:m.value})}),children:n(pe,{inlineSize:"base"})}),n(Xa,{onClick:R})]}),n(Be,{customizations:b,options:zt}),n(Hc,{localPickupDeliveryLine:T,onShowModal:C}),n(Be,{customizations:w,options:zt})]})})();return n(Pn,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(ze,{accessibilityLabel:e.translate("local_pickup.pick_up_location"),children:[O,n(Cc,{methods:a.value?.methods,type:a.value?.type,open:k,onClose:f,addressFocus:L})]})})}function zc(){return Qn({active:!0}),null}const Wt=5;function Wc(e,t){const a=qe({methods:e,selectedDeliveryMethodHandle:t}),[o,i]=le(Wt),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+Wt),a("checkout_pickup_buyer_reveal_more"))}}}const $c=13;function Wu(){const{i18n:e}=g(),[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(B,{children:Ya(o,$c)})]}):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(Gc,{isLocationFormVisible:t,setIsLocationFormVisible:a})]})})})}function Gc({isLocationFormVisible:e,setIsLocationFormVisible:t}){const a=Ze(),{i18n:o}=g(),{negotiating:i}=Sn(),s=en(),r=Ke("deliveryNext"),{value:l}=Aa().value,c=!!l,{isOnlyCountryAvailable:u}=we(),d=Mn(),{deliveryLines:p}=$(),h=p.value,{negotiate:v}=ke(),m=Ui(),y=xe("Checkout::PickupLocations::RenderBefore"),_=xe("Checkout::PickupLocations::RenderAfter"),k=se(()=>({isLocationFormVisible:e}),[e]),M=()=>t(!1),L=()=>t(O=>!O),b=()=>{M();const O=h.find(T=>{const N=T.peek().id;return N&&N===s.value?.id});O&&(O.fields.deliveryMethodHandle.value=void 0),v({include:["deliveryNext"],fieldsToResolve:["deliveryNext"]})},w=Fe(),{pickupCountries:C,loading:f}=ia(Za,{sellableDeliveryMethods:w}),R=A(()=>!!(s.value&&Fl(s.value.methods)));if(c)return n($t,{isLocationFormVisible:e,setFormVisibilityFalse:M,handleLocationChange:b,pickupCountries:C.value??[],onToggleLocationFormClick:L});if(i.value||!a.value||f.value||!C.value)return n(Ln,{});if(s.value){const{methods:O,type:T}=s.value,N=m.value.PICK_UP??0,H=R.value&&d&&!u,P=u?Oe(N,{oneItem:()=>
2o.translate("local_pickup.location_information_far_away_one_item",{count:O.length}),otherItems:()=>o.translate("local_pickup.location_information_far_away_other_items",{count:O.length})}):Oe(N,{oneItem:()=>o.translate("local_pickup.location_nearby_one_item",{count:O.length}),otherItems:()=>o.translate("local_pickup.location_nearby_other_items",{count:O.length})});return n(I,{gap:"base",children:[n(no,{}),n(Be,{customizations:y,options:k}),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:!H&&n(Ee,{color:"subdued",children:d?P:o.translate("local_pickup.location_information",{count:O.length})})}),n(Ja,{locationFormVisible:e,toggleLocationFormVisibility:M,onLocationChange:b,pickupCountries:C.value,children:n(qc,{itemCount:N,methods:O,type:T,allLocationsFarAway:R,loading:r.value,onToggleLocationFormClick:L})}),n(Be,{customizations:_,options:k})]})}return n($t,{isLocationFormVisible:e,setFormVisibilityFalse:M,handleLocationChange:b,pickupCountries:C.value,onToggleLocationFormClick:L})}function $t({isLocationFormVisible:e,setFormVisibilityFalse:t,handleLocationChange:a,pickupCountries:o,onToggleLocationFormClick:i}){const{value:s,loading:r}=La().value,l=ue().merchandiseLines,{i18n:c}=g(),{locationAddress:u}
2=$(),d=u.peek(),p=o.find(m=>m.value===d.countryCode)?.label,h=Qe(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(Ja,{locationFormVisible:e,toggleLocationFormVisibility:t,onLocationChange:a,pickupCountries:o,children:n(An,{heading:v,tryDifferentLocationOnClick:i})}),n(Kc,{})]}):n(Ln,{})}function Kc(){return Qn({active:!0}),null}function Gt({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(ka,{address:t,textSize:"small",hiddenFields:["phone"]}),i&&r&&n(Gt,{instructions:r})]}),secondaryContent:n(X,{children:[n(B,{type:"strong",letterCase:o,children:n("span",{style:{display:"flex",justifyContent:"flex-end"},children:a})}),s&&r&&n(Gt,{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(B,{type:"strong",children:l})})}function qc({itemCount:e,methods:t,allLocationsFarAway:a,type:o,loading:i,onToggleLocationFormClick:s}){const{i18n:r,checkout:{identity:l}}=g(),c=l.current.value==="shopPay",{negotiate:u}=ke(),d=oa(),{isOnlyCountryAvailable:p}=we(),h=Mn(),v=Ze(),m=zi({base:!0,medium:!1}),y=v.value?m??!1:!0,[_,k]=Ca({type:o,deliveryMethodType:"PICK_UP"}),{revealedMethods:M,amountLeft:L,allRevealed:b,revealMore:w}=Wc(t,_),{setInverseGroupDeliveryMethodHandle:C,getInverseGroupDeliveryMethodHandle:f}=Sa(t,o),R=q(([x=""])=>{if(k(x),d.value){const W=f(x);C(W)}u({include:["deliveryNext"]})},[k,d,u,f,C]),O=xe("purchase.checkout.pickup-location-option-item.render-after"),T=de(tt(Xn).hasViolations),N=pt({allLocationsFarAway:a,selectedPickupOptionNoLongerAvailable:T}),H=se(()=>_?[_]:[],[_]);if(i)return n(Ln,{hideText:!0});const P=(x,W)=>x===0?r.translate("shipping.free_rate_label"):r.formatCurrency(x,{currency:W}),S=({name:x="",proximityLabel:W,distance:z})=>{if(!(!p&&(z||W)))return x;const re=W||`(${ct(r,z)})`;return n(X,{children:[x," ",n(B,{color:"subdued",children:re})]})};return n(I,{gap:"base",children:[n(Y,{when:N,children:n(ut,{itemCount:e,methods:t,onChangeLocationClick:s})}),T.value&&n(dt,{}),n(st,{name:"local_pickup_methods",values:H,onChange:R,hideRadioControl:!c&&M.length===1,children:M.map(({handle:x,cost:{amount:W,currencyCode:z},pickupLocation:ie})=>{const{address:re,instructions:Q,name:D,distanceFromBuyer:V,proximityLabel:U}=ie,ee=P(W,z),F=S({name:D,distance:V,proximityLabel:h?void 0:U}),J=ee===r.translate("shipping.free_rate_label")?"uppercase":void 0;return n(jc,{handle:x,address:re,secondaryLabel:ee,letterCase:J,showInstructionsLeft:!!(Q&&(c||y)),showInstructionsRight:!!(Q&&!c&&!y),instructions:Q,nameLabel:F,itemRenderAfterCustomizations:O},x)})}),!b&&n(G,{inlineAlignment:"end",children:n(me,{onClick:w,children:r.translate("local_pickup.reveal_more_label",{count:L})})})]})}function Yc({heading:e="auto"}){const{i18n:t}=g(),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(ha,{blockSize:"small-500"}),n(Bs,{text:t.translate("pickup_point.waiting_on_pickup_point_location_notice")})]})})}const $u=mn({displayName:"PickupPoint",load:()=>Kn(()=>an(()=>import("./component-PickupPoint.iWjeoIDl.js"),__vite__mapDeps([64,1,6,2,3,4,5,7,8,9,29,30,31,56,51,23,18,24,25,26,14,15,52,13,16,17,19,20,21,22,27,65,59,66,67,43,41,42,44,45,28,46,47,40,11,12,48,49,50,53,54,38,39,55,68]))),renderLoading:e=>n(Yc,{...e})});function Gu({selectedDeliveryMethodType:e}){const{i18n:t}=g(),{merchandiseLines:a}=$(),o=Je(e),{shouldOpenModal:i}=ro(),s=A(()=>{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=A(()=>`${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:mt,children:n(ge,{gridAutoFlow:"column",gridTemplateColumns:"minmax(auto, max-content) minmax(0, 1fr) minmax(auto, max-content)",alignItems:"center",gap:"small-200",children:[n(Ia,{variant:"fan-legacy",sortByPrice:!0,merchandise:o.value,size:"small",useImageAltTexts:!1}),n(B,{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 Xc({onClose:e}={}){const{negotiate:t}=ke(),{i18n:a}=g(),o=Wi(),{deliveryLines:i,merchandiseLines:s,discountLines:r}=$(),l=Fe(),c=te(!1),u=q(({targetDeliveryMethodType:h,merchandiseStableIds:v})=>{const{orphanedRemovedFromCartStableIds:m}=li({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=q(h=>{aa({deliveryLines:i,merchandiseLines:s,merchandiseStableIds:h,discountLines:r})},[i,s,r]),p=q(()=>{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 Ku({id:e=mt,open:t}){const{i18n:a}=g(),o=Je("PICK_UP"),i=Je("SHIPPING"),{moveMerchandise:s,removeMerchandise:r,saveAndClose:l}=Xc(),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 Jc(e){return e==="LOCAL"?"SHIPPING":e}function Zc(e){const t=new Set(e.map(Jc));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 ju(){const{violations:e}=$i(kt),{client:t,i18n:a,shop:o,source:i,observability:s,url:r,embed:l,checkout:c}=g(),{merchandiseLines:u,shippingAddress:d}=$(),{countryName:p,loading:h}=Gi(d.value),{value:v}=ue().merchandiseLines,{negotiate:m}=ke(),y=Ki(),{negotiating:_,methods:k}=Sn(),{loading:M}=Yn(),L=te(y.peek()),b=te(M.peek().has("deliveryNext")),C=A(()=>{const ne=M.value.has("deliveryNext"),Se=b.current&&!ne;return y.value?L.current=!0:Se&&(L.current=!1),b.current=ne,L.current}).value,{cartUpdated:f,setCartUpdated:R}=Qc(),O=bn(),[T,N]=le(void 0),H=!!l;K(()=>{e.size>0&&N(p)},[e]);const P=qa({deliveryMethodType:"SHIPPING",mode:"deliveryMethodScoped"}),S=A(()=>P.value.merchandiseLines),x=A(()=>P.value.merchandiseLines.length>0);if(!v||v.lines.length===0||h||T!==p||C)return null;if(f)return n(Cn,{heading:a.translate("merchandise_unavailable_in_buyer_location.cart_updated"),tone:"info"});if(e.size===0||o.shipPickupInOneOrderEnabled&&_.value&&Zc(k.value))return null;const z=na(Array.from(e),v,Array.from(kt)),ie=z?.map(({stableId:ne})=>ne),re=u.value.filter(({stableId:ne})=>!ie?.includes(ne)),Q=re.length===0,D=n($n,{bannerType:"shipping",merchandiseLines:S});if(z==null)return x.value?D:null;const V=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 U=null;Q&&z.length===1?U=a.translate("merchandise_unavailable_in_buyer_location.banner_title.all_products_one",{location_name:V}):Q?U=a.translate("merchandise_unavailable_in_buyer_location.banner_title.all_products_other",{location_name:V}):z.length===1?U=a.translate("merchandise_unavailable_in_buyer_location.banner_title.some_products_one",{location_name:V}):U=a.translate("merchandise_unavailable_in_buyer_location.banner_title.some_products_other",{location_name:V});const ee=Q?null:n(ga,{children:z.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))}),F=z.length===1?a.translate("merchandise_unavailable_in_buyer_location.remove_items_action.one"):a.translate("merchandise_unavailable_in_buyer_location.remove_items_action.other"),J=a.translate("merchandise_unavailable_in_buyer_location.empty_cart_action");function j(){O("click",{element:{tagName:"a",textContent:J},section:"delivery",timestamp:new Date}),s.log("redirect_to_storefront","[UnavailableInBuyerLocationBanner] Empty cart and redirect to storefront",{allItemsUnavailable:Q,redirectSuccess:o.hasStorefront}),ji({client:t,url:r,source:i,configuration:c.configuration})}function Ce(){O("click",{element:{tagName:"a",textContent:F},section:"delivery",timestamp:new Date}),u.value=re,m({onComplete:R})}const _e=n(B,{children:Q?Q&&(H||!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:j,children:J})}):a.translate("merchandise_unavailable_in_buyer_location.change_address_or_remove",{remove_action:n(me,{onClick:Ce,children:F})})}),fe=n(Ea,{impressionType:"unavailable_in_buyer_location",impressionFeatures:Array.from(e).map(({code:ne})=>ne),children:n(je,{heading:U,tone:"critical",children:n(I,{gap:"base",children:[ee,_e]})})});return n(Y,{when:x,fallback:fe,children:D})}function eu({taxId:e}){const{negotiate:t}=ke(),a=qi(),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 nu({status:e}){const{i18n:t}=g(),{shippingAddress:a}=$(),o=de(e);return A(()=>{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 tu(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 au=fn("VatNumberFieldInfoTooltip");function ou({status:e}){const{i18n:t}=g();return e.type==="pending"?n(et,{size:"small",accessibilityLabel:t.translate("taxes.vat_number.accessibility.status.validating")}):e.type==="invalid_format"?n(mo,{}):n(iu,{status:e})}function iu({status:{validationStatus:e}}){const{i18n:t}=g();return e==="VALID"?n(X,{children:[n(oe,{tone:"success",size:"small",type:"check-circle"}),n(B,{accessibilityVisibility:"exclusive",children:t.translate("taxes.vat_number.accessibility.status.valid")})]}):n(mo,{})}function mo(){const{i18n:e}=g(),t=_n(void 0,au);return n(X,{children:[n(oe,{size:"small",type:"question-circle",interestFor:t}),n(ua,{id:t,children:e.translate("taxes.vat_number.field.tooltip")})]})}function qu({taxId:e,applied:t,inputRef:a}){const{i18n:o}=g(),i=eu({taxId:e}),s=nu(i),r=A(()=>s.value&&{type:"warning",value:s.value.message}),l=e.warnings.includes("DOMESTIC_NOT_APPLICABLE");return tu(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(da,{ref:a,name:"vatNumber",label:o.translate("taxes.vat_number.field.label"),autocomplete:"off",inputMode:"text",accessoryEnd:n(ou,{status:i.status}),error:r.value,...i})}),l&&n(Cn,{tone:"info",children:o.translate("taxes.vat_number.domestic_order")})]})}function Yu({name:e,variant:t="content",children:a}){return Yi(()=>an(()=>Promise.resolve({}),__vite__mapDeps([69]))),n("div",{className:`delivery-transition-${t}
2`,style:e?{"--delivery-view-transition-name":e}:void 0,children:a})}export{Vt as A,Cc as B,Fu as C,Uu as D,Ru as E,kc as F,Xa as G,_c as H,$n as I,oo as J,io as K,bc as L,Tc as M,Ac as N,Ic as O,Oa as P,mt as Q,hn as R,no as S,Fl as T,ju as U,qu as V,pt as W,vc as X,ut as Y,Da as Z,qa as a,Ln as b,Uc as c,dt as d,Hu as e,ho as f,$u as g,Yu as h,Ku as i,Mn as j,zu as k,Wu as l,Gu as m,Vu as n,_r as o,Rt as p,An as q,za as r,Nt as s,Ar as t,Vs as u,Ra as v,xa as w,we as x,fc as y,ct 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.