PageSourceSearch

https://mostreams-com.lovable.app/assets/TrafficBeacon-dDhumio4.js

js mostreams-com.lovable.app collected 2026-10-03 03:34:12 UTC 1,830 bytes, 1 lines download raw bytes

1import{u as g,r as d,s as l,d as p}from"./index-BNrdOJig.js";function h(){if(typeof window>"u")return"";let e=window.sessionStorage.getItem("mo_session_id");return e||(e=crypto.randomUUID(),window.sessionStorage.setItem("mo_session_id",e)),e}function _(){if(typeof navigator>"u")return{device:"unknown",browser:"unknown",os:"unknown"};const e=navigator.userAgent,o=/Mobi|Android|iPhone|iPad|iPod/i.test(e),s=/Tablet|iPad/i.test(e)?"tablet":o?"mobile":"desktop";let n="other";/Edg\//.test(e)?n="Edge":/OPR\//.test(e)?n="Opera":/Chrome\//.test(e)?n="Chrome":/Safari\//.test(e)?n="Safari":/Firefox\//.test(e)&&(n="Firefox");let t="other";return/Windows/.test(e)?t="Windows":/Mac OS X/.test(e)?t="macOS":/Android/.test(e)?t="Android":/iPhone|iPad|iPod/.test(e)?t="iOS":/Linux/.test(e)&&(t="Linux"),{device:s,browser:n,os:t}}let a=null,u=null;async function b(){return a||(u||(u=p().then(e=>(a=e,e))),u)}function P(){const e=g({select:i=>i.location.pathname}),o=d.useRef(null);return d.useEffect(()=>{if(typeof window>"u"||!e||o.current===e)return;o.current=e;const i=async()=>{try{const t=await b(),{device:c,browser:f,os:m}=_(),r=new URLSearchParams(window.location.search),{data:{session:w}}=await l.auth.getSession();await l.from("page_views").insert({session_id:h(),user_id:w?.user?.id??null,path:e,referrer:document.referrer||null,utm_source:r.get("utm_source"),utm_medium:r.get("utm_medium"),utm_campaign:r.get("utm_campaign"),country_code:t?.code??null,country_name:t?.name??null,region:t?.region??null,city:t?.city??null,latitude:t?.lat??null,longitude:t?.lng??null,device:c,browser:f,os:m})}catch{}},s=window.requestIdleCallback;if(s){const t=s(()=>{i()},{timeout:4e3});return()=>window.cancelIdleCallback?.(t)}const n=window.setTimeout(()=>{i()},1200);return()=>window.clearTimeout(n)},[e]),null}export{P as TrafficBeacon};

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.