import{e as t,ay as e,_ as n,a as i,az as o,aA as s,ap as l,aq as a,aB as r,b as h,aC as d,R as c,U as p,Q as u,B as f,C as m,aD as g,A as w,aE as v,aF as _,g as b,aG as y,K as x,v as k,l as S,aH as $,a0 as E,aI as M,Z as C,aJ as L,o as W,I as F,P as A,d as T,ar as q,V as z,aK as B,aL as H,q as I,j as N,s as U,aM as P,aN as D,F as O,G as R,aO as j,aP as V,H as G,J as Y,a6 as J,a7 as Q}from"./chunk.common_BtjbWkV9.esm.js";class K extends HTMLElement{constructor(){super();const t=document.createElement("template"),n=this.getAttribute("size"),i=this.getAttribute("background-color")||"#FFF";t.innerHTML=function(t=36,n){const[i,o,s]=e(n),l=`rgb(${i}, ${o}, ${s})`,a=1.15,r=t,h=Math.round(r/a);return`\n \n \n \n \n `}(n?Number.parseInt(n,10):void 0,i),this.attachShadow({mode:"open"}).appendChild(t.content.cloneNode(!0))}}var X,Z,tt,et,nt,it,ot,st,lt,at,rt,ht,dt,ct,pt;const ut="shop-modal-content";class ft extends HTMLElement{constructor(){super(),X.add(this),Z.set(this,void 0),tt.set(this,void 0),et.set(this,void 0),nt.set(this,void 0),it.set(this,void 0),ot.set(this,void 0),st.set(this,void 0),lt.set(this,void 0),at.set(this,void 0),rt.set(this,void 0),ht.set(this,{});const t=document.createElement("template");t.innerHTML=`\n \n \n \n `,n(this,Z,this.attachShadow({mode:"open"}),"f"),i(this,Z,"f").appendChild(t.content.cloneNode(!0)),n(this,tt,i(this,Z,"f").querySelector(`.${ut}`),"f"),n(this,et,i(this,Z,"f").querySelector(`.${ut}-title`),"f"),n(this,nt,i(this,Z,"f").querySelector(`.${ut}-description`),"f"),n(this,it,i(this,Z,"f").querySelector(`.${ut}-content`),"f"),n(this,ot,i(this,Z,"f").querySelector(`.${ut}-processing`),"f"),n(this,st,i(this,Z,"f").querySelector(`.${ut}-processing-user`),"f"),n(this,at,i(this,Z,"f").querySelector(`.${ut}-children`),"f"),n(this,rt,i(this,Z,"f").querySelector(`.${ut}-disclaimer`),"f")}hideDivider(){i(this,tt,"f").classList.add("hide-divider")}showDivider(){i(this,tt,"f").classList.remove("hide-divider")}update(t){n(this,ht,Object.assign(Object.assign({},i(this,ht,"f")),t),"f"),i(this,X,"m",dt).call(this),i(this,X,"m",ct).call(this),i(this,X,"m",pt).call(this)}}function mt(t,e=!1){const n=document.createElement("shop-modal-content");return e&&n.hideDivider(),n.update(t),n}Z=new WeakMap,tt=new WeakMap,et=new WeakMap,nt=new WeakMap,it=new WeakMap,ot=new WeakMap,st=new WeakMap,lt=new WeakMap,at=new WeakMap,rt=new WeakMap,ht=new WeakMap,X=new WeakSet,dt=function(){const{title:t,description:e,authorizeState:n}=i(this,ht,"f"),o=t||e;i(this,tt,"f").classList.toggle("hidden",!o),i(this,et,"f").classList.toggle("hidden",!t),i(this,nt,"f").classList.toggle("hidden",!e),i(this,et,"f").textContent=t||"",i(this,nt,"f").textContent=e||"",n&&(i(this,tt,"f").classList.toggle("hide-divider",n===s.Start),i(this,tt,"f").classList.toggle(`${ut}--small`,n===s.Start))},ct=function(){var t;const{authorizeState:e,status:o,email:r}=i(this,ht,"f"),h=Boolean(e||o),d=Boolean(o&&r),c=Boolean(h&&!d);if(i(this,it,"f").classList.toggle("hidden",!h),i(this,ot,"f").classList.toggle("hidden",!d),i(this,at,"f").classList.toggle("hidden",!c),!i(this,lt,"f")&&d){const o=e===s.OneClick?l.Branded:l.Regular;n(this,lt,a(o),"f"),i(this,ot,"f").appendChild(i(this,lt,"f")),null===(t=i(this,lt,"f"))||void 0===t||t.setStatus({status:"loading",message:""})}i(this,st,"f").textContent=r||""},pt=function(){const{disclaimer:t}=i(this,ht,"f"),e=Boolean(t);i(this,rt,"f").classList.toggle("hidden",!e),i(this,rt,"f").innerHTML=t||""},customElements.get("shop-modal-content")||customElements.define("shop-modal-content",ft);const gt="following";class wt extends HTMLElement{constructor(){super(),this._rootElement=null,this._button=null,this._wrapper=null,this._heartIcon=null,this._followSpan=null,this._followingSpan=null,this._i18n=null,this._followTextWidth=0,this._followingTextWidth=0,customElements.get("shop-logo")||customElements.define("shop-logo",r)}connectedCallback(){return h(this,void 0,void 0,(function*(){yield this._initTranslations(),this._initElements()}))}setFollowing({following:t=!0,skipAnimation:e=!1}){var n,i,o,s,l;null===(n=this._button)||void 0===n||n.classList.toggle("button--animating",!e),null===(i=this._button)||void 0===i||i.classList.toggle("button--following",t),null!==this._followSpan&&null!==this._followingSpan&&(this._followSpan.ariaHidden=t?"true":"false",this._followingSpan.ariaHidden=t?"false":"true"),this.style.setProperty("--button-width",`${t?this._followingTextWidth:this._followTextWidth}px`),window.matchMedia("(prefers-reduced-motion: reduce)").matches||e?null===(o=this._heartIcon)||void 0===o||o.setFilled(t):null===(l=null===(s=this._button)||void 0===s?void 0:s.querySelector(".follow-text"))||void 0===l||l.addEventListener("transitionend",(()=>{var e;null===(e=this._heartIcon)||void 0===e||e.setFilled(t)}))}setFocused(){var t;null===(t=this._button)||void 0===t||t.focus()}_initTranslations(){return h(this,void 0,void 0,(function*(){try{const t="en",e={follow_on_shop:{follow:"Follow on {shop}",following:"Following on {shop}",auth_modal:{title:"Follow on Shop",description:"Stay in the know—never miss a sale, restock, or order update."},following_modal:{title:"Visit {store} on Shop",subtitle:"Everything you need to shop, track, and pay—all in one place.",qr_header:"Scan to visit {store} on the Shop app",qr_alt_text:"Shop app QR code",continue:"Continue"},completed:{title:"You're following {store}",subtitle:"We've sent you an email with a link to download the Shop app."},personalization_consent:{title:"To follow on Shop, sync your shopping activity"}},login_with_shop:{login:"Sign in with {shop}",auth_modal:{login_title:"Sign in with Shop",login_title_with_store:"Sign in to {store} with Shop",login_description:"The easiest and most secure way to sign in to {store}—no password needed.",signup_title:"Create an account",signup_description:"Enter your phone number to create a Shop account.",login_sms_title:"Confirm it's you",login_sms_description:"Enter the code sent to {phoneNumber}",login_email_title:"Confirm it’s you",login_email_description:"Enter the code sent to your email, {email}",login_webauthn_title:"Confirm it’s you",login_webauthn_description:"Sign in with a passkey to securely use your saved information.",login_webauthn_footer:"By continuing, your name and email address will be shared with {store}."}},verified_email_auth:{auth_modal:{login_title:"Log in or sign up",signup_title:"Continue with Shop",signup_description:"Create a Shop account to sign in to {clientName}–no passwords needed"}},legal:{terms_of_service:"terms of service",privacy_policy:"privacy policy",terms:"terms",client:"See {clientName}’s {termsOfService} and {privacyPolicy}.",shop:"By continuing, you agree to Shop’s {termsOfService} and acknowledge the {privacyPolicy}.",authorized_scopes:{email_name:"By continuing, your name and email address will be shared with {store}."}},checkout_modal:{auth_modal:{login_sms_description:"Enter the code sent to {phoneNumber} to securely use your saved information.",login_email_description:"Enter the code sent to your email, {email} to securely use your saved information."}},customer_accounts:{remember_me:"Save my info securely with Shop to sign in faster everywhere",sign_up_page:{auth_modal:{login_title:"Continue with Shop",login_description:"Use your Shop account to sign in everywhere—no password needed.",login_sms_description:"Use your Shop account to sign in everywhere—no password needed.\r\n\r\nConfirm it's you, enter the code sent to {phoneNumber}",login_email_description:"Use your Shop account to sign in everywhere—no password needed.\r\n\r\nConfirm it's you, enter the code sent to your email, {email}",login_webauthn_title:"Continue with Shop",login_webauthn_description:"Sign in with a passkey to securely use your saved information."}}},payment_request:{auth_modal:{login_title:"Check out with Shop Pay",login_description:"Use your saved information to check out securely at {store}.",login_sms_title:"Confirm it's you",login_sms_description:"Enter the code sent to {phoneNumber} to securely use your saved information.",login_email_title:"Confirm it’s you",login_email_description:"Enter the code sent to your email, {email} to securely use your saved information."}}};this._i18n=new u({[t]:e})}catch(t){t instanceof Error&&f.notify(t)}return null}))}_initElements(){var t,e,n,i;const o=document.createElement("template");if(o.innerHTML=`\n \n \n `,this._rootElement=this.attachShadow({mode:"open"}),this._rootElement.appendChild(o.content.cloneNode(!0)),this._i18n){const t=this._i18n.translate("follow_on_shop.follow",{shop:vt("white")}),e=this._i18n.translate("follow_on_shop.following",{shop:vt("black")});this._rootElement.querySelector('slot[name="follow-text"]').innerHTML=t,this._rootElement.querySelector('slot[name="following-text"]').innerHTML=e}this._button=this._rootElement.querySelector(".button"),this._wrapper=this._button.querySelector(".follow-icon-wrapper"),this._followSpan=null===(t=this._rootElement)||void 0===t?void 0:t.querySelector("span.follow-text"),this._followingSpan=null===(e=this._rootElement)||void 0===e?void 0:e.querySelector("span.following-text"),this._heartIcon=d(),this._wrapper.prepend(this._heartIcon),this._followTextWidth=(null===(n=this._rootElement.querySelector(".follow-text"))||void 0===n?void 0:n.scrollWidth)||0,this._followingTextWidth=(null===(i=this._rootElement.querySelector(".following-text"))||void 0===i?void 0:i.scrollWidth)||0,this.style.setProperty("--reserved-width",`${Math.max(this._followTextWidth,this._followingTextWidth)}px`),this.setFollowing({following:this.hasAttribute(gt),skipAnimation:!0}),this._setButtonStyle()}_setButtonStyle(){var t,e;const n=c(this),i=p(n,"#ffffff")>p(n,"#000000"),o=p(n,"#5433EB")<=3.06;if(null===(t=this._button)||void 0===t||t.classList.toggle("button--dark",i),null===(e=this._button)||void 0===e||e.classList.toggle("button--bordered",o),i&&this._i18n){const t=this._i18n.translate("follow_on_shop.following",{shop:vt("white")});this._rootElement.querySelector('slot[name="following-text"]').innerHTML=t}}}function vt(t){return``}var _t,bt,yt,xt,kt,St,$t,Et,Mt,Ct;customElements.get("follow-on-shop-button")||customElements.define("follow-on-shop-button",wt);const Lt="store-logo";class Wt extends HTMLElement{constructor(){super(),_t.add(this),bt.set(this,void 0),yt.set(this,void 0),xt.set(this,void 0),kt.set(this,void 0),St.set(this,void 0),$t.set(this,void 0),Et.set(this,""),Mt.set(this,"");const t=document.createElement("template");t.innerHTML=`\n \n
\n
\n \n \n
\n
\n
\n `,n(this,bt,this.attachShadow({mode:"open"}),"f"),i(this,bt,"f").appendChild(t.content.cloneNode(!0)),n(this,yt,i(this,bt,"f").querySelector(`.${Lt}`),"f"),n(this,xt,i(this,bt,"f").querySelector(`.${Lt}-logo-wrapper`),"f"),n(this,kt,i(this,xt,"f").querySelector("img"),"f"),n(this,St,i(this,xt,"f").querySelector("span"),"f"),n(this,$t,d(),"f"),i(this,bt,"f").querySelector(`.${Lt}-icon-wrapper`).append(i(this,$t,"f"))}update({name:t,logoSrc:e}){n(this,Et,t||i(this,Et,"f"),"f"),n(this,Mt,e||i(this,Mt,"f"),"f"),i(this,_t,"m",Ct).call(this)}connectedCallback(){i(this,kt,"f").addEventListener("error",(()=>{n(this,Mt,"","f"),i(this,_t,"m",Ct).call(this)}))}setFavorited(){return i(this,yt,"f").classList.add(`${Lt}--favorited`),window.matchMedia("(prefers-reduced-motion: reduce)").matches?(i(this,$t,"f").setFilled(),Promise.resolve()):new Promise((t=>{i(this,$t,"f").addEventListener("animationstart",(()=>{i(this,$t,"f").setFilled()})),i(this,$t,"f").addEventListener("animationend",(()=>{setTimeout(t,1e3)}))}))}}var Ft,At,Tt,qt,zt,Bt,Ht,It,Nt,Ut,Pt,Dt,Ot,Rt,jt,Vt,Gt,Yt,Jt,Qt,Kt,Xt,Zt,te,ee,ne,ie,oe,se,le,ae,re,he,de,ce,pe,ue,fe,me,ge,we,ve,_e,be,ye,xe,ke,Se,$e;bt=new WeakMap,yt=new WeakMap,xt=new WeakMap,kt=new WeakMap,St=new WeakMap,$t=new WeakMap,Et=new WeakMap,Mt=new WeakMap,_t=new WeakSet,Ct=function(){const t=i(this,Et,"f"),e=i(this,kt,"f").src;i(this,St,"f").textContent=t.charAt(0),i(this,St,"f").ariaLabel=t,i(this,Mt,"f")&&i(this,Mt,"f")!==e?(i(this,kt,"f").src=i(this,Mt,"f"),i(this,kt,"f").alt=t,i(this,xt,"f").classList.remove(`${Lt}-logo-wrapper--text`),i(this,xt,"f").classList.add(`${Lt}-logo-wrapper--image`)):i(this,Mt,"f")||(i(this,xt,"f").classList.remove(`${Lt}-logo-wrapper--image`),i(this,xt,"f").classList.add(`${Lt}-logo-wrapper--text`))},customElements.get(Lt)||customElements.define(Lt,Wt),function(t){t.Closed="closed",t.Mounting="mounting",t.Open="open"}($e||($e={}));const Ee="shop_followed";class Me extends m{static get observedAttributes(){return[g,w,v,_]}constructor(){super(),Ft.add(this),At.set(this,void 0),Tt.set(this,b()),qt.set(this,""),zt.set(this,"2"),Bt.set(this,window.location.origin),Ht.set(this,!1),It.set(this,new y({elementName:"shop-follow-button",analyticsTraceId:i(this,Tt,"f")})),Nt.set(this,void 0),Ut.set(this,void 0),Pt.set(this,!1),Dt.set(this,null),Ot.set(this,void 0),Rt.set(this,void 0),jt.set(this,void 0),Vt.set(this,void 0),Gt.set(this,void 0),Yt.set(this,void 0),Jt.set(this,void 0),Qt.set(this,void 0),Kt.set(this,void 0),Xt.set(this,$e.Closed),Zt.set(this,void 0),te.set(this,void 0),ee.set(this,void 0),ne.set(this,null),ie.set(this,(()=>{i(this,Ft,"m",ue).call(this,!0)})),n(this,At,this.attachShadow({mode:"open"}),"f"),n(this,Pt,"true"===x(Ee),"f")}attributeChangedCallback(t,e,o){switch(t){case w:n(this,zt,o,"f"),i(this,Ft,"m",ue).call(this);break;case g:n(this,qt,o,"f"),i(this,Ft,"m",ue).call(this);break;case v:n(this,Bt,o,"f"),k(i(this,Bt,"f"));break;case _:n(this,Ht,"true"===o,"f"),i(this,Ft,"m",ue).call(this)}}connectedCallback(){return h(this,void 0,void 0,(function*(){this.subscribeToHub(S.UserStatusIdentity,i(this,ie,"f")),yield i(this,Ft,"m",oe).call(this),i(this,Ft,"m",se).call(this),i(this,Ft,"m",le).call(this)}))}disconnectedCallback(){var t,e,n,o;this.unsubscribeAllFromHub(),null===(t=i(this,Rt,"f"))||void 0===t||t.destroy(),null===(e=i(this,Nt,"f"))||void 0===e||e.disconnect(),null===(n=i(this,Gt,"f"))||void 0===n||n.destroy(),null===(o=i(this,Yt,"f"))||void 0===o||o.destroy()}}At=new WeakMap,Tt=new WeakMap,qt=new WeakMap,zt=new WeakMap,Bt=new WeakMap,Ht=new WeakMap,It=new WeakMap,Nt=new WeakMap,Ut=new WeakMap,Pt=new WeakMap,Dt=new WeakMap,Ot=new WeakMap,Rt=new WeakMap,jt=new WeakMap,Vt=new WeakMap,Gt=new WeakMap,Yt=new WeakMap,Jt=new WeakMap,Qt=new WeakMap,Kt=new WeakMap,Xt=new WeakMap,Zt=new WeakMap,te=new WeakMap,ee=new WeakMap,ne=new WeakMap,ie=new WeakMap,Ft=new WeakSet,oe=function(){return h(this,void 0,void 0,(function*(){try{const t="en",e={follow_on_shop:{follow:"Follow on {shop}",following:"Following on {shop}",auth_modal:{title:"Follow on Shop",description:"Stay in the know—never miss a sale, restock, or order update."},following_modal:{title:"Visit {store} on Shop",subtitle:"Everything you need to shop, track, and pay—all in one place.",qr_header:"Scan to visit {store} on the Shop app",qr_alt_text:"Shop app QR code",continue:"Continue"},completed:{title:"You're following {store}",subtitle:"We've sent you an email with a link to download the Shop app."},personalization_consent:{title:"To follow on Shop, sync your shopping activity"}},login_with_shop:{login:"Sign in with {shop}",auth_modal:{login_title:"Sign in with Shop",login_title_with_store:"Sign in to {store} with Shop",login_description:"The easiest and most secure way to sign in to {store}—no password needed.",signup_title:"Create an account",signup_description:"Enter your phone number to create a Shop account.",login_sms_title:"Confirm it's you",login_sms_description:"Enter the code sent to {phoneNumber}",login_email_title:"Confirm it’s you",login_email_description:"Enter the code sent to your email, {email}",login_webauthn_title:"Confirm it’s you",login_webauthn_description:"Sign in with a passkey to securely use your saved information.",login_webauthn_footer:"By continuing, your name and email address will be shared with {store}."}},verified_email_auth:{auth_modal:{login_title:"Log in or sign up",signup_title:"Continue with Shop",signup_description:"Create a Shop account to sign in to {clientName}–no passwords needed"}},legal:{terms_of_service:"terms of service",privacy_policy:"privacy policy",terms:"terms",client:"See {clientName}’s {termsOfService} and {privacyPolicy}.",shop:"By continuing, you agree to Shop’s {termsOfService} and acknowledge the {privacyPolicy}.",authorized_scopes:{email_name:"By continuing, your name and email address will be shared with {store}."}},checkout_modal:{auth_modal:{login_sms_description:"Enter the code sent to {phoneNumber} to securely use your saved information.",login_email_description:"Enter the code sent to your email, {email} to securely use your saved information."}},customer_accounts:{remember_me:"Save my info securely with Shop to sign in faster everywhere",sign_up_page:{auth_modal:{login_title:"Continue with Shop",login_description:"Use your Shop account to sign in everywhere—no password needed.",login_sms_description:"Use your Shop account to sign in everywhere—no password needed.\r\n\r\nConfirm it's you, enter the code sent to {phoneNumber}",login_email_description:"Use your Shop account to sign in everywhere—no password needed.\r\n\r\nConfirm it's you, enter the code sent to your email, {email}",login_webauthn_title:"Continue with Shop",login_webauthn_description:"Sign in with a passkey to securely use your saved information."}}},payment_request:{auth_modal:{login_title:"Check out with Shop Pay",login_description:"Use your saved information to check out securely at {store}.",login_sms_title:"Confirm it's you",login_sms_description:"Enter the code sent to {phoneNumber} to securely use your saved information.",login_email_title:"Confirm it’s you",login_email_description:"Enter the code sent to your email, {email} to securely use your saved information."}}};n(this,ne,new u({[t]:e}),"f")}catch(t){t instanceof Error&&f.notify(t)}return null}))},se=function(){n(this,Ut,function(t){const e=document.createElement("follow-on-shop-button");return t&&e.setAttribute(gt,""),e}(i(this,Pt,"f")),"f"),i(this,At,"f").innerHTML=$,i(this,At,"f").appendChild(i(this,Ut,"f"))},le=function(){var t;i(this,Ft,"m",ge).call(this,i(this,Pt,"f")),i(this,Ft,"m",we).call(this),k(i(this,Bt,"f")),null===(t=i(this,Ut,"f"))||void 0===t||t.addEventListener("click",(()=>{var t;if(i(this,Ht,"f"))return n(this,Pt,!i(this,Pt,"f"),"f"),void(null===(t=i(this,Ut,"f"))||void 0===t||t.setFollowing({following:i(this,Pt,"f")}));i(this,Pt,"f")?(i(this,It,"f").trackFollowingGetAppButtonPageImpression(),E()?i(this,Ft,"m",re).call(this):i(this,Ft,"m",pe).call(this)):(i(this,It,"f").trackFollowButtonClicked(),i(this,Ft,"m",ae).call(this))}))},ae=function(){i(this,Jt,"f")?i(this,Ft,"m",xe).call(this):(n(this,Qt,i(this,Ft,"m",he).call(this),"f"),n(this,Kt,mt({}),"f"),i(this,Kt,"f").append(i(this,Ft,"m",de).call(this)),n(this,Gt,M().withInnerHTML($).build(),"f"),i(this,Gt,"f").setNametagSuffix("follow"),n(this,Jt,i(this,Gt,"f").sheetModal,"f"),i(this,Jt,"f").setAttribute(C,i(this,Tt,"f")),i(this,Jt,"f").appendChild(i(this,Qt,"f")),i(this,Jt,"f").appendChild(i(this,Kt,"f")),i(this,Jt,"f").addEventListener("modalcloserequest",i(this,Ft,"m",ke).bind(this)),i(this,Jt,"f").setMonorailTracker(i(this,It,"f")),n(this,Xt,$e.Mounting,"f"))},re=function(){return h(this,void 0,void 0,(function*(){var t,e,o;if(!i(this,Zt,"f")){n(this,Yt,M().withInnerHTML($).build(),"f"),i(this,Yt,"f").setNametagSuffix("followed"),n(this,Zt,i(this,Yt,"f").sheetModal,"f"),i(this,Zt,"f").setMonorailTracker(i(this,It,"f")),i(this,Zt,"f").setAttribute("disable-popup","true");const s=yield i(this,Ft,"m",ve).call(this),l=null!==(t=null==s?void 0:s.name)&&void 0!==t?t:"the store",a=null===(e=i(this,ne,"f"))||void 0===e?void 0:e.translate("follow_on_shop.following_modal.title",{store:l}),r=null===(o=i(this,ne,"f"))||void 0===o?void 0:o.translate("follow_on_shop.following_modal.subtitle");n(this,te,mt({title:a,description:r},!0),"f"),i(this,Zt,"f").appendChild(i(this,te,"f")),i(this,Zt,"f").appendChild(yield i(this,Ft,"m",ce).call(this)),i(this,Zt,"f").addEventListener("modalcloserequest",(()=>h(this,void 0,void 0,(function*(){var t;i(this,Zt,"f")&&(yield i(this,Zt,"f").close()),null===(t=i(this,Ut,"f"))||void 0===t||t.setFocused()})))),a&&i(this,Zt,"f").setAttribute("title",a)}i(this,Zt,"f").open(),i(this,It,"f").trackFollowingGetAppButtonPageImpression()}))},he=function(){const t=document.createElement(Lt);return i(this,Ft,"m",ve).call(this).then((e=>{t.update({name:(null==e?void 0:e.name)||"",logoSrc:(null==e?void 0:e.id)?`${L}/shops/${e.id}/logo?width=58`:""})})).catch((()=>{})),t},de=function(){var t;n(this,Ot,document.createElement("iframe"),"f"),i(this,Ot,"f").tabIndex=0,i(this,Ft,"m",ue).call(this);const e=(null===(t=this.ownerDocument)||void 0===t?void 0:t.defaultView)||void 0;return n(this,Rt,new W(new F(i(this,Ot,"f")),[A,T,i(this,Bt,"f")],i(this,Ft,"m",Se).bind(this),e),"f"),n(this,jt,new q(i(this,Ot,"f")),"f"),z(i(this,Ot,"f"),"allow","publickey-credentials-get *"),i(this,Ot,"f")},ce=function(){return h(this,void 0,void 0,(function*(){var t,e;const n=document.createElement("div"),o=yield i(this,Ft,"m",ve).call(this),s=null==o?void 0:o.id,l=null!==(e=null===(t=i(this,ne,"f"))||void 0===t?void 0:t.translate("follow_on_shop.following_modal.continue",{defaultValue:"Continue"}))&&void 0!==e?e:"",a=s?`https://shop.app/sid/${s}`:"#";return n.innerHTML=B(a,l),n.addEventListener("click",(()=>h(this,void 0,void 0,(function*(){var t;i(this,It,"f").trackFollowingGetAppButtonClicked(),null===(t=i(this,Zt,"f"))||void 0===t||t.close()})))),n}))},pe=function(){return h(this,void 0,void 0,(function*(){var t,e,o,s,l,a,r;if(!i(this,ee,"f")){n(this,ee,document.createElement("div"),"f"),i(this,ee,"f").classList.add("fos-tooltip","fos-tooltip-hidden");const h=yield i(this,Ft,"m",ve).call(this),d=null!==(t=null==h?void 0:h.name)&&void 0!==t?t:"the store",c=null!==(o=null===(e=i(this,ne,"f"))||void 0===e?void 0:e.translate("follow_on_shop.following_modal.qr_header",{store:d}))&&void 0!==o?o:"",p=null!==(l=null===(s=i(this,ne,"f"))||void 0===s?void 0:s.translate("follow_on_shop.following_modal.qr_alt_text"))&&void 0!==l?l:"",u=null==h?void 0:h.id,f=u?`${L}/qr/sid/${u}`:"#";i(this,ee,"f").innerHTML=H(c,f,p),null===(a=i(this,ee,"f").querySelector(".fos-tooltip-overlay"))||void 0===a||a.addEventListener("click",(()=>{var t;null===(t=i(this,ee,"f"))||void 0===t||t.classList.toggle("fos-tooltip-hidden",!0)})),null===(r=i(this,ee,"f"))||void 0===r||r.addEventListener("click",(()=>{var t;null===(t=i(this,ee,"f"))||void 0===t||t.classList.toggle("fos-tooltip-hidden",!0)})),i(this,At,"f").appendChild(i(this,ee,"f"))}i(this,ee,"f").classList.toggle("fos-tooltip-hidden",!1)}))},ue=function(t){if(i(this,Ot,"f")){const e={clientId:i(this,qt,"f"),responseType:"code"},n=I({version:i(this,zt,"f"),analyticsTraceId:i(this,Tt,"f"),flow:N.Follow,oauthParams:e});i(this,Ft,"m",fe).call(this),z(i(this,Ot,"f"),"src",n,t),f.leaveBreadcrumb("Iframe url updated",{authorizeUrl:n},"state")}},fe=function(){i(this,Ft,"m",me).call(this),n(this,Vt,setTimeout((()=>{const t=R.temporarilyUnavailable;this.dispatchCustomEvent("error",{message:t.message,code:t.code}),i(this,Ft,"m",me).call(this)}),U),"f")},me=function(){i(this,Vt,"f")&&(clearTimeout(i(this,Vt,"f")),n(this,Vt,void 0,"f"))},ge=function(t){i(this,It,"f").trackFollowButtonPageImpression(t)},we=function(){n(this,Nt,new IntersectionObserver((t=>{var e;for(const{isIntersecting:n}of t)n&&(null===(e=i(this,Nt,"f"))||void 0===e||e.disconnect(),i(this,It,"f").trackFollowButtonInViewport())})),"f"),i(this,Nt,"f").observe(i(this,Ut,"f"))},ve=function(){return h(this,void 0,void 0,(function*(){return i(this,Dt,"f")||n(this,Dt,yield P(i(this,Bt,"f")),"f"),i(this,Dt,"f")}))},_e=function(t){return h(this,arguments,void 0,(function*({loggedIn:t,shouldFinalizeLogin:e,email:o,givenNameFirstInitial:s,avatar:l}){var a,r,h,d;const c=new Date;c.setTime(c.getTime()+31536e6),document.cookie=`${Ee}=true;expires=${c.toUTCString()};path=/`,t&&e&&(j(i(this,Bt,"f"),(t=>{f.notify(new Error(t))})),this.publishToHub(S.UserSessionCreate,{email:s||o,initial:s||(null==o?void 0:o[0])||"",avatar:l})),this.dispatchCustomEvent("completed",{loggedIn:t,email:o}),yield null===(a=i(this,Qt,"f"))||void 0===a?void 0:a.setFavorited(),yield null===(r=i(this,Jt,"f"))||void 0===r?void 0:r.close(),null===(h=i(this,Rt,"f"))||void 0===h||h.destroy(),null===(d=i(this,Ut,"f"))||void 0===d||d.setFollowing({following:!0}),n(this,Pt,!0,"f"),i(this,Ft,"m",ge).call(this,!0)}))},be=function(t,e,n){i(this,Ft,"m",me).call(this),this.dispatchCustomEvent("error",{code:t,message:e,email:n})},ye=function(t){return h(this,arguments,void 0,(function*({clientName:t,logoSrc:e}){(t||e)&&i(this,Qt,"f").update({name:t,logoSrc:e}),i(this,It,"f").trackShopPayModalStateChange({currentState:V.Loaded}),i(this,Xt,"f")===$e.Mounting&&(i(this,Ft,"m",xe).call(this),n(this,Xt,$e.Open,"f"),i(this,Ft,"m",me).call(this))}))},xe=function(){return h(this,void 0,void 0,(function*(){var t;(yield i(this,Jt,"f").open())&&(null===(t=i(this,jt,"f"))||void 0===t||t.postMessage({type:"sheetmodalopened"}))}))},ke=function(){return h(this,void 0,void 0,(function*(){var t,e;if(i(this,Jt,"f")){(yield i(this,Jt,"f").close())&&(null===(t=i(this,jt,"f"))||void 0===t||t.postMessage({type:"sheetmodalclosed"}),D())}null===(e=i(this,Ut,"f"))||void 0===e||e.setFocused()}))},Se=function(t){var e,n,o,l;switch(t.type){case"loaded":i(this,Ft,"m",ye).call(this,t);break;case"resize_iframe":i(this,Ot,"f").style.height=`${t.height}px`,i(this,Ot,"f").style.width=`${O(t.width,i(this,Ot,"f"))}px`;break;case"completed":i(this,Ft,"m",_e).call(this,t);break;case"error":i(this,Ft,"m",be).call(this,t.code,t.message,t.email);break;case"content":null===(e=i(this,Jt,"f"))||void 0===e||e.setAttribute("title",t.title),null===(n=i(this,Kt,"f"))||void 0===n||n.update(t),null===(o=i(this,Qt,"f"))||void 0===o||o.classList.toggle("hidden",t.authorizeState===s.Captcha);break;case"processing_status_updated":null===(l=i(this,Kt,"f"))||void 0===l||l.update(t);break;case"close_requested":i(this,Ft,"m",ke).call(this)}},G()&&(Y({bundle:"loginButton",bundleLocale:"en"}),J(),t("shop-follow-button",Me),Q(),t("shop-swirl",K)); //# sourceMappingURL=client.login-button_C7ZT1KH5.en.esm.js.map