try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4538a996-52d5-4f0c-9dd2-815785971e65",e._sentryDebugIdIdentifier="sentry-dbid-4538a996-52d5-4f0c-9dd2-815785971e65")}catch(e){}{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=Object.assign({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:anthropic-apps":!0})}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[33174],{0x3b869ac3:(e,t,r)=>{let i;r.d(t,{XO:()=>r1});var s,n,a,o,l,c=r(0xfa1bd25c),u=r(0x243825738),h=r(0x23743853f),d=r(0x1709dbbfc),m=r(0x6096d538),g=r(0x1223f14b9),p=r(0xe62571ff),_=r(0x1e1606a03),v=r(0x3c5047a3),f=r(0x1fe52c542),b=r(0x16e3c6c98),w=r(0xe7d09562),y=r(0x22b8d2099),S=r(0x135495fde),T=r(0x715769ec),x=r(0x1c5bc9c37),M=r(0x455aadbb),E=r(0x23ade8457),A=r(0x1f6e45358),C=r(0x75b256ef),P=r(0x37a98772),L=r(0x122559418),O=r(0x7b83eb4a),R=r(0x9624e0f3),k=r(0x3b607ede),N=r(0x36ae4918),I=r(0x2333d6080),U=r(0x22412967a),D=r(0x36add605),B=r(0x738739f4),F=r(0xb17e92ac),$=r(0x2340451cc),V=r(0x18c0eaa61),G=r(0x1a8741d9f),z=r(0x2333cef0c),H=r(0x139b90133),j=r(0xbf298269),W=r(0x1428fa160),K=r(0x1315c1671),X=r(0x17e242400),q=r.n(X);function J(e){return null!=e}function Z(e){let t=Object.keys(e);return 0===t.length?"":JSON.stringify((t=t.sort()).map(t=>[t,e[t]]))}!function(e){e[e.DELTA=0]="DELTA",e[e.CUMULATIVE=1]="CUMULATIVE"}(s||(s={})),function(e){e.COUNTER="COUNTER",e.GAUGE="GAUGE",e.HISTOGRAM="HISTOGRAM",e.UP_DOWN_COUNTER="UP_DOWN_COUNTER",e.OBSERVABLE_COUNTER="OBSERVABLE_COUNTER",e.OBSERVABLE_GAUGE="OBSERVABLE_GAUGE",e.OBSERVABLE_UP_DOWN_COUNTER="OBSERVABLE_UP_DOWN_COUNTER"}(n||(n={})),function(e){e[e.HISTOGRAM=0]="HISTOGRAM",e[e.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",e[e.GAUGE=2]="GAUGE",e[e.SUM=3]="SUM"}(a||(a={}));class Q extends Error{constructor(e){super(e),Object.setPrototypeOf(this,Q.prototype)}}function Y(e,t){let r;return Promise.race([e,new Promise(function(e,i){r=setTimeout(function(){i(new Q("Operation timed out."))},t)})]).then(e=>(clearTimeout(r),e),e=>{throw clearTimeout(r),e})}async function ee(e){return Promise.all(e.map(async e=>{try{let t=await e;return{status:"fulfilled",value:t}}catch(e){return{status:"rejected",reason:e}}}))}function et(e){return"rejected"===e.status}function er(e,t){let r=[];return e.forEach(e=>{r.push(...t(e))}),r}!function(e){e[e.DROP=0]="DROP",e[e.SUM=1]="SUM",e[e.LAST_VALUE=2]="LAST_VALUE",e[e.HISTOGRAM=3]="HISTOGRAM",e[e.EXPONENTIAL_HISTOGRAM=4]="EXPONENTIAL_HISTOGRAM"}(o||(o={}));class ei{kind=o.DROP;createAccumulation(){}merge(e,t){}diff(e,t){}toMetricData(e,t,r,i){}}class es{startTime;_boundaries;_recordMinMax;_current;constructor(e,t,r=!0,i=function(e){let t=e.map(()=>0);return t.push(0),{buckets:{boundaries:e,counts:t},sum:0,count:0,hasMinMax:!1,min:1/0,max:-1/0}}(t)){this.startTime=e,this._boundaries=t,this._recordMinMax=r,this._current=i}record(e){if(Number.isNaN(e))return;this._current.count+=1,this._current.sum+=e,this._recordMinMax&&(this._current.min=Math.min(e,this._current.min),this._current.max=Math.max(e,this._current.max),this._current.hasMinMax=!0);let t=function(e,t){let r=0,i=e.length-1,s=e.length;for(;i>=r;){let n=r+Math.trunc((i-r)/2);e[n]{let s=r.toPointValue(),a=e.type===n.GAUGE||e.type===n.UP_DOWN_COUNTER||e.type===n.OBSERVABLE_GAUGE||e.type===n.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:t,startTime:r.startTime,endTime:i,value:{min:s.hasMinMax?s.min:void 0,max:s.hasMinMax?s.max:void 0,sum:a?void 0:s.sum,buckets:s.buckets,count:s.count}}})}}}class ea{backing;indexBase;indexStart;indexEnd;constructor(e=new eo,t=0,r=0,i=0){this.backing=e,this.indexBase=t,this.indexStart=r,this.indexEnd=i}get offset(){return this.indexStart}get length(){return 0===this.backing.length||this.indexEnd===this.indexStart&&0===this.at(0)?0:this.indexEnd-this.indexStart+1}counts(){return Array.from({length:this.length},(e,t)=>this.at(t))}at(e){let t=this.indexBase-this.indexStart;return e=0;e--)if(0!==this.at(e)){this.indexEnd-=this.length-e-1;break}this._rotate()}downscale(e){this._rotate();let t=1+this.indexEnd-this.indexStart,r=1<>=e,this.indexEnd>>=e,this.indexBase=this.indexStart}clone(){return new ea(this.backing.clone(),this.indexBase,this.indexStart,this.indexEnd)}_rotate(){let e=this.indexBase-this.indexStart;0!==e&&(e>0?(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,e),this.backing.reverse(e,this.backing.length)):(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,this.backing.length+e)),this.indexBase=this.indexStart)}_relocateBucket(e,t){e!==t&&this.incrementBucket(e,this.backing.emptyBucket(t))}}class eo{_counts;constructor(e=[0]){this._counts=e}get length(){return this._counts.length}countAt(e){return this._counts[e]}growTo(e,t,r){let i=Array(e).fill(0);i.splice(r,this._counts.length-t,...this._counts.slice(t)),i.splice(0,t,...this._counts.slice(0,t)),this._counts=i}reverse(e,t){let r=Math.floor((e+t)/2)-e;for(let i=0;i=t?this._counts[e]-=t:this._counts[e]=0}clone(){return new eo([...this._counts])}}function el(e){let t=new DataView(new ArrayBuffer(8));return t.setFloat64(0,e),((0x7ff00000&t.getUint32(0))>>20)-1023}function ec(e){let t=new DataView(new ArrayBuffer(8));t.setFloat64(0,e);let r=t.getUint32(0);return(1048575&r)*0x100000000+t.getUint32(4)}function eu(e,t){return 0===e||e===1/0||e===-1/0||Number.isNaN(e)?e:e*Math.pow(2,t)}class eh extends Error{}class ed{_shift;constructor(e){this._shift=-e}mapToIndex(e){return e<22250738585072014e-324?this._minNormalLowerBoundaryIndex():el(e)+this._rightShift(ec(e)-1,52)>>this._shift}lowerBoundary(e){let t=this._minNormalLowerBoundaryIndex();if(er)throw new eh(`overflow: ${e} is > maximum lower boundary: ${r}`);return eu(1,e<>this._shift;return this._shift<2&&e--,e}_maxNormalLowerBoundaryIndex(){return 1023>>this._shift}_rightShift(e,t){return Math.floor(e*Math.pow(2,-t))}}class em{_scale;_scaleFactor;_inverseFactor;constructor(e){this._scale=e,this._scaleFactor=eu(Math.LOG2E,e),this._inverseFactor=eu(Math.LN2,-e)}mapToIndex(e){if(e<=22250738585072014e-324)return this._minNormalLowerBoundaryIndex()-1;if(0===ec(e))return(el(e)<=r?r:t}lowerBoundary(e){let t=this._maxNormalLowerBoundaryIndex();if(e>=t){if(e===t)return 2*Math.exp((e-(1< maximum lower boundary: ${t}`)}let r=this._minNormalLowerBoundaryIndex();if(e<=r){if(e===r)return 22250738585072014e-324;if(e===r-1)return Math.exp((e+(1<t>10?new em(t-10):new ed(t-10));function ep(e){if(e>20||e<-10)throw new eh(`expected scale >= -10 && <= 20, got: ${e}`);return eg[e+10]}class e_{low;high;static combine(e,t){return new e_(Math.min(e.low,t.low),Math.max(e.high,t.high))}constructor(e,t){this.low=e,this.high=t}}class ev{startTime;_maxSize;_recordMinMax;_sum;_count;_zeroCount;_min;_max;_positive;_negative;_mapping;constructor(e=e,t=160,r=!0,i=0,s=0,n=0,a=1/0,o=-1/0,l=new ea,u=new ea,h=ep(20)){this.startTime=e,this._maxSize=t,this._recordMinMax=r,this._sum=i,this._count=s,this._zeroCount=n,this._min=a,this._max=o,this._positive=l,this._negative=u,this._mapping=h,this._maxSize<2&&(c.s.warn(`Exponential Histogram Max Size set to ${this._maxSize}, \ changing to the minimum size of: 2`),this._maxSize=2)}record(e){this.updateByIncrement(e,1)}setStartTime(e){this.startTime=e}toPointValue(){return{hasMinMax:this._recordMinMax,min:this.min,max:this.max,sum:this.sum,positive:{offset:this.positive.offset,bucketCounts:this.positive.counts()},negative:{offset:this.negative.offset,bucketCounts:this.negative.counts()},count:this.count,scale:this.scale,zeroCount:this.zeroCount}}get sum(){return this._sum}get min(){return this._min}get max(){return this._max}get count(){return this._count}get zeroCount(){return this._zeroCount}get scale(){return this._count===this._zeroCount?0:this._mapping.scale}get positive(){return this._positive}get negative(){return this._negative}updateByIncrement(e,t){if(!Number.isNaN(e)){if(e>this._max&&(this._max=e),e0?this._updateBuckets(this._positive,e,t):this._updateBuckets(this._negative,-e,t)}}merge(e){0===this._count?(this._min=e.min,this._max=e.max):0!==e.count&&(e.minthis.max&&(this._max=e.max)),this.startTime=e.startTime,this._sum+=e.sum,this._count+=e.count,this._zeroCount+=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._mergeBuckets(this.positive,e,e.positive,t),this._mergeBuckets(this.negative,e,e.negative,t)}diff(e){this._min=1/0,this._max=-1/0,this._sum-=e.sum,this._count-=e.count,this._zeroCount-=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._diffBuckets(this.positive,e,e.positive,t),this._diffBuckets(this.negative,e,e.negative,t)}clone(){return new ev(this.startTime,this._maxSize,this._recordMinMax,this._sum,this._count,this._zeroCount,this._min,this._max,this.positive.clone(),this.negative.clone(),this._mapping)}_updateBuckets(e,t,r){let i=this._mapping.mapToIndex(t),s=!1,n=0,a=0;if(0===e.length?(e.indexStart=i,e.indexEnd=e.indexStart,e.indexBase=e.indexStart):i=this._maxSize?(s=!0,a=i,n=e.indexEnd):i>e.indexEnd&&i-e.indexStart>=this._maxSize&&(s=!0,a=e.indexStart,n=i),s){let e=this._changeScale(n,a);this._downscale(e),i=this._mapping.mapToIndex(t)}this._incrementIndexBy(e,i,r)}_incrementIndexBy(e,t,r){if(0===r)return;if(0===e.length&&(e.indexStart=e.indexEnd=e.indexBase=t),t=e.backing.length&&this._grow(e,r+1),e.indexStart=t}else if(t>e.indexEnd){let r=t-e.indexStart;r>=e.backing.length&&this._grow(e,r+1),e.indexEnd=t}let i=t-e.indexBase;i<0&&(i+=e.backing.length),e.incrementBucket(i,r)}_grow(e,t){var r;let i=e.backing.length,s=e.indexBase-e.indexStart,n=(r=t,r--,r|=r>>1,r|=r>>2,r|=r>>4,r|=r>>8,r|=r>>16,++r);n>this._maxSize&&(n=this._maxSize);let a=n-s;e.backing.growTo(n,i-s,a)}_changeScale(e,t){let r=0;for(;e-t>=this._maxSize;)e>>=1,t>>=1,r++;return r}_downscale(e){if(0===e)return;if(e<0)throw Error(`impossible change of scale: ${this.scale}`);let t=this._mapping.scale-e;this._positive.downscale(e),this._negative.downscale(e),this._mapping=ep(t)}_minScale(e){let t=Math.min(this.scale,e.scale),r=e_.combine(this._highLowAtScale(this.positive,this.scale,t),this._highLowAtScale(e.positive,e.scale,t)),i=e_.combine(this._highLowAtScale(this.negative,this.scale,t),this._highLowAtScale(e.negative,e.scale,t));return Math.min(t-this._changeScale(r.high,r.low),t-this._changeScale(i.high,i.low))}_highLowAtScale(e,t,r){if(0===e.length)return new e_(0,-1);let i=t-r;return new e_(e.indexStart>>i,e.indexEnd>>i)}_mergeBuckets(e,t,r,i){let s=r.offset,n=t.scale-i;for(let t=0;t>n,r.at(t))}_diffBuckets(e,t,r,i){let s=r.offset,n=t.scale-i;for(let t=0;t>n)-e.indexBase;i<0&&(i+=e.backing.length),e.decrementBucket(i,r.at(t))}e.trim()}}class ef{_maxSize;_recordMinMax;kind=o.EXPONENTIAL_HISTOGRAM;constructor(e,t){this._maxSize=e,this._recordMinMax=t}createAccumulation(e){return new ev(e,this._maxSize,this._recordMinMax)}merge(e,t){let r=t.clone();return r.merge(e),r}diff(e,t){let r=t.clone();return r.diff(e),r}toMetricData(e,t,r,i){return{descriptor:e,aggregationTemporality:t,dataPointType:a.EXPONENTIAL_HISTOGRAM,dataPoints:r.map(([t,r])=>{let s=r.toPointValue(),a=e.type===n.GAUGE||e.type===n.UP_DOWN_COUNTER||e.type===n.OBSERVABLE_GAUGE||e.type===n.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:t,startTime:r.startTime,endTime:i,value:{min:s.hasMinMax?s.min:void 0,max:s.hasMinMax?s.max:void 0,sum:a?void 0:s.sum,positive:{offset:s.positive.offset,bucketCounts:s.positive.bucketCounts},negative:{offset:s.negative.offset,bucketCounts:s.negative.bucketCounts},count:s.count,scale:s.scale,zeroCount:s.zeroCount}}})}}}class eb{startTime;_current;sampleTime;constructor(e,t=0,r=[0,0]){this.startTime=e,this._current=t,this.sampleTime=r}record(e){this._current=e,this.sampleTime=(0,O.lg)(Date.now())}setStartTime(e){this.startTime=e}toPointValue(){return this._current}}class ew{kind=o.LAST_VALUE;createAccumulation(e){return new eb(e)}merge(e,t){let r=(0,O.w_)(t.sampleTime)>=(0,O.w_)(e.sampleTime)?t:e;return new eb(e.startTime,r.toPointValue(),r.sampleTime)}diff(e,t){let r=(0,O.w_)(t.sampleTime)>=(0,O.w_)(e.sampleTime)?t:e;return new eb(t.startTime,r.toPointValue(),r.sampleTime)}toMetricData(e,t,r,i){return{descriptor:e,aggregationTemporality:t,dataPointType:a.GAUGE,dataPoints:r.map(([e,t])=>({attributes:e,startTime:t.startTime,endTime:i,value:t.toPointValue()}))}}}class ey{startTime;monotonic;_current;reset;constructor(e,t,r=0,i=!1){this.startTime=e,this.monotonic=t,this._current=r,this.reset=i}record(e){this.monotonic&&e<0||(this._current+=e)}setStartTime(e){this.startTime=e}toPointValue(){return this._current}}class eS{monotonic;kind=o.SUM;constructor(e){this.monotonic=e}createAccumulation(e){return new ey(e,this.monotonic)}merge(e,t){let r=e.toPointValue(),i=t.toPointValue();return t.reset?new ey(t.startTime,this.monotonic,i,t.reset):new ey(e.startTime,this.monotonic,r+i)}diff(e,t){let r=e.toPointValue(),i=t.toPointValue();return this.monotonic&&r>i?new ey(t.startTime,this.monotonic,i,!0):new ey(t.startTime,this.monotonic,i-r)}toMetricData(e,t,r,i){return{descriptor:e,aggregationTemporality:t,dataPointType:a.SUM,dataPoints:r.map(([e,t])=>({attributes:e,startTime:t.startTime,endTime:i,value:t.toPointValue()})),isMonotonic:this.monotonic}}}class eT{static DEFAULT_INSTANCE=new ei;createAggregator(e){return eT.DEFAULT_INSTANCE}}class ex{static MONOTONIC_INSTANCE=new eS(!0);static NON_MONOTONIC_INSTANCE=new eS(!1);createAggregator(e){switch(e.type){case n.COUNTER:case n.OBSERVABLE_COUNTER:case n.HISTOGRAM:return ex.MONOTONIC_INSTANCE;default:return ex.NON_MONOTONIC_INSTANCE}}}class eM{static DEFAULT_INSTANCE=new ew;createAggregator(e){return eM.DEFAULT_INSTANCE}}class eE{static DEFAULT_INSTANCE=new en([0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4],!0);createAggregator(e){return eE.DEFAULT_INSTANCE}}class eA{_recordMinMax;_boundaries;constructor(e,t=!0){if(this._recordMinMax=t,null==e)throw Error("ExplicitBucketHistogramAggregation should be created with explicit boundaries, if a single bucket histogram is required, please pass an empty array");let r=(e=(e=e.concat()).sort((e,t)=>e-t)).lastIndexOf(-1/0),i=e.indexOf(1/0);-1===i&&(i=void 0),this._boundaries=e.slice(r+1,i)}createAggregator(e){return new en(this._boundaries,this._recordMinMax)}}class eC{_maxSize;_recordMinMax;constructor(e=160,t=!0){this._maxSize=e,this._recordMinMax=t}createAggregator(e){return new ef(this._maxSize,this._recordMinMax)}}class eP{_resolve(e){switch(e.type){case n.COUNTER:case n.UP_DOWN_COUNTER:case n.OBSERVABLE_COUNTER:case n.OBSERVABLE_UP_DOWN_COUNTER:return eO;case n.GAUGE:case n.OBSERVABLE_GAUGE:return eR;case n.HISTOGRAM:if(e.advice.explicitBucketBoundaries)return new eA(e.advice.explicitBucketBoundaries);return ek}return c.s.warn(`Unable to recognize instrument type: ${e.type}`),eL}createAggregator(e){return this._resolve(e).createAggregator(e)}}let eL=new eT,eO=new ex,eR=new eM,ek=new eE,eN=new eP;function eI(e){switch(e.type){case l.DEFAULT:return eN;case l.DROP:return eL;case l.SUM:return eO;case l.LAST_VALUE:return eR;case l.EXPONENTIAL_HISTOGRAM:return new eC(e.options?.maxSize,e.options?.recordMinMax);case l.EXPLICIT_BUCKET_HISTOGRAM:if(null==e.options)return ek;return new eA(e.options?.boundaries,e.options?.recordMinMax);default:throw Error("Unsupported Aggregation")}}!function(e){e[e.DEFAULT=0]="DEFAULT",e[e.DROP=1]="DROP",e[e.SUM=2]="SUM",e[e.LAST_VALUE=3]="LAST_VALUE",e[e.EXPLICIT_BUCKET_HISTOGRAM=4]="EXPLICIT_BUCKET_HISTOGRAM",e[e.EXPONENTIAL_HISTOGRAM=5]="EXPONENTIAL_HISTOGRAM"}(l||(l={}));let eU=e=>({type:l.DEFAULT}),eD=e=>s.CUMULATIVE;class eB{_shutdown=!1;_metricProducers;_sdkMetricProducer;_aggregationTemporalitySelector;_aggregationSelector;_cardinalitySelector;constructor(e){this._aggregationSelector=e?.aggregationSelector??eU,this._aggregationTemporalitySelector=e?.aggregationTemporalitySelector??eD,this._metricProducers=e?.metricProducers??[],this._cardinalitySelector=e?.cardinalitySelector}setMetricProducer(e){if(this._sdkMetricProducer)throw Error("MetricReader can not be bound to a MeterProvider again.");this._sdkMetricProducer=e,this.onInitialized()}selectAggregation(e){return this._aggregationSelector(e)}selectAggregationTemporality(e){return this._aggregationTemporalitySelector(e)}selectCardinalityLimit(e){return this._cardinalitySelector?this._cardinalitySelector(e):2e3}onInitialized(){}async collect(e){if(void 0===this._sdkMetricProducer)throw Error("MetricReader is not bound to a MetricProducer");if(this._shutdown)throw Error("MetricReader is shutdown");let[t,...r]=await Promise.all([this._sdkMetricProducer.collect({timeoutMillis:e?.timeoutMillis}),...this._metricProducers.map(t=>t.collect({timeoutMillis:e?.timeoutMillis}))]),i=t.errors.concat(er(r,e=>e.errors));return{resourceMetrics:{resource:t.resourceMetrics.resource,scopeMetrics:t.resourceMetrics.scopeMetrics.concat(er(r,e=>e.resourceMetrics.scopeMetrics))},errors:i}}async shutdown(e){if(this._shutdown)return void c.s.error("Cannot call shutdown twice.");e?.timeoutMillis==null?await this.onShutdown():await Y(this.onShutdown(),e.timeoutMillis),this._shutdown=!0}async forceFlush(e){return this._shutdown?void c.s.warn("Cannot forceFlush on already shutdown MetricReader."):e?.timeoutMillis==null?void await this.onForceFlush():void await Y(this.onForceFlush(),e.timeoutMillis)}}class eF extends eB{_interval;_exporter;_exportInterval;_exportTimeout;constructor(e){if(super({aggregationSelector:e.exporter.selectAggregation?.bind(e.exporter),aggregationTemporalitySelector:e.exporter.selectAggregationTemporality?.bind(e.exporter),metricProducers:e.metricProducers}),void 0!==e.exportIntervalMillis&&e.exportIntervalMillis<=0)throw Error("exportIntervalMillis must be greater than 0");if(void 0!==e.exportTimeoutMillis&&e.exportTimeoutMillis<=0)throw Error("exportTimeoutMillis must be greater than 0");if(void 0!==e.exportTimeoutMillis&&void 0!==e.exportIntervalMillis&&e.exportIntervalMillis0&&c.s.error("PeriodicExportingMetricReader: metrics collection errors",...t),e.resource.asyncAttributesPending)try{await e.resource.waitForAsyncAttributes?.()}catch(e){c.s.debug("Error while resolving async portion of resource: ",e),(0,R.s)(e)}if(0===e.scopeMetrics.length)return;let r=await k.mM._export(this._exporter,e);if(r.code!==N.V.SUCCESS)throw Error(`PeriodicExportingMetricReader: metrics export failed (error ${r.error})`)}onInitialized(){this._interval=setInterval(()=>{this._runOnce()},this._exportInterval),(0,I.K)(this._interval)}async onForceFlush(){await this._runOnce(),await this._exporter.forceFlush()}async onShutdown(){this._interval&&clearInterval(this._interval),await this.onForceFlush(),await this._exporter.shutdown()}}class e${_shutdown=!1;_temporalitySelector;constructor(e){this._temporalitySelector=e?.temporalitySelector??eD}export(e,t){return this._shutdown?void setImmediate(t,{code:N.V.FAILED}):e$._sendMetrics(e,t)}forceFlush(){return Promise.resolve()}selectAggregationTemporality(e){return this._temporalitySelector(e)}shutdown(){return this._shutdown=!0,Promise.resolve()}static _sendMetrics(e,t){for(let t of e.scopeMetrics)for(let e of t.metrics)console.dir({descriptor:e.descriptor,dataPointType:e.dataPointType,dataPoints:e.dataPoints},{depth:null});t({code:N.V.SUCCESS})}}class eV{_registeredViews=[];addView(e){this._registeredViews.push(e)}findViews(e,t){return this._registeredViews.filter(r=>this._matchInstrument(r.instrumentSelector,e)&&this._matchMeter(r.meterSelector,t))}_matchInstrument(e,t){return(void 0===e.getType()||t.type===e.getType())&&e.getNameFilter().match(t.name)&&e.getUnitFilter().match(t.unit)}_matchMeter(e,t){return e.getNameFilter().match(t.name)&&(void 0===t.version||e.getVersionFilter().match(t.version))&&(void 0===t.schemaUrl||e.getSchemaUrlFilter().match(t.schemaUrl))}}function eG(e,t,r){return null==e.match(ez)&&c.s.warn(`Invalid metric name: "${e}". The metric name should be a ASCII string with a length no greater than 255 characters.`),{name:e,type:t,description:r?.description??"",unit:r?.unit??"",valueType:r?.valueType??d.e.DOUBLE,advice:r?.advice??{}}}let ez=/^[a-z][a-z0-9_.\-/]{0,254}$/i;class eH{_writableMetricStorage;_descriptor;constructor(e,t){this._writableMetricStorage=e,this._descriptor=t}_record(e,t={},r=m._.active()){if("number"!=typeof e)return void c.s.warn(`non-number value provided to metric ${this._descriptor.name}: ${e}`);(this._descriptor.valueType!==d.e.INT||Number.isInteger(e)||(c.s.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`),Number.isInteger(e=Math.trunc(e))))&&this._writableMetricStorage.record(e,t,r,(0,O.lg)(Date.now()))}}class ej extends eH{add(e,t,r){this._record(e,t,r)}}class eW extends eH{add(e,t,r){if(e<0)return void c.s.warn(`negative value provided to counter ${this._descriptor.name}: ${e}`);this._record(e,t,r)}}class eK extends eH{record(e,t,r){this._record(e,t,r)}}class eX extends eH{record(e,t,r){if(e<0)return void c.s.warn(`negative value provided to histogram ${this._descriptor.name}: ${e}`);this._record(e,t,r)}}class eq{_observableRegistry;_metricStorages;_descriptor;constructor(e,t,r){this._observableRegistry=r,this._descriptor=e,this._metricStorages=t}addCallback(e){this._observableRegistry.addCallback(e,this)}removeCallback(e){this._observableRegistry.removeCallback(e,this)}}class eJ extends eq{}class eZ extends eq{}class eQ extends eq{}function eY(e){return e instanceof eq}class e0{_meterSharedState;constructor(e){this._meterSharedState=e}createGauge(e,t){let r=eG(e,n.GAUGE,t);return new eK(this._meterSharedState.registerMetricStorage(r),r)}createHistogram(e,t){let r=eG(e,n.HISTOGRAM,t);return new eX(this._meterSharedState.registerMetricStorage(r),r)}createCounter(e,t){let r=eG(e,n.COUNTER,t);return new eW(this._meterSharedState.registerMetricStorage(r),r)}createUpDownCounter(e,t){let r=eG(e,n.UP_DOWN_COUNTER,t);return new ej(this._meterSharedState.registerMetricStorage(r),r)}createObservableGauge(e,t){let r=eG(e,n.OBSERVABLE_GAUGE,t),i=this._meterSharedState.registerAsyncMetricStorage(r);return new eZ(r,i,this._meterSharedState.observableRegistry)}createObservableCounter(e,t){let r=eG(e,n.OBSERVABLE_COUNTER,t),i=this._meterSharedState.registerAsyncMetricStorage(r);return new eJ(r,i,this._meterSharedState.observableRegistry)}createObservableUpDownCounter(e,t){let r=eG(e,n.OBSERVABLE_UP_DOWN_COUNTER,t),i=this._meterSharedState.registerAsyncMetricStorage(r);return new eQ(r,i,this._meterSharedState.observableRegistry)}addBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.addBatchCallback(e,t)}removeBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.removeBatchCallback(e,t)}}class e1{_instrumentDescriptor;constructor(e){this._instrumentDescriptor=e}getInstrumentDescriptor(){return this._instrumentDescriptor}updateDescription(e){this._instrumentDescriptor=eG(this._instrumentDescriptor.name,this._instrumentDescriptor.type,{description:e,valueType:this._instrumentDescriptor.valueType,unit:this._instrumentDescriptor.unit,advice:this._instrumentDescriptor.advice})}}class e2{_hash;_valueMap=new Map;_keyMap=new Map;constructor(e){this._hash=e}get(e,t){return t??=this._hash(e),this._valueMap.get(t)}getOrDefault(e,t){let r=this._hash(e);if(this._valueMap.has(r))return this._valueMap.get(r);let i=t();return this._keyMap.has(r)||this._keyMap.set(r,e),this._valueMap.set(r,i),i}set(e,t,r){r??=this._hash(e),this._keyMap.has(r)||this._keyMap.set(r,e),this._valueMap.set(r,t)}has(e,t){return t??=this._hash(e),this._valueMap.has(t)}*keys(){let e=this._keyMap.entries(),t=e.next();for(;!0!==t.done;)yield[t.value[1],t.value[0]],t=e.next()}*entries(){let e=this._valueMap.entries(),t=e.next();for(;!0!==t.done;)yield[this._keyMap.get(t.value[0]),t.value[1],t.value[0]],t=e.next()}get size(){return this._valueMap.size}}class e3 extends e2{constructor(){super(Z)}}class e5{_aggregator;_activeCollectionStorage=new e3;_cumulativeMemoStorage=new e3;_cardinalityLimit;_overflowAttributes={"otel.metric.overflow":!0};_overflowHashCode;constructor(e,t){this._aggregator=e,this._cardinalityLimit=(t??2e3)-1,this._overflowHashCode=Z(this._overflowAttributes)}record(e,t,r,i){let s=this._activeCollectionStorage.get(t);if(!s){if(this._activeCollectionStorage.size>=this._cardinalityLimit){let t=this._activeCollectionStorage.getOrDefault(this._overflowAttributes,()=>this._aggregator.createAccumulation(i));t?.record(e);return}s=this._aggregator.createAccumulation(i),this._activeCollectionStorage.set(t,s)}s?.record(e)}batchCumulate(e,t){Array.from(e.entries()).forEach(([e,r,i])=>{let s=this._aggregator.createAccumulation(t);s?.record(r);let n=s;if(this._cumulativeMemoStorage.has(e,i)){let t=this._cumulativeMemoStorage.get(e,i);n=this._aggregator.diff(t,s)}else if(this._cumulativeMemoStorage.size>=this._cardinalityLimit&&(e=this._overflowAttributes,i=this._overflowHashCode,this._cumulativeMemoStorage.has(e,i))){let t=this._cumulativeMemoStorage.get(e,i);n=this._aggregator.diff(t,s)}if(this._activeCollectionStorage.has(e,i)){let t=this._activeCollectionStorage.get(e,i);n=this._aggregator.merge(t,n)}this._cumulativeMemoStorage.set(e,s,i),this._activeCollectionStorage.set(e,n,i)})}collect(){let e=this._activeCollectionStorage;return this._activeCollectionStorage=new e3,e}}class e4{_aggregator;_unreportedAccumulations=new Map;_reportHistory=new Map;constructor(e,t){this._aggregator=e,t.forEach(e=>{this._unreportedAccumulations.set(e,[])})}buildMetrics(e,t,r,i){let n;this._stashAccumulations(r);let a=this._getMergedUnreportedAccumulations(e),o=a;if(this._reportHistory.has(e)){let t=this._reportHistory.get(e),r=t.collectionTime;o=(n=t.aggregationTemporality)===s.CUMULATIVE?e4.merge(t.accumulations,a,this._aggregator):e4.calibrateStartTime(t.accumulations,a,r)}else n=e.selectAggregationTemporality(t.type);this._reportHistory.set(e,{accumulations:o,collectionTime:i,aggregationTemporality:n});let l=Array.from(o.entries());if(0!==l.length)return this._aggregator.toMetricData(t,n,l,i)}_stashAccumulations(e){for(let t of this._unreportedAccumulations.keys()){let r=this._unreportedAccumulations.get(t);void 0===r&&(r=[],this._unreportedAccumulations.set(t,r)),r.push(e)}}_getMergedUnreportedAccumulations(e){let t=new e3,r=this._unreportedAccumulations.get(e);if(this._unreportedAccumulations.set(e,[]),void 0===r)return t;for(let e of r)t=e4.merge(t,e,this._aggregator);return t}static merge(e,t,r){let i=t.entries(),s=i.next();for(;!0!==s.done;){let[t,n,a]=s.value;if(e.has(t,a)){let i=e.get(t,a),s=r.merge(i,n);e.set(t,s,a)}else e.set(t,n,a);s=i.next()}return e}static calibrateStartTime(e,t,r){for(let[i,s]of e.keys()){let e=t.get(i,s);e?.setStartTime(r)}return t}}class e8 extends e1{_attributesProcessor;_aggregationCardinalityLimit;_deltaMetricStorage;_temporalMetricStorage;constructor(e,t,r,i,s){super(e),this._attributesProcessor=r,this._aggregationCardinalityLimit=s,this._deltaMetricStorage=new e5(t,this._aggregationCardinalityLimit),this._temporalMetricStorage=new e4(t,i)}record(e,t){let r=new e3;Array.from(e.entries()).forEach(([e,t])=>{r.set(this._attributesProcessor.process(e),t)}),this._deltaMetricStorage.batchCumulate(r,t)}collect(e,t){let r=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,r,t)}}function e7(e,t){let r="";return e.unit!==t.unit&&(r+=` - Unit '${e.unit}' does not match '${t.unit}' `),e.type!==t.type&&(r+=` - Type '${e.type}' does not match '${t.type}' `),e.valueType!==t.valueType&&(r+=` - Value Type '${e.valueType}' does not match '${t.valueType}' `),e.description!==t.description&&(r+=` - Description '${e.description}' does not match '${t.description}' `),r}function e9(e,t){if(e.valueType!==t.valueType)return` - use valueType '${e.valueType}' on instrument creation or use an instrument name other than '${t.name}'`;if(e.unit!==t.unit)return` - use unit '${e.unit}' on instrument creation or use an instrument name other than '${t.name}'`;if(e.type!==t.type){let r=JSON.stringify({name:t.name,type:t.type,unit:t.unit});return` - create a new view with a name other than '${e.name}' and InstrumentSelector '${r}'`}if(e.description!==t.description){let r=JSON.stringify({name:t.name,type:t.type,unit:t.unit});return` - create a new view with a name other than '${e.name}' and InstrumentSelector '${r}' - OR - create a new view with the name ${e.name} and description '${e.description}' and InstrumentSelector ${r} - OR - create a new view with the name ${t.name} and description '${e.description}' and InstrumentSelector ${r}`}return""}class e6{_sharedRegistry=new Map;_perCollectorRegistry=new Map;static create(){return new e6}getStorages(e){let t=[];for(let e of this._sharedRegistry.values())t=t.concat(e);let r=this._perCollectorRegistry.get(e);if(null!=r)for(let e of r.values())t=t.concat(e);return t}register(e){this._registerStorage(e,this._sharedRegistry)}registerForCollector(e,t){let r=this._perCollectorRegistry.get(e);null==r&&(r=new Map,this._perCollectorRegistry.set(e,r)),this._registerStorage(t,r)}findOrUpdateCompatibleStorage(e){let t=this._sharedRegistry.get(e.name);return void 0===t?null:this._findOrUpdateCompatibleStorage(e,t)}findOrUpdateCompatibleCollectorStorage(e,t){let r=this._perCollectorRegistry.get(e);if(void 0===r)return null;let i=r.get(t.name);return void 0===i?null:this._findOrUpdateCompatibleStorage(t,i)}_registerStorage(e,t){let r=e.getInstrumentDescriptor(),i=t.get(r.name);if(void 0===i)return void t.set(r.name,[e]);i.push(e)}_findOrUpdateCompatibleStorage(e,t){let r=null;for(let i of t){let t=i.getInstrumentDescriptor();!function(e,t){var r,i;return r=e.name,i=t.name,r.toLowerCase()===i.toLowerCase()&&e.unit===t.unit&&e.type===t.type&&e.valueType===t.valueType}(t,e)?c.s.warn("A view or instrument with the name ",e.name," has already been registered and is incompatible with another registered view.\n","Details:\n",e7(t,e),"To resolve the conflict:\n",e9(t,e)):(t.description!==e.description&&(e.description.length>t.description.length&&i.updateDescription(e.description),c.s.warn("A view or instrument with the name ",e.name," has already been registered, but has a different description and is incompatible with another registered view.\n","Details:\n",e7(t,e),"The longer description will be used.\nTo resolve the conflict:",e9(t,e))),r=i)}return r}}class te{_backingStorages;constructor(e){this._backingStorages=e}record(e,t,r,i){this._backingStorages.forEach(s=>{s.record(e,t,r,i)})}}class tt{_instrumentName;_valueType;_buffer=new e3;constructor(e,t){this._instrumentName=e,this._valueType=t}observe(e,t={}){if("number"!=typeof e)return void c.s.warn(`non-number value provided to metric ${this._instrumentName}: ${e}`);(this._valueType!==d.e.INT||Number.isInteger(e)||(c.s.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`),Number.isInteger(e=Math.trunc(e))))&&this._buffer.set(t,e)}}class tr{_buffer=new Map;observe(e,t,r={}){if(!eY(e))return;let i=this._buffer.get(e);if(null==i&&(i=new e3,this._buffer.set(e,i)),"number"!=typeof t)return void c.s.warn(`non-number value provided to metric ${e._descriptor.name}: ${t}`);(e._descriptor.valueType!==d.e.INT||Number.isInteger(t)||(c.s.warn(`INT value type cannot accept a floating-point value for ${e._descriptor.name}, ignoring the fractional digits.`),Number.isInteger(t=Math.trunc(t))))&&i.set(r,t)}}class ti{_callbacks=[];_batchCallbacks=[];addCallback(e,t){this._findCallback(e,t)>=0||this._callbacks.push({callback:e,instrument:t})}removeCallback(e,t){let r=this._findCallback(e,t);r<0||this._callbacks.splice(r,1)}addBatchCallback(e,t){let r=new Set(t.filter(eY));if(0===r.size)return void c.s.error("BatchObservableCallback is not associated with valid instruments",t);this._findBatchCallback(e,r)>=0||this._batchCallbacks.push({callback:e,instruments:r})}removeBatchCallback(e,t){let r=new Set(t.filter(eY)),i=this._findBatchCallback(e,r);i<0||this._batchCallbacks.splice(i,1)}async observe(e,t){let r=this._observeCallbacks(e,t),i=this._observeBatchCallbacks(e,t);return(await ee([...r,...i])).filter(et).map(e=>e.reason)}_observeCallbacks(e,t){return this._callbacks.map(async({callback:r,instrument:i})=>{let s=new tt(i._descriptor.name,i._descriptor.valueType),n=Promise.resolve(r(s));null!=t&&(n=Y(n,t)),await n,i._metricStorages.forEach(t=>{t.record(s._buffer,e)})})}_observeBatchCallbacks(e,t){return this._batchCallbacks.map(async({callback:r,instruments:i})=>{let s=new tr,n=Promise.resolve(r(s));null!=t&&(n=Y(n,t)),await n,i.forEach(t=>{let r=s._buffer.get(t);null!=r&&t._metricStorages.forEach(t=>{t.record(r,e)})})})}_findCallback(e,t){return this._callbacks.findIndex(r=>r.callback===e&&r.instrument===t)}_findBatchCallback(e,t){return this._batchCallbacks.findIndex(r=>r.callback===e&&function(e,t){if(e.size!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0}(r.instruments,t))}}class ts extends e1{_attributesProcessor;_aggregationCardinalityLimit;_deltaMetricStorage;_temporalMetricStorage;constructor(e,t,r,i,s){super(e),this._attributesProcessor=r,this._aggregationCardinalityLimit=s,this._deltaMetricStorage=new e5(t,this._aggregationCardinalityLimit),this._temporalMetricStorage=new e4(t,i)}record(e,t,r,i){t=this._attributesProcessor.process(t,r),this._deltaMetricStorage.record(e,t,r,i)}collect(e,t){let r=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,r,t)}}class tn{process(e,t){return e}}class ta{_processors;constructor(e){this._processors=e}process(e,t){let r=e;for(let e of this._processors)r=e.process(r,t);return r}}let to=new tn;class tl{_meterProviderSharedState;_instrumentationScope;metricStorageRegistry=new e6;observableRegistry=new ti;meter;constructor(e,t){this._meterProviderSharedState=e,this._instrumentationScope=t,this.meter=new e0(this)}registerMetricStorage(e){let t=this._registerMetricStorage(e,ts);return 1===t.length?t[0]:new te(t)}registerAsyncMetricStorage(e){return this._registerMetricStorage(e,e8)}async collect(e,t,r){let i=await this.observableRegistry.observe(t,r?.timeoutMillis),s=this.metricStorageRegistry.getStorages(e);if(0===s.length)return null;let n=s.map(r=>r.collect(e,t)).filter(J);return 0===n.length?{errors:i}:{scopeMetrics:{scope:this._instrumentationScope,metrics:n},errors:i}}_registerMetricStorage(e,t){let r=this._meterProviderSharedState.viewRegistry.findViews(e,this._instrumentationScope).map(r=>{let i={name:r.name??e.name,description:r.description??e.description,type:e.type,unit:e.unit,valueType:e.valueType,advice:e.advice},s=this.metricStorageRegistry.findOrUpdateCompatibleStorage(i);if(null!=s)return s;let n=r.aggregation.createAggregator(i),a=new t(i,n,r.attributesProcessor,this._meterProviderSharedState.metricCollectors,r.aggregationCardinalityLimit);return this.metricStorageRegistry.register(a),a});if(0===r.length){let i=this._meterProviderSharedState.selectAggregations(e.type).map(([r,i])=>{let s=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(r,e);if(null!=s)return s;let n=i.createAggregator(e),a=r.selectCardinalityLimit(e.type),o=new t(e,n,to,[r],a);return this.metricStorageRegistry.registerForCollector(r,o),o});r=r.concat(i)}return r}}class tc{resource;viewRegistry=new eV;metricCollectors=[];meterSharedStates=new Map;constructor(e){this.resource=e}getMeterSharedState(e){let t=`${e.name}:${e.version??""}:${e.schemaUrl??""}`,r=this.meterSharedStates.get(t);return null==r&&(r=new tl(this,e),this.meterSharedStates.set(t,r)),r}selectAggregations(e){let t=[];for(let r of this.metricCollectors)t.push([r,eI(r.selectAggregation(e))]);return t}}class tu{_sharedState;_metricReader;constructor(e,t){this._sharedState=e,this._metricReader=t}async collect(e){let t=(0,O.lg)(Date.now()),r=[],i=[],s=Array.from(this._sharedState.meterSharedStates.values()).map(async s=>{let n=await s.collect(this,t,e);n?.scopeMetrics!=null&&r.push(n.scopeMetrics),n?.errors!=null&&i.push(...n.errors)});return await Promise.all(s),{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:r},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)}selectCardinalityLimit(e){return this._metricReader.selectCardinalityLimit?.(e)??2e3}}let th=/[\^$\\.+?()[\]{}|]/g;class td{_matchAll;_regexp;constructor(e){"*"===e?(this._matchAll=!0,this._regexp=/.*/):(this._matchAll=!1,this._regexp=new RegExp(td.escapePattern(e)))}match(e){return!!this._matchAll||this._regexp.test(e)}static escapePattern(e){return`^${e.replace(th,"\\$&").replace("*",".*")}$`}static hasWildcard(e){return e.includes("*")}}class tm{_matchAll;_pattern;constructor(e){this._matchAll=void 0===e,this._pattern=e}match(e){return!!this._matchAll||e===this._pattern}}class tg{_nameFilter;_type;_unitFilter;constructor(e){this._nameFilter=new td(e?.name??"*"),this._type=e?.type,this._unitFilter=new tm(e?.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}}class tp{_nameFilter;_versionFilter;_schemaUrlFilter;constructor(e){this._nameFilter=new tm(e?.name),this._versionFilter=new tm(e?.version),this._schemaUrlFilter=new tm(e?.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}}class t_{name;description;aggregation;attributesProcessor;instrumentSelector;meterSelector;aggregationCardinalityLimit;constructor(e){(!function(e){if(null==e.instrumentName&&null==e.instrumentType&&null==e.instrumentUnit&&null==e.meterName&&null==e.meterVersion&&null==e.meterSchemaUrl)throw Error("Cannot create view with no selector arguments supplied");if(null!=e.name&&(e?.instrumentName==null||td.hasWildcard(e.instrumentName)))throw Error("Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter.")}(e),null!=e.attributesProcessors)?this.attributesProcessor=new ta(e.attributesProcessors):this.attributesProcessor=to,this.name=e.name,this.description=e.description,this.aggregation=eI(e.aggregation??{type:l.DEFAULT}),this.instrumentSelector=new tg({name:e.instrumentName,type:e.instrumentType,unit:e.instrumentUnit}),this.meterSelector=new tp({name:e.meterName,version:e.meterVersion,schemaUrl:e.meterSchemaUrl}),this.aggregationCardinalityLimit=e.aggregationCardinalityLimit}}class tv{_sharedState;_shutdown=!1;constructor(e){if(this._sharedState=new tc(e?.resource??(0,y.gk)()),e?.views!=null&&e.views.length>0)for(let t of e.views)this._sharedState.viewRegistry.addView(new t_(t));if(e?.readers!=null&&e.readers.length>0)for(let t of e.readers){let e=new tu(this._sharedState,t);t.setMetricProducer(e),this._sharedState.metricCollectors.push(e)}}getMeter(e,t="",r={}){return this._shutdown?(c.s.warn("A shutdown MeterProvider cannot provide a Meter"),(0,g.Ac)()):this._sharedState.getMeterSharedState({name:e,version:t,schemaUrl:r.schemaUrl}).meter}async shutdown(e){if(this._shutdown)return void c.s.warn("shutdown may only be called once per MeterProvider");this._shutdown=!0,await Promise.all(this._sharedState.metricCollectors.map(t=>t.shutdown(e)))}async forceFlush(e){if(this._shutdown)return void c.s.warn("invalid attempt to force flush after MeterProvider shutdown");await Promise.all(this._sharedState.metricCollectors.map(t=>t.forceFlush(e)))}}class tf{emit(e){}}let tb=new tf;class tw{getLogger(e,t,r){return new tf}}let ty=new tw;class tS{constructor(e,t,r,i){this._provider=e,this.name=t,this.version=r,this.options=i}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):tb}}class tT{getLogger(e,t,r){var i;return null!=(i=this.getDelegateLogger(e,t,r))?i:new tS(this,e,t,r)}getDelegate(){var e;return null!=(e=this._delegate)?e:ty}setDelegate(e){this._delegate=e}getDelegateLogger(e,t,r){var i;return null==(i=this._delegate)?void 0:i.getLogger(e,t,r)}}let tx="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof r.g?r.g:{},tM=Symbol.for("io.opentelemetry.js.api.logs");class tE{constructor(){this._proxyLoggerProvider=new tT}static getInstance(){return this._instance||(this._instance=new tE),this._instance}setGlobalLoggerProvider(e){return tx[tM]?this.getLoggerProvider():(tx[tM]=t=>1===t?e:ty,this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,t;return null!=(t=null==(e=tx[tM])?void 0:e.call(tx,1))?t:this._proxyLoggerProvider}getLogger(e,t,r){return this.getLoggerProvider().getLogger(e,t,r)}disable(){delete tx[tM],this._proxyLoggerProvider=new tT}}let tA=tE.getInstance();class tC{hrTime;hrTimeObserved;spanContext;resource;instrumentationScope;attributes={};_severityText;_severityNumber;_body;_eventName;totalAttributesCount=0;_isReadonly=!1;_logRecordLimits;set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get eventName(){return this._eventName}set eventName(e){this._isLogRecordReadonly()||(this._eventName=e)}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}constructor(e,t,r){let{timestamp:i,observedTimestamp:s,eventName:n,severityNumber:a,severityText:o,body:l,attributes:c={},context:d}=r,m=Date.now();if(this.hrTime=(0,O.KJ)(i??m),this.hrTimeObserved=(0,O.KJ)(s??m),d){let e=u.u.getSpanContext(d);e&&h.YA(e)&&(this.spanContext=e)}this.severityNumber=a,this.severityText=o,this.body=l,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this._eventName=n,this.setAttributes(c)}setAttribute(e,t){return this._isLogRecordReadonly()||null===t||(0===e.length?c.s.warn(`Invalid attribute key: ${e}`):(0,U.m)(t)||"object"==typeof t&&!Array.isArray(t)&&Object.keys(t).length>0?(this.totalAttributesCount+=1,Object.keys(this.attributes).length>=this._logRecordLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e))?1===this.droppedAttributesCount&&c.s.warn("Dropping extra attributes."):(0,U.m)(t)?this.attributes[e]=this._truncateToSize(t):this.attributes[e]=t:c.s.warn(`Invalid attribute value set for key: ${e}`)),this}setAttributes(e){for(let[t,r]of Object.entries(e))this.setAttribute(t,r);return this}setBody(e){return this.body=e,this}setEventName(e){return this.eventName=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;return t<=0?(c.s.warn(`Attribute value limit must be positive, got ${t}`),e):"string"==typeof e?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(e=>"string"==typeof e?this._truncateToLimitUtil(e,t):e):e}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&&c.s.warn("Can not execute the operation on emitted log record"),this._isReadonly}}class tP{instrumentationScope;_sharedState;constructor(e,t){this.instrumentationScope=e,this._sharedState=t}emit(e){let t=e.context||m._.active(),r=new tC(this._sharedState,this.instrumentationScope,{context:t,...e});this._sharedState.activeProcessor.onEmit(r,t),r._makeReadonly()}}class tL{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}}class tO{processors;forceFlushTimeoutMillis;constructor(e,t){this.processors=e,this.forceFlushTimeoutMillis=t}async forceFlush(){let e=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map(t=>(0,B.o)(t.forceFlush(),e)))}onEmit(e,t){this.processors.forEach(r=>r.onEmit(e,t))}async shutdown(){await Promise.all(this.processors.map(e=>e.shutdown()))}}class tR{resource;forceFlushTimeoutMillis;logRecordLimits;processors;loggers=new Map;activeProcessor;registeredLogRecordProcessors=[];constructor(e,t,r,i){this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=r,this.processors=i,i.length>0?(this.registeredLogRecordProcessors=i,this.activeProcessor=new tO(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new tL}}class tk{_shutdownOnce;_sharedState;constructor(e={}){let t=(0,F.h)({},{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:(0,D.Jk)("OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:(0,D.Jk)("OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT")??128},includeTraceContext:!0},e),r=e.resource??(0,y.gk)();this._sharedState=new tR(r,t.forceFlushTimeoutMillis,function(e){return{attributeCountLimit:e.attributeCountLimit??(0,D.Jk)("OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT")??(0,D.Jk)("OTEL_ATTRIBUTE_COUNT_LIMIT")??128,attributeValueLengthLimit:e.attributeValueLengthLimit??(0,D.Jk)("OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT")??(0,D.Jk)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0}}(t.logRecordLimits),e?.processors??[]),this._shutdownOnce=new $.I(this._shutdown,this)}getLogger(e,t,r){if(this._shutdownOnce.isCalled)return c.s.warn("A shutdown LoggerProvider cannot provide a Logger"),tb;e||c.s.warn("Logger requested without instrumentation scope name.");let i=e||"unknown",s=`${i}@${t||""}:${r?.schemaUrl||""}`;return this._sharedState.loggers.has(s)||this._sharedState.loggers.set(s,new tP({name:i,version:t,schemaUrl:r?.schemaUrl},this._sharedState)),this._sharedState.loggers.get(s)}forceFlush(){return this._shutdownOnce.isCalled?(c.s.warn("invalid attempt to force flush after LoggerProvider shutdown"),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(c.s.warn("shutdown may only be called once per LoggerProvider"),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}}class tN{export(e,t){this._sendLogRecords(e,t)}shutdown(){return Promise.resolve()}_exportInfo(e){return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationScope,timestamp:(0,O.w_)(e.hrTime),traceId:e.spanContext?.traceId,spanId:e.spanContext?.spanId,traceFlags:e.spanContext?.traceFlags,severityText:e.severityText,severityNumber:e.severityNumber,body:e.body,attributes:e.attributes}}_sendLogRecords(e,t){for(let t of e)console.dir(this._exportInfo(t),{depth:3});t?.({code:N.V.SUCCESS})}}class tI{_exporter;_shutdownOnce;_unresolvedExports;constructor(e){this._exporter=e,this._shutdownOnce=new $.I(this._shutdown,this),this._unresolvedExports=new Set}onEmit(e){if(this._shutdownOnce.isCalled)return;let t=()=>k.mM._export(this._exporter,[e]).then(e=>{e.code!==N.V.SUCCESS&&(0,R.s)(e.error??Error(`SimpleLogRecordProcessor: log record export failed (status ${e})`))}).catch(R.s);if(e.resource.asyncAttributesPending){let r=e.resource.waitForAsyncAttributes?.().then(()=>(this._unresolvedExports.delete(r),t()),R.s);null!=r&&this._unresolvedExports.add(r)}else t()}async forceFlush(){await Promise.all(Array.from(this._unresolvedExports))}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}}class tU{constructor(e={}){var t,r,i;if(this._resource=(0,y.gk)().merge(null!=(t=e.resource)?t:(0,y.QZ)({})),this._resourceDetectors=null!=(r=e.resourceDetectors)?r:[L.X],this._serviceName=e.serviceName,this._serviceVersion=e.serviceVersion,this._autoDetectResources=null==(i=e.autoDetectResources)||i,e.spanProcessor||e.traceExporter||e.spanProcessors){let t={};e.sampler&&(t.sampler=e.sampler),e.spanLimits&&(t.spanLimits=e.spanLimits),e.idGenerator&&(t.idGenerator=e.idGenerator);let r=e.spanProcessors||[];e.traceExporter&&r.push(new T.J(e.traceExporter)),this._tracerProviderConfig={tracerConfig:t,spanProcessor:e.spanProcessor,spanProcessors:r,contextManager:e.contextManager,textMapPropagator:e.textMapPropagator}}e.metricExporters&&(this._meterProviderConfig={metricExporters:e.metricExporters}),e.logExporters&&(this._loggerProviderConfig={logExporters:e.logExporters});let s=[];e.instrumentations&&(s=e.instrumentations),this._instrumentations=s}start(){var e,t,r,i,s;if(this._disabled)return;if(this._autoDetectResources){let e={detectors:this._resourceDetectors};this._resource=this._resource.merge((0,S.$)(e))}this._resource=void 0===this._serviceName?this._resource:this._resource.merge((0,y.QZ)({[P.UX]:this._serviceName})),void 0!==this._serviceVersion&&(this._resource=this._resource.merge((0,y.QZ)({[P.HZ]:this._serviceVersion})));let n=[];(null==(e=this._tracerProviderConfig)?void 0:e.spanProcessor)&&n.push(this._tracerProviderConfig.spanProcessor),(null==(t=this._tracerProviderConfig)?void 0:t.spanProcessors)&&n.push(...this._tracerProviderConfig.spanProcessors);let a=new C.Z(Object.assign(Object.assign({},null==(r=this._tracerProviderConfig)?void 0:r.tracerConfig),{resource:this._resource,spanProcessors:n}));if(this._tracerProvider=a,a.register({contextManager:null==(i=this._tracerProviderConfig)?void 0:i.contextManager,propagator:null==(s=this._tracerProviderConfig)?void 0:s.textMapPropagator}),this._meterProviderConfig){let e=this._meterProviderConfig.metricExporters.map(e=>new eF({exporter:e}));this._meterProvider=new tv({resource:this._resource,readers:e}),p.q.setGlobalMeterProvider(this._meterProvider)}if(this._loggerProviderConfig){let e=this._loggerProviderConfig.logExporters.map(e=>new tI(e));this._loggerProvider=new tk({resource:this._resource,processors:e}),tA.setGlobalLoggerProvider(this._loggerProvider)}(0,w.R)({instrumentations:this._instrumentations})}getResourceAttributes(){return this._resource.attributes}forceFlush(){let e=[];return this._tracerProvider&&e.push(this._tracerProvider.forceFlush()),this._meterProvider&&e.push(this._meterProvider.forceFlush()),this._loggerProvider&&e.push(this._loggerProvider.forceFlush()),Promise.all(e).then(()=>{})}shutdown(){let e=[];return this._tracerProvider&&e.push(this._tracerProvider.shutdown()),this._meterProvider&&e.push(this._meterProvider.shutdown()),this._loggerProvider&&e.push(this._loggerProvider.shutdown()),Promise.all(e).then(()=>{})}}let tD="https://api.honeycomb.io",tB="v1/traces",tF=`${tD}/${tB}`,t$="v1/metrics",tV=`${tD}/${t$}`,tG="v1/logs",tz=`${tD}/${tG}`,tH={apiKey:"",tracesApiKey:"",endpoint:tF,tracesEndpoint:tF,serviceName:"unknown_service",debug:!1,sampleRate:1,skipOptionsValidation:!1,localVisualizations:!1,webVitalsInstrumentationConfig:{enabled:!0}},tj=e=>`@honeycombio/opentelemetry-web: ${e}`,tW=/^[a-f0-9]*$/,tK=/^hc[a-z]ic_[a-z0-9]*$/;function tX(e){if(null==e||0===e.length);else if(32===e.length)return tW.test(e);else if(64===e.length)return tK.test(e);return!1}function tq(e,t){return e.endsWith(t)||e.endsWith(`${t}/`)?e:e.endsWith("/")?e+t:e+"/"+t}let tJ=e=>(null==e?void 0:e.tracesEndpoint)?e.tracesEndpoint:(null==e?void 0:e.endpoint)?tq(e.endpoint,tB):tF,tZ=e=>(null==e?void 0:e.tracesApiKey)||(null==e?void 0:e.apiKey),tQ=e=>"number"==typeof(null==e?void 0:e.sampleRate)&&Number.isSafeInteger(null==e?void 0:e.sampleRate)&&(null==e?void 0:e.sampleRate)>=0?null==e?void 0:e.sampleRate:1,tY=tj("❌ Missing API Key. Set `apiKey` in HoneycombOptions. Telemetry will not be exported."),t0=tj(`❌ Missing Service Name. Set \`serviceName\` in HoneycombOptions. Defaulting to '${tH.serviceName}'`),t1=tj("\uD83D\uDD15 Dataset is ignored in favor of service name."),t2=tj("❌ Missing dataset. Specify either HONEYCOMB_DATASET environment variable or dataset in the options parameter."),t3=tj("⏭️ Skipping options validation. To re-enable, set skipOptionsValidation option or HONEYCOMB_SKIP_OPTIONS_VALIDATION to false."),t5=tj("⏭️ Skipping options validation, because a custom collector is being used."),t4=tj("\uD83D\uDD28 Default deterministic sampler has been overridden. Honeycomb requires a resource attribute called SampleRate to properly show weighted values. Non-deterministic sampleRate could lead to missing spans in Honeycomb. See our docs for more details. https://docs.honeycomb.io/getting-data-in/opentelemetry/node-distro/#sampling-without-the-honeycomb-sdk"),t8=tj("\uD83D\uDD15 Disabling local visualizations - must have both service name and API key configured."),t7=tj("\uD83D\uDD15 Disabling local visualizations - cannot infer auth and ui url roots from endpoint url."),t9=tj("\uD83D\uDD15 Failed to get proper auth response from Honeycomb. No local visualization available."),t6=tj("\uD83D\uDD15 Default honeycomb exporter disabled but no exporters provided");class re{constructor(e){switch(this._sampleRate=e,e){case 0:this._sampler=new x.t;break;case 1:this._sampler=new M.f;break;default:this._sampler=new E.h(1/e)}}shouldSample(e,t,r,i,s,n){let a=this._sampler.shouldSample(e,t,r,i,s,n);return Object.assign(Object.assign({},a),{attributes:Object.assign(Object.assign({},a.attributes),{SampleRate:this._sampleRate})})}toString(){return`DeterministicSampler(${this._sampler.toString()})`}}class rt{t;o=0;i=[];u(e){if(e.hadRecentInput)return;let t=this.i[0],r=this.i.at(-1);this.o&&t&&r&&e.startTime-r.startTime<1e3&&e.startTime-t.startTime<5e3?(this.o+=e.value,this.i.push(e)):(this.o=e.value,this.i=[e]),this.t?.(e)}}let rr=()=>{let e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart{if("loading"===document.readyState)return"loading";{let t=rr();if(t){if(e{let t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},rn=e=>{let t="";try{for(;9!==e?.nodeType;){let r=e,i=r.id?"#"+r.id:[rs(r),...Array.from(r.classList).sort()].join(".");if(t.length+i.length>99)return t||i;if(t=t?i+">"+t:i,r.id)break;e=r.parentNode}}catch{}return t},ra=new WeakMap;function ro(e,t){return ra.get(e)||ra.set(e,new t),ra.get(e)}let rl=-1,rc=e=>{addEventListener("pageshow",t=>{t.persisted&&(rl=t.timeStamp,e(t))},!0)},ru=(e,t,r,i)=>{let s,n;return a=>{t.value>=0&&(a||i)&&((n=t.value-(s??0))||void 0===s)&&(s=t.value,t.delta=n,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t))}},rh=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},rd=()=>{let e=rr();return e?.activationStart??0},rm=(e,t=-1)=>{let r=rr(),i="navigate";return rl>=0?i="back-forward-cache":r&&(document.prerendering||rd()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(0x82f79cd8fff*Math.random())+1e12}`,navigationType:i}},rg=(e,t,r={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let i=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return i.observe({type:e,buffered:!0,...r}),i}}catch{}},rp=e=>{let t=!1;return()=>{t||(e(),t=!0)}},r_=-1,rv=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,rf=e=>{"hidden"===document.visibilityState&&r_>-1&&(r_="visibilitychange"===e.type?e.timeStamp:0,rw())},rb=()=>{addEventListener("visibilitychange",rf,!0),addEventListener("prerenderingchange",rf,!0)},rw=()=>{removeEventListener("visibilitychange",rf,!0),removeEventListener("prerenderingchange",rf,!0)},ry=()=>{if(r_<0){let e=rd();r_=(document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(t=>"hidden"===t.name&&t.startTime>e)[0]?.startTime)??rv(),rb(),rc(()=>{setTimeout(()=>{r_=rv(),rb()})})}return{get firstHiddenTime(){return r_}}},rS=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},rT=[1800,3e3],rx=(e,t={})=>{rS(()=>{let r=ry(),i,s=rm("FCP"),n=rg("paint",e=>{for(let t of e)"first-contentful-paint"===t.name&&(n.disconnect(),t.startTime{i=ru(e,s=rm("FCP"),rT,t.reportAllChanges),rh(()=>{s.value=performance.now()-r.timeStamp,i(!0)})}))})},rM=[.1,.25],rE=e=>e.find(e=>1===e.node?.nodeType)||e[0],rA=0,rC=1/0,rP=0,rL=e=>{for(let t of e)t.interactionId&&(rC=Math.min(rC,t.interactionId),rA=(rP=Math.max(rP,t.interactionId))?(rP-rC)/7+1:0)},rO=()=>i?rA:performance.interactionCount??0,rR=0;class rk{l=[];h=new Map;m;p;v(){rR=rO(),this.l.length=0,this.h.clear()}M(){let e=Math.min(this.l.length-1,Math.floor((rO()-rR)/50));return this.l[e]}u(e){if(this.m?.(e),!e.interactionId&&"first-input"!==e.entryType)return;let t=this.l.at(-1),r=this.h.get(e.interactionId);if(r||this.l.length<10||e.duration>t.T){if(r?e.duration>r.T?(r.entries=[e],r.T=e.duration):e.duration===r.T&&e.startTime===r.entries[0].startTime&&r.entries.push(e):(r={id:e.interactionId,entries:[e],T:e.duration},this.h.set(r.id,r),this.l.push(r)),this.l.sort((e,t)=>t.T-e.T),this.l.length>10)for(let e of this.l.splice(10))this.h.delete(e.id);this.p?.(r)}}}let rN=e=>{let t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=rp(e),document.addEventListener("visibilitychange",e,{once:!0}),t(()=>{e(),document.removeEventListener("visibilitychange",e)}))},rI=[200,500];class rU{m;u(e){this.m?.(e)}}let rD=[2500,4e3],rB=[800,1800],rF=e=>{document.prerendering?rS(()=>rF(e)):"complete"!==document.readyState?addEventListener("load",()=>rF(e),!0):setTimeout(e)};class r${constructor(e,t,r={}){this.instrumentationName=e,this.instrumentationVersion=t,this._wrap=G.wrap,this._unwrap=G.unwrap,this._massWrap=G.massWrap,this._massUnwrap=G.massUnwrap,this._config=Object.assign({enabled:!0},r),this._diag=c.s.createComponentLogger({namespace:e}),this._tracer=u.u.getTracer(e,t),this._meter=p.q.getMeter(e,t),this._updateMetricInstruments()}get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e={}){this._config=Object.assign({},e)}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}}class rV extends r${constructor({enabled:e=!0,vitalsToTrack:t=["CLS","LCP","INP","TTFB","FCP"],lcp:r,cls:i,inp:s,fcp:n,ttfb:a}={}){super("@honeycombio/instrumentation-web-vitals",V.V,{enabled:e,vitalsToTrack:t,lcp:r,cls:i,inp:s,fcp:n,ttfb:a}),this.onReportCLS=(e,t={})=>{let{applyCustomAttributes:r}=t;if(!this.isEnabled())return;let{name:i,attribution:s}=e,{largestShiftTarget:n,largestShiftTime:a,largestShiftValue:o,loadState:l,largestShiftEntry:c}=s,u=this.tracer.startSpan(i);u.setAttributes({"cls.id":e.id,"cls.delta":e.delta,"cls.value":e.value,"cls.rating":e.rating,"cls.navigation_type":e.navigationType,"cls.largest_shift_target":n,"cls.element":n,"cls.largest_shift_time":a,"cls.largest_shift_value":o,"cls.load_state":l,"cls.had_recent_input":null==c?void 0:c.hadRecentInput}),r&&r(e,u),u.end()},this.onReportLCP=(e,t={})=>{let{applyCustomAttributes:r,dataAttributes:i}=t;if(!this.isEnabled())return;let{name:s,attribution:n}=e,{target:a,url:o,timeToFirstByte:l,resourceLoadDelay:c,resourceLoadDuration:u,elementRenderDelay:h,lcpEntry:d}=n,m=this.tracer.startSpan(s);m.setAttributes({"lcp.id":e.id,"lcp.delta":e.delta,"lcp.value":e.value,"lcp.rating":e.rating,"lcp.navigation_type":e.navigationType,"lcp.element":a,"lcp.url":o,"lcp.time_to_first_byte":l,"lcp.resource_load_delay":c,"lcp.resource_load_duration":u,"lcp.element_render_delay":h,"lcp.resource_load_time":u}),this.addDataAttributes(null==d?void 0:d.element,m,i,"lcp"),r&&r(e,m),m.end()},this.onReportINP=(e,t={includeTimingsAsSpans:!1})=>{let{applyCustomAttributes:r,includeTimingsAsSpans:i,dataAttributes:s}=t;if(!this.isEnabled())return;let{name:n,attribution:a}=e,{inputDelay:o,interactionTarget:l,interactionTime:c,interactionType:u,loadState:h,nextPaintTime:d,presentationDelay:m,processingDuration:g,longAnimationFrameEntries:p}=a,_=o+g+m;this.tracer.startActiveSpan(n,{startTime:c},t=>{let n={"inp.id":e.id,"inp.delta":e.delta,"inp.value":e.value,"inp.rating":e.rating,"inp.navigation_type":e.navigationType,"inp.input_delay":o,"inp.interaction_target":l,"inp.interaction_time":c,"inp.interaction_type":u,"inp.load_state":h,"inp.next_paint_time":d,"inp.presentation_delay":m,"inp.processing_duration":g,"inp.duration":_,"inp.element":l,"inp.event_type":u};t.setAttributes(n),e.entries.forEach(e=>{this.addDataAttributes(this.getElementFromNode(e.target),t,s,"inp")}),r&&r(e,t),i&&p.forEach(e=>{this.processPerformanceLongAnimationFrameTimingSpans("inp",e)}),t.end(c+_)})},this.onReportFCP=(e,t={})=>{let{applyCustomAttributes:r}=t;if(!this.isEnabled())return;let{name:i,attribution:s}=e,{timeToFirstByte:n,firstByteToFCP:a,loadState:o}=s,l=this.tracer.startSpan(i);l.setAttributes({"fcp.id":e.id,"fcp.delta":e.delta,"fcp.value":e.value,"fcp.rating":e.rating,"fcp.navigation_type":e.navigationType,"fcp.time_to_first_byte":n,"fcp.time_since_first_byte":a,"fcp.load_state":o}),r&&r(e,l),l.end()},this.onReportTTFB=(e,t={})=>{let{applyCustomAttributes:r}=t;if(!this.isEnabled())return;let{name:i,attribution:s}=e,{cacheDuration:n,connectionDuration:a,dnsDuration:o,requestDuration:l,waitingDuration:c}=s,u={"ttfb.id":e.id,"ttfb.delta":e.delta,"ttfb.value":e.value,"ttfb.rating":e.rating,"ttfb.navigation_type":e.navigationType,"ttfb.waiting_duration":c,"ttfb.dns_duration":o,"ttfb.connection_duration":a,"ttfb.request_duration":l,"ttfb.cache_duration":n,"ttfb.waiting_time":c,"ttfb.dns_time":o,"ttfb.connection_time":a,"ttfb.request_time":l},h=this.tracer.startSpan(i);h.setAttributes(u),r&&r(e,h),h.end()},this.vitalsToTrack=[...t],this.lcpOpts=r,this.clsOpts=i,this.inpOpts=s,this.fcpOpts=n,this.ttfbOpts=a,this._isEnabled=e,this._setupWebVitalsCallbacks()}init(){}_setupWebVitalsCallbacks(){this.vitalsToTrack.includes("CLS")&&((e,t={})=>{let r=ro(t=Object.assign({},t),rt),i=new WeakMap;r.t=e=>{if(e?.sources?.length){let r=rE(e.sources);if(r){let e=(t.generateTarget??rn)(r.node);i.set(r,e)}}},((e,t={})=>{rx(rp(()=>{let r,i=rm("CLS",0),s=ro(t,rt),n=e=>{for(let t of e)s.u(t);s.o>i.value&&(i.value=s.o,i.entries=s.i,r())},a=rg("layout-shift",n);a&&(r=ru(e,i,rM,t.reportAllChanges),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&(n(a.takeRecords()),r(!0))}),rc(()=>{s.o=0,r=ru(e,i=rm("CLS",0),rM,t.reportAllChanges),rh(()=>r())}),setTimeout(r))}))})(t=>{e((e=>{let t={};if(e.entries.length){let r=e.entries.reduce((e,t)=>e.value>t.value?e:t);if(r?.sources?.length){let e=rE(r.sources);e&&(t={largestShiftTarget:i.get(e),largestShiftTime:r.startTime,largestShiftValue:r.value,largestShiftSource:e,largestShiftEntry:r,loadState:ri(r.startTime)})}}return Object.assign(e,{attribution:t})})(t))},t)})(e=>{this.onReportCLS(e,this.clsOpts)},this.clsOpts),this.vitalsToTrack.includes("LCP")&&((e,t={})=>{let r=ro(t=Object.assign({},t),rU),i=new WeakMap;r.m=e=>{if(e.element){let r=(t.generateTarget??rn)(e.element);i.set(e,r)}},((e,t={})=>{rS(()=>{let r=ry(),i,s=rm("LCP"),n=ro(t,rU),a=e=>{for(let a of(t.reportAllChanges||(e=e.slice(-1)),e))n.u(a),a.startTime{a(o.takeRecords()),o.disconnect(),i(!0)});for(let e of["keydown","click","visibilitychange"])addEventListener(e,()=>rN(r),{capture:!0,once:!0});rc(r=>{i=ru(e,s=rm("LCP"),rD,t.reportAllChanges),rh(()=>{s.value=performance.now()-r.timeStamp,i(!0)})})}})})(t=>{e((e=>{let t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){let r=rr();if(r){let s=r.activationStart||0,n=e.entries.at(-1),a=n.url&&performance.getEntriesByType("resource").filter(e=>e.name===n.url)[0],o=Math.max(0,r.responseStart-s),l=Math.max(o,a?(a.requestStart||a.startTime)-s:0),c=Math.min(e.value,Math.max(l,a?a.responseEnd-s:0));t={target:i.get(n),timeToFirstByte:o,resourceLoadDelay:l-o,resourceLoadDuration:c-l,elementRenderDelay:e.value-c,navigationEntry:r,lcpEntry:n},n.url&&(t.url=n.url),a&&(t.lcpResourceEntry=a)}}return Object.assign(e,{attribution:t})})(t))},t)})(e=>{this.onReportLCP(e,this.lcpOpts)},this.lcpOpts),this.vitalsToTrack.includes("INP")&&((e,t={})=>{let r=ro(t=Object.assign({},t),rk),s=[],n=[],a=0,o=new WeakMap,l=new WeakMap,c=!1,u=()=>{c||(rN(h),c=!0)},h=()=>{let e=r.l.map(e=>o.get(e.entries[0])),t=n.length-50;n=n.filter((r,i)=>i>=t||e.includes(r));let i=new Set;for(let e of n)for(let t of d(e.startTime,e.processingEnd))i.add(t);let l=s.length-1-50;s=s.filter((e,t)=>e.startTime>a&&t>l||i.has(e)),c=!1};r.m=e=>{let t,r=e.startTime+e.duration;a=Math.max(a,e.processingEnd);for(let i=n.length-1;i>=0;i--){let s=n[i];if(8>=Math.abs(r-s.renderTime)){(t=s).startTime=Math.min(e.startTime,t.startTime),t.processingStart=Math.min(e.processingStart,t.processingStart),t.processingEnd=Math.max(e.processingEnd,t.processingEnd),t.entries.push(e);break}}t||(t={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:r,entries:[e]},n.push(t)),(e.interactionId||"first-input"===e.entryType)&&o.set(e,t),u()},r.p=e=>{if(!l.get(e)){let r=(t.generateTarget??rn)(e.entries[0].target);l.set(e,r)}};let d=(e,t)=>{let r=[];for(let i of s)if(!(i.startTime+i.durationt)break;r.push(i)}return r};rg("long-animation-frame",e=>{s=s.concat(e),u()}),((e,t={})=>{globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype&&rS(()=>{"interactionCount"in performance||i||(i=rg("event",rL,{type:"event",buffered:!0,durationThreshold:0}));let r,s=rm("INP"),n=ro(t,rk),a=e=>{rN(()=>{for(let t of e)n.u(t);let t=n.M();t&&t.T!==s.value&&(s.value=t.T,s.entries=t.entries,r())})},o=rg("event",a,{durationThreshold:t.durationThreshold??40});r=ru(e,s,rI,t.reportAllChanges),o&&(o.observe({type:"first-input",buffered:!0}),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&(a(o.takeRecords()),r(!0))}),rc(()=>{n.v(),r=ru(e,s=rm("INP"),rI,t.reportAllChanges)}))})})(t=>{e((e=>{let t=e.entries[0],i=o.get(t),s=t.processingStart,n=Math.max(t.startTime+t.duration,s),a=Math.min(i.processingEnd,n),c=i.entries.sort((e,t)=>e.processingStart-t.processingStart),u=d(t.startTime,a),h=r.h.get(t.interactionId),m={interactionTarget:l.get(h),interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:n,processedEventEntries:c,longAnimationFrameEntries:u,inputDelay:s-t.startTime,processingDuration:a-s,presentationDelay:n-a,loadState:ri(t.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return(e=>{if(!e.longAnimationFrameEntries?.length)return;let t=e.interactionTime,r=e.inputDelay,i=e.processingDuration,s,n,a=0,o=0,l=0,c=0;for(let l of e.longAnimationFrameEntries)for(let e of(o=o+l.startTime+l.duration-l.styleAndLayoutStart,l.scripts)){let l=e.startTime+e.duration;if(lc&&(n=e.startTime=t+r+i?"presentation-delay":"processing-duration",s=e,c=u)}let u=e.longAnimationFrameEntries.at(-1),h=u?u.startTime+u.duration:0;h>=t+r+i&&(l=e.nextPaintTime-h),s&&n&&(e.longestScript={entry:s,subpart:n,intersectingDuration:c}),e.totalScriptDuration=a,e.totalStyleAndLayoutDuration=o,e.totalPaintDuration=l,e.totalUnattributedDuration=e.nextPaintTime-t-a-o-l})(m),Object.assign(e,{attribution:m})})(t))},t)})(e=>{this.onReportINP(e,this.inpOpts)},this.inpOpts),this.vitalsToTrack.includes("TTFB")&&((e,t={})=>{((e,t={})=>{let r=rm("TTFB"),i=ru(e,r,rB,t.reportAllChanges);rF(()=>{let s=rr();s&&(r.value=Math.max(s.responseStart-rd(),0),r.entries=[s],i(!0),rc(()=>{(i=ru(e,r=rm("TTFB",0),rB,t.reportAllChanges))(!0)}))})})(t=>{e((e=>{let t={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(e.entries.length){let r=e.entries[0],i=r.activationStart||0,s=Math.max((r.workerStart||r.fetchStart)-i,0),n=Math.max(r.domainLookupStart-i,0),a=Math.max(r.connectStart-i,0),o=Math.max(r.connectEnd-i,0);t={waitingDuration:s,cacheDuration:n-s,dnsDuration:a-n,connectionDuration:o-a,requestDuration:e.value-o,navigationEntry:r}}return Object.assign(e,{attribution:t})})(t))},t)})(e=>{this.onReportTTFB(e,this.ttfbOpts)},this.ttfbOpts),this.vitalsToTrack.includes("FCP")&&((e,t={})=>{rx(t=>{e((e=>{let t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:ri(rl)};if(e.entries.length){let r=rr(),i=e.entries.at(-1);if(r){let s=r.activationStart||0,n=Math.max(0,r.responseStart-s);t={timeToFirstByte:n,firstByteToFCP:e.value-n,loadState:ri(e.entries[0].startTime),navigationEntry:r,fcpEntry:i}}}return Object.assign(e,{attribution:t})})(t))},t)})(e=>{this.onReportFCP(e,this.fcpOpts)},this.fcpOpts)}getAttrPrefix(e){return e.toLowerCase()}getAttributesForPerformanceLongAnimationFrameTiming(e){return{"inp.timing.duration":e.duration,"inp.timing.entryType":e.entryType,"inp.timing.name":e.name,"inp.timing.renderStart":e.renderStart,"inp.timing.startTime":e.startTime}}getAttributesForPerformanceScriptTiming(e){return{"inp.timing.script.entry_type":e.entryType,"inp.timing.script.start_time":e.startTime,"inp.timing.script.execution_start":e.executionStart,"inp.timing.script.duration":e.duration,"inp.timing.script.forced_style_and_layout_duration":e.forcedStyleAndLayoutDuration,"inp.timing.script.invoker":e.invoker,"inp.timing.script.pause_duration":e.pauseDuration,"inp.timing.script.source_url":e.sourceURL,"inp.timing.script.source_function_name":e.sourceFunctionName,"inp.timing.script.source_char_position":e.sourceCharPosition,"inp.timing.script.window_attribution":e.windowAttribution}}processPerformanceLongAnimationFrameTimingSpans(e,t){if(!t)return;let r=this.getAttributesForPerformanceLongAnimationFrameTiming(t);this.tracer.startActiveSpan(t.name,{startTime:t.startTime},i=>{i.setAttributes(r),this.processPerformanceScriptTimingSpans(e,t.scripts),i.end(t.startTime+t.duration)})}processPerformanceScriptTimingSpans(e,t){t&&(null==t?void 0:t.length)&&t.map(e=>{this.tracer.startActiveSpan(e.name,{startTime:e.startTime},t=>{let r=this.getAttributesForPerformanceScriptTiming(e);t.setAttributes(r),t.end(e.startTime+e.duration)})})}getElementFromNode(e){if((null==e?void 0:e.nodeType)===Node.ELEMENT_NODE)return e}addDataAttributes(e,t,r,i){if(null==e?void 0:e.dataset)for(let s in e.dataset){let n=e.dataset[s];void 0!==n&&(void 0===r||r.includes(s))&&t.setAttribute(`${i}.element.data.${s}`,n)}}disable(){if(!this.isEnabled())return void this._diag.debug("Instrumentation already disabled");this._isEnabled=!1,this._diag.debug("Instrumentation disabled")}enable(){if(this.isEnabled())return void this._diag.debug("Instrumentation already enabled");this._isEnabled=!0,this._diag.debug("Instrumentation enabled"),this._diag.debug(`Sending spans for ${this.vitalsToTrack.join(",")}`)}isEnabled(){return this._isEnabled}}let rG="@honeycombio/instrumentation-global-errors";class rz extends r${constructor({enabled:e=!0,applyCustomAttributesOnSpan:t}={}){super(rG,V.V,{enabled:e,applyCustomAttributesOnSpan:t}),this.onError=e=>{let t="reason"in e?e.reason:e.error;console.log(this.applyCustomAttributesOnSpan),t&&function(e,t={},r=u.u.getTracer(rG),i){let s=e.message,n=e.name,a=Object.assign(Object.assign({[P.d6]:n,[P.wL]:s,[P.Mb]:e.stack},function(e){if(!e)return{};let t=(0,z.computeStackTrace)(e).stack,r=[],i=[],s=[],n=[];return Array.isArray(t)?(t.forEach(e=>{r.push(e.line),i.push(e.column),s.push(e.func),n.push(e.url)}),{"exception.structured_stacktrace.columns":i,"exception.structured_stacktrace.lines":r,"exception.structured_stacktrace.functions":s,"exception.structured_stacktrace.urls":n}):{}}(e)),t),o=r.startSpan("exception",{attributes:a},m._.active());i&&i(o,e),o.setStatus({code:f.s.ERROR,message:s}),o.end()}(t,{},this.tracer,this.applyCustomAttributesOnSpan)},e&&this.enable(),this._isEnabled=e,this.applyCustomAttributesOnSpan=t}init(){}disable(){if(!this.isEnabled())return void this._diag.debug("Instrumentation already disabled");this._isEnabled=!1,window.removeEventListener("error",this.onError),window.removeEventListener("unhandledrejection",this.onError),this._diag.debug("Instrumentation disabled")}enable(){if(this.isEnabled())return void this._diag.debug("Instrumentation already enabled");this._isEnabled=!0,window.addEventListener("error",this.onError),window.addEventListener("unhandledrejection",this.onError),this._diag.debug("Instrumentation enabled")}isEnabled(){return this._isEnabled}}let rH="x-honeycomb-team",rj="x-honeycomb-dataset";function rW(e,t,r,i=!1){let s=Object.assign(Object.assign({},null==e?void 0:e.headers),r);return t&&!s[rH]&&(s[rH]=t),tX(t)&&(i&&(null==e?void 0:e.metricsDataset)?s[rj]=null==e?void 0:e.metricsDataset:(null==e?void 0:e.dataset)&&(s[rj]=null==e?void 0:e.dataset)),s}class rK{constructor(e,t,r,i,s){if(this._traceUrl="",this._logLevel=_.u.DEBUG,r&&(this._logLevel=r),!e||!t){this._logLevel>=_.u.DEBUG&&console.debug(t8);return}if(!i||!s){this._logLevel>=_.u.DEBUG&&console.debug(t7);return}fetch(i,{headers:{"x-honeycomb-team":t}}).then(e=>{if(e.ok)return e.json();throw Error()}).then(r=>{var i,n,a;if(null==(i=r.team)?void 0:i.slug)this._traceUrl=function(e,t,r,i,s){let n=`${s}/${r}`;return!tX(e)&&i&&(n+=`/environments/${i}`),n+=`/datasets/${t}/trace?trace_id`}(t,e,null==(n=r.team)?void 0:n.slug,null==(a=r.environment)?void 0:a.slug,s);else throw Error()}).catch(()=>{this._logLevel>=_.u.INFO&&console.log(t9)})}export(e,t){this._traceUrl&&e.forEach(e=>{var t;(null==(t=e.parentSpanContext)?void 0:t.spanId)||!(this._logLevel>=_.u.INFO)||console.log(tj(`Honeycomb link: ${this._traceUrl}=${e.spanContext().traceId}`))}),t({code:N.V.SUCCESS})}shutdown(){return Promise.resolve()}}class rX{constructor(e){this._exporters=e}export(e,t){this._exporters.forEach(r=>r.export(e,t)),t({code:N.V.SUCCESS})}async shutdown(){let e=[];this._exporters.forEach(t=>e.push(t.shutdown())),await Promise.all(e)}}class rq{constructor(){}onStart(e,t){var r,i;(null!=(i=null==(r=b.$.getBaggage(t))?void 0:r.getAllEntries())?i:[]).forEach(t=>{e.setAttribute(t[0],t[1].value),c.s.debug(`@honeycombio/opentelemetry-web: 🚨 Baggage in all outgoing headers: ${t[0]}=${t[1].value} `)})}onEnd(){}forceFlush(){return Promise.resolve()}shutdown(){return Promise.resolve()}}class rJ{constructor(){}onStart(e){let{href:t,pathname:r,search:i,hash:s,hostname:n}=window.location;e.setAttributes({"browser.width":window.innerWidth,"browser.height":window.innerHeight,"page.hash":s,"page.url":t,"page.route":r,"page.hostname":n,"page.search":i,"url.path":r})}onEnd(){}forceFlush(){return Promise.resolve()}shutdown(){return Promise.resolve()}}let rZ=new A.s().generateTraceId(),rQ={getSessionId:()=>rZ},rY={path:!0,hash:!0,hostname:!0,referrer:!0,url:!1,search:!1};function r0(e,t){if(e)return t}class r1 extends tU{constructor(e){var t,r;let i=[...(null==e?void 0:e.instrumentations)||[]];(null==(t=null==e?void 0:e.webVitalsInstrumentationConfig)?void 0:t.enabled)!==!1&&i.push(new rV(null==e?void 0:e.webVitalsInstrumentationConfig)),(null==(r=null==e?void 0:e.globalErrorsInstrumentationConfig)?void 0:r.enabled)!==!1&&i.push(new rz(null==e?void 0:e.globalErrorsInstrumentationConfig)),super(Object.assign(Object.assign({},e),{instrumentations:i,resource:(e=>{let t=(0,y.QZ)({});return(null==e?void 0:e.disableBrowserAttributes)||(t=t.merge(function(e){var t;if(!1===e||!(null==window?void 0:window.location))return(0,y.QZ)({});let r=(t=e)?Object.assign(Object.assign({},rY),t):rY,{href:i,pathname:s,search:n,hash:a,hostname:o}=window.location,l={"entry_page.url":r0(r.url,i),"entry_page.path":r0(r.path,s),"entry_page.search":r0(r.search,n),"entry_page.hash":r0(r.hash,a),"entry_page.hostname":r0(r.hostname,o),"entry_page.referrer":r0(r.referrer,document.referrer)};return(0,y.QZ)(l)}(null==e?void 0:e.entryPageAttributes)).merge(function(){var e,t,r;let{browserName:i,browserVersion:s,deviceType:n}=(e=>{let t,r,i=new(q())(e),{name:s,version:n}=i.getBrowser();return{browserName:null!=s?s:"unknown",browserVersion:null!=n?n:"unknown",deviceType:(t=i.getDevice().type,r=s,t||r?t||"desktop":"unknown")}})(navigator.userAgent),a={[P.Mz]:navigator.userAgent,"browser.mobile":navigator.userAgent.includes("Mobi"),"browser.touch_screen_enabled":navigator.maxTouchPoints>0,"browser.language":navigator.language,"browser.name":i,"browser.version":s,"device.type":n,"network.effectiveType":null!=(t=null==(e=navigator.connection)?void 0:e.effectiveType)?t:"unknown","screen.width":window.screen.width,"screen.height":window.screen.height,"screen.size":(r=window.screen.width)<=768?"small":r>768&&r<=1024?"medium":r>1024?"large":"unknown"};return(0,y.QZ)(a)}())),t=t.merge((0,y.QZ)({"honeycomb.distro.version":V.V,"honeycomb.distro.runtime_version":"browser","telemetry.distro.name":"@honeycombio/opentelemetry-web","telemetry.distro.version":V.V})),(null==e?void 0:e.resource)&&(t=t.merge(e.resource)),(null==e?void 0:e.resourceAttributes)&&(t=t.merge((0,y.QZ)(e.resourceAttributes))),t})(e),sampler:(e=>(null==e?void 0:e.sampler)?e.sampler:new re(tQ(e)))(e),spanProcessors:(e=>{let t=[];return(null==e?void 0:e.disableBrowserAttributes)||t.push(new rJ),t.push(new rq,(0,K.r)((null==e?void 0:e.sessionProvider)||rQ),...(null==e?void 0:e.spanProcessors)||[]),t})(e),traceExporter:function(e){let t=[];return(null==e?void 0:e.localVisualizations)&&t.push(function(e){let t=tZ(e),{authRoot:r,uiRoot:i}=((e="")=>{let t,r,i=new URL(e),s=/(api)([.|-])?(.*?)(\.?)(honeycomb\.io)(.*)/.exec(i.host);return null===s?{authRoot:void 0,uiRoot:void 0}:("-"===s[2]?(t=`api-${s[3]}`,r=`ui-${s[3]}`):(t=s[3]?`api.${s[3]}`:"api",r=s[3]?`ui.${s[3]}`:"ui"),{authRoot:`${i.protocol}//${t}.honeycomb.io/1/auth`,uiRoot:`${i.protocol}//${r}.honeycomb.io`})})((null==e?void 0:e.tracesEndpoint)||tJ(e));return new rK(null==e?void 0:e.serviceName,t,null==e?void 0:e.logLevel,r,i)}(e)),(null==e?void 0:e.traceExporter)&&t.push(null==e?void 0:e.traceExporter),(null==e?void 0:e.traceExporters)&&t.push(...e.traceExporters),(null==e?void 0:e.disableDefaultTraceExporter)!==!0&&t.unshift(function(e){let t=tZ(e);return new H.Q({url:tJ(e),headers:rW(e,t,null==e?void 0:e.tracesHeaders),timeoutMillis:(null==e?void 0:e.tracesTimeout)||(null==e?void 0:e.timeout)||1e4})}(e)),new rX([...t])}(e),metricExporters:function(e){let t=[];return(null==e?void 0:e.metricExporters)&&t.push(...e.metricExporters),(null==e?void 0:e.disableDefaultMetricExporter)!==!0&&t.unshift(function(e){let t=(null==e?void 0:e.metricsApiKey)||(null==e?void 0:e.apiKey);return new j.r({url:(null==e?void 0:e.metricsEndpoint)?e.metricsEndpoint:(null==e?void 0:e.endpoint)?tq(e.endpoint,t$):tV,headers:rW(e,t,null==e?void 0:e.metricsHeaders,!0),timeoutMillis:(null==e?void 0:e.metricsTimeout)||(null==e?void 0:e.timeout)||1e4})}(e)),(null==e?void 0:e.localVisualizations)&&t.push(new e$),t}(e),logExporters:function(e){let t=[];return t.push(function(e){let t=(null==e?void 0:e.logsApiKey)||(null==e?void 0:e.apiKey);return new W.B({url:(null==e?void 0:e.logsEndpoint)?e.logsEndpoint:(null==e?void 0:e.endpoint)?tq(e.endpoint,tG):tz,headers:rW(e,t,null==e?void 0:e.logsHeaders),timeoutMillis:(null==e?void 0:e.logsTimeout)||(null==e?void 0:e.timeout)||1e4})}(e)),(null==e?void 0:e.localVisualizations)&&t.push(new tN),t}(e)})),(e=>{var t,r;let i=(null==e?void 0:e.logLevel)?e.logLevel:_.u.DEBUG;if(null==e?void 0:e.skipOptionsValidation){i>=_.u.DEBUG&&console.debug(t3);return}let s=null!=(t=null==e?void 0:e.tracesEndpoint)?t:null==e?void 0:e.endpoint;if(s&&(e=>{try{return!new URL(e).hostname.endsWith(".honeycomb.io")}catch(e){return!1}})(s)){i>=_.u.DEBUG&&console.debug(t5);return}return(null==e?void 0:e.apiKey)||!(i>=_.u.WARN)||console.warn(tY),(null==e?void 0:e.serviceName)||!(i>=_.u.WARN)||console.warn(t0),(null==e?void 0:e.apiKey)&&!tX(null==e?void 0:e.apiKey)&&(null==e?void 0:e.dataset)&&i>=_.u.WARN&&console.warn(t1),(null==e?void 0:e.apiKey)&&tX(null==e?void 0:e.apiKey)&&!(null==e?void 0:e.dataset)&&i>=_.u.WARN&&console.warn(t2),(null==e?void 0:e.sampler)&&i>=_.u.DEBUG&&console.debug(t4),(null==e?void 0:e.disableDefaultTraceExporter)!==!0||(null==e?void 0:e.traceExporter)||(null==(r=null==e?void 0:e.traceExporters)?void 0:r.length)||console.warn(t6)})(e),(null==e?void 0:e.debug)&&function(e){if(!(null==e?void 0:e.debug))return;c.s.setLogger(new v.F,_.u.DEBUG),c.s.debug(tj("\uD83D\uDC1D Honeycomb Web SDK Debug Mode Enabled \uD83D\uDC1D"));let t=tJ(e),r=Object.assign(Object.assign(Object.assign({},tH),e),{tracesEndpoint:t});(function(e){let t=tZ(e)||"";if(!t)return c.s.debug(tY);c.s.debug(tj(`API Key configured for traces: '${t}'`))})(r),function(e){let t=e.serviceName||tH.serviceName;if(t===tH.serviceName)return c.s.debug(t0);c.s.debug(`@honeycombio/opentelemetry-web: Service Name configured for traces: '${t}'`)}(r),function(e){let t=tJ(e);if(!t)return c.s.debug(tj("No endpoint configured for traces"));c.s.debug(tj(`Endpoint configured for traces: '${t}'`))}(r),function(e){let t=tQ(e);if(!t)return c.s.debug("No sampler configured for traces");c.s.debug(tj(`Sample Rate configured for traces: '${t}'`))}(r)}(e)}}}}]);