1import{r as e}from"./jsx-runtime-DUAcabCT.js";var t=e({getAnalyticsIds:()=>x,initAnalytics:()=>y,track:()=>g,trackOnce:()=>w,trackPageview:()=>b}),n=`floky_vid`,r=`floky_sid`,i=`floky_sid_ts`,a=1800*1e3;function o(){return typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}function s(){return typeof window<`u`&&typeof document<`u`}function c(){if(!s())return``;let e=localStorage.getItem(n);return e||(e=o(),localStorage.setItem(n,e)),e}function l(){let e=c();if(!s())return{visitor_id:e,session_id:``,is_new_session:!1};let t=Date.now(),n=Number(sessionStorage.getItem(i)||`0`),l=sessionStorage.getItem(r)||``,u=!1;return(!l||t-n>a)&&(l=o(),sessionStorage.setItem(r,l),u=!0),sessionStorage.setItem(i,String(t)),{visitor_id:e,session_id:l,is_new_session:u}}var u=[],d=null,f=!1;function p(){if(!s()||u.length===0)return;let e=u;u=[],d&&=(clearTimeout(d),null);let t=JSON.stringify({events:e});try{if(navigator.sendBeacon){let e=new Blob([t],{type:`application/json`});if(navigator.sendBeacon(`/api/public/track`,e))return}}catch{}fetch(`/api/public/track`,{method:`POST`,headers:{"Content-Type":`application/json`},body:t,keepalive:!0}).catch(()=>{})}function m(){d||=setTimeout(()=>{d=null,p()},1500)}function h(){if(!s())return{};let e=new URLSearchParams(window.location.search);return{utm_source:e.get(`utm_source`)??void 0,utm_medium:e.get(`utm_medium`)??void 0,utm_campaign:e.get(`utm_campaign`)??void 0,utm_term:e.get(`utm_term`)??void 0,utm_content:e.get(`utm_content`)??void 0}}function g(e,t={}){if(!s())return;let n=l();n.session_id&&(n.is_new_session&&!f?(f=!0,u.push({visitor_id:n.visitor_id,session_id:n.session_id,event_name:`session_start`,path:window.location.pathname,props:{...h(),referrer:document.referrer||null,landing_path:window.location.pathname,screen:`${window.screen?.width||0}x${window.screen?.height||0}`,viewport:`${window.innerWidth}x${window.innerHeight}`,language:navigator.language},ts:Date.now()})):f||=!0,u.push({visitor_id:n.visitor_id,session_id:n.session_id,event_name:e,path:window.location.pathname,props:t,ts:Date.now()}),m())}var _=!1,v=``;function y(){if(!s()||_)return;_=!0,document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`&&p()}),window.addEventListener(`pagehide`,p);let e=new Set,t=[25,50,75,100];window.addEventListener(`scroll`,()=>{let n=document.documentElement,r=n.scrollHeight-n.clientHeight;if(r<=0)return;let i=Math.min(100,Math.round((window.scrollY||n.scrollTop)/r*100));for(let n of t)i>=n&&!e.has(n)&&(e.add(n),g(`scroll_depth`,{depth:n}))},{passive:!0}),window.__flokyResetScroll=()=>e.clear()}function b(e){if(!s()||e===v)return;v=e;let t=window.__flokyResetScroll;t&&t(),g(`pageview`,{title:document.title})}function x(){if(!s())return{visitor_id:``,session_id:``};let e=l(),t=h();return{visitor_id:e.visitor_id,session_id:e.session_id,utm_source:t.utm_source,utm_medium:t.utm_medium,utm_campaign:t.utm_campaign,referrer:document.referrer||void 0}}var S=new Set,C=`floky_once`;function w(e,t,n={}){if(!s()||S.has(e))return;let r=[];try{r=JSON.parse(sessionStorage.getItem(C)||`[]`)}catch{r=[]}if(r.includes(e)){S.add(e);return}S.add(e),r.push(e);try{sessionStorage.setItem(C,JSON.stringify(r.slice(-300)))}catch{}g(t,n)}export{t as i,g as n,w as r,x as t};
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.