@vercel/otel 1.8.3 → 1.8.4
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/dist/edge/index.js +1 -1
- package/dist/edge/index.js.map +2 -2
- package/dist/node/index.js +1 -1
- package/dist/node/index.js.map +2 -2
- package/package.json +1 -1
package/dist/node/index.js
CHANGED
|
@@ -17,5 +17,5 @@ var bp=Object.create;var vs=Object.defineProperty;var Pp=Object.getOwnPropertyDe
|
|
|
17
17
|
To resolve the conflict:`,(0,Qi.getConflictResolutionRecipe)(s,e))),n=i):P_.diag.warn("A view or instrument with the name ",e.name,` has already been registered and is incompatible with another registered view.
|
|
18
18
|
`,`Details:
|
|
19
19
|
`,(0,Qi.getIncompatibilityDetails)(s,e),`To resolve the conflict:
|
|
20
|
-
`,(0,Qi.getConflictResolutionRecipe)(s,e))}return n}};Zi.MetricStorageRegistry=eu});var v_=c(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.MultiMetricStorage=void 0;var tu=class{constructor(e){this._backingStorages=e}record(e,t,n,i){this._backingStorages.forEach(s=>{s.record(e,t,n,i)})}};Ji.MultiMetricStorage=tu});var L_=c(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.BatchObservableResultImpl=Qt.ObservableResultImpl=void 0;var Yt=(h(),f(d)),I_=Mr(),HT=ki(),ru=class{constructor(e,t){this._instrumentName=e,this._valueType=t,this._buffer=new I_.AttributeHashMap}observe(e,t={}){if(typeof e!="number"){Yt.diag.warn(`non-number value provided to metric ${this._instrumentName}: ${e}`);return}this._valueType===Yt.ValueType.INT&&!Number.isInteger(e)&&(Yt.diag.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)}};Qt.ObservableResultImpl=ru;var nu=class{constructor(){this._buffer=new Map}observe(e,t,n={}){if(!(0,HT.isObservableInstrument)(e))return;let i=this._buffer.get(e);if(i==null&&(i=new I_.AttributeHashMap,this._buffer.set(e,i)),typeof t!="number"){Yt.diag.warn(`non-number value provided to metric ${e._descriptor.name}: ${t}`);return}e._descriptor.valueType===Yt.ValueType.INT&&!Number.isInteger(t)&&(Yt.diag.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))||i.set(n,t)}};Qt.BatchObservableResultImpl=nu});var N_=c(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.ObservableRegistry=void 0;var kT=(h(),f(d)),M_=ki(),C_=L_(),Cr=me(),iu=class{constructor(){this._callbacks=[],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(M_.isObservableInstrument));if(n.size===0){kT.diag.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(M_.isObservableInstrument)),i=this._findBatchCallback(e,n);i<0||this._batchCallbacks.splice(i,1)}async observe(e,t){let n=this._observeCallbacks(e,t),i=this._observeBatchCallbacks(e,t);return(await(0,Cr.PromiseAllSettled)([...n,...i])).filter(Cr.isPromiseAllSettledRejectionResult).map(a=>a.reason)}_observeCallbacks(e,t){return this._callbacks.map(async({callback:n,instrument:i})=>{let s=new C_.ObservableResultImpl(i._descriptor.name,i._descriptor.valueType),o=Promise.resolve(n(s));t!=null&&(o=(0,Cr.callWithTimeout)(o,t)),await o,i._metricStorages.forEach(a=>{a.record(s._buffer,e)})})}_observeBatchCallbacks(e,t){return this._batchCallbacks.map(async({callback:n,instruments:i})=>{let s=new C_.BatchObservableResultImpl,o=Promise.resolve(n(s));t!=null&&(o=(0,Cr.callWithTimeout)(o,t)),await o,i.forEach(a=>{let u=s._buffer.get(a);u!=null&&a._metricStorages.forEach(l=>{l.record(u,e)})})})}_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&&(0,Cr.setEquals)(n.instruments,t))}};es.ObservableRegistry=iu});var w_=c(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.SyncMetricStorage=void 0;var XT=$a(),$T=Ya(),WT=Za(),su=class extends XT.MetricStorage{constructor(e,t,n,i){super(e),this._attributesProcessor=n,this._deltaMetricStorage=new $T.DeltaMetricProcessor(t),this._temporalMetricStorage=new WT.TemporalMetricProcessor(t,i)}record(e,t,n,i){t=this._attributesProcessor.process(t,n),this._deltaMetricStorage.record(e,t,n,i)}collect(e,t){let n=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,n,t)}};ts.SyncMetricStorage=su});var au=c(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.FilteringAttributesProcessor=xe.NoopAttributesProcessor=xe.AttributesProcessor=void 0;var Nr=class{static Noop(){return KT}};xe.AttributesProcessor=Nr;var rs=class extends Nr{process(e,t){return e}};xe.NoopAttributesProcessor=rs;var ou=class extends Nr{constructor(e){super(),this._allowedAttributeNames=e}process(e,t){let n={};return Object.keys(e).filter(i=>this._allowedAttributeNames.includes(i)).forEach(i=>n[i]=e[i]),n}};xe.FilteringAttributesProcessor=ou;var KT=new rs});var x_=c(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.MeterSharedState=void 0;var zT=Oe(),YT=g_(),QT=me(),ZT=T_(),JT=y_(),eS=v_(),tS=N_(),rS=w_(),nS=au(),uu=class{constructor(e,t){this._meterProviderSharedState=e,this._instrumentationScope=t,this.metricStorageRegistry=new JT.MetricStorageRegistry,this.observableRegistry=new tS.ObservableRegistry,this.meter=new YT.Meter(this)}registerMetricStorage(e){let t=this._registerMetricStorage(e,rS.SyncMetricStorage);return t.length===1?t[0]:new eS.MultiMetricStorage(t)}registerAsyncMetricStorage(e){return this._registerMetricStorage(e,ZT.AsyncMetricStorage)}async collect(e,t,n){let i=await this.observableRegistry.observe(t,n?.timeoutMillis),s=this.metricStorageRegistry.getStorages(e);if(s.length===0)return null;let o=s.map(a=>a.collect(e,t)).filter(QT.isNotNullish);return o.length===0?{errors:i}:{scopeMetrics:{scope:this._instrumentationScope,metrics:o},errors:i}}_registerMetricStorage(e,t){let i=this._meterProviderSharedState.viewRegistry.findViews(e,this._instrumentationScope).map(s=>{let o=(0,zT.createInstrumentDescriptorWithView)(s,e),a=this.metricStorageRegistry.findOrUpdateCompatibleStorage(o);if(a!=null)return a;let u=s.aggregation.createAggregator(o),l=new t(o,u,s.attributesProcessor,this._meterProviderSharedState.metricCollectors);return this.metricStorageRegistry.register(l),l});if(i.length===0){let o=this._meterProviderSharedState.selectAggregations(e.type).map(([a,u])=>{let l=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(a,e);if(l!=null)return l;let _=u.createAggregator(e),E=new t(e,_,nS.AttributesProcessor.Noop(),[a]);return this.metricStorageRegistry.registerForCollector(a,E),E});i=i.concat(o)}return i}};ns.MeterSharedState=uu});var D_=c(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.MeterProviderSharedState=void 0;var iS=me(),sS=m_(),oS=x_(),cu=class{constructor(e){this.resource=e,this.viewRegistry=new sS.ViewRegistry,this.metricCollectors=[],this.meterSharedStates=new Map}getMeterSharedState(e){let t=(0,iS.instrumentationScopeId)(e),n=this.meterSharedStates.get(t);return n==null&&(n=new oS.MeterSharedState(this,e),this.meterSharedStates.set(t,n)),n}selectAggregations(e){let t=[];for(let n of this.metricCollectors)t.push([n,n.selectAggregation(e)]);return t}};is.MeterProviderSharedState=cu});var B_=c(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.MetricCollector=void 0;var aS=S(),lu=class{constructor(e,t){this._sharedState=e,this._metricReader=t}async collect(e){let t=(0,aS.millisToHrTime)(Date.now()),n=[],i=[],s=Array.from(this._sharedState.meterSharedStates.values()).map(async o=>{let a=await o.collect(this,t,e);a?.scopeMetrics!=null&&n.push(a.scopeMetrics),a?.errors!=null&&i.push(...a.errors)});return await Promise.all(s),{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:n},errors:i}}async forceFlush(e){await this._metricReader.forceFlush(e)}async shutdown(e){await this._metricReader.shutdown(e)}selectAggregationTemporality(e){return this._metricReader.selectAggregationTemporality(e)}selectAggregation(e){return this._metricReader.selectAggregation(e)}};ss.MetricCollector=lu});var q_=c(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.MeterProvider=void 0;var os=(h(),f(d)),U_=tt(),uS=D_(),cS=B_(),du=class{constructor(e){var t;this._shutdown=!1;let n=U_.Resource.default().merge((t=e?.resource)!==null&&t!==void 0?t:U_.Resource.empty());if(this._sharedState=new uS.MeterProviderSharedState(n),e?.views!=null&&e.views.length>0)for(let i of e.views)this._sharedState.viewRegistry.addView(i)}getMeter(e,t="",n={}){return this._shutdown?(os.diag.warn("A shutdown MeterProvider cannot provide a Meter"),(0,os.createNoopMeter)()):this._sharedState.getMeterSharedState({name:e,version:t,schemaUrl:n.schemaUrl}).meter}addMetricReader(e){let t=new cS.MetricCollector(this._sharedState,e);e.setMetricProducer(t),this._sharedState.metricCollectors.push(t)}async shutdown(e){if(this._shutdown){os.diag.warn("shutdown may only be called once per MeterProvider");return}this._shutdown=!0,await Promise.all(this._sharedState.metricCollectors.map(t=>t.shutdown(e)))}async forceFlush(e){if(this._shutdown){os.diag.warn("invalid attempt to force flush after MeterProvider shutdown");return}await Promise.all(this._sharedState.metricCollectors.map(t=>t.forceFlush(e)))}};as.MeterProvider=du});var us=c(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.ExactPredicate=Zt.PatternPredicate=void 0;var lS=/[\^$\\.+?()[\]{}|]/g,_u=class r{constructor(e){e==="*"?(this._matchAll=!0,this._regexp=/.*/):(this._matchAll=!1,this._regexp=new RegExp(r.escapePattern(e)))}match(e){return this._matchAll?!0:this._regexp.test(e)}static escapePattern(e){return`^${e.replace(lS,"\\$&").replace("*",".*")}$`}static hasWildcard(e){return e.includes("*")}};Zt.PatternPredicate=_u;var hu=class{constructor(e){this._matchAll=e===void 0,this._pattern=e}match(e){return!!(this._matchAll||e===this._pattern)}};Zt.ExactPredicate=hu});var V_=c(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.InstrumentSelector=void 0;var G_=us(),pu=class{constructor(e){var t;this._nameFilter=new G_.PatternPredicate((t=e?.name)!==null&&t!==void 0?t:"*"),this._type=e?.type,this._unitFilter=new G_.ExactPredicate(e?.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}};cs.InstrumentSelector=pu});var j_=c(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.MeterSelector=void 0;var fu=us(),Eu=class{constructor(e){this._nameFilter=new fu.ExactPredicate(e?.name),this._versionFilter=new fu.ExactPredicate(e?.version),this._schemaUrlFilter=new fu.ExactPredicate(e?.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}};ls.MeterSelector=Eu});var H_=c(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.View=void 0;var dS=us(),F_=au(),_S=V_(),hS=j_(),pS=Bi();function fS(r){return r.instrumentName==null&&r.instrumentType==null&&r.instrumentUnit==null&&r.meterName==null&&r.meterVersion==null&&r.meterSchemaUrl==null}var mu=class{constructor(e){var t;if(fS(e))throw new Error("Cannot create view with no selector arguments supplied");if(e.name!=null&&(e?.instrumentName==null||dS.PatternPredicate.hasWildcard(e.instrumentName)))throw new Error("Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter.");e.attributeKeys!=null?this.attributesProcessor=new F_.FilteringAttributesProcessor(e.attributeKeys):this.attributesProcessor=F_.AttributesProcessor.Noop(),this.name=e.name,this.description=e.description,this.aggregation=(t=e.aggregation)!==null&&t!==void 0?t:pS.Aggregation.Default(),this.instrumentSelector=new _S.InstrumentSelector({name:e.instrumentName,type:e.instrumentType,unit:e.instrumentUnit}),this.meterSelector=new hS.MeterSelector({name:e.meterName,version:e.meterVersion,schemaUrl:e.meterSchemaUrl})}};ds.View=mu});var k_=c(g=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0});g.TimeoutError=g.View=g.Aggregation=g.SumAggregation=g.LastValueAggregation=g.HistogramAggregation=g.DropAggregation=g.ExponentialHistogramAggregation=g.ExplicitBucketHistogramAggregation=g.DefaultAggregation=g.MeterProvider=g.InstrumentType=g.ConsoleMetricExporter=g.InMemoryMetricExporter=g.PeriodicExportingMetricReader=g.MetricReader=g.DataPointType=g.AggregationTemporality=void 0;var ES=Oi();Object.defineProperty(g,"AggregationTemporality",{enumerable:!0,get:function(){return ES.AggregationTemporality}});var mS=Nt();Object.defineProperty(g,"DataPointType",{enumerable:!0,get:function(){return mS.DataPointType}});var gS=wa();Object.defineProperty(g,"MetricReader",{enumerable:!0,get:function(){return gS.MetricReader}});var TS=__();Object.defineProperty(g,"PeriodicExportingMetricReader",{enumerable:!0,get:function(){return TS.PeriodicExportingMetricReader}});var SS=p_();Object.defineProperty(g,"InMemoryMetricExporter",{enumerable:!0,get:function(){return SS.InMemoryMetricExporter}});var AS=E_();Object.defineProperty(g,"ConsoleMetricExporter",{enumerable:!0,get:function(){return AS.ConsoleMetricExporter}});var OS=Oe();Object.defineProperty(g,"InstrumentType",{enumerable:!0,get:function(){return OS.InstrumentType}});var RS=q_();Object.defineProperty(g,"MeterProvider",{enumerable:!0,get:function(){return RS.MeterProvider}});var De=Bi();Object.defineProperty(g,"DefaultAggregation",{enumerable:!0,get:function(){return De.DefaultAggregation}});Object.defineProperty(g,"ExplicitBucketHistogramAggregation",{enumerable:!0,get:function(){return De.ExplicitBucketHistogramAggregation}});Object.defineProperty(g,"ExponentialHistogramAggregation",{enumerable:!0,get:function(){return De.ExponentialHistogramAggregation}});Object.defineProperty(g,"DropAggregation",{enumerable:!0,get:function(){return De.DropAggregation}});Object.defineProperty(g,"HistogramAggregation",{enumerable:!0,get:function(){return De.HistogramAggregation}});Object.defineProperty(g,"LastValueAggregation",{enumerable:!0,get:function(){return De.LastValueAggregation}});Object.defineProperty(g,"SumAggregation",{enumerable:!0,get:function(){return De.SumAggregation}});Object.defineProperty(g,"Aggregation",{enumerable:!0,get:function(){return De.Aggregation}});var bS=H_();Object.defineProperty(g,"View",{enumerable:!0,get:function(){return bS.View}});var PS=me();Object.defineProperty(g,"TimeoutError",{enumerable:!0,get:function(){return PS.TimeoutError}})});var X_=c(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.AbstractAsyncHooksContextManager=void 0;var yS=J("events"),vS=["addListener","on","once","prependListener","prependOnceListener"],gu=class{constructor(){this._kOtListeners=Symbol("OtListeners"),this._wrapped=!1}bind(e,t){return t instanceof yS.EventEmitter?this._bindEventEmitter(e,t):typeof t=="function"?this._bindFunction(e,t):t}_bindFunction(e,t){let n=this,i=function(...s){return n.with(e,()=>t.apply(this,s))};return Object.defineProperty(i,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),i}_bindEventEmitter(e,t){return this._getPatchMap(t)!==void 0||(this._createPatchMap(t),vS.forEach(i=>{t[i]!==void 0&&(t[i]=this._patchAddListener(t,t[i],e))}),typeof t.removeListener=="function"&&(t.removeListener=this._patchRemoveListener(t,t.removeListener)),typeof t.off=="function"&&(t.off=this._patchRemoveListener(t,t.off)),typeof t.removeAllListeners=="function"&&(t.removeAllListeners=this._patchRemoveAllListeners(t,t.removeAllListeners))),t}_patchRemoveListener(e,t){let n=this;return function(i,s){var o;let a=(o=n._getPatchMap(e))===null||o===void 0?void 0:o[i];if(a===void 0)return t.call(this,i,s);let u=a.get(s);return t.call(this,i,u||s)}}_patchRemoveAllListeners(e,t){let n=this;return function(i){let s=n._getPatchMap(e);return s!==void 0&&(arguments.length===0?n._createPatchMap(e):s[i]!==void 0&&delete s[i]),t.apply(this,arguments)}}_patchAddListener(e,t,n){let i=this;return function(s,o){if(i._wrapped)return t.call(this,s,o);let a=i._getPatchMap(e);a===void 0&&(a=i._createPatchMap(e));let u=a[s];u===void 0&&(u=new WeakMap,a[s]=u);let l=i.bind(n,o);u.set(o,l),i._wrapped=!0;try{return t.call(this,s,l)}finally{i._wrapped=!1}}}_createPatchMap(e){let t=Object.create(null);return e[this._kOtListeners]=t,t}_getPatchMap(e){return e[this._kOtListeners]}};_s.AbstractAsyncHooksContextManager=gu});var $_=c(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});hs.AsyncLocalStorageContextManager=void 0;var IS=(h(),f(d)),LS=J("async_hooks"),MS=X_(),Tu=class extends MS.AbstractAsyncHooksContextManager{constructor(){super(),this._asyncLocalStorage=new LS.AsyncLocalStorage}active(){var e;return(e=this._asyncLocalStorage.getStore())!==null&&e!==void 0?e:IS.ROOT_CONTEXT}with(e,t,n,...i){let s=n==null?t:t.bind(n);return this._asyncLocalStorage.run(e,s,...i)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}};hs.AsyncLocalStorageContextManager=Tu});var Ru=c(Be=>{"use strict";Object.defineProperty(Be,"__esModule",{value:!0});Be.toAnyValue=Be.toKeyValue=Be.toAttributes=void 0;function BS(r){return Object.keys(r).map(e=>Au(e,r[e]))}Be.toAttributes=BS;function Au(r,e){return{key:r,value:Ou(e)}}Be.toKeyValue=Au;function Ou(r){let e=typeof r;return e==="string"?{stringValue:r}:e==="number"?Number.isInteger(r)?{intValue:r}:{doubleValue:r}:e==="boolean"?{boolValue:r}:r instanceof Uint8Array?{bytesValue:r}:Array.isArray(r)?{arrayValue:{values:r.map(Ou)}}:e==="object"&&r!=null?{kvlistValue:{values:Object.entries(r).map(([t,n])=>Au(t,n))}}:{}}Be.toAnyValue=Ou});var Z_=c(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.toOtlpSpanEvent=Ue.toOtlpLink=Ue.sdkSpanToOtlpSpan=void 0;var bu=Ru();function US(r,e){var t;let n=r.spanContext(),i=r.status;return{traceId:e.encodeSpanContext(n.traceId),spanId:e.encodeSpanContext(n.spanId),parentSpanId:e.encodeOptionalSpanContext(r.parentSpanId),traceState:(t=n.traceState)===null||t===void 0?void 0:t.serialize(),name:r.name,kind:r.kind==null?0:r.kind+1,startTimeUnixNano:e.encodeHrTime(r.startTime),endTimeUnixNano:e.encodeHrTime(r.endTime),attributes:(0,bu.toAttributes)(r.attributes),droppedAttributesCount:r.droppedAttributesCount,events:r.events.map(s=>Q_(s,e)),droppedEventsCount:r.droppedEventsCount,status:{code:i.code,message:i.message},links:r.links.map(s=>Y_(s,e)),droppedLinksCount:r.droppedLinksCount}}Ue.sdkSpanToOtlpSpan=US;function Y_(r,e){var t;return{attributes:r.attributes?(0,bu.toAttributes)(r.attributes):[],spanId:e.encodeSpanContext(r.context.spanId),traceId:e.encodeSpanContext(r.context.traceId),traceState:(t=r.context.traceState)===null||t===void 0?void 0:t.serialize(),droppedAttributesCount:r.droppedAttributesCount||0}}Ue.toOtlpLink=Y_;function Q_(r,e){return{attributes:r.attributes?(0,bu.toAttributes)(r.attributes):[],name:r.name,timeUnixNano:e.encodeHrTime(r.time),droppedAttributesCount:r.droppedAttributesCount||0}}Ue.toOtlpSpanEvent=Q_});var nh=c(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.getOtlpEncoder=oe.encodeAsString=oe.encodeAsLongBits=oe.toLongBits=oe.hrTimeToNanos=void 0;var Es=S(),qS=BigInt(1e9);function Pu(r){return BigInt(r[0])*qS+BigInt(r[1])}oe.hrTimeToNanos=Pu;function eh(r){let e=Number(BigInt.asUintN(32,r)),t=Number(BigInt.asUintN(32,r>>BigInt(32)));return{low:e,high:t}}oe.toLongBits=eh;function yu(r){let e=Pu(r);return eh(e)}oe.encodeAsLongBits=yu;function th(r){return Pu(r).toString()}oe.encodeAsString=th;var GS=typeof BigInt<"u"?th:Es.hrTimeToNanoseconds;function J_(r){return r}function rh(r){if(r!==void 0)return(0,Es.hexToBase64)(r)}var VS={encodeHrTime:yu,encodeSpanContext:Es.hexToBase64,encodeOptionalSpanContext:rh};function jS(r){var e,t;if(r===void 0)return VS;let n=(e=r.useLongBits)!==null&&e!==void 0?e:!0,i=(t=r.useHex)!==null&&t!==void 0?t:!1;return{encodeHrTime:n?yu:GS,encodeSpanContext:i?J_:Es.hexToBase64,encodeOptionalSpanContext:i?J_:rh}}oe.getOtlpEncoder=jS});var vu=c(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.createExportTraceServiceRequest=void 0;var FS=Ru(),HS=Z_(),kS=nh();function XS(r,e){let t=(0,kS.getOtlpEncoder)(e);return{resourceSpans:WS(r,t)}}ms.createExportTraceServiceRequest=XS;function $S(r){let e=new Map;for(let t of r){let n=e.get(t.resource);n||(n=new Map,e.set(t.resource,n));let i=`${t.instrumentationLibrary.name}@${t.instrumentationLibrary.version||""}:${t.instrumentationLibrary.schemaUrl||""}`,s=n.get(i);s||(s=[],n.set(i,s)),s.push(t)}return e}function WS(r,e){let t=$S(r),n=[],i=t.entries(),s=i.next();for(;!s.done;){let[o,a]=s.value,u=[],l=a.values(),_=l.next();for(;!_.done;){let O=_.value;if(O.length>0){let{name:D,version:z,schemaUrl:I}=O[0].instrumentationLibrary,U=O.map(L=>(0,HS.sdkSpanToOtlpSpan)(L,e));u.push({scope:{name:D,version:z},spans:U,schemaUrl:I})}_=l.next()}let E={resource:{attributes:(0,FS.toAttributes)(o.attributes),droppedAttributesCount:0},scopeSpans:u,schemaUrl:void 0};n.push(E),s=i.next()}return n}});var oh=c(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.parseRetryAfterToMills=C.isExportRetryable=C.invalidTimeout=C.configureExporterTimeout=C.appendRootPathToUrlIfNeeded=C.appendResourcePathToUrl=C.parseHeaders=C.DEFAULT_EXPORT_BACKOFF_MULTIPLIER=C.DEFAULT_EXPORT_MAX_BACKOFF=C.DEFAULT_EXPORT_INITIAL_BACKOFF=C.DEFAULT_EXPORT_MAX_ATTEMPTS=void 0;var Iu=(h(),f(d)),ih=S(),sh=1e4;C.DEFAULT_EXPORT_MAX_ATTEMPTS=5;C.DEFAULT_EXPORT_INITIAL_BACKOFF=1e3;C.DEFAULT_EXPORT_MAX_BACKOFF=5e3;C.DEFAULT_EXPORT_BACKOFF_MULTIPLIER=1.5;function KS(r={}){let e={};return Object.entries(r).forEach(([t,n])=>{typeof n<"u"?e[t]=String(n):Iu.diag.warn(`Header "${t}" has wrong value and will be ignored`)}),e}C.parseHeaders=KS;function zS(r,e){return r.endsWith("/")||(r=r+"/"),r+e}C.appendResourcePathToUrl=zS;function YS(r){try{let e=new URL(r);return e.pathname===""&&(e.pathname=e.pathname+"/"),e.toString()}catch{return Iu.diag.warn(`Could not parse export URL: '${r}'`),r}}C.appendRootPathToUrlIfNeeded=YS;function QS(r){return typeof r=="number"?r<=0?Lu(r,sh):r:ZS()}C.configureExporterTimeout=QS;function ZS(){var r;let e=Number((r=(0,ih.getEnv)().OTEL_EXPORTER_OTLP_TRACES_TIMEOUT)!==null&&r!==void 0?r:(0,ih.getEnv)().OTEL_EXPORTER_OTLP_TIMEOUT);return e<=0?Lu(e,sh):e}function Lu(r,e){return Iu.diag.warn("Timeout must be greater than 0",r),e}C.invalidTimeout=Lu;function JS(r){return[429,502,503,504].includes(r)}C.isExportRetryable=JS;function eA(r){if(r==null)return-1;let e=Number.parseInt(r,10);if(Number.isInteger(e))return e>0?e*1e3:-1;let t=new Date(r).getTime()-Date.now();return t>=0?t:0}C.parseRetryAfterToMills=eA});var uh=c(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.OTLPExporterBase=void 0;var ah=(h(),f(d)),xr=S(),tA=oh(),Mu=class{constructor(e={}){this._sendingPromises=[],this.url=this.getDefaultUrl(e),typeof e.hostname=="string"&&(this.hostname=e.hostname),this.shutdown=this.shutdown.bind(this),this._shutdownOnce=new xr.BindOnceFuture(this._shutdown,this),this._concurrencyLimit=typeof e.concurrencyLimit=="number"?e.concurrencyLimit:30,this.timeoutMillis=(0,tA.configureExporterTimeout)(e.timeoutMillis),this.onInit(e)}export(e,t){if(this._shutdownOnce.isCalled){t({code:xr.ExportResultCode.FAILED,error:new Error("Exporter has been shutdown")});return}if(this._sendingPromises.length>=this._concurrencyLimit){t({code:xr.ExportResultCode.FAILED,error:new Error("Concurrent export limit reached")});return}this._export(e).then(()=>{t({code:xr.ExportResultCode.SUCCESS})}).catch(n=>{t({code:xr.ExportResultCode.FAILED,error:n})})}_export(e){return new Promise((t,n)=>{try{ah.diag.debug("items to be sent",e),this.send(e,t,n)}catch(i){n(i)}})}shutdown(){return this._shutdownOnce.call()}forceFlush(){return Promise.all(this._sendingPromises).then(()=>{})}_shutdown(){return ah.diag.debug("shutdown started"),this.onShutdown(),this.forceFlush()}};gs.OTLPExporterBase=Mu});var _h=c((AP,dh)=>{"use strict";dh.exports=iA;function iA(r,e){for(var t=new Array(arguments.length-1),n=0,i=2,s=!0;i<arguments.length;)t[n++]=arguments[i++];return new Promise(function(a,u){t[n]=function(_){if(s)if(s=!1,_)u(_);else{for(var E=new Array(arguments.length-1),O=0;O<E.length;)E[O++]=arguments[O];a.apply(null,E)}};try{r.apply(e||null,t)}catch(l){s&&(s=!1,u(l))}})}});var Eh=c(fh=>{"use strict";var Ss=fh;Ss.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&e.charAt(t)==="=";)++n;return Math.ceil(e.length*3)/4-n};var rr=new Array(64),ph=new Array(123);for(le=0;le<64;)ph[rr[le]=le<26?le+65:le<52?le+71:le<62?le-4:le-59|43]=le++;var le;Ss.encode=function(e,t,n){for(var i=null,s=[],o=0,a=0,u;t<n;){var l=e[t++];switch(a){case 0:s[o++]=rr[l>>2],u=(l&3)<<4,a=1;break;case 1:s[o++]=rr[u|l>>4],u=(l&15)<<2,a=2;break;case 2:s[o++]=rr[u|l>>6],s[o++]=rr[l&63],a=0;break}o>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,s)),o=0)}return a&&(s[o++]=rr[u],s[o++]=61,a===1&&(s[o++]=61)),i?(o&&i.push(String.fromCharCode.apply(String,s.slice(0,o))),i.join("")):String.fromCharCode.apply(String,s.slice(0,o))};var hh="invalid encoding";Ss.decode=function(e,t,n){for(var i=n,s=0,o,a=0;a<e.length;){var u=e.charCodeAt(a++);if(u===61&&s>1)break;if((u=ph[u])===void 0)throw Error(hh);switch(s){case 0:o=u,s=1;break;case 1:t[n++]=o<<2|(u&48)>>4,o=u,s=2;break;case 2:t[n++]=(o&15)<<4|(u&60)>>2,o=u,s=3;break;case 3:t[n++]=(o&3)<<6|u,s=0;break}}if(s===1)throw Error(hh);return n-i};Ss.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}});var gh=c((RP,mh)=>{"use strict";mh.exports=As;function As(){this._listeners={}}As.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this};As.prototype.off=function(e,t){if(e===void 0)this._listeners={};else if(t===void 0)this._listeners[e]=[];else for(var n=this._listeners[e],i=0;i<n.length;)n[i].fn===t?n.splice(i,1):++i;return this};As.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],i=1;i<arguments.length;)n.push(arguments[i++]);for(i=0;i<t.length;)t[i].fn.apply(t[i++].ctx,n)}return this}});var Ph=c((bP,bh)=>{"use strict";bh.exports=Th(Th);function Th(r){return typeof Float32Array<"u"?function(){var e=new Float32Array([-0]),t=new Uint8Array(e.buffer),n=t[3]===128;function i(u,l,_){e[0]=u,l[_]=t[0],l[_+1]=t[1],l[_+2]=t[2],l[_+3]=t[3]}function s(u,l,_){e[0]=u,l[_]=t[3],l[_+1]=t[2],l[_+2]=t[1],l[_+3]=t[0]}r.writeFloatLE=n?i:s,r.writeFloatBE=n?s:i;function o(u,l){return t[0]=u[l],t[1]=u[l+1],t[2]=u[l+2],t[3]=u[l+3],e[0]}function a(u,l){return t[3]=u[l],t[2]=u[l+1],t[1]=u[l+2],t[0]=u[l+3],e[0]}r.readFloatLE=n?o:a,r.readFloatBE=n?a:o}():function(){function e(n,i,s,o){var a=i<0?1:0;if(a&&(i=-i),i===0)n(1/i>0?0:2147483648,s,o);else if(isNaN(i))n(2143289344,s,o);else if(i>34028234663852886e22)n((a<<31|2139095040)>>>0,s,o);else if(i<11754943508222875e-54)n((a<<31|Math.round(i/1401298464324817e-60))>>>0,s,o);else{var u=Math.floor(Math.log(i)/Math.LN2),l=Math.round(i*Math.pow(2,-u)*8388608)&8388607;n((a<<31|u+127<<23|l)>>>0,s,o)}}r.writeFloatLE=e.bind(null,Sh),r.writeFloatBE=e.bind(null,Ah);function t(n,i,s){var o=n(i,s),a=(o>>31)*2+1,u=o>>>23&255,l=o&8388607;return u===255?l?NaN:a*(1/0):u===0?a*1401298464324817e-60*l:a*Math.pow(2,u-150)*(l+8388608)}r.readFloatLE=t.bind(null,Oh),r.readFloatBE=t.bind(null,Rh)}(),typeof Float64Array<"u"?function(){var e=new Float64Array([-0]),t=new Uint8Array(e.buffer),n=t[7]===128;function i(u,l,_){e[0]=u,l[_]=t[0],l[_+1]=t[1],l[_+2]=t[2],l[_+3]=t[3],l[_+4]=t[4],l[_+5]=t[5],l[_+6]=t[6],l[_+7]=t[7]}function s(u,l,_){e[0]=u,l[_]=t[7],l[_+1]=t[6],l[_+2]=t[5],l[_+3]=t[4],l[_+4]=t[3],l[_+5]=t[2],l[_+6]=t[1],l[_+7]=t[0]}r.writeDoubleLE=n?i:s,r.writeDoubleBE=n?s:i;function o(u,l){return t[0]=u[l],t[1]=u[l+1],t[2]=u[l+2],t[3]=u[l+3],t[4]=u[l+4],t[5]=u[l+5],t[6]=u[l+6],t[7]=u[l+7],e[0]}function a(u,l){return t[7]=u[l],t[6]=u[l+1],t[5]=u[l+2],t[4]=u[l+3],t[3]=u[l+4],t[2]=u[l+5],t[1]=u[l+6],t[0]=u[l+7],e[0]}r.readDoubleLE=n?o:a,r.readDoubleBE=n?a:o}():function(){function e(n,i,s,o,a,u){var l=o<0?1:0;if(l&&(o=-o),o===0)n(0,a,u+i),n(1/o>0?0:2147483648,a,u+s);else if(isNaN(o))n(0,a,u+i),n(2146959360,a,u+s);else if(o>17976931348623157e292)n(0,a,u+i),n((l<<31|2146435072)>>>0,a,u+s);else{var _;if(o<22250738585072014e-324)_=o/5e-324,n(_>>>0,a,u+i),n((l<<31|_/4294967296)>>>0,a,u+s);else{var E=Math.floor(Math.log(o)/Math.LN2);E===1024&&(E=1023),_=o*Math.pow(2,-E),n(_*4503599627370496>>>0,a,u+i),n((l<<31|E+1023<<20|_*1048576&1048575)>>>0,a,u+s)}}}r.writeDoubleLE=e.bind(null,Sh,0,4),r.writeDoubleBE=e.bind(null,Ah,4,0);function t(n,i,s,o,a){var u=n(o,a+i),l=n(o,a+s),_=(l>>31)*2+1,E=l>>>20&2047,O=4294967296*(l&1048575)+u;return E===2047?O?NaN:_*(1/0):E===0?_*5e-324*O:_*Math.pow(2,E-1075)*(O+4503599627370496)}r.readDoubleLE=t.bind(null,Oh,0,4),r.readDoubleBE=t.bind(null,Rh,4,0)}(),r}function Sh(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}function Ah(r,e,t){e[t]=r>>>24,e[t+1]=r>>>16&255,e[t+2]=r>>>8&255,e[t+3]=r&255}function Oh(r,e){return(r[e]|r[e+1]<<8|r[e+2]<<16|r[e+3]<<24)>>>0}function Rh(r,e){return(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}});var yh=c((exports,module)=>{"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(r){}return null}});var Ih=c(vh=>{"use strict";var Nu=vh;Nu.length=function(e){for(var t=0,n=0,i=0;i<e.length;++i)n=e.charCodeAt(i),n<128?t+=1:n<2048?t+=2:(n&64512)===55296&&(e.charCodeAt(i+1)&64512)===56320?(++i,t+=4):t+=3;return t};Nu.read=function(e,t,n){var i=n-t;if(i<1)return"";for(var s=null,o=[],a=0,u;t<n;)u=e[t++],u<128?o[a++]=u:u>191&&u<224?o[a++]=(u&31)<<6|e[t++]&63:u>239&&u<365?(u=((u&7)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,o[a++]=55296+(u>>10),o[a++]=56320+(u&1023)):o[a++]=(u&15)<<12|(e[t++]&63)<<6|e[t++]&63,a>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,o)),a=0);return s?(a&&s.push(String.fromCharCode.apply(String,o.slice(0,a))),s.join("")):String.fromCharCode.apply(String,o.slice(0,a))};Nu.write=function(e,t,n){for(var i=n,s,o,a=0;a<e.length;++a)s=e.charCodeAt(a),s<128?t[n++]=s:s<2048?(t[n++]=s>>6|192,t[n++]=s&63|128):(s&64512)===55296&&((o=e.charCodeAt(a+1))&64512)===56320?(s=65536+((s&1023)<<10)+(o&1023),++a,t[n++]=s>>18|240,t[n++]=s>>12&63|128,t[n++]=s>>6&63|128,t[n++]=s&63|128):(t[n++]=s>>12|224,t[n++]=s>>6&63|128,t[n++]=s&63|128);return n-i}});var Mh=c((yP,Lh)=>{"use strict";Lh.exports=sA;function sA(r,e,t){var n=t||8192,i=n>>>1,s=null,o=n;return function(u){if(u<1||u>i)return r(u);o+u>n&&(s=r(n),o=0);var l=e.call(s,o,o+=u);return o&7&&(o=(o|7)+1),l}}});var Nh=c((vP,Ch)=>{"use strict";Ch.exports=V;var Dr=Ge();function V(r,e){this.lo=r>>>0,this.hi=e>>>0}var ut=V.zero=new V(0,0);ut.toNumber=function(){return 0};ut.zzEncode=ut.zzDecode=function(){return this};ut.length=function(){return 1};var oA=V.zeroHash="\0\0\0\0\0\0\0\0";V.fromNumber=function(e){if(e===0)return ut;var t=e<0;t&&(e=-e);var n=e>>>0,i=(e-n)/4294967296>>>0;return t&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new V(n,i)};V.from=function(e){if(typeof e=="number")return V.fromNumber(e);if(Dr.isString(e))if(Dr.Long)e=Dr.Long.fromString(e);else return V.fromNumber(parseInt(e,10));return e.low||e.high?new V(e.low>>>0,e.high>>>0):ut};V.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+n*4294967296)}return this.lo+this.hi*4294967296};V.prototype.toLong=function(e){return Dr.Long?new Dr.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var qe=String.prototype.charCodeAt;V.fromHash=function(e){return e===oA?ut:new V((qe.call(e,0)|qe.call(e,1)<<8|qe.call(e,2)<<16|qe.call(e,3)<<24)>>>0,(qe.call(e,4)|qe.call(e,5)<<8|qe.call(e,6)<<16|qe.call(e,7)<<24)>>>0)};V.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};V.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this};V.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this};V.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}});var Ge=c(wu=>{"use strict";var p=wu;p.asPromise=_h();p.base64=Eh();p.EventEmitter=gh();p.float=Ph();p.inquire=yh();p.utf8=Ih();p.pool=Mh();p.LongBits=Nh();p.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);p.global=p.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||wu;p.emptyArray=Object.freeze?Object.freeze([]):[];p.emptyObject=Object.freeze?Object.freeze({}):{};p.isInteger=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};p.isString=function(e){return typeof e=="string"||e instanceof String};p.isObject=function(e){return e&&typeof e=="object"};p.isset=p.isSet=function(e,t){var n=e[t];return n!=null&&e.hasOwnProperty(t)?typeof n!="object"||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1};p.Buffer=function(){try{var r=p.inquire("buffer").Buffer;return r.prototype.utf8Write?r:null}catch{return null}}();p._Buffer_from=null;p._Buffer_allocUnsafe=null;p.newBuffer=function(e){return typeof e=="number"?p.Buffer?p._Buffer_allocUnsafe(e):new p.Array(e):p.Buffer?p._Buffer_from(e):typeof Uint8Array>"u"?e:new Uint8Array(e)};p.Array=typeof Uint8Array<"u"?Uint8Array:Array;p.Long=p.global.dcodeIO&&p.global.dcodeIO.Long||p.global.Long||p.inquire("long");p.key2Re=/^true|false|0|1$/;p.key32Re=/^-?(?:0|[1-9][0-9]*)$/;p.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;p.longToHash=function(e){return e?p.LongBits.from(e).toHash():p.LongBits.zeroHash};p.longFromHash=function(e,t){var n=p.LongBits.fromHash(e);return p.Long?p.Long.fromBits(n.lo,n.hi,t):n.toNumber(!!t)};function wh(r,e,t){for(var n=Object.keys(e),i=0;i<n.length;++i)(r[n[i]]===void 0||!t)&&(r[n[i]]=e[n[i]]);return r}p.merge=wh;p.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function xh(r){function e(t,n){if(!(this instanceof e))return new e(t,n);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:new Error().stack||""}),n&&wh(this,n)}return e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return r},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),e}p.newError=xh;p.ProtocolError=xh("ProtocolError");p.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var i=Object.keys(this),s=i.length-1;s>-1;--s)if(t[i[s]]===1&&this[i[s]]!==void 0&&this[i[s]]!==null)return i[s]}};p.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}};p.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};p._configure=function(){var r=p.Buffer;if(!r){p._Buffer_from=p._Buffer_allocUnsafe=null;return}p._Buffer_from=r.from!==Uint8Array.from&&r.from||function(t,n){return new r(t,n)},p._Buffer_allocUnsafe=r.allocUnsafe||function(t){return new r(t)}}});var Vu=c((LP,qh)=>{"use strict";qh.exports=A;var ae=Ge(),xu,Os=ae.LongBits,Dh=ae.base64,Bh=ae.utf8;function Br(r,e,t){this.fn=r,this.len=e,this.next=void 0,this.val=t}function Bu(){}function aA(r){this.head=r.head,this.tail=r.tail,this.len=r.len,this.next=r.states}function A(){this.len=0,this.head=new Br(Bu,0,0),this.tail=this.head,this.states=null}var Uh=function(){return ae.Buffer?function(){return(A.create=function(){return new xu})()}:function(){return new A}};A.create=Uh();A.alloc=function(e){return new ae.Array(e)};ae.Array!==Array&&(A.alloc=ae.pool(A.alloc,ae.Array.prototype.subarray));A.prototype._push=function(e,t,n){return this.tail=this.tail.next=new Br(e,t,n),this.len+=t,this};function Uu(r,e,t){e[t]=r&255}function uA(r,e,t){for(;r>127;)e[t++]=r&127|128,r>>>=7;e[t]=r}function qu(r,e){this.len=r,this.next=void 0,this.val=e}qu.prototype=Object.create(Br.prototype);qu.prototype.fn=uA;A.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new qu((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this};A.prototype.int32=function(e){return e<0?this._push(Gu,10,Os.fromNumber(e)):this.uint32(e)};A.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function Gu(r,e,t){for(;r.hi;)e[t++]=r.lo&127|128,r.lo=(r.lo>>>7|r.hi<<25)>>>0,r.hi>>>=7;for(;r.lo>127;)e[t++]=r.lo&127|128,r.lo=r.lo>>>7;e[t++]=r.lo}A.prototype.uint64=function(e){var t=Os.from(e);return this._push(Gu,t.length(),t)};A.prototype.int64=A.prototype.uint64;A.prototype.sint64=function(e){var t=Os.from(e).zzEncode();return this._push(Gu,t.length(),t)};A.prototype.bool=function(e){return this._push(Uu,1,e?1:0)};function Du(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}A.prototype.fixed32=function(e){return this._push(Du,4,e>>>0)};A.prototype.sfixed32=A.prototype.fixed32;A.prototype.fixed64=function(e){var t=Os.from(e);return this._push(Du,4,t.lo)._push(Du,4,t.hi)};A.prototype.sfixed64=A.prototype.fixed64;A.prototype.float=function(e){return this._push(ae.float.writeFloatLE,4,e)};A.prototype.double=function(e){return this._push(ae.float.writeDoubleLE,8,e)};var cA=ae.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var i=0;i<e.length;++i)t[n+i]=e[i]};A.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(Uu,1,0);if(ae.isString(e)){var n=A.alloc(t=Dh.length(e));Dh.decode(e,n,0),e=n}return this.uint32(t)._push(cA,t,e)};A.prototype.string=function(e){var t=Bh.length(e);return t?this.uint32(t)._push(Bh.write,t,e):this._push(Uu,1,0)};A.prototype.fork=function(){return this.states=new aA(this),this.head=this.tail=new Br(Bu,0,0),this.len=0,this};A.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Br(Bu,0,0),this.len=0),this};A.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this};A.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t};A._configure=function(r){xu=r,A.create=Uh(),xu._configure()}});var jh=c((MP,Vh)=>{"use strict";Vh.exports=Te;var Gh=Vu();(Te.prototype=Object.create(Gh.prototype)).constructor=Te;var Ve=Ge();function Te(){Gh.call(this)}Te._configure=function(){Te.alloc=Ve._Buffer_allocUnsafe,Te.writeBytesBuffer=Ve.Buffer&&Ve.Buffer.prototype instanceof Uint8Array&&Ve.Buffer.prototype.set.name==="set"?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var i=0;i<e.length;)t[n++]=e[i++]}};Te.prototype.bytes=function(e){Ve.isString(e)&&(e=Ve._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(Te.writeBytesBuffer,t,e),this};function lA(r,e,t){r.length<40?Ve.utf8.write(r,e,t):e.utf8Write?e.utf8Write(r,t):e.write(r,t)}Te.prototype.string=function(e){var t=Ve.Buffer.byteLength(e);return this.uint32(t),t&&this._push(lA,t,e),this};Te._configure()});var Hu=c((CP,$h)=>{"use strict";$h.exports=w;var de=Ge(),Fu,kh=de.LongBits,dA=de.utf8;function _e(r,e){return RangeError("index out of range: "+r.pos+" + "+(e||1)+" > "+r.len)}function w(r){this.buf=r,this.pos=0,this.len=r.length}var Fh=typeof Uint8Array<"u"?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new w(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new w(e);throw Error("illegal buffer")},Xh=function(){return de.Buffer?function(t){return(w.create=function(i){return de.Buffer.isBuffer(i)?new Fu(i):Fh(i)})(t)}:Fh};w.create=Xh();w.prototype._slice=de.Array.prototype.subarray||de.Array.prototype.slice;w.prototype.uint32=function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,_e(this,10);return e}}();w.prototype.int32=function(){return this.uint32()|0};w.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function ju(){var r=new kh(0,0),e=0;if(this.len-this.pos>4){for(;e<4;++e)if(r.lo=(r.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return r;if(r.lo=(r.lo|(this.buf[this.pos]&127)<<28)>>>0,r.hi=(r.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return r;e=0}else{for(;e<3;++e){if(this.pos>=this.len)throw _e(this);if(r.lo=(r.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return r}return r.lo=(r.lo|(this.buf[this.pos++]&127)<<e*7)>>>0,r}if(this.len-this.pos>4){for(;e<5;++e)if(r.hi=(r.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return r}else for(;e<5;++e){if(this.pos>=this.len)throw _e(this);if(r.hi=(r.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return r}throw Error("invalid varint encoding")}w.prototype.bool=function(){return this.uint32()!==0};function Rs(r,e){return(r[e-4]|r[e-3]<<8|r[e-2]<<16|r[e-1]<<24)>>>0}w.prototype.fixed32=function(){if(this.pos+4>this.len)throw _e(this,4);return Rs(this.buf,this.pos+=4)};w.prototype.sfixed32=function(){if(this.pos+4>this.len)throw _e(this,4);return Rs(this.buf,this.pos+=4)|0};function Hh(){if(this.pos+8>this.len)throw _e(this,8);return new kh(Rs(this.buf,this.pos+=4),Rs(this.buf,this.pos+=4))}w.prototype.float=function(){if(this.pos+4>this.len)throw _e(this,4);var e=de.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e};w.prototype.double=function(){if(this.pos+8>this.len)throw _e(this,4);var e=de.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e};w.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw _e(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,n);if(t===n){var i=de.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,n)};w.prototype.string=function(){var e=this.bytes();return dA.read(e,0,e.length)};w.prototype.skip=function(e){if(typeof e=="number"){if(this.pos+e>this.len)throw _e(this,e);this.pos+=e}else do if(this.pos>=this.len)throw _e(this);while(this.buf[this.pos++]&128);return this};w.prototype.skipType=function(r){switch(r){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(r=this.uint32()&7)!==4;)this.skipType(r);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+r+" at offset "+this.pos)}return this};w._configure=function(r){Fu=r,w.create=Xh(),Fu._configure();var e=de.Long?"toLong":"toNumber";de.merge(w.prototype,{int64:function(){return ju.call(this)[e](!1)},uint64:function(){return ju.call(this)[e](!0)},sint64:function(){return ju.call(this).zzDecode()[e](!1)},fixed64:function(){return Hh.call(this)[e](!0)},sfixed64:function(){return Hh.call(this)[e](!1)}})}});var Yh=c((NP,zh)=>{"use strict";zh.exports=ct;var Kh=Hu();(ct.prototype=Object.create(Kh.prototype)).constructor=ct;var Wh=Ge();function ct(r){Kh.call(this,r)}ct._configure=function(){Wh.Buffer&&(ct.prototype._slice=Wh.Buffer.prototype.slice)};ct.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))};ct._configure()});var Zh=c((wP,Qh)=>{"use strict";Qh.exports=Ur;var ku=Ge();(Ur.prototype=Object.create(ku.EventEmitter.prototype)).constructor=Ur;function Ur(r,e,t){if(typeof r!="function")throw TypeError("rpcImpl must be a function");ku.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!e,this.responseDelimited=!!t}Ur.prototype.rpcCall=function r(e,t,n,i,s){if(!i)throw TypeError("request must be specified");var o=this;if(!s)return ku.asPromise(r,o,e,t,n,i);if(!o.rpcImpl){setTimeout(function(){s(Error("already ended"))},0);return}try{return o.rpcImpl(e,t[o.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(u,l){if(u)return o.emit("error",u,e),s(u);if(l===null){o.end(!0);return}if(!(l instanceof n))try{l=n[o.responseDelimited?"decodeDelimited":"decode"](l)}catch(_){return o.emit("error",_,e),s(_)}return o.emit("data",l,e),s(null,l)})}catch(a){o.emit("error",a,e),setTimeout(function(){s(a)},0);return}};Ur.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var ep=c(Jh=>{"use strict";var _A=Jh;_A.Service=Zh()});var rp=c((DP,tp)=>{"use strict";tp.exports={}});var sp=c(ip=>{"use strict";var Z=ip;Z.build="minimal";Z.Writer=Vu();Z.BufferWriter=jh();Z.Reader=Hu();Z.BufferReader=Yh();Z.util=Ge();Z.rpc=ep();Z.roots=rp();Z.configure=np;function np(){Z.util._configure(),Z.Writer._configure(Z.BufferWriter),Z.Reader._configure(Z.BufferReader)}np()});var ap=c((UP,op)=>{"use strict";op.exports=sp()});var N=K(zo(),1);h();ea();var Ep=K(Od(),1),or=K(tt(),1),mp=K(qd(),1),gp=K(k_(),1),Tp=K(ie(),1),ar=K(Hr(),1),Sp=K($_(),1),he=K(S(),1);h();var CS=Symbol.for("@vercel/request-context");function Jt(){return globalThis[CS]?.get()}var Su=K(ie(),1);function ps(r){return Object.fromEntries(Object.entries(r).filter(([e,t])=>t!==void 0))}function W_(r){return r?r.split("::").at(-1):void 0}function K_(r=Jt(),e){if(!r)return;let t=e?wS(e,r.headers):void 0;return ps({[Su.SemanticAttributes.HTTP_HOST]:r.headers.host,[Su.SemanticAttributes.HTTP_USER_AGENT]:r.headers["user-agent"],"http.referer":r.headers.referer,"vercel.request_id":W_(r.headers["x-vercel-id"]),"vercel.matched_path":r.headers["x-matched-path"],"vercel.edge_region":r.headers["x-vercel-edge-region"],...t})}var NS={keys(r){return[]},get(r,e){return r[e.toLocaleLowerCase()]}};function wS(r,e){if(typeof r=="function")return r(e,NS);let t={};for(let[n,i]of Object.entries(r)){let s=e[i.toLocaleLowerCase()];s!==void 0&&(t[n]=s)}return t}h();function wr(r){return(r&d.TraceFlags.SAMPLED)!==0}var fs=class{constructor(e,t){this.processors=e;this.attributesFromHeaders=t;this.rootSpanIds=new Map;this.waitSpanEnd=new Map}forceFlush(){return Promise.all(this.processors.map(e=>e.forceFlush().catch(t=>{d.diag.error("@vercel/otel: forceFlush failed:",t)}))).then(()=>{})}shutdown(){return Promise.all(this.processors.map(e=>e.shutdown().catch(()=>{}))).then(()=>{})}onStart(e,t){let{traceId:n,spanId:i,traceFlags:s}=e.spanContext(),o=!e.parentSpanId||!this.rootSpanIds.has(n);if(o?this.rootSpanIds.set(n,{rootSpanId:i,open:[]}):this.rootSpanIds.get(n)?.open.push(e),o&&wr(s)){let a=Jt(),u=K_(a,this.attributesFromHeaders);u&&e.setAttributes(u),a&&a.waitUntil(async()=>{if(this.rootSpanIds.has(n)){let l=new Promise(E=>{this.waitSpanEnd.set(n,E)}),_;await Promise.race([l,new Promise(E=>{_=setTimeout(()=>{this.waitSpanEnd.delete(n),E(void 0)},50)})]),_&&clearTimeout(_)}return this.forceFlush()})}for(let a of this.processors)a.onStart(e,t)}onEnd(e){let{traceId:t,spanId:n,traceFlags:i}=e.spanContext(),s=wr(i),o=this.rootSpanIds.get(t),a=o?.rootSpanId===n;if(s){let u=DS(e);u&&Object.assign(e.attributes,u)}if(a){if(this.rootSpanIds.delete(t),o.open.length>0){for(let u of o.open)if(!u.ended&&u.spanContext().spanId!==n)try{u.end()}catch(l){d.diag.error("@vercel/otel: onEnd failed:",l)}}}else if(o)for(let u=0;u<o.open.length;u++)o.open[u]?.spanContext().spanId===n&&o.open.splice(u,1);for(let u of this.processors)u.onEnd(e);if(a){let u=this.waitSpanEnd.get(t);u&&(this.waitSpanEnd.delete(t),u())}}},xS={[d.SpanKind.INTERNAL]:"internal",[d.SpanKind.SERVER]:"server",[d.SpanKind.CLIENT]:"client",[d.SpanKind.PRODUCER]:"producer",[d.SpanKind.CONSUMER]:"consumer"};function DS(r){let{kind:e,attributes:t}=r,{"operation.name":n,"resouce.name":i,"span.type":s,"next.span_type":o,"http.method":a,"http.route":u}=t;if(n)return;let l=i??(a&&typeof a=="string"&&u&&typeof u=="string"?`${a} ${u}`:u);if(r.kind===d.SpanKind.SERVER&&a&&u&&typeof a=="string"&&typeof u=="string")return{"operation.name":"web.request","resource.name":l};let _=r.instrumentationLibrary.name,E=o??s;if(E&&typeof E=="string"){let O=z_(_,E);return u?{"operation.name":O,"resource.name":l}:{"operation.name":O}}return{"operation.name":z_(_,e===d.SpanKind.INTERNAL?"":xS[e])}}function z_(r,e){if(!r)return e;let t=r.replace(/[ @./]/g,"_");return t.startsWith("_")&&(t=t.slice(1)),e?`${t}.${e}`:t}var lh=K(vu(),1);var ch=K(uh(),1);h();var er=class extends ch.OTLPExporterBase{constructor(e={}){super(e),e.headers&&(this._headers=e.headers)}onShutdown(){d.diag.debug("@vercel/otel/otlp: onShutdown")}onInit(){d.diag.debug("@vercel/otel/otlp: onInit")}send(e,t,n){if(this._shutdownOnce.isCalled){d.diag.debug("@vercel/otel/otlp: Shutdown already started. Cannot send objects");return}let i=this.convert(e),s,o,a;try{({body:s,contentType:o,headers:a}=this.toMessage(i))}catch(l){d.diag.warn("@vercel/otel/otlp: no proto",l);return}let u=fetch(this.url,{method:"POST",body:s,headers:{...this._headers,...a,"Content-Type":o,"User-Agent":"OTel-OTLP-Exporter-JavaScript/0.46.0"},next:{internal:!0}}).then(l=>{d.diag.debug("@vercel/otel/otlp: onSuccess",l.status,l.statusText),t(),l.arrayBuffer().catch(()=>{})}).catch(l=>{d.diag.error("@vercel/otel/otlp: onError",l),n(l)}).finally(()=>{let l=this._sendingPromises.indexOf(u);this._sendingPromises.splice(l,1)});this._sendingPromises.push(u)}getDefaultUrl(e){throw new Error("Method not implemented.")}};var rA="v1/traces",nA=`http://localhost:4318/${rA}`;function Ts(r){return typeof r.url=="string"?r.url:nA}var tr=class{constructor(e={}){this.impl=new Cu(e)}export(e,t){this.impl.export(e,t)}shutdown(){return this.impl.shutdown()}forceFlush(){return this.impl.forceFlush()}},Cu=class extends er{convert(e){return(0,lh.createExportTraceServiceRequest)(e,{useHex:!0,useLongBits:!1})}toMessage(e){return{body:JSON.stringify(e),contentType:"application/json"}}getDefaultUrl(e){return Ts(e)}};var dp=K(vu(),1);var up=K(ap(),1);function cp(r){let e=new up.Writer;return hA(r,e),e.finish()}function hA(r,e){if(r.resourceSpans!=null&&r.resourceSpans.length)for(let t=0;t<r.resourceSpans.length;++t)pA(r.resourceSpans[t],e.uint32(10).fork()).ldelim();return e}function pA(r,e){if(r.resource!=null&&fA(r.resource,e.uint32(10).fork()).ldelim(),r.scopeSpans!=null&&r.scopeSpans.length)for(let t=0;t<r.scopeSpans.length;++t)EA(r.scopeSpans[t],e.uint32(18).fork()).ldelim();return r.schemaUrl!=null&&e.uint32(26).string(r.schemaUrl),e}function fA(r,e){if(r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)nr(r.attributes[t],e.uint32(10).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(16).uint32(r.droppedAttributesCount),e}function EA(r,e){if(r.scope!=null&&TA(r.scope,e.uint32(10).fork()).ldelim(),r.spans!=null&&r.spans.length)for(let t=0;t<r.spans.length;++t)SA(r.spans[t],e.uint32(18).fork()).ldelim();return r.schemaUrl!=null&&e.uint32(26).string(r.schemaUrl),e}function nr(r,e){return r.key!=null&&e.uint32(10).string(r.key),r.value!=null&&lp(r.value,e.uint32(18).fork()).ldelim(),e}function lp(r,e){return r.stringValue!=null&&e.uint32(10).string(r.stringValue),r.boolValue!=null&&e.uint32(16).bool(r.boolValue),r.intValue!=null&&e.uint32(24).int64(r.intValue),r.doubleValue!=null&&e.uint32(33).double(r.doubleValue),r.arrayValue!=null&&mA(r.arrayValue,e.uint32(42).fork()).ldelim(),r.kvlistValue!=null&&gA(r.kvlistValue,e.uint32(50).fork()).ldelim(),r.bytesValue!=null&&e.uint32(58).bytes(r.bytesValue),e}function mA(r,e){if(r.values!=null&&r.values.length)for(let t=0;t<r.values.length;++t)lp(r.values[t],e.uint32(10).fork()).ldelim();return e}function gA(r,e){if(r.values!=null&&r.values.length)for(let t=0;t<r.values.length;++t)nr(r.values[t],e.uint32(10).fork()).ldelim();return e}function TA(r,e){if(r.name!=null&&e.uint32(10).string(r.name),r.version!=null&&e.uint32(18).string(r.version),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)nr(r.attributes[t],e.uint32(26).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(32).uint32(r.droppedAttributesCount),e}function SA(r,e){if(r.traceId!=null&&e.uint32(10).bytes(r.traceId),r.spanId!=null&&e.uint32(18).bytes(r.spanId),r.traceState!=null&&e.uint32(26).string(r.traceState),r.parentSpanId!=null&&e.uint32(34).bytes(r.parentSpanId),r.name!=null&&e.uint32(42).string(r.name),r.kind!=null&&e.uint32(48).int32(r.kind),r.startTimeUnixNano!=null&&e.uint32(57).fixed64(r.startTimeUnixNano),r.endTimeUnixNano!=null&&e.uint32(65).fixed64(r.endTimeUnixNano),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)nr(r.attributes[t],e.uint32(74).fork()).ldelim();if(r.droppedAttributesCount!=null&&e.uint32(80).uint32(r.droppedAttributesCount),r.events!=null&&r.events.length)for(let t=0;t<r.events.length;++t)OA(r.events[t],e.uint32(90).fork()).ldelim();if(r.droppedEventsCount!=null&&e.uint32(96).uint32(r.droppedEventsCount),r.links!=null&&r.links.length)for(let t=0;t<r.links.length;++t)RA(r.links[t],e.uint32(106).fork()).ldelim();return r.droppedLinksCount!=null&&e.uint32(112).uint32(r.droppedLinksCount),r.status!=null&&AA(r.status,e.uint32(122).fork()).ldelim(),e}function AA(r,e){return r.message!=null&&e.uint32(18).string(r.message),r.code!=null&&e.uint32(24).int32(r.code),e}function OA(r,e){if(r.timeUnixNano!=null&&e.uint32(9).fixed64(r.timeUnixNano),r.name!=null&&e.uint32(18).string(r.name),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)nr(r.attributes[t],e.uint32(26).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(32).uint32(r.droppedAttributesCount),e}function RA(r,e){if(r.traceId!=null&&e.uint32(10).bytes(r.traceId),r.spanId!=null&&e.uint32(18).bytes(r.spanId),r.traceState!=null&&e.uint32(26).string(r.traceState),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)nr(r.attributes[t],e.uint32(34).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(40).uint32(r.droppedAttributesCount),e}var lt=class{constructor(e={}){this.impl=new Xu(e)}export(e,t){this.impl.export(e,t)}shutdown(){return this.impl.shutdown()}forceFlush(){return this.impl.forceFlush()}},Xu=class extends er{convert(e){return(0,dp.createExportTraceServiceRequest)(e,void 0)}toMessage(e){return{body:cp(e),contentType:"application/x-protobuf",headers:{accept:"application/x-protobuf"}}}getDefaultUrl(e){return Ts(e)}};h();var be=K(ie(),1);function _p(r,e){return r.replace(/\{(?<temp1>[^{}]+)\}/g,(t,n)=>{let i=e[n];return i!==void 0?String(i):t})}var ir=class{constructor(e={}){this.instrumentationName="@vercel/otel/fetch";this.instrumentationVersion="1.0.0";this.config=e}getConfig(){return this.config}setConfig(){}setTracerProvider(e){this.tracerProvider=e}setMeterProvider(){}enable(){this.disable();let{tracerProvider:e}=this;if(!e)return;let t=e.getTracer(this.instrumentationName,this.instrumentationVersion),n=this.config.ignoreUrls??[],i=(I,U)=>{if(U?.opentelemetry?.ignore!==void 0)return U.opentelemetry.ignore;if(n.length===0)return!1;let L=I.toString();return n.some(m=>typeof m=="string"?m==="*"?!0:L.startsWith(m):m.test(L))},s=process.env.VERCEL_URL||process.env.NEXT_PUBLIC_VERCEL_URL||null,o=process.env.VERCEL_BRANCH_URL||process.env.NEXT_PUBLIC_VERCEL_BRANCH_URL||null,a=this.config.propagateContextUrls??[],u=this.config.dontPropagateContextUrls??[],l=this.config.resourceNameTemplate,{attributesFromRequestHeaders:_,attributesFromResponseHeaders:E}=this.config,O=(I,U)=>{if(U?.opentelemetry?.propagateContext)return U.opentelemetry.propagateContext;let L=I.toString();return u.length>0&&u.some(m=>typeof m=="string"?m==="*"?!0:L.startsWith(m):m.test(L))?!1:s&&I.protocol==="https:"&&(I.host===s||I.host===o||I.host===Jt()?.headers.host)||!s&&I.protocol==="http:"&&I.hostname==="localhost"?!0:a.some(m=>typeof m=="string"?m==="*"?!0:L.startsWith(m):m.test(L))};process.env.NEXT_OTEL_FETCH_DISABLED="1";let D=globalThis.fetch;this.originalFetch=D;let z=async(I,U)=>{let L=U;if(L?.next?.internal)return D(I,L);let m=new Request(I instanceof Request?I.clone():I,L),Pe=new URL(m.url);if(i(Pe,L))return D(I,L);let Ps={[be.SemanticAttributes.HTTP_METHOD]:m.method,[be.SemanticAttributes.HTTP_URL]:m.url,[be.SemanticAttributes.HTTP_HOST]:Pe.host,[be.SemanticAttributes.HTTP_SCHEME]:Pe.protocol.replace(":",""),[be.SemanticAttributes.NET_PEER_NAME]:Pe.hostname,[be.SemanticAttributes.NET_PEER_PORT]:Pe.port},dt=l?_p(l,Ps):PA(m.url),Op=L?.opentelemetry?.spanName??`fetch ${m.method} ${m.url}`,Wu=d.context.active(),q=t.startSpan(Op,{kind:d.SpanKind.CLIENT,attributes:{...Ps,"operation.name":`fetch.${m.method}`,"resource.name":dt,...L?.opentelemetry?.attributes}},Wu);if(!q.isRecording()||!wr(q.spanContext().traceFlags))return q.end(),D(I,L);if(O(Pe,L)){let _t=d.trace.setSpan(Wu,q);d.propagation.inject(_t,m.headers,bA)}_&&hp(q,_,m.headers);try{let _t=Date.now(),ye=await D(I,{...L,headers:m.headers}),Rp=Date.now()-_t;return q.setAttribute(be.SemanticAttributes.HTTP_STATUS_CODE,ye.status),q.setAttribute("http.response_time",Rp),E&&hp(q,E,ye.headers),ye.status>=500&&$u(q,`Status: ${ye.status} (${ye.statusText})`),ye.body?yA(ye).then(ys=>{q.isRecording()&&(q.setAttribute(be.SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED,ys),q.end())},ys=>{q.isRecording()&&($u(q,ys),q.end())}):q.end(),ye}catch(_t){throw $u(q,_t),q.end(),_t}};globalThis.fetch=z}disable(){this.originalFetch&&(globalThis.fetch=this.originalFetch)}},bA={set(r,e,t){r.set(e,t)}};function PA(r){let e=r.indexOf("?");return e===-1?r:r.substring(0,e)}function yA(r){let e=0,n=r.clone().body?.getReader();if(!n)return Promise.resolve(0);let i=()=>n.read().then(({done:s,value:o})=>{if(!s)return e+=o.byteLength,i()});return i().then(()=>e)}function $u(r,e){if(e instanceof Error)r.recordException(e),r.setStatus({code:d.SpanStatusCode.ERROR,message:e.message});else{let t=String(e);r.setStatus({code:d.SpanStatusCode.ERROR,message:t})}}function hp(r,e,t){for(let[n,i]of Object.entries(e)){let s=t.get(i);s!==null&&r.setAttribute(n,s)}}var bs=class{constructor(e={}){this.configuration=e}start(){let e=vA(),t=(0,ar.getEnvWithoutDefaults)(),n=this.configuration,i=process.env.NEXT_RUNTIME||"nodejs",s=!!e.OTEL_SDK_DISABLED;if(t.OTEL_LOG_LEVEL&&d.diag.setLogger(new d.DiagConsoleLogger,{logLevel:t.OTEL_LOG_LEVEL}),s)return;let o=n.idGenerator??new N.RandomIdGenerator,a=n.contextManager??new Sp.AsyncLocalStorageContextManager;a.enable(),this.contextManager=a;let u=e.OTEL_SERVICE_NAME||n.serviceName||"app",l=new or.Resource(ps({[Tp.SemanticResourceAttributes.SERVICE_NAME]:u,"node.ci":process.env.CI?!0:void 0,"node.env":process.env.NODE_ENV,env:process.env.VERCEL_ENV||process.env.NEXT_PUBLIC_VERCEL_ENV,"vercel.region":process.env.VERCEL_REGION,"vercel.runtime":i,"vercel.sha":process.env.VERCEL_GIT_COMMIT_SHA||process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA,"vercel.host":process.env.VERCEL_URL||process.env.NEXT_PUBLIC_VERCEL_URL||void 0,"vercel.branch_host":process.env.VERCEL_BRANCH_URL||process.env.NEXT_PUBLIC_VERCEL_BRANCH_URL||void 0,...n.attributes})),_=n.resourceDetectors??[or.envDetectorSync];if(n.autoDetectResources??!0){let m={detectors:_};l=l.merge((0,or.detectResourcesSync)(m))}let O=LA(n.propagators,e),D=MA(n.traceSampler,e),z=CA(n.spanProcessors,n,e);z.length===0&&d.diag.warn("@vercel/otel: No span processors configured. No spans will be exported.");let I=n.spanLimits,U=new N.BasicTracerProvider({resource:l,idGenerator:o,sampler:D,spanLimits:I});if(U.addSpanProcessor(new fs(z,n.attributesFromHeaders)),U.register({contextManager:a,propagator:new he.CompositePropagator({propagators:O})}),this.tracerProvider=U,n.logRecordProcessor){let m=new mp.LoggerProvider({resource:l});this.loggerProvider=m,m.addLogRecordProcessor(n.logRecordProcessor),it.logs.setGlobalLoggerProvider(m)}if(n.metricReader||n.views){let m=new gp.MeterProvider({resource:l,views:n.views??[]});n.metricReader&&m.addMetricReader(n.metricReader),d.metrics.setGlobalMeterProvider(m),this.meterProvider=m}let L=IA(n.instrumentations,n.instrumentationConfig);this.disableInstrumentations=(0,Ep.registerInstrumentations)({instrumentations:L}),d.diag.info("@vercel/otel: started",u,i)}async shutdown(){let e=[];this.tracerProvider&&e.push(this.tracerProvider.shutdown()),this.loggerProvider&&e.push(this.loggerProvider.shutdown()),this.meterProvider&&e.push(this.meterProvider.shutdown()),d.diag.info("@vercel/otel: shutting down",e.length,process.env.NEXT_RUNTIME),await Promise.all(e),this.contextManager&&this.contextManager.disable();let{disableInstrumentations:t}=this;t&&t()}};function vA(){let r=(0,ar.parseEnvironment)(process.env);return{...ar.DEFAULT_ENVIRONMENT,...r}}function IA(r,e){return(r??["auto"]).map(t=>t==="auto"?(d.diag.debug("@vercel/otel: Configure instrumentations: fetch",e?.fetch),[new ir(e?.fetch)]):t==="fetch"?(d.diag.debug("@vercel/otel: Configure instrumentations: fetch",e?.fetch),new ir(e?.fetch)):t).flat()}function LA(r,e){let t=e.OTEL_PROPAGATORS&&e.OTEL_PROPAGATORS.length>0?e.OTEL_PROPAGATORS:void 0;return(r??t??["auto"]).map(n=>{if(n==="none")return[];if(n==="auto")return d.diag.debug("@vercel/otel: Configure propagators: tracecontext, baggage"),[new he.W3CTraceContextPropagator,new he.W3CBaggagePropagator];if(n==="tracecontext")return d.diag.debug("@vercel/otel: Configure propagator: tracecontext"),new he.W3CTraceContextPropagator;if(n==="baggage")return d.diag.debug("@vercel/otel: Configure propagator: baggage"),new he.W3CBaggagePropagator;if(typeof n=="string")throw new Error(`Unknown propagator: "${n}"`);return n}).flat()}var pp="always_on",sr=1;function MA(r,e){if(r&&typeof r!="string")return r;let t=r&&r!=="auto"?r:e.OTEL_TRACES_SAMPLER||pp;switch(d.diag.debug("@vercel/otel: Configure sampler: ",t),t){case"always_on":return new N.AlwaysOnSampler;case"always_off":return new N.AlwaysOffSampler;case"parentbased_always_on":return new N.ParentBasedSampler({root:new N.AlwaysOnSampler});case"parentbased_always_off":return new N.ParentBasedSampler({root:new N.AlwaysOffSampler});case"traceidratio":return new N.TraceIdRatioBasedSampler(fp(e));case"parentbased_traceidratio":return new N.ParentBasedSampler({root:new N.TraceIdRatioBasedSampler(fp(e))});default:return d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER value "${String(e.OTEL_TRACES_SAMPLER)} invalid, defaulting to ${pp}".`),new N.AlwaysOnSampler}}function fp(r){if(r.OTEL_TRACES_SAMPLER_ARG===void 0||r.OTEL_TRACES_SAMPLER_ARG==="")return d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${sr}.`),sr;d.diag.debug("@vercel/otel: Configure sampler probability: ",r.OTEL_TRACES_SAMPLER_ARG);let e=Number(r.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${sr}.`),sr):e<0||e>1?(d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${sr}.`),sr):e}function CA(r,e,t){return[...(r??["auto"]).map(n=>{if(n==="auto"){if(process.env.VERCEL_OTEL_ENDPOINTS){let i=process.env.VERCEL_OTEL_ENDPOINTS_PORT||"4318",s=process.env.VERCEL_OTEL_ENDPOINTS_PROTOCOL||"http/protobuf";d.diag.debug("@vercel/otel: Configure vercel otel collector on port: ",i,s);let o={url:`http://localhost:${i}/v1/traces`,headers:{}},a=s==="http/protobuf"?new lt(o):new tr(o);return new N.BatchSpanProcessor(a)}return!e.traceExporter||e.traceExporter==="auto"||t.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT||t.OTEL_EXPORTER_OTLP_ENDPOINT?new N.BatchSpanProcessor(NA(t)):void 0}return n}).filter(DA),...e.traceExporter&&e.traceExporter!=="auto"?[new N.BatchSpanProcessor(e.traceExporter)]:[]]}function NA(r){let e=process.env.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL??process.env.OTEL_EXPORTER_OTLP_PROTOCOL??"http/protobuf",t=xA(r),n={...he.baggageUtils.parseKeyPairsIntoRecord(r.OTEL_EXPORTER_OTLP_HEADERS),...he.baggageUtils.parseKeyPairsIntoRecord(r.OTEL_EXPORTER_OTLP_TRACES_HEADERS)};switch(d.diag.debug("@vercel/otel: Configure trace exporter: ",e,t,`headers: ${Object.keys(n).join(",")||"<none>"}`),e){case"http/json":return new tr({url:t,headers:n});case"http/protobuf":return new lt({url:t,headers:n});default:return d.diag.warn(`@vercel/otel: Unsupported OTLP traces protocol: ${e}. Using http/protobuf.`),new lt}}var Ap="v1/traces",wA=`http://localhost:4318/${Ap}`;function xA(r){let e=r.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT;if(e&&typeof e=="string")return e;let t=r.OTEL_EXPORTER_OTLP_ENDPOINT;return t&&typeof t=="string"?`${t}/${Ap}`:wA}function DA(r){return r!=null}function iy(r){let e;r?typeof r=="string"?e={serviceName:r}:e=r:e={},new bs(e).start()}export{ir as FetchInstrumentation,tr as OTLPHttpJsonTraceExporter,lt as OTLPHttpProtoTraceExporter,iy as registerOTel};
|
|
20
|
+
`,(0,Qi.getConflictResolutionRecipe)(s,e))}return n}};Zi.MetricStorageRegistry=eu});var v_=c(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.MultiMetricStorage=void 0;var tu=class{constructor(e){this._backingStorages=e}record(e,t,n,i){this._backingStorages.forEach(s=>{s.record(e,t,n,i)})}};Ji.MultiMetricStorage=tu});var L_=c(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.BatchObservableResultImpl=Qt.ObservableResultImpl=void 0;var Yt=(h(),f(d)),I_=Mr(),HT=ki(),ru=class{constructor(e,t){this._instrumentName=e,this._valueType=t,this._buffer=new I_.AttributeHashMap}observe(e,t={}){if(typeof e!="number"){Yt.diag.warn(`non-number value provided to metric ${this._instrumentName}: ${e}`);return}this._valueType===Yt.ValueType.INT&&!Number.isInteger(e)&&(Yt.diag.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)}};Qt.ObservableResultImpl=ru;var nu=class{constructor(){this._buffer=new Map}observe(e,t,n={}){if(!(0,HT.isObservableInstrument)(e))return;let i=this._buffer.get(e);if(i==null&&(i=new I_.AttributeHashMap,this._buffer.set(e,i)),typeof t!="number"){Yt.diag.warn(`non-number value provided to metric ${e._descriptor.name}: ${t}`);return}e._descriptor.valueType===Yt.ValueType.INT&&!Number.isInteger(t)&&(Yt.diag.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))||i.set(n,t)}};Qt.BatchObservableResultImpl=nu});var N_=c(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.ObservableRegistry=void 0;var kT=(h(),f(d)),M_=ki(),C_=L_(),Cr=me(),iu=class{constructor(){this._callbacks=[],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(M_.isObservableInstrument));if(n.size===0){kT.diag.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(M_.isObservableInstrument)),i=this._findBatchCallback(e,n);i<0||this._batchCallbacks.splice(i,1)}async observe(e,t){let n=this._observeCallbacks(e,t),i=this._observeBatchCallbacks(e,t);return(await(0,Cr.PromiseAllSettled)([...n,...i])).filter(Cr.isPromiseAllSettledRejectionResult).map(a=>a.reason)}_observeCallbacks(e,t){return this._callbacks.map(async({callback:n,instrument:i})=>{let s=new C_.ObservableResultImpl(i._descriptor.name,i._descriptor.valueType),o=Promise.resolve(n(s));t!=null&&(o=(0,Cr.callWithTimeout)(o,t)),await o,i._metricStorages.forEach(a=>{a.record(s._buffer,e)})})}_observeBatchCallbacks(e,t){return this._batchCallbacks.map(async({callback:n,instruments:i})=>{let s=new C_.BatchObservableResultImpl,o=Promise.resolve(n(s));t!=null&&(o=(0,Cr.callWithTimeout)(o,t)),await o,i.forEach(a=>{let u=s._buffer.get(a);u!=null&&a._metricStorages.forEach(l=>{l.record(u,e)})})})}_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&&(0,Cr.setEquals)(n.instruments,t))}};es.ObservableRegistry=iu});var w_=c(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.SyncMetricStorage=void 0;var XT=$a(),$T=Ya(),WT=Za(),su=class extends XT.MetricStorage{constructor(e,t,n,i){super(e),this._attributesProcessor=n,this._deltaMetricStorage=new $T.DeltaMetricProcessor(t),this._temporalMetricStorage=new WT.TemporalMetricProcessor(t,i)}record(e,t,n,i){t=this._attributesProcessor.process(t,n),this._deltaMetricStorage.record(e,t,n,i)}collect(e,t){let n=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,n,t)}};ts.SyncMetricStorage=su});var au=c(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.FilteringAttributesProcessor=xe.NoopAttributesProcessor=xe.AttributesProcessor=void 0;var Nr=class{static Noop(){return KT}};xe.AttributesProcessor=Nr;var rs=class extends Nr{process(e,t){return e}};xe.NoopAttributesProcessor=rs;var ou=class extends Nr{constructor(e){super(),this._allowedAttributeNames=e}process(e,t){let n={};return Object.keys(e).filter(i=>this._allowedAttributeNames.includes(i)).forEach(i=>n[i]=e[i]),n}};xe.FilteringAttributesProcessor=ou;var KT=new rs});var x_=c(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.MeterSharedState=void 0;var zT=Oe(),YT=g_(),QT=me(),ZT=T_(),JT=y_(),eS=v_(),tS=N_(),rS=w_(),nS=au(),uu=class{constructor(e,t){this._meterProviderSharedState=e,this._instrumentationScope=t,this.metricStorageRegistry=new JT.MetricStorageRegistry,this.observableRegistry=new tS.ObservableRegistry,this.meter=new YT.Meter(this)}registerMetricStorage(e){let t=this._registerMetricStorage(e,rS.SyncMetricStorage);return t.length===1?t[0]:new eS.MultiMetricStorage(t)}registerAsyncMetricStorage(e){return this._registerMetricStorage(e,ZT.AsyncMetricStorage)}async collect(e,t,n){let i=await this.observableRegistry.observe(t,n?.timeoutMillis),s=this.metricStorageRegistry.getStorages(e);if(s.length===0)return null;let o=s.map(a=>a.collect(e,t)).filter(QT.isNotNullish);return o.length===0?{errors:i}:{scopeMetrics:{scope:this._instrumentationScope,metrics:o},errors:i}}_registerMetricStorage(e,t){let i=this._meterProviderSharedState.viewRegistry.findViews(e,this._instrumentationScope).map(s=>{let o=(0,zT.createInstrumentDescriptorWithView)(s,e),a=this.metricStorageRegistry.findOrUpdateCompatibleStorage(o);if(a!=null)return a;let u=s.aggregation.createAggregator(o),l=new t(o,u,s.attributesProcessor,this._meterProviderSharedState.metricCollectors);return this.metricStorageRegistry.register(l),l});if(i.length===0){let o=this._meterProviderSharedState.selectAggregations(e.type).map(([a,u])=>{let l=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(a,e);if(l!=null)return l;let _=u.createAggregator(e),E=new t(e,_,nS.AttributesProcessor.Noop(),[a]);return this.metricStorageRegistry.registerForCollector(a,E),E});i=i.concat(o)}return i}};ns.MeterSharedState=uu});var D_=c(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.MeterProviderSharedState=void 0;var iS=me(),sS=m_(),oS=x_(),cu=class{constructor(e){this.resource=e,this.viewRegistry=new sS.ViewRegistry,this.metricCollectors=[],this.meterSharedStates=new Map}getMeterSharedState(e){let t=(0,iS.instrumentationScopeId)(e),n=this.meterSharedStates.get(t);return n==null&&(n=new oS.MeterSharedState(this,e),this.meterSharedStates.set(t,n)),n}selectAggregations(e){let t=[];for(let n of this.metricCollectors)t.push([n,n.selectAggregation(e)]);return t}};is.MeterProviderSharedState=cu});var B_=c(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.MetricCollector=void 0;var aS=S(),lu=class{constructor(e,t){this._sharedState=e,this._metricReader=t}async collect(e){let t=(0,aS.millisToHrTime)(Date.now()),n=[],i=[],s=Array.from(this._sharedState.meterSharedStates.values()).map(async o=>{let a=await o.collect(this,t,e);a?.scopeMetrics!=null&&n.push(a.scopeMetrics),a?.errors!=null&&i.push(...a.errors)});return await Promise.all(s),{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:n},errors:i}}async forceFlush(e){await this._metricReader.forceFlush(e)}async shutdown(e){await this._metricReader.shutdown(e)}selectAggregationTemporality(e){return this._metricReader.selectAggregationTemporality(e)}selectAggregation(e){return this._metricReader.selectAggregation(e)}};ss.MetricCollector=lu});var q_=c(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.MeterProvider=void 0;var os=(h(),f(d)),U_=tt(),uS=D_(),cS=B_(),du=class{constructor(e){var t;this._shutdown=!1;let n=U_.Resource.default().merge((t=e?.resource)!==null&&t!==void 0?t:U_.Resource.empty());if(this._sharedState=new uS.MeterProviderSharedState(n),e?.views!=null&&e.views.length>0)for(let i of e.views)this._sharedState.viewRegistry.addView(i)}getMeter(e,t="",n={}){return this._shutdown?(os.diag.warn("A shutdown MeterProvider cannot provide a Meter"),(0,os.createNoopMeter)()):this._sharedState.getMeterSharedState({name:e,version:t,schemaUrl:n.schemaUrl}).meter}addMetricReader(e){let t=new cS.MetricCollector(this._sharedState,e);e.setMetricProducer(t),this._sharedState.metricCollectors.push(t)}async shutdown(e){if(this._shutdown){os.diag.warn("shutdown may only be called once per MeterProvider");return}this._shutdown=!0,await Promise.all(this._sharedState.metricCollectors.map(t=>t.shutdown(e)))}async forceFlush(e){if(this._shutdown){os.diag.warn("invalid attempt to force flush after MeterProvider shutdown");return}await Promise.all(this._sharedState.metricCollectors.map(t=>t.forceFlush(e)))}};as.MeterProvider=du});var us=c(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.ExactPredicate=Zt.PatternPredicate=void 0;var lS=/[\^$\\.+?()[\]{}|]/g,_u=class r{constructor(e){e==="*"?(this._matchAll=!0,this._regexp=/.*/):(this._matchAll=!1,this._regexp=new RegExp(r.escapePattern(e)))}match(e){return this._matchAll?!0:this._regexp.test(e)}static escapePattern(e){return`^${e.replace(lS,"\\$&").replace("*",".*")}$`}static hasWildcard(e){return e.includes("*")}};Zt.PatternPredicate=_u;var hu=class{constructor(e){this._matchAll=e===void 0,this._pattern=e}match(e){return!!(this._matchAll||e===this._pattern)}};Zt.ExactPredicate=hu});var V_=c(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.InstrumentSelector=void 0;var G_=us(),pu=class{constructor(e){var t;this._nameFilter=new G_.PatternPredicate((t=e?.name)!==null&&t!==void 0?t:"*"),this._type=e?.type,this._unitFilter=new G_.ExactPredicate(e?.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}};cs.InstrumentSelector=pu});var j_=c(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.MeterSelector=void 0;var fu=us(),Eu=class{constructor(e){this._nameFilter=new fu.ExactPredicate(e?.name),this._versionFilter=new fu.ExactPredicate(e?.version),this._schemaUrlFilter=new fu.ExactPredicate(e?.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}};ls.MeterSelector=Eu});var H_=c(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.View=void 0;var dS=us(),F_=au(),_S=V_(),hS=j_(),pS=Bi();function fS(r){return r.instrumentName==null&&r.instrumentType==null&&r.instrumentUnit==null&&r.meterName==null&&r.meterVersion==null&&r.meterSchemaUrl==null}var mu=class{constructor(e){var t;if(fS(e))throw new Error("Cannot create view with no selector arguments supplied");if(e.name!=null&&(e?.instrumentName==null||dS.PatternPredicate.hasWildcard(e.instrumentName)))throw new Error("Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter.");e.attributeKeys!=null?this.attributesProcessor=new F_.FilteringAttributesProcessor(e.attributeKeys):this.attributesProcessor=F_.AttributesProcessor.Noop(),this.name=e.name,this.description=e.description,this.aggregation=(t=e.aggregation)!==null&&t!==void 0?t:pS.Aggregation.Default(),this.instrumentSelector=new _S.InstrumentSelector({name:e.instrumentName,type:e.instrumentType,unit:e.instrumentUnit}),this.meterSelector=new hS.MeterSelector({name:e.meterName,version:e.meterVersion,schemaUrl:e.meterSchemaUrl})}};ds.View=mu});var k_=c(g=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0});g.TimeoutError=g.View=g.Aggregation=g.SumAggregation=g.LastValueAggregation=g.HistogramAggregation=g.DropAggregation=g.ExponentialHistogramAggregation=g.ExplicitBucketHistogramAggregation=g.DefaultAggregation=g.MeterProvider=g.InstrumentType=g.ConsoleMetricExporter=g.InMemoryMetricExporter=g.PeriodicExportingMetricReader=g.MetricReader=g.DataPointType=g.AggregationTemporality=void 0;var ES=Oi();Object.defineProperty(g,"AggregationTemporality",{enumerable:!0,get:function(){return ES.AggregationTemporality}});var mS=Nt();Object.defineProperty(g,"DataPointType",{enumerable:!0,get:function(){return mS.DataPointType}});var gS=wa();Object.defineProperty(g,"MetricReader",{enumerable:!0,get:function(){return gS.MetricReader}});var TS=__();Object.defineProperty(g,"PeriodicExportingMetricReader",{enumerable:!0,get:function(){return TS.PeriodicExportingMetricReader}});var SS=p_();Object.defineProperty(g,"InMemoryMetricExporter",{enumerable:!0,get:function(){return SS.InMemoryMetricExporter}});var AS=E_();Object.defineProperty(g,"ConsoleMetricExporter",{enumerable:!0,get:function(){return AS.ConsoleMetricExporter}});var OS=Oe();Object.defineProperty(g,"InstrumentType",{enumerable:!0,get:function(){return OS.InstrumentType}});var RS=q_();Object.defineProperty(g,"MeterProvider",{enumerable:!0,get:function(){return RS.MeterProvider}});var De=Bi();Object.defineProperty(g,"DefaultAggregation",{enumerable:!0,get:function(){return De.DefaultAggregation}});Object.defineProperty(g,"ExplicitBucketHistogramAggregation",{enumerable:!0,get:function(){return De.ExplicitBucketHistogramAggregation}});Object.defineProperty(g,"ExponentialHistogramAggregation",{enumerable:!0,get:function(){return De.ExponentialHistogramAggregation}});Object.defineProperty(g,"DropAggregation",{enumerable:!0,get:function(){return De.DropAggregation}});Object.defineProperty(g,"HistogramAggregation",{enumerable:!0,get:function(){return De.HistogramAggregation}});Object.defineProperty(g,"LastValueAggregation",{enumerable:!0,get:function(){return De.LastValueAggregation}});Object.defineProperty(g,"SumAggregation",{enumerable:!0,get:function(){return De.SumAggregation}});Object.defineProperty(g,"Aggregation",{enumerable:!0,get:function(){return De.Aggregation}});var bS=H_();Object.defineProperty(g,"View",{enumerable:!0,get:function(){return bS.View}});var PS=me();Object.defineProperty(g,"TimeoutError",{enumerable:!0,get:function(){return PS.TimeoutError}})});var X_=c(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.AbstractAsyncHooksContextManager=void 0;var yS=J("events"),vS=["addListener","on","once","prependListener","prependOnceListener"],gu=class{constructor(){this._kOtListeners=Symbol("OtListeners"),this._wrapped=!1}bind(e,t){return t instanceof yS.EventEmitter?this._bindEventEmitter(e,t):typeof t=="function"?this._bindFunction(e,t):t}_bindFunction(e,t){let n=this,i=function(...s){return n.with(e,()=>t.apply(this,s))};return Object.defineProperty(i,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),i}_bindEventEmitter(e,t){return this._getPatchMap(t)!==void 0||(this._createPatchMap(t),vS.forEach(i=>{t[i]!==void 0&&(t[i]=this._patchAddListener(t,t[i],e))}),typeof t.removeListener=="function"&&(t.removeListener=this._patchRemoveListener(t,t.removeListener)),typeof t.off=="function"&&(t.off=this._patchRemoveListener(t,t.off)),typeof t.removeAllListeners=="function"&&(t.removeAllListeners=this._patchRemoveAllListeners(t,t.removeAllListeners))),t}_patchRemoveListener(e,t){let n=this;return function(i,s){var o;let a=(o=n._getPatchMap(e))===null||o===void 0?void 0:o[i];if(a===void 0)return t.call(this,i,s);let u=a.get(s);return t.call(this,i,u||s)}}_patchRemoveAllListeners(e,t){let n=this;return function(i){let s=n._getPatchMap(e);return s!==void 0&&(arguments.length===0?n._createPatchMap(e):s[i]!==void 0&&delete s[i]),t.apply(this,arguments)}}_patchAddListener(e,t,n){let i=this;return function(s,o){if(i._wrapped)return t.call(this,s,o);let a=i._getPatchMap(e);a===void 0&&(a=i._createPatchMap(e));let u=a[s];u===void 0&&(u=new WeakMap,a[s]=u);let l=i.bind(n,o);u.set(o,l),i._wrapped=!0;try{return t.call(this,s,l)}finally{i._wrapped=!1}}}_createPatchMap(e){let t=Object.create(null);return e[this._kOtListeners]=t,t}_getPatchMap(e){return e[this._kOtListeners]}};_s.AbstractAsyncHooksContextManager=gu});var $_=c(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});hs.AsyncLocalStorageContextManager=void 0;var IS=(h(),f(d)),LS=J("async_hooks"),MS=X_(),Tu=class extends MS.AbstractAsyncHooksContextManager{constructor(){super(),this._asyncLocalStorage=new LS.AsyncLocalStorage}active(){var e;return(e=this._asyncLocalStorage.getStore())!==null&&e!==void 0?e:IS.ROOT_CONTEXT}with(e,t,n,...i){let s=n==null?t:t.bind(n);return this._asyncLocalStorage.run(e,s,...i)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}};hs.AsyncLocalStorageContextManager=Tu});var Ru=c(Be=>{"use strict";Object.defineProperty(Be,"__esModule",{value:!0});Be.toAnyValue=Be.toKeyValue=Be.toAttributes=void 0;function BS(r){return Object.keys(r).map(e=>Au(e,r[e]))}Be.toAttributes=BS;function Au(r,e){return{key:r,value:Ou(e)}}Be.toKeyValue=Au;function Ou(r){let e=typeof r;return e==="string"?{stringValue:r}:e==="number"?Number.isInteger(r)?{intValue:r}:{doubleValue:r}:e==="boolean"?{boolValue:r}:r instanceof Uint8Array?{bytesValue:r}:Array.isArray(r)?{arrayValue:{values:r.map(Ou)}}:e==="object"&&r!=null?{kvlistValue:{values:Object.entries(r).map(([t,n])=>Au(t,n))}}:{}}Be.toAnyValue=Ou});var Z_=c(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.toOtlpSpanEvent=Ue.toOtlpLink=Ue.sdkSpanToOtlpSpan=void 0;var bu=Ru();function US(r,e){var t;let n=r.spanContext(),i=r.status;return{traceId:e.encodeSpanContext(n.traceId),spanId:e.encodeSpanContext(n.spanId),parentSpanId:e.encodeOptionalSpanContext(r.parentSpanId),traceState:(t=n.traceState)===null||t===void 0?void 0:t.serialize(),name:r.name,kind:r.kind==null?0:r.kind+1,startTimeUnixNano:e.encodeHrTime(r.startTime),endTimeUnixNano:e.encodeHrTime(r.endTime),attributes:(0,bu.toAttributes)(r.attributes),droppedAttributesCount:r.droppedAttributesCount,events:r.events.map(s=>Q_(s,e)),droppedEventsCount:r.droppedEventsCount,status:{code:i.code,message:i.message},links:r.links.map(s=>Y_(s,e)),droppedLinksCount:r.droppedLinksCount}}Ue.sdkSpanToOtlpSpan=US;function Y_(r,e){var t;return{attributes:r.attributes?(0,bu.toAttributes)(r.attributes):[],spanId:e.encodeSpanContext(r.context.spanId),traceId:e.encodeSpanContext(r.context.traceId),traceState:(t=r.context.traceState)===null||t===void 0?void 0:t.serialize(),droppedAttributesCount:r.droppedAttributesCount||0}}Ue.toOtlpLink=Y_;function Q_(r,e){return{attributes:r.attributes?(0,bu.toAttributes)(r.attributes):[],name:r.name,timeUnixNano:e.encodeHrTime(r.time),droppedAttributesCount:r.droppedAttributesCount||0}}Ue.toOtlpSpanEvent=Q_});var nh=c(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.getOtlpEncoder=oe.encodeAsString=oe.encodeAsLongBits=oe.toLongBits=oe.hrTimeToNanos=void 0;var Es=S(),qS=BigInt(1e9);function Pu(r){return BigInt(r[0])*qS+BigInt(r[1])}oe.hrTimeToNanos=Pu;function eh(r){let e=Number(BigInt.asUintN(32,r)),t=Number(BigInt.asUintN(32,r>>BigInt(32)));return{low:e,high:t}}oe.toLongBits=eh;function yu(r){let e=Pu(r);return eh(e)}oe.encodeAsLongBits=yu;function th(r){return Pu(r).toString()}oe.encodeAsString=th;var GS=typeof BigInt<"u"?th:Es.hrTimeToNanoseconds;function J_(r){return r}function rh(r){if(r!==void 0)return(0,Es.hexToBase64)(r)}var VS={encodeHrTime:yu,encodeSpanContext:Es.hexToBase64,encodeOptionalSpanContext:rh};function jS(r){var e,t;if(r===void 0)return VS;let n=(e=r.useLongBits)!==null&&e!==void 0?e:!0,i=(t=r.useHex)!==null&&t!==void 0?t:!1;return{encodeHrTime:n?yu:GS,encodeSpanContext:i?J_:Es.hexToBase64,encodeOptionalSpanContext:i?J_:rh}}oe.getOtlpEncoder=jS});var vu=c(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.createExportTraceServiceRequest=void 0;var FS=Ru(),HS=Z_(),kS=nh();function XS(r,e){let t=(0,kS.getOtlpEncoder)(e);return{resourceSpans:WS(r,t)}}ms.createExportTraceServiceRequest=XS;function $S(r){let e=new Map;for(let t of r){let n=e.get(t.resource);n||(n=new Map,e.set(t.resource,n));let i=`${t.instrumentationLibrary.name}@${t.instrumentationLibrary.version||""}:${t.instrumentationLibrary.schemaUrl||""}`,s=n.get(i);s||(s=[],n.set(i,s)),s.push(t)}return e}function WS(r,e){let t=$S(r),n=[],i=t.entries(),s=i.next();for(;!s.done;){let[o,a]=s.value,u=[],l=a.values(),_=l.next();for(;!_.done;){let O=_.value;if(O.length>0){let{name:D,version:z,schemaUrl:I}=O[0].instrumentationLibrary,U=O.map(L=>(0,HS.sdkSpanToOtlpSpan)(L,e));u.push({scope:{name:D,version:z},spans:U,schemaUrl:I})}_=l.next()}let E={resource:{attributes:(0,FS.toAttributes)(o.attributes),droppedAttributesCount:0},scopeSpans:u,schemaUrl:void 0};n.push(E),s=i.next()}return n}});var oh=c(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.parseRetryAfterToMills=C.isExportRetryable=C.invalidTimeout=C.configureExporterTimeout=C.appendRootPathToUrlIfNeeded=C.appendResourcePathToUrl=C.parseHeaders=C.DEFAULT_EXPORT_BACKOFF_MULTIPLIER=C.DEFAULT_EXPORT_MAX_BACKOFF=C.DEFAULT_EXPORT_INITIAL_BACKOFF=C.DEFAULT_EXPORT_MAX_ATTEMPTS=void 0;var Iu=(h(),f(d)),ih=S(),sh=1e4;C.DEFAULT_EXPORT_MAX_ATTEMPTS=5;C.DEFAULT_EXPORT_INITIAL_BACKOFF=1e3;C.DEFAULT_EXPORT_MAX_BACKOFF=5e3;C.DEFAULT_EXPORT_BACKOFF_MULTIPLIER=1.5;function KS(r={}){let e={};return Object.entries(r).forEach(([t,n])=>{typeof n<"u"?e[t]=String(n):Iu.diag.warn(`Header "${t}" has wrong value and will be ignored`)}),e}C.parseHeaders=KS;function zS(r,e){return r.endsWith("/")||(r=r+"/"),r+e}C.appendResourcePathToUrl=zS;function YS(r){try{let e=new URL(r);return e.pathname===""&&(e.pathname=e.pathname+"/"),e.toString()}catch{return Iu.diag.warn(`Could not parse export URL: '${r}'`),r}}C.appendRootPathToUrlIfNeeded=YS;function QS(r){return typeof r=="number"?r<=0?Lu(r,sh):r:ZS()}C.configureExporterTimeout=QS;function ZS(){var r;let e=Number((r=(0,ih.getEnv)().OTEL_EXPORTER_OTLP_TRACES_TIMEOUT)!==null&&r!==void 0?r:(0,ih.getEnv)().OTEL_EXPORTER_OTLP_TIMEOUT);return e<=0?Lu(e,sh):e}function Lu(r,e){return Iu.diag.warn("Timeout must be greater than 0",r),e}C.invalidTimeout=Lu;function JS(r){return[429,502,503,504].includes(r)}C.isExportRetryable=JS;function eA(r){if(r==null)return-1;let e=Number.parseInt(r,10);if(Number.isInteger(e))return e>0?e*1e3:-1;let t=new Date(r).getTime()-Date.now();return t>=0?t:0}C.parseRetryAfterToMills=eA});var uh=c(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.OTLPExporterBase=void 0;var ah=(h(),f(d)),xr=S(),tA=oh(),Mu=class{constructor(e={}){this._sendingPromises=[],this.url=this.getDefaultUrl(e),typeof e.hostname=="string"&&(this.hostname=e.hostname),this.shutdown=this.shutdown.bind(this),this._shutdownOnce=new xr.BindOnceFuture(this._shutdown,this),this._concurrencyLimit=typeof e.concurrencyLimit=="number"?e.concurrencyLimit:30,this.timeoutMillis=(0,tA.configureExporterTimeout)(e.timeoutMillis),this.onInit(e)}export(e,t){if(this._shutdownOnce.isCalled){t({code:xr.ExportResultCode.FAILED,error:new Error("Exporter has been shutdown")});return}if(this._sendingPromises.length>=this._concurrencyLimit){t({code:xr.ExportResultCode.FAILED,error:new Error("Concurrent export limit reached")});return}this._export(e).then(()=>{t({code:xr.ExportResultCode.SUCCESS})}).catch(n=>{t({code:xr.ExportResultCode.FAILED,error:n})})}_export(e){return new Promise((t,n)=>{try{ah.diag.debug("items to be sent",e),this.send(e,t,n)}catch(i){n(i)}})}shutdown(){return this._shutdownOnce.call()}forceFlush(){return Promise.all(this._sendingPromises).then(()=>{})}_shutdown(){return ah.diag.debug("shutdown started"),this.onShutdown(),this.forceFlush()}};gs.OTLPExporterBase=Mu});var _h=c((AP,dh)=>{"use strict";dh.exports=iA;function iA(r,e){for(var t=new Array(arguments.length-1),n=0,i=2,s=!0;i<arguments.length;)t[n++]=arguments[i++];return new Promise(function(a,u){t[n]=function(_){if(s)if(s=!1,_)u(_);else{for(var E=new Array(arguments.length-1),O=0;O<E.length;)E[O++]=arguments[O];a.apply(null,E)}};try{r.apply(e||null,t)}catch(l){s&&(s=!1,u(l))}})}});var Eh=c(fh=>{"use strict";var Ss=fh;Ss.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&e.charAt(t)==="=";)++n;return Math.ceil(e.length*3)/4-n};var rr=new Array(64),ph=new Array(123);for(le=0;le<64;)ph[rr[le]=le<26?le+65:le<52?le+71:le<62?le-4:le-59|43]=le++;var le;Ss.encode=function(e,t,n){for(var i=null,s=[],o=0,a=0,u;t<n;){var l=e[t++];switch(a){case 0:s[o++]=rr[l>>2],u=(l&3)<<4,a=1;break;case 1:s[o++]=rr[u|l>>4],u=(l&15)<<2,a=2;break;case 2:s[o++]=rr[u|l>>6],s[o++]=rr[l&63],a=0;break}o>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,s)),o=0)}return a&&(s[o++]=rr[u],s[o++]=61,a===1&&(s[o++]=61)),i?(o&&i.push(String.fromCharCode.apply(String,s.slice(0,o))),i.join("")):String.fromCharCode.apply(String,s.slice(0,o))};var hh="invalid encoding";Ss.decode=function(e,t,n){for(var i=n,s=0,o,a=0;a<e.length;){var u=e.charCodeAt(a++);if(u===61&&s>1)break;if((u=ph[u])===void 0)throw Error(hh);switch(s){case 0:o=u,s=1;break;case 1:t[n++]=o<<2|(u&48)>>4,o=u,s=2;break;case 2:t[n++]=(o&15)<<4|(u&60)>>2,o=u,s=3;break;case 3:t[n++]=(o&3)<<6|u,s=0;break}}if(s===1)throw Error(hh);return n-i};Ss.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}});var gh=c((RP,mh)=>{"use strict";mh.exports=As;function As(){this._listeners={}}As.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this};As.prototype.off=function(e,t){if(e===void 0)this._listeners={};else if(t===void 0)this._listeners[e]=[];else for(var n=this._listeners[e],i=0;i<n.length;)n[i].fn===t?n.splice(i,1):++i;return this};As.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],i=1;i<arguments.length;)n.push(arguments[i++]);for(i=0;i<t.length;)t[i].fn.apply(t[i++].ctx,n)}return this}});var Ph=c((bP,bh)=>{"use strict";bh.exports=Th(Th);function Th(r){return typeof Float32Array<"u"?function(){var e=new Float32Array([-0]),t=new Uint8Array(e.buffer),n=t[3]===128;function i(u,l,_){e[0]=u,l[_]=t[0],l[_+1]=t[1],l[_+2]=t[2],l[_+3]=t[3]}function s(u,l,_){e[0]=u,l[_]=t[3],l[_+1]=t[2],l[_+2]=t[1],l[_+3]=t[0]}r.writeFloatLE=n?i:s,r.writeFloatBE=n?s:i;function o(u,l){return t[0]=u[l],t[1]=u[l+1],t[2]=u[l+2],t[3]=u[l+3],e[0]}function a(u,l){return t[3]=u[l],t[2]=u[l+1],t[1]=u[l+2],t[0]=u[l+3],e[0]}r.readFloatLE=n?o:a,r.readFloatBE=n?a:o}():function(){function e(n,i,s,o){var a=i<0?1:0;if(a&&(i=-i),i===0)n(1/i>0?0:2147483648,s,o);else if(isNaN(i))n(2143289344,s,o);else if(i>34028234663852886e22)n((a<<31|2139095040)>>>0,s,o);else if(i<11754943508222875e-54)n((a<<31|Math.round(i/1401298464324817e-60))>>>0,s,o);else{var u=Math.floor(Math.log(i)/Math.LN2),l=Math.round(i*Math.pow(2,-u)*8388608)&8388607;n((a<<31|u+127<<23|l)>>>0,s,o)}}r.writeFloatLE=e.bind(null,Sh),r.writeFloatBE=e.bind(null,Ah);function t(n,i,s){var o=n(i,s),a=(o>>31)*2+1,u=o>>>23&255,l=o&8388607;return u===255?l?NaN:a*(1/0):u===0?a*1401298464324817e-60*l:a*Math.pow(2,u-150)*(l+8388608)}r.readFloatLE=t.bind(null,Oh),r.readFloatBE=t.bind(null,Rh)}(),typeof Float64Array<"u"?function(){var e=new Float64Array([-0]),t=new Uint8Array(e.buffer),n=t[7]===128;function i(u,l,_){e[0]=u,l[_]=t[0],l[_+1]=t[1],l[_+2]=t[2],l[_+3]=t[3],l[_+4]=t[4],l[_+5]=t[5],l[_+6]=t[6],l[_+7]=t[7]}function s(u,l,_){e[0]=u,l[_]=t[7],l[_+1]=t[6],l[_+2]=t[5],l[_+3]=t[4],l[_+4]=t[3],l[_+5]=t[2],l[_+6]=t[1],l[_+7]=t[0]}r.writeDoubleLE=n?i:s,r.writeDoubleBE=n?s:i;function o(u,l){return t[0]=u[l],t[1]=u[l+1],t[2]=u[l+2],t[3]=u[l+3],t[4]=u[l+4],t[5]=u[l+5],t[6]=u[l+6],t[7]=u[l+7],e[0]}function a(u,l){return t[7]=u[l],t[6]=u[l+1],t[5]=u[l+2],t[4]=u[l+3],t[3]=u[l+4],t[2]=u[l+5],t[1]=u[l+6],t[0]=u[l+7],e[0]}r.readDoubleLE=n?o:a,r.readDoubleBE=n?a:o}():function(){function e(n,i,s,o,a,u){var l=o<0?1:0;if(l&&(o=-o),o===0)n(0,a,u+i),n(1/o>0?0:2147483648,a,u+s);else if(isNaN(o))n(0,a,u+i),n(2146959360,a,u+s);else if(o>17976931348623157e292)n(0,a,u+i),n((l<<31|2146435072)>>>0,a,u+s);else{var _;if(o<22250738585072014e-324)_=o/5e-324,n(_>>>0,a,u+i),n((l<<31|_/4294967296)>>>0,a,u+s);else{var E=Math.floor(Math.log(o)/Math.LN2);E===1024&&(E=1023),_=o*Math.pow(2,-E),n(_*4503599627370496>>>0,a,u+i),n((l<<31|E+1023<<20|_*1048576&1048575)>>>0,a,u+s)}}}r.writeDoubleLE=e.bind(null,Sh,0,4),r.writeDoubleBE=e.bind(null,Ah,4,0);function t(n,i,s,o,a){var u=n(o,a+i),l=n(o,a+s),_=(l>>31)*2+1,E=l>>>20&2047,O=4294967296*(l&1048575)+u;return E===2047?O?NaN:_*(1/0):E===0?_*5e-324*O:_*Math.pow(2,E-1075)*(O+4503599627370496)}r.readDoubleLE=t.bind(null,Oh,0,4),r.readDoubleBE=t.bind(null,Rh,4,0)}(),r}function Sh(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}function Ah(r,e,t){e[t]=r>>>24,e[t+1]=r>>>16&255,e[t+2]=r>>>8&255,e[t+3]=r&255}function Oh(r,e){return(r[e]|r[e+1]<<8|r[e+2]<<16|r[e+3]<<24)>>>0}function Rh(r,e){return(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}});var yh=c((exports,module)=>{"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(r){}return null}});var Ih=c(vh=>{"use strict";var Nu=vh;Nu.length=function(e){for(var t=0,n=0,i=0;i<e.length;++i)n=e.charCodeAt(i),n<128?t+=1:n<2048?t+=2:(n&64512)===55296&&(e.charCodeAt(i+1)&64512)===56320?(++i,t+=4):t+=3;return t};Nu.read=function(e,t,n){var i=n-t;if(i<1)return"";for(var s=null,o=[],a=0,u;t<n;)u=e[t++],u<128?o[a++]=u:u>191&&u<224?o[a++]=(u&31)<<6|e[t++]&63:u>239&&u<365?(u=((u&7)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,o[a++]=55296+(u>>10),o[a++]=56320+(u&1023)):o[a++]=(u&15)<<12|(e[t++]&63)<<6|e[t++]&63,a>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,o)),a=0);return s?(a&&s.push(String.fromCharCode.apply(String,o.slice(0,a))),s.join("")):String.fromCharCode.apply(String,o.slice(0,a))};Nu.write=function(e,t,n){for(var i=n,s,o,a=0;a<e.length;++a)s=e.charCodeAt(a),s<128?t[n++]=s:s<2048?(t[n++]=s>>6|192,t[n++]=s&63|128):(s&64512)===55296&&((o=e.charCodeAt(a+1))&64512)===56320?(s=65536+((s&1023)<<10)+(o&1023),++a,t[n++]=s>>18|240,t[n++]=s>>12&63|128,t[n++]=s>>6&63|128,t[n++]=s&63|128):(t[n++]=s>>12|224,t[n++]=s>>6&63|128,t[n++]=s&63|128);return n-i}});var Mh=c((yP,Lh)=>{"use strict";Lh.exports=sA;function sA(r,e,t){var n=t||8192,i=n>>>1,s=null,o=n;return function(u){if(u<1||u>i)return r(u);o+u>n&&(s=r(n),o=0);var l=e.call(s,o,o+=u);return o&7&&(o=(o|7)+1),l}}});var Nh=c((vP,Ch)=>{"use strict";Ch.exports=V;var Dr=Ge();function V(r,e){this.lo=r>>>0,this.hi=e>>>0}var ut=V.zero=new V(0,0);ut.toNumber=function(){return 0};ut.zzEncode=ut.zzDecode=function(){return this};ut.length=function(){return 1};var oA=V.zeroHash="\0\0\0\0\0\0\0\0";V.fromNumber=function(e){if(e===0)return ut;var t=e<0;t&&(e=-e);var n=e>>>0,i=(e-n)/4294967296>>>0;return t&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new V(n,i)};V.from=function(e){if(typeof e=="number")return V.fromNumber(e);if(Dr.isString(e))if(Dr.Long)e=Dr.Long.fromString(e);else return V.fromNumber(parseInt(e,10));return e.low||e.high?new V(e.low>>>0,e.high>>>0):ut};V.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+n*4294967296)}return this.lo+this.hi*4294967296};V.prototype.toLong=function(e){return Dr.Long?new Dr.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var qe=String.prototype.charCodeAt;V.fromHash=function(e){return e===oA?ut:new V((qe.call(e,0)|qe.call(e,1)<<8|qe.call(e,2)<<16|qe.call(e,3)<<24)>>>0,(qe.call(e,4)|qe.call(e,5)<<8|qe.call(e,6)<<16|qe.call(e,7)<<24)>>>0)};V.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};V.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this};V.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this};V.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}});var Ge=c(wu=>{"use strict";var p=wu;p.asPromise=_h();p.base64=Eh();p.EventEmitter=gh();p.float=Ph();p.inquire=yh();p.utf8=Ih();p.pool=Mh();p.LongBits=Nh();p.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);p.global=p.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||wu;p.emptyArray=Object.freeze?Object.freeze([]):[];p.emptyObject=Object.freeze?Object.freeze({}):{};p.isInteger=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};p.isString=function(e){return typeof e=="string"||e instanceof String};p.isObject=function(e){return e&&typeof e=="object"};p.isset=p.isSet=function(e,t){var n=e[t];return n!=null&&e.hasOwnProperty(t)?typeof n!="object"||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1};p.Buffer=function(){try{var r=p.inquire("buffer").Buffer;return r.prototype.utf8Write?r:null}catch{return null}}();p._Buffer_from=null;p._Buffer_allocUnsafe=null;p.newBuffer=function(e){return typeof e=="number"?p.Buffer?p._Buffer_allocUnsafe(e):new p.Array(e):p.Buffer?p._Buffer_from(e):typeof Uint8Array>"u"?e:new Uint8Array(e)};p.Array=typeof Uint8Array<"u"?Uint8Array:Array;p.Long=p.global.dcodeIO&&p.global.dcodeIO.Long||p.global.Long||p.inquire("long");p.key2Re=/^true|false|0|1$/;p.key32Re=/^-?(?:0|[1-9][0-9]*)$/;p.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;p.longToHash=function(e){return e?p.LongBits.from(e).toHash():p.LongBits.zeroHash};p.longFromHash=function(e,t){var n=p.LongBits.fromHash(e);return p.Long?p.Long.fromBits(n.lo,n.hi,t):n.toNumber(!!t)};function wh(r,e,t){for(var n=Object.keys(e),i=0;i<n.length;++i)(r[n[i]]===void 0||!t)&&(r[n[i]]=e[n[i]]);return r}p.merge=wh;p.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function xh(r){function e(t,n){if(!(this instanceof e))return new e(t,n);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:new Error().stack||""}),n&&wh(this,n)}return e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return r},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),e}p.newError=xh;p.ProtocolError=xh("ProtocolError");p.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var i=Object.keys(this),s=i.length-1;s>-1;--s)if(t[i[s]]===1&&this[i[s]]!==void 0&&this[i[s]]!==null)return i[s]}};p.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}};p.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};p._configure=function(){var r=p.Buffer;if(!r){p._Buffer_from=p._Buffer_allocUnsafe=null;return}p._Buffer_from=r.from!==Uint8Array.from&&r.from||function(t,n){return new r(t,n)},p._Buffer_allocUnsafe=r.allocUnsafe||function(t){return new r(t)}}});var Vu=c((LP,qh)=>{"use strict";qh.exports=A;var ae=Ge(),xu,Os=ae.LongBits,Dh=ae.base64,Bh=ae.utf8;function Br(r,e,t){this.fn=r,this.len=e,this.next=void 0,this.val=t}function Bu(){}function aA(r){this.head=r.head,this.tail=r.tail,this.len=r.len,this.next=r.states}function A(){this.len=0,this.head=new Br(Bu,0,0),this.tail=this.head,this.states=null}var Uh=function(){return ae.Buffer?function(){return(A.create=function(){return new xu})()}:function(){return new A}};A.create=Uh();A.alloc=function(e){return new ae.Array(e)};ae.Array!==Array&&(A.alloc=ae.pool(A.alloc,ae.Array.prototype.subarray));A.prototype._push=function(e,t,n){return this.tail=this.tail.next=new Br(e,t,n),this.len+=t,this};function Uu(r,e,t){e[t]=r&255}function uA(r,e,t){for(;r>127;)e[t++]=r&127|128,r>>>=7;e[t]=r}function qu(r,e){this.len=r,this.next=void 0,this.val=e}qu.prototype=Object.create(Br.prototype);qu.prototype.fn=uA;A.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new qu((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this};A.prototype.int32=function(e){return e<0?this._push(Gu,10,Os.fromNumber(e)):this.uint32(e)};A.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function Gu(r,e,t){for(;r.hi;)e[t++]=r.lo&127|128,r.lo=(r.lo>>>7|r.hi<<25)>>>0,r.hi>>>=7;for(;r.lo>127;)e[t++]=r.lo&127|128,r.lo=r.lo>>>7;e[t++]=r.lo}A.prototype.uint64=function(e){var t=Os.from(e);return this._push(Gu,t.length(),t)};A.prototype.int64=A.prototype.uint64;A.prototype.sint64=function(e){var t=Os.from(e).zzEncode();return this._push(Gu,t.length(),t)};A.prototype.bool=function(e){return this._push(Uu,1,e?1:0)};function Du(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}A.prototype.fixed32=function(e){return this._push(Du,4,e>>>0)};A.prototype.sfixed32=A.prototype.fixed32;A.prototype.fixed64=function(e){var t=Os.from(e);return this._push(Du,4,t.lo)._push(Du,4,t.hi)};A.prototype.sfixed64=A.prototype.fixed64;A.prototype.float=function(e){return this._push(ae.float.writeFloatLE,4,e)};A.prototype.double=function(e){return this._push(ae.float.writeDoubleLE,8,e)};var cA=ae.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var i=0;i<e.length;++i)t[n+i]=e[i]};A.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(Uu,1,0);if(ae.isString(e)){var n=A.alloc(t=Dh.length(e));Dh.decode(e,n,0),e=n}return this.uint32(t)._push(cA,t,e)};A.prototype.string=function(e){var t=Bh.length(e);return t?this.uint32(t)._push(Bh.write,t,e):this._push(Uu,1,0)};A.prototype.fork=function(){return this.states=new aA(this),this.head=this.tail=new Br(Bu,0,0),this.len=0,this};A.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Br(Bu,0,0),this.len=0),this};A.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this};A.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t};A._configure=function(r){xu=r,A.create=Uh(),xu._configure()}});var jh=c((MP,Vh)=>{"use strict";Vh.exports=Te;var Gh=Vu();(Te.prototype=Object.create(Gh.prototype)).constructor=Te;var Ve=Ge();function Te(){Gh.call(this)}Te._configure=function(){Te.alloc=Ve._Buffer_allocUnsafe,Te.writeBytesBuffer=Ve.Buffer&&Ve.Buffer.prototype instanceof Uint8Array&&Ve.Buffer.prototype.set.name==="set"?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var i=0;i<e.length;)t[n++]=e[i++]}};Te.prototype.bytes=function(e){Ve.isString(e)&&(e=Ve._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(Te.writeBytesBuffer,t,e),this};function lA(r,e,t){r.length<40?Ve.utf8.write(r,e,t):e.utf8Write?e.utf8Write(r,t):e.write(r,t)}Te.prototype.string=function(e){var t=Ve.Buffer.byteLength(e);return this.uint32(t),t&&this._push(lA,t,e),this};Te._configure()});var Hu=c((CP,$h)=>{"use strict";$h.exports=w;var de=Ge(),Fu,kh=de.LongBits,dA=de.utf8;function _e(r,e){return RangeError("index out of range: "+r.pos+" + "+(e||1)+" > "+r.len)}function w(r){this.buf=r,this.pos=0,this.len=r.length}var Fh=typeof Uint8Array<"u"?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new w(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new w(e);throw Error("illegal buffer")},Xh=function(){return de.Buffer?function(t){return(w.create=function(i){return de.Buffer.isBuffer(i)?new Fu(i):Fh(i)})(t)}:Fh};w.create=Xh();w.prototype._slice=de.Array.prototype.subarray||de.Array.prototype.slice;w.prototype.uint32=function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,_e(this,10);return e}}();w.prototype.int32=function(){return this.uint32()|0};w.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function ju(){var r=new kh(0,0),e=0;if(this.len-this.pos>4){for(;e<4;++e)if(r.lo=(r.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return r;if(r.lo=(r.lo|(this.buf[this.pos]&127)<<28)>>>0,r.hi=(r.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return r;e=0}else{for(;e<3;++e){if(this.pos>=this.len)throw _e(this);if(r.lo=(r.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return r}return r.lo=(r.lo|(this.buf[this.pos++]&127)<<e*7)>>>0,r}if(this.len-this.pos>4){for(;e<5;++e)if(r.hi=(r.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return r}else for(;e<5;++e){if(this.pos>=this.len)throw _e(this);if(r.hi=(r.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return r}throw Error("invalid varint encoding")}w.prototype.bool=function(){return this.uint32()!==0};function Rs(r,e){return(r[e-4]|r[e-3]<<8|r[e-2]<<16|r[e-1]<<24)>>>0}w.prototype.fixed32=function(){if(this.pos+4>this.len)throw _e(this,4);return Rs(this.buf,this.pos+=4)};w.prototype.sfixed32=function(){if(this.pos+4>this.len)throw _e(this,4);return Rs(this.buf,this.pos+=4)|0};function Hh(){if(this.pos+8>this.len)throw _e(this,8);return new kh(Rs(this.buf,this.pos+=4),Rs(this.buf,this.pos+=4))}w.prototype.float=function(){if(this.pos+4>this.len)throw _e(this,4);var e=de.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e};w.prototype.double=function(){if(this.pos+8>this.len)throw _e(this,4);var e=de.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e};w.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw _e(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,n);if(t===n){var i=de.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,n)};w.prototype.string=function(){var e=this.bytes();return dA.read(e,0,e.length)};w.prototype.skip=function(e){if(typeof e=="number"){if(this.pos+e>this.len)throw _e(this,e);this.pos+=e}else do if(this.pos>=this.len)throw _e(this);while(this.buf[this.pos++]&128);return this};w.prototype.skipType=function(r){switch(r){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(r=this.uint32()&7)!==4;)this.skipType(r);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+r+" at offset "+this.pos)}return this};w._configure=function(r){Fu=r,w.create=Xh(),Fu._configure();var e=de.Long?"toLong":"toNumber";de.merge(w.prototype,{int64:function(){return ju.call(this)[e](!1)},uint64:function(){return ju.call(this)[e](!0)},sint64:function(){return ju.call(this).zzDecode()[e](!1)},fixed64:function(){return Hh.call(this)[e](!0)},sfixed64:function(){return Hh.call(this)[e](!1)}})}});var Yh=c((NP,zh)=>{"use strict";zh.exports=ct;var Kh=Hu();(ct.prototype=Object.create(Kh.prototype)).constructor=ct;var Wh=Ge();function ct(r){Kh.call(this,r)}ct._configure=function(){Wh.Buffer&&(ct.prototype._slice=Wh.Buffer.prototype.slice)};ct.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))};ct._configure()});var Zh=c((wP,Qh)=>{"use strict";Qh.exports=Ur;var ku=Ge();(Ur.prototype=Object.create(ku.EventEmitter.prototype)).constructor=Ur;function Ur(r,e,t){if(typeof r!="function")throw TypeError("rpcImpl must be a function");ku.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!e,this.responseDelimited=!!t}Ur.prototype.rpcCall=function r(e,t,n,i,s){if(!i)throw TypeError("request must be specified");var o=this;if(!s)return ku.asPromise(r,o,e,t,n,i);if(!o.rpcImpl){setTimeout(function(){s(Error("already ended"))},0);return}try{return o.rpcImpl(e,t[o.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(u,l){if(u)return o.emit("error",u,e),s(u);if(l===null){o.end(!0);return}if(!(l instanceof n))try{l=n[o.responseDelimited?"decodeDelimited":"decode"](l)}catch(_){return o.emit("error",_,e),s(_)}return o.emit("data",l,e),s(null,l)})}catch(a){o.emit("error",a,e),setTimeout(function(){s(a)},0);return}};Ur.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var ep=c(Jh=>{"use strict";var _A=Jh;_A.Service=Zh()});var rp=c((DP,tp)=>{"use strict";tp.exports={}});var sp=c(ip=>{"use strict";var Z=ip;Z.build="minimal";Z.Writer=Vu();Z.BufferWriter=jh();Z.Reader=Hu();Z.BufferReader=Yh();Z.util=Ge();Z.rpc=ep();Z.roots=rp();Z.configure=np;function np(){Z.util._configure(),Z.Writer._configure(Z.BufferWriter),Z.Reader._configure(Z.BufferReader)}np()});var ap=c((UP,op)=>{"use strict";op.exports=sp()});var N=K(zo(),1);h();ea();var Ep=K(Od(),1),or=K(tt(),1),mp=K(qd(),1),gp=K(k_(),1),Tp=K(ie(),1),ar=K(Hr(),1),Sp=K($_(),1),he=K(S(),1);h();var CS=Symbol.for("@vercel/request-context");function Jt(){return globalThis[CS]?.get()}var Su=K(ie(),1);function ps(r){return Object.fromEntries(Object.entries(r).filter(([e,t])=>t!==void 0))}function W_(r){return r?r.split("::").at(-1):void 0}function K_(r=Jt(),e){if(!r)return;let t=e?wS(e,r.headers):void 0;return ps({[Su.SemanticAttributes.HTTP_HOST]:r.headers.host,[Su.SemanticAttributes.HTTP_USER_AGENT]:r.headers["user-agent"],"http.referer":r.headers.referer,"vercel.request_id":W_(r.headers["x-vercel-id"]),"vercel.matched_path":r.headers["x-matched-path"],"vercel.edge_region":r.headers["x-vercel-edge-region"],...t})}var NS={keys(r){return[]},get(r,e){return r[e.toLocaleLowerCase()]}};function wS(r,e){if(typeof r=="function")return r(e,NS);let t={};for(let[n,i]of Object.entries(r)){let s=e[i.toLocaleLowerCase()];s!==void 0&&(t[n]=s)}return t}h();function wr(r){return(r&d.TraceFlags.SAMPLED)!==0}var fs=class{constructor(e,t){this.processors=e;this.attributesFromHeaders=t;this.rootSpanIds=new Map;this.waitSpanEnd=new Map}forceFlush(){return Promise.all(this.processors.map(e=>e.forceFlush().catch(t=>{d.diag.error("@vercel/otel: forceFlush failed:",t)}))).then(()=>{})}shutdown(){return Promise.all(this.processors.map(e=>e.shutdown().catch(()=>{}))).then(()=>{})}onStart(e,t){let{traceId:n,spanId:i,traceFlags:s}=e.spanContext(),o=!e.parentSpanId||!this.rootSpanIds.has(n);if(o?this.rootSpanIds.set(n,{rootSpanId:i,open:[]}):this.rootSpanIds.get(n)?.open.push(e),o&&wr(s)){let a=Jt(),u=K_(a,this.attributesFromHeaders);u&&e.setAttributes(u),a&&a.waitUntil(async()=>{if(this.rootSpanIds.has(n)){let l=new Promise(E=>{this.waitSpanEnd.set(n,E)}),_;await Promise.race([l,new Promise(E=>{_=setTimeout(()=>{this.waitSpanEnd.delete(n),E(void 0)},50)})]),_&&clearTimeout(_)}return this.forceFlush()})}for(let a of this.processors)a.onStart(e,t)}onEnd(e){let{traceId:t,spanId:n,traceFlags:i}=e.spanContext(),s=wr(i),o=this.rootSpanIds.get(t),a=o?.rootSpanId===n;if(s){let u=DS(e);u&&Object.assign(e.attributes,u)}if(a){if(this.rootSpanIds.delete(t),o.open.length>0){for(let u of o.open)if(!u.ended&&u.spanContext().spanId!==n)try{u.end()}catch(l){d.diag.error("@vercel/otel: onEnd failed:",l)}}}else if(o)for(let u=0;u<o.open.length;u++)o.open[u]?.spanContext().spanId===n&&o.open.splice(u,1);for(let u of this.processors)u.onEnd(e);if(a){let u=this.waitSpanEnd.get(t);u&&(this.waitSpanEnd.delete(t),u())}}},xS={[d.SpanKind.INTERNAL]:"internal",[d.SpanKind.SERVER]:"server",[d.SpanKind.CLIENT]:"client",[d.SpanKind.PRODUCER]:"producer",[d.SpanKind.CONSUMER]:"consumer"};function DS(r){let{kind:e,attributes:t}=r,{"operation.name":n,"resource.name":i,"span.type":s,"next.span_type":o,"http.method":a,"http.route":u}=t;if(n)return;let l=i??(a&&typeof a=="string"&&u&&typeof u=="string"?`${a} ${u}`:u);if(r.kind===d.SpanKind.SERVER&&a&&u&&typeof a=="string"&&typeof u=="string")return{"operation.name":"web.request","resource.name":l};let _=r.instrumentationLibrary.name,E=o??s;if(E&&typeof E=="string"){let O=z_(_,E);return u?{"operation.name":O,"resource.name":l}:{"operation.name":O}}return{"operation.name":z_(_,e===d.SpanKind.INTERNAL?"":xS[e])}}function z_(r,e){if(!r)return e;let t=r.replace(/[ @./]/g,"_");return t.startsWith("_")&&(t=t.slice(1)),e?`${t}.${e}`:t}var lh=K(vu(),1);var ch=K(uh(),1);h();var er=class extends ch.OTLPExporterBase{constructor(e={}){super(e),e.headers&&(this._headers=e.headers)}onShutdown(){d.diag.debug("@vercel/otel/otlp: onShutdown")}onInit(){d.diag.debug("@vercel/otel/otlp: onInit")}send(e,t,n){if(this._shutdownOnce.isCalled){d.diag.debug("@vercel/otel/otlp: Shutdown already started. Cannot send objects");return}let i=this.convert(e),s,o,a;try{({body:s,contentType:o,headers:a}=this.toMessage(i))}catch(l){d.diag.warn("@vercel/otel/otlp: no proto",l);return}let u=fetch(this.url,{method:"POST",body:s,headers:{...this._headers,...a,"Content-Type":o,"User-Agent":"OTel-OTLP-Exporter-JavaScript/0.46.0"},next:{internal:!0}}).then(l=>{d.diag.debug("@vercel/otel/otlp: onSuccess",l.status,l.statusText),t(),l.arrayBuffer().catch(()=>{})}).catch(l=>{d.diag.error("@vercel/otel/otlp: onError",l),n(l)}).finally(()=>{let l=this._sendingPromises.indexOf(u);this._sendingPromises.splice(l,1)});this._sendingPromises.push(u)}getDefaultUrl(e){throw new Error("Method not implemented.")}};var rA="v1/traces",nA=`http://localhost:4318/${rA}`;function Ts(r){return typeof r.url=="string"?r.url:nA}var tr=class{constructor(e={}){this.impl=new Cu(e)}export(e,t){this.impl.export(e,t)}shutdown(){return this.impl.shutdown()}forceFlush(){return this.impl.forceFlush()}},Cu=class extends er{convert(e){return(0,lh.createExportTraceServiceRequest)(e,{useHex:!0,useLongBits:!1})}toMessage(e){return{body:JSON.stringify(e),contentType:"application/json"}}getDefaultUrl(e){return Ts(e)}};var dp=K(vu(),1);var up=K(ap(),1);function cp(r){let e=new up.Writer;return hA(r,e),e.finish()}function hA(r,e){if(r.resourceSpans!=null&&r.resourceSpans.length)for(let t=0;t<r.resourceSpans.length;++t)pA(r.resourceSpans[t],e.uint32(10).fork()).ldelim();return e}function pA(r,e){if(r.resource!=null&&fA(r.resource,e.uint32(10).fork()).ldelim(),r.scopeSpans!=null&&r.scopeSpans.length)for(let t=0;t<r.scopeSpans.length;++t)EA(r.scopeSpans[t],e.uint32(18).fork()).ldelim();return r.schemaUrl!=null&&e.uint32(26).string(r.schemaUrl),e}function fA(r,e){if(r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)nr(r.attributes[t],e.uint32(10).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(16).uint32(r.droppedAttributesCount),e}function EA(r,e){if(r.scope!=null&&TA(r.scope,e.uint32(10).fork()).ldelim(),r.spans!=null&&r.spans.length)for(let t=0;t<r.spans.length;++t)SA(r.spans[t],e.uint32(18).fork()).ldelim();return r.schemaUrl!=null&&e.uint32(26).string(r.schemaUrl),e}function nr(r,e){return r.key!=null&&e.uint32(10).string(r.key),r.value!=null&&lp(r.value,e.uint32(18).fork()).ldelim(),e}function lp(r,e){return r.stringValue!=null&&e.uint32(10).string(r.stringValue),r.boolValue!=null&&e.uint32(16).bool(r.boolValue),r.intValue!=null&&e.uint32(24).int64(r.intValue),r.doubleValue!=null&&e.uint32(33).double(r.doubleValue),r.arrayValue!=null&&mA(r.arrayValue,e.uint32(42).fork()).ldelim(),r.kvlistValue!=null&&gA(r.kvlistValue,e.uint32(50).fork()).ldelim(),r.bytesValue!=null&&e.uint32(58).bytes(r.bytesValue),e}function mA(r,e){if(r.values!=null&&r.values.length)for(let t=0;t<r.values.length;++t)lp(r.values[t],e.uint32(10).fork()).ldelim();return e}function gA(r,e){if(r.values!=null&&r.values.length)for(let t=0;t<r.values.length;++t)nr(r.values[t],e.uint32(10).fork()).ldelim();return e}function TA(r,e){if(r.name!=null&&e.uint32(10).string(r.name),r.version!=null&&e.uint32(18).string(r.version),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)nr(r.attributes[t],e.uint32(26).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(32).uint32(r.droppedAttributesCount),e}function SA(r,e){if(r.traceId!=null&&e.uint32(10).bytes(r.traceId),r.spanId!=null&&e.uint32(18).bytes(r.spanId),r.traceState!=null&&e.uint32(26).string(r.traceState),r.parentSpanId!=null&&e.uint32(34).bytes(r.parentSpanId),r.name!=null&&e.uint32(42).string(r.name),r.kind!=null&&e.uint32(48).int32(r.kind),r.startTimeUnixNano!=null&&e.uint32(57).fixed64(r.startTimeUnixNano),r.endTimeUnixNano!=null&&e.uint32(65).fixed64(r.endTimeUnixNano),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)nr(r.attributes[t],e.uint32(74).fork()).ldelim();if(r.droppedAttributesCount!=null&&e.uint32(80).uint32(r.droppedAttributesCount),r.events!=null&&r.events.length)for(let t=0;t<r.events.length;++t)OA(r.events[t],e.uint32(90).fork()).ldelim();if(r.droppedEventsCount!=null&&e.uint32(96).uint32(r.droppedEventsCount),r.links!=null&&r.links.length)for(let t=0;t<r.links.length;++t)RA(r.links[t],e.uint32(106).fork()).ldelim();return r.droppedLinksCount!=null&&e.uint32(112).uint32(r.droppedLinksCount),r.status!=null&&AA(r.status,e.uint32(122).fork()).ldelim(),e}function AA(r,e){return r.message!=null&&e.uint32(18).string(r.message),r.code!=null&&e.uint32(24).int32(r.code),e}function OA(r,e){if(r.timeUnixNano!=null&&e.uint32(9).fixed64(r.timeUnixNano),r.name!=null&&e.uint32(18).string(r.name),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)nr(r.attributes[t],e.uint32(26).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(32).uint32(r.droppedAttributesCount),e}function RA(r,e){if(r.traceId!=null&&e.uint32(10).bytes(r.traceId),r.spanId!=null&&e.uint32(18).bytes(r.spanId),r.traceState!=null&&e.uint32(26).string(r.traceState),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)nr(r.attributes[t],e.uint32(34).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(40).uint32(r.droppedAttributesCount),e}var lt=class{constructor(e={}){this.impl=new Xu(e)}export(e,t){this.impl.export(e,t)}shutdown(){return this.impl.shutdown()}forceFlush(){return this.impl.forceFlush()}},Xu=class extends er{convert(e){return(0,dp.createExportTraceServiceRequest)(e,void 0)}toMessage(e){return{body:cp(e),contentType:"application/x-protobuf",headers:{accept:"application/x-protobuf"}}}getDefaultUrl(e){return Ts(e)}};h();var be=K(ie(),1);function _p(r,e){return r.replace(/\{(?<temp1>[^{}]+)\}/g,(t,n)=>{let i=e[n];return i!==void 0?String(i):t})}var ir=class{constructor(e={}){this.instrumentationName="@vercel/otel/fetch";this.instrumentationVersion="1.0.0";this.config=e}getConfig(){return this.config}setConfig(){}setTracerProvider(e){this.tracerProvider=e}setMeterProvider(){}enable(){this.disable();let{tracerProvider:e}=this;if(!e)return;let t=e.getTracer(this.instrumentationName,this.instrumentationVersion),n=this.config.ignoreUrls??[],i=(I,U)=>{if(U?.opentelemetry?.ignore!==void 0)return U.opentelemetry.ignore;if(n.length===0)return!1;let L=I.toString();return n.some(m=>typeof m=="string"?m==="*"?!0:L.startsWith(m):m.test(L))},s=process.env.VERCEL_URL||process.env.NEXT_PUBLIC_VERCEL_URL||null,o=process.env.VERCEL_BRANCH_URL||process.env.NEXT_PUBLIC_VERCEL_BRANCH_URL||null,a=this.config.propagateContextUrls??[],u=this.config.dontPropagateContextUrls??[],l=this.config.resourceNameTemplate,{attributesFromRequestHeaders:_,attributesFromResponseHeaders:E}=this.config,O=(I,U)=>{if(U?.opentelemetry?.propagateContext)return U.opentelemetry.propagateContext;let L=I.toString();return u.length>0&&u.some(m=>typeof m=="string"?m==="*"?!0:L.startsWith(m):m.test(L))?!1:s&&I.protocol==="https:"&&(I.host===s||I.host===o||I.host===Jt()?.headers.host)||!s&&I.protocol==="http:"&&I.hostname==="localhost"?!0:a.some(m=>typeof m=="string"?m==="*"?!0:L.startsWith(m):m.test(L))};process.env.NEXT_OTEL_FETCH_DISABLED="1";let D=globalThis.fetch;this.originalFetch=D;let z=async(I,U)=>{let L=U;if(L?.next?.internal)return D(I,L);let m=new Request(I instanceof Request?I.clone():I,L),Pe=new URL(m.url);if(i(Pe,L))return D(I,L);let Ps={[be.SemanticAttributes.HTTP_METHOD]:m.method,[be.SemanticAttributes.HTTP_URL]:m.url,[be.SemanticAttributes.HTTP_HOST]:Pe.host,[be.SemanticAttributes.HTTP_SCHEME]:Pe.protocol.replace(":",""),[be.SemanticAttributes.NET_PEER_NAME]:Pe.hostname,[be.SemanticAttributes.NET_PEER_PORT]:Pe.port},dt=l?_p(l,Ps):PA(m.url),Op=L?.opentelemetry?.spanName??`fetch ${m.method} ${m.url}`,Wu=d.context.active(),q=t.startSpan(Op,{kind:d.SpanKind.CLIENT,attributes:{...Ps,"operation.name":`fetch.${m.method}`,"resource.name":dt,...L?.opentelemetry?.attributes}},Wu);if(!q.isRecording()||!wr(q.spanContext().traceFlags))return q.end(),D(I,L);if(O(Pe,L)){let _t=d.trace.setSpan(Wu,q);d.propagation.inject(_t,m.headers,bA)}_&&hp(q,_,m.headers);try{let _t=Date.now(),ye=await D(I,{...L,headers:m.headers}),Rp=Date.now()-_t;return q.setAttribute(be.SemanticAttributes.HTTP_STATUS_CODE,ye.status),q.setAttribute("http.response_time",Rp),E&&hp(q,E,ye.headers),ye.status>=500&&$u(q,`Status: ${ye.status} (${ye.statusText})`),ye.body?yA(ye).then(ys=>{q.isRecording()&&(q.setAttribute(be.SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED,ys),q.end())},ys=>{q.isRecording()&&($u(q,ys),q.end())}):q.end(),ye}catch(_t){throw $u(q,_t),q.end(),_t}};globalThis.fetch=z}disable(){this.originalFetch&&(globalThis.fetch=this.originalFetch)}},bA={set(r,e,t){r.set(e,t)}};function PA(r){let e=r.indexOf("?");return e===-1?r:r.substring(0,e)}function yA(r){let e=0,n=r.clone().body?.getReader();if(!n)return Promise.resolve(0);let i=()=>n.read().then(({done:s,value:o})=>{if(!s)return e+=o.byteLength,i()});return i().then(()=>e)}function $u(r,e){if(e instanceof Error)r.recordException(e),r.setStatus({code:d.SpanStatusCode.ERROR,message:e.message});else{let t=String(e);r.setStatus({code:d.SpanStatusCode.ERROR,message:t})}}function hp(r,e,t){for(let[n,i]of Object.entries(e)){let s=t.get(i);s!==null&&r.setAttribute(n,s)}}var bs=class{constructor(e={}){this.configuration=e}start(){let e=vA(),t=(0,ar.getEnvWithoutDefaults)(),n=this.configuration,i=process.env.NEXT_RUNTIME||"nodejs",s=!!e.OTEL_SDK_DISABLED;if(t.OTEL_LOG_LEVEL&&d.diag.setLogger(new d.DiagConsoleLogger,{logLevel:t.OTEL_LOG_LEVEL}),s)return;let o=n.idGenerator??new N.RandomIdGenerator,a=n.contextManager??new Sp.AsyncLocalStorageContextManager;a.enable(),this.contextManager=a;let u=e.OTEL_SERVICE_NAME||n.serviceName||"app",l=new or.Resource(ps({[Tp.SemanticResourceAttributes.SERVICE_NAME]:u,"node.ci":process.env.CI?!0:void 0,"node.env":process.env.NODE_ENV,env:process.env.VERCEL_ENV||process.env.NEXT_PUBLIC_VERCEL_ENV,"vercel.region":process.env.VERCEL_REGION,"vercel.runtime":i,"vercel.sha":process.env.VERCEL_GIT_COMMIT_SHA||process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA,"vercel.host":process.env.VERCEL_URL||process.env.NEXT_PUBLIC_VERCEL_URL||void 0,"vercel.branch_host":process.env.VERCEL_BRANCH_URL||process.env.NEXT_PUBLIC_VERCEL_BRANCH_URL||void 0,...n.attributes})),_=n.resourceDetectors??[or.envDetectorSync];if(n.autoDetectResources??!0){let m={detectors:_};l=l.merge((0,or.detectResourcesSync)(m))}let O=LA(n.propagators,e),D=MA(n.traceSampler,e),z=CA(n.spanProcessors,n,e);z.length===0&&d.diag.warn("@vercel/otel: No span processors configured. No spans will be exported.");let I=n.spanLimits,U=new N.BasicTracerProvider({resource:l,idGenerator:o,sampler:D,spanLimits:I});if(U.addSpanProcessor(new fs(z,n.attributesFromHeaders)),U.register({contextManager:a,propagator:new he.CompositePropagator({propagators:O})}),this.tracerProvider=U,n.logRecordProcessor){let m=new mp.LoggerProvider({resource:l});this.loggerProvider=m,m.addLogRecordProcessor(n.logRecordProcessor),it.logs.setGlobalLoggerProvider(m)}if(n.metricReader||n.views){let m=new gp.MeterProvider({resource:l,views:n.views??[]});n.metricReader&&m.addMetricReader(n.metricReader),d.metrics.setGlobalMeterProvider(m),this.meterProvider=m}let L=IA(n.instrumentations,n.instrumentationConfig);this.disableInstrumentations=(0,Ep.registerInstrumentations)({instrumentations:L}),d.diag.info("@vercel/otel: started",u,i)}async shutdown(){let e=[];this.tracerProvider&&e.push(this.tracerProvider.shutdown()),this.loggerProvider&&e.push(this.loggerProvider.shutdown()),this.meterProvider&&e.push(this.meterProvider.shutdown()),d.diag.info("@vercel/otel: shutting down",e.length,process.env.NEXT_RUNTIME),await Promise.all(e),this.contextManager&&this.contextManager.disable();let{disableInstrumentations:t}=this;t&&t()}};function vA(){let r=(0,ar.parseEnvironment)(process.env);return{...ar.DEFAULT_ENVIRONMENT,...r}}function IA(r,e){return(r??["auto"]).map(t=>t==="auto"?(d.diag.debug("@vercel/otel: Configure instrumentations: fetch",e?.fetch),[new ir(e?.fetch)]):t==="fetch"?(d.diag.debug("@vercel/otel: Configure instrumentations: fetch",e?.fetch),new ir(e?.fetch)):t).flat()}function LA(r,e){let t=e.OTEL_PROPAGATORS&&e.OTEL_PROPAGATORS.length>0?e.OTEL_PROPAGATORS:void 0;return(r??t??["auto"]).map(n=>{if(n==="none")return[];if(n==="auto")return d.diag.debug("@vercel/otel: Configure propagators: tracecontext, baggage"),[new he.W3CTraceContextPropagator,new he.W3CBaggagePropagator];if(n==="tracecontext")return d.diag.debug("@vercel/otel: Configure propagator: tracecontext"),new he.W3CTraceContextPropagator;if(n==="baggage")return d.diag.debug("@vercel/otel: Configure propagator: baggage"),new he.W3CBaggagePropagator;if(typeof n=="string")throw new Error(`Unknown propagator: "${n}"`);return n}).flat()}var pp="always_on",sr=1;function MA(r,e){if(r&&typeof r!="string")return r;let t=r&&r!=="auto"?r:e.OTEL_TRACES_SAMPLER||pp;switch(d.diag.debug("@vercel/otel: Configure sampler: ",t),t){case"always_on":return new N.AlwaysOnSampler;case"always_off":return new N.AlwaysOffSampler;case"parentbased_always_on":return new N.ParentBasedSampler({root:new N.AlwaysOnSampler});case"parentbased_always_off":return new N.ParentBasedSampler({root:new N.AlwaysOffSampler});case"traceidratio":return new N.TraceIdRatioBasedSampler(fp(e));case"parentbased_traceidratio":return new N.ParentBasedSampler({root:new N.TraceIdRatioBasedSampler(fp(e))});default:return d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER value "${String(e.OTEL_TRACES_SAMPLER)} invalid, defaulting to ${pp}".`),new N.AlwaysOnSampler}}function fp(r){if(r.OTEL_TRACES_SAMPLER_ARG===void 0||r.OTEL_TRACES_SAMPLER_ARG==="")return d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${sr}.`),sr;d.diag.debug("@vercel/otel: Configure sampler probability: ",r.OTEL_TRACES_SAMPLER_ARG);let e=Number(r.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${sr}.`),sr):e<0||e>1?(d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${sr}.`),sr):e}function CA(r,e,t){return[...(r??["auto"]).map(n=>{if(n==="auto"){if(process.env.VERCEL_OTEL_ENDPOINTS){let i=process.env.VERCEL_OTEL_ENDPOINTS_PORT||"4318",s=process.env.VERCEL_OTEL_ENDPOINTS_PROTOCOL||"http/protobuf";d.diag.debug("@vercel/otel: Configure vercel otel collector on port: ",i,s);let o={url:`http://localhost:${i}/v1/traces`,headers:{}},a=s==="http/protobuf"?new lt(o):new tr(o);return new N.BatchSpanProcessor(a)}return!e.traceExporter||e.traceExporter==="auto"||t.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT||t.OTEL_EXPORTER_OTLP_ENDPOINT?new N.BatchSpanProcessor(NA(t)):void 0}return n}).filter(DA),...e.traceExporter&&e.traceExporter!=="auto"?[new N.BatchSpanProcessor(e.traceExporter)]:[]]}function NA(r){let e=process.env.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL??process.env.OTEL_EXPORTER_OTLP_PROTOCOL??"http/protobuf",t=xA(r),n={...he.baggageUtils.parseKeyPairsIntoRecord(r.OTEL_EXPORTER_OTLP_HEADERS),...he.baggageUtils.parseKeyPairsIntoRecord(r.OTEL_EXPORTER_OTLP_TRACES_HEADERS)};switch(d.diag.debug("@vercel/otel: Configure trace exporter: ",e,t,`headers: ${Object.keys(n).join(",")||"<none>"}`),e){case"http/json":return new tr({url:t,headers:n});case"http/protobuf":return new lt({url:t,headers:n});default:return d.diag.warn(`@vercel/otel: Unsupported OTLP traces protocol: ${e}. Using http/protobuf.`),new lt}}var Ap="v1/traces",wA=`http://localhost:4318/${Ap}`;function xA(r){let e=r.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT;if(e&&typeof e=="string")return e;let t=r.OTEL_EXPORTER_OTLP_ENDPOINT;return t&&typeof t=="string"?`${t}/${Ap}`:wA}function DA(r){return r!=null}function iy(r){let e;r?typeof r=="string"?e={serviceName:r}:e=r:e={},new bs(e).start()}export{ir as FetchInstrumentation,tr as OTLPHttpJsonTraceExporter,lt as OTLPHttpProtoTraceExporter,iy as registerOTel};
|
|
21
21
|
//# sourceMappingURL=index.js.map
|