import{Pt as t}from"./630ba094.L_X-5TXi.js";import{WD as e,_S as a,dh as r,jh as n,wh as s,xO as o}from"./6ec9a0fa.rdcQt2v8.js";var u=a.Control,c="shop_pay_new_signup_login_variant",i=["draftOrder","simulated"];a.UnauthenticatedCheckout;var l=[a.UnauthenticatedCheckout];function h(){const l=o();return t(()=>function({shop:t,checkout:o,source:l,router:h,client:d},{url:f=h.currentUrl.value}={}){const p="shopPay"===o.identity.current.value,m=f.searchParams.get(s),y=t.hasFlagEnabled(e),P=null!=o.proposal.negotiated.fields.buyerIdentity.value?.customerProfile,v=m!==n.ShopPayAsPaymentMethod&&m!==n.ShopPayInstallmentsAsPaymentMethod;if(!p||!v||i.includes(l.type)||P&&!y)return u;return function({client:t},e){const r=Object.values(a),n=e.searchParams.get(c),s=r.find(t=>t===n);if(s)return s;const o=t.cookies.get(c);return r.find(t=>t===o)}({client:d},f)||(r(f.search)?u:y?a.UnauthenticatedCheckout:u)}(l,{url:l.router.currentUrl.value}))}export{h as n,l as t};