1(()=>{"use strict";const TOKEN="phc_kk9L8b6dDCqfbBLTXJcXhAjBkXSZ8574FvmEqUcx9sB9",VERSION="spqr-2026-09-25-v1",BRIDGE="spqr_ph_bridge_v1",ATTR="spqr_ph_attribution_v1";if(window.spqrPostHogInstalled||!/^(www\.)?spqrshop\.com$/.test(location.hostname)||/^\/(account|challenge|checkouts?)(\/|$)/.test(location.pathname))return;window.spqrPostHogInstalled=!0;const config=document.querySelector("[data-spqr-posthog]"),page=location.pathname,params=new URLSearchParams(location.search),privateSelector='input,textarea,select,[contenteditable],.ph-no-capture,.ph-mask,.cart__item--properties,[data-engraving-input],[data-spqr-custom-input],[data-spqr-engraving],form[action*="/contact"]';let ph,started=!1,allowed=!1,attribution={},qa=!1,pageviewID,activeSeconds=0,visibleSeconds=0,lastTick=performance.now(),lastInput=performance.now(),maximumScroll=0,flushedAt=performance.now(),bridgeAt=0;const scrollSent=new Set,sectionSeen=new Set,sectionTimers=new Map,getJSON=key=>{try{return JSON.parse(localStorage.getItem(key)||"null")}catch{return null}},putJSON=(key,val)=>{try{localStorage.setItem(key,JSON.stringify(val))}catch{}},cleanText=value=>String(value||"").replace(/[\w.+-]+@[\w.-]+\.[a-z]{2,}/gi,"[redacted]").replace(/ph[xcs]_[\w-]+/g,"[redacted]").slice(0,180);function cleanURL(value){try{const u=new URL(value,location.origin);if(!/^https?:$/.test(u.protocol))return"";const path=/^\/(account|checkouts?)(\/|$)/.test(u.pathname)?"/private":u.pathname;return u.origin+path}catch{return""}}function consentAllowed(){try{return window.Shopify?.customerPrivacy?.analyticsProcessingAllowed?.()===!0}catch{return!1}}function saveBridge(){if(!ph||!allowed)return;const data={distinct_id:ph.get_distinct_id(),session_id:ph.get_session_id(),pageview_id:pageviewID,attribution,spqr_qa:qa,updated_at:Date.now()};putJSON(BRIDGE,data);try{document.cookie=BRIDGE+"="+encodeURIComponent(JSON.stringify(data))+"; Path=/; Max-Age=1800; SameSite=Lax; Secure; Domain=spqrshop.com"}catch{}bridgeAt=Date.now()}function capture(event,props={},instant=!1){!allowed||!ph||!consentAllowed()||(Date.now()-bridgeAt>1e4&&saveBridge(),ph.capture(event,{...attribution,page,page_type:config?.dataset.pageType||"other",pageview_id:pageviewID,theme_id:config?.dataset.themeId,measurement_version:VERSION,spqr_qa:qa,traffic_type:qa?"internal":"customer",...props},instant?{send_instantly:!0}:void 0))}function tick(){const now=performance.now(),seconds=Math.min(2,Math.max(0,(now-lastTick)/1e3));lastTick=now,!(!allowed||document.visibilityState!=="visible")&&(visibleSeconds+=seconds,document.hasFocus()&&now-lastInput<=3e4&&(activeSeconds+=seconds))}function flush(reason){tick(),!(visibleSeconds<.1||!allowed)&&(capture("page_attention",{active_seconds:Math.round(activeSeconds*10)/10,visible_seconds:Math.round(visibleSeconds*10)/10,max_scroll_percent:maximumScroll,reason},!0),activeSeconds=0,visibleSeconds=0,flushedAt=performance.now())}function scrollDepth(){const available=document.documentElement.scrollHeight-innerHeight,pct=available>0?Math.min(100,Math.round(scrollY/available*100)):100;maximumScroll=Math.max(maximumScroll,pct),[25,50,75,90,100].forEach(threshold=>{pct>=threshold&&!scrollSent.has(threshold)&&allowed&&(scrollSent.add(threshold),capture("scroll_depth",{scroll_percent:threshold}))})}function setupBehavior(){["pointerdown","keydown","scroll","touchstart"].forEach(name=>document.addEventListener(name,()=>{lastInput=performance.now()},{passive:!0})),document.addEventListener("scroll",scrollDepth,{passive:!0}),setInterval(()=>{tick(),performance.now()-flushedAt>=15e3&&flush("heartbeat"),allowed&&Date.now()-bridgeAt>15e3&&saveBridge()},1e3),document.addEventListener("visibilitychange",()=>{document.hidden?(flush("hidden"),sectionTimers.forEach(clearTimeout),sectionTimers.clear()):(lastTick=performance.now(),lastInput=lastTick,observeSections())}),window.addEventListener("pagehide",()=>flush("pagehide")),document.addEventListener("click",event=>{const el=event.target.closest?.('a,button,summary,[role="button"]');if(!el||el.closest(privateSelector))return;const label=cleanText(el.getAttribute("aria-label")||el.querySelector("[data-add-to-cart-text]")?.textContent||el.textContent).trim().replace(/\s+/g," ").slice(0,100),section=el.closest('[id^="shopify-section-"]')?.id||"global",target=el.href?cleanURL(el.href):"";capture("interaction_click",{element_id:cleanText(el.id||el.getAttribute("data-spqr-journey")||el.getAttribute("name")||el.tagName.toLowerCase()+":"+label),label,section,target_path:target?new URL(target).pathname:"",element_tag:el.tagName.toLowerCase()}),el.matches('[data-add-to-cart],[name="add"]')&&capture("add_to_cart_clicked"),(el.matches('[data-spqr-buy-now],[name="checkout"]')||/\/checkout\b/.test(el.getAttribute("href")||""))&&capture("checkout_clicked"),el.matches("[data-engraving-toggle]")&&capture("engraving_opened")},!0),document.addEventListener("change",event=>{const el=event.target;el.matches?.('input[name="Size"],input[name="Material"],select[name="Size"],select[name="Material"],select[name="sort_by"],input[name^="filter."]')&&capture(el.name==="sort_by"||el.name.startsWith("filter.")?"collection_filter_changed":"product_option_selected",{option_name:cleanText(el.name),option_value:cleanText(el.value),product_id:config?.dataset.productId||void 0})}),document.addEventListener("spqr:journey",event=>capture("discovery_interaction",{action:cleanText(event.detail?.action),subject:cleanText(event.detail?.subject)})),document.addEventListener("ajaxProduct:error",()=>capture("cart_error",{error_type:"add_to_cart_failed"})),document.addEventListener("cart:open",()=>capture("cart_drawer_opened"));const errorSeen=new WeakSet;new MutationObserver(()=>{document.querySelectorAll("[data-spqr-checkout-error],.errors,.product-form__error-message-wrapper").forEach(el=>{!el.hidden&&el.offsetHeight>0&&el.textContent.trim()&&!errorSeen.has(el)&&(errorSeen.add(el),capture("cart_error",{error_type:/size/i.test(el.textContent)?"size_required":"purchase_form_error"}))})}).observe(document.body,{subtree:!0,attributes:!0,attributeFilter:["hidden","class"],childList:!0}),document.querySelectorAll("video").forEach((el,index)=>{["play","pause","ended"].forEach(action=>el.addEventListener(action,()=>capture("video_engagement",{action,video_index:index,video_path:cleanURL(el.currentSrc),video_seconds:Math.round(el.currentTime)})))}),observeSections(),scrollDepth()}let sectionObserver;function observeSections(){window.IntersectionObserver&&(sectionObserver?.disconnect(),sectionObserver=new IntersectionObserver(entries=>
1entries.forEach(entry=>{const id=entry.target.id;if(!entry.isIntersecting){clearTimeout(sectionTimers.get(id)),sectionTimers.delete(id);return}sectionSeen.has(id)||sectionTimers.has(id)||document.hidden||sectionTimers.set(id,setTimeout(()=>{sectionTimers.delete(id),!(!allowed||document.hidden)&&(sectionSeen.add(id),capture("section_exposed",{section:id,exposure_seconds:2}))},2e3))}),{threshold:.1}),document.querySelectorAll('main [id^="shopify-section-"]').forEach(el=>sectionObserver.observe(el)))}function start(){if(started||!consentAllowed())return;started=!0,allowed=!0;try{params.get("spqr_qa")==="1"&&sessionStorage.setItem("spqr_qa","true"),params.get("spqr_qa")==="0"&&sessionStorage.removeItem("spqr_qa"),qa=sessionStorage.getItem("spqr_qa")==="true"||window.Shopify?.designMode===!0||window.Shopify?.theme?.role!=="main"}catch{qa=params.get("spqr_qa")==="1"}const old=getJSON(ATTR),fresh={};["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","campaign_id","adset_id","ad_id"].forEach(key=>{const value=params.get(key);value&&(fresh[key]=cleanText(value))});let ref="";try{ref=new URL(document.referrer).hostname}catch{}!fresh.utm_source&¶ms.has("gclid")&&Object.assign(fresh,{utm_source:"google",utm_medium:"cpc"}),!fresh.utm_source&¶ms.has("fbclid")&&Object.assign(fresh,{utm_source:"facebook",utm_medium:"social"}),Object.keys(fresh).length?(attribution={...fresh,landing_page:page,attribution_updated_at:Date.now()},putJSON(ATTR,attribution)):old&&Date.now()-old.attribution_updated_at<90*864e5?attribution=old:attribution={utm_source:ref&&!/^(www\.)?spqrshop\.com$/.test(ref)?ref:"direct",utm_medium:ref?"referral":"none",landing_page:page,attribution_updated_at:Date.now()};const sdk=document.createElement("script");sdk.async=!0,sdk.src="https://eu-assets.i.posthog.com/static/array.js",sdk.onload=()=>{if(!consentAllowed()){started=!1,allowed=!1;return}window.posthog.init(TOKEN,{api_host:"https://eu.i.posthog.com",ui_host:"https://eu.posthog.com",defaults:"2026-05-30",person_profiles:"identified_only",capture_pageview:!1,capture_pageleave:!0,autocapture:{dom_event_allowlist:["click","submit"],element_attribute_ignorelist:["value","href","src","title"],capture_copied_text:!1},mask_all_text:!0,mask_all_element_attributes:!0,capture_heatmaps:!0,capture_dead_clicks:!0,mask_personal_data_properties:!0,custom_personal_data_properties:Array.from(params.keys()).filter(key=>!/^utm_|^(campaign_id|adset_id|ad_id|variant|view|spqr_qa)$/.test(key)),capture_performance:{web_vitals:!0,network_timing:!1},capture_exceptions:!0,persistence:"localStorage+cookie",cookie_expiration:90,disable_surveys:!0,enable_recording_console_log:!1,session_recording:{maskAllInputs:!0,maskTextSelector:privateSelector,blockSelector:'iframe,input[type="hidden"],input[type="file"],form[action*="/contact"],.cart__item--properties',recordCrossOriginIframes:!1,recordHeaders:!1,recordBody:!1,streamNetworkBody:!1,captureJsonLd:!1,maskCapturedNetworkRequestFn:request=>request.isInitial?{...request,name:cleanURL(request.name),requestBody:void 0,responseBody:void 0,requestHeaders:void 0,responseHeaders:void 0}:null,maskAttributeFn:(name,value,el)=>/^(href|action)$/i.test(name)?cleanURL(value):/value|email|phone|customer|engraving|token|password/i.test(name)||el?.matches?.("input,textarea,select")?"[redacted]":value},before_send:event=>{if(!consentAllowed())return null;const scrub=(value,key,depth)=>{if(depth>15)return value;if(typeof value=="string"){if(/pathname/i.test(key))try{return new URL(cleanURL(value)).pathname}catch{return""}return/url|href|referrer/i.test(key)?cleanURL(value):value.replace(/[\w.+-]+@[\w.-]+\.[a-z]{2,}/gi,"[redacted]").replace(/ph[xs]_[\w-]+/g,"[redacted]")}return Array.isArray(value)?value.map(v=>scrub(v,key,depth+1)):(value&&typeof value=="object"&&Object.keys(value).forEach(k=>{/^(email|phone|address|engraving|customer|token|password)$/i.test(k)?delete value[k]:value[k]=scrub(value[k],k,depth+1)}),value)};return event.event!=="$snapshot"&&scrub(event.properties,"",0),event.properties.token=TOKEN,event.properties.spqr_qa=qa,event.properties.measurement_version=VERSION,event},loaded:instance=>{ph=instance,window.spqrPostHog=instance,pageviewID=crypto.randomUUID(),ph.register({...attribution,page,page_type:config?.dataset.pageType||"other",pageview_id:pageviewID,spqr_qa:qa,measurement_version:VERSION}),saveBridge(),capture("$pageview"),lastTick=performance.now(),lastInput=lastTick,flushedAt=lastTick,setupBehavior()}})},sdk.onerror=()=>{started=!1},document.head.appendChild(sdk)}function consentChanged(){if(consentAllowed())ph?(allowed=!0,ph.opt_in_capturing({captureEventName:!1}),ph.startSessionRecording(),saveBridge()):start();else{allowed=!1,activeSeconds=0,visibleSeconds=0,ph?.stopSessionRecording(),ph?.opt_out_capturing();try{localStorage.removeItem(BRIDGE),localStorage.removeItem(ATTR),document.cookie=BRIDGE+"=; Path=/; Max-Age=0; Domain=spqrshop.com"}catch{}}}document.addEventListener("visitorConsentCollected",consentChanged),window.Shopify?.customerPrivacy?start():window.Shopify?.loadFeatures?.([{name:"consent-tracking-api",version:"0.1"}],error=>{error||start()})})(); 2//# sourceMappingURL=/cdn/shop/t/65/assets/spqr-posthog.js.map?v=83603086248651833331791105119
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.