@grafana/faro-web-sdk 1.10.1 → 1.10.2
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/instrumentations/console/instrumentation.d.ts +1 -1
- package/dist/bundle/types/instrumentations/errors/instrumentation.d.ts +1 -1
- package/dist/bundle/types/instrumentations/performance/instrumentation.d.ts +1 -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/transports/console/transport.d.ts +1 -1
- package/dist/bundle/types/transports/fetch/transport.d.ts +1 -1
- package/dist/types/instrumentations/console/instrumentation.d.ts +1 -1
- package/dist/types/instrumentations/errors/instrumentation.d.ts +1 -1
- package/dist/types/instrumentations/performance/instrumentation.d.ts +1 -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/transports/console/transport.d.ts +1 -1
- package/dist/types/transports/fetch/transport.d.ts +1 -1
- package/package.json +3 -3
|
@@ -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"),c=e=>n(e,"Array"),l=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=c(e),r=c(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},c=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 l;(null===(r=n.batching)||void 0===r?void 0:r.enabled)&&(l=new N(c,{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==l||l.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==l||l.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==l||l.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;function Y(e){let t=e.cause;return m(t)?t=e.cause.toString():null!==t&&(a(e.cause)||c(e.cause))?t=JSON.stringify(e.cause):null!=t&&(t=e.cause.toString()),null==t?{}:{cause:t}}const Q=e=>e.map((e=>{try{return String(e)}catch(e){return""}})).join(" ");function ee(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 c=null;Z=null!==(u=i.parseStacktrace)&&void 0!==u?u:Z;const l=e=>{n.debug("Changing stacktrace parser"),Z=null!=e?e:Z};return l(i.parseStacktrace),{changeStacktraceParser:l,getStacktraceParser:()=>Z,pushError:(t,{skipDedupe:u,stackFrames:l,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:Object.assign(Object.assign({},Y(t)),null!=f?f:{})},type:e.TransportItemType.EXCEPTION};(null==(l=null!=l?l:t.stack?null==Z?void 0:Z(t).frames:void 0)?void 0:l.length)&&(g.payload.stacktrace={frames:l});const v={type:g.payload.type,value:g.payload.value,stackTrace:g.payload.stacktrace,context:g.payload.context};u||!i.dedupe||r(c)||!y(v,c)?(c=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 c=null;const l=null!==(u=i.logArgsSerializer)&&void 0!==u?u:Q;return{pushLog:(t,{context:u,level:d,skipDedupe:f,spanContext:p,timestampOverwriteMs:m}={})=>{try{const g={type:e.TransportItemType.LOG,payload:{message:l(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(c)&&y(v,c))return void n.debug("Skipping log push because it is the same as the last one\n",g.payload);c=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:c,context:l,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!=l?l:{}}),meta:o.value},m={type:p.payload.type,values:p.payload.values,context:p.payload.context};if(!c&&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,c,l,{skipDedupe:d,spanContext:f,timestampOverwriteMs:p}={})=>{try{const m={meta:o.value,payload:{name:t,domain:null!=l?l:i.eventDomain,attributes:c,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 te extends W{constructor(){super(...arguments),this.api={},this.transports={}}}const ne="1.10.1";const ie="_faroInternal";function re(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(_,ie,{configurable:!1,enumerable:!1,writable:!1,value:e}))}function oe(){return ie in _}function se(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},re(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 ae(e){const t=V(e),n=G(t,e);if(oe()&&!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=ee(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=se(t,n,e,i,r,o,s);return function(e){var t,n;const i={sdk:{version:ne},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 ue="faro",ce={enabled:!0,sendTimeout:250,itemLimit:50},le="view_changed",de="session_start",fe="session_resume",pe="session_extend",me="unknown";var ge="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ve={exports:{}};!function(e,t){!function(n,i){var r="function",o="undefined",s="object",a="string",u="major",c="model",l="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,c,l,d=0;d<t.length&&!c;){var f=t[d],p=t[d+1];for(n=o=0;n<f.length&&!c&&f[n];)if(c=f[n++].exec(e))for(a=0;a<p.length;a++)l=c[++o],typeof(u=p[a])===s&&u.length>0?2===u.length?typeof u[1]==r?this[u[0]]=u[1].call(this,l):this[u[0]]=u[1]:3===u.length?typeof u[1]!==r||u[1].exec&&u[1].test?this[u[0]]=l?l.replace(u[1],u[2]):i:this[u[0]]=l?u[1].call(this,l,u[2]):i:4===u.length&&(this[u[0]]=l?u[3].call(this,l.replace(u[1],u[2])):i):this[u]=l||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,[l,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[l,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[l,p],[/opios[\/ ]+([\w\.]+)/i],[p,[l,A+" Mini"]],[/\bopr\/([\w\.]+)/i],[p,[l,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],[l,p],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[l,"UC"+k]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[p,[l,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[p,[l,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[l,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[l,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[p,[l,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[l,/(.+)/,"$1 Secure "+k],p],[/\bfocus\/([\w\.]+)/i],[p,[l,L+" Focus"]],[/\bopt\/([\w\.]+)/i],[p,[l,A+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[l,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[l,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[l,A+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[l,"MIUI "+k]],[/fxios\/([-\w\.]+)/i],[p,[l,L]],[/\bqihu|(qi?ho?o?|360)browser/i],[[l,"360 "+k]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[l,/(.+)/,"$1 "+k],p],[/(comodo_dragon)\/([\w\.]+)/i],[[l,/_/g," "],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[l,p],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[l],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[l,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],[l,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[l,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[p,[l,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[l,x+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[l,x+" WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[l,"Android "+k]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[l,p],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[p,[l,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[p,l],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[l,[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],[l,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[l,"Netscape"],p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[l,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],[l,p],[/(cobalt)\/([\w\.]+)/i],[l,[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],[c,[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],[c,[f,M],[d,v]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[c,[f,T],[d,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[c,[f,T],[d,h]],[/(macintosh);/i],[c,[f,T]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[c,[f,D],[d,v]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[c,[f,C],[d,h]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[c,[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],[[c,/_/g," "],[f,R],[d,v]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[c,/_/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],[c,[f,"OPPO"],[d,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[c,[f,"Vivo"],[d,v]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[c,[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],[c,[f,N],[d,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[c,[f,N],[d,h]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[c,[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],[c,[f,P],[d,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[c,[f,"Lenovo"],[d,h]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[c,/_/g," "],[f,"Nokia"],[d,v]],[/(pixel c)\b/i],[c,[f,O],[d,h]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[c,[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],[c,[f,j],[d,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[c,"Xperia Tablet"],[f,j],[d,h]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[c,[f,"OnePlus"],[d,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[c,[f,S],[d,h]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[c,/(.+)/g,"Fire Phone $1"],[f,S],[d,v]],[/(playbook);[-\w\),; ]+(rim)/i],[c,f,[d,h]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[c,[f,I],[d,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[c,[f,E],[d,h]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[c,[f,E],[d,v]],[/(nexus 9)/i],[c,[f,"HTC"],[d,h]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[f,[c,/_/g," "],[d,v]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[c,[f,"Acer"],[d,h]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[c,[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,c,[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,c,[d,h]],[/(surface duo)/i],[c,[f,_],[d,h]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[c,[f,"Fairphone"],[d,v]],[/(u304aa)/i],[c,[f,"AT&T"],[d,v]],[/\bsie-(\w*)/i],[c,[f,"Siemens"],[d,v]],[/\b(rct\w+) b/i],[c,[f,"RCA"],[d,h]],[/\b(venue[\d ]{2,7}) b/i],[c,[f,"Dell"],[d,h]],[/\b(q(?:mv|ta)\w+) b/i],[c,[f,"Verizon"],[d,h]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[c,[f,"Barnes & Noble"],[d,h]],[/\b(tm\d{3}\w+) b/i],[c,[f,"NuVision"],[d,h]],[/\b(k88) b/i],[c,[f,"ZTE"],[d,h]],[/\b(nx\d{3}j) b/i],[c,[f,"ZTE"],[d,v]],[/\b(gen\d{3}) b.+49h/i],[c,[f,"Swiss"],[d,v]],[/\b(zur\d{3}) b/i],[c,[f,"Swiss"],[d,h]],[/\b((zeki)?tb.*\b) b/i],[c,[f,"Zeki"],[d,h]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[f,"Dragon Touch"],c,[d,h]],[/\b(ns-?\w{0,9}) b/i],[c,[f,"Insignia"],[d,h]],[/\b((nxa|next)-?\w{0,9}) b/i],[c,[f,"NextBook"],[d,h]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[f,"Voice"],c,[d,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[f,"LvTel"],c,[d,v]],[/\b(ph-1) /i],[c,[f,"Essential"],[d,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[c,[f,"Envizen"],[d,h]],[/\b(trio[-\w\. ]+) b/i],[c,[f,"MachSpeed"],[d,h]],[/\btu_(1491) b/i],[c,[f,"Rotor"],[d,h]],[/(shield[\w ]+) b/i],[c,[f,"Nvidia"],[d,h]],[/(sprint) (\w+)/i],[f,c,[d,v]],[/(kin\.[onetw]{3})/i],[[c,/\./g," "],[f,_],[d,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[c,[f,B],[d,h]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[c,[f,B],[d,v]],[/smart-tv.+(samsung)/i],[f,[d,b]],[/hbbtv.+maple;(\d+)/i],[[c,/^/,"SmartTV"],[f,M],[d,b]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[f,P],[d,b]],[/(apple) ?tv/i],[f,[c,T+" TV"],[d,b]],[/crkey/i],[[c,x+"cast"],[f,O],[d,b]],[/droid.+aft(\w+)( bui|\))/i],[c,[f,S],[d,b]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[c,[f,D],[d,b]],[/(bravia[\w ]+)( bui|\))/i],[c,[f,j],[d,b]],[/(mitv-\w{5}) bui/i],[c,[f,R],[d,b]],[/Hbbtv.*(technisat) (.*);/i],[f,c,[d,b]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[f,G],[c,G],[d,b]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,b]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[f,c,[d,g]],[/droid.+; (shield) bui/i],[c,[f,"Nvidia"],[d,g]],[/(playstation [345portablevi]+)/i],[c,[f,j],[d,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[c,[f,_],[d,g]],[/((pebble))app/i],[f,c,[d,w]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[c,[f,T],[d,w]],[/droid.+; (glass) \d/i],[c,[f,O],[d,w]],[/droid.+; (wt63?0{2,3})\)/i],[c,[f,B],[d,w]],[/(quest( 2| pro)?)/i],[c,[f,U],[d,w]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[f,[d,y]],[/(aeobc)\b/i],[c,[f,S],[d,y]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[c,[d,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[c,[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],[c,[f,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[l,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[l,"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],[l,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,l]],os:[[/microsoft (windows) (vista|xp)/i],[l,p],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[l,[p,H,K]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[l,"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,"."],[l,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[l,z],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[p,l],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[l,p],[/\(bb(10);/i],[p,[l,I]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[l,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[l,L+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[l,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[p,[l,"watchOS"]],[/crkey\/([\d\.]+)/i],[p,[l,x+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[l,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],[l,p],[/(sunos) ?([\w\.\d]*)/i],[[l,"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],[l,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[l]=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[l]="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[c]=i,e[d]=i,W.call(e,b,y.device),S&&!e[d]&&w&&w.mobile&&(e[d]=v),S&&"Macintosh"==e[c]&&g&&typeof g.standalone!==o&&g.maxTouchPoints&&g.maxTouchPoints>2&&(e[c]="iPad",e[d]=h),e},this.getEngine=function(){var e={};return e[l]=i,e[p]=i,W.call(e,b,y.engine),e},this.getOS=function(){var e={};return e[l]=i,e[p]=i,W.call(e,b,y.os),S&&!e[l]&&w&&"Unknown"!=w.platform&&(e[l]=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([l,p,u]),J.CPU=V([m]),J.DEVICE=V([c,f,d,g,v,b,h,w,y]),J.ENGINE=J.OS=V([l,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:ge)}(ve,ve.exports);var he=ve.exports;const be=()=>{const e=new he.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:me,version:null!=n?n:me,os:`${null!=i?i:me} ${null!=r?r:me}`,userAgent:null!=o?o:me,language:null!=s?s:me,mobile:a,brands:null!=u?u:me,viewportWidth:`${window.innerWidth}`,viewportHeight:`${window.innerHeight}`}}},we=()=>({page:{url:location.href}}),ye=[be,we];function Se(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 Te={session:"sessionStorage",local:"localStorage"};function Ee(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 Ie(e,t){return Ce(t)?window[t].getItem(e):null}function ke(e,t,n){if(Ce(n))try{window[n].setItem(e,t)}catch(e){}}function xe(e,t){Ce(t)&&window[t].removeItem(e)}const Le=Ee(Te.local),Oe=Ee(Te.session);function Ce(e){return e===Te.local?Le:e===Te.session&&Oe}function Pe(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 _e(){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 Ne="com.grafana.faro.session",Ae=144e5,Me=9e5,De=Me,je={enabled:!0,persistent:!1,maxSessionPersistenceTime:De};function Re({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 Be(e){if(null==e)return!1;const t=S();if(!(t-e.started<Ae))return!1;return t-e.lastActivity<Me}function Ue({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&&!Le||!u&&!Oe)return;const c=t();if(!1===i&&Be(c))n(Object.assign(Object.assign({},c),{lastActivity:S()}));else{let t=Fe(Re({isSampled:_e()}),c);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==c?void 0:c.sessionMeta)&&void 0!==s?s:null,t.sessionMeta)}}}function Fe(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 ze{constructor(){this.updateSession=Pe((()=>this.updateUserSession()),1e3),this.updateUserSession=Ue({fetchUserSession:ze.fetchUserSession,storeUserSession:ze.storeUserSession}),this.init()}static removeUserSession(){xe(Ne,ze.storageTypeLocal)}static storeUserSession(e){ke(Ne,JSON.stringify(e),ze.storageTypeLocal)}static fetchUserSession(){const e=Ie(Ne,ze.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=ze.fetchUserSession();if(n&&n.id!==(null==i?void 0:i.sessionId)){const t=Fe(Re({sessionId:n.id,isSampled:_e()}),i);ze.storeUserSession(t),e.faro.api.setSession(t.sessionMeta)}}))}}ze.storageTypeLocal=Te.local;class Ve{constructor(){this.updateSession=Pe((()=>this.updateUserSession()),1e3),this.updateUserSession=Ue({fetchUserSession:Ve.fetchUserSession,storeUserSession:Ve.storeUserSession}),this.init()}static removeUserSession(){xe(Ne,Ve.storageTypeSession)}static storeUserSession(e){ke(Ne,JSON.stringify(e),Ve.storageTypeSession)}static fetchUserSession(){const e=Ie(Ne,Ve.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=Ve.fetchUserSession();if(n&&n.id!==(null==i?void 0:i.sessionId)){const t=Fe(Re({sessionId:n.id,isSampled:_e()}),i);Ve.storeUserSession(t),e.faro.api.setSession(t.sessionMeta)}}))}}function $e(e){return(null==e?void 0:e.persistent)?ze:Ve}Ve.storageTypeSession=Te.session;class qe extends te{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-session",this.version=ne}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(pe,{},void 0,{skipDedupe:!0}),void(this.notifiedSession=i);this.notifiedSession=i,this.api.pushEvent(de,{},void 0,{skipDedupe:!0})}}createInitialSession(e,t){var n,i,r,o,s;let a,u,c=e.fetchUserSession();if(t.persistent&&t.maxSessionPersistenceTime&&c){const e=S();c.lastActivity<e-t.maxSessionPersistenceTime&&(ze.removeUserSession(),c=null)}if(Be(c)){const e=null==c?void 0:c.sessionId;u=Re({sessionId:e,isSampled:c.isSampled||!1,started:null==c?void 0:c.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==c?void 0:c.sessionMeta)||void 0===i?void 0:i.attributes),{isSampled:u.isSampled.toString()})},a=fe}else{const e=null!==(o=null===(r=t.session)||void 0===r?void 0:r.id)&&void 0!==o?o:Se().id;u=Re({sessionId:e,isSampled:_e()}),u.sessionMeta={id:e,attributes:Object.assign({isSampled:u.isSampled.toString()},null===(s=t.session)||void 0===s?void 0:s.attributes)},a=de}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=$e(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===de&&this.api.pushEvent(de,{},void 0,{skipDedupe:!0}),i===fe&&this.api.pushEvent(fe,{},void 0,{skipDedupe:!0})}this.metas.addListener(this.sendSessionStartEvent.bind(this))}}class Ge extends te{constructor(e={}){super(),this.options=e,this.name="@grafana/faro-web-sdk:instrumentation-console",this.version=ne}initialize(){this.logDebug("Initializing\n",this.options),x.filter((e=>{var t;return!(null!==(t=this.options.disabledLevels)&&void 0!==t?t:Ge.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)}}}))}}Ge.defaultDisabledLevels=[e.LogLevel.DEBUG,e.LogLevel.TRACE,e.LogLevel.LOG];const We="DOMError",He="DOMException",Ke="Non-Error exception captured with keys:",Xe=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Je="\n",Ze="eval",Ye="?",Qe="@",et=/^\s*at (?:(.*\).*?|.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tt=/\((\S*)(?::(\d+))(?::(\d+))\)/,nt="eval",it="address at ",rt=it.length,ot=/^\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,st=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,at=" > eval",ut="safari-extension",ct="safari-web-extension",lt=/Minified React error #\d+;/i;function dt(e,t,n,i){const r={filename:e||document.location.href,function:t||Ye};return void 0!==n&&(r.lineno=n),void 0!==i&&(r.colno=i),r}function ft(e,t){const n=null==e?void 0:e.includes(ut),i=!n&&(null==e?void 0:e.includes(ct));return n||i?[(null==e?void 0:e.includes(Qe))?e.split(Qe)[0]:e,n?`${ut}:${t}`:`${ct}:${t}`]:[e,t]}function pt(e){let t=[];e.stacktrace?t=e.stacktrace.split(Je).filter(((e,t)=>t%2==0)):e.stack&&(t=e.stack.split(Je));const n=t.reduce(((t,n,i)=>{let r,o,a,u,c;if(r=et.exec(n)){if(o=r[1],a=r[2],u=r[3],c=r[4],null==a?void 0:a.startsWith(nt)){const e=tt.exec(a);e&&(a=e[1],u=e[2],c=e[3])}a=(null==a?void 0:a.startsWith(it))?a.substring(rt):a,[o,a]=ft(o,a)}else if(r=ot.exec(n)){if(o=r[1],a=r[3],u=r[4],c=r[5],a&&a.includes(at)){const e=st.exec(a);e&&(o=o||Ze,a=e[1],u=e[2])}else 0===i&&!c&&s(e.columnNumber)&&(c=String(e.columnNumber+1));[o,a]=ft(o,a)}return(a||o)&&t.push(dt(a,o,u?Number(u):void 0,c?Number(c):void 0)),t}),[]);return lt.test(e.message)?n.slice(1):n}function mt(e){return{frames:pt(e)}}function gt(e){let t,n,i,r,o=[];if(g(e)&&e.error)t=e.error.message,n=e.error.name,o=pt(e.error);else if((i=v(e))||h(e)){const{name:r,message:o}=e;n=null!=r?r:i?We:He,t=o?`${n}: ${o}`:n}else m(e)?(t=e.message,o=pt(e)):(a(e)||(r=f(e)))&&(n=r?e.constructor.name:void 0,t=`${Ke} ${Object.keys(e)}`);return[t,n,o]}function vt(e){const t=window.onerror;window.onerror=(...n)=>{try{const[t,i,r,s,a]=n;let u,c,l=[];const d=o(t),f=dt(i,"?",r,s);a||!d?([u,c,l]=gt(null!=a?a:t),0===l.length&&(l=[f])):d&&([u,c]=function(e){var t,n;const i=e.match(Xe),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),l=[f]),u&&e.pushError(new Error(u),{type:c,stackFrames:l})}finally{null==t||t.apply(window,n)}}}class ht extends te{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-errors",this.version=ne}initialize(){var e;this.logDebug("Initializing"),vt(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=[];l(s)?(r=`Non-Error promise rejection captured with value: ${String(s)}`,o="UnhandledRejection"):[r,o,a]=gt(s),r&&e.pushError(new Error(r),{type:o,stackFrames:a})}))}}class bt extends te{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-view",this.version=ne}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:me,toView:null!==(r=o.name)&&void 0!==r?r:me},void 0,{skipDedupe:!0}),this.notifiedView=o)}initialize(){this.metas.addListener(this.sendViewChangedEvent.bind(this))}}var wt,yt,St,Tt,Et,It=-1,kt=function(e){addEventListener("pageshow",(function(t){t.persisted&&(It=t.timeStamp,e(t))}),!0)},xt=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Lt=function(){var e=xt();return e&&e.activationStart||0},Ot=function(e,t){var n=xt(),i="navigate";return It>=0?i="back-forward-cache":n&&(document.prerendering||Lt()>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}},Ct=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){}},Pt=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))}},_t=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Nt=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},At=function(e){var t=!1;return function(){t||(e(),t=!0)}},Mt=-1,Dt=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},jt=function(e){"hidden"===document.visibilityState&&Mt>-1&&(Mt="visibilitychange"===e.type?e.timeStamp:0,Bt())},Rt=function(){addEventListener("visibilitychange",jt,!0),addEventListener("prerenderingchange",jt,!0)},Bt=function(){removeEventListener("visibilitychange",jt,!0),removeEventListener("prerenderingchange",jt,!0)},Ut=function(){return Mt<0&&(Mt=Dt(),Rt(),kt((function(){setTimeout((function(){Mt=Dt(),Rt()}),0)}))),{get firstHiddenTime(){return Mt}}},Ft=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},zt=[1800,3e3],Vt=function(e,t){t=t||{},Ft((function(){var n,i=Ut(),r=Ot("FCP"),o=Ct("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-Lt(),0),r.entries.push(e),n(!0)))}))}));o&&(n=Pt(e,r,zt,t.reportAllChanges),kt((function(i){r=Ot("FCP"),n=Pt(e,r,zt,t.reportAllChanges),_t((function(){r.value=performance.now()-i.timeStamp,n(!0)}))})))}))},$t=[.1,.25],qt=0,Gt=1/0,Wt=0,Ht=function(e){e.forEach((function(e){e.interactionId&&(Gt=Math.min(Gt,e.interactionId),Wt=Math.max(Wt,e.interactionId),qt=Wt?(Wt-Gt)/7+1:0)}))},Kt=[],Xt=new Map,Jt=0,Zt=[],Yt=function(e){if(Zt.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=Kt[Kt.length-1],n=Xt.get(e.interactionId);if(n||Kt.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]};Xt.set(i.id,i),Kt.push(i)}Kt.sort((function(e,t){return t.latency-e.latency})),Kt.length>10&&Kt.splice(10).forEach((function(e){return Xt.delete(e.id)}))}}},Qt=[200,500],en=[2500,4e3],tn={},nn=[800,1800],rn=function e(t){document.prerendering?Ft((function(){return e(t)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},on={passive:!0,capture:!0},sn=new Date,an=function(e,t){yt||(yt=t,St=e,Tt=new Date,ln(removeEventListener),un())},un=function(){if(St>=0&&St<Tt-sn){var e={entryType:"first-input",name:yt.type,target:yt.target,cancelable:yt.cancelable,startTime:yt.timeStamp,processingStart:yt.timeStamp+St};Et.forEach((function(t){t(e)})),Et=[]}},cn=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(){an(e,t),r()},i=function(){r()},r=function(){removeEventListener("pointerup",n,on),removeEventListener("pointercancel",i,on)};addEventListener("pointerup",n,on),addEventListener("pointercancel",i,on)}(t,e):an(t,e)}},ln=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,cn,on)}))},dn=[100,300];class fn{constructor(e){this.pushMeasurement=e}initialize(){Object.entries(fn.mapping).forEach((([e,t])=>{t((t=>{this.pushMeasurement({type:"web-vitals",values:{[e]:t.value}})}))}))}}fn.mapping={cls:function(e,t){t=t||{},Vt(At((function(){var n,i=Ot("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=Ct("layout-shift",s);a&&(n=Pt(e,i,$t,t.reportAllChanges),Nt((function(){s(a.takeRecords()),n(!0)})),kt((function(){r=0,i=Ot("CLS",0),n=Pt(e,i,$t,t.reportAllChanges),_t((function(){return n()}))})),setTimeout(n,0))})))},fcp:Vt,fid:function(e,t){t=t||{},Ft((function(){var n,i=Ut(),r=Ot("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=Ct("first-input",s);n=Pt(e,r,dn,t.reportAllChanges),a&&(Nt(At((function(){s(a.takeRecords()),a.disconnect()}))),kt((function(){var i;r=Ot("FID"),n=Pt(e,r,dn,t.reportAllChanges),Et=[],St=-1,yt=null,ln(addEventListener),i=o,Et.push(i),un()})))}))},inp:function(e,t){t=t||{},Ft((function(){var n;"interactionCount"in performance||wt||(wt=Ct("event",Ht,{type:"event",buffered:!0,durationThreshold:0}));var i,r=Ot("INP"),o=function(e){e.forEach(Yt);var t,n=(t=Math.min(Kt.length-1,Math.floor(((wt?qt:performance.interactionCount||0)-Jt)/50)),Kt[t]);n&&n.latency!==r.value&&(r.value=n.latency,r.entries=n.entries,i())},s=Ct("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});i=Pt(e,r,Qt,t.reportAllChanges),s&&("PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&s.observe({type:"first-input",buffered:!0}),Nt((function(){o(s.takeRecords()),i(!0)})),kt((function(){Jt=0,Kt.length=0,Xt.clear(),r=Ot("INP"),i=Pt(e,r,Qt,t.reportAllChanges)})))}))},lcp:function(e,t){t=t||{},Ft((function(){var n,i=Ut(),r=Ot("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-Lt(),0),r.entries=[e],n())}))},s=Ct("largest-contentful-paint",o);if(s){n=Pt(e,r,en,t.reportAllChanges);var a=At((function(){tn[r.id]||(o(s.takeRecords()),s.disconnect(),tn[r.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return e=a,t=self.requestIdleCallback||self.setTimeout,n=-1,e=At(e),"hidden"===document.visibilityState?e():(n=t(e),Nt(e)),n;var e,t,n}),!0)})),Nt(a),kt((function(i){r=Ot("LCP"),n=Pt(e,r,en,t.reportAllChanges),_t((function(){r.value=performance.now()-i.timeStamp,tn[r.id]=!0,n(!0)}))}))}}))},ttfb:function(e,t){t=t||{};var n=Ot("TTFB"),i=Pt(e,n,nn,t.reportAllChanges);rn((function(){var r=xt();r&&(n.value=Math.max(r.responseStart-Lt(),0),n.entries=[r],i(!0),kt((function(){n=Ot("TTFB",0),(i=Pt(e,n,nn,t.reportAllChanges))(!0)})))}))}};var pn,mn,gn=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},vn=function(e){if("loading"===document.readyState)return"loading";var t=gn();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"},hn=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},bn=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var i=e,r=i.id?"#"+i.id:hn(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},wn=-1,yn=function(){return wn},Sn=function(e){addEventListener("pageshow",(function(t){t.persisted&&(wn=t.timeStamp,e(t))}),!0)},Tn=function(){var e=gn();return e&&e.activationStart||0},En=function(e,t){var n=gn(),i="navigate";return yn()>=0?i="back-forward-cache":n&&(document.prerendering||Tn()>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}},In=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){}},kn=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))}},xn=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Ln=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},On=function(e){var t=!1;return function(){t||(e(),t=!0)}},Cn=-1,Pn=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},_n=function(e){"hidden"===document.visibilityState&&Cn>-1&&(Cn="visibilitychange"===e.type?e.timeStamp:0,An())},Nn=function(){addEventListener("visibilitychange",_n,!0),addEventListener("prerenderingchange",_n,!0)},An=function(){removeEventListener("visibilitychange",_n,!0),removeEventListener("prerenderingchange",_n,!0)},Mn=function(){return Cn<0&&(Cn=Pn(),Nn(),Sn((function(){setTimeout((function(){Cn=Pn(),Nn()}),0)}))),{get firstHiddenTime(){return Cn}}},Dn=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},jn=[1800,3e3],Rn=function(e,t){t=t||{},Dn((function(){var n,i=Mn(),r=En("FCP"),o=In("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-Tn(),0),r.entries.push(e),n(!0)))}))}));o&&(n=kn(e,r,jn,t.reportAllChanges),Sn((function(i){r=En("FCP"),n=kn(e,r,jn,t.reportAllChanges),xn((function(){r.value=performance.now()-i.timeStamp,n(!0)}))})))}))},Bn=[.1,.25],Un=0,Fn=1/0,zn=0,Vn=function(e){e.forEach((function(e){e.interactionId&&(Fn=Math.min(Fn,e.interactionId),zn=Math.max(zn,e.interactionId),Un=zn?(zn-Fn)/7+1:0)}))},$n=function(){"interactionCount"in performance||pn||(pn=In("event",Vn,{type:"event",buffered:!0,durationThreshold:0}))},qn=[],Gn=new Map,Wn=0,Hn=function(){return(pn?Un:performance.interactionCount||0)-Wn},Kn=[],Xn=function(e){if(Kn.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=qn[qn.length-1],n=Gn.get(e.interactionId);if(n||qn.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]};Gn.set(i.id,i),qn.push(i)}qn.sort((function(e,t){return t.latency-e.latency})),qn.length>10&&qn.splice(10).forEach((function(e){return Gn.delete(e.id)}))}}},Jn=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=On(e),"hidden"===document.visibilityState?e():(n=t(e),Ln(e)),n},Zn=[200,500],Yn=[],Qn=new Map,ei=[],ti=new WeakMap,ni=new Map,ii=-1,ri=function(e){e.forEach((function(e){return Yn.push(e)}))},oi=function(){ni.size>10&&ni.forEach((function(e,t){Gn.has(t)||ni.delete(t)})),ei=ei.slice(-50);var e=new Set(ei.concat(qn.map((function(e){return ti.get(e.entries[0])}))));Qn.forEach((function(t,n){e.has(n)||Qn.delete(n)}));var t=new Set;Qn.forEach((function(e){li(e.startTime,e.processingEnd).forEach((function(e){t.add(e)}))})),Yn=Array.from(t),ii=-1};Kn.push((function(e){e.interactionId&&e.target&&!ni.has(e.interactionId)&&ni.set(e.interactionId,e.target)}),(function(e){for(var t,n=e.startTime+e.duration,i=ei.length-1;i>=0;i--)if(t=ei[i],Math.abs(n-t)<=8){var r=Qn.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&&(ei.push(n),Qn.set(n,{startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,entries:[e]})),(e.interactionId||"first-input"===e.entryType)&&ti.set(e,n)}),(function(){ii<0&&(ii=Jn(oi))}));var si,ai,ui,ci,li=function(e,t){for(var n,i=[],r=0;n=Yn[r];r++)if(!(n.startTime+n.duration<e)){if(n.startTime>t)break;i.push(n)}return i},di=function(e,t){mn||(mn=In("long-animation-frame",ri)),function(e,t){t=t||{},Dn((function(){var n;$n();var i,r=En("INP"),o=function(e){e.forEach(Xn);var t,n=(t=Math.min(qn.length-1,Math.floor(Hn()/50)),qn[t]);n&&n.latency!==r.value&&(r.value=n.latency,r.entries=n.entries,i())},s=In("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});i=kn(e,r,Zn,t.reportAllChanges),s&&("PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&s.observe({type:"first-input",buffered:!0}),Ln((function(){o(s.takeRecords()),i(!0)})),Sn((function(){Wn=0,qn.length=0,Gn.clear(),r=En("INP"),i=kn(e,r,Zn,t.reportAllChanges)})))}))}((function(t){Jn((function(){var n=function(e){var t=e.entries[0],n=ti.get(t),i=Qn.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})),c=u&&u.target||ni.get(t.interactionId),l=[t.startTime+t.duration,o].concat(a.map((function(e){return e.startTime+e.duration}))),d=Math.max.apply(Math,l),f={interactionTarget:bn(c),interactionTargetElement:c,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:vn(t.startTime)};return Object.assign(e,{attribution:f})}(t);e(n)}))}),t)},fi=[2500,4e3],pi={},mi=[800,1800],gi=function e(t){document.prerendering?Dn((function(){return e(t)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},vi=function(e,t){t=t||{};var n=En("TTFB"),i=kn(e,n,mi,t.reportAllChanges);gi((function(){var r=gn();r&&(n.value=Math.max(r.responseStart-Tn(),0),n.entries=[r],i(!0),Sn((function(){n=En("TTFB",0),(i=kn(e,n,mi,t.reportAllChanges))(!0)})))}))},hi={passive:!0,capture:!0},bi=new Date,wi=function(e,t){si||(si=t,ai=e,ui=new Date,Ti(removeEventListener),yi())},yi=function(){if(ai>=0&&ai<ui-bi){var e={entryType:"first-input",name:si.type,target:si.target,cancelable:si.cancelable,startTime:si.timeStamp,processingStart:si.timeStamp+ai};ci.forEach((function(t){t(e)})),ci=[]}},Si=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(){wi(e,t),r()},i=function(){r()},r=function(){removeEventListener("pointerup",n,hi),removeEventListener("pointercancel",i,hi)};addEventListener("pointerup",n,hi),addEventListener("pointercancel",i,hi)}(t,e):wi(t,e)}},Ti=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,Si,hi)}))},Ei=[100,300],Ii=function(e,t){!function(e,t){t=t||{},Dn((function(){var n,i=Mn(),r=En("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=In("first-input",s);n=kn(e,r,Ei,t.reportAllChanges),a&&(Ln(On((function(){s(a.takeRecords()),a.disconnect()}))),Sn((function(){var i;r=En("FID"),n=kn(e,r,Ei,t.reportAllChanges),ci=[],ai=-1,si=null,Ti(addEventListener),i=o,ci.push(i),yi()})))}))}((function(t){var n=function(e){var t=e.entries[0],n={eventTarget:bn(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:vn(t.startTime)};return Object.assign(e,{attribution:n})}(t);e(n)}),t)};const ki="com.grafana.faro.lastNavigationId",xi="load_state",Li="time_to_first_byte";class Oi{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||{},Rn(On((function(){var n,i=En("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=In("layout-shift",s);a&&(n=kn(e,i,Bn,t.reportAllChanges),Ln((function(){s(a.takeRecords()),n(!0)})),Sn((function(){r=0,i=En("CLS",0),n=kn(e,i,Bn,t.reportAllChanges),xn((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:bn(r.node),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:r,largestShiftEntry:i,loadState:vn(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,xi,t),this.addIfPresent(s,"largest_shift_target",r),this.pushMeasurement(o,s)}))}measureFCP(){!function(e,t){Rn((function(t){var n=function(e){var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:vn(yn())};if(e.entries.length){var n=gn(),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:vn(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,Li,n);const o=this.buildInitialContext(e);this.addIfPresent(o,xi,i),this.pushMeasurement(r,o)}))}measureFID(){Ii((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,xi,r),this.pushMeasurement(o,s)}))}measureINP(){di((e=>{const{interactionTime:t,presentationDelay:n,inputDelay:i,processingDuration:r,nextPaintTime:o,loadState:s,interactionTarget:a,interactionType:u}=e.attribution,c=this.buildInitialValues(e);this.addIfPresent(c,"interaction_time",t),this.addIfPresent(c,"presentation_delay",n),this.addIfPresent(c,"input_delay",i),this.addIfPresent(c,"processing_duration",r),this.addIfPresent(c,"next_paint_time",o);const l=this.buildInitialContext(e);this.addIfPresent(l,xi,s),this.addIfPresent(l,"interaction_target",a),this.addIfPresent(l,"interaction_type",u),this.pushMeasurement(c,l)}))}measureLCP(){!function(e,t){!function(e,t){t=t||{},Dn((function(){var n,i=Mn(),r=En("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-Tn(),0),r.entries=[e],n())}))},s=In("largest-contentful-paint",o);if(s){n=kn(e,r,fi,t.reportAllChanges);var a=On((function(){pi[r.id]||(o(s.takeRecords()),s.disconnect(),pi[r.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return Jn(a)}),!0)})),Ln(a),Sn((function(i){r=En("LCP"),n=kn(e,r,fi,t.reportAllChanges),xn((function(){r.value=performance.now()-i.timeStamp,pi[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=gn();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),c=Math.max(u,r.startTime-i);t={element:bn(r.element),timeToFirstByte:s,resourceLoadDelay:a-s,resourceLoadDuration:u-a,elementRenderDelay:c-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,Li,r);const a=this.buildInitialContext(e);this.addIfPresent(a,"element",o),this.pushMeasurement(s,a)}))}measureTTFB(){!function(e,t){vi((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=Ie(ki,Te.session))&&void 0!==t?t:me;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 Ci extends te{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-web-vitals",this.version=ne}initialize(){this.logDebug("Initializing");this.intializeWebVitalsInstrumentation().initialize()}intializeWebVitalsInstrumentation(){return this.config.trackWebVitalsAttribution?new Oi(this.api.pushMeasurement):new fn(this.api.pushMeasurement)}}function Pi(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 _i=/^00-[a-f0-9]{32}-[a-f0-9]{16}-[0-9]{1,2}$/;function Ni(e=[]){for(const t of e)if("traceparent"===t.name){if(!_i.test(t.description))continue;const[,e,n]=t.description.split("-");if(null!=e&&null!=n)return{traceId:e,spanId:n};break}}function Ai(e=[],t){return e.some((e=>e&&null!=t.match(e)))}function Mi(e,t={}){for(const[n,i]of Object.entries(t)){const t=e[n];return null!=t&&(c(i)?i.includes(t):t===i)}return!0}function Di(e){const{connectEnd:t,connectStart:n,decodedBodySize:i,domainLookupEnd:r,domainLookupStart:o,duration:s,encodedBodySize:a,fetchStart:u,initiatorType:c,name:l,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:l,duration:Ri(s),tcpHandshakeTime:Ri(t-n),dnsLookupTime:Ri(r-o),tlsNegotiationTime:Ri(g-w),responseStatus:Ri(b),redirectTime:Ri(f-p),requestTime:Ri(h-g),responseTime:Ri(v-h),fetchTime:Ri(v-u),serviceWorkerTime:Ri(u-S),decodedBodySize:Ri(i),encodedBodySize:Ri(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:Ri(m),protocol:d,initiatorType:c}}function ji(e){const{activationStart:t,domComplete:n,domContentLoadedEventEnd:i,domContentLoadedEventStart:r,domInteractive:o,fetchStart:s,loadEventEnd:a,loadEventStart:u,responseStart:c,type:l}=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:Ri(n-s),documentParsingTime:Ri(d?o-d:null),domProcessingTime:Ri(n-o),domContentLoadHandlerTime:Ri(i-r),onLoadTime:Ri(a-u),ttfb:Ri(Math.max(c-(null!=t?t:0),0)),type:l},Di(e))}function Ri(e){return null==e?me:"number"==typeof e?Math.round(e).toString():e.toString()}const Bi={initiatorType:["xmlhttprequest","fetch"]};class Ui extends te{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-performance",this.version=ne}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)}}((()=>Pi(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||Ai(t,o.name))return;const s=o.toJSON();let a=Ni(null==s?void 0:s.serverTiming);const u=null!==(r=Ie(ki,Te.session))&&void 0!==r?r:me,c=Object.assign(Object.assign({},ji(s)),{faroNavigationId:P(),faroPreviousNavigationId:u});ke(ki,c.faroNavigationId,Te.session),e("faro.performance.navigation",c,void 0,{spanContext:a,timestampOverwriteMs:performance.timeOrigin+s.startTime}),n(c)})).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(Ai(i,e.name))return;const o=e.toJSON();let s=Ni(null==o?void 0:o.serverTiming);if(null==r&&Mi(o,Bi)||r){const e=Object.assign(Object.assign({},Di(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 Fi(e={}){const t=[new ht,new Ci,new qe,new bt];return!1!==e.enablePerformanceInstrumentation&&t.unshift(new Ui),!1!==e.captureConsole&&t.push(new Ge({disabledLevels:e.captureConsoleDisabledLevels})),t}const zi="browser",Vi=()=>{const e=window.k6;return{k6:Object.assign({isK6Browser:!0},(null==e?void 0:e.testRunId)&&{testRunId:null==e?void 0:e.testRunId})}};class $i extends H{constructor(e){var t,n,i,r;super(),this.options=e,this.name="@grafana/faro-web-sdk:transport-fetch",this.version=ne,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 Pi(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 c=this.metas.value.session;return null!=c&&(u=c.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=>Pi(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}=$e(i);Ue({fetchUserSession:e,storeUserSession:r})({forceSessionExtend:!0}),t(`${n} created new session.`)}else t(`${n}.`)}}function qi(e){var t,n,i,r,o,s,u,c,l,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 $i({url:e.url,apiKey:e.apiKey})):p.error('either "url" or "transports" must be defined');return{app:e.app,batching:Object.assign(Object.assign({},ce),e.batching),dedupe:null===(t=e.dedupe)||void 0===t||t,globalObjectKey:e.globalObjectKey||ue,instrumentations:null!==(n=e.instrumentations)&&void 0!==n?n:Fi(),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:Q,metas:function(){const t=ye;return e.metas&&t.push(...e.metas),a(window.k6)?[...t,Vi]:t}(),parseStacktrace:mt,paused:null!==(s=e.paused)&&void 0!==s&&s,preventGlobalExposure:null!==(u=e.preventGlobalExposure)&&void 0!==u&&u,transports:f,unpatchedConsole:null!==(c=e.unpatchedConsole)&&void 0!==c?c:F,beforeSend:e.beforeSend,eventDomain:null!==(l=e.eventDomain)&&void 0!==l?l:zi,ignoreErrors:e.ignoreErrors,ignoreUrls:(null!==(d=e.ignoreUrls)&&void 0!==d?d:[]).concat([/\/collect(?:\/[\w]*)?$/]),sessionTracking:Object.assign(Object.assign({},je),e.sessionTracking),user:e.user,view:e.view,trackResources:e.trackResources,trackWebVitalsAttribution:e.trackWebVitalsAttribution}}return e.BaseExtension=W,e.BaseInstrumentation=te,e.BaseTransport=H,e.ConsoleInstrumentation=Ge,e.ConsoleTransport=class extends H{constructor(e={}){super(),this.options=e,this.name="@grafana/faro-web-sdk:transport-console",this.version=ne}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=pe,e.EVENT_SESSION_RESUME=fe,e.EVENT_SESSION_START=de,e.EVENT_VIEW_CHANGED=le,e.ErrorsInstrumentation=ht,e.FetchTransport=$i,e.MAX_SESSION_PERSISTENCE_TIME=De,e.MAX_SESSION_PERSISTENCE_TIME_BUFFER=6e4,e.PerformanceInstrumentation=Ui,e.PersistentSessionsManager=ze,e.SESSION_EXPIRATION_TIME=Ae,e.SESSION_INACTIVITY_TIME=Me,e.STORAGE_KEY=Ne,e.SessionInstrumentation=qe,e.VERSION=ne,e.ViewInstrumentation=bt,e.VolatileSessionsManager=Ve,e.WebVitalsInstrumentation=Ci,e.allLogLevels=x,e.browserMeta=be,e.buildStackFrame=dt,e.createInternalLogger=$,e.createPromiseBuffer=O,e.createSession=Se,e.deepEqual=y,e.defaultEventDomain=zi,e.defaultExceptionType=J,e.defaultGlobalObjectKey=ue,e.defaultInternalLoggerLevel=U,e.defaultLogLevel=k,e.defaultMetas=ye,e.genShortID=P,e.getCurrentTimestamp=T,e.getDataFromSafariExtensions=ft,e.getInternalFaroFromGlobalObject=function(){return _[ie]},e.getStackFramesFromError=pt,e.getTransportBody=X,e.getWebInstrumentations=Fi,e.globalObject=_,e.initializeFaro=function(e){const t=qi(e);if(t)return ae(t)},e.internalGlobalObjectKey=ie,e.isArray=c,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=oe,e.isMap=e=>w&&i(e,Map),e.isMapDefined=w,e.isNull=r,e.isNumber=s,e.isObject=a,e.isPrimitive=l,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=qi,e.noop=L,e.pageMeta=we,e.parseStacktrace=mt,e.sdkMeta=()=>({sdk:{name:"@grafana/faro-core",version:ne,integrations:e.faro.config.instrumentations.map((({name:e,version:t})=>({name:e,version:t})))}}),e.setInternalFaroOnGlobalObject=re,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"),c=e=>n(e,"Array"),l=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=c(e),r=c(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},c=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 l;(null===(r=n.batching)||void 0===r?void 0:r.enabled)&&(l=new N(c,{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==l||l.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==l||l.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==l||l.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;function Y(e){let t=e.cause;return m(t)?t=e.cause.toString():null!==t&&(a(e.cause)||c(e.cause))?t=JSON.stringify(e.cause):null!=t&&(t=e.cause.toString()),null==t?{}:{cause:t}}const Q=e=>e.map((e=>{try{return String(e)}catch(e){return""}})).join(" ");function ee(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 c=null;Z=null!==(u=i.parseStacktrace)&&void 0!==u?u:Z;const l=e=>{n.debug("Changing stacktrace parser"),Z=null!=e?e:Z};return l(i.parseStacktrace),{changeStacktraceParser:l,getStacktraceParser:()=>Z,pushError:(t,{skipDedupe:u,stackFrames:l,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:Object.assign(Object.assign({},Y(t)),null!=f?f:{})},type:e.TransportItemType.EXCEPTION};(null==(l=null!=l?l:t.stack?null==Z?void 0:Z(t).frames:void 0)?void 0:l.length)&&(g.payload.stacktrace={frames:l});const v={type:g.payload.type,value:g.payload.value,stackTrace:g.payload.stacktrace,context:g.payload.context};u||!i.dedupe||r(c)||!y(v,c)?(c=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 c=null;const l=null!==(u=i.logArgsSerializer)&&void 0!==u?u:Q;return{pushLog:(t,{context:u,level:d,skipDedupe:f,spanContext:p,timestampOverwriteMs:m}={})=>{try{const g={type:e.TransportItemType.LOG,payload:{message:l(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(c)&&y(v,c))return void n.debug("Skipping log push because it is the same as the last one\n",g.payload);c=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:c,context:l,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!=l?l:{}}),meta:o.value},m={type:p.payload.type,values:p.payload.values,context:p.payload.context};if(!c&&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,c,l,{skipDedupe:d,spanContext:f,timestampOverwriteMs:p}={})=>{try{const m={meta:o.value,payload:{name:t,domain:null!=l?l:i.eventDomain,attributes:c,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 te extends W{constructor(){super(...arguments),this.api={},this.transports={}}}const ne="1.10.2";const ie="_faroInternal";function re(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(_,ie,{configurable:!1,enumerable:!1,writable:!1,value:e}))}function oe(){return ie in _}function se(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},re(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 ae(e){const t=V(e),n=G(t,e);if(oe()&&!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=ee(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=se(t,n,e,i,r,o,s);return function(e){var t,n;const i={sdk:{version:ne},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 ue="faro",ce={enabled:!0,sendTimeout:250,itemLimit:50},le="view_changed",de="session_start",fe="session_resume",pe="session_extend",me="unknown";var ge="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ve={exports:{}};!function(e,t){!function(n,i){var r="function",o="undefined",s="object",a="string",u="major",c="model",l="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,c,l,d=0;d<t.length&&!c;){var f=t[d],p=t[d+1];for(n=o=0;n<f.length&&!c&&f[n];)if(c=f[n++].exec(e))for(a=0;a<p.length;a++)l=c[++o],typeof(u=p[a])===s&&u.length>0?2===u.length?typeof u[1]==r?this[u[0]]=u[1].call(this,l):this[u[0]]=u[1]:3===u.length?typeof u[1]!==r||u[1].exec&&u[1].test?this[u[0]]=l?l.replace(u[1],u[2]):i:this[u[0]]=l?u[1].call(this,l,u[2]):i:4===u.length&&(this[u[0]]=l?u[3].call(this,l.replace(u[1],u[2])):i):this[u]=l||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,[l,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[l,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[l,p],[/opios[\/ ]+([\w\.]+)/i],[p,[l,A+" Mini"]],[/\bopr\/([\w\.]+)/i],[p,[l,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],[l,p],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[l,"UC"+k]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[p,[l,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[p,[l,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[l,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[l,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[p,[l,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[l,/(.+)/,"$1 Secure "+k],p],[/\bfocus\/([\w\.]+)/i],[p,[l,L+" Focus"]],[/\bopt\/([\w\.]+)/i],[p,[l,A+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[l,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[l,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[l,A+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[l,"MIUI "+k]],[/fxios\/([-\w\.]+)/i],[p,[l,L]],[/\bqihu|(qi?ho?o?|360)browser/i],[[l,"360 "+k]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[l,/(.+)/,"$1 "+k],p],[/(comodo_dragon)\/([\w\.]+)/i],[[l,/_/g," "],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[l,p],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[l],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[l,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],[l,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[l,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[p,[l,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[l,x+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[l,x+" WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[l,"Android "+k]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[l,p],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[p,[l,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[p,l],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[l,[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],[l,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[l,"Netscape"],p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[l,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],[l,p],[/(cobalt)\/([\w\.]+)/i],[l,[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],[c,[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],[c,[f,M],[d,v]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[c,[f,T],[d,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[c,[f,T],[d,h]],[/(macintosh);/i],[c,[f,T]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[c,[f,D],[d,v]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[c,[f,C],[d,h]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[c,[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],[[c,/_/g," "],[f,R],[d,v]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[c,/_/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],[c,[f,"OPPO"],[d,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[c,[f,"Vivo"],[d,v]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[c,[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],[c,[f,N],[d,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[c,[f,N],[d,h]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[c,[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],[c,[f,P],[d,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[c,[f,"Lenovo"],[d,h]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[c,/_/g," "],[f,"Nokia"],[d,v]],[/(pixel c)\b/i],[c,[f,O],[d,h]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[c,[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],[c,[f,j],[d,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[c,"Xperia Tablet"],[f,j],[d,h]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[c,[f,"OnePlus"],[d,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[c,[f,S],[d,h]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[c,/(.+)/g,"Fire Phone $1"],[f,S],[d,v]],[/(playbook);[-\w\),; ]+(rim)/i],[c,f,[d,h]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[c,[f,I],[d,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[c,[f,E],[d,h]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[c,[f,E],[d,v]],[/(nexus 9)/i],[c,[f,"HTC"],[d,h]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[f,[c,/_/g," "],[d,v]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[c,[f,"Acer"],[d,h]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[c,[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,c,[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,c,[d,h]],[/(surface duo)/i],[c,[f,_],[d,h]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[c,[f,"Fairphone"],[d,v]],[/(u304aa)/i],[c,[f,"AT&T"],[d,v]],[/\bsie-(\w*)/i],[c,[f,"Siemens"],[d,v]],[/\b(rct\w+) b/i],[c,[f,"RCA"],[d,h]],[/\b(venue[\d ]{2,7}) b/i],[c,[f,"Dell"],[d,h]],[/\b(q(?:mv|ta)\w+) b/i],[c,[f,"Verizon"],[d,h]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[c,[f,"Barnes & Noble"],[d,h]],[/\b(tm\d{3}\w+) b/i],[c,[f,"NuVision"],[d,h]],[/\b(k88) b/i],[c,[f,"ZTE"],[d,h]],[/\b(nx\d{3}j) b/i],[c,[f,"ZTE"],[d,v]],[/\b(gen\d{3}) b.+49h/i],[c,[f,"Swiss"],[d,v]],[/\b(zur\d{3}) b/i],[c,[f,"Swiss"],[d,h]],[/\b((zeki)?tb.*\b) b/i],[c,[f,"Zeki"],[d,h]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[f,"Dragon Touch"],c,[d,h]],[/\b(ns-?\w{0,9}) b/i],[c,[f,"Insignia"],[d,h]],[/\b((nxa|next)-?\w{0,9}) b/i],[c,[f,"NextBook"],[d,h]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[f,"Voice"],c,[d,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[f,"LvTel"],c,[d,v]],[/\b(ph-1) /i],[c,[f,"Essential"],[d,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[c,[f,"Envizen"],[d,h]],[/\b(trio[-\w\. ]+) b/i],[c,[f,"MachSpeed"],[d,h]],[/\btu_(1491) b/i],[c,[f,"Rotor"],[d,h]],[/(shield[\w ]+) b/i],[c,[f,"Nvidia"],[d,h]],[/(sprint) (\w+)/i],[f,c,[d,v]],[/(kin\.[onetw]{3})/i],[[c,/\./g," "],[f,_],[d,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[c,[f,B],[d,h]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[c,[f,B],[d,v]],[/smart-tv.+(samsung)/i],[f,[d,b]],[/hbbtv.+maple;(\d+)/i],[[c,/^/,"SmartTV"],[f,M],[d,b]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[f,P],[d,b]],[/(apple) ?tv/i],[f,[c,T+" TV"],[d,b]],[/crkey/i],[[c,x+"cast"],[f,O],[d,b]],[/droid.+aft(\w+)( bui|\))/i],[c,[f,S],[d,b]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[c,[f,D],[d,b]],[/(bravia[\w ]+)( bui|\))/i],[c,[f,j],[d,b]],[/(mitv-\w{5}) bui/i],[c,[f,R],[d,b]],[/Hbbtv.*(technisat) (.*);/i],[f,c,[d,b]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[f,G],[c,G],[d,b]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,b]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[f,c,[d,g]],[/droid.+; (shield) bui/i],[c,[f,"Nvidia"],[d,g]],[/(playstation [345portablevi]+)/i],[c,[f,j],[d,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[c,[f,_],[d,g]],[/((pebble))app/i],[f,c,[d,w]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[c,[f,T],[d,w]],[/droid.+; (glass) \d/i],[c,[f,O],[d,w]],[/droid.+; (wt63?0{2,3})\)/i],[c,[f,B],[d,w]],[/(quest( 2| pro)?)/i],[c,[f,U],[d,w]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[f,[d,y]],[/(aeobc)\b/i],[c,[f,S],[d,y]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[c,[d,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[c,[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],[c,[f,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[l,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[l,"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],[l,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,l]],os:[[/microsoft (windows) (vista|xp)/i],[l,p],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[l,[p,H,K]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[l,"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,"."],[l,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[l,z],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[p,l],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[l,p],[/\(bb(10);/i],[p,[l,I]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[l,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[l,L+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[l,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[p,[l,"watchOS"]],[/crkey\/([\d\.]+)/i],[p,[l,x+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[l,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],[l,p],[/(sunos) ?([\w\.\d]*)/i],[[l,"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],[l,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[l]=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[l]="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[c]=i,e[d]=i,W.call(e,b,y.device),S&&!e[d]&&w&&w.mobile&&(e[d]=v),S&&"Macintosh"==e[c]&&g&&typeof g.standalone!==o&&g.maxTouchPoints&&g.maxTouchPoints>2&&(e[c]="iPad",e[d]=h),e},this.getEngine=function(){var e={};return e[l]=i,e[p]=i,W.call(e,b,y.engine),e},this.getOS=function(){var e={};return e[l]=i,e[p]=i,W.call(e,b,y.os),S&&!e[l]&&w&&"Unknown"!=w.platform&&(e[l]=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([l,p,u]),J.CPU=V([m]),J.DEVICE=V([c,f,d,g,v,b,h,w,y]),J.ENGINE=J.OS=V([l,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:ge)}(ve,ve.exports);var he=ve.exports;const be=()=>{const e=new he.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:me,version:null!=n?n:me,os:`${null!=i?i:me} ${null!=r?r:me}`,userAgent:null!=o?o:me,language:null!=s?s:me,mobile:a,brands:null!=u?u:me,viewportWidth:`${window.innerWidth}`,viewportHeight:`${window.innerHeight}`}}},we=()=>({page:{url:location.href}}),ye=[be,we];function Se(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 Te={session:"sessionStorage",local:"localStorage"};function Ee(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 Ie(e,t){return Ce(t)?window[t].getItem(e):null}function ke(e,t,n){if(Ce(n))try{window[n].setItem(e,t)}catch(e){}}function xe(e,t){Ce(t)&&window[t].removeItem(e)}const Le=Ee(Te.local),Oe=Ee(Te.session);function Ce(e){return e===Te.local?Le:e===Te.session&&Oe}function Pe(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 _e(){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 Ne="com.grafana.faro.session",Ae=144e5,Me=9e5,De=Me,je={enabled:!0,persistent:!1,maxSessionPersistenceTime:De};function Re({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 Be(e){if(null==e)return!1;const t=S();if(!(t-e.started<Ae))return!1;return t-e.lastActivity<Me}function Ue({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&&!Le||!u&&!Oe)return;const c=t();if(!1===i&&Be(c))n(Object.assign(Object.assign({},c),{lastActivity:S()}));else{let t=Fe(Re({isSampled:_e()}),c);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==c?void 0:c.sessionMeta)&&void 0!==s?s:null,t.sessionMeta)}}}function Fe(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 ze{constructor(){this.updateSession=Pe((()=>this.updateUserSession()),1e3),this.updateUserSession=Ue({fetchUserSession:ze.fetchUserSession,storeUserSession:ze.storeUserSession}),this.init()}static removeUserSession(){xe(Ne,ze.storageTypeLocal)}static storeUserSession(e){ke(Ne,JSON.stringify(e),ze.storageTypeLocal)}static fetchUserSession(){const e=Ie(Ne,ze.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=ze.fetchUserSession();if(n&&n.id!==(null==i?void 0:i.sessionId)){const t=Fe(Re({sessionId:n.id,isSampled:_e()}),i);ze.storeUserSession(t),e.faro.api.setSession(t.sessionMeta)}}))}}ze.storageTypeLocal=Te.local;class Ve{constructor(){this.updateSession=Pe((()=>this.updateUserSession()),1e3),this.updateUserSession=Ue({fetchUserSession:Ve.fetchUserSession,storeUserSession:Ve.storeUserSession}),this.init()}static removeUserSession(){xe(Ne,Ve.storageTypeSession)}static storeUserSession(e){ke(Ne,JSON.stringify(e),Ve.storageTypeSession)}static fetchUserSession(){const e=Ie(Ne,Ve.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=Ve.fetchUserSession();if(n&&n.id!==(null==i?void 0:i.sessionId)){const t=Fe(Re({sessionId:n.id,isSampled:_e()}),i);Ve.storeUserSession(t),e.faro.api.setSession(t.sessionMeta)}}))}}function $e(e){return(null==e?void 0:e.persistent)?ze:Ve}Ve.storageTypeSession=Te.session;class qe extends te{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-session",this.version=ne}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(pe,{},void 0,{skipDedupe:!0}),void(this.notifiedSession=i);this.notifiedSession=i,this.api.pushEvent(de,{},void 0,{skipDedupe:!0})}}createInitialSession(e,t){var n,i,r,o,s;let a,u,c=e.fetchUserSession();if(t.persistent&&t.maxSessionPersistenceTime&&c){const e=S();c.lastActivity<e-t.maxSessionPersistenceTime&&(ze.removeUserSession(),c=null)}if(Be(c)){const e=null==c?void 0:c.sessionId;u=Re({sessionId:e,isSampled:c.isSampled||!1,started:null==c?void 0:c.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==c?void 0:c.sessionMeta)||void 0===i?void 0:i.attributes),{isSampled:u.isSampled.toString()})},a=fe}else{const e=null!==(o=null===(r=t.session)||void 0===r?void 0:r.id)&&void 0!==o?o:Se().id;u=Re({sessionId:e,isSampled:_e()}),u.sessionMeta={id:e,attributes:Object.assign({isSampled:u.isSampled.toString()},null===(s=t.session)||void 0===s?void 0:s.attributes)},a=de}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=$e(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===de&&this.api.pushEvent(de,{},void 0,{skipDedupe:!0}),i===fe&&this.api.pushEvent(fe,{},void 0,{skipDedupe:!0})}this.metas.addListener(this.sendSessionStartEvent.bind(this))}}class Ge extends te{constructor(e={}){super(),this.options=e,this.name="@grafana/faro-web-sdk:instrumentation-console",this.version=ne}initialize(){this.logDebug("Initializing\n",this.options),x.filter((e=>{var t;return!(null!==(t=this.options.disabledLevels)&&void 0!==t?t:Ge.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)}}}))}}Ge.defaultDisabledLevels=[e.LogLevel.DEBUG,e.LogLevel.TRACE,e.LogLevel.LOG];const We="DOMError",He="DOMException",Ke="Non-Error exception captured with keys:",Xe=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Je="\n",Ze="eval",Ye="?",Qe="@",et=/^\s*at (?:(.*\).*?|.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tt=/\((\S*)(?::(\d+))(?::(\d+))\)/,nt="eval",it="address at ",rt=it.length,ot=/^\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,st=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,at=" > eval",ut="safari-extension",ct="safari-web-extension",lt=/Minified React error #\d+;/i;function dt(e,t,n,i){const r={filename:e||document.location.href,function:t||Ye};return void 0!==n&&(r.lineno=n),void 0!==i&&(r.colno=i),r}function ft(e,t){const n=null==e?void 0:e.includes(ut),i=!n&&(null==e?void 0:e.includes(ct));return n||i?[(null==e?void 0:e.includes(Qe))?e.split(Qe)[0]:e,n?`${ut}:${t}`:`${ct}:${t}`]:[e,t]}function pt(e){let t=[];e.stacktrace?t=e.stacktrace.split(Je).filter(((e,t)=>t%2==0)):e.stack&&(t=e.stack.split(Je));const n=t.reduce(((t,n,i)=>{let r,o,a,u,c;if(r=et.exec(n)){if(o=r[1],a=r[2],u=r[3],c=r[4],null==a?void 0:a.startsWith(nt)){const e=tt.exec(a);e&&(a=e[1],u=e[2],c=e[3])}a=(null==a?void 0:a.startsWith(it))?a.substring(rt):a,[o,a]=ft(o,a)}else if(r=ot.exec(n)){if(o=r[1],a=r[3],u=r[4],c=r[5],a&&a.includes(at)){const e=st.exec(a);e&&(o=o||Ze,a=e[1],u=e[2])}else 0===i&&!c&&s(e.columnNumber)&&(c=String(e.columnNumber+1));[o,a]=ft(o,a)}return(a||o)&&t.push(dt(a,o,u?Number(u):void 0,c?Number(c):void 0)),t}),[]);return lt.test(e.message)?n.slice(1):n}function mt(e){return{frames:pt(e)}}function gt(e){let t,n,i,r,o=[];if(g(e)&&e.error)t=e.error.message,n=e.error.name,o=pt(e.error);else if((i=v(e))||h(e)){const{name:r,message:o}=e;n=null!=r?r:i?We:He,t=o?`${n}: ${o}`:n}else m(e)?(t=e.message,o=pt(e)):(a(e)||(r=f(e)))&&(n=r?e.constructor.name:void 0,t=`${Ke} ${Object.keys(e)}`);return[t,n,o]}function vt(e){const t=window.onerror;window.onerror=(...n)=>{try{const[t,i,r,s,a]=n;let u,c,l=[];const d=o(t),f=dt(i,"?",r,s);a||!d?([u,c,l]=gt(null!=a?a:t),0===l.length&&(l=[f])):d&&([u,c]=function(e){var t,n;const i=e.match(Xe),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),l=[f]),u&&e.pushError(new Error(u),{type:c,stackFrames:l})}finally{null==t||t.apply(window,n)}}}class ht extends te{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-errors",this.version=ne}initialize(){var e;this.logDebug("Initializing"),vt(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=[];l(s)?(r=`Non-Error promise rejection captured with value: ${String(s)}`,o="UnhandledRejection"):[r,o,a]=gt(s),r&&e.pushError(new Error(r),{type:o,stackFrames:a})}))}}class bt extends te{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-view",this.version=ne}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:me,toView:null!==(r=o.name)&&void 0!==r?r:me},void 0,{skipDedupe:!0}),this.notifiedView=o)}initialize(){this.metas.addListener(this.sendViewChangedEvent.bind(this))}}var wt,yt,St,Tt,Et,It=-1,kt=function(e){addEventListener("pageshow",(function(t){t.persisted&&(It=t.timeStamp,e(t))}),!0)},xt=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Lt=function(){var e=xt();return e&&e.activationStart||0},Ot=function(e,t){var n=xt(),i="navigate";return It>=0?i="back-forward-cache":n&&(document.prerendering||Lt()>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}},Ct=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){}},Pt=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))}},_t=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Nt=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},At=function(e){var t=!1;return function(){t||(e(),t=!0)}},Mt=-1,Dt=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},jt=function(e){"hidden"===document.visibilityState&&Mt>-1&&(Mt="visibilitychange"===e.type?e.timeStamp:0,Bt())},Rt=function(){addEventListener("visibilitychange",jt,!0),addEventListener("prerenderingchange",jt,!0)},Bt=function(){removeEventListener("visibilitychange",jt,!0),removeEventListener("prerenderingchange",jt,!0)},Ut=function(){return Mt<0&&(Mt=Dt(),Rt(),kt((function(){setTimeout((function(){Mt=Dt(),Rt()}),0)}))),{get firstHiddenTime(){return Mt}}},Ft=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},zt=[1800,3e3],Vt=function(e,t){t=t||{},Ft((function(){var n,i=Ut(),r=Ot("FCP"),o=Ct("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-Lt(),0),r.entries.push(e),n(!0)))}))}));o&&(n=Pt(e,r,zt,t.reportAllChanges),kt((function(i){r=Ot("FCP"),n=Pt(e,r,zt,t.reportAllChanges),_t((function(){r.value=performance.now()-i.timeStamp,n(!0)}))})))}))},$t=[.1,.25],qt=0,Gt=1/0,Wt=0,Ht=function(e){e.forEach((function(e){e.interactionId&&(Gt=Math.min(Gt,e.interactionId),Wt=Math.max(Wt,e.interactionId),qt=Wt?(Wt-Gt)/7+1:0)}))},Kt=[],Xt=new Map,Jt=0,Zt=[],Yt=function(e){if(Zt.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=Kt[Kt.length-1],n=Xt.get(e.interactionId);if(n||Kt.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]};Xt.set(i.id,i),Kt.push(i)}Kt.sort((function(e,t){return t.latency-e.latency})),Kt.length>10&&Kt.splice(10).forEach((function(e){return Xt.delete(e.id)}))}}},Qt=[200,500],en=[2500,4e3],tn={},nn=[800,1800],rn=function e(t){document.prerendering?Ft((function(){return e(t)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},on={passive:!0,capture:!0},sn=new Date,an=function(e,t){yt||(yt=t,St=e,Tt=new Date,ln(removeEventListener),un())},un=function(){if(St>=0&&St<Tt-sn){var e={entryType:"first-input",name:yt.type,target:yt.target,cancelable:yt.cancelable,startTime:yt.timeStamp,processingStart:yt.timeStamp+St};Et.forEach((function(t){t(e)})),Et=[]}},cn=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(){an(e,t),r()},i=function(){r()},r=function(){removeEventListener("pointerup",n,on),removeEventListener("pointercancel",i,on)};addEventListener("pointerup",n,on),addEventListener("pointercancel",i,on)}(t,e):an(t,e)}},ln=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,cn,on)}))},dn=[100,300];class fn{constructor(e){this.pushMeasurement=e}initialize(){Object.entries(fn.mapping).forEach((([e,t])=>{t((t=>{this.pushMeasurement({type:"web-vitals",values:{[e]:t.value}})}))}))}}fn.mapping={cls:function(e,t){t=t||{},Vt(At((function(){var n,i=Ot("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=Ct("layout-shift",s);a&&(n=Pt(e,i,$t,t.reportAllChanges),Nt((function(){s(a.takeRecords()),n(!0)})),kt((function(){r=0,i=Ot("CLS",0),n=Pt(e,i,$t,t.reportAllChanges),_t((function(){return n()}))})),setTimeout(n,0))})))},fcp:Vt,fid:function(e,t){t=t||{},Ft((function(){var n,i=Ut(),r=Ot("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=Ct("first-input",s);n=Pt(e,r,dn,t.reportAllChanges),a&&(Nt(At((function(){s(a.takeRecords()),a.disconnect()}))),kt((function(){var i;r=Ot("FID"),n=Pt(e,r,dn,t.reportAllChanges),Et=[],St=-1,yt=null,ln(addEventListener),i=o,Et.push(i),un()})))}))},inp:function(e,t){t=t||{},Ft((function(){var n;"interactionCount"in performance||wt||(wt=Ct("event",Ht,{type:"event",buffered:!0,durationThreshold:0}));var i,r=Ot("INP"),o=function(e){e.forEach(Yt);var t,n=(t=Math.min(Kt.length-1,Math.floor(((wt?qt:performance.interactionCount||0)-Jt)/50)),Kt[t]);n&&n.latency!==r.value&&(r.value=n.latency,r.entries=n.entries,i())},s=Ct("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});i=Pt(e,r,Qt,t.reportAllChanges),s&&("PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&s.observe({type:"first-input",buffered:!0}),Nt((function(){o(s.takeRecords()),i(!0)})),kt((function(){Jt=0,Kt.length=0,Xt.clear(),r=Ot("INP"),i=Pt(e,r,Qt,t.reportAllChanges)})))}))},lcp:function(e,t){t=t||{},Ft((function(){var n,i=Ut(),r=Ot("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-Lt(),0),r.entries=[e],n())}))},s=Ct("largest-contentful-paint",o);if(s){n=Pt(e,r,en,t.reportAllChanges);var a=At((function(){tn[r.id]||(o(s.takeRecords()),s.disconnect(),tn[r.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return e=a,t=self.requestIdleCallback||self.setTimeout,n=-1,e=At(e),"hidden"===document.visibilityState?e():(n=t(e),Nt(e)),n;var e,t,n}),!0)})),Nt(a),kt((function(i){r=Ot("LCP"),n=Pt(e,r,en,t.reportAllChanges),_t((function(){r.value=performance.now()-i.timeStamp,tn[r.id]=!0,n(!0)}))}))}}))},ttfb:function(e,t){t=t||{};var n=Ot("TTFB"),i=Pt(e,n,nn,t.reportAllChanges);rn((function(){var r=xt();r&&(n.value=Math.max(r.responseStart-Lt(),0),n.entries=[r],i(!0),kt((function(){n=Ot("TTFB",0),(i=Pt(e,n,nn,t.reportAllChanges))(!0)})))}))}};var pn,mn,gn=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},vn=function(e){if("loading"===document.readyState)return"loading";var t=gn();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"},hn=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},bn=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var i=e,r=i.id?"#"+i.id:hn(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},wn=-1,yn=function(){return wn},Sn=function(e){addEventListener("pageshow",(function(t){t.persisted&&(wn=t.timeStamp,e(t))}),!0)},Tn=function(){var e=gn();return e&&e.activationStart||0},En=function(e,t){var n=gn(),i="navigate";return yn()>=0?i="back-forward-cache":n&&(document.prerendering||Tn()>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}},In=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){}},kn=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))}},xn=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Ln=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},On=function(e){var t=!1;return function(){t||(e(),t=!0)}},Cn=-1,Pn=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},_n=function(e){"hidden"===document.visibilityState&&Cn>-1&&(Cn="visibilitychange"===e.type?e.timeStamp:0,An())},Nn=function(){addEventListener("visibilitychange",_n,!0),addEventListener("prerenderingchange",_n,!0)},An=function(){removeEventListener("visibilitychange",_n,!0),removeEventListener("prerenderingchange",_n,!0)},Mn=function(){return Cn<0&&(Cn=Pn(),Nn(),Sn((function(){setTimeout((function(){Cn=Pn(),Nn()}),0)}))),{get firstHiddenTime(){return Cn}}},Dn=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},jn=[1800,3e3],Rn=function(e,t){t=t||{},Dn((function(){var n,i=Mn(),r=En("FCP"),o=In("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-Tn(),0),r.entries.push(e),n(!0)))}))}));o&&(n=kn(e,r,jn,t.reportAllChanges),Sn((function(i){r=En("FCP"),n=kn(e,r,jn,t.reportAllChanges),xn((function(){r.value=performance.now()-i.timeStamp,n(!0)}))})))}))},Bn=[.1,.25],Un=0,Fn=1/0,zn=0,Vn=function(e){e.forEach((function(e){e.interactionId&&(Fn=Math.min(Fn,e.interactionId),zn=Math.max(zn,e.interactionId),Un=zn?(zn-Fn)/7+1:0)}))},$n=function(){"interactionCount"in performance||pn||(pn=In("event",Vn,{type:"event",buffered:!0,durationThreshold:0}))},qn=[],Gn=new Map,Wn=0,Hn=function(){return(pn?Un:performance.interactionCount||0)-Wn},Kn=[],Xn=function(e){if(Kn.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=qn[qn.length-1],n=Gn.get(e.interactionId);if(n||qn.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]};Gn.set(i.id,i),qn.push(i)}qn.sort((function(e,t){return t.latency-e.latency})),qn.length>10&&qn.splice(10).forEach((function(e){return Gn.delete(e.id)}))}}},Jn=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=On(e),"hidden"===document.visibilityState?e():(n=t(e),Ln(e)),n},Zn=[200,500],Yn=[],Qn=new Map,ei=[],ti=new WeakMap,ni=new Map,ii=-1,ri=function(e){e.forEach((function(e){return Yn.push(e)}))},oi=function(){ni.size>10&&ni.forEach((function(e,t){Gn.has(t)||ni.delete(t)})),ei=ei.slice(-50);var e=new Set(ei.concat(qn.map((function(e){return ti.get(e.entries[0])}))));Qn.forEach((function(t,n){e.has(n)||Qn.delete(n)}));var t=new Set;Qn.forEach((function(e){li(e.startTime,e.processingEnd).forEach((function(e){t.add(e)}))})),Yn=Array.from(t),ii=-1};Kn.push((function(e){e.interactionId&&e.target&&!ni.has(e.interactionId)&&ni.set(e.interactionId,e.target)}),(function(e){for(var t,n=e.startTime+e.duration,i=ei.length-1;i>=0;i--)if(t=ei[i],Math.abs(n-t)<=8){var r=Qn.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&&(ei.push(n),Qn.set(n,{startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,entries:[e]})),(e.interactionId||"first-input"===e.entryType)&&ti.set(e,n)}),(function(){ii<0&&(ii=Jn(oi))}));var si,ai,ui,ci,li=function(e,t){for(var n,i=[],r=0;n=Yn[r];r++)if(!(n.startTime+n.duration<e)){if(n.startTime>t)break;i.push(n)}return i},di=function(e,t){mn||(mn=In("long-animation-frame",ri)),function(e,t){t=t||{},Dn((function(){var n;$n();var i,r=En("INP"),o=function(e){e.forEach(Xn);var t,n=(t=Math.min(qn.length-1,Math.floor(Hn()/50)),qn[t]);n&&n.latency!==r.value&&(r.value=n.latency,r.entries=n.entries,i())},s=In("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});i=kn(e,r,Zn,t.reportAllChanges),s&&("PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&s.observe({type:"first-input",buffered:!0}),Ln((function(){o(s.takeRecords()),i(!0)})),Sn((function(){Wn=0,qn.length=0,Gn.clear(),r=En("INP"),i=kn(e,r,Zn,t.reportAllChanges)})))}))}((function(t){Jn((function(){var n=function(e){var t=e.entries[0],n=ti.get(t),i=Qn.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})),c=u&&u.target||ni.get(t.interactionId),l=[t.startTime+t.duration,o].concat(a.map((function(e){return e.startTime+e.duration}))),d=Math.max.apply(Math,l),f={interactionTarget:bn(c),interactionTargetElement:c,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:vn(t.startTime)};return Object.assign(e,{attribution:f})}(t);e(n)}))}),t)},fi=[2500,4e3],pi={},mi=[800,1800],gi=function e(t){document.prerendering?Dn((function(){return e(t)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},vi=function(e,t){t=t||{};var n=En("TTFB"),i=kn(e,n,mi,t.reportAllChanges);gi((function(){var r=gn();r&&(n.value=Math.max(r.responseStart-Tn(),0),n.entries=[r],i(!0),Sn((function(){n=En("TTFB",0),(i=kn(e,n,mi,t.reportAllChanges))(!0)})))}))},hi={passive:!0,capture:!0},bi=new Date,wi=function(e,t){si||(si=t,ai=e,ui=new Date,Ti(removeEventListener),yi())},yi=function(){if(ai>=0&&ai<ui-bi){var e={entryType:"first-input",name:si.type,target:si.target,cancelable:si.cancelable,startTime:si.timeStamp,processingStart:si.timeStamp+ai};ci.forEach((function(t){t(e)})),ci=[]}},Si=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(){wi(e,t),r()},i=function(){r()},r=function(){removeEventListener("pointerup",n,hi),removeEventListener("pointercancel",i,hi)};addEventListener("pointerup",n,hi),addEventListener("pointercancel",i,hi)}(t,e):wi(t,e)}},Ti=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,Si,hi)}))},Ei=[100,300],Ii=function(e,t){!function(e,t){t=t||{},Dn((function(){var n,i=Mn(),r=En("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=In("first-input",s);n=kn(e,r,Ei,t.reportAllChanges),a&&(Ln(On((function(){s(a.takeRecords()),a.disconnect()}))),Sn((function(){var i;r=En("FID"),n=kn(e,r,Ei,t.reportAllChanges),ci=[],ai=-1,si=null,Ti(addEventListener),i=o,ci.push(i),yi()})))}))}((function(t){var n=function(e){var t=e.entries[0],n={eventTarget:bn(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:vn(t.startTime)};return Object.assign(e,{attribution:n})}(t);e(n)}),t)};const ki="com.grafana.faro.lastNavigationId",xi="load_state",Li="time_to_first_byte";class Oi{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||{},Rn(On((function(){var n,i=En("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=In("layout-shift",s);a&&(n=kn(e,i,Bn,t.reportAllChanges),Ln((function(){s(a.takeRecords()),n(!0)})),Sn((function(){r=0,i=En("CLS",0),n=kn(e,i,Bn,t.reportAllChanges),xn((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:bn(r.node),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:r,largestShiftEntry:i,loadState:vn(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,xi,t),this.addIfPresent(s,"largest_shift_target",r),this.pushMeasurement(o,s)}))}measureFCP(){!function(e,t){Rn((function(t){var n=function(e){var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:vn(yn())};if(e.entries.length){var n=gn(),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:vn(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,Li,n);const o=this.buildInitialContext(e);this.addIfPresent(o,xi,i),this.pushMeasurement(r,o)}))}measureFID(){Ii((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,xi,r),this.pushMeasurement(o,s)}))}measureINP(){di((e=>{const{interactionTime:t,presentationDelay:n,inputDelay:i,processingDuration:r,nextPaintTime:o,loadState:s,interactionTarget:a,interactionType:u}=e.attribution,c=this.buildInitialValues(e);this.addIfPresent(c,"interaction_time",t),this.addIfPresent(c,"presentation_delay",n),this.addIfPresent(c,"input_delay",i),this.addIfPresent(c,"processing_duration",r),this.addIfPresent(c,"next_paint_time",o);const l=this.buildInitialContext(e);this.addIfPresent(l,xi,s),this.addIfPresent(l,"interaction_target",a),this.addIfPresent(l,"interaction_type",u),this.pushMeasurement(c,l)}))}measureLCP(){!function(e,t){!function(e,t){t=t||{},Dn((function(){var n,i=Mn(),r=En("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-Tn(),0),r.entries=[e],n())}))},s=In("largest-contentful-paint",o);if(s){n=kn(e,r,fi,t.reportAllChanges);var a=On((function(){pi[r.id]||(o(s.takeRecords()),s.disconnect(),pi[r.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return Jn(a)}),!0)})),Ln(a),Sn((function(i){r=En("LCP"),n=kn(e,r,fi,t.reportAllChanges),xn((function(){r.value=performance.now()-i.timeStamp,pi[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=gn();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),c=Math.max(u,r.startTime-i);t={element:bn(r.element),timeToFirstByte:s,resourceLoadDelay:a-s,resourceLoadDuration:u-a,elementRenderDelay:c-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,Li,r);const a=this.buildInitialContext(e);this.addIfPresent(a,"element",o),this.pushMeasurement(s,a)}))}measureTTFB(){!function(e,t){vi((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=Ie(ki,Te.session))&&void 0!==t?t:me;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 Ci extends te{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-web-vitals",this.version=ne}initialize(){this.logDebug("Initializing");this.intializeWebVitalsInstrumentation().initialize()}intializeWebVitalsInstrumentation(){return this.config.trackWebVitalsAttribution?new Oi(this.api.pushMeasurement):new fn(this.api.pushMeasurement)}}function Pi(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 _i=/^00-[a-f0-9]{32}-[a-f0-9]{16}-[0-9]{1,2}$/;function Ni(e=[]){for(const t of e)if("traceparent"===t.name){if(!_i.test(t.description))continue;const[,e,n]=t.description.split("-");if(null!=e&&null!=n)return{traceId:e,spanId:n};break}}function Ai(e=[],t){return e.some((e=>e&&null!=t.match(e)))}function Mi(e,t={}){for(const[n,i]of Object.entries(t)){const t=e[n];return null!=t&&(c(i)?i.includes(t):t===i)}return!0}function Di(e){const{connectEnd:t,connectStart:n,decodedBodySize:i,domainLookupEnd:r,domainLookupStart:o,duration:s,encodedBodySize:a,fetchStart:u,initiatorType:c,name:l,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:l,duration:Ri(s),tcpHandshakeTime:Ri(t-n),dnsLookupTime:Ri(r-o),tlsNegotiationTime:Ri(g-w),responseStatus:Ri(b),redirectTime:Ri(f-p),requestTime:Ri(h-g),responseTime:Ri(v-h),fetchTime:Ri(v-u),serviceWorkerTime:Ri(u-S),decodedBodySize:Ri(i),encodedBodySize:Ri(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:Ri(m),protocol:d,initiatorType:c}}function ji(e){const{activationStart:t,domComplete:n,domContentLoadedEventEnd:i,domContentLoadedEventStart:r,domInteractive:o,fetchStart:s,loadEventEnd:a,loadEventStart:u,responseStart:c,type:l}=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:Ri(n-s),documentParsingTime:Ri(d?o-d:null),domProcessingTime:Ri(n-o),domContentLoadHandlerTime:Ri(i-r),onLoadTime:Ri(a-u),ttfb:Ri(Math.max(c-(null!=t?t:0),0)),type:l},Di(e))}function Ri(e){return null==e?me:"number"==typeof e?Math.round(e).toString():e.toString()}const Bi={initiatorType:["xmlhttprequest","fetch"]};class Ui extends te{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-performance",this.version=ne}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)}}((()=>Pi(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||Ai(t,o.name))return;const s=o.toJSON();let a=Ni(null==s?void 0:s.serverTiming);const u=null!==(r=Ie(ki,Te.session))&&void 0!==r?r:me,c=Object.assign(Object.assign({},ji(s)),{faroNavigationId:P(),faroPreviousNavigationId:u});ke(ki,c.faroNavigationId,Te.session),e("faro.performance.navigation",c,void 0,{spanContext:a,timestampOverwriteMs:performance.timeOrigin+s.startTime}),n(c)})).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(Ai(i,e.name))return;const o=e.toJSON();let s=Ni(null==o?void 0:o.serverTiming);if(null==r&&Mi(o,Bi)||r){const e=Object.assign(Object.assign({},Di(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 Fi(e={}){const t=[new ht,new Ci,new qe,new bt];return!1!==e.enablePerformanceInstrumentation&&t.unshift(new Ui),!1!==e.captureConsole&&t.push(new Ge({disabledLevels:e.captureConsoleDisabledLevels})),t}const zi="browser",Vi=()=>{const e=window.k6;return{k6:Object.assign({isK6Browser:!0},(null==e?void 0:e.testRunId)&&{testRunId:null==e?void 0:e.testRunId})}};class $i extends H{constructor(e){var t,n,i,r;super(),this.options=e,this.name="@grafana/faro-web-sdk:transport-fetch",this.version=ne,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 Pi(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 c=this.metas.value.session;return null!=c&&(u=c.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=>Pi(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}=$e(i);Ue({fetchUserSession:e,storeUserSession:r})({forceSessionExtend:!0}),t(`${n} created new session.`)}else t(`${n}.`)}}function qi(e){var t,n,i,r,o,s,u,c,l,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 $i({url:e.url,apiKey:e.apiKey})):p.error('either "url" or "transports" must be defined');return{app:e.app,batching:Object.assign(Object.assign({},ce),e.batching),dedupe:null===(t=e.dedupe)||void 0===t||t,globalObjectKey:e.globalObjectKey||ue,instrumentations:null!==(n=e.instrumentations)&&void 0!==n?n:Fi(),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:Q,metas:function(){const t=ye;return e.metas&&t.push(...e.metas),a(window.k6)?[...t,Vi]:t}(),parseStacktrace:mt,paused:null!==(s=e.paused)&&void 0!==s&&s,preventGlobalExposure:null!==(u=e.preventGlobalExposure)&&void 0!==u&&u,transports:f,unpatchedConsole:null!==(c=e.unpatchedConsole)&&void 0!==c?c:F,beforeSend:e.beforeSend,eventDomain:null!==(l=e.eventDomain)&&void 0!==l?l:zi,ignoreErrors:e.ignoreErrors,ignoreUrls:(null!==(d=e.ignoreUrls)&&void 0!==d?d:[]).concat([/\/collect(?:\/[\w]*)?$/]),sessionTracking:Object.assign(Object.assign({},je),e.sessionTracking),user:e.user,view:e.view,trackResources:e.trackResources,trackWebVitalsAttribution:e.trackWebVitalsAttribution}}return e.BaseExtension=W,e.BaseInstrumentation=te,e.BaseTransport=H,e.ConsoleInstrumentation=Ge,e.ConsoleTransport=class extends H{constructor(e={}){super(),this.options=e,this.name="@grafana/faro-web-sdk:transport-console",this.version=ne}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=pe,e.EVENT_SESSION_RESUME=fe,e.EVENT_SESSION_START=de,e.EVENT_VIEW_CHANGED=le,e.ErrorsInstrumentation=ht,e.FetchTransport=$i,e.MAX_SESSION_PERSISTENCE_TIME=De,e.MAX_SESSION_PERSISTENCE_TIME_BUFFER=6e4,e.PerformanceInstrumentation=Ui,e.PersistentSessionsManager=ze,e.SESSION_EXPIRATION_TIME=Ae,e.SESSION_INACTIVITY_TIME=Me,e.STORAGE_KEY=Ne,e.SessionInstrumentation=qe,e.VERSION=ne,e.ViewInstrumentation=bt,e.VolatileSessionsManager=Ve,e.WebVitalsInstrumentation=Ci,e.allLogLevels=x,e.browserMeta=be,e.buildStackFrame=dt,e.createInternalLogger=$,e.createPromiseBuffer=O,e.createSession=Se,e.deepEqual=y,e.defaultEventDomain=zi,e.defaultExceptionType=J,e.defaultGlobalObjectKey=ue,e.defaultInternalLoggerLevel=U,e.defaultLogLevel=k,e.defaultMetas=ye,e.genShortID=P,e.getCurrentTimestamp=T,e.getDataFromSafariExtensions=ft,e.getInternalFaroFromGlobalObject=function(){return _[ie]},e.getStackFramesFromError=pt,e.getTransportBody=X,e.getWebInstrumentations=Fi,e.globalObject=_,e.initializeFaro=function(e){const t=qi(e);if(t)return ae(t)},e.internalGlobalObjectKey=ie,e.isArray=c,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=oe,e.isMap=e=>w&&i(e,Map),e.isMapDefined=w,e.isNull=r,e.isNumber=s,e.isObject=a,e.isPrimitive=l,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=qi,e.noop=L,e.pageMeta=we,e.parseStacktrace=mt,e.sdkMeta=()=>({sdk:{name:"@grafana/faro-core",version:ne,integrations:e.faro.config.instrumentations.map((({name:e,version:t})=>({name:e,version:t})))}}),e.setInternalFaroOnGlobalObject=re,e.transportItemTypeToBodyKey=M,e}({});
|
|
@@ -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.10.
|
|
6
|
+
readonly version = "1.10.2";
|
|
7
7
|
static defaultDisabledLevels: LogLevel[];
|
|
8
8
|
constructor(options?: ConsoleInstrumentationOptions);
|
|
9
9
|
initialize(): void;
|
|
@@ -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.10.
|
|
4
|
+
readonly version = "1.10.2";
|
|
5
5
|
initialize(): void;
|
|
6
6
|
}
|
|
@@ -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.10.
|
|
4
|
+
readonly version = "1.10.2";
|
|
5
5
|
initialize(): void;
|
|
6
6
|
private getIgnoreUrls;
|
|
7
7
|
}
|
|
@@ -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.10.
|
|
4
|
+
readonly version = "1.10.2";
|
|
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.10.
|
|
4
|
+
readonly version = "1.10.2";
|
|
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.10.
|
|
4
|
+
readonly version = "1.10.2";
|
|
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.10.
|
|
7
|
+
readonly version = "1.10.2";
|
|
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.10.
|
|
7
|
+
readonly version = "1.10.2";
|
|
8
8
|
promiseBuffer: PromiseBuffer<Response | void>;
|
|
9
9
|
private readonly rateLimitBackoffMs;
|
|
10
10
|
private readonly getNow;
|
|
@@ -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.10.
|
|
6
|
+
readonly version = "1.10.2";
|
|
7
7
|
static defaultDisabledLevels: LogLevel[];
|
|
8
8
|
constructor(options?: ConsoleInstrumentationOptions);
|
|
9
9
|
initialize(): void;
|
|
@@ -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.10.
|
|
4
|
+
readonly version = "1.10.2";
|
|
5
5
|
initialize(): void;
|
|
6
6
|
}
|
|
@@ -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.10.
|
|
4
|
+
readonly version = "1.10.2";
|
|
5
5
|
initialize(): void;
|
|
6
6
|
private getIgnoreUrls;
|
|
7
7
|
}
|
|
@@ -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.10.
|
|
4
|
+
readonly version = "1.10.2";
|
|
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.10.
|
|
4
|
+
readonly version = "1.10.2";
|
|
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.10.
|
|
4
|
+
readonly version = "1.10.2";
|
|
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.10.
|
|
7
|
+
readonly version = "1.10.2";
|
|
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.10.
|
|
7
|
+
readonly version = "1.10.2";
|
|
8
8
|
promiseBuffer: PromiseBuffer<Response | void>;
|
|
9
9
|
private readonly rateLimitBackoffMs;
|
|
10
10
|
private readonly getNow;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/faro-web-sdk",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.2",
|
|
4
4
|
"description": "Faro instrumentations, metas, transports for web.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"observability",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"quality:circular-deps": "madge --circular ."
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@grafana/faro-core": "^1.10.
|
|
55
|
+
"@grafana/faro-core": "^1.10.2",
|
|
56
56
|
"ua-parser-js": "^1.0.32",
|
|
57
57
|
"web-vitals": "^4.0.1"
|
|
58
58
|
},
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "4e2f75f08c305da67e769879cea46b414809a32f"
|
|
67
67
|
}
|