@semiont/cli 0.5.10 → 0.5.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/cli.mjs +332 -131
- package/dist/dashboard/dashboard.css +1 -1
- package/dist/dashboard/dashboard.css.map +2 -2
- package/dist/frontend/dist/assets/{ArrowsRightLeftIcon-qe5-bw6c.js → ArrowsRightLeftIcon-BAptRmrb.js} +2 -2
- package/dist/frontend/dist/assets/{ArrowsRightLeftIcon-qe5-bw6c.js.map → ArrowsRightLeftIcon-BAptRmrb.js.map} +1 -1
- package/dist/frontend/dist/assets/{ChevronLeftIcon-FJT3xRR7.js → ChevronLeftIcon-AP4JA3_n.js} +2 -2
- package/dist/frontend/dist/assets/{ChevronLeftIcon-FJT3xRR7.js.map → ChevronLeftIcon-AP4JA3_n.js.map} +1 -1
- package/dist/frontend/dist/assets/{CommandLineIcon-D3DqthqG.js → CommandLineIcon-DkeF_y-i.js} +2 -2
- package/dist/frontend/dist/assets/{CommandLineIcon-D3DqthqG.js.map → CommandLineIcon-DkeF_y-i.js.map} +1 -1
- package/dist/frontend/dist/assets/{CookiePreferences-Dt8tnn37.js → CookiePreferences-DulRn1Ad.js} +2 -2
- package/dist/frontend/dist/assets/{CookiePreferences-Dt8tnn37.js.map → CookiePreferences-DulRn1Ad.js.map} +1 -1
- package/dist/frontend/dist/assets/{KeyboardShortcutsContext-DuPrCuAy.js → KeyboardShortcutsContext-_SYsNsgM.js} +2 -2
- package/dist/frontend/dist/assets/{KeyboardShortcutsContext-DuPrCuAy.js.map → KeyboardShortcutsContext-_SYsNsgM.js.map} +1 -1
- package/dist/frontend/dist/assets/PdfAnnotationCanvas.client-KWQ7XDWT-_iZ0YQWT.js +2 -0
- package/dist/frontend/dist/assets/PdfAnnotationCanvas.client-KWQ7XDWT-_iZ0YQWT.js.map +1 -0
- package/dist/frontend/dist/assets/{ToolbarPanels-CafIWhrJ.js → ToolbarPanels-CJP-kOex.js} +2 -2
- package/dist/frontend/dist/assets/{ToolbarPanels-CafIWhrJ.js.map → ToolbarPanels-CJP-kOex.js.map} +1 -1
- package/dist/frontend/dist/assets/{XMarkIcon-C17nOvTt.js → XMarkIcon-BUKaQwJf.js} +2 -2
- package/dist/frontend/dist/assets/{XMarkIcon-C17nOvTt.js.map → XMarkIcon-BUKaQwJf.js.map} +1 -1
- package/dist/frontend/dist/assets/{client-D0zS75_0.js → client-BrDEpGKw.js} +2 -2
- package/dist/frontend/dist/assets/{client-D0zS75_0.js.map → client-BrDEpGKw.js.map} +1 -1
- package/dist/frontend/dist/assets/{client-BIkTmQdO.js → client-C7bo_8D-.js} +2 -2
- package/dist/frontend/dist/assets/{client-BIkTmQdO.js.map → client-C7bo_8D-.js.map} +1 -1
- package/dist/frontend/dist/assets/{client-BykyYEVk.js → client-DwyJWkCL.js} +2 -2
- package/dist/frontend/dist/assets/{client-BykyYEVk.js.map → client-DwyJWkCL.js.map} +1 -1
- package/dist/frontend/dist/assets/{client-B-eX6OX_.js → client-szDQ4r9k.js} +2 -2
- package/dist/frontend/dist/assets/{client-B-eX6OX_.js.map → client-szDQ4r9k.js.map} +1 -1
- package/dist/frontend/dist/assets/{en-P2L4X27N-0z6KilQ7.js → en-P2L4X27N-CUjpZEjK.js} +1 -1
- package/dist/frontend/dist/assets/i18n-C4Z9Yn3V.js +2 -0
- package/dist/frontend/dist/assets/i18n-C4Z9Yn3V.js.map +1 -0
- package/dist/frontend/dist/assets/index-Db2g3DPc.css +1 -0
- package/dist/frontend/dist/assets/index-qVNtMzC0.js +140 -0
- package/dist/frontend/dist/assets/index-qVNtMzC0.js.map +1 -0
- package/dist/frontend/dist/assets/{layout-BY31-yeN.js → layout-DTmqSMaD.js} +2 -2
- package/dist/frontend/dist/assets/{layout-BY31-yeN.js.map → layout-DTmqSMaD.js.map} +1 -1
- package/dist/frontend/dist/assets/{layout-DGTYBtjJ.js → layout-Du8P32Vd.js} +2 -2
- package/dist/frontend/dist/assets/{layout-DGTYBtjJ.js.map → layout-Du8P32Vd.js.map} +1 -1
- package/dist/frontend/dist/assets/{layout-Cxdm1QSw.js → layout-bfsd3hAb.js} +2 -2
- package/dist/frontend/dist/assets/{layout-Cxdm1QSw.js.map → layout-bfsd3hAb.js.map} +1 -1
- package/dist/frontend/dist/assets/{layout-BD701NmF.js → layout-vhDZbfjy.js} +2 -2
- package/dist/frontend/dist/assets/{layout-BD701NmF.js.map → layout-vhDZbfjy.js.map} +1 -1
- package/dist/frontend/dist/assets/{not-found-Dh1Haw3Q.js → not-found-Bvki2-z5.js} +2 -2
- package/dist/frontend/dist/assets/{not-found-Dh1Haw3Q.js.map → not-found-Bvki2-z5.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-DIWUAnia.js → page-B2mIxjOM.js} +2 -2
- package/dist/frontend/dist/assets/{page-DIWUAnia.js.map → page-B2mIxjOM.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-Detb5S1i.js → page-B5mEdf46.js} +2 -2
- package/dist/frontend/dist/assets/{page-Detb5S1i.js.map → page-B5mEdf46.js.map} +1 -1
- package/dist/frontend/dist/assets/page-BJR7WHXg.js +2 -0
- package/dist/frontend/dist/assets/{page-B_8uan5K.js.map → page-BJR7WHXg.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-CwXyG2mE.js → page-Baj4wmy7.js} +2 -2
- package/dist/frontend/dist/assets/{page-CwXyG2mE.js.map → page-Baj4wmy7.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-CbiBBpNp.js → page-BbIr9jHP.js} +2 -2
- package/dist/frontend/dist/assets/{page-CbiBBpNp.js.map → page-BbIr9jHP.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-BulxfVIh.js → page-Bc9V6mf9.js} +2 -2
- package/dist/frontend/dist/assets/{page-BulxfVIh.js.map → page-Bc9V6mf9.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-bULE4fbO.js → page-C-3mAlWS.js} +2 -2
- package/dist/frontend/dist/assets/{page-bULE4fbO.js.map → page-C-3mAlWS.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-CNKRCNFf2.js → page-CECOHOJV2.js} +2 -2
- package/dist/frontend/dist/assets/{page-CNKRCNFf2.js.map → page-CECOHOJV2.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-DwgJ-g4v.js → page-CFCQC-1H.js} +2 -2
- package/dist/frontend/dist/assets/{page-DwgJ-g4v.js.map → page-CFCQC-1H.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-D7vCOwQw.js → page-CW-IRz2J.js} +2 -2
- package/dist/frontend/dist/assets/{page-D7vCOwQw.js.map → page-CW-IRz2J.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-Bu_Nr4-h.js → page-ChXxpqyF.js} +2 -2
- package/dist/frontend/dist/assets/{page-Bu_Nr4-h.js.map → page-ChXxpqyF.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-BpQsrL4J.js → page-CwVdaXSz.js} +2 -2
- package/dist/frontend/dist/assets/{page-BpQsrL4J.js.map → page-CwVdaXSz.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-DFLjp4jy.js → page-D3S88nw6.js} +2 -2
- package/dist/frontend/dist/assets/{page-DFLjp4jy.js.map → page-D3S88nw6.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-ClVer5m1.js → page-DA_80CZf.js} +2 -2
- package/dist/frontend/dist/assets/{page-ClVer5m1.js.map → page-DA_80CZf.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-D7nHNi_l.js → page-DrjzWWIE.js} +2 -2
- package/dist/frontend/dist/assets/{page-D7nHNi_l.js.map → page-DrjzWWIE.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-BV7Fcp6v.js → page-DtiXtJ-l.js} +2 -2
- package/dist/frontend/dist/assets/{page-BV7Fcp6v.js.map → page-DtiXtJ-l.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-CGXJMtNl.js → page-RGbKfKB9.js} +2 -2
- package/dist/frontend/dist/assets/{page-CGXJMtNl.js.map → page-RGbKfKB9.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-31Agm8Zw.js → page-lMAxop92.js} +2 -2
- package/dist/frontend/dist/assets/{page-31Agm8Zw.js.map → page-lMAxop92.js.map} +1 -1
- package/dist/frontend/dist/assets/pdf-KENrED1p.js +55 -0
- package/dist/frontend/dist/assets/pdf-KENrED1p.js.map +1 -0
- package/dist/frontend/dist/assets/pdf.worker.min-DEtVeC4l.mjs +29 -0
- package/dist/frontend/dist/assets/{routing-C4nGqdKk.js → routing-DWK3zAt3.js} +2 -2
- package/dist/frontend/dist/assets/{routing-C4nGqdKk.js.map → routing-DWK3zAt3.js.map} +1 -1
- package/dist/frontend/dist/assets/{routing-BcJzThkn.js → routing-aCi3P9yE.js} +2 -2
- package/dist/frontend/dist/assets/{routing-BcJzThkn.js.map → routing-aCi3P9yE.js.map} +1 -1
- package/dist/frontend/dist/assets/{vendor-B3B3_s0C.js → vendor-6KmH4nv9.js} +2 -2
- package/dist/frontend/dist/assets/{vendor-B3B3_s0C.js.map → vendor-6KmH4nv9.js.map} +1 -1
- package/dist/frontend/dist/assets/{web-DBB_8PTg.js → web-BE6xPuyf.js} +2 -2
- package/dist/frontend/dist/assets/{web-DBB_8PTg.js.map → web-BE6xPuyf.js.map} +1 -1
- package/dist/frontend/dist/index.html +4 -4
- package/dist/frontend/package.json +1 -1
- package/package.json +24 -24
- package/dist/frontend/dist/assets/PdfAnnotationCanvas.client-P37SXBWQ-BOxU-1Jy.js +0 -2
- package/dist/frontend/dist/assets/PdfAnnotationCanvas.client-P37SXBWQ-BOxU-1Jy.js.map +0 -1
- package/dist/frontend/dist/assets/i18n-SpKnqnTp.js +0 -2
- package/dist/frontend/dist/assets/i18n-SpKnqnTp.js.map +0 -1
- package/dist/frontend/dist/assets/index-BXSJHlqj.js +0 -140
- package/dist/frontend/dist/assets/index-BXSJHlqj.js.map +0 -1
- package/dist/frontend/dist/assets/index-Cx0aNta6.css +0 -1
- package/dist/frontend/dist/assets/page-B_8uan5K.js +0 -2
- package/dist/frontend/dist/assets/pdf-m5kKOgoq.js +0 -55
- package/dist/frontend/dist/assets/pdf-m5kKOgoq.js.map +0 -1
- package/dist/frontend/dist/assets/pdf.worker.min-CrMmvqMo.mjs +0 -29
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Ct as e,Dt as t,Et as n,Ot as r,St as i,Tt as a,_t as o,bt as s,gt as c,ht as l,vt as u,wt as d,xt as f,yt as ee}from"./index-BXSJHlqj.js";var p;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(p||={});var m=r.instance(),h=class{_delegate;constructor(e){this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}};function g(e,t){let n={attributes:v(e.attributes,t),droppedAttributesCount:0},r=e.schemaUrl;return r&&r!==``&&(n.schemaUrl=r),n}function _(e,t){let n={name:e.name,version:e.version};return e.attributes&&Object.keys(e.attributes).length>0&&(n.attributes=v(e.attributes,t),n.droppedAttributesCount=e.droppedAttributesCount??0),n}function v(e,t){return Object.keys(e).map(n=>te(n,e[n],t))}function te(e,t,n){return{key:e,value:y(t,n)}}function y(e,t){let n=typeof e;if(n===`string`)return{stringValue:e};if(n===`number`)return Number.isInteger(e)?{intValue:e}:{doubleValue:e};if(n===`boolean`)return{boolValue:e};if(e instanceof Uint8Array)return{bytesValue:t.encodeUint8Array(e)};if(Array.isArray(e)){let n=Array(e.length);for(let r=0;r<e.length;r++)n[r]=y(e[r],t);return{arrayValue:{values:n}}}if(n===`object`&&e!=null){let n=Object.keys(e),r=Array(n.length);for(let i=0;i<n.length;i++)r[i]={key:n[i],value:y(e[n[i]],t)};return{kvlistValue:{values:r}}}return{}}var b=256,ne=512;function re(e,t){let n=e&255|b;return t&&(n|=ne),n}function ie(e,t){let n=e.spanContext(),r=e.status,i=e.parentSpanContext?.spanId?t.encodeSpanContext(e.parentSpanContext?.spanId):void 0;return{traceId:t.encodeSpanContext(n.traceId),spanId:t.encodeSpanContext(n.spanId),parentSpanId:i,traceState:n.traceState?.serialize(),name:e.name,kind:e.kind==null?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:v(e.attributes,t),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>oe(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:r.code,message:r.message},links:e.links.map(e=>ae(e,t)),droppedLinksCount:e.droppedLinksCount,flags:re(n.traceFlags,e.parentSpanContext?.isRemote)}}function ae(e,t){return{attributes:e.attributes?v(e.attributes,t):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0,flags:re(e.context.traceFlags,e.context.isRemote)}}function oe(e,t){return{attributes:e.attributes?v(e.attributes,t):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function se(e,t){return{resourceSpans:le(e,t)}}function ce(e){let t=new Map;for(let n of e){let e=t.get(n.resource);e||(e=new Map,t.set(n.resource,e));let r=`${n.instrumentationScope.name}@${n.instrumentationScope.version||``}:${n.instrumentationScope.schemaUrl||``}`,i=e.get(r);i||(i=[],e.set(r,i)),i.push(n)}return t}function le(e,t){let n=ce(e),r=[],i=n.entries(),a=i.next();for(;!a.done;){let[e,n]=a.value,o=[],s=n.values(),c=s.next();for(;!c.done;){let e=c.value;if(e.length>0){let n=e.map(e=>ie(e,t));o.push({scope:_(e[0].instrumentationScope,t),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}c=s.next()}let l=g(e,t),u={resource:l,scopeSpans:o,schemaUrl:l.schemaUrl};r.push(u),a=i.next()}return r}var ue=n(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function de(e){return e.setValue(ue,!0)}function x(e){return e.getValue(ue)===!0}var S=`baggage`,fe=4096;function pe(e){return e.reduce((e,t)=>{let n=`${e}${e===``?``:`,`}${t}`;return n.length>8192?e:n},``)}function me(e){return e.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(n+=`;`+t.metadata.toString()),n})}function he(e){if(!e)return;let n=e.indexOf(`;`),r=n===-1?e:e.substring(0,n),i=r.indexOf(`=`);if(i<=0)return;let a=r.substring(0,i).trim(),o=r.substring(i+1).trim();if(!a||!o)return;let s,c;try{s=decodeURIComponent(a),c=decodeURIComponent(o)}catch{return}let l;return n!==-1&&n<e.length-1&&(l=t(e.substring(n+1))),{key:s,value:c,metadata:l}}function ge(e,t,n,r){let i=0;for(;i<e.length&&n<180;){let a=e.indexOf(`,`,i),o=a===-1?e.length:a,s=o-i;if(s<=4096){let a=he(e.substring(i,o));if(a){let e=(n===0?0:1)+s;if(r+e>8192)break;t[a.key]=a.metadata?{value:a.value,metadata:a.metadata}:{value:a.value},n++,r+=e}}if(a===-1)break;i=a+1}return[n,r]}var _e=class{inject(e,t,n){let r=c.getBaggage(e);if(!r||x(e))return;let i=pe(me(r).filter(e=>e.length<=fe).slice(0,180));i.length>0&&n.set(t,S,i)}extract(e,t,n){let r=n.get(t,S);if(!r)return e;let i={},a=0,o=0;if(Array.isArray(r))for(let e=0;e<r.length;e++)[a,o]=ge(r[e],i,a,o);else[a]=ge(r,i,a,o);return a===0?e:c.setBaggage(e,c.createBaggage(i))}fields(){return[S]}};function C(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!ve(n)){m.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!ye(r)){m.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function ve(e){return typeof e==`string`&&e!==``}function ye(e){return e==null?!0:Array.isArray(e)?be(e):xe(typeof e)}function be(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(xe(e)){t=e;continue}return!1}return!1}}return!0}function xe(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}function Se(){return e=>{m.error(Ce(e))}}function Ce(e){return typeof e==`string`?e:JSON.stringify(we(e))}function we(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;let r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}var Te=Se();function w(e){try{Te(e)}catch{}}var Ee=`2.8.0`,De=`exception.message`,Oe=`exception.stacktrace`,ke=`exception.type`,Ae=`service.name`,je=`service.version`,T=`telemetry.sdk.language`,Me=`webjs`,E=`telemetry.sdk.name`,D=`telemetry.sdk.version`,Ne=`process.runtime.name`,Pe={[E]:`opentelemetry`,[Ne]:`browser`,[T]:Me,[D]:Ee},O=performance,Fe=9,Ie=10**6,k=10**Fe;function A(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*Ie)]}function Le(e){return Ue(A(O.timeOrigin),A(typeof e==`number`?e:O.now()))}function Re(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=k),[n,r]}function ze(e){return e[0]*k+e[1]}function Be(e){return e[0]*1e6+e[1]/1e3}function Ve(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function He(e){return Ve(e)||typeof e==`number`||e instanceof Date}function Ue(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=k&&(n[1]-=k,n[0]+=1),n}var j;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(j||={});var We=class{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[];let t=new Set;for(let e of this._propagators){let n=typeof e.fields==`function`?e.fields():[];for(let e of n)t.add(e)}this._fields=Array.from(t)}inject(e,t,n){for(let r of this._propagators)try{r.inject(e,t,n)}catch(e){m.warn(`Failed to inject with ${r.constructor.name}. Err: ${e.message}`)}}extract(e,t,n){return this._propagators.reduce((e,r)=>{try{return r.extract(e,t,n)}catch(e){m.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}},M=`[_0-9a-z-*/]`,Ge=RegExp(`^(?:${`[a-z]${M}{0,255}`}|${`[a-z0-9]${M}{0,240}@[a-z]${M}{0,13}`})$`),Ke=/^[ -~]{0,255}[!-~]$/,qe=/,|=/;function Je(e){return Ge.test(e)}function Ye(e){return Ke.test(e)&&!qe.test(e)}var Xe=32,Ze=512,Qe=`,`,$e=`=`,et=class e{_length;_rawTraceState;_internalState;constructor(e){this._rawTraceState=typeof e==`string`?e:``,this._length=this._rawTraceState.length}set(e,t){if(!Je(e)||!Ye(t))return this;let n=this._getState(),r=n.get(e),i=this._length;if(typeof r==`string`?i+=t.length-r.length:i+=e.length+t.length+(n.size>0?2:1),i>Ze)return this;let a=new Map(n);return a.delete(e),a.set(e,t),this._fromState(a,i)}unset(e){let t=this._getState(),n=t.get(e);if(typeof n!=`string`)return this;let r=this._length-(e.length+n.length+1);t.size>1&&--r;let i=new Map(t);return i.delete(e),this._fromState(i,r)}get(e){return this._getState().get(e)}serialize(){let e=``,t=0;for(let n of this._getState())t>0&&(e=Qe+e),e=`${n[0]}${$e}${n[1]}`+e,t++;return e}_getState(){if(this._internalState)return this._internalState;let e=this._rawTraceState.split(Qe),t=new Map,n=0;for(let r of e){let e=r.trim(),i=e.indexOf($e);if(i===-1)continue;let a=e.slice(0,i),o=e.slice(i+1);if(!Je(a)||!Ye(o))continue;let s=n+e.length+ +(t.size>0);if(!(s>Ze)&&(t.set(a,o),n=s,t.size>=Xe))break}return this._length=n,this._internalState=new Map(Array.from(t.entries()).reverse()),this._internalState}_fromState(t,n){let r=Object.create(e.prototype);return r._internalState=t,r._length=n,r}},N=`traceparent`,P=`tracestate`,tt=`00`,nt=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`);function rt(e){let t=nt.exec(e);return!t||t[1]===`00`&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var it=class{inject(t,n,r){let i=l.getSpanContext(t);if(!i||x(t)||!s(i))return;let a=`${tt}-${i.traceId}-${i.spanId}-0${Number(i.traceFlags||e.NONE).toString(16)}`;r.set(n,N,a),i.traceState&&r.set(n,P,i.traceState.serialize())}extract(e,t,n){let r=n.get(t,N);if(!r)return e;let i=Array.isArray(r)?r[0]:r;if(typeof i!=`string`)return e;let a=rt(i);if(!a)return e;a.isRemote=!0;let o=n.get(t,P);if(o){let e=Array.isArray(o)?o.join(`,`):o;a.traceState=new et(typeof e==`string`?e:void 0)}return l.setSpanContext(e,a)}fields(){return[N,P]}},at=`[object Object]`,ot=`[object Null]`,st=`[object Undefined]`,ct=Function.prototype.toString,lt=ct.call(Object),ut=Object.getPrototypeOf,dt=Object.prototype,ft=dt.hasOwnProperty,F=Symbol?Symbol.toStringTag:void 0,pt=dt.toString;function mt(e){if(!ht(e)||gt(e)!==at)return!1;let t=ut(e);if(t===null)return!0;let n=ft.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&ct.call(n)===lt}function ht(e){return typeof e==`object`&&!!e}function gt(e){return e==null?e===void 0?st:ot:F&&F in Object(e)?_t(e):vt(e)}function _t(e){let t=ft.call(e,F),n=e[F],r=!1;try{e[F]=void 0,r=!0}catch{}let i=pt.call(e);return r&&(t?e[F]=n:delete e[F]),i}function vt(e){return pt.call(e)}var yt=20;function bt(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=xt(t,e.shift(),0,n);return t}function I(e){return L(e)?e.slice():e}function xt(e,t,n=0,r){let i;if(!(n>yt)){if(n++,z(e)||z(t)||Ct(t))i=I(t);else if(L(e)){if(i=e.slice(),L(t))for(let e=0,n=t.length;e<n;e++)i.push(I(t[e]));else if(R(t)){let e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){let r=e[n];r===`__proto__`||r===`constructor`||r===`prototype`||(i[r]=I(t[r]))}}}else if(R(e))if(R(t)){if(!wt(e,t))return t;i=Object.assign({},e);let a=Object.keys(t);for(let o=0,s=a.length;o<s;o++){let s=a[o];if(s===`__proto__`||s===`constructor`||s===`prototype`)continue;let c=t[s];if(z(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(St(e,s,r)||St(t,s,r))delete i[s];else{if(R(a)&&R(o)){let n=r.get(a)||[],i=r.get(o)||[];n.push({obj:e,key:s}),i.push({obj:t,key:s}),r.set(a,n),r.set(o,i)}i[s]=xt(i[s],c,n,r)}}}}else i=t;return i}}function St(e,t,n){let r=n.get(e[t])||[];for(let n=0,i=r.length;n<i;n++){let i=r[n];if(i.key===t&&i.obj===e)return!0}return!1}function L(e){return Array.isArray(e)}function Ct(e){return typeof e==`function`}function R(e){return!z(e)&&!L(e)&&!Ct(e)&&typeof e==`object`}function z(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function wt(e,t){return!(!mt(e)||!mt(t))}var Tt=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}},Et=class{_isCalled=!1;_deferred=new Tt;_callback;_that;constructor(e,t){this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}};function Dt(e){let t=BigInt(1e9);return BigInt(Math.trunc(e[0]))*t+BigInt(Math.trunc(e[1]))}function Ot(e){return Dt(e).toString()}var kt=typeof BigInt<`u`?Ot:ze;function At(e){return e}var jt={encodeHrTime:kt,encodeSpanContext:At,encodeOptionalSpanContext:At,encodeUint8Array:e=>{if(typeof Buffer<`u`)return Buffer.from(e).toString(`base64`);let t=Array(e.length);for(let n=0;n<e.length;n++)t[n]=String.fromCharCode(e[n]);return btoa(t.join(``))}},Mt={serializeRequest:e=>{let t=se(e,jt);return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(e){return m.warn(`Failed to parse trace export response: ${e.message}. Returning empty response`),{}}}},B=5,Nt=1e3,Pt=5e3,Ft=1.5,It=.2;function Lt(){return 2*It*Math.random()-It}var Rt=class{_transport;constructor(e){this._transport=e}retry(e,t,n){return new Promise((r,i)=>{setTimeout(()=>{this._transport.send(e,t).then(r,i)},n)})}async send(e,t){let n=B,r=Nt,i=Date.now()+t,a=await this._transport.send(e,t);for(;a.status===`retryable`&&n>0;){n--;let t=Math.max(Math.min(r*(1+Lt()),Pt),0);r*=Ft;let o=a.retryInMillis??t,s=i-Date.now();if(o>s)return m.info(`Export retry time ${Math.round(o)}ms exceeds remaining timeout ${Math.round(s)}ms, not retrying further.`),a;m.verbose(`Scheduling export retry in ${Math.round(o)}ms`),a=await this.retry(e,s,o)}return a.status===`success`?m.verbose(`Export succeeded after ${B-n} retry attempts.`):a.status===`retryable`?m.info(`Export failed after maximum retry attempts (${B}).`):m.info(`Export failed with non-retryable error: ${a.error}`),a}shutdown(){return this._transport.shutdown()}};function zt(e){return new Rt(e.transport)}var Bt=class{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw Error(`Concurrency Limit reached`);this._sendingPromises.push(e);let t=()=>{let t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}};function Vt(e){return new Bt(e.concurrencyLimit)}var Ht=class extends Error{code;name=`OTLPExporterError`;data;constructor(e,t,n){super(e),this.data=n,this.code=t}};function Ut(e){return Object.prototype.hasOwnProperty.call(e,`partialSuccess`)}function Wt(){return{handleResponse(e){e==null||!Ut(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||m.warn(`Received Partial Success response:`,JSON.stringify(e.partialSuccess))}}}var Gt=class{_diagLogger;_transport;_serializer;_responseHandler;_promiseQueue;_timeout;constructor(e,t,n,r,i){this._transport=e,this._serializer=t,this._responseHandler=n,this._promiseQueue=r,this._timeout=i,this._diagLogger=m.createComponentLogger({namespace:`OTLPExportDelegate`})}export(e,t){if(this._diagLogger.debug(`items to be sent`,e),this._promiseQueue.hasReachedLimit()){t({code:j.FAILED,error:Error(`Concurrent export limit reached`)});return}let n=this._serializer.serializeRequest(e);if(n==null){t({code:j.FAILED,error:Error(`Nothing to send`)});return}this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(e=>{if(e.status===`success`){if(e.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(e.data))}catch(t){this._diagLogger.warn(`Export succeeded but could not deserialize response - is the response specification compliant?`,t,e.data)}t({code:j.SUCCESS});return}else if(e.status===`failure`&&e.error){t({code:j.FAILED,error:e.error});return}else e.status===`retryable`?t({code:j.FAILED,error:e.error??new Ht(`Export failed with retryable status`)}):t({code:j.FAILED,error:new Ht(`Export failed with unknown error`)})},e=>t({code:j.FAILED,error:e})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug(`shutdown started`),await this.forceFlush(),this._transport.shutdown()}};function Kt(e,t){return new Gt(e.transport,e.serializer,Wt(),e.promiseHandler,t.timeout)}function qt(e,t,n){return Kt({transport:n,serializer:t,promiseHandler:Vt(e)},{timeout:e.timeoutMillis})}function Jt(e){return e===429||e===502||e===503||e===504}function Yt(e){if(e==null)return;let t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?t*1e3:-1;let n=new Date(e).getTime()-Date.now();return n>=0?n:0}var Xt=60*1024,Zt=9,V=0,H=0,Qt=class{_parameters;constructor(e){this._parameters=e}async send(e,t){let n=new AbortController,r=setTimeout(()=>n.abort(),t),i=globalThis.fetch;typeof i.__original==`function`&&(i=i.__original);let a=e.byteLength,o=V+a>Xt,s=!o&&!(H>=Zt);if(s)V+=a,H++;else{let e=o?`size limit`:`count limit`;m.debug(`keepalive disabled: ${(a/1024).toFixed(1)}KB payload, ${H} pending (${e})`)}try{let t=new URL(this._parameters.url),r=await i(t.href,{method:`POST`,headers:await this._parameters.headers(),body:e,signal:n.signal,keepalive:s,mode:globalThis.location?globalThis.location.origin===t.origin?`same-origin`:`cors`:`no-cors`});return r.status>=200&&r.status<=299?(m.debug(`export response success (status: ${r.status})`),{status:`success`}):Jt(r.status)?(m.warn(`export response retryable (status: ${r.status})`),{status:`retryable`,retryInMillis:Yt(r.headers.get(`Retry-After`))}):(m.error(`export response failure (status: ${r.status})`),{status:`failure`,error:Error(`Fetch request failed with non-retryable status ${r.status}`)})}catch(e){return en(e)?(m.warn(`export request retryable (network error: ${e})`),{status:`retryable`,error:Error(`Fetch request encountered a network error`,{cause:e})}):(m.error(`export request failure (error: ${e})`),{status:`failure`,error:Error(`Fetch request errored`,{cause:e})})}finally{clearTimeout(r),s&&(V-=a,H--)}}shutdown(){}};function $t(e){return new Qt(e)}function en(e){return e instanceof TypeError&&!e.cause}function tn(e,t){return qt(e,t,zt({transport:$t(e)}))}function nn(e){if(Number.isFinite(e)&&e>0)return e;throw Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function rn(e){if(e!=null)return async()=>e}function an(e,t,n){return{timeoutMillis:nn(e.timeoutMillis??t.timeoutMillis??n.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??n.concurrencyLimit,compression:e.compression??t.compression??n.compression}}function on(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:`none`}}function sn(e){let t={};return Object.entries(e??{}).forEach(([e,n])=>{n===void 0?m.warn(`Header "${e}" has invalid value (${n}) and will be ignored`):t[e]=String(n)}),t}function cn(e,t,n){return async()=>{let r={...await n()},i={};return t!=null&&Object.assign(i,await t()),e!=null&&Object.assign(i,sn(await e())),Object.assign(i,r)}}function ln(e){if(e!=null)try{let t=globalThis.location?.href;return new URL(e,t).href}catch{throw Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function un(e,t,n){return{...an(e,t,n),headers:cn(e.headers,t.headers,n.headers),url:ln(e.url)??t.url??n.url}}function dn(e,t){return{...on(),headers:async()=>e,url:`http://localhost:4318/`+t}}function fn(e){return typeof e.headers==`function`?e.headers:rn(e.headers)}function pn(e,t,n){return un({url:e.url,timeoutMillis:e.timeoutMillis,headers:fn(e),concurrencyLimit:e.concurrencyLimit},{},dn(n,t))}function mn(e,t,n,r){return tn(pn(e,n,r),t)}var hn=class extends h{constructor(e={}){super(mn(e,Mt,`v1/traces`,{"Content-Type":`application/json`}))}},U;function gn(){if(U===void 0)try{let e=globalThis.process.argv0;U=e?`unknown_service:${e}`:`unknown_service`}catch{U=`unknown_service`}return U}var W=e=>typeof e==`object`&&!!e&&typeof e.then==`function`,_n=class e{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=bn(t),r._asyncAttributesPending=t.filter(([e,t])=>W(t)).length>0,r}constructor(e,t){let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([e,t])=>(W(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=bn(this._rawAttributes),this._schemaUrl=xn(t?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[t,n]=this._rawAttributes[e];this._rawAttributes[e]=[t,W(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&m.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,n]of this._rawAttributes){if(W(n)){m.debug(`Unsettled resource attribute ${t} skipped`);continue}n!=null&&(e[t]??=n)}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let n=Sn(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}};function vn(e,t){return _n.FromAttributeList(Object.entries(e),t)}function yn(){return vn({[Ae]:gn(),[T]:Pe[T],[E]:Pe[E],[D]:Pe[D]})}function bn(e){return e.map(([e,t])=>W(t)?[e,t.catch(t=>{m.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function xn(e){if(typeof e==`string`||e===void 0)return e;m.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function Sn(e,t){let n=e?.schemaUrl,r=t?.schemaUrl,i=n===void 0||n===``,a=r===void 0||r===``;if(i)return r;if(a||n===r)return n;m.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,n,r)}var Cn=`exception`,G=Symbol.for(`nodejs.util.inspect.custom`);function K(e){let t={};for(let[n,r]of e.getRawAttributes())typeof r?.then!=`function`&&r!=null&&(t[n]??=r);return t}function q(e,t,n,r,i){if(typeof n==`number`&&n<0){let t=`[${e}]`;return r?.stylize?r.stylize(t,`special`):t}return typeof i!=`function`||!r?t:`${e} ${i(t,{...r,depth:r.depth==null?r.depth:r.depth-1})}`}var wn=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:u.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){let t=Date.now();if(this._spanContext=e.spanContext,this._performanceStartTime=O.now(),this._performanceOffset=t-(this._performanceStartTime+O.timeOrigin),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,e.links)for(let t of e.links)this.addLink(t);this.startTime=this._getTime(e.startTime??t),this.resource=e.resource,this.instrumentationScope=e.scope,this._recordEndMetrics=e.recordEndMetrics,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,t){if(t==null||this._isSpanEnded())return this;if(e.length===0)return m.warn(`Invalid attribute key: ${e}`),this;if(!ye(t))return m.warn(`Invalid attribute value set for key: ${e}`),this;let{attributeCountLimit:n}=this._spanLimits,r=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n!==void 0&&this._attributesCount>=n&&r?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),r&&this._attributesCount++,this)}setAttributes(e){for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.setAttribute(t,e[t]);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;let{eventCountLimit:r}=this._spanLimits;if(r===0)return m.warn(`No events allowed.`),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&m.debug(`Dropping extra events.`),this.events.shift(),this._droppedEventsCount++),He(t)&&(He(n)||(n=t),t=void 0);let i=C(t),{attributePerEventCountLimit:a}=this._spanLimits,o={},s=0,c=0;for(let e in i){if(!Object.prototype.hasOwnProperty.call(i,e))continue;let t=i[e];if(a!==void 0&&c>=a){s++;continue}o[e]=this._truncateToSize(t),c++}return this.events.push({name:e,attributes:o,time:this._getTime(n),droppedAttributesCount:s}),this}addLink(e){if(this._isSpanEnded())return this;let{linkCountLimit:t}=this._spanLimits;if(t===0)return this._droppedLinksCount++,this;t!==void 0&&this.links.length>=t&&(this._droppedLinksCount===0&&m.debug(`Dropping extra links.`),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:n}=this._spanLimits,r=C(e.attributes),i={},a=0,o=0;for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let t=r[e];if(n!==void 0&&o>=n){a++;continue}i[e]=this._truncateToSize(t),o++}let s={context:e.context};return o>0&&(s.attributes=i),a>0&&(s.droppedAttributesCount=a),this.links.push(s),this}addLinks(e){for(let t of e)this.addLink(t);return this}setStatus(e){if(this._isSpanEnded()||e.code===u.UNSET||this.status.code===u.OK)return this;let t={code:e.code};return e.code===u.ERROR&&(typeof e.message==`string`?t.message=e.message:e.message!=null&&m.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`)),this.status=t,this}updateName(e){return this._isSpanEnded()||(this.name=e),this}end(e){if(this._isSpanEnded()){m.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(e),this._duration=Re(this.startTime,this.endTime),this._duration[0]<0&&(m.warn(`Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.`,this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&m.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&m.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e==`number`&&e<=O.now())return Le(e+this._performanceOffset);if(typeof e==`number`)return A(e);if(e instanceof Date)return A(e.getTime());if(Ve(e))return e;if(this._startTimeProvided)return A(Date.now());let t=O.now()-this._performanceStartTime;return Ue(this.startTime,A(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e==`string`?n[De]=e:e&&(e.code?n[ke]=e.code.toString():e.name&&(n[ke]=e.name),e.message&&(n[De]=e.message),e.stack&&(n[Oe]=e.stack)),n[`exception.type`]||n[`exception.message`]?this.addEvent(Cn,n,t):m.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let e=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);m.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(m.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e==`string`?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(e=>typeof e==`string`?this._truncateToLimitUtil(e,t):e):e}[G](e,t,n){return q(`SpanImpl`,{name:this.name,kind:this.kind,spanContext:this._spanContext,parentSpanContext:this.parentSpanContext,status:this.status,startTime:this.startTime,endTime:this.endTime,duration:this._duration,ended:this._ended,attributes:this.attributes,events:this.events,links:this.links,droppedAttributesCount:this._droppedAttributesCount,droppedEventsCount:this._droppedEventsCount,droppedLinksCount:this._droppedLinksCount,instrumentationScope:this.instrumentationScope,resource:{attributes:K(this.resource)}},e,t,n)}},J;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(J||={});var Y=class{shouldSample(){return{decision:J.NOT_RECORD}}toString(){return`AlwaysOffSampler`}},X=class{shouldSample(){return{decision:J.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}},Z=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||=(w(Error(`ParentBasedSampler must have a root sampler configured`)),new X),this._remoteParentSampled=e.remoteParentSampled??new X,this._remoteParentNotSampled=e.remoteParentNotSampled??new Y,this._localParentSampled=e.localParentSampled??new X,this._localParentNotSampled=e.localParentNotSampled??new Y}shouldSample(t,n,r,i,a,o){let c=l.getSpanContext(t);return!c||!s(c)?this._root.shouldSample(t,n,r,i,a,o):c.isRemote?c.traceFlags&e.SAMPLED?this._remoteParentSampled.shouldSample(t,n,r,i,a,o):this._remoteParentNotSampled.shouldSample(t,n,r,i,a,o):c.traceFlags&e.SAMPLED?this._localParentSampled.shouldSample(t,n,r,i,a,o):this._localParentNotSampled.shouldSample(t,n,r,i,a,o)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}},Tn=class{_ratio;_upperBound;constructor(e=0){this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:f(t)&&this._accumulate(t)<this._upperBound?J.RECORD_AND_SAMPLED:J.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!=`number`||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<32;n+=8){let r=0;for(let t=0;t<8;t++){let i=e.charCodeAt(n+t),a=i<58?i-48:i<71?i-55:i-87;r=r<<4|a}t=(t^r)>>>0}return t}},Q;(function(e){e.AlwaysOff=`always_off`,e.AlwaysOn=`always_on`,e.ParentBasedAlwaysOff=`parentbased_always_off`,e.ParentBasedAlwaysOn=`parentbased_always_on`,e.ParentBasedTraceIdRatio=`parentbased_traceidratio`,e.TraceIdRatio=`traceidratio`})(Q||={});var En=1;function Dn(){return{sampler:On(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function On(){let e=Q.ParentBasedAlwaysOn;switch(e){case Q.AlwaysOn:return new X;case Q.AlwaysOff:return new Y;case Q.ParentBasedAlwaysOn:return new Z({root:new X});case Q.ParentBasedAlwaysOff:return new Z({root:new Y});case Q.TraceIdRatio:return new Tn(kn());case Q.ParentBasedTraceIdRatio:return new Z({root:new Tn(kn())});default:return m.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${Q.ParentBasedAlwaysOn}".`),new Z({root:new X})}}function kn(){return m.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${En}.`),En}function An(e){let t={sampler:On()},n=Dn(),r=Object.assign({},n,t,e);return r.generalLimits=Object.assign({},n.generalLimits,e.generalLimits||{}),r.spanLimits=Object.assign({},n.spanLimits,e.spanLimits||{}),r}function jn(e){let t=Object.assign({},e.spanLimits);return t.attributeCountLimit=e.spanLimits?.attributeCountLimit??e.generalLimits?.attributeCountLimit??void 0??void 0??128,t.attributeValueLengthLimit=e.spanLimits?.attributeValueLengthLimit??e.generalLimits?.attributeValueLengthLimit??void 0??void 0??1/0,Object.assign({},e,{spanLimits:t})}var Mn=class{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e,t){this._exporter=e,this._maxExportBatchSize=typeof t?.maxExportBatchSize==`number`?t.maxExportBatchSize:512,this._maxQueueSize=typeof t?.maxQueueSize==`number`?t.maxQueueSize:2048,this._scheduledDelayMillis=typeof t?.scheduledDelayMillis==`number`?t.scheduledDelayMillis:5e3,this._exportTimeoutMillis=typeof t?.exportTimeoutMillis==`number`?t.exportTimeoutMillis:3e4,this._shutdownOnce=new Et(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(m.warn(`BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(t){this._shutdownOnce.isCalled||(t.spanContext().traceFlags&e.SAMPLED)!==0&&this._addToBuffer(t)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&m.debug(`maxQueueSize reached, dropping spans`),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(m.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{let n=[],r=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let e=0,t=r;e<t;e++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,t)=>{let n=setTimeout(()=>{t(Error(`Timeout`))},this._exportTimeoutMillis);o.with(de(o.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);let i=()=>this._exporter.export(r,r=>{clearTimeout(n),r.code===j.SUCCESS?e():t(r.error??Error(`BatchSpanProcessor: span export failed`))}),a=null;for(let e=0,t=r.length;e<t;e++){let t=r[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(a??=[],a.push(t.resource.waitForAsyncAttributes()))}a===null?i():Promise.all(a).then(i,e=>{w(e),t(e)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{this._isExporting=!1,w(e)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}},Nn=class extends Mn{_visibilityChangeListener;_pageHideListener;constructor(e,t){super(e,t),this.onInit(t)}onInit(e){e?.disableAutoFlushOnDocumentHide!==!0&&typeof document<`u`&&(this._visibilityChangeListener=()=>{document.visibilityState===`hidden`&&this.forceFlush().catch(e=>{w(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{w(e)})},document.addEventListener(`visibilitychange`,this._visibilityChangeListener),document.addEventListener(`pagehide`,this._pageHideListener))}onShutdown(){typeof document<`u`&&(this._visibilityChangeListener&&document.removeEventListener(`visibilitychange`,this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener(`pagehide`,this._pageHideListener))}},Pn=16,Fn=8,In=new Uint8Array(Pn),Ln=new Uint8Array(Fn),Rn=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function zn(e){for(let t=0;t<e.length;t++)e[t]=Math.random()*256>>>0;for(let t=0;t<e.length;t++)if(e[t]>0)return;e[e.length-1]=1}function Bn(e){let t=``;for(let n=0;n<e.length;n++)t+=Rn[e[n]];return t}var Vn=class{generateTraceId(){return zn(In),Bn(In)}generateSpanId(){return zn(Ln),Bn(Ln)}},Hn=`otel.span.parent.origin`,Un=`otel.span.sampling_result`,Wn=`otel.sdk.span.live`,Gn=`otel.sdk.span.started`,Kn=class{startedSpans;liveSpans;constructor(e){this.startedSpans=e.createCounter(Gn,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=e.createUpDownCounter(Wn,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(e,t){let n=Jn(t);if(this.startedSpans.add(1,{[Hn]:qn(e),[Un]:n}),t===J.NOT_RECORD)return()=>{};let r={[Un]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}};function qn(e){return e?e.isRemote?`remote`:`local`:`none`}function Jn(e){switch(e){case J.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case J.RECORD:return`RECORD_ONLY`;case J.NOT_RECORD:return`DROP`}}var Yn=`2.8.0`,Xn=class{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(e,t,n,r){let i=An(t);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=t.idGenerator||new Vn,this._resource=n,this._spanProcessor=r,this.instrumentationScope=e;let a=i.meterProvider?i.meterProvider.getMeter(`@opentelemetry/sdk-trace`,Yn):d();this._tracerMetrics=new Kn(a)}startSpan(t,n={},r=o.active()){n.root&&(r=l.deleteSpan(r));let a=l.getSpan(r);if(x(r))return m.debug(`Instrumentation suppressed, returning Noop Span`),l.wrapSpanContext(i);let s=a?.spanContext(),c=this._idGenerator.generateSpanId(),u,d,f;!s||!l.isSpanContextValid(s)?d=this._idGenerator.generateTraceId():(d=s.traceId,f=s.traceState,u=s);let h=n.kind??ee.INTERNAL,g=(n.links??[]).map(e=>({context:e.context,attributes:C(e.attributes)})),_=C(n.attributes),v=this._sampler.shouldSample(r,d,t,h,_,g),te=this._tracerMetrics.startSpan(s,v.decision);f=v.traceState??f;let y=v.decision===p.RECORD_AND_SAMPLED?e.SAMPLED:e.NONE,b={traceId:d,spanId:c,traceFlags:y,traceState:f};if(v.decision===p.NOT_RECORD)return m.debug(`Recording is off, propagating context in a non-recording span`),l.wrapSpanContext(b);let ne=C(Object.assign(_,v.attributes));return new wn({resource:this._resource,scope:this.instrumentationScope,context:r,spanContext:b,name:t,kind:h,links:g,parentSpanContext:u,attributes:ne,startTime:n.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:te})}startActiveSpan(e,t,n,r){let i,a,s;if(arguments.length<2)return;arguments.length===2?s=t:arguments.length===3?(i=t,s=n):(i=t,a=n,s=r);let c=a??o.active(),u=this.startSpan(e,i,c),d=l.setSpan(c,u);return o.with(d,s,void 0,u)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}[G](e,t,n){return q(`Tracer`,{instrumentationScope:this.instrumentationScope,resource:{attributes:K(this._resource)},spanLimits:this._spanLimits,generalLimits:this._generalLimits},e,t,n)}},Zn=class{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(e=>{w(e||Error(`MultiSpanProcessor: forceFlush failed`)),t()})})}onStart(e,t){for(let n of this._spanProcessors)n.onStart(e,t)}onEnding(e){for(let t of this._spanProcessors)t.onEnding&&t.onEnding(e)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}},$;(function(e){e[e.resolved=0]=`resolved`,e[e.timeout=1]=`timeout`,e[e.error=2]=`error`,e[e.unresolved=3]=`unresolved`})($||={});var Qn=class{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){let t=bt({},Dn(),jn(e));this._resource=t.resource??yn(),this._config=Object.assign({},t,{resource:this._resource});let n=[];e.spanProcessors?.length&&n.push(...e.spanProcessors),this._activeSpanProcessor=new Zn(n)}getTracer(e,t,n){let r=`${e}@${t||``}:${n?.schemaUrl||``}`;return this._tracers.has(r)||this._tracers.set(r,new Xn({name:e,version:t,schemaUrl:n?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(r)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,t=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(n=>{let r,i=setTimeout(()=>{n(Error(`Span processor did not completed within timeout period of ${e} ms`)),r=$.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),r!==$.timeout&&(r=$.resolved,n(r))}).catch(e=>{clearTimeout(i),r=$.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{let r=t.filter(e=>e!==$.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}[G](e,t,n){let r=this._activeSpanProcessor._spanProcessors;return q(`BasicTracerProvider`,{resource:{attributes:K(this._resource)},tracers:Array.from(this._tracers.keys()),spanProcessors:r.map(e=>e.constructor?.name??`SpanProcessor`)},e,t,n)}},$n=class{export(e,t){return this._sendSpans(e,t)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(e){return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationScope,traceId:e.spanContext().traceId,parentSpanContext:e.parentSpanContext,traceState:e.spanContext().traceState?.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:Be(e.startTime),duration:Be(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}}_sendSpans(e,t){for(let t of e)console.dir(this._exportInfo(t),{depth:3});if(t)return t({code:j.SUCCESS})}},er=class{_enabled=!1;_currentContext=a;_bindFunction(e=a,t){let n=this,r=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(r,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}active(){return this._currentContext}bind(e,t){return e===void 0&&(e=this.active()),typeof t==`function`?this._bindFunction(e,t):t}disable(){return this._currentContext=a,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=a,this)}with(e,t,n,...r){let i=this._currentContext;this._currentContext=e||a;try{return t.call(n,...r)}finally{this._currentContext=i}}};function tr(e){if(e!==null){if(e===void 0){let e=new er;e.enable(),o.setGlobalContextManager(e);return}e.enable(),o.setGlobalContextManager(e)}}function nr(e){if(e!==null){if(e===void 0){c.setGlobalPropagator(new We({propagators:[new it,new _e]}));return}c.setGlobalPropagator(e)}}var rr=class extends Qn{constructor(e={}){super(e)}register(e={}){l.setGlobalTracerProvider(this),nr(e.propagator),tr(e.contextManager)}},ir;function ar(e){if(ir||!(e.enabled??!!e.otlpEndpoint))return!1;let t=e.otlpEndpoint?new hn({url:e.otlpEndpoint,...e.otlpHeaders?{headers:e.otlpHeaders}:{}}):new $n;return ir=new rr({resource:vn({[Ae]:e.serviceName,[je]:e.serviceVersion??`0.0.0`}),spanProcessors:[new Nn(t)]}),ir.register(),!0}export{ar as initObservabilityWeb};
|
|
2
|
-
//# sourceMappingURL=web-
|
|
1
|
+
import{Ct as e,Dt as t,Et as n,Ot as r,St as i,Tt as a,_t as o,bt as s,gt as c,ht as l,vt as u,wt as d,xt as f,yt as ee}from"./index-qVNtMzC0.js";var p;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(p||={});var m=r.instance(),h=class{_delegate;constructor(e){this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}};function g(e,t){let n={attributes:v(e.attributes,t),droppedAttributesCount:0},r=e.schemaUrl;return r&&r!==``&&(n.schemaUrl=r),n}function _(e,t){let n={name:e.name,version:e.version};return e.attributes&&Object.keys(e.attributes).length>0&&(n.attributes=v(e.attributes,t),n.droppedAttributesCount=e.droppedAttributesCount??0),n}function v(e,t){return Object.keys(e).map(n=>te(n,e[n],t))}function te(e,t,n){return{key:e,value:y(t,n)}}function y(e,t){let n=typeof e;if(n===`string`)return{stringValue:e};if(n===`number`)return Number.isInteger(e)?{intValue:e}:{doubleValue:e};if(n===`boolean`)return{boolValue:e};if(e instanceof Uint8Array)return{bytesValue:t.encodeUint8Array(e)};if(Array.isArray(e)){let n=Array(e.length);for(let r=0;r<e.length;r++)n[r]=y(e[r],t);return{arrayValue:{values:n}}}if(n===`object`&&e!=null){let n=Object.keys(e),r=Array(n.length);for(let i=0;i<n.length;i++)r[i]={key:n[i],value:y(e[n[i]],t)};return{kvlistValue:{values:r}}}return{}}var b=256,ne=512;function re(e,t){let n=e&255|b;return t&&(n|=ne),n}function ie(e,t){let n=e.spanContext(),r=e.status,i=e.parentSpanContext?.spanId?t.encodeSpanContext(e.parentSpanContext?.spanId):void 0;return{traceId:t.encodeSpanContext(n.traceId),spanId:t.encodeSpanContext(n.spanId),parentSpanId:i,traceState:n.traceState?.serialize(),name:e.name,kind:e.kind==null?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:v(e.attributes,t),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>oe(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:r.code,message:r.message},links:e.links.map(e=>ae(e,t)),droppedLinksCount:e.droppedLinksCount,flags:re(n.traceFlags,e.parentSpanContext?.isRemote)}}function ae(e,t){return{attributes:e.attributes?v(e.attributes,t):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0,flags:re(e.context.traceFlags,e.context.isRemote)}}function oe(e,t){return{attributes:e.attributes?v(e.attributes,t):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function se(e,t){return{resourceSpans:le(e,t)}}function ce(e){let t=new Map;for(let n of e){let e=t.get(n.resource);e||(e=new Map,t.set(n.resource,e));let r=`${n.instrumentationScope.name}@${n.instrumentationScope.version||``}:${n.instrumentationScope.schemaUrl||``}`,i=e.get(r);i||(i=[],e.set(r,i)),i.push(n)}return t}function le(e,t){let n=ce(e),r=[],i=n.entries(),a=i.next();for(;!a.done;){let[e,n]=a.value,o=[],s=n.values(),c=s.next();for(;!c.done;){let e=c.value;if(e.length>0){let n=e.map(e=>ie(e,t));o.push({scope:_(e[0].instrumentationScope,t),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}c=s.next()}let l=g(e,t),u={resource:l,scopeSpans:o,schemaUrl:l.schemaUrl};r.push(u),a=i.next()}return r}var ue=n(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function de(e){return e.setValue(ue,!0)}function x(e){return e.getValue(ue)===!0}var S=`baggage`,fe=4096;function pe(e){return e.reduce((e,t)=>{let n=`${e}${e===``?``:`,`}${t}`;return n.length>8192?e:n},``)}function me(e){return e.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(n+=`;`+t.metadata.toString()),n})}function he(e){if(!e)return;let n=e.indexOf(`;`),r=n===-1?e:e.substring(0,n),i=r.indexOf(`=`);if(i<=0)return;let a=r.substring(0,i).trim(),o=r.substring(i+1).trim();if(!a||!o)return;let s,c;try{s=decodeURIComponent(a),c=decodeURIComponent(o)}catch{return}let l;return n!==-1&&n<e.length-1&&(l=t(e.substring(n+1))),{key:s,value:c,metadata:l}}function ge(e,t,n,r){let i=0;for(;i<e.length&&n<180;){let a=e.indexOf(`,`,i),o=a===-1?e.length:a,s=o-i;if(s<=4096){let a=he(e.substring(i,o));if(a){let e=(n===0?0:1)+s;if(r+e>8192)break;t[a.key]=a.metadata?{value:a.value,metadata:a.metadata}:{value:a.value},n++,r+=e}}if(a===-1)break;i=a+1}return[n,r]}var _e=class{inject(e,t,n){let r=c.getBaggage(e);if(!r||x(e))return;let i=pe(me(r).filter(e=>e.length<=fe).slice(0,180));i.length>0&&n.set(t,S,i)}extract(e,t,n){let r=n.get(t,S);if(!r)return e;let i={},a=0,o=0;if(Array.isArray(r))for(let e=0;e<r.length;e++)[a,o]=ge(r[e],i,a,o);else[a]=ge(r,i,a,o);return a===0?e:c.setBaggage(e,c.createBaggage(i))}fields(){return[S]}};function C(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!ve(n)){m.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!ye(r)){m.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function ve(e){return typeof e==`string`&&e!==``}function ye(e){return e==null?!0:Array.isArray(e)?be(e):xe(typeof e)}function be(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(xe(e)){t=e;continue}return!1}return!1}}return!0}function xe(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}function Se(){return e=>{m.error(Ce(e))}}function Ce(e){return typeof e==`string`?e:JSON.stringify(we(e))}function we(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;let r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}var Te=Se();function w(e){try{Te(e)}catch{}}var Ee=`2.8.0`,De=`exception.message`,Oe=`exception.stacktrace`,ke=`exception.type`,Ae=`service.name`,je=`service.version`,T=`telemetry.sdk.language`,Me=`webjs`,E=`telemetry.sdk.name`,D=`telemetry.sdk.version`,Ne=`process.runtime.name`,Pe={[E]:`opentelemetry`,[Ne]:`browser`,[T]:Me,[D]:Ee},O=performance,Fe=9,Ie=10**6,k=10**Fe;function A(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*Ie)]}function Le(e){return Ue(A(O.timeOrigin),A(typeof e==`number`?e:O.now()))}function Re(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=k),[n,r]}function ze(e){return e[0]*k+e[1]}function Be(e){return e[0]*1e6+e[1]/1e3}function Ve(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function He(e){return Ve(e)||typeof e==`number`||e instanceof Date}function Ue(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=k&&(n[1]-=k,n[0]+=1),n}var j;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(j||={});var We=class{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[];let t=new Set;for(let e of this._propagators){let n=typeof e.fields==`function`?e.fields():[];for(let e of n)t.add(e)}this._fields=Array.from(t)}inject(e,t,n){for(let r of this._propagators)try{r.inject(e,t,n)}catch(e){m.warn(`Failed to inject with ${r.constructor.name}. Err: ${e.message}`)}}extract(e,t,n){return this._propagators.reduce((e,r)=>{try{return r.extract(e,t,n)}catch(e){m.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}},M=`[_0-9a-z-*/]`,Ge=RegExp(`^(?:${`[a-z]${M}{0,255}`}|${`[a-z0-9]${M}{0,240}@[a-z]${M}{0,13}`})$`),Ke=/^[ -~]{0,255}[!-~]$/,qe=/,|=/;function Je(e){return Ge.test(e)}function Ye(e){return Ke.test(e)&&!qe.test(e)}var Xe=32,Ze=512,Qe=`,`,$e=`=`,et=class e{_length;_rawTraceState;_internalState;constructor(e){this._rawTraceState=typeof e==`string`?e:``,this._length=this._rawTraceState.length}set(e,t){if(!Je(e)||!Ye(t))return this;let n=this._getState(),r=n.get(e),i=this._length;if(typeof r==`string`?i+=t.length-r.length:i+=e.length+t.length+(n.size>0?2:1),i>Ze)return this;let a=new Map(n);return a.delete(e),a.set(e,t),this._fromState(a,i)}unset(e){let t=this._getState(),n=t.get(e);if(typeof n!=`string`)return this;let r=this._length-(e.length+n.length+1);t.size>1&&--r;let i=new Map(t);return i.delete(e),this._fromState(i,r)}get(e){return this._getState().get(e)}serialize(){let e=``,t=0;for(let n of this._getState())t>0&&(e=Qe+e),e=`${n[0]}${$e}${n[1]}`+e,t++;return e}_getState(){if(this._internalState)return this._internalState;let e=this._rawTraceState.split(Qe),t=new Map,n=0;for(let r of e){let e=r.trim(),i=e.indexOf($e);if(i===-1)continue;let a=e.slice(0,i),o=e.slice(i+1);if(!Je(a)||!Ye(o))continue;let s=n+e.length+ +(t.size>0);if(!(s>Ze)&&(t.set(a,o),n=s,t.size>=Xe))break}return this._length=n,this._internalState=new Map(Array.from(t.entries()).reverse()),this._internalState}_fromState(t,n){let r=Object.create(e.prototype);return r._internalState=t,r._length=n,r}},N=`traceparent`,P=`tracestate`,tt=`00`,nt=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`);function rt(e){let t=nt.exec(e);return!t||t[1]===`00`&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var it=class{inject(t,n,r){let i=l.getSpanContext(t);if(!i||x(t)||!s(i))return;let a=`${tt}-${i.traceId}-${i.spanId}-0${Number(i.traceFlags||e.NONE).toString(16)}`;r.set(n,N,a),i.traceState&&r.set(n,P,i.traceState.serialize())}extract(e,t,n){let r=n.get(t,N);if(!r)return e;let i=Array.isArray(r)?r[0]:r;if(typeof i!=`string`)return e;let a=rt(i);if(!a)return e;a.isRemote=!0;let o=n.get(t,P);if(o){let e=Array.isArray(o)?o.join(`,`):o;a.traceState=new et(typeof e==`string`?e:void 0)}return l.setSpanContext(e,a)}fields(){return[N,P]}},at=`[object Object]`,ot=`[object Null]`,st=`[object Undefined]`,ct=Function.prototype.toString,lt=ct.call(Object),ut=Object.getPrototypeOf,dt=Object.prototype,ft=dt.hasOwnProperty,F=Symbol?Symbol.toStringTag:void 0,pt=dt.toString;function mt(e){if(!ht(e)||gt(e)!==at)return!1;let t=ut(e);if(t===null)return!0;let n=ft.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&ct.call(n)===lt}function ht(e){return typeof e==`object`&&!!e}function gt(e){return e==null?e===void 0?st:ot:F&&F in Object(e)?_t(e):vt(e)}function _t(e){let t=ft.call(e,F),n=e[F],r=!1;try{e[F]=void 0,r=!0}catch{}let i=pt.call(e);return r&&(t?e[F]=n:delete e[F]),i}function vt(e){return pt.call(e)}var yt=20;function bt(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=xt(t,e.shift(),0,n);return t}function I(e){return L(e)?e.slice():e}function xt(e,t,n=0,r){let i;if(!(n>yt)){if(n++,z(e)||z(t)||Ct(t))i=I(t);else if(L(e)){if(i=e.slice(),L(t))for(let e=0,n=t.length;e<n;e++)i.push(I(t[e]));else if(R(t)){let e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){let r=e[n];r===`__proto__`||r===`constructor`||r===`prototype`||(i[r]=I(t[r]))}}}else if(R(e))if(R(t)){if(!wt(e,t))return t;i=Object.assign({},e);let a=Object.keys(t);for(let o=0,s=a.length;o<s;o++){let s=a[o];if(s===`__proto__`||s===`constructor`||s===`prototype`)continue;let c=t[s];if(z(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(St(e,s,r)||St(t,s,r))delete i[s];else{if(R(a)&&R(o)){let n=r.get(a)||[],i=r.get(o)||[];n.push({obj:e,key:s}),i.push({obj:t,key:s}),r.set(a,n),r.set(o,i)}i[s]=xt(i[s],c,n,r)}}}}else i=t;return i}}function St(e,t,n){let r=n.get(e[t])||[];for(let n=0,i=r.length;n<i;n++){let i=r[n];if(i.key===t&&i.obj===e)return!0}return!1}function L(e){return Array.isArray(e)}function Ct(e){return typeof e==`function`}function R(e){return!z(e)&&!L(e)&&!Ct(e)&&typeof e==`object`}function z(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function wt(e,t){return!(!mt(e)||!mt(t))}var Tt=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}},Et=class{_isCalled=!1;_deferred=new Tt;_callback;_that;constructor(e,t){this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}};function Dt(e){let t=BigInt(1e9);return BigInt(Math.trunc(e[0]))*t+BigInt(Math.trunc(e[1]))}function Ot(e){return Dt(e).toString()}var kt=typeof BigInt<`u`?Ot:ze;function At(e){return e}var jt={encodeHrTime:kt,encodeSpanContext:At,encodeOptionalSpanContext:At,encodeUint8Array:e=>{if(typeof Buffer<`u`)return Buffer.from(e).toString(`base64`);let t=Array(e.length);for(let n=0;n<e.length;n++)t[n]=String.fromCharCode(e[n]);return btoa(t.join(``))}},Mt={serializeRequest:e=>{let t=se(e,jt);return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(e){return m.warn(`Failed to parse trace export response: ${e.message}. Returning empty response`),{}}}},B=5,Nt=1e3,Pt=5e3,Ft=1.5,It=.2;function Lt(){return 2*It*Math.random()-It}var Rt=class{_transport;constructor(e){this._transport=e}retry(e,t,n){return new Promise((r,i)=>{setTimeout(()=>{this._transport.send(e,t).then(r,i)},n)})}async send(e,t){let n=B,r=Nt,i=Date.now()+t,a=await this._transport.send(e,t);for(;a.status===`retryable`&&n>0;){n--;let t=Math.max(Math.min(r*(1+Lt()),Pt),0);r*=Ft;let o=a.retryInMillis??t,s=i-Date.now();if(o>s)return m.info(`Export retry time ${Math.round(o)}ms exceeds remaining timeout ${Math.round(s)}ms, not retrying further.`),a;m.verbose(`Scheduling export retry in ${Math.round(o)}ms`),a=await this.retry(e,s,o)}return a.status===`success`?m.verbose(`Export succeeded after ${B-n} retry attempts.`):a.status===`retryable`?m.info(`Export failed after maximum retry attempts (${B}).`):m.info(`Export failed with non-retryable error: ${a.error}`),a}shutdown(){return this._transport.shutdown()}};function zt(e){return new Rt(e.transport)}var Bt=class{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw Error(`Concurrency Limit reached`);this._sendingPromises.push(e);let t=()=>{let t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}};function Vt(e){return new Bt(e.concurrencyLimit)}var Ht=class extends Error{code;name=`OTLPExporterError`;data;constructor(e,t,n){super(e),this.data=n,this.code=t}};function Ut(e){return Object.prototype.hasOwnProperty.call(e,`partialSuccess`)}function Wt(){return{handleResponse(e){e==null||!Ut(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||m.warn(`Received Partial Success response:`,JSON.stringify(e.partialSuccess))}}}var Gt=class{_diagLogger;_transport;_serializer;_responseHandler;_promiseQueue;_timeout;constructor(e,t,n,r,i){this._transport=e,this._serializer=t,this._responseHandler=n,this._promiseQueue=r,this._timeout=i,this._diagLogger=m.createComponentLogger({namespace:`OTLPExportDelegate`})}export(e,t){if(this._diagLogger.debug(`items to be sent`,e),this._promiseQueue.hasReachedLimit()){t({code:j.FAILED,error:Error(`Concurrent export limit reached`)});return}let n=this._serializer.serializeRequest(e);if(n==null){t({code:j.FAILED,error:Error(`Nothing to send`)});return}this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(e=>{if(e.status===`success`){if(e.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(e.data))}catch(t){this._diagLogger.warn(`Export succeeded but could not deserialize response - is the response specification compliant?`,t,e.data)}t({code:j.SUCCESS});return}else if(e.status===`failure`&&e.error){t({code:j.FAILED,error:e.error});return}else e.status===`retryable`?t({code:j.FAILED,error:e.error??new Ht(`Export failed with retryable status`)}):t({code:j.FAILED,error:new Ht(`Export failed with unknown error`)})},e=>t({code:j.FAILED,error:e})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug(`shutdown started`),await this.forceFlush(),this._transport.shutdown()}};function Kt(e,t){return new Gt(e.transport,e.serializer,Wt(),e.promiseHandler,t.timeout)}function qt(e,t,n){return Kt({transport:n,serializer:t,promiseHandler:Vt(e)},{timeout:e.timeoutMillis})}function Jt(e){return e===429||e===502||e===503||e===504}function Yt(e){if(e==null)return;let t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?t*1e3:-1;let n=new Date(e).getTime()-Date.now();return n>=0?n:0}var Xt=60*1024,Zt=9,V=0,H=0,Qt=class{_parameters;constructor(e){this._parameters=e}async send(e,t){let n=new AbortController,r=setTimeout(()=>n.abort(),t),i=globalThis.fetch;typeof i.__original==`function`&&(i=i.__original);let a=e.byteLength,o=V+a>Xt,s=!o&&!(H>=Zt);if(s)V+=a,H++;else{let e=o?`size limit`:`count limit`;m.debug(`keepalive disabled: ${(a/1024).toFixed(1)}KB payload, ${H} pending (${e})`)}try{let t=new URL(this._parameters.url),r=await i(t.href,{method:`POST`,headers:await this._parameters.headers(),body:e,signal:n.signal,keepalive:s,mode:globalThis.location?globalThis.location.origin===t.origin?`same-origin`:`cors`:`no-cors`});return r.status>=200&&r.status<=299?(m.debug(`export response success (status: ${r.status})`),{status:`success`}):Jt(r.status)?(m.warn(`export response retryable (status: ${r.status})`),{status:`retryable`,retryInMillis:Yt(r.headers.get(`Retry-After`))}):(m.error(`export response failure (status: ${r.status})`),{status:`failure`,error:Error(`Fetch request failed with non-retryable status ${r.status}`)})}catch(e){return en(e)?(m.warn(`export request retryable (network error: ${e})`),{status:`retryable`,error:Error(`Fetch request encountered a network error`,{cause:e})}):(m.error(`export request failure (error: ${e})`),{status:`failure`,error:Error(`Fetch request errored`,{cause:e})})}finally{clearTimeout(r),s&&(V-=a,H--)}}shutdown(){}};function $t(e){return new Qt(e)}function en(e){return e instanceof TypeError&&!e.cause}function tn(e,t){return qt(e,t,zt({transport:$t(e)}))}function nn(e){if(Number.isFinite(e)&&e>0)return e;throw Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function rn(e){if(e!=null)return async()=>e}function an(e,t,n){return{timeoutMillis:nn(e.timeoutMillis??t.timeoutMillis??n.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??n.concurrencyLimit,compression:e.compression??t.compression??n.compression}}function on(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:`none`}}function sn(e){let t={};return Object.entries(e??{}).forEach(([e,n])=>{n===void 0?m.warn(`Header "${e}" has invalid value (${n}) and will be ignored`):t[e]=String(n)}),t}function cn(e,t,n){return async()=>{let r={...await n()},i={};return t!=null&&Object.assign(i,await t()),e!=null&&Object.assign(i,sn(await e())),Object.assign(i,r)}}function ln(e){if(e!=null)try{let t=globalThis.location?.href;return new URL(e,t).href}catch{throw Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function un(e,t,n){return{...an(e,t,n),headers:cn(e.headers,t.headers,n.headers),url:ln(e.url)??t.url??n.url}}function dn(e,t){return{...on(),headers:async()=>e,url:`http://localhost:4318/`+t}}function fn(e){return typeof e.headers==`function`?e.headers:rn(e.headers)}function pn(e,t,n){return un({url:e.url,timeoutMillis:e.timeoutMillis,headers:fn(e),concurrencyLimit:e.concurrencyLimit},{},dn(n,t))}function mn(e,t,n,r){return tn(pn(e,n,r),t)}var hn=class extends h{constructor(e={}){super(mn(e,Mt,`v1/traces`,{"Content-Type":`application/json`}))}},U;function gn(){if(U===void 0)try{let e=globalThis.process.argv0;U=e?`unknown_service:${e}`:`unknown_service`}catch{U=`unknown_service`}return U}var W=e=>typeof e==`object`&&!!e&&typeof e.then==`function`,_n=class e{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=bn(t),r._asyncAttributesPending=t.filter(([e,t])=>W(t)).length>0,r}constructor(e,t){let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([e,t])=>(W(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=bn(this._rawAttributes),this._schemaUrl=xn(t?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[t,n]=this._rawAttributes[e];this._rawAttributes[e]=[t,W(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&m.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,n]of this._rawAttributes){if(W(n)){m.debug(`Unsettled resource attribute ${t} skipped`);continue}n!=null&&(e[t]??=n)}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let n=Sn(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}};function vn(e,t){return _n.FromAttributeList(Object.entries(e),t)}function yn(){return vn({[Ae]:gn(),[T]:Pe[T],[E]:Pe[E],[D]:Pe[D]})}function bn(e){return e.map(([e,t])=>W(t)?[e,t.catch(t=>{m.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function xn(e){if(typeof e==`string`||e===void 0)return e;m.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function Sn(e,t){let n=e?.schemaUrl,r=t?.schemaUrl,i=n===void 0||n===``,a=r===void 0||r===``;if(i)return r;if(a||n===r)return n;m.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,n,r)}var Cn=`exception`,G=Symbol.for(`nodejs.util.inspect.custom`);function K(e){let t={};for(let[n,r]of e.getRawAttributes())typeof r?.then!=`function`&&r!=null&&(t[n]??=r);return t}function q(e,t,n,r,i){if(typeof n==`number`&&n<0){let t=`[${e}]`;return r?.stylize?r.stylize(t,`special`):t}return typeof i!=`function`||!r?t:`${e} ${i(t,{...r,depth:r.depth==null?r.depth:r.depth-1})}`}var wn=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:u.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){let t=Date.now();if(this._spanContext=e.spanContext,this._performanceStartTime=O.now(),this._performanceOffset=t-(this._performanceStartTime+O.timeOrigin),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,e.links)for(let t of e.links)this.addLink(t);this.startTime=this._getTime(e.startTime??t),this.resource=e.resource,this.instrumentationScope=e.scope,this._recordEndMetrics=e.recordEndMetrics,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,t){if(t==null||this._isSpanEnded())return this;if(e.length===0)return m.warn(`Invalid attribute key: ${e}`),this;if(!ye(t))return m.warn(`Invalid attribute value set for key: ${e}`),this;let{attributeCountLimit:n}=this._spanLimits,r=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n!==void 0&&this._attributesCount>=n&&r?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),r&&this._attributesCount++,this)}setAttributes(e){for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.setAttribute(t,e[t]);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;let{eventCountLimit:r}=this._spanLimits;if(r===0)return m.warn(`No events allowed.`),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&m.debug(`Dropping extra events.`),this.events.shift(),this._droppedEventsCount++),He(t)&&(He(n)||(n=t),t=void 0);let i=C(t),{attributePerEventCountLimit:a}=this._spanLimits,o={},s=0,c=0;for(let e in i){if(!Object.prototype.hasOwnProperty.call(i,e))continue;let t=i[e];if(a!==void 0&&c>=a){s++;continue}o[e]=this._truncateToSize(t),c++}return this.events.push({name:e,attributes:o,time:this._getTime(n),droppedAttributesCount:s}),this}addLink(e){if(this._isSpanEnded())return this;let{linkCountLimit:t}=this._spanLimits;if(t===0)return this._droppedLinksCount++,this;t!==void 0&&this.links.length>=t&&(this._droppedLinksCount===0&&m.debug(`Dropping extra links.`),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:n}=this._spanLimits,r=C(e.attributes),i={},a=0,o=0;for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let t=r[e];if(n!==void 0&&o>=n){a++;continue}i[e]=this._truncateToSize(t),o++}let s={context:e.context};return o>0&&(s.attributes=i),a>0&&(s.droppedAttributesCount=a),this.links.push(s),this}addLinks(e){for(let t of e)this.addLink(t);return this}setStatus(e){if(this._isSpanEnded()||e.code===u.UNSET||this.status.code===u.OK)return this;let t={code:e.code};return e.code===u.ERROR&&(typeof e.message==`string`?t.message=e.message:e.message!=null&&m.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`)),this.status=t,this}updateName(e){return this._isSpanEnded()||(this.name=e),this}end(e){if(this._isSpanEnded()){m.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(e),this._duration=Re(this.startTime,this.endTime),this._duration[0]<0&&(m.warn(`Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.`,this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&m.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&m.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e==`number`&&e<=O.now())return Le(e+this._performanceOffset);if(typeof e==`number`)return A(e);if(e instanceof Date)return A(e.getTime());if(Ve(e))return e;if(this._startTimeProvided)return A(Date.now());let t=O.now()-this._performanceStartTime;return Ue(this.startTime,A(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e==`string`?n[De]=e:e&&(e.code?n[ke]=e.code.toString():e.name&&(n[ke]=e.name),e.message&&(n[De]=e.message),e.stack&&(n[Oe]=e.stack)),n[`exception.type`]||n[`exception.message`]?this.addEvent(Cn,n,t):m.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let e=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);m.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(m.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e==`string`?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(e=>typeof e==`string`?this._truncateToLimitUtil(e,t):e):e}[G](e,t,n){return q(`SpanImpl`,{name:this.name,kind:this.kind,spanContext:this._spanContext,parentSpanContext:this.parentSpanContext,status:this.status,startTime:this.startTime,endTime:this.endTime,duration:this._duration,ended:this._ended,attributes:this.attributes,events:this.events,links:this.links,droppedAttributesCount:this._droppedAttributesCount,droppedEventsCount:this._droppedEventsCount,droppedLinksCount:this._droppedLinksCount,instrumentationScope:this.instrumentationScope,resource:{attributes:K(this.resource)}},e,t,n)}},J;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(J||={});var Y=class{shouldSample(){return{decision:J.NOT_RECORD}}toString(){return`AlwaysOffSampler`}},X=class{shouldSample(){return{decision:J.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}},Z=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||=(w(Error(`ParentBasedSampler must have a root sampler configured`)),new X),this._remoteParentSampled=e.remoteParentSampled??new X,this._remoteParentNotSampled=e.remoteParentNotSampled??new Y,this._localParentSampled=e.localParentSampled??new X,this._localParentNotSampled=e.localParentNotSampled??new Y}shouldSample(t,n,r,i,a,o){let c=l.getSpanContext(t);return!c||!s(c)?this._root.shouldSample(t,n,r,i,a,o):c.isRemote?c.traceFlags&e.SAMPLED?this._remoteParentSampled.shouldSample(t,n,r,i,a,o):this._remoteParentNotSampled.shouldSample(t,n,r,i,a,o):c.traceFlags&e.SAMPLED?this._localParentSampled.shouldSample(t,n,r,i,a,o):this._localParentNotSampled.shouldSample(t,n,r,i,a,o)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}},Tn=class{_ratio;_upperBound;constructor(e=0){this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:f(t)&&this._accumulate(t)<this._upperBound?J.RECORD_AND_SAMPLED:J.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!=`number`||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<32;n+=8){let r=0;for(let t=0;t<8;t++){let i=e.charCodeAt(n+t),a=i<58?i-48:i<71?i-55:i-87;r=r<<4|a}t=(t^r)>>>0}return t}},Q;(function(e){e.AlwaysOff=`always_off`,e.AlwaysOn=`always_on`,e.ParentBasedAlwaysOff=`parentbased_always_off`,e.ParentBasedAlwaysOn=`parentbased_always_on`,e.ParentBasedTraceIdRatio=`parentbased_traceidratio`,e.TraceIdRatio=`traceidratio`})(Q||={});var En=1;function Dn(){return{sampler:On(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function On(){let e=Q.ParentBasedAlwaysOn;switch(e){case Q.AlwaysOn:return new X;case Q.AlwaysOff:return new Y;case Q.ParentBasedAlwaysOn:return new Z({root:new X});case Q.ParentBasedAlwaysOff:return new Z({root:new Y});case Q.TraceIdRatio:return new Tn(kn());case Q.ParentBasedTraceIdRatio:return new Z({root:new Tn(kn())});default:return m.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${Q.ParentBasedAlwaysOn}".`),new Z({root:new X})}}function kn(){return m.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${En}.`),En}function An(e){let t={sampler:On()},n=Dn(),r=Object.assign({},n,t,e);return r.generalLimits=Object.assign({},n.generalLimits,e.generalLimits||{}),r.spanLimits=Object.assign({},n.spanLimits,e.spanLimits||{}),r}function jn(e){let t=Object.assign({},e.spanLimits);return t.attributeCountLimit=e.spanLimits?.attributeCountLimit??e.generalLimits?.attributeCountLimit??void 0??void 0??128,t.attributeValueLengthLimit=e.spanLimits?.attributeValueLengthLimit??e.generalLimits?.attributeValueLengthLimit??void 0??void 0??1/0,Object.assign({},e,{spanLimits:t})}var Mn=class{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e,t){this._exporter=e,this._maxExportBatchSize=typeof t?.maxExportBatchSize==`number`?t.maxExportBatchSize:512,this._maxQueueSize=typeof t?.maxQueueSize==`number`?t.maxQueueSize:2048,this._scheduledDelayMillis=typeof t?.scheduledDelayMillis==`number`?t.scheduledDelayMillis:5e3,this._exportTimeoutMillis=typeof t?.exportTimeoutMillis==`number`?t.exportTimeoutMillis:3e4,this._shutdownOnce=new Et(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(m.warn(`BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(t){this._shutdownOnce.isCalled||(t.spanContext().traceFlags&e.SAMPLED)!==0&&this._addToBuffer(t)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&m.debug(`maxQueueSize reached, dropping spans`),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(m.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{let n=[],r=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let e=0,t=r;e<t;e++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,t)=>{let n=setTimeout(()=>{t(Error(`Timeout`))},this._exportTimeoutMillis);o.with(de(o.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);let i=()=>this._exporter.export(r,r=>{clearTimeout(n),r.code===j.SUCCESS?e():t(r.error??Error(`BatchSpanProcessor: span export failed`))}),a=null;for(let e=0,t=r.length;e<t;e++){let t=r[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(a??=[],a.push(t.resource.waitForAsyncAttributes()))}a===null?i():Promise.all(a).then(i,e=>{w(e),t(e)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{this._isExporting=!1,w(e)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}},Nn=class extends Mn{_visibilityChangeListener;_pageHideListener;constructor(e,t){super(e,t),this.onInit(t)}onInit(e){e?.disableAutoFlushOnDocumentHide!==!0&&typeof document<`u`&&(this._visibilityChangeListener=()=>{document.visibilityState===`hidden`&&this.forceFlush().catch(e=>{w(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{w(e)})},document.addEventListener(`visibilitychange`,this._visibilityChangeListener),document.addEventListener(`pagehide`,this._pageHideListener))}onShutdown(){typeof document<`u`&&(this._visibilityChangeListener&&document.removeEventListener(`visibilitychange`,this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener(`pagehide`,this._pageHideListener))}},Pn=16,Fn=8,In=new Uint8Array(Pn),Ln=new Uint8Array(Fn),Rn=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function zn(e){for(let t=0;t<e.length;t++)e[t]=Math.random()*256>>>0;for(let t=0;t<e.length;t++)if(e[t]>0)return;e[e.length-1]=1}function Bn(e){let t=``;for(let n=0;n<e.length;n++)t+=Rn[e[n]];return t}var Vn=class{generateTraceId(){return zn(In),Bn(In)}generateSpanId(){return zn(Ln),Bn(Ln)}},Hn=`otel.span.parent.origin`,Un=`otel.span.sampling_result`,Wn=`otel.sdk.span.live`,Gn=`otel.sdk.span.started`,Kn=class{startedSpans;liveSpans;constructor(e){this.startedSpans=e.createCounter(Gn,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=e.createUpDownCounter(Wn,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(e,t){let n=Jn(t);if(this.startedSpans.add(1,{[Hn]:qn(e),[Un]:n}),t===J.NOT_RECORD)return()=>{};let r={[Un]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}};function qn(e){return e?e.isRemote?`remote`:`local`:`none`}function Jn(e){switch(e){case J.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case J.RECORD:return`RECORD_ONLY`;case J.NOT_RECORD:return`DROP`}}var Yn=`2.8.0`,Xn=class{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(e,t,n,r){let i=An(t);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=t.idGenerator||new Vn,this._resource=n,this._spanProcessor=r,this.instrumentationScope=e;let a=i.meterProvider?i.meterProvider.getMeter(`@opentelemetry/sdk-trace`,Yn):d();this._tracerMetrics=new Kn(a)}startSpan(t,n={},r=o.active()){n.root&&(r=l.deleteSpan(r));let a=l.getSpan(r);if(x(r))return m.debug(`Instrumentation suppressed, returning Noop Span`),l.wrapSpanContext(i);let s=a?.spanContext(),c=this._idGenerator.generateSpanId(),u,d,f;!s||!l.isSpanContextValid(s)?d=this._idGenerator.generateTraceId():(d=s.traceId,f=s.traceState,u=s);let h=n.kind??ee.INTERNAL,g=(n.links??[]).map(e=>({context:e.context,attributes:C(e.attributes)})),_=C(n.attributes),v=this._sampler.shouldSample(r,d,t,h,_,g),te=this._tracerMetrics.startSpan(s,v.decision);f=v.traceState??f;let y=v.decision===p.RECORD_AND_SAMPLED?e.SAMPLED:e.NONE,b={traceId:d,spanId:c,traceFlags:y,traceState:f};if(v.decision===p.NOT_RECORD)return m.debug(`Recording is off, propagating context in a non-recording span`),l.wrapSpanContext(b);let ne=C(Object.assign(_,v.attributes));return new wn({resource:this._resource,scope:this.instrumentationScope,context:r,spanContext:b,name:t,kind:h,links:g,parentSpanContext:u,attributes:ne,startTime:n.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:te})}startActiveSpan(e,t,n,r){let i,a,s;if(arguments.length<2)return;arguments.length===2?s=t:arguments.length===3?(i=t,s=n):(i=t,a=n,s=r);let c=a??o.active(),u=this.startSpan(e,i,c),d=l.setSpan(c,u);return o.with(d,s,void 0,u)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}[G](e,t,n){return q(`Tracer`,{instrumentationScope:this.instrumentationScope,resource:{attributes:K(this._resource)},spanLimits:this._spanLimits,generalLimits:this._generalLimits},e,t,n)}},Zn=class{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(e=>{w(e||Error(`MultiSpanProcessor: forceFlush failed`)),t()})})}onStart(e,t){for(let n of this._spanProcessors)n.onStart(e,t)}onEnding(e){for(let t of this._spanProcessors)t.onEnding&&t.onEnding(e)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}},$;(function(e){e[e.resolved=0]=`resolved`,e[e.timeout=1]=`timeout`,e[e.error=2]=`error`,e[e.unresolved=3]=`unresolved`})($||={});var Qn=class{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){let t=bt({},Dn(),jn(e));this._resource=t.resource??yn(),this._config=Object.assign({},t,{resource:this._resource});let n=[];e.spanProcessors?.length&&n.push(...e.spanProcessors),this._activeSpanProcessor=new Zn(n)}getTracer(e,t,n){let r=`${e}@${t||``}:${n?.schemaUrl||``}`;return this._tracers.has(r)||this._tracers.set(r,new Xn({name:e,version:t,schemaUrl:n?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(r)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,t=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(n=>{let r,i=setTimeout(()=>{n(Error(`Span processor did not completed within timeout period of ${e} ms`)),r=$.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),r!==$.timeout&&(r=$.resolved,n(r))}).catch(e=>{clearTimeout(i),r=$.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{let r=t.filter(e=>e!==$.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}[G](e,t,n){let r=this._activeSpanProcessor._spanProcessors;return q(`BasicTracerProvider`,{resource:{attributes:K(this._resource)},tracers:Array.from(this._tracers.keys()),spanProcessors:r.map(e=>e.constructor?.name??`SpanProcessor`)},e,t,n)}},$n=class{export(e,t){return this._sendSpans(e,t)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(e){return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationScope,traceId:e.spanContext().traceId,parentSpanContext:e.parentSpanContext,traceState:e.spanContext().traceState?.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:Be(e.startTime),duration:Be(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}}_sendSpans(e,t){for(let t of e)console.dir(this._exportInfo(t),{depth:3});if(t)return t({code:j.SUCCESS})}},er=class{_enabled=!1;_currentContext=a;_bindFunction(e=a,t){let n=this,r=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(r,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}active(){return this._currentContext}bind(e,t){return e===void 0&&(e=this.active()),typeof t==`function`?this._bindFunction(e,t):t}disable(){return this._currentContext=a,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=a,this)}with(e,t,n,...r){let i=this._currentContext;this._currentContext=e||a;try{return t.call(n,...r)}finally{this._currentContext=i}}};function tr(e){if(e!==null){if(e===void 0){let e=new er;e.enable(),o.setGlobalContextManager(e);return}e.enable(),o.setGlobalContextManager(e)}}function nr(e){if(e!==null){if(e===void 0){c.setGlobalPropagator(new We({propagators:[new it,new _e]}));return}c.setGlobalPropagator(e)}}var rr=class extends Qn{constructor(e={}){super(e)}register(e={}){l.setGlobalTracerProvider(this),nr(e.propagator),tr(e.contextManager)}},ir;function ar(e){if(ir||!(e.enabled??!!e.otlpEndpoint))return!1;let t=e.otlpEndpoint?new hn({url:e.otlpEndpoint,...e.otlpHeaders?{headers:e.otlpHeaders}:{}}):new $n;return ir=new rr({resource:vn({[Ae]:e.serviceName,[je]:e.serviceVersion??`0.0.0`}),spanProcessors:[new Nn(t)]}),ir.register(),!0}export{ar as initObservabilityWeb};
|
|
2
|
+
//# sourceMappingURL=web-BE6xPuyf.js.map
|