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

@grafana/faro-web-sdk

Package Overview
Dependencies
Maintainers
22
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@grafana/faro-web-sdk - npm Package Compare versions

Comparing version 1.2.3 to 1.2.4

dist/bundle/types/instrumentations/session/sessionManager/index.d.ts

5

./dist/cjs/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isEventDefined = exports.isEvent = exports.isErrorEvent = exports.isErrorDefined = exports.isError = exports.isElementDefined = exports.isElement = exports.isDomException = exports.isDomError = exports.isBoolean = exports.isArray = exports.internalGlobalObjectKey = exports.globalObject = exports.getTransportBody = exports.getInternalFaroFromGlobalObject = exports.getCurrentTimestamp = exports.genShortID = exports.defaultLogLevel = exports.defaultInternalLoggerLevel = exports.defaultGlobalObjectKey = exports.defaultExceptionType = exports.deepEqual = exports.createPromiseBuffer = exports.createInternalLogger = exports.Conventions = exports.BaseTransport = exports.BaseInstrumentation = exports.BaseExtension = exports.allLogLevels = exports.faro = exports.FetchTransport = exports.ConsoleTransport = exports.pageMeta = exports.defaultViewMeta = exports.defaultMetas = exports.createSession = exports.browserMeta = exports.SessionInstrumentation = exports.WebVitalsInstrumentation = exports.ViewInstrumentation = exports.parseStacktrace = exports.getStackFramesFromError = exports.getDataFromSafariExtensions = exports.ErrorsInstrumentation = exports.ConsoleInstrumentation = exports.buildStackFrame = exports.initializeFaro = exports.defaultEventDomain = exports.makeCoreConfig = exports.getWebInstrumentations = void 0;
exports.VERSION = exports.transportItemTypeToBodyKey = exports.TransportItemType = exports.setInternalFaroOnGlobalObject = exports.noop = exports.LogLevel = exports.InternalLoggerLevel = exports.isUndefined = exports.isTypeof = exports.isToString = exports.isThenable = exports.isSyntheticEvent = exports.isSymbol = exports.isString = exports.isRegExp = exports.isPrimitive = exports.isObject = exports.isNumber = exports.isNull = exports.isMapDefined = exports.isMap = exports.isInternalFaroOnGlobalObject = exports.isInt = exports.isInstanceOf = exports.isFunction = void 0;
exports.isEvent = exports.isErrorEvent = exports.isErrorDefined = exports.isError = exports.isElementDefined = exports.isElement = exports.isDomException = exports.isDomError = exports.isBoolean = exports.isArray = exports.internalGlobalObjectKey = exports.globalObject = exports.getTransportBody = exports.getInternalFaroFromGlobalObject = exports.getCurrentTimestamp = exports.genShortID = exports.defaultLogLevel = exports.defaultInternalLoggerLevel = exports.defaultGlobalObjectKey = exports.defaultExceptionType = exports.deepEqual = exports.createPromiseBuffer = exports.createInternalLogger = exports.Conventions = exports.BaseTransport = exports.BaseInstrumentation = exports.BaseExtension = exports.allLogLevels = exports.faro = exports.FetchTransport = exports.ConsoleTransport = exports.sdkMeta = exports.pageMeta = exports.defaultViewMeta = exports.defaultMetas = exports.createSession = exports.browserMeta = exports.SessionInstrumentation = exports.WebVitalsInstrumentation = exports.ViewInstrumentation = exports.parseStacktrace = exports.getStackFramesFromError = exports.getDataFromSafariExtensions = exports.ErrorsInstrumentation = exports.ConsoleInstrumentation = exports.buildStackFrame = exports.initializeFaro = exports.defaultEventDomain = exports.makeCoreConfig = exports.getWebInstrumentations = void 0;
exports.VERSION = exports.transportItemTypeToBodyKey = exports.TransportItemType = exports.setInternalFaroOnGlobalObject = exports.noop = exports.LogLevel = exports.InternalLoggerLevel = exports.isUndefined = exports.isTypeof = exports.isToString = exports.isThenable = exports.isSyntheticEvent = exports.isSymbol = exports.isString = exports.isRegExp = exports.isPrimitive = exports.isObject = exports.isNumber = exports.isNull = exports.isMapDefined = exports.isMap = exports.isInternalFaroOnGlobalObject = exports.isInt = exports.isInstanceOf = exports.isFunction = exports.isEventDefined = void 0;
var config_1 = require("./config");

@@ -28,2 +28,3 @@ Object.defineProperty(exports, "getWebInstrumentations", { enumerable: true, get: function () { return config_1.getWebInstrumentations; } });

Object.defineProperty(exports, "pageMeta", { enumerable: true, get: function () { return metas_1.pageMeta; } });
Object.defineProperty(exports, "sdkMeta", { enumerable: true, get: function () { return metas_1.sdkMeta; } });
var transports_1 = require("./transports");

@@ -30,0 +31,0 @@ Object.defineProperty(exports, "ConsoleTransport", { enumerable: true, get: function () { return transports_1.ConsoleTransport; } });

2

dist/bundle/faro-web-sdk.iife.js

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

