const t=function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:scData?.currency;return["BIF","BYR","CLP","DJF","GNF","ISK","JPY","KMF","KRW","PYG","RWF","UGX","VND","VUV","XAF","XAG","XAU","XBA","XBB","XBC","XBD","XDR","XOF","XPD","XPF","XPT","XTS"].includes(n?.toUpperCase())?t:t/100};window.addEventListener("scSearched",(function(t){const{searchString:n,searchResultIds:e}=t.detail;window.fbq("track","Search",{search_string:n,content_ids:e})})),window.addEventListener("scAddedToCart",(function(t){const n=t.detail;if(!n?.price?.product)return;const e=n?.price?.product,c=e?.product_collections?.data?.map((t=>t.name))||[];window.fbq("track","AddToCart",{...c.length?{content_category:c.join(", ")}:{},content_ids:[e.id],content_name:e?.name+(n?.variant_options?.length?` - ${n?.variant_options.join(" / ")}`:""),content_type:"product",contents:[{id:e.id,quantity:n.quantity}],currency:n?.price?.currency,value:n?.price?.converted_amount||0})})),window.addEventListener("scProductViewed",(function(n){const e=n.detail;window.fbq("track","ViewContent",{content_ids:[e.id],content_category:e?.product_collections?.data?.map((t=>t.name)).join(", "),content_name:e?.name+(e?.variant_options?.length?` - ${e?.variant_options.join(" / ")}`:""),content_type:"product",contents:[{id:e.id,quantity:1}],currency:e?.price?.currency,value:t(e.price?.amount||0,e.price?.currency||"USD")})}));