1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["f2ade998.B-SxTBnl.js","2c1ab0fe.D_oO1jU7.js","4c290a1e.D9lE9kmU.js","app.bDJ3v-8C.js","assets/app.BuSMBobh.css","assets/previous.BpuyvRSB.css","164ad2e3.DgUUtBtV.js","65f3d4da.8ZfwXSRH.js","60a453ce.BIyixFcg.js","0a7dffce.BMM606kb.js","bb728e1c.BObJOhlA.js","assets/stopwatch.Kyhz8KoT.css","74835653.9kmD7491.js","3ca8ef7e.DT3qvctx.js","ac5a19ff.CrIDx928.js","assets/FormLayout.CrYq3At_.css","47b970b2.Bspt4mBz.js","29034f35.BY8rOPhQ.js","assets/PhoneField.uZEuHncj.css","064f6ac1.CT1iFQsV.js","assets/Popover.Bi1nHaU-.css","53bbdad9.Bipg1_Lt.js","efa0389a.-R9eik6_.js","assets/Choice.B7lVAtpz.css","assets/BillingAddressForm.BdwN7V1K.css","a25deb9a.XIOr6b3K.js","assets/useShopPayNewSignupLoginExperiment.BYM12A8B.css","2fdb3dd3.Dk6unqUy.js","cb8fcd45.gqoNFKgG.js","0c0ad074.C7YXa-mF.js","5587f402.B4N8qnlk.js","945a08d6.DUn1GrN-.js","assets/useShopPayButtonClassName.CpHF4L7Q.css","c57e39e6.CFJyqk5V.js","2210eadb.DF0gIp_2.js","assets/ShopPayVerificationSwitch.WW3cs_z5.css","d56ce0bb.DG_7cdr9.js","7b0c98ea.0CGJF8wQ.js","assets/TransitionHeight.CuRoM9zv.css","e3e348f2.sbssU431.js","ca5e9c49.BL-l7mUG.js","31cc568e.CsDC1k63.js","8599b02a.yKiXuwTF.js","assets/index.CIy8uDiZ.css","0e67bd3b.DkCvQkdq.js","f1968089.4OkuMKtQ.js","55098bf1.CrP8QF43.js","cb5cf153.Cf9Ss23E.js","ed9f2238.C-XxbQrN.js","0b8657b8.CBFRF2sQ.js","a422df8c.CGT3eUwi.js","assets/EmptyState.BEvzDDvy.css","79974aab.B4rWj4Zf.js","d22d2b80.22VthIi0.js","f49d4216.DMwWemXC.js","assets/ApplePayButton.CTcryfIc.css","56bd1136.CIMEyGpu.js","3a819064.CWC3Yoc0.js","8536083a.BCEdV5WN.js","assets/WalletSandbox.BoV0vp4z.css","4aab4b34.D7JoYOky.js","assets/amazonWalletLazy.D78LrA7v.css","assets/delivery-method-transitions.S-FSTp4Y.css","78af98ed.D5JvAG94.js","be176b00.BPFeyNW7.js","assets/Map.cbVP6Hp_.css","8574876b.DRpdCYKn.js","assets/PickupPoint.3rHQv8Px.css"])))=>i.map(i=>d[i]); 2import{f as e,_ as n,u as t,h as a,o as i,T as o,d as r,r as l,e as s,A as c,k as d,q as u,i as p,n as m,S as h,g as v,l as _,Q as y,X as g,x as b,a as f,j as k,p as C,aA as P,G as I,E as S,af as L}from"./2c1ab0fe.D_oO1jU7.js";import{F as A,a as M}from"./3ca8ef7e.DT3qvctx.js";import{O as w,Q as E,a8 as x,b0 as N,aT as T,G as O,P as B,iQ as D,ex as F,bh as z,bi as V,bj as R,e9 as U,ae as H,a6 as j,iR as $,cg as K,a7 as G,iS as q,a9 as W,iT as Y,N as Q,az as X,iU as J,eP as Z,iV as ee,_ as ne,cf as te,aZ as ae,iW as ie,iX as oe,ad as re,iY as le,da as se,bb as ce,fX as de,X as ue,iZ as pe,i_ as me,fV as he,i$ as ve,j0 as _e,dx as ye,j1 as ge,j2 as be,ek as fe,j3 as ke,ab as Ce,cG as Pe,j4 as Ie,j5 as Se,E as Le,eA as Ae,ez as Me,H as we,e$ as Ee,j6 as xe,cp as Ne,eB as Te,eE as Oe,aQ as Be,j as De,n as Fe,cq as ze,cJ as Ve,ce as Re,j7 as Ue,j8 as He,cN as je,ac as $e,j9 as Ke,i3 as Ge,ja as qe,jb as We}from"./4c290a1e.D9lE9kmU.js";import{di as Ye,f as Qe,dj as Xe,h as Je,a5 as Ze,P as en,ct as nn,c as tn,e2 as an,co as on,I as rn,l as ln,hB as sn,be as cn,f$ as dn,C as un,a as pn,an as mn,n as hn,gv as vn,J as _n,bS as yn,y as gn,T as bn,bY as fn,gt as kn,S as Cn,L as Pn,hC as In,bT as Sn,ht as Ln,cR as An,cv as Mn,gK as wn,a4 as En,fA as xn,H as Nn,bv as Tn,cN as On,B as Bn,ac as Dn,b1 as Fn,c2 as zn,$ as Vn,Z as Rn,a0 as Un,_ as Hn,hD as jn,p as $n,hE as Kn,dd as Gn,O as qn,U as Wn,b as Yn,gl as Qn,g as Xn,W as Jn,A as Zn,E as et,bk as nt,bj as tt,ck as at,eW as it,fa as ot,hF as rt,bJ as lt,fV as st,hG as ct,cr as dt,cs as ut,hH as pt,fK as mt,eX as ht,bB as vt,hp as _t,ad as yt,br as gt,cp as bt,hI as ft,ci as kt,f3 as Ct,f4 as Pt,dw as It,N as St,cl as Lt,bA as At,cm as Mt,hJ as wt,hK as Et,fi as xt,aB as Nt,c3 as Tt,ax as Ot,hL as Bt,b0 as Dt,af as Ft,bp as zt,hM as Vt,az as Rt,Y as Ut,d9 as Ht,da as jt,en as $t,a1 as Kt,c4 as Gt,hN as qt}from"./164ad2e3.DgUUtBtV.js";import{a as Wt,v as Yt,c as Qt,S as Xt}from"./0c0ad074.C7YXa-mF.js";import{h as Jt,i as Zt}from"./cb8fcd45.gqoNFKgG.js";import{b as ea,c as na,d as ta,e as aa,i as ia,f as oa}from"./2fdb3dd3.Dk6unqUy.js";import{u as ra,A as la}from"./53bbdad9.Bipg1_Lt.js";import{u as sa,S as ca,a as da,b as ua,A as pa}from"./0e67bd3b.DkCvQkdq.js";import{L as ma}from"./f1968089.4OkuMKtQ.js";import{h as ha}from"./65f3d4da.8ZfwXSRH.js";import{P as va,u as _a,F as ya}from"./47b970b2.Bspt4mBz.js";import{_ as ga,j as ba,h as fa}from"./app.bDJ3v-8C.js";import{I as ka}from"./55098bf1.CrP8QF43.js";import{S as Ca,u as Pa,G as Ia}from"./cb5cf153.Cf9Ss23E.js";import{b as Sa,d as La,e as Aa,h as Ma,i as wa,j as Ea,k as xa,a as Na}from"./ed9f2238.C-XxbQrN.js";import{a as Ta,e as Oa,S as Ba}from"./ca5e9c49.BL-l7mUG.js";import{g as Da,P as Fa,h as za}from"./e3e348f2.sbssU431.js";import{S as Va}from"./5587f402.B4N8qnlk.js";import{a as Ra}from"./945a08d6.DUn1GrN-.js";import{M as Ua}from"./0b8657b8.CBFRF2sQ.js";import{b as Ha,C as ja,a as $a}from"./efa0389a.-R9eik6_.js";import{C as Ka}from"./a422df8c.CGT3eUwi.js";import{S as Ga}from"./79974aab.B4rWj4Zf.js";import{T as qa}from"./7b0c98ea.0CGJF8wQ.js";import{u as Wa}from"./d22d2b80.22VthIi0.js";import{a as Ya,s as Qa,M as Xa}from"./74835653.9kmD7491.js";import{P as Ja}
2from"./f49d4216.DMwWemXC.js";import{P as Za}from"./064f6ac1.CT1iFQsV.js";function ei(){const{shop:n,checkout:t}=w(),{shippingAddress:a,billingAddress:i}=E(),o=Ye();return e((()=>{const e=Jt({isShippingRequired:t.isShippingRequired.value,isPickupSelected:o.value,shippingCountryCode:a.fields.countryCode.value,billingCountryCode:i.fields.countryCode.value});return Zt(n,e)}))}function ni(){const{shop:n,source:t,checkout:a}=w(),i=Qe(),o=E(),r=Ye(),l=Xe(),s=ei();return e((()=>{const e=o.phone.value,c=o.email.value,d=a.identity.current.value;let u,p=Boolean(s.value)||"OFF"!==n.smsMarketing;if("shopPay"!==d&&"businessCustomer"!==d||(p=!1),a.configuration.visibility.showSmsMarketing&&p&&!1!==i?.smsMarketingEnabled&&!N(t)){let n;n=e&&!c?"contact":r.value||!a.isShippingRequired.value?"billing":"delivery",u=l.value[n]?"root":n}else u="none";return{isNone:"none"===u,isContact:"contact"===u,isDelivery:"delivery"===u,isBilling:"billing"===u,isRoot:"root"===u}}))}function ti({origin:e="contact_info_page"}){const{acceptEmailMarketing:a}=E(),{negotiate:i}=Je(),{emailMarketingOptInShownSignal:o}=T(),{i18n:r,userEvents:l,checkout:s,source:{checkoutSessionIdentifier:c,sourceId:d},shop:{id:u,myshopifyDomain:p}}=w(),m=s.configuration.layout.isOnePage.value;n((()=>{o.value=!0}),[o]);const h=ha("marketing.disclaimer.description_html",r)?t(en,{type:"small",color:"subdued",children:t(Ze,{children:r.translate("marketing.disclaimer.description_html",{privacy_policy_link:t(ma,{handle:"privacy-policy",tone:"monochrome"}),terms_of_service_link:t(ma,{handle:"terms-of-service",tone:"monochrome"})})})}):null;return t(tn,{gap:"small-200",children:[t(nn,{id:"marketing_opt_in",name:"marketing_opt_in",checked:a.value,onChange:function(n){a.value=n,i({loading:["acceptEmailMarketing"]}),l.monorailEvent({schemaId:"checkout_email_marketing_optin_ui_interaction/1.0",payload:{checkoutToken:c||d,shopId:Number(O(u)),shopifyDomain:p,action:n?"click_email_opt_in":"unclick_email_opt_in",origin:e,checkoutVersion:m?"checkout_one_redesign":"checkout_one"}})},label:ai({identity:s.identity,i18n:r})}),h]})}function ai({identity:e,i18n:n}){switch(e.current.value){case"shopPay":case"buyWithPrime":return n.translate("marketing.accept_shop_pay_marketing_checkbox_label");default:return n.translate("marketing.accept_marketing_checkbox_label")}}ti.displayName="MarketingOptIn";const ii=/<a\b(?<attributes>[^>]*)>(?<text>.*?)<\/a>/gi,oi=/data-policy-handle=(["'])(?<handle>privacy-policy|terms-of-service)\1/i,ri=/<\/?[a-z][\s\S]*>/i;function li(e){return t(Ze,{dangerouslySetInnerHTML:{__html:e}})}function si(e,n){return t("span",{dangerouslySetInnerHTML:{__html:e}},n)}function ci(e){const n=[];let a=0,i=!1;for(const r of e.matchAll(ii)){const o=r.index,l=di(r);if(null==o||!l)continue;const s=e.slice(a,o);if(ri.test(s))return li(e);s&&n.push(si(s,`text-before-${o}`)),n.push(t(ma,{handle:l,tone:"monochrome"},`${l}-${o}`)),a=o+r[0].length,i=!0}const o=e.slice(a);return!i||ri.test(o)?li(e):(o&&n.push(si(o,"trailing-text")),t(Ze,{children:n}))}function di(e){const n=e.groups?.attributes??"",t=n.match(oi)?.groups?.handle;return"privacy-policy"===t?"privacy-policy":"terms-of-service"===t?"terms-of-service":null}function ui(e){return e?.label&&e.disclaimerHtml.trim()?e:void 0}function pi(){const{i18n:r,shop:l,checkout:s,embed:c}=w(),{marketingPhoneInputError:d,previousPhoneMarketingDisclosureKeySignal:u,smsMarketingOptInShownSignal:p}=T(),{phone:m,acceptSmsMarketing:h,smsMarketingPhone:v,shippingAddress:_}=E(),y=ea(),g=ei(),b=g.value,f=ui(b),k=!b&&"OFF"!==l.smsMarketing,C=f?.label??(k?r.translate("marketing.accept_sms_checkbox_label"):void 0),P=Boolean(C);n((()=>{P&&(p.value=!0)}),[P,p]);const I=B(),{handleSmsMarketingConsent:S}=na(),L=e((()=>I.buyerIdentity.value?.customerProfile)),A=e((()=>!m.value&&!s.proposal.negotiated.fields.availableDeliveryAddresses.value?.length)),M=e((()=>Boolean(!m.value))),x=e((()=>!c?.isFlagshipPartner&&!L.value&&!M.value));a((()=>{if(!v.value){const e=A.value?_.fields.phone.value:m.value;v.value=e??""}}),[]),i((()=>{const e=_.fields.phone.value;A.value&&!ui(g.value)&&"OFF"===l.smsMarketing&&(v.value=e||"")})),ta(),i((()=>{const e=(n=g.value)?JSON.stringify([n.label,n.disclaimerHtml]):null;var n;const t=u.peek();u.value=e,null!=t&&null!=e&&t!==e&&h.value&&(h.value=!1)})),i((()=>{m.value&&!L.value&&(v.value=m.value)}));const N=r.translate("field_errors.sms_marketing_phone_invalid"),O=aa(N),D=o((()=>({state:{phone:v},errors:{phone:d}})),[d,v]);if(!C)return null;const F=t(en,f?{type:"small",color:"subdued",children:ci(f.disclaimerHtml)}:{type:"small",color:"subdued",children:t(Ze,{children:r.translate("marketing.sms.disclaimer.description_html",{privacy_policy_link:t(ma,{handle:"privacy-policy",tone:"monochrome"}
2),terms_of_service_link:t(ma,{handle:"terms-of-service",tone:"monochrome"})})})});return t(on,{...D,children:t(an,{id:"smsMarketingOptInDisclosure",open:h.value,summary:t(nn,{id:"sms_marketing_opt_in",name:"sms_marketing_opt_in",label:C,checked:h.value,onChange:function(e){d.value=void 0,S(e)},"aria-controls":"smsMarketingOptInDisclosure"}),content:t(tn,{gap:"base",paddingBlockStart:"base",children:[t(va,{countryCode:y.value??"",label:r.translate("marketing.sms.mobile_phone_number"),disabled:x.value,caretPosition:0,prefillCountryCode:!0,icon:"mobile",...h.value?O:{}}),F]})})})}pi.displayName="PhoneMarketingOptIn";const mi=r({displayName:"ShopPayVerificationSwitch",load:()=>l((()=>ga((()=>import("./f2ade998.B-SxTBnl.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]))))});function hi({onClick:e}){const{i18n:n}=w();return t(ln,{variant:"primary",accessibilityLabel:n.translate("account_management.verification_toggle"),onClick:e,segment:"end",children:t("div",{className:"rdvNk",children:t(rn,{type:"mobile",size:"large"})})})}function vi(){const e=sn({key:"india_phone_autofill",variants:[D.Control,D.Treatment]}),n=_i()===D.Treatment;return e||(n?D.Treatment:D.Control)}function _i(){const{client:e}=w();return e.unstable_getSerialization("experiments")?.find((({clientHandle:e})=>e===ba))?.variant}function yi({emailInput:e,email:n,isShopPayUnauthenticatedUser:t}){const{shopPay:o}=w(),r=c(""),l=t?U.C1ModalShopPay:void 0,[s,p]=d(l),[m,h]=d(!1),[v,_]=d(!1),y=n.trim(),g=u(((e,n)=>{n&&(r.current=n),t||_(!e),h(e)}),[t,r]);return i((()=>{const e=o.session.verificationTrigger.value;e&&(g(!0),o.session.unstable_updateVerificationTrigger(null),t&&[dn.LoginLink,dn.ErrorModalClearEmail].includes(e.source)&&(p(U.C1ModalShopPaySignIn),e.source===dn.ErrorModalClearEmail&&window.dispatchEvent(new Event("shop_pay_verification_reset"))))})),a((()=>{y!==r.current&&(_(!1),h(!1))}),[y,r]),a((()=>{_(!1)}),[e]),{modalUrlOrigin:l,modalUpdatedOrigin:s,shopPayVerificationVisible:m,showShopPayVerificationToggle:v,showShopPayVerification:g,setModalUpdatedOrigin:p,setShowShopPayVerificationToggle:_}}const gi=_n("EmailFieldAccessory");function bi({saved:e}){const{i18n:n}=w(),i=un(void 0,gi),o=n.translate("contact.field_saved_label"),[r,l]=d(!1);return a((()=>{if(e)return pn({content:o,role:"status"})}),[e,o]),t("span",{className:"iWrC7",children:[t(mn,{className:e?"aDczq":void 0,accessibilityLabel:n.translate("contact.field_tooltip_accessibility_label"),accessibilityVisibility:e&&!r?"hidden":"visible",onFocus:()=>l(!0),onBlur:()=>l(!1),interestFor:i,children:t(rn,{type:"question"})}),e?t("span",{className:"oMR3v","aria-hidden":!0,children:t(hn,{type:"small",tone:"neutral",children:o})}):null,t(vn,{id:i,children:n.translate("contact.field_tooltip_helper_text")})]})}function fi(e){return(e??"").trim().toLowerCase()}const ki="contact-information-text-field-container",Ci=`#${ki}`;function Pi({onInputTypeChange:e,onInlineEmailValidation:n,onInlinePhoneValidation:r}){const l=H(),{inMemoryPayPalParts:{accountStatus:u}}=j(),{i18n:h,observability:v,shop:_,shopPay:y,checkout:g,source:b}=w(),f=y.user.isUnauthenticatedUser.value,k=x(),C=ea(),{email:P,phone:I,smsMarketingPhone:S}=E(),L=P.value,A=I.value,[M,N]=d(P.peek()??""),[T,O]=d(k.value||""===I.peek()||""!==P.peek()&&P.peek()||f?"EMAIL":"PHONE"),[B,q]=d(0),W=h.translate("contact.email_or_phone_label"),Y=h.translate("field_errors.email_or_phone_invalid"),Q=function(e,n,t="PHONE"){const{phone:a}=E(),{observability:i,checkout:{validation:{contactErrors:{phoneInputError:o,emailInputError:r}},wallets:l}}=w(),c=l.activeSession.value;cn((e=>{if("EMAIL"!==t&&"error"===e.type)for(const t of e.violations)if("UnprocessableTermViolation"===t.__typename&&F.has(t.code)&&!ia(t.target))if("BUYER_IDENTITY_EMAIL_REQUIRED"===t.code){const e=t.localizedMessage??t.nonLocalizedMessage;o.value=e}else{const e=n||(t.localizedMessage??t.nonLocalizedMessage);o.value=e,r.value=void 0}}));const d=s(void 0),u=c?d:o;return z(a,u,(n=>
2{if(c)i.leaveErrorBreadcrumb("[useValidatedPhoneField] Not validating phone - wallet session active");else{if("EMAIL"!==t)return i.leaveErrorBreadcrumb("[useValidatedPhoneField] Validating phone number"),e(n);i.leaveErrorBreadcrumb("[useValidatedPhoneField] Skipping phone validation - input type is EMAIL")}}),V.InvalidContactMethod),R(a,u,"PHONE"===t?e:void 0)}(r,Y,T),X=$(_,C.value),J=k.value||f||!X.includes("PHONE"),Z=vi(),ee=""===M&&!L,ne=Z===D.Treatment&&"IN"===C.value&&!J&&ee?"tel":"email";function te(e,n){if("EMAIL"===T&&(N(e),f&&de(U.C1ModalShopPay)),!J)if(null!=n&&q(n),""===e)O("EMAIL"),m((()=>{I.value="",P.value="","PHONE"===T&&(S.value="")})),v?.leaveErrorBreadcrumb("[ContactInformation] Input type reset to EMAIL (both fields empty)");else{const n=/([A-Za-z]|\.|@)/.test(e);n&&"EMAIL"!==T?(v.leaveErrorBreadcrumb("[ContactInformation] Input type changed to EMAIL"),m((()=>{I.value="",P.value=e,S.value=""})),O("EMAIL")):n||"PHONE"===T||(v.leaveErrorBreadcrumb("[ContactInformation] Input type changed to PHONE"),P.value="",I.value=e,O("PHONE"))}}a((()=>{v.leaveErrorBreadcrumb("[ContactInformation] Component mounted")}),[v]),a((()=>{e&&e(T)}),[e,T]),a((function(){if(J)return void("EMAIL"!==T&&O("EMAIL"));const e=null!=L&&""!==L,n=null!=A&&""!==A;return e||n||"EMAIL"===T?e&&"EMAIL"!==T?(v.leaveErrorBreadcrumb("[ContactInformation] Input type synced to EMAIL from proposed contact info"),void O("EMAIL")):void(!e&&n&&"PHONE"!==T&&(v.leaveErrorBreadcrumb("[ContactInformation] Input type synced to PHONE from proposed contact info"),O("PHONE"))):(v.leaveErrorBreadcrumb("[ContactInformation] Input type reset to EMAIL from empty proposed contact info"),void O("EMAIL"))}),[L,T,v,J,A]);const ae=c(!0);a((function(){const e=ae.current;ae.current=!1,(!X.includes("PHONE")||f)&&"EMAIL"!==T&&(O("EMAIL"),""===L&&""!==A&&(I.value="",e||(P.value=A)))}),[X]),K((async({reason:e,parts:n})=>"progression"!==e?{behavior:"allow"}:{behavior:"allow",perform(){const e=n.phone.peek();""!==e&&n.deliveryLines.peek().forEach((n=>{const t=n.peek();n.value={...t,deliveryMethodOptions:{...t.deliveryMethodOptions,phone:e}}}))}}));const ie=sa(),{modalUrlOrigin:oe,modalUpdatedOrigin:re,shopPayVerificationVisible:le,showShopPayVerificationToggle:se,showShopPayVerification:ce,setModalUpdatedOrigin:de,setShowShopPayVerificationToggle:ue}=yi({emailInput:M,email:P.value,isShopPayUnauthenticatedUser:f}),pe=c(null),me=function(e,n,t="EMAIL"){const{email:a}=E(),{i18n:i,checkout:{validation:{contactErrors:{emailInputError:o,phoneInputError:r}},wallets:l},observability:c}=w(),{inMemoryApplePayParts:{asPaymentMethod:d,isLoadingPaymentSheet:u},inMemoryPayPalParts:{isLoadingPaymentSheet:p}}=j();cn((n=>{if("PHONE"!==t)if("error"===n.type)if(!l.activeSession.value||d.value)if("negotiation"!==n.negotiationStage||u.value||p.value){c.leaveErrorBreadcrumb(`[ContactInformation] Processing ${n.violations.length} violations`);for(const t of n.violations){if("UnprocessableTermViolation"!==t.__typename||!F.has(t.code)||ia(t.target))continue;const n=e||(t.localizedMessage??t.nonLocalizedMessage);o.value=n,r.value=void 0}}else c.leaveErrorBreadcrumb("[ContactInformation] Journey listener skipped - negotiation stage without wallet validation");else c.leaveErrorBreadcrumb("[ContactInformation] Journey listener skipped - wallet active without Apple Pay");else c.leaveErrorBreadcrumb(`[ContactInformation] Journey listener skipped - event type: ${n.type}`);else c.leaveErrorBreadcrumb("[ContactInformation] Journey listener skipped - input type is PHONE")}));const m=s(void 0),h=l.activeSession.value?m:o;return z(a,h,(e=>{if(l.activeSession.value)return void c.leaveErrorBreadcrumb("[ContactInformation] Not val
2idating email - wallet session active");if(n)return c.leaveErrorBreadcrumb("[ContactInformation] Using custom email validation"),n(e);c.leaveErrorBreadcrumb("[ContactInformation] Using default email validation");const t=Yt(e,i.translate("field_errors.email_blank")),a=Wt(e,i.translate("field_errors.email_invalid"));return t||a}),V.InvalidContactMethod),R(a,h,"EMAIL"===t?n:void 0)}(J?void 0:Y,"PHONE"===T?Ii:n,T),he=G(),ve=he.current.value.contactInfo?.email,_e=function(e,n){const t=o((()=>fi(e)),[e]),i=o((()=>fi(n)),[n]),[r,l]=d(!1),s=c(""!==t&&i===t);return a((()=>{const e=""!==t&&i===t,n=e&&!s.current;if(s.current=e,!e)return void l(!1);if(!n)return;l(!0);const a=setTimeout((()=>l(!1)),2e3);return()=>clearTimeout(a)}),[t,i]),r}(L??"",ve),ye=!b.isAbandonedCheckoutSupported||"EMAIL"!==T||ie.value&&se?void 0:t(bi,{saved:_e}),ge=_a({countryCode:C.value??"",label:W,onInputValueChange:te,caretPosition:B,inputMode:"text",disableFormatting:!0,required:!0,...Q}),be=J?void 0:{label:W,type:"text",caretPosition:B,inputMode:"text"},fe=function({ref:e,email:n,addressType:o="shipping",contactAutocompleteType:r="email",disabled:l,label:s,onInputValueChange:c,caretPosition:d,inputMode:u,type:p="email",required:m,accessory:h}){const{i18n:v,shopPay:_}=w();return a((()=>{if(void 0!==d&&e.current&&n?.value&&d<n.value.length)try{e.current.setSelectionRange(d,d)}catch{}}),[n.value,d,e]),function(){const{email:e}=E();i((()=>{"invalid"!==Wt(e.value,"invalid")&&document.cookie.includes("_tracking_consent=")}))}(),{label:s??v.translate("contact.email_label"),id:"email",name:"email",type:p,ref:e,autocomplete:kn([o,r]),disabled:l,inputMode:u,...n,onInput:async t=>{const a=t.trim();n.onInput(a),c?.(a,function(e){try{return e?.selectionStart}catch{}}(e.current)??0)},error:n.error,autoCapitalize:"text"===p?"off":void 0,accessoryEnd:"loading"===_.userVerification.value.status?t(Cn,{size:"small"}):h,required:m}}({email:me,ref:pe,addressType:g.isShippingRequired.value?"shipping":"billing",disabled:"loading"===u.value.status,required:!0,accessory:ye,contactAutocompleteType:ne,...be,onInputValueChange:te}),ke="PHONE"===T?ge:fe,Ce="PHONE"===T?null==A||""===A:ee,{isEnabled:Pe,impressionFeatures:Ie,fieldProps:Se}=function({fieldProps:e,countryCode:n,combinedFieldRendered:t,fieldIsEmpty:a}){const i=yn(),o=vi(),r=function(){const e=_i();return e===D.Control||e===D.Treatment}(),l="IN"===n&&t,s=c(void 0),d=c(void 0);l&&(s.current??=e.autocomplete??"none",d.current??=a);const u=c(!1);function p(t){const i=e.autocomplete??"none",l=Boolean(e.error);return[`variant:${o}`,`assigned:${r}`,`autocomplete:${s.current??i}`,`autocomplete_at_impression:${i}`,`untouched_at_first_paint:${d.current??a}`,`country:${n}`,`field_has_error:${l}`,`trigger:${t}`]}return{isEnabled:l,impressionFeatures:p("seen"),fieldProps:l?{...e,onFocus:()=>{e.onFocus?.(),u.current||(u.current=!0,i("impression",{impressionType:"contact_autocomplete_hint",impressionFeatures:p("focus"),timestamp:new Date}))}}:e}}({fieldProps:ke,countryCode:C.value,combinedFieldRendered:!J,fieldIsEmpty:Ce}),Le=ie.value&&se?t(hi,{onClick:()=>{ce(!0),f&&de(U.C1ModalShopPay)}}):null,Ae=ie.value?t(p,{when:l,children:t(mi,{popoverActivator:pe,popoverAnchorSelector:Ci,email:M,onSetEmail:e=>{me.onInput(e),te(e),me.onChange(e)},open:le,showPopover:ce,showToggle:ue,urlOrigin:oe,updatedOrigin:re})}):null,Me="PHONE"===T?"phone":"email",we=t(tn,{gap:"small-400",children:[t(gn,{id:ki,gridTemplateColumns:"minmax(0, 1fr) auto",gap:"none",children:[t(bn,{...Se,id:Me,error:Boolean(Se.error),segment:Le?"start":void 0}),Le]}),"string"==typeof Se.error&&Se.error?t(fn,{controlID:Me,children:Se.error}):null]});return t("div",{children:[t(ka,{impressionType:"contact_autocomplete_hint",impressionFeatures:Ie,enabled:Pe,children:we}),Ae]})}function Ii(){}function Si({showLogoutLink:e,logoutUrl:n}){const{i18n:i,shopPay:o,observability:r,source:l}=w(),s=B().buyerIdentity.value,{firstName:c,lastName:d,email:u,phone:p}=s?.customerProfile??{},m=s?.purchasingCompany?.company.name,v=sa(),_="simulated"===l.type,y=c||d,{phone:g}=E(),b=u??p,f=!m&&b?` (${b})`:"",{modalUrlOrigin:k,modalUpdatedOrigin:C,shopPayVerificationVisible:P,showShopPayVerification:I}=yi({isShopPayUnauthenticatedUser:o.user.isUnauthenticatedUser.value,email:u||""});return a((()=>{r.leaveErrorBreadcrumb(`[CustomerCard] Rendered - hasEmail: ${Boolean(u)}, hasPhone: ${Boolean(p)}`),s?.purchasingCompany||(g.value="")}
2),[]),t(h,{children:[t(tn,{direction:"inline",alignItems:"center",gap:"base",children:t(tn,{gap:"small-400",children:[t(hn,{children:y?`${i.translate("general.display_name",{firstName:c??"",lastName:d??""})}${f}`:f}),m?t(tn,{direction:"inline",gap:"small-400",children:[t(hn,{color:"subdued",type:"small",children:m}),u&&t(h,{children:[t(hn,{color:"subdued",type:"small",children:"â¢"}),t(hn,{color:"subdued",type:"small",children:u})]})]}):null,e&&!_?t(tn,{direction:"inline",gap:"base",children:t(Pn,{href:n,children:i.translate("customer_account.sign_out_link_label")})}):null]})}),u&&v.value&&t(mi,{email:u,open:P,showPopover:I,urlOrigin:k,updatedOrigin:C})]})}function Li(){const{i18n:e}=w();return t(hn,{color:"subdued",size:"small",accessibilityLive:"polite",children:e.translate("marketing.sms.disclaimer.description_transactional_html",{privacy_policy_modal_link:t(ma,{handle:"privacy-policy",tone:"monochrome"}),terms_of_service_modal_link:t(ma,{handle:"terms-of-service",tone:"monochrome"})})})}function Ai({hideAllOptIns:n=!1,hideContactInfoEntry:a=!1,hideCustomerCard:i=!1,showEmailMarketingOptIn:r=!0,onValidateEmailInput:l}){const s=B(),c=s.buyerIdentity.value?.customerProfile,p=In().value,m=Qe(),v=!1===m?.smsMarketingEnabled,{client:_,checkout:y,i18n:g,checkout:{validation:{contactErrors:{emailInputError:b,phoneInputError:f}},wallets:k},shop:C}=w(),{emailMarketing:P,contactInfoOptions:I}=C,S=_.unstable_getSerialization("logoutUrl")||"",{isContact:L}=ni().value,{showEmailMarketing:M}=y.configuration.visibility,N=C.hasFlagEnabled(q),{value:T}=s.buyerIdentity,O=T?.countryCode,[D,F]=d(r&&Mi({emailMarketing:P,inputType:"EMAIL",hideNonEuropeMarketingOptInFlagEnabled:N,buyerCountryCode:O,customerProfile:c,showEmailMarketing:M})),[z,V]=d(!1),R=ea(),{validatePhoneNumber:U}=ra(),{negotiate:H}=Je(),j=u((e=>{F(r&&Mi({emailMarketing:P,inputType:e,hideNonEuropeMarketingOptInFlagEnabled:N,buyerCountryCode:O,showEmailMarketing:M})),V(!1)}),[P,N,O,r,M]),K=function(){const{i18n:n,shop:t,shopPay:a}=w(),{shippingAddress:i}=E(),o=x();return e((()=>{const e=i.fields.countryCode.value,r=(e&&t.countrySpecific[e]?.contactInfoOptions)??t.contactInfoOptions;return o.value||a.user.isUnauthenticatedUser.value||!r.includes("PHONE")?n.translate("field_errors.email_blank"):n.translate("field_errors.email_or_phone_blank")}))}(),G=u((e=>{const n=Yt(e,K.value),t=Wt(e,g.translate("field_errors.email_invalid"));return n||t||l?.(e)}),[K,l,g]),Y=u((e=>{const n=Yt(e,g.translate("field_errors.email_or_phone_blank"));if(n)return V(!n),n;const t=U(e,R.value??"ZZ")?void 0:g.translate("field_errors.address_phone_blank");return V(!t),t}),[g,U,R]),Q=yn(),X=Sn(),J=u((({contact:e})=>{k.activeSession.value||H({silenceViolations:["all"],include:[],fieldsToResolve:[...Ln]}),e.value=!0,Q("sectionComplete",{section:"contact",timestamp:new Date}),X({type:"section_complete",section:"contact"})}),[k,H,Q,X]),Z=u((({contact:e})=>{e.value=!1}),[]),{email:ee,phone:ne}=E(),te=o((()=>({state:{phone:ne,email:ee},errors:{phone:f,email:b}})),[ee,b,ne,f]),ae=x(),ie=C.hasFlagEnabled(W)?$(C,R.value):I,oe=ae.value||!ie.includes("PHONE"),re=!c?.email&&!c?.phone||oe&&!c?.email;return t(A,{children:t(An,{target:"cart.buyerIdentity",children:[c&&!i&&t(Si,{showLogoutLink:p,logoutUrl:S}),!a&&re&&t(on,{...te,children:t(ca,{onValid:J,onInvalid:Z,children:t(Pi,{onInputTypeChange:j,onInlineEmailValidation:G,onInlinePhoneValidation:Y})})}),!n&&t(h,{children:[z&&!v?t(Li,{}):null,r&&D?t(ti,{}):null,L&&t(pi,{})]})]})})}function Mi(e){const{emailMarketing:n,inputType:t,hideNonEuropeMarketingOptInFlagEnabled:a,buyerCountryCode:i,customerProfile:o,showEmailMarketing:r}=e,l=a&&!Y(i);return r&&"OFF"!==n&&"EMAIL"===t&&!l&&!o?.acceptsEmailMarketing}function wi(){const e=Mn(),{editorSetShopPaySignal:n}=T(),t=u((e=>n.value?.setShopPay(e)),[n]);return{setEditorShopPay:e&&n.value?t:void 0}}function Ei(){const n=wn(),t=function(){const{checkout:n}=w(),t=da();return e((()=>t.value&&n.configuration.visibility.showExpressCheckout.value))}();return e((()=>n.value?"wallets":t.value?"skeleton":"hidden"))}Si.displayName="CustomerCard";const xi={ApplePayButton:"vT2w7",dark:"f1x20",light:"hKWGx"},Ni=r({displayName:"ApplePayButton",suspense:!1,renderLoading:e=>t(Oi,{...e}),useError:function(e){const{observability:n}=w(),{buttonStatus:t}=j().inMemoryApplePayParts;a((()=>{e&&(t.value={status:"error"},n.leaveErrorBreadcrumb("Apple Pay button chunk failed to load",{wallet:Sa.ApplePay,errorName:e.name,errorMessage:e.message}),n.counter({name:"checkout_wallet_button_rendered",value:1,attributes:{wallet_name:Sa.ApplePay,status:"error",reason:"chunk_load_error",isPaymentMethodFlow:!1}
2}))}),[t,e,n])},load:()=>l((()=>ga((async()=>{const{ApplePayButton:e}=await import("./d56ce0bb.DG_7cdr9.js");return{ApplePayButton:e}}),__vite__mapDeps([36,1,2,3,4,5,6,7,8,9,10,11,37,38,39,40,41,42,43,13,14,15,29,30,21,31,32,28,27,44,12,16,17,18,19,20,22,23,24,45,46,47,48,49,50,51,52,53,54,55])).then((({ApplePayButton:e})=>e))))});function Ti(e){const{source:n}=w(),{buttonStatus:a,sessionLoadFailed:i}=j().inMemoryApplePayParts;return Ta("ApplePay","simulated"!==n.type&&"not_rendered"===a.value.status&&!i.value),t(Ni,{...e})}function Oi({color:e}){const{i18n:n}=w();return t("button",{className:v(xi.ApplePayButton,xi[e],X.borderRadius,Q({focusRing:"base"})),lang:n.locale,disabled:!0,type:"button","aria-label":n.translate("brand.apple_pay")})}const Bi=r({displayName:"PortableWalletsPCIButtonContent",load:()=>ga((()=>import("./56bd1136.CIMEyGpu.js")),__vite__mapDeps([56,1,6,2,3,4,5,7,8,9,10,11,57,14,28,58,59,60,61])).then((e=>e.PortableWalletsPCIButtonContent)),useError:ua});function Di(e){return t(Bi,{...e})}const Fi="oHCaH";function zi(){const{shopPay:e,observability:n,checkout:{wallets:i}}=w(),o=e.app.config,r=La(Sa.ShopifyPay),l=Qt({foregroundColor:Va}),s=Ra(),c=J(o,s),d=oa(Z.DirectCheckoutCheckout),p=En(),m=xn(Sa.ShopifyPay),{setEditorShopPay:h}=wi();a((()=>{n.counter({name:"checkout_wallet_button_rendered",value:1,attributes:{wallet_name:"SHOP_PAY",status:"success"}})}),[n]);const _=u((()=>{r(Aa.Success),m(),i.setActiveSession({newValue:"SHOP_PAY",asPaymentMethod:!1}),i.clearActiveSession({invokingWallet:"SHOP_PAY"})}),[i,m,r]),y=u((e=>{if(h)return e.preventDefault(),void h(!0);_()}),[_,h]),g=v("Xicuw",{[Fi]:!l&&!c},X.borderRadius,Q({focusRing:"base"}));return t("a",{id:"shop-pay-button",href:d,ref:p("shop_pay"),className:g,onClick:y,children:"shop"===e.logoBrand?t(Xt,{size:"medium"}):t(Ca,{size:"medium"})})}function Vi(){const{i18n:e}=w();return t(Tn,{open:!0,blocking:!0,accessibilityLabel:e.translate("wallets.payment_in_progress_title"),padding:"none",children:t(tn,{gap:"large-200",padding:"large-200",children:[t(Nn,{level:1,children:e.translate("wallets.payment_in_progress_title")}),t(hn,{children:e.translate("wallets.payment_in_progress_body")})]})})}const Ri={Header:"o1z23",Text:"_4aXW0",Layout:"DUnBb",StackWrapper:"kTI19",SkeletonWrapper:"JH5oc",SkeletonExited:"Athif",ButtonWrapper:"pUo2R",loading:"_5SdgT",subsequentLoad:"RKgRy",Stack:"iRnuh",SimulatedWalletStack:"QKTth",ShopPayEmphasis:"Pnahu",Container:"OTERX",DrawerLink:"WTXfy",InnerDrawerLink:"qLVAT",DrawerHideButtons:"XHLFs",walletItem:"xBRI9"},Ui="express-checkout-heading";function Hi({buttonCount:e,footer:n,children:a}){const{i18n:i}=w();return t(Bn,{className:Ri.Container,"data-count":e,children:[t("div",{className:Ri.Header,children:t(On,{id:Ui,className:Ri.Text,children:i.translate("alternative_payment_method_banner.express_checkout")})}),t("div",{className:Ri.StackWrapper,children:[t("div",{className:Ri.Layout,children:a}),n]})]})}function ji({count:e,transition:n,shopPayEmphasis:a=!1,hideWallets:i=!1}){const{client:o}=w(),r="fast"!==o.unstable_getSerialization("workerVersion");return t("div",{className:v(Ri.Stack,Ri.SkeletonWrapper,{[Ri.SkeletonExited]:"exited"===n,[Ri.ShopPayEmphasis]:a,[Ri.DrawerHideButtons]:i}),children:[...Array(e).keys()].map((e=>t(Dn,{delay:r},e)))})}const $i=/(iPhone|iPod|iPad|Mac OS)/i,Ki=/((iPhone|iPod|iPad).*AppleWebKit(?!.*(Safari|instagram|FBAV|FB_IAB)))/i,Gi=/(ShopifyCheckoutSDK|CheckoutSheetProtocol|ShopifyCheckoutKit)/i;function qi(e,n,t){return{walletName:n,isRendered:()=>"rendered"===e.value?.status,isLoading:()=>"not_rendered"===e.value?.status&&(t?.()??!0),onTimeout:()=>{e.value={status:"error"}}}}function Wi({buttonCount:n,children:r,walletPaymentMethods:l}){const[s,m]=d(performance.now()),[y,g]=d(!0),b=function(){const{client:{userAgent:e},embed:n}=w(),t=Ki.test(e),a=$i.test(e)&&Gi.test(e),i=void 0!==n&&("SWIFT"===n.platform||"REACT_NATIVE_SWIFT"===n.platform);return!(a||t||i)}(),f=H(),{inMemoryApplePayParts:{paymentSheetError:k}}=j(),C=function(){const{source:n}=w(),t=function(){const n=j();return e((()=>ee.some((e=>function(e,n){const t=Boolean(e.acceleratedWalletPaymentMethods.value.find((e=>e.name===n))),a=(()=>{switch(n){case"APPLE_PAY":{const{buttonStatus:n,sessionLoadFailed:t}=e.inMemoryApplePayParts;return t.value?void 0:n.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 ne.AmazonPay:return e.inMemoryAmazonPayParts.buttonStatus.value;case ne.BuyWithPrime:return e.inMemoryAmazonPayParts.buyWithPrimeButtonStatus.value;default:return}})();
2return t&&"not_rendered"===a?.status}(n,e)))))}(),a="simulated"===n.type;return e((()=>!a&&t.value))}().value,P=function(){const{source:e}=w(),n="simulated"===e.type,{inMemoryApplePayParts:{buttonStatus:t,sessionLoadFailed:a},inMemoryPayPalParts:{acceleratedCheckoutButtonStatus:i},inMemoryVenmoParts:{buttonStatus:r},inMemoryGooglePayParts:{buttonStatus:l},inMemoryAmazonPayParts:{buttonStatus:s,buyWithPrimeButtonStatus:c},inMemoryShopPayParts:{buttonStatus:d},acceleratedWalletPaymentMethods:u}=j(),p=u.value;return o((()=>p.flatMap((e=>{switch(e.name){case"PAYPAL_EXPRESS":return qi(i,Sa.PayPalV6);case"VENMO":return qi(r,Sa.Venmo);case"GOOGLE_PAY":return qi(l,Sa.GooglePay);case"SHOP_PAY":return qi(d,Sa.ShopifyPay);case ne.AmazonPay:return qi(s,ne.AmazonPay);case ne.BuyWithPrime:return qi(c,ne.BuyWithPrime);case"APPLE_PAY":return qi(t,Sa.ApplePay,(()=>!n&&!a.value));default:return[]}}))),[t,a,p,s,c,l,n,i,d,r])}();Da(P),function(e){const{observability:n}=w(),t=c(performance.now()),a=o((()=>e.filter((({walletName:e})=>e!==Sa.ShopifyPay))),[e]),r=c(new Set),l=_(a);i((()=>{l.value.forEach((e=>{e.isRendered()&&!r.current.has(e.walletName)&&(r.current.add(e.walletName),n.histogram({name:"wallet_express_button_ready_time",value:performance.now()-t.current,unit:"ms",attributes:{wallet_name:e.walletName,isPaymentMethodFlow:!1}}))}))}))}(P);const I=B().managedByMarketsPro,S=Fn(C,"base"),[L,A]=d(!1),M=x(),{checkout:E,i18n:N,shop:{id:T},source:D,observability:F,userEvents:z}=w(),V=zn(),R=e((()=>f.value&&"full_express_agreement"===te({hasSubscription:ae({checkout:E}),isApplePayAvailable:l.value.some((({name:e})=>"APPLE_PAY"===e)),variant:V}))),U=Ma();wa(l.value,n);const $=u(((e,t)=>{const a=parseInt(O(T),10),i=Ea({state:t,shopId:a,nascarData:{...e,walletsRenderedCount:n},paymentMethods:l.value});i&&z.monorailEvent(i)}),[T,z,n,l]),K=l.value.some((e=>"SHOP_PAY"===e.name))&&b;C||L||(A(!0),m((e=>performance.now()-e))),a((()=>{L&&F.histogram({name:"wallets_container_render_time",value:s})}),[L,F,s]);const G=c(!1);return a((()=>{"simulated"===D.type||"exited"!==S||G.current||(G.current=!0,performance.mark(ie))}),[D,S]),t(h,{children:[t(Hi,{buttonCount:n,footer:t(h,{children:[t("div",{className:Ri.DrawerLink,children:t(Pn,{accessibilityLive:"polite",textDecoration:"none",onClick:()=>{y?(g(!1),$(U.value,Aa.NascarDrawerOpen)):(g(!0),$(U.value,Aa.NascarDrawerClose))},children:t("div",{className:Ri.InnerDrawerLink,children:[t(hn,{children:y?N.translate("alternative_payment_method_banner.show_more_options"):N.translate("alternative_payment_method_banner.hide_more_options")}),t(rn,{type:y?"chevron-down":"chevron-up",size:"small-200"})]})})}),t(p,{when:M,children:t(Fa,{isForExpressCheckout:!0,showFullSubscriptionConsent:R})}),t(p,{when:I,children:t(tn,{gap:"base",padding:"large-100 none none none",children:t(Ua,{textProps:{color:"subdued",size:"small"}})})})]}),children:[t(ji,{count:Math.min(n,4),transition:S,shopPayEmphasis:K,hideWallets:y}),t("ul",{id:"express-checkout-wallets-wrapper",role:"list",className:v(Ri.Stack,Ri.ButtonWrapper,{[Ri.loading]:C,[Ri.subsequentLoad]:C&&L,[Ri.DrawerHideButtons]:y,[Ri.ShopPayEmphasis]:K}),children:f.value&&r})]}),"payment_cancelled_while_processing"===k?.value?.type&&t(Vi,{})]})}function Yi(){const{i18n:e}=w(),{divider:{borderStyle:n,borderWidth:a}}=Vn(),{main:{divider:{borderStyle:i=n,borderWidth:o=a}={},section:r,spacing:l}}=Rn(),s=oe(r);return t(Bn,{padding:s?`@media (inline-size >= extraSmall) ${l?le(l):"large-200"} none, ${l?le(l):"base"} none`:"large-100 none large-300 none",children:t(Un,{borderStyle:i,borderWidth:re(o),children:t(en,{textAlign:"center",children:t(hn,{color:"subdued",children:e.translate("alternative_payment_method_banner.or")})})})})}function Qi(){return t(h,{children:[t(Hn,{accessibilityLabelledBy:Ui,children:t(Hi,{buttonCount:3,children:t(ji,{count:3,shopPayEmphasis:!0})})}),t(Yi,{})]})}const Xi=e=>e,Ji=y((function(){const{i18n:e,source:n}=w(),a="simulated"===n.type,{acceleratedWalletPaymentMethods:i,buttonCount:o}=j(),r=jn(),l=Ei(),{setEditorShopPay:s}=wi(),{expressCheckout:{button:{cornerRadius:c}={}}}=Rn(),d=$n("Checkout::Dynamic::Render","WALLETS1"),u=Kn(),p=a&&u.value&&!i.value.length;switch(l.value){case"hidden":return null;case"skeleton":return t(Qi,{})}const m=t("li",{className:Ri.walletItem,children:t(Bn,{padding:"large-200",borderRadius:"base",blockAlignment:"center",inlineAlignment:"center",minInlineSize:"100%",className:"_2SmAP",children:t(hn,{color:"subdued",children:e.translate("payment.simulated_express_checkout")})})});return t("div",{style:{...eo(c)},children:[t(Hn,{accessibilityLabelledBy:Ui,children:t(Gn,{sectionId:"expressCheckout",children:t(qn,{section:"expressCheckout",children:[t(Wn,{customizations:d,gap:"large-200",render:Xi}),d.length>0&&t(Yn,{blockSize:"large-200"}),t(Wi,{buttonCount:p?1:o,walletPaymentMethods:i,children:p?m:t(Zi,{paymentMethods:i.value,triggerProgression:r.value,isSimulated:a,preserveShopPay:Boolean(s)})})]})})}),t(Yi,{})]})}));function Zi({paymentMethods:e,triggerProgression:n,isSimulated:a,preserveShopPay:i}){const o=Qn(),r=Pa();return t(h,{children:e.map((e=>{if(a&&"VENMO"===e.name)return null;const l=a&&"SHOP_PAY"===e.name&&i;return t("li",{className:Ri.walletItem,children:a&&!l?t(Bn,{className:"eFu6h",children:t(Bn,{className:v([Ri.walletButton,Ri.Stack,Ri.SimulatedWalletStack]),inert:!0,children:t(no,{method:e,triggerProgression:n})})}):t(no,{method:e,triggerProgression:n})},`${e.name}-${o}-${r.value}`)}))})}function eo(e){return e&&{"--x-express-checkout-button-border-radius":(n=se.borderRadius,e=>e?n[e]:void 0)(e)};var n}function no({method:e,triggerProgression:n}){const a=Qn();switch(e.name){case"APPLE_PAY":return t(Ti,{supportedNetworks:e.supportedNetworks,color:a});case"PAYPAL_EXPRESS":return t(za,{progressToNextPage:n});case"VENMO":return t(za,{fundingSource:"venmo",buttonColor:"blue",progressToNextPage:n});case"SHOP_PAY":return t(zi,{});case"GOOGLE_PAY":return t(Ia,{});case ne.AmazonPay:return t(pa,{});case ne.BuyWithPrime:return t(Di,{wallet:ne.BuyWithPrime});default:return null}}const to=["ApplePay","GooglePay","PayPal","Venmo"];function ao({id:e}){return Oa({id:e,stage:({pendingComponents:e})=>to.some((n=>e.has(n)))?Ba.Usable:Ba.Complete}),null}function io(){const e=B(),n=e.buyerIdentity.value?.customerProfile,{i18n:a}=w(),i=Xn().value,{value:o}=e.buyerIdentity,r=E().rememberMe,l=Boolean(o?.rememberMe)||r.value,c=s(l),{negotiate:d}=Je(),p=Qe(),m=p?.saveShippingAddressCheckboxEnabled??!0,h=Boolean(n),v=E().shippingAddress.value,_=!i&&m&&!h&&!v.oneTimeUse,y=u((e=>{c.value=e,r.value=e,d({})}),[d,r,c]);return _?t(nn,{id:"save_shipping_information",name:"save_shipping_information",checked:c.value,onChange:y,label:a.translate("customer_account.save_my_information_label")}):null}
2function oo(e,n){return n.some((n=>e.includes(n)))}function ro({options:n,selected:a,select:i}){const{i18n:o,source:r}=w(),l="simulated"===r.type,s=B(),c=s.deliveryNext,d=s.paymentLines,u=ce("deliveryNext"),m=e((()=>{const e=de(c.value,"ONE_TIME_PURCHASE"),n=void 0!==ue(d?.value?.lines,"APPLE_PAY"),t="available"===e?.status&&!u.value&&e.hasDeliveryLineChange;return!n&&t}));return t(h,{children:[t(p,{when:m,children:()=>t(Jn,{tone:"warning",errorType:Zn.DeliveryError,children:o.translate("shipping_errors.shipping_method")})}),l&&n.map((e=>t(Gn,{sectionId:`deliveryMethods-${e.id}`},e.id))),t(Ka,{name:"delivery_strategies",title:o.translate("general.choose_delivery_strategy"),titleHidden:!0,values:a,onChange:i,children:n.map((e=>t(Ha,{value:e.id,accessibilityLabel:e.label,secondaryContent:t(rn,{type:e.icon,tone:oo(a,e.value)?"accent":void 0}),children:e.label},e.id)))})]})}const lo=g(null);var so={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 co({name:e,label:n,labelAccessibilityVisibility:a="visible",contentDirection:i="auto",selected:r,onChange:l,children:s}){const c=u((e=>l(e)),[l]),d=o((()=>({name:e,selected:r,select:c,contentDirection:i})),[e,r,c,i]);let p;n&&"exclusive"===a?p=t("legend",{className:Q({screenReaders:"only"}),children:n}):n&&(p=t("legend",{className:so.Legend,children:t(Nn,{level:3,accessibilityRole:"presentation",children:n})}));const m=t("div",{className:so.Segments,"data-choice-list-segmented-part":"control",children:s});return t(lo.Provider,{value:d,children:n?t("fieldset",{className:so.Fieldset,children:[p,m]}):m})}function uo({value:e,children:n,icon:a,secondaryContent:i,accessibilityLabel:o}){const r=b(lo),l=et();if(!r)return console.warn(`Unable to render ChoiceSegmented (value: "${e}"). Verify it is a child of ChoiceListSegmented.`),null;const{name:s,selected:c,select:d,contentDirection:u}=r,p=c===e;return t("label",{className:v(so.ChoiceSegmented,p&&so.ChoiceSegmentedSelected,l&&so.inert),"data-choice-list-segmented-part":"segment",children:[t("input",{id:`${s}-${e}`,type:"radio",name:s,value:e,checked:p,disabled:l,"aria-label":o,"aria-hidden":!!l||void 0,tabIndex:l?-1:void 0,className:so.Input,onChange:()=>d(e)}),t("span",{className:v(so.PrimaryContent,so.contentDirectionVariant[u]),children:[a&&t(rn,{type:a,color:"strong"}),t(hn,{type:"strong",children:n})]}),i&&t(hn,{color:"subdued",children:i})]})}function po(){const{i18n:e}=w(),n=B(),a=ce("deliveryNext").value,i=de(n.deliveryNext.value,"ONE_TIME_PURCHASE"),o=n.paymentLines?.value?.lines;return void 0===ue(o,"APPLE_PAY")&&"available"===i?.status&&!a&&i?.hasDeliveryLineChange?t(Jn,{tone:"warning",errorType:Zn.DeliveryError,children:e.translate("shipping_errors.shipping_method")}):null}const mo="PICK_UP_AND_SHIP";function ho(e,n){switch(e){case"PICK_UP":return n.translate("split_delivery.pickup_all_items");case"SHIPPING":return n.translate("split_delivery.ship_all_items");default:f(e)}}function vo(e){return"PICK_UP"===e.id||"SHIPPING"===e.id}function _o({options:e,selectedIndex:n,select:a}){const{i18n:i,observability:o}=w(),r=u((e=>{e!==mo&&a([e])}),[a]),l=e.filter(vo),s=c(!1);if(!s.current&&l.length<e.length){s.current=!0;const n=e.filter((({id:e})=>"PICK_UP"!==e&&"SHIPPING"!==e)).map((({id:e})=>e)).join(", ");o.log("split_ship_pickup_delivery_method_selector","Unexpected delivery method options for split ship/pickup selector",{optionIds:n})}return t("div",{className:v("qX6SV",Q({colorLayer:"control"})),style:{"--option-count":e.length,"--selected-index":n},children:t(nt,{name:"delivery_strategies",value:mo,onChange:r,children:[t(tt,{value:mo,children:i.translate("split_delivery.pickup_and_ship")}),l.map((({id:e})=>t(tt,{value:e,children:ho(e,i)},e)))]})})}
2const yo="_207IL";function go({options:a,selected:i,select:o,showChangedBanner:r=!0}){const{i18n:l,source:c}=w(),d="simulated"===c.type,m=B(),{value:h}=m.deliveryNext,_=at(),y=de(h,"ONE_TIME_PURCHASE"),{deliveryMethodSelectorClickEvent:g}=function(e){const{source:n,userEvents:t,shop:{id:a},checkout:{identity:i}}=w(),o="shopPay"===i.current.value,r=B().buyerIdentity.value?.customerProfile;return{deliveryMethodSelectorClickEvent:function(i){let l;switch(i){case"SHIPPING":l="checkout_shipping_tab_clicked";break;case"PICK_UP":l="checkout_pickup_tab_clicked";break;case"PICKUP_POINT":l="checkout_pickup_point_tab_clicked"}if(!l)return;const s=e&&"methods"in e?e?.methods.length:void 0;t.monorailEvent({schemaId:"local_pickup_checkout/3.1",payload:{checkoutToken:n.checkoutSessionIdentifier||"",eventType:l,shopId:parseInt(O(a),10),numberLocationsFound:s,userId:r?.id?parseInt(O(r.id),10):void 0,checkoutSurface:o?"shop_pay":"guest_checkout"}})}}}(y),b=e((()=>!_.value)),f=s(!1);n((()=>{let e=_.peek();return k((()=>{const n=_.value;e&&!n&&(f.value=!0),e=n}))}),[_,f]);const P=u((()=>{f.value=!1}),[f]),I=u((([e])=>{if(!e||i.value.includes(e))return;const n=a.value.findIndex((e=>e.id===i.value[0])),t=a.value.findIndex((n=>n.id===e));fa((()=>{o([e])}),[t>n?"delivery-slide-end":"delivery-slide-start"]),g(e)}),[o,i,g,a]),S=e((()=>a.value.findIndex((e=>e.id===i.value[0])))),L=e((()=>a.value.length)),A=e((()=>a.value.some((e=>e.label.length>16))));return t("div",{className:"SnB3D",children:[r&&t(po,{}),d&&t(C,{each:a,getKey:e=>e.id,children:e=>t(Gn,{sectionId:`deliveryMethods-${e.id}`})}),t(p,{when:b,fallback:t(_o,{options:a.value,selectedIndex:S.value,select:o}),children:t("div",{style:{"--selected-index":S.value,"--option-count":L.value},className:v("wvTT8",{[yo]:f.value}),onAnimationEnd:P,children:t(co,{name:"delivery_method",label:l.translate("general.choose_delivery_strategy"),labelAccessibilityVisibility:"exclusive",selected:i.value[0],onChange:e=>I([e]),contentDirection:A.value?"block":"auto",children:t(C,{each:a,getKey:e=>e.id,children:({id:e,label:n,icon:a})=>t(uo,{value:e,icon:a,children:n})})})})})]})}function bo(){const e=it();if(!e)return null;const{variant:n,...a}=e;return"next"===n?t(go,{...a}):t(ro,{options:a.options.value,selected:a.selected.value,select:a.select})}function fo({message:e}){return e?t(Jn,{errorType:Zn.DeliveryError,tone:"critical",children:t(tn,{alignItems:"start",gap:"small-500",children:t(hn,{children:e})})}):null}function ko(){const{i18n:e,url:n,client:a}=w(),i=a.unstable_getSerialization("apiClientId"),o=st(i),r=E().shippingAddress.value,{href:l,onClick:s}=ot(),{countryName:c,loading:d}=rt(r),{hasViolations:u}=lt(pe);if(!u)return null;if(o)return t(fo,{message:t(h,{children:e.translate("merchant_redirect.shop_app_not_supported",{storefront_link:t(Pn,{href:n.storefront(),children:e.translate("contact.storefront_link")})})})});const p=d?r.countryCode:c;return t(fo,{message:t(h,{children:e.translate("payment_errors.payment_method_not_supported",{country:p,checkout_as_guest_link:t(Pn,{href:l,onClick:s,children:e.translate("account_management.checkout_as_guest_link")})})})})}function Co(){const{negotiate:e}=Je(),{deliveryLines:n,merchandiseLines:t,discountLines:a}=E();return i=>{me({deliveryLines:n,merchandiseLines:t,merchandiseStableIds:i,discountLines:a}),e({include:["deliveryNext","merchandiseLines"]})}}function Po(e){return"shopPay"===e.current.value?"shop_pay":"guest_checkout"}function Io(e){requestAnimationFrame((()=>{pn({content:e,role:"status"})}))}function So({merchandiseLines:e,bannerType:n,allowAlternativeAction:a}){const{i18n:i}=w(),r=ct(),l=Co(),s=he(),c=xa(),d="pickup"===n,p=Array.from(new Map(e.value.map((e=>[e.stableId,e]))).values()),m=p.map((({stableId:e})=>e)),v=new Map;for(const t of p){const e=v.get(t.digest);e?v.set(t.digest,{...e,quantity:e.quantity+t.quantity}):v.set(t.digest,t)}const _=Array.from(v.values()),y=p.reduce(((e,{quantity:n})=>e+Math.max(1,n)),0),g=d?"SHIPPING":"PICK_UP",{deliveryMethodsByMerchandise:b}=s.value,f=p.filter((({stableId:e})=>b[e]?.includes(g))),k=f.map((({stableId:e})=>e)),C=f.reduce(((e,{quantity:n})=>e+Math.max(1,n)),0),P=(a?.value??!0)&&!c.value&&k.length===m.length&&C>0,I=function({allLinesAlternativeEligible:e,isPickupBanner:n,variantIds:t}){const{userEvents:a,shop:i,source:r,checkout:{identity:l}}=w(),{merchandiseLines:s}=B();let c="remove_only";e&&(c=n?"remove_or_switch_to_shipping":"remove_or_switch_to_pickup");const d=n?"pick-up":"shipping",p=t.join(","),m=o((()=>t.map((e=>{if(e)try{return parseInt(O(e),10)}catch{return}})).filter((e=>void 0!==e))),[p]);return u((e=>{const n={schemaId:"checkout_inventory_split_buyer_decision/2.0",payload:{shopId:parseInt(O(i.id),10),checkoutToken:r.checkoutSessionIdentifier??"",productVariantIds:m,bannerType:c,buyerAction:e,deliveryMethodType:d,checkoutSurface:Po(l),sourceName:"checkout_one",checkoutProductVariantsCount:s.value?.lines.length}};a.monorailEvent(n)}),[c,d,l,s,a,m,i,r])}({allLinesAlternativeEligible:P,isPickupBanner:d,variantIds:p.map((e=>e.variantId))});if(0===p.length)return null;const S=d?i.translate("split_delivery.inventory_issue_banner.heading.cannot_be_picked_up",{count:y}):i.translate("split_delivery.inventory_issue_banner.heading.cannot_be_shipped",{count:y}),L=P?i.translate("split_delivery.inventory_issue_banner.remove_item",{count:y}):i.translate("split_delivery.inventory_issue_banner.remove_item_only",{count:y}),A=d?i.translate("split_delivery.inventory_issue_banner.ship_separately",{count:C}):i.translate("split_delivery.inventory_issue_banner.pick_them_up_in_store",{count:C}
2),M=_.map((({title:e,subtitle:n,quantity:t})=>{const a=n?`${e} / ${n}`:e;return t>1?i.translate("split_delivery.inventory_issue_banner.merchandise_line_with_quantity",{title:a,quantity:t}):a})).join(", "),E=()=>{I("switch_delivery_method"),r({targetDeliveryMethodType:g,merchandiseStableIds:k}),Io(d?i.translate("split_delivery.accessibility.status.ship_separately",{items:M}):i.translate("split_delivery.accessibility.status.pickup_in_store",{items:M}))},x=t(Pn,{onClick:()=>{I("remove_items"),l(m),Io(i.translate("split_delivery.accessibility.status.remove_items",{items:M}))},children:L});let N=x;if(P){const e=t(Pn,{onClick:E,children:A});N=t(h,d?{children:i.translate("split_delivery.inventory_issue_banner.remove_items_or_ship",{ship_separately_link:e,remove_items_link:x})}:{children:i.translate("split_delivery.inventory_issue_banner.remove_items_or_pickup",{pickup_in_store_link:e,remove_items_link:x})})}return t(Jn,{tone:"critical",errorType:Zn.DeliveryError,heading:S,children:t(tn,{gap:"small-300",children:[t(dt,{gap:"small-300",children:_.map((({stableId:e,title:n,subtitle:a,quantity:o})=>{const r=a?`${n} / ${a}`:n;return t(ut,{children:o>1?i.translate("split_delivery.inventory_issue_banner.merchandise_line_with_quantity",{title:r,quantity:o}):r},e)}))}),t(hn,{children:N})]})})}const Lo=["DELIVERY_NO_DELIVERY_STRATEGY_AVAILABLE_FOR_MERCHANDISE_LINE","MERCHANDISE_OUT_OF_STOCK_IN_CONTEXT"];function Ao(n){const{shop:{shipPickupInOneOrderEnabled:t}}=w(),{allViolations:a,merchandiseLines:i,deliveryNext:o}=B(),r=he(),l=at(),{deliveryLines:s,merchandiseLines:c}=E();return e((()=>{const e=Boolean(!(!o.value||!("supportsSplitDeliveryMethod"in o.value))&&o.value.supportsSplitDeliveryMethod),d={allViolations:a.value,deliveryMethodsByMerchandise:r.value.deliveryMethodsByMerchandise,isSplitShipAndPickup:l.value,negotiatedMerchandiseLines:i.value,proposedDeliveryLines:s.value,proposedMerchandiseLines:c.value},u=t&&e;return"localPickup"===n.mode?function({canUseDeliveryMethodScopedViolations:e,state:n}){if(e){const e=Mo({deliveryMethodType:"PICK_UP",suppressUnscopedPickupViolations:n.isSplitShipAndPickup,state:n});if(e.length>0)return{merchandiseLines:e,allowAlternativeAction:!0}}return n.isSplitShipAndPickup?{merchandiseLines:[],allowAlternativeAction:!1}:(t=n.negotiatedMerchandiseLines,(t?.lines.filter((({requiresShipping:e})=>e)).length??0)>1?{merchandiseLines:Mo({deliveryMethodType:"PICK_UP",suppressUnscopedPickupViolations:!1,state:n}),allowAlternativeAction:!1}:{merchandiseLines:[],allowAlternativeAction:!1});var t}({canUseDeliveryMethodScopedViolations:u,state:d}):u?function({deliveryMethodType:e,state:n}){return{merchandiseLines:Mo({deliveryMethodType:e,suppressUnscopedPickupViolations:"PICK_UP"===e&&n.isSplitShipAndPickup,state:n}),allowAlternativeAction:!0}}({deliveryMethodType:n.deliveryMethodType,state:d}):{merchandiseLines:[],allowAlternativeAction:!1}}))}function Mo({deliveryMethodType:e,suppressUnscopedPickupViolations:n,state:{allViolations:t,deliveryMethodsByMerchandise:a,negotiatedMerchandiseLines:i,proposedDeliveryLines:o,proposedMerchandiseLines:r}}){const l=function(e,n,t){function a(e){const a=n[e]??[];return t.some((e=>a.includes(e)))}return e.flatMap((e=>e.lineComponents.length>0?e.lineComponents.filter((e=>!a(e.stableId))):a(e.stableId)?[]:[e]))}(t&&i?pt(t,i,Lo)??[]:[],a,[e]);return function({violationLines:e,deliveryMethodType:n,proposedDeliveryLines:t,proposedMerchandiseLines:a}){const i=new Set(t.filter((e=>{return t=e.value.deliveryMethodTypes,a=n,0!==t.length&&("PICK_UP"===a?t.every((e=>"SHIPPING"===e||"LOCAL"===e)):t.every((e=>"PICK_UP"===e)));var t,a})).flatMap((e=>e.value.targetMerchandiseLines??[])).map((e=>e.stableId))),o=a.length>0;return e.filter((e=>{const n=ve(a,e.stableId),t=n?.stableId??e.stableId;return!(i.has(e.stableId)||i.has(t)||o&&null==n)}))}({violationLines:n?l.filter((e=>(a[e.stableId]??[]).length>0)):l,deliveryMethodType:e,proposedDeliveryLines:o,proposedMerchandiseLines:r})}function wo(e){return"LOCAL"===e?"SHIPPING":e}function Eo(){const{violations:n}=lt(_e),{client:i,i18n:o,shop:r,source:l,observability:s,url:u,embed:m,checkout:h}=w(),{merchandiseLines:v,shippingAddress:_}=E(),{countryName:y,loading:g}=rt(_.value),{value:b}=B().merchandiseLines,{negotiate:f}=Je(),k=mt(),{negotiating:C,methods:P}=ht(),{loading:I}=G(),S=c(k.peek()),L=c(I.peek().has("deliveryNext")),A=e((()=>{const e=I.value.has("deliveryNext"),n=L.current&&!e;return k.value?S.current=!0:n&&(S.current=!1),L.current=e,S.current})).value,{cartUpdated:M,setCartUpdated:x}=function(){const[e,n]=d(!1),t=G(),i=c(0);return a((()=>{Date.now()<i.current||n(!1)}),[t.lastNegotiation.value]),{cartUpdated:e,setCartUpdated:function(){i.current=Date.now()+1e3,n(!0)}}}(),N=yn(),[T,O]=d(void 0),D=Boolean(m);a((()=>{n.size>0&&O(y)}),[n]);const F=Ao({deliveryMethodType:"SHIPPING",mode:"deliveryMethodScoped"}),z=e((()=>F.value.merchandiseLines)),V=e((()=>F.value.merchandiseLines.length>0));if(!b||0===b.lines.length||g||T!==y)return null;if(A)return null;if(M)return t(vt,{heading:o.translate("merchandise_unavailable_in_buyer_location.cart_updated"),tone:"info"});if(0===n.size)return null;if(r.shipPickupInOneOrderEnabled&&C.value&&function(e){const n=new Set(e.map(wo));return 1===n.size?n.has("SHIPPING")||n.has("PICK_UP")||n.has("PICKUP_POINT"):2===n.size&&n.has("SHIPPING")&&n.has("PICK_UP")}(P.value))return null;const R=pt(Array.from(n),b,Array.from(_e)),U=R?.map((({stableId:e})=>e)),H=v.value.filter((({stableId:e})=>!U?.includes(e))),j=0===H.length,$=t(So,{bannerType:"shipping",merchandiseLines:z});if(null==R)return V.value?$:null;const K=Array.from(n).some((({code:e})=>"MERCHANDISE_PRODUCT_NOT_PUBLISHED_IN_BUYER_LOCATION"===e))?y??o.translate("merchandise_unavailable_in_buyer_location.missing_country_fallback"):o.translate("merchandise_unavailable_in_buyer_location.indeterminate_location_fallback");let q=null;q=j&&1===R.length?o.translate("merchandise_unavailable_in_buyer_location.banner_title.all_products_one",{location_name:K}):j?o.translate("merchandise_unavailable_in_buyer_location.banner_title.all_products_other",{location_name:K}):1===R.length?o.translate("merchandise_unavailable_in_buyer_location.banner_title.some_products_one",{location_name:K}):o.translate("merchandise_unavailable_in_buyer_location.banner_title.some_products_other",{location_name:K});const W=j?null:t(dt,{children:R.map((e=>
2t(ut,{children:e.subtitle?o.translate("merchandise_unavailable_in_buyer_location.unavailable_line_item",{product_name:e.title,variant_label:e.subtitle}):e.title},e.stableId)))}),Y=1===R.length?o.translate("merchandise_unavailable_in_buyer_location.remove_items_action.one"):o.translate("merchandise_unavailable_in_buyer_location.remove_items_action.other"),Q=o.translate("merchandise_unavailable_in_buyer_location.empty_cart_action");const X=t(hn,{children:j?!j||!D&&r.hasStorefront?o.translate("merchandise_unavailable_in_buyer_location.change_address_or_remove",{remove_action:t(Pn,{onClick:function(){N("click",{element:{tagName:"a",textContent:Q},section:"delivery",timestamp:new Date}),s.log("redirect_to_storefront","[UnavailableInBuyerLocationBanner] Empty cart and redirect to storefront",{allItemsUnavailable:j,redirectSuccess:r.hasStorefront}),_t({client:i,url:u,source:l,configuration:h.configuration})},children:Q})}):o.translate("merchandise_unavailable_in_buyer_location.change_address_only"):o.translate("merchandise_unavailable_in_buyer_location.change_address_or_remove",{remove_action:t(Pn,{onClick:function(){N("click",{element:{tagName:"a",textContent:Y},section:"delivery",timestamp:new Date}),v.value=H,f({onComplete:x})},children:Y})})}),J=t(ka,{impressionType:"unavailable_in_buyer_location",impressionFeatures:Array.from(n).map((({code:e})=>e)),children:t(Jn,{heading:q,tone:"critical",children:t(tn,{gap:"base",children:[W,X]})})});return t(p,{when:V,fallback:J,children:$})}function xo({selectedAddress:e,shouldAddressModalSetAsDefault:n}){const{checkout:{address:a,identity:i},i18n:o}=w(),r=E().shippingAddress.value,l=rt(r),{createAddressParts:s}=T(),c=u((e=>{s.addressModalState.value={status:"editing",address:ye(e.address,{extendedAddressMode:a.extendedAddressMode}),addressType:"shipping",addressId:e.id,setAsDefault:n?"default":"disabled"}}),[a.extendedAddressMode,s.addressModalState,n]),d=e?t(Pn,{tone:"monochrome",onClick:()=>c(e),children:o.translate("shipping.address_update")}):o.translate("shipping.address_update"),{hasViolations:p}=lt(ge),{hasViolations:m}=lt(be),{hasViolations:h}=lt(fe),{hasViolations:v}=lt(pe),{hasViolations:_}=lt(_e),y=function({identity:e,hasMerchandiseUnavailableInBuyerLocationViolations:n,hasUnsupportedPaymentMethodViolations:a}){return"shopPay"!==e.current.value?null:n?t(Eo,{}):a?t(ko,{}):null}({identity:i,hasMerchandiseUnavailableInBuyerLocationViolations:_,hasUnsupportedPaymentMethodViolations:v});if(y)return y;let g=o.translate("shipping_errors.invalid_selected_address");return m?g=o.translate("customer_account.incomplete_address",{update_address_link:d}):p?g=l.loading?t(tn,{children:[t(yt,{inlineSize:"large"}),t(yt,{inlineSize:"small"})]}):o.translate("shipping_errors.shipping_method_not_available_generic.one"):(h||Boolean(e))&&(g=o.translate("shipping_errors.invalid_selected_address_with_update_link",{update_address_link:d})),t(fo,{message:g})}function No(){const{checkout:e,client:n}=w(),i=e.addressManager.shipping.value.selectedAddress.value,o=Boolean(i?.default),r=n.unstable_getSerialization("apiClientId"),l=gt(),s=c(!1),{hasViolations:d}=lt(ge),{hasViolations:u}=lt(ke),p=st(r);return a((()=>{(d||u)&&p&&!s.current&&(l.notify(d?{no_delivery_strategy_available:!0}:{out_of_stock_at_origin:!0}),s.current=!0)}),[d,u,p,l]),t(xo,{selectedAddress:i,shouldAddressModalSetAsDefault:o})}function To({name:e,variant:n="content",children:a}){return P((()=>ga((()=>Promise.resolve({})),__vite__mapDeps([62])))),t("div",{className:`delivery-transition-${n}`,style:{"--delivery-view-transition-name":e||void 0},children:a})}const Oo={MILES:100,KILOMETERS:200};function Bo(e,n){const t=n&&("MILES"===n.unit?"mi":"km"),a=n&&n.value<100?1:0;return[n&&e.numberFormatter({minimumFractionDigits:0,maximumFractionDigits:a}).format(n.value),t].join(" ").trim()}function Do(e){const{pickupLocation:n}=e;return n&&"distanceFromBuyer"in n?n.distanceFromBuyer:void 0}const Fo=e=>e.every((e=>{const n=Do(e);return n?.value&&n.value>Oo[n.unit]}));function zo({postalCode:e,city:n,zoneCode:t}){const a=["address2","company","firstName","lastName","phone"];return e?[...a,"zoneCode","city","address1","countryCode"]:n?[...a,"zoneCode","address1","countryCode"]:t?[...a,"zoneCode"]:[...a,"address1"]}function Vo(e,n){const t=e.lastIndexOf(",");if(-1===t)return e.length>n?`${e.slice(0,n)}...`:e;const a=e.slice(0,t),i=e.slice(t);return a.length>n?`${a.slice(0,n)}...${i}`:e}function Ro(){const{locationAddress:e}=E(),n=e.peek(),{countryCode:t,postalCode:a,city:i}=n,o=Boolean(t&&!a&&!i),{details:r}=Ce(t);return{isOnlyCountryAvailable:o,fullCountryName:r?.name||void 0,formattedAddress:bt(n,{hiddenFields:zo(n),multiline:!1,countryFormat:"explicit"})}}function Uo({onClick:e,commandFor:n}){const{i18n:a}=w(),{formattedAddress:i}=Ro(),o=a.translate("local_pickup.toggle_location");return t(ln,{variant:"plain",textDecoration:"none",inlineAlignment:"start",accessibilityLabel:i?`${o}, ${i}
2`:o,onClick:e,commandFor:n,children:i?t(tn,{direction:"inline",gap:"small-500",alignItems:"center",children:[t(rn,{type:"geolocation",size:"small-100"}),t(hn,{children:Vo(i,13)})]}):t(hn,{children:o})})}function Ho({itemCount:e,methods:n,onChangeLocationClick:i}){const{i18n:o}=w(),{isOnlyCountryAvailable:r,formattedAddress:l}=Ro(),s=ft({methods:n});if(a((()=>{r||s("pickup_long_distance_banner_rendered")}),[s,r]),r)return null;const c=(e=>e.every((e=>{const n=Do(e);return"MILES"===n?.unit})))(n)?"MILES":"KILOMETERS",d=Bo(o,{value:Oo[c],unit:c}),u=t("span",{className:"oCDzB",children:l});return t(vt,{children:t(hn,{children:l?o.translate("local_pickup.all_stores_far_away.title_with_item",{distance:t("span",{className:"qIyj1",children:d}),location:i?t(Pn,{tone:"monochrome",onClick:function(){s("pickup_long_distance_banner_change_location_click"),i?.()},children:u}):u,count:e}):o.translate("local_pickup.all_stores_far_away.title",{distance:d})})})}function jo(){const{i18n:e}=w();return t(Jn,{autoFocus:!0,tone:"warning",errorType:Zn.DeliveryError,heading:e.translate("local_pickup.selected_pickup_option_no_longer_available.title"),children:t(hn,{children:e.translate("local_pickup.selected_pickup_option_no_longer_available.description")})})}function $o({allLocationsFarAway:n,selectedPickupOptionNoLongerAvailable:t}){const a=ce("deliveryNext");return e((()=>n.value&&!t.value&&!a.value))}function Ko({hideText:e,singleItem:n}){const{i18n:a}=w(),i=Pe(),o=i.value?.methods??[],r=n?1:o.length||2,l=Array.from({length:r},((e,n)=>`LocationSkeleton${(n+1).toString()}`));return t(h,{children:[e?null:t(tn,{gap:"base",padding:"small-400 none base none",children:t(yt,{size:"extraSmall",children:a.translate("shipping.waiting_on_pickup_location_notice")})}),t(ja,{border:"none",background:"transparent",children:t($a,{name:"skeleton-loading",variant:"block",hideRadioControl:1===l.length,children:l.map((e=>t(Ha,{disabled:!0,value:e,accessibilityLabel:a.translate("general.loading"),secondaryContent:t(tn,{gap:"small-400",alignItems:"end",children:[t(yt,{inlineSize:"small",size:"small"}),t(yt,{inlineSize:"base",size:"small"})]}),children:t(tn,{gap:"small-400",children:[t(yt,{inlineSize:"small",size:"small"}),t(yt,{inlineSize:"base",size:"small"})]})},e)))})})]})}const Go={timeout:8e3,enableHighAccuracy:!0};class qo extends Error{constructor(){super(...arguments),this.name="PermissionsUnsupportedError"}}const Wo=e=>new Promise((n=>{"geolocation"in navigator&&navigator.geolocation?navigator.geolocation.getCurrentPosition((e=>n({reason:"granted",position:e})),(e=>n({reason:Yo(e),error:e})),e):n({reason:"unsupported"})}));function Yo(e){switch(e.code){case 1:return"denied";case 2:return"unavailable";case 3:return"timeout";default:return"unsupported"}}function Qo({disabled:e,displayAsLink:n,onSuccess:a,onError:i,onLocateStart:o,options:r,sharingNotAllowedError:l}){const{i18n:c}=w(),d=function(){const{observability:e}=w();return u((n=>(async(e=Go,n,t)=>{if("permissions"in navigator)try{switch((await navigator.permissions.query({name:"geolocation"})).state){case"granted":case"prompt":return n(e);case"denied":return Promise.resolve({reason:"denied"});default:throw new qo('"geolocation" permission is not supported in this browser')}}catch{t.log("geolocation_permission_supported",'"geolocation" permission is supported in this browser. Using navigator.geolocation.getCurrentPosition instead.')}return n(e)})(n,Wo,e)),[e])}(),m=s(!1),v=s(void 0),_=c.translate("pickup_point.geolocation.shared_location_button"),y=c.translate("pickup_point.geolocation.errors.unsuported_by_browser"),g=l||c.translate("pickup_point.geolocation.errors.permission_not_allowed"),b=c.translate("pickup_point.geolocation.errors.permission_denied");return t(h,{children:[m.value&&n?t(tn,{direction:"inline",gap:"small-400",children:[t(Cn,{}),t(hn,{color:"subdued",children:_})]}):t(ln,{disabled:e,inlineSize:n?void 0:"fill",onClick:async function(){v.value=void 0,m.value=!0,o?.();const e=await d(r);switch(m.value=!1,e.reason){case"granted":a(e.position);break;case"denied":v.value=g;break;case"timeout":case"unavailable":v.value=b;break;case"unsupported":v.value=y}"error"in e&&void 0!==e.error&&i?.(e.error)},loading:m.value,variant:n?"plain":void 0,textDecoration:n?"none":void 0,children:t(tn,{direction:"inline",alignItems:"center",gap:"small-400",children:[t(rn,{type:"geolocation"}),t(en,{children:_})]})}),t(p,{when:v,children:t(fn,{children:v})})]})}function Xo({heading:n,tryDifferentLocationOnClick:i}){const{i18n:o}=w(),r=ht(),l=he(),s=e((()=>Ie(l.value.enabledDeliveryMethods))),c=e((()=>s.value.length>0)),d=_(i),u=e((()=>c.value||Boolean(d.value))),m=Pe(),h=ft({methods:m.value?.methods||[],selectedDeliveryMethodHandle:m.value?.selectedDeliveryMethodHandle});a((()=>{h("pickup_no_location_banner_rendered")}),[h]);const v=t(Pn,{tone:"monochrome",onClick:function(){h("pickup_no_location_banner_ship_items_click"),r.setSelectedMethodTypes(s.value)},children:o.translate("local_pickup.pickup_unavailable_banner_body.ship_items")});function y(){h("pickup_no_location_banner_search_click"),i?.()}const g=i?t(Pn,{tone:"monochrome",onClick:y,children:o.translate("local_pickup.pickup_unavailable_banner_body.search_elsewhere")}
2):o.translate("local_pickup.pickup_unavailable_banner_body.search_elsewhere"),b=i?t(Pn,{tone:"monochrome",onClick:y,children:o.translate("local_pickup.pickup_unavailable_banner_body.search_elsewhere_standalone")}):o.translate("local_pickup.pickup_unavailable_banner_body.search_elsewhere_standalone");return t(Jn,{tone:"critical",errorType:Zn.DeliveryError,heading:n,children:t(p,{when:u,children:t(en,{children:t(p,{when:c,fallback:b,children:o.translate("local_pickup.pickup_unavailable_banner_body.ship_items_or_search_elsewhere",{ship_items:v,search_elsewhere:g})})})})})}function Jo(){const{shop:e}=w();return!e.hasFlagEnabled(Se)}const Zo=_n("AutocompleteSingleAddressField");function er({address:e,onSelect:n,value:a,country:i,hiddenFields:o=["firstName","lastName","company","zoneCode","countryCode","phone"],addressType:r,...l}){const{value:s,setValue:c}=Wa({addressType:r,countryCode:i.code,initialAddressQuery:e.coordinates?Le(e,i,o):a});return t(Ya,{addressType:r,id:un(void 0,Zo),onSelect:function(e){c(Le(e,i,o)),n&&n(e)},value:s,countryCode:i.code,...l})}function nr({pickupCountries:e,selectedCountry:n,onCountryChange:a}){const{i18n:i}=w(),[o,r]=d(!1);return t(Bn,{border:"base",borderWidth:"base",borderRadius:"base",blockAlignment:"center",padding:"none small-200",className:v("_9uTul",o&&"_3zLFw"),children:t(tn,{direction:"inline",alignItems:"center",children:[t("div",{className:"_9rPCU",children:t(ya,{countryCode:n.code.toLowerCase(),accessibilityLabel:n.name})}),t(rn,{type:"chevron-down",size:"small-200",tone:o?"accent":void 0}),t("select",{"aria-label":i.translate("contact.country_label"),className:"FayGq",value:n.code,onBlur:()=>r(!1),onFocus:()=>r(!0),name:"phone_country_select",onChange:e=>{a(e.target.value)},children:e.map((({label:e,value:n})=>t("option",{value:n,children:e},n)))})]})})}const tr=_n("AutocompleteSingleAddressField");function ar({onSearch:e,onBeforeCountryChange:n,onAfterCountryChange:r,sharedLocationAddress:l,searchOnSelect:d,pickupCountries:p,addressAutoFocus:h,onAddressBlur:v}){const _=s(""),{i18n:y,observability:g}=w(),{geolocation:b}=kt(),{locationAddress:f}=E(),k=f.peek(),C=c(k),P=Ae(),S=Jo(),L=o((()=>ye(function(e,n,t,a){const i=Boolean(e.address1||e.postalCode||e.countryCode),o=t?.some((n=>n.value===e.countryCode)),r=t?.some((e=>e.value===n));return i&&o?e:r||0===t.length?(a("auto-selected",n,"pickup"),{countryCode:n}):(a("auto-selected",t[0].value,"pickup"),{countryCode:t[0].value})}(k,b.country.code,p,P),{extendedAddressMode:null})),[]),x=o((()=>Me({countryCode:void 0,address:void 0})),[]),N=R(L.fields.countryCode,x.countryCode),T=R(L.fields.postalCode,x.address),{details:O,loading:B}=Ce(N.value),D=o((()=>O??b.country),[O,b.country]),F=x.address.value,z=o((()=>p?.length?p:[{value:D.code,label:D.name}]),[p,D.code,D.name]),U=u((e=>Le(e,D,["company","firstName","lastName","phone","countryCode","zoneCode"])),[D]),H=D.zones,$=L.value,G=_.value,q=!!N.value&&Qa(N.value);!function(e,n){const{i18n:t,observability:a,checkout:{wallets:i}}=w(),{inMemoryApplePayParts:{asPaymentMethod:o,isLoadingPaymentSheet:r},inMemoryPayPalParts:{isLoadingPaymentSheet:l}}=j();K((async({reason:s})=>{if("negotiation"===s&&!r.value&&!l.value)return{behavior:"allow"};if(i.activeSession.value&&!o.value)return{behavior:"allow"};const c=e.peek(),d=new Map;return c.coordinates||d.set("address",t.translate("field_errors.address_address1_blank")),Ne(c.countryCode)||d.set("countryCode",t.translate("field_errors.address_country_blank")),d.size?(a.leaveErrorBreadcrumb("Blocking address errors",{errors:Array.from(d).map((([,e])=>e))}),{behavior:"block",reason:V.InvalidLocalPickupAddress,perform:()=>{m((()=>{for(const[e,t]of d)n[e].value=t}))}}):{behavior:"allow"}}))}(L,x);const W=Ct(L),Y=yn(),Q=()=>{(N.error||T.error)&&(N.clearError(),T.clearError())};i((()=>{const e=l?.value;e?.countryCode&&I((()=>{m((()=>{W({countryCode:e.countryCode}),_.value="",Q()}))}))})),i((()=>{const e=f.value;e!==C.current&&(C.current=e,e?.coordinates&&I((()=>{m((()=>{W(we(e)),_.value=U(e),Q()}))})))})),a((()=>{const e=L.value;_.value=U(q?e:{postalCode:e.postalCode})}),[L,q,U,_]);const X=(n=$)=>{n.coordinates?(H.length||(n.zoneCode=void 0),e(n)):x.address.value=y.translate("local_pickup.could_not_resolve_address")},J=e=>{const t=()=>{r?.(e),W({countryCode:e}),N.onChange(e),Q(),P("user-input",e,"pickup")};n?n({countryCode:e},t):t()},Z=d&&!S?{source:"magnify",position:"end"}:void 0,ee=q&&d,ne=Boolean(!$.coordinates||!G.length),te=ee?null:t(ln,{variant:"primary",disabled:ne,onClick:X,loading:B,children:y.translate("local_pickup.search_button")}),ae={errors:x,state:{countryCode:L.fields.countryCode,address:q?_:L.fields.postalCode}},ie=Ee(F)?F.message:F,oe=q?"location address":"postalCode",re=un(void 0,tr),le=S?y.translate("local_pickup.location_address_search_placeholder",{postal_code_label:D.labels.postalCode}):y.translate("local_pickup.location_address_search_label");let se;se=S||Boolean(te)?!!ie||void 0:ie;const ce={addressType:"pickup",country:D,address:$,error:se,field:"address1",value:G,icon:Z,autoFocus:h,onBlur:v,autocomplete:q?"shipping street-address":"shipping postal-code",label:q?le:D.labels.postalCode,name:oe,id:re},de=t(er,q?{...ce,onSelect:e=>{!e.coordinates&&e.address1&&g.leaveErrorBreadcrumb("Autocomplete address missing coordinates",{countryCode:e.countryCode||N.value,hasAddress1:Boolean(e.address1),hasPostalCode:Boolean(e.postalCode)});const n=Te(e.countryCode),t=Boolean(e.countryCode&&!n);
2t&&g.leaveErrorBreadcrumb("Discarded invalid autocomplete countryCode",{invalidCountryCode:e.countryCode,fallbackCountryCode:N.value});const a=t?{...e,countryCode:N.value}:{...e,countryCode:n};W(a),d&&X(a),S&&Y("click",{element:{tagName:"button",textContent:"local_pickup_autosuggestion_search"},section:"delivery",timestamp:new Date})},onInput:e=>{$.coordinates&&W({countryCode:N.value}),_.value=e,Q()}}:{...ce,onSelect:e=>{W(e),_.value=U(e)},required:!0,readOnly:B,onInput:e=>{e?Q():_.value=""},onChange:e=>{_.value=e},allowAllCountries:!0}),ue=t(Bn,{children:[t(ir,{autocomplete:ce.autocomplete,label:ce.label,name:ce.name}),de]}),pe=Pt()?.checkoutProfile.hasOverrides.value;return t(An,{target:"cart.deliveryGroups[0].deliveryAddress",children:t(on,{...ae,children:S?t(tn,{gap:"small-300",children:[t(gn,{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:[t(nr,{pickupCountries:z,selectedCountry:D,onCountryChange:J}),ue,t(ln,{variant:"primary",onClick:X,disabled:ne,"data-event-name":"local_pickup_search_button",accessibilityLabel:y.translate("local_pickup.search_button"),children:t(rn,{type:"search"})})]}),ie?t(fn,{controlID:re,children:xe(ie)?ie.textValue:ie}):null]}):t(A,{children:[t(M,{children:t(Xa,{interactive:!pe,children:t(nt,{name:"countryCode",label:D.labels.country,required:!0,autocomplete:"shipping country-name",readOnly:B,value:D.code,onChange:e=>J(e),children:z.map((e=>t(tt,{value:e.value,children:e.label},e.value)))})})}),te?t(tn,{gap:"small-300",children:[t(gn,{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:[ue,te]}),ie?t(fn,{controlID:re,children:xe(ie)?ie.textValue:ie}):null]}):ue]})})})}function ir({autocomplete:e,label:n,name:a}){const i=It(),o=i?.nested?i.id:void 0;return t(Bn,{accessibilityVisibility:"exclusive",children:t("input",{type:"text",tabIndex:-1,"aria-hidden":!0,id:"autofill_localPickupAddress",name:a,autoComplete:e,form:o,"aria-label":n})})}function or({locationFormVisible:e,toggleLocationFormVisibility:n,children:a,onLocationChange:i,pickupCountries:o}){return"shopPay"===w().checkout.identity.current.value?t(h,{children:[a,t(rr,{open:e,onModalClose:()=>n(!1),onLocationChange:i,pickupCountries:o})]}):e?t(lr,{onLocationChange:i,pickupCountries:o}):a}function rr({open:e,onModalClose:n,onLocationChange:a,pickupCountries:i}){const{i18n:o}=w();return t(Tn,{heading:o.translate("local_pickup.toggle_location"),open:e,onHide:n,children:t(St,{section:"delivery",children:[t(lr,{onLocationChange:a,changeLocationOnSelect:!0,pickupCountries:i}),t(Bn,{minBlockSize:"@media (inline-size >= small) 120px, 320px"}),t(ln,{onClick:n,inlineSize:"fill",variant:"plain",size:"extraLarge",children:o.translate("local_pickup.cancel")})]})})}const lr=({onLocationChange:e,onBeforeLocationChange:n,changeLocationOnSelect:a,hideFormOnGeoCoordinatesShare:i,pickupCountries:o,addressAutoFocus:r,onAddressBlur:l})=>{const{geolocation:c}=kt(),{locationAddress:d}=E(),m=Ct(d),{i18n:h}=w(),v=s(!0),_=s(),y=s(void 0),g=Jo(),{syncShippingFromPickup:b}=function(){const{shippingAddress:e}=E(),{shop:n}=w(),t=at();return{syncShippingFromPickup:u((a=>{if(!t.value)return;if(!a)return;const i=e.value;i.countryCode!==a&&(i.postalCode||i.address1||i.address2||i.city||n.shippingCountries.some((e=>e.value===a))&&(e.value={...i,countryCode:a,zoneCode:void 0,coordinates:void 0}))}),[t,e,n])}}(),f=(e,t)=>{const a=()=>{b(e.countryCode),t()};n?n(e,a):a()},k=n=>{if(i&&(v.value=!1),!Oe(n))return void(_.value=h.translate("pickup_point.could_not_resolve_address"));_.value=void 0;const t={zoneCode:c.zone?.code,countryCode:c.country.code,coordinates:{latitude:n.coords.latitude,longitude:n.coords.longitude}};f({countryCode:c.country.code},(()=>{m(t),y.value=t,e(n)}))};return t(tn,{gap:g?"small-300":"base",children:[g?null:t(Qo,{onSuccess:k}),t(p,{when:v,fallback:t(ln,{inlineAlignment:"start",variant:"plain",onClick:()=>{v.value=!0},children:h.translate("shipping.local_pickup.search_address")}),children:t(tn,{gap:"base",children:[g?null:t(gn,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content) minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",alignItems:"center",alignContent:"center",children:[t(Un,{direction:"inline"}),t(Bn,{padding:"none base",children:t(hn,{color:"subdued",children:h.translate("local_pickup.or")}
2)}),t(Un,{direction:"inline"})]}),t(ar,{sharedLocationAddress:y,searchOnSelect:a,onSearch:n=>{f(n,(()=>{m(n),e(n)}))},onBeforeCountryChange:n,onAfterCountryChange:b,pickupCountries:o,addressAutoFocus:r,onAddressBlur:l}),t(p,{when:_,children:e=>t(tn,{gap:"base",padding:"small-200 none none none",children:t(Xo,{heading:e})})})]})}),g&&t(Qo,{onSuccess:k,displayAsLink:!0,sharingNotAllowedError:h.translate("local_pickup.geolocation.permission_not_allowed")})]})},sr={id:"82df6c2dc2bed8371d068138beb16fa3f49623a334766ea9cb4e0932a8fed20b",type:"query",name:"PickupCountries",source:""},cr=Be((({graphql:{coreGraphql:e},router:n,shop:t},{sellableDeliveryMethods:a})=>{const i=S((()=>n.currentUrl.value.pathname.endsWith("/throttle"))),o=e.query(sr,{skip:()=>i.value}),r=S((()=>{const e=o.data.value?.shop?.pickupCountries,{enabledDeliveryMethods:n,deliveryMethodsByMerchandise:i}=a.value,r=Object.keys(i).length>0&&function(e){const n=e.includes("PICK_UP"),t=e.some((e=>dr.includes(e)));return n&&!t}(n);if(!r||!e)return e;const l=[...e],s=new Set(l.map((({value:e})=>e)));for(const a of t.shippingCountries)s.has(a.value)||(l.push(a),s.add(a.value));return l}));return{error:o.error,loading:o.loading,pickupCountries:r}})),dr=["SHIPPING","LOCAL"],ur=e=>e.every((({pickupLocation:e})=>{const n=e&&"distanceFromBuyer"in e?e.distanceFromBuyer:void 0;return n?.value&&n.value>Oo[n.unit]})),pr=(e,n,t,a,i={})=>{const o=e.length;return n?mr(t,{oneItem:()=>a.translate("local_pickup.location_information_far_away_one_item",{count:o}),otherItems:()=>a.translate("local_pickup.location_information_far_away_other_items",{count:o})}):i.allLocationsFarAway?mr(t,{oneItem:()=>a.translate("local_pickup.location_far_away_one_item",{count:o}),otherItems:()=>a.translate("local_pickup.location_far_away_other_items",{count:o})}):1===o?mr(t,{oneItem:()=>a.translate("local_pickup.location_nearby_short_one_item",{count:o}),otherItems:()=>a.translate("local_pickup.location_nearby_short_other_items",{count:o})}):function(e,n){const t=e.map((e=>Do(e)?.value)).filter((e=>void 0!==e));if(0===t.length)return!0;const a=e.find((({handle:e})=>e===n)),i=a?Do(a)?.value:void 0;return void 0===i||i<=Math.min(...t)}(e,i.selectedDeliveryMethodHandle)?mr(t,{oneItem:()=>a.translate("local_pickup.location_closest_one_item"),otherItems:()=>a.translate("local_pickup.location_closest_other_items")}):a.translate("local_pickup.location_selected")};function mr(e,n){return 1===e?n.oneItem():n.otherItems()}function hr({distanceLabel:e,instructions:n}){return e||n?t(tn,{className:"KHJ3S",direction:"inline",rowGap:"small-400",columnGap:"small-200",alignItems:"center",paddingBlockStart:"small-400",children:[e&&t(tn,{direction:"inline",gap:"small-400",alignItems:"center",children:[t(hn,{color:"subdued",children:t(rn,{type:"location",size:"small"})}),t(hn,{fonts:"secondary",type:"small",children:e})]}),n&&t(tn,{direction:"inline",gap:"small-400",alignItems:"center",children:[t(hn,{color:"subdued",children:t(rn,{type:"clock",size:"small"})}),t(hn,{fonts:"secondary",type:"small",children:n})]})]}):null}function vr(){const{checkout:n,shop:t}=w(),{deliveryNext:a,merchandiseLines:i}=B(),o=e((()=>{const e=De(i.value?.lines).filter((e=>Boolean(e.sellingPlan?.subscriptionDetails)));return!!(a.value&&"lines"in a.value&&a.value.lines)&&a.value.lines.some((n=>{if("SUBSCRIPTION"!==n.type)return!1;const t=Fe(n);return"PICK_UP"===t?.methodType&&n.targetMerchandiseLines?.some((n=>e.some((e=>e.stableId===n.stableId))))}))}));return e((()=>t.shipPickupInOneOrderEnabled?o.value:ae({checkout:n})))}function _r({variant:e="text"}){const{i18n:n}=w(),a=vr(),i=n.translate("delivery_options.subscription_pickup_information");return t(p,{when:a,children:"banner"===e?t(vt,{tone:"info",children:i}):t(en,{children:i})})}function yr({method:e,subscriptionBanner:n}){const{i18n:a}=w(),{isOnlyCountryAvailable:i}=Ro(),{cost:o,pickupLocation:r}=e,{name:l,address:s,distanceFromBuyer:c}=r,d=r.instructions.trim(),u=function(e,n){return 0===e.amount?{amount:n.translate("shipping.free_rate_label"),letterCase:"uppercase"}:{amount:n.formatCurrency(e.amount,{currency:e.currencyCode}),letterCase:void 0}}(o,a),p=!i&&c?Bo(a,c):void 0;return t(tn,{direction:"block",gap:"small-400",children:[t(tn,{children:[t(gn,{gap:"small-400",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content)",alignItems:"baseline",children:[t(hn,{type:"strong",children:l}),t(hn,{type:"strong",letterCase:u.letterCase,children:u.amount})]}),t(la,{address:s,hiddenFields:["postalCode","countryCode","phone"]}),t(hr,{distanceLabel:p,instructions:d})]}),n?t(_r,{variant:"banner"}):null]})}function gr({methods:e,selectedDeliveryMethodHandle:n,setSelectedDeliveryMethodHandle:a}){const i=o((()=>n?[n]:[]),[n]),r=u((([e=""])=>a?.(e)),[a]),l=$n("purchase.checkout.pickup-location-option-item.render-after");return t(Ka,{name:"local_pickup_methods",values:i,onChange:r,hideRadioControl:1===e.length,children:e.map((e=>t(br,{method:e,extensions:l},e.handle)))})}function br({method:e,extensions:n}){const a=e.handle,i=o((()=>({handle:a})),[a]);return t(Ha,{value:a,children:[t(yr,{method:e,subscriptionBanner:!1}),t(Wn,{marginBlockStart:"small100",customizations:n,options:i})]},a)}const fr="pickup-locations-modal";function kr({addressFocus:e,...n}){const a=s(!1);return t(Cr,{addressFocus:e??a,...n})}function Cr({methods:e,open:n,type:i,addressFocus:o,onClose:r}){const{i18n:l,shop:c}=w(),[d,v]=Lt({type:i,deliveryMethodType:"PICK_UP"}),y=ze(),{negotiate:g}=Je(),b=B().merchandiseLines,f=_(At(Ve).hasViolations),{fullCountryName:k,isOnlyCountryAvailable:C}=Ro(),P=s(d),I=s(!1),S=s(!1),{setInverseGroupDeliveryMethodHandle:L,getInverseGroupDeliveryMethodHandle:A}=Mt(e||[],i||"ONE_TIME_PURCHASE"),M=he(),{pickupCountries:x,loading:N}=Re(cr,{sellableDeliveryMethods:M}),{deliveryLines:T,merchandiseLines:O,discountLines:D,shippingAddress:F}=E(),z=T.value,V=Pe(),{shouldGateCrossBorder:R,crossBorderGate:U}=Na(),H=_(Boolean(e&&ur(e))),j=$o({allLocationsFarAway:H,selectedPickupOptionNoLongerAvailable:f}),$=(e,n)=>{const t=e.countryCode;t&&R(t)?(r(),U((()=>{F.fields.zoneCode.value=void 0,F.fields.coordinates.value=void 0,F.fields.countryCode.value=t}))):n()},K=wt(b.value?.lines),G=k?l.translate("local_pickup.pickup_unavailable_banner_title_with_country",{country:k,count:K}):l.translate("local_pickup.pickup_unavailable_banner_title",{count:K});a((()=>{(!I.value&&S.value||void 0!==d&&d!==P.value)&&(S.value&&(S.value=!1),P.value=d)}),[I.value,d,S.value]);const q=()=>{c.shipPickupInOneOrderEnabled&&(Ue(T.value).some((({requiresShipping:e})=>e))||m((()=>{He({deliveryLines:T,merchandiseLines:O.value,deliveryMethodTypes:["PICK_UP"]})&&je(D)})))},W=()=>{const e=P.value;if(e!==d){if(v(e),y.value&&e){const n=A(e);L(n)}q(),g({include:["deliveryNext"]})}o.value=!1,r()},Y=()=>{I.value=!0,S.value=!0,q();const e=z.find((e=>{const n=e.peek().id;return n&&n===V.value?.id}));e&&(e.fields.deliveryMethodHandle.value=void 0),g({include:["deliveryNext"],fieldsToResolve:["deliveryNext"],onComplete:()=>{I.value=!1}})},Q=u((e=>{P.value=e}),[P]);return t(Tn,{id:fr,onHide:W,open:n,heading:l.translate("delivery_options.pick_up_locations"),primaryAction:t(xt,{handleSubmit:W,submitText:l.translate("payment.add_credit_card_modal.save")}),children:t(St,{section:"delivery",children:t(Et,{children:t(tn,{gap:"base",children:[t(p,{when:()=>N.value?null:x.value,children:e=>t(lr,{onLocationChange:Y,onBeforeLocationChange:$,changeLocationOnSelect:!0,pickupCountries:e,addressAutoFocus:o.value,onAddressBlur:()=>{o.value=!1}})}),(()=>{if(S.value)return t(Ko,{hideText:!0});if(e){const n=wt(V.value?.targetMerchandiseLines),a=C||H.value?mr(n,{oneItem:()=>l.translate("local_pickup.location_information_far_away_one_item",{count:e.length}),otherItems:()=>l.translate("local_pickup.location_information_far_away_other_items",{count:e.length})}):mr(n,{oneItem:()=>l.translate("local_pickup.location_nearby_one_item",{count:e.length}),otherItems:()=>l.translate("local_pickup.location_nearby_other_items",{count:e.length})});return t(h,{children:[t(p,{when:j,children:t(Ho,{itemCount:n,methods:e,onChangeLocationClick:()=>{o.value=!0}})}),f.value&&t(jo,{}),t(hn,{color:"subdued",children:a}),t(gr,{selectedDeliveryMethodHandle:P.value,setSelectedDeliveryMethodHandle:Q,methods:e})]})}return t(Xo,{heading:G,tryDifferentLocationOnClick:()=>{o.value=!0}})})()]})})})})}function Pr(e,n="base"){const t=$e(n);if(null==e)return t;let a;a=Array.isArray(e)?4===e.length?[Ir(e[0],n),Ir(e[1],n),Ir(e[2],n),Ir(e[3],n)]:[Ir(e[0],n),Ir(e[1],n)]:Ir(e,n);const i=Ke({padding:a}).padding;return null==i?t:i}function Ir(e,n){return function(e){return null!=e&&"none"!==e}(e)?e:n}const Sr="split-delivery-merchandise-modal",Lr=6;function Ar(e){return e.filter((e=>e.requiresShipping))}function Mr(e){return new Set(e.map((e=>e.digest))).size}function wr(e){return Ar(qe(e))}function Er(e){return Ar(Ue(e))}function xr(e){return Mr(wr(e))+Mr(Er(e))}function Nr({targetMerchandiseLines:e,merchandiseLines:n}){const t=Nt(e),a=function(e){return function(e){return e.filter((e=>e.requiresShipping)).reduce(((e,n)=>e+n.quantity),0)}(e.filter(Ge).flatMap((e=>e.lineComponents.length>0?e.lineComponents:[e])))}(n);return{targetMerchandiseQuantity:t,isAllItems:t===a}}function Tr(){const{deliveryLines:n}=E(),t=e((()=>xr(n.value))),a=e((()=>t.value>=6));return{physicalDeliveryTargetMerchandiseCount:t,shouldOpenModal:a}}function Or(n){const{deliveryLines:t}=E();return e((()=>function(e,n){return"PICK_UP"===n?wr(e):Er(e)}(t.value,n)))}function Br(n){const{merchandiseLines:t}=E(),a=ce("deliveryNext"),i=e((()=>{const e=n.value,a=Nr({targetMerchandiseLines:e,merchandiseLines:t.value});if(0!==a.targetMerchandiseQuantity)return{merchandiseLines:e,totalItemCount:a.targetMerchandiseQuantity,isAllItems:a.isAllItems}})),o=c(),r=e((()=>{const e=i.value;return e?(o.current=e,e):o.current}));return{currentSummary:i,visibleSummary:r,isNegotiating:a}}const Dr="split-delivery-method-menu";function Fr(e,n){return`${Dr}-${encodeURIComponent(e)}-${n}`}function zr(e,n){if(0!==e)return n>=0?n:0}function Vr({activeIndex:e,isOpen:n,menuOptionsLength:t,selectedOptionIndex:i,wasOpenRef:o}){return a((()=>n?o.current?void(void 0!==e.value&&e.value>=t&&(e.value=0===t?void 0:t-1)):(void 0===e.value&&(e.value=zr(t,i)),void(o.current=!0)):(e.value=void 0,void(o.current=!1))),[e,n,t,i,o]),a((()=>()=>{e.value=void 0,o.current=!1}),[e,o]),null}function Rr(e){requestAnimationFrame((()=>{pn({content:e,role:"status"})}))}function Ur({merchandiseStableIds:n,onMoveMerchandise:a,onRemoveMerchandise:i,selectedDeliveryMethodType:o,productTitle:r}){const l=L(),{i18n:d}=w(),u=he(),m=ct(),v=Co(),y=_(a??m),g=_(i??v),b=_(Tt().hideOverlay),f=c(null),k=c(!1),P=n[0],I=Fr(P,l),S=function(e,n){return`${Fr(e,n)}-trigger`}(P,l),A=function(e){const{getInteraction:n}=Ot(),t=n(e);return"command"===t?.type&&"overlay"===t.kind&&t.active}(I),M=_(A),E=s(void 0),x=_(o),N=_(r),T=_(n),O=e((()=>{const e={SHIPPING:{label:d.translate("delivery_options.ship"),value:"SHIPPING",icon:"package-delivery",onClick:()=>n("SHIPPING")},PICK_UP:{label:d.translate("delivery_options.pickup"),value:"PICK_UP",icon:"location",onClick:()=>n("PICK_UP")}},n=e=>{b.value(I),e!==x.value&&(y.value({targetDeliveryMethodType:e,merchandiseStableIds:T.value}),Rr("SHIPPING"===e?d.translate("split_delivery.accessibility.status.ship_separately",{items:N.value}):d.translate("split_delivery.accessibility.status.pickup_in_store",{items:N.value})))};return e})),B=e((()=>O.value[x.value].label)),D=e((()=>{const{deliveryMethodsByMerchandise:e}=u.value,n=T.value.map((n=>e[n]));if(0===n.length||n.some((e=>!e)))return[];const[t,...a]=n;return a.reduce(((e,n)=>e.filter((e=>n.includes(e)))),t)})),F=e((()=>{const e=D.value,n=e.map((e=>({...O.value[e],selected:e===x.value}))).sort(((e,n)=>Number(n.selected)-Number(e.selected)));return 1===e.length&&n.push({label:d.translate("stock.remove"),value:"remove",icon:"delete",selected:!1,onClick:()=>{b.value(I),g.value(T.value),Rr(d.translate("split_delivery.accessibility.status.remove_items",{items:N.value}))}}),n})),z=e((()=>F.value.length)),V=e((()=>F.value.findIndex((e=>e.selected)))),R=e=>{const n=z.value;if(0===n||void 0===E.value)return;
2const t=Math.min(E.value,n-1);E.value=(t+e+n)%n},U=()=>{E.value=zr(z.value,V.value)},H=()=>{A||U()},j=e=>{e&&(e.onClick(),requestAnimationFrame((()=>{var e;document.querySelector((e=P,`[id^="${Dr}-${encodeURIComponent(e)}-"][id$="-trigger"]`))?.focus()})))},$=e=>{if(A)switch(e.key){case"ArrowDown":e.preventDefault(),R(1);break;case"ArrowUp":e.preventDefault(),R(-1);break;case"Home":e.preventDefault(),E.value=0;break;case"End":e.preventDefault(),E.value=z.value-1;break;case"Enter":case" ":e.preventDefault(),void 0!==E.value&&j(F.value[E.value]);break;case"Tab":e.stopPropagation(),b.value(I)}else"ArrowDown"!==e.key&&"ArrowUp"!==e.key||(e.preventDefault(),U(),f.current?.click())},K=e((()=>M.value&&void 0!==E.value&&void 0!==F.value[E.value]?`${I}-option-${E.value}`:void 0));return t(p,{when:z,children:e=>t(h,{children:[t(Vr,{activeIndex:E,isOpen:A,menuOptionsLength:e,selectedOptionIndex:V.value,wasOpenRef:k}),t(mn,{ref:f,id:S,command:"--toggle",commandFor:I,background:"base",padding:"small-300",paddingInlineStart:"small-200",borderRadius:"base",className:"HoMMS",accessibilityLabel:`${r}, ${d.translate("review.blocks.change_delivery_method_link_label")}`,onClick:H,role:"combobox",onKeyDown:$,"aria-haspopup":"listbox","aria-autocomplete":"none","aria-activedescendant":K.value,children:t(tn,{direction:"inline",gap:"small-500",alignItems:"center",children:[t("span",{className:"g9aTP",children:B}),t("span",{className:"_5tEP0",children:t(rn,{type:"chevron-down",size:"small-200",tone:"accent"})})]})}),t(Za,{id:I,connector:"none",padding:"none",positionArea:"block-end span-inline-start",children:t("div",{role:"listbox","aria-labelledby":S,children:t(C,{each:F,getKey:e=>e.value,children:(e,n)=>{const a=E.value===n;return t("button",{id:`${I}-option-${n}`,type:"button",role:"option",tabIndex:-1,"aria-selected":e.selected,"data-active":a||void 0,className:"eWR8C",onClick:()=>{j(e)},onMouseOver:()=>{E.value=n},children:t(tn,{direction:"inline",gap:"small-400",alignItems:"center",children:[t(rn,{type:e.icon,tone:a?"accent":"auto"}),t(hn,{type:"small",tone:"remove"===e.value?"critical":"auto",children:e.label})]})})}})})})]})})}function Hr({onMoveMerchandise:e,onRemoveMerchandise:n,title:a,selectedDeliveryMethodType:i}){const r=Or(i).value,l=o((()=>{const e=new Map;for(const n of r){const t=n.digest,a=e.get(t);if(a){if(a.stableIds.includes(n.stableId))continue;a.stableIds.push(n.stableId),a.totalQuantity+=n.quantity}else e.set(t,{line:n,stableIds:[n.stableId],totalQuantity:n.quantity})}return Array.from(e.values())}),[r]),s=Bt(l.map((({line:e})=>e.stableId))),c=Vt(i);return t(h,{children:t(tn,{accessibilityRole:"unordered-list",accessibilityLabel:a,gap:"small-100",children:l.map((({line:{stableId:a,image:o,title:r,subtitle:l,sellingPlan:d},stableIds:u,totalQuantity:p})=>{const m=[l,d?.name].filter(Boolean).join(`Â ${Dt}Â `),h=s.has(a);return t(Bn,{accessibilityRole:"list-item",className:h?c:void 0,children:t(gn,{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:[t(Ft,{alt:o?.altText,size:"small",src:o?.url,totalItems:p>1?p:void 0}),t(Bn,{minInlineSize:"0px",maxInlineSize:"100%",overflow:"hidden",children:[t(hn,{size:"base",children:t(zt,{children:r})}),m&&t(hn,{color:"subdued",size:"small",children:t(zt,{children:m})})]}),t(Bn,{inlineAlignment:"end",children:t(Ur,{merchandiseStableIds:u,onMoveMerchandise:e,onRemoveMerchandise:n,selectedDeliveryMethodType:i,productTitle:r})})]})},a)}))})})}function jr(){const{i18n:n}=w(),a=at(),o=c(null),r=Or("PICK_UP"),{shouldOpenModal:l}=Tr(),{currentSummary:d,visibleSummary:u,isNegotiating:m}=Br(r),h=e((()=>1===d.value?.totalItemCount)),v=e((()=>{const e=u.value;return e?e.isAllItems?n.translate("split_delivery.pickup_all_items"):n.translate("split_delivery.pickup_items_count",{count:e.totalItemCount}):""})),_=e((()=>{const e=n.translate("review.blocks.change_delivery_method_link_label");return v.value?`${v.value}, ${e}`:e})),y=e((()=>v.value||n.translate("split_delivery.items_for_pickup"))),g=s(I((()=>l.value||!h.value&&!a.value)));return i((()=>{g.value=l.value||!h.value&&!a.value})),t(Bn,{children:t(qa,{children:t(p,{when:g,fallback:t("div",{ref:o,tabIndex:-1,
2children:t(Hr,{title:n.translate("split_delivery.items_for_pickup"),selectedDeliveryMethodType:"PICK_UP"})}),children:t(ln,{variant:"plain",tone:"monochrome",inlineSize:"fill",inlineAlignment:"start",textDecoration:"none",accessibilityLabel:l.value?_.value:y.value,command:l.value?"--show":void 0,commandFor:l.value?Sr:void 0,"aria-expanded":!!l.value&&void 0,disabled:m.value,onClick:l.value?void 0:()=>{g.value=!1,requestAnimationFrame((()=>{o.current?.focus()}))},children:t(gn,{gridAutoFlow:"column",gridTemplateColumns:"minmax(auto, max-content) minmax(0, 1fr) minmax(auto, max-content)",alignItems:"center",gap:"small-200",children:[t(Rt,{variant:"fan-legacy",sortByPrice:!0,merchandise:u.value?.merchandiseLines??[],size:"small",useImageAltTexts:!1}),t(p,{when:()=>!m.value&&void 0!==u.value,fallback:t(yt,{inlineSize:"base"}),children:t(hn,{children:v})}),t(rn,{type:"pen",size:"base",tone:"neutral"})]})})})})})}function $r(){const{shop:n}=w(),t=he(),{deliveryNext:a}=B(),i=at(),o=xa();return e((()=>{if(!n.shipPickupInOneOrderEnabled)return!1;if(!(a.value&&"supportsSplitDeliveryMethod"in a.value&&a.value.supportsSplitDeliveryMethod))return!1;const{enabledDeliveryMethods:e,deliveryMethodsByMerchandise:r}=t.value,l=e.includes("SHIPPING"),s=e.includes("PICK_UP");if(!l||!s)return!1;if(!i.value&&o.value)return!1;const c=Object.values(r);if(c.length<2)return!1;if(c.some((e=>e.includes("SHIPPING")&&e.includes("PICK_UP"))))return!0;const d=c.some((e=>e.includes("SHIPPING")&&!e.includes("PICK_UP"))),u=c.some((e=>e.includes("PICK_UP")&&!e.includes("SHIPPING")));return d&&u}))}function Kr({localPickupDeliveryLine:e,onShowModal:n,sectionPadding:a}){const{i18n:i,shop:r}=w(),l=$r(),s=Pr(a),c=r.hasFlagEnabled(W),{methods:d,selectedDeliveryMethodHandle:u}=e,m=d.find((e=>e.handle===u)),v=d.length-1,_=ft({methods:d,selectedDeliveryMethodHandle:u}),y=$n("purchase.checkout.pickup-location-option-item.render-after"),g=m?.handle??"",b=o((()=>({handle:g})),[g]);if(!m)return null;const f=t(h,{children:[t(p,{when:l,children:t(h,{children:[t(Bn,{padding:s,children:t(jr,{})}),t(Un,{accessibilityRole:"presentation"})]})}),t(Bn,{padding:s,children:[t(yr,{method:m,subscriptionBanner:!0}),t(Wn,{marginBlockStart:"small100",customizations:y,options:b})]}),v>0?t(tn,{children:[t(Un,{accessibilityRole:"presentation"}),t(Bn,{padding:s,children:t(ln,{variant:"plain",inlineSize:"fill",textDecoration:"none",inlineAlignment:"start",onClick:function(){n(),_("checkout_pickup_buyer_reveal_more")},children:t(tn,{direction:"inline",gap:"small-200",alignItems:"center",justifyContent:"space-between",children:[t(hn,{type:"strong",children:i.translate("local_pickup.toggle_more_locations",{count:v})}),t(rn,{type:"chevron-right",size:"small-200"})]})})})]}):null]});return t(tn,{gap:"base",children:c?t(Ga,{target:"edgeToEdgeCard",children:t(Hn,{accessibilityRole:"presentation",children:f})}):t(Bn,{border:"base",borderRadius:"large",children:f})})}function Gr({sectionPadding:e}){const{shop:n}=w(),a=$r(),i=Pr(e),o=n.hasFlagEnabled(W),r=t(h,{children:[t(p,{when:a,children:[t(Bn,{padding:i,children:t(jr,{})}),t(Un,{accessibilityRole:"presentation"})]}),t(Bn,{padding:i,children:t(tn,{direction:"block",gap:"small-400",children:t(tn,{children:[t(gn,{gap:"small-400",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content)",alignItems:"baseline",children:[t(yt,{}),t(yt,{inlineSize:"small"})]}),t(yt,{inlineSize:"large"}),t(Bn,{paddingBlockStart:"small-500",children:t(yt,{size:"small"})})]})})}),t(Un,{accessibilityRole:"presentation"}),t(Bn,{padding:i,children:t(yt,{inlineSize:"small"})})]});return t(tn,{gap:"base",children:[t(tn,{direction:"inline",gap:"small-200",justifyContent:"space-between",children:[t(yt,{inlineSize:"large"}),t(yt,{inlineSize:"small"})]}),o?t(Ga,{target:"edgeToEdgeCard",children:t(Hn,{accessibilityRole:"presentation",children:r})}):t(Bn,{border:"base",borderRadius:"large",children:r})]})}function qr({onShowModal:e,showLocationButton:n=!0}){const{i18n:a}=w(),{value:i}=B().merchandiseLines;Ut({active:!0});const{fullCountryName:o,isOnlyCountryAvailable:r}=Ro(),l=ft({methods:[],selectedDeliveryMethodHandle:void 0}),s=wt(i?.lines),c=o?a.translate("local_pickup.pickup_unavailable_banner_title_with_country",{country:o,count:s}):a.translate("local_pickup.pickup_unavailable_banner_title",{count:s});return t(tn,{gap:"small",children:[n&&t(Uo,{onClick:()=>{e(),l(r?"checkout_pickup_geoselector_clicked_country_grain":"checkout_pickup_geoselector_clicked_other_grain")}}),t(Xo,{heading:c,tryDifferentLocationOnClick:()=>e(!0)})]})}const Wr={isLocationFormVisible:!1};function Yr(){const{i18n:n,shop:a}=w(),{main:{section:i}}=Rn(),o=a.hasFlagEnabled(W)?i?.padding:void 0,{negotiating:r}=ht(),l=Pe(),c=H(),u=ce("deliveryNext"),{value:m}=Ht().value,{value:v}=jt().value,y=Boolean(m||v),g=_(At(Ve).hasViolations),b=Ao({mode:"localPickup"}),f=e((()=>b.value.merchandiseLines)),k=e((()=>b.value.allowAlternativeAction)),C=e((()=>b.value.merchandiseLines.length>0)),{isOnlyCountryAvailable:P}=Ro(),I=e((()=>{const e=l.value?.methods??[];return e.length>0&&ur(e)})),S=$o({allLocationsFarAway:I,selectedPickupOptionNoLongerAvailable:g}),L=ft({methods:l.value?.methods||[],selectedDeliveryMethodHandle:l.value?.selectedDeliveryMethodHandle}),[A,M]=d(!1),E=s(!1),x=$n("Checkout::PickupLocations::RenderBefore"),N=$n("Checkout::PickupLocations::RenderAfter"),T=e=>{M(!0),E.value=e??!1},O=()=>{T(),L(P?"checkout_pickup_geoselector_clicked_country_grain":"checkout_pickup_geoselector_clicked_other_grain")},B=(()=>{const e=l.value,a=e?.methods.find((n=>n.handle===e.selectedDeliveryMethodHandle));if(!c.value||A)return t(Gr,{sectionPadding:o});if(r.value&&!a)return t(Gr,{sectionPadding:o});if(y)return t(p,{when:C,fallback:t(qr,{onShowModal:T}),children:t(h,{children:[t(So,{bannerType:"pickup",merchandiseLines:f,allowAlternativeAction:k}),t(Qr,{})]})});if(!e)return t(Gr,{sectionPadding:o});const{methods:i}=e,s=wt(e.targetMerchandiseLines);return t(tn,{gap:"base",children:[t(p,{when:C,children:t(So,{bannerType:"pickup",merchandiseLines:f,allowAlternativeAction:k})}),t(p,{when:g,children:t(jo,{})}),t(p,{when:S,children:t(Ho,{itemCount:s,methods:e.methods,onChangeLocationClick:T})}),t(tn,{direction:"inline",gap:"small-200",justifyContent:"space-between",children:[t(p,{when:u,fallback:t(hn,{color:"subdued",children:pr(i,P,s,n,{selectedDeliveryMethodHandle:e.selectedDeliveryMethodHandle,allLocationsFarAway:I.value})}),children:t(yt,{inlineSize:"base"})}),t(Uo,{onClick:O})]}),t(Wn,{customizations:x,options:Wr}),t(Kr,{localPickupDeliveryLine:e,onShowModal:T,sectionPadding:o}),t(Wn,{customizations:N,options:Wr})]})})();return t(An,{target:"cart.deliveryGroups[0].deliveryAddress",children:t(Hn,{accessibilityLabel:n.translate("local_pickup.pick_up_location"),children:[B,t(kr,{methods:l.value?.methods,type:l.value?.type,open:A,onClose:()=>{M(!1),E.value=!1},addressFocus:E})]})})}function Qr(){return Ut({active:!0}),null}function Xr(){const{i18n:e}=w(),[n,a]=d(!1),{formattedAddress:i}=Ro(),o=i?t(tn,{direction:"inline",gap:"small-500",alignItems:"center",children:[t(rn,{type:"geolocation",size:"small-100"}),t(hn,{children:Vo(i,13)})]}):e.translate("local_pickup.toggle_location");return t(An,{target:"cart.deliveryGroups[0].deliveryAddress",children:t(Hn,{accessibilityLabel:e.translate("delivery_options.pick_up_locations"),children:t(tn,{gap:"small-500",children:[t(gn,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content)",gridTemplateRows:"minmax(0, 1fr)",alignItems:"baseline",children:[t(Nn,{level:2,children:e.translate("delivery_options.pick_up_locations")}),t(Pn,{id:"change-pickup-location-button",textDecoration:"none",onClick:()=>a((e=>!e)),accessibilityLabel:n?e.translate("local_pickup.cancel"):e.translate("local_pickup.toggle_location"),children:n?e.translate("local_pickup.cancel"):o})]}),t(Jr,{isLocationFormVisible:n,setIsLocationFormVisible:a})]})})})}function Jr({isLocationFormVisible:n,setIsLocationFormVisible:a}){const i=H(),{i18n:r,observability:l}=w(),{negotiating:c}=ht(),d=Pe(),u=ce("deliveryNext"),p=s(!1),{value:m}=jt().value,h=Boolean(m),{isOnlyCountryAvailable:v}=Ro(),_=Jo(),{deliveryLines:y}=E(),g=y.value,{negotiate:b}=Je(),f=$t(),k=$n("Checkout::PickupLocations::RenderBefore"),C=$n("Checkout::PickupLocations::RenderAfter"),P=o((()=>({isLocationFormVisible:n})),[n]),I=()=>a(!1),S=()=>a((e=>!e)),L=()=>{I(),async function({negotiate:e,proposedDeliveryLines:n,pickupDeliveryLineId:t,pending:a,deliveryNextLoading:i}){let o;a.value=!0,function(e,n){if(!n)return;const t=e.find((e=>e.value.id===n));t&&(t.fields.deliveryMethodHandle.value=void 0)}(n,t);try{await e({include:["deliveryNext"],fieldsToResolve:["deliveryNext"],onComplete(e){o=e}})}catch(l){throw a.value=!1,l}if("stale"!==o?.status||!i.value)return void(a.value=!1);const r=i.subscribe((e=>{e||(a.value=!1,r())}))}({negotiate:b,proposedDeliveryLines:g,pickupDeliveryLineId:d.value?.id,pending:p,deliveryNextLoading:u}).catch((e=>l.error(e)))},A=he(),{pickupCountries:M,loading:x}=Re(cr,{sellableDeliveryMethods:A}),N=e((()=>Boolean(d.value&&Fo(d.value.methods))));if(h)return t(Zr,{isLocationFormVisible:n,setFormVisibilityFalse:I,handleLocationChange:L,pickupCountries:M.value??[],onToggleLocationFormClick:S});if(c.value||!i.value||x.value||!M.value)return t(Ko,{});if(d.value){const{methods:e,type:a}=d.value,i=f.value.PICK_UP??0,o=N.value&&_&&!v,l=mr(i,v?{oneItem:()=>r.translate("local_pickup.location_information_far_away_one_item",{count:e.length}),otherItems:()=>r.translate("local_pickup.location_information_far_away_other_items",{count:e.length})}:{oneItem:()=>r.translate("local_pickup.location_nearby_one_item",{count:e.length}),otherItems:()=>r.translate("local_pickup.location_nearby_other_items",{count:e.length})});return t(tn,{gap:"base",children:[t(_r,{}),t(Wn,{customizations:k,options:P}),t(gn,{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:!o&&t(en,{
2color:"subdued",children:_?l:r.translate("local_pickup.location_information",{count:e.length})})}),t(or,{locationFormVisible:n,toggleLocationFormVisibility:I,onLocationChange:L,pickupCountries:M.value,children:t(al,{itemCount:i,methods:e,type:a,allLocationsFarAway:N,loading:p.value,onToggleLocationFormClick:S})}),t(Wn,{customizations:C,options:P})]})}return t(Zr,{isLocationFormVisible:n,setFormVisibilityFalse:I,handleLocationChange:L,pickupCountries:M.value,onToggleLocationFormClick:S})}function Zr({isLocationFormVisible:e,setFormVisibilityFalse:n,handleLocationChange:a,pickupCountries:i,onToggleLocationFormClick:o}){const{value:r,loading:l}=Ht().value,s=B().merchandiseLines,{i18n:c}=w(),{locationAddress:d}=E(),u=d.peek(),p=i.find((e=>e.value===u.countryCode))?.label,m=wt(s.value?.lines),h=p?c.translate("order_summary.pickup_unavailable_banner_title_with_country",{count:m,country:p}):c.translate("order_summary.pickup_unavailable_banner_title",{count:m});return!l&&r?t(tn,{gap:"base",children:[t(or,{locationFormVisible:e,toggleLocationFormVisibility:n,onLocationChange:a,pickupCountries:i,children:t(Xo,{heading:h,tryDifferentLocationOnClick:o})}),t(el,{})]}):t(Ko,{})}function el(){return Ut({active:!0}),null}function nl({instructions:e}){return t(Bn,{maxInlineSize:"200px",children:t(en,{type:"small",children:e})})}function tl({handle:e,address:n,secondaryLabel:a,letterCase:i,showInstructionsLeft:r,showInstructionsRight:l,instructions:s,nameLabel:c,itemRenderAfterCustomizations:d}){const u=o((()=>({handle:e})),[e]);return t(Ha,{value:e,details:t(h,{children:[t(la,{address:n,textSize:"small",hiddenFields:["phone"]}),r&&s&&t(nl,{instructions:s})]}),secondaryContent:t(h,{children:[t(hn,{type:"strong",letterCase:i,children:t("span",{style:{display:"flex",justifyContent:"flex-end"},children:a})}),l&&s&&t(nl,{instructions:s})]}),tertiaryContent:d?.length>0&&t(Wn,{customizations:d,options:u,render:e=>t(tn,{padding:"small-100 none none none",gap:"small-100",children:e})}),children:t(hn,{type:"strong",children:c})})}function al({itemCount:e,methods:n,allLocationsFarAway:i,type:r,loading:l,onToggleLocationFormClick:s}){const{i18n:c,checkout:{identity:m}}=w(),v="shopPay"===m.current.value,{negotiate:y}=Je(),g=ze(),{isOnlyCountryAvailable:b}=Ro(),f=Jo(),k=H(),C=Kt({base:!0,medium:!1}),P=!k.value||(C??!1),[I,S]=Lt({type:r,deliveryMethodType:"PICK_UP"}),{revealedMethods:L,amountLeft:A,allRevealed:M,revealMore:E}=function(e,n){const t=ft({methods:e,selectedDeliveryMethodHandle:n}),[i,r]=d(5),l=o((()=>e.slice(0,i)),[e,i]);a((()=>{const t=e.findIndex((e=>e.handle===n));t>=i&&r(t+1)}),[e,i,n]);const s=e.length-l.length,c=l.length>=e.length;return{revealedMethods:l,amountLeft:s,allRevealed:c,revealMore:()=>{c||(r((e=>e+5)),t("checkout_pickup_buyer_reveal_more"))}}}(n,I),{setInverseGroupDeliveryMethodHandle:x,getInverseGroupDeliveryMethodHandle:N}=Mt(n,r),T=u((([e=""])=>{if(S(e),g.value){const n=N(e);x(n)}y({include:["deliveryNext"]})}),[S,g,y,N,x]),O=$n("purchase.checkout.pickup-location-option-item.render-after"),B=_(At(Ve).hasViolations),D=$o({allLocationsFarAway:i,selectedPickupOptionNoLongerAvailable:B}),F=o((()=>I?[I]:[]),[I]);return l?t(Ko,{hideText:!0}):t(tn,{gap:"base",children:[t(p,{when:D,children:t(Ho,{itemCount:e,methods:n,onChangeLocationClick:s})}),B.value&&t(jo,{}),t(Ka,{name:"local_pickup_methods",values:F,onChange:T,hideRadioControl:!v&&1===L.length,children:L.map((({handle:e,cost:{amount:n,currencyCode:a},pickupLocation:i})=>{const{address:o,instructions:r,name:l,distanceFromBuyer:s,proximityLabel:d}=i,u=((e,n)=>0===e?c.translate("shipping.free_rate_label"):c.formatCurrency(e,{currency:n}))(n,a),p=(({name:e="",proximityLabel:n,distance:a})=>{if(b||!a&&!n)return e;const i=n||`(${Bo(c,a)})`;return t(h,{children:[e," ",t(hn,{color:"subdued",children:i})]})})({name:l,distance:s,proximityLabel:f?void 0:d}),m=u===c.translate("shipping.free_rate_label")?"uppercase":void 0,_=Boolean(r&&(v||P)),y=Boolean(r&&!v&&!P);return t(tl,{handle:e,address:o,secondaryLabel:u,letterCase:m,showInstructionsLeft:_,showInstructionsRight:y,instructions:r,nameLabel:p,itemRenderAfterCustomizations:O},e)}))}),!M&&t(Bn,{inlineAlignment:"end",children:t(Pn,{onClick:E,children:c.translate("local_pickup.reveal_more_label",{count:A})})})]})}function il({heading:e="auto"}){const{i18n:n}=w(),a=n.translate("pickup_point.title");return t(Hn,{accessibilityLabel:a,children:t(tn,{gap:"small-400",children:["auto"===e&&t(Nn,{level:2,children:a}),t(Yn,{blockSize:"small-500"}),t(Ja,{text:n.translate("pickup_point.waiting_on_pickup_point_location_notice")})]})})}const ol=r({displayName:"PickupPoint",load:()=>l((()=>ga((()=>import("./78af98ed.D5JvAG94.js")),__vite__mapDeps([63,1,6,2,3,4,5,7,8,9,10,11,54,50,22,23,41,42,43,51,13,14,15,12,16,17,18,19,20,21,24,64,57,65,66,31,29,30,32,28,27,44,45,46,47,39,40,48,49,52,37,38,53,67])))),renderLoading:e=>t(il,{...e})});function rl({selectedDeliveryMethodType:n}){const{i18n:a}=w(),{merchandiseLines:i}=E(),o=Or(n),{shouldOpenModal:r}=Tr(),l=e((()=>{const e=Nr({targetMerchandiseLines:o.value,merchandiseLines:i.value});return e.isAllItems?"PICK_UP"===n?a.translate("split_delivery.pickup_all_items"):a.translate("split_delivery.ship_all_items"):"PICK_UP"===n?a.translate("split_delivery.pickup_items_count",{count:e.targetMerchandiseQuantity}):a.translate("split_delivery.ship_items_count",{count:e.targetMerchandiseQuantity})})),s=e((()=>`${l.value}, ${a.translate("review.blocks.change_delivery_method_link_label")}`));return r.value?t(ln,{variant:"plain",tone:"monochrome",inlineSize:"fill",inlineAlignment:"start",textDecoration:"none",accessibilityLabel:s.value,command:"--show",commandFor:Sr,children:t(gn,{gridAutoFlow:"column",gridTemplateColumns:"minmax(auto, max-content) minmax(0, 1fr) minmax(auto, max-content)",alignItems:"center",gap:"small-200",children:[t(Rt,{variant:"fan-legacy",sortByPrice:!0,merchandise:o.value,size:"small",useImageAltTexts:!1}),t(hn,{children:l}
2),t(rn,{type:"pen",size:"base",tone:"neutral"})]})}):t(Hr,{title:"PICK_UP"===n?a.translate("split_delivery.items_for_pickup"):a.translate("split_delivery.items_for_shipping"),selectedDeliveryMethodType:n})}function ll({id:e=Sr,open:n}){const{i18n:a}=w(),i=Or("PICK_UP"),o=Or("SHIPPING"),{moveMerchandise:r,removeMerchandise:l,saveAndClose:s}=function({onClose:e}={}){const{negotiate:n}=Je(),{i18n:t}=w(),a=Gt(),{deliveryLines:i,merchandiseLines:o,discountLines:r}=E(),l=he(),s=c(!1);return{moveMerchandise:u((({targetDeliveryMethodType:e,merchandiseStableIds:n})=>{const{orphanedRemovedFromCartStableIds:t}=We({deliveryLines:i,merchandiseLines:o,targetDeliveryMethodType:e,merchandiseStableIds:n,sellableDeliveryMethodsByStableId:l.value.deliveryMethodsByMerchandise,discountLines:r});t.length>0&&(s.current=!0)}),[i,o,l,r]),removeMerchandise:u((e=>{me({deliveryLines:i,merchandiseLines:o,merchandiseStableIds:e,discountLines:r})}),[i,o,r]),saveAndClose:u((()=>{e?.(),n({include:["deliveryNext","merchandiseLines"]}),s.current&&(s.current=!1,a(t.translate("stock.removed_from_cart_notice")))}),[n,e,a,t])}}(),d=a.translate("delivery_options.pickup"),p=a.translate("delivery_options.ship_to_address");return t(Tn,{id:e,open:n,accessibilityLabel:a.translate("split_delivery.delivery_method"),onHide:s,primaryAction:t(ln,{command:"--hide",commandFor:e,inlineSize:"fill",variant:"primary",children:a.translate("payment.add_credit_card_modal.save")}),children:t(tn,{gap:"large-300",children:[i.value.length>0&&t(tn,{gap:"base",children:[t(tn,{direction:"inline",gap:"small-400",alignItems:"center",children:[t(rn,{type:"marker"}),t(Nn,{level:2,children:d})]}),t(Bn,{border:"base",borderRadius:"large",padding:"base",children:t(Hr,{onMoveMerchandise:r,onRemoveMerchandise:l,selectedDeliveryMethodType:"PICK_UP",title:d})})]}),o.value.length>0&&t(tn,{gap:"base",children:[t(tn,{direction:"inline",gap:"small-400",alignItems:"center",children:[t(rn,{type:"package-delivery"}),t(Nn,{level:2,children:p})]}),t(Bn,{border:"base",borderRadius:"large",padding:"base",children:t(Hr,{onMoveMerchandise:r,onRemoveMerchandise:l,selectedDeliveryMethodType:"SHIPPING",title:p})})]})]})})}const sl=_n("VatNumberFieldInfoTooltip");function cl({status:e}){const{i18n:n}=w();return"pending"===e.type?t(Cn,{size:"small",accessibilityLabel:n.translate("taxes.vat_number.accessibility.status.validating")}):"invalid_format"===e.type?t(ul,{}):t(dl,{status:e})}function dl({status:{validationStatus:e}}){const{i18n:n}=w();return"VALID"===e?t(h,{children:[t(rn,{tone:"success",size:"small",type:"check-circle"}),t(hn,{accessibilityVisibility:"exclusive",children:n.translate("taxes.vat_number.accessibility.status.valid")})]}):t(ul,{})}function ul(){const{i18n:e}=w(),n=un(void 0,sl);return t(h,{children:[t(rn,{size:"small",type:"question-circle",interestFor:n}),t(vn,{id:n,children:e.translate("taxes.vat_number.field.tooltip")})]})}function pl({taxId:n,applied:i,inputRef:o}){const{i18n:r}=w(),l=function({taxId:e}){const{negotiate:n}=Je(),t=qt(),i=()=>{n({identifier:Symbol.for("vat-id-validation"),force:!0})},o=n=>{e.format.validate(n)&&(i(),t({vatId:n}))};return a((()=>{null===e.validated.status&&o(e.value)}),[]),{value:e.value,status:e.status,loading:"pending"===e.status.type,onBlur:()=>{e.value===e.validated.taxId&&e.validated.status||(i(),t({vatId:e.value}))},onInput:n=>{e.set(n),o(n)}}}({taxId:n}),s=function({status:n}){const{i18n:t}=w(),{shippingAddress:a}=E(),i=_(n);return e((()=>{const e=a.value.countryCode?.toLowerCase(),n=i.value;return"invalid_format"===n.type&&e?{code:"invalid_format",details:{country:e},message:t.translate("taxes.vat_number.status.invalid_format",{scope:e})}:"resolved"===n.type&&"INVALID"===n.validationStatus&&e?{code:"invalid_number",details:{country:e},message:t.translate("taxes.vat_number.status.invalid_number",{scope:e})}:"resolved"===n.type&&"SERVICE_ERROR"===n.validationStatus?{code:"service_error",message:t.translate("taxes.vat_number.status.service_error")}:"resolved"===n.type&&"SERVICE_UNAVAILABLE"===n.validationStatus?{code:"service_unavailable",message:t.translate("taxes.vat_number.status.service_unavailable")}:null}))}(l),d=e((()=>s.value&&{type:"warning",value:s.value.message})),u=n.warnings.includes("DOMESTIC_NOT_APPLICABLE");return function(e,n){const t=c(e.type),i=c(n);a((()=>{i.current=n}),[n]);const o=e.type;a((()=>{const e=t.current;t.current=o,"pending"===e&&"resolved"===o&&i.current()}),[o])}(l.status,(()=>
2{if("resolved"===l.status.type&&"VALID"===l.status.validationStatus&&i)return pn({content:r.translate("taxes.vat_number.accessibility.status.applied"),role:"alert"});if(u)return pn({content:r.translate("taxes.vat_number.accessibility.status.domestic"),role:"status"});const e=s.value;if(e)switch(e.code){case"invalid_number":return pn({content:r.translate("taxes.vat_number.accessibility.status.invalid_number"),role:"alert"});case"service_error":return pn({content:r.translate("taxes.vat_number.accessibility.status.service_error"),role:"alert"});case"service_unavailable":return pn({content:r.translate("taxes.vat_number.accessibility.status.service_unavailable"),role:"alert"})}})),t(tn,{direction:"block",gap:"base",children:[t("div",{"aria-busy":l.loading,children:t(bn,{ref:o,name:"vatNumber",label:r.translate("taxes.vat_number.field.label"),autocomplete:"off",inputMode:"text",accessoryEnd:t(cl,{status:l.status}),error:d.value,...l})}),u&&t(vt,{tone:"info",children:r.translate("taxes.vat_number.domestic_order")})]})}export{Hr as $,er as A,Fo as B,Ai as C,bo as D,Ji as E,$o as F,pr as G,Ho as H,So as I,Uo as J,kr as K,gr as L,vr as M,Bo as N,fr as O,Ko as P,hr as Q,go as R,_r as S,wr as T,Eo as U,pl as V,Er as W,Br as X,xr as Y,Lr as Z,Sr as _,qr as a,po as a0,ti as a1,ko as a2,jo as b,ni as c,pi as d,io as e,No as f,$r as g,ol as h,To as i,ll as j,Jo as k,Yr as l,Xr as m,rl as n,ao as o,Ei as p,Pr as q,Qo as r,xi as s,Xo as t,Ao as u,wi as v,Di as w,fo as x,mi as y,Ro 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.