import{u as e,G as n,h as t,t as i,p as a,T as r,M as s,F as o,D as c,o as l,g as d,m as u,q as m,w as h,P as p}from"./2c1ab0fe.Dbn2KvkT.js";import{L as f,B as b,b as v,k as g,S as y,af as _,aS as j,Z as k,G as w,d as C,bn as S,bl as x,bm as A,f as P,fg as z,$ as M,dX as T,p as E,fh as R,fi as L,dl as I,dk as N,_ as D,U as O,j as B,dm as F,dn as $,de as U,fj as V,eE as Y,fk as H,bZ as G,w as q,q as Z,dZ as X,fl as W,l as J,at as K,eX as Q,ak as ee,al as ne,H as te,ao as ie,r as ae}from"./164ad2e3.FTBuhkTQ.js";import{d as re,F as se,n as oe,ez as ce,aJ as le,ae as de,bC as ue,a6 as me,ac as he,a7 as pe}from"./4b4bc88f.z1yoAwwH.js";import{C as fe}from"./b3389d5c.JToQX7EK.js";import{u as be,S as ve,P as ge,L as ye,R as _e}from"./73a9b0a0.D8197R8-.js";import{M as je}from"./0b8657b8.CiDJmOSt.js";import{P as ke}from"./fc21c11a.DX71sl9j.js";import{P as we}from"./e3e348f2.DlRIwDFx.js";import{b as Ce,c as Se,S as xe}from"./dfca5da5.DtiE-B_a.js";import{S as Ae}from"./79974aab.BEktvauy.js";import{f as Pe,g as ze,h as Me,L as Te,j as Ee,k as Re,l as Le,U as Ie,V as Ne,P as De}from"./f8706cb6.H5idtf8V.js";import{S as Oe}from"./39921a74.bahNnP3U.js";import{O as Be,u as Fe}from"./7a8217fd.qHfhLK3T.js";import{MobileOrderSummary as $e}from"./d2e6a587.BTa3jGZQ.js";import{b as Ue,a as Ve}from"./bf513f9c.B3u9Jber.js";import{a as Ye}from"./1f5e7811.a2EjfHnG.js";import{G as He,u as Ge,b as qe,T as Ze}from"./6bfea526.D62LLGBP.js";import{u as Xe}from"./e129c76e.CdUlGY39.js";import{a as We}from"./01973ac7.D5XeeIWW.js";import{a as Je,P as Ke,W as Qe}from"./c10167e6.a4UUxC0y.js";import{y as en,z as nn,E as tn,u as an,a as rn,g as sn,V as on,b as cn}from"./86720dbb.Ctpif1U0.js";import{a as ln,H as dn}from"./0e9ee714.KXiBhcvk.js";import{b as un,c as mn}from"./app.CooG55fE.js";import{B as hn}from"./dffdfb34.BM70-hlD.js";import{a as pn}from"./24773686.CplnJ3xw.js";import"./69fae6d4.DwAzRqQZ.js";import"./f67abd2c.nPTvXZJz.js";import"./e12db40c.DF32J314.js";import"./9dba8418.NidtnoQ4.js";import"./60a453ce.B80X1bY8.js";import"./3d539943.CHiZMBrZ.js";import"./25604ae0.56pfEpxV.js";import"./dada7e07.d_Jgr9HV.js";import"./c6b02d73.Ba1sudbg.js";import"./0e67bd3b.rVVcKKmW.js";import"./74835653.BLveyRHP.js";import"./3ca8ef7e.CoLpsNbY.js";import"./2bac2c53.CBL7jHzd.js";import"./a9fa9fda.CPgABguf.js";import"./ca3e798e.BBho0lps.js";import"./47b970b2.DCFIpVFI.js";import"./22345fd4.DfRWVvfi.js";import"./064f6ac1.DHFjHCTV.js";import"./efa0389a.BBF5Yj3v.js";import"./4b1c22b7.Tf9Z0cR8.js";import"./e0989459.CIFtnx6c.js";import"./cdfd59e6.CxVDNOs9.js";import"./e477f96c.DtwGO4P4.js";import"./d7065744.DH5rilol.js";import"./7ee73f43.ChJI3xSJ.js";import"./cb5cf153.DR2k6GTr.js";import"./cb38e5c2.BMWpCITo.js";import"./0c0ad074.BVCUV6D7.js";import"./8fe56fc9._gTwhRQ_.js";import"./2210eadb.DF0gIp_2.js";import"./434e3b0a.oup8Ur0H.js";import"./87bfafec.CxwEzGHg.js";import"./051149c8.lHD9iIAq.js";import"./55098bf1.C9NOZwx2.js";import"./71ae3d5c.BgAyZsA9.js";import"./dae24aab.CVNnVl1k.js";import"./e77f7fe0.ByPUY0fc.js";import"./598fef4e.CSEeJ9se.js";import"./ddf59287._uCuCuxL.js";import"./945a08d6.DsBMy-Sv.js";import"./58314944.C8o0ZBBk.js";import"./7bc8057b.jS2i-qiP.js";import"./d25d1b95.DYvnxyL-.js";import"./a25deb9a.e6U0ww9n.js";import"./2b89a178.BVP6w6_h.js";import"./b684bff6.bwJyjEIe.js";import"./a422df8c.Cf87EYCO.js";import"./17425706.Du5FyTeZ.js";import"./bfe75f31.CeEm_sIx.js";import"./6fb6f9d8.D6yUmBOq.js";import"./1444e6bd.CLS56A6L.js";import"./ed9f2238.3jB1CnRm.js";import"./78ab3dd0.UjAWxVn0.js";import"./910cd6e2.BdYIBApg.js";import"./347b440c.Cr4Lo5jt.js";import"./9ce08e25.CVFGyfHb.js";import"./181d38d3.CkWlyM7r.js";import"./792bb671.B3OvVnSg.js";import"./9ca7d819.NFD4561s.js";import"./f49d4216.CilLybTV.js";import"./f51e663e.BOJ2cLC5.js";import"./21cc90a2.DHzOO82q.js";import"./64de7b49.D8TZokHI.js";import"./ca0c3e72.CvmHYoux.js";import"./8e79be58.BLZlQ4SW.js";import"./90e26f5f.BtzmBOQP.js";import"./31cc568e.95lmLO5k.js";import"./65f3d4da.Bb3QiqCm.js";import"./2fdb3dd3.Dn592ndi.js";import"./ca5e9c49.C4Dgo0WK.js";import"./f3e117aa.DNLKh0Hn.js";import"./1a6c2867.D8mTtJ_Z.js";import"./7b0c98ea.CmmnLN9P.js";import"./ac5a19ff.la4o1mqh.js";import"./cc6ff67d.CxMx1fOJ.js";import"./08a3b809.Ce8w6gv6.js";import"./e39bc11c.CPXDRKy_.js";import"./d4ea2faa.CFmOkqFN.js";import"./fe885b80.D6XeXzR1.js";import"./f78726c8.COms9s2w.js";import"./b9c0319a.CZrWIGzl.js";import"./17e57de1.C4OivbHV.js";import"./f692f62f.BHFpWwLS.js";import"./9babe369.SH-YgBx8.js";import"./ec391382.Bx3C9xNN.js";import"./71b60e0a.DfPLdYsH.js";import"./89e2d30a.BHZyUNbR.js";import"./d22d2b80.B6GNsBAl.js";import"./f58f39d8.CX1OVCRt.js";import"./e03065ab.CTM9K0Hk.js";function fn({href:n,children:t,onClick:i}){return e(f,{tone:"monochrome",href:n,onClick:i,children:t})}function bn({onClick:n}){const{i18n:t}=re();return e(fn,{href:"https://www.shopify.com/legal/cookies",onClick:n,children:t.translate("user_consent.policy")})}function vn({onClick:n}){const{i18n:t}=re();return e(fn,{href:"https://help.shop.app/en/shop/shopping/ads-personalization",onClick:n,children:t.translate("user_consent.detailed_view.learn_about_ads")})}function gn({title:n,description:t,checked:i,onChange:a,disabled:r,badgeLabel:s}){const o=e(g,{children:t});return e(y,{gap:"small-200",children:[e(y,{direction:"inline",gap:"small-200",alignItems:"center",children:[e(g,{type:"strong",children:n}),s?e(j,{color:"subdued",children:s}):null]}),e(k,{gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content)",gap:"base",alignItems:"start",children:[o,e(Oe,{checked:i,onChange:a,disabled:r,accessibilityLabel:n})]})]})}function yn({open:a,onClose:r,onConsentSaved:s}){const{consentManager:o,i18n:c,shopPay:l}=re(),d=l.user.shopAccountUuid,u=d.value,m=o.trackingConsentSelection?.value,h=void 0!==m,[p,f]=n(!1),[j,k]=n(!1),[w,C]=n(!1),[S,x]=n(null),[A,P]=n(!1);t(()=>{if(!a)return;const e=o.trackingConsentSelection?.peek();f(e?.analytics??!1),k(e?.marketing??!1),C(!1),x(null),P(!1)},[o,u,a]),t(()=>{a&&!w&&m&&(f(m.analytics),k(m.marketing))},[w,a,m]);const z=i(async()=>{if(A||!h)return;const e=d.value;P(!0),x(null);const n=await o.setTrackingConsent({analytics:p,marketing:j});l.user.shopAccountUuid.value===e&&(n.success?(s?.(),r()):x(c.translate("user_consent.error_saving_consent")),P(!1))},[p,o,c,h,A,j,s,r,l,d]),M=c.translate("user_consent.detailed_view.description",{cookie_policy_href:e(bn,{})}),T=e(v,{inlineSize:"@media (inline-size >= small) auto, 100%",children:e(b,{variant:"primary",onClick:z,inlineSize:"fill",loading:A||!h,disabled:A||!h,children:e(v,{minInlineSize:"100px",inlineAlignment:"center",children:e(g,{children:c.translate("user_consent.detailed_view.save")})})})});return e(Be,{heading:c.translate("user_consent.title"),accessibilityLabel:c.translate("user_consent.manage"),open:a,onHide:r,primaryAction:T,children:e(y,{gap:"base",children:[e(y,{gap:"small-200",children:[S&&e(_,{tone:"critical",children:S}),e(g,{children:M})]}),e(y,{gap:"base",children:[e(gn,{title:c.translate("user_consent.detailed_view.necessary"),description:c.translate("user_consent.detailed_view.necessary_description"),checked:!0,disabled:!0,badgeLabel:c.translate("user_consent.detailed_view.required")}),e(gn,{title:c.translate("user_consent.detailed_view.analytics"),description:c.translate("user_consent.detailed_view.analytics_description"),checked:p,onChange:e=>{f(e),C(!0)},disabled:A||!h}),e(gn,{title:c.translate("user_consent.detailed_view.advertising"),description:c.translate("user_consent.detailed_view.advertising_description",{learn_about_ads_href:e(vn,{})}),checked:j,onChange:e=>{k(e),C(!0)},disabled:A||!h})]})]})})}function _n(){const{consentManager:l,i18n:d,mobileCheckoutSdk:u,observability:m,shopPay:h}=re(),p=h.user.shopAccountUuid,[f,b]=n(!1),[g,j]=n(null),[k,P]=n(p.value),z=a(!1),M=r(void 0);t(()=>{k!==p.value&&(P(p.value),z.value=!1,j(null))},[z,k,p.value]);const T=i(()=>{j(null),b(!0)},[]),E=i(()=>{b(!1)},[]),R=i(()=>{z.value=!0},[z]),L=i(async()=>{const e=p.value;j(null);const n=await l.acceptAll();h.user.shopAccountUuid.value===e&&(n.success?R():j(d.translate("user_consent.error_saving_consent")))},[R,d,h,p,l]),I=i(async()=>{const e=p.value;j(null);const n=await l.rejectAll();h.user.shopAccountUuid.value===e&&(n.success?R():j(d.translate("user_consent.error_saving_consent")))},[R,d,h,p,l]),N=R,D=k===p.value,O=D&&(l.shouldShowBanner.value||z.value),B=function(e,n){const t=r(null),i=r(e),a=r(!1),s=r(null);if(i.current&&!e&&"undefined"!=typeof document){const e=t.current,n=document.activeElement,i=e&&n instanceof HTMLElement&&e.contains(n),r=e&&S(e);a.current=Boolean(i),s.current=i&&r?x(r):null}return i.current=e,o(()=>{if(!a.current||!n)return;a.current=!1;const i=e?t.current&&A(t.current):s.current;s.current=null,i?.isConnected&&document.activeElement===document.body&&i.focus({preventScroll:!0})},[n,e]),t}(O,D),F=r(O);t(()=>{const e=!F.current&&O;if(F.current=O,e)return w({content:d.translate("user_consent.title")})},[d,O]),t(()=>{D&&M.current!==p.value&&(M.current=p.value,m.counter({name:"inline_user_consent_shown",value:1,attributes:{shown:O}}))},[D,O,p.value,m]);const $=e(y,{gap:"small-300",children:[g&&e(_,{tone:"critical",children:g}),e(c,{when:z,fallback:e(jn,{onAcceptAll:L,onManageCookiesClick:T,onRejectAll:I}),children:e(kn,{onManageCookiesClick:T})})]}),U=e(yn,{open:f,onClose:E,onConsentSaved:N});if(!O)return null;const V=e(v,{ref:B,background:"subdued",borderRadius:"large",padding:"base",children:e(y,{gap:"base",accessibilityRole:"group",accessibilityLabel:d.translate("user_consent.title"),children:$})}),Y=u.variant.isPartner();return e(s,{children:[!Y&&e(v,{display:"@media (inline-size >= small) none, auto",children:e(C,{blockSize:"base"})}),V,U]})}function jn({onManageCookiesClick:t,onAcceptAll:a,onRejectAll:r}){const{i18n:s}=re(),[o,c]=n(null),l=null!==o,d=i(async()=>{l||(c("accept"),await a(),c(null))},[l,a]),u=i(async()=>{l||(c("reject"),await r(),c(null))},[l,r]);return e(y,{gap:"base",children:[e(g,{type:"strong",children:s.translate("user_consent.accelerated_view.title")}),e(P,{children:e(g,{children:s.translate("user_consent.accelerated_view.description",{cookie_policy_href:e(bn,{})})})}),e(y,{direction:"inline",gap:"small-200",children:[e(b,{inlineAlignment:"center",onClick:d,size:"small",variant:"secondary",loading:"accept"===o,disabled:l,children:s.translate("user_consent.accelerated_view.accept_all")}),e(b,{inlineAlignment:"center",onClick:u,size:"small",variant:"secondary",loading:"reject"===o,disabled:l,children:s.translate("user_consent.accelerated_view.reject_all")}),e(b,{inlineAlignment:"center",onClick:t,size:"small",variant:"plain",textDecoration:"none",disabled:l,accessibilityLabel:s.translate("user_consent.manage"),children:s.translate("user_consent.accelerated_view.manage")})]})]})}function kn({onManageCookiesClick:n}){const{i18n:t}=re();return e(v,{autoFocus:!0,children:e(g,{children:t.translate("user_consent.accelerated_view.consent_collected",{manage_cookies_href:e(wn,{onManageCookiesClick:n})})})})}function wn({onManageCookiesClick:n}){const{i18n:t}=re();return e(fn,{onClick:n,children:t.translate("user_consent.manage")})}fn.displayName="CookiesLink";const Cn=e=>(e=>"ShopCashCheckoutCashbackIncentive"===e.__typename)(e)&&e.expectedAmount.amount>0,Sn=e=>(e=>"ShopCashCheckoutFlatAmountCashbackIncentive"===e.__typename)(e)&&e.minimumOrderValueSatisfied,xn="https://cdn.shopify.com/shop-assets/static_uploads/shop-cash/",An=`${xn}checkout_banner_coin_light.png`,Pn=`${An} 1x, ${xn}checkout_banner_coin_light_2x.png 2x, ${xn}checkout_banner_coin_light_4x.png 4x`,zn=`${xn}checkout_banner_coin_dark.png`,Mn=`${zn} 1x, ${xn}checkout_banner_coin_dark_2x.png 2x, ${xn}checkout_banner_coin_dark_4x.png 4x`,Tn=({expectedAmount:n,incentives:t,i18n:i,colorScheme:a,incentivePresentation:r})=>{const s=null!=n&&0!==n.amount,o=s?i.formatCurrency(n.amount,{currency:n.currencyCode}):"",c=s?(({i18n:e,incentives:n,formattedTotalAmount:t})=>{if(!n||0===n.length)return;const i=n.find(Cn),a=n.find(Sn),r=i?.displayName;if(i&&r&&a){const n=e.formatCurrency(i.expectedAmount.amount,{currency:i.expectedAmount.currencyCode}),s=e.formatCurrency(a.cashbackAmount.amount,{currency:a.cashbackAmount.currencyCode});return{title:e.translate("shop_cash.rewards_banner_title",{formattedAmount:t}),description:e.translate("shop_cash.reward_banner_description_combined_rewards",{promotionAmount:n,promotionDisplayName:r,offerAmount:s})}}if(i&&r&&!a){const n=e.formatCurrency(i.expectedAmount.amount,{currency:i.expectedAmount.currencyCode}),t=i.remainingRewardLimit?.amount===i.expectedAmount.amount;return{title:e.translate("shop_cash.reward_banner_title_with_promotion_attribution",{formattedAmount:n,promotionDisplayName:r}),description:t?e.translate("shop_cash.reward_banner_description_max"):void 0}}})({i18n:i,incentives:t,formattedTotalAmount:o}):void 0,d=s?c?.title??i.translate("shop_cash.rewards_banner_title",{formattedAmount:o}):"",u=c?.description,m=u?`${d} ${u}`:d,h=s&&(t?.some(e=>Sn(e)||Cn(e))??!1);if(Pe(r,"cashbackBanner",h?m:void 0),!s)return null;const p="dark"===a,f=l("F7fwo",p?"iJGCf":"gXkBh","automatic"===a&&"yeSzn");return e(y,{direction:"inline",alignItems:"center",gap:"small-300",className:f,borderRadius:"large",children:[e("picture",{className:"lZxFl",children:["automatic"===a?e("source",{media:"(prefers-color-scheme: dark)",srcSet:Mn}):null,e("img",{src:p?zn:An,srcSet:p?Mn:Pn,alt:""})]}),u?e(y,{direction:"block",gap:"none",className:"VnjPc",children:[e(g,{children:d}),e(g,{type:"small",children:u})]}):e(g,{children:d})]})};function En(){const{i18n:n}=re(),t=Ye(),{isEarningCashback:i,cashback:a,incentivePresentation:r}=Ue();return i&&a?e(v,{children:[e(C,{blockSize:"large-200"}),e(Tn,{expectedAmount:a.expectedAmount,incentives:a.incentives,i18n:n,colorScheme:t,incentivePresentation:r})]}):null}function Rn(){const n=z();return ze(),e(Je,{ineligibilityReason:n})}function Ln(){const{checkout:e,source:n,shop:t}=re(),i=M(),a=i?.tippingPaymentAllowed??!0;return!se(n)&&t.acceptTipPayments&&a&&e.configuration.visibility.showTips}function In(){const e=Ln(),n=T().value,t=E("Checkout::Dynamic::Render","PAYMENT1"),i=E("Checkout::Dynamic::Render","PAYMENT2"),a=E("Checkout::Dynamic::Render","PAYMENT3");return"inContext"===n||"hidden"===n||"afterPayment"===n&&e?{billingSelector:[],paymentMethodList:t,afterTips:e?i:[],end:e?a:i}:{billingSelector:i,paymentMethodList:t,afterTips:e?a:[],end:e||"afterPayment"!==n?[]:a}}function Nn({selectorShowsTiles:n,children:t}){const{checkout:{negotiator:i}}=re(),{buyerHasActedSignal:s}=i.context,c=en(),d=r(null),u=r(null),m=r(!1),h=oe(n.value&&s.value),p=a(null);o(()=>{const e=u.current;if(!e||"undefined"==typeof MutationObserver)return;const n=new MutationObserver(n=>{if(!e.hasChildNodes())return m.current=!1,void(p.value=null);n.some(e=>e.addedNodes.length>0)&&h.current&&un()&&(m.current=!0,p.value={from:mn(),withMotion:c.loaded})});return n.observe(e,{childList:!0,subtree:!0}),()=>n.disconnect()},[p,h,c]),o(()=>{if(m.current){m.current=!1;for(const e of[d.current,u.current])for(const n of e?.getAnimations?.()??[])n.cancel(),n.play()}});const f=null!==p.value&&p.value.withMotion;return e("div",{ref:d,className:l("OiIKz",f&&"_5YCEU",f&&tn),children:e("div",{ref:u,className:l("dwA7y",f&&nn[p.value?.from??"end"]),children:t})})}const Dn=n=>e(v,{children:n});function On({customizations:n,selectorShowsTiles:t}){return 0===n.length?null:e(s,{children:n.map(n=>"uiExtension"===n.kind?e(Nn,{selectorShowsTiles:t,children:e(R,{extension:n.extension,render:Dn})},n.extension.id):e(L,{field:n.field},n.field.key))})}const Bn=d(function(){const{checkout:n}=re(),t=be(),i=u(()=>function({identity:e}){switch(e.current.value){case"guest":case"customerAccount":case"shopPay":return!0;default:return!1}}({identity:n.identity})),r=ln(),{billingSelector:s,paymentMethodList:o}=In(),l=E("purchase.checkout.payment-method-list.render-after"),d=a(!1);return e(Qe,{dynamicPaymentExtensions:s,children:[e(Ke,{selectorShowsTiles:d,renderVaultingAgreementInline:!1,afterPaymentSelector:e(c,{when:r,children:e(dn,{})})}),e(c,{when:t,children:e(ve,{})}),e(On,{customizations:l,selectorShowsTiles:d}),e(On,{customizations:o,selectorShowsTiles:d}),e(c,{when:i,children:e(He,{})})]})});const Fn=d(function(){const{checkout:n,i18n:t,shop:i}=re(),{discountCodesEnabled:a}=i,r=N(),o=u(()=>a&&r.value);Ge(),function(){const{checkout:{negotiator:e}}=re(),{payment:n,directPaymentFieldsFilled:t}=e.context,{paymentLines:i,directPaymentErrors:a}=e.parts,r=Me();m(()=>{const e=r.value||(s=a,Object.keys(s).filter(e=>"paymentMethodIdentifier"!==e).some(e=>null!=s[e].value));var s,o,c;n.value=(o=i.value,c=t.value,o.some(e=>"direct"!==e.method.type||Boolean(e.method.sessionId)||c)&&!e)})}();const l=function(){const{checkout:e}=re(),{displayedPaymentMethods:n}=an({experienceType:"list"}),t=h(rn(n)),i=T(),a=I(),r=Fe(),s=Ve();return u(()=>{const n=null!==sn(e.identity,s.value)||r.value.freeOrder||r.value.giftCard||r.value.storeCredit||r.value.redeemables,o=!a.value&&("inContext"===i.value||"afterPayment"===i.value);return e.configuration.visibility.showStoreCreditRedemption.value&&!n&&"singlePaymentMethodCreditCard"===t.value.mode&&o})}(),d=u(()=>n.configuration.visibility.showStoreCreditRedemption.value&&!l.value),p=D(),f=Ln(),b=u(()=>n.installments.isSupported.value),{afterTips:v,end:g}=In(),_=E("purchase.checkout.payment-method-list.render-before");return e(U,{target:"cart.paymentLines[0]",children:e(y,{accessibilityRole:"group",accessibilityLabelledBy:"payment",gap:"base",children:[e($n,{}),e(O,{customizations:_}),e(We,{}),e(Te,{}),e(c,{when:d,children:e(qe,{})}),e(c,{when:b,children:e(Rn,{})}),e(B,{children:e(y,{gap:"large-300",children:[e(Bn,{}),e(c,{when:l,children:e(qe,{})}),e(c,{when:p,children:e(on,{})}),e(c,{when:n.configuration.visibility.showPurchaseOrderNumberField,children:e(cn,{showHeading:!1})}),f&&e(s,{children:[e(F,{sectionId:"tips",children:e(Ze,{})}),e(O,{customizations:v})]}),e(O,{customizations:g}),e(c,{when:o,children:e($,{targetSelector:'input[name="reductions"]',icon:"discount",label:t.translate("order_summary.discount_discovery.add_code")})})]})})]})})});function $n(){const{router:n}=re(),t="payment",i=u(()=>Ee(n,t));return e(ge,{headingId:t,autoFocus:i.value})}function Un(){const{embed:n,router:t}=re(),a=t.currentUrl.value,{label:r}=V(),s=Y({clearPii:!0}),o=H(),{isAppLayout:c}=G(),{progressing:l}=q(),{setEditorShopPay:d}=hn(),u=i(()=>{d?d(!1):l.value||s()},[d,l,s]);return o||n?.isCheckoutKit()||!c&&!ce(a.search)?e(f,{onClick:u,textDecoration:"none",children:r}):null}function Vn(){const n=function(){const e=pn(),n=i(()=>{(e=>{le()?e.bridge.iframeClosed():window.close()})(e)},[e]);return n}(),t=de(),a=Z({base:!0,small:!1}),{client:r,i18n:s,shop:{name:o},shopPay:c}=re(),l=ue(r)&&(!t.value||(a??!1));if(!c.visibility.showReturnToStore)return null;if(!l)return null;const d=s.translate("shop_pay_external.return_to_store",{shopName:o});return e(y,{alignItems:"center",children:[e(C,{blockSize:"base"}),e(f,{onClick:n,children:d})]})}function Yn(){const{checkout:{identity:n},source:t,shopPay:i,mobileCheckoutSdk:a}=re(),{visibility:{showCheckoutAsGuestFeature:r}}=i,s=u(()=>"shopPay"===n.current.value);if(!r)return null;const o="shopPayExternal"===t.type?e(Vn,{}):e(Un,{}),l=a.variant.isPartner();return e(c,{when:s,children:[e(C,{blockSize:"large-100"}),e(v,{inlineAlignment:"center",children:o}),l?e(C,{blockSize:"base"}):e(v,{display:"@media (inline-size >= small) auto, none",children:e(C,{blockSize:"base"})})]})}const Hn=d(function({onReady:n,includeContactInVaultedExtensions:i,showMobileOrderSummary:a,showVaultedStateMarketingDisclosureBelowPayment:r,phoneMarketingPlacement:o,isSectionCustomized:l,showVaultedStateMarketingDisclosureOnMobile:d,expressCheckoutSlot:m,showVaultedCardConsentSpacing:f}){const b=X(),g=W(),_=me(),j=Xe(),{checkout:k,embed:w,i18n:S,mobileCheckoutSdk:x,source:A,shop:P,shopPay:z}=re(),T=J(),R=k.negotiator.current.fields.managedByMarketsPro,L=h(Z({base:!0,medium:!1})),I=de(),N=K(),D=u(()=>N.configurationSignal.value.main.spacing),B=u(()=>{const{position:e}=N.configurationSignal.value.reductions;return z.visibility.shouldRenderFloatingShopPayButton?"none":"base"===e?"large-200":a.value&&null!=D.value?he(D.value)??"base":"base"}),{localizationExtensions:$}=k.negotiator.parts,U=u(()=>$.value.length>0),V=u(()=>f?.value&&!U.value?"large-200":"none"),Y=Gn(L),H=u(()=>r.value&&!d.value&&(!L.value||!l.value)),G=u(()=>"belowPayment"===o.value),q=M(),ae=h(q?.tippingPaymentAllowed??!0),oe=u(()=>b.value.payment&&P.acceptTipPayments&&ae.value&&k.configuration.visibility.showTips),ce=Q(),le=x.variant.isPartner(),ue=u(()=>"shopPay"===k.identity.current.value&&"shopPayExternal"!==A.type&&""!==z.user.shopAccountUuid.value&&!se(A)),be=e(c,{when:ue,children:e(_n,{})}),ve=u(()=>"thankYou"===T.value.currentDetour?.type?"Checkout::ThankYou::Dynamic::Render":"Checkout::Dynamic::Render"),ge=E(ve.value,"ORDER_SUMMARY4"),Pe=u(()=>"wallets"!==m.value&&Boolean(R.value)),ze=Re({includeContact:i}),Me=u(()=>!L.value&&!se(A)&&oe.value),Te=u(()=>!L.value&&g.value&&ze.value.length>0),Ee=u(()=>Me.value||Te.value||Pe.value);t(()=>{const e=setTimeout(n,0);return()=>clearTimeout(e)},[n]);const Oe=P.hasFlagEnabled(pe),Be=e(c,{when:a,children:e($e,{})}),Fe=e(y,{gap:"base",children:[e(c,{when:Me,children:e(v,{display:"@media (inline-size >= medium) auto, none",children:e(F,{sectionId:"tips",children:[e(c,{when:()=>!l.value,children:e(C,{blockSize:"large-300"})}),e(Ze,{})]})})}),e(c,{when:Te,children:e(Ne,{extensions:ze})}),e(c,{when:Pe,children:e(y,{gap:"base",padding:"@media (inline-size >= medium) large-400 none none none, none",children:e(je,{textProps:{color:"subdued",size:"small"}})})})]});return e(s,{children:e(Ce,{min:"medium",accessibilityLabel:S.translate("payment.title"),hideDivider:!0,children:[e(c,{when:()=>!b.value.payment,children:e(s,{children:[e(ee,{section:"payment",children:e(ne,{section:"payment",children:e(Ce,{max:"medium",accessibilityLabel:S.translate("payment.title"),children:e(Fn,{})})})}),e(c,{when:k.configuration.visibility.showCashRedemption,children:e(Le,{})}),e(Ie,{})]})}),e(c,{when:U,children:e(Se,{accessibilityLabel:S.translate("localized_fields.additional_information.title"),children:e(y,{gap:"base",padding:"@media (inline-size >= medium) large-400 none none none, none",children:[e(te,{level:2,children:S.translate("localized_fields.additional_information.title")}),e(p,{each:$,children:(n,t)=>e(ye,{localizationExtension:n,index:t})})]})})}),e(c,{when:()=>L.value&&!se(A)&&oe.value,children:e(v,{display:"@media (inline-size >= medium) none, auto",children:[e(F,{sectionId:"tips",children:e(Ze,{renderInSection:L})}),e(c,{when:()=>!w?.isFlagshipPartner,children:e(xe,{spacing:he(D.value)})})]})}),e(c,{when:()=>L.value&&g.value&&ze.value.length,children:e(Ne,{extensions:ze,hideDivider:"whenEmpty"})}),e(ee,{section:"summary",children:e(ne,{section:"summary",children:e("div",{ref:Y,children:[e(Ae,{target:"mobileOrderSummary",children:e(Ce,{max:"medium",hideDivider:!0,children:[e(c,{when:()=>!0===L.value,children:e(_e,{})}),e(De,{showEmailMarketingOptIn:H,showPhoneMarketingOptIn:G,paddingBlockStart:V}),!Oe&&Be,e(y,{gap:B.value,"data-testid":"onepage-pay-button-cluster",children:[Oe?e(s,{children:[Be,e(c,{when:Ee,children:Fe})]}):Fe,e(c,{when:()=>!0!==L.value,children:e(_e,{})}),e(y,{gap:"large-200",children:[e(c,{when:j,children:e(fe,{})}),e(c,{when:_,children:e(we,{placement:"above-pay-button"})}),e(ke,{buttonHidden:ce}),e(c,{when:_,children:e(we,{placement:"default"})}),e(c,{when:()=>!I.value||L.value,children:e(ie,{above:"medium",children:e(O,{customizations:ge,gap:"large-200"})})})]})]}),e(c,{when:k.configuration.visibility.showShopCashRewardsBanner,children:e(En,{})}),le?null:e(s,{children:[e(Yn,{}),be]})]})}),le?e(s,{children:[e(Yn,{}),be]}):null]})})})]})})});function Gn(e){const{setTriggerNode:n}=ae("chat"),t=a(null);return m(()=>{n(e.value?t.value:null)}),i(e=>{t.value=e},[t])}export{Hn as default,Gn as useChatHideTriggerRef};