1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["26e63865.DRzr3cAs.js","2c1ab0fe.Bywc2Brn.js","164ad2e3.DZSd7pLX.js","4b4bc88f.C26USmk8.js","app.DRs7v1W8.js","assets/app.CcGlIMpn.css","assets/wallet-prefilled-guest-return.BJvF0-q4.css","d0bb51ec.-Od_3rgw.js","f67abd2c.vvptRNe9.js","60a453ce.Bo_pHupz.js","e12db40c.J_ouQ898.js","9dba8418.BzGnZlrB.js","assets/hydrate.BtZpYm2T.css","f3fe2775.D_uXSICt.js","ac5a19ff.DOcg_gPh.js","598fef4e.0s9DNJyq.js","assets/PaymentIcon.gzvCNwz_.css","e77f7fe0.ucQ926NO.js","22345fd4.9vcjBj8J.js","4b1c22b7.BoKf5l9E.js","assets/PaymentLine.DT05kVlY.css","a422df8c.1bXGQc8C.js","efa0389a.D_AJL692.js","assets/Choice.CrYuHUmO.css","assets/EmptyState.BEvzDDvy.css","cc6ff67d.DxXH8xOm.js","08a3b809.BkK7NqSp.js","d25d1b95.BKchO7Wj.js","bf513f9c.CCBvccYL.js","e39bc11c.BUjAFMkx.js","7a8217fd.CFcj7rrg.js","8599b02a.CvNpIvqP.js","assets/useShopPayProgressIntercepts.CIy8uDiZ.css","cf29e63b.Dir5vp_T.js","assets/hasViolationsIgnoringCodes.BcTJoNaV.css","dfc03c53.Zf7Vmr3p.js","86720dbb.BFQbmiIX.js","dfca5da5.DO4nAhLG.js","dae24aab.DshQXsWO.js","assets/Section.CU18S7Ap.css","55098bf1.DXcUuNz_.js","0e67bd3b.D7tZwHwl.js","74835653.B5dvKhsY.js","3ca8ef7e.C6ifrex0.js","2495faa4.D3uf12cS.js","a9fa9fda.DRbzGEJQ.js","ca3e798e.Dc9DtEXz.js","47b970b2.DjolDw47.js","assets/PhoneField.uZEuHncj.css","064f6ac1.Bjr6-mBf.js","assets/Popover.Bi1nHaU-.css","assets/BillingAddressForm.BdwN7V1K.css","f692f62f.CtV13pmW.js","9babe369.D342A3FZ.js","b684bff6.DCTHrC-i.js","assets/RedirectionNotice.DgiInWJ-.css","79974aab.DaZOEwGE.js","58314944.QPymRmnD.js","assets/PaymentMethodProgressionHost.BIxPaYCu.css","434e3b0a.B1BBnK_d.js","50130ded.Btr-6Woc.js","65f3d4da.Bb3QiqCm.js","31cc568e.95lmLO5k.js","assets/KnownBuyerPaymentMethodSelector.BXqN6ZOx.css","c10167e6.CAXyM0MS.js","b9c0319a.CPvnjp6u.js","dffdfb34.DLQCxWEB.js","1f5e7811.BFK0fqzB.js","assets/ShopPayLogo.87JMHPUK.css","c6c0cbda.BKcpNz6B.js","assets/useHasViolations.BnDF3H7t.css","2fdb3dd3.BBVlyDMF.js","17425706.CtaKzzog.js","cb5cf153.DnU9t5IG.js","e3e348f2.D2E-Dtt_.js","71ae3d5c.CT21Fulh.js","cb38e5c2.BhWVCtRR.js","78ab3dd0.hruEgq0z.js","ed9f2238.DPytesKr.js","6fb6f9d8.Dzf9eTaT.js","1444e6bd.nTYcj6dN.js","0b8657b8.D3afZApm.js","7b0c98ea.wJBUDVvK.js","assets/TransitionHeight.CuRoM9zv.css","d22d2b80.B6f-Nstb.js","f49d4216.CZ2qzbQ0.js","assets/VatNumberValidationField.CYhzzEkL.css","f1968089.D7rMVkBA.js","17e57de1.B_nQLFIZ.js","assets/PaymentOptionSelector.s-Kd_X2E.css","91811554.CL5TQsge.js","21cc90a2.DHzOO82q.js","64de7b49.B8PyHxU4.js","347b440c.C1_1cjnS.js","9ce08e25.Olf3Esll.js","assets/EstimatedDeliveryContent.B_THySFF.css","0e9ee714.BN1p7a14.js","39921a74.DYnLAd5t.js","assets/Switch.BS8yVgoP.css","ccdf3592.DMzipudw.js","71b60e0a.DfPLdYsH.js","24773686.CaAVXUiT.js","ec391382.Cdv-WKBN.js","assets/StickyPayButton.Cv62Qqkq.css","a25deb9a.G9iQXgws.js","01973ac7.BOddeAem.js","945a08d6.VZGO8GHT.js","7bc8057b.DOprJdrT.js","assets/constants.xO_7ctnq.css","2b89a178.DH7Z9hRP.js","910cd6e2.CdoCkmtO.js","181d38d3.CJ-3Gmk5.js","792bb671.B3OvVnSg.js","assets/Middot.D7Ujmshx.css","d6447d9e.ylld8O85.js","f51e663e.B3qk_wNP.js","8e79be58.CIzdvtZ5.js","assets/ShippingMethodSelector.B0hio2RO.css","90e26f5f.DF9vA_2V.js","assets/SubscriptionPriceBreakdown.vTcdVGq4.css","assets/ShippingLines.LcqrKXE1.css","ca5e9c49.sV1ZKOq5.js","f3e117aa.CUlWDYgU.js","68887467.Rk2uF3DC.js","ca8e826d.BNeiCQWc.js","assets/Avatar.gBkEAe_p.css","17a5f1e4.40suTqtd.js","0e4087ec.BP70Rysg.js","7aefefff.xStqsVa6.js","b3389d5c.DbStXD7Y.js","73a9b0a0.CBuXJYB6.js","81e109b1.DOkM2TK2.js","e0989459.q3_RlbRd.js","cdfd59e6.XnOLrtop.js","assets/RememberMeSection.JBO5WNhc.css","fc21c11a.BTdpkxz4.js","e129c76e.pkv8K8Le.js","d4ea2faa.DFrX4G1p.js","fe885b80.4u7Ja5rL.js","f78726c8.BaX6C3hQ.js","assets/hooks.CKE1iCma.css","e477f96c.C6fFzpZx.js","1ed8f5e3.CzhdrJHY.js","assets/floating-layer.DfWUBaTh.css","7ee73f43.D11Matm5.js","0c0ad074.RCwQbH01.js","assets/useShopPayButtonClassName.BrcQzLuH.css","87bfafec.CxwEzGHg.js","assets/PayButtonSection.CZuxzxFG.css","d2e6a587.D_77Lmvs.js","assets/MobileOrderSummary.DjDhVpQB.css","assets/BelowTheFoldContent.CyS-bj2t.css"])))=>i.map(i=>d[i]); 2import{_ as e}from"./app.DRs7v1W8.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,b_ as j,o as U,bS as G,bZ as Y,eH as W,A as q,da as $,a1 as K,hs as J,gI as X,f as Z,ab as Q,c as ee,bm as ne,hM as te,bY as ae,fE as ie,bW as re,bV as oe,d3 as le,eO as se,bl as ue,cZ as ce,eU as de,d as pe,K as he,bL as me,l as ve,dJ as ye,v as ge,hN as fe,aV as be,cB as _e,a9 as Ce,eM as Pe,aW as Se,Z as Ae,hO as ke,eR as Ee,au as we,hq as Oe,bT as Ie,cK as Re,hP as Te,hQ as
2Le,hR as Ne,hS as De,f8 as Me,eg as Be,cH as xe,h1 as Ve,hT as Fe,hU as He,bJ as ze,hV as je,bE as Ue,cv as Ge,eS as Ye,ee as We,by as qe,hW as $e,hX as Ke,c_ as Je,di as Xe,dl as Ze,hY as Qe,dd as en,dg as nn,bP as tn,hZ as an,h_ as rn,dj as on,dk as ln,cx as sn,h7 as un,h8 as cn,U as dn,eW as pn,eP as hn,bF as mn,f5 as vn,bd as yn,aC as gn,aS as fn,h$ as bn,bG as _n,i0 as Cn,i1 as Pn,cj as Sn,er as An,eT as kn,f4 as En,eX as wn,i2 as On,ai as In,as as Rn,M as Tn,cm as Ln,i3 as Nn,m as Dn,i4 as Mn,t as Bn,i5 as xn,cw as Vn,e$ as Fn,c1 as Hn,cf as zn,c5 as jn,d6 as Un,eY as Gn,dn as Yn,i as Wn,ao as qn,V as $n,fa as Kn,p as Jn,i6 as Xn,aj as Zn,eN as Qn,hg as et,i7 as nt,af as tt,ag as at}from"./164ad2e3.DZSd7pLX.js";import{c as it,cF as rt,a6 as ot,W as lt,j7 as st,jG as ut,bH as ct,bx as dt,bD as pt,jH as ht,gx as mt,hO as vt,aM as yt,hM as gt,hK as ft,aO as bt,hN as _t,ju as Ct,bt as Pt,aJ as St,bw as At,jI as kt,n as Et,jJ as wt,g9 as Ot,bI as It,b8 as Rt,bi as Tt,hr as Lt,L as Nt,m as Dt,jK as Mt,J as Bt,ag as xt,dj as Vt,gg as Ft,x as Ht,I as zt,e_ as jt,ae as Ut,jL as Gt,l as Yt,fr as Wt,_ as qt,jM as $t,K as Kt,b9 as Jt,jN as Xt,jO as Zt,f9 as Qt,O as ea,c8 as na,ew as ta,H as aa,jP as ia,eO as ra,ej as oa,ac as la,e6 as sa,bd as ua,iQ as ca,ai as da,gt as pa,b6 as ha,c4 as ma,e2 as va,jQ as ya,z as ga,fa,iU as ba,jR as _a,jS as Ca,jT as Pa,iW as Sa,gh as Aa,u as ka,gv as Ea,V as wa,jU as Oa,f0 as Ia,e$ as Ra,d3 as Ta,cG as La,cI as Na,cJ as Da,cH as Ma,jV as Ba,j as xa,eM as Va,c_ as Fa,fv as Ha,iV as za,bl as ja,au as Ua,jW as Ga,da as Ya,at as Wa,d8 as qa,cZ as $a,i$ as Ka,jX as Ja,jY as Xa,jZ as Za,j_ as Qa,j$ as ei,k0 as ni,j1 as ti,d1 as ai,k1 as ii,iY as ri,ab as oi,k2 as li,C as si,k3 as ui,ar as ci,k4 as di,k5 as pi,k6 as hi,k7 as mi,p as vi,h as yi,iK as gi,iL as fi,k8 as bi,k9 as _i,aq as Ci,bf as Pi,iO as Si}from"./4b4bc88f.C26USmk8.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 $i,W as Ki,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.DLQCxWEB.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.BN1p7a14.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 $r,s as Kr,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.D_uXSICt.js";import{a as ro,c as oo,S as lo,M as so}from"./dfca5da5.DO4nAhLG.js";import{T as uo,S as co,M as po}from"./79974aab.DaZOEwGE.js";import{R as ho,P as mo,C as vo}from"./e77f7fe0.ucQ926NO.js";import{A as yo,C as go,u as fo,S as bo}from"./0e67bd3b.D7tZwHwl.js";import{b as _o,a as Co,f as Po,u as So}from"./a25deb9a.G9iQXgws.js";import{E as Ao,u as ko,b as Eo,a as wo,c as Oo}from"./01973ac7.BOddeAem.js";import{u as Io}from"./945a08d6.VZGO8GHT.js";import{c as Ro,a as To}from"./58314944.QPymRmnD.js";import{P as Lo}from"./598fef4e.0s9DNJyq.js";import{O as No,W as Do,b as Mo,a as Bo}from"./7a8217fd.CFcj7rrg.js";import{a as xo,b as Vo,C as Fo}from"./efa0389a.D_AJL692.js";import{a as Ho,S as zo,u as jo,b as Uo}from"./bf513f9c.CCBvccYL.js";import{U as Go,I as Yo}from"./7bc8057b.DOprJdrT.js";import{B as Wo,A as qo}from"./74835653.B5dvKhsY.js";import{g as $o,d as Ko,c as Jo,e as Xo}from"./d25d1b95.BKchO7Wj.js";import{u as Zo,S as Qo}from"./c6c0cbda.BKcpNz6B.js";import{S as el,E as nl,f as tl,r as al,e as il,h as rl,i as ol,j as ll,b as sl,c as ul,I as cl,g as dl}from"./f1968089.D7rMVkBA.js";import{b as pl,a as hl,t as ml,d as vl,u as yl,c as gl}from"./2b89a178.DH7Z9hRP.js";import{a as fl,v as bl,b as _l,u as Cl}from"./1f5e7811.BFK0fqzB.js";import{a as Pl}from"./f67abd2c.vvptRNe9.js";import{S as Sl}from"./39921a74.DYnLAd5t.js";import{u as Al,a as kl,M as El,b as wl}from"./b684bff6.DCTHrC-i.js";import{C as Ol,b as Il,E as Rl}from"./a422df8c.1bXGQc8C.js";import{u as Tl,h as Ll}from"./17425706.CtaKzzog.js";import{C as Nl}from"./cf29e63b.Dir5vp_T.js";import{u as Dl,d as Ml,c as Bl}from"./24773686.CaAVXUiT.js";import{S as xl}from"./6fb6f9d8.Dzf9eTaT.js";import{S as Vl}from"./cb5cf153.DnU9t5IG.js";import{S as Fl}from"./cb38e5c2.BhWVCtRR.js";import{u as Hl,a as zl}from"./22345fd4.9vcjBj8J.js";import{v as jl}from"./9dba8418.BzGnZlrB.js";import{P as Ul}from"./47b970b2.DjolDw47.js";import{I as Gl}from"./55098bf1.DXcUuNz_.js";import{a as Yl}from"./ed9f2238.DPytesKr.js";import{A as Wl,C as ql}from"./4b1c22b7.BoKf5l9E.js";import{V as $l,M as Kl,u as Jl,a as Xl,S as Zl,R as Ql,b as es}from"./910cd6e2.CdoCkmtO.js";import{b as ns,a as ts,g as as}from"./e12db40c.J_ouQ898.js";import{r as is}from"./dae24aab.DshQXsWO.js";import{D as rs,u as os,S as ls}from"./d6447d9e.ylld8O85.js";import{g as ss}from"./65f3d4da.Bb3QiqCm.js";import{M as us,c as cs,u as ds,b as ps}from"./64de7b49.B8PyHxU4.js";import{u as hs,S as ms,a as vs,E as ys}from"./347b440c.C1_1cjnS.js";import{b as gs}from"./2fdb3dd3.BBVlyDMF.js";import{u as fs}from"./ca5e9c49.sV1ZKOq5.js";import{f as bs,i as _s}from"./e3e348f2.D2E-Dtt_.js";import{S as Cs}
2from"./f3e117aa.CUlWDYgU.js";import{T as Ps}from"./7b0c98ea.wJBUDVvK.js";import{F as Ss}from"./3ca8ef7e.C6ifrex0.js";import{D as As}from"./f49d4216.CZ2qzbQ0.js";import{S as ks}from"./f51e663e.B3qk_wNP.js";import{m as Es}from"./21cc90a2.DHzOO82q.js";function ws(){const{i18n:e}=it();return n(E,{level:1,children:e.translate("embed.header.review_order")})}function Os(){const{hasError:e}=w(rt),i=_o().value,{i18n:r,observability:o}=it(),l=r.translate("review.blocks.change_link_label"),{inMemoryAmazonPayParts:{hasPaymentSheetError:s,sdkStatus:u}}=ot(),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=it(),{i18n:t}=e,a=function({checkout:e}){return"buyWithPrime"===e.identity.current.value?{rollupId:"buyWithPrimePayDetails",sdkButton:n(Ai,{wallet:lt.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=st(),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}=it();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}=it(),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.DRzr3cAs.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}=it(),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 $s(){const{checkout:{negotiator:e}}=it(),{generalPaymentError:n,generalPaymentErrorCode:a}=e.parts,{violations:i}=j(ut);return t(()=>!!n.value&&(!ct(a.value)||i.value.size>0))}function Ks({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}=it(),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}}=it();s(()=>{if(n)return a.listenResult(e=>{e||(t.value=!0)})},[a,n,t])}function Qs(){const{loading:e}=W(),{checkout:n}=it(),t=n.isShippingRequired.value,a=n.negotiator.parts.shippingAddress.value,{shippingAddress:i,deliveryNext:r}=n.negotiator.current.fields,o=i.value,l=mt(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}=it(),n=e.hasFlagEnabled(gt),a=Or(),i=ft(),r=bt(),o=_t(),{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}}=it(),{paymentLines:a}=t.parts,{violations:i}=j(ut),{message:r,tone:o}=ko(),l=[...i.value][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 q({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}=it(),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},Ct(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(K,{type:"edit"}),n(x,{children:u})]})})})]})}function au({paymentLine:e}){const{i18n:t}=it();switch(e.method.redemptionSource){case"STORE_CREDIT":return n(Q,{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(Z,{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=J(a);return n(Q,{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:X(i)})})]}),n(Z,{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}=it(),l=Or(),u=Tr(l),{canApplyGiftCards:c,paymentLines:d}=$(),p=Pt(),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=bt();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}=it(),{paymentLines:d,remove:p}=$(),{useStoreCreditForSubscriptionRenewals:m}=c.negotiator.parts,v=bt(),g=vt(),b=yt(),_=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})=>Ct(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:{...St(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=>Ct(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(ee,{})})]})}),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},Ct(e.method)))]})})}function su({paymentLine:e}){const{i18n:t}=it(),a=e.method.redemptionContent,i=J(a);return n(Vo,{value:Ct(e.method),secondaryContent:n(Z,{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(Z,{children:t.translate("payment.gift_card_checkbox_label")}),n(V,{direction:"inline",gap:"small-400",children:[n(K,{type:"gift-card"}),n(x,{color:"subdued",children:[" ",X(i)]})]})]})})}function uu(){const{checkout:e}=it(),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}=it(),n=Or(),t=Tr(n),a=Ir(n),i=bt(),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}}
2=it(),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(()=>{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&&At(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=ne(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($r(m))return n(pu,{children:n(x,{children:m.name})});if(Kr(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}}=it(),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}}=it();return"shopPay"===t.current.value?n(hu,{handleNoValidCards:()=>e.value=!0}):n(mu,{})}function yu(){const{i18n:e}=it(),t=kt("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(Z,{children:[e.translate("payment.store_credit.label"),a]})]},Ct(t.method));case"CUSTOM":{const i=t.method.redemptionContent,r=J(i);return n(V,{direction:"inline",alignItems:"center",gap:"base",children:[n(Lo,{type:"gift-card"}),n(Z,{children:[e.translate("payment.gift_card_wrapper.gift_card_label",{identifier:X(r)}),a]})]},Ct(t.method))}default:return null}})}):null}function gu({paymentExemptionReason:e}){const{checkout:{identity:t}}=it();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}=it(),i=Ho(),r=Pt();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}=it(),n=e.latestReceipt.value,{value:t}=e.negotiator.current.fields.paymentMethods,{inMemoryGooglePayParts:{sdkStatus:a,paymentSheetError:i},persistedGooglePaySignal:r,receiptErrorSignal:o}=ot(),l=te({shouldResetCustomerInfo:!1}),u=ae("failed"===n?.status&&"payment"===n.failure.type?n.failure:void 0),c=Et(l);return h(()=>{"error"===a.value.status&&m(()=>{c.current(),i.value={type:wt}})}),s(()=>{Ot(t,"GOOGLE_PAY")||i.value?.type===wt||(i.value={type:wt},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}=it(),n=e.latestReceipt.value,{value:t}=e.negotiator.current.fields.paymentMethods,{inMemoryPayPalParts:{paymentSheetError:a},persistedPayPalSignal:i}=ot(),r=ie(),o=Et(r),l=u(()=>Ot(t,"PAYPAL_EXPRESS"),[t]);return s(()=>{l||(o.current(),a.value={type:wt})},[l,a,o]),s(()=>
2{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}}=it();switch(e.current.value){case"payPal":return n(_u,{});case"googlePay":return n(bu,{});default:return null}}function Pu(){const e=it(),{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([...dt,"PAYMENTS_PHONE_NUMBER_DOES_NOT_MATCH_EXPECTED_PATTERN"])),{hasError:t,clearError:a}=w(pt),{checkout:{negotiator:i}}=it(),{lastJourneyProgression:r}=i,o="failed"===r.value.type&&"completion"===r.value.negotiationStage,l=$s(),s=Y();ht(()=>{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(It),{hasError:_}=re(),{hasError:C}=oe(),{paymentErrors:P}=le().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=se(),R=null!=O&&!I.value,T=Rt().value,N=l.session.selectedPaymentMethod.value,D=Tt(N),{value:M}=e.checkout.negotiator.current.fields.paymentMethods,B=zr({enableAutoSelect:!1}),x=Et(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&&Lt(N)?N.paymentBrands??[]:[],j=z.length>0?M?.find(e=>At(e,z)):void 0,q=ue("Checkout::PaymentMethod::Render",j?.uiExtension?[j.uiExtension]:[]),J=function({checkout:e,shop:n,source:t},{customerProfile:a}){return"shopPay"===e.identity.current.value||Mt({identitySource:e.identity.current.value,isOrderSession:Bt(t),storeVaultEnabled:n.storeVaultEnabled,customerProfile:a})}(e,{customerProfile:E.value?.customerProfile}),X=J&&(c||H),Z=J&&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===Nt.CreditCard&&e.method.requiresCvvConfirmation),de=o.storeVaultGuestCvvVerificationEnabled&&ie,pe=Boolean(D)&&!D?.expired&&!D?.verified,he=Boolean(D?.expired)||ne||R||T||de||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=st(),Ce=t(()=>!(!be.value||_e.value)||Boolean(E.value?.purchasingCompany)),Pe=Xs(p,he||b);qs(q.map(Dt),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:{...St(n,t,a),action:i?"credit_card_expand":"credit_card_collapse"}})}(e,Pe.value))},[d,te,Pe,e]),Ae=function(){const{checkout:e}=it(),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||de,Le=!Ie&&(fe||Z||R),Ne=Re||Le||Boolean(Te);!function(e){const{checkout:{negotiator:n}}=it(),{useStoreCreditForSubscriptionRenewals:t}=n.parts,{loading:a}=W(),i=v(e),r=v(a),o=vt(),l=yt(),{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:de||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(ce,{target:"cart.paymentLines[0]",children:[n(ho,{open:Re,disabled:Le,id:p,label:r.translate("payment.title"),icon:n(K,{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(de,{errors:e,errorType:F.PaymentError}):n(i,{children:[n(wo,{}),n(nu,{})]}),n(pe,{blockSize:"base"})]})}function Au({onPaymentDelegation:e}){const{embed:t,i18n:a}=it(),{rollup:{action:{tone:i}={}}={}}=he();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}=it(),l=L(),u=xt(),{delegatedPaymentInstrument:c}=o.negotiator.context,{message:d,tone:p,inventoryRecoveryReceiptId:h}=ko(),{rollup:{blockPadding:m}={}}=he(),{violations:v,clearViolations:y}=j(It),b=Zo({violations:v}).value;s(()=>{let e=$o(c.peek());return c.subscribe(n=>{const t=$o(n);t!==e&&(e=t,y())})},[c,y]);const _=Boolean(a)&&o.configuration.isPaymentInstrumentsDelegationEnabled&&Boolean(c.value),C=_&&b,P=$o(c.value),S=g(void 0);C&&(S.current=P);const A=Ko(c.value),{billingAddress:k}=o.negotiator.parts,w=Boolean(A&&!Vt(k.value,Jo(A))),O=_&&(C||S.current===P&&w),I=a?.embedder,R=Ft({embedder:I,shop:i}),T=Ht(r.app.config),N=!a?.isFlagshipPartner||zt(a.embedder)||T||R?e.translate("payment.title"):e.translate("payment.payment_method"),D=a?.client?.paymentErrors.value.includes(jt.PaymentEmpty)??!1,M=g(!1),B=g(null),F=f(e=>{B.current=e,e&&M.current&&(e.focus(),M.current=!1)},[]),H=f(async()=>{const e=a?.client;if(!e)return;M.current=!1;const n=null!==B.current;try{const n=await e.paymentMethodChangeStart();if(!n)return;if(n.ucpPaymentInstrument)t.log("delegated_payment_selected","Payment instrument selected",{externalReferenceId:$o(c.value)});else if(n.cart)try{await e.applyCart(n.cart),t.log("delegated_payment_selected","Payment instrument selected",{externalReferenceId:$o(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&&(B.current?B.current.focus():M.current=!0)}},[a,t,c]),z=a?.client?.paymentErrors.value.includes(jt.PaymentDelegationError),U=z?e.translate("payment_errors.payment_credential_delegation_error"):void 0,G=U||d,Y=U?"critical":p,W=Ut(m),q=l.value&&G?n(V,{direction:"block",gap:W,paddingBlockEnd:W,children:[n(Oo,{message:G,tone:Y,inventoryRecoveryReceiptId:U?void 0:h}),!O&&a?.isFlagshipPartner&&n(Au,{onPaymentDelegation:H})]}):void 0;if(!l.value){const e=n(Er,{vaulted:!0,reason:"freeOrder"}),t="amazon"===I?{compact:e}:{primary:e};return n(ho,{id:"payment",label:N,primaryContent:t.primary,compactContent:t.compact,icon:n(K,{id:"payment-creditCardIcon",type:"credit-card",size:"fill"})})}const $=c.value,J=Xo($),X=J?.brand,Z=J?.lastDigits,Q=!(u.value&&$&&X&&Z),ee=Q?e.translate("payment.add_payment_method"):void 0,ne=n(x,{tone:"critical",children:e.translate("payment.add_payment_method")}),te=Z?n(x,{accessibilityVisibility:"exclusive",children:`${wu(X,e)} ${e.translate("payment.ends_with_label",{last_digits:Z})}`}):null,ae=n(x,{accessibilityVisibility:"hidden",children:n("bdi",{children:[wu(X,e),n(vo,{}),Z]})}),ie=(()=>
2{if(!Q)return n(V,{direction:"inline",gap:"small-400",alignItems:"center",children:[te,ae,n(Lo,{type:X,size:"small",accessibilityVisibility:"hidden"})]})})(),re=Q?n(x,{tone:D?"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:X})}),te,ae]}),oe=Q?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")})," ",te,n(x,{type:"strong",accessibilityVisibility:"hidden",children:[wu(X,e),n(vo,{}),Z]}),n(Lo,{type:X,accessibilityVisibility:"hidden"})]}),le="amazon"===I?{compact:oe}:"google"!==I||R?{primary:ie,secondary:void 0===ie?ne:void 0}:{primary:re};return n(ho,{buttonRef:F,id:"payment",label:N,open:O,disabled:O,onToggle:q?void 0:H,primaryContent:le.primary,secondaryContent:le.secondary,compactContent:le.compact,buttonAccessibilityLabel:ee,icon:n(K,{id:"payment-creditCardIcon",type:"credit-card",size:"fill"}),error:q,children:O?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:H}):null]}):null})}const Iu=new Set(["amazonPay","buyWithPrime"]);function Ru(){const{checkout:{identity:e}}=it();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}=it(),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=pl({requiresAvailableBalance:e}),{checkout:{negotiator:a}}=it(),{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?el.ShopCashNotAvailable:a?t:el.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}=it(),n=e.hasFlagEnabled(Gt);return Nu({requiresAvailableBalance:!n})}const Mu=()=>{const e=it().shopPay.app.config,n=fl();return Yt(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}=it(),r=zt(e?.embedder),o=i.app.config.surface,l=a.hasFlagEnabled(Wt),s=me();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}=it(),s=Mu(),{hasMerchandiseDiscounts:u}=(()=>{const{checkout:{negotiator:e}}=it(),n=e.current.fields.discountLines;return t(()=>{const e=n.value;return{hasMerchandiseDiscounts:!!e&&e.lines.some(e=>!!Pl(e)&&e.allocations.some(e=>"MERCHANDISELINE"===e.target.type)),orderDiscountAmount:e?e.lines.filter(e=>Pl(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(Z,{type:"small",children:h}),n(xu,{})]})},Fu=({adType:e,formatMinimumOrderAmount:n,formatRemainingAmount:t,formatOfferAmount:a,hasMerchandiseDiscounts:i})=>{const{i18n:r}=it(),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}=it(),{main:{section:a}}=ve(),i=Nu().value,r=Du().value,o=Lu(),l=ye().value.payment,s=Hu({eligibility:i,offerEligibility:r,discountOffer:o.value});return zt(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 ${Ut(n)??"none"} small-200 ${Ut(t)??"none"}`}function Uu({checked:e,onChange:t,disabled:a}){return n(Sl,{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}}=it(),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 nl;if(!e.method.redemptionContent?.details)return nl;const n={...nl};for(const t of e.method.redemptionContent.details){const e=tl.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:ml(t.destinationAmount),sourceAmount:hl(t.sourceAmount)};"SHOP_PROMOTION"===e?n.SHOP_PROMOTION=[...n.SHOP_PROMOTION,a]:n[e]=a}return n},$u=(e,n)=>{const t=e[n];return Array.isArray(t)?t.length>0:null!=t},Ku=()=>{const{checkout:{negotiator:e}}=it(),{paymentLines:n}=e.current.fields;return t(()=>qu(n.value?.lines.find(Wu)))},Ju=()=>{const{checkout:{negotiator:e}}=it(),{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}}=it(),a=Ju(),i=l(zo),r=i?.redemption.applying,{negotiate:o}=ge(),s=t.parts.paymentLines,u=vl(),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",...qt(["paymentLines","billingAddress"])]})}finally{_(()=>{r.value=!1})}},[r,e,o,c,s,a,d,u,n.session.isInternalProgressing])},Qu=()=>{const{checkout:{negotiator:e}}
2=it(),n=e.current.fields.subtotalAfterMerchandiseDiscounts,a=ft(),i=ec(),r=nc();return t(()=>{const e=a.value,t=e?{amount:al(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}}=it(),{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=Ku();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=il,ac=e=>{const{i18n:n,shopPay:t,webMcp:a,checkout:i}=it(),r=Yu(),o=Zu(),l=Ju(),u=Ku(),{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(()=>{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}=it(),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(Z,{type:"small",children:a})})},sc={availableBalance:null,redeemableBalance:null};function uc(){const e=g([]),n=Qu(),{checkout:a}=it(),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=[]),ll(e.current,t)})}const cc=()=>{const{recordRedemptionActionEvent:e}=yl(),{shop:n,shopPay:t}=it(),a=n.hasFlagEnabled(Wt),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=tl}={})=>{const t=Ku(),a=l(zo),i=a?.cashbackState.stale,{recordRedemptionAutomaticallyRemoved:r}=cc(),o=Zu({enabled:e}),u=Zo(j($t)).value;s(()=>
2{if(!e||!i||!u)return;let a=!1;for(const e of n)$u(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=Ku(),l=Ju(),u=e.filter(e=>!e.eligibility.eligible).flatMap(e=>e.redemptionTypes??tl),c=u.join(","),d=!!t&&a,p=t?u.filter(e=>$u(l.value,e)).join(","):"";s(()=>{if(!n||0===u.length)return;if(!t){const e=u.filter(e=>$u(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=>$u(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])};class hc extends Error{constructor(){super("Multiple Shop Cash payment lines present in negotiation response"),this.name="MultipleShopCashPaymentLinesAnomaly"}}const mc=({message:e})=>n(Q,{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(K,{type:"alert-circle",size:"small"}),n(Z,{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}=it();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}=it(),p=d.hasFlagEnabled(Gt);return pc([{eligibility:e,redemptionTypes:[il]},...p?[]:[{eligibility:n,redemptionTypes:[sl,ul]}]],{retryOnReady:p}),dc(),(e=>{const{client:n,shop:t,shopPay:a}=it(),{recordRedemptionVisibilityEvent:i}=yl(),r=n.unstable_getSerialization("apiClientId"),o=t.hasFlagEnabled(Wt),l=a.app.config.surface,c=Boolean("undefined"!=typeof window&&window.ReactNativeWebView),d=ye().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}=yl(),{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}}=it(),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=ye().value.payment,t=Nu().value,a=Du().value,{redeemableBalance:i,availableBalance:r}=(()=>{const{checkout:{negotiator:e}}
2=it(),n=e.current.fields.shopCashBalance.value,{redeemableTotal:t}=Qu().value,a=(()=>{const{checkout:{negotiator:e}}=it(),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=rl(t.currencyCode);if(t.amount<=i)return sc;if(t.amount<a.amount)return{availableBalance:a,redeemableBalance:t};const r=al(t.amount-a.amount,C(t.currencyCode));return r>=i?{availableBalance:a,redeemableBalance:a}:{availableBalance:a,redeemableBalance:ol({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}=it();return t=>{if(t)switch(t){case"SHOP_CASH_INVALID_BILLING_ADDRESS":return e.translate("shop_cash.redemption_invalid_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}}=it(),{paymentLines:i}=a.current.fields,r=Pt().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}=it(),i=a.negotiator.current.fields.buyerIdentity.value?.purchasingCompany,r=a.addressManager.shipping.value,o=r.selectedAddress.value?.id===Nl&&Kt(i)||!e;return n(V,{children:[o&&n(Z,{children:i?.location.name}),n(Z,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}}=it(),s=Xs(e),c=l.current.fields.buyerIdentity.value?.purchasingCompany,d=Tl(),p=fe(),h=Zo(j(bc)).value,{deliveryAddressErrors:m}=le().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(Ol,{name:`single_choice_list_${e}`,values:y,hideRadioControl:!0,children:n(Vo,{value:`single_choice_${e}`,children:n(V,{children:[n(Z,{children:c?.location.name}),n(Z,{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(de,{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}}=it(),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}=it(),{shippingAddress:a,name:i}=e.location,{secondary:r}=Pe({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}}=it(),r=i.parts.billingAddress.value,o=Ac().value,l=null!=o&&i.parts.billingAddressOption.value===o.option,u="form"!==be().value,c=l&&o.sameAsShipping&&!u,d=c?o.address:r,p=_e(d,{displayName:!1}),{isMissingPhone:h}=Al({addressType:"billing"}),{isMissingFirstName:m}=kl({addressType:"billing"}),v=h||m,y="billingAddress",b=Xs(y),_=Jt("deliveryNext").value,C=g(!0),{hasViolations:P,violations:S,clearViolations:A}=G(It),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}=it(),{billingAddress:i,billingAddressOption:r,shippingAddress:o}=t.negotiator.parts,l=Ac(),s=f(e=>{e?r.value="custom":Vt(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&&Vt(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:{...St(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(Ce,{errorType:F.PaymentError,tone:"critical",children:t.translate("address_management.invalid_billing_address_selected")})):R=n(Ce,{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}=it(),{buyerIdentity:n}=e.negotiator.current.fields,a=Se();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(we,{contentDisplay:"block",children:n(Ic,{})})})})}function Ic(){return n(pe,{blockSize:wc,inlineSize:wc})}const Rc=o({displayName:"VaultedContactAvatar",suspense:!1,load:()=>p(()=>e(()=>import("./68887467.Rk2uF3DC.js"),__vite__mapDeps([123,1,124,2,3,4,5,6,7,8,9,10,11,12,125]))),renderLoading:()=>n(Oc,{}),renderError:()=>n(Ic,{}),useError:Ee("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}}=it(),{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(Ie,{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(Re,{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:lt.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:lt.BuyWithPrime,size:"large"})}},businessCustomer:class extends Ec{get buyerIdentity(){return this.appContext.checkout.proposal.negotiated.fields?.buyerIdentity.value}get isOrderOrDraftSession(){return Oe(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 Te({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)&&Le({isFlagshipPartner:Boolean(this.appContext.embed?.isFlagshipPartner),hasError:this.hasError,hasOnlyDigitalItems:Ne(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=Ft({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(K,{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=bl(e,a.emailBlank),t=_l(e,a.emailInvalid),i=n??t;if(i)return{field:"email",error:i}}else if(n&&t){const e=bl(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()))&&Ht(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=it(),a=e.checkout.identity.current.value,i=u(()=>({appContext:e,identitySource:a}),[e,a]),r=Ve().value,o=e.client.unstable_getSerialization("logoutUrl")||"",l=function(){const e=it(),n=Ml(),a=Fe(),i=Co(),r=He(),o=function(){const{checkout:{wallets:e}}=it(),{persistedPayPalSignal:n,inMemoryPayPalParts:{accountStatus:t}}=ot(),{clearForcedCheckoutLayout:a}=Ae(Qt),i=f(()=>{n.value={isVenmo:!1},t.value={status:"not_connected"},a({wallet:e.escalatedWallet.value})},[e.escalatedWallet,n,t,a]);return ke({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}=it(),r=i.currentUrl.value,o=Boolean(a?.isFlagshipPartner)?"small":"medium",l=(t.enabled||a?.isCheckoutKit())&&Ht(e.app.config),s=ta(r.search),u=Cl({foregroundColor:Fl}),c=Cl({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}
2=it(),c=i.negotiator,{visibility:d,app:{config:p}}=l,h=Ht(p),{replaceShopPayInHistory:m}=Dl(),v=f((e,t)=>{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=De(v),{label:g}=Me(),b=Be({clearPii:!0}),_=xe(),C=Boolean(l.config.isReferral),P=f(()=>{i.unstable_setRedirectingExternally(!0),t.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.2",payload:{...St(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=De(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}}=it(),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(Q,{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(Z,{children:[!p&&d&&n(i,{children:[n(x,{accessibilityVisibility:"exclusive",children:s.translate("contact.phone_label")})," "]}),n(ze,{children:h})]}):h}),r&&n(El,{accessibilityLabel:s.translate("review.account_more_actions"),positionArea:"block-end",options:r})]}),l]})}function zc({layout:e,emailAlignment:t,...a}){const{i18n:i}=it(),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=xt(),c=g(!1),{embed:d,i18n:p}=it(),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 je(new Set([...sa].filter(e=>e.startsWith("DELIVERY_COMPANY"))))}function Gc({loading:e,countryCode:n,phone:t}){const a=ua(),{i18n:i,checkout:r}=it(),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}=it(),{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=Ue(l.countryCode,void 0,u),p=n.addressManager.shipping.value.selectedAddress.value,h=p?.address.countryCode,m=Ue(h??l.countryCode,void 0,u,null),{details:v}=da(h),y=!h||void 0!==v&&!v.isFallback,{clearViolations:f}=j(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"),jl({addressType:"shipping",validate:()=>c,setErrors:o})}}if(e.session.selectedShippingAddress.value||e.user.addresses.value.length)return{success:!0};const o=jl({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}}=it(),{geolocation:a}=Ge(),{shippingAddress:i}=n.parts;return t(()=>{const n=i.value;return e.signup.phoneCountryCode.value??n.countryCode??a.country.code})};function $c({padding:e}){const{i18n:t,shopPay:a,checkout:{negotiator:i}}=it(),{shopPayMobilePhoneInputShownSignal:r}=i.context,o=qc(),l=Boolean(a.user.phoneNumber.value),u=(()=>{const{i18n:e,shopPay:n}=it(),{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}=it(),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}=Ye(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(Ul,{name:"phone",countryCode:c.current,label:t.translate("mobile_phone_number.label"),autocomplete:"shipping tel",requireCountryCode:!0,disabled:l,onSelectedCountryChange:d,...u}),n(Z,{type:"small",color:"subdued",children:t.translate("mobile_phone_number.disclaimer")})]})}const Kc="shipping";
2function Jc({filteredFields:e,additionalFieldGroups:t,children:i,settings:r}){const o=va(),{shouldGateCrossBorder:l,crossBorderGate:u}=Yl(),c=it(),{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}=j(sa),A=S.value,k=p.fields?.countryCode.value,E=We(k),w=g(!1);s(()=>{if(!P)return;if(w.current)return;if(0===A.size)return;if(w.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=E(Kc,Array.from(A));_(()=>{for(const[n,t]of e)void 0===d[n]?.value&&(d[n].value=t)})},[P,A,E,d]);const O=C.addressSettings.nonBillingAddressSettings.value,I=p.value,R=ya(),T=Zo(j(Yc)).value,L=C.defaultPhoneNumber.value;O.isRequired("phone",{countryCode:I.countryCode,useMerchantSettings:!0})&&!I.phone&&L&&(p.value={...I,phone:L});const N=v(Boolean(e&&e.length>0)),D=C.trackAddressAutoComplete?()=>{y.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.2",payload:{...St(f,h,b),action:"address_autocomplete"}})}:void 0,M=n(qo,{id:"shippingAddressForm",addressType:Kc,address:p,countries:o,settings:r,addressErrors:d,additionalFieldGroups:t,showSavedAddressSelector:!1,onAddressAutoComplete:D,onBeforeCountryChange:(e,n,t)=>{l(e)?u(n,{onCancel:t}):n()},filteredFields:e,children:i}),x=n(a,{when:N,fallback:M,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(Z,{children:[I.firstName," ",I.lastName]}),n(Wl,{address:I,hiddenFields:["firstName","lastName","phone"],textColor:"subdued"})]}),M]})})});return n(Gl,{impressionType:"delivery_address",impressionFeatures:[],children:[Xc(c)&&n(Wc,{}),T&&C.visibility.showInvalidDeliveryAddressBanner.value&&n(B,{children:[n(Oi,{}),n(pe,{blockSize:"base"})]}),n(a,{when:R,children:n(B,{children:[n(Ie,{tone:"info",children:m.translate("address_management.draft_order_delivery_address_reminder")}),n(pe,{blockSize:"base"})]})}),x,n(a,{when:C.visibility.showStandalonePhoneField,children:n($c,{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=qe(),{checkout:{negotiator:n}}=it(),{paymentLines:a}=n.parts,{walletUsedForSubmissionSignal:i}=ot();return t(()=>e.value||ns({paymentLines:a.value,walletUsedForSubmission:i.value}))}function ed(e,n){return e.isAddressDelegationEnabled&&"shopPay"!==n&&!Pa(n)}const nd=new Set([...sa,...ba,...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}}=it(),t=e.current.fields.buyerIdentity.value?.purchasingCompany,a=fe();return t?n(fc,{formattedAddress:a}):void 0}(),c=u??e,d=v(function(){const{i18n:e}=it(),t=Zo(j(ba)).value,a=Zo(j(_a)).value,{hasError:i,error:r}=w(Ca),o=ae(r?{type:"payment",code:r}:void 0);return i&&o?n(Ce,{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}=it(),{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}=Al(),{isMissingFirstName:G}=kl(),Y=z||G,W="google"===C?.embedder,q=O.configuration.addressSettings.nonBillingAddressSettings.value,$=t(()=>W&&q.isVisible("phone",{countryCode:T.value?.countryCode})),{formattedNumber:J}=zl(T.value?.countryCode??"",$.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(()=>
2function(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)),[ie,re]=b([]),{availableDeliveryAddresses:oe,mustSelectProvidedAddress:se}=O.proposal.negotiated.fields,ue=t(()=>oe.value??[]),ce=t(()=>se.value??!1),pe=U("Checkout::DeliveryAddress::RenderBefore"),he=U("purchase.checkout.delivery-address.render-after"),me=Io([...pe,...he],{lazyReveal:!0}),ve=Je(),ye=t(()=>ue.value?.length&&Boolean(ue.value.find(e=>pa(T.value,e.address)))),ge=t(()=>Boolean(ye.value&&ce.value)),be=Xe(),Se=xt(),Ae=ka(Ze),ke=t(()=>Se.value&&"loading"===Ae.uiStateSignal.value?.status),Ee=t(()=>"filled"===Ae.uiStateSignal.value?.status),we=t(()=>!X.value||!te.value&&Ee.value),Oe="deliveryAddress",Re=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])}}(be,Re),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([...pe,...he],"uiExtension").map(Dt),f(()=>{we.value&&(Re.value=!0)},[we,Re]));s(()=>{Fe&&we.value&&(Ve.value=!0)},[Fe,Ve,we.value]);const He=t(()=>X.value&&Ve.value);s(()=>{we.value&&(me.value||Fe)&&(Re.value=!0)},[me.value,we.value,Fe,Re]),S(()=>{ve.current&&(X.value&&te.value||X.value&&xe||!1===ye.value&&(Re.value=!0))},[ye.value,Re,ve,X.value,te.value,xe]),Zs({isMissing:Y,open:Re});const ze=le(),je=ze.value.deliveryAddressErrors,Ue=t(()=>ze.value.deliveryAddressErrors.length>0),Ge=Qc().value||"payPal"===O.identity.current.value,{violations:Ye,clearViolations:qe}=j(nd),en=Ye.value,nn=en.size>0,{missingAddressFieldSignal:tn,hasResolvedMissingAddressFieldSignal:an}=function({countryCode:e,addressType:n,addressViolations:t}){const{shop:a,checkout:{identity:i}}=it(),r=a.hasFlagEnabled(fa),o=y(void 0),{violations:l}=$e(t),s=l.value,u=We(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=Ke({addressErrors:e});t&&(o.value=t)}return{missingAddressFieldSignal:o,hasResolvedMissingAddressFieldSignal:c}}({countryCode:T.value?.countryCode,addressType:"shipping",addressViolations:sa}),rn=t(()=>Boolean(tn.value)&&!Re.value),on=new Set([...z?wa:[],...G?Oa:[],...rn.value?sa:[]]),ln=to(nn,en,on),{hasError:sn,clearError:un}=w(Ca),cn=M.agreementError.value===cl.InvalidShippingAddress,dn=Jt("deliveryNext"),pn=t(()=>!Se.value||dn.value);h(()=>{ke.value&&m(()=>{un(),M.unstable_setAgreementError(null)})});const hn=f(()=>{qe(),un(),M.unstable_setAgreementError(null)},[qe,un,M]),mn=_e(T.value,{hiddenFields:["phone"],displayName:!1}),vn=P.formatName(T.value?.firstName,T.value?.lastName,!0),yn=T.value?.firstName&&T.value?.lastName?vn:void 0,gn=Pe({address:T.value??{}}),fn=n(a,{when:te,fallback:n(V,{children:[mn,$.value&&J&&n(x,{children:J})]}),children:n(x,{tone:"critical",children:P.translate("shipping.add_shipping_address")})}),bn=te.value?n(x,{tone:N?"critical":void 0,children:P.translate("shipping.add_shipping_address")}):yn,_n=te.value?void 0:n(V,{children:[gn.primary&&n(x,{children:gn.primary}),gn.secondary&&n(x,{children:gn.secondary}),$.value&&J&&n(x,{children:J})]}),Cn=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:yn})]}),children:n(x,{tone:"accent",decoration:"underline",children:P.translate("shipping.add_new_delivery_address")})}),Pn=t(()=>T.value?.postalCode),Sn=n(a,{when:()=>te.value||!Pn.value,fallback:n(V,{children:[n(x,{type:"strong",children:Pn}),$.value&&J&&n(x,{children:J})]}),children:()=>""}),An=(()=>{if(c)return{primary:c};switch(C?.embedder){case"amazon":return{compact:n(V,{direction:"inline",gap:"small-400",alignItems:"center",children:[Cn,Sn]})};case"google":return{primary:bn,secondary:_n};default:return{primary:yn,secondary:fn}}})(),kn=t(()=>Qe(L.value??[])&&!ke.value),En=v(ln&&!kn.value||sn||cn),wn=t(()=>pn.value?null:En.value&&ne&&!ke.value?{type:"invalid-address-banner",element:ne}:!d.value||kn.value||ke.value?!Ue.value||Ge||kn.value?kn.value?{type:"unavailable-in-buyer-location-banner",element:null}:null:{type:"validation-errors-banner",element:n(de,{errors:je,errorType:F.DeliveryError})}:{type:"default-vaulted-delivery-address-error-banner",element:d.value}),On=n(sd,{errorSignal:wn}),In=t(()=>Boolean(wn.value)||Ge&&Ue.value),Rn=v(ln),Tn=v(sn),Ln=v(r),Nn=v(Fe),Dn=t(()=>Q.value||Rn.value||Ue.value),Mn=t(()=>Boolean(Ln.value)||me.value||Nn.value&&we.value||He.value),Bn=t(()=>X.value&&id(Me.value)&&rd(Me.value)&&!Mn.value&&!Tn.value&&!kn.value),xn=t(()=>an.value&&void 0===tn.value),Vn=t(()=>Dn.value&&!Bn.value),Fn=t(()=>X.value&&Ee.value&&!Vn.value),Hn=t(()=>Fn.value&&rd(Me.value)),zn=t(()=>Mn.value||Tn.value||xn.value||!Bn.value&&In.value),jn=t(()=>Dn.value&&!(X.value&&id(Me.value))||kn.value||Mn.value||Tn.value);De.current=jn.value;const Un=t(()=>{if(X.value){if(te.value)return!1;if(Hn.value)return zn.value;if(Q.value&&!Bn.value&&(!an.value||!tn.value))return!0}return Re.value||zn.value}),Gn=f(()=>{Ne.current&&(clearTimeout(Ne.current),Ne.current=null)},[]),Yn=f(()=>{Gn(),Me.value="idle"}
2,[Gn,Me]),Wn=f(()=>{if(Gn(),De.current)return Me.value="collapsed",void(Re.value=!0);Me.value="collapsed",Re.value=!1},[Gn,Me,Re]),qn=f(()=>{Gn(),Ne.current=setTimeout(()=>{Ne.current=null,De.current||(Me.value="pendingCollapsed",Re.value=!1)},300)},[Gn,Me,Re]),$n=f(()=>{Yn(),Re.value=!0},[Yn,Re]);s(()=>Gn,[Gn]),s(()=>{X.value&&Dn.value&&!Be&&Yn()},[Be,Dn.value,X.value,Yn]);const Kn=f(async()=>{if(!X.value||!C?.client)return;if(id(Me.value))return;re([]),Me.value="pending";const e=Un.value;He.value||qn();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 $n();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}),Yn(),Re.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 $n())}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 $n();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 $n();if(r?.cart){_(()=>{for(const e of Object.values(Z))e.value=void 0;qe()});try{await C.client.applyCart(r.cart),Ae.dispatch("addressReplaced"),He.value?Yn():Wn(),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()}),re([{code:"GENERAL_ERROR"}]),$n()}}else He.value?Yn():Wn()}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"}]),$n()}},[He,X,C,k,re,P,Z,Me,Ae,qe,Un,qn,$n,Yn,Re,Wn]),Jn=f(async()=>{if(He.value)return;if(X.value){if(Re.value)return;return void(await Kn())}const e=!Re.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:{...St(a,e,t),action:i?"shipping_addresses_expand":"shipping_addresses_collapse"}})}({userEvents:E,source:I,checkout:O,shop:R},e),Re.value=e},[He,E,I,O,R,Re,Kn,X]);s(()=>{!X.value||!xe||Vn.value||zn.value?Un.value?Re.value=!0:Hn.value&&!zn.value&&(Re.value=!1):Re.value=!1},[Re,X.value,xe,Vn.value,Un.value,Hn.value,zn.value]);const Xn=0===pe.length&&0===he.length,Zn=1===ue.value.length&&ce.value&&Xn,Qn=p.value,et=!pn.value&&!ke.value&&!Bn.value&&ln&&!(X.value&&te.value),nt=X.value&&!Bn.value&&Q.value&&!te.value,tt=et||nt,at=(()=>{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:mn}),children:n(x,{tone:"critical",children:P.translate("address_management.address_form.add_address")})})]})}return c??mn})(),rt=te.value?P.translate("shipping.add_shipping_address"):void 0,ot=be&&!Un.value?n($l,{vatNumber:be.taxId.value,onAdd:()=>{Re.value=!0,Te.focus()}}):void 0,lt=rn.value?n(B,{padding:"none base base base",children:n(Jc,{filteredFields:tn.value?[tn.value]:void 0})}):void 0,st=lt&&ot?n(V,{direction:"block",gap:"base",children:[lt,ot]}):lt??ot,ut=n(Ie,{tone:"info",children:P.translate("address_management.draft_order_delivery_address_reminder")}),ct=Hn.value&&!zn.value||Bn.value?null:p.value?n(i,{children:[On,ut]}):wn.value?On:null,dt=rn.value?{}:{primaryContent:An.primary,secondaryContent:An.secondary,compactContent:An.compact,inlinePrimaryContent:bn,inlineSecondaryContent:_n,compactPrimaryContent:Cn,compactSecondaryContent:Sn,summary:at},pt={buttonRef:Le,open:Re.value,id:Oe,label:P.translate("shipping.shipping_address_title"),error:ct,buttonAccessibilityLabel:rt,...dt,secondaryPersistentContent:st,onToggle:Qn?void 0:Jn,disabled:He.value||Zn||!Fn.value&&tt,renderChildrenWhenCollapsed:!0,icon:n(K,{id:"deliveryAddress-truckIcon",type:"truck",size:"fill"})},ht=n(Us,{embedderErrors:ie,onDismissEmbedderErrors:()=>re([]),showMissingAddressField:rn.value,onAddressDelegation:Kn,onFirstNamePersisted:hn,vatIdFieldMode:Te});return n(i,{children:[H&&n(Wc,{}),l?l(pt,ht):n(ho,{...pt,children:ht})]})}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;
2switch(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}}=en(["company"]),r=!N().value,{errorSignal:o}=Gc({loading:r,phone:t,countryCode:a}),l=Boolean(Uc()?.length),s=Boolean(nn()?.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(K,{tone:"critical",type:"alert-circle"}),n(pe,{display:"inline",inlineSize:"small-400"})]}),e]}),forceOpen:c})}function cd(e){const{checkout:{identity:a}}=it(),i=function(){const{checkout:{negotiator:e}}=it(),n=e.current.fields.buyerIdentity,a=tn(),i=an();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}}=it(),o=r.current.fields.buyerIdentity.value?.purchasingCompany,l=Tl(),s=an(),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(Q,{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}=it(),{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}=it(),{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}=it(),r=ye(),[o]=rn(),l=o.includes("PICK_UP"),{value:s}=on().value,{value:u}=ln().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=sn(),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}=it(),l=sn(),s=La(),{progressing:u}=ge(),c=Jt("deliveryNext").value,d=xt(),{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=un({methods:m.value,selectedDeliveryMethodHandle:g.value?.handle}),P=t(()=>cn(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}}=it(),{deliveryNext:s}=l.current.fields,{progressing:u}=ge(),c=Jt("deliveryNext"),d=xt(),{value:p}=on().value,{value:h}=ln().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=_e(_.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(dn,{customizations:E,options:yd}):void 0,R=w.length>0?n(dn,{customizations:w,options:yd}):void 0,T=zi(),L=un({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,$;const K=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(dn,{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:[K,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:$,primaryAction:X,secondaryActions:Z},ee=n(Gs,{onShowModal:F}),ne=a?n(V,{gap:"base",children:[n(ql.Provider,{value:!1,children:n(md,{onShowPickupLocations:()=>F()})}),X,ee,Z]}):S&ⅇ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}=ge(),l=Jt("deliveryNext"),s=on(),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}=it();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=pn();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}=it(),a=v(pn()),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}}=it(),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(rs,{})})};function Ed(){const{i18n:e,checkout:t}=it(),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=_e(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}=it(),a=_e(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}=it(),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}=it(),i=bt(),{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=ss(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}=it(),n=hn(Va.SHOP_PAY_PAY_NOW),t=hn(Va.SHOP_PAY_INSTALLMENTS),a=hn(Va.SHOP_PAY_INSTALLMENTS_DEFAULTED),i=hn(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}=it(),{visibility:d}=u,p=i.installments.isSupported.value,h=i.installments.isUnavailable.value,m=mn(),v=ss(u),{paymentMethods:y}=i.negotiator.current.fields,f=t(()=>
2xa(y.value)),b=p?f.value?.availableLoanTypes:void 0,_=g(),C=gl(),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:{...dl(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:{...dl(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}=it(),t=y(!1),a=Id(),i=vn(),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}=it();return n(ho,{label:e.translate("pickup_point.title"),open:!0,children:n(yn,{rowsInset:!0,children:n(qi,{heading:"none"})})})}function Dd(){const{userEvents:e,shop:n,source:t,checkout:a}=it();return{trackOnDeliveryToggle:f(i=>{e.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.2",payload:{...St(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:{...St(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])}}const Md=o({displayName:"ShippingGroupsSummary",load:()=>p(()=>e(()=>import("./17a5f1e4.40suTqtd.js"),__vite__mapDeps([126,1,2,3,4,5,6,7,8,9,10,11,12,93,94,95,127,85,21,22,18,23,19,24,66,43,67,68,69,70,71,41,42,44,45,46,47,48,49,50,51,72,40,73,74,75,76,77,78,79,80,81,56,82,83,84,86,96,97,98,99,100,101,102,103,13,14,15,16,17,20,25,26,27,28,29,30,31,32,33,34,37,38,39,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 Bd({lines:e,hideThumbnail:t,shippingTime:a}){const{i18n:r,checkout:o}=it(),{deliveryExpectationLines:l}=hs(),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}=bn(t,l||[],Boolean(h||c));return n(V,{gap:"small-400",children:n(B,{children:[n(ms,{methodTitle:_n({deliveryMethod:t,localDelivery:p?r.translate("shipping.local_delivery"):void 0}),showInterpunct:!0,price:n(vs,{cost:o,costAfterDiscounts:u,inlineDiscount:!0})}),a?n(Z,{color:"subdued",size:s?void 0:"small",children:a}):n(ys,{deliveryMethod:t,deliveryExpectationLine:m,estimatedTimeInTransit:d,paragraphColor:"subdued"})]})},i)};return n(i,{children:e.map(e=>{const a=gn(e.targetMerchandiseLines??[]);return a.slice(0,1).map(i=>n(Q,{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(fn,{variant:"fan-legacy",merchandise:a,size:"small",useResponsiveImageSources:!0,useTitleAsAltTextFallback:!0}):n(us,{merchandiseItem:i,hideBadge:!0})),u(e)]},i.id))})})}function xd({deliveryNextValue:e}){const t=Ua(e).filter(Cn);return t.length?n(Q,{gridAutoRows:"minmax(0, 1fr)",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",gap:"small-200",children:n(Bd,{lines:t,hideThumbnail:1===t.length})}):null}function Vd({cost:e,costAfterDiscounts:t,hideDiscountedTotalOnShippingSelector:a,styleOverrides:i={}}){return e&&t?n(vs,{cost:e,costAfterDiscounts:t,inlineDiscount:!0,preDiscountCost:a,styleOverrides:i}):null}function Fd(){const{i18n:e,checkout:{identity:{current:t}}}=it(),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(Hd,{})}function Hd(){const{embed:e,i18n:a,checkout:r}=it(),o=cs(),{hasMultipleDeliveryGroups:l}=o.value,s=r.configuration.isAddressDelegationEnabled,{customizationsForRollupReveal:u}=ds({hasMultipleDeliveryGroups:l,targeted:!1,shouldHandleRollup:!0}).value,c=U("Checkout::ShippingMethodDetails::RenderAfter"),d=U("Checkout::ShippingMethodDetails::RenderExpanded"),{uiStateSignal:p}=ka(Ze),{hasViolations:m}
2=G(Ga),y=v(m),g=Qc(),b=Zo(Pn(Ya)),_=t(()=>g.value&&b.value),C=sn(),P=Io([...u,...c,...d],{lazyReveal:!0}),S="shippingMethod",A=Xs(S,P.peek()),k=v(qs(Ea([...u,...c,...d],"uiExtension").map(Dt),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}}=it(),l=o.current.fields.deliveryNext,s=Jt("deliveryNext"),{deliveryExpectationLines:u}=hs(),{rollup:{secondaryContent:{typography:{color:c}={}}={}}={}}=he(),d=sn(),p=c??"base",h="filled"===e.status?e.deliveryLines:void 0,m=Jl({deliveryLines:h}
2),v=Zo(j(za)).value,y=Zo(j(ba)).value,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(ja(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(Md,{});return m?e=n(Zl,{summary:m}):d.value&&(e=n(xd,{deliveryNextValue:l.value})),{compactPrimaryContent:void 0,compactSecondaryContent:void 0,inlinePrimaryContent:void 0,inlineSecondaryContent:void 0,primaryContent:e,secondaryContent:m?n(Xl,{summary:m,secondaryContentColor:p}):void 0}}const f=d.value?e.deliveryLines.filter(Cn):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=_n({deliveryMethod:b,localDelivery:"LOCAL"===b.methodType?r.translate("shipping.local_delivery"):void 0}),A=u?.find(e=>e.deliveryStrategyHandle===b.handle),k=n(ms,{methodTitle:S,showInterpunct:!0,price:C&&_?n(Vd,{cost:C,costAfterDiscounts:_,hideDiscountedTotalOnShippingSelector:P}):void 0}),E=n(ys,{deliveryMethod:b,deliveryExpectationLine:A,paragraphColor:c??"base"});return{compactPrimaryContent:n(x,{type:"strong",children:n(ms,{methodTitle:S})}),compactSecondaryContent:n(i,{children:[n(ys,{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(Vd,{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(K,{id:"shippingMethod-packageDeliveryIcon",type:"package-delivery",size:"fill"}),children:n(zs,{singleDeliveryGroup:o})})}const zd={rollup:{label:{visibility:"visible"},blockAlignment:"center"}},jd={rollup:{label:{visibility:"hidden"},blockAlignment:"center"}},Ud={SHIPPING:{id:"shippingMerchandiseList"},PICK_UP:{id:"pickupMerchandiseList"}};function Gd({selectedDeliveryMethodType:e}){const{i18n:i}=it(),r=sn(),{showOverlay:o}=Sn(),l=y(!1),s=Ud[e],u=$i(e),{visibleSummary:c,isNegotiating:d}=Ki(u),p=xt(),{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(fn,{variant:"fan-legacy",sortByPrice:!0,merchandise:c.value?.merchandiseLines??[],size:"small"});if(h.value)return n(uo,{theme:zd,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?jd:zd,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 Yd(){const{rollup:e}=he(),{padding:t}=ti({padding:[e?.blockPadding??"base",e?.inlinePadding??"base"]});return n(B,{padding:t,children:n(dd,{})})}function Wd({hideLastDivider:e,showTopDivider:i,stripBlockEndPadding:r}){const o=ye(),{negotiate:l}=ge(),{checkout:u,embed:c,shop:d,source:p}=it(),h=Qi(),m=t(()=>o.value.delivery&&u.isShippingRequired.value),v=t(()=>m.value&&h.value),y=$a({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(Bt(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 qd({sections:e,hideLastDivider:t,showTopDivider:a,stripBlockEndPadding:i}){const{checkout:{identity:r},shop:o}=it(),l=function(e,n){return"guest"===e.current.value||"businessCustomer"===e.current.value&&n}(r,ye().value.payment),{vaulted:{spacing:s="none",cornerRadius:u,divider:{borderWidth:c="base",borderStyle:d="base",borderColor:p,visibility:h="visible"}={}}={}}=he(),{main:{section:m}}=ve(),{rendered:v}=En(),y=o.hasFlagEnabled(la),g=!l&&!is(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:Kd(n),blockEnd:Kd(t)}}(y?void 0:f);return 0===e.length?null:n("div",{className:P("K6vpG",is(a)&&"CU3YS",g&&"_5HWz9",b&&"r8rqQ",(_||i)&&"_2Ojsq"),style:Jd({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=ye(),{checkout:t,shop:a,embed:r,i18n:o,source:l}=it(),{identity:s,identity:{current:c}}=t,d=c.value,p=a.hasFlagEnabled(Ba),h=a.hasFlagEnabled(la),m=An(),v=kn(),y=$a({checkout:t}),g=m.value&&!v.value,f=sn(),b=Qi(),_=void 0!==La().value,C=Jt("deliveryNext"),P=xt(),{deliveryLines:A}=t.negotiator.parts,k=Ka(A.value??[]).filter(e=>e.requiresShipping).length>0,w=$i("PICK_UP").value.length>0,O=function(){const{eligibility:e,messages:n,redeemableBalance:t,discountOffer:a,shopPromotionDiscounts:i,isDigitalGoodsRedemptionAllowed:r}=yc(),o=Ku();if((e.eligible||r)&&t)return!0;const l=a?.value?.redeemableAmount,s=i.length>0;return!(!e.eligible||!l&&!s)||!!tl.some(e=>$u(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(Gd,{selectedDeliveryMethodType:"SHIPPING"},e);case"shippingMethods":return n(Fd,{},e);case"pickupMerchandiseList":return n(Gd,{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?Yd:dd,{},"deliveryHeading")),x=!0),a.push(n(ce,{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=sn();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(qd,{sections:s,hideLastDivider:!d||is(e),showTopDivider:c&&is(t),stripBlockEndPadding:d&&a})});return l?n(V,{gap:"base",children:[l,p]},o):n(i,{children:p},o)})}):n(qd,{sections:r.flatMap(e=>e.elements),hideLastDivider:e,showTopDivider:t,stripBlockEndPadding:a})})}function Kd(e){return null!=e&&"none"!==e}function Jd({spacing:e,borderWidth:n,borderStyle:t,borderColor:a,visibility:i,cornerRadius:r}){const o=Xd[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":Zd[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 Xd={none:"0px",...ai.spacing},Zd={base:"solid",dashed:"dashed",dotted:"dotted"};function Qd(){const{methods:e}=wn(),{userEvents:n,shop:t,source:a,checkout:i}=it(),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:{...St(a,i,t),action:`delivery_method_${r.toLowerCase()}_selected`}}))})}function ep(){Qd();const{shop:e,i18n:t,checkout:a}=it(),i=pn(),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(ql.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 np(){const{source:e}=it(),t=ye(),a=On(),r=pn(),o=Ad();return Bt(e)||!t.value.delivery?null:n(i,{children:[n(ep,{}),a.value&&r&&!o.value?n(pe,{blockSize:"base"}):null]})}function tp({placement:e}){const{checkout:a,embed:i,shop:r,shopPay:o}=it(),{current:l}=a.identity,s=ye(),u=oi(),c=gs();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(ap,{vaultedContactTypeOverride:"sdkCartHints"===l.value?"base":void 0})}function ap({vaultedContactTypeOverride:e}){const t=Vc();Fc(t);const r=y(!1),o=xt(),{embed:l}=it(),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 ip({showDelivery:e,insideVaultedCard:t}){const{embed:r,shop:o}=it(),l=Ad(),{rollup:{inlinePadding:s}}=he(),u=n(i,{children:[n(tp,{placement:"vaulted-adjacent"}),n(a,{when:e,children:n(np,{})}),n(a,{when:()=>!l.value,children:n(md,{})})]}),c=zt(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 ${Ut(s)??"none"}`:void 0;return c?n(B,{padding:d,children:u}):u}const rp=(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 op(e,n,t,a){const i=e?.status;return"pending"===i||(t||a)&&("filled"===i||n)}const lp=({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=Ku();!function(e,n=!0,a){const{setShopOfferReconciliationPending:i}=it().shopPay,r=function(e,n){const a=v(e),i=v(n),r=Ku(),{checkout:{negotiator:o}}=it(),{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(op(s.value,i,o,t.has("shopPromotion")))return!0;if(d?.length){if(n?!rp(a,d):i||c)return!0}else if(i)return!0}const p=l.value,h=e.SHOP_DISCOUNT_OFFER?.destinationAmount;if(op(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?!rp(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 sp({active:e,ready:t}){const{i18n:a}=it(),i=e.value&&!t.value?a.translate("general.loading"):null;return n(B,{accessibilityRole:"status",accessibilityVisibility:"exclusive",children:i})}const up=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(we,{contentDisplay:"block",blockSize:"48px"})]})})},load:()=>p(()=>e(()=>import("./7aefefff.xStqsVa6.js"),__vite__mapDeps([128,1,2,3,4,5,6,7,8,9,10,11,12,129,130,131,41,42,43,44,45,46,47,18,48,49,50,22,23,19,51,36,27,37,38,39,40,13,14,15,16,17,20,21,24,25,26,28,29,30,31,32,33,34,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,149,82,83,106,150,105,69,70,64,65,66,71,72,78,79,80,84,85,86,61,87,88,89,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 cp({children:e,fillAvailableBlockSize:t,ready:a}){const{checkout:i}=it(),{progress:r}=ge(),o=bs(),l=f(()=>{r("one-page-form-submit",void 0,{skipToCompletion:o.value})},[r,o]),s=gr(l);return n(In,{disabled:!a.value,onSubmit:s,contentsClassName:t?"ifz7X":void 0,children:e},i.identity.current.value)}function dp({loading:e,lineItems:t,onClose:a}){const{i18n:i,url:r,checkout:{configuration:{allowRedirectToStorefront:o},negotiator:l}}=it(),{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(Tn,{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(Z,{children:i.translate("stock.price_update.description")}),n(B,{children:n(Cs,{loading:e,lineItems:t,type:Rn.PriceChange})}),n(V,{direction:"inline",gap:"large-300",alignItems:"center",justifyContent:"end",children:[d,c]})]})})}function pp(e){return e.some(e=>"MERCHANDISE_EXPECTED_PRICE_MISMATCH"===e.code)}function hp(){const{checkout:{wallets:e,negotiator:i}}=it(),r=function(){const{checkout:{negotiator:e}}=it(),n=Jt("merchandiseLines"),a=e.parts.merchandiseLines,i=y(m(()=>a.value));return t(()=>{const t=e.current.fields.allViolations.value,a=pp(t??[]),r=e.current.fields.merchandiseLines.value,o=n.value,l=r?.lines??[],s=i.value,u=Ln(s,l,t,Nn).map(({proposed:e,negotiated:n})=>({line:e??n,problem:{type:Rn.PriceChange,negotiatedPrice:n?.itemPrice,proposedPrice:e?.itemPrice}}));return{hasViolation:a,loading:o,lineItems:u,updateProposal:()=>{u.length>0&&(i.value=l)}}})}(),o=Dn(),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(dp,{loading:e.loading,lineItems:e.lineItems,onClose:d})})}function mp(){const{i18n:e,shop:t}=it(),a=Mn(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 vp(){const{checkout:e,embed:a,shopPay:r}=it(),o=_s(),l=bs(),s=ye(),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(Ql,{}):null,l.value?n(es,{isVaultedReview:!0}):null,u?n(mp,{}):null,h&&!c?n(pe,{blockSize:"base"}):null]}):null}function yp(){const{embed:e,shop:t}=it();return a=>
2!e?.isFlagshipPartner||zt(e.embedder)||Ft({embedder:e.embedder,shop:t})?a:n(yn,{children:a})}function gp({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(ce,{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 fp({extensions:e,hideDivider:t="always"}){const a=yp();return n(dn,{gap:"base",customizations:is(e),render:(e,i)=>i?a(n(oo,{hideDivider:t,children:e})):e})}function bp(e){const{i18n:n}=it(),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=Ua(e);return function(e,n){const t=(n||[]).filter(ci).map(ts);return as(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 _p(){const{shopPay:e,checkout:{negotiator:n}}=it(),{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=bp(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=os(m);return{methodsByType:c,availableDeliveryMethods:l,availableDeliveryMethodsLoading:d,progressiveShippingRatesLoading:v}}function Cp({onChange:e,prerequisitesLoading:n}){const{checkout:{negotiator:t}}=it(),{value:a}=t.current.fields.deliveryNext,i=Jt("deliveryNext").value,r=vi(a,"ONE_TIME_PURCHASE",!0),o=bp(a),[l]=Bn({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 Pp(){const{i18n:e}=it(),{availableDeliveryMethodsLoading:n,progressiveShippingRatesLoading:t}=_p(),a=n&&!t,{selectedDeliveryMethod:i}=Cp({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 q({content:r})},[r]),null}function Sp(){return xn("ONE_TIME_PURCHASE")?n(Pp,{}):null}function Ap({includeContact:e=!0}={}){const n=ye(),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&&Dt(e)===Dt(t)}))?p:(c.current=d,d);var h,m})}const kp=[fr.Button,br.Button,_r.StickyFooter,Cr.Wrapper];function Ep(){const{shopPay:e,checkout:t}=it(),[a]=Vn("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($c,{}):null}const wp="contact";function Op({loginLink:e,title:a}){const{router:i}=it(),r=t(()=>Js(i,wp));return n("div",{className:"nnGzs",children:[n(E,{id:wp,level:1,autoFocus:r.value,children:a}),e]})}function Ip(){const{client:e,i18n:t,source:i}
2=it(),r=Fn(),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")})})}Ip.displayName="LoginLink";const Rp=()=>{const{i18n:e,userEvents:t,source:a,checkout:i,shop:r,shopPay:o}=it();return n(R,{onClick:()=>{t.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...St(a,i,r),action:"click_shop_pay_sign_in"}}),o.session.unstable_updateVerificationTrigger({source:Qo.LoginLink})},children:e.translate("account_management.sign_in_shop")})};function Tp({identityPresentation:e="form",showEmailMarketingOptIn:t}){const a="vaulted"===e,{i18n:r,checkout:{identity:o,validation:{contactErrors:{emailInputError:l}}},shopPay:u}=it(),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(Op,{title:r.translate("contact.contact_method_title")}),n(pe,{blockSize:"base"}),n(tp,{placement:"standalone-vaulted"})]}:{children:[c&&n(i,{children:[n(Vl,{color:"branded"}),n(pe,{blockSize:"base"})]}),n(Op,{title:r.translate("contact.contact_method_title"),loginLink:n(Lp,{})})]}),n(pe,{blockSize:"base"}),n(Ei,{hideAllOptIns:c&&!a,hideCustomerCard:a,showEmailMarketingOptIn:t,onValidateEmailInput:h}),c&&!a&&n(Ep,{})]})}function Lp(){const{checkout:{identity:e}}=it(),t=So();return"shopPay"!==e.current.value?n(Ip,{}):t===bi.UnauthenticatedCheckout?n(Rp,{}):null}const Np=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(dn,{customizations:o,gap:"base",marginBlockEnd:"large300"})}):null,e?n(Gl,{impressionType:"contact",impressionFeatures:[],children:[n(Tp,{identityPresentation:t,showEmailMarketingOptIn:a}),r.length?n(i,{children:n(dn,{customizations:r,marginBlockStart:"base"})}):null,l.length?n(i,{children:n(dn,{customizations:l,gap:"large-200",marginBlockStart:"large300"})}):null]}):n(i,{children:[r.length?n(i,{children:n(dn,{customizations:r,marginBlockStart:"base"})}):null,l.length?n(i,{children:n(dn,{customizations:l,gap:"large-200",marginBlockStart:"large300"})}):null]})]})});function Dp(){const{checkout:{identity:e},i18n:t}=it(),{hasViolations:a}=G(ca),{hasViolations:i}=G(_a),r=Zo(j(_i)).value;if(a&&Mp({identity:e}))return n(or,{});if(r)return n(ce,{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(ce,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(Ce,{tone:"critical",heading:t.translate("shipping_errors.title"),errorType:F.DeliveryError,children:o})})}const Mp=({identity:e})=>"shopPay"===e.current.value,Bp=[{handle:"first"},{handle:"second"}];function xp(){const{i18n:e}=it(),{shippableDeliveryLines:t}=Hn().value,a=t?.[0]?.methods||Bp;return n(Ol,{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(we,{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(zn,{content:a,size:"small"}):null]})},t)})})}function Vp(){const e=it();return n(Rl,{children:n(Il,{children:Fp(e)})})}function Fp({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 Hp=k(function(){const{uiStateSignal:e,initialUiStateSignal:t}=ka(Ze),a=xt(),i=a.value?e.value:t.value,r=Qc(),o=Zo(Pn(Ya)),l=r.value&&o.value,{hasViolations:s}=G(jp),u=a.value&&s&&!l&&"error"!==i.status,c=u?n(Up,{}):null,d=(()=>{switch(i.status){case"initial":case"empty":return n(Vp,{});case"loading":return n(xp,{});case"error":return n(Dp,{});case"filled":{const e=Ci(i.deliveryLines).filter(Cn),t=e.flatMap(({methods:e})=>e.map(({title:e})=>e));return n(Gl,{impressionType:"shipping_methods",impressionFeatures:t,children:n(zp,{lines:e,showErrorBanner:l,deliveryChangedBannerOwnedBySection:u})})}}})();return n(V,{gap:"base",children:[c,d]})});function zp({lines:e,showErrorBanner:t,deliveryChangedBannerOwnedBySection:a}){const r=Dn(),o=jn(),[,l]=b(),u=os(l),c=function({checkout:e}){return"shopPay"===e.identity.current.value?Gp:i}(it());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(ls,{lines:e,loading:u,showErrorBanner:t,deliveryChangedBannerOwnedBySection:a})})]})}Hp.displayName="OnePageShippingMethods";const jp=new Set(["DELIVERY_DELIVERY_LINE_DETAIL_CHANGED"]);function Up(){const{i18n:e}=it();return n(Ce,{tone:"warning",errorType:F.DeliveryError,children:e.translate("shipping_errors.shipping_method")})}function Gp(){const{trackSelectShippingMethod:e}=Dd(),{availableDeliveryMethodsLoading:n,progressiveShippingRatesLoading:t}=_p();
2return Cp({onChange:e,prerequisitesLoading:n||n&&!t}),null}function Yp(){const{checkout:e,i18n:t}=it(),a=e.addressManager.shipping.value,i=wl("shipping"),{shouldGateCrossBorder:r,crossBorderGate:o}=Yl(),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(Q,{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 Wp(){Qd();const e=pn(),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(qp,{})}),n(a,{when:i,children:n(er,{})})]})}function qp(){const{methods:e}=wn(),{i18n:i,router:r,checkout:{wallets:o,identity:l,negotiator:s}}=it(),c=Un(),{deliveryNext:d,optionalDuties:p}=s.current.fields,h=ps(),m=Xe(),{shippingAddress:v}=s.parts;Gn(v,()=>{m&&m.taxId.reset()});const y=U("Checkout::DeliveryAddress::RenderBefore"),g=U("purchase.checkout.delivery-address.render-after"),b=cs(),{hasMultipleDeliveryGroups:_,onlyDeliveryGroupType:C}=b.value,{customizationsBefore:P,customizationsAfter:S}=ds({hasMultipleDeliveryGroups:_,targeted:!1}).value,A=t(()=>ja(d.value,!0)||h.value.showShipmentBreakdown).value,k=A?"small-400":"base",w=Dn(),O=jn(),{negotiate:I}=ge(),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(Wn,{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=sn(),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(Yn,{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,{})]})}),W=n(Yn,{sectionId:"shipping",children:[n(Wn,{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(Z,{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(dn,{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(Yp,{}),n(cr,{}),n(a,{when:M,children:n(rr,{})}),m&&n(dr,{taxId:m.taxId,applied:m.applied})]})})}),n(dn,{customizations:g}),n(V,{gap:k,children:[n(E,{id:z,level:2,autoFocus:j.value,children:i.translate("shipping.shipping_method_title")}),n(qn,{children:[n(a,{when:()=>h.value.showShipmentBreakdown,children:n(Ps,{children:[n(ks,{}),n(pe,{blockSize:"small-200"})]})}),Ll("shipping.shipping_method_notice",i)?n(Z,{children:i.translate("shipping.shipping_method_notice")}):null,n(dn,{customizations:P,options:N,render:L}),n(Ps,{children:[n(Hp,{}),n(As.Preload,{})]}),n(dn,{customizations:S,options:N,render:L})]})]})]})]})}),n(a,{when:()=>p.value?.refuseDutiesPermitted,children:n(Wn,{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(rs,{})]})})})]}),q=t(()=>e.value.includes("PICKUP_POINT")),$=t(()=>e.value.includes("PICK_UP"));return n(a,{when:H,fallback:n(a,{when:()=>q.value||$.value,fallback:W,children:n(a,{when:q,fallback:Y,children:n(Yn,{sectionId:"pickupPoints",children:n(qi,{})})})}),children:n(V,{gap:"large-300",children:[Y,W]})})}function $p({identity:e}){return"customerAccount"===e.current.value}const Kp=k(function(){const{shop:e,i18n:i}=it(),r=U("Checkout::Dynamic::Render","DELIVERY1"),o=pn(),l=ye(),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(Wp,{}),n(dn,{customizations:r})]})})}),Jp=o({displayName:"MobileOrderSummaryBeforeDetails",load:()=>p(()=>e(async()=>{const{MobileOrderSummary:e}=await(import("./d2e6a587.D_77Lmvs.js"));return{MobileOrderSummary:e}},__vite__mapDeps([149,1,3,4,5,6,2,7,8,9,10,11,12,82,83,142,143,106,101,150])).then(({MobileOrderSummary:e})=>({default:e}))),renderError(e){throw e}}),Xp="undefined"==typeof window?void 0:performance.now();"undefined"!=typeof window&&up.preload();const Zp=kp,Qp=k(function(){return(()=>{const{embed:e,checkout:{identity:n},shop:t}=it(),a="shopPay"===n.current.value&&zt(e?.embedder),i=t.hasFlagEnabled(Gt),r=Lu(),o=Du().value;lp({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}=it(),i=ye(),r="shopPay"===e.identity.current.value&&!zt(n?.embedder)&&e.configuration.visibility.showCashRedemption.value&&!(i.value.payment&&Bt(a)),o=t.hasFlagEnabled(Gt),l=Lu(),s=uc(),u=Du().value;lp({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 eh({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 nh=k(function({children:e}){const{checkout:i,embed:r,environment:o,i18n:l,observability:u,shop:c,shopPay:d,source:p}=it(),h="VISIBLE"===i.configuration.headerText?.visibility,m=y(!1),g=f(()=>{m.value||(m.value=!0,void 0!==Xp&&u.histogram({name:"one_page_below_fold_content_ready",value:Math.round(performance.now()-Xp),unit:"ms",attributes:{buildId:o.commitSha}}))},[o.commitSha,m,u]),b=xt(),_=c.hasFlagEnabled(la),C=Ft({embedder:r?.embedder,shop:c}),P="google"===r?.embedder&&C,S=ye(),A=Pr(),k=t(()=>S.value.payment&&A.value),E=v(pn()),w=$n(),O=t(()=>S.value.payment&&c.acceptTipPayments&&(w?.tippingPaymentAllowed??!0)&&i.configuration.visibility.showTips),I=v(rn()[0]),{postPurchaseEnabled:R}=fs(),T=t(()=>i.negotiator.current.fields.buyerIdentity.value?.customerProfile),L=Kn(),N=t(()=>P&&L.value),D=sn(),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=gs(),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}=ge(),{observability:n,checkout:t}=it(),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=pp(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 $=v(Jn({base:!0,medium:!1})),K=t(()=>!b.value||($.value??!1)),J=pr(),X=t(()=>"hidden"!==J.value),Z=v(U("Checkout::Contact::RenderAfter")),Q=function(){const{checkout:e,shop:n,source:a}=it(),{email:i}=e.negotiator.parts,r=ye(),{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&&!Bt(a))})}(),{main:{section:ee}}=ve(),{lineItems:{priority:ne="base"}}=he(),te=v(Si(ee)),ae=On(),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&&K.value),se=t(()=>i.configuration.visibility.showEmailMarketing&&!Bt(p)&&oe.value&&!T.value?.acceptsEmailMarketing),ue=ar(),de=t(()=>ue.value.isRoot?"belowPayment"!==ie.value||K.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),me=t(()=>"guest"===i.identity.current.value?pe.value&&!(S.value.contact&&S.value.payment):pe.value),fe=t(()=>!me.value&&i.isShippingRequired.value),be=t(()=>W.value||Y.value),_e=Ad(),Ce=t(()=>Boolean(!Bt(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||(fe.value||me.value)&&Ce.value)),Ae=t
2(()=>Boolean(fe.value&&Ce.value&&!be.value)),ke=zt(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"===de.value)),Le=t(()=>b.value&&S.value.contact&&!q.value&&Z.value.length>0),Ne=t(()=>!q.value),De=Ap({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;Xn();const He=t(()=>!q.value&&(se.value||le.value)),ze=t(()=>"abovePayment"===de.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),$e=t(()=>!_&&We.value),Ke=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&&!K.value&&(re.value||"belowPayment"===de.value)&&!k.value&&!Le.value&&!Me.value&&!N.value),Qe=t(()=>Ze.value||k.value||Te.value||le.value||ae.value&&!te.value&&K.value||Ye.value&&(K.value||Ee)),en=t(()=>k.value||Ye.value||!S.value.payment&&S.value.delivery&&!K.value&&!Le.value||S.value.payment&&le.value);return n(Ds,{children:[n(Qp,{}),n(V,{blockSize:N.value?"100%":void 0,gap:"@media (inline-size >= extraSmall) large-200, none",children:[n(a,{when:we,children:n(Zn,{accessibilityRole:"presentation"})}),Bt(p)?n(V,{gap:"base",padding:"@media (inline-size >= extraSmall) none, large-200 large-200 none large-200",children:n(Qn,{})}):null,n(et,{section:"toast"}),!Fe&&n(et,{section:"top"}),n(sp,{active:b,ready:m}),n(cp,{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(nt,{})})})}),Fe&&n(et,{section:"top"}),n(a,{when:X,children:n(co,{target:"expressCheckout",children:n(hr,{})})}),n(a,{when:xe,children:[n(tt,{section:"summary",children:n(at,{section:"summary",children:n(B,{padding:"none large-200 large-100 large-200",children:n(co,{target:"plain",children:n(Jp,{})})})})}),n(Zn,{accessibilityRole:"presentation"})]}),n(vp,{}),n(Ms,{}),n(a,{when:q,children:()=>n(oo,{accessibilityLabel:l.translate("contact.contact_method_title"),children:n(tt,{section:"contact",children:n(at,{section:"contact",children:n(Np,{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:$e,children:[n(ip,{showDelivery:fe,insideVaultedCard:Ke}),n(ro,{condition:Ge,hideDivider:Qe,accessibilityLabel:je.value,children:n(V,{children:[n(a,{when:()=>!S.value.contact&&!G.value,children:n(tt,{section:"contact",children:n(at,{section:"contact",children:n(Np,{showForm:i.configuration.showContactInformation})})})}),n(a,{when:()=>!pe.value,children:n(Wd,{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(at,{section:"contact",children:n(gp,{aboveFoldSpacing:!0,showEmailMarketingOptIn:He,showPhoneMarketingOptIn:ze})})}),n(a,{when:Le,children:n(at,{section:"contact",children:n(fp,{extensions:Z,hideDivider:"whenEmpty"})})}),n(a,{when:me,children:n(a,{when:i.isShippingRequired,children:n(eh,{isGuestPartialVaultedDelivery:Re,isSectionStyleUnificationEnabled:_,children:[n(np,{}),n(so,{condition:pe,accessibilityLabel:l.translate("shipping.delivery_title"),children:n(Wd,{hideLastDivider:Ie,showTopDivider:Oe,stripBlockEndPadding:i.configuration.isUniversalCheckoutFinalizer})})]})})}),n(a,{when:Me,children:n(fp,{extensions:De,hideDivider:"whenEmpty"})}),n(a,{when:()=>!S.value.delivery&&i.isShippingRequired.value,children:n(ce,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(tt,{section:"delivery",children:n(at,{section:"delivery",children:n(Yn,{sectionId:"delivery",children:n(Kp,{})})})})})}),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(up,{onReady:g,includeContactInVaultedExtensions:Ne,showMobileOrderSummary:Ve,showVaultedStateMarketingDisclosureBelowPayment:re,phoneMarketingPlacement:de,isSectionCustomized:te,showVaultedStateMarketingDisclosureOnMobile:le,expressCheckoutSlot:J,showVaultedCardConsentSpacing:Ze})})]}),R&&n(io,{})]}),n(hp,{}),n(a,{when:i.isShippingRequired,children:n(Sp,{})}),n(mr,{id:"OnePage"}),e]})}),th=Object.freeze(Object.defineProperty({__proto__:null,MobileOrderSummaryBeforeDetails:Jp,default:nh,onePageCritical
2StyleClassNames:Zp},Symbol.toStringTag,{value:"Module"}));export{nu as L,tu as M,Jc as O,gp as P,iu as R,Bd as S,zu as U,fp as V,Uc as a,Gc as b,Hp as c,Rd as d,Id as e,Bu as f,Mu as g,Td as h,ed as i,$s as j,Ks as k,Js as l,Ap as m,gc as n,th as o,yp 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.