var GrafanaFaroWebSdk=function(e){"use strict";function n(e,n){return typeof e===n}function t(e,n){return Object.prototype.toString.call(e)===`[object ${n}]`}function i(e,n){try{return e instanceof n}catch(e){return!1}}const r=e=>n(e,"undefined"),o=e=>n(e,"null"),s=e=>n(e,"string"),a=e=>n(e,"number")&&!isNaN(e)||n(e,"bigint"),l=e=>!o(e)&&n(e,"object"),u=e=>n(e,"function"),c=e=>t(e,"Array"),d=e=>!l(e)&&!u(e),p=!r(Event),f=e=>p&&i(e,Event),g="undefined"!=typeof Error,b=e=>g&&i(e,Error),v=e=>t(e,"ErrorEvent"),m=e=>t(e,"DOMError"),h=e=>t(e,"DOMException"),w="undefined"!=typeof Element,y="undefined"!=typeof Map;function E(e,t){if(e===t)return!0;if(n(e,"number")&&isNaN(e))return n(t,"number")&&isNaN(t);const i=c(e),r=c(t);if(i!==r)return!1;if(i&&r){const n=e.length;if(n!==t.length)return!1;for(let i=n;0!=i--;)if(!E(e[i],t[i]))return!1;return!0}const o=l(e),s=l(t);if(o!==s)return!1;if(e&&t&&o&&s){const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(let e of n)if(!i.includes(e))return!1;for(let i of n)if(!E(e[i],t[i]))return!1;return!0}return!1}function x(){return(new Date).toISOString()}var T;e.LogLevel=void 0,(T=e.LogLevel||(e.LogLevel={})).TRACE="trace",T.DEBUG="debug",T.INFO="info",T.LOG="log",T.WARN="warn",T.ERROR="error";const k=e.LogLevel.LOG,S=[e.LogLevel.TRACE,e.LogLevel.DEBUG,e.LogLevel.INFO,e.LogLevel.LOG,e.LogLevel.WARN,e.LogLevel.ERROR];function O(){}function I(e){const{size:n,concurrency:t}=e,i=[];let r=0;const o=()=>{if(r<t&&i.length){const{producer:e,resolve:n,reject:t}=i.shift();r++,e().then((e=>{r--,o(),n(e)}),(e=>{r--,o(),t(e)}))}};return{add:e=>{if(i.length+r>=n)throw new Error("Task buffer full");return new Promise(((n,t)=>{i.push({producer:e,resolve:n,reject:t}),o()}))}}}const L="abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ0123456789";function A(e=10){return Array.from(Array(e)).map((()=>L[Math.floor(Math.random()*L.length)])).join("")}function C(){return Date.now()}var j="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},N={exports:{}},R={exports:{}};R.exports=function(e,n){var t,i,r,o,s,a,l,u;for(t=3&e.length,i=e.length-t,r=n,s=3432918353,a=461845907,u=0;u<i;)l=255&e.charCodeAt(u)|(255&e.charCodeAt(++u))<<8|(255&e.charCodeAt(++u))<<16|(255&e.charCodeAt(++u))<<24,++u,r=27492+(65535&(o=5*(65535&(r=(r^=l=(65535&(l=(l=(65535&l)*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<13|r>>>19))+((5*(r>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(l=0,t){case 3:l^=(255&e.charCodeAt(u+2))<<16;case 2:l^=(255&e.charCodeAt(u+1))<<8;case 1:r^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(u)))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295}return r^=e.length,r=2246822507*(65535&(r^=r>>>16))+((2246822507*(r>>>16)&65535)<<16)&4294967295,r=3266489909*(65535&(r^=r>>>13))+((3266489909*(r>>>16)&65535)<<16)&4294967295,(r^=r>>>16)>>>0};var D=R.exports,M={exports:{}};!function(e){e.exports=function(e,n){for(var t,i=e.length,r=n^i,o=0;i>=4;)t=1540483477*(65535&(t=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(t>>>16)&65535)<<16),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)^(t=1540483477*(65535&(t^=t>>>24))+((1540483477*(t>>>16)&65535)<<16)),i-=4,++o;switch(i){case 3:r^=(255&e.charCodeAt(o+2))<<16;case 2:r^=(255&e.charCodeAt(o+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(o)))+((1540483477*(r>>>16)&65535)<<16)}return r=1540483477*(65535&(r^=r>>>13))+((1540483477*(r>>>16)&65535)<<16),(r^=r>>>15)>>>0}}(M);var P=D,_=M.exports;N.exports=P;var B=N.exports.murmur3=P;N.exports.murmur2=_;class z{constructor(e,n){var t,i;this.signalBuffer=[],this.itemLimit=null!==(t=null==n?void 0:n.itemLimit)&&void 0!==t?t:50,this.sendTimeout=null!==(i=null==n?void 0:n.sendTimeout)&&void 0!==i?i:250,this.paused=(null==n?void 0:n.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 n=new Map;return e.forEach((e=>{const t=B(JSON.stringify(e.meta));let i=n.get(t);i=void 0===i?[e]:[...i,e],n.set(t,i)})),Array.from(n.values())}flush(){if(this.paused||0===this.signalBuffer.length)return;this.groupItems(this.signalBuffer).forEach(this.sendFn),this.signalBuffer=[]}}var F;e.TransportItemType=void 0,(F=e.TransportItemType||(e.TransportItemType={})).EXCEPTION="exception",F.LOG="log",F.MEASUREMENT="measurement",F.TRACE="trace",F.EVENT="event";const U={[e.TransportItemType.EXCEPTION]:"exceptions",[e.TransportItemType.LOG]:"logs",[e.TransportItemType.MEASUREMENT]:"measurements",[e.TransportItemType.TRACE]:"traces",[e.TransportItemType.EVENT]:"events"};function $(n){return t=>{if(t.type===e.TransportItemType.EXCEPTION&&t.payload){const e=t.payload,i=`${e.type}: ${e.value}`;if(function(e,n){return e.some((e=>s(e)?n.includes(e):!!n.match(e)))}(n,i))return null}return t}}var V;e.InternalLoggerLevel=void 0,(V=e.InternalLoggerLevel||(e.InternalLoggerLevel={}))[V.OFF=0]="OFF",V[V.ERROR=1]="ERROR",V[V.WARN=2]="WARN",V[V.INFO=3]="INFO",V[V.VERBOSE=4]="VERBOSE";const q={debug:O,error:O,info:O,prefix:"Faro",warn:O},G=e.InternalLoggerLevel.ERROR,W=Object.assign({},console);let H=W;function K(e){var n;return H=null!==(n=e.unpatchedConsole)&&void 0!==n?n:H,H}function X(n=W,t=G){const i=q;return t>e.InternalLoggerLevel.OFF&&(i.error=t>=e.InternalLoggerLevel.ERROR?function(...e){n.error(`${i.prefix}\n`,...e)}:O,i.warn=t>=e.InternalLoggerLevel.WARN?function(...e){n.warn(`${i.prefix}\n`,...e)}:O,i.info=t>=e.InternalLoggerLevel.INFO?function(...e){n.info(`${i.prefix}\n`,...e)}:O,i.debug=t>=e.InternalLoggerLevel.VERBOSE?function(...e){n.debug(`${i.prefix}\n`,...e)}:O),i}let J=q;function Z(e,n){return J=X(e,n.internalLoggerLevel),J}class Q{constructor(){this.unpatchedConsole=W,this.internalLogger=q,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 Y extends Q{isBatched(){return!1}getIgnoreUrls(){return[]}}function ee(e,n){var t,i;if(void 0===n)return e;if(void 0===e)return{resourceSpans:n};const r=null===(t=e.resourceSpans)||void 0===t?void 0:t[0];if(void 0===r)return e;const o=(null==r?void 0:r.scopeSpans)||[],s=(null===(i=null==n?void 0:n[0])||void 0===i?void 0:i.scopeSpans)||[];return Object.assign(Object.assign({},e),{resourceSpans:[Object.assign(Object.assign({},r),{scopeSpans:[...o,...s]})]})}function ne(n){let t={meta:{}};return void 0!==n[0]&&(t.meta=n[0].meta),n.forEach((n=>{switch(n.type){case e.TransportItemType.LOG:case e.TransportItemType.EVENT:case e.TransportItemType.EXCEPTION:case e.TransportItemType.MEASUREMENT:const i=U[n.type],r=t[i];t=Object.assign(Object.assign({},t),{[i]:void 0===r?[n.payload]:[...r,n.payload]});break;case e.TransportItemType.TRACE:t=Object.assign(Object.assign({},t),{traces:ee(t.traces,n.payload.resourceSpans)})}})),t}const te="Error";let ie;function re(n,t,i,r,s){t.debug("Initializing API");const a=function(n,t,i,r,o){let s;return t.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,n)=>{t.debug("Initializing OpenTelemetry"),s={trace:e,context:n}},isOTELInitialized:()=>!!s,pushTraces:n=>{try{const i={type:e.TransportItemType.TRACE,payload:n,meta:r.value};t.debug("Pushing trace\n",i),o.execute(i)}catch(e){t.error("Error pushing trace\n",e)}}}}(0,t,0,r,s);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a),function(n,t,i,r,s,a){var l;t.debug("Initializing exceptions API");let u=null;ie=null!==(l=i.parseStacktrace)&&void 0!==l?l:ie;const c=e=>{t.debug("Changing stacktrace parser"),ie=null!=e?e:ie};return c(i.parseStacktrace),{changeStacktraceParser:c,getStacktraceParser:()=>ie,pushError:(n,{skipDedupe:l,stackFrames:c,type:d,context:p}={})=>{d=d||n.name||te;const f={meta:r.value,payload:{type:d,value:n.message,timestamp:x(),trace:a.getTraceContext(),context:null!=p?p:{}},type:e.TransportItemType.EXCEPTION};(null==(c=null!=c?c:n.stack?null==ie?void 0:ie(n).frames:void 0)?void 0:c.length)&&(f.payload.stacktrace={frames:c});const g={type:f.payload.type,value:f.payload.value,stackTrace:f.payload.stacktrace,context:f.payload.context};l||!i.dedupe||o(u)||!E(g,u)?(u=g,t.debug("Pushing exception\n",f),s.execute(f)):t.debug("Skipping error push because it is the same as the last one\n",f.payload)}}}(0,t,i,r,s,a)),function(e,n,t,i,r){let o,s,a;n.debug("Initializing meta API");const l=e=>{s&&i.remove(s),s={user:e},i.add(s)},u=e=>{o&&i.remove(o),o={session:e},i.add(o)};return{setUser:l,resetUser:l,setSession:u,resetSession:u,getSession:()=>i.value.session,setView:e=>{a&&i.remove(a),a={view:e},i.add(a)},getView:()=>i.value.view}}(0,t,0,r)),function(n,t,i,r,s,a){t.debug("Initializing logs API");let l=null;return{pushLog:(n,{context:u,level:c,skipDedupe:d}={})=>{try{const p={type:e.TransportItemType.LOG,payload:{message:n.map((e=>{try{return String(e)}catch(e){return""}})).join(" "),level:null!=c?c:k,context:null!=u?u:{},timestamp:x(),trace:a.getTraceContext()},meta:r.value},f={message:p.payload.message,level:p.payload.level,context:p.payload.context};if(!d&&i.dedupe&&!o(l)&&E(f,l))return void t.debug("Skipping log push because it is the same as the last one\n",p.payload);l=f,t.debug("Pushing log\n",p),s.execute(p)}catch(e){t.error("Error pushing log\n",e)}}}}(0,t,i,r,s,a)),function(n,t,i,r,s,a){t.debug("Initializing measurements API");let l=null;return{pushMeasurement:(n,{skipDedupe:u,context:c}={})=>{var d;try{const p={type:e.TransportItemType.MEASUREMENT,payload:Object.assign(Object.assign({},n),{trace:a.getTraceContext(),timestamp:null!==(d=n.timestamp)&&void 0!==d?d:x(),context:null!=c?c:{}}),meta:r.value},f={type:p.payload.type,values:p.payload.values,context:p.payload.context};if(!u&&i.dedupe&&!o(l)&&E(f,l))return void t.debug("Skipping measurement push because it is the same as the last one\n",p.payload);l=f,t.debug("Pushing measurement\n",p),s.execute(p)}catch(e){t.error("Error pushing measurement\n",e)}}}}(0,t,i,r,s,a)),function(n,t,i,r,s,a){let l=null;return{pushEvent:(n,u,c,{skipDedupe:d}={})=>{try{const p={meta:r.value,payload:{name:n,domain:null!=c?c:i.eventDomain,attributes:u,timestamp:x(),trace:a.getTraceContext()},type:e.TransportItemType.EVENT},f={name:p.payload.name,attributes:p.payload.attributes,domain:p.payload.domain};if(!d&&i.dedupe&&!o(l)&&E(f,l))return void t.debug("Skipping event push because it is the same as the last one\n",p.payload);l=f,t.debug("Pushing event\n",p),s.execute(p)}catch(e){t.error("Error pushing event",e)}}}}(0,t,i,r,s,a))}const oe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0;class se extends Q{constructor(){super(...arguments),this.api={},this.transports={}}}const ae="1.2.3";const le="_faroInternal";function ue(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(oe,le,{configurable:!1,enumerable:!1,writable:!1,value:e}))}function ce(){return le in oe}function de(n,t,i,r,o,s,a){return t.debug("Initializing Faro"),e.faro={api:s,config:i,instrumentations:a,internalLogger:t,metas:r,pause:o.pause,transports:o,unpatchedConsole:n,unpause:o.unpause},ue(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 oe)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(oe,e.config.globalObjectKey,{configurable:!1,writable:!1,value:e})}}(e.faro),e.faro}function pe(e){const n=K(e),t=Z(n,e);if(ce()&&!e.isolate)return void t.error('Faro is already registered. Either add instrumentations, transports etc. to the global faro instance or use the "isolate" property');t.debug("Initializing");const i=function(e,n,t){let i=[],r=[];const o=()=>i.reduce(((e,n)=>Object.assign(e,u(n)?n():n)),{}),s=()=>{if(r.length){const e=o();r.forEach((n=>n(e)))}};return{add:(...e)=>{n.debug("Adding metas\n",e),i.push(...e),s()},remove:(...e)=>{n.debug("Removing metas\n",e),i=i.filter((n=>!e.includes(n))),s()},addListener:e=>{n.debug("Adding metas listener\n",e),r.push(e)},removeListener:e=>{n.debug("Removing metas listener\n",e),r=r.filter((n=>n!==e))},get value(){return o()}}}(0,t),r=function(e,n,t,i){var r;n.debug("Initializing transports");const o=[];let s=t.paused,a=[];const l=e=>{let n=e;for(const e of a){const t=n.map(e).filter(Boolean);if(0===t.length)return[];n=t}return n},u=e=>{const t=l(e);if(0!==t.length)for(const e of o)n.debug(`Transporting item using ${e.name}\n`,t),e.isBatched()&&e.send(t)},c=e=>{var i;const[r]=l([e]);if(void 0!==r)for(const e of o)n.debug(`Transporting item using ${e.name}\n`,r),e.isBatched()?(null===(i=t.batching)||void 0===i?void 0:i.enabled)||e.send([r]):e.send(r)};let d;return(null===(r=t.batching)||void 0===r?void 0:r.enabled)&&(d=new z(u,{sendTimeout:t.batching.sendTimeout,itemLimit:t.batching.itemLimit,paused:s})),{add:(...r)=>{n.debug("Adding transports"),r.forEach((r=>{n.debug(`Adding "${r.name}" transport`),o.some((e=>e===r))?n.warn(`Transport ${r.name} is already added`):(r.unpatchedConsole=e,r.internalLogger=n,r.config=t,r.metas=i,o.push(r))}))},addBeforeSendHooks:(...e)=>{n.debug("Adding beforeSendHooks\n",a),e.forEach((e=>{e&&a.push(e)}))},addIgnoreErrorsPatterns:(...e)=>{n.debug("Adding ignoreErrorsPatterns\n",e),e.forEach((e=>{e&&a.push($(e))}))},getBeforeSendHooks:()=>[...a],execute:e=>{var n;s||((null===(n=t.batching)||void 0===n?void 0:n.enabled)?(null==d||d.addItem(e),c(e)):c(e))},isPaused:()=>s,pause:()=>{n.debug("Pausing transports"),null==d||d.pause(),s=!0},remove:(...e)=>{n.debug("Removing transports"),e.forEach((e=>{n.debug(`Removing "${e.name}" transport`);const t=o.indexOf(e);-1!==t?o.splice(t,1):n.warn(`Transport "${e.name}" is not added`)}))},removeBeforeSendHooks:(...e)=>{a.filter((n=>!e.includes(n)))},get transports(){return[...o]},unpause:()=>{n.debug("Unpausing transports"),null==d||d.start(),s=!1}}}(n,t,e,i),o=re(0,t,e,i,r),s=function(e,n,t,i,r,o){n.debug("Initializing instrumentations");const s=[];return{add:(...a)=>{n.debug("Adding instrumentations"),a.forEach((a=>{n.debug(`Adding "${a.name}" instrumentation`),s.some((e=>e.name===a.name))?n.warn(`Instrumentation ${a.name} is already added`):(a.unpatchedConsole=e,a.internalLogger=n,a.config=t,a.metas=i,a.transports=r,a.api=o,s.push(a),a.initialize())}))},get instrumentations(){return[...s]},remove:(...e)=>{n.debug("Removing instrumentations"),e.forEach((e=>{var t,i;n.debug(`Removing "${e.name}" instrumentation`);const r=s.reduce(((n,t,i)=>null===n&&t.name===e.name?i:null),null);r?(null===(i=(t=s[r]).destroy)||void 0===i||i.call(t),s.splice(r,1)):n.warn(`Instrumentation "${e.name}" is not added`)}))}}}(n,t,e,i,r,o),a=de(n,t,e,i,r,o,s);return function(e){var n,t,i;const r={sdk:{name:"@grafana/faro-core",version:ae,integrations:e.config.instrumentations.map((({name:e,version:n})=>({name:e,version:n})))}},o=null!==(t=null===(n=e.config.experimentalSessions)||void 0===n?void 0:n.session)&&void 0!==t?t:e.config.session;o&&e.api.setSession(o),e.config.app&&(r.app=e.config.app),e.config.user&&(r.user=e.config.user),e.config.view&&(r.view=e.config.view),e.metas.add(r,...null!==(i=e.config.metas)&&void 0!==i?i:[])}(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 fe="faro",ge={enabled:!0,sendTimeout:250,itemLimit:50},be={EventNames:{CLICK:"click",NAVIGATION:"navigation",SESSION_START:"session_start",VIEW_CHANGED:"view_changed"}};const ve=function(n){var t;try{let e;e=window[n];const t="__faro_storage_test__";return e.setItem(t,t),e.removeItem(t),!0}catch(i){return null===(t=e.faro.internalLogger)||void 0===t||t.info(`Web storage of type ${n} is not available. Reason: ${i}`),!1}}("localStorage");const me="__FARO_SESSION__";function he(e){const n=C();return{sessionId:null!=e?e:A(),lastActivity:n,started:n}}function we(e){!function(e,n){if(ve)try{localStorage.setItem(e,n)}catch(e){}}(me,JSON.stringify(e))}function ye(){const e=(n=me,ve?localStorage.getItem(n):null);var n;return e?JSON.parse(e):null}function Ee(e){if(null==e)return!1;const n=C();if(!(n-e.started<144e5))return!1;return n-e.lastActivity<9e5}function xe(n){const t=function(e,n){let t,i=!1;const r=()=>{null!=t?(e(...t),t=null,setTimeout(r,n)):i=!1};return(...o)=>{i?t=o:(e(...o),i=!0,setTimeout(r,n))}}((()=>{var n,t,i,r,o,s;const a=ye();if(Ee(a))we(Object.assign(Object.assign({},a),{lastActivity:C()}));else{let l=he();l=Object.assign(Object.assign({},l),{sessionMeta:{id:l.sessionId,attributes:Object.assign(Object.assign({},null!==(t=null===(n=e.faro.metas.value.session)||void 0===n?void 0:n.attributes)&&void 0!==t?t:{}),null!=a?{previousSession:a.sessionId}:{})}}),we(l),null===(i=e.faro.api)||void 0===i||i.setSession(l.sessionMeta),null===(o=null===(r=e.faro.config.experimentalSessions)||void 0===r?void 0:r.onSessionChange)||void 0===o||o.call(r,null!==(s=null==a?void 0:a.sessionMeta)&&void 0!==s?s:null,l.sessionMeta)}}),1e3);return{handleUpdate:t,init:function(){we(he(n)),document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&t()})),window.addEventListener("storage",(n=>{var t,i,r;if(n.key!==me)return;const o=JSON.parse(null!==(t=n.newValue)&&void 0!==t?t:""),s=JSON.parse(null!==(i=n.oldValue)&&void 0!==i?i:"");o.sessionId!==s.sessionId&&(null===(r=e.faro.api)||void 0===r||r.setSession(o.sessionMeta))})),e.faro.metas.addListener((function(n){var t,i;const r=n.session,o=ye();if(r&&r.id!==(null==o?void 0:o.sessionId)){const n=Object.assign(Object.assign({},he(r.id)),{sessionMeta:{id:r.id,attributes:Object.assign(Object.assign(Object.assign({},null!==(i=null===(t=null==o?void 0:o.sessionMeta)||void 0===t?void 0:t.attributes)&&void 0!==i?i:{}),r.attributes),o?{previousSession:o.sessionId}:{})}});we(n),e.faro.api.setSession(n.sessionMeta)}}))}}}function Te(n){var t;return(null===(t=e.faro.config.experimentalSessions)||void 0===t?void 0:t.persistent)&&ve?xe(n):function(n){let t=he(n);function i(){var n,i,r,o,s;if(Ee(t))t.lastActivity=C();else{t=he();const a=e.faro.metas.value.session,l={id:t.sessionId,attributes:Object.assign(Object.assign({},null!==(i=null===(n=e.faro.metas.value.session)||void 0===n?void 0:n.attributes)&&void 0!==i?i:{}),(null==a?void 0:a.id)?{previousSession:a.id}:{})};null===(o=null===(r=e.faro.config.experimentalSessions)||void 0===r?void 0:r.onSessionChange)||void 0===o||o.call(r,null!=a?a:null,l),null===(s=e.faro.api)||void 0===s||s.setSession(l)}}return{handleUpdate:i,init:function(){document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&i()})),e.faro.metas.addListener((function(n){var i;const r=n.session;if(r&&r.id!==(null==t?void 0:t.sessionId)){const n=t.sessionId;t=he(r.id),e.faro.api.setSession({id:t.sessionId,attributes:Object.assign(Object.assign({},null!==(i=r.attributes)&&void 0!==i?i:{}),{previousSession:n})})}}))}}}(n)}class ke extends se{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-session",this.version=ae}sendSessionStartEvent(e){var n;const t=e.session;t&&t.id!==(null===(n=this.notifiedSession)||void 0===n?void 0:n.id)&&(this.notifiedSession=t,this.api.pushEvent(be.EventNames.SESSION_START,{},void 0,{skipDedupe:!0}))}initialize(){var e,n,t;this.logDebug("init session instrumentation"),this.sendSessionStartEvent(this.metas.value),this.metas.addListener(this.sendSessionStartEvent.bind(this)),(null===(e=this.config.experimentalSessions)||void 0===e?void 0:e.enabled)&&(this.sessionUpdater=Te(null===(n=this.metas.value.session)||void 0===n?void 0:n.id),this.sessionUpdater.init(),null===(t=this.transports)||void 0===t||t.addBeforeSendHooks(...this.transports.getBeforeSendHooks(),(e=>{var n;return null===(n=this.sessionUpdater)||void 0===n||n.handleUpdate(),e})))}}class Se extends se{constructor(e={}){super(),this.options=e,this.name="@grafana/faro-web-sdk:instrumentation-console",this.version=ae}initialize(){this.logDebug("Initializing\n",this.options),S.filter((e=>{var n;return!(null!==(n=this.options.disabledLevels)&&void 0!==n?n:Se.defaultDisabledLevels).includes(e)})).forEach((e=>{console[e]=(...n)=>{try{this.api.pushLog(n,{level:e})}catch(e){this.logError(e)}finally{this.unpatchedConsole[e](...n)}}}))}}Se.defaultDisabledLevels=[e.LogLevel.DEBUG,e.LogLevel.TRACE,e.LogLevel.LOG];const Oe=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Ie=/^\s*at (?:(.*\).*?|.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Le=/\((\S*)(?::(\d+))(?::(\d+))\)/,Ae="address at ",Ce=Ae.length,je=/^\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,Ne=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Re="safari-extension",De="safari-web-extension",Me=/Minified React error #\d+;/i;function Pe(e,n,t,i){const r={filename:e||document.location.href,function:n||"?"};return void 0!==t&&(r.lineno=t),void 0!==i&&(r.colno=i),r}function _e(e,n){const t=null==e?void 0:e.includes(Re),i=!t&&(null==e?void 0:e.includes(De));return t||i?[(null==e?void 0:e.includes("@"))?e.split("@")[0]:e,t?`${Re}:${n}`:`${De}:${n}`]:[e,n]}function Be(e){let n=[];e.stacktrace?n=e.stacktrace.split("\n").filter(((e,n)=>n%2==0)):e.stack&&(n=e.stack.split("\n"));const t=n.reduce(((n,t,i)=>{let r,o,s,l,u;if(r=Ie.exec(t)){if(o=r[1],s=r[2],l=r[3],u=r[4],null==s?void 0:s.startsWith("eval")){const e=Le.exec(s);e&&(s=e[1],l=e[2],u=e[3])}s=(null==s?void 0:s.startsWith(Ae))?s.substring(Ce):s,[o,s]=_e(o,s)}else if(r=je.exec(t)){if(o=r[1],s=r[3],l=r[4],u=r[5],s&&s.includes(" > eval")){const e=Ne.exec(s);e&&(o=o||"eval",s=e[1],l=e[2])}else 0===i&&!u&&a(e.columnNumber)&&(u=String(e.columnNumber+1));[o,s]=_e(o,s)}return(s||o)&&n.push(Pe(s,o,l?Number(l):void 0,u?Number(u):void 0)),n}),[]);return Me.test(e.message)?t.slice(1):t}function ze(e){return{frames:Be(e)}}function Fe(e){let n,t,i,r,o=[];if(v(e)&&e.error)n=e.error.message,t=e.error.name,o=Be(e.error);else if((i=m(e))||h(e)){const{name:r,message:o}=e;t=null!=r?r:i?"DOMError":"DOMException",n=o?`${t}: ${o}`:t}else b(e)?(n=e.message,o=Be(e)):(l(e)||(r=f(e)))&&(t=r?e.constructor.name:void 0,n=`Non-Error exception captured with keys: ${Object.keys(e)}`);return[n,t,o]}function Ue(e){const n=window.onerror;window.onerror=(...t)=>{try{const[i,r,o,a,l]=t;let u,c,d=[];const p=s(i),f=Pe(r,"?",o,a);l||!p?([u,c,d]=Fe(null!=l?l:i),0===d.length&&(d=[f])):p&&([u,c]=function(e){var n,t;const i=e.match(Oe),r=null!==(n=null==i?void 0:i[1])&&void 0!==n?n:te;return[null!==(t=null==i?void 0:i[2])&&void 0!==t?t:e,r]}(i),d=[f]),u&&e.pushError(new Error(u),{type:c,stackFrames:d})}finally{null==n||n.apply(window,t)}}}class $e extends se{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-errors",this.version=ae}initialize(){var e;this.logDebug("Initializing"),Ue(this.api),e=this.api,window.addEventListener("unhandledrejection",(n=>{var t,i;let r,o,s=n;s.reason?s=n.reason:(null===(t=n.detail)||void 0===t?void 0:t.reason)&&(s=null===(i=n.detail)||void 0===i?void 0:i.reason);let a=[];d(s)?(r=`Non-Error promise rejection captured with value: ${String(s)}`,o="UnhandledRejection"):[r,o,a]=Fe(s),r&&e.pushError(new Error(r),{type:o,stackFrames:a})}))}}class Ve extends se{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-view",this.version=ae}sendViewChangedEvent(e){const n=e.view;n&&n!==this.notifiedView&&(this.notifiedView=n,this.api.pushEvent(be.EventNames.VIEW_CHANGED,{},void 0,{skipDedupe:!0}))}initialize(){this.sendViewChangedEvent(this.metas.value),this.metas.addListener(this.sendViewChangedEvent.bind(this))}}var qe,Ge,We,He,Ke,Xe=-1,Je=function(e){addEventListener("pageshow",(function(n){n.persisted&&(Xe=n.timeStamp,e(n))}),!0)},Ze=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},Qe=function(){var e=Ze();return e&&e.activationStart||0},Ye=function(e,n){var t=Ze(),i="navigate";return Xe>=0?i="back-forward-cache":t&&(document.prerendering||Qe()>0?i="prerender":document.wasDiscarded?i="restore":t.type&&(i=t.type.replace(/_/g,"-"))),{name:e,value:void 0===n?-1:n,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},en=function(e,n,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((function(e){Promise.resolve().then((function(){n(e.getEntries())}))}));return i.observe(Object.assign({type:e,buffered:!0},t||{})),i}}catch(e){}},nn=function(e,n,t,i){var r,o;return function(s){n.value>=0&&(s||i)&&((o=n.value-(r||0))||void 0===r)&&(r=n.value,n.delta=o,n.rating=function(e,n){return e>n[1]?"poor":e>n[0]?"needs-improvement":"good"}(n.value,t),e(n))}},tn=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},rn=function(e){var n=function(n){"pagehide"!==n.type&&"hidden"!==document.visibilityState||e(n)};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},on=function(e){var n=!1;return function(t){n||(e(t),n=!0)}},sn=-1,an=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},ln=function(e){"hidden"===document.visibilityState&&sn>-1&&(sn="visibilitychange"===e.type?e.timeStamp:0,cn())},un=function(){addEventListener("visibilitychange",ln,!0),addEventListener("prerenderingchange",ln,!0)},cn=function(){removeEventListener("visibilitychange",ln,!0),removeEventListener("prerenderingchange",ln,!0)},dn=function(){return sn<0&&(sn=an(),un(),Je((function(){setTimeout((function(){sn=an(),un()}),0)}))),{get firstHiddenTime(){return sn}}},pn=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},fn=[1800,3e3],gn=function(e,n){n=n||{},pn((function(){var t,i=dn(),r=Ye("FCP"),o=en("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-Qe(),0),r.entries.push(e),t(!0)))}))}));o&&(t=nn(e,r,fn,n.reportAllChanges),Je((function(i){r=Ye("FCP"),t=nn(e,r,fn,n.reportAllChanges),tn((function(){r.value=performance.now()-i.timeStamp,t(!0)}))})))}))},bn=[.1,.25],vn={passive:!0,capture:!0},mn=new Date,hn=function(e,n){qe||(qe=n,Ge=e,We=new Date,En(removeEventListener),wn())},wn=function(){if(Ge>=0&&Ge<We-mn){var e={entryType:"first-input",name:qe.type,target:qe.target,cancelable:qe.cancelable,startTime:qe.timeStamp,processingStart:qe.timeStamp+Ge};He.forEach((function(n){n(e)})),He=[]}},yn=function(e){if(e.cancelable){var n=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,n){var t=function(){hn(e,n),r()},i=function(){r()},r=function(){removeEventListener("pointerup",t,vn),removeEventListener("pointercancel",i,vn)};addEventListener("pointerup",t,vn),addEventListener("pointercancel",i,vn)}(n,e):hn(n,e)}},En=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(n){return e(n,yn,vn)}))},xn=[100,300],Tn=0,kn=1/0,Sn=0,On=function(e){e.forEach((function(e){e.interactionId&&(kn=Math.min(kn,e.interactionId),Sn=Math.max(Sn,e.interactionId),Tn=Sn?(Sn-kn)/7+1:0)}))},In=function(){return Ke?Tn:performance.interactionCount||0},Ln=function(){"interactionCount"in performance||Ke||(Ke=en("event",On,{type:"event",buffered:!0,durationThreshold:0}))},An=[200,500],Cn=0,jn=function(){return In()-Cn},Nn=[],Rn={},Dn=function(e){var n=Nn[Nn.length-1],t=Rn[e.interactionId];if(t||Nn.length<10||e.duration>n.latency){if(t)t.entries.push(e),t.latency=Math.max(t.latency,e.duration);else{var i={id:e.interactionId,latency:e.duration,entries:[e]};Rn[i.id]=i,Nn.push(i)}Nn.sort((function(e,n){return n.latency-e.latency})),Nn.splice(10).forEach((function(e){delete Rn[e.id]}))}},Mn=[2500,4e3],Pn={},_n=[800,1800],Bn=function e(n){document.prerendering?pn((function(){return e(n)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(n)}),!0):setTimeout(n,0)};class zn extends se{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-web-vitals",this.version=ae}initialize(){this.logDebug("Initializing"),Object.entries(zn.mapping).forEach((([e,n])=>{n((n=>{this.api.pushMeasurement({type:"web-vitals",values:{[e]:n.value}})}))}))}}function Fn(e={}){const n=[new $e,new zn,new ke,new Ve];return!1!==e.captureConsole&&n.push(new Se({disabledLevels:e.captureConsoleDisabledLevels})),n}zn.mapping={cls:function(e,n){n=n||{},gn(on((function(){var t,i=Ye("CLS",0),r=0,o=[],s=function(e){e.forEach((function(e){if(!e.hadRecentInput){var n=o[0],t=o[o.length-1];r&&e.startTime-t.startTime<1e3&&e.startTime-n.startTime<5e3?(r+=e.value,o.push(e)):(r=e.value,o=[e])}})),r>i.value&&(i.value=r,i.entries=o,t())},a=en("layout-shift",s);a&&(t=nn(e,i,bn,n.reportAllChanges),rn((function(){s(a.takeRecords()),t(!0)})),Je((function(){r=0,i=Ye("CLS",0),t=nn(e,i,bn,n.reportAllChanges),tn((function(){return t()}))})),setTimeout(t,0))})))},fcp:gn,fid:function(e,n){n=n||{},pn((function(){var t,i=dn(),r=Ye("FID"),o=function(e){e.startTime<i.firstHiddenTime&&(r.value=e.processingStart-e.startTime,r.entries.push(e),t(!0))},s=function(e){e.forEach(o)},a=en("first-input",s);t=nn(e,r,xn,n.reportAllChanges),a&&rn(on((function(){s(a.takeRecords()),a.disconnect()}))),a&&Je((function(){var i;r=Ye("FID"),t=nn(e,r,xn,n.reportAllChanges),He=[],Ge=-1,qe=null,En(addEventListener),i=o,He.push(i),wn()}))}))},inp:function(e,n){n=n||{},pn((function(){var t;Ln();var i,r=Ye("INP"),o=function(e){e.forEach((function(e){e.interactionId&&Dn(e),"first-input"===e.entryType&&!Nn.some((function(n){return n.entries.some((function(n){return e.duration===n.duration&&e.startTime===n.startTime}))}))&&Dn(e)}));var n,t=(n=Math.min(Nn.length-1,Math.floor(jn()/50)),Nn[n]);t&&t.latency!==r.value&&(r.value=t.latency,r.entries=t.entries,i())},s=en("event",o,{durationThreshold:null!==(t=n.durationThreshold)&&void 0!==t?t:40});i=nn(e,r,An,n.reportAllChanges),s&&("interactionId"in PerformanceEventTiming.prototype&&s.observe({type:"first-input",buffered:!0}),rn((function(){o(s.takeRecords()),r.value<0&&jn()>0&&(r.value=0,r.entries=[]),i(!0)})),Je((function(){Nn=[],Cn=In(),r=Ye("INP"),i=nn(e,r,An,n.reportAllChanges)})))}))},lcp:function(e,n){n=n||{},pn((function(){var t,i=dn(),r=Ye("LCP"),o=function(e){var n=e[e.length-1];n&&n.startTime<i.firstHiddenTime&&(r.value=Math.max(n.startTime-Qe(),0),r.entries=[n],t())},s=en("largest-contentful-paint",o);if(s){t=nn(e,r,Mn,n.reportAllChanges);var a=on((function(){Pn[r.id]||(o(s.takeRecords()),s.disconnect(),Pn[r.id]=!0,t(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return setTimeout(a,0)}),!0)})),rn(a),Je((function(i){r=Ye("LCP"),t=nn(e,r,Mn,n.reportAllChanges),tn((function(){r.value=performance.now()-i.timeStamp,Pn[r.id]=!0,t(!0)}))}))}}))},ttfb:function(e,n){n=n||{};var t=Ye("TTFB"),i=nn(e,t,_n,n.reportAllChanges);Bn((function(){var r=Ze();if(r){var o=r.responseStart;if(o<=0||o>performance.now())return;t.value=Math.max(o-Qe(),0),t.entries=[r],i(!0),Je((function(){t=Ye("TTFB",0),(i=nn(e,t,_n,n.reportAllChanges))(!0)}))}}))}};const Un="browser";var $n={exports:{}};!function(e,n){!function(t,i){var r="function",o="undefined",s="object",a="string",l="major",u="model",c="name",d="type",p="vendor",f="version",g="architecture",b="console",v="mobile",m="tablet",h="smarttv",w="wearable",y="embedded",E="Amazon",x="Apple",T="ASUS",k="BlackBerry",S="Browser",O="Chrome",I="Firefox",L="Google",A="Huawei",C="LG",j="Microsoft",N="Motorola",R="Opera",D="Samsung",M="Sharp",P="Sony",_="Xiaomi",B="Zebra",z="Facebook",F="Chromium OS",U="Mac OS",$=function(e){for(var n={},t=0;t<e.length;t++)n[e[t].toUpperCase()]=e[t];return n},V=function(e,n){return typeof e===a&&-1!==q(n).indexOf(q(e))},q=function(e){return e.toLowerCase()},G=function(e,n){if(typeof e===a)return e=e.replace(/^\s\s*/,""),typeof n===o?e:e.substring(0,350)},W=function(e,n){for(var t,o,a,l,u,c,d=0;d<n.length&&!u;){var p=n[d],f=n[d+1];for(t=o=0;t<p.length&&!u&&p[t];)if(u=p[t++].exec(e))for(a=0;a<f.length;a++)c=u[++o],typeof(l=f[a])===s&&l.length>0?2===l.length?typeof l[1]==r?this[l[0]]=l[1].call(this,c):this[l[0]]=l[1]:3===l.length?typeof l[1]!==r||l[1].exec&&l[1].test?this[l[0]]=c?c.replace(l[1],l[2]):i:this[l[0]]=c?l[1].call(this,c,l[2]):i:4===l.length&&(this[l[0]]=c?l[3].call(this,c.replace(l[1],l[2])):i):this[l]=c||i;d+=2}},H=function(e,n){for(var t in n)if(typeof n[t]===s&&n[t].length>0){for(var r=0;r<n[t].length;r++)if(V(n[t][r],e))return"?"===t?i:t}else if(V(n[t],e))return"?"===t?i:t;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],[f,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,f],[/opios[\/ ]+([\w\.]+)/i],[f,[c,R+" Mini"]],[/\bopr\/([\w\.]+)/i],[f,[c,R]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[c,f],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[c,"UC"+S]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[f,[c,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[f,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[c,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[f,[c,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure "+S],f],[/\bfocus\/([\w\.]+)/i],[f,[c,I+" Focus"]],[/\bopt\/([\w\.]+)/i],[f,[c,R+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[c,R+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[c,"MIUI "+S]],[/fxios\/([-\w\.]+)/i],[f,[c,I]],[/\bqihu|(qi?ho?o?|360)browser/i],[[c,"360 "+S]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1 "+S],f],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[c,f],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,z],f],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[c,f],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[c,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[f,[c,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[c,O+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,O+" WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[c,"Android "+S]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,f],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[f,[c,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[f,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[f,H,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[c,f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[c,I+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[c,f],[/(cobalt)\/([\w\.]+)/i],[c,[f,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[g,"amd64"]],[/(ia32(?=;))/i],[[g,q]],[/((?:i[346]|x)86)[;\)]/i],[[g,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[g,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[g,"armhf"]],[/windows (ce|mobile); ppc;/i],[[g,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[g,/ower/,"",q]],[/(sun4\w)[;\)]/i],[[g,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[g,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],[u,[p,D],[d,m]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[p,D],[d,v]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[u,[p,x],[d,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[p,x],[d,m]],[/(macintosh);/i],[u,[p,x]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[p,M],[d,v]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[p,A],[d,m]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[p,A],[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],[[u,/_/g," "],[p,_],[d,v]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[p,_],[d,m]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[p,"OPPO"],[d,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[p,"Vivo"],[d,v]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[u,[p,"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],[u,[p,N],[d,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[p,N],[d,m]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[p,C],[d,m]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[p,C],[d,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[p,"Lenovo"],[d,m]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[p,"Nokia"],[d,v]],[/(pixel c)\b/i],[u,[p,L],[d,m]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[p,L],[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],[u,[p,P],[d,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[p,P],[d,m]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[p,"OnePlus"],[d,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[p,E],[d,m]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[p,E],[d,v]],[/(playbook);[-\w\),; ]+(rim)/i],[u,p,[d,m]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[p,k],[d,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[p,T],[d,m]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[p,T],[d,v]],[/(nexus 9)/i],[u,[p,"HTC"],[d,m]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[p,[u,/_/g," "],[d,v]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[p,"Acer"],[d,m]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[p,"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],[p,u,[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],[p,u,[d,m]],[/(surface duo)/i],[u,[p,j],[d,m]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[p,"Fairphone"],[d,v]],[/(u304aa)/i],[u,[p,"AT&T"],[d,v]],[/\bsie-(\w*)/i],[u,[p,"Siemens"],[d,v]],[/\b(rct\w+) b/i],[u,[p,"RCA"],[d,m]],[/\b(venue[\d ]{2,7}) b/i],[u,[p,"Dell"],[d,m]],[/\b(q(?:mv|ta)\w+) b/i],[u,[p,"Verizon"],[d,m]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[p,"Barnes & Noble"],[d,m]],[/\b(tm\d{3}\w+) b/i],[u,[p,"NuVision"],[d,m]],[/\b(k88) b/i],[u,[p,"ZTE"],[d,m]],[/\b(nx\d{3}j) b/i],[u,[p,"ZTE"],[d,v]],[/\b(gen\d{3}) b.+49h/i],[u,[p,"Swiss"],[d,v]],[/\b(zur\d{3}) b/i],[u,[p,"Swiss"],[d,m]],[/\b((zeki)?tb.*\b) b/i],[u,[p,"Zeki"],[d,m]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[p,"Dragon Touch"],u,[d,m]],[/\b(ns-?\w{0,9}) b/i],[u,[p,"Insignia"],[d,m]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[p,"NextBook"],[d,m]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[p,"Voice"],u,[d,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[p,"LvTel"],u,[d,v]],[/\b(ph-1) /i],[u,[p,"Essential"],[d,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[p,"Envizen"],[d,m]],[/\b(trio[-\w\. ]+) b/i],[u,[p,"MachSpeed"],[d,m]],[/\btu_(1491) b/i],[u,[p,"Rotor"],[d,m]],[/(shield[\w ]+) b/i],[u,[p,"Nvidia"],[d,m]],[/(sprint) (\w+)/i],[p,u,[d,v]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[p,j],[d,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[p,B],[d,m]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[p,B],[d,v]],[/smart-tv.+(samsung)/i],[p,[d,h]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[p,D],[d,h]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[p,C],[d,h]],[/(apple) ?tv/i],[p,[u,x+" TV"],[d,h]],[/crkey/i],[[u,O+"cast"],[p,L],[d,h]],[/droid.+aft(\w+)( bui|\))/i],[u,[p,E],[d,h]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[u,[p,M],[d,h]],[/(bravia[\w ]+)( bui|\))/i],[u,[p,P],[d,h]],[/(mitv-\w{5}) bui/i],[u,[p,_],[d,h]],[/Hbbtv.*(technisat) (.*);/i],[p,u,[d,h]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[p,G],[u,G],[d,h]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,h]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[p,u,[d,b]],[/droid.+; (shield) bui/i],[u,[p,"Nvidia"],[d,b]],[/(playstation [345portablevi]+)/i],[u,[p,P],[d,b]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[p,j],[d,b]],[/((pebble))app/i],[p,u,[d,w]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[u,[p,x],[d,w]],[/droid.+; (glass) \d/i],[u,[p,L],[d,w]],[/droid.+; (wt63?0{2,3})\)/i],[u,[p,B],[d,w]],[/(quest( 2| pro)?)/i],[u,[p,z],[d,w]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[p,[d,y]],[/(aeobc)\b/i],[u,[p,E],[d,y]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[u,[d,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[d,m]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,m]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,v]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[p,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[c,f],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,f],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[c,[f,H,K]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,"Windows"],[f,H,K]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,U],[f,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[f,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[c,f],[/\(bb(10);/i],[f,[c,k]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[f,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[f,[c,I+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[c,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[f,[c,"watchOS"]],[/crkey\/([\d\.]+)/i],[f,[c,O+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[c,F],f],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[c,f],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],f],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[c,f]]},J=function(e,n){if(typeof e===s&&(n=e,e=i),!(this instanceof J))return new J(e,n).getResult();var b=typeof t!==o&&t.navigator?t.navigator:i,h=e||(b&&b.userAgent?b.userAgent:""),w=b&&b.userAgentData?b.userAgentData:i,y=n?function(e,n){var t={};for(var i in e)n[i]&&n[i].length%2==0?t[i]=n[i].concat(e[i]):t[i]=e[i];return t}(X,n):X,E=b&&b.userAgent==h;return this.getBrowser=function(){var e,n={};return n[c]=i,n[f]=i,W.call(n,h,y.browser),n[l]=typeof(e=n[f])===a?e.replace(/[^\d\.]/g,"").split(".")[0]:i,E&&b&&b.brave&&typeof b.brave.isBrave==r&&(n[c]="Brave"),n},this.getCPU=function(){var e={};return e[g]=i,W.call(e,h,y.cpu),e},this.getDevice=function(){var e={};return e[p]=i,e[u]=i,e[d]=i,W.call(e,h,y.device),E&&!e[d]&&w&&w.mobile&&(e[d]=v),E&&"Macintosh"==e[u]&&b&&typeof b.standalone!==o&&b.maxTouchPoints&&b.maxTouchPoints>2&&(e[u]="iPad",e[d]=m),e},this.getEngine=function(){var e={};return e[c]=i,e[f]=i,W.call(e,h,y.engine),e},this.getOS=function(){var e={};return e[c]=i,e[f]=i,W.call(e,h,y.os),E&&!e[c]&&w&&"Unknown"!=w.platform&&(e[c]=w.platform.replace(/chrome os/i,F).replace(/macos/i,U)),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 h},this.setUA=function(e){return h=typeof e===a&&e.length>350?G(e,350):e,this},this.setUA(h),this};J.VERSION="1.0.36",J.BROWSER=$([c,f,l]),J.CPU=$([g]),J.DEVICE=$([u,p,d,b,v,h,m,w,y]),J.ENGINE=J.OS=$([c,f]),e.exports&&(n=e.exports=J),n.UAParser=J;var Z=typeof t!==o&&(t.jQuery||t.Zepto);if(Z&&!Z.ua){var Q=new J;Z.ua=Q.getResult(),Z.ua.get=function(){return Q.getUA()},Z.ua.set=function(e){Q.setUA(e);var n=Q.getResult();for(var t in n)Z.ua[t]=n[t]}}}("object"==typeof window?window:j)}($n,$n.exports);var Vn=$n.exports;const qn=()=>{const e=new Vn.UAParser,{name:n,version:t}=e.getBrowser(),{name:i,version:r}=e.getOS(),o=e.getUA(),s=navigator.language,a=navigator.userAgent.includes("Mobi"),l=function(){if(!n||!t)return;if("userAgentData"in navigator)return navigator.userAgentData.brands;return}(),u="unknown";return{browser:{name:null!=n?n:u,version:null!=t?t:u,os:`${null!=i?i:u} ${null!=r?r:u}`,userAgent:null!=o?o:u,language:null!=s?s:u,mobile:a,brands:null!=l?l:u}}},Gn=()=>({page:{url:location.href}}),Wn=[qn,Gn];function Hn(e){return{id:A(),attributes:e}}const Kn={name:"default"},Xn=()=>({k6:{isK6Browser:!0}});function Jn(e,n,t,i){return new(t||(t=Promise))((function(r,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var n;e.done?r(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(s,a)}l((i=i.apply(e,n||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class Zn extends Y{constructor(e){var n,t,i,r;super(),this.options=e,this.name="@grafana/faro-web-sdk:transport-fetch",this.version=ae,this.disabledUntil=new Date,this.rateLimitBackoffMs=null!==(n=e.defaultRateLimitBackoffMs)&&void 0!==n?n:5e3,this.getNow=null!==(t=e.getNow)&&void 0!==t?t:()=>Date.now(),this.promiseBuffer=I({size:null!==(i=e.bufferSize)&&void 0!==i?i:30,concurrency:null!==(r=e.concurrency)&&void 0!==r?r:5})}send(e){return Jn(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((()=>{var n,t,i;const r=JSON.stringify(ne(e)),{url:o,requestOptions:s,apiKey:a}=this.options,l=null!=s?s:{},{headers:u}=l,c=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)n.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(t[i[r]]=e[i[r]])}return t}(l,["headers"]);return fetch(o,Object.assign({method:"POST",headers:Object.assign(Object.assign(Object.assign({"Content-Type":"application/json"},null!=u?u:{}),a?{"x-api-key":a}:{}),(null===(n=this.config.experimentalSessions)||void 0===n?void 0:n.enabled)&&(null===(t=this.metas.value.session)||void 0===t?void 0:t.id)?{"x-faro-session-id":null===(i=this.metas.value.session)||void 0===i?void 0:i.id}:{}),body:r,keepalive:r.length<=6e4},null!=c?c:{})).then((e=>(429===e.status&&(this.disabledUntil=this.getRetryAfterDate(e),this.logWarn(`Too many requests, backing off until ${this.disabledUntil}`)),e.text().catch(O),e))).catch((e=>{this.logError("Failed sending payload to the receiver\n",JSON.parse(r),e)}))}))}catch(e){this.logError(e)}}))}getIgnoreUrls(){return[this.options.url]}isBatched(){return!0}getRetryAfterDate(e){const n=this.getNow(),t=e.headers.get("Retry-After");if(t){const e=Number(t);if(!isNaN(e))return new Date(1e3*e+n);const i=Date.parse(t);if(!isNaN(i))return new Date(i)}return new Date(n+this.rateLimitBackoffMs)}}function Qn(e){var n,t,i,r,o,s,a,u,c,d;const p=[],f=X(e.unpatchedConsole,e.internalLoggerLevel);return e.transports?((e.url||e.apiKey)&&f.error('if "transports" is defined, "url" and "apiKey" should not be defined'),p.push(...e.transports)):e.url?p.push(new Zn({url:e.url,apiKey:e.apiKey})):f.error('either "url" or "transports" must be defined'),{app:e.app,batching:Object.assign(Object.assign({},ge),e.batching),dedupe:null===(n=e.dedupe)||void 0===n||n,globalObjectKey:e.globalObjectKey||fe,instrumentations:null!==(t=e.instrumentations)&&void 0!==t?t:Fn(),internalLoggerLevel:null!==(i=e.internalLoggerLevel)&&void 0!==i?i:G,isolate:null!==(r=e.isolate)&&void 0!==r&&r,metas:function(){const n=Wn;return e.metas&&n.push(...e.metas),l(window.k6)?[...n,Xn]:n}(),parseStacktrace:ze,paused:null!==(o=e.paused)&&void 0!==o&&o,preventGlobalExposure:null!==(s=e.preventGlobalExposure)&&void 0!==s&&s,transports:p,unpatchedConsole:null!==(a=e.unpatchedConsole)&&void 0!==a?a:W,beforeSend:e.beforeSend,eventDomain:null!==(u=e.eventDomain)&&void 0!==u?u:Un,ignoreErrors:e.ignoreErrors,experimentalSessions:Object.assign({enabled:!1,persistent:!1,session:Yn()},e.experimentalSessions),session:null!==(c=e.session)&&void 0!==c?c:Hn(),user:e.user,view:null!==(d=e.view)&&void 0!==d?d:Kn}}function Yn(){const e=ye();return{id:Ee(e)?null==e?void 0:e.sessionId:Hn().id}}return e.BaseExtension=Q,e.BaseInstrumentation=se,e.BaseTransport=Y,e.ConsoleInstrumentation=Se,e.ConsoleTransport=class extends Y{constructor(e={}){super(),this.options=e,this.name="@grafana/faro-web-sdk:transport-console",this.version=ae}send(n){var t;return this.unpatchedConsole[null!==(t=this.options.level)&&void 0!==t?t:e.LogLevel.DEBUG]("New event",ne([n]))}},e.Conventions=be,e.ErrorsInstrumentation=$e,e.FetchTransport=Zn,e.SessionInstrumentation=ke,e.VERSION=ae,e.ViewInstrumentation=Ve,e.WebVitalsInstrumentation=zn,e.allLogLevels=S,e.browserMeta=qn,e.buildStackFrame=Pe,e.createInternalLogger=X,e.createPromiseBuffer=I,e.createSession=Hn,e.deepEqual=E,e.defaultEventDomain=Un,e.defaultExceptionType=te,e.defaultGlobalObjectKey=fe,e.defaultInternalLoggerLevel=G,e.defaultLogLevel=k,e.defaultMetas=Wn,e.defaultViewMeta=Kn,e.genShortID=A,e.getCurrentTimestamp=x,e.getDataFromSafariExtensions=_e,e.getInternalFaroFromGlobalObject=function(){return oe[le]},e.getStackFramesFromError=Be,e.getTransportBody=ne,e.getWebInstrumentations=Fn,e.globalObject=oe,e.initializeFaro=function(e){const n=Qn(e);if(n)return pe(n)},e.internalGlobalObjectKey=le,e.isArray=c,e.isBoolean=e=>n(e,"boolean"),e.isDomError=m,e.isDomException=h,e.isElement=e=>w&&i(e,Element),e.isElementDefined=w,e.isError=b,e.isErrorDefined=g,e.isErrorEvent=v,e.isEvent=f,e.isEventDefined=p,e.isFunction=u,e.isInstanceOf=i,e.isInt=e=>a(e)&&Number.isInteger(e),e.isInternalFaroOnGlobalObject=ce,e.isMap=e=>y&&i(e,Map),e.isMapDefined=y,e.isNull=o,e.isNumber=a,e.isObject=l,e.isPrimitive=d,e.isRegExp=e=>t(e,"RegExp"),e.isString=s,e.isSymbol=e=>n(e,"symbol"),e.isSyntheticEvent=e=>l(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e,e.isThenable=e=>u(null==e?void 0:e.then),e.isToString=t,e.isTypeof=n,e.isUndefined=r,e.makeCoreConfig=Qn,e.noop=O,e.pageMeta=Gn,e.parseStacktrace=ze,e.setInternalFaroOnGlobalObject=ue,e.transportItemTypeToBodyKey=U,e}({});
var GrafanaFaroWebSdk=function(e){"use strict";function n(e,n){return typeof e===n}function t(e,n){return Object.prototype.toString.call(e)===`[object ${n}]`}function i(e,n){try{return e instanceof n}catch(e){return!1}}const r=e=>n(e,"undefined"),o=e=>n(e,"null"),s=e=>n(e,"string"),a=e=>n(e,"number")&&!isNaN(e)||n(e,"bigint"),l=e=>!o(e)&&n(e,"object"),u=e=>n(e,"function"),c=e=>t(e,"Array"),d=e=>!l(e)&&!u(e),p=!r(Event),f=e=>p&&i(e,Event),g="undefined"!=typeof Error,b=e=>g&&i(e,Error),m=e=>t(e,"ErrorEvent"),v=e=>t(e,"DOMError"),h=e=>t(e,"DOMException"),w="undefined"!=typeof Element,y="undefined"!=typeof Map;function S(e,t){if(e===t)return!0;if(n(e,"number")&&isNaN(e))return n(t,"number")&&isNaN(t);const i=c(e),r=c(t);if(i!==r)return!1;if(i&&r){const n=e.length;if(n!==t.length)return!1;for(let i=n;0!=i--;)if(!S(e[i],t[i]))return!1;return!0}const o=l(e),s=l(t);if(o!==s)return!1;if(e&&t&&o&&s){const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(let e of n)if(!i.includes(e))return!1;for(let i of n)if(!S(e[i],t[i]))return!1;return!0}return!1}function E(){return(new Date).toISOString()}var x;e.LogLevel=void 0,(x=e.LogLevel||(e.LogLevel={})).TRACE="trace",x.DEBUG="debug",x.INFO="info",x.LOG="log",x.WARN="warn",x.ERROR="error";const T=e.LogLevel.LOG,k=[e.LogLevel.TRACE,e.LogLevel.DEBUG,e.LogLevel.INFO,e.LogLevel.LOG,e.LogLevel.WARN,e.LogLevel.ERROR];function I(){}function O(e){const{size:n,concurrency:t}=e,i=[];let r=0;const o=()=>{if(r<t&&i.length){const{producer:e,resolve:n,reject:t}=i.shift();r++,e().then((e=>{r--,o(),n(e)}),(e=>{r--,o(),t(e)}))}};return{add:e=>{if(i.length+r>=n)throw new Error("Task buffer full");return new Promise(((n,t)=>{i.push({producer:e,resolve:n,reject:t}),o()}))}}}const L="abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ0123456789";function A(e=10){return Array.from(Array(e)).map((()=>L[Math.floor(Math.random()*L.length)])).join("")}function C(){return Date.now()}var N="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},j={exports:{}},R={exports:{}};R.exports=function(e,n){var t,i,r,o,s,a,l,u;for(t=3&e.length,i=e.length-t,r=n,s=3432918353,a=461845907,u=0;u<i;)l=255&e.charCodeAt(u)|(255&e.charCodeAt(++u))<<8|(255&e.charCodeAt(++u))<<16|(255&e.charCodeAt(++u))<<24,++u,r=27492+(65535&(o=5*(65535&(r=(r^=l=(65535&(l=(l=(65535&l)*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<13|r>>>19))+((5*(r>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(l=0,t){case 3:l^=(255&e.charCodeAt(u+2))<<16;case 2:l^=(255&e.charCodeAt(u+1))<<8;case 1:r^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(u)))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295}return r^=e.length,r=2246822507*(65535&(r^=r>>>16))+((2246822507*(r>>>16)&65535)<<16)&4294967295,r=3266489909*(65535&(r^=r>>>13))+((3266489909*(r>>>16)&65535)<<16)&4294967295,(r^=r>>>16)>>>0};var D=R.exports,U={exports:{}};!function(e){e.exports=function(e,n){for(var t,i=e.length,r=n^i,o=0;i>=4;)t=1540483477*(65535&(t=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(t>>>16)&65535)<<16),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)^(t=1540483477*(65535&(t^=t>>>24))+((1540483477*(t>>>16)&65535)<<16)),i-=4,++o;switch(i){case 3:r^=(255&e.charCodeAt(o+2))<<16;case 2:r^=(255&e.charCodeAt(o+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(o)))+((1540483477*(r>>>16)&65535)<<16)}return r=1540483477*(65535&(r^=r>>>13))+((1540483477*(r>>>16)&65535)<<16),(r^=r>>>15)>>>0}}(U);var M=D,P=U.exports;j.exports=M;var B=j.exports.murmur3=M;j.exports.murmur2=P;class _{constructor(e,n){var t,i;this.signalBuffer=[],this.itemLimit=null!==(t=null==n?void 0:n.itemLimit)&&void 0!==t?t:50,this.sendTimeout=null!==(i=null==n?void 0:n.sendTimeout)&&void 0!==i?i:250,this.paused=(null==n?void 0:n.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 n=new Map;return e.forEach((e=>{const t=B(JSON.stringify(e.meta));let i=n.get(t);i=void 0===i?[e]:[...i,e],n.set(t,i)})),Array.from(n.values())}flush(){if(this.paused||0===this.signalBuffer.length)return;this.groupItems(this.signalBuffer).forEach(this.sendFn),this.signalBuffer=[]}}var z;e.TransportItemType=void 0,(z=e.TransportItemType||(e.TransportItemType={})).EXCEPTION="exception",z.LOG="log",z.MEASUREMENT="measurement",z.TRACE="trace",z.EVENT="event";const F={[e.TransportItemType.EXCEPTION]:"exceptions",[e.TransportItemType.LOG]:"logs",[e.TransportItemType.MEASUREMENT]:"measurements",[e.TransportItemType.TRACE]:"traces",[e.TransportItemType.EVENT]:"events"};function $(n){return t=>{if(t.type===e.TransportItemType.EXCEPTION&&t.payload){const e=t.payload,i=`${e.type}: ${e.value}`;if(function(e,n){return e.some((e=>s(e)?n.includes(e):!!n.match(e)))}(n,i))return null}return t}}var V;e.InternalLoggerLevel=void 0,(V=e.InternalLoggerLevel||(e.InternalLoggerLevel={}))[V.OFF=0]="OFF",V[V.ERROR=1]="ERROR",V[V.WARN=2]="WARN",V[V.INFO=3]="INFO",V[V.VERBOSE=4]="VERBOSE";const q={debug:I,error:I,info:I,prefix:"Faro",warn:I},G=e.InternalLoggerLevel.ERROR,W=Object.assign({},console);let H=W;function K(e){var n;return H=null!==(n=e.unpatchedConsole)&&void 0!==n?n:H,H}function J(n=W,t=G){const i=q;return t>e.InternalLoggerLevel.OFF&&(i.error=t>=e.InternalLoggerLevel.ERROR?function(...e){n.error(`${i.prefix}\n`,...e)}:I,i.warn=t>=e.InternalLoggerLevel.WARN?function(...e){n.warn(`${i.prefix}\n`,...e)}:I,i.info=t>=e.InternalLoggerLevel.INFO?function(...e){n.info(`${i.prefix}\n`,...e)}:I,i.debug=t>=e.InternalLoggerLevel.VERBOSE?function(...e){n.debug(`${i.prefix}\n`,...e)}:I),i}let X=q;function Z(e,n){return X=J(e,n.internalLoggerLevel),X}class Q{constructor(){this.unpatchedConsole=W,this.internalLogger=q,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 Y extends Q{isBatched(){return!1}getIgnoreUrls(){return[]}}function ee(e,n){var t,i;if(void 0===n)return e;if(void 0===e)return{resourceSpans:n};const r=null===(t=e.resourceSpans)||void 0===t?void 0:t[0];if(void 0===r)return e;const o=(null==r?void 0:r.scopeSpans)||[],s=(null===(i=null==n?void 0:n[0])||void 0===i?void 0:i.scopeSpans)||[];return Object.assign(Object.assign({},e),{resourceSpans:[Object.assign(Object.assign({},r),{scopeSpans:[...o,...s]})]})}function ne(n){let t={meta:{}};return void 0!==n[0]&&(t.meta=n[0].meta),n.forEach((n=>{switch(n.type){case e.TransportItemType.LOG:case e.TransportItemType.EVENT:case e.TransportItemType.EXCEPTION:case e.TransportItemType.MEASUREMENT:const i=F[n.type],r=t[i];t=Object.assign(Object.assign({},t),{[i]:void 0===r?[n.payload]:[...r,n.payload]});break;case e.TransportItemType.TRACE:t=Object.assign(Object.assign({},t),{traces:ee(t.traces,n.payload.resourceSpans)})}})),t}const te="Error";let ie;function re(n,t,i,r,s){t.debug("Initializing API");const a=function(n,t,i,r,o){let s;return t.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,n)=>{t.debug("Initializing OpenTelemetry"),s={trace:e,context:n}},isOTELInitialized:()=>!!s,pushTraces:n=>{try{const i={type:e.TransportItemType.TRACE,payload:n,meta:r.value};t.debug("Pushing trace\n",i),o.execute(i)}catch(e){t.error("Error pushing trace\n",e)}}}}(0,t,0,r,s);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a),function(n,t,i,r,s,a){var l;t.debug("Initializing exceptions API");let u=null;ie=null!==(l=i.parseStacktrace)&&void 0!==l?l:ie;const c=e=>{t.debug("Changing stacktrace parser"),ie=null!=e?e:ie};return c(i.parseStacktrace),{changeStacktraceParser:c,getStacktraceParser:()=>ie,pushError:(n,{skipDedupe:l,stackFrames:c,type:d,context:p}={})=>{d=d||n.name||te;const f={meta:r.value,payload:{type:d,value:n.message,timestamp:E(),trace:a.getTraceContext(),context:null!=p?p:{}},type:e.TransportItemType.EXCEPTION};(null==(c=null!=c?c:n.stack?null==ie?void 0:ie(n).frames:void 0)?void 0:c.length)&&(f.payload.stacktrace={frames:c});const g={type:f.payload.type,value:f.payload.value,stackTrace:f.payload.stacktrace,context:f.payload.context};l||!i.dedupe||o(u)||!S(g,u)?(u=g,t.debug("Pushing exception\n",f),s.execute(f)):t.debug("Skipping error push because it is the same as the last one\n",f.payload)}}}(0,t,i,r,s,a)),function(e,n,t,i,r){let o,s,a;n.debug("Initializing meta API");const l=e=>{s&&i.remove(s),s={user:e},i.add(s)},u=e=>{o&&i.remove(o),o={session:e},i.add(o)};return{setUser:l,resetUser:l,setSession:u,resetSession:u,getSession:()=>i.value.session,setView:e=>{a&&i.remove(a),a={view:e},i.add(a)},getView:()=>i.value.view}}(0,t,0,r)),function(n,t,i,r,s,a){t.debug("Initializing logs API");let l=null;return{pushLog:(n,{context:u,level:c,skipDedupe:d}={})=>{try{const p={type:e.TransportItemType.LOG,payload:{message:n.map((e=>{try{return String(e)}catch(e){return""}})).join(" "),level:null!=c?c:T,context:null!=u?u:{},timestamp:E(),trace:a.getTraceContext()},meta:r.value},f={message:p.payload.message,level:p.payload.level,context:p.payload.context};if(!d&&i.dedupe&&!o(l)&&S(f,l))return void t.debug("Skipping log push because it is the same as the last one\n",p.payload);l=f,t.debug("Pushing log\n",p),s.execute(p)}catch(e){t.error("Error pushing log\n",e)}}}}(0,t,i,r,s,a)),function(n,t,i,r,s,a){t.debug("Initializing measurements API");let l=null;return{pushMeasurement:(n,{skipDedupe:u,context:c}={})=>{var d;try{const p={type:e.TransportItemType.MEASUREMENT,payload:Object.assign(Object.assign({},n),{trace:a.getTraceContext(),timestamp:null!==(d=n.timestamp)&&void 0!==d?d:E(),context:null!=c?c:{}}),meta:r.value},f={type:p.payload.type,values:p.payload.values,context:p.payload.context};if(!u&&i.dedupe&&!o(l)&&S(f,l))return void t.debug("Skipping measurement push because it is the same as the last one\n",p.payload);l=f,t.debug("Pushing measurement\n",p),s.execute(p)}catch(e){t.error("Error pushing measurement\n",e)}}}}(0,t,i,r,s,a)),function(n,t,i,r,s,a){let l=null;return{pushEvent:(n,u,c,{skipDedupe:d}={})=>{try{const p={meta:r.value,payload:{name:n,domain:null!=c?c:i.eventDomain,attributes:u,timestamp:E(),trace:a.getTraceContext()},type:e.TransportItemType.EVENT},f={name:p.payload.name,attributes:p.payload.attributes,domain:p.payload.domain};if(!d&&i.dedupe&&!o(l)&&S(f,l))return void t.debug("Skipping event push because it is the same as the last one\n",p.payload);l=f,t.debug("Pushing event\n",p),s.execute(p)}catch(e){t.error("Error pushing event",e)}}}}(0,t,i,r,s,a))}const oe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0;class se extends Q{constructor(){super(...arguments),this.api={},this.transports={}}}const ae="1.2.4";const le="_faroInternal";function ue(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(oe,le,{configurable:!1,enumerable:!1,writable:!1,value:e}))}function ce(){return le in oe}function de(n,t,i,r,o,s,a){return t.debug("Initializing Faro"),e.faro={api:s,config:i,instrumentations:a,internalLogger:t,metas:r,pause:o.pause,transports:o,unpatchedConsole:n,unpause:o.unpause},ue(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 oe)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(oe,e.config.globalObjectKey,{configurable:!1,writable:!1,value:e})}}(e.faro),e.faro}function pe(e){const n=K(e),t=Z(n,e);if(ce()&&!e.isolate)return void t.error('Faro is already registered. Either add instrumentations, transports etc. to the global faro instance or use the "isolate" property');t.debug("Initializing");const i=function(e,n,t){let i=[],r=[];const o=()=>i.reduce(((e,n)=>Object.assign(e,u(n)?n():n)),{}),s=()=>{if(r.length){const e=o();r.forEach((n=>n(e)))}};return{add:(...e)=>{n.debug("Adding metas\n",e),i.push(...e),s()},remove:(...e)=>{n.debug("Removing metas\n",e),i=i.filter((n=>!e.includes(n))),s()},addListener:e=>{n.debug("Adding metas listener\n",e),r.push(e)},removeListener:e=>{n.debug("Removing metas listener\n",e),r=r.filter((n=>n!==e))},get value(){return o()}}}(0,t),r=function(e,n,t,i){var r;n.debug("Initializing transports");const o=[];let s=t.paused,a=[];const l=e=>{let n=e;for(const e of a){const t=n.map(e).filter(Boolean);if(0===t.length)return[];n=t}return n},u=e=>{const t=l(e);if(0!==t.length)for(const e of o)n.debug(`Transporting item using ${e.name}\n`,t),e.isBatched()&&e.send(t)},c=e=>{var i;const[r]=l([e]);if(void 0!==r)for(const e of o)n.debug(`Transporting item using ${e.name}\n`,r),e.isBatched()?(null===(i=t.batching)||void 0===i?void 0:i.enabled)||e.send([r]):e.send(r)};let d;return(null===(r=t.batching)||void 0===r?void 0:r.enabled)&&(d=new _(u,{sendTimeout:t.batching.sendTimeout,itemLimit:t.batching.itemLimit,paused:s})),{add:(...r)=>{n.debug("Adding transports"),r.forEach((r=>{n.debug(`Adding "${r.name}" transport`),o.some((e=>e===r))?n.warn(`Transport ${r.name} is already added`):(r.unpatchedConsole=e,r.internalLogger=n,r.config=t,r.metas=i,o.push(r))}))},addBeforeSendHooks:(...e)=>{n.debug("Adding beforeSendHooks\n",a),e.forEach((e=>{e&&a.push(e)}))},addIgnoreErrorsPatterns:(...e)=>{n.debug("Adding ignoreErrorsPatterns\n",e),e.forEach((e=>{e&&a.push($(e))}))},getBeforeSendHooks:()=>[...a],execute:e=>{var n;s||((null===(n=t.batching)||void 0===n?void 0:n.enabled)?(null==d||d.addItem(e),c(e)):c(e))},isPaused:()=>s,pause:()=>{n.debug("Pausing transports"),null==d||d.pause(),s=!0},remove:(...e)=>{n.debug("Removing transports"),e.forEach((e=>{n.debug(`Removing "${e.name}" transport`);const t=o.indexOf(e);-1!==t?o.splice(t,1):n.warn(`Transport "${e.name}" is not added`)}))},removeBeforeSendHooks:(...e)=>{a.filter((n=>!e.includes(n)))},get transports(){return[...o]},unpause:()=>{n.debug("Unpausing transports"),null==d||d.start(),s=!1}}}(n,t,e,i),o=re(0,t,e,i,r),s=function(e,n,t,i,r,o){n.debug("Initializing instrumentations");const s=[];return{add:(...a)=>{n.debug("Adding instrumentations"),a.forEach((a=>{n.debug(`Adding "${a.name}" instrumentation`),s.some((e=>e.name===a.name))?n.warn(`Instrumentation ${a.name} is already added`):(a.unpatchedConsole=e,a.internalLogger=n,a.config=t,a.metas=i,a.transports=r,a.api=o,s.push(a),a.initialize())}))},get instrumentations(){return[...s]},remove:(...e)=>{n.debug("Removing instrumentations"),e.forEach((e=>{var t,i;n.debug(`Removing "${e.name}" instrumentation`);const r=s.reduce(((n,t,i)=>null===n&&t.name===e.name?i:null),null);r?(null===(i=(t=s[r]).destroy)||void 0===i||i.call(t),s.splice(r,1)):n.warn(`Instrumentation "${e.name}" is not added`)}))}}}(n,t,e,i,r,o),a=de(n,t,e,i,r,o,s);return function(e){var n,t;const i={sdk:{version:ae}};let r=e.config.session;(null===(n=e.config.experimentalSessions)||void 0===n?void 0:n.enabled)&&(r=e.config.experimentalSessions.session),r&&e.api.setSession(r),e.config.app&&(i.app=e.config.app),e.config.user&&(i.user=e.config.user),e.config.view&&(i.view=e.config.view),e.metas.add(i,...null!==(t=e.config.metas)&&void 0!==t?t:[])}(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 fe="faro",ge={enabled:!0,sendTimeout:250,itemLimit:50},be={EventNames:{CLICK:"click",NAVIGATION:"navigation",SESSION_START:"session_start",VIEW_CHANGED:"view_changed"}},me="sessionStorage",ve="localStorage";function he(n){var t;try{let e;e=window[n];const t="__faro_storage_test__";return e.setItem(t,t),e.removeItem(t),!0}catch(i){return null===(t=e.faro.internalLogger)||void 0===t||t.info(`Web storage of type ${n} is not available. Reason: ${i}`),!1}}function we(e,n){return Te(n)?window[n].getItem(e):null}function ye(e,n,t){if(Te(t))try{window[t].setItem(e,n)}catch(e){}}function Se(e,n){Te(n)&&window[n].removeItem(e)}const Ee=he(ve),xe=he(me);function Te(e){return e===ve?Ee:e===me&&xe}function ke(e,n){let t,i=!1;const r=()=>{null!=t?(e(...t),t=null,setTimeout(r,n)):i=!1};return(...o)=>{i?t=o:(e(...o),i=!0,setTimeout(r,n))}}const Ie="__FARO_SESSION__",Oe=144e5;function Le(e){const n=C();return{sessionId:null!=e?e:A(),lastActivity:n,started:n}}function Ae(e){if(null==e)return!1;const n=C();if(!(n-e.started<Oe))return!1;return n-e.lastActivity<9e5}function Ce({fetchUserSession:n,storeUserSession:t}){return function(){var i,r,o,s;if(!n||!t)return;const a=n();if(Ae(a))t(Object.assign(Object.assign({},a),{lastActivity:C()}));else{let n=Ne(Le(),a);t(n),null===(i=e.faro.api)||void 0===i||i.setSession(n.sessionMeta),null===(o=null===(r=e.faro.config.experimentalSessions)||void 0===r?void 0:r.onSessionChange)||void 0===o||o.call(r,null!==(s=null==a?void 0:a.sessionMeta)&&void 0!==s?s:null,n.sessionMeta)}}}function Ne(n,t){var i;const r=Object.assign(Object.assign({},n),{sessionMeta:{id:n.sessionId}}),o=null===(i=e.faro.metas.value.session)||void 0===i?void 0:i.attributes;return(o||null!=t)&&(r.sessionMeta.attributes=Object.assign(Object.assign({},null!=o?o:{}),null!=t?{previousSession:t.sessionId}:{})),r}class je{constructor(e){this.initialSessionId=e,this.updateSession=ke((()=>this.updateUserSession()),1e3),this.updateUserSession=Ce({fetchUserSession:je.fetchUserSession,storeUserSession:je.storeUserSession}),this.init()}static removeUserSession(){Se(Ie,je.storageTypeLocal)}static storeUserSession(e){ye(Ie,JSON.stringify(e),je.storageTypeLocal)}static fetchUserSession(){const e=we(Ie,je.storageTypeLocal);return e?JSON.parse(e):null}init(){je.storeUserSession(Le(this.initialSessionId)),document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&this.updateSession()})),window.addEventListener("storage",(n=>{var t,i,r;if(n.key!==Ie)return;const o=JSON.parse(null!==(t=n.newValue)&&void 0!==t?t:""),s=JSON.parse(null!==(i=n.oldValue)&&void 0!==i?i:"");o.sessionId!==s.sessionId&&(null===(r=e.faro.api)||void 0===r||r.setSession(o.sessionMeta))})),e.faro.metas.addListener((function(n){const t=n.session,i=je.fetchUserSession();if(t&&t.id!==(null==i?void 0:i.sessionId)){const n=Ne(Le(t.id),i);je.storeUserSession(n),e.faro.api.setSession(n.sessionMeta)}}))}}je.storageTypeLocal=ve;class Re{constructor(e){this.initialSessionId=e,this.updateSession=ke((()=>this.updateUserSession()),1e3),this.updateUserSession=Ce({fetchUserSession:Re.fetchUserSession,storeUserSession:Re.storeUserSession}),this.init()}static removeUserSession(){Se(Ie,Re.storageTypeSession)}static storeUserSession(e){ye(Ie,JSON.stringify(e),Re.storageTypeSession)}static fetchUserSession(){const e=we(Ie,Re.storageTypeSession);return e?JSON.parse(e):null}init(){Re.storeUserSession(Le(this.initialSessionId)),document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&this.updateSession()})),e.faro.metas.addListener((function(n){const t=n.session,i=Re.fetchUserSession();if(t&&t.id!==(null==i?void 0:i.sessionId)){const n=Ne(Le(t.id),i);Re.storeUserSession(n),e.faro.api.setSession(n.sessionMeta)}}))}}Re.storageTypeSession=me;class De extends se{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-session",this.version=ae}sendSessionStartEvent(e){var n;const t=e.session;t&&t.id!==(null===(n=this.notifiedSession)||void 0===n?void 0:n.id)&&(this.notifiedSession=t,this.api.pushEvent(be.EventNames.SESSION_START,{},void 0,{skipDedupe:!0}))}getSessionManagerInstanceByConfiguredStrategy(e){var n;return(null===(n=this.config.experimentalSessions)||void 0===n?void 0:n.persistent)&&Ee?new je(e):xe?new Re(e):null}initialize(){var e,n,t;if(this.logDebug("init session instrumentation"),this.sendSessionStartEvent(this.metas.value),this.metas.addListener(this.sendSessionStartEvent.bind(this)),null===(e=this.config.experimentalSessions)||void 0===e?void 0:e.enabled){const e=this.getSessionManagerInstanceByConfiguredStrategy(null===(n=this.metas.value.session)||void 0===n?void 0:n.id);null!=e&&(null===(t=this.transports)||void 0===t||t.addBeforeSendHooks(...this.transports.getBeforeSendHooks(),(n=>(null==e||e.updateSession(),n))))}}}class Ue extends se{constructor(e={}){super(),this.options=e,this.name="@grafana/faro-web-sdk:instrumentation-console",this.version=ae}initialize(){this.logDebug("Initializing\n",this.options),k.filter((e=>{var n;return!(null!==(n=this.options.disabledLevels)&&void 0!==n?n:Ue.defaultDisabledLevels).includes(e)})).forEach((e=>{console[e]=(...n)=>{try{this.api.pushLog(n,{level:e})}catch(e){this.logError(e)}finally{this.unpatchedConsole[e](...n)}}}))}}Ue.defaultDisabledLevels=[e.LogLevel.DEBUG,e.LogLevel.TRACE,e.LogLevel.LOG];const Me=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Pe=/^\s*at (?:(.*\).*?|.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Be=/\((\S*)(?::(\d+))(?::(\d+))\)/,_e="address at ",ze=_e.length,Fe=/^\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,$e=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ve="safari-extension",qe="safari-web-extension",Ge=/Minified React error #\d+;/i;function We(e,n,t,i){const r={filename:e||document.location.href,function:n||"?"};return void 0!==t&&(r.lineno=t),void 0!==i&&(r.colno=i),r}function He(e,n){const t=null==e?void 0:e.includes(Ve),i=!t&&(null==e?void 0:e.includes(qe));return t||i?[(null==e?void 0:e.includes("@"))?e.split("@")[0]:e,t?`${Ve}:${n}`:`${qe}:${n}`]:[e,n]}function Ke(e){let n=[];e.stacktrace?n=e.stacktrace.split("\n").filter(((e,n)=>n%2==0)):e.stack&&(n=e.stack.split("\n"));const t=n.reduce(((n,t,i)=>{let r,o,s,l,u;if(r=Pe.exec(t)){if(o=r[1],s=r[2],l=r[3],u=r[4],null==s?void 0:s.startsWith("eval")){const e=Be.exec(s);e&&(s=e[1],l=e[2],u=e[3])}s=(null==s?void 0:s.startsWith(_e))?s.substring(ze):s,[o,s]=He(o,s)}else if(r=Fe.exec(t)){if(o=r[1],s=r[3],l=r[4],u=r[5],s&&s.includes(" > eval")){const e=$e.exec(s);e&&(o=o||"eval",s=e[1],l=e[2])}else 0===i&&!u&&a(e.columnNumber)&&(u=String(e.columnNumber+1));[o,s]=He(o,s)}return(s||o)&&n.push(We(s,o,l?Number(l):void 0,u?Number(u):void 0)),n}),[]);return Ge.test(e.message)?t.slice(1):t}function Je(e){return{frames:Ke(e)}}function Xe(e){let n,t,i,r,o=[];if(m(e)&&e.error)n=e.error.message,t=e.error.name,o=Ke(e.error);else if((i=v(e))||h(e)){const{name:r,message:o}=e;t=null!=r?r:i?"DOMError":"DOMException",n=o?`${t}: ${o}`:t}else b(e)?(n=e.message,o=Ke(e)):(l(e)||(r=f(e)))&&(t=r?e.constructor.name:void 0,n=`Non-Error exception captured with keys: ${Object.keys(e)}`);return[n,t,o]}function Ze(e){const n=window.onerror;window.onerror=(...t)=>{try{const[i,r,o,a,l]=t;let u,c,d=[];const p=s(i),f=We(r,"?",o,a);l||!p?([u,c,d]=Xe(null!=l?l:i),0===d.length&&(d=[f])):p&&([u,c]=function(e){var n,t;const i=e.match(Me),r=null!==(n=null==i?void 0:i[1])&&void 0!==n?n:te;return[null!==(t=null==i?void 0:i[2])&&void 0!==t?t:e,r]}(i),d=[f]),u&&e.pushError(new Error(u),{type:c,stackFrames:d})}finally{null==n||n.apply(window,t)}}}class Qe extends se{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-errors",this.version=ae}initialize(){var e;this.logDebug("Initializing"),Ze(this.api),e=this.api,window.addEventListener("unhandledrejection",(n=>{var t,i;let r,o,s=n;s.reason?s=n.reason:(null===(t=n.detail)||void 0===t?void 0:t.reason)&&(s=null===(i=n.detail)||void 0===i?void 0:i.reason);let a=[];d(s)?(r=`Non-Error promise rejection captured with value: ${String(s)}`,o="UnhandledRejection"):[r,o,a]=Xe(s),r&&e.pushError(new Error(r),{type:o,stackFrames:a})}))}}class Ye extends se{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-view",this.version=ae}sendViewChangedEvent(e){const n=e.view;n&&n!==this.notifiedView&&(this.notifiedView=n,this.api.pushEvent(be.EventNames.VIEW_CHANGED,{},void 0,{skipDedupe:!0}))}initialize(){this.sendViewChangedEvent(this.metas.value),this.metas.addListener(this.sendViewChangedEvent.bind(this))}}var en,nn,tn,rn,on,sn=-1,an=function(e){addEventListener("pageshow",(function(n){n.persisted&&(sn=n.timeStamp,e(n))}),!0)},ln=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},un=function(){var e=ln();return e&&e.activationStart||0},cn=function(e,n){var t=ln(),i="navigate";return sn>=0?i="back-forward-cache":t&&(document.prerendering||un()>0?i="prerender":document.wasDiscarded?i="restore":t.type&&(i=t.type.replace(/_/g,"-"))),{name:e,value:void 0===n?-1:n,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},dn=function(e,n,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((function(e){Promise.resolve().then((function(){n(e.getEntries())}))}));return i.observe(Object.assign({type:e,buffered:!0},t||{})),i}}catch(e){}},pn=function(e,n,t,i){var r,o;return function(s){n.value>=0&&(s||i)&&((o=n.value-(r||0))||void 0===r)&&(r=n.value,n.delta=o,n.rating=function(e,n){return e>n[1]?"poor":e>n[0]?"needs-improvement":"good"}(n.value,t),e(n))}},fn=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},gn=function(e){var n=function(n){"pagehide"!==n.type&&"hidden"!==document.visibilityState||e(n)};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},bn=function(e){var n=!1;return function(t){n||(e(t),n=!0)}},mn=-1,vn=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},hn=function(e){"hidden"===document.visibilityState&&mn>-1&&(mn="visibilitychange"===e.type?e.timeStamp:0,yn())},wn=function(){addEventListener("visibilitychange",hn,!0),addEventListener("prerenderingchange",hn,!0)},yn=function(){removeEventListener("visibilitychange",hn,!0),removeEventListener("prerenderingchange",hn,!0)},Sn=function(){return mn<0&&(mn=vn(),wn(),an((function(){setTimeout((function(){mn=vn(),wn()}),0)}))),{get firstHiddenTime(){return mn}}},En=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},xn=[1800,3e3],Tn=function(e,n){n=n||{},En((function(){var t,i=Sn(),r=cn("FCP"),o=dn("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-un(),0),r.entries.push(e),t(!0)))}))}));o&&(t=pn(e,r,xn,n.reportAllChanges),an((function(i){r=cn("FCP"),t=pn(e,r,xn,n.reportAllChanges),fn((function(){r.value=performance.now()-i.timeStamp,t(!0)}))})))}))},kn=[.1,.25],In={passive:!0,capture:!0},On=new Date,Ln=function(e,n){en||(en=n,nn=e,tn=new Date,Nn(removeEventListener),An())},An=function(){if(nn>=0&&nn<tn-On){var e={entryType:"first-input",name:en.type,target:en.target,cancelable:en.cancelable,startTime:en.timeStamp,processingStart:en.timeStamp+nn};rn.forEach((function(n){n(e)})),rn=[]}},Cn=function(e){if(e.cancelable){var n=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,n){var t=function(){Ln(e,n),r()},i=function(){r()},r=function(){removeEventListener("pointerup",t,In),removeEventListener("pointercancel",i,In)};addEventListener("pointerup",t,In),addEventListener("pointercancel",i,In)}(n,e):Ln(n,e)}},Nn=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(n){return e(n,Cn,In)}))},jn=[100,300],Rn=0,Dn=1/0,Un=0,Mn=function(e){e.forEach((function(e){e.interactionId&&(Dn=Math.min(Dn,e.interactionId),Un=Math.max(Un,e.interactionId),Rn=Un?(Un-Dn)/7+1:0)}))},Pn=function(){return on?Rn:performance.interactionCount||0},Bn=function(){"interactionCount"in performance||on||(on=dn("event",Mn,{type:"event",buffered:!0,durationThreshold:0}))},_n=[200,500],zn=0,Fn=function(){return Pn()-zn},$n=[],Vn={},qn=function(e){var n=$n[$n.length-1],t=Vn[e.interactionId];if(t||$n.length<10||e.duration>n.latency){if(t)t.entries.push(e),t.latency=Math.max(t.latency,e.duration);else{var i={id:e.interactionId,latency:e.duration,entries:[e]};Vn[i.id]=i,$n.push(i)}$n.sort((function(e,n){return n.latency-e.latency})),$n.splice(10).forEach((function(e){delete Vn[e.id]}))}},Gn=[2500,4e3],Wn={},Hn=[800,1800],Kn=function e(n){document.prerendering?En((function(){return e(n)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(n)}),!0):setTimeout(n,0)};class Jn extends se{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-web-vitals",this.version=ae}initialize(){this.logDebug("Initializing"),Object.entries(Jn.mapping).forEach((([e,n])=>{n((n=>{this.api.pushMeasurement({type:"web-vitals",values:{[e]:n.value}})}))}))}}function Xn(e={}){const n=[new Qe,new Jn,new De,new Ye];return!1!==e.captureConsole&&n.push(new Ue({disabledLevels:e.captureConsoleDisabledLevels})),n}Jn.mapping={cls:function(e,n){n=n||{},Tn(bn((function(){var t,i=cn("CLS",0),r=0,o=[],s=function(e){e.forEach((function(e){if(!e.hadRecentInput){var n=o[0],t=o[o.length-1];r&&e.startTime-t.startTime<1e3&&e.startTime-n.startTime<5e3?(r+=e.value,o.push(e)):(r=e.value,o=[e])}})),r>i.value&&(i.value=r,i.entries=o,t())},a=dn("layout-shift",s);a&&(t=pn(e,i,kn,n.reportAllChanges),gn((function(){s(a.takeRecords()),t(!0)})),an((function(){r=0,i=cn("CLS",0),t=pn(e,i,kn,n.reportAllChanges),fn((function(){return t()}))})),setTimeout(t,0))})))},fcp:Tn,fid:function(e,n){n=n||{},En((function(){var t,i=Sn(),r=cn("FID"),o=function(e){e.startTime<i.firstHiddenTime&&(r.value=e.processingStart-e.startTime,r.entries.push(e),t(!0))},s=function(e){e.forEach(o)},a=dn("first-input",s);t=pn(e,r,jn,n.reportAllChanges),a&&gn(bn((function(){s(a.takeRecords()),a.disconnect()}))),a&&an((function(){var i;r=cn("FID"),t=pn(e,r,jn,n.reportAllChanges),rn=[],nn=-1,en=null,Nn(addEventListener),i=o,rn.push(i),An()}))}))},inp:function(e,n){n=n||{},En((function(){var t;Bn();var i,r=cn("INP"),o=function(e){e.forEach((function(e){e.interactionId&&qn(e),"first-input"===e.entryType&&!$n.some((function(n){return n.entries.some((function(n){return e.duration===n.duration&&e.startTime===n.startTime}))}))&&qn(e)}));var n,t=(n=Math.min($n.length-1,Math.floor(Fn()/50)),$n[n]);t&&t.latency!==r.value&&(r.value=t.latency,r.entries=t.entries,i())},s=dn("event",o,{durationThreshold:null!==(t=n.durationThreshold)&&void 0!==t?t:40});i=pn(e,r,_n,n.reportAllChanges),s&&("interactionId"in PerformanceEventTiming.prototype&&s.observe({type:"first-input",buffered:!0}),gn((function(){o(s.takeRecords()),r.value<0&&Fn()>0&&(r.value=0,r.entries=[]),i(!0)})),an((function(){$n=[],zn=Pn(),r=cn("INP"),i=pn(e,r,_n,n.reportAllChanges)})))}))},lcp:function(e,n){n=n||{},En((function(){var t,i=Sn(),r=cn("LCP"),o=function(e){var n=e[e.length-1];n&&n.startTime<i.firstHiddenTime&&(r.value=Math.max(n.startTime-un(),0),r.entries=[n],t())},s=dn("largest-contentful-paint",o);if(s){t=pn(e,r,Gn,n.reportAllChanges);var a=bn((function(){Wn[r.id]||(o(s.takeRecords()),s.disconnect(),Wn[r.id]=!0,t(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return setTimeout(a,0)}),!0)})),gn(a),an((function(i){r=cn("LCP"),t=pn(e,r,Gn,n.reportAllChanges),fn((function(){r.value=performance.now()-i.timeStamp,Wn[r.id]=!0,t(!0)}))}))}}))},ttfb:function(e,n){n=n||{};var t=cn("TTFB"),i=pn(e,t,Hn,n.reportAllChanges);Kn((function(){var r=ln();if(r){var o=r.responseStart;if(o<=0||o>performance.now())return;t.value=Math.max(o-un(),0),t.entries=[r],i(!0),an((function(){t=cn("TTFB",0),(i=pn(e,t,Hn,n.reportAllChanges))(!0)}))}}))}};const Zn="browser";var Qn={exports:{}};!function(e,n){!function(t,i){var r="function",o="undefined",s="object",a="string",l="major",u="model",c="name",d="type",p="vendor",f="version",g="architecture",b="console",m="mobile",v="tablet",h="smarttv",w="wearable",y="embedded",S="Amazon",E="Apple",x="ASUS",T="BlackBerry",k="Browser",I="Chrome",O="Firefox",L="Google",A="Huawei",C="LG",N="Microsoft",j="Motorola",R="Opera",D="Samsung",U="Sharp",M="Sony",P="Xiaomi",B="Zebra",_="Facebook",z="Chromium OS",F="Mac OS",$=function(e){for(var n={},t=0;t<e.length;t++)n[e[t].toUpperCase()]=e[t];return n},V=function(e,n){return typeof e===a&&-1!==q(n).indexOf(q(e))},q=function(e){return e.toLowerCase()},G=function(e,n){if(typeof e===a)return e=e.replace(/^\s\s*/,""),typeof n===o?e:e.substring(0,350)},W=function(e,n){for(var t,o,a,l,u,c,d=0;d<n.length&&!u;){var p=n[d],f=n[d+1];for(t=o=0;t<p.length&&!u&&p[t];)if(u=p[t++].exec(e))for(a=0;a<f.length;a++)c=u[++o],typeof(l=f[a])===s&&l.length>0?2===l.length?typeof l[1]==r?this[l[0]]=l[1].call(this,c):this[l[0]]=l[1]:3===l.length?typeof l[1]!==r||l[1].exec&&l[1].test?this[l[0]]=c?c.replace(l[1],l[2]):i:this[l[0]]=c?l[1].call(this,c,l[2]):i:4===l.length&&(this[l[0]]=c?l[3].call(this,c.replace(l[1],l[2])):i):this[l]=c||i;d+=2}},H=function(e,n){for(var t in n)if(typeof n[t]===s&&n[t].length>0){for(var r=0;r<n[t].length;r++)if(V(n[t][r],e))return"?"===t?i:t}else if(V(n[t],e))return"?"===t?i:t;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"},J={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[f,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,f],[/opios[\/ ]+([\w\.]+)/i],[f,[c,R+" Mini"]],[/\bopr\/([\w\.]+)/i],[f,[c,R]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[c,f],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[c,"UC"+k]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[f,[c,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[f,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[c,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[f,[c,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure "+k],f],[/\bfocus\/([\w\.]+)/i],[f,[c,O+" Focus"]],[/\bopt\/([\w\.]+)/i],[f,[c,R+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[c,R+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[c,"MIUI "+k]],[/fxios\/([-\w\.]+)/i],[f,[c,O]],[/\bqihu|(qi?ho?o?|360)browser/i],[[c,"360 "+k]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1 "+k],f],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[c,f],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,_],f],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[c,f],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[c,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[f,[c,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[c,I+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,I+" WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[c,"Android "+k]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,f],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[f,[c,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[f,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[f,H,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[c,f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[c,O+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[c,f],[/(cobalt)\/([\w\.]+)/i],[c,[f,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[g,"amd64"]],[/(ia32(?=;))/i],[[g,q]],[/((?:i[346]|x)86)[;\)]/i],[[g,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[g,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[g,"armhf"]],[/windows (ce|mobile); ppc;/i],[[g,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[g,/ower/,"",q]],[/(sun4\w)[;\)]/i],[[g,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[g,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],[u,[p,D],[d,v]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[p,D],[d,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[u,[p,E],[d,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[p,E],[d,v]],[/(macintosh);/i],[u,[p,E]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[p,U],[d,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[p,A],[d,v]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[p,A],[d,m]],[/\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],[[u,/_/g," "],[p,P],[d,m]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[p,P],[d,v]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[p,"OPPO"],[d,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[p,"Vivo"],[d,m]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[u,[p,"Realme"],[d,m]],[/\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],[u,[p,j],[d,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[p,j],[d,v]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[p,C],[d,v]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[p,C],[d,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[p,"Lenovo"],[d,v]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[p,"Nokia"],[d,m]],[/(pixel c)\b/i],[u,[p,L],[d,v]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[p,L],[d,m]],[/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],[u,[p,M],[d,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[p,M],[d,v]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[p,"OnePlus"],[d,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[p,S],[d,v]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[p,S],[d,m]],[/(playbook);[-\w\),; ]+(rim)/i],[u,p,[d,v]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[p,T],[d,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[p,x],[d,v]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[p,x],[d,m]],[/(nexus 9)/i],[u,[p,"HTC"],[d,v]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[p,[u,/_/g," "],[d,m]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[p,"Acer"],[d,v]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[p,"Meizu"],[d,m]],[/(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],[p,u,[d,m]],[/(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],[p,u,[d,v]],[/(surface duo)/i],[u,[p,N],[d,v]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[p,"Fairphone"],[d,m]],[/(u304aa)/i],[u,[p,"AT&T"],[d,m]],[/\bsie-(\w*)/i],[u,[p,"Siemens"],[d,m]],[/\b(rct\w+) b/i],[u,[p,"RCA"],[d,v]],[/\b(venue[\d ]{2,7}) b/i],[u,[p,"Dell"],[d,v]],[/\b(q(?:mv|ta)\w+) b/i],[u,[p,"Verizon"],[d,v]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[p,"Barnes & Noble"],[d,v]],[/\b(tm\d{3}\w+) b/i],[u,[p,"NuVision"],[d,v]],[/\b(k88) b/i],[u,[p,"ZTE"],[d,v]],[/\b(nx\d{3}j) b/i],[u,[p,"ZTE"],[d,m]],[/\b(gen\d{3}) b.+49h/i],[u,[p,"Swiss"],[d,m]],[/\b(zur\d{3}) b/i],[u,[p,"Swiss"],[d,v]],[/\b((zeki)?tb.*\b) b/i],[u,[p,"Zeki"],[d,v]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[p,"Dragon Touch"],u,[d,v]],[/\b(ns-?\w{0,9}) b/i],[u,[p,"Insignia"],[d,v]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[p,"NextBook"],[d,v]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[p,"Voice"],u,[d,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[p,"LvTel"],u,[d,m]],[/\b(ph-1) /i],[u,[p,"Essential"],[d,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[p,"Envizen"],[d,v]],[/\b(trio[-\w\. ]+) b/i],[u,[p,"MachSpeed"],[d,v]],[/\btu_(1491) b/i],[u,[p,"Rotor"],[d,v]],[/(shield[\w ]+) b/i],[u,[p,"Nvidia"],[d,v]],[/(sprint) (\w+)/i],[p,u,[d,m]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[p,N],[d,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[p,B],[d,v]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[p,B],[d,m]],[/smart-tv.+(samsung)/i],[p,[d,h]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[p,D],[d,h]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[p,C],[d,h]],[/(apple) ?tv/i],[p,[u,E+" TV"],[d,h]],[/crkey/i],[[u,I+"cast"],[p,L],[d,h]],[/droid.+aft(\w+)( bui|\))/i],[u,[p,S],[d,h]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[u,[p,U],[d,h]],[/(bravia[\w ]+)( bui|\))/i],[u,[p,M],[d,h]],[/(mitv-\w{5}) bui/i],[u,[p,P],[d,h]],[/Hbbtv.*(technisat) (.*);/i],[p,u,[d,h]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[p,G],[u,G],[d,h]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,h]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[p,u,[d,b]],[/droid.+; (shield) bui/i],[u,[p,"Nvidia"],[d,b]],[/(playstation [345portablevi]+)/i],[u,[p,M],[d,b]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[p,N],[d,b]],[/((pebble))app/i],[p,u,[d,w]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[u,[p,E],[d,w]],[/droid.+; (glass) \d/i],[u,[p,L],[d,w]],[/droid.+; (wt63?0{2,3})\)/i],[u,[p,B],[d,w]],[/(quest( 2| pro)?)/i],[u,[p,_],[d,w]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[p,[d,y]],[/(aeobc)\b/i],[u,[p,S],[d,y]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[u,[d,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[d,v]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,v]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,m]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[p,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[c,f],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,f],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[c,[f,H,K]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,"Windows"],[f,H,K]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,F],[f,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[f,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[c,f],[/\(bb(10);/i],[f,[c,T]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[f,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[f,[c,O+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[c,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[f,[c,"watchOS"]],[/crkey\/([\d\.]+)/i],[f,[c,I+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[c,z],f],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[c,f],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],f],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[c,f]]},X=function(e,n){if(typeof e===s&&(n=e,e=i),!(this instanceof X))return new X(e,n).getResult();var b=typeof t!==o&&t.navigator?t.navigator:i,h=e||(b&&b.userAgent?b.userAgent:""),w=b&&b.userAgentData?b.userAgentData:i,y=n?function(e,n){var t={};for(var i in e)n[i]&&n[i].length%2==0?t[i]=n[i].concat(e[i]):t[i]=e[i];return t}(J,n):J,S=b&&b.userAgent==h;return this.getBrowser=function(){var e,n={};return n[c]=i,n[f]=i,W.call(n,h,y.browser),n[l]=typeof(e=n[f])===a?e.replace(/[^\d\.]/g,"").split(".")[0]:i,S&&b&&b.brave&&typeof b.brave.isBrave==r&&(n[c]="Brave"),n},this.getCPU=function(){var e={};return e[g]=i,W.call(e,h,y.cpu),e},this.getDevice=function(){var e={};return e[p]=i,e[u]=i,e[d]=i,W.call(e,h,y.device),S&&!e[d]&&w&&w.mobile&&(e[d]=m),S&&"Macintosh"==e[u]&&b&&typeof b.standalone!==o&&b.maxTouchPoints&&b.maxTouchPoints>2&&(e[u]="iPad",e[d]=v),e},this.getEngine=function(){var e={};return e[c]=i,e[f]=i,W.call(e,h,y.engine),e},this.getOS=function(){var e={};return e[c]=i,e[f]=i,W.call(e,h,y.os),S&&!e[c]&&w&&"Unknown"!=w.platform&&(e[c]=w.platform.replace(/chrome os/i,z).replace(/macos/i,F)),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 h},this.setUA=function(e){return h=typeof e===a&&e.length>350?G(e,350):e,this},this.setUA(h),this};X.VERSION="1.0.36",X.BROWSER=$([c,f,l]),X.CPU=$([g]),X.DEVICE=$([u,p,d,b,m,h,v,w,y]),X.ENGINE=X.OS=$([c,f]),e.exports&&(n=e.exports=X),n.UAParser=X;var Z=typeof t!==o&&(t.jQuery||t.Zepto);if(Z&&!Z.ua){var Q=new X;Z.ua=Q.getResult(),Z.ua.get=function(){return Q.getUA()},Z.ua.set=function(e){Q.setUA(e);var n=Q.getResult();for(var t in n)Z.ua[t]=n[t]}}}("object"==typeof window?window:N)}(Qn,Qn.exports);var Yn=Qn.exports;const et=()=>{const e=new Yn.UAParser,{name:n,version:t}=e.getBrowser(),{name:i,version:r}=e.getOS(),o=e.getUA(),s=navigator.language,a=navigator.userAgent.includes("Mobi"),l=function(){if(!n||!t)return;if("userAgentData"in navigator)return navigator.userAgentData.brands;return}(),u="unknown";return{browser:{name:null!=n?n:u,version:null!=t?t:u,os:`${null!=i?i:u} ${null!=r?r:u}`,userAgent:null!=o?o:u,language:null!=s?s:u,mobile:a,brands:null!=l?l:u}}},nt=()=>({page:{url:location.href}}),tt=[et,nt];function it(e){return{id:A(),attributes:e}}const rt={name:"default"},ot=()=>({k6:{isK6Browser:!0}});function st(e,n,t,i){return new(t||(t=Promise))((function(r,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var n;e.done?r(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(s,a)}l((i=i.apply(e,n||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class at extends Y{constructor(e){var n,t,i,r;super(),this.options=e,this.name="@grafana/faro-web-sdk:transport-fetch",this.version=ae,this.disabledUntil=new Date,this.rateLimitBackoffMs=null!==(n=e.defaultRateLimitBackoffMs)&&void 0!==n?n:5e3,this.getNow=null!==(t=e.getNow)&&void 0!==t?t:()=>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 st(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((()=>{var n,t,i;const r=JSON.stringify(ne(e)),{url:o,requestOptions:s,apiKey:a}=this.options,l=null!=s?s:{},{headers:u}=l,c=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)n.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(t[i[r]]=e[i[r]])}return t}(l,["headers"]);return fetch(o,Object.assign({method:"POST",headers:Object.assign(Object.assign(Object.assign({"Content-Type":"application/json"},null!=u?u:{}),a?{"x-api-key":a}:{}),(null===(n=this.config.experimentalSessions)||void 0===n?void 0:n.enabled)&&(null===(t=this.metas.value.session)||void 0===t?void 0:t.id)?{"x-faro-session-id":null===(i=this.metas.value.session)||void 0===i?void 0:i.id}:{}),body:r,keepalive:r.length<=6e4},null!=c?c:{})).then((e=>(429===e.status&&(this.disabledUntil=this.getRetryAfterDate(e),this.logWarn(`Too many requests, backing off until ${this.disabledUntil}`)),e.text().catch(I),e))).catch((e=>{this.logError("Failed sending payload to the receiver\n",JSON.parse(r),e)}))}))}catch(e){this.logError(e)}}))}getIgnoreUrls(){return[this.options.url]}isBatched(){return!0}getRetryAfterDate(e){const n=this.getNow(),t=e.headers.get("Retry-After");if(t){const e=Number(t);if(!isNaN(e))return new Date(1e3*e+n);const i=Date.parse(t);if(!isNaN(i))return new Date(i)}return new Date(n+this.rateLimitBackoffMs)}}const lt={persistent:!1,maxSessionPersistenceTime:147e5};function ut(e){var n,t,i,r,o,s,a,u,c,d;const p=[],f=J(e.unpatchedConsole,e.internalLoggerLevel);return e.transports?((e.url||e.apiKey)&&f.error('if "transports" is defined, "url" and "apiKey" should not be defined'),p.push(...e.transports)):e.url?p.push(new at({url:e.url,apiKey:e.apiKey})):f.error('either "url" or "transports" must be defined'),{app:e.app,batching:Object.assign(Object.assign({},ge),e.batching),dedupe:null===(n=e.dedupe)||void 0===n||n,globalObjectKey:e.globalObjectKey||fe,instrumentations:null!==(t=e.instrumentations)&&void 0!==t?t:Xn(),internalLoggerLevel:null!==(i=e.internalLoggerLevel)&&void 0!==i?i:G,isolate:null!==(r=e.isolate)&&void 0!==r&&r,metas:function(){const n=tt;return e.metas&&n.push(...e.metas),l(window.k6)?[...n,ot]:n}(),parseStacktrace:Je,paused:null!==(o=e.paused)&&void 0!==o&&o,preventGlobalExposure:null!==(s=e.preventGlobalExposure)&&void 0!==s&&s,transports:p,unpatchedConsole:null!==(a=e.unpatchedConsole)&&void 0!==a?a:W,beforeSend:e.beforeSend,eventDomain:null!==(u=e.eventDomain)&&void 0!==u?u:Zn,ignoreErrors:e.ignoreErrors,experimentalSessions:Object.assign(Object.assign(Object.assign({enabled:!1},lt),{session:ct(e.experimentalSessions)}),e.experimentalSessions),session:null!==(c=e.session)&&void 0!==c?c:it(),user:e.user,view:null!==(d=e.view)&&void 0!==d?d:rt}}function ct(e){const n=Object.assign(Object.assign({},lt),e);let t;if(n.persistent){const e=je.fetchUserSession(),i=C();e&&e.lastActivity<i-n.maxSessionPersistenceTime&&je.removeUserSession(),t=Ae(e)?null==e?void 0:e.sessionId:it().id}return{id:null!=t?t:it().id}}return e.BaseExtension=Q,e.BaseInstrumentation=se,e.BaseTransport=Y,e.ConsoleInstrumentation=Ue,e.ConsoleTransport=class extends Y{constructor(e={}){super(),this.options=e,this.name="@grafana/faro-web-sdk:transport-console",this.version=ae}send(n){var t;return this.unpatchedConsole[null!==(t=this.options.level)&&void 0!==t?t:e.LogLevel.DEBUG]("New event",ne([n]))}},e.Conventions=be,e.ErrorsInstrumentation=Qe,e.FetchTransport=at,e.SessionInstrumentation=De,e.VERSION=ae,e.ViewInstrumentation=Ye,e.WebVitalsInstrumentation=Jn,e.allLogLevels=k,e.browserMeta=et,e.buildStackFrame=We,e.createInternalLogger=J,e.createPromiseBuffer=O,e.createSession=it,e.deepEqual=S,e.defaultEventDomain=Zn,e.defaultExceptionType=te,e.defaultGlobalObjectKey=fe,e.defaultInternalLoggerLevel=G,e.defaultLogLevel=T,e.defaultMetas=tt,e.defaultViewMeta=rt,e.genShortID=A,e.getCurrentTimestamp=E,e.getDataFromSafariExtensions=He,e.getInternalFaroFromGlobalObject=function(){return oe[le]},e.getStackFramesFromError=Ke,e.getTransportBody=ne,e.getWebInstrumentations=Xn,e.globalObject=oe,e.initializeFaro=function(e){const n=ut(e);if(n)return pe(n)},e.internalGlobalObjectKey=le,e.isArray=c,e.isBoolean=e=>n(e,"boolean"),e.isDomError=v,e.isDomException=h,e.isElement=e=>w&&i(e,Element),e.isElementDefined=w,e.isError=b,e.isErrorDefined=g,e.isErrorEvent=m,e.isEvent=f,e.isEventDefined=p,e.isFunction=u,e.isInstanceOf=i,e.isInt=e=>a(e)&&Number.isInteger(e),e.isInternalFaroOnGlobalObject=ce,e.isMap=e=>y&&i(e,Map),e.isMapDefined=y,e.isNull=o,e.isNumber=a,e.isObject=l,e.isPrimitive=d,e.isRegExp=e=>t(e,"RegExp"),e.isString=s,e.isSymbol=e=>n(e,"symbol"),e.isSyntheticEvent=e=>l(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e,e.isThenable=e=>u(null==e?void 0:e.then),e.isToString=t,e.isTypeof=n,e.isUndefined=r,e.makeCoreConfig=ut,e.noop=I,e.pageMeta=nt,e.parseStacktrace=Je,e.sdkMeta=()=>({sdk:{name:"@grafana/faro-core",version:ae,integrations:e.faro.config.instrumentations.map((({name:e,version:n})=>({name:e,version:n})))}}),e.setInternalFaroOnGlobalObject=ue,e.transportItemTypeToBodyKey=F,e}({});

@@ -7,3 +7,3 @@ export { getWebInstrumentations, makeCoreConfig } from './config';

export type { ConsoleInstrumentationOptions, ErrorEvent, ExtendedPromiseRejectionEvent } from './instrumentations';
export { browserMeta, createSession, defaultMetas, defaultViewMeta, pageMeta } from './metas';
export { browserMeta, createSession, defaultMetas, defaultViewMeta, pageMeta, sdkMeta } from './metas';
export { ConsoleTransport, FetchTransport } from './transports';

@@ -10,0 +10,0 @@ export type { ClockFn, ConsoleTransportOptions, FetchTransportOptions, FetchTransportRequestOptions, } from './transports';

@@ -6,3 +6,3 @@ import { BaseInstrumentation, LogLevel } from '@grafana/faro-core';

readonly name = "@grafana/faro-web-sdk:instrumentation-console";
readonly version = "1.2.3";
readonly version = "1.2.4";
static defaultDisabledLevels: LogLevel[];

@@ -9,0 +9,0 @@ constructor(options?: ConsoleInstrumentationOptions);

import { BaseInstrumentation } from '@grafana/faro-core';
export declare class ErrorsInstrumentation extends BaseInstrumentation {
readonly name = "@grafana/faro-web-sdk:instrumentation-errors";
readonly version = "1.2.3";
readonly version = "1.2.4";
initialize(): void;
}
export { SessionInstrumentation } from './instrumentation';
export * from './sessionHandler';
export * from './sessionManager';
import { BaseInstrumentation } from '@grafana/faro-core';
export declare class SessionInstrumentation extends BaseInstrumentation {
readonly name = "@grafana/faro-web-sdk:instrumentation-session";
readonly version = "1.2.3";
readonly version = "1.2.4";
private notifiedSession;
private sessionUpdater;
private sendSessionStartEvent;
private getSessionManagerInstanceByConfiguredStrategy;
initialize(): void;
}
import { BaseInstrumentation } from '@grafana/faro-core';
export declare class ViewInstrumentation extends BaseInstrumentation {
readonly name = "@grafana/faro-web-sdk:instrumentation-view";
readonly version = "1.2.3";
readonly version = "1.2.4";
private notifiedView;

@@ -6,0 +6,0 @@ private sendViewChangedEvent;

import { BaseInstrumentation } from '@grafana/faro-core';
export declare class WebVitalsInstrumentation extends BaseInstrumentation {
readonly name = "@grafana/faro-web-sdk:instrumentation-web-vitals";
readonly version = "1.2.3";
readonly version = "1.2.4";
static mapping: {

@@ -6,0 +6,0 @@ cls: (onReport: import("web-vitals").CLSReportCallback, opts?: import("web-vitals").ReportOpts | undefined) => void;

@@ -6,1 +6,2 @@ export { browserMeta } from './browser';

export { defaultViewMeta } from './view';
export { sdkMeta } from './sdk';

@@ -7,5 +7,5 @@ import { BaseTransport } from '@grafana/faro-core';

readonly name = "@grafana/faro-web-sdk:transport-console";
readonly version = "1.2.3";
readonly version = "1.2.4";
constructor(options?: ConsoleTransportOptions);
send(item: TransportItem): void;
}

@@ -7,3 +7,3 @@ import { BaseTransport, PromiseBuffer } from '@grafana/faro-core';

readonly name = "@grafana/faro-web-sdk:transport-fetch";
readonly version = "1.2.3";
readonly version = "1.2.4";
promiseBuffer: PromiseBuffer<Response | void>;

@@ -10,0 +10,0 @@ private readonly rateLimitBackoffMs;

@@ -1,7 +0,33 @@

type StorageMechanism = 'sessionStorage' | 'localStorage';
export declare const webStorageType: {
readonly session: "sessionStorage";
readonly local: "localStorage";
};
type StorageMechanism = (typeof webStorageType)[keyof typeof webStorageType];
/**
* Check if selected web storage mechanism is available.
* @param type storage mechanism to test availability for.
* @returns
*/
export declare function isWebStorageAvailable(type: StorageMechanism): boolean;
/**
* Get item from SessionStorage or LocalStorage.
* @param key: the item key.
* @param webStorageMechanism: wether the item shall be received form local storage or session storage. Defaults to local storage.
*/
export declare function getItem(key: string, webStorageMechanism: StorageMechanism): string | null;
/**
* Store item in SessionStorage or LocalStorage.
* @param key: the item key.
* @param value: the item data.
* @param webStorageMechanism: wether the item shall be received form local storage or session storage. Defaults to local storage.
*/
export declare function setItem(key: string, value: string, webStorageMechanism: StorageMechanism): void;
/**
* Remove item from SessionStorage or LocalStorage.
* @param key: the item key.
* @param webStorageMechanism: wether the item shall be received form local storage or session storage. Defaults to local storage.
*/
export declare function removeItem(key: string, webStorageMechanism: StorageMechanism): void;
export declare const isLocalStorageAvailable: boolean;
export declare function getItem(key: string): string | null;
export declare function setItem(key: string, value: string): void;
export declare function removeItem(key: string): void;
export declare const isSessionStorageAvailable: boolean;
export {};

@@ -27,3 +27,4 @@ "use strict";

var instrumentations_1 = require("../instrumentations");
var session_1 = require("../instrumentations/session");
var sessionManager_1 = require("../instrumentations/session/sessionManager");
var sessionManagerUtils_1 = require("../instrumentations/session/sessionManager/sessionManagerUtils");
var metas_1 = require("../metas");

@@ -33,2 +34,7 @@ var k6_1 = require("../metas/k6");

var getWebInstrumentations_1 = require("./getWebInstrumentations");
var defaultSessionPersistenceConfig = {
// enabled: true; // TODO: uncomment once we switch
persistent: false,
maxSessionPersistenceTime: sessionManagerUtils_1.MAX_SESSION_PERSISTENCE_TIME,
};
function makeCoreConfig(browserConfig) {

@@ -82,5 +88,5 @@ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;

// The new session management feature is a PoC and still under development and IS NOT READY for any production use!
experimentalSessions: __assign({
experimentalSessions: __assign(__assign(__assign({
// TODO: will be true on release
enabled: false, persistent: false, session: createSessionMeta() }, browserConfig.experimentalSessions),
enabled: false }, defaultSessionPersistenceConfig), { session: createSessionMeta(browserConfig.experimentalSessions) }), browserConfig.experimentalSessions),
// TODO: deprecate/remove old init code or maybe rename to legacy_session?

@@ -93,9 +99,18 @@ session: (_j = browserConfig.session) !== null && _j !== void 0 ? _j : (0, metas_1.createSession)(),

exports.makeCoreConfig = makeCoreConfig;
function createSessionMeta() {
var userSession = (0, session_1.fetchUserSession)();
var sessionId = (0, session_1.isUserSessionValid)(userSession) ? userSession === null || userSession === void 0 ? void 0 : userSession.sessionId : (0, metas_1.createSession)().id;
function createSessionMeta(sessionsConfig) {
var _sessionsConfig = __assign(__assign({}, defaultSessionPersistenceConfig), sessionsConfig);
var sessionId;
if (_sessionsConfig.persistent) {
var userSession = sessionManager_1.PersistentSessionsManager.fetchUserSession();
var now = (0, faro_core_1.dateNow)();
var shouldClearPersistentSession = userSession && userSession.lastActivity < now - _sessionsConfig.maxSessionPersistenceTime;
if (shouldClearPersistentSession) {
sessionManager_1.PersistentSessionsManager.removeUserSession();
}
sessionId = (0, sessionManagerUtils_1.isUserSessionValid)(userSession) ? userSession === null || userSession === void 0 ? void 0 : userSession.sessionId : (0, metas_1.createSession)().id;
}
return {
id: sessionId,
id: sessionId !== null && sessionId !== void 0 ? sessionId : (0, metas_1.createSession)().id,
};
}
//# sourceMappingURL=makeCoreConfig.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isEventDefined = exports.isEvent = exports.isErrorEvent = exports.isErrorDefined = exports.isError = exports.isElementDefined = exports.isElement = exports.isDomException = exports.isDomError = exports.isBoolean = exports.isArray = exports.internalGlobalObjectKey = exports.globalObject = exports.getTransportBody = exports.getInternalFaroFromGlobalObject = exports.getCurrentTimestamp = exports.genShortID = exports.defaultLogLevel = exports.defaultInternalLoggerLevel = exports.defaultGlobalObjectKey = exports.defaultExceptionType = exports.deepEqual = exports.createPromiseBuffer = exports.createInternalLogger = exports.Conventions = exports.BaseTransport = exports.BaseInstrumentation = exports.BaseExtension = exports.allLogLevels = exports.faro = exports.FetchTransport = exports.ConsoleTransport = exports.pageMeta = exports.defaultViewMeta = exports.defaultMetas = exports.createSession = exports.browserMeta = exports.SessionInstrumentation = exports.WebVitalsInstrumentation = exports.ViewInstrumentation = exports.parseStacktrace = exports.getStackFramesFromError = exports.getDataFromSafariExtensions = exports.ErrorsInstrumentation = exports.ConsoleInstrumentation = exports.buildStackFrame = exports.initializeFaro = exports.defaultEventDomain = exports.makeCoreConfig = exports.getWebInstrumentations = void 0;
exports.VERSION = exports.transportItemTypeToBodyKey = exports.TransportItemType = exports.setInternalFaroOnGlobalObject = exports.noop = exports.LogLevel = exports.InternalLoggerLevel = exports.isUndefined = exports.isTypeof = exports.isToString = exports.isThenable = exports.isSyntheticEvent = exports.isSymbol = exports.isString = exports.isRegExp = exports.isPrimitive = exports.isObject = exports.isNumber = exports.isNull = exports.isMapDefined = exports.isMap = exports.isInternalFaroOnGlobalObject = exports.isInt = exports.isInstanceOf = exports.isFunction = void 0;
exports.isEvent = exports.isErrorEvent = exports.isErrorDefined = exports.isError = exports.isElementDefined = exports.isElement = exports.isDomException = exports.isDomError = exports.isBoolean = exports.isArray = exports.internalGlobalObjectKey = exports.globalObject = exports.getTransportBody = exports.getInternalFaroFromGlobalObject = exports.getCurrentTimestamp = exports.genShortID = exports.defaultLogLevel = exports.defaultInternalLoggerLevel = exports.defaultGlobalObjectKey = exports.defaultExceptionType = exports.deepEqual = exports.createPromiseBuffer = exports.createInternalLogger = exports.Conventions = exports.BaseTransport = exports.BaseInstrumentation = exports.BaseExtension = exports.allLogLevels = exports.faro = exports.FetchTransport = exports.ConsoleTransport = exports.sdkMeta = exports.pageMeta = exports.defaultViewMeta = exports.defaultMetas = exports.createSession = exports.browserMeta = exports.SessionInstrumentation = exports.WebVitalsInstrumentation = exports.ViewInstrumentation = exports.parseStacktrace = exports.getStackFramesFromError = exports.getDataFromSafariExtensions = exports.ErrorsInstrumentation = exports.ConsoleInstrumentation = exports.buildStackFrame = exports.initializeFaro = exports.defaultEventDomain = exports.makeCoreConfig = exports.getWebInstrumentations = void 0;
exports.VERSION = exports.transportItemTypeToBodyKey = exports.TransportItemType = exports.setInternalFaroOnGlobalObject = exports.noop = exports.LogLevel = exports.InternalLoggerLevel = exports.isUndefined = exports.isTypeof = exports.isToString = exports.isThenable = exports.isSyntheticEvent = exports.isSymbol = exports.isString = exports.isRegExp = exports.isPrimitive = exports.isObject = exports.isNumber = exports.isNull = exports.isMapDefined = exports.isMap = exports.isInternalFaroOnGlobalObject = exports.isInt = exports.isInstanceOf = exports.isFunction = exports.isEventDefined = void 0;
var config_1 = require("./config");

@@ -28,2 +28,3 @@ Object.defineProperty(exports, "getWebInstrumentations", { enumerable: true, get: function () { return config_1.getWebInstrumentations; } });

Object.defineProperty(exports, "pageMeta", { enumerable: true, get: function () { return metas_1.pageMeta; } });
Object.defineProperty(exports, "sdkMeta", { enumerable: true, get: function () { return metas_1.sdkMeta; } });
var transports_1 = require("./transports");

@@ -30,0 +31,0 @@ Object.defineProperty(exports, "ConsoleTransport", { enumerable: true, get: function () { return transports_1.ConsoleTransport; } });

@@ -20,3 +20,3 @@ "use strict";

Object.defineProperty(exports, "SessionInstrumentation", { enumerable: true, get: function () { return instrumentation_1.SessionInstrumentation; } });
__exportStar(require("./sessionHandler"), exports);
__exportStar(require("./sessionManager"), exports);
//# sourceMappingURL=index.js.map

@@ -29,3 +29,5 @@ "use strict";

var faro_core_1 = require("@grafana/faro-core");
var sessionHandler_1 = require("./sessionHandler");
var webStorage_1 = require("../../utils/webStorage");
var PersistentSessionsManager_1 = require("./sessionManager/PersistentSessionsManager");
var VolatileSessionManager_1 = require("./sessionManager/VolatileSessionManager");
var SessionInstrumentation = /** @class */ (function (_super) {

@@ -49,4 +51,13 @@ __extends(SessionInstrumentation, _super);

};
SessionInstrumentation.prototype.getSessionManagerInstanceByConfiguredStrategy = function (initialSessionId) {
var _a;
if (((_a = this.config.experimentalSessions) === null || _a === void 0 ? void 0 : _a.persistent) && webStorage_1.isLocalStorageAvailable) {
return new PersistentSessionsManager_1.PersistentSessionsManager(initialSessionId);
}
if (webStorage_1.isSessionStorageAvailable) {
return new VolatileSessionManager_1.VolatileSessionsManager(initialSessionId);
}
return null;
};
SessionInstrumentation.prototype.initialize = function () {
var _this = this;
var _a, _b, _c;

@@ -57,9 +68,9 @@ this.logDebug('init session instrumentation');

if ((_a = this.config.experimentalSessions) === null || _a === void 0 ? void 0 : _a.enabled) {
this.sessionUpdater = (0, sessionHandler_1.getSessionUpdater)((_b = this.metas.value.session) === null || _b === void 0 ? void 0 : _b.id);
this.sessionUpdater.init();
(_c = this.transports) === null || _c === void 0 ? void 0 : _c.addBeforeSendHooks.apply(_c, __spreadArray(__spreadArray([], this.transports.getBeforeSendHooks(), false), [function (item) {
var _a;
(_a = _this.sessionUpdater) === null || _a === void 0 ? void 0 : _a.handleUpdate();
return item;
}], false));
var sessionManager_1 = this.getSessionManagerInstanceByConfiguredStrategy((_b = this.metas.value.session) === null || _b === void 0 ? void 0 : _b.id);
if (sessionManager_1 != null) {
(_c = this.transports) === null || _c === void 0 ? void 0 : _c.addBeforeSendHooks.apply(_c, __spreadArray(__spreadArray([], this.transports.getBeforeSendHooks(), false), [function (item) {
sessionManager_1 === null || sessionManager_1 === void 0 ? void 0 : sessionManager_1.updateSession();
return item;
}], false));
}
}

@@ -66,0 +77,0 @@ };

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultViewMeta = exports.createSession = exports.pageMeta = exports.defaultMetas = exports.browserMeta = void 0;
exports.sdkMeta = exports.defaultViewMeta = exports.createSession = exports.pageMeta = exports.defaultMetas = exports.browserMeta = void 0;
var browser_1 = require("./browser");

@@ -14,2 +14,4 @@ Object.defineProperty(exports, "browserMeta", { enumerable: true, get: function () { return browser_1.browserMeta; } });

Object.defineProperty(exports, "defaultViewMeta", { enumerable: true, get: function () { return view_1.defaultViewMeta; } });
var sdk_1 = require("./sdk");
Object.defineProperty(exports, "sdkMeta", { enumerable: true, get: function () { return sdk_1.sdkMeta; } });
//# sourceMappingURL=index.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.removeItem = exports.setItem = exports.getItem = exports.isLocalStorageAvailable = exports.isWebStorageAvailable = void 0;
exports.isSessionStorageAvailable = exports.isLocalStorageAvailable = exports.removeItem = exports.setItem = exports.getItem = exports.isWebStorageAvailable = exports.webStorageType = void 0;
var faro_core_1 = require("@grafana/faro-core");
exports.webStorageType = {
session: 'sessionStorage',
local: 'localStorage',
};
// TODO: remove default storage type from all function
/**
* Check if selected web storage mechanism is available.
* @param type storage mechanism to test availability for.
* @returns
*/
function isWebStorageAvailable(type) {

@@ -22,6 +32,10 @@ var _a;

exports.isWebStorageAvailable = isWebStorageAvailable;
exports.isLocalStorageAvailable = isWebStorageAvailable('localStorage');
function getItem(key) {
if (exports.isLocalStorageAvailable) {
return localStorage.getItem(key);
/**
* Get item from SessionStorage or LocalStorage.
* @param key: the item key.
* @param webStorageMechanism: wether the item shall be received form local storage or session storage. Defaults to local storage.
*/
function getItem(key, webStorageMechanism) {
if (isWebStorageTypeAvailable(webStorageMechanism)) {
return window[webStorageMechanism].getItem(key);
}

@@ -31,6 +45,12 @@ return null;

exports.getItem = getItem;
function setItem(key, value) {
if (exports.isLocalStorageAvailable) {
/**
* Store item in SessionStorage or LocalStorage.
* @param key: the item key.
* @param value: the item data.
* @param webStorageMechanism: wether the item shall be received form local storage or session storage. Defaults to local storage.
*/
function setItem(key, value, webStorageMechanism) {
if (isWebStorageTypeAvailable(webStorageMechanism)) {
try {
localStorage.setItem(key, value);
window[webStorageMechanism].setItem(key, value);
}

@@ -43,8 +63,24 @@ catch (error) {

exports.setItem = setItem;
function removeItem(key) {
if (exports.isLocalStorageAvailable) {
localStorage.removeItem(key);
/**
* Remove item from SessionStorage or LocalStorage.
* @param key: the item key.
* @param webStorageMechanism: wether the item shall be received form local storage or session storage. Defaults to local storage.
*/
function removeItem(key, webStorageMechanism) {
if (isWebStorageTypeAvailable(webStorageMechanism)) {
window[webStorageMechanism].removeItem(key);
}
}
exports.removeItem = removeItem;
exports.isLocalStorageAvailable = isWebStorageAvailable(exports.webStorageType.local);
exports.isSessionStorageAvailable = isWebStorageAvailable(exports.webStorageType.session);
function isWebStorageTypeAvailable(webStorageMechanism) {
if (webStorageMechanism === exports.webStorageType.local) {
return exports.isLocalStorageAvailable;
}
if (webStorageMechanism === exports.webStorageType.session) {
return exports.isSessionStorageAvailable;
}
return false;
}
//# sourceMappingURL=webStorage.js.map

@@ -1,5 +0,6 @@

import { createInternalLogger, defaultBatchingConfig, defaultGlobalObjectKey, defaultInternalLoggerLevel, defaultUnpatchedConsole, isObject, } from '@grafana/faro-core';
import { createInternalLogger, dateNow, defaultBatchingConfig, defaultGlobalObjectKey, defaultInternalLoggerLevel, defaultUnpatchedConsole, isObject, } from '@grafana/faro-core';
import { defaultEventDomain } from '../consts';
import { parseStacktrace } from '../instrumentations';
import { fetchUserSession, isUserSessionValid } from '../instrumentations/session';
import { PersistentSessionsManager } from '../instrumentations/session/sessionManager';
import { isUserSessionValid, MAX_SESSION_PERSISTENCE_TIME, } from '../instrumentations/session/sessionManager/sessionManagerUtils';
import { createSession, defaultMetas, defaultViewMeta } from '../metas';

@@ -9,2 +10,7 @@ import { k6Meta } from '../metas/k6';

import { getWebInstrumentations } from './getWebInstrumentations';
const defaultSessionPersistenceConfig = {
// enabled: true; // TODO: uncomment once we switch
persistent: false,
maxSessionPersistenceTime: MAX_SESSION_PERSISTENCE_TIME,
};
export function makeCoreConfig(browserConfig) {

@@ -58,5 +64,5 @@ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;

// The new session management feature is a PoC and still under development and IS NOT READY for any production use!
experimentalSessions: Object.assign({
experimentalSessions: Object.assign(Object.assign(Object.assign({
// TODO: will be true on release
enabled: false, persistent: false, session: createSessionMeta() }, browserConfig.experimentalSessions),
enabled: false }, defaultSessionPersistenceConfig), { session: createSessionMeta(browserConfig.experimentalSessions) }), browserConfig.experimentalSessions),
// TODO: deprecate/remove old init code or maybe rename to legacy_session?

@@ -68,9 +74,18 @@ session: (_j = browserConfig.session) !== null && _j !== void 0 ? _j : createSession(),

}
function createSessionMeta() {
const userSession = fetchUserSession();
const sessionId = isUserSessionValid(userSession) ? userSession === null || userSession === void 0 ? void 0 : userSession.sessionId : createSession().id;
function createSessionMeta(sessionsConfig) {
const _sessionsConfig = Object.assign(Object.assign({}, defaultSessionPersistenceConfig), sessionsConfig);
let sessionId;
if (_sessionsConfig.persistent) {
const userSession = PersistentSessionsManager.fetchUserSession();
const now = dateNow();
const shouldClearPersistentSession = userSession && userSession.lastActivity < now - _sessionsConfig.maxSessionPersistenceTime;
if (shouldClearPersistentSession) {
PersistentSessionsManager.removeUserSession();
}
sessionId = isUserSessionValid(userSession) ? userSession === null || userSession === void 0 ? void 0 : userSession.sessionId : createSession().id;
}
return {
id: sessionId,
id: sessionId !== null && sessionId !== void 0 ? sessionId : createSession().id,
};
}
//# sourceMappingURL=makeCoreConfig.js.map

@@ -5,5 +5,5 @@ export { getWebInstrumentations, makeCoreConfig } from './config';

export { buildStackFrame, ConsoleInstrumentation, ErrorsInstrumentation, getDataFromSafariExtensions, getStackFramesFromError, parseStacktrace, ViewInstrumentation, WebVitalsInstrumentation, SessionInstrumentation, } from './instrumentations';
export { browserMeta, createSession, defaultMetas, defaultViewMeta, pageMeta } from './metas';
export { browserMeta, createSession, defaultMetas, defaultViewMeta, pageMeta, sdkMeta } from './metas';
export { ConsoleTransport, FetchTransport } from './transports';
export { faro, allLogLevels, BaseExtension, BaseInstrumentation, BaseTransport, Conventions, createInternalLogger, createPromiseBuffer, deepEqual, defaultExceptionType, defaultGlobalObjectKey, defaultInternalLoggerLevel, defaultLogLevel, genShortID, getCurrentTimestamp, getInternalFaroFromGlobalObject, getTransportBody, globalObject, internalGlobalObjectKey, isArray, isBoolean, isDomError, isDomException, isElement, isElementDefined, isError, isErrorDefined, isErrorEvent, isEvent, isEventDefined, isFunction, isInstanceOf, isInt, isInternalFaroOnGlobalObject, isMap, isMapDefined, isNull, isNumber, isObject, isPrimitive, isRegExp, isString, isSymbol, isSyntheticEvent, isThenable, isToString, isTypeof, isUndefined, InternalLoggerLevel, LogLevel, noop, setInternalFaroOnGlobalObject, TransportItemType, transportItemTypeToBodyKey, VERSION, } from '@grafana/faro-core';
//# sourceMappingURL=index.js.map
export { SessionInstrumentation } from './instrumentation';
export * from './sessionHandler';
export * from './sessionManager';
//# sourceMappingURL=index.js.map
import { BaseInstrumentation, Conventions, VERSION } from '@grafana/faro-core';
import { getSessionUpdater } from './sessionHandler';
import { isLocalStorageAvailable, isSessionStorageAvailable } from '../../utils/webStorage';
import { PersistentSessionsManager } from './sessionManager/PersistentSessionsManager';
import { VolatileSessionsManager } from './sessionManager/VolatileSessionManager';
export class SessionInstrumentation extends BaseInstrumentation {

@@ -19,2 +21,12 @@ constructor() {

}
getSessionManagerInstanceByConfiguredStrategy(initialSessionId) {
var _a;
if (((_a = this.config.experimentalSessions) === null || _a === void 0 ? void 0 : _a.persistent) && isLocalStorageAvailable) {
return new PersistentSessionsManager(initialSessionId);
}
if (isSessionStorageAvailable) {
return new VolatileSessionsManager(initialSessionId);
}
return null;
}
initialize() {

@@ -26,9 +38,9 @@ var _a, _b, _c;

if ((_a = this.config.experimentalSessions) === null || _a === void 0 ? void 0 : _a.enabled) {
this.sessionUpdater = getSessionUpdater((_b = this.metas.value.session) === null || _b === void 0 ? void 0 : _b.id);
this.sessionUpdater.init();
(_c = this.transports) === null || _c === void 0 ? void 0 : _c.addBeforeSendHooks(...this.transports.getBeforeSendHooks(), (item) => {
var _a;
(_a = this.sessionUpdater) === null || _a === void 0 ? void 0 : _a.handleUpdate();
return item;
});
const sessionManager = this.getSessionManagerInstanceByConfiguredStrategy((_b = this.metas.value.session) === null || _b === void 0 ? void 0 : _b.id);
if (sessionManager != null) {
(_c = this.transports) === null || _c === void 0 ? void 0 : _c.addBeforeSendHooks(...this.transports.getBeforeSendHooks(), (item) => {
sessionManager === null || sessionManager === void 0 ? void 0 : sessionManager.updateSession();
return item;
});
}
}

@@ -35,0 +47,0 @@ }

@@ -6,2 +6,3 @@ export { browserMeta } from './browser';

export { defaultViewMeta } from './view';
export { sdkMeta } from './sdk';
//# sourceMappingURL=index.js.map
import { faro } from '@grafana/faro-core';
export const webStorageType = {
session: 'sessionStorage',
local: 'localStorage',
};
// TODO: remove default storage type from all function
/**
* Check if selected web storage mechanism is available.
* @param type storage mechanism to test availability for.
* @returns
*/
export function isWebStorageAvailable(type) {

@@ -18,13 +28,23 @@ var _a;

}
export const isLocalStorageAvailable = isWebStorageAvailable('localStorage');
export function getItem(key) {
if (isLocalStorageAvailable) {
return localStorage.getItem(key);
/**
* Get item from SessionStorage or LocalStorage.
* @param key: the item key.
* @param webStorageMechanism: wether the item shall be received form local storage or session storage. Defaults to local storage.
*/
export function getItem(key, webStorageMechanism) {
if (isWebStorageTypeAvailable(webStorageMechanism)) {
return window[webStorageMechanism].getItem(key);
}
return null;
}
export function setItem(key, value) {
if (isLocalStorageAvailable) {
/**
* Store item in SessionStorage or LocalStorage.
* @param key: the item key.
* @param value: the item data.
* @param webStorageMechanism: wether the item shall be received form local storage or session storage. Defaults to local storage.
*/
export function setItem(key, value, webStorageMechanism) {
if (isWebStorageTypeAvailable(webStorageMechanism)) {
try {
localStorage.setItem(key, value);
window[webStorageMechanism].setItem(key, value);
}

@@ -36,7 +56,23 @@ catch (error) {

}
export function removeItem(key) {
if (isLocalStorageAvailable) {
localStorage.removeItem(key);
/**
* Remove item from SessionStorage or LocalStorage.
* @param key: the item key.
* @param webStorageMechanism: wether the item shall be received form local storage or session storage. Defaults to local storage.
*/
export function removeItem(key, webStorageMechanism) {
if (isWebStorageTypeAvailable(webStorageMechanism)) {
window[webStorageMechanism].removeItem(key);
}
}
export const isLocalStorageAvailable = isWebStorageAvailable(webStorageType.local);
export const isSessionStorageAvailable = isWebStorageAvailable(webStorageType.session);
function isWebStorageTypeAvailable(webStorageMechanism) {
if (webStorageMechanism === webStorageType.local) {
return isLocalStorageAvailable;
}
if (webStorageMechanism === webStorageType.session) {
return isSessionStorageAvailable;
}
return false;
}
//# sourceMappingURL=webStorage.js.map

@@ -7,3 +7,3 @@ export { getWebInstrumentations, makeCoreConfig } from './config';

export type { ConsoleInstrumentationOptions, ErrorEvent, ExtendedPromiseRejectionEvent } from './instrumentations';
export { browserMeta, createSession, defaultMetas, defaultViewMeta, pageMeta } from './metas';
export { browserMeta, createSession, defaultMetas, defaultViewMeta, pageMeta, sdkMeta } from './metas';
export { ConsoleTransport, FetchTransport } from './transports';

@@ -10,0 +10,0 @@ export type { ClockFn, ConsoleTransportOptions, FetchTransportOptions, FetchTransportRequestOptions, } from './transports';

@@ -6,3 +6,3 @@ import { BaseInstrumentation, LogLevel } from '@grafana/faro-core';

readonly name = "@grafana/faro-web-sdk:instrumentation-console";
readonly version = "1.2.3";
readonly version = "1.2.4";
static defaultDisabledLevels: LogLevel[];

@@ -9,0 +9,0 @@ constructor(options?: ConsoleInstrumentationOptions);

import { BaseInstrumentation } from '@grafana/faro-core';
export declare class ErrorsInstrumentation extends BaseInstrumentation {
readonly name = "@grafana/faro-web-sdk:instrumentation-errors";
readonly version = "1.2.3";
readonly version = "1.2.4";
initialize(): void;
}
export { SessionInstrumentation } from './instrumentation';
export * from './sessionHandler';
export * from './sessionManager';
import { BaseInstrumentation } from '@grafana/faro-core';
export declare class SessionInstrumentation extends BaseInstrumentation {
readonly name = "@grafana/faro-web-sdk:instrumentation-session";
readonly version = "1.2.3";
readonly version = "1.2.4";
private notifiedSession;
private sessionUpdater;
private sendSessionStartEvent;
private getSessionManagerInstanceByConfiguredStrategy;
initialize(): void;
}
import { BaseInstrumentation } from '@grafana/faro-core';
export declare class ViewInstrumentation extends BaseInstrumentation {
readonly name = "@grafana/faro-web-sdk:instrumentation-view";
readonly version = "1.2.3";
readonly version = "1.2.4";
private notifiedView;

@@ -6,0 +6,0 @@ private sendViewChangedEvent;

import { BaseInstrumentation } from '@grafana/faro-core';
export declare class WebVitalsInstrumentation extends BaseInstrumentation {
readonly name = "@grafana/faro-web-sdk:instrumentation-web-vitals";
readonly version = "1.2.3";
readonly version = "1.2.4";
static mapping: {

@@ -6,0 +6,0 @@ cls: (onReport: import("web-vitals").CLSReportCallback, opts?: import("web-vitals").ReportOpts | undefined) => void;

@@ -6,1 +6,2 @@ export { browserMeta } from './browser';

export { defaultViewMeta } from './view';
export { sdkMeta } from './sdk';

@@ -7,5 +7,5 @@ import { BaseTransport } from '@grafana/faro-core';

readonly name = "@grafana/faro-web-sdk:transport-console";
readonly version = "1.2.3";
readonly version = "1.2.4";
constructor(options?: ConsoleTransportOptions);
send(item: TransportItem): void;
}

@@ -7,3 +7,3 @@ import { BaseTransport, PromiseBuffer } from '@grafana/faro-core';

readonly name = "@grafana/faro-web-sdk:transport-fetch";
readonly version = "1.2.3";
readonly version = "1.2.4";
promiseBuffer: PromiseBuffer<Response | void>;

@@ -10,0 +10,0 @@ private readonly rateLimitBackoffMs;

@@ -1,7 +0,33 @@

type StorageMechanism = 'sessionStorage' | 'localStorage';
export declare const webStorageType: {
readonly session: "sessionStorage";
readonly local: "localStorage";
};
type StorageMechanism = (typeof webStorageType)[keyof typeof webStorageType];
/**
* Check if selected web storage mechanism is available.
* @param type storage mechanism to test availability for.
* @returns
*/
export declare function isWebStorageAvailable(type: StorageMechanism): boolean;
/**
* Get item from SessionStorage or LocalStorage.
* @param key: the item key.
* @param webStorageMechanism: wether the item shall be received form local storage or session storage. Defaults to local storage.
*/
export declare function getItem(key: string, webStorageMechanism: StorageMechanism): string | null;
/**
* Store item in SessionStorage or LocalStorage.
* @param key: the item key.
* @param value: the item data.
* @param webStorageMechanism: wether the item shall be received form local storage or session storage. Defaults to local storage.
*/
export declare function setItem(key: string, value: string, webStorageMechanism: StorageMechanism): void;
/**
* Remove item from SessionStorage or LocalStorage.
* @param key: the item key.
* @param webStorageMechanism: wether the item shall be received form local storage or session storage. Defaults to local storage.
*/
export declare function removeItem(key: string, webStorageMechanism: StorageMechanism): void;
export declare const isLocalStorageAvailable: boolean;
export declare function getItem(key: string): string | null;
export declare function setItem(key: string, value: string): void;
export declare function removeItem(key: string): void;
export declare const isSessionStorageAvailable: boolean;
export {};
{
"name": "@grafana/faro-web-sdk",
"version": "1.2.3",
"version": "1.2.4",
"description": "Faro instrumentations, metas, transports for web.",

@@ -55,3 +55,3 @@ "keywords": [

"dependencies": {
"@grafana/faro-core": "^1.2.3",
"@grafana/faro-core": "^1.2.4",
"ua-parser-js": "^1.0.32",

@@ -67,3 +67,3 @@ "web-vitals": "^3.1.1"

},
"gitHead": "e15cdf130a4400c4e4f8d597b58a2dc7d488522a"
"gitHead": "72cda534dc953ddaa37a0192ef956ac6ea505962"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc