(()=>{var nr=Object.defineProperty,or=Object.defineProperties;var ir=Object.getOwnPropertyDescriptors;var ze=Object.getOwnPropertySymbols;var sr=Object.prototype.hasOwnProperty,ar=Object.prototype.propertyIsEnumerable;var Qe=(t,e,r)=>e in t?nr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,f=(t,e)=>{for(var r in e||(e={}))sr.call(e,r)&&Qe(t,r,e[r]);if(ze)for(var r of ze(e))ar.call(e,r)&&Qe(t,r,e[r]);return t},G=(t,e)=>or(t,ir(e));var a=(t,e,r)=>new Promise((n,o)=>{var s=l=>{try{c(r.next(l))}catch(u){o(u)}},i=l=>{try{c(r.throw(l))}catch(u){o(u)}},c=l=>l.done?n(l.value):Promise.resolve(l.value).then(s,i);c((r=r.apply(t,e)).next())});var Xe="WebPixel::Render";var Me=t=>shopify.extend(Xe,t);function Ze(){let t="0123456789abcdef";return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{let n=Math.floor(Math.random()*16),o=r==="x"?n:n&3|8;return t[o]})}function et(){let t="0123456789abcdef";return"x".repeat(32).replace(/[x]/g,r=>{let o=Math.floor(Math.random()*16);return t[o]})}var q="GE_UTM_PARAMS",X="GlobalE_Analytics_UTMs",tt="GE_UTM_PARAMS_RAW",pe="GE_META_PARAMS",Pe="BF_CONSENT_PARAM",rt="GlobalE_Analytics_GoogleAds";var nt="borderfree",ot="borderfree.com",ge={FLID:{urlParam:"GEflid",cookieName:"_fbc"},FP:{urlParam:"GEfp",cookieName:"_fbp"}},it="bf_consent",st="directToCheckout",at="directToCheckoutEnabled",K="IsMerchantOperatedByGE";var J="8.55.0";var P=globalThis;function me(t,e,r){let n=r||P,o=n.__SENTRY__=n.__SENTRY__||{},s=o[J]=o[J]||{};return s[t]||(s[t]=e())}var _e=typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__;var cr="Sentry Logger ",ct=["debug","info","warn","error","log","assert","trace"],ut={};function ur(t){if(!("console"in P))return t();let e=P.console,r={},n=Object.keys(ut);n.forEach(o=>{let s=ut[o];r[o]=e[o],e[o]=s});try{return t()}finally{n.forEach(o=>{e[o]=r[o]})}}function lr(){let t=!1,e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return _e?ct.forEach(r=>{e[r]=(...n)=>{t&&ur(()=>{P.console[r](`${cr}[${r}]:`,...n)})}}):ct.forEach(r=>{e[r]=()=>{}}),e}var Z=me("logger",lr);function ee(){return he(P),P}function he(t){let e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||J,e[J]=e[J]||{}}var dr=Object.prototype.toString;function pr(t,e){return dr.call(t)===`[object ${e}]`}function lt(t){return pr(t,"Object")}function dt(t){return!!(t&&t.then&&typeof t.then=="function")}function pt(t,e,r){try{Object.defineProperty(t,e,{value:r,writable:!0,configurable:!0})}catch(n){_e&&Z.log(`Failed to add non-enumerable property "${e}" to object`,t)}}var gt=1e3;function Le(){return Date.now()/gt}function gr(){let{performance:t}=P;if(!t||!t.now)return Le;let e=Date.now()-t.now(),r=t.timeOrigin==null?e:t.timeOrigin;return()=>(r+t.now())/gt}var mt=gr(),Ie,Zn=(()=>{let{performance:t}=P;if(!t||!t.now){Ie="none";return}let e=3600*1e3,r=t.now(),n=Date.now(),o=t.timeOrigin?Math.abs(t.timeOrigin+r-n):e,s=oMath.random()*16;try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(r=()=>{let n=new Uint8Array(1);return e.getRandomValues(n),n[0]})}catch(n){}return("10000000100040008000"+1e11).replace(/[018]/g,n=>(n^(r()&15)>>n/4).toString(16))}function ht(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||mt(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:Y()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{let r=t.timestamp-t.started;t.duration=r>=0?r:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function Ue(){return Y()}function Ne(){return Y().substring(16)}function Fe(t,e,r=2){if(!e||typeof e!="object"||r<=0)return e;if(t&&e&&Object.keys(e).length===0)return t;let n=f({},t);for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=Fe(n[o],e[o],r-1));return n}var Ge="_sentrySpan";function Be(t,e){e?pt(t,Ge,e):delete t[Ge]}function Ke(t){return t[Ge]}var mr=100,je=class t{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Ue(),spanId:Ne()}}clone(){let e=new t;return e._breadcrumbs=[...this._breadcrumbs],e._tags=f({},this._tags),e._extra=f({},this._extra),e._contexts=f({},this._contexts),this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata=f({},this._sdkProcessingMetadata),e._propagationContext=f({},this._propagationContext),e._client=this._client,e._lastEventId=this._lastEventId,Be(e,Ke(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&ht(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags=f(f({},this._tags),e),this._notifyScopeListeners(),this}setTag(e,r){return this._tags=G(f({},this._tags),{[e]:r}),this._notifyScopeListeners(),this}setExtras(e){return this._extra=f(f({},this._extra),e),this._notifyScopeListeners(),this}setExtra(e,r){return this._extra=G(f({},this._extra),{[e]:r}),this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,r){return r===null?delete this._contexts[e]:this._contexts[e]=r,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;let r=typeof e=="function"?e(this):e,[n,o]=r instanceof j?[r.getScopeData(),r.getRequestSession()]:lt(r)?[e,e.requestSession]:[],{tags:s,extra:i,user:c,contexts:l,level:u,fingerprint:g=[],propagationContext:p}=n||{};return this._tags=f(f({},this._tags),s),this._extra=f(f({},this._extra),i),this._contexts=f(f({},this._contexts),l),c&&Object.keys(c).length&&(this._user=c),u&&(this._level=u),g.length&&(this._fingerprint=g),p&&(this._propagationContext=p),o&&(this._requestSession=o),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,Be(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Ue()}),this._notifyScopeListeners(),this}addBreadcrumb(e,r){let n=typeof r=="number"?r:mr;if(n<=0)return this;let o=f({timestamp:Le()},e);return this._breadcrumbs.push(o),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client&&this._client.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:Ke(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=Fe(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=f({spanId:Ne()},e),this}getPropagationContext(){return this._propagationContext}captureException(e,r){let n=r&&r.event_id?r.event_id:Y();if(!this._client)return Z.warn("No client configured on scope - will not capture exception!"),n;let o=new Error("Sentry syntheticException");return this._client.captureException(e,G(f({originalException:e,syntheticException:o},r),{event_id:n}),this),n}captureMessage(e,r,n){let o=n&&n.event_id?n.event_id:Y();if(!this._client)return Z.warn("No client configured on scope - will not capture message!"),o;let s=new Error(e);return this._client.captureMessage(e,r,G(f({originalException:e,syntheticException:s},n),{event_id:o}),this),o}captureEvent(e,r){let n=r&&r.event_id?r.event_id:Y();return this._client?(this._client.captureEvent(e,G(f({},r),{event_id:n}),this),n):(Z.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}},j=je;function ft(){return me("defaultCurrentScope",()=>new j)}function St(){return me("defaultIsolationScope",()=>new j)}var Ve=class{constructor(e,r){let n;e?n=e:n=new j;let o;r?o=r:o=new j,this._stack=[{scope:n}],this._isolationScope=o}withScope(e){let r=this._pushScope(),n;try{n=e(r)}catch(o){throw this._popScope(),o}return dt(n)?n.then(o=>(this._popScope(),o),o=>{throw this._popScope(),o}):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function te(){let t=ee(),e=he(t);return e.stack=e.stack||new Ve(ft(),St())}function hr(t){return te().withScope(t)}function fr(t,e){let r=te();return r.withScope(()=>(r.getStackTop().scope=t,e(t)))}function yt(t){return te().withScope(()=>t(te().getIsolationScope()))}function Et(){return{withIsolationScope:yt,withScope:hr,withSetScope:fr,withSetIsolationScope:(t,e)=>yt(e),getCurrentScope:()=>te().getScope(),getIsolationScope:()=>te().getIsolationScope()}}function He(t){let e=he(t);return e.acs?e.acs:Et()}function Ye(){let t=ee();return He(t).getCurrentScope()}function qe(){let t=ee();return He(t).getIsolationScope()}function _t(t){if(t)return Sr(t)?{captureContext:t}:Er(t)?{captureContext:t}:t}function Sr(t){return t instanceof j||typeof t=="function"}var yr=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"];function Er(t){return Object.keys(t).some(e=>yr.includes(e))}function Te(t,e){return Ye().captureException(t,_t(e))}function we(t,e){qe().setTag(t,e)}var N=class{constructor(e){this.headers=new Headers({"Access-Control-Allow-Origin":"*","Content-Type":"application/json"});this.baseURL=e}buildUrl(e){return`${this.baseURL}${e}`}handleResponse(e,r=!1){let n=e.headers.get("X-Vwo-Campaigns")||void 0;return e.headers.has("X-Error-Message")?e.text().then(()=>({isSuccess:!1,data:null,errorMessage:null,httpStatusCode:e.status,xVwoCampaigns:n})):e.ok?e.status===204?e.text().then(()=>({isSuccess:!0,data:null,errorMessage:null,httpStatusCode:e.status,xVwoCampaigns:n})):r?Promise.resolve({isSuccess:!0,data:null,errorMessage:null,httpStatusCode:e.status,xVwoCampaigns:n}):e.json().then(o=>({isSuccess:!0,data:o.data,errorMessage:null,httpStatusCode:e.status,xVwoCampaigns:n})):e.json().then(o=>({isSuccess:!1,data:null,errorMessage:o.errorMessage,httpStatusCode:e.status,xVwoCampaigns:n}))}handleError(e){var r;return e.name==="AbortError"?{isSuccess:!1,data:null,errorMessage:"Request was cancelled",httpStatusCode:499}:{isSuccess:!1,data:null,errorMessage:e.message,httpStatusCode:((r=e.response)==null?void 0:r.status)||-1}}get(e,r,n=!1,o){return a(this,null,function*(){try{let s=this.buildUrl(e),i=yield fetch(s,f({headers:r!=null?r:{}},o&&{signal:o}));return this.handleResponse(i,n)}catch(s){return this.handleError(s)}})}post(e,r,n,o){return a(this,null,function*(){try{let s=this.buildUrl(e),i=yield fetch(s,f({method:"POST",headers:G(f({},n),{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}),body:JSON.stringify(r)},o&&{signal:o}));return this.handleResponse(i)}catch(s){return this.handleError(s)}})}put(e,r){return a(this,null,function*(){try{let n=this.buildUrl(e),o=yield fetch(n,{method:"PUT",headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"},body:JSON.stringify(r)});return this.handleResponse(o)}catch(n){return this.handleError(n)}})}delete(e){return a(this,null,function*(){try{let r=this.buildUrl(e),n=yield fetch(r,{method:"DELETE",headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}});return this.handleResponse(n)}catch(r){return this.handleError(r)}})}};var L=(t,e)=>{try{we(t,e)}catch(r){console.error("Error setting tag in Sentry",r)}},E=(t,e)=>{try{Te(t,e)}catch(r){console.error("Error sending exception to Sentry",r)}};var Ae=class{constructor(e){this.customDimensionPrefix="cd";this.trackerKey="tid";this.clientIdKey="sid";this.titleKey="ti";this.shippingCountryKey="co";this.envKey="e";this.hcKey="hc";this.logKey="log";this.merchantKey="m";this.cdnUrlKey="cdu";this.pixelResKey="f";this.domainRefererKey="dr";this.dimensionsKey="dims";this.tKey="t";this.categoryKey="c";this.actionKey="a";this.labelKey="l";this.pathKey="p";this.jsonKey="j";this.browserLanguageKey="ul";this.screenResolutionKey="sr";this.userAgentKey="uafvl";this.checkoutServiceUrl="https://checkout-service-qa.bglobale.com/api/v1/";this.gaUrl=e.url,this.data=e}init(){}sendBrowsingEvent(o,s){return a(this,arguments,function*(e,r,n=1){r.size===0&&(r=new Map);try{r.set(this.tKey,"Browsing Start"),r.set(this.pathKey,encodeURIComponent(e.urlPath)),r.set(this.browserLanguageKey,encodeURIComponent(e.language)),r.set(this.screenResolutionKey,encodeURIComponent(e.screenResolution)),r.set(this.userAgentKey,encodeURIComponent(e.userAgent)),yield this.buildBrowsingUrl(r)}catch(i){E(i,{data:"Error sending event"})}})}sendEvent(o,s){return a(this,arguments,function*(e,r,n=1){r.size===0&&(r=new Map);try{r.set(this.tKey,"ev"),r.set(this.categoryKey,encodeURIComponent(e.category)),r.set(this.actionKey,encodeURIComponent(e.action)),r.set(this.labelKey,encodeURIComponent(e.label)),e.json&&r.set(this.jsonKey,encodeURIComponent(JSON.stringify(e.json))),yield this.buildUrlByTrackers(r)}catch(i){E(i,{data:"Error sending event"})}})}buildUrlByTrackers(e){return a(this,null,function*(){let r=Array.from(this.data.measurementIds);for(let n of r){let o="",s=n[0];o=yield this.buildUrlWithParams(s,e,o),new N(this.gaUrl).get(`/collectCheckout${o}`,void 0,!0).then(c=>{}).catch(c=>{E("Analytics Error in .get(`/collectCheckout) for url: "+o),E(c)})}})}buildBrowsingUrl(e){return a(this,null,function*(){let r="";r=yield this.buildUrlWithParams(null,e,r),new N(this.gaUrl).get(`/set${r}`,void 0,!0).then(o=>{}).catch(o=>{E("Analytics Error in .get(`/set) for url: "+r),E(o)})})}identify(e,r){}sendPageView(e,r){return a(this,null,function*(){r.size===0&&(r=new Map),r.set(this.tKey,"pv"),r.set(this.pathKey,encodeURIComponent(e.path)),yield this.buildUrlByTrackers(r)})}buildCustomDimensions(){let e=[];for(let[r,n]of Object.entries(this.data.dimensions)){let o=this.customDimensionPrefix+r,s=encodeURIComponent(n.toString()),i={[o]:s};e.push(i)}return JSON.stringify(e)}buildUrlWithParams(o,s){return a(this,arguments,function*(e,r,n=this.gaUrl){var c,l,u,g,p;let i=this.buildCustomDimensions();return e&&(n=this.addQueryParam(this.trackerKey,this.data.measurementIds.get(e),n)),n=this.addQueryParam(this.clientIdKey,this.data.clientId,n),n=this.addQueryParam(this.titleKey,encodeURIComponent(this.data.title),n),n=this.addQueryParam(this.shippingCountryKey,(l=(c=this.data.shippingCountry)!=null?c:this.data.billingCountry)!=null?l:"",n),n=this.addQueryParam(this.envKey,this.data.cdnUrl?this.data.cdnUrl.toLowerCase().indexOf("dev.")>-1?"live":"local":"",n),n=this.addQueryParam(this.hcKey,"0",n),n=this.addQueryParam(this.logKey,"false",n),n=this.addQueryParam(this.merchantKey,(g=(u=this.data.merchantId)==null?void 0:u.toString())!=null?g:"",n),n=this.addQueryParam(this.cdnUrlKey,(p=this.data.cdnUrl)!=null?p:"empty_cdu",n),n=this.addQueryParam(this.pixelResKey,"gleTags.handlePixelResponse",n),n=this.addQueryParam(this.domainRefererKey,this.data.domainReferer,n),n=this.addQueryParam(this.dimensionsKey,i,n),Array.from(r).forEach(y=>{n=this.addQueryParam(y[0],y[1],n)}),n})}addQueryParam(e,r,n){let o=n.indexOf("?")!=-1?"&":"?";return n=n+o+e+"="+r,n}};function D(t,e,r){if(t&&t.has(e)){let n=t.get(e);return typeof n=="string"&&typeof r=="number"?Number(n):n}else return r}var fe=class t{constructor(){this.merchantId=0;this.cdnUrl="";this.domainReferer="";this.title="";this.dimensions=new Array}adapt(e,r=new Map){let n=new t;if(e&&e!==null){n.userData=e.userData,n.url=e.gaUrl,n.measurementIds=new Map;let o=D(r,"browsingClientId","");o||(o=D(r,"clientId","")),n.clientId=o,e.checkoutTrackerId&&n.measurementIds.set(1,e.checkoutTrackerId),e.browsingTrackerId&&n.measurementIds.set(2,e.browsingTrackerId),n.merchantId=D(r,"merchantId",0),n.environment=D(r,"environment","0"),n.billingCountry=D(r,"billingCountry","0"),n.shippingCountry=D(r,"shippingCountry","0"),n.shippingStateCode=D(r,"shippingStateCode","0"),n.cultureCode=D(r,"cultureCode","0"),n.amount=D(r,"amount","0"),n.webStoreCode=D(r,"webStoreCode","0"),n.applePay=D(r,"applePay","0"),n.siteId=D(r,"siteId","0"),n.isTokenEnabled=D(r,"isTokenEnabled","0"),n.status=D(r,"status",""),n.isOperatedCountry=D(r,"isOperatedCountry","0"),n.cdnUrl=e.cdnUrl,n.dimensions=e.dimensions,n.domainReferer=e.domainReferer,n.title=D(r,"title","")}return n}};var re=class{constructor(e,r,n=new Map){this.enabledAnalyticTypes=new Array;this._instances={};this.googleAnalyticsData=new fe;this.props=new Map;this.geData=new fe;this.data=e,this.props=n,this.enabledAnalyticTypes=r,this.initAll()}initAll(){var e;(e=this.enabledAnalyticTypes)==null||e.forEach(r=>{switch(r){case 1:this.geData=this.googleAnalyticsData.adapt(this.data,this.props),this._instances[1]=new Ae(this.geData),this._instances[1].init();break;case 2:break;case 3:break;default:break}})}isEnabled(e){return this.enabledAnalyticTypes.includes(e)}sendEvent(o,s){return a(this,arguments,function*(e,r,n=new Map){this.isEnabled(e)&&(yield this._instances[e].sendEvent(r,n))})}sendBrowsingEvent(o,s){return a(this,arguments,function*(e,r,n=new Map){this.isEnabled(e)&&(yield this._instances[e].sendBrowsingEvent(r,n))})}sendPageView(o,s){return a(this,arguments,function*(e,r,n=new Map){this.isEnabled(e)&&(yield this._instances[e].sendPageView(r,n))})}};var ne=class{};var W=class{constructor(e){this.name=e}};var oe=class extends W{constructor(e,r,n,o,s){super(e),this.category=r,this.action=n,this.label=o,this.json=s}};var x=t=>String(t).toLowerCase()==="true";var wt="GEMPFCS";function xe(t,e,r,n=!1){return a(this,null,function*(){let o=yield t.cookie.get(e);if(o)try{let i=Fr(o);return i&&i.sid&&i.expiry?i.sid:o}catch(i){E(i)}return yield Nr(t,e,r,n)})}function Nr(t,e,r,n=!1){return a(this,null,function*(){try{let o=new Date,s={sid:Gr(r),expiry:new Date(o.getTime()+30*6e4).toISOString()};return n||(yield t.cookie.set(e,JSON.stringify(s))),s.sid}catch(o){return E(o),""}})}function Fr(t){try{let e=JSON.parse(t);if(e&&typeof e=="object"&&"sid"in e)return e}catch(e){E(e)}return null}function Gr(t){let e=function(c,l){return Math.floor(Math.random()*(l-c+1)+c)},o=e(1e8,999999999),s=e(1e8,999999999);return o+"."+s+"."+t}function ie(S,I,A,$,O,b,R,m){return a(this,arguments,function*(t,e,r,n,o,s,i,c,l=new Map,u,g,p=new Map,y,_,d){var de;if(!n||!o)return{initData:t,instance:e};let T=new N(n),h=`/Shopify/analytics/${r}/${o}/${s}?checkoutId=${i}&clientId=${c}`;p&&p.forEach((B,Oe)=>h+=`&${Oe}=${B}`),y&&(h+=`&sdkClientId=${y}`),_&&(h+=`&sdkSessionId=${_}`),d&&d.forEach((B,Oe)=>h+=`&${Oe}=${B}`);let v=yield T.get(h).then(B=>B).catch(B=>{L("GEAnaliticsURL",h),E(B,{data:"Analytic Error C1 GetConfiguration"})}),M=(de=v==null?void 0:v.data)!=null?de:null,U=new re(M,[r],l);return u(M),g(U),{initData:M,instance:U}})}function se(t,e,r,n,o,s){return a(this,null,function*(){let i=new Map;i.set("clientId",e.clientId),i.set("browsingClientId",r),i.set("merchantId",n.toString()),Br(i,e,o,s),i.set("webStoreCode",""),i.set("applePay",""),i.set("siteId",""),i.set("isTokenEnabled",""),i.set("status",""),i.set("isOperatedCountry",""),i.set("title",e.context.document.title);try{let c=yield t.sessionStorage.getItem("VWO_VARIATION");if(c){let l=JSON.parse(c);l.campaignKey&&i.set("vwoCampaignKey",l.campaignKey),l.variation&&i.set("vwoVariation",l.variation)}}catch(c){}return i})}function Br(t,e,r,n){var s;let o=e.data;o||(o=e.customData),r((s=o.checkout.shippingAddress.countryCode)!=null?s:o.checkout.billingAddress.countryCode),n(o.checkout.token),t.set("billingCountry",o.checkout.billingAddress.countryCode),t.set("shippingCountry",o.checkout.shippingAddress.countryCode),t.set("shippingStateCode",""),t.set("amount",o.checkout.totalPrice.amount)}function Ce(t){return a(this,null,function*(){let e=yield t.sessionStorage.getItem(wt);return e===null||e==="1"})}function At(t){return a(this,null,function*(){return yield t.sessionStorage.setItem(wt,"0"),!0})}function ae(t,e){return a(this,null,function*(){let r=new Map,n="GE_UTM_PARAMS",o=null;try{let s=yield t.localStorage.getItem(n);if(s){let i=JSON.parse(s);i&&typeof i.value=="string"&&Vr(i)&&(o=i.value)}}catch(s){E(s)}if(!o)try{o=yield t.sessionStorage.getItem(n)}catch(s){E(s)}if(o)try{let s=o.split("&").reduce((l,u)=>{let[g,p]=u.split("=");return l[g]=p,l},{});r.set("utmSource",s.utm_source),r.set("utmMedium",s.utm_medium),r.set("utmCampaign",s.utm_campaign);let i=s.bf_direct_to_checkout,c=s.bf_direct_to_checkout_enabled;i&&r.set("bfDirectToCheckout",i),c&&r.set("bfDirectToCheckoutEnabled",c)}catch(s){E(s)}return yield Kr(t,r),x(e==null?void 0:e.BfGoogleAdsEnabled)&&(yield jr(t,r)),r})}function Se(t,e){return a(this,null,function*(){if(!t)return null;let r=new Map;try{let n=yield t.sessionStorage.getItem("VWO_VARIATION");if(!n)return null;let o=JSON.parse(n);return o.campaignKey&&r.set("CampaignName",o.campaignKey),o.variation&&r.set("Variation",o.variation),e&&r.set("CheckoutId",e),r}catch(n){return E(n),null}})}function ce(t,e){return a(this,null,function*(){let r=new Map;if(t!=null&&t.has("utmSource")&&r.set("cs",t.get("utmSource")),t!=null&&t.has("utmMedium")&&r.set("cm",t.get("utmMedium")),t!=null&&t.has("utmCampaign")&&r.set("cn",t.get("utmCampaign")),t!=null&&t.has("GEflid")&&r.set("GEflid",t.get("GEflid")),t!=null&&t.has("GEfp")&&r.set("GEfp",t.get("GEfp")),t!=null&&t.has("bfDirectToCheckout")||t!=null&&t.has("bfDirectToCheckoutEnabled")){let n={borderfreeProperties:{[st]:t.get("bfDirectToCheckout"),[at]:t.get("bfDirectToCheckoutEnabled")}};r.set("j",JSON.stringify(n))}return t!=null&&t.has("gclid")&&r.set("gclid",t.get("gclid")),r})}function ue(t,e,r){return a(this,null,function*(){let n=yield Se(e,r),o=n?Object.fromEntries(n):{};if(Object.keys(o).length>0)if(t.has("j"))try{let s=JSON.parse(t.get("j")),i=f(f({},s),o);t.set("j",JSON.stringify(i))}catch(s){}else t.set("j",JSON.stringify(o))})}function le(t,e,r){return a(this,null,function*(){yield t.sessionStorage.setItem(e,r)})}function xt(t,e){return a(this,null,function*(){return(yield t.sessionStorage.getItem(e))==="true"})}function Kr(t,e){return a(this,null,function*(){try{let r=yield t.sessionStorage.getItem(pe);if(r){let n=JSON.parse(r);n.GEflid&&e.set("GEflid",n.GEflid),n.GEfp&&e.set("GEfp",n.GEfp)}}catch(r){E(r)}})}function jr(t,e){return a(this,null,function*(){let r="bfgclid";try{let n=yield t.localStorage.getItem(rt);if(n){let o=JSON.parse(n);o[r]?e.set("gclid",o[r]):o.gclid&&e.set("gclid",o.gclid)}}catch(n){E(n)}})}function Vr(t){if(!t||typeof t!="object")return!1;let e=new Date(t.expiry).getTime(),r=new Date().getTime();return!isNaN(e)&&rp).catch(p=>{L("GESaveForterToken",l),E(p,{data:"Analytic Error C1 SaveForterToken"})}),[g]=yield Promise.all([self.fetch(Hr,s).then(()=>!0).catch(p=>(E(p),!1)),u]);g||(yield self.fetch(Yr,s))})}var vt=(t,e,r,n,o,s,i,c,l,u,g)=>a(null,null,function*(){var y;let p=self.debug?"TEST ATTEMPT ID":(y=t==null?void 0:t.customData)==null?void 0:y.PaymentAttemptId.toString();p||E("Attempt ID not found");try{yield bt(Dt(e,r,Date.now(),n,o,s,i,p),n,c,l),u(null)}catch(_){E(_),g(_)}});var qr="started",kt=(t,e,r,n,o,s,i,c,l,u,g,p,y,_)=>a(null,null,function*(){let d=t.customData.checkout.isMerchantOperatedByGE;if(yield le(e,n,d),(yield Ce(e))&&d){let S="",I="",O=yield se(e,t,u,l,T=>{L("countryCode",T),I=T},T=>{L("checkoutId",T),S=T}),b=yield ae(e,r),R=yield Se(e,S),m=yield ce(b,e);yield ue(m,e,S),o.forEach(T=>a(null,null,function*(){let h=yield ie(s,i,T,c,l,I,S,u,O,g,p,b,y,_,R);h.initData&&(yield At(e)),g(h.initData),p(h.instance);let C=new oe("checkout_started",be,qr,"checkout_started");yield h.instance.sendEvent(T,C,m)}))}});var Jr="completed",z=(t,e,r,n,o,s,i,c,l,u,g,p,y,_,d,S)=>a(null,null,function*(){if(yield xt(n,s)){let A="",$="",R=yield se(n,t,p,g,C=>{L("countryCode",C),$=C},C=>{L("checkoutId",C),A=C}),m=yield ae(n,o),T=yield Se(n,A),h=yield ce(m,n);yield ue(h,n,A),i.forEach(C=>a(null,null,function*(){var U;let v=yield ie(c,l,C,u,g,$,A,p,R,y,_,m,d,S,T);y(v.initData),_(v.instance);let M=new oe(e,be,Jr,r,(U=t.customData)==null?void 0:U.payload);yield v.instance.sendEvent(C,M,h)}))}});var Rt=(t,e)=>{try{let r=t.context.document.location.search;r.includes("utm_")&&e.sessionStorage.setItem(tt,r)}catch(r){}};function Ot(t,e){return a(this,null,function*(){try{if(yield e.sessionStorage.getItem(pe))return;let{flid:n,fp:o}=yield $r(t,e);(n||o)&&Wr(n,o,e)}catch(r){console.error("Error in Facebook tracking:",r)}})}function $r(t,e){return a(this,null,function*(){let r=new URLSearchParams(t.context.document.location.search),n=r.get(ge.FLID.urlParam),o=r.get(ge.FP.urlParam);if(!n){let s=yield e.cookie.get(ge.FLID.cookieName);s&&(n=s)}if(!o){let s=yield e.cookie.get(ge.FP.cookieName);s&&(o=s)}return{flid:n,fp:o}})}function Wr(t,e,r){let n={};t&&(n.GEflid=t),e&&(n.GEfp=e),Object.keys(n).length>0&&r.sessionStorage.setItem(pe,JSON.stringify(n))}var k=[];for(let t=0;t<256;++t)k.push((t+256).toString(16).slice(1));function zr(t,e=0){return(k[t[e+0]]+k[t[e+1]]+k[t[e+2]]+k[t[e+3]]+"-"+k[t[e+4]]+k[t[e+5]]+"-"+k[t[e+6]]+k[t[e+7]]+"-"+k[t[e+8]]+k[t[e+9]]+"-"+k[t[e+10]]+k[t[e+11]]+k[t[e+12]]+k[t[e+13]]+k[t[e+14]]+k[t[e+15]]).toLowerCase()}var Je,Qr=new Uint8Array(16);function Xr(){if(!Je){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Je=crypto.getRandomValues.bind(crypto)}return Je(Qr)}var Zr=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Mt={randomUUID:Zr};function en(t,e,r){if(Mt.randomUUID&&!e&&!t)return Mt.randomUUID();t=t||{};let n=t.random||(t.rng||Xr)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(let o=0;o<16;++o)e[r+o]=n[o];return e}return zr(n)}var tn=en;function Pt(){return tn()}var ye=class{constructor(t,e,r,n,o,s,i,c){this.eventName=t,this.timestamp=e,this.clientId=r,this.sessionId=n,this.merchantId=o,this.shopperCountryCode=s,this.category=i,this.cdn=c,this.isSdk=!0}},rn=class extends ye{constructor(t,e,r,n,o,s,i,c,l,u,g,p,y,_,d,S,I){super("Page View",t,e,r,n,o,s,i),this.timestamp=t,this.clientId=e,this.sessionId=r,this.merchantId=n,this.shopperCountryCode=o,this.category=s,this.cdn=i,this.pageUrl=c,this.pageTitle=l,this.screenResolution=u,this.userAgent=g,this.referrer=p,this.utmSource=y,this.utmMedium=_,this.utmCampaign=d,this.utmTerm=S,this.utmContent=I}},nn=class extends ye{constructor(t,e,r,n,o,s,i,c,l,u,g,p,y,_,d,S,I){super("Browsing Start",t,e,r,n,o,s,i),this.timestamp=t,this.clientId=e,this.sessionId=r,this.merchantId=n,this.shopperCountryCode=o,this.category=s,this.cdn=i,this.pageUrl=c,this.pageTitle=l,this.screenResolution=u,this.userAgent=g,this.referrer=p,this.utmSource=y,this.utmMedium=_,this.utmCampaign=d,this.utmTerm=S,this.utmContent=I}},$e=class extends Error{constructor(t){super(`The "${t}" is not supported.`)}};function w(t){return{toBeDefined(e){if(t==null||typeof t=="string"&&t.trim()==="")throw new Error(e!=null?e:"The value is not defined.");return t},toThrowNotSupported(e){throw new $e(e)}}}var on=new Set(["com","org","net","edu","gov","uk","co.uk","org.uk","gov.uk","ac.uk","au","com.au","net.au","org.au","co.nz","com.sg","com.br","jp","co.jp","ne.jp","or.jp","go.jp","de","fr","us","ca","cn","com.cn","net.cn","org.cn","co.kr","or.kr","go.kr","in","co.in","net.in","org.in","firm.in","gen.in","ind.in"]);function Lt(t){let e=t.split(".").filter(Boolean);if(e.length<2)return t;let r=e.slice(-2).join("."),n=e.slice(-3).join(".");return on.has(r)&&e.length>=3?`.${n}`:`.${r}`}var sn=class{constructor(t){this.window=w(t).toBeDefined("The window object is required to construct DefaultBrowserAccessor."),this.sessionStorageAsyncWrapper={getItem:e=>Promise.resolve(this.window.sessionStorage.getItem(e)),setItem:(e,r)=>Promise.resolve(this.window.sessionStorage.setItem(e,r)),removeItem:e=>Promise.resolve(this.window.sessionStorage.removeItem(e))},this.localStorageAsyncWrapper={getItem:e=>Promise.resolve(this.window.localStorage.getItem(e)),setItem:(e,r)=>Promise.resolve(this.window.localStorage.setItem(e,r)),removeItem:e=>Promise.resolve(this.window.localStorage.removeItem(e))},this.cookieStorageAsyncWrapper={getItem:e=>{let r=e+"=",n=this.window.document.cookie.split(";").map(o=>o.trim()).find(o=>o.startsWith(r));return Promise.resolve(n?n.substring(r.length):null)},setItem:(e,r)=>{this.window.document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=.${this.window.document.domain}`;let n=Lt(this.window.location.hostname),o=new Date(Date.now()+2*365*24*60*60*1e3).toUTCString();return this.window.document.cookie=`${e}=${encodeURIComponent(r)}; expires=${o}; path=/; domain=${n}`,Promise.resolve()},removeItem:e=>{let r=Lt(this.window.location.hostname);return this.window.document.cookie=`${e}=;expires=Thu, 01 Jan 1970 00:00:00 UTC;path=/;domain=${r}`,Promise.resolve()}}}getPageUrl(){return this.window.location.href}getPageTitle(){return this.window.document.title}getScreenResolution(){return`${this.window.screen.width}x${this.window.screen.height}`}getUserAgent(){return this.window.navigator.userAgent}getReferrer(){return this.window.document.referrer}get sessionStorage(){return this.sessionStorageAsyncWrapper}get localStorage(){return this.localStorageAsyncWrapper}get cookieStorage(){return this.cookieStorageAsyncWrapper}createTrackingPixel(t){let e=this.window.document.createElement("img");e.width=1,e.height=1,e.src=t}createIFrame(t,e,r,n){let o=this.window.document.getElementById(e.attributes.id);o||(o=this.window.document.createElement("iframe"),o.setAttribute("id",e.attributes.id),o.setAttribute("title",e.attributes.title),o.setAttribute("width",e.attributes.width),o.setAttribute("height",e.attributes.height),o.style.display="none",this.window.document.getElementsByTagName("body")[0].appendChild(o)),o.setAttribute("src",t)}},an=class{constructor(t,e,r){this._sessionStorage=w(t).toBeDefined(),this._localStorage=w(e).toBeDefined(),this._cookieStorage=w(r).toBeDefined()}getPageUrl(){}getPageTitle(){}getScreenResolution(){}getUserAgent(){}getReferrer(){}get sessionStorage(){return this._sessionStorage}get localStorage(){return this._localStorage}get cookieStorage(){return this._cookieStorage}createTrackingPixel(t){}createIFrame(t,e,r,n){}},F="GlobalE_Analytics_UTMs",Ut="utm_source",Nt="utm_medium",Ft="utm_campaign",Gt="utm_term",Bt="utm_content",cn=class{constructor(t,e,r){var n,o,s;this.browser=w(t).toBeDefined("The IBrowserAccessor implementation is required to construct UtmHandler."),this.logger=w(e).toBeDefined("The ILogger implementation is required to construct UtmHandler."),this.FT_3DA=(n=r==null?void 0:r.FT_3DA)!=null?n:!0,this.FT_3DA_UTM_SOURCE_LIST=(o=r==null?void 0:r.FT_3DA_UTM_SOURCE_LIST)!=null?o:["borderfree"],this.FT_3DA_STORAGE_LIFETIME=(s=r==null?void 0:r.FT_3DA_STORAGE_LIFETIME)!=null?s:4320}handle(t){return a(this,null,function*(){let e=this.getUtmParams(t),r=yield this.selectStorageStrategy().execute(e);this.utmSource=r.utmSource,this.utmMedium=r.utmMedium,this.utmCampaign=r.utmCampaign,this.utmTerm=r.utmTerm,this.utmContent=r.utmContent})}getUtmParams(t){var p,y,_;let e="direct",r="(none)",n="(not-set)";try{if(o(t))return i(t);if(s(t))return t;let d=new URL(this.browser.getPageUrl());return{utmSource:(p=d.searchParams.get(Ut))!=null?p:l(this.browser),utmMedium:(y=d.searchParams.get(Nt))!=null?y:u(this.browser),utmCampaign:(_=d.searchParams.get(Ft))!=null?_:g(),utmTerm:d.searchParams.get(Gt),utmContent:d.searchParams.get(Bt)}}catch(d){return this.logger.writeErrorLog({method:"UtmHandler::getUtmParams()",message:d.message,errorMessage:d.message,errorStackTrace:d.stackTrace}),{utmSource:e,utmMedium:r,utmCampaign:n,utmTerm:null,utmContent:null}}function o(d){return typeof d=="string"}function s(d){return typeof d=="object"&&d!==null&&"utmSource"in d&&"utmMedium"in d&&"utmCampaign"in d&&typeof d.utmSource=="string"&&typeof d.utmMedium=="string"&&typeof d.utmCampaign=="string"}function i(d){let S=new URLSearchParams(d);return{utmSource:S.get(Ut),utmMedium:S.get(Nt),utmCampaign:S.get(Ft),utmTerm:S.get(Gt),utmContent:S.get(Bt)}}function c(d){return d}function l(d){let S=d.getReferrer();return S?S.includes("google")?"google":S.includes("borderfree")?"borderfree":S:e}function u(d){let S=d.getReferrer();return S?S.includes("google")?"organic":"referral":r}function g(){return n}}selectStorageStrategy(){return this.FT_3DA?new un(this.browser,this.FT_3DA_UTM_SOURCE_LIST,this.FT_3DA_STORAGE_LIFETIME):new ln(this.browser)}},un=class{constructor(t,e,r){this.browser=w(t).toBeDefined("The IBrowserAccessor implementation is required to construct DefaultStorageStrategy."),this.FT_3DA_UTM_SOURCE_LIST=e,this.FT_3DA_STORAGE_LIFETIME=r}execute(t){return a(this,null,function*(){let e=Date.now(),r=this.FT_3DA_UTM_SOURCE_LIST.includes(t.utmSource),n=yield this.browser.localStorage.getItem(F);if(n)try{let o=JSON.parse(n);if(o.expiry&&ethis.logsLimit&&this.logs.shift(),Promise.resolve()}catch(r){}})}writeDebugLog(t){return a(this,null,function*(){return this.writeLog(t,1)})}writeVerboseLog(t){return a(this,null,function*(){return this.writeLog(t,2)})}writeInfoLog(t){return a(this,null,function*(){return this.writeLog(t,3)})}writeWarningLog(t){return a(this,null,function*(){return this.writeLog(t,4)})}writeErrorLog(t){return a(this,null,function*(){return this.writeLog(t,5)})}writeCriticalLog(t){return a(this,null,function*(){return this.writeLog(t,6)})}},mn=class{constructor(t){this.debugOnly=t!=null?t:!1}writeLog(t,e=3){return a(this,null,function*(){try{if(this.debugOnly)console.debug(t);else switch(e){case 1:console.debug(t);break;case 2:console.trace(t);break;case 3:console.info(t);break;case 4:console.warn(t);break;case 5:console.error(t);break;case 6:console.error(t);break;default:break}return Promise.resolve()}catch(r){}})}writeDebugLog(t){return a(this,null,function*(){return this.writeLog(t,1)})}writeVerboseLog(t){return a(this,null,function*(){return this.writeLog(t,2)})}writeInfoLog(t){return a(this,null,function*(){return this.writeLog(t,3)})}writeWarningLog(t){return a(this,null,function*(){return this.writeLog(t,4)})}writeErrorLog(t){return a(this,null,function*(){return this.writeLog(t,5)})}writeCriticalLog(t){return a(this,null,function*(){return this.writeLog(t,6)})}},hn=class extends ye{constructor(t,e,r,n,o,s,i,c,l,u,g,p,y,_){super("Checkout Start",t,e,r,n,o,s,i),this.timestamp=t,this.clientId=e,this.sessionId=r,this.merchantId=n,this.shopperCountryCode=o,this.category=s,this.cdn=i,this.checkoutToken=c,this.userAgent=l,this.utmSource=u,this.utmMedium=g,this.utmCampaign=p,this.utmTerm=y,this.utmContent=_}},fn=class extends ye{constructor(t,e,r,n,o,s,i,c,l,u,g,p,y,_,d,S){super(t,e,r,n,o,s,i,c),this.eventName=t,this.timestamp=e,this.clientId=r,this.sessionId=n,this.merchantId=o,this.shopperCountryCode=s,this.category=i,this.cdn=c,this.checkoutToken=l,this.userAgent=u,this.utmSource=g,this.utmMedium=p,this.utmCampaign=y,this.utmTerm=_,this.utmContent=d,this.data=S}},Sn=class extends ye{constructor(t,e,r,n,o,s,i,c,l,u,g,p,y,_,d,S,I,A,$){super(t,e,r,n,o,s,i,c),this.eventName=t,this.timestamp=e,this.clientId=r,this.sessionId=n,this.merchantId=o,this.shopperCountryCode=s,this.category=i,this.cdn=c,this.pageUrl=l,this.pageTitle=u,this.screenResolution=g,this.userAgent=p,this.referrer=y,this.utmSource=_,this.utmMedium=d,this.utmCampaign=S,this.utmTerm=I,this.utmContent=A,this.data=$}},yn=class{constructor(t,e){this.cdn=w(t).toBeDefined("The CDN is required to initialize ShopifyFetchEventSender."),this.http=w(e).toBeDefined("The IHttp implementation is required to initialize ShopifyFetchEventSender")}send(t){let e=new URL("/client",this.cdn);for(let r in t){let n=t[r];n!=null&&(n&&typeof n=="object"&&(n=JSON.stringify(n)),e.searchParams.append(Yt.map(r),n))}return this.http.get(e.toString())}},En=class{constructor(t,e){this.browser=t,this.logger=e}saveData(t,e){return a(this,null,function*(){var r;try{let n=JSON.stringify(e);yield Promise.all([this.browser.localStorage.setItem(t,n),this.browser.cookieStorage.setItem(t,n)])}catch(n){throw(r=this.logger)==null||r.writeErrorLog({method:"DataStorageManager::saveData()",message:n.message,errorMessage:n.stack||n.message}),new Error(`Failed to save data: ${n.message}`)}})}loadData(t){return a(this,null,function*(){var n,o;let e=null,r=null;try{let s=yield this.browser.cookieStorage.getItem(t);if(s){let i=decodeURIComponent(s);e=JSON.parse(i)}}catch(s){(n=this.logger)==null||n.writeWarningLog({method:"DataStorageManager::loadData()",message:"Failed to parse cookie data.",errorMessage:s.message})}try{let s=yield this.browser.localStorage.getItem(t);s&&(r=JSON.parse(s))}catch(s){(o=this.logger)==null||o.writeWarningLog({method:"DataStorageManager::loadData()",message:"Failed to parse localStorage data.",errorMessage:s.message})}return this.getFreshestValidSnapshot(e,r)})}clearData(t){return a(this,null,function*(){var e;try{yield Promise.all([this.browser.localStorage.removeItem(t),this.browser.cookieStorage.removeItem(t)])}catch(r){throw(e=this.logger)==null||e.writeErrorLog({method:"DataStorageManager::clearData()",message:"Failed to clear data.",errorMessage:r.message}),new Error(`Failed to clear data: ${r.message}`)}})}getFreshestValidSnapshot(t,e){if(t&&e){let r=t==null?void 0:t.dataUpdatedAt,n=e==null?void 0:e.dataUpdatedAt;if(r&&n)return r>n?t:e}return t!=null?t:e}},Q="GlobalE_Analytics_GoogleAds",jt="gclid",Vt="bfgclid",_n=class{get googleClickId(){return this.isBorderfreeGoogleClickId?this.bfgclid:this.gclid}get isBorderfreeGoogleClickId(){return this.bfIsEnabled&&this.bfgclid}constructor(t,e,r){var n,o;this.browser=w(t).toBeDefined("The IBrowserAccessor implementation is required to construct GoogleAdsHandler."),this.logger=w(e).toBeDefined("The ILogger implementation is required to construct GoogleAdsHandler."),this.bfIsEnabled=(n=r==null?void 0:r.bfGoogleAdsEnabled)!=null?n:!0,this.bfLifetimeInDays=(o=r==null?void 0:r.bfGoogleAdsLifetimeInDays)!=null?o:30}handle(t){return a(this,null,function*(){let e=this.parseUrl(t),r=yield this.selectStorageStrategy().execute(e);this.gclid=r.gclid,this.bfgclid=r.bfgclid})}parseUrl(t){let e={gclid:null,bfgclid:null};try{if(r(t))return n(t);if(o(t))return t;let i=new URL(this.browser.getPageUrl());e.gclid=i.searchParams.get(jt),e.bfgclid=i.searchParams.get(Vt)}catch(i){this.logger.writeErrorLog({method:"GoogleAdsHandler::parseUrl()",message:i.message,errorMessage:i.message,errorStackTrace:i.stackTrace})}return e;function r(i){return typeof i=="string"}function n(i){let c=new URLSearchParams(i);return{gclid:c.get(jt),bfgclid:c.get(Vt)}}function o(i){return typeof i=="object"&&i!==null&&"gclid"in i&&"bfgclid"in i&&typeof i.gclid=="string"&&typeof i.bfgclid=="string"}function s(i){return i}}selectStorageStrategy(){return this.bfIsEnabled?new Tn(this.browser,this.bfLifetimeInDays):new In(this.browser)}},In=class{constructor(t){this.browser=w(t).toBeDefined("The IBrowserAccessor implementation is required to construct DefaultStorageStrategy.")}execute(t){return a(this,null,function*(){try{if(t.gclid){let e={gclid:t.gclid,expiry:Date.now()+2592e6},r=JSON.stringify(e);return yield this.browser.localStorage.setItem(Q,r),{gclid:e.gclid,bfgclid:null}}else{let e=yield this.browser.localStorage.getItem(Q),r=JSON.parse(e);return r!=null&&r.expiry&&r.expiry0;){let t=this.eventQueue.pop();if(t&&t.arguments){let e=Array.prototype.slice.call(t.arguments);this[t.functionName](...e)}else this.logger.writeInfoLog("Arguments are undefined or missing for this event")}}init(t,e,r){return a(this,null,function*(){this.merchantId=w(t).toBeDefined("The merchantId is required to load configuration."),this.shopperCountryCode=w(e).toBeDefined("The shopper country is required to load configuration."),this.cdn=w(r==null?void 0:r.cdn).toBeDefined("The CDN currently is required to load configuration. (should be changed in 2025 Q1)"),this.defineBrowserAccessor(r),this.defineLogger(r),this.defineEventSender(r),this.defineDataStorageManager(),yield this.loadConfigurationSnapshot(),(!this.isConfigurationLoaded||this.shopperCountryCode!==e)&&(this.setShopperCountryCode(e),yield this.loadConfigurationFromServer()),this.defineUtmParametersHandler(),this.defineGoogleAdsHandler(),this.setClientId(r.clientId),this.setSessionId(r.sessionId),this.userAgent=this.browser.getUserAgent(),this.screenResolution=this.browser.getScreenResolution(),yield this.utms.handle(r.utms),yield this.googleAds.handle(r.googleAds),yield this.saveConfigurationSnapshot(),this.isInitialized=!0,this.queueEventDequeue()})}setMerchantCountryCode(t){return a(this,null,function*(){this.shopperCountryCode=w(t).toBeDefined("The shopperCountryCode is required to setup Analytics SDK."),yield this.saveConfigurationSnapshot()})}setDataLayer(t){return a(this,null,function*(){this.dataLayer=t,yield this.saveConfigurationSnapshot()})}sendBrowsingStartEvent(){return a(this,arguments,function*(){try{if(!this.isInitialized){this.queueEventSending(this.sendBrowsingStartEvent.name,arguments);return}let t=Date.now();if(yield this.updateSession(t),this.sessionId===this.lockBrowsingStartOnSessionId)return!1;this.lockBrowsingStartOnSessionId=this.sessionId,yield this.saveConfigurationSnapshot();let e=new nn(t,this.clientId,this.sessionId,this.merchantId,this.shopperCountryCode,"Browsing Funnel",this.cdn,this.browser.getPageUrl(),this.browser.getPageTitle(),this.screenResolution,this.userAgent,this.browser.getReferrer(),this.utms.utmSource,this.utms.utmMedium,this.utms.utmCampaign,this.utms.utmTerm,this.utms.utmContent);return yield this.eventSender.send(e),!0}catch(t){this.logger.writeErrorLog({method:"AnalyticsSDK::sendBrowsingStartEvent()",message:t.message,errorMessage:t.message})}})}sendPageViewEvent(){return a(this,arguments,function*(){try{if(!this.isInitialized){this.queueEventSending(this.sendPageViewEvent.name,arguments);return}let t=Date.now();yield this.updateSession(t);let e=new rn(t,this.clientId,this.sessionId,this.merchantId,this.shopperCountryCode,"Browsing Funnel",this.cdn,this.browser.getPageUrl(),this.browser.getPageTitle(),this.screenResolution,this.userAgent,this.browser.getReferrer(),this.utms.utmSource,this.utms.utmMedium,this.utms.utmCampaign,this.utms.utmTerm,this.utms.utmContent);yield this.eventSender.send(e)}catch(t){this.logger.writeErrorLog({method:"AnalyticsSDK::sendPageViewEvent()",message:t.message,errorMessage:t.message})}})}sendBrowsingFunnelEvent(r,n){return a(this,arguments,function*(t,e){try{if(!this.isInitialized){this.queueEventSending(this.sendBrowsingFunnelEvent.name,arguments);return}let o=Date.now();yield this.updateSession(o);let s=new Sn(t,o,this.clientId,this.sessionId,this.merchantId,this.shopperCountryCode,"Browsing Funnel",this.cdn,this.browser.getPageUrl(),this.browser.getPageTitle(),this.screenResolution,this.userAgent,this.browser.getReferrer(),this.utms.utmSource,this.utms.utmMedium,this.utms.utmCampaign,this.utms.utmTerm,this.utms.utmContent,e);yield this.eventSender.send(s)}catch(o){this.logger.writeErrorLog({method:"AnalyticsSDK::sendBrowsingFunnelEvent()",message:o.message,errorMessage:o.message})}})}sendCheckoutStartEvent(e){return a(this,arguments,function*(t){try{if(!this.isInitialized){this.queueEventSending(this.sendCheckoutStartEvent.name,arguments);return}let r=Date.now();if(yield this.updateSession(r),this.sessionId===this.lockCheckoutStartOnSessionId)return!1;this.lockCheckoutStartOnSessionId=this.sessionId,yield this.saveConfigurationSnapshot();let n=new hn(r,this.clientId,this.sessionId,this.merchantId,this.shopperCountryCode,"Checkout Funnel",this.cdn,t,this.userAgent,this.utms.utmSource,this.utms.utmMedium,this.utms.utmCampaign,this.utms.utmTerm,this.utms.utmContent);yield this.eventSender.send(n)}catch(r){this.logger.writeErrorLog({method:"AnalyticsSDK::sendCheckoutStartEvent()",message:r.message,errorMessage:r.message})}})}sendCheckoutFunnelEvent(n,o,s){return a(this,arguments,function*(t,e,r){try{if(!this.isInitialized){this.queueEventSending(this.sendCheckoutFunnelEvent.name,arguments),this.logger.writeDebugLog("Exit sendCheckoutFunnelEvent without sending CheckoutFunnelEvent");return}let i=Date.now();yield this.updateSession(i);let c=new fn(e,i,this.clientId,this.sessionId,this.merchantId,this.shopperCountryCode,"Checkout Funnel",this.cdn,t,this.userAgent,this.utms.utmSource,this.utms.utmMedium,this.utms.utmCampaign,this.utms.utmTerm,this.utms.utmContent,f(f({},this.dataLayer),r));this.logger.writeDebugLog("Sending CheckoutFunnelEvent"),yield this.eventSender.send(c)}catch(i){this.logger.writeErrorLog({method:"AnalyticsSDK::sendCheckoutFunnelEvent()",message:i.message,errorMessage:i.message})}})}};function Jt(t,e){return a(this,null,function*(){try{let n=new URLSearchParams(t.context.document.location.search).get(it);n==="true"&&(yield e.sessionStorage.setItem(Pe,n))}catch(r){console.error("Error in borderfree consent:",r)}})}function V(t,e){return a(this,null,function*(){try{return(yield t.sessionStorage.getItem(Pe))||(e==null?void 0:e.analyticsProcessingAllowed)&&(e==null?void 0:e.marketingAllowed)&&(e==null?void 0:e.saleOfDataAllowed)}catch(r){return console.error(r,{data:"Error checking consent status"}),!1}})}var We={source:"direct",medium:"(none)",campaign:"(not-set)"};function $t({utmSource:t=null,utmMedium:e=null,utmCampaign:r=null,expiry:n=null},{bfDirectToCheckout:o,bfDirectToCheckoutEnabled:s}){let i=[],c=t||e||r,l=c?t:We.source,u=c?e:We.medium,g=c?r:We.campaign;l&&i.push(`utm_source=${l}`),u&&i.push(`utm_medium=${u}`),g&&i.push(`utm_campaign=${g}`),o&&i.push(`bf_direct_to_checkout=${o}`),s&&i.push(`bf_direct_to_checkout_enabled=${s}`);let p=i.join("&");if(!n)return p;let y={value:p};return y.expiry=new Date(n).toISOString(),JSON.stringify(y)}function ve(t,e){return a(this,null,function*(){let r=yield t.getItem(q);if(!r)return{bfDirectToCheckout:null,bfDirectToCheckoutEnabled:null};if(e==1)try{let n=JSON.parse(r);if(n!=null&&n.value)return De(n.value)}catch(n){console.error("Error parsing stored params:",n)}return De(r)})}function Wt(t){return a(this,null,function*(){return(yield t.localStorage.getItem(q))?ve(t.localStorage,1):ve(t.sessionStorage,0)})}function De(t){let e=new URLSearchParams(t);return{bfDirectToCheckout:e.get("bf_direct_to_checkout"),bfDirectToCheckoutEnabled:e.get("bf_direct_to_checkout_enabled")}}function ke(t,e){return a(this,null,function*(){try{let r,n=yield t.localStorage.getItem(X),o=t.localStorage;if(r=1,n||(n=yield t.sessionStorage.getItem(X),o=t.sessionStorage,r=0),!n)return;let s=JSON.parse(n),i=De(e.context.document.location.search),c=i!=null&&i.bfDirectToCheckout||i!=null&&i.bfDirectToCheckoutEnabled?i:yield ve(o,r),l=$t(s,c);yield o.setItem(q,l)}catch(r){E(r,{data:"web-pixel Error processing UTM parameters:"})}})}var H=(t,e,r,n,o=null,s=null)=>a(null,null,function*(){var u,g,p,y,_,d;let i,c=(u=n.data)!=null?u:n.customData,l=(d=(p=(g=c==null?void 0:c.checkout)==null?void 0:g.shippingAddress)==null?void 0:p.countryCode)!=null?d:(_=(y=c==null?void 0:c.checkout)==null?void 0:y.billingAddress)==null?void 0:_.countryCode;try{i=new qt;let S=f(f({cdn:e,clientId:s,browser:{localStorage:r.localStorage,sessionStorage:r.sessionStorage,cookieStorage:{getItem:I=>r.cookie.get(I),setItem:(I,A)=>r.cookie.set(I,A),removeItem:I=>Promise.resolve()}},eventSendingStrategy:1},o&&{utms:o}),o&&{googleAds:o});return yield i.init(t,l!=null?l:"UA",S),i}catch(S){E(S,{data:"web-pixel INIT Error checking Sentry setting:"})}}),zt=(t,e,r,n,o)=>a(null,null,function*(){try{let s;if(x(o==null?void 0:o.FT_IsAnalyticsSDKEnabled))s=yield H(n,r,t,e,e.context.document.location.search);else{let i=yield xe(t,"GLBE_SESS_ID",n,!0);s=yield H(n,r,t,e,e.context.document.location.search,i)}return yield ke(t,e),yield Jt(e,t),s}catch(s){E(s,{data:"web-pixel Error handle Analytics data"})}});function Qt(t,e){return a(this,null,function*(){try{let r=yield t.localStorage.getItem(q);r||(r=yield t.sessionStorage.getItem(q)),r||(yield ke(t,e))}catch(r){E(r,{data:"web-pixel Error processing UTM parameters:"})}})}function Xt(t,e,r){return a(this,null,function*(){if(!t||!e||!r)return;let n=new N(t);try{let o=`/Shopify/analytics/saveClientIds/${e}`;return yield n.post(o,r)}catch(o){E(o,{data:"Error saving client IDs:"})}})}function Ee(t,e,r,n){return a(this,null,function*(){try{let o=yield r.localStorage.getItem(X);if(o||(o=yield r.sessionStorage.getItem(X)),o){let s=JSON.parse(o);if(s.utmSource===nt||s.utmSource===ot){let i=n.data;i!=null||(i=n.customData);let c={checkoutId:i.checkout.token,sdkClientId:null,sdkSessionId:null,utmSource:s.utmSource,utmMedium:s.utmMedium,utmCampaign:s.utmCampaign};Xt(t,e,c)}}}catch(o){E(o,{data:"web-pixel Error processing UTM parameters:"})}})}var Re=class extends W{constructor(e,r,n,o,s){super(e),this.urlPath=r,this.language=n,this.screenResolution=o,this.userAgent=s}};var Zt=(t,e,r,n,o,s,i,c,l,u,g,p,y,_)=>a(null,null,function*(){let d=t.customData.checkout.isMerchantOperatedByGE;if(yield le(e,n,d),(yield Ce(e))&&d){let S="",I="",O=yield se(e,t,u,l,m=>{L("countryCode",m),I=m},m=>{L("checkoutId",m),S=m}),b=yield ae(e,r),R=yield ce(b,e);yield ue(R,e,S),o.forEach(m=>a(null,null,function*(){var C,v,M,U,de,B;let T=yield ie(s,i,m,c,l,I,S,u,O,g,p,b,y,_);g(T.initData),p(T.instance);let h=new Re("Browsing start",(v=(C=t.context.window)==null?void 0:C.location)==null?void 0:v.href,(M=t.context.navigator)==null?void 0:M.language,`${(U=t.context.window.screen)==null?void 0:U.width}x${(de=t.context.window.screen)==null?void 0:de.height}`,(B=t.context.navigator)==null?void 0:B.userAgent);yield T.instance.sendBrowsingEvent(m,h,R)}))}});var er={"checkout-service-qa.bglobale.com":"QA","checkout-service.global-e.com":"Production","checkout-service-int.bglobale.com":"INT","checkout-service-qa-hf.bglobale.com":"QA-HF","checkout-service-stg.bglobale.com":"STG"};function tr(t){try{let e=new URL(t).hostname.toLowerCase();return e in er?er[e]:"WebPixel"}catch(e){return"WebPixel"}}var An="merchantSessionIdFound",rr="GE_SHIPPING_OPTIONS";function Dt(t,e,r,n,o,s,i,c){return{action:An,url:i,refer:s,start:e,text:c,userAgent:o,end:r,duration:r-e,id:1,user:t,site:n}}function xn(t){return a(this,null,function*(){let e=yield t.cookie.get("forterToken");e||(e=[et(),Date.now(),"","","",""].join("_"),yield t.cookie.set("forterToken",e));let r="",n=e.split("_");return n&&(r=n[0]),{forterToken:e,userId:r}})}function Cn(t,e,r,n,o,s){return a(this,null,function*(){let i=yield xn(e),c=n.navigator.userAgent,l=n.window.location.href,u=n.document.referrer,g=i.forterToken,p=i.userId;yield new Promise((y,_)=>{r.subscribe(self.debug?"page_viewed":"ge_payment_loaded",d=>a(null,null,function*(){return yield vt(d,p,t,o,c,u,l,g,s,y,_)}))})})}var be="checkout",bn=i=>a(null,[i],function*({analytics:t,browser:e,settings:r,init:n,_pixelInfo:o,customerPrivacy:s}){let c=n.customerPrivacy;s.subscribe("visitorConsentCollected",O=>{c=O.customerPrivacy}),t.subscribe("page_viewed",O=>a(null,null,function*(){yield zt(e,O,p,u,r),Rt(O,e);let b=yield V(e,c);x(r==null?void 0:r.BorderfreeMetaCAPIEnabled)&&b&&Ot(O,e)}));let l="checkout-one",u=r==null?void 0:r.merchantId,g=r==null?void 0:r.baseApiUrl,p=r==null?void 0:r.CDNUrl,y=tr(g),_="GLBE_SESS_ID",d="",S=[1],I=new ne,A=new re(I,S);if((o?o.surface:l)===l){let O=r==null?void 0:r.siteId;O===void 0||O.length!=12,Cn(Date.now(),e,t,n.context,O,g).then().catch(m=>{}),d=yield xe(e,_,u);let b=m=>{I=m},R=m=>{A=m};t.subscribe("globale_checkout_started",m=>a(null,null,function*(){if(!(yield V(e,c))){Ee(g,u,e,m);return}let h=yield H(u,p,e,m);yield Qt(e,m);let v=(yield Wt(e)).bfDirectToCheckout==="yes";x(r==null?void 0:r.FT_IsAnalyticsSDKEnabled)&&(v&&(yield h.sendBrowsingStartEvent()),yield h.sendCheckoutStartEvent(m.customData.checkout.token)),x(r==null?void 0:r.FT_IsLegacyAnalyticsSDKEnabled)&&(v&&(yield Zt(m,e,r,K,S,I,A,g,u,d,b,R,h.ClientId,h.SessionId)),yield kt(m,e,r,K,S,I,A,g,u,d,b,R,h.ClientId,h.SessionId))})),t.subscribe("checkout_address_info_submitted",m=>a(null,null,function*(){if(!(yield V(e,c))){Ee(g,u,e,m);return}let h=yield H(u,p,e,m);x(r==null?void 0:r.FT_IsAnalyticsSDKEnabled)&&(yield h.sendCheckoutFunnelEvent(m.data.checkout.token,"checkout_address_info_submitted")),x(r==null?void 0:r.FT_IsLegacyAnalyticsSDKEnabled)&&(yield z(m,"checkout_address_info_submitted","checkout_address_info_submitted",e,r,K,S,I,A,g,u,d,b,R,h.ClientId,h.SessionId))})),t.subscribe("checkout_shipping_info_submitted",m=>a(null,null,function*(){if(!(yield V(e,c))){Ee(g,u,e,m);return}let h=yield H(u,p,e,m);x(r==null?void 0:r.FT_IsAnalyticsSDKEnabled)&&(yield h.sendCheckoutFunnelEvent(m.data.checkout.token,"checkout_shipping_info_submitted")),x(r==null?void 0:r.FT_IsLegacyAnalyticsSDKEnabled)&&(yield z(m,"checkout_shipping_info_submitted","checkout_shipping_info_submitted",e,r,K,S,I,A,g,u,d,b,R,h.ClientId,h.SessionId))})),t.subscribe("payment_info_submitted",m=>a(null,null,function*(){if(!(yield V(e,c))){Ee(g,u,e,m);return}let h=yield H(u,p,e,m);x(r==null?void 0:r.FT_IsAnalyticsSDKEnabled)&&(yield h.sendCheckoutFunnelEvent(m.data.checkout.token,"payment_info_submitted")),x(r==null?void 0:r.FT_IsLegacyAnalyticsSDKEnabled)&&(yield z(m,"payment_info_submitted","payment_info_submitted",e,r,K,S,I,A,g,u,d,b,R,h.ClientId,h.SessionId))})),t.subscribe("checkout_completed",m=>a(null,null,function*(){if(!(yield V(e,c)))return;let h=yield H(u,p,e,m);x(r==null?void 0:r.FT_IsAnalyticsSDKEnabled)&&(yield h.sendCheckoutFunnelEvent(m.data.checkout.token,"checkout_completed")),x(r==null?void 0:r.FT_IsLegacyAnalyticsSDKEnabled)&&(yield z(m,"checkout_completed","checkout_completed",e,r,K,S,I,A,g,u,d,b,R,h.ClientId,h.SessionId))})),t.subscribe("shipping_options_available",m=>a(null,null,function*(){if(!(yield V(e,c)))return;let h=yield H(u,p,e,m),C=yield e.sessionStorage.getItem(rr),v=JSON.stringify(m.customData.payload);(!C||C!==v)&&(x(r==null?void 0:r.FT_IsAnalyticsSDKEnabled)&&(yield h.sendCheckoutFunnelEvent(m.customData.checkout.token,"Shipping Options Available")),x(r==null?void 0:r.FT_IsLegacyAnalyticsSDKEnabled)&&(yield z(m,"Shipping Options Available","Shipping Options Available",e,r,K,S,I,A,g,u,d,b,R,h.ClientId,h.SessionId)),e.sessionStorage.setItem(rr,v))})),t.subscribe("vwo_variation_assigned",m=>a(null,null,function*(){let{campaignKey:T,variation:h}=m.customData.data||{};if(!T||!h||!(yield V(e,c))||(yield e.sessionStorage.getItem("VWO_VARIATION")))return;let M={campaignKey:T,variation:h};yield e.sessionStorage.setItem("VWO_VARIATION",JSON.stringify(M));let U=yield H(u,p,e,m);x(r==null?void 0:r.FT_IsAnalyticsSDKEnabled)&&M&&(yield U.sendCheckoutFunnelEvent(m.customData.checkout.token,"VWO Variation Assigned",{"VWO Campaign Name":M.campaignKey,"VWO Variation Name":M.variation})),x(r==null?void 0:r.FT_IsLegacyAnalyticsSDKEnabled)&&(yield z(m,"vwo_variation_assigned","vwo_variation_assigned",e,r,K,S,I,A,g,u,d,b,R,U.ClientId,U.SessionId))})),t.subscribe("is_merchant_operated_by_ge_changed",m=>a(null,null,function*(){if(!(yield V(e,c)))return;let h=m.customData.isMerchantOperatedByGE;yield le(e,K,h)}))}});Me(bn);})();