const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["f2ade998.nIBJYD6f.js","2c1ab0fe.Dbn2KvkT.js","4b4bc88f.z1yoAwwH.js","app.CooG55fE.js","assets/app.CcGlIMpn.css","assets/wallet-prefilled-guest-return.BZwmSkmD.css","1a6c2867.D8mTtJ_Z.js","assets/ShopPayVerificationTrigger.BnDF3H7t.css","5ef0d995.Br8DuiXF.js","164ad2e3.FTBuhkTQ.js","69fae6d4.DwAzRqQZ.js","f67abd2c.nPTvXZJz.js","e12db40c.DF32J314.js","9dba8418.NidtnoQ4.js","60a453ce.B80X1bY8.js","3d539943.CHiZMBrZ.js","assets/hydrate.noyuxvQL.css","74835653.BLveyRHP.js","3ca8ef7e.CoLpsNbY.js","2bac2c53.CBL7jHzd.js","a9fa9fda.CPgABguf.js","ca3e798e.BBho0lps.js","47b970b2.DCFIpVFI.js","22345fd4.DfRWVvfi.js","assets/PhoneField.uZEuHncj.css","064f6ac1.DHFjHCTV.js","assets/Popover.Bi1nHaU-.css","efa0389a.BBF5Yj3v.js","assets/Choice.CrYuHUmO.css","4b1c22b7.Tf9Z0cR8.js","assets/BillingAddressForm.BdwN7V1K.css","a25deb9a.e6U0ww9n.js","2fdb3dd3.Dn592ndi.js","29034f35.7WHWnwob.js","b13c0af6.D4KDplwL.js","91319467.CDisk9qF.js","71b60e0a.DfPLdYsH.js","24773686.CplnJ3xw.js","8fe56fc9._gTwhRQ_.js","2210eadb.DF0gIp_2.js","161adb7d.B9_eDsWP.js","assets/ShopPayVerificationSwitch.WW3cs_z5.css","d08a6c7d.B7aDvSZI.js","d02f7b10.tFae1DZR.js","assets/createWalletValidationLogger.BEEc8l-N.css","16c1b4d1.N3IlorTu.js","ee2bb050.DSvpEDSM.js","17e57de1.C4OivbHV.js","assets/useSandboxTelemetry.BoV0vp4z.css","78ab3dd0.UjAWxVn0.js","d4ea2faa.CFmOkqFN.js","33464469.0y7iVo6f.js","ed9f2238.3jB1CnRm.js","b8733b27.zcrWwlcv.js","384a4e10.CgRnecux.js","843aa2d4.DzLKOBo3.js","7fc410e0.mP12JRDt.js","cdfd59e6.CxVDNOs9.js","89e2d30a.BHZyUNbR.js","3a819064.B6WEUMsF.js","ec391382.Bx3C9xNN.js","assets/WalletApplePayLazy.-zu03NqF.css","d56ce0bb.CyUTw_eQ.js","7b0c98ea.CmmnLN9P.js","assets/TransitionHeight.CuRoM9zv.css","e3e348f2.DlRIwDFx.js","71ae3d5c.BgAyZsA9.js","31cc568e.95lmLO5k.js","1f5e7811.a2EjfHnG.js","assets/ShopPayLogo.87JMHPUK.css","0e67bd3b.rVVcKKmW.js","17425706.Du5FyTeZ.js","cb5cf153.DR2k6GTr.js","cb38e5c2.BMWpCITo.js","6fb6f9d8.D6yUmBOq.js","1444e6bd.CLS56A6L.js","0b8657b8.CiDJmOSt.js","55098bf1.C9NOZwx2.js","a422df8c.Cf87EYCO.js","assets/EmptyState.BEvzDDvy.css","f49d4216.CilLybTV.js","79974aab.BEktvauy.js","d22d2b80.B6GNsBAl.js","f58f39d8.CX1OVCRt.js","e03065ab.CTM9K0Hk.js","assets/ApplePayButton.CTcryfIc.css","56bd1136.BG0dj4Cd.js","cb8fcd45.CPq8qyv5.js","ddf59287._uCuCuxL.js","4aab4b34.BNmUgsb7.js","ac5a19ff.la4o1mqh.js","4c290a1e.B19piqXD.js","assets/amazonWalletLazy.D78LrA7v.css","assets/delivery-method-transitions.S-FSTp4Y.css","dce37576.Bv0ZJ2Eg.js","160e80e7.CSHcDjZe.js","be176b00.CeN1iCCX.js","assets/Map.cbVP6Hp_.css","8574876b.DdFjDDde.js","assets/PickupPointContent.D46g9C9h.css","7fb43285.BP0ifHSs.js","ff358f64.CxAdbpNt.js","ca0c3e72.CvmHYoux.js"])))=>i.map(i=>d[i]); import{m as e,F as n,u as t,h as a,q as i,v as o,j as r,k as l,p as s,T as c,G as u,t as d,o as p,D as m,n as h,M as v,w as _,g as y,P as g,aF as b,am as f,i as k,E as P,O as C,B as I,N as S,z as L}from"./2c1ab0fe.Dbn2KvkT.js";import{F as M,u as A,a as w}from"./3ca8ef7e.CoLpsNbY.js";import{d as E,a6 as x,F as N,w as T,er as O,b6 as B,b7 as D,b8 as F,ae as V,a4 as z,iH as R,cf as U,iI as H,a7 as j,iJ as K,y as q,aQ as $,b0 as G,iK as W,W as Y,ce as X,aR as Q,iL as J,iM as Z,ad as ee,iN as ne,iO as te,bp as ae,iP as ie,iQ as oe,_ as re,bf as le,iR as se,iS as ce,io as ue,c as de,iT as pe,iU as me,e2 as he,iV as ve,hE as _e,iW as ye,bi as ge,iX as be,bb as fe,q as ke,N as Pe,iY as Ce,ag as Ie,bh as Se,iZ as Le,h5 as Me,aw as Ae,i_ as we,ac as Ee,i$ as xe,j0 as Ne,be as Te,v as Oe,ec as Be,eb as De,x as Fe,j1 as Ve,j2 as ze,ci as Re,ab as Ue,ee as He,bg as je,bd as Ke}from"./4b4bc88f.z1yoAwwH.js";import{dY as qe,$ as $e,dZ as Ge,w as We,J as Ye,f as Xe,cY as Qe,S as Je,e_ as Ze,cT as en,a7 as nn,B as tn,bH as an,s as on,G as rn,k as ln,gp as sn,t as cn,gn as un,Z as dn,T as pn,bV as mn,c as hn,L as vn,hb as _n,o as yn,cf as gn,h2 as bn,de as fn,c_ as kn,gB as Pn,a as Cn,H as In,M as Sn,b as Ln,aJ as Mn,bt as An,cC as wn,Q as En,m as xn,ap as Nn,j as Tn,hc as On,p as Bn,hd as Dn,dm as Fn,al as Vn,U as zn,d as Rn,gi as Un,a0 as Hn,ag as jn,af as Kn,fj as qn,he as $n,bL as Gn,cv as Wn,fU as Yn,hf as Xn,cW as Qn,cX as Jn,cR as Zn,hg as et,fR as nt,f5 as tt,co as at,N as it,b_ as ot,b2 as rt,cD as lt,aV as st,bf as ct,hh as ut,Y as dt,g as pt,c5 as mt,hi as ht,X as vt,cE as _t,ai as yt,bY as gt,bX as bt,f4 as ft,cU as kt,e$ as Pt,hj as Ct,ar as It,bO as St,aS as Lt,dR as Mt,dB as At,dC as wt,bM as Et,cP as xt,fd as Nt,dp as Tt,ak as Ot,aR as Bt,eO as Dt,q as Ft,v as Vt,bN as zt,hk as Rt}from"./164ad2e3.FTBuhkTQ.js";import{b as Ut,v as Ht,u as jt,a as Kt}from"./1f5e7811.a2EjfHnG.js";import{p as qt,a as $t,S as Gt,M as Wt,e as Yt}from"./1a6c2867.D8mTtJ_Z.js";import{b as Xt,c as Qt,d as Jt,e as Zt,i as ea,f as na}from"./2fdb3dd3.Dn592ndi.js";import{u as ta,A as aa}from"./22345fd4.DfRWVvfi.js";import{u as ia,S as oa,a as ra,b as la,A as sa}from"./0e67bd3b.rVVcKKmW.js";import{h as ca,L as ua}from"./17425706.Du5FyTeZ.js";import{P as da,u as pa,F as ma}from"./47b970b2.DCFIpVFI.js";import{_ as ha,s as va}from"./app.CooG55fE.js";import{S as _a,u as ya,G as ga}from"./cb5cf153.DR2k6GTr.js";import{a as ba,c as fa,u as ka,d as Pa,e as Ca}from"./78ab3dd0.UjAWxVn0.js";import{b as Ia,d as Sa,S as La}from"./71ae3d5c.BgAyZsA9.js";import{g as Ma,P as Aa,h as wa}from"./e3e348f2.DlRIwDFx.js";import{S as Ea}from"./cb38e5c2.BMWpCITo.js";import{a as xa}from"./89e2d30a.BHZyUNbR.js";import{b as Na,d as Ta}from"./ed9f2238.3jB1CnRm.js";import{S as Oa}from"./6fb6f9d8.D6yUmBOq.js";import{M as Ba}from"./0b8657b8.CiDJmOSt.js";import{I as Da}from"./55098bf1.C9NOZwx2.js";import{b as Fa,C as Va,a as za}from"./efa0389a.BBF5Yj3v.js";import{C as Ra}from"./a422df8c.Cf87EYCO.js";import{P as Ua}from"./f49d4216.CilLybTV.js";import{A as Ha}from"./4b1c22b7.Tf9Z0cR8.js";import{S as ja}from"./79974aab.BEktvauy.js";import{T as Ka}from"./7b0c98ea.CmmnLN9P.js";import{P as qa}from"./064f6ac1.DHFjHCTV.js";import{u as $a}from"./d22d2b80.B6GNsBAl.js";import{a as Ga,s as Wa,M as Ya}from"./74835653.BLveyRHP.js";function Xa(){const{shop:n,checkout:t}=E(),{shippingAddress:a,billingAddress:i}=t.negotiator.parts,o=qe();return e(()=>{const e=qt({isShippingRequired:t.isShippingRequired.value,isPickupSelected:o.value,shippingCountryCode:a.fields.countryCode.value,billingCountryCode:i.fields.countryCode.value});return $t(n,e)})}function Qa(){const{shop:n,source:t,checkout:a}=E(),i=$e(),o=qe(),r=Ge(),l=Xa();return e(()=>{const e=a.negotiator.parts.phone.value,s=a.negotiator.parts.email.value,c=a.identity.current.value;let u,d=Boolean(l.value)||"OFF"!==n.smsMarketing;if("shopPay"!==c&&"businessCustomer"!==c||(d=!1),a.configuration.visibility.showSmsMarketing&&d&&!1!==i?.smsMarketingEnabled&&!N(t)){let n;n=e&&!s?"contact":o.value||!a.isShippingRequired.value?"billing":"delivery",u=r.value[n]?"root":n}else u="none";return{isNone:"none"===u,isContact:"contact"===u,isDelivery:"delivery"===u,isBilling:"billing"===u,isRoot:"root"===u}})}function Ja({origin:e="contact_info_page"}){const{negotiate:a}=We(),{i18n:i,userEvents:o,checkout:r,source:{checkoutSessionIdentifier:l,sourceId:s},shop:{id:c,myshopifyDomain:u}}=E(),{emailMarketingOptInShownSignal:d}=r.negotiator.context,{acceptEmailMarketing:p}=r.negotiator.parts,m=r.configuration.layout.isOnePage.value;n(()=>{d.value=!0},[d]);const h=ca("marketing.disclaimer.description_html",i)?t(Xe,{type:"small",color:"subdued",children:t(Ye,{children:i.translate("marketing.disclaimer.description_html",{privacy_policy_link:t(ua,{handle:"privacy-policy",tone:"monochrome"}),terms_of_service_link:t(ua,{handle:"terms-of-service",tone:"monochrome"})})})}):null;return t(Je,{gap:"small-200",children:[t(Qe,{id:"marketing_opt_in",name:"marketing_opt_in",checked:p.value,onChange:function(n){p.value=n,a({loading:["acceptEmailMarketing"],silenceViolations:["payment-session"]}),o.monorailEvent({schemaId:"checkout_email_marketing_optin_ui_interaction/1.0",payload:{checkoutToken:l||s,shopId:Number(T(c)),shopifyDomain:u,action:n?"click_email_opt_in":"unclick_email_opt_in",origin:e,checkoutVersion:m?"checkout_one_redesign":"checkout_one"}})},label:Za({identity:r.identity,i18n:i})}),h]})}function Za({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")}}Ja.displayName="MarketingOptIn";const ei=/[^>]*)>(?.*?)<\/a>/gi,ni=/data-policy-handle=(["'])(?privacy-policy|terms-of-service)\1/i,ti=/<\/?[a-z][\s\S]*>/i;function ai(e){return t(Ye,{dangerouslySetInnerHTML:{__html:e}})}function ii(e,n){return t("span",{dangerouslySetInnerHTML:{__html:e}},n)}function oi(e){const n=[];let a=0,i=!1;for(const r of e.matchAll(ei)){const o=r.index,l=ri(r);if(null==o||!l)continue;const s=e.slice(a,o);if(ti.test(s))return ai(e);s&&n.push(ii(s,`text-before-${o}`)),n.push(t(ua,{handle:l,tone:"monochrome"},`${l}-${o}`)),a=o+r[0].length,i=!0}const o=e.slice(a);return!i||ti.test(o)?ai(e):(o&&n.push(ii(o,"trailing-text")),t(Ye,{children:n}))}function ri(e){const n=e.groups?.attributes??"",t=n.match(ni)?.groups?.handle;return"privacy-policy"===t?"privacy-policy":"terms-of-service"===t?"terms-of-service":null}function li(e){return e?.label&&e.disclaimerHtml.trim()?e:void 0}function si(){const{i18n:r,shop:l,checkout:s,embed:c}=E(),{marketingPhoneInputError:u,previousPhoneMarketingDisclosureKeySignal:d,smsMarketingOptInShownSignal:p}=s.negotiator.context,{phone:m,acceptSmsMarketing:h,smsMarketingPhone:v,shippingAddress:_}=s.negotiator.parts,y=Xt(),g=Xa(),b=g.value,f=li(b),k=!b&&"OFF"!==l.smsMarketing,P=f?.label??(k?r.translate("marketing.accept_sms_checkbox_label"):void 0),C=Boolean(P);n(()=>{C&&(p.value=!0)},[C,p]);const{handleSmsMarketingConsent:I}=Qt(),S=e(()=>s.negotiator.current.fields.buyerIdentity.value?.customerProfile),L=e(()=>!m.value&&!s.proposal.negotiated.fields.availableDeliveryAddresses.value?.length),M=e(()=>Boolean(!m.value)),A=e(()=>!c?.isFlagshipPartner&&!S.value&&!M.value);a(()=>{if(!v.value){const e=L.value?_.fields.phone.value:m.value;v.value=e??""}},[]),i(()=>{const e=_.fields.phone.value;L.value&&!li(g.value)&&"OFF"===l.smsMarketing&&(v.value=e||"")}),Jt(),i(()=>{const e=(n=g.value)?JSON.stringify([n.label,n.disclaimerHtml]):null;var n;const t=d.peek();d.value=e,null!=t&&null!=e&&t!==e&&h.value&&(h.value=!1)}),i(()=>{m.value&&!S.value&&(v.value=m.value)});const w=r.translate("field_errors.sms_marketing_phone_invalid"),x=Zt(w),N=o(()=>({state:{phone:v},errors:{phone:u}}),[u,v]);if(!P)return null;const T=t(Xe,f?{type:"small",color:"subdued",children:oi(f.disclaimerHtml)}:{type:"small",color:"subdued",children:t(Ye,{children:r.translate("marketing.sms.disclaimer.description_html",{privacy_policy_link:t(ua,{handle:"privacy-policy",tone:"monochrome"}),terms_of_service_link:t(ua,{handle:"terms-of-service",tone:"monochrome"})})})});return t(en,{...N,children:t(Ze,{id:"smsMarketingOptInDisclosure",open:h.value,summary:t(Qe,{id:"sms_marketing_opt_in",name:"sms_marketing_opt_in",label:P,checked:h.value,onChange:function(e){u.value=void 0,I(e)},"aria-controls":"smsMarketingOptInDisclosure"}),content:t(Je,{gap:"base",paddingBlockStart:"base",children:[t(da,{countryCode:y.value??"",label:r.translate("marketing.sms.mobile_phone_number"),disabled:A.value,caretPosition:0,prefillCountryCode:!0,icon:"mobile",...h.value?x:{}}),T]})})})}si.displayName="PhoneMarketingOptIn";const ci=r({displayName:"ShopPayVerificationSwitch",load:()=>l(()=>ha(()=>import("./f2ade998.nIBJYD6f.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41])))});function ui({onClick:e}){const{i18n:n}=E();return t(tn,{variant:"primary",accessibilityLabel:n.translate("account_management.verification_toggle"),onClick:e,segment:"end",children:t("div",{className:"rdvNk",children:t(nn,{type:"mobile",size:"large"})})})}function di({emailInput:e,email:n,isShopPayUnauthenticatedUser:t}){const{shopPay:o}=E(),r=c(""),l=t?Wt.C1ModalShopPay:void 0,[s,p]=u(l),[m,h]=u(!1),[v,_]=u(!1),y=n.trim(),g=d((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&&[Gt.LoginLink,Gt.ErrorModalClearEmail].includes(e.source)&&(p(Wt.C1ModalShopPaySignIn),e.source===Gt.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 pi=cn("EmailFieldAccessory");function mi({saved:e}){const{i18n:n}=E(),i=on(void 0,pi),o=n.translate("contact.field_saved_label"),[r,l]=u(!1);a(()=>{if(e)return rn({content:o,role:"status"})},[e,o]);const s=e&&!r,c={inert:s};return t("span",{className:"iWrC7",children:[t("span",{className:p(e&&"aDczq",s&&"jUk6e"),onFocus:()=>l(!0),onBlur:()=>l(!1),...c,children:t(nn,{type:"question",interestFor:i,accessibilityLabel:n.translate("contact.field_tooltip_accessibility_label")})}),e?t("span",{className:"oMR3v","aria-hidden":!0,children:t(ln,{type:"small",tone:"neutral",children:o})}):null,t(sn,{id:i,children:n.translate("contact.field_tooltip_helper_text")})]})}function hi(e){return(e??"").trim().toLowerCase()}const vi="contact-information-text-field-container",_i=`#${vi}`;function yi({onInputTypeChange:e,onInlineEmailValidation:n,onInlinePhoneValidation:r}){const l=V(),{inMemoryPayPalParts:{accountStatus:d}}=z(),{i18n:p,observability:v,shop:_,shopPay:y,checkout:g,source:b}=E(),f=y.user.isUnauthenticatedUser.value,k=x(),P=Xt(),{email:C,phone:I,smsMarketingPhone:S}=g.negotiator.parts,L=C.value,M=I.value,[A,w]=u(C.peek()??""),[N,T]=u(k.value||""===I.peek()||""!==C.peek()&&C.peek()||f?"EMAIL":"PHONE"),[H,j]=u(0),K=p.translate("contact.email_or_phone_label"),q=p.translate("field_errors.email_or_phone_invalid"),$=function(e,n,t="PHONE"){const{observability:a,checkout:{validation:{contactErrors:{phoneInputError:i,emailInputError:o}},wallets:r,negotiator:l}}=E(),{phone:c}=l.parts,u=r.activeSession.value;an(e=>{if("EMAIL"!==t&&"error"===e.type)for(const t of e.violations)if("UnprocessableTermViolation"===t.__typename&&O.has(t.code)&&!ea(t.target))if("BUYER_IDENTITY_EMAIL_REQUIRED"===t.code){const e=t.localizedMessage??t.nonLocalizedMessage;i.value=e}else{const e=n||(t.localizedMessage??t.nonLocalizedMessage);i.value=e,o.value=void 0}});const d=s(void 0),p=u?d:i;return B(c,p,n=>{if(u)a.leaveErrorBreadcrumb("[useValidatedPhoneField] Not validating phone - wallet session active");else{if("EMAIL"!==t)return a.leaveErrorBreadcrumb("[useValidatedPhoneField] Validating phone number"),e(n);a.leaveErrorBreadcrumb("[useValidatedPhoneField] Skipping phone validation - input type is EMAIL")}},D.InvalidContactMethod),F(c,p,"PHONE"===t?e:void 0)}(r,q,N),G=R(_,P.value),W=k.value||f||!G.includes("PHONE"),Y=""===A&&!L,X="IN"===P.value&&!W&&Y?"tel":"email";function Q(e,n){if("EMAIL"===N&&(w(e),f&&oe(Wt.C1ModalShopPay)),!W)if(null!=n&&j(n),""===e)T("EMAIL"),h(()=>{I.value="",C.value="","PHONE"===N&&(S.value="")}),v?.leaveErrorBreadcrumb("[ContactInformation] Input type reset to EMAIL (both fields empty)");else{const n=/([A-Za-z]|\.|@)/.test(e);n&&"EMAIL"!==N?(v.leaveErrorBreadcrumb("[ContactInformation] Input type changed to EMAIL"),h(()=>{I.value="",C.value=e,S.value=""}),T("EMAIL")):n||"PHONE"===N||(v.leaveErrorBreadcrumb("[ContactInformation] Input type changed to PHONE"),C.value="",I.value=e,T("PHONE"))}}a(()=>{v.leaveErrorBreadcrumb("[ContactInformation] Component mounted")},[v]),a(()=>{e&&e(N)},[e,N]),a(function(){if(W)return void("EMAIL"!==N&&T("EMAIL"));const e=null!=L&&""!==L,n=null!=M&&""!==M;return e||n||"EMAIL"===N?e&&"EMAIL"!==N?(v.leaveErrorBreadcrumb("[ContactInformation] Input type synced to EMAIL from proposed contact info"),void T("EMAIL")):void(!e&&n&&"PHONE"!==N&&(v.leaveErrorBreadcrumb("[ContactInformation] Input type synced to PHONE from proposed contact info"),T("PHONE"))):(v.leaveErrorBreadcrumb("[ContactInformation] Input type reset to EMAIL from empty proposed contact info"),void T("EMAIL"))},[L,N,v,W,M]);const J=c(!0);a(function(){const e=J.current;J.current=!1,(!G.includes("PHONE")||f)&&"EMAIL"!==N&&(T("EMAIL"),""===L&&""!==M&&(I.value="",e||(C.value=M)))},[G]),U(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 Z=ia(),{modalUrlOrigin:ee,modalUpdatedOrigin:ne,shopPayVerificationVisible:te,showShopPayVerificationToggle:ae,showShopPayVerification:ie,setModalUpdatedOrigin:oe,setShowShopPayVerificationToggle:re}=di({emailInput:A,email:C.value,isShopPayUnauthenticatedUser:f}),le=c(null),se=function(e,n,t="EMAIL"){const{i18n:a,checkout:{validation:{contactErrors:{emailInputError:i,phoneInputError:o}},wallets:r,negotiator:l},observability:c}=E(),{email:u}=l.parts,{inMemoryApplePayParts:{asPaymentMethod:d,isLoadingPaymentSheet:p},inMemoryPayPalParts:{isLoadingPaymentSheet:m}}=z();an(n=>{if("PHONE"!==t)if("error"===n.type)if(!r.activeSession.value||d.value)if("negotiation"!==n.negotiationStage||p.value||m.value){c.leaveErrorBreadcrumb(`[ContactInformation] Processing ${n.violations.length} violations`);for(const t of n.violations){if("UnprocessableTermViolation"!==t.__typename||!O.has(t.code)||ea(t.target))continue;const n=e||(t.localizedMessage??t.nonLocalizedMessage);i.value=n,o.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 h=s(void 0),v=r.activeSession.value?h:i;return B(u,v,e=>{if(r.activeSession.value)return void c.leaveErrorBreadcrumb("[ContactInformation] Not validating 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=Ht(e,a.translate("field_errors.email_blank")),i=Ut(e,a.translate("field_errors.email_invalid"));return t||i},D.InvalidContactMethod),F(u,v,"EMAIL"===t?n:void 0)}(W?void 0:q,"PHONE"===N?gi:n,N),ce=g.negotiator,ue=ce.current.value.contactInfo?.email,de=function(e,n){const t=o(()=>hi(e),[e]),i=o(()=>hi(n),[n]),[r,l]=u(!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??"",ue),pe=!b.isAbandonedCheckoutSupported||"EMAIL"!==N||Z.value&&ae?void 0:t(mi,{saved:de}),me=pa({countryCode:P.value??"",label:K,onInputValueChange:Q,caretPosition:H,inputMode:"text",disableFormatting:!0,required:!0,...$}),he=W?void 0:{label:K,type:"text",caretPosition:H,inputMode:"text"},ve=function({ref:e,email:n,addressType:o="shipping",contactAutocompleteType:r="email",disabled:l,label:s,onInputValueChange:c,caretPosition:u,inputMode:d,type:p="email",required:m,accessory:h}){const{i18n:v,shopPay:_}=E();return a(()=>{if(void 0!==u&&e.current&&n?.value&&u{"invalid"!==Ut(t.value,"invalid")&&n.cookies.get("_tracking_consent")})}(),{label:s??v.translate("contact.email_label"),id:"email",name:"email",type:p,ref:e,autocomplete:un([o,r]),disabled:l,inputMode:d,...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(hn,{size:"small"}):h,required:m}}({email:se,ref:le,addressType:g.isShippingRequired.value?"shipping":"billing",disabled:"loading"===d.value.status,required:!0,accessory:pe,contactAutocompleteType:X,...he,onInputValueChange:Q}),_e="PHONE"===N?me:ve,ye=Z.value&&ae?t(ui,{onClick:()=>{ie(!0),f&&oe(Wt.C1ModalShopPay)}}):null,ge=Z.value?t(m,{when:l,children:t(ci,{popoverActivator:le,popoverAnchorSelector:_i,email:A,onSetEmail:e=>{se.onInput(e),Q(e),se.onChange(e)},open:te,showPopover:ie,showToggle:re,urlOrigin:ee,updatedOrigin:ne})}):null,be="PHONE"===N?"phone":"email",fe=t(Je,{gap:"small-400",children:[t(dn,{id:vi,gridTemplateColumns:"minmax(0, 1fr) auto",gap:"none",children:[t(pn,{..._e,id:be,error:Boolean(_e.error),segment:ye?"start":void 0}),ye]}),"string"==typeof _e.error&&_e.error?t(mn,{controlID:be,children:_e.error}):null]});return t("div",{children:[fe,ge]})}function gi(){}function bi({showLogoutLink:e,logoutUrl:n}){const{i18n:i,shopPay:o,observability:r,source:l,checkout:{negotiator:s}}=E(),c=s.current.fields.buyerIdentity.value,{firstName:u,lastName:d,email:p,phone:m}=c?.customerProfile??{},h=c?.purchasingCompany?.company.name,_=ia(),y="simulated"===l.type,g=u||d,{phone:b}=s.parts,f=p??m,k=!h&&f?` (${f})`:"",{modalUrlOrigin:P,modalUpdatedOrigin:C,shopPayVerificationVisible:I,showShopPayVerification:S}=di({isShopPayUnauthenticatedUser:o.user.isUnauthenticatedUser.value,email:p||""});return a(()=>{r.leaveErrorBreadcrumb(`[CustomerCard] Rendered - hasEmail: ${Boolean(p)}, hasPhone: ${Boolean(m)}`),c?.purchasingCompany||(b.value="")},[]),t(v,{children:[t(Je,{direction:"inline",alignItems:"center",gap:"base",children:t(Je,{gap:"small-400",children:[t(ln,{children:g?`${i.translate("general.display_name",{firstName:u??"",lastName:d??""})}${k}`:k}),h?t(Je,{direction:"inline",gap:"small-400",children:[t(ln,{color:"subdued",type:"small",children:h}),p&&t(v,{children:[t(ln,{color:"subdued",type:"small",children:"•"}),t(ln,{color:"subdued",type:"small",children:p})]})]}):null,e&&!y?t(Je,{direction:"inline",gap:"base",children:t(vn,{href:n,children:i.translate("customer_account.sign_out_link_label")})}):null]})}),p&&_.value&&t(ci,{email:p,open:I,showPopover:S,urlOrigin:P,updatedOrigin:C})]})}function fi(){const{i18n:e}=E();return t(ln,{color:"subdued",size:"small",accessibilityLive:"polite",children:e.translate("marketing.sms.disclaimer.description_transactional_html",{privacy_policy_modal_link:t(ua,{handle:"privacy-policy",tone:"monochrome"}),terms_of_service_modal_link:t(ua,{handle:"terms-of-service",tone:"monochrome"})})})}function ki({hideAllOptIns:n=!1,hideContactInfoEntry:a=!1,hideCustomerCard:i=!1,showEmailMarketingOptIn:r=!0,onValidateEmailInput:l}){const{client:s,checkout:c,i18n:p,checkout:{validation:{contactErrors:{emailInputError:h,phoneInputError:_}},wallets:y},shop:g}=E(),b=c.negotiator.current.fields.buyerIdentity.value?.customerProfile,f=_n().value,k=$e(),P=!1===k?.smsMarketingEnabled,{emailMarketing:C,contactInfoOptions:I}=g,S=s.unstable_getSerialization("logoutUrl")||"",L=Qa(),A=e(()=>L.value.isContact),{showEmailMarketing:w}=c.configuration.visibility,N=g.hasFlagEnabled(H),{value:T}=c.negotiator.current.fields.buyerIdentity,O=T?.countryCode,[B,D]=u(r&&Pi({emailMarketing:C,inputType:"EMAIL",hideNonEuropeMarketingOptInFlagEnabled:N,buyerCountryCode:O,customerProfile:b,showEmailMarketing:w})),[F,V]=u(!1),z=Xt(),{validatePhoneNumber:U}=ta(),{negotiate:K}=We(),q=d(e=>{D(r&&Pi({emailMarketing:C,inputType:e,hideNonEuropeMarketingOptInFlagEnabled:N,buyerCountryCode:O,showEmailMarketing:w})),V(!1)},[C,N,O,r,w]),$=function(){const{i18n:n,shop:t,shopPay:a,checkout:{negotiator:i}}=E(),{shippingAddress:o}=i.parts,r=x();return e(()=>{const e=o.fields.countryCode.value,i=(e&&t.countrySpecific[e]?.contactInfoOptions)??t.contactInfoOptions;return r.value||a.user.isUnauthenticatedUser.value||!i.includes("PHONE")?n.translate("field_errors.email_blank"):n.translate("field_errors.email_or_phone_blank")})}(),G=d(e=>{const n=Ht(e,$.value),t=Ut(e,p.translate("field_errors.email_invalid"));return n||t||l?.(e)},[$,l,p]),W=d(e=>{const n=Ht(e,p.translate("field_errors.email_or_phone_blank"));if(n)return V(!n),n;const t=U(e,z.value??"ZZ")?void 0:p.translate("field_errors.address_phone_blank");return V(!t),t},[p,U,z]),Y=yn(),X=gn(),Q=d(({contact:e})=>{y.activeSession.value||K({silenceViolations:["all"],fieldsToResolve:[...bn]}),e.value=!0,Y("sectionComplete",{section:"contact",timestamp:new Date}),X({type:"section_complete",section:"contact"})},[y,K,Y,X]),J=d(({contact:e})=>{e.value=!1},[]),{email:Z,phone:ee}=c.negotiator.parts,ne=o(()=>({state:{phone:ee,email:Z},errors:{phone:_,email:h}}),[Z,h,ee,_]),te=x(),ae=g.hasFlagEnabled(j)?R(g,z.value):I,ie=te.value||!ae.includes("PHONE"),oe=!b?.email&&!b?.phone||ie&&!b?.email;return t(M,{children:t(fn,{target:"cart.buyerIdentity",children:[b&&!i&&t(bi,{showLogoutLink:f,logoutUrl:S}),!a&&oe&&t(en,{...ne,children:t(oa,{onValid:Q,onInvalid:J,children:t(yi,{onInputTypeChange:q,onInlineEmailValidation:G,onInlinePhoneValidation:W})})}),!n&&t(v,{children:[F&&!P?t(fi,{}):null,r&&B?t(Ja,{}):null,t(m,{when:A,children:t(si,{})})]})]})})}function Pi(e){const{emailMarketing:n,inputType:t,hideNonEuropeMarketingOptInFlagEnabled:a,buyerCountryCode:i,customerProfile:o,showEmailMarketing:r}=e,l=a&&!K(i);return r&&"OFF"!==n&&"EMAIL"===t&&!l&&!o?.acceptsEmailMarketing}function Ci(){const e=kn(),{checkout:{negotiator:n}}=E(),{editorSetShopPaySignal:t}=n.context,a=d(e=>t.value?.setShopPay(e),[t]);return{setEditorShopPay:e&&t.value?a:void 0}}function Ii(){const n=Pn(),t=function(){const{checkout:n}=E(),t=ra();return e(()=>t.value&&n.configuration.visibility.showExpressCheckout.value)}();return e(()=>n.value?"wallets":t.value?"skeleton":"hidden")}bi.displayName="CustomerCard";const Si={ApplePayButton:"vT2w7",dark:"f1x20",light:"hKWGx"},Li=r({displayName:"ApplePaySandboxButton",useError:Ni,load:()=>l(()=>ha(()=>import("./d08a6c7d.B7aDvSZI.js"),__vite__mapDeps([42,1,2,3,4,5,43,15,44,45,9,10,11,12,13,14,16,46,47,21,6,7,48,49,50,51,52,53,19,54,55,56,23,57,58,59,20,60,37,61])).then(e=>e.ApplePaySandboxButton))}),Mi=r({displayName:"ApplePayButton",suspense:!1,renderLoading:e=>t(xi,{...e}),useError:Ni,load:()=>l(()=>ha(async()=>{const{ApplePayButton:e}=await(import("./d56ce0bb.CyUTw_eQ.js"));return{ApplePayButton:e}},__vite__mapDeps([62,1,2,3,4,5,9,10,11,12,13,14,15,16,50,63,64,65,66,67,6,7,18,68,69,32,23,70,17,19,20,21,22,24,25,26,27,28,29,30,71,72,73,49,58,52,74,75,76,77,78,79,80,81,82,83,84,85])).then(({ApplePayButton:e})=>e))});function Ai(e){return Ei(),t(Li,{...e})}function wi(e){return Ei(),t(Mi,{...e})}function Ei(){const{source:e}=E(),{buttonStatus:n,sessionLoadFailed:t}=z().inMemoryApplePayParts;Ia("ApplePay","simulated"!==e.type&&"not_rendered"===n.value.status&&!t.value)}function xi({color:e}){const{i18n:n}=E();return t("button",{className:p(Si.ApplePayButton,Si[e],Yt.borderRadius,q({focusRing:"base"})),lang:n.locale,disabled:!0,type:"button","aria-label":n.translate("brand.apple_pay")})}function Ni(e){const{observability:n}=E(),{buttonStatus:t}=z().inMemoryApplePayParts;a(()=>{e&&(t.value={status:"error"},n.leaveErrorBreadcrumb("Apple Pay button chunk failed to load",{wallet:ba.ApplePay,errorName:e.name,errorMessage:e.message}),n.counter({name:"checkout_wallet_button_rendered",value:1,attributes:{wallet_name:ba.ApplePay,status:"error",reason:"chunk_load_error",isPaymentMethodFlow:!1}}))},[t,e,n])}const Ti=r({displayName:"PortableWalletsPCIButtonContent",load:()=>ha(()=>import("./56bd1136.BG0dj4Cd.js"),__vite__mapDeps([86,1,9,2,3,4,5,10,11,12,13,14,15,16,46,47,21,87,45,6,7,48,88,89,58,37,90,91,92])).then(e=>e.PortableWalletsPCIButtonContent),useError:la});function Oi(e){const{shop:n}=E(),a=V(),i=n.hasFlagEnabled($),o=t(Ti,{...e});return i?t(m,{when:a,children:o}):o}function Bi(){const{shopPay:e,observability:n,checkout:{wallets:i}}=E(),o=Na(ba.ShopifyPay),r=jt({foregroundColor:Ea}),l=Kt(),s=na(G.DirectCheckoutCheckout),c=Cn(),u=xa(ba.ShopifyPay),{setEditorShopPay:m}=Ci();a(()=>{n.counter({name:"checkout_wallet_button_rendered",value:1,attributes:{wallet_name:"SHOP_PAY",status:"success"}})},[n]);const h=d(()=>{o(fa.Success),u(),i.setActiveSession({newValue:"SHOP_PAY",asPaymentMethod:!1}),i.clearActiveSession({invokingWallet:"SHOP_PAY"})},[i,u,o]),v=d(e=>{if(m)return e.preventDefault(),void m(!0);h()},[h,m]),_=p("Xicuw",!r&&"dark"!==l&&"oHCaH","automatic"===l&&"LTNIU",Yt.borderRadius,q({focusRing:"base"}));return t("a",{id:"shop-pay-button",href:s,ref:c("shop_pay"),className:_,onClick:v,children:"shop"===e.logoBrand?t(Oa,{size:"medium"}):t(_a,{size:"medium"})})}function Di(){const{i18n:e}=E();return t(Sn,{open:!0,blocking:!0,accessibilityLabel:e.translate("wallets.payment_in_progress_title"),padding:"none",children:t(Je,{gap:"large-200",padding:"large-200",children:[t(In,{level:1,children:e.translate("wallets.payment_in_progress_title")}),t(ln,{children:e.translate("wallets.payment_in_progress_body")})]})})}const Fi={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"},Vi="express-checkout-heading";function zi({buttonCount:e,footer:n,children:a}){const{i18n:i}=E();return t(Ln,{className:Fi.Container,"data-count":e,children:[t("div",{className:Fi.Header,children:t(aa,{id:Vi,className:Fi.Text,children:i.translate("alternative_payment_method_banner.express_checkout")})}),t("div",{className:Fi.StackWrapper,children:[t("div",{className:Fi.Layout,children:a}),n]})]})}function Ri({count:e,transition:n,shopPayEmphasis:a=!1,hideWallets:i=!1}){const{client:o}=E(),r="fast"!==o.unstable_getSerialization("workerVersion");return t("div",{className:p(Fi.Stack,Fi.SkeletonWrapper,"exited"===n&&Fi.SkeletonExited,a&&Fi.ShopPayEmphasis,i&&Fi.DrawerHideButtons),children:[...Array(e).keys()].map(e=>t(Mn,{delay:r},e))})}const Ui=/(iPhone|iPod|iPad|Mac OS)/i,Hi=/((iPhone|iPod|iPad).*AppleWebKit(?!.*(Safari|instagram|FBAV|FB_IAB)))/i,ji=/(ShopifyCheckoutSDK|CheckoutSheetProtocol|ShopifyCheckoutKit)/i;function Ki(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 qi({buttonCount:n,children:r,walletPaymentMethods:l}){const[s,h]=u(performance.now()),[y,g]=u(!0),b=function(){const{client:{userAgent:e},embed:n}=E(),t=Hi.test(e),a=Ui.test(e)&&ji.test(e),i=void 0!==n&&("SWIFT"===n.platform||"REACT_NATIVE_SWIFT"===n.platform);return!(a||t||i)}(),f=V(),{inMemoryApplePayParts:{paymentSheetError:k}}=z(),P=function(){const{source:n}=E(),t=function(){const n=z();return e(()=>W.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 Y.AmazonPay:return e.inMemoryAmazonPayParts.buttonStatus.value;case Y.BuyWithPrime:return e.inMemoryAmazonPayParts.buyWithPrimeButtonStatus.value;default:return}})();return t&&"not_rendered"===a?.status}(n,e)))}(),a="simulated"===n.type;return e(()=>!a&&t.value)}().value,C=function(){const{source:e}=E(),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:u},acceleratedWalletPaymentMethods:d}=z(),p=d.value;return o(()=>p.flatMap(e=>{switch(e.name){case"PAYPAL_EXPRESS":return Ki(i,ba.PayPalV6);case"VENMO":return Ki(r,ba.Venmo);case"GOOGLE_PAY":return Ki(l,ba.GooglePay);case"SHOP_PAY":return Ki(u,ba.ShopifyPay);case Y.AmazonPay:return Ki(s,Y.AmazonPay);case Y.BuyWithPrime:return Ki(c,Y.BuyWithPrime);case"APPLE_PAY":return Ki(t,ba.ApplePay,()=>!n&&!a.value);default:return[]}}),[t,a,p,s,c,l,n,i,u,r])}();Ma(C),function(e){const{observability:n}=E(),t=c(performance.now()),a=o(()=>e.filter(({walletName:e})=>e!==ba.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}}))})})}(C);const I=An(P,"base"),[S,L]=u(!1),M=x(),{checkout:A,i18n:w,shop:{id:N},source:O,observability:B,userEvents:D}=E(),F=A.negotiator.current.fields.managedByMarketsPro,R=wn(),U=e(()=>f.value&&"full_express_agreement"===X({hasSubscription:Q({checkout:A}),isApplePayAvailable:l.value.some(({name:e})=>"APPLE_PAY"===e),variant:R})),H=ka();Pa(l.value,n);const j=d((e,t)=>{const a=parseInt(T(N),10),i=Ca({state:t,shopId:a,nascarData:{...e,walletsRenderedCount:n},paymentMethods:l.value});i&&D.monorailEvent(i)},[N,D,n,l]),K=l.value.some(e=>"SHOP_PAY"===e.name)&&b;P||S||(L(!0),h(e=>performance.now()-e)),a(()=>{S&&B.histogram({name:"wallets_container_render_time",value:s})},[S,B,s]);const q=c(!1);return a(()=>{"simulated"===O.type||"exited"!==I||q.current||(q.current=!0,performance.mark(J))},[O,I]),t(v,{children:[t(zi,{buttonCount:n,footer:t(v,{children:[t("div",{className:Fi.DrawerLink,children:t(vn,{accessibilityLive:"polite",textDecoration:"none",onClick:()=>{y?(g(!1),j(H.value,fa.NascarDrawerOpen)):(g(!0),j(H.value,fa.NascarDrawerClose))},children:t("div",{className:Fi.InnerDrawerLink,children:[t(ln,{children:y?w.translate("alternative_payment_method_banner.show_more_options"):w.translate("alternative_payment_method_banner.hide_more_options")}),t(nn,{type:y?"chevron-down":"chevron-up",size:"small-200"})]})})}),t(m,{when:M,children:t(Aa,{isForExpressCheckout:!0,showFullSubscriptionConsent:U})}),t(m,{when:F,children:t(Je,{gap:"base",padding:"large-100 none none none",children:t(Ba,{textProps:{color:"subdued",size:"small"}})})})]}),children:[t(Ri,{count:Math.min(n,4),transition:I,shopPayEmphasis:K,hideWallets:y}),t("ul",{id:"express-checkout-wallets-wrapper",role:"list",className:p(Fi.Stack,Fi.ButtonWrapper,P&&Fi.loading,P&&S&&Fi.subsequentLoad,y&&Fi.DrawerHideButtons,K&&Fi.ShopPayEmphasis),children:f.value&&r})]}),"payment_cancelled_while_processing"===k?.value?.type&&t(Di,{})]})}function $i(){const{i18n:e}=E(),{divider:{borderStyle:n,borderWidth:a}}=En(),{main:{divider:{borderStyle:i=n,borderWidth:o=a}={},section:r,spacing:l}}=xn(),s=Z(r);return t(Ln,{padding:s?`@media (inline-size >= extraSmall) ${l?ne(l):"large-200"} none, ${l?ne(l):"base"} none`:"large-100 none large-300 none",children:t(Nn,{borderStyle:i,borderWidth:ee(o),children:t(Xe,{textAlign:"center",children:t(ln,{color:"subdued",children:e.translate("alternative_payment_method_banner.or")})})})})}function Gi(){return t(v,{children:[t(Tn,{accessibilityLabelledBy:Vi,children:t(zi,{buttonCount:3,children:t(Ri,{count:3,shopPayEmphasis:!0})})}),t($i,{})]})}const Wi=e=>e,Yi=y(function(){const{i18n:e,source:n}=E(),a="simulated"===n.type,{acceleratedWalletPaymentMethods:i,buttonCount:o}=z(),r=On(),l=Ii(),{setEditorShopPay:s}=Ci(),{expressCheckout:{button:{cornerRadius:c}={}}}=xn(),u=Bn("Checkout::Dynamic::Render","WALLETS1"),d=Dn(),p=a&&d.value&&!i.value.length;switch(l.value){case"hidden":return null;case"skeleton":return t(Gi,{})}const m=t("li",{className:Fi.walletItem,children:t(Ln,{padding:"large-200",borderRadius:"base",blockAlignment:"center",inlineAlignment:"center",minInlineSize:"100%",className:"_2SmAP",children:t(ln,{color:"subdued",children:e.translate("payment.simulated_express_checkout")})})});return t("div",{style:{...Qi(c)},children:[t(Tn,{accessibilityLabelledBy:Vi,children:t(Fn,{sectionId:"expressCheckout",children:t(Vn,{section:"expressCheckout",children:[t(zn,{customizations:u,gap:"large-200",render:Wi}),u.length>0&&t(Rn,{blockSize:"large-200"}),t(qi,{buttonCount:p?1:o,walletPaymentMethods:i,children:p?m:t(Xi,{paymentMethods:i.value,triggerProgression:r.value,isSimulated:a,preserveShopPay:Boolean(s)})})]})})}),t($i,{})]})});function Xi({paymentMethods:e,triggerProgression:n,isSimulated:a,preserveShopPay:i}){const o=Un(),r=ya();return t(v,{children:e.map(e=>{if(a&&"VENMO"===e.name)return null;const l=a&&"SHOP_PAY"===e.name&&i;return t("li",{className:Fi.walletItem,children:a&&!l?t(Ln,{className:"eFu6h",children:t(Ln,{className:p([Fi.walletButton,Fi.Stack,Fi.SimulatedWalletStack]),inert:!0,children:t(Ji,{method:e,triggerProgression:n})})}):t(Ji,{method:e,triggerProgression:n})},`${e.name}-${o}-${r.value}`)})})}function Qi(e){return e&&{"--x-express-checkout-button-border-radius":(n=ae.borderRadius,e=>e?n[e]:void 0)(e)};var n}function Ji({method:e,triggerProgression:n}){const a=Un(),{shop:i}=E(),o=i.hasFlagEnabled(te);switch(e.name){case"APPLE_PAY":return t(o?Ai:wi,{supportedNetworks:e.supportedNetworks,color:a});case"PAYPAL_EXPRESS":return t(wa,{progressToNextPage:n});case"VENMO":return t(wa,{fundingSource:"venmo",buttonColor:"blue",progressToNextPage:n});case"SHOP_PAY":return t(Bi,{});case"GOOGLE_PAY":return t(ga,{});case Y.AmazonPay:return t(sa,{});case Y.BuyWithPrime:return t(Oi,{wallet:Y.BuyWithPrime});default:return null}}const Zi=["ApplePay","GooglePay","PayPal","Venmo"];function eo({id:e}){return Sa({id:e,stage:({pendingComponents:e})=>Zi.some(n=>e.has(n))?La.Usable:La.Complete}),null}function no(){const{i18n:e,checkout:{negotiator:n}}=E(),a=n.current.fields.buyerIdentity.value?.customerProfile,i=Hn().value,{value:o}=n.current.fields.buyerIdentity,r=n.parts.rememberMe,l=Boolean(o?.rememberMe)||r.value,c=s(l),{negotiate:u}=We(),p=$e(),m=p?.saveShippingAddressCheckboxEnabled??!0,h=Boolean(a),v=n.parts.shippingAddress.value,_=!i&&m&&!h&&!v.oneTimeUse,y=d(e=>{c.value=e,r.value=e,u({silenceViolations:["payment-session"]})},[u,r,c]);return _?t(Qe,{id:"save_shipping_information",name:"save_shipping_information",checked:c.value,onChange:y,label:e.translate("customer_account.save_my_information_label")}):null}function to({message:e}){return e?t(Kn,{errorType:jn.DeliveryError,tone:"critical",children:t(Je,{alignItems:"start",gap:"small-500",children:t(ln,{children:e})})}):null}function ao(){const{i18n:e,url:n,client:a,checkout:{negotiator:i}}=E(),o=a.unstable_getSerialization("apiClientId"),r=Yn(o),l=i.parts.shippingAddress.value,{href:s,onClick:c}=qn(),{countryName:u,loading:d}=$n(l);if(!Gn(Wn(ie)).value)return null;if(r)return t(to,{message:t(v,{children:e.translate("merchant_redirect.shop_app_not_supported",{storefront_link:t(vn,{href:n.storefront(),children:e.translate("contact.storefront_link")})})})});const p=d?l.countryCode:u;return t(to,{message:t(v,{children:e.translate("payment_errors.payment_method_not_supported",{country:p,checkout_as_guest_link:t(vn,{href:s,onClick:c,children:e.translate("account_management.checkout_as_guest_link")})})})})}function io(){const{negotiate:e}=We(),{checkout:{negotiator:n}}=E(),{deliveryLines:t,merchandiseLines:a,discountLines:i}=n.parts;return n=>{oe({deliveryLines:t,merchandiseLines:a,merchandiseStableIds:n,discountLines:i}),e({silenceViolations:re(["deliveryNext","merchandiseLines"])})}}function oo(e){return"shopPay"===e.current.value?"shop_pay":"guest_checkout"}function ro(e){requestAnimationFrame(()=>{rn({content:e,role:"status"})})}function lo({title:e,subtitle:n}){return n?`${e} / ${n}`:e}function so({merchandiseLines:n,bannerType:a,allowAlternativeAction:i}){const{i18n:o}=E(),r=Xn(),l=io(),s=le(),c=Ta(),u="pickup"===a,p=u?"SHIPPING":"PICK_UP",h=e(()=>Array.from(new Map(n.value.map(e=>[e.stableId,e])).values())),v=e(()=>h.value.map(({stableId:e})=>e)),_=e(()=>{const e=new Map;for(const n of h.value){const t=e.get(n.digest);t?e.set(n.digest,{...t,quantity:t.quantity+n.quantity}):e.set(n.digest,n)}return Array.from(e.values())}),y=e(()=>h.value.reduce((e,{quantity:n})=>e+Math.max(1,n),0)),b=e(()=>{const{deliveryMethodsByMerchandise:e}=s.value;return h.value.filter(({stableId:n})=>e[n]?.includes(p))}),f=e(()=>b.value.map(({stableId:e})=>e)),k=e(()=>b.value.reduce((e,{quantity:n})=>e+Math.max(1,n),0)),P=e(()=>(i?.value??!0)&&!c.value&&f.value.length===v.value.length&&k.value>0),C=e(()=>h.value.map(({variantId:e})=>e)),I=function({allLinesAlternativeEligible:n,isPickupBanner:t,variantIds:a}){const{userEvents:i,shop:o,source:r,checkout:{identity:l,negotiator:s}}=E(),{merchandiseLines:c}=s.current.fields,u=e(()=>n.value?t?"remove_or_switch_to_shipping":"remove_or_switch_to_pickup":"remove_only"),p=t?"pick-up":"shipping",m=e(()=>a.value.map(e=>{if(e)try{return parseInt(T(e),10)}catch{return}}).filter(e=>void 0!==e));return d(e=>{const n={schemaId:"checkout_inventory_split_buyer_decision/2.0",payload:{shopId:parseInt(T(o.id),10),checkoutToken:r.checkoutSessionIdentifier??"",productVariantIds:m.value,bannerType:u.value,buyerAction:e,deliveryMethodType:p,checkoutSurface:oo(l),sourceName:"checkout_one",checkoutProductVariantsCount:c.value?.lines.length}};i.monorailEvent(n)},[u,p,l,c,i,m,o,r])}({allLinesAlternativeEligible:P,isPickupBanner:u,variantIds:C}),S=e(()=>h.value.length>0),L=e(()=>u?o.translate("split_delivery.inventory_issue_banner.heading.cannot_be_picked_up",{count:y.value}):o.translate("split_delivery.inventory_issue_banner.heading.cannot_be_shipped",{count:y.value})),M=e(()=>P.value?o.translate("split_delivery.inventory_issue_banner.remove_item",{count:y.value}):o.translate("split_delivery.inventory_issue_banner.remove_item_only",{count:y.value})),A=e(()=>u?o.translate("split_delivery.inventory_issue_banner.ship_separately",{count:k.value}):o.translate("split_delivery.inventory_issue_banner.pick_them_up_in_store",{count:k.value})),w=e(()=>_.value.map(({title:e,subtitle:n,quantity:t})=>{const a=lo({title:e,subtitle:n});return t>1?o.translate("split_delivery.inventory_issue_banner.merchandise_line_with_quantity",{title:a,quantity:t}):a}).join(", ")),x=()=>{const e=w.value;I("switch_delivery_method"),r({targetDeliveryMethodType:p,merchandiseStableIds:f.value}),ro(u?o.translate("split_delivery.accessibility.status.ship_separately",{items:e}):o.translate("split_delivery.accessibility.status.pickup_in_store",{items:e}))},N=t(vn,{onClick:()=>{const e=w.value;I("remove_items"),l(v.value),ro(o.translate("split_delivery.accessibility.status.remove_items",{items:e}))},children:M});return t(m,{when:S,children:()=>t(Kn,{tone:"critical",errorType:jn.DeliveryError,heading:L.value,children:t(Je,{gap:"small-300",children:[t(Qn,{gap:"small-300",children:t(g,{each:_,getKey:({stableId:e})=>e,children:({title:e,subtitle:n,quantity:a})=>{const i=lo({title:e,subtitle:n});return t(Jn,{children:a>1?o.translate("split_delivery.inventory_issue_banner.merchandise_line_with_quantity",{title:i,quantity:a}):i})}})}),t(ln,{children:t(m,{when:P,fallback:N,children:()=>{const e=t(vn,{onClick:x,children:A});return u?o.translate("split_delivery.inventory_issue_banner.remove_items_or_ship",{ship_separately_link:e,remove_items_link:N}):o.translate("split_delivery.inventory_issue_banner.remove_items_or_pickup",{pickup_in_store_link:e,remove_items_link:N})}})})]})})})}const co=["DELIVERY_NO_DELIVERY_STRATEGY_AVAILABLE_FOR_MERCHANDISE_LINE","MERCHANDISE_OUT_OF_STOCK_IN_CONTEXT"];function uo(n){const{shop:{shipPickupInOneOrderEnabled:t},checkout:{negotiator:a}}=E(),{allViolations:i,merchandiseLines:o,deliveryNext:r}=a.current.fields,l=le(),s=Zn(),{deliveryLines:c,merchandiseLines:u}=a.parts;return e(()=>{const e=Boolean(!(!r.value||!("supportsSplitDeliveryMethod"in r.value))&&r.value.supportsSplitDeliveryMethod),a={allViolations:i.value,deliveryMethodsByMerchandise:l.value.deliveryMethodsByMerchandise,isSplitShipAndPickup:s.value,negotiatedMerchandiseLines:o.value,proposedDeliveryLines:c.value,proposedMerchandiseLines:u.value},d=t&&e;return"localPickup"===n.mode?function({canUseDeliveryMethodScopedViolations:e,state:n}){if(e){const e=po({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:po({deliveryMethodType:"PICK_UP",suppressUnscopedPickupViolations:!1,state:n}),allowAlternativeAction:!1}:{merchandiseLines:[],allowAlternativeAction:!1});var t}({canUseDeliveryMethodScopedViolations:d,state:a}):d?function({deliveryMethodType:e,state:n}){return{merchandiseLines:po({deliveryMethodType:e,suppressUnscopedPickupViolations:"PICK_UP"===e&&n.isSplitShipAndPickup,state:n}),allowAlternativeAction:!0}}({deliveryMethodType:n.deliveryMethodType,state:a}):{merchandiseLines:[],allowAlternativeAction:!1}})}function po({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?et(t,i,co)??[]:[],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=se(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 mo(e){return"LOCAL"===e?"SHIPPING":e}function ho(){const{violations:n}=Wn(ce),{i18n:i,shop:o,checkout:r}=E(),{shippingAddress:l}=r.negotiator.parts,{countryName:u,loading:d}=$n(l.value),p=_(u),h=_(d),y=r.negotiator.current.fields.merchandiseLines,g=nt(),{negotiating:b,methods:f}=tt(),{loading:k}=r.negotiator,P=c(g.peek()),C=c(k.peek().has("deliveryNext")),I=e(()=>{const e=k.value.has("deliveryNext"),n=C.current&&!e;return g.value?P.current=!0:n&&(P.current=!1),C.current=e,P.current}),{cartUpdated:S,setCartUpdated:L}=function(){const{checkout:{negotiator:n}}=E(),t=s({status:"hidden"}),i=c(),o=e(()=>{const e=t.value;switch(e.status){case"hidden":return!1;case"holding":return!0;case"shown":return n.lastNegotiation.value===e.untilNegotiationAfter}});return a(()=>()=>clearTimeout(i.current),[]),{cartUpdated:o,setCartUpdated:function(){clearTimeout(i.current),t.value={status:"holding"},i.current=setTimeout(()=>{t.value={status:"shown",untilNegotiationAfter:n.lastNegotiation.peek()}},1e3)}}}(),M=s(void 0);a(()=>n.subscribe(e=>{0!==e.size&&(M.value=p.peek())}),[n,p,M]);const A=uo({deliveryMethodType:"SHIPPING",mode:"deliveryMethodScoped"}),w=e(()=>A.value.merchandiseLines),x=e(()=>{const e=I.value,n=y.value;return e||!n||0===n.lines.length||h.value||M.value!==p.value}),N=e(()=>!x.value&&S.value),T=e(()=>!x.value&&!S.value&&0!==n.value.size&&!(o.shipPickupInOneOrderEnabled&&b.value&&function(e){const n=new Set(e.map(mo));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")}(f.value))),O=e(()=>T.value&&w.value.length>0),B=e(()=>{if(!T.value||O.value)return null;const e=y.value;return e?et(Array.from(n.value),e,Array.from(ce)):null});return t(v,{children:[t(m,{when:N,children:t(at,{heading:i.translate("merchandise_unavailable_in_buyer_location.cart_updated"),tone:"info"})}),t(m,{when:O,children:t(so,{bannerType:"shipping",merchandiseLines:w})}),t(m,{when:B,children:e=>t(vo,{violations:n,merchandiseWithViolations:e,countryName:p.value,onItemsRemoved:L})})]})}function vo({violations:e,merchandiseWithViolations:n,countryName:a,onItemsRemoved:i}){const{client:o,i18n:r,shop:l,source:s,observability:c,url:u,embed:d,checkout:p}=E(),m=p.negotiator.parts.merchandiseLines,{negotiate:h}=We(),v=yn(),_=Boolean(d),y=n.map(({stableId:e})=>e),g=m.value.filter(({stableId:e})=>!y.includes(e)),b=0===g.length,f=Array.from(e.value).some(({code:e})=>"MERCHANDISE_PRODUCT_NOT_PUBLISHED_IN_BUYER_LOCATION"===e)?a??r.translate("merchandise_unavailable_in_buyer_location.missing_country_fallback"):r.translate("merchandise_unavailable_in_buyer_location.indeterminate_location_fallback");let k=null;k=b&&1===n.length?r.translate("merchandise_unavailable_in_buyer_location.banner_title.all_products_one",{location_name:f}):b?r.translate("merchandise_unavailable_in_buyer_location.banner_title.all_products_other",{location_name:f}):1===n.length?r.translate("merchandise_unavailable_in_buyer_location.banner_title.some_products_one",{location_name:f}):r.translate("merchandise_unavailable_in_buyer_location.banner_title.some_products_other",{location_name:f});const P=b?null:t(Qn,{children:n.map(e=>t(Jn,{children:e.subtitle?r.translate("merchandise_unavailable_in_buyer_location.unavailable_line_item",{product_name:e.title,variant_label:e.subtitle}):e.title},e.stableId))}),C=1===n.length?r.translate("merchandise_unavailable_in_buyer_location.remove_items_action.one"):r.translate("merchandise_unavailable_in_buyer_location.remove_items_action.other"),I=r.translate("merchandise_unavailable_in_buyer_location.empty_cart_action");const S=t(ln,{children:b?!b||!_&&l.hasStorefront?r.translate("merchandise_unavailable_in_buyer_location.change_address_or_remove",{remove_action:t(vn,{onClick:function(){v("click",{element:{tagName:"a",textContent:I},section:"delivery",timestamp:new Date}),c.log("redirect_to_storefront","[UnavailableInBuyerLocationBanner] Empty cart and redirect to storefront",{allItemsUnavailable:b,redirectSuccess:l.hasStorefront}),ue({client:o,url:u,source:s,configuration:p.configuration})},children:I})}):r.translate("merchandise_unavailable_in_buyer_location.change_address_only"):r.translate("merchandise_unavailable_in_buyer_location.change_address_or_remove",{remove_action:t(vn,{onClick:function(){v("click",{element:{tagName:"a",textContent:C},section:"delivery",timestamp:new Date}),m.value=g,h({onComplete:i})},children:C})})});return t(Da,{impressionType:"unavailable_in_buyer_location",impressionFeatures:Array.from(e.value).map(({code:e})=>e),children:t(Kn,{heading:k,tone:"critical",children:t(Je,{gap:"base",children:[P,S]})})})}function _o({selectedAddress:e,shouldAddressModalSetAsDefault:n}){const{checkout:{address:a,identity:i,negotiator:o},i18n:r}=E(),l=o.parts.shippingAddress.value,s=$n(l),{createAddressParts:c}=o.context,u=d(e=>{c.addressModalState.value={status:"editing",address:de(e.address,{extendedAddressMode:a.extendedAddressMode}),addressType:"shipping",addressId:e.id,setAsDefault:n?"default":"disabled"}},[a.extendedAddressMode,c.addressModalState,n]),p=e?t(vn,{tone:"monochrome",onClick:()=>u(e),children:r.translate("shipping.address_update")}):r.translate("shipping.address_update"),m=Gn(Wn(pe)).value,h=Gn(Wn(me)).value,v=Gn(Wn(he)).value,_=Gn(Wn(ie)).value,y=function({identity:e,hasMerchandiseUnavailableInBuyerLocationViolations:n,hasUnsupportedPaymentMethodViolations:a}){return"shopPay"!==e.current.value?null:n?t(ho,{}):a?t(ao,{}):null}({identity:i,hasMerchandiseUnavailableInBuyerLocationViolations:Gn(Wn(ce)).value,hasUnsupportedPaymentMethodViolations:_});if(y)return y;let g=r.translate("shipping_errors.invalid_selected_address");return h?g=r.translate("customer_account.incomplete_address",{update_address_link:p}):m?g=s.loading?t(Je,{children:[t(it,{inlineSize:"large"}),t(it,{inlineSize:"small"})]}):r.translate("shipping_errors.shipping_method_not_available_generic.one"):(v||Boolean(e))&&(g=r.translate("shipping_errors.invalid_selected_address_with_update_link",{update_address_link:p})),t(to,{message:g})}function yo(){const{checkout:e,client:n}=E(),i=e.addressManager.shipping.value.selectedAddress.value,o=Boolean(i?.default),r=n.unstable_getSerialization("apiClientId"),l=ot(),s=c(!1),u=Gn(Wn(pe)).value,d=Gn(Wn(ve)).value,p=Yn(r);return a(()=>{(u||d)&&p&&!s.current&&(l.notify(u?{no_delivery_strategy_available:!0}:{out_of_stock_at_origin:!0}),s.current=!0)},[u,d,p,l]),t(_o,{selectedAddress:i,shouldAddressModalSetAsDefault:o})}function go({name:e,variant:n="content",children:a}){return b(()=>ha(()=>Promise.resolve({}),__vite__mapDeps([93]))),t("div",{className:`delivery-transition-${n}`,style:{"--delivery-view-transition-name":e||void 0},children:a})}const bo="split-delivery-merchandise-modal";function fo(e){return e.filter(e=>e.requiresShipping)}function ko(e){return new Set(e.map(e=>e.digest)).size}function Po({targetMerchandiseLines:e,merchandiseLines:n}){const t=rt(e),a=function(e){return function(e){return e.filter(e=>e.requiresShipping).reduce((e,n)=>e+n.quantity,0)}(e.filter(_e).flatMap(e=>e.lineComponents.length>0?e.lineComponents:[e]))}(n);return{targetMerchandiseQuantity:t,isAllItems:t===a}}function Co(n){const{checkout:{negotiator:t}}=E(),{deliveryLines:a}=t.parts,i=_(n),o=uo({mode:"localPickup"});return e(()=>{const e=function(e,n){return"PICK_UP"===n?function(e){return fo(ye(e))}(e):function(e){return fo(ge(e))}(e)}(a.value,i.value);if("PICK_UP"!==i.value)return e;const n=new Set(o.value.merchandiseLines.map(({stableId:e})=>e));return e.filter(({stableId:e})=>!n.has(e))})}function Io(){const n=Co("PICK_UP"),t=Co("SHIPPING"),a=e(()=>function(e,n){return ko(e)+ko(n)}(n.value,t.value)),i=e(()=>a.value>=6);return{physicalDeliveryTargetMerchandiseCount:a,shouldOpenModal:i}}const So="split-delivery-method-menu";function Lo(e,n){return`${So}-${encodeURIComponent(e)}-${n}`}function Mo(e,n){if(0!==e)return n>=0?n:0}function Ao({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=Mo(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 wo(e){requestAnimationFrame(()=>{rn({content:e,role:"status"})})}function Eo({merchandiseStableIds:n,onMoveMerchandise:a,onRemoveMerchandise:i,selectedDeliveryMethodType:o,productTitle:r}){const l=f(),{i18n:u}=E(),d=le(),p=Xn(),h=io(),y=_(a??p),b=_(i??h),k=_(lt().hideOverlay),P=c(null),C=c(!1),[I]=n,S=Lo(I,l),L=function(e,n){return`${Lo(e,n)}-trigger`}(I,l),M=function(e){const n=ct(e);return"command"===n?.type&&"overlay"===n.kind&&n.active}(S),A=_(M),w=s(void 0),x=_(o),N=_(r),T=_(n),O=e(()=>{const e={SHIPPING:{label:u.translate("delivery_options.ship"),value:"SHIPPING",icon:"package-delivery",onClick:()=>n("SHIPPING")},PICK_UP:{label:u.translate("delivery_options.pickup"),value:"PICK_UP",icon:"location",onClick:()=>n("PICK_UP")}},n=e=>{k.value(S),e!==x.value&&(y.value({targetDeliveryMethodType:e,merchandiseStableIds:T.value}),wo("SHIPPING"===e?u.translate("split_delivery.accessibility.status.ship_separately",{items:N.value}):u.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}=d.value,n=T.value.map(n=>e[n]);let t;for(const a of n){if(!a)return[];t=t?t.filter(e=>a.includes(e)):[...a]}return 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:u.translate("stock.remove"),value:"remove",icon:"delete",selected:!1,onClick:()=>{k.value(S),b.value(T.value),wo(u.translate("split_delivery.accessibility.status.remove_items",{items:N.value}))}}),n}),V=e(()=>F.value.length),z=e(()=>F.value.findIndex(e=>e.selected)),R=e=>{const n=V.value;if(0===n||void 0===w.value)return;const t=Math.min(w.value,n-1);w.value=(t+e+n)%n},U=()=>{w.value=Mo(V.value,z.value)},H=()=>{M||U()},j=e=>{e&&(e.onClick(),requestAnimationFrame(()=>{var e;document.querySelector((e=I,`[id^="${So}-${encodeURIComponent(e)}-"][id$="-trigger"]`))?.focus()}))},K=e=>{if(M)switch(e.key){case"ArrowDown":e.preventDefault(),R(1);break;case"ArrowUp":e.preventDefault(),R(-1);break;case"Home":e.preventDefault(),w.value=0;break;case"End":e.preventDefault(),w.value=V.value-1;break;case"Enter":case" ":e.preventDefault(),void 0!==w.value&&j(F.value[w.value]);break;case"Tab":e.stopPropagation(),k.value(S)}else"ArrowDown"!==e.key&&"ArrowUp"!==e.key||(e.preventDefault(),U(),P.current?.click())},q=e(()=>A.value&&void 0!==w.value&&void 0!==F.value[w.value]?`${S}-option-${w.value}`:void 0);return t(m,{when:V,children:e=>t(v,{children:[t(Ao,{activeIndex:w,isOpen:M,menuOptionsLength:e,selectedOptionIndex:z.value,wasOpenRef:C}),t(st,{ref:P,id:L,command:"--toggle",commandFor:S,background:"base",padding:"small-300",paddingInlineStart:"small-200",borderRadius:"base",className:"HoMMS",accessibilityLabel:`${r}, ${u.translate("review.blocks.change_delivery_method_link_label")}`,onClick:H,role:"combobox",onKeyDown:K,"aria-haspopup":"listbox","aria-autocomplete":"none","aria-activedescendant":q.value,children:t(Je,{direction:"inline",gap:"small-500",alignItems:"center",children:[t("span",{className:"g9aTP",children:B}),t("span",{className:"_5tEP0",children:t(nn,{type:"chevron-down",size:"small-200",tone:"accent"})})]})}),t(qa,{id:S,connector:"none",padding:"none",positionArea:"block-end span-inline-start",children:t("div",{role:"listbox","aria-labelledby":L,children:t(g,{each:F,getKey:e=>e.value,children:(e,n)=>{const a=w.value===n;return t("button",{id:`${S}-option-${n}`,type:"button",role:"option",tabIndex:-1,"aria-selected":e.selected,"data-active":a||void 0,className:"eWR8C",onClick:()=>{j(e)},onMouseOver:()=>{w.value=n},children:t(Je,{direction:"inline",gap:"small-400",alignItems:"center",children:[t(nn,{type:e.icon,tone:a?"accent":"auto"}),t(ln,{type:"small",tone:"remove"===e.value?"critical":"auto",children:e.label})]})})}})})})]})})}function xo({onMoveMerchandise:e,onRemoveMerchandise:n,title:a,selectedDeliveryMethodType:i}){const r=Co(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=ut(l.map(({line:e})=>e.stableId)),c=ht(i);return t(v,{children:t(Je,{accessibilityRole:"unordered-list",accessibilityLabel:a,gap:"small-100",children:l.map(({line:{stableId:a,image:o,title:r,subtitle:l,sellingPlan:u},stableIds:d,totalQuantity:p})=>{const m=[l,u?.name].filter(Boolean).join(` ${dt} `),h=s.has(a);return t(Ln,{accessibilityRole:"list-item",className:h?c:void 0,children:t(dn,{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(pt,{alt:o?.altText,size:"small",src:o?.url,totalItems:p>1?p:void 0}),t(Ln,{minInlineSize:"0px",maxInlineSize:"100%",overflow:"hidden",children:[t(ln,{size:"base",children:t(mt,{children:r})}),m&&t(ln,{color:"subdued",size:"small",children:t(mt,{children:m})})]}),t(Ln,{inlineAlignment:"end",children:t(Eo,{merchandiseStableIds:d,onMoveMerchandise:e,onRemoveMerchandise:n,selectedDeliveryMethodType:i,productTitle:r})})]})},a)})})})}function No({selectedDeliveryMethodType:n}){const{i18n:a,checkout:{negotiator:i}}=E(),{merchandiseLines:o}=i.parts,r=Co(n),{shouldOpenModal:l}=Io(),s=e(()=>{const e=Po({targetMerchandiseLines:r.value,merchandiseLines:o.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})}),c=e(()=>`${s.value}, ${a.translate("review.blocks.change_delivery_method_link_label")}`);return l.value?t(tn,{variant:"plain",tone:"monochrome",inlineSize:"fill",inlineAlignment:"start",textDecoration:"none",accessibilityLabel:c.value,command:"--show",commandFor:bo,children:t(dn,{gridAutoFlow:"column",gridTemplateColumns:"minmax(auto, max-content) minmax(0, 1fr) minmax(auto, max-content)",alignItems:"center",gap:"small-200",children:[t(vt,{variant:"fan-legacy",sortByPrice:!0,merchandise:r.value,size:"small",useImageAltTexts:!1}),t(ln,{children:s}),t(nn,{type:"pen",size:"base",tone:"neutral"})]})}):t(xo,{title:"PICK_UP"===n?a.translate("split_delivery.items_for_pickup"):a.translate("split_delivery.items_for_shipping"),selectedDeliveryMethodType:n})}function To({id:e=bo,open:n}){const{i18n:a}=E(),i=Co("PICK_UP"),o=Co("SHIPPING"),{moveMerchandise:r,removeMerchandise:l,saveAndClose:s}=function({onClose:e}={}){const{negotiate:n}=We(),{i18n:t,checkout:{negotiator:a}}=E(),i=_t(),{deliveryLines:o,merchandiseLines:r,discountLines:l}=a.parts,s=le(),u=c(!1);return{moveMerchandise:d(({targetDeliveryMethodType:e,merchandiseStableIds:n})=>{const{orphanedRemovedFromCartStableIds:t}=be({deliveryLines:o,merchandiseLines:r,targetDeliveryMethodType:e,merchandiseStableIds:n,sellableDeliveryMethodsByStableId:s.value.deliveryMethodsByMerchandise,discountLines:l});t.length>0&&(u.current=!0)},[o,r,s,l]),removeMerchandise:d(e=>{oe({deliveryLines:o,merchandiseLines:r,merchandiseStableIds:e,discountLines:l})},[o,r,l]),saveAndClose:d(()=>{e?.(),n({silenceViolations:re(["deliveryNext","merchandiseLines"])}),u.current&&(u.current=!1,i(t.translate("stock.removed_from_cart_notice")))},[n,e,i,t])}}(),u=a.translate("delivery_options.pickup"),p=a.translate("delivery_options.ship_to_address");return t(Sn,{id:e,open:n,accessibilityLabel:a.translate("split_delivery.delivery_method"),onHide:s,primaryAction:t(tn,{command:"--hide",commandFor:e,inlineSize:"fill",variant:"primary",children:a.translate("payment.add_credit_card_modal.save")}),children:t(Je,{gap:"large-300",children:[i.value.length>0&&t(Je,{gap:"base",children:[t(Je,{direction:"inline",gap:"small-400",alignItems:"center",children:[t(nn,{type:"marker"}),t(In,{level:2,children:u})]}),t(Ln,{border:"base",borderRadius:"large",padding:"base",children:t(xo,{onMoveMerchandise:r,onRemoveMerchandise:l,selectedDeliveryMethodType:"PICK_UP",title:u})})]}),o.value.length>0&&t(Je,{gap:"base",children:[t(Je,{direction:"inline",gap:"small-400",alignItems:"center",children:[t(nn,{type:"package-delivery"}),t(In,{level:2,children:p})]}),t(Ln,{border:"base",borderRadius:"large",padding:"base",children:t(xo,{onMoveMerchandise:r,onRemoveMerchandise:l,selectedDeliveryMethodType:"SHIPPING",title:p})})]})]})})}const Oo=k(null);var Bo={Fieldset:"_16tpi2ma _1fragemeg _1fragemdw _1fragemf0 _1fragemdc _1fragemqt _1fragemsm _1fragemp0 _1fragemuf _1fragem11h",Legend:"_16tpi2mb _1fragemnh",Segments:"_16tpi2me _16tpi2md _1fragemws _1fragem6t _1fragemx7",SegmentsCardSurface:"_16tpi2mf",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:"_16tpi2mg _1fragemz0 _1fragem11v"};function Do({name:e,label:n,labelAccessibilityVisibility:a="visible",contentDirection:i="auto",selectedSurface:r="control",selected:l,onChange:s,children:c}){const u=d(e=>s(e),[s]),m=o(()=>({name:e,selected:l,select:u,contentDirection:i,selectedSurface:r}),[e,l,u,i,r]);let h;n&&"exclusive"===a?h=t("legend",{className:q({screenReaders:"only"}),children:n}):n&&(h=t("legend",{className:Bo.Legend,children:t(In,{level:3,accessibilityRole:"presentation",children:n})}));const v=t("div",{className:p(Bo.Segments,"card"===r&&Bo.SegmentsCardSurface),"data-choice-list-segmented-part":"control",children:c});return t(Oo.Provider,{value:m,children:n?t("fieldset",{className:Bo.Fieldset,children:[h,v]}):v})}function Fo({value:e,children:n,icon:a,secondaryContent:i,accessibilityLabel:o}){const r=P(Oo),l=yt();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:u,contentDirection:d,selectedSurface:m}=r,h=c===e;return t("label",{className:p(Bo.ChoiceSegmented,h&&"control"===m&&Bo.ChoiceSegmentedSelected,l&&Bo.inert),"data-choice-list-segmented-part":"segment",children:[t("input",{id:`${s}-${e}`,type:"radio",name:s,value:e,checked:h,disabled:l,"aria-label":o,"aria-hidden":!!l||void 0,tabIndex:l?-1:void 0,className:Bo.Input,onChange:()=>u(e)}),t("span",{className:p(Bo.PrimaryContent,Bo.contentDirectionVariant[d]),children:[a&&t(nn,{type:a,color:"strong"}),t(ln,{type:"strong",children:n})]}),i&&t(ln,{color:"subdued",children:i})]})}function Vo(){const{i18n:e,checkout:{negotiator:n}}=E(),a=fe("deliveryNext").value,i=ke(n.current.fields.deliveryNext.value,"ONE_TIME_PURCHASE"),o=n.current.fields.paymentLines?.value?.lines;return void 0===Pe(o,"APPLE_PAY")&&"available"===i?.status&&!a&&i?.hasDeliveryLineChange?t(Kn,{tone:"warning",errorType:jn.DeliveryError,children:e.translate("shipping_errors.shipping_method")}):null}const zo="PICK_UP_AND_SHIP";function Ro(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:C(e)}}function Uo(e){return"PICK_UP"===e.id||"SHIPPING"===e.id}function Ho({options:e,selectedIndex:n,select:a}){const{i18n:i,observability:o}=E(),r=d(e=>{e!==zo&&a([e])},[a]),l=e.filter(Uo),s=c(!1);if(!s.current&&l.length"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:p("qX6SV",q({colorLayer:"control"})),style:{"--option-count":e.length,"--selected-index":n},children:t(gt,{name:"delivery_strategies",value:zo,onChange:r,children:[t(bt,{value:zo,children:i.translate("split_delivery.pickup_and_ship")}),l.map(({id:e})=>t(bt,{value:e,children:Ro(e,i)},e))]})})}function jo({options:a,selected:i,select:o,showChangedBanner:r=!0}){const{i18n:l,shop:c,source:u,checkout:{negotiator:h}}=E(),v="simulated"===u.type,_=c.hasFlagEnabled(j)?"card":"control",{value:y}=h.current.fields.deliveryNext,b=Zn(),f=ke(y,"ONE_TIME_PURCHASE"),{deliveryMethodSelectorClickEvent:k}=function(e){const{source:n,userEvents:t,shop:{id:a},checkout:{identity:i,negotiator:o}}=E(),r="shopPay"===i.current.value,l=o.current.fields.buyerIdentity.value?.customerProfile;return{deliveryMethodSelectorClickEvent:function(i){let o;switch(i){case"SHIPPING":o="checkout_shipping_tab_clicked";break;case"PICK_UP":o="checkout_pickup_tab_clicked";break;case"PICKUP_POINT":o="checkout_pickup_point_tab_clicked"}if(!o)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:o,shopId:parseInt(T(a),10),numberLocationsFound:s,userId:l?.id?parseInt(T(l.id),10):void 0,checkoutSurface:r?"shop_pay":"guest_checkout"}})}}}(f),P=e(()=>!b.value),C=s(!1);n(()=>{let e=b.peek();return I(()=>{const n=b.value;e&&!n&&(C.value=!0),e=n})},[b,C]);const S=d(()=>{C.value=!1},[C]),L=d(([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);va(()=>{o([e])},[t>n?"delivery-slide-end":"delivery-slide-start"]),k(e)},[o,i,k,a]),M=e(()=>a.value.findIndex(e=>e.id===i.value[0])),A=e(()=>a.value.length),w=e(()=>a.value.some(e=>e.label.length>16));return t("div",{className:"SnB3D",children:[r&&t(Vo,{}),v&&t(g,{each:a,getKey:e=>e.id,children:e=>t(Fn,{sectionId:`deliveryMethods-${e.id}`})}),t(m,{when:P,fallback:t(Ho,{options:a.value,selectedIndex:M.value,select:o}),children:t("div",{style:{"--selected-index":M.value,"--option-count":A.value},className:p("wvTT8",C.value&&"_207IL"),onAnimationEnd:S,children:t(Do,{name:"delivery_method",label:l.translate("general.choose_delivery_strategy"),labelAccessibilityVisibility:"exclusive",selected:i.value[0],onChange:e=>L([e]),contentDirection:w.value?"block":"auto",selectedSurface:_,children:t(g,{each:a,getKey:e=>e.id,children:({id:e,label:n,icon:a})=>t(Fo,{value:e,icon:a,children:n})})})})})]})}function Ko(e,n){return n.some(n=>e.includes(n))}function qo({options:n,selected:a,select:i}){const{i18n:o,source:r,checkout:{negotiator:l}}=E(),{deliveryNext:s,paymentLines:c}=l.current.fields,u="simulated"===r.type,d=fe("deliveryNext"),p=e(()=>{const e=ke(s.value,"ONE_TIME_PURCHASE"),n=void 0!==Pe(c?.value?.lines,"APPLE_PAY"),t="available"===e?.status&&!d.value&&e.hasDeliveryLineChange;return!n&&t});return t(v,{children:[t(m,{when:p,children:()=>t(Kn,{tone:"warning",errorType:jn.DeliveryError,children:o.translate("shipping_errors.shipping_method")})}),u&&n.map(e=>t(Fn,{sectionId:`deliveryMethods-${e.id}`},e.id)),t(Ra,{name:"delivery_strategies",title:o.translate("general.choose_delivery_strategy"),titleHidden:!0,values:a,onChange:i,children:n.map(e=>t(Fa,{value:e.id,accessibilityLabel:e.label,secondaryContent:t(nn,{type:e.icon,tone:Ko(a,e.value)?"accent":void 0}),children:e.label},e.id))})]})}function $o(){const e=ft();if(!e)return null;const{variant:n,...a}=e;return"next"===n?t(jo,{...a}):t(qo,{options:a.options.value,selected:a.selected.value,select:a.select})}function Go({heading:e="auto"}){const{i18n:n}=E(),a=n.translate("pickup_point.title");return t(Tn,{accessibilityLabel:a,children:t(Je,{gap:"small-400",children:["auto"===e&&t(In,{level:2,children:a}),t(Rn,{blockSize:"small-500"}),t(Ua,{text:n.translate("pickup_point.waiting_on_pickup_point_location_notice")})]})})}const Wo=r({displayName:"PickupPoint",load:()=>l(()=>ha(()=>import("./dce37576.Bv0ZJ2Eg.js"),__vite__mapDeps([94,1,9,2,3,4,5,10,11,12,13,14,15,16,80,78,27,23,28,29,79,95,18,17,19,20,21,22,24,25,26,30,96,47,97,98,68,69,6,7,32,70,71,72,65,66,73,49,58,52,74,75,76,77,81,63,64,82,83,84,99]))),renderLoading:e=>t(Go,{...e})});function Yo(){const{shop:e}=E();return!e.hasFlagEnabled(Ce)}const Xo={MILES:100,KILOMETERS:200};function Qo(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 Jo(e){const{pickupLocation:n}=e;return n&&"distanceFromBuyer"in n?n.distanceFromBuyer:void 0}const Zo=e=>e.every(e=>{const n=Jo(e);return n?.value&&n.value>Xo[n.unit]});function er({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 nr(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 tr(){const{checkout:{negotiator:e}}=E(),{locationAddress:n}=e.parts,t=n.peek(),{countryCode:a,postalCode:i,city:o}=t,r=Boolean(a&&!i&&!o),{details:l}=Ie(a);return{isOnlyCountryAvailable:r,fullCountryName:l?.name||void 0,formattedAddress:kt(t,{hiddenFields:er(t),multiline:!1,countryFormat:"explicit"})}}function ar({onClick:e,commandFor:n}){const{i18n:a}=E(),{formattedAddress:i}=tr(),o=a.translate("local_pickup.toggle_location");return t(tn,{variant:"plain",textDecoration:"none",inlineAlignment:"start",accessibilityLabel:i?`${o}, ${i}`:o,onClick:e,commandFor:n,children:i?t(Je,{direction:"inline",gap:"small-500",alignItems:"center",children:[t(nn,{type:"geolocation",size:"small-100"}),t(ln,{children:nr(i,13)})]}):t(ln,{children:o})})}function ir({hideText:e,singleItem:n}){const{i18n:a}=E(),i=Se(),o=i.value?.methods??[],r=n?1:o.length||2,l=Array.from({length:r},(e,n)=>`LocationSkeleton${(n+1).toString()}`);return t(v,{children:[e?null:t(Je,{gap:"base",padding:"small-400 none base none",children:t(it,{size:"extraSmall",children:a.translate("shipping.waiting_on_pickup_location_notice")})}),t(Va,{border:"none",background:"transparent",children:t(za,{name:"skeleton-loading",variant:"block",hideRadioControl:1===l.length,children:l.map(e=>t(Fa,{disabled:!0,value:e,accessibilityLabel:a.translate("general.loading"),secondaryContent:t(Je,{gap:"small-400",alignItems:"end",children:[t(it,{inlineSize:"small",size:"small"}),t(it,{inlineSize:"base",size:"small"})]}),children:t(Je,{gap:"small-400",children:[t(it,{inlineSize:"small",size:"small"}),t(it,{inlineSize:"base",size:"small"})]})},e))})})]})}const or=Pt("LocalPickupLocationsModal"),rr=r({displayName:"LocalPickupLocationsModal",suspense:!1,load:()=>l(async()=>({default:(await ha(async()=>{const{LocalPickupLocationsModal:e}=await(import("./7fb43285.BP0ifHSs.js"));return{LocalPickupLocationsModal:e}},__vite__mapDeps([100,1,9,2,3,4,5,10,11,12,13,14,15,16,52,49,101,27,23,28,78,29,79,102,88,18,68,69,6,7,32,70,17,19,20,21,22,24,25,26,30,71,72,65,66,73,58,74,75,76,77,80,81,63,64,82,83,84]))).LocalPickupLocationsModal}))});function lr(e){const{open:n=!1,onClose:i}=e,o=rr.useLoadState(),r=s(null),l=_(i),c=n&&"loaded"!==o;return or(r.value),a(()=>{if(!c)return;let e=!0;return rr.load().then(e=>{if(e instanceof Error)throw e}).catch(n=>{n instanceof Error&&(r.value=n),e&&l.value()}),()=>{e=!1}},[c,r,l]),"loaded"===o?t(rr,{...e}):t(v,{children:[t(rr.Preload,{}),t(sr,{open:n,onClose:i})]})}function sr({open:e,onClose:n}){const{i18n:a}=E();return t(Sn,{open:e,onHide:n,heading:a.translate("delivery_options.pick_up_locations"),children:t(ir,{hideText:!0})})}function cr({heading:n,tryDifferentLocationOnClick:i}){const{i18n:o}=E(),r=tt(),l=le(),s=e(()=>Le(l.value.enabledDeliveryMethods)),c=e(()=>s.value.length>0),u=_(i),d=e(()=>c.value||Boolean(u.value)),p=Se(),h=Ct({methods:p.value?.methods||[],selectedDeliveryMethodHandle:p.value?.selectedDeliveryMethodHandle});a(()=>{h("pickup_no_location_banner_rendered")},[h]);const v=t(vn,{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(vn,{tone:"monochrome",onClick:y,children:o.translate("local_pickup.pickup_unavailable_banner_body.search_elsewhere")}):o.translate("local_pickup.pickup_unavailable_banner_body.search_elsewhere"),b=i?t(vn,{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(Kn,{tone:"critical",errorType:jn.DeliveryError,heading:n,children:t(m,{when:d,children:t(Xe,{children:t(m,{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 ur({onShowModal:e,showLocationButton:n=!0}){const{i18n:a,checkout:{negotiator:i}}=E(),{value:o}=i.current.fields.merchandiseLines;It({active:!0});const{fullCountryName:r,isOnlyCountryAvailable:l}=tr(),s=Ct({methods:[],selectedDeliveryMethodHandle:void 0}),c=St(o?.lines),u=r?a.translate("local_pickup.pickup_unavailable_banner_title_with_country",{country:r,count:c}):a.translate("local_pickup.pickup_unavailable_banner_title",{count:c});return t(Je,{gap:"small",children:[n&&t(ar,{onClick:()=>{e(),s(l?"checkout_pickup_geoselector_clicked_country_grain":"checkout_pickup_geoselector_clicked_other_grain")}}),t(cr,{heading:u,tryDifferentLocationOnClick:()=>e(!0)})]})}const dr=e=>e.every(({pickupLocation:e})=>{const n=e&&"distanceFromBuyer"in e?e.distanceFromBuyer:void 0;return n?.value&&n.value>Xo[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=>Jo(e)?.value).filter(e=>void 0!==e);if(0===t.length)return!0;const a=e.find(({handle:e})=>e===n),i=a?Jo(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({itemCount:e,methods:n,onChangeLocationClick:i}){const{i18n:o}=E(),{isOnlyCountryAvailable:r,formattedAddress:l}=tr(),s=Ct({methods:n});if(a(()=>{r||s("pickup_long_distance_banner_rendered")},[s,r]),r)return null;const c=(e=>e.every(e=>{const n=Jo(e);return"MILES"===n?.unit}))(n)?"MILES":"KILOMETERS",u=Qo(o,{value:Xo[c],unit:c}),d=t("span",{className:"oCDzB",children:l});return t(at,{children:t(ln,{children:l?o.translate("local_pickup.all_stores_far_away.title_with_item",{distance:t("span",{className:"qIyj1",children:u}),location:i?t(vn,{tone:"monochrome",onClick:function(){s("pickup_long_distance_banner_change_location_click"),i?.()},children:d}):d,count:e}):o.translate("local_pickup.all_stores_far_away.title",{distance:u})})})}function vr(){const{i18n:e}=E();return t(Kn,{autoFocus:!0,tone:"warning",errorType:jn.DeliveryError,heading:e.translate("local_pickup.selected_pickup_option_no_longer_available.title"),children:t(ln,{children:e.translate("local_pickup.selected_pickup_option_no_longer_available.description")})})}function _r({allLocationsFarAway:n,selectedPickupOptionNoLongerAvailable:t}){const a=fe("deliveryNext");return e(()=>n.value&&!t.value&&!a.value)}function yr({distanceLabel:e,instructions:n,unavailableItemCount:a=0}){const{i18n:i}=E(),o=a>0;return e||n||o?t(Je,{className:"KHJ3S",direction:"inline",rowGap:"small-400",columnGap:"small-200",alignItems:"center",paddingBlockStart:"small-400",children:[e&&t(Je,{direction:"inline",gap:"small-400",alignItems:"center",children:[t(ln,{color:"subdued",children:t(nn,{type:"location",size:"small"})}),t(ln,{fonts:"secondary",type:"small",children:e})]}),o&&t(Lt,{tone:"warning",color:"subdued",children:t(Mt.Provider,{value:!0,children:t(Je,{direction:"inline",alignItems:"center",gap:"small-400",children:[t(nn,{type:"alert-circle",size:"small-200"}),t(ln,{children:i.translate("local_pickup.unavailable_item_count",{count:a})})]})})}),!o&&n&&t(Je,{direction:"inline",gap:"small-400",alignItems:"center",children:[t(ln,{color:"subdued",children:t(nn,{type:"clock",size:"small"})}),t(ln,{fonts:"secondary",type:"small",children:n})]})]}):null}function gr(){const{checkout:n,shop:t}=E(),{deliveryNext:a,merchandiseLines:i}=n.negotiator.current.fields,o=e(()=>{const e=Me(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=Ae(n);return"PICK_UP"===t?.methodType&&n.targetMerchandiseLines?.some(n=>e.some(e=>e.stableId===n.stableId))})});return e(()=>t.shipPickupInOneOrderEnabled?o.value:Q({checkout:n}))}function br({variant:e="text"}){const{i18n:n}=E(),a=gr(),i=n.translate("delivery_options.subscription_pickup_information");return t(m,{when:a,children:"banner"===e?t(at,{tone:"info",children:i}):t(Xe,{children:i})})}function fr(){const{shop:n,checkout:{negotiator:t}}=E(),a=le(),{deliveryNext:i}=t.current.fields,o=Zn(),r=Ta();return e(()=>{if(!n.shipPickupInOneOrderEnabled)return!1;if(!(i.value&&"supportsSplitDeliveryMethod"in i.value&&i.value.supportsSplitDeliveryMethod))return!1;const{enabledDeliveryMethods:e,deliveryMethodsByMerchandise:t}=a.value,l=e.includes("SHIPPING"),s=e.includes("PICK_UP");if(!l||!s)return!1;if(!o.value&&r.value)return!1;const c=Object.values(t);if(c.length<2)return!1;if(c.some(e=>e.includes("SHIPPING")&&e.includes("PICK_UP")))return!0;const u=c.some(e=>e.includes("SHIPPING")&&!e.includes("PICK_UP")),d=c.some(e=>e.includes("PICK_UP")&&!e.includes("SHIPPING"));return u&&d})}function kr(e){const{checkout:n,i18n:t,shop:a}=E(),i=fr(),o=n.proposal.negotiated.fields,r=o.deliveryNext.value,l=o.merchandiseLines.value,s=o.sellability.value;if(!(a.hasFlagEnabled(we)&&i.value&&e&&r&&"unavailable"!==r.status&&l&&s))return;const c=r.lines.find(n=>"available"===n.status&&n.methods.some(({handle:n,methodType:t})=>n===e&&"PICK_UP"===t));if(!c?.targetMerchandiseLines)return;const u=c.methods.find(({handle:n})=>n===e),d=u?.availability;if(!d?.length)return;const p=new Map(l.lines.flatMap(e=>e.lineComponents.length?e.lineComponents:[e]).map(e=>[e.stableId,e])),m=new Map(d.map(({target:e,status:n})=>[e.stableId,n])),h={canShipSeparately:[],cannotShipSeparately:[]};for(const v of c.targetMerchandiseLines){if(!v.requiresShipping)continue;const e=p.get(v.stableId),n=m.get(v.stableId);if(!e||!n)return;if("UNAVAILABLE"!==n)continue;const t=s.deliveryMethodsByMerchandise[e.stableId];if(!t)return;const a=t.includes("SHIPPING")?"canShipSeparately":"cannotShipSeparately";h[a].push(e)}return h.canShipSeparately.length||h.cannotShipSeparately.length?{stockDetails:["canShipSeparately","cannotShipSeparately"].flatMap(e=>{const n=h[e];if(!n.length)return[];const a=n.reduce((e,{quantity:n})=>e+n,0);return[{type:e,merchandiseLines:n,itemCount:a,title:t.translate("local_pickup.stock_details.out_of_stock"),subtitle:"canShipSeparately"===e?t.translate("local_pickup.stock_details.ship_separately",{count:a}):t.translate("local_pickup.stock_details.remove_items",{count:a})}]})}:void 0}function Pr({method:e,subscriptionBanner:n}){const{i18n:a}=E(),{isOnlyCountryAvailable:i}=tr(),o=kr(e.handle),r=o?.stockDetails.reduce((e,{itemCount:n})=>e+n,0)??0,{cost:l,pickupLocation:s}=e,{name:c,address:u,distanceFromBuyer:d}=s,p=s.instructions.trim(),m=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}}(l,a),h=!i&&d?Qo(a,d):void 0;return t(Je,{direction:"block",gap:"small-400",children:[t(Je,{children:[t(dn,{gap:"small-400",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content)",alignItems:"baseline",children:[t(ln,{type:"strong",children:c}),t(ln,{type:"strong",letterCase:m.letterCase,children:m.amount})]}),t(Ha,{address:u,hiddenFields:["postalCode","countryCode","phone"]}),t(yr,{distanceLabel:h,instructions:p,unavailableItemCount:r})]}),n?t(br,{variant:"banner"}):null]})}function Cr(e,n="base"){const t=Ee(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=xe({padding:a}).padding;return null==i?t:i}function Ir(e,n){return function(e){return null!=e&&"none"!==e}(e)?e:n}function Sr(n){const{checkout:{negotiator:t}}=E(),{merchandiseLines:a}=t.parts,i=fe("deliveryNext"),o=e(()=>{const e=n.value,t=Po({targetMerchandiseLines:e,merchandiseLines:a.value});if(0!==t.targetMerchandiseQuantity)return{merchandiseLines:e,totalItemCount:t.targetMerchandiseQuantity,isAllItems:t.isAllItems}}),r=c(),l=e(()=>{const e=o.value;return e?(r.current=e,e):r.current});return{currentSummary:o,visibleSummary:l,isNegotiating:i}}function Lr({padding:n}){const{i18n:a,checkout:{negotiator:o}}=E(),{deliveryLines:r}=o.parts,l=Zn(),u=uo({mode:"localPickup"}),d=c(null),p=Co("PICK_UP"),{shouldOpenModal:h}=Io(),{currentSummary:_,visibleSummary:y,isNegotiating:g}=Sr(p),b=e(()=>1===_.value?.totalItemCount),f=e(()=>{const e=y.value;return e?e.isAllItems?a.translate("split_delivery.pickup_all_items"):a.translate("split_delivery.pickup_items_count",{count:e.totalItemCount}):""}),k=e(()=>{const e=a.translate("review.blocks.change_delivery_method_link_label");return f.value?`${f.value}, ${e}`:e}),P=e(()=>f.value||a.translate("split_delivery.items_for_pickup")),C=s(S(()=>h.value||!b.value&&!l.value));return i(()=>{C.value=h.value||!b.value&&!l.value}),e(()=>{if(p.value.length>0)return!1;if(Ne(r.value))return!0;const e=new Set(u.value.merchandiseLines.map(({stableId:e})=>e));return y.value?.merchandiseLines.some(({stableId:n})=>e.has(n))??!1}).value?null:t(v,{children:[t(Ln,{padding:n,children:t(Ln,{children:t(Ka,{children:t(m,{when:C,fallback:t("div",{ref:d,tabIndex:-1,children:t(xo,{title:a.translate("split_delivery.items_for_pickup"),selectedDeliveryMethodType:"PICK_UP"})}),children:t(tn,{variant:"plain",tone:"monochrome",inlineSize:"fill",inlineAlignment:"start",textDecoration:"none",accessibilityLabel:h.value?k.value:P.value,command:h.value?"--show":void 0,commandFor:h.value?bo:void 0,"aria-expanded":!!h.value&&void 0,disabled:g.value,onClick:h.value?void 0:()=>{C.value=!1,requestAnimationFrame(()=>{d.current?.focus()})},children:t(dn,{gridAutoFlow:"column",gridTemplateColumns:"minmax(auto, max-content) minmax(0, 1fr) minmax(auto, max-content)",alignItems:"center",gap:"small-200",children:[t(vt,{variant:"fan-legacy",sortByPrice:!0,merchandise:y.value?.merchandiseLines??[],size:"small",useImageAltTexts:!1}),t(m,{when:()=>!g.value&&void 0!==y.value,fallback:t(it,{inlineSize:"base"}),children:t(ln,{children:f})}),t(nn,{type:"pen",size:"base",tone:"neutral"})]})})})})})}),t(Nn,{accessibilityRole:"presentation"})]})}function Mr({localPickupDeliveryLine:e,onShowModal:n,sectionPadding:a}){const{i18n:i,shop:r}=E(),l=fr(),s=Cr(a),c=r.hasFlagEnabled(j),{methods:u,selectedDeliveryMethodHandle:d}=e,p=u.find(e=>e.handle===d),h=u.length-1,_=Ct({methods:u,selectedDeliveryMethodHandle:d}),y=Bn("purchase.checkout.pickup-location-option-item.render-after"),g=p?.handle??"",b=o(()=>({handle:g}),[g]);if(!p)return null;const f=t(v,{children:[t(m,{when:l,children:t(Lr,{padding:s})}),t(Ln,{padding:s,children:[t(Pr,{method:p,subscriptionBanner:!0}),t(zn,{marginBlockStart:"small100",customizations:y,options:b})]}),h>0?t(Je,{children:[t(Nn,{accessibilityRole:"presentation"}),t(Ln,{padding:s,children:t(tn,{variant:"plain",inlineSize:"fill",textDecoration:"none",inlineAlignment:"start",onClick:function(){n(),_("checkout_pickup_buyer_reveal_more")},children:t(Je,{direction:"inline",gap:"small-200",alignItems:"center",justifyContent:"space-between",children:[t(ln,{type:"strong",children:i.translate("local_pickup.toggle_more_locations",{count:h})}),t(nn,{type:"chevron-right",size:"small-200"})]})})})]}):null]});return t(Je,{gap:"base",children:c?t(ja,{target:"edgeToEdgeCard",children:t(Tn,{accessibilityRole:"presentation",children:f})}):t(Ln,{border:"base",borderRadius:"large",children:f})})}function Ar({sectionPadding:e}){const{shop:n}=E(),a=fr(),i=Cr(e),o=n.hasFlagEnabled(j),r=t(v,{children:[t(m,{when:a,children:t(Lr,{padding:i})}),t(Ln,{padding:i,children:t(Je,{direction:"block",gap:"small-400",children:t(Je,{children:[t(dn,{gap:"small-400",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content)",alignItems:"baseline",children:[t(it,{}),t(it,{inlineSize:"small"})]}),t(it,{inlineSize:"large"}),t(Ln,{paddingBlockStart:"small-500",children:t(it,{size:"small"})})]})})}),t(Nn,{accessibilityRole:"presentation"}),t(Ln,{padding:i,children:t(it,{inlineSize:"small"})})]});return t(Je,{gap:"base",children:[t(Je,{direction:"inline",gap:"small-200",justifyContent:"space-between",children:[t(it,{inlineSize:"large"}),t(it,{inlineSize:"small"})]}),o?t(ja,{target:"edgeToEdgeCard",children:t(Tn,{accessibilityRole:"presentation",children:r})}):t(Ln,{border:"base",borderRadius:"large",children:r})]})}const wr={isLocationFormVisible:!1};function Er(){const{i18n:n,shop:a}=E(),{main:{section:i}}=xn(),o=a.hasFlagEnabled(j)?i?.padding:void 0,{negotiating:r}=tt(),l=Se(),c=V(),d=fe("deliveryNext"),{value:p}=At().value,{value:h}=wt().value,_=Boolean(p||h),y=Gn(Et(Te)),g=uo({mode:"localPickup"}),b=e(()=>g.value.merchandiseLines),f=e(()=>g.value.allowAlternativeAction),k=e(()=>g.value.merchandiseLines.length>0),{isOnlyCountryAvailable:P}=tr(),C=e(()=>{const e=l.value?.methods??[];return e.length>0&&dr(e)}),I=_r({allLocationsFarAway:C,selectedPickupOptionNoLongerAvailable:y}),S=Ct({methods:l.value?.methods||[],selectedDeliveryMethodHandle:l.value?.selectedDeliveryMethodHandle}),[L,M]=u(!1),A=s(!1),w=Bn("Checkout::PickupLocations::RenderBefore"),x=Bn("Checkout::PickupLocations::RenderAfter"),N=e=>{M(!0),A.value=e??!1},T=()=>{N(),S(P?"checkout_pickup_geoselector_clicked_country_grain":"checkout_pickup_geoselector_clicked_other_grain")},O=(()=>{const e=l.value,a=e?.methods.find(n=>n.handle===e.selectedDeliveryMethodHandle);if(!c.value||L)return t(Ar,{sectionPadding:o});if(r.value&&!a)return t(Ar,{sectionPadding:o});if(_)return t(m,{when:k,fallback:t(ur,{onShowModal:N}),children:t(v,{children:[t(so,{bannerType:"pickup",merchandiseLines:b,allowAlternativeAction:f}),t(xr,{})]})});if(!e)return t(Ar,{sectionPadding:o});const{methods:i}=e,s=St(e.targetMerchandiseLines);return t(Je,{gap:"base",children:[t(m,{when:k,children:t(so,{bannerType:"pickup",merchandiseLines:b,allowAlternativeAction:f})}),t(m,{when:y,children:t(vr,{})}),t(m,{when:I,children:t(hr,{itemCount:s,methods:e.methods,onChangeLocationClick:N})}),t(Je,{direction:"inline",gap:"small-200",justifyContent:"space-between",children:[t(m,{when:d,fallback:t(ln,{color:"subdued",children:pr(i,P,s,n,{selectedDeliveryMethodHandle:e.selectedDeliveryMethodHandle,allLocationsFarAway:C.value})}),children:t(it,{inlineSize:"base"})}),t(ar,{onClick:T})]}),t(zn,{customizations:w,options:wr}),t(Mr,{localPickupDeliveryLine:e,onShowModal:N,sectionPadding:o}),t(zn,{customizations:x,options:wr})]})})();return t(fn,{target:"cart.deliveryGroups[0].deliveryAddress",children:t(Tn,{accessibilityLabel:n.translate("local_pickup.pick_up_location"),children:[O,t(lr,{methods:l.value?.methods,type:l.value?.type,open:L,onClose:()=>{M(!1),A.value=!1},addressFocus:A})]})})}function xr(){return It({active:!0}),null}const Nr={timeout:8e3,enableHighAccuracy:!0};class Tr extends Error{constructor(){super(...arguments),this.name="PermissionsUnsupportedError"}}const Or=e=>new Promise(n=>{"geolocation"in navigator&&navigator.geolocation?navigator.geolocation.getCurrentPosition(e=>n({reason:"granted",position:e}),e=>n({reason:Br(e),error:e}),e):n({reason:"unsupported"})});function Br(e){switch(e.code){case 1:return"denied";case 2:return"unavailable";case 3:return"timeout";default:return"unsupported"}}function Dr({disabled:e,displayAsLink:n,onSuccess:a,onError:i,onLocateStart:o,options:r,sharingNotAllowedError:l}){const{i18n:c}=E(),u=function(){const{observability:e}=E();return d(n=>(async(e=Nr,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 Tr('"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,Or,e),[e])}(),p=s(!1),h=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(v,{children:[p.value&&n?t(Je,{direction:"inline",gap:"small-400",children:[t(hn,{}),t(ln,{color:"subdued",children:_})]}):t(tn,{disabled:e,inlineSize:n?void 0:"fill",onClick:async function(){h.value=void 0,p.value=!0,o?.();const e=await u(r);switch(p.value=!1,e.reason){case"granted":a(e.position);break;case"denied":h.value=g;break;case"timeout":case"unavailable":h.value=b;break;case"unsupported":h.value=y}"error"in e&&void 0!==e.error&&i?.(e.error)},loading:p.value,variant:n?"plain":void 0,textDecoration:n?"none":void 0,children:t(Je,{direction:"inline",alignItems:"center",gap:"small-400",children:[t(nn,{type:"geolocation"}),t(Xe,{children:_})]})}),t(m,{when:h,children:t(mn,{children:h})})]})}const Fr=cn("AutocompleteSingleAddressField");function Vr({address:e,onSelect:n,value:a,country:i,hiddenFields:o=["firstName","lastName","company","zoneCode","countryCode","phone"],addressType:r,...l}){const{value:s,setValue:c}=$a({addressType:r,countryCode:i.code,initialAddressQuery:e.coordinates?Oe(e,i,o):a});return t(Ga,{addressType:r,id:on(void 0,Fr),onSelect:function(e){c(Oe(e,i,o)),n&&n(e)},value:s,countryCode:i.code,...l})}function zr({pickupCountries:e,selectedCountry:n,onCountryChange:a}){const{i18n:i}=E(),[o,r]=u(!1);return t(Ln,{border:"base",borderWidth:"base",borderRadius:"base",blockAlignment:"center",padding:"none small-200",className:p("_9uTul",o&&"_3zLFw"),children:t(Je,{direction:"inline",alignItems:"center",children:[t("div",{className:"_9rPCU",children:t(ma,{countryCode:n.code.toLowerCase(),accessibilityLabel:n.name})}),t(nn,{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 Rr=cn("AutocompleteSingleAddressField");function Ur({onSearch:e,onBeforeCountryChange:n,onAfterCountryChange:r,sharedLocationAddress:l,searchOnSelect:u,pickupCountries:p,addressAutoFocus:m,onAddressBlur:v}){const _=s(""),{i18n:y,observability:g,checkout:{negotiator:b}}=E(),{geolocation:f}=xt(),{locationAddress:k}=b.parts,P=k.peek(),C=c(P),I=Be(),L=Yo(),x=o(()=>de(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);if(i&&o)return e;const[l]=t;return r||!l?(a("auto-selected",n,"pickup"),{countryCode:n}):(a("auto-selected",l.value,"pickup"),{countryCode:l.value})}(P,f.country.code,p,I),{extendedAddressMode:null}),[]),N=o(()=>De({countryCode:void 0,address:void 0}),[]),T=F(x.fields.countryCode,N.countryCode),O=F(x.fields.postalCode,N.address),{details:B,loading:V}=Ie(T.value),R=o(()=>B??f.country,[B,f.country]),H=N.address.value,j=o(()=>p?.length?p:[{value:R.code,label:R.name}],[p,R.code,R.name]),K=d(e=>Oe(e,R,["company","firstName","lastName","phone","countryCode","zoneCode"]),[R]),q=R.zones,$=x.value,G=_.value,W=!!T.value&&Wa(T.value);!function(e,n){const{i18n:t,observability:a,checkout:{wallets:i}}=E(),{inMemoryApplePayParts:{asPaymentMethod:o,isLoadingPaymentSheet:r},inMemoryPayPalParts:{isLoadingPaymentSheet:l}}=z();U(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(),u=new Map;return c.coordinates||u.set("address",t.translate("field_errors.address_address1_blank")),Re(c.countryCode)||u.set("countryCode",t.translate("field_errors.address_country_blank")),u.size?(a.leaveErrorBreadcrumb("Blocking address errors",{errors:Array.from(u).map(([,e])=>e)}),{behavior:"block",reason:D.InvalidLocalPickupAddress,perform:()=>{h(()=>{for(const[e,t]of u)n[e].value=t})}}):{behavior:"allow"}})}(x,N);const Y=Nt(x),X=yn(),Q=()=>{(T.error||O.error)&&(T.clearError(),O.clearError())};i(()=>{const e=l?.value;e?.countryCode&&S(()=>{h(()=>{Y({countryCode:e.countryCode}),_.value="",Q()})})}),i(()=>{const e=k.value;e!==C.current&&(C.current=e,e?.coordinates&&S(()=>{h(()=>{Y(Fe(e)),_.value=K(e),Q()})}))}),a(()=>{const e=x.value;_.value=K(W?e:{postalCode:e.postalCode})},[x,W,K,_]);const J=(n=$)=>{n.coordinates?(q.length||(n.zoneCode=void 0),e(n)):N.address.value=y.translate("local_pickup.could_not_resolve_address")},Z=e=>{const t=()=>{r?.(e),Y({countryCode:e}),T.onChange(e),Q(),I("user-input",e,"pickup")};n?n({countryCode:e},t):t()},ee=u&&!L?{source:"magnify",position:"end"}:void 0,ne=W&&u,te=Boolean(!$.coordinates||!G.length),ae=ne?null:t(tn,{variant:"primary",disabled:te,onClick:J,loading:V,children:y.translate("local_pickup.search_button")}),ie={errors:N,state:{countryCode:x.fields.countryCode,address:W?_:x.fields.postalCode}},oe=Ve(H)?H.message:H,re=W?"location address":"postalCode",le=on(void 0,Rr),se=L?y.translate("local_pickup.location_address_search_placeholder",{postal_code_label:R.labels.postalCode}):y.translate("local_pickup.location_address_search_label");let ce;ce=L||Boolean(ae)?!!oe||void 0:oe;const ue={addressType:"pickup",country:R,address:$,error:ce,field:"address1",value:G,icon:ee,autoFocus:m,onBlur:v,autocomplete:W?"shipping street-address":"shipping postal-code",label:W?se:R.labels.postalCode,name:re,id:le},pe=t(Vr,W?{...ue,onSelect:e=>{!e.coordinates&&e.address1&&g.leaveErrorBreadcrumb("Autocomplete address missing coordinates",{countryCode:e.countryCode||T.value,hasAddress1:Boolean(e.address1),hasPostalCode:Boolean(e.postalCode)});const n=Ue(e.countryCode),t=Boolean(e.countryCode&&!n);t&&g.leaveErrorBreadcrumb("Discarded invalid autocomplete countryCode",{invalidCountryCode:e.countryCode,fallbackCountryCode:T.value});const a=t?{...e,countryCode:T.value}:{...e,countryCode:n};Y(a),u&&J(a),L&&X("click",{element:{tagName:"button",textContent:"local_pickup_autosuggestion_search"},section:"delivery",timestamp:new Date})},onInput:e=>{$.coordinates&&Y({countryCode:T.value}),_.value=e,Q()}}:{...ue,onSelect:e=>{Y(e),_.value=K(e)},required:!0,readOnly:V,onInput:e=>{e?Q():_.value=""},onChange:e=>{_.value=e},allowAllCountries:!0}),me=t(Ln,{children:[t(Hr,{autocomplete:ue.autocomplete,label:ue.label,name:ue.name}),pe]}),he=A()?.checkoutProfile.hasOverrides.value;return t(fn,{target:"cart.deliveryGroups[0].deliveryAddress",children:t(en,{...ie,children:L?t(Je,{gap:"small-300",children:[t(dn,{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(zr,{pickupCountries:j,selectedCountry:R,onCountryChange:Z}),me,t(tn,{variant:"primary",onClick:J,disabled:te,"data-event-name":"local_pickup_search_button",accessibilityLabel:y.translate("local_pickup.search_button"),children:t(nn,{type:"search"})})]}),oe?t(mn,{controlID:le,children:ze(oe)?oe.textValue:oe}):null]}):t(M,{children:[t(w,{children:t(Ya,{interactive:!he,children:t(gt,{name:"countryCode",label:R.labels.country,required:!0,autocomplete:"shipping country-name",readOnly:V,value:R.code,onChange:e=>Z(e),children:j.map(e=>t(bt,{value:e.value,children:e.label},e.value))})})}),ae?t(Je,{gap:"small-300",children:[t(dn,{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:[me,ae]}),oe?t(mn,{controlID:le,children:ze(oe)?oe.textValue:oe}):null]}):me]})})})}function Hr({autocomplete:e,label:n,name:a}){const i=Tt(),o=i?.nested?i.id:void 0;return t(Ln,{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 jr({locationFormVisible:e,toggleLocationFormVisibility:n,children:a,onLocationChange:i,pickupCountries:o}){return"shopPay"===E().checkout.identity.current.value?t(v,{children:[a,t(Kr,{open:e,onModalClose:()=>n(!1),onLocationChange:i,pickupCountries:o})]}):e?t(qr,{onLocationChange:i,pickupCountries:o}):a}function Kr({open:e,onModalClose:n,onLocationChange:a,pickupCountries:i}){const{i18n:o}=E();return t(Sn,{heading:o.translate("local_pickup.toggle_location"),open:e,onHide:n,children:t(Ot,{section:"delivery",children:[t(qr,{onLocationChange:a,changeLocationOnSelect:!0,pickupCountries:i}),t(Ln,{minBlockSize:"@media (inline-size >= small) 120px, 320px"}),t(tn,{onClick:n,inlineSize:"fill",variant:"plain",size:"extraLarge",children:o.translate("local_pickup.cancel")})]})})}const qr=({onLocationChange:e,onBeforeLocationChange:n,changeLocationOnSelect:a,hideFormOnGeoCoordinatesShare:i,pickupCountries:o,addressAutoFocus:r,onAddressBlur:l})=>{const{geolocation:c}=xt(),{i18n:u,checkout:{negotiator:p}}=E(),{locationAddress:h}=p.parts,v=Nt(h),_=s(!0),y=s(),g=s(void 0),b=Yo(),{syncShippingFromPickup:f}=function(){const{shop:e,checkout:{negotiator:n}}=E(),{shippingAddress:t}=n.parts,a=Zn();return{syncShippingFromPickup:d(n=>{if(!a.value)return;if(!n)return;const i=t.value;i.countryCode!==n&&(i.postalCode||i.address1||i.address2||i.city||e.shippingCountries.some(e=>e.value===n)&&(t.value={...i,countryCode:n,zoneCode:void 0,coordinates:void 0}))},[a,t,e])}}(),k=(e,t)=>{const a=()=>{f(e.countryCode),t()};n?n(e,a):a()},P=n=>{if(i&&(_.value=!1),!He(n))return void(y.value=u.translate("pickup_point.could_not_resolve_address"));y.value=void 0;const t={zoneCode:c.zone?.code,countryCode:c.country.code,coordinates:{latitude:n.coords.latitude,longitude:n.coords.longitude}};k({countryCode:c.country.code},()=>{v(t),g.value=t,e(n)})};return t(Je,{gap:b?"small-300":"base",children:[b?null:t(Dr,{onSuccess:P}),t(m,{when:_,fallback:t(tn,{inlineAlignment:"start",variant:"plain",onClick:()=>{_.value=!0},children:u.translate("shipping.local_pickup.search_address")}),children:t(Je,{gap:"base",children:[b?null:t(dn,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content) minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",alignItems:"center",alignContent:"center",children:[t(Nn,{direction:"inline"}),t(Ln,{padding:"none base",children:t(ln,{color:"subdued",children:u.translate("local_pickup.or")})}),t(Nn,{direction:"inline"})]}),t(Ur,{sharedLocationAddress:g,searchOnSelect:a,onSearch:n=>{k(n,()=>{v(n),e(n)})},onBeforeCountryChange:n,onAfterCountryChange:f,pickupCountries:o,addressAutoFocus:r,onAddressBlur:l}),t(m,{when:y,children:e=>t(Je,{gap:"base",padding:"small-200 none none none",children:t(cr,{heading:e})})})]})}),b&&t(Dr,{onSuccess:P,displayAsLink:!0,sharingNotAllowedError:u.translate("local_pickup.geolocation.permission_not_allowed")})]})},$r={id:"82df6c2dc2bed8371d068138beb16fa3f49623a334766ea9cb4e0932a8fed20b",type:"query",name:"PickupCountries",source:""},Gr=Bt(({graphql:{coreGraphql:e},router:n,shop:t},{sellableDeliveryMethods:a})=>{const i=L(()=>n.currentUrl.value.pathname.endsWith("/throttle")),o=e.query($r,{skip:()=>i.value}),r=L(()=>{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=>Wr.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}}),Wr=["SHIPPING","LOCAL"];function Yr(){const{i18n:e}=E(),[n,a]=u(!1),{formattedAddress:i}=tr(),o=i?t(Je,{direction:"inline",gap:"small-500",alignItems:"center",children:[t(nn,{type:"geolocation",size:"small-100"}),t(ln,{children:nr(i,13)})]}):e.translate("local_pickup.toggle_location");return t(fn,{target:"cart.deliveryGroups[0].deliveryAddress",children:t(Tn,{accessibilityLabel:e.translate("delivery_options.pick_up_locations"),children:t(Je,{gap:"small-500",children:[t(dn,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content)",gridTemplateRows:"minmax(0, 1fr)",alignItems:"baseline",children:[t(In,{level:2,children:e.translate("delivery_options.pick_up_locations")}),t(vn,{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(Xr,{isLocationFormVisible:n,setIsLocationFormVisible:a})]})})})}function Xr({isLocationFormVisible:n,setIsLocationFormVisible:a}){const i=V(),{i18n:r,observability:l,checkout:{negotiator:c}}=E(),{negotiating:u}=tt(),d=Se(),p=fe("deliveryNext"),m=s(!1),{value:h}=wt().value,v=Boolean(h),{isOnlyCountryAvailable:_}=tr(),y=Yo(),{deliveryLines:g}=c.parts,b=g.value,{negotiate:f}=We(),k=Dt(),P=Bn("Checkout::PickupLocations::RenderBefore"),C=Bn("Checkout::PickupLocations::RenderAfter"),I=o(()=>({isLocationFormVisible:n}),[n]),S=()=>a(!1),L=()=>a(e=>!e),M=()=>{S(),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({silenceViolations:re(["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:f,proposedDeliveryLines:b,pickupDeliveryLineId:d.value?.id,pending:m,deliveryNextLoading:p}).catch(e=>l.error(e))},A=le(),{pickupCountries:w,loading:x}=je(Gr,{sellableDeliveryMethods:A}),N=e(()=>Boolean(d.value&&Zo(d.value.methods)));if(v)return t(Qr,{isLocationFormVisible:n,setFormVisibilityFalse:S,handleLocationChange:M,pickupCountries:w.value??[],onToggleLocationFormClick:L});if(u.value||!i.value||x.value||!w.value)return t(ir,{});if(d.value){const{methods:e,type:a}=d.value,i=k.value.PICK_UP??0,o=N.value&&y&&!_,l=mr(i,_?{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(Je,{gap:"base",children:[t(br,{}),t(zn,{customizations:P,options:I}),t(dn,{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(Xe,{color:"subdued",children:y?l:r.translate("local_pickup.location_information",{count:e.length})})}),t(jr,{locationFormVisible:n,toggleLocationFormVisibility:S,onLocationChange:M,pickupCountries:w.value,children:t(nl,{itemCount:i,methods:e,type:a,allLocationsFarAway:N,loading:m.value,onToggleLocationFormClick:L})}),t(zn,{customizations:C,options:I})]})}return t(Qr,{isLocationFormVisible:n,setFormVisibilityFalse:S,handleLocationChange:M,pickupCountries:w.value,onToggleLocationFormClick:L})}function Qr({isLocationFormVisible:e,setFormVisibilityFalse:n,handleLocationChange:a,pickupCountries:i,onToggleLocationFormClick:o}){const{value:r,loading:l}=At().value,{i18n:s,checkout:{negotiator:c}}=E(),u=c.current.fields.merchandiseLines,{locationAddress:d}=c.parts,p=d.peek(),m=i.find(e=>e.value===p.countryCode)?.label,h=St(u.value?.lines),v=m?s.translate("order_summary.pickup_unavailable_banner_title_with_country",{count:h,country:m}):s.translate("order_summary.pickup_unavailable_banner_title",{count:h});return!l&&r?t(Je,{gap:"base",children:[t(jr,{locationFormVisible:e,toggleLocationFormVisibility:n,onLocationChange:a,pickupCountries:i,children:t(cr,{heading:v,tryDifferentLocationOnClick:o})}),t(Jr,{})]}):t(ir,{})}function Jr(){return It({active:!0}),null}function Zr({instructions:e}){return t(Ln,{maxInlineSize:"200px",children:t(Xe,{type:"small",children:e})})}function el({handle:e,address:n,secondaryLabel:a,letterCase:i,showInstructionsLeft:r,showInstructionsRight:l,instructions:s,nameLabel:c,itemRenderAfterCustomizations:u}){const d=o(()=>({handle:e}),[e]);return t(Fa,{value:e,details:t(v,{children:[t(Ha,{address:n,textSize:"small",hiddenFields:["phone"]}),r&&s&&t(Zr,{instructions:s})]}),secondaryContent:t(v,{children:[t(ln,{type:"strong",letterCase:i,children:t("span",{style:{display:"flex",justifyContent:"flex-end"},children:a})}),l&&s&&t(Zr,{instructions:s})]}),tertiaryContent:u?.length>0&&t(zn,{customizations:u,options:d,render:e=>t(Je,{padding:"small-100 none none none",gap:"small-100",children:e})}),children:t(ln,{type:"strong",children:c})})}function nl({itemCount:e,methods:n,allLocationsFarAway:i,type:r,loading:l,onToggleLocationFormClick:s}){const{i18n:c,checkout:{identity:p}}=E(),h="shopPay"===p.current.value,{negotiate:_}=We(),y=Ke(),{isOnlyCountryAvailable:g}=tr(),b=Yo(),f=V(),k=Ft({base:!0,medium:!1}),P=!f.value||(k??!1),[C,I]=Vt({type:r,deliveryMethodType:"PICK_UP"}),{revealedMethods:S,amountLeft:L,allRevealed:M,revealMore:A}=function(e,n){const t=Ct({methods:e,selectedDeliveryMethodHandle:n}),[i,r]=u(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,C),{setInverseGroupDeliveryMethodHandle:w,getInverseGroupDeliveryMethodHandle:x}=zt(n,r),N=d(([e=""])=>{if(I(e),y.value){const n=x(e);w(n)}_({silenceViolations:re(["deliveryNext"])})},[I,y,_,x,w]),T=Bn("purchase.checkout.pickup-location-option-item.render-after"),O=Gn(Et(Te)),B=_r({allLocationsFarAway:i,selectedPickupOptionNoLongerAvailable:O}),D=o(()=>C?[C]:[],[C]);return l?t(ir,{hideText:!0}):t(Je,{gap:"base",children:[t(m,{when:B,children:t(hr,{itemCount:e,methods:n,onChangeLocationClick:s})}),O.value&&t(vr,{}),t(Ra,{name:"local_pickup_methods",values:D,onChange:N,hideRadioControl:!h&&1===S.length,children:S.map(({handle:e,cost:{amount:n,currencyCode:a},pickupLocation:i})=>{const{address:o,instructions:r,name:l,distanceFromBuyer:s,proximityLabel:u}=i,d=((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(g||!a&&!n)return e;const i=n||`(${Qo(c,a)})`;return t(v,{children:[e," ",t(ln,{color:"subdued",children:i})]})})({name:l,distance:s,proximityLabel:b?void 0:u}),m=d===c.translate("shipping.free_rate_label")?"uppercase":void 0,_=Boolean(r&&(h||P)),y=Boolean(r&&!h&&!P);return t(el,{handle:e,address:o,secondaryLabel:d,letterCase:m,showInstructionsLeft:_,showInstructionsRight:y,instructions:r,nameLabel:p,itemRenderAfterCustomizations:T},e)})}),!M&&t(Ln,{inlineAlignment:"end",children:t(vn,{onClick:A,children:c.translate("local_pickup.reveal_more_label",{count:L})})})]})}function tl(){const e=Yo();return t(e?Er:Yr,{})}const al=cn("VatNumberFieldInfoTooltip");function il({status:e}){const{i18n:n}=E();return"pending"===e.type?t(hn,{size:"small",accessibilityLabel:n.translate("taxes.vat_number.accessibility.status.validating")}):"invalid_format"===e.type?t(rl,{}):t(ol,{status:e})}function ol({status:{validationStatus:e}}){const{i18n:n}=E();return"VALID"===e?t(v,{children:[t(nn,{tone:"success",size:"small",type:"check-circle"}),t(ln,{accessibilityVisibility:"exclusive",children:n.translate("taxes.vat_number.accessibility.status.valid")})]}):t(rl,{})}function rl(){const{i18n:e}=E(),n=on(void 0,al);return t(v,{children:[t(nn,{size:"small",type:"question-circle",interestFor:n}),t(sn,{id:n,children:e.translate("taxes.vat_number.field.tooltip")})]})}function ll({taxId:n,applied:i,inputRef:o}){const{i18n:r}=E(),l=function({taxId:e}){const{negotiate:n}=We(),t=Rt(),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,checkout:{negotiator:a}}=E(),{shippingAddress:i}=a.parts,o=_(n);return e(()=>{const e=i.value.countryCode?.toLowerCase(),n=o.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),u=e(()=>s.value&&{type:"warning",value:s.value.message}),d=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,()=>{if("resolved"===l.status.type&&"VALID"===l.status.validationStatus&&i)return rn({content:r.translate("taxes.vat_number.accessibility.status.applied"),role:"alert"});if(d)return rn({content:r.translate("taxes.vat_number.accessibility.status.domestic"),role:"status"});const e=s.value;if(e)switch(e.code){case"invalid_number":return rn({content:r.translate("taxes.vat_number.accessibility.status.invalid_number"),role:"alert"});case"service_error":return rn({content:r.translate("taxes.vat_number.accessibility.status.service_error"),role:"alert"});case"service_unavailable":return rn({content:r.translate("taxes.vat_number.accessibility.status.service_unavailable"),role:"alert"})}}),t(Je,{direction:"block",gap:"base",children:[t("div",{"aria-busy":l.loading,children:t(pn,{ref:o,name:"vatNumber",label:r.translate("taxes.vat_number.field.label"),autocomplete:"off",inputMode:"text",accessoryEnd:t(il,{status:l.status}),error:u.value,...l})}),d&&t(at,{tone:"info",children:r.translate("taxes.vat_number.domestic_order")})]})}export{bo as $,Vr as A,Ci as B,ki as C,$o as D,Yi as E,hr as F,Oi as G,to as H,so as I,ci as J,Zo as K,Pr as L,pr as M,ar as N,lr as O,Gr as P,Yo as Q,gr as R,qr as S,Qo as T,ho as U,ll as V,yr as W,jo as X,Co as Y,Sr as Z,Io as _,tr as a,xo as a0,Vo as a1,Ja as a2,ao as a3,dr as b,_r as c,ir as d,vr as e,cr as f,uo as g,ur as h,br as i,Qa as j,si as k,no as l,yo as m,fr as n,Wo as o,mr as p,go as q,To as r,Si as s,tl as t,kr as u,No as v,eo as w,Ii as x,Cr as y,Dr as z};