@grafana/faro-web-tracing 2.2.3 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
var GrafanaFaroWebTracing=function(t,e){"use strict";var n="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},r="1.9.0",o=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;var i=function(t){var e=new Set([t]),n=new Set,r=t.match(o);if(!r)return function(){return!1};var i=+r[1],s=+r[2],a=+r[3];if(null!=r[4])return function(e){return e===t};function u(t){return n.add(t),!1}function c(t){return e.add(t),!0}return function(t){if(e.has(t))return!0;if(n.has(t))return!1;var r=t.match(o);if(!r)return u(t);var l=+r[1],p=+r[2],d=+r[3];return null!=r[4]||i!==l?u(t):0===i?s===p&&a<=d?c(t):u(t):s<=p?c(t):u(t)}}(r),s=r.split(".")[0],a=Symbol.for("opentelemetry.js.api."+s),u=n;function c(t,e,n,o){var i;void 0===o&&(o=!1);var s=u[a]=null!==(i=u[a])&&void 0!==i?i:{version:r};if(!o&&s[t]){var c=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+t);return n.error(c.stack||c.message),!1}if(s.version!==r){c=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+t+" does not match previously registered API v"+r);return n.error(c.stack||c.message),!1}return s[t]=e,n.debug("@opentelemetry/api: Registered a global for "+t+" v"+r+"."),!0}function l(t){var e,n,r=null===(e=u[a])||void 0===e?void 0:e.version;if(r&&i(r))return null===(n=u[a])||void 0===n?void 0:n[t]}function p(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+r+".");var n=u[a];n&&delete n[t]}var d,h=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s},f=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},g=function(){function t(t){this._namespace=t.namespace||"DiagComponentLogger"}return t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return m("debug",this._namespace,t)},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return m("error",this._namespace,t)},t.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return m("info",this._namespace,t)},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return m("warn",this._namespace,t)},t.prototype.verbose=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return m("verbose",this._namespace,t)},t}();function m(t,e,n){var r=l("diag");if(r)return n.unshift(e),r[t].apply(r,f([],h(n),!1))}!function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"}(d||(d={}));var _=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s},v=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},S=function(){function t(){function t(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=l("diag");if(r)return r[t].apply(r,v([],_(e),!1))}}var e=this;e.setLogger=function(t,n){var r,o,i;if(void 0===n&&(n={logLevel:d.INFO}),t===e){var s=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return e.error(null!==(r=s.stack)&&void 0!==r?r:s.message),!1}"number"==typeof n&&(n={logLevel:n});var a=l("diag"),u=function(t,e){function n(n,r){var o=e[n];return"function"==typeof o&&t>=r?o.bind(e):function(){}}return t<d.NONE?t=d.NONE:t>d.ALL&&(t=d.ALL),e=e||{},{error:n("error",d.ERROR),warn:n("warn",d.WARN),info:n("info",d.INFO),debug:n("debug",d.DEBUG),verbose:n("verbose",d.VERBOSE)}}(null!==(o=n.logLevel)&&void 0!==o?o:d.INFO,t);if(a&&!n.suppressOverrideMessage){var p=null!==(i=(new Error).stack)&&void 0!==i?i:"<failed to generate stacktrace>";a.warn("Current logger will be overwritten from "+p),u.warn("Current logger will overwrite one already registered from "+p)}return c("diag",u,e,!0)},e.disable=function(){p("diag",e)},e.createComponentLogger=function(t){return new g(t)},e.verbose=t("verbose"),e.debug=t("debug"),e.info=t("info"),e.warn=t("warn"),e.error=t("error")}return t.instance=function(){return this._instance||(this._instance=new t),this._instance},t}(),y=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s},b=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},E=function(){function t(t){this._entries=t?new Map(t):new Map}return t.prototype.getEntry=function(t){var e=this._entries.get(t);if(e)return Object.assign({},e)},t.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(t){var e=y(t,2);return[e[0],e[1]]})},t.prototype.setEntry=function(e,n){var r=new t(this._entries);return r._entries.set(e,n),r},t.prototype.removeEntry=function(e){var n=new t(this._entries);return n._entries.delete(e),n},t.prototype.removeEntries=function(){for(var e,n,r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];var i=new t(this._entries);try{for(var s=b(r),a=s.next();!a.done;a=s.next()){var u=a.value;i._entries.delete(u)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}return i},t.prototype.clear=function(){return new t},t}(),T=Symbol("BaggageEntryMetadata"),A=S.instance();function w(t){return void 0===t&&(t={}),new E(new Map(Object.entries(t)))}function O(t){return Symbol.for(t)}var C,R,L=function t(e){var n=this;n._currentContext=e?new Map(e):new Map,n.getValue=function(t){return n._currentContext.get(t)},n.setValue=function(e,r){var o=new t(n._currentContext);return o._currentContext.set(e,r),o},n.deleteValue=function(e){var r=new t(n._currentContext);return r._currentContext.delete(e),r}},P=new L,N=(C=function(t,e){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},C(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}C(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),x=function(){function t(){}return t.prototype.createGauge=function(t,e){return z},t.prototype.createHistogram=function(t,e){return q},t.prototype.createCounter=function(t,e){return $},t.prototype.createUpDownCounter=function(t,e){return G},t.prototype.createObservableGauge=function(t,e){return W},t.prototype.createObservableCounter=function(t,e){return K},t.prototype.createObservableUpDownCounter=function(t,e){return X},t.prototype.addBatchObservableCallback=function(t,e){},t.prototype.removeBatchObservableCallback=function(t){},t}(),D=function(){},I=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return N(e,t),e.prototype.add=function(t,e){},e}(D),k=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return N(e,t),e.prototype.add=function(t,e){},e}(D),M=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return N(e,t),e.prototype.record=function(t,e){},e}(D),U=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return N(e,t),e.prototype.record=function(t,e){},e}(D),j=function(){function t(){}return t.prototype.addCallback=function(t){},t.prototype.removeCallback=function(t){},t}(),B=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return N(e,t),e}(j),F=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return N(e,t),e}(j),H=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return N(e,t),e}(j),V=new x,$=new I,z=new M,q=new U,G=new k,K=new B,W=new F,X=new H,Q={get:function(t,e){if(null!=t)return t[e]},keys:function(t){return null==t?[]:Object.keys(t)}},Y={set:function(t,e,n){null!=t&&(t[e]=n)}},Z=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s},J=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},tt=function(){function t(){}return t.prototype.active=function(){return P},t.prototype.with=function(t,e,n){for(var r=[],o=3;o<arguments.length;o++)r[o-3]=arguments[o];return e.call.apply(e,J([n],Z(r),!1))},t.prototype.bind=function(t,e){return e},t.prototype.enable=function(){return this},t.prototype.disable=function(){return this},t}(),et=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s},nt=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},rt="context",ot=new tt,it=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalContextManager=function(t){return c(rt,t,S.instance())},t.prototype.active=function(){return this._getContextManager().active()},t.prototype.with=function(t,e,n){for(var r,o=[],i=3;i<arguments.length;i++)o[i-3]=arguments[i];return(r=this._getContextManager()).with.apply(r,nt([t,e,n],et(o),!1))},t.prototype.bind=function(t,e){return this._getContextManager().bind(t,e)},t.prototype._getContextManager=function(){return l(rt)||ot},t.prototype.disable=function(){this._getContextManager().disable(),p(rt,S.instance())},t}();!function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"}(R||(R={}));var st="0000000000000000",at="00000000000000000000000000000000",ut={traceId:at,spanId:st,traceFlags:R.NONE},ct=function(){function t(t){void 0===t&&(t=ut),this._spanContext=t}return t.prototype.spanContext=function(){return this._spanContext},t.prototype.setAttribute=function(t,e){return this},t.prototype.setAttributes=function(t){return this},t.prototype.addEvent=function(t,e){return this},t.prototype.addLink=function(t){return this},t.prototype.addLinks=function(t){return this},t.prototype.setStatus=function(t){return this},t.prototype.updateName=function(t){return this},t.prototype.end=function(t){},t.prototype.isRecording=function(){return!1},t.prototype.recordException=function(t,e){},t}(),lt=O("OpenTelemetry Context Key SPAN");function pt(t){return t.getValue(lt)||void 0}function dt(){return pt(it.getInstance().active())}function ht(t,e){return t.setValue(lt,e)}function ft(t){return t.deleteValue(lt)}function gt(t,e){return ht(t,new ct(e))}function mt(t){var e;return null===(e=pt(t))||void 0===e?void 0:e.spanContext()}var _t=/^([0-9a-f]{32})$/i,vt=/^[0-9a-f]{16}$/i;function St(t){return _t.test(t)&&t!==at}function yt(t){return St(t.traceId)&&(e=t.spanId,vt.test(e)&&e!==st);var e}function bt(t){return new ct(t)}var Et=it.getInstance(),Tt=function(){function t(){}return t.prototype.startSpan=function(t,e,n){if(void 0===n&&(n=Et.active()),Boolean(null==e?void 0:e.root))return new ct;var r,o=n&&mt(n);return"object"==typeof(r=o)&&"string"==typeof r.spanId&&"string"==typeof r.traceId&&"number"==typeof r.traceFlags&&yt(o)?new ct(o):new ct},t.prototype.startActiveSpan=function(t,e,n,r){var o,i,s;if(!(arguments.length<2)){2===arguments.length?s=e:3===arguments.length?(o=e,s=n):(o=e,i=n,s=r);var a=null!=i?i:Et.active(),u=this.startSpan(t,o,a),c=ht(a,u);return Et.with(c,s,void 0,u)}},t}();var At,wt,Ot,Ct=new Tt,Rt=function(){function t(t,e,n,r){this._provider=t,this.name=e,this.version=n,this.options=r}return t.prototype.startSpan=function(t,e,n){return this._getTracer().startSpan(t,e,n)},t.prototype.startActiveSpan=function(t,e,n,r){var o=this._getTracer();return Reflect.apply(o.startActiveSpan,o,arguments)},t.prototype._getTracer=function(){if(this._delegate)return this._delegate;var t=this._provider.getDelegateTracer(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):Ct},t}(),Lt=new(function(){function t(){}return t.prototype.getTracer=function(t,e,n){return new Tt},t}()),Pt=function(){function t(){}return t.prototype.getTracer=function(t,e,n){var r;return null!==(r=this.getDelegateTracer(t,e,n))&&void 0!==r?r:new Rt(this,t,e,n)},t.prototype.getDelegate=function(){var t;return null!==(t=this._delegate)&&void 0!==t?t:Lt},t.prototype.setDelegate=function(t){this._delegate=t},t.prototype.getDelegateTracer=function(t,e,n){var r;return null===(r=this._delegate)||void 0===r?void 0:r.getTracer(t,e,n)},t}();!function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(At||(At={})),function(t){t[t.INTERNAL=0]="INTERNAL",t[t.SERVER=1]="SERVER",t[t.CLIENT=2]="CLIENT",t[t.PRODUCER=3]="PRODUCER",t[t.CONSUMER=4]="CONSUMER"}(wt||(wt={})),function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"}(Ot||(Ot={}));var Nt=it.getInstance(),xt=S.instance(),Dt=new(function(){function t(){}return t.prototype.getMeter=function(t,e,n){return V},t}()),It="metrics",kt=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalMeterProvider=function(t){return c(It,t,S.instance())},t.prototype.getMeterProvider=function(){return l(It)||Dt},t.prototype.getMeter=function(t,e,n){return this.getMeterProvider().getMeter(t,e,n)},t.prototype.disable=function(){p(It,S.instance())},t}().getInstance(),Mt=function(){function t(){}return t.prototype.inject=function(t,e){},t.prototype.extract=function(t,e){return t},t.prototype.fields=function(){return[]},t}(),Ut=O("OpenTelemetry Baggage Key");function jt(t){return t.getValue(Ut)||void 0}function Bt(){return jt(it.getInstance().active())}function Ft(t,e){return t.setValue(Ut,e)}function Ht(t){return t.deleteValue(Ut)}var Vt="propagation",$t=new Mt,zt=function(){function t(){this.createBaggage=w,this.getBaggage=jt,this.getActiveBaggage=Bt,this.setBaggage=Ft,this.deleteBaggage=Ht}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalPropagator=function(t){return c(Vt,t,S.instance())},t.prototype.inject=function(t,e,n){return void 0===n&&(n=Y),this._getGlobalPropagator().inject(t,e,n)},t.prototype.extract=function(t,e,n){return void 0===n&&(n=Q),this._getGlobalPropagator().extract(t,e,n)},t.prototype.fields=function(){return this._getGlobalPropagator().fields()},t.prototype.disable=function(){p(Vt,S.instance())},t.prototype._getGlobalPropagator=function(){return l(Vt)||$t},t}(),qt=zt.getInstance(),Gt="trace",Kt=function(){function t(){this._proxyTracerProvider=new Pt,this.wrapSpanContext=bt,this.isSpanContextValid=yt,this.deleteSpan=ft,this.getSpan=pt,this.getActiveSpan=dt,this.getSpanContext=mt,this.setSpan=ht,this.setSpanContext=gt}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(t){var e=c(Gt,this._proxyTracerProvider,S.instance());return e&&this._proxyTracerProvider.setDelegate(t),e},t.prototype.getTracerProvider=function(){return l(Gt)||this._proxyTracerProvider},t.prototype.getTracer=function(t,e){return this.getTracerProvider().getTracer(t,e)},t.prototype.disable=function(){p(Gt,S.instance()),this._proxyTracerProvider=new Pt},t}().getInstance();const Wt=O("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Xt(t){return t.setValue(Wt,!0)}function Qt(t){return!0===t.getValue(Wt)}const Yt=",",Zt="baggage";function Jt(t){if(!t)return;const e=t.indexOf(";"),n=-1===e?t:t.substring(0,e),r=n.indexOf("=");if(r<=0)return;const o=n.substring(0,r).trim(),i=n.substring(r+1).trim();if(!o||!i)return;let s,a,u;try{s=decodeURIComponent(o),a=decodeURIComponent(i)}catch{return}if(-1!==e&&e<t.length-1){const n=t.substring(e+1);"string"!=typeof(c=n)&&(A.error("Cannot create baggage metadata from unknown type: "+typeof c),c=""),u={__TYPE__:T,toString:function(){return c}}}var c;return{key:s,value:a,metadata:u}}class te{inject(t,e,n){const r=qt.getBaggage(t);if(!r||Qt(t))return;const o=function(t){return t.getAllEntries().map(([t,e])=>{let n=`${encodeURIComponent(t)}=${encodeURIComponent(e.value)}`;return void 0!==e.metadata&&(n+=";"+e.metadata.toString()),n})}(r).filter(t=>t.length<=4096).slice(0,180),i=function(t){return t.reduce((t,e)=>{const n=`${t}${""!==t?Yt:""}${e}`;return n.length>8192?t:n},"")}(o);i.length>0&&n.set(e,Zt,i)}extract(t,e,n){const r=n.get(e,Zt),o=Array.isArray(r)?r.join(Yt):r;if(!o)return t;const i={};if(0===o.length)return t;return o.split(Yt).forEach(t=>{const e=Jt(t);if(e){const t={value:e.value};e.metadata&&(t.metadata=e.metadata),i[e.key]=t}}),0===Object.entries(i).length?t:qt.setBaggage(t,qt.createBaggage(i))}fields(){return[Zt]}}function ee(t){const e={};if("object"!=typeof t||null==t)return e;for(const n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;if(!ne(n)){xt.warn(`Invalid attribute key: ${n}`);continue}const r=t[n];re(r)?Array.isArray(r)?e[n]=r.slice():e[n]=r:xt.warn(`Invalid attribute value set for key: ${n}`)}return e}function ne(t){return"string"==typeof t&&""!==t}function re(t){return null==t||(Array.isArray(t)?function(t){let e;for(const n of t){if(null==n)continue;const t=typeof n;if(t!==e){if(!e){if(oe(t)){e=t;continue}return!1}return!1}}return!0}(t):oe(typeof t))}function oe(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}function ie(){return t=>{xt.error(function(t){return"string"==typeof t?t:JSON.stringify(function(t){const e={};let n=t;for(;null!==n;)Object.getOwnPropertyNames(n).forEach(t=>{if(e[t])return;const r=n[t];r&&(e[t]=String(r))}),n=Object.getPrototypeOf(n);return e}(t))}(t))}}let se=ie();function ae(t){try{se(t)}catch{}}function ue(t){}const ce=globalThis,le="error.type",pe="exception.message",de="exception.type",he="http.request.method",fe="http.request.method_original",ge="http.response.status_code",me="server.address",_e="server.port",ve="service.name",Se="telemetry.sdk.language",ye="telemetry.sdk.name",be="telemetry.sdk.version",Ee="url.full",Te="process.runtime.name",Ae={[ye]:"opentelemetry",[Te]:"browser",[Se]:"webjs",[be]:"2.5.0"},we=performance,Oe=Math.pow(10,6),Ce=Math.pow(10,9);function Re(t){const e=t/1e3;return[Math.trunc(e),Math.round(t%1e3*Oe)]}function Le(t){return ke(Re(we.timeOrigin),Re("number"==typeof t?t:we.now()))}function Pe(t){if(De(t))return t;if("number"==typeof t)return t<we.timeOrigin?Le(t):Re(t);if(t instanceof Date)return Re(t.getTime());throw TypeError("Invalid input type")}function Ne(t,e){let n=e[0]-t[0],r=e[1]-t[1];return r<0&&(n-=1,r+=Ce),[n,r]}function xe(t){return t[0]*Ce+t[1]}function De(t){return Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]}function Ie(t){return De(t)||"number"==typeof t||t instanceof Date}function ke(t,e){const n=[t[0]+e[0],t[1]+e[1]];return n[1]>=Ce&&(n[1]-=Ce,n[0]+=1),n}var Me;!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"}(Me||(Me={}));class Ue{_propagators;_fields;constructor(t={}){this._propagators=t.propagators??[],this._fields=Array.from(new Set(this._propagators.map(t=>"function"==typeof t.fields?t.fields():[]).reduce((t,e)=>t.concat(e),[])))}inject(t,e,n){for(const r of this._propagators)try{r.inject(t,e,n)}catch(t){xt.warn(`Failed to inject with ${r.constructor.name}. Err: ${t.message}`)}}extract(t,e,n){return this._propagators.reduce((t,r)=>{try{return r.extract(t,e,n)}catch(t){xt.warn(`Failed to extract with ${r.constructor.name}. Err: ${t.message}`)}return t},t)}fields(){return this._fields.slice()}}const je="[_0-9a-z-*/]",Be=new RegExp(`^(?:${`[a-z]${je}{0,255}`}|${`[a-z0-9]${je}{0,240}@[a-z]${je}{0,13}`})$`),Fe=/^[ -~]{0,255}[!-~]$/,He=/,|=/;class Ve{_internalState=new Map;constructor(t){t&&this._parse(t)}set(t,e){const n=this._clone();return n._internalState.has(t)&&n._internalState.delete(t),n._internalState.set(t,e),n}unset(t){const e=this._clone();return e._internalState.delete(t),e}get(t){return this._internalState.get(t)}serialize(){return this._keys().reduce((t,e)=>(t.push(e+"="+this.get(e)),t),[]).join(",")}_parse(t){t.length>512||(this._internalState=t.split(",").reverse().reduce((t,e)=>{const n=e.trim(),r=n.indexOf("=");if(-1!==r){const o=n.slice(0,r),i=n.slice(r+1,e.length);(function(t){return Be.test(t)})(o)&&function(t){return Fe.test(t)&&!He.test(t)}(i)&&t.set(o,i)}return t},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 t=new Ve;return t._internalState=new Map(this._internalState),t}}const $e="traceparent",ze="tracestate",qe=new RegExp("^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$");function Ge(t){const e=qe.exec(t);return e?"00"===e[1]&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}:null}class Ke{inject(t,e,n){const r=Kt.getSpanContext(t);if(!r||Qt(t)||!yt(r))return;const o=`00-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||R.NONE).toString(16)}`;n.set(e,$e,o),r.traceState&&n.set(e,ze,r.traceState.serialize())}extract(t,e,n){const r=n.get(e,$e);if(!r)return t;const o=Array.isArray(r)?r[0]:r;if("string"!=typeof o)return t;const i=Ge(o);if(!i)return t;i.isRemote=!0;const s=n.get(e,ze);if(s){const t=Array.isArray(s)?s.join(","):s;i.traceState=new Ve("string"==typeof t?t:void 0)}return Kt.setSpanContext(t,i)}fields(){return[$e,ze]}}const We=O("OpenTelemetry SDK Context Key RPC_METADATA");var Xe;!function(t){t.HTTP="http"}(Xe||(Xe={}));const Qe="[object Null]",Ye="[object Undefined]",Ze=Function.prototype.toString,Je=Ze.call(Object),tn=Object.getPrototypeOf,en=Object.prototype,nn=en.hasOwnProperty,rn=Symbol?Symbol.toStringTag:void 0,on=en.toString;function sn(t){if(!function(t){return null!=t&&"object"==typeof t}(t)||"[object Object]"!==function(t){if(null==t)return void 0===t?Ye:Qe;return rn&&rn in Object(t)?function(t){const e=nn.call(t,rn),n=t[rn];let r=!1;try{t[rn]=void 0,r=!0}catch{}const o=on.call(t);r&&(e?t[rn]=n:delete t[rn]);return o}(t):function(t){return on.call(t)}(t)}(t))return!1;const e=tn(t);if(null===e)return!0;const n=nn.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Ze.call(n)===Je}function an(...t){let e=t.shift();const n=new WeakMap;for(;t.length>0;)e=cn(e,t.shift(),0,n);return e}function un(t){return pn(t)?t.slice():t}function cn(t,e,n=0,r){let o;if(!(n>20)){if(n++,fn(t)||fn(e)||dn(e))o=un(e);else if(pn(t)){if(o=t.slice(),pn(e))for(let t=0,n=e.length;t<n;t++)o.push(un(e[t]));else if(hn(e)){const t=Object.keys(e);for(let n=0,r=t.length;n<r;n++){const r=t[n];o[r]=un(e[r])}}}else if(hn(t))if(hn(e)){if(!function(t,e){if(!sn(t)||!sn(e))return!1;return!0}(t,e))return e;o=Object.assign({},t);const i=Object.keys(e);for(let s=0,a=i.length;s<a;s++){const a=i[s],u=e[a];if(fn(u))void 0===u?delete o[a]:o[a]=u;else{const i=o[a],s=u;if(ln(t,a,r)||ln(e,a,r))delete o[a];else{if(hn(i)&&hn(s)){const n=r.get(i)||[],o=r.get(s)||[];n.push({obj:t,key:a}),o.push({obj:e,key:a}),r.set(i,n),r.set(s,o)}o[a]=cn(o[a],u,n,r)}}}}else o=e;return o}}function ln(t,e,n){const r=n.get(t[e])||[];for(let n=0,o=r.length;n<o;n++){const o=r[n];if(o.key===e&&o.obj===t)return!0}return!1}function pn(t){return Array.isArray(t)}function dn(t){return"function"==typeof t}function hn(t){return!fn(t)&&!pn(t)&&!dn(t)&&"object"==typeof t}function fn(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||void 0===t||t instanceof Date||t instanceof RegExp||null===t}class gn extends Error{constructor(t){super(t),Object.setPrototypeOf(this,gn.prototype)}}function mn(t,e){return"string"==typeof e?t===e:!!t.match(e)}function _n(t,e){if(!e)return!1;for(const n of e)if(mn(t,n))return!0;return!1}class vn{_promise;_resolve;_reject;constructor(){this._promise=new Promise((t,e)=>{this._resolve=t,this._reject=e})}get promise(){return this._promise}resolve(t){this._resolve(t)}reject(t){this._reject(t)}}class Sn{_isCalled=!1;_deferred=new vn;_callback;_that;constructor(t,e){this._callback=t,this._that=e}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...t){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...t)).then(t=>this._deferred.resolve(t),t=>this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}}const yn={ALL:d.ALL,VERBOSE:d.VERBOSE,DEBUG:d.DEBUG,INFO:d.INFO,WARN:d.WARN,ERROR:d.ERROR,NONE:d.NONE};const bn={_export:function(t,e){return new Promise(n=>{Nt.with(Xt(Nt.active()),()=>{t.export(e,t=>{n(t)})})})}};var En=Object.freeze({__proto__:null,AnchoredClock:class{_monotonicClock;_epochMillis;_performanceMillis;constructor(t,e){this._monotonicClock=e,this._epochMillis=t.now(),this._performanceMillis=e.now()}now(){const t=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+t}},BindOnceFuture:Sn,CompositePropagator:Ue,get ExportResultCode(){return Me},get RPCType(){return Xe},SDK_INFO:Ae,TRACE_PARENT_HEADER:$e,TRACE_STATE_HEADER:ze,TimeoutError:gn,TraceState:Ve,W3CBaggagePropagator:te,W3CTraceContextPropagator:Ke,_globalThis:ce,addHrTimes:ke,callWithTimeout:function(t,e){let n;const r=new Promise(function(t,r){n=setTimeout(function(){r(new gn("Operation timed out."))},e)});return Promise.race([t,r]).then(t=>(clearTimeout(n),t),t=>{throw clearTimeout(n),t})},deleteRPCMetadata:function(t){return t.deleteValue(We)},diagLogLevelFromString:function(t){if(null==t)return;const e=yn[t.toUpperCase()];return null==e?(xt.warn(`Unknown log level "${t}", expected one of ${Object.keys(yn)}, using default`),d.INFO):e},getBooleanFromEnv:function(t){},getNumberFromEnv:ue,getRPCMetadata:function(t){return t.getValue(We)},getStringFromEnv:function(t){},getStringListFromEnv:function(t){},getTimeOrigin:function(){return we.timeOrigin},globalErrorHandler:ae,hrTime:Le,hrTimeDuration:Ne,hrTimeToMicroseconds:function(t){return 1e6*t[0]+t[1]/1e3},hrTimeToMilliseconds:function(t){return 1e3*t[0]+t[1]/1e6},hrTimeToNanoseconds:xe,hrTimeToTimeStamp:function(t){const e=`${"0".repeat(9)}${t[1]}Z`,n=e.substring(e.length-9-1);return new Date(1e3*t[0]).toISOString().replace("000Z",n)},internal:bn,isAttributeValue:re,isTimeInput:Ie,isTimeInputHrTime:De,isTracingSuppressed:Qt,isUrlIgnored:_n,loggingErrorHandler:ie,merge:an,millisToHrTime:Re,otperformance:we,parseKeyPairsIntoRecord:function(t){const e={};return"string"==typeof t&&t.length>0&&t.split(Yt).forEach(t=>{const n=Jt(t);void 0!==n&&n.value.length>0&&(e[n.key]=n.value)}),e},parseTraceParent:Ge,sanitizeAttributes:ee,setGlobalErrorHandler:function(t){se=t},setRPCMetadata:function(t,e){return t.setValue(We,e)},suppressTracing:Xt,timeInputToHrTime:Pe,unrefTimer:function(t){"number"!=typeof t&&t.unref()},unsuppressTracing:function(t){return t.deleteValue(Wt)},urlMatches:mn});function Tn(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if("function"==typeof e){var n=function t(){var n=!1;try{n=this instanceof t}catch{}return n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(e){var r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,r.get?r:{enumerable:!0,get:function(){return t[e]}})}),n}var An,wn={},On={};function Cn(){if(An)return On;function t(t){return Object.keys(t).map(n=>e(n,t[n]))}function e(t,e){return{key:t,value:n(e)}}function n(t){const r=typeof t;return"string"===r?{stringValue:t}:"number"===r?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:"boolean"===r?{boolValue:t}:t instanceof Uint8Array?{bytesValue:t}:Array.isArray(t)?{arrayValue:{values:t.map(n)}}:"object"===r&&null!=t?{kvlistValue:{values:Object.entries(t).map(([t,n])=>e(t,n))}}:{}}return An=1,Object.defineProperty(On,"__esModule",{value:!0}),On.toAnyValue=On.toKeyValue=On.toAttributes=On.createInstrumentationScope=On.createResource=void 0,On.createResource=function(e){const n={attributes:t(e.attributes),droppedAttributesCount:0},r=e.schemaUrl;return r&&""!==r&&(n.schemaUrl=r),n},On.createInstrumentationScope=function(t){return{name:t.name,version:t.version}},On.toAttributes=t,On.toKeyValue=e,On.toAnyValue=n,On}var Rn,Ln,Pn,Nn={},xn=Tn(En),Dn={};function In(){if(Rn)return Dn;function t(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}return Rn=1,Object.defineProperty(Dn,"__esModule",{value:!0}),Dn.hexToBinary=void 0,Dn.hexToBinary=function(e){const n=new Uint8Array(e.length/2);let r=0;for(let o=0;o<e.length;o+=2){const i=t(e.charCodeAt(o)),s=t(e.charCodeAt(o+1));n[r++]=i<<4|s}return n},Dn}function kn(){if(Ln)return Nn;Ln=1,Object.defineProperty(Nn,"__esModule",{value:!0}),Nn.getOtlpEncoder=Nn.encodeAsString=Nn.encodeAsLongBits=Nn.toLongBits=Nn.hrTimeToNanos=void 0;const t=xn,e=In();function n(t){const e=BigInt(1e9);return BigInt(Math.trunc(t[0]))*e+BigInt(Math.trunc(t[1]))}function r(t){return{low:Number(BigInt.asUintN(32,t)),high:Number(BigInt.asUintN(32,t>>BigInt(32)))}}function o(t){return r(n(t))}function i(t){return n(t).toString()}Nn.hrTimeToNanos=n,Nn.toLongBits=r,Nn.encodeAsLongBits=o,Nn.encodeAsString=i;const s="undefined"!=typeof BigInt?i:t.hrTimeToNanoseconds;function a(t){return t}function u(t){if(void 0!==t)return(0,e.hexToBinary)(t)}const c={encodeHrTime:o,encodeSpanContext:e.hexToBinary,encodeOptionalSpanContext:u};return Nn.getOtlpEncoder=function(t){if(void 0===t)return c;const n=t.useLongBits??!0,r=t.useHex??!1;return{encodeHrTime:n?o:s,encodeSpanContext:r?a:e.hexToBinary,encodeOptionalSpanContext:r?a:u}},Nn}function Mn(){if(Pn)return wn;Pn=1,Object.defineProperty(wn,"__esModule",{value:!0}),wn.createExportTraceServiceRequest=wn.toOtlpSpanEvent=wn.toOtlpLink=wn.sdkSpanToOtlpSpan=void 0;const t=Cn(),e=kn();function n(t,e){let n=255&t|256;return e&&(n|=512),n}function r(e,r){const s=e.spanContext(),a=e.status,u=e.parentSpanContext?.spanId?r.encodeSpanContext(e.parentSpanContext?.spanId):void 0;return{traceId:r.encodeSpanContext(s.traceId),spanId:r.encodeSpanContext(s.spanId),parentSpanId:u,traceState:s.traceState?.serialize(),name:e.name,kind:null==e.kind?0:e.kind+1,startTimeUnixNano:r.encodeHrTime(e.startTime),endTimeUnixNano:r.encodeHrTime(e.endTime),attributes:(0,t.toAttributes)(e.attributes),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(t=>i(t,r)),droppedEventsCount:e.droppedEventsCount,status:{code:a.code,message:a.message},links:e.links.map(t=>o(t,r)),droppedLinksCount:e.droppedLinksCount,flags:n(s.traceFlags,e.parentSpanContext?.isRemote)}}function o(e,r){return{attributes:e.attributes?(0,t.toAttributes)(e.attributes):[],spanId:r.encodeSpanContext(e.context.spanId),traceId:r.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0,flags:n(e.context.traceFlags,e.context.isRemote)}}function i(e,n){return{attributes:e.attributes?(0,t.toAttributes)(e.attributes):[],name:e.name,timeUnixNano:n.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function s(e,n){const o=function(t){const e=new Map;for(const n of t){let t=e.get(n.resource);t||(t=new Map,e.set(n.resource,t));const r=`${n.instrumentationScope.name}@${n.instrumentationScope.version||""}:${n.instrumentationScope.schemaUrl||""}`;let o=t.get(r);o||(o=[],t.set(r,o)),o.push(n)}return e}(e),i=[],s=o.entries();let a=s.next();for(;!a.done;){const[e,o]=a.value,u=[],c=o.values();let l=c.next();for(;!l.done;){const e=l.value;if(e.length>0){const o=e.map(t=>r(t,n));u.push({scope:(0,t.createInstrumentationScope)(e[0].instrumentationScope),spans:o,schemaUrl:e[0].instrumentationScope.schemaUrl})}l=c.next()}const p=(0,t.createResource)(e),d={resource:p,scopeSpans:u,schemaUrl:p.schemaUrl};i.push(d),a=s.next()}return i}return wn.sdkSpanToOtlpSpan=r,wn.toOtlpLink=o,wn.toOtlpSpanEvent=i,wn.createExportTraceServiceRequest=function(t,n){return{resourceSpans:s(t,(0,e.getOtlpEncoder)(n))}},wn}var Un,jn=Mn(),Bn={};function Fn(){return Un||(Un=1,t=Bn,Object.defineProperty(t,"__esModule",{value:!0}),t.EStatusCode=t.ESpanKind=void 0,(e=t.ESpanKind||(t.ESpanKind={}))[e.SPAN_KIND_UNSPECIFIED=0]="SPAN_KIND_UNSPECIFIED",e[e.SPAN_KIND_INTERNAL=1]="SPAN_KIND_INTERNAL",e[e.SPAN_KIND_SERVER=2]="SPAN_KIND_SERVER",e[e.SPAN_KIND_CLIENT=3]="SPAN_KIND_CLIENT",e[e.SPAN_KIND_PRODUCER=4]="SPAN_KIND_PRODUCER",e[e.SPAN_KIND_CONSUMER=5]="SPAN_KIND_CONSUMER",(n=t.EStatusCode||(t.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"),Bn;var t,e,n}var Hn=Fn();class Vn{constructor(t){this.config=t}export(t,n){const r=jn.createExportTraceServiceRequest(t,{useHex:!0,useLongBits:!1});this.config.api.pushTraces(r),function(t=[],n){var r,o;for(const i of t){const{scopeSpans:t}=i;for(const i of t){const{scope:t,spans:s=[]}=i;for(const i of s){if(i.kind!==Hn.ESpanKind.SPAN_KIND_CLIENT)continue;const s={traceId:i.traceId.toString(),spanId:i.spanId.toString()},a={};for(const t of i.attributes)a[t.key]=String(Object.values(t.value)[0]);Number.isNaN(i.endTimeUnixNano)||Number.isNaN(i.startTimeUnixNano)||(a.duration_ns=String(Number(i.endTimeUnixNano)-Number(i.startTimeUnixNano)));const u=(null!==(r=null==t?void 0:t.name)&&void 0!==r?r:"").indexOf("-");let c=e.unknownString;(null==t?void 0:t.name)&&(-1===u&&(c=null!==(o=t.name.split("/")[1])&&void 0!==o?o:t.name),u>-1&&(c=null==t?void 0:t.name.substring(u+1))),n.pushEvent(`faro.tracing.${c}`,a,void 0,{spanContext:s,timestampOverwriteMs:Number(i.endTimeUnixNano)/1e6,customPayloadTransformer:t=>{var e,n;return null!=a["faro.action.user.name"]&&null!=a["faro.action.user.parentId"]&&(t.action={name:a["faro.action.user.name"],parentId:a["faro.action.user.parentId"]},null===(e=t.attributes)||void 0===e||delete e["faro.action.user.name"],null===(n=t.attributes)||void 0===n||delete n["faro.action.user.parentId"]),t}})}}}}(r.resourceSpans,this.config.api),n({code:Me.SUCCESS})}shutdown(){return Promise.resolve(void 0)}}"function"==typeof SuppressedError&&SuppressedError;class $n{emit(t){}}const zn=new $n,qn=Symbol.for("io.opentelemetry.js.api.logs"),Gn=globalThis;const Kn=new class{getLogger(t,e,n){return new $n}};class Wn{constructor(t,e,n,r){this._provider=t,this.name=e,this.version=n,this.options=r}emit(t){this._getLogger().emit(t)}_getLogger(){if(this._delegate)return this._delegate;const t=this._provider._getDelegateLogger(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):zn}}class Xn{getLogger(t,e,n){var r;return null!==(r=this._getDelegateLogger(t,e,n))&&void 0!==r?r:new Wn(this,t,e,n)}_getDelegate(){var t;return null!==(t=this._delegate)&&void 0!==t?t:Kn}_setDelegate(t){this._delegate=t}_getDelegateLogger(t,e,n){var r;return null===(r=this._delegate)||void 0===r?void 0:r.getLogger(t,e,n)}}class Qn{constructor(){this._proxyLoggerProvider=new Xn}static getInstance(){return this._instance||(this._instance=new Qn),this._instance}setGlobalLoggerProvider(t){return Gn[qn]?this.getLoggerProvider():(Gn[qn]=(e=1,n=t,r=Kn,t=>t===e?n:r),this._proxyLoggerProvider._setDelegate(t),t);var e,n,r}getLoggerProvider(){var t,e;return null!==(e=null===(t=Gn[qn])||void 0===t?void 0:t.call(Gn,1))&&void 0!==e?e:this._proxyLoggerProvider}getLogger(t,e,n){return this.getLoggerProvider().getLogger(t,e,n)}disable(){delete Gn[qn],this._proxyLoggerProvider=new Xn}}const Yn=Qn.getInstance();let Zn=console.error.bind(console);function Jn(t,e,n){const r=!!t[e]&&Object.prototype.propertyIsEnumerable.call(t,e);Object.defineProperty(t,e,{configurable:!0,enumerable:r,writable:!0,value:n})}const tr=(t,e,n)=>{if(!t||!t[e])return void Zn("no original function "+String(e)+" to wrap");if(!n)return Zn("no wrapper function"),void Zn((new Error).stack);const r=t[e];if("function"!=typeof r||"function"!=typeof n)return void Zn("original object and wrapper must be functions");const o=n(r,e);return Jn(o,"__original",r),Jn(o,"__unwrap",()=>{t[e]===o&&Jn(t,e,r)}),Jn(o,"__wrapped",!0),Jn(t,e,o),o},er=(t,e,n)=>{if(!t)return Zn("must provide one or more modules to patch"),void Zn((new Error).stack);Array.isArray(t)||(t=[t]),e&&Array.isArray(e)?t.forEach(t=>{e.forEach(e=>{tr(t,e,n)})}):Zn("must provide one or more functions to wrap on modules")},nr=(t,e)=>{if(!t||!t[e])return Zn("no function to unwrap."),void Zn((new Error).stack);const n=t[e];n.__unwrap?n.__unwrap():Zn("no original to unwrap to -- has "+String(e)+" already been unwrapped?")},rr=(t,e)=>{if(!t)return Zn("must provide one or more modules to patch"),void Zn((new Error).stack);Array.isArray(t)||(t=[t]),e&&Array.isArray(e)?t.forEach(t=>{e.forEach(e=>{nr(t,e)})}):Zn("must provide one or more functions to unwrap on modules")};class or{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(t,e,n){this.instrumentationName=t,this.instrumentationVersion=e,this.setConfig(n),this._diag=xt.createComponentLogger({namespace:t}),this._tracer=Kt.getTracer(t,e),this._meter=kt.getMeter(t,e),this._logger=Yn.getLogger(t,e),this._updateMetricInstruments()}_wrap=tr;_unwrap=nr;_massWrap=er;_massUnwrap=rr;get meter(){return this._meter}setMeterProvider(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(t){this._logger=t.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){const t=this.init()??[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(t){this._config={enabled:!0,...t}}setTracerProvider(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(t,e,n,r){if(t)try{t(n,r)}catch(t){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:e},t)}}}class ir extends or{constructor(t,e,n){super(t,e,n),this._config.enabled&&this.enable()}}function sr(t,e,n){let r,o;try{o=t()}catch(t){r=t}finally{return e(r,o),o}}function ar(t){return"function"==typeof t&&"function"==typeof t.__original&&"function"==typeof t.__unwrap&&!0===t.__wrapped}var ur;function cr(t,e){let n=ur.OLD;const r=e?.split(",").map(t=>t.trim()).filter(t=>""!==t);for(const e of r??[]){if(e.toLowerCase()===t+"/dup"){n=ur.DUPLICATE;break}e.toLowerCase()===t&&(n=ur.STABLE)}return n}let lr;function pr(){if(void 0===lr)try{const t=globalThis.process.argv0;lr=t?`unknown_service:${t}`:"unknown_service"}catch{lr="unknown_service"}return lr}!function(t){t[t.STABLE=1]="STABLE",t[t.OLD=2]="OLD",t[t.DUPLICATE=3]="DUPLICATE"}(ur||(ur={}));const dr=t=>null!==t&&"object"==typeof t&&"function"==typeof t.then;class hr{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(t,e){const n=new hr({},e);return n._rawAttributes=mr(t),n._asyncAttributesPending=t.filter(([t,e])=>dr(e)).length>0,n}constructor(t,e){const n=t.attributes??{};this._rawAttributes=Object.entries(n).map(([t,e])=>(dr(e)&&(this._asyncAttributesPending=!0),[t,e])),this._rawAttributes=mr(this._rawAttributes),this._schemaUrl=function(t){if("string"==typeof t||void 0===t)return t;return void xt.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",t)}(e?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let t=0;t<this._rawAttributes.length;t++){const[e,n]=this._rawAttributes[t];this._rawAttributes[t]=[e,dr(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&xt.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const t={};for(const[e,n]of this._rawAttributes)dr(n)?xt.debug(`Unsettled resource attribute ${e} skipped`):null!=n&&(t[e]??=n);return this._asyncAttributesPending||(this._memoizedAttributes=t),t}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(null==t)return this;const e=function(t,e){const n=t?.schemaUrl,r=e?.schemaUrl,o=void 0===n||""===n,i=void 0===r||""===r;if(o)return r;if(i)return n;if(n===r)return n;return void xt.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',n,r)}(this,t),n=e?{schemaUrl:e}:void 0;return hr.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],n)}}function fr(t,e){return hr.FromAttributeList(Object.entries(t),e)}function gr(){return fr({[ve]:pr(),[Se]:Ae[Se],[ye]:Ae[ye],[be]:Ae[be]})}function mr(t){return t.map(([t,e])=>dr(e)?[t,e.catch(e=>{xt.debug("promise rejection for resource attribute: %s - %s",t,e)})]:[t,e])}class _r{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;name;status={code:Ot.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(t){const e=Date.now();this._spanContext=t.spanContext,this._performanceStartTime=we.now(),this._performanceOffset=e-(this._performanceStartTime+we.timeOrigin),this._startTimeProvided=null!=t.startTime,this._spanLimits=t.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0,this._spanProcessor=t.spanProcessor,this.name=t.name,this.parentSpanContext=t.parentSpanContext,this.kind=t.kind,this.links=t.links||[],this.startTime=this._getTime(t.startTime??e),this.resource=t.resource,this.instrumentationScope=t.scope,null!=t.attributes&&this.setAttributes(t.attributes),this._spanProcessor.onStart(this,t.context)}spanContext(){return this._spanContext}setAttribute(t,e){if(null==e||this._isSpanEnded())return this;if(0===t.length)return xt.warn(`Invalid attribute key: ${t}`),this;if(!re(e))return xt.warn(`Invalid attribute value set for key: ${t}`),this;const{attributeCountLimit:n}=this._spanLimits;return void 0!==n&&Object.keys(this.attributes).length>=n&&!Object.prototype.hasOwnProperty.call(this.attributes,t)?(this._droppedAttributesCount++,this):(this.attributes[t]=this._truncateToSize(e),this)}setAttributes(t){for(const[e,n]of Object.entries(t))this.setAttribute(e,n);return this}addEvent(t,e,n){if(this._isSpanEnded())return this;const{eventCountLimit:r}=this._spanLimits;if(0===r)return xt.warn("No events allowed."),this._droppedEventsCount++,this;void 0!==r&&this.events.length>=r&&(0===this._droppedEventsCount&&xt.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),Ie(e)&&(Ie(n)||(n=e),e=void 0);const o=ee(e);return this.events.push({name:t,attributes:o,time:this._getTime(n),droppedAttributesCount:0}),this}addLink(t){return this.links.push(t),this}addLinks(t){return this.links.push(...t),this}setStatus(t){return this._isSpanEnded()||(this.status={...t},null!=this.status.message&&"string"!=typeof t.message&&(xt.warn(`Dropping invalid status.message of type '${typeof t.message}', expected 'string'`),delete this.status.message)),this}updateName(t){return this._isSpanEnded()||(this.name=t),this}end(t){this._isSpanEnded()?xt.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`):(this.endTime=this._getTime(t),this._duration=Ne(this.startTime,this.endTime),this._duration[0]<0&&(xt.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&&xt.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),this._ended=!0,this._spanProcessor.onEnd(this))}_getTime(t){if("number"==typeof t&&t<=we.now())return Le(t+this._performanceOffset);if("number"==typeof t)return Re(t);if(t instanceof Date)return Re(t.getTime());if(De(t))return t;if(this._startTimeProvided)return Re(Date.now());const e=we.now()-this._performanceStartTime;return ke(this.startTime,Re(e))}isRecording(){return!1===this._ended}recordException(t,e){const n={};"string"==typeof t?n[pe]=t:t&&(t.code?n[de]=t.code.toString():t.name&&(n[de]=t.name),t.message&&(n[pe]=t.message),t.stack&&(n["exception.stacktrace"]=t.stack)),n[de]||n[pe]?this.addEvent("exception",n,e):xt.warn(`Failed to record an exception ${t}`)}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 t=new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);xt.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,t)}return this._ended}_truncateToLimitUtil(t,e){return t.length<=e?t:t.substring(0,e)}_truncateToSize(t){const e=this._attributeValueLengthLimit;return e<=0?(xt.warn(`Attribute value limit must be positive, got ${e}`),t):"string"==typeof t?this._truncateToLimitUtil(t,e):Array.isArray(t)?t.map(t=>"string"==typeof t?this._truncateToLimitUtil(t,e):t):t}}var vr,Sr;!function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(vr||(vr={}));class yr{shouldSample(){return{decision:vr.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class br{shouldSample(){return{decision:vr.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class Er{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(t){this._root=t.root,this._root||(ae(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new br),this._remoteParentSampled=t.remoteParentSampled??new br,this._remoteParentNotSampled=t.remoteParentNotSampled??new yr,this._localParentSampled=t.localParentSampled??new br,this._localParentNotSampled=t.localParentNotSampled??new yr}shouldSample(t,e,n,r,o,i){const s=Kt.getSpanContext(t);return s&&yt(s)?s.isRemote?s.traceFlags&R.SAMPLED?this._remoteParentSampled.shouldSample(t,e,n,r,o,i):this._remoteParentNotSampled.shouldSample(t,e,n,r,o,i):s.traceFlags&R.SAMPLED?this._localParentSampled.shouldSample(t,e,n,r,o,i):this._localParentNotSampled.shouldSample(t,e,n,r,o,i):this._root.shouldSample(t,e,n,r,o,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}class Tr{_ratio;_upperBound;constructor(t=0){this._ratio=this._normalize(t),this._upperBound=Math.floor(4294967295*this._ratio)}shouldSample(t,e){return{decision:St(e)&&this._accumulate(e)<this._upperBound?vr.RECORD_AND_SAMPLED:vr.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(t){return"number"!=typeof t||isNaN(t)?0:t>=1?1:t<=0?0:t}_accumulate(t){let e=0;for(let n=0;n<t.length/8;n++){const r=8*n;e=(e^parseInt(t.slice(r,r+8),16))>>>0}return e}}!function(t){t.AlwaysOff="always_off",t.AlwaysOn="always_on",t.ParentBasedAlwaysOff="parentbased_always_off",t.ParentBasedAlwaysOn="parentbased_always_on",t.ParentBasedTraceIdRatio="parentbased_traceidratio",t.TraceIdRatio="traceidratio"}(Sr||(Sr={}));function Ar(){return{sampler:wr(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function wr(){const t=Sr.ParentBasedAlwaysOn;switch(t){case Sr.AlwaysOn:return new br;case Sr.AlwaysOff:return new yr;case Sr.ParentBasedAlwaysOn:return new Er({root:new br});case Sr.ParentBasedAlwaysOff:return new Er({root:new yr});case Sr.TraceIdRatio:return new Tr(Or());case Sr.ParentBasedTraceIdRatio:return new Er({root:new Tr(Or())});default:return xt.error(`OTEL_TRACES_SAMPLER value "${t}" invalid, defaulting to "${Sr.ParentBasedAlwaysOn}".`),new Er({root:new br})}}function Or(){return xt.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to 1."),1}const Cr=1/0;class Rr{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(t,e){this._exporter=t,this._maxExportBatchSize="number"==typeof e?.maxExportBatchSize?e.maxExportBatchSize:512,this._maxQueueSize="number"==typeof e?.maxQueueSize?e.maxQueueSize:2048,this._scheduledDelayMillis="number"==typeof e?.scheduledDelayMillis?e.scheduledDelayMillis:5e3,this._exportTimeoutMillis="number"==typeof e?.exportTimeoutMillis?e.exportTimeoutMillis:3e4,this._shutdownOnce=new Sn(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(xt.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(t,e){}onEnd(t){this._shutdownOnce.isCalled||0!==(t.spanContext().traceFlags&R.SAMPLED)&&this._addToBuffer(t)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(t){if(this._finishedSpans.length>=this._maxQueueSize)return 0===this._droppedSpansCount&&xt.debug("maxQueueSize reached, dropping spans"),void this._droppedSpansCount++;this._droppedSpansCount>0&&(xt.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(t),this._maybeStartTimer()}_flushAll(){return new Promise((t,e)=>{const n=[];for(let t=0,e=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);t<e;t++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{t()}).catch(e)})}_flushOneBatch(){return this._clearTimer(),0===this._finishedSpans.length?Promise.resolve():new Promise((t,e)=>{const n=setTimeout(()=>{e(new Error("Timeout"))},this._exportTimeoutMillis);Nt.with(Xt(Nt.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);const o=()=>this._exporter.export(r,r=>{clearTimeout(n),r.code===Me.SUCCESS?t():e(r.error??new Error("BatchSpanProcessor: span export failed"))});let i=null;for(let t=0,e=r.length;t<e;t++){const e=r[t];e.resource.asyncAttributesPending&&e.resource.waitForAsyncAttributes&&(i??=[],i.push(e.resource.waitForAsyncAttributes()))}null===i?o():Promise.all(i).then(o,t=>{ae(t),e(t)})})})}_maybeStartTimer(){if(this._isExporting)return;const t=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(t=>{this._isExporting=!1,ae(t)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return t();void 0===this._timer&&(this._timer=setTimeout(()=>t(),this._scheduledDelayMillis),"number"!=typeof this._timer&&this._timer.unref())}_clearTimer(){void 0!==this._timer&&(clearTimeout(this._timer),this._timer=void 0)}}class Lr extends Rr{_visibilityChangeListener;_pageHideListener;constructor(t,e){super(t,e),this.onInit(e)}onInit(t){!0!==t?.disableAutoFlushOnDocumentHide&&"undefined"!=typeof document&&(this._visibilityChangeListener=()=>{"hidden"===document.visibilityState&&this.forceFlush().catch(t=>{ae(t)})},this._pageHideListener=()=>{this.forceFlush().catch(t=>{ae(t)})},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 Pr{generateTraceId=xr(16);generateSpanId=xr(8)}const Nr=Array(32);function xr(t){return function(){for(let e=0;e<2*t;e++)Nr[e]=Math.floor(16*Math.random())+48,Nr[e]>=58&&(Nr[e]+=39);return String.fromCharCode.apply(null,Nr.slice(0,2*t))}}class Dr{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;constructor(t,e,n,r){const o=function(t){const e={sampler:wr()},n=Ar(),r=Object.assign({},n,e,t);return r.generalLimits=Object.assign({},n.generalLimits,t.generalLimits||{}),r.spanLimits=Object.assign({},n.spanLimits,t.spanLimits||{}),r}(e);this._sampler=o.sampler,this._generalLimits=o.generalLimits,this._spanLimits=o.spanLimits,this._idGenerator=e.idGenerator||new Pr,this._resource=n,this._spanProcessor=r,this.instrumentationScope=t}startSpan(t,e={},n=Nt.active()){e.root&&(n=Kt.deleteSpan(n));const r=Kt.getSpan(n);if(Qt(n)){xt.debug("Instrumentation suppressed, returning Noop Span");return Kt.wrapSpanContext(ut)}const o=r?.spanContext(),i=this._idGenerator.generateSpanId();let s,a,u;o&&Kt.isSpanContextValid(o)?(a=o.traceId,u=o.traceState,s=o):a=this._idGenerator.generateTraceId();const c=e.kind??wt.INTERNAL,l=(e.links??[]).map(t=>({context:t.context,attributes:ee(t.attributes)})),p=ee(e.attributes),d=this._sampler.shouldSample(n,a,t,c,p,l);u=d.traceState??u;const h={traceId:a,spanId:i,traceFlags:d.decision===At.RECORD_AND_SAMPLED?R.SAMPLED:R.NONE,traceState:u};if(d.decision===At.NOT_RECORD){xt.debug("Recording is off, propagating context in a non-recording span");return Kt.wrapSpanContext(h)}const f=ee(Object.assign(p,d.attributes));return new _r({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:h,name:t,kind:c,links:l,parentSpanContext:s,attributes:f,startTime:e.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits})}startActiveSpan(t,e,n,r){let o,i,s;if(arguments.length<2)return;2===arguments.length?s=e:3===arguments.length?(o=e,s=n):(o=e,i=n,s=r);const a=i??Nt.active(),u=this.startSpan(t,o,a),c=Kt.setSpan(a,u);return Nt.with(c,s,void 0,u)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}class Ir{_spanProcessors;constructor(t){this._spanProcessors=t}forceFlush(){const t=[];for(const e of this._spanProcessors)t.push(e.forceFlush());return new Promise(e=>{Promise.all(t).then(()=>{e()}).catch(t=>{ae(t||new Error("MultiSpanProcessor: forceFlush failed")),e()})})}onStart(t,e){for(const n of this._spanProcessors)n.onStart(t,e)}onEnding(t){for(const e of this._spanProcessors)e.onEnding&&e.onEnding(t)}onEnd(t){for(const e of this._spanProcessors)e.onEnd(t)}shutdown(){const t=[];for(const e of this._spanProcessors)t.push(e.shutdown());return new Promise((e,n)=>{Promise.all(t).then(()=>{e()},n)})}}var kr,Mr;!function(t){t[t.resolved=0]="resolved",t[t.timeout=1]="timeout",t[t.error=2]="error",t[t.unresolved=3]="unresolved"}(kr||(kr={}));class Ur{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(t={}){const e=an({},Ar(),function(t){const e=Object.assign({},t.spanLimits);return e.attributeCountLimit=t.spanLimits?.attributeCountLimit??t.generalLimits?.attributeCountLimit??void 0??void 0??128,e.attributeValueLengthLimit=t.spanLimits?.attributeValueLengthLimit??t.generalLimits?.attributeValueLengthLimit??void 0??void 0??Cr,Object.assign({},t,{spanLimits:e})}(t));this._resource=e.resource??gr(),this._config=Object.assign({},e,{resource:this._resource});const n=[];t.spanProcessors?.length&&n.push(...t.spanProcessors),this._activeSpanProcessor=new Ir(n)}getTracer(t,e,n){const r=`${t}@${e||""}:${n?.schemaUrl||""}`;return this._tracers.has(r)||this._tracers.set(r,new Dr({name:t,version:e,schemaUrl:n?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(r)}forceFlush(){const t=this._config.forceFlushTimeoutMillis,e=this._activeSpanProcessor._spanProcessors.map(e=>new Promise(n=>{let r;const o=setTimeout(()=>{n(new Error(`Span processor did not completed within timeout period of ${t} ms`)),r=kr.timeout},t);e.forceFlush().then(()=>{clearTimeout(o),r!==kr.timeout&&(r=kr.resolved,n(r))}).catch(t=>{clearTimeout(o),r=kr.error,n(t)})}));return new Promise((t,n)=>{Promise.all(e).then(e=>{const r=e.filter(t=>t!==kr.resolved);r.length>0?n(r):t()}).catch(t=>n([t]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}class jr{_enabled=!1;_currentContext=P;_bindFunction(t=P,e){const n=this,r=function(...r){return n.with(t,()=>e.apply(this,r))};return Object.defineProperty(r,"length",{enumerable:!1,configurable:!0,writable:!1,value:e.length}),r}active(){return this._currentContext}bind(t,e){return void 0===t&&(t=this.active()),"function"==typeof e?this._bindFunction(t,e):e}disable(){return this._currentContext=P,this._enabled=!1,this}enable(){return this._enabled||(this._enabled=!0,this._currentContext=P),this}with(t,e,n,...r){const o=this._currentContext;this._currentContext=t||P;try{return e.call(n,...r)}finally{this._currentContext=o}}}class Br extends Ur{constructor(t={}){super(t)}register(t={}){var e;Kt.setGlobalTracerProvider(this),null!==(e=t.propagator)&&(void 0!==e?qt.setGlobalPropagator(e):qt.setGlobalPropagator(new Ue({propagators:[new Ke,new te]}))),function(t){if(null!==t){if(void 0===t){const t=new jr;return t.enable(),void Nt.setGlobalContextManager(t)}t.enable(),Nt.setGlobalContextManager(t)}}(t.contextManager)}}!function(t){t.CONNECT_END="connectEnd",t.CONNECT_START="connectStart",t.DECODED_BODY_SIZE="decodedBodySize",t.DOM_COMPLETE="domComplete",t.DOM_CONTENT_LOADED_EVENT_END="domContentLoadedEventEnd",t.DOM_CONTENT_LOADED_EVENT_START="domContentLoadedEventStart",t.DOM_INTERACTIVE="domInteractive",t.DOMAIN_LOOKUP_END="domainLookupEnd",t.DOMAIN_LOOKUP_START="domainLookupStart",t.ENCODED_BODY_SIZE="encodedBodySize",t.FETCH_START="fetchStart",t.LOAD_EVENT_END="loadEventEnd",t.LOAD_EVENT_START="loadEventStart",t.NAVIGATION_START="navigationStart",t.REDIRECT_END="redirectEnd",t.REDIRECT_START="redirectStart",t.REQUEST_START="requestStart",t.RESPONSE_END="responseEnd",t.RESPONSE_START="responseStart",t.SECURE_CONNECTION_START="secureConnectionStart",t.START_TIME="startTime",t.UNLOAD_EVENT_END="unloadEventEnd",t.UNLOAD_EVENT_START="unloadEventStart"}(Mr||(Mr={}));let Fr;function Hr(t,e,n,r=!0){if(!(o=n,i=e,!(i in o)||"number"!=typeof n[e]||r&&0===n[e]))return t.addEvent(e,n[e]);var o,i}function Vr(t,e,n=!1,r,o){if(void 0===r&&(r=0!==e[Mr.START_TIME]),n||(Hr(t,Mr.FETCH_START,e,r),Hr(t,Mr.DOMAIN_LOOKUP_START,e,r),Hr(t,Mr.DOMAIN_LOOKUP_END,e,r),Hr(t,Mr.CONNECT_START,e,r),Hr(t,Mr.SECURE_CONNECTION_START,e,r),Hr(t,Mr.CONNECT_END,e,r),Hr(t,Mr.REQUEST_START,e,r),Hr(t,Mr.RESPONSE_START,e,r),Hr(t,Mr.RESPONSE_END,e,r)),!o){const n=e[Mr.ENCODED_BODY_SIZE];void 0!==n&&t.setAttribute("http.response_content_length",n);const r=e[Mr.DECODED_BODY_SIZE];void 0!==r&&n!==r&&t.setAttribute("http.response_content_length_uncompressed",r)}}function $r(){return"undefined"!=typeof location?location.origin:void 0}function zr(t,e,n,r,o=new WeakSet,i){const s=qr(t),a=function(t,e,n,r,o,i){const s=xe(e),a=xe(n);let u=r.filter(e=>{const n=xe(Pe(e[Mr.FETCH_START])),r=xe(Pe(e[Mr.RESPONSE_END]));return e.initiatorType.toLowerCase()===(i||"xmlhttprequest")&&e.name===t&&n>=s&&r<=a});u.length>0&&(u=u.filter(t=>!o.has(t)));return u}(t=s.toString(),e,n,r,o,i);if(0===a.length)return{mainRequest:void 0};if(1===a.length)return{mainRequest:a[0]};const u=function(t){return t.slice().sort((t,e)=>{const n=t[Mr.FETCH_START],r=e[Mr.FETCH_START];return n>r?1:n<r?-1:0})}(a);if(s.origin!==$r()&&u.length>1){let t=u[0],e=function(t,e,n){const r=xe(n),o=xe(Pe(e));let i,s=t[1];const a=t.length;for(let e=1;e<a;e++){const n=t[e],a=xe(Pe(n[Mr.FETCH_START])),u=r-xe(Pe(n[Mr.RESPONSE_END]));a>=o&&(!i||u<i)&&(i=u,s=n)}return s}(u,t[Mr.RESPONSE_END],n);const r=t[Mr.RESPONSE_END];return e[Mr.FETCH_START]<r&&(e=t,t=void 0),{corsPreFlightRequest:t,mainRequest:e}}return{mainRequest:a[0]}}function qr(t){if("function"==typeof URL)return new URL(t,"undefined"!=typeof document?document.baseURI:"undefined"!=typeof location?location.href:void 0);const e=(Fr||(Fr=document.createElement("a")),Fr);return e.href=t,e}function Gr(t,e){let n=e||[];("string"==typeof n||n instanceof RegExp)&&(n=[n]);return qr(t).origin===$r()||n.some(e=>mn(t,e))}var Kr;!function(t){t.COMPONENT="component",t.HTTP_STATUS_TEXT="http.status_text"}(Kr||(Kr={}));const Wr=xt.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-fetch/utils"});function Xr(...t){if(t[0]instanceof URL||"string"==typeof t[0]){const e=t[1];if(!e?.body)return Promise.resolve();if(e.body instanceof ReadableStream){const{body:t,length:n}=function(t){if(!t.pipeThrough)return Wr.warn("Platform has ReadableStream but not pipeThrough!"),{body:t,length:Promise.resolve(void 0)};let e,n=0;const r=new Promise(t=>{e=t}),o=new TransformStream({start(){},async transform(t,e){const r=await t;n+=r.byteLength,e.enqueue(t)},flush(){e(n)}});return{body:t.pipeThrough(o),length:r}}(e.body);return e.body=t,n}return Promise.resolve(function(t){if(e=t,"undefined"!=typeof Document&&e instanceof Document)return(new XMLSerializer).serializeToString(document).length;var e;if("string"==typeof t)return Yr(t);if(t instanceof Blob)return t.size;if(t instanceof FormData)return function(t){let e=0;for(const[n,r]of t.entries())e+=n.length,r instanceof Blob?e+=r.size:e+=r.length;return e}(t);if(t instanceof URLSearchParams)return Yr(t.toString());if(void 0!==t.byteLength)return t.byteLength;return void Wr.warn("unknown body type")}(e.body))}{const e=t[0];return e?.body?e.clone().text().then(t=>Yr(t)):Promise.resolve()}}const Qr=new TextEncoder;function Yr(t){return Qr.encode(t).byteLength}function Zr(t){const e=function(){void 0===to&&(to=Jr);return to}(),n=t.toUpperCase();return n in e?n:"_OTHER"}const Jr={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0};let to;const eo={"https:":"443","http:":"80"};const no="0.211.0",ro="undefined"!=typeof PerformanceObserver;class oo extends ir{component="fetch";version=no;moduleName=this.component;_usedResources=new WeakSet;_tasksCount=0;_semconvStability;constructor(t={}){super("@opentelemetry/instrumentation-fetch",no,t),this._semconvStability=cr("http",t?.semconvStabilityOptIn)}init(){}_addChildSpan(t,e){const n=this.tracer.startSpan("CORS Preflight",{startTime:e[Mr.FETCH_START]},Kt.setSpan(Nt.active(),t)),r=!(this._semconvStability&ur.OLD);Vr(n,e,this.getConfig().ignoreNetworkEvents,void 0,r),n.end(e[Mr.RESPONSE_END])}_addFinalSpanAttributes(t,e){const n=qr(e.url);if(this._semconvStability&ur.OLD&&(t.setAttribute("http.status_code",e.status),null!=e.statusText&&t.setAttribute(Kr.HTTP_STATUS_TEXT,e.statusText),t.setAttribute("http.host",n.host),t.setAttribute("http.scheme",n.protocol.replace(":","")),"undefined"!=typeof navigator&&t.setAttribute("http.user_agent",navigator.userAgent)),this._semconvStability&ur.STABLE){t.setAttribute(ge,e.status),t.setAttribute(me,n.hostname);const r=function(t){const e=Number(t.port||eo[t.protocol]);return e&&!isNaN(e)?e:void 0}(n);r&&t.setAttribute(_e,r)}}_addHeaders(t,e){if(!Gr(e,this.getConfig().propagateTraceHeaderCorsUrls)){const t={};return qt.inject(Nt.active(),t),void(Object.keys(t).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}if(t instanceof Request)qt.inject(Nt.active(),t.headers,{set:(t,e,n)=>t.set(e,"string"==typeof n?n:String(n))});else if(t.headers instanceof Headers)qt.inject(Nt.active(),t.headers,{set:(t,e,n)=>t.set(e,"string"==typeof n?n:String(n))});else if(t.headers instanceof Map)qt.inject(Nt.active(),t.headers,{set:(t,e,n)=>t.set(e,"string"==typeof n?n:String(n))});else{const e={};qt.inject(Nt.active(),e),t.headers=Object.assign({},e,t.headers||{})}}_clearResources(){0===this._tasksCount&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(t,e={}){if(_n(t,this.getConfig().ignoreUrls))return void this._diag.debug("ignoring span as url matches ignored url");let n="";const r={};if(this._semconvStability&ur.OLD){const o=(e.method||"GET").toUpperCase();n=`HTTP ${o}`,r[Kr.COMPONENT]=this.moduleName,r["http.method"]=o,r["http.url"]=t}if(this._semconvStability&ur.STABLE){const o=e.method,i=Zr(e.method||"GET");n||(n=i),r[he]=i,i!==o&&(r[fe]=o),r[Ee]=t}return this.tracer.startSpan(n,{kind:wt.CLIENT,attributes:r})}_findResourceAndAddNetworkEvents(t,e,n){let r=e.entries;if(!r.length){if(!performance.getEntriesByType)return;r=performance.getEntriesByType("resource")}const o=zr(e.spanUrl,e.startTime,n,r,this._usedResources,"fetch");if(o.mainRequest){const e=o.mainRequest;this._markResourceAsUsed(e);const n=o.corsPreFlightRequest;n&&(this._addChildSpan(t,n),this._markResourceAsUsed(n));const r=!(this._semconvStability&ur.OLD);Vr(t,e,this.getConfig().ignoreNetworkEvents,void 0,r)}}_markResourceAsUsed(t){this._usedResources.add(t)}_endSpan(t,e,n){const r=Re(Date.now()),o=Le();this._addFinalSpanAttributes(t,n),this._semconvStability&ur.STABLE&&n.status>=400&&(t.setStatus({code:Ot.ERROR}),t.setAttribute(le,String(n.status))),setTimeout(()=>{e.observer?.disconnect(),this._findResourceAndAddNetworkEvents(t,e,o),this._tasksCount--,this._clearResources(),t.end(r)},300)}_patchConstructor(){return t=>{const e=this;return function(...n){const r=this,o=qr(n[0]instanceof Request?n[0].url:String(n[0])).href,i=n[0]instanceof Request?n[0]:n[1]||{},s=e._createSpan(o,i);if(!s)return t.apply(this,n);const a=e._prepareSpanData(o);function u(t,n){e._applyAttributesAfterFetch(t,i,n),e._endSpan(t,a,{status:n.status||0,statusText:n.message,url:o})}function c(t,n){e._applyAttributesAfterFetch(t,i,n),n.status>=200&&n.status<400?e._endSpan(t,a,n):e._endSpan(t,a,{status:n.status,statusText:n.statusText,url:o})}function l(t,e,n){let r=null;try{const e=n.clone().body;if(e){const o=e.getReader(),i=204===n.status||205===n.status||304===n.status?null:function(t,e){if(!t)return null;const n=t.getReader();return new ReadableStream({async pull(t){try{const{value:e,done:r}=await n.read();r?(n.releaseLock(),t.close()):t.enqueue(e)}catch(e){t.error(e),n.cancel(e).catch(t=>{});try{n.releaseLock()}catch{}}},cancel:t=>(e.cancel(t).catch(t=>{}),n.cancel(t))})}(n.body,o);r=new Response(i,{status:n.status,statusText:n.statusText,headers:n.headers});const s=()=>{o.read().then(({done:e})=>{e?c(t,n):s()},e=>{u(t,e)})};s()}else c(t,n)}finally{e(r??n)}}function p(t,e,n){try{u(t,n)}finally{e(n)}}return e.getConfig().measureRequestSize&&Xr(...n).then(t=>{t&&(e._semconvStability&ur.OLD&&s.setAttribute("http.request_content_length_uncompressed",t),e._semconvStability&ur.STABLE&&s.setAttribute("http.request.body.size",t))}).catch(t=>{e._diag.warn("getFetchBodyLength",t)}),new Promise((n,a)=>Nt.with(Kt.setSpan(Nt.active(),s),()=>(e._addHeaders(i,o),e._callRequestHook(s,i),e._tasksCount++,t.apply(r,i instanceof Request?[i]:[o,i]).then(l.bind(r,s,n),p.bind(r,s,a)))))}}}_applyAttributesAfterFetch(t,e,n){const r=this.getConfig().applyCustomAttributesOnSpan;r&&sr(()=>r(t,e,n),t=>{t&&this._diag.error("applyCustomAttributesOnSpan",t)})}_callRequestHook(t,e){const n=this.getConfig().requestHook;n&&sr(()=>n(t,e),t=>{t&&this._diag.error("requestHook",t)})}_prepareSpanData(t){const e=Le(),n=[];if("function"!=typeof PerformanceObserver)return{entries:n,startTime:e,spanUrl:t};const r=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{"fetch"===e.initiatorType&&e.name===t&&n.push(e)})});return r.observe({entryTypes:["resource"]}),{entries:n,observer:r,startTime:e,spanUrl:t}}enable(){ro?(ar(fetch)&&(this._unwrap(globalThis,"fetch"),this._diag.debug("removing previous patch for constructor")),this._wrap(globalThis,"fetch",this._patchConstructor())):this._diag.warn("this instrumentation is intended for web usage only, it does not instrument server-side fetch()")}disable(){ro&&(this._unwrap(globalThis,"fetch"),this._usedResources=new WeakSet)}}var io;!function(t){t.METHOD_OPEN="open",t.METHOD_SEND="send",t.EVENT_ABORT="abort",t.EVENT_ERROR="error",t.EVENT_LOAD="loaded",t.EVENT_TIMEOUT="timeout"}(io||(io={}));const so=xt.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-xml-http-request/utils"});function ao(t){return e=t,"undefined"!=typeof Document&&e instanceof Document?(new XMLSerializer).serializeToString(document).length:"string"==typeof t?co(t):t instanceof Blob?t.size:t instanceof FormData?function(t){let e=0;for(const[n,r]of t.entries())e+=n.length,r instanceof Blob?e+=r.size:e+=r.length;return e}(t):t instanceof URLSearchParams?co(t.toString()):void 0!==t.byteLength?t.byteLength:void so.warn("unknown body type");var e}const uo=new TextEncoder;function co(t){return uo.encode(t).byteLength}const lo={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0};let po;function ho(){return void 0===po&&(po=lo),po}const fo={"https:":"443","http:":"80"};const go="0.211.0";var mo;!function(t){t.HTTP_STATUS_TEXT="http.status_text"}(mo||(mo={}));class _o extends ir{component="xml-http-request";version=go;moduleName=this.component;_tasksCount=0;_xhrMem=new WeakMap;_usedResources=new WeakSet;_semconvStability;constructor(t={}){super("@opentelemetry/instrumentation-xml-http-request",go,t),this._semconvStability=cr("http",t?.semconvStabilityOptIn)}init(){}_addHeaders(t,e){if(!Gr(qr(e).href,this.getConfig().propagateTraceHeaderCorsUrls)){const t={};return qt.inject(Nt.active(),t),void(Object.keys(t).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}const n={};qt.inject(Nt.active(),n),Object.keys(n).forEach(e=>{t.setRequestHeader(e,String(n[e]))})}_addChildSpan(t,e){Nt.with(Kt.setSpan(Nt.active(),t),()=>{const t=this.tracer.startSpan("CORS Preflight",{startTime:e[Mr.FETCH_START]}),n=!(this._semconvStability&ur.OLD);Vr(t,e,this.getConfig().ignoreNetworkEvents,void 0,n),t.end(e[Mr.RESPONSE_END])})}_addFinalSpanAttributes(t,e,n){if(this._semconvStability&ur.OLD){if(void 0!==e.status&&t.setAttribute("http.status_code",e.status),void 0!==e.statusText&&t.setAttribute(mo.HTTP_STATUS_TEXT,e.statusText),"string"==typeof n){const e=qr(n);t.setAttribute("http.host",e.host),t.setAttribute("http.scheme",e.protocol.replace(":",""))}t.setAttribute("http.user_agent",navigator.userAgent)}this._semconvStability&ur.STABLE&&e.status&&t.setAttribute(ge,e.status)}_applyAttributesAfterXHR(t,e){const n=this.getConfig().applyCustomAttributesOnSpan;"function"==typeof n&&sr(()=>n(t,e),t=>{t&&this._diag.error("applyCustomAttributesOnSpan",t)})}_addResourceObserver(t,e){const n=this._xhrMem.get(t);n&&"function"==typeof PerformanceObserver&&"function"==typeof PerformanceResourceTiming&&(n.createdResources={observer:new PerformanceObserver(t=>{const r=t.getEntries(),o=qr(e);r.forEach(t=>{"xmlhttprequest"===t.initiatorType&&t.name===o.href&&n.createdResources&&n.createdResources.entries.push(t)})}),entries:[]},n.createdResources.observer.observe({entryTypes:["resource"]}))}_clearResources(){0===this._tasksCount&&this.getConfig().clearTimingResources&&(we.clearResourceTimings(),this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}_findResourceAndAddNetworkEvents(t,e,n,r,o){if(!(n&&r&&o&&t.createdResources))return;let i=t.createdResources.entries;i&&i.length||(i=we.getEntriesByType("resource"));const s=zr(qr(n).href,r,o,i,this._usedResources);if(s.mainRequest){const t=s.mainRequest;this._markResourceAsUsed(t);const n=s.corsPreFlightRequest;n&&(this._addChildSpan(e,n),this._markResourceAsUsed(n));const r=!(this._semconvStability&ur.OLD);Vr(e,t,this.getConfig().ignoreNetworkEvents,void 0,r)}}_cleanPreviousSpanInformation(t){const e=this._xhrMem.get(t);if(e){const n=e.callbackToRemoveEvents;n&&n(),this._xhrMem.delete(t)}}_createSpan(t,e,n){if(_n(e,this.getConfig().ignoreUrls))return void this._diag.debug("ignoring span as url matches ignored url");let r="";const o=qr(e),i={};if(this._semconvStability&ur.OLD&&(r=n.toUpperCase(),i["http.method"]=n,i["http.url"]=o.toString()),this._semconvStability&ur.STABLE){const t=n,e=function(t){const e=ho(),n=t.toUpperCase();return n in e?n:"_OTHER"}(n);r||(r=e),i[he]=e,e!==t&&(i[fe]=t),i[Ee]=o.toString(),i[me]=o.hostname;const s=function(t){const e=Number(t.port||fo[t.protocol]);return e&&!isNaN(e)?e:void 0}(o);s&&(i[_e]=s)}const s=this.tracer.startSpan(r,{kind:wt.CLIENT,attributes:i});return s.addEvent(io.METHOD_OPEN),this._cleanPreviousSpanInformation(t),this._xhrMem.set(t,{span:s,spanUrl:e}),s}_markResourceAsUsed(t){this._usedResources.add(t)}_patchOpen(){return t=>{const e=this;return function(...n){const r=n[0],o=n[1];return e._createSpan(this,o,r),t.apply(this,n)}}}_patchSend(){const t=this;function e(e,n,r,o){const i=t._xhrMem.get(n);if(!i)return;if(i.status=n.status,i.statusText=n.statusText,t._xhrMem.delete(n),i.span){const e=i.span;t._applyAttributesAfterXHR(e,n),t._semconvStability&ur.STABLE&&(r?o&&(e.setStatus({code:Ot.ERROR,message:o}),e.setAttribute(le,o)):i.status&&i.status>=400&&(e.setStatus({code:Ot.ERROR}),e.setAttribute(le,String(i.status))))}const s=Le(),a=Date.now();setTimeout(()=>{!function(e,n,r,o){const i=n.callbackToRemoveEvents;"function"==typeof i&&i();const{span:s,spanUrl:a,sendStartTime:u}=n;s&&(t._findResourceAndAddNetworkEvents(n,s,a,u,r),s.addEvent(e,o),t._addFinalSpanAttributes(s,n,a),s.end(o),t._tasksCount--),t._clearResources()}(e,i,s,a)},300)}function n(){e(io.EVENT_ERROR,this,!0,"error")}function r(){e(io.EVENT_ABORT,this,!1)}function o(){e(io.EVENT_TIMEOUT,this,!0,"timeout")}function i(){this.status<299?e(io.EVENT_LOAD,this,!1):e(io.EVENT_ERROR,this,!1)}return e=>function(...s){const a=t._xhrMem.get(this);if(!a)return e.apply(this,s);const u=a.span,c=a.spanUrl;if(u&&c){if(t.getConfig().measureRequestSize&&s?.[0]){const e=ao(s[0]);void 0!==e&&(t._semconvStability&ur.OLD&&u.setAttribute("http.request_content_length_uncompressed",e),t._semconvStability&ur.STABLE&&u.setAttribute("http.request.body.size",e))}Nt.with(Kt.setSpan(Nt.active(),u),()=>{t._tasksCount++,a.sendStartTime=Le(),u.addEvent(io.METHOD_SEND),this.addEventListener("abort",r),this.addEventListener("error",n),this.addEventListener("load",i),this.addEventListener("timeout",o),a.callbackToRemoveEvents=()=>{!function(e){e.removeEventListener("abort",r),e.removeEventListener("error",n),e.removeEventListener("load",i),e.removeEventListener("timeout",o);const s=t._xhrMem.get(e);s&&(s.callbackToRemoveEvents=void 0)}(this),a.createdResources&&a.createdResources.observer.disconnect()},t._addHeaders(this,c),t._addResourceObserver(this,c)})}return e.apply(this,s)}}enable(){this._diag.debug("applying patch to",this.moduleName,this.version),ar(XMLHttpRequest.prototype.open)&&(this._unwrap(XMLHttpRequest.prototype,"open"),this._diag.debug("removing previous patch from method open")),ar(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 vo extends _o{constructor(t={}){super(t);this.parentCreateSpan=this._createSpan.bind(this)}_patchOpen(){return t=>{const n=this;return function(...r){let o;try{const t=r[0];let i=e.getUrlFromResource(r[1]);o=n.parentCreateSpan(this,i,t)}catch(t){e.faro.internalLogger.error(t)}const i=e.faro.api.getActiveUserAction();return o&&i&&(null==i?void 0:i.getState())===e.UserActionState.Started&&(o.setAttribute("faro.action.user.name",i.name),o.setAttribute("faro.action.user.parentId",i.parentId)),t.apply(this,r)}}}}function So(t,e,n){yo(t,n instanceof Error?0:n.status)}function yo(t,e){if(null==e)return;(0===e||e>=400&&e<600)&&t.setStatus({code:Ot.ERROR})}function bo(t){return(e,n,r)=>{So(e,0,r),null==t||t(e,n,r)}}function Eo(t){return(e,n)=>{!function(t,e){yo(t,e.status)}(e,n),null==t||t(e,n)}}function To(t={}){const{fetchInstrumentationOptions:n,xhrInstrumentationOptions:r}=t,o=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(t,["fetchInstrumentationOptions","xhrInstrumentationOptions"]),i=function(t,n){return Object.assign(Object.assign(Object.assign(Object.assign({},n),{ignoreNetworkEvents:!0}),t),{applyCustomAttributesOnSpan:bo(null==t?void 0:t.applyCustomAttributesOnSpan),requestHook:(t,n)=>{const r=e.faro.api.getActiveUserAction();r&&(null==r?void 0:r.getState())===e.UserActionState.Started&&(t.setAttribute("faro.action.user.name",r.name),t.setAttribute("faro.action.user.parentId",r.parentId))}})}(n,o),s=function(t,e){return Object.assign(Object.assign(Object.assign(Object.assign({},e),{ignoreNetworkEvents:!0}),t),{applyCustomAttributesOnSpan:Eo(null==t?void 0:t.applyCustomAttributesOnSpan)})}(r,o);return[new oo(i),new vo(s)]}class Ao{constructor(t,e){this.processor=t,this.metas=e}forceFlush(){return this.processor.forceFlush()}onStart(t,e){var n;const r=this.metas.value.session;(null==r?void 0:r.id)&&(t.attributes["session.id"]=r.id);const o=null!==(n=this.metas.value.user)&&void 0!==n?n:{};o.email&&(t.attributes["user.email"]=o.email),o.id&&(t.attributes["user.id"]=o.id),o.username&&(t.attributes["user.name"]=o.username),o.fullName&&(t.attributes["user.full_name"]=o.fullName),o.roles&&(t.attributes["user.roles"]=o.roles.split(",").map(t=>t.trim())),o.hash&&(t.attributes["user.hash"]=o.hash),this.processor.onStart(t,e)}onEnd(t){this.processor.onEnd(t)}shutdown(){return this.processor.shutdown()}}function wo(t={}){var e;return"true"===(null===(e=t.attributes)||void 0===e?void 0:e.isSampled)?vr.RECORD_AND_SAMPLED:vr.NOT_RECORD}class Oo extends e.BaseInstrumentation{constructor(t={}){super(),this.options=t,this.name="@grafana/faro-web-tracing",this.version=e.VERSION}initialize(){var t,n,r,o,i;const s=this.options,a={};this.config.app.name&&(a[ve]=this.config.app.name),this.config.app.namespace&&(a["service.namespace"]=this.config.app.namespace),this.config.app.version&&(a["service.version"]=this.config.app.version),this.config.app.environment&&(a["deployment.environment.name"]=this.config.app.environment,a["deployment.environment"]=this.config.app.environment);const u=this.metas.value.browser;e.isArray(null==u?void 0:u.brands)&&(a["browser.brands"]=u.brands.map(t=>t.brand)),(null==u?void 0:u.language)&&(a["browser.language"]=u.language),"boolean"==typeof(null==u?void 0:u.mobile)&&(a["browser.mobile"]=Boolean(u.mobile)),(null==u?void 0:u.os)&&(a["browser.platform"]=u.os),(null==u?void 0:u.userAgent)&&(a["user_agent.original"]=u.userAgent),a["process.runtime.name"]="browser",a["process.runtime.version"]=null===(t=this.metas.value.browser)||void 0===t?void 0:t.userAgent,a["telemetry.distro.name"]="faro-web-sdk",a["telemetry.distro.version"]=e.VERSION,Object.assign(a,s.resourceAttributes);const c=gr().merge(fr(a));new Br({resource:c,sampler:{shouldSample:()=>({decision:wo(this.api.getSession())})},spanProcessors:[null!==(n=s.spanProcessor)&&void 0!==n?n:new Ao(new Lr(new Vn({api:this.api}),{scheduledDelayMillis:Oo.SCHEDULED_BATCH_DELAY_MS,maxExportBatchSize:30}),this.metas)]}).register({propagator:null!==(r=s.propagator)&&void 0!==r?r:new Ke,contextManager:s.contextManager});const{propagateTraceHeaderCorsUrls:l,fetchInstrumentationOptions:p,xhrInstrumentationOptions:d}=null!==(o=this.options.instrumentationOptions)&&void 0!==o?o:{};!function(t){const e=t.tracerProvider||Kt.getTracerProvider(),n=t.meterProvider||kt.getMeterProvider(),r=t.loggerProvider||Yn.getLoggerProvider(),o=t.instrumentations?.flat()??[];(function(t,e,n,r){for(let o=0,i=t.length;o<i;o++){const i=t[o];e&&i.setTracerProvider(e),n&&i.setMeterProvider(n),r&&i.setLoggerProvider&&i.setLoggerProvider(r),i.getConfig().enabled||i.enable()}})(o,e,n,r)}({instrumentations:null!==(i=s.instrumentations)&&void 0!==i?i:To({ignoreUrls:this.getIgnoreUrls(),propagateTraceHeaderCorsUrls:l,fetchInstrumentationOptions:p,xhrInstrumentationOptions:d})}),this.api.initOTEL(Kt,Nt)}getIgnoreUrls(){return this.transports.transports.flatMap(t=>t.getIgnoreUrls())}}Oo.SCHEDULED_BATCH_DELAY_MS=1e3;return t.FaroMetaAttributesSpanProcessor=Ao,t.FaroTraceExporter=Vn,t.FaroUserActionSpanProcessor=class{constructor(t){this.processor=t}forceFlush(){return this.processor.forceFlush()}onStart(t,n){const r=e.faro.api.getActiveUserAction();r&&(null==r?void 0:r.getState())===e.UserActionState.Started&&t.kind===wt.CLIENT&&(t.attributes["faro.action.user.name"]||(t.attributes["faro.action.user.name"]=null==r?void 0:r.name),t.attributes["faro.action.user.parentId"]||(t.attributes["faro.action.user.parentId"]=null==r?void 0:r.parentId)),this.processor.onStart(t,n)}onEnd(t){this.processor.onEnd(t)}shutdown(){return this.processor.shutdown()}},t.TracingInstrumentation=Oo,t.fetchCustomAttributeFunctionWithDefaults=bo,t.getDefaultOTELInstrumentations=To,t.getSamplingDecision=wo,t.setSpanStatusOnFetchError=So,t}({},GrafanaFaroWebSdk);
|
|
1
|
+
var GrafanaFaroWebTracing=function(t,e){"use strict";var n="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},r="1.9.0",o=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;var i=function(t){var e=new Set([t]),n=new Set,r=t.match(o);if(!r)return function(){return!1};var i=+r[1],s=+r[2],a=+r[3];if(null!=r[4])return function(e){return e===t};function u(t){return n.add(t),!1}function c(t){return e.add(t),!0}return function(t){if(e.has(t))return!0;if(n.has(t))return!1;var r=t.match(o);if(!r)return u(t);var l=+r[1],p=+r[2],d=+r[3];return null!=r[4]||i!==l?u(t):0===i?s===p&&a<=d?c(t):u(t):s<=p?c(t):u(t)}}(r),s=r.split(".")[0],a=Symbol.for("opentelemetry.js.api."+s),u=n;function c(t,e,n,o){var i;void 0===o&&(o=!1);var s=u[a]=null!==(i=u[a])&&void 0!==i?i:{version:r};if(!o&&s[t]){var c=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+t);return n.error(c.stack||c.message),!1}if(s.version!==r){c=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+t+" does not match previously registered API v"+r);return n.error(c.stack||c.message),!1}return s[t]=e,n.debug("@opentelemetry/api: Registered a global for "+t+" v"+r+"."),!0}function l(t){var e,n,r=null===(e=u[a])||void 0===e?void 0:e.version;if(r&&i(r))return null===(n=u[a])||void 0===n?void 0:n[t]}function p(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+r+".");var n=u[a];n&&delete n[t]}var d,h=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s},f=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},g=function(){function t(t){this._namespace=t.namespace||"DiagComponentLogger"}return t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return m("debug",this._namespace,t)},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return m("error",this._namespace,t)},t.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return m("info",this._namespace,t)},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return m("warn",this._namespace,t)},t.prototype.verbose=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return m("verbose",this._namespace,t)},t}();function m(t,e,n){var r=l("diag");if(r)return n.unshift(e),r[t].apply(r,f([],h(n),!1))}!function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"}(d||(d={}));var _=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s},v=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},S=function(){function t(){function t(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=l("diag");if(r)return r[t].apply(r,v([],_(e),!1))}}var e=this;e.setLogger=function(t,n){var r,o,i;if(void 0===n&&(n={logLevel:d.INFO}),t===e){var s=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return e.error(null!==(r=s.stack)&&void 0!==r?r:s.message),!1}"number"==typeof n&&(n={logLevel:n});var a=l("diag"),u=function(t,e){function n(n,r){var o=e[n];return"function"==typeof o&&t>=r?o.bind(e):function(){}}return t<d.NONE?t=d.NONE:t>d.ALL&&(t=d.ALL),e=e||{},{error:n("error",d.ERROR),warn:n("warn",d.WARN),info:n("info",d.INFO),debug:n("debug",d.DEBUG),verbose:n("verbose",d.VERBOSE)}}(null!==(o=n.logLevel)&&void 0!==o?o:d.INFO,t);if(a&&!n.suppressOverrideMessage){var p=null!==(i=(new Error).stack)&&void 0!==i?i:"<failed to generate stacktrace>";a.warn("Current logger will be overwritten from "+p),u.warn("Current logger will overwrite one already registered from "+p)}return c("diag",u,e,!0)},e.disable=function(){p("diag",e)},e.createComponentLogger=function(t){return new g(t)},e.verbose=t("verbose"),e.debug=t("debug"),e.info=t("info"),e.warn=t("warn"),e.error=t("error")}return t.instance=function(){return this._instance||(this._instance=new t),this._instance},t}(),y=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s},b=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},E=function(){function t(t){this._entries=t?new Map(t):new Map}return t.prototype.getEntry=function(t){var e=this._entries.get(t);if(e)return Object.assign({},e)},t.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(t){var e=y(t,2);return[e[0],e[1]]})},t.prototype.setEntry=function(e,n){var r=new t(this._entries);return r._entries.set(e,n),r},t.prototype.removeEntry=function(e){var n=new t(this._entries);return n._entries.delete(e),n},t.prototype.removeEntries=function(){for(var e,n,r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];var i=new t(this._entries);try{for(var s=b(r),a=s.next();!a.done;a=s.next()){var u=a.value;i._entries.delete(u)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}return i},t.prototype.clear=function(){return new t},t}(),T=Symbol("BaggageEntryMetadata"),A=S.instance();function O(t){return void 0===t&&(t={}),new E(new Map(Object.entries(t)))}function w(t){return Symbol.for(t)}var C,R=function t(e){var n=this;n._currentContext=e?new Map(e):new Map,n.getValue=function(t){return n._currentContext.get(t)},n.setValue=function(e,r){var o=new t(n._currentContext);return o._currentContext.set(e,r),o},n.deleteValue=function(e){var r=new t(n._currentContext);return r._currentContext.delete(e),r}},N=new R,P=(C=function(t,e){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},C(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}C(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),L=function(){function t(){}return t.prototype.createGauge=function(t,e){return $},t.prototype.createHistogram=function(t,e){return z},t.prototype.createCounter=function(t,e){return V},t.prototype.createUpDownCounter=function(t,e){return q},t.prototype.createObservableGauge=function(t,e){return K},t.prototype.createObservableCounter=function(t,e){return G},t.prototype.createObservableUpDownCounter=function(t,e){return W},t.prototype.addBatchObservableCallback=function(t,e){},t.prototype.removeBatchObservableCallback=function(t){},t}(),x=function(){},D=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return P(e,t),e.prototype.add=function(t,e){},e}(x),I=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return P(e,t),e.prototype.add=function(t,e){},e}(x),M=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return P(e,t),e.prototype.record=function(t,e){},e}(x),k=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return P(e,t),e.prototype.record=function(t,e){},e}(x),U=function(){function t(){}return t.prototype.addCallback=function(t){},t.prototype.removeCallback=function(t){},t}(),j=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return P(e,t),e}(U),B=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return P(e,t),e}(U),F=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return P(e,t),e}(U),H=new L,V=new D,$=new M,z=new k,q=new I,G=new j,K=new B,W=new F;var X,Q={get:function(t,e){if(null!=t)return t[e]},keys:function(t){return null==t?[]:Object.keys(t)}},Y={set:function(t,e,n){null!=t&&(t[e]=n)}},Z=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s},J=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},tt=function(){function t(){}return t.prototype.active=function(){return N},t.prototype.with=function(t,e,n){for(var r=[],o=3;o<arguments.length;o++)r[o-3]=arguments[o];return e.call.apply(e,J([n],Z(r),!1))},t.prototype.bind=function(t,e){return e},t.prototype.enable=function(){return this},t.prototype.disable=function(){return this},t}(),et=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s},nt=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},rt="context",ot=new tt,it=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalContextManager=function(t){return c(rt,t,S.instance())},t.prototype.active=function(){return this._getContextManager().active()},t.prototype.with=function(t,e,n){for(var r,o=[],i=3;i<arguments.length;i++)o[i-3]=arguments[i];return(r=this._getContextManager()).with.apply(r,nt([t,e,n],et(o),!1))},t.prototype.bind=function(t,e){return this._getContextManager().bind(t,e)},t.prototype._getContextManager=function(){return l(rt)||ot},t.prototype.disable=function(){this._getContextManager().disable(),p(rt,S.instance())},t}();!function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"}(X||(X={}));var st="0000000000000000",at="00000000000000000000000000000000",ut={traceId:at,spanId:st,traceFlags:X.NONE},ct=function(){function t(t){void 0===t&&(t=ut),this._spanContext=t}return t.prototype.spanContext=function(){return this._spanContext},t.prototype.setAttribute=function(t,e){return this},t.prototype.setAttributes=function(t){return this},t.prototype.addEvent=function(t,e){return this},t.prototype.addLink=function(t){return this},t.prototype.addLinks=function(t){return this},t.prototype.setStatus=function(t){return this},t.prototype.updateName=function(t){return this},t.prototype.end=function(t){},t.prototype.isRecording=function(){return!1},t.prototype.recordException=function(t,e){},t}(),lt=w("OpenTelemetry Context Key SPAN");function pt(t){return t.getValue(lt)||void 0}function dt(){return pt(it.getInstance().active())}function ht(t,e){return t.setValue(lt,e)}function ft(t){return t.deleteValue(lt)}function gt(t,e){return ht(t,new ct(e))}function mt(t){var e;return null===(e=pt(t))||void 0===e?void 0:e.spanContext()}var _t=/^([0-9a-f]{32})$/i,vt=/^[0-9a-f]{16}$/i;function St(t){return _t.test(t)&&t!==at}function yt(t){return St(t.traceId)&&(e=t.spanId,vt.test(e)&&e!==st);var e}function bt(t){return new ct(t)}var Et=it.getInstance(),Tt=function(){function t(){}return t.prototype.startSpan=function(t,e,n){if(void 0===n&&(n=Et.active()),Boolean(null==e?void 0:e.root))return new ct;var r,o=n&&mt(n);return"object"==typeof(r=o)&&"string"==typeof r.spanId&&"string"==typeof r.traceId&&"number"==typeof r.traceFlags&&yt(o)?new ct(o):new ct},t.prototype.startActiveSpan=function(t,e,n,r){var o,i,s;if(!(arguments.length<2)){2===arguments.length?s=e:3===arguments.length?(o=e,s=n):(o=e,i=n,s=r);var a=null!=i?i:Et.active(),u=this.startSpan(t,o,a),c=ht(a,u);return Et.with(c,s,void 0,u)}},t}();var At,Ot,wt,Ct=new Tt,Rt=function(){function t(t,e,n,r){this._provider=t,this.name=e,this.version=n,this.options=r}return t.prototype.startSpan=function(t,e,n){return this._getTracer().startSpan(t,e,n)},t.prototype.startActiveSpan=function(t,e,n,r){var o=this._getTracer();return Reflect.apply(o.startActiveSpan,o,arguments)},t.prototype._getTracer=function(){if(this._delegate)return this._delegate;var t=this._provider.getDelegateTracer(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):Ct},t}(),Nt=new(function(){function t(){}return t.prototype.getTracer=function(t,e,n){return new Tt},t}()),Pt=function(){function t(){}return t.prototype.getTracer=function(t,e,n){var r;return null!==(r=this.getDelegateTracer(t,e,n))&&void 0!==r?r:new Rt(this,t,e,n)},t.prototype.getDelegate=function(){var t;return null!==(t=this._delegate)&&void 0!==t?t:Nt},t.prototype.setDelegate=function(t){this._delegate=t},t.prototype.getDelegateTracer=function(t,e,n){var r;return null===(r=this._delegate)||void 0===r?void 0:r.getTracer(t,e,n)},t}();!function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(At||(At={})),function(t){t[t.INTERNAL=0]="INTERNAL",t[t.SERVER=1]="SERVER",t[t.CLIENT=2]="CLIENT",t[t.PRODUCER=3]="PRODUCER",t[t.CONSUMER=4]="CONSUMER"}(Ot||(Ot={})),function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"}(wt||(wt={}));var Lt=it.getInstance(),xt=S.instance(),Dt=new(function(){function t(){}return t.prototype.getMeter=function(t,e,n){return H},t}()),It="metrics",Mt=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalMeterProvider=function(t){return c(It,t,S.instance())},t.prototype.getMeterProvider=function(){return l(It)||Dt},t.prototype.getMeter=function(t,e,n){return this.getMeterProvider().getMeter(t,e,n)},t.prototype.disable=function(){p(It,S.instance())},t}().getInstance(),kt=function(){function t(){}return t.prototype.inject=function(t,e){},t.prototype.extract=function(t,e){return t},t.prototype.fields=function(){return[]},t}(),Ut=w("OpenTelemetry Baggage Key");function jt(t){return t.getValue(Ut)||void 0}function Bt(){return jt(it.getInstance().active())}function Ft(t,e){return t.setValue(Ut,e)}function Ht(t){return t.deleteValue(Ut)}var Vt="propagation",$t=new kt,zt=function(){function t(){this.createBaggage=O,this.getBaggage=jt,this.getActiveBaggage=Bt,this.setBaggage=Ft,this.deleteBaggage=Ht}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalPropagator=function(t){return c(Vt,t,S.instance())},t.prototype.inject=function(t,e,n){return void 0===n&&(n=Y),this._getGlobalPropagator().inject(t,e,n)},t.prototype.extract=function(t,e,n){return void 0===n&&(n=Q),this._getGlobalPropagator().extract(t,e,n)},t.prototype.fields=function(){return this._getGlobalPropagator().fields()},t.prototype.disable=function(){p(Vt,S.instance())},t.prototype._getGlobalPropagator=function(){return l(Vt)||$t},t}(),qt=zt.getInstance(),Gt="trace",Kt=function(){function t(){this._proxyTracerProvider=new Pt,this.wrapSpanContext=bt,this.isSpanContextValid=yt,this.deleteSpan=ft,this.getSpan=pt,this.getActiveSpan=dt,this.getSpanContext=mt,this.setSpan=ht,this.setSpanContext=gt}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(t){var e=c(Gt,this._proxyTracerProvider,S.instance());return e&&this._proxyTracerProvider.setDelegate(t),e},t.prototype.getTracerProvider=function(){return l(Gt)||this._proxyTracerProvider},t.prototype.getTracer=function(t,e){return this.getTracerProvider().getTracer(t,e)},t.prototype.disable=function(){p(Gt,S.instance()),this._proxyTracerProvider=new Pt},t}().getInstance();const Wt=w("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Xt(t){return t.setValue(Wt,!0)}function Qt(t){return!0===t.getValue(Wt)}const Yt=",",Zt="baggage";function Jt(t){if(!t)return;const e=t.indexOf(";"),n=-1===e?t:t.substring(0,e),r=n.indexOf("=");if(r<=0)return;const o=n.substring(0,r).trim(),i=n.substring(r+1).trim();if(!o||!i)return;let s,a,u;try{s=decodeURIComponent(o),a=decodeURIComponent(i)}catch{return}if(-1!==e&&e<t.length-1){const n=t.substring(e+1);"string"!=typeof(c=n)&&(A.error("Cannot create baggage metadata from unknown type: "+typeof c),c=""),u={__TYPE__:T,toString:function(){return c}}}var c;return{key:s,value:a,metadata:u}}class te{inject(t,e,n){const r=qt.getBaggage(t);if(!r||Qt(t))return;const o=function(t){return t.getAllEntries().map(([t,e])=>{let n=`${encodeURIComponent(t)}=${encodeURIComponent(e.value)}`;return void 0!==e.metadata&&(n+=";"+e.metadata.toString()),n})}(r).filter(t=>t.length<=4096).slice(0,180),i=function(t){return t.reduce((t,e)=>{const n=`${t}${""!==t?Yt:""}${e}`;return n.length>8192?t:n},"")}(o);i.length>0&&n.set(e,Zt,i)}extract(t,e,n){const r=n.get(e,Zt),o=Array.isArray(r)?r.join(Yt):r;if(!o)return t;const i={};if(0===o.length)return t;return o.split(Yt).forEach(t=>{const e=Jt(t);if(e){const t={value:e.value};e.metadata&&(t.metadata=e.metadata),i[e.key]=t}}),0===Object.entries(i).length?t:qt.setBaggage(t,qt.createBaggage(i))}fields(){return[Zt]}}function ee(t){const e={};if("object"!=typeof t||null==t)return e;for(const n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;if(!ne(n)){xt.warn(`Invalid attribute key: ${n}`);continue}const r=t[n];re(r)?Array.isArray(r)?e[n]=r.slice():e[n]=r:xt.warn(`Invalid attribute value set for key: ${n}`)}return e}function ne(t){return"string"==typeof t&&""!==t}function re(t){return null==t||(Array.isArray(t)?function(t){let e;for(const n of t){if(null==n)continue;const t=typeof n;if(t!==e){if(!e){if(oe(t)){e=t;continue}return!1}return!1}}return!0}(t):oe(typeof t))}function oe(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}function ie(){return t=>{xt.error(function(t){return"string"==typeof t?t:JSON.stringify(function(t){const e={};let n=t;for(;null!==n;)Object.getOwnPropertyNames(n).forEach(t=>{if(e[t])return;const r=n[t];r&&(e[t]=String(r))}),n=Object.getPrototypeOf(n);return e}(t))}(t))}}let se=ie();function ae(t){try{se(t)}catch{}}function ue(t){}const ce=globalThis,le="error.type",pe="exception.message",de="exception.type",he="http.request.method",fe="http.request.method_original",ge="http.response.status_code",me="server.address",_e="server.port",ve="service.name",Se="telemetry.sdk.language",ye="telemetry.sdk.name",be="telemetry.sdk.version",Ee="url.full",Te="process.runtime.name",Ae={[ye]:"opentelemetry",[Te]:"browser",[Se]:"webjs",[be]:"2.6.0"},Oe=performance,we=Math.pow(10,6),Ce=Math.pow(10,9);function Re(t){const e=t/1e3;return[Math.trunc(e),Math.round(t%1e3*we)]}function Ne(t){return Me(Re(Oe.timeOrigin),Re("number"==typeof t?t:Oe.now()))}function Pe(t){if(De(t))return t;if("number"==typeof t)return t<Oe.timeOrigin?Ne(t):Re(t);if(t instanceof Date)return Re(t.getTime());throw TypeError("Invalid input type")}function Le(t,e){let n=e[0]-t[0],r=e[1]-t[1];return r<0&&(n-=1,r+=Ce),[n,r]}function xe(t){return t[0]*Ce+t[1]}function De(t){return Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]}function Ie(t){return De(t)||"number"==typeof t||t instanceof Date}function Me(t,e){const n=[t[0]+e[0],t[1]+e[1]];return n[1]>=Ce&&(n[1]-=Ce,n[0]+=1),n}var ke;!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"}(ke||(ke={}));class Ue{_propagators;_fields;constructor(t={}){this._propagators=t.propagators??[],this._fields=Array.from(new Set(this._propagators.map(t=>"function"==typeof t.fields?t.fields():[]).reduce((t,e)=>t.concat(e),[])))}inject(t,e,n){for(const r of this._propagators)try{r.inject(t,e,n)}catch(t){xt.warn(`Failed to inject with ${r.constructor.name}. Err: ${t.message}`)}}extract(t,e,n){return this._propagators.reduce((t,r)=>{try{return r.extract(t,e,n)}catch(t){xt.warn(`Failed to extract with ${r.constructor.name}. Err: ${t.message}`)}return t},t)}fields(){return this._fields.slice()}}const je="[_0-9a-z-*/]",Be=new RegExp(`^(?:${`[a-z]${je}{0,255}`}|${`[a-z0-9]${je}{0,240}@[a-z]${je}{0,13}`})$`),Fe=/^[ -~]{0,255}[!-~]$/,He=/,|=/;class Ve{_internalState=new Map;constructor(t){t&&this._parse(t)}set(t,e){const n=this._clone();return n._internalState.has(t)&&n._internalState.delete(t),n._internalState.set(t,e),n}unset(t){const e=this._clone();return e._internalState.delete(t),e}get(t){return this._internalState.get(t)}serialize(){return this._keys().reduce((t,e)=>(t.push(e+"="+this.get(e)),t),[]).join(",")}_parse(t){t.length>512||(this._internalState=t.split(",").reverse().reduce((t,e)=>{const n=e.trim(),r=n.indexOf("=");if(-1!==r){const o=n.slice(0,r),i=n.slice(r+1,e.length);(function(t){return Be.test(t)})(o)&&function(t){return Fe.test(t)&&!He.test(t)}(i)&&t.set(o,i)}return t},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 t=new Ve;return t._internalState=new Map(this._internalState),t}}const $e="traceparent",ze="tracestate",qe=new RegExp("^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$");function Ge(t){const e=qe.exec(t);return e?"00"===e[1]&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}:null}class Ke{inject(t,e,n){const r=Kt.getSpanContext(t);if(!r||Qt(t)||!yt(r))return;const o=`00-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||X.NONE).toString(16)}`;n.set(e,$e,o),r.traceState&&n.set(e,ze,r.traceState.serialize())}extract(t,e,n){const r=n.get(e,$e);if(!r)return t;const o=Array.isArray(r)?r[0]:r;if("string"!=typeof o)return t;const i=Ge(o);if(!i)return t;i.isRemote=!0;const s=n.get(e,ze);if(s){const t=Array.isArray(s)?s.join(","):s;i.traceState=new Ve("string"==typeof t?t:void 0)}return Kt.setSpanContext(t,i)}fields(){return[$e,ze]}}const We=w("OpenTelemetry SDK Context Key RPC_METADATA");var Xe;!function(t){t.HTTP="http"}(Xe||(Xe={}));const Qe="[object Null]",Ye="[object Undefined]",Ze=Function.prototype.toString,Je=Ze.call(Object),tn=Object.getPrototypeOf,en=Object.prototype,nn=en.hasOwnProperty,rn=Symbol?Symbol.toStringTag:void 0,on=en.toString;function sn(t){if(!function(t){return null!=t&&"object"==typeof t}(t)||"[object Object]"!==function(t){if(null==t)return void 0===t?Ye:Qe;return rn&&rn in Object(t)?function(t){const e=nn.call(t,rn),n=t[rn];let r=!1;try{t[rn]=void 0,r=!0}catch{}const o=on.call(t);r&&(e?t[rn]=n:delete t[rn]);return o}(t):function(t){return on.call(t)}(t)}(t))return!1;const e=tn(t);if(null===e)return!0;const n=nn.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Ze.call(n)===Je}function an(...t){let e=t.shift();const n=new WeakMap;for(;t.length>0;)e=cn(e,t.shift(),0,n);return e}function un(t){return pn(t)?t.slice():t}function cn(t,e,n=0,r){let o;if(!(n>20)){if(n++,fn(t)||fn(e)||dn(e))o=un(e);else if(pn(t)){if(o=t.slice(),pn(e))for(let t=0,n=e.length;t<n;t++)o.push(un(e[t]));else if(hn(e)){const t=Object.keys(e);for(let n=0,r=t.length;n<r;n++){const r=t[n];o[r]=un(e[r])}}}else if(hn(t))if(hn(e)){if(!function(t,e){if(!sn(t)||!sn(e))return!1;return!0}(t,e))return e;o=Object.assign({},t);const i=Object.keys(e);for(let s=0,a=i.length;s<a;s++){const a=i[s],u=e[a];if(fn(u))void 0===u?delete o[a]:o[a]=u;else{const i=o[a],s=u;if(ln(t,a,r)||ln(e,a,r))delete o[a];else{if(hn(i)&&hn(s)){const n=r.get(i)||[],o=r.get(s)||[];n.push({obj:t,key:a}),o.push({obj:e,key:a}),r.set(i,n),r.set(s,o)}o[a]=cn(o[a],u,n,r)}}}}else o=e;return o}}function ln(t,e,n){const r=n.get(t[e])||[];for(let n=0,o=r.length;n<o;n++){const o=r[n];if(o.key===e&&o.obj===t)return!0}return!1}function pn(t){return Array.isArray(t)}function dn(t){return"function"==typeof t}function hn(t){return!fn(t)&&!pn(t)&&!dn(t)&&"object"==typeof t}function fn(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||void 0===t||t instanceof Date||t instanceof RegExp||null===t}class gn extends Error{constructor(t){super(t),Object.setPrototypeOf(this,gn.prototype)}}function mn(t,e){return"string"==typeof e?t===e:!!t.match(e)}function _n(t,e){if(!e)return!1;for(const n of e)if(mn(t,n))return!0;return!1}class vn{_promise;_resolve;_reject;constructor(){this._promise=new Promise((t,e)=>{this._resolve=t,this._reject=e})}get promise(){return this._promise}resolve(t){this._resolve(t)}reject(t){this._reject(t)}}class Sn{_isCalled=!1;_deferred=new vn;_callback;_that;constructor(t,e){this._callback=t,this._that=e}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...t){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...t)).then(t=>this._deferred.resolve(t),t=>this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}}const yn={ALL:d.ALL,VERBOSE:d.VERBOSE,DEBUG:d.DEBUG,INFO:d.INFO,WARN:d.WARN,ERROR:d.ERROR,NONE:d.NONE};const bn={_export:function(t,e){return new Promise(n=>{Lt.with(Xt(Lt.active()),()=>{t.export(e,n)})})}};var En=Object.freeze({__proto__:null,AnchoredClock:class{_monotonicClock;_epochMillis;_performanceMillis;constructor(t,e){this._monotonicClock=e,this._epochMillis=t.now(),this._performanceMillis=e.now()}now(){const t=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+t}},BindOnceFuture:Sn,CompositePropagator:Ue,get ExportResultCode(){return ke},get RPCType(){return Xe},SDK_INFO:Ae,TRACE_PARENT_HEADER:$e,TRACE_STATE_HEADER:ze,TimeoutError:gn,TraceState:Ve,W3CBaggagePropagator:te,W3CTraceContextPropagator:Ke,_globalThis:ce,addHrTimes:Me,callWithTimeout:function(t,e){let n;const r=new Promise(function(t,r){n=setTimeout(function(){r(new gn("Operation timed out."))},e)});return Promise.race([t,r]).then(t=>(clearTimeout(n),t),t=>{throw clearTimeout(n),t})},deleteRPCMetadata:function(t){return t.deleteValue(We)},diagLogLevelFromString:function(t){if(null==t)return;const e=yn[t.toUpperCase()];return null==e?(xt.warn(`Unknown log level "${t}", expected one of ${Object.keys(yn)}, using default`),d.INFO):e},getBooleanFromEnv:function(t){},getNumberFromEnv:ue,getRPCMetadata:function(t){return t.getValue(We)},getStringFromEnv:function(t){},getStringListFromEnv:function(t){},getTimeOrigin:function(){return Oe.timeOrigin},globalErrorHandler:ae,hrTime:Ne,hrTimeDuration:Le,hrTimeToMicroseconds:function(t){return 1e6*t[0]+t[1]/1e3},hrTimeToMilliseconds:function(t){return 1e3*t[0]+t[1]/1e6},hrTimeToNanoseconds:xe,hrTimeToTimeStamp:function(t){const e=`${"0".repeat(9)}${t[1]}Z`,n=e.substring(e.length-9-1);return new Date(1e3*t[0]).toISOString().replace("000Z",n)},internal:bn,isAttributeValue:re,isTimeInput:Ie,isTimeInputHrTime:De,isTracingSuppressed:Qt,isUrlIgnored:_n,loggingErrorHandler:ie,merge:an,millisToHrTime:Re,otperformance:Oe,parseKeyPairsIntoRecord:function(t){const e={};return"string"==typeof t&&t.length>0&&t.split(Yt).forEach(t=>{const n=Jt(t);void 0!==n&&n.value.length>0&&(e[n.key]=n.value)}),e},parseTraceParent:Ge,sanitizeAttributes:ee,setGlobalErrorHandler:function(t){se=t},setRPCMetadata:function(t,e){return t.setValue(We,e)},suppressTracing:Xt,timeInputToHrTime:Pe,unrefTimer:function(t){"number"!=typeof t&&t.unref()},unsuppressTracing:function(t){return t.deleteValue(Wt)},urlMatches:mn});function Tn(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if("function"==typeof e){var n=function t(){var n=!1;try{n=this instanceof t}catch{}return n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(e){var r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,r.get?r:{enumerable:!0,get:function(){return t[e]}})}),n}var An,On,wn={},Cn=Tn(En),Rn={};function Nn(){if(An)return Rn;function t(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}return An=1,Object.defineProperty(Rn,"__esModule",{value:!0}),Rn.hexToBinary=void 0,Rn.hexToBinary=function(e){const n=new Uint8Array(e.length/2);let r=0;for(let o=0;o<e.length;o+=2){const i=t(e.charCodeAt(o)),s=t(e.charCodeAt(o+1));n[r++]=i<<4|s}return n},Rn}function Pn(){if(On)return wn;On=1,Object.defineProperty(wn,"__esModule",{value:!0}),wn.JSON_ENCODER=wn.PROTOBUF_ENCODER=wn.encodeAsString=wn.encodeAsLongBits=wn.toLongBits=wn.hrTimeToNanos=void 0;const t=Cn,e=Nn();function n(t){const e=BigInt(1e9);return BigInt(Math.trunc(t[0]))*e+BigInt(Math.trunc(t[1]))}function r(t){return{low:Number(BigInt.asUintN(32,t)),high:Number(BigInt.asUintN(32,t>>BigInt(32)))}}function o(t){return r(n(t))}function i(t){return n(t).toString()}wn.hrTimeToNanos=n,wn.toLongBits=r,wn.encodeAsLongBits=o,wn.encodeAsString=i;const s="undefined"!=typeof BigInt?i:t.hrTimeToNanoseconds;function a(t){return t}return wn.PROTOBUF_ENCODER={encodeHrTime:o,encodeSpanContext:e.hexToBinary,encodeOptionalSpanContext:function(t){if(void 0!==t)return(0,e.hexToBinary)(t)},encodeUint8Array:a},wn.JSON_ENCODER={encodeHrTime:s,encodeSpanContext:a,encodeOptionalSpanContext:a,encodeUint8Array:t=>{if("undefined"!=typeof Buffer)return Buffer.from(t).toString("base64");const e=new Array(t.length);for(let n=0;n<t.length;n++)e[n]=String.fromCharCode(t[n]);return btoa(e.join(""))}},wn}var Ln,xn,Dn=Pn(),In={},Mn={};function kn(){if(Ln)return Mn;function t(t,n){return Object.keys(t).map(r=>e(r,t[r],n))}function e(t,e,r){return{key:t,value:n(e,r)}}function n(t,e){const r=typeof t;if("string"===r)return{stringValue:t};if("number"===r)return Number.isInteger(t)?{intValue:t}:{doubleValue:t};if("boolean"===r)return{boolValue:t};if(t instanceof Uint8Array)return{bytesValue:e.encodeUint8Array(t)};if(Array.isArray(t)){const r=new Array(t.length);for(let o=0;o<t.length;o++)r[o]=n(t[o],e);return{arrayValue:{values:r}}}if("object"===r&&null!=t){const r=Object.keys(t),o=new Array(r.length);for(let i=0;i<r.length;i++)o[i]={key:r[i],value:n(t[r[i]],e)};return{kvlistValue:{values:o}}}return{}}return Ln=1,Object.defineProperty(Mn,"__esModule",{value:!0}),Mn.toAnyValue=Mn.toKeyValue=Mn.toAttributes=Mn.createInstrumentationScope=Mn.createResource=void 0,Mn.createResource=function(e,n){const r={attributes:t(e.attributes,n),droppedAttributesCount:0},o=e.schemaUrl;return o&&""!==o&&(r.schemaUrl=o),r},Mn.createInstrumentationScope=function(t){return{name:t.name,version:t.version}},Mn.toAttributes=t,Mn.toKeyValue=e,Mn.toAnyValue=n,Mn}function Un(){if(xn)return In;xn=1,Object.defineProperty(In,"__esModule",{value:!0}),In.createExportTraceServiceRequest=In.toOtlpSpanEvent=In.toOtlpLink=In.sdkSpanToOtlpSpan=void 0;const t=kn();function e(t,e){let n=255&t|256;return e&&(n|=512),n}function n(n,i){const s=n.spanContext(),a=n.status,u=n.parentSpanContext?.spanId?i.encodeSpanContext(n.parentSpanContext?.spanId):void 0;return{traceId:i.encodeSpanContext(s.traceId),spanId:i.encodeSpanContext(s.spanId),parentSpanId:u,traceState:s.traceState?.serialize(),name:n.name,kind:null==n.kind?0:n.kind+1,startTimeUnixNano:i.encodeHrTime(n.startTime),endTimeUnixNano:i.encodeHrTime(n.endTime),attributes:(0,t.toAttributes)(n.attributes,i),droppedAttributesCount:n.droppedAttributesCount,events:n.events.map(t=>o(t,i)),droppedEventsCount:n.droppedEventsCount,status:{code:a.code,message:a.message},links:n.links.map(t=>r(t,i)),droppedLinksCount:n.droppedLinksCount,flags:e(s.traceFlags,n.parentSpanContext?.isRemote)}}function r(n,r){return{attributes:n.attributes?(0,t.toAttributes)(n.attributes,r):[],spanId:r.encodeSpanContext(n.context.spanId),traceId:r.encodeSpanContext(n.context.traceId),traceState:n.context.traceState?.serialize(),droppedAttributesCount:n.droppedAttributesCount||0,flags:e(n.context.traceFlags,n.context.isRemote)}}function o(e,n){return{attributes:e.attributes?(0,t.toAttributes)(e.attributes,n):[],name:e.name,timeUnixNano:n.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function i(e,r){const o=function(t){const e=new Map;for(const n of t){let t=e.get(n.resource);t||(t=new Map,e.set(n.resource,t));const r=`${n.instrumentationScope.name}@${n.instrumentationScope.version||""}:${n.instrumentationScope.schemaUrl||""}`;let o=t.get(r);o||(o=[],t.set(r,o)),o.push(n)}return e}(e),i=[],s=o.entries();let a=s.next();for(;!a.done;){const[e,o]=a.value,u=[],c=o.values();let l=c.next();for(;!l.done;){const e=l.value;if(e.length>0){const o=e.map(t=>n(t,r));u.push({scope:(0,t.createInstrumentationScope)(e[0].instrumentationScope),spans:o,schemaUrl:e[0].instrumentationScope.schemaUrl})}l=c.next()}const p=(0,t.createResource)(e,r),d={resource:p,scopeSpans:u,schemaUrl:p.schemaUrl};i.push(d),a=s.next()}return i}return In.sdkSpanToOtlpSpan=n,In.toOtlpLink=r,In.toOtlpSpanEvent=o,In.createExportTraceServiceRequest=function(t,e){return{resourceSpans:i(t,e)}},In}var jn,Bn=Un(),Fn={};function Hn(){return jn||(jn=1,t=Fn,Object.defineProperty(t,"__esModule",{value:!0}),t.EStatusCode=t.ESpanKind=void 0,(e=t.ESpanKind||(t.ESpanKind={}))[e.SPAN_KIND_UNSPECIFIED=0]="SPAN_KIND_UNSPECIFIED",e[e.SPAN_KIND_INTERNAL=1]="SPAN_KIND_INTERNAL",e[e.SPAN_KIND_SERVER=2]="SPAN_KIND_SERVER",e[e.SPAN_KIND_CLIENT=3]="SPAN_KIND_CLIENT",e[e.SPAN_KIND_PRODUCER=4]="SPAN_KIND_PRODUCER",e[e.SPAN_KIND_CONSUMER=5]="SPAN_KIND_CONSUMER",(n=t.EStatusCode||(t.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"),Fn;var t,e,n}var Vn=Hn();class $n{constructor(t){this.config=t}export(t,n){const r=Bn.createExportTraceServiceRequest(t,Dn.JSON_ENCODER);this.config.api.pushTraces(r),function(t=[],n){var r,o;for(const i of t){const{scopeSpans:t}=i;for(const i of t){const{scope:t,spans:s=[]}=i;for(const i of s){if(i.kind!==Vn.ESpanKind.SPAN_KIND_CLIENT)continue;const s={traceId:i.traceId.toString(),spanId:i.spanId.toString()},a={};for(const t of i.attributes)a[t.key]=String(Object.values(t.value)[0]);Number.isNaN(i.endTimeUnixNano)||Number.isNaN(i.startTimeUnixNano)||(a.duration_ns=String(Number(i.endTimeUnixNano)-Number(i.startTimeUnixNano)));const u=(null!==(r=null==t?void 0:t.name)&&void 0!==r?r:"").indexOf("-");let c=e.unknownString;(null==t?void 0:t.name)&&(-1===u&&(c=null!==(o=t.name.split("/")[1])&&void 0!==o?o:t.name),u>-1&&(c=null==t?void 0:t.name.substring(u+1))),n.pushEvent(`faro.tracing.${c}`,a,void 0,{spanContext:s,timestampOverwriteMs:Number(i.endTimeUnixNano)/1e6,customPayloadTransformer:t=>{var e,n;return null!=a["faro.action.user.name"]&&null!=a["faro.action.user.parentId"]&&(t.action={name:a["faro.action.user.name"],parentId:a["faro.action.user.parentId"]},null===(e=t.attributes)||void 0===e||delete e["faro.action.user.name"],null===(n=t.attributes)||void 0===n||delete n["faro.action.user.parentId"]),t}})}}}}(r.resourceSpans,this.config.api),n({code:ke.SUCCESS})}shutdown(){return Promise.resolve(void 0)}}"function"==typeof SuppressedError&&SuppressedError;class zn{emit(t){}}const qn=new zn,Gn=Symbol.for("io.opentelemetry.js.api.logs"),Kn=globalThis;const Wn=new class{getLogger(t,e,n){return new zn}};class Xn{constructor(t,e,n,r){this._provider=t,this.name=e,this.version=n,this.options=r}emit(t){this._getLogger().emit(t)}_getLogger(){if(this._delegate)return this._delegate;const t=this._provider._getDelegateLogger(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):qn}}class Qn{getLogger(t,e,n){var r;return null!==(r=this._getDelegateLogger(t,e,n))&&void 0!==r?r:new Xn(this,t,e,n)}_getDelegate(){var t;return null!==(t=this._delegate)&&void 0!==t?t:Wn}_setDelegate(t){this._delegate=t}_getDelegateLogger(t,e,n){var r;return null===(r=this._delegate)||void 0===r?void 0:r.getLogger(t,e,n)}}class Yn{constructor(){this._proxyLoggerProvider=new Qn}static getInstance(){return this._instance||(this._instance=new Yn),this._instance}setGlobalLoggerProvider(t){return Kn[Gn]?this.getLoggerProvider():(Kn[Gn]=(e=1,n=t,r=Wn,t=>t===e?n:r),this._proxyLoggerProvider._setDelegate(t),t);var e,n,r}getLoggerProvider(){var t,e;return null!==(e=null===(t=Kn[Gn])||void 0===t?void 0:t.call(Kn,1))&&void 0!==e?e:this._proxyLoggerProvider}getLogger(t,e,n){return this.getLoggerProvider().getLogger(t,e,n)}disable(){delete Kn[Gn],this._proxyLoggerProvider=new Qn}}const Zn=Yn.getInstance();let Jn=console.error.bind(console);function tr(t,e,n){const r=!!t[e]&&Object.prototype.propertyIsEnumerable.call(t,e);Object.defineProperty(t,e,{configurable:!0,enumerable:r,writable:!0,value:n})}const er=(t,e,n)=>{if(!t||!t[e])return void Jn("no original function "+String(e)+" to wrap");if(!n)return Jn("no wrapper function"),void Jn((new Error).stack);const r=t[e];if("function"!=typeof r||"function"!=typeof n)return void Jn("original object and wrapper must be functions");const o=n(r,e);return tr(o,"__original",r),tr(o,"__unwrap",()=>{t[e]===o&&tr(t,e,r)}),tr(o,"__wrapped",!0),tr(t,e,o),o},nr=(t,e,n)=>{if(!t)return Jn("must provide one or more modules to patch"),void Jn((new Error).stack);Array.isArray(t)||(t=[t]),e&&Array.isArray(e)?t.forEach(t=>{e.forEach(e=>{er(t,e,n)})}):Jn("must provide one or more functions to wrap on modules")},rr=(t,e)=>{if(!t||!t[e])return Jn("no function to unwrap."),void Jn((new Error).stack);const n=t[e];n.__unwrap?n.__unwrap():Jn("no original to unwrap to -- has "+String(e)+" already been unwrapped?")},or=(t,e)=>{if(!t)return Jn("must provide one or more modules to patch"),void Jn((new Error).stack);Array.isArray(t)||(t=[t]),e&&Array.isArray(e)?t.forEach(t=>{e.forEach(e=>{rr(t,e)})}):Jn("must provide one or more functions to unwrap on modules")};class ir{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(t,e,n){this.instrumentationName=t,this.instrumentationVersion=e,this.setConfig(n),this._diag=xt.createComponentLogger({namespace:t}),this._tracer=Kt.getTracer(t,e),this._meter=Mt.getMeter(t,e),this._logger=Zn.getLogger(t,e),this._updateMetricInstruments()}_wrap=er;_unwrap=rr;_massWrap=nr;_massUnwrap=or;get meter(){return this._meter}setMeterProvider(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(t){this._logger=t.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){const t=this.init()??[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(t){this._config={enabled:!0,...t}}setTracerProvider(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(t,e,n,r){if(t)try{t(n,r)}catch(t){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:e},t)}}}class sr extends ir{constructor(t,e,n){super(t,e,n),this._config.enabled&&this.enable()}}function ar(t,e,n){let r,o;try{o=t()}catch(t){r=t}finally{return e(r,o),o}}function ur(t){return"function"==typeof t&&"function"==typeof t.__original&&"function"==typeof t.__unwrap&&!0===t.__wrapped}var cr;function lr(t,e){let n=cr.OLD;const r=e?.split(",").map(t=>t.trim()).filter(t=>""!==t);for(const e of r??[]){if(e.toLowerCase()===t+"/dup"){n=cr.DUPLICATE;break}e.toLowerCase()===t&&(n=cr.STABLE)}return n}let pr;function dr(){if(void 0===pr)try{const t=globalThis.process.argv0;pr=t?`unknown_service:${t}`:"unknown_service"}catch{pr="unknown_service"}return pr}!function(t){t[t.STABLE=1]="STABLE",t[t.OLD=2]="OLD",t[t.DUPLICATE=3]="DUPLICATE"}(cr||(cr={}));const hr=t=>null!==t&&"object"==typeof t&&"function"==typeof t.then;class fr{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(t,e){const n=new fr({},e);return n._rawAttributes=_r(t),n._asyncAttributesPending=t.filter(([t,e])=>hr(e)).length>0,n}constructor(t,e){const n=t.attributes??{};this._rawAttributes=Object.entries(n).map(([t,e])=>(hr(e)&&(this._asyncAttributesPending=!0),[t,e])),this._rawAttributes=_r(this._rawAttributes),this._schemaUrl=function(t){if("string"==typeof t||void 0===t)return t;return void xt.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",t)}(e?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let t=0;t<this._rawAttributes.length;t++){const[e,n]=this._rawAttributes[t];this._rawAttributes[t]=[e,hr(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&xt.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const t={};for(const[e,n]of this._rawAttributes)hr(n)?xt.debug(`Unsettled resource attribute ${e} skipped`):null!=n&&(t[e]??=n);return this._asyncAttributesPending||(this._memoizedAttributes=t),t}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(null==t)return this;const e=function(t,e){const n=t?.schemaUrl,r=e?.schemaUrl,o=void 0===n||""===n,i=void 0===r||""===r;if(o)return r;if(i)return n;if(n===r)return n;return void xt.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',n,r)}(this,t),n=e?{schemaUrl:e}:void 0;return fr.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],n)}}function gr(t,e){return fr.FromAttributeList(Object.entries(t),e)}function mr(){return gr({[ve]:dr(),[Se]:Ae[Se],[ye]:Ae[ye],[be]:Ae[be]})}function _r(t){return t.map(([t,e])=>hr(e)?[t,e.catch(e=>{xt.debug("promise rejection for resource attribute: %s - %s",t,e)})]:[t,e])}class vr{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:wt.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(t){const e=Date.now();this._spanContext=t.spanContext,this._performanceStartTime=Oe.now(),this._performanceOffset=e-(this._performanceStartTime+Oe.timeOrigin),this._startTimeProvided=null!=t.startTime,this._spanLimits=t.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0,this._spanProcessor=t.spanProcessor,this.name=t.name,this.parentSpanContext=t.parentSpanContext,this.kind=t.kind,this.links=t.links||[],this.startTime=this._getTime(t.startTime??e),this.resource=t.resource,this.instrumentationScope=t.scope,this._recordEndMetrics=t.recordEndMetrics,null!=t.attributes&&this.setAttributes(t.attributes),this._spanProcessor.onStart(this,t.context)}spanContext(){return this._spanContext}setAttribute(t,e){if(null==e||this._isSpanEnded())return this;if(0===t.length)return xt.warn(`Invalid attribute key: ${t}`),this;if(!re(e))return xt.warn(`Invalid attribute value set for key: ${t}`),this;const{attributeCountLimit:n}=this._spanLimits,r=!Object.prototype.hasOwnProperty.call(this.attributes,t);return void 0!==n&&this._attributesCount>=n&&r?(this._droppedAttributesCount++,this):(this.attributes[t]=this._truncateToSize(e),r&&this._attributesCount++,this)}setAttributes(t){for(const[e,n]of Object.entries(t))this.setAttribute(e,n);return this}addEvent(t,e,n){if(this._isSpanEnded())return this;const{eventCountLimit:r}=this._spanLimits;if(0===r)return xt.warn("No events allowed."),this._droppedEventsCount++,this;void 0!==r&&this.events.length>=r&&(0===this._droppedEventsCount&&xt.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),Ie(e)&&(Ie(n)||(n=e),e=void 0);const o=ee(e);return this.events.push({name:t,attributes:o,time:this._getTime(n),droppedAttributesCount:0}),this}addLink(t){return this.links.push(t),this}addLinks(t){return this.links.push(...t),this}setStatus(t){return this._isSpanEnded()||(this.status={...t},null!=this.status.message&&"string"!=typeof t.message&&(xt.warn(`Dropping invalid status.message of type '${typeof t.message}', expected 'string'`),delete this.status.message)),this}updateName(t){return this._isSpanEnded()||(this.name=t),this}end(t){this._isSpanEnded()?xt.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`):(this.endTime=this._getTime(t),this._duration=Le(this.startTime,this.endTime),this._duration[0]<0&&(xt.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&&xt.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this))}_getTime(t){if("number"==typeof t&&t<=Oe.now())return Ne(t+this._performanceOffset);if("number"==typeof t)return Re(t);if(t instanceof Date)return Re(t.getTime());if(De(t))return t;if(this._startTimeProvided)return Re(Date.now());const e=Oe.now()-this._performanceStartTime;return Me(this.startTime,Re(e))}isRecording(){return!1===this._ended}recordException(t,e){const n={};"string"==typeof t?n[pe]=t:t&&(t.code?n[de]=t.code.toString():t.name&&(n[de]=t.name),t.message&&(n[pe]=t.message),t.stack&&(n["exception.stacktrace"]=t.stack)),n[de]||n[pe]?this.addEvent("exception",n,e):xt.warn(`Failed to record an exception ${t}`)}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 t=new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);xt.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,t)}return this._ended}_truncateToLimitUtil(t,e){return t.length<=e?t:t.substring(0,e)}_truncateToSize(t){const e=this._attributeValueLengthLimit;return e<=0?(xt.warn(`Attribute value limit must be positive, got ${e}`),t):"string"==typeof t?this._truncateToLimitUtil(t,e):Array.isArray(t)?t.map(t=>"string"==typeof t?this._truncateToLimitUtil(t,e):t):t}}var Sr,yr;!function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(Sr||(Sr={}));class br{shouldSample(){return{decision:Sr.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class Er{shouldSample(){return{decision:Sr.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class Tr{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(t){this._root=t.root,this._root||(ae(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new Er),this._remoteParentSampled=t.remoteParentSampled??new Er,this._remoteParentNotSampled=t.remoteParentNotSampled??new br,this._localParentSampled=t.localParentSampled??new Er,this._localParentNotSampled=t.localParentNotSampled??new br}shouldSample(t,e,n,r,o,i){const s=Kt.getSpanContext(t);return s&&yt(s)?s.isRemote?s.traceFlags&X.SAMPLED?this._remoteParentSampled.shouldSample(t,e,n,r,o,i):this._remoteParentNotSampled.shouldSample(t,e,n,r,o,i):s.traceFlags&X.SAMPLED?this._localParentSampled.shouldSample(t,e,n,r,o,i):this._localParentNotSampled.shouldSample(t,e,n,r,o,i):this._root.shouldSample(t,e,n,r,o,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}class Ar{_ratio;_upperBound;constructor(t=0){this._ratio=this._normalize(t),this._upperBound=Math.floor(4294967295*this._ratio)}shouldSample(t,e){return{decision:St(e)&&this._accumulate(e)<this._upperBound?Sr.RECORD_AND_SAMPLED:Sr.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(t){return"number"!=typeof t||isNaN(t)?0:t>=1?1:t<=0?0:t}_accumulate(t){let e=0;for(let n=0;n<t.length/8;n++){const r=8*n;e=(e^parseInt(t.slice(r,r+8),16))>>>0}return e}}!function(t){t.AlwaysOff="always_off",t.AlwaysOn="always_on",t.ParentBasedAlwaysOff="parentbased_always_off",t.ParentBasedAlwaysOn="parentbased_always_on",t.ParentBasedTraceIdRatio="parentbased_traceidratio",t.TraceIdRatio="traceidratio"}(yr||(yr={}));function Or(){return{sampler:wr(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function wr(){const t=yr.ParentBasedAlwaysOn;switch(t){case yr.AlwaysOn:return new Er;case yr.AlwaysOff:return new br;case yr.ParentBasedAlwaysOn:return new Tr({root:new Er});case yr.ParentBasedAlwaysOff:return new Tr({root:new br});case yr.TraceIdRatio:return new Ar(Cr());case yr.ParentBasedTraceIdRatio:return new Tr({root:new Ar(Cr())});default:return xt.error(`OTEL_TRACES_SAMPLER value "${t}" invalid, defaulting to "${yr.ParentBasedAlwaysOn}".`),new Tr({root:new Er})}}function Cr(){return xt.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to 1."),1}const Rr=1/0;class Nr{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(t,e){this._exporter=t,this._maxExportBatchSize="number"==typeof e?.maxExportBatchSize?e.maxExportBatchSize:512,this._maxQueueSize="number"==typeof e?.maxQueueSize?e.maxQueueSize:2048,this._scheduledDelayMillis="number"==typeof e?.scheduledDelayMillis?e.scheduledDelayMillis:5e3,this._exportTimeoutMillis="number"==typeof e?.exportTimeoutMillis?e.exportTimeoutMillis:3e4,this._shutdownOnce=new Sn(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(xt.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(t,e){}onEnd(t){this._shutdownOnce.isCalled||0!==(t.spanContext().traceFlags&X.SAMPLED)&&this._addToBuffer(t)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(t){if(this._finishedSpans.length>=this._maxQueueSize)return 0===this._droppedSpansCount&&xt.debug("maxQueueSize reached, dropping spans"),void this._droppedSpansCount++;this._droppedSpansCount>0&&(xt.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(t),this._maybeStartTimer()}_flushAll(){return new Promise((t,e)=>{const n=[];for(let t=0,e=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);t<e;t++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{t()}).catch(e)})}_flushOneBatch(){return this._clearTimer(),0===this._finishedSpans.length?Promise.resolve():new Promise((t,e)=>{const n=setTimeout(()=>{e(new Error("Timeout"))},this._exportTimeoutMillis);Lt.with(Xt(Lt.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);const o=()=>this._exporter.export(r,r=>{clearTimeout(n),r.code===ke.SUCCESS?t():e(r.error??new Error("BatchSpanProcessor: span export failed"))});let i=null;for(let t=0,e=r.length;t<e;t++){const e=r[t];e.resource.asyncAttributesPending&&e.resource.waitForAsyncAttributes&&(i??=[],i.push(e.resource.waitForAsyncAttributes()))}null===i?o():Promise.all(i).then(o,t=>{ae(t),e(t)})})})}_maybeStartTimer(){if(this._isExporting)return;const t=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(t=>{this._isExporting=!1,ae(t)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return t();void 0===this._timer&&(this._timer=setTimeout(()=>t(),this._scheduledDelayMillis),"number"!=typeof this._timer&&this._timer.unref())}_clearTimer(){void 0!==this._timer&&(clearTimeout(this._timer),this._timer=void 0)}}class Pr extends Nr{_visibilityChangeListener;_pageHideListener;constructor(t,e){super(t,e),this.onInit(e)}onInit(t){!0!==t?.disableAutoFlushOnDocumentHide&&"undefined"!=typeof document&&(this._visibilityChangeListener=()=>{"hidden"===document.visibilityState&&this.forceFlush().catch(t=>{ae(t)})},this._pageHideListener=()=>{this.forceFlush().catch(t=>{ae(t)})},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))}}const Lr=new Uint8Array(16),xr=new Uint8Array(8),Dr=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Ir(t){for(let e=0;e<t.length;e++)t[e]=256*Math.random()>>>0;for(let e=0;e<t.length;e++)if(t[e]>0)return;t[t.length-1]=1}function Mr(t){let e="";for(let n=0;n<t.length;n++)e+=Dr[t[n]];return e}class kr{generateTraceId(){return Ir(Lr),Mr(Lr)}generateSpanId(){return Ir(xr),Mr(xr)}}const Ur="otel.span.parent.origin",jr="otel.span.sampling_result";class Br{startedSpans;liveSpans;constructor(t){this.startedSpans=t.createCounter("otel.sdk.span.started",{unit:"{span}",description:"The number of created spans."}),this.liveSpans=t.createUpDownCounter("otel.sdk.span.live",{unit:"{span}",description:"The number of currently live spans."})}startSpan(t,e){const n=function(t){switch(t){case Sr.RECORD_AND_SAMPLED:return"RECORD_AND_SAMPLE";case Sr.RECORD:return"RECORD_ONLY";case Sr.NOT_RECORD:return"DROP"}}(e);if(this.startedSpans.add(1,{[Ur]:Fr(t),[jr]:n}),e===Sr.NOT_RECORD)return()=>{};const r={[jr]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}}function Fr(t){return t?t.isRemote?"remote":"local":"none"}class Hr{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(t,e,n,r){const o=function(t){const e={sampler:wr()},n=Or(),r=Object.assign({},n,e,t);return r.generalLimits=Object.assign({},n.generalLimits,t.generalLimits||{}),r.spanLimits=Object.assign({},n.spanLimits,t.spanLimits||{}),r}(e);this._sampler=o.sampler,this._generalLimits=o.generalLimits,this._spanLimits=o.spanLimits,this._idGenerator=e.idGenerator||new kr,this._resource=n,this._spanProcessor=r,this.instrumentationScope=t;const i=o.meterProvider?o.meterProvider.getMeter("@opentelemetry/sdk-trace","2.6.0"):H;this._tracerMetrics=new Br(i)}startSpan(t,e={},n=Lt.active()){e.root&&(n=Kt.deleteSpan(n));const r=Kt.getSpan(n);if(Qt(n)){xt.debug("Instrumentation suppressed, returning Noop Span");return Kt.wrapSpanContext(ut)}const o=r?.spanContext(),i=this._idGenerator.generateSpanId();let s,a,u;o&&Kt.isSpanContextValid(o)?(a=o.traceId,u=o.traceState,s=o):a=this._idGenerator.generateTraceId();const c=e.kind??Ot.INTERNAL,l=(e.links??[]).map(t=>({context:t.context,attributes:ee(t.attributes)})),p=ee(e.attributes),d=this._sampler.shouldSample(n,a,t,c,p,l),h=this._tracerMetrics.startSpan(o,d.decision);u=d.traceState??u;const f={traceId:a,spanId:i,traceFlags:d.decision===At.RECORD_AND_SAMPLED?X.SAMPLED:X.NONE,traceState:u};if(d.decision===At.NOT_RECORD){xt.debug("Recording is off, propagating context in a non-recording span");return Kt.wrapSpanContext(f)}const g=ee(Object.assign(p,d.attributes));return new vr({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:f,name:t,kind:c,links:l,parentSpanContext:s,attributes:g,startTime:e.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:h})}startActiveSpan(t,e,n,r){let o,i,s;if(arguments.length<2)return;2===arguments.length?s=e:3===arguments.length?(o=e,s=n):(o=e,i=n,s=r);const a=i??Lt.active(),u=this.startSpan(t,o,a),c=Kt.setSpan(a,u);return Lt.with(c,s,void 0,u)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}class Vr{_spanProcessors;constructor(t){this._spanProcessors=t}forceFlush(){const t=[];for(const e of this._spanProcessors)t.push(e.forceFlush());return new Promise(e=>{Promise.all(t).then(()=>{e()}).catch(t=>{ae(t||new Error("MultiSpanProcessor: forceFlush failed")),e()})})}onStart(t,e){for(const n of this._spanProcessors)n.onStart(t,e)}onEnding(t){for(const e of this._spanProcessors)e.onEnding&&e.onEnding(t)}onEnd(t){for(const e of this._spanProcessors)e.onEnd(t)}shutdown(){const t=[];for(const e of this._spanProcessors)t.push(e.shutdown());return new Promise((e,n)=>{Promise.all(t).then(()=>{e()},n)})}}var $r,zr;!function(t){t[t.resolved=0]="resolved",t[t.timeout=1]="timeout",t[t.error=2]="error",t[t.unresolved=3]="unresolved"}($r||($r={}));class qr{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(t={}){const e=an({},Or(),function(t){const e=Object.assign({},t.spanLimits);return e.attributeCountLimit=t.spanLimits?.attributeCountLimit??t.generalLimits?.attributeCountLimit??void 0??void 0??128,e.attributeValueLengthLimit=t.spanLimits?.attributeValueLengthLimit??t.generalLimits?.attributeValueLengthLimit??void 0??void 0??Rr,Object.assign({},t,{spanLimits:e})}(t));this._resource=e.resource??mr(),this._config=Object.assign({},e,{resource:this._resource});const n=[];t.spanProcessors?.length&&n.push(...t.spanProcessors),this._activeSpanProcessor=new Vr(n)}getTracer(t,e,n){const r=`${t}@${e||""}:${n?.schemaUrl||""}`;return this._tracers.has(r)||this._tracers.set(r,new Hr({name:t,version:e,schemaUrl:n?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(r)}forceFlush(){const t=this._config.forceFlushTimeoutMillis,e=this._activeSpanProcessor._spanProcessors.map(e=>new Promise(n=>{let r;const o=setTimeout(()=>{n(new Error(`Span processor did not completed within timeout period of ${t} ms`)),r=$r.timeout},t);e.forceFlush().then(()=>{clearTimeout(o),r!==$r.timeout&&(r=$r.resolved,n(r))}).catch(t=>{clearTimeout(o),r=$r.error,n(t)})}));return new Promise((t,n)=>{Promise.all(e).then(e=>{const r=e.filter(t=>t!==$r.resolved);r.length>0?n(r):t()}).catch(t=>n([t]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}class Gr{_enabled=!1;_currentContext=N;_bindFunction(t=N,e){const n=this,r=function(...r){return n.with(t,()=>e.apply(this,r))};return Object.defineProperty(r,"length",{enumerable:!1,configurable:!0,writable:!1,value:e.length}),r}active(){return this._currentContext}bind(t,e){return void 0===t&&(t=this.active()),"function"==typeof e?this._bindFunction(t,e):e}disable(){return this._currentContext=N,this._enabled=!1,this}enable(){return this._enabled||(this._enabled=!0,this._currentContext=N),this}with(t,e,n,...r){const o=this._currentContext;this._currentContext=t||N;try{return e.call(n,...r)}finally{this._currentContext=o}}}class Kr extends qr{constructor(t={}){super(t)}register(t={}){var e;Kt.setGlobalTracerProvider(this),null!==(e=t.propagator)&&(void 0!==e?qt.setGlobalPropagator(e):qt.setGlobalPropagator(new Ue({propagators:[new Ke,new te]}))),function(t){if(null!==t){if(void 0===t){const t=new Gr;return t.enable(),void Lt.setGlobalContextManager(t)}t.enable(),Lt.setGlobalContextManager(t)}}(t.contextManager)}}!function(t){t.CONNECT_END="connectEnd",t.CONNECT_START="connectStart",t.DECODED_BODY_SIZE="decodedBodySize",t.DOM_COMPLETE="domComplete",t.DOM_CONTENT_LOADED_EVENT_END="domContentLoadedEventEnd",t.DOM_CONTENT_LOADED_EVENT_START="domContentLoadedEventStart",t.DOM_INTERACTIVE="domInteractive",t.DOMAIN_LOOKUP_END="domainLookupEnd",t.DOMAIN_LOOKUP_START="domainLookupStart",t.ENCODED_BODY_SIZE="encodedBodySize",t.FETCH_START="fetchStart",t.LOAD_EVENT_END="loadEventEnd",t.LOAD_EVENT_START="loadEventStart",t.NAVIGATION_START="navigationStart",t.REDIRECT_END="redirectEnd",t.REDIRECT_START="redirectStart",t.REQUEST_START="requestStart",t.RESPONSE_END="responseEnd",t.RESPONSE_START="responseStart",t.SECURE_CONNECTION_START="secureConnectionStart",t.START_TIME="startTime",t.UNLOAD_EVENT_END="unloadEventEnd",t.UNLOAD_EVENT_START="unloadEventStart"}(zr||(zr={}));let Wr;function Xr(t,e,n,r=!0){if(!(o=n,i=e,!(i in o)||"number"!=typeof n[e]||r&&0===n[e]))return t.addEvent(e,n[e]);var o,i}function Qr(t,e,n=!1,r,o){if(void 0===r&&(r=0!==e[zr.START_TIME]),n||(Xr(t,zr.FETCH_START,e,r),Xr(t,zr.DOMAIN_LOOKUP_START,e,r),Xr(t,zr.DOMAIN_LOOKUP_END,e,r),Xr(t,zr.CONNECT_START,e,r),Xr(t,zr.SECURE_CONNECTION_START,e,r),Xr(t,zr.CONNECT_END,e,r),Xr(t,zr.REQUEST_START,e,r),Xr(t,zr.RESPONSE_START,e,r),Xr(t,zr.RESPONSE_END,e,r)),!o){const n=e[zr.ENCODED_BODY_SIZE];void 0!==n&&t.setAttribute("http.response_content_length",n);const r=e[zr.DECODED_BODY_SIZE];void 0!==r&&n!==r&&t.setAttribute("http.response_content_length_uncompressed",r)}}function Yr(){return"undefined"!=typeof location?location.origin:void 0}function Zr(t,e,n,r,o=new WeakSet,i){const s=Jr(t),a=function(t,e,n,r,o,i){const s=xe(e),a=xe(n);let u=r.filter(e=>{const n=xe(Pe(e[zr.FETCH_START])),r=xe(Pe(e[zr.RESPONSE_END]));return e.initiatorType.toLowerCase()===(i||"xmlhttprequest")&&e.name===t&&n>=s&&r<=a});u.length>0&&(u=u.filter(t=>!o.has(t)));return u}(t=s.toString(),e,n,r,o,i);if(0===a.length)return{mainRequest:void 0};if(1===a.length)return{mainRequest:a[0]};const u=function(t){return t.slice().sort((t,e)=>{const n=t[zr.FETCH_START],r=e[zr.FETCH_START];return n>r?1:n<r?-1:0})}(a);if(s.origin!==Yr()&&u.length>1){let t=u[0],e=function(t,e,n){const r=xe(n),o=xe(Pe(e));let i,s=t[1];const a=t.length;for(let e=1;e<a;e++){const n=t[e],a=xe(Pe(n[zr.FETCH_START])),u=r-xe(Pe(n[zr.RESPONSE_END]));a>=o&&(!i||u<i)&&(i=u,s=n)}return s}(u,t[zr.RESPONSE_END],n);const r=t[zr.RESPONSE_END];return e[zr.FETCH_START]<r&&(e=t,t=void 0),{corsPreFlightRequest:t,mainRequest:e}}return{mainRequest:a[0]}}function Jr(t){if("function"==typeof URL)return new URL(t,"undefined"!=typeof document?document.baseURI:"undefined"!=typeof location?location.href:void 0);const e=(Wr||(Wr=document.createElement("a")),Wr);return e.href=t,e}function to(t,e){let n=e||[];("string"==typeof n||n instanceof RegExp)&&(n=[n]);return Jr(t).origin===Yr()||n.some(e=>mn(t,e))}var eo;!function(t){t.COMPONENT="component",t.HTTP_STATUS_TEXT="http.status_text"}(eo||(eo={}));const no=xt.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-fetch/utils"});function ro(...t){if(t[0]instanceof URL||"string"==typeof t[0]){const e=t[1];if(!e?.body)return Promise.resolve();if(e.body instanceof ReadableStream){const{body:t,length:n}=function(t){if(!t.pipeThrough)return no.warn("Platform has ReadableStream but not pipeThrough!"),{body:t,length:Promise.resolve(void 0)};let e,n=0;const r=new Promise(t=>{e=t}),o=new TransformStream({start(){},async transform(t,e){const r=await t;n+=r.byteLength,e.enqueue(t)},flush(){e(n)}});return{body:t.pipeThrough(o),length:r}}(e.body);return e.body=t,n}return Promise.resolve(function(t){if(e=t,"undefined"!=typeof Document&&e instanceof Document)return(new XMLSerializer).serializeToString(document).length;var e;if("string"==typeof t)return io(t);if(t instanceof Blob)return t.size;if(t instanceof FormData)return function(t){let e=0;for(const[n,r]of t.entries())e+=n.length,r instanceof Blob?e+=r.size:e+=r.length;return e}(t);if(t instanceof URLSearchParams)return io(t.toString());if(void 0!==t.byteLength)return t.byteLength;return void no.warn("unknown body type")}(e.body))}{const e=t[0];return e?.body?e.clone().text().then(t=>io(t)):Promise.resolve()}}const oo=new TextEncoder;function io(t){return oo.encode(t).byteLength}function so(t){const e=function(){void 0===uo&&(uo=ao);return uo}(),n=t.toUpperCase();return n in e?n:"_OTHER"}const ao={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0};let uo;const co={"https:":"443","http:":"80"};const lo="0.213.0",po="undefined"!=typeof PerformanceObserver;class ho extends sr{component="fetch";version=lo;moduleName=this.component;_usedResources=new WeakSet;_tasksCount=0;_semconvStability;constructor(t={}){super("@opentelemetry/instrumentation-fetch",lo,t),this._semconvStability=lr("http",t?.semconvStabilityOptIn)}init(){}_addChildSpan(t,e){const n=this.tracer.startSpan("CORS Preflight",{startTime:e[zr.FETCH_START]},Kt.setSpan(Lt.active(),t)),r=!(this._semconvStability&cr.OLD);Qr(n,e,this.getConfig().ignoreNetworkEvents,void 0,r),n.end(e[zr.RESPONSE_END])}_addFinalSpanAttributes(t,e){const n=Jr(e.url);if(this._semconvStability&cr.OLD&&(t.setAttribute("http.status_code",e.status),null!=e.statusText&&t.setAttribute(eo.HTTP_STATUS_TEXT,e.statusText),t.setAttribute("http.host",n.host),t.setAttribute("http.scheme",n.protocol.replace(":","")),"undefined"!=typeof navigator&&t.setAttribute("http.user_agent",navigator.userAgent)),this._semconvStability&cr.STABLE){t.setAttribute(ge,e.status),t.setAttribute(me,n.hostname);const r=function(t){const e=Number(t.port||co[t.protocol]);return e&&!isNaN(e)?e:void 0}(n);r&&t.setAttribute(_e,r)}}_addHeaders(t,e){if(!to(e,this.getConfig().propagateTraceHeaderCorsUrls)){const t={};return qt.inject(Lt.active(),t),void(Object.keys(t).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}if(t instanceof Request)qt.inject(Lt.active(),t.headers,{set:(t,e,n)=>t.set(e,"string"==typeof n?n:String(n))});else{const e=new Headers(t.headers);qt.inject(Lt.active(),e,{set:(t,e,n)=>t.set(e,"string"==typeof n?n:String(n))}),t.headers=e}}_clearResources(){0===this._tasksCount&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(t,e={}){if(_n(t,this.getConfig().ignoreUrls))return void this._diag.debug("ignoring span as url matches ignored url");let n="";const r={};if(this._semconvStability&cr.OLD){const o=(e.method||"GET").toUpperCase();n=`HTTP ${o}`,r[eo.COMPONENT]=this.moduleName,r["http.method"]=o,r["http.url"]=t}if(this._semconvStability&cr.STABLE){const o=e.method,i=so(e.method||"GET");n||(n=i),r[he]=i,i!==o&&(r[fe]=o),r[Ee]=t}return this.tracer.startSpan(n,{kind:Ot.CLIENT,attributes:r})}_findResourceAndAddNetworkEvents(t,e,n){let r=e.entries;if(!r.length){if(!performance.getEntriesByType)return;r=performance.getEntriesByType("resource")}const o=Zr(e.spanUrl,e.startTime,n,r,this._usedResources,"fetch");if(o.mainRequest){const e=o.mainRequest;this._markResourceAsUsed(e);const n=o.corsPreFlightRequest;n&&(this._addChildSpan(t,n),this._markResourceAsUsed(n));const r=!(this._semconvStability&cr.OLD);Qr(t,e,this.getConfig().ignoreNetworkEvents,void 0,r)}}_markResourceAsUsed(t){this._usedResources.add(t)}_endSpan(t,e,n){const r=Re(Date.now()),o=Ne();this._addFinalSpanAttributes(t,n),this._semconvStability&cr.STABLE&&n.status>=400&&(t.setStatus({code:wt.ERROR}),t.setAttribute(le,String(n.status))),setTimeout(()=>{e.observer?.disconnect(),this._findResourceAndAddNetworkEvents(t,e,o),this._tasksCount--,this._clearResources(),t.end(r)},300)}_patchConstructor(){return t=>{const e=this,n=new Set(["url","type","redirected"]);function r(t,e){return new Proxy(t,{get(t,o,i){if("string"==typeof o&&n.has(o))return Reflect.get(e,o);if("clone"===o)return function(){return r(t.clone(),e)};const s=Reflect.get(t,o,t);return"function"==typeof s?s.bind(t):s}})}return function(...n){const o=this,i=Jr(n[0]instanceof Request?n[0].url:String(n[0])).href,s=n[0]instanceof Request?n[0]:n[1]||{},a=e._createSpan(i,s);if(!a)return t.apply(this,n);const u=e._prepareSpanData(i);function c(t,n){e._applyAttributesAfterFetch(t,s,n),e._endSpan(t,u,{status:n.status||0,statusText:n.message,url:i})}function l(t,n){e._applyAttributesAfterFetch(t,s,n),n.status>=200&&n.status<400?e._endSpan(t,u,n):e._endSpan(t,u,{status:n.status,statusText:n.statusText,url:i})}function p(t,e,n){let o=null;try{const e=n.clone().body;if(e){const i=e.getReader(),s=204===n.status||205===n.status||304===n.status?null:function(t,e){if(!t)return null;const n=t.getReader();return new ReadableStream({async pull(t){try{const{value:e,done:r}=await n.read();r?(n.releaseLock(),t.close()):t.enqueue(e)}catch(e){t.error(e),n.cancel(e).catch(t=>{});try{n.releaseLock()}catch{}}},cancel:t=>(e.cancel(t).catch(t=>{}),n.cancel(t))})}(n.body,i);o=r(new Response(s,{status:n.status,statusText:n.statusText,headers:n.headers}),n);const a=()=>{i.read().then(({done:e})=>{e?l(t,n):a()},e=>{c(t,e)})};a()}else l(t,n)}finally{e(o??n)}}function d(t,e,n){try{c(t,n)}finally{e(n)}}return e.getConfig().measureRequestSize&&ro(...n).then(t=>{t&&(e._semconvStability&cr.OLD&&a.setAttribute("http.request_content_length_uncompressed",t),e._semconvStability&cr.STABLE&&a.setAttribute("http.request.body.size",t))}).catch(t=>{e._diag.warn("getFetchBodyLength",t)}),new Promise((n,r)=>Lt.with(Kt.setSpan(Lt.active(),a),()=>(e._callRequestHook(a,s),e._addHeaders(s,i),e._tasksCount++,t.apply(o,s instanceof Request?[s]:[i,s]).then(p.bind(o,a,n),d.bind(o,a,r)))))}}}_applyAttributesAfterFetch(t,e,n){const r=this.getConfig().applyCustomAttributesOnSpan;r&&ar(()=>r(t,e,n),t=>{t&&this._diag.error("applyCustomAttributesOnSpan",t)})}_callRequestHook(t,e){const n=this.getConfig().requestHook;n&&ar(()=>n(t,e),t=>{t&&this._diag.error("requestHook",t)})}_prepareSpanData(t){const e=Ne(),n=[];if("function"!=typeof PerformanceObserver)return{entries:n,startTime:e,spanUrl:t};const r=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{"fetch"===e.initiatorType&&e.name===t&&n.push(e)})});return r.observe({entryTypes:["resource"]}),{entries:n,observer:r,startTime:e,spanUrl:t}}enable(){po?(ur(fetch)&&(this._unwrap(globalThis,"fetch"),this._diag.debug("removing previous patch for constructor")),this._wrap(globalThis,"fetch",this._patchConstructor())):this._diag.warn("this instrumentation is intended for web usage only, it does not instrument server-side fetch()")}disable(){po&&(this._unwrap(globalThis,"fetch"),this._usedResources=new WeakSet)}}var fo;!function(t){t.METHOD_OPEN="open",t.METHOD_SEND="send",t.EVENT_ABORT="abort",t.EVENT_ERROR="error",t.EVENT_LOAD="loaded",t.EVENT_TIMEOUT="timeout"}(fo||(fo={}));const go=xt.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-xml-http-request/utils"});function mo(t){return e=t,"undefined"!=typeof Document&&e instanceof Document?(new XMLSerializer).serializeToString(document).length:"string"==typeof t?vo(t):t instanceof Blob?t.size:t instanceof FormData?function(t){let e=0;for(const[n,r]of t.entries())e+=n.length,r instanceof Blob?e+=r.size:e+=r.length;return e}(t):t instanceof URLSearchParams?vo(t.toString()):void 0!==t.byteLength?t.byteLength:void go.warn("unknown body type");var e}const _o=new TextEncoder;function vo(t){return _o.encode(t).byteLength}const So={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0};let yo;function bo(){return void 0===yo&&(yo=So),yo}const Eo={"https:":"443","http:":"80"};const To="0.213.0";var Ao;!function(t){t.HTTP_STATUS_TEXT="http.status_text"}(Ao||(Ao={}));class Oo extends sr{component="xml-http-request";version=To;moduleName=this.component;_tasksCount=0;_xhrMem=new WeakMap;_usedResources=new WeakSet;_semconvStability;constructor(t={}){super("@opentelemetry/instrumentation-xml-http-request",To,t),this._semconvStability=lr("http",t?.semconvStabilityOptIn)}init(){}_addHeaders(t,e){if(!to(Jr(e).href,this.getConfig().propagateTraceHeaderCorsUrls)){const t={};return qt.inject(Lt.active(),t),void(Object.keys(t).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}const n={};qt.inject(Lt.active(),n),Object.keys(n).forEach(e=>{t.setRequestHeader(e,String(n[e]))})}_addChildSpan(t,e){Lt.with(Kt.setSpan(Lt.active(),t),()=>{const t=this.tracer.startSpan("CORS Preflight",{startTime:e[zr.FETCH_START]}),n=!(this._semconvStability&cr.OLD);Qr(t,e,this.getConfig().ignoreNetworkEvents,void 0,n),t.end(e[zr.RESPONSE_END])})}_addFinalSpanAttributes(t,e,n){if(this._semconvStability&cr.OLD){if(void 0!==e.status&&t.setAttribute("http.status_code",e.status),void 0!==e.statusText&&t.setAttribute(Ao.HTTP_STATUS_TEXT,e.statusText),"string"==typeof n){const e=Jr(n);t.setAttribute("http.host",e.host),t.setAttribute("http.scheme",e.protocol.replace(":",""))}t.setAttribute("http.user_agent",navigator.userAgent)}this._semconvStability&cr.STABLE&&e.status&&t.setAttribute(ge,e.status)}_applyAttributesAfterXHR(t,e){const n=this.getConfig().applyCustomAttributesOnSpan;"function"==typeof n&&ar(()=>n(t,e),t=>{t&&this._diag.error("applyCustomAttributesOnSpan",t)})}_addResourceObserver(t,e){const n=this._xhrMem.get(t);n&&"function"==typeof PerformanceObserver&&"function"==typeof PerformanceResourceTiming&&(n.createdResources={observer:new PerformanceObserver(t=>{const r=t.getEntries(),o=Jr(e);r.forEach(t=>{"xmlhttprequest"===t.initiatorType&&t.name===o.href&&n.createdResources&&n.createdResources.entries.push(t)})}),entries:[]},n.createdResources.observer.observe({entryTypes:["resource"]}))}_clearResources(){0===this._tasksCount&&this.getConfig().clearTimingResources&&(Oe.clearResourceTimings(),this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}_findResourceAndAddNetworkEvents(t,e,n,r,o){if(!(n&&r&&o&&t.createdResources))return;let i=t.createdResources.entries;i&&i.length||(i=Oe.getEntriesByType("resource"));const s=Zr(Jr(n).href,r,o,i,this._usedResources);if(s.mainRequest){const t=s.mainRequest;this._markResourceAsUsed(t);const n=s.corsPreFlightRequest;n&&(this._addChildSpan(e,n),this._markResourceAsUsed(n));const r=!(this._semconvStability&cr.OLD);Qr(e,t,this.getConfig().ignoreNetworkEvents,void 0,r)}}_cleanPreviousSpanInformation(t){const e=this._xhrMem.get(t);if(e){const n=e.callbackToRemoveEvents;n&&n(),this._xhrMem.delete(t)}}_createSpan(t,e,n){if(_n(e,this.getConfig().ignoreUrls))return void this._diag.debug("ignoring span as url matches ignored url");let r="";const o=Jr(e),i={};if(this._semconvStability&cr.OLD&&(r=n.toUpperCase(),i["http.method"]=n,i["http.url"]=o.toString()),this._semconvStability&cr.STABLE){const t=n,e=function(t){const e=bo(),n=t.toUpperCase();return n in e?n:"_OTHER"}(n);r||(r=e),i[he]=e,e!==t&&(i[fe]=t),i[Ee]=o.toString(),i[me]=o.hostname;const s=function(t){const e=Number(t.port||Eo[t.protocol]);return e&&!isNaN(e)?e:void 0}(o);s&&(i[_e]=s)}const s=this.tracer.startSpan(r,{kind:Ot.CLIENT,attributes:i});return s.addEvent(fo.METHOD_OPEN),this._cleanPreviousSpanInformation(t),this._xhrMem.set(t,{span:s,spanUrl:e}),s}_markResourceAsUsed(t){this._usedResources.add(t)}_patchOpen(){return t=>{const e=this;return function(...n){const r=n[0],o=n[1];return e._createSpan(this,o,r),t.apply(this,n)}}}_patchSend(){const t=this;function e(e,n,r,o){const i=t._xhrMem.get(n);if(!i)return;if(i.status=n.status,i.statusText=n.statusText,t._xhrMem.delete(n),i.span){const e=i.span;t._applyAttributesAfterXHR(e,n),t._semconvStability&cr.STABLE&&(r?o&&(e.setStatus({code:wt.ERROR,message:o}),e.setAttribute(le,o)):i.status&&i.status>=400&&(e.setStatus({code:wt.ERROR}),e.setAttribute(le,String(i.status))))}const s=Ne(),a=Date.now();setTimeout(()=>{!function(e,n,r,o){const i=n.callbackToRemoveEvents;"function"==typeof i&&i();const{span:s,spanUrl:a,sendStartTime:u}=n;s&&(t._findResourceAndAddNetworkEvents(n,s,a,u,r),s.addEvent(e,o),t._addFinalSpanAttributes(s,n,a),s.end(o),t._tasksCount--),t._clearResources()}(e,i,s,a)},300)}function n(){e(fo.EVENT_ERROR,this,!0,"error")}function r(){e(fo.EVENT_ABORT,this,!1)}function o(){e(fo.EVENT_TIMEOUT,this,!0,"timeout")}function i(){this.status<299?e(fo.EVENT_LOAD,this,!1):e(fo.EVENT_ERROR,this,!1)}return e=>function(...s){const a=t._xhrMem.get(this);if(!a)return e.apply(this,s);const u=a.span,c=a.spanUrl;if(u&&c){if(t.getConfig().measureRequestSize&&s?.[0]){const e=mo(s[0]);void 0!==e&&(t._semconvStability&cr.OLD&&u.setAttribute("http.request_content_length_uncompressed",e),t._semconvStability&cr.STABLE&&u.setAttribute("http.request.body.size",e))}Lt.with(Kt.setSpan(Lt.active(),u),()=>{t._tasksCount++,a.sendStartTime=Ne(),u.addEvent(fo.METHOD_SEND),this.addEventListener("abort",r),this.addEventListener("error",n),this.addEventListener("load",i),this.addEventListener("timeout",o),a.callbackToRemoveEvents=()=>{!function(e){e.removeEventListener("abort",r),e.removeEventListener("error",n),e.removeEventListener("load",i),e.removeEventListener("timeout",o);const s=t._xhrMem.get(e);s&&(s.callbackToRemoveEvents=void 0)}(this),a.createdResources&&a.createdResources.observer.disconnect()},t._addHeaders(this,c),t._addResourceObserver(this,c)})}return e.apply(this,s)}}enable(){this._diag.debug("applying patch to",this.moduleName,this.version),ur(XMLHttpRequest.prototype.open)&&(this._unwrap(XMLHttpRequest.prototype,"open"),this._diag.debug("removing previous patch from method open")),ur(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 wo extends Oo{constructor(t={}){super(t);this.parentCreateSpan=this._createSpan.bind(this)}_patchOpen(){return t=>{const n=this;return function(...r){let o;try{const t=r[0];let i=e.getUrlFromResource(r[1]);o=n.parentCreateSpan(this,i,t)}catch(t){e.faro.internalLogger.error(t)}const i=e.faro.api.getActiveUserAction();return o&&i&&(null==i?void 0:i.getState())===e.UserActionState.Started&&(o.setAttribute("faro.action.user.name",i.name),o.setAttribute("faro.action.user.parentId",i.parentId)),t.apply(this,r)}}}}function Co(t,e,n){Ro(t,n instanceof Error?0:n.status)}function Ro(t,e){if(null==e)return;(0===e||e>=400&&e<600)&&t.setStatus({code:wt.ERROR})}function No(t){return(e,n,r)=>{Co(e,0,r),null==t||t(e,n,r)}}function Po(t){return(e,n)=>{!function(t,e){Ro(t,e.status)}(e,n),null==t||t(e,n)}}function Lo(t={}){const{fetchInstrumentationOptions:n,xhrInstrumentationOptions:r}=t,o=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(t,["fetchInstrumentationOptions","xhrInstrumentationOptions"]),i=function(t,n){return Object.assign(Object.assign(Object.assign(Object.assign({},n),{ignoreNetworkEvents:!0}),t),{applyCustomAttributesOnSpan:No(null==t?void 0:t.applyCustomAttributesOnSpan),requestHook:(t,n)=>{const r=e.faro.api.getActiveUserAction();r&&(null==r?void 0:r.getState())===e.UserActionState.Started&&(t.setAttribute("faro.action.user.name",r.name),t.setAttribute("faro.action.user.parentId",r.parentId))}})}(n,o),s=function(t,e){return Object.assign(Object.assign(Object.assign(Object.assign({},e),{ignoreNetworkEvents:!0}),t),{applyCustomAttributesOnSpan:Po(null==t?void 0:t.applyCustomAttributesOnSpan)})}(r,o);return[new ho(i),new wo(s)]}class xo{constructor(t,e){this.processor=t,this.metas=e}forceFlush(){return this.processor.forceFlush()}onStart(t,e){var n;const r=this.metas.value.session;(null==r?void 0:r.id)&&(t.attributes["session.id"]=r.id);const o=null!==(n=this.metas.value.user)&&void 0!==n?n:{};o.email&&(t.attributes["user.email"]=o.email),o.id&&(t.attributes["user.id"]=o.id),o.username&&(t.attributes["user.name"]=o.username),o.fullName&&(t.attributes["user.full_name"]=o.fullName),o.roles&&(t.attributes["user.roles"]=o.roles.split(",").map(t=>t.trim())),o.hash&&(t.attributes["user.hash"]=o.hash),this.processor.onStart(t,e)}onEnd(t){this.processor.onEnd(t)}shutdown(){return this.processor.shutdown()}}function Do(t={}){var e;return"true"===(null===(e=t.attributes)||void 0===e?void 0:e.isSampled)?Sr.RECORD_AND_SAMPLED:Sr.NOT_RECORD}class Io extends e.BaseInstrumentation{constructor(t={}){super(),this.options=t,this.name="@grafana/faro-web-tracing",this.version=e.VERSION}initialize(){var t,n,r,o,i;const s=this.options,a={};this.config.app.name&&(a[ve]=this.config.app.name),this.config.app.namespace&&(a["service.namespace"]=this.config.app.namespace),this.config.app.version&&(a["service.version"]=this.config.app.version),this.config.app.environment&&(a["deployment.environment.name"]=this.config.app.environment,a["deployment.environment"]=this.config.app.environment);const u=this.metas.value.browser;e.isArray(null==u?void 0:u.brands)&&(a["browser.brands"]=u.brands.map(t=>t.brand)),(null==u?void 0:u.language)&&(a["browser.language"]=u.language),"boolean"==typeof(null==u?void 0:u.mobile)&&(a["browser.mobile"]=Boolean(u.mobile)),(null==u?void 0:u.os)&&(a["browser.platform"]=u.os),(null==u?void 0:u.userAgent)&&(a["user_agent.original"]=u.userAgent),a["process.runtime.name"]="browser",a["process.runtime.version"]=null===(t=this.metas.value.browser)||void 0===t?void 0:t.userAgent,a["telemetry.distro.name"]="faro-web-sdk",a["telemetry.distro.version"]=e.VERSION,Object.assign(a,s.resourceAttributes);const c=mr().merge(gr(a));new Kr({resource:c,sampler:{shouldSample:()=>({decision:Do(this.api.getSession())})},spanProcessors:[null!==(n=s.spanProcessor)&&void 0!==n?n:new xo(new Pr(new $n({api:this.api}),{scheduledDelayMillis:Io.SCHEDULED_BATCH_DELAY_MS,maxExportBatchSize:30}),this.metas)]}).register({propagator:null!==(r=s.propagator)&&void 0!==r?r:new Ke,contextManager:s.contextManager});const{propagateTraceHeaderCorsUrls:l,fetchInstrumentationOptions:p,xhrInstrumentationOptions:d}=null!==(o=this.options.instrumentationOptions)&&void 0!==o?o:{};!function(t){const e=t.tracerProvider||Kt.getTracerProvider(),n=t.meterProvider||Mt.getMeterProvider(),r=t.loggerProvider||Zn.getLoggerProvider(),o=t.instrumentations?.flat()??[];(function(t,e,n,r){for(let o=0,i=t.length;o<i;o++){const i=t[o];e&&i.setTracerProvider(e),n&&i.setMeterProvider(n),r&&i.setLoggerProvider&&i.setLoggerProvider(r),i.getConfig().enabled||i.enable()}})(o,e,n,r)}({instrumentations:null!==(i=s.instrumentations)&&void 0!==i?i:Lo({ignoreUrls:this.getIgnoreUrls(),propagateTraceHeaderCorsUrls:l,fetchInstrumentationOptions:p,xhrInstrumentationOptions:d})}),this.api.initOTEL(Kt,Lt)}getIgnoreUrls(){return this.transports.transports.flatMap(t=>t.getIgnoreUrls())}}Io.SCHEDULED_BATCH_DELAY_MS=1e3;return t.FaroMetaAttributesSpanProcessor=xo,t.FaroTraceExporter=$n,t.FaroUserActionSpanProcessor=class{constructor(t){this.processor=t}forceFlush(){return this.processor.forceFlush()}onStart(t,n){const r=e.faro.api.getActiveUserAction();r&&(null==r?void 0:r.getState())===e.UserActionState.Started&&t.kind===Ot.CLIENT&&(t.attributes["faro.action.user.name"]||(t.attributes["faro.action.user.name"]=null==r?void 0:r.name),t.attributes["faro.action.user.parentId"]||(t.attributes["faro.action.user.parentId"]=null==r?void 0:r.parentId)),this.processor.onStart(t,n)}onEnd(t){this.processor.onEnd(t)}shutdown(){return this.processor.shutdown()}},t.TracingInstrumentation=Io,t.fetchCustomAttributeFunctionWithDefaults=No,t.getDefaultOTELInstrumentations=Lo,t.getSamplingDecision=Do,t.setSpanStatusOnFetchError=Co,t}({},GrafanaFaroWebSdk);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FaroTraceExporter = void 0;
|
|
4
4
|
var core_1 = require("@opentelemetry/core");
|
|
5
|
+
var utils_1 = require("@opentelemetry/otlp-transformer/build/src/common/utils");
|
|
5
6
|
var internal_1 = require("@opentelemetry/otlp-transformer/build/src/trace/internal");
|
|
6
7
|
var faroTraceExporter_utils_1 = require("./faroTraceExporter.utils");
|
|
7
8
|
var FaroTraceExporter = /** @class */ (function () {
|
|
@@ -9,7 +10,7 @@ var FaroTraceExporter = /** @class */ (function () {
|
|
|
9
10
|
this.config = config;
|
|
10
11
|
}
|
|
11
12
|
FaroTraceExporter.prototype.export = function (spans, resultCallback) {
|
|
12
|
-
var traceEvent = (0, internal_1.createExportTraceServiceRequest)(spans,
|
|
13
|
+
var traceEvent = (0, internal_1.createExportTraceServiceRequest)(spans, utils_1.JSON_ENCODER);
|
|
13
14
|
this.config.api.pushTraces(traceEvent);
|
|
14
15
|
(0, faroTraceExporter_utils_1.sendFaroEvents)(traceEvent.resourceSpans, this.config.api);
|
|
15
16
|
resultCallback({ code: core_1.ExportResultCode.SUCCESS });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"faroTraceExporter.js","sourceRoot":"","sources":["../../src/faroTraceExporter.ts"],"names":[],"mappings":";;;AAAA,4CAAuD;AAEvD,qFAA2G;AAG3G,qEAA2D;AAG3D;IACE,2BAAoB,MAA+B;QAA/B,WAAM,GAAN,MAAM,CAAyB;IAAG,CAAC;IAEvD,kCAAM,GAAN,UAAO,KAAqB,EAAE,cAA8C;QAC1E,IAAM,UAAU,GAAG,IAAA,0CAA+B,EAAC,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"faroTraceExporter.js","sourceRoot":"","sources":["../../src/faroTraceExporter.ts"],"names":[],"mappings":";;;AAAA,4CAAuD;AAEvD,gFAAsF;AACtF,qFAA2G;AAG3G,qEAA2D;AAG3D;IACE,2BAAoB,MAA+B;QAA/B,WAAM,GAAN,MAAM,CAAyB;IAAG,CAAC;IAEvD,kCAAM,GAAN,UAAO,KAAqB,EAAE,cAA8C;QAC1E,IAAM,UAAU,GAAG,IAAA,0CAA+B,EAAC,KAAK,EAAE,oBAAY,CAAC,CAAC;QAExE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACvC,IAAA,wCAAc,EAAC,UAAU,CAAC,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAE1D,cAAc,CAAC,EAAE,IAAI,EAAE,uBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,oCAAQ,GAAR;QACE,OAAO,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACpC,CAAC;IACH,wBAAC;AAAD,CAAC,AAfD,IAeC;AAfY,8CAAiB","sourcesContent":["import { ExportResultCode } from '@opentelemetry/core';\nimport type { ExportResult } from '@opentelemetry/core';\nimport { JSON_ENCODER } from '@opentelemetry/otlp-transformer/build/src/common/utils';\nimport { createExportTraceServiceRequest } from '@opentelemetry/otlp-transformer/build/src/trace/internal';\nimport type { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-web';\n\nimport { sendFaroEvents } from './faroTraceExporter.utils';\nimport type { FaroTraceExporterConfig } from './types';\n\nexport class FaroTraceExporter implements SpanExporter {\n constructor(private config: FaroTraceExporterConfig) {}\n\n export(spans: ReadableSpan[], resultCallback: (result: ExportResult) => void): void {\n const traceEvent = createExportTraceServiceRequest(spans, JSON_ENCODER);\n\n this.config.api.pushTraces(traceEvent);\n sendFaroEvents(traceEvent.resourceSpans, this.config.api);\n\n resultCallback({ code: ExportResultCode.SUCCESS });\n }\n\n shutdown(): Promise<void> {\n return Promise.resolve(undefined);\n }\n}\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ExportResultCode } from '@opentelemetry/core';
|
|
2
|
+
import { JSON_ENCODER } from '@opentelemetry/otlp-transformer/build/src/common/utils';
|
|
2
3
|
import { createExportTraceServiceRequest } from '@opentelemetry/otlp-transformer/build/src/trace/internal';
|
|
3
4
|
import { sendFaroEvents } from './faroTraceExporter.utils';
|
|
4
5
|
export class FaroTraceExporter {
|
|
@@ -6,7 +7,7 @@ export class FaroTraceExporter {
|
|
|
6
7
|
this.config = config;
|
|
7
8
|
}
|
|
8
9
|
export(spans, resultCallback) {
|
|
9
|
-
const traceEvent = createExportTraceServiceRequest(spans,
|
|
10
|
+
const traceEvent = createExportTraceServiceRequest(spans, JSON_ENCODER);
|
|
10
11
|
this.config.api.pushTraces(traceEvent);
|
|
11
12
|
sendFaroEvents(traceEvent.resourceSpans, this.config.api);
|
|
12
13
|
resultCallback({ code: ExportResultCode.SUCCESS });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"faroTraceExporter.js","sourceRoot":"","sources":["../../src/faroTraceExporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,+BAA+B,EAAE,MAAM,0DAA0D,CAAC;AAG3G,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG3D,MAAM,OAAO,iBAAiB;IAC5B,YAAoB,MAA+B;QAA/B,WAAM,GAAN,MAAM,CAAyB;IAAG,CAAC;IAEvD,MAAM,CAAC,KAAqB,EAAE,cAA8C;QAC1E,MAAM,UAAU,GAAG,+BAA+B,CAAC,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"faroTraceExporter.js","sourceRoot":"","sources":["../../src/faroTraceExporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,wDAAwD,CAAC;AACtF,OAAO,EAAE,+BAA+B,EAAE,MAAM,0DAA0D,CAAC;AAG3G,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG3D,MAAM,OAAO,iBAAiB;IAC5B,YAAoB,MAA+B;QAA/B,WAAM,GAAN,MAAM,CAAyB;IAAG,CAAC;IAEvD,MAAM,CAAC,KAAqB,EAAE,cAA8C;QAC1E,MAAM,UAAU,GAAG,+BAA+B,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QAExE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACvC,cAAc,CAAC,UAAU,CAAC,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAE1D,cAAc,CAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,QAAQ;QACN,OAAO,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACpC,CAAC;CACF","sourcesContent":["import { ExportResultCode } from '@opentelemetry/core';\nimport type { ExportResult } from '@opentelemetry/core';\nimport { JSON_ENCODER } from '@opentelemetry/otlp-transformer/build/src/common/utils';\nimport { createExportTraceServiceRequest } from '@opentelemetry/otlp-transformer/build/src/trace/internal';\nimport type { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-web';\n\nimport { sendFaroEvents } from './faroTraceExporter.utils';\nimport type { FaroTraceExporterConfig } from './types';\n\nexport class FaroTraceExporter implements SpanExporter {\n constructor(private config: FaroTraceExporterConfig) {}\n\n export(spans: ReadableSpan[], resultCallback: (result: ExportResult) => void): void {\n const traceEvent = createExportTraceServiceRequest(spans, JSON_ENCODER);\n\n this.config.api.pushTraces(traceEvent);\n sendFaroEvents(traceEvent.resourceSpans, this.config.api);\n\n resultCallback({ code: ExportResultCode.SUCCESS });\n }\n\n shutdown(): Promise<void> {\n return Promise.resolve(undefined);\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/faro-web-tracing",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Faro web tracing implementation.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"observability",
|
|
@@ -52,14 +52,14 @@
|
|
|
52
52
|
"quality:circular-deps": "madge --circular ."
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@grafana/faro-web-sdk": "^2.
|
|
55
|
+
"@grafana/faro-web-sdk": "^2.3.0",
|
|
56
56
|
"@opentelemetry/api": "^1.9.0",
|
|
57
57
|
"@opentelemetry/core": "^2.0.0",
|
|
58
|
-
"@opentelemetry/exporter-trace-otlp-http": "^0.
|
|
59
|
-
"@opentelemetry/instrumentation": "^0.
|
|
60
|
-
"@opentelemetry/instrumentation-fetch": "^0.
|
|
61
|
-
"@opentelemetry/instrumentation-xml-http-request": "^0.
|
|
62
|
-
"@opentelemetry/otlp-transformer": "^0.
|
|
58
|
+
"@opentelemetry/exporter-trace-otlp-http": "^0.213.0",
|
|
59
|
+
"@opentelemetry/instrumentation": "^0.213.0",
|
|
60
|
+
"@opentelemetry/instrumentation-fetch": "^0.213.0",
|
|
61
|
+
"@opentelemetry/instrumentation-xml-http-request": "^0.213.0",
|
|
62
|
+
"@opentelemetry/otlp-transformer": "^0.213.0",
|
|
63
63
|
"@opentelemetry/resources": "^2.0.0",
|
|
64
64
|
"@opentelemetry/sdk-trace-web": "^2.0.0",
|
|
65
65
|
"@opentelemetry/semantic-conventions": "^1.32.0"
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"publishConfig": {
|
|
68
68
|
"access": "public"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "92fd42a735ec3f3cb6516fa5eaa95d563cfa1862"
|
|
71
71
|
}
|