PageSourceSearch

https://wearegladfolk.com/cdn/shopifycloud/checkout-web/assets/c1/f8706cb6.CmzBr8Jo.js

js wearegladfolk.com collected 2026-10-07 00:21:28 UTC 175,302 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["26e63865.Cr09dj1v.js","2c1ab0fe.Bywc2Brn.js","164ad2e3.DHuJhR22.js","9dba8418.DInoCEzY.js","app.D2wFhSFv.js","assets/app.BuSMBobh.css","assets/paypal-express-utilities.BhV0n1qN.css","d0bb51ec.DwFzQH6k.js","f67abd2c.CxgiarJo.js","60a453ce.CQQC7Spq.js","e12db40c.DJw7xsqf.js","assets/hydrate.ByGT37s3.css","f3fe2775.COKYRnyG.js","ac5a19ff.By75ODwH.js","598fef4e.TLWCeEj7.js","assets/PaymentIcon.gzvCNwz_.css","e77f7fe0.Dq32v_oT.js","22345fd4.DBXfVnfa.js","4b1c22b7.CaFHnwF0.js","assets/PaymentLine.DT05kVlY.css","a422df8c.69YDwZq9.js","efa0389a.BrVghuh8.js","assets/Choice.B7lVAtpz.css","assets/EmptyState.BEvzDDvy.css","cc6ff67d.BL7MkjW4.js","08a3b809.5tqP2mr3.js","d25d1b95.DsyU8-pY.js","bf513f9c.BCCOkGM7.js","e39bc11c.gbgXD8RN.js","7a8217fd.BZYlxizD.js","8599b02a.83fij-dk.js","assets/useShopPayProgressIntercepts.CIy8uDiZ.css","cf29e63b.Cl-tFGZz.js","assets/hasViolationsIgnoringCodes.BcTJoNaV.css","dfc03c53.DHSFoLiA.js","86720dbb.D0qR6VoS.js","dfca5da5.DZ8Enryg.js","dae24aab.DshQXsWO.js","assets/Section.CU18S7Ap.css","55098bf1.DKOH2TGl.js","0e67bd3b.CXnH6HFm.js","74835653.CZU0gWLB.js","3ca8ef7e.DWjSQTNc.js","2495faa4.Tu9qVTlu.js","a9fa9fda.JxdJYte2.js","ca3e798e.Dc9DtEXz.js","47b970b2.CJVz388Q.js","assets/PhoneField.uZEuHncj.css","064f6ac1.B2UyZ3Ta.js","assets/Popover.Bi1nHaU-.css","assets/BillingAddressForm.BdwN7V1K.css","2bac2c53.gEGJwgcc.js","f692f62f.4xq3n272.js","9babe369.D342A3FZ.js","b684bff6.6xaGXwIR.js","assets/RedirectionNotice.DgiInWJ-.css","79974aab.D9dodboU.js","58314944.BgFF-GDw.js","assets/PaymentMethodProgressionHost.BIxPaYCu.css","434e3b0a.B1BBnK_d.js","50130ded.BPVr3hhF.js","65f3d4da.Bb3QiqCm.js","31cc568e.95lmLO5k.js","assets/KnownBuyerPaymentMethodSelector.BXqN6ZOx.css","c10167e6.CdxHkwxl.js","b9c0319a.CP0dk-f4.js","dffdfb34.BkWX9Jyi.js","1f5e7811.Cs21gkYk.js","assets/ShopPayLogo.87JMHPUK.css","1d34c07e.h4dJAaCz.js","assets/ExpressCheckoutButton.BnDF3H7t.css","2fdb3dd3.C5f1PgoM.js","17425706.Cliq-lrN.js","cb5cf153.DLvw34Ln.js","e3e348f2.Bv52tyZZ.js","71ae3d5c.BGterdcv.js","cb38e5c2.BxvsOkWl.js","78ab3dd0.DKtM_PR5.js","ed9f2238.DZeVQIk0.js","6fb6f9d8.FmllVyKq.js","1444e6bd.nTYcj6dN.js","0b8657b8.BoesyUy1.js","7b0c98ea.BDiOkxId.js","assets/TransitionHeight.CuRoM9zv.css","d22d2b80.DIQep87t.js","f49d4216.aE0oi_Pc.js","assets/VatNumberValidationField.BLDXmYNt.css","f1968089.DLi6Kihi.js","17e57de1.B_nQLFIZ.js","assets/PaymentOptionSelector.s-Kd_X2E.css","91811554.CTWF738M.js","21cc90a2.DHzOO82q.js","64de7b49.CLNCr43I.js","347b440c.8UmgLgUR.js","9ce08e25.DbZR-P3G.js","assets/EstimatedDeliveryContent.B_THySFF.css","0e9ee714.DkM8y9O3.js","39921a74.BpdG6bKT.js","assets/Switch.BS8yVgoP.css","ccdf3592.BVTVJP2g.js","71b60e0a.DfPLdYsH.js","24773686.BY4hRSf6.js","ec391382.192yha1M.js","assets/StickyPayButton.Cv62Qqkq.css","a25deb9a.puhXAk9E.js","01973ac7.v4l-22MT.js","945a08d6.tCcESvAp.js","7bc8057b.G6xDtzfc.js","assets/constants.xO_7ctnq.css","2b89a178.BgrKJQut.js","910cd6e2.BdN5ojLZ.js","181d38d3.CXIvj6V1.js","792bb671.B3OvVnSg.js","assets/Middot.D7Ujmshx.css","d6447d9e.CjZeRf6L.js","f51e663e.Cswasroy.js","8e79be58.WzN5b53K.js","assets/ShippingMethodSelector.B0hio2RO.css","90e26f5f.BfJG0RLt.js","assets/SubscriptionPriceBreakdown.vTcdVGq4.css","assets/ShippingLines.LcqrKXE1.css","ca5e9c49.DTPqgqLh.js","f3e117aa.8yduwivm.js","68887467.B_Jhy707.js","ca8e826d.Cbzk8YxF.js","assets/Avatar.gBkEAe_p.css","17a5f1e4.C_2FUFrI.js","0e4087ec.CNyU4fN9.js","7aefefff.CUtCwl2P.js","b3389d5c.QEUfL4f1.js","73a9b0a0.hcoblGFa.js","81e109b1.DOkM2TK2.js","e0989459.Bg8DY6tL.js","cdfd59e6.BKhDBRbA.js","assets/RememberMeSection.JBO5WNhc.css","fc21c11a.CFb6-Oxb.js","e129c76e.Bzz9ssIz.js","d4ea2faa.XFt6zT8f.js","fe885b80.jONiPULW.js","f78726c8.B_6HchCq.js","assets/hooks.CKE1iCma.css","e477f96c.Bzke7wRl.js","1ed8f5e3.CzhdrJHY.js","assets/floating-layer.DfWUBaTh.css","7ee73f43.CcAyAXKM.js","0c0ad074.DhgxlD4t.js","assets/useShopPayButtonClassName.BrcQzLuH.css","87bfafec.CxwEzGHg.js","assets/PayButtonSection.CZuxzxFG.css","d2e6a587.JvgfpEXS.js","assets/MobileOrderSummary.DjDhVpQB.css","assets/BelowTheFoldContent.CmuzzmSI.css"])))=>i.map(i=>d[i]);
2import{_ as e}from"./app.D2wFhSFv.js";import{u as n,k as t,w as a,S as i,X as r,i as o,x as l,h as s,T as u,y as c,I as d,j as p,p as h,L as m,s as v,o as y,g,q as f,z as b,n as _,ah as C,m as P,_ as S,G as A,N as k}from"./2c1ab0fe.Bywc2Brn.js";import{H as E,bx as w,aM as O,ft as I,L as R,hL as T,c8 as L,df as N,G as D,al as M,b as B,j as x,S as V,aa as F,B as H,e5 as z,hM as j,o as U,bT as G,b_ as Y,eH as W,b$ as q,A as K,da as $,a1 as J,hs as X,gI as Z,f as Q,ab as ee,c as ne,bm as te,hN as ae,bZ as ie,fE as re,bX as oe,bW as le,d3 as se,eO as ue,bl as ce,cZ as de,eU as pe,d as he,K as me,bL as ve,l as ye,dJ as ge,v as fe,hO as be,aV as _e,cB as Ce,a9 as Pe,eM as Se,aW as Ae,Z as ke,hP as Ee,eR as we,au as Oe,hq as Ie,bU as Re,cK as Te,hQ as 
2Le,hR as Ne,hS as De,hT as Me,f8 as Be,eg as xe,cH as Ve,h1 as Fe,hU as He,hV as ze,bJ as je,hW as Ue,bE as Ge,cv as Ye,eS as We,ee as qe,by as Ke,hX as $e,hY as Je,c_ as Xe,di as Ze,dl as Qe,hZ as en,dd as nn,dg as tn,bP as an,h_ as rn,h$ as on,dj as ln,dk as sn,cx as un,h7 as cn,h8 as dn,U as pn,eW as hn,eP as mn,bF as vn,f5 as yn,bd as gn,aC as fn,aS as bn,i0 as _n,bG as Cn,i1 as Pn,i2 as Sn,cj as An,er as kn,eT as En,f4 as wn,eX as On,i3 as In,ai as Rn,as as Tn,M as Ln,cm as Nn,i4 as Dn,m as Mn,i5 as Bn,t as xn,i6 as Vn,cw as Fn,e$ as Hn,c1 as zn,cf as jn,c5 as Un,d6 as Gn,eY as Yn,dn as Wn,i as qn,ao as Kn,V as $n,fa as Jn,p as Xn,i7 as Zn,aj as Qn,eN as et,hg as nt,i8 as tt,af as at,ag as it}from"./164ad2e3.DHuJhR22.js";import{c as rt,cF as ot,a5 as lt,W as st,j6 as ut,jE as ct,bJ as dt,bz as pt,bF as ht,jF as mt,gw as vt,hN as yt,aL as gt,hL as ft,hJ as bt,aN as _t,hM as Ct,jt as Pt,bv as St,aI as At,by as kt,jG as Et,n as wt,jH as Ot,g8 as It,bK as Rt,b8 as Tt,bi as Lt,hq as Nt,K as Dt,m as Mt,jI as Bt,J as xt,af as Vt,dj as Ft,gf as Ht,x as zt,I as jt,f9 as Ut,ad as Gt,jJ as Yt,l as Wt,fq as qt,Z as Kt,jK as $t,b9 as Jt,jL as Xt,jM as Zt,f3 as Qt,N as ea,c8 as na,ev as ta,H as aa,jN as ia,eN as ra,ej as oa,ab as la,e6 as sa,bd as ua,iP as ca,ah as da,gs as pa,b4 as ha,c4 as ma,e2 as va,jO as ya,z as ga,f4 as fa,jP as ba,iT as _a,jQ as Ca,jR as Pa,iV as Sa,gg as Aa,u as ka,gu as Ea,V as wa,jS as Oa,fb as Ia,fa as Ra,d3 as Ta,cG as La,cI as Na,cJ as Da,cH as Ma,jT as Ba,j as xa,eL as Va,c$ as Fa,fu as Ha,bl as za,at as ja,iU as Ua,jU as Ga,da as Ya,as as Wa,d8 as qa,c_ as Ka,i_ as $a,jV as Ja,jW as Xa,jX as Za,jY as Qa,jZ as ei,j_ as ni,j0 as ti,d1 as ai,j$ as ii,iX as ri,aa as oi,k0 as li,C as si,k1 as ui,aq as ci,k2 as di,k3 as pi,k4 as hi,k5 as mi,p as vi,h as yi,iJ as gi,iK as fi,k6 as bi,k7 as _i,ap as Ci,bf as Pi,iN as Si}from"./9dba8418.DInoCEzY.js";import{w as Ai,x as ki,C as Ei,y as wi,f as Oi,U as Ii,u as Ri,I as Ti,i as Li,z as Ni,B as Di,F as Mi,G as Bi,H as xi,J as Vi,K as Fi,k as Hi,M as zi,S as ji,N as Ui,O as Gi,Q as Yi,R as Wi,h as qi,T as Ki,W as $i,X as Ji,Y as Xi,Z as Zi,g as Qi,j as er,_ as nr,D as tr,c as ar,$ as ir,d as rr,a0 as or,l as lr,m as sr,n as ur,e as cr,V as dr,p as pr,E as hr,o as mr}from"./dffdfb34.BkWX9Jyi.js";import{k as vr,D as yr,u as gr,s as fr,b as br,c as _r,l as Cr,a as Pr,H as Sr}from"./0e9ee714.DkM8y9O3.js";import{X as Ar,U as kr,N as Er,W as wr,b as Or,Y as Ir,Z as Rr,c as Tr,d as Lr,G as Nr,S as Dr,e as Mr,_ as Br,$ as xr,a0 as Vr,a1 as Fr,a2 as Hr,f as zr,n as jr,v as Ur,x as Gr,p as Yr,q as Wr,r as qr,z as Kr,s as $r,A as Jr,V as Xr,a3 as Zr,a4 as Qr,h as eo,u as no,t as to,T as ao,i as io}from"./f3fe2775.COKYRnyG.js";import{a as ro,c as oo,S as lo,M as so}from"./dfca5da5.DZ8Enryg.js";import{T as uo,S as co,M as po}from"./79974aab.D9dodboU.js";import{R as ho,P as mo,C as vo}from"./e77f7fe0.Dq32v_oT.js";import{A as yo,C as go,u as fo,S as bo}from"./0e67bd3b.CXnH6HFm.js";import{b as _o,a as Co,f as Po,u as So}from"./a25deb9a.puhXAk9E.js";import{E as Ao,u as ko,b as Eo,a as wo,c as Oo}from"./01973ac7.v4l-22MT.js";import{u as Io}from"./945a08d6.tCcESvAp.js";import{c as Ro,a as To}from"./58314944.BgFF-GDw.js";import{P as Lo}from"./598fef4e.TLWCeEj7.js";import{O as No,W as Do,b as Mo,a as Bo}from"./7a8217fd.BZYlxizD.js";import{a as xo,b as Vo,C as Fo}from"./efa0389a.BrVghuh8.js";import{a as Ho,S as zo,u as jo,b as Uo}from"./bf513f9c.BCCOkGM7.js";import{U as Go,I as Yo}from"./7bc8057b.G6xDtzfc.js";import{B as Wo,A as qo}from"./74835653.CZU0gWLB.js";import{g as Ko,d as $o,c as Jo,e as Xo}from"./d25d1b95.DsyU8-pY.js";import{S as Zo,E as Qo,f as el,r as nl,e as tl,h as al,i as il,j as rl,b as ol,c as ll,I as sl,g as ul}from"./f1968089.DLi6Kihi.js";import{b as cl,a as dl,t as pl,d as hl,u as ml,c as vl}from"./2b89a178.BgrKJQut.js";import{a as yl,v as gl,b as fl,u as bl}from"./1f5e7811.Cs21gkYk.js";import{a as _l}from"./f67abd2c.CxgiarJo.js";import{S as Cl}from"./39921a74.BpdG6bKT.js";import{u as Pl,a as Sl,M as Al,b as kl}from"./b684bff6.6xaGXwIR.js";import{C as El,b as wl,E as Ol}from"./a422df8c.69YDwZq9.js";import{u as Il,h as Rl}from"./17425706.Cliq-lrN.js";import{C as Tl}from"./cf29e63b.Cl-tFGZz.js";import{h as Ll,v as Nl}from"./2bac2c53.gEGJwgcc.js";import{u as Dl,d as Ml,c as Bl}from"./24773686.BY4hRSf6.js";import{S as xl}from"./6fb6f9d8.FmllVyKq.js";import{S as Vl}from"./cb5cf153.DLvw34Ln.js";import{S as Fl}from"./cb38e5c2.BxvsOkWl.js";import{u as Hl,a as zl}from"./22345fd4.DBXfVnfa.js";import{P as jl}from"./47b970b2.CJVz388Q.js";import{I as Ul}from"./55098bf1.DKOH2TGl.js";import{a as Gl}from"./ed9f2238.DZeVQIk0.js";import{A as Yl,C as Wl}from"./4b1c22b7.CaFHnwF0.js";import{V as ql,M as Kl,u as $l,a as Jl,S as Xl,R as Zl,b as Ql}from"./910cd6e2.BdN5ojLZ.js";import{b as es,a as ns,g as ts}from"./e12db40c.DJw7xsqf.js";import{r as as}from"./dae24aab.DshQXsWO.js";import{D as is,u as rs,S as os}from"./d6447d9e.CjZeRf6L.js";import{g as ls}from"./65f3d4da.Bb3QiqCm.js";import{M as ss,c as us,u as cs,b as ds}from"./64de7b49.CLNCr43I.js";import{u as ps,S as hs,a as ms,E as vs}from"./347b440c.8UmgLgUR.js";import{b as ys}from"./2fdb3dd3.C5f1PgoM.js";import{u as gs}from"./ca5e9c49.DTPqgqLh.js";import{f as fs,i as bs}from"./e3e348f2.Bv52tyZZ.js";import{S as _s}
2from"./f3e117aa.8yduwivm.js";import{S as Cs}from"./1d34c07e.h4dJAaCz.js";import{T as Ps}from"./7b0c98ea.BDiOkxId.js";import{F as Ss}from"./3ca8ef7e.DWjSQTNc.js";import{D as As}from"./f49d4216.aE0oi_Pc.js";import{S as ks}from"./f51e663e.Cswasroy.js";import{m as Es}from"./21cc90a2.DHzOO82q.js";function ws(){const{i18n:e}=rt();return n(E,{level:1,children:e.translate("embed.header.review_order")})}function Os(){const{hasError:e}=w(ot),i=_o().value,{i18n:r,observability:o}=rt(),l=r.translate("review.blocks.change_link_label"),{inMemoryAmazonPayParts:{hasPaymentSheetError:s,sdkStatus:u}}=lt(),c=t(()=>{const e=u.value;return e.status===O.Available?e.sdk:void 0});if(!i)return null;const d=I(i.method.walletParams)?.checkout_session_id;return n(a,{when:c,children:t=>n(R,{onClick:()=>{try{t.buywithprime.changePaymentMethod({amazonPayOptions:{amazonCheckoutSessionId:d,isDeclined:e}})}catch(n){s.value=!0,o.error(new T(`Error on changing buyer payment method. Details: ${n}`,{cause:n}))}},children:l})})}function Is(){const e=rt(),{i18n:t}=e,a=function({checkout:e}){return"buyWithPrime"===e.identity.current.value?{rollupId:"buyWithPrimePayDetails",sdkButton:n(Ai,{wallet:st.BuyWithPrime,isSdkOnly:!0}),changeLink:n(Os,{})}:{rollupId:"amazonPayDetails",sdkButton:n(yo,{isSdkOnly:!0}),changeLink:n(Ar,{})}}(e);return n(i,{children:[a.sdkButton,n(ho,{id:a.rollupId,label:t.translate("payment.title"),primaryContent:n(Rs,{}),primaryAction:a.changeLink})]})}function Rs(){const{brand:e,descriptor:t}=kr().value,a=L(),i=ut(),r=N();return a.value?i.value?n(Er,{vaulted:!0,reason:"giftCard"}):t&&r.value?n(wr,{brand:e,descriptor:t}):n(D,{}):n(Er,{vaulted:!0,reason:"freeOrder"})}function Ts({label:e}){const{i18n:t}=rt();return M(),n(i,{children:[n(B,{accessibilityRole:"status",children:n(x,{accessibilityVisibility:"exclusive",children:t.translate("vaulted.loading_section",{section:e(t)})})}
2),n(V,{gap:"small-300",children:[n(D,{inlineSize:"large"}),n(D,{inlineSize:"large"}),n(D,{inlineSize:"small"})]})]})}class Ls{#e=c(0);#n=d(()=>this.#e.value>0);get hasFailures(){return this.#n}register(){return this.#e.value+=1,()=>{this.#e.value-=1}}}const Ns=r(null);function Ds({children:e}){const t=u(()=>new Ls,[]);return n(Ns.Provider,{value:t,children:e})}function Ms(){const{i18n:e}=rt(),t=l(Ns);return t?n(a,{when:()=>t.hasFailures.value,children:n(B,{paddingBlockEnd:"base",children:n(Ao,{bannerId:"VaultedRollupContentsLoadError",errorType:F.CheckoutError,heading:e.translate("error_page.terminal.title"),tone:"critical",autoFocus:!0,iconHidden:!0,children:n(V,{gap:"small-400",alignItems:"start",children:[n(x,{children:e.translate("error_page.terminal.message")}),n(H,{variant:"plain",onClick:()=>globalThis.location.reload(),children:e.translate("error_page.terminal.action.cta")})]})})})}):null}function Bs({children:e}){const t=l(Ns),a=t?.hasFailures.value??!1;return n(B,{inert:a,opacity:a?50:void 0,children:e})}const xs=()=>e(()=>import("./26e63865.Cr09dj1v.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,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122]));function Vs(){return p(xs)}function Fs(e,t,a){return function({displayName:e,load:t,loadingLabel:a}){return o({displayName:e,load:t,suspense:!1,renderLoading:()=>n(Ts,{label:a}),useError:function(n){const{observability:t}=rt(),a=l(Ns);M({active:Boolean(n)}),s(()=>{if(n)return t.error(n,{metadata:{vaulted:{component:e,failure:"lazy_load",boundary:a?"present":"missing"}}}),a?.register()},[n,t,a])}})}({displayName:e,loadingLabel:t,load:async()=>a((await Vs()).vaultedRollupContents)})}const Hs=Fs("DefaultVaultedPaymentRollupContent",e=>e.translate("payment.title"),e=>e.DefaultVaultedPaymentRollupContent),zs=Fs("VaultedShippingMethodsRollupContent",e=>e.translate("shipping.title"),e=>e.VaultedShippingMethodsRollupContent),js=Fs("VaultedBillingAddressRollupContent",e=>e.translate("billing.billing_address_title"),e=>e.VaultedBillingAddressRollupContent),Us=Fs("DefaultVaultedDeliveryAddressRollupContent",e=>e.translate("shipping.shipping_address_title"),e=>e.DefaultVaultedDeliveryAddressRollupContent),Gs=Fs("VaultedLocalPickupOptionsRollupContent",e=>e.translate("local_pickup.title"),e=>e.VaultedLocalPickupOptionsRollupContent),Ys=Fs("VaultedPaymentOptionsRollupContent",e=>e.translate("payment.payment_option.title"),e=>e.VaultedPaymentOptionsRollupContent);function Ws(e,n){const t=new Set(n.map(e=>e.id));return e.some(e=>t.has(e.id))}function qs(e,n){const t=z();return h(()=>{n&&Ws(t.blockingExtensions.value,e)&&m(()=>n())}),Ws(t.blockingExtensions.value,e)}function Ks(){const{checkout:{negotiator:e}}=rt(),{generalPaymentError:n,generalPaymentErrorCode:a}=e.parts,{violations:i}=j(ct);return t(()=>!!n.value&&(!dt(a.value)||i.value.size>0))}function $s({showTips:e,billingFormPosition:n}){const t=U("Checkout::Dynamic::Render","PAYMENT1"),a=U("Checkout::Dynamic::Render","PAYMENT2"),i=U("Checkout::Dynamic::Render","PAYMENT3"),r="inContext"===n||"hidden"===n||"afterPayment"===n&&e?[[],t,a]:[a,t];return(e||"afterPayment"===n)&&r.push(i),r}function Js(e,n){return e.currentUrl.value.hash===`#${n}`}function Xs(e,n=!1){const{router:a}=rt(),i=v(e),r=t(()=>Js(a,i.value)),o=y(n);return s(()=>{r.peek()&&(o.value=!0)},[r,o]),o}function Zs({autoOpen:e=!0,isMissing:n,open:t}){s(()=>{e&&n&&(t.value=!0)},[e,n,t]);const{shopPay:{progressInterceptor:a}}=rt();s(()=>{if(n)return a.listenResult(e=>{e||(t.value=!0)})},[a,n,t])}function Qs(){const{loading:e}=W(),{checkout:n}=rt(),t=n.isShippingRequired.value,a=n.negotiator.parts.shippingAddress.value,{shippingAddress:i,deliveryNext:r}=n.negotiator.current.fields,o=i.value,l=vt(r.value),s=!t||!e&&(l||a?.countryCode===o?.countryCode),u=y(s);return s&&!u.value&&(u.value=!0),u}function eu(){const{shop:e}=rt(),n=e.hasFlagEnabled(ft),a=Or(),i=bt(),r=_t(),o=Ct(),{loading:l}=W(),s=v(l),u=Ir(a),c=Qs(),d=t(()=>{const e=a.value;if(o.value&&e&&!(e.balance.amount<=0))return u.value?Rr({firstOrderTotal:i.value,storeCreditAccount:e}):0===r.value?.amount&&i.value?.currencyCode===e.balance.currencyCode?e.balance:void 0}),p=Tr(a),h=t(()=>{const e=c.value,t=!s.value,a=p.value,i=null!=d.value;return n&&e&&t&&a&&i});return{storeCreditBalanceForSubscriptionRenewals:d,showStoreCreditForSubscriptionRenewals:h}}function nu(){const{i18n:e,checkout:{negotiator:t}}=rt(),{paymentLines:a}=t.parts,{violations:i}=q(ct),{message:r,tone:o}=ko(),l=[...i][0],u=l&&(l.localizedMessage||l.nonLocalizedMessage),c=a.value.find(e=>"giftCard"!==e.method.type&&"redeemable"!==e.method.type)?.method,d="customOnsite"===c?.type?c:void 0,p=d?e.translate("payment_errors.local_payment_method_unavailable",{payment_method:d.name}):void 0,h=Boolean(r)&&("critical"===o||"warning"===o),m=u&&p&&h?`${p}. ${u}
2`:void 0;return s(()=>{if(m)return K({content:m})},[m]),u&&d?n(Ao,{errorType:F.PaymentError,bannerId:"LocalPaymentMethodUnavailableBanner",tone:"warning",heading:p,autoFocus:!h,children:u}):null}function tu({openRedeemablesModal:e,includeStoreCredit:t=!0}){const{i18n:a}=rt(),i=Lr(),{paymentLines:r}=$(),o=t&&i.value.length>0,l=r.length>0,s=[...t?i.value:[],...r];if(!s.length)return null;let u="";return u=l&&o?a.translate("payment.gift_card_store_credit.manage_label"):l?a.translate("payment.gift_card_wrapper.manage_label"):a.translate("payment.store_credit.manage_label"),n(V,{children:[n(V,{gap:"small-200",padding:"small-100",border:"base",borderRadius:"base base none none",children:s.map(e=>n(au,{paymentLine:e},Pt(e.method)))}),n(B,{inlineAlignment:"start",padding:"small-200",borderWidth:"none base base base",borderRadius:"none none base base",children:n(R,{onClick:e,textDecoration:"none",children:n(V,{direction:"inline",alignItems:"center",gap:"small-200",children:[n(J,{type:"edit"}),n(x,{children:u})]})})})]})}function au({paymentLine:e}){const{i18n:t}=rt();switch(e.method.redemptionSource){case"STORE_CREDIT":return n(ee,{gridAutoFlow:"column",gridAutoColumns:"minmax(0, 1fr)",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",children:[n(V,{direction:"inline",alignItems:"center",gap:"small-100",children:[n(Lo,{type:"store-credit"}),n(x,{children:t.translate("payment.store_credit.label")})]}),n(Q,{textAlign:"end",children:n(x,{type:"strong",children:e.cost&&t.formatCurrency(e.cost.amount,{form:"short",currency:e.cost.currencyCode})})})]});case"CUSTOM":{const a=e.method.redemptionContent,i=X(a);return n(ee,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 70%) minmax(0, 30%)",gridTemplateRows:"minmax(0, 1fr)",children:[n(V,{direction:"inline",alignItems:"center",gap:"small-100",children:[n(Lo,{type:"gift-card"}),n(x,{children:t.translate("payment.gift_card_wrapper.gift_card_label",{identifier:Z(i)})})]}),n(Q,{textAlign:"end",children:n(x,{type:"strong",children:e.cost&&t.formatCurrency(e.cost.amount,{form:"short",currency:e.cost.currencyCode})})})]})}default:return null}}function iu({open:e,onClose:t,includeStoreCredit:a=!0}){const{i18n:r,checkout:o}=rt(),l=Or(),u=Tr(l),{canApplyGiftCards:c,paymentLines:d}=$(),p=St(),h=a&&o.configuration.visibility.showStoreCreditRedemption.value&&u.value,m=c||d.length>0,v=g(m);s(()=>{const n=v.current&&!m;v.current=m,e&&n&&!h&&t()},[h,m,t,e]);let y="";h&&m?y=r.translate("payment.gift_card_store_credit.manage_label"):m?y=r.translate("payment.gift_card_wrapper.manage_label"):h&&(y=r.translate("payment.store_credit.manage_label"));const f=()=>{(p.value||!c&&h)&&t()},b=a?n(i,{children:[n(Dr,{}),n(Mr,{afterAppliedRedeemablesChange:f})]}):null;return n(No,{heading:y,open:e,onHide:t,children:n(V,{gap:"base",children:[o.configuration.visibility.showStoreCreditRedemption.value?b:null,n(Nr,{afterAppliedRedeemablesChange:f,autoSelect:!0,showHeading:!1})]})})}function ru(){const e=Or(),n=Tr(e),a=Ir(e),i=Qs(),r=_t();return t(()=>{const e=0===r.value?.amount&&!a.value;return n.value&&i.value&&!e})}function ou(){const{paymentLines:e}=$(),n=ru(),{showStoreCreditForSubscriptionRenewals:t}=eu();return Boolean(e.length)||n.value||t.value}function lu({afterAppliedRedeemablesChange:e,placement:i}){const{i18n:r,userEvents:o,shop:l,source:u,checkout:c}=rt(),{paymentLines:d,remove:p}=$(),{useStoreCreditForSubscriptionRenewals:m}=c.negotiator.parts,v=_t(),g=yt(),b=gt(),_=Or(),C=Ir(_),P=y(Br.Init),S=t(()=>P.value===Br.Loading),A=ou(),k=ru(),{storeCreditBalanceForSubscriptionRenewals:E,showStoreCreditForSubscriptionRenewals:w}=eu(),O=t(()=>g.value||b.value),I=t(()=>g.value?r.translate("payment.store_credit.buying_gift_card"):b.value?r.translate("payment.store_credit.no_fixed_selling_plans"):void 0),R=xr(_.value,P),T=Vr(_.value,P),L=y(N());function N({storeCreditSelected:e=C.value,subscriptionRenewalsSelected:n=m.value}={}){const t=d.map(({method:e})=>Pt(e));return e&&t.unshift(Fr),n&&t.splice(e?1:0,0,Hr),t}s(()=>{L.value=N()},[d]),h(()=>{const e=C.value,n=m.value;L.value=N({storeCreditSelected:e,subscriptionRenewalsSelected:n})});const D=f((e,n)=>{const t=n?"add":"remove",a=i?`${i}_`:"";o.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...At(u,c,l),action:`${a}manage_redeemables_${t}_${e}`}})},[c,o,i,l,u]),M=f(async n=>{const t=L.value,a=t.length>n.length,{shorter:i,longer:r}=a?{shorter:n,longer:t}:{shorter:t,longer:n};L.value=n;const o=r.find(e=>!i.includes(e)),l=o===Hr;let s=!1;if(o===Fr)if(D("store_credit",!a),a){const e=m.value;m.value=!1,({landed:s}=await T()),s||(m.value=e)}else({landed:s}=await R());else if(l){const e=!a;D("store_credit_subscription_renewals",e),m.value=e}else{D("gift_card",!a);const e=d.find(e=>Pt(e.method)===o);if(e?.method){const n=await p(e.method);s="success"===n?.status}}s&&e?.()},[e,R,L,d,D,p,T,m]),B=t(()=>S.value||O.value),F=t(()=>B.value||0===v.value?.amount&&!C.value),H=B;if(!A)return null;const z=_.value?.balance,j=E.value,U=I.value;return n(V,{gap:"base",borderRadius:"base base none none",padding:"expanded"===i?"small-100 none none none":void 0,children:n(xo,{name:"redeemables_list",values:L.value,onChange:M,variant:"block",multiple:!0,children:[k.value&&z&&n(Vo,{value:Fr,disabled:F.value,secondaryContent:n(x,{type:"strong",children:r.formatCurrency(z.amount,{currency:z.currencyCode})}),details:U&&n(x,{children:U}),children:n(V,{direction:"inline",gap:"base",alignItems:"center",children:[n(x,{children:r.translate("payment.store_credit.apply_label")}),n(a,{when:S,children:n(ne,{})})]})}),w.value&&j&&n(Vo,{value:Hr,disabled:H.value,details:n(V,{gap:"small-500",children:[n(x,{children:r.translate("payment.store_credit.remaining_for_subscription_charges_description",{amount:r.formatCurrency(j.amount,{currency:j.currencyCode})})}),U&&n(x,{children:U})]}),children:n(x,{children:r.translate("payment.store_credit.use_remaining_for_subscription_charges_label")})}),d.map(e=>n(su,{paymentLine:e},Pt(e.method)))]})})}function su({paymentLine:e}){const{i18n:t}=rt(),a=e.method.redemptionContent,i=X(a);return n(Vo,{value:Pt(e.method),secondaryContent:n(Q,{textAlign:"end",children:n(x,{type:"strong",children:e.cost&&t.formatCurrency(e.cost.amount,{form:"short",currency:e.cost.currencyCode})})}),children:n(V,{children:[n(Q,{children:t.translate("payment.gift_card_checkbox_label")}),n(V,{direction:"inline",gap:"small-400",children:[n(J,{type:"gift-card"}),n(x,{color:"subdued",children:[" ",Z(i)]})]})]})})}function uu(){const{checkout:e}=rt(),t=y(!1),a=cu();switch(e.identity.current.value){case"shopPay":return n(lu,{placement:"summary"});case"customerAccount":case"businessCustomer":return n(V,{gap:"base",children:[a?n(i,{children:[n(Dr,{}),n(Mr,{})]}):null,n(tu,{includeStoreCredit:!1,openRedeemablesModal:()=>t.value=!0}),n(iu,{includeStoreCredit:!1,open:t.value,onClose:()=>t.value=!1})]});default:return null}}function cu(){const{checkout:e}=rt(),n=Or(),t=Tr(n),a=Ir(n),i=_t(),r=a.value,o=0===i.value?.amount&&!r;return t.value&&(e.configuration.visibility.showStoreCreditRedemption.value||r)&&!o}const du={ONE_PERCENT_CASHBACK:"1",THREE_PERCENT_CASHBACK:"3"};function pu({children:e}){return n(V,{direction:"inline",gap:"small-200",alignItems:"center",children:e})}function hu({handleNoValidCards:e}){const[t,a]=b(!1),{i18n:r,observability:o,shopPay:l,checkout:{negotiator:u}}=rt(),c=u.current.fields.paymentMethods.value,d=l.session.paymentMethodOption.value,p=zr(),h=p.selectedCreditCard.value,m=p.selectedPaymentMethod.value,v=p.selectedPaymentMethodItem.value,y=p.paymentMethods.value,g=l.user.hasFlow.value,f=jr(h),_=y.find(e=>!e.isDisabled);if(s(()=>
2{if(t){const e=setTimeout(()=>{a(!1)},750);return()=>clearTimeout(e)}},[t]),s(()=>{_?"SHOPIFY_INSTALLMENTS"===d?.name&&!0===v?.isDisabled&&(p.selectPaymentMethod(_.method),a(!0)):g&&e()},[v?.isDisabled,d?.name,e,_,p,g]),!m)return null;if(t)return n(pu,{children:n(D,{})});if("CUSTOM_ONSITE"===m.paymentMethod){const e=c?.find(e=>m.paymentBrands&&kt(e,m.paymentBrands));if(!e)return o.log("shop_pay_payment_line_custom_onsite_payment_selected","customOnsitePaymentMethod was selected but not in negotiatedPaymentMethods",{selectedPaymentMethod:JSON.stringify(m),negotiatedPaymentMethods:JSON.stringify(c)}),null;const t=te(e)&&Boolean(e.incentiveType),a=1===e.paymentBrands?.length?e.paymentBrands[0]:"generic";if(t){const t=du[e.incentiveType],i={title:r.translate("payment.usdc_cashback_title",{incentive_percentage:t}),additionalInfo:r.translate("payment.usdc_cashback_additional_info",{terms_url:Go,incentive_percentage:t}),terms:r.translate("payment.usdc_cashback_terms"),termsUrl:Go};return n(pu,{children:[n(x,{children:e.name}),n(Yo,{notice:i,selected:!1}),n(Lo,{type:a})]})}return n(mo,{paymentLine:{method:e},showAmount:!1})}if(Ur(m))return n(pu,{children:[n(x,{children:n(x,{children:r.translate("payment.ideal_label")})}),n(Lo,{type:"ideal"})]});if(Gr(m))return n(pu,{children:[n(x,{children:r.translate("brand.apple_pay")}),n(Lo,{type:"apple_pay"})]});if(Yr(m))return n(pu,{children:[n(x,{children:r.translate("brand.paypal")}),n(Lo,{type:"paypal"})]});if(Wr(m)||qr(m)){const e=r.translate("payment_gateway.shop_pay.name"),t=qr(m)?r.translate("payment_gateway.shop_pay.installments_label"):void 0;return n(pu,{children:[n(x,{children:e}),n(Lo,{type:"shop_pay"}),t?n(x,{color:"subdued",children:t}):null]})}if(Kr(m))return n(pu,{children:n(x,{children:m.name})});if($r(m))return null;if(Jr(m))return null;const C=m.paymentAttributes;return n(Xr,{name:f,digits:n(i,{children:[n(vo,{}),n(x,{size:"base",tone:"neutral",children:C.lastDigits})]}),icon:n(Lo,{type:C.brand})})}function mu(){const{checkout:{negotiator:e}}=rt(),t=e.parts.paymentLines.value,a=u(()=>t.find(e=>"giftCard"!==e.method.type&&"redeemable"!==e.method.type),[t]);return n(V,{gap:"small-400",children:[a&&n(mo,{paymentLine:a,showCardBrandLabel:!0}),n(Zr,{})]})}function vu({openSignal:e}){const{checkout:{identity:t}}=rt();return"shopPay"===t.current.value?n(hu,{handleNoValidCards:()=>e.value=!0}):n(mu,{})}function yu(){const{i18n:e}=rt(),t=Et("STORE_CREDIT"),{paymentLines:a}=$(),i=[...t.value,...a];return i.length?n(V,{gap:"small-200",children:i.map(t=>{const a=t.cost?n(x,{children:[" - ",e.formatCurrency(t.cost.amount,{currency:t.cost.currencyCode,form:"short"})]}):null;switch(t.method.redemptionSource){case"STORE_CREDIT":return n(V,{direction:"inline",alignItems:"center",gap:"base",children:[n(Lo,{type:"store-credit"}),n(Q,{children:[e.translate("payment.store_credit.label"),a]})]},Pt(t.method));case"CUSTOM":{const i=t.method.redemptionContent,r=X(i);return n(V,{direction:"inline",alignItems:"center",gap:"base",children:[n(Lo,{type:"gift-card"}),n(Q,{children:[e.translate("payment.gift_card_wrapper.gift_card_label",{identifier:Z(r)}),a]})]},Pt(t.method))}default:return null}})}):null}function gu({paymentExemptionReason:e}){const{checkout:{identity:t}}=rt();return"shopPay"!==t.current.value||"storeCredit"!==e&&"redeemables"!==e?n(yu,{}):n(Er,{vaulted:!0,reason:e})}function fu({hasPersistentRedeemablesManagement:e,openSignal:t}){const{checkout:a}=rt(),i=Ho(),r=St();return"freeOrder"===i.value?n(Er,{vaulted:!0,reason:"freeOrder"}):"giftCard"===i.value?n(Er,{vaulted:!0,reason:"giftCard"}):function({identity:e,paymentExemptionReason:n,paymentFullyCoveredByRedeemablesAndGiftCards:t}){return!!t&&("shopPay"!==e.current.value||("storeCredit"===n||"redeemables"===n))}({identity:a.identity,paymentExemptionReason:i.value,paymentFullyCoveredByRedeemablesAndGiftCards:r.value})?n(gu,{paymentExemptionReason:i.value}):n(V,{gap:"small-200",children:[!e&&n(yu,{}),n(vu,{openSignal:t})]})}function bu(){const{checkout:e}=rt(),n=e.latestReceipt.value,{value:t}=e.negotiator.current.fields.paymentMethods,{inMemoryGooglePayParts:{sdkStatus:a,paymentSheetError:i},persistedGooglePaySignal:r,receiptErrorSignal:o}=lt(),l=ae({shouldResetCustomerInfo:!1}),u=ie("failed"===n?.status&&"payment"===n.failure.type?n.failure:void 0),c=wt(l);return h(()=>{"error"===a.value.status&&m(()=>{c.current(),i.value={type:Ot}}
2)}),s(()=>{It(t,"GOOGLE_PAY")||i.value?.type===Ot||(i.value={type:Ot},c.current(),r.value={...r.value,receiptIdForPaymentFailure:n?.id}),n?.id!==r.value?.receiptIdForPaymentFailure&&"failed"===n?.status&&"payment"===n?.failure.type&&(r.value={...r.value,receiptIdForPaymentFailure:n?.id},o.value=u)},[c,n,o,t,r,i,u]),s(()=>()=>{o.value=void 0},[o]),null}function _u(){const{checkout:e}=rt(),n=e.latestReceipt.value,{value:t}=e.negotiator.current.fields.paymentMethods,{inMemoryPayPalParts:{paymentSheetError:a},persistedPayPalSignal:i}=lt(),r=re(),o=wt(r),l=u(()=>It(t,"PAYPAL_EXPRESS"),[t]);return s(()=>{l||(o.current(),a.value={type:Ot})},[l,a,o]),s(()=>{if(!n)return;const e=n.id===i.value?.receiptIdForClearedToken,t="failed"===n.status&&"payment"===n.failure.type;!e&&t&&(i.value={...i.value,receiptIdForClearedToken:n?.id},o.current())},[n,l,a,i,o]),null}function Cu(){const{checkout:{identity:e}}=rt();switch(e.current.value){case"payPal":return n(_u,{});case"googlePay":return n(bu,{});default:return null}}function Pu(){const e=rt(),{checkout:a,i18n:r,shop:o,shopPay:l,webMcp:u}=e,c="shopPay"===a.identity.current.value,d=Ro(),p="payment",{hasAnyPaymentError:y,clearReceiptError:g}=function({clearReceiptErrorOnPaymentLineChange:e=!0}={}){const{hasViolations:n}=G(new Set([...pt,"PAYMENTS_PHONE_NUMBER_DOES_NOT_MATCH_EXPECTED_PATTERN"])),{hasError:t,clearError:a}=w(ht),{checkout:{negotiator:i}}=rt(),{lastJourneyProgression:r}=i,o="failed"===r.value.type&&"completion"===r.value.negotiationStage,l=Ks(),s=Y();mt(()=>{e&&a()});const u=t&&!s,c=l.value;return{hasAnyPaymentError:n||u||o||c,errors:{hasExpiryViolation:n,hasReceiptPaymentFailure:t,hasReceiptPaymentError:u,hasSubmitCompletionFailure:o,hasGeneralPaymentError:c},clearReceiptError:a}}({clearReceiptErrorOnPaymentLineChange:!1}),{hasViolations:b}=G(Rt),{hasError:_}=oe(),{hasError:C}=le(),{paymentErrors:P}=se().value,S=P.length>0,{notSupportedError:A}=Eo(),k=Boolean(A),E=e.checkout.negotiator.current.fields.buyerIdentity,{value:O}=e.checkout.negotiator.current.fields.paymentFlexibilityPaymentTermsTemplate,I=ue(),R=null!=O&&!I.value,T=Tt().value,N=l.session.selectedPaymentMethod.value,D=Lt(N),{value:M}=e.checkout.negotiator.current.fields.paymentMethods,B=zr({enableAutoSelect:!1}),x=wt(B),{buyerHasActedSignal:F}=e.checkout.negotiator.context;s(()=>{if(u&&c)return u.unstable_provideSavedCardSelector(async e=>{const n=x.current;if(!(n instanceof Qr))return!1;const t=n.cardPaymentMethods.value.find(({method:n})=>n.id===e)?.method;return!!t&&(F.value=!0,"handled"===(await n.selectPaymentMethod(t,"programmatic",{rebuild:!0})).status)})},[x,c,u,F]);const H=B.paymentMethods.value.length>0,z=null!=N&&Nt(N)?N.paymentBrands??[]:[],j=z.length>0?M?.find(e=>kt(e,z)):void 0,q=ce("Checkout::PaymentMethod::Render",j?.uiExtension?[j.uiExtension]:[]),K=function({checkout:e,shop:n,source:t},{customerProfile:a}){return"shopPay"===e.identity.current.value||Bt({identitySource:e.identity.current.value,isOrderSession:xt(t),storeVaultEnabled:n.storeVaultEnabled,customerProfile:a})}(e,{customerProfile:E.value?.customerProfile}),X=K&&(c||H),Z=K&&0===B.cardPaymentMethods.value.length,{expandedSlot:Q,collapsedSlot:ee}=eo(B),ne=y||k||S||_||C,{directPaymentErrors:te,paymentLines:ae}=e.checkout.negotiator.parts,ie=ae.value.some(e=>e.method.type===Dt.CreditCard&&e.method.requiresCvvConfirmation),re=o.storeVaultGuestCvvVerificationEnabled&&ie,pe=Boolean(D)&&!D?.expired&&!D?.verified,he=Boolean(D?.expired)||ne||R||T||re||pe,me=U("purchase.checkout.payment-method-list.render-before"),ve=U("purchase.checkout.payment-method-list.render-after"),ye=Io([...me,...ve]),ge=Io(q),fe=vr([...me,...ve]),be=L(),_e=ut(),Ce=t(()=>!(!be.value||_e.value)||Boolean(E.value?.purchasingCompany)),Pe=Xs(p,he||b);qs(q.map(Mt),f(()=>{Pe.value=!0},[Pe])),s(()=>{(he||b)&&(Pe.value=!0)},[he,b,Pe]),no();const Se=f(()=>{Pe.value&&To(te)||(Pe.value=!Pe.value,Pe.value&&d(),function({userEvents:e,source:n,checkout:t,shop:a},i){"shopPay"===t.identity.current.value&&e.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...At(n,t,a),action:i?"credit_card_expand":"credit_card_collapse"}})}(e,Pe.value))},[d,te,Pe,e]),Ae=function(){const{checkout:e}=rt(),n=ou(),t=cu(),{paymentLines:a}=$();switch(e.identity.current.value){case"shopPay":return{hasPersistentRedeemablesManagement:!0,show:n};case"customerAccount":case"businessCustomer":{const e=t||a.length>0;return{hasPersistentRedeemablesManagement:e,show:e}}default:return{hasPersistentRedeemablesManagement:!1,show:!1}}}(),ke=n(fu,{openSignal:Pe,hasPersistentRedeemablesManagement:Ae.hasPersistentRedeemablesManagement}),Ee=ne?n(Su,{paymentErrors:P}):null,we=function({checkout:e}){switch(e.identity.current.value){case"payPal":case"googlePay":case"applePay":return!1;default:return!0}}(e),Oe=we&&Ce.value,Ie=!we,Re=!Ie&&Pe.value,Te=Ie?null:Ee||re,Le=!Ie&&(fe||Z||R),Ne=Re||Le||Boolean(Te);!function(e){const{checkout:{negotiator:n}}=rt(),{useStoreCreditForSubscriptionRenewals:t}=n.parts,{loading:a}=W(),i=v(e),r=v(a),o=yt(),l=gt(),{showStoreCreditForSubscriptionRenewals:s}=eu();h(()=>
2{const e=i.value,n=r.value,a=s.value,u=o.value,c=l.value;e&&!n&&(!a||u||c)&&m(()=>{t.value&&(t.value=!1)})})}(c),h(()=>{To(te)&&(Pe.value=!0)}),Zs({autoOpen:!1,isMissing:re||pe,open:Pe});const De=Oe?n(Hs,{usesSharedVaultedSelector:X,hasPersistentRedeemablesManagement:Ae.hasPersistentRedeemablesManagement,msiExpandedSlot:Q,onSelectedPaymentMethodChange:g}):null;h(()=>{(ye.value||ge.value)&&(Pe.value=!0)});const Me=Ae.show?n(uu,{}):null,Be=Ne?void 0:ee,xe=Me?n(V,{gap:"base",children:[Me,Be]}):Be;return n(i,{children:n(de,{target:"cart.paymentLines[0]",children:[n(ho,{open:Re,disabled:Le,id:p,label:r.translate("payment.title"),icon:n(J,{id:"payment-creditCardIcon",type:"credit-card",size:"fill"}),primaryContent:ke,onToggle:Oe?Se:void 0,error:Te,renderChildrenWhenCollapsed:Oe,secondaryPersistentContent:xe,children:De}),n(Cu,{})]})})}function Su({paymentErrors:e}){return n(B,{children:[e.length>0?n(pe,{errors:e,errorType:F.PaymentError}):n(i,{children:[n(wo,{}),n(nu,{})]}),n(he,{blockSize:"base"})]})}function Au({onPaymentDelegation:e}){const{embed:t,i18n:a}=rt(),{rollup:{action:{tone:i}={}}={}}=me();return"amazon"===t?.embedder?n(R,{textDecoration:"none",onClick:e,children:n(x,{tone:"accent",children:a.translate("embed.payment.payment_options")})}):n(H,{tone:"custom"===i?"custom":void 0,onClick:e,variant:"plain",textDecoration:"none",children:a.translate("payment.choose_new_payment_method")})}const ku={visa:"Visa",mastercard:"Mastercard",americanexpress:"American Express",amex:"American Express",discover:"Discover",dinersclub:"Diners Club",maestro:"Maestro",jcb:"JCB"};function Eu(e){return e.toLowerCase().replace(/[-_]/g,"")}function wu(e,n){return e&&"unknown"!==Eu(e)?ku[Eu(e)]??n.translate("payment_gateway.credit_card_label"):n.translate("payment_gateway.credit_card_label")}function Ou(){const{i18n:e,observability:t,embed:a,shop:i,shopPay:r,checkout:o}=rt(),l=L(),u=Vt(),{delegatedPaymentInstrument:c}=o.negotiator.context,{message:d,tone:p,inventoryRecoveryReceiptId:h}=ko(),{rollup:{blockPadding:m}={}}=me(),{hasViolations:v,clearViolations:y}=q(Rt);s(()=>{let e=Ko(c.peek());return c.subscribe(n=>{const t=Ko(n);t!==e&&(e=t,y())})},[c,y]);const b=Boolean(a)&&o.configuration.isPaymentInstrumentsDelegationEnabled&&Boolean(c.value),_=b&&v,C=Ko(c.value),P=g(void 0);_&&(P.current=C);const S=$o(c.value),{billingAddress:A}=o.negotiator.parts,k=Boolean(S&&!Ft(A.value,Jo(S))),w=b&&(_||P.current===C&&k),O=a?.embedder,I=Ht({embedder:O,shop:i}),R=zt(r.app.config),T=!a?.isFlagshipPartner||jt(a.embedder)||R||I?e.translate("payment.title"):e.translate("payment.payment_method"),N=a?.client?.paymentErrors.value.includes(Ut.PaymentEmpty)??!1,D=g(!1),M=g(null),B=f(e=>{M.current=e,e&&D.current&&(e.focus(),D.current=!1)},[]),F=f(async()=>{const e=a?.client;if(!e)return;D.current=!1;const n=null!==M.current;try{const n=await e.paymentMethodChangeStart();if(!n)return;if(n.ucpPaymentInstrument)t.log("delegated_payment_selected","Payment instrument selected",{externalReferenceId:Ko(c.value)});else if(n.cart)try{await e.applyCart(n.cart),t.log("delegated_payment_selected","Payment instrument selected",{externalReferenceId:Ko(c.value)})}catch(i){t.log("delegated_payment_cart_update_error","Failed to apply cart update after payment selection",{error:String(i)})}}finally{!e.paymentErrors.value.length&&n&&(M.current?M.current.focus():D.current=!0)}},[a,t,c]),H=a?.client?.paymentErrors.value.includes(Ut.PaymentDelegationError),z=H?e.translate("payment_errors.payment_credential_delegation_error"):void 0,j=z||d,U=z?"critical":p,G=Gt(m),Y=l.value&&j?n(V,{direction:"block",gap:G,paddingBlockEnd:G,children:[n(Oo,{message:j,tone:U,inventoryRecoveryReceiptId:z?void 0:h}),!w&&a?.isFlagshipPartner&&n(Au,{onPaymentDelegation:F})]}):void 0;if(!l.value){const e=n(Er,{vaulted:!0,reason:"freeOrder"}),t="amazon"===O?{compact:e}:{primary:e};return n(ho,{id:"payment",label:T,primaryContent:t.primary,compactContent:t.compact,icon:n(J,{id:"payment-creditCardIcon",type:"credit-card",size:"fill"})})}const W=c.value,K=Xo(W),$=K?.brand,X=K?.lastDigits,Z=!(u.value&&W&&$&&X),Q=Z?e.translate("payment.add_payment_method"):void 0,ee=n(x,{tone:"critical",children:e.translate("payment.add_payment_method")}),ne=X?n(x,{accessibilityVisibility:"exclusive",children:`${wu($,e)} ${e.translate("payment.ends_with_label",{last_digits:X})}`}):null,te=n(x,{accessibilityVisibility:"hidden",children:n("bdi",{children:[wu($,e),n(vo,{}),X]})}),ae=(()=>
2{if(!Z)return n(V,{direction:"inline",gap:"small-400",alignItems:"center",children:[ne,te,n(Lo,{type:$,size:"small",accessibilityVisibility:"hidden"})]})})(),ie=Z?n(x,{tone:N?"critical":void 0,children:e.translate("payment.add_payment_method")}):n(V,{direction:"inline",gap:"small-400",alignItems:"center",children:[n("span",{"aria-hidden":"true",className:"EnNLk",children:n(Lo,{type:$})}),ne,te]}),re=Z?n(x,{tone:"accent",decoration:"underline",children:e.translate("payment.add_new_payment_method")}):n(V,{direction:"inline",gap:"small-400",alignItems:"center",children:[n(x,{children:e.translate("payment.pay_with")})," ",ne,n(x,{type:"strong",accessibilityVisibility:"hidden",children:[wu($,e),n(vo,{}),X]}),n(Lo,{type:$,accessibilityVisibility:"hidden"})]}),oe="amazon"===O?{compact:re}:"google"!==O||I?{primary:ae,secondary:void 0===ae?ee:void 0}:{primary:ie};return n(ho,{buttonRef:B,id:"payment",label:T,open:w,disabled:w,onToggle:Y?void 0:F,primaryContent:oe.primary,secondaryContent:oe.secondary,compactContent:oe.compact,buttonAccessibilityLabel:Q,icon:n(J,{id:"payment-creditCardIcon",type:"credit-card",size:"fill"}),error:Y,children:w?n(V,{direction:"block",gap:"base",children:[n(E,{level:3,children:e.translate("billing.billing_address_title")}),n(Wo,{}),a?.isFlagshipPartner?n(Au,{onPaymentDelegation:F}):null]}):null})}const Iu=new Set(["amazonPay","buyWithPrime"]);function Ru(){const{checkout:{identity:e}}=rt();return Iu.has(e.current.value)?n(Is,{}):"sdkCartHints"===e.current.value?n(Ou,{}):n(Pu,{})}function Tu(e){if("filled"!==e?.status)return null;const{discountOffer:n}=e;if(!n.offerAmount||!n.campaignHandle)return null;const t=n.minimumOrderValue?{amount:n.minimumOrderValue,satisfied:Boolean(n.minimumOrderValueSatisfied),remainingAmount:n.minimumOrderValueRemainder??null}:null;return{adType:"SHOP_CASH_OFFER",campaignHandle:n.campaignHandle,offerAmount:n.offerAmount,redeemableAmount:!t||t.satisfied?n.offerAmount:null,minimumOrderValue:t}}function Lu(){const{checkout:e}=rt(),n=g(null);return t(()=>{const t=e.proposal.negotiated.fields.shopDiscountOffer.value;return"unavailable"===t?.status?(n.current=null,null):("filled"!==t?.status||(n.current=Tu(t)),n.current)})}const Nu=({requiresAvailableBalance:e=!0}={})=>{const n=function({requiresAvailableBalance:e=!0}={}){const n=cl({requiresAvailableBalance:e}),{checkout:{negotiator:a}}=rt(),{paymentMethods:i,shopCashBalance:r}=a.current.fields;return t(()=>{const{nonEligibleReason:t}=n.value,a=Boolean(i.value?.some(e=>"redeemable"===e.type&&"SHOP_CASH"===e.redemptionSource)),o=r.value,l=null==o||"unavailable"===o.status;let s;return s=e&&l?Zo.ShopCashNotAvailable:a?t:Zo.ShopCashMerchantNotSupported,{nonEligibleReason:s}})}({requiresAvailableBalance:e});return t(()=>{const{nonEligibleReason:e}=n.value;return e?{eligible:!1,reason:e}:{eligible:!0}})};function Du(){const{shop:e}=rt(),n=e.hasFlagEnabled(Yt);return Nu({requiresAvailableBalance:!n})}const Mu=()=>{const e=rt().shopPay.app.config,n=yl();return Wt(e,n)};function Bu(e,n,t){s(()=>{if(e&&t)return e.recordPresentation({component:n,displayLabel:t})},[n,t,e])}const xu=()=>{const{embed:e,i18n:t,shop:a,shopPay:i}=rt(),r=jt(e?.embedder),o=i.app.config.surface,l=a.hasFlagEnabled(qt),s=ve();return(r?"shop_app"===o:l||"shop_app"===o)?n(R,{tone:"monochrome",onClick:()=>{r?function(e){if("undefined"==typeof window)return;const n=function(e){if(e)try{return new URL(e).origin}catch{return}}(e);n&&window.parent.postMessage({jsonrpc:"2.0",method:"ec.keep_shopping"},n)}(e?.client?.embedderOrigin):s.notify({keep_shopping:!0})},children:n(x,{size:"small",children:t.translate("shop_cash.minimum_order_value_banner_keep_shopping")})}):null},Vu=({adType:e,offerAmount:a,minimumOrderValueAmount:i,remainingAmount:r,incentivePresentation:o})=>{const{i18n:l}=rt(),s=Mu(),{hasMerchandiseDiscounts:u}=(()=>{const{checkout:{negotiator:e}}=rt(),n=e.current.fields.discountLines;return t(()=>{const e=n.value;return{hasMerchandiseDiscounts:!!e&&e.lines.some(e=>!!_l(e)&&e.allocations.some(e=>"MERCHANDISELINE"===e.target.type)),orderDiscountAmount:e?e.lines.filter(e=>_l(e)&&"CART"===e.discount.presentationLevel&&e.allocations.some(e=>"MERCHANDISELINE"===e.target.type)).reduce((e,n)=>{const t=n.amount?.amount;return t?e+t:e},0):0}})})().value,c=l.formatCurrency(a.amount,{currency:a.currencyCode,form:"short"}),d=l.formatCurrency(i.amount,{currency:i.currencyCode,form:"short"}),p=r?l.formatCurrency(r.amount,{currency:r.currencyCode,form:"short"}):void 0,h=Fu({adType:e,formatMinimumOrderAmount:d,formatRemainingAmou
2nt:p,formatOfferAmount:c,hasMerchandiseDiscounts:u});return Bu(o,"minimumOrderValueBanner","FLAT_AMOUNT_CASHBACK_OFFER"===e?h:void 0),n(B,{padding:"small-200 small-100",borderRadius:"base",accessibilityRole:"status",className:s?"dHa7y":"O9AXs",children:[n(Q,{type:"small",children:h}),n(xu,{})]})},Fu=({adType:e,formatMinimumOrderAmount:n,formatRemainingAmount:t,formatOfferAmount:a,hasMerchandiseDiscounts:i})=>{const{i18n:r}=rt(),o=i||!t;return"SHOP_CASH_OFFER"===e?o?r.translate("shop_cash.minimum_order_value_banner_discounts_offer_amount",{formatBoostedAmount:a,formatMinimumOrderAmount:n}):r.translate("shop_cash.minimum_order_value_banner",{formatRemainingAmount:t,formatBoostedAmount:a}):"FLAT_AMOUNT_CASHBACK_OFFER"===e?o?r.translate("shop_cash.minimum_order_value_banner_discounts_flat_cashback",{formatOfferAmount:a,formatMinimumOrderAmount:n}):r.translate("shop_cash.minimum_order_value_banner_flat_cashback",{formatRemainingAmount:t,formatOfferAmount:a}):""};function Hu({eligibility:e,offerEligibility:t,discountOffer:a}){const i=l(zo),r=i?.cashback?.incentive;if(!e.eligible&&!t.eligible)return[];const o=[];var s;return t.eligible&&a?.minimumOrderValue&&!a.minimumOrderValue.satisfied&&o.push(n(Vu,{adType:a.adType,offerAmount:a.offerAmount,minimumOrderValueAmount:a.minimumOrderValue.amount,remainingAmount:a.minimumOrderValue.remainingAmount},"mov-discount")),e.eligible&&(s=r,Boolean("ShopCashCheckoutFlatAmountCashbackIncentive"===s?.__typename&&s.minimumOrderValue&&!s.minimumOrderValueSatisfied))&&o.push(n(Vu,{adType:"FLAT_AMOUNT_CASHBACK_OFFER",offerAmount:r.cashbackAmount,minimumOrderValueAmount:r.minimumOrderValue,remainingAmount:r.minimumOrderValueRemainder,incentivePresentation:i?.incentivePresentation},"mov-cashback")),o}function zu(){const{checkout:e,embed:t}=rt(),{main:{section:a}}=ye(),i=Nu().value,r=Du().value,o=Lu(),l=ge().value.payment,s=Hu({eligibility:i,offerEligibility:r,discountOffer:o.value});return jt(t?.embedder)&&!e.configuration.visibility.showCashRedemption.value&&s.length>0?l?n(V,{padding:ju(a?.padding),gap:"small-200",children:s}):n(ro,{hideDivider:l,condition:!l,padding:"none large-200",children:n(V,{padding:"small-200 none",gap:"small-200",children:s})}):null}function ju(e){const[n,t]=(a=e,Array.isArray(a)?2===a.length?[a[1],a[1]]:[a[1],a[3]]:[a,a]);var a;return`small-200 ${Gt(n)??"none"} small-200 ${Gt(t)??"none"}`}function Uu({checked:e,onChange:t,disabled:a}){return n(Cl,{checked:e,onChange:t,icon:"none",className:"mu1NS",accessibilityLabel:"Shop Cash",disabled:a})}function Gu(e,n){return null==e&&null==n||null!=e&&null!=n&&e.amount===n.amount&&e.currencyCode===n.currencyCode}function Yu({enabled:e=!0}={}){const{shopPay:n,checkout:{negotiator:t}}=rt(),a=l(zo),i=t.current.fields.buyerIdentity.value?.shopUser?.publicId;return e&&Boolean(i)&&!n.session.isInternalProgressing.value&&!1===a?.redemption.applying?.value}const Wu=e=>"redeemable"===e.method.type&&"SHOP_CASH"===e.method.redemptionSource,qu=e=>{if(!e)return Qo;if(!e.method.redemptionContent?.details)return Qo;const n={...Qo};for(const t of e.method.redemptionContent.details){const e=el.find(e=>e===t.redemptionType);if(void 0===e)continue;const a={id:t.redemptionId??e,promotionId:"SHOP_PROMOTION"===e?t.redemptionId:void 0,type:e,destinationAmount:pl(t.destinationAmount),sourceAmount:dl(t.sourceAmount)};"SHOP_PROMOTION"===e?n.SHOP_PROMOTION=[...n.SHOP_PROMOTION,a]:n[e]=a}return n},Ku=(e,n)=>{const t=e[n];return Array.isArray(t)?t.length>0:null!=t},$u=()=>{const{checkout:{negotiator:e}}=rt(),{paymentLines:n}=e.current.fields;return t(()=>qu(n.value?.lines.find(Wu)))},Ju=()=>{const{checkout:{negotiator:e}}=rt(),{paymentLines:n}=e.parts;return t(()=>qu(n.value?.find(Wu)))},Xu=e=>({type:e.type,amount:e.destinationAmount,promotionId:e.promotionId}),Zu=({enabled:e=!0}={})=>{const{shopPay:n,checkout:{negotiator:t}}=rt(),a=Ju(),i=l(zo),r=i?.redemption.applying,{negotiate:o}=fe(),s=t.parts.paymentLines,u=hl(),c=jo(),d=t.current.fields.buyerIdentity.value?.shopUser?.publicId;return f(async(t,{onNegotiateAccepted:i}={})=>{const{SHOP_CASH_BALANCE:l,SHOP_DISCOUNT_OFFER:p,SHOP_PROMOTION:h}=a.peek(),{SHOP_CASH_BALANCE:m=(l?Xu(l):null),SHOP_DISCOUNT_OFFER:v=(p?Xu(p):null),SHOP_PROMOTION:y=h.map(Xu)}=t,g=n.session.isInternalProgressing.value;if(!e)return;if(!r)return;if(g)return;if(!d)return;if(r.peek())return;_(()=>{r.value=!0});const f=s.peek().filter(e=>"redeemable"!==e.method.type||"SHOP_CASH"!==e.method.redemptionSource),b=Object.values(t).flatMap(e=>Array.isArray(e)?e:[e]).find(e=>null!=e)?.amount.currencyCode,C=[m,v,...y??[]].filter(e=>null!==e&&(!b||e.amount.currencyCode===b)),{selectedBillingAddress:P,selectedShippingAddress:S,isUsingApplePayShippingFallback:A}=u.value,k=!P.address1||"APPLE_PAY"===c.value,E=function(e,n,t){if(!t)return null;if(0===e.length)return null;const a=e.reduce((e,n)=>e+n.amount.amount,0),i=e[0].amount.currencyCode;return{cost:{amount:a,currencyCode:i},method:{type:"redeemable",redemptionSource:"SHOP_CASH",redemptionContent:{redemptionId:t,billingAddress:{streetAddress:n?{address1:n.address1??"",address2:n.address2,city:n.city??"",company:n.company,firstName:n.firstName,lastName:n.lastName??"",phone:n.phone,postalCode:n.postalCode,zoneCode:n.zoneCode,countryCode:n.countryCode??""}:null},destinationAmount:{amount:a.toString(),currencyCode:i},sourceAmount:{amount:a.toString(),currencyCode:i},redemptionPaymentOptionKind:"decoupled",details:e.map(e=>({sourceAmount:e.amount?{amount:e.amount.amount.toString(),currencyCode:e.amount.currencyCode}:null,destinationAmount:{amount:e.amount.amount.toString(),currencyCode:e.amount.currencyCode},redemptionId:e.promotionId??e.type,redemptionType:e.type}))}}}}(C,!A&&S&&k?S:P,d);E&&f.push(E),s.value=f;try{i?.(),await o({silenceViolations:["non-shop-cash",...Kt(["paymentLines","billingAddress"])]})}finally{_(()=>{r.value=!1})}},[r,e,o,c,s,a,d,u,n.session.isInternalProgressing])},Qu=()=>{const{checkout:{negotiator:e}}=rt(),n=e.current.fields.subtotalAfterMerchandiseDiscounts,a=bt(),i=ec(),r=nc();return t(()=>{const e=a.value,t=e?{amount:nl(e.amount-i.value-r.value,C(e.currencyCode)),currencyCode:e.currencyCode}:void 0;return{orderTotal:e,orderSubtotal:n.value,redeemableTotal:t}})},ec=()=>{const{checkout:{negotiator:e}}=rt(),{paymentLines:n}=e.current.fields;return t(()=>(n.value?.lines??[]).reduce((e,n)=>n.cost&&((e=>"giftCard"===e.method.type)(n)||(e=>"redeemable"===e.method.type)(n)&&!(e=>"SHOP_CASH"===e.method.redemptionSource)(n))?e+n.cost.amount:e,0))},nc=()=>{const e=$u();return t(()=>Object.values(e.value).flatMap(e=>Array.isArray(e)?e:[e]).reduce((e,n)=>n?"SHOP_CASH_BALANCE"===n.type?e:e+n.destinationAmount.amount:e,0))},tc=tl,ac=e=>{const{i18n:n,shopPay:t,webMcp:a,checkout:i}=rt(),r=Yu(),o=Zu(),l=Ju(),u=$u(),{applying:c}=Uo().redemption,{buyerIdentity:d,shopCashBalance:p}=i.negotiator.current.fields,h=Qu(),m=ic(d.value),v=ic(p.value),y=(g=p.value,"filled"===g?.status&&g.eligible&&(g.redeemableBalance?.amount??0)>0?void 0:ic(h.value));var g;const b=Boolean(l.value[tc]),_=u.value[tc]?.destinationAmount||null,C=f(async n=>{if(c.value)return;const t=n?e:null;Gu(_,t)&&Gu(l.value[tc]?.destinationAmount,t)||await o({[tc]:t?{type:"SHOP_CASH_BALANCE",amount:t,promotionId:null}:null})},[_,e,o,c,l]);s(()=>
2{if(a&&e.amount>0)return a.unstable_registerDeclaredField({key:"shop_cash",read(){const e=i.latestReceipt.value?.status;if(!e||!["processed","processing","processing_remote_checkouts","polling_for_order","action_required"].includes(e))return{key:"shop_cash",purpose:"dev.shopify.shopping.declared_fields.generic",title:"Shop Cash",description:"Apply the available Shop Cash balance. Resend true to retain it in a checkout update; omission or null removes it.",value_schema:{type:"boolean"},required:!1,value:Boolean(l.value[tc])}},prepare(n){if(null!==n&&"boolean"!=typeof n)return{requirement:"must be a boolean or null"};const a=!0===n;return{phase:"negotiate",changed:!0,apply:async()=>!(!r||c.value||t.session.isInternalProgressing.value||ic(d.value)!==m||ic(p.value)!==v||void 0!==y&&ic(h.value)!==y)&&(await C(a),Gu(u.value[tc]?.destinationAmount??null,a?e:null))}}})},[a,i,t.session,e,l,u,r,c,d,m,p,v,h,y,C]),s(()=>{_&&(Gu(_,e)||C(!0))},[e]);const P=n.formatCurrency(e.amount,{currency:e.currencyCode,form:"short"});return{title:n.translate("order_summary.shop_cash_title"),amount:b?n.translate("shop_cash.redemption.balance.applied",{formattedAmount:P}):n.translate("shop_cash.redemption.balance.available",{formattedAmount:P}),checked:b,handleChange:C,disabled:c.value}};function ic(e){return JSON.stringify(e)??""}const rc={rollup:{blockAlignment:"center"}},oc=({redeemableBalance:e})=>{const{title:t,amount:a,checked:i,handleChange:r,disabled:o}=ac(e);return n("div",{className:"yY3sV",children:n(uo,{theme:rc,children:n(ho,{label:t,primaryContent:a,primaryAction:n(Uu,{checked:i,onChange:r,disabled:o})})})})},lc=()=>{const{i18n:e}=rt(),t=Mu(),a=e.translate("payment_errors.vaulted_card_required_error");return n(B,{padding:"small-200 small-100",borderRadius:"base",accessibilityRole:"status",className:P("Q9An4",t&&"K92xU"),children:n(Q,{type:"small",children:a})})},sc={availableBalance:null,redeemableBalance:null};function uc(){const e=g([]),n=Qu(),{checkout:a}=rt(),i=a.proposal.negotiated.fields.shopPromotion;return t(()=>{const{orderTotal:t}=n.value,a=i.value;return"filled"===a?.status?e.current=a.promotions:"unavailable"===a?.status&&(e.current=[]),rl(e.current,t)})}const cc=()=>{const{recordRedemptionActionEvent:e}=ml(),{shop:n,shopPay:t}=rt(),a=n.hasFlagEnabled(qt),i=t.app.config.surface,r=Boolean("undefined"!=typeof window&&window.ReactNativeWebView),o=u(()=>({shopPayCheckoutSurface:i,isReactNativeWebview:r,isShopCashBalanceBetaEnabled:a,isOnePageCheckout:!0,nEnabledCreditCards:0}),[i,r,a]),l=f(n=>{e({...o,...n})},[o,e]),s=f((e,n)=>{l({action:"auto-apply",redemptionType:e,source:n})},[l]),c=f((e,n)=>{l({action:"manually-apply",redemptionType:e,source:n})},[l]);return{recordRedemptionAutomaticallyApplied:s,recordRedemptionAutomaticallyRemoved:f((e,n)=>{l({action:"auto-remove",redemptionType:e,source:n})},[l]),recordRedemptionManuallyApplied:c,recordRedemptionManuallyRemoved:f((e,n)=>{l({action:"manually-remove",redemptionType:e,source:n})},[l])}},dc=({enabled:e=!0,redemptionTypes:n=el}={})=>{const t=$u(),a=l(zo),i=a?.cashbackState.stale,{recordRedemptionAutomaticallyRemoved:r}=cc(),o=Zu({enabled:e}),{hasViolations:u}=q($t);s(()=>{if(!e||!i||!u)return;let a=!1;for(const e of n)Ku(t.value,e)&&(a=!0,r(e,"useRemoveRedemptionsOnViolation"));a&&(i.value=!0,o(Object.fromEntries(n.map(e=>[e,null]))))},[e,u])},pc=(e,{enabled:n=!0,retryOnReady:t=!1}={})=>{const a=Yu({enabled:n}),i=Zu({enabled:n}),{recordRedemptionAutomaticallyRemoved:r}=cc(),o=$u(),l=Ju(),u=e.filter(e=>!e.eligibility.eligible).flatMap(e=>e.redemptionTypes??el),c=u.join(","),d=!!t&&a,p=t?u.filter(e=>Ku(l.value,e)).join(","):"";s(()=>{if(!n||0===u.length)return;if(!t){const e=u.filter(e=>Ku(o.value,e));if(0===e.length)return;return void i(Object.fromEntries(u.map(e=>[e,null])),{onNegotiateAccepted:()=>{for(const n of e)r(n,"useRemoveRedemptionsWhenIneligible")}})}if(!a)return;const e=u.filter(e=>Ku(l.value,e));0!==e.length&&i(Object.fromEntries(u.map(e=>[e,null])),{onNegotiateAccepted:()=>{for(const n of e)r(n,"useRemoveRedemptionsWhenIneligible")}})},[n,d,c,p])};
2class hc extends Error{constructor(){super("Multiple Shop Cash payment lines present in negotiation response"),this.name="MultipleShopCashPaymentLinesAnomaly"}}const mc=({message:e})=>n(ee,{gridAutoFlow:"column",gridTemplateColumns:"minmax(auto, max-content) minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",borderRadius:"base",borderWidth:"base",padding:"small-400 small-200",gap:"small-200",accessibilityRole:"alert",alignItems:"center",alignContent:"center",children:[n(J,{type:"alert-circle",size:"small"}),n(Q,{color:"subdued",size:"small",children:e})]});function vc(){const{eligibility:e,offerEligibility:n,redeemableBalance:t,availableBalance:a,discountOffer:i,messages:r,showVaultedCardBanner:o,vaulted:l,isDigitalGoodsRedemptionAllowed:c}=yc();!function(e){const n=g(!1),t=g(performance.now()),{observability:a}=rt();s(()=>{if(!n.current&&e&&e.amount>0){const e=performance.now()-t.current;a.histogram({name:"new_performance_shop_cash_balance_display_time",value:Math.round(e)}),n.current=!0}},[e,a])}(a);const{shop:d}=rt(),p=d.hasFlagEnabled(Yt);return pc([{eligibility:e,redemptionTypes:[tl]},...p?[]:[{eligibility:n,redemptionTypes:[ol,ll]}]],{retryOnReady:p}),dc(),(e=>{const{client:n,shop:t,shopPay:a}=rt(),{recordRedemptionVisibilityEvent:i}=ml(),r=n.unstable_getSerialization("apiClientId"),o=t.hasFlagEnabled(qt),l=a.app.config.surface,c=Boolean("undefined"!=typeof window&&window.ReactNativeWebView),d=ge().value.payment,p=u(()=>({visibility:"visible",reason:e.reason??"none",position:d?"vaulted":"unvaulted",shopPayCheckoutSurface:l,isReactNativeWebview:c,isShopCashBalanceBetaEnabled:o,apiClientId:r,isOnePageCheckout:!0,nEnabledCreditCards:0}),[l,c,o,r,e.reason,d]);s(()=>{i(p)},[i,e.reason])})(e),(({eligibility:e,availableBalance:n,redeemableBalance:t,discountOffer:a})=>{const{recordRedemptionEligibilityEvent:i}=ml(),{orderTotal:r,orderSubtotal:o}=Qu().value,l=u(()=>a?a.minimumOrderValue&&!a.minimumOrderValue.satisfied?"BELOW_MOV":void 0:"NO_CAMPAIGN",[a]),c=u(()=>{if(r)return{balance:n?.amount??0,balanceCurrency:n?.currencyCode??"USD",totalPrice:r.amount,totalPriceCurrency:r.currencyCode,subtotalPrice:o?.amount??0,subtotalPriceCurrency:o?.currencyCode??"USD",maxTotalRedemptionAllowed:t?.amount??0,isBoostAvailable:Boolean(a),boostCampaignId:a?.campaignHandle,offerAmountBelowMov:a?.minimumOrderValue?.remainingAmount?.amount,offerMinimumOrderValueRequired:a?.minimumOrderValue?.amount.amount,maxPostOfferRemainingAmount:0,maxOfferRedemptionAmount:a?.offerAmount?.amount,boostIneligibilityReason:l,redemptionIneligibilityReason:e.reason}},[n,r,o,a,t,l,e.reason]);s(()=>{c&&i(c)},[i,e.reason,n,t,a])})({eligibility:e,availableBalance:a,redeemableBalance:t,discountOffer:i.value}),(()=>{const{observability:e,source:n,checkout:{negotiator:t}}=rt(),a=t.current.fields.paymentLines.value,i=u(()=>a?.lines.filter(e=>"redeemable"===e.method.type&&"SHOP_CASH"===e.method.redemptionSource)??[],[a]),r=g(!1);s(()=>{if(!i)return;if(i.length<=1)return;if(r.current)return;const t=JSON.stringify(i.map(e=>e.method.redemptionContent?.details?.map(n=>({redemptionPaymentGroupId:e.method.redemptionContent?.redemptionId,redemptionId:n.redemptionId,type:n.redemptionType,amount:n.destinationAmount}))));r.current=!0,e.error(new hc,{severity:"error",metadata:{shopCash:{redemptions:t},source:{type:n.type},checkout:{token:n.checkoutSessionIdentifier||n.sourceId}}})},[i,e,n])})(),{eligibility:e,redeemableBalance:t,messages:r,showVaultedCardBanner:o,vaulted:l,isDigitalGoodsRedemptionAllowed:c}}function yc(){const e=ge().value.payment,t=Nu().value,a=Du().value,{redeemableBalance:i,availableBalance:r}=(()=>{const{checkout:{negotiator:e}}=rt(),n=e.current.fields.shopCashBalance.value,{redeemableTotal:t}=Qu().value,a=(()=>{const{checkout:{negotiator:e}}=rt(),n=e.current.fields.shopCashBalance.value,t=g(null);return"filled"===n?.status?t.current=n.availableBalance:"unavailable"===n?.status&&(t.current=null),t.current})();if("filled"===n?.status&&n.eligible&&null!=n.redeemableBalance&&n.redeemableBalance.amount>0)return{availableBalance:n.availableBalance,redeemableBalance:n.redeemableBalance};if(!a)return sc;if(a.amount<=0)return sc;if(!t)return sc;const i=al(t.currencyCode);if(t.amount<=i)return sc;if(t.amount<a.amount)return{availableBalance:a,redeemableBalance:t};const r=nl(t.amount-a.amount,C(t.currencyCode));return r>=i?{availableBalance:a,redeemableBalance:a}:{availableBalance:a,redeemableBalance:il({amount:a.amount-(i-r),currencyCode:a.currencyCode})}})(),o=Lu(),l=uc().value,s=Hu({eligibility:t,offerEligibility:a,discountOffer:o.value}),{eligibilityMessage:u,showVaultedCardBanner:c}=(e=>{const t=(()=>{const{i18n:e}=rt();return t=>{if(t)switch(t){case"SHOP_CASH_INVALID_BILLING_ADDRESS":return e.translate("shop_cash.redemption_invali
2d_billing_address");case"SHOP_CASH_INVALID_SHIPPING_ADDRESS":return e.translate("shop_cash.redemption_invalid_shipping_address");case"SHOP_CASH_MERCHANT_NOT_SUPPORTED":case"PAYMENTS_SHOP_CASH_UNSUPPORTED_CURRENCY":return e.translate("shop_cash.redemption_unsupported_merchant");case"SHOP_CASH_UNSUPPORTED_DELIVERY_METHOD_TYPE":return e.translate("shop_cash.redemption_unsupported_delivery_method");case"PAYMENTS_SHOP_CASH_UNSUPPORTED_SHIPPING":return e.translate("shop_cash.redemption_unsupported_shipping");case"PAYMENTS_SHOP_CASH_GIFT_CARD_NOT_ALLOWED":return e.translate("shop_cash.redemption_unsupported_gift_cards");case"INSUFFICIENT_FUNDING_LEDGER_BALANCE":return e.translate("shop_cash.redemption_error_exclusive_campaign_out_of_funds");case"BUYER_BALANCE_HOLD_ERROR":return e.translate("shop_cash.redemption_balance_hold",{shopRewardsTermsLink:n(R,{target:"_blank",href:"https://shop.app/shop-cash-terms",children:e.translate("shop_cash.shop_rewards_terms")})});case"DISCOUNT_OFFER_ERROR":return e.translate("shop_cash.exclusive_offer_error");case"SHOP_CASH_NOT_AVAILABLE":case"PAYMENTS_SHOP_CASH_ORDER_TOTAL_TOO_LOW":return;default:return e.translate("shop_cash.redemption_error")}}})(),{checkout:{negotiator:a}}=rt(),{paymentLines:i}=a.current.fields,r=St().value&&Boolean(i.value?.lines.find(Wu));return{eligibilityMessage:t(e.reason),showVaultedCardBanner:r}})(t),d=!t.eligible&&"PAYMENTS_SHOP_CASH_UNSUPPORTED_SHIPPING"===t.reason,p=[];return u&&!d&&p.push(n(mc,{message:u},"eligibility-banner")),p.push(...s),{eligibility:t,offerEligibility:a,redeemableBalance:i,availableBalance:r,discountOffer:o,shopPromotionDiscounts:l,messages:p,showVaultedCardBanner:c,vaulted:e,isDigitalGoodsRedemptionAllowed:d}}const gc=()=>{const{eligibility:e,redeemableBalance:t,messages:a,showVaultedCardBanner:r,vaulted:o,isDigitalGoodsRedemptionAllowed:l}=vc();return r&&!o&&a.push(n(lc,{})),n(i,{children:[(e.eligible||l)&&t&&n(ro,{hideDivider:o,condition:!o,children:n(oc,{redeemableBalance:t})}),a.length>0&&n(ro,{hideDivider:o,condition:!o,padding:"none large-200",children:n(V,{padding:"small-200 none",gap:"small-200",children:a})})]})};function fc({formattedAddress:e}){const{i18n:t,checkout:a}=rt(),i=a.negotiator.current.fields.buyerIdentity.value?.purchasingCompany,r=a.addressManager.shipping.value,o=r.selectedAddress.value?.id===Tl&&Ll(i)||!e;return n(V,{children:[o&&n(Q,{children:i?.location.name}),n(Q,e?{children:e}:{color:"subdued",children:t.translate("review.blocks.no_address")})]})}const bc=new Set(["DELIVERY_NO_DELIVERY_STRATEGY_AVAILABLE_FOR_MERCHANDISE_LINE"]);function _c({id:e="deliveryAddress",label:t,formattedAddress:r}){const{i18n:o,checkout:{negotiator:l}}=rt(),s=Xs(e),c=l.current.fields.buyerIdentity.value?.purchasingCompany,d=Il(),p=be(),{hasViolations:h}=q(bc),{deliveryAddressErrors:m}=se().value,v=r??p,y=u(()=>[`single_choice_${e}`],[e]),g=t??o.translate("shipping.shipping_address_title"),f=n(fc,{formattedAddress:v}),b=n(i,{children:[n(El,{name:`single_choice_list_${e}`,values:y,hideRadioControl:!0,children:n(Vo,{value:`single_choice_${e}`,children:n(V,{children:[n(Q,{children:c?.location.name}),n(Q,{color:"subdued",children:v??o.translate("review.blocks.no_address")})]})})}),n(a,{when:d,children:n(B,{padding:"small-200 small-100 none small-100",children:n(go,{showIcon:!0})})})]}),_="deliveryAddress"!==e?null:h?n(ki,{message:o.translate("shipping_errors.shipping_method_not_available_generic.one")}):m.length>0?n(pe,{errors:m,errorType:F.DeliveryError}):null;return n(ho,{id:e,label:g,open:s.value,onToggle:()=>{s.value=!s.value},primaryContent:f,error:_,children:b})}function Cc({isAbovePaymentSummary:e=!1}={}){const{checkout:{identity:t,negotiator:a}}=rt(),i=a.current.fields.buyerIdentity.value?.purchasingCompany,r=function(e){const n=e.current.value;return"customerAccount"===n||"businessCustomer"===n}(t)&&!e;return r?n(Sc,{renderInlineSelector:!0}):i?n(Pc,{purchasingCompany:i}):n(Sc,{})}function Pc({purchasingCompany:e}){const{i18n:t}=rt(),{shippingAddress:a,name:i}=e.location,{secondary:r}=Se({address:a??{},nameLinePosition:"inline",addressDisplayName:i}),o=a?r:t.translate("review.blocks.no_address");return n(_c,{id:"billingAddress",label:t.translate("company_location.location_title"),formattedAddress:o})}function Sc({renderInlineSelector:e=!1}={}){const{i18n:t,checkout:{identity:a,negotiator:i}}=rt(),r=i.parts.billingAddress.value,o=Ac().value,l=null!=o&&i.parts.billingAddressOption.value===o.option,u="form"!==_e().value,c=l&&o.sameAsShipping&&!u,d=c?o.address:r,p=Ce(d,{displayName:!1}),{isMissingPhone:h}=Pl({addressType:"billing"}),{isMissingFirstName:m}=Sl({addressType:"billing"}),v=h||m,y="billingAddress",b=Xs(y),_=Jt("deliveryNext").value,C=g(!0),{hasViolations:P,violations:S,clearViolations:A}=G(Rt),k=new Set([...h?["PAYMENTS_PHONE_NUMBER_REQUIRED"]:[],...m?Xt:[]]),E=to(P,S,k),{hasViolations:w}=G(Zt);s(()=>{E&&(b.value=!0)},[E,b]),s(()=>{C.current?C.current=!1:A()},[A,r]),Zs({isMissing:v,open:b});const O=function(){const{userEvents:e,source:n,checkout:t,shop:a}=rt(),{billingAddress:i,billingAddressOption:r,shippingAddress:o}=t.negotiator.parts,l=Ac(),s=f(e=>{e?r.value="custom":Ft(i.value,o.value)?r.value="shipping":r.value="custom"},[i,r,o]),u=f(e=>{const n=l.value;e?(n&&r.value===n.option&&(i.value=n.address),r.value="custom"):n&&Ft(i.value,
2n.address)?r.value=n.option:r.value="custom"},[i,r,l]),c=f(i=>e.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...At(n,t,a),action:i?"billing_addresses_expand":"billing_addresses_collapse"}}),[t,e,a,n]);return function({identity:e,switchBillingAddressOption:n,switchAndPrefillBillingAddressOption:t,recordShopPayInteraction:a}){switch(e.current.value){case"payPal":return n;case"customerAccount":case"businessCustomer":return t;case"shopPay":return a;default:return}}({identity:t.identity,switchBillingAddressOption:s,switchAndPrefillBillingAddressOption:u,recordShopPayInteraction:c})}(),I=f(()=>{const e=!b.value;return O?.(e),b.value=e,e},[O,b]);let R=E;!function(e,n){return"applePay"===e.current.value&&n}(a,w)?E&&!_&&(R=n(Pe,{errorType:F.PaymentError,tone:"critical",children:t.translate("address_management.invalid_billing_address_selected")})):R=n(Pe,{errorType:F.PaymentError,tone:"critical",children:t.translate("payment.billing_must_match_shipping_notice")});const T=t.formatName(d?.firstName,d?.lastName,!0);let L,N;return!l||c?(L=T,N=p):L=o.sameAsShipping?t.translate("billing.same_as_shipping"):p,n(ho,{id:y,label:t.translate("billing.billing_address_title"),open:b.value,onToggle:I,error:R,primaryContent:L,secondaryContent:N,renderChildrenWhenCollapsed:v,children:n(js,{renderInlineSelector:e})})}function Ac(){const{checkout:e}=rt(),{buyerIdentity:n}=e.negotiator.current.fields,a=Ae();return t(()=>{if(n.value?.purchasingCompany){const{address:n,type:t}=e.addressManager.billing.value.suggestedAddress.value;return!n||"billing"!==t&&"billing-fact"!==t&&"shipping"!==t?null:{option:t,address:n,sameAsShipping:!1}}return{option:"shipping",address:a.value,sameAsShipping:!0}})}function kc(e,n){return e?n?`${n} · ${e}`:e:""}class Ec{constructor(e,n){this.appContext=e,this.providerData=n,this.triggerClientSideValidation=this.triggerClientSideValidation.bind(this),this.mapServerViolationsToClient=this.mapServerViolationsToClient.bind(this)}get email(){return this.appContext.checkout.proposal.proposed.email.value||void 0}get phone(){return this.appContext.checkout.proposal.proposed.phone.value||void 0}get displayPhone(){}get displayContent(){return{contact:this.email}}get moreOptions(){if(this.hasCheckoutAsGuest(this.providerData))return this.providerData.checkoutAsGuest?[this.providerData.checkoutAsGuest]:void 0}get showShopPayVerification(){return!1}get hasError(){return!1}get shouldHide(){return!1}get shouldTriggerValidation(){return!1}get shouldClearClientSideValidation(){return!1}get shouldMapServerViolationsToClient(){return!1}triggerClientSideValidation(){return!1}clearClientSideValidation(){}mapServerViolationsToClient(){}get isEmbeddedPartner(){return Boolean(this.appContext.embed?.isFlagshipPartner)}get logo(){return null}get displayOptions(){return{vaultedContactType:"base",contentLayout:void 0}}hasCheckoutAsGuest(e){return"object"==typeof e&&null!==e&&"checkoutAsGuest"in e}}const wc="large-400";function Oc(){return n(V,{"aria-busy":!0,alignItems:"center",display:"inline",justifyContent:"center",children:n(V,{borderRadius:"fullyRounded",overflow:"hidden",children:n(Oe,{contentDisplay:"block",children:n(Ic,{})})})})}function Ic(){return n(he,{blockSize:wc,inlineSize:wc})}const Rc=o({displayName:"VaultedContactAvatar",suspense:!1,load:()=>p(()=>e(()=>import("./68887467.B_Jhy707.js"),__vite__mapDeps([123,1,124,2,3,4,5,6,7,8,9,10,11,125]))),renderLoading:()=>n(Oc,{}),renderError:()=>n(Ic,{}),useError:we("VaultedContactAvatar")});function Tc(e,t=""){const a=e?.customerProfile?.firstName?.charAt(0),i=e?.customerProfile?.lastName?.charAt(0),r=t.charAt(0),o=(a??i??r).toUpperCase();return o?n(Rc,{initials:o}):null}function Lc({email:e,phone:t}){const{i18n:a,checkout:{configuration:i},observability:r,shop:{name:o}}=rt(),{hasExternalOrderNotifications:l}=i,c=function({email:e,phone:n}){return e?"email":n?"phone":void 0}({email:e,phone:t}),d=l?c:void 0;s(()=>{d&&(r.log("shop_pay_external_order_notification_banner_suppressed","Withheld the order notification banner: this checkout's order notifications are the merchant's to send",{contact_type:d}),r.counter({name:"shop_pay_external_order_notification_banner_suppressed",value:1,attributes:{contact_type:d}}))},[r,d]);const p=u(()=>l?null:e?a.translate("account_management.email_changed",{shopName:o,email:Nc(e)}):t?a.translate("account_management.phone_changed",{shopName:o,phone:Nc(t)}):null,[e,t,o,a,l]);return p?n(B,{padding:"small-200 none none none",children:n(Re,{tone:"info",children:p})}):null}const Nc=e=>n(x,{type:"strong",children:e});function Dc({url:e,displayName:t}){return n(V,{direction:"inline",gap:"small-400",alignItems:"center",children:[n(B,{inl
2ineSize:"16px",blockSize:"16px",children:n(Te,{src:e,alt:"",accessibilityRole:"presentation",inlineSize:"fill",aspectRatio:"auto"})}),n(x,{size:"medium",type:"strong",children:t})]})}const Mc={amazonPay:class extends Ec{get displayContent(){return{contact:kc(this.appContext.checkout.proposal.proposed.email.value,this.appContext.checkout.proposal.proposed.shippingAddress.fields.firstName.value)}}get logo(){const e=this.isEmbeddedPartner?"xsmall":"medium";return n(Do,{wallet:st.AmazonPay,size:e})}},applePay:class extends Ec{get logo(){return n(Do,{wallet:"APPLE_PAY_BORDERLESS",size:"xsmall"})}},buyWithPrime:class extends Ec{get displayContent(){return{contact:kc(this.appContext.checkout.proposal.proposed.email.value,this.appContext.checkout.proposal.proposed.shippingAddress.fields.firstName.value)}}get logo(){return n(Do,{wallet:st.BuyWithPrime,size:"large"})}},businessCustomer:class extends Ec{get buyerIdentity(){return this.appContext.checkout.proposal.negotiated.fields?.buyerIdentity.value}get isOrderOrDraftSession(){return Ie(this.appContext.source)}get displayContent(){const e=this.buyerIdentity?.purchasingCompany?.company.name??"",n=this.email;return{contact:this.appContext.i18n.translate("contact.company_contact_info",{companyName:e,contact:n??""})}}get logo(){return Tc(this.buyerIdentity,this.email)}get displayOptions(){return{vaultedContactType:"base",contentLayout:"box"}}get moreOptions(){const{accountInfo:e}=this.providerData,{i18n:n}=this.appContext;return e.showLogoutLink&&!this.isOrderOrDraftSession?[{label:n.translate("customer_account.sign_out_link_label"),onClick:e.logoutAndClearProposal}]:void 0}},customerAccount:class extends Ec{get buyerIdentity(){return this.appContext.checkout.proposal.negotiated.value.buyerIdentity}get logo(){return Tc(this.buyerIdentity,this.email)}get displayOptions(){return{vaultedContactType:"base",contentLayout:"box"}}get showShopPayVerification(){return Boolean(this.email)&&this.providerData.loadShopPayVerification}get moreOptions(){const{accountInfo:e}=this.providerData,{i18n:n}=this.appContext;return e.showLogoutLink?[{label:n.translate("customer_account.sign_out_link_label"),onClick:e.logoutAndClearProposal}]:void 0}},googlePay:class extends Ec{get logo(){const e=this.isEmbeddedPartner?"xxxsmall":"xxsmall";return n(Do,{wallet:"GOOGLE_PAY",size:e})}},payPal:class extends Ec{get displayContent(){return{contact:this.payPalEmail||this.email}}get logo(){const e=this.isEmbeddedPartner?"xxsmall":"small";return n(Do,{size:e,wallet:"PAYPAL_EXPRESS"})}get payPalEmail(){const e=ea(this.appContext.checkout.proposal.proposed.paymentLines.value,"PAYPAL_EXPRESS");return e?.method.walletContent?.email||void 0}get children(){const e=this.displayContent.contact;return Boolean(e)&&Boolean(this.email)&&e!==this.email?n(Lc,{email:this.email}):null}get displayOptions(){return{vaultedContactType:"base",contentLayout:void 0,children:this.children}}},sdkCartHints:class extends Ec{get displayPhone(){return this.appContext.shop.contactInfoOptions.includes("PHONE")?this.phone:void 0}get displayContent(){const{i18n:e}=this.appContext,n=this.email||this.displayPhone||"";return{label:e.translate("contact.contact_method_title"),contact:n,useSummaryInContent:!0}}get hasError(){const{validation:{contactErrors:{emailInputError:e,phoneInputError:n}}}=this.appContext.checkout;return Le({email:this.email,phone:this.phone,emailInputError:e.value,phoneInputError:n.value,hasViolations:this.displayableContactViolations.length>0})}get shouldHide(){const e=this.appContext.checkout.proposal.negotiated.fields.merchandiseLines.value?.lines;return!(Boolean(this.appContext.embed?.interstitialPartnerDisplayName)&&!this.appContext.checkout.identity.customerContactMethodPrefilled)&&Ne({isFlagshipPartner:Boolean(this.appContext.embed?.isFlagshipPartner),hasError:this.hasError,hasOnlyDigitalItems:De(e)})}get shouldTriggerValidation(){return Boolean(this.email||this.phone)}get shouldClearClientSideValidation(){const{validation:{contactErrors:{emailInputError:e,phoneInputError:n}}}=this.appContext.checkout;return!this.email&&!this.phone&&(this.isClearableContactError(e.value)||this.isClearableContactError(n.value))}get shouldMapServerViolationsToClient(){const{violationsSubscriptionResult:{hasViolations:e}}=this.providerData;return e}triggerClientSideValidation(){const{i18n:e}=this.appContext,{validation:{contactErrors:{emailInputError:n,phoneInputError:t}}}=this.appContext.checkout;n.value=void 0,t.value=void 0;const a=this.appContext.shop.contactInfoOptions.includes("PHONE"),i=this.validateContactInformation({email:this.email,phone:this.phone,phoneAllowed:a,translations:{emailBlank:e.translate("field_errors.email_blank"),emailInvalid:e.translate("field_errors.email_invalid"),blank:e.translate("field_errors.email_or_phone_blank")}});if(!i)return!1;switch(i.field){case"email":return n.value=i.error,!0;case"phone":return t.value=i.error,!0}}clearClientSideValidation(){const{validation:{contactErrors:{emailInputError:e,phoneInputError:n}}}=this.appContext.checkout;this.isClearableContactError(e.value)&&(e.value=void 0),this.isClearableContactError(n.value)&&(n.value=void 0)}mapServerViolationsToClient(){const{validation:{contactErrors:{emailInputError:e,phoneInputError:n}}}=this.appContext.checkout,{violationsSubscriptionResult:{clearViolations:t}}=this.providerData,a=Boolean(this.email||this.phone),i=Boolean(e.value)||Boolean(n.value);for(const r of this.displayableContactViolations)!i&&a&&"UnprocessableTermViolation"===r.__typename&&(e.value=r.localizedMessage??r.n
2onLocalizedMessage,n.value=void 0);t()}get logo(){const e=this.appContext.embed,t=Ht({embedder:e?.embedder,shop:this.appContext.shop}),a=e?.interstitialPartnerDisplayName,i=e?.interstitialPartnerProfileIconUrl;return t&&a&&!0===e?.isFlagshipPartner&&this.appContext.checkout.identity.customerContactMethodPrefilled?i?n(Dc,{url:i,displayName:a}):Tc(void 0,this.email):n(J,{type:"email",size:"fill"})}get displayOptions(){return{vaultedContactType:"rollup",expandable:!0,children:n(Ei,{showEmailMarketingOptIn:!1})}}get displayableContactViolations(){const{violations:e,negotiationStage:n}=this.providerData.violationsSubscriptionResult,t=na(this.email)||this.appContext.shop.contactInfoOptions.includes("PHONE")&&na(this.phone),a="negotiation"===n&&!this.appContext.embed?.isFlagshipPartner&&t;return Array.from(e).filter(({code:e})=>!a||"BUYER_IDENTITY_MISSING_CONTACT_METHOD"!==e)}validateContactInformation({email:e,phone:n,phoneAllowed:t,translations:a}){if(!(e||n&&t))return{field:"email",error:t?a.blank:a.emailBlank};if(e){const n=gl(e,a.emailBlank),t=fl(e,a.emailInvalid),i=n??t;if(i)return{field:"email",error:i}}else if(n&&t){const e=gl(n,a.blank);if(e)return{field:"phone",error:e}}}isClearableContactError(e){return!!e&&!("object"==typeof e&&"origin"in e&&"client"===e.origin)}},shopPay:class extends Ec{#t;#a;constructor(e,n){super(e,n),this.#t=(this.appContext.mobileCheckoutSdk.enabled||Boolean(this.appContext.embed?.isCheckoutKit()))&&zt(this.appContext.shopPay.app.config),this.#a=ta(this.appContext.router.currentUrl.value.search)}get displayContent(){return{contact:this.appContext.shopPay.user.email.value}}get displayPhone(){return this.appContext.shopPay.user.phoneNumber.value||void 0}get logo(){return this.providerData.shopPayLogo}get moreOptions(){return this.providerData.shopPayMoreOptions}get children(){const e=this.displayContent.contact,t=Boolean(e)&&Boolean(this.email)&&e!==this.email,a=Boolean(this.phone&&!this.email);return t||a?n(Lc,{email:this.email,phone:this.phone}):null}get displayOptions(){let e;return(this.#t||this.#a||!this.appContext.shopPay.visibility.showVaultedContactInlineLogo)&&(e="stack"),this.appContext.shopPay.visibility.showVaultedContactHeader||(e="box"),this.appContext.shopPay.visibility.showVaultedContact?{vaultedContactType:"base",contentLayout:e,children:this.children}:{vaultedContactType:"hidden"}}}};class Bc extends Error{constructor(){super("Guest identity should never be instantiated. Guest identity has vaultedSections.contact=false, so VaultedContact never renders."),this.name="GuestIdentityError"}}const xc=new aa(0,0,100);function Vc(){const e=rt(),a=e.checkout.identity.current.value,i=u(()=>({appContext:e,identitySource:a}),[e,a]),r=Fe().value,o=e.client.unstable_getSerialization("logoutUrl")||"",l=function(){const e=rt(),n=Ml(),a=He(),i=Co(),r=ze(),o=function(){const{checkout:{wallets:e}}=rt(),{persistedPayPalSignal:n,inMemoryPayPalParts:{accountStatus:t}}=lt(),{clearForcedCheckoutLayout:a}=ke(Qt),i=f(()=>{n.value={isVenmo:!1},t.value={status:"not_connected"},a({wallet:e.escalatedWallet.value})},[e.escalatedWallet,n,t,a]);return Ee({onClick:i,shouldResetCustomerInfo:!0,skipRedirect:!0})}(),l=v({amazonPayCheckoutAsGuest:n,applePayCheckoutAsGuest:a,buyWithPrimeCheckoutAsGuest:i,googlePayCheckoutAsGuest:r,payPalCheckoutAsGuest:o});return t(()=>{const n=l.value;switch(e.checkout.identity.current.value){case"amazonPay":return n.amazonPayCheckoutAsGuest;case"applePay":return n.applePayCheckoutAsGuest;case"buyWithPrime":return n.buyWithPrimeCheckoutAsGuest;case"googlePay":return n.googlePayCheckoutAsGuest;case"payPal":return n.payPalCheckoutAsGuest;default:return}})}().value,s=fo(),c=function(){const{shopPay:e,mobileCheckoutSdk:t,embed:a,router:i}=rt(),r=i.currentUrl.value,o=Boolean(a?.isFlagshipPartner)?"small":"medium",l=(t.enabled||a?.isCheckoutKit())&&zt(e.app.config),s=ta(r.search),u=bl({foregroundColor:Fl}),c=bl({foregroundColor:xc});if(l||s||!e.visibility.showVaultedContactInlineLogo)return null;let d;return d=u?"branded":c?"white":"black","shop"!==e.logoBrand?n(Vl,{color:d,size:o}):n(xl,{color:d,size:o})}(),d=function(){const{i18n:e,observability:n,userEvents:t,source:a,checkout:i,shop:r,persistence:o,shopPay:l,router:s}=rt(),c=i.negotiator,{visibility:d,app:{config:p}}=l,h=zt(p),{replaceShopPayInHistory:m}=Dl(),v=f((e,t)=>
2{if("success"!==t.status)return i.unstable_setRedirectingExternally(!1),void n.log("shop_pay_switch_account_session_clear_failed","Shop Pay account switch session clear did not succeed",{status:t.status});o?.clearAll();const a=new URL(window.location.href);a.pathname=s.resolve(ia).pathname,a.searchParams.set(ra,"1"),m(a.toString())},[i,n,o,m,s]),y=Me(v),{label:g}=Be(),b=xe({clearPii:!0}),_=Ve(),C=Boolean(l.config.isReferral),P=f(()=>{i.unstable_setRedirectingExternally(!0),t.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.2",payload:{...At(a,i,r),action:"switch_account"}},{exportImmediately:!0});const e=c.block();c.waitForPendingNegotiations().then(()=>y()).catch(()=>{i.unstable_setRedirectingExternally(!1)}).finally(e)},[y,t,a,i,r,c]);return u(()=>{const n=[];return d.showSwitchAccountAction&&n.push({onClick:_?()=>{}:P,label:e.translate("account_management.switch_account")}),d.showCheckoutAsGuestKebabLink&&!C&&n.push({onClick:b,label:g}),!h&&d.showSwitchVaultedContactMenu?n:void 0},[g,b,P,e,_,C,h,d.showSwitchAccountAction,d.showCheckoutAsGuestKebabLink,d.showSwitchVaultedContactMenu])}(),p=G(oa),h=Me(f(()=>{e.persistence?.clearAll(),window.location.assign(o)},[e,o])),m=f(()=>{e.checkout.unstable_setRedirectingExternally(!0),h().catch(()=>{e.checkout.unstable_setRedirectingExternally(!1)})},[e.checkout,h]);return u(()=>function(e,n){const t=e.checkout.identity.current.value;if("guest"===t)throw new Bc;return function(e,n,t){return new(0,Mc[e])(n,t)}(t,e,n)}(i.appContext,{accountInfo:{logoutAndClearProposal:m,showLogoutLink:r},loadShopPayVerification:s.value,shopPayLogo:c,shopPayMoreOptions:d,checkoutAsGuest:l,violationsSubscriptionResult:p}),[i,m,r,s.value,c,d,l,p])}function Fc(e){const n=g(void 0),t=e.email,a=e.phone,i=Boolean(t||a);s(()=>{const r=n.current,o=Boolean(r),l=Boolean(r?.email||r?.phone),s=!o||r?.email!==t||r?.phone!==a;e.shouldTriggerValidation&&s?e.triggerClientSideValidation():o&&!l||i||!e.shouldClearClientSideValidation||e.clearClientSideValidation(),n.current={email:t,phone:a}},[t,i,a,e]),s(()=>{e.shouldMapServerViolationsToClient&&e.mapServerViolationsToClient()},[e])}function Hc({emailAddress:e,phone:t,logo:a,moreOptions:r,emailAlignment:o="end",children:l}){const{i18n:s,shop:u,checkout:{negotiator:c}}=rt(),d=u.hasFlagEnabled(la)?t:void 0,p=e??(d?void 0:c.parts.email.value),h=p||d||n(D,{});return n(i,{children:[n(ee,{gridAutoFlow:"column",gridTemplateColumns:a?"minmax(auto, max-content) minmax(0, 1fr) minmax(auto, max-content)":"minmax(0, 1fr) minmax(auto, max-content)",gridTemplateRows:"minmax(0, 1fr)",gap:"small-300",alignItems:"center",alignContent:"center",justifyContent:o,justifyItems:o,children:[a,n(B,{maxInlineSize:"100%",children:"string"==typeof h?n(Q,{children:[!p&&d&&n(i,{children:[n(x,{accessibilityVisibility:"exclusive",children:s.translate("contact.phone_label")})," "]}),n(je,{children:h})]}):h}),r&&n(Al,{accessibilityLabel:s.translate("review.account_more_actions"),positionArea:"block-end",options:r})]}),l]})}function zc({layout:e,emailAlignment:t,...a}){const{i18n:i}=rt(),r=n(Hc,{...a,emailAlignment:t??("stack"===e||"box"===e?"start":"end")});switch(e){case"stack":return n(V,{gap:"base",padding:"none none base none",children:r});case"box":return n(B,{padding:"base none",children:n(V,{gap:"base",children:r})});default:return n(B,{role:"region",accessibilityLabel:i.translate("customer_account.rollup_label"),padding:"small-200 none base none",children:r})}}function jc(){const e="contact",t=Xs(e),r=f(()=>t.value=!t.value,[t]),o=Vc();Fc(o);const l=y(!1),u=Vt(),c=g(!1),{embed:d,i18n:p}=rt(),h=o.displayOptions,{vaultedContactType:m}=h,{label:v,contact:b,useSummaryInContent:_}=o.displayContent,C=o.email,P=o.displayPhone,S=o.hasError;if(s(()=>{o.hasError&&(t.value=!0)},[o.hasError,t]),"hidden"===m||o.shouldHide&&!c.current)return null;c.current=!0;const A=_?b:void 0,k="amazon"===d?.embedder?{compact:A}:{primary:A};return"rollup"===m?n(ho,{id:e,label:v??p.translate("contact.contact_method_title"),primaryContent:k.primary,compactContent:k.compact,open:t.value||S,onToggle:S||!h.expandable?void 0:r,icon:o.logo,children:h.children??null}):n(i,{children:[n(zc,{emailAddress:b,phone:P,logo:o.logo,moreOptions:o.moreOptions,layout:h.contentLayout,children:h.children??null}),o.showShopPayVerification?n(a,{when:u,children:n(wi,{email:C??"",open:l.value,showPopover:e=>{l.value=e}})}):null]})}function Uc(){return Ue(new Set([...sa].filter(e=>e.startsWith("DELIVERY_COMPANY"))))}function Gc({loading:e,countryCode:n,phone:t}){const a=ua(),{i18n:i,checkout:r}=rt(),o=r.configuration.addressSettings.nonBillingAddressSettings.value,l=u(()=>o.isRequired("phone",{countryCode:n}),[n,o]),{validatePhoneNumber:c,isPhoneNumberUtilLoaded:d}=Hl(),p=f(e=>{const t=na(e);return l&&!t?i.translate("field_errors.phone_blank"):t&&!c(e??"",n)?i.translate("field_errors.shipping_line_phone_invalid"):void 0},[l,c,n,i]),h=g(!1);return s(()=>
2{if(h.current||!d||e)return;const n=p(t);a.value=n,h.current=!0},[l,d,e,t,a,p]),u(()=>({errorSignal:a,validatePhoneField:p,isPhoneRequired:l}),[a,l,p])}const Yc=new Set(ca);function Wc(){const{shopPay:e,checkout:n,source:t,observability:a}=rt(),{deliveryMethodsAddressErrors:i}=n.negotiator.context,r=Mo(),{shippingAddress:o}=n.negotiator.parts,l=o.value,u=n.configuration.addressSettings.nonBillingAddressSettings.value,c="simulated"===t.type,d=Ge(l.countryCode,void 0,u),p=n.addressManager.shipping.value.selectedAddress.value,h=p?.address.countryCode,m=Ge(h??l.countryCode,void 0,u,null),{details:v}=da(h),y=!h||void 0!==v&&!v.isFallback,{clearViolations:f}=q(Yc),b=g(!0);return s(()=>{b.current?b.current=!1:f()},[f,l]),Bo("shippingAddress",async()=>{const t=async(e,t)=>await n.addressManager.shipping.value.createAddress(t)?{success:!0}:{success:!1,location:e,errors:Object.values(i).some(e=>void 0!==e.value)?[]:[r({offerGuestCheckout:!0})]};if(!c){const r=n.addressManager.shipping.value.selectedAddress.value,o=n.proposal.negotiated.fields.buyerIdentity.value?.customerProfile;if(r&&"CustomerProfile"===o?.__typename&&o.shippingAddresses.some(e=>e.id===r.id)){const o=e=>{_(()=>{for(const[n,t]of e)i[n].value=t})},s=()=>t("intercept_shipping_address_vault_ca",{address:r.address,selectAddress:!0,addressErrorsOverride:i});if(!y||r.address.countryCode!==h)return s();const u=m(r.address,"shipping");if(0===u.size)return s();const c=d(l,"shipping"),p=e=>{try{a.log("shop_pay_ca_vault_address_invalid","Selected customer-account address fails validation before Shop Pay vault-save",{invalidFields:Array.from(u.keys()).sort().join(","),proposalInvalidFields:Array.from(c.keys()).sort().join(","),proposalDiverges:!pa(l,r.address),outcome:e})}catch{}};if(0===c.size){const a=e.user.addresses.value.find(e=>pa(e.address,l));if(a&&await n.addressManager.shipping.value.selectAddress(a.id))return p("selected_matching_vaulted"),{success:!0};const r=await t("intercept_shipping_address_vault_ca_proposal",{address:l,selectAddress:!0,addressErrorsOverride:i});return p(r.success?"vaulted_proposal":"vault_proposal_rejected"),r}return p("blocked_client_side"),Nl({addressType:"shipping",validate:()=>c,setErrors:o})}}if(e.session.selectedShippingAddress.value||e.user.addresses.value.length)return{success:!0};const o=Nl({addressType:"shipping",validate:()=>d(l,"shipping"),setErrors:e=>{_(()=>{for(const[n,t]of e)i[n].value=t})}});return o.success?"authenticated_user"===e.user.flow.peek()?t("intercept_shipping_address_add_new",{address:l,addressErrorsOverride:i}):{success:!0}:o}),null}const qc=()=>{const{shopPay:e,checkout:{negotiator:n}}=rt(),{geolocation:a}=Ye(),{shippingAddress:i}=n.parts;return t(()=>{const n=i.value;return e.signup.phoneCountryCode.value??n.countryCode??a.country.code})};function Kc({padding:e}){const{i18n:t,shopPay:a,checkout:{negotiator:i}}=rt(),{shopPayMobilePhoneInputShownSignal:r}=i.context,o=qc(),l=Boolean(a.user.phoneNumber.value),u=(()=>{const{i18n:e,shopPay:n}=rt(),{isPhoneNumberUtilLoaded:t,validatePhoneNumber:a}=Hl(),i=qc(),r=f(n=>na(n)?t&&!a(n??"",i.value,!0)?e.translate("mobile_phone_number.mobile_phone_invalid"):void 0:e.translate("field_errors.phone_blank"),[e,t,a,i]);return ha(n.signup.phoneNumberRawSignal,n.signup.phoneErrorRawSignal,r)})();S(()=>(r.value=!0,()=>{r.value=!1}),[r]);const c=g(o.peek());(()=>{const{shopPay:e,checkout:n}=rt(),t=n.configuration.addressSettings.nonBillingAddressSettings.value,{shippingAddress:a}=n.negotiator.parts,i=e.signup.phoneNumber.value,r=e.signup.phoneError.value,o=a.fields.countryCode.value,l=a.fields.phone.value,{deliveryMethodsAddressErrors:u}=n.negotiator.context,c=u.phone.value,{setAddressError:d}=We(u),p=qc(),{isPhoneNumberUtilLoaded:h}=Hl(),m=g(!1),v=zl(p.value,i,!0);s(function(){l&&!i&&e.signup.unstable_setPhoneNumber(l);const n=e.signup.phoneCountryCode.value;o&&!n&&e.signup.unstable_setPhoneCountryCode(o)},[]),s(()=>{if(!m.current&&h&&i){const{prefix:n}=v;i.startsWith(n)||e.signup.unstable_setPhoneNumber(`${n}${i}`),m.current=!0}},[h]),ma(async({parts:n,reason:a})=>{if("negotiation"!==a)return{behavior:"allow"};const{shippingAddress:i}=n;let r=e.signup.phoneNumber.peek();r&&r!==v.prefix||(r=void 0);const o=i.peek().phone;return{behavior:"allow",perform(){r!==o&&t.isVisible("phone",{countryCode:p.value,useMerchantSettings:!0})&&(i.fields.phone.value=r)}}}),s(function(){r!==c&&d("phone",r)},[r,c,d])})();const d=f(e=>{a.signup.unstable_setPhoneCountryCode(e)},[a.signup]);return n(V,{gap:"base",padding:e,children:[n(jl,{name:"phone",countryCode:c.current,label:t.translate("mobile_phone_number.label"),autocomplete:"shipping tel",requireCountryCode:!0,disabled:l,onSelectedCountryChange:d,...u}),n(Q,{type:"small",color:"subdued",children:t.translate("mobile_phone_number.disclaimer")})]})}const $c="shipping";
2function Jc({filteredFields:e,additionalFieldGroups:t,children:i,settings:r}){const o=va(),{shouldGateCrossBorder:l,crossBorderGate:u}=Gl(),c=rt(),{deliveryMethodsAddressErrors:d}=c.checkout.negotiator.context,{shippingAddress:p}=c.checkout.negotiator.parts,{checkout:h,i18n:m,userEvents:y,source:f,shop:b}=c,{configuration:C}=h,P=C.isAddressDelegationEnabled,{violations:S}=q(sa),A=p.fields?.countryCode.value,k=qe(A),E=g(!1);s(()=>{if(!P)return;if(E.current)return;if(0===S.size)return;if(E.current=!0,Object.values(d).some(e=>{const n=e.value;return n&&"object"==typeof n&&"client"===n.origin&&"inline-validation"===n.type}))return;const e=k($c,Array.from(S));_(()=>{for(const[n,t]of e)void 0===d[n]?.value&&(d[n].value=t)})},[P,S,k,d]);const w=C.addressSettings.nonBillingAddressSettings.value,O=p.value,I=ya(),{hasViolations:R}=q(Yc),T=C.defaultPhoneNumber.value;w.isRequired("phone",{countryCode:O.countryCode,useMerchantSettings:!0})&&!O.phone&&T&&(p.value={...O,phone:T});const L=v(Boolean(e&&e.length>0)),N=C.trackAddressAutoComplete?()=>{y.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.2",payload:{...At(f,h,b),action:"address_autocomplete"}})}:void 0,D=n(qo,{id:"shippingAddressForm",addressType:$c,address:p,countries:o,settings:r,addressErrors:d,additionalFieldGroups:t,showSavedAddressSelector:!1,onAddressAutoComplete:N,onBeforeCountryChange:(e,n,t)=>{l(e)?u(n,{onCancel:t}):n()},filteredFields:e,children:i}),M=n(a,{when:L,fallback:D,children:n(B,{background:"base",borderRadius:"base",className:ga({colorLayer:"controlSelected"}),paddingInline:"base",paddingBlockStart:"large-100",paddingBlockEnd:"base",children:n(V,{direction:"block",gap:"base",children:[n(B,{padding:"none",children:[n(Q,{children:[O.firstName," ",O.lastName]}),n(Yl,{address:O,hiddenFields:["firstName","lastName","phone"],textColor:"subdued"})]}),D]})})});return n(Ul,{impressionType:"delivery_address",impressionFeatures:[],children:[Xc(c)&&n(Wc,{}),R&&C.visibility.showInvalidDeliveryAddressBanner.value&&n(B,{children:[n(Oi,{}),n(he,{blockSize:"base"})]}),n(a,{when:I,children:n(B,{children:[n(Re,{tone:"info",children:m.translate("address_management.draft_order_delivery_address_reminder")}),n(he,{blockSize:"base"})]})}),M,n(a,{when:C.visibility.showStandalonePhoneField,children:n(Kc,{padding:"base none none none"})})]})}function Xc({checkout:e}){return"shopPay"===e.identity.current.value}const Zc=e=>{if(!e)return"unknown";const{taxId:n}=e;if(n.warnings.includes("DOMESTIC_NOT_APPLICABLE"))return"write";const{status:t}=e.taxId;return"pending"===t.type&&"VALID"===n.validated.status||"resolved"===t.type&&"VALID"===t.validationStatus?"vaulted":"write"};function Qc(){const e=Ke(),{checkout:{negotiator:n}}=rt(),{paymentLines:a}=n.parts,{walletUsedForSubmissionSignal:i}=lt();return t(()=>e.value||es({paymentLines:a.value,walletUsedForSubmission:i.value}))}function ed(e,n){return e.isAddressDelegationEnabled&&"shopPay"!==n&&!Pa(n)}const nd=new Set([...sa,..._a,...ca,...Sa]),td=["phone","zoneCode","countryCode","firstName","lastName","name"],ad=["phone","zoneCode","countryCode","firstName","lastName","name","coordinates","oneTimeUse"];function id(e){return"pending"===e||"pendingCollapsed"===e}function rd(e){return"collapsed"===e||"pendingCollapsed"===e}function od({summary:e,forceOpen:r,initiallyOpen:o=!1,renderRollup:l}={}){const u=function(){const{checkout:{negotiator:e}}=rt(),t=e.current.fields.buyerIdentity.value?.purchasingCompany,a=be();return t?n(fc,{formattedAddress:a}):void 0}(),c=u??e,d=v(function(){const{i18n:e}=rt(),{hasViolations:t}=q(_a),{hasViolations:a}=q(Ca),{hasError:i,error:r}
2=w(ba),o=ie(r?{type:"payment",code:r}:void 0);return i&&o?n(Pe,{tone:"critical",errorType:F.DeliveryError,children:o}):t?n(ki,{message:e.translate("shipping_errors.shipping_method_not_available_generic.one")}):a?n(ki,{message:e.translate("shipping_errors.shipping_method_not_available_due_to_unsatisfied_conditions")}):null}()),p=ya(),{embed:C,i18n:P,shopPay:A,observability:k,userEvents:E,checkout:O,source:I,shop:R}=rt(),{shippingAddress:T}=O.negotiator.parts,{allViolations:L}=O.negotiator.current.fields,N=C?.client?.addressErrors.value.includes(Aa.AddressEmpty)??!1,D=va(),{installments:M}=A,H="shopPay"===O.identity.current.value,{isMissingPhone:z}=Pl(),{isMissingFirstName:j}=Sl(),G=z||j,Y="google"===C?.embedder,W=O.configuration.addressSettings.nonBillingAddressSettings.value,K=t(()=>Y&&W.isVisible("phone",{countryCode:T.value?.countryCode})),{formattedNumber:$}=zl(T.value?.countryCode??"",K.value?T.value?.phone:void 0),X=t(()=>ed(O.configuration,O.identity.current.value)),{deliveryMethodsAddressErrors:Z}=O.negotiator.context,Q=t(()=>Object.values(Z).some(e=>void 0!==e.value)),ee=t(()=>Boolean(T.value?.countryCode&&!D?.some(e=>e.value===T.value.countryCode))),ne=function({checkout:e,i18n:t},a){return e.configuration.visibility.showInvalidDeliveryAddressBanner.value?n(Oi,{}):a?n(ki,{message:t.translate("shipping_errors.unavailable_address_country")}):null}({checkout:O,i18n:P},ee.value),te=t(()=>function(e,n=[]){const t=Object.entries(e).reduce((e,[t,a])=>("boolean"!=typeof a&&!a||n.includes(t)||(e[t]=a),e),{});return 0===Object.keys(t).length}(T.value,X.value?ad:td)),[ae,re]=b([]),{availableDeliveryAddresses:oe,mustSelectProvidedAddress:le}=O.proposal.negotiated.fields,ue=t(()=>oe.value??[]),ce=t(()=>le.value??!1),de=U("Checkout::DeliveryAddress::RenderBefore"),he=U("purchase.checkout.delivery-address.render-after"),me=Io([...de,...he],{lazyReveal:!0}),ve=Xe(),ye=t(()=>ue.value?.length&&Boolean(ue.value.find(e=>pa(T.value,e.address)))),ge=t(()=>Boolean(ye.value&&ce.value)),fe=Ze(),_e=Vt(),Ae=ka(Qe),ke=t(()=>_e.value&&"loading"===Ae.uiStateSignal.value?.status),Ee=t(()=>"filled"===Ae.uiStateSignal.value?.status),we=t(()=>!X.value||!te.value&&Ee.value),Oe="deliveryAddress",Ie=Xs(Oe,m(()=>o||(me.value||ge.value)&&we.value)),Te=function(e,n){const[t,a]=b(Zc(e)),i=g(null),r=y(!1);"vaulted"===t&&Zc(e)!==t&&a("write"),"unknown"===t&&Zc(e)!==t&&a(Zc(e));const o=f(e=>{i.current=e,n.value&&e&&r.value&&(r.value=!1,e.focus())},[r,n]);return h(()=>{n.value&&i.current&&r.value&&(r.value=!1,i.current.focus())}),{status:t,inputRef:o,focus:f(()=>{r.value=!0,a("write"),n.value&&i.current&&(r.value=!1,i.current.focus())},[r,n])}}(fe,Ie),Le=g(null),Ne=g(null),De=g(!1),Me=y("idle"),Be=id(Me.value),xe=rd(Me.value),Ve=y(!1),Fe=qs(Ea([...de,...he],"uiExtension").map(Mt),f(()=>{we.value&&(Ie.value=!0)},[we,Ie]));s(()=>{Fe&&we.value&&(Ve.value=!0)},[Fe,Ve,we.value]);const He=t(()=>X.value&&Ve.value);s(()=>{we.value&&(me.value||Fe)&&(Ie.value=!0)},[me.value,we.value,Fe,Ie]),S(()=>{ve.current&&(X.value&&te.value||X.value&&xe||!1===ye.value&&(Ie.value=!0))},[ye.value,Ie,ve,X.value,te.value,xe]),Zs({isMissing:G,open:Ie});const ze=se(),je=ze.value.deliveryAddressErrors,Ue=t(()=>ze.value.deliveryAddressErrors.length>0),Ge=Qc().value||"payPal"===O.identity.current.value,{hasViolations:Ye,violations:We,clearViolations:Ke}=q(nd),{missingAddressFieldSignal:nn,hasResolvedMissingAddressFieldSignal:tn}=function({countryCode:e,addressType:n,addressViolations:t}){const{shop:a,checkout:{identity:i}}=rt(),r=a.hasFlagEnabled(fa),o=y(void 0),{violations:l}=$e(t),s=l.value,u=qe(e),c=y(!1),d="applePay"===i.current.value||"googlePay"===i.current.value||"payPal"===i.current.value;if(r&&d&&void 0===o.value&&s.size>0&&!c.value){c.value=!0;const e=u(n,Array.from(s)),t=Je({addressErrors:e});t&&(o.value=t)}return{missingAddressFieldSignal:o,hasResolvedMissingAddressFieldSignal:c}}({countryCode:T.value?.countryCode,addressType:"shipping",addressViolations:sa}),an=t(()=>Boolean(nn.value)&&!Ie.value),rn=new Set([...z?wa:[],...j?Oa:[],...an.value?sa:[]]),on=to(Ye,We,rn),{hasError:ln,clearError:sn}=w(ba),un=M.agreementError.value===sl.InvalidShippingAddress,cn=Jt("deliveryNext"),dn=t(()=>!_e.value||cn.value);h(()=>{ke.value&&m(()=>{sn(),M.unstable_setAgreementError(null)})});const pn=f(()=>{Ke(),sn(),M.unstable_setAgreementError(null)},[Ke,sn,M]),hn=Ce(T.value,{hiddenFields:["phone"],displayName:!1}),mn=P.formatName(T.value?.firstName,T.value?.lastName,!0),vn=T.value?.firstName&&T.value?.lastName?mn:void 0,yn=Se({address:T.value??{}}),gn=n(a,{when:te,fallback:n(V,{children:[hn,K.value&&$&&n(x,{children:$})]}),children:n(x,{tone:"critical",children:P.translate("shipping.add_shipping_address")})}),fn=te.value?n(x,{tone:N?"critical":void 0,children:P.translate("shipping.add_shipping_address")}):vn,bn=te.value?void 0:n(V,{children:[yn.primary&&n(x,{children:yn.primary}),yn.secondary&&n(x,{children:yn.secondary}),K.value&&$&&n(x,{children:$})]}),_n=n(a,{when:()=>te.value||!T.value?.postalCode,fallback:n(i,{children:[n(x,{children:P.translate("shipping.delivery_to")}),n(x,{type:"strong",children:vn})]}),children:n(x,{tone:"accent",decoration:"underline",children:P.translate("shipping.add_new_delivery_address")})}),Cn=t(()=>T.value?.postalCode),Pn=n(a,{when:()=>te.value||!Cn.value,fallback:n(V,{children:[n(x,{type:"strong",children:Cn}),K.value&&$&&n(x,{children:$})]}),children:()=>""}),Sn=(()=>
2{if(c)return{primary:c};switch(C?.embedder){case"amazon":return{compact:n(V,{direction:"inline",gap:"small-400",alignItems:"center",children:[_n,Pn]})};case"google":return{primary:fn,secondary:bn};default:return{primary:vn,secondary:gn}}})(),An=t(()=>en(L.value??[])&&!ke.value),kn=v(on&&!An.value||ln||un),En=t(()=>dn.value?null:kn.value&&ne&&!ke.value?{type:"invalid-address-banner",element:ne}:!d.value||An.value||ke.value?!Ue.value||Ge||An.value?An.value?{type:"unavailable-in-buyer-location-banner",element:null}:null:{type:"validation-errors-banner",element:n(pe,{errors:je,errorType:F.DeliveryError})}:{type:"default-vaulted-delivery-address-error-banner",element:d.value}),wn=n(sd,{errorSignal:En}),On=t(()=>Boolean(En.value)||Ge&&Ue.value),In=v(on),Rn=v(ln),Tn=v(r),Ln=v(Fe),Nn=t(()=>Q.value||In.value||Ue.value),Dn=t(()=>Boolean(Tn.value)||me.value||Ln.value&&we.value||He.value),Mn=t(()=>X.value&&id(Me.value)&&rd(Me.value)&&!Dn.value&&!Rn.value&&!An.value),Bn=t(()=>tn.value&&void 0===nn.value),xn=t(()=>Nn.value&&!Mn.value),Vn=t(()=>X.value&&Ee.value&&!xn.value),Fn=t(()=>Vn.value&&rd(Me.value)),Hn=t(()=>Dn.value||Rn.value||Bn.value||!Mn.value&&On.value),zn=t(()=>Nn.value&&!(X.value&&id(Me.value))||An.value||Dn.value||Rn.value);De.current=zn.value;const jn=t(()=>{if(X.value){if(te.value)return!1;if(Fn.value)return Hn.value;if(Q.value&&!Mn.value&&(!tn.value||!nn.value))return!0}return Ie.value||Hn.value}),Un=f(()=>{Ne.current&&(clearTimeout(Ne.current),Ne.current=null)},[]),Gn=f(()=>{Un(),Me.value="idle"},[Un,Me]),Yn=f(()=>{if(Un(),De.current)return Me.value="collapsed",void(Ie.value=!0);Me.value="collapsed",Ie.value=!1},[Un,Me,Ie]),Wn=f(()=>{Un(),Ne.current=setTimeout(()=>{Ne.current=null,De.current||(Me.value="pendingCollapsed",Ie.value=!1)},300)},[Un,Me,Ie]),qn=f(()=>{Gn(),Ie.value=!0},[Gn,Ie]);s(()=>Un,[Un]),s(()=>{X.value&&Nn.value&&!Be&&Gn()},[Be,Nn.value,X.value,Gn]);const Kn=f(async()=>{if(!X.value||!C?.client)return;if(id(Me.value))return;re([]),Me.value="pending";const e=jn.value;He.value||Wn();const n=performance.now();try{const a=await C.client.addressChangeStart("shipping").then(e=>({response:e,error:void 0})).catch(e=>({response:void 0,error:e})),i=performance.now()-n;if(a.error){const{error:n}=a;if(n instanceof Ia)return k.log("third_party_delivery_address_timeout","Address change timed out, falling back to manual entry.",{duration:i}),re([{code:"GENERAL_ERROR",message:String(P.translate("shipping.third_party_address_timeout"))}]),void qn();const t=n instanceof Error?n.message:String(n);return n instanceof Ra&&n.isUserCancelledError?(k.log("third_party_delivery_address_cancelled","User cancelled address selection",{duration:i}),Gn(),Ie.value=e,void Le.current?.focus()):(n instanceof Ta?(k.log("third_party_delivery_address_protocol_error","Address change failed due to protocol/schema violation",{duration:i,technicalError:t}),C.client.error({code:"INVALID_PAYLOAD",message:"Invalid response format from address selection",timestamp:Date.now()})):k.log("third_party_delivery_address_error","Address change failed with error",{duration:i,error:t}),re([{code:"GENERAL_ERROR"}]),void qn())}const{response:r}=a;if(!r||"object"!=typeof r)return k.log("embedder_invalid_response","Invalid or missing response from embedder",{event:"checkout.addressChangeStart",duration:i,receivedResponse:r}),C.client.error({code:"INVALID_PAYLOAD",message:"Invalid or missing response from address selection",timestamp:Date.now()}),re([{code:"GENERAL_ERROR"}]),void qn();if(r?.errors&&r.errors.length>0)return re(r.errors),k.log("embedder_error_cancelled_operation","Address change cancelled due to embedder errors",{event:"checkout.addressChangeStart",errorCodes:r.errors.map(e=>e.code),duration:i}),void qn();if(r?.cart){_(()=>{for(const e of Object.values(Z))e.value=void 0;Ke()});try{await C.client.applyCart(r.cart),Ae.dispatch("addressReplaced"),He.value?Gn():Yn(),k.log("address_change_start_success","Successfully applied address change from embedder",{duration:i}),Le.current?.focus()}catch(t){k.log("cart_update_failed_after_address_change","Failed to apply cart update after address change",{event:"checkout.addressChangeStart",error:t instanceof Error?t.message:String(t),duration:i}),C.client.error({code:"INVALID_CART",message:"Failed to apply cart update after address change",timestamp:Date.now()}
2),re([{code:"GENERAL_ERROR"}]),qn()}}else He.value?Gn():Yn()}catch(t){const e=performance.now()-n;k.log("third_party_delivery_address_error","Error delegating address change to embedder.",{error:t instanceof Error?t.message:String(t),duration:e}),re([{code:"GENERAL_ERROR"}]),qn()}},[He,X,C,k,re,P,Z,Me,Ae,Ke,jn,Wn,qn,Gn,Ie,Yn]),$n=f(async()=>{if(He.value)return;if(X.value){if(Ie.value)return;return void(await Kn())}const e=!Ie.value;!function({checkout:e,userEvents:n,shop:t,source:a},i){"shopPay"===e.identity.current.value&&n.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...At(a,e,t),action:i?"shipping_addresses_expand":"shipping_addresses_collapse"}})}({userEvents:E,source:I,checkout:O,shop:R},e),Ie.value=e},[He,E,I,O,R,Ie,Kn,X]);s(()=>{!X.value||!xe||xn.value||Hn.value?jn.value?Ie.value=!0:Fn.value&&!Hn.value&&(Ie.value=!1):Ie.value=!1},[Ie,X.value,xe,xn.value,jn.value,Fn.value,Hn.value]);const Jn=0===de.length&&0===he.length,Xn=1===ue.value.length&&ce.value&&Jn,Zn=p.value,Qn=!dn.value&&!ke.value&&!Mn.value&&on&&!(X.value&&te.value),et=X.value&&!Mn.value&&Q.value&&!te.value,nt=Qn||et,tt=(()=>{if(X.value){const{firstName:e,lastName:t}=T.value,i=!0,r=P.formatName(e,t,i);return n(V,{children:[e&&t&&n(x,{children:r}),n(a,{when:te,fallback:n(x,{color:"subdued",children:hn}),children:n(x,{tone:"critical",children:P.translate("address_management.address_form.add_address")})})]})}return c??hn})(),at=te.value?P.translate("shipping.add_shipping_address"):void 0,it=fe&&!jn.value?n(ql,{vatNumber:fe.taxId.value,onAdd:()=>{Ie.value=!0,Te.focus()}}):void 0,ot=an.value?n(B,{padding:"none base base base",children:n(Jc,{filteredFields:nn.value?[nn.value]:void 0})}):void 0,lt=ot&&it?n(V,{direction:"block",gap:"base",children:[ot,it]}):ot??it,st=n(Re,{tone:"info",children:P.translate("address_management.draft_order_delivery_address_reminder")}),ut=Fn.value&&!Hn.value||Mn.value?null:p.value?n(i,{children:[wn,st]}):En.value?wn:null,ct=an.value?{}:{primaryContent:Sn.primary,secondaryContent:Sn.secondary,compactContent:Sn.compact,inlinePrimaryContent:fn,inlineSecondaryContent:bn,compactPrimaryContent:_n,compactSecondaryContent:Pn,summary:tt},dt={buttonRef:Le,open:Ie.value,id:Oe,label:P.translate("shipping.shipping_address_title"),error:ut,buttonAccessibilityLabel:at,...ct,secondaryPersistentContent:lt,onToggle:Zn?void 0:$n,disabled:He.value||Xn||!Vn.value&&nt,renderChildrenWhenCollapsed:!0,icon:n(J,{id:"deliveryAddress-truckIcon",type:"truck",size:"fill"})},pt=n(Us,{embedderErrors:ae,onDismissEmbedderErrors:()=>re([]),showMissingAddressField:an.value,onAddressDelegation:Kn,onFirstNamePersisted:pn,vatIdFieldMode:Te});return n(i,{children:[H&&n(Wc,{}),l?l(dt,pt):n(ho,{...dt,children:pt})]})}const ld=({errorBanner:e})=>n(B,{paddingBlock:"small-500",children:e}),sd=({errorSignal:e})=>{const t=e.value;if(!t)return null;const a=t.type;switch(a){case"invalid-address-banner":case"default-vaulted-delivery-address-error-banner":case"validation-errors-banner":return n(ld,{errorBanner:t.element});case"unavailable-in-buyer-location-banner":return n(ld,{errorBanner:n(Ii,{})});default:A(a)}};function ud(){const{formattedAddress:e,address:{phone:t,countryCode:a}}=nn(["company"]),r=!N().value,{errorSignal:o}=Gc({loading:r,phone:t,countryCode:a}),l=Boolean(Uc()?.length),s=Boolean(tn()?.length),u=Boolean(o.value),c=Boolean(s||l||u);return n(od,{summary:r?n(D,{}):n(V,{direction:"inline",children:[c&&n(i,{children:[n(J,{tone:"critical",type:"alert-circle"}),n(he,{display:"inline",inlineSize:"small-400"})]}),e]}),forceOpen:c})}function cd(e){const{checkout:{identity:a}}=rt(),i=function(){const{checkout:{negotiator:e}}=rt(),n=e.current.fields.buyerIdentity,a=an(),i=rn();return t(()=>Boolean(n.value?.purchasingCompany)&&(!a.value||i.value))}();return"amazonPay"===a.current.value||"buyWithPrime"===a.current.value?n(ud,{}):i.value?n(_c,{}):n(od,{...e})}function dd(){const{i18n:e,router:i,checkout:{negotiator:r}}=rt(),o=r.current.fields.buyerIdentity.value?.purchasingCompany,l=Il(),s=rn(),u="deliveryAddress",c=t(()=>Js(i,u));return!o||o.contact.locationCount<=1||s.value?n(E,{id:u,level:1,autoFocus:c.value,children:e.translate("shipping.delivery_title")}):n(ee,{gridTemplateColumns:"@media (inline-size >= small) 'minmax(0, 1fr) minmax(auto, max-content)', 'minmax(0, 1fr)'",gap:"@media (inline-size >= small) base, none",alignItems:"@media (inline-size >= small) center, ''",alignContent:"@media (inline-size >= small) center, ''",justifyContent:"@media (inline-size >= small) start, ''",justifyItems:"@media (inline-size >= small) start, ''",children:[n(E,{id:u,level:1,autoFocus:c.value,children:e.translate("contact.ship_to_company",{companyName:o.location.name})}),n(a,{when:l,children:n(go,{})})]})}function pd(){const{i18n:e}=rt(),{eligibility:t,redeemableBalance:a,messages:i,isDigitalGoodsRedemptionAllowed:r}=vc(),o=(t.eligible||r)&&a,l=i.length>0?n(V,{gap:"small-200",children:i}):void 0;return o||l?o?n(hd,{redeemableBalance:a,messages:l}):n(ho,{id:"cashRedemption",open:!1,label:e.translate("order_summary.shop_cash_title"),error:l}):null}function hd({redeemableBalance:e,messages:t}){const{i18n:a}=rt(),{amount:i,checked:r,handleChange:o,disabled:l}=ac(e),s=e?a.formatCurrency(e.amount,{currency:e.currencyCode,form:"short"}):void 0;return n(ho,{id:"cashRedemption",open:!0,label:a.translate("order_summary.shop_cash_title"),primaryContent:s,error:t,primaryAction:n(Uu,{checked:r,onChange:o,disabled:l}),children:n(x,{fonts:"primary",tone:"accent",children:i})})}function md({onShowPickupLocations:e}={}){const{i18n:i}=rt(),r=ge(),[o]=on(),l=o.includes("PICK_UP"),{value:s}=ln().value,{value:u}=sn().value,c=Boolean(s||u),d=Ri({mode:"localPickup"}),p=t(()=>d.value.merchandiseLines),h=t(()=>d.value.allowAlternativeAction),m=t(()=>d.value.merchandiseLines.length>0),v=un(),y=c&&!m.value;if(!l||!r.value.delivery)return null;const g=m.value&&c;return n(Li,{name:"local-pickup-adjacent",variant:"adjacent",children:n(V,{gap:m.value?"base":"small-400",paddingBlockEnd:g?"base":void 0,children:[n(a,{when:v,children:n(B,{paddingBlockStart:"small-400",paddingBlockEnd:y?"small-400":void 0,children:n(E,{level:2,children:i.translate("delivery_options.pickup")})})}),n(a,{when:m,children:n(Ti,{bannerType:"pickup",merchandiseLines:p,allowAlternativeAction:h})}),n(vd,{hasNoDeliveryMethods:c,onShowPickupLocations:e})]})})}function vd({hasNoDeliveryMethods:e,onShowPickupLocations:r}){const{i18n:o}=rt(),l=un(),s=La(),{progressing:u}=fe(),c=Jt("deliveryNext").value,d=Vt(),{isOnlyCountryAvailable:p}=Ni(),h=y(!1),m=t(()=>s.value?.methods??[]),g=t(()=>{const e=s.value;return e&&Na(e)}),f=t(()=>m.value.length>0&&Di(m.value)),b=v(G(Da).hasViolations),_=Mi({allLocationsFarAway:f,selectedPickupOptionNoLongerAvailable:b}),C=cn({methods:m.value,selectedDeliveryMethodHandle:g.value?.handle}),P=t(()=>dn(s.value?.targetMerchandiseLines)),S=t(()=>Bi(m.value,p,P.value,o,{selectedDeliveryMethodHandle:g.value?.handle,allLocationsFarAway:f.value})),A=()=>{C(p?"checkout_pickup_geoselector_clicked_country_grain":"checkout_pickup_geoselector_clicked_other_grain"),r?r():h.value=!0};return e?null:n(i,{children:[n(a,{when:_,children:n(xi,{itemCount:P.value,methods:m.value,onChangeLocationClick:A})}),n(V,{direction:"inline",gap:"small-400",alignItems:"center",justifyContent:"space-between",paddingBlockStart:l.value?void 0:"small-200",paddingBlockEnd:l.value?"small":"small-200",children:[d.value&&!u.value&&c?n(D,{inl
2ineSize:"base"}):n(x,{color:"subdued",children:S}),n(Vi,{onClick:A})]}),r?null:n(Fi,{methods:s.value?.methods,type:s.value?.type,open:h.value,onClose:()=>{h.value=!1}})]})}const yd={isLocationFormVisible:!1};function gd({initiallyOpen:e=!1,renderRollup:a}){const{i18n:r,shop:o,checkout:{negotiator:l}}=rt(),{deliveryNext:s}=l.current.fields,{progressing:u}=fe(),c=Jt("deliveryNext"),d=Vt(),{value:p}=ln().value,{value:h}=sn().value,m=Boolean(p||h),v=La(),f=t(()=>Ma(s.value)??[]),_=t(()=>o.shipPickupInOneOrderEnabled?v.value&&Na(v.value):f.value[0]),C=t(()=>_.value?.handle??""),P=t(()=>({handle:C.value})),S=Hi(),{isOnlyCountryAvailable:A}=Ni(),k=Ce(_.value?.pickupLocation?.address,{hiddenFields:["postalCode","countryCode","phone"]}),E=U("Checkout::PickupLocations::RenderBefore"),w=U("Checkout::PickupLocations::RenderAfter"),O=U("purchase.checkout.pickup-location-option-item.render-after"),I=E.length>0?n(pn,{customizations:E,options:yd}):void 0,R=w.length>0?n(pn,{customizations:w,options:yd}):void 0,T=zi(),L=cn({methods:f.value||[],selectedDeliveryMethodHandle:_.value?.handle}),[N,M]=b(!1),B=y(e),x=y(!1),F=e=>{M(!0),x.value=e??!1},{currentAdditionalLocations:H,additionalLocationsCount:z}=function(e){const n=g(),a=t(()=>{const t=e.value?e.value.methods.length-1:void 0;return void 0!==t&&(n.current=t),t}),i=t(()=>a.value??n.current);return{currentAdditionalLocations:a,additionalLocationsCount:i}}(v),j=t(()=>Boolean(H.value)||d.value&&c.value&&0!==z.value);let G,Y,W,q,K;const $=T.value?n(V,{gap:"small-200",children:n(ji,{variant:"banner"})}):void 0;if(d.value&&!u.value&&c.value)G=n(D,{}),Y=n(D,{inlineSize:"base"}),W=n(D,{inlineSize:"small"}),K=$;else if(_.value?.pickupLocation){const{cost:{amount:e,currencyCode:t},pickupLocation:{name:a}}=_.value,o="PickupInStoreLocation"===_.value.pickupLocation?.type?_.value.pickupLocation.distanceFromBuyer:void 0,l=o&&!A?Ui(r,o):void 0,s=0===e?r.translate("shipping.free_rate_label"):r.formatCurrency(e,{currency:t}),u="PickupInStoreLocation"===_.value.pickupLocation.type&&_.value.pickupLocation.instructions.trim();G=n(i,{children:[a,n(Kl,{}),s]}),Y=k||void 0;const c=l||u?n(Yi,{distanceLabel:l,instructions:u||void 0}):null,d=O.length>0?n(pn,{customizations:O,options:P.value}):null;W=c&&d?n(V,{gap:"small-400",children:[c,d]}):c??d??void 0,q=I?n(V,{gap:"small-200",children:I}):void 0,K=$||R?n(V,{gap:"small-200",children:[$,R]}):void 0}const J=!c.value&&!0===m,X=m?n(Vi,{onClick:()=>{F(),L(A?"checkout_pickup_geoselector_clicked_country_grain":"checkout_pickup_geoselector_clicked_other_grain")},commandFor:Gi}):void 0,Z=j.value?n(fd,{locationCount:z.value,onShowModal:F,onTrackAnalytics:()=>L("checkout_pickup_buyer_reveal_more")}):void 0,Q=a?{id:"pickupLocations",label:r.translate("delivery_options.pickup"),open:B.value,disabled:J||O.length>0,onToggle:()=>{B.value=!B.value},primaryContent:G,secondaryContent:Y,primaryPersistentContent:q,secondaryPersistentContent:R}:{id:"pickupLocations",label:r.translate("local_pickup.title"),open:J,primaryContent:G,secondaryContent:Y,tertiaryContent:W,primaryPersistentContent:q,secondaryPersistentContent:K,primaryAction:X,secondaryActions:Z},ee=n(Gs,{onShowModal:F}),ne=a?n(V,{gap:"base",children:[n(Wl.Provider,{value:!1,children:n(md,{onShowPickupLocations:()=>F()})}),X,ee,Z]}):S&&ee;return n(i,{children:[a?a(Q,ne):n(ho,{...Q,children:ne}),n(Fi,{methods:v.value?.methods,type:v.value?.type,open:N,onClose:()=>{M(!1),x.value=!1},addressFocus:x})]})}function fd({locationCount:e,onShowModal:i,onTrackAnalytics:r}){const{progressing:o}=fe(),l=Jt("deliveryNext"),s=ln(),u=t(()=>o.value||!l.value&&!s.value.loading);return n(a,{when:u,fallback:n(D,{}),children:n(bd,{locationCount:e,onShowModal:i,onTrackAnalytics:r})})}function bd({locationCount:e,onShowModal:t,onTrackAnalytics:a}){const{i18n:i}=rt();return e?n(H,{variant:"plain",textDecoration:"none",inlineAlignment:"start",onClick:()=>{t(),a()},children:n(V,{direction:"inline",gap:"small-400",alignItems:"center",children:n(x,{type:"strong",children:e>20?i.translate("local_pickup.toggle_multiple_locations",{count:String(20)}):i.translate("local_pickup.toggle_more_locations",{count:e})})})}):null}function _d({destination:e}){const t=y(!1),a=y();return n(i,{children:[n("deliveryAddress"===e?cd:gd,{initiallyOpen:t.value,renderRollup:(e,n)=>(a.value={props:e,content:n},null)}),n(Cd,{rollup:a,switched:t})]})}function Cd({rollup:e,switched:t}){const a=e.value;return a?n(ho,{...a.props,children:n(V,{gap:"base",children:[n(Pd,{switched:t}),a.content]}
2)}):null}function Pd({switched:e}){const t=hn();return t?n(Wi,{options:t.options,selected:t.selected,select:n=>{e.value=!0,t.select(n)},showChangedBanner:!1}):null}const Sd=new Set(["SHIPPING","PICK_UP"]);function Ad(){const{checkout:e,shop:n}=rt(),a=v(hn()),i=n.hasFlagEnabled(Ba);return t(()=>"next"===a.value?.variant&&(!i||1===e.sections.availableToRender.value.filter(e=>"deliveryAddress"===e||"localPickupOptions"===e).length)&&function(e,n=[],t=[]){return"vaulted"===e&&n.every(({id:e})=>Sd.has(e))&&1===t.length&&Sd.has(t[0])}(e.configuration.deliveryMethodSelectorPlacement,a.value?.options.value,a.value?.selected.value))}const kd=()=>{const{i18n:e,checkout:{negotiator:t}}=rt(),a=y(!0),{value:i}=t.current.fields.optionalDuties,r=i?.buyerRefusesDuties?e.translate("shipping.duties_and_taxes_options.ddu_title"):e.translate("shipping.duties_and_taxes_options.ddp_title");return n(ho,{open:a.value,id:"optionalDuties",label:e.translate("shipping.duties_and_taxes_title"),primaryContent:r,onToggle:()=>a.value=!a.value,children:n(is,{})})};function Ed(){const{i18n:e,checkout:t}=rt(),a=t.negotiator.parts.shippingAddress.value,{deliveryNext:{value:i},buyerIdentity:{value:r}}=t.negotiator.current.fields,o=(t.proposal.facts.delivery??[])[0],l=r?.purchasingCompany,s=l?.location.name,u=Boolean(l)&&Boolean(s),c="unavailable"===i?.status?a:o?.deliveryAddress,d=Ce(c??void 0,{countryFormat:"explicit",displayName:u}),p=e.formatName(c?.firstName,c?.lastName,!0);if(o?.pickupAddress)return n(wd,{address:o.pickupAddress??void 0});const h=c?p:e.translate("review.blocks.no_address"),m=u?s:h,v=u?e.translate("review.blocks.no_address"):void 0,y=c?d:v;return n(ho,{id:"orderEditDeliveryAddress",label:e.translate("review.blocks.shipping_address_title"),primaryContent:m,secondaryContent:y})}function wd({address:e}){const{i18n:t}=rt(),a=Ce(e,{hiddenFields:["postalCode","countryCode","phone"]}),i=a?n(x,{children:a}):void 0;return n(ho,{id:"orderEditDeliveryAddress",label:t.translate("local_pickup.title"),primaryContent:i})}function Od(){const{i18n:e,checkout:t}=rt(),a=(t.proposal.facts.delivery??[])[0],i=a?.lines.filter(({deliveryChange:e,isFulfilled:n})=>"REMOVED"!==e&&!n).map(e=>n(yr,{line:e},e.title));return n(ho,{id:"orderEditShippingMethod",label:e.translate("shipping.title"),primaryContent:i})}function Id(){const{i18n:e,shopPay:n,checkout:a}=rt(),i=_t(),{paymentMethods:r}=a.negotiator.current.fields;return t(()=>function({i18n:e,shopPay:n,chargeAmount:t,numberOfPaymentTerms:a,installmentsUnavailable:i,paymentDue:r,installmentsConfig:o}){const l=ls(n),s=r?.currencyCode,u=o?.availableLoanTypes,c=t?e.formatCurrency(t,{currency:s,form:"short"}):void 0,{payNowLabel:d,payNowSubtitle:p}={payNowLabel:e.translate("installments.installments_pay_now"),payNowSubtitle:e.translate("installments.installments_pay_now_subtitle")},h=()=>2===a?e.translate("installments.pay_in_installments_subtitle.split_pay_2"):1===a?e.translate("installments.pay_in_installments_subtitle.split_pay_30"):e.translate("installments.pay_in_installments_subtitle.split_pay"),m="GBP"===s?e.translate("installments.pay_in_installments.gb"):"AUD"===s?e.translate("installments.pay_in_installments.au"):!i&&c&&u&&0!==u.length?u.includes("ZERO_PERCENT")?e.translate("installments.pay_in_installments.only_interest"):u.includes("INTEREST")&&u.includes("SPLIT_PAY")?e.translate("installments.pay_in_installments.all"):u.includes("INTEREST")?e.translate("installments.pay_in_installments.only_interest"):(g=c,2===a?e.translate("installments.pay_in_installments.only_split_pay_2",{amount:g}):1===a?e.translate("installments.pay_in_installments.only_split_pay_30",{amount:g}):e.translate("installments.pay_in_installments.only_split_pay",{amount:g})):2===a?e.translate("installments.pay_in_installments_no_amount_2"):1===a?e.translate("installments.pay_in_installments_no_amount_30"):e.translate("installments.pay_in_installments_no_amount"),v="GBP"===s?!i&&u&&c&&0!==u.length?2===a?h():u.includes("INTEREST")&&u.includes("SPLIT_PAY")?e.translate("installments.pay_in_installments_subtitle.split_pay_3_gb",{amount:c}):u.includes("ZERO_PERCENT")&&u.includes("SPLIT_PAY")&&(6===a||12===a)?e.translate("installments.pay_in_installments_subt
2itle.split_pay_3_6z_12z_gb",{amount:c}):u.includes("ZERO_PERCENT")&&12===a?e.translate("installments.pay_in_installments_subtitle.zero_percent_12z_gb",{amount:c}):u?.includes("ZERO_PERCENT")&&6===a?e.translate("installments.pay_in_installments_subtitle.zero_percent_6z_gb",{amount:c}):u.includes("INTEREST")?e.translate("installments.pay_in_installments_subtitle.informational_gb"):e.translate("installments.pay_in_installments_subtitle.split_pay_3_gb",{amount:c}):e.translate("installments.pay_in_installments_subtitle.informational_gb"):u&&c&&0!==u.length?u.includes("ZERO_PERCENT")?e.translate("installments.pay_in_installments_subtitle.interest"):u.includes("INTEREST")&&u.includes("SPLIT_PAY")?e.translate("installments.pay_in_installments_subtitle.all",{amount:c}):u.includes("INTEREST")?e.translate("installments.pay_in_installments_subtitle.interest"):h():h(),y="SHOP_PAY"===l;var g;return{payNowLabel:d,payNowSubtitle:p,installmentsLabel:m,installmentsSubtitle:v,summary:"SHOP_PAY"===l?`${d} - ${p}`:`${m} - ${v}`,primaryLabel:y?d:m,secondaryLabel:y?p:v}}({i18n:e,shopPay:n,chargeAmount:a.installments.chargeAmount.value,numberOfPaymentTerms:a.installments.numberOfPaymentTerms.value,installmentsUnavailable:a.installments.isUnavailable.value,paymentDue:i.value,installmentsConfig:xa(r.value)}))}function Rd(){const{userEvents:e}=rt(),n=mn(Va.SHOP_PAY_PAY_NOW),t=mn(Va.SHOP_PAY_INSTALLMENTS),a=mn(Va.SHOP_PAY_INSTALLMENTS_DEFAULTED),i=mn(Va.SHOP_PAY_PAY_NOW_DEFAULTED);return{recordRetailEvent:f(r=>{const o=function(){switch(r){case"payment_method_pay_now":return n;case"payment_method_installments":default:return t;case"default_payment_method_installments":return a;case"default_payment_method_pay_now":return i}}();return e.monorailEvent({schemaId:"retail_shop_pay/2.0",payload:o})},[e,n,t,a,i])}}function Td({onAutoExpand:e,ineligibilityReasonLabel:n}){const{source:a,checkout:i,shop:r,observability:o,userEvents:l,shopPay:u,embed:c}=rt(),{visibility:d}=u,p=i.installments.isSupported.value,h=i.installments.isUnavailable.value,m=vn(),v=ls(u),{paymentMethods:y}=i.negotiator.current.fields,f=t(()=>
2xa(y.value)),b=p?f.value?.availableLoanTypes:void 0,_=g(),C=vl(),P=u.user.installments.isRetryable.value,{recordRetailEvent:S}=Rd();s(()=>{n&&!P&&"SHOPIFY_INSTALLMENTS"===v&&u.session.unstable_updatePaymentMethodOption({type:"wallet",name:"SHOP_PAY"})},[P,n,v,u.session]),s(()=>{u.session.isInternalProgressing.value||p&&!h&&(!m.value&&d.showAutoExpandedPaymentMethods&&e?.(),C.value.spiPreselected&&(u.session.unstable_updatePaymentMethodOption({type:"wallet",name:"SHOPIFY_INSTALLMENTS"}),o.leaveErrorBreadcrumb("SPI preselected",{})))},[p,h,m.value,C.value.spiPreselected,u.session,o,d.showAutoExpandedPaymentMethods,e]),s(()=>{m.value&&p&&S(h?"default_payment_method_pay_now":"default_payment_method_installments")},[p,h,m.value,S]),s(()=>{!h&&b&&JSON.stringify(_.current)!==JSON.stringify(b)&&(l.monorailEvent({schemaId:"shopify_pay_payment_page_installments/1.4",payload:{...ul(a,i,r,{embedPlatform:c?.platform,shopAppSurface:u.app.config.surface}),eventType:Fa.InterestEligibility,success:Ha(b),errorMessage:Ha(b)?void 0:JSON.stringify(["amount"])}}),l.monorailEvent({schemaId:"shopify_pay_payment_page_installments/1.4",payload:{...ul(a,i,r,{embedPlatform:c?.platform,shopAppSurface:u.app.config.surface}),eventType:Fa.SplitPayEligibility,success:Boolean(b.includes("SPLIT_PAY")),errorMessage:b.includes("SPLIT_PAY")?void 0:JSON.stringify(["amount"])}}),_.current=b)},[b,h,l,a,i,r,c?.platform,u.app.config.surface])}function Ld(){const{i18n:e}=rt(),t=y(!1),a=Id(),i=yn(),r=f(()=>{t.value=!t.value},[t]);return Td({onAutoExpand:f(()=>{t.value=!0},[t]),ineligibilityReasonLabel:i}),n(ho,{open:t.value,id:"paymentOptions",label:e.translate("payment.payment_option.title"),primaryContent:a.value.primaryLabel,secondaryContent:a.value.secondaryLabel,onToggle:r,children:n(Ys,{ineligibilityReason:i})})}function Nd(){const{i18n:e}=rt();return n(ho,{label:e.translate("pickup_point.title"),open:!0,children:n(gn,{rowsInset:!0,children:n(qi,{heading:"none"})})})}function Dd(){const{userEvents:e,shop:n,source:t,checkout:a}=rt();return{trackOnDeliveryToggle:f(i=>{e.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.2",payload:{...At(t,a,n),action:i?"shipping_rates_expand":"shipping_rates_collapse"}})},[e,t,a,n]),trackSelectShippingMethod:f((i,r)=>{e.monorailEvent({schemaId:"shopify_pay_payment_page_select_shipping_rate/3.1",payload:{...At(t,a,n),currentRate:i.handle??"",currentRatePrice:`${i?.cost?.amount??0}`,isLocalDelivery:!i.pickupLocation&&"LOCAL"===i.methodType,isLocalPickup:Boolean(i.pickupLocation),previousRate:r?.handle,previousRatePrice:"number"==typeof r?.cost?.amount?`${r?.cost?.amount}`:void 0}})},[e,t,a,n])}}function Md({violations:e}){return t(()=>e.value.size>0)}const Bd=o({displayName:"ShippingGroupsSummary",load:()=>p(()=>e(()=>import("./17a5f1e4.C_2FUFrI.js"),__vite__mapDeps([126,1,2,3,4,5,6,7,8,9,10,11,93,94,95,127,85,20,21,17,22,18,23,66,42,67,68,69,70,71,40,41,43,44,45,46,47,48,49,50,72,51,39,73,74,75,76,77,78,79,80,81,56,82,83,84,86,96,97,98,99,100,101,102,103,12,13,14,15,16,19,24,25,26,27,28,29,30,31,32,33,36,37,38,104,105,57,106,107,108,87,109,54,110,111,112,113,114,115,91,92,116,117,118,119,62,120,61,121,122]))),renderLoading:()=>n(D,{})});function xd({lines:e,hideThumbnail:t,shippingTime:a}){const{i18n:r,checkout:o}=rt(),{deliveryExpectationLines:l}=ps(),s=o.configuration.layout.isOnePage.value,u=e=>{const t=e.methods.find(({handle:n})=>n===e.selectedDeliveryMethodHandle);if(!t)return null;const{handle:i,cost:o,costAfterDiscounts:u,brandedPromise:c,estimatedTimeInTransit:d}=t,p="LOCAL"===t.methodType,h=Boolean(t?.deliveryPredictionEligible),{deliveryExpectation:m}=_n(t,l||[],Boolean(h||c));return n(V,{gap:"small-400",children:n(B,{children:[n(hs,{methodTitle:Cn({deliveryMethod:t,localDelivery:p?r.translate("shipping.local_delivery"):void 0}),showInterpunct:!0,price:n(ms,{cost:o,costAfterDiscounts:u,inlineDiscount:!0})}),a?n(Q,{color:"subdued",size:s?void 0:"small",children:a}):n(vs,{deliveryMethod:t,deliveryExpectationLine:m,estimatedTimeInTransit:d,paragraphColor:"subdued"})]})},i)};return n(i,{children:e.map(e=>{const a=fn(e.targetMerchandiseLines??[]);return a.slice(0,1).map(i=>n(ee,{gridAutoFlow:"column",gridTemplateColumns:"minmax(auto, max-content) minmax(auto, max-content)",gridTemplateRows:"minmax(0, 1fr)",gap:"large-100",alignItems:"center",alignContent:"center",children:[!t&&(a.length>1?n(bn,{variant:"fan-legacy",merchandise:a,size:"small",useResponsiveImageSources:!0,useTitleAsAltTextFallback:!0}):n(ss,{merchandiseItem:i,hideBadge:!0})),u(e)]},i.id))})})}function Vd({deliveryNextValue:e}){const t=ja(e).filter(Pn);return t.length?n(ee,{gridAutoRows:"minmax(0, 1fr)",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",gap:"small-200",children:n(xd,{lines:t,hideThumbnail:1===t.length})}):null}function Fd({cost:e,costAfterDiscounts:t,hideDiscountedTotalOnShippingSelector:a,styleOverrides:i={}}){return e&&t?n(ms,{cost:e,costAfterDiscounts:t,inlineDiscount:!0,preDiscountCost:a,styleOverrides:i}):null}function Hd(){const{i18n:e,checkout:{identity:{current:t}}}=rt(),a=t.value,i="amazonPay"===a||"buyWithPrime"===a;return!N().value&&i?n(ho,{id:"amazonPayShippingMethods",label:e.translate("shipping.title"),primaryContent:n(D,{})}):n(zd,{})}function zd(){const{embed:e,i18n:a,checkout:r}=rt(),o=us(),{hasMultipleDeliveryGroups:l}=o.value,s=r.configuration.isAddressDelegationEnabled,{customizationsForRollupReveal:u}=cs({hasMultipleDeliveryGroups:l,targeted:!1,shouldHandleRollup:!0}).value,c=U("Checkout::ShippingMethodDetails::RenderAfter"),d=U("Checkout::ShippingMethodDetails::RenderExpanded"),{uiStateSignal:p}=ka(Qe),{hasViolations:m}
2=G(Ga),y=v(m),g=Qc(),b=Md(Sn(Ya)),_=t(()=>g.value&&b.value),C=un(),P=Io([...u,...c,...d],{lazyReveal:!0}),S="shippingMethod",A=Xs(S,P.peek()),k=v(qs(Ea([...u,...c,...d],"uiExtension").map(Mt),f(()=>{A.value=!0},[A])));h(()=>{P.value&&(A.value=!0)}),h(()=>{(y.value||_.value||!C.value&&function(e){if("filled"!==e.status)return!1;const n=["SHIPPING","LOCAL"];return e.deliveryLines.some(e=>{const t=Wa(e);return!!n.includes(t?.methodType||"")&&"available"===e.status&&e.hasDeliveryLineChange})}(p.value))&&(A.value=!0)});const E=function({identity:{current:e}}){const{trackOnDeliveryToggle:n}=Dd(),t=f(e=>{n(e)},[n]);return"shopPay"===e.value?t:void 0}({identity:r.identity}),w=f(()=>{const e=!A.value;E?.(e),A.value=e},[E,A]),{deliveryNext:O,shippingAddress:I}=r.negotiator.current.fields,{deliveryLines:R}=r.negotiator.parts,T=function({i18n:e,identity:{current:n}}){switch(n.value){case"amazonPay":case"buyWithPrime":case"businessCustomer":case"customerAccount":case"shopPay":return{addressIncompleteMessage:e.translate("shipping.method_summary.incomplete_address_selected"),addressInvalidMessage:e.translate("shipping_errors.invalid_shipping_method_summary")};default:return}}({i18n:a,identity:r.identity}),L=function({state:e,addressInvalidMessage:t,addressIncompleteMessage:a}){const{i18n:r,checkout:{negotiator:o}}=rt(),l=o.current.fields.deliveryNext,s=Jt("deliveryNext"),{deliveryExpectationLines:u}=ps(),{rollup:{secondaryContent:{typography:{color:c}={}}={}}={}}=me(),d=un(),p=c??"base",h="filled"===e.status?e.deliveryLines:void 0,m=$l({deliveryLines:h}),{hasViolations:v}=q(Ua),{hasViolations:y}
2=q(_a),g=n(V,{children:[n(D,{inlineSize:"base",size:"small"}),n(D,{inlineSize:"small",size:"extraSmall"})]});if("initial"===e.status||"loading"===e.status)return{compactPrimaryContent:n(D,{inlineSize:"base",size:"small"}),compactSecondaryContent:void 0,inlinePrimaryContent:g,inlineSecondaryContent:void 0,primaryContent:g,secondaryContent:void 0};if("empty"===e.status||"error"===e.status){const i=a??r.translate("shipping.method_summary.incomplete_address_entered"),o=t??r.translate("shipping.invalid_shipping_method_summary"),l=r.translate("shipping.different_shipping_method_summary");let s="empty"===e.status?i:o;v?s=i:y&&(s=l);const u=n(x,{children:s});return{compactPrimaryContent:u,compactSecondaryContent:void 0,inlinePrimaryContent:void 0,inlineSecondaryContent:u,primaryContent:u,secondaryContent:void 0}}if(za(l.value,d.value)){if(s.value)return{compactPrimaryContent:void 0,compactSecondaryContent:void 0,inlinePrimaryContent:void 0,inlineSecondaryContent:void 0,primaryContent:g,secondaryContent:void 0};let e=n(Bd,{});return m?e=n(Xl,{summary:m}):d.value&&(e=n(Vd,{deliveryNextValue:l.value})),{compactPrimaryContent:void 0,compactSecondaryContent:void 0,inlinePrimaryContent:void 0,inlineSecondaryContent:void 0,primaryContent:e,secondaryContent:m?n(Jl,{summary:m,secondaryContentColor:p}):void 0}}const f=d.value?e.deliveryLines.filter(Pn):e.deliveryLines,b=Po(f);if(!b)return{compactPrimaryContent:void 0,compactSecondaryContent:void 0,inlinePrimaryContent:void 0,inlineSecondaryContent:void 0,primaryContent:void 0,secondaryContent:void 0};const{costAfterDiscounts:_,cost:C,hideDiscountedTotalOnShippingSelector:P}=b,S=Cn({deliveryMethod:b,localDelivery:"LOCAL"===b.methodType?r.translate("shipping.local_delivery"):void 0}),A=u?.find(e=>e.deliveryStrategyHandle===b.handle),k=n(hs,{methodTitle:S,showInterpunct:!0,price:C&&_?n(Fd,{cost:C,costAfterDiscounts:_,hideDiscountedTotalOnShippingSelector:P}):void 0}),E=n(vs,{deliveryMethod:b,deliveryExpectationLine:A,paragraphColor:c??"base"});return{compactPrimaryContent:n(x,{type:"strong",children:n(hs,{methodTitle:S})}),compactSecondaryContent:n(i,{children:[n(vs,{deliveryMethod:b,deliveryExpectationLine:A,paragraphColor:c,formatContent:e=>e?n(V,{display:"inline",direction:"inline",columnGap:"none",alignItems:"center",children:["(",e,")"]}):null}),n(x,{color:c,children:n(Fd,{cost:C,costAfterDiscounts:_,hideDiscountedTotalOnShippingSelector:P,styleOverrides:{shouldBold:!1}})})]}),inlinePrimaryContent:k,inlineSecondaryContent:E,primaryContent:k,secondaryContent:E}}({state:p.value,addressIncompleteMessage:T?.addressIncompleteMessage,addressInvalidMessage:T?.addressInvalidMessage}),N=(()=>{switch(e?.embedder){case"amazon":{const{compactPrimaryContent:e,compactSecondaryContent:t}=L;return void 0===e&&void 0===t?{primary:L.primaryContent,secondary:L.secondaryContent}:{compact:n(V,{direction:"inline",gap:"small-400",alignItems:"center",children:[e,t]})}}case"google":return{primary:L.inlinePrimaryContent,secondary:L.inlineSecondaryContent};default:return{primary:L.primaryContent,secondary:L.secondaryContent}}})();h(()=>{const e=function(e,n,t){return qa(e).some(({line:e,method:a})=>{if("SHIPPING"!==a?.methodType&&"LOCAL"!==a?.methodType)return!1;if(!a?.phoneRequired)return!1;const i=n.find(n=>{const t=n.peek();return t.type===e.type&&t.id===e.id}),r=i?.fields.deliveryMethodOptions.value.phone?.value;return!r&&!t})}(O.value,R.value,I.value?.phone);e&&(A.value=!0)});const M=t(()=>("error"===p.value.status||"empty"===p.value.status)&&!(P.value||k.value));return h(()=>{M.value&&(A.value=!1)}),n(ho,{open:A.value,id:S,label:a.translate("shipping.title"),primaryContent:N.primary,secondaryContent:N.secondary,compactContent:N.compact,onToggle:s&&"empty"===p.value.status||M.value?void 0:w,renderChildrenWhenCollapsed:!0,icon:n(J,{id:"shippingMethod-packageDeliveryIcon",type:"package-delivery",size:"fill"}),children:n(zs,{singleDeliveryGroup:o})})}const jd={rollup:{label:{visibility:"visible"},blockAlignment:"center"}},Ud={rollup:{label:{visibility:"hidden"},blockAlignment:"center"}},Gd={SHIPPING:{id:"shippingMerchandiseList"},PICK_UP:{id:"pickupMerchandiseList"}};function Yd({selectedDeliveryMethodType:e}){const{i18n:i}=rt(),r=un(),{showOverlay:o}=An(),l=y(!1),s=Gd[e],u=Ki(e),{visibleSummary:c,isNegotiating:d}=$i(u),p=Vt(),{shouldOpenModal:h}=Ji(),m=t(()=>{const e=c.value;return e?e.isAllItems?i.translate("split_delivery.all_items"):i.translate("split_delivery.items_count",{count:e.totalItemCount}):""}),v="PICK_UP"===e?i.translate("delivery_options.pick_up"):i.translate("delivery_options.ship"),g=n(a,{when:()=>!(void 0===c.value||p.value&&d.value),fallback:n(D,{}),children:n(x,{children:m})}),f=n(bn,{variant:"fan-legacy",sortByPrice:!0,merchandise:c.value?.merchandiseLines??[],size:"small"});if(h.value)return n(uo,{theme:jd,children:n(ho,{id:s.id,label:v,thumbnail:f,onClick:()=>o(Xi),primaryContent:g})});const b=l.value||r.value;return n(uo,{theme:b?Ud:jd,children:n(ho,{id:s.id,label:v,thumbnail:f,open:b,onToggle:b?void 0:()=>{l.value=!l.value},primaryContent:g,children:n(Zi,{title:"PICK_UP"===e?i.translate("split_delivery.items_for_pickup"):i.translate("split_delivery.items_for_shipping"),selectedDeliveryMethodType:e})})})}function Wd(){const{rollup:e}=me(),{padding:t}=ti({padding:[e?.blockPadding??"base",e?.inlinePadding??"base"]});return n(B,{padding:t,children:n(dd,{})})}function qd({hideLastDivider:e,showTopDivider:i,stripBlockEndPadding:r}){const o=ge(),{negotiate:l}=fe(),{checkout:u,embed:c,shop:d,source:p}=rt(),h=Qi(),m=t(()=>o.value.delivery&&u.isShippingRequired.value),v=t(()=>m.value&&h.value),y=Ka({checkout:u}),g=t(()=>o.value.contact&&u.configuration.showContactInformation),f=[...t(()=>ii({isContactVaulted:o.value.contact,configuration:u.configuration,identity:u.identity,embed:c,shop:d})).value?[n(jc,{},"contact")]:[],...m.value?[n(cd,{},"delivery")]:[],...function(e){if(xt(p))return o.value.payment?[n(Ru,{},"payment")]:[];const t=[];
2return y&&t.push(n(Cc,{isAbovePaymentSummary:!0},"businessCustomerBilling")),o.value.payment&&(t.push(n(Ru,{},"payment")),e.configuration.visibility.showCashRedemption.value&&t.push(n(gc,{},"cashRedemption")),o.value.billing&&!y&&t.push(n(Cc,{},"billingAddress"))),t}(u)],b=f.length>0||g.value;var _;return s(()=>{_&&Vs().catch(()=>{})},[_=b]),function({hasSections:e,identity:n,wallets:t,negotiate:a}){s(()=>{e&&function({identity:e,wallets:n}){return"amazonPay"!==e.current.value&&"buyWithPrime"!==e.current.value&&!n.activeSession.value}({identity:n,wallets:t})&&a({silenceViolations:["all"]})},[])}({hasSections:b,identity:u.identity,wallets:u.wallets,negotiate:l}),0===f.length?null:n(B,{children:[n(Bs,{children:n($d,{hideLastDivider:e,showTopDivider:i,stripBlockEndPadding:r})}),n(a,{when:()=>o.value.payment,children:n(zu,{})}),n(a,{when:v,children:n(er,{})})]})}function Kd({sections:e,hideLastDivider:t,showTopDivider:a,stripBlockEndPadding:i}){const{checkout:{identity:r},shop:o}=rt(),l=function(e,n){return"guest"===e.current.value||"businessCustomer"===e.current.value&&n}(r,ge().value.payment),{vaulted:{spacing:s="none",cornerRadius:u,divider:{borderWidth:c="base",borderStyle:d="base",borderColor:p,visibility:h="visible"}={}}={}}=me(),{main:{section:m}}=ye(),{rendered:v}=wn(),y=o.hasFlagEnabled(la),g=!l&&!as(t),f=v?.padding,{blockStart:b,blockEnd:_}=function(e){if(null==e)return{blockStart:!1,blockEnd:!1};const n=Array.isArray(e)?e[0]:e;let t=Array.isArray(e)?e[0]:e;return Array.isArray(e)&&4===e.length&&(t=e[2]),{blockStart:Jd(n),blockEnd:Jd(t)}}(y?void 0:f);return 0===e.length?null:n("div",{className:P("K6vpG",as(a)&&"CU3YS",g&&"_5HWz9",b&&"r8rqQ",(_||i)&&"_2Ojsq"),style:Xd({spacing:s,borderWidth:c,borderStyle:d,borderColor:p??"base",visibility:h,cornerRadius:m?.cornerRadius??u}),children:e})}function $d({hideLastDivider:e,showTopDivider:t,stripBlockEndPadding:a}){const r=function(){const e=ge(),{checkout:t,shop:a,embed:r,i18n:o,source:l}=rt(),{identity:s,identity:{current:c}}=t,d=c.value,p=a.hasFlagEnabled(Ba),h=a.hasFlagEnabled(la),m=kn(),v=En(),y=Ka({checkout:t}),g=m.value&&!v.value,f=un(),b=Qi(),_=void 0!==La().value,C=Jt("deliveryNext"),P=Vt(),{deliveryLines:A}=t.negotiator.parts,k=$a(A.value??[]).filter(e=>e.requiresShipping).length>0,w=Ki("PICK_UP").value.length>0,O=function(){const{eligibility:e,messages:n,redeemableBalance:t,discountOffer:a,shopPromotionDiscounts:i,isDigitalGoodsRedemptionAllowed:r}=yc(),o=$u();if((e.eligible||r)&&t)return!0;const l=a?.value?.redeemableAmount,s=i.length>0;return!(!e.eligible||!l&&!s)||!!el.some(e=>Ku(o.value,e))||n.length>0}(),I=u(()=>({isSplitShipAndPickup:f.value,isBusinessCustomerSingleChoiceMode:g,businessCustomerCannotProvideShippingAddress:m.value,redemptionEligibilityVisible:O,shouldAllowInlineSplit:b.value,hasShippingMerchandiseLines:k,hasLocalPickupDeliveryLine:_,hasPickupMerchandiseToDisplay:w,deliveryNextLoading:P.value&&C.value}),[f.value,g,m.value,O,b.value,k,_,w,P.value,C.value]),R=I.isSplitShipAndPickup?Ja:Xa,T=R[d]??R.default,L=Ad(),N=e=>!L.value||"deliveryAddress"!==e&&"localPickupOptions"!==e?e:"deliveryDestination",D=e=>{switch(e){case"contact":return n(jc,{},e);case"businessCustomerSingleChoice":return n(_c,{},e);case"orderEditDeliveryAddress":return n(Ed,{},e);case"orderEditShippingMethod":return n(Od,{},e);case"deliveryAddress":return L.value?n(_d,{destination:e}):n(cd,{},e);case"shippingMerchandiseList":return n(Yd,{selectedDeliveryMethodType:"SHIPPING"},e);case"shippingMethods":return n(Hd,{},e);case"pickupMerchandiseList":return n(Yd,{selectedDeliveryMethodType:"PICK_UP"},e);case"localPickupOptions":return L.value?n(_d,{destination:e}):n(gd,{},e);case"pickupPoint":return n(Nd,{},e);case"dutyOptions":return n(kd,{},e);case"paymentOptions":return n(Ld,{},e);case"payment":return n(Ru,{},e);case"billing":return n(Cc,{isAbovePaymentSummary:y},e);case"cashRedemption":return n(pd,{},e);default:return n(i,{})}};S(()=>{p&&t.sections.unstable_providePreactContext(I)},[p,t.sections,I]);const M={configuration:t.configuration,installments:t.installments,isShippingRequired:t.isShippingRequired,vaultedSections:p?t.vaultedSections:{signal:e},source:l,proposal:t.proposal,identity:s,shop:a,embed:r}
2,B=p?t.sections.availableToRenderGrouped.value:Za(Qa(T.filter(e=>ei[e].shouldRender({preactContext:I,concepts:M})),{preactContext:I,concepts:M}));let x=!1;return B.filter(e=>e.length>0).map(e=>{const a=[];for(const{sectionId:o,groupId:l}of e){const e=D(o);null!=l&&ni.has(l)?(!x&&t.configuration.visibility.showDeliveryHeading.value&&(a.push(n(h?Wd:dd,{},"deliveryHeading")),x=!0),a.push(n(de,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(Li,{name:o,children:e})},N(o)))):a.push(e)}const i=e[0]?.groupId,r=function(e,t,a){if(t.isSplitShipAndPickup)return"shipping"===e?n(E,{level:2,children:a.translate("delivery_options.ship_to_address")}):void 0}(i,I,o);return{groupId:i,header:r,elements:a}})}(),o=un();if(0===r.length)return null;const l=r.length>1&&o.value;return n(i,{children:l?n(V,{gap:"large-200",children:r.map(({groupId:o,header:l,elements:s},u)=>{const c=0===u,d=u===r.length-1,p=n(oo,{hideDivider:"always",children:n(Kd,{sections:s,hideLastDivider:!d||as(e),showTopDivider:c&&as(t),stripBlockEndPadding:d&&a})});return l?n(V,{gap:"base",children:[l,p]},o):n(i,{children:p},o)})}):n(Kd,{sections:r.flatMap(e=>e.elements),hideLastDivider:e,showTopDivider:t,stripBlockEndPadding:a})})}function Jd(e){return null!=e&&"none"!==e}function Xd({spacing:e,borderWidth:n,borderStyle:t,borderColor:a,visibility:i,cornerRadius:r}){const o=Zd[e],l={none:"0px",...ai.borderWidth},s={base:ai.color.default.border,transparent:"transparent"},u="hidden"===i?"0px":l[n];return{"--vaulted-divider-width":u,"--vaulted-divider-style":Qd[t],"--vaulted-divider-color":s[a],"--vaulted-spacing":o,"--divider-offset":`calc((${o} + calc(${u} * 2)) / 2)`,"--vaulted-corner-radius":r?ai.borderRadius[r]:void 0}}const Zd={none:"0px",...ai.spacing},Qd={base:"solid",dashed:"dashed",dotted:"dotted"};function ep(){const{methods:e}=On(),{userEvents:n,shop:t,source:a,checkout:i}=rt(),r="shopPay"===i.identity.current.value;h(()=>
2{if(r)for(const r of e.value)m(()=>n.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...At(a,i,t),action:`delivery_method_${r.toLowerCase()}_selected`}}))})}function np(){ep();const{shop:e,i18n:t,checkout:a}=rt(),i=hn(),r=Ad(),o=!e.hasFlagEnabled(ri),l=!a.configuration.visibility.showDeliveryHeading.value&&!o;if(!i)return null;if(r.value)return n(nr,{});const s=t.translate("shipping.delivery_title");return n(Wl.Provider,{value:!0,children:n(Fo,{presentation:"base",children:n(B,{padding:o?"none":"base none",accessibilityLabel:s,className:o?"_5hYUU":void 0,children:n(V,{gap:"base",children:[l&&n(x,{color:"subdued",children:s}),n(tr,{})]})})})})}function tp(){const{source:e}=rt(),t=ge(),a=In(),r=hn(),o=Ad();return xt(e)||!t.value.delivery?null:n(i,{children:[n(np,{}),a.value&&r&&!o.value?n(he,{blockSize:"base"}):null]})}function ap({placement:e}){const{checkout:a,embed:i,shop:r,shopPay:o}=rt(),{current:l}=a.identity,s=ge(),u=oi(),c=ys();return t(()=>li({configuration:a.configuration,identity:a.identity,shop:r,shopPay:o,embed:i,vaultedSections:s.value,isShippingRequired:a.isShippingRequired.value,hasSellingPlan:u.value,phoneCountryCode:c.value})).value!==e?null:n(ip,{vaultedContactTypeOverride:"sdkCartHints"===l.value?"base":void 0})}function ip({vaultedContactTypeOverride:e}){const t=Vc();Fc(t);const r=y(!1),o=Vt(),{embed:l}=rt(),s=t.displayOptions,u="base"===s.vaultedContactType,c="rollup"===s.vaultedContactType?e??"rollup":s.vaultedContactType,d=u?s.contentLayout:void 0,p="rollup"===s.vaultedContactType&&"base"===c;if("base"!==c)return null;const h=t.logo;let m=null;return(p&&t.hasError||u)&&(m=s.children??null),n(i,{children:[n(zc,{emailAddress:t.displayContent.contact,phone:t.displayPhone,logo:h,moreOptions:t.moreOptions,emailAlignment:p&&t.isEmbeddedPartner&&!l?.interstitialPartnerProfileIconUrl?"start":void 0,layout:p?void 0:d,children:m}),t.showShopPayVerification&&n(a,{when:o,children:n(wi,{email:t.email??"",open:r.value,showPopover:e=>{r.value=e}})})]})}function rp({showDelivery:e,insideVaultedCard:t}){const{embed:r,shop:o}=rt(),l=Ad(),{rollup:{inlinePadding:s}}=me(),u=n(i,{children:[n(ap,{placement:"vaulted-adjacent"}),n(a,{when:e,children:n(tp,{})}),n(a,{when:()=>!l.value,children:n(md,{})})]}),c=jt(r?.embedder);if(o.hasFlagEnabled(la)){if(!c&&!t?.value)return u;const{padding:e}=ti({padding:["none",s??"base"]});return n(B,{padding:e,children:u})}const d=c?`none ${Gt(s)??"none"}`:void 0;return c?n(B,{padding:d,children:u}):u}const op=(e,n)=>{if(e.length!==n.length)return!1;const t=[...e];return n.every(e=>{const n=t.findIndex(n=>n.promotionId===e.promotionId&&Gu(n.destinationAmount,e.availableBalance));return-1!==n&&(t.splice(n,1),!0)})};function lp(e,n,t,a){const i=e?.status;return"pending"===i||(t||a)&&("filled"===i||n)}const sp=({discountOffer:e,eligibility:n,shopPromotionDiscounts:a,enabled:i=!0})=>{const r=Yu({enabled:i}),o=Zu({enabled:i}),{recordRedemptionAutomaticallyApplied:l,recordRedemptionAutomaticallyRemoved:c}=cc(),d=g(),p=$u();!function(e,n=!0,a){const{setShopOfferReconciliationPending:i}=rt().shopPay,r=function(e,n){const a=v(e),i=v(n),r=$u(),{checkout:{negotiator:o}}=rt(),{shopDiscountOffer:l,shopPromotion:s}=o.current.fields,u=o.loading;return t(()=>{const e=r.value,n=a.value.eligible,t=u.value,o=t.has("discountLines"),c=t.has("shopCashBalance"),d=i.value;if(void 0!==d){const a=e.SHOP_PROMOTION,i=a.length>0;if(lp(s.value,i,o,t.has("shopPromotion")))return!0;if(d?.length){if(n?!op(a,d):i||c)return!0}else if(i)return!0}const p=l.value,h=e.SHOP_DISCOUNT_OFFER?.destinationAmount;if(lp(p,null!=h,o,t.has("shopDiscountOffer")))return!0;const m=Tu(p)?.redeemableAmount;return null==h?null!=m&&(n||c):!n||null==m||!Gu(h,m)})}(e,a);S(()=>{if(!n)return;const e=r.subscribe(i);return()=>{e(),i(!1)}},[n,r,i])}(n,i,a);const h=u(()=>{const t=p.value.SHOP_DISCOUNT_OFFER?.destinationAmount;return e?Gu(t,e.redeemableAmount)||!n.eligible&&e.redeemableAmount?void 0:{SHOP_DISCOUNT_OFFER:e.redeemableAmount?{type:"SHOP_DISCOUNT_OFFER",amount:e.redeemableAmount,promotionId:null}:null}:t?{SHOP_DISCOUNT_OFFER:null}:void 0},[e,p.value.SHOP_DISCOUNT_OFFER?.destinationAmount,n.eligible]),m=u(()=>{if(void 0===a)return;const e=p.value.SHOP_PROMOTION;return a&&0!==a.length?!op(e,a)&&n.eligible?{SHOP_PROMOTION:a.map(e=>({type:"SHOP_PROMOTION",amount:e.availableBalance,promotionId:e.promotionId}))}:void 0:e.length>0?{SHOP_PROMOTION:null}:void 0},[a,p.value.SHOP_PROMOTION,n.eligible]),y=u(()=>{if(h||m)return{...h,...m}},[h,m]);s(()=>{i&&y?r&&d.current!==y&&o(y,{onNegotiateAccepted:()=>
2{d.current=y,Object.entries(y).forEach(([e,n])=>{(n?l:c)(e,"useApplyAutomaticRedemptions")})}}):d.current=void 0},[i,r,y])};function up({active:e,ready:t}){const{i18n:a}=rt(),i=e.value&&!t.value?a.translate("general.loading"):null;return n(B,{accessibilityRole:"status",accessibilityVisibility:"exclusive",children:i})}const cp=o({displayName:"BelowTheFoldContent",renderLoading:function(){return n(B,{"aria-busy":!0,padding:"large-200 none",children:n(V,{gap:"base",children:[n(D,{inlineSize:"large"}),n(D,{inlineSize:"base"}),n(Oe,{contentDisplay:"block",blockSize:"48px"})]})})},load:()=>p(()=>e(()=>import("./7aefefff.CUtCwl2P.js"),__vite__mapDeps([128,1,2,3,4,5,6,7,8,9,10,11,129,130,131,40,41,42,43,44,45,46,17,47,48,49,21,22,18,50,35,26,36,37,38,39,12,13,14,15,16,19,20,23,24,25,27,28,29,30,31,32,33,51,52,53,54,55,56,57,58,132,133,134,81,135,96,97,98,74,75,99,100,101,67,68,102,103,136,77,137,138,139,140,141,142,143,144,73,76,145,146,147,59,148,64,65,66,69,70,71,72,78,79,80,82,83,84,85,86,61,87,88,89,105,149,106,150,104,107,108,109,110,93,94,95,111,112,113,114,115,91,92,116,117,118,119,62,120,121,122,151]))),renderError(e){throw e}});function dp({children:e,fillAvailableBlockSize:t,ready:a}){const{checkout:i}=rt(),{progress:r}=fe(),o=fs(),l=f(()=>{r("one-page-form-submit",void 0,{skipToCompletion:o.value})},[r,o]),s=gr(l);return n(Rn,{disabled:!a.value,onSubmit:s,contentsClassName:t?"ifz7X":void 0,children:e},i.identity.current.value)}function pp({loading:e,lineItems:t,onClose:a}){const{i18n:i,url:r,checkout:{configuration:{allowRedirectToStorefront:o},negotiator:l}}=rt(),{checkoutProtocolModalEventSignal:u}=l.context,c=n(H,{variant:"primary",onClick:a,children:i.translate("stock.continue_cta_label")}),d=o&&n(R,{href:r.cart(),children:i.translate("stock.return_to_store_label")});return s(()=>()=>{u.value="none"},[u]),n(Ln,{heading:i.translate("stock.price_update.title"),open:!0,onShow:()=>{u.value="priceChange"},onHide:a,size:"large",children:n(V,{gap:"large-200",children:[n(Q,{children:i.translate("stock.price_update.description")}),n(B,{children:n(_s,{loading:e,lineItems:t,type:Tn.PriceChange})}),n(V,{direction:"inline",gap:"large-300",alignItems:"center",justifyContent:"end",children:[d,c]})]})})}function hp(e){return e.some(e=>"MERCHANDISE_EXPECTED_PRICE_MISMATCH"===e.code)}function mp(){const{checkout:{wallets:e,negotiator:i}}=rt(),r=function(){const{checkout:{negotiator:e}}=rt(),n=Jt("merchandiseLines"),a=e.parts.merchandiseLines,i=y(m(()=>a.value));return t(()=>{const t=e.current.fields.allViolations.value,a=hp(t??[]),r=e.current.fields.merchandiseLines.value,o=n.value,l=r?.lines??[],s=i.value,u=Nn(s,l,t,Dn).map(({proposed:e,negotiated:n})=>({line:e??n,problem:{type:Tn.PriceChange,negotiatedPrice:n?.itemPrice,proposedPrice:e?.itemPrice}}));return{hasViolation:a,loading:o,lineItems:u,updateProposal:()=>{u.length>0&&(i.value=l)}}})}(),o=Mn(),l=g(!1),s=t(()=>i.current.fields.allViolations.value?.some(e=>si.has(e.code))),u=t(()=>!s.value&&r.value.hasViolation&&r.value.lineItems.length>0),c=t(()=>{const n=r.value;return u.value?l.current=!0:l.current&&!n.loading&&0===n.lineItems.length&&(l.current=!1),!e.activeSession.value&&l.current&&n.lineItems.length>0?n:void 0});h(()=>{u.value&&o("inventoryPriceChange",{element:{tagName:"modal"},timestamp:new Date,visible:!0})});const d=f(()=>{l.current=!1,r.value.updateProposal()},[r]);return n(a,{when:c,children:e=>n(pp,{loading:e.loading,lineItems:e.lineItems,onClose:d})})}function vp(){const{i18n:e,shop:t}=rt(),a=Bn(t.storefrontUrl)?.replace(/-/g,"‑");return a?n("strong",{"data-testid":"referral-title",className:"LaXGo",children:e.translate("merchant_redirect.referral_title",{merchant_url:a})}):null}function yp(){const{checkout:e,embed:a,shopPay:r}=rt(),o=bs(),l=fs(),s=ge(),u="webview-rendered"===r.config.isReferral,c=a?.isFlagshipPartner??!1,d=t(()=>s.value.contact&&e.configuration.showContactInformation||s.value.delivery||s.value.payment).value,p=o.value,h=p||l.value||u;return d&&h?n(i,{children:[p?n(Zl,{}):null,l.value?n(Ql,{isVaultedReview:!0}):null,u?n(vp,{}):null,h&&!c?n(he,{blockSize:"base"}):null]}):null}function gp(){const{embed:e,shop:t}=rt();return a=>
2!e?.isFlagshipPartner||jt(e.embedder)||Ht({embedder:e.embedder,shop:t})?a:n(gn,{children:a})}function fp({showEmailMarketingOptIn:e,showPhoneMarketingOptIn:i,aboveFoldSpacing:r,paddingBlockStart:o,children:l}){const s=ar(),u=t(()=>i?.value??s.value.isRoot),c=t(()=>e.value||u.value),d=t(()=>e.value&&u.value),p=t(()=>d.value?r?"small-200":"base":"none"),h=t(()=>r?"large-200 none large-200 none":`${o?.value??"none"} none base none`);return n(a,{when:c,fallback:l,children:()=>n(de,{target:"cart.buyerIdentity",children:n(V,{gap:r?"small-200":"base",padding:h.value,children:[n(V,{gap:p.value,children:[n(a,{when:e,children:n(ir,{origin:"payment_page"})}),n(a,{when:u,children:n(rr,{})})]}),l]})})})}function bp({extensions:e,hideDivider:t="always"}){const a=gp();return n(pn,{gap:"base",customizations:as(e),render:(e,i)=>i?a(n(oo,{hideDivider:t,children:e})):e})}function _p(e){const{i18n:n}=rt(),t=f(e=>e.reduce((t,a,i)=>i===e.length-1?n.translate("shipping.shipping_method_combinations.combination",{rest:t,current:a}):n.translate("shipping.shipping_method_combinations.with_separator",{rest:t,current:a}),""),[n]);return u(()=>{if(!ui(e))return[];const a=ja(e);return function(e,n){const t=(n||[]).filter(ci).map(ns);return ts(t).filter(e=>e.length>0).map(n=>function(e,n){return{...di(e)??e[0],title:mi(e,n),cost:hi(e),costAfterDiscounts:pi(e)}}(n,e))}({businessDays:e=>n.translate("shipping.estimated_delivery_date",{count:e}),businessDaysRange:(e,t)=>
2n.translate("shipping.estimated_delivery_date_range",{minimum:e,maximum:t}),subscriptionsOnlyShippingTitle:n.translate("shipping.subscription_shipping"),combineTwoShippingTitles:(e,t)=>n.translate("shipping.shipping_method_combinations.combination",{rest:e,current:t}),combineMultipleShippingTitles:t,localDeliveryTitle:n.translate("shipping.local_delivery")},a)},[t,e,n])}function Cp(){const{shopPay:e,checkout:{negotiator:n}}=rt(),{value:t}=n.current.fields.deliveryNext,a=Jt("deliveryNext").value,i=vi(t,"ONE_TIME_PURCHASE",!0),r=u(()=>i&&"available"===i.status?i.methods:[],[i]),o=_p(t),l=ui(t)?o:r,c=u(()=>l.reduce((e,n)=>{const t="LOCAL"===n.methodType?"SHIPPING":n.methodType;return"PICK_UP"===t||"SHIPPING"===t?{...e,[t]:[...e[t],n]}:e},{SHIPPING:[],PICK_UP:[]}),[l]),[d,p]=b(!0),h=e.session.selectedShippingAddress.value;s(()=>{p(!0)},[h]),s(()=>{a||p(!1)},[a]);const[,m]=b(),v=rs(m);return{methodsByType:c,availableDeliveryMethods:l,availableDeliveryMethodsLoading:d,progressiveShippingRatesLoading:v}}function Pp({onChange:e,prerequisitesLoading:n}){const{checkout:{negotiator:t}}=rt(),{value:a}=t.current.fields.deliveryNext,i=Jt("deliveryNext").value,r=vi(a,"ONE_TIME_PURCHASE",!0),o=_p(a),[l]=xn({type:r?.type}),c=u(()=>{if(!n&&!i&&l&&null!=r&&"available"===r.status)return ui(a)?o.find(e=>e.handle===l):r.methods.find(e=>e.handle===l)},[n,i,l,r,a,o]),d=g(c);return s(()=>{c&&d.current&&d.current.handle!==c.handle&&e(c,d.current),d.current=c},[c,e]),{selectedDeliveryMethod:c}}function Sp(){const{i18n:e}=rt(),{availableDeliveryMethodsLoading:n,progressiveShippingRatesLoading:t}=Cp(),a=n&&!t,{selectedDeliveryMethod:i}=Pp({onChange:()=>{},prerequisitesLoading:n||a}),r=i?e.translate("order_summary.updated_shipping_method",{shipping_method:i.title}):void 0,o=g(r);return s(()=>{const e=o.current;if(o.current=r,r&&r!==e)return K({content:r})},[r]),null}function Ap(){return Vn("ONE_TIME_PURCHASE")?n(Sp,{}):null}function kp({includeContact:e=!0}={}){const n=ge(),a=v(U("Checkout::Dynamic::Render","INFORMATION1")),i=v(U("Checkout::Dynamic::Render","INFORMATION2")),r=v(U("Checkout::Dynamic::Render","DELIVERY1")),o=v(U("Checkout::Dynamic::Render","DELIVERY2")),l=v(U("Checkout::Dynamic::Render","PAYMENT1")),s=v(U("Checkout::Dynamic::Render","PAYMENT2")),u=v(U("Checkout::Dynamic::Render","PAYMENT3")),c=g();return t(()=>{const t=n.value,d=[];t.contact&&("boolean"==typeof e?e:e.value)&&d.push(...a.value,...i.value),t.delivery&&d.push(...r.value,...o.value),t.payment&&d.push(...l.value,...s.value,...u.value);const p=c.current;return p&&(m=d,(h=p).length===m.length&&h.every((e,n)=>{const t=m[n];return void 0!==t&&Mt(e)===Mt(t)}))?p:(c.current=d,d);var h,m})}const Ep=[fr.Button,br.Button,_r.StickyFooter,Cr.Wrapper];function wp(){const{shopPay:e,checkout:t}=rt(),[a]=Fn("ONE_TIME_PURCHASE");if("unauthenticated_user"!==e.user.flow.value)return null;const i=a[0],r="PICKUP_POINT"===i||"PICK_UP"===i;return!t.isShippingRequired.value||r?n(Kc,{}):null}const Op="contact";function Ip({loginLink:e,title:a}){const{router:i}=rt(),r=t(()=>Js(i,Op));return n("div",{className:"nnGzs",children:[n(E,{id:Op,level:1,autoFocus:r.value,children:a}),e]})}function Rp(){const{client:e,i18n:t,source:i}
2=rt(),r=Hn(),o="simulated"===i.type;return n(a,{when:r,children:n(R,{href:o?void 0:e.unstable_getSerialization("loginUrl")||"",children:t.translate("customer_account.sign_in_link_label")})})}Rp.displayName="LoginLink";const Tp=()=>{const{i18n:e,userEvents:t,source:a,checkout:i,shop:r,shopPay:o}=rt();return n(R,{onClick:()=>{t.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...At(a,i,r),action:"click_shop_pay_sign_in"}}),o.session.unstable_updateVerificationTrigger({source:Cs.LoginLink})},children:e.translate("account_management.sign_in_shop")})};function Lp({identityPresentation:e="form",showEmailMarketingOptIn:t}){const a="vaulted"===e,{i18n:r,checkout:{identity:o,validation:{contactErrors:{emailInputError:l}}},shopPay:u}=rt(),c="shopPay"===o.current.value,d=r.translate("field_errors.email_invalid"),p=u.userVerification.value;s(()=>{c&&"invalid"===p.status&&(l.value=d)},[c,l,d,p.status]);const h=f(e=>{if(c)return p.email===e&&"invalid"===p.status?d:void 0},[c,d,p.email,p.status]);return n(i,{children:[n(i,a?{children:[n(Ip,{title:r.translate("contact.contact_method_title")}),n(he,{blockSize:"base"}),n(ap,{placement:"standalone-vaulted"})]}:{children:[c&&n(i,{children:[n(Vl,{color:"branded"}),n(he,{blockSize:"base"})]}),n(Ip,{title:r.translate("contact.contact_method_title"),loginLink:n(Np,{})})]}),n(he,{blockSize:"base"}),n(Ei,{hideAllOptIns:c&&!a,hideCustomerCard:a,showEmailMarketingOptIn:t,onValidateEmailInput:h}),c&&!a&&n(wp,{})]})}function Np(){const{checkout:{identity:e}}=rt(),t=So();return"shopPay"!==e.current.value?n(Rp,{}):t===bi.UnauthenticatedCheckout?n(Tp,{}):null}const Dp=k(function({showForm:e=!0,identityPresentation:t="form",showEmailMarketingOptIn:a}){const r=U("Checkout::Contact::RenderAfter"),o=U("Checkout::Dynamic::Render","INFORMATION1"),l=U("Checkout::Dynamic::Render","INFORMATION2");return n(i,{children:[o.length?n(i,{children:n(pn,{customizations:o,gap:"base",marginBlockEnd:"large300"})}):null,e?n(Ul,{impressionType:"contact",impressionFeatures:[],children:[n(Lp,{identityPresentation:t,showEmailMarketingOptIn:a}),r.length?n(i,{children:n(pn,{customizations:r,marginBlockStart:"base"})}):null,l.length?n(i,{children:n(pn,{customizations:l,gap:"large-200",marginBlockStart:"large300"})}):null]}):n(i,{children:[r.length?n(i,{children:n(pn,{customizations:r,marginBlockStart:"base"})}):null,l.length?n(i,{children:n(pn,{customizations:l,gap:"large-200",marginBlockStart:"large300"})}):null]})]})});function Mp(){const{checkout:{identity:e},i18n:t}=rt(),{hasViolations:a}=G(ca),{hasViolations:i}=G(Ca),{hasViolations:r}=q(_i);if(a&&Bp({identity:e}))return n(or,{});if(r)return n(de,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(ki,{message:t.translate("field_errors.shipping_method_invalid_phone_number")})});const o=i?t.translate("shipping_errors.shipping_method_not_available_due_to_unsatisfied_conditions"):t.translate("shipping_errors.shipping_method_not_available_generic.one");return n(de,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(Pe,{tone:"critical",heading:t.translate("shipping_errors.title"),errorType:F.DeliveryError,children:o})})}const Bp=({identity:e})=>"shopPay"===e.current.value,xp=[{handle:"first"},{handle:"second"}];function Vp(){const{i18n:e}=rt(),{shippableDeliveryLines:t}=zn().value,a=t?.[0]?.methods||xp;return n(El,{name:"shippingMethods",variant:"block",hideRadioControl:1===a.length,children:a.map(({handle:t,description:a,estimatedTimeInTransit:i,deliveryPredictionEligible:r})=>{const o=Boolean(r),l=a;return n(Vo,{value:t,disabled:!0,accessibilityLabel:e.translate("general.loading"),secondaryContent:n(Oe,{inlineSize:"5ch"}
2),children:n(V,{gap:"small-500",children:[n(D,{inlineSize:"small"}),o||null!=i?n(D,{inlineSize:"base",size:"small",id:"pending-shipping-estimated-time"}):null,l?n(jn,{content:a,size:"small"}):null]})},t)})})}function Fp(){const e=rt();return n(Ol,{children:n(wl,{children:Hp(e)})})}function Hp({checkout:e,i18n:n}){return"shopPay"===e.identity.current.value?n.translate("shipping_errors.invalid_shipping_method_summary"):n.translate("shipping_errors.empty_state")}const zp=k(function(){const{uiStateSignal:e,initialUiStateSignal:t}=ka(Qe),a=Vt(),i=a.value?e.value:t.value,r=Qc(),o=Md(Sn(Ya)),l=r.value&&o.value,{hasViolations:s}=G(Up),u=a.value&&s&&!l&&"error"!==i.status,c=u?n(Gp,{}):null,d=(()=>{switch(i.status){case"initial":case"empty":return n(Fp,{});case"loading":return n(Vp,{});case"error":return n(Mp,{});case"filled":{const e=Ci(i.deliveryLines).filter(Pn),t=e.flatMap(({methods:e})=>e.map(({title:e})=>e));return n(Ul,{impressionType:"shipping_methods",impressionFeatures:t,children:n(jp,{lines:e,showErrorBanner:l,deliveryChangedBannerOwnedBySection:u})})}}})();return n(V,{gap:"base",children:[c,d]})});function jp({lines:e,showErrorBanner:t,deliveryChangedBannerOwnedBySection:a}){const r=Mn(),o=Un(),[,l]=b(),u=rs(l),c=function({checkout:e}){return"shopPay"===e.identity.current.value?Yp:i}(rt());return s(()=>{r("shippingMethodsFilled",{timestamp:new Date}),o({type:"shipping_methods_filled"})},[o,r]),n(i,{children:[n(c,{}),n(V,{gap:"large-200",children:n(os,{lines:e,loading:u,showErrorBanner:t,deliveryChangedBannerOwnedBySection:a})})]})}zp.displayName="OnePageShippingMethods";const Up=new Set(["DELIVERY_DELIVERY_LINE_DETAIL_CHANGED"]);function Gp(){const{i18n:e}=rt();return n(Pe,{tone:"warning",errorType:F.DeliveryError,children:e.translate("shipping_errors.shipping_method")})}function Yp(){const{trackSelectShippingMethod:e}=Dd(),{availableDeliveryMethodsLoading:n,progressiveShippingRatesLoading:t}=Cp();return Pp({onChange:e,prerequisitesLoading:n||n&&!t}),null}function Wp(){const{checkout:e,i18n:t}=rt(),a=e.addressManager.shipping.value,i=kl("shipping"),{shouldGateCrossBorder:r,crossBorderGate:o}=Gl(),l=a.addresses.value.find(({id:e})=>e!==a.selectedAddress.value?.id),s=f(()=>{if(!l)return;const e=()=>i.selectAddress(l.id,{source:"select-saved-address-link"}),n=l.address.countryCode;n&&r(n)?o(e):e()},[i,l,r,o]);return l?n(ee,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",justifyContent:"start",justifyItems:"start",children:n(R,{id:"save_shipping_information",textDecoration:"none",onClick:s,children:t.translate("customer_account.saved_address_option_link")})}):null}function qp(){ep();const e=hn(),t=e?.options.value.some(e=>"PICKUP_POINT"===e.id)??!1,i=Qi();return n(V,{gap:"large-300",children:[t&&n(qi.Prefetch,{}),n(tr,{}),n(Li,{name:"delivery-methods",children:n(Kp,{})}),n(a,{when:i,children:n(er,{})})]})}function Kp(){const{methods:e}=On(),{i18n:i,router:r,checkout:{wallets:o,identity:l,negotiator:s}}=rt(),c=Gn(),{deliveryNext:d,optionalDuties:p}=s.current.fields,h=ds(),m=Ze(),{shippingAddress:v}=s.parts;Yn(v,()=>{m&&m.taxId.reset()});const y=U("Checkout::DeliveryAddress::RenderBefore"),g=U("purchase.checkout.delivery-address.render-after"),b=us(),{hasMultipleDeliveryGroups:_,onlyDeliveryGroupType:C}=b.value,{customizationsBefore:P,customizationsAfter:S}=cs({hasMultipleDeliveryGroups:_,targeted:!1}).value,A=t(()=>za(d.value,!0)||h.value.showShipmentBreakdown).value,k=A?"small-400":"base",w=Mn(),O=Un(),{negotiate:I}=fe(),R=f(({shipping:e})=>{o.activeSession.value||I({fieldsToResolve:["deliveryNext"],silenceViolations:["non-delivery-address",...Pi],runListenersOnError:!0}),e.value=!0,w("sectionComplete",{section:"deliveryAddress",timestamp:new Date}),O({type:"section_complete",section:"deliveryAddress"})},[o,I,w,O]),T=f(({shipping:e})=>{e.value=!1},[]),L=e=>n(qn,{padding:A?"small-400 none":void 0,children:e}),N=u(()=>({groupType:C&&Es(C),includeDeliverySelectionGroups:!1}),[C]),D=ar(),M=t(()=>D.value.isDelivery),x=un(),F=Qi(),H=t(()=>!!x.value&&(e.value.includes("PICK_UP")&&e.value.includes("SHIPPING"))),z="shippingMethod",j=t(()=>Js(r,z)),G=Hi(),Y=n(Wn,{sectionId:"localPickup",children:n(V,{gap:"small",children:[n(a,{when:H,children:n(E,{level:2,children:i.translate("delivery_options.pickup")})}),n(G?lr:sr,{})]})}
2),W=n(Wn,{sectionId:"shipping",children:[n(qn,{children:n(V,{gap:"base",children:[n(a,{when:H,children:n(E,{level:2,children:i.translate("delivery_options.ship_to_address")})}),n(a,{when:c,children:n(Q,{color:"subdued",children:i.translate("shipping.shipping_used_as_billing_notice")})}),n(a,{when:H,children:n(a,{when:F,children:n(B,{border:"base",padding:"base",borderRadius:"large",children:n(ur,{selectedDeliveryMethodType:"SHIPPING"})})})}),n(pn,{customizations:y}),n(V,{gap:"large-300",children:[n(Ss,{children:n(bo,{onValid:R,onInvalid:T,children:n(Jc,{children:[$p({identity:l})&&n(Wp,{}),n(cr,{}),n(a,{when:M,children:n(rr,{})}),m&&n(dr,{taxId:m.taxId,applied:m.applied})]})})}),n(pn,{customizations:g}),n(V,{gap:k,children:[n(E,{id:z,level:2,autoFocus:j.value,children:i.translate("shipping.shipping_method_title")}),n(Kn,{children:[n(a,{when:()=>h.value.showShipmentBreakdown,children:n(Ps,{children:[n(ks,{}),n(he,{blockSize:"small-200"})]})}),Rl("shipping.shipping_method_notice",i)?n(Q,{children:i.translate("shipping.shipping_method_notice")}):null,n(pn,{customizations:P,options:N,render:L}),n(Ps,{children:[n(zp,{}),n(As.Preload,{})]}),n(pn,{customizations:S,options:N,render:L})]})]})]})]})}),n(a,{when:()=>p.value?.refuseDutiesPermitted,children:n(qn,{accessibilityLabel:i.translate("shipping.duties_and_taxes_title"),children:n(V,{gap:"base",children:[n(E,{level:2,children:i.translate("shipping.duties_and_taxes_title")}),n(is,{})]})})})]}),q=t(()=>e.value.includes("PICKUP_POINT")),K=t(()=>e.value.includes("PICK_UP"));return n(a,{when:H,fallback:n(a,{when:()=>q.value||K.value,fallback:W,children:n(a,{when:q,fallback:Y,children:n(Wn,{sectionId:"pickupPoints",children:n(qi,{})})})}),children:n(V,{gap:"large-300",children:[Y,W]})})}function $p({identity:e}){return"customerAccount"===e.current.value}const Jp=k(function(){const{shop:e,i18n:i}=rt(),r=U("Checkout::Dynamic::Render","DELIVERY1"),o=hn(),l=ge(),s=e.hasFlagEnabled(ri),u=v(Boolean(!s&&o)),c=t(()=>l.value.contact&&u.value),d=t(()=>c.value?void 0:"deliveryAddress"),p=t(()=>c.value?i.translate("shipping.delivery_title"):void 0);return n(oo,{accessibilityLabelledBy:d.value,accessibilityLabel:p.value,accessibilityRole:"group",children:n(V,{gap:"base",children:[n(a,{when:()=>!c.value,children:n(V,{gap:"small-400",children:n(dd,{})})}),n(Ii,{}),n(qp,{}),n(pn,{customizations:r})]})})}),Xp=o({displayName:"MobileOrderSummaryBeforeDetails",load:()=>p(()=>e(async()=>{const{MobileOrderSummary:e}=await(import("./d2e6a587.JvgfpEXS.js"));return{MobileOrderSummary:e}},__vite__mapDeps([149,1,3,4,5,6,2,7,8,9,10,11,82,83,142,143,106,101,150])).then(({MobileOrderSummary:e})=>({default:e}))),renderError(e){throw e}}),Zp="undefined"==typeof window?void 0:performance.now();"undefined"!=typeof window&&cp.preload();const Qp=Ep,eh=k(function(){return(()=>{const{embed:e,checkout:{identity:n},shop:t}=rt(),a="shopPay"===n.current.value&&jt(e?.embedder),i=t.hasFlagEnabled(Yt),r=Lu(),o=Du().value;sp({enabled:a,discountOffer:a?r.value:null,shopPromotionDiscounts:void 0,eligibility:o}),pc([{eligibility:o,redemptionTypes:["SHOP_DISCOUNT_OFFER"]}],{enabled:a,retryOnReady:i}),dc({enabled:a,redemptionTypes:["SHOP_DISCOUNT_OFFER"]})})(),(()=>{const{checkout:e,embed:n,shop:t,source:a}=rt(),i=ge(),r="shopPay"===e.identity.current.value&&!jt(n?.embedder)&&e.configuration.visibility.showCashRedemption.value&&!(i.value.payment&&xt(a)),o=t.hasFlagEnabled(Yt),l=Lu(),s=uc(),u=Du().value;sp({enabled:r,discountOffer:r?l.value:null,shopPromotionDiscounts:r?s.value:null,eligibility:u}),pc([{eligibility:u,redemptionTypes:["SHOP_DISCOUNT_OFFER","SHOP_PROMOTION"]}],{enabled:r&&o,retryOnReady:!0})})(),null});function nh({isGuestPartialVaultedDelivery:e,isSectionStyleUnificationEnabled:a,children:i}){const r=t(()=>!e.value);return a?n(co,{target:e.value?"edgeToEdge":"vaulted",children:i}):n(po,{target:"vaulted",condition:r,children:i})}const th=k(function({children:e}){const{checkout:i,embed:r,environment:o,i18n:l,observability:u,shop:c,shopPay:d,source:p}=rt(),h="VISIBLE"===i.configuration.headerText?.visibility,m=y(!1),g=f(()=>{m.value||(m.value=!0,void 0!==Zp&&u.histogram({name:"one_page_below_fold_content_ready",value:Math.round(performance.now()-Zp),unit:"ms",attributes:{buildId:o.commitSha}}))},[o.commitSha,m,u]),b=Vt(),_=c.hasFlagEnabled(la),C=Ht({embedder:r?.embedder,shop:c}),P="google"===r?.embedder&&C,S=ge(),A=Pr(),k=t(()=>S.value.payment&&A.value),E=v(hn()),w=$n(),O=t(()=>S.value.payment&&c.acceptTipPayments&&(w?.tippingPaymentAllowed??!0)&&i.configuration.visibility.showTips),I=v(on()[0]),{postPurchaseEnabled:R}=gs(),T=t(()=>i.negotiator.current.fields.buyerIdentity.value?.customerProfile),L=Jn(),N=t(()=>P&&L.value),D=un(),M=t(()=>S.value.contact&&i.configuration.showContactInformation||S.value.delivery&&i.isShippingRequired.value||S.value.payment),x=t(()=>S.value.delivery&&i.isShippingRequired.value||S.value.payment),F=t(()=>D.value&&M.value),H=oi(),z=ys(),j=t(()=>li({configuration:i.configuration,identity:i.identity,shop:c,shopPay:d,embed:r,vaultedSections:S.value,isShippingRequired:i.isShippingRequired.value,hasSellingPlan:H.value,phoneCountryCode:z.value})),G=t(()=>"standalone-form"===j.value),Y=t(()=>"standalone-vaulted"===j.value),W=t(()=>"vaulted-adjacent"===j.value),q=t(()=>G.value||Y.value);!function(){const{negotiate:e}=fe(),{observability:n,checkout:t}=rt(),a=t.negotiator.current.fields.buyerIdentity,i=t.negotiator.parts.shippingAddress.value,r=t.negotiator.parts.billingAddress.value,{value:o=[]}=t.negotiator.current.fields.allViolations,l=yi(o),u=hp(o),c=t.isShippingRequired.value?i.countryCode:r.countryCode,d=a?.value?.countryCode,p=JSON.stringify(a?.value,(e,n)=>void 0===n?null:n);s(()=>{l||u||d&&c!==d&&(n.log("country_code_alignment_mismatch_detected","[EnsureBackAndFrontEndCountryCodeAlignment] There was a mismatch between the preselected and the buyerIdentity countryCode on checkout load.",{selectedCountryCode:c,buyerIdentityCountryCode:d,buyerIdentity:p}),e({silenceViolations:["all"]}))},[])}();const K=v(Xn({base:!0,medium:!1})),$=t(()=>!b.value||(K.value??!1)),J=pr(),X=t(()=>"hidden"!==J.value),Z=v(U("Checkout::Contact::RenderAfter")),Q=function(){const{checkout:e,shop:n,source:a}=rt(),{email:i}=e.negotiator.parts,r=ge(),{buyerIdentity:o}=e.negotiator.current.fields,l=n.hasFlagEnabled(gi);return t(()=>{if("businessCustomer"===e.identity.current.value)return!1;const t=o.value;if(t?.customerProfile?.acceptsEmailMarketing)return!1;const s=e.configuration.visibility.showEmailMarketing&&"OFF"!==n.emailMarketing&&r.value.contact;if("sdkCartHints"===e.identity.current.value)return Boolean(s&&i.value);const u=l&&!fi(t?.countryCode);return Boolean(s&&"shopPayExternal"!==a.type&&!u&&!xt(a))})}(),{main:{section:ee}}=ye(),{lineItems:{priority:ne="base"}}=me(),te=v(Si(ee)),ae=In(),ie=t(()=>"shopPay"===i.identity.current.value||S.value.payment||!te.value?"belowPayment":"abovePayment"),re=t(()=>!q.value&&Q.value&&"belowPayment"===ie.value),oe=t(()=>!q.value&&Q.value&&"abovePayment"===ie.value),le=t(()=>ae.value&&S.value.payment&&re.value&&$.value),se=t(()=>i.configuration.visibility.showEmailMarketing&&!xt(p)&&oe.value&&!T.value?.acceptsEmailMarketing),ue=ar(),ce=t(()=>ue.value.isRoot?"belowPayment"!==ie.value||$.value&&te.value?"abovePayment":"belowPayment":"none"),pe=t(()=>"guest"===i.identity.current.value&&S.value.delivery||"businessCustomer"===i.identity.current.value&&!S.value.delivery&&S.value.payment),he=t(()=>"guest"===i.identity.current.value?pe.value&&!(S.value.contact&&S.value.payment):pe.value),ve=t(()=>!he.value&&i.isShippingRequired.value),be=t(()=>W.value||Y.value),_e=Ad(),Ce=t(()=>Boolean(!xt(p)&&S.value.delivery&&null!=E.value&&!_e.value)),Pe=t(()=>S.value.delivery&&I.value.includes("PICK_UP")&&!_e.value),Se=t(()=>Boolean(be.value||Pe.value||(ve.value||he.value)&&Ce.value)),Ae=t
2(()=>Boolean(ve.value&&Ce.value&&!be.value)),ke=jt(r?.embedder),Ee="beforeDetails"===i.configuration.orderSummary?.placement,we=t(()=>ke&&!Ee&&!Ae.value),Oe=t(()=>ke&&Se.value),Ie=t(()=>ke?Ee:te.value),Re=t(()=>"guest"===i.identity.current.value&&S.value.delivery&&!S.value.contact),Te=t(()=>!q.value&&te.value&&(se.value||"abovePayment"===ce.value)),Le=t(()=>b.value&&S.value.contact&&!q.value&&Z.value.length>0),Ne=t(()=>!q.value),De=kp({includeContact:Ne}),Me=t(()=>b.value&&!L.value&&De.value.length>0),Be=Bl(),xe=t(()=>b.value&&Be.value&&Ee),Ve=t(()=>Be.value&&!Ee),Fe=Boolean(r?.isFlagshipPartner)&&"high"===ne;Zn();const He=t(()=>!q.value&&(se.value||le.value)),ze=t(()=>"abovePayment"===ce.value),je=t(()=>q.value?S.value.delivery&&i.isShippingRequired.value?l.translate("shipping.delivery_title"):l.translate("payment.title"):l.translate("contact.contact_method_title")),Ue=t(()=>!te.value&&!F.value&&(!Y.value||x.value)),Ge=t(()=>!(F.value&&S.value.contact)&&(!Y.value||x.value)&&(ae.value||te.value&&!S.value.contact)),Ye=t(()=>S.value.payment&&!le.value&&!Ve.value),We=t(()=>M.value&&!Re.value),qe=t(()=>_&&We.value),Ke=t(()=>!_&&We.value),$e=t(()=>qe.value&&Ue.value),Je=t(()=>!ke&&qe.value&&Ue.value&&!pe.value&&S.value.payment&&(!i.isShippingRequired.value||S.value.delivery)),Xe=t(()=>ke?Ee:ae.value||Je.value),Ze=t(()=>Je.value&&!$.value&&(re.value||"belowPayment"===ce.value)&&!k.value&&!Le.value&&!Me.value&&!N.value),Qe=t(()=>Ze.value||k.value||Te.value||le.value||ae.value&&!te.value&&$.value||Ye.value&&($.value||Ee)),en=t(()=>k.value||Ye.value||!S.value.payment&&S.value.delivery&&!$.value&&!Le.value||S.value.payment&&le.value);return n(Ds,{children:[n(eh,{}),n(V,{blockSize:N.value?"100%":void 0,gap:"@media (inline-size >= extraSmall) large-200, none",children:[n(a,{when:we,children:n(Qn,{accessibilityRole:"presentation"})}),xt(p)?n(V,{gap:"base",padding:"@media (inline-size >= extraSmall) none, large-200 large-200 none large-200",children:n(et,{})}):null,n(nt,{section:"toast"}),!Fe&&n(nt,{section:"top"}),n(up,{active:b,ready:m}),n(dp,{fillAvailableBlockSize:N.value,ready:m,children:[h&&n(B,{padding:"none none large-100 none",children:n(ws,{})}),"high"===ne&&n(B,{display:"@media (inline-size >= medium) none, auto",children:n(co,{target:"lineItems",children:n(oo,{hideDivider:X,children:n(tt,{})})})}),Fe&&n(nt,{section:"top"}),n(a,{when:X,children:n(co,{target:"expressCheckout",children:n(hr,{})})}),n(a,{when:xe,children:[n(at,{section:"summary",children:n(it,{section:"summary",children:n(B,{padding:"none large-200 large-100 large-200",children:n(co,{target:"plain",children:n(Xp,{})})})})}),n(Qn,{accessibilityRole:"presentation"})]}),n(yp,{}),n(Ms,{}),n(a,{when:q,children:()=>n(oo,{accessibilityLabel:l.translate("contact.contact_method_title"),children:n(at,{section:"contact",children:n(it,{section:"contact",children:n(Dp,{showForm:i.configuration.showContactInformation,identityPresentation:Y.value?"vaulted":"form",showEmailMarketingOptIn:Y.value?Q.value:void 0})})})})}),n(po,{target:"vaulted",condition:qe,children:n(ro,{hideDivider:en,condition:Ue,accessibilityLabel:je.value,children:n(po,{target:"vaulted",condition:Ke,children:[n(rp,{showDelivery:ve,insideVaultedCard:$e}),n(ro,{condition:Ge,hideDivider:Qe,accessibilityLabel:je.value,children:n(V,{children:[n(a,{when:()=>!S.value.contact&&!G.value,children:n(at,{section:"contact",children:n(it,{section:"contact",children:n(Dp,{showForm:i.configuration.showContactInformation})})})}),n(a,{when:()=>!pe.value,children:n(qd,{hideLastDivider:Xe,showTopDivider:Oe,stripBlockEndPadding:i.configuration.isUniversalCheckoutFinalizer})})]})}),n(a,{when:F,children:n(lo,{})})]})})}),n(a,{when:k,children:n(B,{paddingBlockStart:"small-300",paddingBlockEnd:"base",children:n(Sr,{})})}),n(a,{when:()=>(!q.value||ze.value)&&(te.value||le.value),children:n(it,{section:"contact",children:n(fp,{aboveFoldSpacing:!0,showEmailMarketingOptIn:He,showPhoneMarketingOptIn:ze})})}),n(a,{when:Le,children:n(it,{section:"contact",children:n(bp,{extensions:Z,hideDivider:"whenEmpty"})})}),n(a,{when:he,children:n(a,{when:i.isShippingRequired,children:n(nh,{isGuestPartialVaultedDelivery:Re,isSectionStyleUnificationEnabled:_,children:[n(tp,{}),n(so,{condition:pe,accessibilityLabel:l.translate("shipping.delivery_title"),children:n(qd,{hideLastDivider:Ie,showTopDivider:Oe,stripBlockEndPadding:i.configuration.isUniversalCheckoutFinalizer})})]})})}),n(a,{when:Me,children:n(bp,{extensions:De,hideDivider:"whenEmpty"})}),n(a,{when:()=>!S.value.delivery&&i.isShippingRequired.value,children:n(de,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(at,{section:"delivery",children:n(it,{section:"delivery",children:n(Wn,{sectionId:"delivery",children:n(Jp,{})})})})})}),n(a,{when:O,children:n(ao.Prefetch,{})}),n(a,{when:N,children:n(B,{className:"xoG3V","data-testid":"onepage-vaulted-spacing"})}),n(a,{when:b,children:n(cp,{onReady:g,includeContactInVaultedExtensions:Ne,showMobileOrderSummary:Ve,showVaultedStateMarketingDisclosureBelowPayment:re,phoneMarketingPlacement:ce,isSectionCustomized:te,showVaultedStateMarketingDisclosureOnMobile:le,expressCheckoutSlot:J,showVaultedCardConsentSpacing:Ze})})]}),R&&n(io,{})]}),n(mp,{}),n(a,{when:i.isShippingRequired,children:n(Ap,{})}),n(mr,{id:"OnePage"}),e]})}),ah=Object.freeze(Object.defineProperty({__proto__:null,MobileOrderSummaryBeforeDetails:Xp,default:th,onePageCritical
2StyleClassNames:Qp},Symbol.toStringTag,{value:"Module"}));export{nu as L,tu as M,Jc as O,fp as P,iu as R,xd as S,zu as U,bp as V,Uc as a,Gc as b,zp as c,Rd as d,Id as e,Td as f,Ks as g,$s as h,ed as i,Js as j,Bu as k,Mu as l,kp as m,gc as n,ah as o,gp as u};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.