@inkeep/open-knowledge 0.0.0-dev-20260430041629 → 0.0.0-dev-20260430063358

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.
Files changed (50) hide show
  1. package/dist/cli.mjs +5 -5
  2. package/dist/constants-DrhEfUQE.mjs +2 -0
  3. package/dist/{dist-BGmJPYOc.mjs → dist-BAXWuYIZ.mjs} +2 -2
  4. package/dist/{dist-DrvijmGn.mjs → dist-DuYysD9-.mjs} +2 -2
  5. package/dist/{dist-Bxeddlf1.mjs → dist-d3vqEyC5.mjs} +1 -1
  6. package/dist/index.mjs +1 -1
  7. package/dist/init-BjCJuWSb.mjs +1 -0
  8. package/dist/init-CABEHD4d.mjs +1 -0
  9. package/dist/{init-PORXx7vd.mjs → init-CINypD5f.mjs} +3 -3
  10. package/dist/{init-CV_xugP_.mjs → init-CsF5t9q-.mjs} +2 -2
  11. package/dist/{loader-CPzUWkvf.mjs → loader-D1CrMLB2.mjs} +2 -2
  12. package/dist/loader-DRHRURwC.mjs +1 -0
  13. package/dist/paths-CQPr6nyc.mjs +2 -0
  14. package/dist/paths-DK1PziJN.mjs +1 -0
  15. package/dist/{preview-CsRZ-Vcf.mjs → preview-8Vt_tNBB.mjs} +2 -2
  16. package/dist/preview-C-XjtsGD.mjs +1 -0
  17. package/dist/public/assets/{ActivityModeContent-DRqbNhfV.js → ActivityModeContent-IRFPgzna.js} +1 -1
  18. package/dist/public/assets/{DocumentContext-B-H7z2mx.js → DocumentContext-B1Fp4JCg.js} +4 -4
  19. package/dist/public/assets/{GraphPanel-Cj6loEvC.js → GraphPanel-CDyaftq6.js} +1 -1
  20. package/dist/public/assets/McpConsentDialogBody-BKRS2Qm0.js +1 -0
  21. package/dist/public/assets/{SettingsPane-dmFz0VJ8.js → SettingsPane-BMeVMzBd.js} +1 -1
  22. package/dist/public/assets/{SourceEditor-CsO92AcD.js → SourceEditor-CVLfrqOH.js} +1 -1
  23. package/dist/public/assets/{clipboard-CmwParkX.js → clipboard-DcNdBOCD.js} +1 -1
  24. package/dist/public/assets/{config-validation-events-CHBXJot6.js → config-validation-events-CpU7XuBS.js} +1 -1
  25. package/dist/public/assets/index-BSJSvPoC.js +1843 -0
  26. package/dist/public/assets/index-C5vN2roo.css +1 -0
  27. package/dist/public/assets/mcp-consent-store-BBTXqzE6.js +1 -0
  28. package/dist/public/assets/{target-navigation-intent-7XRXuzFn.js → target-navigation-intent-BgBCKYrO.js} +1 -1
  29. package/dist/public/assets/{telemetry-impl-DYBNNWwm.js → telemetry-impl-DF7KVxgp.js} +2 -2
  30. package/dist/public/assets/{toggle-group-DIb9bLBj.js → toggle-group-Czy0P9Ee.js} +1 -1
  31. package/dist/public/assets/{tooltip-CRxi5gOu.js → tooltip-Dqn5ly4m.js} +1 -1
  32. package/dist/public/index.html +9 -8
  33. package/dist/{server-Bme59hx2.mjs → server-Dq2PmzsL.mjs} +2 -2
  34. package/dist/src-DQwyziiR.mjs +1 -0
  35. package/dist/start-BNLzgRz7.mjs +1 -0
  36. package/dist/{start-Ds-3qtJF.mjs → start-DEfS916L.mjs} +2 -2
  37. package/package.json +1 -1
  38. package/dist/constants-BQZMBSjL.mjs +0 -2
  39. package/dist/init-Cds71WAI.mjs +0 -1
  40. package/dist/init-g2zamAnn.mjs +0 -1
  41. package/dist/loader-B0BWajcB.mjs +0 -1
  42. package/dist/paths-BEB-Zpmi.mjs +0 -1
  43. package/dist/paths-DEN3St8d.mjs +0 -2
  44. package/dist/preview-D-0GOYHB.mjs +0 -1
  45. package/dist/public/assets/McpConsentDialogBody-B1ioffug.js +0 -1
  46. package/dist/public/assets/index-Dcw_lEA0.js +0 -1843
  47. package/dist/public/assets/index-uXLRXDYd.css +0 -1
  48. package/dist/src-bBNMJYgV.mjs +0 -1
  49. package/dist/start-ZcmBOEtV.mjs +0 -1
  50. /package/dist/public/assets/{__vite-browser-external-B0s46rwe.js → __vite-browser-external-BW1_xmov.js} +0 -0
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./__vite-browser-external-B0s46rwe.js","./chunk-DECur_0Z.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./chunk-DECur_0Z.js";import{i as t,n,r,t as i}from"./propagation-api-LnD10wq2.js";import{a,c as o,d as s,f as c,i as l,l as u,n as d,o as f,p as ee,r as p,t as m,u as h}from"./trace-api-CbLDdnQA.js";var te=class{constructor(){}createGauge(e,t){return fe}createHistogram(e,t){return pe}createCounter(e,t){return de}createUpDownCounter(e,t){return me}createObservableGauge(e,t){return ge}createObservableCounter(e,t){return he}createObservableUpDownCounter(e,t){return _e}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},g=class{},ne=class extends g{add(e,t){}},re=class extends g{add(e,t){}},ie=class extends g{record(e,t){}},ae=class extends g{record(e,t){}},oe=class{addCallback(e){}removeCallback(e){}},se=class extends oe{},ce=class extends oe{},le=class extends oe{},ue=new te,de=new ne,fe=new ie,pe=new ae,me=new re,he=new se,ge=new ce,_e=new le;function ve(){return ue}var ye;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(ye||={});var be;(function(e){e[e.INTERNAL=0]=`INTERNAL`,e[e.SERVER=1]=`SERVER`,e[e.CLIENT=2]=`CLIENT`,e[e.PRODUCER=3]=`PRODUCER`,e[e.CONSUMER=4]=`CONSUMER`})(be||={});var _=h.instance(),xe=new class{getMeter(e,t,n){return ue}},Se=`metrics`,Ce=class e{constructor(){}static getInstance(){return this._instance||=new e,this._instance}setGlobalMeterProvider(e){return c(Se,e,h.instance())}getMeterProvider(){return s(Se)||xe}getMeter(e,t,n){return this.getMeterProvider().getMeter(e,t,n)}disable(){ee(Se,h.instance())}}.getInstance(),we=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()}},Te=class extends Error{code;name=`OTLPExporterError`;data;constructor(e,t,n){super(e),this.data=n,this.code=t}};function Ee(e){if(Number.isFinite(e)&&e>0)return e;throw Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function De(e){if(e!=null)return()=>e}function Oe(e,t,n){return{timeoutMillis:Ee(e.timeoutMillis??t.timeoutMillis??n.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??n.concurrencyLimit,compression:e.compression??t.compression??n.compression}}function ke(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:`none`}}var Ae=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 je(e){return new Ae(e.concurrencyLimit)}var Me=`http.url`,Ne=`http.user_agent`,Pe=Me,Fe=Ne,Ie=`error.type`,Le=`exception.message`,Re=`exception.stacktrace`,ze=`exception.type`,Be=`http.request.method`,Ve=`http.request.method_original`,He=`http.response.status_code`,Ue=`server.address`,We=`server.port`,Ge=`service.name`,Ke=`service.version`,qe=`telemetry.sdk.language`,Je=`webjs`,Ye=`telemetry.sdk.name`,Xe=`telemetry.sdk.version`,Ze=`url.full`,v;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(v||={});function Qe(e){return Object.prototype.hasOwnProperty.call(e,`partialSuccess`)}function $e(){return{handleResponse(e){e==null||!Qe(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||_.warn(`Received Partial Success response:`,JSON.stringify(e.partialSuccess))}}}var et=class{_transport;_serializer;_responseHandler;_promiseQueue;_timeout;_diagLogger;constructor(e,t,n,r,i){this._transport=e,this._serializer=t,this._responseHandler=n,this._promiseQueue=r,this._timeout=i,this._diagLogger=_.createComponentLogger({namespace:`OTLPExportDelegate`})}export(e,t){if(this._diagLogger.debug(`items to be sent`,e),this._promiseQueue.hasReachedLimit()){t({code:v.FAILED,error:Error(`Concurrent export limit reached`)});return}let n=this._serializer.serializeRequest(e);if(n==null){t({code:v.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:v.SUCCESS});return}else if(e.status===`failure`&&e.error){t({code:v.FAILED,error:e.error});return}else e.status===`retryable`?t({code:v.FAILED,error:new Te(`Export failed with retryable status`)}):t({code:v.FAILED,error:new Te(`Export failed with unknown error`)})},e=>t({code:v.FAILED,error:e})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug(`shutdown started`),await this.forceFlush(),this._transport.shutdown()}};function tt(e,t){return new et(e.transport,e.serializer,$e(),e.promiseHandler,t.timeout)}function nt(e,t,n){return tt({transport:n,serializer:t,promiseHandler:je(e)},{timeout:e.timeoutMillis})}var rt=10**9;function it(e){return e[0]*rt+e[1]}function at(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function ot(e){let t=new Uint8Array(e.length/2),n=0;for(let r=0;r<e.length;r+=2){let i=at(e.charCodeAt(r)),a=at(e.charCodeAt(r+1));t[n++]=i<<4|a}return t}function st(e){let t=BigInt(1e9);return BigInt(e[0])*t+BigInt(e[1])}function ct(e){return{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}function lt(e){return ct(st(e))}function ut(e){return st(e).toString()}var dt=typeof BigInt<`u`?ut:it;function ft(e){return e}function pt(e){if(e!==void 0)return ot(e)}var mt={encodeHrTime:lt,encodeSpanContext:ot,encodeOptionalSpanContext:pt};function ht(e){if(e===void 0)return mt;let t=e.useLongBits??!0,n=e.useHex??!1;return{encodeHrTime:t?lt:dt,encodeSpanContext:n?ft:ot,encodeOptionalSpanContext:n?ft:pt}}function gt(e){let t={attributes:y(e.attributes),droppedAttributesCount:0},n=e.schemaUrl;return n&&n!==``&&(t.schemaUrl=n),t}function _t(e){return{name:e.name,version:e.version}}function y(e){return Object.keys(e).map(t=>vt(t,e[t]))}function vt(e,t){return{key:e,value:yt(t)}}function yt(e){let t=typeof e;return t===`string`?{stringValue:e}:t===`number`?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:t===`boolean`?{boolValue:e}:e instanceof Uint8Array?{bytesValue:e}:Array.isArray(e)?{arrayValue:{values:e.map(yt)}}:t===`object`&&e!=null?{kvlistValue:{values:Object.entries(e).map(([e,t])=>vt(e,t))}}:{}}function bt(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:y(e.attributes),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>St(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:r.code,message:r.message},links:e.links.map(e=>xt(e,t)),droppedLinksCount:e.droppedLinksCount}}function xt(e,t){return{attributes:e.attributes?y(e.attributes):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0}}function St(e,t){return{attributes:e.attributes?y(e.attributes):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function Ct(e,t){return{resourceSpans:Tt(e,ht(t))}}function wt(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 Tt(e,t){let n=wt(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=>bt(e,t));o.push({scope:_t(e[0].instrumentationScope),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}c=s.next()}let l=gt(e),u={resource:l,scopeSpans:o,schemaUrl:l.schemaUrl};r.push(u),a=i.next()}return r}var Et={serializeRequest:e=>{let t=Ct(e,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;return JSON.parse(t.decode(e))}},Dt=5,Ot=1e3,kt=5e3,At=1.5,jt=.2;function Mt(){return 2*jt*Math.random()-jt}var Nt=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=Date.now()+t,r=await this._transport.send(e,t),i=Dt,a=Ot;for(;r.status===`retryable`&&i>0;){i--;let t=Math.max(Math.min(a,kt)+Mt(),0);a*=At;let o=r.retryInMillis??t,s=n-Date.now();if(o>s)return r;r=await this.retry(e,s,o)}return r}shutdown(){return this._transport.shutdown()}};function Pt(e){return new Nt(e.transport)}function Ft(e){return[429,502,503,504].includes(e)}function It(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 Lt=class{_parameters;constructor(e){this._parameters=e}send(e,t){return new Promise(n=>{let r=new XMLHttpRequest;r.timeout=t,r.open(`POST`,this._parameters.url);let i=this._parameters.headers();Object.entries(i).forEach(([e,t])=>{r.setRequestHeader(e,t)}),r.ontimeout=e=>{n({status:`failure`,error:Error(`XHR request timed out`)})},r.onreadystatechange=()=>{r.status>=200&&r.status<=299?(_.debug(`XHR success`),n({status:`success`})):r.status&&Ft(r.status)?n({status:`retryable`,retryInMillis:It(r.getResponseHeader(`Retry-After`))}):r.status!==0&&n({status:`failure`,error:Error(`XHR request failed with non-retryable status`)})},r.onabort=()=>{n({status:`failure`,error:Error(`XHR request aborted`)})},r.onerror=()=>{n({status:`failure`,error:Error(`XHR request errored`)})},r.send(e)})}shutdown(){}};function Rt(e){return new Lt(e)}var zt=class{_params;constructor(e){this._params=e}send(e){return new Promise(t=>{navigator.sendBeacon(this._params.url,new Blob([e],{type:this._params.blobType}))?(_.debug(`SendBeacon success`),t({status:`success`})):t({status:`failure`,error:Error(`SendBeacon failed`)})})}shutdown(){}};function Bt(e){return new zt(e)}var Vt=class{_parameters;constructor(e){this._parameters=e}async send(e,t){let n=new AbortController,r=setTimeout(()=>n.abort(),t);try{let t=!!globalThis.location,r=new URL(this._parameters.url),i=await fetch(r.href,{method:`POST`,headers:this._parameters.headers(),body:e,signal:n.signal,keepalive:t,mode:t?globalThis.location?.origin===r.origin?`same-origin`:`cors`:`no-cors`});return i.status>=200&&i.status<=299?(_.debug(`response success`),{status:`success`}):Ft(i.status)?{status:`retryable`,retryInMillis:It(i.headers.get(`Retry-After`))}:{status:`failure`,error:Error(`Fetch request failed with non-retryable status`)}}catch(e){return e?.name===`AbortError`?{status:`failure`,error:Error(`Fetch request timed out`,{cause:e})}:{status:`failure`,error:Error(`Fetch request errored`,{cause:e})}}finally{clearTimeout(r)}}shutdown(){}};function Ht(e){return new Vt(e)}function Ut(e,t){return nt(e,t,Pt({transport:Rt(e)}))}function Wt(e,t){return nt(e,t,Pt({transport:Ht(e)}))}function Gt(e,t){return nt(e,t,Pt({transport:Bt({url:e.url,blobType:e.headers()[`Content-Type`]})}))}function Kt(e){return()=>{let t={};return Object.entries(e?.()??{}).forEach(([e,n])=>{n===void 0?_.warn(`Header "${e}" has invalid value (${n}) and will be ignored`):t[e]=String(n)}),t}}function qt(e,t,n){let r={...n()},i={};return()=>(t!=null&&Object.assign(i,t()),e!=null&&Object.assign(i,e()),Object.assign(i,r))}function Jt(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 Yt(n){return async r=>{let{Agent:i}=await t(()=>import(`./__vite-browser-external-B0s46rwe.js`).then(t=>e(t.default)),__vite__mapDeps([0,1]),import.meta.url);return new i(n)}}function Xt(e,t,n){return{...Oe(e,t,n),headers:qt(Kt(e.headers),t.headers,n.headers),url:Jt(e.url)??t.url??n.url,agentFactory:e.agentFactory??t.agentFactory??n.agentFactory}}function Zt(e,t){return{...ke(),headers:()=>e,url:`http://localhost:4318/`+t,agentFactory:Yt({keepAlive:!0})}}function Qt(e,t,n){return Xt({url:e.url,timeoutMillis:e.timeoutMillis,headers:De(e.headers),concurrencyLimit:e.concurrencyLimit},{},Zt(n,t))}function $t(e,t,n,r){return en(e.headers)(Qt(e,n,r),t)}function en(e){return!e&&typeof navigator.sendBeacon==`function`?Gt:globalThis.fetch===void 0?Ut:Wt}var tn=class extends we{constructor(e={}){super($t(e,Et,`v1/traces`,{"Content-Type":`application/json`}))}},nn=class{emit(e){}},rn=new nn,an=new class{getLogger(e,t,n){return new nn}},on=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):rn}},sn=class{getLogger(e,t,n){return this._getDelegateLogger(e,t,n)??new on(this,e,t,n)}_getDelegate(){return this._delegate??an}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){return this._delegate?.getLogger(e,t,n)}},cn=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{},ln=Symbol.for(`io.opentelemetry.js.api.logs`),b=cn;function un(e,t,n){return r=>r===e?t:n}var dn=class e{constructor(){this._proxyLoggerProvider=new sn}static getInstance(){return this._instance||=new e,this._instance}setGlobalLoggerProvider(e){return b[ln]?this.getLoggerProvider():(b[ln]=un(1,e,an),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){return b[ln]?.call(b,1)??this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete b[ln],this._proxyLoggerProvider=new sn}}.getInstance();function fn(e,t,n,r){for(let i=0,a=e.length;i<a;i++){let a=e[i];t&&a.setTracerProvider(t),n&&a.setMeterProvider(n),r&&a.setLoggerProvider&&a.setLoggerProvider(r),a.getConfig().enabled||a.enable()}}function pn(e){e.forEach(e=>e.disable())}function mn(e){let t=e.tracerProvider||m.getTracerProvider(),n=e.meterProvider||Ce.getMeterProvider(),r=e.loggerProvider||dn.getLoggerProvider(),i=e.instrumentations?.flat()??[];return fn(i,t,n,r),()=>{pn(i)}}var x=console.error.bind(console);function S(e,t,n){let r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}var hn=(e,t,n)=>{if(!e||!e[t]){x(`no original function `+String(t)+` to wrap`);return}if(!n){x(`no wrapper function`),x(Error().stack);return}let r=e[t];if(typeof r!=`function`||typeof n!=`function`){x(`original object and wrapper must be functions`);return}let i=n(r,t);return S(i,`__original`,r),S(i,`__unwrap`,()=>{e[t]===i&&S(e,t,r)}),S(i,`__wrapped`,!0),S(e,t,i),i},gn=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{x(`must provide one or more modules to patch`),x(Error().stack);return}if(!(t&&Array.isArray(t))){x(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{hn(e,t,n)})})},_n=(e,t)=>{if(!e||!e[t]){x(`no function to unwrap.`),x(Error().stack);return}let n=e[t];if(!n.__unwrap)x(`no original to unwrap to -- has `+String(t)+` already been unwrapped?`);else{n.__unwrap();return}},vn=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{x(`must provide one or more modules to patch`),x(Error().stack);return}if(!(t&&Array.isArray(t))){x(`must provide one or more functions to unwrap on modules`);return}e.forEach(e=>{t.forEach(t=>{_n(e,t)})})};function C(e){e&&e.logger&&(typeof e.logger==`function`?x=e.logger:x(`new logger isn't a function, not replacing`))}C.wrap=hn,C.massWrap=gn,C.unwrap=_n,C.massUnwrap=vn;var yn=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,t,n){this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(n),this._diag=_.createComponentLogger({namespace:e}),this._tracer=m.getTracer(e,t),this._meter=Ce.getMeter(e,t),this._logger=dn.getLogger(e,t),this._updateMetricInstruments()}_wrap=hn;_unwrap=_n;_massWrap=gn;_massUnwrap=vn;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error(`Error running span customization hook due to exception in handler`,{triggerName:t},e)}}},bn=class extends yn{constructor(e,t,n){super(e,t,n),this._config.enabled&&this.enable()}};function w(e,t,n){let r,i;try{i=e()}catch(e){r=e}finally{if(t(r,i),r&&!n)throw r;return i}}function T(e){return typeof e==`function`&&typeof e.__original==`function`&&typeof e.__unwrap==`function`&&e.__wrapped===!0}var E;(function(e){e[e.STABLE=1]=`STABLE`,e[e.OLD=2]=`OLD`,e[e.DUPLICATE=3]=`DUPLICATE`})(E||={});function xn(e,t){let n=E.OLD,r=t?.split(`,`).map(e=>e.trim()).filter(e=>e!==``);for(let t of r??[])if(t.toLowerCase()===e+`/dup`){n=E.DUPLICATE;break}else t.toLowerCase()===e&&(n=E.STABLE);return n}var Sn=u(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function Cn(e){return e.setValue(Sn,!0)}function wn(e){return e.getValue(Sn)===!0}var Tn=`baggage`,En=4096;function Dn(e){return e.reduce((e,t)=>{let n=`${e}${e===``?``:`,`}${t}`;return n.length>8192?e:n},``)}function On(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 kn(e){if(!e)return;let t=e.indexOf(`;`),n=t===-1?e:e.substring(0,t),i=n.indexOf(`=`);if(i<=0)return;let a=n.substring(0,i).trim(),o=n.substring(i+1).trim();if(!a||!o)return;let s,c;try{s=decodeURIComponent(a),c=decodeURIComponent(o)}catch{return}let l;return t!==-1&&t<e.length-1&&(l=r(e.substring(t+1))),{key:s,value:c,metadata:l}}var An=class{inject(e,t,n){let r=i.getBaggage(e);if(!r||wn(e))return;let a=Dn(On(r).filter(e=>e.length<=En).slice(0,180));a.length>0&&n.set(t,Tn,a)}extract(e,t,n){let r=n.get(t,Tn),a=Array.isArray(r)?r.join(`,`):r;if(!a)return e;let o={};return a.length===0||(a.split(`,`).forEach(e=>{let t=kn(e);if(t){let e={value:t.value};t.metadata&&(e.metadata=t.metadata),o[t.key]=e}}),Object.entries(o).length===0)?e:i.setBaggage(e,i.createBaggage(o))}fields(){return[Tn]}};function D(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!jn(n)){_.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Mn(r)){_.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function jn(e){return typeof e==`string`&&e!==``}function Mn(e){return e==null?!0:Array.isArray(e)?Nn(e):Pn(typeof e)}function Nn(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(Pn(e)){t=e;continue}return!1}return!1}}return!0}function Pn(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}function Fn(){return e=>{_.error(In(e))}}function In(e){return typeof e==`string`?e:JSON.stringify(Ln(e))}function Ln(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 Rn=Fn();function O(e){try{Rn(e)}catch{}}var zn=`2.7.0`,Bn=`process.runtime.name`,Vn={[Ye]:`opentelemetry`,[Bn]:`browser`,[qe]:Je,[Xe]:zn},k=performance,Hn=9,Un=10**6,Wn=10**Hn;function A(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*Un)]}function Gn(e){return Yn(A(k.timeOrigin),A(typeof e==`number`?e:k.now()))}function Kn(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=Wn),[n,r]}function qn(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function Jn(e){return qn(e)||typeof e==`number`||e instanceof Date}function Yn(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=Wn&&(n[1]-=Wn,n[0]+=1),n}var Xn;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(Xn||={});var Zn=class{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[],this._fields=Array.from(new Set(this._propagators.map(e=>typeof e.fields==`function`?e.fields():[]).reduce((e,t)=>e.concat(t),[])))}inject(e,t,n){for(let r of this._propagators)try{r.inject(e,t,n)}catch(e){_.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){_.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}},Qn=`[_0-9a-z-*/]`,$n=`[a-z]${Qn}{0,255}`,er=`[a-z0-9]${Qn}{0,240}@[a-z]${Qn}{0,13}`,tr=RegExp(`^(?:${$n}|${er})$`),nr=/^[ -~]{0,255}[!-~]$/,rr=/,|=/;function ir(e){return tr.test(e)}function ar(e){return nr.test(e)&&!rr.test(e)}var or=32,sr=512,cr=`,`,lr=`=`,ur=class e{_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,t){let n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,t),n}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+lr+this.get(t)),e),[]).join(cr)}_parse(e){e.length>sr||(this._internalState=e.split(cr).reverse().reduce((e,t)=>{let n=t.trim(),r=n.indexOf(lr);if(r!==-1){let i=n.slice(0,r),a=n.slice(r+1,t.length);ir(i)&&ar(a)&&e.set(i,a)}return e},new Map),this._internalState.size>or&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,or))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let t=new e;return t._internalState=new Map(this._internalState),t}},j=`traceparent`,dr=`tracestate`,fr=`00`,pr=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`);function mr(e){let t=pr.exec(e);return!t||t[1]===`00`&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var hr=class{inject(e,t,n){let r=m.getSpanContext(e);if(!r||wn(e)||!p(r))return;let i=`${fr}-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||f.NONE).toString(16)}`;n.set(t,j,i),r.traceState&&n.set(t,dr,r.traceState.serialize())}extract(e,t,n){let r=n.get(t,j);if(!r)return e;let i=Array.isArray(r)?r[0]:r;if(typeof i!=`string`)return e;let a=mr(i);if(!a)return e;a.isRemote=!0;let o=n.get(t,dr);if(o){let e=Array.isArray(o)?o.join(`,`):o;a.traceState=new ur(typeof e==`string`?e:void 0)}return m.setSpanContext(e,a)}fields(){return[j,dr]}},gr=`[object Object]`,_r=`[object Null]`,vr=`[object Undefined]`,yr=Function.prototype.toString,br=yr.call(Object),xr=Object.getPrototypeOf,Sr=Object.prototype,Cr=Sr.hasOwnProperty,M=Symbol?Symbol.toStringTag:void 0,wr=Sr.toString;function Tr(e){if(!Er(e)||Dr(e)!==gr)return!1;let t=xr(e);if(t===null)return!0;let n=Cr.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&yr.call(n)===br}function Er(e){return typeof e==`object`&&!!e}function Dr(e){return e==null?e===void 0?vr:_r:M&&M in Object(e)?Or(e):kr(e)}function Or(e){let t=Cr.call(e,M),n=e[M],r=!1;try{e[M]=void 0,r=!0}catch{}let i=wr.call(e);return r&&(t?e[M]=n:delete e[M]),i}function kr(e){return wr.call(e)}var Ar=20;function jr(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=Nr(t,e.shift(),0,n);return t}function Mr(e){return N(e)?e.slice():e}function Nr(e,t,n=0,r){let i;if(!(n>Ar)){if(n++,F(e)||F(t)||Fr(t))i=Mr(t);else if(N(e)){if(i=e.slice(),N(t))for(let e=0,n=t.length;e<n;e++)i.push(Mr(t[e]));else if(P(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]=Mr(t[r]))}}}else if(P(e))if(P(t)){if(!Ir(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(F(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(Pr(e,s,r)||Pr(t,s,r))delete i[s];else{if(P(a)&&P(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]=Nr(i[s],c,n,r)}}}}else i=t;return i}}function Pr(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 N(e){return Array.isArray(e)}function Fr(e){return typeof e==`function`}function P(e){return!F(e)&&!N(e)&&!Fr(e)&&typeof e==`object`}function F(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function Ir(e,t){return!(!Tr(e)||!Tr(t))}var Lr=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)}},Rr=class{_isCalled=!1;_deferred=new Lr;_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}},I;function zr(){if(I===void 0)try{let e=globalThis.process.argv0;I=e?`unknown_service:${e}`:`unknown_service`}catch{I=`unknown_service`}return I}var L=e=>typeof e==`object`&&!!e&&typeof e.then==`function`,Br=class e{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=Ur(t),r._asyncAttributesPending=t.filter(([e,t])=>L(t)).length>0,r}constructor(e,t){let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([e,t])=>(L(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=Ur(this._rawAttributes),this._schemaUrl=Wr(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,L(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&_.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,n]of this._rawAttributes){if(L(n)){_.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=Gr(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}};function Vr(e,t){return Br.FromAttributeList(Object.entries(e),t)}function Hr(){return Vr({[Ge]:zr(),[qe]:Vn[qe],[Ye]:Vn[Ye],[Xe]:Vn[Xe]})}function Ur(e){return e.map(([e,t])=>L(t)?[e,t.catch(t=>{_.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function Wr(e){if(typeof e==`string`||e===void 0)return e;_.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function Gr(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;_.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,n,r)}var Kr=`exception`,qr=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:d.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=k.now(),this._performanceOffset=t-(this._performanceStartTime+k.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 _.warn(`Invalid attribute key: ${e}`),this;if(!Mn(t))return _.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 _.warn(`No events allowed.`),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&_.debug(`Dropping extra events.`),this.events.shift(),this._droppedEventsCount++),Jn(t)&&(Jn(n)||(n=t),t=void 0);let i=D(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&&_.debug(`Dropping extra links.`),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:n}=this._spanLimits,r=D(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===d.UNSET||this.status.code===d.OK)return this;let t={code:e.code};return e.code===d.ERROR&&(typeof e.message==`string`?t.message=e.message:e.message!=null&&_.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()){_.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=Kn(this.startTime,this.endTime),this._duration[0]<0&&(_.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&&_.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&_.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<=k.now())return Gn(e+this._performanceOffset);if(typeof e==`number`)return A(e);if(e instanceof Date)return A(e.getTime());if(qn(e))return e;if(this._startTimeProvided)return A(Date.now());let t=k.now()-this._performanceStartTime;return Yn(this.startTime,A(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e==`string`?n[Le]=e:e&&(e.code?n[ze]=e.code.toString():e.name&&(n[ze]=e.name),e.message&&(n[Le]=e.message),e.stack&&(n[Re]=e.stack)),n[`exception.type`]||n[`exception.message`]?this.addEvent(Kr,n,t):_.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}}`);_.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?(_.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}},R;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(R||={});var z=class{shouldSample(){return{decision:R.NOT_RECORD}}toString(){return`AlwaysOffSampler`}},B=class{shouldSample(){return{decision:R.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}},V=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||=(O(Error(`ParentBasedSampler must have a root sampler configured`)),new B),this._remoteParentSampled=e.remoteParentSampled??new B,this._remoteParentNotSampled=e.remoteParentNotSampled??new z,this._localParentSampled=e.localParentSampled??new B,this._localParentNotSampled=e.localParentNotSampled??new z}shouldSample(e,t,n,r,i,a){let o=m.getSpanContext(e);return!o||!p(o)?this._root.shouldSample(e,t,n,r,i,a):o.isRemote?o.traceFlags&f.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,i,a):this._remoteParentNotSampled.shouldSample(e,t,n,r,i,a):o.traceFlags&f.SAMPLED?this._localParentSampled.shouldSample(e,t,n,r,i,a):this._localParentNotSampled.shouldSample(e,t,n,r,i,a)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}},Jr=class{_ratio;_upperBound;constructor(e=0){this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:l(t)&&this._accumulate(t)<this._upperBound?R.RECORD_AND_SAMPLED:R.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<e.length/8;n++){let r=n*8,i=parseInt(e.slice(r,r+8),16);t=(t^i)>>>0}return t}},H;(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`})(H||={});var Yr=1;function Xr(){return{sampler:Zr(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function Zr(){let e=H.ParentBasedAlwaysOn;switch(e){case H.AlwaysOn:return new B;case H.AlwaysOff:return new z;case H.ParentBasedAlwaysOn:return new V({root:new B});case H.ParentBasedAlwaysOff:return new V({root:new z});case H.TraceIdRatio:return new Jr(Qr());case H.ParentBasedTraceIdRatio:return new V({root:new Jr(Qr())});default:return _.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${H.ParentBasedAlwaysOn}".`),new V({root:new B})}}function Qr(){return _.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Yr}.`),Yr}function $r(e){let t={sampler:Zr()},n=Xr(),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 ei(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 ti=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 Rr(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(_.warn(`BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&f.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&_.debug(`maxQueueSize reached, dropping spans`),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(_.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 r=setTimeout(()=>{t(Error(`Timeout`))},this._exportTimeoutMillis);n.with(Cn(n.active()),()=>{let n;this._finishedSpans.length<=this._maxExportBatchSize?(n=this._finishedSpans,this._finishedSpans=[]):n=this._finishedSpans.splice(0,this._maxExportBatchSize);let i=()=>this._exporter.export(n,n=>{clearTimeout(r),n.code===Xn.SUCCESS?e():t(n.error??Error(`BatchSpanProcessor: span export failed`))}),a=null;for(let e=0,t=n.length;e<t;e++){let t=n[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(a??=[],a.push(t.resource.waitForAsyncAttributes()))}a===null?i():Promise.all(a).then(i,e=>{O(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,O(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)}},ni=class extends ti{_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=>{O(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{O(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))}},ri=16,ii=8,ai=new Uint8Array(ri),oi=new Uint8Array(ii),si=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function ci(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 li(e){let t=``;for(let n=0;n<e.length;n++)t+=si[e[n]];return t}var ui=class{generateTraceId(){return ci(ai),li(ai)}generateSpanId(){return ci(oi),li(oi)}},di=`otel.span.parent.origin`,fi=`otel.span.sampling_result`,pi=`otel.sdk.span.live`,mi=`otel.sdk.span.started`,hi=class{startedSpans;liveSpans;constructor(e){this.startedSpans=e.createCounter(mi,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=e.createUpDownCounter(pi,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(e,t){let n=_i(t);if(this.startedSpans.add(1,{[di]:gi(e),[fi]:n}),t===R.NOT_RECORD)return()=>{};let r={[fi]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}};function gi(e){return e?e.isRemote?`remote`:`local`:`none`}function _i(e){switch(e){case R.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case R.RECORD:return`RECORD_ONLY`;case R.NOT_RECORD:return`DROP`}}var vi=`2.7.0`,yi=class{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(e,t,n,r){let i=$r(t);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=t.idGenerator||new ui,this._resource=n,this._spanProcessor=r,this.instrumentationScope=e,this._tracerMetrics=new hi(i.meterProvider?i.meterProvider.getMeter(`@opentelemetry/sdk-trace`,vi):ve())}startSpan(e,t={},r=n.active()){t.root&&(r=m.deleteSpan(r));let i=m.getSpan(r);if(wn(r))return _.debug(`Instrumentation suppressed, returning Noop Span`),m.wrapSpanContext(a);let o=i?.spanContext(),s=this._idGenerator.generateSpanId(),c,l,u;!o||!m.isSpanContextValid(o)?l=this._idGenerator.generateTraceId():(l=o.traceId,u=o.traceState,c=o);let d=t.kind??be.INTERNAL,ee=(t.links??[]).map(e=>({context:e.context,attributes:D(e.attributes)})),p=D(t.attributes),h=this._sampler.shouldSample(r,l,e,d,p,ee),te=this._tracerMetrics.startSpan(o,h.decision);u=h.traceState??u;let g=h.decision===ye.RECORD_AND_SAMPLED?f.SAMPLED:f.NONE,ne={traceId:l,spanId:s,traceFlags:g,traceState:u};if(h.decision===ye.NOT_RECORD)return _.debug(`Recording is off, propagating context in a non-recording span`),m.wrapSpanContext(ne);let re=D(Object.assign(p,h.attributes));return new qr({resource:this._resource,scope:this.instrumentationScope,context:r,spanContext:ne,name:e,kind:d,links:ee,parentSpanContext:c,attributes:re,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:te})}startActiveSpan(e,t,r,i){let a,o,s;if(arguments.length<2)return;arguments.length===2?s=t:arguments.length===3?(a=t,s=r):(a=t,o=r,s=i);let c=o??n.active(),l=this.startSpan(e,a,c),u=m.setSpan(c,l);return n.with(u,s,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}},bi=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=>{O(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)})}},U;(function(e){e[e.resolved=0]=`resolved`,e[e.timeout=1]=`timeout`,e[e.error=2]=`error`,e[e.unresolved=3]=`unresolved`})(U||={});var xi=class{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){let t=jr({},Xr(),ei(e));this._resource=t.resource??Hr(),this._config=Object.assign({},t,{resource:this._resource});let n=[];e.spanProcessors?.length&&n.push(...e.spanProcessors),this._activeSpanProcessor=new bi(n)}getTracer(e,t,n){let r=`${e}@${t||``}:${n?.schemaUrl||``}`;return this._tracers.has(r)||this._tracers.set(r,new yi({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=U.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),r!==U.timeout&&(r=U.resolved,n(r))}).catch(e=>{clearTimeout(i),r=U.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{let r=t.filter(e=>e!==U.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}},Si=class{_enabled=!1;_currentContext=o;_bindFunction(e=o,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=o,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=o,this)}with(e,t,n,...r){let i=this._currentContext;this._currentContext=e||o;try{return t.call(n,...r)}finally{this._currentContext=i}}};function Ci(e){if(e!==null){if(e===void 0){let e=new Si;e.enable(),n.setGlobalContextManager(e);return}e.enable(),n.setGlobalContextManager(e)}}function wi(e){if(e!==null){if(e===void 0){i.setGlobalPropagator(new Zn({propagators:[new hr,new An]}));return}i.setGlobalPropagator(e)}}var Ti=class extends xi{constructor(e={}){super(e)}register(e={}){m.setGlobalTracerProvider(this),wi(e.propagator),Ci(e.contextManager)}},W;(function(e){e.CONNECT_END=`connectEnd`,e.CONNECT_START=`connectStart`,e.DECODED_BODY_SIZE=`decodedBodySize`,e.DOM_COMPLETE=`domComplete`,e.DOM_CONTENT_LOADED_EVENT_END=`domContentLoadedEventEnd`,e.DOM_CONTENT_LOADED_EVENT_START=`domContentLoadedEventStart`,e.DOM_INTERACTIVE=`domInteractive`,e.DOMAIN_LOOKUP_END=`domainLookupEnd`,e.DOMAIN_LOOKUP_START=`domainLookupStart`,e.ENCODED_BODY_SIZE=`encodedBodySize`,e.FETCH_START=`fetchStart`,e.LOAD_EVENT_END=`loadEventEnd`,e.LOAD_EVENT_START=`loadEventStart`,e.NAVIGATION_START=`navigationStart`,e.REDIRECT_END=`redirectEnd`,e.REDIRECT_START=`redirectStart`,e.REQUEST_START=`requestStart`,e.RESPONSE_END=`responseEnd`,e.RESPONSE_START=`responseStart`,e.SECURE_CONNECTION_START=`secureConnectionStart`,e.START_TIME=`startTime`,e.UNLOAD_EVENT_END=`unloadEventEnd`,e.UNLOAD_EVENT_START=`unloadEventStart`})(W||={});var Ei=`http.response_content_length`,Di=`http.response_content_length_uncompressed`;function G(e,t){return t in e}function K(e,t,n,r=!0){if(G(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function Oi(e,t,n=!1,r,i){if(r===void 0&&(r=t[W.START_TIME]!==0),n||(K(e,W.FETCH_START,t,r),K(e,W.DOMAIN_LOOKUP_START,t,r),K(e,W.DOMAIN_LOOKUP_END,t,r),K(e,W.CONNECT_START,t,r),K(e,W.SECURE_CONNECTION_START,t,r),K(e,W.CONNECT_END,t,r),K(e,W.REQUEST_START,t,r),K(e,W.RESPONSE_START,t,r),K(e,W.RESPONSE_END,t,r)),!i){let n=t[W.ENCODED_BODY_SIZE];n!==void 0&&e.setAttribute(Ei,n);let r=t[W.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(Di,r)}}function ki(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return`/`;let n=ji(e,t);if(t&&n.indexOf(`@id`)>0)return n;let r=``;return e.parentNode&&(r+=ki(e.parentNode,t)),r+=n,r}function Ai(e){if(!e.parentNode)return 0;let t=[e.nodeType];e.nodeType===Node.CDATA_SECTION_NODE&&t.push(Node.TEXT_NODE);let n=Array.from(e.parentNode.childNodes);return n=n.filter(n=>{let r=n.localName;return t.indexOf(n.nodeType)>=0&&r===e.localName}),n.length>=1?n.indexOf(e)+1:0}function ji(e,t){let n=e.nodeType,r=Ai(e),i=``;if(n===Node.ELEMENT_NODE){let n=e.getAttribute(`id`);if(t&&n)return`//*[@id="${n}"]`;i=e.localName}else if(n===Node.TEXT_NODE||n===Node.CDATA_SECTION_NODE)i=`text()`;else if(n===Node.COMMENT_NODE)i=`comment()`;else return``;return i&&r>1?`/${i}[${r}]`:`/${i}`}var q;(function(e){e.DOCUMENT_LOAD=`documentLoad`,e.DOCUMENT_FETCH=`documentFetch`,e.RESOURCE_FETCH=`resourceFetch`})(q||={});var Mi=`0.49.0`,Ni=`@opentelemetry/instrumentation-document-load`,Pi;(function(e){e.FIRST_PAINT=`firstPaint`,e.FIRST_CONTENTFUL_PAINT=`firstContentfulPaint`})(Pi||={});var Fi=()=>{let e={},t=k.getEntriesByType?.(`navigation`)[0];if(t)Object.values(W).forEach(n=>{if(G(t,n)){let r=t[n];typeof r==`number`&&(e[n]=r)}});else{let t=k.timing;t&&Object.values(W).forEach(n=>{if(G(t,n)){let r=t[n];typeof r==`number`&&(e[n]=r)}})}return e},Ii={"first-paint":Pi.FIRST_PAINT,"first-contentful-paint":Pi.FIRST_CONTENTFUL_PAINT},Li=e=>{let t=k.getEntriesByType?.(`paint`);t&&t.forEach(({name:t,startTime:n})=>{G(Ii,t)&&e.addEvent(Ii[t],n)})},Ri=class extends bn{component=`document-load`;version=`1`;moduleName=this.component;constructor(e={}){super(Ni,Mi,e)}init(){}_onDocumentLoaded(){window.setTimeout(()=>{this._collectPerformance()})}_addResourcesSpans(e){let t=k.getEntriesByType?.(`resource`);t&&t.forEach(t=>{this._initResourceSpan(t,e)})}_collectPerformance(){let e=Array.from(document.getElementsByTagName(`meta`)).find(e=>e.getAttribute(`name`)===j),t=Fi(),r=e&&e.content||``;n.with(i.extract(o,{traceparent:r}),()=>{let e=this._startSpan(q.DOCUMENT_LOAD,W.FETCH_START,t);e&&(n.with(m.setSpan(n.active(),e),()=>{let e=this._startSpan(q.DOCUMENT_FETCH,W.FETCH_START,t);e&&(e.setAttribute(Pe,location.href),n.with(m.setSpan(n.active(),e),()=>{Oi(e,t,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentFetch),this._endSpan(e,W.RESPONSE_END,t)}))}),e.setAttribute(Pe,location.href),e.setAttribute(Fe,navigator.userAgent),this._addResourcesSpans(e),this.getConfig().ignoreNetworkEvents||(K(e,W.FETCH_START,t),K(e,W.UNLOAD_EVENT_START,t),K(e,W.UNLOAD_EVENT_END,t),K(e,W.DOM_INTERACTIVE,t),K(e,W.DOM_CONTENT_LOADED_EVENT_START,t),K(e,W.DOM_CONTENT_LOADED_EVENT_END,t),K(e,W.DOM_COMPLETE,t),K(e,W.LOAD_EVENT_START,t),K(e,W.LOAD_EVENT_END,t)),this.getConfig().ignorePerformancePaintEvents||Li(e),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentLoad),this._endSpan(e,W.LOAD_EVENT_END,t))})}_endSpan(e,t,n){e&&(G(n,t)?e.end(n[t]):e.end())}_initResourceSpan(e,t){let n=this._startSpan(q.RESOURCE_FETCH,W.FETCH_START,e,t);n&&(n.setAttribute(Pe,e.name),Oi(n,e,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnResourceSpan(n,e,this.getConfig().applyCustomAttributesOnSpan?.resourceFetch),this._endSpan(n,W.RESPONSE_END,e))}_startSpan(e,t,r,i){if(G(r,t)&&typeof r[t]==`number`)return this.tracer.startSpan(e,{startTime:r[t]},i?m.setSpan(n.active(),i):void 0)}_waitForPageLoad(){window.document.readyState===`complete`?this._onDocumentLoaded():(this._onDocumentLoaded=this._onDocumentLoaded.bind(this),window.addEventListener(`load`,this._onDocumentLoaded))}_addCustomAttributesOnSpan(e,t){t&&w(()=>t(e),e=>{e&&this._diag.error(`addCustomAttributesOnSpan`,e)},!0)}_addCustomAttributesOnResourceSpan(e,t,n){n&&w(()=>n(e,t),e=>{e&&this._diag.error(`addCustomAttributesOnResourceSpan`,e)},!0)}enable(){window.removeEventListener(`load`,this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener(`load`,this._onDocumentLoaded)}},zi=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{},Bi=performance,Vi=9,Hi=10**6,Ui=10**Vi;function J(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*Hi)]}function Wi(){let e=Bi.timeOrigin;if(typeof e!=`number`){let t=Bi;e=t.timing&&t.timing.fetchStart}return e}function Gi(e){return qi(J(Wi()),J(typeof e==`number`?e:Bi.now()))}function Y(e){if(Ki(e))return e;if(typeof e==`number`)return e<Wi()?Gi(e):J(e);if(e instanceof Date)return J(e.getTime());throw TypeError(`Invalid input type`)}function X(e){return e[0]*Ui+e[1]}function Ki(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function qi(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=Ui&&(n[1]-=Ui,n[0]+=1),n}function Ji(e,t){return typeof t==`string`?e===t:!!e.match(t)}function Yi(e,t){if(!t)return!1;for(let n of t)if(Ji(e,n))return!0;return!1}var Z;(function(e){e.CONNECT_END=`connectEnd`,e.CONNECT_START=`connectStart`,e.DECODED_BODY_SIZE=`decodedBodySize`,e.DOM_COMPLETE=`domComplete`,e.DOM_CONTENT_LOADED_EVENT_END=`domContentLoadedEventEnd`,e.DOM_CONTENT_LOADED_EVENT_START=`domContentLoadedEventStart`,e.DOM_INTERACTIVE=`domInteractive`,e.DOMAIN_LOOKUP_END=`domainLookupEnd`,e.DOMAIN_LOOKUP_START=`domainLookupStart`,e.ENCODED_BODY_SIZE=`encodedBodySize`,e.FETCH_START=`fetchStart`,e.LOAD_EVENT_END=`loadEventEnd`,e.LOAD_EVENT_START=`loadEventStart`,e.NAVIGATION_START=`navigationStart`,e.REDIRECT_END=`redirectEnd`,e.REDIRECT_START=`redirectStart`,e.REQUEST_START=`requestStart`,e.RESPONSE_END=`responseEnd`,e.RESPONSE_START=`responseStart`,e.SECURE_CONNECTION_START=`secureConnectionStart`,e.START_TIME=`startTime`,e.UNLOAD_EVENT_END=`unloadEventEnd`,e.UNLOAD_EVENT_START=`unloadEventStart`})(Z||={});var Xi=`http.response_content_length`,Zi=`http.response_content_length_uncompressed`,Qi;function $i(){return Qi||=document.createElement(`a`),Qi}function ea(e,t){return t in e}function Q(e,t,n,r=!0){if(ea(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function ta(e,t,n=!1,r,i){if(r===void 0&&(r=t[Z.START_TIME]!==0),n||(Q(e,Z.FETCH_START,t,r),Q(e,Z.DOMAIN_LOOKUP_START,t,r),Q(e,Z.DOMAIN_LOOKUP_END,t,r),Q(e,Z.CONNECT_START,t,r),Q(e,Z.SECURE_CONNECTION_START,t,r),Q(e,Z.CONNECT_END,t,r),Q(e,Z.REQUEST_START,t,r),Q(e,Z.RESPONSE_START,t,r),Q(e,Z.RESPONSE_END,t,r)),!i){let n=t[Z.ENCODED_BODY_SIZE];n!==void 0&&e.setAttribute(Xi,n);let r=t[Z.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(Zi,r)}}function na(e){return e.slice().sort((e,t)=>{let n=e[Z.FETCH_START],r=t[Z.FETCH_START];return n>r?1:n<r?-1:0})}function ra(){return typeof location<`u`?location.origin:void 0}function ia(e,t,n,r,i=new WeakSet,a){let o=sa(e);e=o.toString();let s=oa(e,t,n,r,i,a);if(s.length===0)return{mainRequest:void 0};if(s.length===1)return{mainRequest:s[0]};let c=na(s);if(o.origin!==ra()&&c.length>1){let e=c[0],t=aa(c,e[Z.RESPONSE_END],n),r=e[Z.RESPONSE_END];return t[Z.FETCH_START]<r&&(t=e,e=void 0),{corsPreFlightRequest:e,mainRequest:t}}else return{mainRequest:s[0]}}function aa(e,t,n){let r=X(n),i=X(Y(t)),a=e[1],o,s=e.length;for(let t=1;t<s;t++){let n=e[t],s=X(Y(n[Z.FETCH_START])),c=r-X(Y(n[Z.RESPONSE_END]));s>=i&&(!o||c<o)&&(o=c,a=n)}return a}function oa(e,t,n,r,i,a){let o=X(t),s=X(n),c=r.filter(t=>{let n=X(Y(t[Z.FETCH_START])),r=X(Y(t[Z.RESPONSE_END]));return t.initiatorType.toLowerCase()===(a||`xmlhttprequest`)&&t.name===e&&n>=o&&r<=s});return c.length>0&&(c=c.filter(e=>!i.has(e))),c}function sa(e){if(typeof URL==`function`)return new URL(e,typeof document<`u`?document.baseURI:typeof location<`u`?location.href:void 0);let t=$i();return t.href=e,t}function ca(e,t){let n=t||[];return(typeof n==`string`||n instanceof RegExp)&&(n=[n]),sa(e).origin===ra()?!0:n.some(t=>Ji(e,t))}var la;(function(e){e.COMPONENT=`component`,e.HTTP_STATUS_TEXT=`http.status_text`})(la||={});var ua=`http.host`,da=`http.method`,fa=`http.request.body.size`,pa=`http.request_content_length_uncompressed`,ma=`http.scheme`,ha=`http.status_code`,ga=`http.url`,_a=`http.user_agent`,va=_.createComponentLogger({namespace:`@opentelemetry/opentelemetry-instrumentation-fetch/utils`});function ya(...e){if(e[0]instanceof URL||typeof e[0]==`string`){let t=e[1];if(!t?.body)return Promise.resolve();if(t.body instanceof ReadableStream){let{body:e,length:n}=ba(t.body);return t.body=e,n}else return Promise.resolve(Sa(t.body))}else{let t=e[0];return t?.body?t.clone().text().then(e=>wa(e)):Promise.resolve()}}function ba(e){if(!e.pipeThrough)return va.warn(`Platform has ReadableStream but not pipeThrough!`),{body:e,length:Promise.resolve(void 0)};let t=0,n,r=new Promise(e=>{n=e}),i=new TransformStream({start(){},async transform(e,n){let r=await e;t+=r.byteLength,n.enqueue(e)},flush(){n(t)}});return{body:e.pipeThrough(i),length:r}}function xa(e){return typeof Document<`u`&&e instanceof Document}function Sa(e){if(xa(e))return new XMLSerializer().serializeToString(document).length;if(typeof e==`string`)return wa(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return Ta(e);if(e instanceof URLSearchParams)return wa(e.toString());if(e.byteLength!==void 0)return e.byteLength;va.warn(`unknown body type`)}var Ca=new TextEncoder;function wa(e){return Ca.encode(e).byteLength}function Ta(e){let t=0;for(let[n,r]of e.entries())t+=n.length,r instanceof Blob?t+=r.size:t+=r.length;return t}function Ea(e){let t=ka(),n=e.toUpperCase();return n in t?n:`_OTHER`}var Da={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0},Oa;function ka(){return Oa===void 0&&(Oa=Da),Oa}var Aa={"https:":`443`,"http:":`80`};function ja(e){let t=Number(e.port||Aa[e.protocol]);if(t&&!isNaN(t))return t}var Ma=`0.204.0`,Na=300,Pa=typeof process==`object`&&process.release?.name===`node`,Fa=class extends bn{component=`fetch`;version=Ma;moduleName=this.component;_usedResources=new WeakSet;_tasksCount=0;_semconvStability;constructor(e={}){super(`@opentelemetry/instrumentation-fetch`,Ma,e),this._semconvStability=xn(`http`,e?.semconvStabilityOptIn)}init(){}_addChildSpan(e,t){let r=this.tracer.startSpan(`CORS Preflight`,{startTime:t[Z.FETCH_START]},m.setSpan(n.active(),e)),i=!(this._semconvStability&E.OLD);ta(r,t,this.getConfig().ignoreNetworkEvents,void 0,i),r.end(t[Z.RESPONSE_END])}_addFinalSpanAttributes(e,t){let n=sa(t.url);if(this._semconvStability&E.OLD&&(e.setAttribute(ha,t.status),t.statusText!=null&&e.setAttribute(la.HTTP_STATUS_TEXT,t.statusText),e.setAttribute(ua,n.host),e.setAttribute(ma,n.protocol.replace(`:`,``)),typeof navigator<`u`&&e.setAttribute(_a,navigator.userAgent)),this._semconvStability&E.STABLE){e.setAttribute(He,t.status),e.setAttribute(Ue,n.hostname);let r=ja(n);r&&e.setAttribute(We,r)}}_addHeaders(e,t){if(!ca(t,this.getConfig().propagateTraceHeaderCorsUrls)){let e={};i.inject(n.active(),e),Object.keys(e).length>0&&this._diag.debug(`headers inject skipped due to CORS policy`);return}if(e instanceof Request)i.inject(n.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else if(e.headers instanceof Headers)i.inject(n.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else if(e.headers instanceof Map)i.inject(n.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else{let t={};i.inject(n.active(),t),e.headers=Object.assign({},t,e.headers||{})}}_clearResources(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(e,t={}){if(Yi(e,this.getConfig().ignoreUrls)){this._diag.debug(`ignoring span as url matches ignored url`);return}let n=``,r={};if(this._semconvStability&E.OLD){let i=(t.method||`GET`).toUpperCase();n=`HTTP ${i}`,r[la.COMPONENT]=this.moduleName,r[da]=i,r[ga]=e}if(this._semconvStability&E.STABLE){let i=t.method,a=Ea(t.method||`GET`);n||=a,r[Be]=a,a!==i&&(r[Ve]=i),r[Ze]=e}return this.tracer.startSpan(n,{kind:be.CLIENT,attributes:r})}_findResourceAndAddNetworkEvents(e,t,n){let r=t.entries;if(!r.length){if(!performance.getEntriesByType)return;r=performance.getEntriesByType(`resource`)}let i=ia(t.spanUrl,t.startTime,n,r,this._usedResources,`fetch`);if(i.mainRequest){let t=i.mainRequest;this._markResourceAsUsed(t);let n=i.corsPreFlightRequest;n&&(this._addChildSpan(e,n),this._markResourceAsUsed(n));let r=!(this._semconvStability&E.OLD);ta(e,t,this.getConfig().ignoreNetworkEvents,void 0,r)}}_markResourceAsUsed(e){this._usedResources.add(e)}_endSpan(e,t,n){let r=J(Date.now()),i=Gi();this._addFinalSpanAttributes(e,n),this._semconvStability&E.STABLE&&n.status>=400&&(e.setStatus({code:d.ERROR}),e.setAttribute(Ie,String(n.status))),setTimeout(()=>{t.observer?.disconnect(),this._findResourceAndAddNetworkEvents(e,t,i),this._tasksCount--,this._clearResources(),e.end(r)},Na)}_patchConstructor(){return e=>{let t=this;return function(...r){let i=this,a=sa(r[0]instanceof Request?r[0].url:String(r[0])).href,o=r[0]instanceof Request?r[0]:r[1]||{},s=t._createSpan(a,o);if(!s)return e.apply(this,r);let c=t._prepareSpanData(a);t.getConfig().measureRequestSize&&ya(...r).then(e=>{e&&(t._semconvStability&E.OLD&&s.setAttribute(pa,e),t._semconvStability&E.STABLE&&s.setAttribute(fa,e))}).catch(e=>{t._diag.warn(`getFetchBodyLength`,e)});function l(e,n){t._applyAttributesAfterFetch(e,o,n),t._endSpan(e,c,{status:n.status||0,statusText:n.message,url:a})}function u(e,n){t._applyAttributesAfterFetch(e,o,n),n.status>=200&&n.status<400?t._endSpan(e,c,n):t._endSpan(e,c,{status:n.status,statusText:n.statusText,url:a})}function d(e,t,n){try{let t=n.clone().body;if(t){let r=t.getReader(),i=()=>{r.read().then(({done:t})=>{t?u(e,n):i()},t=>{l(e,t)})};i()}else u(e,n)}finally{t(n)}}function f(e,t,n){try{l(e,n)}finally{t(n)}}return new Promise((r,c)=>n.with(m.setSpan(n.active(),s),()=>(t._addHeaders(o,a),t._callRequestHook(s,o),t._tasksCount++,e.apply(i,o instanceof Request?[o]:[a,o]).then(d.bind(i,s,r),f.bind(i,s,c)))))}}}_applyAttributesAfterFetch(e,t,n){let r=this.getConfig().applyCustomAttributesOnSpan;r&&w(()=>r(e,t,n),e=>{e&&this._diag.error(`applyCustomAttributesOnSpan`,e)},!0)}_callRequestHook(e,t){let n=this.getConfig().requestHook;n&&w(()=>n(e,t),e=>{e&&this._diag.error(`requestHook`,e)},!0)}_prepareSpanData(e){let t=Gi(),n=[];if(typeof PerformanceObserver!=`function`)return{entries:n,startTime:t,spanUrl:e};let r=new PerformanceObserver(t=>{t.getEntries().forEach(t=>{t.initiatorType===`fetch`&&t.name===e&&n.push(t)})});return r.observe({entryTypes:[`resource`]}),{entries:n,observer:r,startTime:t,spanUrl:e}}enable(){if(Pa){this._diag.warn(`this instrumentation is intended for web usage only, it does not instrument Node.js's fetch()`);return}T(fetch)&&(this._unwrap(zi,`fetch`),this._diag.debug(`removing previous patch for constructor`)),this._wrap(zi,`fetch`,this._patchConstructor())}disable(){Pa||(this._unwrap(zi,`fetch`),this._usedResources=new WeakSet)}},$;(function(e){e.EVENT_TYPE=`event_type`,e.TARGET_ELEMENT=`target_element`,e.TARGET_XPATH=`target_xpath`,e.HTTP_URL=`http.url`})($||={});var Ia=`0.49.0`,La=`@opentelemetry/instrumentation-user-interaction`,Ra=`OT_ZONE_CONTEXT`,za=`Navigation:`,Ba=[`click`];function Va(){return!1}var Ha=class extends bn{version=Ia;moduleName=`user-interaction`;_spansData=new WeakMap;_wrappedListeners=new WeakMap;_eventsSpanMap=new WeakMap;_eventNames;_shouldPreventSpanCreation;constructor(e={}){super(La,Ia,e),this._eventNames=new Set(e?.eventNames??Ba),this._shouldPreventSpanCreation=typeof e?.shouldPreventSpanCreation==`function`?e.shouldPreventSpanCreation:Va}init(){}_checkForTimeout(e,t){let n=this._spansData.get(t);n&&(e.source===`setTimeout`?n.hrTimeLastTimeout=Gn():e.source!==`Promise.then`&&e.source!==`setTimeout`&&(n.hrTimeLastTimeout=void 0))}_allowEventName(e){return this._eventNames.has(e)}_createSpan(e,t,r){if(!(e instanceof HTMLElement)||!e.getAttribute||e.hasAttribute(`disabled`)||!this._allowEventName(t))return;let i=ki(e,!0);try{let a=this.tracer.startSpan(t,{attributes:{[$.EVENT_TYPE]:t,[$.TARGET_ELEMENT]:e.tagName,[$.TARGET_XPATH]:i,[$.HTTP_URL]:window.location.href}},r?m.setSpan(n.active(),r):void 0);return this._shouldPreventSpanCreation(t,e,a)===!0?void 0:(this._spansData.set(a,{taskCount:0}),a)}catch(e){this._diag.error(`failed to start create new user interaction span`,e)}}_decrementTask(e){let t=this._spansData.get(e);t&&(t.taskCount--,t.taskCount===0&&this._tryToEndSpan(e,t.hrTimeLastTimeout))}_getCurrentSpan(e){let t=e.get(Ra);return t&&m.getSpan(t)}_incrementTask(e){let t=this._spansData.get(e);t&&t.taskCount++}addPatchedListener(e,t,n,r){let i=this._wrappedListeners.get(n);i||(i=new Map,this._wrappedListeners.set(n,i));let a=i.get(t);return a||(a=new Map,i.set(t,a)),a.has(e)?!1:(a.set(e,r),!0)}removePatchedListener(e,t,n){let r=this._wrappedListeners.get(n);if(!r)return;let i=r.get(t);if(!i)return;let a=i.get(e);return a&&(i.delete(e),i.size===0&&(r.delete(t),r.size===0&&this._wrappedListeners.delete(n))),a}_invokeListener(e,t,n){return typeof e==`function`?e.apply(t,n):e.handleEvent(n[0])}_patchAddEventListener(){let e=this;return t=>function(r,i,a){if(!i)return t.call(this,r,i,a);let o=a&&typeof a==`object`&&a.once,s=function(...t){let a,s=t[0],c=s?.target;s&&(a=e._eventsSpanMap.get(s)),o&&e.removePatchedListener(this,r,i);let l=e._createSpan(c,r,a);return l?(s&&e._eventsSpanMap.set(s,l),n.with(m.setSpan(n.active(),l),()=>{let n=e._invokeListener(i,this,t);return l.end(),n})):e._invokeListener(i,this,t)};if(e.addPatchedListener(this,r,i,s))return t.call(this,r,s,a)}}_patchRemoveEventListener(){let e=this;return t=>function(n,r,i){let a=e.removePatchedListener(this,n,r);return a?t.call(this,n,a,i):t.call(this,n,r,i)}}_getPatchableEventTargets(){return window.EventTarget?[EventTarget.prototype]:[Node.prototype,Window.prototype]}_patchHistoryApi(){this._unpatchHistoryApi(),this._wrap(history,`replaceState`,this._patchHistoryMethod()),this._wrap(history,`pushState`,this._patchHistoryMethod()),this._wrap(history,`back`,this._patchHistoryMethod()),this._wrap(history,`forward`,this._patchHistoryMethod()),this._wrap(history,`go`,this._patchHistoryMethod())}_patchHistoryMethod(){let e=this;return t=>function(...n){let r=`${location.pathname}${location.hash}${location.search}`,i=t.apply(this,n),a=`${location.pathname}${location.hash}${location.search}`;return r!==a&&e._updateInteractionName(a),i}}_unpatchHistoryApi(){T(history.replaceState)&&this._unwrap(history,`replaceState`),T(history.pushState)&&this._unwrap(history,`pushState`),T(history.back)&&this._unwrap(history,`back`),T(history.forward)&&this._unwrap(history,`forward`),T(history.go)&&this._unwrap(history,`go`)}_updateInteractionName(e){let t=m.getSpan(n.active());t&&typeof t.updateName==`function`&&t.updateName(`${za} ${e}`)}_patchZoneCancelTask(){let e=this;return t=>function(n){let r=Zone.current,i=e._getCurrentSpan(r);return i&&e._shouldCountTask(n,r)&&e._decrementTask(i),t.call(this,n)}}_patchZoneScheduleTask(){let e=this;return t=>function(n){let r=Zone.current,i=e._getCurrentSpan(r);return i&&e._shouldCountTask(n,r)&&(e._incrementTask(i),e._checkForTimeout(n,i)),t.call(this,n)}}_patchZoneRunTask(){let e=this;return t=>function(r,i,a){let o=(Array.isArray(a)&&a[0]instanceof Event?a[0]:void 0)?.target,s,c=this;if(o){if(s=e._createSpan(o,r.eventName),s)return e._incrementTask(s),c.run(()=>{try{return n.with(m.setSpan(n.active(),s),()=>{let e=Zone.current;return r._zone=e,t.call(e,r,i,a)})}finally{e._decrementTask(s)}})}else s=e._getCurrentSpan(c);try{return t.call(c,r,i,a)}finally{s&&e._shouldCountTask(r,c)&&e._decrementTask(s)}}}_shouldCountTask(e,t){if(e._zone&&(t=e._zone),!t||!e.data||e.data.isPeriodic)return!1;let n=this._getCurrentSpan(t);return!n||!this._spansData.get(n)?!1:e.type===`macroTask`||e.type===`microTask`}_tryToEndSpan(e,t){e&&this._spansData.get(e)&&(e.end(t),this._spansData.delete(e))}enable(){let e=this._getZoneWithPrototype();this._diag.debug(`applying patch to`,this.moduleName,this.version,`zone:`,!!e),e?(T(e.prototype.runTask)&&(this._unwrap(e.prototype,`runTask`),this._diag.debug(`removing previous patch from method runTask`)),T(e.prototype.scheduleTask)&&(this._unwrap(e.prototype,`scheduleTask`),this._diag.debug(`removing previous patch from method scheduleTask`)),T(e.prototype.cancelTask)&&(this._unwrap(e.prototype,`cancelTask`),this._diag.debug(`removing previous patch from method cancelTask`)),this._zonePatched=!0,this._wrap(e.prototype,`runTask`,this._patchZoneRunTask()),this._wrap(e.prototype,`scheduleTask`,this._patchZoneScheduleTask()),this._wrap(e.prototype,`cancelTask`,this._patchZoneCancelTask())):(this._zonePatched=!1,this._getPatchableEventTargets().forEach(e=>{T(e.addEventListener)&&(this._unwrap(e,`addEventListener`),this._diag.debug(`removing previous patch from method addEventListener`)),T(e.removeEventListener)&&(this._unwrap(e,`removeEventListener`),this._diag.debug(`removing previous patch from method removeEventListener`)),this._wrap(e,`addEventListener`,this._patchAddEventListener()),this._wrap(e,`removeEventListener`,this._patchRemoveEventListener())})),this._patchHistoryApi()}disable(){let e=this._getZoneWithPrototype();this._diag.debug(`removing patch from`,this.moduleName,this.version,`zone:`,!!e),e&&this._zonePatched?(T(e.prototype.runTask)&&this._unwrap(e.prototype,`runTask`),T(e.prototype.scheduleTask)&&this._unwrap(e.prototype,`scheduleTask`),T(e.prototype.cancelTask)&&this._unwrap(e.prototype,`cancelTask`)):this._getPatchableEventTargets().forEach(e=>{T(e.addEventListener)&&this._unwrap(e,`addEventListener`),T(e.removeEventListener)&&this._unwrap(e,`removeEventListener`)}),this._unpatchHistoryApi()}_getZoneWithPrototype(){return window.Zone}},Ua=`deployment.environment.name`,Wa=!1;function Ga(){return{BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}?.VITE_OTEL_COLLECTOR_URL??`http://localhost:4318`}function Ka(){if(Wa)return;Wa=!0;let e=null,t=!1;try{let n=Ga(),r={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1};e=new Ti({resource:Vr({[Ge]:`open-knowledge-app`,[Ke]:r?.VITE_APP_VERSION??`dev`,[Ua]:r?.MODE??`dev`}),spanProcessors:[new ni(new tn({url:`${n}/v1/traces`}),{maxExportBatchSize:50,scheduledDelayMillis:2e3})]}),e.register(),t=!0,mn({instrumentations:[new Ri,new Ha({eventNames:[`click`,`submit`]}),new Fa({propagateTraceHeaderCorsUrls:[/^https?:\/\/localhost(:\d+)?\/api\//,/^https?:\/\/127\.0\.0\.1(:\d+)?\/api\//,/^\/api\//],clearTimingResources:!0})]}),console.info(`[otel] frontend telemetry initialized — OTLP/HTTP → ${n}/v1/traces`)}catch(n){console.warn(`[otel] frontend telemetry init failed — continuing without`,n),t&&e&&e.shutdown().catch(()=>{}),Wa=!1}}export{Ka as install};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./__vite-browser-external-BW1_xmov.js","./chunk-DECur_0Z.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./chunk-DECur_0Z.js";import{i as t,n,r,t as i}from"./propagation-api-LnD10wq2.js";import{a,c as o,d as s,f as c,i as l,l as u,n as d,o as f,p as ee,r as p,t as m,u as h}from"./trace-api-CbLDdnQA.js";var te=class{constructor(){}createGauge(e,t){return fe}createHistogram(e,t){return pe}createCounter(e,t){return de}createUpDownCounter(e,t){return me}createObservableGauge(e,t){return ge}createObservableCounter(e,t){return he}createObservableUpDownCounter(e,t){return _e}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},g=class{},ne=class extends g{add(e,t){}},re=class extends g{add(e,t){}},ie=class extends g{record(e,t){}},ae=class extends g{record(e,t){}},oe=class{addCallback(e){}removeCallback(e){}},se=class extends oe{},ce=class extends oe{},le=class extends oe{},ue=new te,de=new ne,fe=new ie,pe=new ae,me=new re,he=new se,ge=new ce,_e=new le;function ve(){return ue}var ye;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(ye||={});var be;(function(e){e[e.INTERNAL=0]=`INTERNAL`,e[e.SERVER=1]=`SERVER`,e[e.CLIENT=2]=`CLIENT`,e[e.PRODUCER=3]=`PRODUCER`,e[e.CONSUMER=4]=`CONSUMER`})(be||={});var _=h.instance(),xe=new class{getMeter(e,t,n){return ue}},Se=`metrics`,Ce=class e{constructor(){}static getInstance(){return this._instance||=new e,this._instance}setGlobalMeterProvider(e){return c(Se,e,h.instance())}getMeterProvider(){return s(Se)||xe}getMeter(e,t,n){return this.getMeterProvider().getMeter(e,t,n)}disable(){ee(Se,h.instance())}}.getInstance(),we=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()}},Te=class extends Error{code;name=`OTLPExporterError`;data;constructor(e,t,n){super(e),this.data=n,this.code=t}};function Ee(e){if(Number.isFinite(e)&&e>0)return e;throw Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function De(e){if(e!=null)return()=>e}function Oe(e,t,n){return{timeoutMillis:Ee(e.timeoutMillis??t.timeoutMillis??n.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??n.concurrencyLimit,compression:e.compression??t.compression??n.compression}}function ke(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:`none`}}var Ae=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 je(e){return new Ae(e.concurrencyLimit)}var Me=`http.url`,Ne=`http.user_agent`,Pe=Me,Fe=Ne,Ie=`error.type`,Le=`exception.message`,Re=`exception.stacktrace`,ze=`exception.type`,Be=`http.request.method`,Ve=`http.request.method_original`,He=`http.response.status_code`,Ue=`server.address`,We=`server.port`,Ge=`service.name`,Ke=`service.version`,qe=`telemetry.sdk.language`,Je=`webjs`,Ye=`telemetry.sdk.name`,Xe=`telemetry.sdk.version`,Ze=`url.full`,v;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(v||={});function Qe(e){return Object.prototype.hasOwnProperty.call(e,`partialSuccess`)}function $e(){return{handleResponse(e){e==null||!Qe(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||_.warn(`Received Partial Success response:`,JSON.stringify(e.partialSuccess))}}}var et=class{_transport;_serializer;_responseHandler;_promiseQueue;_timeout;_diagLogger;constructor(e,t,n,r,i){this._transport=e,this._serializer=t,this._responseHandler=n,this._promiseQueue=r,this._timeout=i,this._diagLogger=_.createComponentLogger({namespace:`OTLPExportDelegate`})}export(e,t){if(this._diagLogger.debug(`items to be sent`,e),this._promiseQueue.hasReachedLimit()){t({code:v.FAILED,error:Error(`Concurrent export limit reached`)});return}let n=this._serializer.serializeRequest(e);if(n==null){t({code:v.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:v.SUCCESS});return}else if(e.status===`failure`&&e.error){t({code:v.FAILED,error:e.error});return}else e.status===`retryable`?t({code:v.FAILED,error:new Te(`Export failed with retryable status`)}):t({code:v.FAILED,error:new Te(`Export failed with unknown error`)})},e=>t({code:v.FAILED,error:e})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug(`shutdown started`),await this.forceFlush(),this._transport.shutdown()}};function tt(e,t){return new et(e.transport,e.serializer,$e(),e.promiseHandler,t.timeout)}function nt(e,t,n){return tt({transport:n,serializer:t,promiseHandler:je(e)},{timeout:e.timeoutMillis})}var rt=10**9;function it(e){return e[0]*rt+e[1]}function at(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function ot(e){let t=new Uint8Array(e.length/2),n=0;for(let r=0;r<e.length;r+=2){let i=at(e.charCodeAt(r)),a=at(e.charCodeAt(r+1));t[n++]=i<<4|a}return t}function st(e){let t=BigInt(1e9);return BigInt(e[0])*t+BigInt(e[1])}function ct(e){return{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}function lt(e){return ct(st(e))}function ut(e){return st(e).toString()}var dt=typeof BigInt<`u`?ut:it;function ft(e){return e}function pt(e){if(e!==void 0)return ot(e)}var mt={encodeHrTime:lt,encodeSpanContext:ot,encodeOptionalSpanContext:pt};function ht(e){if(e===void 0)return mt;let t=e.useLongBits??!0,n=e.useHex??!1;return{encodeHrTime:t?lt:dt,encodeSpanContext:n?ft:ot,encodeOptionalSpanContext:n?ft:pt}}function gt(e){let t={attributes:y(e.attributes),droppedAttributesCount:0},n=e.schemaUrl;return n&&n!==``&&(t.schemaUrl=n),t}function _t(e){return{name:e.name,version:e.version}}function y(e){return Object.keys(e).map(t=>vt(t,e[t]))}function vt(e,t){return{key:e,value:yt(t)}}function yt(e){let t=typeof e;return t===`string`?{stringValue:e}:t===`number`?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:t===`boolean`?{boolValue:e}:e instanceof Uint8Array?{bytesValue:e}:Array.isArray(e)?{arrayValue:{values:e.map(yt)}}:t===`object`&&e!=null?{kvlistValue:{values:Object.entries(e).map(([e,t])=>vt(e,t))}}:{}}function bt(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:y(e.attributes),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>St(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:r.code,message:r.message},links:e.links.map(e=>xt(e,t)),droppedLinksCount:e.droppedLinksCount}}function xt(e,t){return{attributes:e.attributes?y(e.attributes):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0}}function St(e,t){return{attributes:e.attributes?y(e.attributes):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function Ct(e,t){return{resourceSpans:Tt(e,ht(t))}}function wt(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 Tt(e,t){let n=wt(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=>bt(e,t));o.push({scope:_t(e[0].instrumentationScope),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}c=s.next()}let l=gt(e),u={resource:l,scopeSpans:o,schemaUrl:l.schemaUrl};r.push(u),a=i.next()}return r}var Et={serializeRequest:e=>{let t=Ct(e,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;return JSON.parse(t.decode(e))}},Dt=5,Ot=1e3,kt=5e3,At=1.5,jt=.2;function Mt(){return 2*jt*Math.random()-jt}var Nt=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=Date.now()+t,r=await this._transport.send(e,t),i=Dt,a=Ot;for(;r.status===`retryable`&&i>0;){i--;let t=Math.max(Math.min(a,kt)+Mt(),0);a*=At;let o=r.retryInMillis??t,s=n-Date.now();if(o>s)return r;r=await this.retry(e,s,o)}return r}shutdown(){return this._transport.shutdown()}};function Pt(e){return new Nt(e.transport)}function Ft(e){return[429,502,503,504].includes(e)}function It(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 Lt=class{_parameters;constructor(e){this._parameters=e}send(e,t){return new Promise(n=>{let r=new XMLHttpRequest;r.timeout=t,r.open(`POST`,this._parameters.url);let i=this._parameters.headers();Object.entries(i).forEach(([e,t])=>{r.setRequestHeader(e,t)}),r.ontimeout=e=>{n({status:`failure`,error:Error(`XHR request timed out`)})},r.onreadystatechange=()=>{r.status>=200&&r.status<=299?(_.debug(`XHR success`),n({status:`success`})):r.status&&Ft(r.status)?n({status:`retryable`,retryInMillis:It(r.getResponseHeader(`Retry-After`))}):r.status!==0&&n({status:`failure`,error:Error(`XHR request failed with non-retryable status`)})},r.onabort=()=>{n({status:`failure`,error:Error(`XHR request aborted`)})},r.onerror=()=>{n({status:`failure`,error:Error(`XHR request errored`)})},r.send(e)})}shutdown(){}};function Rt(e){return new Lt(e)}var zt=class{_params;constructor(e){this._params=e}send(e){return new Promise(t=>{navigator.sendBeacon(this._params.url,new Blob([e],{type:this._params.blobType}))?(_.debug(`SendBeacon success`),t({status:`success`})):t({status:`failure`,error:Error(`SendBeacon failed`)})})}shutdown(){}};function Bt(e){return new zt(e)}var Vt=class{_parameters;constructor(e){this._parameters=e}async send(e,t){let n=new AbortController,r=setTimeout(()=>n.abort(),t);try{let t=!!globalThis.location,r=new URL(this._parameters.url),i=await fetch(r.href,{method:`POST`,headers:this._parameters.headers(),body:e,signal:n.signal,keepalive:t,mode:t?globalThis.location?.origin===r.origin?`same-origin`:`cors`:`no-cors`});return i.status>=200&&i.status<=299?(_.debug(`response success`),{status:`success`}):Ft(i.status)?{status:`retryable`,retryInMillis:It(i.headers.get(`Retry-After`))}:{status:`failure`,error:Error(`Fetch request failed with non-retryable status`)}}catch(e){return e?.name===`AbortError`?{status:`failure`,error:Error(`Fetch request timed out`,{cause:e})}:{status:`failure`,error:Error(`Fetch request errored`,{cause:e})}}finally{clearTimeout(r)}}shutdown(){}};function Ht(e){return new Vt(e)}function Ut(e,t){return nt(e,t,Pt({transport:Rt(e)}))}function Wt(e,t){return nt(e,t,Pt({transport:Ht(e)}))}function Gt(e,t){return nt(e,t,Pt({transport:Bt({url:e.url,blobType:e.headers()[`Content-Type`]})}))}function Kt(e){return()=>{let t={};return Object.entries(e?.()??{}).forEach(([e,n])=>{n===void 0?_.warn(`Header "${e}" has invalid value (${n}) and will be ignored`):t[e]=String(n)}),t}}function qt(e,t,n){let r={...n()},i={};return()=>(t!=null&&Object.assign(i,t()),e!=null&&Object.assign(i,e()),Object.assign(i,r))}function Jt(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 Yt(n){return async r=>{let{Agent:i}=await t(()=>import(`./__vite-browser-external-BW1_xmov.js`).then(t=>e(t.default)),__vite__mapDeps([0,1]),import.meta.url);return new i(n)}}function Xt(e,t,n){return{...Oe(e,t,n),headers:qt(Kt(e.headers),t.headers,n.headers),url:Jt(e.url)??t.url??n.url,agentFactory:e.agentFactory??t.agentFactory??n.agentFactory}}function Zt(e,t){return{...ke(),headers:()=>e,url:`http://localhost:4318/`+t,agentFactory:Yt({keepAlive:!0})}}function Qt(e,t,n){return Xt({url:e.url,timeoutMillis:e.timeoutMillis,headers:De(e.headers),concurrencyLimit:e.concurrencyLimit},{},Zt(n,t))}function $t(e,t,n,r){return en(e.headers)(Qt(e,n,r),t)}function en(e){return!e&&typeof navigator.sendBeacon==`function`?Gt:globalThis.fetch===void 0?Ut:Wt}var tn=class extends we{constructor(e={}){super($t(e,Et,`v1/traces`,{"Content-Type":`application/json`}))}},nn=class{emit(e){}},rn=new nn,an=new class{getLogger(e,t,n){return new nn}},on=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):rn}},sn=class{getLogger(e,t,n){return this._getDelegateLogger(e,t,n)??new on(this,e,t,n)}_getDelegate(){return this._delegate??an}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){return this._delegate?.getLogger(e,t,n)}},cn=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{},ln=Symbol.for(`io.opentelemetry.js.api.logs`),b=cn;function un(e,t,n){return r=>r===e?t:n}var dn=class e{constructor(){this._proxyLoggerProvider=new sn}static getInstance(){return this._instance||=new e,this._instance}setGlobalLoggerProvider(e){return b[ln]?this.getLoggerProvider():(b[ln]=un(1,e,an),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){return b[ln]?.call(b,1)??this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete b[ln],this._proxyLoggerProvider=new sn}}.getInstance();function fn(e,t,n,r){for(let i=0,a=e.length;i<a;i++){let a=e[i];t&&a.setTracerProvider(t),n&&a.setMeterProvider(n),r&&a.setLoggerProvider&&a.setLoggerProvider(r),a.getConfig().enabled||a.enable()}}function pn(e){e.forEach(e=>e.disable())}function mn(e){let t=e.tracerProvider||m.getTracerProvider(),n=e.meterProvider||Ce.getMeterProvider(),r=e.loggerProvider||dn.getLoggerProvider(),i=e.instrumentations?.flat()??[];return fn(i,t,n,r),()=>{pn(i)}}var x=console.error.bind(console);function S(e,t,n){let r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}var hn=(e,t,n)=>{if(!e||!e[t]){x(`no original function `+String(t)+` to wrap`);return}if(!n){x(`no wrapper function`),x(Error().stack);return}let r=e[t];if(typeof r!=`function`||typeof n!=`function`){x(`original object and wrapper must be functions`);return}let i=n(r,t);return S(i,`__original`,r),S(i,`__unwrap`,()=>{e[t]===i&&S(e,t,r)}),S(i,`__wrapped`,!0),S(e,t,i),i},gn=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{x(`must provide one or more modules to patch`),x(Error().stack);return}if(!(t&&Array.isArray(t))){x(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{hn(e,t,n)})})},_n=(e,t)=>{if(!e||!e[t]){x(`no function to unwrap.`),x(Error().stack);return}let n=e[t];if(!n.__unwrap)x(`no original to unwrap to -- has `+String(t)+` already been unwrapped?`);else{n.__unwrap();return}},vn=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{x(`must provide one or more modules to patch`),x(Error().stack);return}if(!(t&&Array.isArray(t))){x(`must provide one or more functions to unwrap on modules`);return}e.forEach(e=>{t.forEach(t=>{_n(e,t)})})};function C(e){e&&e.logger&&(typeof e.logger==`function`?x=e.logger:x(`new logger isn't a function, not replacing`))}C.wrap=hn,C.massWrap=gn,C.unwrap=_n,C.massUnwrap=vn;var yn=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,t,n){this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(n),this._diag=_.createComponentLogger({namespace:e}),this._tracer=m.getTracer(e,t),this._meter=Ce.getMeter(e,t),this._logger=dn.getLogger(e,t),this._updateMetricInstruments()}_wrap=hn;_unwrap=_n;_massWrap=gn;_massUnwrap=vn;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error(`Error running span customization hook due to exception in handler`,{triggerName:t},e)}}},bn=class extends yn{constructor(e,t,n){super(e,t,n),this._config.enabled&&this.enable()}};function w(e,t,n){let r,i;try{i=e()}catch(e){r=e}finally{if(t(r,i),r&&!n)throw r;return i}}function T(e){return typeof e==`function`&&typeof e.__original==`function`&&typeof e.__unwrap==`function`&&e.__wrapped===!0}var E;(function(e){e[e.STABLE=1]=`STABLE`,e[e.OLD=2]=`OLD`,e[e.DUPLICATE=3]=`DUPLICATE`})(E||={});function xn(e,t){let n=E.OLD,r=t?.split(`,`).map(e=>e.trim()).filter(e=>e!==``);for(let t of r??[])if(t.toLowerCase()===e+`/dup`){n=E.DUPLICATE;break}else t.toLowerCase()===e&&(n=E.STABLE);return n}var Sn=u(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function Cn(e){return e.setValue(Sn,!0)}function wn(e){return e.getValue(Sn)===!0}var Tn=`baggage`,En=4096;function Dn(e){return e.reduce((e,t)=>{let n=`${e}${e===``?``:`,`}${t}`;return n.length>8192?e:n},``)}function On(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 kn(e){if(!e)return;let t=e.indexOf(`;`),n=t===-1?e:e.substring(0,t),i=n.indexOf(`=`);if(i<=0)return;let a=n.substring(0,i).trim(),o=n.substring(i+1).trim();if(!a||!o)return;let s,c;try{s=decodeURIComponent(a),c=decodeURIComponent(o)}catch{return}let l;return t!==-1&&t<e.length-1&&(l=r(e.substring(t+1))),{key:s,value:c,metadata:l}}var An=class{inject(e,t,n){let r=i.getBaggage(e);if(!r||wn(e))return;let a=Dn(On(r).filter(e=>e.length<=En).slice(0,180));a.length>0&&n.set(t,Tn,a)}extract(e,t,n){let r=n.get(t,Tn),a=Array.isArray(r)?r.join(`,`):r;if(!a)return e;let o={};return a.length===0||(a.split(`,`).forEach(e=>{let t=kn(e);if(t){let e={value:t.value};t.metadata&&(e.metadata=t.metadata),o[t.key]=e}}),Object.entries(o).length===0)?e:i.setBaggage(e,i.createBaggage(o))}fields(){return[Tn]}};function D(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!jn(n)){_.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Mn(r)){_.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function jn(e){return typeof e==`string`&&e!==``}function Mn(e){return e==null?!0:Array.isArray(e)?Nn(e):Pn(typeof e)}function Nn(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(Pn(e)){t=e;continue}return!1}return!1}}return!0}function Pn(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}function Fn(){return e=>{_.error(In(e))}}function In(e){return typeof e==`string`?e:JSON.stringify(Ln(e))}function Ln(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 Rn=Fn();function O(e){try{Rn(e)}catch{}}var zn=`2.7.0`,Bn=`process.runtime.name`,Vn={[Ye]:`opentelemetry`,[Bn]:`browser`,[qe]:Je,[Xe]:zn},k=performance,Hn=9,Un=10**6,Wn=10**Hn;function A(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*Un)]}function Gn(e){return Yn(A(k.timeOrigin),A(typeof e==`number`?e:k.now()))}function Kn(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=Wn),[n,r]}function qn(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function Jn(e){return qn(e)||typeof e==`number`||e instanceof Date}function Yn(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=Wn&&(n[1]-=Wn,n[0]+=1),n}var Xn;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(Xn||={});var Zn=class{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[],this._fields=Array.from(new Set(this._propagators.map(e=>typeof e.fields==`function`?e.fields():[]).reduce((e,t)=>e.concat(t),[])))}inject(e,t,n){for(let r of this._propagators)try{r.inject(e,t,n)}catch(e){_.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){_.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}},Qn=`[_0-9a-z-*/]`,$n=`[a-z]${Qn}{0,255}`,er=`[a-z0-9]${Qn}{0,240}@[a-z]${Qn}{0,13}`,tr=RegExp(`^(?:${$n}|${er})$`),nr=/^[ -~]{0,255}[!-~]$/,rr=/,|=/;function ir(e){return tr.test(e)}function ar(e){return nr.test(e)&&!rr.test(e)}var or=32,sr=512,cr=`,`,lr=`=`,ur=class e{_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,t){let n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,t),n}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+lr+this.get(t)),e),[]).join(cr)}_parse(e){e.length>sr||(this._internalState=e.split(cr).reverse().reduce((e,t)=>{let n=t.trim(),r=n.indexOf(lr);if(r!==-1){let i=n.slice(0,r),a=n.slice(r+1,t.length);ir(i)&&ar(a)&&e.set(i,a)}return e},new Map),this._internalState.size>or&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,or))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let t=new e;return t._internalState=new Map(this._internalState),t}},j=`traceparent`,dr=`tracestate`,fr=`00`,pr=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`);function mr(e){let t=pr.exec(e);return!t||t[1]===`00`&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var hr=class{inject(e,t,n){let r=m.getSpanContext(e);if(!r||wn(e)||!p(r))return;let i=`${fr}-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||f.NONE).toString(16)}`;n.set(t,j,i),r.traceState&&n.set(t,dr,r.traceState.serialize())}extract(e,t,n){let r=n.get(t,j);if(!r)return e;let i=Array.isArray(r)?r[0]:r;if(typeof i!=`string`)return e;let a=mr(i);if(!a)return e;a.isRemote=!0;let o=n.get(t,dr);if(o){let e=Array.isArray(o)?o.join(`,`):o;a.traceState=new ur(typeof e==`string`?e:void 0)}return m.setSpanContext(e,a)}fields(){return[j,dr]}},gr=`[object Object]`,_r=`[object Null]`,vr=`[object Undefined]`,yr=Function.prototype.toString,br=yr.call(Object),xr=Object.getPrototypeOf,Sr=Object.prototype,Cr=Sr.hasOwnProperty,M=Symbol?Symbol.toStringTag:void 0,wr=Sr.toString;function Tr(e){if(!Er(e)||Dr(e)!==gr)return!1;let t=xr(e);if(t===null)return!0;let n=Cr.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&yr.call(n)===br}function Er(e){return typeof e==`object`&&!!e}function Dr(e){return e==null?e===void 0?vr:_r:M&&M in Object(e)?Or(e):kr(e)}function Or(e){let t=Cr.call(e,M),n=e[M],r=!1;try{e[M]=void 0,r=!0}catch{}let i=wr.call(e);return r&&(t?e[M]=n:delete e[M]),i}function kr(e){return wr.call(e)}var Ar=20;function jr(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=Nr(t,e.shift(),0,n);return t}function Mr(e){return N(e)?e.slice():e}function Nr(e,t,n=0,r){let i;if(!(n>Ar)){if(n++,F(e)||F(t)||Fr(t))i=Mr(t);else if(N(e)){if(i=e.slice(),N(t))for(let e=0,n=t.length;e<n;e++)i.push(Mr(t[e]));else if(P(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]=Mr(t[r]))}}}else if(P(e))if(P(t)){if(!Ir(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(F(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(Pr(e,s,r)||Pr(t,s,r))delete i[s];else{if(P(a)&&P(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]=Nr(i[s],c,n,r)}}}}else i=t;return i}}function Pr(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 N(e){return Array.isArray(e)}function Fr(e){return typeof e==`function`}function P(e){return!F(e)&&!N(e)&&!Fr(e)&&typeof e==`object`}function F(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function Ir(e,t){return!(!Tr(e)||!Tr(t))}var Lr=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)}},Rr=class{_isCalled=!1;_deferred=new Lr;_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}},I;function zr(){if(I===void 0)try{let e=globalThis.process.argv0;I=e?`unknown_service:${e}`:`unknown_service`}catch{I=`unknown_service`}return I}var L=e=>typeof e==`object`&&!!e&&typeof e.then==`function`,Br=class e{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=Ur(t),r._asyncAttributesPending=t.filter(([e,t])=>L(t)).length>0,r}constructor(e,t){let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([e,t])=>(L(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=Ur(this._rawAttributes),this._schemaUrl=Wr(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,L(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&_.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,n]of this._rawAttributes){if(L(n)){_.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=Gr(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}};function Vr(e,t){return Br.FromAttributeList(Object.entries(e),t)}function Hr(){return Vr({[Ge]:zr(),[qe]:Vn[qe],[Ye]:Vn[Ye],[Xe]:Vn[Xe]})}function Ur(e){return e.map(([e,t])=>L(t)?[e,t.catch(t=>{_.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function Wr(e){if(typeof e==`string`||e===void 0)return e;_.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function Gr(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;_.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,n,r)}var Kr=`exception`,qr=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:d.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=k.now(),this._performanceOffset=t-(this._performanceStartTime+k.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 _.warn(`Invalid attribute key: ${e}`),this;if(!Mn(t))return _.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 _.warn(`No events allowed.`),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&_.debug(`Dropping extra events.`),this.events.shift(),this._droppedEventsCount++),Jn(t)&&(Jn(n)||(n=t),t=void 0);let i=D(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&&_.debug(`Dropping extra links.`),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:n}=this._spanLimits,r=D(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===d.UNSET||this.status.code===d.OK)return this;let t={code:e.code};return e.code===d.ERROR&&(typeof e.message==`string`?t.message=e.message:e.message!=null&&_.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()){_.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=Kn(this.startTime,this.endTime),this._duration[0]<0&&(_.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&&_.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&_.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<=k.now())return Gn(e+this._performanceOffset);if(typeof e==`number`)return A(e);if(e instanceof Date)return A(e.getTime());if(qn(e))return e;if(this._startTimeProvided)return A(Date.now());let t=k.now()-this._performanceStartTime;return Yn(this.startTime,A(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e==`string`?n[Le]=e:e&&(e.code?n[ze]=e.code.toString():e.name&&(n[ze]=e.name),e.message&&(n[Le]=e.message),e.stack&&(n[Re]=e.stack)),n[`exception.type`]||n[`exception.message`]?this.addEvent(Kr,n,t):_.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}}`);_.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?(_.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}},R;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(R||={});var z=class{shouldSample(){return{decision:R.NOT_RECORD}}toString(){return`AlwaysOffSampler`}},B=class{shouldSample(){return{decision:R.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}},V=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||=(O(Error(`ParentBasedSampler must have a root sampler configured`)),new B),this._remoteParentSampled=e.remoteParentSampled??new B,this._remoteParentNotSampled=e.remoteParentNotSampled??new z,this._localParentSampled=e.localParentSampled??new B,this._localParentNotSampled=e.localParentNotSampled??new z}shouldSample(e,t,n,r,i,a){let o=m.getSpanContext(e);return!o||!p(o)?this._root.shouldSample(e,t,n,r,i,a):o.isRemote?o.traceFlags&f.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,i,a):this._remoteParentNotSampled.shouldSample(e,t,n,r,i,a):o.traceFlags&f.SAMPLED?this._localParentSampled.shouldSample(e,t,n,r,i,a):this._localParentNotSampled.shouldSample(e,t,n,r,i,a)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}},Jr=class{_ratio;_upperBound;constructor(e=0){this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:l(t)&&this._accumulate(t)<this._upperBound?R.RECORD_AND_SAMPLED:R.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<e.length/8;n++){let r=n*8,i=parseInt(e.slice(r,r+8),16);t=(t^i)>>>0}return t}},H;(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`})(H||={});var Yr=1;function Xr(){return{sampler:Zr(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function Zr(){let e=H.ParentBasedAlwaysOn;switch(e){case H.AlwaysOn:return new B;case H.AlwaysOff:return new z;case H.ParentBasedAlwaysOn:return new V({root:new B});case H.ParentBasedAlwaysOff:return new V({root:new z});case H.TraceIdRatio:return new Jr(Qr());case H.ParentBasedTraceIdRatio:return new V({root:new Jr(Qr())});default:return _.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${H.ParentBasedAlwaysOn}".`),new V({root:new B})}}function Qr(){return _.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Yr}.`),Yr}function $r(e){let t={sampler:Zr()},n=Xr(),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 ei(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 ti=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 Rr(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(_.warn(`BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&f.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&_.debug(`maxQueueSize reached, dropping spans`),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(_.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 r=setTimeout(()=>{t(Error(`Timeout`))},this._exportTimeoutMillis);n.with(Cn(n.active()),()=>{let n;this._finishedSpans.length<=this._maxExportBatchSize?(n=this._finishedSpans,this._finishedSpans=[]):n=this._finishedSpans.splice(0,this._maxExportBatchSize);let i=()=>this._exporter.export(n,n=>{clearTimeout(r),n.code===Xn.SUCCESS?e():t(n.error??Error(`BatchSpanProcessor: span export failed`))}),a=null;for(let e=0,t=n.length;e<t;e++){let t=n[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(a??=[],a.push(t.resource.waitForAsyncAttributes()))}a===null?i():Promise.all(a).then(i,e=>{O(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,O(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)}},ni=class extends ti{_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=>{O(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{O(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))}},ri=16,ii=8,ai=new Uint8Array(ri),oi=new Uint8Array(ii),si=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function ci(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 li(e){let t=``;for(let n=0;n<e.length;n++)t+=si[e[n]];return t}var ui=class{generateTraceId(){return ci(ai),li(ai)}generateSpanId(){return ci(oi),li(oi)}},di=`otel.span.parent.origin`,fi=`otel.span.sampling_result`,pi=`otel.sdk.span.live`,mi=`otel.sdk.span.started`,hi=class{startedSpans;liveSpans;constructor(e){this.startedSpans=e.createCounter(mi,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=e.createUpDownCounter(pi,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(e,t){let n=_i(t);if(this.startedSpans.add(1,{[di]:gi(e),[fi]:n}),t===R.NOT_RECORD)return()=>{};let r={[fi]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}};function gi(e){return e?e.isRemote?`remote`:`local`:`none`}function _i(e){switch(e){case R.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case R.RECORD:return`RECORD_ONLY`;case R.NOT_RECORD:return`DROP`}}var vi=`2.7.0`,yi=class{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(e,t,n,r){let i=$r(t);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=t.idGenerator||new ui,this._resource=n,this._spanProcessor=r,this.instrumentationScope=e,this._tracerMetrics=new hi(i.meterProvider?i.meterProvider.getMeter(`@opentelemetry/sdk-trace`,vi):ve())}startSpan(e,t={},r=n.active()){t.root&&(r=m.deleteSpan(r));let i=m.getSpan(r);if(wn(r))return _.debug(`Instrumentation suppressed, returning Noop Span`),m.wrapSpanContext(a);let o=i?.spanContext(),s=this._idGenerator.generateSpanId(),c,l,u;!o||!m.isSpanContextValid(o)?l=this._idGenerator.generateTraceId():(l=o.traceId,u=o.traceState,c=o);let d=t.kind??be.INTERNAL,ee=(t.links??[]).map(e=>({context:e.context,attributes:D(e.attributes)})),p=D(t.attributes),h=this._sampler.shouldSample(r,l,e,d,p,ee),te=this._tracerMetrics.startSpan(o,h.decision);u=h.traceState??u;let g=h.decision===ye.RECORD_AND_SAMPLED?f.SAMPLED:f.NONE,ne={traceId:l,spanId:s,traceFlags:g,traceState:u};if(h.decision===ye.NOT_RECORD)return _.debug(`Recording is off, propagating context in a non-recording span`),m.wrapSpanContext(ne);let re=D(Object.assign(p,h.attributes));return new qr({resource:this._resource,scope:this.instrumentationScope,context:r,spanContext:ne,name:e,kind:d,links:ee,parentSpanContext:c,attributes:re,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:te})}startActiveSpan(e,t,r,i){let a,o,s;if(arguments.length<2)return;arguments.length===2?s=t:arguments.length===3?(a=t,s=r):(a=t,o=r,s=i);let c=o??n.active(),l=this.startSpan(e,a,c),u=m.setSpan(c,l);return n.with(u,s,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}},bi=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=>{O(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)})}},U;(function(e){e[e.resolved=0]=`resolved`,e[e.timeout=1]=`timeout`,e[e.error=2]=`error`,e[e.unresolved=3]=`unresolved`})(U||={});var xi=class{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){let t=jr({},Xr(),ei(e));this._resource=t.resource??Hr(),this._config=Object.assign({},t,{resource:this._resource});let n=[];e.spanProcessors?.length&&n.push(...e.spanProcessors),this._activeSpanProcessor=new bi(n)}getTracer(e,t,n){let r=`${e}@${t||``}:${n?.schemaUrl||``}`;return this._tracers.has(r)||this._tracers.set(r,new yi({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=U.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),r!==U.timeout&&(r=U.resolved,n(r))}).catch(e=>{clearTimeout(i),r=U.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{let r=t.filter(e=>e!==U.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}},Si=class{_enabled=!1;_currentContext=o;_bindFunction(e=o,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=o,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=o,this)}with(e,t,n,...r){let i=this._currentContext;this._currentContext=e||o;try{return t.call(n,...r)}finally{this._currentContext=i}}};function Ci(e){if(e!==null){if(e===void 0){let e=new Si;e.enable(),n.setGlobalContextManager(e);return}e.enable(),n.setGlobalContextManager(e)}}function wi(e){if(e!==null){if(e===void 0){i.setGlobalPropagator(new Zn({propagators:[new hr,new An]}));return}i.setGlobalPropagator(e)}}var Ti=class extends xi{constructor(e={}){super(e)}register(e={}){m.setGlobalTracerProvider(this),wi(e.propagator),Ci(e.contextManager)}},W;(function(e){e.CONNECT_END=`connectEnd`,e.CONNECT_START=`connectStart`,e.DECODED_BODY_SIZE=`decodedBodySize`,e.DOM_COMPLETE=`domComplete`,e.DOM_CONTENT_LOADED_EVENT_END=`domContentLoadedEventEnd`,e.DOM_CONTENT_LOADED_EVENT_START=`domContentLoadedEventStart`,e.DOM_INTERACTIVE=`domInteractive`,e.DOMAIN_LOOKUP_END=`domainLookupEnd`,e.DOMAIN_LOOKUP_START=`domainLookupStart`,e.ENCODED_BODY_SIZE=`encodedBodySize`,e.FETCH_START=`fetchStart`,e.LOAD_EVENT_END=`loadEventEnd`,e.LOAD_EVENT_START=`loadEventStart`,e.NAVIGATION_START=`navigationStart`,e.REDIRECT_END=`redirectEnd`,e.REDIRECT_START=`redirectStart`,e.REQUEST_START=`requestStart`,e.RESPONSE_END=`responseEnd`,e.RESPONSE_START=`responseStart`,e.SECURE_CONNECTION_START=`secureConnectionStart`,e.START_TIME=`startTime`,e.UNLOAD_EVENT_END=`unloadEventEnd`,e.UNLOAD_EVENT_START=`unloadEventStart`})(W||={});var Ei=`http.response_content_length`,Di=`http.response_content_length_uncompressed`;function G(e,t){return t in e}function K(e,t,n,r=!0){if(G(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function Oi(e,t,n=!1,r,i){if(r===void 0&&(r=t[W.START_TIME]!==0),n||(K(e,W.FETCH_START,t,r),K(e,W.DOMAIN_LOOKUP_START,t,r),K(e,W.DOMAIN_LOOKUP_END,t,r),K(e,W.CONNECT_START,t,r),K(e,W.SECURE_CONNECTION_START,t,r),K(e,W.CONNECT_END,t,r),K(e,W.REQUEST_START,t,r),K(e,W.RESPONSE_START,t,r),K(e,W.RESPONSE_END,t,r)),!i){let n=t[W.ENCODED_BODY_SIZE];n!==void 0&&e.setAttribute(Ei,n);let r=t[W.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(Di,r)}}function ki(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return`/`;let n=ji(e,t);if(t&&n.indexOf(`@id`)>0)return n;let r=``;return e.parentNode&&(r+=ki(e.parentNode,t)),r+=n,r}function Ai(e){if(!e.parentNode)return 0;let t=[e.nodeType];e.nodeType===Node.CDATA_SECTION_NODE&&t.push(Node.TEXT_NODE);let n=Array.from(e.parentNode.childNodes);return n=n.filter(n=>{let r=n.localName;return t.indexOf(n.nodeType)>=0&&r===e.localName}),n.length>=1?n.indexOf(e)+1:0}function ji(e,t){let n=e.nodeType,r=Ai(e),i=``;if(n===Node.ELEMENT_NODE){let n=e.getAttribute(`id`);if(t&&n)return`//*[@id="${n}"]`;i=e.localName}else if(n===Node.TEXT_NODE||n===Node.CDATA_SECTION_NODE)i=`text()`;else if(n===Node.COMMENT_NODE)i=`comment()`;else return``;return i&&r>1?`/${i}[${r}]`:`/${i}`}var q;(function(e){e.DOCUMENT_LOAD=`documentLoad`,e.DOCUMENT_FETCH=`documentFetch`,e.RESOURCE_FETCH=`resourceFetch`})(q||={});var Mi=`0.49.0`,Ni=`@opentelemetry/instrumentation-document-load`,Pi;(function(e){e.FIRST_PAINT=`firstPaint`,e.FIRST_CONTENTFUL_PAINT=`firstContentfulPaint`})(Pi||={});var Fi=()=>{let e={},t=k.getEntriesByType?.(`navigation`)[0];if(t)Object.values(W).forEach(n=>{if(G(t,n)){let r=t[n];typeof r==`number`&&(e[n]=r)}});else{let t=k.timing;t&&Object.values(W).forEach(n=>{if(G(t,n)){let r=t[n];typeof r==`number`&&(e[n]=r)}})}return e},Ii={"first-paint":Pi.FIRST_PAINT,"first-contentful-paint":Pi.FIRST_CONTENTFUL_PAINT},Li=e=>{let t=k.getEntriesByType?.(`paint`);t&&t.forEach(({name:t,startTime:n})=>{G(Ii,t)&&e.addEvent(Ii[t],n)})},Ri=class extends bn{component=`document-load`;version=`1`;moduleName=this.component;constructor(e={}){super(Ni,Mi,e)}init(){}_onDocumentLoaded(){window.setTimeout(()=>{this._collectPerformance()})}_addResourcesSpans(e){let t=k.getEntriesByType?.(`resource`);t&&t.forEach(t=>{this._initResourceSpan(t,e)})}_collectPerformance(){let e=Array.from(document.getElementsByTagName(`meta`)).find(e=>e.getAttribute(`name`)===j),t=Fi(),r=e&&e.content||``;n.with(i.extract(o,{traceparent:r}),()=>{let e=this._startSpan(q.DOCUMENT_LOAD,W.FETCH_START,t);e&&(n.with(m.setSpan(n.active(),e),()=>{let e=this._startSpan(q.DOCUMENT_FETCH,W.FETCH_START,t);e&&(e.setAttribute(Pe,location.href),n.with(m.setSpan(n.active(),e),()=>{Oi(e,t,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentFetch),this._endSpan(e,W.RESPONSE_END,t)}))}),e.setAttribute(Pe,location.href),e.setAttribute(Fe,navigator.userAgent),this._addResourcesSpans(e),this.getConfig().ignoreNetworkEvents||(K(e,W.FETCH_START,t),K(e,W.UNLOAD_EVENT_START,t),K(e,W.UNLOAD_EVENT_END,t),K(e,W.DOM_INTERACTIVE,t),K(e,W.DOM_CONTENT_LOADED_EVENT_START,t),K(e,W.DOM_CONTENT_LOADED_EVENT_END,t),K(e,W.DOM_COMPLETE,t),K(e,W.LOAD_EVENT_START,t),K(e,W.LOAD_EVENT_END,t)),this.getConfig().ignorePerformancePaintEvents||Li(e),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentLoad),this._endSpan(e,W.LOAD_EVENT_END,t))})}_endSpan(e,t,n){e&&(G(n,t)?e.end(n[t]):e.end())}_initResourceSpan(e,t){let n=this._startSpan(q.RESOURCE_FETCH,W.FETCH_START,e,t);n&&(n.setAttribute(Pe,e.name),Oi(n,e,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnResourceSpan(n,e,this.getConfig().applyCustomAttributesOnSpan?.resourceFetch),this._endSpan(n,W.RESPONSE_END,e))}_startSpan(e,t,r,i){if(G(r,t)&&typeof r[t]==`number`)return this.tracer.startSpan(e,{startTime:r[t]},i?m.setSpan(n.active(),i):void 0)}_waitForPageLoad(){window.document.readyState===`complete`?this._onDocumentLoaded():(this._onDocumentLoaded=this._onDocumentLoaded.bind(this),window.addEventListener(`load`,this._onDocumentLoaded))}_addCustomAttributesOnSpan(e,t){t&&w(()=>t(e),e=>{e&&this._diag.error(`addCustomAttributesOnSpan`,e)},!0)}_addCustomAttributesOnResourceSpan(e,t,n){n&&w(()=>n(e,t),e=>{e&&this._diag.error(`addCustomAttributesOnResourceSpan`,e)},!0)}enable(){window.removeEventListener(`load`,this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener(`load`,this._onDocumentLoaded)}},zi=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{},Bi=performance,Vi=9,Hi=10**6,Ui=10**Vi;function J(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*Hi)]}function Wi(){let e=Bi.timeOrigin;if(typeof e!=`number`){let t=Bi;e=t.timing&&t.timing.fetchStart}return e}function Gi(e){return qi(J(Wi()),J(typeof e==`number`?e:Bi.now()))}function Y(e){if(Ki(e))return e;if(typeof e==`number`)return e<Wi()?Gi(e):J(e);if(e instanceof Date)return J(e.getTime());throw TypeError(`Invalid input type`)}function X(e){return e[0]*Ui+e[1]}function Ki(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function qi(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=Ui&&(n[1]-=Ui,n[0]+=1),n}function Ji(e,t){return typeof t==`string`?e===t:!!e.match(t)}function Yi(e,t){if(!t)return!1;for(let n of t)if(Ji(e,n))return!0;return!1}var Z;(function(e){e.CONNECT_END=`connectEnd`,e.CONNECT_START=`connectStart`,e.DECODED_BODY_SIZE=`decodedBodySize`,e.DOM_COMPLETE=`domComplete`,e.DOM_CONTENT_LOADED_EVENT_END=`domContentLoadedEventEnd`,e.DOM_CONTENT_LOADED_EVENT_START=`domContentLoadedEventStart`,e.DOM_INTERACTIVE=`domInteractive`,e.DOMAIN_LOOKUP_END=`domainLookupEnd`,e.DOMAIN_LOOKUP_START=`domainLookupStart`,e.ENCODED_BODY_SIZE=`encodedBodySize`,e.FETCH_START=`fetchStart`,e.LOAD_EVENT_END=`loadEventEnd`,e.LOAD_EVENT_START=`loadEventStart`,e.NAVIGATION_START=`navigationStart`,e.REDIRECT_END=`redirectEnd`,e.REDIRECT_START=`redirectStart`,e.REQUEST_START=`requestStart`,e.RESPONSE_END=`responseEnd`,e.RESPONSE_START=`responseStart`,e.SECURE_CONNECTION_START=`secureConnectionStart`,e.START_TIME=`startTime`,e.UNLOAD_EVENT_END=`unloadEventEnd`,e.UNLOAD_EVENT_START=`unloadEventStart`})(Z||={});var Xi=`http.response_content_length`,Zi=`http.response_content_length_uncompressed`,Qi;function $i(){return Qi||=document.createElement(`a`),Qi}function ea(e,t){return t in e}function Q(e,t,n,r=!0){if(ea(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function ta(e,t,n=!1,r,i){if(r===void 0&&(r=t[Z.START_TIME]!==0),n||(Q(e,Z.FETCH_START,t,r),Q(e,Z.DOMAIN_LOOKUP_START,t,r),Q(e,Z.DOMAIN_LOOKUP_END,t,r),Q(e,Z.CONNECT_START,t,r),Q(e,Z.SECURE_CONNECTION_START,t,r),Q(e,Z.CONNECT_END,t,r),Q(e,Z.REQUEST_START,t,r),Q(e,Z.RESPONSE_START,t,r),Q(e,Z.RESPONSE_END,t,r)),!i){let n=t[Z.ENCODED_BODY_SIZE];n!==void 0&&e.setAttribute(Xi,n);let r=t[Z.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(Zi,r)}}function na(e){return e.slice().sort((e,t)=>{let n=e[Z.FETCH_START],r=t[Z.FETCH_START];return n>r?1:n<r?-1:0})}function ra(){return typeof location<`u`?location.origin:void 0}function ia(e,t,n,r,i=new WeakSet,a){let o=sa(e);e=o.toString();let s=oa(e,t,n,r,i,a);if(s.length===0)return{mainRequest:void 0};if(s.length===1)return{mainRequest:s[0]};let c=na(s);if(o.origin!==ra()&&c.length>1){let e=c[0],t=aa(c,e[Z.RESPONSE_END],n),r=e[Z.RESPONSE_END];return t[Z.FETCH_START]<r&&(t=e,e=void 0),{corsPreFlightRequest:e,mainRequest:t}}else return{mainRequest:s[0]}}function aa(e,t,n){let r=X(n),i=X(Y(t)),a=e[1],o,s=e.length;for(let t=1;t<s;t++){let n=e[t],s=X(Y(n[Z.FETCH_START])),c=r-X(Y(n[Z.RESPONSE_END]));s>=i&&(!o||c<o)&&(o=c,a=n)}return a}function oa(e,t,n,r,i,a){let o=X(t),s=X(n),c=r.filter(t=>{let n=X(Y(t[Z.FETCH_START])),r=X(Y(t[Z.RESPONSE_END]));return t.initiatorType.toLowerCase()===(a||`xmlhttprequest`)&&t.name===e&&n>=o&&r<=s});return c.length>0&&(c=c.filter(e=>!i.has(e))),c}function sa(e){if(typeof URL==`function`)return new URL(e,typeof document<`u`?document.baseURI:typeof location<`u`?location.href:void 0);let t=$i();return t.href=e,t}function ca(e,t){let n=t||[];return(typeof n==`string`||n instanceof RegExp)&&(n=[n]),sa(e).origin===ra()?!0:n.some(t=>Ji(e,t))}var la;(function(e){e.COMPONENT=`component`,e.HTTP_STATUS_TEXT=`http.status_text`})(la||={});var ua=`http.host`,da=`http.method`,fa=`http.request.body.size`,pa=`http.request_content_length_uncompressed`,ma=`http.scheme`,ha=`http.status_code`,ga=`http.url`,_a=`http.user_agent`,va=_.createComponentLogger({namespace:`@opentelemetry/opentelemetry-instrumentation-fetch/utils`});function ya(...e){if(e[0]instanceof URL||typeof e[0]==`string`){let t=e[1];if(!t?.body)return Promise.resolve();if(t.body instanceof ReadableStream){let{body:e,length:n}=ba(t.body);return t.body=e,n}else return Promise.resolve(Sa(t.body))}else{let t=e[0];return t?.body?t.clone().text().then(e=>wa(e)):Promise.resolve()}}function ba(e){if(!e.pipeThrough)return va.warn(`Platform has ReadableStream but not pipeThrough!`),{body:e,length:Promise.resolve(void 0)};let t=0,n,r=new Promise(e=>{n=e}),i=new TransformStream({start(){},async transform(e,n){let r=await e;t+=r.byteLength,n.enqueue(e)},flush(){n(t)}});return{body:e.pipeThrough(i),length:r}}function xa(e){return typeof Document<`u`&&e instanceof Document}function Sa(e){if(xa(e))return new XMLSerializer().serializeToString(document).length;if(typeof e==`string`)return wa(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return Ta(e);if(e instanceof URLSearchParams)return wa(e.toString());if(e.byteLength!==void 0)return e.byteLength;va.warn(`unknown body type`)}var Ca=new TextEncoder;function wa(e){return Ca.encode(e).byteLength}function Ta(e){let t=0;for(let[n,r]of e.entries())t+=n.length,r instanceof Blob?t+=r.size:t+=r.length;return t}function Ea(e){let t=ka(),n=e.toUpperCase();return n in t?n:`_OTHER`}var Da={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0},Oa;function ka(){return Oa===void 0&&(Oa=Da),Oa}var Aa={"https:":`443`,"http:":`80`};function ja(e){let t=Number(e.port||Aa[e.protocol]);if(t&&!isNaN(t))return t}var Ma=`0.204.0`,Na=300,Pa=typeof process==`object`&&process.release?.name===`node`,Fa=class extends bn{component=`fetch`;version=Ma;moduleName=this.component;_usedResources=new WeakSet;_tasksCount=0;_semconvStability;constructor(e={}){super(`@opentelemetry/instrumentation-fetch`,Ma,e),this._semconvStability=xn(`http`,e?.semconvStabilityOptIn)}init(){}_addChildSpan(e,t){let r=this.tracer.startSpan(`CORS Preflight`,{startTime:t[Z.FETCH_START]},m.setSpan(n.active(),e)),i=!(this._semconvStability&E.OLD);ta(r,t,this.getConfig().ignoreNetworkEvents,void 0,i),r.end(t[Z.RESPONSE_END])}_addFinalSpanAttributes(e,t){let n=sa(t.url);if(this._semconvStability&E.OLD&&(e.setAttribute(ha,t.status),t.statusText!=null&&e.setAttribute(la.HTTP_STATUS_TEXT,t.statusText),e.setAttribute(ua,n.host),e.setAttribute(ma,n.protocol.replace(`:`,``)),typeof navigator<`u`&&e.setAttribute(_a,navigator.userAgent)),this._semconvStability&E.STABLE){e.setAttribute(He,t.status),e.setAttribute(Ue,n.hostname);let r=ja(n);r&&e.setAttribute(We,r)}}_addHeaders(e,t){if(!ca(t,this.getConfig().propagateTraceHeaderCorsUrls)){let e={};i.inject(n.active(),e),Object.keys(e).length>0&&this._diag.debug(`headers inject skipped due to CORS policy`);return}if(e instanceof Request)i.inject(n.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else if(e.headers instanceof Headers)i.inject(n.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else if(e.headers instanceof Map)i.inject(n.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else{let t={};i.inject(n.active(),t),e.headers=Object.assign({},t,e.headers||{})}}_clearResources(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(e,t={}){if(Yi(e,this.getConfig().ignoreUrls)){this._diag.debug(`ignoring span as url matches ignored url`);return}let n=``,r={};if(this._semconvStability&E.OLD){let i=(t.method||`GET`).toUpperCase();n=`HTTP ${i}`,r[la.COMPONENT]=this.moduleName,r[da]=i,r[ga]=e}if(this._semconvStability&E.STABLE){let i=t.method,a=Ea(t.method||`GET`);n||=a,r[Be]=a,a!==i&&(r[Ve]=i),r[Ze]=e}return this.tracer.startSpan(n,{kind:be.CLIENT,attributes:r})}_findResourceAndAddNetworkEvents(e,t,n){let r=t.entries;if(!r.length){if(!performance.getEntriesByType)return;r=performance.getEntriesByType(`resource`)}let i=ia(t.spanUrl,t.startTime,n,r,this._usedResources,`fetch`);if(i.mainRequest){let t=i.mainRequest;this._markResourceAsUsed(t);let n=i.corsPreFlightRequest;n&&(this._addChildSpan(e,n),this._markResourceAsUsed(n));let r=!(this._semconvStability&E.OLD);ta(e,t,this.getConfig().ignoreNetworkEvents,void 0,r)}}_markResourceAsUsed(e){this._usedResources.add(e)}_endSpan(e,t,n){let r=J(Date.now()),i=Gi();this._addFinalSpanAttributes(e,n),this._semconvStability&E.STABLE&&n.status>=400&&(e.setStatus({code:d.ERROR}),e.setAttribute(Ie,String(n.status))),setTimeout(()=>{t.observer?.disconnect(),this._findResourceAndAddNetworkEvents(e,t,i),this._tasksCount--,this._clearResources(),e.end(r)},Na)}_patchConstructor(){return e=>{let t=this;return function(...r){let i=this,a=sa(r[0]instanceof Request?r[0].url:String(r[0])).href,o=r[0]instanceof Request?r[0]:r[1]||{},s=t._createSpan(a,o);if(!s)return e.apply(this,r);let c=t._prepareSpanData(a);t.getConfig().measureRequestSize&&ya(...r).then(e=>{e&&(t._semconvStability&E.OLD&&s.setAttribute(pa,e),t._semconvStability&E.STABLE&&s.setAttribute(fa,e))}).catch(e=>{t._diag.warn(`getFetchBodyLength`,e)});function l(e,n){t._applyAttributesAfterFetch(e,o,n),t._endSpan(e,c,{status:n.status||0,statusText:n.message,url:a})}function u(e,n){t._applyAttributesAfterFetch(e,o,n),n.status>=200&&n.status<400?t._endSpan(e,c,n):t._endSpan(e,c,{status:n.status,statusText:n.statusText,url:a})}function d(e,t,n){try{let t=n.clone().body;if(t){let r=t.getReader(),i=()=>{r.read().then(({done:t})=>{t?u(e,n):i()},t=>{l(e,t)})};i()}else u(e,n)}finally{t(n)}}function f(e,t,n){try{l(e,n)}finally{t(n)}}return new Promise((r,c)=>n.with(m.setSpan(n.active(),s),()=>(t._addHeaders(o,a),t._callRequestHook(s,o),t._tasksCount++,e.apply(i,o instanceof Request?[o]:[a,o]).then(d.bind(i,s,r),f.bind(i,s,c)))))}}}_applyAttributesAfterFetch(e,t,n){let r=this.getConfig().applyCustomAttributesOnSpan;r&&w(()=>r(e,t,n),e=>{e&&this._diag.error(`applyCustomAttributesOnSpan`,e)},!0)}_callRequestHook(e,t){let n=this.getConfig().requestHook;n&&w(()=>n(e,t),e=>{e&&this._diag.error(`requestHook`,e)},!0)}_prepareSpanData(e){let t=Gi(),n=[];if(typeof PerformanceObserver!=`function`)return{entries:n,startTime:t,spanUrl:e};let r=new PerformanceObserver(t=>{t.getEntries().forEach(t=>{t.initiatorType===`fetch`&&t.name===e&&n.push(t)})});return r.observe({entryTypes:[`resource`]}),{entries:n,observer:r,startTime:t,spanUrl:e}}enable(){if(Pa){this._diag.warn(`this instrumentation is intended for web usage only, it does not instrument Node.js's fetch()`);return}T(fetch)&&(this._unwrap(zi,`fetch`),this._diag.debug(`removing previous patch for constructor`)),this._wrap(zi,`fetch`,this._patchConstructor())}disable(){Pa||(this._unwrap(zi,`fetch`),this._usedResources=new WeakSet)}},$;(function(e){e.EVENT_TYPE=`event_type`,e.TARGET_ELEMENT=`target_element`,e.TARGET_XPATH=`target_xpath`,e.HTTP_URL=`http.url`})($||={});var Ia=`0.49.0`,La=`@opentelemetry/instrumentation-user-interaction`,Ra=`OT_ZONE_CONTEXT`,za=`Navigation:`,Ba=[`click`];function Va(){return!1}var Ha=class extends bn{version=Ia;moduleName=`user-interaction`;_spansData=new WeakMap;_wrappedListeners=new WeakMap;_eventsSpanMap=new WeakMap;_eventNames;_shouldPreventSpanCreation;constructor(e={}){super(La,Ia,e),this._eventNames=new Set(e?.eventNames??Ba),this._shouldPreventSpanCreation=typeof e?.shouldPreventSpanCreation==`function`?e.shouldPreventSpanCreation:Va}init(){}_checkForTimeout(e,t){let n=this._spansData.get(t);n&&(e.source===`setTimeout`?n.hrTimeLastTimeout=Gn():e.source!==`Promise.then`&&e.source!==`setTimeout`&&(n.hrTimeLastTimeout=void 0))}_allowEventName(e){return this._eventNames.has(e)}_createSpan(e,t,r){if(!(e instanceof HTMLElement)||!e.getAttribute||e.hasAttribute(`disabled`)||!this._allowEventName(t))return;let i=ki(e,!0);try{let a=this.tracer.startSpan(t,{attributes:{[$.EVENT_TYPE]:t,[$.TARGET_ELEMENT]:e.tagName,[$.TARGET_XPATH]:i,[$.HTTP_URL]:window.location.href}},r?m.setSpan(n.active(),r):void 0);return this._shouldPreventSpanCreation(t,e,a)===!0?void 0:(this._spansData.set(a,{taskCount:0}),a)}catch(e){this._diag.error(`failed to start create new user interaction span`,e)}}_decrementTask(e){let t=this._spansData.get(e);t&&(t.taskCount--,t.taskCount===0&&this._tryToEndSpan(e,t.hrTimeLastTimeout))}_getCurrentSpan(e){let t=e.get(Ra);return t&&m.getSpan(t)}_incrementTask(e){let t=this._spansData.get(e);t&&t.taskCount++}addPatchedListener(e,t,n,r){let i=this._wrappedListeners.get(n);i||(i=new Map,this._wrappedListeners.set(n,i));let a=i.get(t);return a||(a=new Map,i.set(t,a)),a.has(e)?!1:(a.set(e,r),!0)}removePatchedListener(e,t,n){let r=this._wrappedListeners.get(n);if(!r)return;let i=r.get(t);if(!i)return;let a=i.get(e);return a&&(i.delete(e),i.size===0&&(r.delete(t),r.size===0&&this._wrappedListeners.delete(n))),a}_invokeListener(e,t,n){return typeof e==`function`?e.apply(t,n):e.handleEvent(n[0])}_patchAddEventListener(){let e=this;return t=>function(r,i,a){if(!i)return t.call(this,r,i,a);let o=a&&typeof a==`object`&&a.once,s=function(...t){let a,s=t[0],c=s?.target;s&&(a=e._eventsSpanMap.get(s)),o&&e.removePatchedListener(this,r,i);let l=e._createSpan(c,r,a);return l?(s&&e._eventsSpanMap.set(s,l),n.with(m.setSpan(n.active(),l),()=>{let n=e._invokeListener(i,this,t);return l.end(),n})):e._invokeListener(i,this,t)};if(e.addPatchedListener(this,r,i,s))return t.call(this,r,s,a)}}_patchRemoveEventListener(){let e=this;return t=>function(n,r,i){let a=e.removePatchedListener(this,n,r);return a?t.call(this,n,a,i):t.call(this,n,r,i)}}_getPatchableEventTargets(){return window.EventTarget?[EventTarget.prototype]:[Node.prototype,Window.prototype]}_patchHistoryApi(){this._unpatchHistoryApi(),this._wrap(history,`replaceState`,this._patchHistoryMethod()),this._wrap(history,`pushState`,this._patchHistoryMethod()),this._wrap(history,`back`,this._patchHistoryMethod()),this._wrap(history,`forward`,this._patchHistoryMethod()),this._wrap(history,`go`,this._patchHistoryMethod())}_patchHistoryMethod(){let e=this;return t=>function(...n){let r=`${location.pathname}${location.hash}${location.search}`,i=t.apply(this,n),a=`${location.pathname}${location.hash}${location.search}`;return r!==a&&e._updateInteractionName(a),i}}_unpatchHistoryApi(){T(history.replaceState)&&this._unwrap(history,`replaceState`),T(history.pushState)&&this._unwrap(history,`pushState`),T(history.back)&&this._unwrap(history,`back`),T(history.forward)&&this._unwrap(history,`forward`),T(history.go)&&this._unwrap(history,`go`)}_updateInteractionName(e){let t=m.getSpan(n.active());t&&typeof t.updateName==`function`&&t.updateName(`${za} ${e}`)}_patchZoneCancelTask(){let e=this;return t=>function(n){let r=Zone.current,i=e._getCurrentSpan(r);return i&&e._shouldCountTask(n,r)&&e._decrementTask(i),t.call(this,n)}}_patchZoneScheduleTask(){let e=this;return t=>function(n){let r=Zone.current,i=e._getCurrentSpan(r);return i&&e._shouldCountTask(n,r)&&(e._incrementTask(i),e._checkForTimeout(n,i)),t.call(this,n)}}_patchZoneRunTask(){let e=this;return t=>function(r,i,a){let o=(Array.isArray(a)&&a[0]instanceof Event?a[0]:void 0)?.target,s,c=this;if(o){if(s=e._createSpan(o,r.eventName),s)return e._incrementTask(s),c.run(()=>{try{return n.with(m.setSpan(n.active(),s),()=>{let e=Zone.current;return r._zone=e,t.call(e,r,i,a)})}finally{e._decrementTask(s)}})}else s=e._getCurrentSpan(c);try{return t.call(c,r,i,a)}finally{s&&e._shouldCountTask(r,c)&&e._decrementTask(s)}}}_shouldCountTask(e,t){if(e._zone&&(t=e._zone),!t||!e.data||e.data.isPeriodic)return!1;let n=this._getCurrentSpan(t);return!n||!this._spansData.get(n)?!1:e.type===`macroTask`||e.type===`microTask`}_tryToEndSpan(e,t){e&&this._spansData.get(e)&&(e.end(t),this._spansData.delete(e))}enable(){let e=this._getZoneWithPrototype();this._diag.debug(`applying patch to`,this.moduleName,this.version,`zone:`,!!e),e?(T(e.prototype.runTask)&&(this._unwrap(e.prototype,`runTask`),this._diag.debug(`removing previous patch from method runTask`)),T(e.prototype.scheduleTask)&&(this._unwrap(e.prototype,`scheduleTask`),this._diag.debug(`removing previous patch from method scheduleTask`)),T(e.prototype.cancelTask)&&(this._unwrap(e.prototype,`cancelTask`),this._diag.debug(`removing previous patch from method cancelTask`)),this._zonePatched=!0,this._wrap(e.prototype,`runTask`,this._patchZoneRunTask()),this._wrap(e.prototype,`scheduleTask`,this._patchZoneScheduleTask()),this._wrap(e.prototype,`cancelTask`,this._patchZoneCancelTask())):(this._zonePatched=!1,this._getPatchableEventTargets().forEach(e=>{T(e.addEventListener)&&(this._unwrap(e,`addEventListener`),this._diag.debug(`removing previous patch from method addEventListener`)),T(e.removeEventListener)&&(this._unwrap(e,`removeEventListener`),this._diag.debug(`removing previous patch from method removeEventListener`)),this._wrap(e,`addEventListener`,this._patchAddEventListener()),this._wrap(e,`removeEventListener`,this._patchRemoveEventListener())})),this._patchHistoryApi()}disable(){let e=this._getZoneWithPrototype();this._diag.debug(`removing patch from`,this.moduleName,this.version,`zone:`,!!e),e&&this._zonePatched?(T(e.prototype.runTask)&&this._unwrap(e.prototype,`runTask`),T(e.prototype.scheduleTask)&&this._unwrap(e.prototype,`scheduleTask`),T(e.prototype.cancelTask)&&this._unwrap(e.prototype,`cancelTask`)):this._getPatchableEventTargets().forEach(e=>{T(e.addEventListener)&&this._unwrap(e,`addEventListener`),T(e.removeEventListener)&&this._unwrap(e,`removeEventListener`)}),this._unpatchHistoryApi()}_getZoneWithPrototype(){return window.Zone}},Ua=`deployment.environment.name`,Wa=!1;function Ga(){return{BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}?.VITE_OTEL_COLLECTOR_URL??`http://localhost:4318`}function Ka(){if(Wa)return;Wa=!0;let e=null,t=!1;try{let n=Ga(),r={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1};e=new Ti({resource:Vr({[Ge]:`open-knowledge-app`,[Ke]:r?.VITE_APP_VERSION??`dev`,[Ua]:r?.MODE??`dev`}),spanProcessors:[new ni(new tn({url:`${n}/v1/traces`}),{maxExportBatchSize:50,scheduledDelayMillis:2e3})]}),e.register(),t=!0,mn({instrumentations:[new Ri,new Ha({eventNames:[`click`,`submit`]}),new Fa({propagateTraceHeaderCorsUrls:[/^https?:\/\/localhost(:\d+)?\/api\//,/^https?:\/\/127\.0\.0\.1(:\d+)?\/api\//,/^\/api\//],clearTimingResources:!0})]}),console.info(`[otel] frontend telemetry initialized — OTLP/HTTP → ${n}/v1/traces`)}catch(n){console.warn(`[otel] frontend telemetry init failed — continuing without`,n),t&&e&&e.shutdown().catch(()=>{}),Wa=!1}}export{Ka as install};
@@ -369,7 +369,7 @@ ${t.slice(l+2)}`,d+=1;else break}t.push({indent:l,number:parseInt(s,10),content:
369
369
  `);case`WRITE_ERROR`:return`Failed to write config file: ${e.detail}`;case`UNKNOWN`:return e.message??`Unknown error.`}}function K$(e){let t=e;for(let e=0;e<16;e++){if(t==null||t?._zod?.def?.shape!==void 0)return t;let e=t?._zod?.def?.innerType;if(e===void 0)return t;t=e}return t}function q$(e,t){let n=e;for(let e of t){n=K$(n);let t=n?._zod?.def?.shape;if(!t||(n=t[String(e)],n===void 0))return}return n}function J$(e,t){let n=q$(e,t);if(n!==void 0)return zE(n)}var Y$=2e3;function X$(e){let t=Date.now();for(let[n,r]of e.entries()){let i=r;i.timestamp&&t-i.timestamp>3e4&&e.delete(n)}}function Z$(e,t){for(let[,n]of e.entries()){let e=n;if(e.timestamp&&e.timestamp>t)return!0}return!1}var Q$=`__system__`,$$=`__config__/workspace`,e1=`__user__/config.yml`;Object.freeze([$$,e1]);var t1=[`incoming`,`outgoing`,`both`];function n1(e){return t1.includes(e)}var r1=[`image/jpeg`,`image/png`,`image/gif`,`image/webp`,`image/svg+xml`],i1=[`video/mp4`,`video/webm`,`video/ogg`],a1=[`audio/mpeg`,`audio/wav`,`audio/ogg`],o1=aD.extend({priority:60,addAttributes(){return{...this.parent?.(),fenceDelimiter:{default:"`"},fenceLength:{default:3}}}}),s1=vD.extend({name:`emphasis`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`*`}}}}),c1=fD.extend({name:`strong`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`**`}}}}),l1=hh.create({name:`escapeMark`,priority:10,excludes:``,inclusive:!1,parseHTML(){return[{tag:`span[data-escape-mark]`}]},renderHTML(){return[`span`,{"data-escape-mark":``},0]}}),u1=/^---\r?\n([\s\S]*?\r?\n)?---(\r?\n|$)/;function d1(e){let t=e.match(u1);return t?{frontmatter:t[0],body:e.slice(t[0].length)}:{frontmatter:``,body:e}}var f1=bD.extend({priority:60,addAttributes(){return{...this.parent?.(),hardBreakStyle:{default:`backslash`}}}}),p1=SD.extend({priority:60,addAttributes(){return{...this.parent?.(),headingStyle:{default:`atx`}}}}),m1=cg.create({name:`htmlBlock`,group:`block`,atom:!0,priority:60,addAttributes(){return{content:{default:``}}},parseHTML(){return[{tag:`div[data-html-block]`}]},renderHTML({node:e}){return[`div`,{"data-html-block":``,class:`html-block`},e.attrs.content]}}),h1=cg.create({name:`jsxComponent`,group:`block`,atom:!1,content:`block*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{componentName:{default:``},kind:{default:`element`},attributes:{default:[]},sourceRaw:{default:``},sourceDirty:{default:!1},props:{default:{}}}},parseHTML(){return[{tag:`div[data-jsx-component]`,getAttrs:e=>typeof e==`string`?!1:{componentName:e.getAttribute(`data-component-name`)||``,sourceRaw:e.getAttribute(`data-source-raw`)||``}}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-jsx-component":``,"data-component-name":e.componentName,"data-source-raw":e.sourceRaw},0]},addCommands(){return{insertJsxComponent:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{sourceRaw:e}})}}}),g1=cg.create({name:`jsxInline`,group:`inline`,inline:!0,atom:!1,content:`text*`,isolating:!1,selectable:!0,priority:60,addAttributes(){return{}},parseHTML(){return[{tag:`span[data-jsx-inline]`}]},renderHTML(){return[`span`,{"data-jsx-inline":``},0]}}),_1=Lk.extend({priority:60,addOptions(){return{openOnClick:!1,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`},isAllowedUri:e=>{try{let t=new URL(e,`https://placeholder.invalid`).protocol.toLowerCase();return![`javascript:`,`data:`,`vbscript:`].includes(t)}catch{return!1}},validate:()=>!0,shouldAutoLink:()=>!0}},addAttributes(){return{...this.parent?.(),linkStyle:{default:`inline`,rendered:!1},refLabel:{default:null,rendered:!1}}}}),v1=cg.create({name:`linkRefDef`,group:`block`,atom:!0,priority:60,addAttributes(){return{label:{default:``},href:{default:``},title:{default:null}}},parseHTML(){return[{tag:`div[data-link-ref-def]`}]},renderHTML({node:e}){let{label:t,href:n,title:r}=e.attrs;return[`div`,{"data-link-ref-def":``,class:`link-ref-def`},r?`[${t}]: ${n} "${r}"`:`[${t}]: ${n}`]}});function y1(e){return e.type.name===`list`&&!e.attrs.ordered}function b1(e){return e.type.name===`list`&&!!e.attrs.ordered}function x1(e){let t=!1;return e.forEach(e=>{e.type.name===`listItem`&&e.attrs.checked!==null&&(t=!0)}),t}function S1(e,t,n,r,i,a,o){let s=Up(e=>e.type.name===`list`)(e.selection);if(s&&i(s.node)){let{$from:n,$to:i}=e.selection;return n.blockRange(i)?Vs(r)(e,t):!1}if(s){if(!t)return!0;let{tr:n}=e;return n.setNodeMarkup(s.pos,void 0,{...s.node.attrs,...a}),o!==void 0&&s.node.forEach((e,t)=>{if(e.type.name===`listItem`){let r=s.pos+1+t;n.setNodeMarkup(r,void 0,{...e.attrs,...o??{}})}}),t(n),!0}return Rs(n,a)(e,void 0)?t?Rs(n,a)(e,n=>{if(o){let t=n.mapping.map(e.selection.$from.pos),r=n.doc.resolve(t);for(let e=r.depth;e>0;e--){let t=r.node(e);if(t.type.name===`listItem`){n.setNodeMarkup(r.before(e),void 0,{...t.attrs,...o});break}}}t(n)}):!0:!1}var C1=cg.create({name:`list`,group:`block list`,content:`listItem+`,priority:60,addAttributes(){return{ordered:{default:!1},start:{default:1},spread:{default:!1},bulletMarker:{default:null},listMarkerDelimiter:{default:null}}},parseHTML(){return[{tag:`ul`,getAttrs:()=>({ordered:!1})},{tag:`ol`,getAttrs:e=>({ordered:!0,start:e.getAttribute(`start`)?Number(e.getAttribute(`start`)):1})}]},renderHTML({node:e,HTMLAttributes:t}){let n=e.attrs.ordered?`ol`:`ul`,r={};return e.attrs.ordered&&e.attrs.start!==1&&(r.start=e.attrs.start),[n,$p(t,r),0]},addCommands(){return{toggleBulletList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:S1(e,t,n,r,e=>y1(e)&&!x1(e),{ordered:!1},{checked:null})},toggleOrderedList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:S1(e,t,n,r,e=>b1(e),{ordered:!0},{checked:null})},toggleTaskList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:S1(e,t,n,r,e=>y1(e)&&x1(e),{ordered:!1},{checked:!1})}}},addInputRules(){return[Uh({find:/^\s*([-+*])(?!\s*\[[ xX]\])\s$/,type:this.type,getAttributes:e=>({ordered:!1,bulletMarker:e[1]})}),Uh({find:/^\s*(\d+)([.)])\s$/,type:this.type,getAttributes:e=>({ordered:!0,start:Number(e[1]),listMarkerDelimiter:e[2]})}),new sh({find:/^\s*[-*+]\s\[([ xX])\]\s$/,handler:({state:e,range:t,match:n})=>{let r=e.schema.nodes.list;if(!r)return null;let i=n[1]!==` `,a=e.tr.delete(t.from,t.to),o=a.doc.resolve(t.from).blockRange();if(!o)return null;let s=Ga(o,r,{ordered:!1});if(!s)return null;a.wrap(o,s);let c=a.doc.resolve(a.mapping.map(t.from));for(let e=c.depth;e>0;e--){let t=c.node(e);if(t.type.name===`listItem`){a.setNodeMarkup(c.before(e),void 0,{...t.attrs,checked:i});break}}}})]},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList(),"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList(),"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),w1=cg.create({name:`listItem`,content:`paragraph block*`,defining:!0,priority:60,addAttributes(){return{checked:{default:null},spread:{default:!1}}},parseHTML(){return[{tag:`li`,getAttrs:e=>{let t=e.querySelector(`input[type="checkbox"]`);return{checked:t?t.checked:null}}}]},renderHTML({node:e,HTMLAttributes:t}){return e.attrs.checked===null?[`li`,$p(t),0]:[`li`,$p(t,{"data-type":`taskItem`,"data-checked":e.attrs.checked?`true`:`false`}),[`label`,{contenteditable:`false`},[`input`,{type:`checkbox`,...e.attrs.checked?{checked:`checked`}:{}}]],[`div`,0]]},addNodeView(){return({node:e,getPos:t,editor:n,HTMLAttributes:r})=>{let i=document.createElement(`li`);Object.entries($p(r,e.attrs.checked===null?{}:{"data-type":`taskItem`,"data-checked":String(!!e.attrs.checked)})).forEach(([e,t])=>{t!=null&&i.setAttribute(e,String(t))});let a=null,o=null,s=document.createElement(`div`);return e.attrs.checked!==null&&(a=document.createElement(`label`),a.contentEditable=`false`,o=document.createElement(`input`),o.type=`checkbox`,o.checked=!!e.attrs.checked,n.isEditable||(o.disabled=!0),o.addEventListener(`change`,()=>{let r=t();r===void 0||typeof r!=`number`||n.view.dispatch(n.view.state.tr.setNodeMarkup(r,void 0,{...e.attrs,checked:o?.checked??!1}))}),a.appendChild(o),i.appendChild(a)),i.appendChild(s),{dom:i,contentDOM:s,update(t){return t.type!==e.type||t.attrs.checked!==null!=(e.attrs.checked!==null)?!1:(o&&t.attrs.checked!==null&&(o.checked=!!t.attrs.checked,i.setAttribute(`data-checked`,String(!!t.attrs.checked))),e=t,!0)}}}},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.sinkListItem(this.name);return!1},"Shift-Tab":()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.liftListItem(this.name);return!1}}}}),T1=C1,E1=w1,D1=cg.create({name:`rawMdxFallback`,group:`block`,atom:!1,content:`text*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{reason:{default:``},originalSpan:{default:{start:0,end:0}}}},parseHTML(){return[{tag:`div[data-raw-mdx-fallback]`,getAttrs:e=>typeof e==`string`?!1:{reason:e.getAttribute(`data-reason`)||``}}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-raw-mdx-fallback":``,"data-raw-badge":`raw`,"data-reason":e.reason,contenteditable:`false`,class:`raw-mdx-fallback`},0]},addNodeView(){return({HTMLAttributes:e})=>{let t=document.createElement(`div`);t.setAttribute(`data-raw-mdx-fallback`,``),t.setAttribute(`data-raw-badge`,`raw`),t.setAttribute(`contenteditable`,`false`),t.classList.add(`raw-mdx-fallback`),e.reason&&t.setAttribute(`data-reason`,e.reason);let n=document.createElement(`pre`);return n.classList.add(`raw-mdx-fallback-content`),n.setAttribute(`contenteditable`,`false`),t.appendChild(n),{dom:t,contentDOM:n,ignoreMutation:()=>!0}}}}),O1=$j.extend({excludes:``}),k1=hh.create({name:`sourceLiteral`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceRaw:{default:``}}},parseHTML(){return[{tag:`span[data-source-literal]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-source-literal":``,...e},0]}}),A1=nM.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}}});function j1(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function M1(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}var N1=cg.create({name:`wikiLink`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolved:{default:!1}}},parseHTML(){return[{tag:`span[data-wiki-link]`,getAttrs:e=>typeof e==`string`?!1:{target:e.getAttribute(`data-target`)||``,alias:j1(e.getAttribute(`data-alias`)),anchor:j1(e.getAttribute(`data-anchor`)),resolved:e.getAttribute(`data-resolved`)===`true`}},{tag:`a.wiki-link[data-target]`,priority:100,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-target`)??``;return t?{target:t,alias:j1(e.getAttribute(`data-alias`)),anchor:j1(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=j1(e.attrs.alias),i=j1(e.attrs.anchor),a=e.attrs.resolved===!0;return[`span`,{...t,"data-wiki-link":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,"data-resolved":a?`true`:`false`},M1({target:n,alias:r,anchor:i})]}}),P1=[h1,D1,g1,N1,T1,E1,s1,c1,O1,o1,p1,A1,_1,m1,v1,f1,l1,k1,MN.configure({undoRedo:!1,bulletList:!1,orderedList:!1,listItem:!1,italic:!1,bold:!1,code:!1,codeBlock:!1,heading:!1,horizontalRule:!1,hardBreak:!1,link:!1}),qj.configure({resizable:!0}),Pj,Nj,Mj,Hk.configure({inline:!0}),Bk];function F1(e,t){let n=encodeURIComponent(t.prompt),r=encodeURIComponent(t.projectDir),i=encodeURIComponent(t.docPath);return`claude://${e.mode}/new?q=${n}&folder=${r}&file=${i}`}function I1(e){return`codex://new?prompt=${encodeURIComponent(e.prompt)}&path=${encodeURIComponent(e.projectDir)}`}function L1(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t<0?e:e.substring(t+1)}function R1(e){return`cursor://anysphere.cursor-deeplink/prompt?text=${encodeURIComponent(encodeURIComponent(e.prompt))}&workspace=${encodeURIComponent(L1(e.projectDir))}&mode=agent`}function z1(e){return`Open Knowledge doc: ${e.relativePath}. Use the open-knowledge MCP tool for backlinks and related context.`}function B1(e){return`https://claude.ai/new?q=${encodeURIComponent(e)}`}var V1=/notionvc:/i,H1=()=>e=>{U1(e)&&(W1(e),G1(e))};function U1(e){if(!(`children`in e)||!Array.isArray(e.children))return!1;for(let t of e.children){if(t.type===`comment`){let e=String(t.value??``);if(V1.test(e))return!0}if(t.type===`element`&&U1(t))return!0}return!1}function W1(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&W1(t);let t=[];for(let n of e.children){if(n.type!==`text`){t.push(n);continue}let e=String(n.value??``);if(!e.includes(`
370
370
  `)){t.push(n);continue}let r=e.split(`
371
371
  `);for(let e=0;e<r.length;e++)r[e]&&t.push({type:`text`,value:r[e]??``}),e<r.length-1&&t.push({type:`element`,tagName:`br`,properties:{},children:[]})}e.children=t}function G1(e){if(!(!(`children`in e)||!Array.isArray(e.children))){e.children=e.children.filter(e=>e.type===`comment`?!V1.test(String(e.value??``)):!0);for(let t of e.children)t.type===`element`&&G1(t)}}var K1=new Set([`Apple-tab-span`,`Apple-converted-space`,`Apple-style-span`]),q1=()=>e=>{J1(e)};function J1(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&J1(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return Y1(t)?[]:X1(t)?t.children:[t]})}}function Y1(e){if(e.tagName!==`meta`)return!1;let t=e.properties?.name,n=e.properties?.content;return t===`Generator`&&typeof n==`string`&&/Cocoa/i.test(n)}function X1(e){if(e.tagName!==`span`)return!1;let t=e.properties?.className;return Array.isArray(t)?t.length>0&&t.every(e=>K1.has(String(e))):!1}var Z1=`docs-internal-guid-`;function Q1(e,t){let n=e.children[t];!n||n.type!==`element`||e.children.splice(t,1,...n.children)}var $1=()=>e=>{e0(e)};function e0(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&e0(t);let t=0;for(;t<e.children.length;){let n=e.children[t];if(!n||n.type!==`element`){t++;continue}let r=n;if(t0(r)||n0(r)){Q1(e,t);continue}t++}}function t0(e){if(e.tagName!==`b`)return!1;let t=e.properties?.id;return typeof t==`string`&&t.startsWith(Z1)}function n0(e){if(e.tagName!==`div`||e.properties?.dir!==`ltr`)return!1;let t=e.children.filter(e=>e.type===`element`);return t.length===1?t[0]?.tagName===`table`:!1}var r0=new Set([`commit-link`,`user-mention`,`team-mention`,`issue-link`]),i0=()=>e=>{a0(e)};function a0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&a0(t);for(let t of e.children)t.type===`element`&&o0(t)}}function o0(e){if(!e.properties)return;for(let t of Object.keys(e.properties))t.startsWith(`dataHovercard`)&&delete e.properties[t];let t=e.properties.className;if(Array.isArray(t)){let n=t.filter(e=>!r0.has(String(e)));n.length===0?delete e.properties.className:e.properties.className=n}}var s0=/^gmail_/,c0=()=>e=>{l0(e)};function l0(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&l0(t);let t=0;for(;t<e.children.length;){let n=e.children[t];if(n.type!==`element`){t++;continue}let r=n;if(r.tagName===`div`&&u0(r,`gmail_quote`)&&(r.tagName=`blockquote`),d0(r),f0(r)){e.children.splice(t,1,...r.children);continue}t++}}function u0(e,t){let n=e.properties?.className;return Array.isArray(n)?n.some(e=>String(e)===t):!1}function d0(e){let t=e.properties?.className;if(!Array.isArray(t))return;let n=t.filter(e=>!s0.test(String(e)));n.length===0?delete e.properties?.className:e.properties&&(e.properties.className=n)}function f0(e){if(e.tagName!==`div`||e.properties?.dir!==`ltr`)return!1;let t=e.properties?.className;return t!=null&&!(Array.isArray(t)&&t.length===0)?!1:e.children.filter(e=>e.type===`element`).length<=1}var p0=()=>e=>{m0(e)};function m0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&m0(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return t.tagName===`google-sheets-html-origin`?t.children:t.tagName===`style`?[]:(h0(t),[t])})}}function h0(e){if(e.properties)for(let t of Object.keys(e.properties))t.startsWith(`dataSheets`)&&delete e.properties[t]}var g0=[`o:`,`w:`,`m:`,`v:`,`u1:`],_0=/^Mso[A-Z]/,v0=/^\s*\[if\s+[^\]]*\]/,y0=()=>e=>{b0(e)};function b0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&b0(t);e.children=e.children.flatMap(e=>{if(e.type===`comment`){let t=String(e.value??``);return v0.test(t)?[]:[e]}if(e.type!==`element`)return[e];let t=e;return x0(t)?[]:(S0(t),[t])})}}function x0(e){return g0.some(t=>e.tagName.startsWith(t))}function S0(e){let t=e.properties;if(!t)return;let n=t.className;if(Array.isArray(n)){let e=n.filter(e=>typeof e==`string`&&!_0.test(e));e.length===0?delete t.className:t.className=e}else typeof n==`string`&&_0.test(n)&&delete t.className;let r=t.style;typeof r==`string`&&/mso-/i.test(r)&&delete t.style;for(let e of Object.keys(t))if(e.startsWith(`xmlns:`)){let n=e.slice(6);g0.some(e=>e===`${n}:`)&&delete t[e]}}var C0=/^c-(message_kit__|message__|compose|timestamp)/,w0=()=>e=>{T0(e)};function T0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&T0(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return E0(t)?[]:(D0(t),[t])})}}function E0(e){let t=e.properties?.className;return Array.isArray(t)?t.some(e=>String(e)===`c-timestamp`||String(e).startsWith(`c-timestamp`)):!1}function D0(e){let t=e.properties?.className;if(!Array.isArray(t))return;let n=t.filter(e=>!C0.test(String(e)));n.length===0?delete e.properties?.className:e.properties&&(e.properties.className=n)}var O0=()=>e=>{k0(e)};function k0(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&k0(t);for(let t=0;t<e.children.length;t++){let n=e.children[t];if(n.type!==`element`)continue;let r=n;A0(r)&&(e.children[t]=M0(r))}}}function A0(e){if(e.tagName!==`div`)return!1;let t=e.children.filter(e=>e.type===`element`&&e.tagName===`div`);return t.length<2?!1:t.some(e=>j0(e))}function j0(e){for(let t of e.children){if(t.type!==`element`)continue;let e=t,n=e.properties?.style;if(typeof n==`string`&&/color\s*:/i.test(n)||j0(e))return!0}return!1}function M0(e){return{type:`element`,tagName:`pre`,properties:{},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:e.children.filter(e=>e.type===`element`&&e.tagName===`div`).map(e=>N0(e)).join(`
372
- `)}]}]}}function N0(e){let t=``;for(let n of e.children)n.type===`text`?t+=n.value??``:n.type===`element`&&(t+=N0(n));return t}var P0=class extends Error{htmlBytes;maxBytes;constructor(e,t){super(`HTML payload (${e} bytes) exceeds htmlToMdast ceiling (${t} bytes); falling through to plain text`),this.name=`HtmlPayloadTooLargeError`,this.htmlBytes=e,this.maxBytes=t}},F0=[$1,y0,q1,c0,H1,O0,p0,w0,i0];function I0(e,t){let n=t?.maxBytes??5242880;if(e.length>n)throw new P0(e.length,n);let r=gJ().use(wz,{fragment:!0});for(let e of F0)r.use(e);for(let e of t?.additionalCleanupPlugins??[])r.use(e);r.use(wH);let i=r.parse(e);return r.runSync(i)}function L0(e){return String(gJ().use(sJ).use(cJ).stringify(e))}function R0(e){let t=Array.isArray(e.attrs.attributes)?e.attrs.attributes.filter(e=>typeof e==`object`&&!!e&&`type`in e):[],n=e.attrs.props??{};for(let[e,r]of Object.entries(n)){let n=t.findIndex(t=>t.type===`mdxJsxAttribute`&&t.name===e),i=z0(e,r);n>=0?t[n]=i:t.push(i)}return t}function z0(e,t){if(t===!0)return{type:`mdxJsxAttribute`,name:e,value:null};if(t===!1)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}};if(t==null)return{type:`mdxJsxAttribute`,name:e,value:null};if(typeof t==`string`)return{type:`mdxJsxAttribute`,name:e,value:t};if(typeof t==`number`)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:JSON.stringify(t)}};if(typeof t==`object`){let n;try{n=JSON.stringify(t)}catch{n=String(t)}return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:n}}}return{type:`mdxJsxAttribute`,name:e,value:String(t)}}function B0(e,t,n){return{type:`mdxJsxFlowElement`,name:e,attributes:R0(t),children:n.all(t),data:{}}}var V0=[{name:`type`,type:`enum`,enumValues:[`note`,`tip`,`important`,`warning`,`caution`],defaultValue:`note`,required:!1,description:`GFM alert variant`},{name:`title`,type:`string`,required:!1,description:`Optional heading shown above the body`},{name:`icon`,type:`string`,required:!1,description:"Custom lucide icon override (e.g. `lucide:Lightbulb`)"},{name:`color`,type:`string`,required:!1,description:"Optional accent color override (hex — e.g. `#F05032`)"},{name:`collapsible`,type:`boolean`,required:!1,defaultValue:!1,description:"Render as a foldable `<details>` (Obsidian `[!TYPE]+/-`)"},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!0,description:`When collapsible, start in the open state`},{name:`children`,type:`reactnode`,required:!0,description:`Callout content`}],H0=[{name:`src`,type:`string`,required:!0,description:`Image source URL`,accept:r1,autoFocus:!0},{name:`alt`,type:`string`,required:!1,defaultValue:``,description:`Alt text`},{name:`width`,type:`number`,required:!1,description:`Image width`},{name:`height`,type:`number`,required:!1,description:`Image height`},{name:`srcset`,type:`string`,required:!1,advanced:!0,description:`Responsive image candidate set (e.g. "x.png 1x, y.png 2x")`},{name:`sizes`,type:`string`,required:!1,advanced:!0,description:`Responsive image sizes hint paired with srcset`},{name:`loading`,type:`enum`,enumValues:[`eager`,`lazy`],defaultValue:`lazy`,required:!1,advanced:!0,description:`Native img loading strategy (defaults to lazy)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`decoding`,type:`enum`,enumValues:[`sync`,`async`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,description:`Hint for how the browser should decode the image`},{name:`fetchpriority`,type:`enum`,enumValues:[`high`,`low`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,description:`Resource fetch priority hint`},{name:`crossorigin`,type:`enum`,enumValues:[`anonymous`,`use-credentials`],required:!1,advanced:!0,description:`CORS mode for the image fetch`},{name:`referrerpolicy`,type:`string`,required:!1,advanced:!0,description:`Referrer policy for the image fetch (HTML referrerpolicy values)`}],U0=[{name:`src`,type:`string`,required:!0,description:`Video source URL`,accept:i1,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,description:`Show native HTML5 video controls (defaults to true)`},{name:`autoplay`,type:`boolean`,required:!1,description:`Begin playback as soon as possible (usually requires muted)`},{name:`poster`,type:`string`,required:!1,description:`Poster image URL shown before playback`},{name:`width`,type:`number`,required:!1,description:`Video width`},{name:`height`,type:`number`,required:!1,description:`Video height`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`},{name:`playsinline`,type:`boolean`,required:!1,advanced:!0,description:`Play inline on iOS rather than entering fullscreen`},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the video to preload`}],W0=[{name:`src`,type:`string`,required:!0,description:`Audio source URL`,accept:a1,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,description:`Show native HTML5 audio controls (defaults to true)`},{name:`autoplay`,type:`boolean`,required:!1,description:`Begin playback as soon as possible (usually requires muted)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the audio to preload`}],G0=[{name:`title`,type:`string`,required:!0,description:`Accordion heading shown inside the <summary>`},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!1,description:`When true, the accordion renders expanded on initial load`},{name:`icon`,type:`string`,required:!1,description:"Custom lucide icon override (e.g. `lucide:Rocket`)"},{name:`description`,type:`string`,required:!1,description:`Optional subtitle rendered below the title inside <summary>`},{name:`id`,type:`string`,required:!1,description:"HTML id attribute for deep-linking (e.g. `#advanced-options`)"},{name:`name`,type:`string`,required:!1,description:`HTML5 <details name=> group — siblings with the same name are mutually exclusive`}],K0=[V0[0],V0[1],V0[4],V0[5],V0[6]],q0=[H0[0],H0[1],H0[7]],J0=[G0[0],G0[1],G0[4],G0[5]];function Y0(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function X0(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}var Z0=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:V0,icon:`MessageSquareWarning`,category:`content`,displayName:`Callout`,description:`GFM alert / admonition with 5 type variants (note, tip, important, warning, caution)`,searchTerms:[`note`,`warning`,`tip`,`important`,`caution`,`alert`,`admonition`],serialize:(e,t)=>B0(`Callout`,e,t)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:H0,icon:`ZoomIn`,category:`media`,displayName:`Image`,description:`Image with click-to-zoom and HTML-native attributes`,searchTerms:[`image`,`zoom`,`picture`,`photo`],serialize:(e,t)=>B0(`img`,e,t)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:U0,icon:`Film`,category:`media`,displayName:`Video`,description:`HTML5 video player with native controls`,searchTerms:[`video`,`media`,`player`,`mp4`,`webm`,`movie`],serialize:(e,t)=>B0(`video`,e,t)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:W0,icon:`Volume2`,category:`media`,displayName:`Audio`,description:`HTML5 audio player with native controls`,searchTerms:[`audio`,`sound`,`music`,`mp3`,`podcast`,`player`],serialize:(e,t)=>B0(`audio`,e,t)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:G0,icon:`ChevronRight`,category:`content`,displayName:`Accordion`,description:"Standalone expand/collapse via native HTML5 <details>/<summary>. Group siblings with the `name` prop for exclusive-accordion UX.",searchTerms:[`toggle`,`accordion`,`expandable`,`details`,`disclosure`,`collapse`,`fold`],serialize:(e,t)=>B0(`Accordion`,e,t)},{name:`GFMCallout`,surface:`compat`,hasChildren:!0,props:K0,icon:`MessageSquareWarning`,category:`content`,displayName:`GFM Callout`,description:"GFM blockquote alert (`> [!NOTE]`) — read-only compat. Preserves `> [!NOTE]` syntax on round-trip; insert a fresh Callout block for the full prop surface.",rendersAs:`Callout`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=new Set([`note`,`tip`,`important`,`warning`,`caution`]),i=n?.type??`note`;return{type:`blockquote`,children:[{type:`html`,value:`[!${(r.has(i.toLowerCase())?i:`note`).toUpperCase()}]${n?.collapsible?n.defaultOpen===!1?`-`:`+`:``}${n?.title?` ${n.title}`:``}`},...t.all(e).filter(e=>{if(e.type!==`paragraph`)return!0;let t=e;return Array.isArray(t.children)&&t.children.length>0})]}}},{name:`CommonMarkImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:q0,icon:`ZoomIn`,category:`media`,displayName:`CommonMark Image`,description:'CommonMark image (`![alt](src "title")`) — read-only compat. Preserves `![alt](src)` syntax on round-trip; insert a fresh Image block for the full HTML-native attribute surface (srcset, sizes, decoding, etc.).',rendersAs:`img`,translateProps:e=>e,serialize:e=>{let t=e.attrs.props;return{type:`paragraph`,children:[{type:`image`,url:t?.src??``,alt:t?.alt??``,title:t?.title??null}]}}},{name:`HtmlDetailsAccordion`,surface:`compat`,hasChildren:!0,props:J0,icon:`ChevronRight`,category:`content`,displayName:`HTML5 Details`,description:"HTML5 `<details><summary>` collapsible — read-only compat. Preserves `<details>` syntax on round-trip; insert a fresh Accordion block for icon / description / group-name props.",rendersAs:`Accordion`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=n?.defaultOpen?` open`:``,i=n?.name?` name="${Y0(n.name)}"`:``,a=n?.id?` id="${Y0(n.id)}"`:``,o=n?.title?.trim(),s=o?`<summary>${X0(o)}</summary>`:``;return{type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:[],children:t.all(e),data:{htmlBoundary:{opener:`<details${r}${i}${a}>\n${s}`,closer:`</details>`}}}}}],Q0={name:`*`,surface:`canonical`,hasChildren:!0,props:[],description:`Unregistered component — children editable as markdown`,serialize:(e,t)=>B0(e.attrs.componentName||`*`,e,t)};function $0(){let e=new Map;e.set(`*`,Q0);for(let t of Z0)e.set(t.name,t);return{get(t){return e.get(t)},getOrWildcard(t){return e.get(t)??e.get(`*`)},set(t,n){e.set(t,n)},has(t){return e.has(t)},entries(){return e.entries()}}}var e2={parseFallback:{blockLevel:0,wholeDoc:0},jsxRenderFailure:{},jsxAutoConvertFailed:{},jsxAutoConvertSucceeded:{},jsxPropDropped:{},jsxMoveFailed:{},jsxStuckCopyFailed:{},jsxStuckDeleteFailed:{}};function t2(){e2.parseFallback.blockLevel++}function n2(){e2.parseFallback.wholeDoc++}function r2(e){e2.jsxRenderFailure[e]=(e2.jsxRenderFailure[e]??0)+1}function i2(e){e2.jsxAutoConvertFailed[e]=(e2.jsxAutoConvertFailed[e]??0)+1}function a2(e){e2.jsxAutoConvertSucceeded[e]=(e2.jsxAutoConvertSucceeded[e]??0)+1}function o2(e){e2.jsxPropDropped[e]=(e2.jsxPropDropped[e]??0)+1}function s2(e){e2.jsxMoveFailed[e]=(e2.jsxMoveFailed[e]??0)+1}function c2(e){e2.jsxStuckCopyFailed[e]=(e2.jsxStuckCopyFailed[e]??0)+1}function l2(e){e2.jsxStuckDeleteFailed[e]=(e2.jsxStuckDeleteFailed[e]??0)+1}var u2=/^(`{3,}|~{3,})/gm;function d2(e){let t=[],n=null;for(let r of e.matchAll(u2)){let e=r[1],i=r.index;n?e[0]===n.marker[0]&&e.length>=n.marker.length&&(t.push([n.offset,i+r[0].length]),n=null):n={marker:e,offset:i}}return n&&t.push([n.offset,e.length]),t}function f2(e,t){return t.some(([t,n])=>e>=t&&e<n)}var p2=/^[ \t]{0,3}\[([^\]]+)\]:\s*(\S+)(\s+(?:"[^"]*"|'[^']*'|\([^)]*\)))?\s*$/gm;function m2(e){let t=d2(e),n=[];for(let r of e.matchAll(p2))f2(r.index,t)||n.push(r[0].trimEnd());return n.length>0?`${n.join(`
372
+ `)}]}]}}function N0(e){let t=``;for(let n of e.children)n.type===`text`?t+=n.value??``:n.type===`element`&&(t+=N0(n));return t}var P0=class extends Error{htmlBytes;maxBytes;constructor(e,t){super(`HTML payload (${e} bytes) exceeds htmlToMdast ceiling (${t} bytes); falling through to plain text`),this.name=`HtmlPayloadTooLargeError`,this.htmlBytes=e,this.maxBytes=t}},F0=[$1,y0,q1,c0,H1,O0,p0,w0,i0];function I0(e,t){let n=t?.maxBytes??5242880;if(e.length>n)throw new P0(e.length,n);let r=gJ().use(wz,{fragment:!0});for(let e of F0)r.use(e);for(let e of t?.additionalCleanupPlugins??[])r.use(e);r.use(wH);let i=r.parse(e);return r.runSync(i)}function L0(e){return String(gJ().use(sJ).use(cJ).stringify(e))}function R0(e){let t=Array.isArray(e.attrs.attributes)?e.attrs.attributes.filter(e=>typeof e==`object`&&!!e&&`type`in e):[],n=e.attrs.props??{};for(let[e,r]of Object.entries(n)){let n=t.findIndex(t=>t.type===`mdxJsxAttribute`&&t.name===e),i=z0(e,r);n>=0?t[n]=i:t.push(i)}return t}function z0(e,t){if(t===!0)return{type:`mdxJsxAttribute`,name:e,value:null};if(t===!1)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}};if(t==null)return{type:`mdxJsxAttribute`,name:e,value:null};if(typeof t==`string`)return{type:`mdxJsxAttribute`,name:e,value:t};if(typeof t==`number`)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:JSON.stringify(t)}};if(typeof t==`object`){let n;try{n=JSON.stringify(t)}catch{n=String(t)}return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:n}}}return{type:`mdxJsxAttribute`,name:e,value:String(t)}}function B0(e,t,n){return{type:`mdxJsxFlowElement`,name:e,attributes:R0(t),children:n.all(t),data:{}}}var V0=[{name:`type`,type:`enum`,enumValues:[`note`,`tip`,`important`,`warning`,`caution`],defaultValue:`note`,required:!1,description:`GFM alert variant`},{name:`title`,type:`string`,required:!1,description:`Optional heading shown above the body`},{name:`icon`,type:`string`,required:!1,description:"Custom lucide icon override (e.g. `lucide:Lightbulb`)"},{name:`color`,type:`string`,required:!1,description:"Optional accent color override (hex — e.g. `#F05032`)"},{name:`collapsible`,type:`boolean`,required:!1,defaultValue:!1,description:"Render as a foldable `<details>` (Obsidian `[!TYPE]+/-`)"},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!0,description:`When collapsible, start in the open state`},{name:`children`,type:`reactnode`,required:!0,description:`Callout content`}],H0=[{name:`src`,type:`string`,required:!0,description:`Image source URL`,accept:r1,autoFocus:!0},{name:`alt`,type:`string`,required:!1,defaultValue:``,description:`Alt text`},{name:`width`,type:`number`,required:!1,description:`Image width`},{name:`height`,type:`number`,required:!1,description:`Image height`},{name:`srcset`,type:`string`,required:!1,advanced:!0,description:`Responsive image candidate set (e.g. "x.png 1x, y.png 2x")`},{name:`sizes`,type:`string`,required:!1,advanced:!0,description:`Responsive image sizes hint paired with srcset`},{name:`loading`,type:`enum`,enumValues:[`eager`,`lazy`],defaultValue:`lazy`,required:!1,advanced:!0,description:`Native img loading strategy (defaults to lazy)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`decoding`,type:`enum`,enumValues:[`sync`,`async`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,description:`Hint for how the browser should decode the image`},{name:`fetchpriority`,type:`enum`,enumValues:[`high`,`low`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,description:`Resource fetch priority hint`},{name:`crossorigin`,type:`enum`,enumValues:[`anonymous`,`use-credentials`],required:!1,advanced:!0,description:`CORS mode for the image fetch`},{name:`referrerpolicy`,type:`string`,required:!1,advanced:!0,description:`Referrer policy for the image fetch (HTML referrerpolicy values)`}],U0=[{name:`src`,type:`string`,required:!0,description:`Video source URL`,accept:i1,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,description:`Show native HTML5 video controls (defaults to true)`},{name:`autoplay`,type:`boolean`,required:!1,description:`Begin playback as soon as possible (usually requires muted)`},{name:`poster`,type:`string`,required:!1,description:`Poster image URL shown before playback`},{name:`width`,type:`number`,required:!1,description:`Video width`},{name:`height`,type:`number`,required:!1,description:`Video height`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`},{name:`playsinline`,type:`boolean`,required:!1,advanced:!0,description:`Play inline on iOS rather than entering fullscreen`},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the video to preload`}],W0=[{name:`src`,type:`string`,required:!0,description:`Audio source URL`,accept:a1,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,description:`Show native HTML5 audio controls (defaults to true)`},{name:`autoplay`,type:`boolean`,required:!1,description:`Begin playback as soon as possible (usually requires muted)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the audio to preload`}],G0=[{name:`title`,type:`string`,required:!0,description:`Accordion heading shown inside the <summary>`},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!1,description:`When true, the accordion renders expanded on initial load`},{name:`icon`,type:`string`,required:!1,description:"Custom lucide icon override (e.g. `lucide:Rocket`)"},{name:`description`,type:`string`,required:!1,description:`Optional subtitle rendered below the title inside <summary>`},{name:`id`,type:`string`,required:!1,description:"HTML id attribute for deep-linking (e.g. `#advanced-options`)"},{name:`name`,type:`string`,required:!1,description:`HTML5 <details name=> group — siblings with the same name are mutually exclusive`}],K0=[V0[0],V0[1],V0[4],V0[5],V0[6]],q0=[H0[0],H0[1],H0[7]],J0=[G0[0],G0[1],G0[4],G0[5]];function Y0(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function X0(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}var Z0=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:V0,icon:`MessageSquareWarning`,category:`content`,displayName:`Callout`,description:`GFM alert / admonition with 5 type variants (note, tip, important, warning, caution)`,searchTerms:[`note`,`warning`,`tip`,`important`,`caution`,`alert`,`admonition`],serialize:(e,t)=>B0(`Callout`,e,t)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:H0,icon:`Image`,category:`media`,displayName:`Image`,description:`Image with click-to-zoom and HTML-native attributes`,searchTerms:[`image`,`zoom`,`picture`,`photo`],serialize:(e,t)=>B0(`img`,e,t)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:U0,icon:`SquarePlay`,category:`media`,displayName:`Video`,description:`HTML5 video player with native controls`,searchTerms:[`video`,`media`,`player`,`mp4`,`webm`,`movie`],serialize:(e,t)=>B0(`video`,e,t)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:W0,icon:`Volume2`,category:`media`,displayName:`Audio`,description:`HTML5 audio player with native controls`,searchTerms:[`audio`,`sound`,`music`,`mp3`,`podcast`,`player`],serialize:(e,t)=>B0(`audio`,e,t)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:G0,icon:`ChevronRight`,category:`content`,displayName:`Accordion`,description:"Standalone expand/collapse via native HTML5 <details>/<summary>. Group siblings with the `name` prop for exclusive-accordion UX.",searchTerms:[`toggle`,`accordion`,`expandable`,`details`,`disclosure`,`collapse`,`fold`],serialize:(e,t)=>B0(`Accordion`,e,t)},{name:`GFMCallout`,surface:`compat`,hasChildren:!0,props:K0,icon:`MessageSquareWarning`,category:`content`,displayName:`GFM Callout`,description:"GFM blockquote alert (`> [!NOTE]`) — read-only compat. Preserves `> [!NOTE]` syntax on round-trip; insert a fresh Callout block for the full prop surface.",rendersAs:`Callout`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=new Set([`note`,`tip`,`important`,`warning`,`caution`]),i=n?.type??`note`;return{type:`blockquote`,children:[{type:`html`,value:`[!${(r.has(i.toLowerCase())?i:`note`).toUpperCase()}]${n?.collapsible?n.defaultOpen===!1?`-`:`+`:``}${n?.title?` ${n.title}`:``}`},...t.all(e).filter(e=>{if(e.type!==`paragraph`)return!0;let t=e;return Array.isArray(t.children)&&t.children.length>0})]}}},{name:`CommonMarkImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:q0,icon:`Image`,category:`media`,displayName:`CommonMark Image`,description:'CommonMark image (`![alt](src "title")`) — read-only compat. Preserves `![alt](src)` syntax on round-trip; insert a fresh Image block for the full HTML-native attribute surface (srcset, sizes, decoding, etc.).',rendersAs:`img`,translateProps:e=>e,serialize:e=>{let t=e.attrs.props;return{type:`paragraph`,children:[{type:`image`,url:t?.src??``,alt:t?.alt??``,title:t?.title??null}]}}},{name:`HtmlDetailsAccordion`,surface:`compat`,hasChildren:!0,props:J0,icon:`ChevronRight`,category:`content`,displayName:`HTML5 Details`,description:"HTML5 `<details><summary>` collapsible — read-only compat. Preserves `<details>` syntax on round-trip; insert a fresh Accordion block for icon / description / group-name props.",rendersAs:`Accordion`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=n?.defaultOpen?` open`:``,i=n?.name?` name="${Y0(n.name)}"`:``,a=n?.id?` id="${Y0(n.id)}"`:``,o=n?.title?.trim(),s=o?`<summary>${X0(o)}</summary>`:``;return{type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:[],children:t.all(e),data:{htmlBoundary:{opener:`<details${r}${i}${a}>\n${s}`,closer:`</details>`}}}}}],Q0={name:`*`,surface:`canonical`,hasChildren:!0,props:[],description:`Unregistered component — children editable as markdown`,serialize:(e,t)=>B0(e.attrs.componentName||`*`,e,t)};function $0(){let e=new Map;e.set(`*`,Q0);for(let t of Z0)e.set(t.name,t);return{get(t){return e.get(t)},getOrWildcard(t){return e.get(t)??e.get(`*`)},set(t,n){e.set(t,n)},has(t){return e.has(t)},entries(){return e.entries()}}}var e2={parseFallback:{blockLevel:0,wholeDoc:0},jsxRenderFailure:{},jsxAutoConvertFailed:{},jsxAutoConvertSucceeded:{},jsxPropDropped:{},jsxMoveFailed:{},jsxStuckCopyFailed:{},jsxStuckDeleteFailed:{}};function t2(){e2.parseFallback.blockLevel++}function n2(){e2.parseFallback.wholeDoc++}function r2(e){e2.jsxRenderFailure[e]=(e2.jsxRenderFailure[e]??0)+1}function i2(e){e2.jsxAutoConvertFailed[e]=(e2.jsxAutoConvertFailed[e]??0)+1}function a2(e){e2.jsxAutoConvertSucceeded[e]=(e2.jsxAutoConvertSucceeded[e]??0)+1}function o2(e){e2.jsxPropDropped[e]=(e2.jsxPropDropped[e]??0)+1}function s2(e){e2.jsxMoveFailed[e]=(e2.jsxMoveFailed[e]??0)+1}function c2(e){e2.jsxStuckCopyFailed[e]=(e2.jsxStuckCopyFailed[e]??0)+1}function l2(e){e2.jsxStuckDeleteFailed[e]=(e2.jsxStuckDeleteFailed[e]??0)+1}var u2=/^(`{3,}|~{3,})/gm;function d2(e){let t=[],n=null;for(let r of e.matchAll(u2)){let e=r[1],i=r.index;n?e[0]===n.marker[0]&&e.length>=n.marker.length&&(t.push([n.offset,i+r[0].length]),n=null):n={marker:e,offset:i}}return n&&t.push([n.offset,e.length]),t}function f2(e,t){return t.some(([t,n])=>e>=t&&e<n)}var p2=/^[ \t]{0,3}\[([^\]]+)\]:\s*(\S+)(\s+(?:"[^"]*"|'[^']*'|\([^)]*\)))?\s*$/gm;function m2(e){let t=d2(e),n=[];for(let r of e.matchAll(p2))f2(r.index,t)||n.push(r[0].trimEnd());return n.length>0?`${n.join(`
373
373
  `)}\n\n`:``}var h2=500,g2=1e3;function _2(e,t){let n={startMs:typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),calls:0};return x2(e,t.parse,0,n)}function v2(e){return e.calls>=g2?!0:(typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now())-e.startMs>=h2}var y2=500;function b2(e){return e instanceof Error?{name:e.name,message:e.message.slice(0,y2),stack:e.stack?.split(`
374
374
  `).slice(0,4).join(`
375
375
  `)}:{name:`UnknownError`,message:String(e??`unknown`).slice(0,y2)}}function x2(e,t,n,r){if(n>20)return n2(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`MAX_SPLIT_DEPTH exceeded`})),j2(e);if(r){if(v2(r))return n2(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`parse budget exhausted`,calls:r.calls})),j2(e);r.calls+=1}try{return t(e)}catch(i){let a=S2(i),o=b2(i);if(a===void 0){if(n===0){let n=A2(e,t,i,r);if(n)return n}return n2(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:o.message,error:o})),j2(e)}t2(),console.warn(JSON.stringify({event:`mdx-block-fallback`,offset:a,reason:o.message,error:o}));try{let i=O2(e,a),s=e.slice(0,i.start),c=e.slice(i.start,i.end),l=e.slice(i.end),u=s.trim()?x2(s,t,n+1,r):{type:`doc`,content:[]},d=l.trim()?x2(m2(s)+l,t,n+1,r):{type:`doc`,content:[]},f={type:`rawMdxFallback`,attrs:{reason:o.message,originalSpan:{start:i.start,end:i.end}},content:c?[{type:`text`,text:c}]:[]},p=[...u.content??[],f,...d.content??[]];return{type:`doc`,content:p.length>0?p:[{type:`paragraph`,content:[]}]}}catch(t){n2();let n=b2(t);return console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`Recovery failed: ${n.message}`,recoveryPath:`block-split-then-rejoin`,error:n,originalError:o})),j2(e)}}}function S2(e){if(!e||typeof e!=`object`)return;let t=e;if(t.place&&typeof t.place.offset==`number`)return t.place.offset;if(t.place?.start&&typeof t.place.start.offset==`number`)return t.place.start.offset;if(t.position&&typeof t.position.offset==`number`)return t.position.offset;if(t.position?.start&&typeof t.position.start.offset==`number`)return t.position.start.offset}function C2(e,t){let n=/\n\s*\n/g,r=null;for(let i of e.matchAll(n)){if(i.index>=t)break;r=i.index+i[0].length}return r}function w2(e,t){for(let n of e.matchAll(/\n\s*\n/g))if(n.index>=t)return n.index;return null}var T2=32*1024;function E2(e,t){let n=[];for(let r of e.matchAll(/<(\/?)([A-Z][A-Za-z0-9.]*)/g)){let i=r.index;if(f2(i,t))continue;let a=r[1]===`/`,o=r[2],s=i+r[0].length,c=Math.min(e.length,s+T2),l=!1,u=0,d=-1,f=!1;for(let t=s;t<c;t++){let n=e[t];if(l){n===`"`&&(l=!1),n===`\\`&&t+1<c&&t++;continue}if(n===`"`){l=!0;continue}if(n===`{`){u++;continue}if(n===`}`&&u>0){u--;continue}if(!(u>0)&&n===`>`){d=t,t>0&&e[t-1]===`/`&&(f=!0);break}}if(d===-1)continue;let p=d+1;a?n.push({kind:`close`,name:o,start:i,end:p}):f?n.push({kind:`self-close`,name:o,start:i,end:p}):n.push({kind:`open`,name:o,start:i,end:p})}return n}function D2(e){let t=E2(e,d2(e)),n=[],r=[];for(let i of t){if(i.kind===`self-close`)continue;if(i.kind===`open`){n.push(i);continue}let t=-1;for(let e=n.length-1;e>=0;e--)if(n[e].name===i.name){t=e;break}if(t!==-1){for(let a=n.length-1;a>t;a--){let t=n[a],o=w2(e,t.start)??e.length;r.push({start:t.start,end:Math.min(i.start,o),source:`unmatched`})}r.push({start:n[t].start,end:i.end,source:`pair`}),n.length=t}}for(let t of n){let n=w2(e,t.start)??e.length;r.push({start:t.start,end:Math.min(e.length,n),source:`unmatched`})}return r}function O2(e,t){let n=D2(e),r=null;for(let e of n)e.start<=t&&t<=e.end&&(!r||e.end-e.start<r.end-r.start)&&(r=e);return r?{start:r.start,end:r.end}:{start:C2(e,t)??0,end:w2(e,t)??e.length}}function k2(e){let t=d2(e),n=/\n[ \t]*\n/g,r=[0];for(let i of e.matchAll(n)){let e=i.index;f2(e,t)||r.push(e+i[0].length)}r.push(e.length);let i=[];for(let t=0;t<r.length-1;t++){let n=r[t],a=r[t+1];if(a<=n)continue;let o=e.slice(n,a);o.trim()&&i.push({src:o,start:n,end:a})}return i}function A2(e,t,n,r){let i=k2(e);if(i.length<2)return null;let a=[],o=!1,s=``;for(let e of i){if(r&&v2(r))break;r&&(r.calls+=1);let i=s+e.src;try{let n=t(i).content??[];s+=m2(e.src);let r=n.filter(e=>e.type!==`paragraph`||Array.isArray(e.content)&&e.content.length>0);if(r.length===0&&n.length>0){o=!0;continue}a.push(...r),o=!0}catch(t){t2();let r=t?.message?.slice(0,200)??`unknown block error`,i=n?.message?.slice(0,160)??`unknown`;console.warn(JSON.stringify({event:`mdx-block-fallback`,offset:e.start,reason:`Per-block recovery after position-less error: ${i}`,blockError:r,blockErrorName:t?.name})),a.push({type:`rawMdxFallback`,attrs:{reason:r,originalSpan:{start:e.start,end:e.end}},content:[{type:`text`,text:e.src}]})}}return o?{type:`doc`,content:a.length>0?a:[{type:`paragraph`,content:[]}]}:null}function j2(e){return{type:`doc`,content:[{type:`paragraph`,content:[{type:`text`,text:e}]}]}}var M2=``,N2=``,P2=``,F2=``,I2=``,L2=/<([a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>]+)>/g,R2=/<!--[\s\S]*?-->/g,z2=/<\/([a-z][a-z0-9]*)\s*>/g,B2=/<([a-z][a-z0-9]*)(\s[^>]*)?\/?>/g,V2=new Set([`img`,`video`,`audio`]),H2=/<\/([A-Z][A-Za-z0-9.]*)>/g;function U2(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>>1;e[i]<t?n=i+1:r=i}return n}function W2(e){let t=new Map,n=new RegExp(H2.source,`g`),r=n.exec(e);for(;r!==null;){let i=t.get(r[1]);i?i.push(r.index):t.set(r[1],[r.index]),r=n.exec(e)}return t}function G2(e){let t=[],n=/\n\s*\n/g,r=n.exec(e);for(;r!==null;)t.push(r.index),r=n.exec(e);return t}function K2(e){let t=[],n=e.indexOf(`/>`);for(;n!==-1;)t.push(n),n=e.indexOf(`/>`,n+2);return t}function q2(e){let t=e;t=t.replace(R2,e=>e.replace(/</g,M2).replace(/>/g,N2)),t=t.replace(L2,(e,t)=>`${M2}${t.replaceAll(`:`,P2).replaceAll(`@`,F2)}${N2}`),t=t.replace(z2,e=>e.replace(/</g,M2).replace(/>/g,N2)),t=t.replace(B2,(e,t)=>V2.has(t)&&e.endsWith(`/>`)?e:t[0]===t[0].toLowerCase()&&t[0]!==t[0].toUpperCase()?e.replace(/</g,M2).replace(/>/g,N2):e),t=t.replace(/<>/g,`${M2}${N2}`);let n=W2(t),r=G2(t),i=K2(t);t=t.replace(/</g,(e,a)=>{let o=t.slice(a,a+256);if(o[1]===`/`)return/^<\/[a-zA-Z][a-zA-Z0-9.]*[ \t]*>/.test(o)?e:M2;let s=/^<([a-z][a-z0-9]*)([^>]*)\/>/.exec(o);if(s&&V2.has(s[1]))return e;let c=/^<([A-Z][a-zA-Z0-9.]*)[\s/>]/.exec(o);if(!c)return M2;let l=c[1],u=U2(r,a),d=U2(i,u<r.length?r[u]:t.length);if(d>0){let n=i[d-1];if(n>a){let r=a+c[0].length-1;if(!t.slice(r,n).replace(/"[^"]*"|'[^']*'/g,``).includes(`/`))return e}}let f=n.get(l);return f&&U2(f,a)<f.length?e:M2});{let e=[],n=[];for(let r=0;r<t.length;r++){if(t[r]===`
@@ -1 +1 @@
1
- import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./compiler-runtime-Y11fyRVL.js";import{_n as i,gn as a,hn as o,mn as s,pn as c}from"./toggle-group-DIb9bLBj.js";import{_ as l,c as u,f as d,i as f,n as p,o as ee,p as m,r as h,s as g,u as _,y as v}from"./button-CXhPNzpp.js";var y=e(t(),1),b=n(),x=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),S=`VisuallyHidden`,C=y.forwardRef((e,t)=>(0,b.jsx)(m.span,{...e,ref:t,style:{...x,...e.style}}));C.displayName=S;var w=C,[T,E]=d(`Tooltip`,[i]),D=i(),O=`TooltipProvider`,k=700,A=`tooltip.open`,[te,j]=T(O),M=e=>{let{__scopeTooltip:t,delayDuration:n=k,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=y.useRef(!0),s=y.useRef(!1),c=y.useRef(0);return y.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,b.jsx)(te,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:y.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:y.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:y.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};M.displayName=O;var N=`Tooltip`,[P,F]=T(N),I=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:o,disableHoverableContent:s,delayDuration:c}=e,l=j(N,e.__scopeTooltip),d=D(t),[f,p]=y.useState(null),m=ee(),h=y.useRef(0),g=s??l.disableHoverableContent,_=c??l.delayDuration,v=y.useRef(!1),[x,S]=u({prop:r,defaultProp:i??!1,onChange:e=>{e?(l.onOpen(),document.dispatchEvent(new CustomEvent(A))):l.onClose(),o?.(e)},caller:N}),C=y.useMemo(()=>x?v.current?`delayed-open`:`instant-open`:`closed`,[x]),w=y.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,S(!0)},[S]),T=y.useCallback(()=>{window.clearTimeout(h.current),h.current=0,S(!1)},[S]),E=y.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,S(!0),h.current=0},_)},[_,S]);return y.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]),(0,b.jsx)(a,{...d,children:(0,b.jsx)(P,{scope:t,contentId:m,open:x,stateAttribute:C,trigger:f,onTriggerChange:p,onTriggerEnter:y.useCallback(()=>{l.isOpenDelayedRef.current?E():w()},[l.isOpenDelayedRef,E,w]),onTriggerLeave:y.useCallback(()=>{g?T():(window.clearTimeout(h.current),h.current=0)},[T,g]),onOpen:w,onClose:T,disableHoverableContent:g,children:n})})};I.displayName=N;var L=`TooltipTrigger`,R=y.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=F(L,n),a=j(L,n),o=D(n),s=v(t,y.useRef(null),i.onTriggerChange),l=y.useRef(!1),u=y.useRef(!1),d=y.useCallback(()=>l.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener(`pointerup`,d),[d]),(0,b.jsx)(c,{asChild:!0,...o,children:(0,b.jsx)(m.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:_(e.onPointerMove,e=>{e.pointerType!==`touch`&&!u.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:_(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:_(e.onPointerDown,()=>{i.open&&i.onClose(),l.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:_(e.onFocus,()=>{l.current||i.onOpen()}),onBlur:_(e.onBlur,i.onClose),onClick:_(e.onClick,i.onClose)})})});R.displayName=L;var z=`TooltipPortal`,[B,V]=T(z,{forceMount:void 0}),H=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=F(z,t);return(0,b.jsx)(B,{scope:t,forceMount:n,children:(0,b.jsx)(g,{present:n||a.open,children:(0,b.jsx)(h,{asChild:!0,container:i,children:r})})})};H.displayName=z;var U=`TooltipContent`,W=y.forwardRef((e,t)=>{let n=V(U,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=F(U,e.__scopeTooltip);return(0,b.jsx)(g,{present:r||o.open,children:o.disableHoverableContent?(0,b.jsx)(Y,{side:i,...a,ref:t}):(0,b.jsx)(G,{side:i,...a,ref:t})})}),G=y.forwardRef((e,t)=>{let n=F(U,e.__scopeTooltip),r=j(U,e.__scopeTooltip),i=y.useRef(null),a=v(t,i),[o,s]=y.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=y.useCallback(()=>{s(null),d(!1)},[d]),p=y.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=re(r,ne(r,n.getBoundingClientRect())),a=ie(t.getBoundingClientRect());s(oe([...i,...a])),d(!0)},[d]);return y.useEffect(()=>()=>f(),[f]),y.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),y.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!ae(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,b.jsx)(Y,{...e,ref:a})}),[K,q]=T(N,{isInside:!1}),J=l(`TooltipContent`),Y=y.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:s,...c}=e,l=F(U,n),u=D(n),{onClose:d}=l;return y.useEffect(()=>(document.addEventListener(A,d),()=>document.removeEventListener(A,d)),[d]),y.useEffect(()=>{if(l.trigger){let e=e=>{e.target?.contains(l.trigger)&&d()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]),(0,b.jsx)(f,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,b.jsxs)(o,{"data-state":l.stateAttribute,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,b.jsx)(J,{children:r}),(0,b.jsx)(K,{scope:n,isInside:!0,children:(0,b.jsx)(w,{id:l.contentId,role:`tooltip`,children:i||r})})]})})});W.displayName=U;var X=`TooltipArrow`,Z=y.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=D(n);return q(X,n).isInside?null:(0,b.jsx)(s,{...i,...r,ref:t})});Z.displayName=X;function ne(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function re(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function ie(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function ae(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function oe(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),se(t)}function se(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Q=M,ce=I,le=R,ue=H,de=W,fe=Z,$=r();function pe(e){let t=(0,$.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({delayDuration:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let i=r===void 0?0:r,a;return t[3]!==i||t[4]!==n?(a=(0,b.jsx)(Q,{"data-slot":`tooltip-provider`,delayDuration:i,...n}),t[3]=i,t[4]=n,t[5]=a):a=t[5],a}function me(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,b.jsx)(ce,{"data-slot":`tooltip`,...n}),t[2]=n,t[3]=r),r}function he(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,b.jsx)(le,{"data-slot":`tooltip-trigger`,...n}),t[2]=n,t[3]=r),r}function ge(e){let t=(0,$.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,sideOffset:a,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?0:a,s;t[5]===r?s=t[6]:(s=p(`z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,r),t[5]=r,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,b.jsx)(fe,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`}),t[7]=c):c=t[7];let l;return t[8]!==n||t[9]!==i||t[10]!==o||t[11]!==s?(l=(0,b.jsx)(ue,{children:(0,b.jsxs)(de,{"data-slot":`tooltip-content`,sideOffset:o,className:s,...i,children:[n,c]})}),t[8]=n,t[9]=i,t[10]=o,t[11]=s,t[12]=l):l=t[12],l}export{he as i,ge as n,pe as r,me as t};
1
+ import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./compiler-runtime-Y11fyRVL.js";import{_n as i,gn as a,hn as o,mn as s,pn as c}from"./toggle-group-Czy0P9Ee.js";import{_ as l,c as u,f as d,i as f,n as p,o as ee,p as m,r as h,s as g,u as _,y as v}from"./button-CXhPNzpp.js";var y=e(t(),1),b=n(),x=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),S=`VisuallyHidden`,C=y.forwardRef((e,t)=>(0,b.jsx)(m.span,{...e,ref:t,style:{...x,...e.style}}));C.displayName=S;var w=C,[T,E]=d(`Tooltip`,[i]),D=i(),O=`TooltipProvider`,k=700,A=`tooltip.open`,[te,j]=T(O),M=e=>{let{__scopeTooltip:t,delayDuration:n=k,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=y.useRef(!0),s=y.useRef(!1),c=y.useRef(0);return y.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,b.jsx)(te,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:y.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:y.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:y.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};M.displayName=O;var N=`Tooltip`,[P,F]=T(N),I=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:o,disableHoverableContent:s,delayDuration:c}=e,l=j(N,e.__scopeTooltip),d=D(t),[f,p]=y.useState(null),m=ee(),h=y.useRef(0),g=s??l.disableHoverableContent,_=c??l.delayDuration,v=y.useRef(!1),[x,S]=u({prop:r,defaultProp:i??!1,onChange:e=>{e?(l.onOpen(),document.dispatchEvent(new CustomEvent(A))):l.onClose(),o?.(e)},caller:N}),C=y.useMemo(()=>x?v.current?`delayed-open`:`instant-open`:`closed`,[x]),w=y.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,S(!0)},[S]),T=y.useCallback(()=>{window.clearTimeout(h.current),h.current=0,S(!1)},[S]),E=y.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,S(!0),h.current=0},_)},[_,S]);return y.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]),(0,b.jsx)(a,{...d,children:(0,b.jsx)(P,{scope:t,contentId:m,open:x,stateAttribute:C,trigger:f,onTriggerChange:p,onTriggerEnter:y.useCallback(()=>{l.isOpenDelayedRef.current?E():w()},[l.isOpenDelayedRef,E,w]),onTriggerLeave:y.useCallback(()=>{g?T():(window.clearTimeout(h.current),h.current=0)},[T,g]),onOpen:w,onClose:T,disableHoverableContent:g,children:n})})};I.displayName=N;var L=`TooltipTrigger`,R=y.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=F(L,n),a=j(L,n),o=D(n),s=v(t,y.useRef(null),i.onTriggerChange),l=y.useRef(!1),u=y.useRef(!1),d=y.useCallback(()=>l.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener(`pointerup`,d),[d]),(0,b.jsx)(c,{asChild:!0,...o,children:(0,b.jsx)(m.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:_(e.onPointerMove,e=>{e.pointerType!==`touch`&&!u.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:_(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:_(e.onPointerDown,()=>{i.open&&i.onClose(),l.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:_(e.onFocus,()=>{l.current||i.onOpen()}),onBlur:_(e.onBlur,i.onClose),onClick:_(e.onClick,i.onClose)})})});R.displayName=L;var z=`TooltipPortal`,[B,V]=T(z,{forceMount:void 0}),H=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=F(z,t);return(0,b.jsx)(B,{scope:t,forceMount:n,children:(0,b.jsx)(g,{present:n||a.open,children:(0,b.jsx)(h,{asChild:!0,container:i,children:r})})})};H.displayName=z;var U=`TooltipContent`,W=y.forwardRef((e,t)=>{let n=V(U,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=F(U,e.__scopeTooltip);return(0,b.jsx)(g,{present:r||o.open,children:o.disableHoverableContent?(0,b.jsx)(Y,{side:i,...a,ref:t}):(0,b.jsx)(G,{side:i,...a,ref:t})})}),G=y.forwardRef((e,t)=>{let n=F(U,e.__scopeTooltip),r=j(U,e.__scopeTooltip),i=y.useRef(null),a=v(t,i),[o,s]=y.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=y.useCallback(()=>{s(null),d(!1)},[d]),p=y.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=re(r,ne(r,n.getBoundingClientRect())),a=ie(t.getBoundingClientRect());s(oe([...i,...a])),d(!0)},[d]);return y.useEffect(()=>()=>f(),[f]),y.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),y.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!ae(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,b.jsx)(Y,{...e,ref:a})}),[K,q]=T(N,{isInside:!1}),J=l(`TooltipContent`),Y=y.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:s,...c}=e,l=F(U,n),u=D(n),{onClose:d}=l;return y.useEffect(()=>(document.addEventListener(A,d),()=>document.removeEventListener(A,d)),[d]),y.useEffect(()=>{if(l.trigger){let e=e=>{e.target?.contains(l.trigger)&&d()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]),(0,b.jsx)(f,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,b.jsxs)(o,{"data-state":l.stateAttribute,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,b.jsx)(J,{children:r}),(0,b.jsx)(K,{scope:n,isInside:!0,children:(0,b.jsx)(w,{id:l.contentId,role:`tooltip`,children:i||r})})]})})});W.displayName=U;var X=`TooltipArrow`,Z=y.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=D(n);return q(X,n).isInside?null:(0,b.jsx)(s,{...i,...r,ref:t})});Z.displayName=X;function ne(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function re(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function ie(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function ae(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function oe(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),se(t)}function se(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Q=M,ce=I,le=R,ue=H,de=W,fe=Z,$=r();function pe(e){let t=(0,$.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({delayDuration:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let i=r===void 0?0:r,a;return t[3]!==i||t[4]!==n?(a=(0,b.jsx)(Q,{"data-slot":`tooltip-provider`,delayDuration:i,...n}),t[3]=i,t[4]=n,t[5]=a):a=t[5],a}function me(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,b.jsx)(ce,{"data-slot":`tooltip`,...n}),t[2]=n,t[3]=r),r}function he(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,b.jsx)(le,{"data-slot":`tooltip-trigger`,...n}),t[2]=n,t[3]=r),r}function ge(e){let t=(0,$.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,sideOffset:a,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?0:a,s;t[5]===r?s=t[6]:(s=p(`z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,r),t[5]=r,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,b.jsx)(fe,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`}),t[7]=c):c=t[7];let l;return t[8]!==n||t[9]!==i||t[10]!==o||t[11]!==s?(l=(0,b.jsx)(ue,{children:(0,b.jsxs)(de,{"data-slot":`tooltip-content`,sideOffset:o,className:s,...i,children:[n,c]})}),t[8]=n,t[9]=i,t[10]=o,t[11]=s,t[12]=l):l=t[12],l}export{he as i,ge as n,pe as r,me as t};
@@ -20,7 +20,7 @@
20
20
  nothing for the formatter to reindent.
21
21
  -->
22
22
  <script>(() => { let mode = 'wysiwyg'; try { const raw = localStorage.getItem('ok-editor-mode-v1'); if (raw === 'wysiwyg' || raw === 'source') mode = raw; } catch {} window.__OK_EDITOR_MODE__ = mode; })();</script>
23
- <script type="module" crossorigin src="./assets/index-Dcw_lEA0.js"></script>
23
+ <script type="module" crossorigin src="./assets/index-BSJSvPoC.js"></script>
24
24
  <link rel="modulepreload" crossorigin href="./assets/chunk-DECur_0Z.js">
25
25
  <link rel="modulepreload" crossorigin href="./assets/trace-api-CbLDdnQA.js">
26
26
  <link rel="modulepreload" crossorigin href="./assets/propagation-api-LnD10wq2.js">
@@ -29,18 +29,19 @@
29
29
  <link rel="modulepreload" crossorigin href="./assets/dist-oNAFjGrp.js">
30
30
  <link rel="modulepreload" crossorigin href="./assets/compiler-runtime-Y11fyRVL.js">
31
31
  <link rel="modulepreload" crossorigin href="./assets/button-CXhPNzpp.js">
32
- <link rel="modulepreload" crossorigin href="./assets/toggle-group-DIb9bLBj.js">
32
+ <link rel="modulepreload" crossorigin href="./assets/toggle-group-Czy0P9Ee.js">
33
33
  <link rel="modulepreload" crossorigin href="./assets/dist-RVD4DzGH.js">
34
34
  <link rel="modulepreload" crossorigin href="./assets/dialog-CJazZw1E.js">
35
- <link rel="modulepreload" crossorigin href="./assets/DocumentContext-B-H7z2mx.js">
35
+ <link rel="modulepreload" crossorigin href="./assets/DocumentContext-B1Fp4JCg.js">
36
36
  <link rel="modulepreload" crossorigin href="./assets/panel-DiSt1efw.js">
37
- <link rel="modulepreload" crossorigin href="./assets/clipboard-CmwParkX.js">
38
- <link rel="modulepreload" crossorigin href="./assets/tooltip-CRxi5gOu.js">
37
+ <link rel="modulepreload" crossorigin href="./assets/clipboard-DcNdBOCD.js">
38
+ <link rel="modulepreload" crossorigin href="./assets/tooltip-Dqn5ly4m.js">
39
39
  <link rel="modulepreload" crossorigin href="./assets/agent-presence-XtMgnv3n.js">
40
40
  <link rel="modulepreload" crossorigin href="./assets/circle-check-bKAq6pcI.js">
41
- <link rel="modulepreload" crossorigin href="./assets/config-validation-events-CHBXJot6.js">
42
- <link rel="modulepreload" crossorigin href="./assets/target-navigation-intent-7XRXuzFn.js">
43
- <link rel="stylesheet" crossorigin href="./assets/index-uXLRXDYd.css">
41
+ <link rel="modulepreload" crossorigin href="./assets/config-validation-events-CpU7XuBS.js">
42
+ <link rel="modulepreload" crossorigin href="./assets/target-navigation-intent-BgBCKYrO.js">
43
+ <link rel="modulepreload" crossorigin href="./assets/mcp-consent-store-BBTXqzE6.js">
44
+ <link rel="stylesheet" crossorigin href="./assets/index-C5vN2roo.css">
44
45
  </head>
45
46
 
46
47
  <body class="antialiased">
@@ -1,3 +1,3 @@
1
- import{$ as e,Lt as t,Q as n,X as r,Y as i,et as a,it as o,nt as s,rt as c,tt as l}from"./dist-BGmJPYOc.mjs";import{dirname as u,isAbsolute as d,resolve as f}from"node:path";import{existsSync as p,readFileSync as m,renameSync as h,unlinkSync as g}from"node:fs";import{homedir as _}from"node:os";import{mkdir as v,rename as y,writeFile as b}from"node:fs/promises";var x=t();function S(e){return`https://unpkg.com/@inkeep/open-knowledge@latest/dist/schemas/${i}/${e===`user`?`config.user.schema.json`:`config.workspace.schema.json`}`}function C(e){return`# yaml-language-server: $schema=${S(e)}\n`}function w(e,t,r){return f(e===`user`?r??_():d(t)?t:f(t),n,`config.yml`)}function T(e){return{ok:!1,error:e}}function E(e){return{ok:!0,...e}}async function D(e,t){let n=`${e}.tmp.${crypto.randomUUID()}`;try{await b(n,t,{encoding:`utf-8`,mode:420}),await y(n,e)}catch(e){try{g(n)}catch{}throw e}}async function O(e){return c(`config.patch`,{"config.scope":e.scope,"config.transport":`fs`},async t=>{let n=await k(e);return t.setAttribute(`config.outcome`,n.ok?`success`:`rejected`),n.ok||t.setAttribute(`config.error.code`,n.error.code),n})}async function k(t){let{cwd:n,scope:i,patch:c,homedirOverride:l,firstWriteHeader:d}=t,f=w(i,n,l),h=``,g=!1;if(p(f)){g=!0;try{h=m(f,`utf-8`)}catch(e){return T({code:`WRITE_ERROR`,detail:`Could not read existing config: ${e instanceof Error?e.message:String(e)}`})}}let _=(0,x.parseDocument)(h);if(_.errors.length>0)return T({code:`YAML_PARSE`,detail:_.errors.map(e=>e.message).join(`; `)});if(_.contents===null)_.contents=_.createNode({});else if(!(0,x.isMap)(_.contents))return T({code:`YAML_PARSE`,detail:`Top-level YAML value must be a mapping (object), got ${(0,x.isSeq)(_.contents)?`sequence`:`scalar`}`});let y=a(_,c),b=_.toJSON(),S=o(`config.validate`,{"config.scope":i,"config.validation.layer":`L2`},t=>{let n=r.safeParse(b);if(t.setAttribute(`config.outcome`,n.success?`success`:`rejected`),!n.success)for(let t of n.error.issues)e(`config.validation.issue`,{"issue.path":t.path.map(e=>String(e)).join(`.`),"issue.message":t.message});return n});if(!S.success)return T({code:`SCHEMA_INVALID`,issues:S.error.issues.map(s)});let O=_.toString();if(!g){let e=d===void 0?C(i):d??``;e.length>0&&(O=`${e.endsWith(`
1
+ import{$ as e,Lt as t,Q as n,X as r,Y as i,et as a,it as o,nt as s,rt as c,tt as l}from"./dist-BAXWuYIZ.mjs";import{dirname as u,isAbsolute as d,resolve as f}from"node:path";import{existsSync as p,readFileSync as m,renameSync as h,unlinkSync as g}from"node:fs";import{homedir as _}from"node:os";import{mkdir as v,rename as y,writeFile as b}from"node:fs/promises";var x=t();function S(e){return`https://unpkg.com/@inkeep/open-knowledge@latest/dist/schemas/${i}/${e===`user`?`config.user.schema.json`:`config.workspace.schema.json`}`}function C(e){return`# yaml-language-server: $schema=${S(e)}\n`}function w(e,t,r){return f(e===`user`?r??_():d(t)?t:f(t),n,`config.yml`)}function T(e){return{ok:!1,error:e}}function E(e){return{ok:!0,...e}}async function D(e,t){let n=`${e}.tmp.${crypto.randomUUID()}`;try{await b(n,t,{encoding:`utf-8`,mode:420}),await y(n,e)}catch(e){try{g(n)}catch{}throw e}}async function O(e){return c(`config.patch`,{"config.scope":e.scope,"config.transport":`fs`},async t=>{let n=await k(e);return t.setAttribute(`config.outcome`,n.ok?`success`:`rejected`),n.ok||t.setAttribute(`config.error.code`,n.error.code),n})}async function k(t){let{cwd:n,scope:i,patch:c,homedirOverride:l,firstWriteHeader:d}=t,f=w(i,n,l),h=``,g=!1;if(p(f)){g=!0;try{h=m(f,`utf-8`)}catch(e){return T({code:`WRITE_ERROR`,detail:`Could not read existing config: ${e instanceof Error?e.message:String(e)}`})}}let _=(0,x.parseDocument)(h);if(_.errors.length>0)return T({code:`YAML_PARSE`,detail:_.errors.map(e=>e.message).join(`; `)});if(_.contents===null)_.contents=_.createNode({});else if(!(0,x.isMap)(_.contents))return T({code:`YAML_PARSE`,detail:`Top-level YAML value must be a mapping (object), got ${(0,x.isSeq)(_.contents)?`sequence`:`scalar`}`});let y=a(_,c),b=_.toJSON(),S=o(`config.validate`,{"config.scope":i,"config.validation.layer":`L2`},t=>{let n=r.safeParse(b);if(t.setAttribute(`config.outcome`,n.success?`success`:`rejected`),!n.success)for(let t of n.error.issues)e(`config.validation.issue`,{"issue.path":t.path.map(e=>String(e)).join(`.`),"issue.message":t.message});return n});if(!S.success)return T({code:`SCHEMA_INVALID`,issues:S.error.issues.map(s)});let O=_.toString();if(!g){let e=d===void 0?C(i):d??``;e.length>0&&(O=`${e.endsWith(`
2
2
  `)?e:`${e}\n`}${O}`)}try{await v(u(f),{recursive:!0})}catch(e){return T({code:`WRITE_ERROR`,detail:`Could not create parent directory for ${f}: ${e instanceof Error?e.message:String(e)}`})}try{await D(f,O)}catch(e){return T({code:`WRITE_ERROR`,detail:`Could not write ${f}: ${e instanceof Error?e.message:String(e)}`})}return E({effective:S.data,appliedPaths:y,path:f,created:!g})}function A(e){if(!p(e))return[];let t=(0,x.parseDocument)(m(e,`utf-8`));if(t.errors.length>0)return[];let n=t.toJSON();if(!n||typeof n!=`object`||Array.isArray(n))return[];let r=n.folders;return Array.isArray(r)?r:[]}function j(e){return{ok:!1,error:e}}function M(e){return{ok:!0,...e}}async function N(e){let t=e.scope??`workspace`,n=w(t,e.cwd,e.homedirOverride),r;try{r=A(n)}catch(e){return j({code:`WRITE_ERROR`,detail:`Could not read current folders: ${e instanceof Error?e.message:String(e)}`})}let i=r.map(e=>({match:e.match,frontmatter:{...e.frontmatter}}));for(let t of e.rules){let e=t.new_match??t.match,n=i.findIndex(e=>e.match===t.match);if(t.new_match!==void 0&&t.new_match!==t.match){if(n>=0){let e=i.findIndex((e,r)=>r!==n&&e.match===t.new_match);e>=0&&i.splice(e,1);let r=e>=0&&e<n?n-1:n;i[r]={match:t.new_match,frontmatter:{...t.frontmatter}}}else{let n=i.findIndex(t=>t.match===e);n>=0?i[n]={match:e,frontmatter:{...t.frontmatter}}:i.push({match:e,frontmatter:{...t.frontmatter}})}continue}n>=0?i[n]={match:t.match,frontmatter:{...t.frontmatter}}:i.push({match:t.match,frontmatter:{...t.frontmatter}})}let a=await O({cwd:e.cwd,scope:t,patch:{folders:i},homedirOverride:e.homedirOverride});return a.ok?M({effective:a.effective,appliedPaths:a.appliedPaths,path:a.path,created:a.created}):j(a.error)}function P(e,t){let n=F(`user`,t),r=F(`workspace`,t),i=new Map;for(let t of e){let e=t.join(`.`);i.set(e,{user:I(n,t),workspace:I(r,t)})}return i}function F(e,t){let n=w(e,t.cwd,t.homedirOverride);if(!p(n))return null;let r;try{r=m(n,`utf-8`)}catch(t){return t.code!==`ENOENT`&&console.warn(`[inspectConfigPaths] could not read ${e} config at ${n}: ${t.message??t}`),null}let i=(0,x.parseDocument)(r);return i.errors.length>0?(console.warn(`[inspectConfigPaths] ${e} config at ${n} has YAML parse errors; treating as absent for scope inference`),null):i.toJSON()}function I(e,t){if(t.length===0)return e!=null;let n=e;for(let e of t){if(n==null)return!1;if(Array.isArray(n)&&typeof e==`number`){n=n[e];continue}if(typeof n==`object`){let t=String(e);if(!(t in n))return!1;n=n[t];continue}return!1}return n!==void 0}function L(e,t,n,r){return e.success?{code:`UNKNOWN`,message:`unexpected success in error path`}:{code:`SCHEMA_INVALID`,issues:e.error.issues.map(e=>{let i=e.path.map(e=>typeof e==`symbol`?String(e):e),a=l({file:r,source:n,doc:t,path:i});return{path:i,message:e.message,issueCode:e.code,...a===void 0?{}:{source:a}}})}}function R(e,t,n){let r=`${e}.invalid-${t.replace(/[:.]/g,`-`)}`;try{return h(e,r),r}catch(t){n(`[config] Could not sideline invalid config file ${e} → ${r}: ${t instanceof Error?t.message:String(t)}. File left in place; using schema defaults.`);return}}function z(e){let{absPath:t,sideline:n=!0,timestamp:i=new Date().toISOString()}=e,a=e.warn??(e=>console.warn(e)),o=r.parse({});if(!p(t))return{valid:!0,value:o,source:void 0};let s;try{s=m(t,`utf-8`)}catch(e){let n=e instanceof Error?e.message:String(e);return a(`[config] Could not read ${t}: ${n}. Using schema defaults.`),{valid:!1,value:o,error:{code:`UNKNOWN`,message:`Read failed: ${n}`}}}let c=(0,x.parseDocument)(s);if(c.errors.length>0){let e=c.errors.map(e=>e.message).join(`; `);a(`[config] ${t} contains invalid YAML (${e}). Using schema defaults.`+(n?``:` Pass-through mode: file left in place.`));let r=n?R(t,i,a):void 0;return{valid:!1,value:o,error:{code:`YAML_PARSE`,detail:e},...r===void 0?{}:{sidelinedTo:r}}}let l=c.toJSON()??{},u=r.safeParse(l);if(!u.success){let e=L(u,c,s,t);a(`[config] ${t} fails schema validation (${u.error.issues.length} issue(s)). Using schema defaults.`+(n?``:` Pass-through mode: file left in place.`));let r=n?R(t,i,a):void 0;return{valid:!1,value:o,error:e,...r===void 0?{}:{sidelinedTo:r}}}return{valid:!0,value:u.data,source:t}}export{O as a,w as i,P as n,z as r,N as t};
3
- //# sourceMappingURL=server-Bme59hx2.mjs.map
3
+ //# sourceMappingURL=server-Dq2PmzsL.mjs.map