"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.usePerformanceMetrics=usePerformanceMetrics;const theme_1=require("@redocly/theme"),web_vitals_1=require("web-vitals");function usePerformanceMetrics({sendTelemetry:e}){(0,theme_1.useMount)((()=>{const t={},a=[new Promise((e=>(0,web_vitals_1.onCLS)((t=>e({name:"CLS",value:t.value}))))),new Promise((e=>(0,web_vitals_1.onLCP)((t=>e({name:"LCP",value:t.value}))))),new Promise((e=>(0,web_vitals_1.onFCP)((t=>e({name:"FCP",value:t.value}))))),new Promise((e=>(0,web_vitals_1.onTTFB)((t=>e({name:"TTFB",value:t.value})))))];Promise.allSettled(a).then((a=>{a.forEach((e=>{if("fulfilled"===e.status){const{name:a,value:s}=e.value;t[a]=Math.round(s)}})),e(t)}))}))}
//# sourceMappingURL=usePerformanceMetrics.js.map