"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[13],{41:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.logViewCollection=t.logViewProduct=t.logCartView=t.logPageView=void 0;const n=i(275),o=(...e)=>{try{return parseInt(...e)}catch{return}},r=(...e)=>{try{return parseFloat(...e)}catch{return}};t.logPageView=()=>{if("undefined"!=typeof window)return(0,n.initBentoAnalytics)({elevar:!0})},t.logCartView=()=>{if("undefined"!=typeof window)return(0,t.logPageView)()?.then((()=>(0,n.logViewCart)()))},t.logViewProduct=async(e,i)=>{if("undefined"==typeof window)return;const a=r(i?.price.amount)??0,l=r(i.compareAtPrice?.amount??"0")??0;return(0,t.logPageView)()?.then((()=>(0,n.logViewContent)({discounted_price:l,discounts:[],featured_image:{aspect_ratio:1,height:0,width:0,url:window.location.origin+e.featuredImage.src,alt:e.featuredImage.alt},final_line_price:a,final_price:a,gift_card:!1,grams:0,inventory:1,handle:e.handle,id:e.id,image:i.image.src,key:i.sku??e.id,line_level_discount_allocations:[],line_level_total_discount:0,line_price:a,options_with_values:[],original_line_price:l,original_price:l,price:r(i.price.amount)??0,product_description:e.description,product_has_only_default_variant:e.variants.length<=1,product_id:o(e.id)??0,product_title:e.title,product_type:e.collections.join(",")||"unknown",properties:{},quantity:1,requires_shipping:!0,sku:i.sku,taxable:!0,title:e.title,total_discount:l?l-a:0,url:window.location.href,variant_id:o(i.id)??0,variant_options:i.selectedOptions.map((e=>`${e.name}: ${e.value}`)),variant_title:i.title,vendor:e.vendor})))},t.logViewCollection=async({collection:e,product:i,variant:a})=>{if("undefined"==typeof window)return;const l=e?.id.split("/").pop(),c={title:e?.title||e?.handle||"",id:o(l??"0")??0,url:window.location.href},d=[{product:{compare_at_price:r(i.variant_compare_at_price),id:o(i.id),image:{aspect_ratio:1,width:0,src:i.images[0]?.src||"",alt:i.title},price:r(i.priceRange.minVariantPrice.amount),selectedOptions:[],title:i.title,url:i.handle,vendor:i.vendor,type:i.collections.join(",")||"unknown"},selected_variant:{compare_at_price:r(a?.compareAtPrice?.amount??"0"),id:o(a?.id),image:{aspect_ratio:1,width:0,src:a?.image.src||"",alt:a?.title},price:r(a?.price.amount),sku:a?.sku,title:a?.title,inventory_quantity:a?.quantityAvailable,url:a?.id||""},quantity:i.totalInventory}];(0,t.logPageView)()?.then((()=>(0,n.logCollectionView)(c,d)))}}}]);