1var W=Object.defineProperty;var j=(t,e,i)=>e in t?W(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var h=(t,e,i)=>j(t,typeof e!="symbol"?e+"":e,i);let O=-1;const f=t=>{addEventListener("pageshow",e=>{e.persisted&&(O=e.timeStamp,t(e))},!0)},l=(t,e,i,n)=>{let r,o;return a=>{e.value>=0&&(a||n)&&(o=e.value-(r??0),(o||r===void 0)&&(r=e.value,e.delta=o,e.rating=((s,d)=>s>d[1]?"poor":s>d[0]?"needs-improvement":"good")(e.value,i),t(e)))}},w=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},A=()=>{const t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},v=()=>{const t=A();return(t==null?void 0:t.activationStart)??0},u=(t,e=-1)=>{const i=A();let n="navigate";return O>=0?n="back-forward-cache":i&&(document.prerendering||v()>0?n="prerender":document.wasDiscarded?n="restore":i.type&&(n=i.type.replace(/_/g,"-"))),{name:t,value:e,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:n}},P=new WeakMap;function I(t,e){return P.get(t)||P.set(t,new e),P.get(t)}class z{constructor(){h(this,"t");h(this,"i",0);h(this,"o",[])}h(e){var r;if(e.hadRecentInput)return;const i=this.o[0],n=this.o.at(-1);this.i&&i&&n&&e.startTime-n.startTime<1e3&&e.startTime-i.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),(r=this.t)==null||r.call(this,e)}}const g=(t,e,i={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const n=new PerformanceObserver(r=>{Promise.resolve().then(()=>{e(r.getEntries())})});return n.observe({type:t,buffered:!0,...i}),n}}catch{}},F=t=>{let e=!1;return()=>{e||(t(),e=!0)}};let m=-1;const $=new Set,M=()=>document.visibilityState!=="hidden"||document.prerendering?1/0:0,L=t=>{if(document.visibilityState==="hidden"){if(t.type==="visibilitychange")for(const e of $)e();isFinite(m)||(m=t.type==="visibilitychange"?t.timeStamp:0,removeEventListener("prerenderingchange",L,!0))}},y=()=>{var t;if(m<0){const e=v();m=(document.prerendering||(t=globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>e)[0])==null?void 0:t.startTime)??M(),addEventListener("visibilitychange",L,!0),addEventListener("prerenderingchange",L,!0),f(()=>{setTimeout(()=>{m=M()})})}return{get firstHiddenTime(){return m},onHidden(e){$.add(e)}}},C=t=>{document.prerendering?addEventListener("prerenderingchange",()=>t(),!0):t()},k=[1800,3e3],G=(t,e={})=>{C(()=>{const i=y();let n,r=u("FCP");const o=g("paint",a=>{for(const s of a)s.name==="first-contentful-paint"&&(o.disconnect(),s.startTime<i.firstHiddenTime&&(r.value=Math.max(s.startTime-v(),0),r.entries.push(s),n(!0)))});o&&(n=l(t,r,k,e.reportAllChanges),f(a=>{r=u("FCP"),n=l(t,r,k,e.reportAllChanges),w(()=>{r.value=performance.now()-a.timeStamp,n(!0)})}))})},B=[.1,.25],X=(t,e={})=>{const i=y();G(F(()=>{let n,r=u("CLS",0);const o=I(e,z),a=d=>{for(const c of d)o.h(c);o.i>r.value&&(r.value=o.i,r.entries=o.o,n())},s=g("layout-shift",a);s&&(n=l(t,r,B,e.reportAllChanges),i.onHidden(()=>{a(s.takeRecords()),n(!0)}),f(()=>{o.i=0,r=u("CLS",0),n=l(t,r,B,e.reportAllChanges),w(()=>n())}),setTimeout(n))}))};let D=0,b=1/0,T=0;const J=t=>{for(const e of t)e.interactionId&&(b=Math.min(b,e.interactionId),T=Math.max(T,e.interactionId),D=T?(T-b)/7+1:0)};let S;const H=()=>S?D:performance.interactionCount??0,K=()=>{"interactionCount"in performance||S||(S=g("event",J,{type:"event",buffered:!0,durationThreshold:0}))};let x=0;class Q{constructor(){h(this,"u",[]);h(this,"l",new Map);h(this,"m");h(this,"p")}v(){x=H(),this.u.length=0,this.l.clear()}L(){const e=Math.min(this.u.length-1,Math.floor((H()-x)/50));return this.u[e]}h(e){var r,o;if((r=this.m)==null||r.call(this,e),!e.interactionId&&e.entryType!=="first-input")return;const i=this.u.at(-1);let n=this.l.get(e.interactionId);if(n||this.u.length<10||e.duration>i.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.l.set(n.id,n),this.u.push(n)),this.u.sort((a,s)=>s.P-a.P),this.u.length>10){const a=this.u.splice(10);for(const s of a)this.l.delete(s.id)}(o=this.p)==null||o.call(this,n)}}}const _=t=>{const e=globalThis.requestIdleCallback||setTimeout;document.visibilityState==="hidden"?t():(t=F(t),addEventListener("visibilitychange",t,{once:!0,capture:!0}),e(()=>{t(),removeEventListener("visibilitychange",t,{capture:!0})}
1))},N=[200,500],Y=(t,e={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const i=y();C(()=>{K();let n,r=u("INP");const o=I(e,Q),a=d=>{_(()=>{for(const p of d)o.h(p);const c=o.L();c&&c.P!==r.value&&(r.value=c.P,r.entries=c.entries,n())})},s=g("event",a,{durationThreshold:e.durationThreshold??40});n=l(t,r,N,e.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),i.onHidden(()=>{a(s.takeRecords()),n(!0)}),f(()=>{o.v(),r=u("INP"),n=l(t,r,N,e.reportAllChanges)}))})};class U{constructor(){h(this,"m")}h(e){var i;(i=this.m)==null||i.call(this,e)}}const q=[2500,4e3],Z=(t,e={})=>{C(()=>{const i=y();let n,r=u("LCP");const o=I(e,U),a=d=>{e.reportAllChanges||(d=d.slice(-1));for(const c of d)o.h(c),c.startTime<i.firstHiddenTime&&(r.value=Math.max(c.startTime-v(),0),r.entries=[c],n())},s=g("largest-contentful-paint",a);if(s){n=l(t,r,q,e.reportAllChanges);const d=F(()=>{a(s.takeRecords()),s.disconnect(),n(!0)}),c=p=>{p.isTrusted&&(_(d),removeEventListener(p.type,c,{capture:!0}))};for(const p of["keydown","click","visibilitychange"])addEventListener(p,c,{capture:!0});f(p=>{r=u("LCP"),n=l(t,r,q,e.reportAllChanges),w(()=>{r.value=performance.now()-p.timeStamp,n(!0)})})}})},R=[800,1800],E=t=>{document.prerendering?C(()=>E(t)):document.readyState!=="complete"?addEventListener("load",()=>E(t),!0):setTimeout(t)},ee=(t,e={})=>{let i=u("TTFB"),n=l(t,i,R,e.reportAllChanges);E(()=>{const r=A();r&&(i.value=Math.max(r.responseStart-v(),0),i.entries=[r],n(!0),f(()=>{i=u("TTFB",0),n=l(t,i,R,e.reportAllChanges),n(!0)}))})};export{B as CLSThresholds,k as FCPThresholds,N as INPThresholds,q as LCPThresholds,R as TTFBThresholds,X as onCLS,G as onFCP,Y as onINP,Z as onLCP,ee as onTTFB};
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.