1import"./client.shop-login-button_DmUq1QfF.en.esm.js";import{_ as e,af as t,aj as n,i as o,ao as i,ay as a,x as s,c as r,at as c,au as l,av as u,az as d,aA as m,aB as p,aw as f,ar as g,as as h,aC as v,ah as _}from"./chunk.common_DplD2_3Q.en.esm.js";import"./chunk.modal_BxEbAqG6.en.esm.js";function b(){return e(this,arguments,void 0,(function*(_=!1,b){var w,E;const j=t(),k=new n("initCustomerAccounts"),A={analyticsContext:"loginWithShopClassicCustomerAccounts",analyticsTraceId:j,apiKey:"",flow:"classic_customer_accounts",flowVersion:"sign_in",shopPermanentDomain:null!==(E=null===(w=o.Shopify)||void 0===w?void 0:w.shop)&&void 0!==E?E:""},S=new i({analyticsData:A,notify:k.notify});try{if(a(o.location.pathname).endsWith("/account"))return void function(){e(this,void 0,void 0,(function*(){S.trackPageImpression({page:"CLASSIC_CUSTOMER_ACCOUNTS_ACCOUNT_PAGE"}),yield import("./loader.shop-toast-manager.esm.js")}))}();const t=new AbortController;(null==b?void 0:b.fedCMEnabled)&&function(e){const t=r.querySelector("#customer_login");if(!t)return;c({mediation:"required",analyticsTraceId:j,monorailTracker:S,signal:e}).then((e=>function(e,t,n,i){if(200!==(null==e?void 0:e.status))return void(null==i||i.notify(new Error("FedCM failed to authenticate")));if(!t)return void(null==i||i.notify(new Error("FedCM failed to find the nearest form to leverage sign in URL")));const a=y(t,n);o.location.assign(a)}(e,t,j,k))).catch((e=>function(e,t){if(e instanceof d||e instanceof m||"IdentityCredentialError"===e.name&&"Error retrieving a token."===e.message||e instanceof DOMException&&"NetworkError"===e.name&&"Error retrieving a token."===e.message)return;t.notify(e)}(e,k)))}(t.signal),function({abortFedCmController:e,autoOpen:t,initOptions:n}){const i=new WeakMap;let a=null;const s=l({onFallback:e=>{e.addEventListener("focus",c,{once:!0}),S.produceMonorailEvent({event:{schemaId:"shopify_pay_login_with_
1shop_sdk_error_events/1.0",payload:Object.assign(Object.assign({},A),{sdkVersion:"1.1.0-beta",errorCode:"fallback_to_focus_event",errorMessage:"Fallback to focus event for classic customer accounts"})}})},onVisible:n=>d({input:n,autoOpen:t,abortFedCmController:e})});function c(n){d({input:n.target,autoOpen:t,abortFedCmController:e})}function d({abortFedCmController:e,autoOpen:t,input:s}){var c;const l=s.form;if(!l)return;if(i.has(s)&&(null===(c=i.get(s))||void 0===c||c.destroy(),i.delete(s)),!a){a=function({autoOpen:e,initOptions:t}){let n,o=!1;n=r.querySelector("shop-login-button:not([action])"),n||(n=g("shop-login-button"),o=!0);(function({element:e,props:t}){Object.entries(Object.assign(Object.assign({},C),t)).forEach((([t,n])=>{const o=v(t);e.setAttribute(o,String(n))}))})({element:n,props:Object.assign(Object.assign(Object.assign(Object.assign({autoOpen:e,consentChallenge:!0,disableSignUp:!0,experiments:JSON.stringify((null==t?void 0:t.experiments)||{})},o?{hideButton:!0}:{}),{proxy:!0}),h()),{responseType:"code",uxMode:"windoid"})}),o&&r.body.appendChild(n);return n}({autoOpen:t,initOptions:n});const i=y(l,O(a));a.setAttribute("return-uri",i),a.addEventListener("completed",(()=>{o.location.assign(i)})),a.addEventListener("windoidopened",(()=>{null==e||e.abort(new m)})),a.addEventListener("modalclosed",(()=>{p("signInWithShop:modalDismissed","true")}))}a.getAttribute("defer-modal-on-autofill")&&a.setAttribute("email-input-selector",`#${s.id}`),a.setAttribute("email",s.value),i.set(s,new f(s,(e=>{null==a||a.setAttribute("email",e)})));const u=r.createElement("input");u.type="hidden",u.name="login_with_shop[analytics_trace_id]",u.value=O(a),l.appendChild(u)}u({onElementFound:e=>s.observe(e),selector:'form[data-login-with-shop-sign-in] input[type="email"],form[data-login-with-shop-sign-in] input[name="customer[email]"'})}({abortFedCmController:t,autoOpen:!(null==b?void 0:b.fedCMEnabled),initOptions:b})}catch(e){e instanceof Error&&k.notify(e),e instanceof s&&"InitCustomerAccountsError"===e.name&&S.produceMonorailEvent({event:{payload:Object.assign(Object.assign({},A),{analyticsTraceId:e.analyticsTraceId||j,errorCode:e.code,errorMessage:e.message,sdkVersion:"1.1.0-beta"}
1),schemaId:"shopify_pay_login_with_shop_sdk_error_events/1.0"}})}}))}const C={analyticsContext:"loginWithShopClassicCustomerAccounts",clientId:"",flow:"classic_customer_accounts",flowVersion:"sign_in"};function y(e,t){var n,i;const a=null===(n=e.elements.namedItem("checkout_url"))||void 0===n?void 0:n.value,s=null===(i=e.elements.namedItem("return_url"))||void 0===i?void 0:i.value,r=new URLSearchParams(Object.assign(Object.assign({analytics_trace_id:t},a&&{checkout_url:a}),s&&{return_url:s}));return`${o.location.origin}/account/redirect?${r.toString()}`}function O(e){return(null==e?void 0:e.getAttribute("data-instance-id"))||t()}_("initCustomerAccounts",b); 2//# sourceMappingURL=client.init-customer-accounts_CItT2Bi5.en.esm.js.map
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.