PageSourceSearch

https://shopidc.com/web-pixels/strict/app/[email protected]

js shopidc.com collected 2026-09-24 18:34:32 UTC 27,171 bytes, 1 lines download raw bytes

1(()=>{var Fe=Object.defineProperty,Re=Object.defineProperties;var Ne=Object.getOwnPropertyDescriptors;var Y=Object.getOwnPropertySymbols;var Be=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable;var B=(n,t,e)=>t in n?Fe(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,l=(n,t)=>{for(var e in t||(t={}))Be.call(t,e)&&B(n,e,t[e]);if(Y)for(var e of Y(t))Oe.call(t,e)&&B(n,e,t[e]);return n},w=(n,t)=>Re(n,Ne(t));var E=(n,t,e)=>B(n,typeof t!="symbol"?t+"":t,e);var _=(n,t,e)=>new Promise((r,i)=>{var o=a=>{try{c(e.next(a))}catch(p){i(p)}},s=a=>{try{c(e.throw(a))}catch(p){i(p)}},c=a=>a.done?r(a.value):Promise.resolve(a.value).then(o,s);c((e=e.apply(n,t)).next())});var J="WebPixel::Render";var O=n=>shopify.extend(J,n);function G(n,t){n.subscribe("pf_form_submit",e=>{try{let r=e!=null&&typeof e=="object"?l({},e):{};t("pf_form_submit",r)}catch(r){console.warn("PageFly: Error processing pf_form_submit event:",r)}})}function Z(n,t){n.subscribe("pf_add_to_cart",e=>{try{let r=e!=null&&typeof e=="object"?l({},e):{};t("pf_add_to_cart",r)}catch(r){console.warn("PageFly: Error processing pf_add_to_cart event:",r)}})}function H(n,t){n.subscribe("pf_conversion",e=>{try{let r=e!=null&&typeof e=="object"?l({},e):{};t("pf_conversion",r)}catch(r){console.warn("PageFly: Error processing pf_conversion event:",r)}})}function $(n,t){n.subscribe("pf_dynamic_checkout",e=>{try{let r=e!=null&&typeof e=="object"?l({},e):{};t("pf_dynamic_checkout",r)}catch(r){console.warn("PageFly: Error processing pf_dynamic_checkout event:",r)}})}function Q(n,t){n.subscribe("pf_page_exit",e=>{try{let r=e!=null&&typeof e=="object"?l({},e):{};t("pf_page_exit",r)}catch(r){console.warn("PageFly: Error processing pf_page_exit event:",r)}})}function W(n,t){n.subscribe("pf_view_blog_post",e=>{try{let r=e!=null&&typeof e=="object"?l({},e):{};t("pf_view_blog_post",r)}catch(r){console.warn("PageFly: Error processing pf_view_blog_post event:",r)}})}function ee(n,t){n.subscribe("pf_view_collection",e=>{try{let r=e!=null&&typeof e=="object"?l({},e):{};t("pf_view_collection",r)}catch(r){console.warn("PageFly: Error processing pf_view_collection event:",r)}})}function te(n,t){n.subscribe("pf_view_page",e=>{try{let r=e!=null&&typeof e=="object"?l({},e):{};t("pf_view_page",r)}catch(r){console.warn("PageFly: Error processing pf_view_page event:",r)}})}function ne(n,t){n.subscribe("pf_view_product",e=>{try{let r=e!=null&&typeof e=="object"?l({},e):{};t("pf_view_product",r)}catch(r){console.warn("PageFly: Error processing pf_view_product event:",r)}})}var Me=new Set(["view_page","page_exit","view_product","add_to_cart","remove_from_cart","begin_checkout","purchase","variant_selected","click","scroll","form_submit","section_view","section_click","section_time","section_scroll_depth","section_re_entry","section_scroll_complete","experiment_assigned","custom"]);function f(n){return typeof n=="string"&&n.length>0&&n.length<=2048?n:void 0}var Le=50,De=8192;function Ue(n){if(n===null||typeof n!="object"||Array.isArray(n))return;let t=n;if(!(Object.keys(t).length>Le)){try{if(JSON.stringify(t).length>De)return}catch(e){return}return t}}function Ve(n,t){var c,a,p,u,g,y,x,d;let e=f(n.event_name);if(!e||!Me.has(e))return null;let r=e,i=f(n.visitor_id)||String((c=t.clientId)!=null?c:""),o=(p=f(n.timestamp))!=null?p:String((a=t.timestamp)!=null?a:new Date().toISOString()),s=Ue(n.properties);return{event_name:r,shop_domain:(u=f(n.shop_domain))!=null?u:"unknown",page_id:(g=f(n.page_id))!=null?g:"",visitor_id:i,session_id:(y=f(n.session_id))!=null?y:"",timestamp:o,experiment_id:f(n.experiment_id),variant_id:(x=f(n.variant_id))!=null?x:"control",section_id:f(n.section_id),section_version:f(n.section_version),page_type:(d=f(n.page_type))!=null?d:"ai_sales_page",page_name:f(n.page_name),utm_source:f(n.utm_source),utm_medium:f(n.utm_medium),utm_campaign:f(n.utm_campaign),device_type:f(n.device_type),user_type:f(n.user_type),properties:s!=null?s:{}}}function re(n,t){try{n.subscribe("pagefly:ai_sales_page",e=>{try{let r=e.clientId;if(typeof r!="string"||r.length===0)return;let i=e.customData;if(i===null||typeof i!="object")return;let o=Ve(i,e);if(o===null)return;t.enqueue(o)}catch(r){}})}catch(e){}}var v={page_viewed:{eventType:"page_viewed",enabled:!0,critical:!1},product_viewed:{eventType:"product_viewed",enabled:!0,critical:!1},product_added_to_cart:{eventType:"product_added_to_cart",enabled:!0,critical:!0},product_removed_from_cart:{eventType:"product_removed_from_cart",enabled:!0,critical:!1},cart_viewed:{eventType:"cart_viewed",enabled:!0,critical:!1},checkout_started:{eventType:"checkout_started",enabled:!0,critical:!0},checkout_completed:{eventType:"checkout_completed",enabled:!0,critical:!0},clicked:{eventType:"cta_click",enabled:!0,critical:!1},section_engagement:{eventType:"section_engagement",enabled:!0,critical:!1},section_view:{eventType:"section_view",enabled:!0,critical:!1},section_click:{eventType:"section_click",enabled:!0,critical:!1},section_cta_click:{eventType:"section_cta_click",enabled:!0,critical:!1},section_time:{eventType:"section_time",enabled:!0,critical:!1},section_re_entry:{eventType:"section_re_entry",enabled:!0,critical:!1},section_scroll_complete:{eventType:"section_scroll_complete",enabled:!0,critical:!1}};function h(n){var t,e;return(e=(t=v[n])==null?void 0:t.enabled)!=null?e:!1}function ie(n,t){h("product_added_to_cart")&&n.subscribe("product_added_to_cart",(e=>{var r,i,o;try{let s=(r=e.data)==null?void 0:r.cartLine;if(s&&s.merchandise){let c=s.merchandise;t(v.product_added_to_cart.eventType,{product_id:(i=c.product)!=null&&i.id&&parseInt(c.product.id)||null,variant_id:c.id&&parseInt(c.id
1)||null,quantity:s.quantity||1,price:parseFloat(String(((o=c.price)==null?void 0:o.amount)||0))||0,product_title:c.title||null,variant_title:c.title||null})}}catch(s){console.warn("PageFly: Error processing product_added_to_cart event:",s)}})),h("product_removed_from_cart")&&n.subscribe("product_removed_from_cart",(e=>{var r,i,o;try{let s=(r=e.data)==null?void 0:r.cartLine;s&&s.merchandise&&t(v.product_removed_from_cart.eventType,{product_id:(i=s.merchandise.product)!=null&&i.id&&parseInt(s.merchandise.product.id)||null,variant_id:s.merchandise.id&&parseInt(s.merchandise.id)||null,quantity:s.quantity||0,price:parseFloat(String(((o=s.merchandise.price)==null?void 0:o.amount)||0))||0,cart_items:[],cart_total:0})}catch(s){console.warn("PageFly: Error processing product_removed_from_cart event:",s)}})),h("cart_viewed")&&n.subscribe("cart_viewed",(e=>{var r,i,o;try{let s=(r=e.data)==null?void 0:r.cart;if(s&&s.lines&&Array.isArray(s.lines)){let c=s.lines.map(a=>{var p,u,g,y,x;return{product_id:(u=(p=a.merchandise)==null?void 0:p.product)!=null&&u.id&&parseInt(a.merchandise.product.id)||null,variant_id:(g=a.merchandise)!=null&&g.id&&parseInt(a.merchandise.id)||null,quantity:a.quantity||0,price:parseFloat(String(((x=(y=a.merchandise)==null?void 0:y.price)==null?void 0:x.amount)||0))||0}}).filter(a=>a.product_id!==null);c.length>0&&t(v.cart_viewed.eventType,{cart_items:c,cart_total:parseFloat(String(((o=(i=s.cost)==null?void 0:i.totalAmount)==null?void 0:o.amount)||0))||0,items_count:c.reduce((a,p)=>a+p.quantity,0)})}}catch(s){console.warn("PageFly: Error processing cart_viewed event:",s)}}))}var oe=null;function M(){return oe}function se(n){try{n.subscribe("pagefly:ai_sales_page",t=>{try{let e=t.customData;if(e===null||typeof e!="object"||e.event_name!=="experiment_assigned")return;let r=typeof e.experiment_id=="string"?e.experiment_id:typeof e.experimentId=="string"?e.experimentId:"",i=typeof e.variant_id=="string"?e.variant_id:"",o=typeof e.section_id=="string"?e.section_id:"";if(!r)return;oe={experimentId:r,variantId:i,sectionId:o}}catch(e){}})}catch(t){}}function ae(n,t,e){h("checkout_started")&&n.subscribe("checkout_started",(r=>_(null,null,function*(){var i,o,s;try{if((i=r.data)==null?void 0:i.checkout){let a=(yield(o=e==null?void 0:e.sessionStorage)==null?void 0:o.getItem("PF_SHOP_DOMAIN"))||(yield(s=e==null?void 0:e.localStorage)==null?void 0:s.getItem("PF_SHOP_DOMAIN"))||"",p=M();t("begin_checkout",w(l({},r),{customData:{shopDomain:a}}))}}catch(c){console.warn("PageFly: Error processing checkout_started event:",c)}}))),h("checkout_completed")&&n.subscribe("checkout_completed",(r=>{var i,o,s,c,a;try{let p=(i=r.data)==null?void 0:i.checkout;if(p){let u=parseFloat(String(((o=p.totalPrice)==null?void 0:o.amount)||0))||0,g=M();t(v.checkout_completed.eventType,l({order_id:((s=p.order)==null?void 0:s.id)||null,checkout_token:p.token||null,total_price:u,revenue_cents:Math.round(u*100),currency:p.currencyCode||null,customer_id:((a=(c=p.order)==null?void 0:c.customer)==null?void 0:a.id)||null},g?{experiment_id:g.experimentId,variant_id:g.variantId}:{}))}}catch(p){console.warn("PageFly: Error processing checkout_completed event:",p)}}))}function pe(n){if(!n)return ce();try{let t=new URL(n);return{utm_source:t.searchParams.get("utm_source"),utm_medium:t.searchParams.get("utm_medium"),utm_campaign:t.searchParams.get("utm_campaign"),utm_term:t.searchParams.get("utm_term"),utm_content:t.searchParams.get("utm_content")}}catch(t){return console.warn("PageFly: Invalid URL for UTM extraction:",t),ce()}}function ce(){return{utm_source:null,utm_medium:null,utm_campaign:null,utm_term:null,utm_content:null}}function le(n){if(!n)return"unknown";try{let e=new URL(n).pathname.toLowerCase();return e==="/"||e==="/index"?"home":e.includes("/products/")?"product":e.includes("/collections/")?"collection":e.includes("/cart")?"cart":e.includes("/checkout")?"checkout":e.includes("/pages/")?"page":e.includes("/blogs/")?"blog":e.includes("/search")?"search":"other"}catch(t){return console.warn("PageFly: Invalid URL for page type detection:",t),"unknown"}}function de(n){var r,i;if(!n)return!1;let t=(r=n.tagName)==null?void 0:r.toLowerCase(),e=(i=n.type)==null?void 0:i.toLowerCase();return!!(t==="button"||t==="a"||t==="input"&&["button","submit","image"].includes(e||"")||n.href)}function ue(n,t){let e=je(n,t);return{text:L(n).substring(0,200),href:n.href||null,section_content:e?{text_content:e.text_content,headings:e.headings,prices:e.prices}:null}}function L(n){return(n.value||n.name||"").trim()}function je(n,t){try{return{text_content:L(n).substring(0,500),element_tag:n.tagName||null,element_id:n.id||null,element_class:null,click_position:{pageX:t.pageX||null,pageY:t.pageY||null},headings:[],prices:[],element_text:L(n)||null}}catch(e){return{text_content:"",element_tag:n.tagName||null,element_id:n.id||null,element_class:null,click_position:{pageX:t.pageX||null,pageY:t.pageY||null},headings:[],prices:[],error:`Context extraction failed: ${e}`,element_text:null}}}function me(n,t){h("clicked")&&n.subscribe("clicked",(e=>{try{let r=e.data,i=r==null?void 0:r.element;if(!i)return;if(de(i)){let o=ue(i,r);t(v.clicked.eventType,o)}}catch(r){console.warn("PageFly: Error processing clicked event:",r)}}))}var Ke="pf_client_id";function _e(n,t,e){h("page_viewed")&&n.subscribe("page_viewed",(r=>{var i,o,s,c,a;try{let p=r.clientId;p&&(e!=null&&e.localStorage)&&e.localStorage.setItem(Ke,p);let u=((s=(o=(i=r.context)==null?void 0:i.document)==null?void 0:o.location)==null?void 0:s.href)||"",g=((a=(c=r.context)==null?void 0:c.document)==null?void 0:a.referrer)||"",y=pe(u);t(v.page_viewed.eventType,{url:u,page_type:le(u),referrer:g,utm_source:y.utm_source||null,utm_medium:y.utm_medium||null,utm_campaign:y.utm_campaign||null,utm_term:y.utm_term||null,utm_content:y.utm_content||null})}catch(p){console.warn("PageFly: Error processing page_viewed event:",p)}}))}function ge(n,t){h("product_viewed")&&n.subscribe("product_viewed",(e=>{var r,i,o,s,c;try{let a=(r=e.data)==null?void 0:r.productVariant;a&&t(v.product_viewed.eventType,{product_id:(i=a.product)!=null&&i.id&&parseInt(a.product.id)||null,variant_id:a.id&&parseInt(a.id)||null,product_title:a.title||null,product_vendor:((o=a.product)==null?void 0:o.vendor)||null,product_type:((s=a.product)==null?void 0:s.type)||null,price:parseFloat(String(((c=a.price)==null?void 0:c.amount)||0))||null,collection_id:null})}catch(a){console.warn("PageFly: Error processing product_viewed event:",a)}}))}var ze=[{shopifyEvent:"pagefly:section_view",trackedKey:"section_view"},{shopifyEvent:"pagefly:section_click",trackedKey:"section_click"},{shopifyEvent:"pagefly:section_cta_click",trackedKey:"section_cta_click"},{shopifyEvent:"pagefly:section_time",trackedKey:"section_time"}];function ye(n,t){h("section_engagement")&&n.subscribe("pagefly:section_engagement",e=>{try{let r=e.customData;if(!r)return;t(v.section_engagement.eventType,{section_text_content:r.sectionTextContent,focus_duration:r.focusDuration,timestamp:r.timestamp})}catch(r){}});for(let{shopifyEvent:e,trackedKey:r}of ze)h(r)&&n.subscribe(e,i=>{try{let o=i.customData;if(!(o!=null&&o.sectionId)||!(o!=null&&o.campaignId))return;let s=v[r].eventType;t(s,l(l({section_id:o.sectionId,section_version:o.sectionVersion,variant_id:o.variantId,campaign_id:o.campaignId},o.clickTarget?{click_target:o.clickTarget}:{}),o.duration!=null?{duration:o.duration}:{}))}catch(o){}})}var qe="pagefly:smart_pages",ve="__pf_smart_page_id",Xe="__pf_smart_section_id",Ye=new Set(["view_page","page_exit","section_view","section_click","
1section_time","experiment_assigned","custom"]);function T(n){return typeof n=="string"&&n.length>0&&n.length<=2048?n:void 0}function Je(n){if(n===null||typeof n!="object"||Array.isArray(n))return;let t=n;if(!(Object.keys(t).length>50)){try{if(JSON.stringify(t).length>8192)return}catch(e){return}return t}}function Ge(n,t){var r,i,o,s,c,a;let e=T(n.event_name);return!e||!Ye.has(e)?null:{event_name:e,shop_domain:(r=T(n.shop_domain))!=null?r:"unknown",page_id:(i=T(n.page_id))!=null?i:"",visitor_id:T(n.visitor_id)||String((o=t.clientId)!=null?o:""),session_id:(s=T(n.session_id))!=null?s:"",timestamp:(c=T(n.timestamp))!=null?c:new Date().toISOString(),experiment_id:T(n.experiment_id),variant_id:T(n.variant_id),section_id:T(n.section_id),page_type:"smart_pages",page_name:T(n.page_name),device_type:T(n.device_type),properties:(a=Je(n.properties))!=null?a:{}}}function fe(n){var r;if(!Array.isArray(n))return null;let t=n.find(i=>i.key===ve);if(!(t!=null&&t.value))return null;let e=n.find(i=>i.key===Xe);return{pageId:t.value,sectionId:(r=e==null?void 0:e.value)!=null?r:""}}function Ee(n,t){try{n.subscribe(qe,e=>{try{let r=e.clientId;if(typeof r!="string"||r.length===0)return;let i=e.customData;if(i===null||typeof i!="object")return;let o=Ge(i,e);if(!o)return;t.enqueue(o)}catch(r){}})}catch(e){}}function he(n,t,e){var i;let r="unknown";try{let o=(i=e==null?void 0:e.url)==null?void 0:i.call(e);o&&(r=new URL(o).hostname)}catch(o){}try{n.subscribe("product_added_to_cart",o=>{var s,c,a,p,u,g,y,x;try{let d=o.clientId;if(typeof d!="string"||d.length===0)return;let m=(s=o.data)==null?void 0:s.cartLine,b=(a=(c=m==null?void 0:m.merchandise)==null?void 0:c.product)==null?void 0:a.properties,I=fe(b);if(!I)return;t.enqueue({event_name:"add_to_cart",shop_domain:r,page_id:I.pageId,visitor_id:d,session_id:"",timestamp:new Date().toISOString(),section_id:I.sectionId,page_type:"smart_pages",properties:{product_id:(u=(p=m==null?void 0:m.merchandise)==null?void 0:p.product)==null?void 0:u.id,variant_id:(g=m==null?void 0:m.merchandise)==null?void 0:g.id,price:(x=(y=m==null?void 0:m.cost)==null?void 0:y.totalAmount)==null?void 0:x.amount}})}catch(d){}}),n.subscribe("checkout_completed",o=>{var s,c,a,p,u,g,y,x,d,m;try{let b=o.clientId;if(typeof b!="string"||b.length===0)return;let S=(((c=(s=o.data)==null?void 0:s.checkout)==null?void 0:c.lineItems)||[]).filter(k=>Array.isArray(k.properties)&&k.properties.some(F=>F.key===ve));if(S.length===0)return;let P=fe(S[0].properties);if(!P)return;t.enqueue({event_name:"purchase",shop_domain:r,page_id:P.pageId,visitor_id:b,session_id:"",timestamp:new Date().toISOString(),page_type:"smart_pages",properties:{order_id:(u=(p=(a=o.data)==null?void 0:a.checkout)==null?void 0:p.order)==null?void 0:u.id,revenue:(x=(y=(g=o.data)==null?void 0:g.checkout)==null?void 0:y.totalPrice)==null?void 0:x.amount,currency:(m=(d=o.data)==null?void 0:d.checkout)==null?void 0:m.currencyCode,item_count:S.length}})}catch(b){}})}catch(o){}}var Ze=!1;function xe(n,t,e,r){se(n),_e(n,t,r),ge(n,t),ie(n,t),ae(n,t,r),me(n,t),ye(n,t),re(n,e),Ze&&(Ee(n,e),he(n,e,r)),G(n,t),te(n,t),H(n,t),Z(n,t),$(n,t),ne(n,t),ee(n,t),W(n,t),Q(n,t)}var He="https://analytics-v1.pagefly.io/analytics-v2/events",D=class{constructor(t){E(this,"queue",[]);E(this,"timerId",null);E(this,"endpoint");this.endpoint=He,this.timerId=setInterval(()=>{this.flush()},3e3)}enqueue(t){if(this.queue.length>=10)return;this.queue.push(t);let e=t.event_name,r=e==="page_exit"||e==="add_to_cart"||e==="purchase";(this.queue.length>=5||r)&&this.flush()}flush(){if(this.queue.length===0)return;let t=this.queue.splice(0);try{fetch(this.endpoint,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json"},body:JSON.stringify({source:"ai_sales_page",events:t})}).catch(e=>console.error("[AnalyticsForwarder] flush failed:",e))}catch(e){}}cleanup(){this.flush(),this.timerId!==null&&(clearInterval(this.timerId),this.timerId=null)}};function Se(n){return new D(n)}var U=class{constructor(){E(this,"STORAGE_KEY","PF_CUSTOMER_EVENTS_TRACKER");E(this,"MAX_EVENTS",300);E(this,"MAX_EVENT_SIZE",10*1024);E(this,"MAX_TOTAL_SIZE",4*1024*1024);E(this,"browserAPI",null);E(this,"isInitialized",!1);E(this,"fallbackStorage",[]);E(this,"useLocalStorage",!0)}init(t){return _(this,null,function*(){if(!this.isInitialized&&(this.browserAPI=t,this.isInitialized=!0,!(t!=null&&t.localStorage))){console.warn("PageFly: Browser localStorage not available, using memory storage"),this.useLocalStorage=!1;return}})}saveEvent(t){return _(this,null,function*(){let e=w(l({},t),{createdAt:new Date().toISOString()});if(this.validateEventSize(e)||(e.data=this.truncateEventData(e.data)),!this.useLocalStorage){this.storeInMemory(e);return}try{yield this.storeInLocalStorage(e)}catch(r){this.handleStorageError(r,e)}})}getAllEvents(t){return _(this,null,function*(){if(!this.useLocalStorage){let e=[...this.fallbackStorage];return t?e.slice(0,t):e}try{let e=yield this.loadEventsFromStorage();return t?e.slice(0,t):e}catch(e){console.warn("PageFly: Failed to load events from localStorage:",e);let r=[...this.fallbackStorage];return t?r.slice(0,t):r}})}getEventsByDateRange(t,e){return _(this,null,function*(){return(yield this.getAllEvents()).filter(i=>i.createdAt>=t&&i.createdAt<=e)})}
1getEventCount(){return _(this,null,function*(){if(!this.useLocalStorage)return this.fallbackStorage.length;try{return(yield this.loadEventsFromStorage()).length}catch(t){return console.warn("PageFly: Failed to get event count:",t),this.fallbackStorage.length}})}isUsingLocalStorage(){return this.useLocalStorage}storeInLocalStorage(t){return _(this,null,function*(){let e=yield this.loadEventsFromStorage();e.unshift(t),e.length>this.MAX_EVENTS&&e.pop(),this.enforceStorageSize(e);let r=JSON.stringify(e);yield this.browserAPI.localStorage.setItem(this.STORAGE_KEY,r)})}loadEventsFromStorage(){return _(this,null,function*(){try{let t=yield this.browserAPI.localStorage.getItem(this.STORAGE_KEY);if(!t)return[];let e=JSON.parse(t);return Array.isArray(e)?this.validateEvents(e):(console.warn("PageFly: Invalid data format, clearing storage"),yield this.clearStorage(),[])}catch(t){return console.warn("PageFly: Failed to parse storage data:",t),yield this.clearStorage(),[]}})}validateEvents(t){let e=t.filter(r=>r&&typeof r=="object"&&r.createdAt&&r.eventType);return e.length!==t.length&&console.warn(`PageFly: Filtered out ${t.length-e.length} invalid events`),e}enforceStorageSize(t){let e=JSON.stringify(t);for(;t.length>0&&e.length>this.MAX_TOTAL_SIZE;)t.pop(),e=JSON.stringify(t);e.length>this.MAX_TOTAL_SIZE&&console.warn("PageFly: Storage size limit reached, removed oldest events")}validateEventSize(t){return JSON.stringify(t).length<=this.MAX_EVENT_SIZE}truncateEventData(t){var r,i;let e=l({},t);return(r=e.section_content)!=null&&r.text_content&&(e.section_content.text_content=this.truncateText(e.section_content.text_content,500)),typeof e.text=="string"&&(e.text=this.truncateText(e.text,200)),(i=e.page_context)!=null&&i.title&&(e.page_context.title=this.truncateText(e.page_context.title,100)),e}truncateText(t,e){return t.length>e?t.substring(0,e)+"...":t}storeInMemory(t){this.fallbackStorage.unshift(t),this.fallbackStorage.length>this.MAX_EVENTS&&this.fallbackStorage.pop()}handleStorageError(t,e){t.name==="QuotaExceededError"||t.code===22?(console.warn("PageFly: localStorage quota exceeded, switching to memory storage"),this.useLocalStorage=!1,this.storeInMemory(e)):(console.warn("PageFly: localStorage error:",t.message||t),this.storeInMemory(e))}clearStorage(){return _(this,null,function*(){try{yield this.browserAPI.localStorage.removeItem(this.STORAGE_KEY)}catch(t){console.warn("PageFly: Failed to clear storage:",t)}})}generateId(){return`${Date.now()}-${Math.random().toString(36).substring(2,9)}`}},C=new U;var Te="https://analytics-v1.pagefly.io/analytics-v2/events";function Ae(n){return _(this,null,function*(){if(n.length)try{yield fetch(Te,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({events:n})})}catch(t){console.debug("\u274C Send events failed:",t)}})}function V(n){return n?`PF_SESSION:${n}`:"PF_SESSION_STATE"}function R(n){return n?`PF_USER_TYPE:${n}`:"PF_USER_TYPE"}var $e=1800*1e3,Qe=720*60*60*1e3;function We(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,n=>{let t=Math.random()*16|0;return(n==="x"?t:t&3|8).toString(16)})}function j(n){return{sessionId:We(),sessionStartAt:new Date(n).toISOString()}}function et(n){var t;return{sessionId:String((t=n.sessionId)!=null?t:""),lastActivityAt:Number(n.lastActivityAt)||0,sessionStartAt:typeof n.sessionStartAt=="string"?n.sessionStartAt:"",lastEventAt:typeof n.lastEventAt=="number"&&n.lastEventAt>0?n.lastEventAt:null,engaged:n.engaged===!0}}function be(n,t=""){return _(this,null,function*(){let e=Date.now();try{if(!(n!=null&&n.localStorage)){let s=j(e);return{sessionId:s.sessionId,sessionStartAt:s.sessionStartAt,duration_ms:0,engaged:!1}}let r=yield n.localStorage.getItem(V(t));if(r){let s=et(JSON.parse(r));if(e-s.lastActivityAt<=$e){let c=s.lastEventAt!=null?e-s.lastEventAt:0,a=w(l({},s),{lastActivityAt:e,lastEventAt:e});return yield n.localStorage.setItem(V(t),JSON.stringify(a)),{sessionId:s.sessionId,sessionStartAt:s.sessionStartAt,duration_ms:c,engaged:s.engaged===!0}}}let i=j(e),o={sessionId:i.sessionId,lastActivityAt:e,sessionStartAt:i.sessionStartAt,lastEventAt:e,engaged:!1};return yield n.localStorage.setItem(V(t),JSON.stringify(o)),{sessionId:i.sessionId,sessionStartAt:i.sessionStartAt,duration_ms:0,engaged:!1}}catch(r){let i=j(e);return{sessionId:i.sessionId,sessionStartAt:i.sessionStartAt,duration_ms:0,engaged:!1}}})}function we(n,t=""){return _(this,null,function*(){let e=Date.now();try{if(!(n!=null&&n.localStorage))return"new_user";let r=yield n.localStorage.getItem(R(t));if(r){let i=JSON.parse(r);return e-i.firstSeenAt>Qe?(yield n.localStorage.setItem(R(t),JSON.stringify({userType:"new_user",firstSeenAt:e})),"new_user"):(i.userType==="returned_user"||(yield n.localStorage.setItem(R(t),JSON.stringify({userType:"returned_user",firstSeenAt:i.firstSeenAt}))),"returned_user")}return yield n.localStorage.setItem(R(t),JSON.stringify({userType:"new_user",firstSeenAt:e})),"new_user"}catch(r){return"new_user"}})}var tt=["pf_view_page","pf_form_submit","pf_conversion","pf_add_to_cart","pf_dynamic_checkout","pf_view_product","pf_view_collection","pf_view_blog_post","begin_checkout","pf_page_exit"];function nt(n){return tt.includes(n)}function rt(n){try{if(n){let t=new URL(n).searchParams.get("pf_v");if(t)return t}}catch(t){}return"control"}var K=class{constructor(t){E(this,"initialized",!1);E(this,"browserAPI",null);this.browserAPI=t}ensureInitialized(){return _(this,null,function*(){if(!this.initialized)try{yield C.init(this.browserAPI),this.initialized=!0}catch(t){console.warn("PageFly: Failed to initialize storage:",t),this.initialized=!0}})}saveEvent(t,e){return _(this,null,function*(){var i,o,s,c,a,p,u,g,y,x;yield this.ensureInitialized();let r={eventType:t,data:e};try{if(nt(t)){let d=(i=e.customData)!=null?i:{},m=d.shopDomain||"";m&&((s=(o=this.browserAPI)==null?void 0:o.sessionStorage)==null||s.setItem("PF_SHOP_DOMAIN",m).catch(()=>{}),(a=(c=this.browserAPI)==null?void 0:c.localStorage)==null||a.setItem("PF_SHOP_DOMAIN",m).catch(()=>{}));let[b,I]=yield Promise.all([be(this.browserAPI,m),we(this.browserAPI,m)]),S=(p=e.context)!=null?p:{},P=(g=(u=S==null?void 0:S.document)==null?void 0:u.location)!=null?g:{},k=(y=S==null?void 0:S.navigator)!=null?y:{},F="",z="",q="";try{if(P.href){let A=new URL(P.href);F=A.searchParams.get("utm_source")||"",z=A.searchParams.get("utm_medium")||"",q=A.searchParams.get("utm_campaign")||""}}catch(A){}let X=(k.userAgent||"").toLowerCase(),N="desktop";/mobile|android|iphone|ipod/.test(X)?N="mobile":/tablet|ipad/.test(X)&&(N="tablet");let Ce={event_name:(t||"custom").replace(/^pf_/,"")||"custom",timestamp:e.timestamp||new Date().toISOString(),visitor_id:e.clientId||"",session_id:b.sessionId,user_t
1ype:I,shop_domain:d.shopDomain||"unknown",page_id:d.pageId||d.page_id||"unknown",experiment_id:d.experimentId||"",variant_id:rt(P.href),section_id:d.sectionId||d.sectionRootType||"",section_version:d.sectionVersion||"",properties:w(l({},Object.fromEntries(Object.entries(d).filter(([A])=>!["shopDomain","pageId","page_id","pageType","experimentId","sectionId","sectionRootType","sectionVersion","send_to","pf_event"].includes(A)))),{engaged:b.engaged,seq:e.seq,eventId:e.id}),page_type:d.pageType||"",page_name:((x=S==null?void 0:S.document)==null?void 0:x.title)||"",utm_source:F,utm_medium:z,utm_campaign:q,country:"",device_type:N,duration_ms:Math.max(0,Number(e.duration_ms)||0)};for(let A=1;A<=3;A++)try{yield Ae([Ce]);break}catch(ot){A<3&&(yield new Promise(ke=>setTimeout(ke,2e3)))}}yield C.saveEvent(r)}catch(d){console.warn("PageFly: Failed to store behavior event:",d)}})}getEvents(t){return _(this,null,function*(){yield this.ensureInitialized();try{return yield C.getAllEvents(t)}catch(e){return console.warn("PageFly: Failed to get events from localStorage:",e),[]}})}getEventsByDateRange(t,e){return _(this,null,function*(){yield this.ensureInitialized();try{return yield C.getEventsByDateRange(t,e)}catch(r){return console.warn("PageFly: Failed to get events by date range:",r),[]}})}};function Ie(n){let t=new K(n);return{saveEvent:(e,r)=>t.saveEvent(e,r),getEvents:e=>t.getEvents(e),getEventsByDateRange:(e,r)=>t.getEventsByDateRange(e,r)}}var Pe="2.1.12";O(({analytics:n,browser:t,settings:e})=>{let r=e==null?void 0:e.analyticsEndpoint,i=Ie(t),o=Se(r);xe(n,i.saveEvent,o,t),console.log(`%c PageFly %c Customer Events Tracker %c Version ${Pe} %c`,"background:#4a4cf6;padding:2px 1px;border-radius:3px 0 0 3px;color:#FFFFFF","background:#0094ff;padding:2px 1px;color:#000000","background:#FE2C55;padding:2px 1px;border-radius:0 3px 3px 0;color:#25F4EE","background:transparent")});})();

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.