1import{t as e}from"./dist.Cnxa_LV8.js";import{t}from"./store.CgJyyZdh.js";import{n,t as r}from"./updateK5aMeta.ev0eiQKw.js";import{t as i}from"./resolveSubscriberState.BPdOVIjn.js";import{t as a}from"./store.DxJag6Rn.js";var o=`article-body`,s=`https://cl.k5a.io/61484fd82f894143d543e432.js`;function c(e,t,i={}){if(typeof window>`u`)throw Error(`Kilkaya should only be setup on the client`);let a=n();t&&a.$userState.set(t),r(e);let{debug:c,logger:l=console}=i;e.type===`article`&&!document.getElementsByClassName(`article-body`).length&&l.warn(`[setupKilkaya] article tracked but no element with main content class found: '${o}'`);let u=document.createElement(`script`);u.src=s,u.async=!0,c&&(u.onload=()=>{l.info(`[setupKilkaya] kilkaya script loaded %o`,window.k5aMeta);try{window.kilkaya.debugModeOn()}catch{}},u.onerror=()=>{l.error(`[setupKilkaya] kilkaya script failed to load`)}),document.head.appendChild(u)}function l(e){if(!e)return[`agebin_unknown`];let t=new Date(e);if(isNaN(t.valueOf()))return[`agebin_unknown`];let n=new Date().valueOf()-t.valueOf(),r=Math.floor(n/315576e5);if(r<10||r>=100)return[`agebin_unknown`];let i=Number(r.toString().charAt(0)),a=[`agebin_${i}0_${i}9`];return r>=15&&r<=99&&a.push(`agebin_15_99`),r>=15&&r<=39&&a.push(`agebin_15_39`),r>=30&&r<=49&&a.push(`agebin_30_49`),a}var u=c,d=class extends HTMLElement{async connectedCallback(){let n=t(),r=a(),[o]=await Promise.all([n.isLoggedIn(),r.syncUser().catch(()=>e.warn(`[kilkaya-loader] Failed to sync touchpoint user data`))]),s=l(r.$user.get()?.profile?.birthdate),c=i();u(JSON.parse(this.dataset.metadata||`{}`),{loggedIn:o,subscriber:c===`subscription`,ageSegment:s})}};customElements.define(`kilkaya-loader`,d);
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.