Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

web-vitals

Package Overview
Dependencies
Maintainers
3
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

web-vitals - npm Package Compare versions

Comparing version 4.0.0-beta.0 to 4.0.0-beta.1

16

dist/modules/attribution/onTTFB.js

@@ -25,6 +25,6 @@ /*

metric.attribution = {
waitingTime: dnsStart,
dnsTime: connectStart - dnsStart,
connectionTime: requestStart - connectStart,
requestTime: metric.value - requestStart,
waitingDuration: dnsStart,
dnsDuration: connectStart - dnsStart,
connectionDuration: requestStart - connectStart,
requestDuration: metric.value - requestStart,
navigationEntry: navigationEntry,

@@ -36,6 +36,6 @@ };

metric.attribution = {
waitingTime: 0,
dnsTime: 0,
connectionTime: 0,
requestTime: 0,
waitingDuration: 0,
dnsDuration: 0,
connectionDuration: 0,
requestDuration: 0,
};

@@ -42,0 +42,0 @@ };

@@ -12,7 +12,2 @@ interface Interaction {

export declare const DEFAULT_DURATION_THRESHOLD = 40;
/**
* Returns the interaction count since the last bfcache restore (or for the
* full page lifecycle if there were no bfcache restores).
*/
export declare const getInteractionCountForNavigation: () => number;
export declare const resetInteractions: () => void;

