"use strict";(()=>{(()=>{try{let{document:o,location:i,navigator:r,screen:y,history:p,sessionStorage:m,crypto:w}=window,d=o.currentScript||o.querySelector('script[src*="hk.js"]');if(!d)return;let E=d.getAttribute("data-collect-dnt")==="true",S=d.getAttribute("data-disable-beacon")==="true",B=/bot|spider|crawl|slurp|ia_archiver/i.test(r.userAgent),P=i.hostname==="localhost"||i.hostname==="127.0.0.1",$=r.doNotTrack==="1";if(P||B||$&&!E){window.hk=window.hk||{},window.hk.event=()=>{};return}let b=new URL(d.src),_=`${b.origin}/ingest`,v=()=>w?.randomUUID?w.randomUUID():"10000000-1000-4000-8000-100000000000".replace(/[018]/g,t=>(t^w.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)),g="hk_session",L=1800*1e3,f=(()=>{let t=Date.now(),e=null;try{let n=m.getItem(g);if(n){let[s,a]=n.split("|");t-parseInt(a,10){let n=t.get(e);if(!n)return null;let s=n.trim();return s.length>0?s:null},I=()=>u!==i.pathname?`${i.origin}${u}`:R||null,l=()=>{let t=i.pathname,e=new URLSearchParams(i.search);try{m.setItem(g,`${f}|${Date.now()}`)}catch{}let n=I(),s=u===t&&n&&new URL(n).hostname!==A,a={path:t,referrer:n||null,ua:r.userAgent,vp_w:window.innerWidth,vp_h:window.innerHeight,sc_w:y.width,sc_h:y.height,lang:r.language,u_src:c(e,"utm_source"),u_med:c(e,"utm_medium"),u_cmp:c(e,"utm_campaign"),u_trm:c(e,"utm_term"),u_cnt:c(e,"utm_content"),unique:!!s,session_id:f,page_id:v()},h=JSON.stringify(a),D={"Content-Type":"application/json"};if(r.sendBeacon&&!S){let k=new Blob([h],{type:"application/json"});r.sendBeacon(_,k)}else fetch(_,{method:"POST",body:h,headers:D,keepalive:!0,credentials:"omit"}).catch(()=>{});u=t},U=t=>{let e=p[t];return function(...n){e.apply(this,n),l()}};p.pushState=U("pushState"),p.replaceState=U("replaceState"),window.addEventListener("popstate",l),window.addEventListener("hashchange",l),o.visibilityState==="prerender"?o.addEventListener("visibilitychange",()=>{o.visibilityState==="visible"&&l()},{once:!0}):l(),window.hk=window.hk||{},window.hk.event=(t,e)=>{let n={n:t,p:e||{},r:I(),sid:f},s=JSON.stringify(n),a=`${b.origin}/ingest/event`;if(r.sendBeacon&&!S){let h=new Blob([s],{type:"application/json"});r.sendBeacon(a,h)}else fetch(a,{method:"POST",body:s,headers:{"Content-Type":"application/json"},keepalive:!0,credentials:"omit"}).catch(()=>{})}}catch(o){console?.debug&&console.debug("[HitKeep]",o)}})();})();