@blueking/open-telemetry 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -2
- package/dist/bk-rum.global.js +3 -3
- package/dist/bk-rum.global.js.map +1 -1
- package/dist/core/config.d.ts +5 -1
- package/dist/core/id.d.ts +8 -0
- package/dist/core/plugin.d.ts +15 -2
- package/dist/core/sdk.d.ts +2 -2
- package/dist/core/throttle.d.ts +20 -0
- package/dist/index.js +798 -543
- package/dist/index.js.map +1 -1
- package/dist/plugins/csp-violation.d.ts +15 -2
- package/dist/plugins/device.d.ts +18 -2
- package/dist/plugins/http-body.d.ts +0 -17
- package/dist/plugins/long-task.d.ts +10 -2
- package/dist/plugins/page-view.d.ts +1 -1
- package/dist/plugins/route-timing.d.ts +1 -5
- package/dist/plugins/session.d.ts +0 -4
- package/dist/plugins/web-vitals.d.ts +1 -1
- package/dist/plugins/websocket.d.ts +1 -1
- package/package.json +2 -2
package/dist/bk-rum.global.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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}, \
|
|
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,ee=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}}})),D,te=t((()=>{D=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__:D,toString(){return e}}}var ne,A=t((()=>{T(),ee(),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!==D.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(D.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),D[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===ee||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==ee||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(ee,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===ee&&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`,ee=`eventTask`,D={},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)},ee=function(e){return y.call(v.target,v.eventName,e.invoke,v.options)},D=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:ee,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],ee=!1;if(E){if(ee=!0,f){for(let e=0;e<E.length;e++)if(ne(E[e],p))return}}else E=l[T]=[];let D,te=l.constructor.name,O=Tr[te];O&&(D=O[u]),D||(D=te+i+(_?_(u):u)),v.options=g,x&&(v.options.once=!1),v.target=l,v.capture=b,v.eventName=u,v.isExisting=ee;let k=r?Cr:void 0;k&&(k.taskData=v),y&&(v.options.signal=void 0);let j=S.scheduleEventTask(D,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:`,D,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;)ee(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 ee(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 D=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(D),o=t.current;return this[g]==null?this[_].push(o,a,e,n):ee(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(D);i[v]=v;let a=t.current;return this[g]==null?this[_].push(a,i,e,e):ee(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
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
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.
|
|
@@ -8,4 +8,4 @@ var BkOpenTelemetry=(function(){var e=Object.defineProperty,t=(e,t)=>()=>(e&&(t=
|
|
|
8
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
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_})();
|
|
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,vf=t((()=>{I(),W(),z(),K(),_f=class{constructor(e){R(this,`_exporter`,void 0),R(this,`_shutdownOnce`,void 0),R(this,`_pendingExports`,void 0),this._exporter=e,this._shutdownOnce=new bo(this._shutdown,this),this._pendingExports=new Set}forceFlush(){var e=this;return G(function*(){yield Promise.all(Array.from(e._pendingExports)),e._exporter.forceFlush&&(yield e._exporter.forceFlush())})()}onStart(e,t){}onEnd(e){if(this._shutdownOnce.isCalled||(e.spanContext().traceFlags&M.SAMPLED)===0)return;let t=this._doExport(e).catch(e=>vi(e));this._pendingExports.add(t),t.finally(()=>this._pendingExports.delete(t))}_doExport(e){var t=this;return G(function*(){if(e.resource.asyncAttributesPending){var n,r;yield(n=(r=e.resource).waitForAsyncAttributes)==null?void 0:n.call(r)}let i=yield wo._export(t._exporter,[e]);if(i.code!==fa.SUCCESS){var a;throw(a=i.error)==null?Error(`SimpleSpanProcessor: span export failed (status ${i})`):a}})()}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}}})),yf=t((()=>{gf(),Zd(),W(),z(),vf(),xd(),Cd(),Td(),Dd(),yd()})),bf,xf=t((()=>{I(),z(),bf=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 Sf(e){if(e!==null){if(e===void 0){let e=new bf;e.enable(),N.setGlobalContextManager(e);return}e.enable(),N.setGlobalContextManager(e)}}function Cf(e){if(e!==null){if(e===void 0){Gt.setGlobalPropagator(new ma({propagators:[new Ia,new oi]}));return}Gt.setGlobalPropagator(e)}}var wf,Tf=t((()=>{yf(),xf(),I(),W(),wf=class extends hf{constructor(e={}){super(e)}register(e={}){F.setGlobalTracerProvider(this),Cf(e.propagator),Sf(e.contextManager)}}})),Q,Ef=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={}))})),Df,Of,kf=t((()=>{Df=`http.response_content_length`,Of=`http.response_content_length_uncompressed`}));function Af(){return Uf||(Uf=document.createElement(`a`)),Uf}function jf(e,t){return t in e}function $(e,t,n,r=!0){if(jf(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function Mf(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(Df,n);let r=t[Q.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(Of,r)}}function Nf(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 Pf(){return typeof location<`u`?location.origin:void 0}function Ff(e,t,n,r,i=new WeakSet,a){let o=Rf(e);e=o.toString();let s=Lf(e,t,n,r,i,a);if(s.length===0)return{mainRequest:void 0};if(s.length===1)return{mainRequest:s[0]};let c=Nf(s);if(o.origin!==Pf()&&c.length>1){let e=c[0],t=If(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 If(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 Lf(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 Rf(e){if(typeof URL==`function`)return new URL(e,typeof document<`u`?document.baseURI:typeof location<`u`?location.href:void 0);let t=Af();return t.href=e,t}function zf(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return`/`;let n=Vf(e,t);if(t&&n.indexOf(`@id`)>0)return n;let r=``;return e.parentNode&&(r+=zf(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 Vf(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 Hf(e,t){let n=t||[];return(typeof n==`string`||n instanceof RegExp)&&(n=[n]),Rf(e).origin===Pf()?!0:n.some(t=>ho(e,t))}var Uf,Wf=t((()=>{Ef(),W(),kf()})),Gf=t((()=>{Tf(),xf(),Ef(),Wf(),yf()}));Ju(),Gf(),gn();var Kf=`body`,qf=3e3,Jf=.8,Yf=[`[data-loading="true"]`,`[aria-busy="true"]`,`.loading`,`.is-loading`,`.spinner`,`.skeleton`,`.bk-loading`],Xf=[[.5,.5],[.25,.25],[.75,.25],[.25,.75],[.75,.75]],Zf=e=>{if(!e)return``;let t=e.tagName.toLowerCase();return e.id?`${t}#${e.id}`:t},Qf=(e,t)=>e?t.some(t=>{try{return e.matches(t)||!!e.closest(t)}catch(e){return!1}}):!1,$f=e=>{if(typeof document>`u`)return()=>{};if(document.readyState===`complete`||document.readyState===`interactive`)return e(),()=>{};let t=()=>{document.removeEventListener(`DOMContentLoaded`,t),e()};return document.addEventListener(`DOMContentLoaded`,t),()=>document.removeEventListener(`DOMContentLoaded`,t)},ep=e=>{let t,n,r=!1;return{name:`blank-screen`,enabled:!!e,init(i){var a,o,s,c;if(typeof window>`u`||typeof document>`u`)return;let l=typeof e==`object`?e:{},u=(a=l.rootSelector)==null?Kf:a,d=(o=l.checkDelay)==null?qf:o,f=(s=l.threshold)==null?Jf:s,p=[...Yf,...(c=l.ignoreSelectors)==null?[]:c],m=i.meter.createCounter(`browser.blank_screen.count`,{description:`Number of suspected blank screen detections`}),h=()=>{try{var e,t;let n=document.querySelector(u),r=0,a=0;for(let[e,t]of Xf){let i=document.elementFromPoint(window.innerWidth*e,window.innerHeight*t);if(Qf(i,p)){a+=1;continue}(i===n||i===document.body||i===document.documentElement)&&(r+=1)}let o=Xf.length-a;if(o===0)return;let s=r/o,c=s>=f,l={"bk.rum.blank_screen.score":s,"bk.rum.blank_screen.threshold":f,"bk.rum.blank_screen.root":u,"bk.rum.blank_screen.detected":c,"bk.rum.blank_screen.sample_total":Xf.length,"bk.rum.blank_screen.sample_valid":o,"bk.rum.blank_screen.sample_loading":a,"bk.rum.blank_screen.center_element":Zf(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};c&&(m.add(1,i.applyRedact({"bk.rum.blank_screen.root":u})),i.emitLog({severityNumber:L.ERROR,severityText:`ERROR`,body:`browser.blank_screen`,attributes:l}))}catch(e){if(i.config.debug){var n;(n=globalThis.console)==null||n.warn(`[bk-ot][blank-screen] detection failed:`,e)}}};n=$f(()=>{r||(t=window.setTimeout(h,d))})},shutdown(){r=!0,n==null||n(),n=void 0,t!==void 0&&typeof window<`u`&&(window.clearTimeout(t),t=void 0)}}},tp=()=>typeof window>`u`?`http://localhost`:window.location.origin,np=e=>{try{return new URL(e,tp()).href}catch(t){return e}},rp=e=>e.length>1?e.replace(/\/+$/,``):e,ip=(e,t)=>{let n=e=>rp(e.replace(/[?#].*$/,``));return n(e)===n(t)},ap=e=>{try{return new URL(e,tp()).origin===tp()}catch(e){return!1}},op=(e,t)=>{let n=np(t);return[e.traces.endpoint,e.metrics.endpoint,e.logs.endpoint].some(e=>ip(n,np(e)))},sp=(e,t)=>op(e,t),cp=(e,t)=>ap(t),lp,up=t((()=>{(function(e){e.DOCUMENT_LOAD=`documentLoad`,e.DOCUMENT_FETCH=`documentFetch`,e.RESOURCE_FETCH=`resourceFetch`})(lp||(lp={}))})),dp,fp,pp=t((()=>{dp=`0.62.0`,fp=`@opentelemetry/instrumentation-document-load`})),mp,hp,gp=t((()=>{mp=`http.url`,hp=`http.user_agent`})),_p,vp=t((()=>{(function(e){e.FIRST_PAINT=`firstPaint`,e.FIRST_CONTENTFUL_PAINT=`firstContentfulPaint`})(_p||(_p={}))})),yp,bp,xp,Sp=t((()=>{W(),vp(),yp=()=>{var e;let t={},n=(e=U.getEntriesByType)==null?void 0:e.call(U,`navigation`)[0];if(n)Object.values(Q).forEach(e=>{if(jf(n,e)){let r=n[e];typeof r==`number`&&(t[e]=r)}});else{let e=U.timing;e&&Object.values(Q).forEach(n=>{if(jf(e,n)){let r=e[n];typeof r==`number`&&(t[n]=r)}})}return t},bp={"first-paint":_p.FIRST_PAINT,"first-contentful-paint":_p.FIRST_CONTENTFUL_PAINT},xp=e=>{var t;let n=(t=U.getEntriesByType)==null?void 0:t.call(U,`paint`);n&&n.forEach(({name:t,startTime:n})=>{jf(bp,t)&&e.addEvent(bp[t],n)})}})),Cp,wp=t((()=>{I(),W(),Gf(),qi(),up(),pp(),gp(),Sp(),z(),Cp=class extends Vu{constructor(e={}){super(fp,dp,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=yp(),n=e&&e.content||``;N.with(Gt.extract(j,{traceparent:n}),()=>{var e;let n=this._startSpan(lp.DOCUMENT_LOAD,Q.FETCH_START,t);n&&(N.with(F.setSpan(N.active(),n),()=>{let e=this._startSpan(lp.DOCUMENT_FETCH,Q.FETCH_START,t);e&&(this._semconvStability&Z.OLD&&e.setAttribute(mp,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);Mf(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(mp,location.href),n.setAttribute(hp,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||xp(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&&(jf(n,t)?e.end(n[t]):e.end())}_initResourceSpan(e,t){let n=this._startSpan(lp.RESOURCE_FETCH,Q.FETCH_START,e,t);if(n){var r;this._semconvStability&Z.OLD&&n.setAttribute(mp,e.name),this._semconvStability&Z.STABLE&&n.setAttribute(Hi,e.name);let t=!(this._semconvStability&Z.OLD);Mf(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(jf(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)}}})),Tp=n({AttributeNames:()=>lp,DocumentLoadInstrumentation:()=>Cp}),Ep=t((()=>{wp(),up()})),Dp,Op=t((()=>{(function(e){e.COMPONENT=`component`,e.HTTP_STATUS_TEXT=`http.status_text`})(Dp||(Dp={}))})),kp,Ap,jp,Mp,Np,Pp,Fp,Ip,Lp=t((()=>{kp=`http.host`,Ap=`http.method`,jp=`http.request.body.size`,Mp=`http.request_content_length_uncompressed`,Np=`http.scheme`,Pp=`http.status_code`,Fp=`http.url`,Ip=`http.user_agent`}));function Rp(...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}=zp(t.body);return t.body=e,n}else return Promise.resolve(Vp(t.body))}else{let t=e[0];return t!=null&&t.body?t.clone().text().then(e=>Hp(e)):Promise.resolve()}}function zp(e){if(!e.pipeThrough)return qp.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 Bp(e){return typeof Document<`u`&&e instanceof Document}function Vp(e){if(Bp(e))return new XMLSerializer().serializeToString(document).length;if(typeof e==`string`)return Hp(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return Up(e);if(e instanceof URLSearchParams)return Hp(e.toString());if(e.byteLength!==void 0)return e.byteLength;qp.warn(`unknown body type`)}function Hp(e){return Jp.encode(e).byteLength}function Up(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 Wp(e){let t=Gp(),n=e.toUpperCase();return n in t?n:`_OTHER`}function Gp(){return Xp===void 0&&(Xp=Yp),Xp}function Kp(e){let t=Number(e.port||Zp[e.protocol]);if(t&&!isNaN(t))return t}var qp,Jp,Yp,Xp,Zp,Qp=t((()=>{I(),W(),K(),qp=P.createComponentLogger({namespace:`@opentelemetry/opentelemetry-instrumentation-fetch/utils`}),Jp=new TextEncoder,Yp={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0},Zp={"https:":`443`,"http:":`80`}})),$p,em=t((()=>{$p=`0.217.0`})),tm,nm,rm,im=t((()=>{I(),Ju(),W(),Gf(),Op(),Lp(),qi(),Qp(),em(),z(),tm=300,nm=typeof PerformanceObserver<`u`,rm=class extends Vu{constructor(e={}){super(`@opentelemetry/instrumentation-fetch`,$p,e),R(this,`component`,`fetch`),R(this,`version`,$p),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);Mf(n,t,this.getConfig().ignoreNetworkEvents,void 0,r),n.end(t[Q.RESPONSE_END])}_addFinalSpanAttributes(e,t){let n=Rf(t.url);if(this._semconvStability&Z.OLD&&(e.setAttribute(Pp,t.status),t.statusText!=null&&e.setAttribute(Dp.HTTP_STATUS_TEXT,t.statusText),e.setAttribute(kp,n.host),e.setAttribute(Np,n.protocol.replace(`:`,``)),typeof navigator<`u`&&e.setAttribute(Ip,navigator.userAgent)),this._semconvStability&Z.STABLE){e.setAttribute(Pi,t.status),e.setAttribute(Fi,n.hostname);let r=Kp(n);r&&e.setAttribute(Ii,r)}}_addHeaders(e,t){if(!Hf(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[Dp.COMPONENT]=this.moduleName,r[Ap]=i,r[Fp]=e}if(this._semconvStability&Z.STABLE){let i=t.method,a=Wp(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=Ff(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);Mf(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)},tm)}_patchConstructor(){return e=>{let t=this;return function(...n){if(!t._isEnabled)return e.apply(this,n);let r=this,i=Rf(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&&Rp(...n).then(e=>{e&&(t._semconvStability&Z.OLD&&o.setAttribute(Mp,e),t._semconvStability&Z.STABLE&&o.setAttribute(jp,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(!nm){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(){nm&&this._isEnabled&&(this._isEnabled=!1,this._usedResources=new WeakSet)}}})),am=n({FetchInstrumentation:()=>rm}),om=t((()=>{im()})),sm,cm,lm,um,dm,fm,pm,mm,hm=t((()=>{sm=`http.host`,cm=`http.method`,lm=`http.request.body.size`,um=`http.request_content_length_uncompressed`,dm=`http.scheme`,fm=`http.status_code`,pm=`http.url`,mm=`http.user_agent`})),gm,_m=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`})(gm||(gm={}))}));function vm(e){return typeof Document<`u`&&e instanceof Document}function ym(e){if(vm(e))return new XMLSerializer().serializeToString(document).length;if(typeof e==`string`)return bm(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return xm(e);if(e instanceof URLSearchParams)return bm(e.toString());if(e.byteLength!==void 0)return e.byteLength;Tm.warn(`unknown body type`)}function bm(e){return Em.encode(e).byteLength}function xm(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 Sm(e){let t=Cm(),n=e.toUpperCase();return n in t?n:`_OTHER`}function Cm(){return Om===void 0&&(Om=Dm),Om}function wm(e){let t=Number(e.port||km[e.protocol]);if(t&&!isNaN(t))return t}var Tm,Em,Dm,Om,km,Am=t((()=>{I(),W(),Tm=P.createComponentLogger({namespace:`@opentelemetry/opentelemetry-instrumentation-xml-http-request/utils`}),Em=new TextEncoder,Dm={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0},km={"https:":`443`,"http:":`80`}})),jm,Mm=t((()=>{jm=`0.217.0`})),Nm,Pm=t((()=>{(function(e){e.HTTP_STATUS_TEXT=`http.status_text`})(Nm||(Nm={}))})),Fm,Im,Lm=t((()=>{I(),Ju(),W(),Gf(),qi(),hm(),_m(),Am(),Mm(),Pm(),z(),Fm=300,Im=class extends Vu{constructor(e={}){super(`@opentelemetry/instrumentation-xml-http-request`,jm,e),R(this,`component`,`xml-http-request`),R(this,`version`,jm),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=Rf(t).href;if(!Hf(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);Mf(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(fm,t.status),t.statusText!==void 0&&e.setAttribute(Nm.HTTP_STATUS_TEXT,t.statusText),typeof n==`string`){let t=Rf(n);e.setAttribute(sm,t.host),e.setAttribute(dm,t.protocol.replace(`:`,``))}e.setAttribute(mm,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=Rf(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=Ff(Rf(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);Mf(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=Rf(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[cm]=n,a[pm]=r.toString()),this._semconvStability&Z.STABLE){let e=n,t=Sm(n);i||(i=t),a[Mi]=t,t!==e&&(a[Ni]=e),a[Hi]=r.toString(),a[Fi]=r.hostname;let o=wm(r);o&&(a[Ii]=o)}let o=this.tracer.startSpan(i,{kind:yt.CLIENT,attributes:a});return o.addEvent(gm.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)},Fm)}function r(){n(gm.EVENT_ERROR,this,!0,`error`)}function i(){n(gm.EVENT_ABORT,this,!1)}function a(){n(gm.EVENT_TIMEOUT,this,!0,`timeout`)}function o(){this.status<299?n(gm.EVENT_LOAD,this,!1):n(gm.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=ym(t);r!==void 0&&(e._semconvStability&Z.OLD&&l.setAttribute(um,r),e._semconvStability&Z.STABLE&&l.setAttribute(lm,r))}N.with(F.setSpan(N.active(),l),()=>{e._tasksCount++,c.sendStartTime=ea(),l.addEvent(gm.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)}}})),Rm=n({XMLHttpRequestInstrumentation:()=>Im}),zm=t((()=>{Lm()})),Bm,Vm=t((()=>{(function(e){e.EVENT_TYPE=`event_type`,e.TARGET_ELEMENT=`target_element`,e.TARGET_XPATH=`target_xpath`,e.HTTP_URL=`http.url`})(Bm||(Bm={}))})),Hm,Um,Wm=t((()=>{Hm=`0.61.0`,Um=`@opentelemetry/instrumentation-user-interaction`}));function Gm(){return!1}var Km,qm,Jm,Ym,Xm=t((()=>{Ju(),I(),W(),Gf(),Vm(),Wm(),z(),Km=`OT_ZONE_CONTEXT`,qm=`Navigation:`,Jm=[`click`],Ym=class extends Vu{constructor(e={}){var t;super(Um,Hm,e),R(this,`version`,Hm),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?Jm:t),this._shouldPreventSpanCreation=typeof(e==null?void 0:e.shouldPreventSpanCreation)==`function`?e.shouldPreventSpanCreation:Gm}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=zf(e,!0);try{let i=this.tracer.startSpan(t,{attributes:{[Bm.EVENT_TYPE]:t,[Bm.TARGET_ELEMENT]:e.tagName,[Bm.TARGET_XPATH]:r,[Bm.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(Km);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(`${qm} ${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}}})),Zm=n({AttributeNames:()=>Bm,UserInteractionInstrumentation:()=>Ym}),Qm=t((()=>{Xm(),Vm()}));Ju(),K();var $m=[`http.url`,`url.full`],eh=e=>({test:e}),th=(e,t)=>{t.setAttributes(e.applyRedact(e.config.getPageAttributes()));for(let r of $m){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)}}},nh=e=>{let t=[];return{name:`official-instrumentations`,enabled:!!(e.documentLoad||e.fetch||e.xhr||e.userInteraction),init(n){return G(function*(){let r=[eh(e=>sp(n.config,e))],i=[eh(e=>cp(n.config,e))],[a,o,s,c]=yield Promise.all([e.documentLoad?Promise.resolve().then(()=>(Ep(),Tp)):Promise.resolve(null),e.fetch?Promise.resolve().then(()=>(om(),am)):Promise.resolve(null),e.xhr?Promise.resolve().then(()=>(zm(),Rm)):Promise.resolve(null),e.userInteraction?Promise.resolve().then(()=>(Qm(),Zm)):Promise.resolve(null)]);if(a&&t.push(new a.DocumentLoadInstrumentation({semconvStabilityOptIn:`http`})),o&&t.push(new o.FetchInstrumentation({applyCustomAttributesOnSpan:e=>th(n,e),ignoreUrls:r,propagateTraceHeaderCorsUrls:i,semconvStabilityOptIn:`http`,ignoreNetworkEvents:!1})),s&&t.push(new s.XMLHttpRequestInstrumentation({applyCustomAttributesOnSpan:e=>th(n,e),ignoreUrls:r,propagateTraceHeaderCorsUrls:i,semconvStabilityOptIn:`http`,ignoreNetworkEvents:!1})),c){let n=e.userInteraction!==null&&typeof e.userInteraction==`object`?{eventNames:e.userInteraction.eventNames}:void 0;t.push(new c.UserInteractionInstrumentation(n))}Au({instrumentations:t})})()},shutdown(){for(;t.length;){var e,n;(e=t.pop())==null||(n=e.disable)==null||n.call(e)}}}},rh=e=>{let t=5381;for(let n=0;n<e.length;n++)t=t*33^e.charCodeAt(n);return(t>>>0).toString(36)},ih=(e,t)=>{let n=new Map,r=0,i=t=>{if(!(t-r<e)){r=t;for(let[r,i]of n)t-i.windowStart>e&&n.delete(r)}};return{allow(r){let a=Date.now();i(a);let o=n.get(r);return!o||a-o.windowStart>e?(n.set(r,{count:1,windowStart:a}),{allowed:!0,count:1}):(o.count+=1,{allowed:o.count<=t,count:o.count})}}};gn(),Y();var ah=6e4,oh=5,sh=/^https?:|^\/\//i,ch=(e,t)=>{if(t)return sh.test(t)?e(t):t},lh=e=>{let t;return{name:`csp-violation`,enabled:!!e,init(e){if(typeof window>`u`||typeof document>`u`)return;let n=ih(ah,oh),r=t=>{let r=rh(`${t.violatedDirective}|${t.blockedURI}|${t.sourceFile}|${t.lineNumber}`),i=n.allow(r);if(!i.allowed)return;let a=ch(e.config.redactUrl,t.blockedURI),o=t.sourceFile?e.config.redactUrl(t.sourceFile):void 0,s=i.count===1;e.emitLog({severityNumber:L.WARN,severityText:`WARN`,body:`csp.violation`,attributes:J(J({},e.config.getPageAttributes()),{},{"csp.blocked_uri":a,"csp.violated_directive":t.violatedDirective,"csp.effective_directive":t.effectiveDirective,"csp.disposition":t.disposition,"csp.source_file":o,"csp.line_number":t.lineNumber,"csp.column_number":t.columnNumber,"csp.status_code":t.statusCode,"csp.fingerprint":r,"csp.window_count":i.count},s?{"csp.original_policy":t.originalPolicy}:{})})};document.addEventListener(`securitypolicyviolation`,r),t=()=>document.removeEventListener(`securitypolicyviolation`,r)},shutdown(){t==null||t(),t=void 0}}},uh=e=>typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`${e}-${Date.now()}-${Math.random().toString(16).slice(2)}`;Y();var dh=`bk_ot_session_id`,fh=250,ph=()=>navigator.connection,mh=()=>navigator.userAgentData,hh=e=>{let t=null;try{t=window.localStorage.getItem(e)}catch(e){}if(t)return t;let n=uh(`device`);try{window.localStorage.setItem(e,n)}catch(e){}return n},gh=()=>{var e,t;return typeof window>`u`?{}:{"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}},_h=()=>{let e=ph();return e?{"network.effective_type":e.effectiveType,"network.connection_type":e.type,"network.downlink":e.downlink,"network.rtt":e.rtt,"network.save_data":e.saveData}:{}},vh=()=>{if(typeof navigator>`u`)return{};let e=mh();return{"device.memory":navigator.deviceMemory,"device.cpu_cores":navigator.hardwareConcurrency,"device.platform":e==null?void 0:e.platform,"device.mobile":e==null?void 0:e.mobile}},yh=(e,t)=>{let n;return()=>{n!==void 0&&window.clearTimeout(n),n=window.setTimeout(()=>{n=void 0,e()},t)}},bh=e=>{let t=[];return{name:`device`,enabled:!!e,init(n){var r;let i=typeof e==`object`?(r=e.storageKey)==null?dh:r:dh,a=typeof window>`u`?uh(`device`):hh(i);if(n.setRuntimeAttributes(J(J(J({"device.id":a},vh()),gh()),_h())),typeof window>`u`)return;let o=yh(()=>{n.setRuntimeAttributes(gh())},fh);window.addEventListener(`resize`,o),window.addEventListener(`orientationchange`,o),t.push(()=>window.removeEventListener(`resize`,o),()=>window.removeEventListener(`orientationchange`,o));let s=ph();if(s&&typeof s.addEventListener==`function`){let e=()=>{n.setRuntimeAttributes(_h())};s.addEventListener(`change`,e),t.push(()=>{var t;(t=s.removeEventListener)==null||t.call(s,`change`,e)})}},shutdown(){for(;t.length;){var e;(e=t.pop())==null||e()}}}};I(),gn(),Y();var xh=6e4,Sh=5,Ch=e=>{if(e instanceof Error)return e.message;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch(t){return String(e)}},wh=e=>{var t;return e instanceof Error?(t=e.stack)==null?``:t:``},Th=({context:e,error:t,exceptionType:n,extra:r={},source:i,spanName:a,throttle:o})=>{let s=Ch(t),c=wh(t),l=rh(`${i}|${s}|${c.slice(0,256)}`),u=o.allow(l);if(!u.allowed)return;let d=F.getActiveSpan(),f=t instanceof Error?t:{message:s,name:n==null?i:n},p=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,"bk.rum.error.window_count":u.count},r),m=()=>e.emitLog({severityNumber:L.ERROR,severityText:`ERROR`,body:s,attributes:p});if(d){d.recordException(f),d.setStatus({code:xt.ERROR,message:s}),m();return}let h=e.startSpan(a,p);h.recordException(f),h.setStatus({code:xt.ERROR,message:s}),N.with(F.setSpan(N.active(),h),m),h.end()},Eh=e=>{let t=[];return{name:`error`,enabled:!!e,init(n){var r,i;if(typeof window>`u`)return;let a=ih(typeof e==`object`?(r=e.windowMs)==null?xh:r:xh,typeof e==`object`?(i=e.maxPerWindow)==null?Sh:i:Sh),o=e=>{var t;let r=!e.error&&!e.filename&&e.message===`Script error.`;Th({context:n,throttle:a,spanName:`browser.error`,source:`window.error`,error:(t=e.error)==null?e.message:t,extra:J({"code.filepath":e.filename,"code.lineno":e.lineno,"code.column":e.colno},r?{"bk.rum.error.cross_origin":!0}:{})})},s=e=>{Th({context:n,throttle:a,spanName:`browser.unhandledrejection`,source:`unhandledrejection`,error:e.reason,exceptionType:e.reason instanceof Error?e.reason.name:`UnhandledRejection`})},c=e=>{if(e instanceof ErrorEvent)return;let t=e.target;if(!(t instanceof Element))return;let r=t,i=r.src||r.href||t.currentSrc||``;Th({context:n,throttle:a,spanName:`browser.resource_error`,source:`resource`,error:Error(`Resource load failed: ${t.tagName.toLowerCase()} ${i}`),exceptionType:`ResourceError`,extra:{"url.full":n.config.redactUrl(i),"html.tag":t.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 Dh=10*1024,Oh=10,kh=new WeakMap,Ah=(e,t)=>e.length<=t?{body:e,truncated:!1}:{body:e.slice(0,t),truncated:!0},jh=(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},Mh=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)},Nh=function(){var e=G(function*(e){return e==null?``:typeof e==`string`?e:e instanceof URLSearchParams?e.toString():e instanceof FormData?Mh(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)}}(),Ph=function(){var e=G(function*(e,t,n){let r=yield Nh(e);if(r)return J(J({},Ah(r,t)),{},{contentType:n})});return function(t,n,r){return e.apply(this,arguments)}}(),Fh=function(){var e=G(function*(e,t,n){try{return yield Ph(e,t,n)}catch(e){return}});return function(t,n,r){return e.apply(this,arguments)}}(),Ih=e=>e instanceof Request?e.url:String(e),Lh=(e,t)=>t!=null&&t.method?t.method:e instanceof Request?e.method:`GET`,Rh=function(){var e=G(function*(e,t,n){if(t!=null&&t.body)return Fh(t.body,n,jh(t.headers,`content-type`));if(e instanceof Request)try{return Fh(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)}}(),zh=function(){var e=G(function*(e,t){try{let n=e.headers.get(`content-type`)||void 0,r=e.headers.get(`content-length`);if(r){let e=Number(r);if(Number.isFinite(e)&&e>t*Oh)return{body:``,contentType:n,truncated:!0}}let i=e.clone();return Fh(i.body?yield i.text():``,t,n)}catch(e){return}});return function(t,n){return e.apply(this,arguments)}}(),Bh=(e,t)=>{if(e.responseType===``||e.responseType===`text`)return J(J({},Ah(e.responseText||``,t)),{},{contentType:e.getResponseHeader(`content-type`)||void 0});if(e.responseType===`json`)return J(J({},Ah(JSON.stringify(e.response),t)),{},{contentType:e.getResponseHeader(`content-type`)||void 0})},Vh=(e,t,n)=>{if(n)return e.redact(J(J({},t),{},{body:n.body,truncated:n.truncated}))},Hh=({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?Vh(c,{contentType:i==null?void 0:i.contentType,method:u,status:o,type:`request`,url:s},i):void 0,f=l?Vh(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})},Uh=e=>{let t=[];return{name:`http-body`,enabled:!!e,init(n){if(!e||typeof window>`u`)return;let r=e.maxBodySize||Dh,i=window.fetch;if(typeof i==`function`){let e=function(){var e=G(function*(e,t){let a=Ih(e);if(sp(n.config,a))return i(e,t);let o=Lh(e,t),s=yield Rh(e,t,r),c=performance.now();try{let l=yield i(e,t);return Hh({context:n,duration:performance.now()-c,method:o,request:s,response:l.status>=400?yield zh(l,r):void 0,status:l.status,url:a}),l}catch(e){throw Hh({context:n,duration:performance.now()-c,error:e,method:o,request:s,url:a}),e}});return function(t,n){return e.apply(this,arguments)}}();window.fetch=e,t.push(()=>{window.fetch===e&&(window.fetch=i)})}let a=XMLHttpRequest.prototype.open,o=XMLHttpRequest.prototype.send,s=XMLHttpRequest.prototype.setRequestHeader,c=function(e,t,...n){var r;return kh.set(this,{method:e,startTime:performance.now(),url:String(t)}),a.call(this,e,t,(r=n[0])==null?!0:r,n[1],n[2])},l=function(e,t){let n=kh.get(this);if(n){var r;let i=e.toLowerCase(),a=(r=n.requestHeaders)==null?{}:r,o=a[i];a[i]=o?`${o}, ${t}`:t,n.requestHeaders=a}return s.call(this,e,t)},u=function(e){var t=this;let i=kh.get(this);if(i){var a;i.requestPromise=Fh(e,r,(a=i.requestHeaders)==null?void 0:a[`content-type`])}return this.addEventListener(`abort`,()=>{let e=kh.get(this);e&&(e.aborted=!0)},{once:!0}),this.addEventListener(`error`,()=>{let e=kh.get(this);e&&(e.networkError=!0)},{once:!0}),this.addEventListener(`loadend`,()=>{G(function*(){let e=kh.get(t);if(!e||sp(n.config,e.url)||e.aborted)return;let i=e.networkError||t.status>=400?Bh(t,r):void 0,a=yield e.requestPromise;Hh({context:n,duration:performance.now()-e.startTime,error:e.networkError?Error(`XHR network error`):void 0,method:e.method,request:a,response:i,status:t.status,url:e.url})})()},{once:!0}),o.call(this,e)};XMLHttpRequest.prototype.open=c,XMLHttpRequest.prototype.setRequestHeader=l,XMLHttpRequest.prototype.send=u,t.push(()=>{XMLHttpRequest.prototype.open===c&&(XMLHttpRequest.prototype.open=a),XMLHttpRequest.prototype.setRequestHeader===l&&(XMLHttpRequest.prototype.setRequestHeader=s),XMLHttpRequest.prototype.send===u&&(XMLHttpRequest.prototype.send=o)})},shutdown(){for(;t.length;){var e;(e=t.pop())==null||e()}}}};Y();var Wh=50,Gh=e=>{let t;return{name:`long-task`,enabled:!!e,init(n){var r,i;if(typeof PerformanceObserver>`u`||!((r=PerformanceObserver.supportedEntryTypes)!=null&&r.includes(`longtask`)))return;let a=typeof e==`object`?(i=e.threshold)==null?Wh:i:Wh,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=>{let t=n.applyRedact(J(J({},n.config.getPageAttributes()),n.config.getMetricAttributes()));for(let n of e.getEntries()){var r,i;if(n.duration<a)continue;let e=(r=n.attribution)==null?void 0:r[0],c=J(J({},t),{},{"long_task.name":n.name,"long_task.attribution":(i=e==null?void 0:e.name)==null?`unknown`:i});o.add(1,c),s.record(n.duration,c)}}),t.observe({type:`longtask`,buffered:!0})}catch(e){t=void 0}},shutdown(){t==null||t.disconnect(),t=void 0}}},Kh=new Set,qh=``,Jh,Yh,Xh=!1,Zh=()=>typeof location>`u`?``:location.href,Qh=(e,t)=>{let n=Zh();qh=n;let r={fromUrl:t,source:e,toUrl:n};for(let e of Array.from(Kh))e(r)},$h=()=>{Qh(`popstate`,qh||Zh())},eg=()=>{Qh(`hashchange`,qh||Zh())},tg=()=>{Xh||typeof window>`u`||typeof history>`u`||(Xh=!0,qh=Zh(),Jh=history.pushState,Yh=history.replaceState,history.pushState=function(e,t,n){let r=qh||Zh(),i=Jh==null?void 0:Jh.apply(this,[e,t,n]);return Qh(`pushState`,r),i},history.replaceState=function(e,t,n){let r=qh||Zh(),i=Yh==null?void 0:Yh.apply(this,[e,t,n]);return Qh(`replaceState`,r),i},window.addEventListener(`popstate`,$h),window.addEventListener(`hashchange`,eg))},ng=()=>{!Xh||typeof window>`u`||typeof history>`u`||(Jh&&(history.pushState=Jh),Yh&&(history.replaceState=Yh),window.removeEventListener(`popstate`,$h),window.removeEventListener(`hashchange`,eg),Jh=void 0,Yh=void 0,Xh=!1,qh=``)},rg=e=>typeof window>`u`||typeof history>`u`?()=>{}:(tg(),Kh.add(e),()=>{Kh.delete(e),Kh.size===0&&ng()});Y();var ig=()=>typeof location>`u`?``:location.href,ag=e=>{let t=[];return{name:`page-view`,enabled:!!e,init(e){if(typeof window>`u`)return;let n=``,r=(t,r=n)=>{let i=ig();if(i===n)return;n=i;let a=t===`load`;e.startSpan(`browser.page_view`,J(J({},e.config.getPageAttributes()),{},{"url.full":e.config.redactUrl(i),"url.previous":e.config.redactUrl(r),"bk.rum.event.source":t},a?{"document.referrer":e.config.redactUrl(document.referrer||``)}:{})).end()},i=rg(e=>{r(e.source,e.fromUrl)});r(`load`),t.push(i)},shutdown(){for(;t.length;){var e;(e=t.pop())==null||e()}}}};Y();var og=e=>{let t=[],n=!1;return{name:`route-timing`,enabled:!!e,init(e){if(typeof window>`u`||typeof history>`u`)return;let r=e.meter.createHistogram(`browser.route_change.duration`,{unit:`ms`,description:`Estimated SPA route change duration (route start to next idle)`}),i=(t,i,a)=>{if(n)return;let o=performance.now(),s=performance.timeOrigin+o,c=()=>{if(n||typeof document<`u`&&document.visibilityState===`hidden`)return;let c=performance.now()-o,l=e.applyRedact(J(J(J({},e.config.getPageAttributes()),e.config.getMetricAttributes()),{},{"route.change.source":t}));r.record(c,l),e.startSpan(`browser.route_change`,J(J({},l),{},{"url.full":e.config.redactUrl(a),"url.previous":e.config.redactUrl(i),"route.change.duration_ms":c}),{startTime:s}).end()};requestAnimationFrame(()=>requestAnimationFrame(()=>setTimeout(c,0)))},a=rg(e=>{e.fromUrl!==e.toUrl&&i(e.source,e.fromUrl,e.toUrl)});t.push(a)},shutdown(){for(n=!0;t.length;){var e;(e=t.pop())==null||e()}}}};gn(),Y();var sg=1800*1e3,cg=1440*60*1e3,lg=6e4,ug=5e3,dg=[`click`,`keydown`,`scroll`,`mousemove`,`touchstart`],fg=(e,t)=>typeof e==`number`&&Number.isFinite(e)&&e>0&&e<=t+ug,pg=(e,t)=>{if(!e)return null;try{let n=JSON.parse(e);if(typeof(n==null?void 0:n.id)==`string`&&fg(n.ts,t)&&fg(n.startedAt,t))return n}catch(e){}return null},mg=(e,t)=>{if(typeof window>`u`)return null;let n=null;try{n=window.localStorage.getItem(e)}catch(e){}let r=pg(n,t);if(r)return r;try{n=window.sessionStorage.getItem(e)}catch(e){}return r=pg(n,t),r},hg=(e,t)=>{if(typeof window>`u`)return;let n=JSON.stringify(t);try{window.sessionStorage.setItem(e,n)}catch(e){}try{window.localStorage.setItem(e,n)}catch(e){}},gg=(e,t,n)=>{let r=Date.now(),i=mg(e,r);if(i){let a=r-i.ts>=t,o=r-i.startedAt>=n;if(!a&&!o){let t=J(J({},i),{},{ts:r});return hg(e,t),{id:t.id,rotated:!1}}let s=a?`inactivity`:`maxLifetime`,c={id:uh(`session`),startedAt:r,ts:r};return hg(e,c),{id:c.id,prevId:i.id,reason:s,rotated:!0}}let a={id:uh(`session`),startedAt:r,ts:r};return hg(e,a),{id:a.id,reason:`init`,rotated:!0}},_g=e=>{let t=``;try{t=new URL(e).host}catch(n){t=e}return`bk_ot_session__${rh(t||`default`)}`},vg=(e,t)=>{!t.rotated||!t.reason||e.emitLog({severityNumber:L.INFO,severityText:`INFO`,body:t.reason===`init`?`session.start`:`session.rotate`,attributes:J(J({},e.config.getPageAttributes()),{},{"session.id":t.id,"session.rotate.reason":t.reason},t.prevId?{"session.previous_id":t.prevId}:{})})},yg=e=>{let t=[];return{name:`session`,enabled:!!e,init(n){var r,i,a;let o=typeof e==`object`?e:void 0,s=(r=o==null?void 0:o.storageKey)==null?_g(n.config.endpoint):r,c=(i=o==null?void 0:o.inactivityMs)==null?sg:i,l=(a=o==null?void 0:o.maxLifetimeMs)==null?cg:a,u=``,d=()=>{if(typeof window>`u`){u||(u=uh(`session`),n.setRuntimeAttributes({"session.id":u}));return}let e=gg(s,c,l);n.setRuntimeAttributes({"session.id":e.id}),e.id!==u&&(u=e.id,vg(n,e))};if(d(),typeof window>`u`||typeof document>`u`)return;let f=Date.now(),p=()=>{let e=Date.now();e-f<lg||(f=e,d())},m={capture:!0,passive:!0};dg.forEach(e=>{window.addEventListener(e,p,m)}),t.push(()=>{dg.forEach(e=>{window.removeEventListener(e,p,m)})});let h=()=>{document.visibilityState===`visible`&&d()};document.addEventListener(`visibilitychange`,h),t.push(()=>document.removeEventListener(`visibilitychange`,h));let g=e=>{if(e.storageArea!==window.localStorage||e.key!==s||!e.newValue)return;let t=Date.now(),r=pg(e.newValue,t);if(!(!r||r.id===u)){u=r.id;try{window.sessionStorage.setItem(s,e.newValue)}catch(e){}n.setRuntimeAttributes({"session.id":r.id})}};window.addEventListener(`storage`,g),t.push(()=>window.removeEventListener(`storage`,g))},shutdown(){for(;t.length;){var e;(e=t.pop())==null||e()}}}},bg=n({CLSThresholds:()=>Gg,FCPThresholds:()=>Ug,INPThresholds:()=>a_,LCPThresholds:()=>c_,TTFBThresholds:()=>u_,onCLS:()=>qg,onFCP:()=>Jg,onINP:()=>o_,onLCP:()=>l_,onTTFB:()=>f_});function xg(e,t){return Dg.get(e)||Dg.set(e,new t),Dg.get(e)}var 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,Qg,$g,e_,t_,n_,r_,i_,a_,o_,s_,c_,l_,u_,d_,f_,p_=t((()=>{z(),Y(),Sg=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)}},Cg=()=>{let e=performance.getEntriesByType(`navigation`)[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},wg=e=>{if(document.readyState===`loading`)return`loading`;let t=Cg();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`},Tg=e=>{let t=e.nodeName;return e.nodeType===1?t.toLowerCase():t.toUpperCase().replace(/^#/,``)},Eg=e=>{let t=``;try{for(;(e==null?void 0:e.nodeType)!==9;){let n=e,r=n.id?`#`+n.id:[Tg(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,Og=-1,kg=()=>Og,Ag=e=>{addEventListener(`pageshow`,t=>{t.persisted&&(Og=t.timeStamp,e(t))},!0)},jg=(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)))}},Mg=e=>{requestAnimationFrame(()=>requestAnimationFrame(e))},Ng=()=>{var e,t;return(e=(t=Cg())==null?void 0:t.activationStart)==null?0:e},Pg=(e,t=-1)=>{let n=Cg(),r=`navigate`;return kg()>=0?r=`back-forward-cache`:n&&(document.prerendering||Ng()>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}},Fg=(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){}},Ig=e=>{let t=!1;return()=>{t||(e(),t=!0)}},Lg=-1,Rg=new Set,zg=()=>document.visibilityState!==`hidden`||document.prerendering?1/0:0,Bg=e=>{if(document.visibilityState===`hidden`){if(e.type===`visibilitychange`)for(let e of Rg)e();isFinite(Lg)||(Lg=e.type===`visibilitychange`?e.timeStamp:0,removeEventListener(`prerenderingchange`,Bg,!0))}},Vg=()=>{if(Lg<0){var e;let t=Ng(),n=document.prerendering||(e=globalThis.performance.getEntriesByType(`visibility-state`).find(e=>e.name===`hidden`&&e.startTime>=t))==null?void 0:e.startTime;Lg=n==null?zg():n,addEventListener(`visibilitychange`,Bg,!0),addEventListener(`prerenderingchange`,Bg,!0),Ag(()=>{setTimeout(()=>{Lg=zg()})})}return{get firstHiddenTime(){return Lg},onHidden(e){Rg.add(e)}}},Hg=e=>{document.prerendering?addEventListener(`prerenderingchange`,e,!0):e()},Ug=[1800,3e3],Wg=(e,t={})=>{Hg(()=>{let n=Vg(),r,i=Pg(`FCP`),a=Fg(`paint`,e=>{for(let t of e)t.name===`first-contentful-paint`&&(a.disconnect(),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-Ng(),0),i.entries.push(t),r(!0)))});a&&(r=jg(e,i,Ug,t.reportAllChanges),Ag(n=>{i=Pg(`FCP`),r=jg(e,i,Ug,t.reportAllChanges),Mg(()=>{i.value=performance.now()-n.timeStamp,r(!0)})}))})},Gg=[.1,.25],Kg=e=>e.find(e=>{var t;return((t=e.node)==null?void 0:t.nodeType)===1})||e[0],qg=(e,t={})=>{let n=xg(t=Object.assign({},t),Sg),r=new WeakMap;n.t=e=>{var n;if(!(e==null||(n=e.sources)==null)&&n.length){let n=Kg(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?Eg(o):i;r.set(n,e)}}},((e,t={})=>{let n=Vg();Wg(Ig(()=>{let r,i=Pg(`CLS`,0),a=xg(t,Sg),o=e=>{for(let t of e)a.u(t);a.o>i.value&&(i.value=a.o,i.entries=a.i,r())},s=Fg(`layout-shift`,o);s&&(r=jg(e,i,Gg,t.reportAllChanges),n.onHidden(()=>{o(s.takeRecords()),r(!0)}),Ag(()=>{a.o=0,i=Pg(`CLS`,0),r=jg(e,i,Gg,t.reportAllChanges),Mg(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=Kg(i.sources);e&&(t={largestShiftTarget:r.get(e),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:e,largestShiftEntry:i,loadState:wg(i.startTime)})}}return Object.assign(e,{attribution:t})})(t))},t)},Jg=(e,t={})=>{Wg(t=>{e((e=>{let t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:wg(kg())};if(e.entries.length){let n=Cg(),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:wg(e.entries[0].startTime),navigationEntry:n,fcpEntry:r}}}return Object.assign(e,{attribution:t})})(t))},t)},Yg=0,Xg=1/0,Zg=0,Qg=e=>{for(let t of e)t.interactionId&&(Xg=Math.min(Xg,t.interactionId),Zg=Math.max(Zg,t.interactionId),Yg=Zg?(Zg-Xg)/7+1:0)},e_=()=>{var e;return $g?Yg:(e=performance.interactionCount)==null?0:e},t_=()=>{`interactionCount`in performance||$g||($g=Fg(`event`,Qg,{durationThreshold:0}))},n_=0,r_=class{constructor(){R(this,`l`,[]),R(this,`h`,new Map),R(this,`m`,void 0),R(this,`p`,void 0)}v(){n_=e_(),this.l.length=0,this.h.clear()}M(){let e=Math.min(this.l.length-1,Math.floor((e_()-n_)/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)}}},i_=e=>{let t=globalThis.requestIdleCallback||setTimeout,n=globalThis.cancelIdleCallback||clearTimeout;if(document.visibilityState===`hidden`)e();else{let r=Ig(e),i=-1,a=()=>{n(i),r()};addEventListener(`visibilitychange`,a,{once:!0,capture:!0}),i=t(()=>{removeEventListener(`visibilitychange`,a,{capture:!0}),r()})}},a_=[200,500],o_=(e,t={})=>{let n=xg(t=Object.assign({},t),r_),r=[],i=[],a=0,o=new WeakMap,s=new WeakMap,c=!1,l=()=>{c||(i_(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?Eg(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:wg(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})};Fg(`long-animation-frame`,e=>{r=r.concat(e),l()}),((e,t={})=>{if(!globalThis.PerformanceEventTiming||!(`interactionId`in PerformanceEventTiming.prototype))return;let n=Vg();Hg(()=>{var r;t_();let i,a=Pg(`INP`),o=xg(t,r_),s=e=>{i_(()=>{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=Fg(`event`,s,{durationThreshold:(r=t.durationThreshold)==null?40:r});i=jg(e,a,a_,t.reportAllChanges),c&&(c.observe({type:`first-input`,buffered:!0}),n.onHidden(()=>{s(c.takeRecords()),i(!0)}),Ag(()=>{o.v(),a=Pg(`INP`),i=jg(e,a,a_,t.reportAllChanges)}))})})(t=>{e(f(t))},t)},s_=class{constructor(){R(this,`m`,void 0)}u(e){var t;(t=this.m)==null||t.call(this,e)}},c_=[2500,4e3],l_=(e,t={})=>{let n=xg(t=Object.assign({},t),s_),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?Eg(n):i;r.set(e,o)}else e.id&&r.set(e,`#${e.id}`)},((e,t={})=>{Hg(()=>{let n=Vg(),r,i=Pg(`LCP`),a=xg(t,s_),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-Ng(),0),i.entries=[t],r())},s=Fg(`largest-contentful-paint`,o);if(s){r=jg(e,i,c_,t.reportAllChanges);let n=Ig(()=>{o(s.takeRecords()),s.disconnect(),r(!0)}),a=e=>{e.isTrusted&&(i_(n),removeEventListener(e.type,a,{capture:!0}))};for(let e of[`keydown`,`click`,`visibilitychange`])addEventListener(e,a,{capture:!0});Ag(n=>{i=Pg(`LCP`),r=jg(e,i,c_,t.reportAllChanges),Mg(()=>{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=Cg();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)},u_=[800,1800],d_=e=>{document.prerendering?Hg(()=>d_(e)):document.readyState===`complete`?setTimeout(e):addEventListener(`load`,()=>d_(e),!0)},f_=(e,t={})=>{((e,t={})=>{let n=Pg(`TTFB`),r=jg(e,n,u_,t.reportAllChanges);d_(()=>{let i=Cg();i&&(n.value=Math.max(i.responseStart-Ng(),0),n.entries=[i],r(!0),Ag(()=>{n=Pg(`TTFB`,0),r=jg(e,n,u_,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 m_=`unknown`,h_=e=>e?e.replace(/_/g,`-`):m_,g_=()=>{if(typeof performance>`u`)return m_;let e=performance.getEntriesByType(`navigation`)[0];return h_(e==null?void 0:e.type)},__=(e,t)=>{var n;return{"rum.navigation.type":(n=e.navigationType)==null?t:n,"web_vital.name":e.name,"web_vital.rating":e.rating}},v_=(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},y_=e=>{let t=!1;return{name:`web-vitals`,enabled:!!e,init(e){return G(function*(){if(typeof window>`u`)return;let n;try{n=yield Promise.resolve().then(()=>(p_(),bg))}catch(t){if(e.config.debug){var r;(r=globalThis.console)==null||r.warn(`[bk-ot] web-vitals load failed:`,t)}return}if(t)return;let{onCLS:i,onFCP:a,onINP:o,onLCP:s,onTTFB:c}=n,l=g_(),u=e.meter.createHistogram(`browser.web_vital.cls`,{unit:`1`,description:`Cumulative Layout Shift`}),d=e.meter.createHistogram(`browser.web_vital.duration`,{unit:`ms`,description:`Web Vitals duration metrics, including FCP, INP, LCP and TTFB`}),f=t=>{e.startSpan(`browser.web_vital`,J(J(J(J({},e.config.getPageAttributes()),e.config.getMetricAttributes()),__(t,l)),{},{"web_vital.id":t.id,"web_vital.value":t.value},v_(t,e.config.redactUrl))).end()},p=n=>{t||!Number.isFinite(n.value)||(d.record(n.value,e.applyRedact(J(J(J({},e.config.getPageAttributes()),e.config.getMetricAttributes()),__(n,l)))),f(n))};i(n=>{t||!Number.isFinite(n.value)||(u.record(n.value,e.applyRedact(J(J(J({},e.config.getPageAttributes()),e.config.getMetricAttributes()),__(n,l)))),f(n))}),a(p),o(p),s(p),c(p)})()},shutdown(){t=!0}}};I(),gn(),Y();var b_=64*1024,x_=6e4,S_=5,C_=e=>e==null?0:typeof e==`string`?e.length>b_||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,w_=(e,t)=>{let n={"network.protocol.name":`websocket`,"url.full":t(e)},r={"network.protocol.name":`websocket`};try{let t=new URL(e,typeof location>`u`?`http://localhost`:location.href);n[`server.address`]=t.host,n[`url.scheme`]=t.protocol.replace(`:`,``),r[`server.address`]=t.host,r[`url.scheme`]=n[`url.scheme`]}catch(e){}return{metricAttributes:r,spanAttributes:n}},T_=(e,t)=>{let{bytesCounter:n,connectDurationHistogram:r,context:i,errorCounter:a,errorThrottle:o,isDisposed:s,messageCounter:c,url:l}=t,{metricAttributes:u,spanAttributes:d}=w_(l,i.config.redactUrl),f=i.startSpan(`websocket.connect`,d),p=performance.now(),m=!1,h=e=>{if(m)return;m=!0;let t=performance.now()-p;e===`error`&&f.setStatus({code:xt.ERROR,message:`websocket connect failed`}),f.setAttribute(`websocket.connect.duration_ms`,t),f.end(),e===`opened`&&!s()&&r.record(t,u)};e.addEventListener(`open`,()=>{s()||h(`opened`)}),e.addEventListener(`message`,e=>{if(s())return;let t=J(J({},u),{},{"websocket.direction":`in`});c.add(1,t),n.add(C_(e.data),t)}),e.addEventListener(`error`,()=>{if(s())return;let e=m?`runtime`:`connect`;a.add(1,J(J({},u),{},{"websocket.error.phase":e})),h(`error`);let t=o.allow(`ws:error:${l}`);t.allowed&&i.emitLog({severityNumber:L.ERROR,severityText:`ERROR`,body:`websocket.error`,attributes:J(J({},d),{},{"websocket.error.phase":e,"websocket.error.window_count":t.count})})}),e.addEventListener(`close`,e=>{s()||(m||h(`error`),i.emitLog({severityNumber:L.INFO,severityText:`INFO`,body:`websocket.close`,attributes:J(J({},d),{},{"websocket.close.code":e.code,"websocket.close.reason":e.reason,"websocket.close.was_clean":e.wasClean})}))});let g=e.send.bind(e);e.send=e=>{if(!s()){let t=J(J({},u),{},{"websocket.direction":`out`});c.add(1,t),n.add(C_(e),t)}return g(e)}},E_=e=>{let t,n,r=!1;return{name:`websocket`,enabled:!!e,init(e){if(typeof window>`u`||window.WebSocket===void 0)return;let i=window.WebSocket;t=i;let a=e.meter.createCounter(`browser.websocket.message.count`,{description:`Total number of WebSocket messages observed`}),o=e.meter.createCounter(`browser.websocket.message.bytes`,{unit:`By`,description:`Total bytes transferred over WebSocket (best-effort)`}),s=e.meter.createCounter(`browser.websocket.error.count`,{description:`Total number of WebSocket error events`}),c=e.meter.createHistogram(`browser.websocket.connect.duration`,{unit:`ms`,description:`WebSocket connection establishment duration (only successful connects)`}),l=ih(x_,S_),u=()=>r;n=new Proxy(i,{construct(t,n,i){let d=Reflect.construct(t,n,i);if(r)return d;let f=n[0]==null?``:String(n[0]);return!f||sp(e.config,f)||T_(d,{bytesCounter:o,connectDurationHistogram:c,context:e,errorCounter:s,errorThrottle:l,isDisposed:u,messageCounter:a,url:f}),d}}),window.WebSocket=n},shutdown(){r=!0,typeof window<`u`&&t&&window.WebSocket===n&&(window.WebSocket=t),n=void 0,t=void 0}}};Y();var D_=`http://localhost:4318`,O_=60*1e3,k_=e=>e.replace(/\/+$/,``),A_=(e,t)=>{let n=k_(e||D_);return n.endsWith(`/v1/${t}`)?n:n.endsWith(`/v1`)?`${n}/${t}`:`${n}/v1/${t}`},j_=(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?k_(s):A_((a=o==null?void 0:o.endpoint)==null?e.endpoint:a,t),headers:c,timeoutMillis:o==null?void 0:o.timeoutMillis}},M_=e=>typeof e!=`number`||!Number.isFinite(e)?1:Math.max(0,Math.min(1,e)),N_=(e,t)=>typeof e==`number`&&Number.isFinite(e)&&e>0?e:t,P_=(e,t)=>typeof e==`number`&&Number.isFinite(e)&&e>=0?e:t,F_=(e,t)=>typeof e!=`number`||!Number.isFinite(e)?t:Math.max(0,Math.min(1,e)),I_=e=>e.body,L_=e=>{var t;return e?typeof e==`boolean`?{maxBodySize:10*1024,redact:I_}:{maxBodySize:N_(e.maxBodySize,10*1024),redact:(t=e.redact)==null?I_:t}:!1},R_=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:L_(e==null?void 0:e.httpBody),session:typeof(e==null?void 0:e.session)==`object`?J(J({},e.session),{},{inactivityMs:N_(e.session.inactivityMs,1800*1e3),maxLifetimeMs:N_(e.session.maxLifetimeMs,1440*60*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:N_(e.error.maxPerWindow,5),windowMs:N_(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:P_(e.blankScreen.checkDelay,3e3),threshold:F_(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:P_(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}},z_=e=>e,B_=e=>e,V_=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,ee,D;let te={"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:k_(e.endpoint||D_),traces:j_(e,`traces`),metrics:j_(e,`metrics`),logs:j_(e,`logs`),sampleRate:M_(e.sampleRate),spanProcessor:(a=e.spanProcessor)==null?`batch`:a,resourceAttributes:te,metricIntervalMillis:O_,instrumentations:(o=e.instrumentations)==null?[]:o,commonInstrumentations:{documentLoad:(s=(c=e.rum)==null?void 0:c.documentLoad)==null?!0:s,fetch:(l=(u=e.rum)==null?void 0:u.fetch)==null?!0:l,xhr:(d=(f=e.rum)==null?void 0:f.xhr)==null?!0:d,userInteraction:(p=(m=e.rum)==null?void 0:m.userInteraction)==null?!0:p},rum:R_(e.rum),plugins:(h=e.plugins)==null?[]:h,autoStart:(g=e.autoStart)==null?!0:g,getPageAttributes:(_=(v=e.attributes)==null?void 0:v.page)==null?(()=>({"rum.page.host":typeof window>`u`?``:window.location.host,"rum.page.path":typeof window>`u`?``:window.location.pathname})):_,getMetricAttributes:(y=(b=e.attributes)==null?void 0:b.metric)==null?(()=>({})):y,getErrorAttributes:(x=(S=e.attributes)==null?void 0:S.error)==null?(()=>({})):x,getCustomAttributes:(C=(w=e.attributes)==null?void 0:w.custom)==null?(()=>({})):C,redactAttributes:(T=(E=e.redact)==null?void 0:E.attributes)==null?z_:T,redactUrl:(ee=(D=e.redact)==null?void 0:D.url)==null?B_:ee})};z(),K();var H_=(e,t)=>typeof e.enabled==`function`?e.enabled(t):e.enabled!==!1,U_=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*(){for(let r of t.plugins)if(H_(r,e.config))try{yield r.init(e),t.startedPlugins.push(r)}catch(t){if(e.config.debug){var n;(n=globalThis.console)==null||n.warn(`[bk-ot] plugin "${r.name}" init failed:`,t)}}})()}},W_=[`http.url`,`url.full`],G_=e=>{for(let n of W_){var t;let r=(t=e.attributes)==null?void 0:t[n];if(typeof r==`string`)return r}},K_=class{constructor(e,t){this.inner=e,this.config=t}forceFlush(){return this.inner.forceFlush()}onEnd(e){let t=G_(e);t&&op(this.config,t)||this.inner.onEnd(e)}onStart(e,t){this.inner.onStart(e,t)}shutdown(){return this.inner.shutdown()}},q_=`__bk_ot_sampled__`,J_=new Map,Y_=e=>J_.get(e),X_=(e,t)=>(J_.set(e,t),t),Z_=({sampleRate:e})=>{if(e<=0)return!1;if(e>=1)return!0;try{let t=sessionStorage.getItem(q_);if(t)return t===`1`;let n=Math.random()<e;return sessionStorage.setItem(q_,n?`1`:`0`),X_(q_,n),n}catch(t){let n=Y_(q_);return typeof n==`boolean`?n:X_(q_,Math.random()<e)}};I(),gn(),W(),Ju(),ac(),yf(),Gf(),z(),Y(),K();var Q_=e=>({url:e.endpoint,headers:e.headers,concurrencyLimit:e.concurrencyLimit,timeoutMillis:e.timeoutMillis}),$_=`bk-rum`,ev=(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,tv=e=>[nh(e.commonInstrumentations)],nv=e=>[bh(e.rum.device),Uh(e.rum.httpBody),yg(e.rum.session),ag(e.rum.pageView),Eh(e.rum.error),y_(e.rum.webVitals),ep(e.rum.blankScreen),E_(e.rum.websocket),Gh(e.rum.longTask),lh(e.rum.cspViolation),og(e.rum.routeTiming)],rv=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={},n)=>this.tracer.startSpan(e,{kind:yt.INTERNAL,startTime:n==null?void 0:n.startTime,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=V_(e),this.sampled=this.config.enabled&&Z_(this.config);let n=Qs(this.config.resourceAttributes),r=ev(new Eu(Q_(this.config.traces)),`traces`,this.config.debug),i=ev(new Tu(Q_(this.config.metrics)),`metrics`,this.config.debug),a=ev(new hu(Q_(this.config.logs)),`logs`,this.config.debug),o=new K_(this.config.spanProcessor===`simple`?new _f(r):new Bd(r,this.config.spanBatch),this.config),s=new Ks({exporter:i,exportIntervalMillis:this.config.metricIntervalMillis}),c=new pd(a);this.tracerProvider=new wf({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($_),this.meter=this.meterProvider.getMeter($_),this.logger=this.loggerProvider.getLogger($_),this.runtimeAttributes={"bk.rum.sampled":this.sampled},this.registeredInstrumentations=this.config.enabled?[...this.config.instrumentations]:[],this.plugins=[...this.config.enabled?tv(this.config):[],...this.sampled?[...nv(this.config),...this.config.plugins]:[]],this.pluginManager=new U_(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:rv}),rv})();
|