(self.webpackChunkui=self.webpackChunkui||[]).push([[7],{19:function(e,t,o){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.initBentoAnalytics=t.logCollectionView=t.loadShopifyAccount=t.DEFAULT_SHOPIFY_ACCOUNT_DATA=void 0,t.logViewCart=async function(){const e=(0,p.uuid)();await(0,p.callOrlyTagHooks)("viewCart",e)},t.logViewContent=async function(e){const o=(0,p.uuid)(),n=[(0,p.callOrlyTagHooks)("viewContent",e,o),(0,a.logGoogleViewContent)(e,o),(0,u.logSnapchatViewContent)(e,o),(0,c.logKlaviyoViewedProduct)(e,o)];await(0,t.loadShopifyAccount)();const i=[(0,d.logOutsmartlyViewedProduct)(e,o),(0,d.logOutsmartlySelectedVariant)(e,o),(0,s.logShopifyViewContent)(e,o),(0,r.logFacebookViewContent)(e,o),(0,_.logTikTokViewContent)(e,o)];await Promise.allSettled([...n,...i])},t.loadScript=m,t.loadAccount=v,t.logClickContent=async function(e,t,o=0){const n=window.__APP_CONFIG__?.eventId||(0,p.uuid)();await(0,p.callOrlyTagHooks)("clickContent",e,t,o,n)},t.logSignUp=async function(e){const t=(0,p.uuid)();await Promise.allSettled([(0,p.callOrlyTagHooks)("signUp",e,t)])},t.logSignIn=async function(e){const t=(0,p.uuid)();await Promise.allSettled([(0,p.callOrlyTagHooks)("signIn",e,t)])},t.logSearch=async function(e,t){const o=(0,p.uuid)();await Promise.allSettled([(0,p.callOrlyTagHooks)("search",e,t,o)])};const i=o(32),r=o(128),a=o(94),c=o(95),d=o(96),l=o(37),s=o(130),u=o(98),_=o(131),p=o(5),w=n(o(43));async function y(e,t){await Promise.allSettled([(0,p.callOrlyTagHooks)("addToCart",e,t),(0,s.logAddToCartShopify)(e,t),(0,r.logAddToCartFacebook)(e,t),(0,_.logAddToCartTikTok)(e,t),(0,l.logAddToCartPinterest)(e,t),(0,u.logAddToCartSnapchat)(e,t),(0,a.logAddToCartGoogleAnalytics)(e,t),(0,c.logAddToCartKlaviyo)(e,t)])}async function g(e,t){await(0,p.callOrlyTagHooks)("removeFromCart",e,t)}async function f(){const e=window.__APP_CONFIG__?.eventId||(0,p.uuid)(),o=(0,t.loadShopifyAccount)(),n=o.then((async e=>{await v(e)}));await Promise.allSettled([(0,p.callOrlyTagHooks)("pageView",e,o),(0,a.logGooglePageView)(e,o),(0,u.logSnapchatPageView)(e,o),(0,d.logOutsmartlyPageView)(e,o),(0,s.logShopifyPageView)(e,o),(0,l.logPinterestPageView)(e,o),(0,r.logFacebookPageView)(e,o),n])}async function m(){await Promise.allSettled([(0,p.callOrlyTagHooks)("loadScript"),new Promise((e=>{(0,a.loadGoogleAnalytics)(),e()})),new Promise((e=>{(0,c.loadKlaviyo)(),e()})),new Promise((e=>{(0,_.loadTikTok)(),e()}))])}async function v(e){await Promise.allSettled([(0,p.callOrlyTagHooks)("loadAccount",e),new Promise((t=>{(0,u.loadSnapchat)(e),t()}))])}t.DEFAULT_SHOPIFY_ACCOUNT_DATA={loggedIn:!1,id:"",email:"",phone:"",first_name:"",last_name:"",city:"",country:"",countryCode:"",zip:"",address1:"",address2:"",hashedEmail:"",loyaltylion_has_account:!1,loyaltylion_token:"",loyaltylion_auth_token:"",province:"",provinceCode:"",rechargeHash:"",date:"",tags:"",orderValue:"",orderId:"",theme:void 0},t.loadShopifyAccount=(0,w.default)((async()=>{const e=window.__APP_CONFIG__?.ANALYTICS.accountEndpoint??"/api/account";try{return await fetch(e).then((e=>e.json())).catch((o=>(console.error("loadShopifyAccount from endpoint failed.\n",`Tried to fetch from: ${e}\n.`,"Returning a default account...\n",`error: ${JSON.stringify(o)}`),t.DEFAULT_SHOPIFY_ACCOUNT_DATA)))}catch(o){return console.warn(`Error loading account from '${e}', returning default account instead.\n You can change default account endpoint on window.__APP_CONFIG__.ANALYTICS.accountEndpoint.\n ${JSON.stringify(o,void 0,2)}`),t.DEFAULT_SHOPIFY_ACCOUNT_DATA}})),t.logCollectionView=(0,w.default)((async(e,t)=>{const o=(0,p.uuid)();await Promise.allSettled([(0,p.callOrlyTagHooks)("collectionView",e,t,o),(0,l.logPinterestCollectionView)(e,t,o),(0,a.logGoogleCollectionView)(e,t,o)])}));const A=async(e,t)=>{const o=await fetch(e,t),n=await o.json();return queueMicrotask((()=>function(e,t,o){if(!(0,p.isShopifyCart)(o)){if(!(0,p.isShopifyCartError)(o))throw new Error("unexpected response, not a ShopifyCart or ShopifyCartError");return o}const n=(0,p.normalizeCart)(o),i=t.get("x-event-id")??(0,p.uuid)();e.startsWith("/cart/add.js")?C(n,i):e.startsWith("/cart/change.js")||e.startsWith("/cart/update.js")?P(n,i):e.startsWith("/cart.json")?(0,p.updateCart)(n):console.error(`Unknown URL: ${e}`)}(e,o.headers,n))),n},C=(e,t)=>{const o=(0,p.getOldCart)();if(!o)return void(0,p.updateCart)(e);const n=new Map(o.items.map((e=>[e.key,e])));for(const o of e.items){const e=n.get(o.key),i=e?.quantity||0,r=o.quantity-i;y({...o,quantity:r},t).catch((e=>{console.error(e)}))}},P=(e,t)=>{const o=(0,p.getOldCart)();if(!o)return void(0,p.updateCart)(e);const n=(0,p.getItemCounts)(o.items),i=(0,p.getItemCounts)(e.items);for(const[e,o]of i.entries()){const i=n.get(e),r=i?.quantity||0,a=o.quantity-r;a>0?y({...o,quantity:a},t).catch((e=>{console.error(e)})):a<0&&g({...o,quantity:-a},t).catch((e=>{console.error(e)}))}for(const[e,o]of n.entries())i.has(e)||g(o,t).catch((e=>{console.error(e)}));(0,p.updateCart)(e)};t.initBentoAnalytics=(0,w.default)((async e=>{if("undefined"==typeof window)return void console.warn("initBentoAnalytics: window not defined, NOP.");if(!window.__APP_CONFIG__)return void console.warn("No window.__APP_CONFIG__ found.");window.__APP_CONFIG__.fetchCartJSON=A;const t={elevar:i.initElevar};for(const o of(0,p.entries)(e))if(o){const[e,n]=o;n&&t[e]()}try{await m().then(f)}catch(e){console.log(e)}}))},138:(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useViewContent=function(e){(0,n.useEffect)((()=>{(0,i.logViewContent)(e).catch((e=>{console.error(e)}))}),[e.product_id,e.variant_id])},t.useCollectionView=function(e,t){(0,n.useEffect)((()=>{(0,i.logCollectionView)(e,t).catch((e=>{console.error(e)}))}),[e,t])};const n=o(3),i=o(19)},127:(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadScriptWithDelay=t.loadScript=t.initBentoAnalytics=t.logCollectionView=t.logSearch=t.logSignIn=t.logSignUp=t.logViewContent=t.logViewCart=t.loadShopifyAccount=t.useCollectionView=t.useViewContent=t.useOutsmartlyErrorReporting=t.logOutsmartlyError=t.loadImapactRadius=t.loadAttn=t.loadIntellipse=t.loadKlaviyoSubscribe=t.loadKlaviyo=t.loadLoyaltyLion=t.loadSnapchat=t.loadPinterest=t.loadGoogleAnalytics=t.initElevar=void 0;var n=o(32);Object.defineProperty(t,"initElevar",{enumerable:!0,get:function(){return n.initElevar}});var i=o(94);Object.defineProperty(t,"loadGoogleAnalytics",{enumerable:!0,get:function(){return i.loadGoogleAnalytics}});var r=o(37);Object.defineProperty(t,"loadPinterest",{enumerable:!0,get:function(){return r.loadPinterest}});var a=o(98);Object.defineProperty(t,"loadSnapchat",{enumerable:!0,get:function(){return a.loadSnapchat}});var c=o(133);Object.defineProperty(t,"loadLoyaltyLion",{enumerable:!0,get:function(){return c.loadLoyaltyLion}});var d=o(95);Object.defineProperty(t,"loadKlaviyo",{enumerable:!0,get:function(){return d.loadKlaviyo}}),Object.defineProperty(t,"loadKlaviyoSubscribe",{enumerable:!0,get:function(){return d.loadKlaviyoSubscribe}});var l=o(135);Object.defineProperty(t,"loadIntellipse",{enumerable:!0,get:function(){return l.loadIntellipse}});var s=o(136);Object.defineProperty(t,"loadAttn",{enumerable:!0,get:function(){return s.loadAttn}});var u=o(137);Object.defineProperty(t,"loadImapactRadius",{enumerable:!0,get:function(){return u.loadImapactRadius}});var _=o(96);Object.defineProperty(t,"logOutsmartlyError",{enumerable:!0,get:function(){return _.logOutsmartlyError}}),Object.defineProperty(t,"useOutsmartlyErrorReporting",{enumerable:!0,get:function(){return _.useOutsmartlyErrorReporting}});var p=o(138);Object.defineProperty(t,"useViewContent",{enumerable:!0,get:function(){return p.useViewContent}}),Object.defineProperty(t,"useCollectionView",{enumerable:!0,get:function(){return p.useCollectionView}});var w=o(19);Object.defineProperty(t,"loadShopifyAccount",{enumerable:!0,get:function(){return w.loadShopifyAccount}}),Object.defineProperty(t,"logViewCart",{enumerable:!0,get:function(){return w.logViewCart}}),Object.defineProperty(t,"logViewContent",{enumerable:!0,get:function(){return w.logViewContent}}),Object.defineProperty(t,"logSignUp",{enumerable:!0,get:function(){return w.logSignUp}}),Object.defineProperty(t,"logSignIn",{enumerable:!0,get:function(){return w.logSignIn}}),Object.defineProperty(t,"logSearch",{enumerable:!0,get:function(){return w.logSearch}}),Object.defineProperty(t,"logCollectionView",{enumerable:!0,get:function(){return w.logCollectionView}}),Object.defineProperty(t,"initBentoAnalytics",{enumerable:!0,get:function(){return w.initBentoAnalytics}});var y=o(5);Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return y.loadScript}}),Object.defineProperty(t,"loadScriptWithDelay",{enumerable:!0,get:function(){return y.loadScriptWithDelay}})},136:(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadAttn=function(){if(!window.__APP_CONFIG__?.ANALYTICS)return;const{ATTN_ID:e,ATTN_DELAY:t=10}=window.__APP_CONFIG__.ANALYTICS;if(!e)return;const o={src:`//cdn.attn.tv/${e}/dtag.js`,id:"attn-script",timeout:1e3*t,anonymous:!1};(0,n.loadScriptWithDelay)(o)};const n=o(5)},32:function(e,t,o){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.logElevarSearch=t.logElevarViewCart=t.logElevarViewContent=t.logElevarClickContent=t.logElevarCollectionView=t.logElevarRemoveFromCart=t.logElevarAddToCart=t.logElevarPageView=void 0,t.initElevar=function(){"undefined"!=typeof window&&(window._orlyTags||(window._orlyTags=[]),window._orlyTags.push(["addToCart",t.logElevarAddToCart],["removeFromCart",t.logElevarRemoveFromCart],["clickContent",t.logElevarClickContent],["collectionView",t.logElevarCollectionView],["pageView",t.logElevarPageView],["viewCart",t.logElevarViewCart],["viewContent",t.logElevarViewContent],["loadScript",c],["search",t.logElevarSearch]))},t.loadElevar=c;const i=o(19),r=o(5),a=n(o(43));async function c(){try{const e=await(0,r.waitForShopifyY)();e&&(window.ElevarUserIdFn=()=>e),await fetch("/static-489c224a/elevar/live.html").then((e=>e.text())).then((e=>{const t=document.createRange().createContextualFragment(e);document.body.append(t)})),window.ElevarPushToDataLayer??=e=>(window.ElevarDataLayer=window.ElevarDataLayer??[],window.ElevarDataLayer.push(e))}catch(e){throw new Error("loadElevar error:"+JSON.stringify(e,void 0,2))}}async function d(e){const t=e??await(0,i.loadShopifyAccount)(),o=(0,r.getOldCart)(),n=o?.items.map(((e,t)=>({name:e.title,id:e.id.toString(),category:e.product_type||"unknown",brand:e.vendor,variant:e.variant_id.toString()||"",price:e.final_line_price.toString(),quantity:e.quantity.toString(),product_id:e.product_id.toString(),variant_id:e.variant_id.toString(),compare_at_price:e.original_line_price.toString(),image:e.image,inventory:"",list:"",url:e.url,position:t})))??[];return{user:{customer_address_1:t.address1||void 0,customer_address_2:t.address2||void 0,customer_city:t.city||void 0,customer_country:t.country||void 0,customer_email:t.email||void 0,customer_first_name:t.first_name||void 0,customer_id:t.id||void 0,customer_last_name:t.last_name||void 0,customer_order_count:void 0,customer_phone:t.phone||void 0,customer_province:t.province||void 0,customer_province_code:t.provinceCode||void 0,customer_tags:t.tags||void 0,customer_total_spent:t.orderValue||void 0,customer_zip:t.zip||void 0,user_consent:void 0,visitor_type:t.loggedIn?"logged_in":"guest"},cart:{items:n,total:o?.total_price.toString()??""}}}const l=async e=>{const t=(0,r.readCookie)("cart_currency")||(0,r.readCookie)("cartCurrency");return t||((e??await(0,i.loadShopifyAccount)()).currency||"USD")},s=(e,t)=>{const o=new URL(t?.url||window.location.href),n=o.pathname+o.search;return e.map(((e,t)=>{const o=e.selected_variant?.id||e.product.id,i=e.selected_variant?.price??e.product.price,r=e.selected_variant?.compare_at_price??e.product.compare_at_price,a=e.selected_variant?.inventory_quantity;return{id:e.selected_variant?.sku??o?.toString(),name:e.product.title,list:n,brand:e.product.vendor,category:e.product.type,variant:e.selected_variant?.title,variant_id:e.selected_variant?.id?.toString(),position:t+1,price:i?.toFixed(2),quantity:a?a.toString():"1",product_id:e.product.id?.toString(),compare_at_price:r?.toFixed(2)??i?.toFixed(2),url:e.selected_variant?.url||e.product.url}}))};function u(e){const t=e.price.toFixed(2),o=e.original_price.toFixed(2),n=e.position??0,i=document.referrer?new URL(document.referrer):void 0;return{id:e.sku,name:e.product_title,price:t,image:e.image,brand:e.vendor,category:e.product_type||"unknown",compare_at_price:o===t||"0.00"===o?t:o,product_id:e.product_id.toString(),variant_id:e.variant_id.toString(),variant:e.variant_title,inventory:e.inventory?.toString(),list:i?`${i.pathname}${i.search}`:"",position:n+1,quantity:e.quantity.toString(),url:e.url}}function _(e,t,o=0){const n=e.selected_variant?.price??e.product.price,i=e.selected_variant?.compare_at_price??e.product.compare_at_price,r=e.selected_variant?.image??e.product.image,a=new URL(t?.url||window.location.href),c=a.pathname+a.search;return{id:e.selected_variant?.sku||e.product.id?.toString(),name:e.product.title,price:n?.toFixed(2),image:r?.src,brand:e.product.vendor,category:e.product.type,compare_at_price:i===n||0===i?n?.toFixed(2):i?.toFixed(2),product_id:e.product.id?.toString(),variant_id:e.selected_variant?.id?.toString(),variant:e.selected_variant?.title,inventory:e.selected_variant?.inventory_quantity?.toString(),list:c,position:o+1,quantity:e.quantity?.toString(),url:e.selected_variant?.url||e.product.url}}t.logElevarPageView=async(e,t)=>{const o=await t,n=await l(o),{user:i,cart:r}=await d(o);window.ElevarPushToDataLayer?.({event:"dl_user_data",eventId:e,cart_total:r.total,user_properties:i,ecommerce:{currencyCode:n,cart_contents:{products:r.items}}})},t.logElevarAddToCart=async(e,t=(0,r.uuid)())=>{const o=u(e),n=await l(),{user:i}=await d();window.ElevarPushToDataLayer?.({event:"dl_add_to_cart",eventId:t,user_properties:i,ecommerce:{currencyCode:n,add:{actionField:{list:document.referrer?new URL(document.referrer).pathname:"",action:"add"},products:[o]}}})},t.logElevarRemoveFromCart=async(e,t=(0,r.uuid)())=>{const o=u(e),n=await l(),{user:i}=await d();window.ElevarPushToDataLayer?.({event:"dl_remove_from_cart",eventId:t,user_properties:i,ecommerce:{currencyCode:n,remove:{actionField:{list:"Shopping Cart"},products:[o]}}})},t.logElevarCollectionView=async(e,t,o=(0,r.uuid)())=>{const n=await l(),{user:i}=await d(),a=s(t,e);window.ElevarPushToDataLayer?.({event:"dl_view_item_list",eventId:o,user_properties:i,ecommerce:{currencyCode:n,impressions:a}})},t.logElevarClickContent=async(e,t,o=0,n=(0,r.uuid)())=>{const{user:i}=await d(),a=await l(),c=new URL(e.url||window.location.href),s=`${c.pathname}${c.search}`,u=[_(t,e,o)];window.ElevarPushToDataLayer?.({event:"dl_select_item",eventId:n,user_properties:i,ecommerce:{currencyCode:a,click:{actionField:{list:s,action:"click"},products:u}}})};const p=(0,a.default)((async e=>{const o=(0,r.cartItemToBentoAnalyticsItem)(e),n=document.referrer?new URL(document.referrer):void 0;await(0,t.logElevarClickContent)({id:-1,title:n?`${n.pathname}${n.search}`:"",url:document.referrer},o,0)}));t.logElevarViewContent=async(e,t=(0,r.uuid)())=>{document.referrer&&await p(e);const o=document.referrer||window.location.href?new URL(document.referrer||window.location.href):void 0,n=await l(),i=_((0,r.cartItemToBentoAnalyticsItem)(e));i.inventory||console.error("Please attach an inventory value to cartItem for logViewContent events.");const{user:a}=await d(),c=[i];window.ElevarPushToDataLayer?.({event:"dl_view_item",eventId:t,user_properties:a,ecommerce:{currencyCode:n,detail:{actionField:{list:o?`${o.pathname}${o.search}`:"",action:"detail"},products:c}}})},t.logElevarViewCart=async(e=(0,r.uuid)())=>{const o=await l();await(0,t.logElevarPageView)(e,(0,i.loadShopifyAccount)());const{user:n,cart:a}=await d();var c;window.ElevarPushToDataLayer?.({event:"dl_view_cart",eventId:e,user_properties:n,ecommerce:{currencyCode:o,actionField:{list:"Shopping Cart"},impressions:(c=a.items??[],c.map(((e,t)=>({...e,position:t+1,list:"Shopping Cart"}))))},cart_total:a.total})},t.logElevarSearch=async(e,t,o=(0,r.uuid)())=>{const n=await l(),{user:i}=await d(),a=new URL(window.location.href);a.searchParams.set("query",e),window.ElevarPushToDataLayer?.({event:"dl_view_search_results",eventId:o,user_properties:i,ecommerce:{currencyCode:n,actionField:{list:"search results"},impressions:s(t,{title:"search results test",url:a.toString(),id:-1})}})}},128:(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logFacebookPageView=t.logFacebookViewContent=t.logAddToCartFacebook=void 0;const n=o(5),i=o(129);function r(){if(!window.__APP_CONFIG__?.ANALYTICS)return;const{USE_FB_SDK:e,FB_INIT:t}=window.__APP_CONFIG__.ANALYTICS;return!e||t?t:(window.__APP_CONFIG__.ANALYTICS.FB_INIT=(async()=>{if(!window.__APP_CONFIG__?.ANALYTICS.USE_FB_SDK)return;const{FB_ID:e}=window.__APP_CONFIG__.ANALYTICS;if(e&&((0,i.loadFacebookSdk)(),window.fbq)){(0,n.ccpa_dns)()?window.fbq("dataProcessingOptions",["LDU"],1,1e3):window.fbq("dataProcessingOptions",[]);const t=await l();window.fbq("init",e,t)}})(),window.__APP_CONFIG__.ANALYTICS.FB_INIT)}function a(e,t){const o=`${e.title??""} - ${t.title??""}`;return[`&cd[content_ids]=${t.id??""}`,"&cd[content_type]=product_group",`&cd[content_name]=${window.encodeURIComponent(o)}`,`&cd[currency]=${(0,n.readCookie)("cartCurrency")??"USD"}`,`&cd[value]=${window.encodeURIComponent(t.price??"0")}`,e.productType?`&cd[content_category]=${e.productType}`:"","&cd[num_items]=1"]}function c(e,t){const o=`${e.title??""} - ${t.title??""}`;return{content_ids:void 0===e.content_ids?t.id?[t.id]:[]:e.content_ids,content_type:"product",content_name:o,curency:(0,n.readCookie)("cartCurrency")??"USD",value:Number.parseFloat(t.price??"0"),content_category:e.productType}}async function d(e){const t=(0,n.readCookie)("_shopify_y"),o=(0,n.readCookie)("_fbp"),i=(0,n.readCookie)("_fbc"),r=await async function(){const e=await l();return e?await Promise.all(Object.entries(e).map((async([e,t])=>t&&"string"==typeof t?`&ud[${e}]=${window.encodeURIComponent(await(0,n.sha256)(t))}`:""))):[]}(),a=`${document.location.pathname}${document.location.search}`;return[`&dl=${window.encodeURIComponent(a)}`,`&eid=${e}`,o?`&fbp=${window.encodeURIComponent(o)}`:"",i?`&fbc=${window.encodeURIComponent(i)}`:"",t?`&external_id[0]=${window.encodeURIComponent(t)}`:"",...r,(0,n.ccpa_dns)()?"&dpo=LDU&dpoco=1&dpost=1000":"&dpo="].join("")}async function l(){const e=await(window.__APP_CONFIG__?.account);if(e?.id)return{em:e.email,fn:e.first_name,ln:e.last_name,ph:e.phone?.replace(/\D+/g,"")}}t.logAddToCartFacebook=async(e,t)=>{if(!window.__APP_CONFIG__?.ANALYTICS)return;const{FB_ID:o,USE_FB_SDK:i}=window.__APP_CONFIG__.ANALYTICS;if(!o)return;const[l,s]=(0,n.buildProductAndVariant)(e);if(await r(),i&&window.fbq?.loaded)window.fbq("track","AddToCart",c(l,s),{eventID:t});else try{(0,n.imagePixel)([`https://www.facebook.com/tr/?id=${o}`,"&ev=AddToCart",await d(t),...a(l,s)].join(""))}catch(e){console.error(e)}},t.logFacebookViewContent=async(e,t)=>{if(!window.__APP_CONFIG__?.ANALYTICS)return;const{FB_ID:o,USE_FB_SDK:i}=window.__APP_CONFIG__.ANALYTICS;if(!o)return;const[l,s]=(0,n.buildProductAndVariant)(e);try{if(await r(),i&&window.fbq?.loaded)return void window.fbq("track","ViewContent",c(l,s),{eventID:t});(0,n.imagePixel)([`https://www.facebook.com/tr/?id=${o}`,"&ev=ViewContent",await d(t),...a(l,s)].join(""))}catch(e){console.error(e)}},t.logFacebookPageView=async e=>{if(!window.__APP_CONFIG__?.ANALYTICS)return;const{FB_ID:t,USE_FB_SDK:o}=window.__APP_CONFIG__.ANALYTICS;if(t)if(await r(),o&&window.fbq?.loaded)window.fbq("track","PageView");else try{(0,n.imagePixel)(`https://www.facebook.com/tr/?id=${t}&ev=PageView${await d(e)}`)}catch(e){console.error(e)}}},94:(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logGoogleCollectionView=t.logGoogleClickContent=t.logGoogleViewContent=t.logAddToCartGoogleAnalytics=t.event=t.logGooglePageView=t.loadGoogleAnalytics=void 0;const n=o(5);t.loadGoogleAnalytics=()=>{if(!window.__APP_CONFIG__?.ANALYTICS)return;const{GA_ID:e}=window.__APP_CONFIG__.ANALYTICS;if(!e)return;window.gtag||(window.dataLayer=window.dataLayer||[],window.gtag=function(...e){window.dataLayer?.push(e)},window.gtag("js",new Date));const t={src:`https://www.googletagmanager.com/gtag/js?id=${e}`,id:"google-analytics",timeout:3e3};(0,n.loadScriptWithDelay)(t)};let i="";function r(e,t,o={},n=!0){void 0!==window.gtag&&window.gtag("event",e,{...o,currency:"USD",items:t,non_interaction:n})}function a(e,t,o){return{item_id:e.selected_variant?.sku||e.product.id?.toString()||"",item_name:[e.product.title,e.selected_variant?.title].filter((e=>!!e)).join(" "),item_category:e.product.type??"",price:e.product.price,item_brand:e.product.vendor,item_list_id:t.url,item_list_name:t.title,item_variant:e.selected_variant?.id?.toString(),index:o,quantity:e.quantity||1,affiliation:void 0,coupon:void 0,discount:void 0,location_id:void 0}}t.logGooglePageView=()=>{if(!window.__APP_CONFIG__?.ANALYTICS)return;const{GA_ID:e,ADDITIONAL_GA:t}=window.__APP_CONFIG__.ANALYTICS;if(!e)return;const o=`${document.location.pathname}${document.location.search}`,r=window.gtag;if(r&&i!==o&&(i=o,(0,n.ccpa_dns)()&&r("set",{restricted_data_processing:!0}),r("config",e,{page_path:o}),t))for(const e of t)r("config",e,{page_path:o})},t.event=({action:e,category:t,label:o,value:n,non_interaction:i})=>{window.gtag&&window.gtag("event",e,{event_category:t,event_label:o,value:n,non_interaction:i})},t.logAddToCartGoogleAnalytics=e=>{if(!window.__APP_CONFIG__?.ANALYTICS)return;const{GA_ID:t}=window.__APP_CONFIG__.ANALYTICS;t&&r("add_to_cart",[a((0,n.cartItemToBentoAnalyticsItem)(e),{title:document.title,id:-1,url:window.location.toString()})],{},!1)},t.logGoogleViewContent=e=>{if(!window.__APP_CONFIG__?.ANALYTICS)return;const{GA_ID:t}=window.__APP_CONFIG__.ANALYTICS;t&&r("view_item",[a((0,n.cartItemToBentoAnalyticsItem)(e),{title:document.title,id:-1,url:window.location.toString()})])},t.logGoogleClickContent=(e,t,o=0)=>{if(!window.__APP_CONFIG__?.ANALYTICS)return;const{GA_ID:n}=window.__APP_CONFIG__.ANALYTICS;n&&r("select_content",[a(t,e,o)],{content_type:"product"})},t.logGoogleCollectionView=(e,t)=>{if(!window.__APP_CONFIG__?.ANALYTICS)return;const{GA_ID:o}=window.__APP_CONFIG__.ANALYTICS;o&&r("view_item_list",t.map(((t,o)=>a(t,e,o))))}},137:(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadImapactRadius=function(){if(!window.__APP_CONFIG__?.ANALYTICS)return;const{IMPACTRADIUS_ENABLED:e=!1,IMPACTRADIUS_DELAY:t=5}=window.__APP_CONFIG__.ANALYTICS;if(!e)return;const o={src:"//d.impactradius-event.com/A2248058-8d0a-428f-b528-d1484c8157851.js",id:"impact-radius-script",timeout:1e3*t,anonymous:!1};(0,n.loadScriptWithDelay)(o)};const n=o(5)},135:(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadIntellipse=function(){if(!window.__APP_CONFIG__?.ANALYTICS)return;const{ANALYTICS:{INTELLIPSE_ENABLED:e=!1,INTELLIPSE_DELAY:t=10},SHOP_NAME:o}=window.__APP_CONFIG__;if(!e)return;const i={src:`https://bootstrap.production.intellipse.com/bootstrap.js?shop=${o}.myshopify.com`,id:"intellipse-script",timeout:1e3*t,anonymous:!1};(0,n.loadScriptWithDelay)(i)};const n=o(5)},95:(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadKlaviyoSubscribe=t.logAddToCartKlaviyo=t.logKlaviyoViewedProduct=t.loadKlaviyo=void 0;const n=o(5);function i(){if(!window.__APP_CONFIG__?.ANALYTICS)return!1;const{KLAVIYO_ID:e}=window.__APP_CONFIG__.ANALYTICS;return!!e}t.loadKlaviyo=()=>{if(!window.__APP_CONFIG__?.ANALYTICS)return;const{ANALYTICS:{KLAVIYO_ID:e,KLAVIYO_DELAY:t=2},SHOP_NAME:o}=window.__APP_CONFIG__;if(!e)return;const i={src:`//static.klaviyo.com/onsite/js/klaviyo.js?company_id=${e}&shop=${o}.myshopify.com`,id:"klaviyo-script",timeout:1e3*t,anonymous:!1};!function(){if(!window.klaviyo){window._klOnsite=window._klOnsite||[];try{window.klaviyo=new Proxy({},{get:function(e,t){return"push"===t?function(){var e;(e=window._klOnsite).push.apply(e,arguments)}:function(){for(var e=arguments.length,o=new Array(e),n=0;n{if(!i())return;const[t]=(0,n.buildProductAndVariant)(e),o=`${document.location.pathname}${document.location.search}`,r={Name:t.title,ProductID:t.id,ImageURL:t.image,URL:o,Brand:t.vendor,Price:t.price,CompareAtPrice:t.compareAtPrice??void 0},a={Name:r.Name,ProductID:r.ProductID,Handle:r.URL,Brand:r.Brand,Price:r.Price,ImageUrl:r.ImageURL,Metadata:{Brand:r.Brand,Price:r.Price,CompareAtPrice:r.CompareAtPrice}};window.klaviyo.push(["track","Viewed Product",a]);const c={Name:r.Name,ProductID:r.ProductID,Handle:r.URL,Brand:r.Brand,Price:r.Price,ImageUrl:r.ImageURL,Metadata:{Brand:r.Brand,Price:r.Price,CompareAtPrice:r.CompareAtPrice}};window.klaviyo.push(["trackViewedItem",c]),window.geq?.event("Viewed Product Reclaim",c)},t.logAddToCartKlaviyo=e=>{if(!i())return;const[t,o]=(0,n.buildProductAndVariant)(e),r={Name:t.title,ProductID:t.id,ImageURL:t.image,Handle:t.handle,Brand:t.vendor,Price:t.price??o.price};window.klaviyo.push(["track","Added to Cart",r]),window.geq?.addToCart(r)},t.loadKlaviyoSubscribe=()=>{if(!window.__APP_CONFIG__?.ANALYTICS)return;const{KLAVIYO_DELAY:e=0}=window.__APP_CONFIG__.ANALYTICS,t={src:"//www.klaviyo.com/media/js/public/klaviyo_subscribe.js",id:"klaviyo-subscribe-script",timeout:1e3*e,anonymous:!1};(0,n.loadScriptWithDelay)(t,(()=>{window.KlaviyoSubscribe?window.KlaviyoSubscribe.attachToForms("#footer_email_signup",{hide_form_on_success:!0}):console.warn("KlaviyoSubscribe not found")}))}},129:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadFacebookSdk=function(){var e,t,o,n,i,r;e=window,t=document,o="script",e.fbq||(n=e.fbq=function(){n.callMethod?n.callMethod.apply(n,arguments):n.queue.push(arguments)},e._fbq||(e._fbq=n),n.push=n,n.loaded=!0,n.version="2.0",n.queue=[],(i=t.createElement(o)).async=!0,i.src="https://connect.facebook.net/en_US/fbevents.js",(r=t.getElementsByTagName(o)[0]).parentNode.insertBefore(i,r))}},132:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadTikTokScript=function(e){!function(t,o,n){t.TiktokAnalyticsObject=n;var i=t[n]=t[n]||[];i.methods=["page","track","identify","instances","debug","on","off","once","ready","alias","group","enableCookie","disableCookie"],i.setAndDefer=function(e,t){e[t]=function(){e.push([t].concat(Array.prototype.slice.call(arguments,0)))}};for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadLoyaltyLion=function(e){return new Promise(((t,o)=>{if(window.loyaltylion&&(window.loyaltylion=window.lion=void 0,function(){for(const e of document.querySelectorAll("[data-lion-react-container]"))e.remove();for(const e of document.querySelectorAll("#loyaltylion"))e.remove()}()),!e.loyaltylion_token||!window.__APP_CONFIG__?.ANALYTICS.LOYALTYLION_ENABLED)return console.log("LoyaltyLion wasn't loaded because it isn't enabled for this site."),void t();"function"==typeof window.requestIdleCallback?window.requestIdleCallback((()=>{i(e,t,o)})):setTimeout((()=>{i(e,t,o)}),0)}))};const n=o(134);function i({loggedIn:e,id:t,email:o,first_name:i,last_name:r,loyaltylion_has_account:a,loyaltylion_token:c,rechargeHash:d,loyaltylion_auth_token:l,date:s},u,_){try{(0,n.loadScript)(),a&&e&&o?window.loyaltylion?.init({token:c??"",customer:{id:t??"",email:o,name:`${i??""} ${r??""}`,rechargeHash:d??""},auth:{date:s??"",token:l??""}}):window.loyaltylion?.init({token:c??""}),window.loyaltylion?.on("ready",(()=>{setTimeout((()=>{u()}),0)}))}catch(e){console.error(`Could not load LoyaltyLion: ${JSON.stringify(e)}`),_(e)}}},134:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadScript=function(){!function(e,t){function o(t){var o=e.getElementsByTagName("script")[0],n=e.createElement("script");n.src=t,n.crossOrigin="",n.onload=e=>{e.target.parentNode.removeChild(e.target)},o.parentNode.insertBefore(n,o)}if(!t.isLoyaltyLion){window.loyaltylion=t,void 0===window.lion&&(window.lion=t),t.version=2,t.isLoyaltyLion=!0;var n=new Date,i=n.getFullYear().toString()+n.getMonth().toString()+n.getDate().toString();o("https://sdk.loyaltylion.net/static/2/loader.js?t="+i);var r=!1;t.init=function(e){if(r)throw new Error("Cannot call lion.init more than once");r=!0;var a=t._token=e.token;if(!a)throw new Error("Token must be supplied to lion.init");for(var c=[],d="_push configure bootstrap shutdown on removeListener authenticateCustomer".split(" "),l=0;l(window.addEventListener("unhandledrejection",r),window.addEventListener("error",r),()=>{window.removeEventListener("unhandledrejection",r),window.removeEventListener("error",r)})),[])},t.logOutsmartlyError=r;const n=o(3),i=o(5);function r(e,t){if("undefined"==typeof window||!window.__APP_CONFIG__)return;const{postLogger:o,rid:n,vid:i,startTimestamp:r,headTimestamp:a}=window.__APP_CONFIG__;if(o){const c=Math.floor(window.performance.now());o({table:"error",row:{rid:n,vid:i,timelineMark:r+c,elapsedTime:c,headTimestamp:a,source:t??location.pathname,message:"message"in e?e.message:JSON.stringify(e.reason),error:"stack"in e?e.stack:JSON.stringify(e)}})}}function a(e,t){if(!window.__APP_CONFIG__)return;const{postLogger:o,startTimestamp:n,rid:i,vid:r}=window.__APP_CONFIG__;if(!o)return;const a=Math.floor(window.performance.now());o({table:"outcome",row:{rid:i,vid:r,outcome:e,timelineMark:n+a,elapsedTime:a,pathname:window.location.pathname,metadata:t}})}function c(e,t){return[{key:"eventId",value:t},{key:"handle",value:e.handle},{key:"title",value:e.title},{key:"productId",value:e.id},{key:"productType",value:e.productType??"NA"},{key:"imageUrl",value:e.image??"NA"},{key:"vendor",value:e.vendor??"NA"},{key:"price",value:e.price},{key:"compareAtPrice",value:e.compareAtPrice??e.price}].filter((e=>void 0!==e.value))}function d(e){return e.selectedOptions?e.selectedOptions.map((({name:e="NA",value:t="NA"})=>({key:e,value:t}))):e.optionMap?[{key:"Color",value:e.optionMap.Color},{key:"Size",value:e.optionMap.Size}]:[]}t.logOutsmartlyPageView=e=>{if("undefined"==typeof window||!window.__APP_CONFIG__)return;const{postLogger:t,rid:o,vid:n,startTimestamp:i}=window.__APP_CONFIG__;if(!t)return;const r=Math.floor(window.performance.now());t({table:"outcome",row:{outcome:"PageView",rid:o,vid:n,timelineMark:i+r,elapsedTime:r,pathname:location.pathname,entryDepth:window.scrollY,scrollTopOnEntry:window.scrollY,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,documentHeight:0,metadata:[{key:"eventId",value:e}]}})},t.logOutsmartlyViewedProduct=(e,t)=>{const[o]=(0,i.buildProductAndVariant)(e);"undefined"!=typeof window&&a("ViewProduct",c(o,t))},t.logOutsmartlySelectedVariant=(e,t)=>{const[o,n]=(0,i.buildProductAndVariant)(e);"undefined"!=typeof window&&a("ViewProductVariant",[...c(o,t),{key:"variantId",value:n.id??""},{key:"eventId",value:t},...d(n)])}},37:function(e,t,o){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.logPinterestCollectionView=t.logAddToCartPinterest=t.logPinterestPageView=t.loadPinterest=void 0;const i=n(o(97)),r=o(5);t.loadPinterest=()=>{if(!window.__APP_CONFIG__?.ANALYTICS)return;const{PINTEREST_ID:e}=window.__APP_CONFIG__.ANALYTICS;if(e)try{(0,i.default)(e),(new Image).src=`https://ct.pinterest.com/v3/?tid=${e}&noscript=1`}catch(e){console.error(e)}},t.logPinterestPageView=async(e,t)=>{if(!window.__APP_CONFIG__?.ANALYTICS)return;const{PINTEREST_ID:o}=window.__APP_CONFIG__.ANALYTICS;if(!o)return;const n=await t;if(n)(new Image).src=["https://ct.pinterest.com/v3/?event=PageVisit",`&tid=${o}`,n.loggedIn&&n.hashedEmail?`&pd[em]=${n.hashedEmail}`:""].join("");else try{window.pintrk("track","checkout"),(new Image).src=`https://ct.pinterest.com/v3/?tid=${o}&event=pageview&noscript=1`}catch(e){console.error(e)}},t.logAddToCartPinterest=e=>{if(!window.__APP_CONFIG__?.ANALYTICS)return;const{PINTEREST_ID:t}=window.__APP_CONFIG__.ANALYTICS;if(!t)return;const[o,n]=(0,r.buildProductAndVariant)(e);(new Image).src=["https://ct.pinterest.com/v3/?event=AddToCart",`&tid=${t}`,`&ed[line_items][0][product_id]=${o.id??""}`,`&ed[line_items][0][product_variant_id]=${n.id??""}`,`&ed[line_items][0][product_price]=${n.price??""}`,"&ed[line_items][0][product_quantity]=1",`&ed[line_items][0][product_name]=${window.encodeURIComponent(`${o.title??""} - ${n.title??""}`)}`].join("")},t.logPinterestCollectionView=()=>{if(!window.__APP_CONFIG__?.ANALYTICS)return;const{PINTEREST_ID:e}=window.__APP_CONFIG__.ANALYTICS;e&&((new Image).src=["https://ct.pinterest.com/v3/?event=ViewCategory",`&tid=${e}`].join(""))}},97:e=>{"use strict";e.exports=function(e){!function(){if(!window.pintrk){window.pintrk=function(){window.pintrk.queue.push(Array.prototype.slice.call(arguments))};var e=window.pintrk;e.queue=[],e.version="3.0";var t=document.createElement("script");t.async=!0,t.src="https://s.pinimg.com/ct/core.js";var o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(t,o)}}(),window.pintrk("load",e),window.pintrk("page")}},130:(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logShopifyPageView=t.logShopifyViewContent=t.logAddToCartShopify=void 0;const n=o(5);let i="";async function r(e){await fetch("https://monorail-edge.shopifysvc.com/unstable/produce_batch",{headers:{"content-type":"text/plain"},referrerPolicy:"strict-origin-when-cross-origin",body:JSON.stringify(e),method:"POST",mode:"cors",credentials:"omit"})}function a(e,t,o){const r=function(e,t,o){const r=(0,n.readCookie)("_shopify_y"),a=Date.now(),{SHOP_ID:c,STORE_URL:d}=window.__APP_CONFIG__??{},l=`${d??""}${document.location.pathname}${document.location.search}`,s=o?[JSON.stringify(o)]:void 0;return{schema_id:"storefront_customer_tracking/2.2",payload:{test_event_code:(0,n.readCookie)("test_event_code"),event_id:t,event_name:e,products:s,total_value:o?o.price:void 0,currency:o?"USD":void 0,shop_id:c,event_time:a,event_source_url:l,unique_token:r,page_id:i,source:"trekkie",ccpa_enforced:!1,gdpr_enforced:!1,s2s_event_id:null,expect_s2s_event_id:!1,expect_s2s_emit:!1,s2s_event_id_source:null},metadata:{event_created_at_ms:a}}}(e,t,o);return{metadata:{event_sent_at_ms:Date.now()},events:[r]}}function c(e,t){const o=`${e.title??""} - ${t.title??""}`;return{variant_id:t.id,product_id:e.id,product_gid:`gid://shopify/Product/${e.id??""}`,name:o,price:Number.parseFloat(t.price??"0"),sku:t.sku,brand:t.brand,variant:o,category:"",quantity:e.quantity}}t.logAddToCartShopify=async(e,t)=>{const[o,i]=(0,n.buildProductAndVariant)(e),d=a("Added Product",t,c(o,i));0!==d.events.length&&await r(d)},t.logShopifyViewContent=async(e,t)=>{const[o,i]=(0,n.buildProductAndVariant)(e),d=a("Viewed Product",t,c(o,i));0!==d.events.length&&await r(d)},t.logShopifyPageView=async(e,t)=>{const o=await t;if(!o||!window.__APP_CONFIG__)return;const c=o.loggedIn?Number.parseInt(o.id??"0"):void 0,d=(0,n.readCookie)("_shopify_y"),l=(0,n.readCookie)("_shopify_s"),s=(0,n.readCookie)("_shopify_fs"),u=Date.now(),_=document.location.pathname,p=document.location.search,{SHOP_ID:w,STORE_URL:y}=window.__APP_CONFIG__,g=`${y}${_}${p}`;i=(0,n.uuid)();const f=a("Page View",e),m=_.includes("/products/")?"product":_.includes("/collections/")?"collection":"home",v={schema_id:"trekkie_storefront_page_view/1.2",payload:{name:null,referrer:"",path:_,search:p,url:g,properties:{},eventId:e,pageType:m,shopId:w,isMerchantRequest:null,contentLanguage:"en",currency:"USD",customerId:c,appName:"storefront",uniqToken:d,visitToken:l,microSessionId:(0,n.uuid)(),microSessionCount:1,firstSeen:s,isPersistentCookie:!0,eventType:"page"},metadata:{event_created_at_ms:u}};f.events.push(v),await r(f)}},98:(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logAddToCartSnapchat=t.logSnapchatViewContent=t.logSnapchatPageView=t.loadSnapchat=void 0;const n=o(5);t.loadSnapchat=e=>{if(!window.__APP_CONFIG__?.ANALYTICS)return;const{SNAPCHAT_ID:t,SNAPCHAT_DELAY:o=0}=window.__APP_CONFIG__.ANALYTICS;if(!t)return;if(!window.snaptr){const e=(...t)=>{e.handleRequest?e.handleRequest.apply(e,t):e.queue.push(t)};e.queue=[],window.snaptr=e}const i={src:"//sc-static.net/scevent.min.js",id:"snapchat-script",timeout:1e3*o,anonymous:!1};(0,n.loadScriptWithDelay)(i),window.snaptr&&window.snaptr("init",t,{user_email:e.email})},t.logSnapchatPageView=()=>{if(!window.__APP_CONFIG__?.ANALYTICS)return;const{SNAPCHAT_ID:e}=window.__APP_CONFIG__.ANALYTICS;e&&window.snaptr&&window.snaptr("track","PAGE_VIEW")},t.logSnapchatViewContent=e=>{if(!window.__APP_CONFIG__?.ANALYTICS)return;const{SNAPCHAT_ID:t}=window.__APP_CONFIG__.ANALYTICS;if(!t||!window.snaptr)return;const[o,i]=(0,n.buildProductAndVariant)(e);window.snaptr("track","VIEW_CONTENT",{currency:"USD",item_category:o.id,item_ids:i.id,description:`${o.title??""} - ${i.title??""}`,price:i.price})},t.logAddToCartSnapchat=e=>{const[t,o]=(0,n.buildProductAndVariant)(e);if(!window.__APP_CONFIG__?.ANALYTICS)return;const{SNAPCHAT_ID:i}=window.__APP_CONFIG__.ANALYTICS;i&&window.snaptr&&window.snaptr("track","ADD_CART",{currency:"USD",item_category:t.id,item_ids:o.id,description:`${t.title??""} - ${o.title??""}`,price:o.price})}},131:(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logTikTokViewContent=t.logAddToCartTikTok=t.loadTikTok=void 0;const n=o(5),i=o(132);function r(e,t,o){return[{content_id:e.id,content_type:"product",content_name:`${e.title??""} - ${t.title??""}`,quantity:1,price:t.price,curency:(0,n.readCookie)("cartCurrency")??"USD"},{event_id:o}]}t.loadTikTok=()=>{if(!window.__APP_CONFIG__?.ANALYTICS)return;const{TIKTOK_ID:e}=window.__APP_CONFIG__.ANALYTICS;e&&void 0===window.ttq&&(0,i.loadTikTokScript)(e)},t.logAddToCartTikTok=(e,t)=>{const[o,i]=(0,n.buildProductAndVariant)(e);try{void 0!==window.ttq&&window.ttq.track("AddToCart",...r(o,i,t))}catch(e){console.log(e)}},t.logTikTokViewContent=(e,t)=>{const[o,i]=(0,n.buildProductAndVariant)(e);try{void 0!==window.ttq&&window.ttq.track("ViewContent",...r(o,i,t))}catch(e){console.log(e)}}},5:(e,t,o)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cartItemToBentoAnalyticsItem=t.getItemCounts=t.getOldCart=t.updateCart=t.safeParse=t.normalizeCart=t.buildProductAndVariant=void 0,t.loadScript=r,t.loadScriptWithDelay=function(e,t=()=>{}){const{src:o,id:n,useRequestIdleCallback:a}=e;if(document.querySelector(`#${n}`))"function"==typeof window.requestIdleCallback?window.requestIdleCallback(t):window.setTimeout(t,0);else if(a&&"function"==typeof window.requestIdleCallback)window.requestIdleCallback((()=>{r(e,t)}));else{const n=e.timeout||window.scriptDelayTime||1e4;i[o]=window.setTimeout(r,n,e,t)}},t.readCookie=a,t.entries=function(e){return Object.entries(e)},t.callOrlyTagHooks=async function(e,...t){const o=[];if(window._orlyTags)for(const[n,i]of window._orlyTags)n===e&&o.push(i(...t).catch((o=>{const n=new Error(`callOrlyTagHooks: error in type: ${e}\n params: ${JSON.stringify(t,void 0,2)}\n error: ${JSON.stringify(o)}`);return console.error(n),n})));await Promise.allSettled(o)},t.isShopifyCartItem=c,t.isShopifyCartError=function(e){return"object"!=typeof e||null===e?(console.log("not even an object!"),!1):"string"==typeof e.message},t.isShopifyCart=d,t.waitForShopifyY=async function(){await(0,n.loadShopifyAccount)().catch((e=>{console.error("Could not load accout before getting _shopify_y",e)}));const e=a("_shopify_y");return e||console.error("_shopify_y should be defined"),e},t.uuid=function(){let e="";try{const t=window.crypto||window.msCrypto,o=new Uint16Array(31);t.getRandomValues(o);let n=0;e=s.replace(/[x]/g,(function(e){for(let e=[],t=1;t>>0}catch(t){e=(new Date).getTime()>>>0}try{t=performance.now()>>>0}catch(e){t=0}const o=Math.abs(e+t).toString(16).toLowerCase();return"00000000".substring(0,8-o.length)+o}()+"-"+e},t.cancellableFetch=function(e,t={}){const o=new AbortController,{signal:n}=o;return{response:fetch(e,{...t,signal:n}),cancel:()=>{o.abort()}}},t.sha256=async function(e){const t=(new TextEncoder).encode(e),o=await crypto.subtle.digest("SHA-256",t);return[...new Uint8Array(o)].map((e=>e.toString(16).padStart(2,"0"))).join("")},t.imagePixel=function(e){const t=new Image;t.height=1,t.width=1,t.setAttribute("style","display:none;"),t.src=e,document.body.append(t)},t.ccpa_dns=function(){return/__ccpa_dns=true/.test(document.cookie)};const n=o(19),i={};function r(e,t=()=>{}){const{src:o,id:n,anonymous:r=!0}=e;if(i[o]&&window.clearTimeout(i[o]),document.querySelector(`#${n}`))return;const a=document.createElement("script");a.src=o,a.defer=!0,a.id=n,r&&(a.crossOrigin="anonymous"),a.addEventListener("load","function"==typeof window.requestIdleCallback?()=>window.requestIdleCallback(t):t),document.body.append(a)}function a(e){const t=decodeURIComponent(document.cookie).match(/[^\s,;=]+=[^\s,;=]+/g);if(t)for(const o of t){const[t,n]=o.split("=");if(t===e)return n}}function c(e){const t=e;return"string"==typeof t.key&&"number"==typeof t.quantity}function d(e){if("object"!=typeof e||null===e)return console.log("not even an object!"),!1;const{items:t}=e;return Array.isArray(t)&&t.every((e=>c(e)))}t.buildProductAndVariant=e=>[{id:e.product_id?.toString(),handle:e.handle,title:e.product_title,tags:[],price:e.price?.toString(),compareAtPrice:e.original_price?.toString(),vendor:e.vendor,productType:e.product_type,image:e.image,quantity:e.quantity},{id:e.variant_id?.toString(),sku:e.sku,brand:e.vendor,title:e.variant_title,price:e.price?.toString(),selectedOptions:e.options_with_values}],t.normalizeCart=e=>{return{...e,items:(t=e.items,t.map((e=>({...e,price:.01*e.price,original_price:.01*e.original_price,final_line_price:.01*e.final_line_price,final_price:.01*e.final_price,original_line_price:.01*e.original_line_price,line_price:.01*e.line_price})))),total_price:.01*e.total_price,total_discount:.01*e.total_discount,original_total_price:.01*e.original_total_price,items_subtotal_price:.01*e.items_subtotal_price};var t},t.safeParse=e=>{try{return JSON.parse(e)}catch(t){console.error("Could not parse as JSON:",e,"\nerror:",t)}};const l="outsmartly-shopify-cart";t.updateCart=e=>{window.localStorage.setItem(l,JSON.stringify(e))},t.getOldCart=()=>{const e=window.localStorage.getItem(l)||"";if(!e||0===e.length)return;const o=(0,t.safeParse)(e);return d(o)?o:void 0},t.getItemCounts=e=>{const t=new Map;for(const o of e){const e=t.get(o.id);e?e.quantity+=o.quantity:t.set(o.id,{...o})}return t};const s="xxxx-4xxx-xxxx-xxxxxxxxxxxx";t.cartItemToBentoAnalyticsItem=e=>{const t={src:e.featured_image?.url,alt:e.featured_image?.alt,width:e.featured_image?.width,aspect_ratio:e.featured_image?.aspect_ratio};return{product:{id:e.product_id,compare_at_price:e.original_price,price:e.price,selectedOptions:[],title:e.product_title,url:e.url,vendor:e.vendor,type:e.product_type,image:t},selected_variant:{id:e.variant_id,compare_at_price:e.original_price,price:e.price,sku:e.sku,url:e.url,inventory_quantity:1,title:e.variant_title,image:t},quantity:e.quantity}}},99:e=>{e.exports=function(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,o){return t.apply(this,arguments)};case 3:return function(e,o,n){return t.apply(this,arguments)};case 4:return function(e,o,n,i){return t.apply(this,arguments)};case 5:return function(e,o,n,i,r){return t.apply(this,arguments)};case 6:return function(e,o,n,i,r,a){return t.apply(this,arguments)};case 7:return function(e,o,n,i,r,a,c){return t.apply(this,arguments)};case 8:return function(e,o,n,i,r,a,c,d){return t.apply(this,arguments)};case 9:return function(e,o,n,i,r,a,c,d,l){return t.apply(this,arguments)};case 10:return function(e,o,n,i,r,a,c,d,l,s){return t.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}},100:(e,t,o)=>{var n=o(101);e.exports=function(e){return function t(o){return 0===arguments.length||n(o)?t:e.apply(this,arguments)}}},101:e=>{e.exports=function(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}},43:(e,t,o)=>{var n=o(99),i=o(100)((function(e){var t,o=!1;return n(e.length,(function(){return o?t:(o=!0,t=e.apply(this,arguments))}))}));e.exports=i}}]);