1import{t as e,m as t,s as a}from"./2c1ab0fe.GMbxnz74.js";import{bv as n,c2 as s,S as c,J as l,W as o,cS as r,cU as i}from"./4c290a1e.C6TDJ9Fn.js";import{iF as _,co as u}from"./164ad2e3.BbIvMjRY.js";var d=(e=>(e.ApplePay="ApplePay",e.Checkout="Checkout",e.PayPalV6="PayPalV6",e.Venmo="Venmo",e.GooglePay="GooglePay",e.ShopifyPay="ShopifyPay",e.ShopPayApplePay="ShopPayApplePay",e))(d||{}),p=(e=>(e.Attempt="attempt",e.Success="success",e.Cancelled="cancelled",e.Failure="failure",e.Clicked="clicked",e.Initialized="initialized",e.NascarDrawerOpen="open",e.NascarDrawerClose="close",e))(p||{}),m=(e=>(e.Express="express",e.PaymentMethod="payment_method",e))(m||{}),h=(e=>(e.InitCalled="spb_init_called",e.ClickAcceleratedClicked="spb_instrument_click__accelerated__clicked",e.ClickSheetClicked="spb_instrument_click__sheet__clicked",e.ClickAcceleratedInitialized="spb_instrument_click__accelerated__initialized",e.ClickSheetInitialized="spb_instrument_click__sheet__initialized",e.ClickAcceleratedSuccess="spb_instrument_click__accelerated__success",e.ClickSheetSuccess="spb_instrument_click__sheet__success",e.ClickAcceleratedCancelled="spb_instrument_click__accelerated__cancelled",e.ClickSheetCancelled="spb_instrument_click__sheet__cancelled",e.ClickAcceleratedFailed="spb_instrument_click__accelerated__failure",e.ClickSheetFailed="spb_instrument_click__sheet__failure",e.SheetLoaded="spb_instrument_sheet_loaded",e.AuthAcceleratedAttempt="spb_instrument_auth__accelerated__attempt",e.AuthSheetAttempt="spb_instrument_auth__sheet__attempt",e.AuthAcceleratedSuccess="spb_instrument_auth__accelerated__success",e.AuthSheetSuccess="spb_instrument_auth__sheet__success",e.AuthAcceleratedFailure="spb_instrument_auth__accelerated__failure",e.AuthSheetFailure="spb_instrument_auth__sheet__failure",e.AuthorizationAttempt="wallets_authorization_attempt",e.AuthorizationComplete="wallets_authorization_complete",e.CryptoModalCancelled="checkout_crypto_payment_modal__cancelled",e.CryptoModalCompleted="checkout_crypto_payment_modal__completed",e.CryptoModalRendered="checkout_crypto_payment_modal__rendered",e.CryptoModalWalletAction="checkout_crypto_payment_modal__wallet_action",e.CryptoModalError="checkout_crypto_payment_modal__error",e.RecoveryFlowInitiated="spb_instrument_recovery_flow__initiated",e))(h||{});function y(){const t=n();return e(()=>({screenWidth:"undefined"==typeof window?0:window.innerWidth,cartValue:t.value?.amount,currencyCode:t.value?.currencyCode}))}function k(e,a){const n=s(),{userEvents:l}=c(),o=y();t(()=>{const{defaultAttributes:t}=n.value;if(!t)return;const s=v(e),c=f({walletName:void 0,shopId:t.shopId,eventName:"spb_init_called",nascarData:{...o.value,walletsRenderedCount:a,walletsRenderedNames:s},walletType:"payment_method"});c&&l.monorailEvent(c)},[l,o.value,e,a,n])}function C({state:e,shopId:t,paymentMethods:a,nascarData:n}){return f({walletName:"NascarDrawer",shopId:t,eventName:e,nascarData:{...n,walletsRenderedNames:v(a)}})}function f({walletName:e,shopId:t,eventName:a,nascarData:n,walletType:s,ttl:c,eventSubtype:l}){const o=_();return o?b({eventName:a,shopId:t,defaultAttributes:o,nascarData:n,walletType:s,walletName:e,ttl:c,eventSubtype:l}):null}function b({eventName:e,shopId:t,defaultAttributes:a,nascarData:n,walletName:s,walletType:c,ttl:l,eventSubtype:o}){const{uniqToken:r,visitToken:i,microSessionId:_,microSessionCount:u=0,themeId:d,themeCityHash:p,contentLanguage:m,referer:h,checkoutToken:y}=a??{};return{schemaId:"shopify_wallet_checkout_track/6.3",payload:{event:e,eventSubtype:o??c??"express",appName:"checkout",pageType:"checkout",checkoutToken:y,instrumentId:s,checkoutOne:!0,uniqToken:r,visitToken:i,microSessionId:_,microSessionCount:u,shopId:t,themeId:d,themeCityHash:p||"",contentLanguage:m,referer:h,...l&&{ttl:l},...n&&{...n}}}}function v(e){return e.map(e=>e.name).join(",")}function S(e){const t=A(e);return a((e,a=m.Express)=>{const n=a===m.Express;t({event:`${n?"spb_instrument_click__accelerated_":"spb_instrument_click__sheet_"}_${e}`,walletType:a})},[t])}function w(e){const t=A(e);return a((e,a=m.Express)=>{const n=a===m.Express;t({event:`spb_instrument_auth__${n?"accelerated":"sheet"}__${e}`,walletType:a})},[t])}function A(e){const{userEvents:t,shop:{id:n}}=c();return a(({event:a,ttl:s,walletType:c,eventSubtype:o})=>{const r=parseInt(l(n),10),i=f({walletName:e,shopId:r,eventName:a,walletType:c,ttl:s,eventSubtype:o});i&&t.monorailEvent(i)},[t,n,e])}function I(){const{checkout:e}=c(),{locationAddress:t}=o(),n=u(),s=a(e=>{const a=t.fields.countryCode.value;return Boolean(n.value&&a&&e!==a)}
1,[t,n]),l=a((t,{dismissible:a=!0,onCancel:n}={})=>{!function(e,t,{dismissible:a=!0,onCancel:n}={}){let s=null;const c=new Promise(e=>{s=e});e.setCrossBorderConfirmState({onConfirm:a=>{e.setCrossBorderConfirmState(null),a.setSelectedMethodTypes(["SHIPPING"]),t(),s?.()},...a&&{onCancel:()=>{e.setCrossBorderConfirmState(null),n?.(),s?.()}},modalPromise:c})}(e,t,{dismissible:a,onCancel:n})},[e]);return{shouldGateCrossBorder:s,crossBorderGate:l}}function N(){const{shippingAddress:t}=o(),a=r();return e(()=>{const e=t.value?.countryCode;if(!e)return!1;const n=a.value;if(!n)return!1;const s=i(n)?.pickupLocation?.address.countryCode;return!!s&&e!==s})}export{h as W,I as a,d as b,m as c,S as d,p as e,w as f,b as g,y as h,k as i,C as j,N as k,A as u};
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.