@blueking/open-telemetry 0.0.3 → 0.0.5

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,11 +1,11 @@
1
- var BkOpenTelemetry=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.defineProperty,n=(e,t)=>()=>(e&&(t=e(e=0)),t),r=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r};function i(e){"@babel/helpers - typeof";return i=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},i(e)}var a=n((()=>{}));function o(e,t){if(i(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(i(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var s=n((()=>{a()}));function c(e){var t=o(e,`string`);return i(t)==`symbol`?t:t+``}var l=n((()=>{a(),s()}));function u(e,t,n){return(t=c(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var d=n((()=>{l()}));function f(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function p(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){f(a,r,i,o,s,`next`,e)}function s(e){f(a,r,i,o,s,`throw`,e)}o(void 0)})}}var m=n((()=>{}));d(),m();var h=(e,t)=>typeof e.enabled==`function`?e.enabled(t):e.enabled!==!1,g=e=>e,_=class{constructor(e){u(this,`plugins`,void 0),u(this,`startedPlugins`,[]),this.plugins=e}flush(){var e=this;return p(function*(){yield Promise.all(e.startedPlugins.map(e=>Promise.resolve().then(()=>{var t;return(t=e.flush)==null?void 0:t.call(e)})))})()}shutdown(){var e=this;return p(function*(){let t=[...e.startedPlugins].reverse();for(let e of t){var n;yield(n=e.shutdown)==null?void 0:n.call(e)}e.startedPlugins=[]})()}start(e){var t=this;return p(function*(){try{for(let n of t.plugins)h(n,e.config)&&(yield n.init(e),t.startedPlugins.push(n))}catch(e){throw yield t.shutdown(),e}})()}},v,y=n((()=>{v=`1.9.1`}));function b(e){let t=new Set([e]),n=new Set,r=e.match(x);if(!r)return()=>!1;let i={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(i.prerelease!=null)return function(t){return t===e};function a(e){return n.add(e),!1}function o(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;let r=e.match(x);if(!r)return a(e);let s={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};return s.prerelease!=null||i.major!==s.major?a(e):i.major===0?i.minor===s.minor&&i.patch<=s.patch?o(e):a(e):i.minor<=s.minor?o(e):a(e)}}var x,S,C=n((()=>{y(),x=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,S=b(v)}));function w(e,t,n,r=!1){var i;let a=k[O]=(i=k[O])==null?{version:v}:i;if(!r&&a[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(t.stack||t.message),!1}if(a.version!==`1.9.1`){let t=Error(`@opentelemetry/api: Registration of version v${a.version} for ${e} does not match previously registered API v${v}`);return n.error(t.stack||t.message),!1}return a[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${v}.`),!0}function T(e){var t,n;let r=(t=k[O])==null?void 0:t.version;if(!(!r||!S(r)))return(n=k[O])==null?void 0:n[e]}function E(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${v}.`);let n=k[O];n&&delete n[e]}var D,O,k,A=n((()=>{y(),C(),D=v.split(`.`)[0],O=Symbol.for(`opentelemetry.js.api.${D}`),k=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{}}));function j(e,t,n){let r=T(`diag`);if(r)return r[e](t,...n)}var ee,M=n((()=>{A(),ee=class{constructor(e){this._namespace=e.namespace||`DiagComponentLogger`}debug(...e){return j(`debug`,this._namespace,e)}error(...e){return j(`error`,this._namespace,e)}info(...e){return j(`info`,this._namespace,e)}warn(...e){return j(`warn`,this._namespace,e)}verbose(...e){return j(`verbose`,this._namespace,e)}}})),N,te=n((()=>{(function(e){e[e.NONE=0]=`NONE`,e[e.ERROR=30]=`ERROR`,e[e.WARN=50]=`WARN`,e[e.INFO=60]=`INFO`,e[e.DEBUG=70]=`DEBUG`,e[e.VERBOSE=80]=`VERBOSE`,e[e.ALL=9999]=`ALL`})(N||(N={}))}));function P(e,t){e<N.NONE?e=N.NONE:e>N.ALL&&(e=N.ALL),t=t||{};function n(n,r){let i=t[n];return typeof i==`function`&&e>=r?i.bind(t):function(){}}return{error:n(`error`,N.ERROR),warn:n(`warn`,N.WARN),info:n(`info`,N.INFO),debug:n(`debug`,N.DEBUG),verbose:n(`verbose`,N.VERBOSE)}}var ne=n((()=>{te()})),re,ie,ae=n((()=>{M(),ne(),te(),A(),re=`diag`,ie=class e{static instance(){return this._instance||(this._instance=new e),this._instance}constructor(){function e(e){return function(...t){let n=T(`diag`);if(n)return n[e](...t)}}let t=this;t.setLogger=(e,n={logLevel:N.INFO})=>{var r,i,a;if(e===t){let e=Error(`Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation`);return t.error((r=e.stack)==null?e.message:r),!1}typeof n==`number`&&(n={logLevel:n});let o=T(`diag`),s=P((i=n.logLevel)==null?N.INFO:i,e);if(o&&!n.suppressOverrideMessage){let e=(a=Error().stack)==null?`<failed to generate stacktrace>`:a;o.warn(`Current logger will be overwritten from ${e}`),s.warn(`Current logger will overwrite one already registered from ${e}`)}return w(`diag`,s,t,!0)},t.disable=()=>{E(re,t)},t.createComponentLogger=e=>new ee(e),t.verbose=e(`verbose`),t.debug=e(`debug`),t.info=e(`info`),t.warn=e(`warn`),t.error=e(`error`)}}})),oe,se=n((()=>{oe=class e{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let t=this._entries.get(e);if(t)return Object.assign({},t)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(t,n){let r=new e(this._entries);return r._entries.set(t,n),r}removeEntry(t){let n=new e(this._entries);return n._entries.delete(t),n}removeEntries(...t){let n=new e(this._entries);for(let e of t)n._entries.delete(e);return n}clear(){return new e}}})),ce,le=n((()=>{ce=Symbol(`BaggageEntryMetadata`)}));function ue(e={}){return new oe(new Map(Object.entries(e)))}function de(e){return typeof e!=`string`&&(fe.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=``),{__TYPE__:ce,toString(){return e}}}var fe,pe=n((()=>{ae(),se(),le(),fe=ie.instance()}));function me(e){return Symbol.for(e)}var he,ge,_e=n((()=>{he=class e{constructor(t){let n=this;n._currentContext=t?new Map(t):new Map,n.getValue=e=>n._currentContext.get(e),n.setValue=(t,r)=>{let i=new e(n._currentContext);return i._currentContext.set(t,r),i},n.deleteValue=t=>{let r=new e(n._currentContext);return r._currentContext.delete(t),r}}},ge=new he}));function ve(){return ke}var ye,be,xe,Se,Ce,we,Te,Ee,De,Oe,ke,Ae,je,Me,Ne,Pe,Fe,Ie,Le=n((()=>{ye=class{constructor(){}createGauge(e,t){return je}createHistogram(e,t){return Me}createCounter(e,t){return Ae}createUpDownCounter(e,t){return Ne}createObservableGauge(e,t){return Fe}createObservableCounter(e,t){return Pe}createObservableUpDownCounter(e,t){return Ie}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},be=class{},xe=class extends be{add(e,t){}},Se=class extends be{add(e,t){}},Ce=class extends be{record(e,t){}},we=class extends be{record(e,t){}},Te=class{addCallback(e){}removeCallback(e){}},Ee=class extends Te{},De=class extends Te{},Oe=class extends Te{},ke=new ye,Ae=new xe,je=new Ce,Me=new we,Ne=new Se,Pe=new Ee,Fe=new De,Ie=new Oe})),Re,ze=n((()=>{(function(e){e[e.INT=0]=`INT`,e[e.DOUBLE=1]=`DOUBLE`})(Re||(Re={}))})),Be,Ve,He=n((()=>{Be={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},Ve={set(e,t,n){e!=null&&(e[t]=n)}}})),Ue,We=n((()=>{_e(),Ue=class{active(){return ge}with(e,t,n,...r){return t.call(n,...r)}bind(e,t){return t}enable(){return this}disable(){return this}}})),Ge,Ke,qe,Je=n((()=>{We(),A(),ae(),Ge=`context`,Ke=new Ue,qe=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalContextManager(e){return w(Ge,e,ie.instance())}active(){return this._getContextManager().active()}with(e,t,n,...r){return this._getContextManager().with(e,t,n,...r)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return T(Ge)||Ke}disable(){this._getContextManager().disable(),E(Ge,ie.instance())}}})),F,Ye=n((()=>{(function(e){e[e.NONE=0]=`NONE`,e[e.SAMPLED=1]=`SAMPLED`})(F||(F={}))})),Xe,Ze,Qe,$e=n((()=>{Ye(),Xe=`0000000000000000`,Ze=`00000000000000000000000000000000`,Qe={traceId:Ze,spanId:Xe,traceFlags:F.NONE}})),et,tt=n((()=>{$e(),et=class{constructor(e=Qe){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}}}));function nt(e){return e.getValue(ct)||void 0}function rt(){return nt(qe.getInstance().active())}function it(e,t){return e.setValue(ct,t)}function at(e){return e.deleteValue(ct)}function ot(e,t){return it(e,new et(t))}function st(e){var t;return(t=nt(e))==null?void 0:t.spanContext()}var ct,lt=n((()=>{_e(),tt(),Je(),ct=me(`OpenTelemetry Context Key SPAN`)}));function ut(e,t){if(typeof e!=`string`||e.length!==t)return!1;let n=0;for(let t=0;t<e.length;t+=4)n+=(ht[e.charCodeAt(t)]|0)+(ht[e.charCodeAt(t+1)]|0)+(ht[e.charCodeAt(t+2)]|0)+(ht[e.charCodeAt(t+3)]|0);return n===t}function dt(e){return ut(e,32)&&e!==`00000000000000000000000000000000`}function ft(e){return ut(e,16)&&e!==`0000000000000000`}function pt(e){return dt(e.traceId)&&ft(e.spanId)}function mt(e){return new et(e)}var ht,gt=n((()=>{$e(),tt(),ht=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1])}));function _t(e){return typeof e==`object`&&!!e&&`spanId`in e&&typeof e.spanId==`string`&&`traceId`in e&&typeof e.traceId==`string`&&`traceFlags`in e&&typeof e.traceFlags==`number`}var vt,yt,bt=n((()=>{Je(),lt(),tt(),gt(),vt=qe.getInstance(),yt=class{startSpan(e,t,n=vt.active()){if(t!=null&&t.root)return new et;let r=n&&st(n);return _t(r)&&pt(r)?new et(r):new et}startActiveSpan(e,t,n,r){let i,a,o;if(arguments.length<2)return;arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);let s=a==null?vt.active():a,c=this.startSpan(e,i,s),l=it(s,c);return vt.with(l,o,void 0,c)}}})),xt,St,Ct=n((()=>{bt(),xt=new yt,St=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}startSpan(e,t,n){return this._getTracer().startSpan(e,t,n)}startActiveSpan(e,t,n,r){let i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):xt}}})),wt,Tt=n((()=>{bt(),wt=class{getTracer(e,t,n){return new yt}}})),Et,Dt,Ot=n((()=>{Ct(),Tt(),Et=new wt,Dt=class{getTracer(e,t,n){var r;return(r=this.getDelegateTracer(e,t,n))==null?new St(this,e,t,n):r}getDelegate(){var e;return(e=this._delegate)==null?Et:e}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,n){var r;return(r=this._delegate)==null?void 0:r.getTracer(e,t,n)}}})),kt,At=n((()=>{(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(kt||(kt={}))})),jt,Mt=n((()=>{(function(e){e[e.INTERNAL=0]=`INTERNAL`,e[e.SERVER=1]=`SERVER`,e[e.CLIENT=2]=`CLIENT`,e[e.PRODUCER=3]=`PRODUCER`,e[e.CONSUMER=4]=`CONSUMER`})(jt||(jt={}))})),I,Nt=n((()=>{(function(e){e[e.UNSET=0]=`UNSET`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`})(I||(I={}))})),L,Pt=n((()=>{Je(),L=qe.getInstance()})),R,Ft=n((()=>{ae(),R=ie.instance()})),It,Lt,Rt=n((()=>{Le(),It=class{getMeter(e,t,n){return ke}},Lt=new It})),zt,Bt,Vt=n((()=>{Rt(),A(),ae(),zt=`metrics`,Bt=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalMeterProvider(e){return w(zt,e,ie.instance())}getMeterProvider(){return T(zt)||Lt}getMeter(e,t,n){return this.getMeterProvider().getMeter(e,t,n)}disable(){E(zt,ie.instance())}}})),Ht,Ut=n((()=>{Vt(),Ht=Bt.getInstance()})),Wt,Gt=n((()=>{Wt=class{inject(e,t){}extract(e,t){return e}fields(){return[]}}}));function Kt(e){return e.getValue(Xt)||void 0}function qt(){return Kt(qe.getInstance().active())}function Jt(e,t){return e.setValue(Xt,t)}function Yt(e){return e.deleteValue(Xt)}var Xt,Zt=n((()=>{Je(),_e(),Xt=me(`OpenTelemetry Baggage Key`)})),Qt,$t,en,tn=n((()=>{A(),Gt(),He(),Zt(),pe(),ae(),Qt=`propagation`,$t=new Wt,en=class e{constructor(){this.createBaggage=ue,this.getBaggage=Kt,this.getActiveBaggage=qt,this.setBaggage=Jt,this.deleteBaggage=Yt}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalPropagator(e){return w(Qt,e,ie.instance())}inject(e,t,n=Ve){return this._getGlobalPropagator().inject(e,t,n)}extract(e,t,n=Be){return this._getGlobalPropagator().extract(e,t,n)}fields(){return this._getGlobalPropagator().fields()}disable(){E(Qt,ie.instance())}_getGlobalPropagator(){return T(Qt)||$t}}})),nn,rn=n((()=>{tn(),nn=en.getInstance()})),an,on,sn=n((()=>{A(),Ot(),gt(),lt(),ae(),an=`trace`,on=class e{constructor(){this._proxyTracerProvider=new Dt,this.wrapSpanContext=mt,this.isSpanContextValid=pt,this.deleteSpan=at,this.getSpan=nt,this.getActiveSpan=rt,this.getSpanContext=st,this.setSpan=it,this.setSpanContext=ot}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalTracerProvider(e){let t=w(an,this._proxyTracerProvider,ie.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return T(an)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){E(an,ie.instance()),this._proxyTracerProvider=new Dt}}})),z,cn=n((()=>{sn(),z=on.getInstance()})),B=n((()=>{pe(),_e(),te(),Le(),ze(),He(),Ct(),Ot(),At(),Mt(),Nt(),Ye(),gt(),$e(),Pt(),Ft(),Ut(),rn(),cn()})),ln,un=n((()=>{(function(e){e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.TRACE=1]=`TRACE`,e[e.TRACE2=2]=`TRACE2`,e[e.TRACE3=3]=`TRACE3`,e[e.TRACE4=4]=`TRACE4`,e[e.DEBUG=5]=`DEBUG`,e[e.DEBUG2=6]=`DEBUG2`,e[e.DEBUG3=7]=`DEBUG3`,e[e.DEBUG4=8]=`DEBUG4`,e[e.INFO=9]=`INFO`,e[e.INFO2=10]=`INFO2`,e[e.INFO3=11]=`INFO3`,e[e.INFO4=12]=`INFO4`,e[e.WARN=13]=`WARN`,e[e.WARN2=14]=`WARN2`,e[e.WARN3=15]=`WARN3`,e[e.WARN4=16]=`WARN4`,e[e.ERROR=17]=`ERROR`,e[e.ERROR2=18]=`ERROR2`,e[e.ERROR3=19]=`ERROR3`,e[e.ERROR4=20]=`ERROR4`,e[e.FATAL=21]=`FATAL`,e[e.FATAL2=22]=`FATAL2`,e[e.FATAL3=23]=`FATAL3`,e[e.FATAL4=24]=`FATAL4`})(ln||(ln={}))})),dn,fn,pn=n((()=>{dn=class{emit(e){}enabled(){return!1}},fn=new dn}));function mn(e,t,n){return r=>r===e?t:n}var hn,gn,_n=n((()=>{hn=Symbol.for(`io.opentelemetry.js.api.logs`),gn=globalThis})),vn,yn,bn=n((()=>{pn(),vn=class{getLogger(e,t,n){return new dn}},yn=new vn})),xn,Sn=n((()=>{pn(),xn=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):fn}}})),Cn,wn=n((()=>{bn(),Sn(),Cn=class{getLogger(e,t,n){var r;return(r=this._getDelegateLogger(e,t,n))==null?new xn(this,e,t,n):r}_getDelegate(){var e;return(e=this._delegate)==null?yn:e}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){var r;return(r=this._delegate)==null?void 0:r.getLogger(e,t,n)}}})),Tn,En=n((()=>{_n(),bn(),wn(),Tn=class e{constructor(){this._proxyLoggerProvider=new Cn}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(e){return gn[hn]?this.getLoggerProvider():(gn[hn]=mn(1,e,yn),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,t;return(t=(e=gn[hn])==null?void 0:e.call(gn,1))==null?this._proxyLoggerProvider:t}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete gn[hn],this._proxyLoggerProvider=new Cn}}})),Dn,On=n((()=>{un(),pn(),En(),Dn=Tn.getInstance()}));function kn(e){return typeof e==`object`&&!!e&&`addEventListener`in e&&typeof e.addEventListener==`function`&&`removeEventListener`in e&&typeof e.removeEventListener==`function`}B(),d();var An=`OT_ZONE_CONTEXT`,jn=class{constructor(){u(this,`_enabled`,!1)}_bindFunction(e,t){let n=this,r=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(r,`length`,{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}_bindListener(e,t){let n=t;return n.__ot_listeners===void 0?(n.__ot_listeners={},typeof n.addEventListener==`function`&&(n.addEventListener=this._patchAddEventListener(n,n.addEventListener,e)),typeof n.removeEventListener==`function`&&(n.removeEventListener=this._patchRemoveEventListener(n,n.removeEventListener)),t):t}_createZone(e,t){return Zone.current.fork({name:e,properties:{[An]:t},onCancelTask(e,t,n,r){return r.state===`notScheduled`||r.state===`running`?r:e.cancelTask(n,r)}})}_patchAddEventListener(e,t,n){let r=this;return function(i,a,o){e.__ot_listeners===void 0&&(e.__ot_listeners={});let s=e.__ot_listeners[i];s===void 0&&(s=new WeakMap,e.__ot_listeners[i]=s);let c=r.bind(n,a);return s.set(a,c),t.call(this,i,c,o)}}_patchRemoveEventListener(e,t){return function(n,r){if(e.__ot_listeners===void 0||e.__ot_listeners[n]===void 0)return t.call(this,n,r);let i=e.__ot_listeners[n],a=i.get(r);return i.delete(r),t.call(this,n,a||r)}}active(){return!this._enabled||!Zone.current?ge:Zone.current.get(An)||ge}bind(e,t){return typeof t==`function`?this._bindFunction(e,t):(kn(t)&&this._bindListener(e,t),t)}disable(){return this._enabled=!1,this}enable(){return this._enabled=!0,this}with(e,t,n,...r){let i=`otel:with`;return t.name&&(i+=`:${t.name}`),this._createZone(i,e).run(t,n,r)}};On();var Mn=Object.defineProperty,Nn=Object.defineProperties,Pn=Object.getOwnPropertyDescriptors,Fn=Object.getOwnPropertySymbols,In=Object.prototype.hasOwnProperty,Ln=Object.prototype.propertyIsEnumerable,Rn=(e,t,n)=>t in e?Mn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zn=(e,t)=>{for(var n in t||(t={}))In.call(t,n)&&Rn(e,n,t[n]);if(Fn)for(var n of Fn(t))Ln.call(t,n)&&Rn(e,n,t[n]);return e},Bn=(e,t)=>Nn(e,Pn(t)),V=(e,t,n)=>(Rn(e,typeof t==`symbol`?t:t+``,n),n),H=globalThis;function Vn(e){return(H.__Zone_symbol_prefix||`__zone_symbol__`)+e}function Hn(){let e=H.performance;function t(t){e&&e.mark&&e.mark(t)}function n(t,n){e&&e.measure&&e.measure(t,n)}t(`Zone`);let r=class e{constructor(e,t){V(this,`_parent`),V(this,`_name`),V(this,`_properties`),V(this,`_zoneDelegate`),this._parent=e,this._name=t?t.name||`unnamed`:`<root>`,this._properties=t&&t.properties||{},this._zoneDelegate=new o(this,this._parent&&this._parent._zoneDelegate,t)}static assertZonePatched(){if(H.Promise!==O.ZoneAwarePromise)throw Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}static get root(){let t=e.current;for(;t.parent;)t=t.parent;return t}static get current(){return A.zone}static get currentTask(){return j}static __load_patch(r,i,a=!1){if(O.hasOwnProperty(r)){let e=H[Vn(`forceDuplicateZoneCheck`)]===!0;if(!a&&e)throw Error(`Already loaded patch: `+r)}else if(!H[`__Zone_disable_`+r]){let a=`Zone:`+r;t(a),O[r]=i(H,e,k),n(a,a)}}get parent(){return this._parent}get name(){return this._name}get(e){let t=this.getZoneWith(e);if(t)return t._properties[e]}getZoneWith(e){let t=this;for(;t;){if(t._properties.hasOwnProperty(e))return t;t=t._parent}return null}fork(e){if(!e)throw Error(`ZoneSpec required!`);return this._zoneDelegate.fork(this,e)}wrap(e,t){if(typeof e!=`function`)throw Error(`Expecting function got: `+e);let n=this._zoneDelegate.intercept(this,e,t),r=this;return function(){return r.runGuarded(n,this,arguments,t)}}run(e,t,n,r){A={parent:A,zone:this};try{return this._zoneDelegate.invoke(this,e,t,n,r)}finally{A=A.parent}}runGuarded(e,t=null,n,r){A={parent:A,zone:this};try{try{return this._zoneDelegate.invoke(this,e,t,n,r)}catch(e){if(this._zoneDelegate.handleError(this,e))throw e}}finally{A=A.parent}}runTask(e,t,n){if(e.zone!=this)throw Error(`A task can only be run in the zone of creation! (Creation: `+(e.zone||v).name+`; Execution: `+this.name+`)`);let r=e,{type:i,data:{isPeriodic:a=!1,isRefreshable:o=!1}={}}=e;if(e.state===y&&(i===D||i===E))return;let s=e.state!=S;s&&r._transitionTo(S,x);let c=j;j=r,A={parent:A,zone:this};try{i==E&&e.data&&!a&&!o&&(e.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,r,t,n)}catch(e){if(this._zoneDelegate.handleError(this,e))throw e}}finally{let t=e.state;if(t!==y&&t!==w)if(i==D||a||o&&t===b)s&&r._transitionTo(x,S,b);else{let e=r._zoneDelegates;this._updateTaskCount(r,-1),s&&r._transitionTo(y,S,y),o&&(r._zoneDelegates=e)}A=A.parent,j=c}}scheduleTask(e){if(e.zone&&e.zone!==this){let t=this;for(;t;){if(t===e.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${e.zone.name}`);t=t.parent}}e._transitionTo(b,y);let t=[];e._zoneDelegates=t,e._zone=this;try{e=this._zoneDelegate.scheduleTask(this,e)}catch(t){throw e._transitionTo(w,b,y),this._zoneDelegate.handleError(this,t),t}return e._zoneDelegates===t&&this._updateTaskCount(e,1),e.state==b&&e._transitionTo(x,b),e}scheduleMicroTask(e,t,n,r){return this.scheduleTask(new s(T,e,t,n,r,void 0))}scheduleMacroTask(e,t,n,r,i){return this.scheduleTask(new s(E,e,t,n,r,i))}scheduleEventTask(e,t,n,r,i){return this.scheduleTask(new s(D,e,t,n,r,i))}cancelTask(e){if(e.zone!=this)throw Error(`A task can only be cancelled in the zone of creation! (Creation: `+(e.zone||v).name+`; Execution: `+this.name+`)`);if(!(e.state!==x&&e.state!==S)){e._transitionTo(C,x,S);try{this._zoneDelegate.cancelTask(this,e)}catch(t){throw e._transitionTo(w,C),this._zoneDelegate.handleError(this,t),t}return this._updateTaskCount(e,-1),e._transitionTo(y,C),e.runCount=-1,e}}_updateTaskCount(e,t){let n=e._zoneDelegates;t==-1&&(e._zoneDelegates=null);for(let r=0;r<n.length;r++)n[r]._updateTaskCount(e.type,t)}};V(r,`__symbol__`,Vn);let i=r,a={name:``,onHasTask:(e,t,n,r)=>e.hasTask(n,r),onScheduleTask:(e,t,n,r)=>e.scheduleTask(n,r),onInvokeTask:(e,t,n,r,i,a)=>e.invokeTask(n,r,i,a),onCancelTask:(e,t,n,r)=>e.cancelTask(n,r)};class o{constructor(e,t,n){V(this,`_zone`),V(this,`_taskCounts`,{microTask:0,macroTask:0,eventTask:0}),V(this,`_forkDlgt`),V(this,`_forkZS`),V(this,`_forkCurrZone`),V(this,`_interceptDlgt`),V(this,`_interceptZS`),V(this,`_interceptCurrZone`),V(this,`_invokeDlgt`),V(this,`_invokeZS`),V(this,`_invokeCurrZone`),V(this,`_handleErrorDlgt`),V(this,`_handleErrorZS`),V(this,`_handleErrorCurrZone`),V(this,`_scheduleTaskDlgt`),V(this,`_scheduleTaskZS`),V(this,`_scheduleTaskCurrZone`),V(this,`_invokeTaskDlgt`),V(this,`_invokeTaskZS`),V(this,`_invokeTaskCurrZone`),V(this,`_cancelTaskDlgt`),V(this,`_cancelTaskZS`),V(this,`_cancelTaskCurrZone`),V(this,`_hasTaskDlgt`),V(this,`_hasTaskDlgtOwner`),V(this,`_hasTaskZS`),V(this,`_hasTaskCurrZone`),this._zone=e,this._forkZS=n&&(n&&n.onFork?n:t._forkZS),this._forkDlgt=n&&(n.onFork?t:t._forkDlgt),this._forkCurrZone=n&&(n.onFork?this._zone:t._forkCurrZone),this._interceptZS=n&&(n.onIntercept?n:t._interceptZS),this._interceptDlgt=n&&(n.onIntercept?t:t._interceptDlgt),this._interceptCurrZone=n&&(n.onIntercept?this._zone:t._interceptCurrZone),this._invokeZS=n&&(n.onInvoke?n:t._invokeZS),this._invokeDlgt=n&&(n.onInvoke?t:t._invokeDlgt),this._invokeCurrZone=n&&(n.onInvoke?this._zone:t._invokeCurrZone),this._handleErrorZS=n&&(n.onHandleError?n:t._handleErrorZS),this._handleErrorDlgt=n&&(n.onHandleError?t:t._handleErrorDlgt),this._handleErrorCurrZone=n&&(n.onHandleError?this._zone:t._handleErrorCurrZone),this._scheduleTaskZS=n&&(n.onScheduleTask?n:t._scheduleTaskZS),this._scheduleTaskDlgt=n&&(n.onScheduleTask?t:t._scheduleTaskDlgt),this._scheduleTaskCurrZone=n&&(n.onScheduleTask?this._zone:t._scheduleTaskCurrZone),this._invokeTaskZS=n&&(n.onInvokeTask?n:t._invokeTaskZS),this._invokeTaskDlgt=n&&(n.onInvokeTask?t:t._invokeTaskDlgt),this._invokeTaskCurrZone=n&&(n.onInvokeTask?this._zone:t._invokeTaskCurrZone),this._cancelTaskZS=n&&(n.onCancelTask?n:t._cancelTaskZS),this._cancelTaskDlgt=n&&(n.onCancelTask?t:t._cancelTaskDlgt),this._cancelTaskCurrZone=n&&(n.onCancelTask?this._zone:t._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;let r=n&&n.onHasTask,i=t&&t._hasTaskZS;(r||i)&&(this._hasTaskZS=r?n:a,this._hasTaskDlgt=t,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=this._zone,n.onScheduleTask||(this._scheduleTaskZS=a,this._scheduleTaskDlgt=t,this._scheduleTaskCurrZone=this._zone),n.onInvokeTask||(this._invokeTaskZS=a,this._invokeTaskDlgt=t,this._invokeTaskCurrZone=this._zone),n.onCancelTask||(this._cancelTaskZS=a,this._cancelTaskDlgt=t,this._cancelTaskCurrZone=this._zone))}get zone(){return this._zone}fork(e,t){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,e,t):new i(e,t)}intercept(e,t,n){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,e,t,n):t}invoke(e,t,n,r,i){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,e,t,n,r,i):t.apply(n,r)}handleError(e,t){return this._handleErrorZS?this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,e,t):!0}scheduleTask(e,t){let n=t;if(this._scheduleTaskZS)this._hasTaskZS&&n._zoneDelegates.push(this._hasTaskDlgtOwner),n=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,e,t),n||(n=t);else if(t.scheduleFn)t.scheduleFn(t);else if(t.type==T)g(t);else throw Error(`Task is missing scheduleFn.`);return n}invokeTask(e,t,n,r){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,e,t,n,r):t.callback.apply(n,r)}cancelTask(e,t){let n;if(this._cancelTaskZS)n=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,e,t);else{if(!t.cancelFn)throw Error(`Task is not cancelable`);n=t.cancelFn(t)}return n}hasTask(e,t){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,e,t)}catch(t){this.handleError(e,t)}}_updateTaskCount(e,t){let n=this._taskCounts,r=n[e],i=n[e]=r+t;if(i<0)throw Error(`More tasks executed then were scheduled.`);if(r==0||i==0){let t={microTask:n.microTask>0,macroTask:n.macroTask>0,eventTask:n.eventTask>0,change:e};this.hasTask(this._zone,t)}}}class s{constructor(e,t,n,r,i,a){if(V(this,`type`),V(this,`source`),V(this,`invoke`),V(this,`callback`),V(this,`data`),V(this,`scheduleFn`),V(this,`cancelFn`),V(this,`_zone`,null),V(this,`runCount`,0),V(this,`_zoneDelegates`,null),V(this,`_state`,`notScheduled`),this.type=e,this.source=t,this.data=r,this.scheduleFn=i,this.cancelFn=a,!n)throw Error(`callback is not defined`);this.callback=n;let o=this;e===D&&r&&r.useG?this.invoke=s.invokeTask:this.invoke=function(){return s.invokeTask.call(H,o,this,arguments)}}static invokeTask(e,t,n){e||(e=this),ee++;try{return e.runCount++,e.zone.runTask(e,t,n)}finally{ee===1&&!H[d]&&_(),ee--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(y,b)}_transitionTo(e,t,n){if(this._state===t||this._state===n)this._state=e,e==y&&(this._zoneDelegates=null);else throw Error(`${this.type} '${this.source}': can not transition to '${e}', expecting state '${t}'${n?` or '`+n+`'`:``}, was '${this._state}'.`)}toString(){return this.data&&this.data.handleId!==void 0?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}let c=Vn(`setTimeout`),l=Vn(`Promise`),u=Vn(`then`),d=Vn(`enable_native_microtask_draining`),f=[],p=!1,m;function h(e){var t;!m&&H[l]&&(m=H[l].resolve(0)),m?((t=m[u])==null?m.then:t).call(m,e):H[c](e,0)}function g(e){let t=H[d],n=t&&f.length===0&&!p,r=!t&&ee===0&&f.length===0;(n||r)&&h(_),e&&f.push(e)}function _(){if(!p){for(p=!0;f.length;){let e=f;f=[];for(let t of e)try{t.zone.runTask(t,null,null)}catch(e){k.onUnhandledError(e)}}H[d]?(p=!1,k.microtaskDrainDone()):(k.microtaskDrainDone(),p=!1)}}let v={name:`NO ZONE`},y=`notScheduled`,b=`scheduling`,x=`scheduled`,S=`running`,C=`canceling`,w=`unknown`,T=`microTask`,E=`macroTask`,D=`eventTask`,O={},k={symbol:Vn,currentZoneFrame:()=>A,onUnhandledError:M,microtaskDrainDone:M,scheduleMicroTask:g,showUncaughtError:()=>!i[Vn(`ignoreConsoleErrorUncaughtError`)],patchEventTarget:()=>[],patchOnProperties:M,patchMethod:()=>M,bindArguments:()=>[],patchThen:()=>M,patchMacroTask:()=>M,patchEventPrototype:()=>M,getGlobalObjects:()=>void 0,ObjectDefineProperty:()=>M,ObjectGetOwnPropertyDescriptor:()=>void 0,ObjectCreate:()=>void 0,ArraySlice:()=>[],patchClass:()=>M,wrapWithCurrentZone:()=>M,filterProperties:()=>[],attachOriginToPatched:()=>M,_redefineProperty:()=>M,patchCallbacks:()=>M,nativeScheduleMicroTask:h},A={parent:null,zone:new i(null,null)},j=null,ee=0;function M(){}return n(`Zone`,`Zone`),i}function Un(){let e=globalThis,t=e[Vn(`forceDuplicateZoneCheck`)]===!0;if(e.Zone&&(t||typeof e.Zone.__symbol__!=`function`))throw Error(`Zone already loaded.`);return e.Zone!=null||(e.Zone=Hn()),e.Zone}var Wn=Object.getOwnPropertyDescriptor,Gn=Object.defineProperty,Kn=Object.getPrototypeOf,qn=Object.create,Jn=Array.prototype.slice,Yn=`addEventListener`,Xn=`removeEventListener`,Zn=Vn(Yn),Qn=Vn(Xn),$n=`true`,er=`false`,tr=Vn(``);function nr(e,t){return Zone.current.wrap(e,t)}function rr(e,t,n,r,i){return Zone.current.scheduleMacroTask(e,t,n,r,i)}var U=Vn,ir=typeof window<`u`,ar=ir?window:void 0,W=ir&&ar||globalThis,or=`removeAttribute`;function sr(e,t){for(let n=e.length-1;n>=0;n--)typeof e[n]==`function`&&(e[n]=nr(e[n],t+`_`+n));return e}function cr(e,t){let n=e.constructor.name;for(let r=0;r<t.length;r++){let i=t[r],a=e[i];if(a){if(!lr(Wn(e,i)))continue;e[i]=(e=>{let t=function(){return e.apply(this,sr(arguments,n+`.`+i))};return Tr(t,e),t})(a)}}}function lr(e){return e?e.writable===!1?!1:!(typeof e.get==`function`&&e.set===void 0):!0}var ur=typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope,dr=!(`nw`in W)&&W.process!==void 0&&W.process.toString()===`[object process]`,fr=!dr&&!ur&&!!(ir&&ar.HTMLElement),pr=W.process!==void 0&&W.process.toString()===`[object process]`&&!ur&&!!(ir&&ar.HTMLElement),mr={},hr=U(`enable_beforeunload`),gr=function(e){if(e=e||W.event,!e)return;let t=mr[e.type];t||(t=mr[e.type]=U(`ON_PROPERTY`+e.type));let n=this||e.target||W,r=n[t],i;if(fr&&n===ar&&e.type===`error`){let t=e;i=r&&r.call(this,t.message,t.filename,t.lineno,t.colno,t.error),i===!0&&e.preventDefault()}else i=r&&r.apply(this,arguments),e.type===`beforeunload`&&W[hr]&&typeof i==`string`?e.returnValue=i:i!=null&&!i&&e.preventDefault();return i};function _r(e,t,n){let r=Wn(e,t);if(!r&&n&&Wn(n,t)&&(r={enumerable:!0,configurable:!0}),!r||!r.configurable)return;let i=U(`on`+t+`patched`);if(e.hasOwnProperty(i)&&e[i])return;delete r.writable,delete r.value;let a=r.get,o=r.set,s=t.slice(2),c=mr[s];c||(c=mr[s]=U(`ON_PROPERTY`+s)),r.set=function(t){let n=this;!n&&e===W&&(n=W),n&&(typeof n[c]==`function`&&n.removeEventListener(s,gr),o==null||o.call(n,null),n[c]=t,typeof t==`function`&&n.addEventListener(s,gr,!1))},r.get=function(){let n=this;if(!n&&e===W&&(n=W),!n)return null;let i=n[c];if(i)return i;if(a){let e=a.call(this);if(e)return r.set.call(this,e),typeof n[or]==`function`&&n.removeAttribute(t),e}return null},Gn(e,t,r),e[i]=!0}function vr(e,t,n){if(t)for(let r=0;r<t.length;r++)_r(e,`on`+t[r],n);else{let t=[];for(let n in e)n.slice(0,2)==`on`&&t.push(n);for(let r=0;r<t.length;r++)_r(e,t[r],n)}}var yr=U(`originalInstance`);function br(e){let t=W[e];if(!t)return;W[U(e)]=t,W[e]=function(){let n=sr(arguments,e);switch(n.length){case 0:this[yr]=new t;break;case 1:this[yr]=new t(n[0]);break;case 2:this[yr]=new t(n[0],n[1]);break;case 3:this[yr]=new t(n[0],n[1],n[2]);break;case 4:this[yr]=new t(n[0],n[1],n[2],n[3]);break;default:throw Error(`Arg list too long.`)}},Tr(W[e],t);let n=new t(function(){}),r;for(r in n)e===`XMLHttpRequest`&&r===`responseBlob`||(function(t){typeof n[t]==`function`?W[e].prototype[t]=function(){return this[yr][t].apply(this[yr],arguments)}:Gn(W[e].prototype,t,{set:function(n){typeof n==`function`?(this[yr][t]=nr(n,e+`.`+t),Tr(this[yr][t],n)):this[yr][t]=n},get:function(){return this[yr][t]}})})(r);for(r in t)r!==`prototype`&&t.hasOwnProperty(r)&&(W[e][r]=t[r])}function xr(e,t){typeof Object.getOwnPropertySymbols==`function`&&Object.getOwnPropertySymbols(e).forEach(n=>{let r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,{get:function(){return e[n]},set:function(t){r&&(!r.writable||typeof r.set!=`function`)||(e[n]=t)},enumerable:r?r.enumerable:!0,configurable:r?r.configurable:!0})})}var Sr=!1;function Cr(e,t,n){let r=e;for(;r&&!r.hasOwnProperty(t);)r=Kn(r);!r&&e[t]&&(r=e);let i=U(t),a=null;if(r&&(!(a=r[i])||!r.hasOwnProperty(i))&&(a=r[i]=r[t],lr(r&&Wn(r,t)))){let e=n(a,i,t);r[t]=function(){return e(this,arguments)},Tr(r[t],a),Sr&&xr(a,r[t])}return a}function wr(e,t,n){let r=null;function i(e){let t=e.data;return t.args[t.cbIdx]=function(){e.invoke.apply(this,arguments)},r.apply(t.target,t.args),e}r=Cr(e,t,e=>function(t,r){let a=n(t,r);return a.cbIdx>=0&&typeof r[a.cbIdx]==`function`?rr(a.name,r[a.cbIdx],a,i):e.apply(t,r)})}function Tr(e,t){e[U(`OriginalDelegate`)]=t}function Er(e){return typeof e==`function`}function Dr(e){return typeof e==`number`}var Or={useG:!0},kr={},Ar={},jr=RegExp(`^`+tr+`(\\w+)(true|false)$`),Mr=U(`propagationStopped`);function Nr(e,t){let n=(t?t(e):e)+er,r=(t?t(e):e)+$n,i=tr+n,a=tr+r;kr[e]={},kr[e][er]=i,kr[e][$n]=a}function Pr(e,t,n,r){let i=r&&r.add||Yn,a=r&&r.rm||Xn,o=r&&r.listeners||`eventListeners`,s=r&&r.rmAll||`removeAllListeners`,c=U(i),l=`.`+i+`:`,u=`prependListener`;``+u;let d=function(e,t,n){if(e.isRemoved)return;let r=e.callback;typeof r==`object`&&r.handleEvent&&(e.callback=e=>r.handleEvent(e),e.originalDelegate=r);let i;try{e.invoke(e,t,[n])}catch(e){i=e}let o=e.options;if(o&&typeof o==`object`&&o.once){let r=e.originalDelegate?e.originalDelegate:e.callback;t[a].call(t,n.type,r,o)}return i};function f(n,r,i){if(r=r||e.event,!r)return;let a=n||r.target||e,o=a[kr[r.type][i?$n:er]];if(o){let e=[];if(o.length===1){let t=d(o[0],a,r);t&&e.push(t)}else{let t=o.slice();for(let n=0;n<t.length&&!(r&&r[Mr]===!0);n++){let i=d(t[n],a,r);i&&e.push(i)}}if(e.length===1)throw e[0];for(let n=0;n<e.length;n++){let r=e[n];t.nativeScheduleMicroTask(()=>{throw r})}}}let p=function(e){return f(this,e,!1)},m=function(e){return f(this,e,!0)};function h(t,n){if(!t)return!1;let r=!0;n&&n.useG!==void 0&&(r=n.useG);let d=n&&n.vh,f=!0;n&&n.chkDup!==void 0&&(f=n.chkDup);let h=!1;n&&n.rt!==void 0&&(h=n.rt);let g=t;for(;g&&!g.hasOwnProperty(i);)g=Kn(g);if(!g&&t[i]&&(g=t),!g||g[c])return!1;let _=n&&n.eventNameToString,v={},y=g[c]=g[i],b=g[U(a)]=g[a],x=g[U(o)]=g[o],S=g[U(s)]=g[s],C;n&&n.prepend&&(C=g[U(n.prepend)]=g[n.prepend]);function w(e,t){return t?typeof e==`boolean`?{capture:e,passive:!0}:e?typeof e==`object`&&e.passive!==!1?Bn(zn({},e),{passive:!0}):e:{passive:!0}:e}let T=function(e){if(!v.isExisting)return y.call(v.target,v.eventName,v.capture?m:p,v.options)},E=function(e){if(!e.isRemoved){let t=kr[e.eventName],n;t&&(n=t[e.capture?$n:er]);let r=n&&e.target[n];if(r){for(let t=0;t<r.length;t++)if(r[t]===e){r.splice(t,1),e.isRemoved=!0,e.removeAbortListener&&(e.removeAbortListener(),e.removeAbortListener=null),r.length===0&&(e.allRemoved=!0,e.target[n]=null);break}}}if(e.allRemoved)return b.call(e.target,e.eventName,e.capture?m:p,e.options)},D=function(e){return y.call(v.target,v.eventName,e.invoke,v.options)},O=function(e){return C.call(v.target,v.eventName,e.invoke,v.options)},k=function(e){return b.call(e.target,e.eventName,e.invoke,e.options)},A=r?T:D,j=r?E:k,ee=(n==null?void 0:n.diff)||function(e,t){let n=typeof t;return n===`function`&&e.callback===t||n===`object`&&e.originalDelegate===t},M=Zone[U(`UNPATCHED_EVENTS`)],N=e[U(`PASSIVE_EVENTS`)];function te(e){if(typeof e==`object`&&e){let t=zn({},e);return e.signal&&(t.signal=e.signal),t}return e}let P=function(t,i,a,o,s=!1,c=!1){return function(){let l=this||e,u=arguments[0];n&&n.transferEventName&&(u=n.transferEventName(u));let p=arguments[1];if(!p||dr&&u===`uncaughtException`)return t.apply(this,arguments);let m=!1;if(typeof p!=`function`){if(!p.handleEvent)return t.apply(this,arguments);m=!0}if(d&&!d(t,p,l,arguments))return;let h=!!N&&N.indexOf(u)!==-1,g=te(w(arguments[2],h)),y=g==null?void 0:g.signal;if(y!=null&&y.aborted)return;if(M){for(let e=0;e<M.length;e++)if(u===M[e])return h?t.call(l,u,p,g):t.apply(this,arguments)}let b=g?typeof g==`boolean`?!0:g.capture:!1,x=g&&typeof g==`object`?g.once:!1,S=Zone.current,C=kr[u];C||(Nr(u,_),C=kr[u]);let T=C[b?$n:er],E=l[T],D=!1;if(E){if(D=!0,f){for(let e=0;e<E.length;e++)if(ee(E[e],p))return}}else E=l[T]=[];let O,k=l.constructor.name,A=Ar[k];A&&(O=A[u]),O||(O=k+i+(_?_(u):u)),v.options=g,x&&(v.options.once=!1),v.target=l,v.capture=b,v.eventName=u,v.isExisting=D;let j=r?Or:void 0;j&&(j.taskData=v),y&&(v.options.signal=void 0);let P=S.scheduleEventTask(O,p,j,a,o);if(y){v.options.signal=y;let e=()=>P.zone.cancelTask(P);t.call(y,`abort`,e,{once:!0}),P.removeAbortListener=()=>y.removeEventListener(`abort`,e)}if(v.target=null,j&&(j.taskData=null),x&&(v.options.once=!0),typeof P.options!=`boolean`&&(P.options=g),P.target=l,P.capture=b,P.eventName=u,m&&(P.originalDelegate=p),c?E.unshift(P):E.push(P),s)return l}};return g[i]=P(y,l,A,j,h),C&&(g[u]=P(C,`.prependListener:`,O,j,h,!0)),g[a]=function(){let t=this||e,r=arguments[0];n&&n.transferEventName&&(r=n.transferEventName(r));let i=arguments[2],a=i?typeof i==`boolean`?!0:i.capture:!1,o=arguments[1];if(!o)return b.apply(this,arguments);if(d&&!d(b,o,t,arguments))return;let s=kr[r],c;s&&(c=s[a?$n:er]);let l=c&&t[c];if(l)for(let e=0;e<l.length;e++){let n=l[e];if(ee(n,o)){if(l.splice(e,1),n.isRemoved=!0,l.length===0&&(n.allRemoved=!0,t[c]=null,!a&&typeof r==`string`)){let e=tr+`ON_PROPERTY`+r;t[e]=null}return n.zone.cancelTask(n),h?t:void 0}}return b.apply(this,arguments)},g[o]=function(){let t=this||e,r=arguments[0];n&&n.transferEventName&&(r=n.transferEventName(r));let i=[],a=Fr(t,_?_(r):r);for(let e=0;e<a.length;e++){let t=a[e],n=t.originalDelegate?t.originalDelegate:t.callback;i.push(n)}return i},g[s]=function(){let t=this||e,r=arguments[0];if(r){n&&n.transferEventName&&(r=n.transferEventName(r));let e=kr[r];if(e){let n=e[er],i=e[$n],o=t[n],s=t[i];if(o){let e=o.slice();for(let t=0;t<e.length;t++){let n=e[t],i=n.originalDelegate?n.originalDelegate:n.callback;this[a].call(this,r,i,n.options)}}if(s){let e=s.slice();for(let t=0;t<e.length;t++){let n=e[t],i=n.originalDelegate?n.originalDelegate:n.callback;this[a].call(this,r,i,n.options)}}}}else{let e=Object.keys(t);for(let t=0;t<e.length;t++){let n=e[t],r=jr.exec(n),i=r&&r[1];i&&i!==`removeListener`&&this[s].call(this,i)}this[s].call(this,`removeListener`)}if(h)return this},Tr(g[i],y),Tr(g[a],b),S&&Tr(g[s],S),x&&Tr(g[o],x),!0}let g=[];for(let e=0;e<n.length;e++)g[e]=h(n[e],r);return g}function Fr(e,t){if(!t){let n=[];for(let r in e){let i=jr.exec(r),a=i&&i[1];if(a&&(!t||a===t)){let t=e[r];if(t)for(let e=0;e<t.length;e++)n.push(t[e])}}return n}let n=kr[t];n||(Nr(t),n=kr[t]);let r=e[n[er]],i=e[n[$n]];return r?i?r.concat(i):r.slice():i?i.slice():[]}function Ir(e,t){let n=e.Event;n&&n.prototype&&t.patchMethod(n.prototype,`stopImmediatePropagation`,e=>function(t,n){t[Mr]=!0,e&&e.apply(t,n)})}function Lr(e,t){t.patchMethod(e,`queueMicrotask`,e=>function(e,t){Zone.current.scheduleMicroTask(`queueMicrotask`,t[0])})}var Rr=U(`zoneTask`);function zr(e,t,n,r){let i=null,a=null;t+=r,n+=r;let o={};function s(t){let n=t.data;n.args[0]=function(){return t.invoke.apply(this,arguments)};let r=i.apply(e,n.args);return Dr(r)?n.handleId=r:(n.handle=r,n.isRefreshable=Er(r.refresh)),t}function c(t){let{handle:n,handleId:r}=t.data;return a.call(e,n==null?r:n)}i=Cr(e,t,n=>function(i,a){var l;if(Er(a[0])){let e={isRefreshable:!1,isPeriodic:r===`Interval`,delay:r===`Timeout`||r===`Interval`?a[1]||0:void 0,args:a},n=a[0];a[0]=function(){try{return n.apply(this,arguments)}finally{let{handle:t,handleId:n,isPeriodic:r,isRefreshable:i}=e;!r&&!i&&(n?delete o[n]:t&&(t[Rr]=null))}};let i=rr(t,a[0],e,s,c);if(!i)return i;let{handleId:u,handle:d,isRefreshable:f,isPeriodic:p}=i.data;if(u)o[u]=i;else if(d&&(d[Rr]=i,f&&!p)){let e=d.refresh;d.refresh=function(){let{zone:t,state:n}=i;return n===`notScheduled`?(i._state=`scheduled`,t._updateTaskCount(i,1)):n===`running`&&(i._state=`scheduling`),e.call(this)}}return(l=d==null?u:d)==null?i:l}else return n.apply(e,a)}),a=Cr(e,n,t=>function(n,r){let i=r[0],a;Dr(i)?(a=o[i],delete o[i]):(a=i==null?void 0:i[Rr],a?i[Rr]=null:a=i),a!=null&&a.type?a.cancelFn&&a.zone.cancelTask(a):t.apply(e,r)})}function Br(e,t){let{isBrowser:n,isMix:r}=t.getGlobalObjects();!n&&!r||!e.customElements||!(`customElements`in e)||t.patchCallbacks(t,e.customElements,`customElements`,`define`,[`connectedCallback`,`disconnectedCallback`,`adoptedCallback`,`attributeChangedCallback`,`formAssociatedCallback`,`formDisabledCallback`,`formResetCallback`,`formStateRestoreCallback`])}function Vr(e,t){if(Zone[t.symbol(`patchEventTarget`)])return;let{eventNames:n,zoneSymbolEventNames:r,TRUE_STR:i,FALSE_STR:a,ZONE_SYMBOL_PREFIX:o}=t.getGlobalObjects();for(let e=0;e<n.length;e++){let t=n[e],s=t+a,c=t+i,l=o+s,u=o+c;r[t]={},r[t][a]=l,r[t][i]=u}let s=e.EventTarget;if(!(!s||!s.prototype))return t.patchEventTarget(e,t,[s&&s.prototype]),!0}function Hr(e,t){t.patchEventPrototype(e,t)}function Ur(e,t,n){if(!n||n.length===0)return t;let r=n.filter(t=>t.target===e);if(r.length===0)return t;let i=r[0].ignoreProperties;return t.filter(e=>i.indexOf(e)===-1)}function Wr(e,t,n,r){e&&vr(e,Ur(e,t,n),r)}function Gr(e){return Object.getOwnPropertyNames(e).filter(e=>e.startsWith(`on`)&&e.length>2).map(e=>e.substring(2))}function Kr(e,t){if(dr&&!pr||Zone[e.symbol(`patchEvents`)])return;let n=t.__Zone_ignore_on_properties,r=[];if(fr){let e=window;r=r.concat([`Document`,`SVGElement`,`Element`,`HTMLElement`,`HTMLBodyElement`,`HTMLMediaElement`,`HTMLFrameSetElement`,`HTMLFrameElement`,`HTMLIFrameElement`,`HTMLMarqueeElement`,`Worker`]),Wr(e,Gr(e),n,Kn(e))}r=r.concat([`XMLHttpRequest`,`XMLHttpRequestEventTarget`,`IDBIndex`,`IDBRequest`,`IDBOpenDBRequest`,`IDBDatabase`,`IDBTransaction`,`IDBCursor`,`WebSocket`]);for(let e=0;e<r.length;e++){let i=t[r[e]];i!=null&&i.prototype&&Wr(i.prototype,Gr(i.prototype),n)}}function qr(e){e.__load_patch(`timers`,e=>{let t=`clear`;zr(e,`set`,t,`Timeout`),zr(e,`set`,t,`Interval`),zr(e,`set`,t,`Immediate`)}),e.__load_patch(`requestAnimationFrame`,e=>{zr(e,`request`,`cancel`,`AnimationFrame`),zr(e,`mozRequest`,`mozCancel`,`AnimationFrame`),zr(e,`webkitRequest`,`webkitCancel`,`AnimationFrame`)}),e.__load_patch(`blocking`,(e,t)=>{let n=[`alert`,`prompt`,`confirm`];for(let r=0;r<n.length;r++){let i=n[r];Cr(e,i,(n,r,i)=>function(r,a){return t.current.run(n,e,a,i)})}}),e.__load_patch(`EventTarget`,(e,t,n)=>{Hr(e,n),Vr(e,n);let r=e.XMLHttpRequestEventTarget;r&&r.prototype&&n.patchEventTarget(e,n,[r.prototype])}),e.__load_patch(`MutationObserver`,(e,t,n)=>{br(`MutationObserver`),br(`WebKitMutationObserver`)}),e.__load_patch(`IntersectionObserver`,(e,t,n)=>{br(`IntersectionObserver`)}),e.__load_patch(`FileReader`,(e,t,n)=>{br(`FileReader`)}),e.__load_patch(`on_property`,(e,t,n)=>{Kr(n,e)}),e.__load_patch(`customElements`,(e,t,n)=>{Br(e,n)}),e.__load_patch(`XHR`,(e,t)=>{c(e);let n=U(`xhrTask`),r=U(`xhrSync`),i=U(`xhrListener`),a=U(`xhrScheduled`),o=U(`xhrURL`),s=U(`xhrErrorBeforeScheduled`);function c(e){let c=e.XMLHttpRequest;if(!c)return;let l=c.prototype;function u(e){return e[n]}let d=l[Zn],f=l[Qn];if(!d){let t=e.XMLHttpRequestEventTarget;if(t){let e=t.prototype;d=e[Zn],f=e[Qn]}}let p=`readystatechange`,m=`scheduled`;function h(e){let r=e.data,o=r.target;o[a]=!1,o[s]=!1;let c=o[i];d||(d=o[Zn],f=o[Qn]),c&&f.call(o,p,c);let l=o[i]=()=>{if(o.readyState===o.DONE)if(!r.aborted&&o[a]&&e.state===m){let n=o[t.__symbol__(`loadfalse`)];if(o.status!==0&&n&&n.length>0){let i=e.invoke;e.invoke=function(){let n=o[t.__symbol__(`loadfalse`)];for(let t=0;t<n.length;t++)n[t]===e&&n.splice(t,1);!r.aborted&&e.state===m&&i.call(e)},n.push(e)}else e.invoke()}else !r.aborted&&o[a]===!1&&(o[s]=!0)};return d.call(o,p,l),o[n]||(o[n]=e),x.apply(o,r.args),o[a]=!0,e}function g(){}function _(e){let t=e.data;return t.aborted=!0,S.apply(t.target,t.args)}let v=Cr(l,`open`,()=>function(e,t){return e[r]=t[2]==0,e[o]=t[1],v.apply(e,t)}),y=U(`fetchTaskAborting`),b=U(`fetchTaskScheduling`),x=Cr(l,`send`,()=>function(e,n){if(t.current[b]===!0||e[r])return x.apply(e,n);{let t={target:e,url:e[o],isPeriodic:!1,args:n,aborted:!1},r=rr(`XMLHttpRequest.send`,g,t,h,_);e&&e[s]===!0&&!t.aborted&&r.state===m&&r.invoke()}}),S=Cr(l,`abort`,()=>function(e,n){let r=u(e);if(r&&typeof r.type==`string`){if(r.cancelFn==null||r.data&&r.data.aborted)return;r.zone.cancelTask(r)}else if(t.current[y]===!0)return S.apply(e,n)})}}),e.__load_patch(`geolocation`,e=>{e.navigator&&e.navigator.geolocation&&cr(e.navigator.geolocation,[`getCurrentPosition`,`watchPosition`])}),e.__load_patch(`PromiseRejectionEvent`,(e,t)=>{function n(t){return function(n){Fr(e,t).forEach(r=>{let i=e.PromiseRejectionEvent;if(i){let e=new i(t,{promise:n.promise,reason:n.rejection});r.invoke(e)}})}}e.PromiseRejectionEvent&&(t[U(`unhandledPromiseRejectionHandler`)]=n(`unhandledrejection`),t[U(`rejectionHandledHandler`)]=n(`rejectionhandled`))}),e.__load_patch(`queueMicrotask`,(e,t,n)=>{Lr(e,n)})}function Jr(e){e.__load_patch(`ZoneAwarePromise`,(e,t,n)=>{let r=Object.getOwnPropertyDescriptor,i=Object.defineProperty;function a(e){return e&&e.toString===Object.prototype.toString?(e.constructor&&e.constructor.name||``)+`: `+JSON.stringify(e):e?e.toString():Object.prototype.toString.call(e)}let o=n.symbol,s=[],c=e[o(`DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION`)]!==!1,l=o(`Promise`),u=o(`then`);n.onUnhandledError=e=>{if(n.showUncaughtError()){let t=e&&e.rejection;t?console.error(`Unhandled Promise rejection:`,t instanceof Error?t.message:t,`; Zone:`,e.zone.name,`; Task:`,e.task&&e.task.source,`; Value:`,t,t instanceof Error?t.stack:void 0):console.error(e)}},n.microtaskDrainDone=()=>{for(;s.length;){let e=s.shift();try{e.zone.runGuarded(()=>{throw e.throwOriginal?e.rejection:e})}catch(e){f(e)}}};let d=o(`unhandledPromiseRejectionHandler`);function f(e){n.onUnhandledError(e);try{let n=t[d];typeof n==`function`&&n.call(this,e)}catch(e){}}function p(e){return e&&typeof e.then==`function`}function m(e){return e}function h(e){return A.reject(e)}let g=o(`state`),_=o(`value`),v=o(`finally`),y=o(`parentPromiseValue`),b=o(`parentPromiseState`);function x(e,t){return n=>{try{w(e,t,n)}catch(t){w(e,!1,t)}}}let S=function(){let e=!1;return function(t){return function(){e||(e=!0,t.apply(null,arguments))}}},C=o(`currentTaskTrace`);function w(e,r,o){let l=S();if(e===o)throw TypeError(`Promise resolved with itself`);if(e[g]===null){let u=null;try{(typeof o==`object`||typeof o==`function`)&&(u=o&&o.then)}catch(t){return l(()=>{w(e,!1,t)})(),e}if(r!==!1&&o instanceof A&&o.hasOwnProperty(g)&&o.hasOwnProperty(_)&&o[g]!==null)E(o),w(e,o[g],o[_]);else if(r!==!1&&typeof u==`function`)try{u.call(o,l(x(e,r)),l(x(e,!1)))}catch(t){l(()=>{w(e,!1,t)})()}else{e[g]=r;let l=e[_];if(e[_]=o,e[v]===v&&r===!0&&(e[g]=e[b],e[_]=e[y]),r===!1&&o instanceof Error){let e=t.currentTask&&t.currentTask.data&&t.currentTask.data.__creationTrace__;e&&i(o,C,{configurable:!0,enumerable:!1,writable:!0,value:e})}for(let t=0;t<l.length;)D(e,l[t++],l[t++],l[t++],l[t++]);if(l.length==0&&r==0){e[g]=0;let r=o;try{throw Error(`Uncaught (in promise): `+a(o)+(o&&o.stack?`
2
- `+o.stack:``))}catch(e){r=e}c&&(r.throwOriginal=!0),r.rejection=o,r.promise=e,r.zone=t.current,r.task=t.currentTask,s.push(r),n.scheduleMicroTask()}}}return e}let T=o(`rejectionHandledHandler`);function E(e){if(e[g]===0){try{let n=t[T];n&&typeof n==`function`&&n.call(this,{rejection:e[_],promise:e})}catch(e){}e[g]=!1;for(let t=0;t<s.length;t++)e===s[t].promise&&s.splice(t,1)}}function D(e,t,n,r,i){E(e);let a=e[g],o=a?typeof r==`function`?r:m:typeof i==`function`?i:h;t.scheduleMicroTask(`Promise.then`,()=>{try{let r=e[_],i=!!n&&v===n[v];i&&(n[y]=r,n[b]=a),w(n,!0,t.run(o,void 0,i&&o!==h&&o!==m?[]:[r]))}catch(e){w(n,!1,e)}},n)}let O=function(){},k=e.AggregateError;class A{static toString(){return`function ZoneAwarePromise() { [native code] }`}static resolve(e){return e instanceof A?e:w(new this(null),!0,e)}static reject(e){return w(new this(null),!1,e)}static withResolvers(){let e={};return e.promise=new A((t,n)=>{e.resolve=t,e.reject=n}),e}static any(e){if(!e||typeof e[Symbol.iterator]!=`function`)return Promise.reject(new k([],`All promises were rejected`));let t=[],n=0;try{for(let r of e)n++,t.push(A.resolve(r))}catch(e){return Promise.reject(new k([],`All promises were rejected`))}if(n===0)return Promise.reject(new k([],`All promises were rejected`));let r=!1,i=[];return new A((e,a)=>{for(let o=0;o<t.length;o++)t[o].then(t=>{r||(r=!0,e(t))},e=>{i.push(e),n--,n===0&&(r=!0,a(new k(i,`All promises were rejected`)))})})}static race(e){let t,n,r=new this((e,r)=>{t=e,n=r});function i(e){t(e)}function a(e){n(e)}for(let t of e)p(t)||(t=this.resolve(t)),t.then(i,a);return r}static all(e){return A.allWithCallback(e)}static allSettled(e){return(this&&this.prototype instanceof A?this:A).allWithCallback(e,{thenCallback:e=>({status:`fulfilled`,value:e}),errorCallback:e=>({status:`rejected`,reason:e})})}static allWithCallback(e,t){let n,r,i=new this((e,t)=>{n=e,r=t}),a=2,o=0,s=[];for(let i of e){p(i)||(i=this.resolve(i));let e=o;try{i.then(r=>{s[e]=t?t.thenCallback(r):r,a--,a===0&&n(s)},i=>{t?(s[e]=t.errorCallback(i),a--,a===0&&n(s)):r(i)})}catch(e){r(e)}a++,o++}return a-=2,a===0&&n(s),i}constructor(e){let t=this;if(!(t instanceof A))throw Error(`Must be an instanceof Promise.`);t[g]=null,t[_]=[];try{let n=S();e&&e(n(x(t,!0)),n(x(t,!1)))}catch(e){w(t,!1,e)}}get[Symbol.toStringTag](){return`Promise`}get[Symbol.species](){return A}then(e,n){var r;let i=(r=this.constructor)==null?void 0:r[Symbol.species];(!i||typeof i!=`function`)&&(i=this.constructor||A);let a=new i(O),o=t.current;return this[g]==null?this[_].push(o,a,e,n):D(this,o,a,e,n),a}catch(e){return this.then(null,e)}finally(e){var n;let r=(n=this.constructor)==null?void 0:n[Symbol.species];(!r||typeof r!=`function`)&&(r=A);let i=new r(O);i[v]=v;let a=t.current;return this[g]==null?this[_].push(a,i,e,e):D(this,a,i,e,e),i}}A.resolve=A.resolve,A.reject=A.reject,A.race=A.race,A.all=A.all;let j=e[l]=e.Promise;e.Promise=A;let ee=o(`thenPatched`);function M(e){let t=e.prototype,n=r(t,`then`);if(n&&(n.writable===!1||!n.configurable))return;let i=t.then;t[u]=i,e.prototype.then=function(e,t){return new A((e,t)=>{i.call(this,e,t)}).then(e,t)},e[ee]=!0}n.patchThen=M;function N(e){return function(t,n){let r=e.apply(t,n);if(r instanceof A)return r;let i=r.constructor;return i[ee]||M(i),r}}if(j){M(j);let t=j.try;t&&typeof t==`function`&&(A.try=t),Cr(e,`fetch`,e=>N(e))}return Promise[t.__symbol__(`uncaughtPromiseErrors`)]=s,A})}function Yr(e){e.__load_patch(`toString`,e=>{let t=Function.prototype.toString,n=U(`OriginalDelegate`),r=U(`Promise`),i=U(`Error`),a=function(){if(typeof this==`function`){let a=this[n];if(a)return typeof a==`function`?t.call(a):Object.prototype.toString.call(a);if(this===Promise){let n=e[r];if(n)return t.call(n)}if(this===Error){let n=e[i];if(n)return t.call(n)}}return t.call(this)};a[n]=t,Function.prototype.toString=a;let o=Object.prototype.toString;Object.prototype.toString=function(){return typeof Promise==`function`&&this instanceof Promise?`[object Promise]`:o.call(this)}})}function Xr(e,t,n,r,i){let a=Zone.__symbol__(r);if(t[a])return;let o=t[a]=t[r];t[r]=function(a,s,c){return s&&s.prototype&&i.forEach(function(t){let i=`${n}.${r}::`+t,a=s.prototype;try{if(a.hasOwnProperty(t)){let n=e.ObjectGetOwnPropertyDescriptor(a,t);n&&n.value?(n.value=e.wrapWithCurrentZone(n.value,i),e._redefineProperty(s.prototype,t,n)):a[t]&&(a[t]=e.wrapWithCurrentZone(a[t],i))}else a[t]&&(a[t]=e.wrapWithCurrentZone(a[t],i))}catch(e){}}),o.call(t,a,s,c)},e.attachOriginToPatched(t[r],o)}function Zr(e){e.__load_patch(`util`,(e,t,n)=>{let r=Gr(e);n.patchOnProperties=vr,n.patchMethod=Cr,n.bindArguments=sr,n.patchMacroTask=wr;let i=t.__symbol__(`BLACK_LISTED_EVENTS`),a=t.__symbol__(`UNPATCHED_EVENTS`);e[a]&&(e[i]=e[a]),e[i]&&(t[i]=t[a]=e[i]),n.patchEventPrototype=Ir,n.patchEventTarget=Pr,n.ObjectDefineProperty=Gn,n.ObjectGetOwnPropertyDescriptor=Wn,n.ObjectCreate=qn,n.ArraySlice=Jn,n.patchClass=br,n.wrapWithCurrentZone=nr,n.filterProperties=Ur,n.attachOriginToPatched=Tr,n._redefineProperty=Object.defineProperty,n.patchCallbacks=Xr,n.getGlobalObjects=()=>({globalSources:Ar,zoneSymbolEventNames:kr,eventNames:r,isBrowser:fr,isMix:pr,isNode:dr,TRUE_STR:$n,FALSE_STR:er,ZONE_SYMBOL_PREFIX:tr,ADD_EVENT_LISTENER_STR:Yn,REMOVE_EVENT_LISTENER_STR:Xn})})}function Qr(e){Jr(e),Yr(e),Zr(e)}var $r=Un();Qr($r),qr($r);function ei(e){return e.setValue(ni,!0)}function ti(e){return e.getValue(ni)===!0}var ni,ri=n((()=>{B(),ni=me(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`)})),ii,ai,oi=n((()=>{ii=`baggage`,ai=4096}));function si(e){return e.reduce((e,t)=>{let n=`${e}${e===``?``:`,`}${t}`;return n.length>8192?e:n},``)}function ci(e){return e.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(n+=`;`+t.metadata.toString()),n})}function li(e){if(!e)return;let t=e.indexOf(`;`),n=t===-1?e:e.substring(0,t),r=n.indexOf(`=`);if(r<=0)return;let i=n.substring(0,r).trim(),a=n.substring(r+1).trim();if(!i||!a)return;let o,s;try{o=decodeURIComponent(i),s=decodeURIComponent(a)}catch(e){return}let c;return t!==-1&&t<e.length-1&&(c=de(e.substring(t+1))),{key:o,value:s,metadata:c}}var ui=n((()=>{B(),oi()})),di,fi=n((()=>{B(),ri(),oi(),ui(),di=class{inject(e,t,n){let r=nn.getBaggage(e);if(!r||ti(e))return;let i=si(ci(r).filter(e=>e.length<=ai).slice(0,180));i.length>0&&n.set(t,ii,i)}extract(e,t,n){let r=n.get(t,ii),i=Array.isArray(r)?r.join(`,`):r;if(!i)return e;let a={};return i.length===0||(i.split(`,`).forEach(e=>{let t=li(e);if(t){let e={value:t.value};t.metadata&&(e.metadata=t.metadata),a[t.key]=e}}),Object.entries(a).length===0)?e:nn.setBaggage(e,nn.createBaggage(a))}fields(){return[ii]}}}));function pi(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!mi(n)){R.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!hi(r)){R.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function mi(e){return typeof e==`string`&&e!==``}function hi(e){return e==null?!0:Array.isArray(e)?gi(e):_i(typeof e)}function gi(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(_i(e)){t=e;continue}return!1}return!1}}return!0}function _i(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}var vi=n((()=>{B()}));function yi(){return e=>{R.error(bi(e))}}function bi(e){return typeof e==`string`?e:JSON.stringify(xi(e))}function xi(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;let r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}var Si=n((()=>{B()}));function Ci(e){try{wi(e)}catch(e){}}var wi,Ti=n((()=>{Si(),wi=yi()})),Ei=n((()=>{})),Di,Oi=n((()=>{Di=`2.7.1`})),ki=n((()=>{})),Ai=n((()=>{ki()})),ji=n((()=>{})),Mi=n((()=>{ji()})),Ni,Pi,Fi,Ii,Li,Ri,zi,Bi,Vi,Hi,Ui,Wi,Gi,Ki,qi,Ji,Yi=n((()=>{Ni=`error.type`,Pi=`exception.message`,Fi=`exception.stacktrace`,Ii=`exception.type`,Li=`http.request.method`,Ri=`http.request.method_original`,zi=`http.response.status_code`,Bi=`server.address`,Vi=`server.port`,Hi=`service.name`,Ui=`telemetry.sdk.language`,Wi=`webjs`,Gi=`telemetry.sdk.name`,Ki=`telemetry.sdk.version`,qi=`url.full`,Ji=`user_agent.original`})),Xi=n((()=>{})),Zi=n((()=>{})),Qi=n((()=>{Ai(),Mi(),Yi(),Xi(),Zi()})),$i,ea=n((()=>{$i=`process.runtime.name`})),ta,na=n((()=>{Oi(),Qi(),ea(),ta={[Gi]:`opentelemetry`,[$i]:`browser`,[Ui]:Wi,[Ki]:Di}})),G,ra=n((()=>{Ei(),na(),G=performance}));function ia(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*ma)]}function aa(e){return fa(ia(G.timeOrigin),ia(typeof e==`number`?e:G.now()))}function oa(e){if(ua(e))return e;if(typeof e==`number`)return e<G.timeOrigin?aa(e):ia(e);if(e instanceof Date)return ia(e.getTime());throw TypeError(`Invalid input type`)}function sa(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=ha),[n,r]}function ca(e){return e[0]*ha+e[1]}function la(e){return e[0]*1e6+e[1]/1e3}function ua(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function da(e){return ua(e)||typeof e==`number`||e instanceof Date}function fa(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=ha&&(n[1]-=ha,n[0]+=1),n}var pa,ma,ha,ga=n((()=>{ra(),pa=9,ma=Math.pow(10,6),ha=Math.pow(10,pa)})),_a,va=n((()=>{(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(_a||(_a={}))})),ya,ba=n((()=>{B(),d(),ya=class{constructor(e={}){var t;u(this,`_propagators`,void 0),u(this,`_fields`,void 0),this._propagators=(t=e.propagators)==null?[]:t;let n=new Set;for(let e of this._propagators){let t=typeof e.fields==`function`?e.fields():[];for(let e of t)n.add(e)}this._fields=Array.from(n)}inject(e,t,n){for(let r of this._propagators)try{r.inject(e,t,n)}catch(e){R.warn(`Failed to inject with ${r.constructor.name}. Err: ${e.message}`)}}extract(e,t,n){return this._propagators.reduce((e,r)=>{try{return r.extract(e,t,n)}catch(e){R.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}}}));function xa(e){return Ea.test(e)}function Sa(e){return Da.test(e)&&!Oa.test(e)}var Ca,wa,Ta,Ea,Da,Oa,ka=n((()=>{Ca=`[_0-9a-z-*/]`,wa=`[a-z]${Ca}{0,255}`,Ta=`[a-z0-9]${Ca}{0,240}@[a-z]${Ca}{0,13}`,Ea=RegExp(`^(?:${wa}|${Ta})$`),Da=/^[ -~]{0,255}[!-~]$/,Oa=/,|=/})),Aa,ja,Ma,Na,Pa,Fa=n((()=>{ka(),d(),Aa=32,ja=512,Ma=`,`,Na=`=`,Pa=class e{constructor(e){u(this,`_length`,void 0),u(this,`_rawTraceState`,void 0),u(this,`_internalState`,void 0),this._rawTraceState=typeof e==`string`?e:``,this._length=this._rawTraceState.length}set(e,t){if(!xa(e)||!Sa(t))return this;let n=this._getState(),r=n.get(e),i=this._length;if(typeof r==`string`?i+=t.length-r.length:i+=e.length+t.length+(n.size>0?2:1),i>ja)return this;let a=new Map(n);return a.delete(e),a.set(e,t),this._fromState(a,i)}unset(e){let t=this._getState(),n=t.get(e);if(typeof n!=`string`)return this;let r=this._length-(e.length+n.length+1);t.size>1&&--r;let i=new Map(t);return i.delete(e),this._fromState(i,r)}get(e){return this._getState().get(e)}serialize(){let e=``,t=0;for(let n of this._getState())t>0&&(e=Ma+e),e=`${n[0]}${Na}${n[1]}`+e,t++;return e}_getState(){if(this._internalState)return this._internalState;let e=this._rawTraceState.split(Ma),t=new Map,n=0;for(let r of e){let e=r.trim(),i=e.indexOf(Na);if(i===-1)continue;let a=e.slice(0,i),o=e.slice(i+1);if(!xa(a)||!Sa(o))continue;let s=n+e.length+ +(t.size>0);if(!(s>ja)&&(t.set(a,o),n=s,t.size>=Aa))break}return this._length=n,this._internalState=new Map(Array.from(t.entries()).reverse()),this._internalState}_fromState(t,n){let r=Object.create(e.prototype);return r._internalState=t,r._length=n,r}}}));function Ia(e){let t=Ba.exec(e);return!t||t[1]===`00`&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var La,Ra,za,Ba,Va,Ha=n((()=>{B(),ri(),Fa(),La=`traceparent`,Ra=`tracestate`,za=`00`,Ba=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`),Va=class{inject(e,t,n){let r=z.getSpanContext(e);if(!r||ti(e)||!pt(r))return;let i=`${za}-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||F.NONE).toString(16)}`;n.set(t,La,i),r.traceState&&n.set(t,Ra,r.traceState.serialize())}extract(e,t,n){let r=n.get(t,La);if(!r)return e;let i=Array.isArray(r)?r[0]:r;if(typeof i!=`string`)return e;let a=Ia(i);if(!a)return e;a.isRemote=!0;let o=n.get(t,Ra);if(o){let e=Array.isArray(o)?o.join(`,`):o;a.traceState=new Pa(typeof e==`string`?e:void 0)}return z.setSpanContext(e,a)}fields(){return[La,Ra]}}}));function Ua(e){if(!Wa(e)||Ga(e)!==Ja)return!1;let t=$a(e);if(t===null)return!0;let n=to.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&Za.call(n)===Qa}function Wa(e){return typeof e==`object`&&!!e}function Ga(e){return e==null?e===void 0?Xa:Ya:no&&no in Object(e)?Ka(e):qa(e)}function Ka(e){let t=to.call(e,no),n=e[no],r=!1;try{e[no]=void 0,r=!0}catch(e){}let i=ro.call(e);return r&&(t?e[no]=n:delete e[no]),i}function qa(e){return ro.call(e)}var Ja,Ya,Xa,Za,Qa,$a,eo,to,no,ro,io=n((()=>{Ja=`[object Object]`,Ya=`[object Null]`,Xa=`[object Undefined]`,Za=Function.prototype.toString,Qa=Za.call(Object),$a=Object.getPrototypeOf,eo=Object.prototype,to=eo.hasOwnProperty,no=Symbol?Symbol.toStringTag:void 0,ro=eo.toString}));function ao(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=so(t,e.shift(),0,n);return t}function oo(e){return lo(e)?e.slice():e}function so(e,t,n=0,r){let i;if(!(n>ho)){if(n++,po(e)||po(t)||uo(t))i=oo(t);else if(lo(e)){if(i=e.slice(),lo(t))for(let e=0,n=t.length;e<n;e++)i.push(oo(t[e]));else if(fo(t)){let e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){let r=e[n];r===`__proto__`||r===`constructor`||r===`prototype`||(i[r]=oo(t[r]))}}}else if(fo(e))if(fo(t)){if(!mo(e,t))return t;i=Object.assign({},e);let a=Object.keys(t);for(let o=0,s=a.length;o<s;o++){let s=a[o];if(s===`__proto__`||s===`constructor`||s===`prototype`)continue;let c=t[s];if(po(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(co(e,s,r)||co(t,s,r))delete i[s];else{if(fo(a)&&fo(o)){let n=r.get(a)||[],i=r.get(o)||[];n.push({obj:e,key:s}),i.push({obj:t,key:s}),r.set(a,n),r.set(o,i)}i[s]=so(i[s],c,n,r)}}}}else i=t;return i}}function co(e,t,n){let r=n.get(e[t])||[];for(let n=0,i=r.length;n<i;n++){let i=r[n];if(i.key===t&&i.obj===e)return!0}return!1}function lo(e){return Array.isArray(e)}function uo(e){return typeof e==`function`}function fo(e){return!po(e)&&!lo(e)&&!uo(e)&&typeof e==`object`}function po(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function mo(e,t){return!(!Ua(e)||!Ua(t))}var ho,go=n((()=>{io(),ho=20}));function _o(e,t){let n,r=new Promise(function(e,r){n=setTimeout(function(){r(new vo(`Operation timed out.`))},t)});return Promise.race([e,r]).then(e=>(clearTimeout(n),e),e=>{throw clearTimeout(n),e})}var vo,yo=n((()=>{vo=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}}}));function bo(e,t){return typeof t==`string`?e===t:!!e.match(t)}function xo(e,t){if(!t)return!1;for(let n of t)if(bo(e,n))return!0;return!1}var So=n((()=>{})),Co,wo=n((()=>{d(),Co=class{constructor(){u(this,`_promise`,void 0),u(this,`_resolve`,void 0),u(this,`_reject`,void 0),this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}})),To,Eo=n((()=>{wo(),d(),To=class{constructor(e,t){u(this,`_isCalled`,!1),u(this,`_deferred`,new Co),u(this,`_callback`,void 0),u(this,`_that`,void 0),this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}}}));function Do(e,t){return new Promise(n=>{L.with(ei(L.active()),()=>{e.export(t,n)})})}var Oo=n((()=>{B(),ri()})),ko,K=n((()=>{fi(),d(),vi(),Ti(),Si(),ga(),va(),ui(),ra(),ba(),Ha(),B(),ri(),Fa(),go(),yo(),So(),Eo(),Oo(),ko={_export:Do}}));d();var Ao=class{constructor(e){u(this,`_delegate`,void 0),this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}};d();var jo=class extends Error{constructor(e,t,n){super(e),u(this,`code`,void 0),u(this,`name`,`OTLPExporterError`),u(this,`data`,void 0),this.data=n,this.code=t}};m();function Mo(e){if(Number.isFinite(e)&&e>0)return e;throw Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function No(e){if(e!=null)return p(function*(){return e})}function Po(e,t,n){var r,i,a,o,s,c;return{timeoutMillis:Mo((r=(i=e.timeoutMillis)==null?t.timeoutMillis:i)==null?n.timeoutMillis:r),concurrencyLimit:(a=(o=e.concurrencyLimit)==null?t.concurrencyLimit:o)==null?n.concurrencyLimit:a,compression:(s=(c=e.compression)==null?t.compression:c)==null?n.compression:s}}function Fo(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:`none`}}d(),m();var Io=class{constructor(e){u(this,`_concurrencyLimit`,void 0),u(this,`_sendingPromises`,[]),this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw Error(`Concurrency Limit reached`);this._sendingPromises.push(e);let t=()=>{let t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}awaitAll(){var e=this;return p(function*(){yield Promise.all(e._sendingPromises)})()}};function Lo(e){return new Io(e.concurrencyLimit)}B();function Ro(e){return Object.prototype.hasOwnProperty.call(e,`partialSuccess`)}function zo(){return{handleResponse(e){e==null||!Ro(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||R.warn(`Received Partial Success response:`,JSON.stringify(e.partialSuccess))}}}K(),B(),d(),m();var Bo=class{constructor(e,t,n,r,i){u(this,`_diagLogger`,void 0),u(this,`_transport`,void 0),u(this,`_serializer`,void 0),u(this,`_responseHandler`,void 0),u(this,`_promiseQueue`,void 0),u(this,`_timeout`,void 0),this._transport=e,this._serializer=t,this._responseHandler=n,this._promiseQueue=r,this._timeout=i,this._diagLogger=R.createComponentLogger({namespace:`OTLPExportDelegate`})}export(e,t){if(this._diagLogger.debug(`items to be sent`,e),this._promiseQueue.hasReachedLimit()){t({code:_a.FAILED,error:Error(`Concurrent export limit reached`)});return}let n=this._serializer.serializeRequest(e);if(n==null){t({code:_a.FAILED,error:Error(`Nothing to send`)});return}this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(e=>{if(e.status===`success`){if(e.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(e.data))}catch(t){this._diagLogger.warn(`Export succeeded but could not deserialize response - is the response specification compliant?`,t,e.data)}t({code:_a.SUCCESS});return}else if(e.status===`failure`&&e.error){t({code:_a.FAILED,error:e.error});return}else if(e.status===`retryable`){var n;t({code:_a.FAILED,error:(n=e.error)==null?new jo(`Export failed with retryable status`):n})}else t({code:_a.FAILED,error:new jo(`Export failed with unknown error`)})},e=>t({code:_a.FAILED,error:e})))}forceFlush(){return this._promiseQueue.awaitAll()}shutdown(){var e=this;return p(function*(){e._diagLogger.debug(`shutdown started`),yield e.forceFlush(),e._transport.shutdown()})()}};function Vo(e,t){return new Bo(e.transport,e.serializer,zo(),e.promiseHandler,t.timeout)}function Ho(e,t,n){return Vo({transport:n,serializer:t,promiseHandler:Lo(e)},{timeout:e.timeoutMillis})}var Uo;(function(e){e[e.DELTA=0]=`DELTA`,e[e.CUMULATIVE=1]=`CUMULATIVE`})(Uo||(Uo={}));var q;(function(e){e.COUNTER=`COUNTER`,e.GAUGE=`GAUGE`,e.HISTOGRAM=`HISTOGRAM`,e.UP_DOWN_COUNTER=`UP_DOWN_COUNTER`,e.OBSERVABLE_COUNTER=`OBSERVABLE_COUNTER`,e.OBSERVABLE_GAUGE=`OBSERVABLE_GAUGE`,e.OBSERVABLE_UP_DOWN_COUNTER=`OBSERVABLE_UP_DOWN_COUNTER`})(q||(q={}));var Wo;(function(e){e[e.HISTOGRAM=0]=`HISTOGRAM`,e[e.EXPONENTIAL_HISTOGRAM=1]=`EXPONENTIAL_HISTOGRAM`,e[e.GAUGE=2]=`GAUGE`,e[e.SUM=3]=`SUM`})(Wo||(Wo={}));function Go(e){let t=Object.keys(e);return t.length===0?``:(t=t.sort(),JSON.stringify(t.map(t=>[t,e[t]])))}function Ko(e){var t,n;return`${e.name}:${(t=e.version)==null?``:t}:${(n=e.schemaUrl)==null?``:n}`}var qo=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};function Jo(e,t){let n,r=new Promise(function(e,r){n=setTimeout(function(){r(new qo(`Operation timed out.`))},t)});return Promise.race([e,r]).then(e=>(clearTimeout(n),e),e=>{throw clearTimeout(n),e})}function Yo(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Xo(e,t){let n=0,r=e.length-1,i=e.length;for(;r>=n;){let a=n+Math.trunc((r-n)/2);e[a]<t?n=a+1:(i=a,r=a-1)}return i}function Zo(e,t){return e.toLowerCase()===t.toLowerCase()}var Qo;(function(e){e[e.DROP=0]=`DROP`,e[e.SUM=1]=`SUM`,e[e.LAST_VALUE=2]=`LAST_VALUE`,e[e.HISTOGRAM=3]=`HISTOGRAM`,e[e.EXPONENTIAL_HISTOGRAM=4]=`EXPONENTIAL_HISTOGRAM`})(Qo||(Qo={})),d();var $o=class{constructor(){u(this,`kind`,Qo.DROP)}createAccumulation(){}merge(e,t){}diff(e,t){}toMetricData(e,t,n,r){}};d();function es(e){let t=e.map(()=>0);return t.push(0),{buckets:{boundaries:e,counts:t},sum:0,count:0,hasMinMax:!1,min:1/0,max:-1/0}}var ts=class{constructor(e,t,n=!0,r=es(t)){u(this,`startTime`,void 0),u(this,`_boundaries`,void 0),u(this,`_recordMinMax`,void 0),u(this,`_current`,void 0),this.startTime=e,this._boundaries=t,this._recordMinMax=n,this._current=r}record(e){if(Number.isNaN(e))return;this._current.count+=1,this._current.sum+=e,this._recordMinMax&&(this._current.min=Math.min(e,this._current.min),this._current.max=Math.max(e,this._current.max),this._current.hasMinMax=!0);let t=Xo(this._boundaries,e);this._current.buckets.counts[t]+=1}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},ns=class{constructor(e,t){u(this,`kind`,Qo.HISTOGRAM),u(this,`_boundaries`,void 0),u(this,`_recordMinMax`,void 0),this._boundaries=e,this._recordMinMax=t}createAccumulation(e){return new ts(e,this._boundaries,this._recordMinMax)}merge(e,t){let n=e.toPointValue(),r=t.toPointValue(),i=n.buckets.counts,a=r.buckets.counts,o=Array(i.length);for(let e=0;e<i.length;e++)o[e]=i[e]+a[e];let s=1/0,c=-1/0;return this._recordMinMax&&(n.hasMinMax&&r.hasMinMax?(s=Math.min(n.min,r.min),c=Math.max(n.max,r.max)):n.hasMinMax?(s=n.min,c=n.max):r.hasMinMax&&(s=r.min,c=r.max)),new ts(e.startTime,n.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:n.buckets.boundaries,counts:o},count:n.count+r.count,sum:n.sum+r.sum,hasMinMax:this._recordMinMax&&(n.hasMinMax||r.hasMinMax),min:s,max:c})}diff(e,t){let n=e.toPointValue(),r=t.toPointValue(),i=n.buckets.counts,a=r.buckets.counts,o=Array(i.length);for(let e=0;e<i.length;e++)o[e]=a[e]-i[e];return new ts(t.startTime,n.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:n.buckets.boundaries,counts:o},count:r.count-n.count,sum:r.sum-n.sum,hasMinMax:!1,min:1/0,max:-1/0})}toMetricData(e,t,n,r){return{descriptor:e,aggregationTemporality:t,dataPointType:Wo.HISTOGRAM,dataPoints:n.map(([t,n])=>{let i=n.toPointValue(),a=e.type===q.GAUGE||e.type===q.UP_DOWN_COUNTER||e.type===q.OBSERVABLE_GAUGE||e.type===q.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:t,startTime:n.startTime,endTime:r,value:{min:i.hasMinMax?i.min:void 0,max:i.hasMinMax?i.max:void 0,sum:a?void 0:i.sum,buckets:i.buckets,count:i.count}}})}}};d();var rs=class e{constructor(e=new is,t=0,n=0,r=0){u(this,`backing`,void 0),u(this,`indexBase`,void 0),u(this,`indexStart`,void 0),u(this,`indexEnd`,void 0),this.backing=e,this.indexBase=t,this.indexStart=n,this.indexEnd=r}get offset(){return this.indexStart}get length(){return this.backing.length===0||this.indexEnd===this.indexStart&&this.at(0)===0?0:this.indexEnd-this.indexStart+1}counts(){return Array.from({length:this.length},(e,t)=>this.at(t))}at(e){let t=this.indexBase-this.indexStart;return e<t&&(e+=this.backing.length),e-=t,this.backing.countAt(e)}incrementBucket(e,t){this.backing.increment(e,t)}decrementBucket(e,t){this.backing.decrement(e,t)}trim(){for(let e=0;e<this.length;e++)if(this.at(e)!==0){this.indexStart+=e;break}else if(e===this.length-1){this.indexStart=this.indexEnd=this.indexBase=0;return}for(let e=this.length-1;e>=0;e--)if(this.at(e)!==0){this.indexEnd-=this.length-e-1;break}this._rotate()}downscale(e){this._rotate();let t=1+this.indexEnd-this.indexStart,n=1<<e,r=0,i=0;for(let e=this.indexStart;e<=this.indexEnd;){let a=e%n;a<0&&(a+=n);for(let o=a;o<n&&r<t;o++)this._relocateBucket(i,r),r++,e++;i++}this.indexStart>>=e,this.indexEnd>>=e,this.indexBase=this.indexStart}clone(){return new e(this.backing.clone(),this.indexBase,this.indexStart,this.indexEnd)}_rotate(){let e=this.indexBase-this.indexStart;e!==0&&(e>0?(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,e),this.backing.reverse(e,this.backing.length)):(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,this.backing.length+e)),this.indexBase=this.indexStart)}_relocateBucket(e,t){e!==t&&this.incrementBucket(e,this.backing.emptyBucket(t))}},is=class e{constructor(e=[0]){u(this,`_counts`,void 0),this._counts=e}get length(){return this._counts.length}countAt(e){return this._counts[e]}growTo(e,t,n){let r=Array(e).fill(0);r.splice(n,this._counts.length-t,...this._counts.slice(t)),r.splice(0,t,...this._counts.slice(0,t)),this._counts=r}reverse(e,t){let n=Math.floor((e+t)/2)-e;for(let r=0;r<n;r++){let n=this._counts[e+r];this._counts[e+r]=this._counts[t-r-1],this._counts[t-r-1]=n}}emptyBucket(e){let t=this._counts[e];return this._counts[e]=0,t}increment(e,t){this._counts[e]+=t}decrement(e,t){this._counts[e]>=t?this._counts[e]-=t:this._counts[e]=0}clone(){return new e([...this._counts])}},as=2146435072,os=1048575,ss=1023,cs=-ss+1,ls=ss,us=Math.pow(2,-1022);function ds(e){let t=new DataView(new ArrayBuffer(8));return t.setFloat64(0,e),((t.getUint32(0)&as)>>20)-ss}function fs(e){let t=new DataView(new ArrayBuffer(8));t.setFloat64(0,e);let n=t.getUint32(0),r=t.getUint32(4);return(n&os)*Math.pow(2,32)+r}function ps(e,t){return e===0||e===1/0||e===-1/0||Number.isNaN(e)?e:e*Math.pow(2,t)}function ms(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e++,e}var hs=class extends Error{};d();var gs=class{constructor(e){u(this,`_shift`,void 0),this._shift=-e}mapToIndex(e){return e<us?this._minNormalLowerBoundaryIndex():ds(e)+this._rightShift(fs(e)-1,52)>>this._shift}lowerBoundary(e){let t=this._minNormalLowerBoundaryIndex();if(e<t)throw new hs(`underflow: ${e} is < minimum lower boundary: ${t}`);let n=this._maxNormalLowerBoundaryIndex();if(e>n)throw new hs(`overflow: ${e} is > maximum lower boundary: ${n}`);return ps(1,e<<this._shift)}get scale(){return this._shift===0?0:-this._shift}_minNormalLowerBoundaryIndex(){let e=cs>>this._shift;return this._shift<2&&e--,e}_maxNormalLowerBoundaryIndex(){return ls>>this._shift}_rightShift(e,t){return Math.floor(e*Math.pow(2,-t))}};d();var _s=class{constructor(e){u(this,`_scale`,void 0),u(this,`_scaleFactor`,void 0),u(this,`_inverseFactor`,void 0),this._scale=e,this._scaleFactor=ps(Math.LOG2E,e),this._inverseFactor=ps(Math.LN2,-e)}mapToIndex(e){if(e<=us)return this._minNormalLowerBoundaryIndex()-1;if(fs(e)===0)return(ds(e)<<this._scale)-1;let t=Math.floor(Math.log(e)*this._scaleFactor),n=this._maxNormalLowerBoundaryIndex();return t>=n?n:t}lowerBoundary(e){let t=this._maxNormalLowerBoundaryIndex();if(e>=t){if(e===t)return 2*Math.exp((e-(1<<this._scale))/this._scaleFactor);throw new hs(`overflow: ${e} is > maximum lower boundary: ${t}`)}let n=this._minNormalLowerBoundaryIndex();if(e<=n){if(e===n)return us;if(e===n-1)return Math.exp((e+(1<<this._scale))/this._scaleFactor)/2;throw new hs(`overflow: ${e} is < minimum lower boundary: ${n}`)}return Math.exp(e*this._inverseFactor)}get scale(){return this._scale}_minNormalLowerBoundaryIndex(){return cs<<this._scale}_maxNormalLowerBoundaryIndex(){return(ls+1<<this._scale)-1}},vs=-10,ys=20,bs=Array.from({length:31},(e,t)=>t>10?new _s(t-10):new gs(t-10));function xs(e){if(e>ys||e<vs)throw new hs(`expected scale >= ${vs} && <= ${ys}, got: ${e}`);return bs[e+10]}B(),d();var Ss=class e{static combine(t,n){return new e(Math.min(t.low,n.low),Math.max(t.high,n.high))}constructor(e,t){u(this,`low`,void 0),u(this,`high`,void 0),this.low=e,this.high=t}},Cs=20,ws=160,Ts=2,Es=class e{constructor(e,t=ws,n=!0,r=0,i=0,a=0,o=1/0,s=-1/0,c=new rs,l=new rs,d=xs(Cs)){u(this,`startTime`,void 0),u(this,`_maxSize`,void 0),u(this,`_recordMinMax`,void 0),u(this,`_sum`,void 0),u(this,`_count`,void 0),u(this,`_zeroCount`,void 0),u(this,`_min`,void 0),u(this,`_max`,void 0),u(this,`_positive`,void 0),u(this,`_negative`,void 0),u(this,`_mapping`,void 0),this.startTime=e,this._maxSize=t,this._recordMinMax=n,this._sum=r,this._count=i,this._zeroCount=a,this._min=o,this._max=s,this._positive=c,this._negative=l,this._mapping=d,this._maxSize<Ts&&(R.warn(`Exponential Histogram Max Size set to ${this._maxSize}, \
3
- changing to the minimum size of: ${Ts}`),this._maxSize=Ts)}record(e){this.updateByIncrement(e,1)}setStartTime(e){this.startTime=e}toPointValue(){return{hasMinMax:this._recordMinMax,min:this.min,max:this.max,sum:this.sum,positive:{offset:this.positive.offset,bucketCounts:this.positive.counts()},negative:{offset:this.negative.offset,bucketCounts:this.negative.counts()},count:this.count,scale:this.scale,zeroCount:this.zeroCount}}get sum(){return this._sum}get min(){return this._min}get max(){return this._max}get count(){return this._count}get zeroCount(){return this._zeroCount}get scale(){return this._count===this._zeroCount?0:this._mapping.scale}get positive(){return this._positive}get negative(){return this._negative}updateByIncrement(e,t){if(!Number.isNaN(e)){if(e>this._max&&(this._max=e),e<this._min&&(this._min=e),this._count+=t,e===0){this._zeroCount+=t;return}this._sum+=e*t,e>0?this._updateBuckets(this._positive,e,t):this._updateBuckets(this._negative,-e,t)}}merge(e){this._count===0?(this._min=e.min,this._max=e.max):e.count!==0&&(e.min<this.min&&(this._min=e.min),e.max>this.max&&(this._max=e.max)),this.startTime=e.startTime,this._sum+=e.sum,this._count+=e.count,this._zeroCount+=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._mergeBuckets(this.positive,e,e.positive,t),this._mergeBuckets(this.negative,e,e.negative,t)}diff(e){this._min=1/0,this._max=-1/0,this._sum-=e.sum,this._count-=e.count,this._zeroCount-=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._diffBuckets(this.positive,e,e.positive,t),this._diffBuckets(this.negative,e,e.negative,t)}clone(){return new e(this.startTime,this._maxSize,this._recordMinMax,this._sum,this._count,this._zeroCount,this._min,this._max,this.positive.clone(),this.negative.clone(),this._mapping)}_updateBuckets(e,t,n){let r=this._mapping.mapToIndex(t),i=!1,a=0,o=0;if(e.length===0?(e.indexStart=r,e.indexEnd=e.indexStart,e.indexBase=e.indexStart):r<e.indexStart&&e.indexEnd-r>=this._maxSize?(i=!0,o=r,a=e.indexEnd):r>e.indexEnd&&r-e.indexStart>=this._maxSize&&(i=!0,o=e.indexStart,a=r),i){let e=this._changeScale(a,o);this._downscale(e),r=this._mapping.mapToIndex(t)}this._incrementIndexBy(e,r,n)}_incrementIndexBy(e,t,n){if(n===0)return;if(e.length===0&&(e.indexStart=e.indexEnd=e.indexBase=t),t<e.indexStart){let n=e.indexEnd-t;n>=e.backing.length&&this._grow(e,n+1),e.indexStart=t}else if(t>e.indexEnd){let n=t-e.indexStart;n>=e.backing.length&&this._grow(e,n+1),e.indexEnd=t}let r=t-e.indexBase;r<0&&(r+=e.backing.length),e.incrementBucket(r,n)}_grow(e,t){let n=e.backing.length,r=e.indexBase-e.indexStart,i=n-r,a=ms(t);a>this._maxSize&&(a=this._maxSize);let o=a-r;e.backing.growTo(a,i,o)}_changeScale(e,t){let n=0;for(;e-t>=this._maxSize;)e>>=1,t>>=1,n++;return n}_downscale(e){if(e===0)return;if(e<0)throw Error(`impossible change of scale: ${this.scale}`);let t=this._mapping.scale-e;this._positive.downscale(e),this._negative.downscale(e),this._mapping=xs(t)}_minScale(e){let t=Math.min(this.scale,e.scale),n=Ss.combine(this._highLowAtScale(this.positive,this.scale,t),this._highLowAtScale(e.positive,e.scale,t)),r=Ss.combine(this._highLowAtScale(this.negative,this.scale,t),this._highLowAtScale(e.negative,e.scale,t));return Math.min(t-this._changeScale(n.high,n.low),t-this._changeScale(r.high,r.low))}_highLowAtScale(e,t,n){if(e.length===0)return new Ss(0,-1);let r=t-n;return new Ss(e.indexStart>>r,e.indexEnd>>r)}_mergeBuckets(e,t,n,r){let i=n.offset,a=t.scale-r;for(let t=0;t<n.length;t++)this._incrementIndexBy(e,i+t>>a,n.at(t))}_diffBuckets(e,t,n,r){let i=n.offset,a=t.scale-r;for(let t=0;t<n.length;t++){let r=(i+t>>a)-e.indexBase;r<0&&(r+=e.backing.length),e.decrementBucket(r,n.at(t))}e.trim()}},Ds=class{constructor(e,t){u(this,`kind`,Qo.EXPONENTIAL_HISTOGRAM),u(this,`_maxSize`,void 0),u(this,`_recordMinMax`,void 0),this._maxSize=e,this._recordMinMax=t}createAccumulation(e){return new Es(e,this._maxSize,this._recordMinMax)}merge(e,t){let n=t.clone();return n.merge(e),n}diff(e,t){let n=t.clone();return n.diff(e),n}toMetricData(e,t,n,r){return{descriptor:e,aggregationTemporality:t,dataPointType:Wo.EXPONENTIAL_HISTOGRAM,dataPoints:n.map(([t,n])=>{let i=n.toPointValue(),a=e.type===q.GAUGE||e.type===q.UP_DOWN_COUNTER||e.type===q.OBSERVABLE_GAUGE||e.type===q.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:t,startTime:n.startTime,endTime:r,value:{min:i.hasMinMax?i.min:void 0,max:i.hasMinMax?i.max:void 0,sum:a?void 0:i.sum,positive:{offset:i.positive.offset,bucketCounts:i.positive.bucketCounts},negative:{offset:i.negative.offset,bucketCounts:i.negative.bucketCounts},count:i.count,scale:i.scale,zeroCount:i.zeroCount}}})}}};K(),d();var Os=class{constructor(e,t=0,n=[0,0]){u(this,`startTime`,void 0),u(this,`_current`,void 0),u(this,`sampleTime`,void 0),this.startTime=e,this._current=t,this.sampleTime=n}record(e){this._current=e,this.sampleTime=ia(Date.now())}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},ks=class{constructor(){u(this,`kind`,Qo.LAST_VALUE)}createAccumulation(e){return new Os(e)}merge(e,t){let n=la(t.sampleTime)>=la(e.sampleTime)?t:e;return new Os(e.startTime,n.toPointValue(),n.sampleTime)}diff(e,t){let n=la(t.sampleTime)>=la(e.sampleTime)?t:e;return new Os(t.startTime,n.toPointValue(),n.sampleTime)}toMetricData(e,t,n,r){return{descriptor:e,aggregationTemporality:t,dataPointType:Wo.GAUGE,dataPoints:n.map(([e,t])=>({attributes:e,startTime:t.startTime,endTime:r,value:t.toPointValue()}))}}};d();var As=class{constructor(e,t,n=0,r=!1){u(this,`startTime`,void 0),u(this,`monotonic`,void 0),u(this,`_current`,void 0),u(this,`reset`,void 0),this.startTime=e,this.monotonic=t,this._current=n,this.reset=r}record(e){this.monotonic&&e<0||(this._current+=e)}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},js=class{constructor(e){u(this,`kind`,Qo.SUM),u(this,`monotonic`,void 0),this.monotonic=e}createAccumulation(e){return new As(e,this.monotonic)}merge(e,t){let n=e.toPointValue(),r=t.toPointValue();return t.reset?new As(t.startTime,this.monotonic,r,t.reset):new As(e.startTime,this.monotonic,n+r)}diff(e,t){let n=e.toPointValue(),r=t.toPointValue();return this.monotonic&&n>r?new As(t.startTime,this.monotonic,r,!0):new As(t.startTime,this.monotonic,r-n)}toMetricData(e,t,n,r){return{descriptor:e,aggregationTemporality:t,dataPointType:Wo.SUM,dataPoints:n.map(([e,t])=>({attributes:e,startTime:t.startTime,endTime:r,value:t.toPointValue()})),isMonotonic:this.monotonic}}};B(),d();var Ms=class e{createAggregator(t){return e.DEFAULT_INSTANCE}};u(Ms,`DEFAULT_INSTANCE`,new $o);var Ns=class e{createAggregator(t){switch(t.type){case q.COUNTER:case q.OBSERVABLE_COUNTER:case q.HISTOGRAM:return e.MONOTONIC_INSTANCE;default:return e.NON_MONOTONIC_INSTANCE}}};u(Ns,`MONOTONIC_INSTANCE`,new js(!0)),u(Ns,`NON_MONOTONIC_INSTANCE`,new js(!1));var Ps=class e{createAggregator(t){return e.DEFAULT_INSTANCE}};u(Ps,`DEFAULT_INSTANCE`,new ks);var Fs=class e{createAggregator(t){return e.DEFAULT_INSTANCE}};u(Fs,`DEFAULT_INSTANCE`,new ns([0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4],!0));var Is=class{constructor(e,t=!0){if(u(this,`_boundaries`,void 0),u(this,`_recordMinMax`,void 0),e==null)throw Error(`ExplicitBucketHistogramAggregation should be created with explicit boundaries, if a single bucket histogram is required, please pass an empty array`);e=e.concat(),e=e.sort((e,t)=>e-t);let n=e.lastIndexOf(-1/0),r=e.indexOf(1/0);r===-1&&(r=void 0),this._boundaries=e.slice(n+1,r),this._recordMinMax=t}createAggregator(e){return new ns(this._boundaries,this._recordMinMax)}},Ls=class{constructor(e=160,t=!0){u(this,`_maxSize`,void 0),u(this,`_recordMinMax`,void 0),this._maxSize=e,this._recordMinMax=t}createAggregator(e){return new Ds(this._maxSize,this._recordMinMax)}},Rs=class{_resolve(e){switch(e.type){case q.COUNTER:case q.UP_DOWN_COUNTER:case q.OBSERVABLE_COUNTER:case q.OBSERVABLE_UP_DOWN_COUNTER:return Bs;case q.GAUGE:case q.OBSERVABLE_GAUGE:return Vs;case q.HISTOGRAM:return e.advice.explicitBucketBoundaries?new Is(e.advice.explicitBucketBoundaries):Hs}return R.warn(`Unable to recognize instrument type: ${e.type}`),zs}createAggregator(e){return this._resolve(e).createAggregator(e)}},zs=new Ms,Bs=new Ns,Vs=new Ps,Hs=new Fs;new Ls;var Us=new Rs,Ws;(function(e){e[e.DEFAULT=0]=`DEFAULT`,e[e.DROP=1]=`DROP`,e[e.SUM=2]=`SUM`,e[e.LAST_VALUE=3]=`LAST_VALUE`,e[e.EXPLICIT_BUCKET_HISTOGRAM=4]=`EXPLICIT_BUCKET_HISTOGRAM`,e[e.EXPONENTIAL_HISTOGRAM=5]=`EXPONENTIAL_HISTOGRAM`})(Ws||(Ws={}));function Gs(e){switch(e.type){case Ws.DEFAULT:return Us;case Ws.DROP:return zs;case Ws.SUM:return Bs;case Ws.LAST_VALUE:return Vs;case Ws.EXPONENTIAL_HISTOGRAM:{var t,n;let r=e;return new Ls((t=r.options)==null?void 0:t.maxSize,(n=r.options)==null?void 0:n.recordMinMax)}case Ws.EXPLICIT_BUCKET_HISTOGRAM:{let t=e;if(t.options==null)return Hs;var r,i;return new Is((r=t.options)==null?void 0:r.boundaries,(i=t.options)==null?void 0:i.recordMinMax)}default:throw Error(`Unsupported Aggregation`)}}var Ks=e=>({type:Ws.DEFAULT}),qs=e=>Uo.CUMULATIVE;B(),d(),m();var Js=class{constructor(e){var t,n,r;u(this,`_shutdown`,!1),u(this,`_metricProducers`,void 0),u(this,`_sdkMetricProducer`,void 0),u(this,`_aggregationTemporalitySelector`,void 0),u(this,`_aggregationSelector`,void 0),u(this,`_cardinalitySelector`,void 0),this._aggregationSelector=(t=e==null?void 0:e.aggregationSelector)==null?Ks:t,this._aggregationTemporalitySelector=(n=e==null?void 0:e.aggregationTemporalitySelector)==null?qs:n,this._metricProducers=(r=e==null?void 0:e.metricProducers)==null?[]:r,this._cardinalitySelector=e==null?void 0:e.cardinalitySelector}setMetricProducer(e){if(this._sdkMetricProducer)throw Error(`MetricReader can not be bound to a MeterProvider again.`);this._sdkMetricProducer=e,this.onInitialized()}selectAggregation(e){return this._aggregationSelector(e)}selectAggregationTemporality(e){return this._aggregationTemporalitySelector(e)}selectCardinalityLimit(e){return this._cardinalitySelector?this._cardinalitySelector(e):2e3}onInitialized(){}collect(e){var t=this;return p(function*(){if(t._sdkMetricProducer===void 0)throw Error(`MetricReader is not bound to a MetricProducer`);if(t._shutdown)throw Error(`MetricReader is shutdown`);let[n,...r]=yield Promise.all([t._sdkMetricProducer.collect({timeoutMillis:e==null?void 0:e.timeoutMillis}),...t._metricProducers.map(t=>t.collect({timeoutMillis:e==null?void 0:e.timeoutMillis}))]),i=n.errors.concat(r.flatMap(e=>e.errors));return{resourceMetrics:{resource:n.resourceMetrics.resource,scopeMetrics:n.resourceMetrics.scopeMetrics.concat(r.flatMap(e=>e.resourceMetrics.scopeMetrics))},errors:i}})()}shutdown(e){var t=this;return p(function*(){if(t._shutdown){R.error(`Cannot call shutdown twice.`);return}(e==null?void 0:e.timeoutMillis)==null?yield t.onShutdown():yield Jo(t.onShutdown(),e.timeoutMillis),t._shutdown=!0})()}forceFlush(e){var t=this;return p(function*(){if(t._shutdown){R.warn(`Cannot forceFlush on already shutdown MetricReader.`);return}if((e==null?void 0:e.timeoutMillis)==null){yield t.onForceFlush();return}yield Jo(t.onForceFlush(),e.timeoutMillis)})()}};function Ys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function J(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ys(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ys(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Y=n((()=>{d()}));B(),K(),d(),Y(),m();var Xs=class extends Js{constructor(e){var t,n;let{exporter:r,exportIntervalMillis:i=6e4,metricProducers:a,cardinalityLimits:o}=e,{exportTimeoutMillis:s=3e4}=e;if(super({aggregationSelector:(t=r.selectAggregation)==null?void 0:t.bind(r),aggregationTemporalitySelector:(n=r.selectAggregationTemporality)==null?void 0:n.bind(r),metricProducers:a,cardinalitySelector:e=>{let t=J({default:2e3},o);switch(e){case q.COUNTER:var n;return(n=t.counter)==null?t.default:n;case q.GAUGE:var r;return(r=t.gauge)==null?t.default:r;case q.HISTOGRAM:var i;return(i=t.histogram)==null?t.default:i;case q.OBSERVABLE_COUNTER:var a;return(a=t.observableCounter)==null?t.default:a;case q.OBSERVABLE_UP_DOWN_COUNTER:var s;return(s=t.observableUpDownCounter)==null?t.default:s;case q.OBSERVABLE_GAUGE:var c;return(c=t.observableGauge)==null?t.default:c;case q.UP_DOWN_COUNTER:var l;return(l=t.upDownCounter)==null?t.default:l;default:return t.default}}}),u(this,`_interval`,void 0),u(this,`_exporter`,void 0),u(this,`_exportInterval`,void 0),u(this,`_exportTimeout`,void 0),i<=0)throw Error(`exportIntervalMillis must be greater than 0`);if(s<=0)throw Error(`exportTimeoutMillis must be greater than 0`);if(i<s){if(`exportIntervalMillis`in e&&`exportTimeoutMillis`in e)throw Error(`exportIntervalMillis must be greater than or equal to exportTimeoutMillis`);R.info(`Timeout of ${s} exceeds the interval of ${i}. Clamping timeout to interval duration.`),s=i}this._exportInterval=i,this._exportTimeout=s,this._exporter=r}_runOnce(){var e=this;return p(function*(){try{yield Jo(e._doRun(),e._exportTimeout)}catch(t){if(t instanceof qo){R.error(`Export took longer than %s milliseconds and timed out.`,e._exportTimeout);return}Ci(t)}})()}_doRun(){var e=this;return p(function*(){let{resourceMetrics:t,errors:n}=yield e.collect({timeoutMillis:e._exportTimeout});if(n.length>0&&R.error(`PeriodicExportingMetricReader: metrics collection errors`,...n),t.resource.asyncAttributesPending)try{var r,i;yield(r=(i=t.resource).waitForAsyncAttributes)==null?void 0:r.call(i)}catch(e){R.debug(`Error while resolving async portion of resource: `,e),Ci(e)}if(t.scopeMetrics.length===0)return;let a=yield ko._export(e._exporter,t);if(a.code!==_a.SUCCESS)throw Error(`PeriodicExportingMetricReader: metrics export failed (error ${a.error})`)})()}onInitialized(){this._interval=setInterval(()=>{this._runOnce()},this._exportInterval),typeof this._interval!=`number`&&this._interval.unref()}onForceFlush(){var e=this;return p(function*(){yield e._runOnce(),yield e._exporter.forceFlush()})()}onShutdown(){var e=this;return p(function*(){e._interval&&clearInterval(e._interval),yield e.onForceFlush(),yield e._exporter.shutdown()})()}};function Zs(){if(Qs===void 0)try{let e=globalThis.process.argv0;Qs=e?`unknown_service:${e}`:`unknown_service`}catch(e){Qs=`unknown_service`}return Qs}var Qs,$s=n((()=>{})),ec,tc=n((()=>{ec=e=>typeof e==`object`&&!!e&&typeof e.then==`function`}));function nc(e,t){return sc.FromAttributeList(Object.entries(e),t)}function rc(){return nc({[Hi]:Zs(),[Ui]:ta[Ui],[Gi]:ta[Gi],[Ki]:ta[Ki]})}function ic(e){return e.map(([e,t])=>ec(t)?[e,t.catch(t=>{R.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function ac(e){if(typeof e==`string`||e===void 0)return e;R.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function oc(e,t){let n=e==null?void 0:e.schemaUrl,r=t==null?void 0:t.schemaUrl,i=n===void 0||n===``,a=r===void 0||r===``;if(i)return r;if(a||n===r)return n;R.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,n,r)}var sc,cc=n((()=>{B(),K(),Qi(),$s(),tc(),d(),m(),sc=class e{static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=ic(t),r._asyncAttributesPending=t.filter(([e,t])=>ec(t)).length>0,r}constructor(e,t){var n;u(this,`_rawAttributes`,void 0),u(this,`_asyncAttributesPending`,!1),u(this,`_schemaUrl`,void 0),u(this,`_memoizedAttributes`,void 0);let r=(n=e.attributes)==null?{}:n;this._rawAttributes=Object.entries(r).map(([e,t])=>(ec(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=ic(this._rawAttributes),this._schemaUrl=ac(t==null?void 0:t.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}waitForAsyncAttributes(){var e=this;return p(function*(){if(e.asyncAttributesPending){for(let t=0;t<e._rawAttributes.length;t++){let[n,r]=e._rawAttributes[t];e._rawAttributes[t]=[n,ec(r)?yield r:r]}e._asyncAttributesPending=!1}})()}get attributes(){if(this.asyncAttributesPending&&R.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,n]of this._rawAttributes){if(ec(n)){R.debug(`Unsettled resource attribute ${t} skipped`);continue}n!=null&&(e[t]!=null||(e[t]=n))}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let n=oc(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}}})),lc=n((()=>{B(),cc(),Qi(),K(),d(),$s()}));d();var uc=class{constructor(){u(this,`_registeredViews`,[])}addView(e){this._registeredViews.push(e)}findViews(e,t){return this._registeredViews.filter(n=>this._matchInstrument(n.instrumentSelector,e)&&this._matchMeter(n.meterSelector,t))}_matchInstrument(e,t){return(e.getType()===void 0||t.type===e.getType())&&e.getNameFilter().match(t.name)&&e.getUnitFilter().match(t.unit)}_matchMeter(e,t){return e.getNameFilter().match(t.name)&&(t.version===void 0||e.getVersionFilter().match(t.version))&&(t.schemaUrl===void 0||e.getSchemaUrlFilter().match(t.schemaUrl))}};B();function dc(e,t,n){var r,i,a,o;return hc(e)||R.warn(`Invalid metric name: "${e}". The metric name should be a ASCII string with a length no greater than 255 characters.`),{name:e,type:t,description:(r=n==null?void 0:n.description)==null?``:r,unit:(i=n==null?void 0:n.unit)==null?``:i,valueType:(a=n==null?void 0:n.valueType)==null?Re.DOUBLE:a,advice:(o=n==null?void 0:n.advice)==null?{}:o}}function fc(e,t){var n,r;return{name:(n=e.name)==null?t.name:n,description:(r=e.description)==null?t.description:r,type:t.type,unit:t.unit,valueType:t.valueType,advice:t.advice}}function pc(e,t){return Zo(e.name,t.name)&&e.unit===t.unit&&e.type===t.type&&e.valueType===t.valueType}var mc=/^[a-z][a-z0-9_.\-/]{0,254}$/i;function hc(e){return mc.test(e)}B(),K(),d();var gc=class{constructor(e,t){u(this,`_writableMetricStorage`,void 0),u(this,`_descriptor`,void 0),this._writableMetricStorage=e,this._descriptor=t}_record(e,t={},n=L.active()){if(typeof e!=`number`){R.warn(`non-number value provided to metric ${this._descriptor.name}: ${e}`);return}this._descriptor.valueType===Re.INT&&!Number.isInteger(e)&&(R.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._writableMetricStorage.record(e,t,n,ia(Date.now()))}},_c=class extends gc{add(e,t,n){this._record(e,t,n)}},vc=class extends gc{add(e,t,n){if(e<0){R.warn(`negative value provided to counter ${this._descriptor.name}: ${e}`);return}this._record(e,t,n)}},yc=class extends gc{record(e,t,n){this._record(e,t,n)}},bc=class extends gc{record(e,t,n){if(e<0){R.warn(`negative value provided to histogram ${this._descriptor.name}: ${e}`);return}this._record(e,t,n)}},xc=class{constructor(e,t,n){u(this,`_metricStorages`,void 0),u(this,`_descriptor`,void 0),u(this,`_observableRegistry`,void 0),this._descriptor=e,this._metricStorages=t,this._observableRegistry=n}addCallback(e){this._observableRegistry.addCallback(e,this)}removeCallback(e){this._observableRegistry.removeCallback(e,this)}},Sc=class extends xc{},Cc=class extends xc{},wc=class extends xc{};function Tc(e){return e instanceof xc}d();var Ec=class{constructor(e){u(this,`_meterSharedState`,void 0),this._meterSharedState=e}createGauge(e,t){let n=dc(e,q.GAUGE,t);return new yc(this._meterSharedState.registerMetricStorage(n),n)}createHistogram(e,t){let n=dc(e,q.HISTOGRAM,t);return new bc(this._meterSharedState.registerMetricStorage(n),n)}createCounter(e,t){let n=dc(e,q.COUNTER,t);return new vc(this._meterSharedState.registerMetricStorage(n),n)}createUpDownCounter(e,t){let n=dc(e,q.UP_DOWN_COUNTER,t);return new _c(this._meterSharedState.registerMetricStorage(n),n)}createObservableGauge(e,t){let n=dc(e,q.OBSERVABLE_GAUGE,t);return new Cc(n,this._meterSharedState.registerAsyncMetricStorage(n),this._meterSharedState.observableRegistry)}createObservableCounter(e,t){let n=dc(e,q.OBSERVABLE_COUNTER,t);return new Sc(n,this._meterSharedState.registerAsyncMetricStorage(n),this._meterSharedState.observableRegistry)}createObservableUpDownCounter(e,t){let n=dc(e,q.OBSERVABLE_UP_DOWN_COUNTER,t);return new wc(n,this._meterSharedState.registerAsyncMetricStorage(n),this._meterSharedState.observableRegistry)}addBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.addBatchCallback(e,t)}removeBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.removeBatchCallback(e,t)}};d();var Dc=class{constructor(e){u(this,`_instrumentDescriptor`,void 0),this._instrumentDescriptor=e}getInstrumentDescriptor(){return this._instrumentDescriptor}updateDescription(e){this._instrumentDescriptor=dc(this._instrumentDescriptor.name,this._instrumentDescriptor.type,{description:e,valueType:this._instrumentDescriptor.valueType,unit:this._instrumentDescriptor.unit,advice:this._instrumentDescriptor.advice})}};d();var Oc=class{constructor(e){u(this,`_valueMap`,new Map),u(this,`_keyMap`,new Map),u(this,`_hash`,void 0),this._hash=e}get(e,t){return t!=null||(t=this._hash(e)),this._valueMap.get(t)}getOrDefault(e,t){let n=this._hash(e);if(this._valueMap.has(n))return this._valueMap.get(n);let r=t();return this._keyMap.has(n)||this._keyMap.set(n,e),this._valueMap.set(n,r),r}set(e,t,n){n!=null||(n=this._hash(e)),this._keyMap.has(n)||this._keyMap.set(n,e),this._valueMap.set(n,t)}has(e,t){return t!=null||(t=this._hash(e)),this._valueMap.has(t)}*keys(){let e=this._keyMap.entries(),t=e.next();for(;t.done!==!0;)yield[t.value[1],t.value[0]],t=e.next()}*entries(){let e=this._valueMap.entries(),t=e.next();for(;t.done!==!0;)yield[this._keyMap.get(t.value[0]),t.value[1],t.value[0]],t=e.next()}get size(){return this._valueMap.size}},kc=class extends Oc{constructor(){super(Go)}};d();var Ac=class{constructor(e,t){u(this,`_activeCollectionStorage`,new kc),u(this,`_cumulativeMemoStorage`,new kc),u(this,`_cardinalityLimit`,void 0),u(this,`_overflowAttributes`,{"otel.metric.overflow":!0}),u(this,`_overflowHashCode`,void 0),u(this,`_aggregator`,void 0),this._aggregator=e,this._cardinalityLimit=(t==null?2e3:t)-1,this._overflowHashCode=Go(this._overflowAttributes)}record(e,t,n,r){let i=this._activeCollectionStorage.get(t);if(!i){if(this._activeCollectionStorage.size>=this._cardinalityLimit){let t=this._activeCollectionStorage.getOrDefault(this._overflowAttributes,()=>this._aggregator.createAccumulation(r));t==null||t.record(e);return}i=this._aggregator.createAccumulation(r),this._activeCollectionStorage.set(t,i)}i==null||i.record(e)}batchCumulate(e,t){for(let[n,r,i]of e.entries()){let e=n,a=i,o=this._aggregator.createAccumulation(t);o==null||o.record(r);let s=o;if(this._cumulativeMemoStorage.has(e,a)){let t=this._cumulativeMemoStorage.get(e,a);s=this._aggregator.diff(t,o)}else if(this._cumulativeMemoStorage.size>=this._cardinalityLimit&&(e=this._overflowAttributes,a=this._overflowHashCode,this._cumulativeMemoStorage.has(e,a))){let t=this._cumulativeMemoStorage.get(e,a);s=this._aggregator.diff(t,o)}if(this._activeCollectionStorage.has(e,a)){let t=this._activeCollectionStorage.get(e,a);s=this._aggregator.merge(t,s)}this._cumulativeMemoStorage.set(e,o,a),this._activeCollectionStorage.set(e,s,a)}}collect(){let e=this._activeCollectionStorage;return this._activeCollectionStorage=new kc,e}};d();var jc=class e{constructor(e,t){u(this,`_aggregator`,void 0),u(this,`_unreportedAccumulations`,new Map),u(this,`_reportHistory`,new Map),this._aggregator=e,t.forEach(e=>{this._unreportedAccumulations.set(e,[])})}buildMetrics(t,n,r,i){this._stashAccumulations(r);let a=this._getMergedUnreportedAccumulations(t),o=a,s;if(this._reportHistory.has(t)){let n=this._reportHistory.get(t),r=n.collectionTime;s=n.aggregationTemporality,o=s===Uo.CUMULATIVE?e.merge(n.accumulations,a,this._aggregator):e.calibrateStartTime(n.accumulations,a,r)}else s=t.selectAggregationTemporality(n.type);this._reportHistory.set(t,{accumulations:o,collectionTime:i,aggregationTemporality:s});let c=Mc(o);if(c.length!==0)return this._aggregator.toMetricData(n,s,c,i)}_stashAccumulations(e){let t=this._unreportedAccumulations.keys();for(let n of t){let t=this._unreportedAccumulations.get(n);t===void 0&&(t=[],this._unreportedAccumulations.set(n,t)),t.push(e)}}_getMergedUnreportedAccumulations(t){let n=new kc,r=this._unreportedAccumulations.get(t);if(this._unreportedAccumulations.set(t,[]),r===void 0)return n;for(let t of r)n=e.merge(n,t,this._aggregator);return n}static merge(e,t,n){let r=e,i=t.entries(),a=i.next();for(;a.done!==!0;){let[t,o,s]=a.value;if(e.has(t,s)){let i=e.get(t,s),a=n.merge(i,o);r.set(t,a,s)}else r.set(t,o,s);a=i.next()}return r}static calibrateStartTime(e,t,n){for(let[r,i]of e.keys()){let e=t.get(r,i);e==null||e.setStartTime(n)}return t}};function Mc(e){return Array.from(e.entries())}d();var Nc=class extends Dc{constructor(e,t,n,r,i){super(e),u(this,`_aggregationCardinalityLimit`,void 0),u(this,`_deltaMetricStorage`,void 0),u(this,`_temporalMetricStorage`,void 0),u(this,`_attributesProcessor`,void 0),this._aggregationCardinalityLimit=i,this._deltaMetricStorage=new Ac(t,this._aggregationCardinalityLimit),this._temporalMetricStorage=new jc(t,r),this._attributesProcessor=n}record(e,t){let n=new kc;for(let[t,r]of e.entries())n.set(this._attributesProcessor.process(t),r);this._deltaMetricStorage.batchCumulate(n,t)}collect(e,t){let n=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,n,t)}};function Pc(e,t){let n=``;return e.unit!==t.unit&&(n+=`\t- Unit '${e.unit}' does not match '${t.unit}'\n`),e.type!==t.type&&(n+=`\t- Type '${e.type}' does not match '${t.type}'\n`),e.valueType!==t.valueType&&(n+=`\t- Value Type '${e.valueType}' does not match '${t.valueType}'\n`),e.description!==t.description&&(n+=`\t- Description '${e.description}' does not match '${t.description}'\n`),n}function Fc(e,t){return`\t- use valueType '${e.valueType}' on instrument creation or use an instrument name other than '${t.name}'`}function Ic(e,t){return`\t- use unit '${e.unit}' on instrument creation or use an instrument name other than '${t.name}'`}function Lc(e,t){let n={name:t.name,type:t.type,unit:t.unit},r=JSON.stringify(n);return`\t- create a new view with a name other than '${e.name}' and InstrumentSelector '${r}'`}function Rc(e,t){let n={name:t.name,type:t.type,unit:t.unit},r=JSON.stringify(n);return`\t- create a new view with a name other than '${e.name}' and InstrumentSelector '${r}'
1
+ var BkOpenTelemetry=(function(){var e=Object.defineProperty,t=(e,t)=>()=>(e&&(t=e(e=0)),t),n=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},r,i=t((()=>{r=`1.9.1`}));function a(e){let t=new Set([e]),n=new Set,r=e.match(o);if(!r)return()=>!1;let i={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(i.prerelease!=null)return function(t){return t===e};function a(e){return n.add(e),!1}function s(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;let r=e.match(o);if(!r)return a(e);let c={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};return c.prerelease!=null||i.major!==c.major?a(e):i.major===0?i.minor===c.minor&&i.patch<=c.patch?s(e):a(e):i.minor<=c.minor?s(e):a(e)}}var o,s,c=t((()=>{i(),o=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,s=a(r)}));function l(e,t,n,i=!1){var a;let o=m[p]=(a=m[p])==null?{version:r}:a;if(!i&&o[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(t.stack||t.message),!1}if(o.version!==`1.9.1`){let t=Error(`@opentelemetry/api: Registration of version v${o.version} for ${e} does not match previously registered API v${r}`);return n.error(t.stack||t.message),!1}return o[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${r}.`),!0}function u(e){var t,n;let r=(t=m[p])==null?void 0:t.version;if(!(!r||!s(r)))return(n=m[p])==null?void 0:n[e]}function d(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${r}.`);let n=m[p];n&&delete n[e]}var f,p,m,h=t((()=>{i(),c(),f=r.split(`.`)[0],p=Symbol.for(`opentelemetry.js.api.${f}`),m=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{}}));function g(e,t,n){let r=u(`diag`);if(r)return r[e](t,...n)}var _,v=t((()=>{h(),_=class{constructor(e){this._namespace=e.namespace||`DiagComponentLogger`}debug(...e){return g(`debug`,this._namespace,e)}error(...e){return g(`error`,this._namespace,e)}info(...e){return g(`info`,this._namespace,e)}warn(...e){return g(`warn`,this._namespace,e)}verbose(...e){return g(`verbose`,this._namespace,e)}}})),y,b=t((()=>{(function(e){e[e.NONE=0]=`NONE`,e[e.ERROR=30]=`ERROR`,e[e.WARN=50]=`WARN`,e[e.INFO=60]=`INFO`,e[e.DEBUG=70]=`DEBUG`,e[e.VERBOSE=80]=`VERBOSE`,e[e.ALL=9999]=`ALL`})(y||(y={}))}));function x(e,t){e<y.NONE?e=y.NONE:e>y.ALL&&(e=y.ALL),t=t||{};function n(n,r){let i=t[n];return typeof i==`function`&&e>=r?i.bind(t):function(){}}return{error:n(`error`,y.ERROR),warn:n(`warn`,y.WARN),info:n(`info`,y.INFO),debug:n(`debug`,y.DEBUG),verbose:n(`verbose`,y.VERBOSE)}}var S=t((()=>{b()})),C,w,T=t((()=>{v(),S(),b(),h(),C=`diag`,w=class e{static instance(){return this._instance||(this._instance=new e),this._instance}constructor(){function e(e){return function(...t){let n=u(`diag`);if(n)return n[e](...t)}}let t=this;t.setLogger=(e,n={logLevel:y.INFO})=>{var r,i,a;if(e===t){let e=Error(`Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation`);return t.error((r=e.stack)==null?e.message:r),!1}typeof n==`number`&&(n={logLevel:n});let o=u(`diag`),s=x((i=n.logLevel)==null?y.INFO:i,e);if(o&&!n.suppressOverrideMessage){let e=(a=Error().stack)==null?`<failed to generate stacktrace>`:a;o.warn(`Current logger will be overwritten from ${e}`),s.warn(`Current logger will overwrite one already registered from ${e}`)}return l(`diag`,s,t,!0)},t.disable=()=>{d(C,t)},t.createComponentLogger=e=>new _(e),t.verbose=e(`verbose`),t.debug=e(`debug`),t.info=e(`info`),t.warn=e(`warn`),t.error=e(`error`)}}})),E,D=t((()=>{E=class e{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let t=this._entries.get(e);if(t)return Object.assign({},t)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(t,n){let r=new e(this._entries);return r._entries.set(t,n),r}removeEntry(t){let n=new e(this._entries);return n._entries.delete(t),n}removeEntries(...t){let n=new e(this._entries);for(let e of t)n._entries.delete(e);return n}clear(){return new e}}})),ee,te=t((()=>{ee=Symbol(`BaggageEntryMetadata`)}));function O(e={}){return new E(new Map(Object.entries(e)))}function k(e){return typeof e!=`string`&&(ne.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=``),{__TYPE__:ee,toString(){return e}}}var ne,A=t((()=>{T(),D(),te(),ne=w.instance()}));function re(e){return Symbol.for(e)}var ie,j,ae=t((()=>{ie=class e{constructor(t){let n=this;n._currentContext=t?new Map(t):new Map,n.getValue=e=>n._currentContext.get(e),n.setValue=(t,r)=>{let i=new e(n._currentContext);return i._currentContext.set(t,r),i},n.deleteValue=t=>{let r=new e(n._currentContext);return r._currentContext.delete(t),r}}},j=new ie}));function oe(){return _e}var se,ce,le,ue,de,fe,pe,me,he,ge,_e,ve,ye,be,xe,Se,Ce,we,Te=t((()=>{se=class{constructor(){}createGauge(e,t){return ye}createHistogram(e,t){return be}createCounter(e,t){return ve}createUpDownCounter(e,t){return xe}createObservableGauge(e,t){return Ce}createObservableCounter(e,t){return Se}createObservableUpDownCounter(e,t){return we}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},ce=class{},le=class extends ce{add(e,t){}},ue=class extends ce{add(e,t){}},de=class extends ce{record(e,t){}},fe=class extends ce{record(e,t){}},pe=class{addCallback(e){}removeCallback(e){}},me=class extends pe{},he=class extends pe{},ge=class extends pe{},_e=new se,ve=new le,ye=new de,be=new fe,xe=new ue,Se=new me,Ce=new he,we=new ge})),Ee,De=t((()=>{(function(e){e[e.INT=0]=`INT`,e[e.DOUBLE=1]=`DOUBLE`})(Ee||(Ee={}))})),Oe,ke,Ae=t((()=>{Oe={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},ke={set(e,t,n){e!=null&&(e[t]=n)}}})),je,Me=t((()=>{ae(),je=class{active(){return j}with(e,t,n,...r){return t.call(n,...r)}bind(e,t){return t}enable(){return this}disable(){return this}}})),Ne,Pe,Fe,Ie=t((()=>{Me(),h(),T(),Ne=`context`,Pe=new je,Fe=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalContextManager(e){return l(Ne,e,w.instance())}active(){return this._getContextManager().active()}with(e,t,n,...r){return this._getContextManager().with(e,t,n,...r)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return u(Ne)||Pe}disable(){this._getContextManager().disable(),d(Ne,w.instance())}}})),M,Le=t((()=>{(function(e){e[e.NONE=0]=`NONE`,e[e.SAMPLED=1]=`SAMPLED`})(M||(M={}))})),Re,ze,Be,Ve=t((()=>{Le(),Re=`0000000000000000`,ze=`00000000000000000000000000000000`,Be={traceId:ze,spanId:Re,traceFlags:M.NONE}})),He,Ue=t((()=>{Ve(),He=class{constructor(e=Be){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}}}));function We(e){return e.getValue(Xe)||void 0}function Ge(){return We(Fe.getInstance().active())}function Ke(e,t){return e.setValue(Xe,t)}function qe(e){return e.deleteValue(Xe)}function Je(e,t){return Ke(e,new He(t))}function Ye(e){var t;return(t=We(e))==null?void 0:t.spanContext()}var Xe,Ze=t((()=>{ae(),Ue(),Ie(),Xe=re(`OpenTelemetry Context Key SPAN`)}));function Qe(e,t){if(typeof e!=`string`||e.length!==t)return!1;let n=0;for(let t=0;t<e.length;t+=4)n+=(rt[e.charCodeAt(t)]|0)+(rt[e.charCodeAt(t+1)]|0)+(rt[e.charCodeAt(t+2)]|0)+(rt[e.charCodeAt(t+3)]|0);return n===t}function $e(e){return Qe(e,32)&&e!==`00000000000000000000000000000000`}function et(e){return Qe(e,16)&&e!==`0000000000000000`}function tt(e){return $e(e.traceId)&&et(e.spanId)}function nt(e){return new He(e)}var rt,it=t((()=>{Ve(),Ue(),rt=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1])}));function at(e){return typeof e==`object`&&!!e&&`spanId`in e&&typeof e.spanId==`string`&&`traceId`in e&&typeof e.traceId==`string`&&`traceFlags`in e&&typeof e.traceFlags==`number`}var ot,st,ct=t((()=>{Ie(),Ze(),Ue(),it(),ot=Fe.getInstance(),st=class{startSpan(e,t,n=ot.active()){if(t!=null&&t.root)return new He;let r=n&&Ye(n);return at(r)&&tt(r)?new He(r):new He}startActiveSpan(e,t,n,r){let i,a,o;if(arguments.length<2)return;arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);let s=a==null?ot.active():a,c=this.startSpan(e,i,s),l=Ke(s,c);return ot.with(l,o,void 0,c)}}})),lt,ut,dt=t((()=>{ct(),lt=new st,ut=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}startSpan(e,t,n){return this._getTracer().startSpan(e,t,n)}startActiveSpan(e,t,n,r){let i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):lt}}})),ft,pt=t((()=>{ct(),ft=class{getTracer(e,t,n){return new st}}})),mt,ht,gt=t((()=>{dt(),pt(),mt=new ft,ht=class{getTracer(e,t,n){var r;return(r=this.getDelegateTracer(e,t,n))==null?new ut(this,e,t,n):r}getDelegate(){var e;return(e=this._delegate)==null?mt:e}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,n){var r;return(r=this._delegate)==null?void 0:r.getTracer(e,t,n)}}})),_t,vt=t((()=>{(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(_t||(_t={}))})),yt,bt=t((()=>{(function(e){e[e.INTERNAL=0]=`INTERNAL`,e[e.SERVER=1]=`SERVER`,e[e.CLIENT=2]=`CLIENT`,e[e.PRODUCER=3]=`PRODUCER`,e[e.CONSUMER=4]=`CONSUMER`})(yt||(yt={}))})),xt,St=t((()=>{(function(e){e[e.UNSET=0]=`UNSET`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`})(xt||(xt={}))})),N,Ct=t((()=>{Ie(),N=Fe.getInstance()})),P,wt=t((()=>{T(),P=w.instance()})),Tt,Et,Dt=t((()=>{Te(),Tt=class{getMeter(e,t,n){return _e}},Et=new Tt})),Ot,kt,At=t((()=>{Dt(),h(),T(),Ot=`metrics`,kt=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalMeterProvider(e){return l(Ot,e,w.instance())}getMeterProvider(){return u(Ot)||Et}getMeter(e,t,n){return this.getMeterProvider().getMeter(e,t,n)}disable(){d(Ot,w.instance())}}})),jt,Mt=t((()=>{At(),jt=kt.getInstance()})),Nt,Pt=t((()=>{Nt=class{inject(e,t){}extract(e,t){return e}fields(){return[]}}}));function Ft(e){return e.getValue(zt)||void 0}function It(){return Ft(Fe.getInstance().active())}function Lt(e,t){return e.setValue(zt,t)}function Rt(e){return e.deleteValue(zt)}var zt,Bt=t((()=>{Ie(),ae(),zt=re(`OpenTelemetry Baggage Key`)})),Vt,Ht,Ut,Wt=t((()=>{h(),Pt(),Ae(),Bt(),A(),T(),Vt=`propagation`,Ht=new Nt,Ut=class e{constructor(){this.createBaggage=O,this.getBaggage=Ft,this.getActiveBaggage=It,this.setBaggage=Lt,this.deleteBaggage=Rt}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalPropagator(e){return l(Vt,e,w.instance())}inject(e,t,n=ke){return this._getGlobalPropagator().inject(e,t,n)}extract(e,t,n=Oe){return this._getGlobalPropagator().extract(e,t,n)}fields(){return this._getGlobalPropagator().fields()}disable(){d(Vt,w.instance())}_getGlobalPropagator(){return u(Vt)||Ht}}})),Gt,Kt=t((()=>{Wt(),Gt=Ut.getInstance()})),qt,Jt,Yt=t((()=>{h(),gt(),it(),Ze(),T(),qt=`trace`,Jt=class e{constructor(){this._proxyTracerProvider=new ht,this.wrapSpanContext=nt,this.isSpanContextValid=tt,this.deleteSpan=qe,this.getSpan=We,this.getActiveSpan=Ge,this.getSpanContext=Ye,this.setSpan=Ke,this.setSpanContext=Je}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalTracerProvider(e){let t=l(qt,this._proxyTracerProvider,w.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return u(qt)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){d(qt,w.instance()),this._proxyTracerProvider=new ht}}})),F,Xt=t((()=>{Yt(),F=Jt.getInstance()})),I=t((()=>{A(),ae(),b(),Te(),De(),Ae(),dt(),gt(),vt(),bt(),St(),Le(),it(),Ve(),Ct(),wt(),Mt(),Kt(),Xt()})),L,Zt=t((()=>{(function(e){e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.TRACE=1]=`TRACE`,e[e.TRACE2=2]=`TRACE2`,e[e.TRACE3=3]=`TRACE3`,e[e.TRACE4=4]=`TRACE4`,e[e.DEBUG=5]=`DEBUG`,e[e.DEBUG2=6]=`DEBUG2`,e[e.DEBUG3=7]=`DEBUG3`,e[e.DEBUG4=8]=`DEBUG4`,e[e.INFO=9]=`INFO`,e[e.INFO2=10]=`INFO2`,e[e.INFO3=11]=`INFO3`,e[e.INFO4=12]=`INFO4`,e[e.WARN=13]=`WARN`,e[e.WARN2=14]=`WARN2`,e[e.WARN3=15]=`WARN3`,e[e.WARN4=16]=`WARN4`,e[e.ERROR=17]=`ERROR`,e[e.ERROR2=18]=`ERROR2`,e[e.ERROR3=19]=`ERROR3`,e[e.ERROR4=20]=`ERROR4`,e[e.FATAL=21]=`FATAL`,e[e.FATAL2=22]=`FATAL2`,e[e.FATAL3=23]=`FATAL3`,e[e.FATAL4=24]=`FATAL4`})(L||(L={}))})),Qt,$t,en=t((()=>{Qt=class{emit(e){}enabled(){return!1}},$t=new Qt}));function tn(e,t,n){return r=>r===e?t:n}var nn,rn,an=t((()=>{nn=Symbol.for(`io.opentelemetry.js.api.logs`),rn=globalThis})),on,sn,cn=t((()=>{en(),on=class{getLogger(e,t,n){return new Qt}},sn=new on})),ln,un=t((()=>{en(),ln=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):$t}}})),dn,fn=t((()=>{cn(),un(),dn=class{getLogger(e,t,n){var r;return(r=this._getDelegateLogger(e,t,n))==null?new ln(this,e,t,n):r}_getDelegate(){var e;return(e=this._delegate)==null?sn:e}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){var r;return(r=this._delegate)==null?void 0:r.getLogger(e,t,n)}}})),pn,mn=t((()=>{an(),cn(),fn(),pn=class e{constructor(){this._proxyLoggerProvider=new dn}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(e){return rn[nn]?this.getLoggerProvider():(rn[nn]=tn(1,e,sn),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,t;return(t=(e=rn[nn])==null?void 0:e.call(rn,1))==null?this._proxyLoggerProvider:t}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete rn[nn],this._proxyLoggerProvider=new dn}}})),hn,gn=t((()=>{Zt(),en(),mn(),hn=pn.getInstance()}));function _n(e){return typeof e==`object`&&!!e&&`addEventListener`in e&&typeof e.addEventListener==`function`&&`removeEventListener`in e&&typeof e.removeEventListener==`function`}function vn(e){"@babel/helpers - typeof";return vn=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},vn(e)}var yn=t((()=>{}));function bn(e,t){if(vn(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(vn(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var xn=t((()=>{yn()}));function Sn(e){var t=bn(e,`string`);return vn(t)==`symbol`?t:t+``}var Cn=t((()=>{yn(),xn()}));function R(e,t,n){return(t=Sn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var z=t((()=>{Cn()}));I(),z();var wn=`OT_ZONE_CONTEXT`,Tn=class{constructor(){R(this,`_enabled`,!1)}_bindFunction(e,t){let n=this,r=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(r,`length`,{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}_bindListener(e,t){let n=t;return n.__ot_listeners===void 0?(n.__ot_listeners={},typeof n.addEventListener==`function`&&(n.addEventListener=this._patchAddEventListener(n,n.addEventListener,e)),typeof n.removeEventListener==`function`&&(n.removeEventListener=this._patchRemoveEventListener(n,n.removeEventListener)),t):t}_createZone(e,t){return Zone.current.fork({name:e,properties:{[wn]:t},onCancelTask(e,t,n,r){return r.state===`notScheduled`||r.state===`running`?r:e.cancelTask(n,r)}})}_patchAddEventListener(e,t,n){let r=this;return function(i,a,o){e.__ot_listeners===void 0&&(e.__ot_listeners={});let s=e.__ot_listeners[i];s===void 0&&(s=new WeakMap,e.__ot_listeners[i]=s);let c=r.bind(n,a);return s.set(a,c),t.call(this,i,c,o)}}_patchRemoveEventListener(e,t){return function(n,r){if(e.__ot_listeners===void 0||e.__ot_listeners[n]===void 0)return t.call(this,n,r);let i=e.__ot_listeners[n],a=i.get(r);return i.delete(r),t.call(this,n,a||r)}}active(){return!this._enabled||!Zone.current?j:Zone.current.get(wn)||j}bind(e,t){return typeof t==`function`?this._bindFunction(e,t):(_n(t)&&this._bindListener(e,t),t)}disable(){return this._enabled=!1,this}enable(){return this._enabled=!0,this}with(e,t,n,...r){let i=`otel:with`;return t.name&&(i+=`:${t.name}`),this._createZone(i,e).run(t,n,r)}};gn();var En=Object.defineProperty,Dn=Object.defineProperties,On=Object.getOwnPropertyDescriptors,kn=Object.getOwnPropertySymbols,An=Object.prototype.hasOwnProperty,jn=Object.prototype.propertyIsEnumerable,Mn=(e,t,n)=>t in e?En(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Nn=(e,t)=>{for(var n in t||(t={}))An.call(t,n)&&Mn(e,n,t[n]);if(kn)for(var n of kn(t))jn.call(t,n)&&Mn(e,n,t[n]);return e},Pn=(e,t)=>Dn(e,On(t)),B=(e,t,n)=>(Mn(e,typeof t==`symbol`?t:t+``,n),n),Fn=globalThis;function In(e){return(Fn.__Zone_symbol_prefix||`__zone_symbol__`)+e}function Ln(){let e=Fn.performance;function t(t){e&&e.mark&&e.mark(t)}function n(t,n){e&&e.measure&&e.measure(t,n)}t(`Zone`);let r=class e{constructor(e,t){B(this,`_parent`),B(this,`_name`),B(this,`_properties`),B(this,`_zoneDelegate`),this._parent=e,this._name=t?t.name||`unnamed`:`<root>`,this._properties=t&&t.properties||{},this._zoneDelegate=new o(this,this._parent&&this._parent._zoneDelegate,t)}static assertZonePatched(){if(Fn.Promise!==ee.ZoneAwarePromise)throw Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}static get root(){let t=e.current;for(;t.parent;)t=t.parent;return t}static get current(){return O.zone}static get currentTask(){return k}static __load_patch(r,i,a=!1){if(ee.hasOwnProperty(r)){let e=Fn[In(`forceDuplicateZoneCheck`)]===!0;if(!a&&e)throw Error(`Already loaded patch: `+r)}else if(!Fn[`__Zone_disable_`+r]){let a=`Zone:`+r;t(a),ee[r]=i(Fn,e,te),n(a,a)}}get parent(){return this._parent}get name(){return this._name}get(e){let t=this.getZoneWith(e);if(t)return t._properties[e]}getZoneWith(e){let t=this;for(;t;){if(t._properties.hasOwnProperty(e))return t;t=t._parent}return null}fork(e){if(!e)throw Error(`ZoneSpec required!`);return this._zoneDelegate.fork(this,e)}wrap(e,t){if(typeof e!=`function`)throw Error(`Expecting function got: `+e);let n=this._zoneDelegate.intercept(this,e,t),r=this;return function(){return r.runGuarded(n,this,arguments,t)}}run(e,t,n,r){O={parent:O,zone:this};try{return this._zoneDelegate.invoke(this,e,t,n,r)}finally{O=O.parent}}runGuarded(e,t=null,n,r){O={parent:O,zone:this};try{try{return this._zoneDelegate.invoke(this,e,t,n,r)}catch(e){if(this._zoneDelegate.handleError(this,e))throw e}}finally{O=O.parent}}runTask(e,t,n){if(e.zone!=this)throw Error(`A task can only be run in the zone of creation! (Creation: `+(e.zone||v).name+`; Execution: `+this.name+`)`);let r=e,{type:i,data:{isPeriodic:a=!1,isRefreshable:o=!1}={}}=e;if(e.state===y&&(i===D||i===E))return;let s=e.state!=S;s&&r._transitionTo(S,x);let c=k;k=r,O={parent:O,zone:this};try{i==E&&e.data&&!a&&!o&&(e.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,r,t,n)}catch(e){if(this._zoneDelegate.handleError(this,e))throw e}}finally{let t=e.state;if(t!==y&&t!==w)if(i==D||a||o&&t===b)s&&r._transitionTo(x,S,b);else{let e=r._zoneDelegates;this._updateTaskCount(r,-1),s&&r._transitionTo(y,S,y),o&&(r._zoneDelegates=e)}O=O.parent,k=c}}scheduleTask(e){if(e.zone&&e.zone!==this){let t=this;for(;t;){if(t===e.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${e.zone.name}`);t=t.parent}}e._transitionTo(b,y);let t=[];e._zoneDelegates=t,e._zone=this;try{e=this._zoneDelegate.scheduleTask(this,e)}catch(t){throw e._transitionTo(w,b,y),this._zoneDelegate.handleError(this,t),t}return e._zoneDelegates===t&&this._updateTaskCount(e,1),e.state==b&&e._transitionTo(x,b),e}scheduleMicroTask(e,t,n,r){return this.scheduleTask(new s(T,e,t,n,r,void 0))}scheduleMacroTask(e,t,n,r,i){return this.scheduleTask(new s(E,e,t,n,r,i))}scheduleEventTask(e,t,n,r,i){return this.scheduleTask(new s(D,e,t,n,r,i))}cancelTask(e){if(e.zone!=this)throw Error(`A task can only be cancelled in the zone of creation! (Creation: `+(e.zone||v).name+`; Execution: `+this.name+`)`);if(!(e.state!==x&&e.state!==S)){e._transitionTo(C,x,S);try{this._zoneDelegate.cancelTask(this,e)}catch(t){throw e._transitionTo(w,C),this._zoneDelegate.handleError(this,t),t}return this._updateTaskCount(e,-1),e._transitionTo(y,C),e.runCount=-1,e}}_updateTaskCount(e,t){let n=e._zoneDelegates;t==-1&&(e._zoneDelegates=null);for(let r=0;r<n.length;r++)n[r]._updateTaskCount(e.type,t)}};B(r,`__symbol__`,In);let i=r,a={name:``,onHasTask:(e,t,n,r)=>e.hasTask(n,r),onScheduleTask:(e,t,n,r)=>e.scheduleTask(n,r),onInvokeTask:(e,t,n,r,i,a)=>e.invokeTask(n,r,i,a),onCancelTask:(e,t,n,r)=>e.cancelTask(n,r)};class o{constructor(e,t,n){B(this,`_zone`),B(this,`_taskCounts`,{microTask:0,macroTask:0,eventTask:0}),B(this,`_forkDlgt`),B(this,`_forkZS`),B(this,`_forkCurrZone`),B(this,`_interceptDlgt`),B(this,`_interceptZS`),B(this,`_interceptCurrZone`),B(this,`_invokeDlgt`),B(this,`_invokeZS`),B(this,`_invokeCurrZone`),B(this,`_handleErrorDlgt`),B(this,`_handleErrorZS`),B(this,`_handleErrorCurrZone`),B(this,`_scheduleTaskDlgt`),B(this,`_scheduleTaskZS`),B(this,`_scheduleTaskCurrZone`),B(this,`_invokeTaskDlgt`),B(this,`_invokeTaskZS`),B(this,`_invokeTaskCurrZone`),B(this,`_cancelTaskDlgt`),B(this,`_cancelTaskZS`),B(this,`_cancelTaskCurrZone`),B(this,`_hasTaskDlgt`),B(this,`_hasTaskDlgtOwner`),B(this,`_hasTaskZS`),B(this,`_hasTaskCurrZone`),this._zone=e,this._forkZS=n&&(n&&n.onFork?n:t._forkZS),this._forkDlgt=n&&(n.onFork?t:t._forkDlgt),this._forkCurrZone=n&&(n.onFork?this._zone:t._forkCurrZone),this._interceptZS=n&&(n.onIntercept?n:t._interceptZS),this._interceptDlgt=n&&(n.onIntercept?t:t._interceptDlgt),this._interceptCurrZone=n&&(n.onIntercept?this._zone:t._interceptCurrZone),this._invokeZS=n&&(n.onInvoke?n:t._invokeZS),this._invokeDlgt=n&&(n.onInvoke?t:t._invokeDlgt),this._invokeCurrZone=n&&(n.onInvoke?this._zone:t._invokeCurrZone),this._handleErrorZS=n&&(n.onHandleError?n:t._handleErrorZS),this._handleErrorDlgt=n&&(n.onHandleError?t:t._handleErrorDlgt),this._handleErrorCurrZone=n&&(n.onHandleError?this._zone:t._handleErrorCurrZone),this._scheduleTaskZS=n&&(n.onScheduleTask?n:t._scheduleTaskZS),this._scheduleTaskDlgt=n&&(n.onScheduleTask?t:t._scheduleTaskDlgt),this._scheduleTaskCurrZone=n&&(n.onScheduleTask?this._zone:t._scheduleTaskCurrZone),this._invokeTaskZS=n&&(n.onInvokeTask?n:t._invokeTaskZS),this._invokeTaskDlgt=n&&(n.onInvokeTask?t:t._invokeTaskDlgt),this._invokeTaskCurrZone=n&&(n.onInvokeTask?this._zone:t._invokeTaskCurrZone),this._cancelTaskZS=n&&(n.onCancelTask?n:t._cancelTaskZS),this._cancelTaskDlgt=n&&(n.onCancelTask?t:t._cancelTaskDlgt),this._cancelTaskCurrZone=n&&(n.onCancelTask?this._zone:t._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;let r=n&&n.onHasTask,i=t&&t._hasTaskZS;(r||i)&&(this._hasTaskZS=r?n:a,this._hasTaskDlgt=t,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=this._zone,n.onScheduleTask||(this._scheduleTaskZS=a,this._scheduleTaskDlgt=t,this._scheduleTaskCurrZone=this._zone),n.onInvokeTask||(this._invokeTaskZS=a,this._invokeTaskDlgt=t,this._invokeTaskCurrZone=this._zone),n.onCancelTask||(this._cancelTaskZS=a,this._cancelTaskDlgt=t,this._cancelTaskCurrZone=this._zone))}get zone(){return this._zone}fork(e,t){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,e,t):new i(e,t)}intercept(e,t,n){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,e,t,n):t}invoke(e,t,n,r,i){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,e,t,n,r,i):t.apply(n,r)}handleError(e,t){return this._handleErrorZS?this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,e,t):!0}scheduleTask(e,t){let n=t;if(this._scheduleTaskZS)this._hasTaskZS&&n._zoneDelegates.push(this._hasTaskDlgtOwner),n=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,e,t),n||(n=t);else if(t.scheduleFn)t.scheduleFn(t);else if(t.type==T)g(t);else throw Error(`Task is missing scheduleFn.`);return n}invokeTask(e,t,n,r){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,e,t,n,r):t.callback.apply(n,r)}cancelTask(e,t){let n;if(this._cancelTaskZS)n=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,e,t);else{if(!t.cancelFn)throw Error(`Task is not cancelable`);n=t.cancelFn(t)}return n}hasTask(e,t){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,e,t)}catch(t){this.handleError(e,t)}}_updateTaskCount(e,t){let n=this._taskCounts,r=n[e],i=n[e]=r+t;if(i<0)throw Error(`More tasks executed then were scheduled.`);if(r==0||i==0){let t={microTask:n.microTask>0,macroTask:n.macroTask>0,eventTask:n.eventTask>0,change:e};this.hasTask(this._zone,t)}}}class s{constructor(e,t,n,r,i,a){if(B(this,`type`),B(this,`source`),B(this,`invoke`),B(this,`callback`),B(this,`data`),B(this,`scheduleFn`),B(this,`cancelFn`),B(this,`_zone`,null),B(this,`runCount`,0),B(this,`_zoneDelegates`,null),B(this,`_state`,`notScheduled`),this.type=e,this.source=t,this.data=r,this.scheduleFn=i,this.cancelFn=a,!n)throw Error(`callback is not defined`);this.callback=n;let o=this;e===D&&r&&r.useG?this.invoke=s.invokeTask:this.invoke=function(){return s.invokeTask.call(Fn,o,this,arguments)}}static invokeTask(e,t,n){e||(e=this),ne++;try{return e.runCount++,e.zone.runTask(e,t,n)}finally{ne===1&&!Fn[d]&&_(),ne--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(y,b)}_transitionTo(e,t,n){if(this._state===t||this._state===n)this._state=e,e==y&&(this._zoneDelegates=null);else throw Error(`${this.type} '${this.source}': can not transition to '${e}', expecting state '${t}'${n?` or '`+n+`'`:``}, was '${this._state}'.`)}toString(){return this.data&&this.data.handleId!==void 0?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}let c=In(`setTimeout`),l=In(`Promise`),u=In(`then`),d=In(`enable_native_microtask_draining`),f=[],p=!1,m;function h(e){var t;!m&&Fn[l]&&(m=Fn[l].resolve(0)),m?((t=m[u])==null?m.then:t).call(m,e):Fn[c](e,0)}function g(e){let t=Fn[d],n=t&&f.length===0&&!p,r=!t&&ne===0&&f.length===0;(n||r)&&h(_),e&&f.push(e)}function _(){if(!p){for(p=!0;f.length;){let e=f;f=[];for(let t of e)try{t.zone.runTask(t,null,null)}catch(e){te.onUnhandledError(e)}}Fn[d]?(p=!1,te.microtaskDrainDone()):(te.microtaskDrainDone(),p=!1)}}let v={name:`NO ZONE`},y=`notScheduled`,b=`scheduling`,x=`scheduled`,S=`running`,C=`canceling`,w=`unknown`,T=`microTask`,E=`macroTask`,D=`eventTask`,ee={},te={symbol:In,currentZoneFrame:()=>O,onUnhandledError:A,microtaskDrainDone:A,scheduleMicroTask:g,showUncaughtError:()=>!i[In(`ignoreConsoleErrorUncaughtError`)],patchEventTarget:()=>[],patchOnProperties:A,patchMethod:()=>A,bindArguments:()=>[],patchThen:()=>A,patchMacroTask:()=>A,patchEventPrototype:()=>A,getGlobalObjects:()=>void 0,ObjectDefineProperty:()=>A,ObjectGetOwnPropertyDescriptor:()=>void 0,ObjectCreate:()=>void 0,ArraySlice:()=>[],patchClass:()=>A,wrapWithCurrentZone:()=>A,filterProperties:()=>[],attachOriginToPatched:()=>A,_redefineProperty:()=>A,patchCallbacks:()=>A,nativeScheduleMicroTask:h},O={parent:null,zone:new i(null,null)},k=null,ne=0;function A(){}return n(`Zone`,`Zone`),i}function Rn(){let e=globalThis,t=e[In(`forceDuplicateZoneCheck`)]===!0;if(e.Zone&&(t||typeof e.Zone.__symbol__!=`function`))throw Error(`Zone already loaded.`);return e.Zone!=null||(e.Zone=Ln()),e.Zone}var zn=Object.getOwnPropertyDescriptor,Bn=Object.defineProperty,Vn=Object.getPrototypeOf,Hn=Object.create,Un=Array.prototype.slice,Wn=`addEventListener`,Gn=`removeEventListener`,Kn=In(Wn),qn=In(Gn),Jn=`true`,Yn=`false`,Xn=In(``);function Zn(e,t){return Zone.current.wrap(e,t)}function Qn(e,t,n,r,i){return Zone.current.scheduleMacroTask(e,t,n,r,i)}var V=In,$n=typeof window<`u`,er=$n?window:void 0,H=$n&&er||globalThis,tr=`removeAttribute`;function nr(e,t){for(let n=e.length-1;n>=0;n--)typeof e[n]==`function`&&(e[n]=Zn(e[n],t+`_`+n));return e}function rr(e,t){let n=e.constructor.name;for(let r=0;r<t.length;r++){let i=t[r],a=e[i];if(a){if(!ir(zn(e,i)))continue;e[i]=(e=>{let t=function(){return e.apply(this,nr(arguments,n+`.`+i))};return br(t,e),t})(a)}}}function ir(e){return e?e.writable===!1?!1:!(typeof e.get==`function`&&e.set===void 0):!0}var ar=typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope,or=!(`nw`in H)&&H.process!==void 0&&H.process.toString()===`[object process]`,sr=!or&&!ar&&!!($n&&er.HTMLElement),cr=H.process!==void 0&&H.process.toString()===`[object process]`&&!ar&&!!($n&&er.HTMLElement),lr={},ur=V(`enable_beforeunload`),dr=function(e){if(e=e||H.event,!e)return;let t=lr[e.type];t||(t=lr[e.type]=V(`ON_PROPERTY`+e.type));let n=this||e.target||H,r=n[t],i;if(sr&&n===er&&e.type===`error`){let t=e;i=r&&r.call(this,t.message,t.filename,t.lineno,t.colno,t.error),i===!0&&e.preventDefault()}else i=r&&r.apply(this,arguments),e.type===`beforeunload`&&H[ur]&&typeof i==`string`?e.returnValue=i:i!=null&&!i&&e.preventDefault();return i};function fr(e,t,n){let r=zn(e,t);if(!r&&n&&zn(n,t)&&(r={enumerable:!0,configurable:!0}),!r||!r.configurable)return;let i=V(`on`+t+`patched`);if(e.hasOwnProperty(i)&&e[i])return;delete r.writable,delete r.value;let a=r.get,o=r.set,s=t.slice(2),c=lr[s];c||(c=lr[s]=V(`ON_PROPERTY`+s)),r.set=function(t){let n=this;!n&&e===H&&(n=H),n&&(typeof n[c]==`function`&&n.removeEventListener(s,dr),o==null||o.call(n,null),n[c]=t,typeof t==`function`&&n.addEventListener(s,dr,!1))},r.get=function(){let n=this;if(!n&&e===H&&(n=H),!n)return null;let i=n[c];if(i)return i;if(a){let e=a.call(this);if(e)return r.set.call(this,e),typeof n[tr]==`function`&&n.removeAttribute(t),e}return null},Bn(e,t,r),e[i]=!0}function pr(e,t,n){if(t)for(let r=0;r<t.length;r++)fr(e,`on`+t[r],n);else{let t=[];for(let n in e)n.slice(0,2)==`on`&&t.push(n);for(let r=0;r<t.length;r++)fr(e,t[r],n)}}var mr=V(`originalInstance`);function hr(e){let t=H[e];if(!t)return;H[V(e)]=t,H[e]=function(){let n=nr(arguments,e);switch(n.length){case 0:this[mr]=new t;break;case 1:this[mr]=new t(n[0]);break;case 2:this[mr]=new t(n[0],n[1]);break;case 3:this[mr]=new t(n[0],n[1],n[2]);break;case 4:this[mr]=new t(n[0],n[1],n[2],n[3]);break;default:throw Error(`Arg list too long.`)}},br(H[e],t);let n=new t(function(){}),r;for(r in n)e===`XMLHttpRequest`&&r===`responseBlob`||(function(t){typeof n[t]==`function`?H[e].prototype[t]=function(){return this[mr][t].apply(this[mr],arguments)}:Bn(H[e].prototype,t,{set:function(n){typeof n==`function`?(this[mr][t]=Zn(n,e+`.`+t),br(this[mr][t],n)):this[mr][t]=n},get:function(){return this[mr][t]}})})(r);for(r in t)r!==`prototype`&&t.hasOwnProperty(r)&&(H[e][r]=t[r])}function gr(e,t){typeof Object.getOwnPropertySymbols==`function`&&Object.getOwnPropertySymbols(e).forEach(n=>{let r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,{get:function(){return e[n]},set:function(t){r&&(!r.writable||typeof r.set!=`function`)||(e[n]=t)},enumerable:r?r.enumerable:!0,configurable:r?r.configurable:!0})})}var _r=!1;function vr(e,t,n){let r=e;for(;r&&!r.hasOwnProperty(t);)r=Vn(r);!r&&e[t]&&(r=e);let i=V(t),a=null;if(r&&(!(a=r[i])||!r.hasOwnProperty(i))&&(a=r[i]=r[t],ir(r&&zn(r,t)))){let e=n(a,i,t);r[t]=function(){return e(this,arguments)},br(r[t],a),_r&&gr(a,r[t])}return a}function yr(e,t,n){let r=null;function i(e){let t=e.data;return t.args[t.cbIdx]=function(){e.invoke.apply(this,arguments)},r.apply(t.target,t.args),e}r=vr(e,t,e=>function(t,r){let a=n(t,r);return a.cbIdx>=0&&typeof r[a.cbIdx]==`function`?Qn(a.name,r[a.cbIdx],a,i):e.apply(t,r)})}function br(e,t){e[V(`OriginalDelegate`)]=t}function xr(e){return typeof e==`function`}function Sr(e){return typeof e==`number`}var Cr={useG:!0},wr={},Tr={},Er=RegExp(`^`+Xn+`(\\w+)(true|false)$`),Dr=V(`propagationStopped`);function Or(e,t){let n=(t?t(e):e)+Yn,r=(t?t(e):e)+Jn,i=Xn+n,a=Xn+r;wr[e]={},wr[e][Yn]=i,wr[e][Jn]=a}function kr(e,t,n,r){let i=r&&r.add||Wn,a=r&&r.rm||Gn,o=r&&r.listeners||`eventListeners`,s=r&&r.rmAll||`removeAllListeners`,c=V(i),l=`.`+i+`:`,u=`prependListener`;``+u;let d=function(e,t,n){if(e.isRemoved)return;let r=e.callback;typeof r==`object`&&r.handleEvent&&(e.callback=e=>r.handleEvent(e),e.originalDelegate=r);let i;try{e.invoke(e,t,[n])}catch(e){i=e}let o=e.options;if(o&&typeof o==`object`&&o.once){let r=e.originalDelegate?e.originalDelegate:e.callback;t[a].call(t,n.type,r,o)}return i};function f(n,r,i){if(r=r||e.event,!r)return;let a=n||r.target||e,o=a[wr[r.type][i?Jn:Yn]];if(o){let e=[];if(o.length===1){let t=d(o[0],a,r);t&&e.push(t)}else{let t=o.slice();for(let n=0;n<t.length&&!(r&&r[Dr]===!0);n++){let i=d(t[n],a,r);i&&e.push(i)}}if(e.length===1)throw e[0];for(let n=0;n<e.length;n++){let r=e[n];t.nativeScheduleMicroTask(()=>{throw r})}}}let p=function(e){return f(this,e,!1)},m=function(e){return f(this,e,!0)};function h(t,n){if(!t)return!1;let r=!0;n&&n.useG!==void 0&&(r=n.useG);let d=n&&n.vh,f=!0;n&&n.chkDup!==void 0&&(f=n.chkDup);let h=!1;n&&n.rt!==void 0&&(h=n.rt);let g=t;for(;g&&!g.hasOwnProperty(i);)g=Vn(g);if(!g&&t[i]&&(g=t),!g||g[c])return!1;let _=n&&n.eventNameToString,v={},y=g[c]=g[i],b=g[V(a)]=g[a],x=g[V(o)]=g[o],S=g[V(s)]=g[s],C;n&&n.prepend&&(C=g[V(n.prepend)]=g[n.prepend]);function w(e,t){return t?typeof e==`boolean`?{capture:e,passive:!0}:e?typeof e==`object`&&e.passive!==!1?Pn(Nn({},e),{passive:!0}):e:{passive:!0}:e}let T=function(e){if(!v.isExisting)return y.call(v.target,v.eventName,v.capture?m:p,v.options)},E=function(e){if(!e.isRemoved){let t=wr[e.eventName],n;t&&(n=t[e.capture?Jn:Yn]);let r=n&&e.target[n];if(r){for(let t=0;t<r.length;t++)if(r[t]===e){r.splice(t,1),e.isRemoved=!0,e.removeAbortListener&&(e.removeAbortListener(),e.removeAbortListener=null),r.length===0&&(e.allRemoved=!0,e.target[n]=null);break}}}if(e.allRemoved)return b.call(e.target,e.eventName,e.capture?m:p,e.options)},D=function(e){return y.call(v.target,v.eventName,e.invoke,v.options)},ee=function(e){return C.call(v.target,v.eventName,e.invoke,v.options)},te=function(e){return b.call(e.target,e.eventName,e.invoke,e.options)},O=r?T:D,k=r?E:te,ne=(n==null?void 0:n.diff)||function(e,t){let n=typeof t;return n===`function`&&e.callback===t||n===`object`&&e.originalDelegate===t},A=Zone[V(`UNPATCHED_EVENTS`)],re=e[V(`PASSIVE_EVENTS`)];function ie(e){if(typeof e==`object`&&e){let t=Nn({},e);return e.signal&&(t.signal=e.signal),t}return e}let j=function(t,i,a,o,s=!1,c=!1){return function(){let l=this||e,u=arguments[0];n&&n.transferEventName&&(u=n.transferEventName(u));let p=arguments[1];if(!p||or&&u===`uncaughtException`)return t.apply(this,arguments);let m=!1;if(typeof p!=`function`){if(!p.handleEvent)return t.apply(this,arguments);m=!0}if(d&&!d(t,p,l,arguments))return;let h=!!re&&re.indexOf(u)!==-1,g=ie(w(arguments[2],h)),y=g==null?void 0:g.signal;if(y!=null&&y.aborted)return;if(A){for(let e=0;e<A.length;e++)if(u===A[e])return h?t.call(l,u,p,g):t.apply(this,arguments)}let b=g?typeof g==`boolean`?!0:g.capture:!1,x=g&&typeof g==`object`?g.once:!1,S=Zone.current,C=wr[u];C||(Or(u,_),C=wr[u]);let T=C[b?Jn:Yn],E=l[T],D=!1;if(E){if(D=!0,f){for(let e=0;e<E.length;e++)if(ne(E[e],p))return}}else E=l[T]=[];let ee,te=l.constructor.name,O=Tr[te];O&&(ee=O[u]),ee||(ee=te+i+(_?_(u):u)),v.options=g,x&&(v.options.once=!1),v.target=l,v.capture=b,v.eventName=u,v.isExisting=D;let k=r?Cr:void 0;k&&(k.taskData=v),y&&(v.options.signal=void 0);let j=S.scheduleEventTask(ee,p,k,a,o);if(y){v.options.signal=y;let e=()=>j.zone.cancelTask(j);t.call(y,`abort`,e,{once:!0}),j.removeAbortListener=()=>y.removeEventListener(`abort`,e)}if(v.target=null,k&&(k.taskData=null),x&&(v.options.once=!0),typeof j.options!=`boolean`&&(j.options=g),j.target=l,j.capture=b,j.eventName=u,m&&(j.originalDelegate=p),c?E.unshift(j):E.push(j),s)return l}};return g[i]=j(y,l,O,k,h),C&&(g[u]=j(C,`.prependListener:`,ee,k,h,!0)),g[a]=function(){let t=this||e,r=arguments[0];n&&n.transferEventName&&(r=n.transferEventName(r));let i=arguments[2],a=i?typeof i==`boolean`?!0:i.capture:!1,o=arguments[1];if(!o)return b.apply(this,arguments);if(d&&!d(b,o,t,arguments))return;let s=wr[r],c;s&&(c=s[a?Jn:Yn]);let l=c&&t[c];if(l)for(let e=0;e<l.length;e++){let n=l[e];if(ne(n,o)){if(l.splice(e,1),n.isRemoved=!0,l.length===0&&(n.allRemoved=!0,t[c]=null,!a&&typeof r==`string`)){let e=Xn+`ON_PROPERTY`+r;t[e]=null}return n.zone.cancelTask(n),h?t:void 0}}return b.apply(this,arguments)},g[o]=function(){let t=this||e,r=arguments[0];n&&n.transferEventName&&(r=n.transferEventName(r));let i=[],a=Ar(t,_?_(r):r);for(let e=0;e<a.length;e++){let t=a[e],n=t.originalDelegate?t.originalDelegate:t.callback;i.push(n)}return i},g[s]=function(){let t=this||e,r=arguments[0];if(r){n&&n.transferEventName&&(r=n.transferEventName(r));let e=wr[r];if(e){let n=e[Yn],i=e[Jn],o=t[n],s=t[i];if(o){let e=o.slice();for(let t=0;t<e.length;t++){let n=e[t],i=n.originalDelegate?n.originalDelegate:n.callback;this[a].call(this,r,i,n.options)}}if(s){let e=s.slice();for(let t=0;t<e.length;t++){let n=e[t],i=n.originalDelegate?n.originalDelegate:n.callback;this[a].call(this,r,i,n.options)}}}}else{let e=Object.keys(t);for(let t=0;t<e.length;t++){let n=e[t],r=Er.exec(n),i=r&&r[1];i&&i!==`removeListener`&&this[s].call(this,i)}this[s].call(this,`removeListener`)}if(h)return this},br(g[i],y),br(g[a],b),S&&br(g[s],S),x&&br(g[o],x),!0}let g=[];for(let e=0;e<n.length;e++)g[e]=h(n[e],r);return g}function Ar(e,t){if(!t){let n=[];for(let r in e){let i=Er.exec(r),a=i&&i[1];if(a&&(!t||a===t)){let t=e[r];if(t)for(let e=0;e<t.length;e++)n.push(t[e])}}return n}let n=wr[t];n||(Or(t),n=wr[t]);let r=e[n[Yn]],i=e[n[Jn]];return r?i?r.concat(i):r.slice():i?i.slice():[]}function jr(e,t){let n=e.Event;n&&n.prototype&&t.patchMethod(n.prototype,`stopImmediatePropagation`,e=>function(t,n){t[Dr]=!0,e&&e.apply(t,n)})}function Mr(e,t){t.patchMethod(e,`queueMicrotask`,e=>function(e,t){Zone.current.scheduleMicroTask(`queueMicrotask`,t[0])})}var Nr=V(`zoneTask`);function Pr(e,t,n,r){let i=null,a=null;t+=r,n+=r;let o={};function s(t){let n=t.data;n.args[0]=function(){return t.invoke.apply(this,arguments)};let r=i.apply(e,n.args);return Sr(r)?n.handleId=r:(n.handle=r,n.isRefreshable=xr(r.refresh)),t}function c(t){let{handle:n,handleId:r}=t.data;return a.call(e,n==null?r:n)}i=vr(e,t,n=>function(i,a){var l;if(xr(a[0])){let e={isRefreshable:!1,isPeriodic:r===`Interval`,delay:r===`Timeout`||r===`Interval`?a[1]||0:void 0,args:a},n=a[0];a[0]=function(){try{return n.apply(this,arguments)}finally{let{handle:t,handleId:n,isPeriodic:r,isRefreshable:i}=e;!r&&!i&&(n?delete o[n]:t&&(t[Nr]=null))}};let i=Qn(t,a[0],e,s,c);if(!i)return i;let{handleId:u,handle:d,isRefreshable:f,isPeriodic:p}=i.data;if(u)o[u]=i;else if(d&&(d[Nr]=i,f&&!p)){let e=d.refresh;d.refresh=function(){let{zone:t,state:n}=i;return n===`notScheduled`?(i._state=`scheduled`,t._updateTaskCount(i,1)):n===`running`&&(i._state=`scheduling`),e.call(this)}}return(l=d==null?u:d)==null?i:l}else return n.apply(e,a)}),a=vr(e,n,t=>function(n,r){let i=r[0],a;Sr(i)?(a=o[i],delete o[i]):(a=i==null?void 0:i[Nr],a?i[Nr]=null:a=i),a!=null&&a.type?a.cancelFn&&a.zone.cancelTask(a):t.apply(e,r)})}function Fr(e,t){let{isBrowser:n,isMix:r}=t.getGlobalObjects();!n&&!r||!e.customElements||!(`customElements`in e)||t.patchCallbacks(t,e.customElements,`customElements`,`define`,[`connectedCallback`,`disconnectedCallback`,`adoptedCallback`,`attributeChangedCallback`,`formAssociatedCallback`,`formDisabledCallback`,`formResetCallback`,`formStateRestoreCallback`])}function Ir(e,t){if(Zone[t.symbol(`patchEventTarget`)])return;let{eventNames:n,zoneSymbolEventNames:r,TRUE_STR:i,FALSE_STR:a,ZONE_SYMBOL_PREFIX:o}=t.getGlobalObjects();for(let e=0;e<n.length;e++){let t=n[e],s=t+a,c=t+i,l=o+s,u=o+c;r[t]={},r[t][a]=l,r[t][i]=u}let s=e.EventTarget;if(!(!s||!s.prototype))return t.patchEventTarget(e,t,[s&&s.prototype]),!0}function Lr(e,t){t.patchEventPrototype(e,t)}function Rr(e,t,n){if(!n||n.length===0)return t;let r=n.filter(t=>t.target===e);if(r.length===0)return t;let i=r[0].ignoreProperties;return t.filter(e=>i.indexOf(e)===-1)}function zr(e,t,n,r){e&&pr(e,Rr(e,t,n),r)}function Br(e){return Object.getOwnPropertyNames(e).filter(e=>e.startsWith(`on`)&&e.length>2).map(e=>e.substring(2))}function Vr(e,t){if(or&&!cr||Zone[e.symbol(`patchEvents`)])return;let n=t.__Zone_ignore_on_properties,r=[];if(sr){let e=window;r=r.concat([`Document`,`SVGElement`,`Element`,`HTMLElement`,`HTMLBodyElement`,`HTMLMediaElement`,`HTMLFrameSetElement`,`HTMLFrameElement`,`HTMLIFrameElement`,`HTMLMarqueeElement`,`Worker`]),zr(e,Br(e),n,Vn(e))}r=r.concat([`XMLHttpRequest`,`XMLHttpRequestEventTarget`,`IDBIndex`,`IDBRequest`,`IDBOpenDBRequest`,`IDBDatabase`,`IDBTransaction`,`IDBCursor`,`WebSocket`]);for(let e=0;e<r.length;e++){let i=t[r[e]];i!=null&&i.prototype&&zr(i.prototype,Br(i.prototype),n)}}function Hr(e){e.__load_patch(`timers`,e=>{let t=`clear`;Pr(e,`set`,t,`Timeout`),Pr(e,`set`,t,`Interval`),Pr(e,`set`,t,`Immediate`)}),e.__load_patch(`requestAnimationFrame`,e=>{Pr(e,`request`,`cancel`,`AnimationFrame`),Pr(e,`mozRequest`,`mozCancel`,`AnimationFrame`),Pr(e,`webkitRequest`,`webkitCancel`,`AnimationFrame`)}),e.__load_patch(`blocking`,(e,t)=>{let n=[`alert`,`prompt`,`confirm`];for(let r=0;r<n.length;r++){let i=n[r];vr(e,i,(n,r,i)=>function(r,a){return t.current.run(n,e,a,i)})}}),e.__load_patch(`EventTarget`,(e,t,n)=>{Lr(e,n),Ir(e,n);let r=e.XMLHttpRequestEventTarget;r&&r.prototype&&n.patchEventTarget(e,n,[r.prototype])}),e.__load_patch(`MutationObserver`,(e,t,n)=>{hr(`MutationObserver`),hr(`WebKitMutationObserver`)}),e.__load_patch(`IntersectionObserver`,(e,t,n)=>{hr(`IntersectionObserver`)}),e.__load_patch(`FileReader`,(e,t,n)=>{hr(`FileReader`)}),e.__load_patch(`on_property`,(e,t,n)=>{Vr(n,e)}),e.__load_patch(`customElements`,(e,t,n)=>{Fr(e,n)}),e.__load_patch(`XHR`,(e,t)=>{c(e);let n=V(`xhrTask`),r=V(`xhrSync`),i=V(`xhrListener`),a=V(`xhrScheduled`),o=V(`xhrURL`),s=V(`xhrErrorBeforeScheduled`);function c(e){let c=e.XMLHttpRequest;if(!c)return;let l=c.prototype;function u(e){return e[n]}let d=l[Kn],f=l[qn];if(!d){let t=e.XMLHttpRequestEventTarget;if(t){let e=t.prototype;d=e[Kn],f=e[qn]}}let p=`readystatechange`,m=`scheduled`;function h(e){let r=e.data,o=r.target;o[a]=!1,o[s]=!1;let c=o[i];d||(d=o[Kn],f=o[qn]),c&&f.call(o,p,c);let l=o[i]=()=>{if(o.readyState===o.DONE)if(!r.aborted&&o[a]&&e.state===m){let n=o[t.__symbol__(`loadfalse`)];if(o.status!==0&&n&&n.length>0){let i=e.invoke;e.invoke=function(){let n=o[t.__symbol__(`loadfalse`)];for(let t=0;t<n.length;t++)n[t]===e&&n.splice(t,1);!r.aborted&&e.state===m&&i.call(e)},n.push(e)}else e.invoke()}else !r.aborted&&o[a]===!1&&(o[s]=!0)};return d.call(o,p,l),o[n]||(o[n]=e),x.apply(o,r.args),o[a]=!0,e}function g(){}function _(e){let t=e.data;return t.aborted=!0,S.apply(t.target,t.args)}let v=vr(l,`open`,()=>function(e,t){return e[r]=t[2]==0,e[o]=t[1],v.apply(e,t)}),y=V(`fetchTaskAborting`),b=V(`fetchTaskScheduling`),x=vr(l,`send`,()=>function(e,n){if(t.current[b]===!0||e[r])return x.apply(e,n);{let t={target:e,url:e[o],isPeriodic:!1,args:n,aborted:!1},r=Qn(`XMLHttpRequest.send`,g,t,h,_);e&&e[s]===!0&&!t.aborted&&r.state===m&&r.invoke()}}),S=vr(l,`abort`,()=>function(e,n){let r=u(e);if(r&&typeof r.type==`string`){if(r.cancelFn==null||r.data&&r.data.aborted)return;r.zone.cancelTask(r)}else if(t.current[y]===!0)return S.apply(e,n)})}}),e.__load_patch(`geolocation`,e=>{e.navigator&&e.navigator.geolocation&&rr(e.navigator.geolocation,[`getCurrentPosition`,`watchPosition`])}),e.__load_patch(`PromiseRejectionEvent`,(e,t)=>{function n(t){return function(n){Ar(e,t).forEach(r=>{let i=e.PromiseRejectionEvent;if(i){let e=new i(t,{promise:n.promise,reason:n.rejection});r.invoke(e)}})}}e.PromiseRejectionEvent&&(t[V(`unhandledPromiseRejectionHandler`)]=n(`unhandledrejection`),t[V(`rejectionHandledHandler`)]=n(`rejectionhandled`))}),e.__load_patch(`queueMicrotask`,(e,t,n)=>{Mr(e,n)})}function Ur(e){e.__load_patch(`ZoneAwarePromise`,(e,t,n)=>{let r=Object.getOwnPropertyDescriptor,i=Object.defineProperty;function a(e){return e&&e.toString===Object.prototype.toString?(e.constructor&&e.constructor.name||``)+`: `+JSON.stringify(e):e?e.toString():Object.prototype.toString.call(e)}let o=n.symbol,s=[],c=e[o(`DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION`)]!==!1,l=o(`Promise`),u=o(`then`);n.onUnhandledError=e=>{if(n.showUncaughtError()){let t=e&&e.rejection;t?console.error(`Unhandled Promise rejection:`,t instanceof Error?t.message:t,`; Zone:`,e.zone.name,`; Task:`,e.task&&e.task.source,`; Value:`,t,t instanceof Error?t.stack:void 0):console.error(e)}},n.microtaskDrainDone=()=>{for(;s.length;){let e=s.shift();try{e.zone.runGuarded(()=>{throw e.throwOriginal?e.rejection:e})}catch(e){f(e)}}};let d=o(`unhandledPromiseRejectionHandler`);function f(e){n.onUnhandledError(e);try{let n=t[d];typeof n==`function`&&n.call(this,e)}catch(e){}}function p(e){return e&&typeof e.then==`function`}function m(e){return e}function h(e){return O.reject(e)}let g=o(`state`),_=o(`value`),v=o(`finally`),y=o(`parentPromiseValue`),b=o(`parentPromiseState`);function x(e,t){return n=>{try{w(e,t,n)}catch(t){w(e,!1,t)}}}let S=function(){let e=!1;return function(t){return function(){e||(e=!0,t.apply(null,arguments))}}},C=o(`currentTaskTrace`);function w(e,r,o){let l=S();if(e===o)throw TypeError(`Promise resolved with itself`);if(e[g]===null){let u=null;try{(typeof o==`object`||typeof o==`function`)&&(u=o&&o.then)}catch(t){return l(()=>{w(e,!1,t)})(),e}if(r!==!1&&o instanceof O&&o.hasOwnProperty(g)&&o.hasOwnProperty(_)&&o[g]!==null)E(o),w(e,o[g],o[_]);else if(r!==!1&&typeof u==`function`)try{u.call(o,l(x(e,r)),l(x(e,!1)))}catch(t){l(()=>{w(e,!1,t)})()}else{e[g]=r;let l=e[_];if(e[_]=o,e[v]===v&&r===!0&&(e[g]=e[b],e[_]=e[y]),r===!1&&o instanceof Error){let e=t.currentTask&&t.currentTask.data&&t.currentTask.data.__creationTrace__;e&&i(o,C,{configurable:!0,enumerable:!1,writable:!0,value:e})}for(let t=0;t<l.length;)D(e,l[t++],l[t++],l[t++],l[t++]);if(l.length==0&&r==0){e[g]=0;let r=o;try{throw Error(`Uncaught (in promise): `+a(o)+(o&&o.stack?`
2
+ `+o.stack:``))}catch(e){r=e}c&&(r.throwOriginal=!0),r.rejection=o,r.promise=e,r.zone=t.current,r.task=t.currentTask,s.push(r),n.scheduleMicroTask()}}}return e}let T=o(`rejectionHandledHandler`);function E(e){if(e[g]===0){try{let n=t[T];n&&typeof n==`function`&&n.call(this,{rejection:e[_],promise:e})}catch(e){}e[g]=!1;for(let t=0;t<s.length;t++)e===s[t].promise&&s.splice(t,1)}}function D(e,t,n,r,i){E(e);let a=e[g],o=a?typeof r==`function`?r:m:typeof i==`function`?i:h;t.scheduleMicroTask(`Promise.then`,()=>{try{let r=e[_],i=!!n&&v===n[v];i&&(n[y]=r,n[b]=a),w(n,!0,t.run(o,void 0,i&&o!==h&&o!==m?[]:[r]))}catch(e){w(n,!1,e)}},n)}let ee=function(){},te=e.AggregateError;class O{static toString(){return`function ZoneAwarePromise() { [native code] }`}static resolve(e){return e instanceof O?e:w(new this(null),!0,e)}static reject(e){return w(new this(null),!1,e)}static withResolvers(){let e={};return e.promise=new O((t,n)=>{e.resolve=t,e.reject=n}),e}static any(e){if(!e||typeof e[Symbol.iterator]!=`function`)return Promise.reject(new te([],`All promises were rejected`));let t=[],n=0;try{for(let r of e)n++,t.push(O.resolve(r))}catch(e){return Promise.reject(new te([],`All promises were rejected`))}if(n===0)return Promise.reject(new te([],`All promises were rejected`));let r=!1,i=[];return new O((e,a)=>{for(let o=0;o<t.length;o++)t[o].then(t=>{r||(r=!0,e(t))},e=>{i.push(e),n--,n===0&&(r=!0,a(new te(i,`All promises were rejected`)))})})}static race(e){let t,n,r=new this((e,r)=>{t=e,n=r});function i(e){t(e)}function a(e){n(e)}for(let t of e)p(t)||(t=this.resolve(t)),t.then(i,a);return r}static all(e){return O.allWithCallback(e)}static allSettled(e){return(this&&this.prototype instanceof O?this:O).allWithCallback(e,{thenCallback:e=>({status:`fulfilled`,value:e}),errorCallback:e=>({status:`rejected`,reason:e})})}static allWithCallback(e,t){let n,r,i=new this((e,t)=>{n=e,r=t}),a=2,o=0,s=[];for(let i of e){p(i)||(i=this.resolve(i));let e=o;try{i.then(r=>{s[e]=t?t.thenCallback(r):r,a--,a===0&&n(s)},i=>{t?(s[e]=t.errorCallback(i),a--,a===0&&n(s)):r(i)})}catch(e){r(e)}a++,o++}return a-=2,a===0&&n(s),i}constructor(e){let t=this;if(!(t instanceof O))throw Error(`Must be an instanceof Promise.`);t[g]=null,t[_]=[];try{let n=S();e&&e(n(x(t,!0)),n(x(t,!1)))}catch(e){w(t,!1,e)}}get[Symbol.toStringTag](){return`Promise`}get[Symbol.species](){return O}then(e,n){var r;let i=(r=this.constructor)==null?void 0:r[Symbol.species];(!i||typeof i!=`function`)&&(i=this.constructor||O);let a=new i(ee),o=t.current;return this[g]==null?this[_].push(o,a,e,n):D(this,o,a,e,n),a}catch(e){return this.then(null,e)}finally(e){var n;let r=(n=this.constructor)==null?void 0:n[Symbol.species];(!r||typeof r!=`function`)&&(r=O);let i=new r(ee);i[v]=v;let a=t.current;return this[g]==null?this[_].push(a,i,e,e):D(this,a,i,e,e),i}}O.resolve=O.resolve,O.reject=O.reject,O.race=O.race,O.all=O.all;let k=e[l]=e.Promise;e.Promise=O;let ne=o(`thenPatched`);function A(e){let t=e.prototype,n=r(t,`then`);if(n&&(n.writable===!1||!n.configurable))return;let i=t.then;t[u]=i,e.prototype.then=function(e,t){return new O((e,t)=>{i.call(this,e,t)}).then(e,t)},e[ne]=!0}n.patchThen=A;function re(e){return function(t,n){let r=e.apply(t,n);if(r instanceof O)return r;let i=r.constructor;return i[ne]||A(i),r}}if(k){A(k);let t=k.try;t&&typeof t==`function`&&(O.try=t),vr(e,`fetch`,e=>re(e))}return Promise[t.__symbol__(`uncaughtPromiseErrors`)]=s,O})}function Wr(e){e.__load_patch(`toString`,e=>{let t=Function.prototype.toString,n=V(`OriginalDelegate`),r=V(`Promise`),i=V(`Error`),a=function(){if(typeof this==`function`){let a=this[n];if(a)return typeof a==`function`?t.call(a):Object.prototype.toString.call(a);if(this===Promise){let n=e[r];if(n)return t.call(n)}if(this===Error){let n=e[i];if(n)return t.call(n)}}return t.call(this)};a[n]=t,Function.prototype.toString=a;let o=Object.prototype.toString;Object.prototype.toString=function(){return typeof Promise==`function`&&this instanceof Promise?`[object Promise]`:o.call(this)}})}function Gr(e,t,n,r,i){let a=Zone.__symbol__(r);if(t[a])return;let o=t[a]=t[r];t[r]=function(a,s,c){return s&&s.prototype&&i.forEach(function(t){let i=`${n}.${r}::`+t,a=s.prototype;try{if(a.hasOwnProperty(t)){let n=e.ObjectGetOwnPropertyDescriptor(a,t);n&&n.value?(n.value=e.wrapWithCurrentZone(n.value,i),e._redefineProperty(s.prototype,t,n)):a[t]&&(a[t]=e.wrapWithCurrentZone(a[t],i))}else a[t]&&(a[t]=e.wrapWithCurrentZone(a[t],i))}catch(e){}}),o.call(t,a,s,c)},e.attachOriginToPatched(t[r],o)}function Kr(e){e.__load_patch(`util`,(e,t,n)=>{let r=Br(e);n.patchOnProperties=pr,n.patchMethod=vr,n.bindArguments=nr,n.patchMacroTask=yr;let i=t.__symbol__(`BLACK_LISTED_EVENTS`),a=t.__symbol__(`UNPATCHED_EVENTS`);e[a]&&(e[i]=e[a]),e[i]&&(t[i]=t[a]=e[i]),n.patchEventPrototype=jr,n.patchEventTarget=kr,n.ObjectDefineProperty=Bn,n.ObjectGetOwnPropertyDescriptor=zn,n.ObjectCreate=Hn,n.ArraySlice=Un,n.patchClass=hr,n.wrapWithCurrentZone=Zn,n.filterProperties=Rr,n.attachOriginToPatched=br,n._redefineProperty=Object.defineProperty,n.patchCallbacks=Gr,n.getGlobalObjects=()=>({globalSources:Tr,zoneSymbolEventNames:wr,eventNames:r,isBrowser:sr,isMix:cr,isNode:or,TRUE_STR:Jn,FALSE_STR:Yn,ZONE_SYMBOL_PREFIX:Xn,ADD_EVENT_LISTENER_STR:Wn,REMOVE_EVENT_LISTENER_STR:Gn})})}function qr(e){Ur(e),Wr(e),Kr(e)}var Jr=Rn();qr(Jr),Hr(Jr);function Yr(e){return e.setValue(Zr,!0)}function Xr(e){return e.getValue(Zr)===!0}var Zr,Qr=t((()=>{I(),Zr=re(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`)})),$r,ei,ti=t((()=>{$r=`baggage`,ei=4096}));function ni(e){return e.reduce((e,t)=>{let n=`${e}${e===``?``:`,`}${t}`;return n.length>8192?e:n},``)}function ri(e){return e.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(n+=`;`+t.metadata.toString()),n})}function ii(e){if(!e)return;let t=e.indexOf(`;`),n=t===-1?e:e.substring(0,t),r=n.indexOf(`=`);if(r<=0)return;let i=n.substring(0,r).trim(),a=n.substring(r+1).trim();if(!i||!a)return;let o,s;try{o=decodeURIComponent(i),s=decodeURIComponent(a)}catch(e){return}let c;return t!==-1&&t<e.length-1&&(c=k(e.substring(t+1))),{key:o,value:s,metadata:c}}var ai=t((()=>{I(),ti()})),oi,si=t((()=>{I(),Qr(),ti(),ai(),oi=class{inject(e,t,n){let r=Gt.getBaggage(e);if(!r||Xr(e))return;let i=ni(ri(r).filter(e=>e.length<=ei).slice(0,180));i.length>0&&n.set(t,$r,i)}extract(e,t,n){let r=n.get(t,$r),i=Array.isArray(r)?r.join(`,`):r;if(!i)return e;let a={};return i.length===0||(i.split(`,`).forEach(e=>{let t=ii(e);if(t){let e={value:t.value};t.metadata&&(e.metadata=t.metadata),a[t.key]=e}}),Object.entries(a).length===0)?e:Gt.setBaggage(e,Gt.createBaggage(a))}fields(){return[$r]}}}));function ci(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!li(n)){P.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!ui(r)){P.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function li(e){return typeof e==`string`&&e!==``}function ui(e){return e==null?!0:Array.isArray(e)?di(e):fi(typeof e)}function di(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(fi(e)){t=e;continue}return!1}return!1}}return!0}function fi(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}var pi=t((()=>{I()}));function mi(){return e=>{P.error(hi(e))}}function hi(e){return typeof e==`string`?e:JSON.stringify(gi(e))}function gi(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;let r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}var _i=t((()=>{I()}));function vi(e){try{yi(e)}catch(e){}}var yi,bi=t((()=>{_i(),yi=mi()})),xi=t((()=>{})),Si,Ci=t((()=>{Si=`2.7.1`})),wi=t((()=>{})),Ti=t((()=>{wi()})),Ei=t((()=>{})),Di=t((()=>{Ei()})),Oi,ki,Ai,ji,Mi,Ni,Pi,Fi,Ii,Li,Ri,zi,Bi,Vi,Hi,Ui,Wi=t((()=>{Oi=`error.type`,ki=`exception.message`,Ai=`exception.stacktrace`,ji=`exception.type`,Mi=`http.request.method`,Ni=`http.request.method_original`,Pi=`http.response.status_code`,Fi=`server.address`,Ii=`server.port`,Li=`service.name`,Ri=`telemetry.sdk.language`,zi=`webjs`,Bi=`telemetry.sdk.name`,Vi=`telemetry.sdk.version`,Hi=`url.full`,Ui=`user_agent.original`})),Gi=t((()=>{})),Ki=t((()=>{})),qi=t((()=>{Ti(),Di(),Wi(),Gi(),Ki()})),Ji,Yi=t((()=>{Ji=`process.runtime.name`})),Xi,Zi=t((()=>{Ci(),qi(),Yi(),Xi={[Bi]:`opentelemetry`,[Ji]:`browser`,[Ri]:zi,[Vi]:Si}})),U,Qi=t((()=>{xi(),Zi(),U=performance}));function $i(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*la)]}function ea(e){return sa($i(U.timeOrigin),$i(typeof e==`number`?e:U.now()))}function ta(e){if(aa(e))return e;if(typeof e==`number`)return e<U.timeOrigin?ea(e):$i(e);if(e instanceof Date)return $i(e.getTime());throw TypeError(`Invalid input type`)}function na(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=ua),[n,r]}function ra(e){return e[0]*ua+e[1]}function ia(e){return e[0]*1e6+e[1]/1e3}function aa(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function oa(e){return aa(e)||typeof e==`number`||e instanceof Date}function sa(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=ua&&(n[1]-=ua,n[0]+=1),n}var ca,la,ua,da=t((()=>{Qi(),ca=9,la=Math.pow(10,6),ua=Math.pow(10,ca)})),fa,pa=t((()=>{(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(fa||(fa={}))})),ma,ha=t((()=>{I(),z(),ma=class{constructor(e={}){var t;R(this,`_propagators`,void 0),R(this,`_fields`,void 0),this._propagators=(t=e.propagators)==null?[]:t;let n=new Set;for(let e of this._propagators){let t=typeof e.fields==`function`?e.fields():[];for(let e of t)n.add(e)}this._fields=Array.from(n)}inject(e,t,n){for(let r of this._propagators)try{r.inject(e,t,n)}catch(e){P.warn(`Failed to inject with ${r.constructor.name}. Err: ${e.message}`)}}extract(e,t,n){return this._propagators.reduce((e,r)=>{try{return r.extract(e,t,n)}catch(e){P.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}}}));function ga(e){return xa.test(e)}function _a(e){return Sa.test(e)&&!Ca.test(e)}var va,ya,ba,xa,Sa,Ca,wa=t((()=>{va=`[_0-9a-z-*/]`,ya=`[a-z]${va}{0,255}`,ba=`[a-z0-9]${va}{0,240}@[a-z]${va}{0,13}`,xa=RegExp(`^(?:${ya}|${ba})$`),Sa=/^[ -~]{0,255}[!-~]$/,Ca=/,|=/})),Ta,Ea,Da,Oa,ka,Aa=t((()=>{wa(),z(),Ta=32,Ea=512,Da=`,`,Oa=`=`,ka=class e{constructor(e){R(this,`_length`,void 0),R(this,`_rawTraceState`,void 0),R(this,`_internalState`,void 0),this._rawTraceState=typeof e==`string`?e:``,this._length=this._rawTraceState.length}set(e,t){if(!ga(e)||!_a(t))return this;let n=this._getState(),r=n.get(e),i=this._length;if(typeof r==`string`?i+=t.length-r.length:i+=e.length+t.length+(n.size>0?2:1),i>Ea)return this;let a=new Map(n);return a.delete(e),a.set(e,t),this._fromState(a,i)}unset(e){let t=this._getState(),n=t.get(e);if(typeof n!=`string`)return this;let r=this._length-(e.length+n.length+1);t.size>1&&--r;let i=new Map(t);return i.delete(e),this._fromState(i,r)}get(e){return this._getState().get(e)}serialize(){let e=``,t=0;for(let n of this._getState())t>0&&(e=Da+e),e=`${n[0]}${Oa}${n[1]}`+e,t++;return e}_getState(){if(this._internalState)return this._internalState;let e=this._rawTraceState.split(Da),t=new Map,n=0;for(let r of e){let e=r.trim(),i=e.indexOf(Oa);if(i===-1)continue;let a=e.slice(0,i),o=e.slice(i+1);if(!ga(a)||!_a(o))continue;let s=n+e.length+ +(t.size>0);if(!(s>Ea)&&(t.set(a,o),n=s,t.size>=Ta))break}return this._length=n,this._internalState=new Map(Array.from(t.entries()).reverse()),this._internalState}_fromState(t,n){let r=Object.create(e.prototype);return r._internalState=t,r._length=n,r}}}));function ja(e){let t=Fa.exec(e);return!t||t[1]===`00`&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var Ma,Na,Pa,Fa,Ia,La=t((()=>{I(),Qr(),Aa(),Ma=`traceparent`,Na=`tracestate`,Pa=`00`,Fa=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`),Ia=class{inject(e,t,n){let r=F.getSpanContext(e);if(!r||Xr(e)||!tt(r))return;let i=`${Pa}-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||M.NONE).toString(16)}`;n.set(t,Ma,i),r.traceState&&n.set(t,Na,r.traceState.serialize())}extract(e,t,n){let r=n.get(t,Ma);if(!r)return e;let i=Array.isArray(r)?r[0]:r;if(typeof i!=`string`)return e;let a=ja(i);if(!a)return e;a.isRemote=!0;let o=n.get(t,Na);if(o){let e=Array.isArray(o)?o.join(`,`):o;a.traceState=new ka(typeof e==`string`?e:void 0)}return F.setSpanContext(e,a)}fields(){return[Ma,Na]}}}));function Ra(e){if(!za(e)||Ba(e)!==Ua)return!1;let t=Ja(e);if(t===null)return!0;let n=Xa.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&Ka.call(n)===qa}function za(e){return typeof e==`object`&&!!e}function Ba(e){return e==null?e===void 0?Ga:Wa:Za&&Za in Object(e)?Va(e):Ha(e)}function Va(e){let t=Xa.call(e,Za),n=e[Za],r=!1;try{e[Za]=void 0,r=!0}catch(e){}let i=Qa.call(e);return r&&(t?e[Za]=n:delete e[Za]),i}function Ha(e){return Qa.call(e)}var Ua,Wa,Ga,Ka,qa,Ja,Ya,Xa,Za,Qa,$a=t((()=>{Ua=`[object Object]`,Wa=`[object Null]`,Ga=`[object Undefined]`,Ka=Function.prototype.toString,qa=Ka.call(Object),Ja=Object.getPrototypeOf,Ya=Object.prototype,Xa=Ya.hasOwnProperty,Za=Symbol?Symbol.toStringTag:void 0,Qa=Ya.toString}));function eo(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=no(t,e.shift(),0,n);return t}function to(e){return io(e)?e.slice():e}function no(e,t,n=0,r){let i;if(!(n>lo)){if(n++,so(e)||so(t)||ao(t))i=to(t);else if(io(e)){if(i=e.slice(),io(t))for(let e=0,n=t.length;e<n;e++)i.push(to(t[e]));else if(oo(t)){let e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){let r=e[n];r===`__proto__`||r===`constructor`||r===`prototype`||(i[r]=to(t[r]))}}}else if(oo(e))if(oo(t)){if(!co(e,t))return t;i=Object.assign({},e);let a=Object.keys(t);for(let o=0,s=a.length;o<s;o++){let s=a[o];if(s===`__proto__`||s===`constructor`||s===`prototype`)continue;let c=t[s];if(so(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(ro(e,s,r)||ro(t,s,r))delete i[s];else{if(oo(a)&&oo(o)){let n=r.get(a)||[],i=r.get(o)||[];n.push({obj:e,key:s}),i.push({obj:t,key:s}),r.set(a,n),r.set(o,i)}i[s]=no(i[s],c,n,r)}}}}else i=t;return i}}function ro(e,t,n){let r=n.get(e[t])||[];for(let n=0,i=r.length;n<i;n++){let i=r[n];if(i.key===t&&i.obj===e)return!0}return!1}function io(e){return Array.isArray(e)}function ao(e){return typeof e==`function`}function oo(e){return!so(e)&&!io(e)&&!ao(e)&&typeof e==`object`}function so(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function co(e,t){return!(!Ra(e)||!Ra(t))}var lo,uo=t((()=>{$a(),lo=20}));function fo(e,t){let n,r=new Promise(function(e,r){n=setTimeout(function(){r(new po(`Operation timed out.`))},t)});return Promise.race([e,r]).then(e=>(clearTimeout(n),e),e=>{throw clearTimeout(n),e})}var po,mo=t((()=>{po=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}}}));function ho(e,t){return typeof t==`string`?e===t:!!e.match(t)}function go(e,t){if(!t)return!1;for(let n of t)if(ho(e,n))return!0;return!1}var _o=t((()=>{})),vo,yo=t((()=>{z(),vo=class{constructor(){R(this,`_promise`,void 0),R(this,`_resolve`,void 0),R(this,`_reject`,void 0),this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}})),bo,xo=t((()=>{yo(),z(),bo=class{constructor(e,t){R(this,`_isCalled`,!1),R(this,`_deferred`,new vo),R(this,`_callback`,void 0),R(this,`_that`,void 0),this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}}}));function So(e,t){return new Promise(n=>{N.with(Yr(N.active()),()=>{e.export(t,n)})})}var Co=t((()=>{I(),Qr()})),wo,W=t((()=>{si(),z(),pi(),bi(),_i(),da(),pa(),ai(),Qi(),ha(),La(),I(),Qr(),Aa(),uo(),mo(),_o(),xo(),Co(),wo={_export:So}}));z();var To=class{constructor(e){R(this,`_delegate`,void 0),this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}};z();var Eo=class extends Error{constructor(e,t,n){super(e),R(this,`code`,void 0),R(this,`name`,`OTLPExporterError`),R(this,`data`,void 0),this.data=n,this.code=t}};function Do(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function G(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){Do(a,r,i,o,s,`next`,e)}function s(e){Do(a,r,i,o,s,`throw`,e)}o(void 0)})}}var K=t((()=>{}));K();function Oo(e){if(Number.isFinite(e)&&e>0)return e;throw Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function ko(e){if(e!=null)return G(function*(){return e})}function Ao(e,t,n){var r,i,a,o,s,c;return{timeoutMillis:Oo((r=(i=e.timeoutMillis)==null?t.timeoutMillis:i)==null?n.timeoutMillis:r),concurrencyLimit:(a=(o=e.concurrencyLimit)==null?t.concurrencyLimit:o)==null?n.concurrencyLimit:a,compression:(s=(c=e.compression)==null?t.compression:c)==null?n.compression:s}}function jo(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:`none`}}z(),K();var Mo=class{constructor(e){R(this,`_concurrencyLimit`,void 0),R(this,`_sendingPromises`,[]),this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw Error(`Concurrency Limit reached`);this._sendingPromises.push(e);let t=()=>{let t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}awaitAll(){var e=this;return G(function*(){yield Promise.all(e._sendingPromises)})()}};function No(e){return new Mo(e.concurrencyLimit)}I();function Po(e){return Object.prototype.hasOwnProperty.call(e,`partialSuccess`)}function Fo(){return{handleResponse(e){e==null||!Po(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||P.warn(`Received Partial Success response:`,JSON.stringify(e.partialSuccess))}}}W(),I(),z(),K();var Io=class{constructor(e,t,n,r,i){R(this,`_diagLogger`,void 0),R(this,`_transport`,void 0),R(this,`_serializer`,void 0),R(this,`_responseHandler`,void 0),R(this,`_promiseQueue`,void 0),R(this,`_timeout`,void 0),this._transport=e,this._serializer=t,this._responseHandler=n,this._promiseQueue=r,this._timeout=i,this._diagLogger=P.createComponentLogger({namespace:`OTLPExportDelegate`})}export(e,t){if(this._diagLogger.debug(`items to be sent`,e),this._promiseQueue.hasReachedLimit()){t({code:fa.FAILED,error:Error(`Concurrent export limit reached`)});return}let n=this._serializer.serializeRequest(e);if(n==null){t({code:fa.FAILED,error:Error(`Nothing to send`)});return}this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(e=>{if(e.status===`success`){if(e.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(e.data))}catch(t){this._diagLogger.warn(`Export succeeded but could not deserialize response - is the response specification compliant?`,t,e.data)}t({code:fa.SUCCESS});return}else if(e.status===`failure`&&e.error){t({code:fa.FAILED,error:e.error});return}else if(e.status===`retryable`){var n;t({code:fa.FAILED,error:(n=e.error)==null?new Eo(`Export failed with retryable status`):n})}else t({code:fa.FAILED,error:new Eo(`Export failed with unknown error`)})},e=>t({code:fa.FAILED,error:e})))}forceFlush(){return this._promiseQueue.awaitAll()}shutdown(){var e=this;return G(function*(){e._diagLogger.debug(`shutdown started`),yield e.forceFlush(),e._transport.shutdown()})()}};function Lo(e,t){return new Io(e.transport,e.serializer,Fo(),e.promiseHandler,t.timeout)}function Ro(e,t,n){return Lo({transport:n,serializer:t,promiseHandler:No(e)},{timeout:e.timeoutMillis})}var zo;(function(e){e[e.DELTA=0]=`DELTA`,e[e.CUMULATIVE=1]=`CUMULATIVE`})(zo||(zo={}));var q;(function(e){e.COUNTER=`COUNTER`,e.GAUGE=`GAUGE`,e.HISTOGRAM=`HISTOGRAM`,e.UP_DOWN_COUNTER=`UP_DOWN_COUNTER`,e.OBSERVABLE_COUNTER=`OBSERVABLE_COUNTER`,e.OBSERVABLE_GAUGE=`OBSERVABLE_GAUGE`,e.OBSERVABLE_UP_DOWN_COUNTER=`OBSERVABLE_UP_DOWN_COUNTER`})(q||(q={}));var Bo;(function(e){e[e.HISTOGRAM=0]=`HISTOGRAM`,e[e.EXPONENTIAL_HISTOGRAM=1]=`EXPONENTIAL_HISTOGRAM`,e[e.GAUGE=2]=`GAUGE`,e[e.SUM=3]=`SUM`})(Bo||(Bo={}));function Vo(e){let t=Object.keys(e);return t.length===0?``:(t=t.sort(),JSON.stringify(t.map(t=>[t,e[t]])))}function Ho(e){var t,n;return`${e.name}:${(t=e.version)==null?``:t}:${(n=e.schemaUrl)==null?``:n}`}var Uo=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};function Wo(e,t){let n,r=new Promise(function(e,r){n=setTimeout(function(){r(new Uo(`Operation timed out.`))},t)});return Promise.race([e,r]).then(e=>(clearTimeout(n),e),e=>{throw clearTimeout(n),e})}function Go(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Ko(e,t){let n=0,r=e.length-1,i=e.length;for(;r>=n;){let a=n+Math.trunc((r-n)/2);e[a]<t?n=a+1:(i=a,r=a-1)}return i}function qo(e,t){return e.toLowerCase()===t.toLowerCase()}var Jo;(function(e){e[e.DROP=0]=`DROP`,e[e.SUM=1]=`SUM`,e[e.LAST_VALUE=2]=`LAST_VALUE`,e[e.HISTOGRAM=3]=`HISTOGRAM`,e[e.EXPONENTIAL_HISTOGRAM=4]=`EXPONENTIAL_HISTOGRAM`})(Jo||(Jo={})),z();var Yo=class{constructor(){R(this,`kind`,Jo.DROP)}createAccumulation(){}merge(e,t){}diff(e,t){}toMetricData(e,t,n,r){}};z();function Xo(e){let t=e.map(()=>0);return t.push(0),{buckets:{boundaries:e,counts:t},sum:0,count:0,hasMinMax:!1,min:1/0,max:-1/0}}var Zo=class{constructor(e,t,n=!0,r=Xo(t)){R(this,`startTime`,void 0),R(this,`_boundaries`,void 0),R(this,`_recordMinMax`,void 0),R(this,`_current`,void 0),this.startTime=e,this._boundaries=t,this._recordMinMax=n,this._current=r}record(e){if(Number.isNaN(e))return;this._current.count+=1,this._current.sum+=e,this._recordMinMax&&(this._current.min=Math.min(e,this._current.min),this._current.max=Math.max(e,this._current.max),this._current.hasMinMax=!0);let t=Ko(this._boundaries,e);this._current.buckets.counts[t]+=1}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},Qo=class{constructor(e,t){R(this,`kind`,Jo.HISTOGRAM),R(this,`_boundaries`,void 0),R(this,`_recordMinMax`,void 0),this._boundaries=e,this._recordMinMax=t}createAccumulation(e){return new Zo(e,this._boundaries,this._recordMinMax)}merge(e,t){let n=e.toPointValue(),r=t.toPointValue(),i=n.buckets.counts,a=r.buckets.counts,o=Array(i.length);for(let e=0;e<i.length;e++)o[e]=i[e]+a[e];let s=1/0,c=-1/0;return this._recordMinMax&&(n.hasMinMax&&r.hasMinMax?(s=Math.min(n.min,r.min),c=Math.max(n.max,r.max)):n.hasMinMax?(s=n.min,c=n.max):r.hasMinMax&&(s=r.min,c=r.max)),new Zo(e.startTime,n.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:n.buckets.boundaries,counts:o},count:n.count+r.count,sum:n.sum+r.sum,hasMinMax:this._recordMinMax&&(n.hasMinMax||r.hasMinMax),min:s,max:c})}diff(e,t){let n=e.toPointValue(),r=t.toPointValue(),i=n.buckets.counts,a=r.buckets.counts,o=Array(i.length);for(let e=0;e<i.length;e++)o[e]=a[e]-i[e];return new Zo(t.startTime,n.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:n.buckets.boundaries,counts:o},count:r.count-n.count,sum:r.sum-n.sum,hasMinMax:!1,min:1/0,max:-1/0})}toMetricData(e,t,n,r){return{descriptor:e,aggregationTemporality:t,dataPointType:Bo.HISTOGRAM,dataPoints:n.map(([t,n])=>{let i=n.toPointValue(),a=e.type===q.GAUGE||e.type===q.UP_DOWN_COUNTER||e.type===q.OBSERVABLE_GAUGE||e.type===q.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:t,startTime:n.startTime,endTime:r,value:{min:i.hasMinMax?i.min:void 0,max:i.hasMinMax?i.max:void 0,sum:a?void 0:i.sum,buckets:i.buckets,count:i.count}}})}}};z();var $o=class e{constructor(e=new es,t=0,n=0,r=0){R(this,`backing`,void 0),R(this,`indexBase`,void 0),R(this,`indexStart`,void 0),R(this,`indexEnd`,void 0),this.backing=e,this.indexBase=t,this.indexStart=n,this.indexEnd=r}get offset(){return this.indexStart}get length(){return this.backing.length===0||this.indexEnd===this.indexStart&&this.at(0)===0?0:this.indexEnd-this.indexStart+1}counts(){return Array.from({length:this.length},(e,t)=>this.at(t))}at(e){let t=this.indexBase-this.indexStart;return e<t&&(e+=this.backing.length),e-=t,this.backing.countAt(e)}incrementBucket(e,t){this.backing.increment(e,t)}decrementBucket(e,t){this.backing.decrement(e,t)}trim(){for(let e=0;e<this.length;e++)if(this.at(e)!==0){this.indexStart+=e;break}else if(e===this.length-1){this.indexStart=this.indexEnd=this.indexBase=0;return}for(let e=this.length-1;e>=0;e--)if(this.at(e)!==0){this.indexEnd-=this.length-e-1;break}this._rotate()}downscale(e){this._rotate();let t=1+this.indexEnd-this.indexStart,n=1<<e,r=0,i=0;for(let e=this.indexStart;e<=this.indexEnd;){let a=e%n;a<0&&(a+=n);for(let o=a;o<n&&r<t;o++)this._relocateBucket(i,r),r++,e++;i++}this.indexStart>>=e,this.indexEnd>>=e,this.indexBase=this.indexStart}clone(){return new e(this.backing.clone(),this.indexBase,this.indexStart,this.indexEnd)}_rotate(){let e=this.indexBase-this.indexStart;e!==0&&(e>0?(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,e),this.backing.reverse(e,this.backing.length)):(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,this.backing.length+e)),this.indexBase=this.indexStart)}_relocateBucket(e,t){e!==t&&this.incrementBucket(e,this.backing.emptyBucket(t))}},es=class e{constructor(e=[0]){R(this,`_counts`,void 0),this._counts=e}get length(){return this._counts.length}countAt(e){return this._counts[e]}growTo(e,t,n){let r=Array(e).fill(0);r.splice(n,this._counts.length-t,...this._counts.slice(t)),r.splice(0,t,...this._counts.slice(0,t)),this._counts=r}reverse(e,t){let n=Math.floor((e+t)/2)-e;for(let r=0;r<n;r++){let n=this._counts[e+r];this._counts[e+r]=this._counts[t-r-1],this._counts[t-r-1]=n}}emptyBucket(e){let t=this._counts[e];return this._counts[e]=0,t}increment(e,t){this._counts[e]+=t}decrement(e,t){this._counts[e]>=t?this._counts[e]-=t:this._counts[e]=0}clone(){return new e([...this._counts])}},ts=2146435072,ns=1048575,rs=1023,is=-rs+1,as=rs,os=Math.pow(2,-1022);function ss(e){let t=new DataView(new ArrayBuffer(8));return t.setFloat64(0,e),((t.getUint32(0)&ts)>>20)-rs}function cs(e){let t=new DataView(new ArrayBuffer(8));t.setFloat64(0,e);let n=t.getUint32(0),r=t.getUint32(4);return(n&ns)*Math.pow(2,32)+r}function ls(e,t){return e===0||e===1/0||e===-1/0||Number.isNaN(e)?e:e*Math.pow(2,t)}function us(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e++,e}var ds=class extends Error{};z();var fs=class{constructor(e){R(this,`_shift`,void 0),this._shift=-e}mapToIndex(e){return e<os?this._minNormalLowerBoundaryIndex():ss(e)+this._rightShift(cs(e)-1,52)>>this._shift}lowerBoundary(e){let t=this._minNormalLowerBoundaryIndex();if(e<t)throw new ds(`underflow: ${e} is < minimum lower boundary: ${t}`);let n=this._maxNormalLowerBoundaryIndex();if(e>n)throw new ds(`overflow: ${e} is > maximum lower boundary: ${n}`);return ls(1,e<<this._shift)}get scale(){return this._shift===0?0:-this._shift}_minNormalLowerBoundaryIndex(){let e=is>>this._shift;return this._shift<2&&e--,e}_maxNormalLowerBoundaryIndex(){return as>>this._shift}_rightShift(e,t){return Math.floor(e*Math.pow(2,-t))}};z();var ps=class{constructor(e){R(this,`_scale`,void 0),R(this,`_scaleFactor`,void 0),R(this,`_inverseFactor`,void 0),this._scale=e,this._scaleFactor=ls(Math.LOG2E,e),this._inverseFactor=ls(Math.LN2,-e)}mapToIndex(e){if(e<=os)return this._minNormalLowerBoundaryIndex()-1;if(cs(e)===0)return(ss(e)<<this._scale)-1;let t=Math.floor(Math.log(e)*this._scaleFactor),n=this._maxNormalLowerBoundaryIndex();return t>=n?n:t}lowerBoundary(e){let t=this._maxNormalLowerBoundaryIndex();if(e>=t){if(e===t)return 2*Math.exp((e-(1<<this._scale))/this._scaleFactor);throw new ds(`overflow: ${e} is > maximum lower boundary: ${t}`)}let n=this._minNormalLowerBoundaryIndex();if(e<=n){if(e===n)return os;if(e===n-1)return Math.exp((e+(1<<this._scale))/this._scaleFactor)/2;throw new ds(`overflow: ${e} is < minimum lower boundary: ${n}`)}return Math.exp(e*this._inverseFactor)}get scale(){return this._scale}_minNormalLowerBoundaryIndex(){return is<<this._scale}_maxNormalLowerBoundaryIndex(){return(as+1<<this._scale)-1}},ms=-10,hs=20,gs=Array.from({length:31},(e,t)=>t>10?new ps(t-10):new fs(t-10));function _s(e){if(e>hs||e<ms)throw new ds(`expected scale >= ${ms} && <= ${hs}, got: ${e}`);return gs[e+10]}I(),z();var vs=class e{static combine(t,n){return new e(Math.min(t.low,n.low),Math.max(t.high,n.high))}constructor(e,t){R(this,`low`,void 0),R(this,`high`,void 0),this.low=e,this.high=t}},ys=20,bs=160,xs=2,Ss=class e{constructor(e,t=bs,n=!0,r=0,i=0,a=0,o=1/0,s=-1/0,c=new $o,l=new $o,u=_s(ys)){R(this,`startTime`,void 0),R(this,`_maxSize`,void 0),R(this,`_recordMinMax`,void 0),R(this,`_sum`,void 0),R(this,`_count`,void 0),R(this,`_zeroCount`,void 0),R(this,`_min`,void 0),R(this,`_max`,void 0),R(this,`_positive`,void 0),R(this,`_negative`,void 0),R(this,`_mapping`,void 0),this.startTime=e,this._maxSize=t,this._recordMinMax=n,this._sum=r,this._count=i,this._zeroCount=a,this._min=o,this._max=s,this._positive=c,this._negative=l,this._mapping=u,this._maxSize<xs&&(P.warn(`Exponential Histogram Max Size set to ${this._maxSize}, \
3
+ changing to the minimum size of: ${xs}`),this._maxSize=xs)}record(e){this.updateByIncrement(e,1)}setStartTime(e){this.startTime=e}toPointValue(){return{hasMinMax:this._recordMinMax,min:this.min,max:this.max,sum:this.sum,positive:{offset:this.positive.offset,bucketCounts:this.positive.counts()},negative:{offset:this.negative.offset,bucketCounts:this.negative.counts()},count:this.count,scale:this.scale,zeroCount:this.zeroCount}}get sum(){return this._sum}get min(){return this._min}get max(){return this._max}get count(){return this._count}get zeroCount(){return this._zeroCount}get scale(){return this._count===this._zeroCount?0:this._mapping.scale}get positive(){return this._positive}get negative(){return this._negative}updateByIncrement(e,t){if(!Number.isNaN(e)){if(e>this._max&&(this._max=e),e<this._min&&(this._min=e),this._count+=t,e===0){this._zeroCount+=t;return}this._sum+=e*t,e>0?this._updateBuckets(this._positive,e,t):this._updateBuckets(this._negative,-e,t)}}merge(e){this._count===0?(this._min=e.min,this._max=e.max):e.count!==0&&(e.min<this.min&&(this._min=e.min),e.max>this.max&&(this._max=e.max)),this.startTime=e.startTime,this._sum+=e.sum,this._count+=e.count,this._zeroCount+=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._mergeBuckets(this.positive,e,e.positive,t),this._mergeBuckets(this.negative,e,e.negative,t)}diff(e){this._min=1/0,this._max=-1/0,this._sum-=e.sum,this._count-=e.count,this._zeroCount-=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._diffBuckets(this.positive,e,e.positive,t),this._diffBuckets(this.negative,e,e.negative,t)}clone(){return new e(this.startTime,this._maxSize,this._recordMinMax,this._sum,this._count,this._zeroCount,this._min,this._max,this.positive.clone(),this.negative.clone(),this._mapping)}_updateBuckets(e,t,n){let r=this._mapping.mapToIndex(t),i=!1,a=0,o=0;if(e.length===0?(e.indexStart=r,e.indexEnd=e.indexStart,e.indexBase=e.indexStart):r<e.indexStart&&e.indexEnd-r>=this._maxSize?(i=!0,o=r,a=e.indexEnd):r>e.indexEnd&&r-e.indexStart>=this._maxSize&&(i=!0,o=e.indexStart,a=r),i){let e=this._changeScale(a,o);this._downscale(e),r=this._mapping.mapToIndex(t)}this._incrementIndexBy(e,r,n)}_incrementIndexBy(e,t,n){if(n===0)return;if(e.length===0&&(e.indexStart=e.indexEnd=e.indexBase=t),t<e.indexStart){let n=e.indexEnd-t;n>=e.backing.length&&this._grow(e,n+1),e.indexStart=t}else if(t>e.indexEnd){let n=t-e.indexStart;n>=e.backing.length&&this._grow(e,n+1),e.indexEnd=t}let r=t-e.indexBase;r<0&&(r+=e.backing.length),e.incrementBucket(r,n)}_grow(e,t){let n=e.backing.length,r=e.indexBase-e.indexStart,i=n-r,a=us(t);a>this._maxSize&&(a=this._maxSize);let o=a-r;e.backing.growTo(a,i,o)}_changeScale(e,t){let n=0;for(;e-t>=this._maxSize;)e>>=1,t>>=1,n++;return n}_downscale(e){if(e===0)return;if(e<0)throw Error(`impossible change of scale: ${this.scale}`);let t=this._mapping.scale-e;this._positive.downscale(e),this._negative.downscale(e),this._mapping=_s(t)}_minScale(e){let t=Math.min(this.scale,e.scale),n=vs.combine(this._highLowAtScale(this.positive,this.scale,t),this._highLowAtScale(e.positive,e.scale,t)),r=vs.combine(this._highLowAtScale(this.negative,this.scale,t),this._highLowAtScale(e.negative,e.scale,t));return Math.min(t-this._changeScale(n.high,n.low),t-this._changeScale(r.high,r.low))}_highLowAtScale(e,t,n){if(e.length===0)return new vs(0,-1);let r=t-n;return new vs(e.indexStart>>r,e.indexEnd>>r)}_mergeBuckets(e,t,n,r){let i=n.offset,a=t.scale-r;for(let t=0;t<n.length;t++)this._incrementIndexBy(e,i+t>>a,n.at(t))}_diffBuckets(e,t,n,r){let i=n.offset,a=t.scale-r;for(let t=0;t<n.length;t++){let r=(i+t>>a)-e.indexBase;r<0&&(r+=e.backing.length),e.decrementBucket(r,n.at(t))}e.trim()}},Cs=class{constructor(e,t){R(this,`kind`,Jo.EXPONENTIAL_HISTOGRAM),R(this,`_maxSize`,void 0),R(this,`_recordMinMax`,void 0),this._maxSize=e,this._recordMinMax=t}createAccumulation(e){return new Ss(e,this._maxSize,this._recordMinMax)}merge(e,t){let n=t.clone();return n.merge(e),n}diff(e,t){let n=t.clone();return n.diff(e),n}toMetricData(e,t,n,r){return{descriptor:e,aggregationTemporality:t,dataPointType:Bo.EXPONENTIAL_HISTOGRAM,dataPoints:n.map(([t,n])=>{let i=n.toPointValue(),a=e.type===q.GAUGE||e.type===q.UP_DOWN_COUNTER||e.type===q.OBSERVABLE_GAUGE||e.type===q.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:t,startTime:n.startTime,endTime:r,value:{min:i.hasMinMax?i.min:void 0,max:i.hasMinMax?i.max:void 0,sum:a?void 0:i.sum,positive:{offset:i.positive.offset,bucketCounts:i.positive.bucketCounts},negative:{offset:i.negative.offset,bucketCounts:i.negative.bucketCounts},count:i.count,scale:i.scale,zeroCount:i.zeroCount}}})}}};W(),z();var ws=class{constructor(e,t=0,n=[0,0]){R(this,`startTime`,void 0),R(this,`_current`,void 0),R(this,`sampleTime`,void 0),this.startTime=e,this._current=t,this.sampleTime=n}record(e){this._current=e,this.sampleTime=$i(Date.now())}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},Ts=class{constructor(){R(this,`kind`,Jo.LAST_VALUE)}createAccumulation(e){return new ws(e)}merge(e,t){let n=ia(t.sampleTime)>=ia(e.sampleTime)?t:e;return new ws(e.startTime,n.toPointValue(),n.sampleTime)}diff(e,t){let n=ia(t.sampleTime)>=ia(e.sampleTime)?t:e;return new ws(t.startTime,n.toPointValue(),n.sampleTime)}toMetricData(e,t,n,r){return{descriptor:e,aggregationTemporality:t,dataPointType:Bo.GAUGE,dataPoints:n.map(([e,t])=>({attributes:e,startTime:t.startTime,endTime:r,value:t.toPointValue()}))}}};z();var Es=class{constructor(e,t,n=0,r=!1){R(this,`startTime`,void 0),R(this,`monotonic`,void 0),R(this,`_current`,void 0),R(this,`reset`,void 0),this.startTime=e,this.monotonic=t,this._current=n,this.reset=r}record(e){this.monotonic&&e<0||(this._current+=e)}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},Ds=class{constructor(e){R(this,`kind`,Jo.SUM),R(this,`monotonic`,void 0),this.monotonic=e}createAccumulation(e){return new Es(e,this.monotonic)}merge(e,t){let n=e.toPointValue(),r=t.toPointValue();return t.reset?new Es(t.startTime,this.monotonic,r,t.reset):new Es(e.startTime,this.monotonic,n+r)}diff(e,t){let n=e.toPointValue(),r=t.toPointValue();return this.monotonic&&n>r?new Es(t.startTime,this.monotonic,r,!0):new Es(t.startTime,this.monotonic,r-n)}toMetricData(e,t,n,r){return{descriptor:e,aggregationTemporality:t,dataPointType:Bo.SUM,dataPoints:n.map(([e,t])=>({attributes:e,startTime:t.startTime,endTime:r,value:t.toPointValue()})),isMonotonic:this.monotonic}}};I(),z();var Os=class e{createAggregator(t){return e.DEFAULT_INSTANCE}};R(Os,`DEFAULT_INSTANCE`,new Yo);var ks=class e{createAggregator(t){switch(t.type){case q.COUNTER:case q.OBSERVABLE_COUNTER:case q.HISTOGRAM:return e.MONOTONIC_INSTANCE;default:return e.NON_MONOTONIC_INSTANCE}}};R(ks,`MONOTONIC_INSTANCE`,new Ds(!0)),R(ks,`NON_MONOTONIC_INSTANCE`,new Ds(!1));var As=class e{createAggregator(t){return e.DEFAULT_INSTANCE}};R(As,`DEFAULT_INSTANCE`,new Ts);var js=class e{createAggregator(t){return e.DEFAULT_INSTANCE}};R(js,`DEFAULT_INSTANCE`,new Qo([0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4],!0));var Ms=class{constructor(e,t=!0){if(R(this,`_boundaries`,void 0),R(this,`_recordMinMax`,void 0),e==null)throw Error(`ExplicitBucketHistogramAggregation should be created with explicit boundaries, if a single bucket histogram is required, please pass an empty array`);e=e.concat(),e=e.sort((e,t)=>e-t);let n=e.lastIndexOf(-1/0),r=e.indexOf(1/0);r===-1&&(r=void 0),this._boundaries=e.slice(n+1,r),this._recordMinMax=t}createAggregator(e){return new Qo(this._boundaries,this._recordMinMax)}},Ns=class{constructor(e=160,t=!0){R(this,`_maxSize`,void 0),R(this,`_recordMinMax`,void 0),this._maxSize=e,this._recordMinMax=t}createAggregator(e){return new Cs(this._maxSize,this._recordMinMax)}},Ps=class{_resolve(e){switch(e.type){case q.COUNTER:case q.UP_DOWN_COUNTER:case q.OBSERVABLE_COUNTER:case q.OBSERVABLE_UP_DOWN_COUNTER:return Is;case q.GAUGE:case q.OBSERVABLE_GAUGE:return Ls;case q.HISTOGRAM:return e.advice.explicitBucketBoundaries?new Ms(e.advice.explicitBucketBoundaries):Rs}return P.warn(`Unable to recognize instrument type: ${e.type}`),Fs}createAggregator(e){return this._resolve(e).createAggregator(e)}},Fs=new Os,Is=new ks,Ls=new As,Rs=new js;new Ns;var zs=new Ps,Bs;(function(e){e[e.DEFAULT=0]=`DEFAULT`,e[e.DROP=1]=`DROP`,e[e.SUM=2]=`SUM`,e[e.LAST_VALUE=3]=`LAST_VALUE`,e[e.EXPLICIT_BUCKET_HISTOGRAM=4]=`EXPLICIT_BUCKET_HISTOGRAM`,e[e.EXPONENTIAL_HISTOGRAM=5]=`EXPONENTIAL_HISTOGRAM`})(Bs||(Bs={}));function Vs(e){switch(e.type){case Bs.DEFAULT:return zs;case Bs.DROP:return Fs;case Bs.SUM:return Is;case Bs.LAST_VALUE:return Ls;case Bs.EXPONENTIAL_HISTOGRAM:{var t,n;let r=e;return new Ns((t=r.options)==null?void 0:t.maxSize,(n=r.options)==null?void 0:n.recordMinMax)}case Bs.EXPLICIT_BUCKET_HISTOGRAM:{let t=e;if(t.options==null)return Rs;var r,i;return new Ms((r=t.options)==null?void 0:r.boundaries,(i=t.options)==null?void 0:i.recordMinMax)}default:throw Error(`Unsupported Aggregation`)}}var Hs=e=>({type:Bs.DEFAULT}),Us=e=>zo.CUMULATIVE;I(),z(),K();var Ws=class{constructor(e){var t,n,r;R(this,`_shutdown`,!1),R(this,`_metricProducers`,void 0),R(this,`_sdkMetricProducer`,void 0),R(this,`_aggregationTemporalitySelector`,void 0),R(this,`_aggregationSelector`,void 0),R(this,`_cardinalitySelector`,void 0),this._aggregationSelector=(t=e==null?void 0:e.aggregationSelector)==null?Hs:t,this._aggregationTemporalitySelector=(n=e==null?void 0:e.aggregationTemporalitySelector)==null?Us:n,this._metricProducers=(r=e==null?void 0:e.metricProducers)==null?[]:r,this._cardinalitySelector=e==null?void 0:e.cardinalitySelector}setMetricProducer(e){if(this._sdkMetricProducer)throw Error(`MetricReader can not be bound to a MeterProvider again.`);this._sdkMetricProducer=e,this.onInitialized()}selectAggregation(e){return this._aggregationSelector(e)}selectAggregationTemporality(e){return this._aggregationTemporalitySelector(e)}selectCardinalityLimit(e){return this._cardinalitySelector?this._cardinalitySelector(e):2e3}onInitialized(){}collect(e){var t=this;return G(function*(){if(t._sdkMetricProducer===void 0)throw Error(`MetricReader is not bound to a MetricProducer`);if(t._shutdown)throw Error(`MetricReader is shutdown`);let[n,...r]=yield Promise.all([t._sdkMetricProducer.collect({timeoutMillis:e==null?void 0:e.timeoutMillis}),...t._metricProducers.map(t=>t.collect({timeoutMillis:e==null?void 0:e.timeoutMillis}))]),i=n.errors.concat(r.flatMap(e=>e.errors));return{resourceMetrics:{resource:n.resourceMetrics.resource,scopeMetrics:n.resourceMetrics.scopeMetrics.concat(r.flatMap(e=>e.resourceMetrics.scopeMetrics))},errors:i}})()}shutdown(e){var t=this;return G(function*(){if(t._shutdown){P.error(`Cannot call shutdown twice.`);return}(e==null?void 0:e.timeoutMillis)==null?yield t.onShutdown():yield Wo(t.onShutdown(),e.timeoutMillis),t._shutdown=!0})()}forceFlush(e){var t=this;return G(function*(){if(t._shutdown){P.warn(`Cannot forceFlush on already shutdown MetricReader.`);return}if((e==null?void 0:e.timeoutMillis)==null){yield t.onForceFlush();return}yield Wo(t.onForceFlush(),e.timeoutMillis)})()}};function Gs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function J(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Gs(Object(n),!0).forEach(function(t){R(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gs(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Y=t((()=>{z()}));I(),W(),z(),Y(),K();var Ks=class extends Ws{constructor(e){var t,n;let{exporter:r,exportIntervalMillis:i=6e4,metricProducers:a,cardinalityLimits:o}=e,{exportTimeoutMillis:s=3e4}=e;if(super({aggregationSelector:(t=r.selectAggregation)==null?void 0:t.bind(r),aggregationTemporalitySelector:(n=r.selectAggregationTemporality)==null?void 0:n.bind(r),metricProducers:a,cardinalitySelector:e=>{let t=J({default:2e3},o);switch(e){case q.COUNTER:var n;return(n=t.counter)==null?t.default:n;case q.GAUGE:var r;return(r=t.gauge)==null?t.default:r;case q.HISTOGRAM:var i;return(i=t.histogram)==null?t.default:i;case q.OBSERVABLE_COUNTER:var a;return(a=t.observableCounter)==null?t.default:a;case q.OBSERVABLE_UP_DOWN_COUNTER:var s;return(s=t.observableUpDownCounter)==null?t.default:s;case q.OBSERVABLE_GAUGE:var c;return(c=t.observableGauge)==null?t.default:c;case q.UP_DOWN_COUNTER:var l;return(l=t.upDownCounter)==null?t.default:l;default:return t.default}}}),R(this,`_interval`,void 0),R(this,`_exporter`,void 0),R(this,`_exportInterval`,void 0),R(this,`_exportTimeout`,void 0),i<=0)throw Error(`exportIntervalMillis must be greater than 0`);if(s<=0)throw Error(`exportTimeoutMillis must be greater than 0`);if(i<s){if(`exportIntervalMillis`in e&&`exportTimeoutMillis`in e)throw Error(`exportIntervalMillis must be greater than or equal to exportTimeoutMillis`);P.info(`Timeout of ${s} exceeds the interval of ${i}. Clamping timeout to interval duration.`),s=i}this._exportInterval=i,this._exportTimeout=s,this._exporter=r}_runOnce(){var e=this;return G(function*(){try{yield Wo(e._doRun(),e._exportTimeout)}catch(t){if(t instanceof Uo){P.error(`Export took longer than %s milliseconds and timed out.`,e._exportTimeout);return}vi(t)}})()}_doRun(){var e=this;return G(function*(){let{resourceMetrics:t,errors:n}=yield e.collect({timeoutMillis:e._exportTimeout});if(n.length>0&&P.error(`PeriodicExportingMetricReader: metrics collection errors`,...n),t.resource.asyncAttributesPending)try{var r,i;yield(r=(i=t.resource).waitForAsyncAttributes)==null?void 0:r.call(i)}catch(e){P.debug(`Error while resolving async portion of resource: `,e),vi(e)}if(t.scopeMetrics.length===0)return;let a=yield wo._export(e._exporter,t);if(a.code!==fa.SUCCESS)throw Error(`PeriodicExportingMetricReader: metrics export failed (error ${a.error})`)})()}onInitialized(){this._interval=setInterval(()=>{this._runOnce()},this._exportInterval),typeof this._interval!=`number`&&this._interval.unref()}onForceFlush(){var e=this;return G(function*(){yield e._runOnce(),yield e._exporter.forceFlush()})()}onShutdown(){var e=this;return G(function*(){e._interval&&clearInterval(e._interval),yield e.onForceFlush(),yield e._exporter.shutdown()})()}};function qs(){if(Js===void 0)try{let e=globalThis.process.argv0;Js=e?`unknown_service:${e}`:`unknown_service`}catch(e){Js=`unknown_service`}return Js}var Js,Ys=t((()=>{})),Xs,Zs=t((()=>{Xs=e=>typeof e==`object`&&!!e&&typeof e.then==`function`}));function Qs(e,t){return rc.FromAttributeList(Object.entries(e),t)}function $s(){return Qs({[Li]:qs(),[Ri]:Xi[Ri],[Bi]:Xi[Bi],[Vi]:Xi[Vi]})}function ec(e){return e.map(([e,t])=>Xs(t)?[e,t.catch(t=>{P.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function tc(e){if(typeof e==`string`||e===void 0)return e;P.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function nc(e,t){let n=e==null?void 0:e.schemaUrl,r=t==null?void 0:t.schemaUrl,i=n===void 0||n===``,a=r===void 0||r===``;if(i)return r;if(a||n===r)return n;P.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,n,r)}var rc,ic=t((()=>{I(),W(),qi(),Ys(),Zs(),z(),K(),rc=class e{static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=ec(t),r._asyncAttributesPending=t.filter(([e,t])=>Xs(t)).length>0,r}constructor(e,t){var n;R(this,`_rawAttributes`,void 0),R(this,`_asyncAttributesPending`,!1),R(this,`_schemaUrl`,void 0),R(this,`_memoizedAttributes`,void 0);let r=(n=e.attributes)==null?{}:n;this._rawAttributes=Object.entries(r).map(([e,t])=>(Xs(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=ec(this._rawAttributes),this._schemaUrl=tc(t==null?void 0:t.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}waitForAsyncAttributes(){var e=this;return G(function*(){if(e.asyncAttributesPending){for(let t=0;t<e._rawAttributes.length;t++){let[n,r]=e._rawAttributes[t];e._rawAttributes[t]=[n,Xs(r)?yield r:r]}e._asyncAttributesPending=!1}})()}get attributes(){if(this.asyncAttributesPending&&P.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,n]of this._rawAttributes){if(Xs(n)){P.debug(`Unsettled resource attribute ${t} skipped`);continue}n!=null&&(e[t]!=null||(e[t]=n))}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let n=nc(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}}})),ac=t((()=>{I(),ic(),qi(),W(),z(),Ys()}));z();var oc=class{constructor(){R(this,`_registeredViews`,[])}addView(e){this._registeredViews.push(e)}findViews(e,t){return this._registeredViews.filter(n=>this._matchInstrument(n.instrumentSelector,e)&&this._matchMeter(n.meterSelector,t))}_matchInstrument(e,t){return(e.getType()===void 0||t.type===e.getType())&&e.getNameFilter().match(t.name)&&e.getUnitFilter().match(t.unit)}_matchMeter(e,t){return e.getNameFilter().match(t.name)&&(t.version===void 0||e.getVersionFilter().match(t.version))&&(t.schemaUrl===void 0||e.getSchemaUrlFilter().match(t.schemaUrl))}};I();function sc(e,t,n){var r,i,a,o;return dc(e)||P.warn(`Invalid metric name: "${e}". The metric name should be a ASCII string with a length no greater than 255 characters.`),{name:e,type:t,description:(r=n==null?void 0:n.description)==null?``:r,unit:(i=n==null?void 0:n.unit)==null?``:i,valueType:(a=n==null?void 0:n.valueType)==null?Ee.DOUBLE:a,advice:(o=n==null?void 0:n.advice)==null?{}:o}}function cc(e,t){var n,r;return{name:(n=e.name)==null?t.name:n,description:(r=e.description)==null?t.description:r,type:t.type,unit:t.unit,valueType:t.valueType,advice:t.advice}}function lc(e,t){return qo(e.name,t.name)&&e.unit===t.unit&&e.type===t.type&&e.valueType===t.valueType}var uc=/^[a-z][a-z0-9_.\-/]{0,254}$/i;function dc(e){return uc.test(e)}I(),W(),z();var fc=class{constructor(e,t){R(this,`_writableMetricStorage`,void 0),R(this,`_descriptor`,void 0),this._writableMetricStorage=e,this._descriptor=t}_record(e,t={},n=N.active()){if(typeof e!=`number`){P.warn(`non-number value provided to metric ${this._descriptor.name}: ${e}`);return}this._descriptor.valueType===Ee.INT&&!Number.isInteger(e)&&(P.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._writableMetricStorage.record(e,t,n,$i(Date.now()))}},pc=class extends fc{add(e,t,n){this._record(e,t,n)}},mc=class extends fc{add(e,t,n){if(e<0){P.warn(`negative value provided to counter ${this._descriptor.name}: ${e}`);return}this._record(e,t,n)}},hc=class extends fc{record(e,t,n){this._record(e,t,n)}},gc=class extends fc{record(e,t,n){if(e<0){P.warn(`negative value provided to histogram ${this._descriptor.name}: ${e}`);return}this._record(e,t,n)}},_c=class{constructor(e,t,n){R(this,`_metricStorages`,void 0),R(this,`_descriptor`,void 0),R(this,`_observableRegistry`,void 0),this._descriptor=e,this._metricStorages=t,this._observableRegistry=n}addCallback(e){this._observableRegistry.addCallback(e,this)}removeCallback(e){this._observableRegistry.removeCallback(e,this)}},vc=class extends _c{},yc=class extends _c{},bc=class extends _c{};function xc(e){return e instanceof _c}z();var Sc=class{constructor(e){R(this,`_meterSharedState`,void 0),this._meterSharedState=e}createGauge(e,t){let n=sc(e,q.GAUGE,t);return new hc(this._meterSharedState.registerMetricStorage(n),n)}createHistogram(e,t){let n=sc(e,q.HISTOGRAM,t);return new gc(this._meterSharedState.registerMetricStorage(n),n)}createCounter(e,t){let n=sc(e,q.COUNTER,t);return new mc(this._meterSharedState.registerMetricStorage(n),n)}createUpDownCounter(e,t){let n=sc(e,q.UP_DOWN_COUNTER,t);return new pc(this._meterSharedState.registerMetricStorage(n),n)}createObservableGauge(e,t){let n=sc(e,q.OBSERVABLE_GAUGE,t);return new yc(n,this._meterSharedState.registerAsyncMetricStorage(n),this._meterSharedState.observableRegistry)}createObservableCounter(e,t){let n=sc(e,q.OBSERVABLE_COUNTER,t);return new vc(n,this._meterSharedState.registerAsyncMetricStorage(n),this._meterSharedState.observableRegistry)}createObservableUpDownCounter(e,t){let n=sc(e,q.OBSERVABLE_UP_DOWN_COUNTER,t);return new bc(n,this._meterSharedState.registerAsyncMetricStorage(n),this._meterSharedState.observableRegistry)}addBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.addBatchCallback(e,t)}removeBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.removeBatchCallback(e,t)}};z();var Cc=class{constructor(e){R(this,`_instrumentDescriptor`,void 0),this._instrumentDescriptor=e}getInstrumentDescriptor(){return this._instrumentDescriptor}updateDescription(e){this._instrumentDescriptor=sc(this._instrumentDescriptor.name,this._instrumentDescriptor.type,{description:e,valueType:this._instrumentDescriptor.valueType,unit:this._instrumentDescriptor.unit,advice:this._instrumentDescriptor.advice})}};z();var wc=class{constructor(e){R(this,`_valueMap`,new Map),R(this,`_keyMap`,new Map),R(this,`_hash`,void 0),this._hash=e}get(e,t){return t!=null||(t=this._hash(e)),this._valueMap.get(t)}getOrDefault(e,t){let n=this._hash(e);if(this._valueMap.has(n))return this._valueMap.get(n);let r=t();return this._keyMap.has(n)||this._keyMap.set(n,e),this._valueMap.set(n,r),r}set(e,t,n){n!=null||(n=this._hash(e)),this._keyMap.has(n)||this._keyMap.set(n,e),this._valueMap.set(n,t)}has(e,t){return t!=null||(t=this._hash(e)),this._valueMap.has(t)}*keys(){let e=this._keyMap.entries(),t=e.next();for(;t.done!==!0;)yield[t.value[1],t.value[0]],t=e.next()}*entries(){let e=this._valueMap.entries(),t=e.next();for(;t.done!==!0;)yield[this._keyMap.get(t.value[0]),t.value[1],t.value[0]],t=e.next()}get size(){return this._valueMap.size}},Tc=class extends wc{constructor(){super(Vo)}};z();var Ec=class{constructor(e,t){R(this,`_activeCollectionStorage`,new Tc),R(this,`_cumulativeMemoStorage`,new Tc),R(this,`_cardinalityLimit`,void 0),R(this,`_overflowAttributes`,{"otel.metric.overflow":!0}),R(this,`_overflowHashCode`,void 0),R(this,`_aggregator`,void 0),this._aggregator=e,this._cardinalityLimit=(t==null?2e3:t)-1,this._overflowHashCode=Vo(this._overflowAttributes)}record(e,t,n,r){let i=this._activeCollectionStorage.get(t);if(!i){if(this._activeCollectionStorage.size>=this._cardinalityLimit){let t=this._activeCollectionStorage.getOrDefault(this._overflowAttributes,()=>this._aggregator.createAccumulation(r));t==null||t.record(e);return}i=this._aggregator.createAccumulation(r),this._activeCollectionStorage.set(t,i)}i==null||i.record(e)}batchCumulate(e,t){for(let[n,r,i]of e.entries()){let e=n,a=i,o=this._aggregator.createAccumulation(t);o==null||o.record(r);let s=o;if(this._cumulativeMemoStorage.has(e,a)){let t=this._cumulativeMemoStorage.get(e,a);s=this._aggregator.diff(t,o)}else if(this._cumulativeMemoStorage.size>=this._cardinalityLimit&&(e=this._overflowAttributes,a=this._overflowHashCode,this._cumulativeMemoStorage.has(e,a))){let t=this._cumulativeMemoStorage.get(e,a);s=this._aggregator.diff(t,o)}if(this._activeCollectionStorage.has(e,a)){let t=this._activeCollectionStorage.get(e,a);s=this._aggregator.merge(t,s)}this._cumulativeMemoStorage.set(e,o,a),this._activeCollectionStorage.set(e,s,a)}}collect(){let e=this._activeCollectionStorage;return this._activeCollectionStorage=new Tc,e}};z();var Dc=class e{constructor(e,t){R(this,`_aggregator`,void 0),R(this,`_unreportedAccumulations`,new Map),R(this,`_reportHistory`,new Map),this._aggregator=e,t.forEach(e=>{this._unreportedAccumulations.set(e,[])})}buildMetrics(t,n,r,i){this._stashAccumulations(r);let a=this._getMergedUnreportedAccumulations(t),o=a,s;if(this._reportHistory.has(t)){let n=this._reportHistory.get(t),r=n.collectionTime;s=n.aggregationTemporality,o=s===zo.CUMULATIVE?e.merge(n.accumulations,a,this._aggregator):e.calibrateStartTime(n.accumulations,a,r)}else s=t.selectAggregationTemporality(n.type);this._reportHistory.set(t,{accumulations:o,collectionTime:i,aggregationTemporality:s});let c=Oc(o);if(c.length!==0)return this._aggregator.toMetricData(n,s,c,i)}_stashAccumulations(e){let t=this._unreportedAccumulations.keys();for(let n of t){let t=this._unreportedAccumulations.get(n);t===void 0&&(t=[],this._unreportedAccumulations.set(n,t)),t.push(e)}}_getMergedUnreportedAccumulations(t){let n=new Tc,r=this._unreportedAccumulations.get(t);if(this._unreportedAccumulations.set(t,[]),r===void 0)return n;for(let t of r)n=e.merge(n,t,this._aggregator);return n}static merge(e,t,n){let r=e,i=t.entries(),a=i.next();for(;a.done!==!0;){let[t,o,s]=a.value;if(e.has(t,s)){let i=e.get(t,s),a=n.merge(i,o);r.set(t,a,s)}else r.set(t,o,s);a=i.next()}return r}static calibrateStartTime(e,t,n){for(let[r,i]of e.keys()){let e=t.get(r,i);e==null||e.setStartTime(n)}return t}};function Oc(e){return Array.from(e.entries())}z();var kc=class extends Cc{constructor(e,t,n,r,i){super(e),R(this,`_aggregationCardinalityLimit`,void 0),R(this,`_deltaMetricStorage`,void 0),R(this,`_temporalMetricStorage`,void 0),R(this,`_attributesProcessor`,void 0),this._aggregationCardinalityLimit=i,this._deltaMetricStorage=new Ec(t,this._aggregationCardinalityLimit),this._temporalMetricStorage=new Dc(t,r),this._attributesProcessor=n}record(e,t){let n=new Tc;for(let[t,r]of e.entries())n.set(this._attributesProcessor.process(t),r);this._deltaMetricStorage.batchCumulate(n,t)}collect(e,t){let n=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,n,t)}};function Ac(e,t){let n=``;return e.unit!==t.unit&&(n+=`\t- Unit '${e.unit}' does not match '${t.unit}'\n`),e.type!==t.type&&(n+=`\t- Type '${e.type}' does not match '${t.type}'\n`),e.valueType!==t.valueType&&(n+=`\t- Value Type '${e.valueType}' does not match '${t.valueType}'\n`),e.description!==t.description&&(n+=`\t- Description '${e.description}' does not match '${t.description}'\n`),n}function jc(e,t){return`\t- use valueType '${e.valueType}' on instrument creation or use an instrument name other than '${t.name}'`}function Mc(e,t){return`\t- use unit '${e.unit}' on instrument creation or use an instrument name other than '${t.name}'`}function Nc(e,t){let n={name:t.name,type:t.type,unit:t.unit},r=JSON.stringify(n);return`\t- create a new view with a name other than '${e.name}' and InstrumentSelector '${r}'`}function Pc(e,t){let n={name:t.name,type:t.type,unit:t.unit},r=JSON.stringify(n);return`\t- create a new view with a name other than '${e.name}' and InstrumentSelector '${r}'
4
4
  \t- OR - create a new view with the name ${e.name} and description '${e.description}' and InstrumentSelector ${r}
5
- \t- OR - create a new view with the name ${t.name} and description '${e.description}' and InstrumentSelector ${r}`}function zc(e,t){return e.valueType===t.valueType?e.unit===t.unit?e.type===t.type?e.description===t.description?``:Rc(e,t):Lc(e,t):Ic(e,t):Fc(e,t)}B(),d();var Bc=class e{constructor(){u(this,`_sharedRegistry`,new Map),u(this,`_perCollectorRegistry`,new Map)}static create(){return new e}getStorages(e){let t=[];for(let e of this._sharedRegistry.values())t=t.concat(e);let n=this._perCollectorRegistry.get(e);if(n!=null)for(let e of n.values())t=t.concat(e);return t}register(e){this._registerStorage(e,this._sharedRegistry)}registerForCollector(e,t){let n=this._perCollectorRegistry.get(e);n==null&&(n=new Map,this._perCollectorRegistry.set(e,n)),this._registerStorage(t,n)}findOrUpdateCompatibleStorage(e){let t=this._sharedRegistry.get(e.name);return t===void 0?null:this._findOrUpdateCompatibleStorage(e,t)}findOrUpdateCompatibleCollectorStorage(e,t){let n=this._perCollectorRegistry.get(e);if(n===void 0)return null;let r=n.get(t.name);return r===void 0?null:this._findOrUpdateCompatibleStorage(t,r)}_registerStorage(e,t){let n=e.getInstrumentDescriptor(),r=t.get(n.name);if(r===void 0){t.set(n.name,[e]);return}r.push(e)}_findOrUpdateCompatibleStorage(e,t){let n=null;for(let r of t){let t=r.getInstrumentDescriptor();pc(t,e)?(t.description!==e.description&&(e.description.length>t.description.length&&r.updateDescription(e.description),R.warn(`A view or instrument with the name `,e.name,` has already been registered, but has a different description and is incompatible with another registered view.
5
+ \t- OR - create a new view with the name ${t.name} and description '${e.description}' and InstrumentSelector ${r}`}function Fc(e,t){return e.valueType===t.valueType?e.unit===t.unit?e.type===t.type?e.description===t.description?``:Pc(e,t):Nc(e,t):Mc(e,t):jc(e,t)}I(),z();var Ic=class e{constructor(){R(this,`_sharedRegistry`,new Map),R(this,`_perCollectorRegistry`,new Map)}static create(){return new e}getStorages(e){let t=[];for(let e of this._sharedRegistry.values())t=t.concat(e);let n=this._perCollectorRegistry.get(e);if(n!=null)for(let e of n.values())t=t.concat(e);return t}register(e){this._registerStorage(e,this._sharedRegistry)}registerForCollector(e,t){let n=this._perCollectorRegistry.get(e);n==null&&(n=new Map,this._perCollectorRegistry.set(e,n)),this._registerStorage(t,n)}findOrUpdateCompatibleStorage(e){let t=this._sharedRegistry.get(e.name);return t===void 0?null:this._findOrUpdateCompatibleStorage(e,t)}findOrUpdateCompatibleCollectorStorage(e,t){let n=this._perCollectorRegistry.get(e);if(n===void 0)return null;let r=n.get(t.name);return r===void 0?null:this._findOrUpdateCompatibleStorage(t,r)}_registerStorage(e,t){let n=e.getInstrumentDescriptor(),r=t.get(n.name);if(r===void 0){t.set(n.name,[e]);return}r.push(e)}_findOrUpdateCompatibleStorage(e,t){let n=null;for(let r of t){let t=r.getInstrumentDescriptor();lc(t,e)?(t.description!==e.description&&(e.description.length>t.description.length&&r.updateDescription(e.description),P.warn(`A view or instrument with the name `,e.name,` has already been registered, but has a different description and is incompatible with another registered view.
6
6
  `,`Details:
7
- `,Pc(t,e),`The longer description will be used.
8
- To resolve the conflict:`,zc(t,e))),n=r):R.warn(`A view or instrument with the name `,e.name,` has already been registered and is incompatible with another registered view.
7
+ `,Ac(t,e),`The longer description will be used.
8
+ To resolve the conflict:`,Fc(t,e))),n=r):P.warn(`A view or instrument with the name `,e.name,` has already been registered and is incompatible with another registered view.
9
9
  `,`Details:
10
- `,Pc(t,e),`To resolve the conflict:
11
- `,zc(t,e))}return n}};d();var Vc=class{constructor(e){u(this,`_backingStorages`,void 0),this._backingStorages=e}record(e,t,n,r){let i=this._backingStorages;for(let a=0;a<i.length;a++)i[a].record(e,t,n,r)}};B(),d();var Hc=class{constructor(e,t){u(this,`_buffer`,new kc),u(this,`_instrumentName`,void 0),u(this,`_valueType`,void 0),this._instrumentName=e,this._valueType=t}observe(e,t={}){if(typeof e!=`number`){R.warn(`non-number value provided to metric ${this._instrumentName}: ${e}`);return}this._valueType===Re.INT&&!Number.isInteger(e)&&(R.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._buffer.set(t,e)}},Uc=class{constructor(){u(this,`_buffer`,new Map)}observe(e,t,n={}){if(!Tc(e))return;let r=this._buffer.get(e);if(r==null&&(r=new kc,this._buffer.set(e,r)),typeof t!=`number`){R.warn(`non-number value provided to metric ${e._descriptor.name}: ${t}`);return}e._descriptor.valueType===Re.INT&&!Number.isInteger(t)&&(R.warn(`INT value type cannot accept a floating-point value for ${e._descriptor.name}, ignoring the fractional digits.`),t=Math.trunc(t),!Number.isInteger(t))||r.set(n,t)}};B(),d(),m();var Wc=class{constructor(){u(this,`_callbacks`,[]),u(this,`_batchCallbacks`,[])}addCallback(e,t){this._findCallback(e,t)>=0||this._callbacks.push({callback:e,instrument:t})}removeCallback(e,t){let n=this._findCallback(e,t);n<0||this._callbacks.splice(n,1)}addBatchCallback(e,t){let n=new Set(t.filter(Tc));if(n.size===0){R.error(`BatchObservableCallback is not associated with valid instruments`,t);return}this._findBatchCallback(e,n)>=0||this._batchCallbacks.push({callback:e,instruments:n})}removeBatchCallback(e,t){let n=new Set(t.filter(Tc)),r=this._findBatchCallback(e,n);r<0||this._batchCallbacks.splice(r,1)}observe(e,t){var n=this;return p(function*(){let r=n._observeCallbacks(e,t),i=n._observeBatchCallbacks(e,t);return(yield Promise.allSettled([...r,...i])).filter(e=>e.status===`rejected`).map(e=>e.reason)})()}_observeCallbacks(e,t){return this._callbacks.map(function(){var n=p(function*({callback:n,instrument:r}){let i=new Hc(r._descriptor.name,r._descriptor.valueType),a=Promise.resolve(n(i));t!=null&&(a=Jo(a,t)),yield a,r._metricStorages.forEach(t=>{t.record(i._buffer,e)})});return function(e){return n.apply(this,arguments)}}())}_observeBatchCallbacks(e,t){return this._batchCallbacks.map(function(){var n=p(function*({callback:n,instruments:r}){let i=new Uc,a=Promise.resolve(n(i));t!=null&&(a=Jo(a,t)),yield a,r.forEach(t=>{let n=i._buffer.get(t);n!=null&&t._metricStorages.forEach(t=>{t.record(n,e)})})});return function(e){return n.apply(this,arguments)}}())}_findCallback(e,t){return this._callbacks.findIndex(n=>n.callback===e&&n.instrument===t)}_findBatchCallback(e,t){return this._batchCallbacks.findIndex(n=>n.callback===e&&Yo(n.instruments,t))}};d();var Gc=class extends Dc{constructor(e,t,n,r,i){super(e),u(this,`_aggregationCardinalityLimit`,void 0),u(this,`_deltaMetricStorage`,void 0),u(this,`_temporalMetricStorage`,void 0),u(this,`_attributesProcessor`,void 0),this._aggregationCardinalityLimit=i,this._deltaMetricStorage=new Ac(t,this._aggregationCardinalityLimit),this._temporalMetricStorage=new jc(t,r),this._attributesProcessor=n}record(e,t,n,r){t=this._attributesProcessor.process(t,n),this._deltaMetricStorage.record(e,t,n,r)}collect(e,t){let n=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,n,t)}};d();var Kc=class{process(e,t){return e}},qc=class{constructor(e){u(this,`_processors`,void 0),this._processors=e}process(e,t){let n=e;for(let e of this._processors)n=e.process(n,t);return n}};function Jc(){return Xc}function Yc(e){return new qc(e)}var Xc=new Kc;d(),m();var Zc=class{constructor(e,t){u(this,`metricStorageRegistry`,new Bc),u(this,`observableRegistry`,new Wc),u(this,`meter`,void 0),u(this,`_meterProviderSharedState`,void 0),u(this,`_instrumentationScope`,void 0),this.meter=new Ec(this),this._meterProviderSharedState=e,this._instrumentationScope=t}registerMetricStorage(e){let t=this._registerMetricStorage(e,Gc);return t.length===1?t[0]:new Vc(t)}registerAsyncMetricStorage(e){return this._registerMetricStorage(e,Nc)}collect(e,t,n){var r=this;return p(function*(){let i=yield r.observableRegistry.observe(t,n==null?void 0:n.timeoutMillis),a=r.metricStorageRegistry.getStorages(e);if(a.length===0)return null;let o=[];return a.forEach(n=>{let r=n.collect(e,t);r!=null&&o.push(r)}),o.length===0?{errors:i}:{scopeMetrics:{scope:r._instrumentationScope,metrics:o},errors:i}})()}_registerMetricStorage(e,t){let n=this._meterProviderSharedState.viewRegistry.findViews(e,this._instrumentationScope).map(n=>{let r=fc(n,e),i=this.metricStorageRegistry.findOrUpdateCompatibleStorage(r);if(i!=null)return i;let a=new t(r,n.aggregation.createAggregator(r),n.attributesProcessor,this._meterProviderSharedState.metricCollectors,n.aggregationCardinalityLimit);return this.metricStorageRegistry.register(a),a});if(n.length===0){let r=this._meterProviderSharedState.selectAggregations(e.type).map(([n,r])=>{let i=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(n,e);if(i!=null)return i;let a=r.createAggregator(e),o=n.selectCardinalityLimit(e.type),s=new t(e,a,Jc(),[n],o);return this.metricStorageRegistry.registerForCollector(n,s),s});n=n.concat(r)}return n}};d();var Qc=class{constructor(e){u(this,`viewRegistry`,new uc),u(this,`metricCollectors`,[]),u(this,`meterSharedStates`,new Map),u(this,`resource`,void 0),this.resource=e}getMeterSharedState(e){let t=Ko(e),n=this.meterSharedStates.get(t);return n==null&&(n=new Zc(this,e),this.meterSharedStates.set(t,n)),n}selectAggregations(e){let t=[];for(let n of this.metricCollectors)t.push([n,Gs(n.selectAggregation(e))]);return t}};K(),d(),m();var $c=class{constructor(e,t){u(this,`_sharedState`,void 0),u(this,`_metricReader`,void 0),this._sharedState=e,this._metricReader=t}collect(e){var t=this;return p(function*(){let n=ia(Date.now()),r=[],i=[],a=Array.from(t._sharedState.meterSharedStates.values()).map(function(){var a=p(function*(a){let o=yield a.collect(t,n,e);(o==null?void 0:o.scopeMetrics)!=null&&r.push(o.scopeMetrics),(o==null?void 0:o.errors)!=null&&i.push(...o.errors)});return function(e){return a.apply(this,arguments)}}());return yield Promise.all(a),{resourceMetrics:{resource:t._sharedState.resource,scopeMetrics:r},errors:i}})()}forceFlush(e){var t=this;return p(function*(){yield t._metricReader.forceFlush(e)})()}shutdown(e){var t=this;return p(function*(){yield t._metricReader.shutdown(e)})()}selectAggregationTemporality(e){return this._metricReader.selectAggregationTemporality(e)}selectAggregation(e){return this._metricReader.selectAggregation(e)}selectCardinalityLimit(e){var t,n,r;return(t=(n=(r=this._metricReader).selectCardinalityLimit)==null?void 0:n.call(r,e))==null?2e3:t}};d();var el=/[\^$\\.+?()[\]{}|]/g,tl=class e{constructor(t){u(this,`_matchAll`,void 0),u(this,`_regexp`,void 0),t===`*`?(this._matchAll=!0,this._regexp=/.*/):(this._matchAll=!1,this._regexp=new RegExp(e.escapePattern(t)))}match(e){return this._matchAll?!0:this._regexp.test(e)}static escapePattern(e){return`^${e.replace(el,`\\$&`).replace(`*`,`.*`)}$`}static hasWildcard(e){return e.includes(`*`)}},nl=class{constructor(e){u(this,`_matchAll`,void 0),u(this,`_pattern`,void 0),this._matchAll=e===void 0,this._pattern=e}match(e){return!!(this._matchAll||e===this._pattern)}};d();var rl=class{constructor(e){var t;u(this,`_nameFilter`,void 0),u(this,`_type`,void 0),u(this,`_unitFilter`,void 0),this._nameFilter=new tl((t=e==null?void 0:e.name)==null?`*`:t),this._type=e==null?void 0:e.type,this._unitFilter=new nl(e==null?void 0:e.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}};d();var il=class{constructor(e){u(this,`_nameFilter`,void 0),u(this,`_versionFilter`,void 0),u(this,`_schemaUrlFilter`,void 0),this._nameFilter=new nl(e==null?void 0:e.name),this._versionFilter=new nl(e==null?void 0:e.version),this._schemaUrlFilter=new nl(e==null?void 0:e.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}};d();function al(e){return e.instrumentName==null&&e.instrumentType==null&&e.instrumentUnit==null&&e.meterName==null&&e.meterVersion==null&&e.meterSchemaUrl==null}function ol(e){if(al(e))throw Error(`Cannot create view with no selector arguments supplied`);if(e.name!=null&&((e==null?void 0:e.instrumentName)==null||tl.hasWildcard(e.instrumentName)))throw Error(`Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter.`)}var sl=class{constructor(e){var t;u(this,`name`,void 0),u(this,`description`,void 0),u(this,`aggregation`,void 0),u(this,`attributesProcessor`,void 0),u(this,`instrumentSelector`,void 0),u(this,`meterSelector`,void 0),u(this,`aggregationCardinalityLimit`,void 0),ol(e),e.attributesProcessors==null?this.attributesProcessor=Jc():this.attributesProcessor=Yc(e.attributesProcessors),this.name=e.name,this.description=e.description,this.aggregation=Gs((t=e.aggregation)==null?{type:Ws.DEFAULT}:t),this.instrumentSelector=new rl({name:e.instrumentName,type:e.instrumentType,unit:e.instrumentUnit}),this.meterSelector=new il({name:e.meterName,version:e.meterVersion,schemaUrl:e.meterSchemaUrl}),this.aggregationCardinalityLimit=e.aggregationCardinalityLimit}};B(),lc(),d(),m();var cl=class{constructor(e){var t;if(u(this,`_sharedState`,void 0),u(this,`_shutdown`,!1),this._sharedState=new Qc((t=e==null?void 0:e.resource)==null?rc():t),(e==null?void 0:e.views)!=null&&e.views.length>0)for(let t of e.views)this._sharedState.viewRegistry.addView(new sl(t));if((e==null?void 0:e.readers)!=null&&e.readers.length>0)for(let t of e.readers){let e=new $c(this._sharedState,t);t.setMetricProducer(e),this._sharedState.metricCollectors.push(e)}}getMeter(e,t=``,n={}){return this._shutdown?(R.warn(`A shutdown MeterProvider cannot provide a Meter`),ve()):this._sharedState.getMeterSharedState({name:e,version:t,schemaUrl:n.schemaUrl}).meter}shutdown(e){var t=this;return p(function*(){if(t._shutdown){R.warn(`shutdown may only be called once per MeterProvider`);return}t._shutdown=!0,yield Promise.all(t._sharedState.metricCollectors.map(t=>t.shutdown(e)))})()}forceFlush(e){var t=this;return p(function*(){if(t._shutdown){R.warn(`invalid attempt to force flush after MeterProvider shutdown`);return}yield Promise.all(t._sharedState.metricCollectors.map(t=>t.forceFlush(e)))})()}},ll;(function(e){e[e.AGGREGATION_TEMPORALITY_UNSPECIFIED=0]=`AGGREGATION_TEMPORALITY_UNSPECIFIED`,e[e.AGGREGATION_TEMPORALITY_DELTA=1]=`AGGREGATION_TEMPORALITY_DELTA`,e[e.AGGREGATION_TEMPORALITY_CUMULATIVE=2]=`AGGREGATION_TEMPORALITY_CUMULATIVE`})(ll||(ll={}));function ul(e,t){let n={attributes:fl(e.attributes,t),droppedAttributesCount:0},r=e.schemaUrl;return r&&r!==``&&(n.schemaUrl=r),n}function dl(e){return{name:e.name,version:e.version}}function fl(e,t){return Object.keys(e).map(n=>pl(n,e[n],t))}function pl(e,t,n){return{key:e,value:ml(t,n)}}function ml(e,t){let n=typeof e;if(n===`string`)return{stringValue:e};if(n===`number`)return Number.isInteger(e)?{intValue:e}:{doubleValue:e};if(n===`boolean`)return{boolValue:e};if(e instanceof Uint8Array)return{bytesValue:t.encodeUint8Array(e)};if(Array.isArray(e)){let n=Array(e.length);for(let r=0;r<e.length;r++)n[r]=ml(e[r],t);return{arrayValue:{values:n}}}if(n===`object`&&e!=null){let n=Object.keys(e),r=Array(n.length);for(let i=0;i<n.length;i++)r[i]={key:n[i],value:ml(e[n[i]],t)};return{kvlistValue:{values:r}}}return{}}B();function hl(e,t){let n=ul(e.resource,t);return{resource:n,schemaUrl:n.schemaUrl,scopeMetrics:gl(e.scopeMetrics,t)}}function gl(e,t){return Array.from(e.map(e=>({scope:dl(e.scope),metrics:e.metrics.map(e=>_l(e,t)),schemaUrl:e.scope.schemaUrl})))}function _l(e,t){let n={name:e.descriptor.name,description:e.descriptor.description,unit:e.descriptor.unit},r=Sl(e.aggregationTemporality);switch(e.dataPointType){case Wo.SUM:n.sum={aggregationTemporality:r,isMonotonic:e.isMonotonic,dataPoints:yl(e,t)};break;case Wo.GAUGE:n.gauge={dataPoints:yl(e,t)};break;case Wo.HISTOGRAM:n.histogram={aggregationTemporality:r,dataPoints:bl(e,t)};break;case Wo.EXPONENTIAL_HISTOGRAM:n.exponentialHistogram={aggregationTemporality:r,dataPoints:xl(e,t)};break}return n}function vl(e,t,n){let r={attributes:fl(e.attributes,n),startTimeUnixNano:n.encodeHrTime(e.startTime),timeUnixNano:n.encodeHrTime(e.endTime)};switch(t){case Re.INT:r.asInt=e.value;break;case Re.DOUBLE:r.asDouble=e.value;break}return r}function yl(e,t){return e.dataPoints.map(n=>vl(n,e.descriptor.valueType,t))}function bl(e,t){return e.dataPoints.map(e=>{let n=e.value;return{attributes:fl(e.attributes,t),bucketCounts:n.buckets.counts,explicitBounds:n.buckets.boundaries,count:n.count,sum:n.sum,min:n.min,max:n.max,startTimeUnixNano:t.encodeHrTime(e.startTime),timeUnixNano:t.encodeHrTime(e.endTime)}})}function xl(e,t){return e.dataPoints.map(e=>{let n=e.value;return{attributes:fl(e.attributes,t),count:n.count,min:n.min,max:n.max,sum:n.sum,positive:{offset:n.positive.offset,bucketCounts:n.positive.bucketCounts},negative:{offset:n.negative.offset,bucketCounts:n.negative.bucketCounts},scale:n.scale,zeroCount:n.zeroCount,startTimeUnixNano:t.encodeHrTime(e.startTime),timeUnixNano:t.encodeHrTime(e.endTime)}})}function Sl(e){switch(e){case Uo.DELTA:return ll.AGGREGATION_TEMPORALITY_DELTA;case Uo.CUMULATIVE:return ll.AGGREGATION_TEMPORALITY_CUMULATIVE}}function Cl(e,t){return{resourceMetrics:e.map(e=>hl(e,t))}}K();function wl(e){let t=BigInt(1e9);return BigInt(Math.trunc(e[0]))*t+BigInt(Math.trunc(e[1]))}function Tl(e){return wl(e).toString()}var El=typeof BigInt<`u`?Tl:ca;function Dl(e){return e}var Ol={encodeHrTime:El,encodeSpanContext:Dl,encodeOptionalSpanContext:Dl,encodeUint8Array:e=>{if(typeof Buffer<`u`)return Buffer.from(e).toString(`base64`);let t=Array(e.length);for(let n=0;n<e.length;n++)t[n]=String.fromCharCode(e[n]);return btoa(t.join(``))}};function kl(e,t){return{resourceLogs:jl(e,t)}}function Al(e){let t=new Map;for(let n of e){let{resource:e,instrumentationScope:{name:r,version:i=``,schemaUrl:a=``}}=n,o=t.get(e);o||(o=new Map,t.set(e,o));let s=`${r}@${i}:${a}`,c=o.get(s);c||(c=[],o.set(s,c)),c.push(n)}return t}function jl(e,t){let n=Al(e);return Array.from(n,([e,n])=>{let r=ul(e,t);return{resource:r,scopeLogs:Array.from(n,([,e])=>({scope:dl(e[0].instrumentationScope),logRecords:e.map(e=>Ml(e,t)),schemaUrl:e[0].instrumentationScope.schemaUrl})),schemaUrl:r.schemaUrl}})}function Ml(e,t){var n,r,i;return{timeUnixNano:t.encodeHrTime(e.hrTime),observedTimeUnixNano:t.encodeHrTime(e.hrTimeObserved),severityNumber:Nl(e.severityNumber),severityText:e.severityText,body:ml(e.body,t),eventName:e.eventName,attributes:Pl(e.attributes,t),droppedAttributesCount:e.droppedAttributesCount,flags:(n=e.spanContext)==null?void 0:n.traceFlags,traceId:t.encodeOptionalSpanContext((r=e.spanContext)==null?void 0:r.traceId),spanId:t.encodeOptionalSpanContext((i=e.spanContext)==null?void 0:i.spanId)}}function Nl(e){return e}function Pl(e,t){return Object.keys(e).map(n=>pl(n,e[n],t))}B();var Fl={serializeRequest:e=>{let t=kl(e,Ol);return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(e){return R.warn(`Failed to parse logs export response: ${e.message}. Returning empty response`),{}}}};B();var Il={serializeRequest:e=>{let t=Cl([e],Ol);return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(e){return R.warn(`Failed to parse metrics export response: ${e.message}. Returning empty response`),{}}}},Ll=256,Rl=512;function zl(e,t){let n=e&255|Ll;return t&&(n|=Rl),n}function Bl(e,t){var n,r,i,a;let o=e.spanContext(),s=e.status,c=(n=e.parentSpanContext)!=null&&n.spanId?t.encodeSpanContext((r=e.parentSpanContext)==null?void 0:r.spanId):void 0;return{traceId:t.encodeSpanContext(o.traceId),spanId:t.encodeSpanContext(o.spanId),parentSpanId:c,traceState:(i=o.traceState)==null?void 0:i.serialize(),name:e.name,kind:e.kind==null?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:fl(e.attributes,t),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>Hl(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:s.code,message:s.message},links:e.links.map(e=>Vl(e,t)),droppedLinksCount:e.droppedLinksCount,flags:zl(o.traceFlags,(a=e.parentSpanContext)==null?void 0:a.isRemote)}}function Vl(e,t){var n;return{attributes:e.attributes?fl(e.attributes,t):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:(n=e.context.traceState)==null?void 0:n.serialize(),droppedAttributesCount:e.droppedAttributesCount||0,flags:zl(e.context.traceFlags,e.context.isRemote)}}function Hl(e,t){return{attributes:e.attributes?fl(e.attributes,t):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function Ul(e,t){return{resourceSpans:Gl(e,t)}}function Wl(e){let t=new Map;for(let n of e){let e=t.get(n.resource);e||(e=new Map,t.set(n.resource,e));let r=`${n.instrumentationScope.name}@${n.instrumentationScope.version||``}:${n.instrumentationScope.schemaUrl||``}`,i=e.get(r);i||(i=[],e.set(r,i)),i.push(n)}return t}function Gl(e,t){let n=Wl(e),r=[],i=n.entries(),a=i.next();for(;!a.done;){let[e,n]=a.value,o=[],s=n.values(),c=s.next();for(;!c.done;){let e=c.value;if(e.length>0){let n=e.map(e=>Bl(e,t));o.push({scope:dl(e[0].instrumentationScope),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}c=s.next()}let l=ul(e,t),u={resource:l,scopeSpans:o,schemaUrl:l.schemaUrl};r.push(u),a=i.next()}return r}B();var Kl={serializeRequest:e=>{let t=Ul(e,Ol);return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(e){return R.warn(`Failed to parse trace export response: ${e.message}. Returning empty response`),{}}}};B(),d(),m();var ql=5,Jl=1e3,Yl=5e3,Xl=1.5,Zl=.2;function Ql(){return 2*Zl*Math.random()-Zl}var $l=class{constructor(e){u(this,`_transport`,void 0),this._transport=e}retry(e,t,n){return new Promise((r,i)=>{setTimeout(()=>{this._transport.send(e,t).then(r,i)},n)})}send(e,t){var n=this;return p(function*(){let r=ql,i=Jl,a=Date.now()+t,o=yield n._transport.send(e,t);for(;o.status===`retryable`&&r>0;){var s;r--;let t=Math.max(Math.min(i*(1+Ql()),Yl),0);i*=Xl;let c=(s=o.retryInMillis)==null?t:s,l=a-Date.now();if(c>l)return R.info(`Export retry time ${Math.round(c)}ms exceeds remaining timeout ${Math.round(l)}ms, not retrying further.`),o;R.verbose(`Scheduling export retry in ${Math.round(c)}ms`),o=yield n.retry(e,l,c)}return o.status===`success`?R.verbose(`Export succeeded after ${ql-r} retry attempts.`):o.status===`retryable`?R.info(`Export failed after maximum retry attempts (${ql}).`):R.info(`Export failed with non-retryable error: ${o.error}`),o})()}shutdown(){return this._transport.shutdown()}};function eu(e){return new $l(e.transport)}function tu(e){return e===429||e===502||e===503||e===504}function nu(e){if(e==null)return;let t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?t*1e3:-1;let n=new Date(e).getTime()-Date.now();return n>=0?n:0}B(),d(),m();var ru=60*1024,iu=9,au=0,ou=0,su=class{constructor(e){u(this,`_parameters`,void 0),this._parameters=e}send(e,t){var n=this;return p(function*(){let r=new AbortController,i=setTimeout(()=>r.abort(),t),a=globalThis.fetch;typeof a.__original==`function`&&(a=a.__original);let o=e.byteLength,s=au+o>ru,c=!s&&!(ou>=iu);if(c)au+=o,ou++;else{let e=s?`size limit`:`count limit`;R.debug(`keepalive disabled: ${(o/1024).toFixed(1)}KB payload, ${ou} pending (${e})`)}try{let t=new URL(n._parameters.url),i=yield a(t.href,{method:`POST`,headers:yield n._parameters.headers(),body:e,signal:r.signal,keepalive:c,mode:globalThis.location?globalThis.location.origin===t.origin?`same-origin`:`cors`:`no-cors`});return i.status>=200&&i.status<=299?(R.debug(`export response success (status: ${i.status})`),{status:`success`}):tu(i.status)?(R.warn(`export response retryable (status: ${i.status})`),{status:`retryable`,retryInMillis:nu(i.headers.get(`Retry-After`))}):(R.error(`export response failure (status: ${i.status})`),{status:`failure`,error:Error(`Fetch request failed with non-retryable status ${i.status}`)})}catch(e){return lu(e)?(R.warn(`export request retryable (network error: ${e})`),{status:`retryable`,error:Error(`Fetch request encountered a network error`,{cause:e})}):(R.error(`export request failure (error: ${e})`),{status:`failure`,error:Error(`Fetch request errored`,{cause:e})})}finally{clearTimeout(i),c&&(au-=o,ou--)}})()}shutdown(){}};function cu(e){return new su(e)}function lu(e){return e instanceof TypeError&&!e.cause}function uu(e,t){return Ho(e,t,eu({transport:cu(e)}))}B();function du(e){let t={};return Object.entries(e==null?{}:e).forEach(([e,n])=>{n===void 0?R.warn(`Header "${e}" has invalid value (${n}) and will be ignored`):t[e]=String(n)}),t}Y(),m();function fu(e,t,n){return p(function*(){let r=J({},yield n()),i={};return t!=null&&Object.assign(i,yield t()),e!=null&&Object.assign(i,du(yield e())),Object.assign(i,r)})}function pu(e){if(e!=null)try{var t;let n=(t=globalThis.location)==null?void 0:t.href;return new URL(e,n).href}catch(t){throw Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function mu(e,t,n){var r,i;return J(J({},Po(e,t,n)),{},{headers:fu(e.headers,t.headers,n.headers),url:(r=(i=pu(e.url))==null?t.url:i)==null?n.url:r})}function hu(e,t){return J(J({},Fo()),{},{headers:function(){var t=p(function*(){return e});return function(){return t.apply(this,arguments)}}(),url:`http://localhost:4318/`+t})}function gu(e){return typeof e.headers==`function`?e.headers:No(e.headers)}function _u(e,t,n){return mu({url:e.url,timeoutMillis:e.timeoutMillis,headers:gu(e),concurrencyLimit:e.concurrencyLimit},{},hu(n,t))}function vu(e,t,n,r){return uu(_u(e,n,r),t)}var yu=class extends Ao{constructor(e={}){super(vu(e,Fl,`v1/logs`,{"Content-Type":`application/json`}))}},bu;(function(e){e[e.DELTA=0]=`DELTA`,e[e.CUMULATIVE=1]=`CUMULATIVE`,e[e.LOWMEMORY=2]=`LOWMEMORY`})(bu||(bu={})),K(),B(),d();var xu=()=>Uo.CUMULATIVE,Su=e=>{switch(e){case q.COUNTER:case q.OBSERVABLE_COUNTER:case q.GAUGE:case q.HISTOGRAM:case q.OBSERVABLE_GAUGE:return Uo.DELTA;case q.UP_DOWN_COUNTER:case q.OBSERVABLE_UP_DOWN_COUNTER:return Uo.CUMULATIVE}},Cu=e=>{switch(e){case q.COUNTER:case q.HISTOGRAM:return Uo.DELTA;case q.GAUGE:case q.UP_DOWN_COUNTER:case q.OBSERVABLE_UP_DOWN_COUNTER:case q.OBSERVABLE_COUNTER:case q.OBSERVABLE_GAUGE:return Uo.CUMULATIVE}};function wu(){var e;let t=((e=void 0)==null?`cumulative`:e).toLowerCase();return t===`cumulative`?xu:t===`delta`?Su:t===`lowmemory`?Cu:(R.warn(`OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to '${t}', but only 'cumulative' and 'delta' are allowed. Using default ('cumulative') instead.`),xu)}function Tu(e){return e==null?wu():e===bu.DELTA?Su:e===bu.LOWMEMORY?Cu:xu}var Eu=Object.freeze({type:Ws.DEFAULT});function Du(e){var t;return(t=e==null?void 0:e.aggregationPreference)==null?(()=>Eu):t}var Ou=class extends Ao{constructor(e,t){super(e),u(this,`_aggregationTemporalitySelector`,void 0),u(this,`_aggregationSelector`,void 0),this._aggregationSelector=Du(t),this._aggregationTemporalitySelector=Tu(t==null?void 0:t.temporalityPreference)}selectAggregation(e){return this._aggregationSelector(e)}selectAggregationTemporality(e){return this._aggregationTemporalitySelector(e)}},ku=class extends Ou{constructor(e){super(vu(e==null?{}:e,Il,`v1/metrics`,{"Content-Type":`application/json`}),e)}},Au=class extends Ao{constructor(e={}){super(vu(e,Kl,`v1/traces`,{"Content-Type":`application/json`}))}};function ju(e){return Mu(e,new WeakSet)}function Mu(e,t){if(e==null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e instanceof Uint8Array)return!0;if(typeof e==`object`){if(t.has(e))return!1;if(t.add(e),Array.isArray(e))return e.every(e=>Mu(e,t));let n=e;return n.constructor!==Object&&n.constructor!==void 0?!1:Object.values(n).every(e=>Mu(e,t))}return!1}B(),K(),Qi(),d();var Nu=class{set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get eventName(){return this._eventName}set eventName(e){this._isLogRecordReadonly()||(this._eventName=e)}get droppedAttributesCount(){return this._droppedAttributesCount}constructor(e,t,n){u(this,`hrTime`,void 0),u(this,`hrTimeObserved`,void 0),u(this,`spanContext`,void 0),u(this,`resource`,void 0),u(this,`instrumentationScope`,void 0),u(this,`attributes`,{}),u(this,`_severityText`,void 0),u(this,`_severityNumber`,void 0),u(this,`_body`,void 0),u(this,`_eventName`,void 0),u(this,`_attributesCount`,0),u(this,`_droppedAttributesCount`,0),u(this,`_isReadonly`,!1),u(this,`_logRecordLimits`,void 0);let{timestamp:r,observedTimestamp:i,eventName:a,severityNumber:o,severityText:s,body:c,attributes:l={},exception:d,context:f}=n,p=Date.now();if(this.hrTime=oa(r==null?p:r),this.hrTimeObserved=oa(i==null?p:i),f){let e=z.getSpanContext(f);e&&pt(e)&&(this.spanContext=e)}this.severityNumber=o,this.severityText=s,this.body=c,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this._eventName=a,this.setAttributes(l),d!=null&&this._setException(d)}setAttribute(e,t){if(this._isLogRecordReadonly())return this;if(e.length===0)return R.warn(`Invalid attribute key: ${e}`),this;if(!ju(t))return R.warn(`Invalid attribute value set for key: ${e}`),this;let n=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n&&this._attributesCount>=this._logRecordLimits.attributeCountLimit?(this._droppedAttributesCount++,this._droppedAttributesCount===1&&R.warn(`Dropping extra attributes.`),this):(this.attributes[e]=this._truncateToSize(t),n&&this._attributesCount++,this)}setAttributes(e){for(let[t,n]of Object.entries(e))this.setAttribute(t,n);return this}setBody(e){return this.body=e,this}setEventName(e){return this.eventName=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;if(t<=0)return R.warn(`Attribute value limit must be positive, got ${t}`),e;if(e==null)return e;if(typeof e==`string`)return this._truncateToLimitUtil(e,t);if(e instanceof Uint8Array)return e;if(Array.isArray(e))return e.map(e=>this._truncateToSize(e));if(typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))t[n]=this._truncateToSize(r);return t}return e}_setException(e){let t=!1;if(typeof e==`string`||typeof e==`number`)Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute(Pi,String(e)),t=!0;else if(e&&typeof e==`object`){let n=e;n.code?(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(Ii,n.code.toString()),t=!0):n.name&&(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(Ii,n.name),t=!0),n.message&&(Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute(Pi,n.message),t=!0),n.stack&&(Object.hasOwn(this.attributes,`exception.stacktrace`)||this.setAttribute(Fi,n.stack),t=!0)}t||R.warn(`Failed to record an exception ${e}`)}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&&R.warn(`Can not execute the operation on emitted log record`),this._isReadonly}};B(),d(),Y();var Pu=class{constructor(e,t){u(this,`instrumentationScope`,void 0),u(this,`_sharedState`,void 0),u(this,`_loggerConfig`,void 0),this.instrumentationScope=e,this._sharedState=t,this._loggerConfig=this._sharedState.getLoggerConfig(this.instrumentationScope)}emit(e){var t;let n=this._loggerConfig,r=e.context||L.active(),i=(t=e.severityNumber)==null?ln.UNSPECIFIED:t;if(i!==ln.UNSPECIFIED&&i<n.minimumSeverity)return;if(n.traceBased){let e=z.getSpanContext(r);if(e&&pt(e)&&(e.traceFlags&F.SAMPLED)!==F.SAMPLED)return}let a=new Nu(this._sharedState,this.instrumentationScope,J({context:r},e));this._sharedState.loggerMetrics.emitLog(),this._sharedState.activeProcessor.onEmit(a,r),a._makeReadonly()}enabled(e){let t=this._loggerConfig;if(t.disabled)return!1;let n=e==null?void 0:e.severityNumber;if(typeof n==`number`&&n!==ln.UNSPECIFIED&&n<t.minimumSeverity)return!1;let r=(e==null?void 0:e.context)||L.active();if(t.traceBased){let e=z.getSpanContext(r);if(e&&pt(e)&&(e.traceFlags&F.SAMPLED)!==F.SAMPLED)return!1}let i={context:r,instrumentationScope:this.instrumentationScope,severityNumber:e==null?void 0:e.severityNumber,eventName:e==null?void 0:e.eventName};for(let e of this._sharedState.processors)if(!e.enabled||e.enabled(i))return!0;return!1}},Fu=class{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}enabled(e){return!1}};K(),d(),m();var Iu=class{constructor(e,t){u(this,`processors`,void 0),u(this,`forceFlushTimeoutMillis`,void 0),this.processors=e,this.forceFlushTimeoutMillis=t}forceFlush(){var e=this;return p(function*(){let t=e.forceFlushTimeoutMillis;yield Promise.all(e.processors.map(e=>_o(e.forceFlush(),t)))})()}onEmit(e,t){this.processors.forEach(n=>n.onEmit(e,t))}shutdown(){var e=this;return p(function*(){yield Promise.all(e.processors.map(e=>e.shutdown()))})()}enabled(e){for(let t of this.processors)if(!t.enabled||t.enabled(e))return!0;return!1}};function Lu(e){return`${e.name}@${e.version||``}:${e.schemaUrl||``}`}var Ru=`otel.sdk.log.created`;d();var zu=class{constructor(e){u(this,`createdLogs`,void 0),this.createdLogs=e.createCounter(Ru,{unit:`{log_record}`,description:`The number of logs submitted to enabled SDK Loggers.`})}emitLog(){this.createdLogs.add(1)}},Bu=`0.217.0`;B(),On(),Y(),d();var Vu={disabled:!1,minimumSeverity:ln.UNSPECIFIED,traceBased:!1},Hu=()=>J({},Vu),Uu=class{constructor(e,t,n,r,i,a){u(this,`loggers`,new Map),u(this,`activeProcessor`,void 0),u(this,`registeredLogRecordProcessors`,[]),u(this,`resource`,void 0),u(this,`forceFlushTimeoutMillis`,void 0),u(this,`logRecordLimits`,void 0),u(this,`processors`,void 0),u(this,`loggerMetrics`,void 0),u(this,`_loggerConfigurator`,void 0),u(this,`_loggerConfigs`,new Map),this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=n,this.processors=r,r.length>0?(this.registeredLogRecordProcessors=r,this.activeProcessor=new Iu(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new Fu,this._loggerConfigurator=i==null?Hu:i;let o=a?a.getMeter(`@opentelemetry/sdk-logs`,Bu):ve();this.loggerMetrics=new zu(o)}getLoggerConfig(e){let t=Lu(e),n=this._loggerConfigs.get(t);return n||(n=this._loggerConfigurator(e),this._loggerConfigs.set(t,n),n)}};B(),On(),lc(),K(),d();var Wu=class{constructor(e={}){var t,n,r,i,a,o,s,c;u(this,`_shutdownOnce`,void 0),u(this,`_sharedState`,void 0);let l={resource:(t=e.resource)==null?rc():t,forceFlushTimeoutMillis:(n=e.forceFlushTimeoutMillis)==null?3e4:n,logRecordLimits:{attributeCountLimit:(r=(i=e.logRecordLimits)==null?void 0:i.attributeCountLimit)==null?128:r,attributeValueLengthLimit:(a=(o=e.logRecordLimits)==null?void 0:o.attributeValueLengthLimit)==null?1/0:a},loggerConfigurator:(s=e.loggerConfigurator)==null?Hu:s,processors:(c=e.processors)==null?[]:c,meterProvider:e.meterProvider};this._sharedState=new Uu(l.resource,l.forceFlushTimeoutMillis,l.logRecordLimits,l.processors,l.loggerConfigurator,l.meterProvider),this._shutdownOnce=new To(this._shutdown,this)}getLogger(e,t,n){if(this._shutdownOnce.isCalled)return R.warn(`A shutdown LoggerProvider cannot provide a Logger`),fn;e||R.warn(`Logger requested without instrumentation scope name.`);let r=e||`unknown`,i=`${r}@${t||``}:${(n==null?void 0:n.schemaUrl)||``}`;return this._sharedState.loggers.has(i)||this._sharedState.loggers.set(i,new Pu({name:r,version:t,schemaUrl:n==null?void 0:n.schemaUrl},this._sharedState)),this._sharedState.loggers.get(i)}forceFlush(){return this._shutdownOnce.isCalled?(R.warn(`invalid attempt to force flush after LoggerProvider shutdown`),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(R.warn(`shutdown may only be called once per LoggerProvider`),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}};B(),K(),m(),d();function Gu(e){return Ku.apply(this,arguments)}function Ku(){return Ku=p(function*(e){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];r.resource.asyncAttributesPending&&r.resource.waitForAsyncAttributes&&t.push(r.resource.waitForAsyncAttributes())}t!=null&&t.length>0&&(yield Promise.all(t))}),Ku.apply(this,arguments)}var qu=class{constructor(e,t,n){u(this,`_exportCompleted`,void 0),u(this,`_exportScheduledPromise`,void 0),u(this,`_exportScheduledResolve`,void 0),this._exportScheduledPromise=new Promise(e=>{this._exportScheduledResolve=e}),this._exportCompleted=this._executeExport(e,t,n)}get exportCompleted(){return this._exportCompleted}get exportScheduled(){return this._exportScheduledPromise}_executeExport(e,t,n){var r=this;return p(function*(){try{yield Gu(t),yield L.with(ei(L.active()),p(function*(){return r._exportWithTimeout(e,t,n)}))}catch(e){Ci(e),r._exportScheduledResolve()}})()}_exportWithTimeout(e,t,n){var r=this;return p(function*(){return new Promise((i,a)=>{let o=setTimeout(()=>{a(Error(`Timeout`))},n);e.export(t,e=>{if(clearTimeout(o),e.code===_a.SUCCESS)i();else{var t;a((t=e.error)==null?Error(`BatchLogRecordProcessor: log record export failed`):t)}}),r._exportScheduledResolve()})})()}},Ju=class{constructor(e,t){var n,r,i,a;u(this,`_maxExportBatchSize`,void 0),u(this,`_maxQueueSize`,void 0),u(this,`_scheduledDelayMillis`,void 0),u(this,`_exportTimeoutMillis`,void 0),u(this,`_exporter`,void 0),u(this,`_currentExport`,null),u(this,`_finishedLogRecords`,[]),u(this,`_timer`,void 0),u(this,`_shutdownOnce`,void 0),u(this,`_flushing`,!1),this._exporter=e,this._maxExportBatchSize=(n=t==null?void 0:t.maxExportBatchSize)==null?512:n,this._maxQueueSize=(r=t==null?void 0:t.maxQueueSize)==null?2048:r,this._scheduledDelayMillis=(i=t==null?void 0:t.scheduledDelayMillis)==null?5e3:i,this._exportTimeoutMillis=(a=t==null?void 0:t.exportTimeoutMillis)==null?3e4:a,this._shutdownOnce=new To(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(R.warn(`BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}_addToBuffer(e){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}shutdown(){return this._shutdownOnce.call()}_shutdown(){var e=this;return p(function*(){e.onShutdown(),yield e._flushAll(),yield e._exporter.shutdown()})()}_flushAll(){var e=this;return p(function*(){if(e._flushing)return;e._flushing=!0;let t=e._finishedLogRecords;for(e._finishedLogRecords=[],e._clearTimer(),e._currentExport!==null&&(yield e._exporter.forceFlush(),yield e._currentExport.exportCompleted,e._currentExport=null);t.length>0;){let n;t.length<=e._maxExportBatchSize?(n=t,t=[]):n=t.splice(0,e._maxExportBatchSize);let r=new qu(e._exporter,n,e._exportTimeoutMillis);e._currentExport=r;try{yield r.exportScheduled,yield e._exporter.forceFlush(),yield r.exportCompleted}catch(e){Ci(e)}finally{e._currentExport=null}}e._flushing=!1,e._maybeStartTimer()})()}_extractBatch(){if(this._finishedLogRecords.length===0)return null;if(this._finishedLogRecords.length<=this._maxExportBatchSize){let e=this._finishedLogRecords;return this._finishedLogRecords=[],e}else return this._finishedLogRecords.splice(0,this._maxExportBatchSize)}_exportOneBatch(){this._clearTimer();let e=this._extractBatch();if(e===null)return;let t=new qu(this._exporter,e,this._exportTimeoutMillis);this._currentExport=t,t.exportCompleted.then(()=>{this._currentExport=null,this._maybeStartTimer()}).catch(e=>{this._currentExport=null,Ci(e),this._maybeStartTimer()})}_maybeStartTimer(){if(!this._shutdownOnce.isCalled&&!this._flushing&&this._finishedLogRecords.length!==0&&this._currentExport===null){if(this._finishedLogRecords.length>=this._maxExportBatchSize){this._exportOneBatch();return}this._timer===void 0&&(this._timer=setTimeout(()=>{this._timer=void 0,this._exportOneBatch()},this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}};d();var Yu=class extends Ju{constructor(e,t){super(e,t),u(this,`_visibilityChangeListener`,void 0),u(this,`_pageHideListener`,void 0),this._onInit(t)}onShutdown(){typeof document>`u`||(this._visibilityChangeListener&&document.removeEventListener(`visibilitychange`,this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener(`pagehide`,this._pageHideListener))}_onInit(e){(e==null?void 0:e.disableAutoFlushOnDocumentHide)===!0||typeof document>`u`||(this._visibilityChangeListener=()=>{document.visibilityState===`hidden`&&this.forceFlush()},this._pageHideListener=()=>{this.forceFlush()},document.addEventListener(`visibilitychange`,this._visibilityChangeListener),document.addEventListener(`pagehide`,this._pageHideListener))}},Xu,Zu=n((()=>{Xu=`exception`})),Qu,$u=n((()=>{B(),K(),Qi(),Zu(),d(),Qu=class{constructor(e){var t,n;u(this,`_spanContext`,void 0),u(this,`kind`,void 0),u(this,`parentSpanContext`,void 0),u(this,`attributes`,{}),u(this,`links`,[]),u(this,`events`,[]),u(this,`startTime`,void 0),u(this,`resource`,void 0),u(this,`instrumentationScope`,void 0),u(this,`_droppedAttributesCount`,0),u(this,`_droppedEventsCount`,0),u(this,`_droppedLinksCount`,0),u(this,`_attributesCount`,0),u(this,`name`,void 0),u(this,`status`,{code:I.UNSET}),u(this,`endTime`,[0,0]),u(this,`_ended`,!1),u(this,`_duration`,[-1,-1]),u(this,`_spanProcessor`,void 0),u(this,`_spanLimits`,void 0),u(this,`_attributeValueLengthLimit`,void 0),u(this,`_recordEndMetrics`,void 0),u(this,`_performanceStartTime`,void 0),u(this,`_performanceOffset`,void 0),u(this,`_startTimeProvided`,void 0);let r=Date.now();if(this._spanContext=e.spanContext,this._performanceStartTime=G.now(),this._performanceOffset=r-(this._performanceStartTime+G.timeOrigin),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=(t=this._spanLimits.attributeValueLengthLimit)==null?0:t,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,e.links)for(let t of e.links)this.addLink(t);this.startTime=this._getTime((n=e.startTime)==null?r:n),this.resource=e.resource,this.instrumentationScope=e.scope,this._recordEndMetrics=e.recordEndMetrics,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,t){if(t==null||this._isSpanEnded())return this;if(e.length===0)return R.warn(`Invalid attribute key: ${e}`),this;if(!hi(t))return R.warn(`Invalid attribute value set for key: ${e}`),this;let{attributeCountLimit:n}=this._spanLimits,r=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n!==void 0&&this._attributesCount>=n&&r?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),r&&this._attributesCount++,this)}setAttributes(e){for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.setAttribute(t,e[t]);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;let{eventCountLimit:r}=this._spanLimits;if(r===0)return R.warn(`No events allowed.`),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&R.debug(`Dropping extra events.`),this.events.shift(),this._droppedEventsCount++),da(t)&&(da(n)||(n=t),t=void 0);let i=pi(t),{attributePerEventCountLimit:a}=this._spanLimits,o={},s=0,c=0;for(let e in i){if(!Object.prototype.hasOwnProperty.call(i,e))continue;let t=i[e];if(a!==void 0&&c>=a){s++;continue}o[e]=this._truncateToSize(t),c++}return this.events.push({name:e,attributes:o,time:this._getTime(n),droppedAttributesCount:s}),this}addLink(e){if(this._isSpanEnded())return this;let{linkCountLimit:t}=this._spanLimits;if(t===0)return this._droppedLinksCount++,this;t!==void 0&&this.links.length>=t&&(this._droppedLinksCount===0&&R.debug(`Dropping extra links.`),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:n}=this._spanLimits,r=pi(e.attributes),i={},a=0,o=0;for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let t=r[e];if(n!==void 0&&o>=n){a++;continue}i[e]=this._truncateToSize(t),o++}let s={context:e.context};return o>0&&(s.attributes=i),a>0&&(s.droppedAttributesCount=a),this.links.push(s),this}addLinks(e){for(let t of e)this.addLink(t);return this}setStatus(e){if(this._isSpanEnded()||e.code===I.UNSET||this.status.code===I.OK)return this;let t={code:e.code};return e.code===I.ERROR&&(typeof e.message==`string`?t.message=e.message:e.message!=null&&R.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`)),this.status=t,this}updateName(e){return this._isSpanEnded()||(this.name=e),this}end(e){var t;if(this._isSpanEnded()){R.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(e),this._duration=sa(this.startTime,this.endTime),this._duration[0]<0&&(R.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&&R.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&R.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),(t=this._recordEndMetrics)==null||t.call(this),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e==`number`&&e<=G.now())return aa(e+this._performanceOffset);if(typeof e==`number`)return ia(e);if(e instanceof Date)return ia(e.getTime());if(ua(e))return e;if(this._startTimeProvided)return ia(Date.now());let t=G.now()-this._performanceStartTime;return fa(this.startTime,ia(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e==`string`?n[Pi]=e:e&&(e.code?n[Ii]=e.code.toString():e.name&&(n[Ii]=e.name),e.message&&(n[Pi]=e.message),e.stack&&(n[Fi]=e.stack)),n[`exception.type`]||n[`exception.message`]?this.addEvent(Xu,n,t):R.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let e=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);R.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(R.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e==`string`?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(e=>typeof e==`string`?this._truncateToLimitUtil(e,t):e):e}}})),ed,td=n((()=>{(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(ed||(ed={}))})),nd,rd=n((()=>{td(),nd=class{shouldSample(){return{decision:ed.NOT_RECORD}}toString(){return`AlwaysOffSampler`}}})),id,ad=n((()=>{td(),id=class{shouldSample(){return{decision:ed.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}}})),od,sd=n((()=>{B(),K(),rd(),ad(),d(),od=class{constructor(e){var t,n,r,i;u(this,`_root`,void 0),u(this,`_remoteParentSampled`,void 0),u(this,`_remoteParentNotSampled`,void 0),u(this,`_localParentSampled`,void 0),u(this,`_localParentNotSampled`,void 0),this._root=e.root,this._root||(Ci(Error(`ParentBasedSampler must have a root sampler configured`)),this._root=new id),this._remoteParentSampled=(t=e.remoteParentSampled)==null?new id:t,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)==null?new nd:n,this._localParentSampled=(r=e.localParentSampled)==null?new id:r,this._localParentNotSampled=(i=e.localParentNotSampled)==null?new nd:i}shouldSample(e,t,n,r,i,a){let o=z.getSpanContext(e);return!o||!pt(o)?this._root.shouldSample(e,t,n,r,i,a):o.isRemote?o.traceFlags&F.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,i,a):this._remoteParentNotSampled.shouldSample(e,t,n,r,i,a):o.traceFlags&F.SAMPLED?this._localParentSampled.shouldSample(e,t,n,r,i,a):this._localParentNotSampled.shouldSample(e,t,n,r,i,a)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}})),cd,ld=n((()=>{B(),td(),d(),cd=class{constructor(e=0){u(this,`_ratio`,void 0),u(this,`_upperBound`,void 0),this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:dt(t)&&this._accumulate(t)<this._upperBound?ed.RECORD_AND_SAMPLED:ed.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!=`number`||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<32;n+=8){let r=0;for(let t=0;t<8;t++){let i=e.charCodeAt(n+t),a=i<58?i-48:i<71?i-55:i-87;r=r<<4|a}t=(t^r)>>>0}return t}}}));function ud(){var e,t,n,r,i,a,o,s;return{sampler:dd(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:(e=void 0)==null?1/0:e,attributeCountLimit:(t=void 0)==null?128:t},spanLimits:{attributeValueLengthLimit:(n=void 0)==null?1/0:n,attributeCountLimit:(r=void 0)==null?128:r,linkCountLimit:(i=void 0)==null?128:i,eventCountLimit:(a=void 0)==null?128:a,attributePerEventCountLimit:(o=void 0)==null?128:o,attributePerLinkCountLimit:(s=void 0)==null?128:s}}}function dd(){var e;let t=(e=void 0)==null?pd.ParentBasedAlwaysOn:e;switch(t){case pd.AlwaysOn:return new id;case pd.AlwaysOff:return new nd;case pd.ParentBasedAlwaysOn:return new od({root:new id});case pd.ParentBasedAlwaysOff:return new od({root:new nd});case pd.TraceIdRatio:return new cd(fd());case pd.ParentBasedTraceIdRatio:return new od({root:new cd(fd())});default:return R.error(`OTEL_TRACES_SAMPLER value "${t}" invalid, defaulting to "${pd.ParentBasedAlwaysOn}".`),new od({root:new id})}}function fd(){return R.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${md}.`),md}var pd,md,hd=n((()=>{B(),K(),rd(),ad(),sd(),ld(),(function(e){e.AlwaysOff=`always_off`,e.AlwaysOn=`always_on`,e.ParentBasedAlwaysOff=`parentbased_always_off`,e.ParentBasedAlwaysOn=`parentbased_always_on`,e.ParentBasedTraceIdRatio=`parentbased_traceidratio`,e.TraceIdRatio=`traceidratio`})(pd||(pd={})),md=1}));function gd(e){let t={sampler:dd()},n=ud(),r=Object.assign({},n,t,e);return r.generalLimits=Object.assign({},n.generalLimits,e.generalLimits||{}),r.spanLimits=Object.assign({},n.spanLimits,e.spanLimits||{}),r}function _d(e){var t,n,r,i,a,o,s,c,l,u,d,f;let p=Object.assign({},e.spanLimits);return p.attributeCountLimit=(t=(n=(r=(i=(a=e.spanLimits)==null?void 0:a.attributeCountLimit)==null?(o=e.generalLimits)==null?void 0:o.attributeCountLimit:i)==null?void 0:r)==null?void 0:n)==null?128:t,p.attributeValueLengthLimit=(s=(c=(l=(u=(d=e.spanLimits)==null?void 0:d.attributeValueLengthLimit)==null?(f=e.generalLimits)==null?void 0:f.attributeValueLengthLimit:u)==null?void 0:l)==null?void 0:c)==null?vd:s,Object.assign({},e,{spanLimits:p})}var vd,yd=n((()=>{hd(),K(),vd=1/0})),bd,xd=n((()=>{B(),K(),d(),bd=class{constructor(e,t){var n,r,i,a;u(this,`_maxExportBatchSize`,void 0),u(this,`_maxQueueSize`,void 0),u(this,`_scheduledDelayMillis`,void 0),u(this,`_exportTimeoutMillis`,void 0),u(this,`_exporter`,void 0),u(this,`_isExporting`,!1),u(this,`_finishedSpans`,[]),u(this,`_timer`,void 0),u(this,`_shutdownOnce`,void 0),u(this,`_droppedSpansCount`,0),this._exporter=e,this._maxExportBatchSize=typeof(t==null?void 0:t.maxExportBatchSize)==`number`?t.maxExportBatchSize:(n=void 0)==null?512:n,this._maxQueueSize=typeof(t==null?void 0:t.maxQueueSize)==`number`?t.maxQueueSize:(r=void 0)==null?2048:r,this._scheduledDelayMillis=typeof(t==null?void 0:t.scheduledDelayMillis)==`number`?t.scheduledDelayMillis:(i=void 0)==null?5e3:i,this._exportTimeoutMillis=typeof(t==null?void 0:t.exportTimeoutMillis)==`number`?t.exportTimeoutMillis:(a=void 0)==null?3e4:a,this._shutdownOnce=new To(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(R.warn(`BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&F.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&R.debug(`maxQueueSize reached, dropping spans`),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(R.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{let n=[],r=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let e=0,t=r;e<t;e++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,t)=>{let n=setTimeout(()=>{t(Error(`Timeout`))},this._exportTimeoutMillis);L.with(ei(L.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);let i=()=>this._exporter.export(r,r=>{if(clearTimeout(n),r.code===_a.SUCCESS)e();else{var i;t((i=r.error)==null?Error(`BatchSpanProcessor: span export failed`):i)}}),a=null;for(let e=0,t=r.length;e<t;e++){let t=r[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(a!=null||(a=[]),a.push(t.resource.waitForAsyncAttributes()))}a===null?i():Promise.all(a).then(i,e=>{Ci(e),t(e)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{this._isExporting=!1,Ci(e)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}}})),Sd,Cd=n((()=>{xd(),K(),d(),Sd=class extends bd{constructor(e,t){super(e,t),u(this,`_visibilityChangeListener`,void 0),u(this,`_pageHideListener`,void 0),this.onInit(t)}onInit(e){(e==null?void 0:e.disableAutoFlushOnDocumentHide)!==!0&&typeof document<`u`&&(this._visibilityChangeListener=()=>{document.visibilityState===`hidden`&&this.forceFlush().catch(e=>{Ci(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{Ci(e)})},document.addEventListener(`visibilitychange`,this._visibilityChangeListener),document.addEventListener(`pagehide`,this._pageHideListener))}onShutdown(){typeof document<`u`&&(this._visibilityChangeListener&&document.removeEventListener(`visibilitychange`,this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener(`pagehide`,this._pageHideListener))}}}));function wd(e){for(let t=0;t<e.length;t++)e[t]=Math.random()*256>>>0;for(let t=0;t<e.length;t++)if(e[t]>0)return;e[e.length-1]=1}function Td(e){let t=``;for(let n=0;n<e.length;n++)t+=Ad[e[n]];return t}var Ed,Dd,Od,kd,Ad,jd,Md=n((()=>{Ed=16,Dd=8,Od=new Uint8Array(Ed),kd=new Uint8Array(Dd),Ad=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`)),jd=class{generateTraceId(){return wd(Od),Td(Od)}generateSpanId(){return wd(kd),Td(kd)}}})),Nd=n((()=>{Cd(),Md()})),Pd,Fd,Id,Ld,Rd=n((()=>{Pd=`otel.span.parent.origin`,Fd=`otel.span.sampling_result`,Id=`otel.sdk.span.live`,Ld=`otel.sdk.span.started`}));function zd(e){return e?e.isRemote?`remote`:`local`:`none`}function Bd(e){switch(e){case ed.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case ed.RECORD:return`RECORD_ONLY`;case ed.NOT_RECORD:return`DROP`}}var Vd,Hd=n((()=>{td(),Rd(),d(),Vd=class{constructor(e){u(this,`startedSpans`,void 0),u(this,`liveSpans`,void 0),this.startedSpans=e.createCounter(Ld,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=e.createUpDownCounter(Id,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(e,t){let n=Bd(t);if(this.startedSpans.add(1,{[Pd]:zd(e),[Fd]:n}),t===ed.NOT_RECORD)return()=>{};let r={[Fd]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}}})),Ud,Wd=n((()=>{Ud=`2.7.1`})),Gd,Kd=n((()=>{B(),K(),$u(),yd(),Nd(),Hd(),Wd(),d(),Gd=class{constructor(e,t,n,r){u(this,`_sampler`,void 0),u(this,`_generalLimits`,void 0),u(this,`_spanLimits`,void 0),u(this,`_idGenerator`,void 0),u(this,`instrumentationScope`,void 0),u(this,`_resource`,void 0),u(this,`_spanProcessor`,void 0),u(this,`_tracerMetrics`,void 0);let i=gd(t);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=t.idGenerator||new jd,this._resource=n,this._spanProcessor=r,this.instrumentationScope=e;let a=i.meterProvider?i.meterProvider.getMeter(`@opentelemetry/sdk-trace`,Ud):ve();this._tracerMetrics=new Vd(a)}startSpan(e,t={},n=L.active()){var r,i,a;t.root&&(n=z.deleteSpan(n));let o=z.getSpan(n);if(ti(n))return R.debug(`Instrumentation suppressed, returning Noop Span`),z.wrapSpanContext(Qe);let s=o==null?void 0:o.spanContext(),c=this._idGenerator.generateSpanId(),l,u,d;!s||!z.isSpanContextValid(s)?u=this._idGenerator.generateTraceId():(u=s.traceId,d=s.traceState,l=s);let f=(r=t.kind)==null?jt.INTERNAL:r,p=((i=t.links)==null?[]:i).map(e=>({context:e.context,attributes:pi(e.attributes)})),m=pi(t.attributes),h=this._sampler.shouldSample(n,u,e,f,m,p),g=this._tracerMetrics.startSpan(s,h.decision);d=(a=h.traceState)==null?d:a;let _=h.decision===kt.RECORD_AND_SAMPLED?F.SAMPLED:F.NONE,v={traceId:u,spanId:c,traceFlags:_,traceState:d};if(h.decision===kt.NOT_RECORD)return R.debug(`Recording is off, propagating context in a non-recording span`),z.wrapSpanContext(v);let y=pi(Object.assign(m,h.attributes));return new Qu({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:v,name:e,kind:f,links:p,parentSpanContext:l,attributes:y,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:g})}startActiveSpan(e,t,n,r){var i;let a,o,s;if(arguments.length<2)return;arguments.length===2?s=t:arguments.length===3?(a=t,s=n):(a=t,o=n,s=r);let c=(i=o)==null?L.active():i,l=this.startSpan(e,a,c),u=z.setSpan(c,l);return L.with(u,s,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}})),qd,Jd=n((()=>{K(),d(),qd=class{constructor(e){u(this,`_spanProcessors`,void 0),this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(e=>{Ci(e||Error(`MultiSpanProcessor: forceFlush failed`)),t()})})}onStart(e,t){for(let n of this._spanProcessors)n.onStart(e,t)}onEnding(e){for(let t of this._spanProcessors)t.onEnding&&t.onEnding(e)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}}})),Yd,Xd,Zd=n((()=>{K(),lc(),Kd(),hd(),Jd(),yd(),d(),(function(e){e[e.resolved=0]=`resolved`,e[e.timeout=1]=`timeout`,e[e.error=2]=`error`,e[e.unresolved=3]=`unresolved`})(Yd||(Yd={})),Xd=class{constructor(e={}){var t,n;u(this,`_config`,void 0),u(this,`_tracers`,new Map),u(this,`_resource`,void 0),u(this,`_activeSpanProcessor`,void 0);let r=ao({},ud(),_d(e));this._resource=(t=r.resource)==null?rc():t,this._config=Object.assign({},r,{resource:this._resource});let i=[];(n=e.spanProcessors)!=null&&n.length&&i.push(...e.spanProcessors),this._activeSpanProcessor=new qd(i)}getTracer(e,t,n){let r=`${e}@${t||``}:${(n==null?void 0:n.schemaUrl)||``}`;return this._tracers.has(r)||this._tracers.set(r,new Gd({name:e,version:t,schemaUrl:n==null?void 0:n.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(r)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,t=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(n=>{let r,i=setTimeout(()=>{n(Error(`Span processor did not completed within timeout period of ${e} ms`)),r=Yd.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),r!==Yd.timeout&&(r=Yd.resolved,n(r))}).catch(e=>{clearTimeout(i),r=Yd.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{let r=t.filter(e=>e!==Yd.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}})),Qd=n((()=>{Zd(),Nd(),K(),d(),B(),m(),rd(),ad(),sd(),ld(),td()})),$d,ef=n((()=>{B(),d(),$d=class{constructor(){u(this,`_enabled`,!1),u(this,`_currentContext`,ge)}_bindFunction(e=ge,t){let n=this,r=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(r,`length`,{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}active(){return this._currentContext}bind(e,t){return e===void 0&&(e=this.active()),typeof t==`function`?this._bindFunction(e,t):t}disable(){return this._currentContext=ge,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=ge,this)}with(e,t,n,...r){let i=this._currentContext;this._currentContext=e||ge;try{return t.call(n,...r)}finally{this._currentContext=i}}}}));function tf(e){if(e!==null){if(e===void 0){let e=new $d;e.enable(),L.setGlobalContextManager(e);return}e.enable(),L.setGlobalContextManager(e)}}function nf(e){if(e!==null){if(e===void 0){nn.setGlobalPropagator(new ya({propagators:[new Va,new di]}));return}nn.setGlobalPropagator(e)}}var rf,af=n((()=>{Qd(),ef(),B(),K(),rf=class extends Xd{constructor(e={}){super(e)}register(e={}){z.setGlobalTracerProvider(this),nf(e.propagator),tf(e.contextManager)}}})),X,of=n((()=>{(function(e){e.CONNECT_END=`connectEnd`,e.CONNECT_START=`connectStart`,e.DECODED_BODY_SIZE=`decodedBodySize`,e.DOM_COMPLETE=`domComplete`,e.DOM_CONTENT_LOADED_EVENT_END=`domContentLoadedEventEnd`,e.DOM_CONTENT_LOADED_EVENT_START=`domContentLoadedEventStart`,e.DOM_INTERACTIVE=`domInteractive`,e.DOMAIN_LOOKUP_END=`domainLookupEnd`,e.DOMAIN_LOOKUP_START=`domainLookupStart`,e.ENCODED_BODY_SIZE=`encodedBodySize`,e.FETCH_START=`fetchStart`,e.LOAD_EVENT_END=`loadEventEnd`,e.LOAD_EVENT_START=`loadEventStart`,e.NAVIGATION_START=`navigationStart`,e.REDIRECT_END=`redirectEnd`,e.REDIRECT_START=`redirectStart`,e.REQUEST_START=`requestStart`,e.RESPONSE_END=`responseEnd`,e.RESPONSE_START=`responseStart`,e.SECURE_CONNECTION_START=`secureConnectionStart`,e.START_TIME=`startTime`,e.UNLOAD_EVENT_END=`unloadEventEnd`,e.UNLOAD_EVENT_START=`unloadEventStart`})(X||(X={}))})),sf,cf,lf=n((()=>{sf=`http.response_content_length`,cf=`http.response_content_length_uncompressed`}));function uf(){return Cf||(Cf=document.createElement(`a`)),Cf}function df(e,t){return t in e}function Z(e,t,n,r=!0){if(df(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function ff(e,t,n=!1,r,i){if(r===void 0&&(r=t[X.START_TIME]!==0),n||(Z(e,X.FETCH_START,t,r),Z(e,X.DOMAIN_LOOKUP_START,t,r),Z(e,X.DOMAIN_LOOKUP_END,t,r),Z(e,X.CONNECT_START,t,r),Z(e,X.SECURE_CONNECTION_START,t,r),Z(e,X.CONNECT_END,t,r),Z(e,X.REQUEST_START,t,r),Z(e,X.RESPONSE_START,t,r),Z(e,X.RESPONSE_END,t,r)),!i){let n=t[X.ENCODED_BODY_SIZE];n!==void 0&&e.setAttribute(sf,n);let r=t[X.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(cf,r)}}function pf(e){return e.slice().sort((e,t)=>{let n=e[X.FETCH_START],r=t[X.FETCH_START];return n>r?1:n<r?-1:0})}function mf(){return typeof location<`u`?location.origin:void 0}function hf(e,t,n,r,i=new WeakSet,a){let o=vf(e);e=o.toString();let s=_f(e,t,n,r,i,a);if(s.length===0)return{mainRequest:void 0};if(s.length===1)return{mainRequest:s[0]};let c=pf(s);if(o.origin!==mf()&&c.length>1){let e=c[0],t=gf(c,e[X.RESPONSE_END],n),r=e[X.RESPONSE_END];return t[X.FETCH_START]<r&&(t=e,e=void 0),{corsPreFlightRequest:e,mainRequest:t}}else return{mainRequest:s[0]}}function gf(e,t,n){let r=ca(n),i=ca(oa(t)),a=e[1],o,s=e.length;for(let t=1;t<s;t++){let n=e[t],s=ca(oa(n[X.FETCH_START])),c=r-ca(oa(n[X.RESPONSE_END]));s>=i&&(!o||c<o)&&(o=c,a=n)}return a}function _f(e,t,n,r,i,a){let o=ca(t),s=ca(n),c=r.filter(t=>{let n=ca(oa(t[X.FETCH_START])),r=ca(oa(t[X.RESPONSE_END]));return t.initiatorType.toLowerCase()===(a||`xmlhttprequest`)&&t.name===e&&n>=o&&r<=s});return c.length>0&&(c=c.filter(e=>!i.has(e))),c}function vf(e){if(typeof URL==`function`)return new URL(e,typeof document<`u`?document.baseURI:typeof location<`u`?location.href:void 0);let t=uf();return t.href=e,t}function yf(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return`/`;let n=xf(e,t);if(t&&n.indexOf(`@id`)>0)return n;let r=``;return e.parentNode&&(r+=yf(e.parentNode,t)),r+=n,r}function bf(e){if(!e.parentNode)return 0;let t=[e.nodeType];e.nodeType===Node.CDATA_SECTION_NODE&&t.push(Node.TEXT_NODE);let n=Array.from(e.parentNode.childNodes);return n=n.filter(n=>{let r=n.localName;return t.indexOf(n.nodeType)>=0&&r===e.localName}),n.length>=1?n.indexOf(e)+1:0}function xf(e,t){let n=e.nodeType,r=bf(e),i=``;if(n===Node.ELEMENT_NODE){let n=e.getAttribute(`id`);if(t&&n)return`//*[@id="${n}"]`;i=e.localName}else if(n===Node.TEXT_NODE||n===Node.CDATA_SECTION_NODE)i=`text()`;else if(n===Node.COMMENT_NODE)i=`comment()`;else return``;return i&&r>1?`/${i}[${r}]`:`/${i}`}function Sf(e,t){let n=t||[];return(typeof n==`string`||n instanceof RegExp)&&(n=[n]),vf(e).origin===mf()?!0:n.some(t=>bo(e,t))}var Cf,wf=n((()=>{of(),K(),lf()})),Tf=n((()=>{af(),ef(),of(),wf(),Qd()}));Tf(),On();var Ef=`body`,Df=3e3,Of=.8,kf=[`[data-loading="true"]`,`[aria-busy="true"]`,`.loading`,`.is-loading`,`.spinner`,`.skeleton`,`.bk-loading`],Af=[[.5,.5],[.25,.25],[.75,.25],[.25,.75],[.75,.75]],jf=e=>{if(!e)return``;let t=e.tagName.toLowerCase();return e.id?`${t}#${e.id}`:t},Mf=(e,t)=>e?t.some(t=>{try{return e.matches(t)||!!e.closest(t)}catch(e){return!1}}):!1,Nf=e=>{if(typeof document>`u`)return;if(document.readyState===`complete`||document.readyState===`interactive`){e();return}let t=()=>{document.removeEventListener(`DOMContentLoaded`,t),e()};document.addEventListener(`DOMContentLoaded`,t)},Pf=e=>{let t;return{name:`blank-screen`,enabled:!!e,init(n){var r,i,a,o;if(typeof window>`u`||typeof document>`u`)return;let s=typeof e==`object`?e:{},c=(r=s.rootSelector)==null?Ef:r,l=(i=s.checkDelay)==null?Df:i,u=(a=s.threshold)==null?Of:a,d=[...kf,...(o=s.ignoreSelectors)==null?[]:o],f=n.meter.createCounter(`browser.blank_screen.count`,{description:`Number of suspected blank screen detections`});Nf(()=>{t=window.setTimeout(()=>{var e,t;let r=document.querySelector(c),i=0,a=0;for(let[e,t]of Af){let n=document.elementFromPoint(window.innerWidth*e,window.innerHeight*t);if(Mf(n,d)){a+=1;continue}(n===r||n===document.body||n===document.documentElement)&&(i+=1)}let o=i/Af.length;if(a===Af.length)return;let s=o>=u,l={"bk.rum.blank_screen.score":o,"bk.rum.blank_screen.threshold":u,"bk.rum.blank_screen.root":c,"bk.rum.blank_screen.detected":s,"bk.rum.blank_screen.center_element":jf(document.elementFromPoint(window.innerWidth/2,window.innerHeight/2)),"bk.rum.blank_screen.dom_node_count":(e=(t=document.body)==null?void 0:t.getElementsByTagName(`*`).length)==null?0:e};s&&(f.add(1,n.applyRedact({"bk.rum.blank_screen.root":c})),n.emitLog({severityNumber:ln.ERROR,severityText:`ERROR`,body:`browser.blank_screen`,attributes:l}))},l)})},shutdown(){t!==void 0&&typeof window<`u`&&window.clearTimeout(t)}}};function Ff(e,t,n,r){for(let i=0,a=e.length;i<a;i++){let a=e[i];t&&a.setTracerProvider(t),n&&a.setMeterProvider(n),r&&a.setLoggerProvider&&a.setLoggerProvider(r),a.getConfig().enabled||a.enable()}}function If(e){e.forEach(e=>e.disable())}var Lf=n((()=>{}));function Rf(e){var t,n;let r=e.tracerProvider||z.getTracerProvider(),i=e.meterProvider||Ht.getMeterProvider(),a=e.loggerProvider||Dn.getLoggerProvider(),o=(t=(n=e.instrumentations)==null?void 0:n.flat())==null?[]:t;return Ff(o,r,i,a),()=>{If(o)}}var zf=n((()=>{B(),On(),Lf()}));function Bf(e,t,n){let r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}function Vf(e){e&&e.logger&&(typeof e.logger==`function`?Q=e.logger:Q(`new logger isn't a function, not replacing`))}var Q,Hf,Uf,Wf,Gf,Kf=n((()=>{Q=console.error.bind(console),Hf=(e,t,n)=>{if(!e||!e[t]){Q(`no original function `+String(t)+` to wrap`);return}if(!n){Q(`no wrapper function`),Q(Error().stack);return}let r=e[t];if(typeof r!=`function`||typeof n!=`function`){Q(`original object and wrapper must be functions`);return}let i=n(r,t);return Bf(i,`__original`,r),Bf(i,`__unwrap`,()=>{e[t]===i&&Bf(e,t,r)}),Bf(i,`__wrapped`,!0),Bf(e,t,i),i},Uf=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{Q(`must provide one or more modules to patch`),Q(Error().stack);return}if(!(t&&Array.isArray(t))){Q(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{Hf(e,t,n)})})},Wf=(e,t)=>{if(!e||!e[t]){Q(`no function to unwrap.`),Q(Error().stack);return}let n=e[t];if(!n.__unwrap)Q(`no original to unwrap to -- has `+String(t)+` already been unwrapped?`);else{n.__unwrap();return}},Gf=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{Q(`must provide one or more modules to patch`),Q(Error().stack);return}if(!(t&&Array.isArray(t))){Q(`must provide one or more functions to unwrap on modules`);return}e.forEach(e=>{t.forEach(t=>{Wf(e,t)})})},Vf.wrap=Hf,Vf.massWrap=Uf,Vf.unwrap=Wf,Vf.massUnwrap=Gf})),qf,Jf=n((()=>{B(),On(),Kf(),d(),Y(),qf=class{constructor(e,t,n){u(this,`_config`,{}),u(this,`_tracer`,void 0),u(this,`_meter`,void 0),u(this,`_logger`,void 0),u(this,`_diag`,void 0),u(this,`instrumentationName`,void 0),u(this,`instrumentationVersion`,void 0),u(this,`_wrap`,Hf),u(this,`_unwrap`,Wf),u(this,`_massWrap`,Uf),u(this,`_massUnwrap`,Gf),this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(n),this._diag=R.createComponentLogger({namespace:e}),this._tracer=z.getTracer(e,t),this._meter=Ht.getMeter(e,t),this._logger=Dn.getLogger(e,t),this._updateMetricInstruments()}get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){var e;let t=(e=this.init())==null?[]:e;return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config=J({enabled:!0},e)}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error(`Error running span customization hook due to exception in handler`,{triggerName:t},e)}}}})),Yf,Xf=n((()=>{Jf(),Yf=class extends qf{constructor(e,t,n){super(e,t,n),this._config.enabled&&this.enable()}}})),Zf=n((()=>{Xf(),B()}));function Qf(e,t,n){let r,i;try{i=e()}catch(e){r=e}finally{if(t(r,i),r&&!n)throw r;return i}}var $f=n((()=>{}));function ep(e,t){let n=$.OLD,r=t==null?void 0:t.split(`,`).map(e=>e.trim()).filter(e=>e!==``);for(let t of r==null?[]:r)if(t.toLowerCase()===e+`/dup`){n=$.DUPLICATE;break}else t.toLowerCase()===e&&(n=$.STABLE);return n}var $,tp=n((()=>{(function(e){e[e.STABLE=1]=`STABLE`,e[e.OLD=2]=`OLD`,e[e.DUPLICATE=3]=`DUPLICATE`})($||($={}))})),np=n((()=>{zf(),Zf(),d(),$f(),tp()}));np();var rp=()=>typeof window>`u`?`http://localhost`:window.location.origin,ip=e=>{try{return new URL(e,rp()).href}catch(t){return e}},ap=e=>e.length>1?e.replace(/\/+$/,``):e,op=(e,t)=>{let n=e=>ap(e.replace(/[?#].*$/,``));return n(e)===n(t)},sp=e=>{try{return new URL(e,rp()).origin===rp()}catch(e){return!1}},cp=(e,t)=>{let n=ip(t);return[e.traces.endpoint,e.metrics.endpoint,e.logs.endpoint].some(e=>op(n,ip(e)))},lp=(e,t)=>cp(e,t),up=(e,t)=>sp(t),dp,fp=n((()=>{(function(e){e.DOCUMENT_LOAD=`documentLoad`,e.DOCUMENT_FETCH=`documentFetch`,e.RESOURCE_FETCH=`resourceFetch`})(dp||(dp={}))})),pp,mp,hp=n((()=>{pp=`0.62.0`,mp=`@opentelemetry/instrumentation-document-load`})),gp,_p,vp=n((()=>{gp=`http.url`,_p=`http.user_agent`})),yp,bp=n((()=>{(function(e){e.FIRST_PAINT=`firstPaint`,e.FIRST_CONTENTFUL_PAINT=`firstContentfulPaint`})(yp||(yp={}))})),xp,Sp,Cp,wp=n((()=>{K(),bp(),xp=()=>{var e;let t={},n=(e=G.getEntriesByType)==null?void 0:e.call(G,`navigation`)[0];if(n)Object.values(X).forEach(e=>{if(df(n,e)){let r=n[e];typeof r==`number`&&(t[e]=r)}});else{let e=G.timing;e&&Object.values(X).forEach(n=>{if(df(e,n)){let r=e[n];typeof r==`number`&&(t[n]=r)}})}return t},Sp={"first-paint":yp.FIRST_PAINT,"first-contentful-paint":yp.FIRST_CONTENTFUL_PAINT},Cp=e=>{var t;let n=(t=G.getEntriesByType)==null?void 0:t.call(G,`paint`);n&&n.forEach(({name:t,startTime:n})=>{df(Sp,t)&&e.addEvent(Sp[t],n)})}})),Tp,Ep=n((()=>{B(),K(),Tf(),Qi(),fp(),hp(),vp(),wp(),d(),Tp=class extends Yf{constructor(e={}){super(mp,pp,e),u(this,`component`,`document-load`),u(this,`version`,`1`),u(this,`moduleName`,this.component),u(this,`_semconvStability`,void 0),this._semconvStability=ep(`http`,e==null?void 0:e.semconvStabilityOptIn)}init(){}_onDocumentLoaded(){window.setTimeout(()=>{this._collectPerformance()})}_addResourcesSpans(e){var t;let n=(t=G.getEntriesByType)==null?void 0:t.call(G,`resource`);n&&n.forEach(t=>{this._initResourceSpan(t,e)})}_collectPerformance(){let e=Array.from(document.getElementsByTagName(`meta`)).find(e=>e.getAttribute(`name`)===La),t=xp(),n=e&&e.content||``;L.with(nn.extract(ge,{traceparent:n}),()=>{var e;let n=this._startSpan(dp.DOCUMENT_LOAD,X.FETCH_START,t);n&&(L.with(z.setSpan(L.active(),n),()=>{let e=this._startSpan(dp.DOCUMENT_FETCH,X.FETCH_START,t);e&&(this._semconvStability&$.OLD&&e.setAttribute(gp,location.href),this._semconvStability&$.STABLE&&e.setAttribute(qi,location.href),L.with(z.setSpan(L.active(),e),()=>{var n;let r=!(this._semconvStability&$.OLD);ff(e,t,this.getConfig().ignoreNetworkEvents,void 0,r),this._addCustomAttributesOnSpan(e,(n=this.getConfig().applyCustomAttributesOnSpan)==null?void 0:n.documentFetch),this._endSpan(e,X.RESPONSE_END,t)}))}),this._semconvStability&$.OLD&&(n.setAttribute(gp,location.href),n.setAttribute(_p,navigator.userAgent)),this._semconvStability&$.STABLE&&(n.setAttribute(qi,location.href),n.setAttribute(Ji,navigator.userAgent)),this._addResourcesSpans(n),this.getConfig().ignoreNetworkEvents||(Z(n,X.FETCH_START,t),Z(n,X.UNLOAD_EVENT_START,t),Z(n,X.UNLOAD_EVENT_END,t),Z(n,X.DOM_INTERACTIVE,t),Z(n,X.DOM_CONTENT_LOADED_EVENT_START,t),Z(n,X.DOM_CONTENT_LOADED_EVENT_END,t),Z(n,X.DOM_COMPLETE,t),Z(n,X.LOAD_EVENT_START,t),Z(n,X.LOAD_EVENT_END,t)),this.getConfig().ignorePerformancePaintEvents||Cp(n),this._addCustomAttributesOnSpan(n,(e=this.getConfig().applyCustomAttributesOnSpan)==null?void 0:e.documentLoad),this._endSpan(n,X.LOAD_EVENT_END,t))})}_endSpan(e,t,n){e&&(df(n,t)?e.end(n[t]):e.end())}_initResourceSpan(e,t){let n=this._startSpan(dp.RESOURCE_FETCH,X.FETCH_START,e,t);if(n){var r;this._semconvStability&$.OLD&&n.setAttribute(gp,e.name),this._semconvStability&$.STABLE&&n.setAttribute(qi,e.name);let t=!(this._semconvStability&$.OLD);ff(n,e,this.getConfig().ignoreNetworkEvents,void 0,t),this._addCustomAttributesOnResourceSpan(n,e,(r=this.getConfig().applyCustomAttributesOnSpan)==null?void 0:r.resourceFetch),this._endSpan(n,X.RESPONSE_END,e)}}_startSpan(e,t,n,r){if(df(n,t)&&typeof n[t]==`number`)return this.tracer.startSpan(e,{startTime:n[t]},r?z.setSpan(L.active(),r):void 0)}_waitForPageLoad(){window.document.readyState===`complete`?this._onDocumentLoaded():(this._onDocumentLoaded=this._onDocumentLoaded.bind(this),window.addEventListener(`load`,this._onDocumentLoaded))}_addCustomAttributesOnSpan(e,t){t&&Qf(()=>t(e),e=>{e&&this._diag.error(`addCustomAttributesOnSpan`,e)},!0)}_addCustomAttributesOnResourceSpan(e,t,n){n&&Qf(()=>n(e,t),e=>{e&&this._diag.error(`addCustomAttributesOnResourceSpan`,e)},!0)}enable(){window.removeEventListener(`load`,this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener(`load`,this._onDocumentLoaded)}}})),Dp=r({AttributeNames:()=>dp,DocumentLoadInstrumentation:()=>Tp}),Op=n((()=>{Ep(),fp()})),kp,Ap=n((()=>{(function(e){e.COMPONENT=`component`,e.HTTP_STATUS_TEXT=`http.status_text`})(kp||(kp={}))})),jp,Mp,Np,Pp,Fp,Ip,Lp,Rp,zp=n((()=>{jp=`http.host`,Mp=`http.method`,Np=`http.request.body.size`,Pp=`http.request_content_length_uncompressed`,Fp=`http.scheme`,Ip=`http.status_code`,Lp=`http.url`,Rp=`http.user_agent`}));function Bp(...e){if(e[0]instanceof URL||typeof e[0]==`string`){let t=e[1];if(!(t!=null&&t.body))return Promise.resolve();if(t.body instanceof ReadableStream){let{body:e,length:n}=Vp(t.body);return t.body=e,n}else return Promise.resolve(Up(t.body))}else{let t=e[0];return t!=null&&t.body?t.clone().text().then(e=>Wp(e)):Promise.resolve()}}function Vp(e){if(!e.pipeThrough)return Yp.warn(`Platform has ReadableStream but not pipeThrough!`),{body:e,length:Promise.resolve(void 0)};let t=0,n,r=new Promise(e=>{n=e}),i=new TransformStream({start(){},transform(e,n){return p(function*(){let r=yield e;t+=r.byteLength,n.enqueue(e)})()},flush(){n(t)}});return{body:e.pipeThrough(i),length:r}}function Hp(e){return typeof Document<`u`&&e instanceof Document}function Up(e){if(Hp(e))return new XMLSerializer().serializeToString(document).length;if(typeof e==`string`)return Wp(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return Gp(e);if(e instanceof URLSearchParams)return Wp(e.toString());if(e.byteLength!==void 0)return e.byteLength;Yp.warn(`unknown body type`)}function Wp(e){return Xp.encode(e).byteLength}function Gp(e){let t=0;for(let[n,r]of e.entries())t+=n.length,r instanceof Blob?t+=r.size:t+=r.length;return t}function Kp(e){let t=qp(),n=e.toUpperCase();return n in t?n:`_OTHER`}function qp(){return Qp===void 0&&(Qp=Zp),Qp}function Jp(e){let t=Number(e.port||$p[e.protocol]);if(t&&!isNaN(t))return t}var Yp,Xp,Zp,Qp,$p,em=n((()=>{B(),K(),m(),Yp=R.createComponentLogger({namespace:`@opentelemetry/opentelemetry-instrumentation-fetch/utils`}),Xp=new TextEncoder,Zp={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0},$p={"https:":`443`,"http:":`80`}})),tm,nm=n((()=>{tm=`0.217.0`})),rm,im,am,om=n((()=>{B(),np(),K(),Tf(),Ap(),zp(),Qi(),em(),nm(),d(),rm=300,im=typeof PerformanceObserver<`u`,am=class extends Yf{constructor(e={}){super(`@opentelemetry/instrumentation-fetch`,tm,e),u(this,`component`,`fetch`),u(this,`version`,tm),u(this,`moduleName`,this.component),u(this,`_usedResources`,new WeakSet),u(this,`_tasksCount`,0),u(this,`_semconvStability`,void 0),this._semconvStability=ep(`http`,e==null?void 0:e.semconvStabilityOptIn)}init(){}_addChildSpan(e,t){let n=this.tracer.startSpan(`CORS Preflight`,{startTime:t[X.FETCH_START]},z.setSpan(L.active(),e)),r=!(this._semconvStability&$.OLD);ff(n,t,this.getConfig().ignoreNetworkEvents,void 0,r),n.end(t[X.RESPONSE_END])}_addFinalSpanAttributes(e,t){let n=vf(t.url);if(this._semconvStability&$.OLD&&(e.setAttribute(Ip,t.status),t.statusText!=null&&e.setAttribute(kp.HTTP_STATUS_TEXT,t.statusText),e.setAttribute(jp,n.host),e.setAttribute(Fp,n.protocol.replace(`:`,``)),typeof navigator<`u`&&e.setAttribute(Rp,navigator.userAgent)),this._semconvStability&$.STABLE){e.setAttribute(zi,t.status),e.setAttribute(Bi,n.hostname);let r=Jp(n);r&&e.setAttribute(Vi,r)}}_addHeaders(e,t){if(!Sf(t,this.getConfig().propagateTraceHeaderCorsUrls)){let e={};nn.inject(L.active(),e),Object.keys(e).length>0&&this._diag.debug(`headers inject skipped due to CORS policy`);return}if(e instanceof Request)nn.inject(L.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else{let t=new Headers(e.headers);nn.inject(L.active(),t,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))}),e.headers=t}}_clearResources(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(e,t={}){if(xo(e,this.getConfig().ignoreUrls)){this._diag.debug(`ignoring span as url matches ignored url`);return}let n=``,r={};if(this._semconvStability&$.OLD){let i=(t.method||`GET`).toUpperCase();n=`HTTP ${i}`,r[kp.COMPONENT]=this.moduleName,r[Mp]=i,r[Lp]=e}if(this._semconvStability&$.STABLE){let i=t.method,a=Kp(t.method||`GET`);n||(n=a),r[Li]=a,a!==i&&(r[Ri]=i),r[qi]=e}return this.tracer.startSpan(n,{kind:jt.CLIENT,attributes:r})}_findResourceAndAddNetworkEvents(e,t,n){let r=t.entries;if(!r.length){if(!performance.getEntriesByType)return;r=performance.getEntriesByType(`resource`)}let i=hf(t.spanUrl,t.startTime,n,r,this._usedResources,`fetch`);if(i.mainRequest){let t=i.mainRequest;this._markResourceAsUsed(t);let n=i.corsPreFlightRequest;n&&(this._addChildSpan(e,n),this._markResourceAsUsed(n));let r=!(this._semconvStability&$.OLD);ff(e,t,this.getConfig().ignoreNetworkEvents,void 0,r)}}_markResourceAsUsed(e){this._usedResources.add(e)}_endSpan(e,t,n){let r=ia(Date.now()),i=aa();this._addFinalSpanAttributes(e,n),this._semconvStability&$.STABLE&&n.status>=400&&(e.setStatus({code:I.ERROR}),e.setAttribute(Ni,String(n.status))),setTimeout(()=>{var n;(n=t.observer)==null||n.disconnect(),this._findResourceAndAddNetworkEvents(e,t,i),this._tasksCount--,this._clearResources(),e.end(r)},rm)}_patchConstructor(){return e=>{let t=this;return function(...n){if(!t._isEnabled)return e.apply(this,n);let r=this,i=vf(n[0]instanceof Request?n[0].url:String(n[0])).href,a;a=n[0]instanceof Request?n[1]==null?n[0]:new Request(n[0],n[1]):n[1]||{};let o=t._createSpan(i,a);if(!o)return e.apply(this,n);let s=t._prepareSpanData(i);t.getConfig().measureRequestSize&&Bp(...n).then(e=>{e&&(t._semconvStability&$.OLD&&o.setAttribute(Pp,e),t._semconvStability&$.STABLE&&o.setAttribute(Np,e))}).catch(e=>{t._diag.warn(`getFetchBodyLength`,e)});function c(e,n){t._applyAttributesAfterFetch(e,a,n),t._endSpan(e,s,{status:n.status||0,statusText:n.message,url:i})}function l(e,n){t._applyAttributesAfterFetch(e,a,n),n.status>=200&&n.status<400?t._endSpan(e,s,n):t._endSpan(e,s,{status:n.status,statusText:n.statusText,url:i})}function u(e,n){try{let t=n.clone().body;if(t){let r=t.getReader(),i=()=>{r.read().then(({done:t})=>{t?l(e,n):i()},t=>{c(e,t)})};i()}else l(e,n)}catch(n){t._diag.error(`Failed to read fetch response body`,n),t._endSpan(e,s,{status:0,url:i})}return n}function d(e,n){try{c(e,n)}catch(r){t._diag.error(`Failed to end span on fetch error`,r),t._endSpan(e,s,{status:n.status||0,url:i})}throw n}return L.with(z.setSpan(L.active(),o),()=>(t._callRequestHook(o,a),t._addHeaders(a,i),t._tasksCount++,e.apply(r,a instanceof Request?[a]:[i,a]).then(u.bind(r,o),d.bind(r,o))))}}}_applyAttributesAfterFetch(e,t,n){let r=this.getConfig().applyCustomAttributesOnSpan;r&&Qf(()=>r(e,t,n),e=>{e&&this._diag.error(`applyCustomAttributesOnSpan`,e)},!0)}_callRequestHook(e,t){let n=this.getConfig().requestHook;n&&Qf(()=>n(e,t),e=>{e&&this._diag.error(`requestHook`,e)},!0)}_prepareSpanData(e){let t=aa(),n=[];if(typeof PerformanceObserver!=`function`)return{entries:n,startTime:t,spanUrl:e};let r=new PerformanceObserver(t=>{t.getEntries().forEach(t=>{t.initiatorType===`fetch`&&t.name===e&&n.push(t)})});return r.observe({entryTypes:[`resource`]}),{entries:n,observer:r,startTime:t,spanUrl:e}}enable(){if(!im){this._diag.warn(`this instrumentation is intended for web usage only, it does not instrument server-side fetch()`);return}if(!this._isEnabled){if(this._isFetchPatched){this._diag.debug(`fetch constructor already patched`),this._isEnabled=!0;return}try{this._wrap(globalThis,`fetch`,this._patchConstructor()),this._isFetchPatched=!0,this._isEnabled=!0}catch(e){this._diag.warn(`Failed to patch globalThis.fetch; instrumentation will not be enabled. Another script may have locked globalThis.fetch via Object.defineProperty.`,e)}}}disable(){im&&this._isEnabled&&(this._isEnabled=!1,this._usedResources=new WeakSet)}}})),sm=r({FetchInstrumentation:()=>am}),cm=n((()=>{om()})),lm,um,dm,fm,pm,mm,hm,gm,_m=n((()=>{lm=`http.host`,um=`http.method`,dm=`http.request.body.size`,fm=`http.request_content_length_uncompressed`,pm=`http.scheme`,mm=`http.status_code`,hm=`http.url`,gm=`http.user_agent`})),vm,ym=n((()=>{(function(e){e.METHOD_OPEN=`open`,e.METHOD_SEND=`send`,e.EVENT_ABORT=`abort`,e.EVENT_ERROR=`error`,e.EVENT_LOAD=`loaded`,e.EVENT_TIMEOUT=`timeout`})(vm||(vm={}))}));function bm(e){return typeof Document<`u`&&e instanceof Document}function xm(e){if(bm(e))return new XMLSerializer().serializeToString(document).length;if(typeof e==`string`)return Sm(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return Cm(e);if(e instanceof URLSearchParams)return Sm(e.toString());if(e.byteLength!==void 0)return e.byteLength;Dm.warn(`unknown body type`)}function Sm(e){return Om.encode(e).byteLength}function Cm(e){let t=0;for(let[n,r]of e.entries())t+=n.length,r instanceof Blob?t+=r.size:t+=r.length;return t}function wm(e){let t=Tm(),n=e.toUpperCase();return n in t?n:`_OTHER`}function Tm(){return Am===void 0&&(Am=km),Am}function Em(e){let t=Number(e.port||jm[e.protocol]);if(t&&!isNaN(t))return t}var Dm,Om,km,Am,jm,Mm=n((()=>{B(),K(),Dm=R.createComponentLogger({namespace:`@opentelemetry/opentelemetry-instrumentation-xml-http-request/utils`}),Om=new TextEncoder,km={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0},jm={"https:":`443`,"http:":`80`}})),Nm,Pm=n((()=>{Nm=`0.217.0`})),Fm,Im=n((()=>{(function(e){e.HTTP_STATUS_TEXT=`http.status_text`})(Fm||(Fm={}))})),Lm,Rm,zm=n((()=>{B(),np(),K(),Tf(),Qi(),_m(),ym(),Mm(),Pm(),Im(),d(),Lm=300,Rm=class extends Yf{constructor(e={}){super(`@opentelemetry/instrumentation-xml-http-request`,Nm,e),u(this,`component`,`xml-http-request`),u(this,`version`,Nm),u(this,`moduleName`,this.component),u(this,`_tasksCount`,0),u(this,`_xhrMem`,new WeakMap),u(this,`_usedResources`,new WeakSet),u(this,`_semconvStability`,void 0),this._semconvStability=ep(`http`,e==null?void 0:e.semconvStabilityOptIn)}init(){}_addHeaders(e,t){let n=vf(t).href;if(!Sf(n,this.getConfig().propagateTraceHeaderCorsUrls)){let e={};nn.inject(L.active(),e),Object.keys(e).length>0&&this._diag.debug(`headers inject skipped due to CORS policy`);return}let r={};nn.inject(L.active(),r),Object.keys(r).forEach(t=>{e.setRequestHeader(t,String(r[t]))})}_addChildSpan(e,t){L.with(z.setSpan(L.active(),e),()=>{let e=this.tracer.startSpan(`CORS Preflight`,{startTime:t[X.FETCH_START]}),n=!(this._semconvStability&$.OLD);ff(e,t,this.getConfig().ignoreNetworkEvents,void 0,n),e.end(t[X.RESPONSE_END])})}_addFinalSpanAttributes(e,t,n){if(this._semconvStability&$.OLD){if(t.status!==void 0&&e.setAttribute(mm,t.status),t.statusText!==void 0&&e.setAttribute(Fm.HTTP_STATUS_TEXT,t.statusText),typeof n==`string`){let t=vf(n);e.setAttribute(lm,t.host),e.setAttribute(pm,t.protocol.replace(`:`,``))}e.setAttribute(gm,navigator.userAgent)}this._semconvStability&$.STABLE&&t.status&&e.setAttribute(zi,t.status)}_applyAttributesAfterXHR(e,t){let n=this.getConfig().applyCustomAttributesOnSpan;typeof n==`function`&&Qf(()=>n(e,t),e=>{e&&this._diag.error(`applyCustomAttributesOnSpan`,e)},!0)}_addResourceObserver(e,t){let n=this._xhrMem.get(e);!n||typeof PerformanceObserver!=`function`||typeof PerformanceResourceTiming!=`function`||(n.createdResources={observer:new PerformanceObserver(e=>{let r=e.getEntries(),i=vf(t);r.forEach(e=>{e.initiatorType===`xmlhttprequest`&&e.name===i.href&&n.createdResources&&n.createdResources.entries.push(e)})}),entries:[]},n.createdResources.observer.observe({entryTypes:[`resource`]}))}_clearResources(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(G.clearResourceTimings(),this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}_findResourceAndAddNetworkEvents(e,t,n,r,i){if(!n||!r||!i||!e.createdResources)return;let a=e.createdResources.entries;(!a||!a.length)&&(a=G.getEntriesByType(`resource`));let o=hf(vf(n).href,r,i,a,this._usedResources);if(o.mainRequest){let e=o.mainRequest;this._markResourceAsUsed(e);let n=o.corsPreFlightRequest;n&&(this._addChildSpan(t,n),this._markResourceAsUsed(n));let r=!(this._semconvStability&$.OLD);ff(t,e,this.getConfig().ignoreNetworkEvents,void 0,r)}}_cleanPreviousSpanInformation(e){let t=this._xhrMem.get(e);if(t){let n=t.callbackToRemoveEvents;n&&n(),this._xhrMem.delete(e)}}_createSpan(e,t,n){let r=vf(t);if(xo(r.href,this.getConfig().ignoreUrls)){this._diag.debug(`ignoring span as url matches ignored url`);return}let i=``,a={};if(this._semconvStability&$.OLD&&(i=n.toUpperCase(),a[um]=n,a[hm]=r.toString()),this._semconvStability&$.STABLE){let e=n,t=wm(n);i||(i=t),a[Li]=t,t!==e&&(a[Ri]=e),a[qi]=r.toString(),a[Bi]=r.hostname;let o=Em(r);o&&(a[Vi]=o)}let o=this.tracer.startSpan(i,{kind:jt.CLIENT,attributes:a});return o.addEvent(vm.METHOD_OPEN),this._cleanPreviousSpanInformation(e),this._xhrMem.set(e,{span:o,spanUrl:t}),o}_markResourceAsUsed(e){this._usedResources.add(e)}_patchOpen(){return e=>{let t=this;return function(...n){if(!t._isEnabled)return e.apply(this,n);let r=n[0],i=n[1];return t._createSpan(this,i,r),e.apply(this,n)}}}_patchSend(){let e=this;function t(t,n,r,i){let a=n.callbackToRemoveEvents;typeof a==`function`&&a();let{span:o,spanUrl:s,sendStartTime:c}=n;o&&(e._findResourceAndAddNetworkEvents(n,o,s,c,r),o.addEvent(t,i),e._addFinalSpanAttributes(o,n,s),o.end(i),e._tasksCount--),e._clearResources()}function n(n,r,i,a){let o=e._xhrMem.get(r);if(!o)return;if(o.status=r.status,o.statusText=r.statusText,e._xhrMem.delete(r),o.span){let t=o.span;e._applyAttributesAfterXHR(t,r),e._semconvStability&$.STABLE&&(i?a&&(t.setStatus({code:I.ERROR,message:a}),t.setAttribute(Ni,a)):o.status&&o.status>=400&&(t.setStatus({code:I.ERROR}),t.setAttribute(Ni,String(o.status))))}let s=aa(),c=Date.now();setTimeout(()=>{t(n,o,s,c)},Lm)}function r(){n(vm.EVENT_ERROR,this,!0,`error`)}function i(){n(vm.EVENT_ABORT,this,!1)}function a(){n(vm.EVENT_TIMEOUT,this,!0,`timeout`)}function o(){this.status<299?n(vm.EVENT_LOAD,this,!1):n(vm.EVENT_ERROR,this,!1)}function s(t){t.removeEventListener(`abort`,i),t.removeEventListener(`error`,r),t.removeEventListener(`load`,o),t.removeEventListener(`timeout`,a);let n=e._xhrMem.get(t);n&&(n.callbackToRemoveEvents=void 0)}return t=>function(...n){if(!e._isEnabled)return t.apply(this,n);let c=e._xhrMem.get(this);if(!c)return t.apply(this,n);let l=c.span,u=c.spanUrl;if(l&&u){if(e.getConfig().measureRequestSize&&n!=null&&n[0]){let t=n[0],r=xm(t);r!==void 0&&(e._semconvStability&$.OLD&&l.setAttribute(fm,r),e._semconvStability&$.STABLE&&l.setAttribute(dm,r))}L.with(z.setSpan(L.active(),l),()=>{e._tasksCount++,c.sendStartTime=aa(),l.addEvent(vm.METHOD_SEND),this.addEventListener(`abort`,i),this.addEventListener(`error`,r),this.addEventListener(`load`,o),this.addEventListener(`timeout`,a),c.callbackToRemoveEvents=()=>{s(this),c.createdResources&&c.createdResources.observer.disconnect()},e._addHeaders(this,u),e._addResourceObserver(this,u)})}return t.apply(this,n)}}enable(){if(!this._isEnabled){if(this._isXhrPatched){this._diag.debug(`reactivating existing patch on`,this.moduleName,this.version),this._isEnabled=!0;return}try{this._diag.debug(`applying patch to`,this.moduleName,this.version),this._wrap(XMLHttpRequest.prototype,`open`,this._patchOpen()),this._wrap(XMLHttpRequest.prototype,`send`,this._patchSend()),this._isXhrPatched=!0,this._isEnabled=!0}catch(e){this._unwrap(XMLHttpRequest.prototype,`open`),this._unwrap(XMLHttpRequest.prototype,`send`),this._diag.warn(`Failed to patch globalThis.XMLHttpRequest; instrumentation will not be enabled. Another script may have locked globalThis.XMLHttpRequest via Object.defineProperty.`,e)}}}disable(){this._isEnabled&&(this._isEnabled=!1,this._tasksCount=0,this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}}})),Bm=r({XMLHttpRequestInstrumentation:()=>Rm}),Vm=n((()=>{zm()})),Hm,Um=n((()=>{(function(e){e.EVENT_TYPE=`event_type`,e.TARGET_ELEMENT=`target_element`,e.TARGET_XPATH=`target_xpath`,e.HTTP_URL=`http.url`})(Hm||(Hm={}))})),Wm,Gm,Km=n((()=>{Wm=`0.61.0`,Gm=`@opentelemetry/instrumentation-user-interaction`}));function qm(){return!1}var Jm,Ym,Xm,Zm,Qm=n((()=>{np(),B(),K(),Tf(),Um(),Km(),d(),Jm=`OT_ZONE_CONTEXT`,Ym=`Navigation:`,Xm=[`click`],Zm=class extends Yf{constructor(e={}){var t;super(Gm,Wm,e),u(this,`version`,Wm),u(this,`moduleName`,`user-interaction`),u(this,`_spansData`,new WeakMap),u(this,`_wrappedListeners`,new WeakMap),u(this,`_eventsSpanMap`,new WeakMap),u(this,`_eventNames`,void 0),u(this,`_shouldPreventSpanCreation`,void 0),this._eventNames=new Set((t=e==null?void 0:e.eventNames)==null?Xm:t),this._shouldPreventSpanCreation=typeof(e==null?void 0:e.shouldPreventSpanCreation)==`function`?e.shouldPreventSpanCreation:qm}init(){}_checkForTimeout(e,t){let n=this._spansData.get(t);n&&(e.source===`setTimeout`?n.hrTimeLastTimeout=aa():e.source!==`Promise.then`&&e.source!==`setTimeout`&&(n.hrTimeLastTimeout=void 0))}_allowEventName(e){return this._eventNames.has(e)}_createSpan(e,t,n){if(!this._isEnabled||!(e instanceof HTMLElement)||!e.getAttribute||e.hasAttribute(`disabled`)||!this._allowEventName(t))return;let r=yf(e,!0);try{let i=this.tracer.startSpan(t,{attributes:{[Hm.EVENT_TYPE]:t,[Hm.TARGET_ELEMENT]:e.tagName,[Hm.TARGET_XPATH]:r,[Hm.HTTP_URL]:window.location.href}},n?z.setSpan(L.active(),n):void 0);return this._shouldPreventSpanCreation(t,e,i)===!0?void 0:(this._spansData.set(i,{taskCount:0}),i)}catch(e){this._diag.error(`failed to start create new user interaction span`,e)}}_decrementTask(e){let t=this._spansData.get(e);t&&(t.taskCount--,t.taskCount===0&&this._tryToEndSpan(e,t.hrTimeLastTimeout))}_getCurrentSpan(e){let t=e.get(Jm);return t&&z.getSpan(t)}_incrementTask(e){let t=this._spansData.get(e);t&&t.taskCount++}addPatchedListener(e,t,n,r){let i=this._wrappedListeners.get(n);i||(i=new Map,this._wrappedListeners.set(n,i));let a=i.get(t);return a||(a=new Map,i.set(t,a)),a.has(e)?!1:(a.set(e,r),!0)}removePatchedListener(e,t,n){let r=this._wrappedListeners.get(n);if(!r)return;let i=r.get(t);if(!i)return;let a=i.get(e);return a&&(i.delete(e),i.size===0&&(r.delete(t),r.size===0&&this._wrappedListeners.delete(n))),a}_invokeListener(e,t,n){return typeof e==`function`?e.apply(t,n):e.handleEvent(n[0])}_patchAddEventListener(){let e=this;return t=>function(n,r,i){if(!r)return t.call(this,n,r,i);let a=i&&typeof i==`object`&&i.once,o=function(...t){let i,o=t[0],s=o==null?void 0:o.target;o&&(i=e._eventsSpanMap.get(o)),a&&e.removePatchedListener(this,n,r);let c=e._createSpan(s,n,i);return c?(o&&e._eventsSpanMap.set(o,c),L.with(z.setSpan(L.active(),c),()=>{let n=e._invokeListener(r,this,t);return c.end(),n})):e._invokeListener(r,this,t)};if(e.addPatchedListener(this,n,r,o))return t.call(this,n,o,i)}}_patchRemoveEventListener(){let e=this;return t=>function(n,r,i){let a=e.removePatchedListener(this,n,r);return a?t.call(this,n,a,i):t.call(this,n,r,i)}}_getPatchableEventTargets(){return window.EventTarget?[EventTarget.prototype]:[Node.prototype,Window.prototype]}_patchHistoryApi(){this._isEnabled&&(this._wrap(history,`replaceState`,this._patchHistoryMethod()),this._wrap(history,`pushState`,this._patchHistoryMethod()),this._wrap(history,`back`,this._patchHistoryMethod()),this._wrap(history,`forward`,this._patchHistoryMethod()),this._wrap(history,`go`,this._patchHistoryMethod()))}_patchHistoryMethod(){let e=this;return t=>function(...n){if(!e._isEnabled)return t.apply(this,n);let r=`${location.pathname}${location.hash}${location.search}`,i=t.apply(this,n),a=`${location.pathname}${location.hash}${location.search}`;return r!==a&&e._updateInteractionName(a),i}}_updateInteractionName(e){let t=z.getSpan(L.active());t&&typeof t.updateName==`function`&&t.updateName(`${Ym} ${e}`)}_patchZoneCancelTask(){let e=this;return t=>function(n){let r=Zone.current,i=e._getCurrentSpan(r);return i&&e._shouldCountTask(n,r)&&e._decrementTask(i),t.call(this,n)}}_patchZoneScheduleTask(){let e=this;return t=>function(n){let r=Zone.current,i=e._getCurrentSpan(r);return i&&e._shouldCountTask(n,r)&&(e._incrementTask(i),e._checkForTimeout(n,i)),t.call(this,n)}}_patchZoneRunTask(){let e=this;return t=>function(n,r,i){let a=Array.isArray(i)&&i[0]instanceof Event?i[0]:void 0,o=a==null?void 0:a.target,s,c=this;if(o){if(s=e._createSpan(o,n.eventName),s)return e._incrementTask(s),c.run(()=>{try{return L.with(z.setSpan(L.active(),s),()=>{let e=Zone.current;return n._zone=e,t.call(e,n,r,i)})}finally{e._decrementTask(s)}})}else s=e._getCurrentSpan(c);try{return t.call(c,n,r,i)}finally{s&&e._shouldCountTask(n,c)&&e._decrementTask(s)}}}_shouldCountTask(e,t){if(e._zone&&(t=e._zone),!t||!e.data||e.data.isPeriodic)return!1;let n=this._getCurrentSpan(t);return!n||!this._spansData.get(n)?!1:e.type===`macroTask`||e.type===`microTask`}_tryToEndSpan(e,t){e&&this._spansData.get(e)&&(e.end(t),this._spansData.delete(e))}enable(){if(this._isEnabled||(this._isEnabled=!0,typeof this._zonePatched==`boolean`))return;let e=this._getZoneWithPrototype();this._diag.debug(`applying patch to`,this.moduleName,this.version,`zone:`,!!e),e?(this._zonePatched=!0,this._wrap(e.prototype,`runTask`,this._patchZoneRunTask()),this._wrap(e.prototype,`scheduleTask`,this._patchZoneScheduleTask()),this._wrap(e.prototype,`cancelTask`,this._patchZoneCancelTask())):(this._zonePatched=!1,this._getPatchableEventTargets().forEach(e=>{this._wrap(e,`addEventListener`,this._patchAddEventListener()),this._wrap(e,`removeEventListener`,this._patchRemoveEventListener())})),this._patchHistoryApi()}disable(){this._isEnabled&&(this._isEnabled=!1)}_getZoneWithPrototype(){return window.Zone}}})),$m=r({AttributeNames:()=>Hm,UserInteractionInstrumentation:()=>Zm}),eh=n((()=>{Qm(),Um()}));np(),m();var th=[`http.url`,`url.full`],nh=e=>({test:e}),rh=(e,t)=>{t.setAttributes(e.applyRedact(e.config.getPageAttributes()));for(let r of th){var n;let i=(n=t.attributes)==null?void 0:n[r];if(typeof i==`string`){let n=e.applyRedact({[r]:e.config.redactUrl(i)})[r];typeof n==`string`&&t.setAttribute(r,n)}}},ih=e=>{let t=[];return{name:`official-instrumentations`,enabled:!!(e.documentLoad||e.fetch||e.xhr||e.userInteraction),init(n){return p(function*(){let r=[],i=[nh(e=>lp(n.config,e))],a=[nh(e=>up(n.config,e))];if(e.documentLoad){let{DocumentLoadInstrumentation:e}=yield Promise.resolve().then(()=>(Op(),Dp));r.push(new e({semconvStabilityOptIn:`http`}))}if(e.fetch){let{FetchInstrumentation:e}=yield Promise.resolve().then(()=>(cm(),sm));r.push(new e({applyCustomAttributesOnSpan:e=>rh(n,e),ignoreUrls:i,propagateTraceHeaderCorsUrls:a,semconvStabilityOptIn:`http`,ignoreNetworkEvents:!1}))}if(e.xhr){let{XMLHttpRequestInstrumentation:e}=yield Promise.resolve().then(()=>(Vm(),Bm));r.push(new e({applyCustomAttributesOnSpan:e=>rh(n,e),ignoreUrls:i,propagateTraceHeaderCorsUrls:a,semconvStabilityOptIn:`http`,ignoreNetworkEvents:!1}))}if(e.userInteraction){let{UserInteractionInstrumentation:t}=yield Promise.resolve().then(()=>(eh(),$m)),n=typeof e.userInteraction==`object`?{eventNames:e.userInteraction.eventNames}:void 0;r.push(new t(n))}t.push(...r),Rf({instrumentations:r})})()},shutdown(){for(;t.length;){var e,n;(e=t.pop())==null||(n=e.disable)==null||n.call(e)}}}};On(),Y();var ah=e=>{let t;return{name:`csp-violation`,enabled:!!e,init(e){if(typeof window>`u`||typeof document>`u`)return;let n=t=>{e.emitLog({severityNumber:ln.WARN,severityText:`WARN`,body:`csp.violation`,attributes:J(J({},e.config.getPageAttributes()),{},{"csp.blocked_uri":e.config.redactUrl(t.blockedURI||``),"csp.violated_directive":t.violatedDirective,"csp.effective_directive":t.effectiveDirective,"csp.original_policy":t.originalPolicy,"csp.disposition":t.disposition,"csp.source_file":e.config.redactUrl(t.sourceFile||``),"csp.line_number":t.lineNumber,"csp.column_number":t.columnNumber,"csp.status_code":t.statusCode})})};document.addEventListener(`securitypolicyviolation`,n),t=()=>document.removeEventListener(`securitypolicyviolation`,n)},shutdown(){t==null||t(),t=void 0}}};Y();var oh=`bk_ot_session_id`,sh=()=>typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`device-${Date.now()}-${Math.random().toString(16).slice(2)}`,ch=e=>{try{let t=window.localStorage.getItem(e);if(t)return t;let n=sh();return window.localStorage.setItem(e,n),n}catch(e){return sh()}},lh=()=>{var e,t,n;if(typeof window>`u`)return{};let r=navigator.connection;return{"browser.viewport.width":window.innerWidth,"browser.viewport.height":window.innerHeight,"browser.screen.width":(e=window.screen)==null?void 0:e.width,"browser.screen.height":(t=window.screen)==null?void 0:t.height,"network.effective_type":(n=r==null?void 0:r.effectiveType)==null?r==null?void 0:r.type:n}},uh=e=>({name:`device`,enabled:!!e,init(t){var n;let r=typeof e==`object`?(n=e.storageKey)==null?oh:n:oh,i=typeof window>`u`?sh():ch(r);t.setRuntimeAttributes(J({"device.id":i},lh()))}});B(),On(),Y();var dh=6e4,fh=5,ph=e=>{if(e instanceof Error)return e.message;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch(t){return String(e)}},mh=e=>{var t;return e instanceof Error?(t=e.stack)==null?``:t:``},hh=e=>{let t=5381;for(let n=0;n<e.length;n++)t=t*33^e.charCodeAt(n);return(t>>>0).toString(36)},gh=(e,t)=>{let n=new Map;return{allow(r){let i=Date.now(),a=n.get(r);return!a||i-a.windowStart>e?(n.set(r,{count:1,windowStart:i}),!0):a.count>=t?!1:(a.count+=1,!0)}}},_h=({context:e,error:t,exceptionType:n,extra:r={},source:i,spanName:a,throttle:o})=>{let s=ph(t),c=mh(t),l=hh(`${i}|${s}|${c.slice(0,256)}`);if(!o.allow(l))return;let u=z.getActiveSpan(),d=t instanceof Error?t:{message:s,name:n==null?i:n},f=J(J(J({},e.config.getPageAttributes()),e.config.getErrorAttributes()),{},{"exception.message":s,"exception.stacktrace":c,"exception.type":t instanceof Error?t.name:n==null?i:n,"bk.rum.error.source":i,"bk.rum.error.fingerprint":l},r),p=e.startSpan(a,f);u==null||u.recordException(d),u==null||u.setStatus({code:I.ERROR,message:s}),p.recordException(d),p.setStatus({code:I.ERROR,message:s}),p.end(),e.emitLog({severityNumber:ln.ERROR,severityText:`ERROR`,body:s,attributes:f})},vh=e=>{let t=[];return{name:`error`,enabled:!!e,init(n){var r,i;if(typeof window>`u`)return;let a=gh(typeof e==`object`?(r=e.windowMs)==null?dh:r:dh,typeof e==`object`?(i=e.maxPerWindow)==null?fh:i:fh),o=e=>{var t;_h({context:n,throttle:a,spanName:`browser.error`,source:`window.error`,error:(t=e.error)==null?e.message:t,extra:{"code.filepath":e.filename,"code.lineno":e.lineno,"code.column":e.colno}})},s=e=>{_h({context:n,throttle:a,spanName:`browser.unhandledrejection`,source:`unhandledrejection`,error:e.reason,exceptionType:e.reason instanceof Error?e.reason.name:`UnhandledRejection`})},c=e=>{var t;let r=e.target;if(r===window)return;let i=r.src||r.href||``;_h({context:n,throttle:a,spanName:`browser.resource_error`,source:`resource`,error:Error(`Resource load failed: ${((t=r.tagName)==null?void 0:t.toLowerCase())||`unknown`} ${i}`),exceptionType:`ResourceError`,extra:{"url.full":n.config.redactUrl(i),"html.tag":r.tagName||``}})};window.addEventListener(`error`,o),window.addEventListener(`unhandledrejection`,s),window.addEventListener(`error`,c,!0),t.push(()=>window.removeEventListener(`error`,o),()=>window.removeEventListener(`unhandledrejection`,s),()=>window.removeEventListener(`error`,c,!0))},shutdown(){for(;t.length;){var e;(e=t.pop())==null||e()}}}};On(),m(),Y();var yh=10*1024,bh=(e,t)=>e.length<=t?{body:e,truncated:!1}:{body:e.slice(0,t),truncated:!0},xh=(e,t)=>{if(!e)return;if(e instanceof Headers)return e.get(t)||void 0;let n=t.toLowerCase();if(Array.isArray(e)){var r;return(r=e.find(([e])=>e.toLowerCase()===n))==null?void 0:r[1]}let i=Object.keys(e).find(e=>e.toLowerCase()===n);return i?e[i]:void 0},Sh=e=>{let t={};return e.forEach((e,n)=>{t[n]=e instanceof File?`[File name=${e.name} type=${e.type||`unknown`} size=${e.size}]`:e}),JSON.stringify(t)},Ch=function(){var e=p(function*(e){return e==null?``:typeof e==`string`?e:e instanceof URLSearchParams?e.toString():e instanceof FormData?Sh(e):e instanceof Blob?e.text():e instanceof ArrayBuffer||ArrayBuffer.isView(e)?new TextDecoder().decode(e):e instanceof Document?new XMLSerializer().serializeToString(e):String(e)});return function(t){return e.apply(this,arguments)}}(),wh=function(){var e=p(function*(e,t,n){let r=yield Ch(e);if(r)return J(J({},bh(r,t)),{},{contentType:n})});return function(t,n,r){return e.apply(this,arguments)}}(),Th=function(){var e=p(function*(e,t,n){try{return yield wh(e,t,n)}catch(e){return}});return function(t,n,r){return e.apply(this,arguments)}}(),Eh=e=>e instanceof Request?e.url:String(e),Dh=(e,t)=>t!=null&&t.method?t.method:e instanceof Request?e.method:`GET`,Oh=function(){var e=p(function*(e,t,n){if(t!=null&&t.body)return Th(t.body,n,xh(t.headers,`content-type`));if(e instanceof Request)try{return Th(yield e.clone().text(),n,e.headers.get(`content-type`)||void 0)}catch(e){return}});return function(t,n,r){return e.apply(this,arguments)}}(),kh=function(){var e=p(function*(e,t){try{let n=e.clone();return Th(n.body?yield n.text():``,t,e.headers.get(`content-type`)||void 0)}catch(e){return}});return function(t,n){return e.apply(this,arguments)}}(),Ah=(e,t)=>{if(e.responseType===``||e.responseType===`text`)return J(J({},bh(e.responseText||``,t)),{},{contentType:e.getResponseHeader(`content-type`)||void 0});if(e.responseType===`json`)return J(J({},bh(JSON.stringify(e.response),t)),{},{contentType:e.getResponseHeader(`content-type`)||void 0})},jh=(e,t,n)=>{if(n)return e.redact(J(J({},t),{},{body:n.body,truncated:n.truncated}))},Mh=({context:e,duration:t,error:n,method:r,request:i,response:a,status:o,url:s})=>{let c=e.config.rum.httpBody;if(!c)return;let l=!!n||typeof o==`number`&&o>=400,u=r.toUpperCase(),d=l?jh(c,{contentType:i==null?void 0:i.contentType,method:u,status:o,type:`request`,url:s},i):void 0,f=l?jh(c,{contentType:a==null?void 0:a.contentType,method:u,status:o,type:`response`,url:s},a):void 0,p=J(J({},e.config.getPageAttributes()),{},{"http.duration":t,"http.request.method":u,"url.full":e.config.redactUrl(s)});if(typeof o==`number`&&(p[`http.response.status_code`]=o),d!=null&&(p[`http.request.body`]=d),f!=null&&(p[`http.response.body`]=f),l){var m,h;p[`bk.rum.http_body.request.truncated`]=(m=i==null?void 0:i.truncated)==null?!1:m,p[`bk.rum.http_body.response.truncated`]=(h=a==null?void 0:a.truncated)==null?!1:h}if(n instanceof Error){var g;p[`exception.message`]=n.message,p[`exception.type`]=n.name,p[`exception.stacktrace`]=(g=n.stack)==null?``:g}e.emitLog({severityNumber:l?ln.ERROR:ln.INFO,severityText:l?`ERROR`:`INFO`,body:l?`HTTP request completed with error`:`HTTP request completed`,attributes:p})},Nh=e=>{let t=[];return{name:`http-body`,enabled:!!e,init(n){if(!e||typeof window>`u`)return;let r=e.maxBodySize||yh,i=window.fetch;typeof i==`function`&&(window.fetch=function(){var e=p(function*(e,t){let a=Eh(e);if(lp(n.config,a))return i(e,t);let o=Dh(e,t),s=yield Oh(e,t,r),c=performance.now();try{let l=yield i(e,t);return Mh({context:n,duration:performance.now()-c,method:o,request:s,response:l.status>=400?yield kh(l,r):void 0,status:l.status,url:a}),l}catch(e){throw Mh({context:n,duration:performance.now()-c,error:e,method:o,request:s,url:a}),e}});return function(t,n){return e.apply(this,arguments)}}(),t.push(()=>{window.fetch=i}));let a=XMLHttpRequest.prototype.open,o=XMLHttpRequest.prototype.send,s=XMLHttpRequest.prototype.setRequestHeader;XMLHttpRequest.prototype.open=function(e,t,...n){return this.__bkOtHttpBodyMeta__={method:e,startTime:performance.now(),url:String(t)},a.call(this,e,t,...n)},XMLHttpRequest.prototype.setRequestHeader=function(e,t){var n;return this.__bkOtHttpBodyRequestHeaders__=J(J({},(n=this.__bkOtHttpBodyRequestHeaders__)==null?{}:n),{},{[e]:t}),s.call(this,e,t)},XMLHttpRequest.prototype.send=function(e){return Th(e,r,xh(this.__bkOtHttpBodyRequestHeaders__,`content-type`)).then(e=>{this.__bkOtHttpBodyRequest__=e}),this.addEventListener(`loadend`,()=>{let e=this.__bkOtHttpBodyMeta__;if(!e||lp(n.config,e.url))return;let t=this.status>=400?Ah(this,r):void 0;Mh({context:n,duration:performance.now()-e.startTime,method:e.method,request:this.__bkOtHttpBodyRequest__,response:t,status:this.status,url:e.url})}),o.call(this,e)},t.push(()=>{XMLHttpRequest.prototype.open=a,XMLHttpRequest.prototype.send=o,XMLHttpRequest.prototype.setRequestHeader=s})},shutdown(){for(;t.length;){var e;(e=t.pop())==null||e()}}}};Y();var Ph=50,Fh=e=>{let t;return{name:`long-task`,enabled:!!e,init(n){var r;if(typeof PerformanceObserver>`u`)return;let i=PerformanceObserver.supportedEntryTypes;if(!(i!=null&&i.includes(`longtask`)))return;let a=typeof e==`object`?(r=e.threshold)==null?Ph:r:Ph,o=n.meter.createCounter(`browser.long_task.count`,{description:`Number of long tasks observed (duration >= threshold)`}),s=n.meter.createHistogram(`browser.long_task.duration`,{unit:`ms`,description:`Duration of long tasks`});try{t=new PerformanceObserver(e=>{for(let i of e.getEntries()){var t,r;if(i.duration<a)continue;let e=(t=i.attribution)==null?void 0:t[0],c=n.applyRedact(J(J(J({},n.config.getPageAttributes()),n.config.getMetricAttributes()),{},{"long_task.name":i.name,"long_task.attribution":(r=e==null?void 0:e.name)==null?`unknown`:r}));o.add(1,c),s.record(i.duration,c)}}),t.observe({type:`longtask`,buffered:!0})}catch(e){t=void 0}},shutdown(){t==null||t.disconnect(),t=void 0}}},Ih=new Set,Lh=``,Rh,zh,Bh=!1,Vh=()=>typeof location>`u`?``:location.href,Hh=(e,t)=>{let n=Vh();Lh=n;let r={fromUrl:t,source:e,toUrl:n};for(let e of Array.from(Ih))e(r)},Uh=()=>{Hh(`popstate`,Lh||Vh())},Wh=()=>{Hh(`hashchange`,Lh||Vh())},Gh=()=>{Bh||typeof window>`u`||typeof history>`u`||(Bh=!0,Lh=Vh(),Rh=history.pushState,zh=history.replaceState,history.pushState=function(e,t,n){let r=Lh||Vh(),i=Rh==null?void 0:Rh.apply(this,[e,t,n]);return Hh(`pushState`,r),i},history.replaceState=function(e,t,n){let r=Lh||Vh(),i=zh==null?void 0:zh.apply(this,[e,t,n]);return Hh(`replaceState`,r),i},window.addEventListener(`popstate`,Uh),window.addEventListener(`hashchange`,Wh))},Kh=()=>{!Bh||typeof window>`u`||typeof history>`u`||(Rh&&(history.pushState=Rh),zh&&(history.replaceState=zh),window.removeEventListener(`popstate`,Uh),window.removeEventListener(`hashchange`,Wh),Rh=void 0,zh=void 0,Bh=!1,Lh=``)},qh=e=>typeof window>`u`||typeof history>`u`?()=>{}:(Gh(),Ih.add(e),()=>{Ih.delete(e),Ih.size===0&&Kh()});Y();var Jh=()=>typeof location>`u`?``:location.href,Yh=e=>{let t=[];return{name:`page-view`,enabled:!!e,init(e){if(typeof window>`u`)return;let n=``,r=(t,r=n)=>{let i=Jh();i!==n&&(n=i,e.startSpan(`browser.page_view`,J(J({},e.config.getPageAttributes()),{},{"url.full":e.config.redactUrl(i),"url.previous":e.config.redactUrl(r),"document.referrer":e.config.redactUrl(document.referrer||``),"bk.rum.event.source":t})).end())},i=qh(e=>{r(e.source,e.fromUrl)});r(`load`),t.push(i)},shutdown(){for(;t.length;){var e;(e=t.pop())==null||e()}}}};Y();var Xh=e=>{let t=[];return{name:`route-timing`,enabled:!!e,init(e){if(typeof window>`u`||typeof history>`u`)return;let n=e.meter.createHistogram(`browser.route_change.duration`,{unit:`ms`,description:`Estimated SPA route change duration (route start to next idle)`}),r=(t,r,i)=>{let a=performance.now(),o=()=>{let o=performance.now()-a,s=e.applyRedact(J(J(J({},e.config.getPageAttributes()),e.config.getMetricAttributes()),{},{"route.change.source":t}));n.record(o,s),e.startSpan(`browser.route_change`,J(J({},s),{},{"url.full":e.config.redactUrl(i),"url.previous":e.config.redactUrl(r),"route.change.duration_ms":o})).end()};requestAnimationFrame(()=>requestAnimationFrame(()=>setTimeout(o,0)))},i=qh(e=>{e.fromUrl!==e.toUrl&&r(e.source,e.fromUrl,e.toUrl)});t.push(i)},shutdown(){for(;t.length;){var e;(e=t.pop())==null||e()}}}},Zh=`bk_ot_session`,Qh=1800*1e3,$h=()=>typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`session-${Date.now()}-${Math.random().toString(16).slice(2)}`,eg=e=>{try{var t;let n=(t=window.sessionStorage.getItem(e))==null?window.localStorage.getItem(e):t;if(!n)return null;let r=JSON.parse(n);return typeof(r==null?void 0:r.id)==`string`&&typeof(r==null?void 0:r.ts)==`number`?r:null}catch(e){return null}},tg=(e,t)=>{try{let n=JSON.stringify(t);window.sessionStorage.setItem(e,n),window.localStorage.setItem(e,n)}catch(e){}},ng=(e,t)=>{let n=Date.now(),r=eg(e);if(r&&n-r.ts<t){let t={id:r.id,ts:n};return tg(e,t),t.id}let i={id:$h(),ts:n};return tg(e,i),i.id},rg=e=>{let t;return{name:`session`,enabled:!!e,init(n){var r,i;let a=typeof e==`object`?(r=e.storageKey)==null?Zh:r:Zh,o=typeof e==`object`?(i=e.inactivityMs)==null?Qh:i:Qh,s=()=>{let e=typeof window>`u`?$h():ng(a,o);n.setRuntimeAttributes({"session.id":e})};if(s(),typeof window>`u`||typeof document>`u`)return;let c=()=>{document.visibilityState===`visible`&&s()};document.addEventListener(`visibilitychange`,c),t=()=>document.removeEventListener(`visibilitychange`,c)},shutdown(){t==null||t(),t=void 0}}},ig=r({CLSThresholds:()=>kg,FCPThresholds:()=>Dg,INPThresholds:()=>Ug,LCPThresholds:()=>Kg,TTFBThresholds:()=>Jg,onCLS:()=>jg,onFCP:()=>Mg,onINP:()=>Wg,onLCP:()=>qg,onTTFB:()=>Xg});function ag(e,t){return dg.get(e)||dg.set(e,new t),dg.get(e)}var og,sg,cg,lg,ug,dg,fg,pg,mg,hg,gg,_g,vg,yg,bg,xg,Sg,Cg,wg,Tg,Eg,Dg,Og,kg,Ag,jg,Mg,Ng,Pg,Fg,Ig,Lg,Rg,zg,Bg,Vg,Hg,Ug,Wg,Gg,Kg,qg,Jg,Yg,Xg,Zg=n((()=>{d(),Y(),og=class{constructor(){u(this,`t`,void 0),u(this,`o`,0),u(this,`i`,[])}u(e){var t;if(e.hadRecentInput)return;let n=this.i[0],r=this.i.at(-1);this.o&&n&&r&&e.startTime-r.startTime<1e3&&e.startTime-n.startTime<5e3?(this.o+=e.value,this.i.push(e)):(this.o=e.value,this.i=[e]),(t=this.t)==null||t.call(this,e)}},sg=()=>{let e=performance.getEntriesByType(`navigation`)[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},cg=e=>{if(document.readyState===`loading`)return`loading`;let t=sg();if(t){if(e<t.domInteractive)return`loading`;if(t.domContentLoadedEventStart===0||e<t.domContentLoadedEventStart)return`dom-interactive`;if(t.domComplete===0||e<t.domComplete)return`dom-content-loaded`}return`complete`},lg=e=>{let t=e.nodeName;return e.nodeType===1?t.toLowerCase():t.toUpperCase().replace(/^#/,``)},ug=e=>{let t=``;try{for(;(e==null?void 0:e.nodeType)!==9;){let n=e,r=n.id?`#`+n.id:[lg(n),...Array.from(n.classList).sort()].join(`.`);if(t.length+r.length>99)return t||r;if(t=t?r+`>`+t:r,n.id)break;e=n.parentNode}}catch(e){}return t},dg=new WeakMap,fg=-1,pg=()=>fg,mg=e=>{addEventListener(`pageshow`,t=>{t.persisted&&(fg=t.timeStamp,e(t))},!0)},hg=(e,t,n,r)=>{let i,a;return o=>{var s;t.value>=0&&(o||r)&&(a=t.value-((s=i)==null?0:s),(a||i===void 0)&&(i=t.value,t.delta=a,t.rating=((e,t)=>e>t[1]?`poor`:e>t[0]?`needs-improvement`:`good`)(t.value,n),e(t)))}},gg=e=>{requestAnimationFrame(()=>requestAnimationFrame(e))},_g=()=>{var e,t;return(e=(t=sg())==null?void 0:t.activationStart)==null?0:e},vg=(e,t=-1)=>{let n=sg(),r=`navigate`;return pg()>=0?r=`back-forward-cache`:n&&(document.prerendering||_g()>0?r=`prerender`:document.wasDiscarded?r=`restore`:n.type&&(r=n.type.replace(/_/g,`-`))),{name:e,value:t,rating:`good`,delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+0xe8d4a51000}`,navigationType:r}},yg=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(e=>{queueMicrotask(()=>{t(e.getEntries())})});return r.observe(J({type:e,buffered:!0},n)),r}}catch(e){}},bg=e=>{let t=!1;return()=>{t||(e(),t=!0)}},xg=-1,Sg=new Set,Cg=()=>document.visibilityState!==`hidden`||document.prerendering?1/0:0,wg=e=>{if(document.visibilityState===`hidden`){if(e.type===`visibilitychange`)for(let e of Sg)e();isFinite(xg)||(xg=e.type===`visibilitychange`?e.timeStamp:0,removeEventListener(`prerenderingchange`,wg,!0))}},Tg=()=>{if(xg<0){var e;let t=_g(),n=document.prerendering||(e=globalThis.performance.getEntriesByType(`visibility-state`).find(e=>e.name===`hidden`&&e.startTime>=t))==null?void 0:e.startTime;xg=n==null?Cg():n,addEventListener(`visibilitychange`,wg,!0),addEventListener(`prerenderingchange`,wg,!0),mg(()=>{setTimeout(()=>{xg=Cg()})})}return{get firstHiddenTime(){return xg},onHidden(e){Sg.add(e)}}},Eg=e=>{document.prerendering?addEventListener(`prerenderingchange`,e,!0):e()},Dg=[1800,3e3],Og=(e,t={})=>{Eg(()=>{let n=Tg(),r,i=vg(`FCP`),a=yg(`paint`,e=>{for(let t of e)t.name===`first-contentful-paint`&&(a.disconnect(),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-_g(),0),i.entries.push(t),r(!0)))});a&&(r=hg(e,i,Dg,t.reportAllChanges),mg(n=>{i=vg(`FCP`),r=hg(e,i,Dg,t.reportAllChanges),gg(()=>{i.value=performance.now()-n.timeStamp,r(!0)})}))})},kg=[.1,.25],Ag=e=>e.find(e=>{var t;return((t=e.node)==null?void 0:t.nodeType)===1})||e[0],jg=(e,t={})=>{let n=ag(t=Object.assign({},t),og),r=new WeakMap;n.t=e=>{var n;if(!(e==null||(n=e.sources)==null)&&n.length){let n=Ag(e.sources),o=n==null?void 0:n.node;if(o){var i,a;let e=(i=(a=t.generateTarget)==null?void 0:a.call(t,o))==null?ug(o):i;r.set(n,e)}}},((e,t={})=>{let n=Tg();Og(bg(()=>{let r,i=vg(`CLS`,0),a=ag(t,og),o=e=>{for(let t of e)a.u(t);a.o>i.value&&(i.value=a.o,i.entries=a.i,r())},s=yg(`layout-shift`,o);s&&(r=hg(e,i,kg,t.reportAllChanges),n.onHidden(()=>{o(s.takeRecords()),r(!0)}),mg(()=>{a.o=0,i=vg(`CLS`,0),r=hg(e,i,kg,t.reportAllChanges),gg(r)}),setTimeout(r))}))})(t=>{e((e=>{let t={};if(e.entries.length){var n;let i=e.entries.reduce((e,t)=>e.value>t.value?e:t);if(!(i==null||(n=i.sources)==null)&&n.length){let e=Ag(i.sources);e&&(t={largestShiftTarget:r.get(e),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:e,largestShiftEntry:i,loadState:cg(i.startTime)})}}return Object.assign(e,{attribution:t})})(t))},t)},Mg=(e,t={})=>{Og(t=>{e((e=>{let t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:cg(pg())};if(e.entries.length){let n=sg(),r=e.entries.at(-1);if(n){let i=n.activationStart||0,a=Math.max(0,n.responseStart-i);t={timeToFirstByte:a,firstByteToFCP:e.value-a,loadState:cg(e.entries[0].startTime),navigationEntry:n,fcpEntry:r}}}return Object.assign(e,{attribution:t})})(t))},t)},Ng=0,Pg=1/0,Fg=0,Ig=e=>{for(let t of e)t.interactionId&&(Pg=Math.min(Pg,t.interactionId),Fg=Math.max(Fg,t.interactionId),Ng=Fg?(Fg-Pg)/7+1:0)},Rg=()=>{var e;return Lg?Ng:(e=performance.interactionCount)==null?0:e},zg=()=>{`interactionCount`in performance||Lg||(Lg=yg(`event`,Ig,{durationThreshold:0}))},Bg=0,Vg=class{constructor(){u(this,`l`,[]),u(this,`h`,new Map),u(this,`m`,void 0),u(this,`p`,void 0)}v(){Bg=Rg(),this.l.length=0,this.h.clear()}M(){let e=Math.min(this.l.length-1,Math.floor((Rg()-Bg)/50));return this.l[e]}u(e){var t;if((t=this.m)==null||t.call(this,e),!e.interactionId&&e.entryType!==`first-input`)return;let n=this.l.at(-1),r=this.h.get(e.interactionId);if(r||this.l.length<10||e.duration>n.T){var i;if(r?e.duration>r.T?(r.entries=[e],r.T=e.duration):e.duration===r.T&&e.startTime===r.entries[0].startTime&&r.entries.push(e):(r={id:e.interactionId,entries:[e],T:e.duration},this.h.set(r.id,r),this.l.push(r)),this.l.sort((e,t)=>t.T-e.T),this.l.length>10){let e=this.l.splice(10);for(let t of e)this.h.delete(t.id)}(i=this.p)==null||i.call(this,r)}}},Hg=e=>{let t=globalThis.requestIdleCallback||setTimeout,n=globalThis.cancelIdleCallback||clearTimeout;if(document.visibilityState===`hidden`)e();else{let r=bg(e),i=-1,a=()=>{n(i),r()};addEventListener(`visibilitychange`,a,{once:!0,capture:!0}),i=t(()=>{removeEventListener(`visibilitychange`,a,{capture:!0}),r()})}},Ug=[200,500],Wg=(e,t={})=>{let n=ag(t=Object.assign({},t),Vg),r=[],i=[],a=0,o=new WeakMap,s=new WeakMap,c=!1,l=()=>{c||(Hg(u),c=!0)},u=()=>{let e=new Set(n.l.map(e=>o.get(e.entries[0]))),t=i.length-10;i=i.filter((n,r)=>r>=t||e.has(n));let s=new Set;for(let e of i){let t=d(e.startTime,e.processingEnd);for(let e of t)s.add(e)}r=r.filter(e=>e.startTime>a||s.has(e)),c=!1};n.m=e=>{let n=e.startTime+e.duration,r;a=Math.max(a,e.processingEnd);for(let a=i.length-1;a>=0;a--){let o=i[a];if(Math.abs(n-o.renderTime)<=8){r=o,r.startTime=Math.min(e.startTime,r.startTime),r.processingStart=Math.min(e.processingStart,r.processingStart),r.processingEnd=Math.max(e.processingEnd,r.processingEnd),!1!==t.includeProcessedEventEntries&&r.entries.push(e);break}}r||(r={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:n,entries:!1===t.includeProcessedEventEntries?[]:[e]},i.push(r)),(e.interactionId||e.entryType===`first-input`)&&o.set(e,r),l()},n.p=e=>{if(!s.get(e)){let i=e.entries[0].target;if(i){var n,r;let a=(n=(r=t.generateTarget)==null?void 0:r.call(t,i))==null?ug(i):n;s.set(e,a)}}};let d=(e,t)=>{let n=[];for(let i of r)if(!(i.startTime+i.duration<e)){if(i.startTime>t)break;n.push(i)}return n},f=e=>{let t=e.entries[0],r=o.get(t),i=t.processingStart,a=Math.max(t.startTime+t.duration,i),c=Math.min(r.processingEnd,a),l=r.entries.sort((e,t)=>e.processingStart-t.processingStart),u=d(t.startTime,c),f=n.h.get(t.interactionId),p={interactionTarget:s.get(f),interactionType:t.name.startsWith(`key`)?`keyboard`:`pointer`,interactionTime:t.startTime,nextPaintTime:a,processedEventEntries:l,longAnimationFrameEntries:u,inputDelay:i-t.startTime,processingDuration:c-i,presentationDelay:a-c,loadState:cg(t.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return(e=>{var t;if(!((t=e.longAnimationFrameEntries)!=null&&t.length))return;let n=e.interactionTime,r=e.inputDelay,i=e.processingDuration,a,o,s=0,c=0,l=0,u=0;for(let t of e.longAnimationFrameEntries){c=c+t.startTime+t.duration-t.styleAndLayoutStart;for(let e of t.scripts){let t=e.startTime+e.duration;if(t<n)continue;let l=t-Math.max(n,e.startTime),d=e.duration?l/e.duration*e.forcedStyleAndLayoutDuration:0;s+=l-d,c+=d,l>u&&(o=e.startTime<n+r?`input-delay`:e.startTime>=n+r+i?`presentation-delay`:`processing-duration`,a=e,u=l)}}let d=e.longAnimationFrameEntries.at(-1),f=d?d.startTime+d.duration:0;f>=n+r+i&&(l=e.nextPaintTime-f),a&&o&&(e.longestScript={entry:a,subpart:o,intersectingDuration:u}),e.totalScriptDuration=s,e.totalStyleAndLayoutDuration=c,e.totalPaintDuration=l,e.totalUnattributedDuration=e.nextPaintTime-n-s-c-l})(p),Object.assign(e,{attribution:p})};yg(`long-animation-frame`,e=>{r=r.concat(e),l()}),((e,t={})=>{if(!globalThis.PerformanceEventTiming||!(`interactionId`in PerformanceEventTiming.prototype))return;let n=Tg();Eg(()=>{var r;zg();let i,a=vg(`INP`),o=ag(t,Vg),s=e=>{Hg(()=>{for(let t of e)o.u(t);let t=o.M();t&&t.T!==a.value&&(a.value=t.T,a.entries=t.entries,i())})},c=yg(`event`,s,{durationThreshold:(r=t.durationThreshold)==null?40:r});i=hg(e,a,Ug,t.reportAllChanges),c&&(c.observe({type:`first-input`,buffered:!0}),n.onHidden(()=>{s(c.takeRecords()),i(!0)}),mg(()=>{o.v(),a=vg(`INP`),i=hg(e,a,Ug,t.reportAllChanges)}))})})(t=>{e(f(t))},t)},Gg=class{constructor(){u(this,`m`,void 0)}u(e){var t;(t=this.m)==null||t.call(this,e)}},Kg=[2500,4e3],qg=(e,t={})=>{let n=ag(t=Object.assign({},t),Gg),r=new WeakMap;n.m=e=>{let n=e.element;if(n){var i,a;let o=(i=(a=t.generateTarget)==null?void 0:a.call(t,n))==null?ug(n):i;r.set(e,o)}else e.id&&r.set(e,`#${e.id}`)},((e,t={})=>{Eg(()=>{let n=Tg(),r,i=vg(`LCP`),a=ag(t,Gg),o=e=>{t.reportAllChanges||(e=e.slice(-1));for(let t of e)a.u(t),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-_g(),0),i.entries=[t],r())},s=yg(`largest-contentful-paint`,o);if(s){r=hg(e,i,Kg,t.reportAllChanges);let n=bg(()=>{o(s.takeRecords()),s.disconnect(),r(!0)}),a=e=>{e.isTrusted&&(Hg(n),removeEventListener(e.type,a,{capture:!0}))};for(let e of[`keydown`,`click`,`visibilitychange`])addEventListener(e,a,{capture:!0});mg(n=>{i=vg(`LCP`),r=hg(e,i,Kg,t.reportAllChanges),gg(()=>{i.value=performance.now()-n.timeStamp,r(!0)})})}})})(t=>{e((e=>{let t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){let n=e.entries.at(-1),i=n.url&&performance.getEntriesByType(`resource`).find(e=>e.name===n.url);t.target=r.get(n),t.lcpEntry=n,n.url&&(t.url=n.url),i&&(t.lcpResourceEntry=i);let a=sg();if(a){let n=a.activationStart||0,r=Math.max(0,a.responseStart-n),o=Math.max(r,i?(i.requestStart||i.startTime)-n:0),s=Math.min(e.value,Math.max(o,i?i.responseEnd-n:0));t=J(J({},t),{},{timeToFirstByte:r,resourceLoadDelay:o-r,resourceLoadDuration:s-o,elementRenderDelay:e.value-s,navigationEntry:a})}}return Object.assign(e,{attribution:t})})(t))},t)},Jg=[800,1800],Yg=e=>{document.prerendering?Eg(()=>Yg(e)):document.readyState===`complete`?setTimeout(e):addEventListener(`load`,()=>Yg(e),!0)},Xg=(e,t={})=>{((e,t={})=>{let n=vg(`TTFB`),r=hg(e,n,Jg,t.reportAllChanges);Yg(()=>{let i=sg();i&&(n.value=Math.max(i.responseStart-_g(),0),n.entries=[i],r(!0),mg(()=>{n=vg(`TTFB`,0),r=hg(e,n,Jg,t.reportAllChanges),r(!0)}))})})(t=>{e((e=>{let t={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(e.entries.length){let n=e.entries[0],r=n.activationStart||0,i=Math.max((n.workerStart||n.fetchStart)-r,0),a=Math.max(n.domainLookupStart-r,0),o=Math.max(n.connectStart-r,0),s=Math.max(n.connectEnd-r,0);t={waitingDuration:i,cacheDuration:a-i,dnsDuration:o-a,connectionDuration:s-o,requestDuration:e.value-s,navigationEntry:n}}return Object.assign(e,{attribution:t})})(t))},t)}}));Y(),m();var Qg=()=>{let e=performance.getEntriesByType(`navigation`)[0];return(e==null?void 0:e.type)||`unknown`},$g=e=>({"rum.navigation.type":Qg(),"web_vital.name":e.name,"web_vital.rating":e.rating}),e_=(e,t)=>{var n;let r=(n=e.attribution)==null?{}:n,i={},a=(e,t,n)=>{t!=null&&(typeof t==`string`||typeof t==`number`||typeof t==`boolean`)&&(i[e]=typeof t==`string`&&n?n(t):t)};switch(e.name){case`LCP`:a(`web_vital.lcp.url`,r.url,t),a(`web_vital.lcp.target`,r.target),a(`web_vital.lcp.element_render_delay`,r.elementRenderDelay),a(`web_vital.lcp.resource_load_duration`,r.resourceLoadDuration),a(`web_vital.lcp.time_to_first_byte`,r.timeToFirstByte);break;case`CLS`:a(`web_vital.cls.largest_shift_target`,r.largestShiftTarget),a(`web_vital.cls.largest_shift_value`,r.largestShiftValue),a(`web_vital.cls.load_state`,r.loadState);break;case`INP`:a(`web_vital.inp.interaction_target`,r.interactionTarget),a(`web_vital.inp.interaction_type`,r.interactionType),a(`web_vital.inp.input_delay`,r.inputDelay),a(`web_vital.inp.processing_duration`,r.processingDuration),a(`web_vital.inp.presentation_delay`,r.presentationDelay);break;case`FCP`:a(`web_vital.fcp.time_to_first_byte`,r.timeToFirstByte),a(`web_vital.fcp.load_state`,r.loadState);break;case`TTFB`:a(`web_vital.ttfb.waiting_duration`,r.waitingDuration),a(`web_vital.ttfb.dns_duration`,r.dnsDuration),a(`web_vital.ttfb.connection_duration`,r.connectionDuration),a(`web_vital.ttfb.request_duration`,r.requestDuration);break;default:break}return i},t_=e=>({name:`web-vitals`,enabled:!!e,init(e){return p(function*(){if(typeof window>`u`)return;let{onCLS:t,onFCP:n,onINP:r,onLCP:i,onTTFB:a}=yield Promise.resolve().then(()=>(Zg(),ig)),o=e.meter.createHistogram(`browser.web_vital.cls`,{unit:`1`,description:`Cumulative Layout Shift`}),s=e.meter.createHistogram(`browser.web_vital.duration`,{unit:`ms`,description:`Web Vitals duration metrics, including FCP, INP, LCP and TTFB`}),c=t=>{e.startSpan(`browser.web_vital`,J(J(J(J({},e.config.getPageAttributes()),e.config.getMetricAttributes()),$g(t)),{},{"web_vital.id":t.id,"web_vital.value":t.value},e_(t,e.config.redactUrl))).end()},l=t=>{s.record(t.value,e.applyRedact(J(J(J({},e.config.getPageAttributes()),e.config.getMetricAttributes()),$g(t)))),c(t)};t(t=>{o.record(t.value,e.applyRedact(J(J(J({},e.config.getPageAttributes()),e.config.getMetricAttributes()),$g(t)))),c(t)}),n(l),r(l),i(l),a(l)})()}});B(),On(),Y();var n_=e=>e==null?0:typeof e==`string`?typeof TextEncoder>`u`?e.length:new TextEncoder().encode(e).byteLength:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:typeof Blob<`u`&&e instanceof Blob?e.size:0,r_=(e,t)=>{let n={"url.full":t(e),"network.protocol.name":`websocket`};try{n[`server.address`]=new URL(e,typeof location>`u`?`http://localhost`:location.href).host}catch(e){}return{spanAttributes:n,metricAttributes:{"network.protocol.name":`websocket`}}},i_=e=>{let t;return{name:`websocket`,enabled:!!e,init(e){if(typeof window>`u`||window.WebSocket===void 0)return;let n=window.WebSocket;t=n;let r=e.meter.createCounter(`browser.websocket.message.count`,{description:`Total number of WebSocket messages observed`}),i=e.meter.createCounter(`browser.websocket.message.bytes`,{unit:`By`,description:`Total bytes transferred over WebSocket (best-effort)`}),a=e.meter.createCounter(`browser.websocket.error.count`,{description:`Total number of WebSocket error events`}),o=function(t,o){let s=t.toString();if(lp(e.config,s))return o===void 0?new n(t):new n(t,o);let{metricAttributes:c,spanAttributes:l}=r_(s,e.config.redactUrl),u=e.startSpan(`websocket.connect`,l),d=performance.now(),f=o===void 0?new n(t):new n(t,o),p=!1,m=e=>{p||(p=!0,e===`error`&&u.setStatus({code:I.ERROR,message:`websocket connect failed`}),u.setAttribute(`websocket.connect.duration_ms`,performance.now()-d),u.end())};f.addEventListener(`open`,()=>m(`opened`)),f.addEventListener(`message`,e=>{r.add(1,J(J({},c),{},{"websocket.direction":`in`})),i.add(n_(e.data),J(J({},c),{},{"websocket.direction":`in`}))}),f.addEventListener(`error`,()=>{a.add(1,c),m(`error`),e.emitLog({severityNumber:ln.ERROR,severityText:`ERROR`,body:`websocket.error`,attributes:l})}),f.addEventListener(`close`,t=>{m(`opened`),e.emitLog({severityNumber:ln.INFO,severityText:`INFO`,body:`websocket.close`,attributes:J(J({},l),{},{"websocket.close.code":t.code,"websocket.close.reason":t.reason,"websocket.close.was_clean":t.wasClean})})});let h=f.send.bind(f);return f.send=e=>(r.add(1,J(J({},c),{},{"websocket.direction":`out`})),i.add(n_(e),J(J({},c),{},{"websocket.direction":`out`})),h(e)),f};o.prototype=n.prototype,Object.assign(o,n),window.WebSocket=o},shutdown(){t&&typeof window<`u`&&(window.WebSocket=t)}}};Y();var a_=`http://localhost:4318`,o_=10*1e3,s_=e=>e.replace(/\/+$/,``),c_=(e,t)=>{let n=s_(e||a_);return n.endsWith(`/v1/${t}`)?n:n.endsWith(`/v1`)?`${n}/${t}`:`${n}/v1/${t}`},l_=(e,t)=>{var n;let r=e.token||e.headers?J(J({},e.token?{Authorization:`Bearer ${e.token}`}:{}),(n=e.headers)==null?{}:n):void 0;return{endpoint:c_(e.endpoint,t),headers:r}},u_=e=>typeof e!=`number`||!Number.isFinite(e)?1:Math.max(0,Math.min(1,e)),d_=(e,t)=>typeof e==`number`&&Number.isFinite(e)&&e>0?e:t,f_=(e,t)=>typeof e==`number`&&Number.isFinite(e)&&e>=0?e:t,p_=(e,t)=>typeof e!=`number`||!Number.isFinite(e)?t:Math.max(0,Math.min(1,e)),m_=e=>e.body,h_=e=>{var t;return e?typeof e==`boolean`?{maxBodySize:10*1024,redact:m_}:{maxBodySize:d_(e.maxBodySize,10*1024),redact:(t=e.redact)==null?m_:t}:!1},g_=e=>{var t,n,r,i,a,o,s,c,l,u;return{device:(t=e==null?void 0:e.device)==null?!0:t,httpBody:h_(e==null?void 0:e.httpBody),session:typeof(e==null?void 0:e.session)==`object`?J(J({},e.session),{},{inactivityMs:d_(e.session.inactivityMs,1800*1e3)}):(n=e==null?void 0:e.session)==null?!0:n,pageView:(r=e==null?void 0:e.pageView)==null?!0:r,error:typeof(e==null?void 0:e.error)==`object`?J(J({},e.error),{},{maxPerWindow:d_(e.error.maxPerWindow,5),windowMs:d_(e.error.windowMs,6e4)}):(i=e==null?void 0:e.error)==null?!0:i,webVitals:(a=e==null?void 0:e.webVitals)==null?!0:a,blankScreen:typeof(e==null?void 0:e.blankScreen)==`object`?J(J({},e.blankScreen),{},{checkDelay:f_(e.blankScreen.checkDelay,3e3),threshold:p_(e.blankScreen.threshold,.8)}):(o=e==null?void 0:e.blankScreen)==null?!0:o,websocket:(s=e==null?void 0:e.websocket)==null?!0:s,longTask:typeof(e==null?void 0:e.longTask)==`object`?J(J({},e.longTask),{},{threshold:f_(e.longTask.threshold,50)}):(c=e==null?void 0:e.longTask)==null?!1:c,cspViolation:(l=e==null?void 0:e.cspViolation)==null?!1:l,routeTiming:(u=e==null?void 0:e.routeTiming)==null?!1:u}},__=e=>e,v_=e=>e,y_=e=>{var t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E;let D={"deployment.environment.name":(t=e.environment)==null?`production`:t,"rum.provider":`blueking`,"telemetry.sdk.language":`webjs`};return J(J({},e),{},{debug:(n=e.debug)==null?!1:n,enabled:(r=e.enabled)==null?!0:r,environment:(i=e.environment)==null?`production`:i,endpoint:s_(e.endpoint||a_),traces:l_(e,`traces`),metrics:l_(e,`metrics`),logs:l_(e,`logs`),sampleRate:u_(e.sampleRate),resourceAttributes:D,metricIntervalMillis:o_,instrumentations:{documentLoad:(a=(o=e.rum)==null?void 0:o.documentLoad)==null?!0:a,fetch:(s=(c=e.rum)==null?void 0:c.fetch)==null?!0:s,xhr:(l=(u=e.rum)==null?void 0:u.xhr)==null?!0:l,userInteraction:(d=(f=e.rum)==null?void 0:f.userInteraction)==null?!0:d},rum:g_(e.rum),plugins:(p=e.plugins)==null?[]:p,autoStart:(m=e.autoStart)==null?!0:m,getPageAttributes:(h=(g=e.attributes)==null?void 0:g.page)==null?(()=>({"rum.page.host":typeof window>`u`?``:window.location.host,"rum.page.path":typeof window>`u`?``:window.location.pathname})):h,getMetricAttributes:(_=(v=e.attributes)==null?void 0:v.metric)==null?(()=>({})):_,getErrorAttributes:(y=(b=e.attributes)==null?void 0:b.error)==null?(()=>({})):y,getCustomAttributes:(x=(S=e.attributes)==null?void 0:S.custom)==null?(()=>({})):x,redactAttributes:(C=(w=e.redact)==null?void 0:w.attributes)==null?__:C,redactUrl:(T=(E=e.redact)==null?void 0:E.url)==null?v_:T})},b_=[`http.url`,`url.full`],x_=e=>{for(let n of b_){var t;let r=(t=e.attributes)==null?void 0:t[n];if(typeof r==`string`)return r}},S_=class{constructor(e,t){this.inner=e,this.config=t}forceFlush(){return this.inner.forceFlush()}onEnd(e){let t=x_(e);t&&cp(this.config,t)||this.inner.onEnd(e)}onStart(e,t){this.inner.onStart(e,t)}shutdown(){return this.inner.shutdown()}},C_=`__bk_ot_sampled__`,w_=new Map,T_=e=>w_.get(e),E_=(e,t)=>(w_.set(e,t),t),D_=({sampleRate:e})=>{if(e<=0)return!1;if(e>=1)return!0;try{let t=sessionStorage.getItem(C_);if(t)return t===`1`;let n=Math.random()<e;return sessionStorage.setItem(C_,n?`1`:`0`),E_(C_,n),n}catch(t){let n=T_(C_);return typeof n==`boolean`?n:E_(C_,Math.random()<e)}};B(),On(),K(),lc(),Qd(),Tf(),Y(),m();var O_=e=>({url:e.endpoint,headers:e.headers,concurrencyLimit:e.concurrencyLimit,timeoutMillis:e.timeoutMillis}),k_=`bk-rum`,A_=(e,t,n)=>n?new Proxy(e,{get(e,n,r){if(n===`export`)return(n,r)=>{var i;return(i=globalThis.console)==null||i.log(`[bk-ot][${t}]`,n),e.export(n,r)};let i=Reflect.get(e,n,r);return typeof i==`function`?i.bind(e):i}}):e,j_=e=>[ih(e.instrumentations)],M_=e=>[uh(e.rum.device),Nh(e.rum.httpBody),rg(e.rum.session),Yh(e.rum.pageView),vh(e.rum.error),t_(e.rum.webVitals),Pf(e.rum.blankScreen),i_(e.rum.websocket),Fh(e.rum.longTask),ah(e.rum.cspViolation),Xh(e.rum.routeTiming)],N_=e=>{let t=y_(e),n=t.enabled&&D_(t),r=nc(t.resourceAttributes),i=A_(new Au(O_(t.traces)),`traces`,t.debug),a=A_(new ku(O_(t.metrics)),`metrics`,t.debug),o=A_(new yu(O_(t.logs)),`logs`,t.debug),s=new S_(new Sd(i,t.spanBatch),t),c=new Xs({exporter:a,exportIntervalMillis:t.metricIntervalMillis}),l=new Yu(o),u=new rf({resource:r,sampler:new od({root:new cd(+!!n)}),spanProcessors:[s]}),d=new cl({resource:r,readers:[c]}),f=new Wu({resource:r,processors:[l]}),m=u.getTracer(k_),h=d.getMeter(k_),g=f.getLogger(k_),v={"bk.rum.sampled":n},y=new _([...t.enabled?j_(t):[],...n?[...M_(t),...t.plugins]:[]]),b=[],x=`idle`,S=()=>J({},v),C=e=>{Object.assign(v,e)},w=e=>t.redactAttributes(e),T=(e,t={})=>m.startSpan(e,{kind:jt.INTERNAL,attributes:w(J(J({},S()),t))}),E={config:t,tracer:m,meter:h,logger:g,applyRedact:w,emitLog:e=>{var t;let n=J(J({},e),{},{attributes:w(J(J({},S()),(t=e.attributes)==null?{}:t))});g.emit(n)},getRuntimeAttributes:S,setRuntimeAttributes:C,startSpan:T,reportCustomEvent({attributes:e={},error:r,name:i}){if(!n){if(t.debug){var a;(a=globalThis.console)==null||a.warn(`[bk-ot] custom event dropped (not sampled):`,i)}return}let o=T(`custom.${i}`,J(J(J(J({},t.getPageAttributes()),t.getCustomAttributes()),e),{},{"rum.custom.name":i}));r&&(o.recordException(r),o.setStatus({code:I.ERROR,message:r.message})),o.end()},start(){return p(function*(){if(x!==`started`){if(x===`stopped`)throw Error(`[bk-ot] instance has been shut down and cannot be restarted; create a new instance instead.`);if(!t.enabled){x=`started`;return}nn.setGlobalPropagator(new Va),u.register({contextManager:new jn}),Ht.setGlobalMeterProvider(d),Dn.setGlobalLoggerProvider(f);try{if(yield y.start(E),typeof window<`u`&&typeof document<`u`){let e=()=>{E.flush()},t=()=>{document.visibilityState===`hidden`&&E.flush()};window.addEventListener(`pagehide`,e),document.addEventListener(`visibilitychange`,t),b.push(()=>window.removeEventListener(`pagehide`,e),()=>document.removeEventListener(`visibilitychange`,t))}}catch(t){for(;b.length;){var e;(e=b.pop())==null||e()}throw yield y.shutdown(),z.disable(),Ht.disable(),L.disable(),t}x=`started`}})()},flush(){return p(function*(){yield y.flush(),yield u.forceFlush(),yield d.forceFlush(),yield f.forceFlush()})()},shutdown(){return p(function*(){if(x!==`stopped`){for(yield E.flush();b.length;){var e;(e=b.pop())==null||e()}yield y.shutdown(),yield u.shutdown(),yield d.shutdown(),yield f.shutdown(),z.disable(),Ht.disable(),L.disable(),x=`stopped`}})()}};return t.autoStart&&E.start().catch(e=>{var t;(t=globalThis.console)==null||t.warn(`[bk-ot] auto start failed:`,e)}),E},P_=N_,F_={createBkOT:N_,createPlugin:g,initBkOT:P_};return typeof window<`u`&&Object.assign(window,{BkOpenTelemetry:F_}),e.BkOpenTelemetry=F_,e.FilteringSpanProcessor=S_,e.createBkOT=N_,e.createBlankScreenPlugin=Pf,e.createCommonInstrumentationsPlugin=ih,e.createCspViolationPlugin=ah,e.createDevicePlugin=uh,e.createErrorPlugin=vh,e.createHttpBodyPlugin=Nh,e.createLongTaskPlugin=Fh,e.createPageViewPlugin=Yh,e.createPlugin=g,e.createRouteTimingPlugin=Xh,e.createSessionPlugin=rg,e.createWebSocketPlugin=i_,e.createWebVitalsPlugin=t_,e.initBkOT=P_,e.normalizeConfig=y_,e})({});
10
+ `,Ac(t,e),`To resolve the conflict:
11
+ `,Fc(t,e))}return n}};z();var Lc=class{constructor(e){R(this,`_backingStorages`,void 0),this._backingStorages=e}record(e,t,n,r){let i=this._backingStorages;for(let a=0;a<i.length;a++)i[a].record(e,t,n,r)}};I(),z();var Rc=class{constructor(e,t){R(this,`_buffer`,new Tc),R(this,`_instrumentName`,void 0),R(this,`_valueType`,void 0),this._instrumentName=e,this._valueType=t}observe(e,t={}){if(typeof e!=`number`){P.warn(`non-number value provided to metric ${this._instrumentName}: ${e}`);return}this._valueType===Ee.INT&&!Number.isInteger(e)&&(P.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._buffer.set(t,e)}},zc=class{constructor(){R(this,`_buffer`,new Map)}observe(e,t,n={}){if(!xc(e))return;let r=this._buffer.get(e);if(r==null&&(r=new Tc,this._buffer.set(e,r)),typeof t!=`number`){P.warn(`non-number value provided to metric ${e._descriptor.name}: ${t}`);return}e._descriptor.valueType===Ee.INT&&!Number.isInteger(t)&&(P.warn(`INT value type cannot accept a floating-point value for ${e._descriptor.name}, ignoring the fractional digits.`),t=Math.trunc(t),!Number.isInteger(t))||r.set(n,t)}};I(),z(),K();var Bc=class{constructor(){R(this,`_callbacks`,[]),R(this,`_batchCallbacks`,[])}addCallback(e,t){this._findCallback(e,t)>=0||this._callbacks.push({callback:e,instrument:t})}removeCallback(e,t){let n=this._findCallback(e,t);n<0||this._callbacks.splice(n,1)}addBatchCallback(e,t){let n=new Set(t.filter(xc));if(n.size===0){P.error(`BatchObservableCallback is not associated with valid instruments`,t);return}this._findBatchCallback(e,n)>=0||this._batchCallbacks.push({callback:e,instruments:n})}removeBatchCallback(e,t){let n=new Set(t.filter(xc)),r=this._findBatchCallback(e,n);r<0||this._batchCallbacks.splice(r,1)}observe(e,t){var n=this;return G(function*(){let r=n._observeCallbacks(e,t),i=n._observeBatchCallbacks(e,t);return(yield Promise.allSettled([...r,...i])).filter(e=>e.status===`rejected`).map(e=>e.reason)})()}_observeCallbacks(e,t){return this._callbacks.map(function(){var n=G(function*({callback:n,instrument:r}){let i=new Rc(r._descriptor.name,r._descriptor.valueType),a=Promise.resolve(n(i));t!=null&&(a=Wo(a,t)),yield a,r._metricStorages.forEach(t=>{t.record(i._buffer,e)})});return function(e){return n.apply(this,arguments)}}())}_observeBatchCallbacks(e,t){return this._batchCallbacks.map(function(){var n=G(function*({callback:n,instruments:r}){let i=new zc,a=Promise.resolve(n(i));t!=null&&(a=Wo(a,t)),yield a,r.forEach(t=>{let n=i._buffer.get(t);n!=null&&t._metricStorages.forEach(t=>{t.record(n,e)})})});return function(e){return n.apply(this,arguments)}}())}_findCallback(e,t){return this._callbacks.findIndex(n=>n.callback===e&&n.instrument===t)}_findBatchCallback(e,t){return this._batchCallbacks.findIndex(n=>n.callback===e&&Go(n.instruments,t))}};z();var Vc=class extends Cc{constructor(e,t,n,r,i){super(e),R(this,`_aggregationCardinalityLimit`,void 0),R(this,`_deltaMetricStorage`,void 0),R(this,`_temporalMetricStorage`,void 0),R(this,`_attributesProcessor`,void 0),this._aggregationCardinalityLimit=i,this._deltaMetricStorage=new Ec(t,this._aggregationCardinalityLimit),this._temporalMetricStorage=new Dc(t,r),this._attributesProcessor=n}record(e,t,n,r){t=this._attributesProcessor.process(t,n),this._deltaMetricStorage.record(e,t,n,r)}collect(e,t){let n=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,n,t)}};z();var Hc=class{process(e,t){return e}},Uc=class{constructor(e){R(this,`_processors`,void 0),this._processors=e}process(e,t){let n=e;for(let e of this._processors)n=e.process(n,t);return n}};function Wc(){return Kc}function Gc(e){return new Uc(e)}var Kc=new Hc;z(),K();var qc=class{constructor(e,t){R(this,`metricStorageRegistry`,new Ic),R(this,`observableRegistry`,new Bc),R(this,`meter`,void 0),R(this,`_meterProviderSharedState`,void 0),R(this,`_instrumentationScope`,void 0),this.meter=new Sc(this),this._meterProviderSharedState=e,this._instrumentationScope=t}registerMetricStorage(e){let t=this._registerMetricStorage(e,Vc);return t.length===1?t[0]:new Lc(t)}registerAsyncMetricStorage(e){return this._registerMetricStorage(e,kc)}collect(e,t,n){var r=this;return G(function*(){let i=yield r.observableRegistry.observe(t,n==null?void 0:n.timeoutMillis),a=r.metricStorageRegistry.getStorages(e);if(a.length===0)return null;let o=[];return a.forEach(n=>{let r=n.collect(e,t);r!=null&&o.push(r)}),o.length===0?{errors:i}:{scopeMetrics:{scope:r._instrumentationScope,metrics:o},errors:i}})()}_registerMetricStorage(e,t){let n=this._meterProviderSharedState.viewRegistry.findViews(e,this._instrumentationScope).map(n=>{let r=cc(n,e),i=this.metricStorageRegistry.findOrUpdateCompatibleStorage(r);if(i!=null)return i;let a=new t(r,n.aggregation.createAggregator(r),n.attributesProcessor,this._meterProviderSharedState.metricCollectors,n.aggregationCardinalityLimit);return this.metricStorageRegistry.register(a),a});if(n.length===0){let r=this._meterProviderSharedState.selectAggregations(e.type).map(([n,r])=>{let i=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(n,e);if(i!=null)return i;let a=r.createAggregator(e),o=n.selectCardinalityLimit(e.type),s=new t(e,a,Wc(),[n],o);return this.metricStorageRegistry.registerForCollector(n,s),s});n=n.concat(r)}return n}};z();var Jc=class{constructor(e){R(this,`viewRegistry`,new oc),R(this,`metricCollectors`,[]),R(this,`meterSharedStates`,new Map),R(this,`resource`,void 0),this.resource=e}getMeterSharedState(e){let t=Ho(e),n=this.meterSharedStates.get(t);return n==null&&(n=new qc(this,e),this.meterSharedStates.set(t,n)),n}selectAggregations(e){let t=[];for(let n of this.metricCollectors)t.push([n,Vs(n.selectAggregation(e))]);return t}};W(),z(),K();var Yc=class{constructor(e,t){R(this,`_sharedState`,void 0),R(this,`_metricReader`,void 0),this._sharedState=e,this._metricReader=t}collect(e){var t=this;return G(function*(){let n=$i(Date.now()),r=[],i=[],a=Array.from(t._sharedState.meterSharedStates.values()).map(function(){var a=G(function*(a){let o=yield a.collect(t,n,e);(o==null?void 0:o.scopeMetrics)!=null&&r.push(o.scopeMetrics),(o==null?void 0:o.errors)!=null&&i.push(...o.errors)});return function(e){return a.apply(this,arguments)}}());return yield Promise.all(a),{resourceMetrics:{resource:t._sharedState.resource,scopeMetrics:r},errors:i}})()}forceFlush(e){var t=this;return G(function*(){yield t._metricReader.forceFlush(e)})()}shutdown(e){var t=this;return G(function*(){yield t._metricReader.shutdown(e)})()}selectAggregationTemporality(e){return this._metricReader.selectAggregationTemporality(e)}selectAggregation(e){return this._metricReader.selectAggregation(e)}selectCardinalityLimit(e){var t,n,r;return(t=(n=(r=this._metricReader).selectCardinalityLimit)==null?void 0:n.call(r,e))==null?2e3:t}};z();var Xc=/[\^$\\.+?()[\]{}|]/g,Zc=class e{constructor(t){R(this,`_matchAll`,void 0),R(this,`_regexp`,void 0),t===`*`?(this._matchAll=!0,this._regexp=/.*/):(this._matchAll=!1,this._regexp=new RegExp(e.escapePattern(t)))}match(e){return this._matchAll?!0:this._regexp.test(e)}static escapePattern(e){return`^${e.replace(Xc,`\\$&`).replace(`*`,`.*`)}$`}static hasWildcard(e){return e.includes(`*`)}},Qc=class{constructor(e){R(this,`_matchAll`,void 0),R(this,`_pattern`,void 0),this._matchAll=e===void 0,this._pattern=e}match(e){return!!(this._matchAll||e===this._pattern)}};z();var $c=class{constructor(e){var t;R(this,`_nameFilter`,void 0),R(this,`_type`,void 0),R(this,`_unitFilter`,void 0),this._nameFilter=new Zc((t=e==null?void 0:e.name)==null?`*`:t),this._type=e==null?void 0:e.type,this._unitFilter=new Qc(e==null?void 0:e.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}};z();var el=class{constructor(e){R(this,`_nameFilter`,void 0),R(this,`_versionFilter`,void 0),R(this,`_schemaUrlFilter`,void 0),this._nameFilter=new Qc(e==null?void 0:e.name),this._versionFilter=new Qc(e==null?void 0:e.version),this._schemaUrlFilter=new Qc(e==null?void 0:e.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}};z();function tl(e){return e.instrumentName==null&&e.instrumentType==null&&e.instrumentUnit==null&&e.meterName==null&&e.meterVersion==null&&e.meterSchemaUrl==null}function nl(e){if(tl(e))throw Error(`Cannot create view with no selector arguments supplied`);if(e.name!=null&&((e==null?void 0:e.instrumentName)==null||Zc.hasWildcard(e.instrumentName)))throw Error(`Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter.`)}var rl=class{constructor(e){var t;R(this,`name`,void 0),R(this,`description`,void 0),R(this,`aggregation`,void 0),R(this,`attributesProcessor`,void 0),R(this,`instrumentSelector`,void 0),R(this,`meterSelector`,void 0),R(this,`aggregationCardinalityLimit`,void 0),nl(e),e.attributesProcessors==null?this.attributesProcessor=Wc():this.attributesProcessor=Gc(e.attributesProcessors),this.name=e.name,this.description=e.description,this.aggregation=Vs((t=e.aggregation)==null?{type:Bs.DEFAULT}:t),this.instrumentSelector=new $c({name:e.instrumentName,type:e.instrumentType,unit:e.instrumentUnit}),this.meterSelector=new el({name:e.meterName,version:e.meterVersion,schemaUrl:e.meterSchemaUrl}),this.aggregationCardinalityLimit=e.aggregationCardinalityLimit}};I(),ac(),z(),K();var il=class{constructor(e){var t;if(R(this,`_sharedState`,void 0),R(this,`_shutdown`,!1),this._sharedState=new Jc((t=e==null?void 0:e.resource)==null?$s():t),(e==null?void 0:e.views)!=null&&e.views.length>0)for(let t of e.views)this._sharedState.viewRegistry.addView(new rl(t));if((e==null?void 0:e.readers)!=null&&e.readers.length>0)for(let t of e.readers){let e=new Yc(this._sharedState,t);t.setMetricProducer(e),this._sharedState.metricCollectors.push(e)}}getMeter(e,t=``,n={}){return this._shutdown?(P.warn(`A shutdown MeterProvider cannot provide a Meter`),oe()):this._sharedState.getMeterSharedState({name:e,version:t,schemaUrl:n.schemaUrl}).meter}shutdown(e){var t=this;return G(function*(){if(t._shutdown){P.warn(`shutdown may only be called once per MeterProvider`);return}t._shutdown=!0,yield Promise.all(t._sharedState.metricCollectors.map(t=>t.shutdown(e)))})()}forceFlush(e){var t=this;return G(function*(){if(t._shutdown){P.warn(`invalid attempt to force flush after MeterProvider shutdown`);return}yield Promise.all(t._sharedState.metricCollectors.map(t=>t.forceFlush(e)))})()}},al;(function(e){e[e.AGGREGATION_TEMPORALITY_UNSPECIFIED=0]=`AGGREGATION_TEMPORALITY_UNSPECIFIED`,e[e.AGGREGATION_TEMPORALITY_DELTA=1]=`AGGREGATION_TEMPORALITY_DELTA`,e[e.AGGREGATION_TEMPORALITY_CUMULATIVE=2]=`AGGREGATION_TEMPORALITY_CUMULATIVE`})(al||(al={}));function ol(e,t){let n={attributes:cl(e.attributes,t),droppedAttributesCount:0},r=e.schemaUrl;return r&&r!==``&&(n.schemaUrl=r),n}function sl(e){return{name:e.name,version:e.version}}function cl(e,t){return Object.keys(e).map(n=>ll(n,e[n],t))}function ll(e,t,n){return{key:e,value:ul(t,n)}}function ul(e,t){let n=typeof e;if(n===`string`)return{stringValue:e};if(n===`number`)return Number.isInteger(e)?{intValue:e}:{doubleValue:e};if(n===`boolean`)return{boolValue:e};if(e instanceof Uint8Array)return{bytesValue:t.encodeUint8Array(e)};if(Array.isArray(e)){let n=Array(e.length);for(let r=0;r<e.length;r++)n[r]=ul(e[r],t);return{arrayValue:{values:n}}}if(n===`object`&&e!=null){let n=Object.keys(e),r=Array(n.length);for(let i=0;i<n.length;i++)r[i]={key:n[i],value:ul(e[n[i]],t)};return{kvlistValue:{values:r}}}return{}}I();function dl(e,t){let n=ol(e.resource,t);return{resource:n,schemaUrl:n.schemaUrl,scopeMetrics:fl(e.scopeMetrics,t)}}function fl(e,t){return Array.from(e.map(e=>({scope:sl(e.scope),metrics:e.metrics.map(e=>pl(e,t)),schemaUrl:e.scope.schemaUrl})))}function pl(e,t){let n={name:e.descriptor.name,description:e.descriptor.description,unit:e.descriptor.unit},r=vl(e.aggregationTemporality);switch(e.dataPointType){case Bo.SUM:n.sum={aggregationTemporality:r,isMonotonic:e.isMonotonic,dataPoints:hl(e,t)};break;case Bo.GAUGE:n.gauge={dataPoints:hl(e,t)};break;case Bo.HISTOGRAM:n.histogram={aggregationTemporality:r,dataPoints:gl(e,t)};break;case Bo.EXPONENTIAL_HISTOGRAM:n.exponentialHistogram={aggregationTemporality:r,dataPoints:_l(e,t)};break}return n}function ml(e,t,n){let r={attributes:cl(e.attributes,n),startTimeUnixNano:n.encodeHrTime(e.startTime),timeUnixNano:n.encodeHrTime(e.endTime)};switch(t){case Ee.INT:r.asInt=e.value;break;case Ee.DOUBLE:r.asDouble=e.value;break}return r}function hl(e,t){return e.dataPoints.map(n=>ml(n,e.descriptor.valueType,t))}function gl(e,t){return e.dataPoints.map(e=>{let n=e.value;return{attributes:cl(e.attributes,t),bucketCounts:n.buckets.counts,explicitBounds:n.buckets.boundaries,count:n.count,sum:n.sum,min:n.min,max:n.max,startTimeUnixNano:t.encodeHrTime(e.startTime),timeUnixNano:t.encodeHrTime(e.endTime)}})}function _l(e,t){return e.dataPoints.map(e=>{let n=e.value;return{attributes:cl(e.attributes,t),count:n.count,min:n.min,max:n.max,sum:n.sum,positive:{offset:n.positive.offset,bucketCounts:n.positive.bucketCounts},negative:{offset:n.negative.offset,bucketCounts:n.negative.bucketCounts},scale:n.scale,zeroCount:n.zeroCount,startTimeUnixNano:t.encodeHrTime(e.startTime),timeUnixNano:t.encodeHrTime(e.endTime)}})}function vl(e){switch(e){case zo.DELTA:return al.AGGREGATION_TEMPORALITY_DELTA;case zo.CUMULATIVE:return al.AGGREGATION_TEMPORALITY_CUMULATIVE}}function yl(e,t){return{resourceMetrics:e.map(e=>dl(e,t))}}W();function bl(e){let t=BigInt(1e9);return BigInt(Math.trunc(e[0]))*t+BigInt(Math.trunc(e[1]))}function xl(e){return bl(e).toString()}var Sl=typeof BigInt<`u`?xl:ra;function Cl(e){return e}var wl={encodeHrTime:Sl,encodeSpanContext:Cl,encodeOptionalSpanContext:Cl,encodeUint8Array:e=>{if(typeof Buffer<`u`)return Buffer.from(e).toString(`base64`);let t=Array(e.length);for(let n=0;n<e.length;n++)t[n]=String.fromCharCode(e[n]);return btoa(t.join(``))}};function Tl(e,t){return{resourceLogs:Dl(e,t)}}function El(e){let t=new Map;for(let n of e){let{resource:e,instrumentationScope:{name:r,version:i=``,schemaUrl:a=``}}=n,o=t.get(e);o||(o=new Map,t.set(e,o));let s=`${r}@${i}:${a}`,c=o.get(s);c||(c=[],o.set(s,c)),c.push(n)}return t}function Dl(e,t){let n=El(e);return Array.from(n,([e,n])=>{let r=ol(e,t);return{resource:r,scopeLogs:Array.from(n,([,e])=>({scope:sl(e[0].instrumentationScope),logRecords:e.map(e=>Ol(e,t)),schemaUrl:e[0].instrumentationScope.schemaUrl})),schemaUrl:r.schemaUrl}})}function Ol(e,t){var n,r,i;return{timeUnixNano:t.encodeHrTime(e.hrTime),observedTimeUnixNano:t.encodeHrTime(e.hrTimeObserved),severityNumber:kl(e.severityNumber),severityText:e.severityText,body:ul(e.body,t),eventName:e.eventName,attributes:Al(e.attributes,t),droppedAttributesCount:e.droppedAttributesCount,flags:(n=e.spanContext)==null?void 0:n.traceFlags,traceId:t.encodeOptionalSpanContext((r=e.spanContext)==null?void 0:r.traceId),spanId:t.encodeOptionalSpanContext((i=e.spanContext)==null?void 0:i.spanId)}}function kl(e){return e}function Al(e,t){return Object.keys(e).map(n=>ll(n,e[n],t))}I();var jl={serializeRequest:e=>{let t=Tl(e,wl);return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(e){return P.warn(`Failed to parse logs export response: ${e.message}. Returning empty response`),{}}}};I();var Ml={serializeRequest:e=>{let t=yl([e],wl);return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(e){return P.warn(`Failed to parse metrics export response: ${e.message}. Returning empty response`),{}}}},Nl=256,Pl=512;function Fl(e,t){let n=e&255|Nl;return t&&(n|=Pl),n}function Il(e,t){var n,r,i,a;let o=e.spanContext(),s=e.status,c=(n=e.parentSpanContext)!=null&&n.spanId?t.encodeSpanContext((r=e.parentSpanContext)==null?void 0:r.spanId):void 0;return{traceId:t.encodeSpanContext(o.traceId),spanId:t.encodeSpanContext(o.spanId),parentSpanId:c,traceState:(i=o.traceState)==null?void 0:i.serialize(),name:e.name,kind:e.kind==null?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:cl(e.attributes,t),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>Rl(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:s.code,message:s.message},links:e.links.map(e=>Ll(e,t)),droppedLinksCount:e.droppedLinksCount,flags:Fl(o.traceFlags,(a=e.parentSpanContext)==null?void 0:a.isRemote)}}function Ll(e,t){var n;return{attributes:e.attributes?cl(e.attributes,t):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:(n=e.context.traceState)==null?void 0:n.serialize(),droppedAttributesCount:e.droppedAttributesCount||0,flags:Fl(e.context.traceFlags,e.context.isRemote)}}function Rl(e,t){return{attributes:e.attributes?cl(e.attributes,t):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function zl(e,t){return{resourceSpans:Vl(e,t)}}function Bl(e){let t=new Map;for(let n of e){let e=t.get(n.resource);e||(e=new Map,t.set(n.resource,e));let r=`${n.instrumentationScope.name}@${n.instrumentationScope.version||``}:${n.instrumentationScope.schemaUrl||``}`,i=e.get(r);i||(i=[],e.set(r,i)),i.push(n)}return t}function Vl(e,t){let n=Bl(e),r=[],i=n.entries(),a=i.next();for(;!a.done;){let[e,n]=a.value,o=[],s=n.values(),c=s.next();for(;!c.done;){let e=c.value;if(e.length>0){let n=e.map(e=>Il(e,t));o.push({scope:sl(e[0].instrumentationScope),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}c=s.next()}let l=ol(e,t),u={resource:l,scopeSpans:o,schemaUrl:l.schemaUrl};r.push(u),a=i.next()}return r}I();var Hl={serializeRequest:e=>{let t=zl(e,wl);return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(e){return P.warn(`Failed to parse trace export response: ${e.message}. Returning empty response`),{}}}};I(),z(),K();var Ul=5,Wl=1e3,Gl=5e3,Kl=1.5,ql=.2;function Jl(){return 2*ql*Math.random()-ql}var Yl=class{constructor(e){R(this,`_transport`,void 0),this._transport=e}retry(e,t,n){return new Promise((r,i)=>{setTimeout(()=>{this._transport.send(e,t).then(r,i)},n)})}send(e,t){var n=this;return G(function*(){let r=Ul,i=Wl,a=Date.now()+t,o=yield n._transport.send(e,t);for(;o.status===`retryable`&&r>0;){var s;r--;let t=Math.max(Math.min(i*(1+Jl()),Gl),0);i*=Kl;let c=(s=o.retryInMillis)==null?t:s,l=a-Date.now();if(c>l)return P.info(`Export retry time ${Math.round(c)}ms exceeds remaining timeout ${Math.round(l)}ms, not retrying further.`),o;P.verbose(`Scheduling export retry in ${Math.round(c)}ms`),o=yield n.retry(e,l,c)}return o.status===`success`?P.verbose(`Export succeeded after ${Ul-r} retry attempts.`):o.status===`retryable`?P.info(`Export failed after maximum retry attempts (${Ul}).`):P.info(`Export failed with non-retryable error: ${o.error}`),o})()}shutdown(){return this._transport.shutdown()}};function Xl(e){return new Yl(e.transport)}function Zl(e){return e===429||e===502||e===503||e===504}function Ql(e){if(e==null)return;let t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?t*1e3:-1;let n=new Date(e).getTime()-Date.now();return n>=0?n:0}I(),z(),K();var $l=60*1024,eu=9,tu=0,nu=0,ru=class{constructor(e){R(this,`_parameters`,void 0),this._parameters=e}send(e,t){var n=this;return G(function*(){let r=new AbortController,i=setTimeout(()=>r.abort(),t),a=globalThis.fetch;typeof a.__original==`function`&&(a=a.__original);let o=e.byteLength,s=tu+o>$l,c=!s&&!(nu>=eu);if(c)tu+=o,nu++;else{let e=s?`size limit`:`count limit`;P.debug(`keepalive disabled: ${(o/1024).toFixed(1)}KB payload, ${nu} pending (${e})`)}try{let t=new URL(n._parameters.url),i=yield a(t.href,{method:`POST`,headers:yield n._parameters.headers(),body:e,signal:r.signal,keepalive:c,mode:globalThis.location?globalThis.location.origin===t.origin?`same-origin`:`cors`:`no-cors`});return i.status>=200&&i.status<=299?(P.debug(`export response success (status: ${i.status})`),{status:`success`}):Zl(i.status)?(P.warn(`export response retryable (status: ${i.status})`),{status:`retryable`,retryInMillis:Ql(i.headers.get(`Retry-After`))}):(P.error(`export response failure (status: ${i.status})`),{status:`failure`,error:Error(`Fetch request failed with non-retryable status ${i.status}`)})}catch(e){return au(e)?(P.warn(`export request retryable (network error: ${e})`),{status:`retryable`,error:Error(`Fetch request encountered a network error`,{cause:e})}):(P.error(`export request failure (error: ${e})`),{status:`failure`,error:Error(`Fetch request errored`,{cause:e})})}finally{clearTimeout(i),c&&(tu-=o,nu--)}})()}shutdown(){}};function iu(e){return new ru(e)}function au(e){return e instanceof TypeError&&!e.cause}function ou(e,t){return Ro(e,t,Xl({transport:iu(e)}))}I();function su(e){let t={};return Object.entries(e==null?{}:e).forEach(([e,n])=>{n===void 0?P.warn(`Header "${e}" has invalid value (${n}) and will be ignored`):t[e]=String(n)}),t}Y(),K();function cu(e,t,n){return G(function*(){let r=J({},yield n()),i={};return t!=null&&Object.assign(i,yield t()),e!=null&&Object.assign(i,su(yield e())),Object.assign(i,r)})}function lu(e){if(e!=null)try{var t;let n=(t=globalThis.location)==null?void 0:t.href;return new URL(e,n).href}catch(t){throw Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function uu(e,t,n){var r,i;return J(J({},Ao(e,t,n)),{},{headers:cu(e.headers,t.headers,n.headers),url:(r=(i=lu(e.url))==null?t.url:i)==null?n.url:r})}function du(e,t){return J(J({},jo()),{},{headers:function(){var t=G(function*(){return e});return function(){return t.apply(this,arguments)}}(),url:`http://localhost:4318/`+t})}function fu(e){return typeof e.headers==`function`?e.headers:ko(e.headers)}function pu(e,t,n){return uu({url:e.url,timeoutMillis:e.timeoutMillis,headers:fu(e),concurrencyLimit:e.concurrencyLimit},{},du(n,t))}function mu(e,t,n,r){return ou(pu(e,n,r),t)}var hu=class extends To{constructor(e={}){super(mu(e,jl,`v1/logs`,{"Content-Type":`application/json`}))}},gu;(function(e){e[e.DELTA=0]=`DELTA`,e[e.CUMULATIVE=1]=`CUMULATIVE`,e[e.LOWMEMORY=2]=`LOWMEMORY`})(gu||(gu={})),W(),I(),z();var _u=()=>zo.CUMULATIVE,vu=e=>{switch(e){case q.COUNTER:case q.OBSERVABLE_COUNTER:case q.GAUGE:case q.HISTOGRAM:case q.OBSERVABLE_GAUGE:return zo.DELTA;case q.UP_DOWN_COUNTER:case q.OBSERVABLE_UP_DOWN_COUNTER:return zo.CUMULATIVE}},yu=e=>{switch(e){case q.COUNTER:case q.HISTOGRAM:return zo.DELTA;case q.GAUGE:case q.UP_DOWN_COUNTER:case q.OBSERVABLE_UP_DOWN_COUNTER:case q.OBSERVABLE_COUNTER:case q.OBSERVABLE_GAUGE:return zo.CUMULATIVE}};function bu(){var e;let t=((e=void 0)==null?`cumulative`:e).toLowerCase();return t===`cumulative`?_u:t===`delta`?vu:t===`lowmemory`?yu:(P.warn(`OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to '${t}', but only 'cumulative' and 'delta' are allowed. Using default ('cumulative') instead.`),_u)}function xu(e){return e==null?bu():e===gu.DELTA?vu:e===gu.LOWMEMORY?yu:_u}var Su=Object.freeze({type:Bs.DEFAULT});function Cu(e){var t;return(t=e==null?void 0:e.aggregationPreference)==null?(()=>Su):t}var wu=class extends To{constructor(e,t){super(e),R(this,`_aggregationTemporalitySelector`,void 0),R(this,`_aggregationSelector`,void 0),this._aggregationSelector=Cu(t),this._aggregationTemporalitySelector=xu(t==null?void 0:t.temporalityPreference)}selectAggregation(e){return this._aggregationSelector(e)}selectAggregationTemporality(e){return this._aggregationTemporalitySelector(e)}},Tu=class extends wu{constructor(e){super(mu(e==null?{}:e,Ml,`v1/metrics`,{"Content-Type":`application/json`}),e)}},Eu=class extends To{constructor(e={}){super(mu(e,Hl,`v1/traces`,{"Content-Type":`application/json`}))}};function Du(e,t,n,r){for(let i=0,a=e.length;i<a;i++){let a=e[i];t&&a.setTracerProvider(t),n&&a.setMeterProvider(n),r&&a.setLoggerProvider&&a.setLoggerProvider(r),a.getConfig().enabled||a.enable()}}function Ou(e){e.forEach(e=>e.disable())}var ku=t((()=>{}));function Au(e){var t,n;let r=e.tracerProvider||F.getTracerProvider(),i=e.meterProvider||jt.getMeterProvider(),a=e.loggerProvider||hn.getLoggerProvider(),o=(t=(n=e.instrumentations)==null?void 0:n.flat())==null?[]:t;return Du(o,r,i,a),()=>{Ou(o)}}var ju=t((()=>{I(),ku()}));function Mu(e,t,n){let r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}function Nu(e){e&&e.logger&&(typeof e.logger==`function`?X=e.logger:X(`new logger isn't a function, not replacing`))}var X,Pu,Fu,Iu,Lu,Ru=t((()=>{X=console.error.bind(console),Pu=(e,t,n)=>{if(!e||!e[t]){X(`no original function `+String(t)+` to wrap`);return}if(!n){X(`no wrapper function`),X(Error().stack);return}let r=e[t];if(typeof r!=`function`||typeof n!=`function`){X(`original object and wrapper must be functions`);return}let i=n(r,t);return Mu(i,`__original`,r),Mu(i,`__unwrap`,()=>{e[t]===i&&Mu(e,t,r)}),Mu(i,`__wrapped`,!0),Mu(e,t,i),i},Fu=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{X(`must provide one or more modules to patch`),X(Error().stack);return}if(!(t&&Array.isArray(t))){X(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{Pu(e,t,n)})})},Iu=(e,t)=>{if(!e||!e[t]){X(`no function to unwrap.`),X(Error().stack);return}let n=e[t];if(!n.__unwrap)X(`no original to unwrap to -- has `+String(t)+` already been unwrapped?`);else{n.__unwrap();return}},Lu=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{X(`must provide one or more modules to patch`),X(Error().stack);return}if(!(t&&Array.isArray(t))){X(`must provide one or more functions to unwrap on modules`);return}e.forEach(e=>{t.forEach(t=>{Iu(e,t)})})},Nu.wrap=Pu,Nu.massWrap=Fu,Nu.unwrap=Iu,Nu.massUnwrap=Lu})),zu,Bu=t((()=>{I(),gn(),Ru(),z(),Y(),zu=class{constructor(e,t,n){R(this,`_config`,{}),R(this,`_tracer`,void 0),R(this,`_meter`,void 0),R(this,`_logger`,void 0),R(this,`_diag`,void 0),R(this,`instrumentationName`,void 0),R(this,`instrumentationVersion`,void 0),R(this,`_wrap`,Pu),R(this,`_unwrap`,Iu),R(this,`_massWrap`,Fu),R(this,`_massUnwrap`,Lu),this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(n),this._diag=P.createComponentLogger({namespace:e}),this._tracer=F.getTracer(e,t),this._meter=jt.getMeter(e,t),this._logger=hn.getLogger(e,t),this._updateMetricInstruments()}get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){var e;let t=(e=this.init())==null?[]:e;return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config=J({enabled:!0},e)}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error(`Error running span customization hook due to exception in handler`,{triggerName:t},e)}}}})),Vu,Hu=t((()=>{Bu(),Vu=class extends zu{constructor(e,t,n){super(e,t,n),this._config.enabled&&this.enable()}}})),Uu=t((()=>{Hu(),I()}));function Wu(e,t,n){let r,i;try{i=e()}catch(e){r=e}finally{if(t(r,i),r&&!n)throw r;return i}}var Gu=t((()=>{}));function Ku(e,t){let n=Z.OLD,r=t==null?void 0:t.split(`,`).map(e=>e.trim()).filter(e=>e!==``);for(let t of r==null?[]:r)if(t.toLowerCase()===e+`/dup`){n=Z.DUPLICATE;break}else t.toLowerCase()===e&&(n=Z.STABLE);return n}var Z,qu=t((()=>{(function(e){e[e.STABLE=1]=`STABLE`,e[e.OLD=2]=`OLD`,e[e.DUPLICATE=3]=`DUPLICATE`})(Z||(Z={}))})),Ju=t((()=>{ju(),Uu(),z(),Gu(),qu()}));function Yu(e){return Xu(e,new WeakSet)}function Xu(e,t){if(e==null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e instanceof Uint8Array)return!0;if(typeof e==`object`){if(t.has(e))return!1;if(t.add(e),Array.isArray(e))return e.every(e=>Xu(e,t));let n=e;return n.constructor!==Object&&n.constructor!==void 0?!1:Object.values(n).every(e=>Xu(e,t))}return!1}I(),W(),qi(),z();var Zu=class{set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get eventName(){return this._eventName}set eventName(e){this._isLogRecordReadonly()||(this._eventName=e)}get droppedAttributesCount(){return this._droppedAttributesCount}constructor(e,t,n){R(this,`hrTime`,void 0),R(this,`hrTimeObserved`,void 0),R(this,`spanContext`,void 0),R(this,`resource`,void 0),R(this,`instrumentationScope`,void 0),R(this,`attributes`,{}),R(this,`_severityText`,void 0),R(this,`_severityNumber`,void 0),R(this,`_body`,void 0),R(this,`_eventName`,void 0),R(this,`_attributesCount`,0),R(this,`_droppedAttributesCount`,0),R(this,`_isReadonly`,!1),R(this,`_logRecordLimits`,void 0);let{timestamp:r,observedTimestamp:i,eventName:a,severityNumber:o,severityText:s,body:c,attributes:l={},exception:u,context:d}=n,f=Date.now();if(this.hrTime=ta(r==null?f:r),this.hrTimeObserved=ta(i==null?f:i),d){let e=F.getSpanContext(d);e&&tt(e)&&(this.spanContext=e)}this.severityNumber=o,this.severityText=s,this.body=c,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this._eventName=a,this.setAttributes(l),u!=null&&this._setException(u)}setAttribute(e,t){if(this._isLogRecordReadonly())return this;if(e.length===0)return P.warn(`Invalid attribute key: ${e}`),this;if(!Yu(t))return P.warn(`Invalid attribute value set for key: ${e}`),this;let n=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n&&this._attributesCount>=this._logRecordLimits.attributeCountLimit?(this._droppedAttributesCount++,this._droppedAttributesCount===1&&P.warn(`Dropping extra attributes.`),this):(this.attributes[e]=this._truncateToSize(t),n&&this._attributesCount++,this)}setAttributes(e){for(let[t,n]of Object.entries(e))this.setAttribute(t,n);return this}setBody(e){return this.body=e,this}setEventName(e){return this.eventName=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;if(t<=0)return P.warn(`Attribute value limit must be positive, got ${t}`),e;if(e==null)return e;if(typeof e==`string`)return this._truncateToLimitUtil(e,t);if(e instanceof Uint8Array)return e;if(Array.isArray(e))return e.map(e=>this._truncateToSize(e));if(typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))t[n]=this._truncateToSize(r);return t}return e}_setException(e){let t=!1;if(typeof e==`string`||typeof e==`number`)Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute(ki,String(e)),t=!0;else if(e&&typeof e==`object`){let n=e;n.code?(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(ji,n.code.toString()),t=!0):n.name&&(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(ji,n.name),t=!0),n.message&&(Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute(ki,n.message),t=!0),n.stack&&(Object.hasOwn(this.attributes,`exception.stacktrace`)||this.setAttribute(Ai,n.stack),t=!0)}t||P.warn(`Failed to record an exception ${e}`)}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&&P.warn(`Can not execute the operation on emitted log record`),this._isReadonly}};gn(),I(),z(),Y();var Qu=class{constructor(e,t){R(this,`instrumentationScope`,void 0),R(this,`_sharedState`,void 0),R(this,`_loggerConfig`,void 0),this.instrumentationScope=e,this._sharedState=t,this._loggerConfig=this._sharedState.getLoggerConfig(this.instrumentationScope)}emit(e){var t;let n=this._loggerConfig,r=e.context||N.active(),i=(t=e.severityNumber)==null?L.UNSPECIFIED:t;if(i!==L.UNSPECIFIED&&i<n.minimumSeverity)return;if(n.traceBased){let e=F.getSpanContext(r);if(e&&tt(e)&&(e.traceFlags&M.SAMPLED)!==M.SAMPLED)return}let a=new Zu(this._sharedState,this.instrumentationScope,J({context:r},e));this._sharedState.loggerMetrics.emitLog(),this._sharedState.activeProcessor.onEmit(a,r),a._makeReadonly()}enabled(e){let t=this._loggerConfig;if(t.disabled)return!1;let n=e==null?void 0:e.severityNumber;if(typeof n==`number`&&n!==L.UNSPECIFIED&&n<t.minimumSeverity)return!1;let r=(e==null?void 0:e.context)||N.active();if(t.traceBased){let e=F.getSpanContext(r);if(e&&tt(e)&&(e.traceFlags&M.SAMPLED)!==M.SAMPLED)return!1}let i={context:r,instrumentationScope:this.instrumentationScope,severityNumber:e==null?void 0:e.severityNumber,eventName:e==null?void 0:e.eventName};for(let e of this._sharedState.processors)if(!e.enabled||e.enabled(i))return!0;return!1}},$u=class{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}enabled(e){return!1}};W(),z(),K();var ed=class{constructor(e,t){R(this,`processors`,void 0),R(this,`forceFlushTimeoutMillis`,void 0),this.processors=e,this.forceFlushTimeoutMillis=t}forceFlush(){var e=this;return G(function*(){let t=e.forceFlushTimeoutMillis;yield Promise.all(e.processors.map(e=>fo(e.forceFlush(),t)))})()}onEmit(e,t){this.processors.forEach(n=>n.onEmit(e,t))}shutdown(){var e=this;return G(function*(){yield Promise.all(e.processors.map(e=>e.shutdown()))})()}enabled(e){for(let t of this.processors)if(!t.enabled||t.enabled(e))return!0;return!1}};function td(e){return`${e.name}@${e.version||``}:${e.schemaUrl||``}`}var nd=`otel.sdk.log.created`;z();var rd=class{constructor(e){R(this,`createdLogs`,void 0),this.createdLogs=e.createCounter(nd,{unit:`{log_record}`,description:`The number of logs submitted to enabled SDK Loggers.`})}emitLog(){this.createdLogs.add(1)}},id=`0.217.0`;I(),gn(),Y(),z();var ad={disabled:!1,minimumSeverity:L.UNSPECIFIED,traceBased:!1},od=()=>J({},ad),sd=class{constructor(e,t,n,r,i,a){R(this,`loggers`,new Map),R(this,`activeProcessor`,void 0),R(this,`registeredLogRecordProcessors`,[]),R(this,`resource`,void 0),R(this,`forceFlushTimeoutMillis`,void 0),R(this,`logRecordLimits`,void 0),R(this,`processors`,void 0),R(this,`loggerMetrics`,void 0),R(this,`_loggerConfigurator`,void 0),R(this,`_loggerConfigs`,new Map),this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=n,this.processors=r,r.length>0?(this.registeredLogRecordProcessors=r,this.activeProcessor=new ed(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new $u,this._loggerConfigurator=i==null?od:i;let o=a?a.getMeter(`@opentelemetry/sdk-logs`,id):oe();this.loggerMetrics=new rd(o)}getLoggerConfig(e){let t=td(e),n=this._loggerConfigs.get(t);return n||(n=this._loggerConfigurator(e),this._loggerConfigs.set(t,n),n)}};I(),gn(),ac(),W(),z();var cd=class{constructor(e={}){var t,n,r,i,a,o,s,c;R(this,`_shutdownOnce`,void 0),R(this,`_sharedState`,void 0);let l={resource:(t=e.resource)==null?$s():t,forceFlushTimeoutMillis:(n=e.forceFlushTimeoutMillis)==null?3e4:n,logRecordLimits:{attributeCountLimit:(r=(i=e.logRecordLimits)==null?void 0:i.attributeCountLimit)==null?128:r,attributeValueLengthLimit:(a=(o=e.logRecordLimits)==null?void 0:o.attributeValueLengthLimit)==null?1/0:a},loggerConfigurator:(s=e.loggerConfigurator)==null?od:s,processors:(c=e.processors)==null?[]:c,meterProvider:e.meterProvider};this._sharedState=new sd(l.resource,l.forceFlushTimeoutMillis,l.logRecordLimits,l.processors,l.loggerConfigurator,l.meterProvider),this._shutdownOnce=new bo(this._shutdown,this)}getLogger(e,t,n){if(this._shutdownOnce.isCalled)return P.warn(`A shutdown LoggerProvider cannot provide a Logger`),$t;e||P.warn(`Logger requested without instrumentation scope name.`);let r=e||`unknown`,i=`${r}@${t||``}:${(n==null?void 0:n.schemaUrl)||``}`;return this._sharedState.loggers.has(i)||this._sharedState.loggers.set(i,new Qu({name:r,version:t,schemaUrl:n==null?void 0:n.schemaUrl},this._sharedState)),this._sharedState.loggers.get(i)}forceFlush(){return this._shutdownOnce.isCalled?(P.warn(`invalid attempt to force flush after LoggerProvider shutdown`),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(P.warn(`shutdown may only be called once per LoggerProvider`),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}};I(),W(),K(),z();function ld(e){return ud.apply(this,arguments)}function ud(){return ud=G(function*(e){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];r.resource.asyncAttributesPending&&r.resource.waitForAsyncAttributes&&t.push(r.resource.waitForAsyncAttributes())}t!=null&&t.length>0&&(yield Promise.all(t))}),ud.apply(this,arguments)}var dd=class{constructor(e,t,n){R(this,`_exportCompleted`,void 0),R(this,`_exportScheduledPromise`,void 0),R(this,`_exportScheduledResolve`,void 0),this._exportScheduledPromise=new Promise(e=>{this._exportScheduledResolve=e}),this._exportCompleted=this._executeExport(e,t,n)}get exportCompleted(){return this._exportCompleted}get exportScheduled(){return this._exportScheduledPromise}_executeExport(e,t,n){var r=this;return G(function*(){try{yield ld(t),yield N.with(Yr(N.active()),G(function*(){return r._exportWithTimeout(e,t,n)}))}catch(e){vi(e),r._exportScheduledResolve()}})()}_exportWithTimeout(e,t,n){var r=this;return G(function*(){return new Promise((i,a)=>{let o=setTimeout(()=>{a(Error(`Timeout`))},n);e.export(t,e=>{if(clearTimeout(o),e.code===fa.SUCCESS)i();else{var t;a((t=e.error)==null?Error(`BatchLogRecordProcessor: log record export failed`):t)}}),r._exportScheduledResolve()})})()}},fd=class{constructor(e,t){var n,r,i,a;R(this,`_maxExportBatchSize`,void 0),R(this,`_maxQueueSize`,void 0),R(this,`_scheduledDelayMillis`,void 0),R(this,`_exportTimeoutMillis`,void 0),R(this,`_exporter`,void 0),R(this,`_currentExport`,null),R(this,`_finishedLogRecords`,[]),R(this,`_timer`,void 0),R(this,`_shutdownOnce`,void 0),R(this,`_flushing`,!1),this._exporter=e,this._maxExportBatchSize=(n=t==null?void 0:t.maxExportBatchSize)==null?512:n,this._maxQueueSize=(r=t==null?void 0:t.maxQueueSize)==null?2048:r,this._scheduledDelayMillis=(i=t==null?void 0:t.scheduledDelayMillis)==null?5e3:i,this._exportTimeoutMillis=(a=t==null?void 0:t.exportTimeoutMillis)==null?3e4:a,this._shutdownOnce=new bo(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(P.warn(`BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}_addToBuffer(e){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}shutdown(){return this._shutdownOnce.call()}_shutdown(){var e=this;return G(function*(){e.onShutdown(),yield e._flushAll(),yield e._exporter.shutdown()})()}_flushAll(){var e=this;return G(function*(){if(e._flushing)return;e._flushing=!0;let t=e._finishedLogRecords;for(e._finishedLogRecords=[],e._clearTimer(),e._currentExport!==null&&(yield e._exporter.forceFlush(),yield e._currentExport.exportCompleted,e._currentExport=null);t.length>0;){let n;t.length<=e._maxExportBatchSize?(n=t,t=[]):n=t.splice(0,e._maxExportBatchSize);let r=new dd(e._exporter,n,e._exportTimeoutMillis);e._currentExport=r;try{yield r.exportScheduled,yield e._exporter.forceFlush(),yield r.exportCompleted}catch(e){vi(e)}finally{e._currentExport=null}}e._flushing=!1,e._maybeStartTimer()})()}_extractBatch(){if(this._finishedLogRecords.length===0)return null;if(this._finishedLogRecords.length<=this._maxExportBatchSize){let e=this._finishedLogRecords;return this._finishedLogRecords=[],e}else return this._finishedLogRecords.splice(0,this._maxExportBatchSize)}_exportOneBatch(){this._clearTimer();let e=this._extractBatch();if(e===null)return;let t=new dd(this._exporter,e,this._exportTimeoutMillis);this._currentExport=t,t.exportCompleted.then(()=>{this._currentExport=null,this._maybeStartTimer()}).catch(e=>{this._currentExport=null,vi(e),this._maybeStartTimer()})}_maybeStartTimer(){if(!this._shutdownOnce.isCalled&&!this._flushing&&this._finishedLogRecords.length!==0&&this._currentExport===null){if(this._finishedLogRecords.length>=this._maxExportBatchSize){this._exportOneBatch();return}this._timer===void 0&&(this._timer=setTimeout(()=>{this._timer=void 0,this._exportOneBatch()},this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}};z();var pd=class extends fd{constructor(e,t){super(e,t),R(this,`_visibilityChangeListener`,void 0),R(this,`_pageHideListener`,void 0),this._onInit(t)}onShutdown(){typeof document>`u`||(this._visibilityChangeListener&&document.removeEventListener(`visibilitychange`,this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener(`pagehide`,this._pageHideListener))}_onInit(e){(e==null?void 0:e.disableAutoFlushOnDocumentHide)===!0||typeof document>`u`||(this._visibilityChangeListener=()=>{document.visibilityState===`hidden`&&this.forceFlush()},this._pageHideListener=()=>{this.forceFlush()},document.addEventListener(`visibilitychange`,this._visibilityChangeListener),document.addEventListener(`pagehide`,this._pageHideListener))}},md,hd=t((()=>{md=`exception`})),gd,_d=t((()=>{I(),W(),qi(),hd(),z(),gd=class{constructor(e){var t,n;R(this,`_spanContext`,void 0),R(this,`kind`,void 0),R(this,`parentSpanContext`,void 0),R(this,`attributes`,{}),R(this,`links`,[]),R(this,`events`,[]),R(this,`startTime`,void 0),R(this,`resource`,void 0),R(this,`instrumentationScope`,void 0),R(this,`_droppedAttributesCount`,0),R(this,`_droppedEventsCount`,0),R(this,`_droppedLinksCount`,0),R(this,`_attributesCount`,0),R(this,`name`,void 0),R(this,`status`,{code:xt.UNSET}),R(this,`endTime`,[0,0]),R(this,`_ended`,!1),R(this,`_duration`,[-1,-1]),R(this,`_spanProcessor`,void 0),R(this,`_spanLimits`,void 0),R(this,`_attributeValueLengthLimit`,void 0),R(this,`_recordEndMetrics`,void 0),R(this,`_performanceStartTime`,void 0),R(this,`_performanceOffset`,void 0),R(this,`_startTimeProvided`,void 0);let r=Date.now();if(this._spanContext=e.spanContext,this._performanceStartTime=U.now(),this._performanceOffset=r-(this._performanceStartTime+U.timeOrigin),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=(t=this._spanLimits.attributeValueLengthLimit)==null?0:t,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,e.links)for(let t of e.links)this.addLink(t);this.startTime=this._getTime((n=e.startTime)==null?r:n),this.resource=e.resource,this.instrumentationScope=e.scope,this._recordEndMetrics=e.recordEndMetrics,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,t){if(t==null||this._isSpanEnded())return this;if(e.length===0)return P.warn(`Invalid attribute key: ${e}`),this;if(!ui(t))return P.warn(`Invalid attribute value set for key: ${e}`),this;let{attributeCountLimit:n}=this._spanLimits,r=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n!==void 0&&this._attributesCount>=n&&r?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),r&&this._attributesCount++,this)}setAttributes(e){for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.setAttribute(t,e[t]);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;let{eventCountLimit:r}=this._spanLimits;if(r===0)return P.warn(`No events allowed.`),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&P.debug(`Dropping extra events.`),this.events.shift(),this._droppedEventsCount++),oa(t)&&(oa(n)||(n=t),t=void 0);let i=ci(t),{attributePerEventCountLimit:a}=this._spanLimits,o={},s=0,c=0;for(let e in i){if(!Object.prototype.hasOwnProperty.call(i,e))continue;let t=i[e];if(a!==void 0&&c>=a){s++;continue}o[e]=this._truncateToSize(t),c++}return this.events.push({name:e,attributes:o,time:this._getTime(n),droppedAttributesCount:s}),this}addLink(e){if(this._isSpanEnded())return this;let{linkCountLimit:t}=this._spanLimits;if(t===0)return this._droppedLinksCount++,this;t!==void 0&&this.links.length>=t&&(this._droppedLinksCount===0&&P.debug(`Dropping extra links.`),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:n}=this._spanLimits,r=ci(e.attributes),i={},a=0,o=0;for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let t=r[e];if(n!==void 0&&o>=n){a++;continue}i[e]=this._truncateToSize(t),o++}let s={context:e.context};return o>0&&(s.attributes=i),a>0&&(s.droppedAttributesCount=a),this.links.push(s),this}addLinks(e){for(let t of e)this.addLink(t);return this}setStatus(e){if(this._isSpanEnded()||e.code===xt.UNSET||this.status.code===xt.OK)return this;let t={code:e.code};return e.code===xt.ERROR&&(typeof e.message==`string`?t.message=e.message:e.message!=null&&P.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`)),this.status=t,this}updateName(e){return this._isSpanEnded()||(this.name=e),this}end(e){var t;if(this._isSpanEnded()){P.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(e),this._duration=na(this.startTime,this.endTime),this._duration[0]<0&&(P.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&&P.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&P.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),(t=this._recordEndMetrics)==null||t.call(this),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e==`number`&&e<=U.now())return ea(e+this._performanceOffset);if(typeof e==`number`)return $i(e);if(e instanceof Date)return $i(e.getTime());if(aa(e))return e;if(this._startTimeProvided)return $i(Date.now());let t=U.now()-this._performanceStartTime;return sa(this.startTime,$i(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e==`string`?n[ki]=e:e&&(e.code?n[ji]=e.code.toString():e.name&&(n[ji]=e.name),e.message&&(n[ki]=e.message),e.stack&&(n[Ai]=e.stack)),n[`exception.type`]||n[`exception.message`]?this.addEvent(md,n,t):P.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let e=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);P.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(P.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e==`string`?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(e=>typeof e==`string`?this._truncateToLimitUtil(e,t):e):e}}})),vd,yd=t((()=>{(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(vd||(vd={}))})),bd,xd=t((()=>{yd(),bd=class{shouldSample(){return{decision:vd.NOT_RECORD}}toString(){return`AlwaysOffSampler`}}})),Sd,Cd=t((()=>{yd(),Sd=class{shouldSample(){return{decision:vd.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}}})),wd,Td=t((()=>{I(),W(),xd(),Cd(),z(),wd=class{constructor(e){var t,n,r,i;R(this,`_root`,void 0),R(this,`_remoteParentSampled`,void 0),R(this,`_remoteParentNotSampled`,void 0),R(this,`_localParentSampled`,void 0),R(this,`_localParentNotSampled`,void 0),this._root=e.root,this._root||(vi(Error(`ParentBasedSampler must have a root sampler configured`)),this._root=new Sd),this._remoteParentSampled=(t=e.remoteParentSampled)==null?new Sd:t,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)==null?new bd:n,this._localParentSampled=(r=e.localParentSampled)==null?new Sd:r,this._localParentNotSampled=(i=e.localParentNotSampled)==null?new bd:i}shouldSample(e,t,n,r,i,a){let o=F.getSpanContext(e);return!o||!tt(o)?this._root.shouldSample(e,t,n,r,i,a):o.isRemote?o.traceFlags&M.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,i,a):this._remoteParentNotSampled.shouldSample(e,t,n,r,i,a):o.traceFlags&M.SAMPLED?this._localParentSampled.shouldSample(e,t,n,r,i,a):this._localParentNotSampled.shouldSample(e,t,n,r,i,a)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}})),Ed,Dd=t((()=>{I(),yd(),z(),Ed=class{constructor(e=0){R(this,`_ratio`,void 0),R(this,`_upperBound`,void 0),this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:$e(t)&&this._accumulate(t)<this._upperBound?vd.RECORD_AND_SAMPLED:vd.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!=`number`||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<32;n+=8){let r=0;for(let t=0;t<8;t++){let i=e.charCodeAt(n+t),a=i<58?i-48:i<71?i-55:i-87;r=r<<4|a}t=(t^r)>>>0}return t}}}));function Od(){var e,t,n,r,i,a,o,s;return{sampler:kd(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:(e=void 0)==null?1/0:e,attributeCountLimit:(t=void 0)==null?128:t},spanLimits:{attributeValueLengthLimit:(n=void 0)==null?1/0:n,attributeCountLimit:(r=void 0)==null?128:r,linkCountLimit:(i=void 0)==null?128:i,eventCountLimit:(a=void 0)==null?128:a,attributePerEventCountLimit:(o=void 0)==null?128:o,attributePerLinkCountLimit:(s=void 0)==null?128:s}}}function kd(){var e;let t=(e=void 0)==null?jd.ParentBasedAlwaysOn:e;switch(t){case jd.AlwaysOn:return new Sd;case jd.AlwaysOff:return new bd;case jd.ParentBasedAlwaysOn:return new wd({root:new Sd});case jd.ParentBasedAlwaysOff:return new wd({root:new bd});case jd.TraceIdRatio:return new Ed(Ad());case jd.ParentBasedTraceIdRatio:return new wd({root:new Ed(Ad())});default:return P.error(`OTEL_TRACES_SAMPLER value "${t}" invalid, defaulting to "${jd.ParentBasedAlwaysOn}".`),new wd({root:new Sd})}}function Ad(){return P.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Md}.`),Md}var jd,Md,Nd=t((()=>{I(),W(),xd(),Cd(),Td(),Dd(),(function(e){e.AlwaysOff=`always_off`,e.AlwaysOn=`always_on`,e.ParentBasedAlwaysOff=`parentbased_always_off`,e.ParentBasedAlwaysOn=`parentbased_always_on`,e.ParentBasedTraceIdRatio=`parentbased_traceidratio`,e.TraceIdRatio=`traceidratio`})(jd||(jd={})),Md=1}));function Pd(e){let t={sampler:kd()},n=Od(),r=Object.assign({},n,t,e);return r.generalLimits=Object.assign({},n.generalLimits,e.generalLimits||{}),r.spanLimits=Object.assign({},n.spanLimits,e.spanLimits||{}),r}function Fd(e){var t,n,r,i,a,o,s,c,l,u,d,f;let p=Object.assign({},e.spanLimits);return p.attributeCountLimit=(t=(n=(r=(i=(a=e.spanLimits)==null?void 0:a.attributeCountLimit)==null?(o=e.generalLimits)==null?void 0:o.attributeCountLimit:i)==null?void 0:r)==null?void 0:n)==null?128:t,p.attributeValueLengthLimit=(s=(c=(l=(u=(d=e.spanLimits)==null?void 0:d.attributeValueLengthLimit)==null?(f=e.generalLimits)==null?void 0:f.attributeValueLengthLimit:u)==null?void 0:l)==null?void 0:c)==null?Id:s,Object.assign({},e,{spanLimits:p})}var Id,Ld=t((()=>{Nd(),W(),Id=1/0})),Rd,zd=t((()=>{I(),W(),z(),Rd=class{constructor(e,t){var n,r,i,a;R(this,`_maxExportBatchSize`,void 0),R(this,`_maxQueueSize`,void 0),R(this,`_scheduledDelayMillis`,void 0),R(this,`_exportTimeoutMillis`,void 0),R(this,`_exporter`,void 0),R(this,`_isExporting`,!1),R(this,`_finishedSpans`,[]),R(this,`_timer`,void 0),R(this,`_shutdownOnce`,void 0),R(this,`_droppedSpansCount`,0),this._exporter=e,this._maxExportBatchSize=typeof(t==null?void 0:t.maxExportBatchSize)==`number`?t.maxExportBatchSize:(n=void 0)==null?512:n,this._maxQueueSize=typeof(t==null?void 0:t.maxQueueSize)==`number`?t.maxQueueSize:(r=void 0)==null?2048:r,this._scheduledDelayMillis=typeof(t==null?void 0:t.scheduledDelayMillis)==`number`?t.scheduledDelayMillis:(i=void 0)==null?5e3:i,this._exportTimeoutMillis=typeof(t==null?void 0:t.exportTimeoutMillis)==`number`?t.exportTimeoutMillis:(a=void 0)==null?3e4:a,this._shutdownOnce=new bo(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(P.warn(`BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&M.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&P.debug(`maxQueueSize reached, dropping spans`),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(P.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{let n=[],r=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let e=0,t=r;e<t;e++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,t)=>{let n=setTimeout(()=>{t(Error(`Timeout`))},this._exportTimeoutMillis);N.with(Yr(N.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);let i=()=>this._exporter.export(r,r=>{if(clearTimeout(n),r.code===fa.SUCCESS)e();else{var i;t((i=r.error)==null?Error(`BatchSpanProcessor: span export failed`):i)}}),a=null;for(let e=0,t=r.length;e<t;e++){let t=r[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(a!=null||(a=[]),a.push(t.resource.waitForAsyncAttributes()))}a===null?i():Promise.all(a).then(i,e=>{vi(e),t(e)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{this._isExporting=!1,vi(e)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}}})),Bd,Vd=t((()=>{zd(),W(),z(),Bd=class extends Rd{constructor(e,t){super(e,t),R(this,`_visibilityChangeListener`,void 0),R(this,`_pageHideListener`,void 0),this.onInit(t)}onInit(e){(e==null?void 0:e.disableAutoFlushOnDocumentHide)!==!0&&typeof document<`u`&&(this._visibilityChangeListener=()=>{document.visibilityState===`hidden`&&this.forceFlush().catch(e=>{vi(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{vi(e)})},document.addEventListener(`visibilitychange`,this._visibilityChangeListener),document.addEventListener(`pagehide`,this._pageHideListener))}onShutdown(){typeof document<`u`&&(this._visibilityChangeListener&&document.removeEventListener(`visibilitychange`,this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener(`pagehide`,this._pageHideListener))}}}));function Hd(e){for(let t=0;t<e.length;t++)e[t]=Math.random()*256>>>0;for(let t=0;t<e.length;t++)if(e[t]>0)return;e[e.length-1]=1}function Ud(e){let t=``;for(let n=0;n<e.length;n++)t+=Jd[e[n]];return t}var Wd,Gd,Kd,qd,Jd,Yd,Xd=t((()=>{Wd=16,Gd=8,Kd=new Uint8Array(Wd),qd=new Uint8Array(Gd),Jd=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`)),Yd=class{generateTraceId(){return Hd(Kd),Ud(Kd)}generateSpanId(){return Hd(qd),Ud(qd)}}})),Zd=t((()=>{Vd(),Xd()})),Qd,$d,ef,tf,nf=t((()=>{Qd=`otel.span.parent.origin`,$d=`otel.span.sampling_result`,ef=`otel.sdk.span.live`,tf=`otel.sdk.span.started`}));function rf(e){return e?e.isRemote?`remote`:`local`:`none`}function af(e){switch(e){case vd.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case vd.RECORD:return`RECORD_ONLY`;case vd.NOT_RECORD:return`DROP`}}var of,sf=t((()=>{yd(),nf(),z(),of=class{constructor(e){R(this,`startedSpans`,void 0),R(this,`liveSpans`,void 0),this.startedSpans=e.createCounter(tf,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=e.createUpDownCounter(ef,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(e,t){let n=af(t);if(this.startedSpans.add(1,{[Qd]:rf(e),[$d]:n}),t===vd.NOT_RECORD)return()=>{};let r={[$d]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}}})),cf,lf=t((()=>{cf=`2.7.1`})),uf,df=t((()=>{I(),W(),_d(),Ld(),Zd(),sf(),lf(),z(),uf=class{constructor(e,t,n,r){R(this,`_sampler`,void 0),R(this,`_generalLimits`,void 0),R(this,`_spanLimits`,void 0),R(this,`_idGenerator`,void 0),R(this,`instrumentationScope`,void 0),R(this,`_resource`,void 0),R(this,`_spanProcessor`,void 0),R(this,`_tracerMetrics`,void 0);let i=Pd(t);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=t.idGenerator||new Yd,this._resource=n,this._spanProcessor=r,this.instrumentationScope=e;let a=i.meterProvider?i.meterProvider.getMeter(`@opentelemetry/sdk-trace`,cf):oe();this._tracerMetrics=new of(a)}startSpan(e,t={},n=N.active()){var r,i,a;t.root&&(n=F.deleteSpan(n));let o=F.getSpan(n);if(Xr(n))return P.debug(`Instrumentation suppressed, returning Noop Span`),F.wrapSpanContext(Be);let s=o==null?void 0:o.spanContext(),c=this._idGenerator.generateSpanId(),l,u,d;!s||!F.isSpanContextValid(s)?u=this._idGenerator.generateTraceId():(u=s.traceId,d=s.traceState,l=s);let f=(r=t.kind)==null?yt.INTERNAL:r,p=((i=t.links)==null?[]:i).map(e=>({context:e.context,attributes:ci(e.attributes)})),m=ci(t.attributes),h=this._sampler.shouldSample(n,u,e,f,m,p),g=this._tracerMetrics.startSpan(s,h.decision);d=(a=h.traceState)==null?d:a;let _=h.decision===_t.RECORD_AND_SAMPLED?M.SAMPLED:M.NONE,v={traceId:u,spanId:c,traceFlags:_,traceState:d};if(h.decision===_t.NOT_RECORD)return P.debug(`Recording is off, propagating context in a non-recording span`),F.wrapSpanContext(v);let y=ci(Object.assign(m,h.attributes));return new gd({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:v,name:e,kind:f,links:p,parentSpanContext:l,attributes:y,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:g})}startActiveSpan(e,t,n,r){var i;let a,o,s;if(arguments.length<2)return;arguments.length===2?s=t:arguments.length===3?(a=t,s=n):(a=t,o=n,s=r);let c=(i=o)==null?N.active():i,l=this.startSpan(e,a,c),u=F.setSpan(c,l);return N.with(u,s,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}})),ff,pf=t((()=>{W(),z(),ff=class{constructor(e){R(this,`_spanProcessors`,void 0),this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(e=>{vi(e||Error(`MultiSpanProcessor: forceFlush failed`)),t()})})}onStart(e,t){for(let n of this._spanProcessors)n.onStart(e,t)}onEnding(e){for(let t of this._spanProcessors)t.onEnding&&t.onEnding(e)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}}})),mf,hf,gf=t((()=>{W(),ac(),df(),Nd(),pf(),Ld(),z(),(function(e){e[e.resolved=0]=`resolved`,e[e.timeout=1]=`timeout`,e[e.error=2]=`error`,e[e.unresolved=3]=`unresolved`})(mf||(mf={})),hf=class{constructor(e={}){var t,n;R(this,`_config`,void 0),R(this,`_tracers`,new Map),R(this,`_resource`,void 0),R(this,`_activeSpanProcessor`,void 0);let r=eo({},Od(),Fd(e));this._resource=(t=r.resource)==null?$s():t,this._config=Object.assign({},r,{resource:this._resource});let i=[];(n=e.spanProcessors)!=null&&n.length&&i.push(...e.spanProcessors),this._activeSpanProcessor=new ff(i)}getTracer(e,t,n){let r=`${e}@${t||``}:${(n==null?void 0:n.schemaUrl)||``}`;return this._tracers.has(r)||this._tracers.set(r,new uf({name:e,version:t,schemaUrl:n==null?void 0:n.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(r)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,t=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(n=>{let r,i=setTimeout(()=>{n(Error(`Span processor did not completed within timeout period of ${e} ms`)),r=mf.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),r!==mf.timeout&&(r=mf.resolved,n(r))}).catch(e=>{clearTimeout(i),r=mf.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{let r=t.filter(e=>e!==mf.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}})),_f=t((()=>{gf(),Zd(),W(),z(),I(),K(),xd(),Cd(),Td(),Dd(),yd()})),vf,yf=t((()=>{I(),z(),vf=class{constructor(){R(this,`_enabled`,!1),R(this,`_currentContext`,j)}_bindFunction(e=j,t){let n=this,r=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(r,`length`,{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}active(){return this._currentContext}bind(e,t){return e===void 0&&(e=this.active()),typeof t==`function`?this._bindFunction(e,t):t}disable(){return this._currentContext=j,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=j,this)}with(e,t,n,...r){let i=this._currentContext;this._currentContext=e||j;try{return t.call(n,...r)}finally{this._currentContext=i}}}}));function bf(e){if(e!==null){if(e===void 0){let e=new vf;e.enable(),N.setGlobalContextManager(e);return}e.enable(),N.setGlobalContextManager(e)}}function xf(e){if(e!==null){if(e===void 0){Gt.setGlobalPropagator(new ma({propagators:[new Ia,new oi]}));return}Gt.setGlobalPropagator(e)}}var Sf,Cf=t((()=>{_f(),yf(),I(),W(),Sf=class extends hf{constructor(e={}){super(e)}register(e={}){F.setGlobalTracerProvider(this),xf(e.propagator),bf(e.contextManager)}}})),Q,wf=t((()=>{(function(e){e.CONNECT_END=`connectEnd`,e.CONNECT_START=`connectStart`,e.DECODED_BODY_SIZE=`decodedBodySize`,e.DOM_COMPLETE=`domComplete`,e.DOM_CONTENT_LOADED_EVENT_END=`domContentLoadedEventEnd`,e.DOM_CONTENT_LOADED_EVENT_START=`domContentLoadedEventStart`,e.DOM_INTERACTIVE=`domInteractive`,e.DOMAIN_LOOKUP_END=`domainLookupEnd`,e.DOMAIN_LOOKUP_START=`domainLookupStart`,e.ENCODED_BODY_SIZE=`encodedBodySize`,e.FETCH_START=`fetchStart`,e.LOAD_EVENT_END=`loadEventEnd`,e.LOAD_EVENT_START=`loadEventStart`,e.NAVIGATION_START=`navigationStart`,e.REDIRECT_END=`redirectEnd`,e.REDIRECT_START=`redirectStart`,e.REQUEST_START=`requestStart`,e.RESPONSE_END=`responseEnd`,e.RESPONSE_START=`responseStart`,e.SECURE_CONNECTION_START=`secureConnectionStart`,e.START_TIME=`startTime`,e.UNLOAD_EVENT_END=`unloadEventEnd`,e.UNLOAD_EVENT_START=`unloadEventStart`})(Q||(Q={}))})),Tf,Ef,Df=t((()=>{Tf=`http.response_content_length`,Ef=`http.response_content_length_uncompressed`}));function Of(){return Vf||(Vf=document.createElement(`a`)),Vf}function kf(e,t){return t in e}function $(e,t,n,r=!0){if(kf(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function Af(e,t,n=!1,r,i){if(r===void 0&&(r=t[Q.START_TIME]!==0),n||($(e,Q.FETCH_START,t,r),$(e,Q.DOMAIN_LOOKUP_START,t,r),$(e,Q.DOMAIN_LOOKUP_END,t,r),$(e,Q.CONNECT_START,t,r),$(e,Q.SECURE_CONNECTION_START,t,r),$(e,Q.CONNECT_END,t,r),$(e,Q.REQUEST_START,t,r),$(e,Q.RESPONSE_START,t,r),$(e,Q.RESPONSE_END,t,r)),!i){let n=t[Q.ENCODED_BODY_SIZE];n!==void 0&&e.setAttribute(Tf,n);let r=t[Q.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(Ef,r)}}function jf(e){return e.slice().sort((e,t)=>{let n=e[Q.FETCH_START],r=t[Q.FETCH_START];return n>r?1:n<r?-1:0})}function Mf(){return typeof location<`u`?location.origin:void 0}function Nf(e,t,n,r,i=new WeakSet,a){let o=If(e);e=o.toString();let s=Ff(e,t,n,r,i,a);if(s.length===0)return{mainRequest:void 0};if(s.length===1)return{mainRequest:s[0]};let c=jf(s);if(o.origin!==Mf()&&c.length>1){let e=c[0],t=Pf(c,e[Q.RESPONSE_END],n),r=e[Q.RESPONSE_END];return t[Q.FETCH_START]<r&&(t=e,e=void 0),{corsPreFlightRequest:e,mainRequest:t}}else return{mainRequest:s[0]}}function Pf(e,t,n){let r=ra(n),i=ra(ta(t)),a=e[1],o,s=e.length;for(let t=1;t<s;t++){let n=e[t],s=ra(ta(n[Q.FETCH_START])),c=r-ra(ta(n[Q.RESPONSE_END]));s>=i&&(!o||c<o)&&(o=c,a=n)}return a}function Ff(e,t,n,r,i,a){let o=ra(t),s=ra(n),c=r.filter(t=>{let n=ra(ta(t[Q.FETCH_START])),r=ra(ta(t[Q.RESPONSE_END]));return t.initiatorType.toLowerCase()===(a||`xmlhttprequest`)&&t.name===e&&n>=o&&r<=s});return c.length>0&&(c=c.filter(e=>!i.has(e))),c}function If(e){if(typeof URL==`function`)return new URL(e,typeof document<`u`?document.baseURI:typeof location<`u`?location.href:void 0);let t=Of();return t.href=e,t}function Lf(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return`/`;let n=zf(e,t);if(t&&n.indexOf(`@id`)>0)return n;let r=``;return e.parentNode&&(r+=Lf(e.parentNode,t)),r+=n,r}function Rf(e){if(!e.parentNode)return 0;let t=[e.nodeType];e.nodeType===Node.CDATA_SECTION_NODE&&t.push(Node.TEXT_NODE);let n=Array.from(e.parentNode.childNodes);return n=n.filter(n=>{let r=n.localName;return t.indexOf(n.nodeType)>=0&&r===e.localName}),n.length>=1?n.indexOf(e)+1:0}function zf(e,t){let n=e.nodeType,r=Rf(e),i=``;if(n===Node.ELEMENT_NODE){let n=e.getAttribute(`id`);if(t&&n)return`//*[@id="${n}"]`;i=e.localName}else if(n===Node.TEXT_NODE||n===Node.CDATA_SECTION_NODE)i=`text()`;else if(n===Node.COMMENT_NODE)i=`comment()`;else return``;return i&&r>1?`/${i}[${r}]`:`/${i}`}function Bf(e,t){let n=t||[];return(typeof n==`string`||n instanceof RegExp)&&(n=[n]),If(e).origin===Mf()?!0:n.some(t=>ho(e,t))}var Vf,Hf=t((()=>{wf(),W(),Df()})),Uf=t((()=>{Cf(),yf(),wf(),Hf(),_f()}));Ju(),Uf(),gn();var Wf=`body`,Gf=3e3,Kf=.8,qf=[`[data-loading="true"]`,`[aria-busy="true"]`,`.loading`,`.is-loading`,`.spinner`,`.skeleton`,`.bk-loading`],Jf=[[.5,.5],[.25,.25],[.75,.25],[.25,.75],[.75,.75]],Yf=e=>{if(!e)return``;let t=e.tagName.toLowerCase();return e.id?`${t}#${e.id}`:t},Xf=(e,t)=>e?t.some(t=>{try{return e.matches(t)||!!e.closest(t)}catch(e){return!1}}):!1,Zf=e=>{if(typeof document>`u`)return;if(document.readyState===`complete`||document.readyState===`interactive`){e();return}let t=()=>{document.removeEventListener(`DOMContentLoaded`,t),e()};document.addEventListener(`DOMContentLoaded`,t)},Qf=e=>{let t;return{name:`blank-screen`,enabled:!!e,init(n){var r,i,a,o;if(typeof window>`u`||typeof document>`u`)return;let s=typeof e==`object`?e:{},c=(r=s.rootSelector)==null?Wf:r,l=(i=s.checkDelay)==null?Gf:i,u=(a=s.threshold)==null?Kf:a,d=[...qf,...(o=s.ignoreSelectors)==null?[]:o],f=n.meter.createCounter(`browser.blank_screen.count`,{description:`Number of suspected blank screen detections`});Zf(()=>{t=window.setTimeout(()=>{var e,t;let r=document.querySelector(c),i=0,a=0;for(let[e,t]of Jf){let n=document.elementFromPoint(window.innerWidth*e,window.innerHeight*t);if(Xf(n,d)){a+=1;continue}(n===r||n===document.body||n===document.documentElement)&&(i+=1)}let o=i/Jf.length;if(a===Jf.length)return;let s=o>=u,l={"bk.rum.blank_screen.score":o,"bk.rum.blank_screen.threshold":u,"bk.rum.blank_screen.root":c,"bk.rum.blank_screen.detected":s,"bk.rum.blank_screen.center_element":Yf(document.elementFromPoint(window.innerWidth/2,window.innerHeight/2)),"bk.rum.blank_screen.dom_node_count":(e=(t=document.body)==null?void 0:t.getElementsByTagName(`*`).length)==null?0:e};s&&(f.add(1,n.applyRedact({"bk.rum.blank_screen.root":c})),n.emitLog({severityNumber:L.ERROR,severityText:`ERROR`,body:`browser.blank_screen`,attributes:l}))},l)})},shutdown(){t!==void 0&&typeof window<`u`&&window.clearTimeout(t)}}},$f=()=>typeof window>`u`?`http://localhost`:window.location.origin,ep=e=>{try{return new URL(e,$f()).href}catch(t){return e}},tp=e=>e.length>1?e.replace(/\/+$/,``):e,np=(e,t)=>{let n=e=>tp(e.replace(/[?#].*$/,``));return n(e)===n(t)},rp=e=>{try{return new URL(e,$f()).origin===$f()}catch(e){return!1}},ip=(e,t)=>{let n=ep(t);return[e.traces.endpoint,e.metrics.endpoint,e.logs.endpoint].some(e=>np(n,ep(e)))},ap=(e,t)=>ip(e,t),op=(e,t)=>rp(t),sp,cp=t((()=>{(function(e){e.DOCUMENT_LOAD=`documentLoad`,e.DOCUMENT_FETCH=`documentFetch`,e.RESOURCE_FETCH=`resourceFetch`})(sp||(sp={}))})),lp,up,dp=t((()=>{lp=`0.62.0`,up=`@opentelemetry/instrumentation-document-load`})),fp,pp,mp=t((()=>{fp=`http.url`,pp=`http.user_agent`})),hp,gp=t((()=>{(function(e){e.FIRST_PAINT=`firstPaint`,e.FIRST_CONTENTFUL_PAINT=`firstContentfulPaint`})(hp||(hp={}))})),_p,vp,yp,bp=t((()=>{W(),gp(),_p=()=>{var e;let t={},n=(e=U.getEntriesByType)==null?void 0:e.call(U,`navigation`)[0];if(n)Object.values(Q).forEach(e=>{if(kf(n,e)){let r=n[e];typeof r==`number`&&(t[e]=r)}});else{let e=U.timing;e&&Object.values(Q).forEach(n=>{if(kf(e,n)){let r=e[n];typeof r==`number`&&(t[n]=r)}})}return t},vp={"first-paint":hp.FIRST_PAINT,"first-contentful-paint":hp.FIRST_CONTENTFUL_PAINT},yp=e=>{var t;let n=(t=U.getEntriesByType)==null?void 0:t.call(U,`paint`);n&&n.forEach(({name:t,startTime:n})=>{kf(vp,t)&&e.addEvent(vp[t],n)})}})),xp,Sp=t((()=>{I(),W(),Uf(),qi(),cp(),dp(),mp(),bp(),z(),xp=class extends Vu{constructor(e={}){super(up,lp,e),R(this,`component`,`document-load`),R(this,`version`,`1`),R(this,`moduleName`,this.component),R(this,`_semconvStability`,void 0),this._semconvStability=Ku(`http`,e==null?void 0:e.semconvStabilityOptIn)}init(){}_onDocumentLoaded(){window.setTimeout(()=>{this._collectPerformance()})}_addResourcesSpans(e){var t;let n=(t=U.getEntriesByType)==null?void 0:t.call(U,`resource`);n&&n.forEach(t=>{this._initResourceSpan(t,e)})}_collectPerformance(){let e=Array.from(document.getElementsByTagName(`meta`)).find(e=>e.getAttribute(`name`)===Ma),t=_p(),n=e&&e.content||``;N.with(Gt.extract(j,{traceparent:n}),()=>{var e;let n=this._startSpan(sp.DOCUMENT_LOAD,Q.FETCH_START,t);n&&(N.with(F.setSpan(N.active(),n),()=>{let e=this._startSpan(sp.DOCUMENT_FETCH,Q.FETCH_START,t);e&&(this._semconvStability&Z.OLD&&e.setAttribute(fp,location.href),this._semconvStability&Z.STABLE&&e.setAttribute(Hi,location.href),N.with(F.setSpan(N.active(),e),()=>{var n;let r=!(this._semconvStability&Z.OLD);Af(e,t,this.getConfig().ignoreNetworkEvents,void 0,r),this._addCustomAttributesOnSpan(e,(n=this.getConfig().applyCustomAttributesOnSpan)==null?void 0:n.documentFetch),this._endSpan(e,Q.RESPONSE_END,t)}))}),this._semconvStability&Z.OLD&&(n.setAttribute(fp,location.href),n.setAttribute(pp,navigator.userAgent)),this._semconvStability&Z.STABLE&&(n.setAttribute(Hi,location.href),n.setAttribute(Ui,navigator.userAgent)),this._addResourcesSpans(n),this.getConfig().ignoreNetworkEvents||($(n,Q.FETCH_START,t),$(n,Q.UNLOAD_EVENT_START,t),$(n,Q.UNLOAD_EVENT_END,t),$(n,Q.DOM_INTERACTIVE,t),$(n,Q.DOM_CONTENT_LOADED_EVENT_START,t),$(n,Q.DOM_CONTENT_LOADED_EVENT_END,t),$(n,Q.DOM_COMPLETE,t),$(n,Q.LOAD_EVENT_START,t),$(n,Q.LOAD_EVENT_END,t)),this.getConfig().ignorePerformancePaintEvents||yp(n),this._addCustomAttributesOnSpan(n,(e=this.getConfig().applyCustomAttributesOnSpan)==null?void 0:e.documentLoad),this._endSpan(n,Q.LOAD_EVENT_END,t))})}_endSpan(e,t,n){e&&(kf(n,t)?e.end(n[t]):e.end())}_initResourceSpan(e,t){let n=this._startSpan(sp.RESOURCE_FETCH,Q.FETCH_START,e,t);if(n){var r;this._semconvStability&Z.OLD&&n.setAttribute(fp,e.name),this._semconvStability&Z.STABLE&&n.setAttribute(Hi,e.name);let t=!(this._semconvStability&Z.OLD);Af(n,e,this.getConfig().ignoreNetworkEvents,void 0,t),this._addCustomAttributesOnResourceSpan(n,e,(r=this.getConfig().applyCustomAttributesOnSpan)==null?void 0:r.resourceFetch),this._endSpan(n,Q.RESPONSE_END,e)}}_startSpan(e,t,n,r){if(kf(n,t)&&typeof n[t]==`number`)return this.tracer.startSpan(e,{startTime:n[t]},r?F.setSpan(N.active(),r):void 0)}_waitForPageLoad(){window.document.readyState===`complete`?this._onDocumentLoaded():(this._onDocumentLoaded=this._onDocumentLoaded.bind(this),window.addEventListener(`load`,this._onDocumentLoaded))}_addCustomAttributesOnSpan(e,t){t&&Wu(()=>t(e),e=>{e&&this._diag.error(`addCustomAttributesOnSpan`,e)},!0)}_addCustomAttributesOnResourceSpan(e,t,n){n&&Wu(()=>n(e,t),e=>{e&&this._diag.error(`addCustomAttributesOnResourceSpan`,e)},!0)}enable(){window.removeEventListener(`load`,this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener(`load`,this._onDocumentLoaded)}}})),Cp=n({AttributeNames:()=>sp,DocumentLoadInstrumentation:()=>xp}),wp=t((()=>{Sp(),cp()})),Tp,Ep=t((()=>{(function(e){e.COMPONENT=`component`,e.HTTP_STATUS_TEXT=`http.status_text`})(Tp||(Tp={}))})),Dp,Op,kp,Ap,jp,Mp,Np,Pp,Fp=t((()=>{Dp=`http.host`,Op=`http.method`,kp=`http.request.body.size`,Ap=`http.request_content_length_uncompressed`,jp=`http.scheme`,Mp=`http.status_code`,Np=`http.url`,Pp=`http.user_agent`}));function Ip(...e){if(e[0]instanceof URL||typeof e[0]==`string`){let t=e[1];if(!(t!=null&&t.body))return Promise.resolve();if(t.body instanceof ReadableStream){let{body:e,length:n}=Lp(t.body);return t.body=e,n}else return Promise.resolve(zp(t.body))}else{let t=e[0];return t!=null&&t.body?t.clone().text().then(e=>Bp(e)):Promise.resolve()}}function Lp(e){if(!e.pipeThrough)return Gp.warn(`Platform has ReadableStream but not pipeThrough!`),{body:e,length:Promise.resolve(void 0)};let t=0,n,r=new Promise(e=>{n=e}),i=new TransformStream({start(){},transform(e,n){return G(function*(){let r=yield e;t+=r.byteLength,n.enqueue(e)})()},flush(){n(t)}});return{body:e.pipeThrough(i),length:r}}function Rp(e){return typeof Document<`u`&&e instanceof Document}function zp(e){if(Rp(e))return new XMLSerializer().serializeToString(document).length;if(typeof e==`string`)return Bp(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return Vp(e);if(e instanceof URLSearchParams)return Bp(e.toString());if(e.byteLength!==void 0)return e.byteLength;Gp.warn(`unknown body type`)}function Bp(e){return Kp.encode(e).byteLength}function Vp(e){let t=0;for(let[n,r]of e.entries())t+=n.length,r instanceof Blob?t+=r.size:t+=r.length;return t}function Hp(e){let t=Up(),n=e.toUpperCase();return n in t?n:`_OTHER`}function Up(){return Jp===void 0&&(Jp=qp),Jp}function Wp(e){let t=Number(e.port||Yp[e.protocol]);if(t&&!isNaN(t))return t}var Gp,Kp,qp,Jp,Yp,Xp=t((()=>{I(),W(),K(),Gp=P.createComponentLogger({namespace:`@opentelemetry/opentelemetry-instrumentation-fetch/utils`}),Kp=new TextEncoder,qp={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0},Yp={"https:":`443`,"http:":`80`}})),Zp,Qp=t((()=>{Zp=`0.217.0`})),$p,em,tm,nm=t((()=>{I(),Ju(),W(),Uf(),Ep(),Fp(),qi(),Xp(),Qp(),z(),$p=300,em=typeof PerformanceObserver<`u`,tm=class extends Vu{constructor(e={}){super(`@opentelemetry/instrumentation-fetch`,Zp,e),R(this,`component`,`fetch`),R(this,`version`,Zp),R(this,`moduleName`,this.component),R(this,`_usedResources`,new WeakSet),R(this,`_tasksCount`,0),R(this,`_semconvStability`,void 0),this._semconvStability=Ku(`http`,e==null?void 0:e.semconvStabilityOptIn)}init(){}_addChildSpan(e,t){let n=this.tracer.startSpan(`CORS Preflight`,{startTime:t[Q.FETCH_START]},F.setSpan(N.active(),e)),r=!(this._semconvStability&Z.OLD);Af(n,t,this.getConfig().ignoreNetworkEvents,void 0,r),n.end(t[Q.RESPONSE_END])}_addFinalSpanAttributes(e,t){let n=If(t.url);if(this._semconvStability&Z.OLD&&(e.setAttribute(Mp,t.status),t.statusText!=null&&e.setAttribute(Tp.HTTP_STATUS_TEXT,t.statusText),e.setAttribute(Dp,n.host),e.setAttribute(jp,n.protocol.replace(`:`,``)),typeof navigator<`u`&&e.setAttribute(Pp,navigator.userAgent)),this._semconvStability&Z.STABLE){e.setAttribute(Pi,t.status),e.setAttribute(Fi,n.hostname);let r=Wp(n);r&&e.setAttribute(Ii,r)}}_addHeaders(e,t){if(!Bf(t,this.getConfig().propagateTraceHeaderCorsUrls)){let e={};Gt.inject(N.active(),e),Object.keys(e).length>0&&this._diag.debug(`headers inject skipped due to CORS policy`);return}if(e instanceof Request)Gt.inject(N.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else{let t=new Headers(e.headers);Gt.inject(N.active(),t,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))}),e.headers=t}}_clearResources(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(e,t={}){if(go(e,this.getConfig().ignoreUrls)){this._diag.debug(`ignoring span as url matches ignored url`);return}let n=``,r={};if(this._semconvStability&Z.OLD){let i=(t.method||`GET`).toUpperCase();n=`HTTP ${i}`,r[Tp.COMPONENT]=this.moduleName,r[Op]=i,r[Np]=e}if(this._semconvStability&Z.STABLE){let i=t.method,a=Hp(t.method||`GET`);n||(n=a),r[Mi]=a,a!==i&&(r[Ni]=i),r[Hi]=e}return this.tracer.startSpan(n,{kind:yt.CLIENT,attributes:r})}_findResourceAndAddNetworkEvents(e,t,n){let r=t.entries;if(!r.length){if(!performance.getEntriesByType)return;r=performance.getEntriesByType(`resource`)}let i=Nf(t.spanUrl,t.startTime,n,r,this._usedResources,`fetch`);if(i.mainRequest){let t=i.mainRequest;this._markResourceAsUsed(t);let n=i.corsPreFlightRequest;n&&(this._addChildSpan(e,n),this._markResourceAsUsed(n));let r=!(this._semconvStability&Z.OLD);Af(e,t,this.getConfig().ignoreNetworkEvents,void 0,r)}}_markResourceAsUsed(e){this._usedResources.add(e)}_endSpan(e,t,n){let r=$i(Date.now()),i=ea();this._addFinalSpanAttributes(e,n),this._semconvStability&Z.STABLE&&n.status>=400&&(e.setStatus({code:xt.ERROR}),e.setAttribute(Oi,String(n.status))),setTimeout(()=>{var n;(n=t.observer)==null||n.disconnect(),this._findResourceAndAddNetworkEvents(e,t,i),this._tasksCount--,this._clearResources(),e.end(r)},$p)}_patchConstructor(){return e=>{let t=this;return function(...n){if(!t._isEnabled)return e.apply(this,n);let r=this,i=If(n[0]instanceof Request?n[0].url:String(n[0])).href,a;a=n[0]instanceof Request?n[1]==null?n[0]:new Request(n[0],n[1]):n[1]||{};let o=t._createSpan(i,a);if(!o)return e.apply(this,n);let s=t._prepareSpanData(i);t.getConfig().measureRequestSize&&Ip(...n).then(e=>{e&&(t._semconvStability&Z.OLD&&o.setAttribute(Ap,e),t._semconvStability&Z.STABLE&&o.setAttribute(kp,e))}).catch(e=>{t._diag.warn(`getFetchBodyLength`,e)});function c(e,n){t._applyAttributesAfterFetch(e,a,n),t._endSpan(e,s,{status:n.status||0,statusText:n.message,url:i})}function l(e,n){t._applyAttributesAfterFetch(e,a,n),n.status>=200&&n.status<400?t._endSpan(e,s,n):t._endSpan(e,s,{status:n.status,statusText:n.statusText,url:i})}function u(e,n){try{let t=n.clone().body;if(t){let r=t.getReader(),i=()=>{r.read().then(({done:t})=>{t?l(e,n):i()},t=>{c(e,t)})};i()}else l(e,n)}catch(n){t._diag.error(`Failed to read fetch response body`,n),t._endSpan(e,s,{status:0,url:i})}return n}function d(e,n){try{c(e,n)}catch(r){t._diag.error(`Failed to end span on fetch error`,r),t._endSpan(e,s,{status:n.status||0,url:i})}throw n}return N.with(F.setSpan(N.active(),o),()=>(t._callRequestHook(o,a),t._addHeaders(a,i),t._tasksCount++,e.apply(r,a instanceof Request?[a]:[i,a]).then(u.bind(r,o),d.bind(r,o))))}}}_applyAttributesAfterFetch(e,t,n){let r=this.getConfig().applyCustomAttributesOnSpan;r&&Wu(()=>r(e,t,n),e=>{e&&this._diag.error(`applyCustomAttributesOnSpan`,e)},!0)}_callRequestHook(e,t){let n=this.getConfig().requestHook;n&&Wu(()=>n(e,t),e=>{e&&this._diag.error(`requestHook`,e)},!0)}_prepareSpanData(e){let t=ea(),n=[];if(typeof PerformanceObserver!=`function`)return{entries:n,startTime:t,spanUrl:e};let r=new PerformanceObserver(t=>{t.getEntries().forEach(t=>{t.initiatorType===`fetch`&&t.name===e&&n.push(t)})});return r.observe({entryTypes:[`resource`]}),{entries:n,observer:r,startTime:t,spanUrl:e}}enable(){if(!em){this._diag.warn(`this instrumentation is intended for web usage only, it does not instrument server-side fetch()`);return}if(!this._isEnabled){if(this._isFetchPatched){this._diag.debug(`fetch constructor already patched`),this._isEnabled=!0;return}try{this._wrap(globalThis,`fetch`,this._patchConstructor()),this._isFetchPatched=!0,this._isEnabled=!0}catch(e){this._diag.warn(`Failed to patch globalThis.fetch; instrumentation will not be enabled. Another script may have locked globalThis.fetch via Object.defineProperty.`,e)}}}disable(){em&&this._isEnabled&&(this._isEnabled=!1,this._usedResources=new WeakSet)}}})),rm=n({FetchInstrumentation:()=>tm}),im=t((()=>{nm()})),am,om,sm,cm,lm,um,dm,fm,pm=t((()=>{am=`http.host`,om=`http.method`,sm=`http.request.body.size`,cm=`http.request_content_length_uncompressed`,lm=`http.scheme`,um=`http.status_code`,dm=`http.url`,fm=`http.user_agent`})),mm,hm=t((()=>{(function(e){e.METHOD_OPEN=`open`,e.METHOD_SEND=`send`,e.EVENT_ABORT=`abort`,e.EVENT_ERROR=`error`,e.EVENT_LOAD=`loaded`,e.EVENT_TIMEOUT=`timeout`})(mm||(mm={}))}));function gm(e){return typeof Document<`u`&&e instanceof Document}function _m(e){if(gm(e))return new XMLSerializer().serializeToString(document).length;if(typeof e==`string`)return vm(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return ym(e);if(e instanceof URLSearchParams)return vm(e.toString());if(e.byteLength!==void 0)return e.byteLength;Cm.warn(`unknown body type`)}function vm(e){return wm.encode(e).byteLength}function ym(e){let t=0;for(let[n,r]of e.entries())t+=n.length,r instanceof Blob?t+=r.size:t+=r.length;return t}function bm(e){let t=xm(),n=e.toUpperCase();return n in t?n:`_OTHER`}function xm(){return Em===void 0&&(Em=Tm),Em}function Sm(e){let t=Number(e.port||Dm[e.protocol]);if(t&&!isNaN(t))return t}var Cm,wm,Tm,Em,Dm,Om=t((()=>{I(),W(),Cm=P.createComponentLogger({namespace:`@opentelemetry/opentelemetry-instrumentation-xml-http-request/utils`}),wm=new TextEncoder,Tm={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0},Dm={"https:":`443`,"http:":`80`}})),km,Am=t((()=>{km=`0.217.0`})),jm,Mm=t((()=>{(function(e){e.HTTP_STATUS_TEXT=`http.status_text`})(jm||(jm={}))})),Nm,Pm,Fm=t((()=>{I(),Ju(),W(),Uf(),qi(),pm(),hm(),Om(),Am(),Mm(),z(),Nm=300,Pm=class extends Vu{constructor(e={}){super(`@opentelemetry/instrumentation-xml-http-request`,km,e),R(this,`component`,`xml-http-request`),R(this,`version`,km),R(this,`moduleName`,this.component),R(this,`_tasksCount`,0),R(this,`_xhrMem`,new WeakMap),R(this,`_usedResources`,new WeakSet),R(this,`_semconvStability`,void 0),this._semconvStability=Ku(`http`,e==null?void 0:e.semconvStabilityOptIn)}init(){}_addHeaders(e,t){let n=If(t).href;if(!Bf(n,this.getConfig().propagateTraceHeaderCorsUrls)){let e={};Gt.inject(N.active(),e),Object.keys(e).length>0&&this._diag.debug(`headers inject skipped due to CORS policy`);return}let r={};Gt.inject(N.active(),r),Object.keys(r).forEach(t=>{e.setRequestHeader(t,String(r[t]))})}_addChildSpan(e,t){N.with(F.setSpan(N.active(),e),()=>{let e=this.tracer.startSpan(`CORS Preflight`,{startTime:t[Q.FETCH_START]}),n=!(this._semconvStability&Z.OLD);Af(e,t,this.getConfig().ignoreNetworkEvents,void 0,n),e.end(t[Q.RESPONSE_END])})}_addFinalSpanAttributes(e,t,n){if(this._semconvStability&Z.OLD){if(t.status!==void 0&&e.setAttribute(um,t.status),t.statusText!==void 0&&e.setAttribute(jm.HTTP_STATUS_TEXT,t.statusText),typeof n==`string`){let t=If(n);e.setAttribute(am,t.host),e.setAttribute(lm,t.protocol.replace(`:`,``))}e.setAttribute(fm,navigator.userAgent)}this._semconvStability&Z.STABLE&&t.status&&e.setAttribute(Pi,t.status)}_applyAttributesAfterXHR(e,t){let n=this.getConfig().applyCustomAttributesOnSpan;typeof n==`function`&&Wu(()=>n(e,t),e=>{e&&this._diag.error(`applyCustomAttributesOnSpan`,e)},!0)}_addResourceObserver(e,t){let n=this._xhrMem.get(e);!n||typeof PerformanceObserver!=`function`||typeof PerformanceResourceTiming!=`function`||(n.createdResources={observer:new PerformanceObserver(e=>{let r=e.getEntries(),i=If(t);r.forEach(e=>{e.initiatorType===`xmlhttprequest`&&e.name===i.href&&n.createdResources&&n.createdResources.entries.push(e)})}),entries:[]},n.createdResources.observer.observe({entryTypes:[`resource`]}))}_clearResources(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(U.clearResourceTimings(),this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}_findResourceAndAddNetworkEvents(e,t,n,r,i){if(!n||!r||!i||!e.createdResources)return;let a=e.createdResources.entries;(!a||!a.length)&&(a=U.getEntriesByType(`resource`));let o=Nf(If(n).href,r,i,a,this._usedResources);if(o.mainRequest){let e=o.mainRequest;this._markResourceAsUsed(e);let n=o.corsPreFlightRequest;n&&(this._addChildSpan(t,n),this._markResourceAsUsed(n));let r=!(this._semconvStability&Z.OLD);Af(t,e,this.getConfig().ignoreNetworkEvents,void 0,r)}}_cleanPreviousSpanInformation(e){let t=this._xhrMem.get(e);if(t){let n=t.callbackToRemoveEvents;n&&n(),this._xhrMem.delete(e)}}_createSpan(e,t,n){let r=If(t);if(go(r.href,this.getConfig().ignoreUrls)){this._diag.debug(`ignoring span as url matches ignored url`);return}let i=``,a={};if(this._semconvStability&Z.OLD&&(i=n.toUpperCase(),a[om]=n,a[dm]=r.toString()),this._semconvStability&Z.STABLE){let e=n,t=bm(n);i||(i=t),a[Mi]=t,t!==e&&(a[Ni]=e),a[Hi]=r.toString(),a[Fi]=r.hostname;let o=Sm(r);o&&(a[Ii]=o)}let o=this.tracer.startSpan(i,{kind:yt.CLIENT,attributes:a});return o.addEvent(mm.METHOD_OPEN),this._cleanPreviousSpanInformation(e),this._xhrMem.set(e,{span:o,spanUrl:t}),o}_markResourceAsUsed(e){this._usedResources.add(e)}_patchOpen(){return e=>{let t=this;return function(...n){if(!t._isEnabled)return e.apply(this,n);let r=n[0],i=n[1];return t._createSpan(this,i,r),e.apply(this,n)}}}_patchSend(){let e=this;function t(t,n,r,i){let a=n.callbackToRemoveEvents;typeof a==`function`&&a();let{span:o,spanUrl:s,sendStartTime:c}=n;o&&(e._findResourceAndAddNetworkEvents(n,o,s,c,r),o.addEvent(t,i),e._addFinalSpanAttributes(o,n,s),o.end(i),e._tasksCount--),e._clearResources()}function n(n,r,i,a){let o=e._xhrMem.get(r);if(!o)return;if(o.status=r.status,o.statusText=r.statusText,e._xhrMem.delete(r),o.span){let t=o.span;e._applyAttributesAfterXHR(t,r),e._semconvStability&Z.STABLE&&(i?a&&(t.setStatus({code:xt.ERROR,message:a}),t.setAttribute(Oi,a)):o.status&&o.status>=400&&(t.setStatus({code:xt.ERROR}),t.setAttribute(Oi,String(o.status))))}let s=ea(),c=Date.now();setTimeout(()=>{t(n,o,s,c)},Nm)}function r(){n(mm.EVENT_ERROR,this,!0,`error`)}function i(){n(mm.EVENT_ABORT,this,!1)}function a(){n(mm.EVENT_TIMEOUT,this,!0,`timeout`)}function o(){this.status<299?n(mm.EVENT_LOAD,this,!1):n(mm.EVENT_ERROR,this,!1)}function s(t){t.removeEventListener(`abort`,i),t.removeEventListener(`error`,r),t.removeEventListener(`load`,o),t.removeEventListener(`timeout`,a);let n=e._xhrMem.get(t);n&&(n.callbackToRemoveEvents=void 0)}return t=>function(...n){if(!e._isEnabled)return t.apply(this,n);let c=e._xhrMem.get(this);if(!c)return t.apply(this,n);let l=c.span,u=c.spanUrl;if(l&&u){if(e.getConfig().measureRequestSize&&n!=null&&n[0]){let t=n[0],r=_m(t);r!==void 0&&(e._semconvStability&Z.OLD&&l.setAttribute(cm,r),e._semconvStability&Z.STABLE&&l.setAttribute(sm,r))}N.with(F.setSpan(N.active(),l),()=>{e._tasksCount++,c.sendStartTime=ea(),l.addEvent(mm.METHOD_SEND),this.addEventListener(`abort`,i),this.addEventListener(`error`,r),this.addEventListener(`load`,o),this.addEventListener(`timeout`,a),c.callbackToRemoveEvents=()=>{s(this),c.createdResources&&c.createdResources.observer.disconnect()},e._addHeaders(this,u),e._addResourceObserver(this,u)})}return t.apply(this,n)}}enable(){if(!this._isEnabled){if(this._isXhrPatched){this._diag.debug(`reactivating existing patch on`,this.moduleName,this.version),this._isEnabled=!0;return}try{this._diag.debug(`applying patch to`,this.moduleName,this.version),this._wrap(XMLHttpRequest.prototype,`open`,this._patchOpen()),this._wrap(XMLHttpRequest.prototype,`send`,this._patchSend()),this._isXhrPatched=!0,this._isEnabled=!0}catch(e){this._unwrap(XMLHttpRequest.prototype,`open`),this._unwrap(XMLHttpRequest.prototype,`send`),this._diag.warn(`Failed to patch globalThis.XMLHttpRequest; instrumentation will not be enabled. Another script may have locked globalThis.XMLHttpRequest via Object.defineProperty.`,e)}}}disable(){this._isEnabled&&(this._isEnabled=!1,this._tasksCount=0,this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}}})),Im=n({XMLHttpRequestInstrumentation:()=>Pm}),Lm=t((()=>{Fm()})),Rm,zm=t((()=>{(function(e){e.EVENT_TYPE=`event_type`,e.TARGET_ELEMENT=`target_element`,e.TARGET_XPATH=`target_xpath`,e.HTTP_URL=`http.url`})(Rm||(Rm={}))})),Bm,Vm,Hm=t((()=>{Bm=`0.61.0`,Vm=`@opentelemetry/instrumentation-user-interaction`}));function Um(){return!1}var Wm,Gm,Km,qm,Jm=t((()=>{Ju(),I(),W(),Uf(),zm(),Hm(),z(),Wm=`OT_ZONE_CONTEXT`,Gm=`Navigation:`,Km=[`click`],qm=class extends Vu{constructor(e={}){var t;super(Vm,Bm,e),R(this,`version`,Bm),R(this,`moduleName`,`user-interaction`),R(this,`_spansData`,new WeakMap),R(this,`_wrappedListeners`,new WeakMap),R(this,`_eventsSpanMap`,new WeakMap),R(this,`_eventNames`,void 0),R(this,`_shouldPreventSpanCreation`,void 0),this._eventNames=new Set((t=e==null?void 0:e.eventNames)==null?Km:t),this._shouldPreventSpanCreation=typeof(e==null?void 0:e.shouldPreventSpanCreation)==`function`?e.shouldPreventSpanCreation:Um}init(){}_checkForTimeout(e,t){let n=this._spansData.get(t);n&&(e.source===`setTimeout`?n.hrTimeLastTimeout=ea():e.source!==`Promise.then`&&e.source!==`setTimeout`&&(n.hrTimeLastTimeout=void 0))}_allowEventName(e){return this._eventNames.has(e)}_createSpan(e,t,n){if(!this._isEnabled||!(e instanceof HTMLElement)||!e.getAttribute||e.hasAttribute(`disabled`)||!this._allowEventName(t))return;let r=Lf(e,!0);try{let i=this.tracer.startSpan(t,{attributes:{[Rm.EVENT_TYPE]:t,[Rm.TARGET_ELEMENT]:e.tagName,[Rm.TARGET_XPATH]:r,[Rm.HTTP_URL]:window.location.href}},n?F.setSpan(N.active(),n):void 0);return this._shouldPreventSpanCreation(t,e,i)===!0?void 0:(this._spansData.set(i,{taskCount:0}),i)}catch(e){this._diag.error(`failed to start create new user interaction span`,e)}}_decrementTask(e){let t=this._spansData.get(e);t&&(t.taskCount--,t.taskCount===0&&this._tryToEndSpan(e,t.hrTimeLastTimeout))}_getCurrentSpan(e){let t=e.get(Wm);return t&&F.getSpan(t)}_incrementTask(e){let t=this._spansData.get(e);t&&t.taskCount++}addPatchedListener(e,t,n,r){let i=this._wrappedListeners.get(n);i||(i=new Map,this._wrappedListeners.set(n,i));let a=i.get(t);return a||(a=new Map,i.set(t,a)),a.has(e)?!1:(a.set(e,r),!0)}removePatchedListener(e,t,n){let r=this._wrappedListeners.get(n);if(!r)return;let i=r.get(t);if(!i)return;let a=i.get(e);return a&&(i.delete(e),i.size===0&&(r.delete(t),r.size===0&&this._wrappedListeners.delete(n))),a}_invokeListener(e,t,n){return typeof e==`function`?e.apply(t,n):e.handleEvent(n[0])}_patchAddEventListener(){let e=this;return t=>function(n,r,i){if(!r)return t.call(this,n,r,i);let a=i&&typeof i==`object`&&i.once,o=function(...t){let i,o=t[0],s=o==null?void 0:o.target;o&&(i=e._eventsSpanMap.get(o)),a&&e.removePatchedListener(this,n,r);let c=e._createSpan(s,n,i);return c?(o&&e._eventsSpanMap.set(o,c),N.with(F.setSpan(N.active(),c),()=>{let n=e._invokeListener(r,this,t);return c.end(),n})):e._invokeListener(r,this,t)};if(e.addPatchedListener(this,n,r,o))return t.call(this,n,o,i)}}_patchRemoveEventListener(){let e=this;return t=>function(n,r,i){let a=e.removePatchedListener(this,n,r);return a?t.call(this,n,a,i):t.call(this,n,r,i)}}_getPatchableEventTargets(){return window.EventTarget?[EventTarget.prototype]:[Node.prototype,Window.prototype]}_patchHistoryApi(){this._isEnabled&&(this._wrap(history,`replaceState`,this._patchHistoryMethod()),this._wrap(history,`pushState`,this._patchHistoryMethod()),this._wrap(history,`back`,this._patchHistoryMethod()),this._wrap(history,`forward`,this._patchHistoryMethod()),this._wrap(history,`go`,this._patchHistoryMethod()))}_patchHistoryMethod(){let e=this;return t=>function(...n){if(!e._isEnabled)return t.apply(this,n);let r=`${location.pathname}${location.hash}${location.search}`,i=t.apply(this,n),a=`${location.pathname}${location.hash}${location.search}`;return r!==a&&e._updateInteractionName(a),i}}_updateInteractionName(e){let t=F.getSpan(N.active());t&&typeof t.updateName==`function`&&t.updateName(`${Gm} ${e}`)}_patchZoneCancelTask(){let e=this;return t=>function(n){let r=Zone.current,i=e._getCurrentSpan(r);return i&&e._shouldCountTask(n,r)&&e._decrementTask(i),t.call(this,n)}}_patchZoneScheduleTask(){let e=this;return t=>function(n){let r=Zone.current,i=e._getCurrentSpan(r);return i&&e._shouldCountTask(n,r)&&(e._incrementTask(i),e._checkForTimeout(n,i)),t.call(this,n)}}_patchZoneRunTask(){let e=this;return t=>function(n,r,i){let a=Array.isArray(i)&&i[0]instanceof Event?i[0]:void 0,o=a==null?void 0:a.target,s,c=this;if(o){if(s=e._createSpan(o,n.eventName),s)return e._incrementTask(s),c.run(()=>{try{return N.with(F.setSpan(N.active(),s),()=>{let e=Zone.current;return n._zone=e,t.call(e,n,r,i)})}finally{e._decrementTask(s)}})}else s=e._getCurrentSpan(c);try{return t.call(c,n,r,i)}finally{s&&e._shouldCountTask(n,c)&&e._decrementTask(s)}}}_shouldCountTask(e,t){if(e._zone&&(t=e._zone),!t||!e.data||e.data.isPeriodic)return!1;let n=this._getCurrentSpan(t);return!n||!this._spansData.get(n)?!1:e.type===`macroTask`||e.type===`microTask`}_tryToEndSpan(e,t){e&&this._spansData.get(e)&&(e.end(t),this._spansData.delete(e))}enable(){if(this._isEnabled||(this._isEnabled=!0,typeof this._zonePatched==`boolean`))return;let e=this._getZoneWithPrototype();this._diag.debug(`applying patch to`,this.moduleName,this.version,`zone:`,!!e),e?(this._zonePatched=!0,this._wrap(e.prototype,`runTask`,this._patchZoneRunTask()),this._wrap(e.prototype,`scheduleTask`,this._patchZoneScheduleTask()),this._wrap(e.prototype,`cancelTask`,this._patchZoneCancelTask())):(this._zonePatched=!1,this._getPatchableEventTargets().forEach(e=>{this._wrap(e,`addEventListener`,this._patchAddEventListener()),this._wrap(e,`removeEventListener`,this._patchRemoveEventListener())})),this._patchHistoryApi()}disable(){this._isEnabled&&(this._isEnabled=!1)}_getZoneWithPrototype(){return window.Zone}}})),Ym=n({AttributeNames:()=>Rm,UserInteractionInstrumentation:()=>qm}),Xm=t((()=>{Jm(),zm()}));Ju(),K();var Zm=[`http.url`,`url.full`],Qm=e=>({test:e}),$m=(e,t)=>{t.setAttributes(e.applyRedact(e.config.getPageAttributes()));for(let r of Zm){var n;let i=(n=t.attributes)==null?void 0:n[r];if(typeof i==`string`){let n=e.applyRedact({[r]:e.config.redactUrl(i)})[r];typeof n==`string`&&t.setAttribute(r,n)}}},eh=e=>{let t=[];return{name:`official-instrumentations`,enabled:!!(e.documentLoad||e.fetch||e.xhr||e.userInteraction),init(n){return G(function*(){let r=[],i=[Qm(e=>ap(n.config,e))],a=[Qm(e=>op(n.config,e))];if(e.documentLoad){let{DocumentLoadInstrumentation:e}=yield Promise.resolve().then(()=>(wp(),Cp));r.push(new e({semconvStabilityOptIn:`http`}))}if(e.fetch){let{FetchInstrumentation:e}=yield Promise.resolve().then(()=>(im(),rm));r.push(new e({applyCustomAttributesOnSpan:e=>$m(n,e),ignoreUrls:i,propagateTraceHeaderCorsUrls:a,semconvStabilityOptIn:`http`,ignoreNetworkEvents:!1}))}if(e.xhr){let{XMLHttpRequestInstrumentation:e}=yield Promise.resolve().then(()=>(Lm(),Im));r.push(new e({applyCustomAttributesOnSpan:e=>$m(n,e),ignoreUrls:i,propagateTraceHeaderCorsUrls:a,semconvStabilityOptIn:`http`,ignoreNetworkEvents:!1}))}if(e.userInteraction){let{UserInteractionInstrumentation:t}=yield Promise.resolve().then(()=>(Xm(),Ym)),n=typeof e.userInteraction==`object`?{eventNames:e.userInteraction.eventNames}:void 0;r.push(new t(n))}t.push(...r),Au({instrumentations:r})})()},shutdown(){for(;t.length;){var e,n;(e=t.pop())==null||(n=e.disable)==null||n.call(e)}}}};gn(),Y();var th=e=>{let t;return{name:`csp-violation`,enabled:!!e,init(e){if(typeof window>`u`||typeof document>`u`)return;let n=t=>{e.emitLog({severityNumber:L.WARN,severityText:`WARN`,body:`csp.violation`,attributes:J(J({},e.config.getPageAttributes()),{},{"csp.blocked_uri":e.config.redactUrl(t.blockedURI||``),"csp.violated_directive":t.violatedDirective,"csp.effective_directive":t.effectiveDirective,"csp.original_policy":t.originalPolicy,"csp.disposition":t.disposition,"csp.source_file":e.config.redactUrl(t.sourceFile||``),"csp.line_number":t.lineNumber,"csp.column_number":t.columnNumber,"csp.status_code":t.statusCode})})};document.addEventListener(`securitypolicyviolation`,n),t=()=>document.removeEventListener(`securitypolicyviolation`,n)},shutdown(){t==null||t(),t=void 0}}};Y();var nh=`bk_ot_session_id`,rh=()=>typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`device-${Date.now()}-${Math.random().toString(16).slice(2)}`,ih=e=>{try{let t=window.localStorage.getItem(e);if(t)return t;let n=rh();return window.localStorage.setItem(e,n),n}catch(e){return rh()}},ah=()=>{var e,t,n;if(typeof window>`u`)return{};let r=navigator.connection;return{"browser.viewport.width":window.innerWidth,"browser.viewport.height":window.innerHeight,"browser.screen.width":(e=window.screen)==null?void 0:e.width,"browser.screen.height":(t=window.screen)==null?void 0:t.height,"network.effective_type":(n=r==null?void 0:r.effectiveType)==null?r==null?void 0:r.type:n}},oh=e=>({name:`device`,enabled:!!e,init(t){var n;let r=typeof e==`object`?(n=e.storageKey)==null?nh:n:nh,i=typeof window>`u`?rh():ih(r);t.setRuntimeAttributes(J({"device.id":i},ah()))}});I(),gn(),Y();var sh=6e4,ch=5,lh=e=>{if(e instanceof Error)return e.message;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch(t){return String(e)}},uh=e=>{var t;return e instanceof Error?(t=e.stack)==null?``:t:``},dh=e=>{let t=5381;for(let n=0;n<e.length;n++)t=t*33^e.charCodeAt(n);return(t>>>0).toString(36)},fh=(e,t)=>{let n=new Map;return{allow(r){let i=Date.now(),a=n.get(r);return!a||i-a.windowStart>e?(n.set(r,{count:1,windowStart:i}),!0):a.count>=t?!1:(a.count+=1,!0)}}},ph=({context:e,error:t,exceptionType:n,extra:r={},source:i,spanName:a,throttle:o})=>{let s=lh(t),c=uh(t),l=dh(`${i}|${s}|${c.slice(0,256)}`);if(!o.allow(l))return;let u=F.getActiveSpan(),d=t instanceof Error?t:{message:s,name:n==null?i:n},f=J(J(J({},e.config.getPageAttributes()),e.config.getErrorAttributes()),{},{"exception.message":s,"exception.stacktrace":c,"exception.type":t instanceof Error?t.name:n==null?i:n,"bk.rum.error.source":i,"bk.rum.error.fingerprint":l},r),p=()=>e.emitLog({severityNumber:L.ERROR,severityText:`ERROR`,body:s,attributes:f});if(u){u.recordException(d),u.setStatus({code:xt.ERROR,message:s}),p();return}let m=e.startSpan(a,f);m.recordException(d),m.setStatus({code:xt.ERROR,message:s}),N.with(F.setSpan(N.active(),m),p),m.end()},mh=e=>{let t=[];return{name:`error`,enabled:!!e,init(n){var r,i;if(typeof window>`u`)return;let a=fh(typeof e==`object`?(r=e.windowMs)==null?sh:r:sh,typeof e==`object`?(i=e.maxPerWindow)==null?ch:i:ch),o=e=>{var t;ph({context:n,throttle:a,spanName:`browser.error`,source:`window.error`,error:(t=e.error)==null?e.message:t,extra:{"code.filepath":e.filename,"code.lineno":e.lineno,"code.column":e.colno}})},s=e=>{ph({context:n,throttle:a,spanName:`browser.unhandledrejection`,source:`unhandledrejection`,error:e.reason,exceptionType:e.reason instanceof Error?e.reason.name:`UnhandledRejection`})},c=e=>{var t;let r=e.target;if(r===window)return;let i=r.src||r.href||``;ph({context:n,throttle:a,spanName:`browser.resource_error`,source:`resource`,error:Error(`Resource load failed: ${((t=r.tagName)==null?void 0:t.toLowerCase())||`unknown`} ${i}`),exceptionType:`ResourceError`,extra:{"url.full":n.config.redactUrl(i),"html.tag":r.tagName||``}})};window.addEventListener(`error`,o),window.addEventListener(`unhandledrejection`,s),window.addEventListener(`error`,c,!0),t.push(()=>window.removeEventListener(`error`,o),()=>window.removeEventListener(`unhandledrejection`,s),()=>window.removeEventListener(`error`,c,!0))},shutdown(){for(;t.length;){var e;(e=t.pop())==null||e()}}}};gn(),K(),Y();var hh=10*1024,gh=(e,t)=>e.length<=t?{body:e,truncated:!1}:{body:e.slice(0,t),truncated:!0},_h=(e,t)=>{if(!e)return;if(e instanceof Headers)return e.get(t)||void 0;let n=t.toLowerCase();if(Array.isArray(e)){var r;return(r=e.find(([e])=>e.toLowerCase()===n))==null?void 0:r[1]}let i=Object.keys(e).find(e=>e.toLowerCase()===n);return i?e[i]:void 0},vh=e=>{let t={};return e.forEach((e,n)=>{t[n]=e instanceof File?`[File name=${e.name} type=${e.type||`unknown`} size=${e.size}]`:e}),JSON.stringify(t)},yh=function(){var e=G(function*(e){return e==null?``:typeof e==`string`?e:e instanceof URLSearchParams?e.toString():e instanceof FormData?vh(e):e instanceof Blob?e.text():e instanceof ArrayBuffer||ArrayBuffer.isView(e)?new TextDecoder().decode(e):e instanceof Document?new XMLSerializer().serializeToString(e):String(e)});return function(t){return e.apply(this,arguments)}}(),bh=function(){var e=G(function*(e,t,n){let r=yield yh(e);if(r)return J(J({},gh(r,t)),{},{contentType:n})});return function(t,n,r){return e.apply(this,arguments)}}(),xh=function(){var e=G(function*(e,t,n){try{return yield bh(e,t,n)}catch(e){return}});return function(t,n,r){return e.apply(this,arguments)}}(),Sh=e=>e instanceof Request?e.url:String(e),Ch=(e,t)=>t!=null&&t.method?t.method:e instanceof Request?e.method:`GET`,wh=function(){var e=G(function*(e,t,n){if(t!=null&&t.body)return xh(t.body,n,_h(t.headers,`content-type`));if(e instanceof Request)try{return xh(yield e.clone().text(),n,e.headers.get(`content-type`)||void 0)}catch(e){return}});return function(t,n,r){return e.apply(this,arguments)}}(),Th=function(){var e=G(function*(e,t){try{let n=e.clone();return xh(n.body?yield n.text():``,t,e.headers.get(`content-type`)||void 0)}catch(e){return}});return function(t,n){return e.apply(this,arguments)}}(),Eh=(e,t)=>{if(e.responseType===``||e.responseType===`text`)return J(J({},gh(e.responseText||``,t)),{},{contentType:e.getResponseHeader(`content-type`)||void 0});if(e.responseType===`json`)return J(J({},gh(JSON.stringify(e.response),t)),{},{contentType:e.getResponseHeader(`content-type`)||void 0})},Dh=(e,t,n)=>{if(n)return e.redact(J(J({},t),{},{body:n.body,truncated:n.truncated}))},Oh=({context:e,duration:t,error:n,method:r,request:i,response:a,status:o,url:s})=>{let c=e.config.rum.httpBody;if(!c)return;let l=!!n||typeof o==`number`&&o>=400,u=r.toUpperCase(),d=l?Dh(c,{contentType:i==null?void 0:i.contentType,method:u,status:o,type:`request`,url:s},i):void 0,f=l?Dh(c,{contentType:a==null?void 0:a.contentType,method:u,status:o,type:`response`,url:s},a):void 0,p=J(J({},e.config.getPageAttributes()),{},{"http.duration":t,"http.request.method":u,"url.full":e.config.redactUrl(s)});if(typeof o==`number`&&(p[`http.response.status_code`]=o),d!=null&&(p[`http.request.body`]=d),f!=null&&(p[`http.response.body`]=f),l){var m,h;p[`bk.rum.http_body.request.truncated`]=(m=i==null?void 0:i.truncated)==null?!1:m,p[`bk.rum.http_body.response.truncated`]=(h=a==null?void 0:a.truncated)==null?!1:h}if(n instanceof Error){var g;p[`exception.message`]=n.message,p[`exception.type`]=n.name,p[`exception.stacktrace`]=(g=n.stack)==null?``:g}e.emitLog({severityNumber:l?L.ERROR:L.INFO,severityText:l?`ERROR`:`INFO`,body:l?`HTTP request completed with error`:`HTTP request completed`,attributes:p})},kh=e=>{let t=[];return{name:`http-body`,enabled:!!e,init(n){if(!e||typeof window>`u`)return;let r=e.maxBodySize||hh,i=window.fetch;typeof i==`function`&&(window.fetch=function(){var e=G(function*(e,t){let a=Sh(e);if(ap(n.config,a))return i(e,t);let o=Ch(e,t),s=yield wh(e,t,r),c=performance.now();try{let l=yield i(e,t);return Oh({context:n,duration:performance.now()-c,method:o,request:s,response:l.status>=400?yield Th(l,r):void 0,status:l.status,url:a}),l}catch(e){throw Oh({context:n,duration:performance.now()-c,error:e,method:o,request:s,url:a}),e}});return function(t,n){return e.apply(this,arguments)}}(),t.push(()=>{window.fetch=i}));let a=XMLHttpRequest.prototype.open,o=XMLHttpRequest.prototype.send,s=XMLHttpRequest.prototype.setRequestHeader;XMLHttpRequest.prototype.open=function(e,t,...n){var r;return this.__bkOtHttpBodyMeta__={method:e,startTime:performance.now(),url:String(t)},a.call(this,e,t,(r=n[0])==null?!0:r,n[1],n[2])},XMLHttpRequest.prototype.setRequestHeader=function(e,t){var n;return this.__bkOtHttpBodyRequestHeaders__=J(J({},(n=this.__bkOtHttpBodyRequestHeaders__)==null?{}:n),{},{[e]:t}),s.call(this,e,t)},XMLHttpRequest.prototype.send=function(e){return xh(e,r,_h(this.__bkOtHttpBodyRequestHeaders__,`content-type`)).then(e=>{this.__bkOtHttpBodyRequest__=e}),this.addEventListener(`loadend`,()=>{let e=this.__bkOtHttpBodyMeta__;if(!e||ap(n.config,e.url))return;let t=this.status>=400?Eh(this,r):void 0;Oh({context:n,duration:performance.now()-e.startTime,method:e.method,request:this.__bkOtHttpBodyRequest__,response:t,status:this.status,url:e.url})}),o.call(this,e)},t.push(()=>{XMLHttpRequest.prototype.open=a,XMLHttpRequest.prototype.send=o,XMLHttpRequest.prototype.setRequestHeader=s})},shutdown(){for(;t.length;){var e;(e=t.pop())==null||e()}}}};Y();var Ah=50,jh=e=>{let t;return{name:`long-task`,enabled:!!e,init(n){var r;if(typeof PerformanceObserver>`u`)return;let i=PerformanceObserver.supportedEntryTypes;if(!(i!=null&&i.includes(`longtask`)))return;let a=typeof e==`object`?(r=e.threshold)==null?Ah:r:Ah,o=n.meter.createCounter(`browser.long_task.count`,{description:`Number of long tasks observed (duration >= threshold)`}),s=n.meter.createHistogram(`browser.long_task.duration`,{unit:`ms`,description:`Duration of long tasks`});try{t=new PerformanceObserver(e=>{for(let i of e.getEntries()){var t,r;if(i.duration<a)continue;let e=(t=i.attribution)==null?void 0:t[0],c=n.applyRedact(J(J(J({},n.config.getPageAttributes()),n.config.getMetricAttributes()),{},{"long_task.name":i.name,"long_task.attribution":(r=e==null?void 0:e.name)==null?`unknown`:r}));o.add(1,c),s.record(i.duration,c)}}),t.observe({type:`longtask`,buffered:!0})}catch(e){t=void 0}},shutdown(){t==null||t.disconnect(),t=void 0}}},Mh=new Set,Nh=``,Ph,Fh,Ih=!1,Lh=()=>typeof location>`u`?``:location.href,Rh=(e,t)=>{let n=Lh();Nh=n;let r={fromUrl:t,source:e,toUrl:n};for(let e of Array.from(Mh))e(r)},zh=()=>{Rh(`popstate`,Nh||Lh())},Bh=()=>{Rh(`hashchange`,Nh||Lh())},Vh=()=>{Ih||typeof window>`u`||typeof history>`u`||(Ih=!0,Nh=Lh(),Ph=history.pushState,Fh=history.replaceState,history.pushState=function(e,t,n){let r=Nh||Lh(),i=Ph==null?void 0:Ph.apply(this,[e,t,n]);return Rh(`pushState`,r),i},history.replaceState=function(e,t,n){let r=Nh||Lh(),i=Fh==null?void 0:Fh.apply(this,[e,t,n]);return Rh(`replaceState`,r),i},window.addEventListener(`popstate`,zh),window.addEventListener(`hashchange`,Bh))},Hh=()=>{!Ih||typeof window>`u`||typeof history>`u`||(Ph&&(history.pushState=Ph),Fh&&(history.replaceState=Fh),window.removeEventListener(`popstate`,zh),window.removeEventListener(`hashchange`,Bh),Ph=void 0,Fh=void 0,Ih=!1,Nh=``)},Uh=e=>typeof window>`u`||typeof history>`u`?()=>{}:(Vh(),Mh.add(e),()=>{Mh.delete(e),Mh.size===0&&Hh()});Y();var Wh=()=>typeof location>`u`?``:location.href,Gh=e=>{let t=[];return{name:`page-view`,enabled:!!e,init(e){if(typeof window>`u`)return;let n=``,r=(t,r=n)=>{let i=Wh();i!==n&&(n=i,e.startSpan(`browser.page_view`,J(J({},e.config.getPageAttributes()),{},{"url.full":e.config.redactUrl(i),"url.previous":e.config.redactUrl(r),"document.referrer":e.config.redactUrl(document.referrer||``),"bk.rum.event.source":t})).end())},i=Uh(e=>{r(e.source,e.fromUrl)});r(`load`),t.push(i)},shutdown(){for(;t.length;){var e;(e=t.pop())==null||e()}}}};Y();var Kh=e=>{let t=[];return{name:`route-timing`,enabled:!!e,init(e){if(typeof window>`u`||typeof history>`u`)return;let n=e.meter.createHistogram(`browser.route_change.duration`,{unit:`ms`,description:`Estimated SPA route change duration (route start to next idle)`}),r=(t,r,i)=>{let a=performance.now(),o=()=>{let o=performance.now()-a,s=e.applyRedact(J(J(J({},e.config.getPageAttributes()),e.config.getMetricAttributes()),{},{"route.change.source":t}));n.record(o,s),e.startSpan(`browser.route_change`,J(J({},s),{},{"url.full":e.config.redactUrl(i),"url.previous":e.config.redactUrl(r),"route.change.duration_ms":o})).end()};requestAnimationFrame(()=>requestAnimationFrame(()=>setTimeout(o,0)))},i=Uh(e=>{e.fromUrl!==e.toUrl&&r(e.source,e.fromUrl,e.toUrl)});t.push(i)},shutdown(){for(;t.length;){var e;(e=t.pop())==null||e()}}}},qh=`bk_ot_session`,Jh=1800*1e3,Yh=()=>typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`session-${Date.now()}-${Math.random().toString(16).slice(2)}`,Xh=e=>{try{var t;let n=(t=window.sessionStorage.getItem(e))==null?window.localStorage.getItem(e):t;if(!n)return null;let r=JSON.parse(n);return typeof(r==null?void 0:r.id)==`string`&&typeof(r==null?void 0:r.ts)==`number`?r:null}catch(e){return null}},Zh=(e,t)=>{try{let n=JSON.stringify(t);window.sessionStorage.setItem(e,n),window.localStorage.setItem(e,n)}catch(e){}},Qh=(e,t)=>{let n=Date.now(),r=Xh(e);if(r&&n-r.ts<t){let t={id:r.id,ts:n};return Zh(e,t),t.id}let i={id:Yh(),ts:n};return Zh(e,i),i.id},$h=e=>{let t;return{name:`session`,enabled:!!e,init(n){var r,i;let a=typeof e==`object`?(r=e.storageKey)==null?qh:r:qh,o=typeof e==`object`?(i=e.inactivityMs)==null?Jh:i:Jh,s=()=>{let e=typeof window>`u`?Yh():Qh(a,o);n.setRuntimeAttributes({"session.id":e})};if(s(),typeof window>`u`||typeof document>`u`)return;let c=()=>{document.visibilityState===`visible`&&s()};document.addEventListener(`visibilitychange`,c),t=()=>document.removeEventListener(`visibilitychange`,c)},shutdown(){t==null||t(),t=void 0}}},eg=n({CLSThresholds:()=>Tg,FCPThresholds:()=>Cg,INPThresholds:()=>zg,LCPThresholds:()=>Hg,TTFBThresholds:()=>Wg,onCLS:()=>Dg,onFCP:()=>Og,onINP:()=>Bg,onLCP:()=>Ug,onTTFB:()=>Kg});function tg(e,t){return sg.get(e)||sg.set(e,new t),sg.get(e)}var ng,rg,ig,ag,og,sg,cg,lg,ug,dg,fg,pg,mg,hg,gg,_g,vg,yg,bg,xg,Sg,Cg,wg,Tg,Eg,Dg,Og,kg,Ag,jg,Mg,Ng,Pg,Fg,Ig,Lg,Rg,zg,Bg,Vg,Hg,Ug,Wg,Gg,Kg,qg=t((()=>{z(),Y(),ng=class{constructor(){R(this,`t`,void 0),R(this,`o`,0),R(this,`i`,[])}u(e){var t;if(e.hadRecentInput)return;let n=this.i[0],r=this.i.at(-1);this.o&&n&&r&&e.startTime-r.startTime<1e3&&e.startTime-n.startTime<5e3?(this.o+=e.value,this.i.push(e)):(this.o=e.value,this.i=[e]),(t=this.t)==null||t.call(this,e)}},rg=()=>{let e=performance.getEntriesByType(`navigation`)[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},ig=e=>{if(document.readyState===`loading`)return`loading`;let t=rg();if(t){if(e<t.domInteractive)return`loading`;if(t.domContentLoadedEventStart===0||e<t.domContentLoadedEventStart)return`dom-interactive`;if(t.domComplete===0||e<t.domComplete)return`dom-content-loaded`}return`complete`},ag=e=>{let t=e.nodeName;return e.nodeType===1?t.toLowerCase():t.toUpperCase().replace(/^#/,``)},og=e=>{let t=``;try{for(;(e==null?void 0:e.nodeType)!==9;){let n=e,r=n.id?`#`+n.id:[ag(n),...Array.from(n.classList).sort()].join(`.`);if(t.length+r.length>99)return t||r;if(t=t?r+`>`+t:r,n.id)break;e=n.parentNode}}catch(e){}return t},sg=new WeakMap,cg=-1,lg=()=>cg,ug=e=>{addEventListener(`pageshow`,t=>{t.persisted&&(cg=t.timeStamp,e(t))},!0)},dg=(e,t,n,r)=>{let i,a;return o=>{var s;t.value>=0&&(o||r)&&(a=t.value-((s=i)==null?0:s),(a||i===void 0)&&(i=t.value,t.delta=a,t.rating=((e,t)=>e>t[1]?`poor`:e>t[0]?`needs-improvement`:`good`)(t.value,n),e(t)))}},fg=e=>{requestAnimationFrame(()=>requestAnimationFrame(e))},pg=()=>{var e,t;return(e=(t=rg())==null?void 0:t.activationStart)==null?0:e},mg=(e,t=-1)=>{let n=rg(),r=`navigate`;return lg()>=0?r=`back-forward-cache`:n&&(document.prerendering||pg()>0?r=`prerender`:document.wasDiscarded?r=`restore`:n.type&&(r=n.type.replace(/_/g,`-`))),{name:e,value:t,rating:`good`,delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+0xe8d4a51000}`,navigationType:r}},hg=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(e=>{queueMicrotask(()=>{t(e.getEntries())})});return r.observe(J({type:e,buffered:!0},n)),r}}catch(e){}},gg=e=>{let t=!1;return()=>{t||(e(),t=!0)}},_g=-1,vg=new Set,yg=()=>document.visibilityState!==`hidden`||document.prerendering?1/0:0,bg=e=>{if(document.visibilityState===`hidden`){if(e.type===`visibilitychange`)for(let e of vg)e();isFinite(_g)||(_g=e.type===`visibilitychange`?e.timeStamp:0,removeEventListener(`prerenderingchange`,bg,!0))}},xg=()=>{if(_g<0){var e;let t=pg(),n=document.prerendering||(e=globalThis.performance.getEntriesByType(`visibility-state`).find(e=>e.name===`hidden`&&e.startTime>=t))==null?void 0:e.startTime;_g=n==null?yg():n,addEventListener(`visibilitychange`,bg,!0),addEventListener(`prerenderingchange`,bg,!0),ug(()=>{setTimeout(()=>{_g=yg()})})}return{get firstHiddenTime(){return _g},onHidden(e){vg.add(e)}}},Sg=e=>{document.prerendering?addEventListener(`prerenderingchange`,e,!0):e()},Cg=[1800,3e3],wg=(e,t={})=>{Sg(()=>{let n=xg(),r,i=mg(`FCP`),a=hg(`paint`,e=>{for(let t of e)t.name===`first-contentful-paint`&&(a.disconnect(),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-pg(),0),i.entries.push(t),r(!0)))});a&&(r=dg(e,i,Cg,t.reportAllChanges),ug(n=>{i=mg(`FCP`),r=dg(e,i,Cg,t.reportAllChanges),fg(()=>{i.value=performance.now()-n.timeStamp,r(!0)})}))})},Tg=[.1,.25],Eg=e=>e.find(e=>{var t;return((t=e.node)==null?void 0:t.nodeType)===1})||e[0],Dg=(e,t={})=>{let n=tg(t=Object.assign({},t),ng),r=new WeakMap;n.t=e=>{var n;if(!(e==null||(n=e.sources)==null)&&n.length){let n=Eg(e.sources),o=n==null?void 0:n.node;if(o){var i,a;let e=(i=(a=t.generateTarget)==null?void 0:a.call(t,o))==null?og(o):i;r.set(n,e)}}},((e,t={})=>{let n=xg();wg(gg(()=>{let r,i=mg(`CLS`,0),a=tg(t,ng),o=e=>{for(let t of e)a.u(t);a.o>i.value&&(i.value=a.o,i.entries=a.i,r())},s=hg(`layout-shift`,o);s&&(r=dg(e,i,Tg,t.reportAllChanges),n.onHidden(()=>{o(s.takeRecords()),r(!0)}),ug(()=>{a.o=0,i=mg(`CLS`,0),r=dg(e,i,Tg,t.reportAllChanges),fg(r)}),setTimeout(r))}))})(t=>{e((e=>{let t={};if(e.entries.length){var n;let i=e.entries.reduce((e,t)=>e.value>t.value?e:t);if(!(i==null||(n=i.sources)==null)&&n.length){let e=Eg(i.sources);e&&(t={largestShiftTarget:r.get(e),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:e,largestShiftEntry:i,loadState:ig(i.startTime)})}}return Object.assign(e,{attribution:t})})(t))},t)},Og=(e,t={})=>{wg(t=>{e((e=>{let t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:ig(lg())};if(e.entries.length){let n=rg(),r=e.entries.at(-1);if(n){let i=n.activationStart||0,a=Math.max(0,n.responseStart-i);t={timeToFirstByte:a,firstByteToFCP:e.value-a,loadState:ig(e.entries[0].startTime),navigationEntry:n,fcpEntry:r}}}return Object.assign(e,{attribution:t})})(t))},t)},kg=0,Ag=1/0,jg=0,Mg=e=>{for(let t of e)t.interactionId&&(Ag=Math.min(Ag,t.interactionId),jg=Math.max(jg,t.interactionId),kg=jg?(jg-Ag)/7+1:0)},Pg=()=>{var e;return Ng?kg:(e=performance.interactionCount)==null?0:e},Fg=()=>{`interactionCount`in performance||Ng||(Ng=hg(`event`,Mg,{durationThreshold:0}))},Ig=0,Lg=class{constructor(){R(this,`l`,[]),R(this,`h`,new Map),R(this,`m`,void 0),R(this,`p`,void 0)}v(){Ig=Pg(),this.l.length=0,this.h.clear()}M(){let e=Math.min(this.l.length-1,Math.floor((Pg()-Ig)/50));return this.l[e]}u(e){var t;if((t=this.m)==null||t.call(this,e),!e.interactionId&&e.entryType!==`first-input`)return;let n=this.l.at(-1),r=this.h.get(e.interactionId);if(r||this.l.length<10||e.duration>n.T){var i;if(r?e.duration>r.T?(r.entries=[e],r.T=e.duration):e.duration===r.T&&e.startTime===r.entries[0].startTime&&r.entries.push(e):(r={id:e.interactionId,entries:[e],T:e.duration},this.h.set(r.id,r),this.l.push(r)),this.l.sort((e,t)=>t.T-e.T),this.l.length>10){let e=this.l.splice(10);for(let t of e)this.h.delete(t.id)}(i=this.p)==null||i.call(this,r)}}},Rg=e=>{let t=globalThis.requestIdleCallback||setTimeout,n=globalThis.cancelIdleCallback||clearTimeout;if(document.visibilityState===`hidden`)e();else{let r=gg(e),i=-1,a=()=>{n(i),r()};addEventListener(`visibilitychange`,a,{once:!0,capture:!0}),i=t(()=>{removeEventListener(`visibilitychange`,a,{capture:!0}),r()})}},zg=[200,500],Bg=(e,t={})=>{let n=tg(t=Object.assign({},t),Lg),r=[],i=[],a=0,o=new WeakMap,s=new WeakMap,c=!1,l=()=>{c||(Rg(u),c=!0)},u=()=>{let e=new Set(n.l.map(e=>o.get(e.entries[0]))),t=i.length-10;i=i.filter((n,r)=>r>=t||e.has(n));let s=new Set;for(let e of i){let t=d(e.startTime,e.processingEnd);for(let e of t)s.add(e)}r=r.filter(e=>e.startTime>a||s.has(e)),c=!1};n.m=e=>{let n=e.startTime+e.duration,r;a=Math.max(a,e.processingEnd);for(let a=i.length-1;a>=0;a--){let o=i[a];if(Math.abs(n-o.renderTime)<=8){r=o,r.startTime=Math.min(e.startTime,r.startTime),r.processingStart=Math.min(e.processingStart,r.processingStart),r.processingEnd=Math.max(e.processingEnd,r.processingEnd),!1!==t.includeProcessedEventEntries&&r.entries.push(e);break}}r||(r={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:n,entries:!1===t.includeProcessedEventEntries?[]:[e]},i.push(r)),(e.interactionId||e.entryType===`first-input`)&&o.set(e,r),l()},n.p=e=>{if(!s.get(e)){let i=e.entries[0].target;if(i){var n,r;let a=(n=(r=t.generateTarget)==null?void 0:r.call(t,i))==null?og(i):n;s.set(e,a)}}};let d=(e,t)=>{let n=[];for(let i of r)if(!(i.startTime+i.duration<e)){if(i.startTime>t)break;n.push(i)}return n},f=e=>{let t=e.entries[0],r=o.get(t),i=t.processingStart,a=Math.max(t.startTime+t.duration,i),c=Math.min(r.processingEnd,a),l=r.entries.sort((e,t)=>e.processingStart-t.processingStart),u=d(t.startTime,c),f=n.h.get(t.interactionId),p={interactionTarget:s.get(f),interactionType:t.name.startsWith(`key`)?`keyboard`:`pointer`,interactionTime:t.startTime,nextPaintTime:a,processedEventEntries:l,longAnimationFrameEntries:u,inputDelay:i-t.startTime,processingDuration:c-i,presentationDelay:a-c,loadState:ig(t.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return(e=>{var t;if(!((t=e.longAnimationFrameEntries)!=null&&t.length))return;let n=e.interactionTime,r=e.inputDelay,i=e.processingDuration,a,o,s=0,c=0,l=0,u=0;for(let t of e.longAnimationFrameEntries){c=c+t.startTime+t.duration-t.styleAndLayoutStart;for(let e of t.scripts){let t=e.startTime+e.duration;if(t<n)continue;let l=t-Math.max(n,e.startTime),d=e.duration?l/e.duration*e.forcedStyleAndLayoutDuration:0;s+=l-d,c+=d,l>u&&(o=e.startTime<n+r?`input-delay`:e.startTime>=n+r+i?`presentation-delay`:`processing-duration`,a=e,u=l)}}let d=e.longAnimationFrameEntries.at(-1),f=d?d.startTime+d.duration:0;f>=n+r+i&&(l=e.nextPaintTime-f),a&&o&&(e.longestScript={entry:a,subpart:o,intersectingDuration:u}),e.totalScriptDuration=s,e.totalStyleAndLayoutDuration=c,e.totalPaintDuration=l,e.totalUnattributedDuration=e.nextPaintTime-n-s-c-l})(p),Object.assign(e,{attribution:p})};hg(`long-animation-frame`,e=>{r=r.concat(e),l()}),((e,t={})=>{if(!globalThis.PerformanceEventTiming||!(`interactionId`in PerformanceEventTiming.prototype))return;let n=xg();Sg(()=>{var r;Fg();let i,a=mg(`INP`),o=tg(t,Lg),s=e=>{Rg(()=>{for(let t of e)o.u(t);let t=o.M();t&&t.T!==a.value&&(a.value=t.T,a.entries=t.entries,i())})},c=hg(`event`,s,{durationThreshold:(r=t.durationThreshold)==null?40:r});i=dg(e,a,zg,t.reportAllChanges),c&&(c.observe({type:`first-input`,buffered:!0}),n.onHidden(()=>{s(c.takeRecords()),i(!0)}),ug(()=>{o.v(),a=mg(`INP`),i=dg(e,a,zg,t.reportAllChanges)}))})})(t=>{e(f(t))},t)},Vg=class{constructor(){R(this,`m`,void 0)}u(e){var t;(t=this.m)==null||t.call(this,e)}},Hg=[2500,4e3],Ug=(e,t={})=>{let n=tg(t=Object.assign({},t),Vg),r=new WeakMap;n.m=e=>{let n=e.element;if(n){var i,a;let o=(i=(a=t.generateTarget)==null?void 0:a.call(t,n))==null?og(n):i;r.set(e,o)}else e.id&&r.set(e,`#${e.id}`)},((e,t={})=>{Sg(()=>{let n=xg(),r,i=mg(`LCP`),a=tg(t,Vg),o=e=>{t.reportAllChanges||(e=e.slice(-1));for(let t of e)a.u(t),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-pg(),0),i.entries=[t],r())},s=hg(`largest-contentful-paint`,o);if(s){r=dg(e,i,Hg,t.reportAllChanges);let n=gg(()=>{o(s.takeRecords()),s.disconnect(),r(!0)}),a=e=>{e.isTrusted&&(Rg(n),removeEventListener(e.type,a,{capture:!0}))};for(let e of[`keydown`,`click`,`visibilitychange`])addEventListener(e,a,{capture:!0});ug(n=>{i=mg(`LCP`),r=dg(e,i,Hg,t.reportAllChanges),fg(()=>{i.value=performance.now()-n.timeStamp,r(!0)})})}})})(t=>{e((e=>{let t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){let n=e.entries.at(-1),i=n.url&&performance.getEntriesByType(`resource`).find(e=>e.name===n.url);t.target=r.get(n),t.lcpEntry=n,n.url&&(t.url=n.url),i&&(t.lcpResourceEntry=i);let a=rg();if(a){let n=a.activationStart||0,r=Math.max(0,a.responseStart-n),o=Math.max(r,i?(i.requestStart||i.startTime)-n:0),s=Math.min(e.value,Math.max(o,i?i.responseEnd-n:0));t=J(J({},t),{},{timeToFirstByte:r,resourceLoadDelay:o-r,resourceLoadDuration:s-o,elementRenderDelay:e.value-s,navigationEntry:a})}}return Object.assign(e,{attribution:t})})(t))},t)},Wg=[800,1800],Gg=e=>{document.prerendering?Sg(()=>Gg(e)):document.readyState===`complete`?setTimeout(e):addEventListener(`load`,()=>Gg(e),!0)},Kg=(e,t={})=>{((e,t={})=>{let n=mg(`TTFB`),r=dg(e,n,Wg,t.reportAllChanges);Gg(()=>{let i=rg();i&&(n.value=Math.max(i.responseStart-pg(),0),n.entries=[i],r(!0),ug(()=>{n=mg(`TTFB`,0),r=dg(e,n,Wg,t.reportAllChanges),r(!0)}))})})(t=>{e((e=>{let t={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(e.entries.length){let n=e.entries[0],r=n.activationStart||0,i=Math.max((n.workerStart||n.fetchStart)-r,0),a=Math.max(n.domainLookupStart-r,0),o=Math.max(n.connectStart-r,0),s=Math.max(n.connectEnd-r,0);t={waitingDuration:i,cacheDuration:a-i,dnsDuration:o-a,connectionDuration:s-o,requestDuration:e.value-s,navigationEntry:n}}return Object.assign(e,{attribution:t})})(t))},t)}}));Y(),K();var Jg=()=>{let e=performance.getEntriesByType(`navigation`)[0];return(e==null?void 0:e.type)||`unknown`},Yg=e=>({"rum.navigation.type":Jg(),"web_vital.name":e.name,"web_vital.rating":e.rating}),Xg=(e,t)=>{var n;let r=(n=e.attribution)==null?{}:n,i={},a=e=>r[e],o=(e,t,n)=>{t!=null&&(typeof t==`string`||typeof t==`number`||typeof t==`boolean`)&&(i[e]=typeof t==`string`&&n?n(t):t)};switch(e.name){case`LCP`:o(`web_vital.lcp.url`,a(`url`),t),o(`web_vital.lcp.target`,a(`target`)),o(`web_vital.lcp.element_render_delay`,a(`elementRenderDelay`)),o(`web_vital.lcp.resource_load_duration`,a(`resourceLoadDuration`)),o(`web_vital.lcp.time_to_first_byte`,a(`timeToFirstByte`));break;case`CLS`:o(`web_vital.cls.largest_shift_target`,a(`largestShiftTarget`)),o(`web_vital.cls.largest_shift_value`,a(`largestShiftValue`)),o(`web_vital.cls.load_state`,a(`loadState`));break;case`INP`:o(`web_vital.inp.interaction_target`,a(`interactionTarget`)),o(`web_vital.inp.interaction_type`,a(`interactionType`)),o(`web_vital.inp.input_delay`,a(`inputDelay`)),o(`web_vital.inp.processing_duration`,a(`processingDuration`)),o(`web_vital.inp.presentation_delay`,a(`presentationDelay`));break;case`FCP`:o(`web_vital.fcp.time_to_first_byte`,a(`timeToFirstByte`)),o(`web_vital.fcp.load_state`,a(`loadState`));break;case`TTFB`:o(`web_vital.ttfb.waiting_duration`,a(`waitingDuration`)),o(`web_vital.ttfb.dns_duration`,a(`dnsDuration`)),o(`web_vital.ttfb.connection_duration`,a(`connectionDuration`)),o(`web_vital.ttfb.request_duration`,a(`requestDuration`));break;default:break}return i},Zg=e=>({name:`web-vitals`,enabled:!!e,init(e){return G(function*(){if(typeof window>`u`)return;let{onCLS:t,onFCP:n,onINP:r,onLCP:i,onTTFB:a}=yield Promise.resolve().then(()=>(qg(),eg)),o=e.meter.createHistogram(`browser.web_vital.cls`,{unit:`1`,description:`Cumulative Layout Shift`}),s=e.meter.createHistogram(`browser.web_vital.duration`,{unit:`ms`,description:`Web Vitals duration metrics, including FCP, INP, LCP and TTFB`}),c=t=>{e.startSpan(`browser.web_vital`,J(J(J(J({},e.config.getPageAttributes()),e.config.getMetricAttributes()),Yg(t)),{},{"web_vital.id":t.id,"web_vital.value":t.value},Xg(t,e.config.redactUrl))).end()},l=t=>{s.record(t.value,e.applyRedact(J(J(J({},e.config.getPageAttributes()),e.config.getMetricAttributes()),Yg(t)))),c(t)};t(t=>{o.record(t.value,e.applyRedact(J(J(J({},e.config.getPageAttributes()),e.config.getMetricAttributes()),Yg(t)))),c(t)}),n(l),r(l),i(l),a(l)})()}});I(),gn(),Y();var Qg=e=>e==null?0:typeof e==`string`?typeof TextEncoder>`u`?e.length:new TextEncoder().encode(e).byteLength:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:typeof Blob<`u`&&e instanceof Blob?e.size:0,$g=(e,t)=>{let n={"url.full":t(e),"network.protocol.name":`websocket`};try{n[`server.address`]=new URL(e,typeof location>`u`?`http://localhost`:location.href).host}catch(e){}return{spanAttributes:n,metricAttributes:{"network.protocol.name":`websocket`}}},e_=e=>{let t;return{name:`websocket`,enabled:!!e,init(e){if(typeof window>`u`||window.WebSocket===void 0)return;let n=window.WebSocket;t=n;let r=e.meter.createCounter(`browser.websocket.message.count`,{description:`Total number of WebSocket messages observed`}),i=e.meter.createCounter(`browser.websocket.message.bytes`,{unit:`By`,description:`Total bytes transferred over WebSocket (best-effort)`}),a=e.meter.createCounter(`browser.websocket.error.count`,{description:`Total number of WebSocket error events`}),o=function(t,o){let s=t.toString();if(ap(e.config,s))return o===void 0?new n(t):new n(t,o);let{metricAttributes:c,spanAttributes:l}=$g(s,e.config.redactUrl),u=e.startSpan(`websocket.connect`,l),d=performance.now(),f=o===void 0?new n(t):new n(t,o),p=!1,m=e=>{p||(p=!0,e===`error`&&u.setStatus({code:xt.ERROR,message:`websocket connect failed`}),u.setAttribute(`websocket.connect.duration_ms`,performance.now()-d),u.end())};f.addEventListener(`open`,()=>m(`opened`)),f.addEventListener(`message`,e=>{r.add(1,J(J({},c),{},{"websocket.direction":`in`})),i.add(Qg(e.data),J(J({},c),{},{"websocket.direction":`in`}))}),f.addEventListener(`error`,()=>{a.add(1,c),m(`error`),e.emitLog({severityNumber:L.ERROR,severityText:`ERROR`,body:`websocket.error`,attributes:l})}),f.addEventListener(`close`,t=>{m(`opened`),e.emitLog({severityNumber:L.INFO,severityText:`INFO`,body:`websocket.close`,attributes:J(J({},l),{},{"websocket.close.code":t.code,"websocket.close.reason":t.reason,"websocket.close.was_clean":t.wasClean})})});let h=f.send.bind(f);return f.send=e=>(r.add(1,J(J({},c),{},{"websocket.direction":`out`})),i.add(Qg(e),J(J({},c),{},{"websocket.direction":`out`})),h(e)),f};o.prototype=n.prototype,Object.assign(o,n),window.WebSocket=o},shutdown(){t&&typeof window<`u`&&(window.WebSocket=t)}}};Y();var t_=`http://localhost:4318`,n_=60*1e3,r_=e=>e.replace(/\/+$/,``),i_=(e,t)=>{let n=r_(e||t_);return n.endsWith(`/v1/${t}`)?n:n.endsWith(`/v1`)?`${n}/${t}`:`${n}/v1/${t}`},a_=(e,t)=>{var n,r,i,a;let o=e[t],s=(n=e.signalEndpoints)==null?void 0:n[t],c=e.token||e.headers||o!=null&&o.headers?J(J(J({},e.token?{Authorization:`Bearer ${e.token}`}:{}),(r=e.headers)==null?{}:r),(i=o==null?void 0:o.headers)==null?{}:i):void 0;return{concurrencyLimit:o==null?void 0:o.concurrencyLimit,endpoint:s?r_(s):i_((a=o==null?void 0:o.endpoint)==null?e.endpoint:a,t),headers:c,timeoutMillis:o==null?void 0:o.timeoutMillis}},o_=e=>typeof e!=`number`||!Number.isFinite(e)?1:Math.max(0,Math.min(1,e)),s_=(e,t)=>typeof e==`number`&&Number.isFinite(e)&&e>0?e:t,c_=(e,t)=>typeof e==`number`&&Number.isFinite(e)&&e>=0?e:t,l_=(e,t)=>typeof e!=`number`||!Number.isFinite(e)?t:Math.max(0,Math.min(1,e)),u_=e=>e.body,d_=e=>{var t;return e?typeof e==`boolean`?{maxBodySize:10*1024,redact:u_}:{maxBodySize:s_(e.maxBodySize,10*1024),redact:(t=e.redact)==null?u_:t}:!1},f_=e=>{var t,n,r,i,a,o,s,c,l,u;return{device:(t=e==null?void 0:e.device)==null?!0:t,httpBody:d_(e==null?void 0:e.httpBody),session:typeof(e==null?void 0:e.session)==`object`?J(J({},e.session),{},{inactivityMs:s_(e.session.inactivityMs,1800*1e3)}):(n=e==null?void 0:e.session)==null?!0:n,pageView:(r=e==null?void 0:e.pageView)==null?!0:r,error:typeof(e==null?void 0:e.error)==`object`?J(J({},e.error),{},{maxPerWindow:s_(e.error.maxPerWindow,5),windowMs:s_(e.error.windowMs,6e4)}):(i=e==null?void 0:e.error)==null?!0:i,webVitals:(a=e==null?void 0:e.webVitals)==null?!0:a,blankScreen:typeof(e==null?void 0:e.blankScreen)==`object`?J(J({},e.blankScreen),{},{checkDelay:c_(e.blankScreen.checkDelay,3e3),threshold:l_(e.blankScreen.threshold,.8)}):(o=e==null?void 0:e.blankScreen)==null?!0:o,websocket:(s=e==null?void 0:e.websocket)==null?!0:s,longTask:typeof(e==null?void 0:e.longTask)==`object`?J(J({},e.longTask),{},{threshold:c_(e.longTask.threshold,50)}):(c=e==null?void 0:e.longTask)==null?!1:c,cspViolation:(l=e==null?void 0:e.cspViolation)==null?!1:l,routeTiming:(u=e==null?void 0:e.routeTiming)==null?!1:u}},p_=e=>e,m_=e=>e,h_=e=>{var t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D;let ee={"deployment.environment.name":(t=e.environment)==null?`production`:t,"rum.provider":`blueking`,"telemetry.sdk.language":`webjs`};return J(J({},e),{},{debug:(n=e.debug)==null?!1:n,enabled:(r=e.enabled)==null?!0:r,environment:(i=e.environment)==null?`production`:i,endpoint:r_(e.endpoint||t_),traces:a_(e,`traces`),metrics:a_(e,`metrics`),logs:a_(e,`logs`),sampleRate:o_(e.sampleRate),resourceAttributes:ee,metricIntervalMillis:n_,instrumentations:(a=e.instrumentations)==null?[]:a,commonInstrumentations:{documentLoad:(o=(s=e.rum)==null?void 0:s.documentLoad)==null?!0:o,fetch:(c=(l=e.rum)==null?void 0:l.fetch)==null?!0:c,xhr:(u=(d=e.rum)==null?void 0:d.xhr)==null?!0:u,userInteraction:(f=(p=e.rum)==null?void 0:p.userInteraction)==null?!0:f},rum:f_(e.rum),plugins:(m=e.plugins)==null?[]:m,autoStart:(h=e.autoStart)==null?!0:h,getPageAttributes:(g=(_=e.attributes)==null?void 0:_.page)==null?(()=>({"rum.page.host":typeof window>`u`?``:window.location.host,"rum.page.path":typeof window>`u`?``:window.location.pathname})):g,getMetricAttributes:(v=(y=e.attributes)==null?void 0:y.metric)==null?(()=>({})):v,getErrorAttributes:(b=(x=e.attributes)==null?void 0:x.error)==null?(()=>({})):b,getCustomAttributes:(S=(C=e.attributes)==null?void 0:C.custom)==null?(()=>({})):S,redactAttributes:(w=(T=e.redact)==null?void 0:T.attributes)==null?p_:w,redactUrl:(E=(D=e.redact)==null?void 0:D.url)==null?m_:E})};z(),K();var g_=(e,t)=>typeof e.enabled==`function`?e.enabled(t):e.enabled!==!1,__=class{constructor(e){R(this,`plugins`,void 0),R(this,`startedPlugins`,[]),this.plugins=e}flush(){var e=this;return G(function*(){yield Promise.all(e.startedPlugins.map(e=>Promise.resolve().then(()=>{var t;return(t=e.flush)==null?void 0:t.call(e)})))})()}shutdown(){var e=this;return G(function*(){let t=[...e.startedPlugins].reverse();for(let e of t){var n;yield(n=e.shutdown)==null?void 0:n.call(e)}e.startedPlugins=[]})()}start(e){var t=this;return G(function*(){try{for(let n of t.plugins)g_(n,e.config)&&(yield n.init(e),t.startedPlugins.push(n))}catch(e){throw yield t.shutdown(),e}})()}},v_=[`http.url`,`url.full`],y_=e=>{for(let n of v_){var t;let r=(t=e.attributes)==null?void 0:t[n];if(typeof r==`string`)return r}},b_=class{constructor(e,t){this.inner=e,this.config=t}forceFlush(){return this.inner.forceFlush()}onEnd(e){let t=y_(e);t&&ip(this.config,t)||this.inner.onEnd(e)}onStart(e,t){this.inner.onStart(e,t)}shutdown(){return this.inner.shutdown()}},x_=`__bk_ot_sampled__`,S_=new Map,C_=e=>S_.get(e),w_=(e,t)=>(S_.set(e,t),t),T_=({sampleRate:e})=>{if(e<=0)return!1;if(e>=1)return!0;try{let t=sessionStorage.getItem(x_);if(t)return t===`1`;let n=Math.random()<e;return sessionStorage.setItem(x_,n?`1`:`0`),w_(x_,n),n}catch(t){let n=C_(x_);return typeof n==`boolean`?n:w_(x_,Math.random()<e)}};I(),gn(),W(),Ju(),ac(),_f(),Uf(),z(),Y(),K();var E_=e=>({url:e.endpoint,headers:e.headers,concurrencyLimit:e.concurrencyLimit,timeoutMillis:e.timeoutMillis}),D_=`bk-rum`,O_=(e,t,n)=>n?new Proxy(e,{get(e,n,r){if(n===`export`)return(n,r)=>{var i;return(i=globalThis.console)==null||i.log(`[bk-ot][${t}]`,n),e.export(n,r)};let i=Reflect.get(e,n,r);return typeof i==`function`?i.bind(e):i}}):e,k_=e=>[eh(e.commonInstrumentations)],A_=e=>[oh(e.rum.device),kh(e.rum.httpBody),$h(e.rum.session),Gh(e.rum.pageView),mh(e.rum.error),Zg(e.rum.webVitals),Qf(e.rum.blankScreen),e_(e.rum.websocket),jh(e.rum.longTask),th(e.rum.cspViolation),Kh(e.rum.routeTiming)],j_=class{assertBeforeStart(e){if(this.phase!==`idle`)throw Error(`[bk-ot] ${e}() must be called before start(); set autoStart: false before registration.`)}constructor(e){var t=this;R(this,`loggerProvider`,void 0),R(this,`meterProvider`,void 0),R(this,`phase`,`idle`),R(this,`pluginManager`,void 0),R(this,`plugins`,void 0),R(this,`registeredInstrumentations`,void 0),R(this,`runtimeAttributes`,void 0),R(this,`sampled`,void 0),R(this,`teardownCallbacks`,[]),R(this,`tracerProvider`,void 0),R(this,`applyRedact`,e=>this.config.redactAttributes(e)),R(this,`config`,void 0),R(this,`emitLog`,e=>{var t;let n=J(J({},e),{},{attributes:this.applyRedact(J(J({},this.getRuntimeAttributes()),(t=e.attributes)==null?{}:t))});this.logger.emit(n)}),R(this,`flush`,G(function*(){yield t.pluginManager.flush(),yield t.tracerProvider.forceFlush(),yield t.meterProvider.forceFlush(),yield t.loggerProvider.forceFlush()})),R(this,`getRuntimeAttributes`,()=>J({},this.runtimeAttributes)),R(this,`logger`,void 0),R(this,`meter`,void 0),R(this,`reportCustomEvent`,({attributes:e={},error:t,name:n})=>{if(!this.sampled){if(this.config.debug){var r;(r=globalThis.console)==null||r.warn(`[bk-ot] custom event dropped (not sampled):`,n)}return}let i=this.startSpan(`custom.${n}`,J(J(J(J({},this.config.getPageAttributes()),this.config.getCustomAttributes()),e),{},{"rum.custom.name":n}));t&&(i.recordException(t),i.setStatus({code:xt.ERROR,message:t.message})),i.end()}),R(this,`setRuntimeAttributes`,e=>{Object.assign(this.runtimeAttributes,e)}),R(this,`shutdown`,G(function*(){if(t.phase!==`stopped`){for(yield t.flush();t.teardownCallbacks.length;){var e;(e=t.teardownCallbacks.pop())==null||e()}for(yield t.pluginManager.shutdown();t.registeredInstrumentations.length;){var n,r;(n=t.registeredInstrumentations.pop())==null||(r=n.disable)==null||r.call(n)}yield t.tracerProvider.shutdown(),yield t.meterProvider.shutdown(),yield t.loggerProvider.shutdown(),F.disable(),jt.disable(),N.disable(),t.phase=`stopped`}})),R(this,`start`,G(function*(){if(!(t.phase===`started`||t.phase===`starting`)){if(t.phase===`stopped`)throw Error(`[bk-ot] instance has been shut down and cannot be restarted; create a new instance instead.`);if(!t.config.enabled){t.phase=`started`;return}t.phase=`starting`,Gt.setGlobalPropagator(new Ia),t.tracerProvider.register({contextManager:new Tn}),jt.setGlobalMeterProvider(t.meterProvider),hn.setGlobalLoggerProvider(t.loggerProvider);try{if(t.registeredInstrumentations.length&&Au({instrumentations:t.registeredInstrumentations,meterProvider:t.meterProvider,tracerProvider:t.tracerProvider}),yield t.pluginManager.start(t),typeof window<`u`&&typeof document<`u`){let e=()=>{t.flush()},n=()=>{document.visibilityState===`hidden`&&t.flush()};window.addEventListener(`pagehide`,e),document.addEventListener(`visibilitychange`,n),t.teardownCallbacks.push(()=>window.removeEventListener(`pagehide`,e),()=>document.removeEventListener(`visibilitychange`,n))}}catch(r){for(;t.teardownCallbacks.length;){var e;(e=t.teardownCallbacks.pop())==null||e()}yield t.pluginManager.shutdown();for(let e of t.registeredInstrumentations){var n;(n=e.disable)==null||n.call(e)}throw F.disable(),jt.disable(),N.disable(),t.phase=`idle`,r}t.phase=`started`}})),R(this,`startSpan`,(e,t={})=>this.tracer.startSpan(e,{kind:yt.INTERNAL,attributes:this.applyRedact(J(J({},this.getRuntimeAttributes()),t))})),R(this,`tracer`,void 0),R(this,`use`,e=>(this.assertBeforeStart(`use`),this.sampled&&this.plugins.push(e),this)),R(this,`useInstrumentation`,e=>(this.assertBeforeStart(`useInstrumentation`),this.config.enabled&&this.registeredInstrumentations.push(e),this)),this.config=h_(e),this.sampled=this.config.enabled&&T_(this.config);let n=Qs(this.config.resourceAttributes),r=O_(new Eu(E_(this.config.traces)),`traces`,this.config.debug),i=O_(new Tu(E_(this.config.metrics)),`metrics`,this.config.debug),a=O_(new hu(E_(this.config.logs)),`logs`,this.config.debug),o=new b_(new Bd(r,this.config.spanBatch),this.config),s=new Ks({exporter:i,exportIntervalMillis:this.config.metricIntervalMillis}),c=new pd(a);this.tracerProvider=new Sf({resource:n,sampler:new wd({root:new Ed(+!!this.sampled)}),spanProcessors:[o]}),this.meterProvider=new il({resource:n,readers:[s]}),this.loggerProvider=new cd({resource:n,processors:[c]}),this.tracer=this.tracerProvider.getTracer(D_),this.meter=this.meterProvider.getMeter(D_),this.logger=this.loggerProvider.getLogger(D_),this.runtimeAttributes={"bk.rum.sampled":this.sampled},this.registeredInstrumentations=this.config.enabled?[...this.config.instrumentations]:[],this.plugins=[...this.config.enabled?k_(this.config):[],...this.sampled?[...A_(this.config),...this.config.plugins]:[]],this.pluginManager=new __(this.plugins),this.config.autoStart&&this.start().catch(e=>{var t;(t=globalThis.console)==null||t.warn(`[bk-ot] auto start failed:`,e)})}};return typeof window<`u`&&Object.assign(window,{BkOpenTelemetry:j_}),j_})();