PageSourceSearch

https://cdnx.wingmate.com/assets/apm/bundle-stable.min.js

js wingmate.com collected 2026-10-02 15:01:01 UTC 174,319 bytes, 1 lines download raw bytes

1var LTVModules=function(e){"use strict";var t="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},n="1.9.0",r=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;var i=function(e){var t=new Set([e]),n=new Set,i=e.match(r);if(!i)return function(){return!1};var o=+i[1],s=+i[2],a=+i[3];if(null!=i[4])return function(t){return t===e};function u(e){return n.add(e),!1}function c(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;var i=e.match(r);if(!i)return u(e);var l=+i[1],d=+i[2],p=+i[3];return null!=i[4]||o!==l?u(e):0===o?s===d&&a<=p?c(e):u(e):s<=d?c(e):u(e)}}(n),o=n.split(".")[0],s=Symbol.for("opentelemetry.js.api."+o),a=t;function u(e,t,r,i){var o;void 0===i&&(i=!1);var u=a[s]=null!==(o=a[s])&&void 0!==o?o:{version:n};if(!i&&u[e]){var c=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return r.error(c.stack||c.message),!1}if(u.version!==n){c=new Error("@opentelemetry/api: Registration of version v"+u.version+" for "+e+" does not match previously registered API v"+n);return r.error(c.stack||c.message),!1}return u[e]=t,r.debug("@opentelemetry/api: Registered a global for "+e+" v"+n+"."),!0}function c(e){var t,n,r=null===(t=a[s])||void 0===t?void 0:t.version;if(r&&i(r))return null===(n=a[s])||void 0===n?void 0:n[e]}function l(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+n+".");var r=a[s];r&&delete r[e]}var d,p=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},f=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},h=function(){function e(e){this._namespace=e.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return g("debug",this._namespace,e)},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return g("error",this._namespace,e)},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return g("info",this._namespace,e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return g("warn",this._namespace,e)},e.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return g("verbose",this._namespace,e)},e}();function g(e,t,n){var r=c("diag");if(r)return n.unshift(t),r[e].apply(r,f([],p(n),!1))}!function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"}(d||(d={}));var m=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},v=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},b=function(){function e(){function e(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=c("diag");if(r)return r[e].apply(r,v([],m(t),!1))}}var t=this;t.setLogger=function(e,n){var r,i,o;if(void 0===n&&(n={logLevel:d.INFO}),e===t){var s=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error(null!==(r=s.stack)&&void 0!==r?r:s.message),!1}"number"==typeof n&&(n={logLevel:n});var a=c("diag"),l=function(e,t){function n(n,r){var i=t[n];return"function"==typeof i&&e>=r?i.bind(t):function(){}}return e<d.NONE?e=d.NONE:e>d.ALL&&(e=d.ALL),t=t||{},{error:n("error",d.ERROR),warn:n("warn",d.WARN),info:n("info",d.INFO),debug:n("debug",d.DEBUG),verbose
1:n("verbose",d.VERBOSE)}}(null!==(i=n.logLevel)&&void 0!==i?i:d.INFO,e);if(a&&!n.suppressOverrideMessage){var p=null!==(o=(new Error).stack)&&void 0!==o?o:"<failed to generate stacktrace>";a.warn("Current logger will be overwritten from "+p),l.warn("Current logger will overwrite one already registered from "+p)}return u("diag",l,t,!0)},t.disable=function(){l("diag",t)},t.createComponentLogger=function(e){return new h(e)},t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e}(),y=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},_=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},w=function(){function e(e){this._entries=e?new Map(e):new Map}return e.prototype.getEntry=function(e){var t=this._entries.get(e);if(t)return Object.assign({},t)},e.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var t=y(e,2);return[t[0],t[1]]})},e.prototype.setEntry=function(t,n){var r=new e(this._entries);return r._entries.set(t,n),r},e.prototype.removeEntry=function(t){var n=new e(this._entries);return n._entries.delete(t),n},e.prototype.removeEntries=function(){for(var t,n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=new e(this._entries);try{for(var s=_(r),a=s.next();!a.done;a=s.next()){var u=a.value;o._entries.delete(u)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return o},e.prototype.clear=function(){return new e},e}(),S=Symbol("BaggageEntryMetadata"),T=b.instance();function E(e){return void 0===e&&(e={}),new w(new Map(Object.entries(e)))}function O(e){return Symbol.for(e)}var A,C,x=function e(t){var n=this;n._currentContext=t?new Map(t):new Map,n.getValue=function(e){return n._currentContext.get(e)},n.setValue=function(t,r){var i=new e(n._currentContext);return i._currentContext.set(t,r),i},n.deleteValue=function(t){var r=new e(n._currentContext);return r._currentContext.delete(t),r}},R=new x,L=(A=function(e,t){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},A(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}A(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),P=function(){function e(){}return e.prototype.createGauge=function(e,t){return V},e.prototype.createHistogram=function(e,t){return q},e.prototype.createCounter=function(e,t){return H},e.prototype.createUpDownCounter=function(e,t){return $},e.prototype.createObservableGauge=function(e,t){return K},e.prototype.createObservableCounter=function(e,t){return G},e.prototype.createObservableUpDownCounter=function(e,t){return W},e.prototype.addBatchObservableCallback=function(e,t){},e.prototype.removeBatchObservableCallback=function(e){},e}(),k=function(){},I=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return L(t,e),t.prototype.add=function(e,t){},t}(k),N=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return L(t,e),t.prototype.add=function(e,t){},t}(k),D=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return L(t,e),t.prototype.record=function(e,t){},t}(k),M=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return L(t,e),t.prototype.record=function(e,t){},t}(k),j=function(){function e(){}return e.prototype.addCallback=function(e){},e.prototype.removeCallback=function(e){},e}(),U=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return L(t,e),t}(j),B=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return L(t,e),t}(j),F=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return L(t,e),t}(j),z=new P,H=new I,V=new D,q=new M,$=new N,G=new U,K=new B,W=new F,X={get:function(e,t){if(null!=e)return e[t]},keys:function(e){return null==e?[]:Object.keys(e)}},Q={set:function(e,t,n){null!=e&&(e[t]=n)}},Y=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},Z=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},J=function(){function e(){}return e.prototype.active=function(){return R},e.prototype.with=function(e,t,n){for(var r=[],i=3;i<arguments.length;i++)r[i-3]=arguments[i];return t.call.apply(t,Z([n],Y(r),!1))},e.prototype.bind=function(e,t){return t},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e}(),ee=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},te=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},ne="context",re=new J,ie=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(e){return u(ne,e,b.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(e,t,n){for(var r,i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];return(r=this._getContextManager()).with.apply(r,te([e,t,n],ee(i),!1))},e.prototype.bind=function(e,t){return this._getContextManager().bind(e,t)},e.prototype._getContextManager=function(){return c(ne)||re},e.prototype.disable=function(){this._getContextManager().disable(),l(ne,b.instance())},e}();!function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"}(C||(C={}));var oe="0000000000000000",se="00000000000000000000000000000000",ae={traceId:se,spanId:oe,traceFlags:C.NONE},ue=function(){function e(e){void 0===e&&(e=ae),this._spanContext=e}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(e,t){return this},e.prototype.setAttributes=function(e){return this},e.prototype.addEvent=function(e,t){return this},e.prototype.addLink=function(e){return this},e.prototype.addLinks=function(e){return this},e.prototype.setStatus=function(e){return this},e.prototype.updateName=function(e){return this},e.prototype.end=function(e){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(e,t){},e}(),ce=O("OpenTelemetry Context Key SPAN");function le(e){return e.getValue(ce)||void 0}function de(){return le(ie.getInstance().active())}function pe(e,t){return e.setValue(ce,t)}function fe(e){return e.deleteValue(ce)}function he(e,t){return pe(e,new ue(t))}function ge(e){var t;return null===(t=le(e))||void 0===t?void 0:t.spanContext()}var me=/^([0-9a-f]{32})$/i,ve=/^[0-9a-f]{16}$/i;function be(e){return me.test(e)&&e!==se}function ye(e){return be(e.traceId)&&(t=e.spanId,ve.test(t)&&t!==oe);var t}function _e(e){return new ue(e)}var we=ie.getInstance(),Se=function(){function e(){}return e.prototype.startSpan=function(e,t,n){if(void 0===n&&(n=we.active()),Boolean(null==t?void 0:t.root))return new ue;var r,i=n&&ge(n);return"object"==typeof(r=i)&&"string"==typeof r.spanId&&"string"==typeof r.traceId&&"number"==typeof r.traceFlags&&ye(i)?new ue(i):new ue},e.prototype.startActiveSpan=function(e,t,n,r){var i,o,s;if(!(arguments.length<2)){2===arguments.length?s=t:3===arguments.length?(i=t,s=n):(i=t,o=n,s=r);var a=null!=o?o:we.active(),u=this.startSpan(e,i,a),c=pe(a,u);return we.with(c,s,void 0,u)}},e}();var Te,Ee,Oe,Ae=new Se,Ce=function(){function e(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}return e.prototype.startSpan=function(e,t,n){return this._getTracer().startSpan(e,t,n)},e.prototype.startActiveSpan=function(e,t,n,r){var i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Ae},e}(),xe=new(function(){function e(){}return e.prototype.getTracer=function(e,t,n){return new Se},e}()),Re=function(){function e(){}return e.prototype.getTracer=function(e,t,n){var r;return null!==(r=this.getDelegateTracer(e,t,n))&&void 0!==r?r:new Ce(this,e,t,n)},e.prototype.getDelegate=function(){var e;return null!==(e=this._delegate)&&void 0!==e?e:xe},e.prototype.setDelegate=function(e){this._delegate=e},e.prototype.getDelegateTracer=function(e,t,n){var r;return null===(r=this._delegate)||void 0===r?void 0:r.getTracer(e,t,n)},e}();!function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(Te||(Te={})),function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"}(Ee||(Ee={})),function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"}(Oe||(Oe={}));var Le=ie.getInstance(),Pe=b.instance(),ke=new(function(){function e(){}return e.prototype.getMeter=function(e,t,n){return z},e}()),Ie="metrics",Ne=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalMeterProvider=function(e){return u(Ie,e,b.instance())},e.prototype.getMeterProvider=function(){return c(Ie)||ke},e.prototype.getMeter=function(e,t,n){return this.getMeterProvider().getMeter(e,t,n)},e.prototype.disable=function(){l(Ie,b.instance())},e}().getInstance(),De=function(){function e(){}return e.prototype.inject=function(e,t){},e.prototype.extract=function(e,t){return e},e.prototype.fields=function(){return[]},e}(),Me=O("OpenTelemetry Baggage Key");function je(e){return e.getValue(Me)||void 0}function Ue(){return je(ie.getInstance().active())}function Be(e,t){return e.setValue(Me,t)}function Fe(e){return e.deleteValue(Me)}var ze="propagation",He=new De,Ve=function(){function e(){this.createBaggage=E,this.getBaggage=je,this.getActiveBaggage=Ue,this.setBaggage=Be,this.deleteBaggage=Fe}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalPropagator=function(e){return u(ze,e,b.instance())}
1,e.prototype.inject=function(e,t,n){return void 0===n&&(n=Q),this._getGlobalPropagator().inject(e,t,n)},e.prototype.extract=function(e,t,n){return void 0===n&&(n=X),this._getGlobalPropagator().extract(e,t,n)},e.prototype.fields=function(){return this._getGlobalPropagator().fields()},e.prototype.disable=function(){l(ze,b.instance())},e.prototype._getGlobalPropagator=function(){return c(ze)||He},e}(),qe=Ve.getInstance(),$e="trace",Ge=function(){function e(){this._proxyTracerProvider=new Re,this.wrapSpanContext=_e,this.isSpanContextValid=ye,this.deleteSpan=fe,this.getSpan=le,this.getActiveSpan=de,this.getSpanContext=ge,this.setSpan=pe,this.setSpanContext=he}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(e){var t=u($e,this._proxyTracerProvider,b.instance());return t&&this._proxyTracerProvider.setDelegate(e),t},e.prototype.getTracerProvider=function(){return c($e)||this._proxyTracerProvider},e.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t)},e.prototype.disable=function(){l($e,b.instance()),this._proxyTracerProvider=new Re},e}().getInstance();function Ke(e){let t={};const n=e.length;for(let r=0;r<n;r++){const n=e[r];n&&(t[String(n).toUpperCase().replace(/[-.]/g,"_")]=n)}return t}const We="deployment.environment",Xe=We,Qe=Ke(["cloud.provider","cloud.account.id","cloud.region","cloud.availability_zone","cloud.platform","aws.ecs.container.arn","aws.ecs.cluster.arn","aws.ecs.launchtype","aws.ecs.task.arn","aws.ecs.task.family","aws.ecs.task.revision","aws.eks.cluster.arn","aws.log.group.names","aws.log.group.arns","aws.log.stream.names","aws.log.stream.arns","container.name","container.id","container.runtime","container.image.name","container.image.tag",We,"device.id","device.model.identifier","device.model.name","faas.name","faas.id","faas.version","faas.instance","faas.max_memory","host.id","host.name","host.type","host.arch","host.image.name","host.image.id","host.image.version","k8s.cluster.name","k8s.node.name","k8s.node.uid","k8s.namespace.name","k8s.pod.uid","k8s.pod.name","k8s.container.name","k8s.replicaset.uid","k8s.replicaset.name","k8s.deployment.uid","k8s.deployment.name","k8s.statefulset.uid","k8s.statefulset.name","k8s.daemonset.uid","k8s.daemonset.name","k8s.job.uid","k8s.job.name","k8s.cronjob.uid","k8s.cronjob.name","os.type","os.description","os.name","os.version","process.pid","process.executable.name","process.executable.path","process.command","process.command_line","process.command_args","process.owner","process.runtime.name","process.runtime.version","process.runtime.description","service.name","service.namespace","service.instance.id","service.version","telemetry.sdk.name","telemetry.sdk.language","telemetry.sdk.version","telemetry.auto.version","webengine.name","webengine.version","webengine.description"]),Ye="error.type",Ze="exception.message",Je="exception.type",et="http.request.method",tt="http.request.method_original",nt="http.response.status_code",rt="server.address",it="server.port",ot="service.name",st="telemetry.sdk.language",at="telemetry.sdk.name",ut="telemetry.sdk.version",ct="url.full",lt=O("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function dt(e){return e.setValue(lt,!0)}function pt(e){return!0===e.getValue(lt)}const ft=",",ht="baggage";function gt(e){const t=e.split(";");if(t.length<=0)return;const n=t.shift();if(!n)return;const r=n.indexOf("=");if(r<=0)return;const i=decodeURIComponent(n.substring(0,r).trim()),o=decodeURIComponent(n.substring(r+1).trim());let s;var a;return t.length>0&&("string"!=typeof(a=t.join(";"))&&(T.error("Cannot create baggage metadata from unknown type: "+typeof a),a=""),s={__TYPE__:S,toString:function(){return a}}),{key:i,value:o,metadata:s}}class mt{inject(e,t,n){const r=qe.getBaggage(e);if(!r||pt(e))return;const i=function(e){return e.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return void 0!==t.metadata&&(n+=";"+t.metadata.toString()),n})}(r).filter(e=>e.length<=4096).slice(0,180),o=function(e){return e.reduce((e,t)=>
1{const n=`${e}${""!==e?ft:""}${t}`;return n.length>8192?e:n},"")}(i);o.length>0&&n.set(t,ht,o)}extract(e,t,n){const r=n.get(t,ht),i=Array.isArray(r)?r.join(ft):r;if(!i)return e;const o={};if(0===i.length)return e;return i.split(ft).forEach(e=>{const t=gt(e);if(t){const e={value:t.value};t.metadata&&(e.metadata=t.metadata),o[t.key]=e}}),0===Object.entries(o).length?e:qe.setBaggage(e,qe.createBaggage(o))}fields(){return[ht]}}function vt(e){const t={};if("object"!=typeof e||null==e)return t;for(const[n,r]of Object.entries(e))bt(n)?yt(r)?Array.isArray(r)?t[n]=r.slice():t[n]=r:Pe.warn(`Invalid attribute value set for key: ${n}`):Pe.warn(`Invalid attribute key: ${n}`);return t}function bt(e){return"string"==typeof e&&e.length>0}function yt(e){return null==e||(Array.isArray(e)?function(e){let t;for(const n of e)if(null!=n){if(!t){if(_t(n)){t=typeof n;continue}return!1}if(typeof n!==t)return!1}return!0}(e):_t(e))}function _t(e){switch(typeof e){case"number":case"boolean":case"string":return!0}return!1}function wt(){return e=>{Pe.error(function(e){return"string"==typeof e?e:JSON.stringify(function(e){const t={};let n=e;for(;null!==n;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;const r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}(e))}(e))}}let St=wt();function Tt(e){try{St(e)}catch{}}function Et(e){}const Ot="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},At=performance,Ct="process.runtime.name",xt={[at]:"opentelemetry",[Ct]:"browser",[st]:"webjs",[ut]:"2.0.1"};function Rt(e){}const Lt=Math.pow(10,6),Pt=Math.pow(10,9);function kt(e){const t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*Lt)]}function It(){let e=At.timeOrigin;if("number"!=typeof e){const t=At;e=t.timing&&t.timing.fetchStart}return e}function Nt(e){return Ft(kt(It()),kt("number"==typeof e?e:At.now()))}function Dt(e){if(Ut(e))return e;if("number"==typeof e)return e<It()?Nt(e):kt(e);if(e instanceof Date)return kt(e.getTime());throw TypeError("Invalid input type")}function Mt(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(n-=1,r+=Pt),[n,r]}function jt(e){return e[0]*Pt+e[1]}function Ut(e){return Array.isArray(e)&&2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]}function Bt(e){return Ut(e)||"number"==typeof e||e instanceof Date}function Ft(e,t){const n=[e[0]+t[0],e[1]+t[1]];return n[1]>=Pt&&(n[1]-=Pt,n[0]+=1),n}var zt;!function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"}(zt||(zt={}));class Ht{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[],this._fields=Array.from(new Set(this._propagators.map(e=>"function"==typeof e.fields?e.fields():[]).reduce((e,t)=>e.concat(t),[])))}inject(e,t,n){for(const r of this._propagators)try{r.inject(e,t,n)}catch(e){Pe.warn(`Failed to inject with ${r.constructor.name}. Err: ${e.message}`)}}extract(e,t,n){return this._propagators.reduce((e,r)=>{try{return r.extract(e,t,n)}catch(e){Pe.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}}const Vt="[_0-9a-z-*/]",qt=new RegExp(`^(?:${`[a-z]${Vt}{0,255}`}|${`[a-z0-9]${Vt}{0,240}@[a-z]${Vt}{0,13}`})$`),$t=/^[ -~]{0,255}[!-~]$/,Gt=/,|=/;class Kt{_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,t){const n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,t),n}unset(e){const t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+"="+this.get(t)),e),[]).join(",")}_parse(e){e.length>512||(this._internalState=e.split(",").reverse().reduce((e,t)=>{const n=t.trim(),r=n.indexOf("=");if(-1!==r){const i=n.slice(0,r),o=n.slice(r+1,t.length);(function(e){return qt.test(e)})(i)&&function(e){return $t.test(e)&&!Gt.test(e)}(o)&&e.set(i,o)}return e},new Map),this._internalState.size>32&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,32))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){const e=new Kt;return e._internalState=new Map(this._internalState),e}}const Wt="traceparent",Xt="tracestate",Qt=new RegExp("^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$");function Yt(e){const t=Qt.exec(e);return t?"00"===t[1]&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}:null}class Zt{inject(e,t,n){const r=Ge.getSpanContext(e);if(!r||pt(e)||!ye(r))return;const i=`00-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||C.NONE).toString(16)}`;n.set(t,Wt,i),r.traceState&&n.set(t,Xt,r.traceState.serialize())}extract(e,t,n){const r=n.get(t,Wt);if(!r)return e;const i=Array.isArray(r)?r[0]:r;if("string"!=typeof i)return e;const o=Yt(i);if(!o)return e;o.isRemote=!0;const s=n.get(t,Xt);if(s){const e=Array.isArray(s)?s.join(","):s;o.traceState=new Kt("string"==typeof e?e:void 0)}return Ge.setSpanContext(e,o)}fields(){return[Wt,Xt]}}const Jt=O("OpenTelemetry SDK Context Key RPC_METADATA");var en;!function(e){e.HTTP="http"}(en||(en={}));
1const tn="[object Null]",nn="[object Undefined]",rn=Function.prototype.toString,on=rn.call(Object),sn=Object.getPrototypeOf,an=Object.prototype,un=an.hasOwnProperty,cn=Symbol?Symbol.toStringTag:void 0,ln=an.toString;function dn(e){if(!function(e){return null!=e&&"object"==typeof e}(e)||"[object Object]"!==function(e){if(null==e)return void 0===e?nn:tn;return cn&&cn in Object(e)?function(e){const t=un.call(e,cn),n=e[cn];let r=!1;try{e[cn]=void 0,r=!0}catch(e){}const i=ln.call(e);r&&(t?e[cn]=n:delete e[cn]);return i}(e):function(e){return ln.call(e)}(e)}(e))return!1;const t=sn(e);if(null===t)return!0;const n=un.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&rn.call(n)===on}function pn(...e){let t=e.shift();const n=new WeakMap;for(;e.length>0;)t=hn(t,e.shift(),0,n);return t}function fn(e){return mn(e)?e.slice():e}function hn(e,t,n=0,r){let i;if(!(n>20)){if(n++,yn(e)||yn(t)||vn(t))i=fn(t);else if(mn(e)){if(i=e.slice(),mn(t))for(let e=0,n=t.length;e<n;e++)i.push(fn(t[e]));else if(bn(t)){const e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){const r=e[n];i[r]=fn(t[r])}}}else if(bn(e))if(bn(t)){if(!function(e,t){if(!dn(e)||!dn(t))return!1;return!0}(e,t))return t;i=Object.assign({},e);const o=Object.keys(t);for(let s=0,a=o.length;s<a;s++){const a=o[s],u=t[a];if(yn(u))void 0===u?delete i[a]:i[a]=u;else{const o=i[a],s=u;if(gn(e,a,r)||gn(t,a,r))delete i[a];else{if(bn(o)&&bn(s)){const n=r.get(o)||[],i=r.get(s)||[];n.push({obj:e,key:a}),i.push({obj:t,key:a}),r.set(o,n),r.set(s,i)}i[a]=hn(i[a],u,n,r)}}}}else i=t;return i}}function gn(e,t,n){const r=n.get(e[t])||[];for(let n=0,i=r.length;n<i;n++){const i=r[n];if(i.key===t&&i.obj===e)return!0}return!1}function mn(e){return Array.isArray(e)}function vn(e){return"function"==typeof e}function bn(e){return!yn(e)&&!mn(e)&&!vn(e)&&"object"==typeof e}function yn(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||void 0===e||e instanceof Date||e instanceof RegExp||null===e}class _n extends Error{constructor(e){super(e),Object.setPrototypeOf(this,_n.prototype)}}function wn(e,t){return"string"==typeof t?e===t:!!e.match(t)}function Sn(e,t){if(!t)return!1;for(const n of t)if(wn(e,n))return!0;return!1}class Tn{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}class En{_callback;_that;_isCalled=!1;_deferred=new Tn;constructor(e,t){this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}}const On={ALL:d.ALL,VERBOSE:d.VERBOSE,DEBUG:d.DEBUG,INFO:d.INFO,WARN:d.WARN,ERROR:d.ERROR,NONE:d.NONE};const An={_export:function(e,t){return new Promise(n=>{Le.with(dt(Le.active()),()=>{e.export(t,e=>{n(e)})})})}};var Cn=Object.freeze({__proto__:null,AnchoredClock:class{_monotonicClock;_epochMillis;_performanceMillis;constructor(e,t){this._monotonicClock=t,this._epochMillis=e.now(),this._performanceMillis=t.now()}now(){const e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}},BindOnceFuture:En,CompositePropagator:Ht,get ExportResultCode(){return zt},get RPCType(){return en},SDK_INFO:xt,TRACE_PARENT_HEADER:Wt,TRACE_STATE_HEADER:Xt,TimeoutError:_n,TraceState:Kt,W3CBaggagePropagator:mt,W3CTraceContextPropagator:Zt,_globalThis:Ot,addHrTimes:Ft,callWithTimeout:function(e,t){let n;const r=new Promise(function(e,r){n=setTimeout(function(){r(new _n("Operation timed out."))},t)});return Promise.race([e,r]).then(e=>(clearTimeout(n),e),e=>{throw clearTimeout(n),e})},deleteRPCMetadata:function(e){return e.deleteValue(Jt)},diagLogLevelFromString:function(e){if(null==e)return;const t=On[e.toUpperCase()];return null==t?(Pe.warn(`Unknown log level "${e}", expected one of ${Object.keys(On)}, using default`),d.INFO):t},getBooleanFromEnv:function(e){},getNumberFromEnv:Et,getRPCMetadata:function(e){return e.getValue(Jt)},getStringFromEnv:function(e){},getStringListFromEnv:function(e){},getTimeOrigin:It,globalErrorHandler:Tt,hrTime:Nt,hrTimeDuration:Mt,hrTimeToMicroseconds:function(e){return 1e6*e[0]+e[1]/1e3},hrTimeToMilliseconds:function(e){return 1e3*e[0]+e[1]/1e6},hrTimeToNanoseconds:jt,hrTimeToTimeStamp:function(e){const t=`${"0".repeat(9)}${e[1]}Z`,n=t.substring(t.length-9-1);return new Date(1e3*e[0]).toISOString().replace("000Z",n)},internal:An,isAttributeValue:yt,isTimeInput:Bt,isTimeInputHrTime:Ut,isTracingSuppressed:pt,isUrlIgnored:Sn,loggingErrorHandler:wt,merge:pn,millisToHrTime:kt,otperformance:At,parseKeyPairsIntoRecord:function(e){const t={};return"string"==typeof e&&e.length>
10&&e.split(ft).forEach(e=>{const n=gt(e);void 0!==n&&n.value.length>0&&(t[n.key]=n.value)}),t},parseTraceParent:Yt,sanitizeAttributes:vt,setGlobalErrorHandler:function(e){St=e},setRPCMetadata:function(e,t){return e.setValue(Jt,t)},suppressTracing:dt,timeInputToHrTime:Dt,unrefTimer:Rt,unsuppressTracing:function(e){return e.deleteValue(lt)},urlMatches:wn}),xn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Rn(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var Ln={},Pn={};function kn(e){return Object.keys(e).map(t=>In(t,e[t]))}function In(e,t){return{key:e,value:Nn(t)}}function Nn(e){const t=typeof e;return"string"===t?{stringValue:e}:"number"===t?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:"boolean"===t?{boolValue:e}:e instanceof Uint8Array?{bytesValue:e}:Array.isArray(e)?{arrayValue:{values:e.map(Nn)}}:"object"===t&&null!=e?{kvlistValue:{values:Object.entries(e).map(([e,t])=>In(e,t))}}:{}}Object.defineProperty(Pn,"__esModule",{value:!0}),Pn.toAnyValue=Pn.toKeyValue=Pn.toAttributes=Pn.createInstrumentationScope=Pn.createResource=void 0,Pn.createResource=function(e){return{attributes:kn(e.attributes),droppedAttributesCount:0}},Pn.createInstrumentationScope=function(e){return{name:e.name,version:e.version}},Pn.toAttributes=kn,Pn.toKeyValue=In,Pn.toAnyValue=Nn;var Dn={},Mn=Rn(Cn),jn={};function Un(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}Object.defineProperty(jn,"__esModule",{value:!0}),jn.hexToBinary=void 0,jn.hexToBinary=function(e){const t=new Uint8Array(e.length/2);let n=0;for(let r=0;r<e.length;r+=2){const i=Un(e.charCodeAt(r)),o=Un(e.charCodeAt(r+1));t[n++]=i<<4|o}return t},Object.defineProperty(Dn,"__esModule",{value:!0}),Dn.getOtlpEncoder=Dn.encodeAsString=Dn.encodeAsLongBits=Dn.toLongBits=Dn.hrTimeToNanos=void 0;const Bn=Mn,Fn=jn;function zn(e){const t=BigInt(1e9);return BigInt(e[0])*t+BigInt(e[1])}function Hn(e){return{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}function Vn(e){return Hn(zn(e))}function qn(e){return zn(e).toString()}Dn.hrTimeToNanos=zn,Dn.toLongBits=Hn,Dn.encodeAsLongBits=Vn,Dn.encodeAsString=qn;const $n="undefined"!=typeof BigInt?qn:Bn.hrTimeToNanoseconds;function Gn(e){return e}function Kn(e){if(void 0!==e)return(0,Fn.hexToBinary)(e)}const Wn={encodeHrTime:Vn,encodeSpanContext:Fn.hexToBinary,encodeOptionalSpanContext:Kn};Dn.getOtlpEncoder=function(e){if(void 0===e)return Wn;const t=e.useLongBits??!0,n=e.useHex??!1;return{encodeHrTime:t?Vn:$n,encodeSpanContext:n?Gn:Fn.hexToBinary,encodeOptionalSpanContext:n?Gn:Kn}},Object.defineProperty(Ln,"__esModule",{value:!0});var Xn=Ln.createExportTraceServiceRequest=Ln.toOtlpSpanEvent=Ln.toOtlpLink=Ln.sdkSpanToOtlpSpan=void 0;const Qn=Pn,Yn=Dn;function Zn(e,t){const n=e.spanContext(),r=e.status,i=e.parentSpanContext?.spanId?t.encodeSpanContext(e.parentSpanContext?.spanId):void 0;return{traceId:t.encodeSpanContext(n.traceId),spanId:t.encodeSpanContext(n.spanId),parentSpanId:i,traceState:n.traceState?.serialize(),name:e.name,kind:null==e.kind?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:(0,Qn.toAttributes)(e.attributes),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>er(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:r.code,message:r.message},links:e.links.map(e=>Jn(e,t)),droppedLinksCount:e.droppedLinksCount}}function Jn(e,t){return{attributes:e.attributes?(0,Qn.toAttributes)(e.attributes):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0}}function er(e,t){return{attributes:e.attributes?(0,Qn.toAttributes)(e.attributes):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function tr(e,t){const n=function(e){const t=new Map;for(const n of e){let e=t.get(n.resource);e||(e=new Map,t.set(n.resource,e));const r=`${n.instrumentationScope.name}@${n.instrumentationScope.version||""}:${n.instrumentationScope.schemaUrl||""}`;let i=e.get(r);i||(i=[],e.set(r,i)),i.push(n)}return t}(e),r=[],i=n.entries();let o=i.next();for(;!o.done;){const[e,n]=o.value,s=[],a=n.values();let u=a.next();for(;!u.done;){const e=u.value;if(e.length>0){const n=e.map(e=>Zn(e,t));s.push({scope:(0,Qn.createInstrumentationScope)(e[0].instrumentationScope),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}u=a.next()}const c={resource:(0,Qn.createResource)(e),scopeSpans:s,schemaUrl:void 0};
1r.push(c),o=i.next()}return r}Ln.sdkSpanToOtlpSpan=Zn,Ln.toOtlpLink=Jn,Ln.toOtlpSpanEvent=er,Xn=Ln.createExportTraceServiceRequest=function(e,t){return{resourceSpans:tr(e,(0,Yn.getOtlpEncoder)(t))}};var nr={};function rr(e,t){return typeof e===t}function ir(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function or(e,t){try{return e instanceof t}catch(e){return!1}}!function(e){var t,n;Object.defineProperty(e,"__esModule",{value:!0}),e.EStatusCode=e.ESpanKind=void 0,(t=e.ESpanKind||(e.ESpanKind={}))[t.SPAN_KIND_UNSPECIFIED=0]="SPAN_KIND_UNSPECIFIED",t[t.SPAN_KIND_INTERNAL=1]="SPAN_KIND_INTERNAL",t[t.SPAN_KIND_SERVER=2]="SPAN_KIND_SERVER",t[t.SPAN_KIND_CLIENT=3]="SPAN_KIND_CLIENT",t[t.SPAN_KIND_PRODUCER=4]="SPAN_KIND_PRODUCER",t[t.SPAN_KIND_CONSUMER=5]="SPAN_KIND_CONSUMER",(n=e.EStatusCode||(e.EStatusCode={}))[n.STATUS_CODE_UNSET=0]="STATUS_CODE_UNSET",n[n.STATUS_CODE_OK=1]="STATUS_CODE_OK",n[n.STATUS_CODE_ERROR=2]="STATUS_CODE_ERROR"}(nr);const sr=e=>rr(e,"null"),ar=e=>rr(e,"string"),ur=e=>!sr(e)&&rr(e,"object"),cr=e=>rr(e,"function"),lr=e=>ir(e,"Array"),dr="undefined"!=typeof Event,pr="undefined"!=typeof Error,fr=e=>pr&&or(e,Error);function hr(e){return null==e||(lr(e)||ar(e)?0===e.length:!!ur(e)&&0===Object.keys(e).length)}function gr(e,t){if(e===t)return!0;if(rr(e,"number")&&isNaN(e))return rr(t,"number")&&isNaN(t);const n=lr(e),r=lr(t);if(n!==r)return!1;if(n&&r){const n=e.length;if(n!==t.length)return!1;for(let r=n;0!==r--;)if(!gr(e[r],t[r]))return!1;return!0}const i=ur(e),o=ur(t);if(i!==o)return!1;if(e&&t&&i&&o){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;for(let r of n)if(!gr(e[r],t[r]))return!1;return!0}return!1}function mr(){return Date.now()}function vr(){return(new Date).toISOString()}function br(e){return new Date(e).toISOString()}var yr;!function(e){e.TRACE="trace",e.DEBUG="debug",e.INFO="info",e.LOG="log",e.WARN="warn",e.ERROR="error"}(yr||(yr={}));const _r=yr.LOG,wr=[yr.TRACE,yr.DEBUG,yr.INFO,yr.LOG,yr.WARN,yr.ERROR];function Sr(){}const Tr="abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ0123456789";function Er(e=10){return Array.from(Array(e)).map(()=>Tr[Math.floor(59*Math.random())]).join("")}const Or="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0;function Ar(e={}){return JSON.stringify(null!=e?e:{},function(){const e=new WeakSet;return function(t,n){if(ur(n)&&null!==n){if(e.has(n))return null;e.add(n)}return n}}())}function Cr(e={}){const t={};for(const[n,r]of Object.entries(e))t[n]=ur(r)&&null!==r?Ar(r):String(r);return t}class xr{constructor(){this.subscribers=[]}subscribe(e){return this.subscribers.push(e),{unsubscribe:()=>this.unsubscribe(e)}}unsubscribe(e){this.subscribers=this.subscribers.filter(t=>t!==e)}notify(e){this.subscribers.forEach(t=>t(e))}first(){const e=new xr,t=t=>{e.notify(t),n.unsubscribe()},n=this.subscribe(t),r=e.unsubscribe.bind(e);return this.withUnsubscribeOverride(e,r,t)}takeWhile(e){const t=new xr,n=r=>{e(r)?t.notify(r):t.unsubscribe(n)};this.subscribe(n);const r=t.unsubscribe.bind(t);return this.withUnsubscribeOverride(t,r,n)}filter(e){const t=new xr,n=n=>{e(n)&&t.notify(n)};this.subscribe(n);const r=t.unsubscribe.bind(t);return this.withUnsubscribeOverride(t,r,n)}merge(...e){const t=new xr,n=[];e.forEach(e=>{const r=e.subscribe(e=>{t.notify(e)});n.push(r)});const r=t.unsubscribeAll.bind(t);return t.unsubscribe=()=>{n.forEach(e=>e.unsubscribe()),r()},t}withUnsubscribeOverride(e,t,n){return e.unsubscribe=e=>{t(e),this.unsubscribe(n)},e}unsubscribeAll(){this.subscribers=[]}}class Rr{constructor(e,t){var n,r;this.signalBuffer=[],this.itemLimit=null!==(n=null==t?void 0:t.itemLimit)&&void 0!==n?n:50,this.sendTimeout=null!==(r=null==t?void 0:t.sendTimeout)&&void 0!==r?r:250,this.paused=(null==t?void 0:t.paused)||!1,this.sendFn=e,this.flushInterval=-1,this.paused||this.start(),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&this.flush()})}addItem(e){this.paused||(this.signalBuffer.push(e),this.signalBuffer.length>=this.itemLimit&&this.flush())}start(){this.paused=!1,this.sendTimeout>0&&(this.flushInterval=window.setInterval(()=>this.flush(),this.sendTimeout))}pause(){this.paused=!0,clearInterval(this.flushInterval)}groupItems(e){const t=new Map;
1return e.forEach(e=>{const n=JSON.stringify(e.meta);let r=t.get(n);r=void 0===r?[e]:[...r,e],t.set(n,r)}),Array.from(t.values())}flush(){if(this.paused||0===this.signalBuffer.length)return;this.groupItems(this.signalBuffer).forEach(this.sendFn),this.signalBuffer=[]}}var Lr;!function(e){e.EXCEPTION="exception",e.LOG="log",e.MEASUREMENT="measurement",e.TRACE="trace",e.EVENT="event"}(Lr||(Lr={}));const Pr={[Lr.EXCEPTION]:"exceptions",[Lr.LOG]:"logs",[Lr.MEASUREMENT]:"measurements",[Lr.TRACE]:"traces",[Lr.EVENT]:"events"};function kr(e,t,n,r){var i;t.debug("Initializing transports");const o=[];let s=n.paused,a=[];const u=e=>{let t=e;for(const e of a){const r=t.map(e).filter(Boolean);if(0===r.length)return[];t=Ir(r,n)}return t},c=e=>{const n=u(e);if(0!==n.length)for(const e of o)t.debug(`Transporting item using ${e.name}\n`,n),e.isBatched()&&e.send(n)};let l;(null===(i=n.batching)||void 0===i?void 0:i.enabled)&&(l=new Rr(c,{sendTimeout:n.batching.sendTimeout,itemLimit:n.batching.itemLimit,paused:s}));return{add:(...i)=>{t.debug("Adding transports"),i.forEach(i=>{t.debug(`Adding "${i.name}" transport`);o.some(e=>e===i)?t.warn(`Transport ${i.name} is already added`):(i.unpatchedConsole=e,i.internalLogger=t,i.config=n,i.metas=r,o.push(i))})},addBeforeSendHooks:(...e)=>{t.debug("Adding beforeSendHooks\n",a),e.forEach(e=>{e&&a.push(e)})},getBeforeSendHooks:()=>[...a],execute:e=>{var r;s||((null===(r=n.batching)||void 0===r?void 0:r.enabled)&&(null==l||l.addItem(e)),(e=>{var r,i;if((null===(r=n.batching)||void 0===r?void 0:r.enabled)&&o.every(e=>e.isBatched()))return;const[s]=u([e]);if(void 0!==s)for(const e of o)t.debug(`Transporting item using ${e.name}\n`,s),e.isBatched()?(null===(i=n.batching)||void 0===i?void 0:i.enabled)||e.send([s]):e.send(s)})(e))},isPaused:()=>s,pause:()=>{t.debug("Pausing transports"),null==l||l.pause(),s=!0},remove:(...e)=>{t.debug("Removing transports"),e.forEach(e=>{t.debug(`Removing "${e.name}" transport`);const n=o.indexOf(e);-1!==n?o.splice(n,1):t.warn(`Transport "${e.name}" is not added`)})},removeBeforeSendHooks:(...e)=>{a.filter(t=>!e.includes(t))},get transports(){return[...o]},unpause:()=>{t.debug("Unpausing transports"),null==l||l.start(),s=!1}}}function Ir(e,t){if(t.preserveOriginalError)for(const t of e)t.type===Lr.EXCEPTION&&delete t.payload.originalError;return e}var Nr;!function(e){e[e.OFF=0]="OFF",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.VERBOSE=4]="VERBOSE"}(Nr||(Nr={}));const Dr={debug:Sr,error:Sr,info:Sr,prefix:"Faro",warn:Sr},Mr=Nr.ERROR,jr=Object.assign({},console);let Ur=jr;function Br(e){var t;return Ur=null!==(t=e.unpatchedConsole)&&void 0!==t?t:Ur,Ur}function Fr(e=jr,t=Mr){const n=Dr;return t>Nr.OFF&&(n.error=t>=Nr.ERROR?function(...t){e.error(`${n.prefix}\n`,...t)}:Sr,n.warn=t>=Nr.WARN?function(...t){e.warn(`${n.prefix}\n`,...t)}:Sr,n.info=t>=Nr.INFO?function(...t){e.info(`${n.prefix}\n`,...t)}:Sr,n.debug=t>=Nr.VERBOSE?function(...t){e.debug(`${n.prefix}\n`,...t)}:Sr),n}let zr=Dr;function Hr(e,t){return zr=Fr(e,t.internalLoggerLevel),zr}class Vr{constructor(){this.unpatchedConsole=jr,this.internalLogger=Dr,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 qr extends Vr{isBatched(){return!1}getIgnoreUrls(){return[]}}function $r(e,t){var n,r;if(void 0===t)return e;if(void 0===e)return{resourceSpans:t};const i=null===(n=e.resourceSpans)||void 0===n?void 0:n[0];if(void 0===i)return e;const o=(null==i?void 0:i.scopeSpans)||[],s=(null===(r=null==t?void 0:t[0])||void 0===r?void 0:r.scopeSpans)||[];return Object.assign(Object.assign({},e),{resourceSpans:[Object.assign(Object.assign({},i),{scopeSpans:[...o,...s]})]})}const Gr="user-action-start",Kr="user-action-end",Wr="user-action-cancel",Xr="user-action-halt";const Qr="Error",Yr=e=>e.map(e=>ur(e)?Ar(e):String(e)).join(" ");let Zr;function Jr({internalLogger:e,config:t,metas:n,transports:r,tracesApi:i,actionBuffer:o,getMessage:s}){var a;e.debug("Initializing exceptions API");let u=null;Zr=null!==(a=t.parseStacktrace)&&void 0!==a?a:Zr;const c=t=>{e.debug("Changing stacktrace parser"),Zr=null!=t?t:Zr},{ignoreErrors:l=[],preserveOriginalError:d}=t;return c(t.parseStacktrace),{changeStacktraceParser:c,getStacktraceParser:()=>Zr,pushError:(a,{skipDedupe:c,stackFrames:p,type:f,context:h,spanContext:g,timestampOverwriteMs:m,originalError:v}={})=>
1{if(!function(e,t){const{message:n,name:r,stack:i}=t;return o=e,s=n+" "+r+" "+i,o.some(e=>ar(e)?s.includes(e):!!s.match(e));var o,s}(l,null!=v?v:a))try{const l=Cr(Object.assign(Object.assign({},function(e){let t=e.cause;fr(t)?t=e.cause.toString():null!==t&&(ur(e.cause)||lr(e.cause))?t=Ar(e.cause):null!=t&&(t=e.cause.toString());return null==t?{}:{cause:t}}(null!=v?v:a)),null!=h?h:{})),b={meta:n.value,payload:Object.assign(Object.assign({type:f||a.name||Qr,value:a.message,timestamp:m?br(m):vr(),trace:g?{trace_id:g.traceId,span_id:g.spanId}:i.getTraceContext()},hr(l)?{}:{context:l}),d?{originalError:v}:{}),type:Lr.EXCEPTION};(null==(p=null!=p?p:a.stack?null==Zr?void 0:Zr(a).frames:void 0)?void 0:p.length)&&(b.payload.stacktrace={frames:p});const y={type:b.payload.type,value:b.payload.value,stackTrace:b.payload.stacktrace,context:b.payload.context};if(!c&&t.dedupe&&!sr(u)&&gr(y,u))return void e.debug("Skipping error push because it is the same as the last one\n",b.payload);u=y,e.debug("Pushing exception\n",b);const _=s();_&&_.type===Gr?o.addItem(b):r.execute(b)}catch(t){e.error("Error pushing event",t)}}}}const ei=e=>e.map(e=>{try{return String(e)}catch(e){return""}}).join(" ");class ti{constructor(){this.buffer=[]}addItem(e){this.buffer.push(e)}flushBuffer(e){if(cr(e))for(const t of this.buffer)e(t);this.buffer.length=0}size(){return this.buffer.length}}function ni({apiMessageBus:e,transports:t,config:n}){const r=new ti,i=n.trackUserActionsExcludeItem;let o;e.subscribe(e=>{if(Gr!==e.type&&Xr!==e.type){if(e.type===Kr){const{id:n,name:s}=e;return r.flushBuffer(e=>{if(function(e,t){return(null==t?void 0:t(e))||e.type===Lr.MEASUREMENT&&"web-vitals"===e.payload.type}(e,i))return void t.execute(e);const r=Object.assign(Object.assign({},e),{payload:Object.assign(Object.assign({},e.payload),{action:{parentId:n,name:s}})});t.execute(r)}),void(o=void 0)}e.type===Wr&&(o=void 0,r.flushBuffer(e=>{t.execute(e)}))}else o=e});return{actionBuffer:r,getMessage:()=>
1o}}const ri=new xr;function ii(e,t,n,r,i){t.debug("Initializing API");const{actionBuffer:o,getMessage:s}=ni({apiMessageBus:ri,transports:i,config:n}),a=function(e,t,n,r,i){let o;return t.debug("Initializing traces API"),{getOTEL:()=>o,getTraceContext:()=>{const e=null==o?void 0:o.trace.getSpanContext(o.context.active());return e?{trace_id:e.traceId,span_id:e.spanId}:void 0},initOTEL:(e,n)=>{t.debug("Initializing OpenTelemetry"),o={trace:e,context:n}},isOTELInitialized:()=>!!o,pushTraces:e=>{try{const n={type:Lr.TRACE,payload:e,meta:r.value};t.debug("Pushing trace\n",n),i.execute(n)}catch(e){t.error("Error pushing trace\n",e)}}}}(0,t,0,r,i),u={unpatchedConsole:e,internalLogger:t,config:n,metas:r,transports:i,tracesApi:a,actionBuffer:o,getMessage:s};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a),Jr(u)),function({internalLogger:e,metas:t}){let n,r,i,o;e.debug("Initializing meta API");const s=e=>{r&&t.remove(r),r={user:e},t.add(r)},a=(e,r)=>{var i;const o=null==r?void 0:r.overrides,s=o?{overrides:Object.assign(Object.assign({},null===(i=null==n?void 0:n.session)||void 0===i?void 0:i.overrides),o)}:{};n&&t.remove(n),n={session:Object.assign(Object.assign({},hr(e)?void 0:e),s)},t.add(n)},u=()=>t.value.session,c=()=>t.value.page;return{setUser:s,resetUser:s,setSession:a,resetSession:a,getSession:u,setView:(e,n)=>{var r;if((null==n?void 0:n.overrides)&&a(u(),{overrides:n.overrides}),(null===(r=null==i?void 0:i.view)||void 0===r?void 0:r.name)===(null==e?void 0:e.name))return;const o=i;i={view:e},t.add(i),o&&t.remove(o)},getView:()=>t.value.view,setPage:e=>{var n;const r=ar(e)?Object.assign(Object.assign({},null!==(n=null==o?void 0:o.page)&&void 0!==n?n:c()),{id:e}):e;o&&t.remove(o),o={page:r},t.add(o)},getPage:c}}(u)),function({internalLogger:e,config:t,metas:n,transports:r,tracesApi:i,actionBuffer:o,getMessage:s}){var a;e.debug("Initializing logs API");let u=null;
1const c=null!==(a=t.logArgsSerializer)&&void 0!==a?a:ei;return{pushLog:(a,{context:l,level:d,skipDedupe:p,spanContext:f,timestampOverwriteMs:h}={})=>{try{const g=Cr(l),m={type:Lr.LOG,payload:{message:c(a),level:null!=d?d:_r,context:hr(g)?void 0:g,timestamp:h?br(h):vr(),trace:f?{trace_id:f.traceId,span_id:f.spanId}:i.getTraceContext()},meta:n.value},v={message:m.payload.message,level:m.payload.level,context:m.payload.context};if(!p&&t.dedupe&&!sr(u)&&gr(v,u))return void e.debug("Skipping log push because it is the same as the last one\n",m.payload);u=v,e.debug("Pushing log\n",m);const b=s();b&&b.type===Gr?o.addItem(m):r.execute(m)}catch(t){e.error("Error pushing log\n",t)}}}}(u)),function({internalLogger:e,config:t,metas:n,transports:r,tracesApi:i,actionBuffer:o,getMessage:s}){e.debug("Initializing measurements API");let a=null;return{pushMeasurement:(u,{skipDedupe:c,context:l,spanContext:d,timestampOverwriteMs:p}={})=>{try{const f=Cr(l),h={type:Lr.MEASUREMENT,payload:Object.assign(Object.assign({},u),{trace:d?{trace_id:d.traceId,span_id:d.spanId}:i.getTraceContext(),timestamp:p?br(p):vr(),context:hr(f)?void 0:f}),meta:n.value},g={type:h.payload.type,values:h.payload.values,context:h.payload.context};if(!c&&t.dedupe&&!sr(a)&&gr(g,a))return void e.debug("Skipping measurement push because it is the same as the last one\n",h.payload);a=g,e.debug("Pushing measurement\n",h);const m=s();m&&m.type===Gr?o.addItem(h):r.execute(h)}catch(t){e.error("Error pushing measurement\n",t)}}}}(u)),function({internalLogger:e,config:t,metas:n,transports:r,tracesApi:i,actionBuffer:o,getMessage:s}){let a=null;return{pushEvent:(u,c,l,{skipDedupe:d,spanContext:p,timestampOverwriteMs:f,customPayloadTransformer:h=e=>e}={})=>{try{const g=Cr(c),m={meta:n.value,payload:h({name:u,domain:null!=l?l:t.eventDomain,attributes:hr(g)?void 0:g,timestamp:f?br(f):vr(),trace:p?{trace_id:p.traceId,span_id:p.spanId}:i.getTraceContext()}),type:Lr.EVENT},v={name:m.payload.name,attributes:m.payload.attributes,domain:m.payload.domain};if(!d&&t.dedupe&&!sr(a)&&gr(v,a))return void e.debug("Skipping event push because it is the same as the last one\n",m.payload);a=v,e.debug("Pushing event\n",m);const b=s();b&&b.type===Gr?o.addItem(m):r.execute(m)}catch(t){e.error("Error pushing event",t)}}}}(u))}class oi extends Vr{constructor(){super(...arguments),this.api={},this.transports={}}}const si="1.19.0";const ai="_faroInternal";let ui={};function ci(e,t,n,r,i,o,s){return t.debug("Initializing Faro"),ui={api:o,config:n,instrumentations:s,internalLogger:t,metas:r,pause:i.pause,transports:i,unpatchedConsole:e,unpause:i.unpause},function(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(Or,ai,{configurable:!1,enumerable:!1,writable:!1,value:e}))}(ui),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 Or)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(Or,e.config.globalObjectKey,{configurable:!1,writable:!1,value:e})}}(ui),ui}function li(e){const t=Br(e),n=Hr(t,e);if(ai in Or&&!e.isolate)return void n.error('Faro is already registered. Either add instrumentations, transports etc. to the global faro instance or use the "isolate" property');n.debug("Initializing");const r=function(e,t){let n=[],r=[];const i=()=>n.reduce((e,t)=>Object.assign(e,cr(t)?t():t),{}),o=()=>{if(r.length){const e=i();r.forEach(t=>t(e))}};return{add:(...e)=>{t.debug("Adding metas\n",e),n.push(...e),o()},remove:(...e)=>{t.debug("Removing metas\n",e),n=n.filter(t=>!e.includes(t)),o()},addListener:e=>{t.debug("Adding metas listener\n",e),r.push(e)},removeListener:e=>{t.debug("Removing metas listener\n",e),r=r.filter(t=>t!==e)},get value(){return i()}}}(0,n),i=kr(t,n,e,r),o=ii(t,n,e,r,i),s=function(e,t,n,r,i,o){t.debug("Initializing instrumentations");const s=[];return{add:(...a)=>{t.debug("Adding instrumentations"),a.forEach(a=>{t.debug(`Adding "${a.name}" instrumentation`),s.some(e=>
1e.name===a.name)?t.warn(`Instrumentation ${a.name} is already added`):(a.unpatchedConsole=e,a.internalLogger=t,a.config=n,a.metas=r,a.transports=i,a.api=o,s.push(a),a.initialize())})},get instrumentations(){return[...s]},remove:(...e)=>{t.debug("Removing instrumentations"),e.forEach(e=>{var n,r;t.debug(`Removing "${e.name}" instrumentation`);const i=s.reduce((t,n,r)=>null===t&&n.name===e.name?r:null,null);null!==i?(null===(r=(n=s[i]).destroy)||void 0===r||r.call(n),s.splice(i,1)):t.warn(`Instrumentation "${e.name}" is not added`)})}}}(t,n,e,r,i,o),a=ci(t,n,e,r,i,o,s);return function(e){var t,n;const r={sdk:{version:si},app:{bundleId:e.config.app.name&&(i=e.config.app.name,null==Or?void 0:Or[`__faroBundleId_${i}`])}};var i;const o=null===(t=e.config.sessionTracking)||void 0===t?void 0:t.session;o&&e.api.setSession(o),e.config.app&&(r.app=Object.assign(Object.assign({},e.config.app),r.app)),e.config.user&&(r.user=e.config.user),e.config.view&&(r.view=e.config.view),e.metas.add(r,...null!==(n=e.config.metas)&&void 0!==n?n:[])}(a),function(e){e.transports.add(...e.config.transports),e.transports.addBeforeSendHooks(e.config.beforeSend)}(a),function(e){e.instrumentations.add(...e.config.instrumentations)}(a),a}const di="faro",pi={enabled:!0,sendTimeout:250,itemLimit:50},fi="session_start",hi="session_resume",gi="service_name_override",mi="unknown";var vi={exports:{}};!function(e,t){!function(n,r){var i="function",o="undefined",s="object",a="string",u="major",c="model",l="name",d="type",p="vendor",f="version",h="architecture",g="console",m="mobile",v="tablet",b="smarttv",y="wearable",_="embedded",w="Amazon",S="Apple",T="ASUS",E="BlackBerry",O="Browser",A="Chrome",C="Firefox",x="Google",R="Huawei",L="LG",P="Microsoft",k="Motorola",I="Opera",N="Samsung",D="Sharp",M="Sony",j="Xiaomi",U="Zebra",B="Facebook",F="Chromium OS",z="Mac OS",H=" Browser",V=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},q=function(e,t){return typeof e===a&&-1!==$(t).indexOf($(e))},$=function(e){return e.toLowerCase()},G=function(e,t){if(typeof e===a)return e=e.replace(/^\s\s*/,""),typeof t===o?e:e.substring(0,500)},K=function(e,t){for(var n,o,a,u,c,l,d=0;d<t.length&&!c;){var p=t[d],f=t[d+1];for(n=o=0;n<p.length&&!c&&p[n];)if(c=p[n++].exec(e))for(a=0;a<f.length;a++)l=c[++o],typeof(u=f[a])===s&&u.length>0?2===u.length?typeof u[1]==i?this[u[0]]=u[1].call(this,l):this[u[0]]=u[1]:3===u.length?typeof u[1]!==i||u[1].exec&&u[1].test?this[u[0]]=l?l.replace(u[1],u[2]):r:this[u[0]]=l?u[1].call(this,l,u[2]):r:4===u.length&&(this[u[0]]=l?u[3].call(this,l.replace(u[1],u[2])):r):this[u]=l||r;d+=2}},W=function(e,t){for(var n in t)if(typeof t[n]===s&&t[n].length>0){for(var i=0;i<t[n].length;i++)if(q(t[n][i],e))return"?"===n?r:n}else if(q(t[n],e))return"?"===n?r:n;return t.hasOwnProperty("*")?t["*"]:e},X={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"},Q={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[f,[l,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[l,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[l,f],[/opios[\/ ]+([\w\.]+)/i],[f,[l,I+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[f,[l,I+" GX"]],[/\bopr\/([\w\.]+)/i],[f,[l,I]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[f,[l,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[f,[l,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[l,f],[/quark(?:pc)?\/([-\w\.]+)/i],[f,[l,"Quark"]],[/\bddg\/([\w\.]+)/i],[f,[l,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[l,"UC"+O]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[f,[l,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[l,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[l,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[f,[l,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[f,[l,"Smart Lenovo "+O]],[/(avast|avg)\/([\w\.]+)/i],[[l,/(.+)/,"$1 Secure "+O],f],[/\bfocus\/([\w\.]+)/i],[f,[l,C+" Focus"]],[/\bopt\/([\w\.]+)/i],[f,[l,I+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[l,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[l,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[l,I+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[l,"MIUI"+H]],[/fxios\/([\w\.-]+)/i],[f,[l,C]],[/\bqihoobrowser\/?([\w\.]*)/i],[f,[l,"360"]],[/\b(qq)\/([\w\.]+)/i],[[l,/(.+)/,"$1Browser"],f],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[l,/(.+)/,"$1"+H],f],[/samsungbrowser\/([\w\.]+)/i],[f,[l,N+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[f,[l,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[l,"Sogou Mobile"],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[l,f],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[l],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[f,l],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[l,B],f],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[l,f],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[l,"GSA"]],[/musical_ly(?:.
vendor: 4,580 bytes, line 1
1+app_?version\/|_)([\w\.]+)/i],[f,[l,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[l,A+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[l,A+" WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[l,"Android "+O]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[l,f],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[f,[l,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[f,l],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[l,[f,W,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[l,f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[l,"Netscape"],f],[/(wolvic|librewolf)\/([\w\.]+)/i],[l,f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[l,C+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\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|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[l,[f,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[l,[f,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[h,"amd64"]],[/(ia32(?=;))/i],[[h,$]],[/((?:i[346]|x)86)[;\)]/i],[[h,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[h,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[h,"armhf"]],[/windows (ce|mobile); ppc;/i],[[h,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[h,/ower/,"",$]],[/(sun4\w)[;\)]/i],[[h,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[h,$]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[c,[p,N],[d,v]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[c,[p,N],[d,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[c,[p,S],[d,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[c,[p,S],[d,v]],[/(macintosh);/i],[c,[p,S]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[c,[p,D],[d,m]],[/(?:honor)([-\w ]+)[;\)]/i],[c,[p,"Honor"],[d,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[c,[p,R],[d,v]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[c,[p,R],[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,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[c,/_/g," "],[p,j],[d,m]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[c,/_/g," "],[p,j],[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],[c,[p,"OPPO"],[d,m]],[/\b(opd2\d{3}a?) bui/i],[c,[p,"OPPO"],[d,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[c,[p,"Vivo"],[d,m]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[c,[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],[c,[p,k],[d,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[c,[p,k],[d,v]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[c,[p,L],[d,v]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[c,[p,L],[d,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[c,[p,"Lenovo"],[d,v]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[c,/_/g," "],[p,"Nokia"],[d,m]],[/(pixel c)\b/i],[c,[p,x],[d,v]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[c,[p,x],[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],[c,[p,M],[d,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[c,"Xperia Tablet"],[p,M],[d,v]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[c,[p,"OnePlus"],[d,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[c,[p,w],[d,v]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[c,/(.+)
vendor: 5,020 bytes, line 1
1/g,"Fire Phone $1"],[p,w],[d,m]],[/(playbook);[-\w\),; ]+(rim)/i],[c,p,[d,v]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[c,[p,E],[d,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[c,[p,T],[d,v]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[c,[p,T],[d,m]],[/(nexus 9)/i],[c,[p,"HTC"],[d,v]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[p,[c,/_/g," "],[d,m]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[c,[p,"TCL"],[d,v]],[/(itel) ((\w+))/i],[[p,$],c,[d,W,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[c,[p,"Acer"],[d,v]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[c,[p,"Meizu"],[d,m]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[c,[p,"Ulefone"],[d,m]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[c,[p,"Energizer"],[d,m]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[c,[p,"Cat"],[d,m]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[c,[p,"Smartfren"],[d,m]],[/droid.+; (a(?:015|06[35]|142p?))/i],[c,[p,"Nothing"],[d,m]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[p,c,[d,m]],[/(imo) (tab \w+)/i,/(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,c,[d,v]],[/(surface duo)/i],[c,[p,P],[d,v]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[c,[p,"Fairphone"],[d,m]],[/(u304aa)/i],[c,[p,"AT&T"],[d,m]],[/\bsie-(\w*)/i],[c,[p,"Siemens"],[d,m]],[/\b(rct\w+) b/i],[c,[p,"RCA"],[d,v]],[/\b(venue[\d ]{2,7}) b/i],[c,[p,"Dell"],[d,v]],[/\b(q(?:mv|ta)\w+) b/i],[c,[p,"Verizon"],[d,v]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[c,[p,"Barnes & Noble"],[d,v]],[/\b(tm\d{3}\w+) b/i],[c,[p,"NuVision"],[d,v]],[/\b(k88) b/i],[c,[p,"ZTE"],[d,v]],[/\b(nx\d{3}j) b/i],[c,[p,"ZTE"],[d,m]],[/\b(gen\d{3}) b.+49h/i],[c,[p,"Swiss"],[d,m]],[/\b(zur\d{3}) b/i],[c,[p,"Swiss"],[d,v]],[/\b((zeki)?tb.*\b) b/i],[c,[p,"Zeki"],[d,v]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[p,"Dragon Touch"],c,[d,v]],[/\b(ns-?\w{0,9}) b/i],[c,[p,"Insignia"],[d,v]],[/\b((nxa|next)-?\w{0,9}) b/i],[c,[p,"NextBook"],[d,v]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[p,"Voice"],c,[d,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[p,"LvTel"],c,[d,m]],[/\b(ph-1) /i],[c,[p,"Essential"],[d,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[c,[p,"Envizen"],[d,v]],[/\b(trio[-\w\. ]+) b/i],[c,[p,"MachSpeed"],[d,v]],[/\btu_(1491) b/i],[c,[p,"Rotor"],[d,v]],[/(shield[\w ]+) b/i],[c,[p,"Nvidia"],[d,v]],[/(sprint) (\w+)/i],[p,c,[d,m]],[/(kin\.[onetw]{3})/i],[[c,/\./g," "],[p,P],[d,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[c,[p,U],[d,v]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[c,[p,U],[d,m]],[/smart-tv.+(samsung)/i],[p,[d,b]],[/hbbtv.+maple;(\d+)/i],[[c,/^/,"SmartTV"],[p,N],[d,b]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[p,L],[d,b]],[/(apple) ?tv/i],[p,[c,S+" TV"],[d,b]],[/crkey/i],[[c,A+"cast"],[p,x],[d,b]],[/droid.+aft(\w+)( bui|\))/i],[c,[p,w],[d,b]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[c,[p,D],[d,b]],[/(bravia[\w ]+)( bui|\))/i],[c,[p,M],[d,b]],[/(mitv-\w{5}) bui/i],[c,[p,j],[d,b]],[/Hbbtv.*(technisat) (.*);/i],[p,c,[d,b]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[p,G],[c,G],[d,b]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,b]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[p,c,[d,g]],[/droid.+; (shield) bui/i],[c,[p,"Nvidia"],[d,g]],[/(playstation [345portablevi]+)/i],[c,[p,M],[d,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[c,[p,P],[d,g]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[c,[p,N],[d,y]],[/((pebble))app/i],[p,c,[d,y]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[c,[p,S],[d,y]],[/droid.+; (glass) \d/i],[c,[p,x],[d,y]],[/droid.+; (wt63?0{2,3})\)/i],[c,[p,U],[d,y]],[/droid.+; (glass) \d/i],[c,[p,x],[d,y]],[/(pico) (4|neo3(?: link|pro)?)/i],[p,c,[d,y]],[/; (quest( \d| pro)?)/i],[c,[p,B],[d,y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[p,[d,_]],[/(aeobc)\b/i],[c,[p,w],[d,_]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[c,[d,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[c,[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],[c,[p,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[l,"E
1dgeHTML"]],[/(arkweb)\/([\w\.]+)/i],[l,f],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[l,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[l,f],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,l]],os:[[/microsoft (windows) (vista|xp)/i],[l,f],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[l,[f,W,X]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[f,W,X],[l,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[l,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[l,z],[f,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[f,l],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[l,f],[/\(bb(10);/i],[f,[l,E]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[f,[l,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[f,[l,C+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[l,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[f,[l,"watchOS"]],[/crkey\/([\d\.]+)/i],[f,[l,A+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[l,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],[l,f],[/(sunos) ?([\w\.\d]*)/i],[[l,"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],[l,f]]},Y=function(e,t){if(typeof e===s&&(t=e,e=r),!(this instanceof Y))return new Y(e,t).getResult();var g=typeof n!==o&&n.navigator?n.navigator:r,b=e||(g&&g.userAgent?g.userAgent:""),y=g&&g.userAgentData?g.userAgentData:r,_=t?function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n}(Q,t):Q,w=g&&g.userAgent==b;return this.getBrowser=function(){var e,t={};return t[l]=r,t[f]=r,K.call(t,b,_.browser),t[u]=typeof(e=t[f])===a?e.replace(/[^\d\.]/g,"").split(".")[0]:r,w&&g&&g.brave&&typeof g.brave.isBrave==i&&(t[l]="Brave"),t},this.getCPU=function(){var e={};return e[h]=r,K.call(e,b,_.cpu),e},this.getDevice=function(){var e={};return e[p]=r,e[c]=r,e[d]=r,K.call(e,b,_.device),w&&!e[d]&&y&&y.mobile&&(e[d]=m),w&&"Macintosh"==e[c]&&g&&typeof g.standalone!==o&&g.maxTouchPoints&&g.maxTouchPoints>2&&(e[c]="iPad",e[d]=v),e},this.getEngine=function(){var e={};return e[l]=r,e[f]=r,K.call(e,b,_.engine),e},this.getOS=function(){var e={};return e[l]=r,e[f]=r,K.call(e,b,_.os),w&&!e[l]&&y&&y.platform&&"Unknown"!=y.platform&&(e[l]=y.platform.replace(/chrome os/i,F).replace(/macos/i,z)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return b},this.setUA=function(e){return b=typeof e===a&&e.length>500?G(e,500):e,this},this.setUA(b),this};Y.VERSION="1.0.40",Y.BROWSER=V([l,f,u]),Y.CPU=V([h]),Y.DEVICE=V([c,p,d,g,m,b,v,y,_]),Y.ENGINE=Y.OS=V([l,f]),e.exports&&(t=e.exports=Y),t.UAParser=Y;var Z=typeof n!==o&&(n.jQuery||n.Zepto);if(Z&&!Z.ua){var J=new Y;Z.ua=J.getResult(),Z.ua.get=function(){return J.getUA()},Z.ua.set=function(e){J.setUA(e);var t=J.getResult();for(var n in t)Z.ua[n]=t[n]}}}("object"==typeof window?window:xn)}
1(vi,vi.exports);var bi=vi.exports;const yi=()=>{const e=new bi.UAParser,{name:t,version:n}=e.getBrowser(),{name:r,version:i}=e.getOS(),o=e.getUA(),s=navigator.language,a=navigator.userAgent.includes("Mobi"),u=function(){if(!t||!n)return;if("userAgentData"in navigator&&navigator.userAgentData)return navigator.userAgentData.brands;return}();return{browser:{name:null!=t?t:mi,version:null!=n?n:mi,os:`${null!=r?r:mi} ${null!=i?i:mi}`,userAgent:null!=o?o:mi,language:null!=s?s:mi,mobile:a,brands:null!=u?u:mi,viewportWidth:`${window.innerWidth}`,viewportHeight:`${window.innerHeight}`}}};function _i(e){var t,n,r,i;return{id:null!==(i=null===(r=null===(n=null===(t=ui.config)||void 0===t?void 0:t.sessionTracking)||void 0===n?void 0:n.generateSessionId)||void 0===r?void 0:r.call(n))&&void 0!==i?i:Er(),attributes:e}}const wi="sessionStorage",Si="localStorage";function Ti(e){var t;try{let t;t=window[e];const n="__faro_storage_test__";return t.setItem(n,n),t.removeItem(n),!0}catch(n){return null===(t=ui.internalLogger)||void 0===t||t.info(`Web storage of type ${e} is not available. Reason: ${n}`),!1}}function Ei(e,t){return Ri(t)?window[t].getItem(e):null}function Oi(e,t,n){if(Ri(n))try{window[n].setItem(e,t)}catch(e){}}function Ai(e,t){Ri(t)&&window[t].removeItem(e)}const Ci=Ti(Si),xi=Ti(wi);function Ri(e){return e===Si?Ci:e===wi&&xi}function Li(e,t){let n,r=!1;const i=()=>{null!=n?(e(...n),n=null,setTimeout(i,t)):r=!1};return(...o)=>{r?n=o:(e(...o),r=!0,setTimeout(i,t))}}function Pi(e=""){return ui.transports.transports.flatMap(e=>e.getIgnoreUrls()).some(t=>e&&null!=e.match(t))}function ki(e){return ar(e)?e:e instanceof URL?e.href:!hr(e)&&cr(null==e?void 0:e.toString)?e.toString():void 0}const Ii="com.grafana.faro.session",Ni=9e5,Di={enabled:!0,persistent:!1,maxSessionPersistenceTime:Ni};function Mi(){var e,t,n;const r=ui.config.sessionTracking;let i=null!==(n=null!==(t=null===(e=null==r?void 0:r.sampler)||void 0===e?void 0:e.call(r,{metas:ui.metas.value}))&&void 0!==t?t:null==r?void 0:r.samplingRate)&&void 0!==n?n:1;if("number"!=typeof i){i=0}return Math.random()<i}function ji({sessionId:e,started:t,lastActivity:n,isSampled:r=!0}={}){var i,o;const s=mr(),a=null===(o=null===(i=ui.config)||void 0===i?void 0:i.sessionTracking)||void 0===o?void 0:o.generateSessionId;return null==e&&(e="function"==typeof a?a():Er()),{sessionId:e,lastActivity:null!=n?n:s,started:null!=t?t:s,isSampled:r}}function Ui(e){if(null==e)return!1;const t=mr();if(!(t-e.started<144e5))return!1;return t-e.lastActivity<Ni}function Bi({fetchUserSession:e,storeUserSession:t}){return function({forceSessionExtend:n}={forceSessionExtend:!1}){var r,i,o;if(!e||!t)return;const s=ui.config.sessionTracking,a=null==s?void 0:s.persistent;if(a&&!Ci||!a&&!xi)return;const u=e();if(!1===n&&Ui(u))t(Object.assign(Object.assign({},u),{lastActivity:mr()}));else{let e=Fi(ji({isSampled:Mi()}),u);t(e),null===(r=ui.api)||void 0===r||r.setSession(e.sessionMeta),null===(i=null==s?void 0:s.onSessionChange)||void 0===i||i.call(s,null!==(o=null==u?void 0:u.sessionMeta)&&void 0!==o?o:null,e.sessionMeta)}}}function Fi(e,t){var n,r,i,o,s,a,u;const c=Object.assign(Object.assign({},e),{sessionMeta:{id:e.sessionId,attributes:Object.assign(Object.assign(Object.assign({},null===(r=null===(n=ui.config.sessionTracking)||void 0===n?void 0:n.session)||void 0===r?void 0:r.attributes),null!==(o=null===(i=ui.metas.value.session)||void 0===i?void 0:i.attributes)&&void 0!==o?o:{}),{isSampled:e.isSampled.toString()})}}),l=null!==(a=null===(s=ui.metas.value.session)||void 0===s?void 0:s.overrides)&&void 0!==a?a:null===(u=null==t?void 0:t.sessionMeta)||void 0===u?void 0:u.overrides;hr(l)||(c.sessionMeta.overrides=l);const d=null==t?void 0:t.sessionId;return null!=d&&(c.sessionMeta.attributes.previousSession=d),c}function zi({fetchUserSession:e,storeUserSession:t}){return function(n){const r=n.session,i=e();let o=null==r?void 0:r.id;const s=null==r?void 0:r.attributes,a=null==r?void 0:r.overrides,u=null==i?void 0:i.sessionMeta,c=null==u?void 0:u.overrides,l=!!a&&!gr(a,c),d=!!s&&!gr(s,null==u?void 0:u.attributes);if(!!r&&o!==(null==i?void 0:i.sessionId)||d||l){const e=Fi(ji({sessionId:o,isSampled:Mi()}),i);t(e),function(e,t={},n={}){var r,i,o;if(!e)return;const s=t.serviceName,a=null!==(o=null!==(r=n.serviceName)&&void 0!==r?r:null===(i=ui.metas.value.app)||void 0===i?void 0:i.name)&&void 0!==o?o:"";s&&s!==a&&ui.api.pushEvent(gi,{serviceName:s,previousServiceName:a})}(l,a,c),ui.api.setSession(e.sessionMeta)}}}class Hi{constructor(){this.updateSession=Li(()=>this.updateUserSession(),1e3),this.updateUserSession=Bi({fetchUserSession:Hi.fetchUserSession,storeUserSession:Hi.storeUserSession}),this.init()}static removeUserSession(){Ai(Ii,Hi.storageTypeLocal)}static storeUserSession(e){Oi(Ii,Ar(e),Hi.storageTypeLocal)}static fetchUserSession(){const e=Ei(Ii,Hi.storageTypeLocal);return e?JSON.parse(e):null}init(){document.addEventListener("visibilitychange",()=>{"visible"===document.visibilityState&&this.updateSession()}),ui.metas.addListener(zi({fetchUserSession:Hi.fetchUserSession,storeUserSession:Hi.storeUserSession}))}}Hi.storageTypeLocal=Si;class Vi{constructor(){this.updateSession=Li(()=>this.updateUserSession(),1e3),this.updateUserSession=Bi({fetchUserSession:Vi.fetchUserSession,storeUserSession:Vi.storeUserSession}),this.init()}static removeUserSession(){Ai(Ii,Vi.storageTypeSession)}static storeUserSession(e){Oi(Ii,Ar(e),Vi.storageTypeSession)}static fetchUserSession(){const e=Ei(Ii,Vi.storageTypeSession);return e?JSON.parse(e):null}init(){document.addEventListener("visibilitychange",()=>{"visible"===document.visibilityState&&this.updateSession()}),ui.metas.addListener(zi({fetchUserSession:Vi.fetchUserSession,storeUserSession:Vi.storeUserSession}))}}function qi(e){return(null==e?void 0:e.persistent)?Hi:Vi}Vi.storageTypeSession=wi;class $i extends oi{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-se
1ssion",this.version=si}sendSessionStartEvent(e){var t,n;const r=e.session;if(r&&r.id!==(null===(t=this.notifiedSession)||void 0===t?void 0:t.id)){if(this.notifiedSession&&this.notifiedSession.id===(null===(n=r.attributes)||void 0===n?void 0:n.previousSession))return this.api.pushEvent("session_extend",{},void 0,{skipDedupe:!0}),void(this.notifiedSession=r);this.notifiedSession=r,this.api.pushEvent(fi,{},void 0,{skipDedupe:!0})}}createInitialSession(e,t){var n,r,i,o,s,a;let u,c,l=e.fetchUserSession();if(t.persistent&&t.maxSessionPersistenceTime&&l){const e=mr();l.lastActivity<e-t.maxSessionPersistenceTime&&(Hi.removeUserSession(),l=null)}if(Ui(l)){const e=null==l?void 0:l.sessionId;c=ji({sessionId:e,isSampled:l.isSampled||!1,started:null==l?void 0:l.started});const i=null==l?void 0:l.sessionMeta,o=Object.assign(Object.assign({},null===(n=t.session)||void 0===n?void 0:n.overrides),null==i?void 0:i.overrides);c.sessionMeta=Object.assign(Object.assign({},t.session),{id:e,attributes:Object.assign(Object.assign(Object.assign({},null===(r=t.session)||void 0===r?void 0:r.attributes),null==i?void 0:i.attributes),{isSampled:c.isSampled.toString()}),overrides:o}),u=hi}else{const e=null!==(o=null===(i=t.session)||void 0===i?void 0:i.id)&&void 0!==o?o:_i().id;c=ji({sessionId:e,isSampled:Mi()});const n=null===(s=t.session)||void 0===s?void 0:s.overrides;c.sessionMeta=Object.assign({id:e,attributes:Object.assign({isSampled:c.isSampled.toString()},null===(a=t.session)||void 0===a?void 0:a.attributes)},n?{overrides:n}:{}),u=fi}return{initialSession:c,lifecycleType:u}}registerBeforeSendHook(e){var t;const{updateSession:n}=new e;null===(t=this.transports)||void 0===t||t.addBeforeSendHooks(e=>{var t,r,i;n();const o=null===(t=e.meta.session)||void 0===t?void 0:t.attributes;if(o&&"true"===(null==o?void 0:o.isSampled)){let t=JSON.parse(JSON.stringify(e));const n=null===(r=t.meta.session)||void 0===r?void 0:r.attributes;return null==n||delete n.isSampled,0===Object.keys(null!=n?n:{}).length&&(null===(i=t.meta.session)||void 0===i||delete i.attributes),t}return null})}initialize(){this.logDebug("init session instrumentation");const e=this.config.sessionTracking;if(null==e?void 0:e.enabled){const t=qi(e);this.registerBeforeSendHook(t);const{initialSession:n,lifecycleType:r}=this.createInitialSession(t,e);t.storeUserSession(n);const i=n.sessionMeta;this.notifiedSession=i,this.api.setSession(i),r===fi&&this.api.pushEvent(fi,{},void 0,{skipDedupe:!0}),r===hi&&this.api.pushEvent(hi,{},void 0,{skipDedupe:!0})}this.metas.addListener(this.sendSessionStartEvent.bind(this))}}const Gi=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;const Ki=/^\s*at (?:(.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Wi=/\((\S*)(?::(\d+))(?::(\d+))\)/,Xi="address at ",Qi=/^\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,Yi=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Zi="safari-extension",Ji="safari-web-extension",eo=/Minified React error #\d+;/i;function to(e,t,n,r){const i={filename:e||document.location.href,function:t||"?"};return void 0!==n&&(i.lineno=n),void 0!==r&&(i.colno=r),i}function no(e,t){const n=null==e?void 0:e.includes(Zi),r=!n&&(null==e?void 0:e.includes(Ji));return n||r?[(null==e?void 0:e.includes("@"))?e.split("@")[0]:e,n?`${Zi}:${t}`:`${Ji}:${t}`]:[e,t]}function ro(e){let t=[];e.stacktrace?t=e.stacktrace.split("\n").filter((e,t)=>t%2==0):e.stack&&(t=e.stack.split("\n"));const n=t.reduce((t,n,r)=>{let i,o,s,a,u;if(i=Ki.exec(n)){if(o=i[1],s=i[2],a=i[3],u=i[4],null==s?void 0:s.startsWith("eval")){const e=Wi.exec(s);e&&(s=e[1],a=e[2],u=e[3])}s=(null==s?void 0:s.startsWith(Xi))?s.substring(11):s,[o,s]=no(o,s)}else if(i=Qi.exec(n)){if(o=i[1],s=i[3],a=i[4],u=i[5],s&&s.includes(" > eval")){const e=Yi.exec(s);e&&(o=o||"eval",s=e[1],a=e[2])}else 0===r&&!u&&(rr(c=e.columnNumber,"number")&&!isNaN(c)||rr(c,"bigint"))&&(u=String(e.columnNumber+1));[o,s]=no(o,s)}var c;return(s||o)&&t.push(to(s,o,a?Number(a):void 0,u?Number(u):void 0)),t},[]);return eo.test(e.message)?n.slice(1):n}function io(e){return{frames:ro(e)}}function oo(e){let t,n,r,i,o=[];
1if((e=>ir(e,"ErrorEvent"))(e)&&e.error)t=e.error.message,n=e.error.name,o=ro(e.error);else if((r=(e=>ir(e,"DOMError"))(e))||(e=>ir(e,"DOMException"))(e)){const{name:i,message:o}=e;n=null!=i?i:r?"DOMError":"DOMException",t=o?`${n}: ${o}`:n}else fr(e)?(t=e.message,o=ro(e)):(ur(e)||(i=(e=>dr&&or(e,Event))(e)))&&(n=i?e.constructor.name:void 0,t=`Non-Error exception captured with keys: ${Object.keys(e)}`);return[t,n,o]}function so(e){const[t,n,r,i,o]=e;let s,a,u=[];const c=ar(t),l=to(n,"?",r,i);return o||!c?([s,a,u]=oo(null!=o?o:t),0===u.length&&(u=[l])):c&&([s,a]=function(e){var t,n;const r=e.match(Gi),i=null!==(t=null==r?void 0:r[1])&&void 0!==t?t:Qr;return[null!==(n=null==r?void 0:r[2])&&void 0!==n?n:e,i]}(t),u=[l]),{value:s,type:a,stackFrames:u}}function ao(e,t){return fr(e[0])?so(e):{value:t(e)}}class uo extends oi{constructor(e={}){super(),this.options=e,this.name="@grafana/faro-web-sdk:instrumentation-console",this.version=si,this.errorSerializer=ei}initialize(){var e,t,n,r;this.options=Object.assign(Object.assign({},this.options),this.config.consoleInstrumentation);const i=(null===(e=this.options)||void 0===e?void 0:e.serializeErrors)||!!(null===(t=this.options)||void 0===t?void 0:t.errorSerializer);this.errorSerializer=i?null!==(r=null===(n=this.options)||void 0===n?void 0:n.errorSerializer)&&void 0!==r?r:Yr:ei,wr.filter(e=>{var t,n;return!(null!==(n=null===(t=this.options)||void 0===t?void 0:t.disabledLevels)&&void 0!==n?n:uo.defaultDisabledLevels).includes(e)}).forEach(e=>{console[e]=(...t)=>{var n,r;try{if(e!==yr.ERROR||(null===(n=this.options)||void 0===n?void 0:n.consoleErrorAsLog))if(e===yr.ERROR&&(null===(r=this.options)||void 0===r?void 0:r.consoleErrorAsLog)){const{value:n,type:r,stackFrames:i}=ao(t,this.errorSerializer);this.api.pushLog(n?[uo.consoleErrorPrefix+n]:t,{level:e,context:{value:null!=n?n:"",type:null!=r?r:"",stackFrames:(null==i?void 0:i.length)?Yr(i):""}})}else this.api.pushLog(t,{level:e});else{const{value:e,type:n,stackFrames:r}=ao(t,this.errorSerializer);if(e&&!n&&!r)return void this.api.pushError(new Error(uo.consoleErrorPrefix+e));this.api.pushError(new Error(uo.consoleErrorPrefix+e),{type:n,stackFrames:r})}}catch(e){this.logError(e)}finally{this.unpatchedConsole[e](...t)}}})}}function co(e){window.addEventListener("unhandledrejection",t=>{var n,r;let i,o,s=t;s.reason?s=t.reason:(null===(n=t.detail)||void 0===n?void 0:n.reason)&&(s=null===(r=t.detail)||void 0===r?void 0:r.reason);let a=[];(e=>!ur(e)&&!cr(e))(s)?(i=`Non-Error promise rejection captured with value: ${String(s)}`,o="UnhandledRejection"):[i,o,a]=oo(s),i&&e.pushError(new Error(i),{type:o,stackFrames:a})})}uo.defaultDisabledLevels=[yr.DEBUG,yr.TRACE,yr.LOG],uo.consoleErrorPrefix="console.error: ";class lo extends oi{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-errors",this.version=si}initialize(){this.logDebug("Initializing"),function(e){const t=window.onerror;window.onerror=(...n)=>{try{const{value:t,type:r,stackFrames:i}=so(n),o=n[4];if(t){const n={type:r,stackFrames:i};null!=o&&(n.originalError=o),e.pushError(new Error(t),n)}}finally{null==t||t.apply(window,n)}}}(this.api),co(this.api)}}class po extends oi{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-view",this.version=si}sendViewChangedEvent(e){var t,n,r,i;const o=e.view;o&&o.name!==(null===(t=this.notifiedView)||void 0===t?void 0:t.name)&&(this.api.pushEvent("view_changed",{fromView:null!==(r=null===(n=this.notifiedView)||void 0===n?void 0:n.name)&&void 0!==r?r:mi,toView:null!==(i=o.name)&&void 0!==i?i:mi},void 0,{skipDedupe:!0}),this.notifiedView=o)}initialize(){this.metas.addListener(this.sendViewChangedEvent.bind(this))}}var fo,ho,go,mo,vo,bo=-1,yo=function(e){addEventListener("pageshow",function(t){t.persisted&&(bo=t.timeStamp,e(t))},!0)},_o=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},wo=function(){var e=_o();return e&&e.activationStart||0},So=function(e,t){var n=_o(),r="navigate";return bo>=0?r="back-forward-cache":n&&(document.prerendering||wo()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},To=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver(function(e){Promise.resolve().then(function(){t(e.getEntries())})});return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},Eo=function(e,t,n,r){var i,o;return function(s){t.value>=0&&(s||r)&&((o=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},Oo=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},Ao=function(e){document.addEventListener("visibilitychange",function(){"hidden"===document.visibilityState&&e()})},Co=function(e){var t=!1;return function(){t||(e(),t=!0)}},xo=-1,Ro=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Lo=function(e){"hidden"===document.visibilityState&&xo>-1&&(xo="visibilitychange"===e.type?e.timeStamp:0,ko())},Po=function(){addEventListener("visibilitychange",Lo,!0),addEventListener("prerenderingchange",Lo,!0)},ko=function(){removeEventListener("visibilitychange",Lo,!0),removeEventListener("prerenderingchange",Lo,!0)},Io=function(){return xo<0&&(xo=Ro(),Po(),yo(function(){setTimeout(function(){xo=Ro(),Po()},0)})),{get firstHiddenTime(){return xo}}},No=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},Do=[1800,3e3],Mo=function(e,t){t=t||{},No(function(){var n,r=Io(),i=So("FCP"),o=To("paint",function(e){e.forEach(function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-wo(),0),i.entries.push(e),n(!0)))})});o&&(n=Eo(e,i,Do,t.reportAllChanges),yo(function(r){i=So("FCP"),n=Eo(e,i,Do,t.reportAllChanges),Oo(function(){i.value=performance.now()-r.timeStamp,n(!0)})}))})},jo=[.1,.25],Uo=0,Bo=1/0,Fo=0,zo=function(e){e.forEach(function(e){e.interactionId&&(Bo=Math.min(Bo,e.
1interactionId),Fo=Math.max(Fo,e.interactionId),Uo=Fo?(Fo-Bo)/7+1:0)})},Ho=function(){return fo?Uo:performance.interactionCount||0},Vo=[],qo=new Map,$o=0,Go=[],Ko=function(e){if(Go.forEach(function(t){return t(e)}),e.interactionId||"first-input"===e.entryType){var t=Vo[Vo.length-1],n=qo.get(e.interactionId);if(n||Vo.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};qo.set(r.id,r),Vo.push(r)}Vo.sort(function(e,t){return t.latency-e.latency}),Vo.length>10&&Vo.splice(10).forEach(function(e){return qo.delete(e.id)})}}},Wo=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=Co(e),"hidden"===document.visibilityState?e():(n=t(e),Ao(e)),n},Xo=[200,500],Qo=[2500,4e3],Yo={},Zo=[800,1800],Jo=function e(t){document.prerendering?No(function(){return e(t)}):"complete"!==document.readyState?addEventListener("load",function(){return e(t)},!0):setTimeout(t,0)},es={passive:!0,capture:!0},ts=new Date,ns=function(e,t){ho||(ho=t,go=e,mo=new Date,os(removeEventListener),rs())},rs=function(){if(go>=0&&go<mo-ts){var e={entryType:"first-input",name:ho.type,target:ho.target,cancelable:ho.cancelable,startTime:ho.timeStamp,processingStart:ho.timeStamp+go};vo.forEach(function(t){t(e)}),vo=[]}},is=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){ns(e,t),i()},r=function(){i()},i=function(){removeEventListener("pointerup",n,es),removeEventListener("pointercancel",r,es)};addEventListener("pointerup",n,es),addEventListener("pointercancel",r,es)}(t,e):ns(t,e)}},os=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach(function(t){return e(t,is,es)})},ss=[100,300];class as{constructor(e,t){this.pushMeasurement=e,this.webVitalConfig=t}initialize(){Object.entries(as.mapping).forEach(([e,t])=>{var n;t(t=>{this.pushMeasurement({type:"web-vitals",values:{[e]:t.value}})},{reportAllChanges:null===(n=this.webVitalConfig)||void 0===n?void 0:n.reportAllChanges})})}}as.mapping={cls:function(e,t){t=t||{},Mo(Co(function(){var n,r=So("CLS",0),i=0,o=[],s=function(e){e.forEach(function(e){if(!e.hadRecentInput){var t=o[0],n=o[o.length-1];i&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,o.push(e)):(i=e.value,o=[e])}}),i>r.value&&(r.value=i,r.entries=o,n())},a=To("layout-shift",s);a&&(n=Eo(e,r,jo,t.reportAllChanges),Ao(function(){s(a.takeRecords()),n(!0)}),yo(function(){i=0,r=So("CLS",0),n=Eo(e,r,jo,t.reportAllChanges),Oo(function(){return n()})}),setTimeout(n,0))}))},fcp:Mo,fid:function(e,t){t=t||{},No(function(){var n,r=Io(),i=So("FID"),o=function(e){e.startTime<r.firstHiddenTime&&(i.value=e.processingStart-e.startTime,i.entries.push(e),n(!0))},s=function(e){e.forEach(o)},a=To("first-input",s);n=Eo(e,i,ss,t.reportAllChanges),a&&(Ao(Co(function(){s(a.takeRecords()),a.disconnect()})),yo(function(){var r;i=So("FID"),n=Eo(e,i,ss,t.reportAllChanges),vo=[],go=-1,ho=null,os(addEventListener),r=o,vo.push(r),rs()}))})},inp:function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},No(function(){var n;"interactionCount"in performance||fo||(fo=To("event",zo,{type:"event",buffered:!0,durationThreshold:0}));var r,i=So("INP"),o=function(e){Wo(function(){e.forEach(Ko);var t=function(){var e=Math.min(Vo.length-1,Math.floor((Ho()-$o)/50));return Vo[e]}();t&&t.latency!==i.value&&(i.value=t.latency,i.entries=t.entries,r())})},s=To("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});r=Eo(e,i,Xo,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),Ao(function(){o(s.takeRecords()),r(!0)}),yo(function(){$o=Ho(),Vo.length=0,qo.clear(),i=So("INP"),r=Eo(e,i,Xo,t.reportAllChanges)}))}))},lcp:function(e,t){t=t||{},No(function(){var n,r=Io(),i=So("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach(function(e){e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-wo(),0),i.entries=[e],n())})},s=To("largest-contentful-paint",o);if(s){n=Eo(e,i,Qo,t.reportAllChanges);var a=Co(function(){Yo[i.id]||(o(s.takeRecords()),s.disconnect(),Yo[i.id]=!0,n(!0))});["keydown","click"].forEach(function(e){addEventListener(e,function(){return Wo(a)},{once:!0,capture:!0})}),Ao(a),yo(function(r){i=So("LCP"),n=Eo(e,i,Qo,t.reportAllChanges),Oo(function(){i.value=performance.now()-r.timeStamp,Yo[i.id]=!0,n(!0)})})}})},ttfb:function(e,t){t=t||{};var n=So("TTFB"),r=Eo(e,n,Zo,t.reportAllChanges);Jo(function(){var i=_o();i&&(n.value=Math.max(i.responseStart-wo(),0),n.entries=[i],r(!0),yo(function(){n=So("TTFB",0),(r=Eo(e,n,Zo,t.reportAllChanges))(!0)}))})}};var us,cs,ls=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},ds=function(e){if("loading"===document.readyState)return"loading";var t=ls();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},ps=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},fs=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var r=e,i=r.id?"#"+r.id:ps(r)+(r.classList&&r.classList.value&&r.classList.value.trim()&&r.classList.value.trim().length?"."+r.classList.value.trim().replace(/\s+/g,"."):"");if(n.length+i.length>(t||100)-1)return n||i;if(n=n?i+">"+n:i,r.id)break;e=r.parentNode}}catch(e){}return n},hs=-1,gs=function(){return hs},ms=function(e){addEventListener("pageshow",function(t){t.persisted&&(hs=t.timeStamp,e(t))},!0)},vs=function(){var e=ls();return e&&e.activationStart||0},bs=function(e,t){var n=ls(),r="navigate";return gs()>=0?r="back-forward-cache":n&&(document.prerendering||vs()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},ys=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver(function(e){Promise.resolve().then(function(){t(e.getEntries())})});return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},_s=function(e,t,n,r){var i,o;return function(s){t.value>=0&&(s||r)&&((o=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},ws=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},Ss=function(e){document.addEventListener("visibilitychange",function(){"hidden"===document.visibilityState&&e()})},Ts=function(e){var t=!1;return function(){t||(e(),t=!0)}},Es=-1,Os=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},As=function(e){"hidden"===document.visibilityState&&Es>-1&&(Es="visibilitychange"===e.type?e.timeStamp:0,xs())},Cs=function(){addEventListener("visibilitychange",As,!0),addEventListener("prerenderingchange",As,!0)},xs=function(){removeEventListener("visibilitychange",As,!0),removeEventListener("prerenderingchange",As,!0)},Rs=function(){return Es<0&&(Es=Os(),Cs(),ms(function(){setTimeout(function(){Es=Os(),Cs()},0)})),{get firstHiddenTime(){return Es}}},Ls=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},Ps=[1800,3e3],ks=function(e,t){t=t||{},Ls(function(){var n,r=Rs(),i=bs("FCP"),o=ys("paint",function(e){e.forEach(function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-vs(),0),i.entries.push(e),n(!0)))})});o&&(n=_s(e,i,Ps,t.reportAllChanges),ms(function(r){i=bs("FCP"),n=_s(e,i,Ps,t.reportAllChanges),ws(function(){i.value=performance.now()-r.timeStamp,n(!0)})}))})},Is=[.1,.25],Ns=0,Ds=1/0,Ms=0,js=function(e){e.forEach(function(e){e.interactionId&&(Ds=Math.min(Ds,e.interactionId),Ms=Math.max(Ms,e.interactionId),Ns=Ms?(Ms-Ds)/7+1:0)})},Us=function(){return us?Ns:performance.interactionCount||0},Bs=function(){"interactionCount"in performance||us||(us=ys("event",js,{type:"event",buffered:!0,durationThreshold:0}))},Fs=[],zs=new Map,Hs=0,Vs=[],qs=function(e){if(Vs.forEach(function(t){return t(e)}),e.interactionId||"first-input"===e.entryType){var t=Fs[Fs.length-1],n=zs.get(e.interactionId);if(n||Fs.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};zs.set(r.id,r),Fs.push(r)}Fs.sort(function(e,t){return t.latency-e.latency}),Fs.length>
110&&Fs.splice(10).forEach(function(e){return zs.delete(e.id)})}}},$s=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=Ts(e),"hidden"===document.visibilityState?e():(n=t(e),Ss(e)),n},Gs=[200,500],Ks=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},Ls(function(){var n;Bs();var r,i=bs("INP"),o=function(e){$s(function(){e.forEach(qs);var t=function(){var e=Math.min(Fs.length-1,Math.floor((Us()-Hs)/50));return Fs[e]}();t&&t.latency!==i.value&&(i.value=t.latency,i.entries=t.entries,r())})},s=ys("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});r=_s(e,i,Gs,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),Ss(function(){o(s.takeRecords()),r(!0)}),ms(function(){Hs=Us(),Fs.length=0,zs.clear(),i=bs("INP"),r=_s(e,i,Gs,t.reportAllChanges)}))}))},Ws=[],Xs=[],Qs=0,Ys=new WeakMap,Zs=new Map,Js=-1,ea=function(e){Ws=Ws.concat(e),ta()},ta=function(){Js<0&&(Js=$s(na))},na=function(){Zs.size>10&&Zs.forEach(function(e,t){zs.has(t)||Zs.delete(t)});var e=Fs.map(function(e){return Ys.get(e.entries[0])}),t=Xs.length-50;Xs=Xs.filter(function(n,r){return r>=t||e.includes(n)});for(var n=new Set,r=0;r<Xs.length;r++){var i=Xs[r];aa(i.startTime,i.processingEnd).forEach(function(e){n.add(e)})}var o=Ws.length-1-50;Ws=Ws.filter(function(e,t){return e.startTime>Qs&&t>o||n.has(e)}),Js=-1};Vs.push(function(e){e.interactionId&&e.target&&!Zs.has(e.interactionId)&&Zs.set(e.interactionId,e.target)},function(e){var t,n=e.startTime+e.duration;Qs=Math.max(Qs,e.processingEnd);for(var r=Xs.length-1;r>=0;r--){var i=Xs[r];if(Math.abs(n-i.renderTime)<=8){(t=i).startTime=Math.min(e.startTime,t.startTime),t.processingStart=Math.min(e.processingStart,t.processingStart),t.processingEnd=Math.max(e.processingEnd,t.processingEnd),t.entries.push(e);break}}t||(t={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:n,entries:[e]},Xs.push(t)),(e.interactionId||"first-input"===e.entryType)&&Ys.set(e,t),ta()});var ra,ia,oa,sa,aa=function(e,t){for(var n,r=[],i=0;n=Ws[i];i++)if(!(n.startTime+n.duration<e)){if(n.startTime>t)break;r.push(n)}return r},ua=[2500,4e3],ca={},la=[800,1800],da=function e(t){document.prerendering?Ls(function(){return e(t)}):"complete"!==document.readyState?addEventListener("load",function(){return e(t)},!0):setTimeout(t,0)},pa=function(e,t){t=t||{};var n=bs("TTFB"),r=_s(e,n,la,t.reportAllChanges);da(function(){var i=ls();i&&(n.value=Math.max(i.responseStart-vs(),0),n.entries=[i],r(!0),ms(function(){n=bs("TTFB",0),(r=_s(e,n,la,t.reportAllChanges))(!0)}))})},fa={passive:!0,capture:!0},ha=new Date,ga=function(e,t){ra||(ra=t,ia=e,oa=new Date,ba(removeEventListener),ma())},ma=function(){if(ia>=0&&ia<oa-ha){var e={entryType:"first-input",name:ra.type,target:ra.target,cancelable:ra.cancelable,startTime:ra.timeStamp,processingStart:ra.timeStamp+ia};sa.forEach(function(t){t(e)}),sa=[]}},va=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){ga(e,t),i()},r=function(){i()},i=function(){removeEventListener("pointerup",n,fa),removeEventListener("pointercancel",r,fa)};addEventListener("pointerup",n,fa),addEventListener("pointercancel",r,fa)}(t,e):ga(t,e)}},ba=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach(function(t){return e(t,va,fa)})},ya=[100,300],_a=function(e,t){!function(e,t){t=t||{},Ls(function(){var n,r=Rs(),i=bs("FID"),o=function(e){e.startTime<r.firstHiddenTime&&(i.value=e.processingStart-e.startTime,i.entries.push(e),n(!0))},s=function(e){e.forEach(o)},a=ys("first-input",s);n=_s(e,i,ya,t.reportAllChanges),a&&(Ss(Ts(function(){s(a.takeRecords()),a.disconnect()})),ms(function(){var r;i=bs("FID"),n=_s(e,i,ya,t.reportAllChanges),sa=[],ia=-1,ra=null,ba(addEventListener),r=o,sa.push(r),ma()}))})}(function(t){var n=function(e){var t=e.entries[0],n={eventTarget:fs(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:ds(t.startTime)};return Object.assign(e,{attribution:n})}(t);e(n)},t)};const wa="com.grafana.faro.lastNavigationId",Sa="load_state",Ta="time_to_first_byte";class Ea{constructor(e,t){this.corePushMeasurement=e,this.webVitalConfig=t}initialize(){this.measureCLS(),this.measureFCP(),this.measureFID(),this.measureINP(),this.measureLCP(),this.measureTTFB()}measureCLS(){var e;!function(e,t){!function(e,t){t=t||{},ks(Ts(function(){var n,r=bs("CLS",0),i=0,o=[],s=function(e){e.forEach(function(e){if(!e.hadRecentInput){var t=o[0],n=o[o.length-1];i&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,o.push(e)):(i=e.value,o=[e])}}),i>r.value&&(r.value=i,r.entries=o,n())},a=ys("layout-shift",s);a&&(n=_s(e,r,Is,t.reportAllChanges),Ss(function(){s(a.takeRecords()),n(!0)}),ms(function(){i=0,r=bs("CLS",0),n=_s(e,r,Is,t.reportAllChanges),ws(function(){return n()})}),setTimeout(n,0))}
1))}(function(t){var n=function(e){var t,n={};if(e.entries.length){var r=e.entries.reduce(function(e,t){return e&&e.value>t.value?e:t});if(r&&r.sources&&r.sources.length){var i=(t=r.sources).find(function(e){return e.node&&1===e.node.nodeType})||t[0];i&&(n={largestShiftTarget:fs(i.node),largestShiftTime:r.startTime,largestShiftValue:r.value,largestShiftSource:i,largestShiftEntry:r,loadState:ds(r.startTime)})}}return Object.assign(e,{attribution:n})}(t);e(n)},t)}(e=>{const{loadState:t,largestShiftValue:n,largestShiftTime:r,largestShiftTarget:i}=e.attribution,o=this.buildInitialValues(e);this.addIfPresent(o,"largest_shift_value",n),this.addIfPresent(o,"largest_shift_time",r);const s=this.buildInitialContext(e);this.addIfPresent(s,Sa,t),this.addIfPresent(s,"largest_shift_target",i),this.pushMeasurement(o,s)},{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}measureFCP(){var e;!function(e,t){ks(function(t){var n=function(e){var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:ds(gs())};if(e.entries.length){var n=ls(),r=e.entries[e.entries.length-1];if(n){var i=n.activationStart||0,o=Math.max(0,n.responseStart-i);t={timeToFirstByte:o,firstByteToFCP:e.value-o,loadState:ds(e.entries[0].startTime),navigationEntry:n,fcpEntry:r}}}return Object.assign(e,{attribution:t})}(t);e(n)},t)}(e=>{const{firstByteToFCP:t,timeToFirstByte:n,loadState:r}=e.attribution,i=this.buildInitialValues(e);this.addIfPresent(i,"first_byte_to_fcp",t),this.addIfPresent(i,Ta,n);const o=this.buildInitialContext(e);this.addIfPresent(o,Sa,r),this.pushMeasurement(i,o)},{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}measureFID(){var e;_a(e=>{const{eventTime:t,eventTarget:n,eventType:r,loadState:i}=e.attribution,o=this.buildInitialValues(e);this.addIfPresent(o,"event_time",t);const s=this.buildInitialContext(e);this.addIfPresent(s,"event_target",n),this.addIfPresent(s,"event_type",r),this.addIfPresent(s,Sa,i),this.pushMeasurement(o,s)},{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}measureINP(){var e;!function(e,t){cs||(cs=ys("long-animation-frame",ea)),Ks(function(t){var n=function(e){var t=e.entries[0],n=Ys.get(t),r=t.processingStart,i=n.processingEnd,o=n.entries.sort(function(e,t){return e.processingStart-t.processingStart}),s=aa(t.startTime,i),a=e.entries.find(function(e){return e.target}),u=a&&a.target||Zs.get(t.interactionId),c=[t.startTime+t.duration,i].concat(s.map(function(e){return e.startTime+e.duration})),l=Math.max.apply(Math,c),d={interactionTarget:fs(u),interactionTargetElement:u,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:l,processedEventEntries:o,longAnimationFrameEntries:s,inputDelay:r-t.startTime,processingDuration:i-r,presentationDelay:Math.max(l-i,0),loadState:ds(t.startTime)};return Object.assign(e,{attribution:d})}(t);e(n)},t)}(e=>{const{interactionTime:t,presentationDelay:n,inputDelay:r,processingDuration:i,nextPaintTime:o,loadState:s,interactionTarget:a,interactionType:u}=e.attribution,c=this.buildInitialValues(e);this.addIfPresent(c,"interaction_time",t),this.addIfPresent(c,"presentation_delay",n),this.addIfPresent(c,"input_delay",r),this.addIfPresent(c,"processing_duration",i),this.addIfPresent(c,"next_paint_time",o);const l=this.buildInitialContext(e);this.addIfPresent(l,Sa,s),this.addIfPresent(l,"interaction_target",a),this.addIfPresent(l,"interaction_type",u),this.pushMeasurement(c,l)},{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}measureLCP(){var e;!function(e,t){!function(e,t){t=t||{},Ls(function(){var n,r=Rs(),i=bs("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach(function(e){e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-vs(),0),i.entries=[e],n())})},s=ys("largest-contentful-paint",o);if(s){n=_s(e,i,ua,t.reportAllChanges);var a=Ts(function(){ca[i.id]||(o(s.takeRecords()),s.disconnect(),ca[i.id]=!0,n(!0))});["keydown","click"].forEach(function(e){addEventListener(e,function(){return $s(a)},{once:!0,capture:!0})}),Ss(a),ms(function(r){i=bs("LCP"),n=_s(e,i,ua,t.reportAllChanges),ws(function(){i.value=performance.now()-r.timeStamp,ca[i.id]=!0,n(!0)})})}})}(function(t){var n=function(e){var t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){var n=ls();if(n){var r=n.activationStart||0,i=e.entries[e.entries.length-1],o=i.url&&performance.getEntriesByType("resource").filter(function(e){return e.name===i.url})[0],s=Math.max(0,n.responseStart-r),a=Math.max(s,o?(o.requestStart||o.startTime)-r:0),u=Math.max(a,o?o.responseEnd-r:0),c=Math.max(u,i.startTime-r);t={element:fs(i.element),timeToFirstByte:s,resourceLoadDelay:a-s,resourceLoadDuration:u-a,elementRenderDelay:c-u,navigationEntry:n,lcpEntry:i},i.url&&(t.url=i.url),o&&(t.lcpResourceEntry=o)}}return Object.assign(e,{attribution:t})}(t);e(n)},t)}(e=>{const{elementRenderDelay:t,resourceLoadDelay:n,resourceLoadDuration:r,timeToFirstByte:i,element:o}=e.attribution,s=this.buildInitialValues(e);this.addIfPresent(s,"element_render_delay",t),this.addIfPresent(s,"resource_load_delay",n),this.addIfPresent(s,"resource_load_duration",r),this.addIfPresent(s,Ta,i);const a=this.buildInitialContext(e);this.addIfPresent(a,"element",o),this.pushMeasurement(s,a)},{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}measureTTFB(){var e;!function(e,t){pa(function(t){var n=function(e){var t={waitingDuration:0,
1cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(e.entries.length){var n=e.entries[0],r=n.activationStart||0,i=Math.max((n.workerStart||n.fetchStart)-r,0),o=Math.max(n.domainLookupStart-r,0),s=Math.max(n.connectStart-r,0),a=Math.max(n.connectEnd-r,0);t={waitingDuration:i,cacheDuration:o-i,dnsDuration:s-o,connectionDuration:a-s,requestDuration:e.value-a,navigationEntry:n}}return Object.assign(e,{attribution:t})}(t);e(n)},t)}(e=>{const{dnsDuration:t,connectionDuration:n,requestDuration:r,waitingDuration:i,cacheDuration:o}=e.attribution,s=this.buildInitialValues(e);this.addIfPresent(s,"dns_duration",t),this.addIfPresent(s,"connection_duration",n),this.addIfPresent(s,"request_duration",r),this.addIfPresent(s,"waiting_duration",i),this.addIfPresent(s,"cache_duration",o);const a=this.buildInitialContext(e);this.pushMeasurement(s,a)},{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}buildInitialValues(e){const t=e.name.toLowerCase();return{[t]:e.value,delta:e.delta}}buildInitialContext(e){var t;const n=null!==(t=Ei(wa,wi))&&void 0!==t?t:mi;return{id:e.id,rating:e.rating,navigation_type:e.navigationType,navigation_entry_id:n}}pushMeasurement(e,t){this.corePushMeasurement({type:"web-vitals",values:e},{context:t})}addIfPresent(e,t,n){n&&(e[t]=n)}}class Oa extends oi{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-web-vitals",this.version=si}initialize(){this.logDebug("Initializing");this.intializeWebVitalsInstrumentation().initialize()}intializeWebVitalsInstrumentation(){var e,t,n;return!1===(null===(e=this.config)||void 0===e?void 0:e.trackWebVitalsAttribution)||!1===(null===(n=null===(t=this.config)||void 0===t?void 0:t.webVitalsInstrumentation)||void 0===n?void 0:n.trackAttribution)?new as(this.api.pushMeasurement,this.config.webVitalsInstrumentation):new Ea(this.api.pushMeasurement,this.config.webVitalsInstrumentation)}}const Aa="resource",Ca=/^00-[a-f0-9]{32}-[a-f0-9]{16}-[0-9]{1,2}$/;function xa(e=[]){for(const t of e)if("traceparent"===t.name){if(!Ca.test(t.description))continue;const[,e,n]=t.description.split("-");if(null!=e&&null!=n)return{traceId:e,spanId:n};break}}function Ra(e,t={}){for(const[n,r]of Object.entries(t)){const t=e[n];return null!=t&&(lr(r)?r.includes(t):t===r)}return!0}function La(e){const{connectEnd:t,connectStart:n,decodedBodySize:r,domainLookupEnd:i,domainLookupStart:o,duration:s,encodedBodySize:a,fetchStart:u,initiatorType:c,name:l,nextHopProtocol:d,redirectEnd:p,redirectStart:f,renderBlockingStatus:h,requestStart:g,responseEnd:m,responseStart:v,responseStatus:b,secureConnectionStart:y,transferSize:_,workerStart:w}=e;return{name:l,duration:ka(s),tcpHandshakeTime:ka(t-n),dnsLookupTime:ka(i-o),tlsNegotiationTime:ka(t-y),responseStatus:ka(b),redirectTime:ka(p-f),requestTime:ka(v-g),responseTime:ka(m-v),fetchTime:ka(m-u),serviceWorkerTime:ka(u-w),decodedBodySize:ka(r),encodedBodySize:ka(a),cacheHitStatus:function(){let e="fullLoad";0===_?r>0&&(e="cache"):null!=b?304===b&&(e="conditionalFetch"):a>0&&_<a&&(e="conditionalFetch");return e}(),renderBlockingStatus:ka(h),protocol:d,initiatorType:c,visibilityState:document.visibilityState,ttfb:ka(v-g),transferSize:ka(_)}}function Pa(e){const{activationStart:t,domComplete:n,domContentLoadedEventEnd:r,domContentLoadedEventStart:i,domInteractive:o,fetchStart:s,loadEventEnd:a,loadEventStart:u,responseStart:c,type:l}=e,d=function(){var e;if(null!=(null===(e=performance.timing)||void 0===e?void 0:e.domLoading))return performance.timing.domLoading-performance.timeOrigin;return null}();return Object.assign(Object.assign({},La(e)),{pageLoadTime:ka(n-s),documentParsingTime:ka(d?o-d:null),domProcessingTime:ka(n-o),domContentLoadHandlerTime:ka(r-i),onLoadTime:ka(a-u),ttfb:ka(Math.max(c-(null!=t?t:0),0)),type:l})}function ka(e){return null==e?mi:"number"==typeof e?Math.round(e>0?e:0).toString():e.toString()}const Ia={initiatorType:["xmlhttprequest","fetch"]};var Na=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}u((r=r.apply(e,t||[])).next())})};const Da=new xr;class Ma extends oi{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-performance",this.version=si}initialize(){"PerformanceObserver"in window?function(e){if("complete"===document.readyState)e();else{const t=()=>{"complete"===document.readyState&&(e(),document.removeEventListener("readystatechange",t))};document.addEventListener("readystatechange",t)}}(()=>Na(this,void 0,void 0,function*(){const e=this.api.pushEvent,{faroNavigationId:t}=yield function(e){let t;const n=new Promise(e=>{t=e});return new PerformanceObserver(n=>{var r;const[i]=n.getEntries();if(null==i||Pi(i.name))return;const o=i.toJSON();let s=xa(null==o?void 0:o.serverTiming);const a=null!==(r=Ei(wa,wi))&&void 0!==r?r:mi,u=Object.assign(Object.assign({},Pa(o)),{faroNavigationId:Er(),faroPreviousNavigationId:a});Oi(wa,u.faroNavigationId,wi),e("faro.performance.navigation",u,void 0,{spanContext:s,timestampOverwriteMs:performance.timeOrigin+o.startTime}),t(u)}
1).observe({type:"navigation",buffered:!0}),n}(e);null!=t&&function(e,t,n){const r=ui.config.trackResources;new PerformanceObserver(i=>{const o=i.getEntries();for(const i of o){if(Pi(i.name))return;const o=i.toJSON();let s=xa(null==o?void 0:o.serverTiming);if(null==r&&Ra(o,Ia)||r){const r=Object.assign(Object.assign({},La(o)),{faroNavigationId:e,faroResourceId:Er()});ui.config.trackUserActionsPreview&&(null==n||n.notify({type:Aa})),t("faro.performance.resource",r,void 0,{spanContext:s,timestampOverwriteMs:performance.timeOrigin+o.startTime})}}}).observe({type:Aa,buffered:!0})}(t,e,Da)})):this.logDebug("performance observer not supported. Disable performance instrumentation.")}}const ja="http-request-start",Ua="http-request-end",Ba="data-faro-user-action-name",Fa="faroApiCall";const za="fetch",Ha="xhr";function Va(){const e=new xr;function t(t){e.notify({type:ja,request:t})}function n(t){e.notify({type:Ua,request:t})}return function({onRequestEnd:e,onRequestStart:t}){const n=window.fetch;window.fetch=function(){var r,i;const o=null!==(r=ki(arguments[0]))&&void 0!==r?r:"",s=Pi(o),a=(null!==(i=arguments[1])&&void 0!==i?i:{}).method,u=Er();return s||t({url:o,method:a,requestId:u,apiType:za}),n.apply(this,arguments).then(t=>(s||e({url:o,method:a,requestId:u,apiType:za}),t)).catch(t=>{throw s||e({url:o,method:a,requestId:u,apiType:za}),t})}}({onRequestStart:t,onRequestEnd:n}),function({onRequestStart:e,onRequestEnd:t}){const n=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(){const r=arguments[1],i=Pi(r),o=arguments[0],s=Er();this.addEventListener("loadstart",function(){i||e({url:r,method:o,requestId:s,apiType:Ha})}),this.addEventListener("load",function(){i||t({url:r,method:o,requestId:s,apiType:Ha})}),this.addEventListener("error",function(){i||t({url:r,method:o,requestId:s,apiType:Ha})}),this.addEventListener("abort",function(){i||t({url:r,method:o,requestId:s,apiType:Ha})}),n.apply(this,arguments)}}({onRequestStart:t,onRequestEnd:n}),e}function qa(e){const{api:t,config:n}=e,r=Va(),i=function(){const e=new xr;return new MutationObserver((t,n)=>{e.notify({type:"dom-mutation"})}).observe(document,{attributes:!0,childList:!0,subtree:!0,characterData:!0}),e}(),o=function(){const e=new xr;return Da.subscribe(t=>{t.type===Aa&&e.notify({type:"resource-entry"})}),e}();let s,a=!1;return function(e){var u;let c;const l=(d=e).type===Fa&&"string"==typeof d.name;var d;if(c=l?e.name:function(e,t){const n=function(e){const t=e.split("data-")[1],n=null==t?void 0:t.replace(/-(.)/g,(e,t)=>t.toUpperCase());return null==n?void 0:n.replace(/-/g,"")}(t),r=e.dataset;for(const e in r)if(e===n)return r[e];return}(e.target,null!==(u=n.trackUserActionsDataAttributeName)&&void 0!==u?u:"faroUserActionName"),a||null==c)return;a=!0;const p=mr();let f;const h=Er();ri.notify({type:Gr,name:c,startTime:p,parentId:h}),s=Ga(s,()=>{f=mr(),a=!1,function(e,t){ri.notify({type:Wr,name:e,parentId:t})}(c,h)},100);const g=new Map;let m,v=!1;const b=(new xr).merge(r,i,o).takeWhile(()=>a).filter(e=>!!(!v||Wa(e)&&g.has(e.request.requestId))).subscribe(n=>{(function(e){return e.type===ja})(n)&&g.set(n.request.requestId,n.request),Wa(n)&&g.delete(n.request.requestId),s=Ga(s,()=>{f=mr();const n=Object.assign({api:t,userActionName:c,startTime:p,endTime:f,actionId:h,event:e},l?{attributes:e.attributes}:{}),r=g.size>0;v&&!r&&(clearTimeout(m),v=!1),r?(v=!0,ri.notify({type:Xr,name:c,parentId:h,reason:"pending-requests",haltTime:mr()}),m=Ga(void 0,()=>{Ka(b),$a(n),a=!1,v=!1},1e4)):(Ka(b),$a(n),a=!1,v=!1)},100)})}}function $a(e){const{api:t,userActionName:n,startTime:r,endTime:i,actionId:o,event:s,attributes:a}=e,u=i-r,c=s.type;ri.notify({type:Kr,name:n,id:o,startTime:r,endTime:i,duration:u,eventType:c}),t.pushEvent(n,Object.assign({userActionStartTime:r.toString(),userActionEndTime:i.toString(),userActionDuration:u.toString(),userActionTrigger:c},Cr(a)),void 0,{timestampOverwriteMs:r,customPayloadTransformer:e=>(e.action={id:o,name:n},e)})}function Ga(e,t,n){return e&&clearTimeout(e),e=setTimeout(()=>{t()},n)}function Ka(e){null==e||e.unsubscribe(),e=void 0}function Wa(e){return e.type===Ua}let Xa;class Qa extends oi{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-user-action",this.version=si}initialize(){Xa=qa(ui),window.addEventListener("pointerdown",Xa),window.addEventListener("keydown",Xa)}}class Ya extends oi{constructor(){super(),this.name="@grafana/faro-web-sdk:instrumentation-csp",this.version=si}initialize(){document.addEventListener("securitypolicyviolation",this.securitypolicyviolationHandler.bind(this))}destroy(){document.removeEventListener("securitypolicyviolation",this.securitypolicyviolationHandler)}securitypolicyviolationHandler(e){this.api.pushEvent("securitypolicyviolation",Cr(e))}}function Za(e={}){const t=[new Qa,new lo,new Oa,new $i,new po];return!1!==e.enablePerformanceInstrumentation&&t.unshift(new Ma),!1!==e.enableContentSecurityPolicyInstrumentation&&t.push(new Ya),!1!==e.captureConsole&&t.push(new uo({disabledLevels:e.captureConsoleDisabledLevels})),t}const Ja="browser",eu=()=>{const e=window.k6;return{k6:Object.assign({isK6Browser:!0},(null==e?void 0:e.testRunId)&&{testRunId:null==e?void 0:e.testRunId})}};let tu,nu;function ru({generatePageId:e,initialPageMeta:t}={}){return()=>{const n=location.href;return cr(e)&&tu!==n&&(tu=n,nu=e(location)),{page:Object.assign(Object.assign({url:n},nu?{id:nu}:{}),t)}}}
1var iu=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}u((r=r.apply(e,t||[])).next())})},ou=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class su extends qr{constructor(e){var t,n,r,i;super(),this.options=e,this.name="@grafana/faro-web-sdk:transport-fetch",this.version=si,this.disabledUntil=new Date,this.rateLimitBackoffMs=null!==(t=e.defaultRateLimitBackoffMs)&&void 0!==t?t:5e3,this.getNow=null!==(n=e.getNow)&&void 0!==n?n:()=>Date.now(),this.promiseBuffer=function(e){const{size:t,concurrency:n}=e,r=[];let i=0;const o=()=>{if(i<n&&r.length){const{producer:e,resolve:t,reject:n}=r.shift();i++,e().then(e=>{i--,o(),t(e)},e=>{i--,o(),n(e)})}};return{add:e=>{if(r.length+i>=t)throw new Error("Task buffer full");return new Promise((t,n)=>{r.push({producer:e,resolve:t,reject:n}),o()})}}}({size:null!==(r=e.bufferSize)&&void 0!==r?r:30,concurrency:null!==(i=e.concurrency)&&void 0!==i?i:5})}send(e){return iu(this,void 0,void 0,function*(){try{if(this.disabledUntil>new Date(this.getNow()))return this.logWarn(`Dropping transport item due to too many requests. Backoff until ${this.disabledUntil}`),Promise.resolve();yield this.promiseBuffer.add(()=>{const t=JSON.stringify(function(e){let t={meta:{}};return void 0!==e[0]&&(t.meta=e[0].meta),e.forEach(e=>{switch(e.type){case Lr.LOG:case Lr.EVENT:case Lr.EXCEPTION:case Lr.MEASUREMENT:const n=Pr[e.type],r=t[n];t=Object.assign(Object.assign({},t),{[n]:void 0===r?[e.payload]:[...r,e.payload]});break;case Lr.TRACE:t=Object.assign(Object.assign({},t),{traces:$r(t.traces,e.payload.resourceSpans)})}}),t}(e)),{url:n,requestOptions:r,apiKey:i}=this.options,o=null!=r?r:{},{headers:s}=o,a=ou(o,["headers"]);let u;const c=this.metas.value.session;return null!=c&&(u=c.id),fetch(n,Object.assign({method:"POST",headers:Object.assign(Object.assign(Object.assign({"Content-Type":"application/json"},null!=s?s:{}),i?{"x-api-key":i}:{}),u?{"x-faro-session-id":u}:{}),body:t,keepalive:t.length<=6e4},null!=a?a:{})).then(e=>iu(this,void 0,void 0,function*(){if(202===e.status){"invalid"===e.headers.get("X-Faro-Session-Status")&&this.extendFaroSession(this.config,this.logDebug)}return 429===e.status&&(this.disabledUntil=this.getRetryAfterDate(e),this.logWarn(`Too many requests, backing off until ${this.disabledUntil}`)),e.text().catch(Sr),e})).catch(e=>{this.logError("Failed sending payload to the receiver\n",JSON.parse(t),e)})})}catch(e){this.logError(e)}})}getIgnoreUrls(){var e;return[this.options.url].concat(null!==(e=this.config.ignoreUrls)&&void 0!==e?e:[])}isBatched(){return!0}getRetryAfterDate(e){const t=this.getNow(),n=e.headers.get("Retry-After");if(n){const e=Number(n);if(!isNaN(e))return new Date(1e3*e+t);const r=Date.parse(n);if(!isNaN(r))return new Date(r)}return new Date(t+this.rateLimitBackoffMs)}extendFaroSession(e,t){const n="Session expired",r=e.sessionTracking;if(null==r?void 0:r.enabled){const{fetchUserSession:e,storeUserSession:i}=qi(r);Bi({fetchUserSession:e,storeUserSession:i})({forceSessionExtend:!0}),t(`${n} created new session.`)}else t(`${n}.`)}}var au=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function uu(e,{trackUserActionsPreview:t}){return e.filter(e=>!("@grafana/faro-web-sdk:instrumentation-user-action"===e.name&&!t))}function cu(e){var t,n;const{page:r,generatePageId:i}=null!==(t=null==e?void 0:e.pageTracking)&&void 0!==t?t:{},o=[yi,ru({generatePageId:i,initialPageMeta:r}),...null!==(n=e.metas)&&void 0!==n?n:[]];return ur(window.k6)?[...o,eu]:o}function lu({trackGeolocation:e,sessionTracking:t}){var n;const r={};return rr(e,"boolean")&&(r.geoLocationTrackingEnabled=e),hr(r)?{}:{session:Object.assign(Object.assign({},null!==(n=null==t?void 0:t.session)&&void 0!==n?n:{}),{overrides:r})}}function du(e){const t=function(e){var t;const n=[],r=Fr(e.unpatchedConsole,e.internalLoggerLevel);e.transports?((e.url||e.apiKey)&&r.error('if "transports" is defined, "url" and "apiKey" should not be defined'),n.push(...e.transports)):e.url?n.push(new su({url:e.url,apiKey:e.apiKey})):r.error('either "url" or "transports" must be defined');const{dedupe:i=!0,eventDomain:o=Ja,globalObjectKey:s=di,instrumentations:a=Za(),internalLoggerLevel:u=Mr,isolate:c=!1,logArgsSerializer:l=ei,metas:d=cu(e),paused:p=!1,preventGlobalExposure:f=!1,unpatchedConsole:h=jr,trackUserActionsPreview:g=!1,trackUserActionsDataAttributeName:m=Ba,url:v}=e,b=au(e,["dedupe","eventDomain","globalObjectKey","instrumentations","internalLoggerLevel","isolate","logArg
1sSerializer","metas","paused","preventGlobalExposure","unpatchedConsole","trackUserActionsPreview","trackUserActionsDataAttributeName","url"]);return Object.assign(Object.assign({},b),{batching:Object.assign(Object.assign({},pi),e.batching),dedupe:i,globalObjectKey:s,instrumentations:uu(a,e),internalLoggerLevel:u,isolate:c,logArgsSerializer:l,metas:d,parseStacktrace:io,paused:p,preventGlobalExposure:f,transports:n,unpatchedConsole:h,eventDomain:o,ignoreUrls:[...null!==(t=e.ignoreUrls)&&void 0!==t?t:[],...v?[v]:[],/\/collect(?:\/[\w]*)?$/],sessionTracking:Object.assign(Object.assign(Object.assign({},Di),e.sessionTracking),lu({trackGeolocation:e.trackGeolocation,sessionTracking:e.sessionTracking})),trackUserActionsPreview:g,trackUserActionsDataAttributeName:m})}(e);if(t)return li(t)}class pu{constructor(e){this.config=e}export(e,t){const n=Xn(e,{useHex:!0,useLongBits:!1});this.config.api.pushTraces(n),function(e=[]){var t,n;for(const r of e){const{scopeSpans:e}=r;for(const r of e){const{scope:e,spans:i=[]}=r;for(const r of i){if(r.kind!==nr.ESpanKind.SPAN_KIND_CLIENT)continue;const i={traceId:r.traceId.toString(),spanId:r.spanId.toString()},o={};for(const e of r.attributes)o[e.key]=String(Object.values(e.value)[0]);Number.isNaN(r.endTimeUnixNano)||Number.isNaN(r.startTimeUnixNano)||(o.duration_ns=String(Number(r.endTimeUnixNano)-Number(r.startTimeUnixNano)));const s=(null!==(t=null==e?void 0:e.name)&&void 0!==t?t:"").indexOf("-");let a=mi;(null==e?void 0:e.name)&&(-1===s&&(a=null!==(n=e.name.split("/")[1])&&void 0!==n?n:e.name),s>-1&&(a=null==e?void 0:e.name.substring(s+1))),ui.api.pushEvent(`faro.tracing.${a}`,o,void 0,{spanContext:i,timestampOverwriteMs:Number(r.endTimeUnixNano)/1e6,customPayloadTransformer:e=>{var t,n;return null!=o["faro.action.user.name"]&&null!=o["faro.action.user.parentId"]&&(e.action={name:o["faro.action.user.name"],parentId:o["faro.action.user.parentId"]},null===(t=e.attributes)||void 0===t||delete t["faro.action.user.name"],null===(n=e.attributes)||void 0===n||delete n["faro.action.user.parentId"]),e}})}}}}(n.resourceSpans),t({code:zt.SUCCESS})}shutdown(){return Promise.resolve(void 0)}}class fu{emit(e){}}const hu=new fu;const gu=new class{getLogger(e,t,n){return new fu}};class mu{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;const e=this._provider.getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):hu}}class vu{getLogger(e,t,n){var r;return null!==(r=this.getDelegateLogger(e,t,n))&&void 0!==r?r:new mu(this,e,t,n)}getDelegate(){var e;return null!==(e=this._delegate)&&void 0!==e?e:gu}setDelegate(e){this._delegate=e}getDelegateLogger(e,t,n){var r;return null===(r=this._delegate)||void 0===r?void 0:r.getLogger(e,t,n)}}const bu="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},yu=Symbol.for("io.opentelemetry.js.api.logs"),_u=bu;class wu{constructor(){this._proxyLoggerProvider=new vu}static getInstance(){return this._instance||(this._instance=new wu),this._instance}setGlobalLoggerProvider(e){return _u[yu]?this.getLoggerProvider():(_u[yu]=(t=1,n=e,r=gu,e=>e===t?n:r),this._proxyLoggerProvider.setDelegate(e),e);var t,n,r}getLoggerProvider(){var e,t;return null!==(t=null===(e=_u[yu])||void 0===e?void 0:e.call(_u,1))&&void 0!==t?t:this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete _u[yu],this._proxyLoggerProvider=new vu}}const Su=wu.getInstance();let Tu=console.error.bind(console);function Eu(e,t,n){const r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}const Ou=(e,t,n)=>{if(!e||!e[t])return void Tu("no original function "+String(t)+" to wrap");if(!n)return Tu("no wrapper function"),void Tu((new Error).stack);const r=e[t];if("function"!=typeof r||"function"!=typeof n)return void Tu("original object and wrapper must be functions");const i=n(r,t);return Eu(i,"__original",r),Eu(i,"__unwrap",()=>{e[t]===i&&Eu(e,t,r)}),Eu(i,"__wrapped",!0),Eu(e,t,i),i}
1,Au=(e,t,n)=>{if(!e)return Tu("must provide one or more modules to patch"),void Tu((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{Ou(e,t,n)})}):Tu("must provide one or more functions to wrap on modules")},Cu=(e,t)=>{if(!e||!e[t])return Tu("no function to unwrap."),void Tu((new Error).stack);const n=e[t];n.__unwrap?n.__unwrap():Tu("no original to unwrap to -- has "+String(t)+" already been unwrapped?")},xu=(e,t)=>{if(!e)return Tu("must provide one or more modules to patch"),void Tu((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{Cu(e,t)})}):Tu("must provide one or more functions to unwrap on modules")};class Ru{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,t,n){this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(n),this._diag=Pe.createComponentLogger({namespace:e}),this._tracer=Ge.getTracer(e,t),this._meter=Ne.getMeter(e,t),this._logger=Su.getLogger(e,t),this._updateMetricInstruments()}_wrap=Ou;_unwrap=Cu;_massWrap=Au;_massUnwrap=xu;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){const e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:t},e)}}}class Lu extends Ru{constructor(e,t,n){super(e,t,n),this._config.enabled&&this.enable()}}function Pu(e,t,n){let r,i;try{i=e()}catch(e){r=e}finally{return t(r,i),i}}function ku(e){return"function"==typeof e&&"function"==typeof e.__original&&"function"==typeof e.__unwrap&&!0===e.__wrapped}var Iu;function Nu(e,t){let n=Iu.OLD;const r=t?.split(",").map(e=>e.trim()).filter(e=>""!==e);for(const t of r??[]){if(t.toLowerCase()===e+"/dup"){n=Iu.DUPLICATE;break}t.toLowerCase()===e&&(n=Iu.STABLE)}return n}!function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"}(Iu||(Iu={}));const Du=e=>null!==e&&"object"==typeof e&&"function"==typeof e.then;class Mu{_rawAttributes;_asyncAttributesPending=!1;_memoizedAttributes;static FromAttributeList(e){const t=new Mu({});return t._rawAttributes=Bu(e),t._asyncAttributesPending=e.filter(([e,t])=>Du(t)).length>0,t}constructor(e){const t=e.attributes??{};this._rawAttributes=Object.entries(t).map(([e,t])=>(Du(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=Bu(this._rawAttributes)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){const[t,n]=this._rawAttributes[e];this._rawAttributes[e]=[t,Du(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&Pe.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const e={};for(const[t,n]of this._rawAttributes)Du(n)?Pe.debug(`Unsettled resource attribute ${t} skipped`):null!=n&&(e[t]??=n);return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}merge(e){return null==e?this:Mu.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()])}}function ju(e){return Mu.FromAttributeList(Object.entries(e))}function Uu(){return ju({[ot]:"unknown_service",[st]:xt[st],[at]:xt[at],[ut]:xt[ut]})}function Bu(e){return e.map(([e,t])=>Du(t)?[e,t.catch(t=>{Pe.debug("promise rejection for resource attribute: %s - %s",e,t)})]:[e,t])}class Fu{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;name;status={code:Oe.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){const t=Date.now();this._spanContext=e.spanContext,this._performanceStartTime=At.now(),this._performanceOffset=t-(this._performanceStartTime+It()),this._startTimeProvided=null!=e.startTime,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,this.links=e.links||[],this.startTime=this._getTime(e.startTime??t),this.resource=e.resource,this.instrumentationScope=e.scope,null!=e.attributes&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,t){if(null==t||this._isSpanEnded())return this;if(0===e.length)return Pe.warn(`Invalid attribute key: ${e}`),this;if(!yt(t))return Pe.warn(`Invalid attribute value set for key: ${e}`),this;const{attributeCountLimit:n}=this._spanLimits;return void 0!==n&&Object.keys(this.attributes).length>=n&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),this)}setAttributes(e){for(const[t,n]of Object.entries(e))this.setAttribute(t,n);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;const{eventCountLimit:r}=this._spanLimits;if(0===r)return Pe.warn("No events allowed."),this._droppedEventsCount++,this;void 0!==r&&this.events.length>=r&&(0===this._droppedEventsCount&&Pe.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),Bt(t)&&(Bt(n)||(n=t),t=void 0);const i=vt(t);return this.events.push({name:e,attributes:i,time:this._getTime(n),droppedAttributesCount:0}),this}addLink(e){return this.links.push(e),this}addLinks(e){return this.links.push(...e),this}setStatus(e){return this._isSpanEnded()||(this.status={...e},null!=this.status.message&&"string"!=typeof e.message&&(Pe.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`),delete this.status.message)),this}updateName(e){return this._isSpanEnded()||(this.name=e),this}end(e){this._isSpanEnded()?Pe.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`):(this._ended=!0,this.endTime=this._getTime(e),this._duration=Mt(this.startTime,this.endTime),this._duration[0]<0&&(Pe.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&Pe.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this))}_getTime(e){if("number"==typeof e&&e<=At.now())return Nt(e+this._performanceOffset);if("number"==typeof e)return kt(e);
1if(e instanceof Date)return kt(e.getTime());if(Ut(e))return e;if(this._startTimeProvided)return kt(Date.now());const t=At.now()-this._performanceStartTime;return Ft(this.startTime,kt(t))}isRecording(){return!1===this._ended}recordException(e,t){const n={};"string"==typeof e?n[Ze]=e:e&&(e.code?n[Je]=e.code.toString():e.name&&(n[Je]=e.name),e.message&&(n[Ze]=e.message),e.stack&&(n["exception.stacktrace"]=e.stack)),n[Je]||n[Ze]?this.addEvent("exception",n,t):Pe.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){const e=new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);Pe.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){const t=this._attributeValueLengthLimit;return t<=0?(Pe.warn(`Attribute value limit must be positive, got ${t}`),e):"string"==typeof e?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(e=>"string"==typeof e?this._truncateToLimitUtil(e,t):e):e}}var zu;!function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(zu||(zu={}));class Hu{shouldSample(){return{decision:zu.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class Vu{shouldSample(){return{decision:zu.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class qu{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||(Tt(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new Vu),this._remoteParentSampled=e.remoteParentSampled??new Vu,this._remoteParentNotSampled=e.remoteParentNotSampled??new Hu,this._localParentSampled=e.localParentSampled??new Vu,this._localParentNotSampled=e.localParentNotSampled??new Hu}shouldSample(e,t,n,r,i,o){const s=Ge.getSpanContext(e);return s&&ye(s)?s.isRemote?s.traceFlags&C.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,i,o):this._remoteParentNotSampled.shouldSample(e,t,n,r,i,o):s.traceFlags&C.SAMPLED?this._localParentSampled.shouldSample(e,t,n,r,i,o):this._localParentNotSampled.shouldSample(e,t,n,r,i,o):this._root.shouldSample(e,t,n,r,i,o)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}class $u{_ratio;_upperBound;constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(4294967295*this._ratio)}shouldSample(e,t){return{decision:be(t)&&this._accumulate(t)<this._upperBound?zu.RECORD_AND_SAMPLED:zu.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return"number"!=typeof e||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<e.length/8;n++){const r=8*n;t=(t^parseInt(e.slice(r,r+8),16))>>>0}return t}}function Gu(){return{sampler:Ku(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function Ku(){const e="parentbased_always_on";switch(e){case"always_on":return new Vu;case"always_off":return new Hu;case"parentbased_always_on":return new qu({root:new Vu});case"parentbased_always_off":return new qu({root:new Hu});case"traceidratio":return new $u(Wu());case"parentbased_traceidratio":return new qu({root:new $u(Wu())});default:return Pe.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "parentbased_always_on".`),new qu({root:new Vu})}}function Wu(){return Pe.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to 1."),1}const Xu=1/0;class Qu{_exporter;_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e,t){this._exporter=e,this._maxExportBatchSize="number"==typeof t?.maxExportBatchSize?t.maxExportBatchSize:512,this._maxQueueSize="number"==typeof t?.maxQueueSize?t.maxQueueSize:2048,this._scheduledDelayMillis="number"==typeof t?.scheduledDelayMillis?t.scheduledDelayMillis:5e3,this._exportTimeoutMillis="number"==typeof t?.exportTimeoutMillis?t.exportTimeoutMillis:3e4,this._shutdownOnce=new En(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Pe.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||0!==(e.spanContext().traceFlags&C.SAMPLED)&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize)return 0===this._droppedSpansCount&&Pe.debug("maxQueueSize reached, dropping spans"),void this._droppedSpansCount++;this._droppedSpansCount>0&&(Pe.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>
1{const n=[];for(let e=0,t=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);e<t;e++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),0===this._finishedSpans.length?Promise.resolve():new Promise((e,t)=>{const n=setTimeout(()=>{t(new Error("Timeout"))},this._exportTimeoutMillis);Le.with(dt(Le.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);const i=()=>this._exporter.export(r,r=>{clearTimeout(n),r.code===zt.SUCCESS?e():t(r.error??new Error("BatchSpanProcessor: span export failed"))});let o=null;for(let e=0,t=r.length;e<t;e++){const t=r[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(o??=[],o.push(t.resource.waitForAsyncAttributes()))}null===o?i():Promise.all(o).then(i,e=>{Tt(e),t(e)})})})}_maybeStartTimer(){if(this._isExporting)return;const e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{this._isExporting=!1,Tt(e)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();void 0===this._timer&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),this._timer)}_clearTimer(){void 0!==this._timer&&(clearTimeout(this._timer),this._timer=void 0)}}class Yu extends Qu{_visibilityChangeListener;_pageHideListener;constructor(e,t){super(e,t),this.onInit(t)}onInit(e){!0!==e?.disableAutoFlushOnDocumentHide&&"undefined"!=typeof document&&(this._visibilityChangeListener=()=>{"hidden"===document.visibilityState&&this.forceFlush().catch(e=>{Tt(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{Tt(e)})},document.addEventListener("visibilitychange",this._visibilityChangeListener),document.addEventListener("pagehide",this._pageHideListener))}onShutdown(){"undefined"!=typeof document&&(this._visibilityChangeListener&&document.removeEventListener("visibilitychange",this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener("pagehide",this._pageHideListener))}}class Zu{generateTraceId=ec(16);generateSpanId=ec(8)}const Ju=Array(32);function ec(e){return function(){for(let t=0;t<2*e;t++)Ju[t]=Math.floor(16*Math.random())+48,Ju[t]>=58&&(Ju[t]+=39);return String.fromCharCode.apply(null,Ju.slice(0,2*e))}}class tc{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;constructor(e,t,n,r){const i=function(e){const t={sampler:Ku()},n=Gu(),r=Object.assign({},n,t,e);return r.generalLimits=Object.assign({},n.generalLimits,e.generalLimits||{}),r.spanLimits=Object.assign({},n.spanLimits,e.spanLimits||{}),r}(t);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=t.idGenerator||new Zu,this._resource=n,this._spanProcessor=r,this.instrumentationScope=e}startSpan(e,t={},n=Le.active()){t.root&&(n=Ge.deleteSpan(n));const r=Ge.getSpan(n);if(pt(n)){Pe.debug("Instrumentation suppressed, returning Noop Span");return Ge.wrapSpanContext(ae)}const i=r?.spanContext(),o=this._idGenerator.generateSpanId();let s,a,u;i&&Ge.isSpanContextValid(i)?(a=i.traceId,u=i.traceState,s=i):a=this._idGenerator.generateTraceId();const c=t.kind??Ee.INTERNAL,l=(t.links??[]).map(e=>({context:e.context,attributes:vt(e.attributes)})),d=vt(t.attributes),p=this._sampler.shouldSample(n,a,e,c,d,l);u=p.traceState??u;const f={traceId:a,spanId:o,traceFlags:p.decision===Te.RECORD_AND_SAMPLED?C.SAMPLED:C.NONE,traceState:u};if(p.decision===Te.NOT_RECORD){Pe.debug("Recording is off, propagating context in a non-recording span");return Ge.wrapSpanContext(f)}const h=vt(Object.assign(d,p.attributes));return new Fu({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:f,name:e,kind:c,links:l,parentSpanContext:s,attributes:h,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits})}startActiveSpan(e,t,n,r){let i,o,s;if(arguments.length<2)return;2===arguments.length?s=t:3===arguments.length?(i=t,s=n):(i=t,o=n,s=r);const a=o??Le.active(),u=this.startSpan(e,i,a),c=Ge.setSpan(a,u);return Le.with(c,s,void 0,u)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}class nc{_spanProcessors;constructor(e){this._spanProcessors=e}
1forceFlush(){const e=[];for(const t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(e=>{Tt(e||new Error("MultiSpanProcessor: forceFlush failed")),t()})})}onStart(e,t){for(const n of this._spanProcessors)n.onStart(e,t)}onEnd(e){for(const t of this._spanProcessors)t.onEnd(e)}shutdown(){const e=[];for(const t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}}var rc,ic;!function(e){e[e.resolved=0]="resolved",e[e.timeout=1]="timeout",e[e.error=2]="error",e[e.unresolved=3]="unresolved"}(rc||(rc={}));class oc{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){const t=pn({},Gu(),function(e){const t=Object.assign({},e.spanLimits);return t.attributeCountLimit=e.spanLimits?.attributeCountLimit??e.generalLimits?.attributeCountLimit??void 0??void 0??128,t.attributeValueLengthLimit=e.spanLimits?.attributeValueLengthLimit??e.generalLimits?.attributeValueLengthLimit??void 0??void 0??Xu,Object.assign({},e,{spanLimits:t})}(e));this._resource=t.resource??Uu(),this._config=Object.assign({},t,{resource:this._resource});const n=[];e.spanProcessors?.length&&n.push(...e.spanProcessors),this._activeSpanProcessor=new nc(n)}getTracer(e,t,n){const r=`${e}@${t||""}:${n?.schemaUrl||""}`;return this._tracers.has(r)||this._tracers.set(r,new tc({name:e,version:t,schemaUrl:n?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(r)}forceFlush(){const e=this._config.forceFlushTimeoutMillis,t=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(n=>{let r;const i=setTimeout(()=>{n(new Error(`Span processor did not completed within timeout period of ${e} ms`)),r=rc.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),r!==rc.timeout&&(r=rc.resolved,n(r))}).catch(e=>{clearTimeout(i),r=rc.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{const r=t.filter(e=>e!==rc.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}class sc{_enabled=!1;_currentContext=R;_bindFunction(e=R,t){const n=this,r=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(r,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}active(){return this._currentContext}bind(e,t){return void 0===e&&(e=this.active()),"function"==typeof t?this._bindFunction(e,t):t}disable(){return this._currentContext=R,this._enabled=!1,this}enable(){return this._enabled||(this._enabled=!0,this._currentContext=R),this}with(e,t,n,...r){const i=this._currentContext;this._currentContext=e||R;try{return t.call(n,...r)}finally{this._currentContext=i}}}class ac extends oc{constructor(e={}){super(e)}register(e={}){var t;Ge.setGlobalTracerProvider(this),null!==(t=e.propagator)&&(void 0!==t?qe.setGlobalPropagator(t):qe.setGlobalPropagator(new Ht({propagators:[new Zt,new mt]}))),function(e){if(null!==e){if(void 0===e){const e=new sc;return e.enable(),void Le.setGlobalContextManager(e)}e.enable(),Le.setGlobalContextManager(e)}}(e.contextManager)}}!function(e){e.CONNECT_END="connectEnd",e.CONNECT_START="connectStart",e.DECODED_BODY_SIZE="decodedBodySize",e.DOM_COMPLETE="domComplete",e.DOM_CONTENT_LOADED_EVENT_END="domContentLoadedEventEnd",e.DOM_CONTENT_LOADED_EVENT_START="domContentLoadedEventStart",e.DOM_INTERACTIVE="domInteractive",e.DOMAIN_LOOKUP_END="domainLookupEnd",e.DOMAIN_LOOKUP_START="domainLookupStart",e.ENCODED_BODY_SIZE="encodedBodySize",e.FETCH_START="fetchStart",e.LOAD_EVENT_END="loadEventEnd",e.LOAD_EVENT_START="loadEventStart",e.NAVIGATION_START="navigationStart",e.REDIRECT_END="redirectEnd",e.REDIRECT_START="redirectStart",e.REQUEST_START="requestStart",e.RESPONSE_END="responseEnd",e.RESPONSE_START="responseStart",e.SECURE_CONNECTION_START="secureConnectionStart",e.START_TIME="startTime",e.UNLOAD_EVENT_END="unloadEventEnd",e.UNLOAD_EVENT_START="unloadEventStart"}(ic||(ic={}));let uc;function cc(e,t,n,r=!0){if(!(i=n,o=t,!(o in i)||"number"!=typeof n[t]||r&&0===n[t]))return e.addEvent(t,n[t]);var i,o}function lc(e,t,n=!1,r,i){if(void 0===r&&(r=0!==t[ic.START_TIME]),n||(cc(e,ic.FETCH_START,t,r),cc(e,ic.DOMAIN_LOOKUP_START,t,r),cc(e,ic.DOMAIN_LOOKUP_END,t,r),cc(e,ic.CONNECT_START,t,r),cc(e,ic.SECURE_CONNECTION_START,t,r),cc(e,ic.CONNECT_END,t,r),cc(e,ic.REQUEST_START,t,r),cc(e,ic.RESPONSE_START,t,r),cc(e,ic.RESPONSE_END,t,r)),!i){const n=t[ic.ENCODED_BODY_SIZE];void 0!==n&&e.setAttribute("http.response_content_length",n);const r=t[ic.DECODED_BODY_SIZE];void 0!==r&&n!==r&&e.setAttribute("http.response_content_length_uncompressed",r)}}function dc(){return"undefined"!=typeof location?location.origin:void 0}function pc(e,t,n,r,i=new WeakSet,o){const s=fc(e),a=function(e,t,n,r,i,o){const s=jt(t),a=jt(n);let u=r.filter(t=>
1{const n=jt(Dt(t[ic.FETCH_START])),r=jt(Dt(t[ic.RESPONSE_END]));return t.initiatorType.toLowerCase()===(o||"xmlhttprequest")&&t.name===e&&n>=s&&r<=a});u.length>0&&(u=u.filter(e=>!i.has(e)));return u}(e=s.toString(),t,n,r,i,o);if(0===a.length)return{mainRequest:void 0};if(1===a.length)return{mainRequest:a[0]};const u=function(e){return e.slice().sort((e,t)=>{const n=e[ic.FETCH_START],r=t[ic.FETCH_START];return n>r?1:n<r?-1:0})}(a);if(s.origin!==dc()&&u.length>1){let e=u[0],t=function(e,t,n){const r=jt(n),i=jt(Dt(t));let o,s=e[1];const a=e.length;for(let t=1;t<a;t++){const n=e[t],a=jt(Dt(n[ic.FETCH_START])),u=r-jt(Dt(n[ic.RESPONSE_END]));a>=i&&(!o||u<o)&&(o=u,s=n)}return s}(u,e[ic.RESPONSE_END],n);const r=e[ic.RESPONSE_END];return t[ic.FETCH_START]<r&&(t=e,e=void 0),{corsPreFlightRequest:e,mainRequest:t}}return{mainRequest:a[0]}}function fc(e){if("function"==typeof URL)return new URL(e,"undefined"!=typeof document?document.baseURI:"undefined"!=typeof location?location.href:void 0);const t=(uc||(uc=document.createElement("a")),uc);return t.href=e,t}function hc(e,t){let n=t||[];("string"==typeof n||n instanceof RegExp)&&(n=[n]);return fc(e).origin===dc()||n.some(t=>wn(e,t))}var gc;!function(e){e.COMPONENT="component",e.HTTP_STATUS_TEXT="http.status_text"}(gc||(gc={}));var mc={};Object.defineProperty(mc,"__esModule",{value:!0});var vc=mc.ATTR_HTTP_USER_AGENT=mc.ATTR_HTTP_URL=mc.ATTR_HTTP_STATUS_CODE=mc.ATTR_HTTP_SCHEME=mc.ATTR_HTTP_RESPONSE_CONTENT_LENGTH=mc.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED=mc.ATTR_HTTP_REQUEST_BODY_SIZE=mc.ATTR_HTTP_METHOD=mc.ATTR_HTTP_HOST=void 0,bc=mc.ATTR_HTTP_HOST="http.host",yc=mc.ATTR_HTTP_METHOD="http.method",_c=mc.ATTR_HTTP_REQUEST_BODY_SIZE="http.request.body.size",wc=mc.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED="http.request_content_length_uncompressed";mc.ATTR_HTTP_RESPONSE_CONTENT_LENGTH="http.response_content_length";var Sc=mc.ATTR_HTTP_SCHEME="http.scheme",Tc=mc.ATTR_HTTP_STATUS_CODE="http.status_code",Ec=mc.ATTR_HTTP_URL="http.url";vc=mc.ATTR_HTTP_USER_AGENT="http.user_agent";const Oc=Pe.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-fetch/utils"});function Ac(...e){if(e[0]instanceof URL||"string"==typeof e[0]){const t=e[1];if(!t?.body)return Promise.resolve();if(t.body instanceof ReadableStream){const{body:e,length:n}=function(e){if(!e.pipeThrough)return Oc.warn("Platform has ReadableStream but not pipeThrough!"),{body:e,length:Promise.resolve(void 0)};let t,n=0;const r=new Promise(e=>{t=e}),i=new TransformStream({start(){},async transform(e,t){const r=await e;n+=r.byteLength,t.enqueue(e)},flush(){t(n)}});return{body:e.pipeThrough(i),length:r}}(t.body);return t.body=e,n}return Promise.resolve(function(e){if(t=e,"undefined"!=typeof Document&&t instanceof Document)return(new XMLSerializer).serializeToString(document).length;var t;if("string"==typeof e)return xc(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return function(e){let t=0;for(const[n,r]of e.entries())t+=n.length,r instanceof Blob?t+=r.size:t+=r.length;return t}(e);if(e instanceof URLSearchParams)return xc(e.toString());if(void 0!==e.byteLength)return e.byteLength;return void Oc.warn("unknown body type")}(t.body))}{const t=e[0];return t?.body?t.clone().text().then(e=>xc(e)):Promise.resolve()}}const Cc=new TextEncoder;function xc(e){return Cc.encode(e).byteLength}function Rc(e){const t=function(){void 0===Pc&&(Pc=Lc);return Pc}(),n=e.toUpperCase();return n in t?n:"_OTHER"}const Lc={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0};let Pc;const kc={"https:":"443","http:":"80"};const Ic="0.202.0",Nc="object"==typeof process&&"node"===process.release?.name;class Dc extends Lu{component="fetch";version=Ic;moduleName=this.component;_usedResources=new WeakSet;_tasksCount=0;_semconvStability;constructor(e={}){super("@opentelemetry/instrumentation-fetch",Ic,e),this._semconvStability=Nu("http",e?.semconvStabilityOptIn)}init(){}_addChildSpan(e,t){const n=this.tracer.startSpan("CORS Preflight",{startTime:t[ic.FETCH_START]},Ge.setSpan(Le.active(),e)),r=!(this._semconvStability&Iu.OLD);lc(n,t,this.getConfig().ignoreNetworkEvents,void 0,r),n.end(t[ic.RESPONSE_END])}_addFinalSpanAttributes(e,t){const n=fc(t.url);if(this._semconvStability&Iu.OLD&&(e.setAttribute(Tc,t.status),null!=t.statusText&&e.setAttribute(gc.HTTP_STATUS_TEXT,t.statusText),e.setAttribute(bc,n.host),e.setAttribute(Sc,n.protocol.replace(":","")),"undefined"!=typeof navigator&&e.setAttribute(vc,navigator.userAgent)),this._semconvStability&Iu.STABLE){e.setAttribute(nt,t.status),e.setAttribute(rt,n.hostname);const r=function(e){const t=Number(e.port||kc[e.protocol]);return t&&!isNaN(t)?t:void 0}(n);r&&e.setAttribute(it,r)}}_addHeaders(e,t){if(!hc(t,this.getConfig().propagateTraceHeaderCorsUrls)){const e={};return qe.inject(Le.active(),e),void(Object.keys(e).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}if(e instanceof Request)qe.inject(Le.active(),e.headers,{set:(e,t,n)=>e.set(t,"string"==typeof n?n:String(n))});else if(e.headers instanceof Headers)qe.inject(Le.active(),e.headers,{set:(e,t,n)=>e.set(t,"string"==typeof n?n:String(n))});else if(e.headers instanceof Map)qe.inject(Le.active(),e.headers,{set:(e,t,n)=>e.set(t,"string"==typeof n?n:String(n))});else{const t={};qe.inject(Le.active(),t),e.headers=Object.assign({},t,e.headers||{})}}_clearResources(){0===this._tasksCount&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(e,t={}){if(Sn(e,this.getConfig().ignoreUrls))return void this._diag.debug("ignoring span as url matches ignored url");let n="";const r={};if(this._semconvStability&Iu.OLD){const i=(t.method||"GET").toUpperCase();n=`HTTP ${i}`,r[gc.COMPONENT]=this.moduleName,r[yc]=i,r[Ec]=e}if(this._semconvStability&Iu.STABLE){const i=t.method,o=Rc(t.method||"GET");
1n||(n=o),r[et]=o,o!==i&&(r[tt]=i),r[ct]=e}return this.tracer.startSpan(n,{kind:Ee.CLIENT,attributes:r})}_findResourceAndAddNetworkEvents(e,t,n){let r=t.entries;if(!r.length){if(!performance.getEntriesByType)return;r=performance.getEntriesByType("resource")}const i=pc(t.spanUrl,t.startTime,n,r,this._usedResources,"fetch");if(i.mainRequest){const t=i.mainRequest;this._markResourceAsUsed(t);const n=i.corsPreFlightRequest;n&&(this._addChildSpan(e,n),this._markResourceAsUsed(n));const r=!(this._semconvStability&Iu.OLD);lc(e,t,this.getConfig().ignoreNetworkEvents,void 0,r)}}_markResourceAsUsed(e){this._usedResources.add(e)}_endSpan(e,t,n){const r=kt(Date.now()),i=Nt();this._addFinalSpanAttributes(e,n),this._semconvStability&Iu.STABLE&&n.status>=400&&(e.setStatus({code:Oe.ERROR}),e.setAttribute(Ye,String(n.status))),setTimeout(()=>{t.observer?.disconnect(),this._findResourceAndAddNetworkEvents(e,t,i),this._tasksCount--,this._clearResources(),e.end(r)},300)}_patchConstructor(){return e=>{const t=this;return function(...n){const r=this,i=fc(n[0]instanceof Request?n[0].url:String(n[0])).href,o=n[0]instanceof Request?n[0]:n[1]||{},s=t._createSpan(i,o);if(!s)return e.apply(this,n);const a=t._prepareSpanData(i);function u(e,n){t._applyAttributesAfterFetch(e,o,n),t._endSpan(e,a,{status:n.status||0,statusText:n.message,url:i})}function c(e,n){t._applyAttributesAfterFetch(e,o,n),n.status>=200&&n.status<400?t._endSpan(e,a,n):t._endSpan(e,a,{status:n.status,statusText:n.statusText,url:i})}function l(e,t,n){try{const t=n.clone().body;if(t){const r=t.getReader(),i=()=>{r.read().then(({done:t})=>{t?c(e,n):i()},t=>{u(e,t)})};i()}else c(e,n)}finally{t(n)}}function d(e,t,n){try{u(e,n)}finally{t(n)}}return t.getConfig().measureRequestSize&&Ac(...n).then(e=>{e&&(t._semconvStability&Iu.OLD&&s.setAttribute(wc,e),t._semconvStability&Iu.STABLE&&s.setAttribute(_c,e))}).catch(e=>{t._diag.warn("getFetchBodyLength",e)}),new Promise((n,a)=>Le.with(Ge.setSpan(Le.active(),s),()=>(t._addHeaders(o,i),t._callRequestHook(s,o),t._tasksCount++,e.apply(r,o instanceof Request?[o]:[i,o]).then(l.bind(r,s,n),d.bind(r,s,a)))))}}}_applyAttributesAfterFetch(e,t,n){const r=this.getConfig().applyCustomAttributesOnSpan;r&&Pu(()=>r(e,t,n),e=>{e&&this._diag.error("applyCustomAttributesOnSpan",e)})}_callRequestHook(e,t){const n=this.getConfig().requestHook;n&&Pu(()=>n(e,t),e=>{e&&this._diag.error("requestHook",e)})}_prepareSpanData(e){const t=Nt(),n=[];if("function"!=typeof PerformanceObserver)return{entries:n,startTime:t,spanUrl:e};const r=new PerformanceObserver(t=>{t.getEntries().forEach(t=>{"fetch"===t.initiatorType&&t.name===e&&n.push(t)})});return r.observe({entryTypes:["resource"]}),{entries:n,observer:r,startTime:t,spanUrl:e}}enable(){Nc?this._diag.warn("this instrumentation is intended for web usage only, it does not instrument Node.js's fetch()"):(ku(fetch)&&(this._unwrap(Ot,"fetch"),this._diag.debug("removing previous patch for constructor")),this._wrap(Ot,"fetch",this._patchConstructor()))}disable(){Nc||(this._unwrap(Ot,"fetch"),this._usedResources=new WeakSet)}}var Mc;!function(e){e.METHOD_OPEN="open",e.METHOD_SEND="send",e.EVENT_ABORT="abort",e.EVENT_ERROR="error",e.EVENT_LOAD="loaded",e.EVENT_TIMEOUT="timeout"}(Mc||(Mc={}));const jc=Pe.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-xml-http-request/utils"});function Uc(e){return t=e,"undefined"!=typeof Document&&t instanceof Document?(new XMLSerializer).serializeToString(document).length:"string"==typeof e?Fc(e):e instanceof Blob?e.size:e instanceof FormData?function(e){let t=0;for(const[n,r]of e.entries())t+=n.length,r instanceof Blob?t+=r.size:t+=r.length;return t}(e):e instanceof URLSearchParams?Fc(e.toString()):void 0!==e.byteLength?e.byteLength:void jc.warn("unknown body type");var t}const Bc=new TextEncoder;function Fc(e){return Bc.encode(e).byteLength}const zc={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0};let Hc;function Vc(){return void 0===Hc&&(Hc=zc),Hc}const qc={"https:":"443","http:":"80"};const $c="0.202.0";var Gc;!function(e){e.HTTP_STATUS_TEXT="http.status_text"}(Gc||(Gc={}));class Kc extends Lu{component="xml-http-request";version=$c;moduleName=this.component;_tasksCount=0;_xhrMem=new WeakMap;_usedResources=new WeakSet;_semconvStability;constructor(e={}){super("@opentelemetry/instrumentation-xml-http-request",$c,e),this._semconvStability=Nu("http",e?.semconvStabilityOptIn)}init(){}_addHeaders(e,t){if(!hc(fc(t).href,this.getConfig().propagateTraceHeaderCorsUrls)){const e={};return qe.inject(Le.active(),e),void(Object.keys(e).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}const n={};
1qe.inject(Le.active(),n),Object.keys(n).forEach(t=>{e.setRequestHeader(t,String(n[t]))})}_addChildSpan(e,t){Le.with(Ge.setSpan(Le.active(),e),()=>{const e=this.tracer.startSpan("CORS Preflight",{startTime:t[ic.FETCH_START]}),n=!(this._semconvStability&Iu.OLD);lc(e,t,this.getConfig().ignoreNetworkEvents,void 0,n),e.end(t[ic.RESPONSE_END])})}_addFinalSpanAttributes(e,t,n){if(this._semconvStability&Iu.OLD){if(void 0!==t.status&&e.setAttribute("http.status_code",t.status),void 0!==t.statusText&&e.setAttribute(Gc.HTTP_STATUS_TEXT,t.statusText),"string"==typeof n){const t=fc(n);e.setAttribute("http.host",t.host),e.setAttribute("http.scheme",t.protocol.replace(":",""))}e.setAttribute("http.user_agent",navigator.userAgent)}this._semconvStability&Iu.STABLE&&t.status&&e.setAttribute(nt,t.status)}_applyAttributesAfterXHR(e,t){const n=this.getConfig().applyCustomAttributesOnSpan;"function"==typeof n&&Pu(()=>n(e,t),e=>{e&&this._diag.error("applyCustomAttributesOnSpan",e)})}_addResourceObserver(e,t){const n=this._xhrMem.get(e);n&&"function"==typeof PerformanceObserver&&"function"==typeof PerformanceResourceTiming&&(n.createdResources={observer:new PerformanceObserver(e=>{const r=e.getEntries(),i=fc(t);r.forEach(e=>{"xmlhttprequest"===e.initiatorType&&e.name===i.href&&n.createdResources&&n.createdResources.entries.push(e)})}),entries:[]},n.createdResources.observer.observe({entryTypes:["resource"]}))}_clearResources(){0===this._tasksCount&&this.getConfig().clearTimingResources&&(At.clearResourceTimings(),this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}_findResourceAndAddNetworkEvents(e,t,n,r,i){if(!(n&&r&&i&&e.createdResources))return;let o=e.createdResources.entries;o&&o.length||(o=At.getEntriesByType("resource"));const s=pc(fc(n).href,r,i,o,this._usedResources);if(s.mainRequest){const e=s.mainRequest;this._markResourceAsUsed(e);const n=s.corsPreFlightRequest;n&&(this._addChildSpan(t,n),this._markResourceAsUsed(n));const r=!(this._semconvStability&Iu.OLD);lc(t,e,this.getConfig().ignoreNetworkEvents,void 0,r)}}_cleanPreviousSpanInformation(e){const t=this._xhrMem.get(e);if(t){const n=t.callbackToRemoveEvents;n&&n(),this._xhrMem.delete(e)}}_createSpan(e,t,n){if(Sn(t,this.getConfig().ignoreUrls))return void this._diag.debug("ignoring span as url matches ignored url");let r="";const i=fc(t),o={};if(this._semconvStability&Iu.OLD&&(r=n.toUpperCase(),o["http.method"]=n,o["http.url"]=i.toString()),this._semconvStability&Iu.STABLE){const e=n,t=function(e){const t=Vc(),n=e.toUpperCase();return n in t?n:"_OTHER"}(n);r||(r=t),o[et]=t,t!==e&&(o[tt]=e),o[ct]=i.toString(),o[rt]=i.hostname;const s=function(e){const t=Number(e.port||qc[e.protocol]);return t&&!isNaN(t)?t:void 0}(i);s&&(o[it]=s)}const s=this.tracer.startSpan(r,{kind:Ee.CLIENT,attributes:o});return s.addEvent(Mc.METHOD_OPEN),this._cleanPreviousSpanInformation(e),this._xhrMem.set(e,{span:s,spanUrl:t}),s}_markResourceAsUsed(e){this._usedResources.add(e)}_patchOpen(){return e=>{const t=this;return function(...n){const r=n[0],i=n[1];return t._createSpan(this,i,r),e.apply(this,n)}}}_patchSend(){const e=this;function t(t,n,r,i){const o=e._xhrMem.get(n);if(!o)return;if(o.status=n.status,o.statusText=n.statusText,e._xhrMem.delete(n),o.span){const t=o.span;e._applyAttributesAfterXHR(t,n),e._semconvStability&Iu.STABLE&&(r?i&&(t.setStatus({code:Oe.ERROR,message:i}),t.setAttribute(Ye,i)):o.status&&o.status>=400&&(t.setStatus({code:Oe.ERROR}),t.setAttribute(Ye,String(o.status))))}const s=Nt(),a=Date.now();setTimeout(()=>{!function(t,n,r,i){const o=n.callbackToRemoveEvents;"function"==typeof o&&o();const{span:s,spanUrl:a,sendStartTime:u}=n;s&&(e._findResourceAndAddNetworkEvents(n,s,a,u,r),s.addEvent(t,i),e._addFinalSpanAttributes(s,n,a),s.end(i),e._tasksCount--),e._clearResources()}(t,o,s,a)},300)}function n(){t(Mc.EVENT_ERROR,this,!0,"error")}function r(){t(Mc.EVENT_ABORT,this,!1)}function i(){t(Mc.EVENT_TIMEOUT,this,!0,"timeout")}function o(){this.status<299?t(Mc.EVENT_LOAD,this,!1):t(Mc.EVENT_ERROR,this,!1)}return t=>function(...s){const a=e._xhrMem.get(this);if(!a)return t.apply(this,s);const u=a.span,c=a.spanUrl;if(u&&c){if(e.getConfig().measureRequestSize&&s?.[0]){const t=Uc(s[0]);void 0!==t&&(e._semconvStability&Iu.OLD&&u.setAttribute("http.request_content_length_uncompressed",t),e._semconvStability&Iu.STABLE&&u.setAttribute("http.request.body.size",t))}Le.with(Ge.setSpan(Le.active(),u),()=>{e._tasksCount++,a.sendStartTime=Nt(),u.addEvent(Mc.METHOD_SEND),this.addEventListener("abort",r),this.addEventListener("error",n),this.addEventListener("load",o),this.addEventListener("timeout",i),a.callbackToRemoveEvents=()=>{!function(t){t.removeEventListener("abort",r),t.removeEventListener("error",n),t.removeEventListener("load",o),t.removeEventListener("timeout",i);const s=e._xhrMem.get(t);s&&(s.callbackToRemoveEvents=void 0)}(this),a.createdResources&&a.createdResources.observer.disconnect()},e._addHeaders(this,c),e._addResourceObserver(this,c)})}return t.apply(this,s)}}enable(){this._diag.debug("applying patch to",this.moduleName,this.version),ku(XMLHttpRequest.prototype.open)&&(this._unwrap(XMLHttpRequest.prototype,"open"),this._diag.debug("removing previous patch from method open")),ku(XMLHttpRequest.prototype.send)&&(this._unwrap(XMLHttpRequest.prototype,"send"),this._diag.debug("removing previous patch from method send")),this._wrap(XMLHttpRequest.prototype,"open",this._patchOpen()),this._wrap(XMLHttpRequest.prototype,"send",this._patchSend())}disable(){this._diag.debug("removing patch from",this.moduleName,this.version),this._unwrap(XMLHttpRequest.prototype,"open"),this._unwrap(XMLHttpRequest.prototype,"send"),this._tasksCount=0,this._xhrMem=new WeakMap,this._usedResources=new WeakSet}}class Wc extends Kc{constructor(e={}){super(e);this.parentCreateSpan=this._createSpan.bind(this)}_patchOpen(){return e=>{const t=this;return function(...n){try{const e=n[0];let r=ki(n[1]);t.parentCreateSpan(this,r,e)}catch(e){ui.internalLogger.error(e)}return e.apply(this,n)}}}}function Xc(e,t){if(null==t)return;(0===t||t>=400&&t<600)&&e.setStatus({code:Oe.ERROR})}function Qc(e){return(t,n,r)=>{!function(e,t,n){Xc(e,n instanceof Error?0:n.status)}(t,0,r),null==e||e(t,n,r)}}function Yc(e){return(t,n)=>{!function(e,t){Xc(e,t.status)}(t,n),null==e||e(t,n)}}var Zc=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};
1function Jc(e={}){const{fetchInstrumentationOptions:t,xhrInstrumentationOptions:n}=e,r=Zc(e,["fetchInstrumentationOptions","xhrInstrumentationOptions"]),i=function(e,t){return Object.assign(Object.assign(Object.assign(Object.assign({},t),{ignoreNetworkEvents:!0}),e),{applyCustomAttributesOnSpan:Qc(null==e?void 0:e.applyCustomAttributesOnSpan)})}(t,r),o=function(e,t){return Object.assign(Object.assign(Object.assign(Object.assign({},t),{ignoreNetworkEvents:!0}),e),{applyCustomAttributesOnSpan:Yc(null==e?void 0:e.applyCustomAttributesOnSpan)})}(n,r);return[new Dc(i),new Wc(o)]}class el{constructor(e,t){this.processor=e,this.metas=t}forceFlush(){return this.processor.forceFlush()}onStart(e,t){var n;const r=this.metas.value.session;(null==r?void 0:r.id)&&(e.attributes["session.id"]=r.id,e.attributes.session_id=r.id);const i=null!==(n=this.metas.value.user)&&void 0!==n?n:{};i.email&&(e.attributes["user.email"]=i.email),i.id&&(e.attributes["user.id"]=i.id),i.username&&(e.attributes["user.name"]=i.username),i.fullName&&(e.attributes["user.full_name"]=i.fullName),i.roles&&(e.attributes["user.roles"]=i.roles.split(",").map(e=>e.trim())),i.hash&&(e.attributes["user.hash"]=i.hash),this.processor.onStart(e,t)}onEnd(e){this.processor.onEnd(e)}shutdown(){return this.processor.shutdown()}}class tl{constructor(e){this.processor=e,ri.subscribe(e=>{e.type!==Gr?[Kr,Xr,Wr].includes(e.type)&&(this.message=void 0):this.message=e})}forceFlush(){return this.processor.forceFlush()}onStart(e,t){var n,r;e.kind===Ee.CLIENT&&this.message&&(e.attributes["faro.action.user.name"]=null===(n=this.message)||void 0===n?void 0:n.name,e.attributes["faro.action.user.parentId"]=null===(r=this.message)||void 0===r?void 0:r.parentId),this.processor.onStart(e,t)}onEnd(e){this.processor.onEnd(e)}shutdown(){return this.processor.shutdown()}}function nl(e={}){var t;return"true"===(null===(t=e.attributes)||void 0===t?void 0:t.isSampled)?zu.RECORD_AND_SAMPLED:zu.NOT_RECORD}class rl extends oi{constructor(e={}){super(),this.options=e,this.name="@grafana/faro-web-tracing",this.version=si}initialize(){var e,t,n,r,i;const o=this.options,s={};this.config.app.name&&(s[ot]=this.config.app.name),this.config.app.namespace&&(s["service.namespace"]=this.config.app.namespace),this.config.app.version&&(s["service.version"]=this.config.app.version),this.config.app.environment&&(s["deployment.environment.name"]=this.config.app.environment,s[Xe]=this.config.app.environment);const a=this.metas.value.browser;lr(null==a?void 0:a.brands)&&(s["browser.brands"]=a.brands.map(e=>e.brand)),(null==a?void 0:a.language)&&(s["browser.language"]=a.language),"boolean"==typeof(null==a?void 0:a.mobile)&&(s["browser.mobile"]=Boolean(a.mobile)),(null==a?void 0:a.os)&&(s["browser.platform"]=a.os),(null==a?void 0:a.userAgent)&&(s["user_agent.original"]=a.userAgent),s["process.runtime.name"]="browser",s["process.runtime.version"]=null===(e=this.metas.value.browser)||void 0===e?void 0:e.userAgent,s["telemetry.distro.name"]="faro-web-sdk",s["telemetry.distro.version"]=si,Object.assign(s,o.resourceAttributes);const u=Uu().merge(ju(s));new ac({resource:u,sampler:{shouldSample:()=>({decision:nl(this.api.getSession())})},spanProcessors:[null!==(t=o.spanProcessor)&&void 0!==t?t:new tl(new el(new Yu(new pu({api:this.api}),{scheduledDelayMillis:rl.SCHEDULED_BATCH_DELAY_MS,maxExportBatchSize:30}),this.metas))]}).register({propagator:null!==(n=o.propagator)&&void 0!==n?n:new Zt,contextManager:o.contextManager});const{propagateTraceHeaderCorsUrls:c,fetchInstrumentationOptions:l,xhrInstrumentationOptions:d}=null!==(r=this.options.instrumentationOptions)&&void 0!==r?r:{};!function(e){const t=e.tracerProvider||Ge.getTracerProvider(),n=e.meterProvider||Ne.getMeterProvider(),r=e.loggerProvider||Su.getLoggerProvider(),i=e.instrumentations?.flat()??[];(function(e,t,n,r){for(let i=0,o=e.length;i<o;i++){const o=e[i];t&&o.setTracerProvider(t),n&&o.setMeterProvider(n),r&&o.setLoggerProvider&&o.setLoggerProvider(r),o.getConfig().enabled||o.enable()}})(i,t,n,r)}({instrumentations:null!==(i=o.instrumentations)&&void 0!==i?i:Jc({ignoreUrls:this.getIgnoreUrls(),propagateTraceHeaderCorsUrls:c,fetchInstrumentationOptions:l,xhrInstrumentationOptions:d})}),this.api.initOTEL(Ge,Le)}getIgnoreUrls(){return this.transports.transports.flatMap(e=>e.getIgnoreUrls())}}rl.SCHEDULED_BATCH_DELAY_MS=1e3;class il{constructor(e){if(void 0!==window.ltvApm)return console.log("LTV APM already detected skipping initialization..."),this._=window.ltvApm._,null;e=e||{},this._={},this._.config=e,this._.config.url=e.url,void 0===this._.config.url&&(this._.config.url=window.APM_URL),void 0===this._.config.url&&(this._.config.url="https://gap01.ltvops.com/collect"),-1!==this._.config.url.indexOf("_")&&(this._.config.url=this._.config.url.replace(/_/g,"")),this._.config.ignoreUrls=e.ignoreUrls||window.APM_IGNORE_URLS||[],this._.config.name=e.name||window.APM_NAME||"not-provided",this._.config.version=e.version||window.APM_VERSION||"0.0.0",this._.config.key=e.key||window.APM_KEY||"not-provided",this._.config.enabled=e.enabled||window.APM_ENABLED||true,this._.config.type=e.type||window.APM_TYPE||"fetch",this._.resourceAttributes={[Qe.SERVICE_NAME]:this._.config.name,[Qe.SERVICE_VERSION]:this._.config.version},""!==this._.config.key&&"not-provided"!==this._.config.key||console.error("APM_KEY must be provided"),window.ltvApm=this}get enabled(){return this._.config.enabled}
1async init(){this._.faro=du({url:this._.config.url,apiKey:this._.config.key,instrumentations:[...Za({captureConsole:!0}),new rl],app:{name:this._.config.name,version:this._.config.version}})}getTracer(e="default",t=""){return""===t&&(t=this._.version),Ge.getTracer(e,t)}startActiveSpan(...e){return this.getTracer().startActiveSpan(...e)}getActiveContext(){const e=Le.active();if(e)return e;return this.getTracer().startSpan("default").spanContext()}get faro(){return this._.faro}recordError(...e){if(this.enabled)return this.faro&&this.faro.api&&!0===this.faro.api.isOTELInitialized?this.faro.api.pushError(...e):void 0}setUser(e={}){if(this.faro&&this.faro.api)return this.faro.api.setUser(e)}resetUser(e={}){if(this.faro&&this.faro.api)return this.faro.api.resetUser()}setSession(e={}){if(this.faro&&this.faro.api)return this.faro.api.setSession(_i(e))}resetSession(){if(this.faro&&this.faro.api)return this.faro.api.resetSession()}get context(){return Le.active()}get log(){const e=this;return{info(t,n){let r=!1;if(e.faro&&e.faro.api)return r=!0,e.faro.api.pushLog([t],{context:n,level:yr.INFO});r||console.info(t)},error(t,n){let r=!1;if(e.faro&&e.faro.api)return r=!0,e.faro.api.pushLog([t],{context:n,level:yr.ERROR});r||console.error(t)},debug(t,n){let r=!1;if(e.faro&&e.faro.api)return r=!0,e.faro.api.pushLog([t],{context:n,level:yr.DEBUG});r||console.debug(t)},warn(t,n){let r=!1;if(e.faro&&e.faro.api)return r=!0,e.faro.api.pushLog([t],{context:n,level:yr.WARN});r||console.warn(t)}}}}return e.OpentelemetryBrowser=il,e.default=il,Object.defineProperty(e,"__esModule",{value:!0}),e}({});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.