import{T as b,c as C,u as n,d as P,S as _,k as y}from"./dist-vendor.DBR6g02j.js";import{a as h,a8 as B,u as T,c0 as A,fR as v,S as M}from"./shop-pay-FullScreenBackground.CUfzz8_n.js";import{M as g,H as p,k as f,I as D,T as S,N as L,v as w}from"./shop-pay-ButtonWithRegisterWebPixel.Bb6ujYnt.js";import{c as x,d as H,P as I,b as N}from"./shopPaySessionTokenStorage-Page.DzjUg09x.js";import{T as z}from"./utilities-MarketsProDisclaimer.BIFM8Ivw.js";import{C as O}from"./icons-OffsitePaymentFailed.DoXAgngx.js";const J="theme",Y="context";function R(){const{mobileCheckoutSdk:o}=h();if(!o.enabled)return!1;const t=o.config?.colorScheme,a=!!(typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)")?.matches);return t==="DARK"||o.variant.isStandard()&&t==="AUTOMATIC"&&a}const U=o=>({backgroundColor:t,foregroundColor:a})=>{const s=k(t),e=k(a),r=Math.max(s,e),c=Math.min(s,e),i=(r+.05)/(c+.05);return{isValidContrast:i>=o,ratio:Math.round(i*100)/100}},V=U(3.06);function k(o){const a=o.toRgbTuple().map(s=>{const e=s/255;return e<=.04045?e/12.92:((e+.055)/1.055)**2.4});return .2126*a[0]+.7152*a[1]+.0722*a[2]}const Z=(o,t,a)=>o*.299+t*.587+a*.114,d=new A(0,0,100);function E({foregroundColor:o,backgroundColor:t,section:a="main"}){const s=B(),{colors:e}=T(),r=s[a];let c=d;if(t!==void 0)c=t;else if(r.colorScheme==="inherit"){const{background:l,colorScheme:m}=s.canvas;m&&l!=="transparent"&&(c=e.schemes?.[m]?.base?.background??d)}else{const l=r.colorScheme;c=l?e.schemes?.[l]?.base?.background??d:d}const{isValidContrast:i}=b(()=>V({backgroundColor:c,foregroundColor:o}),[c,o]);return i}const $="_0mzUL",u={Button:$,"Button--dark":"_6W0f3","Button--contrast":"aFsKX","Button--progressing":"XVUQD"};function j({progressing:o=!1}={}){const t=E({foregroundColor:M}),a=R(),s=h().shopPay.app.config,e=v(s,a);return b(()=>C(u.Button,{[u["Button--contrast"]]:!t&&!e,[u["Button--dark"]]:e,[u["Button--progressing"]]:o}),[e,t,o])}function oo(){const{shopPay:o}=h(),t=o.session.isInternalProgressing;return j({progressing:t})}function K(){const{i18n:o,shop:{hasStorefront:t,contactEmail:a},url:s}=h(),e=n(x,{children:n(g,{variant:"primary",size:"large",inlineSize:"fill",href:`mailto:${a}`,children:o.translate("no_address_location.email_us_button_label")})}),r=t?n(H,{children:n(g,{href:s.cart(),variant:"plain",inlineSize:"fill",textDecoration:"none",children:[n(p,{above:"small",children:n(f,{direction:"inline",gap:"small-400",alignItems:"center",children:[n(D,{type:"chevron-left",size:"small-200"}),n(S,{children:o.translate("general.back_to_cart")})]})}),n(p,{below:"medium",children:n(S,{children:o.translate("general.back_to_cart")})})]})}):null;return P({stage:_.Usable,id:"NoAddressLocation"}),n(y,{children:[n(z,{children:o.translate("no_address_location.title")}),n(f,{gap:"large-500",children:[n(O,{status:"warning",children:[n(L,{children:o.translate("no_address_location.header")}),n(w,{color:"subdued",children:o.translate("no_address_location.message")})]}),n(I,{children:(e||r)&&n(N,{children:[e,r]})})]})]})}const no=Object.freeze(Object.defineProperty({__proto__:null,default:K},Symbol.toStringTag,{value:"Module"}));export{no as N,J as a,oo as b,Z as c,E as d,j as e,Y as s,R as u};
