(()=>{const send=(metric,value,rating)=>{try{navigator.sendBeacon('/api/search-os/vitals',new Blob([JSON.stringify({path:location.pathname,metric,value,rating,device:innerWidth<768?'mobile':'desktop'})],{type:'application/json'}))}catch(e){}};const rate=(m,v)=>m==='CLS'?(v<=.1?'good':v<=.25?'needs-improvement':'poor'):(m==='INP'?(v<=200?'good':v<=500?'needs-improvement':'poor'):(v<=2500?'good':v<=4000?'needs-improvement':'poor'));try{new PerformanceObserver(l=>l.getEntries().forEach(e=>send('LCP',e.startTime,rate('LCP',e.startTime)))).observe({type:'largest-contentful-paint',buffered:true});let cls=0;new PerformanceObserver(l=>{l.getEntries().forEach(e=>{if(!e.hadRecentInput)cls+=e.value});send('CLS',cls,rate('CLS',cls))}).observe({type:'layout-shift',buffered:true});new PerformanceObserver(l=>l.getEntries().forEach(e=>send('INP',e.duration,rate('INP',e.duration)))).observe({type:'event',durationThreshold:40})}catch(e){}})();