@grafana/faro-web-sdk 1.9.1 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle/faro-web-sdk.iife.js +1 -1
- package/dist/bundle/types/index.d.ts +1 -1
- package/dist/bundle/types/instrumentations/console/instrumentation.d.ts +1 -1
- package/dist/bundle/types/instrumentations/errors/const.d.ts +1 -1
- package/dist/bundle/types/instrumentations/errors/instrumentation.d.ts +1 -1
- package/dist/bundle/types/instrumentations/errors/stackFrames/const.d.ts +1 -1
- package/dist/bundle/types/instrumentations/performance/instrumentation.d.ts +1 -1
- package/dist/bundle/types/instrumentations/performance/types.d.ts +2 -1
- package/dist/bundle/types/instrumentations/session/instrumentation.d.ts +1 -1
- package/dist/bundle/types/instrumentations/view/instrumentation.d.ts +1 -1
- package/dist/bundle/types/instrumentations/webVitals/instrumentation.d.ts +1 -1
- package/dist/bundle/types/metas/index.d.ts +0 -1
- package/dist/bundle/types/transports/console/transport.d.ts +1 -1
- package/dist/bundle/types/transports/fetch/transport.d.ts +1 -1
- package/dist/cjs/config/makeCoreConfig.js +2 -2
- package/dist/cjs/config/makeCoreConfig.js.map +1 -1
- package/dist/cjs/index.js +2 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/instrumentations/errors/const.js +2 -2
- package/dist/cjs/instrumentations/errors/const.js.map +1 -1
- package/dist/cjs/instrumentations/errors/registerOnerror.js +1 -1
- package/dist/cjs/instrumentations/errors/registerOnerror.js.map +1 -1
- package/dist/cjs/instrumentations/errors/stackFrames/buildStackFrame.js +1 -1
- package/dist/cjs/instrumentations/errors/stackFrames/buildStackFrame.js.map +1 -1
- package/dist/cjs/instrumentations/errors/stackFrames/const.js +2 -2
- package/dist/cjs/instrumentations/errors/stackFrames/const.js.map +1 -1
- package/dist/cjs/instrumentations/performance/navigation.js +1 -1
- package/dist/cjs/instrumentations/performance/navigation.js.map +1 -1
- package/dist/cjs/instrumentations/performance/performanceUtils.js +1 -1
- package/dist/cjs/instrumentations/performance/performanceUtils.js.map +1 -1
- package/dist/cjs/instrumentations/performance/types.js.map +1 -1
- package/dist/cjs/instrumentations/view/instrumentation.js +3 -4
- package/dist/cjs/instrumentations/view/instrumentation.js.map +1 -1
- package/dist/cjs/instrumentations/webVitals/webVitalsWithAttribution.js +2 -1
- package/dist/cjs/instrumentations/webVitals/webVitalsWithAttribution.js.map +1 -1
- package/dist/cjs/metas/browser/meta.js +7 -7
- package/dist/cjs/metas/browser/meta.js.map +1 -1
- package/dist/cjs/metas/index.js +1 -3
- package/dist/cjs/metas/index.js.map +1 -1
- package/dist/esm/config/makeCoreConfig.js +3 -3
- package/dist/esm/config/makeCoreConfig.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/instrumentations/errors/const.js +1 -1
- package/dist/esm/instrumentations/errors/const.js.map +1 -1
- package/dist/esm/instrumentations/errors/registerOnerror.js +2 -2
- package/dist/esm/instrumentations/errors/registerOnerror.js.map +1 -1
- package/dist/esm/instrumentations/errors/stackFrames/buildStackFrame.js +2 -2
- package/dist/esm/instrumentations/errors/stackFrames/buildStackFrame.js.map +1 -1
- package/dist/esm/instrumentations/errors/stackFrames/const.js +1 -1
- package/dist/esm/instrumentations/errors/stackFrames/const.js.map +1 -1
- package/dist/esm/instrumentations/performance/navigation.js +2 -2
- package/dist/esm/instrumentations/performance/navigation.js.map +1 -1
- package/dist/esm/instrumentations/performance/performanceUtils.js +2 -2
- package/dist/esm/instrumentations/performance/performanceUtils.js.map +1 -1
- package/dist/esm/instrumentations/performance/types.js.map +1 -1
- package/dist/esm/instrumentations/view/instrumentation.js +4 -5
- package/dist/esm/instrumentations/view/instrumentation.js.map +1 -1
- package/dist/esm/instrumentations/webVitals/webVitalsWithAttribution.js +2 -1
- package/dist/esm/instrumentations/webVitals/webVitalsWithAttribution.js.map +1 -1
- package/dist/esm/metas/browser/meta.js +7 -7
- package/dist/esm/metas/browser/meta.js.map +1 -1
- package/dist/esm/metas/index.js +0 -1
- package/dist/esm/metas/index.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/instrumentations/console/instrumentation.d.ts +1 -1
- package/dist/types/instrumentations/errors/const.d.ts +1 -1
- package/dist/types/instrumentations/errors/instrumentation.d.ts +1 -1
- package/dist/types/instrumentations/errors/stackFrames/const.d.ts +1 -1
- package/dist/types/instrumentations/performance/instrumentation.d.ts +1 -1
- package/dist/types/instrumentations/performance/types.d.ts +2 -1
- package/dist/types/instrumentations/session/instrumentation.d.ts +1 -1
- package/dist/types/instrumentations/view/instrumentation.d.ts +1 -1
- package/dist/types/instrumentations/webVitals/instrumentation.d.ts +1 -1
- package/dist/types/metas/index.d.ts +0 -1
- package/dist/types/transports/console/transport.d.ts +1 -1
- package/dist/types/transports/fetch/transport.d.ts +1 -1
- package/package.json +3 -3
- package/dist/bundle/types/metas/view/const.d.ts +0 -3
- package/dist/bundle/types/metas/view/index.d.ts +0 -1
- package/dist/cjs/metas/view/const.js +0 -7
- package/dist/cjs/metas/view/const.js.map +0 -1
- package/dist/cjs/metas/view/index.js +0 -6
- package/dist/cjs/metas/view/index.js.map +0 -1
- package/dist/esm/metas/view/const.js +0 -4
- package/dist/esm/metas/view/const.js.map +0 -1
- package/dist/esm/metas/view/index.js +0 -2
- package/dist/esm/metas/view/index.js.map +0 -1
- package/dist/types/metas/view/const.d.ts +0 -3
- package/dist/types/metas/view/index.d.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var GrafanaFaroWebSdk=function(e){"use strict";function t(e,t){return typeof e===t}function n(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function i(e,t){try{return e instanceof t}catch(e){return!1}}const r=e=>t(e,"null"),o=e=>t(e,"string"),s=e=>t(e,"number")&&!isNaN(e)||t(e,"bigint"),a=e=>!r(e)&&t(e,"object"),u=e=>t(e,"function"),l=e=>n(e,"Array"),c=e=>!a(e)&&!u(e),d="undefined"!=typeof Event,f=e=>d&&i(e,Event),p="undefined"!=typeof Error,m=e=>p&&i(e,Error),g=e=>n(e,"ErrorEvent"),v=e=>n(e,"DOMError"),h=e=>n(e,"DOMException"),b="undefined"!=typeof Element,w="undefined"!=typeof Map;function y(e,n){if(e===n)return!0;if(t(e,"number")&&isNaN(e))return t(n,"number")&&isNaN(n);const i=l(e),r=l(n);if(i!==r)return!1;if(i&&r){const t=e.length;if(t!==n.length)return!1;for(let i=t;0!=i--;)if(!y(e[i],n[i]))return!1;return!0}const o=a(e),s=a(n);if(o!==s)return!1;if(e&&n&&o&&s){const t=Object.keys(e),i=Object.keys(n);if(t.length!==i.length)return!1;for(let e of t)if(!i.includes(e))return!1;for(let i of t)if(!y(e[i],n[i]))return!1;return!0}return!1}function S(){return Date.now()}function T(){return(new Date).toISOString()}function E(e){return new Date(e).toISOString()}var I;e.LogLevel=void 0,(I=e.LogLevel||(e.LogLevel={})).TRACE="trace",I.DEBUG="debug",I.INFO="info",I.LOG="log",I.WARN="warn",I.ERROR="error";const k=e.LogLevel.LOG,x=[e.LogLevel.TRACE,e.LogLevel.DEBUG,e.LogLevel.INFO,e.LogLevel.LOG,e.LogLevel.WARN,e.LogLevel.ERROR];function L(){}function O(e){const{size:t,concurrency:n}=e,i=[];let r=0;const o=()=>{if(r<n&&i.length){const{producer:e,resolve:t,reject:n}=i.shift();r++,e().then((e=>{r--,o(),t(e)}),(e=>{r--,o(),n(e)}))}};return{add:e=>{if(i.length+r>=t)throw new Error("Task buffer full");return new Promise(((t,n)=>{i.push({producer:e,resolve:t,reject:n}),o()}))}}}const C="abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ0123456789";function P(e=10){return Array.from(Array(e)).map((()=>C[Math.floor(Math.random()*C.length)])).join("")}const _="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0;class N{constructor(e,t){var n,i;this.signalBuffer=[],this.itemLimit=null!==(n=null==t?void 0:t.itemLimit)&&void 0!==n?n:50,this.sendTimeout=null!==(i=null==t?void 0:t.sendTimeout)&&void 0!==i?i:250,this.paused=(null==t?void 0:t.paused)||!1,this.sendFn=e,this.flushInterval=-1,this.paused||this.start(),document.addEventListener("visibilitychange",(()=>{"hidden"===document.visibilityState&&this.flush()}))}addItem(e){this.paused||(this.signalBuffer.push(e),this.signalBuffer.length>=this.itemLimit&&this.flush())}start(){this.paused=!1,this.sendTimeout>0&&(this.flushInterval=window.setInterval((()=>this.flush()),this.sendTimeout))}pause(){this.paused=!0,clearInterval(this.flushInterval)}groupItems(e){const t=new Map;return e.forEach((e=>{const n=JSON.stringify(e.meta);let i=t.get(n);i=void 0===i?[e]:[...i,e],t.set(n,i)})),Array.from(t.values())}flush(){if(this.paused||0===this.signalBuffer.length)return;this.groupItems(this.signalBuffer).forEach(this.sendFn),this.signalBuffer=[]}}var A;e.TransportItemType=void 0,(A=e.TransportItemType||(e.TransportItemType={})).EXCEPTION="exception",A.LOG="log",A.MEASUREMENT="measurement",A.TRACE="trace",A.EVENT="event";const M={[e.TransportItemType.EXCEPTION]:"exceptions",[e.TransportItemType.LOG]:"logs",[e.TransportItemType.MEASUREMENT]:"measurements",[e.TransportItemType.TRACE]:"traces",[e.TransportItemType.EVENT]:"events"};function D(t){return n=>{if(n.type===e.TransportItemType.EXCEPTION&&n.payload){const e=n.payload,i=`${e.type}: ${e.value}`;if(function(e,t){return e.some((e=>o(e)?t.includes(e):!!t.match(e)))}(t,i))return null}return n}}function j(e,t,n,i){var r;t.debug("Initializing transports");const o=[];let s=n.paused,a=[];const u=e=>{let t=e;for(const e of a){const n=t.map(e).filter(Boolean);if(0===n.length)return[];t=n}return t},l=e=>{const n=u(e);if(0!==n.length)for(const e of o)t.debug(`Transporting item using ${e.name}\n`,n),e.isBatched()&&e.send(n)};let c;(null===(r=n.batching)||void 0===r?void 0:r.enabled)&&(c=new N(l,{sendTimeout:n.batching.sendTimeout,itemLimit:n.batching.itemLimit,paused:s}));return{add:(...r)=>{t.debug("Adding transports"),r.forEach((r=>{t.debug(`Adding "${r.name}" transport`);o.some((e=>e===r))?t.warn(`Transport ${r.name} is already added`):(r.unpatchedConsole=e,r.internalLogger=t,r.config=n,r.metas=i,o.push(r))}))},addBeforeSendHooks:(...e)=>{t.debug("Adding beforeSendHooks\n",a),e.forEach((e=>{e&&a.push(e)}))},addIgnoreErrorsPatterns:(...e)=>{t.debug("Adding ignoreErrorsPatterns\n",e),e.forEach((e=>{e&&a.push(D(e))}))},getBeforeSendHooks:()=>[...a],execute:e=>{var i;s||((null===(i=n.batching)||void 0===i?void 0:i.enabled)&&(null==c||c.addItem(e)),(e=>{var i,r;if((null===(i=n.batching)||void 0===i?void 0:i.enabled)&&o.every((e=>e.isBatched())))return;const[s]=u([e]);if(void 0!==s)for(const e of o)t.debug(`Transporting item using ${e.name}\n`,s),e.isBatched()?(null===(r=n.batching)||void 0===r?void 0:r.enabled)||e.send([s]):e.send(s)})(e))},isPaused:()=>s,pause:()=>{t.debug("Pausing transports"),null==c||c.pause(),s=!0},remove:(...e)=>{t.debug("Removing transports"),e.forEach((e=>{t.debug(`Removing "${e.name}" transport`);const n=o.indexOf(e);-1!==n?o.splice(n,1):t.warn(`Transport "${e.name}" is not added`)}))},removeBeforeSendHooks:(...e)=>{a.filter((t=>!e.includes(t)))},get transports(){return[...o]},unpause:()=>{t.debug("Unpausing transports"),null==c||c.start(),s=!1}}}var R;e.InternalLoggerLevel=void 0,(R=e.InternalLoggerLevel||(e.InternalLoggerLevel={}))[R.OFF=0]="OFF",R[R.ERROR=1]="ERROR",R[R.WARN=2]="WARN",R[R.INFO=3]="INFO",R[R.VERBOSE=4]="VERBOSE";const B={debug:L,error:L,info:L,prefix:"Faro",warn:L},U=e.InternalLoggerLevel.ERROR,F=Object.assign({},console);let z=F;function V(e){var t;return z=null!==(t=e.unpatchedConsole)&&void 0!==t?t:z,z}function $(t=F,n=U){const i=B;return n>e.InternalLoggerLevel.OFF&&(i.error=n>=e.InternalLoggerLevel.ERROR?function(...e){t.error(`${i.prefix}\n`,...e)}:L,i.warn=n>=e.InternalLoggerLevel.WARN?function(...e){t.warn(`${i.prefix}\n`,...e)}:L,i.info=n>=e.InternalLoggerLevel.INFO?function(...e){t.info(`${i.prefix}\n`,...e)}:L,i.debug=n>=e.InternalLoggerLevel.VERBOSE?function(...e){t.debug(`${i.prefix}\n`,...e)}:L),i}let q=B;function G(e,t){return q=$(e,t.internalLoggerLevel),q}class W{constructor(){this.unpatchedConsole=F,this.internalLogger=B,this.config={},this.metas={}}logDebug(...e){this.internalLogger.debug(`${this.name}\n`,...e)}logInfo(...e){this.internalLogger.info(`${this.name}\n`,...e)}logWarn(...e){this.internalLogger.warn(`${this.name}\n`,...e)}logError(...e){this.internalLogger.error(`${this.name}\n`,...e)}}class H extends W{isBatched(){return!1}getIgnoreUrls(){return[]}}function K(e,t){var n,i;if(void 0===t)return e;if(void 0===e)return{resourceSpans:t};const r=null===(n=e.resourceSpans)||void 0===n?void 0:n[0];if(void 0===r)return e;const o=(null==r?void 0:r.scopeSpans)||[],s=(null===(i=null==t?void 0:t[0])||void 0===i?void 0:i.scopeSpans)||[];return Object.assign(Object.assign({},e),{resourceSpans:[Object.assign(Object.assign({},r),{scopeSpans:[...o,...s]})]})}function X(t){let n={meta:{}};return void 0!==t[0]&&(n.meta=t[0].meta),t.forEach((t=>{switch(t.type){case e.TransportItemType.LOG:case e.TransportItemType.EVENT:case e.TransportItemType.EXCEPTION:case e.TransportItemType.MEASUREMENT:const i=M[t.type],r=n[i];n=Object.assign(Object.assign({},n),{[i]:void 0===r?[t.payload]:[...r,t.payload]});break;case e.TransportItemType.TRACE:n=Object.assign(Object.assign({},n),{traces:K(n.traces,t.payload.resourceSpans)})}})),n}const J="Error";let Z;const Y=e=>e.map((e=>{try{return String(e)}catch(e){return""}})).join(" ");function Q(t,n,i,o,s){n.debug("Initializing API");const a=function(t,n,i,r,o){let s;return n.debug("Initializing traces API"),{getOTEL:()=>s,getTraceContext:()=>{const e=null==s?void 0:s.trace.getSpanContext(s.context.active());return e?{trace_id:e.traceId,span_id:e.spanId}:void 0},initOTEL:(e,t)=>{n.debug("Initializing OpenTelemetry"),s={trace:e,context:t}},isOTELInitialized:()=>!!s,pushTraces:t=>{try{const i={type:e.TransportItemType.TRACE,payload:t,meta:r.value};n.debug("Pushing trace\n",i),o.execute(i)}catch(e){n.error("Error pushing trace\n",e)}}}}(0,n,0,o,s);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a),function(t,n,i,o,s,a){var u;n.debug("Initializing exceptions API");let l=null;Z=null!==(u=i.parseStacktrace)&&void 0!==u?u:Z;const c=e=>{n.debug("Changing stacktrace parser"),Z=null!=e?e:Z};return c(i.parseStacktrace),{changeStacktraceParser:c,getStacktraceParser:()=>Z,pushError:(t,{skipDedupe:u,stackFrames:c,type:d,context:f,spanContext:p,timestampOverwriteMs:m}={})=>{d=d||t.name||J;const g={meta:o.value,payload:{type:d,value:t.message,timestamp:m?E(m):T(),trace:p?{trace_id:p.traceId,span_id:p.spanId}:a.getTraceContext(),context:null!=f?f:{}},type:e.TransportItemType.EXCEPTION};(null==(c=null!=c?c:t.stack?null==Z?void 0:Z(t).frames:void 0)?void 0:c.length)&&(g.payload.stacktrace={frames:c});const v={type:g.payload.type,value:g.payload.value,stackTrace:g.payload.stacktrace,context:g.payload.context};u||!i.dedupe||r(l)||!y(v,l)?(l=v,n.debug("Pushing exception\n",g),s.execute(g)):n.debug("Skipping error push because it is the same as the last one\n",g.payload)}}}(0,n,i,o,s,a)),function(e,t,n,i){let r,o,s;t.debug("Initializing meta API");const a=e=>{o&&i.remove(o),o={user:e},i.add(o)},u=e=>{r&&i.remove(r),r={session:e},i.add(r)};return{setUser:a,resetUser:a,setSession:u,resetSession:u,getSession:()=>i.value.session,setView:e=>{var t;if((null===(t=null==s?void 0:s.view)||void 0===t?void 0:t.name)===(null==e?void 0:e.name))return;const n=s;s={view:e},i.add(s),n&&i.remove(n)},getView:()=>i.value.view}}(0,n,0,o)),function(t,n,i,o,s,a){var u;n.debug("Initializing logs API");let l=null;const c=null!==(u=i.logArgsSerializer)&&void 0!==u?u:Y;return{pushLog:(t,{context:u,level:d,skipDedupe:f,spanContext:p,timestampOverwriteMs:m}={})=>{try{const g={type:e.TransportItemType.LOG,payload:{message:c(t),level:null!=d?d:k,context:null!=u?u:{},timestamp:m?E(m):T(),trace:p?{trace_id:p.traceId,span_id:p.spanId}:a.getTraceContext()},meta:o.value},v={message:g.payload.message,level:g.payload.level,context:g.payload.context};if(!f&&i.dedupe&&!r(l)&&y(v,l))return void n.debug("Skipping log push because it is the same as the last one\n",g.payload);l=v,n.debug("Pushing log\n",g),s.execute(g)}catch(e){n.error("Error pushing log\n",e)}}}}(0,n,i,o,s,a)),function(t,n,i,o,s,a){n.debug("Initializing measurements API");let u=null;return{pushMeasurement:(t,{skipDedupe:l,context:c,spanContext:d,timestampOverwriteMs:f}={})=>{try{const p={type:e.TransportItemType.MEASUREMENT,payload:Object.assign(Object.assign({},t),{trace:d?{trace_id:d.traceId,span_id:d.spanId}:a.getTraceContext(),timestamp:f?E(f):T(),context:null!=c?c:{}}),meta:o.value},m={type:p.payload.type,values:p.payload.values,context:p.payload.context};if(!l&&i.dedupe&&!r(u)&&y(m,u))return void n.debug("Skipping measurement push because it is the same as the last one\n",p.payload);u=m,n.debug("Pushing measurement\n",p),s.execute(p)}catch(e){n.error("Error pushing measurement\n",e)}}}}(0,n,i,o,s,a)),function(t,n,i,o,s,a){let u=null;return{pushEvent:(t,l,c,{skipDedupe:d,spanContext:f,timestampOverwriteMs:p}={})=>{try{const m={meta:o.value,payload:{name:t,domain:null!=c?c:i.eventDomain,attributes:l,timestamp:p?E(p):T(),trace:f?{trace_id:f.traceId,span_id:f.spanId}:a.getTraceContext()},type:e.TransportItemType.EVENT},g={name:m.payload.name,attributes:m.payload.attributes,domain:m.payload.domain};if(!d&&i.dedupe&&!r(u)&&y(g,u))return void n.debug("Skipping event push because it is the same as the last one\n",m.payload);u=g,n.debug("Pushing event\n",m),s.execute(m)}catch(e){n.error("Error pushing event",e)}}}}(0,n,i,o,s,a))}class ee extends W{constructor(){super(...arguments),this.api={},this.transports={}}}const te="1.9.1";const ne="_faroInternal";function ie(e){e.config.isolate?e.internalLogger.debug("Skipping registering internal Faro instance on global object"):(e.internalLogger.debug("Registering internal Faro instance on global object"),Object.defineProperty(_,ne,{configurable:!1,enumerable:!1,writable:!1,value:e}))}function re(){return ne in _}function oe(t,n,i,r,o,s,a){return n.debug("Initializing Faro"),e.faro={api:s,config:i,instrumentations:a,internalLogger:n,metas:r,pause:o.pause,transports:o,unpatchedConsole:t,unpause:o.unpause},ie(e.faro),function(e){if(e.config.preventGlobalExposure)e.internalLogger.debug("Skipping registering public Faro instance in the global scope");else{if(e.internalLogger.debug(`Registering public faro reference in the global scope using "${e.config.globalObjectKey}" key`),e.config.globalObjectKey in _)return void e.internalLogger.warn(`Skipping global registration due to key "${e.config.globalObjectKey}" being used already. Please set "globalObjectKey" to something else or set "preventGlobalExposure" to "true"`);Object.defineProperty(_,e.config.globalObjectKey,{configurable:!1,writable:!1,value:e})}}(e.faro),e.faro}function se(e){const t=V(e),n=G(t,e);if(re()&&!e.isolate)return void n.error('Faro is already registered. Either add instrumentations, transports etc. to the global faro instance or use the "isolate" property');n.debug("Initializing");const i=function(e,t){let n=[],i=[];const r=()=>n.reduce(((e,t)=>Object.assign(e,u(t)?t():t)),{}),o=()=>{if(i.length){const e=r();i.forEach((t=>t(e)))}};return{add:(...e)=>{t.debug("Adding metas\n",e),n.push(...e),o()},remove:(...e)=>{t.debug("Removing metas\n",e),n=n.filter((t=>!e.includes(t))),o()},addListener:e=>{t.debug("Adding metas listener\n",e),i.push(e)},removeListener:e=>{t.debug("Removing metas listener\n",e),i=i.filter((t=>t!==e))},get value(){return r()}}}(0,n),r=j(t,n,e,i),o=Q(0,n,e,i,r),s=function(e,t,n,i,r,o){t.debug("Initializing instrumentations");const s=[];return{add:(...a)=>{t.debug("Adding instrumentations"),a.forEach((a=>{t.debug(`Adding "${a.name}" instrumentation`),s.some((e=>e.name===a.name))?t.warn(`Instrumentation ${a.name} is already added`):(a.unpatchedConsole=e,a.internalLogger=t,a.config=n,a.metas=i,a.transports=r,a.api=o,s.push(a),a.initialize())}))},get instrumentations(){return[...s]},remove:(...e)=>{t.debug("Removing instrumentations"),e.forEach((e=>{var n,i;t.debug(`Removing "${e.name}" instrumentation`);const r=s.reduce(((t,n,i)=>null===t&&n.name===e.name?i:null),null);r?(null===(i=(n=s[r]).destroy)||void 0===i||i.call(n),s.splice(r,1)):t.warn(`Instrumentation "${e.name}" is not added`)}))}}}(t,n,e,i,r,o),a=oe(t,n,e,i,r,o,s);return function(e){var t,n;const i={sdk:{version:te},app:{bundleId:e.config.app.name&&(r=e.config.app.name,null==_?void 0:_[`__faroBundleId_${r}`])}};var r;const o=null===(t=e.config.sessionTracking)||void 0===t?void 0:t.session;o&&e.api.setSession(o),e.config.app&&(i.app=Object.assign(Object.assign({},e.config.app),i.app)),e.config.user&&(i.user=e.config.user),e.config.view&&(i.view=e.config.view),e.metas.add(i,...null!==(n=e.config.metas)&&void 0!==n?n:[])}(a),function(e){e.transports.add(...e.config.transports),e.transports.addBeforeSendHooks(e.config.beforeSend),e.transports.addIgnoreErrorsPatterns(e.config.ignoreErrors)}(a),function(e){e.instrumentations.add(...e.config.instrumentations)}(a),a}e.faro={};const ae="faro",ue={enabled:!0,sendTimeout:250,itemLimit:50},le="view_changed",ce="session_start",de="session_resume",fe="session_extend";var pe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},me={exports:{}};!function(e,t){!function(n,i){var r="function",o="undefined",s="object",a="string",u="major",l="model",c="name",d="type",f="vendor",p="version",m="architecture",g="console",v="mobile",h="tablet",b="smarttv",w="wearable",y="embedded",S="Amazon",T="Apple",E="ASUS",I="BlackBerry",k="Browser",x="Chrome",L="Firefox",O="Google",C="Huawei",P="LG",_="Microsoft",N="Motorola",A="Opera",M="Samsung",D="Sharp",j="Sony",R="Xiaomi",B="Zebra",U="Facebook",F="Chromium OS",z="Mac OS",V=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},$=function(e,t){return typeof e===a&&-1!==q(t).indexOf(q(e))},q=function(e){return e.toLowerCase()},G=function(e,t){if(typeof e===a)return e=e.replace(/^\s\s*/,""),typeof t===o?e:e.substring(0,350)},W=function(e,t){for(var n,o,a,u,l,c,d=0;d<t.length&&!l;){var f=t[d],p=t[d+1];for(n=o=0;n<f.length&&!l&&f[n];)if(l=f[n++].exec(e))for(a=0;a<p.length;a++)c=l[++o],typeof(u=p[a])===s&&u.length>0?2===u.length?typeof u[1]==r?this[u[0]]=u[1].call(this,c):this[u[0]]=u[1]:3===u.length?typeof u[1]!==r||u[1].exec&&u[1].test?this[u[0]]=c?c.replace(u[1],u[2]):i:this[u[0]]=c?u[1].call(this,c,u[2]):i:4===u.length&&(this[u[0]]=c?u[3].call(this,c.replace(u[1],u[2])):i):this[u]=c||i;d+=2}},H=function(e,t){for(var n in t)if(typeof t[n]===s&&t[n].length>0){for(var r=0;r<t[n].length;r++)if($(t[n][r],e))return"?"===n?i:n}else if($(t[n],e))return"?"===n?i:n;return e},K={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},X={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,p],[/opios[\/ ]+([\w\.]+)/i],[p,[c,A+" Mini"]],[/\bopr\/([\w\.]+)/i],[p,[c,A]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[c,p],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[c,"UC"+k]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[p,[c,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[p,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[c,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[p,[c,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure "+k],p],[/\bfocus\/([\w\.]+)/i],[p,[c,L+" Focus"]],[/\bopt\/([\w\.]+)/i],[p,[c,A+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[c,A+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[c,"MIUI "+k]],[/fxios\/([-\w\.]+)/i],[p,[c,L]],[/\bqihu|(qi?ho?o?|360)browser/i],[[c,"360 "+k]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1 "+k],p],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[c,p],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,U],p],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[c,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[c,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[p,[c,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[c,x+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,x+" WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[c,"Android "+k]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,p],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[p,[c,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[p,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[p,H,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[c,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[c,L+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[c,p],[/(cobalt)\/([\w\.]+)/i],[c,[p,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[m,"amd64"]],[/(ia32(?=;))/i],[[m,q]],[/((?:i[346]|x)86)[;\)]/i],[[m,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[m,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[m,"armhf"]],[/windows (ce|mobile); ppc;/i],[[m,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[m,/ower/,"",q]],[/(sun4\w)[;\)]/i],[[m,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[m,q]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[f,M],[d,h]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[f,M],[d,v]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[l,[f,T],[d,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[f,T],[d,h]],[/(macintosh);/i],[l,[f,T]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[f,D],[d,v]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[f,C],[d,h]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[f,C],[d,v]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[l,/_/g," "],[f,R],[d,v]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[f,R],[d,h]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[f,"OPPO"],[d,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[f,"Vivo"],[d,v]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[f,"Realme"],[d,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[f,N],[d,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[f,N],[d,h]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[f,P],[d,h]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[f,P],[d,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[f,"Lenovo"],[d,h]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[f,"Nokia"],[d,v]],[/(pixel c)\b/i],[l,[f,O],[d,h]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[f,O],[d,v]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[f,j],[d,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[f,j],[d,h]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[f,"OnePlus"],[d,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[f,S],[d,h]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[f,S],[d,v]],[/(playbook);[-\w\),; ]+(rim)/i],[l,f,[d,h]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[f,I],[d,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[f,E],[d,h]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[f,E],[d,v]],[/(nexus 9)/i],[l,[f,"HTC"],[d,h]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[f,[l,/_/g," "],[d,v]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[f,"Acer"],[d,h]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[f,"Meizu"],[d,v]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[f,l,[d,v]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[f,l,[d,h]],[/(surface duo)/i],[l,[f,_],[d,h]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[f,"Fairphone"],[d,v]],[/(u304aa)/i],[l,[f,"AT&T"],[d,v]],[/\bsie-(\w*)/i],[l,[f,"Siemens"],[d,v]],[/\b(rct\w+) b/i],[l,[f,"RCA"],[d,h]],[/\b(venue[\d ]{2,7}) b/i],[l,[f,"Dell"],[d,h]],[/\b(q(?:mv|ta)\w+) b/i],[l,[f,"Verizon"],[d,h]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[f,"Barnes & Noble"],[d,h]],[/\b(tm\d{3}\w+) b/i],[l,[f,"NuVision"],[d,h]],[/\b(k88) b/i],[l,[f,"ZTE"],[d,h]],[/\b(nx\d{3}j) b/i],[l,[f,"ZTE"],[d,v]],[/\b(gen\d{3}) b.+49h/i],[l,[f,"Swiss"],[d,v]],[/\b(zur\d{3}) b/i],[l,[f,"Swiss"],[d,h]],[/\b((zeki)?tb.*\b) b/i],[l,[f,"Zeki"],[d,h]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[f,"Dragon Touch"],l,[d,h]],[/\b(ns-?\w{0,9}) b/i],[l,[f,"Insignia"],[d,h]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[f,"NextBook"],[d,h]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[f,"Voice"],l,[d,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[f,"LvTel"],l,[d,v]],[/\b(ph-1) /i],[l,[f,"Essential"],[d,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[f,"Envizen"],[d,h]],[/\b(trio[-\w\. ]+) b/i],[l,[f,"MachSpeed"],[d,h]],[/\btu_(1491) b/i],[l,[f,"Rotor"],[d,h]],[/(shield[\w ]+) b/i],[l,[f,"Nvidia"],[d,h]],[/(sprint) (\w+)/i],[f,l,[d,v]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[f,_],[d,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[f,B],[d,h]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[f,B],[d,v]],[/smart-tv.+(samsung)/i],[f,[d,b]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[f,M],[d,b]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[f,P],[d,b]],[/(apple) ?tv/i],[f,[l,T+" TV"],[d,b]],[/crkey/i],[[l,x+"cast"],[f,O],[d,b]],[/droid.+aft(\w+)( bui|\))/i],[l,[f,S],[d,b]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[f,D],[d,b]],[/(bravia[\w ]+)( bui|\))/i],[l,[f,j],[d,b]],[/(mitv-\w{5}) bui/i],[l,[f,R],[d,b]],[/Hbbtv.*(technisat) (.*);/i],[f,l,[d,b]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[f,G],[l,G],[d,b]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,b]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[f,l,[d,g]],[/droid.+; (shield) bui/i],[l,[f,"Nvidia"],[d,g]],[/(playstation [345portablevi]+)/i],[l,[f,j],[d,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[f,_],[d,g]],[/((pebble))app/i],[f,l,[d,w]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[l,[f,T],[d,w]],[/droid.+; (glass) \d/i],[l,[f,O],[d,w]],[/droid.+; (wt63?0{2,3})\)/i],[l,[f,B],[d,w]],[/(quest( 2| pro)?)/i],[l,[f,U],[d,w]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[f,[d,y]],[/(aeobc)\b/i],[l,[f,S],[d,y]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[l,[d,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[d,h]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,h]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,v]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[f,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[c,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,p],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[c,[p,H,K]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,"Windows"],[p,H,K]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,z],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[p,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[c,p],[/\(bb(10);/i],[p,[c,I]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[c,L+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[c,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[p,[c,"watchOS"]],[/crkey\/([\d\.]+)/i],[p,[c,x+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[c,F],p],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[c,p],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[c,p]]},J=function(e,t){if(typeof e===s&&(t=e,e=i),!(this instanceof J))return new J(e,t).getResult();var g=typeof n!==o&&n.navigator?n.navigator:i,b=e||(g&&g.userAgent?g.userAgent:""),w=g&&g.userAgentData?g.userAgentData:i,y=t?function(e,t){var n={};for(var i in e)t[i]&&t[i].length%2==0?n[i]=t[i].concat(e[i]):n[i]=e[i];return n}(X,t):X,S=g&&g.userAgent==b;return this.getBrowser=function(){var e,t={};return t[c]=i,t[p]=i,W.call(t,b,y.browser),t[u]=typeof(e=t[p])===a?e.replace(/[^\d\.]/g,"").split(".")[0]:i,S&&g&&g.brave&&typeof g.brave.isBrave==r&&(t[c]="Brave"),t},this.getCPU=function(){var e={};return e[m]=i,W.call(e,b,y.cpu),e},this.getDevice=function(){var e={};return e[f]=i,e[l]=i,e[d]=i,W.call(e,b,y.device),S&&!e[d]&&w&&w.mobile&&(e[d]=v),S&&"Macintosh"==e[l]&&g&&typeof g.standalone!==o&&g.maxTouchPoints&&g.maxTouchPoints>2&&(e[l]="iPad",e[d]=h),e},this.getEngine=function(){var e={};return e[c]=i,e[p]=i,W.call(e,b,y.engine),e},this.getOS=function(){var e={};return e[c]=i,e[p]=i,W.call(e,b,y.os),S&&!e[c]&&w&&"Unknown"!=w.platform&&(e[c]=w.platform.replace(/chrome os/i,F).replace(/macos/i,z)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return b},this.setUA=function(e){return b=typeof e===a&&e.length>350?G(e,350):e,this},this.setUA(b),this};J.VERSION="1.0.36",J.BROWSER=V([c,p,u]),J.CPU=V([m]),J.DEVICE=V([l,f,d,g,v,b,h,w,y]),J.ENGINE=J.OS=V([c,p]),e.exports&&(t=e.exports=J),t.UAParser=J;var Z=typeof n!==o&&(n.jQuery||n.Zepto);if(Z&&!Z.ua){var Y=new J;Z.ua=Y.getResult(),Z.ua.get=function(){return Y.getUA()},Z.ua.set=function(e){Y.setUA(e);var t=Y.getResult();for(var n in t)Z.ua[n]=t[n]}}}("object"==typeof window?window:pe)}(me,me.exports);var ge=me.exports;const ve=()=>{const e=new ge.UAParser,{name:t,version:n}=e.getBrowser(),{name:i,version:r}=e.getOS(),o=e.getUA(),s=navigator.language,a=navigator.userAgent.includes("Mobi"),u=function(){if(!t||!n)return;if("userAgentData"in navigator&&navigator.userAgentData)return navigator.userAgentData.brands;return}(),l="unknown";return{browser:{name:null!=t?t:l,version:null!=n?n:l,os:`${null!=i?i:l} ${null!=r?r:l}`,userAgent:null!=o?o:l,language:null!=s?s:l,mobile:a,brands:null!=u?u:l,viewportWidth:`${window.innerWidth}`,viewportHeight:`${window.innerHeight}`}}},he=()=>({page:{url:location.href}}),be=[ve,he];function we(t){var n,i,r,o;return{id:null!==(o=null===(r=null===(i=null===(n=e.faro.config)||void 0===n?void 0:n.sessionTracking)||void 0===i?void 0:i.generateSessionId)||void 0===r?void 0:r.call(i))&&void 0!==o?o:P(),attributes:t}}const ye={name:"default"},Se={session:"sessionStorage",local:"localStorage"};function Te(t){var n;try{let e;e=window[t];const n="__faro_storage_test__";return e.setItem(n,n),e.removeItem(n),!0}catch(i){return null===(n=e.faro.internalLogger)||void 0===n||n.info(`Web storage of type ${t} is not available. Reason: ${i}`),!1}}function Ee(e,t){return Oe(t)?window[t].getItem(e):null}function Ie(e,t,n){if(Oe(n))try{window[n].setItem(e,t)}catch(e){}}function ke(e,t){Oe(t)&&window[t].removeItem(e)}const xe=Te(Se.local),Le=Te(Se.session);function Oe(e){return e===Se.local?xe:e===Se.session&&Le}function Ce(e,t){let n,i=!1;const r=()=>{null!=n?(e(...n),n=null,setTimeout(r,t)):i=!1};return(...o)=>{i?n=o:(e(...o),i=!0,setTimeout(r,t))}}function Pe(){var t,n,i;const r=e.faro.config.sessionTracking;let o=null!==(i=null!==(n=null===(t=null==r?void 0:r.sampler)||void 0===t?void 0:t.call(r,{metas:e.faro.metas.value}))&&void 0!==n?n:null==r?void 0:r.samplingRate)&&void 0!==i?i:1;if("number"!=typeof o){o=0}return Math.random()<o}const _e="com.grafana.faro.session",Ne=144e5,Ae=9e5,Me=Ae,De={enabled:!0,persistent:!1,maxSessionPersistenceTime:Me};function je({sessionId:t,started:n,lastActivity:i,isSampled:r=!0}={}){var o,s;const a=S(),u=null===(s=null===(o=e.faro.config)||void 0===o?void 0:o.sessionTracking)||void 0===s?void 0:s.generateSessionId;return null==t&&(t="function"==typeof u?u():P()),{sessionId:t,lastActivity:null!=i?i:a,started:null!=n?n:a,isSampled:r}}function Re(e){if(null==e)return!1;const t=S();if(!(t-e.started<Ne))return!1;return t-e.lastActivity<Ae}function Be({fetchUserSession:t,storeUserSession:n}){return function({forceSessionExtend:i}={forceSessionExtend:!1}){var r,o,s;if(!t||!n)return;const a=e.faro.config.sessionTracking,u=null==a?void 0:a.persistent;if(u&&!xe||!u&&!Le)return;const l=t();if(!1===i&&Re(l))n(Object.assign(Object.assign({},l),{lastActivity:S()}));else{let t=Ue(je({isSampled:Pe()}),l);n(t),null===(r=e.faro.api)||void 0===r||r.setSession(t.sessionMeta),null===(o=null==a?void 0:a.onSessionChange)||void 0===o||o.call(a,null!==(s=null==l?void 0:l.sessionMeta)&&void 0!==s?s:null,t.sessionMeta)}}}function Ue(t,n){var i,r,o,s;return Object.assign(Object.assign({},t),{sessionMeta:{id:t.sessionId,attributes:Object.assign(Object.assign(Object.assign(Object.assign({},null===(r=null===(i=e.faro.config.sessionTracking)||void 0===i?void 0:i.session)||void 0===r?void 0:r.attributes),null!==(s=null===(o=e.faro.metas.value.session)||void 0===o?void 0:o.attributes)&&void 0!==s?s:{}),null!=n?{previousSession:n.sessionId}:{}),{isSampled:t.isSampled.toString()})}})}class Fe{constructor(){this.updateSession=Ce((()=>this.updateUserSession()),1e3),this.updateUserSession=Be({fetchUserSession:Fe.fetchUserSession,storeUserSession:Fe.storeUserSession}),this.init()}static removeUserSession(){ke(_e,Fe.storageTypeLocal)}static storeUserSession(e){Ie(_e,JSON.stringify(e),Fe.storageTypeLocal)}static fetchUserSession(){const e=Ee(_e,Fe.storageTypeLocal);return e?JSON.parse(e):null}init(){document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&this.updateSession()})),e.faro.metas.addListener((function(t){const n=t.session,i=Fe.fetchUserSession();if(n&&n.id!==(null==i?void 0:i.sessionId)){const t=Ue(je({sessionId:n.id,isSampled:Pe()}),i);Fe.storeUserSession(t),e.faro.api.setSession(t.sessionMeta)}}))}}Fe.storageTypeLocal=Se.local;class ze{constructor(){this.updateSession=Ce((()=>this.updateUserSession()),1e3),this.updateUserSession=Be({fetchUserSession:ze.fetchUserSession,storeUserSession:ze.storeUserSession}),this.init()}static removeUserSession(){ke(_e,ze.storageTypeSession)}static storeUserSession(e){Ie(_e,JSON.stringify(e),ze.storageTypeSession)}static fetchUserSession(){const e=Ee(_e,ze.storageTypeSession);return e?JSON.parse(e):null}init(){document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&this.updateSession()})),e.faro.metas.addListener((function(t){const n=t.session,i=ze.fetchUserSession();if(n&&n.id!==(null==i?void 0:i.sessionId)){const t=Ue(je({sessionId:n.id,isSampled:Pe()}),i);ze.storeUserSession(t),e.faro.api.setSession(t.sessionMeta)}}))}}function Ve(e){return(null==e?void 0:e.persistent)?Fe:ze}ze.storageTypeSession=Se.session;class $e extends ee{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-session",this.version=te}sendSessionStartEvent(e){var t,n;const i=e.session;if(i&&i.id!==(null===(t=this.notifiedSession)||void 0===t?void 0:t.id)){if(this.notifiedSession&&this.notifiedSession.id===(null===(n=i.attributes)||void 0===n?void 0:n.previousSession))return this.api.pushEvent(fe,{},void 0,{skipDedupe:!0}),void(this.notifiedSession=i);this.notifiedSession=i,this.api.pushEvent(ce,{},void 0,{skipDedupe:!0})}}createInitialSession(e,t){var n,i,r,o,s;let a,u,l=e.fetchUserSession();if(t.persistent&&t.maxSessionPersistenceTime&&l){const e=S();l.lastActivity<e-t.maxSessionPersistenceTime&&(Fe.removeUserSession(),l=null)}if(Re(l)){const e=null==l?void 0:l.sessionId;u=je({sessionId:e,isSampled:l.isSampled||!1,started:null==l?void 0:l.started}),u.sessionMeta={id:e,attributes:Object.assign(Object.assign(Object.assign({},null===(n=t.session)||void 0===n?void 0:n.attributes),null===(i=null==l?void 0:l.sessionMeta)||void 0===i?void 0:i.attributes),{isSampled:u.isSampled.toString()})},a=de}else{const e=null!==(o=null===(r=t.session)||void 0===r?void 0:r.id)&&void 0!==o?o:we().id;u=je({sessionId:e,isSampled:Pe()}),u.sessionMeta={id:e,attributes:Object.assign({isSampled:u.isSampled.toString()},null===(s=t.session)||void 0===s?void 0:s.attributes)},a=ce}return{initialSession:u,lifecycleType:a}}registerBeforeSendHook(e){var t;const{updateSession:n}=new e;null===(t=this.transports)||void 0===t||t.addBeforeSendHooks((e=>{var t,i,r;n();const o=null===(t=e.meta.session)||void 0===t?void 0:t.attributes;if(o&&"true"===(null==o?void 0:o.isSampled)){let t=JSON.parse(JSON.stringify(e));const n=null===(i=t.meta.session)||void 0===i?void 0:i.attributes;return null==n||delete n.isSampled,0===Object.keys(null!=n?n:{}).length&&(null===(r=t.meta.session)||void 0===r||delete r.attributes),t}return null}))}initialize(){this.logDebug("init session instrumentation");const e=this.config.sessionTracking;if(null==e?void 0:e.enabled){const t=Ve(e);this.registerBeforeSendHook(t);const{initialSession:n,lifecycleType:i}=this.createInitialSession(t,e);t.storeUserSession(n);const r=n.sessionMeta;this.notifiedSession=r,this.api.setSession(r),i===ce&&this.api.pushEvent(ce,{},void 0,{skipDedupe:!0}),i===de&&this.api.pushEvent(de,{},void 0,{skipDedupe:!0})}this.metas.addListener(this.sendSessionStartEvent.bind(this))}}class qe extends ee{constructor(e={}){super(),this.options=e,this.name="@grafana/faro-web-sdk:instrumentation-console",this.version=te}initialize(){this.logDebug("Initializing\n",this.options),x.filter((e=>{var t;return!(null!==(t=this.options.disabledLevels)&&void 0!==t?t:qe.defaultDisabledLevels).includes(e)})).forEach((e=>{console[e]=(...t)=>{try{this.api.pushLog(t,{level:e})}catch(e){this.logError(e)}finally{this.unpatchedConsole[e](...t)}}}))}}qe.defaultDisabledLevels=[e.LogLevel.DEBUG,e.LogLevel.TRACE,e.LogLevel.LOG];const Ge="DOMError",We="DOMException",He="Non-Error exception captured with keys:",Ke=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Xe="\n",Je="eval",Ze="?",Ye="@",Qe=/^\s*at (?:(.*\).*?|.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,et=/\((\S*)(?::(\d+))(?::(\d+))\)/,tt="eval",nt="address at ",it=nt.length,rt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|safari-extension|safari-web-extension|capacitor)?:\/.*?|\[native code]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ot=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,st=" > eval",at="safari-extension",ut="safari-web-extension",lt=/Minified React error #\d+;/i;function ct(e,t,n,i){const r={filename:e||document.location.href,function:t||Ze};return void 0!==n&&(r.lineno=n),void 0!==i&&(r.colno=i),r}function dt(e,t){const n=null==e?void 0:e.includes(at),i=!n&&(null==e?void 0:e.includes(ut));return n||i?[(null==e?void 0:e.includes(Ye))?e.split(Ye)[0]:e,n?`${at}:${t}`:`${ut}:${t}`]:[e,t]}function ft(e){let t=[];e.stacktrace?t=e.stacktrace.split(Xe).filter(((e,t)=>t%2==0)):e.stack&&(t=e.stack.split(Xe));const n=t.reduce(((t,n,i)=>{let r,o,a,u,l;if(r=Qe.exec(n)){if(o=r[1],a=r[2],u=r[3],l=r[4],null==a?void 0:a.startsWith(tt)){const e=et.exec(a);e&&(a=e[1],u=e[2],l=e[3])}a=(null==a?void 0:a.startsWith(nt))?a.substring(it):a,[o,a]=dt(o,a)}else if(r=rt.exec(n)){if(o=r[1],a=r[3],u=r[4],l=r[5],a&&a.includes(st)){const e=ot.exec(a);e&&(o=o||Je,a=e[1],u=e[2])}else 0===i&&!l&&s(e.columnNumber)&&(l=String(e.columnNumber+1));[o,a]=dt(o,a)}return(a||o)&&t.push(ct(a,o,u?Number(u):void 0,l?Number(l):void 0)),t}),[]);return lt.test(e.message)?n.slice(1):n}function pt(e){return{frames:ft(e)}}function mt(e){let t,n,i,r,o=[];if(g(e)&&e.error)t=e.error.message,n=e.error.name,o=ft(e.error);else if((i=v(e))||h(e)){const{name:r,message:o}=e;n=null!=r?r:i?Ge:We,t=o?`${n}: ${o}`:n}else m(e)?(t=e.message,o=ft(e)):(a(e)||(r=f(e)))&&(n=r?e.constructor.name:void 0,t=`${He} ${Object.keys(e)}`);return[t,n,o]}function gt(e){const t=window.onerror;window.onerror=(...n)=>{try{const[t,i,r,s,a]=n;let u,l,c=[];const d=o(t),f=ct(i,"?",r,s);a||!d?([u,l,c]=mt(null!=a?a:t),0===c.length&&(c=[f])):d&&([u,l]=function(e){var t,n;const i=e.match(Ke),r=null!==(t=null==i?void 0:i[1])&&void 0!==t?t:J;return[null!==(n=null==i?void 0:i[2])&&void 0!==n?n:e,r]}(t),c=[f]),u&&e.pushError(new Error(u),{type:l,stackFrames:c})}finally{null==t||t.apply(window,n)}}}class vt extends ee{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-errors",this.version=te}initialize(){var e;this.logDebug("Initializing"),gt(this.api),e=this.api,window.addEventListener("unhandledrejection",(t=>{var n,i;let r,o,s=t;s.reason?s=t.reason:(null===(n=t.detail)||void 0===n?void 0:n.reason)&&(s=null===(i=t.detail)||void 0===i?void 0:i.reason);let a=[];c(s)?(r=`Non-Error promise rejection captured with value: ${String(s)}`,o="UnhandledRejection"):[r,o,a]=mt(s),r&&e.pushError(new Error(r),{type:o,stackFrames:a})}))}}class ht extends ee{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-view",this.version=te}sendViewChangedEvent(e){var t,n,i;const r=e.view;r&&r.name!==(null===(t=this.notifiedView)||void 0===t?void 0:t.name)&&(this.api.pushEvent(le,{fromView:null!==(i=null===(n=this.notifiedView)||void 0===n?void 0:n.name)&&void 0!==i?i:"",toView:r.name},void 0,{skipDedupe:!0}),this.notifiedView=r)}initialize(){this.sendViewChangedEvent(this.metas.value),this.metas.addListener(this.sendViewChangedEvent.bind(this))}}var bt,wt,yt,St,Tt,Et=-1,It=function(e){addEventListener("pageshow",(function(t){t.persisted&&(Et=t.timeStamp,e(t))}),!0)},kt=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},xt=function(){var e=kt();return e&&e.activationStart||0},Lt=function(e,t){var n=kt(),i="navigate";return Et>=0?i="back-forward-cache":n&&(document.prerendering||xt()>0?i="prerender":document.wasDiscarded?i="restore":n.type&&(i=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},Ot=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return i.observe(Object.assign({type:e,buffered:!0},n||{})),i}}catch(e){}},Ct=function(e,t,n,i){var r,o;return function(s){t.value>=0&&(s||i)&&((o=t.value-(r||0))||void 0===r)&&(r=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},Pt=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},_t=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Nt=function(e){var t=!1;return function(){t||(e(),t=!0)}},At=-1,Mt=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Dt=function(e){"hidden"===document.visibilityState&&At>-1&&(At="visibilitychange"===e.type?e.timeStamp:0,Rt())},jt=function(){addEventListener("visibilitychange",Dt,!0),addEventListener("prerenderingchange",Dt,!0)},Rt=function(){removeEventListener("visibilitychange",Dt,!0),removeEventListener("prerenderingchange",Dt,!0)},Bt=function(){return At<0&&(At=Mt(),jt(),It((function(){setTimeout((function(){At=Mt(),jt()}),0)}))),{get firstHiddenTime(){return At}}},Ut=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},Ft=[1800,3e3],zt=function(e,t){t=t||{},Ut((function(){var n,i=Bt(),r=Lt("FCP"),o=Ot("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-xt(),0),r.entries.push(e),n(!0)))}))}));o&&(n=Ct(e,r,Ft,t.reportAllChanges),It((function(i){r=Lt("FCP"),n=Ct(e,r,Ft,t.reportAllChanges),Pt((function(){r.value=performance.now()-i.timeStamp,n(!0)}))})))}))},Vt=[.1,.25],$t=0,qt=1/0,Gt=0,Wt=function(e){e.forEach((function(e){e.interactionId&&(qt=Math.min(qt,e.interactionId),Gt=Math.max(Gt,e.interactionId),$t=Gt?(Gt-qt)/7+1:0)}))},Ht=[],Kt=new Map,Xt=0,Jt=[],Zt=function(e){if(Jt.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=Ht[Ht.length-1],n=Kt.get(e.interactionId);if(n||Ht.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var i={id:e.interactionId,latency:e.duration,entries:[e]};Kt.set(i.id,i),Ht.push(i)}Ht.sort((function(e,t){return t.latency-e.latency})),Ht.length>10&&Ht.splice(10).forEach((function(e){return Kt.delete(e.id)}))}}},Yt=[200,500],Qt=[2500,4e3],en={},tn=[800,1800],nn=function e(t){document.prerendering?Ut((function(){return e(t)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},rn={passive:!0,capture:!0},on=new Date,sn=function(e,t){wt||(wt=t,yt=e,St=new Date,ln(removeEventListener),an())},an=function(){if(yt>=0&&yt<St-on){var e={entryType:"first-input",name:wt.type,target:wt.target,cancelable:wt.cancelable,startTime:wt.timeStamp,processingStart:wt.timeStamp+yt};Tt.forEach((function(t){t(e)})),Tt=[]}},un=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){sn(e,t),r()},i=function(){r()},r=function(){removeEventListener("pointerup",n,rn),removeEventListener("pointercancel",i,rn)};addEventListener("pointerup",n,rn),addEventListener("pointercancel",i,rn)}(t,e):sn(t,e)}},ln=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,un,rn)}))},cn=[100,300];class dn{constructor(e){this.pushMeasurement=e}initialize(){Object.entries(dn.mapping).forEach((([e,t])=>{t((t=>{this.pushMeasurement({type:"web-vitals",values:{[e]:t.value}})}))}))}}dn.mapping={cls:function(e,t){t=t||{},zt(Nt((function(){var n,i=Lt("CLS",0),r=0,o=[],s=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=o[0],n=o[o.length-1];r&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(r+=e.value,o.push(e)):(r=e.value,o=[e])}})),r>i.value&&(i.value=r,i.entries=o,n())},a=Ot("layout-shift",s);a&&(n=Ct(e,i,Vt,t.reportAllChanges),_t((function(){s(a.takeRecords()),n(!0)})),It((function(){r=0,i=Lt("CLS",0),n=Ct(e,i,Vt,t.reportAllChanges),Pt((function(){return n()}))})),setTimeout(n,0))})))},fcp:zt,fid:function(e,t){t=t||{},Ut((function(){var n,i=Bt(),r=Lt("FID"),o=function(e){e.startTime<i.firstHiddenTime&&(r.value=e.processingStart-e.startTime,r.entries.push(e),n(!0))},s=function(e){e.forEach(o)},a=Ot("first-input",s);n=Ct(e,r,cn,t.reportAllChanges),a&&(_t(Nt((function(){s(a.takeRecords()),a.disconnect()}))),It((function(){var i;r=Lt("FID"),n=Ct(e,r,cn,t.reportAllChanges),Tt=[],yt=-1,wt=null,ln(addEventListener),i=o,Tt.push(i),an()})))}))},inp:function(e,t){t=t||{},Ut((function(){var n;"interactionCount"in performance||bt||(bt=Ot("event",Wt,{type:"event",buffered:!0,durationThreshold:0}));var i,r=Lt("INP"),o=function(e){e.forEach(Zt);var t,n=(t=Math.min(Ht.length-1,Math.floor(((bt?$t:performance.interactionCount||0)-Xt)/50)),Ht[t]);n&&n.latency!==r.value&&(r.value=n.latency,r.entries=n.entries,i())},s=Ot("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});i=Ct(e,r,Yt,t.reportAllChanges),s&&("PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&s.observe({type:"first-input",buffered:!0}),_t((function(){o(s.takeRecords()),i(!0)})),It((function(){Xt=0,Ht.length=0,Kt.clear(),r=Lt("INP"),i=Ct(e,r,Yt,t.reportAllChanges)})))}))},lcp:function(e,t){t=t||{},Ut((function(){var n,i=Bt(),r=Lt("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-xt(),0),r.entries=[e],n())}))},s=Ot("largest-contentful-paint",o);if(s){n=Ct(e,r,Qt,t.reportAllChanges);var a=Nt((function(){en[r.id]||(o(s.takeRecords()),s.disconnect(),en[r.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return e=a,t=self.requestIdleCallback||self.setTimeout,n=-1,e=Nt(e),"hidden"===document.visibilityState?e():(n=t(e),_t(e)),n;var e,t,n}),!0)})),_t(a),It((function(i){r=Lt("LCP"),n=Ct(e,r,Qt,t.reportAllChanges),Pt((function(){r.value=performance.now()-i.timeStamp,en[r.id]=!0,n(!0)}))}))}}))},ttfb:function(e,t){t=t||{};var n=Lt("TTFB"),i=Ct(e,n,tn,t.reportAllChanges);nn((function(){var r=kt();r&&(n.value=Math.max(r.responseStart-xt(),0),n.entries=[r],i(!0),It((function(){n=Lt("TTFB",0),(i=Ct(e,n,tn,t.reportAllChanges))(!0)})))}))}};var fn,pn,mn=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},gn=function(e){if("loading"===document.readyState)return"loading";var t=mn();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},vn=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},hn=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var i=e,r=i.id?"#"+i.id:vn(i)+(i.classList&&i.classList.value&&i.classList.value.trim()&&i.classList.value.trim().length?"."+i.classList.value.trim().replace(/\s+/g,"."):"");if(n.length+r.length>(t||100)-1)return n||r;if(n=n?r+">"+n:r,i.id)break;e=i.parentNode}}catch(e){}return n},bn=-1,wn=function(){return bn},yn=function(e){addEventListener("pageshow",(function(t){t.persisted&&(bn=t.timeStamp,e(t))}),!0)},Sn=function(){var e=mn();return e&&e.activationStart||0},Tn=function(e,t){var n=mn(),i="navigate";return wn()>=0?i="back-forward-cache":n&&(document.prerendering||Sn()>0?i="prerender":document.wasDiscarded?i="restore":n.type&&(i=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},En=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return i.observe(Object.assign({type:e,buffered:!0},n||{})),i}}catch(e){}},In=function(e,t,n,i){var r,o;return function(s){t.value>=0&&(s||i)&&((o=t.value-(r||0))||void 0===r)&&(r=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},kn=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},xn=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Ln=function(e){var t=!1;return function(){t||(e(),t=!0)}},On=-1,Cn=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Pn=function(e){"hidden"===document.visibilityState&&On>-1&&(On="visibilitychange"===e.type?e.timeStamp:0,Nn())},_n=function(){addEventListener("visibilitychange",Pn,!0),addEventListener("prerenderingchange",Pn,!0)},Nn=function(){removeEventListener("visibilitychange",Pn,!0),removeEventListener("prerenderingchange",Pn,!0)},An=function(){return On<0&&(On=Cn(),_n(),yn((function(){setTimeout((function(){On=Cn(),_n()}),0)}))),{get firstHiddenTime(){return On}}},Mn=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},Dn=[1800,3e3],jn=function(e,t){t=t||{},Mn((function(){var n,i=An(),r=Tn("FCP"),o=En("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-Sn(),0),r.entries.push(e),n(!0)))}))}));o&&(n=In(e,r,Dn,t.reportAllChanges),yn((function(i){r=Tn("FCP"),n=In(e,r,Dn,t.reportAllChanges),kn((function(){r.value=performance.now()-i.timeStamp,n(!0)}))})))}))},Rn=[.1,.25],Bn=0,Un=1/0,Fn=0,zn=function(e){e.forEach((function(e){e.interactionId&&(Un=Math.min(Un,e.interactionId),Fn=Math.max(Fn,e.interactionId),Bn=Fn?(Fn-Un)/7+1:0)}))},Vn=function(){"interactionCount"in performance||fn||(fn=En("event",zn,{type:"event",buffered:!0,durationThreshold:0}))},$n=[],qn=new Map,Gn=0,Wn=function(){return(fn?Bn:performance.interactionCount||0)-Gn},Hn=[],Kn=function(e){if(Hn.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=$n[$n.length-1],n=qn.get(e.interactionId);if(n||$n.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var i={id:e.interactionId,latency:e.duration,entries:[e]};qn.set(i.id,i),$n.push(i)}$n.sort((function(e,t){return t.latency-e.latency})),$n.length>10&&$n.splice(10).forEach((function(e){return qn.delete(e.id)}))}}},Xn=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=Ln(e),"hidden"===document.visibilityState?e():(n=t(e),xn(e)),n},Jn=[200,500],Zn=[],Yn=new Map,Qn=[],ei=new WeakMap,ti=new Map,ni=-1,ii=function(e){e.forEach((function(e){return Zn.push(e)}))},ri=function(){ti.size>10&&ti.forEach((function(e,t){qn.has(t)||ti.delete(t)})),Qn=Qn.slice(-50);var e=new Set(Qn.concat($n.map((function(e){return ei.get(e.entries[0])}))));Yn.forEach((function(t,n){e.has(n)||Yn.delete(n)}));var t=new Set;Yn.forEach((function(e){li(e.startTime,e.processingEnd).forEach((function(e){t.add(e)}))})),Zn=Array.from(t),ni=-1};Hn.push((function(e){e.interactionId&&e.target&&!ti.has(e.interactionId)&&ti.set(e.interactionId,e.target)}),(function(e){for(var t,n=e.startTime+e.duration,i=Qn.length-1;i>=0;i--)if(t=Qn[i],Math.abs(n-t)<=8){var r=Yn.get(t);r.startTime=Math.min(e.startTime,r.startTime),r.processingStart=Math.min(e.processingStart,r.processingStart),r.processingEnd=Math.max(e.processingEnd,r.processingEnd),r.entries.push(e),n=t;break}n!==t&&(Qn.push(n),Yn.set(n,{startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,entries:[e]})),(e.interactionId||"first-input"===e.entryType)&&ei.set(e,n)}),(function(){ni<0&&(ni=Xn(ri))}));var oi,si,ai,ui,li=function(e,t){for(var n,i=[],r=0;n=Zn[r];r++)if(!(n.startTime+n.duration<e)){if(n.startTime>t)break;i.push(n)}return i},ci=function(e,t){pn||(pn=En("long-animation-frame",ii)),function(e,t){t=t||{},Mn((function(){var n;Vn();var i,r=Tn("INP"),o=function(e){e.forEach(Kn);var t,n=(t=Math.min($n.length-1,Math.floor(Wn()/50)),$n[t]);n&&n.latency!==r.value&&(r.value=n.latency,r.entries=n.entries,i())},s=En("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});i=In(e,r,Jn,t.reportAllChanges),s&&("PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&s.observe({type:"first-input",buffered:!0}),xn((function(){o(s.takeRecords()),i(!0)})),yn((function(){Gn=0,$n.length=0,qn.clear(),r=Tn("INP"),i=In(e,r,Jn,t.reportAllChanges)})))}))}((function(t){Xn((function(){var n=function(e){var t=e.entries[0],n=ei.get(t),i=Yn.get(n),r=t.processingStart,o=i.processingEnd,s=i.entries.sort((function(e,t){return e.processingStart-t.processingStart})),a=li(t.startTime,o),u=e.entries.find((function(e){return e.target})),l=u&&u.target||ti.get(t.interactionId),c=[t.startTime+t.duration,o].concat(a.map((function(e){return e.startTime+e.duration}))),d=Math.max.apply(Math,c),f={interactionTarget:hn(l),interactionTargetElement:l,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:d,processedEventEntries:s,longAnimationFrameEntries:a,inputDelay:r-t.startTime,processingDuration:o-r,presentationDelay:Math.max(d-o,0),loadState:gn(t.startTime)};return Object.assign(e,{attribution:f})}(t);e(n)}))}),t)},di=[2500,4e3],fi={},pi=[800,1800],mi=function e(t){document.prerendering?Mn((function(){return e(t)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},gi=function(e,t){t=t||{};var n=Tn("TTFB"),i=In(e,n,pi,t.reportAllChanges);mi((function(){var r=mn();r&&(n.value=Math.max(r.responseStart-Sn(),0),n.entries=[r],i(!0),yn((function(){n=Tn("TTFB",0),(i=In(e,n,pi,t.reportAllChanges))(!0)})))}))},vi={passive:!0,capture:!0},hi=new Date,bi=function(e,t){oi||(oi=t,si=e,ai=new Date,Si(removeEventListener),wi())},wi=function(){if(si>=0&&si<ai-hi){var e={entryType:"first-input",name:oi.type,target:oi.target,cancelable:oi.cancelable,startTime:oi.timeStamp,processingStart:oi.timeStamp+si};ui.forEach((function(t){t(e)})),ui=[]}},yi=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){bi(e,t),r()},i=function(){r()},r=function(){removeEventListener("pointerup",n,vi),removeEventListener("pointercancel",i,vi)};addEventListener("pointerup",n,vi),addEventListener("pointercancel",i,vi)}(t,e):bi(t,e)}},Si=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,yi,vi)}))},Ti=[100,300],Ei=function(e,t){!function(e,t){t=t||{},Mn((function(){var n,i=An(),r=Tn("FID"),o=function(e){e.startTime<i.firstHiddenTime&&(r.value=e.processingStart-e.startTime,r.entries.push(e),n(!0))},s=function(e){e.forEach(o)},a=En("first-input",s);n=In(e,r,Ti,t.reportAllChanges),a&&(xn(Ln((function(){s(a.takeRecords()),a.disconnect()}))),yn((function(){var i;r=Tn("FID"),n=In(e,r,Ti,t.reportAllChanges),ui=[],si=-1,oi=null,Si(addEventListener),i=o,ui.push(i),wi()})))}))}((function(t){var n=function(e){var t=e.entries[0],n={eventTarget:hn(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:gn(t.startTime)};return Object.assign(e,{attribution:n})}(t);e(n)}),t)};const Ii="com.grafana.faro.lastNavigationId",ki="load_state",xi="time_to_first_byte";class Li{constructor(e){this.corePushMeasurement=e}initialize(){this.measureCLS(),this.measureFCP(),this.measureFID(),this.measureINP(),this.measureLCP(),this.measureTTFB()}measureCLS(){!function(e,t){!function(e,t){t=t||{},jn(Ln((function(){var n,i=Tn("CLS",0),r=0,o=[],s=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=o[0],n=o[o.length-1];r&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(r+=e.value,o.push(e)):(r=e.value,o=[e])}})),r>i.value&&(i.value=r,i.entries=o,n())},a=En("layout-shift",s);a&&(n=In(e,i,Rn,t.reportAllChanges),xn((function(){s(a.takeRecords()),n(!0)})),yn((function(){r=0,i=Tn("CLS",0),n=In(e,i,Rn,t.reportAllChanges),kn((function(){return n()}))})),setTimeout(n,0))})))}((function(t){var n=function(e){var t,n={};if(e.entries.length){var i=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(i&&i.sources&&i.sources.length){var r=(t=i.sources).find((function(e){return e.node&&1===e.node.nodeType}))||t[0];r&&(n={largestShiftTarget:hn(r.node),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:r,largestShiftEntry:i,loadState:gn(i.startTime)})}}return Object.assign(e,{attribution:n})}(t);e(n)}),t)}((e=>{const{loadState:t,largestShiftValue:n,largestShiftTime:i,largestShiftTarget:r}=e.attribution,o=this.buildInitialValues(e);this.addIfPresent(o,"largest_shift_value",n),this.addIfPresent(o,"largest_shift_time",i);const s=this.buildInitialContext(e);this.addIfPresent(s,ki,t),this.addIfPresent(s,"largest_shift_target",r),this.pushMeasurement(o,s)}))}measureFCP(){!function(e,t){jn((function(t){var n=function(e){var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:gn(wn())};if(e.entries.length){var n=mn(),i=e.entries[e.entries.length-1];if(n){var r=n.activationStart||0,o=Math.max(0,n.responseStart-r);t={timeToFirstByte:o,firstByteToFCP:e.value-o,loadState:gn(e.entries[0].startTime),navigationEntry:n,fcpEntry:i}}}return Object.assign(e,{attribution:t})}(t);e(n)}),t)}((e=>{const{firstByteToFCP:t,timeToFirstByte:n,loadState:i}=e.attribution,r=this.buildInitialValues(e);this.addIfPresent(r,"first_byte_to_fcp",t),this.addIfPresent(r,xi,n);const o=this.buildInitialContext(e);this.addIfPresent(o,ki,i),this.pushMeasurement(r,o)}))}measureFID(){Ei((e=>{const{eventTime:t,eventTarget:n,eventType:i,loadState:r}=e.attribution,o=this.buildInitialValues(e);this.addIfPresent(o,"event_time",t);const s=this.buildInitialContext(e);this.addIfPresent(s,"event_target",n),this.addIfPresent(s,"event_type",i),this.addIfPresent(s,ki,r),this.pushMeasurement(o,s)}))}measureINP(){ci((e=>{const{interactionTime:t,presentationDelay:n,inputDelay:i,processingDuration:r,nextPaintTime:o,loadState:s,interactionTarget:a,interactionType:u}=e.attribution,l=this.buildInitialValues(e);this.addIfPresent(l,"interaction_time",t),this.addIfPresent(l,"presentation_delay",n),this.addIfPresent(l,"input_delay",i),this.addIfPresent(l,"processing_duration",r),this.addIfPresent(l,"next_paint_time",o);const c=this.buildInitialContext(e);this.addIfPresent(c,ki,s),this.addIfPresent(c,"interaction_target",a),this.addIfPresent(c,"interaction_type",u),this.pushMeasurement(l,c)}))}measureLCP(){!function(e,t){!function(e,t){t=t||{},Mn((function(){var n,i=An(),r=Tn("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-Sn(),0),r.entries=[e],n())}))},s=En("largest-contentful-paint",o);if(s){n=In(e,r,di,t.reportAllChanges);var a=Ln((function(){fi[r.id]||(o(s.takeRecords()),s.disconnect(),fi[r.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return Xn(a)}),!0)})),xn(a),yn((function(i){r=Tn("LCP"),n=In(e,r,di,t.reportAllChanges),kn((function(){r.value=performance.now()-i.timeStamp,fi[r.id]=!0,n(!0)}))}))}}))}((function(t){var n=function(e){var t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){var n=mn();if(n){var i=n.activationStart||0,r=e.entries[e.entries.length-1],o=r.url&&performance.getEntriesByType("resource").filter((function(e){return e.name===r.url}))[0],s=Math.max(0,n.responseStart-i),a=Math.max(s,o?(o.requestStart||o.startTime)-i:0),u=Math.max(a,o?o.responseEnd-i:0),l=Math.max(u,r.startTime-i);t={element:hn(r.element),timeToFirstByte:s,resourceLoadDelay:a-s,resourceLoadDuration:u-a,elementRenderDelay:l-u,navigationEntry:n,lcpEntry:r},r.url&&(t.url=r.url),o&&(t.lcpResourceEntry=o)}}return Object.assign(e,{attribution:t})}(t);e(n)}),t)}((e=>{const{elementRenderDelay:t,resourceLoadDelay:n,resourceLoadDuration:i,timeToFirstByte:r,element:o}=e.attribution,s=this.buildInitialValues(e);this.addIfPresent(s,"element_render_delay",t),this.addIfPresent(s,"resource_load_delay",n),this.addIfPresent(s,"resource_load_duration",i),this.addIfPresent(s,xi,r);const a=this.buildInitialContext(e);this.addIfPresent(a,"element",o),this.pushMeasurement(s,a)}))}measureTTFB(){!function(e,t){gi((function(t){var n=function(e){var t={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(e.entries.length){var n=e.entries[0],i=n.activationStart||0,r=Math.max((n.workerStart||n.fetchStart)-i,0),o=Math.max(n.domainLookupStart-i,0),s=Math.max(n.connectStart-i,0),a=Math.max(n.connectEnd-i,0);t={waitingDuration:r,cacheDuration:o-r,dnsDuration:s-o,connectionDuration:a-s,requestDuration:e.value-a,navigationEntry:n}}return Object.assign(e,{attribution:t})}(t);e(n)}),t)}((e=>{const{dnsDuration:t,connectionDuration:n,requestDuration:i,waitingDuration:r,cacheDuration:o}=e.attribution,s=this.buildInitialValues(e);this.addIfPresent(s,"dns_duration",t),this.addIfPresent(s,"connection_duration",n),this.addIfPresent(s,"request_duration",i),this.addIfPresent(s,"waiting_duration",r),this.addIfPresent(s,"cache_duration",o);const a=this.buildInitialContext(e);this.pushMeasurement(s,a)}))}buildInitialValues(e){const t=e.name.toLowerCase();return{[t]:e.value,delta:e.delta}}buildInitialContext(e){var t;const n=null!==(t=Ee(Ii,Se.session))&&void 0!==t?t:"unknown";return{id:e.id,rating:e.rating,navigation_type:e.navigationType,navigation_entry_id:n}}pushMeasurement(e,t){this.corePushMeasurement({type:"web-vitals",values:e},{context:t})}addIfPresent(e,t,n){n&&(e[t]=n)}}class Oi extends ee{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-web-vitals",this.version=te}initialize(){this.logDebug("Initializing");this.intializeWebVitalsInstrumentation().initialize()}intializeWebVitalsInstrumentation(){return this.config.trackWebVitalsAttribution?new Li(this.api.pushMeasurement):new dn(this.api.pushMeasurement)}}function Ci(e,t,n,i){return new(n||(n=Promise))((function(r,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const Pi=/^00-[a-f0-9]{32}-[a-f0-9]{16}-[0-9]{1,2}$/;function _i(e=[]){for(const t of e)if("traceparent"===t.name){if(!Pi.test(t.description))continue;const[,e,n]=t.description.split("-");if(null!=e&&null!=n)return{traceId:e,spanId:n};break}}function Ni(e=[],t){return e.some((e=>e&&null!=t.match(e)))}function Ai(e,t={}){for(const[n,i]of Object.entries(t)){const t=e[n];return null!=t&&(l(i)?i.includes(t):t===i)}return!0}function Mi(e){const{connectEnd:t,connectStart:n,decodedBodySize:i,domainLookupEnd:r,domainLookupStart:o,duration:s,encodedBodySize:a,fetchStart:u,initiatorType:l,name:c,nextHopProtocol:d,redirectEnd:f,redirectStart:p,renderBlockingStatus:m,requestStart:g,responseEnd:v,responseStart:h,responseStatus:b,secureConnectionStart:w,transferSize:y,workerStart:S}=e;return{name:c,duration:ji(s),tcpHandshakeTime:ji(t-n),dnsLookupTime:ji(r-o),tlsNegotiationTime:ji(g-w),responseStatus:ji(b),redirectTime:ji(f-p),requestTime:ji(h-g),responseTime:ji(v-h),fetchTime:ji(v-u),serviceWorkerTime:ji(u-S),decodedBodySize:ji(i),encodedBodySize:ji(a),cacheHitStatus:function(){let e="fullLoad";0===y?i>0&&(e="cache"):null!=b?304===b&&(e="conditionalFetch"):a>0&&y<a&&(e="conditionalFetch");return e}(),renderBlockingStatus:ji(m),protocol:d,initiatorType:l}}function Di(e){const{activationStart:t,domComplete:n,domContentLoadedEventEnd:i,domContentLoadedEventStart:r,domInteractive:o,fetchStart:s,loadEventEnd:a,loadEventStart:u,responseStart:l,type:c}=e,d=function(){var e;if(null!=(null===(e=performance.timing)||void 0===e?void 0:e.domLoading))return performance.timing.domLoading-performance.timeOrigin;return null}();return Object.assign({visibilityState:document.visibilityState,pageLoadTime:ji(n-s),documentParsingTime:ji(d?o-d:null),domProcessingTime:ji(n-o),domContentLoadHandlerTime:ji(i-r),onLoadTime:ji(a-u),ttfb:ji(Math.max(l-(null!=t?t:0),0)),type:c},Mi(e))}function ji(e){return null==e?"unknown":"number"==typeof e?Math.round(e).toString():e.toString()}const Ri={initiatorType:["xmlhttprequest","fetch"]};class Bi extends ee{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-performance",this.version=te}initialize(){"PerformanceObserver"in window?function(e){if("complete"===document.readyState)e();else{const t=()=>{"complete"===document.readyState&&(e(),document.removeEventListener("readystatechange",t))};document.addEventListener("readystatechange",t)}}((()=>Ci(this,void 0,void 0,(function*(){const t=this.api.pushEvent,n=this.getIgnoreUrls(),{faroNavigationId:i}=yield function(e,t){let n;const i=new Promise((e=>{n=e}));return new PerformanceObserver((i=>{var r;const[o]=i.getEntries();if(null==o||Ni(t,o.name))return;const s=o.toJSON();let a=_i(null==s?void 0:s.serverTiming);const u=null!==(r=Ee(Ii,Se.session))&&void 0!==r?r:"unknown",l=Object.assign(Object.assign({},Di(s)),{faroNavigationId:P(),faroPreviousNavigationId:u});Ie(Ii,l.faroNavigationId,Se.session),e("faro.performance.navigation",l,void 0,{spanContext:a,timestampOverwriteMs:performance.timeOrigin+s.startTime}),n(l)})).observe({type:"navigation",buffered:!0}),i}(t,n);null!=i&&function(t,n,i){const r=e.faro.config.trackResources;new PerformanceObserver((e=>{const o=e.getEntries();for(const e of o){if(Ni(i,e.name))return;const o=e.toJSON();let s=_i(null==o?void 0:o.serverTiming);if(null==r&&Ai(o,Ri)||r){const e=Object.assign(Object.assign({},Mi(o)),{faroNavigationId:t,faroResourceId:P()});n("faro.performance.resource",e,void 0,{spanContext:s,timestampOverwriteMs:performance.timeOrigin+o.startTime})}}})).observe({type:"resource",buffered:!0})}(i,t,n)})))):this.logDebug("performance observer not supported. Disable performance instrumentation.")}getIgnoreUrls(){var e;return null===(e=this.transports.transports)||void 0===e?void 0:e.flatMap((e=>e.getIgnoreUrls()))}}function Ui(e={}){const t=[new vt,new Oi,new $e,new ht];return!1!==e.enablePerformanceInstrumentation&&t.unshift(new Bi),!1!==e.captureConsole&&t.push(new qe({disabledLevels:e.captureConsoleDisabledLevels})),t}const Fi="browser",zi=()=>{const e=window.k6;return{k6:Object.assign({isK6Browser:!0},(null==e?void 0:e.testRunId)&&{testRunId:null==e?void 0:e.testRunId})}};class Vi extends H{constructor(e){var t,n,i,r;super(),this.options=e,this.name="@grafana/faro-web-sdk:transport-fetch",this.version=te,this.disabledUntil=new Date,this.rateLimitBackoffMs=null!==(t=e.defaultRateLimitBackoffMs)&&void 0!==t?t:5e3,this.getNow=null!==(n=e.getNow)&&void 0!==n?n:()=>Date.now(),this.promiseBuffer=O({size:null!==(i=e.bufferSize)&&void 0!==i?i:30,concurrency:null!==(r=e.concurrency)&&void 0!==r?r:5})}send(e){return Ci(this,void 0,void 0,(function*(){try{if(this.disabledUntil>new Date(this.getNow()))return this.logWarn(`Dropping transport item due to too many requests. Backoff until ${this.disabledUntil}`),Promise.resolve();yield this.promiseBuffer.add((()=>{const t=JSON.stringify(X(e)),{url:n,requestOptions:i,apiKey:r}=this.options,o=null!=i?i:{},{headers:s}=o,a=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}(o,["headers"]);let u;const l=this.metas.value.session;return null!=l&&(u=l.id),fetch(n,Object.assign({method:"POST",headers:Object.assign(Object.assign(Object.assign({"Content-Type":"application/json"},null!=s?s:{}),r?{"x-api-key":r}:{}),u?{"x-faro-session-id":u}:{}),body:t,keepalive:t.length<=6e4},null!=a?a:{})).then((e=>Ci(this,void 0,void 0,(function*(){if(202===e.status){"invalid"===e.headers.get("X-Faro-Session-Status")&&this.extendFaroSession(this.config,this.logDebug)}return 429===e.status&&(this.disabledUntil=this.getRetryAfterDate(e),this.logWarn(`Too many requests, backing off until ${this.disabledUntil}`)),e.text().catch(L),e})))).catch((e=>{this.logError("Failed sending payload to the receiver\n",JSON.parse(t),e)}))}))}catch(e){this.logError(e)}}))}getIgnoreUrls(){var e;return[this.options.url].concat(null!==(e=this.config.ignoreUrls)&&void 0!==e?e:[])}isBatched(){return!0}getRetryAfterDate(e){const t=this.getNow(),n=e.headers.get("Retry-After");if(n){const e=Number(n);if(!isNaN(e))return new Date(1e3*e+t);const i=Date.parse(n);if(!isNaN(i))return new Date(i)}return new Date(t+this.rateLimitBackoffMs)}extendFaroSession(e,t){const n="Session expired",i=e.sessionTracking;if(null==i?void 0:i.enabled){const{fetchUserSession:e,storeUserSession:r}=Ve(i);Be({fetchUserSession:e,storeUserSession:r})({forceSessionExtend:!0}),t(`${n} created new session.`)}else t(`${n}.`)}}function $i(e){var t,n,i,r,o,s,u,l,c,d;const f=[],p=$(e.unpatchedConsole,e.internalLoggerLevel);e.transports?((e.url||e.apiKey)&&p.error('if "transports" is defined, "url" and "apiKey" should not be defined'),f.push(...e.transports)):e.url?f.push(new Vi({url:e.url,apiKey:e.apiKey})):p.error('either "url" or "transports" must be defined');return{app:e.app,batching:Object.assign(Object.assign({},ue),e.batching),dedupe:null===(t=e.dedupe)||void 0===t||t,globalObjectKey:e.globalObjectKey||ae,instrumentations:null!==(n=e.instrumentations)&&void 0!==n?n:Ui(),internalLoggerLevel:null!==(i=e.internalLoggerLevel)&&void 0!==i?i:U,isolate:null!==(r=e.isolate)&&void 0!==r&&r,logArgsSerializer:null!==(o=e.logArgsSerializer)&&void 0!==o?o:Y,metas:function(){const t=be;return e.metas&&t.push(...e.metas),a(window.k6)?[...t,zi]:t}(),parseStacktrace:pt,paused:null!==(s=e.paused)&&void 0!==s&&s,preventGlobalExposure:null!==(u=e.preventGlobalExposure)&&void 0!==u&&u,transports:f,unpatchedConsole:null!==(l=e.unpatchedConsole)&&void 0!==l?l:F,beforeSend:e.beforeSend,eventDomain:null!==(c=e.eventDomain)&&void 0!==c?c:Fi,ignoreErrors:e.ignoreErrors,ignoreUrls:e.ignoreUrls,sessionTracking:Object.assign(Object.assign({},De),e.sessionTracking),user:e.user,view:null!==(d=e.view)&&void 0!==d?d:ye,trackResources:e.trackResources,trackWebVitalsAttribution:e.trackWebVitalsAttribution}}return e.BaseExtension=W,e.BaseInstrumentation=ee,e.BaseTransport=H,e.ConsoleInstrumentation=qe,e.ConsoleTransport=class extends H{constructor(e={}){super(),this.options=e,this.name="@grafana/faro-web-sdk:transport-console",this.version=te}send(t){var n;return this.unpatchedConsole[null!==(n=this.options.level)&&void 0!==n?n:e.LogLevel.DEBUG]("New event",X([t]))}},e.Conventions={EventNames:{CLICK:"click",NAVIGATION:"navigation",SESSION_START:"session_start",VIEW_CHANGED:"view_changed"}},e.EVENT_CLICK="click",e.EVENT_NAVIGATION="navigation",e.EVENT_ROUTE_CHANGE="route_change",e.EVENT_SESSION_EXTEND=fe,e.EVENT_SESSION_RESUME=de,e.EVENT_SESSION_START=ce,e.EVENT_VIEW_CHANGED=le,e.ErrorsInstrumentation=vt,e.FetchTransport=Vi,e.MAX_SESSION_PERSISTENCE_TIME=Me,e.MAX_SESSION_PERSISTENCE_TIME_BUFFER=6e4,e.PerformanceInstrumentation=Bi,e.PersistentSessionsManager=Fe,e.SESSION_EXPIRATION_TIME=Ne,e.SESSION_INACTIVITY_TIME=Ae,e.STORAGE_KEY=_e,e.SessionInstrumentation=$e,e.VERSION=te,e.ViewInstrumentation=ht,e.VolatileSessionsManager=ze,e.WebVitalsInstrumentation=Oi,e.allLogLevels=x,e.browserMeta=ve,e.buildStackFrame=ct,e.createInternalLogger=$,e.createPromiseBuffer=O,e.createSession=we,e.deepEqual=y,e.defaultEventDomain=Fi,e.defaultExceptionType=J,e.defaultGlobalObjectKey=ae,e.defaultInternalLoggerLevel=U,e.defaultLogLevel=k,e.defaultMetas=be,e.defaultViewMeta=ye,e.genShortID=P,e.getCurrentTimestamp=T,e.getDataFromSafariExtensions=dt,e.getInternalFaroFromGlobalObject=function(){return _[ne]},e.getStackFramesFromError=ft,e.getTransportBody=X,e.getWebInstrumentations=Ui,e.globalObject=_,e.initializeFaro=function(e){const t=$i(e);if(t)return se(t)},e.internalGlobalObjectKey=ne,e.isArray=l,e.isBoolean=e=>t(e,"boolean"),e.isDomError=v,e.isDomException=h,e.isElement=e=>b&&i(e,Element),e.isElementDefined=b,e.isError=m,e.isErrorDefined=p,e.isErrorEvent=g,e.isEvent=f,e.isEventDefined=d,e.isFunction=u,e.isInstanceOf=i,e.isInt=e=>s(e)&&Number.isInteger(e),e.isInternalFaroOnGlobalObject=re,e.isMap=e=>w&&i(e,Map),e.isMapDefined=w,e.isNull=r,e.isNumber=s,e.isObject=a,e.isPrimitive=c,e.isRegExp=e=>n(e,"RegExp"),e.isString=o,e.isSymbol=e=>t(e,"symbol"),e.isSyntheticEvent=e=>a(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e,e.isThenable=e=>u(null==e?void 0:e.then),e.isToString=n,e.isTypeof=t,e.isUndefined=e=>t(e,"undefined"),e.makeCoreConfig=$i,e.noop=L,e.pageMeta=he,e.parseStacktrace=pt,e.sdkMeta=()=>({sdk:{name:"@grafana/faro-core",version:te,integrations:e.faro.config.instrumentations.map((({name:e,version:t})=>({name:e,version:t})))}}),e.setInternalFaroOnGlobalObject=ie,e.transportItemTypeToBodyKey=M,e}({});
|
|
1
|
+
var GrafanaFaroWebSdk=function(e){"use strict";function t(e,t){return typeof e===t}function n(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function i(e,t){try{return e instanceof t}catch(e){return!1}}const r=e=>t(e,"null"),o=e=>t(e,"string"),s=e=>t(e,"number")&&!isNaN(e)||t(e,"bigint"),a=e=>!r(e)&&t(e,"object"),u=e=>t(e,"function"),l=e=>n(e,"Array"),c=e=>!a(e)&&!u(e),d="undefined"!=typeof Event,f=e=>d&&i(e,Event),p="undefined"!=typeof Error,m=e=>p&&i(e,Error),g=e=>n(e,"ErrorEvent"),v=e=>n(e,"DOMError"),h=e=>n(e,"DOMException"),b="undefined"!=typeof Element,w="undefined"!=typeof Map;function y(e,n){if(e===n)return!0;if(t(e,"number")&&isNaN(e))return t(n,"number")&&isNaN(n);const i=l(e),r=l(n);if(i!==r)return!1;if(i&&r){const t=e.length;if(t!==n.length)return!1;for(let i=t;0!=i--;)if(!y(e[i],n[i]))return!1;return!0}const o=a(e),s=a(n);if(o!==s)return!1;if(e&&n&&o&&s){const t=Object.keys(e),i=Object.keys(n);if(t.length!==i.length)return!1;for(let e of t)if(!i.includes(e))return!1;for(let i of t)if(!y(e[i],n[i]))return!1;return!0}return!1}function S(){return Date.now()}function T(){return(new Date).toISOString()}function E(e){return new Date(e).toISOString()}var I;e.LogLevel=void 0,(I=e.LogLevel||(e.LogLevel={})).TRACE="trace",I.DEBUG="debug",I.INFO="info",I.LOG="log",I.WARN="warn",I.ERROR="error";const k=e.LogLevel.LOG,x=[e.LogLevel.TRACE,e.LogLevel.DEBUG,e.LogLevel.INFO,e.LogLevel.LOG,e.LogLevel.WARN,e.LogLevel.ERROR];function L(){}function O(e){const{size:t,concurrency:n}=e,i=[];let r=0;const o=()=>{if(r<n&&i.length){const{producer:e,resolve:t,reject:n}=i.shift();r++,e().then((e=>{r--,o(),t(e)}),(e=>{r--,o(),n(e)}))}};return{add:e=>{if(i.length+r>=t)throw new Error("Task buffer full");return new Promise(((t,n)=>{i.push({producer:e,resolve:t,reject:n}),o()}))}}}const C="abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ0123456789";function P(e=10){return Array.from(Array(e)).map((()=>C[Math.floor(Math.random()*C.length)])).join("")}const _="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0;class N{constructor(e,t){var n,i;this.signalBuffer=[],this.itemLimit=null!==(n=null==t?void 0:t.itemLimit)&&void 0!==n?n:50,this.sendTimeout=null!==(i=null==t?void 0:t.sendTimeout)&&void 0!==i?i:250,this.paused=(null==t?void 0:t.paused)||!1,this.sendFn=e,this.flushInterval=-1,this.paused||this.start(),document.addEventListener("visibilitychange",(()=>{"hidden"===document.visibilityState&&this.flush()}))}addItem(e){this.paused||(this.signalBuffer.push(e),this.signalBuffer.length>=this.itemLimit&&this.flush())}start(){this.paused=!1,this.sendTimeout>0&&(this.flushInterval=window.setInterval((()=>this.flush()),this.sendTimeout))}pause(){this.paused=!0,clearInterval(this.flushInterval)}groupItems(e){const t=new Map;return e.forEach((e=>{const n=JSON.stringify(e.meta);let i=t.get(n);i=void 0===i?[e]:[...i,e],t.set(n,i)})),Array.from(t.values())}flush(){if(this.paused||0===this.signalBuffer.length)return;this.groupItems(this.signalBuffer).forEach(this.sendFn),this.signalBuffer=[]}}var A;e.TransportItemType=void 0,(A=e.TransportItemType||(e.TransportItemType={})).EXCEPTION="exception",A.LOG="log",A.MEASUREMENT="measurement",A.TRACE="trace",A.EVENT="event";const M={[e.TransportItemType.EXCEPTION]:"exceptions",[e.TransportItemType.LOG]:"logs",[e.TransportItemType.MEASUREMENT]:"measurements",[e.TransportItemType.TRACE]:"traces",[e.TransportItemType.EVENT]:"events"};function D(t){return n=>{if(n.type===e.TransportItemType.EXCEPTION&&n.payload){const e=n.payload,i=`${e.type}: ${e.value}`;if(function(e,t){return e.some((e=>o(e)?t.includes(e):!!t.match(e)))}(t,i))return null}return n}}function j(e,t,n,i){var r;t.debug("Initializing transports");const o=[];let s=n.paused,a=[];const u=e=>{let t=e;for(const e of a){const n=t.map(e).filter(Boolean);if(0===n.length)return[];t=n}return t},l=e=>{const n=u(e);if(0!==n.length)for(const e of o)t.debug(`Transporting item using ${e.name}\n`,n),e.isBatched()&&e.send(n)};let c;(null===(r=n.batching)||void 0===r?void 0:r.enabled)&&(c=new N(l,{sendTimeout:n.batching.sendTimeout,itemLimit:n.batching.itemLimit,paused:s}));return{add:(...r)=>{t.debug("Adding transports"),r.forEach((r=>{t.debug(`Adding "${r.name}" transport`);o.some((e=>e===r))?t.warn(`Transport ${r.name} is already added`):(r.unpatchedConsole=e,r.internalLogger=t,r.config=n,r.metas=i,o.push(r))}))},addBeforeSendHooks:(...e)=>{t.debug("Adding beforeSendHooks\n",a),e.forEach((e=>{e&&a.push(e)}))},addIgnoreErrorsPatterns:(...e)=>{t.debug("Adding ignoreErrorsPatterns\n",e),e.forEach((e=>{e&&a.push(D(e))}))},getBeforeSendHooks:()=>[...a],execute:e=>{var i;s||((null===(i=n.batching)||void 0===i?void 0:i.enabled)&&(null==c||c.addItem(e)),(e=>{var i,r;if((null===(i=n.batching)||void 0===i?void 0:i.enabled)&&o.every((e=>e.isBatched())))return;const[s]=u([e]);if(void 0!==s)for(const e of o)t.debug(`Transporting item using ${e.name}\n`,s),e.isBatched()?(null===(r=n.batching)||void 0===r?void 0:r.enabled)||e.send([s]):e.send(s)})(e))},isPaused:()=>s,pause:()=>{t.debug("Pausing transports"),null==c||c.pause(),s=!0},remove:(...e)=>{t.debug("Removing transports"),e.forEach((e=>{t.debug(`Removing "${e.name}" transport`);const n=o.indexOf(e);-1!==n?o.splice(n,1):t.warn(`Transport "${e.name}" is not added`)}))},removeBeforeSendHooks:(...e)=>{a.filter((t=>!e.includes(t)))},get transports(){return[...o]},unpause:()=>{t.debug("Unpausing transports"),null==c||c.start(),s=!1}}}var R;e.InternalLoggerLevel=void 0,(R=e.InternalLoggerLevel||(e.InternalLoggerLevel={}))[R.OFF=0]="OFF",R[R.ERROR=1]="ERROR",R[R.WARN=2]="WARN",R[R.INFO=3]="INFO",R[R.VERBOSE=4]="VERBOSE";const B={debug:L,error:L,info:L,prefix:"Faro",warn:L},U=e.InternalLoggerLevel.ERROR,F=Object.assign({},console);let z=F;function V(e){var t;return z=null!==(t=e.unpatchedConsole)&&void 0!==t?t:z,z}function $(t=F,n=U){const i=B;return n>e.InternalLoggerLevel.OFF&&(i.error=n>=e.InternalLoggerLevel.ERROR?function(...e){t.error(`${i.prefix}\n`,...e)}:L,i.warn=n>=e.InternalLoggerLevel.WARN?function(...e){t.warn(`${i.prefix}\n`,...e)}:L,i.info=n>=e.InternalLoggerLevel.INFO?function(...e){t.info(`${i.prefix}\n`,...e)}:L,i.debug=n>=e.InternalLoggerLevel.VERBOSE?function(...e){t.debug(`${i.prefix}\n`,...e)}:L),i}let q=B;function G(e,t){return q=$(e,t.internalLoggerLevel),q}class W{constructor(){this.unpatchedConsole=F,this.internalLogger=B,this.config={},this.metas={}}logDebug(...e){this.internalLogger.debug(`${this.name}\n`,...e)}logInfo(...e){this.internalLogger.info(`${this.name}\n`,...e)}logWarn(...e){this.internalLogger.warn(`${this.name}\n`,...e)}logError(...e){this.internalLogger.error(`${this.name}\n`,...e)}}class H extends W{isBatched(){return!1}getIgnoreUrls(){return[]}}function K(e,t){var n,i;if(void 0===t)return e;if(void 0===e)return{resourceSpans:t};const r=null===(n=e.resourceSpans)||void 0===n?void 0:n[0];if(void 0===r)return e;const o=(null==r?void 0:r.scopeSpans)||[],s=(null===(i=null==t?void 0:t[0])||void 0===i?void 0:i.scopeSpans)||[];return Object.assign(Object.assign({},e),{resourceSpans:[Object.assign(Object.assign({},r),{scopeSpans:[...o,...s]})]})}function X(t){let n={meta:{}};return void 0!==t[0]&&(n.meta=t[0].meta),t.forEach((t=>{switch(t.type){case e.TransportItemType.LOG:case e.TransportItemType.EVENT:case e.TransportItemType.EXCEPTION:case e.TransportItemType.MEASUREMENT:const i=M[t.type],r=n[i];n=Object.assign(Object.assign({},n),{[i]:void 0===r?[t.payload]:[...r,t.payload]});break;case e.TransportItemType.TRACE:n=Object.assign(Object.assign({},n),{traces:K(n.traces,t.payload.resourceSpans)})}})),n}const J="Error";let Z;const Y=e=>e.map((e=>{try{return String(e)}catch(e){return""}})).join(" ");function Q(t,n,i,o,s){n.debug("Initializing API");const a=function(t,n,i,r,o){let s;return n.debug("Initializing traces API"),{getOTEL:()=>s,getTraceContext:()=>{const e=null==s?void 0:s.trace.getSpanContext(s.context.active());return e?{trace_id:e.traceId,span_id:e.spanId}:void 0},initOTEL:(e,t)=>{n.debug("Initializing OpenTelemetry"),s={trace:e,context:t}},isOTELInitialized:()=>!!s,pushTraces:t=>{try{const i={type:e.TransportItemType.TRACE,payload:t,meta:r.value};n.debug("Pushing trace\n",i),o.execute(i)}catch(e){n.error("Error pushing trace\n",e)}}}}(0,n,0,o,s);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a),function(t,n,i,o,s,a){var u;n.debug("Initializing exceptions API");let l=null;Z=null!==(u=i.parseStacktrace)&&void 0!==u?u:Z;const c=e=>{n.debug("Changing stacktrace parser"),Z=null!=e?e:Z};return c(i.parseStacktrace),{changeStacktraceParser:c,getStacktraceParser:()=>Z,pushError:(t,{skipDedupe:u,stackFrames:c,type:d,context:f,spanContext:p,timestampOverwriteMs:m}={})=>{d=d||t.name||J;const g={meta:o.value,payload:{type:d,value:t.message,timestamp:m?E(m):T(),trace:p?{trace_id:p.traceId,span_id:p.spanId}:a.getTraceContext(),context:null!=f?f:{}},type:e.TransportItemType.EXCEPTION};(null==(c=null!=c?c:t.stack?null==Z?void 0:Z(t).frames:void 0)?void 0:c.length)&&(g.payload.stacktrace={frames:c});const v={type:g.payload.type,value:g.payload.value,stackTrace:g.payload.stacktrace,context:g.payload.context};u||!i.dedupe||r(l)||!y(v,l)?(l=v,n.debug("Pushing exception\n",g),s.execute(g)):n.debug("Skipping error push because it is the same as the last one\n",g.payload)}}}(0,n,i,o,s,a)),function(e,t,n,i){let r,o,s;t.debug("Initializing meta API");const a=e=>{o&&i.remove(o),o={user:e},i.add(o)},u=e=>{r&&i.remove(r),r={session:e},i.add(r)};return{setUser:a,resetUser:a,setSession:u,resetSession:u,getSession:()=>i.value.session,setView:e=>{var t;if((null===(t=null==s?void 0:s.view)||void 0===t?void 0:t.name)===(null==e?void 0:e.name))return;const n=s;s={view:e},i.add(s),n&&i.remove(n)},getView:()=>i.value.view}}(0,n,0,o)),function(t,n,i,o,s,a){var u;n.debug("Initializing logs API");let l=null;const c=null!==(u=i.logArgsSerializer)&&void 0!==u?u:Y;return{pushLog:(t,{context:u,level:d,skipDedupe:f,spanContext:p,timestampOverwriteMs:m}={})=>{try{const g={type:e.TransportItemType.LOG,payload:{message:c(t),level:null!=d?d:k,context:null!=u?u:{},timestamp:m?E(m):T(),trace:p?{trace_id:p.traceId,span_id:p.spanId}:a.getTraceContext()},meta:o.value},v={message:g.payload.message,level:g.payload.level,context:g.payload.context};if(!f&&i.dedupe&&!r(l)&&y(v,l))return void n.debug("Skipping log push because it is the same as the last one\n",g.payload);l=v,n.debug("Pushing log\n",g),s.execute(g)}catch(e){n.error("Error pushing log\n",e)}}}}(0,n,i,o,s,a)),function(t,n,i,o,s,a){n.debug("Initializing measurements API");let u=null;return{pushMeasurement:(t,{skipDedupe:l,context:c,spanContext:d,timestampOverwriteMs:f}={})=>{try{const p={type:e.TransportItemType.MEASUREMENT,payload:Object.assign(Object.assign({},t),{trace:d?{trace_id:d.traceId,span_id:d.spanId}:a.getTraceContext(),timestamp:f?E(f):T(),context:null!=c?c:{}}),meta:o.value},m={type:p.payload.type,values:p.payload.values,context:p.payload.context};if(!l&&i.dedupe&&!r(u)&&y(m,u))return void n.debug("Skipping measurement push because it is the same as the last one\n",p.payload);u=m,n.debug("Pushing measurement\n",p),s.execute(p)}catch(e){n.error("Error pushing measurement\n",e)}}}}(0,n,i,o,s,a)),function(t,n,i,o,s,a){let u=null;return{pushEvent:(t,l,c,{skipDedupe:d,spanContext:f,timestampOverwriteMs:p}={})=>{try{const m={meta:o.value,payload:{name:t,domain:null!=c?c:i.eventDomain,attributes:l,timestamp:p?E(p):T(),trace:f?{trace_id:f.traceId,span_id:f.spanId}:a.getTraceContext()},type:e.TransportItemType.EVENT},g={name:m.payload.name,attributes:m.payload.attributes,domain:m.payload.domain};if(!d&&i.dedupe&&!r(u)&&y(g,u))return void n.debug("Skipping event push because it is the same as the last one\n",m.payload);u=g,n.debug("Pushing event\n",m),s.execute(m)}catch(e){n.error("Error pushing event",e)}}}}(0,n,i,o,s,a))}class ee extends W{constructor(){super(...arguments),this.api={},this.transports={}}}const te="1.10.0";const ne="_faroInternal";function ie(e){e.config.isolate?e.internalLogger.debug("Skipping registering internal Faro instance on global object"):(e.internalLogger.debug("Registering internal Faro instance on global object"),Object.defineProperty(_,ne,{configurable:!1,enumerable:!1,writable:!1,value:e}))}function re(){return ne in _}function oe(t,n,i,r,o,s,a){return n.debug("Initializing Faro"),e.faro={api:s,config:i,instrumentations:a,internalLogger:n,metas:r,pause:o.pause,transports:o,unpatchedConsole:t,unpause:o.unpause},ie(e.faro),function(e){if(e.config.preventGlobalExposure)e.internalLogger.debug("Skipping registering public Faro instance in the global scope");else{if(e.internalLogger.debug(`Registering public faro reference in the global scope using "${e.config.globalObjectKey}" key`),e.config.globalObjectKey in _)return void e.internalLogger.warn(`Skipping global registration due to key "${e.config.globalObjectKey}" being used already. Please set "globalObjectKey" to something else or set "preventGlobalExposure" to "true"`);Object.defineProperty(_,e.config.globalObjectKey,{configurable:!1,writable:!1,value:e})}}(e.faro),e.faro}function se(e){const t=V(e),n=G(t,e);if(re()&&!e.isolate)return void n.error('Faro is already registered. Either add instrumentations, transports etc. to the global faro instance or use the "isolate" property');n.debug("Initializing");const i=function(e,t){let n=[],i=[];const r=()=>n.reduce(((e,t)=>Object.assign(e,u(t)?t():t)),{}),o=()=>{if(i.length){const e=r();i.forEach((t=>t(e)))}};return{add:(...e)=>{t.debug("Adding metas\n",e),n.push(...e),o()},remove:(...e)=>{t.debug("Removing metas\n",e),n=n.filter((t=>!e.includes(t))),o()},addListener:e=>{t.debug("Adding metas listener\n",e),i.push(e)},removeListener:e=>{t.debug("Removing metas listener\n",e),i=i.filter((t=>t!==e))},get value(){return r()}}}(0,n),r=j(t,n,e,i),o=Q(0,n,e,i,r),s=function(e,t,n,i,r,o){t.debug("Initializing instrumentations");const s=[];return{add:(...a)=>{t.debug("Adding instrumentations"),a.forEach((a=>{t.debug(`Adding "${a.name}" instrumentation`),s.some((e=>e.name===a.name))?t.warn(`Instrumentation ${a.name} is already added`):(a.unpatchedConsole=e,a.internalLogger=t,a.config=n,a.metas=i,a.transports=r,a.api=o,s.push(a),a.initialize())}))},get instrumentations(){return[...s]},remove:(...e)=>{t.debug("Removing instrumentations"),e.forEach((e=>{var n,i;t.debug(`Removing "${e.name}" instrumentation`);const r=s.reduce(((t,n,i)=>null===t&&n.name===e.name?i:null),null);r?(null===(i=(n=s[r]).destroy)||void 0===i||i.call(n),s.splice(r,1)):t.warn(`Instrumentation "${e.name}" is not added`)}))}}}(t,n,e,i,r,o),a=oe(t,n,e,i,r,o,s);return function(e){var t,n;const i={sdk:{version:te},app:{bundleId:e.config.app.name&&(r=e.config.app.name,null==_?void 0:_[`__faroBundleId_${r}`])}};var r;const o=null===(t=e.config.sessionTracking)||void 0===t?void 0:t.session;o&&e.api.setSession(o),e.config.app&&(i.app=Object.assign(Object.assign({},e.config.app),i.app)),e.config.user&&(i.user=e.config.user),e.config.view&&(i.view=e.config.view),e.metas.add(i,...null!==(n=e.config.metas)&&void 0!==n?n:[])}(a),function(e){e.transports.add(...e.config.transports),e.transports.addBeforeSendHooks(e.config.beforeSend),e.transports.addIgnoreErrorsPatterns(e.config.ignoreErrors)}(a),function(e){e.instrumentations.add(...e.config.instrumentations)}(a),a}e.faro={};const ae="faro",ue={enabled:!0,sendTimeout:250,itemLimit:50},le="view_changed",ce="session_start",de="session_resume",fe="session_extend",pe="unknown";var me="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ge={exports:{}};!function(e,t){!function(n,i){var r="function",o="undefined",s="object",a="string",u="major",l="model",c="name",d="type",f="vendor",p="version",m="architecture",g="console",v="mobile",h="tablet",b="smarttv",w="wearable",y="embedded",S="Amazon",T="Apple",E="ASUS",I="BlackBerry",k="Browser",x="Chrome",L="Firefox",O="Google",C="Huawei",P="LG",_="Microsoft",N="Motorola",A="Opera",M="Samsung",D="Sharp",j="Sony",R="Xiaomi",B="Zebra",U="Facebook",F="Chromium OS",z="Mac OS",V=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},$=function(e,t){return typeof e===a&&-1!==q(t).indexOf(q(e))},q=function(e){return e.toLowerCase()},G=function(e,t){if(typeof e===a)return e=e.replace(/^\s\s*/,""),typeof t===o?e:e.substring(0,350)},W=function(e,t){for(var n,o,a,u,l,c,d=0;d<t.length&&!l;){var f=t[d],p=t[d+1];for(n=o=0;n<f.length&&!l&&f[n];)if(l=f[n++].exec(e))for(a=0;a<p.length;a++)c=l[++o],typeof(u=p[a])===s&&u.length>0?2===u.length?typeof u[1]==r?this[u[0]]=u[1].call(this,c):this[u[0]]=u[1]:3===u.length?typeof u[1]!==r||u[1].exec&&u[1].test?this[u[0]]=c?c.replace(u[1],u[2]):i:this[u[0]]=c?u[1].call(this,c,u[2]):i:4===u.length&&(this[u[0]]=c?u[3].call(this,c.replace(u[1],u[2])):i):this[u]=c||i;d+=2}},H=function(e,t){for(var n in t)if(typeof t[n]===s&&t[n].length>0){for(var r=0;r<t[n].length;r++)if($(t[n][r],e))return"?"===n?i:n}else if($(t[n],e))return"?"===n?i:n;return e},K={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},X={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,p],[/opios[\/ ]+([\w\.]+)/i],[p,[c,A+" Mini"]],[/\bopr\/([\w\.]+)/i],[p,[c,A]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[c,p],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[c,"UC"+k]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[p,[c,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[p,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[c,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[p,[c,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure "+k],p],[/\bfocus\/([\w\.]+)/i],[p,[c,L+" Focus"]],[/\bopt\/([\w\.]+)/i],[p,[c,A+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[c,A+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[c,"MIUI "+k]],[/fxios\/([-\w\.]+)/i],[p,[c,L]],[/\bqihu|(qi?ho?o?|360)browser/i],[[c,"360 "+k]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1 "+k],p],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[c,p],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,U],p],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[c,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[c,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[p,[c,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[c,x+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,x+" WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[c,"Android "+k]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,p],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[p,[c,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[p,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[p,H,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[c,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[c,L+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[c,p],[/(cobalt)\/([\w\.]+)/i],[c,[p,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[m,"amd64"]],[/(ia32(?=;))/i],[[m,q]],[/((?:i[346]|x)86)[;\)]/i],[[m,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[m,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[m,"armhf"]],[/windows (ce|mobile); ppc;/i],[[m,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[m,/ower/,"",q]],[/(sun4\w)[;\)]/i],[[m,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[m,q]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[f,M],[d,h]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[f,M],[d,v]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[l,[f,T],[d,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[f,T],[d,h]],[/(macintosh);/i],[l,[f,T]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[f,D],[d,v]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[f,C],[d,h]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[f,C],[d,v]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[l,/_/g," "],[f,R],[d,v]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[f,R],[d,h]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[f,"OPPO"],[d,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[f,"Vivo"],[d,v]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[f,"Realme"],[d,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[f,N],[d,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[f,N],[d,h]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[f,P],[d,h]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[f,P],[d,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[f,"Lenovo"],[d,h]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[f,"Nokia"],[d,v]],[/(pixel c)\b/i],[l,[f,O],[d,h]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[f,O],[d,v]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[f,j],[d,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[f,j],[d,h]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[f,"OnePlus"],[d,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[f,S],[d,h]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[f,S],[d,v]],[/(playbook);[-\w\),; ]+(rim)/i],[l,f,[d,h]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[f,I],[d,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[f,E],[d,h]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[f,E],[d,v]],[/(nexus 9)/i],[l,[f,"HTC"],[d,h]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[f,[l,/_/g," "],[d,v]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[f,"Acer"],[d,h]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[f,"Meizu"],[d,v]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[f,l,[d,v]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[f,l,[d,h]],[/(surface duo)/i],[l,[f,_],[d,h]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[f,"Fairphone"],[d,v]],[/(u304aa)/i],[l,[f,"AT&T"],[d,v]],[/\bsie-(\w*)/i],[l,[f,"Siemens"],[d,v]],[/\b(rct\w+) b/i],[l,[f,"RCA"],[d,h]],[/\b(venue[\d ]{2,7}) b/i],[l,[f,"Dell"],[d,h]],[/\b(q(?:mv|ta)\w+) b/i],[l,[f,"Verizon"],[d,h]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[f,"Barnes & Noble"],[d,h]],[/\b(tm\d{3}\w+) b/i],[l,[f,"NuVision"],[d,h]],[/\b(k88) b/i],[l,[f,"ZTE"],[d,h]],[/\b(nx\d{3}j) b/i],[l,[f,"ZTE"],[d,v]],[/\b(gen\d{3}) b.+49h/i],[l,[f,"Swiss"],[d,v]],[/\b(zur\d{3}) b/i],[l,[f,"Swiss"],[d,h]],[/\b((zeki)?tb.*\b) b/i],[l,[f,"Zeki"],[d,h]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[f,"Dragon Touch"],l,[d,h]],[/\b(ns-?\w{0,9}) b/i],[l,[f,"Insignia"],[d,h]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[f,"NextBook"],[d,h]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[f,"Voice"],l,[d,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[f,"LvTel"],l,[d,v]],[/\b(ph-1) /i],[l,[f,"Essential"],[d,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[f,"Envizen"],[d,h]],[/\b(trio[-\w\. ]+) b/i],[l,[f,"MachSpeed"],[d,h]],[/\btu_(1491) b/i],[l,[f,"Rotor"],[d,h]],[/(shield[\w ]+) b/i],[l,[f,"Nvidia"],[d,h]],[/(sprint) (\w+)/i],[f,l,[d,v]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[f,_],[d,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[f,B],[d,h]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[f,B],[d,v]],[/smart-tv.+(samsung)/i],[f,[d,b]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[f,M],[d,b]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[f,P],[d,b]],[/(apple) ?tv/i],[f,[l,T+" TV"],[d,b]],[/crkey/i],[[l,x+"cast"],[f,O],[d,b]],[/droid.+aft(\w+)( bui|\))/i],[l,[f,S],[d,b]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[f,D],[d,b]],[/(bravia[\w ]+)( bui|\))/i],[l,[f,j],[d,b]],[/(mitv-\w{5}) bui/i],[l,[f,R],[d,b]],[/Hbbtv.*(technisat) (.*);/i],[f,l,[d,b]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[f,G],[l,G],[d,b]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,b]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[f,l,[d,g]],[/droid.+; (shield) bui/i],[l,[f,"Nvidia"],[d,g]],[/(playstation [345portablevi]+)/i],[l,[f,j],[d,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[f,_],[d,g]],[/((pebble))app/i],[f,l,[d,w]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[l,[f,T],[d,w]],[/droid.+; (glass) \d/i],[l,[f,O],[d,w]],[/droid.+; (wt63?0{2,3})\)/i],[l,[f,B],[d,w]],[/(quest( 2| pro)?)/i],[l,[f,U],[d,w]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[f,[d,y]],[/(aeobc)\b/i],[l,[f,S],[d,y]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[l,[d,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[d,h]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,h]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,v]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[f,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[c,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,p],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[c,[p,H,K]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,"Windows"],[p,H,K]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,z],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[p,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[c,p],[/\(bb(10);/i],[p,[c,I]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[c,L+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[c,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[p,[c,"watchOS"]],[/crkey\/([\d\.]+)/i],[p,[c,x+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[c,F],p],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[c,p],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[c,p]]},J=function(e,t){if(typeof e===s&&(t=e,e=i),!(this instanceof J))return new J(e,t).getResult();var g=typeof n!==o&&n.navigator?n.navigator:i,b=e||(g&&g.userAgent?g.userAgent:""),w=g&&g.userAgentData?g.userAgentData:i,y=t?function(e,t){var n={};for(var i in e)t[i]&&t[i].length%2==0?n[i]=t[i].concat(e[i]):n[i]=e[i];return n}(X,t):X,S=g&&g.userAgent==b;return this.getBrowser=function(){var e,t={};return t[c]=i,t[p]=i,W.call(t,b,y.browser),t[u]=typeof(e=t[p])===a?e.replace(/[^\d\.]/g,"").split(".")[0]:i,S&&g&&g.brave&&typeof g.brave.isBrave==r&&(t[c]="Brave"),t},this.getCPU=function(){var e={};return e[m]=i,W.call(e,b,y.cpu),e},this.getDevice=function(){var e={};return e[f]=i,e[l]=i,e[d]=i,W.call(e,b,y.device),S&&!e[d]&&w&&w.mobile&&(e[d]=v),S&&"Macintosh"==e[l]&&g&&typeof g.standalone!==o&&g.maxTouchPoints&&g.maxTouchPoints>2&&(e[l]="iPad",e[d]=h),e},this.getEngine=function(){var e={};return e[c]=i,e[p]=i,W.call(e,b,y.engine),e},this.getOS=function(){var e={};return e[c]=i,e[p]=i,W.call(e,b,y.os),S&&!e[c]&&w&&"Unknown"!=w.platform&&(e[c]=w.platform.replace(/chrome os/i,F).replace(/macos/i,z)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return b},this.setUA=function(e){return b=typeof e===a&&e.length>350?G(e,350):e,this},this.setUA(b),this};J.VERSION="1.0.36",J.BROWSER=V([c,p,u]),J.CPU=V([m]),J.DEVICE=V([l,f,d,g,v,b,h,w,y]),J.ENGINE=J.OS=V([c,p]),e.exports&&(t=e.exports=J),t.UAParser=J;var Z=typeof n!==o&&(n.jQuery||n.Zepto);if(Z&&!Z.ua){var Y=new J;Z.ua=Y.getResult(),Z.ua.get=function(){return Y.getUA()},Z.ua.set=function(e){Y.setUA(e);var t=Y.getResult();for(var n in t)Z.ua[n]=t[n]}}}("object"==typeof window?window:me)}(ge,ge.exports);var ve=ge.exports;const he=()=>{const e=new ve.UAParser,{name:t,version:n}=e.getBrowser(),{name:i,version:r}=e.getOS(),o=e.getUA(),s=navigator.language,a=navigator.userAgent.includes("Mobi"),u=function(){if(!t||!n)return;if("userAgentData"in navigator&&navigator.userAgentData)return navigator.userAgentData.brands;return}();return{browser:{name:null!=t?t:pe,version:null!=n?n:pe,os:`${null!=i?i:pe} ${null!=r?r:pe}`,userAgent:null!=o?o:pe,language:null!=s?s:pe,mobile:a,brands:null!=u?u:pe,viewportWidth:`${window.innerWidth}`,viewportHeight:`${window.innerHeight}`}}},be=()=>({page:{url:location.href}}),we=[he,be];function ye(t){var n,i,r,o;return{id:null!==(o=null===(r=null===(i=null===(n=e.faro.config)||void 0===n?void 0:n.sessionTracking)||void 0===i?void 0:i.generateSessionId)||void 0===r?void 0:r.call(i))&&void 0!==o?o:P(),attributes:t}}const Se={session:"sessionStorage",local:"localStorage"};function Te(t){var n;try{let e;e=window[t];const n="__faro_storage_test__";return e.setItem(n,n),e.removeItem(n),!0}catch(i){return null===(n=e.faro.internalLogger)||void 0===n||n.info(`Web storage of type ${t} is not available. Reason: ${i}`),!1}}function Ee(e,t){return Oe(t)?window[t].getItem(e):null}function Ie(e,t,n){if(Oe(n))try{window[n].setItem(e,t)}catch(e){}}function ke(e,t){Oe(t)&&window[t].removeItem(e)}const xe=Te(Se.local),Le=Te(Se.session);function Oe(e){return e===Se.local?xe:e===Se.session&&Le}function Ce(e,t){let n,i=!1;const r=()=>{null!=n?(e(...n),n=null,setTimeout(r,t)):i=!1};return(...o)=>{i?n=o:(e(...o),i=!0,setTimeout(r,t))}}function Pe(){var t,n,i;const r=e.faro.config.sessionTracking;let o=null!==(i=null!==(n=null===(t=null==r?void 0:r.sampler)||void 0===t?void 0:t.call(r,{metas:e.faro.metas.value}))&&void 0!==n?n:null==r?void 0:r.samplingRate)&&void 0!==i?i:1;if("number"!=typeof o){o=0}return Math.random()<o}const _e="com.grafana.faro.session",Ne=144e5,Ae=9e5,Me=Ae,De={enabled:!0,persistent:!1,maxSessionPersistenceTime:Me};function je({sessionId:t,started:n,lastActivity:i,isSampled:r=!0}={}){var o,s;const a=S(),u=null===(s=null===(o=e.faro.config)||void 0===o?void 0:o.sessionTracking)||void 0===s?void 0:s.generateSessionId;return null==t&&(t="function"==typeof u?u():P()),{sessionId:t,lastActivity:null!=i?i:a,started:null!=n?n:a,isSampled:r}}function Re(e){if(null==e)return!1;const t=S();if(!(t-e.started<Ne))return!1;return t-e.lastActivity<Ae}function Be({fetchUserSession:t,storeUserSession:n}){return function({forceSessionExtend:i}={forceSessionExtend:!1}){var r,o,s;if(!t||!n)return;const a=e.faro.config.sessionTracking,u=null==a?void 0:a.persistent;if(u&&!xe||!u&&!Le)return;const l=t();if(!1===i&&Re(l))n(Object.assign(Object.assign({},l),{lastActivity:S()}));else{let t=Ue(je({isSampled:Pe()}),l);n(t),null===(r=e.faro.api)||void 0===r||r.setSession(t.sessionMeta),null===(o=null==a?void 0:a.onSessionChange)||void 0===o||o.call(a,null!==(s=null==l?void 0:l.sessionMeta)&&void 0!==s?s:null,t.sessionMeta)}}}function Ue(t,n){var i,r,o,s;return Object.assign(Object.assign({},t),{sessionMeta:{id:t.sessionId,attributes:Object.assign(Object.assign(Object.assign(Object.assign({},null===(r=null===(i=e.faro.config.sessionTracking)||void 0===i?void 0:i.session)||void 0===r?void 0:r.attributes),null!==(s=null===(o=e.faro.metas.value.session)||void 0===o?void 0:o.attributes)&&void 0!==s?s:{}),null!=n?{previousSession:n.sessionId}:{}),{isSampled:t.isSampled.toString()})}})}class Fe{constructor(){this.updateSession=Ce((()=>this.updateUserSession()),1e3),this.updateUserSession=Be({fetchUserSession:Fe.fetchUserSession,storeUserSession:Fe.storeUserSession}),this.init()}static removeUserSession(){ke(_e,Fe.storageTypeLocal)}static storeUserSession(e){Ie(_e,JSON.stringify(e),Fe.storageTypeLocal)}static fetchUserSession(){const e=Ee(_e,Fe.storageTypeLocal);return e?JSON.parse(e):null}init(){document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&this.updateSession()})),e.faro.metas.addListener((function(t){const n=t.session,i=Fe.fetchUserSession();if(n&&n.id!==(null==i?void 0:i.sessionId)){const t=Ue(je({sessionId:n.id,isSampled:Pe()}),i);Fe.storeUserSession(t),e.faro.api.setSession(t.sessionMeta)}}))}}Fe.storageTypeLocal=Se.local;class ze{constructor(){this.updateSession=Ce((()=>this.updateUserSession()),1e3),this.updateUserSession=Be({fetchUserSession:ze.fetchUserSession,storeUserSession:ze.storeUserSession}),this.init()}static removeUserSession(){ke(_e,ze.storageTypeSession)}static storeUserSession(e){Ie(_e,JSON.stringify(e),ze.storageTypeSession)}static fetchUserSession(){const e=Ee(_e,ze.storageTypeSession);return e?JSON.parse(e):null}init(){document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&this.updateSession()})),e.faro.metas.addListener((function(t){const n=t.session,i=ze.fetchUserSession();if(n&&n.id!==(null==i?void 0:i.sessionId)){const t=Ue(je({sessionId:n.id,isSampled:Pe()}),i);ze.storeUserSession(t),e.faro.api.setSession(t.sessionMeta)}}))}}function Ve(e){return(null==e?void 0:e.persistent)?Fe:ze}ze.storageTypeSession=Se.session;class $e extends ee{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-session",this.version=te}sendSessionStartEvent(e){var t,n;const i=e.session;if(i&&i.id!==(null===(t=this.notifiedSession)||void 0===t?void 0:t.id)){if(this.notifiedSession&&this.notifiedSession.id===(null===(n=i.attributes)||void 0===n?void 0:n.previousSession))return this.api.pushEvent(fe,{},void 0,{skipDedupe:!0}),void(this.notifiedSession=i);this.notifiedSession=i,this.api.pushEvent(ce,{},void 0,{skipDedupe:!0})}}createInitialSession(e,t){var n,i,r,o,s;let a,u,l=e.fetchUserSession();if(t.persistent&&t.maxSessionPersistenceTime&&l){const e=S();l.lastActivity<e-t.maxSessionPersistenceTime&&(Fe.removeUserSession(),l=null)}if(Re(l)){const e=null==l?void 0:l.sessionId;u=je({sessionId:e,isSampled:l.isSampled||!1,started:null==l?void 0:l.started}),u.sessionMeta={id:e,attributes:Object.assign(Object.assign(Object.assign({},null===(n=t.session)||void 0===n?void 0:n.attributes),null===(i=null==l?void 0:l.sessionMeta)||void 0===i?void 0:i.attributes),{isSampled:u.isSampled.toString()})},a=de}else{const e=null!==(o=null===(r=t.session)||void 0===r?void 0:r.id)&&void 0!==o?o:ye().id;u=je({sessionId:e,isSampled:Pe()}),u.sessionMeta={id:e,attributes:Object.assign({isSampled:u.isSampled.toString()},null===(s=t.session)||void 0===s?void 0:s.attributes)},a=ce}return{initialSession:u,lifecycleType:a}}registerBeforeSendHook(e){var t;const{updateSession:n}=new e;null===(t=this.transports)||void 0===t||t.addBeforeSendHooks((e=>{var t,i,r;n();const o=null===(t=e.meta.session)||void 0===t?void 0:t.attributes;if(o&&"true"===(null==o?void 0:o.isSampled)){let t=JSON.parse(JSON.stringify(e));const n=null===(i=t.meta.session)||void 0===i?void 0:i.attributes;return null==n||delete n.isSampled,0===Object.keys(null!=n?n:{}).length&&(null===(r=t.meta.session)||void 0===r||delete r.attributes),t}return null}))}initialize(){this.logDebug("init session instrumentation");const e=this.config.sessionTracking;if(null==e?void 0:e.enabled){const t=Ve(e);this.registerBeforeSendHook(t);const{initialSession:n,lifecycleType:i}=this.createInitialSession(t,e);t.storeUserSession(n);const r=n.sessionMeta;this.notifiedSession=r,this.api.setSession(r),i===ce&&this.api.pushEvent(ce,{},void 0,{skipDedupe:!0}),i===de&&this.api.pushEvent(de,{},void 0,{skipDedupe:!0})}this.metas.addListener(this.sendSessionStartEvent.bind(this))}}class qe extends ee{constructor(e={}){super(),this.options=e,this.name="@grafana/faro-web-sdk:instrumentation-console",this.version=te}initialize(){this.logDebug("Initializing\n",this.options),x.filter((e=>{var t;return!(null!==(t=this.options.disabledLevels)&&void 0!==t?t:qe.defaultDisabledLevels).includes(e)})).forEach((e=>{console[e]=(...t)=>{try{this.api.pushLog(t,{level:e})}catch(e){this.logError(e)}finally{this.unpatchedConsole[e](...t)}}}))}}qe.defaultDisabledLevels=[e.LogLevel.DEBUG,e.LogLevel.TRACE,e.LogLevel.LOG];const Ge="DOMError",We="DOMException",He="Non-Error exception captured with keys:",Ke=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Xe="\n",Je="eval",Ze="?",Ye="@",Qe=/^\s*at (?:(.*\).*?|.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,et=/\((\S*)(?::(\d+))(?::(\d+))\)/,tt="eval",nt="address at ",it=nt.length,rt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|safari-extension|safari-web-extension|capacitor)?:\/.*?|\[native code]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ot=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,st=" > eval",at="safari-extension",ut="safari-web-extension",lt=/Minified React error #\d+;/i;function ct(e,t,n,i){const r={filename:e||document.location.href,function:t||Ze};return void 0!==n&&(r.lineno=n),void 0!==i&&(r.colno=i),r}function dt(e,t){const n=null==e?void 0:e.includes(at),i=!n&&(null==e?void 0:e.includes(ut));return n||i?[(null==e?void 0:e.includes(Ye))?e.split(Ye)[0]:e,n?`${at}:${t}`:`${ut}:${t}`]:[e,t]}function ft(e){let t=[];e.stacktrace?t=e.stacktrace.split(Xe).filter(((e,t)=>t%2==0)):e.stack&&(t=e.stack.split(Xe));const n=t.reduce(((t,n,i)=>{let r,o,a,u,l;if(r=Qe.exec(n)){if(o=r[1],a=r[2],u=r[3],l=r[4],null==a?void 0:a.startsWith(tt)){const e=et.exec(a);e&&(a=e[1],u=e[2],l=e[3])}a=(null==a?void 0:a.startsWith(nt))?a.substring(it):a,[o,a]=dt(o,a)}else if(r=rt.exec(n)){if(o=r[1],a=r[3],u=r[4],l=r[5],a&&a.includes(st)){const e=ot.exec(a);e&&(o=o||Je,a=e[1],u=e[2])}else 0===i&&!l&&s(e.columnNumber)&&(l=String(e.columnNumber+1));[o,a]=dt(o,a)}return(a||o)&&t.push(ct(a,o,u?Number(u):void 0,l?Number(l):void 0)),t}),[]);return lt.test(e.message)?n.slice(1):n}function pt(e){return{frames:ft(e)}}function mt(e){let t,n,i,r,o=[];if(g(e)&&e.error)t=e.error.message,n=e.error.name,o=ft(e.error);else if((i=v(e))||h(e)){const{name:r,message:o}=e;n=null!=r?r:i?Ge:We,t=o?`${n}: ${o}`:n}else m(e)?(t=e.message,o=ft(e)):(a(e)||(r=f(e)))&&(n=r?e.constructor.name:void 0,t=`${He} ${Object.keys(e)}`);return[t,n,o]}function gt(e){const t=window.onerror;window.onerror=(...n)=>{try{const[t,i,r,s,a]=n;let u,l,c=[];const d=o(t),f=ct(i,"?",r,s);a||!d?([u,l,c]=mt(null!=a?a:t),0===c.length&&(c=[f])):d&&([u,l]=function(e){var t,n;const i=e.match(Ke),r=null!==(t=null==i?void 0:i[1])&&void 0!==t?t:J;return[null!==(n=null==i?void 0:i[2])&&void 0!==n?n:e,r]}(t),c=[f]),u&&e.pushError(new Error(u),{type:l,stackFrames:c})}finally{null==t||t.apply(window,n)}}}class vt extends ee{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-errors",this.version=te}initialize(){var e;this.logDebug("Initializing"),gt(this.api),e=this.api,window.addEventListener("unhandledrejection",(t=>{var n,i;let r,o,s=t;s.reason?s=t.reason:(null===(n=t.detail)||void 0===n?void 0:n.reason)&&(s=null===(i=t.detail)||void 0===i?void 0:i.reason);let a=[];c(s)?(r=`Non-Error promise rejection captured with value: ${String(s)}`,o="UnhandledRejection"):[r,o,a]=mt(s),r&&e.pushError(new Error(r),{type:o,stackFrames:a})}))}}class ht extends ee{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-view",this.version=te}sendViewChangedEvent(e){var t,n,i,r;const o=e.view;o&&o.name!==(null===(t=this.notifiedView)||void 0===t?void 0:t.name)&&(this.api.pushEvent(le,{fromView:null!==(i=null===(n=this.notifiedView)||void 0===n?void 0:n.name)&&void 0!==i?i:pe,toView:null!==(r=o.name)&&void 0!==r?r:pe},void 0,{skipDedupe:!0}),this.notifiedView=o)}initialize(){this.metas.addListener(this.sendViewChangedEvent.bind(this))}}var bt,wt,yt,St,Tt,Et=-1,It=function(e){addEventListener("pageshow",(function(t){t.persisted&&(Et=t.timeStamp,e(t))}),!0)},kt=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},xt=function(){var e=kt();return e&&e.activationStart||0},Lt=function(e,t){var n=kt(),i="navigate";return Et>=0?i="back-forward-cache":n&&(document.prerendering||xt()>0?i="prerender":document.wasDiscarded?i="restore":n.type&&(i=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},Ot=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return i.observe(Object.assign({type:e,buffered:!0},n||{})),i}}catch(e){}},Ct=function(e,t,n,i){var r,o;return function(s){t.value>=0&&(s||i)&&((o=t.value-(r||0))||void 0===r)&&(r=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},Pt=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},_t=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Nt=function(e){var t=!1;return function(){t||(e(),t=!0)}},At=-1,Mt=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Dt=function(e){"hidden"===document.visibilityState&&At>-1&&(At="visibilitychange"===e.type?e.timeStamp:0,Rt())},jt=function(){addEventListener("visibilitychange",Dt,!0),addEventListener("prerenderingchange",Dt,!0)},Rt=function(){removeEventListener("visibilitychange",Dt,!0),removeEventListener("prerenderingchange",Dt,!0)},Bt=function(){return At<0&&(At=Mt(),jt(),It((function(){setTimeout((function(){At=Mt(),jt()}),0)}))),{get firstHiddenTime(){return At}}},Ut=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},Ft=[1800,3e3],zt=function(e,t){t=t||{},Ut((function(){var n,i=Bt(),r=Lt("FCP"),o=Ot("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-xt(),0),r.entries.push(e),n(!0)))}))}));o&&(n=Ct(e,r,Ft,t.reportAllChanges),It((function(i){r=Lt("FCP"),n=Ct(e,r,Ft,t.reportAllChanges),Pt((function(){r.value=performance.now()-i.timeStamp,n(!0)}))})))}))},Vt=[.1,.25],$t=0,qt=1/0,Gt=0,Wt=function(e){e.forEach((function(e){e.interactionId&&(qt=Math.min(qt,e.interactionId),Gt=Math.max(Gt,e.interactionId),$t=Gt?(Gt-qt)/7+1:0)}))},Ht=[],Kt=new Map,Xt=0,Jt=[],Zt=function(e){if(Jt.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=Ht[Ht.length-1],n=Kt.get(e.interactionId);if(n||Ht.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var i={id:e.interactionId,latency:e.duration,entries:[e]};Kt.set(i.id,i),Ht.push(i)}Ht.sort((function(e,t){return t.latency-e.latency})),Ht.length>10&&Ht.splice(10).forEach((function(e){return Kt.delete(e.id)}))}}},Yt=[200,500],Qt=[2500,4e3],en={},tn=[800,1800],nn=function e(t){document.prerendering?Ut((function(){return e(t)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},rn={passive:!0,capture:!0},on=new Date,sn=function(e,t){wt||(wt=t,yt=e,St=new Date,ln(removeEventListener),an())},an=function(){if(yt>=0&&yt<St-on){var e={entryType:"first-input",name:wt.type,target:wt.target,cancelable:wt.cancelable,startTime:wt.timeStamp,processingStart:wt.timeStamp+yt};Tt.forEach((function(t){t(e)})),Tt=[]}},un=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){sn(e,t),r()},i=function(){r()},r=function(){removeEventListener("pointerup",n,rn),removeEventListener("pointercancel",i,rn)};addEventListener("pointerup",n,rn),addEventListener("pointercancel",i,rn)}(t,e):sn(t,e)}},ln=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,un,rn)}))},cn=[100,300];class dn{constructor(e){this.pushMeasurement=e}initialize(){Object.entries(dn.mapping).forEach((([e,t])=>{t((t=>{this.pushMeasurement({type:"web-vitals",values:{[e]:t.value}})}))}))}}dn.mapping={cls:function(e,t){t=t||{},zt(Nt((function(){var n,i=Lt("CLS",0),r=0,o=[],s=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=o[0],n=o[o.length-1];r&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(r+=e.value,o.push(e)):(r=e.value,o=[e])}})),r>i.value&&(i.value=r,i.entries=o,n())},a=Ot("layout-shift",s);a&&(n=Ct(e,i,Vt,t.reportAllChanges),_t((function(){s(a.takeRecords()),n(!0)})),It((function(){r=0,i=Lt("CLS",0),n=Ct(e,i,Vt,t.reportAllChanges),Pt((function(){return n()}))})),setTimeout(n,0))})))},fcp:zt,fid:function(e,t){t=t||{},Ut((function(){var n,i=Bt(),r=Lt("FID"),o=function(e){e.startTime<i.firstHiddenTime&&(r.value=e.processingStart-e.startTime,r.entries.push(e),n(!0))},s=function(e){e.forEach(o)},a=Ot("first-input",s);n=Ct(e,r,cn,t.reportAllChanges),a&&(_t(Nt((function(){s(a.takeRecords()),a.disconnect()}))),It((function(){var i;r=Lt("FID"),n=Ct(e,r,cn,t.reportAllChanges),Tt=[],yt=-1,wt=null,ln(addEventListener),i=o,Tt.push(i),an()})))}))},inp:function(e,t){t=t||{},Ut((function(){var n;"interactionCount"in performance||bt||(bt=Ot("event",Wt,{type:"event",buffered:!0,durationThreshold:0}));var i,r=Lt("INP"),o=function(e){e.forEach(Zt);var t,n=(t=Math.min(Ht.length-1,Math.floor(((bt?$t:performance.interactionCount||0)-Xt)/50)),Ht[t]);n&&n.latency!==r.value&&(r.value=n.latency,r.entries=n.entries,i())},s=Ot("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});i=Ct(e,r,Yt,t.reportAllChanges),s&&("PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&s.observe({type:"first-input",buffered:!0}),_t((function(){o(s.takeRecords()),i(!0)})),It((function(){Xt=0,Ht.length=0,Kt.clear(),r=Lt("INP"),i=Ct(e,r,Yt,t.reportAllChanges)})))}))},lcp:function(e,t){t=t||{},Ut((function(){var n,i=Bt(),r=Lt("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-xt(),0),r.entries=[e],n())}))},s=Ot("largest-contentful-paint",o);if(s){n=Ct(e,r,Qt,t.reportAllChanges);var a=Nt((function(){en[r.id]||(o(s.takeRecords()),s.disconnect(),en[r.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return e=a,t=self.requestIdleCallback||self.setTimeout,n=-1,e=Nt(e),"hidden"===document.visibilityState?e():(n=t(e),_t(e)),n;var e,t,n}),!0)})),_t(a),It((function(i){r=Lt("LCP"),n=Ct(e,r,Qt,t.reportAllChanges),Pt((function(){r.value=performance.now()-i.timeStamp,en[r.id]=!0,n(!0)}))}))}}))},ttfb:function(e,t){t=t||{};var n=Lt("TTFB"),i=Ct(e,n,tn,t.reportAllChanges);nn((function(){var r=kt();r&&(n.value=Math.max(r.responseStart-xt(),0),n.entries=[r],i(!0),It((function(){n=Lt("TTFB",0),(i=Ct(e,n,tn,t.reportAllChanges))(!0)})))}))}};var fn,pn,mn=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},gn=function(e){if("loading"===document.readyState)return"loading";var t=mn();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},vn=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},hn=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var i=e,r=i.id?"#"+i.id:vn(i)+(i.classList&&i.classList.value&&i.classList.value.trim()&&i.classList.value.trim().length?"."+i.classList.value.trim().replace(/\s+/g,"."):"");if(n.length+r.length>(t||100)-1)return n||r;if(n=n?r+">"+n:r,i.id)break;e=i.parentNode}}catch(e){}return n},bn=-1,wn=function(){return bn},yn=function(e){addEventListener("pageshow",(function(t){t.persisted&&(bn=t.timeStamp,e(t))}),!0)},Sn=function(){var e=mn();return e&&e.activationStart||0},Tn=function(e,t){var n=mn(),i="navigate";return wn()>=0?i="back-forward-cache":n&&(document.prerendering||Sn()>0?i="prerender":document.wasDiscarded?i="restore":n.type&&(i=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},En=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return i.observe(Object.assign({type:e,buffered:!0},n||{})),i}}catch(e){}},In=function(e,t,n,i){var r,o;return function(s){t.value>=0&&(s||i)&&((o=t.value-(r||0))||void 0===r)&&(r=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},kn=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},xn=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Ln=function(e){var t=!1;return function(){t||(e(),t=!0)}},On=-1,Cn=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Pn=function(e){"hidden"===document.visibilityState&&On>-1&&(On="visibilitychange"===e.type?e.timeStamp:0,Nn())},_n=function(){addEventListener("visibilitychange",Pn,!0),addEventListener("prerenderingchange",Pn,!0)},Nn=function(){removeEventListener("visibilitychange",Pn,!0),removeEventListener("prerenderingchange",Pn,!0)},An=function(){return On<0&&(On=Cn(),_n(),yn((function(){setTimeout((function(){On=Cn(),_n()}),0)}))),{get firstHiddenTime(){return On}}},Mn=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},Dn=[1800,3e3],jn=function(e,t){t=t||{},Mn((function(){var n,i=An(),r=Tn("FCP"),o=En("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-Sn(),0),r.entries.push(e),n(!0)))}))}));o&&(n=In(e,r,Dn,t.reportAllChanges),yn((function(i){r=Tn("FCP"),n=In(e,r,Dn,t.reportAllChanges),kn((function(){r.value=performance.now()-i.timeStamp,n(!0)}))})))}))},Rn=[.1,.25],Bn=0,Un=1/0,Fn=0,zn=function(e){e.forEach((function(e){e.interactionId&&(Un=Math.min(Un,e.interactionId),Fn=Math.max(Fn,e.interactionId),Bn=Fn?(Fn-Un)/7+1:0)}))},Vn=function(){"interactionCount"in performance||fn||(fn=En("event",zn,{type:"event",buffered:!0,durationThreshold:0}))},$n=[],qn=new Map,Gn=0,Wn=function(){return(fn?Bn:performance.interactionCount||0)-Gn},Hn=[],Kn=function(e){if(Hn.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=$n[$n.length-1],n=qn.get(e.interactionId);if(n||$n.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var i={id:e.interactionId,latency:e.duration,entries:[e]};qn.set(i.id,i),$n.push(i)}$n.sort((function(e,t){return t.latency-e.latency})),$n.length>10&&$n.splice(10).forEach((function(e){return qn.delete(e.id)}))}}},Xn=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=Ln(e),"hidden"===document.visibilityState?e():(n=t(e),xn(e)),n},Jn=[200,500],Zn=[],Yn=new Map,Qn=[],ei=new WeakMap,ti=new Map,ni=-1,ii=function(e){e.forEach((function(e){return Zn.push(e)}))},ri=function(){ti.size>10&&ti.forEach((function(e,t){qn.has(t)||ti.delete(t)})),Qn=Qn.slice(-50);var e=new Set(Qn.concat($n.map((function(e){return ei.get(e.entries[0])}))));Yn.forEach((function(t,n){e.has(n)||Yn.delete(n)}));var t=new Set;Yn.forEach((function(e){li(e.startTime,e.processingEnd).forEach((function(e){t.add(e)}))})),Zn=Array.from(t),ni=-1};Hn.push((function(e){e.interactionId&&e.target&&!ti.has(e.interactionId)&&ti.set(e.interactionId,e.target)}),(function(e){for(var t,n=e.startTime+e.duration,i=Qn.length-1;i>=0;i--)if(t=Qn[i],Math.abs(n-t)<=8){var r=Yn.get(t);r.startTime=Math.min(e.startTime,r.startTime),r.processingStart=Math.min(e.processingStart,r.processingStart),r.processingEnd=Math.max(e.processingEnd,r.processingEnd),r.entries.push(e),n=t;break}n!==t&&(Qn.push(n),Yn.set(n,{startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,entries:[e]})),(e.interactionId||"first-input"===e.entryType)&&ei.set(e,n)}),(function(){ni<0&&(ni=Xn(ri))}));var oi,si,ai,ui,li=function(e,t){for(var n,i=[],r=0;n=Zn[r];r++)if(!(n.startTime+n.duration<e)){if(n.startTime>t)break;i.push(n)}return i},ci=function(e,t){pn||(pn=En("long-animation-frame",ii)),function(e,t){t=t||{},Mn((function(){var n;Vn();var i,r=Tn("INP"),o=function(e){e.forEach(Kn);var t,n=(t=Math.min($n.length-1,Math.floor(Wn()/50)),$n[t]);n&&n.latency!==r.value&&(r.value=n.latency,r.entries=n.entries,i())},s=En("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});i=In(e,r,Jn,t.reportAllChanges),s&&("PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&s.observe({type:"first-input",buffered:!0}),xn((function(){o(s.takeRecords()),i(!0)})),yn((function(){Gn=0,$n.length=0,qn.clear(),r=Tn("INP"),i=In(e,r,Jn,t.reportAllChanges)})))}))}((function(t){Xn((function(){var n=function(e){var t=e.entries[0],n=ei.get(t),i=Yn.get(n),r=t.processingStart,o=i.processingEnd,s=i.entries.sort((function(e,t){return e.processingStart-t.processingStart})),a=li(t.startTime,o),u=e.entries.find((function(e){return e.target})),l=u&&u.target||ti.get(t.interactionId),c=[t.startTime+t.duration,o].concat(a.map((function(e){return e.startTime+e.duration}))),d=Math.max.apply(Math,c),f={interactionTarget:hn(l),interactionTargetElement:l,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:d,processedEventEntries:s,longAnimationFrameEntries:a,inputDelay:r-t.startTime,processingDuration:o-r,presentationDelay:Math.max(d-o,0),loadState:gn(t.startTime)};return Object.assign(e,{attribution:f})}(t);e(n)}))}),t)},di=[2500,4e3],fi={},pi=[800,1800],mi=function e(t){document.prerendering?Mn((function(){return e(t)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},gi=function(e,t){t=t||{};var n=Tn("TTFB"),i=In(e,n,pi,t.reportAllChanges);mi((function(){var r=mn();r&&(n.value=Math.max(r.responseStart-Sn(),0),n.entries=[r],i(!0),yn((function(){n=Tn("TTFB",0),(i=In(e,n,pi,t.reportAllChanges))(!0)})))}))},vi={passive:!0,capture:!0},hi=new Date,bi=function(e,t){oi||(oi=t,si=e,ai=new Date,Si(removeEventListener),wi())},wi=function(){if(si>=0&&si<ai-hi){var e={entryType:"first-input",name:oi.type,target:oi.target,cancelable:oi.cancelable,startTime:oi.timeStamp,processingStart:oi.timeStamp+si};ui.forEach((function(t){t(e)})),ui=[]}},yi=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){bi(e,t),r()},i=function(){r()},r=function(){removeEventListener("pointerup",n,vi),removeEventListener("pointercancel",i,vi)};addEventListener("pointerup",n,vi),addEventListener("pointercancel",i,vi)}(t,e):bi(t,e)}},Si=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,yi,vi)}))},Ti=[100,300],Ei=function(e,t){!function(e,t){t=t||{},Mn((function(){var n,i=An(),r=Tn("FID"),o=function(e){e.startTime<i.firstHiddenTime&&(r.value=e.processingStart-e.startTime,r.entries.push(e),n(!0))},s=function(e){e.forEach(o)},a=En("first-input",s);n=In(e,r,Ti,t.reportAllChanges),a&&(xn(Ln((function(){s(a.takeRecords()),a.disconnect()}))),yn((function(){var i;r=Tn("FID"),n=In(e,r,Ti,t.reportAllChanges),ui=[],si=-1,oi=null,Si(addEventListener),i=o,ui.push(i),wi()})))}))}((function(t){var n=function(e){var t=e.entries[0],n={eventTarget:hn(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:gn(t.startTime)};return Object.assign(e,{attribution:n})}(t);e(n)}),t)};const Ii="com.grafana.faro.lastNavigationId",ki="load_state",xi="time_to_first_byte";class Li{constructor(e){this.corePushMeasurement=e}initialize(){this.measureCLS(),this.measureFCP(),this.measureFID(),this.measureINP(),this.measureLCP(),this.measureTTFB()}measureCLS(){!function(e,t){!function(e,t){t=t||{},jn(Ln((function(){var n,i=Tn("CLS",0),r=0,o=[],s=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=o[0],n=o[o.length-1];r&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(r+=e.value,o.push(e)):(r=e.value,o=[e])}})),r>i.value&&(i.value=r,i.entries=o,n())},a=En("layout-shift",s);a&&(n=In(e,i,Rn,t.reportAllChanges),xn((function(){s(a.takeRecords()),n(!0)})),yn((function(){r=0,i=Tn("CLS",0),n=In(e,i,Rn,t.reportAllChanges),kn((function(){return n()}))})),setTimeout(n,0))})))}((function(t){var n=function(e){var t,n={};if(e.entries.length){var i=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(i&&i.sources&&i.sources.length){var r=(t=i.sources).find((function(e){return e.node&&1===e.node.nodeType}))||t[0];r&&(n={largestShiftTarget:hn(r.node),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:r,largestShiftEntry:i,loadState:gn(i.startTime)})}}return Object.assign(e,{attribution:n})}(t);e(n)}),t)}((e=>{const{loadState:t,largestShiftValue:n,largestShiftTime:i,largestShiftTarget:r}=e.attribution,o=this.buildInitialValues(e);this.addIfPresent(o,"largest_shift_value",n),this.addIfPresent(o,"largest_shift_time",i);const s=this.buildInitialContext(e);this.addIfPresent(s,ki,t),this.addIfPresent(s,"largest_shift_target",r),this.pushMeasurement(o,s)}))}measureFCP(){!function(e,t){jn((function(t){var n=function(e){var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:gn(wn())};if(e.entries.length){var n=mn(),i=e.entries[e.entries.length-1];if(n){var r=n.activationStart||0,o=Math.max(0,n.responseStart-r);t={timeToFirstByte:o,firstByteToFCP:e.value-o,loadState:gn(e.entries[0].startTime),navigationEntry:n,fcpEntry:i}}}return Object.assign(e,{attribution:t})}(t);e(n)}),t)}((e=>{const{firstByteToFCP:t,timeToFirstByte:n,loadState:i}=e.attribution,r=this.buildInitialValues(e);this.addIfPresent(r,"first_byte_to_fcp",t),this.addIfPresent(r,xi,n);const o=this.buildInitialContext(e);this.addIfPresent(o,ki,i),this.pushMeasurement(r,o)}))}measureFID(){Ei((e=>{const{eventTime:t,eventTarget:n,eventType:i,loadState:r}=e.attribution,o=this.buildInitialValues(e);this.addIfPresent(o,"event_time",t);const s=this.buildInitialContext(e);this.addIfPresent(s,"event_target",n),this.addIfPresent(s,"event_type",i),this.addIfPresent(s,ki,r),this.pushMeasurement(o,s)}))}measureINP(){ci((e=>{const{interactionTime:t,presentationDelay:n,inputDelay:i,processingDuration:r,nextPaintTime:o,loadState:s,interactionTarget:a,interactionType:u}=e.attribution,l=this.buildInitialValues(e);this.addIfPresent(l,"interaction_time",t),this.addIfPresent(l,"presentation_delay",n),this.addIfPresent(l,"input_delay",i),this.addIfPresent(l,"processing_duration",r),this.addIfPresent(l,"next_paint_time",o);const c=this.buildInitialContext(e);this.addIfPresent(c,ki,s),this.addIfPresent(c,"interaction_target",a),this.addIfPresent(c,"interaction_type",u),this.pushMeasurement(l,c)}))}measureLCP(){!function(e,t){!function(e,t){t=t||{},Mn((function(){var n,i=An(),r=Tn("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-Sn(),0),r.entries=[e],n())}))},s=En("largest-contentful-paint",o);if(s){n=In(e,r,di,t.reportAllChanges);var a=Ln((function(){fi[r.id]||(o(s.takeRecords()),s.disconnect(),fi[r.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return Xn(a)}),!0)})),xn(a),yn((function(i){r=Tn("LCP"),n=In(e,r,di,t.reportAllChanges),kn((function(){r.value=performance.now()-i.timeStamp,fi[r.id]=!0,n(!0)}))}))}}))}((function(t){var n=function(e){var t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){var n=mn();if(n){var i=n.activationStart||0,r=e.entries[e.entries.length-1],o=r.url&&performance.getEntriesByType("resource").filter((function(e){return e.name===r.url}))[0],s=Math.max(0,n.responseStart-i),a=Math.max(s,o?(o.requestStart||o.startTime)-i:0),u=Math.max(a,o?o.responseEnd-i:0),l=Math.max(u,r.startTime-i);t={element:hn(r.element),timeToFirstByte:s,resourceLoadDelay:a-s,resourceLoadDuration:u-a,elementRenderDelay:l-u,navigationEntry:n,lcpEntry:r},r.url&&(t.url=r.url),o&&(t.lcpResourceEntry=o)}}return Object.assign(e,{attribution:t})}(t);e(n)}),t)}((e=>{const{elementRenderDelay:t,resourceLoadDelay:n,resourceLoadDuration:i,timeToFirstByte:r,element:o}=e.attribution,s=this.buildInitialValues(e);this.addIfPresent(s,"element_render_delay",t),this.addIfPresent(s,"resource_load_delay",n),this.addIfPresent(s,"resource_load_duration",i),this.addIfPresent(s,xi,r);const a=this.buildInitialContext(e);this.addIfPresent(a,"element",o),this.pushMeasurement(s,a)}))}measureTTFB(){!function(e,t){gi((function(t){var n=function(e){var t={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(e.entries.length){var n=e.entries[0],i=n.activationStart||0,r=Math.max((n.workerStart||n.fetchStart)-i,0),o=Math.max(n.domainLookupStart-i,0),s=Math.max(n.connectStart-i,0),a=Math.max(n.connectEnd-i,0);t={waitingDuration:r,cacheDuration:o-r,dnsDuration:s-o,connectionDuration:a-s,requestDuration:e.value-a,navigationEntry:n}}return Object.assign(e,{attribution:t})}(t);e(n)}),t)}((e=>{const{dnsDuration:t,connectionDuration:n,requestDuration:i,waitingDuration:r,cacheDuration:o}=e.attribution,s=this.buildInitialValues(e);this.addIfPresent(s,"dns_duration",t),this.addIfPresent(s,"connection_duration",n),this.addIfPresent(s,"request_duration",i),this.addIfPresent(s,"waiting_duration",r),this.addIfPresent(s,"cache_duration",o);const a=this.buildInitialContext(e);this.pushMeasurement(s,a)}))}buildInitialValues(e){const t=e.name.toLowerCase();return{[t]:e.value,delta:e.delta}}buildInitialContext(e){var t;const n=null!==(t=Ee(Ii,Se.session))&&void 0!==t?t:pe;return{id:e.id,rating:e.rating,navigation_type:e.navigationType,navigation_entry_id:n}}pushMeasurement(e,t){this.corePushMeasurement({type:"web-vitals",values:e},{context:t})}addIfPresent(e,t,n){n&&(e[t]=n)}}class Oi extends ee{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-web-vitals",this.version=te}initialize(){this.logDebug("Initializing");this.intializeWebVitalsInstrumentation().initialize()}intializeWebVitalsInstrumentation(){return this.config.trackWebVitalsAttribution?new Li(this.api.pushMeasurement):new dn(this.api.pushMeasurement)}}function Ci(e,t,n,i){return new(n||(n=Promise))((function(r,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const Pi=/^00-[a-f0-9]{32}-[a-f0-9]{16}-[0-9]{1,2}$/;function _i(e=[]){for(const t of e)if("traceparent"===t.name){if(!Pi.test(t.description))continue;const[,e,n]=t.description.split("-");if(null!=e&&null!=n)return{traceId:e,spanId:n};break}}function Ni(e=[],t){return e.some((e=>e&&null!=t.match(e)))}function Ai(e,t={}){for(const[n,i]of Object.entries(t)){const t=e[n];return null!=t&&(l(i)?i.includes(t):t===i)}return!0}function Mi(e){const{connectEnd:t,connectStart:n,decodedBodySize:i,domainLookupEnd:r,domainLookupStart:o,duration:s,encodedBodySize:a,fetchStart:u,initiatorType:l,name:c,nextHopProtocol:d,redirectEnd:f,redirectStart:p,renderBlockingStatus:m,requestStart:g,responseEnd:v,responseStart:h,responseStatus:b,secureConnectionStart:w,transferSize:y,workerStart:S}=e;return{name:c,duration:ji(s),tcpHandshakeTime:ji(t-n),dnsLookupTime:ji(r-o),tlsNegotiationTime:ji(g-w),responseStatus:ji(b),redirectTime:ji(f-p),requestTime:ji(h-g),responseTime:ji(v-h),fetchTime:ji(v-u),serviceWorkerTime:ji(u-S),decodedBodySize:ji(i),encodedBodySize:ji(a),cacheHitStatus:function(){let e="fullLoad";0===y?i>0&&(e="cache"):null!=b?304===b&&(e="conditionalFetch"):a>0&&y<a&&(e="conditionalFetch");return e}(),renderBlockingStatus:ji(m),protocol:d,initiatorType:l}}function Di(e){const{activationStart:t,domComplete:n,domContentLoadedEventEnd:i,domContentLoadedEventStart:r,domInteractive:o,fetchStart:s,loadEventEnd:a,loadEventStart:u,responseStart:l,type:c}=e,d=function(){var e;if(null!=(null===(e=performance.timing)||void 0===e?void 0:e.domLoading))return performance.timing.domLoading-performance.timeOrigin;return null}();return Object.assign({visibilityState:document.visibilityState,pageLoadTime:ji(n-s),documentParsingTime:ji(d?o-d:null),domProcessingTime:ji(n-o),domContentLoadHandlerTime:ji(i-r),onLoadTime:ji(a-u),ttfb:ji(Math.max(l-(null!=t?t:0),0)),type:c},Mi(e))}function ji(e){return null==e?pe:"number"==typeof e?Math.round(e).toString():e.toString()}const Ri={initiatorType:["xmlhttprequest","fetch"]};class Bi extends ee{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-performance",this.version=te}initialize(){"PerformanceObserver"in window?function(e){if("complete"===document.readyState)e();else{const t=()=>{"complete"===document.readyState&&(e(),document.removeEventListener("readystatechange",t))};document.addEventListener("readystatechange",t)}}((()=>Ci(this,void 0,void 0,(function*(){const t=this.api.pushEvent,n=this.getIgnoreUrls(),{faroNavigationId:i}=yield function(e,t){let n;const i=new Promise((e=>{n=e}));return new PerformanceObserver((i=>{var r;const[o]=i.getEntries();if(null==o||Ni(t,o.name))return;const s=o.toJSON();let a=_i(null==s?void 0:s.serverTiming);const u=null!==(r=Ee(Ii,Se.session))&&void 0!==r?r:pe,l=Object.assign(Object.assign({},Di(s)),{faroNavigationId:P(),faroPreviousNavigationId:u});Ie(Ii,l.faroNavigationId,Se.session),e("faro.performance.navigation",l,void 0,{spanContext:a,timestampOverwriteMs:performance.timeOrigin+s.startTime}),n(l)})).observe({type:"navigation",buffered:!0}),i}(t,n);null!=i&&function(t,n,i){const r=e.faro.config.trackResources;new PerformanceObserver((e=>{const o=e.getEntries();for(const e of o){if(Ni(i,e.name))return;const o=e.toJSON();let s=_i(null==o?void 0:o.serverTiming);if(null==r&&Ai(o,Ri)||r){const e=Object.assign(Object.assign({},Mi(o)),{faroNavigationId:t,faroResourceId:P()});n("faro.performance.resource",e,void 0,{spanContext:s,timestampOverwriteMs:performance.timeOrigin+o.startTime})}}})).observe({type:"resource",buffered:!0})}(i,t,n)})))):this.logDebug("performance observer not supported. Disable performance instrumentation.")}getIgnoreUrls(){var e;return null===(e=this.transports.transports)||void 0===e?void 0:e.flatMap((e=>e.getIgnoreUrls()))}}function Ui(e={}){const t=[new vt,new Oi,new $e,new ht];return!1!==e.enablePerformanceInstrumentation&&t.unshift(new Bi),!1!==e.captureConsole&&t.push(new qe({disabledLevels:e.captureConsoleDisabledLevels})),t}const Fi="browser",zi=()=>{const e=window.k6;return{k6:Object.assign({isK6Browser:!0},(null==e?void 0:e.testRunId)&&{testRunId:null==e?void 0:e.testRunId})}};class Vi extends H{constructor(e){var t,n,i,r;super(),this.options=e,this.name="@grafana/faro-web-sdk:transport-fetch",this.version=te,this.disabledUntil=new Date,this.rateLimitBackoffMs=null!==(t=e.defaultRateLimitBackoffMs)&&void 0!==t?t:5e3,this.getNow=null!==(n=e.getNow)&&void 0!==n?n:()=>Date.now(),this.promiseBuffer=O({size:null!==(i=e.bufferSize)&&void 0!==i?i:30,concurrency:null!==(r=e.concurrency)&&void 0!==r?r:5})}send(e){return Ci(this,void 0,void 0,(function*(){try{if(this.disabledUntil>new Date(this.getNow()))return this.logWarn(`Dropping transport item due to too many requests. Backoff until ${this.disabledUntil}`),Promise.resolve();yield this.promiseBuffer.add((()=>{const t=JSON.stringify(X(e)),{url:n,requestOptions:i,apiKey:r}=this.options,o=null!=i?i:{},{headers:s}=o,a=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}(o,["headers"]);let u;const l=this.metas.value.session;return null!=l&&(u=l.id),fetch(n,Object.assign({method:"POST",headers:Object.assign(Object.assign(Object.assign({"Content-Type":"application/json"},null!=s?s:{}),r?{"x-api-key":r}:{}),u?{"x-faro-session-id":u}:{}),body:t,keepalive:t.length<=6e4},null!=a?a:{})).then((e=>Ci(this,void 0,void 0,(function*(){if(202===e.status){"invalid"===e.headers.get("X-Faro-Session-Status")&&this.extendFaroSession(this.config,this.logDebug)}return 429===e.status&&(this.disabledUntil=this.getRetryAfterDate(e),this.logWarn(`Too many requests, backing off until ${this.disabledUntil}`)),e.text().catch(L),e})))).catch((e=>{this.logError("Failed sending payload to the receiver\n",JSON.parse(t),e)}))}))}catch(e){this.logError(e)}}))}getIgnoreUrls(){var e;return[this.options.url].concat(null!==(e=this.config.ignoreUrls)&&void 0!==e?e:[])}isBatched(){return!0}getRetryAfterDate(e){const t=this.getNow(),n=e.headers.get("Retry-After");if(n){const e=Number(n);if(!isNaN(e))return new Date(1e3*e+t);const i=Date.parse(n);if(!isNaN(i))return new Date(i)}return new Date(t+this.rateLimitBackoffMs)}extendFaroSession(e,t){const n="Session expired",i=e.sessionTracking;if(null==i?void 0:i.enabled){const{fetchUserSession:e,storeUserSession:r}=Ve(i);Be({fetchUserSession:e,storeUserSession:r})({forceSessionExtend:!0}),t(`${n} created new session.`)}else t(`${n}.`)}}function $i(e){var t,n,i,r,o,s,u,l,c;const d=[],f=$(e.unpatchedConsole,e.internalLoggerLevel);e.transports?((e.url||e.apiKey)&&f.error('if "transports" is defined, "url" and "apiKey" should not be defined'),d.push(...e.transports)):e.url?d.push(new Vi({url:e.url,apiKey:e.apiKey})):f.error('either "url" or "transports" must be defined');return{app:e.app,batching:Object.assign(Object.assign({},ue),e.batching),dedupe:null===(t=e.dedupe)||void 0===t||t,globalObjectKey:e.globalObjectKey||ae,instrumentations:null!==(n=e.instrumentations)&&void 0!==n?n:Ui(),internalLoggerLevel:null!==(i=e.internalLoggerLevel)&&void 0!==i?i:U,isolate:null!==(r=e.isolate)&&void 0!==r&&r,logArgsSerializer:null!==(o=e.logArgsSerializer)&&void 0!==o?o:Y,metas:function(){const t=we;return e.metas&&t.push(...e.metas),a(window.k6)?[...t,zi]:t}(),parseStacktrace:pt,paused:null!==(s=e.paused)&&void 0!==s&&s,preventGlobalExposure:null!==(u=e.preventGlobalExposure)&&void 0!==u&&u,transports:d,unpatchedConsole:null!==(l=e.unpatchedConsole)&&void 0!==l?l:F,beforeSend:e.beforeSend,eventDomain:null!==(c=e.eventDomain)&&void 0!==c?c:Fi,ignoreErrors:e.ignoreErrors,ignoreUrls:e.ignoreUrls,sessionTracking:Object.assign(Object.assign({},De),e.sessionTracking),user:e.user,view:e.view,trackResources:e.trackResources,trackWebVitalsAttribution:e.trackWebVitalsAttribution}}return e.BaseExtension=W,e.BaseInstrumentation=ee,e.BaseTransport=H,e.ConsoleInstrumentation=qe,e.ConsoleTransport=class extends H{constructor(e={}){super(),this.options=e,this.name="@grafana/faro-web-sdk:transport-console",this.version=te}send(t){var n;return this.unpatchedConsole[null!==(n=this.options.level)&&void 0!==n?n:e.LogLevel.DEBUG]("New event",X([t]))}},e.Conventions={EventNames:{CLICK:"click",NAVIGATION:"navigation",SESSION_START:"session_start",VIEW_CHANGED:"view_changed"}},e.EVENT_CLICK="click",e.EVENT_NAVIGATION="navigation",e.EVENT_ROUTE_CHANGE="route_change",e.EVENT_SESSION_EXTEND=fe,e.EVENT_SESSION_RESUME=de,e.EVENT_SESSION_START=ce,e.EVENT_VIEW_CHANGED=le,e.ErrorsInstrumentation=vt,e.FetchTransport=Vi,e.MAX_SESSION_PERSISTENCE_TIME=Me,e.MAX_SESSION_PERSISTENCE_TIME_BUFFER=6e4,e.PerformanceInstrumentation=Bi,e.PersistentSessionsManager=Fe,e.SESSION_EXPIRATION_TIME=Ne,e.SESSION_INACTIVITY_TIME=Ae,e.STORAGE_KEY=_e,e.SessionInstrumentation=$e,e.VERSION=te,e.ViewInstrumentation=ht,e.VolatileSessionsManager=ze,e.WebVitalsInstrumentation=Oi,e.allLogLevels=x,e.browserMeta=he,e.buildStackFrame=ct,e.createInternalLogger=$,e.createPromiseBuffer=O,e.createSession=ye,e.deepEqual=y,e.defaultEventDomain=Fi,e.defaultExceptionType=J,e.defaultGlobalObjectKey=ae,e.defaultInternalLoggerLevel=U,e.defaultLogLevel=k,e.defaultMetas=we,e.genShortID=P,e.getCurrentTimestamp=T,e.getDataFromSafariExtensions=dt,e.getInternalFaroFromGlobalObject=function(){return _[ne]},e.getStackFramesFromError=ft,e.getTransportBody=X,e.getWebInstrumentations=Ui,e.globalObject=_,e.initializeFaro=function(e){const t=$i(e);if(t)return se(t)},e.internalGlobalObjectKey=ne,e.isArray=l,e.isBoolean=e=>t(e,"boolean"),e.isDomError=v,e.isDomException=h,e.isElement=e=>b&&i(e,Element),e.isElementDefined=b,e.isError=m,e.isErrorDefined=p,e.isErrorEvent=g,e.isEvent=f,e.isEventDefined=d,e.isFunction=u,e.isInstanceOf=i,e.isInt=e=>s(e)&&Number.isInteger(e),e.isInternalFaroOnGlobalObject=re,e.isMap=e=>w&&i(e,Map),e.isMapDefined=w,e.isNull=r,e.isNumber=s,e.isObject=a,e.isPrimitive=c,e.isRegExp=e=>n(e,"RegExp"),e.isString=o,e.isSymbol=e=>t(e,"symbol"),e.isSyntheticEvent=e=>a(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e,e.isThenable=e=>u(null==e?void 0:e.then),e.isToString=n,e.isTypeof=t,e.isUndefined=e=>t(e,"undefined"),e.makeCoreConfig=$i,e.noop=L,e.pageMeta=be,e.parseStacktrace=pt,e.sdkMeta=()=>({sdk:{name:"@grafana/faro-core",version:te,integrations:e.faro.config.instrumentations.map((({name:e,version:t})=>({name:e,version:t})))}}),e.setInternalFaroOnGlobalObject=ie,e.transportItemTypeToBodyKey=M,e}({});
|
|
@@ -4,7 +4,7 @@ export { defaultEventDomain } from './consts';
|
|
|
4
4
|
export { initializeFaro } from './initialize';
|
|
5
5
|
export { buildStackFrame, ConsoleInstrumentation, ErrorsInstrumentation, getDataFromSafariExtensions, getStackFramesFromError, parseStacktrace, ViewInstrumentation, WebVitalsInstrumentation, SessionInstrumentation, PerformanceInstrumentation, } from './instrumentations';
|
|
6
6
|
export type { ConsoleInstrumentationOptions, ErrorEvent, ExtendedPromiseRejectionEvent } from './instrumentations';
|
|
7
|
-
export { browserMeta, createSession, defaultMetas,
|
|
7
|
+
export { browserMeta, createSession, defaultMetas, pageMeta, sdkMeta } from './metas';
|
|
8
8
|
export { ConsoleTransport, FetchTransport } from './transports';
|
|
9
9
|
export type { ClockFn, ConsoleTransportOptions, FetchTransportOptions, FetchTransportRequestOptions, } from './transports';
|
|
10
10
|
export { faro, allLogLevels, BaseExtension, BaseInstrumentation, BaseTransport, Conventions, createInternalLogger, createPromiseBuffer, deepEqual, defaultExceptionType, defaultGlobalObjectKey, defaultInternalLoggerLevel, defaultLogLevel, genShortID, getCurrentTimestamp, getInternalFaroFromGlobalObject, getTransportBody, globalObject, internalGlobalObjectKey, isArray, isBoolean, isDomError, isDomException, isElement, isElementDefined, isError, isErrorDefined, isErrorEvent, isEvent, isEventDefined, isFunction, isInstanceOf, isInt, isInternalFaroOnGlobalObject, isMap, isMapDefined, isNull, isNumber, isObject, isPrimitive, isRegExp, isString, isSymbol, isSyntheticEvent, isThenable, isToString, isTypeof, isUndefined, InternalLoggerLevel, LogLevel, noop, setInternalFaroOnGlobalObject, TransportItemType, transportItemTypeToBodyKey, VERSION, EVENT_CLICK, EVENT_NAVIGATION, EVENT_ROUTE_CHANGE, EVENT_SESSION_EXTEND, EVENT_SESSION_RESUME, EVENT_SESSION_START, EVENT_VIEW_CHANGED, } from '@grafana/faro-core';
|
|
@@ -3,7 +3,7 @@ import type { ConsoleInstrumentationOptions } from './types';
|
|
|
3
3
|
export declare class ConsoleInstrumentation extends BaseInstrumentation {
|
|
4
4
|
private options;
|
|
5
5
|
readonly name = "@grafana/faro-web-sdk:instrumentation-console";
|
|
6
|
-
readonly version = "1.
|
|
6
|
+
readonly version = "1.10.0";
|
|
7
7
|
static defaultDisabledLevels: LogLevel[];
|
|
8
8
|
constructor(options?: ConsoleInstrumentationOptions);
|
|
9
9
|
initialize(): void;
|
|
@@ -3,5 +3,5 @@ export declare const primitiveUnhandledType = "UnhandledRejection";
|
|
|
3
3
|
export declare const domErrorType = "DOMError";
|
|
4
4
|
export declare const domExceptionType = "DOMException";
|
|
5
5
|
export declare const objectEventValue = "Non-Error exception captured with keys:";
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const unknownSymbolString = "?";
|
|
7
7
|
export declare const valueTypeRegex: RegExp;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseInstrumentation } from '@grafana/faro-core';
|
|
2
2
|
export declare class ErrorsInstrumentation extends BaseInstrumentation {
|
|
3
3
|
readonly name = "@grafana/faro-web-sdk:instrumentation-errors";
|
|
4
|
-
readonly version = "1.
|
|
4
|
+
readonly version = "1.10.0";
|
|
5
5
|
initialize(): void;
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const newLineString = "\n";
|
|
2
2
|
export declare const evalString = "eval";
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const unknownSymbolString = "?";
|
|
4
4
|
export declare const atString = "@";
|
|
5
5
|
export declare const webkitLineRegex: RegExp;
|
|
6
6
|
export declare const webkitEvalRegex: RegExp;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseInstrumentation } from '@grafana/faro-core';
|
|
2
2
|
export declare class PerformanceInstrumentation extends BaseInstrumentation {
|
|
3
3
|
readonly name = "@grafana/faro-web-sdk:instrumentation-performance";
|
|
4
|
-
readonly version = "1.
|
|
4
|
+
readonly version = "1.10.0";
|
|
5
5
|
initialize(): void;
|
|
6
6
|
private getIgnoreUrls;
|
|
7
7
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { unknownString } from '@grafana/faro-core';
|
|
1
2
|
export type FaroNavigationTiming = Readonly<{
|
|
2
3
|
duration: string;
|
|
3
4
|
visibilityState: DocumentVisibilityState;
|
|
@@ -25,7 +26,7 @@ export type FaroResourceTiming = Readonly<{
|
|
|
25
26
|
decodedBodySize: string;
|
|
26
27
|
encodedBodySize: string;
|
|
27
28
|
cacheHitStatus: 'cache' | 'conditionalFetch' | 'fullLoad';
|
|
28
|
-
renderBlockingStatus: 'blocking' | 'non-blocking' |
|
|
29
|
+
renderBlockingStatus: 'blocking' | 'non-blocking' | typeof unknownString;
|
|
29
30
|
initiatorType: string;
|
|
30
31
|
}>;
|
|
31
32
|
export type FaroNavigationItem = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseInstrumentation } from '@grafana/faro-core';
|
|
2
2
|
export declare class SessionInstrumentation extends BaseInstrumentation {
|
|
3
3
|
readonly name = "@grafana/faro-web-sdk:instrumentation-session";
|
|
4
|
-
readonly version = "1.
|
|
4
|
+
readonly version = "1.10.0";
|
|
5
5
|
private notifiedSession;
|
|
6
6
|
private sendSessionStartEvent;
|
|
7
7
|
private createInitialSession;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseInstrumentation } from '@grafana/faro-core';
|
|
2
2
|
export declare class ViewInstrumentation extends BaseInstrumentation {
|
|
3
3
|
readonly name = "@grafana/faro-web-sdk:instrumentation-view";
|
|
4
|
-
readonly version = "1.
|
|
4
|
+
readonly version = "1.10.0";
|
|
5
5
|
private notifiedView;
|
|
6
6
|
private sendViewChangedEvent;
|
|
7
7
|
initialize(): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseInstrumentation } from '@grafana/faro-core';
|
|
2
2
|
export declare class WebVitalsInstrumentation extends BaseInstrumentation {
|
|
3
3
|
readonly name = "@grafana/faro-web-sdk:instrumentation-web-vitals";
|
|
4
|
-
readonly version = "1.
|
|
4
|
+
readonly version = "1.10.0";
|
|
5
5
|
initialize(): void;
|
|
6
6
|
private intializeWebVitalsInstrumentation;
|
|
7
7
|
}
|
|
@@ -4,7 +4,7 @@ import type { ConsoleTransportOptions } from './types';
|
|
|
4
4
|
export declare class ConsoleTransport extends BaseTransport {
|
|
5
5
|
private options;
|
|
6
6
|
readonly name = "@grafana/faro-web-sdk:transport-console";
|
|
7
|
-
readonly version = "1.
|
|
7
|
+
readonly version = "1.10.0";
|
|
8
8
|
constructor(options?: ConsoleTransportOptions);
|
|
9
9
|
send(item: TransportItem): void;
|
|
10
10
|
}
|
|
@@ -4,7 +4,7 @@ import type { FetchTransportOptions } from './types';
|
|
|
4
4
|
export declare class FetchTransport extends BaseTransport {
|
|
5
5
|
private options;
|
|
6
6
|
readonly name = "@grafana/faro-web-sdk:transport-fetch";
|
|
7
|
-
readonly version = "1.
|
|
7
|
+
readonly version = "1.10.0";
|
|
8
8
|
promiseBuffer: PromiseBuffer<Response | void>;
|
|
9
9
|
private readonly rateLimitBackoffMs;
|
|
10
10
|
private readonly getNow;
|
|
@@ -30,7 +30,7 @@ var k6_1 = require("../metas/k6");
|
|
|
30
30
|
var transports_1 = require("../transports");
|
|
31
31
|
var getWebInstrumentations_1 = require("./getWebInstrumentations");
|
|
32
32
|
function makeCoreConfig(browserConfig) {
|
|
33
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
33
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
34
34
|
var transports = [];
|
|
35
35
|
var internalLogger = (0, faro_core_1.createInternalLogger)(browserConfig.unpatchedConsole, browserConfig.internalLoggerLevel);
|
|
36
36
|
if (browserConfig.transports) {
|
|
@@ -80,7 +80,7 @@ function makeCoreConfig(browserConfig) {
|
|
|
80
80
|
ignoreUrls: browserConfig.ignoreUrls,
|
|
81
81
|
sessionTracking: __assign(__assign({}, session_1.defaultSessionTrackingConfig), browserConfig.sessionTracking),
|
|
82
82
|
user: browserConfig.user,
|
|
83
|
-
view:
|
|
83
|
+
view: browserConfig.view,
|
|
84
84
|
trackResources: browserConfig.trackResources,
|
|
85
85
|
trackWebVitalsAttribution: browserConfig.trackWebVitalsAttribution,
|
|
86
86
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeCoreConfig.js","sourceRoot":"","sources":["../../../src/config/makeCoreConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAQ4B;AAG5B,oCAA+C;AAC/C,wDAAsD;AACtD,uDAA2E;AAC3E,
|
|
1
|
+
{"version":3,"file":"makeCoreConfig.js","sourceRoot":"","sources":["../../../src/config/makeCoreConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAQ4B;AAG5B,oCAA+C;AAC/C,wDAAsD;AACtD,uDAA2E;AAC3E,kCAAwC;AACxC,kCAAqC;AACrC,4CAA+C;AAE/C,mEAAkE;AAGlE,SAAgB,cAAc,CAAC,aAA4B;;IACzD,IAAM,UAAU,GAAgB,EAAE,CAAC;IAEnC,IAAM,cAAc,GAAG,IAAA,gCAAoB,EAAC,aAAa,CAAC,gBAAgB,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAC;IAE/G,IAAI,aAAa,CAAC,UAAU,EAAE;QAC5B,IAAI,aAAa,CAAC,GAAG,IAAI,aAAa,CAAC,MAAM,EAAE;YAC7C,cAAc,CAAC,KAAK,CAAC,sEAAsE,CAAC,CAAC;SAC9F;QAED,UAAU,CAAC,IAAI,OAAf,UAAU,EAAS,aAAa,CAAC,UAAU,EAAE;KAC9C;SAAM,IAAI,aAAa,CAAC,GAAG,EAAE;QAC5B,UAAU,CAAC,IAAI,CACb,IAAI,2BAAc,CAAC;YACjB,GAAG,EAAE,aAAa,CAAC,GAAG;YACtB,MAAM,EAAE,aAAa,CAAC,MAAM;SAC7B,CAAC,CACH,CAAC;KACH;SAAM;QACL,cAAc,CAAC,KAAK,CAAC,8CAA8C,CAAC,CAAC;KACtE;IAED,SAAS,WAAW;QAClB,IAAM,YAAY,GAAG,oBAAY,CAAC;QAElC,IAAI,aAAa,CAAC,KAAK,EAAE;YACvB,YAAY,CAAC,IAAI,OAAjB,YAAY,EAAS,aAAa,CAAC,KAAK,EAAE;SAC3C;QAED,IAAM,kBAAkB,GAAG,IAAA,oBAAQ,EAAE,MAAc,CAAC,EAAE,CAAC,CAAC;QAExD,IAAI,kBAAkB,EAAE;YACtB,uCAAW,YAAY,UAAE,WAAM,UAAE;SAClC;QAED,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,IAAM,MAAM,GAAW;QACrB,GAAG,EAAE,aAAa,CAAC,GAAG;QACtB,QAAQ,wBACH,iCAAqB,GACrB,aAAa,CAAC,QAAQ,CAC1B;QACD,MAAM,EAAE,MAAA,aAAa,CAAC,MAAM,mCAAI,IAAI;QACpC,eAAe,EAAE,aAAa,CAAC,eAAe,IAAI,kCAAsB;QACxE,gBAAgB,EAAE,MAAA,aAAa,CAAC,gBAAgB,mCAAI,IAAA,+CAAsB,GAAE;QAC5E,mBAAmB,EAAE,MAAA,aAAa,CAAC,mBAAmB,mCAAI,sCAA0B;QACpF,OAAO,EAAE,MAAA,aAAa,CAAC,OAAO,mCAAI,KAAK;QACvC,iBAAiB,EAAE,MAAA,aAAa,CAAC,iBAAiB,mCAAI,oCAAwB;QAC9E,KAAK,EAAE,WAAW,EAAE;QACpB,eAAe,oCAAA;QACf,MAAM,EAAE,MAAA,aAAa,CAAC,MAAM,mCAAI,KAAK;QACrC,qBAAqB,EAAE,MAAA,aAAa,CAAC,qBAAqB,mCAAI,KAAK;QACnE,UAAU,YAAA;QACV,gBAAgB,EAAE,MAAA,aAAa,CAAC,gBAAgB,mCAAI,mCAAuB;QAE3E,UAAU,EAAE,aAAa,CAAC,UAAU;QACpC,WAAW,EAAE,MAAA,aAAa,CAAC,WAAW,mCAAI,2BAAkB;QAC5D,YAAY,EAAE,aAAa,CAAC,YAAY;QACxC,UAAU,EAAE,aAAa,CAAC,UAAU;QAEpC,eAAe,wBACV,sCAA4B,GAC5B,aAAa,CAAC,eAAe,CACjC;QAED,IAAI,EAAE,aAAa,CAAC,IAAI;QACxB,IAAI,EAAE,aAAa,CAAC,IAAI;QACxB,cAAc,EAAE,aAAa,CAAC,cAAc;QAC5C,yBAAyB,EAAE,aAAa,CAAC,yBAAyB;KACnE,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC;AA1ED,wCA0EC","sourcesContent":["import {\n createInternalLogger,\n defaultBatchingConfig,\n defaultGlobalObjectKey,\n defaultInternalLoggerLevel,\n defaultLogArgsSerializer,\n defaultUnpatchedConsole,\n isObject,\n} from '@grafana/faro-core';\nimport type { Config, MetaItem, Transport } from '@grafana/faro-core';\n\nimport { defaultEventDomain } from '../consts';\nimport { parseStacktrace } from '../instrumentations';\nimport { defaultSessionTrackingConfig } from '../instrumentations/session';\nimport { defaultMetas } from '../metas';\nimport { k6Meta } from '../metas/k6';\nimport { FetchTransport } from '../transports';\n\nimport { getWebInstrumentations } from './getWebInstrumentations';\nimport type { BrowserConfig } from './types';\n\nexport function makeCoreConfig(browserConfig: BrowserConfig): Config | undefined {\n const transports: Transport[] = [];\n\n const internalLogger = createInternalLogger(browserConfig.unpatchedConsole, browserConfig.internalLoggerLevel);\n\n if (browserConfig.transports) {\n if (browserConfig.url || browserConfig.apiKey) {\n internalLogger.error('if \"transports\" is defined, \"url\" and \"apiKey\" should not be defined');\n }\n\n transports.push(...browserConfig.transports);\n } else if (browserConfig.url) {\n transports.push(\n new FetchTransport({\n url: browserConfig.url,\n apiKey: browserConfig.apiKey,\n })\n );\n } else {\n internalLogger.error('either \"url\" or \"transports\" must be defined');\n }\n\n function createMetas(): MetaItem[] {\n const initialMetas = defaultMetas;\n\n if (browserConfig.metas) {\n initialMetas.push(...browserConfig.metas);\n }\n\n const isK6BrowserSession = isObject((window as any).k6);\n\n if (isK6BrowserSession) {\n return [...initialMetas, k6Meta];\n }\n\n return initialMetas;\n }\n\n const config: Config = {\n app: browserConfig.app,\n batching: {\n ...defaultBatchingConfig,\n ...browserConfig.batching,\n },\n dedupe: browserConfig.dedupe ?? true,\n globalObjectKey: browserConfig.globalObjectKey || defaultGlobalObjectKey,\n instrumentations: browserConfig.instrumentations ?? getWebInstrumentations(),\n internalLoggerLevel: browserConfig.internalLoggerLevel ?? defaultInternalLoggerLevel,\n isolate: browserConfig.isolate ?? false,\n logArgsSerializer: browserConfig.logArgsSerializer ?? defaultLogArgsSerializer,\n metas: createMetas(),\n parseStacktrace,\n paused: browserConfig.paused ?? false,\n preventGlobalExposure: browserConfig.preventGlobalExposure ?? false,\n transports,\n unpatchedConsole: browserConfig.unpatchedConsole ?? defaultUnpatchedConsole,\n\n beforeSend: browserConfig.beforeSend,\n eventDomain: browserConfig.eventDomain ?? defaultEventDomain,\n ignoreErrors: browserConfig.ignoreErrors,\n ignoreUrls: browserConfig.ignoreUrls,\n\n sessionTracking: {\n ...defaultSessionTrackingConfig,\n ...browserConfig.sessionTracking,\n },\n\n user: browserConfig.user,\n view: browserConfig.view,\n trackResources: browserConfig.trackResources,\n trackWebVitalsAttribution: browserConfig.trackWebVitalsAttribution,\n };\n\n return config;\n}\n"]}
|