@@ -19,0 +14,0 @@ /**

@@ -33,3 +33,3 @@ /*

*/
export const getInteractionCountForNavigation = () => {
const getInteractionCountForNavigation = () => {
return getInteractionCount() - prevInteractionCount;

@@ -36,0 +36,0 @@ };

@@ -17,4 +17,4 @@ /*

import { onHidden } from './onHidden.js';
import { runOnce } from './runOnce.js';
const rIC = self.requestIdleCallback || self.setTimeout;
const cIC = self.cancelIdleCallback || self.clearTimeout;
/**

@@ -26,2 +26,5 @@ * Runs the passed callback during the next idle period, or immediately

let handle = -1;
cb = runOnce(cb);
// If the document is hidden, run the callback immediately, otherwise
// race an idle callback with the next `visibilitychange` event.
if (document.visibilityState === 'hidden') {

@@ -32,8 +35,5 @@ cb();

handle = rIC(cb);
onHidden(() => {
cIC(handle);
cb();
});
onHidden(cb);
}
return handle;
};

@@ -19,3 +19,3 @@ /*

import { initMetric } from './lib/initMetric.js';
import { DEFAULT_DURATION_THRESHOLD, processInteractionEntry, estimateP98LongestInteraction, getInteractionCountForNavigation, resetInteractions, } from './lib/interactions.js';
import { DEFAULT_DURATION_THRESHOLD, processInteractionEntry, estimateP98LongestInteraction, resetInteractions, } from './lib/interactions.js';
import { observe } from './lib/observe.js';

@@ -62,14 +62,4 @@ import { onHidden } from './lib/onHidden.js';

let report;
const durationThreshold = opts.durationThreshold ?? DEFAULT_DURATION_THRESHOLD;
const handleEntries = (entries) => {
entries.forEach((entry) => {
// Ignore `first-input` entries if the duration value is greater
// than the threshold (since that means an `event` entry should
// have been dispatched).
if (entry.entryType === 'first-input' &&
entry.duration >= durationThreshold) {
return;
}
processInteractionEntry(entry);
});
entries.forEach(processInteractionEntry);
const inp = estimateP98LongestInteraction();

@@ -102,8 +92,2 @@ if (inp && inp.latency !== metric.value) {

handleEntries(po.takeRecords());
// If the interaction count shows that there were interactions but
// none were captured by the PerformanceObserver, report a latency of 0.
if (metric.value < 0 && getInteractionCountForNavigation() > 0) {
metric.value = 0;
metric.entries = [];
}
report(true);

@@ -110,0 +94,0 @@ });

@@ -20,17 +20,17 @@ import type { Metric } from './base.js';

*/
waitingTime: number;
waitingDuration: number;
/**
* The total time to resolve the DNS for the current request.
*/
dnsTime: number;
dnsDuration: number;
/**
* The total time to create the connection to the requested domain.
*/
connectionTime: number;
connectionDuration: number;
/**
* The time time from when the request was sent until the first byte of the
* The total time from when the request was sent until the first byte of the
* response was received. This includes network time as well as server
* processing time.
*/
requestTime: number;
requestDuration: number;
/**

@@ -37,0 +37,0 @@ * The `navigation` entry of the current page, which is useful for diagnosing

@@ -1,1 +0,1 @@

var webVitals=function(t){"use strict";var e,n,r=function(){return self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},i=function(t){if("loading"===document.readyState)return"loading";var e=r();if(e){if(t<e.domInteractive)return"loading";if(0===e.domContentLoadedEventStart||t<e.domContentLoadedEventStart)return"dom-interactive";if(0===e.domComplete||t<e.domComplete)return"dom-content-loaded"}return"complete"},a=function(t){var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},o=function(t,e){var n="";try{for(;t&&9!==t.nodeType;){var r=t,i=r.id?"#"+r.id:a(r)+(r.classList&&r.classList.value&&r.classList.value.trim()&&r.classList.value.trim().length?"."+r.classList.value.trim().replace(/\s+/g,"."):"");if(n.length+i.length>(e||100)-1)return n||i;if(n=n?i+">"+n:i,r.id)break;t=r.parentNode}}catch(t){}return n},u=-1,c=function(){return u},s=function(t){addEventListener("pageshow",(function(e){e.persisted&&(u=e.timeStamp,t(e))}),!0)},f=function(){var t=r();return t&&t.activationStart||0},l=function(t,e){var n=r(),i="navigate";c()>=0?i="back-forward-cache":n&&(document.prerendering||f()>0?i="prerender":document.wasDiscarded?i="restore":n.type&&(i=n.type.replace(/_/g,"-")));return{name:t,value:void 0===e?-1:e,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},d=function(t,e,n){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var r=new PerformanceObserver((function(t){Promise.resolve().then((function(){e(t.getEntries())}))}));return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch(t){}},m=function(t,e,n,r){var i,a;return function(o){e.value>=0&&(o||r)&&((a=e.value-(i||0))||void 0===i)&&(i=e.value,e.delta=a,e.rating=function(t,e){return t>e[1]?"poor":t>e[0]?"needs-improvement":"good"}(e.value,n),t(e))}},p=function(t){requestAnimationFrame((function(){return requestAnimationFrame((function(){return t()}))}))},v=function(t){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&t()}))},h=function(t){var e=!1;return function(){e||(t(),e=!0)}},g=-1,T=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},y=function(t){"hidden"===document.visibilityState&&g>-1&&(g="visibilitychange"===t.type?t.timeStamp:0,S())},E=function(){addEventListener("visibilitychange",y,!0),addEventListener("prerenderingchange",y,!0)},S=function(){removeEventListener("visibilitychange",y,!0),removeEventListener("prerenderingchange",y,!0)},b=function(){return g<0&&(g=T(),E(),s((function(){setTimeout((function(){g=T(),E()}),0)}))),{get firstHiddenTime(){return g}}},C=function(t){document.prerendering?addEventListener("prerenderingchange",(function(){return t()}),!0):t()},L=[1800,3e3],M=function(t,e){e=e||{},C((function(){var n,r=b(),i=l("FCP"),a=d("paint",(function(t){t.forEach((function(t){"first-contentful-paint"===t.name&&(a.disconnect(),t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-f(),0),i.entries.push(t),n(!0)))}))}));a&&(n=m(t,i,L,e.reportAllChanges),s((function(r){i=l("FCP"),n=m(t,i,L,e.reportAllChanges),p((function(){i.value=performance.now()-r.timeStamp,n(!0)}))})))}))},w=[.1,.25],F=function(t){return t<=0||t>performance.now()},I=0,P=1/0,D=0,k=function(t){t.forEach((function(t){t.interactionId&&(P=Math.min(P,t.interactionId),D=Math.max(D,t.interactionId),I=D?(D-P)/7+1:0)}))},x=function(){"interactionCount"in performance||e||(e=d("event",k,{type:"event",buffered:!0,durationThreshold:0}))},A=[],B=new Map,R=0,q=function(){return(e?I:performance.interactionCount||0)-R},N=[],H=self.requestIdleCallback||self.setTimeout,O=self.cancelIdleCallback||self.clearTimeout,V=function(t){var e=-1;return"hidden"===document.visibilityState?t():(e=H(t),v((function(){O(e),t()}))),e},W=[200,500],j=function(t,e){e=e||{},C((function(){var n,r;x();var i,a=l("INP"),o=null!==(n=e.durationThreshold)&&void 0!==n?n:40,u=function(t){t.forEach((function(t){"first-input"===t.entryType&&t.duration>=o||function(t){if(N.forEach((function(e){return e(t)})),t.interactionId||"first-input"===t.entryType){var e=A[A.length-1],n=B.get(t.interactionId);if(n||A.length<10||t.duration>e.latency){if(n)t.duration>n.latency?(n.entries=[t],n.latency=t.duration):t.duration===n.latency&&t.startTime===n.entries[0].startTime&&n.entries.push(t);else{var r={id:t.interactionId,latency:t.duration,entries:[t]};B.set(r.id,r),A.push(r)}A.sort((function(t,e){return e.latency-t.latency})),A.length>10&&A.splice(10).forEach((function(t){return B.delete(t.id)}))}}}(t)}));var e,n=(e=Math.min(A.length-1,Math.floor(q()/50)),A[e]);n&&n.latency!==a.value&&(a.value=n.latency,a.entries=n.entries,i())},c=d("event",u,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40});i=m(t,a,W,e.reportAllChanges),c&&("PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&c.observe({type:"first-input",buffered:!0}),v((function(){u(c.takeRecords()),a.value<0&&q()>0&&(a.value=0,a.entries=[]),i(!0)})),s((function(){R=0,A.length=0,B.clear(),a=l("INP"),i=m(t,a,W,e.reportAllChanges)})))}))},U=[],_=new Map,z=[],G=new WeakMap,J=-1,K=function(t){t.forEach((function(t){return U.push(t)}))},Q=function(){z=z.slice(-50);var t=new Set(z.concat(A.map((function(t){return G.get(t.entries[0])}))));_.forEach((function(e,n){t.has(n)||_.delete(n)}));var e=new Set;_.forEach((function(t){tt(t.startTime,t.processingEnd).forEach((function(t){e.add(t)}))})),U=Array.from(e),J=-1};N.push((function(t){for(var e,n=t.startTime+t.duration,r=z.length-1;r>=0;r--)if(e=z[r],Math.abs(n-e)<=8){var i=_.get(e);i.startTime=Math.min(t.startTime,i.startTime),i.processingStart=Math.min(t.processingStart,i.processingStart),i.processingEnd=Math.max(t.processingEnd,i.processingEnd),i.entries.push(t),n=e;break}n!==e&&(z.push(n),_.set(n,{startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,entries:[t]})),(t.interactionId||"first-input"===t.entryType)&&G.set(t,n),J<0&&(J=V(Q))}));var X,Y,Z,$,tt=function(t,e){for(var n,r=[],i=0;n=U[i];i++)if(!(n.startTime+n.duration<t)){if(n.startTime>e)break;r.push(n)}return r},et=[2500,4e3],nt={},rt=[800,1800],it=function t(e){document.prerendering?C((function(){return t(e)})):"complete"!==document.readyState?addEventListener("load",(function(){return t(e)}),!0):setTimeout(e,0)},at=function(t,e){e=e||{};var n=l("TTFB"),i=m(t,n,rt,e.reportAllChanges);it((function(){var a=r();if(a){var o=a.responseStart;if(F(o))return;n.value=Math.max(o-f(),0),n.entries=[a],i(!0),s((function(){n=l("TTFB",0),(i=m(t,n,rt,e.reportAllChanges))(!0)}))}}))},ot={passive:!0,capture:!0},ut=new Date,ct=function(t,e){X||(X=e,Y=t,Z=new Date,lt(removeEventListener),st())},st=function(){if(Y>=0&&Y<Z-ut){var t={entryType:"first-input",name:X.type,target:X.target,cancelable:X.cancelable,startTime:X.timeStamp,processingStart:X.timeStamp+Y};$.forEach((function(e){e(t)})),$=[]}},ft=function(t){if(t.cancelable){var e=(t.timeStamp>1e12?new Date:performance.now())-t.timeStamp;"pointerdown"==t.type?function(t,e){var n=function(){ct(t,e),i()},r=function(){i()},i=function(){removeEventListener("pointerup",n,ot),removeEventListener("pointercancel",r,ot)};addEventListener("pointerup",n,ot),addEventListener("pointercancel",r,ot)}(e,t):ct(e,t)}},lt=function(t){["mousedown","keydown","touchstart","pointerdown"].forEach((function(e){return t(e,ft,ot)}))},dt=[100,300],mt=function(t,e){e=e||{},C((function(){var n,r=b(),i=l("FID"),a=function(t){t.startTime<r.firstHiddenTime&&(i.value=t.processingStart-t.startTime,i.entries.push(t),n(!0))},o=function(t){t.forEach(a)},u=d("first-input",o);n=m(t,i,dt,e.reportAllChanges),u&&(v(h((function(){o(u.takeRecords()),u.disconnect()}))),s((function(){var r;i=l("FID"),n=m(t,i,dt,e.reportAllChanges),$=[],Y=-1,X=null,lt(addEventListener),r=a,$.push(r),st()})))}))};return t.CLSThresholds=w,t.FCPThresholds=L,t.FIDThresholds=dt,t.INPThresholds=W,t.LCPThresholds=et,t.TTFBThresholds=rt,t.onCLS=function(t,e){!function(t,e){e=e||{},M(h((function(){var n,r=l("CLS",0),i=0,a=[],o=function(t){t.forEach((function(t){if(!t.hadRecentInput){var e=a[0],n=a[a.length-1];i&&t.startTime-n.startTime<1e3&&t.startTime-e.startTime<5e3?(i+=t.value,a.push(t)):(i=t.value,a=[t])}})),i>r.value&&(r.value=i,r.entries=a,n())},u=d("layout-shift",o);u&&(n=m(t,r,w,e.reportAllChanges),v((function(){o(u.takeRecords()),n(!0)})),s((function(){i=0,r=l("CLS",0),n=m(t,r,w,e.reportAllChanges),p((function(){return n()}))})),setTimeout(n,0))})))}((function(e){!function(t){if(t.entries.length){var e=t.entries.reduce((function(t,e){return t&&t.value>e.value?t:e}));if(e&&e.sources&&e.sources.length){var n=(r=e.sources).find((function(t){return t.node&&1===t.node.nodeType}))||r[0];if(n)return void(t.attribution={largestShiftTarget:o(n.node),largestShiftTime:e.startTime,largestShiftValue:e.value,largestShiftSource:n,largestShiftEntry:e,loadState:i(e.startTime)})}}var r;t.attribution={}}(e),t(e)}),e)},t.onFCP=function(t,e){M((function(e){!function(t){if(t.entries.length){var e=r(),n=t.entries[t.entries.length-1];if(e){var a=e.responseStart;if(F(a))return;var o=e.activationStart||0,u=Math.max(0,a-o);return void(t.attribution={timeToFirstByte:u,firstByteToFCP:t.value-u,loadState:i(t.entries[0].startTime),navigationEntry:e,fcpEntry:n})}}t.attribution={timeToFirstByte:0,firstByteToFCP:t.value,loadState:i(c())}}(e),t(e)}),e)},t.onFID=function(t,e){mt((function(e){!function(t){var e=t.entries[0];t.attribution={eventTarget:o(e.target),eventType:e.name,eventTime:e.startTime,eventEntry:e,loadState:i(e.startTime)}}(e),t(e)}),e)},t.onINP=function(t,e){n||(n=d("long-animation-frame",K)),j((function(e){V((function(){!function(t){var e=t.entries[0],n=G.get(e),r=_.get(n),a=e.processingStart,u=r.processingEnd,c=r.entries.sort((function(t,e){return t.processingStart-e.processingStart})),s=tt(e.startTime,u),f=t.entries.find((function(t){return t.target})),l=[e.startTime+e.duration,u].concat(s.map((function(t){return t.startTime+t.duration}))),d=Math.max.apply(Math,l);t.attribution={interactionTarget:o(f&&f.target),interactionType:e.name.startsWith("key")?"keyboard":"pointer",interactionTime:e.startTime,nextPaintTime:d,processedEventEntries:c,longAnimationFrameEntries:s,inputDelay:a-e.startTime,processingDuration:u-a,presentationDelay:Math.max(d-u,0),loadState:i(e.startTime)}}(e),t(e)}))}),e)},t.onLCP=function(t,e){!function(t,e){e=e||{},C((function(){var n,r=b(),i=l("LCP"),a=function(t){var e=t[t.length-1];e&&e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-f(),0),i.entries=[e],n())},o=d("largest-contentful-paint",a);if(o){n=m(t,i,et,e.reportAllChanges);var u=h((function(){nt[i.id]||(a(o.takeRecords()),o.disconnect(),nt[i.id]=!0,n(!0))}));["keydown","click"].forEach((function(t){addEventListener(t,(function(){return V(u)}),!0)})),v(u),s((function(r){i=l("LCP"),n=m(t,i,et,e.reportAllChanges),p((function(){i.value=performance.now()-r.timeStamp,nt[i.id]=!0,n(!0)}))}))}}))}((function(e){!function(t){if(t.entries.length){var e=r();if(e){var n=e.responseStart;if(F(n))return;var i=e.activationStart||0,a=t.entries[t.entries.length-1],u=a.url&&performance.getEntriesByType("resource").filter((function(t){return t.name===a.url}))[0],c=Math.max(0,n-i),s=Math.max(c,u?(u.requestStart||u.startTime)-i:0),f=Math.max(s,u?u.responseEnd-i:0),l=Math.max(f,a.startTime-i),d={element:o(a.element),timeToFirstByte:c,resourceLoadDelay:s-c,resourceLoadDuration:f-s,elementRenderDelay:l-f,navigationEntry:e,lcpEntry:a};return a.url&&(d.url=a.url),u&&(d.lcpResourceEntry=u),void(t.attribution=d)}}t.attribution={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value}}(e),t(e)}),e)},t.onTTFB=function(t,e){at((function(e){!function(t){if(t.entries.length){var e=t.entries[0],n=e.activationStart||0,r=Math.max(e.domainLookupStart-n,0),i=Math.max(e.connectStart-n,0),a=Math.max(e.requestStart-n,0);t.attribution={waitingTime:r,dnsTime:i-r,connectionTime:a-i,requestTime:t.value-a,navigationEntry:e}}else t.attribution={waitingTime:0,dnsTime:0,connectionTime:0,requestTime:0}}(e),t(e)}),e)},t}({});
var webVitals=function(t){"use strict";var e,n,r=function(){return self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},i=function(t){if("loading"===document.readyState)return"loading";var e=r();if(e){if(t<e.domInteractive)return"loading";if(0===e.domContentLoadedEventStart||t<e.domContentLoadedEventStart)return"dom-interactive";if(0===e.domComplete||t<e.domComplete)return"dom-content-loaded"}return"complete"},a=function(t){var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},o=function(t,e){var n="";try{for(;t&&9!==t.nodeType;){var r=t,i=r.id?"#"+r.id:a(r)+(r.classList&&r.classList.value&&r.classList.value.trim()&&r.classList.value.trim().length?"."+r.classList.value.trim().replace(/\s+/g,"."):"");if(n.length+i.length>(e||100)-1)return n||i;if(n=n?i+">"+n:i,r.id)break;t=r.parentNode}}catch(t){}return n},u=-1,c=function(){return u},s=function(t){addEventListener("pageshow",(function(e){e.persisted&&(u=e.timeStamp,t(e))}),!0)},f=function(){var t=r();return t&&t.activationStart||0},d=function(t,e){var n=r(),i="navigate";c()>=0?i="back-forward-cache":n&&(document.prerendering||f()>0?i="prerender":document.wasDiscarded?i="restore":n.type&&(i=n.type.replace(/_/g,"-")));return{name:t,value:void 0===e?-1:e,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},l=function(t,e,n){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var r=new PerformanceObserver((function(t){Promise.resolve().then((function(){e(t.getEntries())}))}));return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch(t){}},m=function(t,e,n,r){var i,a;return function(o){e.value>=0&&(o||r)&&((a=e.value-(i||0))||void 0===i)&&(i=e.value,e.delta=a,e.rating=function(t,e){return t>e[1]?"poor":t>e[0]?"needs-improvement":"good"}(e.value,n),t(e))}},p=function(t){requestAnimationFrame((function(){return requestAnimationFrame((function(){return t()}))}))},v=function(t){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&t()}))},h=function(t){var e=!1;return function(){e||(t(),e=!0)}},g=-1,T=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},y=function(t){"hidden"===document.visibilityState&&g>-1&&(g="visibilitychange"===t.type?t.timeStamp:0,S())},E=function(){addEventListener("visibilitychange",y,!0),addEventListener("prerenderingchange",y,!0)},S=function(){removeEventListener("visibilitychange",y,!0),removeEventListener("prerenderingchange",y,!0)},b=function(){return g<0&&(g=T(),E(),s((function(){setTimeout((function(){g=T(),E()}),0)}))),{get firstHiddenTime(){return g}}},L=function(t){document.prerendering?addEventListener("prerenderingchange",(function(){return t()}),!0):t()},C=[1800,3e3],M=function(t,e){e=e||{},L((function(){var n,r=b(),i=d("FCP"),a=l("paint",(function(t){t.forEach((function(t){"first-contentful-paint"===t.name&&(a.disconnect(),t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-f(),0),i.entries.push(t),n(!0)))}))}));a&&(n=m(t,i,C,e.reportAllChanges),s((function(r){i=d("FCP"),n=m(t,i,C,e.reportAllChanges),p((function(){i.value=performance.now()-r.timeStamp,n(!0)}))})))}))},w=[.1,.25],D=function(t){return t<=0||t>performance.now()},F=0,P=1/0,I=0,k=function(t){t.forEach((function(t){t.interactionId&&(P=Math.min(P,t.interactionId),I=Math.max(I,t.interactionId),F=I?(I-P)/7+1:0)}))},x=function(){"interactionCount"in performance||e||(e=l("event",k,{type:"event",buffered:!0,durationThreshold:0}))},A=[],B=new Map,R=0,q=function(){return(e?F:performance.interactionCount||0)-R},N=[],H=function(t){if(N.forEach((function(e){return e(t)})),t.interactionId||"first-input"===t.entryType){var e=A[A.length-1],n=B.get(t.interactionId);if(n||A.length<10||t.duration>e.latency){if(n)t.duration>n.latency?(n.entries=[t],n.latency=t.duration):t.duration===n.latency&&t.startTime===n.entries[0].startTime&&n.entries.push(t);else{var r={id:t.interactionId,latency:t.duration,entries:[t]};B.set(r.id,r),A.push(r)}A.sort((function(t,e){return e.latency-t.latency})),A.length>10&&A.splice(10).forEach((function(t){return B.delete(t.id)}))}}},O=self.requestIdleCallback||self.setTimeout,V=function(t){var e=-1;return t=h(t),"hidden"===document.visibilityState?t():(e=O(t),v(t)),e},W=[200,500],j=function(t,e){e=e||{},L((function(){var n;x();var r,i=d("INP"),a=function(t){t.forEach(H);var e,n=(e=Math.min(A.length-1,Math.floor(q()/50)),A[e]);n&&n.latency!==i.value&&(i.value=n.latency,i.entries=n.entries,r())},o=l("event",a,{durationThreshold:null!==(n=e.durationThreshold)&&void 0!==n?n:40});r=m(t,i,W,e.reportAllChanges),o&&("PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&o.observe({type:"first-input",buffered:!0}),v((function(){a(o.takeRecords()),r(!0)})),s((function(){R=0,A.length=0,B.clear(),i=d("INP"),r=m(t,i,W,e.reportAllChanges)})))}))},U=[],_=new Map,z=[],G=new WeakMap,J=-1,K=function(t){t.forEach((function(t){return U.push(t)}))},Q=function(){z=z.slice(-50);var t=new Set(z.concat(A.map((function(t){return G.get(t.entries[0])}))));_.forEach((function(e,n){t.has(n)||_.delete(n)}));var e=new Set;_.forEach((function(t){tt(t.startTime,t.processingEnd).forEach((function(t){e.add(t)}))})),U=Array.from(e),J=-1};N.push((function(t){for(var e,n=t.startTime+t.duration,r=z.length-1;r>=0;r--)if(e=z[r],Math.abs(n-e)<=8){var i=_.get(e);i.startTime=Math.min(t.startTime,i.startTime),i.processingStart=Math.min(t.processingStart,i.processingStart),i.processingEnd=Math.max(t.processingEnd,i.processingEnd),i.entries.push(t),n=e;break}n!==e&&(z.push(n),_.set(n,{startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,entries:[t]})),(t.interactionId||"first-input"===t.entryType)&&G.set(t,n),J<0&&(J=V(Q))}));var X,Y,Z,$,tt=function(t,e){for(var n,r=[],i=0;n=U[i];i++)if(!(n.startTime+n.duration<t)){if(n.startTime>e)break;r.push(n)}return r},et=[2500,4e3],nt={},rt=[800,1800],it=function t(e){document.prerendering?L((function(){return t(e)})):"complete"!==document.readyState?addEventListener("load",(function(){return t(e)}),!0):setTimeout(e,0)},at=function(t,e){e=e||{};var n=d("TTFB"),i=m(t,n,rt,e.reportAllChanges);it((function(){var a=r();if(a){var o=a.responseStart;if(D(o))return;n.value=Math.max(o-f(),0),n.entries=[a],i(!0),s((function(){n=d("TTFB",0),(i=m(t,n,rt,e.reportAllChanges))(!0)}))}}))},ot={passive:!0,capture:!0},ut=new Date,ct=function(t,e){X||(X=e,Y=t,Z=new Date,dt(removeEventListener),st())},st=function(){if(Y>=0&&Y<Z-ut){var t={entryType:"first-input",name:X.type,target:X.target,cancelable:X.cancelable,startTime:X.timeStamp,processingStart:X.timeStamp+Y};$.forEach((function(e){e(t)})),$=[]}},ft=function(t){if(t.cancelable){var e=(t.timeStamp>1e12?new Date:performance.now())-t.timeStamp;"pointerdown"==t.type?function(t,e){var n=function(){ct(t,e),i()},r=function(){i()},i=function(){removeEventListener("pointerup",n,ot),removeEventListener("pointercancel",r,ot)};addEventListener("pointerup",n,ot),addEventListener("pointercancel",r,ot)}(e,t):ct(e,t)}},dt=function(t){["mousedown","keydown","touchstart","pointerdown"].forEach((function(e){return t(e,ft,ot)}))},lt=[100,300],mt=function(t,e){e=e||{},L((function(){var n,r=b(),i=d("FID"),a=function(t){t.startTime<r.firstHiddenTime&&(i.value=t.processingStart-t.startTime,i.entries.push(t),n(!0))},o=function(t){t.forEach(a)},u=l("first-input",o);n=m(t,i,lt,e.reportAllChanges),u&&(v(h((function(){o(u.takeRecords()),u.disconnect()}))),s((function(){var r;i=d("FID"),n=m(t,i,lt,e.reportAllChanges),$=[],Y=-1,X=null,dt(addEventListener),r=a,$.push(r),st()})))}))};return t.CLSThresholds=w,t.FCPThresholds=C,t.FIDThresholds=lt,t.INPThresholds=W,t.LCPThresholds=et,t.TTFBThresholds=rt,t.onCLS=function(t,e){!function(t,e){e=e||{},M(h((function(){var n,r=d("CLS",0),i=0,a=[],o=function(t){t.forEach((function(t){if(!t.hadRecentInput){var e=a[0],n=a[a.length-1];i&&t.startTime-n.startTime<1e3&&t.startTime-e.startTime<5e3?(i+=t.value,a.push(t)):(i=t.value,a=[t])}})),i>r.value&&(r.value=i,r.entries=a,n())},u=l("layout-shift",o);u&&(n=m(t,r,w,e.reportAllChanges),v((function(){o(u.takeRecords()),n(!0)})),s((function(){i=0,r=d("CLS",0),n=m(t,r,w,e.reportAllChanges),p((function(){return n()}))})),setTimeout(n,0))})))}((function(e){!function(t){if(t.entries.length){var e=t.entries.reduce((function(t,e){return t&&t.value>e.value?t:e}));if(e&&e.sources&&e.sources.length){var n=(r=e.sources).find((function(t){return t.node&&1===t.node.nodeType}))||r[0];if(n)return void(t.attribution={largestShiftTarget:o(n.node),largestShiftTime:e.startTime,largestShiftValue:e.value,largestShiftSource:n,largestShiftEntry:e,loadState:i(e.startTime)})}}var r;t.attribution={}}(e),t(e)}),e)},t.onFCP=function(t,e){M((function(e){!function(t){if(t.entries.length){var e=r(),n=t.entries[t.entries.length-1];if(e){var a=e.responseStart;if(D(a))return;var o=e.activationStart||0,u=Math.max(0,a-o);return void(t.attribution={timeToFirstByte:u,firstByteToFCP:t.value-u,loadState:i(t.entries[0].startTime),navigationEntry:e,fcpEntry:n})}}t.attribution={timeToFirstByte:0,firstByteToFCP:t.value,loadState:i(c())}}(e),t(e)}),e)},t.onFID=function(t,e){mt((function(e){!function(t){var e=t.entries[0];t.attribution={eventTarget:o(e.target),eventType:e.name,eventTime:e.startTime,eventEntry:e,loadState:i(e.startTime)}}(e),t(e)}),e)},t.onINP=function(t,e){n||(n=l("long-animation-frame",K)),j((function(e){V((function(){!function(t){var e=t.entries[0],n=G.get(e),r=_.get(n),a=e.processingStart,u=r.processingEnd,c=r.entries.sort((function(t,e){return t.processingStart-e.processingStart})),s=tt(e.startTime,u),f=t.entries.find((function(t){return t.target})),d=[e.startTime+e.duration,u].concat(s.map((function(t){return t.startTime+t.duration}))),l=Math.max.apply(Math,d);t.attribution={interactionTarget:o(f&&f.target),interactionType:e.name.startsWith("key")?"keyboard":"pointer",interactionTime:e.startTime,nextPaintTime:l,processedEventEntries:c,longAnimationFrameEntries:s,inputDelay:a-e.startTime,processingDuration:u-a,presentationDelay:Math.max(l-u,0),loadState:i(e.startTime)}}(e),t(e)}))}),e)},t.onLCP=function(t,e){!function(t,e){e=e||{},L((function(){var n,r=b(),i=d("LCP"),a=function(t){var e=t[t.length-1];e&&e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-f(),0),i.entries=[e],n())},o=l("largest-contentful-paint",a);if(o){n=m(t,i,et,e.reportAllChanges);var u=h((function(){nt[i.id]||(a(o.takeRecords()),o.disconnect(),nt[i.id]=!0,n(!0))}));["keydown","click"].forEach((function(t){addEventListener(t,(function(){return V(u)}),!0)})),v(u),s((function(r){i=d("LCP"),n=m(t,i,et,e.reportAllChanges),p((function(){i.value=performance.now()-r.timeStamp,nt[i.id]=!0,n(!0)}))}))}}))}((function(e){!function(t){if(t.entries.length){var e=r();if(e){var n=e.responseStart;if(D(n))return;var i=e.activationStart||0,a=t.entries[t.entries.length-1],u=a.url&&performance.getEntriesByType("resource").filter((function(t){return t.name===a.url}))[0],c=Math.max(0,n-i),s=Math.max(c,u?(u.requestStart||u.startTime)-i:0),f=Math.max(s,u?u.responseEnd-i:0),d=Math.max(f,a.startTime-i),l={element:o(a.element),timeToFirstByte:c,resourceLoadDelay:s-c,resourceLoadDuration:f-s,elementRenderDelay:d-f,navigationEntry:e,lcpEntry:a};return a.url&&(l.url=a.url),u&&(l.lcpResourceEntry=u),void(t.attribution=l)}}t.attribution={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value}}(e),t(e)}),e)},t.onTTFB=function(t,e){at((function(e){!function(t){if(t.entries.length){var e=t.entries[0],n=e.activationStart||0,r=Math.max(e.domainLookupStart-n,0),i=Math.max(e.connectStart-n,0),a=Math.max(e.requestStart-n,0);t.attribution={waitingDuration:r,dnsDuration:i-r,connectionDuration:a-i,requestDuration:t.value-a,navigationEntry:e}}else t.attribution={waitingDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0}}(e),t(e)}),e)},t}({});

@@ -1,1 +0,1 @@

var t,e,n=function(){return self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},r=function(t){if("loading"===document.readyState)return"loading";var e=n();if(e){if(t<e.domInteractive)return"loading";if(0===e.domContentLoadedEventStart||t<e.domContentLoadedEventStart)return"dom-interactive";if(0===e.domComplete||t<e.domComplete)return"dom-content-loaded"}return"complete"},i=function(t){var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},a=function(t,e){var n="";try{for(;t&&9!==t.nodeType;){var r=t,a=r.id?"#"+r.id:i(r)+(r.classList&&r.classList.value&&r.classList.value.trim()&&r.classList.value.trim().length?"."+r.classList.value.trim().replace(/\s+/g,"."):"");if(n.length+a.length>(e||100)-1)return n||a;if(n=n?a+">"+n:a,r.id)break;t=r.parentNode}}catch(t){}return n},o=-1,u=function(){return o},c=function(t){addEventListener("pageshow",(function(e){e.persisted&&(o=e.timeStamp,t(e))}),!0)},s=function(){var t=n();return t&&t.activationStart||0},f=function(t,e){var r=n(),i="navigate";u()>=0?i="back-forward-cache":r&&(document.prerendering||s()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-")));return{name:t,value:void 0===e?-1:e,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},l=function(t,e,n){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var r=new PerformanceObserver((function(t){Promise.resolve().then((function(){e(t.getEntries())}))}));return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch(t){}},d=function(t,e,n,r){var i,a;return function(o){e.value>=0&&(o||r)&&((a=e.value-(i||0))||void 0===i)&&(i=e.value,e.delta=a,e.rating=function(t,e){return t>e[1]?"poor":t>e[0]?"needs-improvement":"good"}(e.value,n),t(e))}},m=function(t){requestAnimationFrame((function(){return requestAnimationFrame((function(){return t()}))}))},p=function(t){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&t()}))},v=function(t){var e=!1;return function(){e||(t(),e=!0)}},h=-1,g=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},T=function(t){"hidden"===document.visibilityState&&h>-1&&(h="visibilitychange"===t.type?t.timeStamp:0,E())},y=function(){addEventListener("visibilitychange",T,!0),addEventListener("prerenderingchange",T,!0)},E=function(){removeEventListener("visibilitychange",T,!0),removeEventListener("prerenderingchange",T,!0)},S=function(){return h<0&&(h=g(),y(),c((function(){setTimeout((function(){h=g(),y()}),0)}))),{get firstHiddenTime(){return h}}},b=function(t){document.prerendering?addEventListener("prerenderingchange",(function(){return t()}),!0):t()},L=[1800,3e3],C=function(t,e){e=e||{},b((function(){var n,r=S(),i=f("FCP"),a=l("paint",(function(t){t.forEach((function(t){"first-contentful-paint"===t.name&&(a.disconnect(),t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-s(),0),i.entries.push(t),n(!0)))}))}));a&&(n=d(t,i,L,e.reportAllChanges),c((function(r){i=f("FCP"),n=d(t,i,L,e.reportAllChanges),m((function(){i.value=performance.now()-r.timeStamp,n(!0)}))})))}))},M=[.1,.25],w=function(t,e){!function(t,e){e=e||{},C(v((function(){var n,r=f("CLS",0),i=0,a=[],o=function(t){t.forEach((function(t){if(!t.hadRecentInput){var e=a[0],n=a[a.length-1];i&&t.startTime-n.startTime<1e3&&t.startTime-e.startTime<5e3?(i+=t.value,a.push(t)):(i=t.value,a=[t])}})),i>r.value&&(r.value=i,r.entries=a,n())},u=l("layout-shift",o);u&&(n=d(t,r,M,e.reportAllChanges),p((function(){o(u.takeRecords()),n(!0)})),c((function(){i=0,r=f("CLS",0),n=d(t,r,M,e.reportAllChanges),m((function(){return n()}))})),setTimeout(n,0))})))}((function(e){!function(t){if(t.entries.length){var e=t.entries.reduce((function(t,e){return t&&t.value>e.value?t:e}));if(e&&e.sources&&e.sources.length){var n=(i=e.sources).find((function(t){return t.node&&1===t.node.nodeType}))||i[0];if(n)return void(t.attribution={largestShiftTarget:a(n.node),largestShiftTime:e.startTime,largestShiftValue:e.value,largestShiftSource:n,largestShiftEntry:e,loadState:r(e.startTime)})}}var i;t.attribution={}}(e),t(e)}),e)},k=function(t){return t<=0||t>performance.now()},x=function(t,e){C((function(e){!function(t){if(t.entries.length){var e=n(),i=t.entries[t.entries.length-1];if(e){var a=e.responseStart;if(k(a))return;var o=e.activationStart||0,c=Math.max(0,a-o);return void(t.attribution={timeToFirstByte:c,firstByteToFCP:t.value-c,loadState:r(t.entries[0].startTime),navigationEntry:e,fcpEntry:i})}}t.attribution={timeToFirstByte:0,firstByteToFCP:t.value,loadState:r(u())}}(e),t(e)}),e)},A=0,D=1/0,I=0,F=function(t){t.forEach((function(t){t.interactionId&&(D=Math.min(D,t.interactionId),I=Math.max(I,t.interactionId),A=I?(I-D)/7+1:0)}))},P=function(){"interactionCount"in performance||t||(t=l("event",F,{type:"event",buffered:!0,durationThreshold:0}))},B=[],R=new Map,q=0,H=function(){return(t?A:performance.interactionCount||0)-q},N=[],O=self.requestIdleCallback||self.setTimeout,W=self.cancelIdleCallback||self.clearTimeout,j=function(t){var e=-1;return"hidden"===document.visibilityState?t():(e=O(t),p((function(){W(e),t()}))),e},U=[200,500],V=function(t,e){e=e||{},b((function(){var n,r;P();var i,a=f("INP"),o=null!==(n=e.durationThreshold)&&void 0!==n?n:40,u=function(t){t.forEach((function(t){"first-input"===t.entryType&&t.duration>=o||function(t){if(N.forEach((function(e){return e(t)})),t.interactionId||"first-input"===t.entryType){var e=B[B.length-1],n=R.get(t.interactionId);if(n||B.length<10||t.duration>e.latency){if(n)t.duration>n.latency?(n.entries=[t],n.latency=t.duration):t.duration===n.latency&&t.startTime===n.entries[0].startTime&&n.entries.push(t);else{var r={id:t.interactionId,latency:t.duration,entries:[t]};R.set(r.id,r),B.push(r)}B.sort((function(t,e){return e.latency-t.latency})),B.length>10&&B.splice(10).forEach((function(t){return R.delete(t.id)}))}}}(t)}));var e,n=(e=Math.min(B.length-1,Math.floor(H()/50)),B[e]);n&&n.latency!==a.value&&(a.value=n.latency,a.entries=n.entries,i())},s=l("event",u,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40});i=d(t,a,U,e.reportAllChanges),s&&("PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&s.observe({type:"first-input",buffered:!0}),p((function(){u(s.takeRecords()),a.value<0&&H()>0&&(a.value=0,a.entries=[]),i(!0)})),c((function(){q=0,B.length=0,R.clear(),a=f("INP"),i=d(t,a,U,e.reportAllChanges)})))}))},_=[],z=new Map,G=[],J=new WeakMap,K=-1,Q=function(t){t.forEach((function(t){return _.push(t)}))},X=function(){G=G.slice(-50);var t=new Set(G.concat(B.map((function(t){return J.get(t.entries[0])}))));z.forEach((function(e,n){t.has(n)||z.delete(n)}));var e=new Set;z.forEach((function(t){et(t.startTime,t.processingEnd).forEach((function(t){e.add(t)}))})),_=Array.from(e),K=-1};N.push((function(t){for(var e,n=t.startTime+t.duration,r=G.length-1;r>=0;r--)if(e=G[r],Math.abs(n-e)<=8){var i=z.get(e);i.startTime=Math.min(t.startTime,i.startTime),i.processingStart=Math.min(t.processingStart,i.processingStart),i.processingEnd=Math.max(t.processingEnd,i.processingEnd),i.entries.push(t),n=e;break}n!==e&&(G.push(n),z.set(n,{startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,entries:[t]})),(t.interactionId||"first-input"===t.entryType)&&J.set(t,n),K<0&&(K=j(X))}));var Y,Z,$,tt,et=function(t,e){for(var n,r=[],i=0;n=_[i];i++)if(!(n.startTime+n.duration<t)){if(n.startTime>e)break;r.push(n)}return r},nt=function(t,n){e||(e=l("long-animation-frame",Q)),V((function(e){j((function(){!function(t){var e=t.entries[0],n=J.get(e),i=z.get(n),o=e.processingStart,u=i.processingEnd,c=i.entries.sort((function(t,e){return t.processingStart-e.processingStart})),s=et(e.startTime,u),f=t.entries.find((function(t){return t.target})),l=[e.startTime+e.duration,u].concat(s.map((function(t){return t.startTime+t.duration}))),d=Math.max.apply(Math,l);t.attribution={interactionTarget:a(f&&f.target),interactionType:e.name.startsWith("key")?"keyboard":"pointer",interactionTime:e.startTime,nextPaintTime:d,processedEventEntries:c,longAnimationFrameEntries:s,inputDelay:o-e.startTime,processingDuration:u-o,presentationDelay:Math.max(d-u,0),loadState:r(e.startTime)}}(e),t(e)}))}),n)},rt=[2500,4e3],it={},at=function(t,e){!function(t,e){e=e||{},b((function(){var n,r=S(),i=f("LCP"),a=function(t){var e=t[t.length-1];e&&e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-s(),0),i.entries=[e],n())},o=l("largest-contentful-paint",a);if(o){n=d(t,i,rt,e.reportAllChanges);var u=v((function(){it[i.id]||(a(o.takeRecords()),o.disconnect(),it[i.id]=!0,n(!0))}));["keydown","click"].forEach((function(t){addEventListener(t,(function(){return j(u)}),!0)})),p(u),c((function(r){i=f("LCP"),n=d(t,i,rt,e.reportAllChanges),m((function(){i.value=performance.now()-r.timeStamp,it[i.id]=!0,n(!0)}))}))}}))}((function(e){!function(t){if(t.entries.length){var e=n();if(e){var r=e.responseStart;if(k(r))return;var i=e.activationStart||0,o=t.entries[t.entries.length-1],u=o.url&&performance.getEntriesByType("resource").filter((function(t){return t.name===o.url}))[0],c=Math.max(0,r-i),s=Math.max(c,u?(u.requestStart||u.startTime)-i:0),f=Math.max(s,u?u.responseEnd-i:0),l=Math.max(f,o.startTime-i),d={element:a(o.element),timeToFirstByte:c,resourceLoadDelay:s-c,resourceLoadDuration:f-s,elementRenderDelay:l-f,navigationEntry:e,lcpEntry:o};return o.url&&(d.url=o.url),u&&(d.lcpResourceEntry=u),void(t.attribution=d)}}t.attribution={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value}}(e),t(e)}),e)},ot=[800,1800],ut=function t(e){document.prerendering?b((function(){return t(e)})):"complete"!==document.readyState?addEventListener("load",(function(){return t(e)}),!0):setTimeout(e,0)},ct=function(t,e){e=e||{};var r=f("TTFB"),i=d(t,r,ot,e.reportAllChanges);ut((function(){var a=n();if(a){var o=a.responseStart;if(k(o))return;r.value=Math.max(o-s(),0),r.entries=[a],i(!0),c((function(){r=f("TTFB",0),(i=d(t,r,ot,e.reportAllChanges))(!0)}))}}))},st=function(t,e){ct((function(e){!function(t){if(t.entries.length){var e=t.entries[0],n=e.activationStart||0,r=Math.max(e.domainLookupStart-n,0),i=Math.max(e.connectStart-n,0),a=Math.max(e.requestStart-n,0);t.attribution={waitingTime:r,dnsTime:i-r,connectionTime:a-i,requestTime:t.value-a,navigationEntry:e}}else t.attribution={waitingTime:0,dnsTime:0,connectionTime:0,requestTime:0}}(e),t(e)}),e)},ft={passive:!0,capture:!0},lt=new Date,dt=function(t,e){Y||(Y=e,Z=t,$=new Date,vt(removeEventListener),mt())},mt=function(){if(Z>=0&&Z<$-lt){var t={entryType:"first-input",name:Y.type,target:Y.target,cancelable:Y.cancelable,startTime:Y.timeStamp,processingStart:Y.timeStamp+Z};tt.forEach((function(e){e(t)})),tt=[]}},pt=function(t){if(t.cancelable){var e=(t.timeStamp>1e12?new Date:performance.now())-t.timeStamp;"pointerdown"==t.type?function(t,e){var n=function(){dt(t,e),i()},r=function(){i()},i=function(){removeEventListener("pointerup",n,ft),removeEventListener("pointercancel",r,ft)};addEventListener("pointerup",n,ft),addEventListener("pointercancel",r,ft)}(e,t):dt(e,t)}},vt=function(t){["mousedown","keydown","touchstart","pointerdown"].forEach((function(e){return t(e,pt,ft)}))},ht=[100,300],gt=function(t,e){e=e||{},b((function(){var n,r=S(),i=f("FID"),a=function(t){t.startTime<r.firstHiddenTime&&(i.value=t.processingStart-t.startTime,i.entries.push(t),n(!0))},o=function(t){t.forEach(a)},u=l("first-input",o);n=d(t,i,ht,e.reportAllChanges),u&&(p(v((function(){o(u.takeRecords()),u.disconnect()}))),c((function(){var r;i=f("FID"),n=d(t,i,ht,e.reportAllChanges),tt=[],Z=-1,Y=null,vt(addEventListener),r=a,tt.push(r),mt()})))}))},Tt=function(t,e){gt((function(e){!function(t){var e=t.entries[0];t.attribution={eventTarget:a(e.target),eventType:e.name,eventTime:e.startTime,eventEntry:e,loadState:r(e.startTime)}}(e),t(e)}),e)};export{M as CLSThresholds,L as FCPThresholds,ht as FIDThresholds,U as INPThresholds,rt as LCPThresholds,ot as TTFBThresholds,w as onCLS,x as onFCP,Tt as onFID,nt as onINP,at as onLCP,st as onTTFB};
var t,e,n=function(){return self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},r=function(t){if("loading"===document.readyState)return"loading";var e=n();if(e){if(t<e.domInteractive)return"loading";if(0===e.domContentLoadedEventStart||t<e.domContentLoadedEventStart)return"dom-interactive";if(0===e.domComplete||t<e.domComplete)return"dom-content-loaded"}return"complete"},i=function(t){var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},a=function(t,e){var n="";try{for(;t&&9!==t.nodeType;){var r=t,a=r.id?"#"+r.id:i(r)+(r.classList&&r.classList.value&&r.classList.value.trim()&&r.classList.value.trim().length?"."+r.classList.value.trim().replace(/\s+/g,"."):"");if(n.length+a.length>(e||100)-1)return n||a;if(n=n?a+">"+n:a,r.id)break;t=r.parentNode}}catch(t){}return n},o=-1,u=function(){return o},c=function(t){addEventListener("pageshow",(function(e){e.persisted&&(o=e.timeStamp,t(e))}),!0)},s=function(){var t=n();return t&&t.activationStart||0},f=function(t,e){var r=n(),i="navigate";u()>=0?i="back-forward-cache":r&&(document.prerendering||s()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-")));return{name:t,value:void 0===e?-1:e,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},d=function(t,e,n){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var r=new PerformanceObserver((function(t){Promise.resolve().then((function(){e(t.getEntries())}))}));return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch(t){}},l=function(t,e,n,r){var i,a;return function(o){e.value>=0&&(o||r)&&((a=e.value-(i||0))||void 0===i)&&(i=e.value,e.delta=a,e.rating=function(t,e){return t>e[1]?"poor":t>e[0]?"needs-improvement":"good"}(e.value,n),t(e))}},m=function(t){requestAnimationFrame((function(){return requestAnimationFrame((function(){return t()}))}))},p=function(t){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&t()}))},v=function(t){var e=!1;return function(){e||(t(),e=!0)}},h=-1,g=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},T=function(t){"hidden"===document.visibilityState&&h>-1&&(h="visibilitychange"===t.type?t.timeStamp:0,E())},y=function(){addEventListener("visibilitychange",T,!0),addEventListener("prerenderingchange",T,!0)},E=function(){removeEventListener("visibilitychange",T,!0),removeEventListener("prerenderingchange",T,!0)},S=function(){return h<0&&(h=g(),y(),c((function(){setTimeout((function(){h=g(),y()}),0)}))),{get firstHiddenTime(){return h}}},b=function(t){document.prerendering?addEventListener("prerenderingchange",(function(){return t()}),!0):t()},L=[1800,3e3],C=function(t,e){e=e||{},b((function(){var n,r=S(),i=f("FCP"),a=d("paint",(function(t){t.forEach((function(t){"first-contentful-paint"===t.name&&(a.disconnect(),t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-s(),0),i.entries.push(t),n(!0)))}))}));a&&(n=l(t,i,L,e.reportAllChanges),c((function(r){i=f("FCP"),n=l(t,i,L,e.reportAllChanges),m((function(){i.value=performance.now()-r.timeStamp,n(!0)}))})))}))},M=[.1,.25],w=function(t,e){!function(t,e){e=e||{},C(v((function(){var n,r=f("CLS",0),i=0,a=[],o=function(t){t.forEach((function(t){if(!t.hadRecentInput){var e=a[0],n=a[a.length-1];i&&t.startTime-n.startTime<1e3&&t.startTime-e.startTime<5e3?(i+=t.value,a.push(t)):(i=t.value,a=[t])}})),i>r.value&&(r.value=i,r.entries=a,n())},u=d("layout-shift",o);u&&(n=l(t,r,M,e.reportAllChanges),p((function(){o(u.takeRecords()),n(!0)})),c((function(){i=0,r=f("CLS",0),n=l(t,r,M,e.reportAllChanges),m((function(){return n()}))})),setTimeout(n,0))})))}((function(e){!function(t){if(t.entries.length){var e=t.entries.reduce((function(t,e){return t&&t.value>e.value?t:e}));if(e&&e.sources&&e.sources.length){var n=(i=e.sources).find((function(t){return t.node&&1===t.node.nodeType}))||i[0];if(n)return void(t.attribution={largestShiftTarget:a(n.node),largestShiftTime:e.startTime,largestShiftValue:e.value,largestShiftSource:n,largestShiftEntry:e,loadState:r(e.startTime)})}}var i;t.attribution={}}(e),t(e)}),e)},D=function(t){return t<=0||t>performance.now()},x=function(t,e){C((function(e){!function(t){if(t.entries.length){var e=n(),i=t.entries[t.entries.length-1];if(e){var a=e.responseStart;if(D(a))return;var o=e.activationStart||0,c=Math.max(0,a-o);return void(t.attribution={timeToFirstByte:c,firstByteToFCP:t.value-c,loadState:r(t.entries[0].startTime),navigationEntry:e,fcpEntry:i})}}t.attribution={timeToFirstByte:0,firstByteToFCP:t.value,loadState:r(u())}}(e),t(e)}),e)},k=0,A=1/0,F=0,I=function(t){t.forEach((function(t){t.interactionId&&(A=Math.min(A,t.interactionId),F=Math.max(F,t.interactionId),k=F?(F-A)/7+1:0)}))},P=function(){"interactionCount"in performance||t||(t=d("event",I,{type:"event",buffered:!0,durationThreshold:0}))},B=[],R=new Map,q=0,H=function(){return(t?k:performance.interactionCount||0)-q},N=[],O=function(t){if(N.forEach((function(e){return e(t)})),t.interactionId||"first-input"===t.entryType){var e=B[B.length-1],n=R.get(t.interactionId);if(n||B.length<10||t.duration>e.latency){if(n)t.duration>n.latency?(n.entries=[t],n.latency=t.duration):t.duration===n.latency&&t.startTime===n.entries[0].startTime&&n.entries.push(t);else{var r={id:t.interactionId,latency:t.duration,entries:[t]};R.set(r.id,r),B.push(r)}B.sort((function(t,e){return e.latency-t.latency})),B.length>10&&B.splice(10).forEach((function(t){return R.delete(t.id)}))}}},W=self.requestIdleCallback||self.setTimeout,j=function(t){var e=-1;return t=v(t),"hidden"===document.visibilityState?t():(e=W(t),p(t)),e},U=[200,500],V=function(t,e){e=e||{},b((function(){var n;P();var r,i=f("INP"),a=function(t){t.forEach(O);var e,n=(e=Math.min(B.length-1,Math.floor(H()/50)),B[e]);n&&n.latency!==i.value&&(i.value=n.latency,i.entries=n.entries,r())},o=d("event",a,{durationThreshold:null!==(n=e.durationThreshold)&&void 0!==n?n:40});r=l(t,i,U,e.reportAllChanges),o&&("PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&o.observe({type:"first-input",buffered:!0}),p((function(){a(o.takeRecords()),r(!0)})),c((function(){q=0,B.length=0,R.clear(),i=f("INP"),r=l(t,i,U,e.reportAllChanges)})))}))},_=[],z=new Map,G=[],J=new WeakMap,K=-1,Q=function(t){t.forEach((function(t){return _.push(t)}))},X=function(){G=G.slice(-50);var t=new Set(G.concat(B.map((function(t){return J.get(t.entries[0])}))));z.forEach((function(e,n){t.has(n)||z.delete(n)}));var e=new Set;z.forEach((function(t){et(t.startTime,t.processingEnd).forEach((function(t){e.add(t)}))})),_=Array.from(e),K=-1};N.push((function(t){for(var e,n=t.startTime+t.duration,r=G.length-1;r>=0;r--)if(e=G[r],Math.abs(n-e)<=8){var i=z.get(e);i.startTime=Math.min(t.startTime,i.startTime),i.processingStart=Math.min(t.processingStart,i.processingStart),i.processingEnd=Math.max(t.processingEnd,i.processingEnd),i.entries.push(t),n=e;break}n!==e&&(G.push(n),z.set(n,{startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,entries:[t]})),(t.interactionId||"first-input"===t.entryType)&&J.set(t,n),K<0&&(K=j(X))}));var Y,Z,$,tt,et=function(t,e){for(var n,r=[],i=0;n=_[i];i++)if(!(n.startTime+n.duration<t)){if(n.startTime>e)break;r.push(n)}return r},nt=function(t,n){e||(e=d("long-animation-frame",Q)),V((function(e){j((function(){!function(t){var e=t.entries[0],n=J.get(e),i=z.get(n),o=e.processingStart,u=i.processingEnd,c=i.entries.sort((function(t,e){return t.processingStart-e.processingStart})),s=et(e.startTime,u),f=t.entries.find((function(t){return t.target})),d=[e.startTime+e.duration,u].concat(s.map((function(t){return t.startTime+t.duration}))),l=Math.max.apply(Math,d);t.attribution={interactionTarget:a(f&&f.target),interactionType:e.name.startsWith("key")?"keyboard":"pointer",interactionTime:e.startTime,nextPaintTime:l,processedEventEntries:c,longAnimationFrameEntries:s,inputDelay:o-e.startTime,processingDuration:u-o,presentationDelay:Math.max(l-u,0),loadState:r(e.startTime)}}(e),t(e)}))}),n)},rt=[2500,4e3],it={},at=function(t,e){!function(t,e){e=e||{},b((function(){var n,r=S(),i=f("LCP"),a=function(t){var e=t[t.length-1];e&&e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-s(),0),i.entries=[e],n())},o=d("largest-contentful-paint",a);if(o){n=l(t,i,rt,e.reportAllChanges);var u=v((function(){it[i.id]||(a(o.takeRecords()),o.disconnect(),it[i.id]=!0,n(!0))}));["keydown","click"].forEach((function(t){addEventListener(t,(function(){return j(u)}),!0)})),p(u),c((function(r){i=f("LCP"),n=l(t,i,rt,e.reportAllChanges),m((function(){i.value=performance.now()-r.timeStamp,it[i.id]=!0,n(!0)}))}))}}))}((function(e){!function(t){if(t.entries.length){var e=n();if(e){var r=e.responseStart;if(D(r))return;var i=e.activationStart||0,o=t.entries[t.entries.length-1],u=o.url&&performance.getEntriesByType("resource").filter((function(t){return t.name===o.url}))[0],c=Math.max(0,r-i),s=Math.max(c,u?(u.requestStart||u.startTime)-i:0),f=Math.max(s,u?u.responseEnd-i:0),d=Math.max(f,o.startTime-i),l={element:a(o.element),timeToFirstByte:c,resourceLoadDelay:s-c,resourceLoadDuration:f-s,elementRenderDelay:d-f,navigationEntry:e,lcpEntry:o};return o.url&&(l.url=o.url),u&&(l.lcpResourceEntry=u),void(t.attribution=l)}}t.attribution={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value}}(e),t(e)}),e)},ot=[800,1800],ut=function t(e){document.prerendering?b((function(){return t(e)})):"complete"!==document.readyState?addEventListener("load",(function(){return t(e)}),!0):setTimeout(e,0)},ct=function(t,e){e=e||{};var r=f("TTFB"),i=l(t,r,ot,e.reportAllChanges);ut((function(){var a=n();if(a){var o=a.responseStart;if(D(o))return;r.value=Math.max(o-s(),0),r.entries=[a],i(!0),c((function(){r=f("TTFB",0),(i=l(t,r,ot,e.reportAllChanges))(!0)}))}}))},st=function(t,e){ct((function(e){!function(t){if(t.entries.length){var e=t.entries[0],n=e.activationStart||0,r=Math.max(e.domainLookupStart-n,0),i=Math.max(e.connectStart-n,0),a=Math.max(e.requestStart-n,0);t.attribution={waitingDuration:r,dnsDuration:i-r,connectionDuration:a-i,requestDuration:t.value-a,navigationEntry:e}}else t.attribution={waitingDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0}}(e),t(e)}),e)},ft={passive:!0,capture:!0},dt=new Date,lt=function(t,e){Y||(Y=e,Z=t,$=new Date,vt(removeEventListener),mt())},mt=function(){if(Z>=0&&Z<$-dt){var t={entryType:"first-input",name:Y.type,target:Y.target,cancelable:Y.cancelable,startTime:Y.timeStamp,processingStart:Y.timeStamp+Z};tt.forEach((function(e){e(t)})),tt=[]}},pt=function(t){if(t.cancelable){var e=(t.timeStamp>1e12?new Date:performance.now())-t.timeStamp;"pointerdown"==t.type?function(t,e){var n=function(){lt(t,e),i()},r=function(){i()},i=function(){removeEventListener("pointerup",n,ft),removeEventListener("pointercancel",r,ft)};addEventListener("pointerup",n,ft),addEventListener("pointercancel",r,ft)}(e,t):lt(e,t)}},vt=function(t){["mousedown","keydown","touchstart","pointerdown"].forEach((function(e){return t(e,pt,ft)}))},ht=[100,300],gt=function(t,e){e=e||{},b((function(){var n,r=S(),i=f("FID"),a=function(t){t.startTime<r.firstHiddenTime&&(i.value=t.processingStart-t.startTime,i.entries.push(t),n(!0))},o=function(t){t.forEach(a)},u=d("first-input",o);n=l(t,i,ht,e.reportAllChanges),u&&(p(v((function(){o(u.takeRecords()),u.disconnect()}))),c((function(){var r;i=f("FID"),n=l(t,i,ht,e.reportAllChanges),tt=[],Z=-1,Y=null,vt(addEventListener),r=a,tt.push(r),mt()})))}))},Tt=function(t,e){gt((function(e){!function(t){var e=t.entries[0];t.attribution={eventTarget:a(e.target),eventType:e.name,eventTime:e.startTime,eventEntry:e,loadState:r(e.startTime)}}(e),t(e)}),e)};export{M as CLSThresholds,L as FCPThresholds,ht as FIDThresholds,U as INPThresholds,rt as LCPThresholds,ot as TTFBThresholds,w as onCLS,x as onFCP,Tt as onFID,nt as onINP,at as onLCP,st as onTTFB};

@@ -1,1 +0,1 @@

var webVitals=function(e){"use strict";var n,t,r,i,o,a=-1,c=function(e){addEventListener("pageshow",(function(n){n.persisted&&(a=n.timeStamp,e(n))}),!0)},u=function(){return self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},s=function(){var e=u();return e&&e.activationStart||0},f=function(e,n){var t=u(),r="navigate";a>=0?r="back-forward-cache":t&&(document.prerendering||s()>0?r="prerender":document.wasDiscarded?r="restore":t.type&&(r=t.type.replace(/_/g,"-")));return{name:e,value:void 0===n?-1:n,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},d=function(e,n,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){n(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},t||{})),r}}catch(e){}},l=function(e,n,t,r){var i,o;return function(a){n.value>=0&&(a||r)&&((o=n.value-(i||0))||void 0===i)&&(i=n.value,n.delta=o,n.rating=function(e,n){return e>n[1]?"poor":e>n[0]?"needs-improvement":"good"}(n.value,t),e(n))}},v=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},p=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},m=function(e){var n=!1;return function(){n||(e(),n=!0)}},h=-1,g=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},T=function(e){"hidden"===document.visibilityState&&h>-1&&(h="visibilitychange"===e.type?e.timeStamp:0,E())},y=function(){addEventListener("visibilitychange",T,!0),addEventListener("prerenderingchange",T,!0)},E=function(){removeEventListener("visibilitychange",T,!0),removeEventListener("prerenderingchange",T,!0)},C=function(){return h<0&&(h=g(),y(),c((function(){setTimeout((function(){h=g(),y()}),0)}))),{get firstHiddenTime(){return h}}},b=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},L=[1800,3e3],S=function(e,n){n=n||{},b((function(){var t,r=C(),i=f("FCP"),o=d("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-s(),0),i.entries.push(e),t(!0)))}))}));o&&(t=l(e,i,L,n.reportAllChanges),c((function(r){i=f("FCP"),t=l(e,i,L,n.reportAllChanges),v((function(){i.value=performance.now()-r.timeStamp,t(!0)}))})))}))},w=[.1,.25],I=0,P=1/0,A=0,F=function(e){e.forEach((function(e){e.interactionId&&(P=Math.min(P,e.interactionId),A=Math.max(A,e.interactionId),I=A?(A-P)/7+1:0)}))},k=function(){"interactionCount"in performance||n||(n=d("event",F,{type:"event",buffered:!0,durationThreshold:0}))},M=[],D=new Map,B=0,R=function(){return(n?I:performance.interactionCount||0)-B},x=[],H=[200,500],N=self.requestIdleCallback||self.setTimeout,q=self.cancelIdleCallback||self.clearTimeout,O=[2500,4e3],j={},V=[800,1800],_=function e(n){document.prerendering?b((function(){return e(n)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(n)}),!0):setTimeout(n,0)},z={passive:!0,capture:!0},G=new Date,J=function(e,n){t||(t=n,r=e,i=new Date,U(removeEventListener),K())},K=function(){if(r>=0&&r<i-G){var e={entryType:"first-input",name:t.type,target:t.target,cancelable:t.cancelable,startTime:t.timeStamp,processingStart:t.timeStamp+r};o.forEach((function(n){n(e)})),o=[]}},Q=function(e){if(e.cancelable){var n=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,n){var t=function(){J(e,n),i()},r=function(){i()},i=function(){removeEventListener("pointerup",t,z),removeEventListener("pointercancel",r,z)};addEventListener("pointerup",t,z),addEventListener("pointercancel",r,z)}(n,e):J(n,e)}},U=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(n){return e(n,Q,z)}))},W=[100,300];return e.CLSThresholds=w,e.FCPThresholds=L,e.FIDThresholds=W,e.INPThresholds=H,e.LCPThresholds=O,e.TTFBThresholds=V,e.onCLS=function(e,n){n=n||{},S(m((function(){var t,r=f("CLS",0),i=0,o=[],a=function(e){e.forEach((function(e){if(!e.hadRecentInput){var n=o[0],t=o[o.length-1];i&&e.startTime-t.startTime<1e3&&e.startTime-n.startTime<5e3?(i+=e.value,o.push(e)):(i=e.value,o=[e])}})),i>r.value&&(r.value=i,r.entries=o,t())},u=d("layout-shift",a);u&&(t=l(e,r,w,n.reportAllChanges),p((function(){a(u.takeRecords()),t(!0)})),c((function(){i=0,r=f("CLS",0),t=l(e,r,w,n.reportAllChanges),v((function(){return t()}))})),setTimeout(t,0))})))},e.onFCP=S,e.onFID=function(e,n){n=n||{},b((function(){var i,a=C(),u=f("FID"),s=function(e){e.startTime<a.firstHiddenTime&&(u.value=e.processingStart-e.startTime,u.entries.push(e),i(!0))},v=function(e){e.forEach(s)},h=d("first-input",v);i=l(e,u,W,n.reportAllChanges),h&&(p(m((function(){v(h.takeRecords()),h.disconnect()}))),c((function(){var a;u=f("FID"),i=l(e,u,W,n.reportAllChanges),o=[],r=-1,t=null,U(addEventListener),a=s,o.push(a),K()})))}))},e.onINP=function(e,n){n=n||{},b((function(){var t,r;k();var i,o=f("INP"),a=null!==(t=n.durationThreshold)&&void 0!==t?t:40,u=function(e){e.forEach((function(e){"first-input"===e.entryType&&e.duration>=a||function(e){if(x.forEach((function(n){return n(e)})),e.interactionId||"first-input"===e.entryType){var n=M[M.length-1],t=D.get(e.interactionId);if(t||M.length<10||e.duration>n.latency){if(t)e.duration>t.latency?(t.entries=[e],t.latency=e.duration):e.duration===t.latency&&e.startTime===t.entries[0].startTime&&t.entries.push(e);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};D.set(r.id,r),M.push(r)}M.sort((function(e,n){return n.latency-e.latency})),M.length>10&&M.splice(10).forEach((function(e){return D.delete(e.id)}))}}}(e)}));var n,t=(n=Math.min(M.length-1,Math.floor(R()/50)),M[n]);t&&t.latency!==o.value&&(o.value=t.latency,o.entries=t.entries,i())},s=d("event",u,{durationThreshold:null!==(r=n.durationThreshold)&&void 0!==r?r:40});i=l(e,o,H,n.reportAllChanges),s&&("PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&s.observe({type:"first-input",buffered:!0}),p((function(){u(s.takeRecords()),o.value<0&&R()>0&&(o.value=0,o.entries=[]),i(!0)})),c((function(){B=0,M.length=0,D.clear(),o=f("INP"),i=l(e,o,H,n.reportAllChanges)})))}))},e.onLCP=function(e,n){n=n||{},b((function(){var t,r=C(),i=f("LCP"),o=function(e){var n=e[e.length-1];n&&n.startTime<r.firstHiddenTime&&(i.value=Math.max(n.startTime-s(),0),i.entries=[n],t())},a=d("largest-contentful-paint",o);if(a){t=l(e,i,O,n.reportAllChanges);var u=m((function(){j[i.id]||(o(a.takeRecords()),a.disconnect(),j[i.id]=!0,t(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return e=u,n=-1,"hidden"===document.visibilityState?e():(n=N(e),p((function(){q(n),e()}))),n;var e,n}),!0)})),p(u),c((function(r){i=f("LCP"),t=l(e,i,O,n.reportAllChanges),v((function(){i.value=performance.now()-r.timeStamp,j[i.id]=!0,t(!0)}))}))}}))},e.onTTFB=function(e,n){n=n||{};var t=f("TTFB"),r=l(e,t,V,n.reportAllChanges);_((function(){var i,o=u();if(o){var a=o.responseStart;if((i=a)<=0||i>performance.now())return;t.value=Math.max(a-s(),0),t.entries=[o],r(!0),c((function(){t=f("TTFB",0),(r=l(e,t,V,n.reportAllChanges))(!0)}))}}))},e}({});
var webVitals=function(e){"use strict";var n,t,r,i,o,a=-1,c=function(e){addEventListener("pageshow",(function(n){n.persisted&&(a=n.timeStamp,e(n))}),!0)},u=function(){return self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},s=function(){var e=u();return e&&e.activationStart||0},f=function(e,n){var t=u(),r="navigate";a>=0?r="back-forward-cache":t&&(document.prerendering||s()>0?r="prerender":document.wasDiscarded?r="restore":t.type&&(r=t.type.replace(/_/g,"-")));return{name:e,value:void 0===n?-1:n,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},d=function(e,n,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){n(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},t||{})),r}}catch(e){}},l=function(e,n,t,r){var i,o;return function(a){n.value>=0&&(a||r)&&((o=n.value-(i||0))||void 0===i)&&(i=n.value,n.delta=o,n.rating=function(e,n){return e>n[1]?"poor":e>n[0]?"needs-improvement":"good"}(n.value,t),e(n))}},v=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},p=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},m=function(e){var n=!1;return function(){n||(e(),n=!0)}},h=-1,g=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},T=function(e){"hidden"===document.visibilityState&&h>-1&&(h="visibilitychange"===e.type?e.timeStamp:0,E())},y=function(){addEventListener("visibilitychange",T,!0),addEventListener("prerenderingchange",T,!0)},E=function(){removeEventListener("visibilitychange",T,!0),removeEventListener("prerenderingchange",T,!0)},C=function(){return h<0&&(h=g(),y(),c((function(){setTimeout((function(){h=g(),y()}),0)}))),{get firstHiddenTime(){return h}}},L=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},b=[1800,3e3],S=function(e,n){n=n||{},L((function(){var t,r=C(),i=f("FCP"),o=d("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-s(),0),i.entries.push(e),t(!0)))}))}));o&&(t=l(e,i,b,n.reportAllChanges),c((function(r){i=f("FCP"),t=l(e,i,b,n.reportAllChanges),v((function(){i.value=performance.now()-r.timeStamp,t(!0)}))})))}))},w=[.1,.25],I=0,P=1/0,A=0,F=function(e){e.forEach((function(e){e.interactionId&&(P=Math.min(P,e.interactionId),A=Math.max(A,e.interactionId),I=A?(A-P)/7+1:0)}))},M=function(){"interactionCount"in performance||n||(n=d("event",F,{type:"event",buffered:!0,durationThreshold:0}))},k=[],D=new Map,B=0,R=function(){return(n?I:performance.interactionCount||0)-B},x=[],H=function(e){if(x.forEach((function(n){return n(e)})),e.interactionId||"first-input"===e.entryType){var n=k[k.length-1],t=D.get(e.interactionId);if(t||k.length<10||e.duration>n.latency){if(t)e.duration>t.latency?(t.entries=[e],t.latency=e.duration):e.duration===t.latency&&e.startTime===t.entries[0].startTime&&t.entries.push(e);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};D.set(r.id,r),k.push(r)}k.sort((function(e,n){return n.latency-e.latency})),k.length>10&&k.splice(10).forEach((function(e){return D.delete(e.id)}))}}},N=[200,500],q=self.requestIdleCallback||self.setTimeout,O=[2500,4e3],j={},V=[800,1800],_=function e(n){document.prerendering?L((function(){return e(n)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(n)}),!0):setTimeout(n,0)},z={passive:!0,capture:!0},G=new Date,J=function(e,n){t||(t=n,r=e,i=new Date,U(removeEventListener),K())},K=function(){if(r>=0&&r<i-G){var e={entryType:"first-input",name:t.type,target:t.target,cancelable:t.cancelable,startTime:t.timeStamp,processingStart:t.timeStamp+r};o.forEach((function(n){n(e)})),o=[]}},Q=function(e){if(e.cancelable){var n=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,n){var t=function(){J(e,n),i()},r=function(){i()},i=function(){removeEventListener("pointerup",t,z),removeEventListener("pointercancel",r,z)};addEventListener("pointerup",t,z),addEventListener("pointercancel",r,z)}(n,e):J(n,e)}},U=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(n){return e(n,Q,z)}))},W=[100,300];return e.CLSThresholds=w,e.FCPThresholds=b,e.FIDThresholds=W,e.INPThresholds=N,e.LCPThresholds=O,e.TTFBThresholds=V,e.onCLS=function(e,n){n=n||{},S(m((function(){var t,r=f("CLS",0),i=0,o=[],a=function(e){e.forEach((function(e){if(!e.hadRecentInput){var n=o[0],t=o[o.length-1];i&&e.startTime-t.startTime<1e3&&e.startTime-n.startTime<5e3?(i+=e.value,o.push(e)):(i=e.value,o=[e])}})),i>r.value&&(r.value=i,r.entries=o,t())},u=d("layout-shift",a);u&&(t=l(e,r,w,n.reportAllChanges),p((function(){a(u.takeRecords()),t(!0)})),c((function(){i=0,r=f("CLS",0),t=l(e,r,w,n.reportAllChanges),v((function(){return t()}))})),setTimeout(t,0))})))},e.onFCP=S,e.onFID=function(e,n){n=n||{},L((function(){var i,a=C(),u=f("FID"),s=function(e){e.startTime<a.firstHiddenTime&&(u.value=e.processingStart-e.startTime,u.entries.push(e),i(!0))},v=function(e){e.forEach(s)},h=d("first-input",v);i=l(e,u,W,n.reportAllChanges),h&&(p(m((function(){v(h.takeRecords()),h.disconnect()}))),c((function(){var a;u=f("FID"),i=l(e,u,W,n.reportAllChanges),o=[],r=-1,t=null,U(addEventListener),a=s,o.push(a),K()})))}))},e.onINP=function(e,n){n=n||{},L((function(){var t;M();var r,i=f("INP"),o=function(e){e.forEach(H);var n,t=(n=Math.min(k.length-1,Math.floor(R()/50)),k[n]);t&&t.latency!==i.value&&(i.value=t.latency,i.entries=t.entries,r())},a=d("event",o,{durationThreshold:null!==(t=n.durationThreshold)&&void 0!==t?t:40});r=l(e,i,N,n.reportAllChanges),a&&("PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&a.observe({type:"first-input",buffered:!0}),p((function(){o(a.takeRecords()),r(!0)})),c((function(){B=0,k.length=0,D.clear(),i=f("INP"),r=l(e,i,N,n.reportAllChanges)})))}))},e.onLCP=function(e,n){n=n||{},L((function(){var t,r=C(),i=f("LCP"),o=function(e){var n=e[e.length-1];n&&n.startTime<r.firstHiddenTime&&(i.value=Math.max(n.startTime-s(),0),i.entries=[n],t())},a=d("largest-contentful-paint",o);if(a){t=l(e,i,O,n.reportAllChanges);var u=m((function(){j[i.id]||(o(a.takeRecords()),a.disconnect(),j[i.id]=!0,t(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return n=-1,e=m(e=u),"hidden"===document.visibilityState?e():(n=q(e),p(e)),n;var e,n}),!0)})),p(u),c((function(r){i=f("LCP"),t=l(e,i,O,n.reportAllChanges),v((function(){i.value=performance.now()-r.timeStamp,j[i.id]=!0,t(!0)}))}))}}))},e.onTTFB=function(e,n){n=n||{};var t=f("TTFB"),r=l(e,t,V,n.reportAllChanges);_((function(){var i,o=u();if(o){var a=o.responseStart;if((i=a)<=0||i>performance.now())return;t.value=Math.max(a-s(),0),t.entries=[o],r(!0),c((function(){t=f("TTFB",0),(r=l(e,t,V,n.reportAllChanges))(!0)}))}}))},e}({});

@@ -1,1 +0,1 @@

var e,n,t,i,r,a=-1,o=function(e){addEventListener("pageshow",(function(n){n.persisted&&(a=n.timeStamp,e(n))}),!0)},c=function(){return self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},u=function(){var e=c();return e&&e.activationStart||0},f=function(e,n){var t=c(),i="navigate";a>=0?i="back-forward-cache":t&&(document.prerendering||u()>0?i="prerender":document.wasDiscarded?i="restore":t.type&&(i=t.type.replace(/_/g,"-")));return{name:e,value:void 0===n?-1:n,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},s=function(e,n,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((function(e){Promise.resolve().then((function(){n(e.getEntries())}))}));return i.observe(Object.assign({type:e,buffered:!0},t||{})),i}}catch(e){}},d=function(e,n,t,i){var r,a;return function(o){n.value>=0&&(o||i)&&((a=n.value-(r||0))||void 0===r)&&(r=n.value,n.delta=a,n.rating=function(e,n){return e>n[1]?"poor":e>n[0]?"needs-improvement":"good"}(n.value,t),e(n))}},l=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},v=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},p=function(e){var n=!1;return function(){n||(e(),n=!0)}},m=-1,h=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},g=function(e){"hidden"===document.visibilityState&&m>-1&&(m="visibilitychange"===e.type?e.timeStamp:0,T())},y=function(){addEventListener("visibilitychange",g,!0),addEventListener("prerenderingchange",g,!0)},T=function(){removeEventListener("visibilitychange",g,!0),removeEventListener("prerenderingchange",g,!0)},E=function(){return m<0&&(m=h(),y(),o((function(){setTimeout((function(){m=h(),y()}),0)}))),{get firstHiddenTime(){return m}}},b=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},C=[1800,3e3],L=function(e,n){n=n||{},b((function(){var t,i=E(),r=f("FCP"),a=s("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(a.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-u(),0),r.entries.push(e),t(!0)))}))}));a&&(t=d(e,r,C,n.reportAllChanges),o((function(i){r=f("FCP"),t=d(e,r,C,n.reportAllChanges),l((function(){r.value=performance.now()-i.timeStamp,t(!0)}))})))}))},S=[.1,.25],w=function(e,n){n=n||{},L(p((function(){var t,i=f("CLS",0),r=0,a=[],c=function(e){e.forEach((function(e){if(!e.hadRecentInput){var n=a[0],t=a[a.length-1];r&&e.startTime-t.startTime<1e3&&e.startTime-n.startTime<5e3?(r+=e.value,a.push(e)):(r=e.value,a=[e])}})),r>i.value&&(i.value=r,i.entries=a,t())},u=s("layout-shift",c);u&&(t=d(e,i,S,n.reportAllChanges),v((function(){c(u.takeRecords()),t(!0)})),o((function(){r=0,i=f("CLS",0),t=d(e,i,S,n.reportAllChanges),l((function(){return t()}))})),setTimeout(t,0))})))},A=0,I=1/0,P=0,k=function(e){e.forEach((function(e){e.interactionId&&(I=Math.min(I,e.interactionId),P=Math.max(P,e.interactionId),A=P?(P-I)/7+1:0)}))},M=function(){"interactionCount"in performance||e||(e=s("event",k,{type:"event",buffered:!0,durationThreshold:0}))},F=[],D=new Map,x=0,R=function(){return(e?A:performance.interactionCount||0)-x},B=[],H=[200,500],q=function(e,n){n=n||{},b((function(){var t,i;M();var r,a=f("INP"),c=null!==(t=n.durationThreshold)&&void 0!==t?t:40,u=function(e){e.forEach((function(e){"first-input"===e.entryType&&e.duration>=c||function(e){if(B.forEach((function(n){return n(e)})),e.interactionId||"first-input"===e.entryType){var n=F[F.length-1],t=D.get(e.interactionId);if(t||F.length<10||e.duration>n.latency){if(t)e.duration>t.latency?(t.entries=[e],t.latency=e.duration):e.duration===t.latency&&e.startTime===t.entries[0].startTime&&t.entries.push(e);else{var i={id:e.interactionId,latency:e.duration,entries:[e]};D.set(i.id,i),F.push(i)}F.sort((function(e,n){return n.latency-e.latency})),F.length>10&&F.splice(10).forEach((function(e){return D.delete(e.id)}))}}}(e)}));var n,t=(n=Math.min(F.length-1,Math.floor(R()/50)),F[n]);t&&t.latency!==a.value&&(a.value=t.latency,a.entries=t.entries,r())},l=s("event",u,{durationThreshold:null!==(i=n.durationThreshold)&&void 0!==i?i:40});r=d(e,a,H,n.reportAllChanges),l&&("PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&l.observe({type:"first-input",buffered:!0}),v((function(){u(l.takeRecords()),a.value<0&&R()>0&&(a.value=0,a.entries=[]),r(!0)})),o((function(){x=0,F.length=0,D.clear(),a=f("INP"),r=d(e,a,H,n.reportAllChanges)})))}))},O=self.requestIdleCallback||self.setTimeout,N=self.cancelIdleCallback||self.clearTimeout,j=[2500,4e3],_={},z=function(e,n){n=n||{},b((function(){var t,i=E(),r=f("LCP"),a=function(e){var n=e[e.length-1];n&&n.startTime<i.firstHiddenTime&&(r.value=Math.max(n.startTime-u(),0),r.entries=[n],t())},c=s("largest-contentful-paint",a);if(c){t=d(e,r,j,n.reportAllChanges);var m=p((function(){_[r.id]||(a(c.takeRecords()),c.disconnect(),_[r.id]=!0,t(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return e=m,n=-1,"hidden"===document.visibilityState?e():(n=O(e),v((function(){N(n),e()}))),n;var e,n}),!0)})),v(m),o((function(i){r=f("LCP"),t=d(e,r,j,n.reportAllChanges),l((function(){r.value=performance.now()-i.timeStamp,_[r.id]=!0,t(!0)}))}))}}))},G=[800,1800],J=function e(n){document.prerendering?b((function(){return e(n)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(n)}),!0):setTimeout(n,0)},K=function(e,n){n=n||{};var t=f("TTFB"),i=d(e,t,G,n.reportAllChanges);J((function(){var r,a=c();if(a){var s=a.responseStart;if((r=s)<=0||r>performance.now())return;t.value=Math.max(s-u(),0),t.entries=[a],i(!0),o((function(){t=f("TTFB",0),(i=d(e,t,G,n.reportAllChanges))(!0)}))}}))},Q={passive:!0,capture:!0},U=new Date,V=function(e,r){n||(n=r,t=e,i=new Date,Y(removeEventListener),W())},W=function(){if(t>=0&&t<i-U){var e={entryType:"first-input",name:n.type,target:n.target,cancelable:n.cancelable,startTime:n.timeStamp,processingStart:n.timeStamp+t};r.forEach((function(n){n(e)})),r=[]}},X=function(e){if(e.cancelable){var n=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,n){var t=function(){V(e,n),r()},i=function(){r()},r=function(){removeEventListener("pointerup",t,Q),removeEventListener("pointercancel",i,Q)};addEventListener("pointerup",t,Q),addEventListener("pointercancel",i,Q)}(n,e):V(n,e)}},Y=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(n){return e(n,X,Q)}))},Z=[100,300],$=function(e,i){i=i||{},b((function(){var a,c=E(),u=f("FID"),l=function(e){e.startTime<c.firstHiddenTime&&(u.value=e.processingStart-e.startTime,u.entries.push(e),a(!0))},m=function(e){e.forEach(l)},h=s("first-input",m);a=d(e,u,Z,i.reportAllChanges),h&&(v(p((function(){m(h.takeRecords()),h.disconnect()}))),o((function(){var o;u=f("FID"),a=d(e,u,Z,i.reportAllChanges),r=[],t=-1,n=null,Y(addEventListener),o=l,r.push(o),W()})))}))};export{S as CLSThresholds,C as FCPThresholds,Z as FIDThresholds,H as INPThresholds,j as LCPThresholds,G as TTFBThresholds,w as onCLS,L as onFCP,$ as onFID,q as onINP,z as onLCP,K as onTTFB};
var e,n,t,r,i,a=-1,o=function(e){addEventListener("pageshow",(function(n){n.persisted&&(a=n.timeStamp,e(n))}),!0)},c=function(){return self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},u=function(){var e=c();return e&&e.activationStart||0},f=function(e,n){var t=c(),r="navigate";a>=0?r="back-forward-cache":t&&(document.prerendering||u()>0?r="prerender":document.wasDiscarded?r="restore":t.type&&(r=t.type.replace(/_/g,"-")));return{name:e,value:void 0===n?-1:n,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},s=function(e,n,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){n(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},t||{})),r}}catch(e){}},d=function(e,n,t,r){var i,a;return function(o){n.value>=0&&(o||r)&&((a=n.value-(i||0))||void 0===i)&&(i=n.value,n.delta=a,n.rating=function(e,n){return e>n[1]?"poor":e>n[0]?"needs-improvement":"good"}(n.value,t),e(n))}},l=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},p=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},v=function(e){var n=!1;return function(){n||(e(),n=!0)}},m=-1,h=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},g=function(e){"hidden"===document.visibilityState&&m>-1&&(m="visibilitychange"===e.type?e.timeStamp:0,T())},y=function(){addEventListener("visibilitychange",g,!0),addEventListener("prerenderingchange",g,!0)},T=function(){removeEventListener("visibilitychange",g,!0),removeEventListener("prerenderingchange",g,!0)},E=function(){return m<0&&(m=h(),y(),o((function(){setTimeout((function(){m=h(),y()}),0)}))),{get firstHiddenTime(){return m}}},b=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},C=[1800,3e3],L=function(e,n){n=n||{},b((function(){var t,r=E(),i=f("FCP"),a=s("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(a.disconnect(),e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-u(),0),i.entries.push(e),t(!0)))}))}));a&&(t=d(e,i,C,n.reportAllChanges),o((function(r){i=f("FCP"),t=d(e,i,C,n.reportAllChanges),l((function(){i.value=performance.now()-r.timeStamp,t(!0)}))})))}))},S=[.1,.25],w=function(e,n){n=n||{},L(v((function(){var t,r=f("CLS",0),i=0,a=[],c=function(e){e.forEach((function(e){if(!e.hadRecentInput){var n=a[0],t=a[a.length-1];i&&e.startTime-t.startTime<1e3&&e.startTime-n.startTime<5e3?(i+=e.value,a.push(e)):(i=e.value,a=[e])}})),i>r.value&&(r.value=i,r.entries=a,t())},u=s("layout-shift",c);u&&(t=d(e,r,S,n.reportAllChanges),p((function(){c(u.takeRecords()),t(!0)})),o((function(){i=0,r=f("CLS",0),t=d(e,r,S,n.reportAllChanges),l((function(){return t()}))})),setTimeout(t,0))})))},A=0,I=1/0,P=0,M=function(e){e.forEach((function(e){e.interactionId&&(I=Math.min(I,e.interactionId),P=Math.max(P,e.interactionId),A=P?(P-I)/7+1:0)}))},k=function(){"interactionCount"in performance||e||(e=s("event",M,{type:"event",buffered:!0,durationThreshold:0}))},F=[],D=new Map,x=0,R=function(){return(e?A:performance.interactionCount||0)-x},B=[],H=function(e){if(B.forEach((function(n){return n(e)})),e.interactionId||"first-input"===e.entryType){var n=F[F.length-1],t=D.get(e.interactionId);if(t||F.length<10||e.duration>n.latency){if(t)e.duration>t.latency?(t.entries=[e],t.latency=e.duration):e.duration===t.latency&&e.startTime===t.entries[0].startTime&&t.entries.push(e);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};D.set(r.id,r),F.push(r)}F.sort((function(e,n){return n.latency-e.latency})),F.length>10&&F.splice(10).forEach((function(e){return D.delete(e.id)}))}}},q=[200,500],O=function(e,n){n=n||{},b((function(){var t;k();var r,i=f("INP"),a=function(e){e.forEach(H);var n,t=(n=Math.min(F.length-1,Math.floor(R()/50)),F[n]);t&&t.latency!==i.value&&(i.value=t.latency,i.entries=t.entries,r())},c=s("event",a,{durationThreshold:null!==(t=n.durationThreshold)&&void 0!==t?t:40});r=d(e,i,q,n.reportAllChanges),c&&("PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&c.observe({type:"first-input",buffered:!0}),p((function(){a(c.takeRecords()),r(!0)})),o((function(){x=0,F.length=0,D.clear(),i=f("INP"),r=d(e,i,q,n.reportAllChanges)})))}))},N=self.requestIdleCallback||self.setTimeout,j=[2500,4e3],_={},z=function(e,n){n=n||{},b((function(){var t,r=E(),i=f("LCP"),a=function(e){var n=e[e.length-1];n&&n.startTime<r.firstHiddenTime&&(i.value=Math.max(n.startTime-u(),0),i.entries=[n],t())},c=s("largest-contentful-paint",a);if(c){t=d(e,i,j,n.reportAllChanges);var m=v((function(){_[i.id]||(a(c.takeRecords()),c.disconnect(),_[i.id]=!0,t(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return n=-1,e=v(e=m),"hidden"===document.visibilityState?e():(n=N(e),p(e)),n;var e,n}),!0)})),p(m),o((function(r){i=f("LCP"),t=d(e,i,j,n.reportAllChanges),l((function(){i.value=performance.now()-r.timeStamp,_[i.id]=!0,t(!0)}))}))}}))},G=[800,1800],J=function e(n){document.prerendering?b((function(){return e(n)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(n)}),!0):setTimeout(n,0)},K=function(e,n){n=n||{};var t=f("TTFB"),r=d(e,t,G,n.reportAllChanges);J((function(){var i,a=c();if(a){var s=a.responseStart;if((i=s)<=0||i>performance.now())return;t.value=Math.max(s-u(),0),t.entries=[a],r(!0),o((function(){t=f("TTFB",0),(r=d(e,t,G,n.reportAllChanges))(!0)}))}}))},Q={passive:!0,capture:!0},U=new Date,V=function(e,i){n||(n=i,t=e,r=new Date,Y(removeEventListener),W())},W=function(){if(t>=0&&t<r-U){var e={entryType:"first-input",name:n.type,target:n.target,cancelable:n.cancelable,startTime:n.timeStamp,processingStart:n.timeStamp+t};i.forEach((function(n){n(e)})),i=[]}},X=function(e){if(e.cancelable){var n=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,n){var t=function(){V(e,n),i()},r=function(){i()},i=function(){removeEventListener("pointerup",t,Q),removeEventListener("pointercancel",r,Q)};addEventListener("pointerup",t,Q),addEventListener("pointercancel",r,Q)}(n,e):V(n,e)}},Y=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(n){return e(n,X,Q)}))},Z=[100,300],$=function(e,r){r=r||{},b((function(){var a,c=E(),u=f("FID"),l=function(e){e.startTime<c.firstHiddenTime&&(u.value=e.processingStart-e.startTime,u.entries.push(e),a(!0))},m=function(e){e.forEach(l)},h=s("first-input",m);a=d(e,u,Z,r.reportAllChanges),h&&(p(v((function(){m(h.takeRecords()),h.disconnect()}))),o((function(){var o;u=f("FID"),a=d(e,u,Z,r.reportAllChanges),i=[],t=-1,n=null,Y(addEventListener),o=l,i.push(o),W()})))}))};export{S as CLSThresholds,C as FCPThresholds,Z as FIDThresholds,q as INPThresholds,j as LCPThresholds,G as TTFBThresholds,w as onCLS,L as onFCP,$ as onFID,O as onINP,z as onLCP,K as onTTFB};
{
"name": "web-vitals",
"version": "4.0.0-beta.0",
"version": "4.0.0-beta.1",
"description": "Easily measure performance metrics in JavaScript",

@@ -5,0 +5,0 @@ "type": "module",

@@ -1031,17 +1031,17 @@ # `web-vitals`

*/
waitingTime: number;
waitingDuration: number;
/**
* The total time to resolve the DNS for the current request.
*/
dnsTime: number;
dnsDuration: number;
/**
* The total time to create the connection to the requested domain.
*/
connectionTime: number;
connectionDuration: number;
/**
* The time time from when the request was sent until the first byte of the
* The total time from when the request was sent until the first byte of the
* response was received. This includes network time as well as server
* processing time.
*/
requestTime: number;
requestDuration: number;
/**

@@ -1048,0 +1048,0 @@ * The `navigation` entry of the current page, which is useful for diagnosing

@@ -45,6 +45,6 @@ /*

(metric as TTFBMetricWithAttribution).attribution = {
waitingTime: dnsStart,
dnsTime: connectStart - dnsStart,
connectionTime: requestStart - connectStart,
requestTime: metric.value - requestStart,
waitingDuration: dnsStart,
dnsDuration: connectStart - dnsStart,
connectionDuration: requestStart - connectStart,
requestDuration: metric.value - requestStart,
navigationEntry: navigationEntry,

@@ -56,6 +56,6 @@ };

(metric as TTFBMetricWithAttribution).attribution = {
waitingTime: 0,
dnsTime: 0,
connectionTime: 0,
requestTime: 0,
waitingDuration: 0,
dnsDuration: 0,
connectionDuration: 0,
requestDuration: 0,
};

@@ -62,0 +62,0 @@ };

@@ -49,3 +49,3 @@ /*

*/
export const getInteractionCountForNavigation = () => {
const getInteractionCountForNavigation = () => {
return getInteractionCount() - prevInteractionCount;

@@ -52,0 +52,0 @@ };

@@ -18,5 +18,5 @@ /*

import {onHidden} from './onHidden.js';
import {runOnce} from './runOnce.js';
const rIC = self.requestIdleCallback || self.setTimeout;
const cIC = self.cancelIdleCallback || self.clearTimeout;

@@ -29,2 +29,5 @@ /**

let handle = -1;
cb = runOnce(cb);
// If the document is hidden, run the callback immediately, otherwise
// race an idle callback with the next `visibilitychange` event.
if (document.visibilityState === 'hidden') {

@@ -34,8 +37,5 @@ cb();

handle = rIC(cb);
onHidden(() => {
cIC(handle);
cb();
});
onHidden(cb);
}
return handle;
};

@@ -24,3 +24,2 @@ /*

estimateP98LongestInteraction,
getInteractionCountForNavigation,
resetInteractions,

@@ -81,18 +80,4 @@ } from './lib/interactions.js';

const durationThreshold =
opts!.durationThreshold ?? DEFAULT_DURATION_THRESHOLD;
const handleEntries = (entries: INPMetric['entries']) => {
entries.forEach((entry) => {
// Ignore `first-input` entries if the duration value is greater
// than the threshold (since that means an `event` entry should
// have been dispatched).
if (
entry.entryType === 'first-input' &&
entry.duration >= durationThreshold
) {
return;
}
processInteractionEntry(entry);
});
entries.forEach(processInteractionEntry);

@@ -138,10 +123,2 @@ const inp = estimateP98LongestInteraction();

handleEntries(po.takeRecords() as INPMetric['entries']);
// If the interaction count shows that there were interactions but
// none were captured by the PerformanceObserver, report a latency of 0.
if (metric.value < 0 && getInteractionCountForNavigation() > 0) {
metric.value = 0;
metric.entries = [];
}
report(true);

@@ -148,0 +125,0 @@ });

@@ -38,17 +38,17 @@ /*

*/
waitingTime: number;
waitingDuration: number;
/**
* The total time to resolve the DNS for the current request.
*/
dnsTime: number;
dnsDuration: number;
/**
* The total time to create the connection to the requested domain.
*/
connectionTime: number;
connectionDuration: number;
/**
* The time time from when the request was sent until the first byte of the
* The total time from when the request was sent until the first byte of the
* response was received. This includes network time as well as server
* processing time.
*/
requestTime: number;
requestDuration: number;
/**

@@ -55,0 +55,0 @@ * The `navigation` entry of the current page, which is useful for diagnosing

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc