devicetree-language-server 0.3.2 → 0.4.0

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 (2) hide show
  1. package/dist/server.js +180 -174
  2. package/package.json +1 -1
package/dist/server.js CHANGED
@@ -1,197 +1,197 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var lI=Object.create;var np=Object.defineProperty;var uI=Object.getOwnPropertyDescriptor;var dI=Object.getOwnPropertyNames;var fI=Object.getPrototypeOf,hI=Object.prototype.hasOwnProperty;var E=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),pI=(n,e)=>{for(var t in e)np(n,t,{get:e[t],enumerable:!0})},mI=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of dI(e))!hI.call(n,s)&&s!==t&&np(n,s,{get:()=>e[s],enumerable:!(r=uI(e,s))||r.enumerable});return n};var K=(n,e,t)=>(t=n!=null?lI(fI(n)):{},mI(e||!n||!n.__esModule?np(t,"default",{value:n,enumerable:!0}):t,n));var jl=E(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.thenable=vt.typedArray=vt.stringArray=vt.array=vt.func=vt.error=vt.number=vt.string=vt.boolean=void 0;function gI(n){return n===!0||n===!1}vt.boolean=gI;function jT(n){return typeof n=="string"||n instanceof String}vt.string=jT;function yI(n){return typeof n=="number"||n instanceof Number}vt.number=yI;function bI(n){return n instanceof Error}vt.error=bI;function FT(n){return typeof n=="function"}vt.func=FT;function BT(n){return Array.isArray(n)}vt.array=BT;function vI(n){return BT(n)&&n.every(e=>jT(e))}vt.stringArray=vI;function TI(n,e){return Array.isArray(n)&&n.every(e)}vt.typedArray=TI;function SI(n){return n&&FT(n.then)}vt.thenable=SI});var Hi=E(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.stringArray=Kt.array=Kt.func=Kt.error=Kt.number=Kt.string=Kt.boolean=void 0;function _I(n){return n===!0||n===!1}Kt.boolean=_I;function UT(n){return typeof n=="string"||n instanceof String}Kt.string=UT;function EI(n){return typeof n=="number"||n instanceof Number}Kt.number=EI;function wI(n){return n instanceof Error}Kt.error=wI;function kI(n){return typeof n=="function"}Kt.func=kI;function VT(n){return Array.isArray(n)}Kt.array=VT;function NI(n){return VT(n)&&n.every(e=>UT(e))}Kt.stringArray=NI});var Pp=E(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.Message=Q.NotificationType9=Q.NotificationType8=Q.NotificationType7=Q.NotificationType6=Q.NotificationType5=Q.NotificationType4=Q.NotificationType3=Q.NotificationType2=Q.NotificationType1=Q.NotificationType0=Q.NotificationType=Q.RequestType9=Q.RequestType8=Q.RequestType7=Q.RequestType6=Q.RequestType5=Q.RequestType4=Q.RequestType3=Q.RequestType2=Q.RequestType1=Q.RequestType=Q.RequestType0=Q.AbstractMessageSignature=Q.ParameterStructures=Q.ResponseError=Q.ErrorCodes=void 0;var ti=Hi(),rp;(function(n){n.ParseError=-32700,n.InvalidRequest=-32600,n.MethodNotFound=-32601,n.InvalidParams=-32602,n.InternalError=-32603,n.jsonrpcReservedErrorRangeStart=-32099,n.serverErrorStart=-32099,n.MessageWriteError=-32099,n.MessageReadError=-32098,n.PendingResponseRejected=-32097,n.ConnectionInactive=-32096,n.ServerNotInitialized=-32002,n.UnknownErrorCode=-32001,n.jsonrpcReservedErrorRangeEnd=-32e3,n.serverErrorEnd=-32e3})(rp||(Q.ErrorCodes=rp={}));var sp=class n extends Error{constructor(e,t,r){super(t),this.code=ti.number(e)?e:rp.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,n.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};Q.ResponseError=sp;var pn=class n{constructor(e){this.kind=e}static is(e){return e===n.auto||e===n.byName||e===n.byPosition}toString(){return this.kind}};Q.ParameterStructures=pn;pn.auto=new pn("auto");pn.byPosition=new pn("byPosition");pn.byName=new pn("byName");var Ze=class{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return pn.auto}};Q.AbstractMessageSignature=Ze;var ip=class extends Ze{constructor(e){super(e,0)}};Q.RequestType0=ip;var op=class extends Ze{constructor(e,t=pn.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Q.RequestType=op;var ap=class extends Ze{constructor(e,t=pn.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Q.RequestType1=ap;var cp=class extends Ze{constructor(e){super(e,2)}};Q.RequestType2=cp;var lp=class extends Ze{constructor(e){super(e,3)}};Q.RequestType3=lp;var up=class extends Ze{constructor(e){super(e,4)}};Q.RequestType4=up;var dp=class extends Ze{constructor(e){super(e,5)}};Q.RequestType5=dp;var fp=class extends Ze{constructor(e){super(e,6)}};Q.RequestType6=fp;var hp=class extends Ze{constructor(e){super(e,7)}};Q.RequestType7=hp;var pp=class extends Ze{constructor(e){super(e,8)}};Q.RequestType8=pp;var mp=class extends Ze{constructor(e){super(e,9)}};Q.RequestType9=mp;var gp=class extends Ze{constructor(e,t=pn.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Q.NotificationType=gp;var yp=class extends Ze{constructor(e){super(e,0)}};Q.NotificationType0=yp;var bp=class extends Ze{constructor(e,t=pn.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Q.NotificationType1=bp;var vp=class extends Ze{constructor(e){super(e,2)}};Q.NotificationType2=vp;var Tp=class extends Ze{constructor(e){super(e,3)}};Q.NotificationType3=Tp;var Sp=class extends Ze{constructor(e){super(e,4)}};Q.NotificationType4=Sp;var _p=class extends Ze{constructor(e){super(e,5)}};Q.NotificationType5=_p;var Ep=class extends Ze{constructor(e){super(e,6)}};Q.NotificationType6=Ep;var wp=class extends Ze{constructor(e){super(e,7)}};Q.NotificationType7=wp;var kp=class extends Ze{constructor(e){super(e,8)}};Q.NotificationType8=kp;var Np=class extends Ze{constructor(e){super(e,9)}};Q.NotificationType9=Np;var WT;(function(n){function e(s){let i=s;return i&&ti.string(i.method)&&(ti.string(i.id)||ti.number(i.id))}n.isRequest=e;function t(s){let i=s;return i&&ti.string(i.method)&&s.id===void 0}n.isNotification=t;function r(s){let i=s;return i&&(i.result!==void 0||!!i.error)&&(ti.string(i.id)||ti.number(i.id)||i.id===null)}n.isResponse=r})(WT||(Q.Message=WT={}))});var Dp=E(ls=>{"use strict";var zT;Object.defineProperty(ls,"__esModule",{value:!0});ls.LRUCache=ls.LinkedMap=ls.Touch=void 0;var Gt;(function(n){n.None=0,n.First=1,n.AsOld=n.First,n.Last=2,n.AsNew=n.Last})(Gt||(ls.Touch=Gt={}));var Fl=class{constructor(){this[zT]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=Gt.None){let r=this._map.get(e);if(r)return t!==Gt.None&&this.touch(r,t),r.value}set(e,t,r=Gt.None){let s=this._map.get(e);if(s)s.value=t,r!==Gt.None&&this.touch(s,r);else{switch(s={key:e,value:t,next:void 0,previous:void 0},r){case Gt.None:this.addItemLast(s);break;case Gt.First:this.addItemFirst(s);break;case Gt.Last:this.addItemLast(s);break;default:this.addItemLast(s);break}this._map.set(e,s),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let r=this._state,s=this._head;for(;s;){if(t?e.bind(t)(s.value,s.key,this):e(s.value,s.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");s=s.next}}keys(){let e=this._state,t=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let s={value:t.key,done:!1};return t=t.next,s}else return{value:void 0,done:!0}}};return r}values(){let e=this._state,t=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let s={value:t.value,done:!1};return t=t.next,s}else return{value:void 0,done:!0}}};return r}entries(){let e=this._state,t=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let s={value:[t.key,t.value],done:!1};return t=t.next,s}else return{value:void 0,done:!0}}};return r}[(zT=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,r=this.size;for(;t&&r>e;)this._map.delete(t.key),t=t.next,r--;this._head=t,this._size=r,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let t=e.next,r=e.previous;if(!t||!r)throw new Error("Invalid list");t.previous=r,r.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==Gt.First&&t!==Gt.Last)){if(t===Gt.First){if(e===this._head)return;let r=e.next,s=e.previous;e===this._tail?(s.next=void 0,this._tail=s):(r.previous=s,s.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===Gt.Last){if(e===this._tail)return;let r=e.next,s=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=s,s.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,r)=>{e.push([r,t])}),e}fromJSON(e){this.clear();for(let[t,r]of e)this.set(t,r)}};ls.LinkedMap=Fl;var Rp=class extends Fl{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=Gt.AsNew){return super.get(e,t)}peek(e){return super.get(e,Gt.None)}set(e,t){return super.set(e,t,Gt.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};ls.LRUCache=Rp});var KT=E(Bl=>{"use strict";Object.defineProperty(Bl,"__esModule",{value:!0});Bl.Disposable=void 0;var HT;(function(n){function e(t){return{dispose:t}}n.create=e})(HT||(Bl.Disposable=HT={}))});var us=E(Op=>{"use strict";Object.defineProperty(Op,"__esModule",{value:!0});var Cp;function Ap(){if(Cp===void 0)throw new Error("No runtime abstraction layer installed");return Cp}(function(n){function e(t){if(t===void 0)throw new Error("No runtime abstraction layer provided");Cp=t}n.install=e})(Ap||(Ap={}));Op.default=Ap});var Gi=E(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.Emitter=Ki.Event=void 0;var PI=us(),GT;(function(n){let e={dispose(){}};n.None=function(){return e}})(GT||(Ki.Event=GT={}));var Ip=class{add(e,t=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let r=!1;for(let s=0,i=this._callbacks.length;s<i;s++)if(this._callbacks[s]===e)if(this._contexts[s]===t){this._callbacks.splice(s,1),this._contexts.splice(s,1);return}else r=!0;if(r)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let t=[],r=this._callbacks.slice(0),s=this._contexts.slice(0);for(let i=0,o=r.length;i<o;i++)try{t.push(r[i].apply(s[i],e))}catch(a){(0,PI.default)().console.error(a)}return t}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Ul=class n{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,t,r)=>{this._callbacks||(this._callbacks=new Ip),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);let s={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,t),s.dispose=n._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(s),s}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};Ki.Emitter=Ul;Ul._noop=function(){}});var zl=E(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.CancellationTokenSource=Yi.CancellationToken=void 0;var RI=us(),DI=Hi(),xp=Gi(),Vl;(function(n){n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:xp.Event.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:xp.Event.None});function e(t){let r=t;return r&&(r===n.None||r===n.Cancelled||DI.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}n.is=e})(Vl||(Yi.CancellationToken=Vl={}));var CI=Object.freeze(function(n,e){let t=(0,RI.default)().timer.setTimeout(n.bind(e),0);return{dispose(){t.dispose()}}}),Wl=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?CI:(this._emitter||(this._emitter=new xp.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Mp=class{get token(){return this._token||(this._token=new Wl),this._token}cancel(){this._token?this._token.cancel():this._token=Vl.Cancelled}dispose(){this._token?this._token instanceof Wl&&this._token.dispose():this._token=Vl.None}};Yi.CancellationTokenSource=Mp});var YT=E(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.SharedArrayReceiverStrategy=Ji.SharedArraySenderStrategy=void 0;var AI=zl(),Sa;(function(n){n.Continue=0,n.Cancelled=1})(Sa||(Sa={}));var $p=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let t=new SharedArrayBuffer(4),r=new Int32Array(t,0,1);r[0]=Sa.Continue,this.buffers.set(e.id,t),e.$cancellationData=t}async sendCancellation(e,t){let r=this.buffers.get(t);if(r===void 0)return;let s=new Int32Array(r,0,1);Atomics.store(s,0,Sa.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};Ji.SharedArraySenderStrategy=$p;var Lp=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Sa.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},qp=class{constructor(e){this.token=new Lp(e)}cancel(){}dispose(){}},jp=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let t=e.$cancellationData;return t===void 0?new AI.CancellationTokenSource:new qp(t)}};Ji.SharedArrayReceiverStrategy=jp});var Bp=E(Hl=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});Hl.Semaphore=void 0;var OI=us(),Fp=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,r)=>{this._waiting.push({thunk:e,resolve:t,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,OI.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let t=e.thunk();t instanceof Promise?t.then(r=>{this._active--,e.resolve(r),this.runNext()},r=>{this._active--,e.reject(r),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}};Hl.Semaphore=Fp});var XT=E(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.ReadableStreamMessageReader=ds.AbstractMessageReader=ds.MessageReader=void 0;var Vp=us(),Xi=Hi(),Up=Gi(),II=Bp(),JT;(function(n){function e(t){let r=t;return r&&Xi.func(r.listen)&&Xi.func(r.dispose)&&Xi.func(r.onError)&&Xi.func(r.onClose)&&Xi.func(r.onPartialMessage)}n.is=e})(JT||(ds.MessageReader=JT={}));var Kl=class{constructor(){this.errorEmitter=new Up.Emitter,this.closeEmitter=new Up.Emitter,this.partialMessageEmitter=new Up.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${Xi.string(e.message)?e.message:"unknown"}`)}};ds.AbstractMessageReader=Kl;var Wp;(function(n){function e(t){let r,s,i,o=new Map,a,c=new Map;if(t===void 0||typeof t=="string")r=t??"utf-8";else{if(r=t.charset??"utf-8",t.contentDecoder!==void 0&&(i=t.contentDecoder,o.set(i.name,i)),t.contentDecoders!==void 0)for(let l of t.contentDecoders)o.set(l.name,l);if(t.contentTypeDecoder!==void 0&&(a=t.contentTypeDecoder,c.set(a.name,a)),t.contentTypeDecoders!==void 0)for(let l of t.contentTypeDecoders)c.set(l.name,l)}return a===void 0&&(a=(0,Vp.default)().applicationJson.decoder,c.set(a.name,a)),{charset:r,contentDecoder:i,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:c}}n.fromOptions=e})(Wp||(Wp={}));var zp=class extends Kl{constructor(e,t){super(),this.readable=e,this.options=Wp.fromOptions(t),this.buffer=(0,Vp.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new II.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let t=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),t}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let r=this.buffer.tryReadHeaders(!0);if(!r)return;let s=r.get("content-length");if(!s){this.fireError(new Error(`Header must provide a Content-Length property.
3
- ${JSON.stringify(Object.fromEntries(r))}`));return}let i=parseInt(s);if(isNaN(i)){this.fireError(new Error(`Content-Length value must be a number. Got ${s}`));return}this.nextMessageLength=i}let t=this.buffer.tryReadBody(this.nextMessageLength);if(t===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let r=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(t):t,s=await this.options.contentTypeDecoder.decode(r,this.options);this.callback(s)}).catch(r=>{this.fireError(r)})}}catch(t){this.fireError(t)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,Vp.default)().timer.setTimeout((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};ds.ReadableStreamMessageReader=zp});var nS=E(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.WriteableStreamMessageWriter=fs.AbstractMessageWriter=fs.MessageWriter=void 0;var QT=us(),_a=Hi(),xI=Bp(),ZT=Gi(),MI="Content-Length: ",eS=`\r
4
- `,tS;(function(n){function e(t){let r=t;return r&&_a.func(r.dispose)&&_a.func(r.onClose)&&_a.func(r.onError)&&_a.func(r.write)}n.is=e})(tS||(fs.MessageWriter=tS={}));var Gl=class{constructor(){this.errorEmitter=new ZT.Emitter,this.closeEmitter=new ZT.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,r){this.errorEmitter.fire([this.asError(e),t,r])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${_a.string(e.message)?e.message:"unknown"}`)}};fs.AbstractMessageWriter=Gl;var Hp;(function(n){function e(t){return t===void 0||typeof t=="string"?{charset:t??"utf-8",contentTypeEncoder:(0,QT.default)().applicationJson.encoder}:{charset:t.charset??"utf-8",contentEncoder:t.contentEncoder,contentTypeEncoder:t.contentTypeEncoder??(0,QT.default)().applicationJson.encoder}}n.fromOptions=e})(Hp||(Hp={}));var Kp=class extends Gl{constructor(e,t){super(),this.writable=e,this.options=Hp.fromOptions(t),this.errorCount=0,this.writeSemaphore=new xI.Semaphore(1),this.writable.onError(r=>this.fireError(r)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(r=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(r):r).then(r=>{let s=[];return s.push(MI,r.byteLength.toString(),eS),s.push(eS),this.doWrite(e,s,r)},r=>{throw this.fireError(r),r}))}async doWrite(e,t,r){try{return await this.writable.write(t.join(""),"ascii"),this.writable.write(r)}catch(s){return this.handleError(s,e),Promise.reject(s)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}};fs.WriteableStreamMessageWriter=Kp});var rS=E(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});Yl.AbstractMessageBuffer=void 0;var $I=13,LI=10,qI=`\r
5
- `,Gp=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let t=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let t=0,r=0,s=0,i=0;e:for(;r<this._chunks.length;){let l=this._chunks[r];for(s=0;s<l.length;){switch(l[s]){case $I:switch(t){case 0:t=1;break;case 2:t=3;break;default:t=0}break;case LI:switch(t){case 1:t=2;break;case 3:t=4,s++;break e;default:t=0}break;default:t=0}s++}i+=l.byteLength,r++}if(t!==4)return;let o=this._read(i+s),a=new Map,c=this.toString(o,"ascii").split(qI);if(c.length<2)return a;for(let l=0;l<c.length-2;l++){let u=c[l],d=u.indexOf(":");if(d===-1)throw new Error(`Message header must separate key and value using ':'
6
- ${u}`);let f=u.substr(0,d),p=u.substr(d+1).trim();a.set(e?f.toLowerCase():f,p)}return a}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let i=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(i)}if(this._chunks[0].byteLength>e){let i=this._chunks[0],o=this.asNative(i,e);return this._chunks[0]=i.slice(e),this._totalLength-=e,o}let t=this.allocNative(e),r=0,s=0;for(;e>0;){let i=this._chunks[s];if(i.byteLength>e){let o=i.slice(0,e);t.set(o,r),r+=e,this._chunks[s]=i.slice(e),this._totalLength-=e,e-=e}else t.set(i,r),r+=i.byteLength,this._chunks.shift(),this._totalLength-=i.byteLength,e-=i.byteLength}return t}};Yl.AbstractMessageBuffer=Gp});var cS=E(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.createMessageConnection=ae.ConnectionOptions=ae.MessageStrategy=ae.CancellationStrategy=ae.CancellationSenderStrategy=ae.CancellationReceiverStrategy=ae.RequestCancellationReceiverStrategy=ae.IdCancellationReceiverStrategy=ae.ConnectionStrategy=ae.ConnectionError=ae.ConnectionErrors=ae.LogTraceNotification=ae.SetTraceNotification=ae.TraceFormat=ae.TraceValues=ae.Trace=ae.NullLogger=ae.ProgressType=ae.ProgressToken=void 0;var sS=us(),ct=Hi(),te=Pp(),iS=Dp(),Ea=Gi(),Yp=zl(),Na;(function(n){n.type=new te.NotificationType("$/cancelRequest")})(Na||(Na={}));var Jp;(function(n){function e(t){return typeof t=="string"||typeof t=="number"}n.is=e})(Jp||(ae.ProgressToken=Jp={}));var wa;(function(n){n.type=new te.NotificationType("$/progress")})(wa||(wa={}));var Xp=class{constructor(){}};ae.ProgressType=Xp;var Qp;(function(n){function e(t){return ct.func(t)}n.is=e})(Qp||(Qp={}));ae.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Re;(function(n){n[n.Off=0]="Off",n[n.Messages=1]="Messages",n[n.Compact=2]="Compact",n[n.Verbose=3]="Verbose"})(Re||(ae.Trace=Re={}));var oS;(function(n){n.Off="off",n.Messages="messages",n.Compact="compact",n.Verbose="verbose"})(oS||(ae.TraceValues=oS={}));(function(n){function e(r){if(!ct.string(r))return n.Off;switch(r=r.toLowerCase(),r){case"off":return n.Off;case"messages":return n.Messages;case"compact":return n.Compact;case"verbose":return n.Verbose;default:return n.Off}}n.fromString=e;function t(r){switch(r){case n.Off:return"off";case n.Messages:return"messages";case n.Compact:return"compact";case n.Verbose:return"verbose";default:return"off"}}n.toString=t})(Re||(ae.Trace=Re={}));var Dn;(function(n){n.Text="text",n.JSON="json"})(Dn||(ae.TraceFormat=Dn={}));(function(n){function e(t){return ct.string(t)?(t=t.toLowerCase(),t==="json"?n.JSON:n.Text):n.Text}n.fromString=e})(Dn||(ae.TraceFormat=Dn={}));var Zp;(function(n){n.type=new te.NotificationType("$/setTrace")})(Zp||(ae.SetTraceNotification=Zp={}));var Jl;(function(n){n.type=new te.NotificationType("$/logTrace")})(Jl||(ae.LogTraceNotification=Jl={}));var ka;(function(n){n[n.Closed=1]="Closed",n[n.Disposed=2]="Disposed",n[n.AlreadyListening=3]="AlreadyListening"})(ka||(ae.ConnectionErrors=ka={}));var Qi=class n extends Error{constructor(e,t){super(t),this.code=e,Object.setPrototypeOf(this,n.prototype)}};ae.ConnectionError=Qi;var em;(function(n){function e(t){let r=t;return r&&ct.func(r.cancelUndispatched)}n.is=e})(em||(ae.ConnectionStrategy=em={}));var Xl;(function(n){function e(t){let r=t;return r&&(r.kind===void 0||r.kind==="id")&&ct.func(r.createCancellationTokenSource)&&(r.dispose===void 0||ct.func(r.dispose))}n.is=e})(Xl||(ae.IdCancellationReceiverStrategy=Xl={}));var tm;(function(n){function e(t){let r=t;return r&&r.kind==="request"&&ct.func(r.createCancellationTokenSource)&&(r.dispose===void 0||ct.func(r.dispose))}n.is=e})(tm||(ae.RequestCancellationReceiverStrategy=tm={}));var Ql;(function(n){n.Message=Object.freeze({createCancellationTokenSource(t){return new Yp.CancellationTokenSource}});function e(t){return Xl.is(t)||tm.is(t)}n.is=e})(Ql||(ae.CancellationReceiverStrategy=Ql={}));var Zl;(function(n){n.Message=Object.freeze({sendCancellation(t,r){return t.sendNotification(Na.type,{id:r})},cleanup(t){}});function e(t){let r=t;return r&&ct.func(r.sendCancellation)&&ct.func(r.cleanup)}n.is=e})(Zl||(ae.CancellationSenderStrategy=Zl={}));var eu;(function(n){n.Message=Object.freeze({receiver:Ql.Message,sender:Zl.Message});function e(t){let r=t;return r&&Ql.is(r.receiver)&&Zl.is(r.sender)}n.is=e})(eu||(ae.CancellationStrategy=eu={}));var tu;(function(n){function e(t){let r=t;return r&&ct.func(r.handleMessage)}n.is=e})(tu||(ae.MessageStrategy=tu={}));var aS;(function(n){function e(t){let r=t;return r&&(eu.is(r.cancellationStrategy)||em.is(r.connectionStrategy)||tu.is(r.messageStrategy))}n.is=e})(aS||(ae.ConnectionOptions=aS={}));var ir;(function(n){n[n.New=1]="New",n[n.Listening=2]="Listening",n[n.Closed=3]="Closed",n[n.Disposed=4]="Disposed"})(ir||(ir={}));function jI(n,e,t,r){let s=t!==void 0?t:ae.NullLogger,i=0,o=0,a=0,c="2.0",l,u=new Map,d,f=new Map,p=new Map,y,m=new iS.LinkedMap,S=new Map,w=new Set,T=new Map,v=Re.Off,R=Dn.Text,A,M=ir.New,z=new Ea.Emitter,j=new Ea.Emitter,ie=new Ea.Emitter,Le=new Ea.Emitter,wt=new Ea.Emitter,pe=r&&r.cancellationStrategy?r.cancellationStrategy:eu.Message;function Ln(k){if(k===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+k.toString()}function as(k){return k===null?"res-unknown-"+(++a).toString():"res-"+k.toString()}function El(){return"not-"+(++o).toString()}function tp(k,I){te.Message.isRequest(I)?k.set(Ln(I.id),I):te.Message.isResponse(I)?k.set(as(I.id),I):k.set(El(),I)}function wl(k){}function ma(){return M===ir.Listening}function Qs(){return M===ir.Closed}function Wr(){return M===ir.Disposed}function Bi(){(M===ir.New||M===ir.Listening)&&(M=ir.Closed,j.fire(void 0))}function Zs(k){z.fire([k,void 0,void 0])}function kl(k){z.fire(k)}n.onClose(Bi),n.onError(Zs),e.onClose(Bi),e.onError(kl);function ga(){y||m.size===0||(y=(0,sS.default)().timer.setImmediate(()=>{y=void 0,Nl()}))}function ya(k){te.Message.isRequest(k)?Rl(k):te.Message.isNotification(k)?Cl(k):te.Message.isResponse(k)?Dl(k):Ui(k)}function Nl(){if(m.size===0)return;let k=m.shift();try{let I=r?.messageStrategy;tu.is(I)?I.handleMessage(k,ya):ya(k)}finally{ga()}}let Pl=k=>{try{if(te.Message.isNotification(k)&&k.method===Na.type.method){let I=k.params.id,B=Ln(I),Y=m.get(B);if(te.Message.isRequest(Y)){let Oe=r?.connectionStrategy,Qe=Oe&&Oe.cancelUndispatched?Oe.cancelUndispatched(Y,wl):void 0;if(Qe&&(Qe.error!==void 0||Qe.result!==void 0)){m.delete(B),T.delete(I),Qe.id=Y.id,ei(Qe,k.method,Date.now()),e.write(Qe).catch(()=>s.error("Sending response for canceled message failed."));return}}let qe=T.get(I);if(qe!==void 0){qe.cancel(),Vi(k);return}else w.add(I)}tp(m,k)}finally{ga()}};function Rl(k){if(Wr())return;function I(me,Ve,ke){let ut={jsonrpc:c,id:k.id};me instanceof te.ResponseError?ut.error=me.toJson():ut.result=me===void 0?null:me,ei(ut,Ve,ke),e.write(ut).catch(()=>s.error("Sending response failed."))}function B(me,Ve,ke){let ut={jsonrpc:c,id:k.id,error:me.toJson()};ei(ut,Ve,ke),e.write(ut).catch(()=>s.error("Sending response failed."))}function Y(me,Ve,ke){me===void 0&&(me=null);let ut={jsonrpc:c,id:k.id,result:me};ei(ut,Ve,ke),e.write(ut).catch(()=>s.error("Sending response failed."))}Il(k);let qe=u.get(k.method),Oe,Qe;qe&&(Oe=qe.type,Qe=qe.handler);let it=Date.now();if(Qe||l){let me=k.id??String(Date.now()),Ve=Xl.is(pe.receiver)?pe.receiver.createCancellationTokenSource(me):pe.receiver.createCancellationTokenSource(k);k.id!==null&&w.has(k.id)&&Ve.cancel(),k.id!==null&&T.set(me,Ve);try{let ke;if(Qe)if(k.params===void 0){if(Oe!==void 0&&Oe.numberOfParams!==0){B(new te.ResponseError(te.ErrorCodes.InvalidParams,`Request ${k.method} defines ${Oe.numberOfParams} params but received none.`),k.method,it);return}ke=Qe(Ve.token)}else if(Array.isArray(k.params)){if(Oe!==void 0&&Oe.parameterStructures===te.ParameterStructures.byName){B(new te.ResponseError(te.ErrorCodes.InvalidParams,`Request ${k.method} defines parameters by name but received parameters by position`),k.method,it);return}ke=Qe(...k.params,Ve.token)}else{if(Oe!==void 0&&Oe.parameterStructures===te.ParameterStructures.byPosition){B(new te.ResponseError(te.ErrorCodes.InvalidParams,`Request ${k.method} defines parameters by position but received parameters by name`),k.method,it);return}ke=Qe(k.params,Ve.token)}else l&&(ke=l(k.method,k.params,Ve.token));let ut=ke;ke?ut.then?ut.then(Ct=>{T.delete(me),I(Ct,k.method,it)},Ct=>{T.delete(me),Ct instanceof te.ResponseError?B(Ct,k.method,it):Ct&&ct.string(Ct.message)?B(new te.ResponseError(te.ErrorCodes.InternalError,`Request ${k.method} failed with message: ${Ct.message}`),k.method,it):B(new te.ResponseError(te.ErrorCodes.InternalError,`Request ${k.method} failed unexpectedly without providing any details.`),k.method,it)}):(T.delete(me),I(ke,k.method,it)):(T.delete(me),Y(ke,k.method,it))}catch(ke){T.delete(me),ke instanceof te.ResponseError?I(ke,k.method,it):ke&&ct.string(ke.message)?B(new te.ResponseError(te.ErrorCodes.InternalError,`Request ${k.method} failed with message: ${ke.message}`),k.method,it):B(new te.ResponseError(te.ErrorCodes.InternalError,`Request ${k.method} failed unexpectedly without providing any details.`),k.method,it)}}else B(new te.ResponseError(te.ErrorCodes.MethodNotFound,`Unhandled method ${k.method}`),k.method,it)}function Dl(k){if(!Wr())if(k.id===null)k.error?s.error(`Received response message without id: Error is:
7
- ${JSON.stringify(k.error,void 0,4)}`):s.error("Received response message without id. No further error information provided.");else{let I=k.id,B=S.get(I);if(xl(k,B),B!==void 0){S.delete(I);try{if(k.error){let Y=k.error;B.reject(new te.ResponseError(Y.code,Y.message,Y.data))}else if(k.result!==void 0)B.resolve(k.result);else throw new Error("Should never happen.")}catch(Y){Y.message?s.error(`Response handler '${B.method}' failed with message: ${Y.message}`):s.error(`Response handler '${B.method}' failed unexpectedly.`)}}}}function Cl(k){if(Wr())return;let I,B;if(k.method===Na.type.method){let Y=k.params.id;w.delete(Y),Vi(k);return}else{let Y=f.get(k.method);Y&&(B=Y.handler,I=Y.type)}if(B||d)try{if(Vi(k),B)if(k.params===void 0)I!==void 0&&I.numberOfParams!==0&&I.parameterStructures!==te.ParameterStructures.byName&&s.error(`Notification ${k.method} defines ${I.numberOfParams} params but received none.`),B();else if(Array.isArray(k.params)){let Y=k.params;k.method===wa.type.method&&Y.length===2&&Jp.is(Y[0])?B({token:Y[0],value:Y[1]}):(I!==void 0&&(I.parameterStructures===te.ParameterStructures.byName&&s.error(`Notification ${k.method} defines parameters by name but received parameters by position`),I.numberOfParams!==k.params.length&&s.error(`Notification ${k.method} defines ${I.numberOfParams} params but received ${Y.length} arguments`)),B(...Y))}else I!==void 0&&I.parameterStructures===te.ParameterStructures.byPosition&&s.error(`Notification ${k.method} defines parameters by position but received parameters by name`),B(k.params);else d&&d(k.method,k.params)}catch(Y){Y.message?s.error(`Notification handler '${k.method}' failed with message: ${Y.message}`):s.error(`Notification handler '${k.method}' failed unexpectedly.`)}else ie.fire(k)}function Ui(k){if(!k){s.error("Received empty message.");return}s.error(`Received message which is neither a response nor a notification message:
8
- ${JSON.stringify(k,null,4)}`);let I=k;if(ct.string(I.id)||ct.number(I.id)){let B=I.id,Y=S.get(B);Y&&Y.reject(new Error("The received response has neither a result nor an error property."))}}function nr(k){if(k!=null)switch(v){case Re.Verbose:return JSON.stringify(k,null,4);case Re.Compact:return JSON.stringify(k);default:return}}function Al(k){if(!(v===Re.Off||!A))if(R===Dn.Text){let I;(v===Re.Verbose||v===Re.Compact)&&k.params&&(I=`Params: ${nr(k.params)}
2
+ "use strict";var Fx=Object.create;var mp=Object.defineProperty;var Bx=Object.getOwnPropertyDescriptor;var Ux=Object.getOwnPropertyNames;var Vx=Object.getPrototypeOf,zx=Object.prototype.hasOwnProperty;var w=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Wx=(t,e)=>{for(var n in e)mp(t,n,{get:e[n],enumerable:!0})},Hx=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Ux(e))!zx.call(t,s)&&s!==n&&mp(t,s,{get:()=>e[s],enumerable:!(r=Bx(e,s))||r.enumerable});return t};var Y=(t,e,n)=>(n=t!=null?Fx(Vx(t)):{},Hx(e||!t||!t.__esModule?mp(n,"default",{value:t,enumerable:!0}):n,t));var Kl=w(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.thenable=wt.typedArray=wt.stringArray=wt.array=wt.func=wt.error=wt.number=wt.string=wt.boolean=void 0;function Gx(t){return t===!0||t===!1}wt.boolean=Gx;function d_(t){return typeof t=="string"||t instanceof String}wt.string=d_;function Kx(t){return typeof t=="number"||t instanceof Number}wt.number=Kx;function Yx(t){return t instanceof Error}wt.error=Yx;function f_(t){return typeof t=="function"}wt.func=f_;function h_(t){return Array.isArray(t)}wt.array=h_;function Xx(t){return h_(t)&&t.every(e=>d_(e))}wt.stringArray=Xx;function Jx(t,e){return Array.isArray(t)&&t.every(e)}wt.typedArray=Jx;function Qx(t){return t&&f_(t.then)}wt.thenable=Qx});var Zi=w(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.stringArray=Yt.array=Yt.func=Yt.error=Yt.number=Yt.string=Yt.boolean=void 0;function Zx(t){return t===!0||t===!1}Yt.boolean=Zx;function p_(t){return typeof t=="string"||t instanceof String}Yt.string=p_;function eM(t){return typeof t=="number"||t instanceof Number}Yt.number=eM;function tM(t){return t instanceof Error}Yt.error=tM;function nM(t){return typeof t=="function"}Yt.func=nM;function m_(t){return Array.isArray(t)}Yt.array=m_;function rM(t){return m_(t)&&t.every(e=>p_(e))}Yt.stringArray=rM});var Fp=w(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.Message=Z.NotificationType9=Z.NotificationType8=Z.NotificationType7=Z.NotificationType6=Z.NotificationType5=Z.NotificationType4=Z.NotificationType3=Z.NotificationType2=Z.NotificationType1=Z.NotificationType0=Z.NotificationType=Z.RequestType9=Z.RequestType8=Z.RequestType7=Z.RequestType6=Z.RequestType5=Z.RequestType4=Z.RequestType3=Z.RequestType2=Z.RequestType1=Z.RequestType=Z.RequestType0=Z.AbstractMessageSignature=Z.ParameterStructures=Z.ResponseError=Z.ErrorCodes=void 0;var ai=Zi(),gp;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(gp||(Z.ErrorCodes=gp={}));var yp=class t extends Error{constructor(e,n,r){super(n),this.code=ai.number(e)?e:gp.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};Z.ResponseError=yp;var mn=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};Z.ParameterStructures=mn;mn.auto=new mn("auto");mn.byPosition=new mn("byPosition");mn.byName=new mn("byName");var rt=class{constructor(e,n){this.method=e,this.numberOfParams=n}get parameterStructures(){return mn.auto}};Z.AbstractMessageSignature=rt;var bp=class extends rt{constructor(e){super(e,0)}};Z.RequestType0=bp;var vp=class extends rt{constructor(e,n=mn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Z.RequestType=vp;var Tp=class extends rt{constructor(e,n=mn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Z.RequestType1=Tp;var _p=class extends rt{constructor(e){super(e,2)}};Z.RequestType2=_p;var Sp=class extends rt{constructor(e){super(e,3)}};Z.RequestType3=Sp;var Ep=class extends rt{constructor(e){super(e,4)}};Z.RequestType4=Ep;var wp=class extends rt{constructor(e){super(e,5)}};Z.RequestType5=wp;var kp=class extends rt{constructor(e){super(e,6)}};Z.RequestType6=kp;var Np=class extends rt{constructor(e){super(e,7)}};Z.RequestType7=Np;var Pp=class extends rt{constructor(e){super(e,8)}};Z.RequestType8=Pp;var Rp=class extends rt{constructor(e){super(e,9)}};Z.RequestType9=Rp;var Dp=class extends rt{constructor(e,n=mn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Z.NotificationType=Dp;var Cp=class extends rt{constructor(e){super(e,0)}};Z.NotificationType0=Cp;var Ap=class extends rt{constructor(e,n=mn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Z.NotificationType1=Ap;var Op=class extends rt{constructor(e){super(e,2)}};Z.NotificationType2=Op;var Ip=class extends rt{constructor(e){super(e,3)}};Z.NotificationType3=Ip;var xp=class extends rt{constructor(e){super(e,4)}};Z.NotificationType4=xp;var Mp=class extends rt{constructor(e){super(e,5)}};Z.NotificationType5=Mp;var Lp=class extends rt{constructor(e){super(e,6)}};Z.NotificationType6=Lp;var $p=class extends rt{constructor(e){super(e,7)}};Z.NotificationType7=$p;var qp=class extends rt{constructor(e){super(e,8)}};Z.NotificationType8=qp;var jp=class extends rt{constructor(e){super(e,9)}};Z.NotificationType9=jp;var g_;(function(t){function e(s){let i=s;return i&&ai.string(i.method)&&(ai.string(i.id)||ai.number(i.id))}t.isRequest=e;function n(s){let i=s;return i&&ai.string(i.method)&&s.id===void 0}t.isNotification=n;function r(s){let i=s;return i&&(i.result!==void 0||!!i.error)&&(ai.string(i.id)||ai.number(i.id)||i.id===null)}t.isResponse=r})(g_||(Z.Message=g_={}))});var Up=w(fs=>{"use strict";var y_;Object.defineProperty(fs,"__esModule",{value:!0});fs.LRUCache=fs.LinkedMap=fs.Touch=void 0;var Xt;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Xt||(fs.Touch=Xt={}));var Yl=class{constructor(){this[y_]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,n=Xt.None){let r=this._map.get(e);if(r)return n!==Xt.None&&this.touch(r,n),r.value}set(e,n,r=Xt.None){let s=this._map.get(e);if(s)s.value=n,r!==Xt.None&&this.touch(s,r);else{switch(s={key:e,value:n,next:void 0,previous:void 0},r){case Xt.None:this.addItemLast(s);break;case Xt.First:this.addItemFirst(s);break;case Xt.Last:this.addItemLast(s);break;default:this.addItemLast(s);break}this._map.set(e,s),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let n=this._map.get(e);if(n)return this._map.delete(e),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,n){let r=this._state,s=this._head;for(;s;){if(n?e.bind(n)(s.value,s.key,this):e(s.value,s.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");s=s.next}}keys(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:n.key,done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return r}values(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:n.value,done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return r}entries(){let e=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:[n.key,n.value],done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return r}[(y_=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let n=e.next,r=e.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}e.next=void 0,e.previous=void 0,this._state++}touch(e,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==Xt.First&&n!==Xt.Last)){if(n===Xt.First){if(e===this._head)return;let r=e.next,s=e.previous;e===this._tail?(s.next=void 0,this._tail=s):(r.previous=s,s.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===Xt.Last){if(e===this._tail)return;let r=e.next,s=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=s,s.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((n,r)=>{e.push([r,n])}),e}fromJSON(e){this.clear();for(let[n,r]of e)this.set(n,r)}};fs.LinkedMap=Yl;var Bp=class extends Yl{constructor(e,n=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,n=Xt.AsNew){return super.get(e,n)}peek(e){return super.get(e,Xt.None)}set(e,n){return super.set(e,n,Xt.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};fs.LRUCache=Bp});var v_=w(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});Xl.Disposable=void 0;var b_;(function(t){function e(n){return{dispose:n}}t.create=e})(b_||(Xl.Disposable=b_={}))});var hs=w(Wp=>{"use strict";Object.defineProperty(Wp,"__esModule",{value:!0});var Vp;function zp(){if(Vp===void 0)throw new Error("No runtime abstraction layer installed");return Vp}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");Vp=n}t.install=e})(zp||(zp={}));Wp.default=zp});var to=w(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.Emitter=eo.Event=void 0;var sM=hs(),T_;(function(t){let e={dispose(){}};t.None=function(){return e}})(T_||(eo.Event=T_={}));var Hp=class{add(e,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,n)})}remove(e,n=null){if(!this._callbacks)return;let r=!1;for(let s=0,i=this._callbacks.length;s<i;s++)if(this._callbacks[s]===e)if(this._contexts[s]===n){this._callbacks.splice(s,1),this._contexts.splice(s,1);return}else r=!0;if(r)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let n=[],r=this._callbacks.slice(0),s=this._contexts.slice(0);for(let i=0,o=r.length;i<o;i++)try{n.push(r[i].apply(s[i],e))}catch(a){(0,sM.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Jl=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,n,r)=>{this._callbacks||(this._callbacks=new Hp),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,n);let s={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,n),s.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(s),s}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};eo.Emitter=Jl;Jl._noop=function(){}});var eu=w(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.CancellationTokenSource=no.CancellationToken=void 0;var iM=hs(),oM=Zi(),Gp=to(),Ql;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Gp.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Gp.Event.None});function e(n){let r=n;return r&&(r===t.None||r===t.Cancelled||oM.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(Ql||(no.CancellationToken=Ql={}));var aM=Object.freeze(function(t,e){let n=(0,iM.default)().timer.setTimeout(t.bind(e),0);return{dispose(){n.dispose()}}}),Zl=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?aM:(this._emitter||(this._emitter=new Gp.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Kp=class{get token(){return this._token||(this._token=new Zl),this._token}cancel(){this._token?this._token.cancel():this._token=Ql.Cancelled}dispose(){this._token?this._token instanceof Zl&&this._token.dispose():this._token=Ql.None}};no.CancellationTokenSource=Kp});var __=w(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.SharedArrayReceiverStrategy=ro.SharedArraySenderStrategy=void 0;var cM=eu(),Ca;(function(t){t.Continue=0,t.Cancelled=1})(Ca||(Ca={}));var Yp=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let n=new SharedArrayBuffer(4),r=new Int32Array(n,0,1);r[0]=Ca.Continue,this.buffers.set(e.id,n),e.$cancellationData=n}async sendCancellation(e,n){let r=this.buffers.get(n);if(r===void 0)return;let s=new Int32Array(r,0,1);Atomics.store(s,0,Ca.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};ro.SharedArraySenderStrategy=Yp;var Xp=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Ca.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},Jp=class{constructor(e){this.token=new Xp(e)}cancel(){}dispose(){}},Qp=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let n=e.$cancellationData;return n===void 0?new cM.CancellationTokenSource:new Jp(n)}};ro.SharedArrayReceiverStrategy=Qp});var em=w(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});tu.Semaphore=void 0;var lM=hs(),Zp=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((n,r)=>{this._waiting.push({thunk:e,resolve:n,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,lM.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let n=e.thunk();n instanceof Promise?n.then(r=>{this._active--,e.resolve(r),this.runNext()},r=>{this._active--,e.reject(r),this.runNext()}):(this._active--,e.resolve(n),this.runNext())}catch(n){this._active--,e.reject(n),this.runNext()}}};tu.Semaphore=Zp});var E_=w(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});ps.ReadableStreamMessageReader=ps.AbstractMessageReader=ps.MessageReader=void 0;var nm=hs(),so=Zi(),tm=to(),uM=em(),S_;(function(t){function e(n){let r=n;return r&&so.func(r.listen)&&so.func(r.dispose)&&so.func(r.onError)&&so.func(r.onClose)&&so.func(r.onPartialMessage)}t.is=e})(S_||(ps.MessageReader=S_={}));var nu=class{constructor(){this.errorEmitter=new tm.Emitter,this.closeEmitter=new tm.Emitter,this.partialMessageEmitter=new tm.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${so.string(e.message)?e.message:"unknown"}`)}};ps.AbstractMessageReader=nu;var rm;(function(t){function e(n){let r,s,i,o=new Map,a,c=new Map;if(n===void 0||typeof n=="string")r=n??"utf-8";else{if(r=n.charset??"utf-8",n.contentDecoder!==void 0&&(i=n.contentDecoder,o.set(i.name,i)),n.contentDecoders!==void 0)for(let l of n.contentDecoders)o.set(l.name,l);if(n.contentTypeDecoder!==void 0&&(a=n.contentTypeDecoder,c.set(a.name,a)),n.contentTypeDecoders!==void 0)for(let l of n.contentTypeDecoders)c.set(l.name,l)}return a===void 0&&(a=(0,nm.default)().applicationJson.decoder,c.set(a.name,a)),{charset:r,contentDecoder:i,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:c}}t.fromOptions=e})(rm||(rm={}));var sm=class extends nu{constructor(e,n){super(),this.readable=e,this.options=rm.fromOptions(n),this.buffer=(0,nm.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new uM.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let n=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),n}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let r=this.buffer.tryReadHeaders(!0);if(!r)return;let s=r.get("content-length");if(!s){this.fireError(new Error(`Header must provide a Content-Length property.
3
+ ${JSON.stringify(Object.fromEntries(r))}`));return}let i=parseInt(s);if(isNaN(i)){this.fireError(new Error(`Content-Length value must be a number. Got ${s}`));return}this.nextMessageLength=i}let n=this.buffer.tryReadBody(this.nextMessageLength);if(n===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let r=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(n):n,s=await this.options.contentTypeDecoder.decode(r,this.options);this.callback(s)}).catch(r=>{this.fireError(r)})}}catch(n){this.fireError(n)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,nm.default)().timer.setTimeout((e,n)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:n}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};ps.ReadableStreamMessageReader=sm});var R_=w(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.WriteableStreamMessageWriter=ms.AbstractMessageWriter=ms.MessageWriter=void 0;var w_=hs(),Aa=Zi(),dM=em(),k_=to(),fM="Content-Length: ",N_=`\r
4
+ `,P_;(function(t){function e(n){let r=n;return r&&Aa.func(r.dispose)&&Aa.func(r.onClose)&&Aa.func(r.onError)&&Aa.func(r.write)}t.is=e})(P_||(ms.MessageWriter=P_={}));var ru=class{constructor(){this.errorEmitter=new k_.Emitter,this.closeEmitter=new k_.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,n,r){this.errorEmitter.fire([this.asError(e),n,r])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${Aa.string(e.message)?e.message:"unknown"}`)}};ms.AbstractMessageWriter=ru;var im;(function(t){function e(n){return n===void 0||typeof n=="string"?{charset:n??"utf-8",contentTypeEncoder:(0,w_.default)().applicationJson.encoder}:{charset:n.charset??"utf-8",contentEncoder:n.contentEncoder,contentTypeEncoder:n.contentTypeEncoder??(0,w_.default)().applicationJson.encoder}}t.fromOptions=e})(im||(im={}));var om=class extends ru{constructor(e,n){super(),this.writable=e,this.options=im.fromOptions(n),this.errorCount=0,this.writeSemaphore=new dM.Semaphore(1),this.writable.onError(r=>this.fireError(r)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(r=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(r):r).then(r=>{let s=[];return s.push(fM,r.byteLength.toString(),N_),s.push(N_),this.doWrite(e,s,r)},r=>{throw this.fireError(r),r}))}async doWrite(e,n,r){try{return await this.writable.write(n.join(""),"ascii"),this.writable.write(r)}catch(s){return this.handleError(s,e),Promise.reject(s)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){this.writable.end()}};ms.WriteableStreamMessageWriter=om});var D_=w(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.AbstractMessageBuffer=void 0;var hM=13,pM=10,mM=`\r
5
+ `,am=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let n=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(n),this._totalLength+=n.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let n=0,r=0,s=0,i=0;e:for(;r<this._chunks.length;){let l=this._chunks[r];for(s=0;s<l.length;){switch(l[s]){case hM:switch(n){case 0:n=1;break;case 2:n=3;break;default:n=0}break;case pM:switch(n){case 1:n=2;break;case 3:n=4,s++;break e;default:n=0}break;default:n=0}s++}i+=l.byteLength,r++}if(n!==4)return;let o=this._read(i+s),a=new Map,c=this.toString(o,"ascii").split(mM);if(c.length<2)return a;for(let l=0;l<c.length-2;l++){let u=c[l],d=u.indexOf(":");if(d===-1)throw new Error(`Message header must separate key and value using ':'
6
+ ${u}`);let f=u.substr(0,d),h=u.substr(d+1).trim();a.set(e?f.toLowerCase():f,h)}return a}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let i=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(i)}if(this._chunks[0].byteLength>e){let i=this._chunks[0],o=this.asNative(i,e);return this._chunks[0]=i.slice(e),this._totalLength-=e,o}let n=this.allocNative(e),r=0,s=0;for(;e>0;){let i=this._chunks[s];if(i.byteLength>e){let o=i.slice(0,e);n.set(o,r),r+=e,this._chunks[s]=i.slice(e),this._totalLength-=e,e-=e}else n.set(i,r),r+=i.byteLength,this._chunks.shift(),this._totalLength-=i.byteLength,e-=i.byteLength}return n}};su.AbstractMessageBuffer=am});var x_=w(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.createMessageConnection=ce.ConnectionOptions=ce.MessageStrategy=ce.CancellationStrategy=ce.CancellationSenderStrategy=ce.CancellationReceiverStrategy=ce.RequestCancellationReceiverStrategy=ce.IdCancellationReceiverStrategy=ce.ConnectionStrategy=ce.ConnectionError=ce.ConnectionErrors=ce.LogTraceNotification=ce.SetTraceNotification=ce.TraceFormat=ce.TraceValues=ce.Trace=ce.NullLogger=ce.ProgressType=ce.ProgressToken=void 0;var C_=hs(),dt=Zi(),ne=Fp(),A_=Up(),Oa=to(),cm=eu(),Ma;(function(t){t.type=new ne.NotificationType("$/cancelRequest")})(Ma||(Ma={}));var lm;(function(t){function e(n){return typeof n=="string"||typeof n=="number"}t.is=e})(lm||(ce.ProgressToken=lm={}));var Ia;(function(t){t.type=new ne.NotificationType("$/progress")})(Ia||(Ia={}));var um=class{constructor(){}};ce.ProgressType=um;var dm;(function(t){function e(n){return dt.func(n)}t.is=e})(dm||(dm={}));ce.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Oe;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(Oe||(ce.Trace=Oe={}));var O_;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(O_||(ce.TraceValues=O_={}));(function(t){function e(r){if(!dt.string(r))return t.Off;switch(r=r.toLowerCase(),r){case"off":return t.Off;case"messages":return t.Messages;case"compact":return t.Compact;case"verbose":return t.Verbose;default:return t.Off}}t.fromString=e;function n(r){switch(r){case t.Off:return"off";case t.Messages:return"messages";case t.Compact:return"compact";case t.Verbose:return"verbose";default:return"off"}}t.toString=n})(Oe||(ce.Trace=Oe={}));var On;(function(t){t.Text="text",t.JSON="json"})(On||(ce.TraceFormat=On={}));(function(t){function e(n){return dt.string(n)?(n=n.toLowerCase(),n==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(On||(ce.TraceFormat=On={}));var fm;(function(t){t.type=new ne.NotificationType("$/setTrace")})(fm||(ce.SetTraceNotification=fm={}));var iu;(function(t){t.type=new ne.NotificationType("$/logTrace")})(iu||(ce.LogTraceNotification=iu={}));var xa;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(xa||(ce.ConnectionErrors=xa={}));var io=class t extends Error{constructor(e,n){super(n),this.code=e,Object.setPrototypeOf(this,t.prototype)}};ce.ConnectionError=io;var hm;(function(t){function e(n){let r=n;return r&&dt.func(r.cancelUndispatched)}t.is=e})(hm||(ce.ConnectionStrategy=hm={}));var ou;(function(t){function e(n){let r=n;return r&&(r.kind===void 0||r.kind==="id")&&dt.func(r.createCancellationTokenSource)&&(r.dispose===void 0||dt.func(r.dispose))}t.is=e})(ou||(ce.IdCancellationReceiverStrategy=ou={}));var pm;(function(t){function e(n){let r=n;return r&&r.kind==="request"&&dt.func(r.createCancellationTokenSource)&&(r.dispose===void 0||dt.func(r.dispose))}t.is=e})(pm||(ce.RequestCancellationReceiverStrategy=pm={}));var au;(function(t){t.Message=Object.freeze({createCancellationTokenSource(n){return new cm.CancellationTokenSource}});function e(n){return ou.is(n)||pm.is(n)}t.is=e})(au||(ce.CancellationReceiverStrategy=au={}));var cu;(function(t){t.Message=Object.freeze({sendCancellation(n,r){return n.sendNotification(Ma.type,{id:r})},cleanup(n){}});function e(n){let r=n;return r&&dt.func(r.sendCancellation)&&dt.func(r.cleanup)}t.is=e})(cu||(ce.CancellationSenderStrategy=cu={}));var lu;(function(t){t.Message=Object.freeze({receiver:au.Message,sender:cu.Message});function e(n){let r=n;return r&&au.is(r.receiver)&&cu.is(r.sender)}t.is=e})(lu||(ce.CancellationStrategy=lu={}));var uu;(function(t){function e(n){let r=n;return r&&dt.func(r.handleMessage)}t.is=e})(uu||(ce.MessageStrategy=uu={}));var I_;(function(t){function e(n){let r=n;return r&&(lu.is(r.cancellationStrategy)||hm.is(r.connectionStrategy)||uu.is(r.messageStrategy))}t.is=e})(I_||(ce.ConnectionOptions=I_={}));var ar;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(ar||(ar={}));function gM(t,e,n,r){let s=n!==void 0?n:ce.NullLogger,i=0,o=0,a=0,c="2.0",l,u=new Map,d,f=new Map,h=new Map,y,m=new A_.LinkedMap,_=new Map,E=new Set,T=new Map,b=Oe.Off,R=On.Text,D,L=ar.New,H=new Oa.Emitter,U=new Oa.Emitter,oe=new Oa.Emitter,Be=new Oa.Emitter,Rt=new Oa.Emitter,me=r&&r.cancellationStrategy?r.cancellationStrategy:lu.Message;function Fn(k){if(k===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+k.toString()}function us(k){return k===null?"res-unknown-"+(++a).toString():"res-"+k.toString()}function Ol(){return"not-"+(++o).toString()}function pp(k,x){ne.Message.isRequest(x)?k.set(Fn(x.id),x):ne.Message.isResponse(x)?k.set(us(x.id),x):k.set(Ol(),x)}function Il(k){}function wa(){return L===ar.Listening}function si(){return L===ar.Closed}function Gr(){return L===ar.Disposed}function Ki(){(L===ar.New||L===ar.Listening)&&(L=ar.Closed,U.fire(void 0))}function ii(k){H.fire([k,void 0,void 0])}function xl(k){H.fire(k)}t.onClose(Ki),t.onError(ii),e.onClose(Ki),e.onError(xl);function ka(){y||m.size===0||(y=(0,C_.default)().timer.setImmediate(()=>{y=void 0,Ml()}))}function Na(k){ne.Message.isRequest(k)?$l(k):ne.Message.isNotification(k)?jl(k):ne.Message.isResponse(k)?ql(k):Yi(k)}function Ml(){if(m.size===0)return;let k=m.shift();try{let x=r?.messageStrategy;uu.is(x)?x.handleMessage(k,Na):Na(k)}finally{ka()}}let Ll=k=>{try{if(ne.Message.isNotification(k)&&k.method===Ma.type.method){let x=k.params.id,V=Fn(x),X=m.get(V);if(ne.Message.isRequest(X)){let Me=r?.connectionStrategy,nt=Me&&Me.cancelUndispatched?Me.cancelUndispatched(X,Il):void 0;if(nt&&(nt.error!==void 0||nt.result!==void 0)){m.delete(V),T.delete(x),nt.id=X.id,oi(nt,k.method,Date.now()),e.write(nt).catch(()=>s.error("Sending response for canceled message failed."));return}}let Ue=T.get(x);if(Ue!==void 0){Ue.cancel(),Xi(k);return}else E.add(x)}pp(m,k)}finally{ka()}};function $l(k){if(Gr())return;function x(ge,Ge,De){let pt={jsonrpc:c,id:k.id};ge instanceof ne.ResponseError?pt.error=ge.toJson():pt.result=ge===void 0?null:ge,oi(pt,Ge,De),e.write(pt).catch(()=>s.error("Sending response failed."))}function V(ge,Ge,De){let pt={jsonrpc:c,id:k.id,error:ge.toJson()};oi(pt,Ge,De),e.write(pt).catch(()=>s.error("Sending response failed."))}function X(ge,Ge,De){ge===void 0&&(ge=null);let pt={jsonrpc:c,id:k.id,result:ge};oi(pt,Ge,De),e.write(pt).catch(()=>s.error("Sending response failed."))}Ul(k);let Ue=u.get(k.method),Me,nt;Ue&&(Me=Ue.type,nt=Ue.handler);let lt=Date.now();if(nt||l){let ge=k.id??String(Date.now()),Ge=ou.is(me.receiver)?me.receiver.createCancellationTokenSource(ge):me.receiver.createCancellationTokenSource(k);k.id!==null&&E.has(k.id)&&Ge.cancel(),k.id!==null&&T.set(ge,Ge);try{let De;if(nt)if(k.params===void 0){if(Me!==void 0&&Me.numberOfParams!==0){V(new ne.ResponseError(ne.ErrorCodes.InvalidParams,`Request ${k.method} defines ${Me.numberOfParams} params but received none.`),k.method,lt);return}De=nt(Ge.token)}else if(Array.isArray(k.params)){if(Me!==void 0&&Me.parameterStructures===ne.ParameterStructures.byName){V(new ne.ResponseError(ne.ErrorCodes.InvalidParams,`Request ${k.method} defines parameters by name but received parameters by position`),k.method,lt);return}De=nt(...k.params,Ge.token)}else{if(Me!==void 0&&Me.parameterStructures===ne.ParameterStructures.byPosition){V(new ne.ResponseError(ne.ErrorCodes.InvalidParams,`Request ${k.method} defines parameters by position but received parameters by name`),k.method,lt);return}De=nt(k.params,Ge.token)}else l&&(De=l(k.method,k.params,Ge.token));let pt=De;De?pt.then?pt.then(xt=>{T.delete(ge),x(xt,k.method,lt)},xt=>{T.delete(ge),xt instanceof ne.ResponseError?V(xt,k.method,lt):xt&&dt.string(xt.message)?V(new ne.ResponseError(ne.ErrorCodes.InternalError,`Request ${k.method} failed with message: ${xt.message}`),k.method,lt):V(new ne.ResponseError(ne.ErrorCodes.InternalError,`Request ${k.method} failed unexpectedly without providing any details.`),k.method,lt)}):(T.delete(ge),x(De,k.method,lt)):(T.delete(ge),X(De,k.method,lt))}catch(De){T.delete(ge),De instanceof ne.ResponseError?x(De,k.method,lt):De&&dt.string(De.message)?V(new ne.ResponseError(ne.ErrorCodes.InternalError,`Request ${k.method} failed with message: ${De.message}`),k.method,lt):V(new ne.ResponseError(ne.ErrorCodes.InternalError,`Request ${k.method} failed unexpectedly without providing any details.`),k.method,lt)}}else V(new ne.ResponseError(ne.ErrorCodes.MethodNotFound,`Unhandled method ${k.method}`),k.method,lt)}function ql(k){if(!Gr())if(k.id===null)k.error?s.error(`Received response message without id: Error is:
7
+ ${JSON.stringify(k.error,void 0,4)}`):s.error("Received response message without id. No further error information provided.");else{let x=k.id,V=_.get(x);if(Vl(k,V),V!==void 0){_.delete(x);try{if(k.error){let X=k.error;V.reject(new ne.ResponseError(X.code,X.message,X.data))}else if(k.result!==void 0)V.resolve(k.result);else throw new Error("Should never happen.")}catch(X){X.message?s.error(`Response handler '${V.method}' failed with message: ${X.message}`):s.error(`Response handler '${V.method}' failed unexpectedly.`)}}}}function jl(k){if(Gr())return;let x,V;if(k.method===Ma.type.method){let X=k.params.id;E.delete(X),Xi(k);return}else{let X=f.get(k.method);X&&(V=X.handler,x=X.type)}if(V||d)try{if(Xi(k),V)if(k.params===void 0)x!==void 0&&x.numberOfParams!==0&&x.parameterStructures!==ne.ParameterStructures.byName&&s.error(`Notification ${k.method} defines ${x.numberOfParams} params but received none.`),V();else if(Array.isArray(k.params)){let X=k.params;k.method===Ia.type.method&&X.length===2&&lm.is(X[0])?V({token:X[0],value:X[1]}):(x!==void 0&&(x.parameterStructures===ne.ParameterStructures.byName&&s.error(`Notification ${k.method} defines parameters by name but received parameters by position`),x.numberOfParams!==k.params.length&&s.error(`Notification ${k.method} defines ${x.numberOfParams} params but received ${X.length} arguments`)),V(...X))}else x!==void 0&&x.parameterStructures===ne.ParameterStructures.byPosition&&s.error(`Notification ${k.method} defines parameters by position but received parameters by name`),V(k.params);else d&&d(k.method,k.params)}catch(X){X.message?s.error(`Notification handler '${k.method}' failed with message: ${X.message}`):s.error(`Notification handler '${k.method}' failed unexpectedly.`)}else oe.fire(k)}function Yi(k){if(!k){s.error("Received empty message.");return}s.error(`Received message which is neither a response nor a notification message:
8
+ ${JSON.stringify(k,null,4)}`);let x=k;if(dt.string(x.id)||dt.number(x.id)){let V=x.id,X=_.get(V);X&&X.reject(new Error("The received response has neither a result nor an error property."))}}function sr(k){if(k!=null)switch(b){case Oe.Verbose:return JSON.stringify(k,null,4);case Oe.Compact:return JSON.stringify(k);default:return}}function Fl(k){if(!(b===Oe.Off||!D))if(R===On.Text){let x;(b===Oe.Verbose||b===Oe.Compact)&&k.params&&(x=`Params: ${sr(k.params)}
9
9
 
10
- `),A.log(`Sending request '${k.method} - (${k.id})'.`,I)}else zr("send-request",k)}function Ol(k){if(!(v===Re.Off||!A))if(R===Dn.Text){let I;(v===Re.Verbose||v===Re.Compact)&&(k.params?I=`Params: ${nr(k.params)}
10
+ `),D.log(`Sending request '${k.method} - (${k.id})'.`,x)}else Kr("send-request",k)}function Bl(k){if(!(b===Oe.Off||!D))if(R===On.Text){let x;(b===Oe.Verbose||b===Oe.Compact)&&(k.params?x=`Params: ${sr(k.params)}
11
11
 
12
- `:I=`No parameters provided.
12
+ `:x=`No parameters provided.
13
13
 
14
- `),A.log(`Sending notification '${k.method}'.`,I)}else zr("send-notification",k)}function ei(k,I,B){if(!(v===Re.Off||!A))if(R===Dn.Text){let Y;(v===Re.Verbose||v===Re.Compact)&&(k.error&&k.error.data?Y=`Error data: ${nr(k.error.data)}
14
+ `),D.log(`Sending notification '${k.method}'.`,x)}else Kr("send-notification",k)}function oi(k,x,V){if(!(b===Oe.Off||!D))if(R===On.Text){let X;(b===Oe.Verbose||b===Oe.Compact)&&(k.error&&k.error.data?X=`Error data: ${sr(k.error.data)}
15
15
 
16
- `:k.result?Y=`Result: ${nr(k.result)}
16
+ `:k.result?X=`Result: ${sr(k.result)}
17
17
 
18
- `:k.error===void 0&&(Y=`No result returned.
18
+ `:k.error===void 0&&(X=`No result returned.
19
19
 
20
- `)),A.log(`Sending response '${I} - (${k.id})'. Processing request took ${Date.now()-B}ms`,Y)}else zr("send-response",k)}function Il(k){if(!(v===Re.Off||!A))if(R===Dn.Text){let I;(v===Re.Verbose||v===Re.Compact)&&k.params&&(I=`Params: ${nr(k.params)}
20
+ `)),D.log(`Sending response '${x} - (${k.id})'. Processing request took ${Date.now()-V}ms`,X)}else Kr("send-response",k)}function Ul(k){if(!(b===Oe.Off||!D))if(R===On.Text){let x;(b===Oe.Verbose||b===Oe.Compact)&&k.params&&(x=`Params: ${sr(k.params)}
21
21
 
22
- `),A.log(`Received request '${k.method} - (${k.id})'.`,I)}else zr("receive-request",k)}function Vi(k){if(!(v===Re.Off||!A||k.method===Jl.type.method))if(R===Dn.Text){let I;(v===Re.Verbose||v===Re.Compact)&&(k.params?I=`Params: ${nr(k.params)}
22
+ `),D.log(`Received request '${k.method} - (${k.id})'.`,x)}else Kr("receive-request",k)}function Xi(k){if(!(b===Oe.Off||!D||k.method===iu.type.method))if(R===On.Text){let x;(b===Oe.Verbose||b===Oe.Compact)&&(k.params?x=`Params: ${sr(k.params)}
23
23
 
24
- `:I=`No parameters provided.
24
+ `:x=`No parameters provided.
25
25
 
26
- `),A.log(`Received notification '${k.method}'.`,I)}else zr("receive-notification",k)}function xl(k,I){if(!(v===Re.Off||!A))if(R===Dn.Text){let B;if((v===Re.Verbose||v===Re.Compact)&&(k.error&&k.error.data?B=`Error data: ${nr(k.error.data)}
26
+ `),D.log(`Received notification '${k.method}'.`,x)}else Kr("receive-notification",k)}function Vl(k,x){if(!(b===Oe.Off||!D))if(R===On.Text){let V;if((b===Oe.Verbose||b===Oe.Compact)&&(k.error&&k.error.data?V=`Error data: ${sr(k.error.data)}
27
27
 
28
- `:k.result?B=`Result: ${nr(k.result)}
28
+ `:k.result?V=`Result: ${sr(k.result)}
29
29
 
30
- `:k.error===void 0&&(B=`No result returned.
30
+ `:k.error===void 0&&(V=`No result returned.
31
31
 
32
- `)),I){let Y=k.error?` Request failed: ${k.error.message} (${k.error.code}).`:"";A.log(`Received response '${I.method} - (${k.id})' in ${Date.now()-I.timerStart}ms.${Y}`,B)}else A.log(`Received response ${k.id} without active response promise.`,B)}else zr("receive-response",k)}function zr(k,I){if(!A||v===Re.Off)return;let B={isLSPMessage:!0,type:k,message:I,timestamp:Date.now()};A.log(B)}function cs(){if(Qs())throw new Qi(ka.Closed,"Connection is closed.");if(Wr())throw new Qi(ka.Disposed,"Connection is disposed.")}function Ml(){if(ma())throw new Qi(ka.AlreadyListening,"Connection is already listening")}function $l(){if(!ma())throw new Error("Call listen() first.")}function Er(k){return k===void 0?null:k}function ba(k){if(k!==null)return k}function va(k){return k!=null&&!Array.isArray(k)&&typeof k=="object"}function Wi(k,I){switch(k){case te.ParameterStructures.auto:return va(I)?ba(I):[Er(I)];case te.ParameterStructures.byName:if(!va(I))throw new Error("Received parameters by name but param is not an object literal.");return ba(I);case te.ParameterStructures.byPosition:return[Er(I)];default:throw new Error(`Unknown parameter structure ${k.toString()}`)}}function Ta(k,I){let B,Y=k.numberOfParams;switch(Y){case 0:B=void 0;break;case 1:B=Wi(k.parameterStructures,I[0]);break;default:B=[];for(let qe=0;qe<I.length&&qe<Y;qe++)B.push(Er(I[qe]));if(I.length<Y)for(let qe=I.length;qe<Y;qe++)B.push(null);break}return B}let Hr={sendNotification:(k,...I)=>{cs();let B,Y;if(ct.string(k)){B=k;let Oe=I[0],Qe=0,it=te.ParameterStructures.auto;te.ParameterStructures.is(Oe)&&(Qe=1,it=Oe);let me=I.length,Ve=me-Qe;switch(Ve){case 0:Y=void 0;break;case 1:Y=Wi(it,I[Qe]);break;default:if(it===te.ParameterStructures.byName)throw new Error(`Received ${Ve} parameters for 'by Name' notification parameter structure.`);Y=I.slice(Qe,me).map(ke=>Er(ke));break}}else{let Oe=I;B=k.method,Y=Ta(k,Oe)}let qe={jsonrpc:c,method:B,params:Y};return Ol(qe),e.write(qe).catch(Oe=>{throw s.error("Sending notification failed."),Oe})},onNotification:(k,I)=>{cs();let B;return ct.func(k)?d=k:I&&(ct.string(k)?(B=k,f.set(k,{type:void 0,handler:I})):(B=k.method,f.set(k.method,{type:k,handler:I}))),{dispose:()=>{B!==void 0?f.delete(B):d=void 0}}},onProgress:(k,I,B)=>{if(p.has(I))throw new Error(`Progress handler for token ${I} already registered`);return p.set(I,B),{dispose:()=>{p.delete(I)}}},sendProgress:(k,I,B)=>Hr.sendNotification(wa.type,{token:I,value:B}),onUnhandledProgress:Le.event,sendRequest:(k,...I)=>{cs(),$l();let B,Y,qe;if(ct.string(k)){B=k;let me=I[0],Ve=I[I.length-1],ke=0,ut=te.ParameterStructures.auto;te.ParameterStructures.is(me)&&(ke=1,ut=me);let Ct=I.length;Yp.CancellationToken.is(Ve)&&(Ct=Ct-1,qe=Ve);let Rn=Ct-ke;switch(Rn){case 0:Y=void 0;break;case 1:Y=Wi(ut,I[ke]);break;default:if(ut===te.ParameterStructures.byName)throw new Error(`Received ${Rn} parameters for 'by Name' request parameter structure.`);Y=I.slice(ke,Ct).map(Ll=>Er(Ll));break}}else{let me=I;B=k.method,Y=Ta(k,me);let Ve=k.numberOfParams;qe=Yp.CancellationToken.is(me[Ve])?me[Ve]:void 0}let Oe=i++,Qe;qe&&(Qe=qe.onCancellationRequested(()=>{let me=pe.sender.sendCancellation(Hr,Oe);return me===void 0?(s.log(`Received no promise from cancellation strategy when cancelling id ${Oe}`),Promise.resolve()):me.catch(()=>{s.log(`Sending cancellation messages for id ${Oe} failed`)})}));let it={jsonrpc:c,id:Oe,method:B,params:Y};return Al(it),typeof pe.sender.enableCancellation=="function"&&pe.sender.enableCancellation(it),new Promise(async(me,Ve)=>{let ke=Rn=>{me(Rn),pe.sender.cleanup(Oe),Qe?.dispose()},ut=Rn=>{Ve(Rn),pe.sender.cleanup(Oe),Qe?.dispose()},Ct={method:B,timerStart:Date.now(),resolve:ke,reject:ut};try{await e.write(it),S.set(Oe,Ct)}catch(Rn){throw s.error("Sending request failed."),Ct.reject(new te.ResponseError(te.ErrorCodes.MessageWriteError,Rn.message?Rn.message:"Unknown reason")),Rn}})},onRequest:(k,I)=>{cs();let B=null;return Qp.is(k)?(B=void 0,l=k):ct.string(k)?(B=null,I!==void 0&&(B=k,u.set(k,{handler:I,type:void 0}))):I!==void 0&&(B=k.method,u.set(k.method,{type:k,handler:I})),{dispose:()=>{B!==null&&(B!==void 0?u.delete(B):l=void 0)}}},hasPendingResponse:()=>S.size>0,trace:async(k,I,B)=>{let Y=!1,qe=Dn.Text;B!==void 0&&(ct.boolean(B)?Y=B:(Y=B.sendNotification||!1,qe=B.traceFormat||Dn.Text)),v=k,R=qe,v===Re.Off?A=void 0:A=I,Y&&!Qs()&&!Wr()&&await Hr.sendNotification(Zp.type,{value:Re.toString(k)})},onError:z.event,onClose:j.event,onUnhandledNotification:ie.event,onDispose:wt.event,end:()=>{e.end()},dispose:()=>{if(Wr())return;M=ir.Disposed,wt.fire(void 0);let k=new te.ResponseError(te.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let I of S.values())I.reject(k);S=new Map,T=new Map,w=new Set,m=new iS.LinkedMap,ct.func(e.dispose)&&e.dispose(),ct.func(n.dispose)&&n.dispose()},listen:()=>{cs(),Ml(),M=ir.Listening,n.listen(Pl)},inspect:()=>{(0,sS.default)().console.log("inspect")}};return Hr.onNotification(Jl.type,k=>{if(v===Re.Off||!A)return;let I=v===Re.Verbose||v===Re.Compact;A.log(k.message,I?k.verbose:void 0)}),Hr.onNotification(wa.type,k=>{let I=p.get(k.token);I?I(k.value):Le.fire(k)}),Hr}ae.createMessageConnection=jI});var nu=E(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.ProgressType=O.ProgressToken=O.createMessageConnection=O.NullLogger=O.ConnectionOptions=O.ConnectionStrategy=O.AbstractMessageBuffer=O.WriteableStreamMessageWriter=O.AbstractMessageWriter=O.MessageWriter=O.ReadableStreamMessageReader=O.AbstractMessageReader=O.MessageReader=O.SharedArrayReceiverStrategy=O.SharedArraySenderStrategy=O.CancellationToken=O.CancellationTokenSource=O.Emitter=O.Event=O.Disposable=O.LRUCache=O.Touch=O.LinkedMap=O.ParameterStructures=O.NotificationType9=O.NotificationType8=O.NotificationType7=O.NotificationType6=O.NotificationType5=O.NotificationType4=O.NotificationType3=O.NotificationType2=O.NotificationType1=O.NotificationType0=O.NotificationType=O.ErrorCodes=O.ResponseError=O.RequestType9=O.RequestType8=O.RequestType7=O.RequestType6=O.RequestType5=O.RequestType4=O.RequestType3=O.RequestType2=O.RequestType1=O.RequestType0=O.RequestType=O.Message=O.RAL=void 0;O.MessageStrategy=O.CancellationStrategy=O.CancellationSenderStrategy=O.CancellationReceiverStrategy=O.ConnectionError=O.ConnectionErrors=O.LogTraceNotification=O.SetTraceNotification=O.TraceFormat=O.TraceValues=O.Trace=void 0;var Ye=Pp();Object.defineProperty(O,"Message",{enumerable:!0,get:function(){return Ye.Message}});Object.defineProperty(O,"RequestType",{enumerable:!0,get:function(){return Ye.RequestType}});Object.defineProperty(O,"RequestType0",{enumerable:!0,get:function(){return Ye.RequestType0}});Object.defineProperty(O,"RequestType1",{enumerable:!0,get:function(){return Ye.RequestType1}});Object.defineProperty(O,"RequestType2",{enumerable:!0,get:function(){return Ye.RequestType2}});Object.defineProperty(O,"RequestType3",{enumerable:!0,get:function(){return Ye.RequestType3}});Object.defineProperty(O,"RequestType4",{enumerable:!0,get:function(){return Ye.RequestType4}});Object.defineProperty(O,"RequestType5",{enumerable:!0,get:function(){return Ye.RequestType5}});Object.defineProperty(O,"RequestType6",{enumerable:!0,get:function(){return Ye.RequestType6}});Object.defineProperty(O,"RequestType7",{enumerable:!0,get:function(){return Ye.RequestType7}});Object.defineProperty(O,"RequestType8",{enumerable:!0,get:function(){return Ye.RequestType8}});Object.defineProperty(O,"RequestType9",{enumerable:!0,get:function(){return Ye.RequestType9}});Object.defineProperty(O,"ResponseError",{enumerable:!0,get:function(){return Ye.ResponseError}});Object.defineProperty(O,"ErrorCodes",{enumerable:!0,get:function(){return Ye.ErrorCodes}});Object.defineProperty(O,"NotificationType",{enumerable:!0,get:function(){return Ye.NotificationType}});Object.defineProperty(O,"NotificationType0",{enumerable:!0,get:function(){return Ye.NotificationType0}});Object.defineProperty(O,"NotificationType1",{enumerable:!0,get:function(){return Ye.NotificationType1}});Object.defineProperty(O,"NotificationType2",{enumerable:!0,get:function(){return Ye.NotificationType2}});Object.defineProperty(O,"NotificationType3",{enumerable:!0,get:function(){return Ye.NotificationType3}});Object.defineProperty(O,"NotificationType4",{enumerable:!0,get:function(){return Ye.NotificationType4}});Object.defineProperty(O,"NotificationType5",{enumerable:!0,get:function(){return Ye.NotificationType5}});Object.defineProperty(O,"NotificationType6",{enumerable:!0,get:function(){return Ye.NotificationType6}});Object.defineProperty(O,"NotificationType7",{enumerable:!0,get:function(){return Ye.NotificationType7}});Object.defineProperty(O,"NotificationType8",{enumerable:!0,get:function(){return Ye.NotificationType8}});Object.defineProperty(O,"NotificationType9",{enumerable:!0,get:function(){return Ye.NotificationType9}});Object.defineProperty(O,"ParameterStructures",{enumerable:!0,get:function(){return Ye.ParameterStructures}});var nm=Dp();Object.defineProperty(O,"LinkedMap",{enumerable:!0,get:function(){return nm.LinkedMap}});Object.defineProperty(O,"LRUCache",{enumerable:!0,get:function(){return nm.LRUCache}});Object.defineProperty(O,"Touch",{enumerable:!0,get:function(){return nm.Touch}});var FI=KT();Object.defineProperty(O,"Disposable",{enumerable:!0,get:function(){return FI.Disposable}});var lS=Gi();Object.defineProperty(O,"Event",{enumerable:!0,get:function(){return lS.Event}});Object.defineProperty(O,"Emitter",{enumerable:!0,get:function(){return lS.Emitter}});var uS=zl();Object.defineProperty(O,"CancellationTokenSource",{enumerable:!0,get:function(){return uS.CancellationTokenSource}});Object.defineProperty(O,"CancellationToken",{enumerable:!0,get:function(){return uS.CancellationToken}});var dS=YT();Object.defineProperty(O,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return dS.SharedArraySenderStrategy}});Object.defineProperty(O,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return dS.SharedArrayReceiverStrategy}});var rm=XT();Object.defineProperty(O,"MessageReader",{enumerable:!0,get:function(){return rm.MessageReader}});Object.defineProperty(O,"AbstractMessageReader",{enumerable:!0,get:function(){return rm.AbstractMessageReader}});Object.defineProperty(O,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return rm.ReadableStreamMessageReader}});var sm=nS();Object.defineProperty(O,"MessageWriter",{enumerable:!0,get:function(){return sm.MessageWriter}});Object.defineProperty(O,"AbstractMessageWriter",{enumerable:!0,get:function(){return sm.AbstractMessageWriter}});Object.defineProperty(O,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return sm.WriteableStreamMessageWriter}});var BI=rS();Object.defineProperty(O,"AbstractMessageBuffer",{enumerable:!0,get:function(){return BI.AbstractMessageBuffer}});var jt=cS();Object.defineProperty(O,"ConnectionStrategy",{enumerable:!0,get:function(){return jt.ConnectionStrategy}});Object.defineProperty(O,"ConnectionOptions",{enumerable:!0,get:function(){return jt.ConnectionOptions}});Object.defineProperty(O,"NullLogger",{enumerable:!0,get:function(){return jt.NullLogger}});Object.defineProperty(O,"createMessageConnection",{enumerable:!0,get:function(){return jt.createMessageConnection}});Object.defineProperty(O,"ProgressToken",{enumerable:!0,get:function(){return jt.ProgressToken}});Object.defineProperty(O,"ProgressType",{enumerable:!0,get:function(){return jt.ProgressType}});Object.defineProperty(O,"Trace",{enumerable:!0,get:function(){return jt.Trace}});Object.defineProperty(O,"TraceValues",{enumerable:!0,get:function(){return jt.TraceValues}});Object.defineProperty(O,"TraceFormat",{enumerable:!0,get:function(){return jt.TraceFormat}});Object.defineProperty(O,"SetTraceNotification",{enumerable:!0,get:function(){return jt.SetTraceNotification}});Object.defineProperty(O,"LogTraceNotification",{enumerable:!0,get:function(){return jt.LogTraceNotification}});Object.defineProperty(O,"ConnectionErrors",{enumerable:!0,get:function(){return jt.ConnectionErrors}});Object.defineProperty(O,"ConnectionError",{enumerable:!0,get:function(){return jt.ConnectionError}});Object.defineProperty(O,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return jt.CancellationReceiverStrategy}});Object.defineProperty(O,"CancellationSenderStrategy",{enumerable:!0,get:function(){return jt.CancellationSenderStrategy}});Object.defineProperty(O,"CancellationStrategy",{enumerable:!0,get:function(){return jt.CancellationStrategy}});Object.defineProperty(O,"MessageStrategy",{enumerable:!0,get:function(){return jt.MessageStrategy}});var UI=us();O.RAL=UI.default});var pS=E(cm=>{"use strict";Object.defineProperty(cm,"__esModule",{value:!0});var fS=require("util"),Gr=nu(),ru=class n extends Gr.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return n.emptyBuffer}fromString(e,t){return Buffer.from(e,t)}toString(e,t){return e instanceof Buffer?e.toString(t):new fS.TextDecoder(t).decode(e)}asNative(e,t){return t===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,t):Buffer.from(e,0,t)}allocNative(e){return Buffer.allocUnsafe(e)}};ru.emptyBuffer=Buffer.allocUnsafe(0);var im=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Gr.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Gr.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Gr.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),Gr.Disposable.create(()=>this.stream.off("data",e))}},om=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Gr.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Gr.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Gr.Disposable.create(()=>this.stream.off("end",e))}write(e,t){return new Promise((r,s)=>{let i=o=>{o==null?r():s(o)};typeof e=="string"?this.stream.write(e,t,i):this.stream.write(e,i)})}end(){this.stream.end()}},hS=Object.freeze({messageBuffer:Object.freeze({create:n=>new ru(n)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(n,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(n,void 0,0),e.charset))}catch(t){return Promise.reject(t)}}}),decoder:Object.freeze({name:"application/json",decode:(n,e)=>{try{return n instanceof Buffer?Promise.resolve(JSON.parse(n.toString(e.charset))):Promise.resolve(JSON.parse(new fS.TextDecoder(e.charset).decode(n)))}catch(t){return Promise.reject(t)}}})}),stream:Object.freeze({asReadableStream:n=>new im(n),asWritableStream:n=>new om(n)}),console,timer:Object.freeze({setTimeout(n,e,...t){let r=setTimeout(n,e,...t);return{dispose:()=>clearTimeout(r)}},setImmediate(n,...e){let t=setImmediate(n,...e);return{dispose:()=>clearImmediate(t)}},setInterval(n,e,...t){let r=setInterval(n,e,...t);return{dispose:()=>clearInterval(r)}}})});function am(){return hS}(function(n){function e(){Gr.RAL.install(hS)}n.install=e})(am||(am={}));cm.default=am});var si=E(ve=>{"use strict";var VI=ve&&ve.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,s)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),WI=ve&&ve.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&VI(e,n,t)};Object.defineProperty(ve,"__esModule",{value:!0});ve.createMessageConnection=ve.createServerSocketTransport=ve.createClientSocketTransport=ve.createServerPipeTransport=ve.createClientPipeTransport=ve.generateRandomPipeName=ve.StreamMessageWriter=ve.StreamMessageReader=ve.SocketMessageWriter=ve.SocketMessageReader=ve.PortMessageWriter=ve.PortMessageReader=ve.IPCMessageWriter=ve.IPCMessageReader=void 0;var Zi=pS();Zi.default.install();var mS=require("path"),zI=require("os"),HI=require("crypto"),ou=require("net"),Cn=nu();WI(nu(),ve);var lm=class extends Cn.AbstractMessageReader{constructor(e){super(),this.process=e;let t=this.process;t.on("error",r=>this.fireError(r)),t.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),Cn.Disposable.create(()=>this.process.off("message",e))}};ve.IPCMessageReader=lm;var um=class extends Cn.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let t=this.process;t.on("error",r=>this.fireError(r)),t.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,t=>{t?(this.errorCount++,this.handleError(t,e)):this.errorCount=0}),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}};ve.IPCMessageWriter=um;var dm=class extends Cn.AbstractMessageReader{constructor(e){super(),this.onData=new Cn.Emitter,e.on("close",()=>this.fireClose),e.on("error",t=>this.fireError(t)),e.on("message",t=>{this.onData.fire(t)})}listen(e){return this.onData.event(e)}};ve.PortMessageReader=dm;var fm=class extends Cn.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",t=>this.fireError(t))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}};ve.PortMessageWriter=fm;var ni=class extends Cn.ReadableStreamMessageReader{constructor(e,t="utf-8"){super((0,Zi.default)().stream.asReadableStream(e),t)}};ve.SocketMessageReader=ni;var ri=class extends Cn.WriteableStreamMessageWriter{constructor(e,t){super((0,Zi.default)().stream.asWritableStream(e),t),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};ve.SocketMessageWriter=ri;var su=class extends Cn.ReadableStreamMessageReader{constructor(e,t){super((0,Zi.default)().stream.asReadableStream(e),t)}};ve.StreamMessageReader=su;var iu=class extends Cn.WriteableStreamMessageWriter{constructor(e,t){super((0,Zi.default)().stream.asWritableStream(e),t)}};ve.StreamMessageWriter=iu;var gS=process.env.XDG_RUNTIME_DIR,KI=new Map([["linux",107],["darwin",103]]);function GI(){let n=(0,HI.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${n}-sock`;let e;gS?e=mS.join(gS,`vscode-ipc-${n}.sock`):e=mS.join(zI.tmpdir(),`vscode-${n}.sock`);let t=KI.get(process.platform);return t!==void 0&&e.length>t&&(0,Zi.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${t} characters.`),e}ve.generateRandomPipeName=GI;function YI(n,e="utf-8"){let t,r=new Promise((s,i)=>{t=s});return new Promise((s,i)=>{let o=(0,ou.createServer)(a=>{o.close(),t([new ni(a,e),new ri(a,e)])});o.on("error",i),o.listen(n,()=>{o.removeListener("error",i),s({onConnected:()=>r})})})}ve.createClientPipeTransport=YI;function JI(n,e="utf-8"){let t=(0,ou.createConnection)(n);return[new ni(t,e),new ri(t,e)]}ve.createServerPipeTransport=JI;function XI(n,e="utf-8"){let t,r=new Promise((s,i)=>{t=s});return new Promise((s,i)=>{let o=(0,ou.createServer)(a=>{o.close(),t([new ni(a,e),new ri(a,e)])});o.on("error",i),o.listen(n,"127.0.0.1",()=>{o.removeListener("error",i),s({onConnected:()=>r})})})}ve.createClientSocketTransport=XI;function QI(n,e="utf-8"){let t=(0,ou.createConnection)(n,"127.0.0.1");return[new ni(t,e),new ri(t,e)]}ve.createServerSocketTransport=QI;function ZI(n){let e=n;return e.read!==void 0&&e.addListener!==void 0}function ex(n){let e=n;return e.write!==void 0&&e.addListener!==void 0}function tx(n,e,t,r){t||(t=Cn.NullLogger);let s=ZI(n)?new su(n):n,i=ex(e)?new iu(e):e;return Cn.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,Cn.createMessageConnection)(s,i,t,r)}ve.createMessageConnection=tx});var hm=E((kK,yS)=>{"use strict";yS.exports=si()});var cu=E((bS,au)=>{(function(n){if(typeof au=="object"&&typeof au.exports=="object"){var e=n(require,bS);e!==void 0&&(au.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],n)})(function(n,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.WorkspaceFolder=e.InlineCompletionContext=e.SelectedCompletionInfo=e.InlineCompletionTriggerKind=e.InlineCompletionList=e.InlineCompletionItem=e.StringValue=e.InlayHint=e.InlayHintLabelPart=e.InlayHintKind=e.InlineValueContext=e.InlineValueEvaluatableExpression=e.InlineValueVariableLookup=e.InlineValueText=e.SemanticTokens=e.SemanticTokenModifiers=e.SemanticTokenTypes=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionTriggerKind=e.CodeActionKind=e.DocumentSymbol=e.WorkspaceSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.CompletionItemLabelDetails=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=e.URI=e.DocumentUri=void 0;var t;(function(g){function N(P){return typeof P=="string"}g.is=N})(t||(e.DocumentUri=t={}));var r;(function(g){function N(P){return typeof P=="string"}g.is=N})(r||(e.URI=r={}));var s;(function(g){g.MIN_VALUE=-2147483648,g.MAX_VALUE=2147483647;function N(P){return typeof P=="number"&&g.MIN_VALUE<=P&&P<=g.MAX_VALUE}g.is=N})(s||(e.integer=s={}));var i;(function(g){g.MIN_VALUE=0,g.MAX_VALUE=2147483647;function N(P){return typeof P=="number"&&g.MIN_VALUE<=P&&P<=g.MAX_VALUE}g.is=N})(i||(e.uinteger=i={}));var o;(function(g){function N(b,h){return b===Number.MAX_VALUE&&(b=i.MAX_VALUE),h===Number.MAX_VALUE&&(h=i.MAX_VALUE),{line:b,character:h}}g.create=N;function P(b){var h=b;return C.objectLiteral(h)&&C.uinteger(h.line)&&C.uinteger(h.character)}g.is=P})(o||(e.Position=o={}));var a;(function(g){function N(b,h,D,x){if(C.uinteger(b)&&C.uinteger(h)&&C.uinteger(D)&&C.uinteger(x))return{start:o.create(b,h),end:o.create(D,x)};if(o.is(b)&&o.is(h))return{start:b,end:h};throw new Error("Range#create called with invalid arguments[".concat(b,", ").concat(h,", ").concat(D,", ").concat(x,"]"))}g.create=N;function P(b){var h=b;return C.objectLiteral(h)&&o.is(h.start)&&o.is(h.end)}g.is=P})(a||(e.Range=a={}));var c;(function(g){function N(b,h){return{uri:b,range:h}}g.create=N;function P(b){var h=b;return C.objectLiteral(h)&&a.is(h.range)&&(C.string(h.uri)||C.undefined(h.uri))}g.is=P})(c||(e.Location=c={}));var l;(function(g){function N(b,h,D,x){return{targetUri:b,targetRange:h,targetSelectionRange:D,originSelectionRange:x}}g.create=N;function P(b){var h=b;return C.objectLiteral(h)&&a.is(h.targetRange)&&C.string(h.targetUri)&&a.is(h.targetSelectionRange)&&(a.is(h.originSelectionRange)||C.undefined(h.originSelectionRange))}g.is=P})(l||(e.LocationLink=l={}));var u;(function(g){function N(b,h,D,x){return{red:b,green:h,blue:D,alpha:x}}g.create=N;function P(b){var h=b;return C.objectLiteral(h)&&C.numberRange(h.red,0,1)&&C.numberRange(h.green,0,1)&&C.numberRange(h.blue,0,1)&&C.numberRange(h.alpha,0,1)}g.is=P})(u||(e.Color=u={}));var d;(function(g){function N(b,h){return{range:b,color:h}}g.create=N;function P(b){var h=b;return C.objectLiteral(h)&&a.is(h.range)&&u.is(h.color)}g.is=P})(d||(e.ColorInformation=d={}));var f;(function(g){function N(b,h,D){return{label:b,textEdit:h,additionalTextEdits:D}}g.create=N;function P(b){var h=b;return C.objectLiteral(h)&&C.string(h.label)&&(C.undefined(h.textEdit)||A.is(h))&&(C.undefined(h.additionalTextEdits)||C.typedArray(h.additionalTextEdits,A.is))}g.is=P})(f||(e.ColorPresentation=f={}));var p;(function(g){g.Comment="comment",g.Imports="imports",g.Region="region"})(p||(e.FoldingRangeKind=p={}));var y;(function(g){function N(b,h,D,x,oe,dt){var Ge={startLine:b,endLine:h};return C.defined(D)&&(Ge.startCharacter=D),C.defined(x)&&(Ge.endCharacter=x),C.defined(oe)&&(Ge.kind=oe),C.defined(dt)&&(Ge.collapsedText=dt),Ge}g.create=N;function P(b){var h=b;return C.objectLiteral(h)&&C.uinteger(h.startLine)&&C.uinteger(h.startLine)&&(C.undefined(h.startCharacter)||C.uinteger(h.startCharacter))&&(C.undefined(h.endCharacter)||C.uinteger(h.endCharacter))&&(C.undefined(h.kind)||C.string(h.kind))}g.is=P})(y||(e.FoldingRange=y={}));var m;(function(g){function N(b,h){return{location:b,message:h}}g.create=N;function P(b){var h=b;return C.defined(h)&&c.is(h.location)&&C.string(h.message)}g.is=P})(m||(e.DiagnosticRelatedInformation=m={}));var S;(function(g){g.Error=1,g.Warning=2,g.Information=3,g.Hint=4})(S||(e.DiagnosticSeverity=S={}));var w;(function(g){g.Unnecessary=1,g.Deprecated=2})(w||(e.DiagnosticTag=w={}));var T;(function(g){function N(P){var b=P;return C.objectLiteral(b)&&C.string(b.href)}g.is=N})(T||(e.CodeDescription=T={}));var v;(function(g){function N(b,h,D,x,oe,dt){var Ge={range:b,message:h};return C.defined(D)&&(Ge.severity=D),C.defined(x)&&(Ge.code=x),C.defined(oe)&&(Ge.source=oe),C.defined(dt)&&(Ge.relatedInformation=dt),Ge}g.create=N;function P(b){var h,D=b;return C.defined(D)&&a.is(D.range)&&C.string(D.message)&&(C.number(D.severity)||C.undefined(D.severity))&&(C.integer(D.code)||C.string(D.code)||C.undefined(D.code))&&(C.undefined(D.codeDescription)||C.string((h=D.codeDescription)===null||h===void 0?void 0:h.href))&&(C.string(D.source)||C.undefined(D.source))&&(C.undefined(D.relatedInformation)||C.typedArray(D.relatedInformation,m.is))}g.is=P})(v||(e.Diagnostic=v={}));var R;(function(g){function N(b,h){for(var D=[],x=2;x<arguments.length;x++)D[x-2]=arguments[x];var oe={title:b,command:h};return C.defined(D)&&D.length>0&&(oe.arguments=D),oe}g.create=N;function P(b){var h=b;return C.defined(h)&&C.string(h.title)&&C.string(h.command)}g.is=P})(R||(e.Command=R={}));var A;(function(g){function N(D,x){return{range:D,newText:x}}g.replace=N;function P(D,x){return{range:{start:D,end:D},newText:x}}g.insert=P;function b(D){return{range:D,newText:""}}g.del=b;function h(D){var x=D;return C.objectLiteral(x)&&C.string(x.newText)&&a.is(x.range)}g.is=h})(A||(e.TextEdit=A={}));var M;(function(g){function N(b,h,D){var x={label:b};return h!==void 0&&(x.needsConfirmation=h),D!==void 0&&(x.description=D),x}g.create=N;function P(b){var h=b;return C.objectLiteral(h)&&C.string(h.label)&&(C.boolean(h.needsConfirmation)||h.needsConfirmation===void 0)&&(C.string(h.description)||h.description===void 0)}g.is=P})(M||(e.ChangeAnnotation=M={}));var z;(function(g){function N(P){var b=P;return C.string(b)}g.is=N})(z||(e.ChangeAnnotationIdentifier=z={}));var j;(function(g){function N(D,x,oe){return{range:D,newText:x,annotationId:oe}}g.replace=N;function P(D,x,oe){return{range:{start:D,end:D},newText:x,annotationId:oe}}g.insert=P;function b(D,x){return{range:D,newText:"",annotationId:x}}g.del=b;function h(D){var x=D;return A.is(x)&&(M.is(x.annotationId)||z.is(x.annotationId))}g.is=h})(j||(e.AnnotatedTextEdit=j={}));var ie;(function(g){function N(b,h){return{textDocument:b,edits:h}}g.create=N;function P(b){var h=b;return C.defined(h)&&Qs.is(h.textDocument)&&Array.isArray(h.edits)}g.is=P})(ie||(e.TextDocumentEdit=ie={}));var Le;(function(g){function N(b,h,D){var x={kind:"create",uri:b};return h!==void 0&&(h.overwrite!==void 0||h.ignoreIfExists!==void 0)&&(x.options=h),D!==void 0&&(x.annotationId=D),x}g.create=N;function P(b){var h=b;return h&&h.kind==="create"&&C.string(h.uri)&&(h.options===void 0||(h.options.overwrite===void 0||C.boolean(h.options.overwrite))&&(h.options.ignoreIfExists===void 0||C.boolean(h.options.ignoreIfExists)))&&(h.annotationId===void 0||z.is(h.annotationId))}g.is=P})(Le||(e.CreateFile=Le={}));var wt;(function(g){function N(b,h,D,x){var oe={kind:"rename",oldUri:b,newUri:h};return D!==void 0&&(D.overwrite!==void 0||D.ignoreIfExists!==void 0)&&(oe.options=D),x!==void 0&&(oe.annotationId=x),oe}g.create=N;function P(b){var h=b;return h&&h.kind==="rename"&&C.string(h.oldUri)&&C.string(h.newUri)&&(h.options===void 0||(h.options.overwrite===void 0||C.boolean(h.options.overwrite))&&(h.options.ignoreIfExists===void 0||C.boolean(h.options.ignoreIfExists)))&&(h.annotationId===void 0||z.is(h.annotationId))}g.is=P})(wt||(e.RenameFile=wt={}));var pe;(function(g){function N(b,h,D){var x={kind:"delete",uri:b};return h!==void 0&&(h.recursive!==void 0||h.ignoreIfNotExists!==void 0)&&(x.options=h),D!==void 0&&(x.annotationId=D),x}g.create=N;function P(b){var h=b;return h&&h.kind==="delete"&&C.string(h.uri)&&(h.options===void 0||(h.options.recursive===void 0||C.boolean(h.options.recursive))&&(h.options.ignoreIfNotExists===void 0||C.boolean(h.options.ignoreIfNotExists)))&&(h.annotationId===void 0||z.is(h.annotationId))}g.is=P})(pe||(e.DeleteFile=pe={}));var Ln;(function(g){function N(P){var b=P;return b&&(b.changes!==void 0||b.documentChanges!==void 0)&&(b.documentChanges===void 0||b.documentChanges.every(function(h){return C.string(h.kind)?Le.is(h)||wt.is(h)||pe.is(h):ie.is(h)}))}g.is=N})(Ln||(e.WorkspaceEdit=Ln={}));var as=function(){function g(N,P){this.edits=N,this.changeAnnotations=P}return g.prototype.insert=function(N,P,b){var h,D;if(b===void 0?h=A.insert(N,P):z.is(b)?(D=b,h=j.insert(N,P,b)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(b),h=j.insert(N,P,D)),this.edits.push(h),D!==void 0)return D},g.prototype.replace=function(N,P,b){var h,D;if(b===void 0?h=A.replace(N,P):z.is(b)?(D=b,h=j.replace(N,P,b)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(b),h=j.replace(N,P,D)),this.edits.push(h),D!==void 0)return D},g.prototype.delete=function(N,P){var b,h;if(P===void 0?b=A.del(N):z.is(P)?(h=P,b=j.del(N,P)):(this.assertChangeAnnotations(this.changeAnnotations),h=this.changeAnnotations.manage(P),b=j.del(N,h)),this.edits.push(b),h!==void 0)return h},g.prototype.add=function(N){this.edits.push(N)},g.prototype.all=function(){return this.edits},g.prototype.clear=function(){this.edits.splice(0,this.edits.length)},g.prototype.assertChangeAnnotations=function(N){if(N===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},g}(),El=function(){function g(N){this._annotations=N===void 0?Object.create(null):N,this._counter=0,this._size=0}return g.prototype.all=function(){return this._annotations},Object.defineProperty(g.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),g.prototype.manage=function(N,P){var b;if(z.is(N)?b=N:(b=this.nextId(),P=N),this._annotations[b]!==void 0)throw new Error("Id ".concat(b," is already in use."));if(P===void 0)throw new Error("No annotation provided for id ".concat(b));return this._annotations[b]=P,this._size++,b},g.prototype.nextId=function(){return this._counter++,this._counter.toString()},g}(),tp=function(){function g(N){var P=this;this._textEditChanges=Object.create(null),N!==void 0?(this._workspaceEdit=N,N.documentChanges?(this._changeAnnotations=new El(N.changeAnnotations),N.changeAnnotations=this._changeAnnotations.all(),N.documentChanges.forEach(function(b){if(ie.is(b)){var h=new as(b.edits,P._changeAnnotations);P._textEditChanges[b.textDocument.uri]=h}})):N.changes&&Object.keys(N.changes).forEach(function(b){var h=new as(N.changes[b]);P._textEditChanges[b]=h})):this._workspaceEdit={}}return Object.defineProperty(g.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),g.prototype.getTextEditChange=function(N){if(Qs.is(N)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var P={uri:N.uri,version:N.version},b=this._textEditChanges[P.uri];if(!b){var h=[],D={textDocument:P,edits:h};this._workspaceEdit.documentChanges.push(D),b=new as(h,this._changeAnnotations),this._textEditChanges[P.uri]=b}return b}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var b=this._textEditChanges[N];if(!b){var h=[];this._workspaceEdit.changes[N]=h,b=new as(h),this._textEditChanges[N]=b}return b}},g.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new El,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},g.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},g.prototype.createFile=function(N,P,b){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var h;M.is(P)||z.is(P)?h=P:b=P;var D,x;if(h===void 0?D=Le.create(N,b):(x=z.is(h)?h:this._changeAnnotations.manage(h),D=Le.create(N,b,x)),this._workspaceEdit.documentChanges.push(D),x!==void 0)return x},g.prototype.renameFile=function(N,P,b,h){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var D;M.is(b)||z.is(b)?D=b:h=b;var x,oe;if(D===void 0?x=wt.create(N,P,h):(oe=z.is(D)?D:this._changeAnnotations.manage(D),x=wt.create(N,P,h,oe)),this._workspaceEdit.documentChanges.push(x),oe!==void 0)return oe},g.prototype.deleteFile=function(N,P,b){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var h;M.is(P)||z.is(P)?h=P:b=P;var D,x;if(h===void 0?D=pe.create(N,b):(x=z.is(h)?h:this._changeAnnotations.manage(h),D=pe.create(N,b,x)),this._workspaceEdit.documentChanges.push(D),x!==void 0)return x},g}();e.WorkspaceChange=tp;var wl;(function(g){function N(b){return{uri:b}}g.create=N;function P(b){var h=b;return C.defined(h)&&C.string(h.uri)}g.is=P})(wl||(e.TextDocumentIdentifier=wl={}));var ma;(function(g){function N(b,h){return{uri:b,version:h}}g.create=N;function P(b){var h=b;return C.defined(h)&&C.string(h.uri)&&C.integer(h.version)}g.is=P})(ma||(e.VersionedTextDocumentIdentifier=ma={}));var Qs;(function(g){function N(b,h){return{uri:b,version:h}}g.create=N;function P(b){var h=b;return C.defined(h)&&C.string(h.uri)&&(h.version===null||C.integer(h.version))}g.is=P})(Qs||(e.OptionalVersionedTextDocumentIdentifier=Qs={}));var Wr;(function(g){function N(b,h,D,x){return{uri:b,languageId:h,version:D,text:x}}g.create=N;function P(b){var h=b;return C.defined(h)&&C.string(h.uri)&&C.string(h.languageId)&&C.integer(h.version)&&C.string(h.text)}g.is=P})(Wr||(e.TextDocumentItem=Wr={}));var Bi;(function(g){g.PlainText="plaintext",g.Markdown="markdown";function N(P){var b=P;return b===g.PlainText||b===g.Markdown}g.is=N})(Bi||(e.MarkupKind=Bi={}));var Zs;(function(g){function N(P){var b=P;return C.objectLiteral(P)&&Bi.is(b.kind)&&C.string(b.value)}g.is=N})(Zs||(e.MarkupContent=Zs={}));var kl;(function(g){g.Text=1,g.Method=2,g.Function=3,g.Constructor=4,g.Field=5,g.Variable=6,g.Class=7,g.Interface=8,g.Module=9,g.Property=10,g.Unit=11,g.Value=12,g.Enum=13,g.Keyword=14,g.Snippet=15,g.Color=16,g.File=17,g.Reference=18,g.Folder=19,g.EnumMember=20,g.Constant=21,g.Struct=22,g.Event=23,g.Operator=24,g.TypeParameter=25})(kl||(e.CompletionItemKind=kl={}));var ga;(function(g){g.PlainText=1,g.Snippet=2})(ga||(e.InsertTextFormat=ga={}));var ya;(function(g){g.Deprecated=1})(ya||(e.CompletionItemTag=ya={}));var Nl;(function(g){function N(b,h,D){return{newText:b,insert:h,replace:D}}g.create=N;function P(b){var h=b;return h&&C.string(h.newText)&&a.is(h.insert)&&a.is(h.replace)}g.is=P})(Nl||(e.InsertReplaceEdit=Nl={}));var Pl;(function(g){g.asIs=1,g.adjustIndentation=2})(Pl||(e.InsertTextMode=Pl={}));var Rl;(function(g){function N(P){var b=P;return b&&(C.string(b.detail)||b.detail===void 0)&&(C.string(b.description)||b.description===void 0)}g.is=N})(Rl||(e.CompletionItemLabelDetails=Rl={}));var Dl;(function(g){function N(P){return{label:P}}g.create=N})(Dl||(e.CompletionItem=Dl={}));var Cl;(function(g){function N(P,b){return{items:P||[],isIncomplete:!!b}}g.create=N})(Cl||(e.CompletionList=Cl={}));var Ui;(function(g){function N(b){return b.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}g.fromPlainText=N;function P(b){var h=b;return C.string(h)||C.objectLiteral(h)&&C.string(h.language)&&C.string(h.value)}g.is=P})(Ui||(e.MarkedString=Ui={}));var nr;(function(g){function N(P){var b=P;return!!b&&C.objectLiteral(b)&&(Zs.is(b.contents)||Ui.is(b.contents)||C.typedArray(b.contents,Ui.is))&&(P.range===void 0||a.is(P.range))}g.is=N})(nr||(e.Hover=nr={}));var Al;(function(g){function N(P,b){return b?{label:P,documentation:b}:{label:P}}g.create=N})(Al||(e.ParameterInformation=Al={}));var Ol;(function(g){function N(P,b){for(var h=[],D=2;D<arguments.length;D++)h[D-2]=arguments[D];var x={label:P};return C.defined(b)&&(x.documentation=b),C.defined(h)?x.parameters=h:x.parameters=[],x}g.create=N})(Ol||(e.SignatureInformation=Ol={}));var ei;(function(g){g.Text=1,g.Read=2,g.Write=3})(ei||(e.DocumentHighlightKind=ei={}));var Il;(function(g){function N(P,b){var h={range:P};return C.number(b)&&(h.kind=b),h}g.create=N})(Il||(e.DocumentHighlight=Il={}));var Vi;(function(g){g.File=1,g.Module=2,g.Namespace=3,g.Package=4,g.Class=5,g.Method=6,g.Property=7,g.Field=8,g.Constructor=9,g.Enum=10,g.Interface=11,g.Function=12,g.Variable=13,g.Constant=14,g.String=15,g.Number=16,g.Boolean=17,g.Array=18,g.Object=19,g.Key=20,g.Null=21,g.EnumMember=22,g.Struct=23,g.Event=24,g.Operator=25,g.TypeParameter=26})(Vi||(e.SymbolKind=Vi={}));var xl;(function(g){g.Deprecated=1})(xl||(e.SymbolTag=xl={}));var zr;(function(g){function N(P,b,h,D,x){var oe={name:P,kind:b,location:{uri:D,range:h}};return x&&(oe.containerName=x),oe}g.create=N})(zr||(e.SymbolInformation=zr={}));var cs;(function(g){function N(P,b,h,D){return D!==void 0?{name:P,kind:b,location:{uri:h,range:D}}:{name:P,kind:b,location:{uri:h}}}g.create=N})(cs||(e.WorkspaceSymbol=cs={}));var Ml;(function(g){function N(b,h,D,x,oe,dt){var Ge={name:b,detail:h,kind:D,range:x,selectionRange:oe};return dt!==void 0&&(Ge.children=dt),Ge}g.create=N;function P(b){var h=b;return h&&C.string(h.name)&&C.number(h.kind)&&a.is(h.range)&&a.is(h.selectionRange)&&(h.detail===void 0||C.string(h.detail))&&(h.deprecated===void 0||C.boolean(h.deprecated))&&(h.children===void 0||Array.isArray(h.children))&&(h.tags===void 0||Array.isArray(h.tags))}g.is=P})(Ml||(e.DocumentSymbol=Ml={}));var $l;(function(g){g.Empty="",g.QuickFix="quickfix",g.Refactor="refactor",g.RefactorExtract="refactor.extract",g.RefactorInline="refactor.inline",g.RefactorRewrite="refactor.rewrite",g.Source="source",g.SourceOrganizeImports="source.organizeImports",g.SourceFixAll="source.fixAll"})($l||(e.CodeActionKind=$l={}));var Er;(function(g){g.Invoked=1,g.Automatic=2})(Er||(e.CodeActionTriggerKind=Er={}));var ba;(function(g){function N(b,h,D){var x={diagnostics:b};return h!=null&&(x.only=h),D!=null&&(x.triggerKind=D),x}g.create=N;function P(b){var h=b;return C.defined(h)&&C.typedArray(h.diagnostics,v.is)&&(h.only===void 0||C.typedArray(h.only,C.string))&&(h.triggerKind===void 0||h.triggerKind===Er.Invoked||h.triggerKind===Er.Automatic)}g.is=P})(ba||(e.CodeActionContext=ba={}));var va;(function(g){function N(b,h,D){var x={title:b},oe=!0;return typeof h=="string"?(oe=!1,x.kind=h):R.is(h)?x.command=h:x.edit=h,oe&&D!==void 0&&(x.kind=D),x}g.create=N;function P(b){var h=b;return h&&C.string(h.title)&&(h.diagnostics===void 0||C.typedArray(h.diagnostics,v.is))&&(h.kind===void 0||C.string(h.kind))&&(h.edit!==void 0||h.command!==void 0)&&(h.command===void 0||R.is(h.command))&&(h.isPreferred===void 0||C.boolean(h.isPreferred))&&(h.edit===void 0||Ln.is(h.edit))}g.is=P})(va||(e.CodeAction=va={}));var Wi;(function(g){function N(b,h){var D={range:b};return C.defined(h)&&(D.data=h),D}g.create=N;function P(b){var h=b;return C.defined(h)&&a.is(h.range)&&(C.undefined(h.command)||R.is(h.command))}g.is=P})(Wi||(e.CodeLens=Wi={}));var Ta;(function(g){function N(b,h){return{tabSize:b,insertSpaces:h}}g.create=N;function P(b){var h=b;return C.defined(h)&&C.uinteger(h.tabSize)&&C.boolean(h.insertSpaces)}g.is=P})(Ta||(e.FormattingOptions=Ta={}));var Hr;(function(g){function N(b,h,D){return{range:b,target:h,data:D}}g.create=N;function P(b){var h=b;return C.defined(h)&&a.is(h.range)&&(C.undefined(h.target)||C.string(h.target))}g.is=P})(Hr||(e.DocumentLink=Hr={}));var k;(function(g){function N(b,h){return{range:b,parent:h}}g.create=N;function P(b){var h=b;return C.objectLiteral(h)&&a.is(h.range)&&(h.parent===void 0||g.is(h.parent))}g.is=P})(k||(e.SelectionRange=k={}));var I;(function(g){g.namespace="namespace",g.type="type",g.class="class",g.enum="enum",g.interface="interface",g.struct="struct",g.typeParameter="typeParameter",g.parameter="parameter",g.variable="variable",g.property="property",g.enumMember="enumMember",g.event="event",g.function="function",g.method="method",g.macro="macro",g.keyword="keyword",g.modifier="modifier",g.comment="comment",g.string="string",g.number="number",g.regexp="regexp",g.operator="operator",g.decorator="decorator"})(I||(e.SemanticTokenTypes=I={}));var B;(function(g){g.declaration="declaration",g.definition="definition",g.readonly="readonly",g.static="static",g.deprecated="deprecated",g.abstract="abstract",g.async="async",g.modification="modification",g.documentation="documentation",g.defaultLibrary="defaultLibrary"})(B||(e.SemanticTokenModifiers=B={}));var Y;(function(g){function N(P){var b=P;return C.objectLiteral(b)&&(b.resultId===void 0||typeof b.resultId=="string")&&Array.isArray(b.data)&&(b.data.length===0||typeof b.data[0]=="number")}g.is=N})(Y||(e.SemanticTokens=Y={}));var qe;(function(g){function N(b,h){return{range:b,text:h}}g.create=N;function P(b){var h=b;return h!=null&&a.is(h.range)&&C.string(h.text)}g.is=P})(qe||(e.InlineValueText=qe={}));var Oe;(function(g){function N(b,h,D){return{range:b,variableName:h,caseSensitiveLookup:D}}g.create=N;function P(b){var h=b;return h!=null&&a.is(h.range)&&C.boolean(h.caseSensitiveLookup)&&(C.string(h.variableName)||h.variableName===void 0)}g.is=P})(Oe||(e.InlineValueVariableLookup=Oe={}));var Qe;(function(g){function N(b,h){return{range:b,expression:h}}g.create=N;function P(b){var h=b;return h!=null&&a.is(h.range)&&(C.string(h.expression)||h.expression===void 0)}g.is=P})(Qe||(e.InlineValueEvaluatableExpression=Qe={}));var it;(function(g){function N(b,h){return{frameId:b,stoppedLocation:h}}g.create=N;function P(b){var h=b;return C.defined(h)&&a.is(b.stoppedLocation)}g.is=P})(it||(e.InlineValueContext=it={}));var me;(function(g){g.Type=1,g.Parameter=2;function N(P){return P===1||P===2}g.is=N})(me||(e.InlayHintKind=me={}));var Ve;(function(g){function N(b){return{value:b}}g.create=N;function P(b){var h=b;return C.objectLiteral(h)&&(h.tooltip===void 0||C.string(h.tooltip)||Zs.is(h.tooltip))&&(h.location===void 0||c.is(h.location))&&(h.command===void 0||R.is(h.command))}g.is=P})(Ve||(e.InlayHintLabelPart=Ve={}));var ke;(function(g){function N(b,h,D){var x={position:b,label:h};return D!==void 0&&(x.kind=D),x}g.create=N;function P(b){var h=b;return C.objectLiteral(h)&&o.is(h.position)&&(C.string(h.label)||C.typedArray(h.label,Ve.is))&&(h.kind===void 0||me.is(h.kind))&&h.textEdits===void 0||C.typedArray(h.textEdits,A.is)&&(h.tooltip===void 0||C.string(h.tooltip)||Zs.is(h.tooltip))&&(h.paddingLeft===void 0||C.boolean(h.paddingLeft))&&(h.paddingRight===void 0||C.boolean(h.paddingRight))}g.is=P})(ke||(e.InlayHint=ke={}));var ut;(function(g){function N(P){return{kind:"snippet",value:P}}g.createSnippet=N})(ut||(e.StringValue=ut={}));var Ct;(function(g){function N(P,b,h,D){return{insertText:P,filterText:b,range:h,command:D}}g.create=N})(Ct||(e.InlineCompletionItem=Ct={}));var Rn;(function(g){function N(P){return{items:P}}g.create=N})(Rn||(e.InlineCompletionList=Rn={}));var Ll;(function(g){g.Invoked=0,g.Automatic=1})(Ll||(e.InlineCompletionTriggerKind=Ll={}));var xT;(function(g){function N(P,b){return{range:P,text:b}}g.create=N})(xT||(e.SelectedCompletionInfo=xT={}));var MT;(function(g){function N(P,b){return{triggerKind:P,selectedCompletionInfo:b}}g.create=N})(MT||(e.InlineCompletionContext=MT={}));var $T;(function(g){function N(P){var b=P;return C.objectLiteral(b)&&r.is(b.uri)&&C.string(b.name)}g.is=N})($T||(e.WorkspaceFolder=$T={})),e.EOL=[`
32
+ `)),x){let X=k.error?` Request failed: ${k.error.message} (${k.error.code}).`:"";D.log(`Received response '${x.method} - (${k.id})' in ${Date.now()-x.timerStart}ms.${X}`,V)}else D.log(`Received response ${k.id} without active response promise.`,V)}else Kr("receive-response",k)}function Kr(k,x){if(!D||b===Oe.Off)return;let V={isLSPMessage:!0,type:k,message:x,timestamp:Date.now()};D.log(V)}function ds(){if(si())throw new io(xa.Closed,"Connection is closed.");if(Gr())throw new io(xa.Disposed,"Connection is disposed.")}function zl(){if(wa())throw new io(xa.AlreadyListening,"Connection is already listening")}function Wl(){if(!wa())throw new Error("Call listen() first.")}function Pr(k){return k===void 0?null:k}function Pa(k){if(k!==null)return k}function Ra(k){return k!=null&&!Array.isArray(k)&&typeof k=="object"}function Ji(k,x){switch(k){case ne.ParameterStructures.auto:return Ra(x)?Pa(x):[Pr(x)];case ne.ParameterStructures.byName:if(!Ra(x))throw new Error("Received parameters by name but param is not an object literal.");return Pa(x);case ne.ParameterStructures.byPosition:return[Pr(x)];default:throw new Error(`Unknown parameter structure ${k.toString()}`)}}function Da(k,x){let V,X=k.numberOfParams;switch(X){case 0:V=void 0;break;case 1:V=Ji(k.parameterStructures,x[0]);break;default:V=[];for(let Ue=0;Ue<x.length&&Ue<X;Ue++)V.push(Pr(x[Ue]));if(x.length<X)for(let Ue=x.length;Ue<X;Ue++)V.push(null);break}return V}let Yr={sendNotification:(k,...x)=>{ds();let V,X;if(dt.string(k)){V=k;let Me=x[0],nt=0,lt=ne.ParameterStructures.auto;ne.ParameterStructures.is(Me)&&(nt=1,lt=Me);let ge=x.length,Ge=ge-nt;switch(Ge){case 0:X=void 0;break;case 1:X=Ji(lt,x[nt]);break;default:if(lt===ne.ParameterStructures.byName)throw new Error(`Received ${Ge} parameters for 'by Name' notification parameter structure.`);X=x.slice(nt,ge).map(De=>Pr(De));break}}else{let Me=x;V=k.method,X=Da(k,Me)}let Ue={jsonrpc:c,method:V,params:X};return Bl(Ue),e.write(Ue).catch(Me=>{throw s.error("Sending notification failed."),Me})},onNotification:(k,x)=>{ds();let V;return dt.func(k)?d=k:x&&(dt.string(k)?(V=k,f.set(k,{type:void 0,handler:x})):(V=k.method,f.set(k.method,{type:k,handler:x}))),{dispose:()=>{V!==void 0?f.delete(V):d=void 0}}},onProgress:(k,x,V)=>{if(h.has(x))throw new Error(`Progress handler for token ${x} already registered`);return h.set(x,V),{dispose:()=>{h.delete(x)}}},sendProgress:(k,x,V)=>Yr.sendNotification(Ia.type,{token:x,value:V}),onUnhandledProgress:Be.event,sendRequest:(k,...x)=>{ds(),Wl();let V,X,Ue;if(dt.string(k)){V=k;let ge=x[0],Ge=x[x.length-1],De=0,pt=ne.ParameterStructures.auto;ne.ParameterStructures.is(ge)&&(De=1,pt=ge);let xt=x.length;cm.CancellationToken.is(Ge)&&(xt=xt-1,Ue=Ge);let An=xt-De;switch(An){case 0:X=void 0;break;case 1:X=Ji(pt,x[De]);break;default:if(pt===ne.ParameterStructures.byName)throw new Error(`Received ${An} parameters for 'by Name' request parameter structure.`);X=x.slice(De,xt).map(Hl=>Pr(Hl));break}}else{let ge=x;V=k.method,X=Da(k,ge);let Ge=k.numberOfParams;Ue=cm.CancellationToken.is(ge[Ge])?ge[Ge]:void 0}let Me=i++,nt;Ue&&(nt=Ue.onCancellationRequested(()=>{let ge=me.sender.sendCancellation(Yr,Me);return ge===void 0?(s.log(`Received no promise from cancellation strategy when cancelling id ${Me}`),Promise.resolve()):ge.catch(()=>{s.log(`Sending cancellation messages for id ${Me} failed`)})}));let lt={jsonrpc:c,id:Me,method:V,params:X};return Fl(lt),typeof me.sender.enableCancellation=="function"&&me.sender.enableCancellation(lt),new Promise(async(ge,Ge)=>{let De=An=>{ge(An),me.sender.cleanup(Me),nt?.dispose()},pt=An=>{Ge(An),me.sender.cleanup(Me),nt?.dispose()},xt={method:V,timerStart:Date.now(),resolve:De,reject:pt};try{await e.write(lt),_.set(Me,xt)}catch(An){throw s.error("Sending request failed."),xt.reject(new ne.ResponseError(ne.ErrorCodes.MessageWriteError,An.message?An.message:"Unknown reason")),An}})},onRequest:(k,x)=>{ds();let V=null;return dm.is(k)?(V=void 0,l=k):dt.string(k)?(V=null,x!==void 0&&(V=k,u.set(k,{handler:x,type:void 0}))):x!==void 0&&(V=k.method,u.set(k.method,{type:k,handler:x})),{dispose:()=>{V!==null&&(V!==void 0?u.delete(V):l=void 0)}}},hasPendingResponse:()=>_.size>0,trace:async(k,x,V)=>{let X=!1,Ue=On.Text;V!==void 0&&(dt.boolean(V)?X=V:(X=V.sendNotification||!1,Ue=V.traceFormat||On.Text)),b=k,R=Ue,b===Oe.Off?D=void 0:D=x,X&&!si()&&!Gr()&&await Yr.sendNotification(fm.type,{value:Oe.toString(k)})},onError:H.event,onClose:U.event,onUnhandledNotification:oe.event,onDispose:Rt.event,end:()=>{e.end()},dispose:()=>{if(Gr())return;L=ar.Disposed,Rt.fire(void 0);let k=new ne.ResponseError(ne.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let x of _.values())x.reject(k);_=new Map,T=new Map,E=new Set,m=new A_.LinkedMap,dt.func(e.dispose)&&e.dispose(),dt.func(t.dispose)&&t.dispose()},listen:()=>{ds(),zl(),L=ar.Listening,t.listen(Ll)},inspect:()=>{(0,C_.default)().console.log("inspect")}};return Yr.onNotification(iu.type,k=>{if(b===Oe.Off||!D)return;let x=b===Oe.Verbose||b===Oe.Compact;D.log(k.message,x?k.verbose:void 0)}),Yr.onNotification(Ia.type,k=>{let x=h.get(k.token);x?x(k.value):Be.fire(k)}),Yr}ce.createMessageConnection=gM});var du=w(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.ProgressType=I.ProgressToken=I.createMessageConnection=I.NullLogger=I.ConnectionOptions=I.ConnectionStrategy=I.AbstractMessageBuffer=I.WriteableStreamMessageWriter=I.AbstractMessageWriter=I.MessageWriter=I.ReadableStreamMessageReader=I.AbstractMessageReader=I.MessageReader=I.SharedArrayReceiverStrategy=I.SharedArraySenderStrategy=I.CancellationToken=I.CancellationTokenSource=I.Emitter=I.Event=I.Disposable=I.LRUCache=I.Touch=I.LinkedMap=I.ParameterStructures=I.NotificationType9=I.NotificationType8=I.NotificationType7=I.NotificationType6=I.NotificationType5=I.NotificationType4=I.NotificationType3=I.NotificationType2=I.NotificationType1=I.NotificationType0=I.NotificationType=I.ErrorCodes=I.ResponseError=I.RequestType9=I.RequestType8=I.RequestType7=I.RequestType6=I.RequestType5=I.RequestType4=I.RequestType3=I.RequestType2=I.RequestType1=I.RequestType0=I.RequestType=I.Message=I.RAL=void 0;I.MessageStrategy=I.CancellationStrategy=I.CancellationSenderStrategy=I.CancellationReceiverStrategy=I.ConnectionError=I.ConnectionErrors=I.LogTraceNotification=I.SetTraceNotification=I.TraceFormat=I.TraceValues=I.Trace=void 0;var Qe=Fp();Object.defineProperty(I,"Message",{enumerable:!0,get:function(){return Qe.Message}});Object.defineProperty(I,"RequestType",{enumerable:!0,get:function(){return Qe.RequestType}});Object.defineProperty(I,"RequestType0",{enumerable:!0,get:function(){return Qe.RequestType0}});Object.defineProperty(I,"RequestType1",{enumerable:!0,get:function(){return Qe.RequestType1}});Object.defineProperty(I,"RequestType2",{enumerable:!0,get:function(){return Qe.RequestType2}});Object.defineProperty(I,"RequestType3",{enumerable:!0,get:function(){return Qe.RequestType3}});Object.defineProperty(I,"RequestType4",{enumerable:!0,get:function(){return Qe.RequestType4}});Object.defineProperty(I,"RequestType5",{enumerable:!0,get:function(){return Qe.RequestType5}});Object.defineProperty(I,"RequestType6",{enumerable:!0,get:function(){return Qe.RequestType6}});Object.defineProperty(I,"RequestType7",{enumerable:!0,get:function(){return Qe.RequestType7}});Object.defineProperty(I,"RequestType8",{enumerable:!0,get:function(){return Qe.RequestType8}});Object.defineProperty(I,"RequestType9",{enumerable:!0,get:function(){return Qe.RequestType9}});Object.defineProperty(I,"ResponseError",{enumerable:!0,get:function(){return Qe.ResponseError}});Object.defineProperty(I,"ErrorCodes",{enumerable:!0,get:function(){return Qe.ErrorCodes}});Object.defineProperty(I,"NotificationType",{enumerable:!0,get:function(){return Qe.NotificationType}});Object.defineProperty(I,"NotificationType0",{enumerable:!0,get:function(){return Qe.NotificationType0}});Object.defineProperty(I,"NotificationType1",{enumerable:!0,get:function(){return Qe.NotificationType1}});Object.defineProperty(I,"NotificationType2",{enumerable:!0,get:function(){return Qe.NotificationType2}});Object.defineProperty(I,"NotificationType3",{enumerable:!0,get:function(){return Qe.NotificationType3}});Object.defineProperty(I,"NotificationType4",{enumerable:!0,get:function(){return Qe.NotificationType4}});Object.defineProperty(I,"NotificationType5",{enumerable:!0,get:function(){return Qe.NotificationType5}});Object.defineProperty(I,"NotificationType6",{enumerable:!0,get:function(){return Qe.NotificationType6}});Object.defineProperty(I,"NotificationType7",{enumerable:!0,get:function(){return Qe.NotificationType7}});Object.defineProperty(I,"NotificationType8",{enumerable:!0,get:function(){return Qe.NotificationType8}});Object.defineProperty(I,"NotificationType9",{enumerable:!0,get:function(){return Qe.NotificationType9}});Object.defineProperty(I,"ParameterStructures",{enumerable:!0,get:function(){return Qe.ParameterStructures}});var mm=Up();Object.defineProperty(I,"LinkedMap",{enumerable:!0,get:function(){return mm.LinkedMap}});Object.defineProperty(I,"LRUCache",{enumerable:!0,get:function(){return mm.LRUCache}});Object.defineProperty(I,"Touch",{enumerable:!0,get:function(){return mm.Touch}});var yM=v_();Object.defineProperty(I,"Disposable",{enumerable:!0,get:function(){return yM.Disposable}});var M_=to();Object.defineProperty(I,"Event",{enumerable:!0,get:function(){return M_.Event}});Object.defineProperty(I,"Emitter",{enumerable:!0,get:function(){return M_.Emitter}});var L_=eu();Object.defineProperty(I,"CancellationTokenSource",{enumerable:!0,get:function(){return L_.CancellationTokenSource}});Object.defineProperty(I,"CancellationToken",{enumerable:!0,get:function(){return L_.CancellationToken}});var $_=__();Object.defineProperty(I,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return $_.SharedArraySenderStrategy}});Object.defineProperty(I,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return $_.SharedArrayReceiverStrategy}});var gm=E_();Object.defineProperty(I,"MessageReader",{enumerable:!0,get:function(){return gm.MessageReader}});Object.defineProperty(I,"AbstractMessageReader",{enumerable:!0,get:function(){return gm.AbstractMessageReader}});Object.defineProperty(I,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return gm.ReadableStreamMessageReader}});var ym=R_();Object.defineProperty(I,"MessageWriter",{enumerable:!0,get:function(){return ym.MessageWriter}});Object.defineProperty(I,"AbstractMessageWriter",{enumerable:!0,get:function(){return ym.AbstractMessageWriter}});Object.defineProperty(I,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return ym.WriteableStreamMessageWriter}});var bM=D_();Object.defineProperty(I,"AbstractMessageBuffer",{enumerable:!0,get:function(){return bM.AbstractMessageBuffer}});var Bt=x_();Object.defineProperty(I,"ConnectionStrategy",{enumerable:!0,get:function(){return Bt.ConnectionStrategy}});Object.defineProperty(I,"ConnectionOptions",{enumerable:!0,get:function(){return Bt.ConnectionOptions}});Object.defineProperty(I,"NullLogger",{enumerable:!0,get:function(){return Bt.NullLogger}});Object.defineProperty(I,"createMessageConnection",{enumerable:!0,get:function(){return Bt.createMessageConnection}});Object.defineProperty(I,"ProgressToken",{enumerable:!0,get:function(){return Bt.ProgressToken}});Object.defineProperty(I,"ProgressType",{enumerable:!0,get:function(){return Bt.ProgressType}});Object.defineProperty(I,"Trace",{enumerable:!0,get:function(){return Bt.Trace}});Object.defineProperty(I,"TraceValues",{enumerable:!0,get:function(){return Bt.TraceValues}});Object.defineProperty(I,"TraceFormat",{enumerable:!0,get:function(){return Bt.TraceFormat}});Object.defineProperty(I,"SetTraceNotification",{enumerable:!0,get:function(){return Bt.SetTraceNotification}});Object.defineProperty(I,"LogTraceNotification",{enumerable:!0,get:function(){return Bt.LogTraceNotification}});Object.defineProperty(I,"ConnectionErrors",{enumerable:!0,get:function(){return Bt.ConnectionErrors}});Object.defineProperty(I,"ConnectionError",{enumerable:!0,get:function(){return Bt.ConnectionError}});Object.defineProperty(I,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Bt.CancellationReceiverStrategy}});Object.defineProperty(I,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Bt.CancellationSenderStrategy}});Object.defineProperty(I,"CancellationStrategy",{enumerable:!0,get:function(){return Bt.CancellationStrategy}});Object.defineProperty(I,"MessageStrategy",{enumerable:!0,get:function(){return Bt.MessageStrategy}});var vM=hs();I.RAL=vM.default});var F_=w(_m=>{"use strict";Object.defineProperty(_m,"__esModule",{value:!0});var q_=require("util"),Jr=du(),fu=class t extends Jr.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return t.emptyBuffer}fromString(e,n){return Buffer.from(e,n)}toString(e,n){return e instanceof Buffer?e.toString(n):new q_.TextDecoder(n).decode(e)}asNative(e,n){return n===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,n):Buffer.from(e,0,n)}allocNative(e){return Buffer.allocUnsafe(e)}};fu.emptyBuffer=Buffer.allocUnsafe(0);var bm=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Jr.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Jr.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Jr.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),Jr.Disposable.create(()=>this.stream.off("data",e))}},vm=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Jr.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Jr.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Jr.Disposable.create(()=>this.stream.off("end",e))}write(e,n){return new Promise((r,s)=>{let i=o=>{o==null?r():s(o)};typeof e=="string"?this.stream.write(e,n,i):this.stream.write(e,i)})}end(){this.stream.end()}},j_=Object.freeze({messageBuffer:Object.freeze({create:t=>new fu(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(n){return Promise.reject(n)}}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new q_.TextDecoder(e.charset).decode(t)))}catch(n){return Promise.reject(n)}}})}),stream:Object.freeze({asReadableStream:t=>new bm(t),asWritableStream:t=>new vm(t)}),console,timer:Object.freeze({setTimeout(t,e,...n){let r=setTimeout(t,e,...n);return{dispose:()=>clearTimeout(r)}},setImmediate(t,...e){let n=setImmediate(t,...e);return{dispose:()=>clearImmediate(n)}},setInterval(t,e,...n){let r=setInterval(t,e,...n);return{dispose:()=>clearInterval(r)}}})});function Tm(){return j_}(function(t){function e(){Jr.RAL.install(j_)}t.install=e})(Tm||(Tm={}));_m.default=Tm});var ui=w(_e=>{"use strict";var TM=_e&&_e.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),_M=_e&&_e.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&TM(e,t,n)};Object.defineProperty(_e,"__esModule",{value:!0});_e.createMessageConnection=_e.createServerSocketTransport=_e.createClientSocketTransport=_e.createServerPipeTransport=_e.createClientPipeTransport=_e.generateRandomPipeName=_e.StreamMessageWriter=_e.StreamMessageReader=_e.SocketMessageWriter=_e.SocketMessageReader=_e.PortMessageWriter=_e.PortMessageReader=_e.IPCMessageWriter=_e.IPCMessageReader=void 0;var oo=F_();oo.default.install();var B_=require("path"),SM=require("os"),EM=require("crypto"),mu=require("net"),In=du();_M(du(),_e);var Sm=class extends In.AbstractMessageReader{constructor(e){super(),this.process=e;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),In.Disposable.create(()=>this.process.off("message",e))}};_e.IPCMessageReader=Sm;var Em=class extends In.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,n=>{n?(this.errorCount++,this.handleError(n,e)):this.errorCount=0}),Promise.resolve()}catch(n){return this.handleError(n,e),Promise.reject(n)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){}};_e.IPCMessageWriter=Em;var wm=class extends In.AbstractMessageReader{constructor(e){super(),this.onData=new In.Emitter,e.on("close",()=>this.fireClose),e.on("error",n=>this.fireError(n)),e.on("message",n=>{this.onData.fire(n)})}listen(e){return this.onData.event(e)}};_e.PortMessageReader=wm;var km=class extends In.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",n=>this.fireError(n))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(n){return this.handleError(n,e),Promise.reject(n)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){}};_e.PortMessageWriter=km;var ci=class extends In.ReadableStreamMessageReader{constructor(e,n="utf-8"){super((0,oo.default)().stream.asReadableStream(e),n)}};_e.SocketMessageReader=ci;var li=class extends In.WriteableStreamMessageWriter{constructor(e,n){super((0,oo.default)().stream.asWritableStream(e),n),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};_e.SocketMessageWriter=li;var hu=class extends In.ReadableStreamMessageReader{constructor(e,n){super((0,oo.default)().stream.asReadableStream(e),n)}};_e.StreamMessageReader=hu;var pu=class extends In.WriteableStreamMessageWriter{constructor(e,n){super((0,oo.default)().stream.asWritableStream(e),n)}};_e.StreamMessageWriter=pu;var U_=process.env.XDG_RUNTIME_DIR,wM=new Map([["linux",107],["darwin",103]]);function kM(){let t=(0,EM.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;U_?e=B_.join(U_,`vscode-ipc-${t}.sock`):e=B_.join(SM.tmpdir(),`vscode-${t}.sock`);let n=wM.get(process.platform);return n!==void 0&&e.length>n&&(0,oo.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${n} characters.`),e}_e.generateRandomPipeName=kM;function NM(t,e="utf-8"){let n,r=new Promise((s,i)=>{n=s});return new Promise((s,i)=>{let o=(0,mu.createServer)(a=>{o.close(),n([new ci(a,e),new li(a,e)])});o.on("error",i),o.listen(t,()=>{o.removeListener("error",i),s({onConnected:()=>r})})})}_e.createClientPipeTransport=NM;function PM(t,e="utf-8"){let n=(0,mu.createConnection)(t);return[new ci(n,e),new li(n,e)]}_e.createServerPipeTransport=PM;function RM(t,e="utf-8"){let n,r=new Promise((s,i)=>{n=s});return new Promise((s,i)=>{let o=(0,mu.createServer)(a=>{o.close(),n([new ci(a,e),new li(a,e)])});o.on("error",i),o.listen(t,"127.0.0.1",()=>{o.removeListener("error",i),s({onConnected:()=>r})})})}_e.createClientSocketTransport=RM;function DM(t,e="utf-8"){let n=(0,mu.createConnection)(t,"127.0.0.1");return[new ci(n,e),new li(n,e)]}_e.createServerSocketTransport=DM;function CM(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function AM(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function OM(t,e,n,r){n||(n=In.NullLogger);let s=CM(t)?new hu(t):t,i=AM(e)?new pu(e):e;return In.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,In.createMessageConnection)(s,i,n,r)}_e.createMessageConnection=OM});var Nm=w((nY,V_)=>{"use strict";V_.exports=ui()});var yu=w((z_,gu)=>{(function(t){if(typeof gu=="object"&&typeof gu.exports=="object"){var e=t(require,z_);e!==void 0&&(gu.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],t)})(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.WorkspaceFolder=e.InlineCompletionContext=e.SelectedCompletionInfo=e.InlineCompletionTriggerKind=e.InlineCompletionList=e.InlineCompletionItem=e.StringValue=e.InlayHint=e.InlayHintLabelPart=e.InlayHintKind=e.InlineValueContext=e.InlineValueEvaluatableExpression=e.InlineValueVariableLookup=e.InlineValueText=e.SemanticTokens=e.SemanticTokenModifiers=e.SemanticTokenTypes=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionTriggerKind=e.CodeActionKind=e.DocumentSymbol=e.WorkspaceSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.CompletionItemLabelDetails=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=e.URI=e.DocumentUri=void 0;var n;(function(g){function N(P){return typeof P=="string"}g.is=N})(n||(e.DocumentUri=n={}));var r;(function(g){function N(P){return typeof P=="string"}g.is=N})(r||(e.URI=r={}));var s;(function(g){g.MIN_VALUE=-2147483648,g.MAX_VALUE=2147483647;function N(P){return typeof P=="number"&&g.MIN_VALUE<=P&&P<=g.MAX_VALUE}g.is=N})(s||(e.integer=s={}));var i;(function(g){g.MIN_VALUE=0,g.MAX_VALUE=2147483647;function N(P){return typeof P=="number"&&g.MIN_VALUE<=P&&P<=g.MAX_VALUE}g.is=N})(i||(e.uinteger=i={}));var o;(function(g){function N(v,p){return v===Number.MAX_VALUE&&(v=i.MAX_VALUE),p===Number.MAX_VALUE&&(p=i.MAX_VALUE),{line:v,character:p}}g.create=N;function P(v){var p=v;return A.objectLiteral(p)&&A.uinteger(p.line)&&A.uinteger(p.character)}g.is=P})(o||(e.Position=o={}));var a;(function(g){function N(v,p,C,M){if(A.uinteger(v)&&A.uinteger(p)&&A.uinteger(C)&&A.uinteger(M))return{start:o.create(v,p),end:o.create(C,M)};if(o.is(v)&&o.is(p))return{start:v,end:p};throw new Error("Range#create called with invalid arguments[".concat(v,", ").concat(p,", ").concat(C,", ").concat(M,"]"))}g.create=N;function P(v){var p=v;return A.objectLiteral(p)&&o.is(p.start)&&o.is(p.end)}g.is=P})(a||(e.Range=a={}));var c;(function(g){function N(v,p){return{uri:v,range:p}}g.create=N;function P(v){var p=v;return A.objectLiteral(p)&&a.is(p.range)&&(A.string(p.uri)||A.undefined(p.uri))}g.is=P})(c||(e.Location=c={}));var l;(function(g){function N(v,p,C,M){return{targetUri:v,targetRange:p,targetSelectionRange:C,originSelectionRange:M}}g.create=N;function P(v){var p=v;return A.objectLiteral(p)&&a.is(p.targetRange)&&A.string(p.targetUri)&&a.is(p.targetSelectionRange)&&(a.is(p.originSelectionRange)||A.undefined(p.originSelectionRange))}g.is=P})(l||(e.LocationLink=l={}));var u;(function(g){function N(v,p,C,M){return{red:v,green:p,blue:C,alpha:M}}g.create=N;function P(v){var p=v;return A.objectLiteral(p)&&A.numberRange(p.red,0,1)&&A.numberRange(p.green,0,1)&&A.numberRange(p.blue,0,1)&&A.numberRange(p.alpha,0,1)}g.is=P})(u||(e.Color=u={}));var d;(function(g){function N(v,p){return{range:v,color:p}}g.create=N;function P(v){var p=v;return A.objectLiteral(p)&&a.is(p.range)&&u.is(p.color)}g.is=P})(d||(e.ColorInformation=d={}));var f;(function(g){function N(v,p,C){return{label:v,textEdit:p,additionalTextEdits:C}}g.create=N;function P(v){var p=v;return A.objectLiteral(p)&&A.string(p.label)&&(A.undefined(p.textEdit)||D.is(p))&&(A.undefined(p.additionalTextEdits)||A.typedArray(p.additionalTextEdits,D.is))}g.is=P})(f||(e.ColorPresentation=f={}));var h;(function(g){g.Comment="comment",g.Imports="imports",g.Region="region"})(h||(e.FoldingRangeKind=h={}));var y;(function(g){function N(v,p,C,M,ae,mt){var Je={startLine:v,endLine:p};return A.defined(C)&&(Je.startCharacter=C),A.defined(M)&&(Je.endCharacter=M),A.defined(ae)&&(Je.kind=ae),A.defined(mt)&&(Je.collapsedText=mt),Je}g.create=N;function P(v){var p=v;return A.objectLiteral(p)&&A.uinteger(p.startLine)&&A.uinteger(p.startLine)&&(A.undefined(p.startCharacter)||A.uinteger(p.startCharacter))&&(A.undefined(p.endCharacter)||A.uinteger(p.endCharacter))&&(A.undefined(p.kind)||A.string(p.kind))}g.is=P})(y||(e.FoldingRange=y={}));var m;(function(g){function N(v,p){return{location:v,message:p}}g.create=N;function P(v){var p=v;return A.defined(p)&&c.is(p.location)&&A.string(p.message)}g.is=P})(m||(e.DiagnosticRelatedInformation=m={}));var _;(function(g){g.Error=1,g.Warning=2,g.Information=3,g.Hint=4})(_||(e.DiagnosticSeverity=_={}));var E;(function(g){g.Unnecessary=1,g.Deprecated=2})(E||(e.DiagnosticTag=E={}));var T;(function(g){function N(P){var v=P;return A.objectLiteral(v)&&A.string(v.href)}g.is=N})(T||(e.CodeDescription=T={}));var b;(function(g){function N(v,p,C,M,ae,mt){var Je={range:v,message:p};return A.defined(C)&&(Je.severity=C),A.defined(M)&&(Je.code=M),A.defined(ae)&&(Je.source=ae),A.defined(mt)&&(Je.relatedInformation=mt),Je}g.create=N;function P(v){var p,C=v;return A.defined(C)&&a.is(C.range)&&A.string(C.message)&&(A.number(C.severity)||A.undefined(C.severity))&&(A.integer(C.code)||A.string(C.code)||A.undefined(C.code))&&(A.undefined(C.codeDescription)||A.string((p=C.codeDescription)===null||p===void 0?void 0:p.href))&&(A.string(C.source)||A.undefined(C.source))&&(A.undefined(C.relatedInformation)||A.typedArray(C.relatedInformation,m.is))}g.is=P})(b||(e.Diagnostic=b={}));var R;(function(g){function N(v,p){for(var C=[],M=2;M<arguments.length;M++)C[M-2]=arguments[M];var ae={title:v,command:p};return A.defined(C)&&C.length>0&&(ae.arguments=C),ae}g.create=N;function P(v){var p=v;return A.defined(p)&&A.string(p.title)&&A.string(p.command)}g.is=P})(R||(e.Command=R={}));var D;(function(g){function N(C,M){return{range:C,newText:M}}g.replace=N;function P(C,M){return{range:{start:C,end:C},newText:M}}g.insert=P;function v(C){return{range:C,newText:""}}g.del=v;function p(C){var M=C;return A.objectLiteral(M)&&A.string(M.newText)&&a.is(M.range)}g.is=p})(D||(e.TextEdit=D={}));var L;(function(g){function N(v,p,C){var M={label:v};return p!==void 0&&(M.needsConfirmation=p),C!==void 0&&(M.description=C),M}g.create=N;function P(v){var p=v;return A.objectLiteral(p)&&A.string(p.label)&&(A.boolean(p.needsConfirmation)||p.needsConfirmation===void 0)&&(A.string(p.description)||p.description===void 0)}g.is=P})(L||(e.ChangeAnnotation=L={}));var H;(function(g){function N(P){var v=P;return A.string(v)}g.is=N})(H||(e.ChangeAnnotationIdentifier=H={}));var U;(function(g){function N(C,M,ae){return{range:C,newText:M,annotationId:ae}}g.replace=N;function P(C,M,ae){return{range:{start:C,end:C},newText:M,annotationId:ae}}g.insert=P;function v(C,M){return{range:C,newText:"",annotationId:M}}g.del=v;function p(C){var M=C;return D.is(M)&&(L.is(M.annotationId)||H.is(M.annotationId))}g.is=p})(U||(e.AnnotatedTextEdit=U={}));var oe;(function(g){function N(v,p){return{textDocument:v,edits:p}}g.create=N;function P(v){var p=v;return A.defined(p)&&si.is(p.textDocument)&&Array.isArray(p.edits)}g.is=P})(oe||(e.TextDocumentEdit=oe={}));var Be;(function(g){function N(v,p,C){var M={kind:"create",uri:v};return p!==void 0&&(p.overwrite!==void 0||p.ignoreIfExists!==void 0)&&(M.options=p),C!==void 0&&(M.annotationId=C),M}g.create=N;function P(v){var p=v;return p&&p.kind==="create"&&A.string(p.uri)&&(p.options===void 0||(p.options.overwrite===void 0||A.boolean(p.options.overwrite))&&(p.options.ignoreIfExists===void 0||A.boolean(p.options.ignoreIfExists)))&&(p.annotationId===void 0||H.is(p.annotationId))}g.is=P})(Be||(e.CreateFile=Be={}));var Rt;(function(g){function N(v,p,C,M){var ae={kind:"rename",oldUri:v,newUri:p};return C!==void 0&&(C.overwrite!==void 0||C.ignoreIfExists!==void 0)&&(ae.options=C),M!==void 0&&(ae.annotationId=M),ae}g.create=N;function P(v){var p=v;return p&&p.kind==="rename"&&A.string(p.oldUri)&&A.string(p.newUri)&&(p.options===void 0||(p.options.overwrite===void 0||A.boolean(p.options.overwrite))&&(p.options.ignoreIfExists===void 0||A.boolean(p.options.ignoreIfExists)))&&(p.annotationId===void 0||H.is(p.annotationId))}g.is=P})(Rt||(e.RenameFile=Rt={}));var me;(function(g){function N(v,p,C){var M={kind:"delete",uri:v};return p!==void 0&&(p.recursive!==void 0||p.ignoreIfNotExists!==void 0)&&(M.options=p),C!==void 0&&(M.annotationId=C),M}g.create=N;function P(v){var p=v;return p&&p.kind==="delete"&&A.string(p.uri)&&(p.options===void 0||(p.options.recursive===void 0||A.boolean(p.options.recursive))&&(p.options.ignoreIfNotExists===void 0||A.boolean(p.options.ignoreIfNotExists)))&&(p.annotationId===void 0||H.is(p.annotationId))}g.is=P})(me||(e.DeleteFile=me={}));var Fn;(function(g){function N(P){var v=P;return v&&(v.changes!==void 0||v.documentChanges!==void 0)&&(v.documentChanges===void 0||v.documentChanges.every(function(p){return A.string(p.kind)?Be.is(p)||Rt.is(p)||me.is(p):oe.is(p)}))}g.is=N})(Fn||(e.WorkspaceEdit=Fn={}));var us=function(){function g(N,P){this.edits=N,this.changeAnnotations=P}return g.prototype.insert=function(N,P,v){var p,C;if(v===void 0?p=D.insert(N,P):H.is(v)?(C=v,p=U.insert(N,P,v)):(this.assertChangeAnnotations(this.changeAnnotations),C=this.changeAnnotations.manage(v),p=U.insert(N,P,C)),this.edits.push(p),C!==void 0)return C},g.prototype.replace=function(N,P,v){var p,C;if(v===void 0?p=D.replace(N,P):H.is(v)?(C=v,p=U.replace(N,P,v)):(this.assertChangeAnnotations(this.changeAnnotations),C=this.changeAnnotations.manage(v),p=U.replace(N,P,C)),this.edits.push(p),C!==void 0)return C},g.prototype.delete=function(N,P){var v,p;if(P===void 0?v=D.del(N):H.is(P)?(p=P,v=U.del(N,P)):(this.assertChangeAnnotations(this.changeAnnotations),p=this.changeAnnotations.manage(P),v=U.del(N,p)),this.edits.push(v),p!==void 0)return p},g.prototype.add=function(N){this.edits.push(N)},g.prototype.all=function(){return this.edits},g.prototype.clear=function(){this.edits.splice(0,this.edits.length)},g.prototype.assertChangeAnnotations=function(N){if(N===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},g}(),Ol=function(){function g(N){this._annotations=N===void 0?Object.create(null):N,this._counter=0,this._size=0}return g.prototype.all=function(){return this._annotations},Object.defineProperty(g.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),g.prototype.manage=function(N,P){var v;if(H.is(N)?v=N:(v=this.nextId(),P=N),this._annotations[v]!==void 0)throw new Error("Id ".concat(v," is already in use."));if(P===void 0)throw new Error("No annotation provided for id ".concat(v));return this._annotations[v]=P,this._size++,v},g.prototype.nextId=function(){return this._counter++,this._counter.toString()},g}(),pp=function(){function g(N){var P=this;this._textEditChanges=Object.create(null),N!==void 0?(this._workspaceEdit=N,N.documentChanges?(this._changeAnnotations=new Ol(N.changeAnnotations),N.changeAnnotations=this._changeAnnotations.all(),N.documentChanges.forEach(function(v){if(oe.is(v)){var p=new us(v.edits,P._changeAnnotations);P._textEditChanges[v.textDocument.uri]=p}})):N.changes&&Object.keys(N.changes).forEach(function(v){var p=new us(N.changes[v]);P._textEditChanges[v]=p})):this._workspaceEdit={}}return Object.defineProperty(g.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),g.prototype.getTextEditChange=function(N){if(si.is(N)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var P={uri:N.uri,version:N.version},v=this._textEditChanges[P.uri];if(!v){var p=[],C={textDocument:P,edits:p};this._workspaceEdit.documentChanges.push(C),v=new us(p,this._changeAnnotations),this._textEditChanges[P.uri]=v}return v}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var v=this._textEditChanges[N];if(!v){var p=[];this._workspaceEdit.changes[N]=p,v=new us(p),this._textEditChanges[N]=v}return v}},g.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Ol,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},g.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},g.prototype.createFile=function(N,P,v){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var p;L.is(P)||H.is(P)?p=P:v=P;var C,M;if(p===void 0?C=Be.create(N,v):(M=H.is(p)?p:this._changeAnnotations.manage(p),C=Be.create(N,v,M)),this._workspaceEdit.documentChanges.push(C),M!==void 0)return M},g.prototype.renameFile=function(N,P,v,p){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var C;L.is(v)||H.is(v)?C=v:p=v;var M,ae;if(C===void 0?M=Rt.create(N,P,p):(ae=H.is(C)?C:this._changeAnnotations.manage(C),M=Rt.create(N,P,p,ae)),this._workspaceEdit.documentChanges.push(M),ae!==void 0)return ae},g.prototype.deleteFile=function(N,P,v){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var p;L.is(P)||H.is(P)?p=P:v=P;var C,M;if(p===void 0?C=me.create(N,v):(M=H.is(p)?p:this._changeAnnotations.manage(p),C=me.create(N,v,M)),this._workspaceEdit.documentChanges.push(C),M!==void 0)return M},g}();e.WorkspaceChange=pp;var Il;(function(g){function N(v){return{uri:v}}g.create=N;function P(v){var p=v;return A.defined(p)&&A.string(p.uri)}g.is=P})(Il||(e.TextDocumentIdentifier=Il={}));var wa;(function(g){function N(v,p){return{uri:v,version:p}}g.create=N;function P(v){var p=v;return A.defined(p)&&A.string(p.uri)&&A.integer(p.version)}g.is=P})(wa||(e.VersionedTextDocumentIdentifier=wa={}));var si;(function(g){function N(v,p){return{uri:v,version:p}}g.create=N;function P(v){var p=v;return A.defined(p)&&A.string(p.uri)&&(p.version===null||A.integer(p.version))}g.is=P})(si||(e.OptionalVersionedTextDocumentIdentifier=si={}));var Gr;(function(g){function N(v,p,C,M){return{uri:v,languageId:p,version:C,text:M}}g.create=N;function P(v){var p=v;return A.defined(p)&&A.string(p.uri)&&A.string(p.languageId)&&A.integer(p.version)&&A.string(p.text)}g.is=P})(Gr||(e.TextDocumentItem=Gr={}));var Ki;(function(g){g.PlainText="plaintext",g.Markdown="markdown";function N(P){var v=P;return v===g.PlainText||v===g.Markdown}g.is=N})(Ki||(e.MarkupKind=Ki={}));var ii;(function(g){function N(P){var v=P;return A.objectLiteral(P)&&Ki.is(v.kind)&&A.string(v.value)}g.is=N})(ii||(e.MarkupContent=ii={}));var xl;(function(g){g.Text=1,g.Method=2,g.Function=3,g.Constructor=4,g.Field=5,g.Variable=6,g.Class=7,g.Interface=8,g.Module=9,g.Property=10,g.Unit=11,g.Value=12,g.Enum=13,g.Keyword=14,g.Snippet=15,g.Color=16,g.File=17,g.Reference=18,g.Folder=19,g.EnumMember=20,g.Constant=21,g.Struct=22,g.Event=23,g.Operator=24,g.TypeParameter=25})(xl||(e.CompletionItemKind=xl={}));var ka;(function(g){g.PlainText=1,g.Snippet=2})(ka||(e.InsertTextFormat=ka={}));var Na;(function(g){g.Deprecated=1})(Na||(e.CompletionItemTag=Na={}));var Ml;(function(g){function N(v,p,C){return{newText:v,insert:p,replace:C}}g.create=N;function P(v){var p=v;return p&&A.string(p.newText)&&a.is(p.insert)&&a.is(p.replace)}g.is=P})(Ml||(e.InsertReplaceEdit=Ml={}));var Ll;(function(g){g.asIs=1,g.adjustIndentation=2})(Ll||(e.InsertTextMode=Ll={}));var $l;(function(g){function N(P){var v=P;return v&&(A.string(v.detail)||v.detail===void 0)&&(A.string(v.description)||v.description===void 0)}g.is=N})($l||(e.CompletionItemLabelDetails=$l={}));var ql;(function(g){function N(P){return{label:P}}g.create=N})(ql||(e.CompletionItem=ql={}));var jl;(function(g){function N(P,v){return{items:P||[],isIncomplete:!!v}}g.create=N})(jl||(e.CompletionList=jl={}));var Yi;(function(g){function N(v){return v.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}g.fromPlainText=N;function P(v){var p=v;return A.string(p)||A.objectLiteral(p)&&A.string(p.language)&&A.string(p.value)}g.is=P})(Yi||(e.MarkedString=Yi={}));var sr;(function(g){function N(P){var v=P;return!!v&&A.objectLiteral(v)&&(ii.is(v.contents)||Yi.is(v.contents)||A.typedArray(v.contents,Yi.is))&&(P.range===void 0||a.is(P.range))}g.is=N})(sr||(e.Hover=sr={}));var Fl;(function(g){function N(P,v){return v?{label:P,documentation:v}:{label:P}}g.create=N})(Fl||(e.ParameterInformation=Fl={}));var Bl;(function(g){function N(P,v){for(var p=[],C=2;C<arguments.length;C++)p[C-2]=arguments[C];var M={label:P};return A.defined(v)&&(M.documentation=v),A.defined(p)?M.parameters=p:M.parameters=[],M}g.create=N})(Bl||(e.SignatureInformation=Bl={}));var oi;(function(g){g.Text=1,g.Read=2,g.Write=3})(oi||(e.DocumentHighlightKind=oi={}));var Ul;(function(g){function N(P,v){var p={range:P};return A.number(v)&&(p.kind=v),p}g.create=N})(Ul||(e.DocumentHighlight=Ul={}));var Xi;(function(g){g.File=1,g.Module=2,g.Namespace=3,g.Package=4,g.Class=5,g.Method=6,g.Property=7,g.Field=8,g.Constructor=9,g.Enum=10,g.Interface=11,g.Function=12,g.Variable=13,g.Constant=14,g.String=15,g.Number=16,g.Boolean=17,g.Array=18,g.Object=19,g.Key=20,g.Null=21,g.EnumMember=22,g.Struct=23,g.Event=24,g.Operator=25,g.TypeParameter=26})(Xi||(e.SymbolKind=Xi={}));var Vl;(function(g){g.Deprecated=1})(Vl||(e.SymbolTag=Vl={}));var Kr;(function(g){function N(P,v,p,C,M){var ae={name:P,kind:v,location:{uri:C,range:p}};return M&&(ae.containerName=M),ae}g.create=N})(Kr||(e.SymbolInformation=Kr={}));var ds;(function(g){function N(P,v,p,C){return C!==void 0?{name:P,kind:v,location:{uri:p,range:C}}:{name:P,kind:v,location:{uri:p}}}g.create=N})(ds||(e.WorkspaceSymbol=ds={}));var zl;(function(g){function N(v,p,C,M,ae,mt){var Je={name:v,detail:p,kind:C,range:M,selectionRange:ae};return mt!==void 0&&(Je.children=mt),Je}g.create=N;function P(v){var p=v;return p&&A.string(p.name)&&A.number(p.kind)&&a.is(p.range)&&a.is(p.selectionRange)&&(p.detail===void 0||A.string(p.detail))&&(p.deprecated===void 0||A.boolean(p.deprecated))&&(p.children===void 0||Array.isArray(p.children))&&(p.tags===void 0||Array.isArray(p.tags))}g.is=P})(zl||(e.DocumentSymbol=zl={}));var Wl;(function(g){g.Empty="",g.QuickFix="quickfix",g.Refactor="refactor",g.RefactorExtract="refactor.extract",g.RefactorInline="refactor.inline",g.RefactorRewrite="refactor.rewrite",g.Source="source",g.SourceOrganizeImports="source.organizeImports",g.SourceFixAll="source.fixAll"})(Wl||(e.CodeActionKind=Wl={}));var Pr;(function(g){g.Invoked=1,g.Automatic=2})(Pr||(e.CodeActionTriggerKind=Pr={}));var Pa;(function(g){function N(v,p,C){var M={diagnostics:v};return p!=null&&(M.only=p),C!=null&&(M.triggerKind=C),M}g.create=N;function P(v){var p=v;return A.defined(p)&&A.typedArray(p.diagnostics,b.is)&&(p.only===void 0||A.typedArray(p.only,A.string))&&(p.triggerKind===void 0||p.triggerKind===Pr.Invoked||p.triggerKind===Pr.Automatic)}g.is=P})(Pa||(e.CodeActionContext=Pa={}));var Ra;(function(g){function N(v,p,C){var M={title:v},ae=!0;return typeof p=="string"?(ae=!1,M.kind=p):R.is(p)?M.command=p:M.edit=p,ae&&C!==void 0&&(M.kind=C),M}g.create=N;function P(v){var p=v;return p&&A.string(p.title)&&(p.diagnostics===void 0||A.typedArray(p.diagnostics,b.is))&&(p.kind===void 0||A.string(p.kind))&&(p.edit!==void 0||p.command!==void 0)&&(p.command===void 0||R.is(p.command))&&(p.isPreferred===void 0||A.boolean(p.isPreferred))&&(p.edit===void 0||Fn.is(p.edit))}g.is=P})(Ra||(e.CodeAction=Ra={}));var Ji;(function(g){function N(v,p){var C={range:v};return A.defined(p)&&(C.data=p),C}g.create=N;function P(v){var p=v;return A.defined(p)&&a.is(p.range)&&(A.undefined(p.command)||R.is(p.command))}g.is=P})(Ji||(e.CodeLens=Ji={}));var Da;(function(g){function N(v,p){return{tabSize:v,insertSpaces:p}}g.create=N;function P(v){var p=v;return A.defined(p)&&A.uinteger(p.tabSize)&&A.boolean(p.insertSpaces)}g.is=P})(Da||(e.FormattingOptions=Da={}));var Yr;(function(g){function N(v,p,C){return{range:v,target:p,data:C}}g.create=N;function P(v){var p=v;return A.defined(p)&&a.is(p.range)&&(A.undefined(p.target)||A.string(p.target))}g.is=P})(Yr||(e.DocumentLink=Yr={}));var k;(function(g){function N(v,p){return{range:v,parent:p}}g.create=N;function P(v){var p=v;return A.objectLiteral(p)&&a.is(p.range)&&(p.parent===void 0||g.is(p.parent))}g.is=P})(k||(e.SelectionRange=k={}));var x;(function(g){g.namespace="namespace",g.type="type",g.class="class",g.enum="enum",g.interface="interface",g.struct="struct",g.typeParameter="typeParameter",g.parameter="parameter",g.variable="variable",g.property="property",g.enumMember="enumMember",g.event="event",g.function="function",g.method="method",g.macro="macro",g.keyword="keyword",g.modifier="modifier",g.comment="comment",g.string="string",g.number="number",g.regexp="regexp",g.operator="operator",g.decorator="decorator"})(x||(e.SemanticTokenTypes=x={}));var V;(function(g){g.declaration="declaration",g.definition="definition",g.readonly="readonly",g.static="static",g.deprecated="deprecated",g.abstract="abstract",g.async="async",g.modification="modification",g.documentation="documentation",g.defaultLibrary="defaultLibrary"})(V||(e.SemanticTokenModifiers=V={}));var X;(function(g){function N(P){var v=P;return A.objectLiteral(v)&&(v.resultId===void 0||typeof v.resultId=="string")&&Array.isArray(v.data)&&(v.data.length===0||typeof v.data[0]=="number")}g.is=N})(X||(e.SemanticTokens=X={}));var Ue;(function(g){function N(v,p){return{range:v,text:p}}g.create=N;function P(v){var p=v;return p!=null&&a.is(p.range)&&A.string(p.text)}g.is=P})(Ue||(e.InlineValueText=Ue={}));var Me;(function(g){function N(v,p,C){return{range:v,variableName:p,caseSensitiveLookup:C}}g.create=N;function P(v){var p=v;return p!=null&&a.is(p.range)&&A.boolean(p.caseSensitiveLookup)&&(A.string(p.variableName)||p.variableName===void 0)}g.is=P})(Me||(e.InlineValueVariableLookup=Me={}));var nt;(function(g){function N(v,p){return{range:v,expression:p}}g.create=N;function P(v){var p=v;return p!=null&&a.is(p.range)&&(A.string(p.expression)||p.expression===void 0)}g.is=P})(nt||(e.InlineValueEvaluatableExpression=nt={}));var lt;(function(g){function N(v,p){return{frameId:v,stoppedLocation:p}}g.create=N;function P(v){var p=v;return A.defined(p)&&a.is(v.stoppedLocation)}g.is=P})(lt||(e.InlineValueContext=lt={}));var ge;(function(g){g.Type=1,g.Parameter=2;function N(P){return P===1||P===2}g.is=N})(ge||(e.InlayHintKind=ge={}));var Ge;(function(g){function N(v){return{value:v}}g.create=N;function P(v){var p=v;return A.objectLiteral(p)&&(p.tooltip===void 0||A.string(p.tooltip)||ii.is(p.tooltip))&&(p.location===void 0||c.is(p.location))&&(p.command===void 0||R.is(p.command))}g.is=P})(Ge||(e.InlayHintLabelPart=Ge={}));var De;(function(g){function N(v,p,C){var M={position:v,label:p};return C!==void 0&&(M.kind=C),M}g.create=N;function P(v){var p=v;return A.objectLiteral(p)&&o.is(p.position)&&(A.string(p.label)||A.typedArray(p.label,Ge.is))&&(p.kind===void 0||ge.is(p.kind))&&p.textEdits===void 0||A.typedArray(p.textEdits,D.is)&&(p.tooltip===void 0||A.string(p.tooltip)||ii.is(p.tooltip))&&(p.paddingLeft===void 0||A.boolean(p.paddingLeft))&&(p.paddingRight===void 0||A.boolean(p.paddingRight))}g.is=P})(De||(e.InlayHint=De={}));var pt;(function(g){function N(P){return{kind:"snippet",value:P}}g.createSnippet=N})(pt||(e.StringValue=pt={}));var xt;(function(g){function N(P,v,p,C){return{insertText:P,filterText:v,range:p,command:C}}g.create=N})(xt||(e.InlineCompletionItem=xt={}));var An;(function(g){function N(P){return{items:P}}g.create=N})(An||(e.InlineCompletionList=An={}));var Hl;(function(g){g.Invoked=0,g.Automatic=1})(Hl||(e.InlineCompletionTriggerKind=Hl={}));var o_;(function(g){function N(P,v){return{range:P,text:v}}g.create=N})(o_||(e.SelectedCompletionInfo=o_={}));var a_;(function(g){function N(P,v){return{triggerKind:P,selectedCompletionInfo:v}}g.create=N})(a_||(e.InlineCompletionContext=a_={}));var c_;(function(g){function N(P){var v=P;return A.objectLiteral(v)&&r.is(v.uri)&&A.string(v.name)}g.is=N})(c_||(e.WorkspaceFolder=c_={})),e.EOL=[`
33
33
  `,`\r
34
- `,"\r"];var LT;(function(g){function N(D,x,oe,dt){return new cI(D,x,oe,dt)}g.create=N;function P(D){var x=D;return!!(C.defined(x)&&C.string(x.uri)&&(C.undefined(x.languageId)||C.string(x.languageId))&&C.uinteger(x.lineCount)&&C.func(x.getText)&&C.func(x.positionAt)&&C.func(x.offsetAt))}g.is=P;function b(D,x){for(var oe=D.getText(),dt=h(x,function(zi,ql){var qT=zi.range.start.line-ql.range.start.line;return qT===0?zi.range.start.character-ql.range.start.character:qT}),Ge=oe.length,rr=dt.length-1;rr>=0;rr--){var sr=dt[rr],Kr=D.offsetAt(sr.range.start),be=D.offsetAt(sr.range.end);if(be<=Ge)oe=oe.substring(0,Kr)+sr.newText+oe.substring(be,oe.length);else throw new Error("Overlapping edit");Ge=Kr}return oe}g.applyEdits=b;function h(D,x){if(D.length<=1)return D;var oe=D.length/2|0,dt=D.slice(0,oe),Ge=D.slice(oe);h(dt,x),h(Ge,x);for(var rr=0,sr=0,Kr=0;rr<dt.length&&sr<Ge.length;){var be=x(dt[rr],Ge[sr]);be<=0?D[Kr++]=dt[rr++]:D[Kr++]=Ge[sr++]}for(;rr<dt.length;)D[Kr++]=dt[rr++];for(;sr<Ge.length;)D[Kr++]=Ge[sr++];return D}})(LT||(e.TextDocument=LT={}));var cI=function(){function g(N,P,b,h){this._uri=N,this._languageId=P,this._version=b,this._content=h,this._lineOffsets=void 0}return Object.defineProperty(g.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),g.prototype.getText=function(N){if(N){var P=this.offsetAt(N.start),b=this.offsetAt(N.end);return this._content.substring(P,b)}return this._content},g.prototype.update=function(N,P){this._content=N.text,this._version=P,this._lineOffsets=void 0},g.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var N=[],P=this._content,b=!0,h=0;h<P.length;h++){b&&(N.push(h),b=!1);var D=P.charAt(h);b=D==="\r"||D===`
35
- `,D==="\r"&&h+1<P.length&&P.charAt(h+1)===`
36
- `&&h++}b&&P.length>0&&N.push(P.length),this._lineOffsets=N}return this._lineOffsets},g.prototype.positionAt=function(N){N=Math.max(Math.min(N,this._content.length),0);var P=this.getLineOffsets(),b=0,h=P.length;if(h===0)return o.create(0,N);for(;b<h;){var D=Math.floor((b+h)/2);P[D]>N?h=D:b=D+1}var x=b-1;return o.create(x,N-P[x])},g.prototype.offsetAt=function(N){var P=this.getLineOffsets();if(N.line>=P.length)return this._content.length;if(N.line<0)return 0;var b=P[N.line],h=N.line+1<P.length?P[N.line+1]:this._content.length;return Math.max(Math.min(b+N.character,h),b)},Object.defineProperty(g.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),g}(),C;(function(g){var N=Object.prototype.toString;function P(be){return typeof be<"u"}g.defined=P;function b(be){return typeof be>"u"}g.undefined=b;function h(be){return be===!0||be===!1}g.boolean=h;function D(be){return N.call(be)==="[object String]"}g.string=D;function x(be){return N.call(be)==="[object Number]"}g.number=x;function oe(be,zi,ql){return N.call(be)==="[object Number]"&&zi<=be&&be<=ql}g.numberRange=oe;function dt(be){return N.call(be)==="[object Number]"&&-2147483648<=be&&be<=2147483647}g.integer=dt;function Ge(be){return N.call(be)==="[object Number]"&&0<=be&&be<=2147483647}g.uinteger=Ge;function rr(be){return N.call(be)==="[object Function]"}g.func=rr;function sr(be){return be!==null&&typeof be=="object"}g.objectLiteral=sr;function Kr(be,zi){return Array.isArray(be)&&be.every(zi)}g.typedArray=Kr})(C||(C={}))})});var ot=E(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.ProtocolNotificationType=mn.ProtocolNotificationType0=mn.ProtocolRequestType=mn.ProtocolRequestType0=mn.RegistrationType=mn.MessageDirection=void 0;var eo=si(),vS;(function(n){n.clientToServer="clientToServer",n.serverToClient="serverToClient",n.both="both"})(vS||(mn.MessageDirection=vS={}));var pm=class{constructor(e){this.method=e}};mn.RegistrationType=pm;var mm=class extends eo.RequestType0{constructor(e){super(e)}};mn.ProtocolRequestType0=mm;var gm=class extends eo.RequestType{constructor(e){super(e,eo.ParameterStructures.byName)}};mn.ProtocolRequestType=gm;var ym=class extends eo.NotificationType0{constructor(e){super(e)}};mn.ProtocolNotificationType0=ym;var bm=class extends eo.NotificationType{constructor(e){super(e,eo.ParameterStructures.byName)}};mn.ProtocolNotificationType=bm});var lu=E(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.objectLiteral=Tt.typedArray=Tt.stringArray=Tt.array=Tt.func=Tt.error=Tt.number=Tt.string=Tt.boolean=void 0;function nx(n){return n===!0||n===!1}Tt.boolean=nx;function TS(n){return typeof n=="string"||n instanceof String}Tt.string=TS;function rx(n){return typeof n=="number"||n instanceof Number}Tt.number=rx;function sx(n){return n instanceof Error}Tt.error=sx;function ix(n){return typeof n=="function"}Tt.func=ix;function SS(n){return Array.isArray(n)}Tt.array=SS;function ox(n){return SS(n)&&n.every(e=>TS(e))}Tt.stringArray=ox;function ax(n,e){return Array.isArray(n)&&n.every(e)}Tt.typedArray=ax;function cx(n){return n!==null&&typeof n=="object"}Tt.objectLiteral=cx});var wS=E(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.ImplementationRequest=void 0;var _S=ot(),ES;(function(n){n.method="textDocument/implementation",n.messageDirection=_S.MessageDirection.clientToServer,n.type=new _S.ProtocolRequestType(n.method)})(ES||(uu.ImplementationRequest=ES={}))});var PS=E(du=>{"use strict";Object.defineProperty(du,"__esModule",{value:!0});du.TypeDefinitionRequest=void 0;var kS=ot(),NS;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=kS.MessageDirection.clientToServer,n.type=new kS.ProtocolRequestType(n.method)})(NS||(du.TypeDefinitionRequest=NS={}))});var CS=E(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.DidChangeWorkspaceFoldersNotification=to.WorkspaceFoldersRequest=void 0;var fu=ot(),RS;(function(n){n.method="workspace/workspaceFolders",n.messageDirection=fu.MessageDirection.serverToClient,n.type=new fu.ProtocolRequestType0(n.method)})(RS||(to.WorkspaceFoldersRequest=RS={}));var DS;(function(n){n.method="workspace/didChangeWorkspaceFolders",n.messageDirection=fu.MessageDirection.clientToServer,n.type=new fu.ProtocolNotificationType(n.method)})(DS||(to.DidChangeWorkspaceFoldersNotification=DS={}))});var IS=E(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});hu.ConfigurationRequest=void 0;var AS=ot(),OS;(function(n){n.method="workspace/configuration",n.messageDirection=AS.MessageDirection.serverToClient,n.type=new AS.ProtocolRequestType(n.method)})(OS||(hu.ConfigurationRequest=OS={}))});var $S=E(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.ColorPresentationRequest=no.DocumentColorRequest=void 0;var pu=ot(),xS;(function(n){n.method="textDocument/documentColor",n.messageDirection=pu.MessageDirection.clientToServer,n.type=new pu.ProtocolRequestType(n.method)})(xS||(no.DocumentColorRequest=xS={}));var MS;(function(n){n.method="textDocument/colorPresentation",n.messageDirection=pu.MessageDirection.clientToServer,n.type=new pu.ProtocolRequestType(n.method)})(MS||(no.ColorPresentationRequest=MS={}))});var jS=E(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.FoldingRangeRefreshRequest=ro.FoldingRangeRequest=void 0;var mu=ot(),LS;(function(n){n.method="textDocument/foldingRange",n.messageDirection=mu.MessageDirection.clientToServer,n.type=new mu.ProtocolRequestType(n.method)})(LS||(ro.FoldingRangeRequest=LS={}));var qS;(function(n){n.method="workspace/foldingRange/refresh",n.messageDirection=mu.MessageDirection.serverToClient,n.type=new mu.ProtocolRequestType0(n.method)})(qS||(ro.FoldingRangeRefreshRequest=qS={}))});var US=E(gu=>{"use strict";Object.defineProperty(gu,"__esModule",{value:!0});gu.DeclarationRequest=void 0;var FS=ot(),BS;(function(n){n.method="textDocument/declaration",n.messageDirection=FS.MessageDirection.clientToServer,n.type=new FS.ProtocolRequestType(n.method)})(BS||(gu.DeclarationRequest=BS={}))});var zS=E(yu=>{"use strict";Object.defineProperty(yu,"__esModule",{value:!0});yu.SelectionRangeRequest=void 0;var VS=ot(),WS;(function(n){n.method="textDocument/selectionRange",n.messageDirection=VS.MessageDirection.clientToServer,n.type=new VS.ProtocolRequestType(n.method)})(WS||(yu.SelectionRangeRequest=WS={}))});var YS=E(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});hs.WorkDoneProgressCancelNotification=hs.WorkDoneProgressCreateRequest=hs.WorkDoneProgress=void 0;var lx=si(),bu=ot(),HS;(function(n){n.type=new lx.ProgressType;function e(t){return t===n.type}n.is=e})(HS||(hs.WorkDoneProgress=HS={}));var KS;(function(n){n.method="window/workDoneProgress/create",n.messageDirection=bu.MessageDirection.serverToClient,n.type=new bu.ProtocolRequestType(n.method)})(KS||(hs.WorkDoneProgressCreateRequest=KS={}));var GS;(function(n){n.method="window/workDoneProgress/cancel",n.messageDirection=bu.MessageDirection.clientToServer,n.type=new bu.ProtocolNotificationType(n.method)})(GS||(hs.WorkDoneProgressCancelNotification=GS={}))});var ZS=E(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});ps.CallHierarchyOutgoingCallsRequest=ps.CallHierarchyIncomingCallsRequest=ps.CallHierarchyPrepareRequest=void 0;var so=ot(),JS;(function(n){n.method="textDocument/prepareCallHierarchy",n.messageDirection=so.MessageDirection.clientToServer,n.type=new so.ProtocolRequestType(n.method)})(JS||(ps.CallHierarchyPrepareRequest=JS={}));var XS;(function(n){n.method="callHierarchy/incomingCalls",n.messageDirection=so.MessageDirection.clientToServer,n.type=new so.ProtocolRequestType(n.method)})(XS||(ps.CallHierarchyIncomingCallsRequest=XS={}));var QS;(function(n){n.method="callHierarchy/outgoingCalls",n.messageDirection=so.MessageDirection.clientToServer,n.type=new so.ProtocolRequestType(n.method)})(QS||(ps.CallHierarchyOutgoingCallsRequest=QS={}))});var i_=E(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.SemanticTokensRefreshRequest=gn.SemanticTokensRangeRequest=gn.SemanticTokensDeltaRequest=gn.SemanticTokensRequest=gn.SemanticTokensRegistrationType=gn.TokenFormat=void 0;var Yr=ot(),e_;(function(n){n.Relative="relative"})(e_||(gn.TokenFormat=e_={}));var Pa;(function(n){n.method="textDocument/semanticTokens",n.type=new Yr.RegistrationType(n.method)})(Pa||(gn.SemanticTokensRegistrationType=Pa={}));var t_;(function(n){n.method="textDocument/semanticTokens/full",n.messageDirection=Yr.MessageDirection.clientToServer,n.type=new Yr.ProtocolRequestType(n.method),n.registrationMethod=Pa.method})(t_||(gn.SemanticTokensRequest=t_={}));var n_;(function(n){n.method="textDocument/semanticTokens/full/delta",n.messageDirection=Yr.MessageDirection.clientToServer,n.type=new Yr.ProtocolRequestType(n.method),n.registrationMethod=Pa.method})(n_||(gn.SemanticTokensDeltaRequest=n_={}));var r_;(function(n){n.method="textDocument/semanticTokens/range",n.messageDirection=Yr.MessageDirection.clientToServer,n.type=new Yr.ProtocolRequestType(n.method),n.registrationMethod=Pa.method})(r_||(gn.SemanticTokensRangeRequest=r_={}));var s_;(function(n){n.method="workspace/semanticTokens/refresh",n.messageDirection=Yr.MessageDirection.serverToClient,n.type=new Yr.ProtocolRequestType0(n.method)})(s_||(gn.SemanticTokensRefreshRequest=s_={}))});var c_=E(vu=>{"use strict";Object.defineProperty(vu,"__esModule",{value:!0});vu.ShowDocumentRequest=void 0;var o_=ot(),a_;(function(n){n.method="window/showDocument",n.messageDirection=o_.MessageDirection.serverToClient,n.type=new o_.ProtocolRequestType(n.method)})(a_||(vu.ShowDocumentRequest=a_={}))});var d_=E(Tu=>{"use strict";Object.defineProperty(Tu,"__esModule",{value:!0});Tu.LinkedEditingRangeRequest=void 0;var l_=ot(),u_;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=l_.MessageDirection.clientToServer,n.type=new l_.ProtocolRequestType(n.method)})(u_||(Tu.LinkedEditingRangeRequest=u_={}))});var v_=E(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.WillDeleteFilesRequest=Yt.DidDeleteFilesNotification=Yt.DidRenameFilesNotification=Yt.WillRenameFilesRequest=Yt.DidCreateFilesNotification=Yt.WillCreateFilesRequest=Yt.FileOperationPatternKind=void 0;var qn=ot(),f_;(function(n){n.file="file",n.folder="folder"})(f_||(Yt.FileOperationPatternKind=f_={}));var h_;(function(n){n.method="workspace/willCreateFiles",n.messageDirection=qn.MessageDirection.clientToServer,n.type=new qn.ProtocolRequestType(n.method)})(h_||(Yt.WillCreateFilesRequest=h_={}));var p_;(function(n){n.method="workspace/didCreateFiles",n.messageDirection=qn.MessageDirection.clientToServer,n.type=new qn.ProtocolNotificationType(n.method)})(p_||(Yt.DidCreateFilesNotification=p_={}));var m_;(function(n){n.method="workspace/willRenameFiles",n.messageDirection=qn.MessageDirection.clientToServer,n.type=new qn.ProtocolRequestType(n.method)})(m_||(Yt.WillRenameFilesRequest=m_={}));var g_;(function(n){n.method="workspace/didRenameFiles",n.messageDirection=qn.MessageDirection.clientToServer,n.type=new qn.ProtocolNotificationType(n.method)})(g_||(Yt.DidRenameFilesNotification=g_={}));var y_;(function(n){n.method="workspace/didDeleteFiles",n.messageDirection=qn.MessageDirection.clientToServer,n.type=new qn.ProtocolNotificationType(n.method)})(y_||(Yt.DidDeleteFilesNotification=y_={}));var b_;(function(n){n.method="workspace/willDeleteFiles",n.messageDirection=qn.MessageDirection.clientToServer,n.type=new qn.ProtocolRequestType(n.method)})(b_||(Yt.WillDeleteFilesRequest=b_={}))});var w_=E(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.MonikerRequest=ms.MonikerKind=ms.UniquenessLevel=void 0;var T_=ot(),S_;(function(n){n.document="document",n.project="project",n.group="group",n.scheme="scheme",n.global="global"})(S_||(ms.UniquenessLevel=S_={}));var __;(function(n){n.$import="import",n.$export="export",n.local="local"})(__||(ms.MonikerKind=__={}));var E_;(function(n){n.method="textDocument/moniker",n.messageDirection=T_.MessageDirection.clientToServer,n.type=new T_.ProtocolRequestType(n.method)})(E_||(ms.MonikerRequest=E_={}))});var R_=E(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.TypeHierarchySubtypesRequest=gs.TypeHierarchySupertypesRequest=gs.TypeHierarchyPrepareRequest=void 0;var io=ot(),k_;(function(n){n.method="textDocument/prepareTypeHierarchy",n.messageDirection=io.MessageDirection.clientToServer,n.type=new io.ProtocolRequestType(n.method)})(k_||(gs.TypeHierarchyPrepareRequest=k_={}));var N_;(function(n){n.method="typeHierarchy/supertypes",n.messageDirection=io.MessageDirection.clientToServer,n.type=new io.ProtocolRequestType(n.method)})(N_||(gs.TypeHierarchySupertypesRequest=N_={}));var P_;(function(n){n.method="typeHierarchy/subtypes",n.messageDirection=io.MessageDirection.clientToServer,n.type=new io.ProtocolRequestType(n.method)})(P_||(gs.TypeHierarchySubtypesRequest=P_={}))});var A_=E(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.InlineValueRefreshRequest=oo.InlineValueRequest=void 0;var Su=ot(),D_;(function(n){n.method="textDocument/inlineValue",n.messageDirection=Su.MessageDirection.clientToServer,n.type=new Su.ProtocolRequestType(n.method)})(D_||(oo.InlineValueRequest=D_={}));var C_;(function(n){n.method="workspace/inlineValue/refresh",n.messageDirection=Su.MessageDirection.serverToClient,n.type=new Su.ProtocolRequestType0(n.method)})(C_||(oo.InlineValueRefreshRequest=C_={}))});var M_=E(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});ys.InlayHintRefreshRequest=ys.InlayHintResolveRequest=ys.InlayHintRequest=void 0;var ao=ot(),O_;(function(n){n.method="textDocument/inlayHint",n.messageDirection=ao.MessageDirection.clientToServer,n.type=new ao.ProtocolRequestType(n.method)})(O_||(ys.InlayHintRequest=O_={}));var I_;(function(n){n.method="inlayHint/resolve",n.messageDirection=ao.MessageDirection.clientToServer,n.type=new ao.ProtocolRequestType(n.method)})(I_||(ys.InlayHintResolveRequest=I_={}));var x_;(function(n){n.method="workspace/inlayHint/refresh",n.messageDirection=ao.MessageDirection.serverToClient,n.type=new ao.ProtocolRequestType0(n.method)})(x_||(ys.InlayHintRefreshRequest=x_={}))});var U_=E(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.DiagnosticRefreshRequest=jn.WorkspaceDiagnosticRequest=jn.DocumentDiagnosticRequest=jn.DocumentDiagnosticReportKind=jn.DiagnosticServerCancellationData=void 0;var B_=si(),ux=lu(),co=ot(),$_;(function(n){function e(t){let r=t;return r&&ux.boolean(r.retriggerRequest)}n.is=e})($_||(jn.DiagnosticServerCancellationData=$_={}));var L_;(function(n){n.Full="full",n.Unchanged="unchanged"})(L_||(jn.DocumentDiagnosticReportKind=L_={}));var q_;(function(n){n.method="textDocument/diagnostic",n.messageDirection=co.MessageDirection.clientToServer,n.type=new co.ProtocolRequestType(n.method),n.partialResult=new B_.ProgressType})(q_||(jn.DocumentDiagnosticRequest=q_={}));var j_;(function(n){n.method="workspace/diagnostic",n.messageDirection=co.MessageDirection.clientToServer,n.type=new co.ProtocolRequestType(n.method),n.partialResult=new B_.ProgressType})(j_||(jn.WorkspaceDiagnosticRequest=j_={}));var F_;(function(n){n.method="workspace/diagnostic/refresh",n.messageDirection=co.MessageDirection.serverToClient,n.type=new co.ProtocolRequestType0(n.method)})(F_||(jn.DiagnosticRefreshRequest=F_={}))});var Y_=E(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.DidCloseNotebookDocumentNotification=ft.DidSaveNotebookDocumentNotification=ft.DidChangeNotebookDocumentNotification=ft.NotebookCellArrayChange=ft.DidOpenNotebookDocumentNotification=ft.NotebookDocumentSyncRegistrationType=ft.NotebookDocument=ft.NotebookCell=ft.ExecutionSummary=ft.NotebookCellKind=void 0;var Ra=cu(),or=lu(),wr=ot(),vm;(function(n){n.Markup=1,n.Code=2;function e(t){return t===1||t===2}n.is=e})(vm||(ft.NotebookCellKind=vm={}));var Tm;(function(n){function e(s,i){let o={executionOrder:s};return(i===!0||i===!1)&&(o.success=i),o}n.create=e;function t(s){let i=s;return or.objectLiteral(i)&&Ra.uinteger.is(i.executionOrder)&&(i.success===void 0||or.boolean(i.success))}n.is=t;function r(s,i){return s===i?!0:s==null||i===null||i===void 0?!1:s.executionOrder===i.executionOrder&&s.success===i.success}n.equals=r})(Tm||(ft.ExecutionSummary=Tm={}));var _u;(function(n){function e(i,o){return{kind:i,document:o}}n.create=e;function t(i){let o=i;return or.objectLiteral(o)&&vm.is(o.kind)&&Ra.DocumentUri.is(o.document)&&(o.metadata===void 0||or.objectLiteral(o.metadata))}n.is=t;function r(i,o){let a=new Set;return i.document!==o.document&&a.add("document"),i.kind!==o.kind&&a.add("kind"),i.executionSummary!==o.executionSummary&&a.add("executionSummary"),(i.metadata!==void 0||o.metadata!==void 0)&&!s(i.metadata,o.metadata)&&a.add("metadata"),(i.executionSummary!==void 0||o.executionSummary!==void 0)&&!Tm.equals(i.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}n.diff=r;function s(i,o){if(i===o)return!0;if(i==null||o===null||o===void 0||typeof i!=typeof o||typeof i!="object")return!1;let a=Array.isArray(i),c=Array.isArray(o);if(a!==c)return!1;if(a&&c){if(i.length!==o.length)return!1;for(let l=0;l<i.length;l++)if(!s(i[l],o[l]))return!1}if(or.objectLiteral(i)&&or.objectLiteral(o)){let l=Object.keys(i),u=Object.keys(o);if(l.length!==u.length||(l.sort(),u.sort(),!s(l,u)))return!1;for(let d=0;d<l.length;d++){let f=l[d];if(!s(i[f],o[f]))return!1}}return!0}})(_u||(ft.NotebookCell=_u={}));var V_;(function(n){function e(r,s,i,o){return{uri:r,notebookType:s,version:i,cells:o}}n.create=e;function t(r){let s=r;return or.objectLiteral(s)&&or.string(s.uri)&&Ra.integer.is(s.version)&&or.typedArray(s.cells,_u.is)}n.is=t})(V_||(ft.NotebookDocument=V_={}));var lo;(function(n){n.method="notebookDocument/sync",n.messageDirection=wr.MessageDirection.clientToServer,n.type=new wr.RegistrationType(n.method)})(lo||(ft.NotebookDocumentSyncRegistrationType=lo={}));var W_;(function(n){n.method="notebookDocument/didOpen",n.messageDirection=wr.MessageDirection.clientToServer,n.type=new wr.ProtocolNotificationType(n.method),n.registrationMethod=lo.method})(W_||(ft.DidOpenNotebookDocumentNotification=W_={}));var z_;(function(n){function e(r){let s=r;return or.objectLiteral(s)&&Ra.uinteger.is(s.start)&&Ra.uinteger.is(s.deleteCount)&&(s.cells===void 0||or.typedArray(s.cells,_u.is))}n.is=e;function t(r,s,i){let o={start:r,deleteCount:s};return i!==void 0&&(o.cells=i),o}n.create=t})(z_||(ft.NotebookCellArrayChange=z_={}));var H_;(function(n){n.method="notebookDocument/didChange",n.messageDirection=wr.MessageDirection.clientToServer,n.type=new wr.ProtocolNotificationType(n.method),n.registrationMethod=lo.method})(H_||(ft.DidChangeNotebookDocumentNotification=H_={}));var K_;(function(n){n.method="notebookDocument/didSave",n.messageDirection=wr.MessageDirection.clientToServer,n.type=new wr.ProtocolNotificationType(n.method),n.registrationMethod=lo.method})(K_||(ft.DidSaveNotebookDocumentNotification=K_={}));var G_;(function(n){n.method="notebookDocument/didClose",n.messageDirection=wr.MessageDirection.clientToServer,n.type=new wr.ProtocolNotificationType(n.method),n.registrationMethod=lo.method})(G_||(ft.DidCloseNotebookDocumentNotification=G_={}))});var Q_=E(Eu=>{"use strict";Object.defineProperty(Eu,"__esModule",{value:!0});Eu.InlineCompletionRequest=void 0;var J_=ot(),X_;(function(n){n.method="textDocument/inlineCompletion",n.messageDirection=J_.MessageDirection.clientToServer,n.type=new J_.ProtocolRequestType(n.method)})(X_||(Eu.InlineCompletionRequest=X_={}))});var dw=E(_=>{"use strict";Object.defineProperty(_,"__esModule",{value:!0});_.WorkspaceSymbolRequest=_.CodeActionResolveRequest=_.CodeActionRequest=_.DocumentSymbolRequest=_.DocumentHighlightRequest=_.ReferencesRequest=_.DefinitionRequest=_.SignatureHelpRequest=_.SignatureHelpTriggerKind=_.HoverRequest=_.CompletionResolveRequest=_.CompletionRequest=_.CompletionTriggerKind=_.PublishDiagnosticsNotification=_.WatchKind=_.RelativePattern=_.FileChangeType=_.DidChangeWatchedFilesNotification=_.WillSaveTextDocumentWaitUntilRequest=_.WillSaveTextDocumentNotification=_.TextDocumentSaveReason=_.DidSaveTextDocumentNotification=_.DidCloseTextDocumentNotification=_.DidChangeTextDocumentNotification=_.TextDocumentContentChangeEvent=_.DidOpenTextDocumentNotification=_.TextDocumentSyncKind=_.TelemetryEventNotification=_.LogMessageNotification=_.ShowMessageRequest=_.ShowMessageNotification=_.MessageType=_.DidChangeConfigurationNotification=_.ExitNotification=_.ShutdownRequest=_.InitializedNotification=_.InitializeErrorCodes=_.InitializeRequest=_.WorkDoneProgressOptions=_.TextDocumentRegistrationOptions=_.StaticRegistrationOptions=_.PositionEncodingKind=_.FailureHandlingKind=_.ResourceOperationKind=_.UnregistrationRequest=_.RegistrationRequest=_.DocumentSelector=_.NotebookCellTextDocumentFilter=_.NotebookDocumentFilter=_.TextDocumentFilter=void 0;_.MonikerRequest=_.MonikerKind=_.UniquenessLevel=_.WillDeleteFilesRequest=_.DidDeleteFilesNotification=_.WillRenameFilesRequest=_.DidRenameFilesNotification=_.WillCreateFilesRequest=_.DidCreateFilesNotification=_.FileOperationPatternKind=_.LinkedEditingRangeRequest=_.ShowDocumentRequest=_.SemanticTokensRegistrationType=_.SemanticTokensRefreshRequest=_.SemanticTokensRangeRequest=_.SemanticTokensDeltaRequest=_.SemanticTokensRequest=_.TokenFormat=_.CallHierarchyPrepareRequest=_.CallHierarchyOutgoingCallsRequest=_.CallHierarchyIncomingCallsRequest=_.WorkDoneProgressCancelNotification=_.WorkDoneProgressCreateRequest=_.WorkDoneProgress=_.SelectionRangeRequest=_.DeclarationRequest=_.FoldingRangeRefreshRequest=_.FoldingRangeRequest=_.ColorPresentationRequest=_.DocumentColorRequest=_.ConfigurationRequest=_.DidChangeWorkspaceFoldersNotification=_.WorkspaceFoldersRequest=_.TypeDefinitionRequest=_.ImplementationRequest=_.ApplyWorkspaceEditRequest=_.ExecuteCommandRequest=_.PrepareRenameRequest=_.RenameRequest=_.PrepareSupportDefaultBehavior=_.DocumentOnTypeFormattingRequest=_.DocumentRangesFormattingRequest=_.DocumentRangeFormattingRequest=_.DocumentFormattingRequest=_.DocumentLinkResolveRequest=_.DocumentLinkRequest=_.CodeLensRefreshRequest=_.CodeLensResolveRequest=_.CodeLensRequest=_.WorkspaceSymbolResolveRequest=void 0;_.InlineCompletionRequest=_.DidCloseNotebookDocumentNotification=_.DidSaveNotebookDocumentNotification=_.DidChangeNotebookDocumentNotification=_.NotebookCellArrayChange=_.DidOpenNotebookDocumentNotification=_.NotebookDocumentSyncRegistrationType=_.NotebookDocument=_.NotebookCell=_.ExecutionSummary=_.NotebookCellKind=_.DiagnosticRefreshRequest=_.WorkspaceDiagnosticRequest=_.DocumentDiagnosticRequest=_.DocumentDiagnosticReportKind=_.DiagnosticServerCancellationData=_.InlayHintRefreshRequest=_.InlayHintResolveRequest=_.InlayHintRequest=_.InlineValueRefreshRequest=_.InlineValueRequest=_.TypeHierarchySupertypesRequest=_.TypeHierarchySubtypesRequest=_.TypeHierarchyPrepareRequest=void 0;var L=ot(),Z_=cu(),At=lu(),dx=wS();Object.defineProperty(_,"ImplementationRequest",{enumerable:!0,get:function(){return dx.ImplementationRequest}});var fx=PS();Object.defineProperty(_,"TypeDefinitionRequest",{enumerable:!0,get:function(){return fx.TypeDefinitionRequest}});var aw=CS();Object.defineProperty(_,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return aw.WorkspaceFoldersRequest}});Object.defineProperty(_,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return aw.DidChangeWorkspaceFoldersNotification}});var hx=IS();Object.defineProperty(_,"ConfigurationRequest",{enumerable:!0,get:function(){return hx.ConfigurationRequest}});var cw=$S();Object.defineProperty(_,"DocumentColorRequest",{enumerable:!0,get:function(){return cw.DocumentColorRequest}});Object.defineProperty(_,"ColorPresentationRequest",{enumerable:!0,get:function(){return cw.ColorPresentationRequest}});var lw=jS();Object.defineProperty(_,"FoldingRangeRequest",{enumerable:!0,get:function(){return lw.FoldingRangeRequest}});Object.defineProperty(_,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return lw.FoldingRangeRefreshRequest}});var px=US();Object.defineProperty(_,"DeclarationRequest",{enumerable:!0,get:function(){return px.DeclarationRequest}});var mx=zS();Object.defineProperty(_,"SelectionRangeRequest",{enumerable:!0,get:function(){return mx.SelectionRangeRequest}});var km=YS();Object.defineProperty(_,"WorkDoneProgress",{enumerable:!0,get:function(){return km.WorkDoneProgress}});Object.defineProperty(_,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return km.WorkDoneProgressCreateRequest}});Object.defineProperty(_,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return km.WorkDoneProgressCancelNotification}});var Nm=ZS();Object.defineProperty(_,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Nm.CallHierarchyIncomingCallsRequest}});Object.defineProperty(_,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Nm.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(_,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Nm.CallHierarchyPrepareRequest}});var uo=i_();Object.defineProperty(_,"TokenFormat",{enumerable:!0,get:function(){return uo.TokenFormat}});Object.defineProperty(_,"SemanticTokensRequest",{enumerable:!0,get:function(){return uo.SemanticTokensRequest}});Object.defineProperty(_,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return uo.SemanticTokensDeltaRequest}});Object.defineProperty(_,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return uo.SemanticTokensRangeRequest}});Object.defineProperty(_,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return uo.SemanticTokensRefreshRequest}});Object.defineProperty(_,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return uo.SemanticTokensRegistrationType}});var gx=c_();Object.defineProperty(_,"ShowDocumentRequest",{enumerable:!0,get:function(){return gx.ShowDocumentRequest}});var yx=d_();Object.defineProperty(_,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return yx.LinkedEditingRangeRequest}});var ii=v_();Object.defineProperty(_,"FileOperationPatternKind",{enumerable:!0,get:function(){return ii.FileOperationPatternKind}});Object.defineProperty(_,"DidCreateFilesNotification",{enumerable:!0,get:function(){return ii.DidCreateFilesNotification}});Object.defineProperty(_,"WillCreateFilesRequest",{enumerable:!0,get:function(){return ii.WillCreateFilesRequest}});Object.defineProperty(_,"DidRenameFilesNotification",{enumerable:!0,get:function(){return ii.DidRenameFilesNotification}});Object.defineProperty(_,"WillRenameFilesRequest",{enumerable:!0,get:function(){return ii.WillRenameFilesRequest}});Object.defineProperty(_,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return ii.DidDeleteFilesNotification}});Object.defineProperty(_,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return ii.WillDeleteFilesRequest}});var Pm=w_();Object.defineProperty(_,"UniquenessLevel",{enumerable:!0,get:function(){return Pm.UniquenessLevel}});Object.defineProperty(_,"MonikerKind",{enumerable:!0,get:function(){return Pm.MonikerKind}});Object.defineProperty(_,"MonikerRequest",{enumerable:!0,get:function(){return Pm.MonikerRequest}});var Rm=R_();Object.defineProperty(_,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return Rm.TypeHierarchyPrepareRequest}});Object.defineProperty(_,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return Rm.TypeHierarchySubtypesRequest}});Object.defineProperty(_,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return Rm.TypeHierarchySupertypesRequest}});var uw=A_();Object.defineProperty(_,"InlineValueRequest",{enumerable:!0,get:function(){return uw.InlineValueRequest}});Object.defineProperty(_,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return uw.InlineValueRefreshRequest}});var Dm=M_();Object.defineProperty(_,"InlayHintRequest",{enumerable:!0,get:function(){return Dm.InlayHintRequest}});Object.defineProperty(_,"InlayHintResolveRequest",{enumerable:!0,get:function(){return Dm.InlayHintResolveRequest}});Object.defineProperty(_,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return Dm.InlayHintRefreshRequest}});var Da=U_();Object.defineProperty(_,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Da.DiagnosticServerCancellationData}});Object.defineProperty(_,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Da.DocumentDiagnosticReportKind}});Object.defineProperty(_,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Da.DocumentDiagnosticRequest}});Object.defineProperty(_,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Da.WorkspaceDiagnosticRequest}});Object.defineProperty(_,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Da.DiagnosticRefreshRequest}});var kr=Y_();Object.defineProperty(_,"NotebookCellKind",{enumerable:!0,get:function(){return kr.NotebookCellKind}});Object.defineProperty(_,"ExecutionSummary",{enumerable:!0,get:function(){return kr.ExecutionSummary}});Object.defineProperty(_,"NotebookCell",{enumerable:!0,get:function(){return kr.NotebookCell}});Object.defineProperty(_,"NotebookDocument",{enumerable:!0,get:function(){return kr.NotebookDocument}});Object.defineProperty(_,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return kr.NotebookDocumentSyncRegistrationType}});Object.defineProperty(_,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return kr.DidOpenNotebookDocumentNotification}});Object.defineProperty(_,"NotebookCellArrayChange",{enumerable:!0,get:function(){return kr.NotebookCellArrayChange}});Object.defineProperty(_,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return kr.DidChangeNotebookDocumentNotification}});Object.defineProperty(_,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return kr.DidSaveNotebookDocumentNotification}});Object.defineProperty(_,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return kr.DidCloseNotebookDocumentNotification}});var bx=Q_();Object.defineProperty(_,"InlineCompletionRequest",{enumerable:!0,get:function(){return bx.InlineCompletionRequest}});var Sm;(function(n){function e(t){let r=t;return At.string(r)||At.string(r.language)||At.string(r.scheme)||At.string(r.pattern)}n.is=e})(Sm||(_.TextDocumentFilter=Sm={}));var _m;(function(n){function e(t){let r=t;return At.objectLiteral(r)&&(At.string(r.notebookType)||At.string(r.scheme)||At.string(r.pattern))}n.is=e})(_m||(_.NotebookDocumentFilter=_m={}));var Em;(function(n){function e(t){let r=t;return At.objectLiteral(r)&&(At.string(r.notebook)||_m.is(r.notebook))&&(r.language===void 0||At.string(r.language))}n.is=e})(Em||(_.NotebookCellTextDocumentFilter=Em={}));var wm;(function(n){function e(t){if(!Array.isArray(t))return!1;for(let r of t)if(!At.string(r)&&!Sm.is(r)&&!Em.is(r))return!1;return!0}n.is=e})(wm||(_.DocumentSelector=wm={}));var eE;(function(n){n.method="client/registerCapability",n.messageDirection=L.MessageDirection.serverToClient,n.type=new L.ProtocolRequestType(n.method)})(eE||(_.RegistrationRequest=eE={}));var tE;(function(n){n.method="client/unregisterCapability",n.messageDirection=L.MessageDirection.serverToClient,n.type=new L.ProtocolRequestType(n.method)})(tE||(_.UnregistrationRequest=tE={}));var nE;(function(n){n.Create="create",n.Rename="rename",n.Delete="delete"})(nE||(_.ResourceOperationKind=nE={}));var rE;(function(n){n.Abort="abort",n.Transactional="transactional",n.TextOnlyTransactional="textOnlyTransactional",n.Undo="undo"})(rE||(_.FailureHandlingKind=rE={}));var sE;(function(n){n.UTF8="utf-8",n.UTF16="utf-16",n.UTF32="utf-32"})(sE||(_.PositionEncodingKind=sE={}));var iE;(function(n){function e(t){let r=t;return r&&At.string(r.id)&&r.id.length>0}n.hasId=e})(iE||(_.StaticRegistrationOptions=iE={}));var oE;(function(n){function e(t){let r=t;return r&&(r.documentSelector===null||wm.is(r.documentSelector))}n.is=e})(oE||(_.TextDocumentRegistrationOptions=oE={}));var aE;(function(n){function e(r){let s=r;return At.objectLiteral(s)&&(s.workDoneProgress===void 0||At.boolean(s.workDoneProgress))}n.is=e;function t(r){let s=r;return s&&At.boolean(s.workDoneProgress)}n.hasWorkDoneProgress=t})(aE||(_.WorkDoneProgressOptions=aE={}));var cE;(function(n){n.method="initialize",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolRequestType(n.method)})(cE||(_.InitializeRequest=cE={}));var lE;(function(n){n.unknownProtocolVersion=1})(lE||(_.InitializeErrorCodes=lE={}));var uE;(function(n){n.method="initialized",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolNotificationType(n.method)})(uE||(_.InitializedNotification=uE={}));var dE;(function(n){n.method="shutdown",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolRequestType0(n.method)})(dE||(_.ShutdownRequest=dE={}));var fE;(function(n){n.method="exit",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolNotificationType0(n.method)})(fE||(_.ExitNotification=fE={}));var hE;(function(n){n.method="workspace/didChangeConfiguration",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolNotificationType(n.method)})(hE||(_.DidChangeConfigurationNotification=hE={}));var pE;(function(n){n.Error=1,n.Warning=2,n.Info=3,n.Log=4,n.Debug=5})(pE||(_.MessageType=pE={}));var mE;(function(n){n.method="window/showMessage",n.messageDirection=L.MessageDirection.serverToClient,n.type=new L.ProtocolNotificationType(n.method)})(mE||(_.ShowMessageNotification=mE={}));var gE;(function(n){n.method="window/showMessageRequest",n.messageDirection=L.MessageDirection.serverToClient,n.type=new L.ProtocolRequestType(n.method)})(gE||(_.ShowMessageRequest=gE={}));var yE;(function(n){n.method="window/logMessage",n.messageDirection=L.MessageDirection.serverToClient,n.type=new L.ProtocolNotificationType(n.method)})(yE||(_.LogMessageNotification=yE={}));var bE;(function(n){n.method="telemetry/event",n.messageDirection=L.MessageDirection.serverToClient,n.type=new L.ProtocolNotificationType(n.method)})(bE||(_.TelemetryEventNotification=bE={}));var vE;(function(n){n.None=0,n.Full=1,n.Incremental=2})(vE||(_.TextDocumentSyncKind=vE={}));var TE;(function(n){n.method="textDocument/didOpen",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolNotificationType(n.method)})(TE||(_.DidOpenTextDocumentNotification=TE={}));var SE;(function(n){function e(r){let s=r;return s!=null&&typeof s.text=="string"&&s.range!==void 0&&(s.rangeLength===void 0||typeof s.rangeLength=="number")}n.isIncremental=e;function t(r){let s=r;return s!=null&&typeof s.text=="string"&&s.range===void 0&&s.rangeLength===void 0}n.isFull=t})(SE||(_.TextDocumentContentChangeEvent=SE={}));var _E;(function(n){n.method="textDocument/didChange",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolNotificationType(n.method)})(_E||(_.DidChangeTextDocumentNotification=_E={}));var EE;(function(n){n.method="textDocument/didClose",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolNotificationType(n.method)})(EE||(_.DidCloseTextDocumentNotification=EE={}));var wE;(function(n){n.method="textDocument/didSave",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolNotificationType(n.method)})(wE||(_.DidSaveTextDocumentNotification=wE={}));var kE;(function(n){n.Manual=1,n.AfterDelay=2,n.FocusOut=3})(kE||(_.TextDocumentSaveReason=kE={}));var NE;(function(n){n.method="textDocument/willSave",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolNotificationType(n.method)})(NE||(_.WillSaveTextDocumentNotification=NE={}));var PE;(function(n){n.method="textDocument/willSaveWaitUntil",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolRequestType(n.method)})(PE||(_.WillSaveTextDocumentWaitUntilRequest=PE={}));var RE;(function(n){n.method="workspace/didChangeWatchedFiles",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolNotificationType(n.method)})(RE||(_.DidChangeWatchedFilesNotification=RE={}));var DE;(function(n){n.Created=1,n.Changed=2,n.Deleted=3})(DE||(_.FileChangeType=DE={}));var CE;(function(n){function e(t){let r=t;return At.objectLiteral(r)&&(Z_.URI.is(r.baseUri)||Z_.WorkspaceFolder.is(r.baseUri))&&At.string(r.pattern)}n.is=e})(CE||(_.RelativePattern=CE={}));var AE;(function(n){n.Create=1,n.Change=2,n.Delete=4})(AE||(_.WatchKind=AE={}));var OE;(function(n){n.method="textDocument/publishDiagnostics",n.messageDirection=L.MessageDirection.serverToClient,n.type=new L.ProtocolNotificationType(n.method)})(OE||(_.PublishDiagnosticsNotification=OE={}));var IE;(function(n){n.Invoked=1,n.TriggerCharacter=2,n.TriggerForIncompleteCompletions=3})(IE||(_.CompletionTriggerKind=IE={}));var xE;(function(n){n.method="textDocument/completion",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolRequestType(n.method)})(xE||(_.CompletionRequest=xE={}));var ME;(function(n){n.method="completionItem/resolve",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolRequestType(n.method)})(ME||(_.CompletionResolveRequest=ME={}));var $E;(function(n){n.method="textDocument/hover",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolRequestType(n.method)})($E||(_.HoverRequest=$E={}));var LE;(function(n){n.Invoked=1,n.TriggerCharacter=2,n.ContentChange=3})(LE||(_.SignatureHelpTriggerKind=LE={}));var qE;(function(n){n.method="textDocument/signatureHelp",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolRequestType(n.method)})(qE||(_.SignatureHelpRequest=qE={}));var jE;(function(n){n.method="textDocument/definition",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolRequestType(n.method)})(jE||(_.DefinitionRequest=jE={}));var FE;(function(n){n.method="textDocument/references",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolRequestType(n.method)})(FE||(_.ReferencesRequest=FE={}));var BE;(function(n){n.method="textDocument/documentHighlight",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolRequestType(n.method)})(BE||(_.DocumentHighlightRequest=BE={}));var UE;(function(n){n.method="textDocument/documentSymbol",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolRequestType(n.method)})(UE||(_.DocumentSymbolRequest=UE={}));var VE;(function(n){n.method="textDocument/codeAction",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolRequestType(n.method)})(VE||(_.CodeActionRequest=VE={}));var WE;(function(n){n.method="codeAction/resolve",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolRequestType(n.method)})(WE||(_.CodeActionResolveRequest=WE={}));var zE;(function(n){n.method="workspace/symbol",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolRequestType(n.method)})(zE||(_.WorkspaceSymbolRequest=zE={}));var HE;(function(n){n.method="workspaceSymbol/resolve",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolRequestType(n.method)})(HE||(_.WorkspaceSymbolResolveRequest=HE={}));var KE;(function(n){n.method="textDocument/codeLens",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolRequestType(n.method)})(KE||(_.CodeLensRequest=KE={}));var GE;(function(n){n.method="codeLens/resolve",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolRequestType(n.method)})(GE||(_.CodeLensResolveRequest=GE={}));var YE;(function(n){n.method="workspace/codeLens/refresh",n.messageDirection=L.MessageDirection.serverToClient,n.type=new L.ProtocolRequestType0(n.method)})(YE||(_.CodeLensRefreshRequest=YE={}));var JE;(function(n){n.method="textDocument/documentLink",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolRequestType(n.method)})(JE||(_.DocumentLinkRequest=JE={}));var XE;(function(n){n.method="documentLink/resolve",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolRequestType(n.method)})(XE||(_.DocumentLinkResolveRequest=XE={}));var QE;(function(n){n.method="textDocument/formatting",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolRequestType(n.method)})(QE||(_.DocumentFormattingRequest=QE={}));var ZE;(function(n){n.method="textDocument/rangeFormatting",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolRequestType(n.method)})(ZE||(_.DocumentRangeFormattingRequest=ZE={}));var ew;(function(n){n.method="textDocument/rangesFormatting",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolRequestType(n.method)})(ew||(_.DocumentRangesFormattingRequest=ew={}));var tw;(function(n){n.method="textDocument/onTypeFormatting",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolRequestType(n.method)})(tw||(_.DocumentOnTypeFormattingRequest=tw={}));var nw;(function(n){n.Identifier=1})(nw||(_.PrepareSupportDefaultBehavior=nw={}));var rw;(function(n){n.method="textDocument/rename",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolRequestType(n.method)})(rw||(_.RenameRequest=rw={}));var sw;(function(n){n.method="textDocument/prepareRename",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolRequestType(n.method)})(sw||(_.PrepareRenameRequest=sw={}));var iw;(function(n){n.method="workspace/executeCommand",n.messageDirection=L.MessageDirection.clientToServer,n.type=new L.ProtocolRequestType(n.method)})(iw||(_.ExecuteCommandRequest=iw={}));var ow;(function(n){n.method="workspace/applyEdit",n.messageDirection=L.MessageDirection.serverToClient,n.type=new L.ProtocolRequestType("workspace/applyEdit")})(ow||(_.ApplyWorkspaceEditRequest=ow={}))});var hw=E(wu=>{"use strict";Object.defineProperty(wu,"__esModule",{value:!0});wu.createProtocolConnection=void 0;var fw=si();function vx(n,e,t,r){return fw.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,fw.createMessageConnection)(n,e,t,r)}wu.createProtocolConnection=vx});var mw=E(yn=>{"use strict";var Tx=yn&&yn.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,s)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),ku=yn&&yn.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Tx(e,n,t)};Object.defineProperty(yn,"__esModule",{value:!0});yn.LSPErrorCodes=yn.createProtocolConnection=void 0;ku(si(),yn);ku(cu(),yn);ku(ot(),yn);ku(dw(),yn);var Sx=hw();Object.defineProperty(yn,"createProtocolConnection",{enumerable:!0,get:function(){return Sx.createProtocolConnection}});var pw;(function(n){n.lspReservedErrorRangeStart=-32899,n.RequestFailed=-32803,n.ServerCancelled=-32802,n.ContentModified=-32801,n.RequestCancelled=-32800,n.lspReservedErrorRangeEnd=-32800})(pw||(yn.LSPErrorCodes=pw={}))});var pt=E(Nr=>{"use strict";var _x=Nr&&Nr.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,s)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),gw=Nr&&Nr.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&_x(e,n,t)};Object.defineProperty(Nr,"__esModule",{value:!0});Nr.createProtocolConnection=void 0;var Ex=hm();gw(hm(),Nr);gw(mw(),Nr);function wx(n,e,t,r){return(0,Ex.createMessageConnection)(n,e,t,r)}Nr.createProtocolConnection=wx});var Cm=E(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.generateUuid=Fn.parse=Fn.isUUID=Fn.v4=Fn.empty=void 0;var Ca=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},Aa=class n extends Ca{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return n._oneOf(n._chars)}constructor(){super([n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),"-",n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),"-","4",n._randomHex(),n._randomHex(),n._randomHex(),"-",n._oneOf(n._timeHighBits),n._randomHex(),n._randomHex(),n._randomHex(),"-",n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex(),n._randomHex()].join(""))}};Aa._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];Aa._timeHighBits=["8","9","a","b"];Fn.empty=new Ca("00000000-0000-0000-0000-000000000000");function yw(){return new Aa}Fn.v4=yw;var kx=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function bw(n){return kx.test(n)}Fn.isUUID=bw;function Nx(n){if(!bw(n))throw new Error("invalid uuid");return new Ca(n)}Fn.parse=Nx;function Px(){return yw().asHex()}Fn.generateUuid=Px});var vw=E(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.attachPartialResult=vs.ProgressFeature=vs.attachWorkDone=void 0;var bs=pt(),Rx=Cm(),oi=class n{constructor(e,t){this._connection=e,this._token=t,n.Instances.set(this._token,this)}begin(e,t,r,s){let i={kind:"begin",title:e,percentage:t,message:r,cancellable:s};this._connection.sendProgress(bs.WorkDoneProgress.type,this._token,i)}report(e,t){let r={kind:"report"};typeof e=="number"?(r.percentage=e,t!==void 0&&(r.message=t)):r.message=e,this._connection.sendProgress(bs.WorkDoneProgress.type,this._token,r)}done(){n.Instances.delete(this._token),this._connection.sendProgress(bs.WorkDoneProgress.type,this._token,{kind:"end"})}};oi.Instances=new Map;var Nu=class extends oi{constructor(e,t){super(e,t),this._source=new bs.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},Oa=class{constructor(){}begin(){}report(){}done(){}},Pu=class extends Oa{constructor(){super(),this._source=new bs.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function Dx(n,e){if(e===void 0||e.workDoneToken===void 0)return new Oa;let t=e.workDoneToken;return delete e.workDoneToken,new oi(n,t)}vs.attachWorkDone=Dx;var Cx=n=>class extends n{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(bs.WorkDoneProgressCancelNotification.type,t=>{let r=oi.Instances.get(t.token);(r instanceof Nu||r instanceof Pu)&&r.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new Oa:new oi(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,Rx.generateUuid)();return this.connection.sendRequest(bs.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Nu(this.connection,e))}else return Promise.resolve(new Pu)}};vs.ProgressFeature=Cx;var Am;(function(n){n.type=new bs.ProgressType})(Am||(Am={}));var Om=class{constructor(e,t){this._connection=e,this._token=t}report(e){this._connection.sendProgress(Am.type,this._token,e)}};function Ax(n,e){if(e===void 0||e.partialResultToken===void 0)return;let t=e.partialResultToken;return delete e.partialResultToken,new Om(n,t)}vs.attachPartialResult=Ax});var Tw=E(Ru=>{"use strict";Object.defineProperty(Ru,"__esModule",{value:!0});Ru.ConfigurationFeature=void 0;var Ox=pt(),Ix=jl(),xx=n=>class extends n{getConfiguration(e){return e?Ix.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let t={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(Ox.ConfigurationRequest.type,t).then(r=>Array.isArray(r)?Array.isArray(e)?r:r[0]:Array.isArray(e)?[]:null)}};Ru.ConfigurationFeature=xx});var Sw=E(Cu=>{"use strict";Object.defineProperty(Cu,"__esModule",{value:!0});Cu.WorkspaceFoldersFeature=void 0;var Du=pt(),Mx=n=>class extends n{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let t=e.workspace;t&&t.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Du.Emitter,this.connection.onNotification(Du.DidChangeWorkspaceFoldersNotification.type,r=>{this._onDidChangeWorkspaceFolders.fire(r.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let t=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=t===!0||typeof t=="string"}getWorkspaceFolders(){return this.connection.sendRequest(Du.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return!this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(Du.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Cu.WorkspaceFoldersFeature=Mx});var _w=E(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});Au.CallHierarchyFeature=void 0;var Im=pt(),$x=n=>class extends n{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(Im.CallHierarchyPrepareRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),void 0)),onIncomingCalls:e=>{let t=Im.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))},onOutgoingCalls:e=>{let t=Im.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))}}}};Au.CallHierarchyFeature=$x});var Mm=E(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.SemanticTokensBuilder=Ts.SemanticTokensDiff=Ts.SemanticTokensFeature=void 0;var Ou=pt(),Lx=n=>class extends n{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Ou.SemanticTokensRefreshRequest.type),on:e=>{let t=Ou.SemanticTokensRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))},onDelta:e=>{let t=Ou.SemanticTokensDeltaRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))},onRange:e=>{let t=Ou.SemanticTokensRangeRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))}}}};Ts.SemanticTokensFeature=Lx;var Iu=class{constructor(e,t){this.originalSequence=e,this.modifiedSequence=t}computeDiff(){let e=this.originalSequence.length,t=this.modifiedSequence.length,r=0;for(;r<t&&r<e&&this.originalSequence[r]===this.modifiedSequence[r];)r++;if(r<t&&r<e){let s=e-1,i=t-1;for(;s>=r&&i>=r&&this.originalSequence[s]===this.modifiedSequence[i];)s--,i--;(s<r||i<r)&&(s++,i++);let o=s-r+1,a=this.modifiedSequence.slice(r,i+1);return a.length===1&&a[0]===this.originalSequence[s]?[{start:r,deleteCount:o-1}]:[{start:r,deleteCount:o,data:a}]}else return r<t?[{start:r,deleteCount:0,data:this.modifiedSequence.slice(r)}]:r<e?[{start:r,deleteCount:e-r}]:[]}};Ts.SemanticTokensDiff=Iu;var xm=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(e,t,r,s,i){let o=e,a=t;this._dataLen>0&&(o-=this._prevLine,o===0&&(a-=this._prevChar)),this._data[this._dataLen++]=o,this._data[this._dataLen++]=a,this._data[this._dataLen++]=r,this._data[this._dataLen++]=s,this._data[this._dataLen++]=i,this._prevLine=e,this._prevChar=t}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new Iu(this._prevData,this._data).computeDiff()}:this.build()}};Ts.SemanticTokensBuilder=xm});var Ew=E(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});xu.ShowDocumentFeature=void 0;var qx=pt(),jx=n=>class extends n{showDocument(e){return this.connection.sendRequest(qx.ShowDocumentRequest.type,e)}};xu.ShowDocumentFeature=jx});var ww=E(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.FileOperationsFeature=void 0;var fo=pt(),Fx=n=>class extends n{onDidCreateFiles(e){return this.connection.onNotification(fo.DidCreateFilesNotification.type,t=>{e(t)})}onDidRenameFiles(e){return this.connection.onNotification(fo.DidRenameFilesNotification.type,t=>{e(t)})}onDidDeleteFiles(e){return this.connection.onNotification(fo.DidDeleteFilesNotification.type,t=>{e(t)})}onWillCreateFiles(e){return this.connection.onRequest(fo.WillCreateFilesRequest.type,(t,r)=>e(t,r))}onWillRenameFiles(e){return this.connection.onRequest(fo.WillRenameFilesRequest.type,(t,r)=>e(t,r))}onWillDeleteFiles(e){return this.connection.onRequest(fo.WillDeleteFilesRequest.type,(t,r)=>e(t,r))}};Mu.FileOperationsFeature=Fx});var kw=E($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.LinkedEditingRangeFeature=void 0;var Bx=pt(),Ux=n=>class extends n{onLinkedEditingRange(e){return this.connection.onRequest(Bx.LinkedEditingRangeRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),void 0))}};$u.LinkedEditingRangeFeature=Ux});var Nw=E(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});Lu.TypeHierarchyFeature=void 0;var $m=pt(),Vx=n=>class extends n{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest($m.TypeHierarchyPrepareRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),void 0)),onSupertypes:e=>{let t=$m.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))},onSubtypes:e=>{let t=$m.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))}}}};Lu.TypeHierarchyFeature=Vx});var Rw=E(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});qu.InlineValueFeature=void 0;var Pw=pt(),Wx=n=>class extends n{get inlineValue(){return{refresh:()=>this.connection.sendRequest(Pw.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(Pw.InlineValueRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t)))}}};qu.InlineValueFeature=Wx});var Cw=E(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.FoldingRangeFeature=void 0;var Dw=pt(),zx=n=>class extends n{get foldingRange(){return{refresh:()=>this.connection.sendRequest(Dw.FoldingRangeRefreshRequest.type),on:e=>{let t=Dw.FoldingRangeRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))}}}};ju.FoldingRangeFeature=zx});var Aw=E(Fu=>{"use strict";Object.defineProperty(Fu,"__esModule",{value:!0});Fu.InlayHintFeature=void 0;var Lm=pt(),Hx=n=>class extends n{get inlayHint(){return{refresh:()=>this.connection.sendRequest(Lm.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(Lm.InlayHintRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t))),resolve:e=>this.connection.onRequest(Lm.InlayHintResolveRequest.type,(t,r)=>e(t,r))}}};Fu.InlayHintFeature=Hx});var Ow=E(Bu=>{"use strict";Object.defineProperty(Bu,"__esModule",{value:!0});Bu.DiagnosticFeature=void 0;var Ia=pt(),Kx=n=>class extends n{get diagnostics(){return{refresh:()=>this.connection.sendRequest(Ia.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(Ia.DocumentDiagnosticRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(Ia.DocumentDiagnosticRequest.partialResult,t))),onWorkspace:e=>this.connection.onRequest(Ia.WorkspaceDiagnosticRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(Ia.WorkspaceDiagnosticRequest.partialResult,t)))}}};Bu.DiagnosticFeature=Kx});var jm=E(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});Uu.TextDocuments=void 0;var ai=pt(),qm=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new ai.Emitter,this._onDidOpen=new ai.Emitter,this._onDidClose=new ai.Emitter,this._onDidSave=new ai.Emitter,this._onWillSave=new ai.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=ai.TextDocumentSyncKind.Incremental;let t=[];return t.push(e.onDidOpenTextDocument(r=>{let s=r.textDocument,i=this._configuration.create(s.uri,s.languageId,s.version,s.text);this._syncedDocuments.set(s.uri,i);let o=Object.freeze({document:i});this._onDidOpen.fire(o),this._onDidChangeContent.fire(o)})),t.push(e.onDidChangeTextDocument(r=>{let s=r.textDocument,i=r.contentChanges;if(i.length===0)return;let{version:o}=s;if(o==null)throw new Error(`Received document change event for ${s.uri} without valid version identifier`);let a=this._syncedDocuments.get(s.uri);a!==void 0&&(a=this._configuration.update(a,i,o),this._syncedDocuments.set(s.uri,a),this._onDidChangeContent.fire(Object.freeze({document:a})))})),t.push(e.onDidCloseTextDocument(r=>{let s=this._syncedDocuments.get(r.textDocument.uri);s!==void 0&&(this._syncedDocuments.delete(r.textDocument.uri),this._onDidClose.fire(Object.freeze({document:s})))})),t.push(e.onWillSaveTextDocument(r=>{let s=this._syncedDocuments.get(r.textDocument.uri);s!==void 0&&this._onWillSave.fire(Object.freeze({document:s,reason:r.reason}))})),t.push(e.onWillSaveTextDocumentWaitUntil((r,s)=>{let i=this._syncedDocuments.get(r.textDocument.uri);return i!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:i,reason:r.reason}),s):[]})),t.push(e.onDidSaveTextDocument(r=>{let s=this._syncedDocuments.get(r.textDocument.uri);s!==void 0&&this._onDidSave.fire(Object.freeze({document:s}))})),ai.Disposable.create(()=>{t.forEach(r=>r.dispose())})}};Uu.TextDocuments=qm});var Bm=E(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.NotebookDocuments=ho.NotebookSyncFeature=void 0;var Bn=pt(),Iw=jm(),Gx=n=>class extends n{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(Bn.DidOpenNotebookDocumentNotification.type,t=>{e(t)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(Bn.DidChangeNotebookDocumentNotification.type,t=>{e(t)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(Bn.DidSaveNotebookDocumentNotification.type,t=>{e(t)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(Bn.DidCloseNotebookDocumentNotification.type,t=>{e(t)})}}};ho.NotebookSyncFeature=Gx;var Vu=class n{onDidOpenTextDocument(e){return this.openHandler=e,Bn.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Bn.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Bn.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return n.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return n.NULL_DISPOSE}onDidSaveTextDocument(){return n.NULL_DISPOSE}};Vu.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var Fm=class{constructor(e){e instanceof Iw.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new Iw.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Bn.Emitter,this._onDidChange=new Bn.Emitter,this._onDidSave=new Bn.Emitter,this._onDidClose=new Bn.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let t=this.notebookCellMap.get(e);return t&&t[0]}findNotebookDocumentForCell(e){let t=typeof e=="string"?e:e.document,r=this.notebookCellMap.get(t);return r&&r[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let t=new Vu,r=[];return r.push(this.cellTextDocuments.listen(t)),r.push(e.notebooks.synchronization.onDidOpenNotebookDocument(s=>{this.notebookDocuments.set(s.notebookDocument.uri,s.notebookDocument);for(let i of s.cellTextDocuments)t.openTextDocument({textDocument:i});this.updateCellMap(s.notebookDocument),this._onDidOpen.fire(s.notebookDocument)})),r.push(e.notebooks.synchronization.onDidChangeNotebookDocument(s=>{let i=this.notebookDocuments.get(s.notebookDocument.uri);if(i===void 0)return;i.version=s.notebookDocument.version;let o=i.metadata,a=!1,c=s.change;c.metadata!==void 0&&(a=!0,i.metadata=c.metadata);let l=[],u=[],d=[],f=[];if(c.cells!==void 0){let w=c.cells;if(w.structure!==void 0){let T=w.structure.array;if(i.cells.splice(T.start,T.deleteCount,...T.cells!==void 0?T.cells:[]),w.structure.didOpen!==void 0)for(let v of w.structure.didOpen)t.openTextDocument({textDocument:v}),l.push(v.uri);if(w.structure.didClose)for(let v of w.structure.didClose)t.closeTextDocument({textDocument:v}),u.push(v.uri)}if(w.data!==void 0){let T=new Map(w.data.map(v=>[v.document,v]));for(let v=0;v<=i.cells.length;v++){let R=T.get(i.cells[v].document);if(R!==void 0){let A=i.cells.splice(v,1,R);if(d.push({old:A[0],new:R}),T.delete(R.document),T.size===0)break}}}if(w.textContent!==void 0)for(let T of w.textContent)t.changeTextDocument({textDocument:T.document,contentChanges:T.changes}),f.push(T.document.uri)}this.updateCellMap(i);let p={notebookDocument:i};a&&(p.metadata={old:o,new:i.metadata});let y=[];for(let w of l)y.push(this.getNotebookCell(w));let m=[];for(let w of u)m.push(this.getNotebookCell(w));let S=[];for(let w of f)S.push(this.getNotebookCell(w));(y.length>0||m.length>0||d.length>0||S.length>0)&&(p.cells={added:y,removed:m,changed:{data:d,textContent:S}}),(p.metadata!==void 0||p.cells!==void 0)&&this._onDidChange.fire(p)})),r.push(e.notebooks.synchronization.onDidSaveNotebookDocument(s=>{let i=this.notebookDocuments.get(s.notebookDocument.uri);i!==void 0&&this._onDidSave.fire(i)})),r.push(e.notebooks.synchronization.onDidCloseNotebookDocument(s=>{let i=this.notebookDocuments.get(s.notebookDocument.uri);if(i!==void 0){this._onDidClose.fire(i);for(let o of s.cellTextDocuments)t.closeTextDocument({textDocument:o});this.notebookDocuments.delete(s.notebookDocument.uri);for(let o of i.cells)this.notebookCellMap.delete(o.document)}})),Bn.Disposable.create(()=>{r.forEach(s=>s.dispose())})}updateCellMap(e){for(let t of e.cells)this.notebookCellMap.set(t.document,[t,e])}};ho.NotebookDocuments=Fm});var xw=E(Wu=>{"use strict";Object.defineProperty(Wu,"__esModule",{value:!0});Wu.MonikerFeature=void 0;var Yx=pt(),Jx=n=>class extends n{get moniker(){return{on:e=>{let t=Yx.MonikerRequest.type;return this.connection.onRequest(t,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(t,r)))}}}};Wu.MonikerFeature=Jx});var Km=E(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.createConnection=Ne.combineFeatures=Ne.combineNotebooksFeatures=Ne.combineLanguagesFeatures=Ne.combineWorkspaceFeatures=Ne.combineWindowFeatures=Ne.combineClientFeatures=Ne.combineTracerFeatures=Ne.combineTelemetryFeatures=Ne.combineConsoleFeatures=Ne._NotebooksImpl=Ne._LanguagesImpl=Ne.BulkUnregistration=Ne.BulkRegistration=Ne.ErrorMessageTracker=void 0;var U=pt(),Un=jl(),Vm=Cm(),se=vw(),Xx=Tw(),Qx=Sw(),Zx=_w(),eM=Mm(),tM=Ew(),nM=ww(),rM=kw(),sM=Nw(),iM=Rw(),oM=Cw(),aM=Aw(),cM=Ow(),lM=Bm(),uM=xw();function Um(n){if(n!==null)return n}var Wm=class{constructor(){this._messages=Object.create(null)}add(e){let t=this._messages[e];t||(t=0),t++,this._messages[e]=t}sendErrors(e){Object.keys(this._messages).forEach(t=>{e.window.showErrorMessage(t)})}};Ne.ErrorMessageTracker=Wm;var zu=class{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(U.MessageType.Error,e)}warn(e){this.send(U.MessageType.Warning,e)}info(e){this.send(U.MessageType.Info,e)}log(e){this.send(U.MessageType.Log,e)}debug(e){this.send(U.MessageType.Debug,e)}send(e,t){this._rawConnection&&this._rawConnection.sendNotification(U.LogMessageNotification.type,{type:e,message:t}).catch(()=>{(0,U.RAL)().console.error("Sending log message failed")})}},zm=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...t){let r={type:U.MessageType.Error,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,r).then(Um)}showWarningMessage(e,...t){let r={type:U.MessageType.Warning,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,r).then(Um)}showInformationMessage(e,...t){let r={type:U.MessageType.Info,message:e,actions:t};return this.connection.sendRequest(U.ShowMessageRequest.type,r).then(Um)}},Mw=(0,tM.ShowDocumentFeature)((0,se.ProgressFeature)(zm)),$w;(function(n){function e(){return new Hu}n.create=e})($w||(Ne.BulkRegistration=$w={}));var Hu=class{constructor(){this._registrations=[],this._registered=new Set}add(e,t){let r=Un.string(e)?e:e.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);let s=Vm.generateUuid();this._registrations.push({id:s,method:r,registerOptions:t||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}},Lw;(function(n){function e(){return new xa(void 0,[])}n.create=e})(Lw||(Ne.BulkUnregistration=Lw={}));var xa=class{constructor(e,t){this._connection=e,this._unregistrations=new Map,t.forEach(r=>{this._unregistrations.set(r.method,r)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let r of this._unregistrations.values())e.push(r);let t={unregisterations:e};this._connection.sendRequest(U.UnregistrationRequest.type,t).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let t=Un.string(e)?e:e.method,r=this._unregistrations.get(t);if(!r)return!1;let s={unregisterations:[r]};return this._connection.sendRequest(U.UnregistrationRequest.type,s).then(()=>{this._unregistrations.delete(t)},i=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}},Ku=class{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,t,r){return e instanceof Hu?this.registerMany(e):e instanceof xa?this.registerSingle1(e,t,r):this.registerSingle2(e,t)}registerSingle1(e,t,r){let s=Un.string(t)?t:t.method,i=Vm.generateUuid(),o={registrations:[{id:i,method:s,registerOptions:r||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(U.RegistrationRequest.type,o).then(a=>(e.add({id:i,method:s}),e),a=>(this.connection.console.info(`Registering request handler for ${s} failed.`),Promise.reject(a)))}registerSingle2(e,t){let r=Un.string(e)?e:e.method,s=Vm.generateUuid(),i={registrations:[{id:s,method:r,registerOptions:t||{}}]};return this.connection.sendRequest(U.RegistrationRequest.type,i).then(o=>U.Disposable.create(()=>{this.unregisterSingle(s,r).catch(()=>{this.connection.console.info(`Un-registering capability with id ${s} failed.`)})}),o=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(o)))}unregisterSingle(e,t){let r={unregisterations:[{id:e,method:t}]};return this.connection.sendRequest(U.UnregistrationRequest.type,r).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let t=e.asRegistrationParams();return this.connection.sendRequest(U.RegistrationRequest.type,t).then(()=>new xa(this._connection,t.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}},Hm=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function t(s){return s&&!!s.edit}let r=t(e)?e:{edit:e};return this.connection.sendRequest(U.ApplyWorkspaceEditRequest.type,r)}},qw=(0,nM.FileOperationsFeature)((0,Qx.WorkspaceFoldersFeature)((0,Xx.ConfigurationFeature)(Hm))),Gu=class{constructor(){this._trace=U.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,t){this._trace!==U.Trace.Off&&this.connection.sendNotification(U.LogTraceNotification.type,{message:e,verbose:this._trace===U.Trace.Verbose?t:void 0}).catch(()=>{})}},Yu=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(U.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},Ju=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,se.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,se.attachPartialResult)(this.connection,t)}};Ne._LanguagesImpl=Ju;var jw=(0,oM.FoldingRangeFeature)((0,uM.MonikerFeature)((0,cM.DiagnosticFeature)((0,aM.InlayHintFeature)((0,iM.InlineValueFeature)((0,sM.TypeHierarchyFeature)((0,rM.LinkedEditingRangeFeature)((0,eM.SemanticTokensFeature)((0,Zx.CallHierarchyFeature)(Ju))))))))),Xu=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,se.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,se.attachPartialResult)(this.connection,t)}};Ne._NotebooksImpl=Xu;var Fw=(0,lM.NotebookSyncFeature)(Xu);function Bw(n,e){return function(t){return e(n(t))}}Ne.combineConsoleFeatures=Bw;function Uw(n,e){return function(t){return e(n(t))}}Ne.combineTelemetryFeatures=Uw;function Vw(n,e){return function(t){return e(n(t))}}Ne.combineTracerFeatures=Vw;function Ww(n,e){return function(t){return e(n(t))}}Ne.combineClientFeatures=Ww;function zw(n,e){return function(t){return e(n(t))}}Ne.combineWindowFeatures=zw;function Hw(n,e){return function(t){return e(n(t))}}Ne.combineWorkspaceFeatures=Hw;function Kw(n,e){return function(t){return e(n(t))}}Ne.combineLanguagesFeatures=Kw;function Gw(n,e){return function(t){return e(n(t))}}Ne.combineNotebooksFeatures=Gw;function dM(n,e){function t(s,i,o){return s&&i?o(s,i):s||i}return{__brand:"features",console:t(n.console,e.console,Bw),tracer:t(n.tracer,e.tracer,Vw),telemetry:t(n.telemetry,e.telemetry,Uw),client:t(n.client,e.client,Ww),window:t(n.window,e.window,zw),workspace:t(n.workspace,e.workspace,Hw),languages:t(n.languages,e.languages,Kw),notebooks:t(n.notebooks,e.notebooks,Gw)}}Ne.combineFeatures=dM;function fM(n,e,t){let r=t&&t.console?new(t.console(zu)):new zu,s=n(r);r.rawAttach(s);let i=t&&t.tracer?new(t.tracer(Gu)):new Gu,o=t&&t.telemetry?new(t.telemetry(Yu)):new Yu,a=t&&t.client?new(t.client(Ku)):new Ku,c=t&&t.window?new(t.window(Mw)):new Mw,l=t&&t.workspace?new(t.workspace(qw)):new qw,u=t&&t.languages?new(t.languages(jw)):new jw,d=t&&t.notebooks?new(t.notebooks(Fw)):new Fw,f=[r,i,o,a,c,l,u,d];function p(T){return T instanceof Promise?T:Un.thenable(T)?new Promise((v,R)=>{T.then(A=>v(A),A=>R(A))}):Promise.resolve(T)}let y,m,S,w={listen:()=>s.listen(),sendRequest:(T,...v)=>s.sendRequest(Un.string(T)?T:T.method,...v),onRequest:(T,v)=>s.onRequest(T,v),sendNotification:(T,v)=>{let R=Un.string(T)?T:T.method;return s.sendNotification(R,v)},onNotification:(T,v)=>s.onNotification(T,v),onProgress:s.onProgress,sendProgress:s.sendProgress,onInitialize:T=>(m=T,{dispose:()=>{m=void 0}}),onInitialized:T=>s.onNotification(U.InitializedNotification.type,T),onShutdown:T=>(y=T,{dispose:()=>{y=void 0}}),onExit:T=>(S=T,{dispose:()=>{S=void 0}}),get console(){return r},get telemetry(){return o},get tracer(){return i},get client(){return a},get window(){return c},get workspace(){return l},get languages(){return u},get notebooks(){return d},onDidChangeConfiguration:T=>s.onNotification(U.DidChangeConfigurationNotification.type,T),onDidChangeWatchedFiles:T=>s.onNotification(U.DidChangeWatchedFilesNotification.type,T),__textDocumentSync:void 0,onDidOpenTextDocument:T=>s.onNotification(U.DidOpenTextDocumentNotification.type,T),onDidChangeTextDocument:T=>s.onNotification(U.DidChangeTextDocumentNotification.type,T),onDidCloseTextDocument:T=>s.onNotification(U.DidCloseTextDocumentNotification.type,T),onWillSaveTextDocument:T=>s.onNotification(U.WillSaveTextDocumentNotification.type,T),onWillSaveTextDocumentWaitUntil:T=>s.onRequest(U.WillSaveTextDocumentWaitUntilRequest.type,T),onDidSaveTextDocument:T=>s.onNotification(U.DidSaveTextDocumentNotification.type,T),sendDiagnostics:T=>s.sendNotification(U.PublishDiagnosticsNotification.type,T),onHover:T=>s.onRequest(U.HoverRequest.type,(v,R)=>T(v,R,(0,se.attachWorkDone)(s,v),void 0)),onCompletion:T=>s.onRequest(U.CompletionRequest.type,(v,R)=>T(v,R,(0,se.attachWorkDone)(s,v),(0,se.attachPartialResult)(s,v))),onCompletionResolve:T=>s.onRequest(U.CompletionResolveRequest.type,T),onSignatureHelp:T=>s.onRequest(U.SignatureHelpRequest.type,(v,R)=>T(v,R,(0,se.attachWorkDone)(s,v),void 0)),onDeclaration:T=>s.onRequest(U.DeclarationRequest.type,(v,R)=>T(v,R,(0,se.attachWorkDone)(s,v),(0,se.attachPartialResult)(s,v))),onDefinition:T=>s.onRequest(U.DefinitionRequest.type,(v,R)=>T(v,R,(0,se.attachWorkDone)(s,v),(0,se.attachPartialResult)(s,v))),onTypeDefinition:T=>s.onRequest(U.TypeDefinitionRequest.type,(v,R)=>T(v,R,(0,se.attachWorkDone)(s,v),(0,se.attachPartialResult)(s,v))),onImplementation:T=>s.onRequest(U.ImplementationRequest.type,(v,R)=>T(v,R,(0,se.attachWorkDone)(s,v),(0,se.attachPartialResult)(s,v))),onReferences:T=>s.onRequest(U.ReferencesRequest.type,(v,R)=>T(v,R,(0,se.attachWorkDone)(s,v),(0,se.attachPartialResult)(s,v))),onDocumentHighlight:T=>s.onRequest(U.DocumentHighlightRequest.type,(v,R)=>T(v,R,(0,se.attachWorkDone)(s,v),(0,se.attachPartialResult)(s,v))),onDocumentSymbol:T=>s.onRequest(U.DocumentSymbolRequest.type,(v,R)=>T(v,R,(0,se.attachWorkDone)(s,v),(0,se.attachPartialResult)(s,v))),onWorkspaceSymbol:T=>s.onRequest(U.WorkspaceSymbolRequest.type,(v,R)=>T(v,R,(0,se.attachWorkDone)(s,v),(0,se.attachPartialResult)(s,v))),onWorkspaceSymbolResolve:T=>s.onRequest(U.WorkspaceSymbolResolveRequest.type,T),onCodeAction:T=>s.onRequest(U.CodeActionRequest.type,(v,R)=>T(v,R,(0,se.attachWorkDone)(s,v),(0,se.attachPartialResult)(s,v))),onCodeActionResolve:T=>s.onRequest(U.CodeActionResolveRequest.type,(v,R)=>T(v,R)),onCodeLens:T=>s.onRequest(U.CodeLensRequest.type,(v,R)=>T(v,R,(0,se.attachWorkDone)(s,v),(0,se.attachPartialResult)(s,v))),onCodeLensResolve:T=>s.onRequest(U.CodeLensResolveRequest.type,(v,R)=>T(v,R)),onDocumentFormatting:T=>s.onRequest(U.DocumentFormattingRequest.type,(v,R)=>T(v,R,(0,se.attachWorkDone)(s,v),void 0)),onDocumentRangeFormatting:T=>s.onRequest(U.DocumentRangeFormattingRequest.type,(v,R)=>T(v,R,(0,se.attachWorkDone)(s,v),void 0)),onDocumentOnTypeFormatting:T=>s.onRequest(U.DocumentOnTypeFormattingRequest.type,(v,R)=>T(v,R)),onRenameRequest:T=>s.onRequest(U.RenameRequest.type,(v,R)=>T(v,R,(0,se.attachWorkDone)(s,v),void 0)),onPrepareRename:T=>s.onRequest(U.PrepareRenameRequest.type,(v,R)=>T(v,R)),onDocumentLinks:T=>s.onRequest(U.DocumentLinkRequest.type,(v,R)=>T(v,R,(0,se.attachWorkDone)(s,v),(0,se.attachPartialResult)(s,v))),onDocumentLinkResolve:T=>s.onRequest(U.DocumentLinkResolveRequest.type,(v,R)=>T(v,R)),onDocumentColor:T=>s.onRequest(U.DocumentColorRequest.type,(v,R)=>T(v,R,(0,se.attachWorkDone)(s,v),(0,se.attachPartialResult)(s,v))),onColorPresentation:T=>s.onRequest(U.ColorPresentationRequest.type,(v,R)=>T(v,R,(0,se.attachWorkDone)(s,v),(0,se.attachPartialResult)(s,v))),onFoldingRanges:T=>s.onRequest(U.FoldingRangeRequest.type,(v,R)=>T(v,R,(0,se.attachWorkDone)(s,v),(0,se.attachPartialResult)(s,v))),onSelectionRanges:T=>s.onRequest(U.SelectionRangeRequest.type,(v,R)=>T(v,R,(0,se.attachWorkDone)(s,v),(0,se.attachPartialResult)(s,v))),onExecuteCommand:T=>s.onRequest(U.ExecuteCommandRequest.type,(v,R)=>T(v,R,(0,se.attachWorkDone)(s,v),void 0)),dispose:()=>s.dispose()};for(let T of f)T.attach(w);return s.onRequest(U.InitializeRequest.type,T=>{e.initialize(T),Un.string(T.trace)&&(i.trace=U.Trace.fromString(T.trace));for(let v of f)v.initialize(T.capabilities);if(m){let v=m(T,new U.CancellationTokenSource().token,(0,se.attachWorkDone)(s,T),void 0);return p(v).then(R=>{if(R instanceof U.ResponseError)return R;let A=R;A||(A={capabilities:{}});let M=A.capabilities;M||(M={},A.capabilities=M),M.textDocumentSync===void 0||M.textDocumentSync===null?M.textDocumentSync=Un.number(w.__textDocumentSync)?w.__textDocumentSync:U.TextDocumentSyncKind.None:!Un.number(M.textDocumentSync)&&!Un.number(M.textDocumentSync.change)&&(M.textDocumentSync.change=Un.number(w.__textDocumentSync)?w.__textDocumentSync:U.TextDocumentSyncKind.None);for(let z of f)z.fillServerCapabilities(M);return A})}else{let v={capabilities:{textDocumentSync:U.TextDocumentSyncKind.None}};for(let R of f)R.fillServerCapabilities(v.capabilities);return v}}),s.onRequest(U.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,y)return y(new U.CancellationTokenSource().token)}),s.onNotification(U.ExitNotification.type,()=>{try{S&&S()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),s.onNotification(U.SetTraceNotification.type,T=>{i.trace=U.Trace.fromString(T.value)}),w}Ne.createConnection=fM});var Yw=E(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.resolveModulePath=bn.FileSystem=bn.resolveGlobalYarnPath=bn.resolveGlobalNodePath=bn.resolve=bn.uriToFilePath=void 0;var hM=require("url"),ar=require("path"),Gm=require("fs"),Qm=require("child_process");function pM(n){let e=hM.parse(n);if(e.protocol!=="file:"||!e.path)return;let t=e.path.split("/");for(var r=0,s=t.length;r<s;r++)t[r]=decodeURIComponent(t[r]);if(process.platform==="win32"&&t.length>1){let i=t[0],o=t[1];i.length===0&&o.length>1&&o[1]===":"&&t.shift()}return ar.normalize(t.join("/"))}bn.uriToFilePath=pM;function Ym(){return process.platform==="win32"}function Qu(n,e,t,r){let s="NODE_PATH",i=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((o,a)=>{let c=process.env,l=Object.create(null);Object.keys(c).forEach(u=>l[u]=c[u]),e&&Gm.existsSync(e)&&(l[s]?l[s]=e+ar.delimiter+l[s]:l[s]=e,r&&r(`NODE_PATH value is: ${l[s]}`)),l.ELECTRON_RUN_AS_NODE="1";try{let u=(0,Qm.fork)("",[],{cwd:t,env:l,execArgv:["-e",i]});if(u.pid===void 0){a(new Error(`Starting process to resolve node module ${n} failed`));return}u.on("error",f=>{a(f)}),u.on("message",f=>{f.c==="r"&&(u.send({c:"e"}),f.s?o(f.r):a(new Error(`Failed to resolve module: ${n}`)))});let d={c:"rs",a:n};u.send(d)}catch(u){a(u)}})}bn.resolve=Qu;function Jm(n){let e="npm",t=Object.create(null);Object.keys(process.env).forEach(i=>t[i]=process.env[i]),t.NO_UPDATE_NOTIFIER="true";let r={encoding:"utf8",env:t};Ym()&&(e="npm.cmd",r.shell=!0);let s=()=>{};try{process.on("SIGPIPE",s);let i=(0,Qm.spawnSync)(e,["config","get","prefix"],r).stdout;if(!i){n&&n("'npm config get prefix' didn't return a value.");return}let o=i.trim();return n&&n(`'npm config get prefix' value is: ${o}`),o.length>0?Ym()?ar.join(o,"node_modules"):ar.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",s)}}bn.resolveGlobalNodePath=Jm;function mM(n){let e="yarn",t={encoding:"utf8"};Ym()&&(e="yarn.cmd",t.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let s=(0,Qm.spawnSync)(e,["global","dir","--json"],t),i=s.stdout;if(!i){n&&(n("'yarn global dir' didn't return a value."),s.stderr&&n(s.stderr));return}let o=i.trim().split(/\r?\n/);for(let a of o)try{let c=JSON.parse(a);if(c.type==="log")return ar.join(c.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",r)}}bn.resolveGlobalYarnPath=mM;var Xm;(function(n){let e;function t(){return e!==void 0||(process.platform==="win32"?e=!1:e=!Gm.existsSync(__filename.toUpperCase())||!Gm.existsSync(__filename.toLowerCase())),e}n.isCaseSensitive=t;function r(s,i){return t()?ar.normalize(i).indexOf(ar.normalize(s))===0:ar.normalize(i).toLowerCase().indexOf(ar.normalize(s).toLowerCase())===0}n.isParent=r})(Xm||(bn.FileSystem=Xm={}));function gM(n,e,t,r){return t?(ar.isAbsolute(t)||(t=ar.join(n,t)),Qu(e,t,t,r).then(s=>Xm.isParent(t,s)?s:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,s=>Qu(e,Jm(r),n,r))):Qu(e,Jm(r),n,r)}bn.resolveModulePath=gM});var Zm=E((IG,Jw)=>{"use strict";Jw.exports=pt()});var Xw=E(Zu=>{"use strict";Object.defineProperty(Zu,"__esModule",{value:!0});Zu.InlineCompletionFeature=void 0;var yM=pt(),bM=n=>class extends n{get inlineCompletion(){return{on:e=>this.connection.onRequest(yM.InlineCompletionRequest.type,(t,r)=>e(t,r,this.attachWorkDoneProgress(t)))}}};Zu.InlineCompletionFeature=bM});var ek=E(Jt=>{"use strict";var vM=Jt&&Jt.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,s)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),Zw=Jt&&Jt.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&vM(e,n,t)};Object.defineProperty(Jt,"__esModule",{value:!0});Jt.ProposedFeatures=Jt.NotebookDocuments=Jt.TextDocuments=Jt.SemanticTokensBuilder=void 0;var TM=Mm();Object.defineProperty(Jt,"SemanticTokensBuilder",{enumerable:!0,get:function(){return TM.SemanticTokensBuilder}});var SM=Xw();Zw(pt(),Jt);var _M=jm();Object.defineProperty(Jt,"TextDocuments",{enumerable:!0,get:function(){return _M.TextDocuments}});var EM=Bm();Object.defineProperty(Jt,"NotebookDocuments",{enumerable:!0,get:function(){return EM.NotebookDocuments}});Zw(Km(),Jt);var Qw;(function(n){n.all={__brand:"features",languages:SM.InlineCompletionFeature}})(Qw||(Jt.ProposedFeatures=Qw={}))});var X=E(Vn=>{"use strict";var wM=Vn&&Vn.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,s)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),sk=Vn&&Vn.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&wM(e,n,t)};Object.defineProperty(Vn,"__esModule",{value:!0});Vn.createConnection=Vn.Files=void 0;var tk=require("node:util"),eg=jl(),kM=Km(),Ma=Yw(),ci=Zm();sk(Zm(),Vn);sk(ek(),Vn);var nk;(function(n){n.uriToFilePath=Ma.uriToFilePath,n.resolveGlobalNodePath=Ma.resolveGlobalNodePath,n.resolveGlobalYarnPath=Ma.resolveGlobalYarnPath,n.resolve=Ma.resolve,n.resolveModulePath=Ma.resolveModulePath})(nk||(Vn.Files=nk={}));var rk;function ed(){if(rk!==void 0)try{rk.end()}catch{}}var po=!1,ik;function NM(){let n="--clientProcessId";function e(t){try{let r=parseInt(t);isNaN(r)||(ik=setInterval(()=>{try{process.kill(r,0)}catch{ed(),process.exit(po?0:1)}},3e3))}catch{}}for(let t=2;t<process.argv.length;t++){let r=process.argv[t];if(r===n&&t+1<process.argv.length){e(process.argv[t+1]);return}else{let s=r.split("=");s[0]===n&&e(s[1])}}}NM();var PM={initialize:n=>{let e=n.processId;eg.number(e)&&ik===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(po?0:1)}},3e3)},get shutdownReceived(){return po},set shutdownReceived(n){po=n},exit:n=>{ed(),process.exit(n)}};function RM(n,e,t,r){let s,i,o,a;return n!==void 0&&n.__brand==="features"&&(s=n,n=e,e=t,t=r),ci.ConnectionStrategy.is(n)||ci.ConnectionOptions.is(n)?a=n:(i=n,o=e,a=t),DM(i,o,a,s)}Vn.createConnection=RM;function DM(n,e,t,r){let s=!1;if(!n&&!e&&process.argv.length>2){let c,l,u=process.argv.slice(2);for(let d=0;d<u.length;d++){let f=u[d];if(f==="--node-ipc"){n=new ci.IPCMessageReader(process),e=new ci.IPCMessageWriter(process);break}else if(f==="--stdio"){s=!0,n=process.stdin,e=process.stdout;break}else if(f==="--socket"){c=parseInt(u[d+1]);break}else if(f==="--pipe"){l=u[d+1];break}else{var i=f.split("=");if(i[0]==="--socket"){c=parseInt(i[1]);break}else if(i[0]==="--pipe"){l=i[1];break}}}if(c){let d=(0,ci.createServerSocketTransport)(c);n=d[0],e=d[1]}else if(l){let d=(0,ci.createServerPipeTransport)(l);n=d[0],e=d[1]}}var o="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!n)throw new Error("Connection input stream is not set. "+o);if(!e)throw new Error("Connection output stream is not set. "+o);if(eg.func(n.read)&&eg.func(n.on)){let c=n;c.on("end",()=>{ed(),process.exit(po?0:1)}),c.on("close",()=>{ed(),process.exit(po?0:1)})}let a=c=>{let l=(0,ci.createProtocolConnection)(n,e,c,t);return s&&CM(c),l};return(0,kM.createConnection)(a,PM,r)}function CM(n){function e(r){return r.map(s=>typeof s=="string"?s:(0,tk.inspect)(s)).join(" ")}let t=new Map;console.assert=function(s,...i){if(!s)if(i.length===0)n.error("Assertion failed");else{let[o,...a]=i;n.error(`Assertion failed: ${o} ${e(a)}`)}},console.count=function(s="default"){let i=String(s),o=t.get(i)??0;o+=1,t.set(i,o),n.log(`${i}: ${i}`)},console.countReset=function(s){s===void 0?t.clear():t.delete(String(s))},console.debug=function(...s){n.log(e(s))},console.dir=function(s,i){n.log((0,tk.inspect)(s,i))},console.log=function(...s){n.log(e(s))},console.error=function(...s){n.error(e(s))},console.trace=function(...s){let i=new Error().stack.replace(/(.+\n){2}/,""),o="Trace";s.length!==0&&(o+=`: ${e(s)}`),n.log(`${o}
37
- ${i}`)},console.warn=function(...s){n.warn(e(s))}}});var ak=E((qG,ok)=>{"use strict";ok.exports=X()});var _e=E(Vt=>{"use strict";var bg=Symbol.for("yaml.alias"),UN=Symbol.for("yaml.document"),Jd=Symbol.for("yaml.map"),VN=Symbol.for("yaml.pair"),vg=Symbol.for("yaml.scalar"),Xd=Symbol.for("yaml.seq"),Zr=Symbol.for("yaml.node.type"),N$=n=>!!n&&typeof n=="object"&&n[Zr]===bg,P$=n=>!!n&&typeof n=="object"&&n[Zr]===UN,R$=n=>!!n&&typeof n=="object"&&n[Zr]===Jd,D$=n=>!!n&&typeof n=="object"&&n[Zr]===VN,WN=n=>!!n&&typeof n=="object"&&n[Zr]===vg,C$=n=>!!n&&typeof n=="object"&&n[Zr]===Xd;function zN(n){if(n&&typeof n=="object")switch(n[Zr]){case Jd:case Xd:return!0}return!1}function A$(n){if(n&&typeof n=="object")switch(n[Zr]){case bg:case Jd:case vg:case Xd:return!0}return!1}var O$=n=>(WN(n)||zN(n))&&!!n.anchor;Vt.ALIAS=bg;Vt.DOC=UN;Vt.MAP=Jd;Vt.NODE_TYPE=Zr;Vt.PAIR=VN;Vt.SCALAR=vg;Vt.SEQ=Xd;Vt.hasAnchor=O$;Vt.isAlias=N$;Vt.isCollection=zN;Vt.isDocument=P$;Vt.isMap=R$;Vt.isNode=A$;Vt.isPair=D$;Vt.isScalar=WN;Vt.isSeq=C$});var Ya=E(Tg=>{"use strict";var Rt=_e(),_n=Symbol("break visit"),HN=Symbol("skip children"),Ir=Symbol("remove node");function Qd(n,e){let t=KN(e);Rt.isDocument(n)?Ao(null,n.contents,t,Object.freeze([n]))===Ir&&(n.contents=null):Ao(null,n,t,Object.freeze([]))}Qd.BREAK=_n;Qd.SKIP=HN;Qd.REMOVE=Ir;function Ao(n,e,t,r){let s=GN(n,e,t,r);if(Rt.isNode(s)||Rt.isPair(s))return YN(n,r,s),Ao(n,s,t,r);if(typeof s!="symbol"){if(Rt.isCollection(e)){r=Object.freeze(r.concat(e));for(let i=0;i<e.items.length;++i){let o=Ao(i,e.items[i],t,r);if(typeof o=="number")i=o-1;else{if(o===_n)return _n;o===Ir&&(e.items.splice(i,1),i-=1)}}}else if(Rt.isPair(e)){r=Object.freeze(r.concat(e));let i=Ao("key",e.key,t,r);if(i===_n)return _n;i===Ir&&(e.key=null);let o=Ao("value",e.value,t,r);if(o===_n)return _n;o===Ir&&(e.value=null)}}return s}async function Zd(n,e){let t=KN(e);Rt.isDocument(n)?await Oo(null,n.contents,t,Object.freeze([n]))===Ir&&(n.contents=null):await Oo(null,n,t,Object.freeze([]))}Zd.BREAK=_n;Zd.SKIP=HN;Zd.REMOVE=Ir;async function Oo(n,e,t,r){let s=await GN(n,e,t,r);if(Rt.isNode(s)||Rt.isPair(s))return YN(n,r,s),Oo(n,s,t,r);if(typeof s!="symbol"){if(Rt.isCollection(e)){r=Object.freeze(r.concat(e));for(let i=0;i<e.items.length;++i){let o=await Oo(i,e.items[i],t,r);if(typeof o=="number")i=o-1;else{if(o===_n)return _n;o===Ir&&(e.items.splice(i,1),i-=1)}}}else if(Rt.isPair(e)){r=Object.freeze(r.concat(e));let i=await Oo("key",e.key,t,r);if(i===_n)return _n;i===Ir&&(e.key=null);let o=await Oo("value",e.value,t,r);if(o===_n)return _n;o===Ir&&(e.value=null)}}return s}function KN(n){return typeof n=="object"&&(n.Collection||n.Node||n.Value)?Object.assign({Alias:n.Node,Map:n.Node,Scalar:n.Node,Seq:n.Node},n.Value&&{Map:n.Value,Scalar:n.Value,Seq:n.Value},n.Collection&&{Map:n.Collection,Seq:n.Collection},n):n}function GN(n,e,t,r){if(typeof t=="function")return t(n,e,r);if(Rt.isMap(e))return t.Map?.(n,e,r);if(Rt.isSeq(e))return t.Seq?.(n,e,r);if(Rt.isPair(e))return t.Pair?.(n,e,r);if(Rt.isScalar(e))return t.Scalar?.(n,e,r);if(Rt.isAlias(e))return t.Alias?.(n,e,r)}function YN(n,e,t){let r=e[e.length-1];if(Rt.isCollection(r))r.items[n]=t;else if(Rt.isPair(r))n==="key"?r.key=t:r.value=t;else if(Rt.isDocument(r))r.contents=t;else{let s=Rt.isAlias(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}Tg.visit=Qd;Tg.visitAsync=Zd});var Sg=E(XN=>{"use strict";var JN=_e(),I$=Ya(),x$={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},M$=n=>n.replace(/[!,[\]{}]/g,e=>x$[e]),Ja=class n{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},n.defaultYaml,e),this.tags=Object.assign({},n.defaultTags,t)}clone(){let e=new n(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new n(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:n.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},n.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:n.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},n.defaultTags),this.atNextDocument=!1);let r=e.trim().split(/[ \t]+/),s=r.shift();switch(s){case"%TAG":{if(r.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[i,o]=r;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[i]=r;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{let o=/^\d+\.\d+$/.test(i);return t(6,`Unsupported YAML version ${i}`,o),!1}}default:return t(0,`Unknown directive ${s}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}let[,r,s]=e.match(/^(.*!)([^!]*)$/s);s||t(`The ${e} tag has no suffix`);let i=this.tags[r];if(i)try{return i+decodeURIComponent(s)}catch(o){return t(String(o)),null}return r==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,r]of Object.entries(this.tags))if(e.startsWith(r))return t+M$(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),s;if(e&&r.length>0&&JN.isNode(e.contents)){let i={};I$.visit(e.contents,(o,a)=>{JN.isNode(a)&&a.tag&&(i[a.tag]=!0)}),s=Object.keys(i)}else s=[];for(let[i,o]of r)i==="!!"&&o==="tag:yaml.org,2002:"||(!e||s.some(a=>a.startsWith(o)))&&t.push(`%TAG ${i} ${o}`);return t.join(`
38
- `)}};Ja.defaultYaml={explicit:!1,version:"1.2"};Ja.defaultTags={"!!":"tag:yaml.org,2002:"};XN.Directives=Ja});var ef=E(Xa=>{"use strict";var QN=_e(),$$=Ya();function L$(n){if(/[\x00-\x19\s,[\]{}]/.test(n)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(n)}`;throw new Error(t)}return!0}function ZN(n){let e=new Set;return $$.visit(n,{Value(t,r){r.anchor&&e.add(r.anchor)}}),e}function eP(n,e){for(let t=1;;++t){let r=`${n}${t}`;if(!e.has(r))return r}}function q$(n,e){let t=[],r=new Map,s=null;return{onAnchor:i=>{t.push(i),s||(s=ZN(n));let o=eP(e,s);return s.add(o),o},setAnchors:()=>{for(let i of t){let o=r.get(i);if(typeof o=="object"&&o.anchor&&(QN.isScalar(o.node)||QN.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=i,a}}},sourceObjects:r}}Xa.anchorIsValid=L$;Xa.anchorNames=ZN;Xa.createNodeAnchors=q$;Xa.findNewAnchor=eP});var _g=E(tP=>{"use strict";function Qa(n,e,t,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,i=r.length;s<i;++s){let o=r[s],a=Qa(n,r,String(s),o);a===void 0?delete r[s]:a!==o&&(r[s]=a)}else if(r instanceof Map)for(let s of Array.from(r.keys())){let i=r.get(s),o=Qa(n,r,s,i);o===void 0?r.delete(s):o!==i&&r.set(s,o)}else if(r instanceof Set)for(let s of Array.from(r)){let i=Qa(n,r,s,s);i===void 0?r.delete(s):i!==s&&(r.delete(s),r.add(i))}else for(let[s,i]of Object.entries(r)){let o=Qa(n,r,s,i);o===void 0?delete r[s]:o!==i&&(r[s]=o)}return n.call(e,t,r)}tP.applyReviver=Qa});var Cs=E(rP=>{"use strict";var j$=_e();function nP(n,e,t){if(Array.isArray(n))return n.map((r,s)=>nP(r,String(s),t));if(n&&typeof n.toJSON=="function"){if(!t||!j$.hasAnchor(n))return n.toJSON(e,t);let r={aliasCount:0,count:1,res:void 0};t.anchors.set(n,r),t.onCreate=i=>{r.res=i,delete t.onCreate};let s=n.toJSON(e,t);return t.onCreate&&t.onCreate(s),s}return typeof n=="bigint"&&!t?.keep?Number(n):n}rP.toJS=nP});var tf=E(iP=>{"use strict";var F$=_g(),sP=_e(),B$=Cs(),Eg=class{constructor(e){Object.defineProperty(this,sP.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:r,onAnchor:s,reviver:i}={}){if(!sP.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=B$.toJS(this,"",o);if(typeof s=="function")for(let{count:c,res:l}of o.anchors.values())s(l,c);return typeof i=="function"?F$.applyReviver(i,{"":a},"",a):a}};iP.NodeBase=Eg});var Za=E(aP=>{"use strict";var U$=ef(),oP=Ya(),nf=_e(),V$=tf(),W$=Cs(),wg=class extends V$.NodeBase{constructor(e){super(nf.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let t;return oP.visit(e,{Node:(r,s)=>{if(s===this)return oP.visit.BREAK;s.anchor===this.source&&(t=s)}}),t}toJSON(e,t){if(!t)return{source:this.source};let{anchors:r,doc:s,maxAliasCount:i}=t,o=this.resolve(s);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=r.get(o);if(a||(W$.toJS(o,null,t),a=r.get(o)),!a||a.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=rf(s,o,r)),a.count*a.aliasCount>i)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,t,r){let s=`*${this.source}`;if(e){if(U$.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(e.implicitKey)return`${s} `}return s}};function rf(n,e,t){if(nf.isAlias(e)){let r=e.resolve(n),s=t&&r&&t.get(r);return s?s.count*s.aliasCount:0}else if(nf.isCollection(e)){let r=0;for(let s of e.items){let i=rf(n,s,t);i>r&&(r=i)}return r}else if(nf.isPair(e)){let r=rf(n,e.key,t),s=rf(n,e.value,t);return Math.max(r,s)}return 1}aP.Alias=wg});var Et=E(kg=>{"use strict";var z$=_e(),H$=tf(),K$=Cs(),G$=n=>!n||typeof n!="function"&&typeof n!="object",As=class extends H$.NodeBase{constructor(e){super(z$.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:K$.toJS(this.value,e,t)}toString(){return String(this.value)}};As.BLOCK_FOLDED="BLOCK_FOLDED";As.BLOCK_LITERAL="BLOCK_LITERAL";As.PLAIN="PLAIN";As.QUOTE_DOUBLE="QUOTE_DOUBLE";As.QUOTE_SINGLE="QUOTE_SINGLE";kg.Scalar=As;kg.isScalarValue=G$});var ec=E(lP=>{"use strict";var Y$=Za(),gi=_e(),cP=Et(),J$="tag:yaml.org,2002:";function X$(n,e,t){if(e){let r=t.filter(i=>i.tag===e),s=r.find(i=>!i.format)??r[0];if(!s)throw new Error(`Tag ${e} not found`);return s}return t.find(r=>r.identify?.(n)&&!r.format)}function Q$(n,e,t){if(gi.isDocument(n)&&(n=n.contents),gi.isNode(n))return n;if(gi.isPair(n)){let d=t.schema[gi.MAP].createNode?.(t.schema,null,t);return d.items.push(n),d}(n instanceof String||n instanceof Number||n instanceof Boolean||typeof BigInt<"u"&&n instanceof BigInt)&&(n=n.valueOf());let{aliasDuplicateObjects:r,onAnchor:s,onTagObj:i,schema:o,sourceObjects:a}=t,c;if(r&&n&&typeof n=="object"){if(c=a.get(n),c)return c.anchor||(c.anchor=s(n)),new Y$.Alias(c.anchor);c={anchor:null,node:null},a.set(n,c)}e?.startsWith("!!")&&(e=J$+e.slice(2));let l=X$(n,e,o.tags);if(!l){if(n&&typeof n.toJSON=="function"&&(n=n.toJSON()),!n||typeof n!="object"){let d=new cP.Scalar(n);return c&&(c.node=d),d}l=n instanceof Map?o[gi.MAP]:Symbol.iterator in Object(n)?o[gi.SEQ]:o[gi.MAP]}i&&(i(l),delete t.onTagObj);let u=l?.createNode?l.createNode(t.schema,n,t):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(t.schema,n,t):new cP.Scalar(n);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}lP.createNode=Q$});var of=E(sf=>{"use strict";var Z$=ec(),xr=_e(),eL=tf();function Ng(n,e,t){let r=t;for(let s=e.length-1;s>=0;--s){let i=e[s];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){let o=[];o[i]=r,r=o}else r=new Map([[i,r]])}return Z$.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:n,sourceObjects:new Map})}var uP=n=>n==null||typeof n=="object"&&!!n[Symbol.iterator]().next().done,Pg=class extends eL.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(r=>xr.isNode(r)||xr.isPair(r)?r.clone(e):r),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(uP(e))this.add(t);else{let[r,...s]=e,i=this.get(r,!0);if(xr.isCollection(i))i.addIn(s,t);else if(i===void 0&&this.schema)this.set(r,Ng(this.schema,s,t));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}deleteIn(e){let[t,...r]=e;if(r.length===0)return this.delete(t);let s=this.get(t,!0);if(xr.isCollection(s))return s.deleteIn(r);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){let[r,...s]=e,i=this.get(r,!0);return s.length===0?!t&&xr.isScalar(i)?i.value:i:xr.isCollection(i)?i.getIn(s,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!xr.isPair(t))return!1;let r=t.value;return r==null||e&&xr.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[t,...r]=e;if(r.length===0)return this.has(t);let s=this.get(t,!0);return xr.isCollection(s)?s.hasIn(r):!1}setIn(e,t){let[r,...s]=e;if(s.length===0)this.set(r,t);else{let i=this.get(r,!0);if(xr.isCollection(i))i.setIn(s,t);else if(i===void 0&&this.schema)this.set(r,Ng(this.schema,s,t));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}};sf.Collection=Pg;sf.collectionFromPath=Ng;sf.isEmptyPath=uP});var tc=E(af=>{"use strict";var tL=n=>n.replace(/^(?!$)(?: $)?/gm,"#");function Rg(n,e){return/^\n+$/.test(n)?n.substring(1):e?n.replace(/^(?! *$)/gm,e):n}var nL=(n,e,t)=>n.endsWith(`
39
- `)?Rg(t,e):t.includes(`
34
+ `,"\r"];var l_;(function(g){function N(C,M,ae,mt){return new jx(C,M,ae,mt)}g.create=N;function P(C){var M=C;return!!(A.defined(M)&&A.string(M.uri)&&(A.undefined(M.languageId)||A.string(M.languageId))&&A.uinteger(M.lineCount)&&A.func(M.getText)&&A.func(M.positionAt)&&A.func(M.offsetAt))}g.is=P;function v(C,M){for(var ae=C.getText(),mt=p(M,function(Qi,Gl){var u_=Qi.range.start.line-Gl.range.start.line;return u_===0?Qi.range.start.character-Gl.range.start.character:u_}),Je=ae.length,ir=mt.length-1;ir>=0;ir--){var or=mt[ir],Xr=C.offsetAt(or.range.start),Te=C.offsetAt(or.range.end);if(Te<=Je)ae=ae.substring(0,Xr)+or.newText+ae.substring(Te,ae.length);else throw new Error("Overlapping edit");Je=Xr}return ae}g.applyEdits=v;function p(C,M){if(C.length<=1)return C;var ae=C.length/2|0,mt=C.slice(0,ae),Je=C.slice(ae);p(mt,M),p(Je,M);for(var ir=0,or=0,Xr=0;ir<mt.length&&or<Je.length;){var Te=M(mt[ir],Je[or]);Te<=0?C[Xr++]=mt[ir++]:C[Xr++]=Je[or++]}for(;ir<mt.length;)C[Xr++]=mt[ir++];for(;or<Je.length;)C[Xr++]=Je[or++];return C}})(l_||(e.TextDocument=l_={}));var jx=function(){function g(N,P,v,p){this._uri=N,this._languageId=P,this._version=v,this._content=p,this._lineOffsets=void 0}return Object.defineProperty(g.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),g.prototype.getText=function(N){if(N){var P=this.offsetAt(N.start),v=this.offsetAt(N.end);return this._content.substring(P,v)}return this._content},g.prototype.update=function(N,P){this._content=N.text,this._version=P,this._lineOffsets=void 0},g.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var N=[],P=this._content,v=!0,p=0;p<P.length;p++){v&&(N.push(p),v=!1);var C=P.charAt(p);v=C==="\r"||C===`
35
+ `,C==="\r"&&p+1<P.length&&P.charAt(p+1)===`
36
+ `&&p++}v&&P.length>0&&N.push(P.length),this._lineOffsets=N}return this._lineOffsets},g.prototype.positionAt=function(N){N=Math.max(Math.min(N,this._content.length),0);var P=this.getLineOffsets(),v=0,p=P.length;if(p===0)return o.create(0,N);for(;v<p;){var C=Math.floor((v+p)/2);P[C]>N?p=C:v=C+1}var M=v-1;return o.create(M,N-P[M])},g.prototype.offsetAt=function(N){var P=this.getLineOffsets();if(N.line>=P.length)return this._content.length;if(N.line<0)return 0;var v=P[N.line],p=N.line+1<P.length?P[N.line+1]:this._content.length;return Math.max(Math.min(v+N.character,p),v)},Object.defineProperty(g.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),g}(),A;(function(g){var N=Object.prototype.toString;function P(Te){return typeof Te<"u"}g.defined=P;function v(Te){return typeof Te>"u"}g.undefined=v;function p(Te){return Te===!0||Te===!1}g.boolean=p;function C(Te){return N.call(Te)==="[object String]"}g.string=C;function M(Te){return N.call(Te)==="[object Number]"}g.number=M;function ae(Te,Qi,Gl){return N.call(Te)==="[object Number]"&&Qi<=Te&&Te<=Gl}g.numberRange=ae;function mt(Te){return N.call(Te)==="[object Number]"&&-2147483648<=Te&&Te<=2147483647}g.integer=mt;function Je(Te){return N.call(Te)==="[object Number]"&&0<=Te&&Te<=2147483647}g.uinteger=Je;function ir(Te){return N.call(Te)==="[object Function]"}g.func=ir;function or(Te){return Te!==null&&typeof Te=="object"}g.objectLiteral=or;function Xr(Te,Qi){return Array.isArray(Te)&&Te.every(Qi)}g.typedArray=Xr})(A||(A={}))})});var ut=w(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.ProtocolNotificationType=gn.ProtocolNotificationType0=gn.ProtocolRequestType=gn.ProtocolRequestType0=gn.RegistrationType=gn.MessageDirection=void 0;var ao=ui(),W_;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(W_||(gn.MessageDirection=W_={}));var Pm=class{constructor(e){this.method=e}};gn.RegistrationType=Pm;var Rm=class extends ao.RequestType0{constructor(e){super(e)}};gn.ProtocolRequestType0=Rm;var Dm=class extends ao.RequestType{constructor(e){super(e,ao.ParameterStructures.byName)}};gn.ProtocolRequestType=Dm;var Cm=class extends ao.NotificationType0{constructor(e){super(e)}};gn.ProtocolNotificationType0=Cm;var Am=class extends ao.NotificationType{constructor(e){super(e,ao.ParameterStructures.byName)}};gn.ProtocolNotificationType=Am});var bu=w(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.objectLiteral=kt.typedArray=kt.stringArray=kt.array=kt.func=kt.error=kt.number=kt.string=kt.boolean=void 0;function IM(t){return t===!0||t===!1}kt.boolean=IM;function H_(t){return typeof t=="string"||t instanceof String}kt.string=H_;function xM(t){return typeof t=="number"||t instanceof Number}kt.number=xM;function MM(t){return t instanceof Error}kt.error=MM;function LM(t){return typeof t=="function"}kt.func=LM;function G_(t){return Array.isArray(t)}kt.array=G_;function $M(t){return G_(t)&&t.every(e=>H_(e))}kt.stringArray=$M;function qM(t,e){return Array.isArray(t)&&t.every(e)}kt.typedArray=qM;function jM(t){return t!==null&&typeof t=="object"}kt.objectLiteral=jM});var X_=w(vu=>{"use strict";Object.defineProperty(vu,"__esModule",{value:!0});vu.ImplementationRequest=void 0;var K_=ut(),Y_;(function(t){t.method="textDocument/implementation",t.messageDirection=K_.MessageDirection.clientToServer,t.type=new K_.ProtocolRequestType(t.method)})(Y_||(vu.ImplementationRequest=Y_={}))});var Z_=w(Tu=>{"use strict";Object.defineProperty(Tu,"__esModule",{value:!0});Tu.TypeDefinitionRequest=void 0;var J_=ut(),Q_;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=J_.MessageDirection.clientToServer,t.type=new J_.ProtocolRequestType(t.method)})(Q_||(Tu.TypeDefinitionRequest=Q_={}))});var nS=w(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.DidChangeWorkspaceFoldersNotification=co.WorkspaceFoldersRequest=void 0;var _u=ut(),eS;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=_u.MessageDirection.serverToClient,t.type=new _u.ProtocolRequestType0(t.method)})(eS||(co.WorkspaceFoldersRequest=eS={}));var tS;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=_u.MessageDirection.clientToServer,t.type=new _u.ProtocolNotificationType(t.method)})(tS||(co.DidChangeWorkspaceFoldersNotification=tS={}))});var iS=w(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});Su.ConfigurationRequest=void 0;var rS=ut(),sS;(function(t){t.method="workspace/configuration",t.messageDirection=rS.MessageDirection.serverToClient,t.type=new rS.ProtocolRequestType(t.method)})(sS||(Su.ConfigurationRequest=sS={}))});var cS=w(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.ColorPresentationRequest=lo.DocumentColorRequest=void 0;var Eu=ut(),oS;(function(t){t.method="textDocument/documentColor",t.messageDirection=Eu.MessageDirection.clientToServer,t.type=new Eu.ProtocolRequestType(t.method)})(oS||(lo.DocumentColorRequest=oS={}));var aS;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=Eu.MessageDirection.clientToServer,t.type=new Eu.ProtocolRequestType(t.method)})(aS||(lo.ColorPresentationRequest=aS={}))});var dS=w(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.FoldingRangeRefreshRequest=uo.FoldingRangeRequest=void 0;var wu=ut(),lS;(function(t){t.method="textDocument/foldingRange",t.messageDirection=wu.MessageDirection.clientToServer,t.type=new wu.ProtocolRequestType(t.method)})(lS||(uo.FoldingRangeRequest=lS={}));var uS;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=wu.MessageDirection.serverToClient,t.type=new wu.ProtocolRequestType0(t.method)})(uS||(uo.FoldingRangeRefreshRequest=uS={}))});var pS=w(ku=>{"use strict";Object.defineProperty(ku,"__esModule",{value:!0});ku.DeclarationRequest=void 0;var fS=ut(),hS;(function(t){t.method="textDocument/declaration",t.messageDirection=fS.MessageDirection.clientToServer,t.type=new fS.ProtocolRequestType(t.method)})(hS||(ku.DeclarationRequest=hS={}))});var yS=w(Nu=>{"use strict";Object.defineProperty(Nu,"__esModule",{value:!0});Nu.SelectionRangeRequest=void 0;var mS=ut(),gS;(function(t){t.method="textDocument/selectionRange",t.messageDirection=mS.MessageDirection.clientToServer,t.type=new mS.ProtocolRequestType(t.method)})(gS||(Nu.SelectionRangeRequest=gS={}))});var _S=w(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.WorkDoneProgressCancelNotification=gs.WorkDoneProgressCreateRequest=gs.WorkDoneProgress=void 0;var FM=ui(),Pu=ut(),bS;(function(t){t.type=new FM.ProgressType;function e(n){return n===t.type}t.is=e})(bS||(gs.WorkDoneProgress=bS={}));var vS;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=Pu.MessageDirection.serverToClient,t.type=new Pu.ProtocolRequestType(t.method)})(vS||(gs.WorkDoneProgressCreateRequest=vS={}));var TS;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=Pu.MessageDirection.clientToServer,t.type=new Pu.ProtocolNotificationType(t.method)})(TS||(gs.WorkDoneProgressCancelNotification=TS={}))});var kS=w(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});ys.CallHierarchyOutgoingCallsRequest=ys.CallHierarchyIncomingCallsRequest=ys.CallHierarchyPrepareRequest=void 0;var fo=ut(),SS;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=fo.MessageDirection.clientToServer,t.type=new fo.ProtocolRequestType(t.method)})(SS||(ys.CallHierarchyPrepareRequest=SS={}));var ES;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=fo.MessageDirection.clientToServer,t.type=new fo.ProtocolRequestType(t.method)})(ES||(ys.CallHierarchyIncomingCallsRequest=ES={}));var wS;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=fo.MessageDirection.clientToServer,t.type=new fo.ProtocolRequestType(t.method)})(wS||(ys.CallHierarchyOutgoingCallsRequest=wS={}))});var AS=w(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.SemanticTokensRefreshRequest=yn.SemanticTokensRangeRequest=yn.SemanticTokensDeltaRequest=yn.SemanticTokensRequest=yn.SemanticTokensRegistrationType=yn.TokenFormat=void 0;var Qr=ut(),NS;(function(t){t.Relative="relative"})(NS||(yn.TokenFormat=NS={}));var La;(function(t){t.method="textDocument/semanticTokens",t.type=new Qr.RegistrationType(t.method)})(La||(yn.SemanticTokensRegistrationType=La={}));var PS;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=Qr.MessageDirection.clientToServer,t.type=new Qr.ProtocolRequestType(t.method),t.registrationMethod=La.method})(PS||(yn.SemanticTokensRequest=PS={}));var RS;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=Qr.MessageDirection.clientToServer,t.type=new Qr.ProtocolRequestType(t.method),t.registrationMethod=La.method})(RS||(yn.SemanticTokensDeltaRequest=RS={}));var DS;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=Qr.MessageDirection.clientToServer,t.type=new Qr.ProtocolRequestType(t.method),t.registrationMethod=La.method})(DS||(yn.SemanticTokensRangeRequest=DS={}));var CS;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=Qr.MessageDirection.serverToClient,t.type=new Qr.ProtocolRequestType0(t.method)})(CS||(yn.SemanticTokensRefreshRequest=CS={}))});var xS=w(Ru=>{"use strict";Object.defineProperty(Ru,"__esModule",{value:!0});Ru.ShowDocumentRequest=void 0;var OS=ut(),IS;(function(t){t.method="window/showDocument",t.messageDirection=OS.MessageDirection.serverToClient,t.type=new OS.ProtocolRequestType(t.method)})(IS||(Ru.ShowDocumentRequest=IS={}))});var $S=w(Du=>{"use strict";Object.defineProperty(Du,"__esModule",{value:!0});Du.LinkedEditingRangeRequest=void 0;var MS=ut(),LS;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=MS.MessageDirection.clientToServer,t.type=new MS.ProtocolRequestType(t.method)})(LS||(Du.LinkedEditingRangeRequest=LS={}))});var WS=w(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.WillDeleteFilesRequest=Jt.DidDeleteFilesNotification=Jt.DidRenameFilesNotification=Jt.WillRenameFilesRequest=Jt.DidCreateFilesNotification=Jt.WillCreateFilesRequest=Jt.FileOperationPatternKind=void 0;var Bn=ut(),qS;(function(t){t.file="file",t.folder="folder"})(qS||(Jt.FileOperationPatternKind=qS={}));var jS;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Bn.MessageDirection.clientToServer,t.type=new Bn.ProtocolRequestType(t.method)})(jS||(Jt.WillCreateFilesRequest=jS={}));var FS;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Bn.MessageDirection.clientToServer,t.type=new Bn.ProtocolNotificationType(t.method)})(FS||(Jt.DidCreateFilesNotification=FS={}));var BS;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Bn.MessageDirection.clientToServer,t.type=new Bn.ProtocolRequestType(t.method)})(BS||(Jt.WillRenameFilesRequest=BS={}));var US;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Bn.MessageDirection.clientToServer,t.type=new Bn.ProtocolNotificationType(t.method)})(US||(Jt.DidRenameFilesNotification=US={}));var VS;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Bn.MessageDirection.clientToServer,t.type=new Bn.ProtocolNotificationType(t.method)})(VS||(Jt.DidDeleteFilesNotification=VS={}));var zS;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Bn.MessageDirection.clientToServer,t.type=new Bn.ProtocolRequestType(t.method)})(zS||(Jt.WillDeleteFilesRequest=zS={}))});var XS=w(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});bs.MonikerRequest=bs.MonikerKind=bs.UniquenessLevel=void 0;var HS=ut(),GS;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(GS||(bs.UniquenessLevel=GS={}));var KS;(function(t){t.$import="import",t.$export="export",t.local="local"})(KS||(bs.MonikerKind=KS={}));var YS;(function(t){t.method="textDocument/moniker",t.messageDirection=HS.MessageDirection.clientToServer,t.type=new HS.ProtocolRequestType(t.method)})(YS||(bs.MonikerRequest=YS={}))});var eE=w(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.TypeHierarchySubtypesRequest=vs.TypeHierarchySupertypesRequest=vs.TypeHierarchyPrepareRequest=void 0;var ho=ut(),JS;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=ho.MessageDirection.clientToServer,t.type=new ho.ProtocolRequestType(t.method)})(JS||(vs.TypeHierarchyPrepareRequest=JS={}));var QS;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=ho.MessageDirection.clientToServer,t.type=new ho.ProtocolRequestType(t.method)})(QS||(vs.TypeHierarchySupertypesRequest=QS={}));var ZS;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=ho.MessageDirection.clientToServer,t.type=new ho.ProtocolRequestType(t.method)})(ZS||(vs.TypeHierarchySubtypesRequest=ZS={}))});var rE=w(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.InlineValueRefreshRequest=po.InlineValueRequest=void 0;var Cu=ut(),tE;(function(t){t.method="textDocument/inlineValue",t.messageDirection=Cu.MessageDirection.clientToServer,t.type=new Cu.ProtocolRequestType(t.method)})(tE||(po.InlineValueRequest=tE={}));var nE;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=Cu.MessageDirection.serverToClient,t.type=new Cu.ProtocolRequestType0(t.method)})(nE||(po.InlineValueRefreshRequest=nE={}))});var aE=w(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.InlayHintRefreshRequest=Ts.InlayHintResolveRequest=Ts.InlayHintRequest=void 0;var mo=ut(),sE;(function(t){t.method="textDocument/inlayHint",t.messageDirection=mo.MessageDirection.clientToServer,t.type=new mo.ProtocolRequestType(t.method)})(sE||(Ts.InlayHintRequest=sE={}));var iE;(function(t){t.method="inlayHint/resolve",t.messageDirection=mo.MessageDirection.clientToServer,t.type=new mo.ProtocolRequestType(t.method)})(iE||(Ts.InlayHintResolveRequest=iE={}));var oE;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=mo.MessageDirection.serverToClient,t.type=new mo.ProtocolRequestType0(t.method)})(oE||(Ts.InlayHintRefreshRequest=oE={}))});var pE=w(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.DiagnosticRefreshRequest=Un.WorkspaceDiagnosticRequest=Un.DocumentDiagnosticRequest=Un.DocumentDiagnosticReportKind=Un.DiagnosticServerCancellationData=void 0;var hE=ui(),BM=bu(),go=ut(),cE;(function(t){function e(n){let r=n;return r&&BM.boolean(r.retriggerRequest)}t.is=e})(cE||(Un.DiagnosticServerCancellationData=cE={}));var lE;(function(t){t.Full="full",t.Unchanged="unchanged"})(lE||(Un.DocumentDiagnosticReportKind=lE={}));var uE;(function(t){t.method="textDocument/diagnostic",t.messageDirection=go.MessageDirection.clientToServer,t.type=new go.ProtocolRequestType(t.method),t.partialResult=new hE.ProgressType})(uE||(Un.DocumentDiagnosticRequest=uE={}));var dE;(function(t){t.method="workspace/diagnostic",t.messageDirection=go.MessageDirection.clientToServer,t.type=new go.ProtocolRequestType(t.method),t.partialResult=new hE.ProgressType})(dE||(Un.WorkspaceDiagnosticRequest=dE={}));var fE;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=go.MessageDirection.serverToClient,t.type=new go.ProtocolRequestType0(t.method)})(fE||(Un.DiagnosticRefreshRequest=fE={}))});var _E=w(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.DidCloseNotebookDocumentNotification=gt.DidSaveNotebookDocumentNotification=gt.DidChangeNotebookDocumentNotification=gt.NotebookCellArrayChange=gt.DidOpenNotebookDocumentNotification=gt.NotebookDocumentSyncRegistrationType=gt.NotebookDocument=gt.NotebookCell=gt.ExecutionSummary=gt.NotebookCellKind=void 0;var $a=yu(),cr=bu(),Rr=ut(),Om;(function(t){t.Markup=1,t.Code=2;function e(n){return n===1||n===2}t.is=e})(Om||(gt.NotebookCellKind=Om={}));var Im;(function(t){function e(s,i){let o={executionOrder:s};return(i===!0||i===!1)&&(o.success=i),o}t.create=e;function n(s){let i=s;return cr.objectLiteral(i)&&$a.uinteger.is(i.executionOrder)&&(i.success===void 0||cr.boolean(i.success))}t.is=n;function r(s,i){return s===i?!0:s==null||i===null||i===void 0?!1:s.executionOrder===i.executionOrder&&s.success===i.success}t.equals=r})(Im||(gt.ExecutionSummary=Im={}));var Au;(function(t){function e(i,o){return{kind:i,document:o}}t.create=e;function n(i){let o=i;return cr.objectLiteral(o)&&Om.is(o.kind)&&$a.DocumentUri.is(o.document)&&(o.metadata===void 0||cr.objectLiteral(o.metadata))}t.is=n;function r(i,o){let a=new Set;return i.document!==o.document&&a.add("document"),i.kind!==o.kind&&a.add("kind"),i.executionSummary!==o.executionSummary&&a.add("executionSummary"),(i.metadata!==void 0||o.metadata!==void 0)&&!s(i.metadata,o.metadata)&&a.add("metadata"),(i.executionSummary!==void 0||o.executionSummary!==void 0)&&!Im.equals(i.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}t.diff=r;function s(i,o){if(i===o)return!0;if(i==null||o===null||o===void 0||typeof i!=typeof o||typeof i!="object")return!1;let a=Array.isArray(i),c=Array.isArray(o);if(a!==c)return!1;if(a&&c){if(i.length!==o.length)return!1;for(let l=0;l<i.length;l++)if(!s(i[l],o[l]))return!1}if(cr.objectLiteral(i)&&cr.objectLiteral(o)){let l=Object.keys(i),u=Object.keys(o);if(l.length!==u.length||(l.sort(),u.sort(),!s(l,u)))return!1;for(let d=0;d<l.length;d++){let f=l[d];if(!s(i[f],o[f]))return!1}}return!0}})(Au||(gt.NotebookCell=Au={}));var mE;(function(t){function e(r,s,i,o){return{uri:r,notebookType:s,version:i,cells:o}}t.create=e;function n(r){let s=r;return cr.objectLiteral(s)&&cr.string(s.uri)&&$a.integer.is(s.version)&&cr.typedArray(s.cells,Au.is)}t.is=n})(mE||(gt.NotebookDocument=mE={}));var yo;(function(t){t.method="notebookDocument/sync",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.RegistrationType(t.method)})(yo||(gt.NotebookDocumentSyncRegistrationType=yo={}));var gE;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolNotificationType(t.method),t.registrationMethod=yo.method})(gE||(gt.DidOpenNotebookDocumentNotification=gE={}));var yE;(function(t){function e(r){let s=r;return cr.objectLiteral(s)&&$a.uinteger.is(s.start)&&$a.uinteger.is(s.deleteCount)&&(s.cells===void 0||cr.typedArray(s.cells,Au.is))}t.is=e;function n(r,s,i){let o={start:r,deleteCount:s};return i!==void 0&&(o.cells=i),o}t.create=n})(yE||(gt.NotebookCellArrayChange=yE={}));var bE;(function(t){t.method="notebookDocument/didChange",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolNotificationType(t.method),t.registrationMethod=yo.method})(bE||(gt.DidChangeNotebookDocumentNotification=bE={}));var vE;(function(t){t.method="notebookDocument/didSave",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolNotificationType(t.method),t.registrationMethod=yo.method})(vE||(gt.DidSaveNotebookDocumentNotification=vE={}));var TE;(function(t){t.method="notebookDocument/didClose",t.messageDirection=Rr.MessageDirection.clientToServer,t.type=new Rr.ProtocolNotificationType(t.method),t.registrationMethod=yo.method})(TE||(gt.DidCloseNotebookDocumentNotification=TE={}))});var wE=w(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});Ou.InlineCompletionRequest=void 0;var SE=ut(),EE;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=SE.MessageDirection.clientToServer,t.type=new SE.ProtocolRequestType(t.method)})(EE||(Ou.InlineCompletionRequest=EE={}))});var $w=w(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.WorkspaceSymbolRequest=S.CodeActionResolveRequest=S.CodeActionRequest=S.DocumentSymbolRequest=S.DocumentHighlightRequest=S.ReferencesRequest=S.DefinitionRequest=S.SignatureHelpRequest=S.SignatureHelpTriggerKind=S.HoverRequest=S.CompletionResolveRequest=S.CompletionRequest=S.CompletionTriggerKind=S.PublishDiagnosticsNotification=S.WatchKind=S.RelativePattern=S.FileChangeType=S.DidChangeWatchedFilesNotification=S.WillSaveTextDocumentWaitUntilRequest=S.WillSaveTextDocumentNotification=S.TextDocumentSaveReason=S.DidSaveTextDocumentNotification=S.DidCloseTextDocumentNotification=S.DidChangeTextDocumentNotification=S.TextDocumentContentChangeEvent=S.DidOpenTextDocumentNotification=S.TextDocumentSyncKind=S.TelemetryEventNotification=S.LogMessageNotification=S.ShowMessageRequest=S.ShowMessageNotification=S.MessageType=S.DidChangeConfigurationNotification=S.ExitNotification=S.ShutdownRequest=S.InitializedNotification=S.InitializeErrorCodes=S.InitializeRequest=S.WorkDoneProgressOptions=S.TextDocumentRegistrationOptions=S.StaticRegistrationOptions=S.PositionEncodingKind=S.FailureHandlingKind=S.ResourceOperationKind=S.UnregistrationRequest=S.RegistrationRequest=S.DocumentSelector=S.NotebookCellTextDocumentFilter=S.NotebookDocumentFilter=S.TextDocumentFilter=void 0;S.MonikerRequest=S.MonikerKind=S.UniquenessLevel=S.WillDeleteFilesRequest=S.DidDeleteFilesNotification=S.WillRenameFilesRequest=S.DidRenameFilesNotification=S.WillCreateFilesRequest=S.DidCreateFilesNotification=S.FileOperationPatternKind=S.LinkedEditingRangeRequest=S.ShowDocumentRequest=S.SemanticTokensRegistrationType=S.SemanticTokensRefreshRequest=S.SemanticTokensRangeRequest=S.SemanticTokensDeltaRequest=S.SemanticTokensRequest=S.TokenFormat=S.CallHierarchyPrepareRequest=S.CallHierarchyOutgoingCallsRequest=S.CallHierarchyIncomingCallsRequest=S.WorkDoneProgressCancelNotification=S.WorkDoneProgressCreateRequest=S.WorkDoneProgress=S.SelectionRangeRequest=S.DeclarationRequest=S.FoldingRangeRefreshRequest=S.FoldingRangeRequest=S.ColorPresentationRequest=S.DocumentColorRequest=S.ConfigurationRequest=S.DidChangeWorkspaceFoldersNotification=S.WorkspaceFoldersRequest=S.TypeDefinitionRequest=S.ImplementationRequest=S.ApplyWorkspaceEditRequest=S.ExecuteCommandRequest=S.PrepareRenameRequest=S.RenameRequest=S.PrepareSupportDefaultBehavior=S.DocumentOnTypeFormattingRequest=S.DocumentRangesFormattingRequest=S.DocumentRangeFormattingRequest=S.DocumentFormattingRequest=S.DocumentLinkResolveRequest=S.DocumentLinkRequest=S.CodeLensRefreshRequest=S.CodeLensResolveRequest=S.CodeLensRequest=S.WorkspaceSymbolResolveRequest=void 0;S.InlineCompletionRequest=S.DidCloseNotebookDocumentNotification=S.DidSaveNotebookDocumentNotification=S.DidChangeNotebookDocumentNotification=S.NotebookCellArrayChange=S.DidOpenNotebookDocumentNotification=S.NotebookDocumentSyncRegistrationType=S.NotebookDocument=S.NotebookCell=S.ExecutionSummary=S.NotebookCellKind=S.DiagnosticRefreshRequest=S.WorkspaceDiagnosticRequest=S.DocumentDiagnosticRequest=S.DocumentDiagnosticReportKind=S.DiagnosticServerCancellationData=S.InlayHintRefreshRequest=S.InlayHintResolveRequest=S.InlayHintRequest=S.InlineValueRefreshRequest=S.InlineValueRequest=S.TypeHierarchySupertypesRequest=S.TypeHierarchySubtypesRequest=S.TypeHierarchyPrepareRequest=void 0;var F=ut(),kE=yu(),Mt=bu(),UM=X_();Object.defineProperty(S,"ImplementationRequest",{enumerable:!0,get:function(){return UM.ImplementationRequest}});var VM=Z_();Object.defineProperty(S,"TypeDefinitionRequest",{enumerable:!0,get:function(){return VM.TypeDefinitionRequest}});var Iw=nS();Object.defineProperty(S,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return Iw.WorkspaceFoldersRequest}});Object.defineProperty(S,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return Iw.DidChangeWorkspaceFoldersNotification}});var zM=iS();Object.defineProperty(S,"ConfigurationRequest",{enumerable:!0,get:function(){return zM.ConfigurationRequest}});var xw=cS();Object.defineProperty(S,"DocumentColorRequest",{enumerable:!0,get:function(){return xw.DocumentColorRequest}});Object.defineProperty(S,"ColorPresentationRequest",{enumerable:!0,get:function(){return xw.ColorPresentationRequest}});var Mw=dS();Object.defineProperty(S,"FoldingRangeRequest",{enumerable:!0,get:function(){return Mw.FoldingRangeRequest}});Object.defineProperty(S,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return Mw.FoldingRangeRefreshRequest}});var WM=pS();Object.defineProperty(S,"DeclarationRequest",{enumerable:!0,get:function(){return WM.DeclarationRequest}});var HM=yS();Object.defineProperty(S,"SelectionRangeRequest",{enumerable:!0,get:function(){return HM.SelectionRangeRequest}});var qm=_S();Object.defineProperty(S,"WorkDoneProgress",{enumerable:!0,get:function(){return qm.WorkDoneProgress}});Object.defineProperty(S,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return qm.WorkDoneProgressCreateRequest}});Object.defineProperty(S,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return qm.WorkDoneProgressCancelNotification}});var jm=kS();Object.defineProperty(S,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return jm.CallHierarchyIncomingCallsRequest}});Object.defineProperty(S,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return jm.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(S,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return jm.CallHierarchyPrepareRequest}});var bo=AS();Object.defineProperty(S,"TokenFormat",{enumerable:!0,get:function(){return bo.TokenFormat}});Object.defineProperty(S,"SemanticTokensRequest",{enumerable:!0,get:function(){return bo.SemanticTokensRequest}});Object.defineProperty(S,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return bo.SemanticTokensDeltaRequest}});Object.defineProperty(S,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return bo.SemanticTokensRangeRequest}});Object.defineProperty(S,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return bo.SemanticTokensRefreshRequest}});Object.defineProperty(S,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return bo.SemanticTokensRegistrationType}});var GM=xS();Object.defineProperty(S,"ShowDocumentRequest",{enumerable:!0,get:function(){return GM.ShowDocumentRequest}});var KM=$S();Object.defineProperty(S,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return KM.LinkedEditingRangeRequest}});var di=WS();Object.defineProperty(S,"FileOperationPatternKind",{enumerable:!0,get:function(){return di.FileOperationPatternKind}});Object.defineProperty(S,"DidCreateFilesNotification",{enumerable:!0,get:function(){return di.DidCreateFilesNotification}});Object.defineProperty(S,"WillCreateFilesRequest",{enumerable:!0,get:function(){return di.WillCreateFilesRequest}});Object.defineProperty(S,"DidRenameFilesNotification",{enumerable:!0,get:function(){return di.DidRenameFilesNotification}});Object.defineProperty(S,"WillRenameFilesRequest",{enumerable:!0,get:function(){return di.WillRenameFilesRequest}});Object.defineProperty(S,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return di.DidDeleteFilesNotification}});Object.defineProperty(S,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return di.WillDeleteFilesRequest}});var Fm=XS();Object.defineProperty(S,"UniquenessLevel",{enumerable:!0,get:function(){return Fm.UniquenessLevel}});Object.defineProperty(S,"MonikerKind",{enumerable:!0,get:function(){return Fm.MonikerKind}});Object.defineProperty(S,"MonikerRequest",{enumerable:!0,get:function(){return Fm.MonikerRequest}});var Bm=eE();Object.defineProperty(S,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return Bm.TypeHierarchyPrepareRequest}});Object.defineProperty(S,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return Bm.TypeHierarchySubtypesRequest}});Object.defineProperty(S,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return Bm.TypeHierarchySupertypesRequest}});var Lw=rE();Object.defineProperty(S,"InlineValueRequest",{enumerable:!0,get:function(){return Lw.InlineValueRequest}});Object.defineProperty(S,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return Lw.InlineValueRefreshRequest}});var Um=aE();Object.defineProperty(S,"InlayHintRequest",{enumerable:!0,get:function(){return Um.InlayHintRequest}});Object.defineProperty(S,"InlayHintResolveRequest",{enumerable:!0,get:function(){return Um.InlayHintResolveRequest}});Object.defineProperty(S,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return Um.InlayHintRefreshRequest}});var qa=pE();Object.defineProperty(S,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return qa.DiagnosticServerCancellationData}});Object.defineProperty(S,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return qa.DocumentDiagnosticReportKind}});Object.defineProperty(S,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return qa.DocumentDiagnosticRequest}});Object.defineProperty(S,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return qa.WorkspaceDiagnosticRequest}});Object.defineProperty(S,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return qa.DiagnosticRefreshRequest}});var Dr=_E();Object.defineProperty(S,"NotebookCellKind",{enumerable:!0,get:function(){return Dr.NotebookCellKind}});Object.defineProperty(S,"ExecutionSummary",{enumerable:!0,get:function(){return Dr.ExecutionSummary}});Object.defineProperty(S,"NotebookCell",{enumerable:!0,get:function(){return Dr.NotebookCell}});Object.defineProperty(S,"NotebookDocument",{enumerable:!0,get:function(){return Dr.NotebookDocument}});Object.defineProperty(S,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return Dr.NotebookDocumentSyncRegistrationType}});Object.defineProperty(S,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return Dr.DidOpenNotebookDocumentNotification}});Object.defineProperty(S,"NotebookCellArrayChange",{enumerable:!0,get:function(){return Dr.NotebookCellArrayChange}});Object.defineProperty(S,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return Dr.DidChangeNotebookDocumentNotification}});Object.defineProperty(S,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return Dr.DidSaveNotebookDocumentNotification}});Object.defineProperty(S,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return Dr.DidCloseNotebookDocumentNotification}});var YM=wE();Object.defineProperty(S,"InlineCompletionRequest",{enumerable:!0,get:function(){return YM.InlineCompletionRequest}});var xm;(function(t){function e(n){let r=n;return Mt.string(r)||Mt.string(r.language)||Mt.string(r.scheme)||Mt.string(r.pattern)}t.is=e})(xm||(S.TextDocumentFilter=xm={}));var Mm;(function(t){function e(n){let r=n;return Mt.objectLiteral(r)&&(Mt.string(r.notebookType)||Mt.string(r.scheme)||Mt.string(r.pattern))}t.is=e})(Mm||(S.NotebookDocumentFilter=Mm={}));var Lm;(function(t){function e(n){let r=n;return Mt.objectLiteral(r)&&(Mt.string(r.notebook)||Mm.is(r.notebook))&&(r.language===void 0||Mt.string(r.language))}t.is=e})(Lm||(S.NotebookCellTextDocumentFilter=Lm={}));var $m;(function(t){function e(n){if(!Array.isArray(n))return!1;for(let r of n)if(!Mt.string(r)&&!xm.is(r)&&!Lm.is(r))return!1;return!0}t.is=e})($m||(S.DocumentSelector=$m={}));var NE;(function(t){t.method="client/registerCapability",t.messageDirection=F.MessageDirection.serverToClient,t.type=new F.ProtocolRequestType(t.method)})(NE||(S.RegistrationRequest=NE={}));var PE;(function(t){t.method="client/unregisterCapability",t.messageDirection=F.MessageDirection.serverToClient,t.type=new F.ProtocolRequestType(t.method)})(PE||(S.UnregistrationRequest=PE={}));var RE;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(RE||(S.ResourceOperationKind=RE={}));var DE;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(DE||(S.FailureHandlingKind=DE={}));var CE;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(CE||(S.PositionEncodingKind=CE={}));var AE;(function(t){function e(n){let r=n;return r&&Mt.string(r.id)&&r.id.length>0}t.hasId=e})(AE||(S.StaticRegistrationOptions=AE={}));var OE;(function(t){function e(n){let r=n;return r&&(r.documentSelector===null||$m.is(r.documentSelector))}t.is=e})(OE||(S.TextDocumentRegistrationOptions=OE={}));var IE;(function(t){function e(r){let s=r;return Mt.objectLiteral(s)&&(s.workDoneProgress===void 0||Mt.boolean(s.workDoneProgress))}t.is=e;function n(r){let s=r;return s&&Mt.boolean(s.workDoneProgress)}t.hasWorkDoneProgress=n})(IE||(S.WorkDoneProgressOptions=IE={}));var xE;(function(t){t.method="initialize",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(xE||(S.InitializeRequest=xE={}));var ME;(function(t){t.unknownProtocolVersion=1})(ME||(S.InitializeErrorCodes=ME={}));var LE;(function(t){t.method="initialized",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolNotificationType(t.method)})(LE||(S.InitializedNotification=LE={}));var $E;(function(t){t.method="shutdown",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType0(t.method)})($E||(S.ShutdownRequest=$E={}));var qE;(function(t){t.method="exit",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolNotificationType0(t.method)})(qE||(S.ExitNotification=qE={}));var jE;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolNotificationType(t.method)})(jE||(S.DidChangeConfigurationNotification=jE={}));var FE;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(FE||(S.MessageType=FE={}));var BE;(function(t){t.method="window/showMessage",t.messageDirection=F.MessageDirection.serverToClient,t.type=new F.ProtocolNotificationType(t.method)})(BE||(S.ShowMessageNotification=BE={}));var UE;(function(t){t.method="window/showMessageRequest",t.messageDirection=F.MessageDirection.serverToClient,t.type=new F.ProtocolRequestType(t.method)})(UE||(S.ShowMessageRequest=UE={}));var VE;(function(t){t.method="window/logMessage",t.messageDirection=F.MessageDirection.serverToClient,t.type=new F.ProtocolNotificationType(t.method)})(VE||(S.LogMessageNotification=VE={}));var zE;(function(t){t.method="telemetry/event",t.messageDirection=F.MessageDirection.serverToClient,t.type=new F.ProtocolNotificationType(t.method)})(zE||(S.TelemetryEventNotification=zE={}));var WE;(function(t){t.None=0,t.Full=1,t.Incremental=2})(WE||(S.TextDocumentSyncKind=WE={}));var HE;(function(t){t.method="textDocument/didOpen",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolNotificationType(t.method)})(HE||(S.DidOpenTextDocumentNotification=HE={}));var GE;(function(t){function e(r){let s=r;return s!=null&&typeof s.text=="string"&&s.range!==void 0&&(s.rangeLength===void 0||typeof s.rangeLength=="number")}t.isIncremental=e;function n(r){let s=r;return s!=null&&typeof s.text=="string"&&s.range===void 0&&s.rangeLength===void 0}t.isFull=n})(GE||(S.TextDocumentContentChangeEvent=GE={}));var KE;(function(t){t.method="textDocument/didChange",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolNotificationType(t.method)})(KE||(S.DidChangeTextDocumentNotification=KE={}));var YE;(function(t){t.method="textDocument/didClose",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolNotificationType(t.method)})(YE||(S.DidCloseTextDocumentNotification=YE={}));var XE;(function(t){t.method="textDocument/didSave",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolNotificationType(t.method)})(XE||(S.DidSaveTextDocumentNotification=XE={}));var JE;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(JE||(S.TextDocumentSaveReason=JE={}));var QE;(function(t){t.method="textDocument/willSave",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolNotificationType(t.method)})(QE||(S.WillSaveTextDocumentNotification=QE={}));var ZE;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(ZE||(S.WillSaveTextDocumentWaitUntilRequest=ZE={}));var ew;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolNotificationType(t.method)})(ew||(S.DidChangeWatchedFilesNotification=ew={}));var tw;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(tw||(S.FileChangeType=tw={}));var nw;(function(t){function e(n){let r=n;return Mt.objectLiteral(r)&&(kE.URI.is(r.baseUri)||kE.WorkspaceFolder.is(r.baseUri))&&Mt.string(r.pattern)}t.is=e})(nw||(S.RelativePattern=nw={}));var rw;(function(t){t.Create=1,t.Change=2,t.Delete=4})(rw||(S.WatchKind=rw={}));var sw;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=F.MessageDirection.serverToClient,t.type=new F.ProtocolNotificationType(t.method)})(sw||(S.PublishDiagnosticsNotification=sw={}));var iw;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(iw||(S.CompletionTriggerKind=iw={}));var ow;(function(t){t.method="textDocument/completion",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(ow||(S.CompletionRequest=ow={}));var aw;(function(t){t.method="completionItem/resolve",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(aw||(S.CompletionResolveRequest=aw={}));var cw;(function(t){t.method="textDocument/hover",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(cw||(S.HoverRequest=cw={}));var lw;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(lw||(S.SignatureHelpTriggerKind=lw={}));var uw;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(uw||(S.SignatureHelpRequest=uw={}));var dw;(function(t){t.method="textDocument/definition",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(dw||(S.DefinitionRequest=dw={}));var fw;(function(t){t.method="textDocument/references",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(fw||(S.ReferencesRequest=fw={}));var hw;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(hw||(S.DocumentHighlightRequest=hw={}));var pw;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(pw||(S.DocumentSymbolRequest=pw={}));var mw;(function(t){t.method="textDocument/codeAction",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(mw||(S.CodeActionRequest=mw={}));var gw;(function(t){t.method="codeAction/resolve",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(gw||(S.CodeActionResolveRequest=gw={}));var yw;(function(t){t.method="workspace/symbol",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(yw||(S.WorkspaceSymbolRequest=yw={}));var bw;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(bw||(S.WorkspaceSymbolResolveRequest=bw={}));var vw;(function(t){t.method="textDocument/codeLens",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(vw||(S.CodeLensRequest=vw={}));var Tw;(function(t){t.method="codeLens/resolve",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(Tw||(S.CodeLensResolveRequest=Tw={}));var _w;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=F.MessageDirection.serverToClient,t.type=new F.ProtocolRequestType0(t.method)})(_w||(S.CodeLensRefreshRequest=_w={}));var Sw;(function(t){t.method="textDocument/documentLink",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(Sw||(S.DocumentLinkRequest=Sw={}));var Ew;(function(t){t.method="documentLink/resolve",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(Ew||(S.DocumentLinkResolveRequest=Ew={}));var ww;(function(t){t.method="textDocument/formatting",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(ww||(S.DocumentFormattingRequest=ww={}));var kw;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(kw||(S.DocumentRangeFormattingRequest=kw={}));var Nw;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(Nw||(S.DocumentRangesFormattingRequest=Nw={}));var Pw;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(Pw||(S.DocumentOnTypeFormattingRequest=Pw={}));var Rw;(function(t){t.Identifier=1})(Rw||(S.PrepareSupportDefaultBehavior=Rw={}));var Dw;(function(t){t.method="textDocument/rename",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(Dw||(S.RenameRequest=Dw={}));var Cw;(function(t){t.method="textDocument/prepareRename",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(Cw||(S.PrepareRenameRequest=Cw={}));var Aw;(function(t){t.method="workspace/executeCommand",t.messageDirection=F.MessageDirection.clientToServer,t.type=new F.ProtocolRequestType(t.method)})(Aw||(S.ExecuteCommandRequest=Aw={}));var Ow;(function(t){t.method="workspace/applyEdit",t.messageDirection=F.MessageDirection.serverToClient,t.type=new F.ProtocolRequestType("workspace/applyEdit")})(Ow||(S.ApplyWorkspaceEditRequest=Ow={}))});var jw=w(Iu=>{"use strict";Object.defineProperty(Iu,"__esModule",{value:!0});Iu.createProtocolConnection=void 0;var qw=ui();function XM(t,e,n,r){return qw.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,qw.createMessageConnection)(t,e,n,r)}Iu.createProtocolConnection=XM});var Bw=w(bn=>{"use strict";var JM=bn&&bn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),xu=bn&&bn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&JM(e,t,n)};Object.defineProperty(bn,"__esModule",{value:!0});bn.LSPErrorCodes=bn.createProtocolConnection=void 0;xu(ui(),bn);xu(yu(),bn);xu(ut(),bn);xu($w(),bn);var QM=jw();Object.defineProperty(bn,"createProtocolConnection",{enumerable:!0,get:function(){return QM.createProtocolConnection}});var Fw;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(Fw||(bn.LSPErrorCodes=Fw={}))});var bt=w(Cr=>{"use strict";var ZM=Cr&&Cr.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Uw=Cr&&Cr.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&ZM(e,t,n)};Object.defineProperty(Cr,"__esModule",{value:!0});Cr.createProtocolConnection=void 0;var eL=Nm();Uw(Nm(),Cr);Uw(Bw(),Cr);function tL(t,e,n,r){return(0,eL.createMessageConnection)(t,e,n,r)}Cr.createProtocolConnection=tL});var Vm=w(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.generateUuid=Vn.parse=Vn.isUUID=Vn.v4=Vn.empty=void 0;var ja=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},Fa=class t extends ja{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return t._oneOf(t._chars)}constructor(){super([t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-","4",t._randomHex(),t._randomHex(),t._randomHex(),"-",t._oneOf(t._timeHighBits),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex()].join(""))}};Fa._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];Fa._timeHighBits=["8","9","a","b"];Vn.empty=new ja("00000000-0000-0000-0000-000000000000");function Vw(){return new Fa}Vn.v4=Vw;var nL=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function zw(t){return nL.test(t)}Vn.isUUID=zw;function rL(t){if(!zw(t))throw new Error("invalid uuid");return new ja(t)}Vn.parse=rL;function sL(){return Vw().asHex()}Vn.generateUuid=sL});var Ww=w(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.attachPartialResult=Ss.ProgressFeature=Ss.attachWorkDone=void 0;var _s=bt(),iL=Vm(),fi=class t{constructor(e,n){this._connection=e,this._token=n,t.Instances.set(this._token,this)}begin(e,n,r,s){let i={kind:"begin",title:e,percentage:n,message:r,cancellable:s};this._connection.sendProgress(_s.WorkDoneProgress.type,this._token,i)}report(e,n){let r={kind:"report"};typeof e=="number"?(r.percentage=e,n!==void 0&&(r.message=n)):r.message=e,this._connection.sendProgress(_s.WorkDoneProgress.type,this._token,r)}done(){t.Instances.delete(this._token),this._connection.sendProgress(_s.WorkDoneProgress.type,this._token,{kind:"end"})}};fi.Instances=new Map;var Mu=class extends fi{constructor(e,n){super(e,n),this._source=new _s.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},Ba=class{constructor(){}begin(){}report(){}done(){}},Lu=class extends Ba{constructor(){super(),this._source=new _s.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function oL(t,e){if(e===void 0||e.workDoneToken===void 0)return new Ba;let n=e.workDoneToken;return delete e.workDoneToken,new fi(t,n)}Ss.attachWorkDone=oL;var aL=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(_s.WorkDoneProgressCancelNotification.type,n=>{let r=fi.Instances.get(n.token);(r instanceof Mu||r instanceof Lu)&&r.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new Ba:new fi(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,iL.generateUuid)();return this.connection.sendRequest(_s.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Mu(this.connection,e))}else return Promise.resolve(new Lu)}};Ss.ProgressFeature=aL;var zm;(function(t){t.type=new _s.ProgressType})(zm||(zm={}));var Wm=class{constructor(e,n){this._connection=e,this._token=n}report(e){this._connection.sendProgress(zm.type,this._token,e)}};function cL(t,e){if(e===void 0||e.partialResultToken===void 0)return;let n=e.partialResultToken;return delete e.partialResultToken,new Wm(t,n)}Ss.attachPartialResult=cL});var Hw=w($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.ConfigurationFeature=void 0;var lL=bt(),uL=Kl(),dL=t=>class extends t{getConfiguration(e){return e?uL.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let n={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(lL.ConfigurationRequest.type,n).then(r=>Array.isArray(r)?Array.isArray(e)?r:r[0]:Array.isArray(e)?[]:null)}};$u.ConfigurationFeature=dL});var Gw=w(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.WorkspaceFoldersFeature=void 0;var qu=bt(),fL=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let n=e.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new qu.Emitter,this.connection.onNotification(qu.DidChangeWorkspaceFoldersNotification.type,r=>{this._onDidChangeWorkspaceFolders.fire(r.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let n=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=n===!0||typeof n=="string"}getWorkspaceFolders(){return this.connection.sendRequest(qu.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return!this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(qu.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};ju.WorkspaceFoldersFeature=fL});var Kw=w(Fu=>{"use strict";Object.defineProperty(Fu,"__esModule",{value:!0});Fu.CallHierarchyFeature=void 0;var Hm=bt(),hL=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(Hm.CallHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onIncomingCalls:e=>{let n=Hm.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(n,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onOutgoingCalls:e=>{let n=Hm.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(n,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Fu.CallHierarchyFeature=hL});var Km=w(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.SemanticTokensBuilder=Es.SemanticTokensDiff=Es.SemanticTokensFeature=void 0;var Bu=bt(),pL=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Bu.SemanticTokensRefreshRequest.type),on:e=>{let n=Bu.SemanticTokensRequest.type;return this.connection.onRequest(n,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onDelta:e=>{let n=Bu.SemanticTokensDeltaRequest.type;return this.connection.onRequest(n,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onRange:e=>{let n=Bu.SemanticTokensRangeRequest.type;return this.connection.onRequest(n,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Es.SemanticTokensFeature=pL;var Uu=class{constructor(e,n){this.originalSequence=e,this.modifiedSequence=n}computeDiff(){let e=this.originalSequence.length,n=this.modifiedSequence.length,r=0;for(;r<n&&r<e&&this.originalSequence[r]===this.modifiedSequence[r];)r++;if(r<n&&r<e){let s=e-1,i=n-1;for(;s>=r&&i>=r&&this.originalSequence[s]===this.modifiedSequence[i];)s--,i--;(s<r||i<r)&&(s++,i++);let o=s-r+1,a=this.modifiedSequence.slice(r,i+1);return a.length===1&&a[0]===this.originalSequence[s]?[{start:r,deleteCount:o-1}]:[{start:r,deleteCount:o,data:a}]}else return r<n?[{start:r,deleteCount:0,data:this.modifiedSequence.slice(r)}]:r<e?[{start:r,deleteCount:e-r}]:[]}};Es.SemanticTokensDiff=Uu;var Gm=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(e,n,r,s,i){let o=e,a=n;this._dataLen>0&&(o-=this._prevLine,o===0&&(a-=this._prevChar)),this._data[this._dataLen++]=o,this._data[this._dataLen++]=a,this._data[this._dataLen++]=r,this._data[this._dataLen++]=s,this._data[this._dataLen++]=i,this._prevLine=e,this._prevChar=n}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new Uu(this._prevData,this._data).computeDiff()}:this.build()}};Es.SemanticTokensBuilder=Gm});var Yw=w(Vu=>{"use strict";Object.defineProperty(Vu,"__esModule",{value:!0});Vu.ShowDocumentFeature=void 0;var mL=bt(),gL=t=>class extends t{showDocument(e){return this.connection.sendRequest(mL.ShowDocumentRequest.type,e)}};Vu.ShowDocumentFeature=gL});var Xw=w(zu=>{"use strict";Object.defineProperty(zu,"__esModule",{value:!0});zu.FileOperationsFeature=void 0;var vo=bt(),yL=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(vo.DidCreateFilesNotification.type,n=>{e(n)})}onDidRenameFiles(e){return this.connection.onNotification(vo.DidRenameFilesNotification.type,n=>{e(n)})}onDidDeleteFiles(e){return this.connection.onNotification(vo.DidDeleteFilesNotification.type,n=>{e(n)})}onWillCreateFiles(e){return this.connection.onRequest(vo.WillCreateFilesRequest.type,(n,r)=>e(n,r))}onWillRenameFiles(e){return this.connection.onRequest(vo.WillRenameFilesRequest.type,(n,r)=>e(n,r))}onWillDeleteFiles(e){return this.connection.onRequest(vo.WillDeleteFilesRequest.type,(n,r)=>e(n,r))}};zu.FileOperationsFeature=yL});var Jw=w(Wu=>{"use strict";Object.defineProperty(Wu,"__esModule",{value:!0});Wu.LinkedEditingRangeFeature=void 0;var bL=bt(),vL=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(bL.LinkedEditingRangeRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))}};Wu.LinkedEditingRangeFeature=vL});var Qw=w(Hu=>{"use strict";Object.defineProperty(Hu,"__esModule",{value:!0});Hu.TypeHierarchyFeature=void 0;var Ym=bt(),TL=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(Ym.TypeHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onSupertypes:e=>{let n=Ym.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(n,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onSubtypes:e=>{let n=Ym.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(n,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Hu.TypeHierarchyFeature=TL});var ek=w(Gu=>{"use strict";Object.defineProperty(Gu,"__esModule",{value:!0});Gu.InlineValueFeature=void 0;var Zw=bt(),_L=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(Zw.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(Zw.InlineValueRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};Gu.InlineValueFeature=_L});var nk=w(Ku=>{"use strict";Object.defineProperty(Ku,"__esModule",{value:!0});Ku.FoldingRangeFeature=void 0;var tk=bt(),SL=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(tk.FoldingRangeRefreshRequest.type),on:e=>{let n=tk.FoldingRangeRequest.type;return this.connection.onRequest(n,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Ku.FoldingRangeFeature=SL});var rk=w(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});Yu.InlayHintFeature=void 0;var Xm=bt(),EL=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(Xm.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(Xm.InlayHintRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n))),resolve:e=>this.connection.onRequest(Xm.InlayHintResolveRequest.type,(n,r)=>e(n,r))}}};Yu.InlayHintFeature=EL});var sk=w(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});Xu.DiagnosticFeature=void 0;var Ua=bt(),wL=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(Ua.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(Ua.DocumentDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(Ua.DocumentDiagnosticRequest.partialResult,n))),onWorkspace:e=>this.connection.onRequest(Ua.WorkspaceDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(Ua.WorkspaceDiagnosticRequest.partialResult,n)))}}};Xu.DiagnosticFeature=wL});var Qm=w(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});Ju.TextDocuments=void 0;var hi=bt(),Jm=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new hi.Emitter,this._onDidOpen=new hi.Emitter,this._onDidClose=new hi.Emitter,this._onDidSave=new hi.Emitter,this._onWillSave=new hi.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=hi.TextDocumentSyncKind.Incremental;let n=[];return n.push(e.onDidOpenTextDocument(r=>{let s=r.textDocument,i=this._configuration.create(s.uri,s.languageId,s.version,s.text);this._syncedDocuments.set(s.uri,i);let o=Object.freeze({document:i});this._onDidOpen.fire(o),this._onDidChangeContent.fire(o)})),n.push(e.onDidChangeTextDocument(r=>{let s=r.textDocument,i=r.contentChanges;if(i.length===0)return;let{version:o}=s;if(o==null)throw new Error(`Received document change event for ${s.uri} without valid version identifier`);let a=this._syncedDocuments.get(s.uri);a!==void 0&&(a=this._configuration.update(a,i,o),this._syncedDocuments.set(s.uri,a),this._onDidChangeContent.fire(Object.freeze({document:a})))})),n.push(e.onDidCloseTextDocument(r=>{let s=this._syncedDocuments.get(r.textDocument.uri);s!==void 0&&(this._syncedDocuments.delete(r.textDocument.uri),this._onDidClose.fire(Object.freeze({document:s})))})),n.push(e.onWillSaveTextDocument(r=>{let s=this._syncedDocuments.get(r.textDocument.uri);s!==void 0&&this._onWillSave.fire(Object.freeze({document:s,reason:r.reason}))})),n.push(e.onWillSaveTextDocumentWaitUntil((r,s)=>{let i=this._syncedDocuments.get(r.textDocument.uri);return i!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:i,reason:r.reason}),s):[]})),n.push(e.onDidSaveTextDocument(r=>{let s=this._syncedDocuments.get(r.textDocument.uri);s!==void 0&&this._onDidSave.fire(Object.freeze({document:s}))})),hi.Disposable.create(()=>{n.forEach(r=>r.dispose())})}};Ju.TextDocuments=Jm});var eg=w(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.NotebookDocuments=To.NotebookSyncFeature=void 0;var zn=bt(),ik=Qm(),kL=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(zn.DidOpenNotebookDocumentNotification.type,n=>{e(n)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(zn.DidChangeNotebookDocumentNotification.type,n=>{e(n)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(zn.DidSaveNotebookDocumentNotification.type,n=>{e(n)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(zn.DidCloseNotebookDocumentNotification.type,n=>{e(n)})}}};To.NotebookSyncFeature=kL;var Qu=class t{onDidOpenTextDocument(e){return this.openHandler=e,zn.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,zn.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,zn.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return t.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return t.NULL_DISPOSE}onDidSaveTextDocument(){return t.NULL_DISPOSE}};Qu.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var Zm=class{constructor(e){e instanceof ik.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new ik.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new zn.Emitter,this._onDidChange=new zn.Emitter,this._onDidSave=new zn.Emitter,this._onDidClose=new zn.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let n=this.notebookCellMap.get(e);return n&&n[0]}findNotebookDocumentForCell(e){let n=typeof e=="string"?e:e.document,r=this.notebookCellMap.get(n);return r&&r[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let n=new Qu,r=[];return r.push(this.cellTextDocuments.listen(n)),r.push(e.notebooks.synchronization.onDidOpenNotebookDocument(s=>{this.notebookDocuments.set(s.notebookDocument.uri,s.notebookDocument);for(let i of s.cellTextDocuments)n.openTextDocument({textDocument:i});this.updateCellMap(s.notebookDocument),this._onDidOpen.fire(s.notebookDocument)})),r.push(e.notebooks.synchronization.onDidChangeNotebookDocument(s=>{let i=this.notebookDocuments.get(s.notebookDocument.uri);if(i===void 0)return;i.version=s.notebookDocument.version;let o=i.metadata,a=!1,c=s.change;c.metadata!==void 0&&(a=!0,i.metadata=c.metadata);let l=[],u=[],d=[],f=[];if(c.cells!==void 0){let E=c.cells;if(E.structure!==void 0){let T=E.structure.array;if(i.cells.splice(T.start,T.deleteCount,...T.cells!==void 0?T.cells:[]),E.structure.didOpen!==void 0)for(let b of E.structure.didOpen)n.openTextDocument({textDocument:b}),l.push(b.uri);if(E.structure.didClose)for(let b of E.structure.didClose)n.closeTextDocument({textDocument:b}),u.push(b.uri)}if(E.data!==void 0){let T=new Map(E.data.map(b=>[b.document,b]));for(let b=0;b<=i.cells.length;b++){let R=T.get(i.cells[b].document);if(R!==void 0){let D=i.cells.splice(b,1,R);if(d.push({old:D[0],new:R}),T.delete(R.document),T.size===0)break}}}if(E.textContent!==void 0)for(let T of E.textContent)n.changeTextDocument({textDocument:T.document,contentChanges:T.changes}),f.push(T.document.uri)}this.updateCellMap(i);let h={notebookDocument:i};a&&(h.metadata={old:o,new:i.metadata});let y=[];for(let E of l)y.push(this.getNotebookCell(E));let m=[];for(let E of u)m.push(this.getNotebookCell(E));let _=[];for(let E of f)_.push(this.getNotebookCell(E));(y.length>0||m.length>0||d.length>0||_.length>0)&&(h.cells={added:y,removed:m,changed:{data:d,textContent:_}}),(h.metadata!==void 0||h.cells!==void 0)&&this._onDidChange.fire(h)})),r.push(e.notebooks.synchronization.onDidSaveNotebookDocument(s=>{let i=this.notebookDocuments.get(s.notebookDocument.uri);i!==void 0&&this._onDidSave.fire(i)})),r.push(e.notebooks.synchronization.onDidCloseNotebookDocument(s=>{let i=this.notebookDocuments.get(s.notebookDocument.uri);if(i!==void 0){this._onDidClose.fire(i);for(let o of s.cellTextDocuments)n.closeTextDocument({textDocument:o});this.notebookDocuments.delete(s.notebookDocument.uri);for(let o of i.cells)this.notebookCellMap.delete(o.document)}})),zn.Disposable.create(()=>{r.forEach(s=>s.dispose())})}updateCellMap(e){for(let n of e.cells)this.notebookCellMap.set(n.document,[n,e])}};To.NotebookDocuments=Zm});var ok=w(Zu=>{"use strict";Object.defineProperty(Zu,"__esModule",{value:!0});Zu.MonikerFeature=void 0;var NL=bt(),PL=t=>class extends t{get moniker(){return{on:e=>{let n=NL.MonikerRequest.type;return this.connection.onRequest(n,(r,s)=>e(r,s,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Zu.MonikerFeature=PL});var og=w(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.createConnection=Ce.combineFeatures=Ce.combineNotebooksFeatures=Ce.combineLanguagesFeatures=Ce.combineWorkspaceFeatures=Ce.combineWindowFeatures=Ce.combineClientFeatures=Ce.combineTracerFeatures=Ce.combineTelemetryFeatures=Ce.combineConsoleFeatures=Ce._NotebooksImpl=Ce._LanguagesImpl=Ce.BulkUnregistration=Ce.BulkRegistration=Ce.ErrorMessageTracker=void 0;var z=bt(),Wn=Kl(),ng=Vm(),ie=Ww(),RL=Hw(),DL=Gw(),CL=Kw(),AL=Km(),OL=Yw(),IL=Xw(),xL=Jw(),ML=Qw(),LL=ek(),$L=nk(),qL=rk(),jL=sk(),FL=eg(),BL=ok();function tg(t){if(t!==null)return t}var rg=class{constructor(){this._messages=Object.create(null)}add(e){let n=this._messages[e];n||(n=0),n++,this._messages[e]=n}sendErrors(e){Object.keys(this._messages).forEach(n=>{e.window.showErrorMessage(n)})}};Ce.ErrorMessageTracker=rg;var ed=class{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(z.MessageType.Error,e)}warn(e){this.send(z.MessageType.Warning,e)}info(e){this.send(z.MessageType.Info,e)}log(e){this.send(z.MessageType.Log,e)}debug(e){this.send(z.MessageType.Debug,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(z.LogMessageNotification.type,{type:e,message:n}).catch(()=>{(0,z.RAL)().console.error("Sending log message failed")})}},sg=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...n){let r={type:z.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(z.ShowMessageRequest.type,r).then(tg)}showWarningMessage(e,...n){let r={type:z.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(z.ShowMessageRequest.type,r).then(tg)}showInformationMessage(e,...n){let r={type:z.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(z.ShowMessageRequest.type,r).then(tg)}},ak=(0,OL.ShowDocumentFeature)((0,ie.ProgressFeature)(sg)),ck;(function(t){function e(){return new td}t.create=e})(ck||(Ce.BulkRegistration=ck={}));var td=class{constructor(){this._registrations=[],this._registered=new Set}add(e,n){let r=Wn.string(e)?e:e.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);let s=ng.generateUuid();this._registrations.push({id:s,method:r,registerOptions:n||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}},lk;(function(t){function e(){return new Va(void 0,[])}t.create=e})(lk||(Ce.BulkUnregistration=lk={}));var Va=class{constructor(e,n){this._connection=e,this._unregistrations=new Map,n.forEach(r=>{this._unregistrations.set(r.method,r)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let r of this._unregistrations.values())e.push(r);let n={unregisterations:e};this._connection.sendRequest(z.UnregistrationRequest.type,n).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let n=Wn.string(e)?e:e.method,r=this._unregistrations.get(n);if(!r)return!1;let s={unregisterations:[r]};return this._connection.sendRequest(z.UnregistrationRequest.type,s).then(()=>{this._unregistrations.delete(n)},i=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}},nd=class{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,n,r){return e instanceof td?this.registerMany(e):e instanceof Va?this.registerSingle1(e,n,r):this.registerSingle2(e,n)}registerSingle1(e,n,r){let s=Wn.string(n)?n:n.method,i=ng.generateUuid(),o={registrations:[{id:i,method:s,registerOptions:r||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(z.RegistrationRequest.type,o).then(a=>(e.add({id:i,method:s}),e),a=>(this.connection.console.info(`Registering request handler for ${s} failed.`),Promise.reject(a)))}registerSingle2(e,n){let r=Wn.string(e)?e:e.method,s=ng.generateUuid(),i={registrations:[{id:s,method:r,registerOptions:n||{}}]};return this.connection.sendRequest(z.RegistrationRequest.type,i).then(o=>z.Disposable.create(()=>{this.unregisterSingle(s,r).catch(()=>{this.connection.console.info(`Un-registering capability with id ${s} failed.`)})}),o=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(o)))}unregisterSingle(e,n){let r={unregisterations:[{id:e,method:n}]};return this.connection.sendRequest(z.UnregistrationRequest.type,r).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let n=e.asRegistrationParams();return this.connection.sendRequest(z.RegistrationRequest.type,n).then(()=>new Va(this._connection,n.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}},ig=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function n(s){return s&&!!s.edit}let r=n(e)?e:{edit:e};return this.connection.sendRequest(z.ApplyWorkspaceEditRequest.type,r)}},uk=(0,IL.FileOperationsFeature)((0,DL.WorkspaceFoldersFeature)((0,RL.ConfigurationFeature)(ig))),rd=class{constructor(){this._trace=z.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,n){this._trace!==z.Trace.Off&&this.connection.sendNotification(z.LogTraceNotification.type,{message:e,verbose:this._trace===z.Trace.Verbose?n:void 0}).catch(()=>{})}},sd=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(z.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},id=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,ie.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,ie.attachPartialResult)(this.connection,n)}};Ce._LanguagesImpl=id;var dk=(0,$L.FoldingRangeFeature)((0,BL.MonikerFeature)((0,jL.DiagnosticFeature)((0,qL.InlayHintFeature)((0,LL.InlineValueFeature)((0,ML.TypeHierarchyFeature)((0,xL.LinkedEditingRangeFeature)((0,AL.SemanticTokensFeature)((0,CL.CallHierarchyFeature)(id))))))))),od=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,ie.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,ie.attachPartialResult)(this.connection,n)}};Ce._NotebooksImpl=od;var fk=(0,FL.NotebookSyncFeature)(od);function hk(t,e){return function(n){return e(t(n))}}Ce.combineConsoleFeatures=hk;function pk(t,e){return function(n){return e(t(n))}}Ce.combineTelemetryFeatures=pk;function mk(t,e){return function(n){return e(t(n))}}Ce.combineTracerFeatures=mk;function gk(t,e){return function(n){return e(t(n))}}Ce.combineClientFeatures=gk;function yk(t,e){return function(n){return e(t(n))}}Ce.combineWindowFeatures=yk;function bk(t,e){return function(n){return e(t(n))}}Ce.combineWorkspaceFeatures=bk;function vk(t,e){return function(n){return e(t(n))}}Ce.combineLanguagesFeatures=vk;function Tk(t,e){return function(n){return e(t(n))}}Ce.combineNotebooksFeatures=Tk;function UL(t,e){function n(s,i,o){return s&&i?o(s,i):s||i}return{__brand:"features",console:n(t.console,e.console,hk),tracer:n(t.tracer,e.tracer,mk),telemetry:n(t.telemetry,e.telemetry,pk),client:n(t.client,e.client,gk),window:n(t.window,e.window,yk),workspace:n(t.workspace,e.workspace,bk),languages:n(t.languages,e.languages,vk),notebooks:n(t.notebooks,e.notebooks,Tk)}}Ce.combineFeatures=UL;function VL(t,e,n){let r=n&&n.console?new(n.console(ed)):new ed,s=t(r);r.rawAttach(s);let i=n&&n.tracer?new(n.tracer(rd)):new rd,o=n&&n.telemetry?new(n.telemetry(sd)):new sd,a=n&&n.client?new(n.client(nd)):new nd,c=n&&n.window?new(n.window(ak)):new ak,l=n&&n.workspace?new(n.workspace(uk)):new uk,u=n&&n.languages?new(n.languages(dk)):new dk,d=n&&n.notebooks?new(n.notebooks(fk)):new fk,f=[r,i,o,a,c,l,u,d];function h(T){return T instanceof Promise?T:Wn.thenable(T)?new Promise((b,R)=>{T.then(D=>b(D),D=>R(D))}):Promise.resolve(T)}let y,m,_,E={listen:()=>s.listen(),sendRequest:(T,...b)=>s.sendRequest(Wn.string(T)?T:T.method,...b),onRequest:(T,b)=>s.onRequest(T,b),sendNotification:(T,b)=>{let R=Wn.string(T)?T:T.method;return s.sendNotification(R,b)},onNotification:(T,b)=>s.onNotification(T,b),onProgress:s.onProgress,sendProgress:s.sendProgress,onInitialize:T=>(m=T,{dispose:()=>{m=void 0}}),onInitialized:T=>s.onNotification(z.InitializedNotification.type,T),onShutdown:T=>(y=T,{dispose:()=>{y=void 0}}),onExit:T=>(_=T,{dispose:()=>{_=void 0}}),get console(){return r},get telemetry(){return o},get tracer(){return i},get client(){return a},get window(){return c},get workspace(){return l},get languages(){return u},get notebooks(){return d},onDidChangeConfiguration:T=>s.onNotification(z.DidChangeConfigurationNotification.type,T),onDidChangeWatchedFiles:T=>s.onNotification(z.DidChangeWatchedFilesNotification.type,T),__textDocumentSync:void 0,onDidOpenTextDocument:T=>s.onNotification(z.DidOpenTextDocumentNotification.type,T),onDidChangeTextDocument:T=>s.onNotification(z.DidChangeTextDocumentNotification.type,T),onDidCloseTextDocument:T=>s.onNotification(z.DidCloseTextDocumentNotification.type,T),onWillSaveTextDocument:T=>s.onNotification(z.WillSaveTextDocumentNotification.type,T),onWillSaveTextDocumentWaitUntil:T=>s.onRequest(z.WillSaveTextDocumentWaitUntilRequest.type,T),onDidSaveTextDocument:T=>s.onNotification(z.DidSaveTextDocumentNotification.type,T),sendDiagnostics:T=>s.sendNotification(z.PublishDiagnosticsNotification.type,T),onHover:T=>s.onRequest(z.HoverRequest.type,(b,R)=>T(b,R,(0,ie.attachWorkDone)(s,b),void 0)),onCompletion:T=>s.onRequest(z.CompletionRequest.type,(b,R)=>T(b,R,(0,ie.attachWorkDone)(s,b),(0,ie.attachPartialResult)(s,b))),onCompletionResolve:T=>s.onRequest(z.CompletionResolveRequest.type,T),onSignatureHelp:T=>s.onRequest(z.SignatureHelpRequest.type,(b,R)=>T(b,R,(0,ie.attachWorkDone)(s,b),void 0)),onDeclaration:T=>s.onRequest(z.DeclarationRequest.type,(b,R)=>T(b,R,(0,ie.attachWorkDone)(s,b),(0,ie.attachPartialResult)(s,b))),onDefinition:T=>s.onRequest(z.DefinitionRequest.type,(b,R)=>T(b,R,(0,ie.attachWorkDone)(s,b),(0,ie.attachPartialResult)(s,b))),onTypeDefinition:T=>s.onRequest(z.TypeDefinitionRequest.type,(b,R)=>T(b,R,(0,ie.attachWorkDone)(s,b),(0,ie.attachPartialResult)(s,b))),onImplementation:T=>s.onRequest(z.ImplementationRequest.type,(b,R)=>T(b,R,(0,ie.attachWorkDone)(s,b),(0,ie.attachPartialResult)(s,b))),onReferences:T=>s.onRequest(z.ReferencesRequest.type,(b,R)=>T(b,R,(0,ie.attachWorkDone)(s,b),(0,ie.attachPartialResult)(s,b))),onDocumentHighlight:T=>s.onRequest(z.DocumentHighlightRequest.type,(b,R)=>T(b,R,(0,ie.attachWorkDone)(s,b),(0,ie.attachPartialResult)(s,b))),onDocumentSymbol:T=>s.onRequest(z.DocumentSymbolRequest.type,(b,R)=>T(b,R,(0,ie.attachWorkDone)(s,b),(0,ie.attachPartialResult)(s,b))),onWorkspaceSymbol:T=>s.onRequest(z.WorkspaceSymbolRequest.type,(b,R)=>T(b,R,(0,ie.attachWorkDone)(s,b),(0,ie.attachPartialResult)(s,b))),onWorkspaceSymbolResolve:T=>s.onRequest(z.WorkspaceSymbolResolveRequest.type,T),onCodeAction:T=>s.onRequest(z.CodeActionRequest.type,(b,R)=>T(b,R,(0,ie.attachWorkDone)(s,b),(0,ie.attachPartialResult)(s,b))),onCodeActionResolve:T=>s.onRequest(z.CodeActionResolveRequest.type,(b,R)=>T(b,R)),onCodeLens:T=>s.onRequest(z.CodeLensRequest.type,(b,R)=>T(b,R,(0,ie.attachWorkDone)(s,b),(0,ie.attachPartialResult)(s,b))),onCodeLensResolve:T=>s.onRequest(z.CodeLensResolveRequest.type,(b,R)=>T(b,R)),onDocumentFormatting:T=>s.onRequest(z.DocumentFormattingRequest.type,(b,R)=>T(b,R,(0,ie.attachWorkDone)(s,b),void 0)),onDocumentRangeFormatting:T=>s.onRequest(z.DocumentRangeFormattingRequest.type,(b,R)=>T(b,R,(0,ie.attachWorkDone)(s,b),void 0)),onDocumentOnTypeFormatting:T=>s.onRequest(z.DocumentOnTypeFormattingRequest.type,(b,R)=>T(b,R)),onRenameRequest:T=>s.onRequest(z.RenameRequest.type,(b,R)=>T(b,R,(0,ie.attachWorkDone)(s,b),void 0)),onPrepareRename:T=>s.onRequest(z.PrepareRenameRequest.type,(b,R)=>T(b,R)),onDocumentLinks:T=>s.onRequest(z.DocumentLinkRequest.type,(b,R)=>T(b,R,(0,ie.attachWorkDone)(s,b),(0,ie.attachPartialResult)(s,b))),onDocumentLinkResolve:T=>s.onRequest(z.DocumentLinkResolveRequest.type,(b,R)=>T(b,R)),onDocumentColor:T=>s.onRequest(z.DocumentColorRequest.type,(b,R)=>T(b,R,(0,ie.attachWorkDone)(s,b),(0,ie.attachPartialResult)(s,b))),onColorPresentation:T=>s.onRequest(z.ColorPresentationRequest.type,(b,R)=>T(b,R,(0,ie.attachWorkDone)(s,b),(0,ie.attachPartialResult)(s,b))),onFoldingRanges:T=>s.onRequest(z.FoldingRangeRequest.type,(b,R)=>T(b,R,(0,ie.attachWorkDone)(s,b),(0,ie.attachPartialResult)(s,b))),onSelectionRanges:T=>s.onRequest(z.SelectionRangeRequest.type,(b,R)=>T(b,R,(0,ie.attachWorkDone)(s,b),(0,ie.attachPartialResult)(s,b))),onExecuteCommand:T=>s.onRequest(z.ExecuteCommandRequest.type,(b,R)=>T(b,R,(0,ie.attachWorkDone)(s,b),void 0)),dispose:()=>s.dispose()};for(let T of f)T.attach(E);return s.onRequest(z.InitializeRequest.type,T=>{e.initialize(T),Wn.string(T.trace)&&(i.trace=z.Trace.fromString(T.trace));for(let b of f)b.initialize(T.capabilities);if(m){let b=m(T,new z.CancellationTokenSource().token,(0,ie.attachWorkDone)(s,T),void 0);return h(b).then(R=>{if(R instanceof z.ResponseError)return R;let D=R;D||(D={capabilities:{}});let L=D.capabilities;L||(L={},D.capabilities=L),L.textDocumentSync===void 0||L.textDocumentSync===null?L.textDocumentSync=Wn.number(E.__textDocumentSync)?E.__textDocumentSync:z.TextDocumentSyncKind.None:!Wn.number(L.textDocumentSync)&&!Wn.number(L.textDocumentSync.change)&&(L.textDocumentSync.change=Wn.number(E.__textDocumentSync)?E.__textDocumentSync:z.TextDocumentSyncKind.None);for(let H of f)H.fillServerCapabilities(L);return D})}else{let b={capabilities:{textDocumentSync:z.TextDocumentSyncKind.None}};for(let R of f)R.fillServerCapabilities(b.capabilities);return b}}),s.onRequest(z.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,y)return y(new z.CancellationTokenSource().token)}),s.onNotification(z.ExitNotification.type,()=>{try{_&&_()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),s.onNotification(z.SetTraceNotification.type,T=>{i.trace=z.Trace.fromString(T.value)}),E}Ce.createConnection=VL});var _k=w(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.resolveModulePath=vn.FileSystem=vn.resolveGlobalYarnPath=vn.resolveGlobalNodePath=vn.resolve=vn.uriToFilePath=void 0;var zL=require("url"),lr=require("path"),ag=require("fs"),dg=require("child_process");function WL(t){let e=zL.parse(t);if(e.protocol!=="file:"||!e.path)return;let n=e.path.split("/");for(var r=0,s=n.length;r<s;r++)n[r]=decodeURIComponent(n[r]);if(process.platform==="win32"&&n.length>1){let i=n[0],o=n[1];i.length===0&&o.length>1&&o[1]===":"&&n.shift()}return lr.normalize(n.join("/"))}vn.uriToFilePath=WL;function cg(){return process.platform==="win32"}function ad(t,e,n,r){let s="NODE_PATH",i=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((o,a)=>{let c=process.env,l=Object.create(null);Object.keys(c).forEach(u=>l[u]=c[u]),e&&ag.existsSync(e)&&(l[s]?l[s]=e+lr.delimiter+l[s]:l[s]=e,r&&r(`NODE_PATH value is: ${l[s]}`)),l.ELECTRON_RUN_AS_NODE="1";try{let u=(0,dg.fork)("",[],{cwd:n,env:l,execArgv:["-e",i]});if(u.pid===void 0){a(new Error(`Starting process to resolve node module ${t} failed`));return}u.on("error",f=>{a(f)}),u.on("message",f=>{f.c==="r"&&(u.send({c:"e"}),f.s?o(f.r):a(new Error(`Failed to resolve module: ${t}`)))});let d={c:"rs",a:t};u.send(d)}catch(u){a(u)}})}vn.resolve=ad;function lg(t){let e="npm",n=Object.create(null);Object.keys(process.env).forEach(i=>n[i]=process.env[i]),n.NO_UPDATE_NOTIFIER="true";let r={encoding:"utf8",env:n};cg()&&(e="npm.cmd",r.shell=!0);let s=()=>{};try{process.on("SIGPIPE",s);let i=(0,dg.spawnSync)(e,["config","get","prefix"],r).stdout;if(!i){t&&t("'npm config get prefix' didn't return a value.");return}let o=i.trim();return t&&t(`'npm config get prefix' value is: ${o}`),o.length>0?cg()?lr.join(o,"node_modules"):lr.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",s)}}vn.resolveGlobalNodePath=lg;function HL(t){let e="yarn",n={encoding:"utf8"};cg()&&(e="yarn.cmd",n.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let s=(0,dg.spawnSync)(e,["global","dir","--json"],n),i=s.stdout;if(!i){t&&(t("'yarn global dir' didn't return a value."),s.stderr&&t(s.stderr));return}let o=i.trim().split(/\r?\n/);for(let a of o)try{let c=JSON.parse(a);if(c.type==="log")return lr.join(c.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",r)}}vn.resolveGlobalYarnPath=HL;var ug;(function(t){let e;function n(){return e!==void 0||(process.platform==="win32"?e=!1:e=!ag.existsSync(__filename.toUpperCase())||!ag.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=n;function r(s,i){return n()?lr.normalize(i).indexOf(lr.normalize(s))===0:lr.normalize(i).toLowerCase().indexOf(lr.normalize(s).toLowerCase())===0}t.isParent=r})(ug||(vn.FileSystem=ug={}));function GL(t,e,n,r){return n?(lr.isAbsolute(n)||(n=lr.join(t,n)),ad(e,n,n,r).then(s=>ug.isParent(n,s)?s:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,s=>ad(e,lg(r),t,r))):ad(e,lg(r),t,r)}vn.resolveModulePath=GL});var fg=w((u3,Sk)=>{"use strict";Sk.exports=bt()});var Ek=w(cd=>{"use strict";Object.defineProperty(cd,"__esModule",{value:!0});cd.InlineCompletionFeature=void 0;var KL=bt(),YL=t=>class extends t{get inlineCompletion(){return{on:e=>this.connection.onRequest(KL.InlineCompletionRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};cd.InlineCompletionFeature=YL});var Nk=w(Qt=>{"use strict";var XL=Qt&&Qt.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),kk=Qt&&Qt.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&XL(e,t,n)};Object.defineProperty(Qt,"__esModule",{value:!0});Qt.ProposedFeatures=Qt.NotebookDocuments=Qt.TextDocuments=Qt.SemanticTokensBuilder=void 0;var JL=Km();Object.defineProperty(Qt,"SemanticTokensBuilder",{enumerable:!0,get:function(){return JL.SemanticTokensBuilder}});var QL=Ek();kk(bt(),Qt);var ZL=Qm();Object.defineProperty(Qt,"TextDocuments",{enumerable:!0,get:function(){return ZL.TextDocuments}});var e1=eg();Object.defineProperty(Qt,"NotebookDocuments",{enumerable:!0,get:function(){return e1.NotebookDocuments}});kk(og(),Qt);var wk;(function(t){t.all={__brand:"features",languages:QL.InlineCompletionFeature}})(wk||(Qt.ProposedFeatures=wk={}))});var Q=w(Hn=>{"use strict";var t1=Hn&&Hn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(e,n);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,s)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Ck=Hn&&Hn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&t1(e,t,n)};Object.defineProperty(Hn,"__esModule",{value:!0});Hn.createConnection=Hn.Files=void 0;var Pk=require("node:util"),hg=Kl(),n1=og(),za=_k(),pi=fg();Ck(fg(),Hn);Ck(Nk(),Hn);var Rk;(function(t){t.uriToFilePath=za.uriToFilePath,t.resolveGlobalNodePath=za.resolveGlobalNodePath,t.resolveGlobalYarnPath=za.resolveGlobalYarnPath,t.resolve=za.resolve,t.resolveModulePath=za.resolveModulePath})(Rk||(Hn.Files=Rk={}));var Dk;function ld(){if(Dk!==void 0)try{Dk.end()}catch{}}var _o=!1,Ak;function r1(){let t="--clientProcessId";function e(n){try{let r=parseInt(n);isNaN(r)||(Ak=setInterval(()=>{try{process.kill(r,0)}catch{ld(),process.exit(_o?0:1)}},3e3))}catch{}}for(let n=2;n<process.argv.length;n++){let r=process.argv[n];if(r===t&&n+1<process.argv.length){e(process.argv[n+1]);return}else{let s=r.split("=");s[0]===t&&e(s[1])}}}r1();var s1={initialize:t=>{let e=t.processId;hg.number(e)&&Ak===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(_o?0:1)}},3e3)},get shutdownReceived(){return _o},set shutdownReceived(t){_o=t},exit:t=>{ld(),process.exit(t)}};function i1(t,e,n,r){let s,i,o,a;return t!==void 0&&t.__brand==="features"&&(s=t,t=e,e=n,n=r),pi.ConnectionStrategy.is(t)||pi.ConnectionOptions.is(t)?a=t:(i=t,o=e,a=n),o1(i,o,a,s)}Hn.createConnection=i1;function o1(t,e,n,r){let s=!1;if(!t&&!e&&process.argv.length>2){let c,l,u=process.argv.slice(2);for(let d=0;d<u.length;d++){let f=u[d];if(f==="--node-ipc"){t=new pi.IPCMessageReader(process),e=new pi.IPCMessageWriter(process);break}else if(f==="--stdio"){s=!0,t=process.stdin,e=process.stdout;break}else if(f==="--socket"){c=parseInt(u[d+1]);break}else if(f==="--pipe"){l=u[d+1];break}else{var i=f.split("=");if(i[0]==="--socket"){c=parseInt(i[1]);break}else if(i[0]==="--pipe"){l=i[1];break}}}if(c){let d=(0,pi.createServerSocketTransport)(c);t=d[0],e=d[1]}else if(l){let d=(0,pi.createServerPipeTransport)(l);t=d[0],e=d[1]}}var o="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!t)throw new Error("Connection input stream is not set. "+o);if(!e)throw new Error("Connection output stream is not set. "+o);if(hg.func(t.read)&&hg.func(t.on)){let c=t;c.on("end",()=>{ld(),process.exit(_o?0:1)}),c.on("close",()=>{ld(),process.exit(_o?0:1)})}let a=c=>{let l=(0,pi.createProtocolConnection)(t,e,c,n);return s&&a1(c),l};return(0,n1.createConnection)(a,s1,r)}function a1(t){function e(r){return r.map(s=>typeof s=="string"?s:(0,Pk.inspect)(s)).join(" ")}let n=new Map;console.assert=function(s,...i){if(!s)if(i.length===0)t.error("Assertion failed");else{let[o,...a]=i;t.error(`Assertion failed: ${o} ${e(a)}`)}},console.count=function(s="default"){let i=String(s),o=n.get(i)??0;o+=1,n.set(i,o),t.log(`${i}: ${i}`)},console.countReset=function(s){s===void 0?n.clear():n.delete(String(s))},console.debug=function(...s){t.log(e(s))},console.dir=function(s,i){t.log((0,Pk.inspect)(s,i))},console.log=function(...s){t.log(e(s))},console.error=function(...s){t.error(e(s))},console.trace=function(...s){let i=new Error().stack.replace(/(.+\n){2}/,""),o="Trace";s.length!==0&&(o+=`: ${e(s)}`),t.log(`${o}
37
+ ${i}`)},console.warn=function(...s){t.warn(e(s))}}});var Ik=w((m3,Ok)=>{"use strict";Ok.exports=Q()});var ke=w(Wt=>{"use strict";var zg=Symbol.for("yaml.alias"),vR=Symbol.for("yaml.document"),uf=Symbol.for("yaml.map"),TR=Symbol.for("yaml.pair"),Wg=Symbol.for("yaml.scalar"),df=Symbol.for("yaml.seq"),ns=Symbol.for("yaml.node.type"),r$=t=>!!t&&typeof t=="object"&&t[ns]===zg,s$=t=>!!t&&typeof t=="object"&&t[ns]===vR,i$=t=>!!t&&typeof t=="object"&&t[ns]===uf,o$=t=>!!t&&typeof t=="object"&&t[ns]===TR,_R=t=>!!t&&typeof t=="object"&&t[ns]===Wg,a$=t=>!!t&&typeof t=="object"&&t[ns]===df;function SR(t){if(t&&typeof t=="object")switch(t[ns]){case uf:case df:return!0}return!1}function c$(t){if(t&&typeof t=="object")switch(t[ns]){case zg:case uf:case Wg:case df:return!0}return!1}var l$=t=>(_R(t)||SR(t))&&!!t.anchor;Wt.ALIAS=zg;Wt.DOC=vR;Wt.MAP=uf;Wt.NODE_TYPE=ns;Wt.PAIR=TR;Wt.SCALAR=Wg;Wt.SEQ=df;Wt.hasAnchor=l$;Wt.isAlias=r$;Wt.isCollection=SR;Wt.isDocument=s$;Wt.isMap=i$;Wt.isNode=c$;Wt.isPair=o$;Wt.isScalar=_R;Wt.isSeq=a$});var sc=w(Hg=>{"use strict";var Ot=ke(),kn=Symbol("break visit"),ER=Symbol("skip children"),qr=Symbol("remove node");function ff(t,e){let n=wR(e);Ot.isDocument(t)?Fo(null,t.contents,n,Object.freeze([t]))===qr&&(t.contents=null):Fo(null,t,n,Object.freeze([]))}ff.BREAK=kn;ff.SKIP=ER;ff.REMOVE=qr;function Fo(t,e,n,r){let s=kR(t,e,n,r);if(Ot.isNode(s)||Ot.isPair(s))return NR(t,r,s),Fo(t,s,n,r);if(typeof s!="symbol"){if(Ot.isCollection(e)){r=Object.freeze(r.concat(e));for(let i=0;i<e.items.length;++i){let o=Fo(i,e.items[i],n,r);if(typeof o=="number")i=o-1;else{if(o===kn)return kn;o===qr&&(e.items.splice(i,1),i-=1)}}}else if(Ot.isPair(e)){r=Object.freeze(r.concat(e));let i=Fo("key",e.key,n,r);if(i===kn)return kn;i===qr&&(e.key=null);let o=Fo("value",e.value,n,r);if(o===kn)return kn;o===qr&&(e.value=null)}}return s}async function hf(t,e){let n=wR(e);Ot.isDocument(t)?await Bo(null,t.contents,n,Object.freeze([t]))===qr&&(t.contents=null):await Bo(null,t,n,Object.freeze([]))}hf.BREAK=kn;hf.SKIP=ER;hf.REMOVE=qr;async function Bo(t,e,n,r){let s=await kR(t,e,n,r);if(Ot.isNode(s)||Ot.isPair(s))return NR(t,r,s),Bo(t,s,n,r);if(typeof s!="symbol"){if(Ot.isCollection(e)){r=Object.freeze(r.concat(e));for(let i=0;i<e.items.length;++i){let o=await Bo(i,e.items[i],n,r);if(typeof o=="number")i=o-1;else{if(o===kn)return kn;o===qr&&(e.items.splice(i,1),i-=1)}}}else if(Ot.isPair(e)){r=Object.freeze(r.concat(e));let i=await Bo("key",e.key,n,r);if(i===kn)return kn;i===qr&&(e.key=null);let o=await Bo("value",e.value,n,r);if(o===kn)return kn;o===qr&&(e.value=null)}}return s}function wR(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function kR(t,e,n,r){if(typeof n=="function")return n(t,e,r);if(Ot.isMap(e))return n.Map?.(t,e,r);if(Ot.isSeq(e))return n.Seq?.(t,e,r);if(Ot.isPair(e))return n.Pair?.(t,e,r);if(Ot.isScalar(e))return n.Scalar?.(t,e,r);if(Ot.isAlias(e))return n.Alias?.(t,e,r)}function NR(t,e,n){let r=e[e.length-1];if(Ot.isCollection(r))r.items[t]=n;else if(Ot.isPair(r))t==="key"?r.key=n:r.value=n;else if(Ot.isDocument(r))r.contents=n;else{let s=Ot.isAlias(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}Hg.visit=ff;Hg.visitAsync=hf});var Gg=w(RR=>{"use strict";var PR=ke(),u$=sc(),d$={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},f$=t=>t.replace(/[!,[\]{}]/g,e=>d$[e]),ic=class t{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,n)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let r=e.trim().split(/[ \t]+/),s=r.shift();switch(s){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[i,o]=r;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[i]=r;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{let o=/^\d+\.\d+$/.test(i);return n(6,`Unsupported YAML version ${i}`,o),!1}}default:return n(0,`Unknown directive ${s}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}let[,r,s]=e.match(/^(.*!)([^!]*)$/s);s||n(`The ${e} tag has no suffix`);let i=this.tags[r];if(i)try{return i+decodeURIComponent(s)}catch(o){return n(String(o)),null}return r==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[n,r]of Object.entries(this.tags))if(e.startsWith(r))return n+f$(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),s;if(e&&r.length>0&&PR.isNode(e.contents)){let i={};u$.visit(e.contents,(o,a)=>{PR.isNode(a)&&a.tag&&(i[a.tag]=!0)}),s=Object.keys(i)}else s=[];for(let[i,o]of r)i==="!!"&&o==="tag:yaml.org,2002:"||(!e||s.some(a=>a.startsWith(o)))&&n.push(`%TAG ${i} ${o}`);return n.join(`
38
+ `)}};ic.defaultYaml={explicit:!1,version:"1.2"};ic.defaultTags={"!!":"tag:yaml.org,2002:"};RR.Directives=ic});var pf=w(oc=>{"use strict";var DR=ke(),h$=sc();function p$(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function CR(t){let e=new Set;return h$.visit(t,{Value(n,r){r.anchor&&e.add(r.anchor)}}),e}function AR(t,e){for(let n=1;;++n){let r=`${t}${n}`;if(!e.has(r))return r}}function m$(t,e){let n=[],r=new Map,s=null;return{onAnchor:i=>{n.push(i),s||(s=CR(t));let o=AR(e,s);return s.add(o),o},setAnchors:()=>{for(let i of n){let o=r.get(i);if(typeof o=="object"&&o.anchor&&(DR.isScalar(o.node)||DR.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=i,a}}},sourceObjects:r}}oc.anchorIsValid=p$;oc.anchorNames=CR;oc.createNodeAnchors=m$;oc.findNewAnchor=AR});var Kg=w(OR=>{"use strict";function ac(t,e,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,i=r.length;s<i;++s){let o=r[s],a=ac(t,r,String(s),o);a===void 0?delete r[s]:a!==o&&(r[s]=a)}else if(r instanceof Map)for(let s of Array.from(r.keys())){let i=r.get(s),o=ac(t,r,s,i);o===void 0?r.delete(s):o!==i&&r.set(s,o)}else if(r instanceof Set)for(let s of Array.from(r)){let i=ac(t,r,s,s);i===void 0?r.delete(s):i!==s&&(r.delete(s),r.add(i))}else for(let[s,i]of Object.entries(r)){let o=ac(t,r,s,i);o===void 0?delete r[s]:o!==i&&(r[s]=o)}return t.call(e,n,r)}OR.applyReviver=ac});var Ls=w(xR=>{"use strict";var g$=ke();function IR(t,e,n){if(Array.isArray(t))return t.map((r,s)=>IR(r,String(s),n));if(t&&typeof t.toJSON=="function"){if(!n||!g$.hasAnchor(t))return t.toJSON(e,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(t,r),n.onCreate=i=>{r.res=i,delete n.onCreate};let s=t.toJSON(e,n);return n.onCreate&&n.onCreate(s),s}return typeof t=="bigint"&&!n?.keep?Number(t):t}xR.toJS=IR});var mf=w(LR=>{"use strict";var y$=Kg(),MR=ke(),b$=Ls(),Yg=class{constructor(e){Object.defineProperty(this,MR.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:r,onAnchor:s,reviver:i}={}){if(!MR.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=b$.toJS(this,"",o);if(typeof s=="function")for(let{count:c,res:l}of o.anchors.values())s(l,c);return typeof i=="function"?y$.applyReviver(i,{"":a},"",a):a}};LR.NodeBase=Yg});var cc=w(qR=>{"use strict";var v$=pf(),$R=sc(),gf=ke(),T$=mf(),_$=Ls(),Xg=class extends T$.NodeBase{constructor(e){super(gf.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let n;return $R.visit(e,{Node:(r,s)=>{if(s===this)return $R.visit.BREAK;s.anchor===this.source&&(n=s)}}),n}toJSON(e,n){if(!n)return{source:this.source};let{anchors:r,doc:s,maxAliasCount:i}=n,o=this.resolve(s);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=r.get(o);if(a||(_$.toJS(o,null,n),a=r.get(o)),!a||a.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=yf(s,o,r)),a.count*a.aliasCount>i)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,n,r){let s=`*${this.source}`;if(e){if(v$.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(e.implicitKey)return`${s} `}return s}};function yf(t,e,n){if(gf.isAlias(e)){let r=e.resolve(t),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}else if(gf.isCollection(e)){let r=0;for(let s of e.items){let i=yf(t,s,n);i>r&&(r=i)}return r}else if(gf.isPair(e)){let r=yf(t,e.key,n),s=yf(t,e.value,n);return Math.max(r,s)}return 1}qR.Alias=Xg});var Pt=w(Jg=>{"use strict";var S$=ke(),E$=mf(),w$=Ls(),k$=t=>!t||typeof t!="function"&&typeof t!="object",$s=class extends E$.NodeBase{constructor(e){super(S$.SCALAR),this.value=e}toJSON(e,n){return n?.keep?this.value:w$.toJS(this.value,e,n)}toString(){return String(this.value)}};$s.BLOCK_FOLDED="BLOCK_FOLDED";$s.BLOCK_LITERAL="BLOCK_LITERAL";$s.PLAIN="PLAIN";$s.QUOTE_DOUBLE="QUOTE_DOUBLE";$s.QUOTE_SINGLE="QUOTE_SINGLE";Jg.Scalar=$s;Jg.isScalarValue=k$});var lc=w(FR=>{"use strict";var N$=cc(),Ei=ke(),jR=Pt(),P$="tag:yaml.org,2002:";function R$(t,e,n){if(e){let r=n.filter(i=>i.tag===e),s=r.find(i=>!i.format)??r[0];if(!s)throw new Error(`Tag ${e} not found`);return s}return n.find(r=>r.identify?.(t)&&!r.format)}function D$(t,e,n){if(Ei.isDocument(t)&&(t=t.contents),Ei.isNode(t))return t;if(Ei.isPair(t)){let d=n.schema[Ei.MAP].createNode?.(n.schema,null,n);return d.items.push(t),d}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:r,onAnchor:s,onTagObj:i,schema:o,sourceObjects:a}=n,c;if(r&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor||(c.anchor=s(t)),new N$.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=P$+e.slice(2));let l=R$(t,e,o.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let d=new jR.Scalar(t);return c&&(c.node=d),d}l=t instanceof Map?o[Ei.MAP]:Symbol.iterator in Object(t)?o[Ei.SEQ]:o[Ei.MAP]}i&&(i(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,t,n):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(n.schema,t,n):new jR.Scalar(t);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}FR.createNode=D$});var vf=w(bf=>{"use strict";var C$=lc(),jr=ke(),A$=mf();function Qg(t,e,n){let r=n;for(let s=e.length-1;s>=0;--s){let i=e[s];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){let o=[];o[i]=r,r=o}else r=new Map([[i,r]])}return C$.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var BR=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,Zg=class extends A$.NodeBase{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(r=>jr.isNode(r)||jr.isPair(r)?r.clone(e):r),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(BR(e))this.add(n);else{let[r,...s]=e,i=this.get(r,!0);if(jr.isCollection(i))i.addIn(s,n);else if(i===void 0&&this.schema)this.set(r,Qg(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}deleteIn(e){let[n,...r]=e;if(r.length===0)return this.delete(n);let s=this.get(n,!0);if(jr.isCollection(s))return s.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(e,n){let[r,...s]=e,i=this.get(r,!0);return s.length===0?!n&&jr.isScalar(i)?i.value:i:jr.isCollection(i)?i.getIn(s,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!jr.isPair(n))return!1;let r=n.value;return r==null||e&&jr.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[n,...r]=e;if(r.length===0)return this.has(n);let s=this.get(n,!0);return jr.isCollection(s)?s.hasIn(r):!1}setIn(e,n){let[r,...s]=e;if(s.length===0)this.set(r,n);else{let i=this.get(r,!0);if(jr.isCollection(i))i.setIn(s,n);else if(i===void 0&&this.schema)this.set(r,Qg(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}};bf.Collection=Zg;bf.collectionFromPath=Qg;bf.isEmptyPath=BR});var uc=w(Tf=>{"use strict";var O$=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function ey(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var I$=(t,e,n)=>t.endsWith(`
39
+ `)?ey(n,e):n.includes(`
40
40
  `)?`
41
- `+Rg(t,e):(n.endsWith(" ")?"":" ")+t;af.indentComment=Rg;af.lineComment=nL;af.stringifyComment=tL});var fP=E(nc=>{"use strict";var rL="flow",Dg="block",cf="quoted";function sL(n,e,t="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:i=20,onFold:o,onOverflow:a}={}){if(!s||s<0)return n;s<i&&(i=0);let c=Math.max(1+i,1+s-e.length);if(n.length<=c)return n;let l=[],u={},d=s-e.length;typeof r=="number"&&(r>s-Math.max(2,i)?l.push(0):d=s-r);let f,p,y=!1,m=-1,S=-1,w=-1;t===Dg&&(m=dP(n,m,e.length),m!==-1&&(d=m+c));for(let v;v=n[m+=1];){if(t===cf&&v==="\\"){switch(S=m,n[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}w=m}if(v===`
42
- `)t===Dg&&(m=dP(n,m,e.length)),d=m+e.length+c,f=void 0;else{if(v===" "&&p&&p!==" "&&p!==`
43
- `&&p!==" "){let R=n[m+1];R&&R!==" "&&R!==`
44
- `&&R!==" "&&(f=m)}if(m>=d)if(f)l.push(f),d=f+c,f=void 0;else if(t===cf){for(;p===" "||p===" ";)p=v,v=n[m+=1],y=!0;let R=m>w+1?m-2:S-1;if(u[R])return n;l.push(R),u[R]=!0,d=R+c,f=void 0}else y=!0}p=v}if(y&&a&&a(),l.length===0)return n;o&&o();let T=n.slice(0,l[0]);for(let v=0;v<l.length;++v){let R=l[v],A=l[v+1]||n.length;R===0?T=`
45
- ${e}${n.slice(0,A)}`:(t===cf&&u[R]&&(T+=`${n[R]}\\`),T+=`
46
- ${e}${n.slice(R+1,A)}`)}return T}function dP(n,e,t){let r=e,s=e+1,i=n[s];for(;i===" "||i===" ";)if(e<s+t)i=n[++e];else{do i=n[++e];while(i&&i!==`
47
- `);r=e,s=e+1,i=n[s]}return r}nc.FOLD_BLOCK=Dg;nc.FOLD_FLOW=rL;nc.FOLD_QUOTED=cf;nc.foldFlowLines=sL});var sc=E(hP=>{"use strict";var hr=Et(),Os=fP(),uf=(n,e)=>({indentAtStart:e?n.indent.length:n.indentAtStart,lineWidth:n.options.lineWidth,minContentWidth:n.options.minContentWidth}),df=n=>/^(%|---|\.\.\.)/m.test(n);function iL(n,e,t){if(!e||e<0)return!1;let r=e-t,s=n.length;if(s<=r)return!1;for(let i=0,o=0;i<s;++i)if(n[i]===`
48
- `){if(i-o>r)return!0;if(o=i+1,s-o<=r)return!1}return!0}function rc(n,e){let t=JSON.stringify(n);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:r}=e,s=e.options.doubleQuotedMinMultiLineLength,i=e.indent||(df(n)?" ":""),o="",a=0;for(let c=0,l=t[c];l;l=t[++c])if(l===" "&&t[c+1]==="\\"&&t[c+2]==="n"&&(o+=t.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(t[c+1]){case"u":{o+=t.slice(a,c);let u=t.substr(c+2,4);switch(u){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:u.substr(0,2)==="00"?o+="\\x"+u.substr(2):o+=t.substr(c,6)}c+=5,a=c+1}break;case"n":if(r||t[c+2]==='"'||t.length<s)c+=1;else{for(o+=t.slice(a,c)+`
41
+ `+ey(n,e):(t.endsWith(" ")?"":" ")+n;Tf.indentComment=ey;Tf.lineComment=I$;Tf.stringifyComment=O$});var VR=w(dc=>{"use strict";var x$="flow",ty="block",_f="quoted";function M$(t,e,n="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:i=20,onFold:o,onOverflow:a}={}){if(!s||s<0)return t;s<i&&(i=0);let c=Math.max(1+i,1+s-e.length);if(t.length<=c)return t;let l=[],u={},d=s-e.length;typeof r=="number"&&(r>s-Math.max(2,i)?l.push(0):d=s-r);let f,h,y=!1,m=-1,_=-1,E=-1;n===ty&&(m=UR(t,m,e.length),m!==-1&&(d=m+c));for(let b;b=t[m+=1];){if(n===_f&&b==="\\"){switch(_=m,t[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}E=m}if(b===`
42
+ `)n===ty&&(m=UR(t,m,e.length)),d=m+e.length+c,f=void 0;else{if(b===" "&&h&&h!==" "&&h!==`
43
+ `&&h!==" "){let R=t[m+1];R&&R!==" "&&R!==`
44
+ `&&R!==" "&&(f=m)}if(m>=d)if(f)l.push(f),d=f+c,f=void 0;else if(n===_f){for(;h===" "||h===" ";)h=b,b=t[m+=1],y=!0;let R=m>E+1?m-2:_-1;if(u[R])return t;l.push(R),u[R]=!0,d=R+c,f=void 0}else y=!0}h=b}if(y&&a&&a(),l.length===0)return t;o&&o();let T=t.slice(0,l[0]);for(let b=0;b<l.length;++b){let R=l[b],D=l[b+1]||t.length;R===0?T=`
45
+ ${e}${t.slice(0,D)}`:(n===_f&&u[R]&&(T+=`${t[R]}\\`),T+=`
46
+ ${e}${t.slice(R+1,D)}`)}return T}function UR(t,e,n){let r=e,s=e+1,i=t[s];for(;i===" "||i===" ";)if(e<s+n)i=t[++e];else{do i=t[++e];while(i&&i!==`
47
+ `);r=e,s=e+1,i=t[s]}return r}dc.FOLD_BLOCK=ty;dc.FOLD_FLOW=x$;dc.FOLD_QUOTED=_f;dc.foldFlowLines=M$});var hc=w(zR=>{"use strict";var mr=Pt(),qs=VR(),Ef=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),wf=t=>/^(%|---|\.\.\.)/m.test(t);function L$(t,e,n){if(!e||e<0)return!1;let r=e-n,s=t.length;if(s<=r)return!1;for(let i=0,o=0;i<s;++i)if(t[i]===`
48
+ `){if(i-o>r)return!0;if(o=i+1,s-o<=r)return!1}return!0}function fc(t,e){let n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=e,s=e.options.doubleQuotedMinMultiLineLength,i=e.indent||(wf(t)?" ":""),o="",a=0;for(let c=0,l=n[c];l;l=n[++c])if(l===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(o+=n.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(n[c+1]){case"u":{o+=n.slice(a,c);let u=n.substr(c+2,4);switch(u){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:u.substr(0,2)==="00"?o+="\\x"+u.substr(2):o+=n.substr(c,6)}c+=5,a=c+1}break;case"n":if(r||n[c+2]==='"'||n.length<s)c+=1;else{for(o+=n.slice(a,c)+`
49
49
 
50
- `;t[c+2]==="\\"&&t[c+3]==="n"&&t[c+4]!=='"';)o+=`
51
- `,c+=2;o+=i,t[c+2]===" "&&(o+="\\"),c+=1,a=c+1}break;default:c+=1}return o=a?o+t.slice(a):t,r?o:Os.foldFlowLines(o,i,Os.FOLD_QUOTED,uf(e,!1))}function Cg(n,e){if(e.options.singleQuote===!1||e.implicitKey&&n.includes(`
52
- `)||/[ \t]\n|\n[ \t]/.test(n))return rc(n,e);let t=e.indent||(df(n)?" ":""),r="'"+n.replace(/'/g,"''").replace(/\n+/g,`$&
53
- ${t}`)+"'";return e.implicitKey?r:Os.foldFlowLines(r,t,Os.FOLD_FLOW,uf(e,!1))}function Io(n,e){let{singleQuote:t}=e.options,r;if(t===!1)r=rc;else{let s=n.includes('"'),i=n.includes("'");s&&!i?r=Cg:i&&!s?r=rc:r=t?Cg:rc}return r(n,e)}var Ag;try{Ag=new RegExp(`(^|(?<!
50
+ `;n[c+2]==="\\"&&n[c+3]==="n"&&n[c+4]!=='"';)o+=`
51
+ `,c+=2;o+=i,n[c+2]===" "&&(o+="\\"),c+=1,a=c+1}break;default:c+=1}return o=a?o+n.slice(a):n,r?o:qs.foldFlowLines(o,i,qs.FOLD_QUOTED,Ef(e,!1))}function ny(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
52
+ `)||/[ \t]\n|\n[ \t]/.test(t))return fc(t,e);let n=e.indent||(wf(t)?" ":""),r="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
53
+ ${n}`)+"'";return e.implicitKey?r:qs.foldFlowLines(r,n,qs.FOLD_FLOW,Ef(e,!1))}function Uo(t,e){let{singleQuote:n}=e.options,r;if(n===!1)r=fc;else{let s=t.includes('"'),i=t.includes("'");s&&!i?r=ny:i&&!s?r=fc:r=n?ny:fc}return r(t,e)}var ry;try{ry=new RegExp(`(^|(?<!
54
54
  ))
55
55
  +(?!
56
- |$)`,"g")}catch{Ag=/\n+(?!\n|$)/g}function lf({comment:n,type:e,value:t},r,s,i){let{blockQuote:o,commentString:a,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(t)||/^\s*$/.test(t))return Io(t,r);let l=r.indent||(r.forceBlockIndent||df(t)?" ":""),u=o==="literal"?!0:o==="folded"||e===hr.Scalar.BLOCK_FOLDED?!1:e===hr.Scalar.BLOCK_LITERAL?!0:!iL(t,c,l.length);if(!t)return u?`|
56
+ |$)`,"g")}catch{ry=/\n+(?!\n|$)/g}function Sf({comment:t,type:e,value:n},r,s,i){let{blockQuote:o,commentString:a,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n)||/^\s*$/.test(n))return Uo(n,r);let l=r.indent||(r.forceBlockIndent||wf(n)?" ":""),u=o==="literal"?!0:o==="folded"||e===mr.Scalar.BLOCK_FOLDED?!1:e===mr.Scalar.BLOCK_LITERAL?!0:!L$(n,c,l.length);if(!n)return u?`|
57
57
  `:`>
58
- `;let d,f;for(f=t.length;f>0;--f){let A=t[f-1];if(A!==`
59
- `&&A!==" "&&A!==" ")break}let p=t.substring(f),y=p.indexOf(`
60
- `);y===-1?d="-":t===p||y!==p.length-1?(d="+",i&&i()):d="",p&&(t=t.slice(0,-p.length),p[p.length-1]===`
61
- `&&(p=p.slice(0,-1)),p=p.replace(Ag,`$&${l}`));let m=!1,S,w=-1;for(S=0;S<t.length;++S){let A=t[S];if(A===" ")m=!0;else if(A===`
62
- `)w=S;else break}let T=t.substring(0,w<S?w+1:S);T&&(t=t.substring(T.length),T=T.replace(/\n+/g,`$&${l}`));let R=(m?l?"2":"1":"")+d;if(n&&(R+=" "+a(n.replace(/ ?[\r\n]+/g," ")),s&&s()),!u){let A=t.replace(/\n+/g,`
63
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),M=!1,z=uf(r,!0);o!=="folded"&&e!==hr.Scalar.BLOCK_FOLDED&&(z.onOverflow=()=>{M=!0});let j=Os.foldFlowLines(`${T}${A}${p}`,l,Os.FOLD_BLOCK,z);if(!M)return`>${R}
64
- ${l}${j}`}return t=t.replace(/\n+/g,`$&${l}`),`|${R}
65
- ${l}${T}${t}${p}`}function oL(n,e,t,r){let{type:s,value:i}=n,{actualString:o,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&i.includes(`
66
- `)||u&&/[[\]{},]/.test(i))return Io(i,e);if(!i||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||u||!i.includes(`
67
- `)?Io(i,e):lf(n,e,t,r);if(!a&&!u&&s!==hr.Scalar.PLAIN&&i.includes(`
68
- `))return lf(n,e,t,r);if(df(i)){if(c==="")return e.forceBlockIndent=!0,lf(n,e,t,r);if(a&&c===l)return Io(i,e)}let d=i.replace(/\n+/g,`$&
69
- ${c}`);if(o){let f=m=>m.default&&m.tag!=="tag:yaml.org,2002:str"&&m.test?.test(d),{compat:p,tags:y}=e.doc.schema;if(y.some(f)||p?.some(f))return Io(i,e)}return a?d:Os.foldFlowLines(d,c,Os.FOLD_FLOW,uf(e,!1))}function aL(n,e,t,r){let{implicitKey:s,inFlow:i}=e,o=typeof n.value=="string"?n:Object.assign({},n,{value:String(n.value)}),{type:a}=n;a!==hr.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=hr.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case hr.Scalar.BLOCK_FOLDED:case hr.Scalar.BLOCK_LITERAL:return s||i?Io(o.value,e):lf(o,e,t,r);case hr.Scalar.QUOTE_DOUBLE:return rc(o.value,e);case hr.Scalar.QUOTE_SINGLE:return Cg(o.value,e);case hr.Scalar.PLAIN:return oL(o,e,t,r);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:d}=e.options,f=s&&u||d;if(l=c(f),l===null)throw new Error(`Unsupported default string type ${f}`)}return l}hP.stringifyString=aL});var ic=E(Og=>{"use strict";var cL=ef(),Is=_e(),lL=tc(),uL=sc();function dL(n,e){let t=Object.assign({blockQuote:!0,commentString:lL.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},n.schema.toStringOptions,e),r;switch(t.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:n,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:r,options:t}}function fL(n,e){if(e.tag){let s=n.filter(i=>i.tag===e.tag);if(s.length>0)return s.find(i=>i.format===e.format)??s[0]}let t,r;if(Is.isScalar(e)){r=e.value;let s=n.filter(i=>i.identify?.(r));if(s.length>1){let i=s.filter(o=>o.test);i.length>0&&(s=i)}t=s.find(i=>i.format===e.format)??s.find(i=>!i.format)}else r=e,t=n.find(s=>s.nodeClass&&r instanceof s.nodeClass);if(!t){let s=r?.constructor?.name??typeof r;throw new Error(`Tag not resolved for ${s} value`)}return t}function hL(n,e,{anchors:t,doc:r}){if(!r.directives)return"";let s=[],i=(Is.isScalar(n)||Is.isCollection(n))&&n.anchor;i&&cL.anchorIsValid(i)&&(t.add(i),s.push(`&${i}`));let o=n.tag?n.tag:e.default?null:e.tag;return o&&s.push(r.directives.tagString(o)),s.join(" ")}function pL(n,e,t,r){if(Is.isPair(n))return n.toString(e,t,r);if(Is.isAlias(n)){if(e.doc.directives)return n.toString(e);if(e.resolvedAliases?.has(n))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(n):e.resolvedAliases=new Set([n]),n=n.resolve(e.doc)}let s,i=Is.isNode(n)?n:e.doc.createNode(n,{onTagObj:c=>s=c});s||(s=fL(e.doc.schema.tags,i));let o=hL(i,s,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof s.stringify=="function"?s.stringify(i,e,t,r):Is.isScalar(i)?uL.stringifyString(i,e,t,r):i.toString(e,t,r);return o?Is.isScalar(i)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
70
- ${e.indent}${a}`:a}Og.createStringifyContext=dL;Og.stringify=pL});var yP=E(gP=>{"use strict";var es=_e(),pP=Et(),mP=ic(),oc=tc();function mL({key:n,value:e},t,r,s){let{allNullValues:i,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=t,f=es.isNode(n)&&n.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(es.isCollection(n)||!es.isNode(n)&&typeof n=="object"){let z="With simple keys, collection cannot be used as a key value";throw new Error(z)}}let p=!d&&(!n||f&&e==null&&!t.inFlow||es.isCollection(n)||(es.isScalar(n)?n.type===pP.Scalar.BLOCK_FOLDED||n.type===pP.Scalar.BLOCK_LITERAL:typeof n=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!p&&(d||!i),indent:a+c});let y=!1,m=!1,S=mP.stringify(n,t,()=>y=!0,()=>m=!0);if(!p&&!t.inFlow&&S.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(t.inFlow){if(i||e==null)return y&&r&&r(),S===""?"?":p?`? ${S}`:S}else if(i&&!d||e==null&&p)return S=`? ${S}`,f&&!y?S+=oc.lineComment(S,t.indent,l(f)):m&&s&&s(),S;y&&(f=null),p?(f&&(S+=oc.lineComment(S,t.indent,l(f))),S=`? ${S}
71
- ${a}:`):(S=`${S}:`,f&&(S+=oc.lineComment(S,t.indent,l(f))));let w,T,v;es.isNode(e)?(w=!!e.spaceBefore,T=e.commentBefore,v=e.comment):(w=!1,T=null,v=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!p&&!f&&es.isScalar(e)&&(t.indentAtStart=S.length+1),m=!1,!u&&c.length>=2&&!t.inFlow&&!p&&es.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let R=!1,A=mP.stringify(e,t,()=>R=!0,()=>m=!0),M=" ";if(f||w||T){if(M=w?`
72
- `:"",T){let z=l(T);M+=`
73
- ${oc.indentComment(z,t.indent)}`}A===""&&!t.inFlow?M===`
74
- `&&(M=`
58
+ `;let d,f;for(f=n.length;f>0;--f){let D=n[f-1];if(D!==`
59
+ `&&D!==" "&&D!==" ")break}let h=n.substring(f),y=h.indexOf(`
60
+ `);y===-1?d="-":n===h||y!==h.length-1?(d="+",i&&i()):d="",h&&(n=n.slice(0,-h.length),h[h.length-1]===`
61
+ `&&(h=h.slice(0,-1)),h=h.replace(ry,`$&${l}`));let m=!1,_,E=-1;for(_=0;_<n.length;++_){let D=n[_];if(D===" ")m=!0;else if(D===`
62
+ `)E=_;else break}let T=n.substring(0,E<_?E+1:_);T&&(n=n.substring(T.length),T=T.replace(/\n+/g,`$&${l}`));let R=(m?l?"2":"1":"")+d;if(t&&(R+=" "+a(t.replace(/ ?[\r\n]+/g," ")),s&&s()),!u){let D=n.replace(/\n+/g,`
63
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),L=!1,H=Ef(r,!0);o!=="folded"&&e!==mr.Scalar.BLOCK_FOLDED&&(H.onOverflow=()=>{L=!0});let U=qs.foldFlowLines(`${T}${D}${h}`,l,qs.FOLD_BLOCK,H);if(!L)return`>${R}
64
+ ${l}${U}`}return n=n.replace(/\n+/g,`$&${l}`),`|${R}
65
+ ${l}${T}${n}${h}`}function $$(t,e,n,r){let{type:s,value:i}=t,{actualString:o,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&i.includes(`
66
+ `)||u&&/[[\]{},]/.test(i))return Uo(i,e);if(!i||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||u||!i.includes(`
67
+ `)?Uo(i,e):Sf(t,e,n,r);if(!a&&!u&&s!==mr.Scalar.PLAIN&&i.includes(`
68
+ `))return Sf(t,e,n,r);if(wf(i)){if(c==="")return e.forceBlockIndent=!0,Sf(t,e,n,r);if(a&&c===l)return Uo(i,e)}let d=i.replace(/\n+/g,`$&
69
+ ${c}`);if(o){let f=m=>m.default&&m.tag!=="tag:yaml.org,2002:str"&&m.test?.test(d),{compat:h,tags:y}=e.doc.schema;if(y.some(f)||h?.some(f))return Uo(i,e)}return a?d:qs.foldFlowLines(d,c,qs.FOLD_FLOW,Ef(e,!1))}function q$(t,e,n,r){let{implicitKey:s,inFlow:i}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==mr.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=mr.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case mr.Scalar.BLOCK_FOLDED:case mr.Scalar.BLOCK_LITERAL:return s||i?Uo(o.value,e):Sf(o,e,n,r);case mr.Scalar.QUOTE_DOUBLE:return fc(o.value,e);case mr.Scalar.QUOTE_SINGLE:return ny(o.value,e);case mr.Scalar.PLAIN:return $$(o,e,n,r);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:d}=e.options,f=s&&u||d;if(l=c(f),l===null)throw new Error(`Unsupported default string type ${f}`)}return l}zR.stringifyString=q$});var pc=w(sy=>{"use strict";var j$=pf(),js=ke(),F$=uc(),B$=hc();function U$(t,e){let n=Object.assign({blockQuote:!0,commentString:F$.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function V$(t,e){if(e.tag){let s=t.filter(i=>i.tag===e.tag);if(s.length>0)return s.find(i=>i.format===e.format)??s[0]}let n,r;if(js.isScalar(e)){r=e.value;let s=t.filter(i=>i.identify?.(r));if(s.length>1){let i=s.filter(o=>o.test);i.length>0&&(s=i)}n=s.find(i=>i.format===e.format)??s.find(i=>!i.format)}else r=e,n=t.find(s=>s.nodeClass&&r instanceof s.nodeClass);if(!n){let s=r?.constructor?.name??typeof r;throw new Error(`Tag not resolved for ${s} value`)}return n}function z$(t,e,{anchors:n,doc:r}){if(!r.directives)return"";let s=[],i=(js.isScalar(t)||js.isCollection(t))&&t.anchor;i&&j$.anchorIsValid(i)&&(n.add(i),s.push(`&${i}`));let o=t.tag?t.tag:e.default?null:e.tag;return o&&s.push(r.directives.tagString(o)),s.join(" ")}function W$(t,e,n,r){if(js.isPair(t))return t.toString(e,n,r);if(js.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let s,i=js.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>s=c});s||(s=V$(e.doc.schema.tags,i));let o=z$(i,s,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof s.stringify=="function"?s.stringify(i,e,n,r):js.isScalar(i)?B$.stringifyString(i,e,n,r):i.toString(e,n,r);return o?js.isScalar(i)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
70
+ ${e.indent}${a}`:a}sy.createStringifyContext=U$;sy.stringify=W$});var KR=w(GR=>{"use strict";var rs=ke(),WR=Pt(),HR=pc(),mc=uc();function H$({key:t,value:e},n,r,s){let{allNullValues:i,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=rs.isNode(t)&&t.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(rs.isCollection(t)||!rs.isNode(t)&&typeof t=="object"){let H="With simple keys, collection cannot be used as a key value";throw new Error(H)}}let h=!d&&(!t||f&&e==null&&!n.inFlow||rs.isCollection(t)||(rs.isScalar(t)?t.type===WR.Scalar.BLOCK_FOLDED||t.type===WR.Scalar.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!h&&(d||!i),indent:a+c});let y=!1,m=!1,_=HR.stringify(t,n,()=>y=!0,()=>m=!0);if(!h&&!n.inFlow&&_.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(n.inFlow){if(i||e==null)return y&&r&&r(),_===""?"?":h?`? ${_}`:_}else if(i&&!d||e==null&&h)return _=`? ${_}`,f&&!y?_+=mc.lineComment(_,n.indent,l(f)):m&&s&&s(),_;y&&(f=null),h?(f&&(_+=mc.lineComment(_,n.indent,l(f))),_=`? ${_}
71
+ ${a}:`):(_=`${_}:`,f&&(_+=mc.lineComment(_,n.indent,l(f))));let E,T,b;rs.isNode(e)?(E=!!e.spaceBefore,T=e.commentBefore,b=e.comment):(E=!1,T=null,b=null,e&&typeof e=="object"&&(e=o.createNode(e))),n.implicitKey=!1,!h&&!f&&rs.isScalar(e)&&(n.indentAtStart=_.length+1),m=!1,!u&&c.length>=2&&!n.inFlow&&!h&&rs.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let R=!1,D=HR.stringify(e,n,()=>R=!0,()=>m=!0),L=" ";if(f||E||T){if(L=E?`
72
+ `:"",T){let H=l(T);L+=`
73
+ ${mc.indentComment(H,n.indent)}`}D===""&&!n.inFlow?L===`
74
+ `&&(L=`
75
75
 
76
- `):M+=`
77
- ${t.indent}`}else if(!p&&es.isCollection(e)){let z=A[0],j=A.indexOf(`
78
- `),ie=j!==-1,Le=t.inFlow??e.flow??e.items.length===0;if(ie||!Le){let wt=!1;if(ie&&(z==="&"||z==="!")){let pe=A.indexOf(" ");z==="&"&&pe!==-1&&pe<j&&A[pe+1]==="!"&&(pe=A.indexOf(" ",pe+1)),(pe===-1||j<pe)&&(wt=!0)}wt||(M=`
79
- ${t.indent}`)}}else(A===""||A[0]===`
80
- `)&&(M="");return S+=M+A,t.inFlow?R&&r&&r():v&&!R?S+=oc.lineComment(S,t.indent,l(v)):m&&s&&s(),S}gP.stringifyPair=mL});var xg=E(Ig=>{"use strict";function gL(n,...e){n==="debug"&&console.log(...e)}function yL(n,e){(n==="debug"||n==="warn")&&(typeof process<"u"&&process.emitWarning?process.emitWarning(e):console.warn(e))}Ig.debug=gL;Ig.warn=yL});var mf=E(pf=>{"use strict";var ac=_e(),bP=Et(),ff="<<",hf={identify:n=>n===ff||typeof n=="symbol"&&n.description===ff,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new bP.Scalar(Symbol(ff)),{addToJSMap:vP}),stringify:()=>ff},bL=(n,e)=>(hf.identify(e)||ac.isScalar(e)&&(!e.type||e.type===bP.Scalar.PLAIN)&&hf.identify(e.value))&&n?.doc.schema.tags.some(t=>t.tag===hf.tag&&t.default);function vP(n,e,t){if(t=n&&ac.isAlias(t)?t.resolve(n.doc):t,ac.isSeq(t))for(let r of t.items)Mg(n,e,r);else if(Array.isArray(t))for(let r of t)Mg(n,e,r);else Mg(n,e,t)}function Mg(n,e,t){let r=n&&ac.isAlias(t)?t.resolve(n.doc):t;if(!ac.isMap(r))throw new Error("Merge sources must be maps or map aliases");let s=r.toJSON(null,n,Map);for(let[i,o]of s)e instanceof Map?e.has(i)||e.set(i,o):e instanceof Set?e.add(i):Object.prototype.hasOwnProperty.call(e,i)||Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}pf.addMergeToJSMap=vP;pf.isMergeKey=bL;pf.merge=hf});var Lg=E(_P=>{"use strict";var vL=xg(),TP=mf(),TL=ic(),SP=_e(),$g=Cs();function SL(n,e,{key:t,value:r}){if(SP.isNode(t)&&t.addToJSMap)t.addToJSMap(n,e,r);else if(TP.isMergeKey(n,t))TP.addMergeToJSMap(n,e,r);else{let s=$g.toJS(t,"",n);if(e instanceof Map)e.set(s,$g.toJS(r,s,n));else if(e instanceof Set)e.add(s);else{let i=_L(t,s,n),o=$g.toJS(r,i,n);i in e?Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[i]=o}}return e}function _L(n,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(SP.isNode(n)&&t?.doc){let r=TL.createStringifyContext(t.doc,{});r.anchors=new Set;for(let i of t.anchors.keys())r.anchors.add(i.anchor);r.inFlow=!0,r.inStringifyKey=!0;let s=n.toString(r);if(!t.mapKeyWarned){let i=JSON.stringify(s);i.length>40&&(i=i.substring(0,36)+'..."'),vL.warn(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return s}return JSON.stringify(e)}_P.addPairToJSMap=SL});var xs=E(qg=>{"use strict";var EP=ec(),EL=yP(),wL=Lg(),gf=_e();function kL(n,e,t){let r=EP.createNode(n,void 0,t),s=EP.createNode(e,void 0,t);return new yf(r,s)}var yf=class n{constructor(e,t=null){Object.defineProperty(this,gf.NODE_TYPE,{value:gf.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:r}=this;return gf.isNode(t)&&(t=t.clone(e)),gf.isNode(r)&&(r=r.clone(e)),new n(t,r)}toJSON(e,t){let r=t?.mapAsMap?new Map:{};return wL.addPairToJSMap(t,r,this)}toString(e,t,r){return e?.doc?EL.stringifyPair(this,e,t,r):JSON.stringify(this)}};qg.Pair=yf;qg.createPair=kL});var jg=E(kP=>{"use strict";var yi=_e(),wP=ic(),bf=tc();function NL(n,e,t){return(e.inFlow??n.flow?RL:PL)(n,e,t)}function PL({comment:n,items:e},t,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:o,onComment:a}){let{indent:c,options:{commentString:l}}=t,u=Object.assign({},t,{indent:i,type:null}),d=!1,f=[];for(let y=0;y<e.length;++y){let m=e[y],S=null;if(yi.isNode(m))!d&&m.spaceBefore&&f.push(""),vf(t,f,m.commentBefore,d),m.comment&&(S=m.comment);else if(yi.isPair(m)){let T=yi.isNode(m.key)?m.key:null;T&&(!d&&T.spaceBefore&&f.push(""),vf(t,f,T.commentBefore,d))}d=!1;let w=wP.stringify(m,u,()=>S=null,()=>d=!0);S&&(w+=bf.lineComment(w,i,l(S))),d&&S&&(d=!1),f.push(r+w)}let p;if(f.length===0)p=s.start+s.end;else{p=f[0];for(let y=1;y<f.length;++y){let m=f[y];p+=m?`
76
+ `):L+=`
77
+ ${n.indent}`}else if(!h&&rs.isCollection(e)){let H=D[0],U=D.indexOf(`
78
+ `),oe=U!==-1,Be=n.inFlow??e.flow??e.items.length===0;if(oe||!Be){let Rt=!1;if(oe&&(H==="&"||H==="!")){let me=D.indexOf(" ");H==="&"&&me!==-1&&me<U&&D[me+1]==="!"&&(me=D.indexOf(" ",me+1)),(me===-1||U<me)&&(Rt=!0)}Rt||(L=`
79
+ ${n.indent}`)}}else(D===""||D[0]===`
80
+ `)&&(L="");return _+=L+D,n.inFlow?R&&r&&r():b&&!R?_+=mc.lineComment(_,n.indent,l(b)):m&&s&&s(),_}GR.stringifyPair=H$});var oy=w(iy=>{"use strict";function G$(t,...e){t==="debug"&&console.log(...e)}function K$(t,e){(t==="debug"||t==="warn")&&(typeof process<"u"&&process.emitWarning?process.emitWarning(e):console.warn(e))}iy.debug=G$;iy.warn=K$});var Rf=w(Pf=>{"use strict";var gc=ke(),YR=Pt(),kf="<<",Nf={identify:t=>t===kf||typeof t=="symbol"&&t.description===kf,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new YR.Scalar(Symbol(kf)),{addToJSMap:XR}),stringify:()=>kf},Y$=(t,e)=>(Nf.identify(e)||gc.isScalar(e)&&(!e.type||e.type===YR.Scalar.PLAIN)&&Nf.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===Nf.tag&&n.default);function XR(t,e,n){if(n=t&&gc.isAlias(n)?n.resolve(t.doc):n,gc.isSeq(n))for(let r of n.items)ay(t,e,r);else if(Array.isArray(n))for(let r of n)ay(t,e,r);else ay(t,e,n)}function ay(t,e,n){let r=t&&gc.isAlias(n)?n.resolve(t.doc):n;if(!gc.isMap(r))throw new Error("Merge sources must be maps or map aliases");let s=r.toJSON(null,t,Map);for(let[i,o]of s)e instanceof Map?e.has(i)||e.set(i,o):e instanceof Set?e.add(i):Object.prototype.hasOwnProperty.call(e,i)||Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}Pf.addMergeToJSMap=XR;Pf.isMergeKey=Y$;Pf.merge=Nf});var ly=w(ZR=>{"use strict";var X$=oy(),JR=Rf(),J$=pc(),QR=ke(),cy=Ls();function Q$(t,e,{key:n,value:r}){if(QR.isNode(n)&&n.addToJSMap)n.addToJSMap(t,e,r);else if(JR.isMergeKey(t,n))JR.addMergeToJSMap(t,e,r);else{let s=cy.toJS(n,"",t);if(e instanceof Map)e.set(s,cy.toJS(r,s,t));else if(e instanceof Set)e.add(s);else{let i=Z$(n,s,t),o=cy.toJS(r,i,t);i in e?Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[i]=o}}return e}function Z$(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(QR.isNode(t)&&n?.doc){let r=J$.createStringifyContext(n.doc,{});r.anchors=new Set;for(let i of n.anchors.keys())r.anchors.add(i.anchor);r.inFlow=!0,r.inStringifyKey=!0;let s=t.toString(r);if(!n.mapKeyWarned){let i=JSON.stringify(s);i.length>40&&(i=i.substring(0,36)+'..."'),X$.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return s}return JSON.stringify(e)}ZR.addPairToJSMap=Q$});var Fs=w(uy=>{"use strict";var e0=lc(),eq=KR(),tq=ly(),Df=ke();function nq(t,e,n){let r=e0.createNode(t,void 0,n),s=e0.createNode(e,void 0,n);return new Cf(r,s)}var Cf=class t{constructor(e,n=null){Object.defineProperty(this,Df.NODE_TYPE,{value:Df.PAIR}),this.key=e,this.value=n}clone(e){let{key:n,value:r}=this;return Df.isNode(n)&&(n=n.clone(e)),Df.isNode(r)&&(r=r.clone(e)),new t(n,r)}toJSON(e,n){let r=n?.mapAsMap?new Map:{};return tq.addPairToJSMap(n,r,this)}toString(e,n,r){return e?.doc?eq.stringifyPair(this,e,n,r):JSON.stringify(this)}};uy.Pair=Cf;uy.createPair=nq});var dy=w(n0=>{"use strict";var wi=ke(),t0=pc(),Af=uc();function rq(t,e,n){return(e.inFlow??t.flow?iq:sq)(t,e,n)}function sq({comment:t,items:e},n,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:o,onComment:a}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:i,type:null}),d=!1,f=[];for(let y=0;y<e.length;++y){let m=e[y],_=null;if(wi.isNode(m))!d&&m.spaceBefore&&f.push(""),Of(n,f,m.commentBefore,d),m.comment&&(_=m.comment);else if(wi.isPair(m)){let T=wi.isNode(m.key)?m.key:null;T&&(!d&&T.spaceBefore&&f.push(""),Of(n,f,T.commentBefore,d))}d=!1;let E=t0.stringify(m,u,()=>_=null,()=>d=!0);_&&(E+=Af.lineComment(E,i,l(_))),d&&_&&(d=!1),f.push(r+E)}let h;if(f.length===0)h=s.start+s.end;else{h=f[0];for(let y=1;y<f.length;++y){let m=f[y];h+=m?`
81
81
  ${c}${m}`:`
82
- `}}return n?(p+=`
83
- `+bf.indentComment(l(n),c),a&&a()):d&&o&&o(),p}function RL({items:n},e,{flowChars:t,itemIndent:r}){let{indent:s,indentStep:i,flowCollectionPadding:o,options:{commentString:a}}=e;r+=i;let c=Object.assign({},e,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let y=0;y<n.length;++y){let m=n[y],S=null;if(yi.isNode(m))m.spaceBefore&&d.push(""),vf(e,d,m.commentBefore,!1),m.comment&&(S=m.comment);else if(yi.isPair(m)){let T=yi.isNode(m.key)?m.key:null;T&&(T.spaceBefore&&d.push(""),vf(e,d,T.commentBefore,!1),T.comment&&(l=!0));let v=yi.isNode(m.value)?m.value:null;v?(v.comment&&(S=v.comment),v.commentBefore&&(l=!0)):m.value==null&&T?.comment&&(S=T.comment)}S&&(l=!0);let w=wP.stringify(m,c,()=>S=null);y<n.length-1&&(w+=","),S&&(w+=bf.lineComment(w,r,a(S))),!l&&(d.length>u||w.includes(`
84
- `))&&(l=!0),d.push(w),u=d.length}let{start:f,end:p}=t;if(d.length===0)return f+p;if(!l){let y=d.reduce((m,S)=>m+S.length+2,2);l=e.options.lineWidth>0&&y>e.options.lineWidth}if(l){let y=f;for(let m of d)y+=m?`
82
+ `}}return t?(h+=`
83
+ `+Af.indentComment(l(t),c),a&&a()):d&&o&&o(),h}function iq({items:t},e,{flowChars:n,itemIndent:r}){let{indent:s,indentStep:i,flowCollectionPadding:o,options:{commentString:a}}=e;r+=i;let c=Object.assign({},e,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let y=0;y<t.length;++y){let m=t[y],_=null;if(wi.isNode(m))m.spaceBefore&&d.push(""),Of(e,d,m.commentBefore,!1),m.comment&&(_=m.comment);else if(wi.isPair(m)){let T=wi.isNode(m.key)?m.key:null;T&&(T.spaceBefore&&d.push(""),Of(e,d,T.commentBefore,!1),T.comment&&(l=!0));let b=wi.isNode(m.value)?m.value:null;b?(b.comment&&(_=b.comment),b.commentBefore&&(l=!0)):m.value==null&&T?.comment&&(_=T.comment)}_&&(l=!0);let E=t0.stringify(m,c,()=>_=null);y<t.length-1&&(E+=","),_&&(E+=Af.lineComment(E,r,a(_))),!l&&(d.length>u||E.includes(`
84
+ `))&&(l=!0),d.push(E),u=d.length}let{start:f,end:h}=n;if(d.length===0)return f+h;if(!l){let y=d.reduce((m,_)=>m+_.length+2,2);l=e.options.lineWidth>0&&y>e.options.lineWidth}if(l){let y=f;for(let m of d)y+=m?`
85
85
  ${i}${s}${m}`:`
86
86
  `;return`${y}
87
- ${s}${p}`}else return`${f}${o}${d.join(" ")}${o}${p}`}function vf({indent:n,options:{commentString:e}},t,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){let i=bf.indentComment(e(r),n);t.push(i.trimStart())}}kP.stringifyCollection=NL});var $s=E(Bg=>{"use strict";var DL=jg(),CL=Lg(),AL=of(),Ms=_e(),Tf=xs(),OL=Et();function cc(n,e){let t=Ms.isScalar(e)?e.value:e;for(let r of n)if(Ms.isPair(r)&&(r.key===e||r.key===t||Ms.isScalar(r.key)&&r.key.value===t))return r}var Fg=class extends AL.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Ms.MAP,e),this.items=[]}static from(e,t,r){let{keepUndefined:s,replacer:i}=r,o=new this(e),a=(c,l)=>{if(typeof i=="function")l=i.call(t,c,l);else if(Array.isArray(i)&&!i.includes(c))return;(l!==void 0||s)&&o.items.push(Tf.createPair(c,l,r))};if(t instanceof Map)for(let[c,l]of t)a(c,l);else if(t&&typeof t=="object")for(let c of Object.keys(t))a(c,t[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){let r;Ms.isPair(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new Tf.Pair(e,e?.value):r=new Tf.Pair(e.key,e.value);let s=cc(this.items,r.key),i=this.schema?.sortMapEntries;if(s){if(!t)throw new Error(`Key ${r.key} already set`);Ms.isScalar(s.value)&&OL.isScalarValue(r.value)?s.value.value=r.value:s.value=r.value}else if(i){let o=this.items.findIndex(a=>i(r,a)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(e){let t=cc(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let s=cc(this.items,e)?.value;return(!t&&Ms.isScalar(s)?s.value:s)??void 0}has(e){return!!cc(this.items,e)}set(e,t){this.add(new Tf.Pair(e,t),!0)}toJSON(e,t,r){let s=r?new r:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(s);for(let i of this.items)CL.addPairToJSMap(t,s,i);return s}toString(e,t,r){if(!e)return JSON.stringify(this);for(let s of this.items)if(!Ms.isPair(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),DL.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:t})}};Bg.YAMLMap=Fg;Bg.findPair=cc});var xo=E(PP=>{"use strict";var IL=_e(),NP=$s(),xL={collection:"map",default:!0,nodeClass:NP.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(n,e){return IL.isMap(n)||e("Expected a mapping for this tag"),n},createNode:(n,e,t)=>NP.YAMLMap.from(n,e,t)};PP.map=xL});var Ls=E(RP=>{"use strict";var ML=ec(),$L=jg(),LL=of(),_f=_e(),qL=Et(),jL=Cs(),Ug=class extends LL.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(_f.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Sf(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let r=Sf(e);if(typeof r!="number")return;let s=this.items[r];return!t&&_f.isScalar(s)?s.value:s}has(e){let t=Sf(e);return typeof t=="number"&&t<this.items.length}set(e,t){let r=Sf(e);if(typeof r!="number")throw new Error(`Expected a valid index, not ${e}.`);let s=this.items[r];_f.isScalar(s)&&qL.isScalarValue(t)?s.value=t:this.items[r]=t}toJSON(e,t){let r=[];t?.onCreate&&t.onCreate(r);let s=0;for(let i of this.items)r.push(jL.toJS(i,String(s++),t));return r}toString(e,t,r){return e?$L.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:t}):JSON.stringify(this)}static from(e,t,r){let{replacer:s}=r,i=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let a of t){if(typeof s=="function"){let c=t instanceof Set?a:String(o++);a=s.call(t,c,a)}i.items.push(ML.createNode(a,void 0,r))}}return i}};function Sf(n){let e=_f.isScalar(n)?n.value:n;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}RP.YAMLSeq=Ug});var Mo=E(CP=>{"use strict";var FL=_e(),DP=Ls(),BL={collection:"seq",default:!0,nodeClass:DP.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(n,e){return FL.isSeq(n)||e("Expected a sequence for this tag"),n},createNode:(n,e,t)=>DP.YAMLSeq.from(n,e,t)};CP.seq=BL});var lc=E(AP=>{"use strict";var UL=sc(),VL={identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify(n,e,t,r){return e=Object.assign({actualString:!0},e),UL.stringifyString(n,e,t,r)}};AP.string=VL});var Ef=E(xP=>{"use strict";var OP=Et(),IP={identify:n=>n==null,createNode:()=>new OP.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new OP.Scalar(null),stringify:({source:n},e)=>typeof n=="string"&&IP.test.test(n)?n:e.options.nullStr};xP.nullTag=IP});var Vg=E($P=>{"use strict";var WL=Et(),MP={identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:n=>new WL.Scalar(n[0]==="t"||n[0]==="T"),stringify({source:n,value:e},t){if(n&&MP.test.test(n)){let r=n[0]==="t"||n[0]==="T";if(e===r)return n}return e?t.options.trueStr:t.options.falseStr}};$P.boolTag=MP});var $o=E(LP=>{"use strict";function zL({format:n,minFractionDigits:e,tag:t,value:r}){if(typeof r=="bigint")return String(r);let s=typeof r=="number"?r:Number(r);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let i=JSON.stringify(r);if(!n&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^\d/.test(i)){let o=i.indexOf(".");o<0&&(o=i.length,i+=".");let a=e-(i.length-o-1);for(;a-- >0;)i+="0"}return i}LP.stringifyNumber=zL});var zg=E(wf=>{"use strict";var HL=Et(),Wg=$o(),KL={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Wg.stringifyNumber},GL={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n),stringify(n){let e=Number(n.value);return isFinite(e)?e.toExponential():Wg.stringifyNumber(n)}},YL={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(n){let e=new HL.Scalar(parseFloat(n)),t=n.indexOf(".");return t!==-1&&n[n.length-1]==="0"&&(e.minFractionDigits=n.length-t-1),e},stringify:Wg.stringifyNumber};wf.float=YL;wf.floatExp=GL;wf.floatNaN=KL});var Kg=E(Nf=>{"use strict";var qP=$o(),kf=n=>typeof n=="bigint"||Number.isInteger(n),Hg=(n,e,t,{intAsBigInt:r})=>r?BigInt(n):parseInt(n.substring(e),t);function jP(n,e,t){let{value:r}=n;return kf(r)&&r>=0?t+r.toString(e):qP.stringifyNumber(n)}var JL={identify:n=>kf(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(n,e,t)=>Hg(n,2,8,t),stringify:n=>jP(n,8,"0o")},XL={identify:kf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(n,e,t)=>Hg(n,0,10,t),stringify:qP.stringifyNumber},QL={identify:n=>kf(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(n,e,t)=>Hg(n,2,16,t),stringify:n=>jP(n,16,"0x")};Nf.int=XL;Nf.intHex=QL;Nf.intOct=JL});var BP=E(FP=>{"use strict";var ZL=xo(),e1=Ef(),t1=Mo(),n1=lc(),r1=Vg(),Gg=zg(),Yg=Kg(),s1=[ZL.map,t1.seq,n1.string,e1.nullTag,r1.boolTag,Yg.intOct,Yg.int,Yg.intHex,Gg.floatNaN,Gg.floatExp,Gg.float];FP.schema=s1});var WP=E(VP=>{"use strict";var i1=Et(),o1=xo(),a1=Mo();function UP(n){return typeof n=="bigint"||Number.isInteger(n)}var Pf=({value:n})=>JSON.stringify(n),c1=[{identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify:Pf},{identify:n=>n==null,createNode:()=>new i1.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Pf},{identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:n=>n==="true",stringify:Pf},{identify:UP,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(n,e,{intAsBigInt:t})=>t?BigInt(n):parseInt(n,10),stringify:({value:n})=>UP(n)?n.toString():JSON.stringify(n)},{identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:n=>parseFloat(n),stringify:Pf}],l1={default:!0,tag:"",test:/^/,resolve(n,e){return e(`Unresolved plain scalar ${JSON.stringify(n)}`),n}},u1=[o1.map,a1.seq].concat(c1,l1);VP.schema=u1});var Xg=E(zP=>{"use strict";var Jg=Et(),d1=sc(),f1={identify:n=>n instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(n,e){if(typeof Buffer=="function")return Buffer.from(n,"base64");if(typeof atob=="function"){let t=atob(n.replace(/[\n\r]/g,"")),r=new Uint8Array(t.length);for(let s=0;s<t.length;++s)r[s]=t.charCodeAt(s);return r}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),n},stringify({comment:n,type:e,value:t},r,s,i){let o=t,a;if(typeof Buffer=="function")a=o instanceof Buffer?o.toString("base64"):Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let l=0;l<o.length;++l)c+=String.fromCharCode(o[l]);a=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e||(e=Jg.Scalar.BLOCK_LITERAL),e!==Jg.Scalar.QUOTE_DOUBLE){let c=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),l=Math.ceil(a.length/c),u=new Array(l);for(let d=0,f=0;d<l;++d,f+=c)u[d]=a.substr(f,c);a=u.join(e===Jg.Scalar.BLOCK_LITERAL?`
88
- `:" ")}return d1.stringifyString({comment:n,type:e,value:a},r,s,i)}};zP.binary=f1});var Cf=E(Df=>{"use strict";var Rf=_e(),Qg=xs(),h1=Et(),p1=Ls();function HP(n,e){if(Rf.isSeq(n))for(let t=0;t<n.items.length;++t){let r=n.items[t];if(!Rf.isPair(r)){if(Rf.isMap(r)){r.items.length>1&&e("Each pair must have its own sequence indicator");let s=r.items[0]||new Qg.Pair(new h1.Scalar(null));if(r.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${r.commentBefore}
87
+ ${s}${h}`}else return`${f}${o}${d.join(" ")}${o}${h}`}function Of({indent:t,options:{commentString:e}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){let i=Af.indentComment(e(r),t);n.push(i.trimStart())}}n0.stringifyCollection=rq});var Us=w(hy=>{"use strict";var oq=dy(),aq=ly(),cq=vf(),Bs=ke(),If=Fs(),lq=Pt();function yc(t,e){let n=Bs.isScalar(e)?e.value:e;for(let r of t)if(Bs.isPair(r)&&(r.key===e||r.key===n||Bs.isScalar(r.key)&&r.key.value===n))return r}var fy=class extends cq.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Bs.MAP,e),this.items=[]}static from(e,n,r){let{keepUndefined:s,replacer:i}=r,o=new this(e),a=(c,l)=>{if(typeof i=="function")l=i.call(n,c,l);else if(Array.isArray(i)&&!i.includes(c))return;(l!==void 0||s)&&o.items.push(If.createPair(c,l,r))};if(n instanceof Map)for(let[c,l]of n)a(c,l);else if(n&&typeof n=="object")for(let c of Object.keys(n))a(c,n[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,n){let r;Bs.isPair(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new If.Pair(e,e?.value):r=new If.Pair(e.key,e.value);let s=yc(this.items,r.key),i=this.schema?.sortMapEntries;if(s){if(!n)throw new Error(`Key ${r.key} already set`);Bs.isScalar(s.value)&&lq.isScalarValue(r.value)?s.value.value=r.value:s.value=r.value}else if(i){let o=this.items.findIndex(a=>i(r,a)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(e){let n=yc(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let s=yc(this.items,e)?.value;return(!n&&Bs.isScalar(s)?s.value:s)??void 0}has(e){return!!yc(this.items,e)}set(e,n){this.add(new If.Pair(e,n),!0)}toJSON(e,n,r){let s=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(s);for(let i of this.items)aq.addPairToJSMap(n,s,i);return s}toString(e,n,r){if(!e)return JSON.stringify(this);for(let s of this.items)if(!Bs.isPair(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),oq.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:n})}};hy.YAMLMap=fy;hy.findPair=yc});var Vo=w(s0=>{"use strict";var uq=ke(),r0=Us(),dq={collection:"map",default:!0,nodeClass:r0.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return uq.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>r0.YAMLMap.from(t,e,n)};s0.map=dq});var Vs=w(i0=>{"use strict";var fq=lc(),hq=dy(),pq=vf(),Mf=ke(),mq=Pt(),gq=Ls(),py=class extends pq.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Mf.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let n=xf(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let r=xf(e);if(typeof r!="number")return;let s=this.items[r];return!n&&Mf.isScalar(s)?s.value:s}has(e){let n=xf(e);return typeof n=="number"&&n<this.items.length}set(e,n){let r=xf(e);if(typeof r!="number")throw new Error(`Expected a valid index, not ${e}.`);let s=this.items[r];Mf.isScalar(s)&&mq.isScalarValue(n)?s.value=n:this.items[r]=n}toJSON(e,n){let r=[];n?.onCreate&&n.onCreate(r);let s=0;for(let i of this.items)r.push(gq.toJS(i,String(s++),n));return r}toString(e,n,r){return e?hq.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(e,n,r){let{replacer:s}=r,i=new this(e);if(n&&Symbol.iterator in Object(n)){let o=0;for(let a of n){if(typeof s=="function"){let c=n instanceof Set?a:String(o++);a=s.call(n,c,a)}i.items.push(fq.createNode(a,void 0,r))}}return i}};function xf(t){let e=Mf.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}i0.YAMLSeq=py});var zo=w(a0=>{"use strict";var yq=ke(),o0=Vs(),bq={collection:"seq",default:!0,nodeClass:o0.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return yq.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>o0.YAMLSeq.from(t,e,n)};a0.seq=bq});var bc=w(c0=>{"use strict";var vq=hc(),Tq={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,r){return e=Object.assign({actualString:!0},e),vq.stringifyString(t,e,n,r)}};c0.string=Tq});var Lf=w(d0=>{"use strict";var l0=Pt(),u0={identify:t=>t==null,createNode:()=>new l0.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new l0.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&u0.test.test(t)?t:e.options.nullStr};d0.nullTag=u0});var my=w(h0=>{"use strict";var _q=Pt(),f0={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new _q.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&f0.test.test(t)){let r=t[0]==="t"||t[0]==="T";if(e===r)return t}return e?n.options.trueStr:n.options.falseStr}};h0.boolTag=f0});var Wo=w(p0=>{"use strict";function Sq({format:t,minFractionDigits:e,tag:n,value:r}){if(typeof r=="bigint")return String(r);let s=typeof r=="number"?r:Number(r);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let i=JSON.stringify(r);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(i)){let o=i.indexOf(".");o<0&&(o=i.length,i+=".");let a=e-(i.length-o-1);for(;a-- >0;)i+="0"}return i}p0.stringifyNumber=Sq});var yy=w($f=>{"use strict";var Eq=Pt(),gy=Wo(),wq={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:gy.stringifyNumber},kq={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():gy.stringifyNumber(t)}},Nq={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new Eq.Scalar(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:gy.stringifyNumber};$f.float=Nq;$f.floatExp=kq;$f.floatNaN=wq});var vy=w(jf=>{"use strict";var m0=Wo(),qf=t=>typeof t=="bigint"||Number.isInteger(t),by=(t,e,n,{intAsBigInt:r})=>r?BigInt(t):parseInt(t.substring(e),n);function g0(t,e,n){let{value:r}=t;return qf(r)&&r>=0?n+r.toString(e):m0.stringifyNumber(t)}var Pq={identify:t=>qf(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>by(t,2,8,n),stringify:t=>g0(t,8,"0o")},Rq={identify:qf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>by(t,0,10,n),stringify:m0.stringifyNumber},Dq={identify:t=>qf(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>by(t,2,16,n),stringify:t=>g0(t,16,"0x")};jf.int=Rq;jf.intHex=Dq;jf.intOct=Pq});var b0=w(y0=>{"use strict";var Cq=Vo(),Aq=Lf(),Oq=zo(),Iq=bc(),xq=my(),Ty=yy(),_y=vy(),Mq=[Cq.map,Oq.seq,Iq.string,Aq.nullTag,xq.boolTag,_y.intOct,_y.int,_y.intHex,Ty.floatNaN,Ty.floatExp,Ty.float];y0.schema=Mq});var _0=w(T0=>{"use strict";var Lq=Pt(),$q=Vo(),qq=zo();function v0(t){return typeof t=="bigint"||Number.isInteger(t)}var Ff=({value:t})=>JSON.stringify(t),jq=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Ff},{identify:t=>t==null,createNode:()=>new Lq.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Ff},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Ff},{identify:v0,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>v0(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Ff}],Fq={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Bq=[$q.map,qq.seq].concat(jq,Fq);T0.schema=Bq});var Ey=w(S0=>{"use strict";var Sy=Pt(),Uq=hc(),Vq={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof Buffer=="function")return Buffer.from(t,"base64");if(typeof atob=="function"){let n=atob(t.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let s=0;s<n.length;++s)r[s]=n.charCodeAt(s);return r}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:n},r,s,i){let o=n,a;if(typeof Buffer=="function")a=o instanceof Buffer?o.toString("base64"):Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let l=0;l<o.length;++l)c+=String.fromCharCode(o[l]);a=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e||(e=Sy.Scalar.BLOCK_LITERAL),e!==Sy.Scalar.QUOTE_DOUBLE){let c=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),l=Math.ceil(a.length/c),u=new Array(l);for(let d=0,f=0;d<l;++d,f+=c)u[d]=a.substr(f,c);a=u.join(e===Sy.Scalar.BLOCK_LITERAL?`
88
+ `:" ")}return Uq.stringifyString({comment:t,type:e,value:a},r,s,i)}};S0.binary=Vq});var Vf=w(Uf=>{"use strict";var Bf=ke(),wy=Fs(),zq=Pt(),Wq=Vs();function E0(t,e){if(Bf.isSeq(t))for(let n=0;n<t.items.length;++n){let r=t.items[n];if(!Bf.isPair(r)){if(Bf.isMap(r)){r.items.length>1&&e("Each pair must have its own sequence indicator");let s=r.items[0]||new wy.Pair(new zq.Scalar(null));if(r.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${r.commentBefore}
89
89
  ${s.key.commentBefore}`:r.commentBefore),r.comment){let i=s.value??s.key;i.comment=i.comment?`${r.comment}
90
- ${i.comment}`:r.comment}r=s}n.items[t]=Rf.isPair(r)?r:new Qg.Pair(r)}}else e("Expected a sequence for this tag");return n}function KP(n,e,t){let{replacer:r}=t,s=new p1.YAMLSeq(n);s.tag="tag:yaml.org,2002:pairs";let i=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof r=="function"&&(o=r.call(e,String(i++),o));let a,c;if(Array.isArray(o))if(o.length===2)a=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let l=Object.keys(o);if(l.length===1)a=l[0],c=o[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=o;s.items.push(Qg.createPair(a,c,t))}return s}var m1={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:HP,createNode:KP};Df.createPairs=KP;Df.pairs=m1;Df.resolvePairs=HP});var ty=E(ey=>{"use strict";var GP=_e(),Zg=Cs(),uc=$s(),g1=Ls(),YP=Cf(),bi=class n extends g1.YAMLSeq{constructor(){super(),this.add=uc.YAMLMap.prototype.add.bind(this),this.delete=uc.YAMLMap.prototype.delete.bind(this),this.get=uc.YAMLMap.prototype.get.bind(this),this.has=uc.YAMLMap.prototype.has.bind(this),this.set=uc.YAMLMap.prototype.set.bind(this),this.tag=n.tag}toJSON(e,t){if(!t)return super.toJSON(e);let r=new Map;t?.onCreate&&t.onCreate(r);for(let s of this.items){let i,o;if(GP.isPair(s)?(i=Zg.toJS(s.key,"",t),o=Zg.toJS(s.value,i,t)):i=Zg.toJS(s,"",t),r.has(i))throw new Error("Ordered maps must not include duplicate keys");r.set(i,o)}return r}static from(e,t,r){let s=YP.createPairs(e,t,r),i=new this;return i.items=s.items,i}};bi.tag="tag:yaml.org,2002:omap";var y1={collection:"seq",identify:n=>n instanceof Map,nodeClass:bi,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){let t=YP.resolvePairs(n,e),r=[];for(let{key:s}of t.items)GP.isScalar(s)&&(r.includes(s.value)?e(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new bi,t)},createNode:(n,e,t)=>bi.from(n,e,t)};ey.YAMLOMap=bi;ey.omap=y1});var eR=E(ny=>{"use strict";var JP=Et();function XP({value:n,source:e},t){return e&&(n?QP:ZP).test.test(e)?e:n?t.options.trueStr:t.options.falseStr}var QP={identify:n=>n===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new JP.Scalar(!0),stringify:XP},ZP={identify:n=>n===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new JP.Scalar(!1),stringify:XP};ny.falseTag=ZP;ny.trueTag=QP});var tR=E(Af=>{"use strict";var b1=Et(),ry=$o(),v1={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ry.stringifyNumber},T1={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n.replace(/_/g,"")),stringify(n){let e=Number(n.value);return isFinite(e)?e.toExponential():ry.stringifyNumber(n)}},S1={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(n){let e=new b1.Scalar(parseFloat(n.replace(/_/g,""))),t=n.indexOf(".");if(t!==-1){let r=n.substring(t+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:ry.stringifyNumber};Af.float=S1;Af.floatExp=T1;Af.floatNaN=v1});var rR=E(fc=>{"use strict";var nR=$o(),dc=n=>typeof n=="bigint"||Number.isInteger(n);function Of(n,e,t,{intAsBigInt:r}){let s=n[0];if((s==="-"||s==="+")&&(e+=1),n=n.substring(e).replace(/_/g,""),r){switch(t){case 2:n=`0b${n}`;break;case 8:n=`0o${n}`;break;case 16:n=`0x${n}`;break}let o=BigInt(n);return s==="-"?BigInt(-1)*o:o}let i=parseInt(n,t);return s==="-"?-1*i:i}function sy(n,e,t){let{value:r}=n;if(dc(r)){let s=r.toString(e);return r<0?"-"+t+s.substr(1):t+s}return nR.stringifyNumber(n)}var _1={identify:dc,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(n,e,t)=>Of(n,2,2,t),stringify:n=>sy(n,2,"0b")},E1={identify:dc,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(n,e,t)=>Of(n,1,8,t),stringify:n=>sy(n,8,"0")},w1={identify:dc,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(n,e,t)=>Of(n,0,10,t),stringify:nR.stringifyNumber},k1={identify:dc,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(n,e,t)=>Of(n,2,16,t),stringify:n=>sy(n,16,"0x")};fc.int=w1;fc.intBin=_1;fc.intHex=k1;fc.intOct=E1});var oy=E(iy=>{"use strict";var Mf=_e(),If=xs(),xf=$s(),vi=class n extends xf.YAMLMap{constructor(e){super(e),this.tag=n.tag}add(e){let t;Mf.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new If.Pair(e.key,null):t=new If.Pair(e,null),xf.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let r=xf.findPair(this.items,e);return!t&&Mf.isPair(r)?Mf.isScalar(r.key)?r.key.value:r.key:r}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let r=xf.findPair(this.items,e);r&&!t?this.items.splice(this.items.indexOf(r),1):!r&&t&&this.items.push(new If.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,r);throw new Error("Set items must all have null values")}static from(e,t,r){let{replacer:s}=r,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof s=="function"&&(o=s.call(t,o,o)),i.items.push(If.createPair(o,null,r));return i}};vi.tag="tag:yaml.org,2002:set";var N1={collection:"map",identify:n=>n instanceof Set,nodeClass:vi,default:!1,tag:"tag:yaml.org,2002:set",createNode:(n,e,t)=>vi.from(n,e,t),resolve(n,e){if(Mf.isMap(n)){if(n.hasAllNullValues(!0))return Object.assign(new vi,n);e("Set items must all have null values")}else e("Expected a mapping for this tag");return n}};iy.YAMLSet=vi;iy.set=N1});var cy=E($f=>{"use strict";var P1=$o();function ay(n,e){let t=n[0],r=t==="-"||t==="+"?n.substring(1):n,s=o=>e?BigInt(o):Number(o),i=r.replace(/_/g,"").split(":").reduce((o,a)=>o*s(60)+s(a),s(0));return t==="-"?s(-1)*i:i}function sR(n){let{value:e}=n,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return P1.stringifyNumber(n);let r="";e<0&&(r="-",e*=t(-1));let s=t(60),i=[e%s];return e<60?i.unshift(0):(e=(e-i[0])/s,i.unshift(e%s),e>=60&&(e=(e-i[0])/s,i.unshift(e))),r+i.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var R1={identify:n=>typeof n=="bigint"||Number.isInteger(n),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(n,e,{intAsBigInt:t})=>ay(n,t),stringify:sR},D1={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:n=>ay(n,!1),stringify:sR},iR={identify:n=>n instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(n){let e=n.match(iR.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,r,s,i,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(t,r-1,s,i||0,o||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=ay(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:n})=>n.toISOString().replace(/(T00:00:00)?\.000Z$/,"")};$f.floatTime=D1;$f.intTime=R1;$f.timestamp=iR});var cR=E(aR=>{"use strict";var C1=xo(),A1=Ef(),O1=Mo(),I1=lc(),x1=Xg(),oR=eR(),ly=tR(),Lf=rR(),M1=mf(),$1=ty(),L1=Cf(),q1=oy(),uy=cy(),j1=[C1.map,O1.seq,I1.string,A1.nullTag,oR.trueTag,oR.falseTag,Lf.intBin,Lf.intOct,Lf.int,Lf.intHex,ly.floatNaN,ly.floatExp,ly.float,x1.binary,M1.merge,$1.omap,L1.pairs,q1.set,uy.intTime,uy.floatTime,uy.timestamp];aR.schema=j1});var bR=E(hy=>{"use strict";var fR=xo(),F1=Ef(),hR=Mo(),B1=lc(),U1=Vg(),dy=zg(),fy=Kg(),V1=BP(),W1=WP(),pR=Xg(),hc=mf(),mR=ty(),gR=Cf(),lR=cR(),yR=oy(),qf=cy(),uR=new Map([["core",V1.schema],["failsafe",[fR.map,hR.seq,B1.string]],["json",W1.schema],["yaml11",lR.schema],["yaml-1.1",lR.schema]]),dR={binary:pR.binary,bool:U1.boolTag,float:dy.float,floatExp:dy.floatExp,floatNaN:dy.floatNaN,floatTime:qf.floatTime,int:fy.int,intHex:fy.intHex,intOct:fy.intOct,intTime:qf.intTime,map:fR.map,merge:hc.merge,null:F1.nullTag,omap:mR.omap,pairs:gR.pairs,seq:hR.seq,set:yR.set,timestamp:qf.timestamp},z1={"tag:yaml.org,2002:binary":pR.binary,"tag:yaml.org,2002:merge":hc.merge,"tag:yaml.org,2002:omap":mR.omap,"tag:yaml.org,2002:pairs":gR.pairs,"tag:yaml.org,2002:set":yR.set,"tag:yaml.org,2002:timestamp":qf.timestamp};function H1(n,e,t){let r=uR.get(e);if(r&&!n)return t&&!r.includes(hc.merge)?r.concat(hc.merge):r.slice();let s=r;if(!s)if(Array.isArray(n))s=[];else{let i=Array.from(uR.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${i} or define customTags array`)}if(Array.isArray(n))for(let i of n)s=s.concat(i);else typeof n=="function"&&(s=n(s.slice()));return t&&(s=s.concat(hc.merge)),s.reduce((i,o)=>{let a=typeof o=="string"?dR[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(dR).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return i.includes(a)||i.push(a),i},[])}hy.coreKnownTags=z1;hy.getTags=H1});var gy=E(vR=>{"use strict";var py=_e(),K1=xo(),G1=Mo(),Y1=lc(),jf=bR(),J1=(n,e)=>n.key<e.key?-1:n.key>e.key?1:0,my=class n{constructor({compat:e,customTags:t,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?jf.getTags(e,"compat"):e?jf.getTags(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?jf.coreKnownTags:{},this.tags=jf.getTags(t,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,py.MAP,{value:K1.map}),Object.defineProperty(this,py.SCALAR,{value:Y1.string}),Object.defineProperty(this,py.SEQ,{value:G1.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?J1:null}clone(){let e=Object.create(n.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};vR.Schema=my});var SR=E(TR=>{"use strict";var X1=_e(),yy=ic(),pc=tc();function Q1(n,e){let t=[],r=e.directives===!0;if(e.directives!==!1&&n.directives){let c=n.directives.toString(n);c?(t.push(c),r=!0):n.directives.docStart&&(r=!0)}r&&t.push("---");let s=yy.createStringifyContext(n,e),{commentString:i}=s.options;if(n.commentBefore){t.length!==1&&t.unshift("");let c=i(n.commentBefore);t.unshift(pc.indentComment(c,""))}let o=!1,a=null;if(n.contents){if(X1.isNode(n.contents)){if(n.contents.spaceBefore&&r&&t.push(""),n.contents.commentBefore){let u=i(n.contents.commentBefore);t.push(pc.indentComment(u,""))}s.forceBlockIndent=!!n.comment,a=n.contents.comment}let c=a?void 0:()=>o=!0,l=yy.stringify(n.contents,s,()=>a=null,c);a&&(l+=pc.lineComment(l,"",i(a))),(l[0]==="|"||l[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${l}`:t.push(l)}else t.push(yy.stringify(n.contents,s));if(n.directives?.docEnd)if(n.comment){let c=i(n.comment);c.includes(`
91
- `)?(t.push("..."),t.push(pc.indentComment(c,""))):t.push(`... ${c}`)}else t.push("...");else{let c=n.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&t[t.length-1]!==""&&t.push(""),t.push(pc.indentComment(i(c),"")))}return t.join(`
90
+ ${i.comment}`:r.comment}r=s}t.items[n]=Bf.isPair(r)?r:new wy.Pair(r)}}else e("Expected a sequence for this tag");return t}function w0(t,e,n){let{replacer:r}=n,s=new Wq.YAMLSeq(t);s.tag="tag:yaml.org,2002:pairs";let i=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof r=="function"&&(o=r.call(e,String(i++),o));let a,c;if(Array.isArray(o))if(o.length===2)a=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let l=Object.keys(o);if(l.length===1)a=l[0],c=o[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=o;s.items.push(wy.createPair(a,c,n))}return s}var Hq={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:E0,createNode:w0};Uf.createPairs=w0;Uf.pairs=Hq;Uf.resolvePairs=E0});var Py=w(Ny=>{"use strict";var k0=ke(),ky=Ls(),vc=Us(),Gq=Vs(),N0=Vf(),ki=class t extends Gq.YAMLSeq{constructor(){super(),this.add=vc.YAMLMap.prototype.add.bind(this),this.delete=vc.YAMLMap.prototype.delete.bind(this),this.get=vc.YAMLMap.prototype.get.bind(this),this.has=vc.YAMLMap.prototype.has.bind(this),this.set=vc.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,n){if(!n)return super.toJSON(e);let r=new Map;n?.onCreate&&n.onCreate(r);for(let s of this.items){let i,o;if(k0.isPair(s)?(i=ky.toJS(s.key,"",n),o=ky.toJS(s.value,i,n)):i=ky.toJS(s,"",n),r.has(i))throw new Error("Ordered maps must not include duplicate keys");r.set(i,o)}return r}static from(e,n,r){let s=N0.createPairs(e,n,r),i=new this;return i.items=s.items,i}};ki.tag="tag:yaml.org,2002:omap";var Kq={collection:"seq",identify:t=>t instanceof Map,nodeClass:ki,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let n=N0.resolvePairs(t,e),r=[];for(let{key:s}of n.items)k0.isScalar(s)&&(r.includes(s.value)?e(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new ki,n)},createNode:(t,e,n)=>ki.from(t,e,n)};Ny.YAMLOMap=ki;Ny.omap=Kq});var A0=w(Ry=>{"use strict";var P0=Pt();function R0({value:t,source:e},n){return e&&(t?D0:C0).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}var D0={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new P0.Scalar(!0),stringify:R0},C0={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new P0.Scalar(!1),stringify:R0};Ry.falseTag=C0;Ry.trueTag=D0});var O0=w(zf=>{"use strict";var Yq=Pt(),Dy=Wo(),Xq={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Dy.stringifyNumber},Jq={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Dy.stringifyNumber(t)}},Qq={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new Yq.Scalar(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){let r=t.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:Dy.stringifyNumber};zf.float=Qq;zf.floatExp=Jq;zf.floatNaN=Xq});var x0=w(_c=>{"use strict";var I0=Wo(),Tc=t=>typeof t=="bigint"||Number.isInteger(t);function Wf(t,e,n,{intAsBigInt:r}){let s=t[0];if((s==="-"||s==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),r){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return s==="-"?BigInt(-1)*o:o}let i=parseInt(t,n);return s==="-"?-1*i:i}function Cy(t,e,n){let{value:r}=t;if(Tc(r)){let s=r.toString(e);return r<0?"-"+n+s.substr(1):n+s}return I0.stringifyNumber(t)}var Zq={identify:Tc,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>Wf(t,2,2,n),stringify:t=>Cy(t,2,"0b")},ej={identify:Tc,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>Wf(t,1,8,n),stringify:t=>Cy(t,8,"0")},tj={identify:Tc,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>Wf(t,0,10,n),stringify:I0.stringifyNumber},nj={identify:Tc,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>Wf(t,2,16,n),stringify:t=>Cy(t,16,"0x")};_c.int=tj;_c.intBin=Zq;_c.intHex=nj;_c.intOct=ej});var Oy=w(Ay=>{"use strict";var Kf=ke(),Hf=Fs(),Gf=Us(),Ni=class t extends Gf.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let n;Kf.isPair(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new Hf.Pair(e.key,null):n=new Hf.Pair(e,null),Gf.findPair(this.items,n.key)||this.items.push(n)}get(e,n){let r=Gf.findPair(this.items,e);return!n&&Kf.isPair(r)?Kf.isScalar(r.key)?r.key.value:r.key:r}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let r=Gf.findPair(this.items,e);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Hf.Pair(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(e,n,r){let{replacer:s}=r,i=new this(e);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof s=="function"&&(o=s.call(n,o,o)),i.items.push(Hf.createPair(o,null,r));return i}};Ni.tag="tag:yaml.org,2002:set";var rj={collection:"map",identify:t=>t instanceof Set,nodeClass:Ni,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>Ni.from(t,e,n),resolve(t,e){if(Kf.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Ni,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Ay.YAMLSet=Ni;Ay.set=rj});var xy=w(Yf=>{"use strict";var sj=Wo();function Iy(t,e){let n=t[0],r=n==="-"||n==="+"?t.substring(1):t,s=o=>e?BigInt(o):Number(o),i=r.replace(/_/g,"").split(":").reduce((o,a)=>o*s(60)+s(a),s(0));return n==="-"?s(-1)*i:i}function M0(t){let{value:e}=t,n=o=>o;if(typeof e=="bigint")n=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return sj.stringifyNumber(t);let r="";e<0&&(r="-",e*=n(-1));let s=n(60),i=[e%s];return e<60?i.unshift(0):(e=(e-i[0])/s,i.unshift(e%s),e>=60&&(e=(e-i[0])/s,i.unshift(e))),r+i.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var ij={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:n})=>Iy(t,n),stringify:M0},oj={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>Iy(t,!1),stringify:M0},L0={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(L0.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,r,s,i,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(n,r-1,s,i||0,o||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=Iy(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:t})=>t.toISOString().replace(/(T00:00:00)?\.000Z$/,"")};Yf.floatTime=oj;Yf.intTime=ij;Yf.timestamp=L0});var j0=w(q0=>{"use strict";var aj=Vo(),cj=Lf(),lj=zo(),uj=bc(),dj=Ey(),$0=A0(),My=O0(),Xf=x0(),fj=Rf(),hj=Py(),pj=Vf(),mj=Oy(),Ly=xy(),gj=[aj.map,lj.seq,uj.string,cj.nullTag,$0.trueTag,$0.falseTag,Xf.intBin,Xf.intOct,Xf.int,Xf.intHex,My.floatNaN,My.floatExp,My.float,dj.binary,fj.merge,hj.omap,pj.pairs,mj.set,Ly.intTime,Ly.floatTime,Ly.timestamp];q0.schema=gj});var Y0=w(jy=>{"use strict";var V0=Vo(),yj=Lf(),z0=zo(),bj=bc(),vj=my(),$y=yy(),qy=vy(),Tj=b0(),_j=_0(),W0=Ey(),Sc=Rf(),H0=Py(),G0=Vf(),F0=j0(),K0=Oy(),Jf=xy(),B0=new Map([["core",Tj.schema],["failsafe",[V0.map,z0.seq,bj.string]],["json",_j.schema],["yaml11",F0.schema],["yaml-1.1",F0.schema]]),U0={binary:W0.binary,bool:vj.boolTag,float:$y.float,floatExp:$y.floatExp,floatNaN:$y.floatNaN,floatTime:Jf.floatTime,int:qy.int,intHex:qy.intHex,intOct:qy.intOct,intTime:Jf.intTime,map:V0.map,merge:Sc.merge,null:yj.nullTag,omap:H0.omap,pairs:G0.pairs,seq:z0.seq,set:K0.set,timestamp:Jf.timestamp},Sj={"tag:yaml.org,2002:binary":W0.binary,"tag:yaml.org,2002:merge":Sc.merge,"tag:yaml.org,2002:omap":H0.omap,"tag:yaml.org,2002:pairs":G0.pairs,"tag:yaml.org,2002:set":K0.set,"tag:yaml.org,2002:timestamp":Jf.timestamp};function Ej(t,e,n){let r=B0.get(e);if(r&&!t)return n&&!r.includes(Sc.merge)?r.concat(Sc.merge):r.slice();let s=r;if(!s)if(Array.isArray(t))s=[];else{let i=Array.from(B0.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${i} or define customTags array`)}if(Array.isArray(t))for(let i of t)s=s.concat(i);else typeof t=="function"&&(s=t(s.slice()));return n&&(s=s.concat(Sc.merge)),s.reduce((i,o)=>{let a=typeof o=="string"?U0[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(U0).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return i.includes(a)||i.push(a),i},[])}jy.coreKnownTags=Sj;jy.getTags=Ej});var Uy=w(X0=>{"use strict";var Fy=ke(),wj=Vo(),kj=zo(),Nj=bc(),Qf=Y0(),Pj=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,By=class t{constructor({compat:e,customTags:n,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Qf.getTags(e,"compat"):e?Qf.getTags(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?Qf.coreKnownTags:{},this.tags=Qf.getTags(n,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,Fy.MAP,{value:wj.map}),Object.defineProperty(this,Fy.SCALAR,{value:Nj.string}),Object.defineProperty(this,Fy.SEQ,{value:kj.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Pj:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};X0.Schema=By});var Q0=w(J0=>{"use strict";var Rj=ke(),Vy=pc(),Ec=uc();function Dj(t,e){let n=[],r=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(n.push(c),r=!0):t.directives.docStart&&(r=!0)}r&&n.push("---");let s=Vy.createStringifyContext(t,e),{commentString:i}=s.options;if(t.commentBefore){n.length!==1&&n.unshift("");let c=i(t.commentBefore);n.unshift(Ec.indentComment(c,""))}let o=!1,a=null;if(t.contents){if(Rj.isNode(t.contents)){if(t.contents.spaceBefore&&r&&n.push(""),t.contents.commentBefore){let u=i(t.contents.commentBefore);n.push(Ec.indentComment(u,""))}s.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>o=!0,l=Vy.stringify(t.contents,s,()=>a=null,c);a&&(l+=Ec.lineComment(l,"",i(a))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(Vy.stringify(t.contents,s));if(t.directives?.docEnd)if(t.comment){let c=i(t.comment);c.includes(`
91
+ `)?(n.push("..."),n.push(Ec.indentComment(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=t.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push(Ec.indentComment(i(c),"")))}return n.join(`
92
92
  `)+`
93
- `}TR.stringifyDocument=Q1});var mc=E(_R=>{"use strict";var Z1=Za(),Lo=of(),zn=_e(),eq=xs(),tq=Cs(),nq=gy(),rq=SR(),by=ef(),sq=_g(),iq=ec(),vy=Sg(),Ty=class n{constructor(e,t,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,zn.NODE_TYPE,{value:zn.DOC});let s=null;typeof t=="function"||Array.isArray(t)?s=t:r===void 0&&t&&(r=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=i;let{version:o}=i;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new vy.Directives({version:o}),this.setSchema(o,r),this.contents=e===void 0?null:this.createNode(e,s,r)}clone(){let e=Object.create(n.prototype,{[zn.NODE_TYPE]:{value:zn.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=zn.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){qo(this.contents)&&this.contents.add(e)}addIn(e,t){qo(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let r=by.anchorNames(this);e.anchor=!t||r.has(t)?by.findNewAnchor(t||"a",r):t}return new Z1.Alias(e.anchor)}createNode(e,t,r){let s;if(typeof t=="function")e=t.call({"":e},"",e),s=t;else if(Array.isArray(t)){let S=T=>typeof T=="number"||T instanceof String||T instanceof Number,w=t.filter(S).map(String);w.length>0&&(t=t.concat(w)),s=t}else r===void 0&&t&&(r=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:l,tag:u}=r??{},{onAnchor:d,setAnchors:f,sourceObjects:p}=by.createNodeAnchors(this,o||"a"),y={aliasDuplicateObjects:i??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:s,schema:this.schema,sourceObjects:p},m=iq.createNode(e,u,y);return a&&zn.isCollection(m)&&(m.flow=!0),f(),m}createPair(e,t,r={}){let s=this.createNode(e,null,r),i=this.createNode(t,null,r);return new eq.Pair(s,i)}delete(e){return qo(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Lo.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):qo(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return zn.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Lo.isEmptyPath(e)?!t&&zn.isScalar(this.contents)?this.contents.value:this.contents:zn.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return zn.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Lo.isEmptyPath(e)?this.contents!==void 0:zn.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Lo.collectionFromPath(this.schema,[e],t):qo(this.contents)&&this.contents.set(e,t)}setIn(e,t){Lo.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=Lo.collectionFromPath(this.schema,Array.from(e),t):qo(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let r;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new vy.Directives({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new vy.Directives({version:e}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{let s=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${s}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(r)this.schema=new nq.Schema(Object.assign(r,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:r,maxAliasCount:s,onAnchor:i,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},c=tq.toJS(this.contents,t??"",a);if(typeof i=="function")for(let{count:l,res:u}of a.anchors.values())i(u,l);return typeof o=="function"?sq.applyReviver(o,{"":c},"",c):c}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return rq.stringifyDocument(this,e)}};function qo(n){if(zn.isCollection(n))return!0;throw new Error("Expected a YAML collection as document contents")}_R.Document=Ty});var bc=E(yc=>{"use strict";var gc=class extends Error{constructor(e,t,r,s){super(),this.name=e,this.code=r,this.message=s,this.pos=t}},Sy=class extends gc{constructor(e,t,r){super("YAMLParseError",e,t,r)}},_y=class extends gc{constructor(e,t,r){super("YAMLWarning",e,t,r)}},oq=(n,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));let{line:r,col:s}=t.linePos[0];t.message+=` at line ${r}, column ${s}`;let i=s-1,o=n.substring(e.lineStarts[r-1],e.lineStarts[r]).replace(/[\n\r]+$/,"");if(i>=60&&o.length>80){let a=Math.min(i-39,o.length-79);o="\u2026"+o.substring(a),i-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),r>1&&/^ *$/.test(o.substring(0,i))){let a=n.substring(e.lineStarts[r-2],e.lineStarts[r-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
94
- `),o=a+o}if(/[^ ]/.test(o)){let a=1,c=t.linePos[1];c&&c.line===r&&c.col>s&&(a=Math.max(1,Math.min(c.col-s,80-i)));let l=" ".repeat(i)+"^".repeat(a);t.message+=`:
93
+ `}J0.stringifyDocument=Dj});var wc=w(Z0=>{"use strict";var Cj=cc(),Ho=vf(),Gn=ke(),Aj=Fs(),Oj=Ls(),Ij=Uy(),xj=Q0(),zy=pf(),Mj=Kg(),Lj=lc(),Wy=Gg(),Hy=class t{constructor(e,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Gn.NODE_TYPE,{value:Gn.DOC});let s=null;typeof n=="function"||Array.isArray(n)?s=n:r===void 0&&n&&(r=n,n=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=i;let{version:o}=i;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Wy.Directives({version:o}),this.setSchema(o,r),this.contents=e===void 0?null:this.createNode(e,s,r)}clone(){let e=Object.create(t.prototype,{[Gn.NODE_TYPE]:{value:Gn.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Gn.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Go(this.contents)&&this.contents.add(e)}addIn(e,n){Go(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){let r=zy.anchorNames(this);e.anchor=!n||r.has(n)?zy.findNewAnchor(n||"a",r):n}return new Cj.Alias(e.anchor)}createNode(e,n,r){let s;if(typeof n=="function")e=n.call({"":e},"",e),s=n;else if(Array.isArray(n)){let _=T=>typeof T=="number"||T instanceof String||T instanceof Number,E=n.filter(_).map(String);E.length>0&&(n=n.concat(E)),s=n}else r===void 0&&n&&(r=n,n=void 0);let{aliasDuplicateObjects:i,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:l,tag:u}=r??{},{onAnchor:d,setAnchors:f,sourceObjects:h}=zy.createNodeAnchors(this,o||"a"),y={aliasDuplicateObjects:i??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:s,schema:this.schema,sourceObjects:h},m=Lj.createNode(e,u,y);return a&&Gn.isCollection(m)&&(m.flow=!0),f(),m}createPair(e,n,r={}){let s=this.createNode(e,null,r),i=this.createNode(n,null,r);return new Aj.Pair(s,i)}delete(e){return Go(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Ho.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Go(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return Gn.isCollection(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return Ho.isEmptyPath(e)?!n&&Gn.isScalar(this.contents)?this.contents.value:this.contents:Gn.isCollection(this.contents)?this.contents.getIn(e,n):void 0}has(e){return Gn.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Ho.isEmptyPath(e)?this.contents!==void 0:Gn.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=Ho.collectionFromPath(this.schema,[e],n):Go(this.contents)&&this.contents.set(e,n)}setIn(e,n){Ho.isEmptyPath(e)?this.contents=n:this.contents==null?this.contents=Ho.collectionFromPath(this.schema,Array.from(e),n):Go(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let r;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Wy.Directives({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Wy.Directives({version:e}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{let s=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${s}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new Ij.Schema(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:r,maxAliasCount:s,onAnchor:i,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},c=Oj.toJS(this.contents,n??"",a);if(typeof i=="function")for(let{count:l,res:u}of a.anchors.values())i(u,l);return typeof o=="function"?Mj.applyReviver(o,{"":c},"",c):c}toJSON(e,n){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:n})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let n=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return xj.stringifyDocument(this,e)}};function Go(t){if(Gn.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}Z0.Document=Hy});var Pc=w(Nc=>{"use strict";var kc=class extends Error{constructor(e,n,r,s){super(),this.name=e,this.code=r,this.message=s,this.pos=n}},Gy=class extends kc{constructor(e,n,r){super("YAMLParseError",e,n,r)}},Ky=class extends kc{constructor(e,n,r){super("YAMLWarning",e,n,r)}},$j=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>e.linePos(a));let{line:r,col:s}=n.linePos[0];n.message+=` at line ${r}, column ${s}`;let i=s-1,o=t.substring(e.lineStarts[r-1],e.lineStarts[r]).replace(/[\n\r]+$/,"");if(i>=60&&o.length>80){let a=Math.min(i-39,o.length-79);o="\u2026"+o.substring(a),i-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),r>1&&/^ *$/.test(o.substring(0,i))){let a=t.substring(e.lineStarts[r-2],e.lineStarts[r-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
94
+ `),o=a+o}if(/[^ ]/.test(o)){let a=1,c=n.linePos[1];c&&c.line===r&&c.col>s&&(a=Math.max(1,Math.min(c.col-s,80-i)));let l=" ".repeat(i)+"^".repeat(a);n.message+=`:
95
95
 
96
96
  ${o}
97
97
  ${l}
98
- `}};yc.YAMLError=gc;yc.YAMLParseError=Sy;yc.YAMLWarning=_y;yc.prettifyError=oq});var vc=E(ER=>{"use strict";function aq(n,{flow:e,indicator:t,next:r,offset:s,onError:i,parentIndent:o,startOnNewline:a}){let c=!1,l=a,u=a,d="",f="",p=!1,y=!1,m=null,S=null,w=null,T=null,v=null,R=null,A=null;for(let j of n)switch(y&&(j.type!=="space"&&j.type!=="newline"&&j.type!=="comma"&&i(j.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),m&&(l&&j.type!=="comment"&&j.type!=="newline"&&i(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),j.type){case"space":!e&&(t!=="doc-start"||r?.type!=="flow-collection")&&j.source.includes(" ")&&(m=j),u=!0;break;case"comment":{u||i(j,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let ie=j.source.substring(1)||" ";d?d+=f+ie:d=ie,f="",l=!1;break}case"newline":l?d?d+=j.source:c=!0:f+=j.source,l=!0,p=!0,(S||w)&&(T=j),u=!0;break;case"anchor":S&&i(j,"MULTIPLE_ANCHORS","A node can have at most one anchor"),j.source.endsWith(":")&&i(j.offset+j.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),S=j,A===null&&(A=j.offset),l=!1,u=!1,y=!0;break;case"tag":{w&&i(j,"MULTIPLE_TAGS","A node can have at most one tag"),w=j,A===null&&(A=j.offset),l=!1,u=!1,y=!0;break}case t:(S||w)&&i(j,"BAD_PROP_ORDER",`Anchors and tags must be after the ${j.source} indicator`),R&&i(j,"UNEXPECTED_TOKEN",`Unexpected ${j.source} in ${e??"collection"}`),R=j,l=t==="seq-item-ind"||t==="explicit-key-ind",u=!1;break;case"comma":if(e){v&&i(j,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),v=j,l=!1,u=!1;break}default:i(j,"UNEXPECTED_TOKEN",`Unexpected ${j.type} token`),l=!1,u=!1}let M=n[n.length-1],z=M?M.offset+M.source.length:s;return y&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&i(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(l&&m.indent<=o||r?.type==="block-map"||r?.type==="block-seq")&&i(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:v,found:R,spaceBefore:c,comment:d,hasNewline:p,anchor:S,tag:w,newlineAfterProp:T,end:z,start:A??z}}ER.resolveProps=aq});var Ff=E(wR=>{"use strict";function Ey(n){if(!n)return null;switch(n.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(n.source.includes(`
99
- `))return!0;if(n.end){for(let e of n.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of n.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(Ey(e.key)||Ey(e.value))return!0}return!1;default:return!0}}wR.containsNewline=Ey});var wy=E(kR=>{"use strict";var cq=Ff();function lq(n,e,t){if(e?.type==="flow-collection"){let r=e.end[0];r.indent===n&&(r.source==="]"||r.source==="}")&&cq.containsNewline(e)&&t(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}kR.flowIndentCheck=lq});var ky=E(PR=>{"use strict";var NR=_e();function uq(n,e,t){let{uniqueKeys:r}=n.options;if(r===!1)return!1;let s=typeof r=="function"?r:(i,o)=>i===o||NR.isScalar(i)&&NR.isScalar(o)&&i.value===o.value;return e.some(i=>s(i.key,t))}PR.mapIncludes=uq});var IR=E(OR=>{"use strict";var RR=xs(),dq=$s(),DR=vc(),fq=Ff(),CR=wy(),hq=ky(),AR="All mapping items must start at the same column";function pq({composeNode:n,composeEmptyNode:e},t,r,s,i){let o=i?.nodeClass??dq.YAMLMap,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let c=r.offset,l=null;for(let u of r.items){let{start:d,key:f,sep:p,value:y}=u,m=DR.resolveProps(d,{indicator:"explicit-key-ind",next:f??p?.[0],offset:c,onError:s,parentIndent:r.indent,startOnNewline:!0}),S=!m.found;if(S){if(f&&(f.type==="block-seq"?s(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==r.indent&&s(c,"BAD_INDENT",AR)),!m.anchor&&!m.tag&&!p){l=m.end,m.comment&&(a.comment?a.comment+=`
100
- `+m.comment:a.comment=m.comment);continue}(m.newlineAfterProp||fq.containsNewline(f))&&s(f??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else m.found?.indent!==r.indent&&s(c,"BAD_INDENT",AR);t.atKey=!0;let w=m.end,T=f?n(t,f,m,s):e(t,w,d,null,m,s);t.schema.compat&&CR.flowIndentCheck(r.indent,f,s),t.atKey=!1,hq.mapIncludes(t,a.items,T)&&s(w,"DUPLICATE_KEY","Map keys must be unique");let v=DR.resolveProps(p??[],{indicator:"map-value-ind",next:y,offset:T.range[2],onError:s,parentIndent:r.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=v.end,v.found){S&&(y?.type==="block-map"&&!v.hasNewline&&s(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&m.start<v.found.offset-1024&&s(T.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let R=y?n(t,y,v,s):e(t,c,p,null,v,s);t.schema.compat&&CR.flowIndentCheck(r.indent,y,s),c=R.range[2];let A=new RR.Pair(T,R);t.options.keepSourceTokens&&(A.srcToken=u),a.items.push(A)}else{S&&s(T.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),v.comment&&(T.comment?T.comment+=`
101
- `+v.comment:T.comment=v.comment);let R=new RR.Pair(T);t.options.keepSourceTokens&&(R.srcToken=u),a.items.push(R)}}return l&&l<c&&s(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[r.offset,c,l??c],a}OR.resolveBlockMap=pq});var MR=E(xR=>{"use strict";var mq=Ls(),gq=vc(),yq=wy();function bq({composeNode:n,composeEmptyNode:e},t,r,s,i){let o=i?.nodeClass??mq.YAMLSeq,a=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let c=r.offset,l=null;for(let{start:u,value:d}of r.items){let f=gq.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:s,parentIndent:r.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||d)d&&d.type==="block-seq"?s(f.end,"BAD_INDENT","All sequence items must start at the same column"):s(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(a.comment=f.comment);continue}let p=d?n(t,d,f,s):e(t,f.end,u,null,f,s);t.schema.compat&&yq.flowIndentCheck(r.indent,d,s),c=p.range[2],a.items.push(p)}return a.range=[r.offset,c,l??c],a}xR.resolveBlockSeq=bq});var jo=E($R=>{"use strict";function vq(n,e,t,r){let s="";if(n){let i=!1,o="";for(let a of n){let{source:c,type:l}=a;switch(l){case"space":i=!0;break;case"comment":{t&&!i&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";s?s+=o+u:s=u,o="";break}case"newline":s&&(o+=c),i=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:s,offset:e}}$R.resolveEnd=vq});var FR=E(jR=>{"use strict";var Tq=_e(),Sq=xs(),LR=$s(),_q=Ls(),Eq=jo(),qR=vc(),wq=Ff(),kq=ky(),Ny="Block collections are not allowed within flow collections",Py=n=>n&&(n.type==="block-map"||n.type==="block-seq");function Nq({composeNode:n,composeEmptyNode:e},t,r,s,i){let o=r.start.source==="{",a=o?"flow map":"flow sequence",c=i?.nodeClass??(o?LR.YAMLMap:_q.YAMLSeq),l=new c(t.schema);l.flow=!0;let u=t.atRoot;u&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let d=r.offset+r.start.source.length;for(let S=0;S<r.items.length;++S){let w=r.items[S],{start:T,key:v,sep:R,value:A}=w,M=qR.resolveProps(T,{flow:a,indicator:"explicit-key-ind",next:v??R?.[0],offset:d,onError:s,parentIndent:r.indent,startOnNewline:!1});if(!M.found){if(!M.anchor&&!M.tag&&!R&&!A){S===0&&M.comma?s(M.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):S<r.items.length-1&&s(M.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),M.comment&&(l.comment?l.comment+=`
102
- `+M.comment:l.comment=M.comment),d=M.end;continue}!o&&t.options.strict&&wq.containsNewline(v)&&s(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(S===0)M.comma&&s(M.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(M.comma||s(M.start,"MISSING_CHAR",`Missing , between ${a} items`),M.comment){let z="";e:for(let j of T)switch(j.type){case"comma":case"space":break;case"comment":z=j.source.substring(1);break e;default:break e}if(z){let j=l.items[l.items.length-1];Tq.isPair(j)&&(j=j.value??j.key),j.comment?j.comment+=`
103
- `+z:j.comment=z,M.comment=M.comment.substring(z.length+1)}}if(!o&&!R&&!M.found){let z=A?n(t,A,M,s):e(t,M.end,R,null,M,s);l.items.push(z),d=z.range[2],Py(A)&&s(z.range,"BLOCK_IN_FLOW",Ny)}else{t.atKey=!0;let z=M.end,j=v?n(t,v,M,s):e(t,z,T,null,M,s);Py(v)&&s(j.range,"BLOCK_IN_FLOW",Ny),t.atKey=!1;let ie=qR.resolveProps(R??[],{flow:a,indicator:"map-value-ind",next:A,offset:j.range[2],onError:s,parentIndent:r.indent,startOnNewline:!1});if(ie.found){if(!o&&!M.found&&t.options.strict){if(R)for(let pe of R){if(pe===ie.found)break;if(pe.type==="newline"){s(pe,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}M.start<ie.found.offset-1024&&s(ie.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else A&&("source"in A&&A.source&&A.source[0]===":"?s(A,"MISSING_CHAR",`Missing space after : in ${a}`):s(ie.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let Le=A?n(t,A,ie,s):ie.found?e(t,ie.end,R,null,ie,s):null;Le?Py(A)&&s(Le.range,"BLOCK_IN_FLOW",Ny):ie.comment&&(j.comment?j.comment+=`
104
- `+ie.comment:j.comment=ie.comment);let wt=new Sq.Pair(j,Le);if(t.options.keepSourceTokens&&(wt.srcToken=w),o){let pe=l;kq.mapIncludes(t,pe.items,j)&&s(z,"DUPLICATE_KEY","Map keys must be unique"),pe.items.push(wt)}else{let pe=new LR.YAMLMap(t.schema);pe.flow=!0,pe.items.push(wt);let Ln=(Le??j).range;pe.range=[j.range[0],Ln[1],Ln[2]],l.items.push(pe)}d=Le?Le.range[2]:ie.end}}let f=o?"}":"]",[p,...y]=r.end,m=d;if(p&&p.source===f)m=p.offset+p.source.length;else{let S=a[0].toUpperCase()+a.substring(1),w=u?`${S} must end with a ${f}`:`${S} in block collection must be sufficiently indented and end with a ${f}`;s(d,u?"MISSING_CHAR":"BAD_INDENT",w),p&&p.source.length!==1&&y.unshift(p)}if(y.length>0){let S=Eq.resolveEnd(y,m,t.options.strict,s);S.comment&&(l.comment?l.comment+=`
105
- `+S.comment:l.comment=S.comment),l.range=[r.offset,m,S.offset]}else l.range=[r.offset,m,m];return l}jR.resolveFlowCollection=Nq});var UR=E(BR=>{"use strict";var Pq=_e(),Rq=Et(),Dq=$s(),Cq=Ls(),Aq=IR(),Oq=MR(),Iq=FR();function Ry(n,e,t,r,s,i){let o=t.type==="block-map"?Aq.resolveBlockMap(n,e,t,r,i):t.type==="block-seq"?Oq.resolveBlockSeq(n,e,t,r,i):Iq.resolveFlowCollection(n,e,t,r,i),a=o.constructor;return s==="!"||s===a.tagName?(o.tag=a.tagName,o):(s&&(o.tag=s),o)}function xq(n,e,t,r,s){let i=r.tag,o=i?e.directives.tagName(i.source,f=>s(i,"TAG_RESOLVE_FAILED",f)):null;if(t.type==="block-seq"){let{anchor:f,newlineAfterProp:p}=r,y=f&&i?f.offset>i.offset?f:i:f??i;y&&(!p||p.offset<y.offset)&&s(y,"MISSING_CHAR","Missing newline after block sequence props")}let a=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!i||!o||o==="!"||o===Dq.YAMLMap.tagName&&a==="map"||o===Cq.YAMLSeq.tagName&&a==="seq")return Ry(n,e,t,s,o);let c=e.schema.tags.find(f=>f.tag===o&&f.collection===a);if(!c){let f=e.schema.knownTags[o];if(f&&f.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else return f?.collection?s(i,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection}`,!0):s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Ry(n,e,t,s,o)}let l=Ry(n,e,t,s,o,c),u=c.resolve?.(l,f=>s(i,"TAG_RESOLVE_FAILED",f),e.options)??l,d=Pq.isNode(u)?u:new Rq.Scalar(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}BR.composeCollection=xq});var Cy=E(VR=>{"use strict";var Dy=Et();function Mq(n,e,t){let r=e.offset,s=$q(e,n.options.strict,t);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};let i=s.mode===">"?Dy.Scalar.BLOCK_FOLDED:Dy.Scalar.BLOCK_LITERAL,o=e.source?Lq(e.source):[],a=o.length;for(let m=o.length-1;m>=0;--m){let S=o[m][1];if(S===""||S==="\r")a=m;else break}if(a===0){let m=s.chomp==="+"&&o.length>0?`
106
- `.repeat(Math.max(1,o.length-1)):"",S=r+s.length;return e.source&&(S+=e.source.length),{value:m,type:i,comment:s.comment,range:[r,S,S]}}let c=e.indent+s.indent,l=e.offset+s.length,u=0;for(let m=0;m<a;++m){let[S,w]=o[m];if(w===""||w==="\r")s.indent===0&&S.length>c&&(c=S.length);else{S.length<c&&t(l+S.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),s.indent===0&&(c=S.length),u=m,c===0&&!n.atRoot&&t(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=S.length+w.length+1}for(let m=o.length-1;m>=a;--m)o[m][0].length>c&&(a=m+1);let d="",f="",p=!1;for(let m=0;m<u;++m)d+=o[m][0].slice(c)+`
107
- `;for(let m=u;m<a;++m){let[S,w]=o[m];l+=S.length+w.length+1;let T=w[w.length-1]==="\r";if(T&&(w=w.slice(0,-1)),w&&S.length<c){let R=`Block scalar lines must not be less indented than their ${s.indent?"explicit indentation indicator":"first line"}`;t(l-w.length-(T?2:1),"BAD_INDENT",R),S=""}i===Dy.Scalar.BLOCK_LITERAL?(d+=f+S.slice(c)+w,f=`
108
- `):S.length>c||w[0]===" "?(f===" "?f=`
109
- `:!p&&f===`
98
+ `}};Nc.YAMLError=kc;Nc.YAMLParseError=Gy;Nc.YAMLWarning=Ky;Nc.prettifyError=$j});var Rc=w(eD=>{"use strict";function qj(t,{flow:e,indicator:n,next:r,offset:s,onError:i,parentIndent:o,startOnNewline:a}){let c=!1,l=a,u=a,d="",f="",h=!1,y=!1,m=null,_=null,E=null,T=null,b=null,R=null,D=null;for(let U of t)switch(y&&(U.type!=="space"&&U.type!=="newline"&&U.type!=="comma"&&i(U.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),m&&(l&&U.type!=="comment"&&U.type!=="newline"&&i(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),U.type){case"space":!e&&(n!=="doc-start"||r?.type!=="flow-collection")&&U.source.includes(" ")&&(m=U),u=!0;break;case"comment":{u||i(U,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let oe=U.source.substring(1)||" ";d?d+=f+oe:d=oe,f="",l=!1;break}case"newline":l?d?d+=U.source:c=!0:f+=U.source,l=!0,h=!0,(_||E)&&(T=U),u=!0;break;case"anchor":_&&i(U,"MULTIPLE_ANCHORS","A node can have at most one anchor"),U.source.endsWith(":")&&i(U.offset+U.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),_=U,D===null&&(D=U.offset),l=!1,u=!1,y=!0;break;case"tag":{E&&i(U,"MULTIPLE_TAGS","A node can have at most one tag"),E=U,D===null&&(D=U.offset),l=!1,u=!1,y=!0;break}case n:(_||E)&&i(U,"BAD_PROP_ORDER",`Anchors and tags must be after the ${U.source} indicator`),R&&i(U,"UNEXPECTED_TOKEN",`Unexpected ${U.source} in ${e??"collection"}`),R=U,l=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(e){b&&i(U,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),b=U,l=!1,u=!1;break}default:i(U,"UNEXPECTED_TOKEN",`Unexpected ${U.type} token`),l=!1,u=!1}let L=t[t.length-1],H=L?L.offset+L.source.length:s;return y&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&i(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(l&&m.indent<=o||r?.type==="block-map"||r?.type==="block-seq")&&i(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:R,spaceBefore:c,comment:d,hasNewline:h,anchor:_,tag:E,newlineAfterProp:T,end:H,start:D??H}}eD.resolveProps=qj});var Zf=w(tD=>{"use strict";function Yy(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
99
+ `))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let n of e.start)if(n.type==="newline")return!0;if(e.sep){for(let n of e.sep)if(n.type==="newline")return!0}if(Yy(e.key)||Yy(e.value))return!0}return!1;default:return!0}}tD.containsNewline=Yy});var Xy=w(nD=>{"use strict";var jj=Zf();function Fj(t,e,n){if(e?.type==="flow-collection"){let r=e.end[0];r.indent===t&&(r.source==="]"||r.source==="}")&&jj.containsNewline(e)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}nD.flowIndentCheck=Fj});var Jy=w(sD=>{"use strict";var rD=ke();function Bj(t,e,n){let{uniqueKeys:r}=t.options;if(r===!1)return!1;let s=typeof r=="function"?r:(i,o)=>i===o||rD.isScalar(i)&&rD.isScalar(o)&&i.value===o.value;return e.some(i=>s(i.key,n))}sD.mapIncludes=Bj});var uD=w(lD=>{"use strict";var iD=Fs(),Uj=Us(),oD=Rc(),Vj=Zf(),aD=Xy(),zj=Jy(),cD="All mapping items must start at the same column";function Wj({composeNode:t,composeEmptyNode:e},n,r,s,i){let o=i?.nodeClass??Uj.YAMLMap,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let c=r.offset,l=null;for(let u of r.items){let{start:d,key:f,sep:h,value:y}=u,m=oD.resolveProps(d,{indicator:"explicit-key-ind",next:f??h?.[0],offset:c,onError:s,parentIndent:r.indent,startOnNewline:!0}),_=!m.found;if(_){if(f&&(f.type==="block-seq"?s(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==r.indent&&s(c,"BAD_INDENT",cD)),!m.anchor&&!m.tag&&!h){l=m.end,m.comment&&(a.comment?a.comment+=`
100
+ `+m.comment:a.comment=m.comment);continue}(m.newlineAfterProp||Vj.containsNewline(f))&&s(f??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else m.found?.indent!==r.indent&&s(c,"BAD_INDENT",cD);n.atKey=!0;let E=m.end,T=f?t(n,f,m,s):e(n,E,d,null,m,s);n.schema.compat&&aD.flowIndentCheck(r.indent,f,s),n.atKey=!1,zj.mapIncludes(n,a.items,T)&&s(E,"DUPLICATE_KEY","Map keys must be unique");let b=oD.resolveProps(h??[],{indicator:"map-value-ind",next:y,offset:T.range[2],onError:s,parentIndent:r.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=b.end,b.found){_&&(y?.type==="block-map"&&!b.hasNewline&&s(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&m.start<b.found.offset-1024&&s(T.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let R=y?t(n,y,b,s):e(n,c,h,null,b,s);n.schema.compat&&aD.flowIndentCheck(r.indent,y,s),c=R.range[2];let D=new iD.Pair(T,R);n.options.keepSourceTokens&&(D.srcToken=u),a.items.push(D)}else{_&&s(T.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),b.comment&&(T.comment?T.comment+=`
101
+ `+b.comment:T.comment=b.comment);let R=new iD.Pair(T);n.options.keepSourceTokens&&(R.srcToken=u),a.items.push(R)}}return l&&l<c&&s(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[r.offset,c,l??c],a}lD.resolveBlockMap=Wj});var fD=w(dD=>{"use strict";var Hj=Vs(),Gj=Rc(),Kj=Xy();function Yj({composeNode:t,composeEmptyNode:e},n,r,s,i){let o=i?.nodeClass??Hj.YAMLSeq,a=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=r.offset,l=null;for(let{start:u,value:d}of r.items){let f=Gj.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:s,parentIndent:r.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||d)d&&d.type==="block-seq"?s(f.end,"BAD_INDENT","All sequence items must start at the same column"):s(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(a.comment=f.comment);continue}let h=d?t(n,d,f,s):e(n,f.end,u,null,f,s);n.schema.compat&&Kj.flowIndentCheck(r.indent,d,s),c=h.range[2],a.items.push(h)}return a.range=[r.offset,c,l??c],a}dD.resolveBlockSeq=Yj});var Ko=w(hD=>{"use strict";function Xj(t,e,n,r){let s="";if(t){let i=!1,o="";for(let a of t){let{source:c,type:l}=a;switch(l){case"space":i=!0;break;case"comment":{n&&!i&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";s?s+=o+u:s=u,o="";break}case"newline":s&&(o+=c),i=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:s,offset:e}}hD.resolveEnd=Xj});var yD=w(gD=>{"use strict";var Jj=ke(),Qj=Fs(),pD=Us(),Zj=Vs(),eF=Ko(),mD=Rc(),tF=Zf(),nF=Jy(),Qy="Block collections are not allowed within flow collections",Zy=t=>t&&(t.type==="block-map"||t.type==="block-seq");function rF({composeNode:t,composeEmptyNode:e},n,r,s,i){let o=r.start.source==="{",a=o?"flow map":"flow sequence",c=i?.nodeClass??(o?pD.YAMLMap:Zj.YAMLSeq),l=new c(n.schema);l.flow=!0;let u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=r.offset+r.start.source.length;for(let _=0;_<r.items.length;++_){let E=r.items[_],{start:T,key:b,sep:R,value:D}=E,L=mD.resolveProps(T,{flow:a,indicator:"explicit-key-ind",next:b??R?.[0],offset:d,onError:s,parentIndent:r.indent,startOnNewline:!1});if(!L.found){if(!L.anchor&&!L.tag&&!R&&!D){_===0&&L.comma?s(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):_<r.items.length-1&&s(L.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),L.comment&&(l.comment?l.comment+=`
102
+ `+L.comment:l.comment=L.comment),d=L.end;continue}!o&&n.options.strict&&tF.containsNewline(b)&&s(b,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(_===0)L.comma&&s(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(L.comma||s(L.start,"MISSING_CHAR",`Missing , between ${a} items`),L.comment){let H="";e:for(let U of T)switch(U.type){case"comma":case"space":break;case"comment":H=U.source.substring(1);break e;default:break e}if(H){let U=l.items[l.items.length-1];Jj.isPair(U)&&(U=U.value??U.key),U.comment?U.comment+=`
103
+ `+H:U.comment=H,L.comment=L.comment.substring(H.length+1)}}if(!o&&!R&&!L.found){let H=D?t(n,D,L,s):e(n,L.end,R,null,L,s);l.items.push(H),d=H.range[2],Zy(D)&&s(H.range,"BLOCK_IN_FLOW",Qy)}else{n.atKey=!0;let H=L.end,U=b?t(n,b,L,s):e(n,H,T,null,L,s);Zy(b)&&s(U.range,"BLOCK_IN_FLOW",Qy),n.atKey=!1;let oe=mD.resolveProps(R??[],{flow:a,indicator:"map-value-ind",next:D,offset:U.range[2],onError:s,parentIndent:r.indent,startOnNewline:!1});if(oe.found){if(!o&&!L.found&&n.options.strict){if(R)for(let me of R){if(me===oe.found)break;if(me.type==="newline"){s(me,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}L.start<oe.found.offset-1024&&s(oe.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else D&&("source"in D&&D.source&&D.source[0]===":"?s(D,"MISSING_CHAR",`Missing space after : in ${a}`):s(oe.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let Be=D?t(n,D,oe,s):oe.found?e(n,oe.end,R,null,oe,s):null;Be?Zy(D)&&s(Be.range,"BLOCK_IN_FLOW",Qy):oe.comment&&(U.comment?U.comment+=`
104
+ `+oe.comment:U.comment=oe.comment);let Rt=new Qj.Pair(U,Be);if(n.options.keepSourceTokens&&(Rt.srcToken=E),o){let me=l;nF.mapIncludes(n,me.items,U)&&s(H,"DUPLICATE_KEY","Map keys must be unique"),me.items.push(Rt)}else{let me=new pD.YAMLMap(n.schema);me.flow=!0,me.items.push(Rt);let Fn=(Be??U).range;me.range=[U.range[0],Fn[1],Fn[2]],l.items.push(me)}d=Be?Be.range[2]:oe.end}}let f=o?"}":"]",[h,...y]=r.end,m=d;if(h&&h.source===f)m=h.offset+h.source.length;else{let _=a[0].toUpperCase()+a.substring(1),E=u?`${_} must end with a ${f}`:`${_} in block collection must be sufficiently indented and end with a ${f}`;s(d,u?"MISSING_CHAR":"BAD_INDENT",E),h&&h.source.length!==1&&y.unshift(h)}if(y.length>0){let _=eF.resolveEnd(y,m,n.options.strict,s);_.comment&&(l.comment?l.comment+=`
105
+ `+_.comment:l.comment=_.comment),l.range=[r.offset,m,_.offset]}else l.range=[r.offset,m,m];return l}gD.resolveFlowCollection=rF});var vD=w(bD=>{"use strict";var sF=ke(),iF=Pt(),oF=Us(),aF=Vs(),cF=uD(),lF=fD(),uF=yD();function eb(t,e,n,r,s,i){let o=n.type==="block-map"?cF.resolveBlockMap(t,e,n,r,i):n.type==="block-seq"?lF.resolveBlockSeq(t,e,n,r,i):uF.resolveFlowCollection(t,e,n,r,i),a=o.constructor;return s==="!"||s===a.tagName?(o.tag=a.tagName,o):(s&&(o.tag=s),o)}function dF(t,e,n,r,s){let i=r.tag,o=i?e.directives.tagName(i.source,f=>s(i,"TAG_RESOLVE_FAILED",f)):null;if(n.type==="block-seq"){let{anchor:f,newlineAfterProp:h}=r,y=f&&i?f.offset>i.offset?f:i:f??i;y&&(!h||h.offset<y.offset)&&s(y,"MISSING_CHAR","Missing newline after block sequence props")}let a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!i||!o||o==="!"||o===oF.YAMLMap.tagName&&a==="map"||o===aF.YAMLSeq.tagName&&a==="seq")return eb(t,e,n,s,o);let c=e.schema.tags.find(f=>f.tag===o&&f.collection===a);if(!c){let f=e.schema.knownTags[o];if(f&&f.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else return f?.collection?s(i,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection}`,!0):s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),eb(t,e,n,s,o)}let l=eb(t,e,n,s,o,c),u=c.resolve?.(l,f=>s(i,"TAG_RESOLVE_FAILED",f),e.options)??l,d=sF.isNode(u)?u:new iF.Scalar(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}bD.composeCollection=dF});var nb=w(TD=>{"use strict";var tb=Pt();function fF(t,e,n){let r=e.offset,s=hF(e,t.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};let i=s.mode===">"?tb.Scalar.BLOCK_FOLDED:tb.Scalar.BLOCK_LITERAL,o=e.source?pF(e.source):[],a=o.length;for(let m=o.length-1;m>=0;--m){let _=o[m][1];if(_===""||_==="\r")a=m;else break}if(a===0){let m=s.chomp==="+"&&o.length>0?`
106
+ `.repeat(Math.max(1,o.length-1)):"",_=r+s.length;return e.source&&(_+=e.source.length),{value:m,type:i,comment:s.comment,range:[r,_,_]}}let c=e.indent+s.indent,l=e.offset+s.length,u=0;for(let m=0;m<a;++m){let[_,E]=o[m];if(E===""||E==="\r")s.indent===0&&_.length>c&&(c=_.length);else{_.length<c&&n(l+_.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),s.indent===0&&(c=_.length),u=m,c===0&&!t.atRoot&&n(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=_.length+E.length+1}for(let m=o.length-1;m>=a;--m)o[m][0].length>c&&(a=m+1);let d="",f="",h=!1;for(let m=0;m<u;++m)d+=o[m][0].slice(c)+`
107
+ `;for(let m=u;m<a;++m){let[_,E]=o[m];l+=_.length+E.length+1;let T=E[E.length-1]==="\r";if(T&&(E=E.slice(0,-1)),E&&_.length<c){let R=`Block scalar lines must not be less indented than their ${s.indent?"explicit indentation indicator":"first line"}`;n(l-E.length-(T?2:1),"BAD_INDENT",R),_=""}i===tb.Scalar.BLOCK_LITERAL?(d+=f+_.slice(c)+E,f=`
108
+ `):_.length>c||E[0]===" "?(f===" "?f=`
109
+ `:!h&&f===`
110
110
  `&&(f=`
111
111
 
112
- `),d+=f+S.slice(c)+w,f=`
113
- `,p=!0):w===""?f===`
112
+ `),d+=f+_.slice(c)+E,f=`
113
+ `,h=!0):E===""?f===`
114
114
  `?d+=`
115
115
  `:f=`
116
- `:(d+=f+w,f=" ",p=!1)}switch(s.chomp){case"-":break;case"+":for(let m=a;m<o.length;++m)d+=`
116
+ `:(d+=f+E,f=" ",h=!1)}switch(s.chomp){case"-":break;case"+":for(let m=a;m<o.length;++m)d+=`
117
117
  `+o[m][0].slice(c);d[d.length-1]!==`
118
118
  `&&(d+=`
119
119
  `);break;default:d+=`
120
- `}let y=r+s.length+e.source.length;return{value:d,type:i,comment:s.comment,range:[r,y,y]}}function $q({offset:n,props:e},t,r){if(e[0].type!=="block-scalar-header")return r(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:s}=e[0],i=s[0],o=0,a="",c=-1;for(let f=1;f<s.length;++f){let p=s[f];if(!a&&(p==="-"||p==="+"))a=p;else{let y=Number(p);!o&&y?o=y:c===-1&&(c=n+f)}}c!==-1&&r(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let l=!1,u="",d=s.length;for(let f=1;f<e.length;++f){let p=e[f];switch(p.type){case"space":l=!0;case"newline":d+=p.source.length;break;case"comment":t&&!l&&r(p,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=p.source.length,u=p.source.substring(1);break;case"error":r(p,"UNEXPECTED_TOKEN",p.message),d+=p.source.length;break;default:{let y=`Unexpected token in block scalar header: ${p.type}`;r(p,"UNEXPECTED_TOKEN",y);let m=p.source;m&&typeof m=="string"&&(d+=m.length)}}}return{mode:i,indent:o,chomp:a,comment:u,length:d}}function Lq(n){let e=n.split(/\n( *)/),t=e[0],r=t.match(/^( *)/),i=[r?.[1]?[r[1],t.slice(r[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)i.push([e[o],e[o+1]]);return i}VR.resolveBlockScalar=Mq});var Oy=E(zR=>{"use strict";var Ay=Et(),qq=jo();function jq(n,e,t){let{offset:r,type:s,source:i,end:o}=n,a,c,l=(f,p,y)=>t(r+f,p,y);switch(s){case"scalar":a=Ay.Scalar.PLAIN,c=Fq(i,l);break;case"single-quoted-scalar":a=Ay.Scalar.QUOTE_SINGLE,c=Bq(i,l);break;case"double-quoted-scalar":a=Ay.Scalar.QUOTE_DOUBLE,c=Uq(i,l);break;default:return t(n,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`),{value:"",type:null,comment:"",range:[r,r+i.length,r+i.length]}}let u=r+i.length,d=qq.resolveEnd(o,u,e,t);return{value:c,type:a,comment:d.comment,range:[r,u,d.offset]}}function Fq(n,e){let t="";switch(n[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${n[0]}`;break}case"@":case"`":{t=`reserved character ${n[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),WR(n)}function Bq(n,e){return(n[n.length-1]!=="'"||n.length===1)&&e(n.length,"MISSING_CHAR","Missing closing 'quote"),WR(n.slice(1,-1)).replace(/''/g,"'")}function WR(n){let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
121
- `,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
122
- `,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=e.exec(n);if(!r)return n;let s=r[1],i=" ",o=e.lastIndex;for(t.lastIndex=o;r=t.exec(n);)r[1]===""?i===`
120
+ `}let y=r+s.length+e.source.length;return{value:d,type:i,comment:s.comment,range:[r,y,y]}}function hF({offset:t,props:e},n,r){if(e[0].type!=="block-scalar-header")return r(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:s}=e[0],i=s[0],o=0,a="",c=-1;for(let f=1;f<s.length;++f){let h=s[f];if(!a&&(h==="-"||h==="+"))a=h;else{let y=Number(h);!o&&y?o=y:c===-1&&(c=t+f)}}c!==-1&&r(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let l=!1,u="",d=s.length;for(let f=1;f<e.length;++f){let h=e[f];switch(h.type){case"space":l=!0;case"newline":d+=h.source.length;break;case"comment":n&&!l&&r(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=h.source.length,u=h.source.substring(1);break;case"error":r(h,"UNEXPECTED_TOKEN",h.message),d+=h.source.length;break;default:{let y=`Unexpected token in block scalar header: ${h.type}`;r(h,"UNEXPECTED_TOKEN",y);let m=h.source;m&&typeof m=="string"&&(d+=m.length)}}}return{mode:i,indent:o,chomp:a,comment:u,length:d}}function pF(t){let e=t.split(/\n( *)/),n=e[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let o=1;o<e.length;o+=2)i.push([e[o],e[o+1]]);return i}TD.resolveBlockScalar=fF});var sb=w(SD=>{"use strict";var rb=Pt(),mF=Ko();function gF(t,e,n){let{offset:r,type:s,source:i,end:o}=t,a,c,l=(f,h,y)=>n(r+f,h,y);switch(s){case"scalar":a=rb.Scalar.PLAIN,c=yF(i,l);break;case"single-quoted-scalar":a=rb.Scalar.QUOTE_SINGLE,c=bF(i,l);break;case"double-quoted-scalar":a=rb.Scalar.QUOTE_DOUBLE,c=vF(i,l);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`),{value:"",type:null,comment:"",range:[r,r+i.length,r+i.length]}}let u=r+i.length,d=mF.resolveEnd(o,u,e,n);return{value:c,type:a,comment:d.comment,range:[r,u,d.offset]}}function yF(t,e){let n="";switch(t[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${t[0]}`;break}case"@":case"`":{n=`reserved character ${t[0]}`;break}}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),_D(t)}function bF(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),_D(t.slice(1,-1)).replace(/''/g,"'")}function _D(t){let e,n;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
121
+ `,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
122
+ `,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=e.exec(t);if(!r)return t;let s=r[1],i=" ",o=e.lastIndex;for(n.lastIndex=o;r=n.exec(t);)r[1]===""?i===`
123
123
  `?s+=i:i=`
124
- `:(s+=i+r[1],i=" "),o=t.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,r=a.exec(n),s+i+(r?.[1]??"")}function Uq(n,e){let t="";for(let r=1;r<n.length-1;++r){let s=n[r];if(!(s==="\r"&&n[r+1]===`
124
+ `:(s+=i+r[1],i=" "),o=n.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,r=a.exec(t),s+i+(r?.[1]??"")}function vF(t,e){let n="";for(let r=1;r<t.length-1;++r){let s=t[r];if(!(s==="\r"&&t[r+1]===`
125
125
  `))if(s===`
126
- `){let{fold:i,offset:o}=Vq(n,r);t+=i,r=o}else if(s==="\\"){let i=n[++r],o=Wq[i];if(o)t+=o;else if(i===`
127
- `)for(i=n[r+1];i===" "||i===" ";)i=n[++r+1];else if(i==="\r"&&n[r+1]===`
128
- `)for(i=n[++r+1];i===" "||i===" ";)i=n[++r+1];else if(i==="x"||i==="u"||i==="U"){let a={x:2,u:4,U:8}[i];t+=zq(n,r+1,a,e),r+=a}else{let a=n.substr(r-1,2);e(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),t+=a}}else if(s===" "||s===" "){let i=r,o=n[r+1];for(;o===" "||o===" ";)o=n[++r+1];o!==`
129
- `&&!(o==="\r"&&n[r+2]===`
130
- `)&&(t+=r>i?n.slice(i,r+1):s)}else t+=s}return(n[n.length-1]!=='"'||n.length===1)&&e(n.length,"MISSING_CHAR",'Missing closing "quote'),t}function Vq(n,e){let t="",r=n[e+1];for(;(r===" "||r===" "||r===`
131
- `||r==="\r")&&!(r==="\r"&&n[e+2]!==`
126
+ `){let{fold:i,offset:o}=TF(t,r);n+=i,r=o}else if(s==="\\"){let i=t[++r],o=_F[i];if(o)n+=o;else if(i===`
127
+ `)for(i=t[r+1];i===" "||i===" ";)i=t[++r+1];else if(i==="\r"&&t[r+1]===`
128
+ `)for(i=t[++r+1];i===" "||i===" ";)i=t[++r+1];else if(i==="x"||i==="u"||i==="U"){let a={x:2,u:4,U:8}[i];n+=SF(t,r+1,a,e),r+=a}else{let a=t.substr(r-1,2);e(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(s===" "||s===" "){let i=r,o=t[r+1];for(;o===" "||o===" ";)o=t[++r+1];o!==`
129
+ `&&!(o==="\r"&&t[r+2]===`
130
+ `)&&(n+=r>i?t.slice(i,r+1):s)}else n+=s}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function TF(t,e){let n="",r=t[e+1];for(;(r===" "||r===" "||r===`
131
+ `||r==="\r")&&!(r==="\r"&&t[e+2]!==`
132
132
  `);)r===`
133
- `&&(t+=`
134
- `),e+=1,r=n[e+1];return t||(t=" "),{fold:t,offset:e}}var Wq={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
135
- `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function zq(n,e,t,r){let s=n.substr(e,t),o=s.length===t&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;if(isNaN(o)){let a=n.substr(e-2,t+2);return r(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}zR.resolveFlowScalar=jq});var GR=E(KR=>{"use strict";var Ti=_e(),HR=Et(),Hq=Cy(),Kq=Oy();function Gq(n,e,t,r){let{value:s,type:i,comment:o,range:a}=e.type==="block-scalar"?Hq.resolveBlockScalar(n,e,r):Kq.resolveFlowScalar(e,n.options.strict,r),c=t?n.directives.tagName(t.source,d=>r(t,"TAG_RESOLVE_FAILED",d)):null,l;n.options.stringKeys&&n.atKey?l=n.schema[Ti.SCALAR]:c?l=Yq(n.schema,s,c,t,r):e.type==="scalar"?l=Jq(n,s,e,r):l=n.schema[Ti.SCALAR];let u;try{let d=l.resolve(s,f=>r(t??e,"TAG_RESOLVE_FAILED",f),n.options);u=Ti.isScalar(d)?d:new HR.Scalar(d)}catch(d){let f=d instanceof Error?d.message:String(d);r(t??e,"TAG_RESOLVE_FAILED",f),u=new HR.Scalar(s)}return u.range=a,u.source=s,i&&(u.type=i),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function Yq(n,e,t,r,s){if(t==="!")return n[Ti.SCALAR];let i=[];for(let a of n.tags)if(!a.collection&&a.tag===t)if(a.default&&a.test)i.push(a);else return a;for(let a of i)if(a.test?.test(e))return a;let o=n.knownTags[t];return o&&!o.collection?(n.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(s(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),n[Ti.SCALAR])}function Jq({atKey:n,directives:e,schema:t},r,s,i){let o=t.tags.find(a=>(a.default===!0||n&&a.default==="key")&&a.test?.test(r))||t[Ti.SCALAR];if(t.compat){let a=t.compat.find(c=>c.default&&c.test?.test(r))??t[Ti.SCALAR];if(o.tag!==a.tag){let c=e.tagString(o.tag),l=e.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;i(s,"TAG_RESOLVE_FAILED",u,!0)}}return o}KR.composeScalar=Gq});var JR=E(YR=>{"use strict";function Xq(n,e,t){if(e){t===null&&(t=e.length);for(let r=t-1;r>=0;--r){let s=e[r];switch(s.type){case"space":case"comment":case"newline":n-=s.source.length;continue}for(s=e[++r];s?.type==="space";)n+=s.source.length,s=e[++r];break}}return n}YR.emptyScalarPosition=Xq});var ZR=E(xy=>{"use strict";var Qq=Za(),Zq=_e(),ej=UR(),XR=GR(),tj=jo(),nj=JR(),rj={composeNode:QR,composeEmptyNode:Iy};function QR(n,e,t,r){let s=n.atKey,{spaceBefore:i,comment:o,anchor:a,tag:c}=t,l,u=!0;switch(e.type){case"alias":l=sj(n,e,r),(a||c)&&r(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=XR.composeScalar(n,e,c,r),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":l=ej.composeCollection(rj,n,e,t,r),a&&(l.anchor=a.source.substring(1));break;default:{let d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;r(e,"UNEXPECTED_TOKEN",d),l=Iy(n,e.offset,void 0,null,t,r),u=!1}}return a&&l.anchor===""&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),s&&n.options.stringKeys&&(!Zq.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&r(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(l.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?l.comment=o:l.commentBefore=o),n.options.keepSourceTokens&&u&&(l.srcToken=e),l}function Iy(n,e,t,r,{spaceBefore:s,comment:i,anchor:o,tag:a,end:c},l){let u={type:"scalar",offset:nj.emptyScalarPosition(e,t,r),indent:-1,source:""},d=XR.composeScalar(n,u,a,l);return o&&(d.anchor=o.source.substring(1),d.anchor===""&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(d.spaceBefore=!0),i&&(d.comment=i,d.range[2]=c),d}function sj({options:n},{offset:e,source:t,end:r},s){let i=new Qq.Alias(t.substring(1));i.source===""&&s(e,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&s(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+t.length,a=tj.resolveEnd(r,o,n.strict,s);return i.range=[e,o,a.offset],a.comment&&(i.comment=a.comment),i}xy.composeEmptyNode=Iy;xy.composeNode=QR});var n0=E(t0=>{"use strict";var ij=mc(),e0=ZR(),oj=jo(),aj=vc();function cj(n,e,{offset:t,start:r,value:s,end:i},o){let a=Object.assign({_directives:e},n),c=new ij.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=aj.resolveProps(r,{indicator:"doc-start",next:s??i?.[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,s&&(s.type==="block-map"||s.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=s?e0.composeNode(l,s,u,o):e0.composeEmptyNode(l,u.end,r,null,u,o);let d=c.contents.range[2],f=oj.resolveEnd(i,d,!1,o);return f.comment&&(c.comment=f.comment),c.range=[t,d,f.offset],c}t0.composeDoc=cj});var $y=E(i0=>{"use strict";var lj=Sg(),uj=mc(),Tc=bc(),r0=_e(),dj=n0(),fj=jo();function Sc(n){if(typeof n=="number")return[n,n+1];if(Array.isArray(n))return n.length===2?n:[n[0],n[1]];let{offset:e,source:t}=n;return[e,e+(typeof t=="string"?t.length:1)]}function s0(n){let e="",t=!1,r=!1;for(let s=0;s<n.length;++s){let i=n[s];switch(i[0]){case"#":e+=(e===""?"":r?`
133
+ `&&(n+=`
134
+ `),e+=1,r=t[e+1];return n||(n=" "),{fold:n,offset:e}}var _F={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
135
+ `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function SF(t,e,n,r){let s=t.substr(e,n),o=s.length===n&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;if(isNaN(o)){let a=t.substr(e-2,n+2);return r(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}SD.resolveFlowScalar=gF});var kD=w(wD=>{"use strict";var Pi=ke(),ED=Pt(),EF=nb(),wF=sb();function kF(t,e,n,r){let{value:s,type:i,comment:o,range:a}=e.type==="block-scalar"?EF.resolveBlockScalar(t,e,r):wF.resolveFlowScalar(e,t.options.strict,r),c=n?t.directives.tagName(n.source,d=>r(n,"TAG_RESOLVE_FAILED",d)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[Pi.SCALAR]:c?l=NF(t.schema,s,c,n,r):e.type==="scalar"?l=PF(t,s,e,r):l=t.schema[Pi.SCALAR];let u;try{let d=l.resolve(s,f=>r(n??e,"TAG_RESOLVE_FAILED",f),t.options);u=Pi.isScalar(d)?d:new ED.Scalar(d)}catch(d){let f=d instanceof Error?d.message:String(d);r(n??e,"TAG_RESOLVE_FAILED",f),u=new ED.Scalar(s)}return u.range=a,u.source=s,i&&(u.type=i),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function NF(t,e,n,r,s){if(n==="!")return t[Pi.SCALAR];let i=[];for(let a of t.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)i.push(a);else return a;for(let a of i)if(a.test?.test(e))return a;let o=t.knownTags[n];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(s(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[Pi.SCALAR])}function PF({atKey:t,directives:e,schema:n},r,s,i){let o=n.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(r))||n[Pi.SCALAR];if(n.compat){let a=n.compat.find(c=>c.default&&c.test?.test(r))??n[Pi.SCALAR];if(o.tag!==a.tag){let c=e.tagString(o.tag),l=e.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;i(s,"TAG_RESOLVE_FAILED",u,!0)}}return o}wD.composeScalar=kF});var PD=w(ND=>{"use strict";function RF(t,e,n){if(e){n===null&&(n=e.length);for(let r=n-1;r>=0;--r){let s=e[r];switch(s.type){case"space":case"comment":case"newline":t-=s.source.length;continue}for(s=e[++r];s?.type==="space";)t+=s.source.length,s=e[++r];break}}return t}ND.emptyScalarPosition=RF});var CD=w(ob=>{"use strict";var DF=cc(),CF=ke(),AF=vD(),RD=kD(),OF=Ko(),IF=PD(),xF={composeNode:DD,composeEmptyNode:ib};function DD(t,e,n,r){let s=t.atKey,{spaceBefore:i,comment:o,anchor:a,tag:c}=n,l,u=!0;switch(e.type){case"alias":l=MF(t,e,r),(a||c)&&r(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=RD.composeScalar(t,e,c,r),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":l=AF.composeCollection(xF,t,e,n,r),a&&(l.anchor=a.source.substring(1));break;default:{let d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;r(e,"UNEXPECTED_TOKEN",d),l=ib(t,e.offset,void 0,null,n,r),u=!1}}return a&&l.anchor===""&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),s&&t.options.stringKeys&&(!CF.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&r(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(l.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?l.comment=o:l.commentBefore=o),t.options.keepSourceTokens&&u&&(l.srcToken=e),l}function ib(t,e,n,r,{spaceBefore:s,comment:i,anchor:o,tag:a,end:c},l){let u={type:"scalar",offset:IF.emptyScalarPosition(e,n,r),indent:-1,source:""},d=RD.composeScalar(t,u,a,l);return o&&(d.anchor=o.source.substring(1),d.anchor===""&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(d.spaceBefore=!0),i&&(d.comment=i,d.range[2]=c),d}function MF({options:t},{offset:e,source:n,end:r},s){let i=new DF.Alias(n.substring(1));i.source===""&&s(e,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&s(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+n.length,a=OF.resolveEnd(r,o,t.strict,s);return i.range=[e,o,a.offset],a.comment&&(i.comment=a.comment),i}ob.composeEmptyNode=ib;ob.composeNode=DD});var ID=w(OD=>{"use strict";var LF=wc(),AD=CD(),$F=Ko(),qF=Rc();function jF(t,e,{offset:n,start:r,value:s,end:i},o){let a=Object.assign({_directives:e},t),c=new LF.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=qF.resolveProps(r,{indicator:"doc-start",next:s??i?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,s&&(s.type==="block-map"||s.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=s?AD.composeNode(l,s,u,o):AD.composeEmptyNode(l,u.end,r,null,u,o);let d=c.contents.range[2],f=$F.resolveEnd(i,d,!1,o);return f.comment&&(c.comment=f.comment),c.range=[n,d,f.offset],c}OD.composeDoc=jF});var cb=w(LD=>{"use strict";var FF=Gg(),BF=wc(),Dc=Pc(),xD=ke(),UF=ID(),VF=Ko();function Cc(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}function MD(t){let e="",n=!1,r=!1;for(let s=0;s<t.length;++s){let i=t[s];switch(i[0]){case"#":e+=(e===""?"":r?`
136
136
 
137
137
  `:`
138
- `)+(i.substring(1)||" "),t=!0,r=!1;break;case"%":n[s+1]?.[0]!=="#"&&(s+=1),t=!1;break;default:t||(r=!0),t=!1}}return{comment:e,afterEmptyLine:r}}var My=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,r,s,i)=>{let o=Sc(t);i?this.warnings.push(new Tc.YAMLWarning(o,r,s)):this.errors.push(new Tc.YAMLParseError(o,r,s))},this.directives=new lj.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:r,afterEmptyLine:s}=s0(this.prelude);if(r){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}
139
- ${r}`:r;else if(s||e.directives.docStart||!i)e.commentBefore=r;else if(r0.isCollection(i)&&!i.flow&&i.items.length>0){let o=i.items[0];r0.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${r}
138
+ `)+(i.substring(1)||" "),n=!0,r=!1;break;case"%":t[s+1]?.[0]!=="#"&&(s+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:e,afterEmptyLine:r}}var ab=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,s,i)=>{let o=Cc(n);i?this.warnings.push(new Dc.YAMLWarning(o,r,s)):this.errors.push(new Dc.YAMLParseError(o,r,s))},this.directives=new FF.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,n){let{comment:r,afterEmptyLine:s}=MD(this.prelude);if(r){let i=e.contents;if(n)e.comment=e.comment?`${e.comment}
139
+ ${r}`:r;else if(s||e.directives.docStart||!i)e.commentBefore=r;else if(xD.isCollection(i)&&!i.flow&&i.items.length>0){let o=i.items[0];xD.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${r}
140
140
  ${a}`:r}else{let o=i.commentBefore;i.commentBefore=o?`${r}
141
- ${o}`:r}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:s0(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,r=-1){for(let s of e)yield*this.next(s);yield*this.end(t,r)}*next(e){switch(process.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,r,s)=>{let i=Sc(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",r,s)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=dj.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new Tc.YAMLParseError(Sc(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){let r="Unexpected doc-end without preceding document";this.errors.push(new Tc.YAMLParseError(Sc(e),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;let t=fj.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let r=this.doc.comment;this.doc.comment=r?`${r}
142
- ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Tc.YAMLParseError(Sc(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let r=Object.assign({_directives:this.directives},this.options),s=new uj.Document(void 0,r);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,t,t],this.decorate(s,!1),yield s}}};i0.Composer=My});var c0=E(Bf=>{"use strict";var hj=Cy(),pj=Oy(),mj=bc(),o0=sc();function gj(n,e=!0,t){if(n){let r=(s,i,o)=>{let a=typeof s=="number"?s:Array.isArray(s)?s[0]:s.offset;if(t)t(a,i,o);else throw new mj.YAMLParseError([a,a+1],i,o)};switch(n.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return pj.resolveFlowScalar(n,e,r);case"block-scalar":return hj.resolveBlockScalar({options:{strict:e}},n,r)}}return null}function yj(n,e){let{implicitKey:t=!1,indent:r,inFlow:s=!1,offset:i=-1,type:o="PLAIN"}=e,a=o0.stringifyString({type:o,value:n},{implicitKey:t,indent:r>0?" ".repeat(r):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:r,source:`
141
+ ${o}`:r}}n?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:MD(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,r=-1){for(let s of e)yield*this.next(s);yield*this.end(n,r)}*next(e){switch(process.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(n,r,s)=>{let i=Cc(e);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",r,s)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let n=UF.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new Dc.YAMLParseError(Cc(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){let r="Unexpected doc-end without preceding document";this.errors.push(new Dc.YAMLParseError(Cc(e),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;let n=VF.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let r=this.doc.comment;this.doc.comment=r?`${r}
142
+ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Dc.YAMLParseError(Cc(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let r=Object.assign({_directives:this.directives},this.options),s=new BF.Document(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,n,n],this.decorate(s,!1),yield s}}};LD.Composer=ab});var jD=w(eh=>{"use strict";var zF=nb(),WF=sb(),HF=Pc(),$D=hc();function GF(t,e=!0,n){if(t){let r=(s,i,o)=>{let a=typeof s=="number"?s:Array.isArray(s)?s[0]:s.offset;if(n)n(a,i,o);else throw new HF.YAMLParseError([a,a+1],i,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return WF.resolveFlowScalar(t,e,r);case"block-scalar":return zF.resolveBlockScalar({options:{strict:e}},t,r)}}return null}function KF(t,e){let{implicitKey:n=!1,indent:r,inFlow:s=!1,offset:i=-1,type:o="PLAIN"}=e,a=$D.stringifyString({type:o,value:t},{implicitKey:n,indent:r>0?" ".repeat(r):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:r,source:`
143
143
  `}];switch(a[0]){case"|":case">":{let l=a.indexOf(`
144
144
  `),u=a.substring(0,l),d=a.substring(l+1)+`
145
- `,f=[{type:"block-scalar-header",offset:i,indent:r,source:u}];return a0(f,c)||f.push({type:"newline",offset:-1,indent:r,source:`
146
- `}),{type:"block-scalar",offset:i,indent:r,props:f,source:d}}case'"':return{type:"double-quoted-scalar",offset:i,indent:r,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:i,indent:r,source:a,end:c};default:return{type:"scalar",offset:i,indent:r,source:a,end:c}}}function bj(n,e,t={}){let{afterKey:r=!1,implicitKey:s=!1,inFlow:i=!1,type:o}=t,a="indent"in n?n.indent:null;if(r&&typeof a=="number"&&(a+=2),!o)switch(n.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let l=n.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let c=o0.stringifyString({type:o,value:e},{implicitKey:s||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":vj(n,c);break;case'"':Ly(n,c,"double-quoted-scalar");break;case"'":Ly(n,c,"single-quoted-scalar");break;default:Ly(n,c,"scalar")}}function vj(n,e){let t=e.indexOf(`
147
- `),r=e.substring(0,t),s=e.substring(t+1)+`
148
- `;if(n.type==="block-scalar"){let i=n.props[0];if(i.type!=="block-scalar-header")throw new Error("Invalid block scalar header");i.source=r,n.source=s}else{let{offset:i}=n,o="indent"in n?n.indent:-1,a=[{type:"block-scalar-header",offset:i,indent:o,source:r}];a0(a,"end"in n?n.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
149
- `});for(let c of Object.keys(n))c!=="type"&&c!=="offset"&&delete n[c];Object.assign(n,{type:"block-scalar",indent:o,props:a,source:s})}}function a0(n,e){if(e)for(let t of e)switch(t.type){case"space":case"comment":n.push(t);break;case"newline":return n.push(t),!0}return!1}function Ly(n,e,t){switch(n.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":n.type=t,n.source=e;break;case"block-scalar":{let r=n.props.slice(1),s=e.length;n.props[0].type==="block-scalar-header"&&(s-=n.props[0].source.length);for(let i of r)i.offset+=s;delete n.props,Object.assign(n,{type:t,source:e,end:r});break}case"block-map":case"block-seq":{let s={type:"newline",offset:n.offset+e.length,indent:n.indent,source:`
150
- `};delete n.items,Object.assign(n,{type:t,source:e,end:[s]});break}default:{let r="indent"in n?n.indent:-1,s="end"in n&&Array.isArray(n.end)?n.end.filter(i=>i.type==="space"||i.type==="comment"||i.type==="newline"):[];for(let i of Object.keys(n))i!=="type"&&i!=="offset"&&delete n[i];Object.assign(n,{type:t,indent:r,source:e,end:s})}}}Bf.createScalarToken=yj;Bf.resolveAsScalar=gj;Bf.setScalarValue=bj});var u0=E(l0=>{"use strict";var Tj=n=>"type"in n?Vf(n):Uf(n);function Vf(n){switch(n.type){case"block-scalar":{let e="";for(let t of n.props)e+=Vf(t);return e+n.source}case"block-map":case"block-seq":{let e="";for(let t of n.items)e+=Uf(t);return e}case"flow-collection":{let e=n.start.source;for(let t of n.items)e+=Uf(t);for(let t of n.end)e+=t.source;return e}case"document":{let e=Uf(n);if(n.end)for(let t of n.end)e+=t.source;return e}default:{let e=n.source;if("end"in n&&n.end)for(let t of n.end)e+=t.source;return e}}}function Uf({start:n,key:e,sep:t,value:r}){let s="";for(let i of n)s+=i.source;if(e&&(s+=Vf(e)),t)for(let i of t)s+=i.source;return r&&(s+=Vf(r)),s}l0.stringify=Tj});var p0=E(h0=>{"use strict";var qy=Symbol("break visit"),Sj=Symbol("skip children"),d0=Symbol("remove item");function Si(n,e){"type"in n&&n.type==="document"&&(n={start:n.start,value:n.value}),f0(Object.freeze([]),n,e)}Si.BREAK=qy;Si.SKIP=Sj;Si.REMOVE=d0;Si.itemAtPath=(n,e)=>{let t=n;for(let[r,s]of e){let i=t?.[r];if(i&&"items"in i)t=i.items[s];else return}return t};Si.parentCollection=(n,e)=>{let t=Si.itemAtPath(n,e.slice(0,-1)),r=e[e.length-1][0],s=t?.[r];if(s&&"items"in s)return s;throw new Error("Parent collection not found")};function f0(n,e,t){let r=t(e,n);if(typeof r=="symbol")return r;for(let s of["key","value"]){let i=e[s];if(i&&"items"in i){for(let o=0;o<i.items.length;++o){let a=f0(Object.freeze(n.concat([[s,o]])),i.items[o],t);if(typeof a=="number")o=a-1;else{if(a===qy)return qy;a===d0&&(i.items.splice(o,1),o-=1)}}typeof r=="function"&&s==="key"&&(r=r(e,n))}}return typeof r=="function"?r(e,n):r}h0.visit=Si});var Wf=E(En=>{"use strict";var jy=c0(),_j=u0(),Ej=p0(),Fy="\uFEFF",By="",Uy="",Vy="",wj=n=>!!n&&"items"in n,kj=n=>!!n&&(n.type==="scalar"||n.type==="single-quoted-scalar"||n.type==="double-quoted-scalar"||n.type==="block-scalar");function Nj(n){switch(n){case Fy:return"<BOM>";case By:return"<DOC>";case Uy:return"<FLOW_END>";case Vy:return"<SCALAR>";default:return JSON.stringify(n)}}function Pj(n){switch(n){case Fy:return"byte-order-mark";case By:return"doc-mode";case Uy:return"flow-error-end";case Vy:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
145
+ `,f=[{type:"block-scalar-header",offset:i,indent:r,source:u}];return qD(f,c)||f.push({type:"newline",offset:-1,indent:r,source:`
146
+ `}),{type:"block-scalar",offset:i,indent:r,props:f,source:d}}case'"':return{type:"double-quoted-scalar",offset:i,indent:r,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:i,indent:r,source:a,end:c};default:return{type:"scalar",offset:i,indent:r,source:a,end:c}}}function YF(t,e,n={}){let{afterKey:r=!1,implicitKey:s=!1,inFlow:i=!1,type:o}=n,a="indent"in t?t.indent:null;if(r&&typeof a=="number"&&(a+=2),!o)switch(t.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let l=t.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let c=$D.stringifyString({type:o,value:e},{implicitKey:s||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":XF(t,c);break;case'"':lb(t,c,"double-quoted-scalar");break;case"'":lb(t,c,"single-quoted-scalar");break;default:lb(t,c,"scalar")}}function XF(t,e){let n=e.indexOf(`
147
+ `),r=e.substring(0,n),s=e.substring(n+1)+`
148
+ `;if(t.type==="block-scalar"){let i=t.props[0];if(i.type!=="block-scalar-header")throw new Error("Invalid block scalar header");i.source=r,t.source=s}else{let{offset:i}=t,o="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:i,indent:o,source:r}];qD(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
149
+ `});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:o,props:a,source:s})}}function qD(t,e){if(e)for(let n of e)switch(n.type){case"space":case"comment":t.push(n);break;case"newline":return t.push(n),!0}return!1}function lb(t,e,n){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=n,t.source=e;break;case"block-scalar":{let r=t.props.slice(1),s=e.length;t.props[0].type==="block-scalar-header"&&(s-=t.props[0].source.length);for(let i of r)i.offset+=s;delete t.props,Object.assign(t,{type:n,source:e,end:r});break}case"block-map":case"block-seq":{let s={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
150
+ `};delete t.items,Object.assign(t,{type:n,source:e,end:[s]});break}default:{let r="indent"in t?t.indent:-1,s="end"in t&&Array.isArray(t.end)?t.end.filter(i=>i.type==="space"||i.type==="comment"||i.type==="newline"):[];for(let i of Object.keys(t))i!=="type"&&i!=="offset"&&delete t[i];Object.assign(t,{type:n,indent:r,source:e,end:s})}}}eh.createScalarToken=KF;eh.resolveAsScalar=GF;eh.setScalarValue=YF});var BD=w(FD=>{"use strict";var JF=t=>"type"in t?nh(t):th(t);function nh(t){switch(t.type){case"block-scalar":{let e="";for(let n of t.props)e+=nh(n);return e+t.source}case"block-map":case"block-seq":{let e="";for(let n of t.items)e+=th(n);return e}case"flow-collection":{let e=t.start.source;for(let n of t.items)e+=th(n);for(let n of t.end)e+=n.source;return e}case"document":{let e=th(t);if(t.end)for(let n of t.end)e+=n.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let n of t.end)e+=n.source;return e}}}function th({start:t,key:e,sep:n,value:r}){let s="";for(let i of t)s+=i.source;if(e&&(s+=nh(e)),n)for(let i of n)s+=i.source;return r&&(s+=nh(r)),s}FD.stringify=JF});var WD=w(zD=>{"use strict";var ub=Symbol("break visit"),QF=Symbol("skip children"),UD=Symbol("remove item");function Ri(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),VD(Object.freeze([]),t,e)}Ri.BREAK=ub;Ri.SKIP=QF;Ri.REMOVE=UD;Ri.itemAtPath=(t,e)=>{let n=t;for(let[r,s]of e){let i=n?.[r];if(i&&"items"in i)n=i.items[s];else return}return n};Ri.parentCollection=(t,e)=>{let n=Ri.itemAtPath(t,e.slice(0,-1)),r=e[e.length-1][0],s=n?.[r];if(s&&"items"in s)return s;throw new Error("Parent collection not found")};function VD(t,e,n){let r=n(e,t);if(typeof r=="symbol")return r;for(let s of["key","value"]){let i=e[s];if(i&&"items"in i){for(let o=0;o<i.items.length;++o){let a=VD(Object.freeze(t.concat([[s,o]])),i.items[o],n);if(typeof a=="number")o=a-1;else{if(a===ub)return ub;a===UD&&(i.items.splice(o,1),o-=1)}}typeof r=="function"&&s==="key"&&(r=r(e,t))}}return typeof r=="function"?r(e,t):r}zD.visit=Ri});var rh=w(Nn=>{"use strict";var db=jD(),ZF=BD(),eB=WD(),fb="\uFEFF",hb="",pb="",mb="",tB=t=>!!t&&"items"in t,nB=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function rB(t){switch(t){case fb:return"<BOM>";case hb:return"<DOC>";case pb:return"<FLOW_END>";case mb:return"<SCALAR>";default:return JSON.stringify(t)}}function sB(t){switch(t){case fb:return"byte-order-mark";case hb:return"doc-mode";case pb:return"flow-error-end";case mb:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
151
151
  `:case`\r
152
- `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(n[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}En.createScalarToken=jy.createScalarToken;En.resolveAsScalar=jy.resolveAsScalar;En.setScalarValue=jy.setScalarValue;En.stringify=_j.stringify;En.visit=Ej.visit;En.BOM=Fy;En.DOCUMENT=By;En.FLOW_END=Uy;En.SCALAR=Vy;En.isCollection=wj;En.isScalar=kj;En.prettyToken=Nj;En.tokenType=Pj});var Hy=E(g0=>{"use strict";var _c=Wf();function pr(n){switch(n){case void 0:case" ":case`
153
- `:case"\r":case" ":return!0;default:return!1}}var m0=new Set("0123456789ABCDEFabcdef"),Rj=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),zf=new Set(",[]{}"),Dj=new Set(` ,[]{}
154
- \r `),Wy=n=>!n||Dj.has(n),zy=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let r=this.next??"stream";for(;r&&(t||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
155
- `?!0:t==="\r"?this.buffer[e+1]===`
156
- `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let r=0;for(;t===" ";)t=this.buffer[++r+e];if(t==="\r"){let s=this.buffer[r+e+1];if(s===`
157
- `||!s&&!this.atEnd)return e+r+1}return t===`
158
- `||r>=this.indentNext||!t&&!this.atEnd?e+r:-1}if(t==="-"||t==="."){let r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&pr(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
159
- `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===_c.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,r=e.indexOf("#");for(;r!==-1;){let i=e[r-1];if(i===" "||i===" "){t=r-1;break}else r=e.indexOf("#",r+1)}for(;;){let i=e[t-1];if(i===" "||i===" ")t-=1;else break}let s=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-s),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield _c.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let t=this.peek(3);if((t==="---"||t==="...")&&pr(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!pr(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&pr(t)){let r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Wy),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,r=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=r=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let s=this.getLine();if(s===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&s[0]!=="#"||r===0&&(s.startsWith("---")||s.startsWith("..."))&&pr(s[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(s[0]==="]"||s[0]==="}")))return this.flowLevel=0,yield _c.FLOW_END,yield*this.parseLineStart();let i=0;for(;s[i]===",";)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),s[i]){case void 0:return"flow";case"#":return yield*this.pushCount(s.length-i),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Wy),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||pr(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let i=0;for(;this.buffer[t-1-i]==="\\";)i+=1;if(i%2===0)break;t=this.buffer.indexOf('"',t+1)}let r=this.buffer.substring(0,t),s=r.indexOf(`
152
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Nn.createScalarToken=db.createScalarToken;Nn.resolveAsScalar=db.resolveAsScalar;Nn.setScalarValue=db.setScalarValue;Nn.stringify=ZF.stringify;Nn.visit=eB.visit;Nn.BOM=fb;Nn.DOCUMENT=hb;Nn.FLOW_END=pb;Nn.SCALAR=mb;Nn.isCollection=tB;Nn.isScalar=nB;Nn.prettyToken=rB;Nn.tokenType=sB});var bb=w(GD=>{"use strict";var Ac=rh();function gr(t){switch(t){case void 0:case" ":case`
153
+ `:case"\r":case" ":return!0;default:return!1}}var HD=new Set("0123456789ABCDEFabcdef"),iB=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),sh=new Set(",[]{}"),oB=new Set(` ,[]{}
154
+ \r `),gb=t=>!t||oB.has(t),yb=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,n=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n===" ";)n=this.buffer[++e];return!n||n==="#"||n===`
155
+ `?!0:n==="\r"?this.buffer[e+1]===`
156
+ `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+e];if(n==="\r"){let s=this.buffer[r+e+1];if(s===`
157
+ `||!s&&!this.atEnd)return e+r+1}return n===`
158
+ `||r>=this.indentNext||!n&&!this.atEnd?e+r:-1}if(n==="-"||n==="."){let r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&gr(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
159
+ `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Ac.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let n=e.length,r=e.indexOf("#");for(;r!==-1;){let i=e[r-1];if(i===" "||i===" "){n=r-1;break}else r=e.indexOf("#",r+1)}for(;;){let i=e[n-1];if(i===" "||i===" ")n-=1;else break}let s=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-s),this.pushNewline(),"stream"}if(this.atLineEnd()){let n=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-n),yield*this.pushNewline(),"stream"}return yield Ac.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let n=this.peek(3);if((n==="---"||n==="...")&&gr(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!gr(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&gr(n)){let r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(gb),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,r=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);let s=this.getLine();if(s===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&s[0]!=="#"||r===0&&(s.startsWith("---")||s.startsWith("..."))&&gr(s[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(s[0]==="]"||s[0]==="}")))return this.flowLevel=0,yield Ac.FLOW_END,yield*this.parseLineStart();let i=0;for(;s[i]===",";)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),s[i]){case void 0:return"flow";case"#":return yield*this.pushCount(s.length-i),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(gb),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||gr(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),n=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let i=0;for(;this.buffer[n-1-i]==="\\";)i+=1;if(i%2===0)break;n=this.buffer.indexOf('"',n+1)}let r=this.buffer.substring(0,n),s=r.indexOf(`
160
160
  `,this.pos);if(s!==-1){for(;s!==-1;){let i=this.continueScalar(s+1);if(i===-1)break;s=r.indexOf(`
161
- `,i)}s!==-1&&(t=s-(r[s-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>pr(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,r;e:for(let i=this.pos;r=this.buffer[i];++i)switch(r){case" ":t+=1;break;case`
162
- `:e=i,t=0;break;case"\r":{let o=this.buffer[i+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
163
- `)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let i=this.continueScalar(e+1);if(i===-1)break;e=this.buffer.indexOf(`
161
+ `,i)}s!==-1&&(n=s-(r[s-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let n=this.buffer[++e];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>gr(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,r;e:for(let i=this.pos;r=this.buffer[i];++i)switch(r){case" ":n+=1;break;case`
162
+ `:e=i,n=0;break;case"\r":{let o=this.buffer[i+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
163
+ `)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let i=this.continueScalar(e+1);if(i===-1)break;e=this.buffer.indexOf(`
164
164
  `,i)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let s=e+1;for(r=this.buffer[s];r===" ";)r=this.buffer[++s];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
165
165
  `;)r=this.buffer[++s];e=s-1}else if(!this.blockScalarKeep)do{let i=e-1,o=this.buffer[i];o==="\r"&&(o=this.buffer[--i]);let a=i;for(;o===" ";)o=this.buffer[--i];if(o===`
166
- `&&i>=this.pos&&i+1+t>a)e=i;else break}while(!0);return yield _c.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,r=this.pos-1,s;for(;s=this.buffer[++r];)if(s===":"){let i=this.buffer[r+1];if(pr(i)||e&&zf.has(i))break;t=r}else if(pr(s)){let i=this.buffer[r+1];if(s==="\r"&&(i===`
166
+ `&&i>=this.pos&&i+1+n>a)e=i;else break}while(!0);return yield Ac.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,n=this.pos-1,r=this.pos-1,s;for(;s=this.buffer[++r];)if(s===":"){let i=this.buffer[r+1];if(gr(i)||e&&sh.has(i))break;n=r}else if(gr(s)){let i=this.buffer[r+1];if(s==="\r"&&(i===`
167
167
  `?(r+=1,s=`
168
- `,i=this.buffer[r+1]):t=r),i==="#"||e&&zf.has(i))break;if(s===`
169
- `){let o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(e&&zf.has(s))break;t=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield _c.SCALAR,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Wy))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,t=this.charAt(1);if(pr(t)||e&&zf.has(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!pr(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(Rj.has(t))t=this.buffer[++e];else if(t==="%"&&m0.has(this.buffer[e+1])&&m0.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
168
+ `,i=this.buffer[r+1]):n=r),i==="#"||e&&sh.has(i))break;if(s===`
169
+ `){let o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(e&&sh.has(s))break;n=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield Ac.SCALAR,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){let r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(gb))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,n=this.charAt(1);if(gr(n)||e&&sh.has(n))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,n=this.buffer[e];for(;!gr(n)&&n!==">";)n=this.buffer[++e];return yield*this.pushToIndex(n===">"?e+1:e,!1)}else{let e=this.pos+1,n=this.buffer[e];for(;n;)if(iB.has(n))n=this.buffer[++e];else if(n==="%"&&HD.has(this.buffer[e+1])&&HD.has(this.buffer[e+2]))n=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
170
170
  `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
171
- `?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,r;do r=this.buffer[++t];while(r===" "||e&&r===" ");let s=t-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=t),s}*pushUntil(e){let t=this.pos,r=this.buffer[t];for(;!e(r);)r=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};g0.Lexer=zy});var Gy=E(y0=>{"use strict";var Ky=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,r=this.lineStarts.length;for(;t<r;){let i=t+r>>1;this.lineStarts[i]<e?t=i+1:r=i}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let s=this.lineStarts[t-1];return{line:t,col:e-s+1}}}};y0.LineCounter=Ky});var Jy=E(_0=>{"use strict";var b0=Wf(),Cj=Hy();function _i(n,e){for(let t=0;t<n.length;++t)if(n[t].type===e)return!0;return!1}function v0(n){for(let e=0;e<n.length;++e)switch(n[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function S0(n){switch(n?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Hf(n){switch(n.type){case"document":return n.start;case"block-map":{let e=n.items[n.items.length-1];return e.sep??e.start}case"block-seq":return n.items[n.items.length-1].start;default:return[]}}function Fo(n){if(n.length===0)return[];let e=n.length;e:for(;--e>=0;)switch(n[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;n[++e]?.type==="space";);return n.splice(e,n.length)}function T0(n){if(n.start.type==="flow-seq-start")for(let e of n.items)e.sep&&!e.value&&!_i(e.start,"explicit-key-ind")&&!_i(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,S0(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}var Yy=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Cj.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let r of this.lexer.lex(e,t))yield*this.next(r);t||(yield*this.end())}*next(e){if(this.source=e,process.env.LOG_TOKENS&&console.log("|",b0.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=b0.tokenType(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let r=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&(!e||e.type!=="doc-end")){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let r=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in r?r.indent:0:t.type==="flow-collection"&&r.type==="document"&&(t.indent=0),t.type==="flow-collection"&&T0(t),r.type){case"document":r.value=t;break;case"block-scalar":r.props.push(t);break;case"block-map":{let s=r.items[r.items.length-1];if(s.value){r.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(s.sep)s.value=t;else{Object.assign(s,{key:t,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{let s=r.items[r.items.length-1];s.value?r.items.push({start:[],value:t}):s.value=t;break}case"flow-collection":{let s=r.items[r.items.length-1];!s||s.value?r.items.push({start:[],key:t,sep:[]}):s.sep?s.value=t:Object.assign(s,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let s=t.items[t.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&v0(s.start)===-1&&(t.indent===0||s.start.every(i=>i.type!=="comment"||i.indent<t.indent))&&(r.type==="document"?r.end=s.start:r.items.push({start:s.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{v0(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let t=Hf(this.peek(2)),r=Fo(t),s;e.end?(s=e.end,s.push(this.sourceToken),delete e.end):s=[this.sourceToken];let i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
172
- `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
173
- `,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let r="end"in t.value?t.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){Array.prototype.push.apply(s,t.start),s.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let r=!this.onKeyLine&&this.indent===e.indent,s=r&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",i=[];if(s&&t.sep&&!t.value){let o=[];for(let a=0;a<t.sep.length;++a){let c=t.sep[a];switch(c.type){case"newline":o.push(a);break;case"space":break;case"comment":c.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(i=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":s||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):s||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(_i(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(S0(t.key)&&!_i(t.sep,"newline")){let o=Fo(t.start),a=t.key,c=t.sep;c.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:c}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else if(_i(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=Fo(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||s?e.items.push({start:i,key:null,sep:[this.sourceToken]}):_i(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);s||t.value?(e.items.push({start:i,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){r&&o.type!=="block-seq"&&e.items.push({start:i}),this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let r="end"in t.value?t.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){Array.prototype.push.apply(s,t.start),s.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||_i(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let r=this.startBlockValue(e);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r&&r.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:s,sep:[]}):t.sep?this.stack.push(s):Object.assign(t,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let s=Hf(r),i=Fo(s);T0(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
174
- `)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
175
- `,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=Hf(e),r=Fo(t);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=Hf(e),r=Fo(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};_0.Parser=Yy});var P0=E(wc=>{"use strict";var E0=$y(),Aj=mc(),Ec=bc(),Oj=xg(),Ij=_e(),xj=Gy(),w0=Jy();function k0(n){let e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new xj.LineCounter||null,prettyErrors:e}}function Mj(n,e={}){let{lineCounter:t,prettyErrors:r}=k0(e),s=new w0.Parser(t?.addNewLine),i=new E0.Composer(e),o=Array.from(i.compose(s.parse(n)));if(r&&t)for(let a of o)a.errors.forEach(Ec.prettifyError(n,t)),a.warnings.forEach(Ec.prettifyError(n,t));return o.length>0?o:Object.assign([],{empty:!0},i.streamInfo())}function N0(n,e={}){let{lineCounter:t,prettyErrors:r}=k0(e),s=new w0.Parser(t?.addNewLine),i=new E0.Composer(e),o=null;for(let a of i.compose(s.parse(n),!0,n.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Ec.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&t&&(o.errors.forEach(Ec.prettifyError(n,t)),o.warnings.forEach(Ec.prettifyError(n,t))),o}function $j(n,e,t){let r;typeof e=="function"?r=e:t===void 0&&e&&typeof e=="object"&&(t=e);let s=N0(n,t);if(!s)return null;if(s.warnings.forEach(i=>Oj.warn(s.options.logLevel,i)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:r},t))}function Lj(n,e,t){let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let s=Math.round(t);t=s<1?void 0:s>8?{indent:8}:{indent:s}}if(n===void 0){let{keepUndefined:s}=t??e??{};if(!s)return}return Ij.isDocument(n)&&!r?n.toString(t):new Aj.Document(n,r,t).toString(t)}wc.parse=$j;wc.parseAllDocuments=Mj;wc.parseDocument=N0;wc.stringify=Lj});var Qy=E($e=>{"use strict";var qj=$y(),jj=mc(),Fj=gy(),Xy=bc(),Bj=Za(),qs=_e(),Uj=xs(),Vj=Et(),Wj=$s(),zj=Ls(),Hj=Wf(),Kj=Hy(),Gj=Gy(),Yj=Jy(),Kf=P0(),R0=Ya();$e.Composer=qj.Composer;$e.Document=jj.Document;$e.Schema=Fj.Schema;$e.YAMLError=Xy.YAMLError;$e.YAMLParseError=Xy.YAMLParseError;$e.YAMLWarning=Xy.YAMLWarning;$e.Alias=Bj.Alias;$e.isAlias=qs.isAlias;$e.isCollection=qs.isCollection;$e.isDocument=qs.isDocument;$e.isMap=qs.isMap;$e.isNode=qs.isNode;$e.isPair=qs.isPair;$e.isScalar=qs.isScalar;$e.isSeq=qs.isSeq;$e.Pair=Uj.Pair;$e.Scalar=Vj.Scalar;$e.YAMLMap=Wj.YAMLMap;$e.YAMLSeq=zj.YAMLSeq;$e.CST=Hj;$e.Lexer=Kj.Lexer;$e.LineCounter=Gj.LineCounter;$e.Parser=Yj.Parser;$e.parse=Kf.parse;$e.parseAllDocuments=Kf.parseAllDocuments;$e.parseDocument=Kf.parseDocument;$e.stringify=Kf.stringify;$e.visit=R0.visit;$e.visitAsync=R0.visitAsync});var I0=E((kee,O0)=>{"use strict";O0.exports=C0;function C0(n,e,t){n instanceof RegExp&&(n=D0(n,t)),e instanceof RegExp&&(e=D0(e,t));var r=A0(n,e,t);return r&&{start:r[0],end:r[1],pre:t.slice(0,r[0]),body:t.slice(r[0]+n.length,r[1]),post:t.slice(r[1]+e.length)}}function D0(n,e){var t=e.match(n);return t?t[0]:null}C0.range=A0;function A0(n,e,t){var r,s,i,o,a,c=t.indexOf(n),l=t.indexOf(e,c+1),u=c;if(c>=0&&l>0){if(n===e)return[c,l];for(r=[],i=t.length;u>=0&&!a;)u==c?(r.push(u),c=t.indexOf(n,u+1)):r.length==1?a=[r.pop(),l]:(s=r.pop(),s<i&&(i=s,o=l),l=t.indexOf(e,u+1)),u=c<l&&c>=0?c:l;r.length&&(a=[i,o])}return a}});var B0=E((Nee,F0)=>{var x0=I0();F0.exports=Qj;var M0="\0SLASH"+Math.random()+"\0",$0="\0OPEN"+Math.random()+"\0",eb="\0CLOSE"+Math.random()+"\0",L0="\0COMMA"+Math.random()+"\0",q0="\0PERIOD"+Math.random()+"\0";function Zy(n){return parseInt(n,10)==n?parseInt(n,10):n.charCodeAt(0)}function Jj(n){return n.split("\\\\").join(M0).split("\\{").join($0).split("\\}").join(eb).split("\\,").join(L0).split("\\.").join(q0)}function Xj(n){return n.split(M0).join("\\").split($0).join("{").split(eb).join("}").split(L0).join(",").split(q0).join(".")}function j0(n){if(!n)return[""];var e=[],t=x0("{","}",n);if(!t)return n.split(",");var r=t.pre,s=t.body,i=t.post,o=r.split(",");o[o.length-1]+="{"+s+"}";var a=j0(i);return i.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function Qj(n){return n?(n.substr(0,2)==="{}"&&(n="\\{\\}"+n.substr(2)),kc(Jj(n),!0).map(Xj)):[]}function Zj(n){return"{"+n+"}"}function eF(n){return/^-?0\d/.test(n)}function tF(n,e){return n<=e}function nF(n,e){return n>=e}function kc(n,e){var t=[],r=x0("{","}",n);if(!r)return[n];var s=r.pre,i=r.post.length?kc(r.post,!1):[""];if(/\$$/.test(r.pre))for(var o=0;o<i.length;o++){var a=s+"{"+r.body+"}"+i[o];t.push(a)}else{var c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),u=c||l,d=r.body.indexOf(",")>=0;if(!u&&!d)return r.post.match(/,.*\}/)?(n=r.pre+"{"+r.body+eb+r.post,kc(n)):[n];var f;if(u)f=r.body.split(/\.\./);else if(f=j0(r.body),f.length===1&&(f=kc(f[0],!1).map(Zj),f.length===1))return i.map(function(Le){return r.pre+f[0]+Le});var p;if(u){var y=Zy(f[0]),m=Zy(f[1]),S=Math.max(f[0].length,f[1].length),w=f.length==3?Math.abs(Zy(f[2])):1,T=tF,v=m<y;v&&(w*=-1,T=nF);var R=f.some(eF);p=[];for(var A=y;T(A,m);A+=w){var M;if(l)M=String.fromCharCode(A),M==="\\"&&(M="");else if(M=String(A),R){var z=S-M.length;if(z>0){var j=new Array(z+1).join("0");A<0?M="-"+j+M.slice(1):M=j+M}}p.push(M)}}else{p=[];for(var ie=0;ie<f.length;ie++)p.push.apply(p,kc(f[ie],!1))}for(var ie=0;ie<p.length;ie++)for(var o=0;o<i.length;o++){var a=s+p[ie]+i[o];(!e||u||a)&&t.push(a)}}return t}});var Vc=E(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.regexpCode=we.getEsmExportName=we.getProperty=we.safeStringify=we.stringify=we.strConcat=we.addCodeArg=we.str=we._=we.nil=we._Code=we.Name=we.IDENTIFIER=we._CodeOrName=void 0;var Bc=class{};we._CodeOrName=Bc;we.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Ni=class extends Bc{constructor(e){if(super(),!we.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};we.Name=Ni;var Yn=class extends Bc{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,r)=>`${t}${r}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,r)=>(r instanceof Ni&&(t[r.str]=(t[r.str]||0)+1),t),{})}};we._Code=Yn;we.nil=new Yn("");function RD(n,...e){let t=[n[0]],r=0;for(;r<e.length;)vb(t,e[r]),t.push(n[++r]);return new Yn(t)}we._=RD;var bb=new Yn("+");function DD(n,...e){let t=[Uc(n[0])],r=0;for(;r<e.length;)t.push(bb),vb(t,e[r]),t.push(bb,Uc(n[++r]));return uB(t),new Yn(t)}we.str=DD;function vb(n,e){e instanceof Yn?n.push(...e._items):e instanceof Ni?n.push(e):n.push(hB(e))}we.addCodeArg=vb;function uB(n){let e=1;for(;e<n.length-1;){if(n[e]===bb){let t=dB(n[e-1],n[e+1]);if(t!==void 0){n.splice(e-1,3,t);continue}n[e++]="+"}e++}}function dB(n,e){if(e==='""')return n;if(n==='""')return e;if(typeof n=="string")return e instanceof Ni||n[n.length-1]!=='"'?void 0:typeof e!="string"?`${n.slice(0,-1)}${e}"`:e[0]==='"'?n.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(n instanceof Ni))return`"${n}${e.slice(1)}`}function fB(n,e){return e.emptyStr()?n:n.emptyStr()?e:DD`${n}${e}`}we.strConcat=fB;function hB(n){return typeof n=="number"||typeof n=="boolean"||n===null?n:Uc(Array.isArray(n)?n.join(","):n)}function pB(n){return new Yn(Uc(n))}we.stringify=pB;function Uc(n){return JSON.stringify(n).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}we.safeStringify=Uc;function mB(n){return typeof n=="string"&&we.IDENTIFIER.test(n)?new Yn(`.${n}`):RD`[${n}]`}we.getProperty=mB;function gB(n){if(typeof n=="string"&&we.IDENTIFIER.test(n))return new Yn(`${n}`);throw new Error(`CodeGen: invalid export name: ${n}, use explicit $id name mapping`)}we.getEsmExportName=gB;function yB(n){return new Yn(n.toString())}we.regexpCode=yB});var _b=E(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.ValueScope=kn.ValueScopeName=kn.Scope=kn.varKinds=kn.UsedValueState=void 0;var wn=Vc(),Tb=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},hh;(function(n){n[n.Started=0]="Started",n[n.Completed=1]="Completed"})(hh||(kn.UsedValueState=hh={}));kn.varKinds={const:new wn.Name("const"),let:new wn.Name("let"),var:new wn.Name("var")};var ph=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof wn.Name?e:this.name(e)}name(e){return new wn.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if(!((r=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||r===void 0)&&r.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};kn.Scope=ph;var mh=class extends wn.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=(0,wn._)`.${new wn.Name(t)}[${r}]`}};kn.ValueScopeName=mh;var bB=(0,wn._)`\n`,Sb=class extends ph{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?bB:wn.nil}}get(){return this._scope}name(e){return new mh(e,this._newName(e))}value(e,t){var r;if(t.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let s=this.toName(e),{prefix:i}=s,o=(r=t.key)!==null&&r!==void 0?r:t.ref,a=this._values[i];if(a){let u=a.get(o);if(u)return u}else a=this._values[i]=new Map;a.set(o,s);let c=this._scope[i]||(this._scope[i]=[]),l=c.length;return c[l]=t.ref,s.setValue(t,{property:i,itemIndex:l}),s}getValue(e,t){let r=this._values[e];if(r)return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,r=>{if(r.scopePath===void 0)throw new Error(`CodeGen: name "${r}" has no value`);return(0,wn._)`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,s=>{if(s.value===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return s.value.code},t,r)}_reduceValues(e,t,r={},s){let i=wn.nil;for(let o in e){let a=e[o];if(!a)continue;let c=r[o]=r[o]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,hh.Started);let u=t(l);if(u){let d=this.opts.es5?kn.varKinds.var:kn.varKinds.const;i=(0,wn._)`${i}${d} ${l} = ${u};${this.opts._n}`}else if(u=s?.(l))i=(0,wn._)`${i}${u}${this.opts._n}`;else throw new Tb(l);c.set(l,hh.Completed)})}return i}};kn.ValueScope=Sb});var ce=E(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.or=fe.and=fe.not=fe.CodeGen=fe.operators=fe.varKinds=fe.ValueScopeName=fe.ValueScope=fe.Scope=fe.Name=fe.regexpCode=fe.stringify=fe.getProperty=fe.nil=fe.strConcat=fe.str=fe._=void 0;var Te=Vc(),vr=_b(),Vs=Vc();Object.defineProperty(fe,"_",{enumerable:!0,get:function(){return Vs._}});Object.defineProperty(fe,"str",{enumerable:!0,get:function(){return Vs.str}});Object.defineProperty(fe,"strConcat",{enumerable:!0,get:function(){return Vs.strConcat}});Object.defineProperty(fe,"nil",{enumerable:!0,get:function(){return Vs.nil}});Object.defineProperty(fe,"getProperty",{enumerable:!0,get:function(){return Vs.getProperty}});Object.defineProperty(fe,"stringify",{enumerable:!0,get:function(){return Vs.stringify}});Object.defineProperty(fe,"regexpCode",{enumerable:!0,get:function(){return Vs.regexpCode}});Object.defineProperty(fe,"Name",{enumerable:!0,get:function(){return Vs.Name}});var vh=_b();Object.defineProperty(fe,"Scope",{enumerable:!0,get:function(){return vh.Scope}});Object.defineProperty(fe,"ValueScope",{enumerable:!0,get:function(){return vh.ValueScope}});Object.defineProperty(fe,"ValueScopeName",{enumerable:!0,get:function(){return vh.ValueScopeName}});Object.defineProperty(fe,"varKinds",{enumerable:!0,get:function(){return vh.varKinds}});fe.operators={GT:new Te._Code(">"),GTE:new Te._Code(">="),LT:new Te._Code("<"),LTE:new Te._Code("<="),EQ:new Te._Code("==="),NEQ:new Te._Code("!=="),NOT:new Te._Code("!"),OR:new Te._Code("||"),AND:new Te._Code("&&"),ADD:new Te._Code("+")};var rs=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},Eb=class extends rs{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?vr.varKinds.var:this.varKind,s=this.rhs===void 0?"":` = ${this.rhs}`;return`${r} ${this.name}${s};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=Zo(this.rhs,e,t)),this}get names(){return this.rhs instanceof Te._CodeOrName?this.rhs.names:{}}},gh=class extends rs{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof Te.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Zo(this.rhs,e,t),this}get names(){let e=this.lhs instanceof Te.Name?{}:{...this.lhs.names};return bh(e,this.rhs)}},wb=class extends gh{constructor(e,t,r,s){super(e,r,s),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},kb=class extends rs{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Nb=class extends rs{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Pb=class extends rs{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Rb=class extends rs{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=Zo(this.code,e,t),this}get names(){return this.code instanceof Te._CodeOrName?this.code.names:{}}},Wc=class extends rs{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,s=r.length;for(;s--;){let i=r[s];i.optimizeNames(e,t)||(vB(e,i.names),r.splice(s,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>Di(e,t.names),{})}},ss=class extends Wc{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Db=class extends Wc{},Qo=class extends ss{};Qo.kind="else";var Pi=class n extends ss{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let r=t.optimizeNodes();t=this.else=Array.isArray(r)?new Qo(r):r}if(t)return e===!1?t instanceof n?t:t.nodes:this.nodes.length?this:new n(CD(e),t instanceof n?[t]:t.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,t){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,t),!!(super.optimizeNames(e,t)||this.else))return this.condition=Zo(this.condition,e,t),this}get names(){let e=super.names;return bh(e,this.condition),this.else&&Di(e,this.else.names),e}};Pi.kind="if";var Ri=class extends ss{};Ri.kind="for";var Cb=class extends Ri{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=Zo(this.iteration,e,t),this}get names(){return Di(super.names,this.iteration.names)}},Ab=class extends Ri{constructor(e,t,r,s){super(),this.varKind=e,this.name=t,this.from=r,this.to=s}render(e){let t=e.es5?vr.varKinds.var:this.varKind,{name:r,from:s,to:i}=this;return`for(${t} ${r}=${s}; ${r}<${i}; ${r}++)`+super.render(e)}get names(){let e=bh(super.names,this.from);return bh(e,this.to)}},yh=class extends Ri{constructor(e,t,r,s){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=Zo(this.iterable,e,t),this}get names(){return Di(super.names,this.iterable.names)}},zc=class extends ss{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};zc.kind="func";var Hc=class extends Wc{render(e){return"return "+super.render(e)}};Hc.kind="return";var Ob=class extends ss{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var r,s;return super.optimizeNames(e,t),(r=this.catch)===null||r===void 0||r.optimizeNames(e,t),(s=this.finally)===null||s===void 0||s.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&Di(e,this.catch.names),this.finally&&Di(e,this.finally.names),e}},Kc=class extends ss{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Kc.kind="catch";var Gc=class extends ss{render(e){return"finally"+super.render(e)}};Gc.kind="finally";var Ib=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
176
- `:""},this._extScope=e,this._scope=new vr.Scope({parent:e}),this._nodes=[new Db]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,s){let i=this._scope.toName(t);return r!==void 0&&s&&(this._constants[i.str]=r),this._leafNode(new Eb(e,i,r)),i}const(e,t,r){return this._def(vr.varKinds.const,e,t,r)}let(e,t,r){return this._def(vr.varKinds.let,e,t,r)}var(e,t,r){return this._def(vr.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new gh(e,t,r))}add(e,t){return this._leafNode(new wb(e,fe.operators.ADD,t))}code(e){return typeof e=="function"?e():e!==Te.nil&&this._leafNode(new Rb(e)),this}object(...e){let t=["{"];for(let[r,s]of e)t.length>1&&t.push(","),t.push(r),(r!==s||this.opts.es5)&&(t.push(":"),(0,Te.addCodeArg)(t,s));return t.push("}"),new Te._Code(t)}if(e,t,r){if(this._blockNode(new Pi(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Pi(e))}else(){return this._elseNode(new Qo)}endIf(){return this._endBlockNode(Pi,Qo)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new Cb(e),t)}forRange(e,t,r,s,i=this.opts.es5?vr.varKinds.var:vr.varKinds.let){let o=this._scope.toName(e);return this._for(new Ab(i,o,t,r),()=>s(o))}forOf(e,t,r,s=vr.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let o=t instanceof Te.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,Te._)`${o}.length`,a=>{this.var(i,(0,Te._)`${o}[${a}]`),r(i)})}return this._for(new yh("of",s,i,t),()=>r(i))}forIn(e,t,r,s=this.opts.es5?vr.varKinds.var:vr.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Te._)`Object.keys(${t})`,r);let i=this._scope.toName(e);return this._for(new yh("in",s,i,t),()=>r(i))}endFor(){return this._endBlockNode(Ri)}label(e){return this._leafNode(new kb(e))}break(e){return this._leafNode(new Nb(e))}return(e){let t=new Hc;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Hc)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');let s=new Ob;if(this._blockNode(s),this.code(e),t){let i=this.name("e");this._currNode=s.catch=new Kc(i),t(i)}return r&&(this._currNode=s.finally=new Gc,this.code(r)),this._endBlockNode(Kc,Gc)}throw(e){return this._leafNode(new Pb(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw new Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||e!==void 0&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=Te.nil,r,s){return this._blockNode(new zc(e,t,r)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(zc)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof Pi))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};fe.CodeGen=Ib;function Di(n,e){for(let t in e)n[t]=(n[t]||0)+(e[t]||0);return n}function bh(n,e){return e instanceof Te._CodeOrName?Di(n,e.names):n}function Zo(n,e,t){if(n instanceof Te.Name)return r(n);if(!s(n))return n;return new Te._Code(n._items.reduce((i,o)=>(o instanceof Te.Name&&(o=r(o)),o instanceof Te._Code?i.push(...o._items):i.push(o),i),[]));function r(i){let o=t[i.str];return o===void 0||e[i.str]!==1?i:(delete e[i.str],o)}function s(i){return i instanceof Te._Code&&i._items.some(o=>o instanceof Te.Name&&e[o.str]===1&&t[o.str]!==void 0)}}function vB(n,e){for(let t in e)n[t]=(n[t]||0)-(e[t]||0)}function CD(n){return typeof n=="boolean"||typeof n=="number"||n===null?!n:(0,Te._)`!${xb(n)}`}fe.not=CD;var TB=AD(fe.operators.AND);function SB(...n){return n.reduce(TB)}fe.and=SB;var _B=AD(fe.operators.OR);function EB(...n){return n.reduce(_B)}fe.or=EB;function AD(n){return(e,t)=>e===Te.nil?t:t===Te.nil?e:(0,Te._)`${xb(e)} ${n} ${xb(t)}`}function xb(n){return n instanceof Te.Name?n:(0,Te._)`(${n})`}});var ge=E(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.checkStrictMode=he.getErrorPath=he.Type=he.useFunc=he.setEvaluated=he.evaluatedPropsToName=he.mergeEvaluated=he.eachItem=he.unescapeJsonPointer=he.escapeJsonPointer=he.escapeFragment=he.unescapeFragment=he.schemaRefOrVal=he.schemaHasRulesButRef=he.schemaHasRules=he.checkUnknownRules=he.alwaysValidSchema=he.toHash=void 0;var He=ce(),wB=Vc();function kB(n){let e={};for(let t of n)e[t]=!0;return e}he.toHash=kB;function NB(n,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(xD(n,e),!MD(e,n.self.RULES.all))}he.alwaysValidSchema=NB;function xD(n,e=n.schema){let{opts:t,self:r}=n;if(!t.strictSchema||typeof e=="boolean")return;let s=r.RULES.keywords;for(let i in e)s[i]||qD(n,`unknown keyword: "${i}"`)}he.checkUnknownRules=xD;function MD(n,e){if(typeof n=="boolean")return!n;for(let t in n)if(e[t])return!0;return!1}he.schemaHasRules=MD;function PB(n,e){if(typeof n=="boolean")return!n;for(let t in n)if(t!=="$ref"&&e.all[t])return!0;return!1}he.schemaHasRulesButRef=PB;function RB({topSchemaRef:n,schemaPath:e},t,r,s){if(!s){if(typeof t=="number"||typeof t=="boolean")return t;if(typeof t=="string")return(0,He._)`${t}`}return(0,He._)`${n}${e}${(0,He.getProperty)(r)}`}he.schemaRefOrVal=RB;function DB(n){return $D(decodeURIComponent(n))}he.unescapeFragment=DB;function CB(n){return encodeURIComponent($b(n))}he.escapeFragment=CB;function $b(n){return typeof n=="number"?`${n}`:n.replace(/~/g,"~0").replace(/\//g,"~1")}he.escapeJsonPointer=$b;function $D(n){return n.replace(/~1/g,"/").replace(/~0/g,"~")}he.unescapeJsonPointer=$D;function AB(n,e){if(Array.isArray(n))for(let t of n)e(t);else e(n)}he.eachItem=AB;function OD({mergeNames:n,mergeToName:e,mergeValues:t,resultToName:r}){return(s,i,o,a)=>{let c=o===void 0?i:o instanceof He.Name?(i instanceof He.Name?n(s,i,o):e(s,i,o),o):i instanceof He.Name?(e(s,o,i),i):t(i,o);return a===He.Name&&!(c instanceof He.Name)?r(s,c):c}}he.mergeEvaluated={props:OD({mergeNames:(n,e,t)=>n.if((0,He._)`${t} !== true && ${e} !== undefined`,()=>{n.if((0,He._)`${e} === true`,()=>n.assign(t,!0),()=>n.assign(t,(0,He._)`${t} || {}`).code((0,He._)`Object.assign(${t}, ${e})`))}),mergeToName:(n,e,t)=>n.if((0,He._)`${t} !== true`,()=>{e===!0?n.assign(t,!0):(n.assign(t,(0,He._)`${t} || {}`),Lb(n,t,e))}),mergeValues:(n,e)=>n===!0?!0:{...n,...e},resultToName:LD}),items:OD({mergeNames:(n,e,t)=>n.if((0,He._)`${t} !== true && ${e} !== undefined`,()=>n.assign(t,(0,He._)`${e} === true ? true : ${t} > ${e} ? ${t} : ${e}`)),mergeToName:(n,e,t)=>n.if((0,He._)`${t} !== true`,()=>n.assign(t,e===!0?!0:(0,He._)`${t} > ${e} ? ${t} : ${e}`)),mergeValues:(n,e)=>n===!0?!0:Math.max(n,e),resultToName:(n,e)=>n.var("items",e)})};function LD(n,e){if(e===!0)return n.var("props",!0);let t=n.var("props",(0,He._)`{}`);return e!==void 0&&Lb(n,t,e),t}he.evaluatedPropsToName=LD;function Lb(n,e,t){Object.keys(t).forEach(r=>n.assign((0,He._)`${e}${(0,He.getProperty)(r)}`,!0))}he.setEvaluated=Lb;var ID={};function OB(n,e){return n.scopeValue("func",{ref:e,code:ID[e.code]||(ID[e.code]=new wB._Code(e.code))})}he.useFunc=OB;var Mb;(function(n){n[n.Num=0]="Num",n[n.Str=1]="Str"})(Mb||(he.Type=Mb={}));function IB(n,e,t){if(n instanceof He.Name){let r=e===Mb.Num;return t?r?(0,He._)`"[" + ${n} + "]"`:(0,He._)`"['" + ${n} + "']"`:r?(0,He._)`"/" + ${n}`:(0,He._)`"/" + ${n}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return t?(0,He.getProperty)(n).toString():"/"+$b(n)}he.getErrorPath=IB;function qD(n,e,t=n.opts.strictSchema){if(t){if(e=`strict mode: ${e}`,t===!0)throw new Error(e);n.self.logger.warn(e)}}he.checkStrictMode=qD});var Jn=E(qb=>{"use strict";Object.defineProperty(qb,"__esModule",{value:!0});var tn=ce(),xB={data:new tn.Name("data"),valCxt:new tn.Name("valCxt"),instancePath:new tn.Name("instancePath"),parentData:new tn.Name("parentData"),parentDataProperty:new tn.Name("parentDataProperty"),rootData:new tn.Name("rootData"),dynamicAnchors:new tn.Name("dynamicAnchors"),vErrors:new tn.Name("vErrors"),errors:new tn.Name("errors"),this:new tn.Name("this"),self:new tn.Name("self"),scope:new tn.Name("scope"),json:new tn.Name("json"),jsonPos:new tn.Name("jsonPos"),jsonLen:new tn.Name("jsonLen"),jsonPart:new tn.Name("jsonPart")};qb.default=xB});var Yc=E(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.extendErrors=nn.resetErrorsCount=nn.reportExtraError=nn.reportError=nn.keyword$DataError=nn.keywordError=void 0;var Ee=ce(),Th=ge(),fn=Jn();nn.keywordError={message:({keyword:n})=>(0,Ee.str)`must pass "${n}" keyword validation`};nn.keyword$DataError={message:({keyword:n,schemaType:e})=>e?(0,Ee.str)`"${n}" keyword must be ${e} ($data)`:(0,Ee.str)`"${n}" keyword is invalid ($data)`};function MB(n,e=nn.keywordError,t,r){let{it:s}=n,{gen:i,compositeRule:o,allErrors:a}=s,c=BD(n,e,t);r??(o||a)?jD(i,c):FD(s,(0,Ee._)`[${c}]`)}nn.reportError=MB;function $B(n,e=nn.keywordError,t){let{it:r}=n,{gen:s,compositeRule:i,allErrors:o}=r,a=BD(n,e,t);jD(s,a),i||o||FD(r,fn.default.vErrors)}nn.reportExtraError=$B;function LB(n,e){n.assign(fn.default.errors,e),n.if((0,Ee._)`${fn.default.vErrors} !== null`,()=>n.if(e,()=>n.assign((0,Ee._)`${fn.default.vErrors}.length`,e),()=>n.assign(fn.default.vErrors,null)))}nn.resetErrorsCount=LB;function qB({gen:n,keyword:e,schemaValue:t,data:r,errsCount:s,it:i}){if(s===void 0)throw new Error("ajv implementation error");let o=n.name("err");n.forRange("i",s,fn.default.errors,a=>{n.const(o,(0,Ee._)`${fn.default.vErrors}[${a}]`),n.if((0,Ee._)`${o}.instancePath === undefined`,()=>n.assign((0,Ee._)`${o}.instancePath`,(0,Ee.strConcat)(fn.default.instancePath,i.errorPath))),n.assign((0,Ee._)`${o}.schemaPath`,(0,Ee.str)`${i.errSchemaPath}/${e}`),i.opts.verbose&&(n.assign((0,Ee._)`${o}.schema`,t),n.assign((0,Ee._)`${o}.data`,r))})}nn.extendErrors=qB;function jD(n,e){let t=n.const("err",e);n.if((0,Ee._)`${fn.default.vErrors} === null`,()=>n.assign(fn.default.vErrors,(0,Ee._)`[${t}]`),(0,Ee._)`${fn.default.vErrors}.push(${t})`),n.code((0,Ee._)`${fn.default.errors}++`)}function FD(n,e){let{gen:t,validateName:r,schemaEnv:s}=n;s.$async?t.throw((0,Ee._)`new ${n.ValidationError}(${e})`):(t.assign((0,Ee._)`${r}.errors`,e),t.return(!1))}var Ci={keyword:new Ee.Name("keyword"),schemaPath:new Ee.Name("schemaPath"),params:new Ee.Name("params"),propertyName:new Ee.Name("propertyName"),message:new Ee.Name("message"),schema:new Ee.Name("schema"),parentSchema:new Ee.Name("parentSchema")};function BD(n,e,t){let{createErrors:r}=n.it;return r===!1?(0,Ee._)`{}`:jB(n,e,t)}function jB(n,e,t={}){let{gen:r,it:s}=n,i=[FB(s,t),BB(n,t)];return UB(n,e,i),r.object(...i)}function FB({errorPath:n},{instancePath:e}){let t=e?(0,Ee.str)`${n}${(0,Th.getErrorPath)(e,Th.Type.Str)}`:n;return[fn.default.instancePath,(0,Ee.strConcat)(fn.default.instancePath,t)]}function BB({keyword:n,it:{errSchemaPath:e}},{schemaPath:t,parentSchema:r}){let s=r?e:(0,Ee.str)`${e}/${n}`;return t&&(s=(0,Ee.str)`${s}${(0,Th.getErrorPath)(t,Th.Type.Str)}`),[Ci.schemaPath,s]}function UB(n,{params:e,message:t},r){let{keyword:s,data:i,schemaValue:o,it:a}=n,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:d}=a;r.push([Ci.keyword,s],[Ci.params,typeof e=="function"?e(n):e||(0,Ee._)`{}`]),c.messages&&r.push([Ci.message,typeof t=="function"?t(n):t]),c.verbose&&r.push([Ci.schema,o],[Ci.parentSchema,(0,Ee._)`${u}${d}`],[fn.default.data,i]),l&&r.push([Ci.propertyName,l])}});var VD=E(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.boolOrEmptySchema=ea.topBoolOrEmptySchema=void 0;var VB=Yc(),WB=ce(),zB=Jn(),HB={message:"boolean schema is false"};function KB(n){let{gen:e,schema:t,validateName:r}=n;t===!1?UD(n,!1):typeof t=="object"&&t.$async===!0?e.return(zB.default.data):(e.assign((0,WB._)`${r}.errors`,null),e.return(!0))}ea.topBoolOrEmptySchema=KB;function GB(n,e){let{gen:t,schema:r}=n;r===!1?(t.var(e,!1),UD(n)):t.var(e,!0)}ea.boolOrEmptySchema=GB;function UD(n,e){let{gen:t,data:r}=n,s={gen:t,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:n};(0,VB.reportError)(s,HB,void 0,e)}});var jb=E(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.getRules=ta.isJSONType=void 0;var YB=["string","number","integer","boolean","null","object","array"],JB=new Set(YB);function XB(n){return typeof n=="string"&&JB.has(n)}ta.isJSONType=XB;function QB(){let n={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...n,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},n.number,n.string,n.array,n.object],post:{rules:[]},all:{},keywords:{}}}ta.getRules=QB});var Fb=E(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.shouldUseRule=Ws.shouldUseGroup=Ws.schemaHasRulesForType=void 0;function ZB({schema:n,self:e},t){let r=e.RULES.types[t];return r&&r!==!0&&WD(n,r)}Ws.schemaHasRulesForType=ZB;function WD(n,e){return e.rules.some(t=>zD(n,t))}Ws.shouldUseGroup=WD;function zD(n,e){var t;return n[e.keyword]!==void 0||((t=e.definition.implements)===null||t===void 0?void 0:t.some(r=>n[r]!==void 0))}Ws.shouldUseRule=zD});var Jc=E(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.reportTypeError=rn.checkDataTypes=rn.checkDataType=rn.coerceAndCheckDataType=rn.getJSONTypes=rn.getSchemaTypes=rn.DataType=void 0;var eU=jb(),tU=Fb(),nU=Yc(),ue=ce(),HD=ge(),na;(function(n){n[n.Correct=0]="Correct",n[n.Wrong=1]="Wrong"})(na||(rn.DataType=na={}));function rU(n){let e=KD(n.type);if(e.includes("null")){if(n.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&n.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');n.nullable===!0&&e.push("null")}return e}rn.getSchemaTypes=rU;function KD(n){let e=Array.isArray(n)?n:n?[n]:[];if(e.every(eU.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}rn.getJSONTypes=KD;function sU(n,e){let{gen:t,data:r,opts:s}=n,i=iU(e,s.coerceTypes),o=e.length>0&&!(i.length===0&&e.length===1&&(0,tU.schemaHasRulesForType)(n,e[0]));if(o){let a=Ub(e,r,s.strictNumbers,na.Wrong);t.if(a,()=>{i.length?oU(n,e,i):Vb(n)})}return o}rn.coerceAndCheckDataType=sU;var GD=new Set(["string","number","integer","boolean","null"]);function iU(n,e){return e?n.filter(t=>GD.has(t)||e==="array"&&t==="array"):[]}function oU(n,e,t){let{gen:r,data:s,opts:i}=n,o=r.let("dataType",(0,ue._)`typeof ${s}`),a=r.let("coerced",(0,ue._)`undefined`);i.coerceTypes==="array"&&r.if((0,ue._)`${o} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>r.assign(s,(0,ue._)`${s}[0]`).assign(o,(0,ue._)`typeof ${s}`).if(Ub(e,s,i.strictNumbers),()=>r.assign(a,s))),r.if((0,ue._)`${a} !== undefined`);for(let l of t)(GD.has(l)||l==="array"&&i.coerceTypes==="array")&&c(l);r.else(),Vb(n),r.endIf(),r.if((0,ue._)`${a} !== undefined`,()=>{r.assign(s,a),aU(n,a)});function c(l){switch(l){case"string":r.elseIf((0,ue._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,ue._)`"" + ${s}`).elseIf((0,ue._)`${s} === null`).assign(a,(0,ue._)`""`);return;case"number":r.elseIf((0,ue._)`${o} == "boolean" || ${s} === null
177
- || (${o} == "string" && ${s} && ${s} == +${s})`).assign(a,(0,ue._)`+${s}`);return;case"integer":r.elseIf((0,ue._)`${o} === "boolean" || ${s} === null
178
- || (${o} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(a,(0,ue._)`+${s}`);return;case"boolean":r.elseIf((0,ue._)`${s} === "false" || ${s} === 0 || ${s} === null`).assign(a,!1).elseIf((0,ue._)`${s} === "true" || ${s} === 1`).assign(a,!0);return;case"null":r.elseIf((0,ue._)`${s} === "" || ${s} === 0 || ${s} === false`),r.assign(a,null);return;case"array":r.elseIf((0,ue._)`${o} === "string" || ${o} === "number"
179
- || ${o} === "boolean" || ${s} === null`).assign(a,(0,ue._)`[${s}]`)}}}function aU({gen:n,parentData:e,parentDataProperty:t},r){n.if((0,ue._)`${e} !== undefined`,()=>n.assign((0,ue._)`${e}[${t}]`,r))}function Bb(n,e,t,r=na.Correct){let s=r===na.Correct?ue.operators.EQ:ue.operators.NEQ,i;switch(n){case"null":return(0,ue._)`${e} ${s} null`;case"array":i=(0,ue._)`Array.isArray(${e})`;break;case"object":i=(0,ue._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":i=o((0,ue._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":i=o();break;default:return(0,ue._)`typeof ${e} ${s} ${n}`}return r===na.Correct?i:(0,ue.not)(i);function o(a=ue.nil){return(0,ue.and)((0,ue._)`typeof ${e} == "number"`,a,t?(0,ue._)`isFinite(${e})`:ue.nil)}}rn.checkDataType=Bb;function Ub(n,e,t,r){if(n.length===1)return Bb(n[0],e,t,r);let s,i=(0,HD.toHash)(n);if(i.array&&i.object){let o=(0,ue._)`typeof ${e} != "object"`;s=i.null?o:(0,ue._)`!${e} || ${o}`,delete i.null,delete i.array,delete i.object}else s=ue.nil;i.number&&delete i.integer;for(let o in i)s=(0,ue.and)(s,Bb(o,e,t,r));return s}rn.checkDataTypes=Ub;var cU={message:({schema:n})=>`must be ${n}`,params:({schema:n,schemaValue:e})=>typeof n=="string"?(0,ue._)`{type: ${n}}`:(0,ue._)`{type: ${e}}`};function Vb(n){let e=lU(n);(0,nU.reportError)(e,cU)}rn.reportTypeError=Vb;function lU(n){let{gen:e,data:t,schema:r}=n,s=(0,HD.schemaRefOrVal)(n,r,"type");return{gen:e,keyword:"type",data:t,schema:r.type,schemaCode:s,schemaValue:s,parentSchema:r,params:{},it:n}}});var JD=E(Sh=>{"use strict";Object.defineProperty(Sh,"__esModule",{value:!0});Sh.assignDefaults=void 0;var ra=ce(),uU=ge();function dU(n,e){let{properties:t,items:r}=n.schema;if(e==="object"&&t)for(let s in t)YD(n,s,t[s].default);else e==="array"&&Array.isArray(r)&&r.forEach((s,i)=>YD(n,i,s.default))}Sh.assignDefaults=dU;function YD(n,e,t){let{gen:r,compositeRule:s,data:i,opts:o}=n;if(t===void 0)return;let a=(0,ra._)`${i}${(0,ra.getProperty)(e)}`;if(s){(0,uU.checkStrictMode)(n,`default is ignored for: ${a}`);return}let c=(0,ra._)`${a} === undefined`;o.useDefaults==="empty"&&(c=(0,ra._)`${c} || ${a} === null || ${a} === ""`),r.if(c,(0,ra._)`${a} = ${(0,ra.stringify)(t)}`)}});var Xn=E(Be=>{"use strict";Object.defineProperty(Be,"__esModule",{value:!0});Be.validateUnion=Be.validateArray=Be.usePattern=Be.callValidateCode=Be.schemaProperties=Be.allSchemaProperties=Be.noPropertyInData=Be.propertyInData=Be.isOwnProperty=Be.hasPropFunc=Be.reportMissingProp=Be.checkMissingProp=Be.checkReportMissingProp=void 0;var rt=ce(),Wb=ge(),zs=Jn(),fU=ge();function hU(n,e){let{gen:t,data:r,it:s}=n;t.if(Hb(t,r,e,s.opts.ownProperties),()=>{n.setParams({missingProperty:(0,rt._)`${e}`},!0),n.error()})}Be.checkReportMissingProp=hU;function pU({gen:n,data:e,it:{opts:t}},r,s){return(0,rt.or)(...r.map(i=>(0,rt.and)(Hb(n,e,i,t.ownProperties),(0,rt._)`${s} = ${i}`)))}Be.checkMissingProp=pU;function mU(n,e){n.setParams({missingProperty:e},!0),n.error()}Be.reportMissingProp=mU;function XD(n){return n.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,rt._)`Object.prototype.hasOwnProperty`})}Be.hasPropFunc=XD;function zb(n,e,t){return(0,rt._)`${XD(n)}.call(${e}, ${t})`}Be.isOwnProperty=zb;function gU(n,e,t,r){let s=(0,rt._)`${e}${(0,rt.getProperty)(t)} !== undefined`;return r?(0,rt._)`${s} && ${zb(n,e,t)}`:s}Be.propertyInData=gU;function Hb(n,e,t,r){let s=(0,rt._)`${e}${(0,rt.getProperty)(t)} === undefined`;return r?(0,rt.or)(s,(0,rt.not)(zb(n,e,t))):s}Be.noPropertyInData=Hb;function QD(n){return n?Object.keys(n).filter(e=>e!=="__proto__"):[]}Be.allSchemaProperties=QD;function yU(n,e){return QD(e).filter(t=>!(0,Wb.alwaysValidSchema)(n,e[t]))}Be.schemaProperties=yU;function bU({schemaCode:n,data:e,it:{gen:t,topSchemaRef:r,schemaPath:s,errorPath:i},it:o},a,c,l){let u=l?(0,rt._)`${n}, ${e}, ${r}${s}`:e,d=[[zs.default.instancePath,(0,rt.strConcat)(zs.default.instancePath,i)],[zs.default.parentData,o.parentData],[zs.default.parentDataProperty,o.parentDataProperty],[zs.default.rootData,zs.default.rootData]];o.opts.dynamicRef&&d.push([zs.default.dynamicAnchors,zs.default.dynamicAnchors]);let f=(0,rt._)`${u}, ${t.object(...d)}`;return c!==rt.nil?(0,rt._)`${a}.call(${c}, ${f})`:(0,rt._)`${a}(${f})`}Be.callValidateCode=bU;var vU=(0,rt._)`new RegExp`;function TU({gen:n,it:{opts:e}},t){let r=e.unicodeRegExp?"u":"",{regExp:s}=e.code,i=s(t,r);return n.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,rt._)`${s.code==="new RegExp"?vU:(0,fU.useFunc)(n,s)}(${t}, ${r})`})}Be.usePattern=TU;function SU(n){let{gen:e,data:t,keyword:r,it:s}=n,i=e.name("valid");if(s.allErrors){let a=e.let("valid",!0);return o(()=>e.assign(a,!1)),a}return e.var(i,!0),o(()=>e.break()),i;function o(a){let c=e.const("len",(0,rt._)`${t}.length`);e.forRange("i",0,c,l=>{n.subschema({keyword:r,dataProp:l,dataPropType:Wb.Type.Num},i),e.if((0,rt.not)(i),a)})}}Be.validateArray=SU;function _U(n){let{gen:e,schema:t,keyword:r,it:s}=n;if(!Array.isArray(t))throw new Error("ajv implementation error");if(t.some(c=>(0,Wb.alwaysValidSchema)(s,c))&&!s.opts.unevaluated)return;let o=e.let("valid",!1),a=e.name("_valid");e.block(()=>t.forEach((c,l)=>{let u=n.subschema({keyword:r,schemaProp:l,compositeRule:!0},a);e.assign(o,(0,rt._)`${o} || ${a}`),n.mergeValidEvaluated(u,a)||e.if((0,rt.not)(o))})),n.result(o,()=>n.reset(),()=>n.error(!0))}Be.validateUnion=_U});var tC=E(qr=>{"use strict";Object.defineProperty(qr,"__esModule",{value:!0});qr.validateKeywordUsage=qr.validSchemaType=qr.funcKeywordCode=qr.macroKeywordCode=void 0;var hn=ce(),Ai=Jn(),EU=Xn(),wU=Yc();function kU(n,e){let{gen:t,keyword:r,schema:s,parentSchema:i,it:o}=n,a=e.macro.call(o.self,s,i,o),c=eC(t,r,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);let l=t.name("valid");n.subschema({schema:a,schemaPath:hn.nil,errSchemaPath:`${o.errSchemaPath}/${r}`,topSchemaRef:c,compositeRule:!0},l),n.pass(l,()=>n.error(!0))}qr.macroKeywordCode=kU;function NU(n,e){var t;let{gen:r,keyword:s,schema:i,parentSchema:o,$data:a,it:c}=n;RU(c,e);let l=!a&&e.compile?e.compile.call(c.self,i,o,c):e.validate,u=eC(r,s,l),d=r.let("valid");n.block$data(d,f),n.ok((t=e.valid)!==null&&t!==void 0?t:d);function f(){if(e.errors===!1)m(),e.modifying&&ZD(n),S(()=>n.error());else{let w=e.async?p():y();e.modifying&&ZD(n),S(()=>PU(n,w))}}function p(){let w=r.let("ruleErrs",null);return r.try(()=>m((0,hn._)`await `),T=>r.assign(d,!1).if((0,hn._)`${T} instanceof ${c.ValidationError}`,()=>r.assign(w,(0,hn._)`${T}.errors`),()=>r.throw(T))),w}function y(){let w=(0,hn._)`${u}.errors`;return r.assign(w,null),m(hn.nil),w}function m(w=e.async?(0,hn._)`await `:hn.nil){let T=c.opts.passContext?Ai.default.this:Ai.default.self,v=!("compile"in e&&!a||e.schema===!1);r.assign(d,(0,hn._)`${w}${(0,EU.callValidateCode)(n,u,T,v)}`,e.modifying)}function S(w){var T;r.if((0,hn.not)((T=e.valid)!==null&&T!==void 0?T:d),w)}}qr.funcKeywordCode=NU;function ZD(n){let{gen:e,data:t,it:r}=n;e.if(r.parentData,()=>e.assign(t,(0,hn._)`${r.parentData}[${r.parentDataProperty}]`))}function PU(n,e){let{gen:t}=n;t.if((0,hn._)`Array.isArray(${e})`,()=>{t.assign(Ai.default.vErrors,(0,hn._)`${Ai.default.vErrors} === null ? ${e} : ${Ai.default.vErrors}.concat(${e})`).assign(Ai.default.errors,(0,hn._)`${Ai.default.vErrors}.length`),(0,wU.extendErrors)(n)},()=>n.error())}function RU({schemaEnv:n},e){if(e.async&&!n.$async)throw new Error("async keyword in sync schema")}function eC(n,e,t){if(t===void 0)throw new Error(`keyword "${e}" failed to compile`);return n.scopeValue("keyword",typeof t=="function"?{ref:t}:{ref:t,code:(0,hn.stringify)(t)})}function DU(n,e,t=!1){return!e.length||e.some(r=>r==="array"?Array.isArray(n):r==="object"?n&&typeof n=="object"&&!Array.isArray(n):typeof n==r||t&&typeof n>"u")}qr.validSchemaType=DU;function CU({schema:n,opts:e,self:t,errSchemaPath:r},s,i){if(Array.isArray(s.keyword)?!s.keyword.includes(i):s.keyword!==i)throw new Error("ajv implementation error");let o=s.dependencies;if(o?.some(a=>!Object.prototype.hasOwnProperty.call(n,a)))throw new Error(`parent schema must have dependencies of ${i}: ${o.join(",")}`);if(s.validateSchema&&!s.validateSchema(n[i])){let c=`keyword "${i}" value is invalid at path "${r}": `+t.errorsText(s.validateSchema.errors);if(e.validateSchema==="log")t.logger.error(c);else throw new Error(c)}}qr.validateKeywordUsage=CU});var rC=E(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.extendSubschemaMode=Hs.extendSubschemaData=Hs.getSubschema=void 0;var jr=ce(),nC=ge();function AU(n,{keyword:e,schemaProp:t,schema:r,schemaPath:s,errSchemaPath:i,topSchemaRef:o}){if(e!==void 0&&r!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=n.schema[e];return t===void 0?{schema:a,schemaPath:(0,jr._)`${n.schemaPath}${(0,jr.getProperty)(e)}`,errSchemaPath:`${n.errSchemaPath}/${e}`}:{schema:a[t],schemaPath:(0,jr._)`${n.schemaPath}${(0,jr.getProperty)(e)}${(0,jr.getProperty)(t)}`,errSchemaPath:`${n.errSchemaPath}/${e}/${(0,nC.escapeFragment)(t)}`}}if(r!==void 0){if(s===void 0||i===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:r,schemaPath:s,topSchemaRef:o,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}Hs.getSubschema=AU;function OU(n,e,{dataProp:t,dataPropType:r,data:s,dataTypes:i,propertyName:o}){if(s!==void 0&&t!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(t!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=e,f=a.let("data",(0,jr._)`${e.data}${(0,jr.getProperty)(t)}`,!0);c(f),n.errorPath=(0,jr.str)`${l}${(0,nC.getErrorPath)(t,r,d.jsPropertySyntax)}`,n.parentDataProperty=(0,jr._)`${t}`,n.dataPathArr=[...u,n.parentDataProperty]}if(s!==void 0){let l=s instanceof jr.Name?s:a.let("data",s,!0);c(l),o!==void 0&&(n.propertyName=o)}i&&(n.dataTypes=i);function c(l){n.data=l,n.dataLevel=e.dataLevel+1,n.dataTypes=[],e.definedProperties=new Set,n.parentData=e.data,n.dataNames=[...e.dataNames,l]}}Hs.extendSubschemaData=OU;function IU(n,{jtdDiscriminator:e,jtdMetadata:t,compositeRule:r,createErrors:s,allErrors:i}){r!==void 0&&(n.compositeRule=r),s!==void 0&&(n.createErrors=s),i!==void 0&&(n.allErrors=i),n.jtdDiscriminator=e,n.jtdMetadata=t}Hs.extendSubschemaMode=IU});var Kb=E((jte,sC)=>{"use strict";sC.exports=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,s,i;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(s=r;s--!==0;)if(!n(e[s],t[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[s]))return!1;for(s=r;s--!==0;){var o=i[s];if(!n(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}});var oC=E((Fte,iC)=>{"use strict";var Ks=iC.exports=function(n,e,t){typeof e=="function"&&(t=e,e={}),t=e.cb||t;var r=typeof t=="function"?t:t.pre||function(){},s=t.post||function(){};_h(e,r,s,n,"",n)};Ks.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Ks.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Ks.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Ks.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function _h(n,e,t,r,s,i,o,a,c,l){if(r&&typeof r=="object"&&!Array.isArray(r)){e(r,s,i,o,a,c,l);for(var u in r){var d=r[u];if(Array.isArray(d)){if(u in Ks.arrayKeywords)for(var f=0;f<d.length;f++)_h(n,e,t,d[f],s+"/"+u+"/"+f,i,s,u,r,f)}else if(u in Ks.propsKeywords){if(d&&typeof d=="object")for(var p in d)_h(n,e,t,d[p],s+"/"+u+"/"+xU(p),i,s,u,r,p)}else(u in Ks.keywords||n.allKeys&&!(u in Ks.skipKeywords))&&_h(n,e,t,d,s+"/"+u,i,s,u,r)}t(r,s,i,o,a,c,l)}}function xU(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}});var Xc=E(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.getSchemaRefs=Nn.resolveUrl=Nn.normalizeId=Nn._getFullPath=Nn.getFullPath=Nn.inlineRef=void 0;var MU=ge(),$U=Kb(),LU=oC(),qU=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function jU(n,e=!0){return typeof n=="boolean"?!0:e===!0?!Gb(n):e?aC(n)<=e:!1}Nn.inlineRef=jU;var FU=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Gb(n){for(let e in n){if(FU.has(e))return!0;let t=n[e];if(Array.isArray(t)&&t.some(Gb)||typeof t=="object"&&Gb(t))return!0}return!1}function aC(n){let e=0;for(let t in n){if(t==="$ref")return 1/0;if(e++,!qU.has(t)&&(typeof n[t]=="object"&&(0,MU.eachItem)(n[t],r=>e+=aC(r)),e===1/0))return 1/0}return e}function cC(n,e="",t){t!==!1&&(e=sa(e));let r=n.parse(e);return lC(n,r)}Nn.getFullPath=cC;function lC(n,e){return n.serialize(e).split("#")[0]+"#"}Nn._getFullPath=lC;var BU=/#\/?$/;function sa(n){return n?n.replace(BU,""):""}Nn.normalizeId=sa;function UU(n,e,t){return t=sa(t),n.resolve(e,t)}Nn.resolveUrl=UU;var VU=/^[a-z_][-a-z0-9._]*$/i;function WU(n,e){if(typeof n=="boolean")return{};let{schemaId:t,uriResolver:r}=this.opts,s=sa(n[t]||e),i={"":s},o=cC(r,s,!1),a={},c=new Set;return LU(n,{allKeys:!0},(d,f,p,y)=>{if(y===void 0)return;let m=o+f,S=i[y];typeof d[t]=="string"&&(S=w.call(this,d[t])),T.call(this,d.$anchor),T.call(this,d.$dynamicAnchor),i[f]=S;function w(v){let R=this.opts.uriResolver.resolve;if(v=sa(S?R(S,v):v),c.has(v))throw u(v);c.add(v);let A=this.refs[v];return typeof A=="string"&&(A=this.refs[A]),typeof A=="object"?l(d,A.schema,v):v!==sa(m)&&(v[0]==="#"?(l(d,a[v],v),a[v]=d):this.refs[v]=m),v}function T(v){if(typeof v=="string"){if(!VU.test(v))throw new Error(`invalid anchor "${v}"`);w.call(this,`#${v}`)}}}),a;function l(d,f,p){if(f!==void 0&&!$U(d,f))throw u(p)}function u(d){return new Error(`reference "${d}" resolves to more than one schema`)}}Nn.getSchemaRefs=WU});var el=E(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});Gs.getData=Gs.KeywordCxt=Gs.validateFunctionCode=void 0;var pC=VD(),uC=Jc(),Jb=Fb(),Eh=Jc(),zU=JD(),Zc=tC(),Yb=rC(),J=ce(),re=Jn(),HU=Xc(),is=ge(),Qc=Yc();function KU(n){if(yC(n)&&(bC(n),gC(n))){JU(n);return}mC(n,()=>(0,pC.topBoolOrEmptySchema)(n))}Gs.validateFunctionCode=KU;function mC({gen:n,validateName:e,schema:t,schemaEnv:r,opts:s},i){s.code.es5?n.func(e,(0,J._)`${re.default.data}, ${re.default.valCxt}`,r.$async,()=>{n.code((0,J._)`"use strict"; ${dC(t,s)}`),YU(n,s),n.code(i)}):n.func(e,(0,J._)`${re.default.data}, ${GU(s)}`,r.$async,()=>n.code(dC(t,s)).code(i))}function GU(n){return(0,J._)`{${re.default.instancePath}="", ${re.default.parentData}, ${re.default.parentDataProperty}, ${re.default.rootData}=${re.default.data}${n.dynamicRef?(0,J._)`, ${re.default.dynamicAnchors}={}`:J.nil}}={}`}function YU(n,e){n.if(re.default.valCxt,()=>{n.var(re.default.instancePath,(0,J._)`${re.default.valCxt}.${re.default.instancePath}`),n.var(re.default.parentData,(0,J._)`${re.default.valCxt}.${re.default.parentData}`),n.var(re.default.parentDataProperty,(0,J._)`${re.default.valCxt}.${re.default.parentDataProperty}`),n.var(re.default.rootData,(0,J._)`${re.default.valCxt}.${re.default.rootData}`),e.dynamicRef&&n.var(re.default.dynamicAnchors,(0,J._)`${re.default.valCxt}.${re.default.dynamicAnchors}`)},()=>{n.var(re.default.instancePath,(0,J._)`""`),n.var(re.default.parentData,(0,J._)`undefined`),n.var(re.default.parentDataProperty,(0,J._)`undefined`),n.var(re.default.rootData,re.default.data),e.dynamicRef&&n.var(re.default.dynamicAnchors,(0,J._)`{}`)})}function JU(n){let{schema:e,opts:t,gen:r}=n;mC(n,()=>{t.$comment&&e.$comment&&TC(n),tV(n),r.let(re.default.vErrors,null),r.let(re.default.errors,0),t.unevaluated&&XU(n),vC(n),sV(n)})}function XU(n){let{gen:e,validateName:t}=n;n.evaluated=e.const("evaluated",(0,J._)`${t}.evaluated`),e.if((0,J._)`${n.evaluated}.dynamicProps`,()=>e.assign((0,J._)`${n.evaluated}.props`,(0,J._)`undefined`)),e.if((0,J._)`${n.evaluated}.dynamicItems`,()=>e.assign((0,J._)`${n.evaluated}.items`,(0,J._)`undefined`))}function dC(n,e){let t=typeof n=="object"&&n[e.schemaId];return t&&(e.code.source||e.code.process)?(0,J._)`/*# sourceURL=${t} */`:J.nil}function QU(n,e){if(yC(n)&&(bC(n),gC(n))){ZU(n,e);return}(0,pC.boolOrEmptySchema)(n,e)}function gC({schema:n,self:e}){if(typeof n=="boolean")return!n;for(let t in n)if(e.RULES.all[t])return!0;return!1}function yC(n){return typeof n.schema!="boolean"}function ZU(n,e){let{schema:t,gen:r,opts:s}=n;s.$comment&&t.$comment&&TC(n),nV(n),rV(n);let i=r.const("_errs",re.default.errors);vC(n,i),r.var(e,(0,J._)`${i} === ${re.default.errors}`)}function bC(n){(0,is.checkUnknownRules)(n),eV(n)}function vC(n,e){if(n.opts.jtd)return fC(n,[],!1,e);let t=(0,uC.getSchemaTypes)(n.schema),r=(0,uC.coerceAndCheckDataType)(n,t);fC(n,t,!r,e)}function eV(n){let{schema:e,errSchemaPath:t,opts:r,self:s}=n;e.$ref&&r.ignoreKeywordsWithRef&&(0,is.schemaHasRulesButRef)(e,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${t}"`)}function tV(n){let{schema:e,opts:t}=n;e.default!==void 0&&t.useDefaults&&t.strictSchema&&(0,is.checkStrictMode)(n,"default is ignored in the schema root")}function nV(n){let e=n.schema[n.opts.schemaId];e&&(n.baseId=(0,HU.resolveUrl)(n.opts.uriResolver,n.baseId,e))}function rV(n){if(n.schema.$async&&!n.schemaEnv.$async)throw new Error("async schema in sync schema")}function TC({gen:n,schemaEnv:e,schema:t,errSchemaPath:r,opts:s}){let i=t.$comment;if(s.$comment===!0)n.code((0,J._)`${re.default.self}.logger.log(${i})`);else if(typeof s.$comment=="function"){let o=(0,J.str)`${r}/$comment`,a=n.scopeValue("root",{ref:e.root});n.code((0,J._)`${re.default.self}.opts.$comment(${i}, ${o}, ${a}.schema)`)}}function sV(n){let{gen:e,schemaEnv:t,validateName:r,ValidationError:s,opts:i}=n;t.$async?e.if((0,J._)`${re.default.errors} === 0`,()=>e.return(re.default.data),()=>e.throw((0,J._)`new ${s}(${re.default.vErrors})`)):(e.assign((0,J._)`${r}.errors`,re.default.vErrors),i.unevaluated&&iV(n),e.return((0,J._)`${re.default.errors} === 0`))}function iV({gen:n,evaluated:e,props:t,items:r}){t instanceof J.Name&&n.assign((0,J._)`${e}.props`,t),r instanceof J.Name&&n.assign((0,J._)`${e}.items`,r)}function fC(n,e,t,r){let{gen:s,schema:i,data:o,allErrors:a,opts:c,self:l}=n,{RULES:u}=l;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,is.schemaHasRulesButRef)(i,u))){s.block(()=>_C(n,"$ref",u.all.$ref.definition));return}c.jtd||oV(n,e),s.block(()=>{for(let f of u.rules)d(f);d(u.post)});function d(f){(0,Jb.shouldUseGroup)(i,f)&&(f.type?(s.if((0,Eh.checkDataType)(f.type,o,c.strictNumbers)),hC(n,f),e.length===1&&e[0]===f.type&&t&&(s.else(),(0,Eh.reportTypeError)(n)),s.endIf()):hC(n,f),a||s.if((0,J._)`${re.default.errors} === ${r||0}`))}}function hC(n,e){let{gen:t,schema:r,opts:{useDefaults:s}}=n;s&&(0,zU.assignDefaults)(n,e.type),t.block(()=>{for(let i of e.rules)(0,Jb.shouldUseRule)(r,i)&&_C(n,i.keyword,i.definition,e.type)})}function oV(n,e){n.schemaEnv.meta||!n.opts.strictTypes||(aV(n,e),n.opts.allowUnionTypes||cV(n,e),lV(n,n.dataTypes))}function aV(n,e){if(e.length){if(!n.dataTypes.length){n.dataTypes=e;return}e.forEach(t=>{SC(n.dataTypes,t)||Xb(n,`type "${t}" not allowed by context "${n.dataTypes.join(",")}"`)}),dV(n,e)}}function cV(n,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Xb(n,"use allowUnionTypes to allow union type keyword")}function lV(n,e){let t=n.self.RULES.all;for(let r in t){let s=t[r];if(typeof s=="object"&&(0,Jb.shouldUseRule)(n.schema,s)){let{type:i}=s.definition;i.length&&!i.some(o=>uV(e,o))&&Xb(n,`missing type "${i.join(",")}" for keyword "${r}"`)}}}function uV(n,e){return n.includes(e)||e==="number"&&n.includes("integer")}function SC(n,e){return n.includes(e)||e==="integer"&&n.includes("number")}function dV(n,e){let t=[];for(let r of n.dataTypes)SC(e,r)?t.push(r):e.includes("integer")&&r==="number"&&t.push("integer");n.dataTypes=t}function Xb(n,e){let t=n.schemaEnv.baseId+n.errSchemaPath;e+=` at "${t}" (strictTypes)`,(0,is.checkStrictMode)(n,e,n.opts.strictTypes)}var wh=class{constructor(e,t,r){if((0,Zc.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,is.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",EC(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Zc.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:t.errors!==!1)&&(this.errsCount=e.gen.const("_errs",re.default.errors))}result(e,t,r){this.failResult((0,J.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,J.not)(e),void 0,t)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,J._)`${t} !== undefined && (${(0,J.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?Qc.reportExtraError:Qc.reportError)(this,this.def.error,t)}$dataError(){(0,Qc.reportError)(this,this.def.$dataError||Qc.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Qc.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=J.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=J.nil,t=J.nil){if(!this.$data)return;let{gen:r,schemaCode:s,schemaType:i,def:o}=this;r.if((0,J.or)((0,J._)`${s} === undefined`,t)),e!==J.nil&&r.assign(e,!0),(i.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==J.nil&&r.assign(e,!1)),r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:s,it:i}=this;return(0,J.or)(o(),a());function o(){if(r.length){if(!(t instanceof J.Name))throw new Error("ajv implementation error");let c=Array.isArray(r)?r:[r];return(0,J._)`${(0,Eh.checkDataTypes)(c,t,i.opts.strictNumbers,Eh.DataType.Wrong)}`}return J.nil}function a(){if(s.validateSchema){let c=e.scopeValue("validate$data",{ref:s.validateSchema});return(0,J._)`!${c}(${t})`}return J.nil}}subschema(e,t){let r=(0,Yb.getSubschema)(this.it,e);(0,Yb.extendSubschemaData)(r,this.it,e),(0,Yb.extendSubschemaMode)(r,e);let s={...this.it,...r,items:void 0,props:void 0};return QU(s,t),s}mergeEvaluated(e,t){let{it:r,gen:s}=this;r.opts.unevaluated&&(r.props!==!0&&e.props!==void 0&&(r.props=is.mergeEvaluated.props(s,e.props,r.props,t)),r.items!==!0&&e.items!==void 0&&(r.items=is.mergeEvaluated.items(s,e.items,r.items,t)))}mergeValidEvaluated(e,t){let{it:r,gen:s}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return s.if(t,()=>this.mergeEvaluated(e,J.Name)),!0}};Gs.KeywordCxt=wh;function _C(n,e,t,r){let s=new wh(n,t,e);"code"in t?t.code(s,r):s.$data&&t.validate?(0,Zc.funcKeywordCode)(s,t):"macro"in t?(0,Zc.macroKeywordCode)(s,t):(t.compile||t.validate)&&(0,Zc.funcKeywordCode)(s,t)}var fV=/^\/(?:[^~]|~0|~1)*$/,hV=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function EC(n,{dataLevel:e,dataNames:t,dataPathArr:r}){let s,i;if(n==="")return re.default.rootData;if(n[0]==="/"){if(!fV.test(n))throw new Error(`Invalid JSON-pointer: ${n}`);s=n,i=re.default.rootData}else{let l=hV.exec(n);if(!l)throw new Error(`Invalid JSON-pointer: ${n}`);let u=+l[1];if(s=l[2],s==="#"){if(u>=e)throw new Error(c("property/index",u));return r[e-u]}if(u>e)throw new Error(c("data",u));if(i=t[e-u],!s)return i}let o=i,a=s.split("/");for(let l of a)l&&(i=(0,J._)`${i}${(0,J.getProperty)((0,is.unescapeJsonPointer)(l))}`,o=(0,J._)`${o} && ${i}`);return o;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${e}`}}Gs.getData=EC});var kh=E(Zb=>{"use strict";Object.defineProperty(Zb,"__esModule",{value:!0});var Qb=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Zb.default=Qb});var tl=E(nv=>{"use strict";Object.defineProperty(nv,"__esModule",{value:!0});var ev=Xc(),tv=class extends Error{constructor(e,t,r,s){super(s||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,ev.resolveUrl)(e,t,r),this.missingSchema=(0,ev.normalizeId)((0,ev.getFullPath)(e,this.missingRef))}};nv.default=tv});var nl=E(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.resolveSchema=Qn.getCompilingSchema=Qn.resolveRef=Qn.compileSchema=Qn.SchemaEnv=void 0;var Tr=ce(),pV=kh(),Oi=Jn(),Sr=Xc(),wC=ge(),mV=el(),ia=class{constructor(e){var t;this.refs={},this.dynamicAnchors={};let r;typeof e.schema=="object"&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:(0,Sr.normalizeId)(r?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=r?.$async,this.refs={}}};Qn.SchemaEnv=ia;function sv(n){let e=kC.call(this,n);if(e)return e;let t=(0,Sr.getFullPath)(this.opts.uriResolver,n.root.baseId),{es5:r,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new Tr.CodeGen(this.scope,{es5:r,lines:s,ownProperties:i}),a;n.$async&&(a=o.scopeValue("Error",{ref:pV.default,code:(0,Tr._)`require("ajv/dist/runtime/validation_error").default`}));let c=o.scopeName("validate");n.validateName=c;let l={gen:o,allErrors:this.opts.allErrors,data:Oi.default.data,parentData:Oi.default.parentData,parentDataProperty:Oi.default.parentDataProperty,dataNames:[Oi.default.data],dataPathArr:[Tr.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:n.schema,code:(0,Tr.stringify)(n.schema)}:{ref:n.schema}),validateName:c,ValidationError:a,schema:n.schema,schemaEnv:n,rootId:t,baseId:n.baseId||t,schemaPath:Tr.nil,errSchemaPath:n.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Tr._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(n),(0,mV.validateFunctionCode)(l),o.optimize(this.opts.code.optimize);let d=o.toString();u=`${o.scopeRefs(Oi.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,n));let p=new Function(`${Oi.default.self}`,`${Oi.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:p}),p.errors=null,p.schema=n.schema,p.schemaEnv=n,n.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:c,validateCode:d,scopeValues:o._values}),this.opts.unevaluated){let{props:y,items:m}=l;p.evaluated={props:y instanceof Tr.Name?void 0:y,items:m instanceof Tr.Name?void 0:m,dynamicProps:y instanceof Tr.Name,dynamicItems:m instanceof Tr.Name},p.source&&(p.source.evaluated=(0,Tr.stringify)(p.evaluated))}return n.validate=p,n}catch(d){throw delete n.validate,delete n.validateName,u&&this.logger.error("Error compiling schema, function code:",u),d}finally{this._compilations.delete(n)}}Qn.compileSchema=sv;function gV(n,e,t){var r;t=(0,Sr.resolveUrl)(this.opts.uriResolver,e,t);let s=n.refs[t];if(s)return s;let i=vV.call(this,n,t);if(i===void 0){let o=(r=n.localRefs)===null||r===void 0?void 0:r[t],{schemaId:a}=this.opts;o&&(i=new ia({schema:o,schemaId:a,root:n,baseId:e}))}if(i!==void 0)return n.refs[t]=yV.call(this,i)}Qn.resolveRef=gV;function yV(n){return(0,Sr.inlineRef)(n.schema,this.opts.inlineRefs)?n.schema:n.validate?n:sv.call(this,n)}function kC(n){for(let e of this._compilations)if(bV(e,n))return e}Qn.getCompilingSchema=kC;function bV(n,e){return n.schema===e.schema&&n.root===e.root&&n.baseId===e.baseId}function vV(n,e){let t;for(;typeof(t=this.refs[e])=="string";)e=t;return t||this.schemas[e]||Nh.call(this,n,e)}function Nh(n,e){let t=this.opts.uriResolver.parse(e),r=(0,Sr._getFullPath)(this.opts.uriResolver,t),s=(0,Sr.getFullPath)(this.opts.uriResolver,n.baseId,void 0);if(Object.keys(n.schema).length>0&&r===s)return rv.call(this,t,n);let i=(0,Sr.normalizeId)(r),o=this.refs[i]||this.schemas[i];if(typeof o=="string"){let a=Nh.call(this,n,o);return typeof a?.schema!="object"?void 0:rv.call(this,t,a)}if(typeof o?.schema=="object"){if(o.validate||sv.call(this,o),i===(0,Sr.normalizeId)(e)){let{schema:a}=o,{schemaId:c}=this.opts,l=a[c];return l&&(s=(0,Sr.resolveUrl)(this.opts.uriResolver,s,l)),new ia({schema:a,schemaId:c,root:n,baseId:s})}return rv.call(this,t,o)}}Qn.resolveSchema=Nh;var TV=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function rv(n,{baseId:e,schema:t,root:r}){var s;if(((s=n.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let a of n.fragment.slice(1).split("/")){if(typeof t=="boolean")return;let c=t[(0,wC.unescapeFragment)(a)];if(c===void 0)return;t=c;let l=typeof t=="object"&&t[this.opts.schemaId];!TV.has(a)&&l&&(e=(0,Sr.resolveUrl)(this.opts.uriResolver,e,l))}let i;if(typeof t!="boolean"&&t.$ref&&!(0,wC.schemaHasRulesButRef)(t,this.RULES)){let a=(0,Sr.resolveUrl)(this.opts.uriResolver,e,t.$ref);i=Nh.call(this,r,a)}let{schemaId:o}=this.opts;if(i=i||new ia({schema:t,schemaId:o,root:r,baseId:e}),i.schema!==i.root.schema)return i}});var NC=E((Hte,SV)=>{SV.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var RC=E((Kte,PC)=>{"use strict";var _V={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};PC.exports={HEX:_V}});var $C=E((Gte,MC)=>{"use strict";var{HEX:EV}=RC(),wV=/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;function OC(n){if(xC(n,".")<3)return{host:n,isIPV4:!1};let e=n.match(wV)||[],[t]=e;return t?{host:NV(t,"."),isIPV4:!0}:{host:n,isIPV4:!1}}function iv(n,e=!1){let t="",r=!0;for(let s of n){if(EV[s]===void 0)return;s!=="0"&&r===!0&&(r=!1),r||(t+=s)}return e&&t.length===0&&(t="0"),t}function kV(n){let e=0,t={error:!1,address:"",zone:""},r=[],s=[],i=!1,o=!1,a=!1;function c(){if(s.length){if(i===!1){let l=iv(s);if(l!==void 0)r.push(l);else return t.error=!0,!1}s.length=0}return!0}for(let l=0;l<n.length;l++){let u=n[l];if(!(u==="["||u==="]"))if(u===":"){if(o===!0&&(a=!0),!c())break;if(e++,r.push(":"),e>7){t.error=!0;break}l-1>=0&&n[l-1]===":"&&(o=!0);continue}else if(u==="%"){if(!c())break;i=!0}else{s.push(u);continue}}return s.length&&(i?t.zone=s.join(""):a?r.push(s.join("")):r.push(iv(s))),t.address=r.join(""),t}function IC(n){if(xC(n,":")<2)return{host:n,isIPV6:!1};let e=kV(n);if(e.error)return{host:n,isIPV6:!1};{let t=e.address,r=e.address;return e.zone&&(t+="%"+e.zone,r+="%25"+e.zone),{host:t,escapedHost:r,isIPV6:!0}}}function NV(n,e){let t="",r=!0,s=n.length;for(let i=0;i<s;i++){let o=n[i];o==="0"&&r?(i+1<=s&&n[i+1]===e||i+1===s)&&(t+=o,r=!1):(o===e?r=!0:r=!1,t+=o)}return t}function xC(n,e){let t=0;for(let r=0;r<n.length;r++)n[r]===e&&t++;return t}var DC=/^\.\.?\//u,CC=/^\/\.(?:\/|$)/u,AC=/^\/\.\.(?:\/|$)/u,PV=/^\/?(?:.|\n)*?(?=\/|$)/u;function RV(n){let e=[];for(;n.length;)if(n.match(DC))n=n.replace(DC,"");else if(n.match(CC))n=n.replace(CC,"/");else if(n.match(AC))n=n.replace(AC,"/"),e.pop();else if(n==="."||n==="..")n="";else{let t=n.match(PV);if(t){let r=t[0];n=n.slice(r.length),e.push(r)}else throw new Error("Unexpected dot segment condition")}return e.join("")}function DV(n,e){let t=e!==!0?escape:unescape;return n.scheme!==void 0&&(n.scheme=t(n.scheme)),n.userinfo!==void 0&&(n.userinfo=t(n.userinfo)),n.host!==void 0&&(n.host=t(n.host)),n.path!==void 0&&(n.path=t(n.path)),n.query!==void 0&&(n.query=t(n.query)),n.fragment!==void 0&&(n.fragment=t(n.fragment)),n}function CV(n){let e=[];if(n.userinfo!==void 0&&(e.push(n.userinfo),e.push("@")),n.host!==void 0){let t=unescape(n.host),r=OC(t);if(r.isIPV4)t=r.host;else{let s=IC(r.host);s.isIPV6===!0?t=`[${s.escapedHost}]`:t=n.host}e.push(t)}return(typeof n.port=="number"||typeof n.port=="string")&&(e.push(":"),e.push(String(n.port))),e.length?e.join(""):void 0}MC.exports={recomposeAuthority:CV,normalizeComponentEncoding:DV,removeDotSegments:RV,normalizeIPv4:OC,normalizeIPv6:IC,stringArrayToHexStripped:iv}});var UC=E((Yte,BC)=>{"use strict";var AV=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,OV=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function LC(n){return typeof n.secure=="boolean"?n.secure:String(n.scheme).toLowerCase()==="wss"}function qC(n){return n.host||(n.error=n.error||"HTTP URIs must have a host."),n}function jC(n){let e=String(n.scheme).toLowerCase()==="https";return(n.port===(e?443:80)||n.port==="")&&(n.port=void 0),n.path||(n.path="/"),n}function IV(n){return n.secure=LC(n),n.resourceName=(n.path||"/")+(n.query?"?"+n.query:""),n.path=void 0,n.query=void 0,n}function xV(n){if((n.port===(LC(n)?443:80)||n.port==="")&&(n.port=void 0),typeof n.secure=="boolean"&&(n.scheme=n.secure?"wss":"ws",n.secure=void 0),n.resourceName){let[e,t]=n.resourceName.split("?");n.path=e&&e!=="/"?e:void 0,n.query=t,n.resourceName=void 0}return n.fragment=void 0,n}function MV(n,e){if(!n.path)return n.error="URN can not be parsed",n;let t=n.path.match(OV);if(t){let r=e.scheme||n.scheme||"urn";n.nid=t[1].toLowerCase(),n.nss=t[2];let s=`${r}:${e.nid||n.nid}`,i=ov[s];n.path=void 0,i&&(n=i.parse(n,e))}else n.error=n.error||"URN can not be parsed.";return n}function $V(n,e){let t=e.scheme||n.scheme||"urn",r=n.nid.toLowerCase(),s=`${t}:${e.nid||r}`,i=ov[s];i&&(n=i.serialize(n,e));let o=n,a=n.nss;return o.path=`${r||e.nid}:${a}`,e.skipEscape=!0,o}function LV(n,e){let t=n;return t.uuid=t.nss,t.nss=void 0,!e.tolerant&&(!t.uuid||!AV.test(t.uuid))&&(t.error=t.error||"UUID is not valid."),t}function qV(n){let e=n;return e.nss=(n.uuid||"").toLowerCase(),e}var FC={scheme:"http",domainHost:!0,parse:qC,serialize:jC},jV={scheme:"https",domainHost:FC.domainHost,parse:qC,serialize:jC},Ph={scheme:"ws",domainHost:!0,parse:IV,serialize:xV},FV={scheme:"wss",domainHost:Ph.domainHost,parse:Ph.parse,serialize:Ph.serialize},BV={scheme:"urn",parse:MV,serialize:$V,skipNormalize:!0},UV={scheme:"urn:uuid",parse:LV,serialize:qV,skipNormalize:!0},ov={http:FC,https:jV,ws:Ph,wss:FV,urn:BV,"urn:uuid":UV};BC.exports=ov});var WC=E((Jte,Dh)=>{"use strict";var{normalizeIPv6:VV,normalizeIPv4:WV,removeDotSegments:rl,recomposeAuthority:zV,normalizeComponentEncoding:Rh}=$C(),av=UC();function HV(n,e){return typeof n=="string"?n=Fr(os(n,e),e):typeof n=="object"&&(n=os(Fr(n,e),e)),n}function KV(n,e,t){let r=Object.assign({scheme:"null"},t),s=VC(os(n,r),os(e,r),r,!0);return Fr(s,{...r,skipEscape:!0})}function VC(n,e,t,r){let s={};return r||(n=os(Fr(n,t),t),e=os(Fr(e,t),t)),t=t||{},!t.tolerant&&e.scheme?(s.scheme=e.scheme,s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=rl(e.path||""),s.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=rl(e.path||""),s.query=e.query):(e.path?(e.path.charAt(0)==="/"?s.path=rl(e.path):((n.userinfo!==void 0||n.host!==void 0||n.port!==void 0)&&!n.path?s.path="/"+e.path:n.path?s.path=n.path.slice(0,n.path.lastIndexOf("/")+1)+e.path:s.path=e.path,s.path=rl(s.path)),s.query=e.query):(s.path=n.path,e.query!==void 0?s.query=e.query:s.query=n.query),s.userinfo=n.userinfo,s.host=n.host,s.port=n.port),s.scheme=n.scheme),s.fragment=e.fragment,s}function GV(n,e,t){return typeof n=="string"?(n=unescape(n),n=Fr(Rh(os(n,t),!0),{...t,skipEscape:!0})):typeof n=="object"&&(n=Fr(Rh(n,!0),{...t,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=Fr(Rh(os(e,t),!0),{...t,skipEscape:!0})):typeof e=="object"&&(e=Fr(Rh(e,!0),{...t,skipEscape:!0})),n.toLowerCase()===e.toLowerCase()}function Fr(n,e){let t={host:n.host,scheme:n.scheme,userinfo:n.userinfo,port:n.port,path:n.path,query:n.query,nid:n.nid,nss:n.nss,uuid:n.uuid,fragment:n.fragment,reference:n.reference,resourceName:n.resourceName,secure:n.secure,error:""},r=Object.assign({},e),s=[],i=av[(r.scheme||t.scheme||"").toLowerCase()];i&&i.serialize&&i.serialize(t,r),t.path!==void 0&&(r.skipEscape?t.path=unescape(t.path):(t.path=escape(t.path),t.scheme!==void 0&&(t.path=t.path.split("%3A").join(":")))),r.reference!=="suffix"&&t.scheme&&s.push(t.scheme,":");let o=zV(t);if(o!==void 0&&(r.reference!=="suffix"&&s.push("//"),s.push(o),t.path&&t.path.charAt(0)!=="/"&&s.push("/")),t.path!==void 0){let a=t.path;!r.absolutePath&&(!i||!i.absolutePath)&&(a=rl(a)),o===void 0&&(a=a.replace(/^\/\//u,"/%2F")),s.push(a)}return t.query!==void 0&&s.push("?",t.query),t.fragment!==void 0&&s.push("#",t.fragment),s.join("")}var YV=Array.from({length:127},(n,e)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(e)));function JV(n){let e=0;for(let t=0,r=n.length;t<r;++t)if(e=n.charCodeAt(t),e>126||YV[e])return!0;return!1}var XV=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function os(n,e){let t=Object.assign({},e),r={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=n.indexOf("%")!==-1,i=!1;t.reference==="suffix"&&(n=(t.scheme?t.scheme+":":"")+"//"+n);let o=n.match(XV);if(o){if(r.scheme=o[1],r.userinfo=o[3],r.host=o[4],r.port=parseInt(o[5],10),r.path=o[6]||"",r.query=o[7],r.fragment=o[8],isNaN(r.port)&&(r.port=o[5]),r.host){let c=WV(r.host);if(c.isIPV4===!1){let l=VV(c.host);r.host=l.host.toLowerCase(),i=l.isIPV6}else r.host=c.host,i=!0}r.scheme===void 0&&r.userinfo===void 0&&r.host===void 0&&r.port===void 0&&r.query===void 0&&!r.path?r.reference="same-document":r.scheme===void 0?r.reference="relative":r.fragment===void 0?r.reference="absolute":r.reference="uri",t.reference&&t.reference!=="suffix"&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");let a=av[(t.scheme||r.scheme||"").toLowerCase()];if(!t.unicodeSupport&&(!a||!a.unicodeSupport)&&r.host&&(t.domainHost||a&&a.domainHost)&&i===!1&&JV(r.host))try{r.host=URL.domainToASCII(r.host.toLowerCase())}catch(c){r.error=r.error||"Host's domain name can not be converted to ASCII: "+c}(!a||a&&!a.skipNormalize)&&(s&&r.scheme!==void 0&&(r.scheme=unescape(r.scheme)),s&&r.host!==void 0&&(r.host=unescape(r.host)),r.path&&(r.path=escape(unescape(r.path))),r.fragment&&(r.fragment=encodeURI(decodeURIComponent(r.fragment)))),a&&a.parse&&a.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}var cv={SCHEMES:av,normalize:HV,resolve:KV,resolveComponents:VC,equal:GV,serialize:Fr,parse:os};Dh.exports=cv;Dh.exports.default=cv;Dh.exports.fastUri=cv});var HC=E(lv=>{"use strict";Object.defineProperty(lv,"__esModule",{value:!0});var zC=WC();zC.code='require("ajv/dist/runtime/uri").default';lv.default=zC});var eA=E(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.CodeGen=zt.Name=zt.nil=zt.stringify=zt.str=zt._=zt.KeywordCxt=void 0;var QV=el();Object.defineProperty(zt,"KeywordCxt",{enumerable:!0,get:function(){return QV.KeywordCxt}});var oa=ce();Object.defineProperty(zt,"_",{enumerable:!0,get:function(){return oa._}});Object.defineProperty(zt,"str",{enumerable:!0,get:function(){return oa.str}});Object.defineProperty(zt,"stringify",{enumerable:!0,get:function(){return oa.stringify}});Object.defineProperty(zt,"nil",{enumerable:!0,get:function(){return oa.nil}});Object.defineProperty(zt,"Name",{enumerable:!0,get:function(){return oa.Name}});Object.defineProperty(zt,"CodeGen",{enumerable:!0,get:function(){return oa.CodeGen}});var ZV=kh(),XC=tl(),e2=jb(),sl=nl(),t2=ce(),il=Xc(),Ch=Jc(),dv=ge(),KC=NC(),n2=HC(),QC=(n,e)=>new RegExp(n,e);QC.code="new RegExp";var r2=["removeAdditional","useDefaults","coerceTypes"],s2=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),i2={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},o2={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},GC=200;function a2(n){var e,t,r,s,i,o,a,c,l,u,d,f,p,y,m,S,w,T,v,R,A,M,z,j,ie;let Le=n.strict,wt=(e=n.code)===null||e===void 0?void 0:e.optimize,pe=wt===!0||wt===void 0?1:wt||0,Ln=(r=(t=n.code)===null||t===void 0?void 0:t.regExp)!==null&&r!==void 0?r:QC,as=(s=n.uriResolver)!==null&&s!==void 0?s:n2.default;return{strictSchema:(o=(i=n.strictSchema)!==null&&i!==void 0?i:Le)!==null&&o!==void 0?o:!0,strictNumbers:(c=(a=n.strictNumbers)!==null&&a!==void 0?a:Le)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=n.strictTypes)!==null&&l!==void 0?l:Le)!==null&&u!==void 0?u:"log",strictTuples:(f=(d=n.strictTuples)!==null&&d!==void 0?d:Le)!==null&&f!==void 0?f:"log",strictRequired:(y=(p=n.strictRequired)!==null&&p!==void 0?p:Le)!==null&&y!==void 0?y:!1,code:n.code?{...n.code,optimize:pe,regExp:Ln}:{optimize:pe,regExp:Ln},loopRequired:(m=n.loopRequired)!==null&&m!==void 0?m:GC,loopEnum:(S=n.loopEnum)!==null&&S!==void 0?S:GC,meta:(w=n.meta)!==null&&w!==void 0?w:!0,messages:(T=n.messages)!==null&&T!==void 0?T:!0,inlineRefs:(v=n.inlineRefs)!==null&&v!==void 0?v:!0,schemaId:(R=n.schemaId)!==null&&R!==void 0?R:"$id",addUsedSchema:(A=n.addUsedSchema)!==null&&A!==void 0?A:!0,validateSchema:(M=n.validateSchema)!==null&&M!==void 0?M:!0,validateFormats:(z=n.validateFormats)!==null&&z!==void 0?z:!0,unicodeRegExp:(j=n.unicodeRegExp)!==null&&j!==void 0?j:!0,int32range:(ie=n.int32range)!==null&&ie!==void 0?ie:!0,uriResolver:as}}var ol=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...a2(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new t2.ValueScope({scope:{},prefixes:s2,es5:t,lines:r}),this.logger=h2(e.logger);let s=e.validateFormats;e.validateFormats=!1,this.RULES=(0,e2.getRules)(),YC.call(this,i2,e,"NOT SUPPORTED"),YC.call(this,o2,e,"DEPRECATED","warn"),this._metaOpts=d2.call(this),e.formats&&l2.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&u2.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),c2.call(this),e.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,s=KC;r==="id"&&(s={...KC},s.id=s.$id,delete s.$id),t&&e&&this.addMetaSchema(s,s[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){let r;if(typeof e=="string"){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let s=r(t);return"$async"in r||(this.errors=r.errors),s}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return s.call(this,e,t);async function s(u,d){await i.call(this,u.$schema);let f=this._addSchema(u,d);return f.validate||o.call(this,f)}async function i(u){u&&!this.getSchema(u)&&await s.call(this,{$ref:u},!0)}async function o(u){try{return this._compileSchemaEnv(u)}catch(d){if(!(d instanceof XC.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),o.call(this,u)}}function a({missingSchema:u,missingRef:d}){if(this.refs[u])throw new Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function c(u){let d=await l.call(this,u);this.refs[u]||await i.call(this,d.$schema),this.refs[u]||this.addSchema(d,u,t)}async function l(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=r(u))}finally{delete this._loading[u]}}}addSchema(e,t,r,s=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,r,s);return this}let i;if(typeof e=="object"){let{schemaId:o}=this.opts;if(i=e[o],i!==void 0&&typeof i!="string")throw new Error(`schema ${o} must be string`)}return t=(0,il.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,s,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let r;if(r=e.$schema,r!==void 0&&typeof r!="string")throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let s=this.validate(r,e);if(!s&&t){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return s}getSchema(e){let t;for(;typeof(t=JC.call(this,e))=="string";)e=t;if(t===void 0){let{schemaId:r}=this.opts,s=new sl.SchemaEnv({schema:{},schemaId:r});if(t=sl.resolveSchema.call(this,s,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=JC.call(this,e);return typeof t=="object"&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let r=e[this.opts.schemaId];return r&&(r=(0,il.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if(typeof e=="string")r=e,typeof t=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else if(typeof e=="object"&&t===void 0){if(t=e,r=t.keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(m2.call(this,r,t),!t)return(0,dv.eachItem)(r,i=>uv.call(this,i)),this;y2.call(this,t);let s={...t,type:(0,Ch.getJSONTypes)(t.type),schemaType:(0,Ch.getJSONTypes)(t.schemaType)};return(0,dv.eachItem)(r,s.type.length===0?i=>uv.call(this,i,s):i=>s.type.forEach(o=>uv.call(this,i,s,o))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let r of t.rules){let s=r.rules.findIndex(i=>i.keyword===e);s>=0&&r.rules.splice(s,1)}return this}addFormat(e,t){return typeof t=="string"&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return!e||e.length===0?"No errors":e.map(s=>`${r}${s.instancePath} ${s.message}`).reduce((s,i)=>s+t+i)}$dataMetaSchema(e,t){let r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let s of t){let i=s.split("/").slice(1),o=e;for(let a of i)o=o[a];for(let a in r){let c=r[a];if(typeof c!="object")continue;let{$data:l}=c.definition,u=o[a];l&&u&&(o[a]=ZC(u))}}return e}_removeAllSchemas(e,t){for(let r in e){let s=e[r];(!t||t.test(r))&&(typeof s=="string"?delete e[r]:s&&!s.meta&&(this._cache.delete(s.schema),delete e[r]))}}_addSchema(e,t,r,s=this.opts.validateSchema,i=this.opts.addUsedSchema){let o,{schemaId:a}=this.opts;if(typeof e=="object")o=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;r=(0,il.normalizeId)(o||r);let l=il.getSchemaRefs.call(this,e,r);return c=new sl.SchemaEnv({schema:e,schemaId:a,meta:t,baseId:r,localRefs:l}),this._cache.set(c.schema,c),i&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=c),s&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):sl.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{sl.compileSchema.call(this,e)}finally{this.opts=t}}};ol.ValidationError=ZV.default;ol.MissingRefError=XC.default;zt.default=ol;function YC(n,e,t,r="error"){for(let s in n){let i=s;i in e&&this.logger[r](`${t}: option ${s}. ${n[i]}`)}}function JC(n){return n=(0,il.normalizeId)(n),this.schemas[n]||this.refs[n]}function c2(){let n=this.opts.schemas;if(n)if(Array.isArray(n))this.addSchema(n);else for(let e in n)this.addSchema(n[e],e)}function l2(){for(let n in this.opts.formats){let e=this.opts.formats[n];e&&this.addFormat(n,e)}}function u2(n){if(Array.isArray(n)){this.addVocabulary(n);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in n){let t=n[e];t.keyword||(t.keyword=e),this.addKeyword(t)}}function d2(){let n={...this.opts};for(let e of r2)delete n[e];return n}var f2={log(){},warn(){},error(){}};function h2(n){if(n===!1)return f2;if(n===void 0)return console;if(n.log&&n.warn&&n.error)return n;throw new Error("logger must implement log, warn and error methods")}var p2=/^[a-z_$][a-z0-9_$:-]*$/i;function m2(n,e){let{RULES:t}=this;if((0,dv.eachItem)(n,r=>{if(t.keywords[r])throw new Error(`Keyword ${r} is already defined`);if(!p2.test(r))throw new Error(`Keyword ${r} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function uv(n,e,t){var r;let s=e?.post;if(t&&s)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,o=s?i.post:i.rules.find(({type:c})=>c===t);if(o||(o={type:t,rules:[]},i.rules.push(o)),i.keywords[n]=!0,!e)return;let a={keyword:n,definition:{...e,type:(0,Ch.getJSONTypes)(e.type),schemaType:(0,Ch.getJSONTypes)(e.schemaType)}};e.before?g2.call(this,o,a,e.before):o.rules.push(a),i.all[n]=a,(r=e.implements)===null||r===void 0||r.forEach(c=>this.addKeyword(c))}function g2(n,e,t){let r=n.rules.findIndex(s=>s.keyword===t);r>=0?n.rules.splice(r,0,e):(n.rules.push(e),this.logger.warn(`rule ${t} is not defined`))}function y2(n){let{metaSchema:e}=n;e!==void 0&&(n.$data&&this.opts.$data&&(e=ZC(e)),n.validateSchema=this.compile(e,!0))}var b2={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function ZC(n){return{anyOf:[n,b2]}}});var tA=E(fv=>{"use strict";Object.defineProperty(fv,"__esModule",{value:!0});var v2={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};fv.default=v2});var Ih=E(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.callRef=Ii.getValidate=void 0;var T2=tl(),nA=Xn(),Pn=ce(),aa=Jn(),rA=nl(),Ah=ge(),S2={keyword:"$ref",schemaType:"string",code(n){let{gen:e,schema:t,it:r}=n,{baseId:s,schemaEnv:i,validateName:o,opts:a,self:c}=r,{root:l}=i;if((t==="#"||t==="#/")&&s===l.baseId)return d();let u=rA.resolveRef.call(c,l,s,t);if(u===void 0)throw new T2.default(r.opts.uriResolver,s,t);if(u instanceof rA.SchemaEnv)return f(u);return p(u);function d(){if(i===l)return Oh(n,o,i,i.$async);let y=e.scopeValue("root",{ref:l});return Oh(n,(0,Pn._)`${y}.validate`,l,l.$async)}function f(y){let m=sA(n,y);Oh(n,m,y,y.$async)}function p(y){let m=e.scopeValue("schema",a.code.source===!0?{ref:y,code:(0,Pn.stringify)(y)}:{ref:y}),S=e.name("valid"),w=n.subschema({schema:y,dataTypes:[],schemaPath:Pn.nil,topSchemaRef:m,errSchemaPath:t},S);n.mergeEvaluated(w),n.ok(S)}}};function sA(n,e){let{gen:t}=n;return e.validate?t.scopeValue("validate",{ref:e.validate}):(0,Pn._)`${t.scopeValue("wrapper",{ref:e})}.validate`}Ii.getValidate=sA;function Oh(n,e,t,r){let{gen:s,it:i}=n,{allErrors:o,schemaEnv:a,opts:c}=i,l=c.passContext?aa.default.this:Pn.nil;r?u():d();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");let y=s.let("valid");s.try(()=>{s.code((0,Pn._)`await ${(0,nA.callValidateCode)(n,e,l)}`),p(e),o||s.assign(y,!0)},m=>{s.if((0,Pn._)`!(${m} instanceof ${i.ValidationError})`,()=>s.throw(m)),f(m),o||s.assign(y,!1)}),n.ok(y)}function d(){n.result((0,nA.callValidateCode)(n,e,l),()=>p(e),()=>f(e))}function f(y){let m=(0,Pn._)`${y}.errors`;s.assign(aa.default.vErrors,(0,Pn._)`${aa.default.vErrors} === null ? ${m} : ${aa.default.vErrors}.concat(${m})`),s.assign(aa.default.errors,(0,Pn._)`${aa.default.vErrors}.length`)}function p(y){var m;if(!i.opts.unevaluated)return;let S=(m=t?.validate)===null||m===void 0?void 0:m.evaluated;if(i.props!==!0)if(S&&!S.dynamicProps)S.props!==void 0&&(i.props=Ah.mergeEvaluated.props(s,S.props,i.props));else{let w=s.var("props",(0,Pn._)`${y}.evaluated.props`);i.props=Ah.mergeEvaluated.props(s,w,i.props,Pn.Name)}if(i.items!==!0)if(S&&!S.dynamicItems)S.items!==void 0&&(i.items=Ah.mergeEvaluated.items(s,S.items,i.items));else{let w=s.var("items",(0,Pn._)`${y}.evaluated.items`);i.items=Ah.mergeEvaluated.items(s,w,i.items,Pn.Name)}}}Ii.callRef=Oh;Ii.default=S2});var iA=E(hv=>{"use strict";Object.defineProperty(hv,"__esModule",{value:!0});var _2=tA(),E2=Ih(),w2=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",_2.default,E2.default];hv.default=w2});var oA=E(pv=>{"use strict";Object.defineProperty(pv,"__esModule",{value:!0});var xh=ce(),Ys=xh.operators,Mh={maximum:{okStr:"<=",ok:Ys.LTE,fail:Ys.GT},minimum:{okStr:">=",ok:Ys.GTE,fail:Ys.LT},exclusiveMaximum:{okStr:"<",ok:Ys.LT,fail:Ys.GTE},exclusiveMinimum:{okStr:">",ok:Ys.GT,fail:Ys.LTE}},k2={message:({keyword:n,schemaCode:e})=>(0,xh.str)`must be ${Mh[n].okStr} ${e}`,params:({keyword:n,schemaCode:e})=>(0,xh._)`{comparison: ${Mh[n].okStr}, limit: ${e}}`},N2={keyword:Object.keys(Mh),type:"number",schemaType:"number",$data:!0,error:k2,code(n){let{keyword:e,data:t,schemaCode:r}=n;n.fail$data((0,xh._)`${t} ${Mh[e].fail} ${r} || isNaN(${t})`)}};pv.default=N2});var aA=E(mv=>{"use strict";Object.defineProperty(mv,"__esModule",{value:!0});var al=ce(),P2={message:({schemaCode:n})=>(0,al.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,al._)`{multipleOf: ${n}}`},R2={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:P2,code(n){let{gen:e,data:t,schemaCode:r,it:s}=n,i=s.opts.multipleOfPrecision,o=e.let("res"),a=i?(0,al._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${i}`:(0,al._)`${o} !== parseInt(${o})`;n.fail$data((0,al._)`(${r} === 0 || (${o} = ${t}/${r}, ${a}))`)}};mv.default=R2});var lA=E(gv=>{"use strict";Object.defineProperty(gv,"__esModule",{value:!0});function cA(n){let e=n.length,t=0,r=0,s;for(;r<e;)t++,s=n.charCodeAt(r++),s>=55296&&s<=56319&&r<e&&(s=n.charCodeAt(r),(s&64512)===56320&&r++);return t}gv.default=cA;cA.code='require("ajv/dist/runtime/ucs2length").default'});var uA=E(yv=>{"use strict";Object.defineProperty(yv,"__esModule",{value:!0});var xi=ce(),D2=ge(),C2=lA(),A2={message({keyword:n,schemaCode:e}){let t=n==="maxLength"?"more":"fewer";return(0,xi.str)`must NOT have ${t} than ${e} characters`},params:({schemaCode:n})=>(0,xi._)`{limit: ${n}}`},O2={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:A2,code(n){let{keyword:e,data:t,schemaCode:r,it:s}=n,i=e==="maxLength"?xi.operators.GT:xi.operators.LT,o=s.opts.unicode===!1?(0,xi._)`${t}.length`:(0,xi._)`${(0,D2.useFunc)(n.gen,C2.default)}(${t})`;n.fail$data((0,xi._)`${o} ${i} ${r}`)}};yv.default=O2});var dA=E(bv=>{"use strict";Object.defineProperty(bv,"__esModule",{value:!0});var I2=Xn(),$h=ce(),x2={message:({schemaCode:n})=>(0,$h.str)`must match pattern "${n}"`,params:({schemaCode:n})=>(0,$h._)`{pattern: ${n}}`},M2={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:x2,code(n){let{data:e,$data:t,schema:r,schemaCode:s,it:i}=n,o=i.opts.unicodeRegExp?"u":"",a=t?(0,$h._)`(new RegExp(${s}, ${o}))`:(0,I2.usePattern)(n,r);n.fail$data((0,$h._)`!${a}.test(${e})`)}};bv.default=M2});var fA=E(vv=>{"use strict";Object.defineProperty(vv,"__esModule",{value:!0});var cl=ce(),$2={message({keyword:n,schemaCode:e}){let t=n==="maxProperties"?"more":"fewer";return(0,cl.str)`must NOT have ${t} than ${e} properties`},params:({schemaCode:n})=>(0,cl._)`{limit: ${n}}`},L2={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:$2,code(n){let{keyword:e,data:t,schemaCode:r}=n,s=e==="maxProperties"?cl.operators.GT:cl.operators.LT;n.fail$data((0,cl._)`Object.keys(${t}).length ${s} ${r}`)}};vv.default=L2});var hA=E(Tv=>{"use strict";Object.defineProperty(Tv,"__esModule",{value:!0});var ll=Xn(),ul=ce(),q2=ge(),j2={message:({params:{missingProperty:n}})=>(0,ul.str)`must have required property '${n}'`,params:({params:{missingProperty:n}})=>(0,ul._)`{missingProperty: ${n}}`},F2={keyword:"required",type:"object",schemaType:"array",$data:!0,error:j2,code(n){let{gen:e,schema:t,schemaCode:r,data:s,$data:i,it:o}=n,{opts:a}=o;if(!i&&t.length===0)return;let c=t.length>=a.loopRequired;if(o.allErrors?l():u(),a.strictRequired){let p=n.parentSchema.properties,{definedProperties:y}=n.it;for(let m of t)if(p?.[m]===void 0&&!y.has(m)){let S=o.schemaEnv.baseId+o.errSchemaPath,w=`required property "${m}" is not defined at "${S}" (strictRequired)`;(0,q2.checkStrictMode)(o,w,o.opts.strictRequired)}}function l(){if(c||i)n.block$data(ul.nil,d);else for(let p of t)(0,ll.checkReportMissingProp)(n,p)}function u(){let p=e.let("missing");if(c||i){let y=e.let("valid",!0);n.block$data(y,()=>f(p,y)),n.ok(y)}else e.if((0,ll.checkMissingProp)(n,t,p)),(0,ll.reportMissingProp)(n,p),e.else()}function d(){e.forOf("prop",r,p=>{n.setParams({missingProperty:p}),e.if((0,ll.noPropertyInData)(e,s,p,a.ownProperties),()=>n.error())})}function f(p,y){n.setParams({missingProperty:p}),e.forOf(p,r,()=>{e.assign(y,(0,ll.propertyInData)(e,s,p,a.ownProperties)),e.if((0,ul.not)(y),()=>{n.error(),e.break()})},ul.nil)}}};Tv.default=F2});var pA=E(Sv=>{"use strict";Object.defineProperty(Sv,"__esModule",{value:!0});var dl=ce(),B2={message({keyword:n,schemaCode:e}){let t=n==="maxItems"?"more":"fewer";return(0,dl.str)`must NOT have ${t} than ${e} items`},params:({schemaCode:n})=>(0,dl._)`{limit: ${n}}`},U2={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:B2,code(n){let{keyword:e,data:t,schemaCode:r}=n,s=e==="maxItems"?dl.operators.GT:dl.operators.LT;n.fail$data((0,dl._)`${t}.length ${s} ${r}`)}};Sv.default=U2});var Lh=E(_v=>{"use strict";Object.defineProperty(_v,"__esModule",{value:!0});var mA=Kb();mA.code='require("ajv/dist/runtime/equal").default';_v.default=mA});var gA=E(wv=>{"use strict";Object.defineProperty(wv,"__esModule",{value:!0});var Ev=Jc(),Ht=ce(),V2=ge(),W2=Lh(),z2={message:({params:{i:n,j:e}})=>(0,Ht.str)`must NOT have duplicate items (items ## ${e} and ${n} are identical)`,params:({params:{i:n,j:e}})=>(0,Ht._)`{i: ${n}, j: ${e}}`},H2={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:z2,code(n){let{gen:e,data:t,$data:r,schema:s,parentSchema:i,schemaCode:o,it:a}=n;if(!r&&!s)return;let c=e.let("valid"),l=i.items?(0,Ev.getSchemaTypes)(i.items):[];n.block$data(c,u,(0,Ht._)`${o} === false`),n.ok(c);function u(){let y=e.let("i",(0,Ht._)`${t}.length`),m=e.let("j");n.setParams({i:y,j:m}),e.assign(c,!0),e.if((0,Ht._)`${y} > 1`,()=>(d()?f:p)(y,m))}function d(){return l.length>0&&!l.some(y=>y==="object"||y==="array")}function f(y,m){let S=e.name("item"),w=(0,Ev.checkDataTypes)(l,S,a.opts.strictNumbers,Ev.DataType.Wrong),T=e.const("indices",(0,Ht._)`{}`);e.for((0,Ht._)`;${y}--;`,()=>{e.let(S,(0,Ht._)`${t}[${y}]`),e.if(w,(0,Ht._)`continue`),l.length>1&&e.if((0,Ht._)`typeof ${S} == "string"`,(0,Ht._)`${S} += "_"`),e.if((0,Ht._)`typeof ${T}[${S}] == "number"`,()=>{e.assign(m,(0,Ht._)`${T}[${S}]`),n.error(),e.assign(c,!1).break()}).code((0,Ht._)`${T}[${S}] = ${y}`)})}function p(y,m){let S=(0,V2.useFunc)(e,W2.default),w=e.name("outer");e.label(w).for((0,Ht._)`;${y}--;`,()=>e.for((0,Ht._)`${m} = ${y}; ${m}--;`,()=>e.if((0,Ht._)`${S}(${t}[${y}], ${t}[${m}])`,()=>{n.error(),e.assign(c,!1).break(w)})))}}};wv.default=H2});var yA=E(Nv=>{"use strict";Object.defineProperty(Nv,"__esModule",{value:!0});var kv=ce(),K2=ge(),G2=Lh(),Y2={message:"must be equal to constant",params:({schemaCode:n})=>(0,kv._)`{allowedValue: ${n}}`},J2={keyword:"const",$data:!0,error:Y2,code(n){let{gen:e,data:t,$data:r,schemaCode:s,schema:i}=n;r||i&&typeof i=="object"?n.fail$data((0,kv._)`!${(0,K2.useFunc)(e,G2.default)}(${t}, ${s})`):n.fail((0,kv._)`${i} !== ${t}`)}};Nv.default=J2});var bA=E(Pv=>{"use strict";Object.defineProperty(Pv,"__esModule",{value:!0});var fl=ce(),X2=ge(),Q2=Lh(),Z2={message:"must be equal to one of the allowed values",params:({schemaCode:n})=>(0,fl._)`{allowedValues: ${n}}`},eW={keyword:"enum",schemaType:"array",$data:!0,error:Z2,code(n){let{gen:e,data:t,$data:r,schema:s,schemaCode:i,it:o}=n;if(!r&&s.length===0)throw new Error("enum must have non-empty array");let a=s.length>=o.opts.loopEnum,c,l=()=>c??(c=(0,X2.useFunc)(e,Q2.default)),u;if(a||r)u=e.let("valid"),n.block$data(u,d);else{if(!Array.isArray(s))throw new Error("ajv implementation error");let p=e.const("vSchema",i);u=(0,fl.or)(...s.map((y,m)=>f(p,m)))}n.pass(u);function d(){e.assign(u,!1),e.forOf("v",i,p=>e.if((0,fl._)`${l()}(${t}, ${p})`,()=>e.assign(u,!0).break()))}function f(p,y){let m=s[y];return typeof m=="object"&&m!==null?(0,fl._)`${l()}(${t}, ${p}[${y}])`:(0,fl._)`${t} === ${m}`}}};Pv.default=eW});var vA=E(Rv=>{"use strict";Object.defineProperty(Rv,"__esModule",{value:!0});var tW=oA(),nW=aA(),rW=uA(),sW=dA(),iW=fA(),oW=hA(),aW=pA(),cW=gA(),lW=yA(),uW=bA(),dW=[tW.default,nW.default,rW.default,sW.default,iW.default,oW.default,aW.default,cW.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},lW.default,uW.default];Rv.default=dW});var Cv=E(hl=>{"use strict";Object.defineProperty(hl,"__esModule",{value:!0});hl.validateAdditionalItems=void 0;var Mi=ce(),Dv=ge(),fW={message:({params:{len:n}})=>(0,Mi.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0,Mi._)`{limit: ${n}}`},hW={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:fW,code(n){let{parentSchema:e,it:t}=n,{items:r}=e;if(!Array.isArray(r)){(0,Dv.checkStrictMode)(t,'"additionalItems" is ignored when "items" is not an array of schemas');return}TA(n,r)}};function TA(n,e){let{gen:t,schema:r,data:s,keyword:i,it:o}=n;o.items=!0;let a=t.const("len",(0,Mi._)`${s}.length`);if(r===!1)n.setParams({len:e.length}),n.pass((0,Mi._)`${a} <= ${e.length}`);else if(typeof r=="object"&&!(0,Dv.alwaysValidSchema)(o,r)){let l=t.var("valid",(0,Mi._)`${a} <= ${e.length}`);t.if((0,Mi.not)(l),()=>c(l)),n.ok(l)}function c(l){t.forRange("i",e.length,a,u=>{n.subschema({keyword:i,dataProp:u,dataPropType:Dv.Type.Num},l),o.allErrors||t.if((0,Mi.not)(l),()=>t.break())})}}hl.validateAdditionalItems=TA;hl.default=hW});var Av=E(pl=>{"use strict";Object.defineProperty(pl,"__esModule",{value:!0});pl.validateTuple=void 0;var SA=ce(),qh=ge(),pW=Xn(),mW={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(n){let{schema:e,it:t}=n;if(Array.isArray(e))return _A(n,"additionalItems",e);t.items=!0,!(0,qh.alwaysValidSchema)(t,e)&&n.ok((0,pW.validateArray)(n))}};function _A(n,e,t=n.schema){let{gen:r,parentSchema:s,data:i,keyword:o,it:a}=n;u(s),a.opts.unevaluated&&t.length&&a.items!==!0&&(a.items=qh.mergeEvaluated.items(r,t.length,a.items));let c=r.name("valid"),l=r.const("len",(0,SA._)`${i}.length`);t.forEach((d,f)=>{(0,qh.alwaysValidSchema)(a,d)||(r.if((0,SA._)`${l} > ${f}`,()=>n.subschema({keyword:o,schemaProp:f,dataProp:f},c)),n.ok(c))});function u(d){let{opts:f,errSchemaPath:p}=a,y=t.length,m=y===d.minItems&&(y===d.maxItems||d[e]===!1);if(f.strictTuples&&!m){let S=`"${o}" is ${y}-tuple, but minItems or maxItems/${e} are not specified or different at path "${p}"`;(0,qh.checkStrictMode)(a,S,f.strictTuples)}}}pl.validateTuple=_A;pl.default=mW});var EA=E(Ov=>{"use strict";Object.defineProperty(Ov,"__esModule",{value:!0});var gW=Av(),yW={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:n=>(0,gW.validateTuple)(n,"items")};Ov.default=yW});var kA=E(Iv=>{"use strict";Object.defineProperty(Iv,"__esModule",{value:!0});var wA=ce(),bW=ge(),vW=Xn(),TW=Cv(),SW={message:({params:{len:n}})=>(0,wA.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0,wA._)`{limit: ${n}}`},_W={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:SW,code(n){let{schema:e,parentSchema:t,it:r}=n,{prefixItems:s}=t;r.items=!0,!(0,bW.alwaysValidSchema)(r,e)&&(s?(0,TW.validateAdditionalItems)(n,s):n.ok((0,vW.validateArray)(n)))}};Iv.default=_W});var NA=E(xv=>{"use strict";Object.defineProperty(xv,"__esModule",{value:!0});var Zn=ce(),jh=ge(),EW={message:({params:{min:n,max:e}})=>e===void 0?(0,Zn.str)`must contain at least ${n} valid item(s)`:(0,Zn.str)`must contain at least ${n} and no more than ${e} valid item(s)`,params:({params:{min:n,max:e}})=>e===void 0?(0,Zn._)`{minContains: ${n}}`:(0,Zn._)`{minContains: ${n}, maxContains: ${e}}`},wW={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:EW,code(n){let{gen:e,schema:t,parentSchema:r,data:s,it:i}=n,o,a,{minContains:c,maxContains:l}=r;i.opts.next?(o=c===void 0?1:c,a=l):o=1;let u=e.const("len",(0,Zn._)`${s}.length`);if(n.setParams({min:o,max:a}),a===void 0&&o===0){(0,jh.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,jh.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),n.fail();return}if((0,jh.alwaysValidSchema)(i,t)){let m=(0,Zn._)`${u} >= ${o}`;a!==void 0&&(m=(0,Zn._)`${m} && ${u} <= ${a}`),n.pass(m);return}i.items=!0;let d=e.name("valid");a===void 0&&o===1?p(d,()=>e.if(d,()=>e.break())):o===0?(e.let(d,!0),a!==void 0&&e.if((0,Zn._)`${s}.length > 0`,f)):(e.let(d,!1),f()),n.result(d,()=>n.reset());function f(){let m=e.name("_valid"),S=e.let("count",0);p(m,()=>e.if(m,()=>y(S)))}function p(m,S){e.forRange("i",0,u,w=>{n.subschema({keyword:"contains",dataProp:w,dataPropType:jh.Type.Num,compositeRule:!0},m),S()})}function y(m){e.code((0,Zn._)`${m}++`),a===void 0?e.if((0,Zn._)`${m} >= ${o}`,()=>e.assign(d,!0).break()):(e.if((0,Zn._)`${m} > ${a}`,()=>e.assign(d,!1).break()),o===1?e.assign(d,!0):e.if((0,Zn._)`${m} >= ${o}`,()=>e.assign(d,!0)))}}};xv.default=wW});var Fh=E(Br=>{"use strict";Object.defineProperty(Br,"__esModule",{value:!0});Br.validateSchemaDeps=Br.validatePropertyDeps=Br.error=void 0;var Mv=ce(),kW=ge(),ml=Xn();Br.error={message:({params:{property:n,depsCount:e,deps:t}})=>{let r=e===1?"property":"properties";return(0,Mv.str)`must have ${r} ${t} when property ${n} is present`},params:({params:{property:n,depsCount:e,deps:t,missingProperty:r}})=>(0,Mv._)`{property: ${n},
171
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||e&&r===" ");let s=n-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=n),s}*pushUntil(e){let n=this.pos,r=this.buffer[n];for(;!e(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};GD.Lexer=yb});var Tb=w(KD=>{"use strict";var vb=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,r=this.lineStarts.length;for(;n<r;){let i=n+r>>1;this.lineStarts[i]<e?n=i+1:r=i}if(this.lineStarts[n]===e)return{line:n+1,col:1};if(n===0)return{line:0,col:e};let s=this.lineStarts[n-1];return{line:n,col:e-s+1}}}};KD.LineCounter=vb});var Sb=w(ZD=>{"use strict";var YD=rh(),aB=bb();function Di(t,e){for(let n=0;n<t.length;++n)if(t[n].type===e)return!0;return!1}function XD(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function QD(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function ih(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function Yo(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function JD(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!Di(e.start,"explicit-key-ind")&&!Di(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,QD(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}var _b=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new aB.Lexer,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let r of this.lexer.lex(e,n))yield*this.next(r);n||(yield*this.end())}*next(e){if(this.source=e,process.env.LOG_TOKENS&&console.log("|",YD.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let n=YD.tokenType(e);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let r=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&(!e||e.type!=="doc-end")){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&JD(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{let s=r.items[r.items.length-1];if(s.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(s.sep)s.value=n;else{Object.assign(s,{key:n,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{let s=r.items[r.items.length-1];s.value?r.items.push({start:[],value:n}):s.value=n;break}case"flow-collection":{let s=r.items[r.items.length-1];!s||s.value?r.items.push({start:[],key:n,sep:[]}):s.sep?s.value=n:Object.assign(s,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let s=n.items[n.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&XD(s.start)===-1&&(n.indent===0||s.start.every(i=>i.type!=="comment"||i.indent<n.indent))&&(r.type==="document"?r.end=s.start:r.items.push({start:s.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{XD(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let n=ih(this.peek(2)),r=Yo(n),s;e.end?(s=e.end,s.push(this.sourceToken),delete e.end):s=[this.sourceToken];let i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
172
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
173
+ `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){let s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){Array.prototype.push.apply(s,n.start),s.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let r=!this.onKeyLine&&this.indent===e.indent,s=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",i=[];if(s&&n.sep&&!n.value){let o=[];for(let a=0;a<n.sep.length;++a){let c=n.sep[a];switch(c.type){case"newline":o.push(a);break;case"space":break;case"comment":c.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(i=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":s||n.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):s||n.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Di(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(QD(n.key)&&!Di(n.sep,"newline")){let o=Yo(n.start),a=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:c}]})}else i.length>0?n.sep=n.sep.concat(i,this.sourceToken):n.sep.push(this.sourceToken);else if(Di(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let o=Yo(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||s?e.items.push({start:i,key:null,sep:[this.sourceToken]}):Di(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);s||n.value?(e.items.push({start:i,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){r&&o.type!=="block-seq"&&e.items.push({start:i}),this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){let s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){Array.prototype.push.apply(s,n.start),s.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||Di(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){let r=this.startBlockValue(e);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r&&r.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:s,sep:[]}):n.sep?this.stack.push(s):Object.assign(n,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let s=ih(r),i=Yo(s);JD(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let n=this.source.indexOf(`
174
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
175
+ `,n)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=ih(e),r=Yo(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=ih(e),r=Yo(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};ZD.Parser=_b});var sC=w(Ic=>{"use strict";var eC=cb(),cB=wc(),Oc=Pc(),lB=oy(),uB=ke(),dB=Tb(),tC=Sb();function nC(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new dB.LineCounter||null,prettyErrors:e}}function fB(t,e={}){let{lineCounter:n,prettyErrors:r}=nC(e),s=new tC.Parser(n?.addNewLine),i=new eC.Composer(e),o=Array.from(i.compose(s.parse(t)));if(r&&n)for(let a of o)a.errors.forEach(Oc.prettifyError(t,n)),a.warnings.forEach(Oc.prettifyError(t,n));return o.length>0?o:Object.assign([],{empty:!0},i.streamInfo())}function rC(t,e={}){let{lineCounter:n,prettyErrors:r}=nC(e),s=new tC.Parser(n?.addNewLine),i=new eC.Composer(e),o=null;for(let a of i.compose(s.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Oc.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(o.errors.forEach(Oc.prettifyError(t,n)),o.warnings.forEach(Oc.prettifyError(t,n))),o}function hB(t,e,n){let r;typeof e=="function"?r=e:n===void 0&&e&&typeof e=="object"&&(n=e);let s=rC(t,n);if(!s)return null;if(s.warnings.forEach(i=>lB.warn(s.options.logLevel,i)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:r},n))}function pB(t,e,n){let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){let s=Math.round(n);n=s<1?void 0:s>8?{indent:8}:{indent:s}}if(t===void 0){let{keepUndefined:s}=n??e??{};if(!s)return}return uB.isDocument(t)&&!r?t.toString(n):new cB.Document(t,r,n).toString(n)}Ic.parse=hB;Ic.parseAllDocuments=fB;Ic.parseDocument=rC;Ic.stringify=pB});var wb=w(je=>{"use strict";var mB=cb(),gB=wc(),yB=Uy(),Eb=Pc(),bB=cc(),zs=ke(),vB=Fs(),TB=Pt(),_B=Us(),SB=Vs(),EB=rh(),wB=bb(),kB=Tb(),NB=Sb(),oh=sC(),iC=sc();je.Composer=mB.Composer;je.Document=gB.Document;je.Schema=yB.Schema;je.YAMLError=Eb.YAMLError;je.YAMLParseError=Eb.YAMLParseError;je.YAMLWarning=Eb.YAMLWarning;je.Alias=bB.Alias;je.isAlias=zs.isAlias;je.isCollection=zs.isCollection;je.isDocument=zs.isDocument;je.isMap=zs.isMap;je.isNode=zs.isNode;je.isPair=zs.isPair;je.isScalar=zs.isScalar;je.isSeq=zs.isSeq;je.Pair=vB.Pair;je.Scalar=TB.Scalar;je.YAMLMap=_B.YAMLMap;je.YAMLSeq=SB.YAMLSeq;je.CST=EB;je.Lexer=wB.Lexer;je.LineCounter=kB.LineCounter;je.Parser=NB.Parser;je.parse=oh.parse;je.parseAllDocuments=oh.parseAllDocuments;je.parseDocument=oh.parseDocument;je.stringify=oh.stringify;je.visit=iC.visit;je.visitAsync=iC.visitAsync});var uC=w((fre,lC)=>{"use strict";lC.exports=aC;function aC(t,e,n){t instanceof RegExp&&(t=oC(t,n)),e instanceof RegExp&&(e=oC(e,n));var r=cC(t,e,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+t.length,r[1]),post:n.slice(r[1]+e.length)}}function oC(t,e){var n=e.match(t);return n?n[0]:null}aC.range=cC;function cC(t,e,n){var r,s,i,o,a,c=n.indexOf(t),l=n.indexOf(e,c+1),u=c;if(c>=0&&l>0){if(t===e)return[c,l];for(r=[],i=n.length;u>=0&&!a;)u==c?(r.push(u),c=n.indexOf(t,u+1)):r.length==1?a=[r.pop(),l]:(s=r.pop(),s<i&&(i=s,o=l),l=n.indexOf(e,u+1)),u=c<l&&c>=0?c:l;r.length&&(a=[i,o])}return a}});var bC=w((hre,yC)=>{var dC=uC();yC.exports=DB;var fC="\0SLASH"+Math.random()+"\0",hC="\0OPEN"+Math.random()+"\0",Nb="\0CLOSE"+Math.random()+"\0",pC="\0COMMA"+Math.random()+"\0",mC="\0PERIOD"+Math.random()+"\0";function kb(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function PB(t){return t.split("\\\\").join(fC).split("\\{").join(hC).split("\\}").join(Nb).split("\\,").join(pC).split("\\.").join(mC)}function RB(t){return t.split(fC).join("\\").split(hC).join("{").split(Nb).join("}").split(pC).join(",").split(mC).join(".")}function gC(t){if(!t)return[""];var e=[],n=dC("{","}",t);if(!n)return t.split(",");var r=n.pre,s=n.body,i=n.post,o=r.split(",");o[o.length-1]+="{"+s+"}";var a=gC(i);return i.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function DB(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),xc(PB(t),!0).map(RB)):[]}function CB(t){return"{"+t+"}"}function AB(t){return/^-?0\d/.test(t)}function OB(t,e){return t<=e}function IB(t,e){return t>=e}function xc(t,e){var n=[],r=dC("{","}",t);if(!r)return[t];var s=r.pre,i=r.post.length?xc(r.post,!1):[""];if(/\$$/.test(r.pre))for(var o=0;o<i.length;o++){var a=s+"{"+r.body+"}"+i[o];n.push(a)}else{var c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),u=c||l,d=r.body.indexOf(",")>=0;if(!u&&!d)return r.post.match(/,.*\}/)?(t=r.pre+"{"+r.body+Nb+r.post,xc(t)):[t];var f;if(u)f=r.body.split(/\.\./);else if(f=gC(r.body),f.length===1&&(f=xc(f[0],!1).map(CB),f.length===1))return i.map(function(Be){return r.pre+f[0]+Be});var h;if(u){var y=kb(f[0]),m=kb(f[1]),_=Math.max(f[0].length,f[1].length),E=f.length==3?Math.abs(kb(f[2])):1,T=OB,b=m<y;b&&(E*=-1,T=IB);var R=f.some(AB);h=[];for(var D=y;T(D,m);D+=E){var L;if(l)L=String.fromCharCode(D),L==="\\"&&(L="");else if(L=String(D),R){var H=_-L.length;if(H>0){var U=new Array(H+1).join("0");D<0?L="-"+U+L.slice(1):L=U+L}}h.push(L)}}else{h=[];for(var oe=0;oe<f.length;oe++)h.push.apply(h,xc(f[oe],!1))}for(var oe=0;oe<h.length;oe++)for(var o=0;o<i.length;o++){var a=s+h[oe]+i[o];(!e||u||a)&&n.push(a)}}return n}});var Qc=w(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.regexpCode=Re.getEsmExportName=Re.getProperty=Re.safeStringify=Re.stringify=Re.strConcat=Re.addCodeArg=Re.str=Re._=Re.nil=Re._Code=Re.Name=Re.IDENTIFIER=Re._CodeOrName=void 0;var Xc=class{};Re._CodeOrName=Xc;Re.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Ii=class extends Xc{constructor(e){if(super(),!Re.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};Re.Name=Ii;var Jn=class extends Xc{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((n,r)=>`${n}${r}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((n,r)=>(r instanceof Ii&&(n[r.str]=(n[r.str]||0)+1),n),{})}};Re._Code=Jn;Re.nil=new Jn("");function iA(t,...e){let n=[t[0]],r=0;for(;r<e.length;)Wb(n,e[r]),n.push(t[++r]);return new Jn(n)}Re._=iA;var zb=new Jn("+");function oA(t,...e){let n=[Jc(t[0])],r=0;for(;r<e.length;)n.push(zb),Wb(n,e[r]),n.push(zb,Jc(t[++r]));return BU(n),new Jn(n)}Re.str=oA;function Wb(t,e){e instanceof Jn?t.push(...e._items):e instanceof Ii?t.push(e):t.push(zU(e))}Re.addCodeArg=Wb;function BU(t){let e=1;for(;e<t.length-1;){if(t[e]===zb){let n=UU(t[e-1],t[e+1]);if(n!==void 0){t.splice(e-1,3,n);continue}t[e++]="+"}e++}}function UU(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Ii||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Ii))return`"${t}${e.slice(1)}`}function VU(t,e){return e.emptyStr()?t:t.emptyStr()?e:oA`${t}${e}`}Re.strConcat=VU;function zU(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Jc(Array.isArray(t)?t.join(","):t)}function WU(t){return new Jn(Jc(t))}Re.stringify=WU;function Jc(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Re.safeStringify=Jc;function HU(t){return typeof t=="string"&&Re.IDENTIFIER.test(t)?new Jn(`.${t}`):iA`[${t}]`}Re.getProperty=HU;function GU(t){if(typeof t=="string"&&Re.IDENTIFIER.test(t))return new Jn(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}Re.getEsmExportName=GU;function KU(t){return new Jn(t.toString())}Re.regexpCode=KU});var Kb=w(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.ValueScope=Rn.ValueScopeName=Rn.Scope=Rn.varKinds=Rn.UsedValueState=void 0;var Pn=Qc(),Hb=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Nh;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Nh||(Rn.UsedValueState=Nh={}));Rn.varKinds={const:new Pn.Name("const"),let:new Pn.Name("let"),var:new Pn.Name("var")};var Ph=class{constructor({prefixes:e,parent:n}={}){this._names={},this._prefixes=e,this._parent=n}toName(e){return e instanceof Pn.Name?e:this.name(e)}name(e){return new Pn.Name(this._newName(e))}_newName(e){let n=this._names[e]||this._nameGroup(e);return`${e}${n.index++}`}_nameGroup(e){var n,r;if(!((r=(n=this._parent)===null||n===void 0?void 0:n._prefixes)===null||r===void 0)&&r.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Rn.Scope=Ph;var Rh=class extends Pn.Name{constructor(e,n){super(n),this.prefix=e}setValue(e,{property:n,itemIndex:r}){this.value=e,this.scopePath=(0,Pn._)`.${new Pn.Name(n)}[${r}]`}};Rn.ValueScopeName=Rh;var YU=(0,Pn._)`\n`,Gb=class extends Ph{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?YU:Pn.nil}}get(){return this._scope}name(e){return new Rh(e,this._newName(e))}value(e,n){var r;if(n.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let s=this.toName(e),{prefix:i}=s,o=(r=n.key)!==null&&r!==void 0?r:n.ref,a=this._values[i];if(a){let u=a.get(o);if(u)return u}else a=this._values[i]=new Map;a.set(o,s);let c=this._scope[i]||(this._scope[i]=[]),l=c.length;return c[l]=n.ref,s.setValue(n,{property:i,itemIndex:l}),s}getValue(e,n){let r=this._values[e];if(r)return r.get(n)}scopeRefs(e,n=this._values){return this._reduceValues(n,r=>{if(r.scopePath===void 0)throw new Error(`CodeGen: name "${r}" has no value`);return(0,Pn._)`${e}${r.scopePath}`})}scopeCode(e=this._values,n,r){return this._reduceValues(e,s=>{if(s.value===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return s.value.code},n,r)}_reduceValues(e,n,r={},s){let i=Pn.nil;for(let o in e){let a=e[o];if(!a)continue;let c=r[o]=r[o]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,Nh.Started);let u=n(l);if(u){let d=this.opts.es5?Rn.varKinds.var:Rn.varKinds.const;i=(0,Pn._)`${i}${d} ${l} = ${u};${this.opts._n}`}else if(u=s?.(l))i=(0,Pn._)`${i}${u}${this.opts._n}`;else throw new Hb(l);c.set(l,Nh.Completed)})}return i}};Rn.ValueScope=Gb});var ue=w(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.or=he.and=he.not=he.CodeGen=he.operators=he.varKinds=he.ValueScopeName=he.ValueScope=he.Scope=he.Name=he.regexpCode=he.stringify=he.getProperty=he.nil=he.strConcat=he.str=he._=void 0;var Se=Qc(),_r=Kb(),Ys=Qc();Object.defineProperty(he,"_",{enumerable:!0,get:function(){return Ys._}});Object.defineProperty(he,"str",{enumerable:!0,get:function(){return Ys.str}});Object.defineProperty(he,"strConcat",{enumerable:!0,get:function(){return Ys.strConcat}});Object.defineProperty(he,"nil",{enumerable:!0,get:function(){return Ys.nil}});Object.defineProperty(he,"getProperty",{enumerable:!0,get:function(){return Ys.getProperty}});Object.defineProperty(he,"stringify",{enumerable:!0,get:function(){return Ys.stringify}});Object.defineProperty(he,"regexpCode",{enumerable:!0,get:function(){return Ys.regexpCode}});Object.defineProperty(he,"Name",{enumerable:!0,get:function(){return Ys.Name}});var Oh=Kb();Object.defineProperty(he,"Scope",{enumerable:!0,get:function(){return Oh.Scope}});Object.defineProperty(he,"ValueScope",{enumerable:!0,get:function(){return Oh.ValueScope}});Object.defineProperty(he,"ValueScopeName",{enumerable:!0,get:function(){return Oh.ValueScopeName}});Object.defineProperty(he,"varKinds",{enumerable:!0,get:function(){return Oh.varKinds}});he.operators={GT:new Se._Code(">"),GTE:new Se._Code(">="),LT:new Se._Code("<"),LTE:new Se._Code("<="),EQ:new Se._Code("==="),NEQ:new Se._Code("!=="),NOT:new Se._Code("!"),OR:new Se._Code("||"),AND:new Se._Code("&&"),ADD:new Se._Code("+")};var os=class{optimizeNodes(){return this}optimizeNames(e,n){return this}},Yb=class extends os{constructor(e,n,r){super(),this.varKind=e,this.name=n,this.rhs=r}render({es5:e,_n:n}){let r=e?_r.varKinds.var:this.varKind,s=this.rhs===void 0?"":` = ${this.rhs}`;return`${r} ${this.name}${s};`+n}optimizeNames(e,n){if(e[this.name.str])return this.rhs&&(this.rhs=ca(this.rhs,e,n)),this}get names(){return this.rhs instanceof Se._CodeOrName?this.rhs.names:{}}},Dh=class extends os{constructor(e,n,r){super(),this.lhs=e,this.rhs=n,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,n){if(!(this.lhs instanceof Se.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=ca(this.rhs,e,n),this}get names(){let e=this.lhs instanceof Se.Name?{}:{...this.lhs.names};return Ah(e,this.rhs)}},Xb=class extends Dh{constructor(e,n,r,s){super(e,r,s),this.op=n}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Jb=class extends os{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Qb=class extends os{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Zb=class extends os{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},ev=class extends os{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,n){return this.code=ca(this.code,e,n),this}get names(){return this.code instanceof Se._CodeOrName?this.code.names:{}}},Zc=class extends os{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((n,r)=>n+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,n=e.length;for(;n--;){let r=e[n].optimizeNodes();Array.isArray(r)?e.splice(n,1,...r):r?e[n]=r:e.splice(n,1)}return e.length>0?this:void 0}optimizeNames(e,n){let{nodes:r}=this,s=r.length;for(;s--;){let i=r[s];i.optimizeNames(e,n)||(XU(e,i.names),r.splice(s,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,n)=>Li(e,n.names),{})}},as=class extends Zc{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},tv=class extends Zc{},aa=class extends as{};aa.kind="else";var xi=class t extends as{constructor(e,n){super(n),this.condition=e}render(e){let n=`if(${this.condition})`+super.render(e);return this.else&&(n+="else "+this.else.render(e)),n}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let n=this.else;if(n){let r=n.optimizeNodes();n=this.else=Array.isArray(r)?new aa(r):r}if(n)return e===!1?n instanceof t?n:n.nodes:this.nodes.length?this:new t(aA(e),n instanceof t?[n]:n.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,n){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,n),!!(super.optimizeNames(e,n)||this.else))return this.condition=ca(this.condition,e,n),this}get names(){let e=super.names;return Ah(e,this.condition),this.else&&Li(e,this.else.names),e}};xi.kind="if";var Mi=class extends as{};Mi.kind="for";var nv=class extends Mi{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,n){if(super.optimizeNames(e,n))return this.iteration=ca(this.iteration,e,n),this}get names(){return Li(super.names,this.iteration.names)}},rv=class extends Mi{constructor(e,n,r,s){super(),this.varKind=e,this.name=n,this.from=r,this.to=s}render(e){let n=e.es5?_r.varKinds.var:this.varKind,{name:r,from:s,to:i}=this;return`for(${n} ${r}=${s}; ${r}<${i}; ${r}++)`+super.render(e)}get names(){let e=Ah(super.names,this.from);return Ah(e,this.to)}},Ch=class extends Mi{constructor(e,n,r,s){super(),this.loop=e,this.varKind=n,this.name=r,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,n){if(super.optimizeNames(e,n))return this.iterable=ca(this.iterable,e,n),this}get names(){return Li(super.names,this.iterable.names)}},el=class extends as{constructor(e,n,r){super(),this.name=e,this.args=n,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};el.kind="func";var tl=class extends Zc{render(e){return"return "+super.render(e)}};tl.kind="return";var sv=class extends as{render(e){let n="try"+super.render(e);return this.catch&&(n+=this.catch.render(e)),this.finally&&(n+=this.finally.render(e)),n}optimizeNodes(){var e,n;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(n=this.finally)===null||n===void 0||n.optimizeNodes(),this}optimizeNames(e,n){var r,s;return super.optimizeNames(e,n),(r=this.catch)===null||r===void 0||r.optimizeNames(e,n),(s=this.finally)===null||s===void 0||s.optimizeNames(e,n),this}get names(){let e=super.names;return this.catch&&Li(e,this.catch.names),this.finally&&Li(e,this.finally.names),e}},nl=class extends as{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};nl.kind="catch";var rl=class extends as{render(e){return"finally"+super.render(e)}};rl.kind="finally";var iv=class{constructor(e,n={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...n,_n:n.lines?`
176
+ `:""},this._extScope=e,this._scope=new _r.Scope({parent:e}),this._nodes=[new tv]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,n){let r=this._extScope.value(e,n);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,n){return this._extScope.getValue(e,n)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,n,r,s){let i=this._scope.toName(n);return r!==void 0&&s&&(this._constants[i.str]=r),this._leafNode(new Yb(e,i,r)),i}const(e,n,r){return this._def(_r.varKinds.const,e,n,r)}let(e,n,r){return this._def(_r.varKinds.let,e,n,r)}var(e,n,r){return this._def(_r.varKinds.var,e,n,r)}assign(e,n,r){return this._leafNode(new Dh(e,n,r))}add(e,n){return this._leafNode(new Xb(e,he.operators.ADD,n))}code(e){return typeof e=="function"?e():e!==Se.nil&&this._leafNode(new ev(e)),this}object(...e){let n=["{"];for(let[r,s]of e)n.length>1&&n.push(","),n.push(r),(r!==s||this.opts.es5)&&(n.push(":"),(0,Se.addCodeArg)(n,s));return n.push("}"),new Se._Code(n)}if(e,n,r){if(this._blockNode(new xi(e)),n&&r)this.code(n).else().code(r).endIf();else if(n)this.code(n).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new xi(e))}else(){return this._elseNode(new aa)}endIf(){return this._endBlockNode(xi,aa)}_for(e,n){return this._blockNode(e),n&&this.code(n).endFor(),this}for(e,n){return this._for(new nv(e),n)}forRange(e,n,r,s,i=this.opts.es5?_r.varKinds.var:_r.varKinds.let){let o=this._scope.toName(e);return this._for(new rv(i,o,n,r),()=>s(o))}forOf(e,n,r,s=_r.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let o=n instanceof Se.Name?n:this.var("_arr",n);return this.forRange("_i",0,(0,Se._)`${o}.length`,a=>{this.var(i,(0,Se._)`${o}[${a}]`),r(i)})}return this._for(new Ch("of",s,i,n),()=>r(i))}forIn(e,n,r,s=this.opts.es5?_r.varKinds.var:_r.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Se._)`Object.keys(${n})`,r);let i=this._scope.toName(e);return this._for(new Ch("in",s,i,n),()=>r(i))}endFor(){return this._endBlockNode(Mi)}label(e){return this._leafNode(new Jb(e))}break(e){return this._leafNode(new Qb(e))}return(e){let n=new tl;if(this._blockNode(n),this.code(e),n.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(tl)}try(e,n,r){if(!n&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');let s=new sv;if(this._blockNode(s),this.code(e),n){let i=this.name("e");this._currNode=s.catch=new nl(i),n(i)}return r&&(this._currNode=s.finally=new rl,this.code(r)),this._endBlockNode(nl,rl)}throw(e){return this._leafNode(new Zb(e))}block(e,n){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(n),this}endBlock(e){let n=this._blockStarts.pop();if(n===void 0)throw new Error("CodeGen: not in self-balancing block");let r=this._nodes.length-n;if(r<0||e!==void 0&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=n,this}func(e,n=Se.nil,r,s){return this._blockNode(new el(e,n,r)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(el)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,n){let r=this._currNode;if(r instanceof e||n&&r instanceof n)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${n?`${e.kind}/${n.kind}`:e.kind}"`)}_elseNode(e){let n=this._currNode;if(!(n instanceof xi))throw new Error('CodeGen: "else" without "if"');return this._currNode=n.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let n=this._nodes;n[n.length-1]=e}};he.CodeGen=iv;function Li(t,e){for(let n in e)t[n]=(t[n]||0)+(e[n]||0);return t}function Ah(t,e){return e instanceof Se._CodeOrName?Li(t,e.names):t}function ca(t,e,n){if(t instanceof Se.Name)return r(t);if(!s(t))return t;return new Se._Code(t._items.reduce((i,o)=>(o instanceof Se.Name&&(o=r(o)),o instanceof Se._Code?i.push(...o._items):i.push(o),i),[]));function r(i){let o=n[i.str];return o===void 0||e[i.str]!==1?i:(delete e[i.str],o)}function s(i){return i instanceof Se._Code&&i._items.some(o=>o instanceof Se.Name&&e[o.str]===1&&n[o.str]!==void 0)}}function XU(t,e){for(let n in e)t[n]=(t[n]||0)-(e[n]||0)}function aA(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Se._)`!${ov(t)}`}he.not=aA;var JU=cA(he.operators.AND);function QU(...t){return t.reduce(JU)}he.and=QU;var ZU=cA(he.operators.OR);function eV(...t){return t.reduce(ZU)}he.or=eV;function cA(t){return(e,n)=>e===Se.nil?n:n===Se.nil?e:(0,Se._)`${ov(e)} ${t} ${ov(n)}`}function ov(t){return t instanceof Se.Name?t:(0,Se._)`(${t})`}});var ye=w(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.checkStrictMode=pe.getErrorPath=pe.Type=pe.useFunc=pe.setEvaluated=pe.evaluatedPropsToName=pe.mergeEvaluated=pe.eachItem=pe.unescapeJsonPointer=pe.escapeJsonPointer=pe.escapeFragment=pe.unescapeFragment=pe.schemaRefOrVal=pe.schemaHasRulesButRef=pe.schemaHasRules=pe.checkUnknownRules=pe.alwaysValidSchema=pe.toHash=void 0;var Xe=ue(),tV=Qc();function nV(t){let e={};for(let n of t)e[n]=!0;return e}pe.toHash=nV;function rV(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(dA(t,e),!fA(e,t.self.RULES.all))}pe.alwaysValidSchema=rV;function dA(t,e=t.schema){let{opts:n,self:r}=t;if(!n.strictSchema||typeof e=="boolean")return;let s=r.RULES.keywords;for(let i in e)s[i]||mA(t,`unknown keyword: "${i}"`)}pe.checkUnknownRules=dA;function fA(t,e){if(typeof t=="boolean")return!t;for(let n in t)if(e[n])return!0;return!1}pe.schemaHasRules=fA;function sV(t,e){if(typeof t=="boolean")return!t;for(let n in t)if(n!=="$ref"&&e.all[n])return!0;return!1}pe.schemaHasRulesButRef=sV;function iV({topSchemaRef:t,schemaPath:e},n,r,s){if(!s){if(typeof n=="number"||typeof n=="boolean")return n;if(typeof n=="string")return(0,Xe._)`${n}`}return(0,Xe._)`${t}${e}${(0,Xe.getProperty)(r)}`}pe.schemaRefOrVal=iV;function oV(t){return hA(decodeURIComponent(t))}pe.unescapeFragment=oV;function aV(t){return encodeURIComponent(cv(t))}pe.escapeFragment=aV;function cv(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}pe.escapeJsonPointer=cv;function hA(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}pe.unescapeJsonPointer=hA;function cV(t,e){if(Array.isArray(t))for(let n of t)e(n);else e(t)}pe.eachItem=cV;function lA({mergeNames:t,mergeToName:e,mergeValues:n,resultToName:r}){return(s,i,o,a)=>{let c=o===void 0?i:o instanceof Xe.Name?(i instanceof Xe.Name?t(s,i,o):e(s,i,o),o):i instanceof Xe.Name?(e(s,o,i),i):n(i,o);return a===Xe.Name&&!(c instanceof Xe.Name)?r(s,c):c}}pe.mergeEvaluated={props:lA({mergeNames:(t,e,n)=>t.if((0,Xe._)`${n} !== true && ${e} !== undefined`,()=>{t.if((0,Xe._)`${e} === true`,()=>t.assign(n,!0),()=>t.assign(n,(0,Xe._)`${n} || {}`).code((0,Xe._)`Object.assign(${n}, ${e})`))}),mergeToName:(t,e,n)=>t.if((0,Xe._)`${n} !== true`,()=>{e===!0?t.assign(n,!0):(t.assign(n,(0,Xe._)`${n} || {}`),lv(t,n,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:pA}),items:lA({mergeNames:(t,e,n)=>t.if((0,Xe._)`${n} !== true && ${e} !== undefined`,()=>t.assign(n,(0,Xe._)`${e} === true ? true : ${n} > ${e} ? ${n} : ${e}`)),mergeToName:(t,e,n)=>t.if((0,Xe._)`${n} !== true`,()=>t.assign(n,e===!0?!0:(0,Xe._)`${n} > ${e} ? ${n} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function pA(t,e){if(e===!0)return t.var("props",!0);let n=t.var("props",(0,Xe._)`{}`);return e!==void 0&&lv(t,n,e),n}pe.evaluatedPropsToName=pA;function lv(t,e,n){Object.keys(n).forEach(r=>t.assign((0,Xe._)`${e}${(0,Xe.getProperty)(r)}`,!0))}pe.setEvaluated=lv;var uA={};function lV(t,e){return t.scopeValue("func",{ref:e,code:uA[e.code]||(uA[e.code]=new tV._Code(e.code))})}pe.useFunc=lV;var av;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(av||(pe.Type=av={}));function uV(t,e,n){if(t instanceof Xe.Name){let r=e===av.Num;return n?r?(0,Xe._)`"[" + ${t} + "]"`:(0,Xe._)`"['" + ${t} + "']"`:r?(0,Xe._)`"/" + ${t}`:(0,Xe._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,Xe.getProperty)(t).toString():"/"+cv(t)}pe.getErrorPath=uV;function mA(t,e,n=t.opts.strictSchema){if(n){if(e=`strict mode: ${e}`,n===!0)throw new Error(e);t.self.logger.warn(e)}}pe.checkStrictMode=mA});var Qn=w(uv=>{"use strict";Object.defineProperty(uv,"__esModule",{value:!0});var nn=ue(),dV={data:new nn.Name("data"),valCxt:new nn.Name("valCxt"),instancePath:new nn.Name("instancePath"),parentData:new nn.Name("parentData"),parentDataProperty:new nn.Name("parentDataProperty"),rootData:new nn.Name("rootData"),dynamicAnchors:new nn.Name("dynamicAnchors"),vErrors:new nn.Name("vErrors"),errors:new nn.Name("errors"),this:new nn.Name("this"),self:new nn.Name("self"),scope:new nn.Name("scope"),json:new nn.Name("json"),jsonPos:new nn.Name("jsonPos"),jsonLen:new nn.Name("jsonLen"),jsonPart:new nn.Name("jsonPart")};uv.default=dV});var sl=w(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.extendErrors=rn.resetErrorsCount=rn.reportExtraError=rn.reportError=rn.keyword$DataError=rn.keywordError=void 0;var Ne=ue(),Ih=ye(),hn=Qn();rn.keywordError={message:({keyword:t})=>(0,Ne.str)`must pass "${t}" keyword validation`};rn.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,Ne.str)`"${t}" keyword must be ${e} ($data)`:(0,Ne.str)`"${t}" keyword is invalid ($data)`};function fV(t,e=rn.keywordError,n,r){let{it:s}=t,{gen:i,compositeRule:o,allErrors:a}=s,c=bA(t,e,n);r??(o||a)?gA(i,c):yA(s,(0,Ne._)`[${c}]`)}rn.reportError=fV;function hV(t,e=rn.keywordError,n){let{it:r}=t,{gen:s,compositeRule:i,allErrors:o}=r,a=bA(t,e,n);gA(s,a),i||o||yA(r,hn.default.vErrors)}rn.reportExtraError=hV;function pV(t,e){t.assign(hn.default.errors,e),t.if((0,Ne._)`${hn.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,Ne._)`${hn.default.vErrors}.length`,e),()=>t.assign(hn.default.vErrors,null)))}rn.resetErrorsCount=pV;function mV({gen:t,keyword:e,schemaValue:n,data:r,errsCount:s,it:i}){if(s===void 0)throw new Error("ajv implementation error");let o=t.name("err");t.forRange("i",s,hn.default.errors,a=>{t.const(o,(0,Ne._)`${hn.default.vErrors}[${a}]`),t.if((0,Ne._)`${o}.instancePath === undefined`,()=>t.assign((0,Ne._)`${o}.instancePath`,(0,Ne.strConcat)(hn.default.instancePath,i.errorPath))),t.assign((0,Ne._)`${o}.schemaPath`,(0,Ne.str)`${i.errSchemaPath}/${e}`),i.opts.verbose&&(t.assign((0,Ne._)`${o}.schema`,n),t.assign((0,Ne._)`${o}.data`,r))})}rn.extendErrors=mV;function gA(t,e){let n=t.const("err",e);t.if((0,Ne._)`${hn.default.vErrors} === null`,()=>t.assign(hn.default.vErrors,(0,Ne._)`[${n}]`),(0,Ne._)`${hn.default.vErrors}.push(${n})`),t.code((0,Ne._)`${hn.default.errors}++`)}function yA(t,e){let{gen:n,validateName:r,schemaEnv:s}=t;s.$async?n.throw((0,Ne._)`new ${t.ValidationError}(${e})`):(n.assign((0,Ne._)`${r}.errors`,e),n.return(!1))}var $i={keyword:new Ne.Name("keyword"),schemaPath:new Ne.Name("schemaPath"),params:new Ne.Name("params"),propertyName:new Ne.Name("propertyName"),message:new Ne.Name("message"),schema:new Ne.Name("schema"),parentSchema:new Ne.Name("parentSchema")};function bA(t,e,n){let{createErrors:r}=t.it;return r===!1?(0,Ne._)`{}`:gV(t,e,n)}function gV(t,e,n={}){let{gen:r,it:s}=t,i=[yV(s,n),bV(t,n)];return vV(t,e,i),r.object(...i)}function yV({errorPath:t},{instancePath:e}){let n=e?(0,Ne.str)`${t}${(0,Ih.getErrorPath)(e,Ih.Type.Str)}`:t;return[hn.default.instancePath,(0,Ne.strConcat)(hn.default.instancePath,n)]}function bV({keyword:t,it:{errSchemaPath:e}},{schemaPath:n,parentSchema:r}){let s=r?e:(0,Ne.str)`${e}/${t}`;return n&&(s=(0,Ne.str)`${s}${(0,Ih.getErrorPath)(n,Ih.Type.Str)}`),[$i.schemaPath,s]}function vV(t,{params:e,message:n},r){let{keyword:s,data:i,schemaValue:o,it:a}=t,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:d}=a;r.push([$i.keyword,s],[$i.params,typeof e=="function"?e(t):e||(0,Ne._)`{}`]),c.messages&&r.push([$i.message,typeof n=="function"?n(t):n]),c.verbose&&r.push([$i.schema,o],[$i.parentSchema,(0,Ne._)`${u}${d}`],[hn.default.data,i]),l&&r.push([$i.propertyName,l])}});var TA=w(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});la.boolOrEmptySchema=la.topBoolOrEmptySchema=void 0;var TV=sl(),_V=ue(),SV=Qn(),EV={message:"boolean schema is false"};function wV(t){let{gen:e,schema:n,validateName:r}=t;n===!1?vA(t,!1):typeof n=="object"&&n.$async===!0?e.return(SV.default.data):(e.assign((0,_V._)`${r}.errors`,null),e.return(!0))}la.topBoolOrEmptySchema=wV;function kV(t,e){let{gen:n,schema:r}=t;r===!1?(n.var(e,!1),vA(t)):n.var(e,!0)}la.boolOrEmptySchema=kV;function vA(t,e){let{gen:n,data:r}=t,s={gen:n,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,TV.reportError)(s,EV,void 0,e)}});var dv=w(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});ua.getRules=ua.isJSONType=void 0;var NV=["string","number","integer","boolean","null","object","array"],PV=new Set(NV);function RV(t){return typeof t=="string"&&PV.has(t)}ua.isJSONType=RV;function DV(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}ua.getRules=DV});var fv=w(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});Xs.shouldUseRule=Xs.shouldUseGroup=Xs.schemaHasRulesForType=void 0;function CV({schema:t,self:e},n){let r=e.RULES.types[n];return r&&r!==!0&&_A(t,r)}Xs.schemaHasRulesForType=CV;function _A(t,e){return e.rules.some(n=>SA(t,n))}Xs.shouldUseGroup=_A;function SA(t,e){var n;return t[e.keyword]!==void 0||((n=e.definition.implements)===null||n===void 0?void 0:n.some(r=>t[r]!==void 0))}Xs.shouldUseRule=SA});var il=w(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.reportTypeError=sn.checkDataTypes=sn.checkDataType=sn.coerceAndCheckDataType=sn.getJSONTypes=sn.getSchemaTypes=sn.DataType=void 0;var AV=dv(),OV=fv(),IV=sl(),de=ue(),EA=ye(),da;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(da||(sn.DataType=da={}));function xV(t){let e=wA(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}sn.getSchemaTypes=xV;function wA(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(AV.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}sn.getJSONTypes=wA;function MV(t,e){let{gen:n,data:r,opts:s}=t,i=LV(e,s.coerceTypes),o=e.length>0&&!(i.length===0&&e.length===1&&(0,OV.schemaHasRulesForType)(t,e[0]));if(o){let a=pv(e,r,s.strictNumbers,da.Wrong);n.if(a,()=>{i.length?$V(t,e,i):mv(t)})}return o}sn.coerceAndCheckDataType=MV;var kA=new Set(["string","number","integer","boolean","null"]);function LV(t,e){return e?t.filter(n=>kA.has(n)||e==="array"&&n==="array"):[]}function $V(t,e,n){let{gen:r,data:s,opts:i}=t,o=r.let("dataType",(0,de._)`typeof ${s}`),a=r.let("coerced",(0,de._)`undefined`);i.coerceTypes==="array"&&r.if((0,de._)`${o} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>r.assign(s,(0,de._)`${s}[0]`).assign(o,(0,de._)`typeof ${s}`).if(pv(e,s,i.strictNumbers),()=>r.assign(a,s))),r.if((0,de._)`${a} !== undefined`);for(let l of n)(kA.has(l)||l==="array"&&i.coerceTypes==="array")&&c(l);r.else(),mv(t),r.endIf(),r.if((0,de._)`${a} !== undefined`,()=>{r.assign(s,a),qV(t,a)});function c(l){switch(l){case"string":r.elseIf((0,de._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,de._)`"" + ${s}`).elseIf((0,de._)`${s} === null`).assign(a,(0,de._)`""`);return;case"number":r.elseIf((0,de._)`${o} == "boolean" || ${s} === null
177
+ || (${o} == "string" && ${s} && ${s} == +${s})`).assign(a,(0,de._)`+${s}`);return;case"integer":r.elseIf((0,de._)`${o} === "boolean" || ${s} === null
178
+ || (${o} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(a,(0,de._)`+${s}`);return;case"boolean":r.elseIf((0,de._)`${s} === "false" || ${s} === 0 || ${s} === null`).assign(a,!1).elseIf((0,de._)`${s} === "true" || ${s} === 1`).assign(a,!0);return;case"null":r.elseIf((0,de._)`${s} === "" || ${s} === 0 || ${s} === false`),r.assign(a,null);return;case"array":r.elseIf((0,de._)`${o} === "string" || ${o} === "number"
179
+ || ${o} === "boolean" || ${s} === null`).assign(a,(0,de._)`[${s}]`)}}}function qV({gen:t,parentData:e,parentDataProperty:n},r){t.if((0,de._)`${e} !== undefined`,()=>t.assign((0,de._)`${e}[${n}]`,r))}function hv(t,e,n,r=da.Correct){let s=r===da.Correct?de.operators.EQ:de.operators.NEQ,i;switch(t){case"null":return(0,de._)`${e} ${s} null`;case"array":i=(0,de._)`Array.isArray(${e})`;break;case"object":i=(0,de._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":i=o((0,de._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":i=o();break;default:return(0,de._)`typeof ${e} ${s} ${t}`}return r===da.Correct?i:(0,de.not)(i);function o(a=de.nil){return(0,de.and)((0,de._)`typeof ${e} == "number"`,a,n?(0,de._)`isFinite(${e})`:de.nil)}}sn.checkDataType=hv;function pv(t,e,n,r){if(t.length===1)return hv(t[0],e,n,r);let s,i=(0,EA.toHash)(t);if(i.array&&i.object){let o=(0,de._)`typeof ${e} != "object"`;s=i.null?o:(0,de._)`!${e} || ${o}`,delete i.null,delete i.array,delete i.object}else s=de.nil;i.number&&delete i.integer;for(let o in i)s=(0,de.and)(s,hv(o,e,n,r));return s}sn.checkDataTypes=pv;var jV={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,de._)`{type: ${t}}`:(0,de._)`{type: ${e}}`};function mv(t){let e=FV(t);(0,IV.reportError)(e,jV)}sn.reportTypeError=mv;function FV(t){let{gen:e,data:n,schema:r}=t,s=(0,EA.schemaRefOrVal)(t,r,"type");return{gen:e,keyword:"type",data:n,schema:r.type,schemaCode:s,schemaValue:s,parentSchema:r,params:{},it:t}}});var PA=w(xh=>{"use strict";Object.defineProperty(xh,"__esModule",{value:!0});xh.assignDefaults=void 0;var fa=ue(),BV=ye();function UV(t,e){let{properties:n,items:r}=t.schema;if(e==="object"&&n)for(let s in n)NA(t,s,n[s].default);else e==="array"&&Array.isArray(r)&&r.forEach((s,i)=>NA(t,i,s.default))}xh.assignDefaults=UV;function NA(t,e,n){let{gen:r,compositeRule:s,data:i,opts:o}=t;if(n===void 0)return;let a=(0,fa._)`${i}${(0,fa.getProperty)(e)}`;if(s){(0,BV.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,fa._)`${a} === undefined`;o.useDefaults==="empty"&&(c=(0,fa._)`${c} || ${a} === null || ${a} === ""`),r.if(c,(0,fa._)`${a} = ${(0,fa.stringify)(n)}`)}});var Zn=w(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.validateUnion=We.validateArray=We.usePattern=We.callValidateCode=We.schemaProperties=We.allSchemaProperties=We.noPropertyInData=We.propertyInData=We.isOwnProperty=We.hasPropFunc=We.reportMissingProp=We.checkMissingProp=We.checkReportMissingProp=void 0;var at=ue(),gv=ye(),Js=Qn(),VV=ye();function zV(t,e){let{gen:n,data:r,it:s}=t;n.if(bv(n,r,e,s.opts.ownProperties),()=>{t.setParams({missingProperty:(0,at._)`${e}`},!0),t.error()})}We.checkReportMissingProp=zV;function WV({gen:t,data:e,it:{opts:n}},r,s){return(0,at.or)(...r.map(i=>(0,at.and)(bv(t,e,i,n.ownProperties),(0,at._)`${s} = ${i}`)))}We.checkMissingProp=WV;function HV(t,e){t.setParams({missingProperty:e},!0),t.error()}We.reportMissingProp=HV;function RA(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,at._)`Object.prototype.hasOwnProperty`})}We.hasPropFunc=RA;function yv(t,e,n){return(0,at._)`${RA(t)}.call(${e}, ${n})`}We.isOwnProperty=yv;function GV(t,e,n,r){let s=(0,at._)`${e}${(0,at.getProperty)(n)} !== undefined`;return r?(0,at._)`${s} && ${yv(t,e,n)}`:s}We.propertyInData=GV;function bv(t,e,n,r){let s=(0,at._)`${e}${(0,at.getProperty)(n)} === undefined`;return r?(0,at.or)(s,(0,at.not)(yv(t,e,n))):s}We.noPropertyInData=bv;function DA(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}We.allSchemaProperties=DA;function KV(t,e){return DA(e).filter(n=>!(0,gv.alwaysValidSchema)(t,e[n]))}We.schemaProperties=KV;function YV({schemaCode:t,data:e,it:{gen:n,topSchemaRef:r,schemaPath:s,errorPath:i},it:o},a,c,l){let u=l?(0,at._)`${t}, ${e}, ${r}${s}`:e,d=[[Js.default.instancePath,(0,at.strConcat)(Js.default.instancePath,i)],[Js.default.parentData,o.parentData],[Js.default.parentDataProperty,o.parentDataProperty],[Js.default.rootData,Js.default.rootData]];o.opts.dynamicRef&&d.push([Js.default.dynamicAnchors,Js.default.dynamicAnchors]);let f=(0,at._)`${u}, ${n.object(...d)}`;return c!==at.nil?(0,at._)`${a}.call(${c}, ${f})`:(0,at._)`${a}(${f})`}We.callValidateCode=YV;var XV=(0,at._)`new RegExp`;function JV({gen:t,it:{opts:e}},n){let r=e.unicodeRegExp?"u":"",{regExp:s}=e.code,i=s(n,r);return t.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,at._)`${s.code==="new RegExp"?XV:(0,VV.useFunc)(t,s)}(${n}, ${r})`})}We.usePattern=JV;function QV(t){let{gen:e,data:n,keyword:r,it:s}=t,i=e.name("valid");if(s.allErrors){let a=e.let("valid",!0);return o(()=>e.assign(a,!1)),a}return e.var(i,!0),o(()=>e.break()),i;function o(a){let c=e.const("len",(0,at._)`${n}.length`);e.forRange("i",0,c,l=>{t.subschema({keyword:r,dataProp:l,dataPropType:gv.Type.Num},i),e.if((0,at.not)(i),a)})}}We.validateArray=QV;function ZV(t){let{gen:e,schema:n,keyword:r,it:s}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some(c=>(0,gv.alwaysValidSchema)(s,c))&&!s.opts.unevaluated)return;let o=e.let("valid",!1),a=e.name("_valid");e.block(()=>n.forEach((c,l)=>{let u=t.subschema({keyword:r,schemaProp:l,compositeRule:!0},a);e.assign(o,(0,at._)`${o} || ${a}`),t.mergeValidEvaluated(u,a)||e.if((0,at.not)(o))})),t.result(o,()=>t.reset(),()=>t.error(!0))}We.validateUnion=ZV});var OA=w(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.validateKeywordUsage=Vr.validSchemaType=Vr.funcKeywordCode=Vr.macroKeywordCode=void 0;var pn=ue(),qi=Qn(),e2=Zn(),t2=sl();function n2(t,e){let{gen:n,keyword:r,schema:s,parentSchema:i,it:o}=t,a=e.macro.call(o.self,s,i,o),c=AA(n,r,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);let l=n.name("valid");t.subschema({schema:a,schemaPath:pn.nil,errSchemaPath:`${o.errSchemaPath}/${r}`,topSchemaRef:c,compositeRule:!0},l),t.pass(l,()=>t.error(!0))}Vr.macroKeywordCode=n2;function r2(t,e){var n;let{gen:r,keyword:s,schema:i,parentSchema:o,$data:a,it:c}=t;i2(c,e);let l=!a&&e.compile?e.compile.call(c.self,i,o,c):e.validate,u=AA(r,s,l),d=r.let("valid");t.block$data(d,f),t.ok((n=e.valid)!==null&&n!==void 0?n:d);function f(){if(e.errors===!1)m(),e.modifying&&CA(t),_(()=>t.error());else{let E=e.async?h():y();e.modifying&&CA(t),_(()=>s2(t,E))}}function h(){let E=r.let("ruleErrs",null);return r.try(()=>m((0,pn._)`await `),T=>r.assign(d,!1).if((0,pn._)`${T} instanceof ${c.ValidationError}`,()=>r.assign(E,(0,pn._)`${T}.errors`),()=>r.throw(T))),E}function y(){let E=(0,pn._)`${u}.errors`;return r.assign(E,null),m(pn.nil),E}function m(E=e.async?(0,pn._)`await `:pn.nil){let T=c.opts.passContext?qi.default.this:qi.default.self,b=!("compile"in e&&!a||e.schema===!1);r.assign(d,(0,pn._)`${E}${(0,e2.callValidateCode)(t,u,T,b)}`,e.modifying)}function _(E){var T;r.if((0,pn.not)((T=e.valid)!==null&&T!==void 0?T:d),E)}}Vr.funcKeywordCode=r2;function CA(t){let{gen:e,data:n,it:r}=t;e.if(r.parentData,()=>e.assign(n,(0,pn._)`${r.parentData}[${r.parentDataProperty}]`))}function s2(t,e){let{gen:n}=t;n.if((0,pn._)`Array.isArray(${e})`,()=>{n.assign(qi.default.vErrors,(0,pn._)`${qi.default.vErrors} === null ? ${e} : ${qi.default.vErrors}.concat(${e})`).assign(qi.default.errors,(0,pn._)`${qi.default.vErrors}.length`),(0,t2.extendErrors)(t)},()=>t.error())}function i2({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function AA(t,e,n){if(n===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof n=="function"?{ref:n}:{ref:n,code:(0,pn.stringify)(n)})}function o2(t,e,n=!1){return!e.length||e.some(r=>r==="array"?Array.isArray(t):r==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==r||n&&typeof t>"u")}Vr.validSchemaType=o2;function a2({schema:t,opts:e,self:n,errSchemaPath:r},s,i){if(Array.isArray(s.keyword)?!s.keyword.includes(i):s.keyword!==i)throw new Error("ajv implementation error");let o=s.dependencies;if(o?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${i}: ${o.join(",")}`);if(s.validateSchema&&!s.validateSchema(t[i])){let c=`keyword "${i}" value is invalid at path "${r}": `+n.errorsText(s.validateSchema.errors);if(e.validateSchema==="log")n.logger.error(c);else throw new Error(c)}}Vr.validateKeywordUsage=a2});var xA=w(Qs=>{"use strict";Object.defineProperty(Qs,"__esModule",{value:!0});Qs.extendSubschemaMode=Qs.extendSubschemaData=Qs.getSubschema=void 0;var zr=ue(),IA=ye();function c2(t,{keyword:e,schemaProp:n,schema:r,schemaPath:s,errSchemaPath:i,topSchemaRef:o}){if(e!==void 0&&r!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return n===void 0?{schema:a,schemaPath:(0,zr._)`${t.schemaPath}${(0,zr.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[n],schemaPath:(0,zr._)`${t.schemaPath}${(0,zr.getProperty)(e)}${(0,zr.getProperty)(n)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,IA.escapeFragment)(n)}`}}if(r!==void 0){if(s===void 0||i===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:r,schemaPath:s,topSchemaRef:o,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}Qs.getSubschema=c2;function l2(t,e,{dataProp:n,dataPropType:r,data:s,dataTypes:i,propertyName:o}){if(s!==void 0&&n!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(n!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=e,f=a.let("data",(0,zr._)`${e.data}${(0,zr.getProperty)(n)}`,!0);c(f),t.errorPath=(0,zr.str)`${l}${(0,IA.getErrorPath)(n,r,d.jsPropertySyntax)}`,t.parentDataProperty=(0,zr._)`${n}`,t.dataPathArr=[...u,t.parentDataProperty]}if(s!==void 0){let l=s instanceof zr.Name?s:a.let("data",s,!0);c(l),o!==void 0&&(t.propertyName=o)}i&&(t.dataTypes=i);function c(l){t.data=l,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,l]}}Qs.extendSubschemaData=l2;function u2(t,{jtdDiscriminator:e,jtdMetadata:n,compositeRule:r,createErrors:s,allErrors:i}){r!==void 0&&(t.compositeRule=r),s!==void 0&&(t.createErrors=s),i!==void 0&&(t.allErrors=i),t.jtdDiscriminator=e,t.jtdMetadata=n}Qs.extendSubschemaMode=u2});var vv=w((Nse,MA)=>{"use strict";MA.exports=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,s,i;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(s=r;s--!==0;)if(!t(e[s],n[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(n).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[s]))return!1;for(s=r;s--!==0;){var o=i[s];if(!t(e[o],n[o]))return!1}return!0}return e!==e&&n!==n}});var $A=w((Pse,LA)=>{"use strict";var Zs=LA.exports=function(t,e,n){typeof e=="function"&&(n=e,e={}),n=e.cb||n;var r=typeof n=="function"?n:n.pre||function(){},s=n.post||function(){};Mh(e,r,s,t,"",t)};Zs.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Zs.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Zs.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Zs.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Mh(t,e,n,r,s,i,o,a,c,l){if(r&&typeof r=="object"&&!Array.isArray(r)){e(r,s,i,o,a,c,l);for(var u in r){var d=r[u];if(Array.isArray(d)){if(u in Zs.arrayKeywords)for(var f=0;f<d.length;f++)Mh(t,e,n,d[f],s+"/"+u+"/"+f,i,s,u,r,f)}else if(u in Zs.propsKeywords){if(d&&typeof d=="object")for(var h in d)Mh(t,e,n,d[h],s+"/"+u+"/"+d2(h),i,s,u,r,h)}else(u in Zs.keywords||t.allKeys&&!(u in Zs.skipKeywords))&&Mh(t,e,n,d,s+"/"+u,i,s,u,r)}n(r,s,i,o,a,c,l)}}function d2(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var ol=w(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.getSchemaRefs=Dn.resolveUrl=Dn.normalizeId=Dn._getFullPath=Dn.getFullPath=Dn.inlineRef=void 0;var f2=ye(),h2=vv(),p2=$A(),m2=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function g2(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Tv(t):e?qA(t)<=e:!1}Dn.inlineRef=g2;var y2=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Tv(t){for(let e in t){if(y2.has(e))return!0;let n=t[e];if(Array.isArray(n)&&n.some(Tv)||typeof n=="object"&&Tv(n))return!0}return!1}function qA(t){let e=0;for(let n in t){if(n==="$ref")return 1/0;if(e++,!m2.has(n)&&(typeof t[n]=="object"&&(0,f2.eachItem)(t[n],r=>e+=qA(r)),e===1/0))return 1/0}return e}function jA(t,e="",n){n!==!1&&(e=ha(e));let r=t.parse(e);return FA(t,r)}Dn.getFullPath=jA;function FA(t,e){return t.serialize(e).split("#")[0]+"#"}Dn._getFullPath=FA;var b2=/#\/?$/;function ha(t){return t?t.replace(b2,""):""}Dn.normalizeId=ha;function v2(t,e,n){return n=ha(n),t.resolve(e,n)}Dn.resolveUrl=v2;var T2=/^[a-z_][-a-z0-9._]*$/i;function _2(t,e){if(typeof t=="boolean")return{};let{schemaId:n,uriResolver:r}=this.opts,s=ha(t[n]||e),i={"":s},o=jA(r,s,!1),a={},c=new Set;return p2(t,{allKeys:!0},(d,f,h,y)=>{if(y===void 0)return;let m=o+f,_=i[y];typeof d[n]=="string"&&(_=E.call(this,d[n])),T.call(this,d.$anchor),T.call(this,d.$dynamicAnchor),i[f]=_;function E(b){let R=this.opts.uriResolver.resolve;if(b=ha(_?R(_,b):b),c.has(b))throw u(b);c.add(b);let D=this.refs[b];return typeof D=="string"&&(D=this.refs[D]),typeof D=="object"?l(d,D.schema,b):b!==ha(m)&&(b[0]==="#"?(l(d,a[b],b),a[b]=d):this.refs[b]=m),b}function T(b){if(typeof b=="string"){if(!T2.test(b))throw new Error(`invalid anchor "${b}"`);E.call(this,`#${b}`)}}}),a;function l(d,f,h){if(f!==void 0&&!h2(d,f))throw u(h)}function u(d){return new Error(`reference "${d}" resolves to more than one schema`)}}Dn.getSchemaRefs=_2});var ll=w(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.getData=ei.KeywordCxt=ei.validateFunctionCode=void 0;var WA=TA(),BA=il(),Sv=fv(),Lh=il(),S2=PA(),cl=OA(),_v=xA(),J=ue(),se=Qn(),E2=ol(),cs=ye(),al=sl();function w2(t){if(KA(t)&&(YA(t),GA(t))){P2(t);return}HA(t,()=>(0,WA.topBoolOrEmptySchema)(t))}ei.validateFunctionCode=w2;function HA({gen:t,validateName:e,schema:n,schemaEnv:r,opts:s},i){s.code.es5?t.func(e,(0,J._)`${se.default.data}, ${se.default.valCxt}`,r.$async,()=>{t.code((0,J._)`"use strict"; ${UA(n,s)}`),N2(t,s),t.code(i)}):t.func(e,(0,J._)`${se.default.data}, ${k2(s)}`,r.$async,()=>t.code(UA(n,s)).code(i))}function k2(t){return(0,J._)`{${se.default.instancePath}="", ${se.default.parentData}, ${se.default.parentDataProperty}, ${se.default.rootData}=${se.default.data}${t.dynamicRef?(0,J._)`, ${se.default.dynamicAnchors}={}`:J.nil}}={}`}function N2(t,e){t.if(se.default.valCxt,()=>{t.var(se.default.instancePath,(0,J._)`${se.default.valCxt}.${se.default.instancePath}`),t.var(se.default.parentData,(0,J._)`${se.default.valCxt}.${se.default.parentData}`),t.var(se.default.parentDataProperty,(0,J._)`${se.default.valCxt}.${se.default.parentDataProperty}`),t.var(se.default.rootData,(0,J._)`${se.default.valCxt}.${se.default.rootData}`),e.dynamicRef&&t.var(se.default.dynamicAnchors,(0,J._)`${se.default.valCxt}.${se.default.dynamicAnchors}`)},()=>{t.var(se.default.instancePath,(0,J._)`""`),t.var(se.default.parentData,(0,J._)`undefined`),t.var(se.default.parentDataProperty,(0,J._)`undefined`),t.var(se.default.rootData,se.default.data),e.dynamicRef&&t.var(se.default.dynamicAnchors,(0,J._)`{}`)})}function P2(t){let{schema:e,opts:n,gen:r}=t;HA(t,()=>{n.$comment&&e.$comment&&JA(t),O2(t),r.let(se.default.vErrors,null),r.let(se.default.errors,0),n.unevaluated&&R2(t),XA(t),M2(t)})}function R2(t){let{gen:e,validateName:n}=t;t.evaluated=e.const("evaluated",(0,J._)`${n}.evaluated`),e.if((0,J._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,J._)`${t.evaluated}.props`,(0,J._)`undefined`)),e.if((0,J._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,J._)`${t.evaluated}.items`,(0,J._)`undefined`))}function UA(t,e){let n=typeof t=="object"&&t[e.schemaId];return n&&(e.code.source||e.code.process)?(0,J._)`/*# sourceURL=${n} */`:J.nil}function D2(t,e){if(KA(t)&&(YA(t),GA(t))){C2(t,e);return}(0,WA.boolOrEmptySchema)(t,e)}function GA({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let n in t)if(e.RULES.all[n])return!0;return!1}function KA(t){return typeof t.schema!="boolean"}function C2(t,e){let{schema:n,gen:r,opts:s}=t;s.$comment&&n.$comment&&JA(t),I2(t),x2(t);let i=r.const("_errs",se.default.errors);XA(t,i),r.var(e,(0,J._)`${i} === ${se.default.errors}`)}function YA(t){(0,cs.checkUnknownRules)(t),A2(t)}function XA(t,e){if(t.opts.jtd)return VA(t,[],!1,e);let n=(0,BA.getSchemaTypes)(t.schema),r=(0,BA.coerceAndCheckDataType)(t,n);VA(t,n,!r,e)}function A2(t){let{schema:e,errSchemaPath:n,opts:r,self:s}=t;e.$ref&&r.ignoreKeywordsWithRef&&(0,cs.schemaHasRulesButRef)(e,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function O2(t){let{schema:e,opts:n}=t;e.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,cs.checkStrictMode)(t,"default is ignored in the schema root")}function I2(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,E2.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function x2(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function JA({gen:t,schemaEnv:e,schema:n,errSchemaPath:r,opts:s}){let i=n.$comment;if(s.$comment===!0)t.code((0,J._)`${se.default.self}.logger.log(${i})`);else if(typeof s.$comment=="function"){let o=(0,J.str)`${r}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,J._)`${se.default.self}.opts.$comment(${i}, ${o}, ${a}.schema)`)}}function M2(t){let{gen:e,schemaEnv:n,validateName:r,ValidationError:s,opts:i}=t;n.$async?e.if((0,J._)`${se.default.errors} === 0`,()=>e.return(se.default.data),()=>e.throw((0,J._)`new ${s}(${se.default.vErrors})`)):(e.assign((0,J._)`${r}.errors`,se.default.vErrors),i.unevaluated&&L2(t),e.return((0,J._)`${se.default.errors} === 0`))}function L2({gen:t,evaluated:e,props:n,items:r}){n instanceof J.Name&&t.assign((0,J._)`${e}.props`,n),r instanceof J.Name&&t.assign((0,J._)`${e}.items`,r)}function VA(t,e,n,r){let{gen:s,schema:i,data:o,allErrors:a,opts:c,self:l}=t,{RULES:u}=l;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,cs.schemaHasRulesButRef)(i,u))){s.block(()=>ZA(t,"$ref",u.all.$ref.definition));return}c.jtd||$2(t,e),s.block(()=>{for(let f of u.rules)d(f);d(u.post)});function d(f){(0,Sv.shouldUseGroup)(i,f)&&(f.type?(s.if((0,Lh.checkDataType)(f.type,o,c.strictNumbers)),zA(t,f),e.length===1&&e[0]===f.type&&n&&(s.else(),(0,Lh.reportTypeError)(t)),s.endIf()):zA(t,f),a||s.if((0,J._)`${se.default.errors} === ${r||0}`))}}function zA(t,e){let{gen:n,schema:r,opts:{useDefaults:s}}=t;s&&(0,S2.assignDefaults)(t,e.type),n.block(()=>{for(let i of e.rules)(0,Sv.shouldUseRule)(r,i)&&ZA(t,i.keyword,i.definition,e.type)})}function $2(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(q2(t,e),t.opts.allowUnionTypes||j2(t,e),F2(t,t.dataTypes))}function q2(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(n=>{QA(t.dataTypes,n)||Ev(t,`type "${n}" not allowed by context "${t.dataTypes.join(",")}"`)}),U2(t,e)}}function j2(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Ev(t,"use allowUnionTypes to allow union type keyword")}function F2(t,e){let n=t.self.RULES.all;for(let r in n){let s=n[r];if(typeof s=="object"&&(0,Sv.shouldUseRule)(t.schema,s)){let{type:i}=s.definition;i.length&&!i.some(o=>B2(e,o))&&Ev(t,`missing type "${i.join(",")}" for keyword "${r}"`)}}}function B2(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function QA(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function U2(t,e){let n=[];for(let r of t.dataTypes)QA(e,r)?n.push(r):e.includes("integer")&&r==="number"&&n.push("integer");t.dataTypes=n}function Ev(t,e){let n=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${n}" (strictTypes)`,(0,cs.checkStrictMode)(t,e,t.opts.strictTypes)}var $h=class{constructor(e,n,r){if((0,cl.validateKeywordUsage)(e,n,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=n.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,cs.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=n.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=n,this.$data)this.schemaCode=e.gen.const("vSchema",eO(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,cl.validSchemaType)(this.schema,n.schemaType,n.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(n.schemaType)}`);("code"in n?n.trackErrors:n.errors!==!1)&&(this.errsCount=e.gen.const("_errs",se.default.errors))}result(e,n,r){this.failResult((0,J.not)(e),n,r)}failResult(e,n,r){this.gen.if(e),r?r():this.error(),n?(this.gen.else(),n(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,n){this.failResult((0,J.not)(e),void 0,n)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:n}=this;this.fail((0,J._)`${n} !== undefined && (${(0,J.or)(this.invalid$data(),e)})`)}error(e,n,r){if(n){this.setParams(n),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,n){(e?al.reportExtraError:al.reportError)(this,this.def.error,n)}$dataError(){(0,al.reportError)(this,this.def.$dataError||al.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,al.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,n){n?Object.assign(this.params,e):this.params=e}block$data(e,n,r=J.nil){this.gen.block(()=>{this.check$data(e,r),n()})}check$data(e=J.nil,n=J.nil){if(!this.$data)return;let{gen:r,schemaCode:s,schemaType:i,def:o}=this;r.if((0,J.or)((0,J._)`${s} === undefined`,n)),e!==J.nil&&r.assign(e,!0),(i.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==J.nil&&r.assign(e,!1)),r.else()}invalid$data(){let{gen:e,schemaCode:n,schemaType:r,def:s,it:i}=this;return(0,J.or)(o(),a());function o(){if(r.length){if(!(n instanceof J.Name))throw new Error("ajv implementation error");let c=Array.isArray(r)?r:[r];return(0,J._)`${(0,Lh.checkDataTypes)(c,n,i.opts.strictNumbers,Lh.DataType.Wrong)}`}return J.nil}function a(){if(s.validateSchema){let c=e.scopeValue("validate$data",{ref:s.validateSchema});return(0,J._)`!${c}(${n})`}return J.nil}}subschema(e,n){let r=(0,_v.getSubschema)(this.it,e);(0,_v.extendSubschemaData)(r,this.it,e),(0,_v.extendSubschemaMode)(r,e);let s={...this.it,...r,items:void 0,props:void 0};return D2(s,n),s}mergeEvaluated(e,n){let{it:r,gen:s}=this;r.opts.unevaluated&&(r.props!==!0&&e.props!==void 0&&(r.props=cs.mergeEvaluated.props(s,e.props,r.props,n)),r.items!==!0&&e.items!==void 0&&(r.items=cs.mergeEvaluated.items(s,e.items,r.items,n)))}mergeValidEvaluated(e,n){let{it:r,gen:s}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return s.if(n,()=>this.mergeEvaluated(e,J.Name)),!0}};ei.KeywordCxt=$h;function ZA(t,e,n,r){let s=new $h(t,n,e);"code"in n?n.code(s,r):s.$data&&n.validate?(0,cl.funcKeywordCode)(s,n):"macro"in n?(0,cl.macroKeywordCode)(s,n):(n.compile||n.validate)&&(0,cl.funcKeywordCode)(s,n)}var V2=/^\/(?:[^~]|~0|~1)*$/,z2=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function eO(t,{dataLevel:e,dataNames:n,dataPathArr:r}){let s,i;if(t==="")return se.default.rootData;if(t[0]==="/"){if(!V2.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);s=t,i=se.default.rootData}else{let l=z2.exec(t);if(!l)throw new Error(`Invalid JSON-pointer: ${t}`);let u=+l[1];if(s=l[2],s==="#"){if(u>=e)throw new Error(c("property/index",u));return r[e-u]}if(u>e)throw new Error(c("data",u));if(i=n[e-u],!s)return i}let o=i,a=s.split("/");for(let l of a)l&&(i=(0,J._)`${i}${(0,J.getProperty)((0,cs.unescapeJsonPointer)(l))}`,o=(0,J._)`${o} && ${i}`);return o;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${e}`}}ei.getData=eO});var qh=w(kv=>{"use strict";Object.defineProperty(kv,"__esModule",{value:!0});var wv=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};kv.default=wv});var ul=w(Rv=>{"use strict";Object.defineProperty(Rv,"__esModule",{value:!0});var Nv=ol(),Pv=class extends Error{constructor(e,n,r,s){super(s||`can't resolve reference ${r} from id ${n}`),this.missingRef=(0,Nv.resolveUrl)(e,n,r),this.missingSchema=(0,Nv.normalizeId)((0,Nv.getFullPath)(e,this.missingRef))}};Rv.default=Pv});var dl=w(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.resolveSchema=er.getCompilingSchema=er.resolveRef=er.compileSchema=er.SchemaEnv=void 0;var Sr=ue(),W2=qh(),ji=Qn(),Er=ol(),tO=ye(),H2=ll(),pa=class{constructor(e){var n;this.refs={},this.dynamicAnchors={};let r;typeof e.schema=="object"&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(n=e.baseId)!==null&&n!==void 0?n:(0,Er.normalizeId)(r?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=r?.$async,this.refs={}}};er.SchemaEnv=pa;function Cv(t){let e=nO.call(this,t);if(e)return e;let n=(0,Er.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:r,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new Sr.CodeGen(this.scope,{es5:r,lines:s,ownProperties:i}),a;t.$async&&(a=o.scopeValue("Error",{ref:W2.default,code:(0,Sr._)`require("ajv/dist/runtime/validation_error").default`}));let c=o.scopeName("validate");t.validateName=c;let l={gen:o,allErrors:this.opts.allErrors,data:ji.default.data,parentData:ji.default.parentData,parentDataProperty:ji.default.parentDataProperty,dataNames:[ji.default.data],dataPathArr:[Sr.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Sr.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:n,baseId:t.baseId||n,schemaPath:Sr.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Sr._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(t),(0,H2.validateFunctionCode)(l),o.optimize(this.opts.code.optimize);let d=o.toString();u=`${o.scopeRefs(ji.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,t));let h=new Function(`${ji.default.self}`,`${ji.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:h}),h.errors=null,h.schema=t.schema,h.schemaEnv=t,t.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:c,validateCode:d,scopeValues:o._values}),this.opts.unevaluated){let{props:y,items:m}=l;h.evaluated={props:y instanceof Sr.Name?void 0:y,items:m instanceof Sr.Name?void 0:m,dynamicProps:y instanceof Sr.Name,dynamicItems:m instanceof Sr.Name},h.source&&(h.source.evaluated=(0,Sr.stringify)(h.evaluated))}return t.validate=h,t}catch(d){throw delete t.validate,delete t.validateName,u&&this.logger.error("Error compiling schema, function code:",u),d}finally{this._compilations.delete(t)}}er.compileSchema=Cv;function G2(t,e,n){var r;n=(0,Er.resolveUrl)(this.opts.uriResolver,e,n);let s=t.refs[n];if(s)return s;let i=X2.call(this,t,n);if(i===void 0){let o=(r=t.localRefs)===null||r===void 0?void 0:r[n],{schemaId:a}=this.opts;o&&(i=new pa({schema:o,schemaId:a,root:t,baseId:e}))}if(i!==void 0)return t.refs[n]=K2.call(this,i)}er.resolveRef=G2;function K2(t){return(0,Er.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Cv.call(this,t)}function nO(t){for(let e of this._compilations)if(Y2(e,t))return e}er.getCompilingSchema=nO;function Y2(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function X2(t,e){let n;for(;typeof(n=this.refs[e])=="string";)e=n;return n||this.schemas[e]||jh.call(this,t,e)}function jh(t,e){let n=this.opts.uriResolver.parse(e),r=(0,Er._getFullPath)(this.opts.uriResolver,n),s=(0,Er.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&r===s)return Dv.call(this,n,t);let i=(0,Er.normalizeId)(r),o=this.refs[i]||this.schemas[i];if(typeof o=="string"){let a=jh.call(this,t,o);return typeof a?.schema!="object"?void 0:Dv.call(this,n,a)}if(typeof o?.schema=="object"){if(o.validate||Cv.call(this,o),i===(0,Er.normalizeId)(e)){let{schema:a}=o,{schemaId:c}=this.opts,l=a[c];return l&&(s=(0,Er.resolveUrl)(this.opts.uriResolver,s,l)),new pa({schema:a,schemaId:c,root:t,baseId:s})}return Dv.call(this,n,o)}}er.resolveSchema=jh;var J2=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Dv(t,{baseId:e,schema:n,root:r}){var s;if(((s=t.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof n=="boolean")return;let c=n[(0,tO.unescapeFragment)(a)];if(c===void 0)return;n=c;let l=typeof n=="object"&&n[this.opts.schemaId];!J2.has(a)&&l&&(e=(0,Er.resolveUrl)(this.opts.uriResolver,e,l))}let i;if(typeof n!="boolean"&&n.$ref&&!(0,tO.schemaHasRulesButRef)(n,this.RULES)){let a=(0,Er.resolveUrl)(this.opts.uriResolver,e,n.$ref);i=jh.call(this,r,a)}let{schemaId:o}=this.opts;if(i=i||new pa({schema:n,schemaId:o,root:r,baseId:e}),i.schema!==i.root.schema)return i}});var rO=w((Ise,Q2)=>{Q2.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var iO=w((xse,sO)=>{"use strict";var Z2={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};sO.exports={HEX:Z2}});var hO=w((Mse,fO)=>{"use strict";var{HEX:ez}=iO(),tz=/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;function lO(t){if(dO(t,".")<3)return{host:t,isIPV4:!1};let e=t.match(tz)||[],[n]=e;return n?{host:rz(n,"."),isIPV4:!0}:{host:t,isIPV4:!1}}function Av(t,e=!1){let n="",r=!0;for(let s of t){if(ez[s]===void 0)return;s!=="0"&&r===!0&&(r=!1),r||(n+=s)}return e&&n.length===0&&(n="0"),n}function nz(t){let e=0,n={error:!1,address:"",zone:""},r=[],s=[],i=!1,o=!1,a=!1;function c(){if(s.length){if(i===!1){let l=Av(s);if(l!==void 0)r.push(l);else return n.error=!0,!1}s.length=0}return!0}for(let l=0;l<t.length;l++){let u=t[l];if(!(u==="["||u==="]"))if(u===":"){if(o===!0&&(a=!0),!c())break;if(e++,r.push(":"),e>7){n.error=!0;break}l-1>=0&&t[l-1]===":"&&(o=!0);continue}else if(u==="%"){if(!c())break;i=!0}else{s.push(u);continue}}return s.length&&(i?n.zone=s.join(""):a?r.push(s.join("")):r.push(Av(s))),n.address=r.join(""),n}function uO(t){if(dO(t,":")<2)return{host:t,isIPV6:!1};let e=nz(t);if(e.error)return{host:t,isIPV6:!1};{let n=e.address,r=e.address;return e.zone&&(n+="%"+e.zone,r+="%25"+e.zone),{host:n,escapedHost:r,isIPV6:!0}}}function rz(t,e){let n="",r=!0,s=t.length;for(let i=0;i<s;i++){let o=t[i];o==="0"&&r?(i+1<=s&&t[i+1]===e||i+1===s)&&(n+=o,r=!1):(o===e?r=!0:r=!1,n+=o)}return n}function dO(t,e){let n=0;for(let r=0;r<t.length;r++)t[r]===e&&n++;return n}var oO=/^\.\.?\//u,aO=/^\/\.(?:\/|$)/u,cO=/^\/\.\.(?:\/|$)/u,sz=/^\/?(?:.|\n)*?(?=\/|$)/u;function iz(t){let e=[];for(;t.length;)if(t.match(oO))t=t.replace(oO,"");else if(t.match(aO))t=t.replace(aO,"/");else if(t.match(cO))t=t.replace(cO,"/"),e.pop();else if(t==="."||t==="..")t="";else{let n=t.match(sz);if(n){let r=n[0];t=t.slice(r.length),e.push(r)}else throw new Error("Unexpected dot segment condition")}return e.join("")}function oz(t,e){let n=e!==!0?escape:unescape;return t.scheme!==void 0&&(t.scheme=n(t.scheme)),t.userinfo!==void 0&&(t.userinfo=n(t.userinfo)),t.host!==void 0&&(t.host=n(t.host)),t.path!==void 0&&(t.path=n(t.path)),t.query!==void 0&&(t.query=n(t.query)),t.fragment!==void 0&&(t.fragment=n(t.fragment)),t}function az(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let n=unescape(t.host),r=lO(n);if(r.isIPV4)n=r.host;else{let s=uO(r.host);s.isIPV6===!0?n=`[${s.escapedHost}]`:n=t.host}e.push(n)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}fO.exports={recomposeAuthority:az,normalizeComponentEncoding:oz,removeDotSegments:iz,normalizeIPv4:lO,normalizeIPv6:uO,stringArrayToHexStripped:Av}});var vO=w((Lse,bO)=>{"use strict";var cz=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,lz=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function pO(t){return typeof t.secure=="boolean"?t.secure:String(t.scheme).toLowerCase()==="wss"}function mO(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function gO(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function uz(t){return t.secure=pO(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function dz(t){if((t.port===(pO(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,n]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=n,t.resourceName=void 0}return t.fragment=void 0,t}function fz(t,e){if(!t.path)return t.error="URN can not be parsed",t;let n=t.path.match(lz);if(n){let r=e.scheme||t.scheme||"urn";t.nid=n[1].toLowerCase(),t.nss=n[2];let s=`${r}:${e.nid||t.nid}`,i=Ov[s];t.path=void 0,i&&(t=i.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function hz(t,e){let n=e.scheme||t.scheme||"urn",r=t.nid.toLowerCase(),s=`${n}:${e.nid||r}`,i=Ov[s];i&&(t=i.serialize(t,e));let o=t,a=t.nss;return o.path=`${r||e.nid}:${a}`,e.skipEscape=!0,o}function pz(t,e){let n=t;return n.uuid=n.nss,n.nss=void 0,!e.tolerant&&(!n.uuid||!cz.test(n.uuid))&&(n.error=n.error||"UUID is not valid."),n}function mz(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var yO={scheme:"http",domainHost:!0,parse:mO,serialize:gO},gz={scheme:"https",domainHost:yO.domainHost,parse:mO,serialize:gO},Fh={scheme:"ws",domainHost:!0,parse:uz,serialize:dz},yz={scheme:"wss",domainHost:Fh.domainHost,parse:Fh.parse,serialize:Fh.serialize},bz={scheme:"urn",parse:fz,serialize:hz,skipNormalize:!0},vz={scheme:"urn:uuid",parse:pz,serialize:mz,skipNormalize:!0},Ov={http:yO,https:gz,ws:Fh,wss:yz,urn:bz,"urn:uuid":vz};bO.exports=Ov});var _O=w(($se,Uh)=>{"use strict";var{normalizeIPv6:Tz,normalizeIPv4:_z,removeDotSegments:fl,recomposeAuthority:Sz,normalizeComponentEncoding:Bh}=hO(),Iv=vO();function Ez(t,e){return typeof t=="string"?t=Wr(ls(t,e),e):typeof t=="object"&&(t=ls(Wr(t,e),e)),t}function wz(t,e,n){let r=Object.assign({scheme:"null"},n),s=TO(ls(t,r),ls(e,r),r,!0);return Wr(s,{...r,skipEscape:!0})}function TO(t,e,n,r){let s={};return r||(t=ls(Wr(t,n),n),e=ls(Wr(e,n),n)),n=n||{},!n.tolerant&&e.scheme?(s.scheme=e.scheme,s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=fl(e.path||""),s.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=fl(e.path||""),s.query=e.query):(e.path?(e.path.charAt(0)==="/"?s.path=fl(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?s.path="/"+e.path:t.path?s.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:s.path=e.path,s.path=fl(s.path)),s.query=e.query):(s.path=t.path,e.query!==void 0?s.query=e.query:s.query=t.query),s.userinfo=t.userinfo,s.host=t.host,s.port=t.port),s.scheme=t.scheme),s.fragment=e.fragment,s}function kz(t,e,n){return typeof t=="string"?(t=unescape(t),t=Wr(Bh(ls(t,n),!0),{...n,skipEscape:!0})):typeof t=="object"&&(t=Wr(Bh(t,!0),{...n,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=Wr(Bh(ls(e,n),!0),{...n,skipEscape:!0})):typeof e=="object"&&(e=Wr(Bh(e,!0),{...n,skipEscape:!0})),t.toLowerCase()===e.toLowerCase()}function Wr(t,e){let n={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},r=Object.assign({},e),s=[],i=Iv[(r.scheme||n.scheme||"").toLowerCase()];i&&i.serialize&&i.serialize(n,r),n.path!==void 0&&(r.skipEscape?n.path=unescape(n.path):(n.path=escape(n.path),n.scheme!==void 0&&(n.path=n.path.split("%3A").join(":")))),r.reference!=="suffix"&&n.scheme&&s.push(n.scheme,":");let o=Sz(n);if(o!==void 0&&(r.reference!=="suffix"&&s.push("//"),s.push(o),n.path&&n.path.charAt(0)!=="/"&&s.push("/")),n.path!==void 0){let a=n.path;!r.absolutePath&&(!i||!i.absolutePath)&&(a=fl(a)),o===void 0&&(a=a.replace(/^\/\//u,"/%2F")),s.push(a)}return n.query!==void 0&&s.push("?",n.query),n.fragment!==void 0&&s.push("#",n.fragment),s.join("")}var Nz=Array.from({length:127},(t,e)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(e)));function Pz(t){let e=0;for(let n=0,r=t.length;n<r;++n)if(e=t.charCodeAt(n),e>126||Nz[e])return!0;return!1}var Rz=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function ls(t,e){let n=Object.assign({},e),r={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=t.indexOf("%")!==-1,i=!1;n.reference==="suffix"&&(t=(n.scheme?n.scheme+":":"")+"//"+t);let o=t.match(Rz);if(o){if(r.scheme=o[1],r.userinfo=o[3],r.host=o[4],r.port=parseInt(o[5],10),r.path=o[6]||"",r.query=o[7],r.fragment=o[8],isNaN(r.port)&&(r.port=o[5]),r.host){let c=_z(r.host);if(c.isIPV4===!1){let l=Tz(c.host);r.host=l.host.toLowerCase(),i=l.isIPV6}else r.host=c.host,i=!0}r.scheme===void 0&&r.userinfo===void 0&&r.host===void 0&&r.port===void 0&&r.query===void 0&&!r.path?r.reference="same-document":r.scheme===void 0?r.reference="relative":r.fragment===void 0?r.reference="absolute":r.reference="uri",n.reference&&n.reference!=="suffix"&&n.reference!==r.reference&&(r.error=r.error||"URI is not a "+n.reference+" reference.");let a=Iv[(n.scheme||r.scheme||"").toLowerCase()];if(!n.unicodeSupport&&(!a||!a.unicodeSupport)&&r.host&&(n.domainHost||a&&a.domainHost)&&i===!1&&Pz(r.host))try{r.host=URL.domainToASCII(r.host.toLowerCase())}catch(c){r.error=r.error||"Host's domain name can not be converted to ASCII: "+c}(!a||a&&!a.skipNormalize)&&(s&&r.scheme!==void 0&&(r.scheme=unescape(r.scheme)),s&&r.host!==void 0&&(r.host=unescape(r.host)),r.path&&(r.path=escape(unescape(r.path))),r.fragment&&(r.fragment=encodeURI(decodeURIComponent(r.fragment)))),a&&a.parse&&a.parse(r,n)}else r.error=r.error||"URI can not be parsed.";return r}var xv={SCHEMES:Iv,normalize:Ez,resolve:wz,resolveComponents:TO,equal:kz,serialize:Wr,parse:ls};Uh.exports=xv;Uh.exports.default=xv;Uh.exports.fastUri=xv});var EO=w(Mv=>{"use strict";Object.defineProperty(Mv,"__esModule",{value:!0});var SO=_O();SO.code='require("ajv/dist/runtime/uri").default';Mv.default=SO});var AO=w(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.CodeGen=Gt.Name=Gt.nil=Gt.stringify=Gt.str=Gt._=Gt.KeywordCxt=void 0;var Dz=ll();Object.defineProperty(Gt,"KeywordCxt",{enumerable:!0,get:function(){return Dz.KeywordCxt}});var ma=ue();Object.defineProperty(Gt,"_",{enumerable:!0,get:function(){return ma._}});Object.defineProperty(Gt,"str",{enumerable:!0,get:function(){return ma.str}});Object.defineProperty(Gt,"stringify",{enumerable:!0,get:function(){return ma.stringify}});Object.defineProperty(Gt,"nil",{enumerable:!0,get:function(){return ma.nil}});Object.defineProperty(Gt,"Name",{enumerable:!0,get:function(){return ma.Name}});Object.defineProperty(Gt,"CodeGen",{enumerable:!0,get:function(){return ma.CodeGen}});var Cz=qh(),RO=ul(),Az=dv(),hl=dl(),Oz=ue(),pl=ol(),Vh=il(),$v=ye(),wO=rO(),Iz=EO(),DO=(t,e)=>new RegExp(t,e);DO.code="new RegExp";var xz=["removeAdditional","useDefaults","coerceTypes"],Mz=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Lz={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},$z={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},kO=200;function qz(t){var e,n,r,s,i,o,a,c,l,u,d,f,h,y,m,_,E,T,b,R,D,L,H,U,oe;let Be=t.strict,Rt=(e=t.code)===null||e===void 0?void 0:e.optimize,me=Rt===!0||Rt===void 0?1:Rt||0,Fn=(r=(n=t.code)===null||n===void 0?void 0:n.regExp)!==null&&r!==void 0?r:DO,us=(s=t.uriResolver)!==null&&s!==void 0?s:Iz.default;return{strictSchema:(o=(i=t.strictSchema)!==null&&i!==void 0?i:Be)!==null&&o!==void 0?o:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:Be)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=t.strictTypes)!==null&&l!==void 0?l:Be)!==null&&u!==void 0?u:"log",strictTuples:(f=(d=t.strictTuples)!==null&&d!==void 0?d:Be)!==null&&f!==void 0?f:"log",strictRequired:(y=(h=t.strictRequired)!==null&&h!==void 0?h:Be)!==null&&y!==void 0?y:!1,code:t.code?{...t.code,optimize:me,regExp:Fn}:{optimize:me,regExp:Fn},loopRequired:(m=t.loopRequired)!==null&&m!==void 0?m:kO,loopEnum:(_=t.loopEnum)!==null&&_!==void 0?_:kO,meta:(E=t.meta)!==null&&E!==void 0?E:!0,messages:(T=t.messages)!==null&&T!==void 0?T:!0,inlineRefs:(b=t.inlineRefs)!==null&&b!==void 0?b:!0,schemaId:(R=t.schemaId)!==null&&R!==void 0?R:"$id",addUsedSchema:(D=t.addUsedSchema)!==null&&D!==void 0?D:!0,validateSchema:(L=t.validateSchema)!==null&&L!==void 0?L:!0,validateFormats:(H=t.validateFormats)!==null&&H!==void 0?H:!0,unicodeRegExp:(U=t.unicodeRegExp)!==null&&U!==void 0?U:!0,int32range:(oe=t.int32range)!==null&&oe!==void 0?oe:!0,uriResolver:us}}var ml=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...qz(e)};let{es5:n,lines:r}=this.opts.code;this.scope=new Oz.ValueScope({scope:{},prefixes:Mz,es5:n,lines:r}),this.logger=zz(e.logger);let s=e.validateFormats;e.validateFormats=!1,this.RULES=(0,Az.getRules)(),NO.call(this,Lz,e,"NOT SUPPORTED"),NO.call(this,$z,e,"DEPRECATED","warn"),this._metaOpts=Uz.call(this),e.formats&&Fz.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&Bz.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),jz.call(this),e.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:n,schemaId:r}=this.opts,s=wO;r==="id"&&(s={...wO},s.id=s.$id,delete s.$id),n&&e&&this.addMetaSchema(s,s[r],!1)}defaultMeta(){let{meta:e,schemaId:n}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[n]||e:void 0}validate(e,n){let r;if(typeof e=="string"){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let s=r(n);return"$async"in r||(this.errors=r.errors),s}compile(e,n){let r=this._addSchema(e,n);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,n){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return s.call(this,e,n);async function s(u,d){await i.call(this,u.$schema);let f=this._addSchema(u,d);return f.validate||o.call(this,f)}async function i(u){u&&!this.getSchema(u)&&await s.call(this,{$ref:u},!0)}async function o(u){try{return this._compileSchemaEnv(u)}catch(d){if(!(d instanceof RO.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),o.call(this,u)}}function a({missingSchema:u,missingRef:d}){if(this.refs[u])throw new Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function c(u){let d=await l.call(this,u);this.refs[u]||await i.call(this,d.$schema),this.refs[u]||this.addSchema(d,u,n)}async function l(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=r(u))}finally{delete this._loading[u]}}}addSchema(e,n,r,s=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,r,s);return this}let i;if(typeof e=="object"){let{schemaId:o}=this.opts;if(i=e[o],i!==void 0&&typeof i!="string")throw new Error(`schema ${o} must be string`)}return n=(0,pl.normalizeId)(n||i),this._checkUnique(n),this.schemas[n]=this._addSchema(e,r,n,s,!0),this}addMetaSchema(e,n,r=this.opts.validateSchema){return this.addSchema(e,n,!0,r),this}validateSchema(e,n){if(typeof e=="boolean")return!0;let r;if(r=e.$schema,r!==void 0&&typeof r!="string")throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let s=this.validate(r,e);if(!s&&n){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return s}getSchema(e){let n;for(;typeof(n=PO.call(this,e))=="string";)e=n;if(n===void 0){let{schemaId:r}=this.opts,s=new hl.SchemaEnv({schema:{},schemaId:r});if(n=hl.resolveSchema.call(this,s,e),!n)return;this.refs[e]=n}return n.validate||this._compileSchemaEnv(n)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let n=PO.call(this,e);return typeof n=="object"&&this._cache.delete(n.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let n=e;this._cache.delete(n);let r=e[this.opts.schemaId];return r&&(r=(0,pl.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let n of e)this.addKeyword(n);return this}addKeyword(e,n){let r;if(typeof e=="string")r=e,typeof n=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),n.keyword=r);else if(typeof e=="object"&&n===void 0){if(n=e,r=n.keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(Hz.call(this,r,n),!n)return(0,$v.eachItem)(r,i=>Lv.call(this,i)),this;Kz.call(this,n);let s={...n,type:(0,Vh.getJSONTypes)(n.type),schemaType:(0,Vh.getJSONTypes)(n.schemaType)};return(0,$v.eachItem)(r,s.type.length===0?i=>Lv.call(this,i,s):i=>s.type.forEach(o=>Lv.call(this,i,s,o))),this}getKeyword(e){let n=this.RULES.all[e];return typeof n=="object"?n.definition:!!n}removeKeyword(e){let{RULES:n}=this;delete n.keywords[e],delete n.all[e];for(let r of n.rules){let s=r.rules.findIndex(i=>i.keyword===e);s>=0&&r.rules.splice(s,1)}return this}addFormat(e,n){return typeof n=="string"&&(n=new RegExp(n)),this.formats[e]=n,this}errorsText(e=this.errors,{separator:n=", ",dataVar:r="data"}={}){return!e||e.length===0?"No errors":e.map(s=>`${r}${s.instancePath} ${s.message}`).reduce((s,i)=>s+n+i)}$dataMetaSchema(e,n){let r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let s of n){let i=s.split("/").slice(1),o=e;for(let a of i)o=o[a];for(let a in r){let c=r[a];if(typeof c!="object")continue;let{$data:l}=c.definition,u=o[a];l&&u&&(o[a]=CO(u))}}return e}_removeAllSchemas(e,n){for(let r in e){let s=e[r];(!n||n.test(r))&&(typeof s=="string"?delete e[r]:s&&!s.meta&&(this._cache.delete(s.schema),delete e[r]))}}_addSchema(e,n,r,s=this.opts.validateSchema,i=this.opts.addUsedSchema){let o,{schemaId:a}=this.opts;if(typeof e=="object")o=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;r=(0,pl.normalizeId)(o||r);let l=pl.getSchemaRefs.call(this,e,r);return c=new hl.SchemaEnv({schema:e,schemaId:a,meta:n,baseId:r,localRefs:l}),this._cache.set(c.schema,c),i&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=c),s&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):hl.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let n=this.opts;this.opts=this._metaOpts;try{hl.compileSchema.call(this,e)}finally{this.opts=n}}};ml.ValidationError=Cz.default;ml.MissingRefError=RO.default;Gt.default=ml;function NO(t,e,n,r="error"){for(let s in t){let i=s;i in e&&this.logger[r](`${n}: option ${s}. ${t[i]}`)}}function PO(t){return t=(0,pl.normalizeId)(t),this.schemas[t]||this.refs[t]}function jz(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function Fz(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function Bz(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let n=t[e];n.keyword||(n.keyword=e),this.addKeyword(n)}}function Uz(){let t={...this.opts};for(let e of xz)delete t[e];return t}var Vz={log(){},warn(){},error(){}};function zz(t){if(t===!1)return Vz;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var Wz=/^[a-z_$][a-z0-9_$:-]*$/i;function Hz(t,e){let{RULES:n}=this;if((0,$v.eachItem)(t,r=>{if(n.keywords[r])throw new Error(`Keyword ${r} is already defined`);if(!Wz.test(r))throw new Error(`Keyword ${r} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function Lv(t,e,n){var r;let s=e?.post;if(n&&s)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,o=s?i.post:i.rules.find(({type:c})=>c===n);if(o||(o={type:n,rules:[]},i.rules.push(o)),i.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,Vh.getJSONTypes)(e.type),schemaType:(0,Vh.getJSONTypes)(e.schemaType)}};e.before?Gz.call(this,o,a,e.before):o.rules.push(a),i.all[t]=a,(r=e.implements)===null||r===void 0||r.forEach(c=>this.addKeyword(c))}function Gz(t,e,n){let r=t.rules.findIndex(s=>s.keyword===n);r>=0?t.rules.splice(r,0,e):(t.rules.push(e),this.logger.warn(`rule ${n} is not defined`))}function Kz(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=CO(e)),t.validateSchema=this.compile(e,!0))}var Yz={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function CO(t){return{anyOf:[t,Yz]}}});var OO=w(qv=>{"use strict";Object.defineProperty(qv,"__esModule",{value:!0});var Xz={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};qv.default=Xz});var Hh=w(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});Fi.callRef=Fi.getValidate=void 0;var Jz=ul(),IO=Zn(),Cn=ue(),ga=Qn(),xO=dl(),zh=ye(),Qz={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:n,it:r}=t,{baseId:s,schemaEnv:i,validateName:o,opts:a,self:c}=r,{root:l}=i;if((n==="#"||n==="#/")&&s===l.baseId)return d();let u=xO.resolveRef.call(c,l,s,n);if(u===void 0)throw new Jz.default(r.opts.uriResolver,s,n);if(u instanceof xO.SchemaEnv)return f(u);return h(u);function d(){if(i===l)return Wh(t,o,i,i.$async);let y=e.scopeValue("root",{ref:l});return Wh(t,(0,Cn._)`${y}.validate`,l,l.$async)}function f(y){let m=MO(t,y);Wh(t,m,y,y.$async)}function h(y){let m=e.scopeValue("schema",a.code.source===!0?{ref:y,code:(0,Cn.stringify)(y)}:{ref:y}),_=e.name("valid"),E=t.subschema({schema:y,dataTypes:[],schemaPath:Cn.nil,topSchemaRef:m,errSchemaPath:n},_);t.mergeEvaluated(E),t.ok(_)}}};function MO(t,e){let{gen:n}=t;return e.validate?n.scopeValue("validate",{ref:e.validate}):(0,Cn._)`${n.scopeValue("wrapper",{ref:e})}.validate`}Fi.getValidate=MO;function Wh(t,e,n,r){let{gen:s,it:i}=t,{allErrors:o,schemaEnv:a,opts:c}=i,l=c.passContext?ga.default.this:Cn.nil;r?u():d();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");let y=s.let("valid");s.try(()=>{s.code((0,Cn._)`await ${(0,IO.callValidateCode)(t,e,l)}`),h(e),o||s.assign(y,!0)},m=>{s.if((0,Cn._)`!(${m} instanceof ${i.ValidationError})`,()=>s.throw(m)),f(m),o||s.assign(y,!1)}),t.ok(y)}function d(){t.result((0,IO.callValidateCode)(t,e,l),()=>h(e),()=>f(e))}function f(y){let m=(0,Cn._)`${y}.errors`;s.assign(ga.default.vErrors,(0,Cn._)`${ga.default.vErrors} === null ? ${m} : ${ga.default.vErrors}.concat(${m})`),s.assign(ga.default.errors,(0,Cn._)`${ga.default.vErrors}.length`)}function h(y){var m;if(!i.opts.unevaluated)return;let _=(m=n?.validate)===null||m===void 0?void 0:m.evaluated;if(i.props!==!0)if(_&&!_.dynamicProps)_.props!==void 0&&(i.props=zh.mergeEvaluated.props(s,_.props,i.props));else{let E=s.var("props",(0,Cn._)`${y}.evaluated.props`);i.props=zh.mergeEvaluated.props(s,E,i.props,Cn.Name)}if(i.items!==!0)if(_&&!_.dynamicItems)_.items!==void 0&&(i.items=zh.mergeEvaluated.items(s,_.items,i.items));else{let E=s.var("items",(0,Cn._)`${y}.evaluated.items`);i.items=zh.mergeEvaluated.items(s,E,i.items,Cn.Name)}}}Fi.callRef=Wh;Fi.default=Qz});var LO=w(jv=>{"use strict";Object.defineProperty(jv,"__esModule",{value:!0});var Zz=OO(),eW=Hh(),tW=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Zz.default,eW.default];jv.default=tW});var $O=w(Fv=>{"use strict";Object.defineProperty(Fv,"__esModule",{value:!0});var Gh=ue(),ti=Gh.operators,Kh={maximum:{okStr:"<=",ok:ti.LTE,fail:ti.GT},minimum:{okStr:">=",ok:ti.GTE,fail:ti.LT},exclusiveMaximum:{okStr:"<",ok:ti.LT,fail:ti.GTE},exclusiveMinimum:{okStr:">",ok:ti.GT,fail:ti.LTE}},nW={message:({keyword:t,schemaCode:e})=>(0,Gh.str)`must be ${Kh[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Gh._)`{comparison: ${Kh[t].okStr}, limit: ${e}}`},rW={keyword:Object.keys(Kh),type:"number",schemaType:"number",$data:!0,error:nW,code(t){let{keyword:e,data:n,schemaCode:r}=t;t.fail$data((0,Gh._)`${n} ${Kh[e].fail} ${r} || isNaN(${n})`)}};Fv.default=rW});var qO=w(Bv=>{"use strict";Object.defineProperty(Bv,"__esModule",{value:!0});var gl=ue(),sW={message:({schemaCode:t})=>(0,gl.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,gl._)`{multipleOf: ${t}}`},iW={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:sW,code(t){let{gen:e,data:n,schemaCode:r,it:s}=t,i=s.opts.multipleOfPrecision,o=e.let("res"),a=i?(0,gl._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${i}`:(0,gl._)`${o} !== parseInt(${o})`;t.fail$data((0,gl._)`(${r} === 0 || (${o} = ${n}/${r}, ${a}))`)}};Bv.default=iW});var FO=w(Uv=>{"use strict";Object.defineProperty(Uv,"__esModule",{value:!0});function jO(t){let e=t.length,n=0,r=0,s;for(;r<e;)n++,s=t.charCodeAt(r++),s>=55296&&s<=56319&&r<e&&(s=t.charCodeAt(r),(s&64512)===56320&&r++);return n}Uv.default=jO;jO.code='require("ajv/dist/runtime/ucs2length").default'});var BO=w(Vv=>{"use strict";Object.defineProperty(Vv,"__esModule",{value:!0});var Bi=ue(),oW=ye(),aW=FO(),cW={message({keyword:t,schemaCode:e}){let n=t==="maxLength"?"more":"fewer";return(0,Bi.str)`must NOT have ${n} than ${e} characters`},params:({schemaCode:t})=>(0,Bi._)`{limit: ${t}}`},lW={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:cW,code(t){let{keyword:e,data:n,schemaCode:r,it:s}=t,i=e==="maxLength"?Bi.operators.GT:Bi.operators.LT,o=s.opts.unicode===!1?(0,Bi._)`${n}.length`:(0,Bi._)`${(0,oW.useFunc)(t.gen,aW.default)}(${n})`;t.fail$data((0,Bi._)`${o} ${i} ${r}`)}};Vv.default=lW});var UO=w(zv=>{"use strict";Object.defineProperty(zv,"__esModule",{value:!0});var uW=Zn(),Yh=ue(),dW={message:({schemaCode:t})=>(0,Yh.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Yh._)`{pattern: ${t}}`},fW={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:dW,code(t){let{data:e,$data:n,schema:r,schemaCode:s,it:i}=t,o=i.opts.unicodeRegExp?"u":"",a=n?(0,Yh._)`(new RegExp(${s}, ${o}))`:(0,uW.usePattern)(t,r);t.fail$data((0,Yh._)`!${a}.test(${e})`)}};zv.default=fW});var VO=w(Wv=>{"use strict";Object.defineProperty(Wv,"__esModule",{value:!0});var yl=ue(),hW={message({keyword:t,schemaCode:e}){let n=t==="maxProperties"?"more":"fewer";return(0,yl.str)`must NOT have ${n} than ${e} properties`},params:({schemaCode:t})=>(0,yl._)`{limit: ${t}}`},pW={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:hW,code(t){let{keyword:e,data:n,schemaCode:r}=t,s=e==="maxProperties"?yl.operators.GT:yl.operators.LT;t.fail$data((0,yl._)`Object.keys(${n}).length ${s} ${r}`)}};Wv.default=pW});var zO=w(Hv=>{"use strict";Object.defineProperty(Hv,"__esModule",{value:!0});var bl=Zn(),vl=ue(),mW=ye(),gW={message:({params:{missingProperty:t}})=>(0,vl.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,vl._)`{missingProperty: ${t}}`},yW={keyword:"required",type:"object",schemaType:"array",$data:!0,error:gW,code(t){let{gen:e,schema:n,schemaCode:r,data:s,$data:i,it:o}=t,{opts:a}=o;if(!i&&n.length===0)return;let c=n.length>=a.loopRequired;if(o.allErrors?l():u(),a.strictRequired){let h=t.parentSchema.properties,{definedProperties:y}=t.it;for(let m of n)if(h?.[m]===void 0&&!y.has(m)){let _=o.schemaEnv.baseId+o.errSchemaPath,E=`required property "${m}" is not defined at "${_}" (strictRequired)`;(0,mW.checkStrictMode)(o,E,o.opts.strictRequired)}}function l(){if(c||i)t.block$data(vl.nil,d);else for(let h of n)(0,bl.checkReportMissingProp)(t,h)}function u(){let h=e.let("missing");if(c||i){let y=e.let("valid",!0);t.block$data(y,()=>f(h,y)),t.ok(y)}else e.if((0,bl.checkMissingProp)(t,n,h)),(0,bl.reportMissingProp)(t,h),e.else()}function d(){e.forOf("prop",r,h=>{t.setParams({missingProperty:h}),e.if((0,bl.noPropertyInData)(e,s,h,a.ownProperties),()=>t.error())})}function f(h,y){t.setParams({missingProperty:h}),e.forOf(h,r,()=>{e.assign(y,(0,bl.propertyInData)(e,s,h,a.ownProperties)),e.if((0,vl.not)(y),()=>{t.error(),e.break()})},vl.nil)}}};Hv.default=yW});var WO=w(Gv=>{"use strict";Object.defineProperty(Gv,"__esModule",{value:!0});var Tl=ue(),bW={message({keyword:t,schemaCode:e}){let n=t==="maxItems"?"more":"fewer";return(0,Tl.str)`must NOT have ${n} than ${e} items`},params:({schemaCode:t})=>(0,Tl._)`{limit: ${t}}`},vW={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:bW,code(t){let{keyword:e,data:n,schemaCode:r}=t,s=e==="maxItems"?Tl.operators.GT:Tl.operators.LT;t.fail$data((0,Tl._)`${n}.length ${s} ${r}`)}};Gv.default=vW});var Xh=w(Kv=>{"use strict";Object.defineProperty(Kv,"__esModule",{value:!0});var HO=vv();HO.code='require("ajv/dist/runtime/equal").default';Kv.default=HO});var GO=w(Xv=>{"use strict";Object.defineProperty(Xv,"__esModule",{value:!0});var Yv=il(),Kt=ue(),TW=ye(),_W=Xh(),SW={message:({params:{i:t,j:e}})=>(0,Kt.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,Kt._)`{i: ${t}, j: ${e}}`},EW={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:SW,code(t){let{gen:e,data:n,$data:r,schema:s,parentSchema:i,schemaCode:o,it:a}=t;if(!r&&!s)return;let c=e.let("valid"),l=i.items?(0,Yv.getSchemaTypes)(i.items):[];t.block$data(c,u,(0,Kt._)`${o} === false`),t.ok(c);function u(){let y=e.let("i",(0,Kt._)`${n}.length`),m=e.let("j");t.setParams({i:y,j:m}),e.assign(c,!0),e.if((0,Kt._)`${y} > 1`,()=>(d()?f:h)(y,m))}function d(){return l.length>0&&!l.some(y=>y==="object"||y==="array")}function f(y,m){let _=e.name("item"),E=(0,Yv.checkDataTypes)(l,_,a.opts.strictNumbers,Yv.DataType.Wrong),T=e.const("indices",(0,Kt._)`{}`);e.for((0,Kt._)`;${y}--;`,()=>{e.let(_,(0,Kt._)`${n}[${y}]`),e.if(E,(0,Kt._)`continue`),l.length>1&&e.if((0,Kt._)`typeof ${_} == "string"`,(0,Kt._)`${_} += "_"`),e.if((0,Kt._)`typeof ${T}[${_}] == "number"`,()=>{e.assign(m,(0,Kt._)`${T}[${_}]`),t.error(),e.assign(c,!1).break()}).code((0,Kt._)`${T}[${_}] = ${y}`)})}function h(y,m){let _=(0,TW.useFunc)(e,_W.default),E=e.name("outer");e.label(E).for((0,Kt._)`;${y}--;`,()=>e.for((0,Kt._)`${m} = ${y}; ${m}--;`,()=>e.if((0,Kt._)`${_}(${n}[${y}], ${n}[${m}])`,()=>{t.error(),e.assign(c,!1).break(E)})))}}};Xv.default=EW});var KO=w(Qv=>{"use strict";Object.defineProperty(Qv,"__esModule",{value:!0});var Jv=ue(),wW=ye(),kW=Xh(),NW={message:"must be equal to constant",params:({schemaCode:t})=>(0,Jv._)`{allowedValue: ${t}}`},PW={keyword:"const",$data:!0,error:NW,code(t){let{gen:e,data:n,$data:r,schemaCode:s,schema:i}=t;r||i&&typeof i=="object"?t.fail$data((0,Jv._)`!${(0,wW.useFunc)(e,kW.default)}(${n}, ${s})`):t.fail((0,Jv._)`${i} !== ${n}`)}};Qv.default=PW});var YO=w(Zv=>{"use strict";Object.defineProperty(Zv,"__esModule",{value:!0});var _l=ue(),RW=ye(),DW=Xh(),CW={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,_l._)`{allowedValues: ${t}}`},AW={keyword:"enum",schemaType:"array",$data:!0,error:CW,code(t){let{gen:e,data:n,$data:r,schema:s,schemaCode:i,it:o}=t;if(!r&&s.length===0)throw new Error("enum must have non-empty array");let a=s.length>=o.opts.loopEnum,c,l=()=>c??(c=(0,RW.useFunc)(e,DW.default)),u;if(a||r)u=e.let("valid"),t.block$data(u,d);else{if(!Array.isArray(s))throw new Error("ajv implementation error");let h=e.const("vSchema",i);u=(0,_l.or)(...s.map((y,m)=>f(h,m)))}t.pass(u);function d(){e.assign(u,!1),e.forOf("v",i,h=>e.if((0,_l._)`${l()}(${n}, ${h})`,()=>e.assign(u,!0).break()))}function f(h,y){let m=s[y];return typeof m=="object"&&m!==null?(0,_l._)`${l()}(${n}, ${h}[${y}])`:(0,_l._)`${n} === ${m}`}}};Zv.default=AW});var XO=w(eT=>{"use strict";Object.defineProperty(eT,"__esModule",{value:!0});var OW=$O(),IW=qO(),xW=BO(),MW=UO(),LW=VO(),$W=zO(),qW=WO(),jW=GO(),FW=KO(),BW=YO(),UW=[OW.default,IW.default,xW.default,MW.default,LW.default,$W.default,qW.default,jW.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},FW.default,BW.default];eT.default=UW});var nT=w(Sl=>{"use strict";Object.defineProperty(Sl,"__esModule",{value:!0});Sl.validateAdditionalItems=void 0;var Ui=ue(),tT=ye(),VW={message:({params:{len:t}})=>(0,Ui.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Ui._)`{limit: ${t}}`},zW={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:VW,code(t){let{parentSchema:e,it:n}=t,{items:r}=e;if(!Array.isArray(r)){(0,tT.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}JO(t,r)}};function JO(t,e){let{gen:n,schema:r,data:s,keyword:i,it:o}=t;o.items=!0;let a=n.const("len",(0,Ui._)`${s}.length`);if(r===!1)t.setParams({len:e.length}),t.pass((0,Ui._)`${a} <= ${e.length}`);else if(typeof r=="object"&&!(0,tT.alwaysValidSchema)(o,r)){let l=n.var("valid",(0,Ui._)`${a} <= ${e.length}`);n.if((0,Ui.not)(l),()=>c(l)),t.ok(l)}function c(l){n.forRange("i",e.length,a,u=>{t.subschema({keyword:i,dataProp:u,dataPropType:tT.Type.Num},l),o.allErrors||n.if((0,Ui.not)(l),()=>n.break())})}}Sl.validateAdditionalItems=JO;Sl.default=zW});var rT=w(El=>{"use strict";Object.defineProperty(El,"__esModule",{value:!0});El.validateTuple=void 0;var QO=ue(),Jh=ye(),WW=Zn(),HW={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:n}=t;if(Array.isArray(e))return ZO(t,"additionalItems",e);n.items=!0,!(0,Jh.alwaysValidSchema)(n,e)&&t.ok((0,WW.validateArray)(t))}};function ZO(t,e,n=t.schema){let{gen:r,parentSchema:s,data:i,keyword:o,it:a}=t;u(s),a.opts.unevaluated&&n.length&&a.items!==!0&&(a.items=Jh.mergeEvaluated.items(r,n.length,a.items));let c=r.name("valid"),l=r.const("len",(0,QO._)`${i}.length`);n.forEach((d,f)=>{(0,Jh.alwaysValidSchema)(a,d)||(r.if((0,QO._)`${l} > ${f}`,()=>t.subschema({keyword:o,schemaProp:f,dataProp:f},c)),t.ok(c))});function u(d){let{opts:f,errSchemaPath:h}=a,y=n.length,m=y===d.minItems&&(y===d.maxItems||d[e]===!1);if(f.strictTuples&&!m){let _=`"${o}" is ${y}-tuple, but minItems or maxItems/${e} are not specified or different at path "${h}"`;(0,Jh.checkStrictMode)(a,_,f.strictTuples)}}}El.validateTuple=ZO;El.default=HW});var eI=w(sT=>{"use strict";Object.defineProperty(sT,"__esModule",{value:!0});var GW=rT(),KW={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,GW.validateTuple)(t,"items")};sT.default=KW});var nI=w(iT=>{"use strict";Object.defineProperty(iT,"__esModule",{value:!0});var tI=ue(),YW=ye(),XW=Zn(),JW=nT(),QW={message:({params:{len:t}})=>(0,tI.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,tI._)`{limit: ${t}}`},ZW={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:QW,code(t){let{schema:e,parentSchema:n,it:r}=t,{prefixItems:s}=n;r.items=!0,!(0,YW.alwaysValidSchema)(r,e)&&(s?(0,JW.validateAdditionalItems)(t,s):t.ok((0,XW.validateArray)(t)))}};iT.default=ZW});var rI=w(oT=>{"use strict";Object.defineProperty(oT,"__esModule",{value:!0});var tr=ue(),Qh=ye(),eH={message:({params:{min:t,max:e}})=>e===void 0?(0,tr.str)`must contain at least ${t} valid item(s)`:(0,tr.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,tr._)`{minContains: ${t}}`:(0,tr._)`{minContains: ${t}, maxContains: ${e}}`},tH={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:eH,code(t){let{gen:e,schema:n,parentSchema:r,data:s,it:i}=t,o,a,{minContains:c,maxContains:l}=r;i.opts.next?(o=c===void 0?1:c,a=l):o=1;let u=e.const("len",(0,tr._)`${s}.length`);if(t.setParams({min:o,max:a}),a===void 0&&o===0){(0,Qh.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,Qh.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Qh.alwaysValidSchema)(i,n)){let m=(0,tr._)`${u} >= ${o}`;a!==void 0&&(m=(0,tr._)`${m} && ${u} <= ${a}`),t.pass(m);return}i.items=!0;let d=e.name("valid");a===void 0&&o===1?h(d,()=>e.if(d,()=>e.break())):o===0?(e.let(d,!0),a!==void 0&&e.if((0,tr._)`${s}.length > 0`,f)):(e.let(d,!1),f()),t.result(d,()=>t.reset());function f(){let m=e.name("_valid"),_=e.let("count",0);h(m,()=>e.if(m,()=>y(_)))}function h(m,_){e.forRange("i",0,u,E=>{t.subschema({keyword:"contains",dataProp:E,dataPropType:Qh.Type.Num,compositeRule:!0},m),_()})}function y(m){e.code((0,tr._)`${m}++`),a===void 0?e.if((0,tr._)`${m} >= ${o}`,()=>e.assign(d,!0).break()):(e.if((0,tr._)`${m} > ${a}`,()=>e.assign(d,!1).break()),o===1?e.assign(d,!0):e.if((0,tr._)`${m} >= ${o}`,()=>e.assign(d,!0)))}}};oT.default=tH});var Zh=w(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.validateSchemaDeps=Hr.validatePropertyDeps=Hr.error=void 0;var aT=ue(),nH=ye(),wl=Zn();Hr.error={message:({params:{property:t,depsCount:e,deps:n}})=>{let r=e===1?"property":"properties";return(0,aT.str)`must have ${r} ${n} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:n,missingProperty:r}})=>(0,aT._)`{property: ${t},
180
180
  missingProperty: ${r},
181
181
  depsCount: ${e},
182
- deps: ${t}}`};var NW={keyword:"dependencies",type:"object",schemaType:"object",error:Br.error,code(n){let[e,t]=PW(n);PA(n,e),RA(n,t)}};function PW({schema:n}){let e={},t={};for(let r in n){if(r==="__proto__")continue;let s=Array.isArray(n[r])?e:t;s[r]=n[r]}return[e,t]}function PA(n,e=n.schema){let{gen:t,data:r,it:s}=n;if(Object.keys(e).length===0)return;let i=t.let("missing");for(let o in e){let a=e[o];if(a.length===0)continue;let c=(0,ml.propertyInData)(t,r,o,s.opts.ownProperties);n.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),s.allErrors?t.if(c,()=>{for(let l of a)(0,ml.checkReportMissingProp)(n,l)}):(t.if((0,Mv._)`${c} && (${(0,ml.checkMissingProp)(n,a,i)})`),(0,ml.reportMissingProp)(n,i),t.else())}}Br.validatePropertyDeps=PA;function RA(n,e=n.schema){let{gen:t,data:r,keyword:s,it:i}=n,o=t.name("valid");for(let a in e)(0,kW.alwaysValidSchema)(i,e[a])||(t.if((0,ml.propertyInData)(t,r,a,i.opts.ownProperties),()=>{let c=n.subschema({keyword:s,schemaProp:a},o);n.mergeValidEvaluated(c,o)},()=>t.var(o,!0)),n.ok(o))}Br.validateSchemaDeps=RA;Br.default=NW});var CA=E($v=>{"use strict";Object.defineProperty($v,"__esModule",{value:!0});var DA=ce(),RW=ge(),DW={message:"property name must be valid",params:({params:n})=>(0,DA._)`{propertyName: ${n.propertyName}}`},CW={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:DW,code(n){let{gen:e,schema:t,data:r,it:s}=n;if((0,RW.alwaysValidSchema)(s,t))return;let i=e.name("valid");e.forIn("key",r,o=>{n.setParams({propertyName:o}),n.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},i),e.if((0,DA.not)(i),()=>{n.error(!0),s.allErrors||e.break()})}),n.ok(i)}};$v.default=CW});var qv=E(Lv=>{"use strict";Object.defineProperty(Lv,"__esModule",{value:!0});var Bh=Xn(),_r=ce(),AW=Jn(),Uh=ge(),OW={message:"must NOT have additional properties",params:({params:n})=>(0,_r._)`{additionalProperty: ${n.additionalProperty}}`},IW={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:OW,code(n){let{gen:e,schema:t,parentSchema:r,data:s,errsCount:i,it:o}=n;if(!i)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=o;if(o.props=!0,c.removeAdditional!=="all"&&(0,Uh.alwaysValidSchema)(o,t))return;let l=(0,Bh.allSchemaProperties)(r.properties),u=(0,Bh.allSchemaProperties)(r.patternProperties);d(),n.ok((0,_r._)`${i} === ${AW.default.errors}`);function d(){e.forIn("key",s,S=>{!l.length&&!u.length?y(S):e.if(f(S),()=>y(S))})}function f(S){let w;if(l.length>8){let T=(0,Uh.schemaRefOrVal)(o,r.properties,"properties");w=(0,Bh.isOwnProperty)(e,T,S)}else l.length?w=(0,_r.or)(...l.map(T=>(0,_r._)`${S} === ${T}`)):w=_r.nil;return u.length&&(w=(0,_r.or)(w,...u.map(T=>(0,_r._)`${(0,Bh.usePattern)(n,T)}.test(${S})`))),(0,_r.not)(w)}function p(S){e.code((0,_r._)`delete ${s}[${S}]`)}function y(S){if(c.removeAdditional==="all"||c.removeAdditional&&t===!1){p(S);return}if(t===!1){n.setParams({additionalProperty:S}),n.error(),a||e.break();return}if(typeof t=="object"&&!(0,Uh.alwaysValidSchema)(o,t)){let w=e.name("valid");c.removeAdditional==="failing"?(m(S,w,!1),e.if((0,_r.not)(w),()=>{n.reset(),p(S)})):(m(S,w),a||e.if((0,_r.not)(w),()=>e.break()))}}function m(S,w,T){let v={keyword:"additionalProperties",dataProp:S,dataPropType:Uh.Type.Str};T===!1&&Object.assign(v,{compositeRule:!0,createErrors:!1,allErrors:!1}),n.subschema(v,w)}}};Lv.default=IW});var IA=E(Fv=>{"use strict";Object.defineProperty(Fv,"__esModule",{value:!0});var xW=el(),AA=Xn(),jv=ge(),OA=qv(),MW={keyword:"properties",type:"object",schemaType:"object",code(n){let{gen:e,schema:t,parentSchema:r,data:s,it:i}=n;i.opts.removeAdditional==="all"&&r.additionalProperties===void 0&&OA.default.code(new xW.KeywordCxt(i,OA.default,"additionalProperties"));let o=(0,AA.allSchemaProperties)(t);for(let d of o)i.definedProperties.add(d);i.opts.unevaluated&&o.length&&i.props!==!0&&(i.props=jv.mergeEvaluated.props(e,(0,jv.toHash)(o),i.props));let a=o.filter(d=>!(0,jv.alwaysValidSchema)(i,t[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)l(d)?u(d):(e.if((0,AA.propertyInData)(e,s,d,i.opts.ownProperties)),u(d),i.allErrors||e.else().var(c,!0),e.endIf()),n.it.definedProperties.add(d),n.ok(c);function l(d){return i.opts.useDefaults&&!i.compositeRule&&t[d].default!==void 0}function u(d){n.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};Fv.default=MW});var LA=E(Bv=>{"use strict";Object.defineProperty(Bv,"__esModule",{value:!0});var xA=Xn(),Vh=ce(),MA=ge(),$A=ge(),$W={keyword:"patternProperties",type:"object",schemaType:"object",code(n){let{gen:e,schema:t,data:r,parentSchema:s,it:i}=n,{opts:o}=i,a=(0,xA.allSchemaProperties)(t),c=a.filter(m=>(0,MA.alwaysValidSchema)(i,t[m]));if(a.length===0||c.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let l=o.strictSchema&&!o.allowMatchingProperties&&s.properties,u=e.name("valid");i.props!==!0&&!(i.props instanceof Vh.Name)&&(i.props=(0,$A.evaluatedPropsToName)(e,i.props));let{props:d}=i;f();function f(){for(let m of a)l&&p(m),i.allErrors?y(m):(e.var(u,!0),y(m),e.if(u))}function p(m){for(let S in l)new RegExp(m).test(S)&&(0,MA.checkStrictMode)(i,`property ${S} matches pattern ${m} (use allowMatchingProperties)`)}function y(m){e.forIn("key",r,S=>{e.if((0,Vh._)`${(0,xA.usePattern)(n,m)}.test(${S})`,()=>{let w=c.includes(m);w||n.subschema({keyword:"patternProperties",schemaProp:m,dataProp:S,dataPropType:$A.Type.Str},u),i.opts.unevaluated&&d!==!0?e.assign((0,Vh._)`${d}[${S}]`,!0):!w&&!i.allErrors&&e.if((0,Vh.not)(u),()=>e.break())})})}}};Bv.default=$W});var qA=E(Uv=>{"use strict";Object.defineProperty(Uv,"__esModule",{value:!0});var LW=ge(),qW={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){let{gen:e,schema:t,it:r}=n;if((0,LW.alwaysValidSchema)(r,t)){n.fail();return}let s=e.name("valid");n.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),n.failResult(s,()=>n.reset(),()=>n.error())},error:{message:"must NOT be valid"}};Uv.default=qW});var jA=E(Vv=>{"use strict";Object.defineProperty(Vv,"__esModule",{value:!0});var jW=Xn(),FW={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:jW.validateUnion,error:{message:"must match a schema in anyOf"}};Vv.default=FW});var FA=E(Wv=>{"use strict";Object.defineProperty(Wv,"__esModule",{value:!0});var Wh=ce(),BW=ge(),UW={message:"must match exactly one schema in oneOf",params:({params:n})=>(0,Wh._)`{passingSchemas: ${n.passing}}`},VW={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:UW,code(n){let{gen:e,schema:t,parentSchema:r,it:s}=n;if(!Array.isArray(t))throw new Error("ajv implementation error");if(s.opts.discriminator&&r.discriminator)return;let i=t,o=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");n.setParams({passing:a}),e.block(l),n.result(o,()=>n.reset(),()=>n.error(!0));function l(){i.forEach((u,d)=>{let f;(0,BW.alwaysValidSchema)(s,u)?e.var(c,!0):f=n.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,Wh._)`${c} && ${o}`).assign(o,!1).assign(a,(0,Wh._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(o,!0),e.assign(a,d),f&&n.mergeEvaluated(f,Wh.Name)})})}}};Wv.default=VW});var BA=E(zv=>{"use strict";Object.defineProperty(zv,"__esModule",{value:!0});var WW=ge(),zW={keyword:"allOf",schemaType:"array",code(n){let{gen:e,schema:t,it:r}=n;if(!Array.isArray(t))throw new Error("ajv implementation error");let s=e.name("valid");t.forEach((i,o)=>{if((0,WW.alwaysValidSchema)(r,i))return;let a=n.subschema({keyword:"allOf",schemaProp:o},s);n.ok(s),n.mergeEvaluated(a)})}};zv.default=zW});var WA=E(Hv=>{"use strict";Object.defineProperty(Hv,"__esModule",{value:!0});var zh=ce(),VA=ge(),HW={message:({params:n})=>(0,zh.str)`must match "${n.ifClause}" schema`,params:({params:n})=>(0,zh._)`{failingKeyword: ${n.ifClause}}`},KW={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:HW,code(n){let{gen:e,parentSchema:t,it:r}=n;t.then===void 0&&t.else===void 0&&(0,VA.checkStrictMode)(r,'"if" without "then" and "else" is ignored');let s=UA(r,"then"),i=UA(r,"else");if(!s&&!i)return;let o=e.let("valid",!0),a=e.name("_valid");if(c(),n.reset(),s&&i){let u=e.let("ifClause");n.setParams({ifClause:u}),e.if(a,l("then",u),l("else",u))}else s?e.if(a,l("then")):e.if((0,zh.not)(a),l("else"));n.pass(o,()=>n.error(!0));function c(){let u=n.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);n.mergeEvaluated(u)}function l(u,d){return()=>{let f=n.subschema({keyword:u},a);e.assign(o,a),n.mergeValidEvaluated(f,o),d?e.assign(d,(0,zh._)`${u}`):n.setParams({ifClause:u})}}}};function UA(n,e){let t=n.schema[e];return t!==void 0&&!(0,VA.alwaysValidSchema)(n,t)}Hv.default=KW});var zA=E(Kv=>{"use strict";Object.defineProperty(Kv,"__esModule",{value:!0});var GW=ge(),YW={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:e,it:t}){e.if===void 0&&(0,GW.checkStrictMode)(t,`"${n}" without "if" is ignored`)}};Kv.default=YW});var HA=E(Gv=>{"use strict";Object.defineProperty(Gv,"__esModule",{value:!0});var JW=Cv(),XW=EA(),QW=Av(),ZW=kA(),ez=NA(),tz=Fh(),nz=CA(),rz=qv(),sz=IA(),iz=LA(),oz=qA(),az=jA(),cz=FA(),lz=BA(),uz=WA(),dz=zA();function fz(n=!1){let e=[oz.default,az.default,cz.default,lz.default,uz.default,dz.default,nz.default,rz.default,tz.default,sz.default,iz.default];return n?e.push(XW.default,ZW.default):e.push(JW.default,QW.default),e.push(ez.default),e}Gv.default=fz});var KA=E(Yv=>{"use strict";Object.defineProperty(Yv,"__esModule",{value:!0});var bt=ce(),hz={message:({schemaCode:n})=>(0,bt.str)`must match format "${n}"`,params:({schemaCode:n})=>(0,bt._)`{format: ${n}}`},pz={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:hz,code(n,e){let{gen:t,data:r,$data:s,schema:i,schemaCode:o,it:a}=n,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=a;if(!c.validateFormats)return;s?f():p();function f(){let y=t.scopeValue("formats",{ref:d.formats,code:c.code.formats}),m=t.const("fDef",(0,bt._)`${y}[${o}]`),S=t.let("fType"),w=t.let("format");t.if((0,bt._)`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>t.assign(S,(0,bt._)`${m}.type || "string"`).assign(w,(0,bt._)`${m}.validate`),()=>t.assign(S,(0,bt._)`"string"`).assign(w,m)),n.fail$data((0,bt.or)(T(),v()));function T(){return c.strictSchema===!1?bt.nil:(0,bt._)`${o} && !${w}`}function v(){let R=u.$async?(0,bt._)`(${m}.async ? await ${w}(${r}) : ${w}(${r}))`:(0,bt._)`${w}(${r})`,A=(0,bt._)`(typeof ${w} == "function" ? ${R} : ${w}.test(${r}))`;return(0,bt._)`${w} && ${w} !== true && ${S} === ${e} && !${A}`}}function p(){let y=d.formats[i];if(!y){T();return}if(y===!0)return;let[m,S,w]=v(y);m===e&&n.pass(R());function T(){if(c.strictSchema===!1){d.logger.warn(A());return}throw new Error(A());function A(){return`unknown format "${i}" ignored in schema at path "${l}"`}}function v(A){let M=A instanceof RegExp?(0,bt.regexpCode)(A):c.code.formats?(0,bt._)`${c.code.formats}${(0,bt.getProperty)(i)}`:void 0,z=t.scopeValue("formats",{key:i,ref:A,code:M});return typeof A=="object"&&!(A instanceof RegExp)?[A.type||"string",A.validate,(0,bt._)`${z}.validate`]:["string",A,z]}function R(){if(typeof y=="object"&&!(y instanceof RegExp)&&y.async){if(!u.$async)throw new Error("async format in sync schema");return(0,bt._)`await ${w}(${r})`}return typeof S=="function"?(0,bt._)`${w}(${r})`:(0,bt._)`${w}.test(${r})`}}}};Yv.default=pz});var GA=E(Jv=>{"use strict";Object.defineProperty(Jv,"__esModule",{value:!0});var mz=KA(),gz=[mz.default];Jv.default=gz});var YA=E(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});ca.contentVocabulary=ca.metadataVocabulary=void 0;ca.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];ca.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var XA=E(Xv=>{"use strict";Object.defineProperty(Xv,"__esModule",{value:!0});var yz=iA(),bz=vA(),vz=HA(),Tz=GA(),JA=YA(),Sz=[yz.default,bz.default,(0,vz.default)(),Tz.default,JA.metadataVocabulary,JA.contentVocabulary];Xv.default=Sz});var Zv=E(gl=>{"use strict";Object.defineProperty(gl,"__esModule",{value:!0});gl.dynamicAnchor=void 0;var Qv=ce(),_z=Jn(),QA=nl(),Ez=Ih(),wz={keyword:"$dynamicAnchor",schemaType:"string",code:n=>ZA(n,n.schema)};function ZA(n,e){let{gen:t,it:r}=n;r.schemaEnv.root.dynamicAnchors[e]=!0;let s=(0,Qv._)`${_z.default.dynamicAnchors}${(0,Qv.getProperty)(e)}`,i=r.errSchemaPath==="#"?r.validateName:kz(n);t.if((0,Qv._)`!${s}`,()=>t.assign(s,i))}gl.dynamicAnchor=ZA;function kz(n){let{schemaEnv:e,schema:t,self:r}=n.it,{root:s,baseId:i,localRefs:o,meta:a}=e.root,{schemaId:c}=r.opts,l=new QA.SchemaEnv({schema:t,schemaId:c,root:s,baseId:i,localRefs:o,meta:a});return QA.compileSchema.call(r,l),(0,Ez.getValidate)(n,l)}gl.default=wz});var eT=E(yl=>{"use strict";Object.defineProperty(yl,"__esModule",{value:!0});yl.dynamicRef=void 0;var eO=ce(),Nz=Jn(),tO=Ih(),Pz={keyword:"$dynamicRef",schemaType:"string",code:n=>nO(n,n.schema)};function nO(n,e){let{gen:t,keyword:r,it:s}=n;if(e[0]!=="#")throw new Error(`"${r}" only supports hash fragment reference`);let i=e.slice(1);if(s.allErrors)o();else{let c=t.let("valid",!1);o(c),n.ok(c)}function o(c){if(s.schemaEnv.root.dynamicAnchors[i]){let l=t.let("_v",(0,eO._)`${Nz.default.dynamicAnchors}${(0,eO.getProperty)(i)}`);t.if(l,a(l,c),a(s.validateName,c))}else a(s.validateName,c)()}function a(c,l){return l?()=>t.block(()=>{(0,tO.callRef)(n,c),t.let(l,!0)}):()=>(0,tO.callRef)(n,c)}}yl.dynamicRef=nO;yl.default=Pz});var rO=E(tT=>{"use strict";Object.defineProperty(tT,"__esModule",{value:!0});var Rz=Zv(),Dz=ge(),Cz={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){n.schema?(0,Rz.dynamicAnchor)(n,""):(0,Dz.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};tT.default=Cz});var sO=E(nT=>{"use strict";Object.defineProperty(nT,"__esModule",{value:!0});var Az=eT(),Oz={keyword:"$recursiveRef",schemaType:"string",code:n=>(0,Az.dynamicRef)(n,n.schema)};nT.default=Oz});var iO=E(rT=>{"use strict";Object.defineProperty(rT,"__esModule",{value:!0});var Iz=Zv(),xz=eT(),Mz=rO(),$z=sO(),Lz=[Iz.default,xz.default,Mz.default,$z.default];rT.default=Lz});var aO=E(sT=>{"use strict";Object.defineProperty(sT,"__esModule",{value:!0});var oO=Fh(),qz={keyword:"dependentRequired",type:"object",schemaType:"object",error:oO.error,code:n=>(0,oO.validatePropertyDeps)(n)};sT.default=qz});var cO=E(iT=>{"use strict";Object.defineProperty(iT,"__esModule",{value:!0});var jz=Fh(),Fz={keyword:"dependentSchemas",type:"object",schemaType:"object",code:n=>(0,jz.validateSchemaDeps)(n)};iT.default=Fz});var lO=E(oT=>{"use strict";Object.defineProperty(oT,"__esModule",{value:!0});var Bz=ge(),Uz={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:n,parentSchema:e,it:t}){e.contains===void 0&&(0,Bz.checkStrictMode)(t,`"${n}" without "contains" is ignored`)}};oT.default=Uz});var uO=E(aT=>{"use strict";Object.defineProperty(aT,"__esModule",{value:!0});var Vz=aO(),Wz=cO(),zz=lO(),Hz=[Vz.default,Wz.default,zz.default];aT.default=Hz});var fO=E(cT=>{"use strict";Object.defineProperty(cT,"__esModule",{value:!0});var Js=ce(),dO=ge(),Kz=Jn(),Gz={message:"must NOT have unevaluated properties",params:({params:n})=>(0,Js._)`{unevaluatedProperty: ${n.unevaluatedProperty}}`},Yz={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:Gz,code(n){let{gen:e,schema:t,data:r,errsCount:s,it:i}=n;if(!s)throw new Error("ajv implementation error");let{allErrors:o,props:a}=i;a instanceof Js.Name?e.if((0,Js._)`${a} !== true`,()=>e.forIn("key",r,d=>e.if(l(a,d),()=>c(d)))):a!==!0&&e.forIn("key",r,d=>a===void 0?c(d):e.if(u(a,d),()=>c(d))),i.props=!0,n.ok((0,Js._)`${s} === ${Kz.default.errors}`);function c(d){if(t===!1){n.setParams({unevaluatedProperty:d}),n.error(),o||e.break();return}if(!(0,dO.alwaysValidSchema)(i,t)){let f=e.name("valid");n.subschema({keyword:"unevaluatedProperties",dataProp:d,dataPropType:dO.Type.Str},f),o||e.if((0,Js.not)(f),()=>e.break())}}function l(d,f){return(0,Js._)`!${d} || !${d}[${f}]`}function u(d,f){let p=[];for(let y in d)d[y]===!0&&p.push((0,Js._)`${f} !== ${y}`);return(0,Js.and)(...p)}}};cT.default=Yz});var pO=E(lT=>{"use strict";Object.defineProperty(lT,"__esModule",{value:!0});var $i=ce(),hO=ge(),Jz={message:({params:{len:n}})=>(0,$i.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0,$i._)`{limit: ${n}}`},Xz={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:Jz,code(n){let{gen:e,schema:t,data:r,it:s}=n,i=s.items||0;if(i===!0)return;let o=e.const("len",(0,$i._)`${r}.length`);if(t===!1)n.setParams({len:i}),n.fail((0,$i._)`${o} > ${i}`);else if(typeof t=="object"&&!(0,hO.alwaysValidSchema)(s,t)){let c=e.var("valid",(0,$i._)`${o} <= ${i}`);e.if((0,$i.not)(c),()=>a(c,i)),n.ok(c)}s.items=!0;function a(c,l){e.forRange("i",l,o,u=>{n.subschema({keyword:"unevaluatedItems",dataProp:u,dataPropType:hO.Type.Num},c),s.allErrors||e.if((0,$i.not)(c),()=>e.break())})}}};lT.default=Xz});var mO=E(uT=>{"use strict";Object.defineProperty(uT,"__esModule",{value:!0});var Qz=fO(),Zz=pO(),eH=[Qz.default,Zz.default];uT.default=eH});var yO=E(Hh=>{"use strict";Object.defineProperty(Hh,"__esModule",{value:!0});Hh.DiscrError=void 0;var gO;(function(n){n.Tag="tag",n.Mapping="mapping"})(gO||(Hh.DiscrError=gO={}))});var vO=E(fT=>{"use strict";Object.defineProperty(fT,"__esModule",{value:!0});var la=ce(),dT=yO(),bO=nl(),tH=tl(),nH=ge(),rH={message:({params:{discrError:n,tagName:e}})=>n===dT.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:n,tag:e,tagName:t}})=>(0,la._)`{error: ${n}, tag: ${t}, tagValue: ${e}}`},sH={keyword:"discriminator",type:"object",schemaType:"object",error:rH,code(n){let{gen:e,data:t,schema:r,parentSchema:s,it:i}=n,{oneOf:o}=s;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=r.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(r.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),l=e.const("tag",(0,la._)`${t}${(0,la.getProperty)(a)}`);e.if((0,la._)`typeof ${l} == "string"`,()=>u(),()=>n.error(!1,{discrError:dT.DiscrError.Tag,tag:l,tagName:a})),n.ok(c);function u(){let p=f();e.if(!1);for(let y in p)e.elseIf((0,la._)`${l} === ${y}`),e.assign(c,d(p[y]));e.else(),n.error(!1,{discrError:dT.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function d(p){let y=e.name("valid"),m=n.subschema({keyword:"oneOf",schemaProp:p},y);return n.mergeEvaluated(m,la.Name),y}function f(){var p;let y={},m=w(s),S=!0;for(let R=0;R<o.length;R++){let A=o[R];if(A?.$ref&&!(0,nH.schemaHasRulesButRef)(A,i.self.RULES)){let z=A.$ref;if(A=bO.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,z),A instanceof bO.SchemaEnv&&(A=A.schema),A===void 0)throw new tH.default(i.opts.uriResolver,i.baseId,z)}let M=(p=A?.properties)===null||p===void 0?void 0:p[a];if(typeof M!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);S=S&&(m||w(A)),T(M,R)}if(!S)throw new Error(`discriminator: "${a}" must be required`);return y;function w({required:R}){return Array.isArray(R)&&R.includes(a)}function T(R,A){if(R.const)v(R.const,A);else if(R.enum)for(let M of R.enum)v(M,A);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function v(R,A){if(typeof R!="string"||R in y)throw new Error(`discriminator: "${a}" values must be unique strings`);y[R]=A}}}};fT.default=sH});var TO=E((Jne,iH)=>{iH.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}}});var SO=E((Xne,oH)=>{oH.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}}});var _O=E((Qne,aH)=>{aH.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}}});var EO=E((Zne,cH)=>{cH.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}}});var wO=E((ere,lH)=>{lH.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}}});var kO=E((tre,uH)=>{uH.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var NO=E((nre,dH)=>{dH.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var PO=E(hT=>{"use strict";Object.defineProperty(hT,"__esModule",{value:!0});var fH=TO(),hH=SO(),pH=_O(),mH=EO(),gH=wO(),yH=kO(),bH=NO(),vH=["/properties"];function TH(n){return[fH,hH,pH,mH,e(this,gH),yH,e(this,bH)].forEach(t=>this.addMetaSchema(t,void 0,!1)),this;function e(t,r){return n?t.$dataMetaSchema(r,vH):r}}hT.default=TH});var RO=E((st,mT)=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.MissingRefError=st.ValidationError=st.CodeGen=st.Name=st.nil=st.stringify=st.str=st._=st.KeywordCxt=st.Ajv2019=void 0;var SH=eA(),_H=XA(),EH=iO(),wH=uO(),kH=mO(),NH=vO(),PH=PO(),pT="https://json-schema.org/draft/2019-09/schema",ua=class extends SH.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(EH.default),_H.default.forEach(e=>this.addVocabulary(e)),this.addVocabulary(wH.default),this.addVocabulary(kH.default),this.opts.discriminator&&this.addKeyword(NH.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(PH.default.call(this,e),this.refs["http://json-schema.org/schema"]=pT)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(pT)?pT:void 0)}};st.Ajv2019=ua;mT.exports=st=ua;mT.exports.Ajv2019=ua;Object.defineProperty(st,"__esModule",{value:!0});st.default=ua;var RH=el();Object.defineProperty(st,"KeywordCxt",{enumerable:!0,get:function(){return RH.KeywordCxt}});var da=ce();Object.defineProperty(st,"_",{enumerable:!0,get:function(){return da._}});Object.defineProperty(st,"str",{enumerable:!0,get:function(){return da.str}});Object.defineProperty(st,"stringify",{enumerable:!0,get:function(){return da.stringify}});Object.defineProperty(st,"nil",{enumerable:!0,get:function(){return da.nil}});Object.defineProperty(st,"Name",{enumerable:!0,get:function(){return da.Name}});Object.defineProperty(st,"CodeGen",{enumerable:!0,get:function(){return da.CodeGen}});var DH=kh();Object.defineProperty(st,"ValidationError",{enumerable:!0,get:function(){return DH.default}});var CH=tl();Object.defineProperty(st,"MissingRefError",{enumerable:!0,get:function(){return CH.default}})});var Xe=K(ak());var td=class n{constructor(e,t,r,s){this._uri=e,this._languageId=t,this._version=r,this._content=s,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(t,r)}return this._content}update(e,t){for(let r of e)if(n.isIncremental(r)){let s=lk(r.range),i=this.offsetAt(s.start),o=this.offsetAt(s.end);this._content=this._content.substring(0,i)+r.text+this._content.substring(o,this._content.length);let a=Math.max(s.start.line,0),c=Math.max(s.end.line,0),l=this._lineOffsets,u=ck(r.text,!1,i);if(c-a===u.length)for(let f=0,p=u.length;f<p;f++)l[f+a+1]=u[f];else u.length<1e4?l.splice(a+1,c-a,...u):this._lineOffsets=l=l.slice(0,a+1).concat(u,l.slice(c+1));let d=r.text.length-(o-i);if(d!==0)for(let f=a+1+u.length,p=l.length;f<p;f++)l[f]=l[f]+d}else if(n.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=t}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=ck(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),r=0,s=t.length;if(s===0)return{line:0,character:e};for(;r<s;){let o=Math.floor((r+s)/2);t[o]>e?s=o:r=o+1}let i=r-1;return{line:i,character:e-t[i]}}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let r=t[e.line],s=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,s),r)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let t=e;return t!=null&&typeof t.text=="string"&&t.range!==void 0&&(t.rangeLength===void 0||typeof t.rangeLength=="number")}static isFull(e){let t=e;return t!=null&&typeof t.text=="string"&&t.range===void 0&&t.rangeLength===void 0}},nd;(function(n){function e(s,i,o,a){return new td(s,i,o,a)}n.create=e;function t(s,i,o){if(s instanceof td)return s.update(i,o),s;throw new Error("TextDocument.update: document must be created by TextDocument.create")}n.update=t;function r(s,i){let o=s.getText(),a=tg(i.map(AM),(u,d)=>{let f=u.range.start.line-d.range.start.line;return f===0?u.range.start.character-d.range.start.character:f}),c=0,l=[];for(let u of a){let d=s.offsetAt(u.range.start);if(d<c)throw new Error("Overlapping edit");d>c&&l.push(o.substring(c,d)),u.newText.length&&l.push(u.newText),c=s.offsetAt(u.range.end)}return l.push(o.substr(c)),l.join("")}n.applyEdits=r})(nd||(nd={}));function tg(n,e){if(n.length<=1)return n;let t=n.length/2|0,r=n.slice(0,t),s=n.slice(t);tg(r,e),tg(s,e);let i=0,o=0,a=0;for(;i<r.length&&o<s.length;)e(r[i],s[o])<=0?n[a++]=r[i++]:n[a++]=s[o++];for(;i<r.length;)n[a++]=r[i++];for(;o<s.length;)n[a++]=s[o++];return n}function ck(n,e,t=0){let r=e?[t]:[];for(let s=0;s<n.length;s++){let i=n.charCodeAt(s);(i===13||i===10)&&(i===13&&s+1<n.length&&n.charCodeAt(s+1)===10&&s++,r.push(t+s+1))}return r}function lk(n){let e=n.start,t=n.end;return e.line>t.line||e.line===t.line&&e.character>t.character?{start:t,end:e}:n}function AM(n){let e=lk(n.range);return e!==n.range?{newText:n.newText,range:e}:n}var rd=["namespace","class","enum","interface","struct","typeParameter","type","parameter","variable","property","enumMember","decorator","event","function","method","macro","label","comment","string","keyword","number","regexp","operator"],sd=["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"];var ad=K(X());var ng=K(require("url")),uk=require("crypto"),dk=require("path"),li=(n,e,t=!0,r=!0)=>({start:{line:n?.pos.line??0,character:t?n?.pos.col??0:(n?.pos.col??0)+(n?.pos.len??0)},end:{line:e?.pos.line??0,character:r?(e?.pos.col??0)+(e?.pos.len??0):e?.pos.col??0}});var Z=n=>li(n.tokenIndexes.start,n.tokenIndexes.end),fk=" ",hk=n=>{fk=n},mo=()=>fk,ui=n=>rd.findIndex(e=>e===n),di=n=>sd.findIndex(e=>e===n),rg=(n,e,t)=>!le(n.uri,e)||t.line<n.pos.line?!1:t.line>n.pos.line?!0:t.character>n.pos.colEnd,OM=(n,e,t)=>le(n.uri,e)?t.line<n.pos.line?!0:t.line>n.pos.line?!1:t.character<n.pos.col:!1,On=(n,e,t)=>!!(le(n.uri,e)&&n.tokenIndexes?.start&&n.tokenIndexes?.end&&(n.tokenIndexes.start.pos.line<t.line||n.tokenIndexes.start.pos.line===t.line&&n.tokenIndexes.start.pos.col<=t.character)&&(n.tokenIndexes.end.pos.line>t.line||n.tokenIndexes.end.pos.line===t.line&&n.tokenIndexes.end.pos.colEnd>=t.character)),pk=(n,e,t)=>!!(le(n.uri,e)&&n.lastToken.value!==";"&&n.tokenIndexes?.start&&n.tokenIndexes?.end&&(n.tokenIndexes.start.pos.line===t.line||n.tokenIndexes.end.pos.line===t.line)&&t.character>=n.tokenIndexes.end.pos.colEnd),mk=(n,e,t)=>{if(!n)return!1;let s=n.filter(i=>i.pos.line===t.line).at(-1);return s&&s.pos.col>=t.character?!1:e.tokenIndexes?.end===s};var Pr=(n,e,t)=>{let r=n,s=n;for(;s;)r=s,s=[...r.children].reverse().find(i=>On(i,e,t));return r},$a=(n,e,t)=>{let r=n,s=n;for(;s;)r=s,s=[...r.children].find(i=>OM(i.lastToken,e,t));return r===n?void 0:r},La=(n,e,t)=>{let r=n,s=n;for(;s;)r=s,s=[...r.children].reverse().find(i=>rg(i.firstToken,e,t));return r===n?void 0:r},V=(n,e,t=ad.DiagnosticSeverity.Error,r=[],s=void 0,i=[],o,a)=>{let c={issues:Array.isArray(n)?n:[n],astElement:e,severity:t,linkedTo:r,tags:s,templateStrings:i,edit:o,codeActionTitle:a},l,u=()=>(l??={severity:c.severity,range:Z(c.astElement),message:c.issues?c.issues.map(xM).join(" or "):"",source:"devicetree",tags:c.tags,data:{firstToken:{pos:c.astElement.firstToken.pos,tokens:c.astElement.firstToken.tokens,value:c.astElement.firstToken.value},lastToken:{pos:c.astElement.lastToken.pos,tokens:c.astElement.lastToken.tokens,value:c.astElement.lastToken.value},issues:{type:"SyntaxIssue",items:c.issues,edit:c.edit,codeActionTitle:c.codeActionTitle}}},l);return c.astElement.issues.push(u),{raw:c,diagnostic:u}},Ot=(n,e,t=ad.DiagnosticSeverity.Error,r=[],s=void 0,i=[],o,a)=>{let c={issues:Array.isArray(n)?n:[n],astElement:e,severity:t,linkedTo:r,tags:s,templateStrings:i,edit:o,codeActionTitle:a},l,u=()=>(l??={severity:c.severity,range:Z(c.astElement),message:MM(c),source:"devicetree",tags:c.tags,relatedInformation:[...c.linkedTo.map(d=>({message:c.issues.map($M).join(" or "),location:{uri:de(d.uri),range:Z(d)}}))]},l);return c.astElement.issues.push(u),{raw:c,diagnostic:u}},F=(n,e,t=ad.DiagnosticSeverity.Error,r=[],s=void 0,i=[],o,a)=>{let c={issues:Array.isArray(n)?n:[n],astElement:e,severity:t,linkedTo:r,tags:s,templateStrings:i,edit:o,codeActionTitle:a},l,u=()=>(l??={severity:c.severity,range:Z(c.astElement),message:LM(c),relatedInformation:[...c.linkedTo.map(d=>({message:c.issues.map(qM).join(" or "),location:{uri:de(d.uri),range:Z(d)}}))],source:"devicetree",tags:c.tags,data:{firstToken:{pos:c.astElement.firstToken.pos,tokens:c.astElement.firstToken.tokens,value:c.astElement.firstToken.value},lastToken:{pos:c.astElement.lastToken.pos,tokens:c.astElement.lastToken.tokens,value:c.astElement.lastToken.value},issues:{type:"StandardTypeIssue",items:c.issues,edit:c.edit,codeActionTitle:c.codeActionTitle}}},l);return c.astElement.issues.push(u),{raw:c,diagnostic:u}},gk=(n,e)=>[...n].sort((r,s)=>{let i=e.getSortKey(r),o=e.getSortKey(s);if(i===void 0||o===void 0)throw new Error("Sort keys must be set");if(i!==o)return i-o;if(!r.tokenIndexes?.end||!s.tokenIndexes?.end)throw new Error("Must have token indexes");return r.tokenIndexes.end.pos.line!==s.tokenIndexes.end.pos.line?r.tokenIndexes.end.pos.line-s.tokenIndexes.end.pos.line:r.tokenIndexes.end.pos.col-s.tokenIndexes.end.pos.col});async function Nt(n,e,t){let r=tt(n.textDocument.uri);if(!e)return[];console.time("search");let i=(await e.getRuntime()).getDeepestAstNode(r,n.position),o=e.getSortKey(i?.ast);return console.timeEnd("search"),t(i,c=>{let l=n.position;return le(c.uri,r)?!!(c.tokenIndexes?.end&&(c.tokenIndexes.end.pos.line<l.line||c.tokenIndexes.end.pos.line===l.line&&c.tokenIndexes.end.pos.colEnd<=l.character)):o!==void 0&&(e.getSortKey(c)??-1)<=o})}function H(n,e){return{start:n,end:e??n}}var $=(n,e)=>n?.tokens.some(t=>t===e),et=n=>e=>e?.value&&n===e.value?"yes":IM(n)(e),De=n=>e=>e?.tokens.some(t=>t===n)?"yes":"no",IM=n=>e=>e?.value&&n.startsWith(e.value)?"partial":"no",Rr=(n,e)=>!!n&&!!e&&n.pos.line===e.pos.line&&le(n.uri,e.uri),an=(n,e)=>!!n&&!!e&&Rr(n,e)&&n.pos.colEnd===e.pos.col,cd=n=>n.map((e,t)=>({index:t,context:e,files:e.getContextFiles()})),cr=(n,e,t,r)=>{if("id"in e){let i=n?.find(o=>o.id===e.id);return i||void 0}if("name"in e){let i=n?.find(o=>o.ctxNames.includes(e.name));return i||void 0}return t?.getContextFiles().find(i=>le(i,e.uri))?t:cd(n).sort(i=>i.context.id===r?-1:0).find(i=>i.files.some(o=>le(o,e.uri)))?.context},sg=(n,e)=>cd(n).filter(r=>r.files.some(s=>le(s,e))).map(r=>r.context),yk=n=>{let e=/^(\w+)\s+(.+)$/,t=/^(\w+)\(([^)]*)\)\s+(.+)$/,r=/^(\w+)\(([^)]*),\s*\.\.\.\)\s+(.+)$/,s;if(s=r.exec(n)){let[,,i,o]=s,a=i.split(",").map(c=>c.trim());return(...c)=>{let l=o;return a.forEach((u,d)=>{let f=new RegExp(`\\b${u}\\b`,"g");l=l.replace(f,c[d])}),l=l.replace(/__VA_ARGS__/g,c.slice(a.length).join(", ")),l}}else if(s=t.exec(n)){let[,,i,o]=s,a=i.split(",").map(c=>c.trim());return(...c)=>{let l=o;return a.forEach((u,d)=>{let f=new RegExp(`\\b${u}\\b`,"g");l=l.replace(f,c[d])}),l}}else if(s=e.exec(n)){let[,,i]=s;return i.trim()}},bk=(n,e)=>{let t=o=>o.replace(/(\w+)\s*##\s*(\w+)/g,(a,c,l)=>c+l),r=o=>o.replace(/#(\w+)/g,(a,c)=>`"${c}"`),s=n,i;do i=s,s=t(i),s=r(s),s=s.replace(/\b(\w+)\(([^)]*)\)|\b(\w+)\b/g,(o,a,c,l)=>{if(a==="defined"){let u=c.split(",").map(d=>d.trim());return u[0]?e.get(u[0])?.resolver:u}else if(a&&typeof e.get(a)?.resolver=="function"){let u=c.split(",").map(d=>d.trim());return(e.get(a)?.resolver)(...u)}else if(l&&typeof e.get(l)?.resolver=="string")return e.get(l)?.resolver;return o});while(s!==i);return s},de=n=>ng.default.pathToFileURL(n).toString(),tt=n=>Je(ng.default.fileURLToPath(n)),le=(n,e)=>!n||!e?!1:n===e,Je=n=>(0,dk.normalize)(process.platform==="win32"?n.toLowerCase():n),Jr=n=>(0,uk.createHash)("sha256").update([Je(n.dtsFile),...n.includePaths.map(Je),...n.overlays.map(Je),n.bindingType,...n.zephyrBindings.map(Je),...n.deviceOrgBindingsMetaSchema.map(Je),...n.deviceOrgTreeBindings.map(Je)].join(":")).digest("hex"),xM=n=>{switch(n){case 0:return"Expected value";case 1:return"Expected ';'";case 2:return"Expected '{'";case 3:return"Expected '}'";case 4:return"Expected '['";case 5:return"Expected ']'";case 12:return"Expected '>'";case 13:return"Expected '<'";case 16:return`Expected '"'`;case 17:return`Expected "'"\\`;case 24:return"Missing ':'";case 21:return"Missing '/'";case 26:return'Expected ")"';case 28:return'Missing ","';case 6:return"Expected property name";case 7:return"Expected node name";case 8:return"Expected node address";case 9:return"Expected node path";case 10:return"Expected node reference";case 11:return"Expected root node name";case 14:return"Expected bytestring";case 15:return"Expected two digits for each byte in bytestring";case 20:return"Hex values are not allowed";case 18:return"Expected label name";case 19:return"Expected '/' at the start of a node path";case 23:return"Found ';' without a statement";case 25:return"Did you mean /delete-node/ or /delete-property/?";case 34:return"Did you mean /delete-node/?";case 35:return"Did you mean /delete-property/?";case 22:return"Unknown syntax";case 27:return"Expected expression";case 31:return"Expected macro identifier";case 30:return"Expected macro identifier or function like macro";case 29:return"White space is not allowed";case 32:return"Properties can only be defined in a node";case 33:return"Properties can only be deleted inside a node";case 36:return"Unable to resolve include";case 37:return"Expected start address";case 38:return"Expected end address";case 39:case 40:return"Expected 8|16|32|64";case 42:return"Unknown macro name";case 43:return"Expected function like macro";case 44:return"Macro expects less arguments";case 45:return"Macro expects more arguments";case 46:return"Missing #ENDIF";case 47:return"Block Unused";case 41:return"This syntax is not officially part of the DTS V0.4 standard"}},MM=n=>n.issues.map(e=>{switch(e){case 0:return`Property "${n.templateStrings[0]}" is replaced by a later definition`;case 1:return"Cannot delete a property before it has been defined";case 2:return"Node name already defined";case 5:return"Cannot delete a node before it has been defined";case 3:return`No node with that reference "${n.templateStrings[0]}" has been defined`;case 8:return`No node with name "${n.templateStrings[0]}" could be found in "/${n.templateStrings[1]}".`;case 4:return`Label name "${n.templateStrings[0]}" already defined`;case 6:return`Property "${n.templateStrings[0]}" was deleted`;case 7:return`Node "${n.templateStrings[0]}" was deleted`;case 9:return`The following node "${n.templateStrings[1]}" shall be present in "${n.templateStrings[0]}" node.`}}).join(" or "),$M=n=>{switch(n){case 0:return"Property name already defined.";case 2:return"Defined here";case 4:return"Defined here";case 7:case 6:return"Deleted here";case 9:return"Node";default:return"TODO"}},LM=n=>n.issues.map(e=>{switch(e){case 9:return`Only these value are allowed ${n.templateStrings[0]}`;case 1:return"INTRO should be empty";case 8:return"INTRO can only be assigned one value";case 5:return"INTRO should be assigned a U32";case 6:return"INTRO should be assigned a U64";case 7:return"INTRO should be assigned a 'property encoded array'";case 2:return"INTRO should be assigned a string";case 3:return"INTRO should be assigned a string list";case 4:return`INTRO expects ${n.templateStrings[1]} values`;case 0:return"INTRO is required";case 11:return"INTRO should be omitted";case 28:return"INTRO name is not permitted under this node";case 10:return"INTRO address value must match node address";case 12:return"INTRO should be 'cpu'";case 13:return"INTRO should be 'memory'";case 14:return"INTRO is deprecated and should not be used'";case 15:return`INTRO ${n.templateStrings[1]}'`;case 19:return"INTRO value must be unique in the entire Devicetree";case 20:return`INTRO should have format ${n.templateStrings[1]}`;case 16:return`INTRO requires property "${n.templateStrings[1]}" in node path "${n.templateStrings[2]}"`;case 18:return"Unable to resolve interrupt parent node";case 17:return`INTRO expects ${n.templateStrings[1]} interrupt cells`;case 21:return`INTRO should have format ${n.templateStrings[1]}`;case 22:return"Node is disabled";case 23:return"Unable to resolve handle";case 24:return`Unable to find "${n.templateStrings[0]}" in ${n.templateStrings[1]}`;case 25:return n.templateStrings[0];case 26:return n.templateStrings[0];case 27:return n.templateStrings[0];case 29:return n.templateStrings[0];case 31:return`INTRO exceeds address space of this node. Range: ${n.templateStrings[1]}-${n.templateStrings[2]}, reg: ${n.templateStrings[3]}-${n.templateStrings[4]}`;case 30:return`INTRO exceeds address space avalable for this mapping. The range ends at ${n.templateStrings[1]}, the node ends at ${n.templateStrings[2]}`;case 32:return`Range overlaps with other range on ${n.templateStrings[0]} address range`}}).join(" or ").replace("INTRO",`Property "${n.templateStrings[0]}"`).replaceAll("INTRO ",""),qM=n=>{switch(n){case 16:case 0:return"Node";case 17:return"Property";case 15:return"Ignored reason";case 19:return"Conflicting properties";case 8:return"Additional value";case 22:return"Disabled by";case 31:return"Address space";case 30:return"Mapping range";case 32:return"Overlapping range";default:return"TODO"}},Ft=(n,e)=>{let t=Math.max(n.length,e.length);for(let r=0;r<t;r++){let s=n[n.length-t+r]??0,i=e[e.length-t+r]??0;if(s<i)return-1;if(s>i)return 1}return 0},An=(n,e)=>{let t=Math.max(n.length,e.length),r=new Array(t).fill(0),s=0;for(let i=0;i<t;i++){let o=n[n.length-1-i]??0,a=e[e.length-1-i]??0,c=o+a+s;r[t-1-i]=c>>>0,s=c>4294967295?1:0}return s&&r.unshift(1),r},jM=(n,e)=>{let t=Math.max(n.length,e.length),r=new Array(t).fill(0),s=0;for(let i=0;i<t;i++){let o=n[n.length-1-i]??0,a=e[e.length-1-i]??0;o-=s,o<a?(o+=4294967296,s=1):s=0,r[t-1-i]=o-a>>>0}for(;r.length>1&&r[0]===0;)r.shift();return r},FM=(n,e)=>An(n,e),vk=(n,e)=>{for(let t of n){let r=t.childAddress,s=t.length,i=An(r,s);if(Ft(e,r)>=0&&Ft(e,i)<0){let o=jM(e,r),a=t.parentAddress,c=FM(a,o),l=An(a,s);return{start:c,end:l,ast:t.ast}}}return null},ld=n=>{let e=[];for(let t=0;t<n.length;t++)for(let r=t+1;r<n.length;r++){let s=n[t],i=n[r],o=s.childAddress,a=An(o,s.length),c=i.childAddress,l=An(c,i.length),u=s.parentAddress,d=An(u,s.length),f=i.parentAddress,p=An(f,i.length),y=Ft(o,l)<0&&Ft(c,a)<0,m=Ft(u,p)<0&&Ft(f,d)<0;(y||m)&&e.push({mappingA:s,mappingB:i,overlapOn:y&&m?"child and parent":y?"child":"parent"})}return e};var Xt=class{constructor(e,t,r){this.uri=e;this.range=t;this.issues=r}},ud=class extends Xt{constructor(t,r,s,i){super(r,s,i);this.value=t;this.type="STRING"}},dd=class extends Xt{constructor(t,r,s,i){super(r,s,i);this.values=t;this.type="BYTESTRING"}},fd=class extends Xt{constructor(t,r,s,i){super(r,s,i);this.value=t;this.type="ARRAY_VALUE"}},hd=class extends Xt{constructor(t,r,s,i,o){super(s,i,o);this.label=t;this.nodePath=r;this.type="LABEL_REF"}},pd=class extends Xt{constructor(t,r,s,i){super(r,s,i);this.nodePath=t;this.type="NODE_PATH"}},md=class extends Xt{constructor(t,r,s,i,o){super(s,i,o);this.value=t;this.evaluated=r}},gd=class extends md{constructor(t,r,s,i,o){super(t,r,s,i,o);this.type="NUMBER_VALUE"}},yd=class extends md{constructor(t,r,s,i,o){super(t,r,s,i,o);this.type="EXPRESSION"}},bd=class extends Xt{constructor(t,r,s,i){super(r,s,i);this.value=t}},vd=class extends Xt{constructor(t,r,s,i,o){super(s,i,o);this.name=t;this.values=r}},Td=class extends Xt{constructor(t,r,s,i){super(r,s,i);this.address=t}},Sd=class extends Xt{constructor(t,r,s,i,o,a){super(i,o,a);this.fullName=t;this.name=r;this.address=s}},_d=class extends Xt{constructor(t,r,s,i){super(r,s,i);this.name=t}};var qa=class extends Xt{constructor(t,r,s,i,o,a,c){super(o,a,c);this.type=t;this.name=r;this.properties=s;this.nodes=i}},Ed=class extends qa{constructor(e,t,r,s,i,o){super("REF",e,t,r,s,i,o)}},wd=class extends qa{constructor(e,t,r,s,i){super("ROOT",null,e,t,r,s,i)}},kd=class extends qa{constructor(e,t,r,s,i,o){super("CHILD",e,t,r,s,i,o)}};var vn=K(X()),q=class{constructor(e){this._children=[];this.issues=[];this._fisrtToken=e?.start,this._lastToken=e?.end}addIssue(e){this.issues.push(e)}get serializeIssues(){return this.issues.map(e=>e())}get firstToken(){return this._fisrtToken??this._children[0].tokenIndexes.start}set firstToken(e){this._fisrtToken=e}get lastToken(){return this._lastToken??this._children.at(-1)?.lastToken??this.firstToken}set lastToken(e){this._lastToken=e}get uri(){return this.firstToken.uri}getTopMostAstNodeForFile(e){return le(e,this.uri)?[this]:this.children.flatMap(t=>t.getTopMostAstNodeForFile(e))}get tokenIndexes(){return{start:this.firstToken,end:this.lastToken}}getDocumentSymbols(e){if(!this.docSymbolsMeta)return this.children.flatMap(r=>r.getDocumentSymbols(e)??[]);if(!le(this.uri,e))return[];let t=Z(this);return[{name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind,range:t,selectionRange:t,children:[...this.children.flatMap(r=>r.getDocumentSymbols(e)??[])]}]}getWorkspaceSymbols(){if(!this.docSymbolsMeta)return this.children.flatMap(r=>r.getWorkspaceSymbols()??[]);let e=this.docSymbolsMeta.kind;if(![vn.SymbolKind.File,vn.SymbolKind.Class,vn.SymbolKind.Namespace].some(r=>r===e))return[];let t=Z(this);return[{location:vn.Location.create(de(this.uri),t),name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind},...this.children.flatMap(r=>r.getWorkspaceSymbols()??[]).filter(r=>r.kind===vn.SymbolKind.File||r.kind===vn.SymbolKind.Class||r.kind===vn.SymbolKind.Namespace)]}buildSemanticTokens(e){this._children.forEach(t=>t.buildSemanticTokens(e)),!(!this.semanticTokenType||!this.semanticTokenModifiers)&&e(ui(this.semanticTokenType),di(this.semanticTokenModifiers),this.tokenIndexes)}get children(){return this._children}get allDescendants(){return this.allDescendantsCache??=[...this._children,...this._children.flatMap(e=>e.allDescendants)],this.allDescendantsCache}addChild(e){e&&(e.parentNode=this,this.children.push(e)),this.allDescendantsCache=void 0}toPrettyString(e){return this.toString()}toString(e){return"TODO"}get range(){return vn.Range.create(vn.Position.create(this.firstToken.pos.line,this.firstToken.pos.col),vn.Position.create(this.lastToken.pos.line,this.lastToken.pos.colEnd))}serialize(e){return new Xt(this.uri,this.range,this.serializeIssues)}};var lr=K(X());var wk=K(X());var Tk=K(X());var Ie=class extends q{constructor(t,r){super(r);this.value=t;this.semanticTokenType="string",this.semanticTokenModifiers="declaration",this.docSymbolsMeta={name:this.value,kind:Tk.SymbolKind.String}}toString(){return`"${this.value.toString()}"`}toJson(){return this.value}serialize(){return new ud(this.value,this.uri,this.range,this.serializeIssues)}};var _k=K(X());var Sk=K(X());function BM(n){return n.replace(/'(.)'/g,(e,t)=>t.charCodeAt(0).toString()).replace(/(0x[a-f\d]+|\d+)[ul]*/gi,"$1")}function ig(n){try{return(0,eval)(BM(n))}catch(e){console.log(e)}return n}var Qt=class extends q{toJson(){return-1}resolve(e){return bk(this.toString(),e)}evaluate(e){return ig(this.resolve(e))}isTrue(e){return ig(`!!(${this.resolve(e)})`)}toPrettyString(e){let t=this.evaluate(e);return`${t.toString()} /* ${this.toString()}${typeof t=="number"?` = 0x${t.toString(16)}`:""} */`}serialize(e){return new yd(this.toString(),this.evaluate(e),this.uri,this.range,this.serializeIssues)}},fi=class extends Qt{constructor(t,r,s){super();this.expression=t;this.wrapped=r;this.join=s;this.addChild(t),s&&(this.addChild(s.operator),this.addChild(s.expression))}addExpression(t,r){this.addChild(t),this.addChild(r)}toString(){let t=this.children.map(r=>r.toString()).join(" ");return this.wrapped?`(${t})`:`${t}`}isTrue(t){let r=`(${this.children.map(s=>s instanceof Qt?s.resolve(t):s.toString()).join(" ")})`;return ig(`!!${r}`)}};var It=class extends Qt{constructor(t,r){super(r);this.value=t;this.docSymbolsMeta={name:this.value.toString(),kind:Sk.SymbolKind.Number},this.semanticTokenType="number",this.semanticTokenModifiers="declaration"}toString(t){return this.value.toString(t)}toJson(){return this.value}toPrettyString(t){let r=this.evaluate(t);return`${r.toString()} /* ${typeof r=="number"?`0x${r.toString(16)}`:""} */`}serialize(){return new gd(this.value.toString(),this.value,this.uri,this.range,this.serializeIssues)}};var St=class extends q{constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Cell Array",kind:_k.SymbolKind.Array},this.values.forEach(r=>this.addChild(r))}toString(){return`<${this.values.map(t=>t.toString()).join(" ")}>`}toPrettyString(t){return`<${this.values.map(r=>r.toPrettyString(t)).join(" ")}>`}toJson(){if(this.values.length===1)return this.values[0].value?.toJson();if(this.values.length===2&&this.values.every(t=>t.value instanceof It)){let t=new ArrayBuffer(8),r=new DataView(t);return this.values.map(s=>s.value.value).forEach((s,i)=>{r.setUint32(i*4,s)}),r.getBigUint64(0)}return this.values.map(t=>t.value?.toJson()??NaN)}serialize(t){let r=this.values.map(s=>s.value?.serialize(t)??null);return new fd(r,this.uri,this.range,this.serializeIssues)}};var Ek=K(X());var Ss=class extends q{constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Byte String Value",kind:Ek.SymbolKind.Array},this.values.forEach(r=>this.addChild(r))}toString(){return`[${this.values.map(t=>t.toString(16).padStart(2,"0")).join(" ")}]`}toJson(){return this.values.map(t=>t.value?.toJson()??NaN)}serialize(){return new dd(this.values.map(t=>t.value?{value:t.value.toString(16),range:t.value.range,evaluated:t.value.value}:null),this.uri,this.range,this.serializeIssues)}};var je=class extends q{constructor(t,r){super(r);this.name=t;this.semanticTokenType="property",this.semanticTokenModifiers="declaration"}toString(){return this.name}serialize(){return new bd(this.name,this.uri,this.range,this.serializeIssues)}},xe=class extends q{constructor(t,r=[]){super();this.propertyName=t;this.labels=r;this._values=void 0;this.docSymbolsMeta={name:this.propertyName?.name??"Unknown",kind:wk.SymbolKind.Property},this.labels.forEach(s=>this.addChild(s)),this.addChild(t)}set values(t){if(this._values)throw new Error("Only one property name is allowed");this._values=t,this.addChild(t)}get values(){return this._values}get quickValues(){return this.values?.values.map(t=>t?t.value instanceof Ie?t.value.value:t.value instanceof St?t.value.values.map(r=>r.value instanceof It?r.value.value:NaN):t.value instanceof Ss?t.value.values.map(r=>r.value?.value??NaN):NaN:null)}toString(){return`${this.propertyName?.toString()??"__UNSET__"}${this.assignOperatorToken?` = ${this._values?.values.map(t=>t?.toString()??"NULL").join(", ")??"NULL"}`:""};`}toPrettyString(t){return`${this.propertyName?.toString()??"__UNSET__"}${this.assignOperatorToken?` = ${this._values?.values.map(r=>r?.toPrettyString(t)??"NULL").join(", ")??"NULL"}`:""};`}serialize(t){return new vd(this.propertyName?.serialize()??null,this.values?.values.map(r=>r?.value?.serialize(t)??null)??null,this.uri,this.range,this.serializeIssues)}};var kk=K(X()),cn=class extends q{constructor(t,r){super();this.keyword=r;this.addChild(r),this.docSymbolsMeta={name:t,kind:kk.SymbolKind.Function}}};var Tn=class extends cn{constructor(t){super("Delete Node",t);this._nodeNameOrRef=null}set nodeNameOrRef(t){if(this._nodeNameOrRef)throw new Error("Only one property name is allowed");this._nodeNameOrRef=t,this.addChild(t)}get nodeNameOrRef(){return this._nodeNameOrRef}};var We=class extends cn{constructor(t){super("Delete Property",t);this._propertyName=null}set propertyName(t){if(this._propertyName)throw new Error("Only only property name is allowed");this._propertyName=t,this.addChild(t)}get propertyName(){return this._propertyName}};var Fe=class n extends q{constructor(){super()}get path(){if(!this.pathName)return["__UNDEFINED__"];if(!this.parentNode||this instanceof mt)return[this.pathName];if(!(this.parentNode instanceof n))return;let e=this.parentNode.path;return e?[...e,this.pathName]:[this.pathName]}get pathName(){}get nodes(){return this.children.filter(e=>e instanceof n)}get deleteNodes(){return this.children.filter(e=>e instanceof Tn)}addNodeChild(e){this.addChild(e)}},mt=class extends Fe{constructor(){super(),this.docSymbolsMeta={name:"/",kind:lr.SymbolKind.Class}}get properties(){return this.children.filter(e=>e instanceof xe)}get name(){return new Me("/",H(this.firstToken))}get deleteProperties(){return this.children.filter(e=>e instanceof We)}get nodes(){return this.children.filter(e=>e instanceof Pe)}get pathName(){return"/"}serialize(e){return new wd(this.properties.map(t=>t.serialize(e)),this.nodes.map(t=>t.serialize(e)),this.uri,this.range,this.serializeIssues)}},xt=class extends Fe{constructor(t=[]){super();this.labels=t;this._labelReference=null;this.docSymbolsMeta={name:"DTC Name",kind:lr.SymbolKind.Class},t.forEach(r=>{super.addChild(r)})}get serializeIssues(){return[...this.issues,...this.labelReference?.issues??[]].map(t=>t())}set labelReference(t){if(this._labelReference)throw new Error("Only on label reference is allowed");this._labelReference=t,this.docSymbolsMeta={name:this.labelReference?.value??"DTC Name",kind:lr.SymbolKind.Class},this.addChild(t)}get path(){return this.resolveNodePath?this.resolveNodePath:super.path}get labelReference(){return this._labelReference}get nodes(){return this.children.filter(t=>t instanceof Pe)}get pathName(){return this.labelReference?.label?`&${this.labelReference?.label?.value}`:void 0}get properties(){return this.children.filter(t=>t instanceof xe)}get deleteProperties(){return this.children.filter(t=>t instanceof We)}serialize(t){return new Ed(this.labelReference?.serialize()??null,this.properties.map(r=>r.serialize(t)),this.nodes.map(r=>r.serialize(t)),this.uri,this.range,this.serializeIssues)}},Pe=class n extends Fe{constructor(t=[],r){super();this.labels=t;this.omitIfNoRef=r;this._name=null;this.docSymbolsMeta={name:"DTC Name",kind:lr.SymbolKind.Class},r&&this.addChild(r),t.forEach(s=>{this.addChild(s)})}get serializeIssues(){return[...this.issues,...this.name?.issues??[]].map(t=>t())}set name(t){if(this._name)throw new Error("Only on label reference is allowed");this._name=t,this.docSymbolsMeta={name:this._name?.toString()??"DTC Name",kind:lr.SymbolKind.Class},this.addChild(t)}get name(){return this._name}get nodes(){return this.children.filter(t=>t instanceof n)}get pathName(){return this._name?.toString()}get properties(){return this.children.filter(t=>t instanceof xe)}get deleteProperties(){return this.children.filter(t=>t instanceof We)}serialize(t){return new kd(this.name?.serialize()??null,this.properties.map(r=>r.serialize(t)),this.nodes.map(r=>r.serialize(t)),this.uri,this.range,this.serializeIssues)}},Nd=class extends q{constructor(t,r){super(r);this.address=t;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.address?.map((t,r)=>t.toString(16).padStart(r?8:0,"0")).join("")??"NaN"}serialize(){return new Td(this.address,this.uri,this.range,this.serializeIssues)}},Me=class extends q{constructor(t,r,s){super(r);this.name=t;this._address=s;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}get value(){return this.name}get address(){return this._address}set address(t){if(this._address)throw new Error("Address can only be set once");t&&(this.lastToken=void 0,this._address=t,t.forEach(r=>this.addChild(r)))}get fullAddress(){return this._address?[...this._address.flatMap(t=>t.address)]:void 0}toString(){return this._address!==void 0?`${this.name}@${this._address.map(t=>t.toString()).join(",")}`:this.name}buildSemanticTokens(t){if(!this.tokenIndexes?.start||!this.tokenIndexes.start.value)return;let r={...this.tokenIndexes.start,pos:{...this.tokenIndexes.start.pos,len:this.name.length}};t(ui("type"),di("declaration"),{start:r,end:r}),this.address!==void 0&&this.address.forEach(s=>{t(ui("decorator"),di("declaration"),{start:s.lastToken.prevToken,end:s.lastToken.prevToken}),s.buildSemanticTokens(t)})}get serializeIssues(){return[...this.issues,...this._address?.flatMap(t=>t.issues)??[]].map(t=>t())}serialize(){return new Sd(this.toString(),new _d(this.name,this.uri,lr.Range.create(lr.Position.create(this.tokenIndexes.start.pos.line,this.tokenIndexes.start.pos.col),lr.Position.create(this.tokenIndexes.start.pos.line,this.tokenIndexes.start.pos.colEnd)),[]),this.address?.map(t=>t.serialize())??null,this.uri,this.range,this.serializeIssues)}};var Nk=K(X());var ye=class extends q{constructor(t){super();this.label=t;this.docSymbolsMeta={name:`&${this.label?.value??"NULL"}`,kind:Nk.SymbolKind.Key},this.addChild(t)}get value(){return this.label?.value}toString(){return`&${this.label?.value??"NULL"}`}toJson(){return-1}serialize(){return new hd(this.label?.toString()??null,this.linksTo?.pathString??null,this.uri,this.range,this.serializeIssues)}};var dr=K(X());var Pt=n=>n instanceof cn?!0:n instanceof Fe?!1:n.parentNode?Pt(n.parentNode):!1;var go=n=>[...n.map(e=>{if(e instanceof Pe||e instanceof mt)return e.name;if(e instanceof xt)return e.labelReference})].filter(e=>!!e),og=(n,e)=>e?e.parentNode===n||og(n,e.parentNode):!1;var ht=K(X());var Pk=K(X());var Xr=class extends q{constructor(){super();this._pathParts=[]}addPath(t,r){this._pathParts.push(t),r&&this.addChild(r),this.addChild(t)}get pathParts(){return[...this._pathParts]}toString(){return this._pathParts.map(t=>t?.toString()??"<NULL>").join("/")}},In=class extends q{constructor(t){super();this.path=t;this.docSymbolsMeta={name:`/${this.path?.toString()??""}`,kind:Pk.SymbolKind.Namespace},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration",this.addChild(t)}toString(){return`&${this.path?.toString()??"NULL"}`}toJson(){return-1}serialize(){return new pd(this.path?.toString()??null,this.uri,this.range,this.serializeIssues)}};var lt=K(X());var Pd=K(X());var Rk=require("path"),_s=class extends q{constructor(t,r){super();this.keyword=t;this.path=r;this.docSymbolsMeta={name:`Include ${r}`,kind:Pd.SymbolKind.File},this.addChild(t),this.addChild(r)}get resolvedPath(){return this._resolvedPath}set resolvedPath(t){this.docSymbolsMeta={name:`Include ${t}`,kind:Pd.SymbolKind.File},this._resolvedPath=t}},yo=class extends q{constructor(t,r,s){super(s);this._path=t;this.relative=r;this.docSymbolsMeta={name:(0,Rk.basename)(this.path),kind:Pd.SymbolKind.File},this.semanticTokenType="string",this.semanticTokenModifiers="declaration"}get path(){return this.relative?this._path.slice(1,-1):this._path}};var Dr=class extends q{constructor(e){super(e),this.semanticTokenType="comment",this.semanticTokenModifiers="documentation"}};var UM=async(n,e,t)=>{let r=lt.Position.create(n.pos.line,n.pos.col),s=t.find(i=>On(i,e,r));if(s)return Pr(s,e,r)},ag=n=>{if(n)return n instanceof Fe?n:ag(n?.parentNode)},vo=(n,e,t=0)=>!e||!le(e.uri,n)?t:vo(n,ag(e.parentNode),t+1),VM=(n,e)=>async t=>{let r=await UM(t.firstToken,e,n);return!r||r===t||t.allDescendants.some(i=>i===r)?0:r instanceof Fe?vo(e,ag(r)):void 0};async function Dk(n,e){let t=[],r=tt(n.textDocument.uri),s=(await e.getRuntime()).fileTopMostAsts(r);return t.push(...(await Promise.all(s.flatMap(async i=>await Ck(n,i,r,VM(s,r))))).flat()),t}var hi=(n,e=1)=>{if(n.prevToken){let t=n.pos.line-n.prevToken.pos.line;if(t-e&&(t!==2&&e!==0||e===0))return lt.TextEdit.replace(lt.Range.create(lt.Position.create(n.prevToken.pos.line,n.prevToken.pos.colEnd),lt.Position.create(n.pos.line-e,n.pos.col)),"".padEnd(e-1,`
183
- `))}},bo=(n,e,t,r="")=>{if(n.pos.line===n.prevToken?.pos.line)return lt.TextEdit.replace(lt.Range.create(lt.Position.create(n.pos.line,n.pos.col),lt.Position.create(n.pos.line,n.pos.col)),`
184
- ${r}${"".padStart(e*t.length,t)}`)},Es=(n,e,t,r="")=>lt.TextEdit.replace(lt.Range.create(lt.Position.create(n.pos.line,0),lt.Position.create(n.pos.line,n.pos.col)),`${"".padStart(e*t.length,t)}${r}`),_t=(n,e=1)=>{if(!n.nextToken)return[];if(n.nextToken?.pos.line!==n.pos.line){let r=hi(n.nextToken,0);if(!r)throw new Error("remove new LinesEdit must be defined");return[lt.TextEdit.insert(lt.Position.create(n.pos.line,n.pos.colEnd),"".padEnd(e," ")),r]}return n.nextToken.pos.col-n.pos.colEnd===e?[]:[lt.TextEdit.replace(lt.Range.create(lt.Position.create(n.pos.line,n.pos.colEnd),lt.Position.create(n.nextToken.pos.line,n.nextToken.pos.col)),"".padEnd(e," "))]},WM=async(n,e,t,r,s,i)=>{if(!le(e.uri,t))return[];let o=[],a=bo(e.firstToken,r,s);if(a)o.push(a);else{o.push(Es(e.firstToken,r,s));let l=hi(e.firstToken);l&&o.push(l)}if(e instanceof Pe||e instanceof xt)if(o.push(...e.labels.flatMap(l=>_t(l.lastToken))),e instanceof Pe){let l=e.name&&e.openScope?_t(e.name.lastToken):[];o.push(...l)}else{let l=e.labelReference&&e.openScope?_t(e.labelReference.lastToken):[];o.push(...l)}if(o.push(...(await Promise.all(e.children.flatMap(l=>Ck(n,l,t,i,r+1)))).flat()),e.closeScope){let l=bo(e.closeScope,r,s);if(l)o.push(l);else{o.push(Es(e.closeScope,r,s));let u=hi(e.closeScope);u&&o.push(u)}}let c=e.lastToken.value===";"&&e.lastToken.prevToken?_t(e.lastToken.prevToken,0):[];return o.push(...c),o},zM=(n,e,t,r)=>{let s=[];if(s.push(..._t(n.lastToken,r?0:1)),n.firstToken.pos.line!==n.firstToken.prevToken?.pos.line){let i=hi(n.firstToken);i&&s.push(i),s.push(Es(n.firstToken,e+1,t))}return n.value,s},HM=(n,e,t,r)=>{let s=[];return n instanceof St||n instanceof Ss?(n.openBracket&&s.push(..._t(n.openBracket,0)),s.push(...n.values.flatMap((i,o)=>zM(i,e,t,o+1===n.values.length&&n.lastToken.nextToken===n.closeBracket))),n.closeBracket&&n.closeBracket?.nextToken?.value!==";"&&n.openBracket&&s.push(..._t(n.closeBracket,0))):n?.lastToken&&r&&s.push(..._t(n.lastToken,n?.lastToken.nextToken?.value===","?0:1)),s},KM=(n,e,t,r)=>{let s=[];return s.push(...n.startLabels.flatMap((i,o)=>o+1===n.startLabels.length?[]:_t(i.lastToken))),s.push(...HM(n.value,e,t,!r||n.endLabels.length>0)),s.push(...n.endLabels.flatMap((i,o)=>o+1===n.endLabels.length?[]:_t(i.lastToken))),s},GM=(n,e,t)=>{let r=[],s=i=>{if(i&&On(n,n.uri,lt.Position.create(i.pos.line,i.pos.col)))return i.value===","?i:s(i.nextToken)};return n.values.forEach((i,o)=>{if(!i)return[];let a=s(i.lastToken),c=n.values.at(o+1);if(a){if(a.pos.line===c?.firstToken?.pos.line)r.push(..._t(a,1));else if(c?.firstToken){let l=hi(c?.firstToken);l&&r.push(l),r.push(Es(c?.firstToken,e+1,t))}}}),[...r,...n.values.flatMap((i,o)=>i?KM(i,e,t,o+1===n.values.length):[])]},YM=(n,e,t)=>{let r=[],s=bo(n.firstToken,e,t);if(s)r.push(s);else{r.push(Es(n.firstToken,e,t));let o=hi(n.firstToken);o&&r.push(o)}if(r.push(...n.labels.flatMap(o=>_t(o.lastToken))),n.values){if(n.propertyName){r.push(..._t(n.propertyName?.lastToken));let o=c=>c?c.value==="="?c:o(c.nextToken):void 0,a=o(n.propertyName?.lastToken.nextToken);a&&r.push(..._t(a))}r.push(...GM(n.values,e,t))}let i=n.lastToken.value===";"&&n.lastToken.prevToken?_t(n.lastToken.prevToken,0):[];return r.push(...i),r},JM=(n,e,t)=>{let r=[],s=bo(n.firstToken,e,t);s?r.push(s):r.push(Es(n.firstToken,e,t));let i=_t(n.keyword.lastToken);r.push(...i);let o=n.lastToken.value===";"&&n.lastToken.prevToken?_t(n.lastToken.prevToken,0):[];return r.push(...o),r},XM=(n,e,t,r)=>{if(t===void 0)return[];if(!le(n.uri,e))return[];let s=[],i=bo(n.firstToken,t,r);i?s.push(i):s.push(Es(n.firstToken,t,r));let o=_t(n.keyword.lastToken);return s.push(...o),s},QM=(n,e,t)=>{let r=[];if(n.lastToken.pos.line===n.lastToken.nextToken?.pos.line&&n.lastToken.nextToken.value!==";"&&r.push(..._t(n.lastToken)),e!==void 0&&n.firstToken.pos.line===n.firstToken.prevToken?.pos.line&&n.firstToken.pos.line===n.lastToken.pos.line)return r.push(..._t(n.firstToken.prevToken)),r;if(e===void 0)return r;let s=n.firstToken.value.startsWith("*")?" ":"",i=bo(n.firstToken,e,t,s);if(i)r.push(i);else{r.push(Es(n.firstToken,e,t,s));let o=hi(n.firstToken);o&&r.push(o)}return r},Ck=async(n,e,t,r,s=0)=>{let i=n.options.tabSize,a=n.options.insertSpaces?"".padStart(i," "):" ";return hk(a),e instanceof Fe?WM(n,e,t,s,a,r):e instanceof xe?YM(e,s,a):e instanceof cn?JM(e,s,a):e instanceof _s?XM(e,t,await r(e),a):e instanceof Dr?QM(e,await r(e),a):[]};function ZM(n){switch(n){case"EMPTY":return"EMPTY";case"U32":return"U32";case"U64":return"U64";case"STRING":return"STRING";case"PROP_ENCODED_ARRAY":return"PROP_ENCODED_ARRAY";case"STRINGLIST":return"STRINGLIST";case"BYTESTRING":return"BYTESTRING";case"ANY":return"ANY";case"UNKNOWN":return"UNKNOWN"}}function e$(n){switch(n){case"EMPTY":return";";case"U32":return" = <10>";case"U64":return" = <10 20>";case"STRING":return' = "str"';case"PROP_ENCODED_ARRAY":return" = <10 20 30 ...>";case"STRINGLIST":return' = "str1" "str2"';case"BYTESTRING":return" = [10 20 .. ..]"}}var G=class{constructor(e,t,r="optional",s=void 0,i,o){this.name=e;this.type=t;this.def=s;this.additionalTypeCheck=o;this.hideAutoComplete=!1;this.list=!1;this.onHover=()=>({kind:ht.MarkupKind.Markdown,value:["### Type","**DTS native type** ",`${this.type.map(e=>e.types.map(ZM).join(" or ")).join(",")}
182
+ deps: ${n}}`};var rH={keyword:"dependencies",type:"object",schemaType:"object",error:Hr.error,code(t){let[e,n]=sH(t);sI(t,e),iI(t,n)}};function sH({schema:t}){let e={},n={};for(let r in t){if(r==="__proto__")continue;let s=Array.isArray(t[r])?e:n;s[r]=t[r]}return[e,n]}function sI(t,e=t.schema){let{gen:n,data:r,it:s}=t;if(Object.keys(e).length===0)return;let i=n.let("missing");for(let o in e){let a=e[o];if(a.length===0)continue;let c=(0,wl.propertyInData)(n,r,o,s.opts.ownProperties);t.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),s.allErrors?n.if(c,()=>{for(let l of a)(0,wl.checkReportMissingProp)(t,l)}):(n.if((0,aT._)`${c} && (${(0,wl.checkMissingProp)(t,a,i)})`),(0,wl.reportMissingProp)(t,i),n.else())}}Hr.validatePropertyDeps=sI;function iI(t,e=t.schema){let{gen:n,data:r,keyword:s,it:i}=t,o=n.name("valid");for(let a in e)(0,nH.alwaysValidSchema)(i,e[a])||(n.if((0,wl.propertyInData)(n,r,a,i.opts.ownProperties),()=>{let c=t.subschema({keyword:s,schemaProp:a},o);t.mergeValidEvaluated(c,o)},()=>n.var(o,!0)),t.ok(o))}Hr.validateSchemaDeps=iI;Hr.default=rH});var aI=w(cT=>{"use strict";Object.defineProperty(cT,"__esModule",{value:!0});var oI=ue(),iH=ye(),oH={message:"property name must be valid",params:({params:t})=>(0,oI._)`{propertyName: ${t.propertyName}}`},aH={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:oH,code(t){let{gen:e,schema:n,data:r,it:s}=t;if((0,iH.alwaysValidSchema)(s,n))return;let i=e.name("valid");e.forIn("key",r,o=>{t.setParams({propertyName:o}),t.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},i),e.if((0,oI.not)(i),()=>{t.error(!0),s.allErrors||e.break()})}),t.ok(i)}};cT.default=aH});var uT=w(lT=>{"use strict";Object.defineProperty(lT,"__esModule",{value:!0});var ep=Zn(),wr=ue(),cH=Qn(),tp=ye(),lH={message:"must NOT have additional properties",params:({params:t})=>(0,wr._)`{additionalProperty: ${t.additionalProperty}}`},uH={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:lH,code(t){let{gen:e,schema:n,parentSchema:r,data:s,errsCount:i,it:o}=t;if(!i)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=o;if(o.props=!0,c.removeAdditional!=="all"&&(0,tp.alwaysValidSchema)(o,n))return;let l=(0,ep.allSchemaProperties)(r.properties),u=(0,ep.allSchemaProperties)(r.patternProperties);d(),t.ok((0,wr._)`${i} === ${cH.default.errors}`);function d(){e.forIn("key",s,_=>{!l.length&&!u.length?y(_):e.if(f(_),()=>y(_))})}function f(_){let E;if(l.length>8){let T=(0,tp.schemaRefOrVal)(o,r.properties,"properties");E=(0,ep.isOwnProperty)(e,T,_)}else l.length?E=(0,wr.or)(...l.map(T=>(0,wr._)`${_} === ${T}`)):E=wr.nil;return u.length&&(E=(0,wr.or)(E,...u.map(T=>(0,wr._)`${(0,ep.usePattern)(t,T)}.test(${_})`))),(0,wr.not)(E)}function h(_){e.code((0,wr._)`delete ${s}[${_}]`)}function y(_){if(c.removeAdditional==="all"||c.removeAdditional&&n===!1){h(_);return}if(n===!1){t.setParams({additionalProperty:_}),t.error(),a||e.break();return}if(typeof n=="object"&&!(0,tp.alwaysValidSchema)(o,n)){let E=e.name("valid");c.removeAdditional==="failing"?(m(_,E,!1),e.if((0,wr.not)(E),()=>{t.reset(),h(_)})):(m(_,E),a||e.if((0,wr.not)(E),()=>e.break()))}}function m(_,E,T){let b={keyword:"additionalProperties",dataProp:_,dataPropType:tp.Type.Str};T===!1&&Object.assign(b,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(b,E)}}};lT.default=uH});var uI=w(fT=>{"use strict";Object.defineProperty(fT,"__esModule",{value:!0});var dH=ll(),cI=Zn(),dT=ye(),lI=uT(),fH={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:n,parentSchema:r,data:s,it:i}=t;i.opts.removeAdditional==="all"&&r.additionalProperties===void 0&&lI.default.code(new dH.KeywordCxt(i,lI.default,"additionalProperties"));let o=(0,cI.allSchemaProperties)(n);for(let d of o)i.definedProperties.add(d);i.opts.unevaluated&&o.length&&i.props!==!0&&(i.props=dT.mergeEvaluated.props(e,(0,dT.toHash)(o),i.props));let a=o.filter(d=>!(0,dT.alwaysValidSchema)(i,n[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)l(d)?u(d):(e.if((0,cI.propertyInData)(e,s,d,i.opts.ownProperties)),u(d),i.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function l(d){return i.opts.useDefaults&&!i.compositeRule&&n[d].default!==void 0}function u(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};fT.default=fH});var pI=w(hT=>{"use strict";Object.defineProperty(hT,"__esModule",{value:!0});var dI=Zn(),np=ue(),fI=ye(),hI=ye(),hH={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:n,data:r,parentSchema:s,it:i}=t,{opts:o}=i,a=(0,dI.allSchemaProperties)(n),c=a.filter(m=>(0,fI.alwaysValidSchema)(i,n[m]));if(a.length===0||c.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let l=o.strictSchema&&!o.allowMatchingProperties&&s.properties,u=e.name("valid");i.props!==!0&&!(i.props instanceof np.Name)&&(i.props=(0,hI.evaluatedPropsToName)(e,i.props));let{props:d}=i;f();function f(){for(let m of a)l&&h(m),i.allErrors?y(m):(e.var(u,!0),y(m),e.if(u))}function h(m){for(let _ in l)new RegExp(m).test(_)&&(0,fI.checkStrictMode)(i,`property ${_} matches pattern ${m} (use allowMatchingProperties)`)}function y(m){e.forIn("key",r,_=>{e.if((0,np._)`${(0,dI.usePattern)(t,m)}.test(${_})`,()=>{let E=c.includes(m);E||t.subschema({keyword:"patternProperties",schemaProp:m,dataProp:_,dataPropType:hI.Type.Str},u),i.opts.unevaluated&&d!==!0?e.assign((0,np._)`${d}[${_}]`,!0):!E&&!i.allErrors&&e.if((0,np.not)(u),()=>e.break())})})}}};hT.default=hH});var mI=w(pT=>{"use strict";Object.defineProperty(pT,"__esModule",{value:!0});var pH=ye(),mH={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:n,it:r}=t;if((0,pH.alwaysValidSchema)(r,n)){t.fail();return}let s=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),t.failResult(s,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};pT.default=mH});var gI=w(mT=>{"use strict";Object.defineProperty(mT,"__esModule",{value:!0});var gH=Zn(),yH={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:gH.validateUnion,error:{message:"must match a schema in anyOf"}};mT.default=yH});var yI=w(gT=>{"use strict";Object.defineProperty(gT,"__esModule",{value:!0});var rp=ue(),bH=ye(),vH={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,rp._)`{passingSchemas: ${t.passing}}`},TH={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:vH,code(t){let{gen:e,schema:n,parentSchema:r,it:s}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");if(s.opts.discriminator&&r.discriminator)return;let i=n,o=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");t.setParams({passing:a}),e.block(l),t.result(o,()=>t.reset(),()=>t.error(!0));function l(){i.forEach((u,d)=>{let f;(0,bH.alwaysValidSchema)(s,u)?e.var(c,!0):f=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,rp._)`${c} && ${o}`).assign(o,!1).assign(a,(0,rp._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(o,!0),e.assign(a,d),f&&t.mergeEvaluated(f,rp.Name)})})}}};gT.default=TH});var bI=w(yT=>{"use strict";Object.defineProperty(yT,"__esModule",{value:!0});var _H=ye(),SH={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:n,it:r}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");let s=e.name("valid");n.forEach((i,o)=>{if((0,_H.alwaysValidSchema)(r,i))return;let a=t.subschema({keyword:"allOf",schemaProp:o},s);t.ok(s),t.mergeEvaluated(a)})}};yT.default=SH});var _I=w(bT=>{"use strict";Object.defineProperty(bT,"__esModule",{value:!0});var sp=ue(),TI=ye(),EH={message:({params:t})=>(0,sp.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,sp._)`{failingKeyword: ${t.ifClause}}`},wH={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:EH,code(t){let{gen:e,parentSchema:n,it:r}=t;n.then===void 0&&n.else===void 0&&(0,TI.checkStrictMode)(r,'"if" without "then" and "else" is ignored');let s=vI(r,"then"),i=vI(r,"else");if(!s&&!i)return;let o=e.let("valid",!0),a=e.name("_valid");if(c(),t.reset(),s&&i){let u=e.let("ifClause");t.setParams({ifClause:u}),e.if(a,l("then",u),l("else",u))}else s?e.if(a,l("then")):e.if((0,sp.not)(a),l("else"));t.pass(o,()=>t.error(!0));function c(){let u=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(u)}function l(u,d){return()=>{let f=t.subschema({keyword:u},a);e.assign(o,a),t.mergeValidEvaluated(f,o),d?e.assign(d,(0,sp._)`${u}`):t.setParams({ifClause:u})}}}};function vI(t,e){let n=t.schema[e];return n!==void 0&&!(0,TI.alwaysValidSchema)(t,n)}bT.default=wH});var SI=w(vT=>{"use strict";Object.defineProperty(vT,"__esModule",{value:!0});var kH=ye(),NH={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:n}){e.if===void 0&&(0,kH.checkStrictMode)(n,`"${t}" without "if" is ignored`)}};vT.default=NH});var EI=w(TT=>{"use strict";Object.defineProperty(TT,"__esModule",{value:!0});var PH=nT(),RH=eI(),DH=rT(),CH=nI(),AH=rI(),OH=Zh(),IH=aI(),xH=uT(),MH=uI(),LH=pI(),$H=mI(),qH=gI(),jH=yI(),FH=bI(),BH=_I(),UH=SI();function VH(t=!1){let e=[$H.default,qH.default,jH.default,FH.default,BH.default,UH.default,IH.default,xH.default,OH.default,MH.default,LH.default];return t?e.push(RH.default,CH.default):e.push(PH.default,DH.default),e.push(AH.default),e}TT.default=VH});var wI=w(_T=>{"use strict";Object.defineProperty(_T,"__esModule",{value:!0});var Et=ue(),zH={message:({schemaCode:t})=>(0,Et.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Et._)`{format: ${t}}`},WH={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:zH,code(t,e){let{gen:n,data:r,$data:s,schema:i,schemaCode:o,it:a}=t,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=a;if(!c.validateFormats)return;s?f():h();function f(){let y=n.scopeValue("formats",{ref:d.formats,code:c.code.formats}),m=n.const("fDef",(0,Et._)`${y}[${o}]`),_=n.let("fType"),E=n.let("format");n.if((0,Et._)`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>n.assign(_,(0,Et._)`${m}.type || "string"`).assign(E,(0,Et._)`${m}.validate`),()=>n.assign(_,(0,Et._)`"string"`).assign(E,m)),t.fail$data((0,Et.or)(T(),b()));function T(){return c.strictSchema===!1?Et.nil:(0,Et._)`${o} && !${E}`}function b(){let R=u.$async?(0,Et._)`(${m}.async ? await ${E}(${r}) : ${E}(${r}))`:(0,Et._)`${E}(${r})`,D=(0,Et._)`(typeof ${E} == "function" ? ${R} : ${E}.test(${r}))`;return(0,Et._)`${E} && ${E} !== true && ${_} === ${e} && !${D}`}}function h(){let y=d.formats[i];if(!y){T();return}if(y===!0)return;let[m,_,E]=b(y);m===e&&t.pass(R());function T(){if(c.strictSchema===!1){d.logger.warn(D());return}throw new Error(D());function D(){return`unknown format "${i}" ignored in schema at path "${l}"`}}function b(D){let L=D instanceof RegExp?(0,Et.regexpCode)(D):c.code.formats?(0,Et._)`${c.code.formats}${(0,Et.getProperty)(i)}`:void 0,H=n.scopeValue("formats",{key:i,ref:D,code:L});return typeof D=="object"&&!(D instanceof RegExp)?[D.type||"string",D.validate,(0,Et._)`${H}.validate`]:["string",D,H]}function R(){if(typeof y=="object"&&!(y instanceof RegExp)&&y.async){if(!u.$async)throw new Error("async format in sync schema");return(0,Et._)`await ${E}(${r})`}return typeof _=="function"?(0,Et._)`${E}(${r})`:(0,Et._)`${E}.test(${r})`}}}};_T.default=WH});var kI=w(ST=>{"use strict";Object.defineProperty(ST,"__esModule",{value:!0});var HH=wI(),GH=[HH.default];ST.default=GH});var NI=w(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.contentVocabulary=ya.metadataVocabulary=void 0;ya.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];ya.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var RI=w(ET=>{"use strict";Object.defineProperty(ET,"__esModule",{value:!0});var KH=LO(),YH=XO(),XH=EI(),JH=kI(),PI=NI(),QH=[KH.default,YH.default,(0,XH.default)(),JH.default,PI.metadataVocabulary,PI.contentVocabulary];ET.default=QH});var kT=w(kl=>{"use strict";Object.defineProperty(kl,"__esModule",{value:!0});kl.dynamicAnchor=void 0;var wT=ue(),ZH=Qn(),DI=dl(),eG=Hh(),tG={keyword:"$dynamicAnchor",schemaType:"string",code:t=>CI(t,t.schema)};function CI(t,e){let{gen:n,it:r}=t;r.schemaEnv.root.dynamicAnchors[e]=!0;let s=(0,wT._)`${ZH.default.dynamicAnchors}${(0,wT.getProperty)(e)}`,i=r.errSchemaPath==="#"?r.validateName:nG(t);n.if((0,wT._)`!${s}`,()=>n.assign(s,i))}kl.dynamicAnchor=CI;function nG(t){let{schemaEnv:e,schema:n,self:r}=t.it,{root:s,baseId:i,localRefs:o,meta:a}=e.root,{schemaId:c}=r.opts,l=new DI.SchemaEnv({schema:n,schemaId:c,root:s,baseId:i,localRefs:o,meta:a});return DI.compileSchema.call(r,l),(0,eG.getValidate)(t,l)}kl.default=tG});var NT=w(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.dynamicRef=void 0;var AI=ue(),rG=Qn(),OI=Hh(),sG={keyword:"$dynamicRef",schemaType:"string",code:t=>II(t,t.schema)};function II(t,e){let{gen:n,keyword:r,it:s}=t;if(e[0]!=="#")throw new Error(`"${r}" only supports hash fragment reference`);let i=e.slice(1);if(s.allErrors)o();else{let c=n.let("valid",!1);o(c),t.ok(c)}function o(c){if(s.schemaEnv.root.dynamicAnchors[i]){let l=n.let("_v",(0,AI._)`${rG.default.dynamicAnchors}${(0,AI.getProperty)(i)}`);n.if(l,a(l,c),a(s.validateName,c))}else a(s.validateName,c)()}function a(c,l){return l?()=>n.block(()=>{(0,OI.callRef)(t,c),n.let(l,!0)}):()=>(0,OI.callRef)(t,c)}}Nl.dynamicRef=II;Nl.default=sG});var xI=w(PT=>{"use strict";Object.defineProperty(PT,"__esModule",{value:!0});var iG=kT(),oG=ye(),aG={keyword:"$recursiveAnchor",schemaType:"boolean",code(t){t.schema?(0,iG.dynamicAnchor)(t,""):(0,oG.checkStrictMode)(t.it,"$recursiveAnchor: false is ignored")}};PT.default=aG});var MI=w(RT=>{"use strict";Object.defineProperty(RT,"__esModule",{value:!0});var cG=NT(),lG={keyword:"$recursiveRef",schemaType:"string",code:t=>(0,cG.dynamicRef)(t,t.schema)};RT.default=lG});var LI=w(DT=>{"use strict";Object.defineProperty(DT,"__esModule",{value:!0});var uG=kT(),dG=NT(),fG=xI(),hG=MI(),pG=[uG.default,dG.default,fG.default,hG.default];DT.default=pG});var qI=w(CT=>{"use strict";Object.defineProperty(CT,"__esModule",{value:!0});var $I=Zh(),mG={keyword:"dependentRequired",type:"object",schemaType:"object",error:$I.error,code:t=>(0,$I.validatePropertyDeps)(t)};CT.default=mG});var jI=w(AT=>{"use strict";Object.defineProperty(AT,"__esModule",{value:!0});var gG=Zh(),yG={keyword:"dependentSchemas",type:"object",schemaType:"object",code:t=>(0,gG.validateSchemaDeps)(t)};AT.default=yG});var FI=w(OT=>{"use strict";Object.defineProperty(OT,"__esModule",{value:!0});var bG=ye(),vG={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:t,parentSchema:e,it:n}){e.contains===void 0&&(0,bG.checkStrictMode)(n,`"${t}" without "contains" is ignored`)}};OT.default=vG});var BI=w(IT=>{"use strict";Object.defineProperty(IT,"__esModule",{value:!0});var TG=qI(),_G=jI(),SG=FI(),EG=[TG.default,_G.default,SG.default];IT.default=EG});var VI=w(xT=>{"use strict";Object.defineProperty(xT,"__esModule",{value:!0});var ni=ue(),UI=ye(),wG=Qn(),kG={message:"must NOT have unevaluated properties",params:({params:t})=>(0,ni._)`{unevaluatedProperty: ${t.unevaluatedProperty}}`},NG={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:kG,code(t){let{gen:e,schema:n,data:r,errsCount:s,it:i}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:o,props:a}=i;a instanceof ni.Name?e.if((0,ni._)`${a} !== true`,()=>e.forIn("key",r,d=>e.if(l(a,d),()=>c(d)))):a!==!0&&e.forIn("key",r,d=>a===void 0?c(d):e.if(u(a,d),()=>c(d))),i.props=!0,t.ok((0,ni._)`${s} === ${wG.default.errors}`);function c(d){if(n===!1){t.setParams({unevaluatedProperty:d}),t.error(),o||e.break();return}if(!(0,UI.alwaysValidSchema)(i,n)){let f=e.name("valid");t.subschema({keyword:"unevaluatedProperties",dataProp:d,dataPropType:UI.Type.Str},f),o||e.if((0,ni.not)(f),()=>e.break())}}function l(d,f){return(0,ni._)`!${d} || !${d}[${f}]`}function u(d,f){let h=[];for(let y in d)d[y]===!0&&h.push((0,ni._)`${f} !== ${y}`);return(0,ni.and)(...h)}}};xT.default=NG});var WI=w(MT=>{"use strict";Object.defineProperty(MT,"__esModule",{value:!0});var Vi=ue(),zI=ye(),PG={message:({params:{len:t}})=>(0,Vi.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Vi._)`{limit: ${t}}`},RG={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:PG,code(t){let{gen:e,schema:n,data:r,it:s}=t,i=s.items||0;if(i===!0)return;let o=e.const("len",(0,Vi._)`${r}.length`);if(n===!1)t.setParams({len:i}),t.fail((0,Vi._)`${o} > ${i}`);else if(typeof n=="object"&&!(0,zI.alwaysValidSchema)(s,n)){let c=e.var("valid",(0,Vi._)`${o} <= ${i}`);e.if((0,Vi.not)(c),()=>a(c,i)),t.ok(c)}s.items=!0;function a(c,l){e.forRange("i",l,o,u=>{t.subschema({keyword:"unevaluatedItems",dataProp:u,dataPropType:zI.Type.Num},c),s.allErrors||e.if((0,Vi.not)(c),()=>e.break())})}}};MT.default=RG});var HI=w(LT=>{"use strict";Object.defineProperty(LT,"__esModule",{value:!0});var DG=VI(),CG=WI(),AG=[DG.default,CG.default];LT.default=AG});var KI=w(ip=>{"use strict";Object.defineProperty(ip,"__esModule",{value:!0});ip.DiscrError=void 0;var GI;(function(t){t.Tag="tag",t.Mapping="mapping"})(GI||(ip.DiscrError=GI={}))});var XI=w(qT=>{"use strict";Object.defineProperty(qT,"__esModule",{value:!0});var ba=ue(),$T=KI(),YI=dl(),OG=ul(),IG=ye(),xG={message:({params:{discrError:t,tagName:e}})=>t===$T.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:n}})=>(0,ba._)`{error: ${t}, tag: ${n}, tagValue: ${e}}`},MG={keyword:"discriminator",type:"object",schemaType:"object",error:xG,code(t){let{gen:e,data:n,schema:r,parentSchema:s,it:i}=t,{oneOf:o}=s;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=r.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(r.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),l=e.const("tag",(0,ba._)`${n}${(0,ba.getProperty)(a)}`);e.if((0,ba._)`typeof ${l} == "string"`,()=>u(),()=>t.error(!1,{discrError:$T.DiscrError.Tag,tag:l,tagName:a})),t.ok(c);function u(){let h=f();e.if(!1);for(let y in h)e.elseIf((0,ba._)`${l} === ${y}`),e.assign(c,d(h[y]));e.else(),t.error(!1,{discrError:$T.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function d(h){let y=e.name("valid"),m=t.subschema({keyword:"oneOf",schemaProp:h},y);return t.mergeEvaluated(m,ba.Name),y}function f(){var h;let y={},m=E(s),_=!0;for(let R=0;R<o.length;R++){let D=o[R];if(D?.$ref&&!(0,IG.schemaHasRulesButRef)(D,i.self.RULES)){let H=D.$ref;if(D=YI.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,H),D instanceof YI.SchemaEnv&&(D=D.schema),D===void 0)throw new OG.default(i.opts.uriResolver,i.baseId,H)}let L=(h=D?.properties)===null||h===void 0?void 0:h[a];if(typeof L!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);_=_&&(m||E(D)),T(L,R)}if(!_)throw new Error(`discriminator: "${a}" must be required`);return y;function E({required:R}){return Array.isArray(R)&&R.includes(a)}function T(R,D){if(R.const)b(R.const,D);else if(R.enum)for(let L of R.enum)b(L,D);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function b(R,D){if(typeof R!="string"||R in y)throw new Error(`discriminator: "${a}" values must be unique strings`);y[R]=D}}}};qT.default=MG});var JI=w(($ie,LG)=>{LG.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}}});var QI=w((qie,$G)=>{$G.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}}});var ZI=w((jie,qG)=>{qG.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}}});var ex=w((Fie,jG)=>{jG.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}}});var tx=w((Bie,FG)=>{FG.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}}});var nx=w((Uie,BG)=>{BG.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var rx=w((Vie,UG)=>{UG.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var sx=w(jT=>{"use strict";Object.defineProperty(jT,"__esModule",{value:!0});var VG=JI(),zG=QI(),WG=ZI(),HG=ex(),GG=tx(),KG=nx(),YG=rx(),XG=["/properties"];function JG(t){return[VG,zG,WG,HG,e(this,GG),KG,e(this,YG)].forEach(n=>this.addMetaSchema(n,void 0,!1)),this;function e(n,r){return t?n.$dataMetaSchema(r,XG):r}}jT.default=JG});var ix=w((ct,BT)=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.MissingRefError=ct.ValidationError=ct.CodeGen=ct.Name=ct.nil=ct.stringify=ct.str=ct._=ct.KeywordCxt=ct.Ajv2019=void 0;var QG=AO(),ZG=RI(),eK=LI(),tK=BI(),nK=HI(),rK=XI(),sK=sx(),FT="https://json-schema.org/draft/2019-09/schema",va=class extends QG.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(eK.default),ZG.default.forEach(e=>this.addVocabulary(e)),this.addVocabulary(tK.default),this.addVocabulary(nK.default),this.opts.discriminator&&this.addKeyword(rK.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:n}=this.opts;n&&(sK.default.call(this,e),this.refs["http://json-schema.org/schema"]=FT)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(FT)?FT:void 0)}};ct.Ajv2019=va;BT.exports=ct=va;BT.exports.Ajv2019=va;Object.defineProperty(ct,"__esModule",{value:!0});ct.default=va;var iK=ll();Object.defineProperty(ct,"KeywordCxt",{enumerable:!0,get:function(){return iK.KeywordCxt}});var Ta=ue();Object.defineProperty(ct,"_",{enumerable:!0,get:function(){return Ta._}});Object.defineProperty(ct,"str",{enumerable:!0,get:function(){return Ta.str}});Object.defineProperty(ct,"stringify",{enumerable:!0,get:function(){return Ta.stringify}});Object.defineProperty(ct,"nil",{enumerable:!0,get:function(){return Ta.nil}});Object.defineProperty(ct,"Name",{enumerable:!0,get:function(){return Ta.Name}});Object.defineProperty(ct,"CodeGen",{enumerable:!0,get:function(){return Ta.CodeGen}});var oK=qh();Object.defineProperty(ct,"ValidationError",{enumerable:!0,get:function(){return oK.default}});var aK=ul();Object.defineProperty(ct,"MissingRefError",{enumerable:!0,get:function(){return aK.default}})});var tt=Y(Ik());var ud=class t{constructor(e,n,r,s){this._uri=e,this._languageId=n,this._version=r,this._content=s,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){for(let r of e)if(t.isIncremental(r)){let s=Mk(r.range),i=this.offsetAt(s.start),o=this.offsetAt(s.end);this._content=this._content.substring(0,i)+r.text+this._content.substring(o,this._content.length);let a=Math.max(s.start.line,0),c=Math.max(s.end.line,0),l=this._lineOffsets,u=xk(r.text,!1,i);if(c-a===u.length)for(let f=0,h=u.length;f<h;f++)l[f+a+1]=u[f];else u.length<1e4?l.splice(a+1,c-a,...u):this._lineOffsets=l=l.slice(0,a+1).concat(u,l.slice(c+1));let d=r.text.length-(o-i);if(d!==0)for(let f=a+1+u.length,h=l.length;f<h;f++)l[f]=l[f]+d}else if(t.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=xk(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,s=n.length;if(s===0)return{line:0,character:e};for(;r<s;){let o=Math.floor((r+s)/2);n[o]>e?s=o:r=o+1}let i=r-1;return{line:i,character:e-n[i]}}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],s=e.line+1<n.length?n[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,s),r)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}},dd;(function(t){function e(s,i,o,a){return new ud(s,i,o,a)}t.create=e;function n(s,i,o){if(s instanceof ud)return s.update(i,o),s;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=n;function r(s,i){let o=s.getText(),a=pg(i.map(c1),(u,d)=>{let f=u.range.start.line-d.range.start.line;return f===0?u.range.start.character-d.range.start.character:f}),c=0,l=[];for(let u of a){let d=s.offsetAt(u.range.start);if(d<c)throw new Error("Overlapping edit");d>c&&l.push(o.substring(c,d)),u.newText.length&&l.push(u.newText),c=s.offsetAt(u.range.end)}return l.push(o.substr(c)),l.join("")}t.applyEdits=r})(dd||(dd={}));function pg(t,e){if(t.length<=1)return t;let n=t.length/2|0,r=t.slice(0,n),s=t.slice(n);pg(r,e),pg(s,e);let i=0,o=0,a=0;for(;i<r.length&&o<s.length;)e(r[i],s[o])<=0?t[a++]=r[i++]:t[a++]=s[o++];for(;i<r.length;)t[a++]=r[i++];for(;o<s.length;)t[a++]=s[o++];return t}function xk(t,e,n=0){let r=e?[n]:[];for(let s=0;s<t.length;s++){let i=t.charCodeAt(s);(i===13||i===10)&&(i===13&&s+1<t.length&&t.charCodeAt(s+1)===10&&s++,r.push(n+s+1))}return r}function Mk(t){let e=t.start,n=t.end;return e.line>n.line||e.line===n.line&&e.character>n.character?{start:n,end:e}:t}function c1(t){let e=Mk(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var fd=["namespace","class","enum","interface","struct","typeParameter","type","parameter","variable","property","enumMember","decorator","event","function","method","macro","label","comment","string","keyword","number","regexp","operator"],hd=["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"];var gd=Y(Q());var mg=Y(require("url")),Lk=require("crypto"),$k=require("path"),mi=(t,e,n=!0,r=!0)=>({start:{line:t?.pos.line??0,character:n?t?.pos.col??0:(t?.pos.col??0)+(t?.pos.len??0)},end:{line:e?.pos.line??0,character:r?(e?.pos.col??0)+(e?.pos.len??0):e?.pos.col??0}});var te=t=>mi(t.tokenIndexes.start,t.tokenIndexes.end),qk=" ",jk=t=>{qk=t},So=()=>qk,gi=t=>fd.findIndex(e=>e===t),yi=t=>hd.findIndex(e=>e===t),gg=(t,e,n)=>!le(t.uri,e)||n.line<t.pos.line?!1:n.line>t.pos.line?!0:n.character>t.pos.colEnd,l1=(t,e,n)=>le(t.uri,e)?n.line<t.pos.line?!0:n.line>t.pos.line?!1:n.character<t.pos.col:!1,xn=(t,e,n)=>!!(le(t.uri,e)&&t.tokenIndexes?.start&&t.tokenIndexes?.end&&(t.tokenIndexes.start.pos.line<n.line||t.tokenIndexes.start.pos.line===n.line&&t.tokenIndexes.start.pos.col<=n.character)&&(t.tokenIndexes.end.pos.line>n.line||t.tokenIndexes.end.pos.line===n.line&&t.tokenIndexes.end.pos.colEnd>=n.character)),Fk=(t,e,n)=>!!(le(t.uri,e)&&t.lastToken.value!==";"&&t.tokenIndexes?.start&&t.tokenIndexes?.end&&(t.tokenIndexes.start.pos.line===n.line||t.tokenIndexes.end.pos.line===n.line)&&n.character>=t.tokenIndexes.end.pos.colEnd),Bk=(t,e,n)=>{if(!t)return!1;let s=t.filter(i=>i.pos.line===n.line).at(-1);return s&&s.pos.col>=n.character?!1:e.tokenIndexes?.end===s};var Or=(t,e,n)=>{let r=t,s=t;for(;s;)r=s,s=[...r.children].reverse().find(i=>xn(i,e,n));return r},Wa=(t,e,n)=>{let r=t,s=t;for(;s;)r=s,s=[...r.children].find(i=>l1(i.lastToken,e,n));return r===t?void 0:r},Ha=(t,e,n)=>{let r=t,s=t;for(;s;)r=s,s=[...r.children].reverse().find(i=>gg(i.firstToken,e,n));return r===t?void 0:r},W=(t,e,n=gd.DiagnosticSeverity.Error,r=[],s=void 0,i=[],o,a)=>{let c={issues:Array.isArray(t)?t:[t],astElement:e,severity:n,linkedTo:r,tags:s,templateStrings:i,edit:o,codeActionTitle:a},l,u=()=>(l??={severity:c.severity,range:te(c.astElement),message:c.issues?c.issues.map(d1).join(" or "):"",source:"devicetree",tags:c.tags,data:{firstToken:{pos:c.astElement.firstToken.pos,tokens:c.astElement.firstToken.tokens,value:c.astElement.firstToken.value},lastToken:{pos:c.astElement.lastToken.pos,tokens:c.astElement.lastToken.tokens,value:c.astElement.lastToken.value},issues:{type:"SyntaxIssue",items:c.issues,edit:c.edit,codeActionTitle:c.codeActionTitle}}},l);return c.astElement.issues.push(u),{raw:c,diagnostic:u}},Lt=(t,e,n=gd.DiagnosticSeverity.Error,r=[],s=void 0,i=[],o,a)=>{let c={issues:Array.isArray(t)?t:[t],astElement:e,severity:n,linkedTo:r,tags:s,templateStrings:i,edit:o,codeActionTitle:a},l,u=()=>(l??={severity:c.severity,range:te(c.astElement),message:f1(c),source:"devicetree",tags:c.tags,relatedInformation:[...c.linkedTo.map(d=>({message:c.issues.map(h1).join(" or "),location:{uri:fe(d.uri),range:te(d)}}))]},l);return c.astElement.issues.push(u),{raw:c,diagnostic:u}},$=(t,e,n=gd.DiagnosticSeverity.Error,r=[],s=void 0,i=[],o,a)=>{let c={issues:Array.isArray(t)?t:[t],astElement:e,severity:n,linkedTo:r,tags:s,templateStrings:i,edit:o,codeActionTitle:a},l,u=()=>(l??={severity:c.severity,range:te(c.astElement),message:p1(c),relatedInformation:[...c.linkedTo.map(d=>({message:c.issues.map(m1).join(" or "),location:{uri:fe(d.uri),range:te(d)}}))],source:"devicetree",tags:c.tags,data:{firstToken:{pos:c.astElement.firstToken.pos,tokens:c.astElement.firstToken.tokens,value:c.astElement.firstToken.value},lastToken:{pos:c.astElement.lastToken.pos,tokens:c.astElement.lastToken.tokens,value:c.astElement.lastToken.value},issues:{type:"StandardTypeIssue",items:c.issues,edit:c.edit,codeActionTitle:c.codeActionTitle}}},l);return c.astElement.issues.push(u),{raw:c,diagnostic:u}},Uk=(t,e)=>[...t].sort((r,s)=>{let i=e.getSortKey(r),o=e.getSortKey(s);if(i===void 0||o===void 0)throw new Error("Sort keys must be set");if(i!==o)return i-o;if(!r.tokenIndexes?.end||!s.tokenIndexes?.end)throw new Error("Must have token indexes");return r.tokenIndexes.end.pos.line!==s.tokenIndexes.end.pos.line?r.tokenIndexes.end.pos.line-s.tokenIndexes.end.pos.line:r.tokenIndexes.end.pos.col-s.tokenIndexes.end.pos.col});async function Dt(t,e,n){let r=et(t.textDocument.uri);if(!e)return[];console.time("search");let i=(await e.getRuntime()).getDeepestAstNode(r,t.position),o=e.getSortKey(i?.ast);return console.timeEnd("search"),n(i,c=>{let l=t.position;return le(c.uri,r)?!!(c.tokenIndexes?.end&&(c.tokenIndexes.end.pos.line<l.line||c.tokenIndexes.end.pos.line===l.line&&c.tokenIndexes.end.pos.colEnd<=l.character)):o!==void 0&&(e.getSortKey(c)??-1)<=o})}function G(t,e){return{start:t,end:e??t}}var q=(t,e)=>t?.tokens.some(n=>n===e),it=t=>e=>e?.value&&t===e.value?"yes":u1(t)(e),Ie=t=>e=>e?.tokens.some(n=>n===t)?"yes":"no",u1=t=>e=>e?.value&&t.startsWith(e.value)?"partial":"no",Ir=(t,e)=>!!t&&!!e&&t.pos.line===e.pos.line&&le(t.uri,e.uri),cn=(t,e)=>!!t&&!!e&&Ir(t,e)&&t.pos.colEnd===e.pos.col,yd=t=>t.map((e,n)=>({index:n,context:e,files:e.getContextFiles()})),ur=(t,e,n,r)=>{if("id"in e){let i=t?.find(o=>o.id===e.id);return i||void 0}if("name"in e){let i=t?.find(o=>o.ctxNames.includes(e.name));return i||void 0}return n?.getContextFiles().find(i=>le(i,e.uri))?n:yd(t).sort(i=>i.context.id===r?-1:0).find(i=>i.files.some(o=>le(o,e.uri)))?.context},yg=(t,e)=>yd(t).filter(r=>r.files.some(s=>le(s,e))).map(r=>r.context),Vk=t=>{let e=/^(\w+)\s+(.+)$/,n=/^(\w+)\(([^)]*)\)\s+(.+)$/,r=/^(\w+)\(([^)]*),\s*\.\.\.\)\s+(.+)$/,s;if(s=r.exec(t)){let[,,i,o]=s,a=i.split(",").map(c=>c.trim());return(...c)=>{let l=o;return a.forEach((u,d)=>{let f=new RegExp(`\\b${u}\\b`,"g");l=l.replace(f,c[d])}),l=l.replace(/__VA_ARGS__/g,c.slice(a.length).join(", ")),l}}else if(s=n.exec(t)){let[,,i,o]=s,a=i.split(",").map(c=>c.trim());return(...c)=>{let l=o;return a.forEach((u,d)=>{let f=new RegExp(`\\b${u}\\b`,"g");l=l.replace(f,c[d])}),l}}else if(s=e.exec(t)){let[,,i]=s;return i.trim()}},zk=(t,e)=>{let n=o=>o.replace(/(\w+)\s*##\s*(\w+)/g,(a,c,l)=>c+l),r=o=>o.replace(/#(\w+)/g,(a,c)=>`"${c}"`),s=t,i;do i=s,s=n(i),s=r(s),s=s.replace(/\b(\w+)\(([^)]*)\)|\b(\w+)\b/g,(o,a,c,l)=>{if(a==="defined"){let u=c.split(",").map(d=>d.trim());return u[0]?e.get(u[0])?.resolver:u}else if(a&&typeof e.get(a)?.resolver=="function"){let u=c.split(",").map(d=>d.trim());return(e.get(a)?.resolver)(...u)}else if(l&&typeof e.get(l)?.resolver=="string")return e.get(l)?.resolver;return o});while(s!==i);return s},fe=t=>mg.default.pathToFileURL(t).toString(),et=t=>Ze(mg.default.fileURLToPath(t)),le=(t,e)=>!t||!e?!1:t===e,Ze=t=>(0,$k.normalize)(process.platform==="win32"?t.toLowerCase():t),Zr=t=>(0,Lk.createHash)("sha256").update([Ze(t.dtsFile),...t.includePaths.map(Ze),...t.overlays.map(Ze),t.bindingType,...t.zephyrBindings.map(Ze),...t.deviceOrgBindingsMetaSchema.map(Ze),...t.deviceOrgTreeBindings.map(Ze)].join(":")).digest("hex"),d1=t=>{switch(t){case 0:return"Expected value";case 1:return"Expected ';'";case 2:return"Expected '{'";case 3:return"Expected '}'";case 4:return"Expected '['";case 5:return"Expected ']'";case 12:return"Expected '>'";case 13:return"Expected '<'";case 16:return`Expected '"'`;case 17:return`Expected "'"\\`;case 24:return"Missing ':'";case 21:return"Missing '/'";case 26:return'Expected ")"';case 28:return'Missing ","';case 6:return"Expected property name";case 7:return"Expected node name";case 8:return"Expected node address";case 9:return"Expected node path";case 10:return"Expected node reference";case 11:return"Expected root node name";case 14:return"Expected bytestring";case 15:return"Expected two digits for each byte in bytestring";case 20:return"Hex values are not allowed";case 18:return"Expected label name";case 19:return"Expected '/' at the start of a node path";case 23:return"Found ';' without a statement";case 25:return"Did you mean /delete-node/ or /delete-property/?";case 34:return"Did you mean /delete-node/?";case 35:return"Did you mean /delete-property/?";case 22:return"Unknown syntax";case 27:return"Expected expression";case 31:return"Expected macro identifier";case 30:return"Expected macro identifier or function like macro";case 29:return"White space is not allowed";case 32:return"Properties can only be defined in a node";case 33:return"Properties can only be deleted inside a node";case 36:return"Unable to resolve include";case 37:return"Expected start address";case 38:return"Expected end address";case 39:case 40:return"Expected 8|16|32|64";case 42:return"Unknown macro name";case 43:return"Expected function like macro";case 44:return"Macro expects less arguments";case 45:return"Macro expects more arguments";case 46:return"Missing #ENDIF";case 47:return"Block Unused";case 41:return"This syntax is not officially part of the DTS V0.4 standard"}},f1=t=>t.issues.map(e=>{switch(e){case 0:return`Property "${t.templateStrings[0]}" is replaced by a later definition`;case 1:return"Cannot delete a property before it has been defined";case 2:return"Node name already defined";case 5:return"Cannot delete a node before it has been defined";case 3:return`No node with that reference "${t.templateStrings[0]}" has been defined`;case 8:return`No node with name "${t.templateStrings[0]}" could be found in "/${t.templateStrings[1]}".`;case 4:return`Label name "${t.templateStrings[0]}" already defined`;case 6:return`Property "${t.templateStrings[0]}" was deleted`;case 7:return`Node "${t.templateStrings[0]}" was deleted`;case 9:return`The following node "${t.templateStrings[1]}" shall be present in "${t.templateStrings[0]}" node.`}}).join(" or "),h1=t=>{switch(t){case 0:return"Property name already defined.";case 2:return"Defined here";case 4:return"Defined here";case 7:case 6:return"Deleted here";case 9:return"Node";default:return"TODO"}},p1=t=>t.issues.map(e=>{switch(e){case 9:return`Only these value are allowed ${t.templateStrings[0]}`;case 1:return"INTRO should be empty";case 8:return"INTRO can only be assigned one value";case 5:return"INTRO should be assigned a U32";case 6:return"INTRO should be assigned a U64";case 7:return"INTRO should be assigned a 'property encoded array'";case 2:return"INTRO should be assigned a string";case 3:return"INTRO should be assigned a string list";case 4:return`INTRO expects ${t.templateStrings[1]} values`;case 0:return"INTRO is required";case 11:return"INTRO should be omitted";case 27:return"INTRO name is not permitted under this node";case 10:return"INTRO address value must match node address";case 12:return"INTRO should be 'cpu'";case 13:return"INTRO should be 'memory'";case 14:return"INTRO is deprecated and should not be used'";case 15:return`INTRO ${t.templateStrings[1]}'`;case 18:return"INTRO value must be unique in the entire Devicetree";case 19:return`INTRO should have format ${t.templateStrings[1]}`;case 16:return`INTRO requires property "${t.templateStrings[1]}" in node path "${t.templateStrings[2]}"`;case 17:return"Unable to resolve interrupt parent node";case 20:return`INTRO should have format ${t.templateStrings[1]}`;case 21:return"Node is disabled";case 22:return"Unable to resolve handle";case 23:return`Unable to find "${t.templateStrings[0]}" in ${t.templateStrings[1]}`;case 24:return t.templateStrings[0];case 25:return t.templateStrings[0];case 26:return t.templateStrings[0];case 28:return t.templateStrings[0];case 29:return`INTRO exceeds address space avalable for this mapping. The range ends at ${t.templateStrings[2]}, the node ends at ${t.templateStrings[1]}`;case 30:return"Map entry overlaps with others entries";case 31:return"Unable to match to a nexus map entry"}}).join(" or ").replace("INTRO",`Property "${t.templateStrings[0]}"`).replaceAll("INTRO ",""),m1=t=>{switch(t){case 16:case 0:return"Node";case 15:return"Ignored reason";case 18:return"Conflicting properties";case 8:return"Additional value";case 21:return"Disabled by";case 29:return"Mapping range";case 30:return"Map entry";case 31:return"Nexus map entries";default:return"TODO"}},Ar=(t,e)=>{let n=Math.max(t.length,e.length);for(let r=0;r<n;r++){let s=t[t.length-n+r]??0,i=e[e.length-n+r]??0;if(s<i)return-1;if(s>i)return 1}return 0},ws=(t,e)=>{let n=Math.max(t.length,e.length),r=new Array(n).fill(0),s=0;for(let i=0;i<n;i++){let o=t[t.length-1-i]??0,a=e[e.length-1-i]??0,c=o+a+s;r[n-1-i]=c>>>0,s=c>4294967295?1:0}return s&&r.unshift(1),r},g1=(t,e)=>{let n=Math.max(t.length,e.length),r=new Array(n).fill(0),s=0;for(let i=0;i<n;i++){let o=t[t.length-1-i]??0,a=e[e.length-1-i]??0;o-=s,o<a?(o+=4294967296,s=1):s=0,r[n-1-i]=o-a>>>0}for(;r.length>1&&r[0]===0;)r.shift();return r},y1=(t,e)=>ws(t,e),Wk=(t,e)=>{let n=[];for(let r of t){let s=r.childAddress,i=r.length,o=ws(s,i);if(Ar(e,s)>=0&&Ar(e,o)<0){let a=g1(e,s),c=r.parentAddress,l=y1(c,a),u=ws(c,i);n.push({start:l,end:u,ast:r.ast})}}return n};var Zt=class{constructor(e,n,r){this.uri=e;this.range=n;this.issues=r}},bd=class extends Zt{constructor(n,r,s,i){super(r,s,i);this.value=n;this.type="STRING"}},vd=class extends Zt{constructor(n,r,s,i){super(r,s,i);this.values=n;this.type="BYTESTRING"}},Td=class extends Zt{constructor(n,r,s,i){super(r,s,i);this.value=n;this.type="ARRAY_VALUE"}},_d=class extends Zt{constructor(n,r,s,i,o){super(s,i,o);this.label=n;this.nodePath=r;this.type="LABEL_REF"}},Sd=class extends Zt{constructor(n,r,s,i){super(r,s,i);this.nodePath=n;this.type="NODE_PATH"}},Ed=class extends Zt{constructor(n,r,s,i,o){super(s,i,o);this.value=n;this.evaluated=r}},wd=class extends Ed{constructor(n,r,s,i,o){super(n,r,s,i,o);this.type="NUMBER_VALUE"}},kd=class extends Ed{constructor(n,r,s,i,o){super(n,r,s,i,o);this.type="EXPRESSION"}},Nd=class extends Zt{constructor(n,r,s,i){super(r,s,i);this.value=n}},Pd=class extends Zt{constructor(n,r,s,i,o){super(s,i,o);this.name=n;this.values=r}},Rd=class extends Zt{constructor(n,r,s,i){super(r,s,i);this.address=n}},Dd=class extends Zt{constructor(n,r,s,i,o,a){super(i,o,a);this.fullName=n;this.name=r;this.address=s}},Cd=class extends Zt{constructor(n,r,s,i){super(r,s,i);this.name=n}};var Ga=class extends Zt{constructor(n,r,s,i,o,a,c){super(o,a,c);this.type=n;this.name=r;this.properties=s;this.nodes=i}},Ad=class extends Ga{constructor(e,n,r,s,i,o){super("REF",e,n,r,s,i,o)}},Od=class extends Ga{constructor(e,n,r,s,i){super("ROOT",null,e,n,r,s,i)}},Id=class extends Ga{constructor(e,n,r,s,i,o){super("CHILD",e,n,r,s,i,o)}};var Tn=Y(Q()),j=class{constructor(e){this._children=[];this.issues=[];this._fisrtToken=e?.start,this._lastToken=e?.end}addIssue(e){this.issues.push(e)}get serializeIssues(){return this.issues.map(e=>e())}get firstToken(){return this._fisrtToken??this._children[0].tokenIndexes.start}set firstToken(e){this._fisrtToken=e}get lastToken(){return this._lastToken??this._children.at(-1)?.lastToken??this.firstToken}set lastToken(e){this._lastToken=e}get uri(){return this.firstToken.uri}getTopMostAstNodeForFile(e){return le(e,this.uri)?[this]:this.children.flatMap(n=>n.getTopMostAstNodeForFile(e))}get tokenIndexes(){return{start:this.firstToken,end:this.lastToken}}getDocumentSymbols(e){if(!this.docSymbolsMeta)return this.children.flatMap(r=>r.getDocumentSymbols(e)??[]);if(!le(this.uri,e))return[];let n=te(this);return[{name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind,range:n,selectionRange:n,children:[...this.children.flatMap(r=>r.getDocumentSymbols(e)??[])]}]}getWorkspaceSymbols(){if(!this.docSymbolsMeta)return this.children.flatMap(r=>r.getWorkspaceSymbols()??[]);let e=this.docSymbolsMeta.kind;if(![Tn.SymbolKind.File,Tn.SymbolKind.Class,Tn.SymbolKind.Namespace].some(r=>r===e))return[];let n=te(this);return[{location:Tn.Location.create(fe(this.uri),n),name:this.docSymbolsMeta.name?this.docSymbolsMeta.name:"__UNSET__",kind:this.docSymbolsMeta.kind},...this.children.flatMap(r=>r.getWorkspaceSymbols()??[]).filter(r=>r.kind===Tn.SymbolKind.File||r.kind===Tn.SymbolKind.Class||r.kind===Tn.SymbolKind.Namespace)]}buildSemanticTokens(e){this._children.forEach(n=>n.buildSemanticTokens(e)),!(!this.semanticTokenType||!this.semanticTokenModifiers)&&e(gi(this.semanticTokenType),yi(this.semanticTokenModifiers),this.tokenIndexes)}get children(){return this._children}get allDescendants(){return this.allDescendantsCache??=[...this._children,...this._children.flatMap(e=>e.allDescendants)],this.allDescendantsCache}addChild(e){e&&(e.parentNode=this,this.children.push(e)),this.allDescendantsCache=void 0}toPrettyString(e){return this.toString()}toString(e){return"TODO"}get range(){return Tn.Range.create(Tn.Position.create(this.firstToken.pos.line,this.firstToken.pos.col),Tn.Position.create(this.lastToken.pos.line,this.lastToken.pos.colEnd))}serialize(e){return new Zt(this.uri,this.range,this.serializeIssues)}};var dr=Y(Q());var Xk=Y(Q());var Hk=Y(Q());var Le=class extends j{constructor(n,r){super(r);this.value=n;this.semanticTokenType="string",this.semanticTokenModifiers="declaration",this.docSymbolsMeta={name:this.value,kind:Hk.SymbolKind.String}}toString(){return`"${this.value.toString()}"`}toJson(){return this.value}serialize(){return new bd(this.value,this.uri,this.range,this.serializeIssues)}};var Kk=Y(Q());var Gk=Y(Q());function b1(t){return t.replace(/'(.)'/g,(e,n)=>n.charCodeAt(0).toString()).replace(/(0x[a-f\d]+|\d+)[ul]*/gi,"$1")}function bg(t){try{return(0,eval)(b1(t))}catch(e){console.log(e)}return t}var ft=class extends j{toJson(){return-1}resolve(e){return zk(this.toString(),e)}evaluate(e){return bg(this.resolve(e))}isTrue(e){return bg(`!!(${this.resolve(e)})`)}toPrettyString(e){let n=this.evaluate(e);return`${n.toString()} /* ${this.toString()}${typeof n=="number"?` = 0x${n.toString(16)}`:""} */`}serialize(e){return new kd(this.toString(),this.evaluate(e),this.uri,this.range,this.serializeIssues)}},bi=class extends ft{constructor(n,r,s){super();this.expression=n;this.wrapped=r;this.join=s;this.addChild(n),s&&(this.addChild(s.operator),this.addChild(s.expression))}addExpression(n,r){this.addChild(n),this.addChild(r)}toString(){let n=this.children.map(r=>r.toString()).join(" ");return this.wrapped?`(${n})`:`${n}`}isTrue(n){let r=`(${this.children.map(s=>s instanceof ft?s.resolve(n):s.toString()).join(" ")})`;return bg(`!!${r}`)}};var Ut=class extends ft{constructor(n,r){super(r);this.value=n;this.docSymbolsMeta={name:this.value.toString(),kind:Gk.SymbolKind.Number},this.semanticTokenType="number",this.semanticTokenModifiers="declaration"}toString(n){return this.value.toString(n)}toJson(){return this.value}toPrettyString(n){let r=this.evaluate(n);return`${r.toString()} /* ${typeof r=="number"?`0x${r.toString(16)}`:""} */`}serialize(){return new wd(this.value.toString(),this.value,this.uri,this.range,this.serializeIssues)}};var Ct=class extends j{constructor(n){super();this.values=n;this.docSymbolsMeta={name:"Cell Array",kind:Kk.SymbolKind.Array},this.values.forEach(r=>this.addChild(r))}toString(){return`<${this.values.map(n=>n.toString()).join(" ")}>`}toPrettyString(n){return`<${this.values.map(r=>r.toPrettyString(n)).join(" ")}>`}toJson(){if(this.values.length===1)return this.values[0].value?.toJson();if(this.values.length===2&&this.values.every(n=>n.value instanceof Ut)){let n=new ArrayBuffer(8),r=new DataView(n);return this.values.map(s=>s.value.value).forEach((s,i)=>{r.setUint32(i*4,s)}),r.getBigUint64(0)}return this.values.map(n=>n.value?.toJson()??NaN)}serialize(n){let r=this.values.map(s=>s.value?.serialize(n)??null);return new Td(r,this.uri,this.range,this.serializeIssues)}};var Yk=Y(Q());var ks=class extends j{constructor(n){super();this.values=n;this.docSymbolsMeta={name:"Byte String Value",kind:Yk.SymbolKind.Array},this.values.forEach(r=>this.addChild(r))}toString(){return`[${this.values.map(n=>n.toString(16).padStart(2,"0")).join(" ")}]`}toJson(){return this.values.map(n=>n.value?.toJson()??NaN)}serialize(){return new vd(this.values.map(n=>n.value?{value:n.value.toString(16),range:n.value.range,evaluated:n.value.value}:null),this.uri,this.range,this.serializeIssues)}};var Ve=class extends j{constructor(n,r){super(r);this.name=n;this.semanticTokenType="property",this.semanticTokenModifiers="declaration"}toString(){return this.name}serialize(){return new Nd(this.name,this.uri,this.range,this.serializeIssues)}},$e=class extends j{constructor(n,r=[]){super();this.propertyName=n;this.labels=r;this._values=void 0;this.docSymbolsMeta={name:this.propertyName?.name??"Unknown",kind:Xk.SymbolKind.Property},this.labels.forEach(s=>this.addChild(s)),this.addChild(n)}set values(n){if(this._values)throw new Error("Only one property name is allowed");this._values=n,this.addChild(n)}get values(){return this._values}get quickValues(){return this.values?.values.map(n=>n?n.value instanceof Le?n.value.value:n.value instanceof Ct?n.value.values.map(r=>r.value instanceof Ut?r.value.value:NaN):n.value instanceof ks?n.value.values.map(r=>r.value?.value??NaN):NaN:null)}toString(){return`${this.propertyName?.toString()??"__UNSET__"}${this.assignOperatorToken?` = ${this._values?.values.map(n=>n?.toString()??"NULL").join(", ")??"NULL"}`:""};`}toPrettyString(n){return`${this.propertyName?.toString()??"__UNSET__"}${this.assignOperatorToken?` = ${this._values?.values.map(r=>r?.toPrettyString(n)??"NULL").join(", ")??"NULL"}`:""};`}serialize(n){return new Pd(this.propertyName?.serialize()??null,this.values?.values.map(r=>r?.value?.serialize(n)??null)??null,this.uri,this.range,this.serializeIssues)}};var Jk=Y(Q()),ln=class extends j{constructor(n,r){super();this.keyword=r;this.addChild(r),this.docSymbolsMeta={name:n,kind:Jk.SymbolKind.Function}}};var _n=class extends ln{constructor(n){super("Delete Node",n);this._nodeNameOrRef=null}set nodeNameOrRef(n){if(this._nodeNameOrRef)throw new Error("Only one property name is allowed");this._nodeNameOrRef=n,this.addChild(n)}get nodeNameOrRef(){return this._nodeNameOrRef}};var Ke=class extends ln{constructor(n){super("Delete Property",n);this._propertyName=null}set propertyName(n){if(this._propertyName)throw new Error("Only only property name is allowed");this._propertyName=n,this.addChild(n)}get propertyName(){return this._propertyName}};var ze=class t extends j{constructor(){super()}get path(){if(!this.pathName)return["__UNDEFINED__"];if(!this.parentNode||this instanceof vt)return[this.pathName];if(!(this.parentNode instanceof t))return;let e=this.parentNode.path;return e?[...e,this.pathName]:[this.pathName]}get pathName(){}get nodes(){return this.children.filter(e=>e instanceof t)}get deleteNodes(){return this.children.filter(e=>e instanceof _n)}addNodeChild(e){this.addChild(e)}},vt=class extends ze{constructor(){super(),this.docSymbolsMeta={name:"/",kind:dr.SymbolKind.Class}}get properties(){return this.children.filter(e=>e instanceof $e)}get name(){return new qe("/",G(this.firstToken))}get deleteProperties(){return this.children.filter(e=>e instanceof Ke)}get nodes(){return this.children.filter(e=>e instanceof Ae)}get pathName(){return"/"}serialize(e){return new Od(this.properties.map(n=>n.serialize(e)),this.nodes.map(n=>n.serialize(e)),this.uri,this.range,this.serializeIssues)}},$t=class extends ze{constructor(n=[]){super();this.labels=n;this._labelReference=null;this.docSymbolsMeta={name:"DTC Name",kind:dr.SymbolKind.Class},n.forEach(r=>{super.addChild(r)})}get serializeIssues(){return[...this.issues,...this.labelReference?.issues??[]].map(n=>n())}set labelReference(n){if(this._labelReference)throw new Error("Only on label reference is allowed");this._labelReference=n,this.docSymbolsMeta={name:this.labelReference?.value??"DTC Name",kind:dr.SymbolKind.Class},this.addChild(n)}get path(){return this.resolveNodePath?this.resolveNodePath:super.path}get labelReference(){return this._labelReference}get nodes(){return this.children.filter(n=>n instanceof Ae)}get pathName(){return this.labelReference?.label?`&${this.labelReference?.label?.value}`:void 0}get properties(){return this.children.filter(n=>n instanceof $e)}get deleteProperties(){return this.children.filter(n=>n instanceof Ke)}serialize(n){return new Ad(this.labelReference?.serialize()??null,this.properties.map(r=>r.serialize(n)),this.nodes.map(r=>r.serialize(n)),this.uri,this.range,this.serializeIssues)}},Ae=class t extends ze{constructor(n=[],r){super();this.labels=n;this.omitIfNoRef=r;this._name=null;this.docSymbolsMeta={name:"DTC Name",kind:dr.SymbolKind.Class},r&&this.addChild(r),n.forEach(s=>{this.addChild(s)})}get serializeIssues(){return[...this.issues,...this.name?.issues??[]].map(n=>n())}set name(n){if(this._name)throw new Error("Only on label reference is allowed");this._name=n,this.docSymbolsMeta={name:this._name?.toString()??"DTC Name",kind:dr.SymbolKind.Class},this.addChild(n)}get name(){return this._name}get nodes(){return this.children.filter(n=>n instanceof t)}get pathName(){return this._name?.toString()}get properties(){return this.children.filter(n=>n instanceof $e)}get deleteProperties(){return this.children.filter(n=>n instanceof Ke)}serialize(n){return new Id(this.name?.serialize()??null,this.properties.map(r=>r.serialize(n)),this.nodes.map(r=>r.serialize(n)),this.uri,this.range,this.serializeIssues)}},xd=class extends j{constructor(n,r){super(r);this.address=n;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.address?.map((n,r)=>n.toString(16).padStart(r?8:0,"0")).join("")??"NaN"}serialize(){return new Rd(this.address,this.uri,this.range,this.serializeIssues)}},qe=class extends j{constructor(n,r,s){super(r);this.name=n;this._address=s;this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}get value(){return this.name}get address(){return this._address}set address(n){if(this._address)throw new Error("Address can only be set once");n&&(this.lastToken=void 0,this._address=n,n.forEach(r=>this.addChild(r)))}get fullAddress(){return this._address?[...this._address.flatMap(n=>n.address)]:void 0}toString(){return this._address!==void 0?`${this.name}@${this._address.map(n=>n.toString()).join(",")}`:this.name}buildSemanticTokens(n){if(!this.tokenIndexes?.start||!this.tokenIndexes.start.value)return;let r={...this.tokenIndexes.start,pos:{...this.tokenIndexes.start.pos,len:this.name.length}};n(gi("type"),yi("declaration"),{start:r,end:r}),this.address!==void 0&&this.address.forEach(s=>{n(gi("decorator"),yi("declaration"),{start:s.lastToken.prevToken,end:s.lastToken.prevToken}),s.buildSemanticTokens(n)})}get serializeIssues(){return[...this.issues,...this._address?.flatMap(n=>n.issues)??[]].map(n=>n())}serialize(){return new Dd(this.toString(),new Cd(this.name,this.uri,dr.Range.create(dr.Position.create(this.tokenIndexes.start.pos.line,this.tokenIndexes.start.pos.col),dr.Position.create(this.tokenIndexes.start.pos.line,this.tokenIndexes.start.pos.colEnd)),[]),this.address?.map(n=>n.serialize())??null,this.uri,this.range,this.serializeIssues)}};var Qk=Y(Q());var be=class extends j{constructor(n){super();this.label=n;this.docSymbolsMeta={name:`&${this.label?.value??"NULL"}`,kind:Qk.SymbolKind.Key},this.addChild(n)}get value(){return this.label?.value}toString(){return`&${this.label?.value??"NULL"}`}toJson(){return-1}serialize(){return new _d(this.label?.toString()??null,this.linksTo?.pathString??null,this.uri,this.range,this.serializeIssues)}};var hr=Y(Q());var At=t=>t instanceof ln?!0:t instanceof ze?!1:t.parentNode?At(t.parentNode):!1;var Eo=t=>[...t.map(e=>{if(e instanceof Ae||e instanceof vt)return e.name;if(e instanceof $t)return e.labelReference})].filter(e=>!!e),vg=(t,e)=>e?e.parentNode===t||vg(t,e.parentNode):!1;var yt=Y(Q());var Zk=Y(Q());var es=class extends j{constructor(){super();this._pathParts=[]}addPath(n,r){this._pathParts.push(n),r&&this.addChild(r),this.addChild(n)}get pathParts(){return[...this._pathParts]}toString(){return this._pathParts.map(n=>n?.toString()??"<NULL>").join("/")}},Mn=class extends j{constructor(n){super();this.path=n;this.docSymbolsMeta={name:`/${this.path?.toString()??""}`,kind:Zk.SymbolKind.Namespace},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration",this.addChild(n)}toString(){return`&${this.path?.toString()??"NULL"}`}toJson(){return-1}serialize(){return new Sd(this.path?.toString()??null,this.uri,this.range,this.serializeIssues)}};var ht=Y(Q());var Md=Y(Q());var eN=require("path"),Ns=class extends j{constructor(n,r){super();this.keyword=n;this.path=r;this.docSymbolsMeta={name:`Include ${r}`,kind:Md.SymbolKind.File},this.addChild(n),this.addChild(r)}get resolvedPath(){return this._resolvedPath}set resolvedPath(n){this.docSymbolsMeta={name:`Include ${n}`,kind:Md.SymbolKind.File},this._resolvedPath=n}},wo=class extends j{constructor(n,r,s){super(s);this._path=n;this.relative=r;this.docSymbolsMeta={name:(0,eN.basename)(this.path),kind:Md.SymbolKind.File},this.semanticTokenType="string",this.semanticTokenModifiers="declaration"}get path(){return this.relative?this._path.slice(1,-1):this._path}};var xr=class extends j{constructor(e){super(e),this.semanticTokenType="comment",this.semanticTokenModifiers="documentation"}};var v1=async(t,e,n)=>{let r=ht.Position.create(t.pos.line,t.pos.col),s=n.find(i=>xn(i,e,r));if(s)return Or(s,e,r)},Tg=t=>{if(t)return t instanceof ze?t:Tg(t?.parentNode)},No=(t,e,n=0)=>!e||!le(e.uri,t)?n:No(t,Tg(e.parentNode),n+1),T1=(t,e)=>async n=>{let r=await v1(n.firstToken,e,t);return!r||r===n||n.allDescendants.some(i=>i===r)?0:r instanceof ze?No(e,Tg(r)):void 0};async function tN(t,e){let n=[],r=et(t.textDocument.uri),s=(await e.getRuntime()).fileTopMostAsts(r);return n.push(...(await Promise.all(s.flatMap(async i=>await nN(t,i,r,T1(s,r))))).flat()),n}var vi=(t,e=1)=>{if(t.prevToken){let n=t.pos.line-t.prevToken.pos.line;if(n-e&&(n!==2&&e!==0||e===0))return ht.TextEdit.replace(ht.Range.create(ht.Position.create(t.prevToken.pos.line,t.prevToken.pos.colEnd),ht.Position.create(t.pos.line-e,t.pos.col)),"".padEnd(e-1,`
183
+ `))}},ko=(t,e,n,r="")=>{if(t.pos.line===t.prevToken?.pos.line)return ht.TextEdit.replace(ht.Range.create(ht.Position.create(t.pos.line,t.pos.col),ht.Position.create(t.pos.line,t.pos.col)),`
184
+ ${r}${"".padStart(e*n.length,n)}`)},Ps=(t,e,n,r="")=>ht.TextEdit.replace(ht.Range.create(ht.Position.create(t.pos.line,0),ht.Position.create(t.pos.line,t.pos.col)),`${"".padStart(e*n.length,n)}${r}`),Nt=(t,e=1)=>{if(!t.nextToken)return[];if(t.nextToken?.pos.line!==t.pos.line){let r=vi(t.nextToken,0);if(!r)throw new Error("remove new LinesEdit must be defined");return[...e?[ht.TextEdit.insert(ht.Position.create(t.pos.line,t.pos.colEnd),"".padEnd(e," "))]:[],r]}return t.nextToken.pos.col-t.pos.colEnd===e?[]:[ht.TextEdit.replace(ht.Range.create(ht.Position.create(t.pos.line,t.pos.colEnd),ht.Position.create(t.nextToken.pos.line,t.nextToken.pos.col)),"".padEnd(e," "))]},_1=async(t,e,n,r,s,i)=>{if(!le(e.uri,n))return[];let o=[],a=ko(e.firstToken,r,s);if(a)o.push(a);else{o.push(Ps(e.firstToken,r,s));let l=vi(e.firstToken);l&&o.push(l)}if(e instanceof Ae||e instanceof $t)if(o.push(...e.labels.flatMap(l=>Nt(l.lastToken))),e instanceof Ae){let l=e.name&&e.openScope?Nt(e.name.lastToken):[];o.push(...l)}else{let l=e.labelReference&&e.openScope?Nt(e.labelReference.lastToken):[];o.push(...l)}if(o.push(...(await Promise.all(e.children.flatMap(l=>nN(t,l,n,i,r+1)))).flat()),e.closeScope){let l=ko(e.closeScope,r,s);if(l)o.push(l);else{o.push(Ps(e.closeScope,r,s));let u=vi(e.closeScope);u&&o.push(u)}}let c=e.lastToken.value===";"&&e.lastToken.prevToken?Nt(e.lastToken.prevToken,0):[];return o.push(...c),o},S1=(t,e,n,r)=>{let s=[];if(s.push(...Nt(t.lastToken,r?0:1)),t.firstToken.pos.line!==t.firstToken.prevToken?.pos.line){let i=vi(t.firstToken);i&&(s.push(i),s.push(Ps(t.firstToken,e+1,n)))}return t.value,s},E1=(t,e,n,r)=>{let s=[];return t instanceof Ct||t instanceof ks?(t.openBracket&&s.push(...Nt(t.openBracket,0)),s.push(...t.values.flatMap((i,o)=>S1(i,e,n,o+1===t.values.length&&t.lastToken.nextToken===t.closeBracket))),t.closeBracket&&t.closeBracket?.nextToken?.value!==";"&&t.openBracket&&s.push(...Nt(t.closeBracket,0))):t?.lastToken&&r&&s.push(...Nt(t.lastToken,t?.lastToken.nextToken?.value===","?0:1)),s},w1=(t,e,n,r)=>{let s=[];return s.push(...t.startLabels.flatMap((i,o)=>o+1===t.startLabels.length?[]:Nt(i.lastToken))),s.push(...E1(t.value,e,n,!r||t.endLabels.length>0)),s.push(...t.endLabels.flatMap((i,o)=>o+1===t.endLabels.length?[]:Nt(i.lastToken))),s},k1=(t,e,n)=>{let r=[],s=i=>{if(i&&xn(t,t.uri,ht.Position.create(i.pos.line,i.pos.col)))return i.value===","?i:s(i.nextToken)};return t.values.forEach((i,o)=>{if(!i)return[];let a=s(i.lastToken),c=t.values.at(o+1);if(a){if(a.pos.line===c?.firstToken?.pos.line)r.push(...Nt(a,1));else if(c?.firstToken){let l=vi(c?.firstToken);l&&r.push(l),r.push(Ps(c?.firstToken,e+1,n))}}}),[...r,...t.values.flatMap((i,o)=>i?w1(i,e,n,o+1===t.values.length):[])]},N1=(t,e,n)=>{let r=[],s=ko(t.firstToken,e,n);if(s)r.push(s);else{r.push(Ps(t.firstToken,e,n));let o=vi(t.firstToken);o&&r.push(o)}if(r.push(...t.labels.flatMap(o=>Nt(o.lastToken))),t.values){if(t.propertyName){r.push(...Nt(t.propertyName?.lastToken));let o=c=>c?c.value==="="?c:o(c.nextToken):void 0,a=o(t.propertyName?.lastToken.nextToken);a&&r.push(...Nt(a))}r.push(...k1(t.values,e,n))}let i=t.lastToken.value===";"&&t.lastToken.prevToken?Nt(t.lastToken.prevToken,0):[];return r.push(...i),r},P1=(t,e,n)=>{let r=[],s=ko(t.firstToken,e,n);s?r.push(s):r.push(Ps(t.firstToken,e,n));let i=Nt(t.keyword.lastToken);r.push(...i);let o=t.lastToken.value===";"&&t.lastToken.prevToken?Nt(t.lastToken.prevToken,0):[];return r.push(...o),r},R1=(t,e,n,r)=>{if(n===void 0)return[];if(!le(t.uri,e))return[];let s=[],i=ko(t.firstToken,n,r);i?s.push(i):s.push(Ps(t.firstToken,n,r));let o=Nt(t.keyword.lastToken);return s.push(...o),s},D1=(t,e,n)=>{let r=[];if(t.lastToken.pos.line===t.lastToken.nextToken?.pos.line&&t.lastToken.nextToken.value!==";"&&r.push(...Nt(t.lastToken)),e!==void 0&&t.firstToken.pos.line===t.firstToken.prevToken?.pos.line&&t.firstToken.pos.line===t.lastToken.pos.line)return r.push(...Nt(t.firstToken.prevToken)),r;if(e===void 0)return r;let s=t.firstToken.value.startsWith("*")?" ":"",i=ko(t.firstToken,e,n,s);if(i)r.push(i);else{r.push(Ps(t.firstToken,e,n,s));let o=vi(t.firstToken);o&&r.push(o)}return r},nN=async(t,e,n,r,s=0)=>{let i=t.options.tabSize,a=t.options.insertSpaces?"".padStart(i," "):" ";return jk(a),e instanceof ze?_1(t,e,n,s,a,r):e instanceof $e?N1(e,s,a):e instanceof ln?P1(e,s,a):e instanceof Ns?R1(e,n,await r(e),a):e instanceof xr?D1(e,await r(e),a):[]};function C1(t){switch(t){case"EMPTY":return"EMPTY";case"U32":return"U32";case"U64":return"U64";case"STRING":return"STRING";case"PROP_ENCODED_ARRAY":return"PROP_ENCODED_ARRAY";case"STRINGLIST":return"STRINGLIST";case"BYTESTRING":return"BYTESTRING";case"ANY":return"ANY";case"UNKNOWN":return"UNKNOWN"}}function A1(t){switch(t){case"EMPTY":return";";case"U32":return" = <10>";case"U64":return" = <10 20>";case"STRING":return' = "str"';case"PROP_ENCODED_ARRAY":return" = <10 20 30 ...>";case"STRINGLIST":return' = "str1" "str2"';case"BYTESTRING":return" = [10 20 .. ..]"}}var K=class{constructor(e,n,r="optional",s=void 0,i,o){this.name=e;this.type=n;this.def=s;this.additionalTypeCheck=o;this.hideAutoComplete=!1;this.list=!1;this.onHover=()=>({kind:yt.MarkupKind.Markdown,value:["### Type","**DTS native type** ",`${this.type.map(e=>e.types.map(C1).join(" or ")).join(",")}
185
185
 
186
186
  `,...this.bindingType?["**Binding type** ",`${this.bindingType}
187
187
 
188
- `]:[],"**Example** ","```",`${typeof this.name=="string"?this.name:"prop"}${this.typeExample?` = ${this.typeExample}`:`${this.type.map(e=>e.types.map(e$).join(" || ")).join(" ")}`};`,"```",...this.description?["### Description",this.description.join(`
188
+ `]:[],"**Example** ","```",`${typeof this.name=="string"?this.name:"prop"}${this.typeExample?` = ${this.typeExample}`:`${this.type.map(e=>e.types.map(A1).join(" || ")).join(" ")}`};`,"```",...this.description?["### Description",this.description.join(`
189
189
 
190
190
  `)]:[],...this.examples?["### Example",this.examples.join(`
191
191
 
192
192
  `)]:[]].join(`
193
- `)});typeof r!="function"?this.required=()=>r:this.required=r,typeof i!="function"?(this.allowedValues=i,this.values=()=>i===void 0?s?[s]:[]:s&&i.indexOf(s)===-1?[s,...i]:i):this.values=i}getNameMatch(e){return typeof this.name=="string"?this.name===e:this.name.test(e)}validateProperty(e,t,r,s){let i=this.required(t);if(s){if(i==="omitted")return[F(11,s.ast,ht.DiagnosticSeverity.Error,void 0,[],[r])]}else{if(i==="required"){let l=e.getOrderedNodeAst(t),u=go(l),d="";if(this.type.length===1&&this.type[0].types.length===1)switch(this.type[0].types[0]){case"U32":case"U64":case"PROP_ENCODED_ARRAY":d=" = <>";break;case"STRING":case"STRINGLIST":d=' = ""';break;case"BYTESTRING":d=" = []";break}return[...l.map((f,p)=>{let y=f.openScope??u[p].lastToken;return F(0,u[p],ht.DiagnosticSeverity.Error,[],[],[r],ht.TextEdit.insert(ht.Position.create(y.pos.line,y.pos.col+1),`
194
- ${"".padEnd(vo(u[p].uri,f)*mo().length,mo())}${r}${d};`))})]}return[]}let o=t$(s),a=[],c=(l,u,d)=>{if(d??=s.ast,!(l.some(p=>p==u)||l.some(p=>p=="STRINGLIST")&&(u==="STRING"||u==="STRINGLIST")||l.some(p=>p=="PROP_ENCODED_ARRAY")&&(u==="U32"||u==="U64"))){let p=[];l.forEach(y=>{switch(y){case"EMPTY":p.push(1);break;case"STRING":p.push(2);break;case"STRINGLIST":p.push(3);break;case"U32":p.push(5);break;case"U64":p.push(6);break;case"PROP_ENCODED_ARRAY":p.push(7);break}}),p.length&&a.push(F(p,d,ht.DiagnosticSeverity.Error,[],[],[s.name]))}};if(this.type[0].types.some(l=>l==="ANY"))return[];if(this.type.length>1){let l=this.type;!this.list&&this.type.length!==o.length?a.push(F(4,s.ast.values??s.ast,ht.DiagnosticSeverity.Error,[],[],[r,this.type.length.toString()])):o.forEach((u,d)=>{l[0].types.every(f=>f!==u)&&a.push(F(3,s.ast.values?.values[d]??s.ast))})}else{this.type[0].types.some(u=>u==="STRINGLIST")?o.some(u=>c(["STRINGLIST"],u,s.ast.values?.values[0]?.value)):this.list||this.type.length===1&&this.type[0].types.filter(u=>u!=="EMPTY").every(u=>u==="PROP_ENCODED_ARRAY")?o.some(u=>c(this.type[0].types,u,s.ast.values?.values[0]?.value)):o.length>1&&this.type[0].types.some(u=>u!=="EMPTY")?a.push(F(8,s.ast.propertyName??s.ast,ht.DiagnosticSeverity.Error,(s.ast.values?.values.slice(1)??[]).filter(u=>!!u),[],[s.name])):o.length===1&&c(this.type[0].types,o[0],s.ast.values?.values[0]?.value);let l=this.values(s);if(a.length===0&&(a.push(...this.additionalTypeCheck?.(s,e.context.macros)??[]),l.length&&this.type[0].types.some(u=>u==="STRING"))){let u=s.ast.values?.values[0]?.value;l.some(d=>u.value===d)||a.push(F(9,s.ast.values?.values[0]?.value??s.ast,ht.DiagnosticSeverity.Error,[],[],[this.values(s).map(d=>`'${d}'`).join(" or ")]))}}return a}getPropertyCompletionItems(e,t,r){let s=this.type.at(t);return s?.types.some(i=>i==="STRING")?e.ast.values?.values&&e.ast.values.values?.length>1?[]:this.values(e).map(i=>({label:r?`${i}`:`"${i}"`,kind:ht.CompletionItemKind.Variable,sortText:i===this.def?`A${i}`:`Z${i}`})):s?.types.some(i=>i==="U32"||i==="U64")?this.values(e).map(i=>({label:r?`${i}`:`<${i}>`,kind:ht.CompletionItemKind.Variable,sortText:i===this.def?`A${i}`:`Z${i}`})):[]}},t$=n=>n.ast.values?n.ast.values.values.map(e=>n$(e)):["EMPTY"],n$=n=>n?n.value instanceof Ie?"STRING":n.value instanceof St?n.value.values.length===1?"U32":n.value.values.length===2?"U64":"PROP_ENCODED_ARRAY":n.value instanceof ye||n.value instanceof In?"U32":"BYTESTRING":"UNKNOWN",ja=class{},Sn=class extends ja{constructor(t=()=>[]){super();this.additionalValidations=t;this.#e=[];this.noMismatchPropertiesAllowed=!1}#e;#t;getIssue(t,r){let s=[],i=r.getProperty("status"),o=i?.ast.values?.values.at(0)?.value;if(o instanceof Ie&&o.value==="disabled")return[...r.definitions,...r.referencedBy].forEach(l=>s.push(F(22,l,ht.DiagnosticSeverity.Hint,[...i?.ast.parentNode?[i?.ast.parentNode]:[]],[ht.DiagnosticTag.Unnecessary]))),s;let a=new Set,c=this.properties.flatMap(l=>{if(typeof l.name=="string"){let f=r.getProperty(l.name);return f&&a.add(f),l.validateProperty(t,r,l.name,f)}let u=r.property.filter(f=>l.getNameMatch(f.name));u.forEach(f=>a.add(f));let d=this.properties.filter(f=>f!==l)??[];return d.length&&u.filter(f=>d.some(p=>p.getNameMatch(f.name)))?[]:u.flatMap(f=>l.validateProperty(t,r,f.name,f))});return a.size!==r.property.length&&this.noMismatchPropertiesAllowed&&r.property.filter(u=>!a.has(u)).forEach(u=>{s.push(F(28,u.ast,ht.DiagnosticSeverity.Error,[],[],[u.name],ht.TextEdit.del(li(u.ast.firstToken.prevToken,u.ast.lastToken,!1))))}),[...s,...c,...this.additionalValidations(t,r)]}get properties(){return this.#e}addProperty(t){Array.isArray(t)?t.forEach(r=>this.#e.push(r)):this.#e.push(t),this.#e.sort((r,s)=>typeof r.name=="string"&&typeof s.name=="string"||typeof r.name!="string"&&typeof s.name!="string"?0:typeof r.name=="string"?-1:1)}get childNodeType(){return this.#t}set childNodeType(t){t&&(this.#t=r=>{let s=t(r);return s.bindingsPath=this.bindingsPath,s})}getOnPropertyHover(t){let r=this.properties.find(s=>s.getNameMatch(t));return r?.onHover.bind(r)()}getPropertyListCompletionItems(t){return this.properties.filter(r=>!r.hideAutoComplete&&r.required(t)!=="omitted"&&typeof r.name=="string").map(r=>{let s=t&&r.required(t),i=!!t.property.some(a=>r.getNameMatch(a.name)),o="a";return s?o=i?"Y":"A":o=i?"Z":"B",{label:`${r.name}`,kind:ht.CompletionItemKind.Property,sortText:`${o}${r.name}`}})??[]}};var ln=class extends q{constructor(t,r,s,i){super();this.startLabels=t;this.value=r;this.endLabels=s;this.bits=i;this.startLabels.forEach(o=>{this.addChild(o)}),this.addChild(i),this.addChild(r),this.endLabels.forEach(o=>{this.addChild(o)})}toString(){return`${[this.value?.toString()??"NULL",...this.endLabels.map(t=>t.toString())].join(" ")}`}toPrettyString(t){return`${[this.value?.toPrettyString(t)??"NULL",...this.endLabels.map(r=>r.toString())].join(" ")}`}toJson(){return this.value?.toJson()}};var Mt=n=>{if(!n?.values.some(e=>!(e?.value instanceof St)))return n?.values.flatMap(e=>e.value.values.map(t=>t.value))??[]},at=(n,e,t,r)=>{let s=n.ast.values?.values.at(e)?.value;if(s instanceof St){let i=s.values.at(t);if(i?.value instanceof Qt){let o=i.value.evaluate(r);if(typeof o=="number")return o}}},ur=(n,e,t=0)=>{if(n instanceof ln){if(n?.value instanceof St){let r=n.value.values.at(t);if(r?.value instanceof It)return e.getPhandle(r.value.value);if(r?.value instanceof ye)return r.value.linksTo;if(r?.value instanceof In)return r.value.path?.pathParts.at(-1)?.linksTo}}else{if(n instanceof It)return e.getPhandle(n.value);if(n instanceof ye)return n.linksTo;if(n instanceof In)return n.path?.pathParts.at(-1)?.linksTo}},Ak=n=>{let e=n.getProperty("#interrupt-cells"),t=e?.ast.values?.values.at(0)?.value;if(t instanceof St){let r=t.values.at(0)?.value;if(r instanceof It)return{cellsProperty:e,node:n,value:r.value}}return{cellsProperty:e,node:n}},W=n=>Array.isArray(n)?[{types:n}]:[{types:[n]}];var Ok=()=>{let n=new G("compatible",W("STRINGLIST"));return n.description=["The compatible property value consists of one or more strings that define the specific programming model for the device. This list of strings should be used by a client program for device driver selection. The property value consists of a concatenated list of null terminated strings, from most specific to most general. They allow a device to express its compatibility with a family of similar devices, potentially allowing a single device driver to match against several devices.",'The recommended format is "manufacturer, model", where manufacturer is a string describing the name of the manufacturer (such as a stock ticker symbol), and model specifies the model number.',"The compatible string should consist only of lowercase letters, digits and dashes, and should start with a letter. A single comma is typically only used following a vendor prefix. Underscores should not be used."],n.examples=['```devicetree\ncompatible = "fsl,mpc8641", "ns16550";\n```',"In this example, an operating system would first try to locate a device driver that supported fsl, mpc8641. If a driver was not found, it would then try to locate a driver that supported the more general ns 16550 device type."],n};var To=K(X()),Ik=()=>{let n=new G("device_type",W("STRING"),"optional",void 0,e=>e.parent.name==="cpu"||e.parent.name==="memory"?[e.parent.name]:[],e=>{if(e.parent.name==="cpu"||e.parent.name==="memory"){let t=e.ast.values?.values.at(0)?.value;if(t instanceof Ie&&t.value!==e.parent.name)return e.parent.name==="cpu"?[F(12,e.ast,To.DiagnosticSeverity.Error,[],[],[e.name])]:[F(13,e.ast,To.DiagnosticSeverity.Error,[],[],[e.name])]}return n.required(e.parent)!=="required"?[F(14,e.ast,To.DiagnosticSeverity.Hint,[],[To.DiagnosticTag.Deprecated],[e.name])]:[]});return n.description=["The device_type property was used in IEEE 1275 to describe the device's FCode programming model. Because DTSpec does not have FCode, new use of the property is deprecated, and it should be included only on cpu and memory nodes for compatibility with IEEE 1275-derived devicetrees."],n};var xk=()=>{let n=new G("#interrupt-cells",W("U32"));return n.description=["The #interrupt-cells property defines the number of cells required to encode an interrupt specifier for an interrupt domain."],n};var Mk=()=>{let n=new G("interrupt-controller",W("EMPTY"),"optional");return n.description=["The presence of an interrupt-controller property defines a node as an interrupt controller node."],n};var $k=()=>{let n=new G("interrupt-parent",W("U32"));return n.description=["Because the hierarchy of the nodes in the interrupt tree might not match the devicetree, the interrupt-parent property is available to make the definition of an interrupt parent explicit. The value is the phandle to the interrupt parent. If this property is missing from a device, its interrupt parent is assumed to be its devicetree parent."],n};var Lk=K(X()),qk=()=>{let n=new G("interrupts",W("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,e=>{let t=[],r=e.parent,s=r.getProperty("interrupt-parent"),i=r.root;return(s?ur(s?.ast.values?.values.at(0),i):r.parent)?t:s?(t.push(F(18,s.ast.values?.values.at(0)?.value??s.ast)),t):(t.push(F(16,e.ast,Lk.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"interrupt-parent",`/${e.parent.path.slice(1).join("/")}`])),t)});return n.description=["The interrupts property of a device node defines the interrupt or interrupts that are generated by the device.The value of the interrupts property consists of an arbitrary number of interrupt specifiers. The format of an interrupt specifier is defined by the binding of the interrupt domain root.","interrupts is overridden by the interrupts-extended property and normally only one or the other should be used."],n.examples=["A common definition of an interrupt specifier in an open PIC-compatible interrupt domain consists of two cells; an interrupt number and level/sense information. See the following example, which defines a single interrupt specifier, with an interrupt number of OxA and level/sense encoding of 8.","```devicetree\ninterrupts = <0xA 8>;\n```"],n};var So=K(X()),jk=()=>{let n=new G("interrupts-extended",W("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,e=>{let t=[],r=e.parent,s=r.getProperty("interrupts");s&&t.push(F(15,s.ast,So.DiagnosticSeverity.Warning,[e.ast],[],[s.name,"is ignored when 'interrupts-extended' is used"]));let i=r.getProperty("interrupt-parent");i&&t.push(F(15,i.ast,So.DiagnosticSeverity.Warning,[e.ast],[],[i.name,"is ignored when 'interrupts-extended' is used"]));let o=r.root,a=Mt(e.ast.values);if(!a?.length)return[];let c=0;for(;c<a.length;){let l=ur(a[c],o);if(!l)return t.push(F(18,a[c],So.DiagnosticSeverity.Error)),t;let u=Ak(l);if(!u.cellsProperty)return t.push(F(16,e.ast,So.DiagnosticSeverity.Error,[...u.node.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${u.node.path.slice(1).join("/")}`])),t;let d=a.length-c-1;if(u.value==null)return t;if(u.value!=null&&u.value>d)return t.push(F(17,a[c],So.DiagnosticSeverity.Error,[u.cellsProperty.ast],[],[e.name,u.value.toString()])),t;c+=u.value+1}return t});return n.description=["The interrupts-extended property lists the interrupts) generated by a device. interrupts-extended should be used instead of interrupts when a device is connected to multiple interrupt controllers as it encodes a parent phandle with each interrupt specifier.","The interrupts and interrupts-extended properties are mutually exclusive. A device node should use one or the other, but not both. Using both is only permissible when required for compatibility with software that does not understand interrupts-extended. If both interrupts-extended and interrupts are present then interrupts-extended takes precedence."],n.examples=["This example shows how a device with two interrupt outputs connected to two separate interrupt controllers would describe the connection using an interrupts-extended property. pic is an interrupt controller with an #interrupt-cells specifier of 2, while gic is an interrupt controller with an #interrupts-cells specifier of 1.","```devicetree\ninterrupts-extended = <&pic OXA 8>, <&gic Oxda>;\n```"],n};var Fk=()=>{let n=new G("dma-noncoherent",W("EMPTY"));return n.description=["For architectures which are by default coherent for 1/O, the dma-noncoherent property is used to indicate a device is not capable of coherent DMA operations. Some architectures have non-coherent DMA by default and this property is not applicable."],n};var Bk=()=>{let n=new G("dma-coherent",W("EMPTY"));return n.description=["For architectures which are by default non-coherent for I/O, the dma-coherent property is used to indicate a device is capable of coherent DMA operations. Some architectures have coherent DMA by default and this property is not applicable."],n};var cg=K(X()),Uk=()=>{let n=new G("dma-ranges",W(["EMPTY","PROP_ENCODED_ARRAY"]),"optional",void 0,void 0,(e,t)=>{let r=[],s=Mt(e.ast.values);if(!s?.length)return[];let i=e.parent.sizeCells(t),o=e.parent.addressCells(t),a=e.parent.parentAddressCells(t);if(n.typeExample=`<${[...Array.from({length:o},()=>"child-bus-address"),...Array.from({length:a},()=>"parent-bus-address"),...Array.from({length:a},()=>"length")].join(" ")}>`,(s.length===0||s.length%(o+a+i)!==0)&&r.push(F(20,s.at(s.length-s.length%(o+a+i))??e.ast,cg.DiagnosticSeverity.Error,[],[],[e.name,n.typeExample])),r.length===0){let c=e.parent.dmaRangeMap(t);c&&ld(c).forEach(l=>{r.push(F(32,l.mappingA.ast,cg.DiagnosticSeverity.Error,[l.mappingB.ast],[],[l.overlapOn]))})}return r});return n.description=["The dma-ranges property is used to describe the direct memory access (DMA) structure of a memory-mapped bus whose devicetree parent can be accessed from DMA operations originating from the bus. It provides a means of defining a mapping or translation between the physical address space of the bus and the physical address space of the parent of the bus.","The format of the value of the dma-ranges property is an arbitrary number of triplets of (child-bus-address, parent-bus-address, length). Each triplet specified describes a contiguous DMA address range.","- The child-bus-address is a physical address within the child bus' address space. The number of cells to represent the address depends on the bus and can be determined from the #address-cells of this node (the node in which the dma-ranges property appears).","- The parent-bus-address is a physical address within the parent bus' address space. The number of cells to represent the parent address is bus dependent and can be determined from the #address-cells property of the node that defines the parent's address space.","- The length specifies the size of the range in the child's address space. The number of cells to represent the size can be determined from the #size-cells of this node (the node in which the dma-ranges property appears)."],n};var Fa=K(X()),Rd=()=>{let n=new G("ranges",W(["EMPTY","PROP_ENCODED_ARRAY"]),"optional",void 0,void 0,(e,t)=>{let r=[],s=Mt(e.ast.values);if(!s?.length)return[];let i=e.parent.sizeCells(t),o=e.parent.addressCells(t),a=e.parent.parentAddressCells(t);if(n.typeExample=`<${[...Array.from({length:o},()=>"child-bus-address"),...Array.from({length:a},()=>"parent-bus-address"),...Array.from({length:a},()=>"length")].join(" ")}>`,(s.length===0||s.length%(o+a+i)!==0)&&r.push(F(20,s.at(s.length-s.length%(o+a+i))??e.ast,Fa.DiagnosticSeverity.Error,[],[],[e.name,n.typeExample])),r.length===0){let c=e.parent.rangeMap(t);c&&ld(c).forEach(u=>{r.push(F(32,u.mappingA.ast,Fa.DiagnosticSeverity.Error,[u.mappingB.ast],[],[u.overlapOn]))});let l=e.parent.reg(t);l&&c?.forEach(u=>{let d=An(u.parentAddress,u.length);(Ft(l.endAddress,d)<0||Ft(l.startAddress,u.parentAddress)>0)&&r.push(F(31,u.ast,Fa.DiagnosticSeverity.Warning,[l.ast],[],[e.name,u.parentAddress.map((f,p)=>`0x${f.toString(16).padStart(p?8:0)}`).join(""),d.map((f,p)=>`0x${f.toString(16).padStart(p?8:0)}`).join(""),l.startAddress.map((f,p)=>`0x${f.toString(16).padStart(p?8:0)}`).join(""),l.endAddress.map((f,p)=>`0x${f.toString(16).padStart(p?8:0)}`).join("")]))}),e.parent.nodes.forEach(u=>{let d=u.getProperty("reg");if(!d)return;let f=u.mappedReg(t);!f?.mappingEnd||!f.mappedAst||f.inMappingRange||r.push(F(30,d.ast.values??d.ast,Fa.DiagnosticSeverity.Warning,[f.mappedAst],[],[d.name,f.endAddress.map((p,y)=>`0x${p.toString(16).padStart(y?8:0)}`).join(""),f.mappingEnd.map((p,y)=>`0x${p.toString(16).padStart(y?8:0)}`).join("")]))})}return r});return n.description=["The ranges property provides a means of defining a mapping or translation between the address space of the bus (the child address space) and the address space of the bus node's parent (the parent address space).","The format of the value of the ranges property is an arbitrary number of triplets of (child-bus-address, parent-bus-address, length)","- The child-bus-address is a physical address within the child bus' address space. The number of cells to represent the address is bus dependent and can be determined from the #address-cells of this node (the node in which the ranges property appears).","- The parent-bus-address is a physical address within the parent bus' address space. The number of cells to represent the parent address is bus dependent and can be determined from the #address-cells property of the node that defines the parent's address space.","- The length specifies the size of the range in the child's address space. The number of cells to represent the size can be determined from the #size-cells of this node (the node in which the ranges property appears).","If the property is defined with an < empty> value, it specifies that the parent and child address space is identical, and no address translation is required.","If the property is not present in a bus node, it is assumed that no mapping exists between children of the node and the parent address space."],n.examples=["Address Translation Example:",["```devicetree",`soc {
193
+ `)});typeof r!="function"?this.required=()=>r:this.required=r,typeof i!="function"?(this.allowedValues=i,this.values=()=>i===void 0?s?[s]:[]:s&&i.indexOf(s)===-1?[s,...i]:i):this.values=i}getNameMatch(e){return typeof this.name=="string"?this.name===e:this.name.test(e)}validateProperty(e,n,r,s){let i=this.required(n);if(s){if(i==="omitted")return[$(11,s.ast,yt.DiagnosticSeverity.Error,void 0,[],[r])]}else{if(i==="required"){let l=e.getOrderedNodeAst(n),u=Eo(l),d="";if(this.type.length===1&&this.type[0].types.length===1)switch(this.type[0].types[0]){case"U32":case"U64":case"PROP_ENCODED_ARRAY":d=" = <>";break;case"STRING":case"STRINGLIST":d=' = ""';break;case"BYTESTRING":d=" = []";break}return[...l.map((f,h)=>{let y=f.openScope??u[h].lastToken;return $(0,u[h],yt.DiagnosticSeverity.Error,[],[],[r],yt.TextEdit.insert(yt.Position.create(y.pos.line,y.pos.col+1),`
194
+ ${"".padEnd(No(u[h].uri,f)*So().length,So())}${r}${d};`))})]}return[]}let o=O1(s),a=[],c=(l,u,d)=>{if(d??=s.ast,!(l.some(h=>h==u)||l.some(h=>h=="STRINGLIST")&&(u==="STRING"||u==="STRINGLIST")||l.some(h=>h=="PROP_ENCODED_ARRAY")&&(u==="U32"||u==="U64"))){let h=[];l.forEach(y=>{switch(y){case"EMPTY":h.push(1);break;case"STRING":h.push(2);break;case"STRINGLIST":h.push(3);break;case"U32":h.push(5);break;case"U64":h.push(6);break;case"PROP_ENCODED_ARRAY":h.push(7);break}}),h.length&&a.push($(h,d,yt.DiagnosticSeverity.Error,[],[],[s.name]))}};if(this.type[0].types.some(l=>l==="ANY"))return[];if(this.type.length>1){let l=this.type;!this.list&&this.type.length!==o.length?a.push($(4,s.ast.values??s.ast,yt.DiagnosticSeverity.Error,[],[],[r,this.type.length.toString()])):o.forEach((u,d)=>{l[0].types.every(f=>f!==u)&&a.push($(3,s.ast.values?.values[d]??s.ast))})}else{this.type[0].types.some(u=>u==="STRINGLIST")?o.some(u=>c(["STRINGLIST"],u,s.ast.values?.values[0]?.value)):this.list||this.type.length===1&&this.type[0].types.filter(u=>u!=="EMPTY").every(u=>u==="PROP_ENCODED_ARRAY")?o.some(u=>c(this.type[0].types,u,s.ast.values?.values[0]?.value)):o.length>1&&this.type[0].types.some(u=>u!=="EMPTY")?a.push($(8,s.ast.propertyName??s.ast,yt.DiagnosticSeverity.Error,(s.ast.values?.values.slice(1)??[]).filter(u=>!!u),[],[s.name])):o.length===1&&c(this.type[0].types,o[0],s.ast.values?.values[0]?.value);let l=this.values(s);if(a.length===0&&(a.push(...this.additionalTypeCheck?.(s,e.context.macros)??[]),l.length&&this.type[0].types.some(u=>u==="STRING"))){let u=s.ast.values?.values[0]?.value;l.some(d=>u.value===d)||a.push($(9,s.ast.values?.values[0]?.value??s.ast,yt.DiagnosticSeverity.Error,[],[],[this.values(s).map(d=>`'${d}'`).join(" or ")]))}}return a}getPropertyCompletionItems(e,n,r){let s=this.type.at(n);return s?.types.some(i=>i==="STRING")?e.ast.values?.values&&e.ast.values.values?.length>1?[]:this.values(e).map(i=>({label:r?`${i}`:`"${i}"`,kind:yt.CompletionItemKind.Variable,sortText:i===this.def?`A${i}`:`Z${i}`})):s?.types.some(i=>i==="U32"||i==="U64")?this.values(e).map(i=>({label:r?`${i}`:`<${i}>`,kind:yt.CompletionItemKind.Variable,sortText:i===this.def?`A${i}`:`Z${i}`})):[]}},O1=t=>t.ast.values?t.ast.values.values.map(e=>I1(e)):["EMPTY"],I1=t=>t?t.value instanceof Le?"STRING":t.value instanceof Ct?t.value.values.length===1?"U32":t.value.values.length===2?"U64":"PROP_ENCODED_ARRAY":t.value instanceof be||t.value instanceof Mn?"U32":"BYTESTRING":"UNKNOWN",Ka=class{},Sn=class extends Ka{constructor(n=()=>[]){super();this.additionalValidations=n;this.#e=[];this.noMismatchPropertiesAllowed=!1}#e;#t;getIssue(n,r){let s=[],i=r.getProperty("status"),o=i?.ast.values?.values.at(0)?.value;if(o instanceof Le&&o.value==="disabled")return[...r.definitions,...r.referencedBy].forEach(l=>s.push($(21,l,yt.DiagnosticSeverity.Hint,[...i?.ast.parentNode?[i?.ast.parentNode]:[]],[yt.DiagnosticTag.Unnecessary]))),s;let a=new Set,c=this.properties.flatMap(l=>{if(typeof l.name=="string"){let f=r.getProperty(l.name);return f&&a.add(f),l.validateProperty(n,r,l.name,f)}let u=r.property.filter(f=>l.getNameMatch(f.name));u.forEach(f=>a.add(f));let d=this.properties.filter(f=>f!==l)??[];return d.length&&u.some(f=>d.some(h=>h.getNameMatch(f.name)))?[]:u.flatMap(f=>l.validateProperty(n,r,f.name,f))});return a.size!==r.property.length&&this.noMismatchPropertiesAllowed&&r.property.filter(u=>!a.has(u)).forEach(u=>{s.push($(27,u.ast,yt.DiagnosticSeverity.Error,[],[],[u.name],yt.TextEdit.del(mi(u.ast.firstToken.prevToken,u.ast.lastToken,!1))))}),[...s,...c,...this.additionalValidations(n,r)]}get properties(){return this.#e}addProperty(n){Array.isArray(n)?n.forEach(r=>this.#e.push(r)):this.#e.push(n),this.#e.sort((r,s)=>typeof r.name=="string"&&typeof s.name=="string"||typeof r.name!="string"&&typeof s.name!="string"?0:typeof r.name=="string"?-1:1)}get childNodeType(){return this.#t}set childNodeType(n){n&&(this.#t=r=>{let s=n(r);return s.bindingsPath=this.bindingsPath,s})}getOnPropertyHover(n){let r=this.properties.find(s=>s.getNameMatch(n));return r?.onHover.bind(r)()}getPropertyListCompletionItems(n){return this.properties.filter(r=>!r.hideAutoComplete&&r.required(n)!=="omitted"&&typeof r.name=="string").map(r=>{let s=n&&r.required(n),i=!!n.property.some(a=>r.getNameMatch(a.name)),o="a";return s?o=i?"Y":"A":o=i?"Z":"B",{label:`${r.name}`,kind:yt.CompletionItemKind.Property,sortText:`${o}${r.name}`}})??[]}};var un=class extends j{constructor(n,r,s,i){super();this.startLabels=n;this.value=r;this.endLabels=s;this.bits=i;this.startLabels.forEach(o=>{this.addChild(o)}),this.addChild(i),this.addChild(r),this.endLabels.forEach(o=>{this.addChild(o)})}toString(){return`${[this.value?.toString()??"NULL",...this.endLabels.map(n=>n.toString())].join(" ")}`}toPrettyString(n){return`${[this.value?.toPrettyString(n)??"NULL",...this.endLabels.map(r=>r.toString())].join(" ")}`}toJson(){return this.value?.toJson()}};var Ee=t=>{if(!t?.values.some(e=>!(e?.value instanceof Ct)))return t?.values.flatMap(e=>e.value.values.map(n=>n.value))??[]};var Pe=(t,e,n,r)=>{let s=t.ast.values?.values.at(e)?.value;if(s instanceof Ct){let i=s.values.at(n);if(i?.value instanceof ft){let o=i.value.evaluate(r);if(typeof o=="number")return o}}},Ln=(t,e,n=0)=>{if(t instanceof un){if(t?.value instanceof Ct){let r=t.value.values.at(n);if(r?.value instanceof Ut)return e.getPhandle(r.value.value);if(r?.value instanceof be)return r.value.linksTo;if(r?.value instanceof Mn)return r.value.path?.pathParts.at(-1)?.linksTo}}else{if(t instanceof Ut)return e.getPhandle(t.value);if(t instanceof be)return t.linksTo;if(t instanceof Mn)return t.path?.pathParts.at(-1)?.linksTo}},B=t=>Array.isArray(t)?[{types:t}]:[{types:[t]}];var rN=()=>{let t=new K("compatible",B("STRINGLIST"));return t.description=["The compatible property value consists of one or more strings that define the specific programming model for the device. This list of strings should be used by a client program for device driver selection. The property value consists of a concatenated list of null terminated strings, from most specific to most general. They allow a device to express its compatibility with a family of similar devices, potentially allowing a single device driver to match against several devices.",'The recommended format is "manufacturer, model", where manufacturer is a string describing the name of the manufacturer (such as a stock ticker symbol), and model specifies the model number.',"The compatible string should consist only of lowercase letters, digits and dashes, and should start with a letter. A single comma is typically only used following a vendor prefix. Underscores should not be used."],t.examples=['```devicetree\ncompatible = "fsl,mpc8641", "ns16550";\n```',"In this example, an operating system would first try to locate a device driver that supported fsl, mpc8641. If a driver was not found, it would then try to locate a driver that supported the more general ns 16550 device type."],t};var Po=Y(Q()),sN=()=>{let t=new K("device_type",B("STRING"),"optional",void 0,e=>e.parent.name==="cpu"||e.parent.name==="memory"?[e.parent.name]:[],e=>{if(e.parent.name==="cpu"||e.parent.name==="memory"){let n=e.ast.values?.values.at(0)?.value;if(n instanceof Le&&n.value!==e.parent.name)return e.parent.name==="cpu"?[$(12,e.ast,Po.DiagnosticSeverity.Error,[],[],[e.name])]:[$(13,e.ast,Po.DiagnosticSeverity.Error,[],[],[e.name])]}return t.required(e.parent)!=="required"?[$(14,e.ast,Po.DiagnosticSeverity.Hint,[],[Po.DiagnosticTag.Deprecated],[e.name])]:[]});return t.description=["The device_type property was used in IEEE 1275 to describe the device's FCode programming model. Because DTSpec does not have FCode, new use of the property is deprecated, and it should be included only on cpu and memory nodes for compatibility with IEEE 1275-derived devicetrees."],t};var iN=()=>{let t=new K("#interrupt-cells",B("U32"));return t.description=["The #interrupt-cells property defines the number of cells required to encode an interrupt specifier for an interrupt domain."],t};var oN=()=>{let t=new K("interrupt-controller",B("EMPTY"),"optional");return t.description=["The presence of an interrupt-controller property defines a node as an interrupt controller node."],t};var aN=()=>{let t=new K("interrupt-parent",B("U32"));return t.description=["Because the hierarchy of the nodes in the interrupt tree might not match the devicetree, the interrupt-parent property is available to make the definition of an interrupt parent explicit. The value is the phandle to the interrupt parent. If this property is missing from a device, its interrupt parent is assumed to be its devicetree parent."],t};var Ro=Y(Q()),cN=()=>{let t=new K("interrupts",B("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,n)=>{let r=[],s=Ee(e.ast.values);if(!s)return r;let i=e.parent,o=i.getProperty("interrupt-parent"),a=i.root,c=o?Ln(o?.ast.values?.values.at(0),a):i.parent;if(!c)return o?(r.push($(17,o.ast.values?.values.at(0)?.value??o.ast)),r):(r.push($(16,e.ast,Ro.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"interrupt-parent",e.parent.pathString])),r);let l=c.getProperty("#interrupt-cells");if(!l)return r;let u=Pe(l,0,0,n);if(!u)return r;t.typeExample=`<${[...Array.from({length:u},()=>"Interrupt")].join(" ")}> `;let d=c.getProperty("interrupt-map"),f=i.parent?.getProperty("#address-cells");d&&!f&&r.push($(16,e.ast.propertyName??e.ast,Ro.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"#address-cells",i.parent.pathString]));let h=0;for(;h<s.length;){if(!l){r.push($(16,e.ast,Ro.DiagnosticSeverity.Error,[...c.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",c.pathString]));break}let y=s.length-h;if(u>y)return r.push($(19,s.at(-1),Ro.DiagnosticSeverity.Error,[],[],[e.name,t.typeExample])),r;let m=s.slice(h,h+u),_=i.mappedReg(n)?.at(0)?.startAddress;if(d&&_){let E=c.getNexusMapEntyMatch("interrupt",n,m,_);E?.match?e.nexusMapsTo.push({mappingValuesAst:m,mapItem:E.match}):r.push($(31,E.entry,Ro.DiagnosticSeverity.Error,[d.ast]))}h+=u}return r});return t.description=["The interrupts property of a device node defines the interrupt or interrupts that are generated by the device.The value of the interrupts property consists of an arbitrary number of interrupt specifiers. The format of an interrupt specifier is defined by the binding of the interrupt domain root.","interrupts is overridden by the interrupts-extended property and normally only one or the other should be used."],t.examples=["A common definition of an interrupt specifier in an open PIC-compatible interrupt domain consists of two cells; an interrupt number and level/sense information. See the following example, which defines a single interrupt specifier, with an interrupt number of OxA and level/sense encoding of 8.","```devicetree\ninterrupts = <0xA 8>;\n```"],t};var Rs=Y(Q()),lN=()=>{let t=new K("interrupts-extended",B("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,n)=>{let r=[],s=e.parent,i=s.getProperty("interrupts");i&&r.push($(15,i.ast,Rs.DiagnosticSeverity.Warning,[e.ast],[],[i.name,"is ignored when 'interrupts-extended' is used"]));let o=s.getProperty("interrupt-parent");o&&r.push($(15,o.ast,Rs.DiagnosticSeverity.Warning,[e.ast],[],[o.name,"is ignored when 'interrupts-extended' is used"]));let a=s.root,c=Ee(e.ast.values);if(!c?.length)return[];t.typeExample="";let l=0;for(;l<c.length;){let u=Ln(c[l],a);if(!u)return r.push($(17,c[l],Rs.DiagnosticSeverity.Error)),r;let d=u.getProperty("#interrupt-cells");if(!d){r.push($(16,e.ast,Rs.DiagnosticSeverity.Error,[...u.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",u.pathString]));break}u?.getProperty("#address-cells")||r.push($(16,e.ast,Rs.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"#address-cells",u.pathString]));let h=Pe(d,0,0,n);if(h==null)return r;let y=c.length-l-1,m=`<${["phandel",...Array.from({length:h},()=>"interrupt")].join(" ")}>`;if(t.typeExample+=m,h>y)return r.push($(19,c.at(-1),Rs.DiagnosticSeverity.Error,[],[],[e.name,m])),r;let _=c.slice(l+1,l+1+h),E=u.getProperty("interrupt-map"),T=s.mappedReg(n)?.at(0)?.startAddress;if(E&&T){let b=u.getNexusMapEntyMatch("interrupt",n,_,T);b?.match?e.nexusMapsTo.push({mappingValuesAst:_,mapItem:b.match}):r.push($(31,b.entry,Rs.DiagnosticSeverity.Error,[E.ast]))}l+=h+1}return r});return t.description=["The interrupts-extended property lists the interrupts) generated by a device. interrupts-extended should be used instead of interrupts when a device is connected to multiple interrupt controllers as it encodes a parent phandle with each interrupt specifier.","The interrupts and interrupts-extended properties are mutually exclusive. A device node should use one or the other, but not both. Using both is only permissible when required for compatibility with software that does not understand interrupts-extended. If both interrupts-extended and interrupts are present then interrupts-extended takes precedence."],t.examples=["This example shows how a device with two interrupt outputs connected to two separate interrupt controllers would describe the connection using an interrupts-extended property. pic is an interrupt controller with an #interrupt-cells specifier of 2, while gic is an interrupt controller with an #interrupts-cells specifier of 1.","```devicetree\ninterrupts-extended = <&pic OXA 8>, <&gic Oxda>;\n```"],t};var uN=()=>{let t=new K("dma-noncoherent",B("EMPTY"));return t.description=["For architectures which are by default coherent for 1/O, the dma-noncoherent property is used to indicate a device is not capable of coherent DMA operations. Some architectures have non-coherent DMA by default and this property is not applicable."],t};var dN=()=>{let t=new K("dma-coherent",B("EMPTY"));return t.description=["For architectures which are by default non-coherent for I/O, the dma-coherent property is used to indicate a device is capable of coherent DMA operations. Some architectures have coherent DMA by default and this property is not applicable."],t};var fN=Y(Q()),hN=()=>{let t=new K("dma-ranges",B(["EMPTY","PROP_ENCODED_ARRAY"]),"optional",void 0,void 0,(e,n)=>{let r=[],s=Ee(e.ast.values);if(!s?.length)return[];let i=e.parent.sizeCells(n),o=e.parent.addressCells(n),a=e.parent.parentAddressCells(n);return t.typeExample=`<${[...Array.from({length:o},()=>"child-bus-address"),...Array.from({length:a},()=>"parent-bus-address"),...Array.from({length:a},()=>"length")].join(" ")}>`,(s.length===0||s.length%(o+a+i)!==0)&&r.push($(19,s.at(s.length-s.length%(o+a+i))??e.ast,fN.DiagnosticSeverity.Error,[],[],[e.name,t.typeExample])),r});return t.description=["The dma-ranges property is used to describe the direct memory access (DMA) structure of a memory-mapped bus whose devicetree parent can be accessed from DMA operations originating from the bus. It provides a means of defining a mapping or translation between the physical address space of the bus and the physical address space of the parent of the bus.","The format of the value of the dma-ranges property is an arbitrary number of triplets of (child-bus-address, parent-bus-address, length). Each triplet specified describes a contiguous DMA address range.","- The child-bus-address is a physical address within the child bus' address space. The number of cells to represent the address depends on the bus and can be determined from the #address-cells of this node (the node in which the dma-ranges property appears).","- The parent-bus-address is a physical address within the parent bus' address space. The number of cells to represent the parent address is bus dependent and can be determined from the #address-cells property of the node that defines the parent's address space.","- The length specifies the size of the range in the child's address space. The number of cells to represent the size can be determined from the #size-cells of this node (the node in which the dma-ranges property appears)."],t};var _g=Y(Q()),Ld=()=>{let t=new K("ranges",B(["EMPTY","PROP_ENCODED_ARRAY"]),"optional",void 0,void 0,(e,n)=>{let r=[],s=Ee(e.ast.values);if(!s?.length)return[];let i=e.parent.sizeCells(n),o=e.parent.addressCells(n),a=e.parent.parentAddressCells(n);return t.typeExample=`<${[...Array.from({length:o},()=>"child-bus-address"),...Array.from({length:a},()=>"parent-bus-address"),...Array.from({length:a},()=>"size")].join(" ")}>`,(s.length===0||s.length%(o+a+i)!==0)&&r.push($(19,s.at(s.length-s.length%(o+a+i))??e.ast,_g.DiagnosticSeverity.Error,[],[],[e.name,t.typeExample])),r.length===0&&e.parent.nodes.forEach(c=>{let l=c.getProperty("reg");l&&c.mappedReg(n)?.forEach(u=>{!u?.mappingEnd||!u.mappedAst||u.inMappingRange||(u.regAst,r.push($(29,u.regAst,_g.DiagnosticSeverity.Warning,[u.mappedAst],[],[l.name,`0x${u.endAddress.map((d,f)=>d.toString(16).padStart(f?8:0,"0")).join("")}`,`0x${u.mappingEnd.map((d,f)=>d.toString(16).padStart(f?8:0,"0")).join("")}`])))})}),r});return t.description=["The ranges property provides a means of defining a mapping or translation between the address space of the bus (the child address space) and the address space of the bus node's parent (the parent address space).","The format of the value of the ranges property is an arbitrary number of triplets of (child-bus-address, parent-bus-address, length)","- The child-bus-address is a physical address within the child bus' address space. The number of cells to represent the address is bus dependent and can be determined from the #address-cells of this node (the node in which the ranges property appears).","- The parent-bus-address is a physical address within the parent bus' address space. The number of cells to represent the parent address is bus dependent and can be determined from the #address-cells property of the node that defines the parent's address space.","- The length specifies the size of the range in the child's address space. The number of cells to represent the size can be determined from the #size-cells of this node (the node in which the ranges property appears).","If the property is defined with an < empty> value, it specifies that the parent and child address space is identical, and no address translation is required.","If the property is not present in a bus node, it is assumed that no mapping exists between children of the node and the parent address space."],t.examples=["Address Translation Example:",["```devicetree",`soc {
195
195
  compatible = "simple-bus";
196
196
  #address-cells = <1>;
197
197
  #size-cells = <1>;
@@ -206,7 +206,7 @@ ${"".padEnd(vo(u[p].uri,f)*mo().length,mo())}${r}${d};`))})]}return[]}let o=t$(s
206
206
  };
207
207
  };`,"```"].join(`
208
208
  `),"The soc node specifies a ranges property of",["```devicetree","<Ox0 Oxe0000000 0x00100000>;","```"].join(`
209
- `),"This property value specifies that for a 1024 KB range of address space, a child node addressed at physical OxO maps to a parent address of physical 0xe0000000. With this mapping, the serial device node can be addressed by a load or store at address 0xe0004600, an offset of 0x4600 (specified in reg) plus the 0xe0000000 mapping specified in ranges."],n};var Vk=()=>{let n=new G("virtual-reg",W("U32"));return n.description=["The virtual-res property specifies an effective address that maps to the first physical address specified in the reg property of the device node. This property enables boot programs to provide client programs with virtual-to-physical mappings that have been set up."],n};var lg=K(X());var Wk=()=>{let n=new G("reg",W("PROP_ENCODED_ARRAY"),e=>e.address!==void 0?"required":"omitted",void 0,void 0,(e,t)=>{let r=[],s=Mt(e.ast.values);if(!s)return[];let i=e.parent.parentSizeCells(t),o=e.parent.parentAddressCells(t);if(n.typeExample=`<${[...Array.from({length:o},()=>"address"),...Array.from({length:i},()=>"cell")].join(" ")}>`,s.length===0||s.length%(i+o)!==0)return r.push(F(20,s.at(s.length-s.length%(i+o))??e.ast,lg.DiagnosticSeverity.Error,[],[],[e.name,n.typeExample])),r;for(let a=0;a<s.length;a+=i+o){let c=s.slice(0,o).map((l,u)=>at(e,0,u,t)??0);if(e.parent.address&&Ft(e.parent.address,c)!==0){let l=e.ast.values?.values.at(0)?.value?.values?.at(0),u=e.ast.values?.values.at(0)?.value?.values?.at(o-1),d=l&&u?new q(H(l.firstToken,u.lastToken)):void 0;r.push(F(10,d??e.ast.values??e.ast,lg.DiagnosticSeverity.Error,[],[],[e.name]))}}return r});return n.examples=["Suppose a device within a system-on-a-chip had two blocks of registers, a 32-byte block at offset 0x3000 in the SOC and a 256-byte block at offset OxFE00. The reg property would be encoded as follows (assuming #address-cells and #size-cells values of 1):","```devicetree\nreg = <0x3000 0x20 0xFE00 0x100>;\n```"],n};var Dd=()=>new G("#size-cells",W("U32"),"optional",1);var Cd=()=>{let n=new G("#address-cells",W("U32"),"optional",2);return n.description=["The #address-cells and #size-cells properties may be used in any device node that has children in the devicetree hierarchy and describes how child device nodes should be addressed. The #address-cells property defines the number of <u32> cells used to encode the address field in a child node's reg property. The #size-cells property defines the number of <u32 > cells used to encode the size field in a child node's reg property.","The #address-cells and #size-cells properties are not inherited from ancestors in the devicetree. They shall be explicitly defined.","A DTSpec-compliant boot program shall supply #address-cells and #size-cells on all nodes that have children.","If missing, a client program should assume a default value of 2 for #address-cells, and a value of 1 for #size-cells."],n.examples=["See the following devicetree excerpt:",["```devicetree",`SOC {
209
+ `),"This property value specifies that for a 1024 KB range of address space, a child node addressed at physical OxO maps to a parent address of physical 0xe0000000. With this mapping, the serial device node can be addressed by a load or store at address 0xe0004600, an offset of 0x4600 (specified in reg) plus the 0xe0000000 mapping specified in ranges."],t};var pN=()=>{let t=new K("virtual-reg",B("U32"));return t.description=["The virtual-res property specifies an effective address that maps to the first physical address specified in the reg property of the device node. This property enables boot programs to provide client programs with virtual-to-physical mappings that have been set up."],t};var Sg=Y(Q());var mN=()=>{let t=new K("reg",B("PROP_ENCODED_ARRAY"),e=>e.address!==void 0?"required":"omitted",void 0,void 0,(e,n)=>{let r=[],s=Ee(e.ast.values);if(!s)return[];let i=e.parent.parentSizeCells(n),o=e.parent.parentAddressCells(n);if(t.typeExample=`<${[...Array.from({length:o},()=>"address"),...Array.from({length:i},()=>"size")].join(" ")}>`,s.length===0||s.length%(i+o)!==0)return r.push($(19,s.at(s.length-s.length%(i+o))??e.ast,Sg.DiagnosticSeverity.Error,[],[],[e.name,t.typeExample])),r;let a=s.slice(0,o).map((c,l)=>Pe(e,0,l,n)??0);if(e.parent.address&&Ar(e.parent.address,a)!==0){let c=e.ast.values?.values.at(0)?.value?.values?.at(0),l=e.ast.values?.values.at(0)?.value?.values?.at(o-1),u=c&&l?new j(G(c.firstToken,l.lastToken)):void 0;r.push($(10,u??e.ast.values??e.ast,Sg.DiagnosticSeverity.Error,[],[],[e.name]))}return r});return t.examples=["Suppose a device within a system-on-a-chip had two blocks of registers, a 32-byte block at offset 0x3000 in the SOC and a 256-byte block at offset OxFE00. The reg property would be encoded as follows (assuming #address-cells and #size-cells values of 1):","```devicetree\nreg = <0x3000 0x20 0xFE00 0x100>;\n```"],t};var $d=()=>new K("#size-cells",B("U32"),"optional",1);var qd=()=>{let t=new K("#address-cells",B("U32"),"optional",2);return t.description=["The #address-cells and #size-cells properties may be used in any device node that has children in the devicetree hierarchy and describes how child device nodes should be addressed. The #address-cells property defines the number of <u32> cells used to encode the address field in a child node's reg property. The #size-cells property defines the number of <u32 > cells used to encode the size field in a child node's reg property.","The #address-cells and #size-cells properties are not inherited from ancestors in the devicetree. They shall be explicitly defined.","A DTSpec-compliant boot program shall supply #address-cells and #size-cells on all nodes that have children.","If missing, a client program should assume a default value of 2 for #address-cells, and a value of 1 for #size-cells."],t.examples=["See the following devicetree excerpt:",["```devicetree",`SOC {
210
210
  #address-cells = <1>;
211
211
  #size-cells = <1>;
212
212
  serial@4600 {
@@ -217,8 +217,8 @@ ${"".padEnd(vo(u[p].uri,f)*mo().length,mo())}${r}${d};`))})]}return[]}let o=t$(s
217
217
  interrupt-parent = <&ipic>;
218
218
  };
219
219
  };`,"```"].join(`
220
- `),"In this example, the #address-cells and #size-cells properties of the soc node are both set to 1. This setting specifies that one cell is required to represent an address and one cell is required to represent the size of nodes that are children of this node.","The serial device reg property necessarily follows this specification set in the parent (soc) node\u2014 the address is represented by a single cell (0x4600), and the size is represented by a single cell (0x100)."],n};var zk=()=>{let n=new G("status",W("STRING"),"optional","okay",["okay","disabled","reserved","fail","fail-sss"]);return n.description=[`The status property indicates the operational status of a device.
221
- The lack of a status property should betreated as if the property existed with the value of "okay"`],n};var Hk=K(X()),Kk=()=>{let n=new G("phandle",W("U32"),"optional",void 0,void 0,(e,t)=>{let r=at(e,0,0,t);if(r){let s=e.parent.root.getAllPhandle(r);if(s.length>1&&s.at(-1)===e.parent)return[F(19,e.ast.values?.values.at(0)??e.ast,Hk.DiagnosticSeverity.Error,s.slice(0,-1).flatMap(i=>i.getProperty("phandle")?.ast).filter(i=>!!i),[],[e.name])]}return[]});return n.description=["The phandle property specifies a numerical identifier for a node that is unique within the devicetree. The phandle property value is used by other nodes that need to refer to the node associated with the property."],n.examples=["See the following devicetree excerpt:",["```devicetree",`pic@10000000 {
220
+ `),"In this example, the #address-cells and #size-cells properties of the soc node are both set to 1. This setting specifies that one cell is required to represent an address and one cell is required to represent the size of nodes that are children of this node.","The serial device reg property necessarily follows this specification set in the parent (soc) node\u2014 the address is represented by a single cell (0x4600), and the size is represented by a single cell (0x100)."],t};var gN=()=>{let t=new K("status",B("STRING"),"optional","okay",["okay","disabled","reserved","fail","fail-sss"]);return t.description=[`The status property indicates the operational status of a device.
221
+ The lack of a status property should betreated as if the property existed with the value of "okay"`],t};var yN=Y(Q()),bN=()=>{let t=new K("phandle",B("U32"),"optional",void 0,void 0,(e,n)=>{let r=Pe(e,0,0,n);if(r){let s=e.parent.root.getAllPhandle(r);if(s.length>1&&s.at(-1)===e.parent)return[$(18,e.ast.values?.values.at(0)??e.ast,yN.DiagnosticSeverity.Error,s.slice(0,-1).flatMap(i=>i.getProperty("phandle")?.ast).filter(i=>!!i),[],[e.name])]}return[]});return t.description=["The phandle property specifies a numerical identifier for a node that is unique within the devicetree. The phandle property value is used by other nodes that need to refer to the node associated with the property."],t.examples=["See the following devicetree excerpt:",["```devicetree",`pic@10000000 {
222
222
  phandle = <1>;
223
223
  interrupt-controller;
224
224
  reg = <0x10000000 0x100>;
@@ -226,65 +226,71 @@ ${"".padEnd(vo(u[p].uri,f)*mo().length,mo())}${r}${d};`))})]}return[]}let o=t$(s
226
226
  `),"A phandle value of 1 is defined. Another device node could reference the pic node with a phandle value of 1:",["```devicetree",`another-device-node {
227
227
  interrupt-parent = <1>;
228
228
  };`,"```"].join(`
229
- `)],n};var Gk=()=>{let n=new G("model",W("STRING"));return n.description=["The model property value is a <string> that specifies the manufacturer's model number of the device.",'The recommended format is: "manufacturer, model" , where manufacturer is a string describing the name of the manufacturer (such as a stock ticker symbol), and model specifies the model number.'],n.examples=['```devicetree\nmodel = "{sl, MPC8349EMITX" ;\n```'],n};var Ad=K(X()),Yk=()=>{let n=new G("name",W("STRING"),"optional",void 0,void 0,e=>[F(14,e.ast,Ad.DiagnosticSeverity.Warning,[],[Ad.DiagnosticTag.Deprecated],[e.name])]);return n.hideAutoComplete=!0,n};var _o=K(X());var Jk=()=>{let n=new G("interrupt-map",W("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,t)=>{let r=[],s=e.parent,i=e.parent.root,o=Mt(e.ast.values);if(!o?.length)return[];let a=s.getProperty("#interrupt-cells");if(!a)return r.push(F(16,e.ast,_o.DiagnosticSeverity.Error,[...s.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${s.path.slice(1).join("/")}`])),r;let c=s.addressCells(t),l=at(a,0,0,t),u=0;for(;u<o.length;){if(l==null)return r;let d=0;u+=c+l;let f=c+l+1;if(n.typeExample??="",n.typeExample+=`<${[...Array.from({length:c},()=>"ChildAddress"),...Array.from({length:l},()=>"ChildInterruptSpecifier"),"InterruptParent ParentUnitAddress... ParentInterruptSpecifier..."].join(" ")}> `,o.length<u+1){r.push(F(21,o[o.length-1],_o.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:c},()=>"ChildAddress"),...Array.from({length:l},()=>"ChildInterruptSpecifier"),"InterruptParent ParentUnitAddress... ParentInterruptSpecifier..."].slice((o.length-d)%f===0?f:(o.length-d)%f).join(" ")}`]));break}let p=ur(o[u],i);if(!p){r.push(F(18,o[u],_o.DiagnosticSeverity.Error));break}let y=p.addressCells(t),m=p.getProperty("#interrupt-cells");if(!m){r.push(F(16,o[u],_o.DiagnosticSeverity.Error,[...p.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${s.path.slice(1).join("/")}`]));break}u++;let S=at(m,0,0,t);if(y==null||S==null)break;if(u+=y+S,o.length<u){let w=c+l+1+y+S;r.push(F(21,o[o.length-1],_o.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:c},()=>"ChildAddress"),...Array.from({length:l},()=>"ChildInterruptSpecifier"),"InterruptParent",...Array.from({length:y},()=>"ParentUnitAddress"),...Array.from({length:S},()=>"ParentInterruptSpecifier")].slice((o.length-d)%w===0?w:(o.length-d)%w).join(" ")}`]));break}d=u}if(!e.ast.values)return[];for(let d=0;d<e.ast.values.values.length;d++){let f=e.ast.values.values.at(d);if(f&&(r.length||l==null||!(f.value instanceof St)))return r}return r});return n.description=["An interrupt-map is a property on a nexus node that bridges one interrupt domain with a set of parent interrupt domains and specifies how interrupt specifiers in the child domain are mapped to their respective parent domains.","The interrupt map is a table where each row is a mapping entry consisting of five components: child unit address, child interrupt specifier, interrupt-parent, parent unit address, parent interrupt specifier.","- child unit address: The unit address of the child node being mapped. The number of 32-bit cells required to specify this is described by the #address-cells property of the bus node on which the child is located.","- child interrupt specifier: The interrupt specifier of the child node being mapped. The number of 32-bit cells required to specify this component is described by the #interrupt-cells property of this node-the nexus node containing the interrupt-map property.","- interrupt-parent: A single <phandle > value that points to the interrupt parent to which the child domain is being mapped.","- parent unit address: The unit address in the domain of the interrupt parent. The number of 32-bit cells required to specify this address is described by the #address-cells property of the node pointed to by the interrupt-parent field.","- parent interrupt specifier: The interrupt specifier in the parent domain. The number of 32-bit cells required to specify this component is described by the #interrupt-cells property of the node pointed to by the interrupt-parent field.","Lookups are performed on the interrupt mapping table by matching a unit-address/interrupt specifier pair against the child components in the interrupt-map. Because some fields in the unit interrupt specifier may not be relevant, a mask is applied before the lookup is done. This mask is defined in the interrupt-map-mask property","Note: Both the child node and the interrupt parent node are required to have #address-cells and #interrupt-cells properties defined. If a unit address component is not required ,#address-cells shall be explicitly defined to be zero."],n};var Xk=()=>{let n=new G("interrupt-map-mask",W("PROP_ENCODED_ARRAY"));return n.description=["An interrupt-map-mask property is specified for a nexus node in the interrupt tree. This property specifies a mask that is ANDed with the incoming unit interrupt specifier being looked up in the table specified in the interrupt-mapproperty."],n};var Eo=K(X()),Qk=()=>{let n=new G(/^(?!interrupt-).*?-map$/,W("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,t)=>{let r=e.name.split("-map",1)[0],s=[],i=e.parent,o=e.parent.root,a=i.getProperty(`#${r}-cells`);if(!a)return s.push(F(16,e.ast,Eo.DiagnosticSeverity.Error,[...i.nodeNameOrLabelRef],[],[e.name,`#${r}-cells`,`/${i.path.slice(1).join("/")}`])),s;let c=at(a,0,0,t);if(c==null)return s;let l=Mt(e.ast.values);if(!l?.length)return[];let u=0,d=0;for(;u<l.length;){if(u+=c,n.typeExample??="",n.typeExample+=`<${[...Array.from({length:c},()=>"ChildSpecifier"),"SpecifierParent ParentSpecifier"].join(" ")}> `,l.length<u+1){let m=c+1;s.push(F(21,l[l.length-1],Eo.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:c},()=>"ChildSpecifier"),"SpecifierParent ParentSpecifier..."].slice((l.length-d)%m===0?m:(l.length-d)%m).join(" ")}`]));break}let f=ur(l[u],o);if(!f){s.push(F(18,l[u],Eo.DiagnosticSeverity.Error));break}let p=f.getProperty(`#${r}-cells`);if(!p)return s.push(F(16,l[u],Eo.DiagnosticSeverity.Error,[...f.nodeNameOrLabelRef],[],[e.name,`#${r}-cells`,`/${i.path.slice(1).join("/")}`])),s;u++;let y=at(p,0,0,t);if(y==null)break;if(u+=y,l.length<u){let m=c+1+y;s.push(F(21,l[l.length-1],Eo.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${[...Array.from({length:c},()=>"ChildSpecifier"),"InterruptParent",...Array.from({length:y},()=>"ParentSpecifier")].slice((l.length-d)%m===0?m:(l.length-d)%m).join(" ")}`]));break}d=u}return n.typeExample??=`<${[...Array.from({length:c},()=>"ChildSpecifier"),"SpecifierParent ParentSpecifier"].join(" ")}>`,s});return n.description=["A `\u2039specifier>-map` is a property in a nexus node that bridges one specifier domain with a set of parent specifier domains and describes how specifiers in the child domain are mapped to their respective parent domains.","The map is a table where each row is a mapping entry consisting of three components: child specifier, specifier parent, and parent specifier.","- child specifier The specifier of the child node being mapped. The number of 32-bit cells required to specify this component is described by the `#<specifier>-cells` property of this node-the nexus node containing the \u2039specifier>-map property.","- Specifier parent A single <phandle > value that points to the specifier parent to which the child domain is being mapped.","- Parent specifier: The specifier in the parent domain. The number of 32-bit cells required to specify this component is described by the `#<specifier>-cells` property of the specifier parent node.","Lookups are performed on the mapping table by matching a specifier against the child specifier in the map. Because some fields in the specifier may not be relevant or need to be modified, a mask is applied before the lookup is done. This mask is defined in the `<specifier>-map-mask` property","Similarly, when the specifier is mapped, some fields in the unit specifier may need to be kept unmodified and passed through from the child node to the parent node. In this case, a `<specifier>-map-pass-thru` property may be specified to apply a mask to the child specifier and copy any bits that match to the parent unit specifier."],n.list=!0,n};var Zk=()=>{let n=new G(/^(?!interrupt-).*?-map-mask$/,W("PROP_ENCODED_ARRAY"));return n.description=["A `<specifier>-map-mask` property may be specified for a nexus node. This property specifies a mask that is ANDed with the child unit specifier being looked up in the table specified in the `<specifier>-map` property. If this propertyis notspecified, the maskis assumedto be a mask with all bits set."],n};var eN=()=>{let n=new G(/^(?!interrupt-).*?-map-pass-thru$/,W("PROP_ENCODED_ARRAY"));return n.description=["A `<specifier>-map-pass-thru` property may be specified for a nexus node. This property specifies a mask that is applied to the child unit specifier being looked up in the table specified in the `<specifier>-map` property. Any matching bits in the child unit specifier are copied over to the parent specifier. If this property is not specified, the mask isassumedtobe amaskwithno bits set."],n};var tN=()=>{let n=new G(/^(?!#(?:address-|interrupt-|size-)).*-cells$/,W("U32"));return n.list=!0,n.description=["The `#<specifier>-cells` propertydefines the number of cells required to encode a specifier for adomain."],n};function Wn(){let n=new Sn;return n.addProperty([Ok(),Gk(),Kk(),zk(),Cd(),Dd(),Wk(),Vk(),Rd(),Uk(),Bk(),Fk(),Yk(),Ik(),qk(),$k(),jk(),xk(),Mk(),Jk(),Xk(),Qk(),Zk(),eN(),tN()]),n}var nN=()=>{let n=new G("chassis-type",W("STRING"),"optional",void 0,["desktop","laptop","convertible","server","tablet","handset","watch","embedded"]);return n.description=[`Specifiesastringthatidentifiestheform-factor
230
- of the system.`],n};var rN=()=>{let n=new G("serial-number",W("STRING"),"optional");return n.description=[`Specifies a string representing the device\u2019s se-
231
- rialnumber.`],n};function sN(){let n=Wn();n.noMismatchPropertiesAllowed=!0;let e=n.properties.find(i=>i.name==="#address-cells");e.required=()=>"required";let t=n.properties.find(i=>i.name==="#size-cells");t.required=()=>"required";let r=n.properties.find(i=>i.name==="model");r.required=()=>"required";let s=n.properties.find(i=>i.name==="compatible");return s.required=()=>"required",n.addProperty([nN(),rN()]),n}var ws=K(X());function iN(){let n=new Sn((t,r)=>{let s=[];return r.parent?.name!=="/"&&s.push(F(27,r.definitions[0],ws.DiagnosticSeverity.Error,r.definitions.slice(1),[],["Aliases node can only be added to a root node"])),r.nodes.forEach(i=>{i.definitions.forEach(o=>{s.push(F(27,o,ws.DiagnosticSeverity.Error,[],[],["Aliases node can not have child nodes"],ws.TextEdit.del(li(o.firstToken.prevToken,o.lastToken,!1)),"Delete Node"))})}),s});n.noMismatchPropertiesAllowed=!0;let e=new G(/^[-A-Za-z0-9]+$/,W(["STRING","U32"]),void 0,void 0,void 0,t=>{let r=[],s=t.ast.quickValues;if(s?.length===1&&typeof s[0]=="string"){if(!s[0].startsWith("/"))return r.push(F(24,t.ast.values??t.ast,ws.DiagnosticSeverity.Error,[],[],[s[0],t.name])),r;if(s[0].trim().endsWith("/"))return r.push(F(24,t.ast.values??t.ast,ws.DiagnosticSeverity.Error,[],[],["",s[0]])),r;let i=t.parent.root,o=s[0].split("/").slice(1);for(;o[0];){let a=i,c=o.splice(0,1)[0],[l,u]=c.split("@"),d=u?.split(",").map(f=>Number.parseInt(f,16));if(i=l?a.getNode(l,d,!1):void 0,!i){r.push(F(24,t.ast.values??t.ast,ws.DiagnosticSeverity.Error,[],[],[l,a.fullName]));break}}}return r});return e.description=["Each property of the /aliases node defines an alias."],n.addProperty([e]),n}function oN(){let n=Wn();n.noMismatchPropertiesAllowed=!0;let e=n.properties.find(t=>t.name==="reg");return e.required=()=>"required",n}var cN=K(X());var aN=(n,e,t)=>{let r=n?.(e,t)??[],s=e.parent.root.getProperty(e.name),i=s?at(s,0,0,t):void 0,o=e.parent.getProperty(e.name);return(o?at(o,0,0,t):void 0)!==i&&r.push(F(29,e.ast,cN.DiagnosticSeverity.Error,[...s?.ast?[s.ast]:[]],void 0,[`${e.name} value in this node must match value of root node`])),r};function lN(){let n=new Sn;n.noMismatchPropertiesAllowed=!0;let e=Cd(),t=e?.additionalTypeCheck;e.additionalTypeCheck=(o,a)=>aN(t,o,a),e.required=()=>"required";let r=Dd(),s=r?.additionalTypeCheck;r.additionalTypeCheck=(o,a)=>aN(s,o,a),r.required=()=>"required";let i=Rd();return i.required=()=>"required",i.type=W("EMPTY"),i.additionalTypeCheck=void 0,n.addProperty([e,r,i]),n}var uN=K(X());function dN(){let n=Wn();n.additionalValidations=(s,i)=>i.parent?.name!=="/"?[F(27,i.definitions[0],uN.DiagnosticSeverity.Error,i.definitions.slice(1),[],["Chosen node can only be added to a root node"])]:[];let e=new G("bootargs",W("STRING"));e.description=[`A string that specifies the boot arguments for
229
+ `)],t};var vN=()=>{let t=new K("model",B("STRING"));return t.description=["The model property value is a <string> that specifies the manufacturer's model number of the device.",'The recommended format is: "manufacturer, model" , where manufacturer is a string describing the name of the manufacturer (such as a stock ticker symbol), and model specifies the model number.'],t.examples=['```devicetree\nmodel = "{sl, MPC8349EMITX" ;\n```'],t};var jd=Y(Q()),TN=()=>{let t=new K("name",B("STRING"),"optional",void 0,void 0,e=>[$(14,e.ast,jd.DiagnosticSeverity.Warning,[],[jd.DiagnosticTag.Deprecated],[e.name])]);return t.hideAutoComplete=!0,t};var Ds=Y(Q());var _N=()=>{let t=new K("interrupt-map",B("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,n)=>{let r=[],s=e.parent,i=e.parent.root,o=Ee(e.ast.values);if(!o?.length)return[];s.getProperty("#address-cells")||r.push($(16,e.ast,Ds.DiagnosticSeverity.Error,[...e.parent.nodeNameOrLabelRef],[],[e.name,"#address-cells",s.pathString]));let c=s.getProperty("#interrupt-cells");if(!c)return r.push($(16,e.ast,Ds.DiagnosticSeverity.Error,[...s.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${s.path.slice(1).join("/")}`])),r;let l=s.addressCells(n),u=Pe(c,0,0,n),d={};if(u==null)return r;let f=0,h=[];for(;f<o.length;){let y=new j(G(o.at(f).firstToken,o.at(l+u+f-1).lastToken)),m="";for(let L=f;L<l+u+f;L++){let H=o[L];m+=`${H instanceof ft?H.evaluate(n).toString():H.toString()}:`}d[m]??=[],d[m].push(y);let _=0;f+=l+u;let E=l+u+1;if(t.typeExample??="",h.push([...Array.from({length:l},()=>"ChildAddr"),...Array.from({length:u},()=>"ChildIntrpt"),"IntrptParent ParentAddr... ParentIntrpt..."]),o.length<f+1){r.push($(20,o[o.length-1],Ds.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${h.at(-1).slice((o.length-_)%E===0?E:(o.length-_)%E).join(" ")}`]));break}let T=Ln(o[f],i);if(!T){r.push($(17,o[f],Ds.DiagnosticSeverity.Error));break}let b=T.addressCells(n),R=T.getProperty("#interrupt-cells");if(!R){r.push($(16,o[f],Ds.DiagnosticSeverity.Error,[...T.nodeNameOrLabelRef],[],[e.name,"#interrupt-cells",`/${s.path.slice(1).join("/")}`]));break}f++;let D=Pe(R,0,0,n);if(D==null)break;if(h.splice(-1,1,[...Array.from({length:l},()=>"ChildAddr"),...Array.from({length:u},()=>"ChildIntrpt"),"IntrptParent",...Array.from({length:b},()=>"ParentAddr"),...Array.from({length:D},()=>"ParentIntrpt")]),f+=b+D,o.length<f){let L=l+u+1+b+D;r.push($(20,o[o.length-1],Ds.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${h.at(-1).slice((o.length-_)%L===0?L:(o.length-_)%L).join(" ")}`]));break}_=f}if(t.typeExample=h.map(y=>`<${y.join(" ")}>`).join(`
230
+ `),!e.ast.values)return[];for(let y=0;y<e.ast.values.values.length;y++){let m=e.ast.values.values.at(y);if(m&&(r.length||u==null||!(m.value instanceof Ct)))return r}return Object.values(d).forEach(y=>{y.length>1&&r.push($(30,y[y.length-1],Ds.DiagnosticSeverity.Error,y.slice(0,-1)))}),r});return t.description=["An interrupt-map is a property on a nexus node that bridges one interrupt domain with a set of parent interrupt domains and specifies how interrupt specifiers in the child domain are mapped to their respective parent domains.","The interrupt map is a table where each row is a mapping entry consisting of five components: child unit address, child interrupt specifier, interrupt-parent, parent unit address, parent interrupt specifier.","- child unit address: The unit address of the child node being mapped. The number of 32-bit cells required to specify this is described by the #address-cells property of the bus node on which the child is located.","- child interrupt specifier: The interrupt specifier of the child node being mapped. The number of 32-bit cells required to specify this component is described by the #interrupt-cells property of this node-the nexus node containing the interrupt-map property.","- interrupt-parent: A single <phandle > value that points to the interrupt parent to which the child domain is being mapped.","- parent unit address: The unit address in the domain of the interrupt parent. The number of 32-bit cells required to specify this address is described by the #address-cells property of the node pointed to by the interrupt-parent field.","- parent interrupt specifier: The interrupt specifier in the parent domain. The number of 32-bit cells required to specify this component is described by the #interrupt-cells property of the node pointed to by the interrupt-parent field.","Lookups are performed on the interrupt mapping table by matching a unit-address/interrupt specifier pair against the child components in the interrupt-map. Because some fields in the unit interrupt specifier may not be relevant, a mask is applied before the lookup is done. This mask is defined in the interrupt-map-mask property","Note: Both the child node and the interrupt parent node are required to have #address-cells and #interrupt-cells properties defined. If a unit address component is not required ,#address-cells shall be explicitly defined to be zero."],t};var SN;(function(t){function e(n){return typeof n=="string"}t.is=e})(SN||(SN={}));var Eg;(function(t){function e(n){return typeof n=="string"}t.is=e})(Eg||(Eg={}));var EN;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(EN||(EN={}));var Fd;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(Fd||(Fd={}));var fr;(function(t){function e(r,s){return r===Number.MAX_VALUE&&(r=Fd.MAX_VALUE),s===Number.MAX_VALUE&&(s=Fd.MAX_VALUE),{line:r,character:s}}t.create=e;function n(r){let s=r;return O.objectLiteral(s)&&O.uinteger(s.line)&&O.uinteger(s.character)}t.is=n})(fr||(fr={}));var Tt;(function(t){function e(r,s,i,o){if(O.uinteger(r)&&O.uinteger(s)&&O.uinteger(i)&&O.uinteger(o))return{start:fr.create(r,s),end:fr.create(i,o)};if(fr.is(r)&&fr.is(s))return{start:r,end:s};throw new Error(`Range#create called with invalid arguments[${r}, ${s}, ${i}, ${o}]`)}t.create=e;function n(r){let s=r;return O.objectLiteral(s)&&fr.is(s.start)&&fr.is(s.end)}t.is=n})(Tt||(Tt={}));var Bd;(function(t){function e(r,s){return{uri:r,range:s}}t.create=e;function n(r){let s=r;return O.objectLiteral(s)&&Tt.is(s.range)&&(O.string(s.uri)||O.undefined(s.uri))}t.is=n})(Bd||(Bd={}));var wN;(function(t){function e(r,s,i,o){return{targetUri:r,targetRange:s,targetSelectionRange:i,originSelectionRange:o}}t.create=e;function n(r){let s=r;return O.objectLiteral(s)&&Tt.is(s.targetRange)&&O.string(s.targetUri)&&Tt.is(s.targetSelectionRange)&&(Tt.is(s.originSelectionRange)||O.undefined(s.originSelectionRange))}t.is=n})(wN||(wN={}));var wg;(function(t){function e(r,s,i,o){return{red:r,green:s,blue:i,alpha:o}}t.create=e;function n(r){let s=r;return O.objectLiteral(s)&&O.numberRange(s.red,0,1)&&O.numberRange(s.green,0,1)&&O.numberRange(s.blue,0,1)&&O.numberRange(s.alpha,0,1)}t.is=n})(wg||(wg={}));var kN;(function(t){function e(r,s){return{range:r,color:s}}t.create=e;function n(r){let s=r;return O.objectLiteral(s)&&Tt.is(s.range)&&wg.is(s.color)}t.is=n})(kN||(kN={}));var NN;(function(t){function e(r,s,i){return{label:r,textEdit:s,additionalTextEdits:i}}t.create=e;function n(r){let s=r;return O.objectLiteral(s)&&O.string(s.label)&&(O.undefined(s.textEdit)||Co.is(s))&&(O.undefined(s.additionalTextEdits)||O.typedArray(s.additionalTextEdits,Co.is))}t.is=n})(NN||(NN={}));var PN;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(PN||(PN={}));var RN;(function(t){function e(r,s,i,o,a,c){let l={startLine:r,endLine:s};return O.defined(i)&&(l.startCharacter=i),O.defined(o)&&(l.endCharacter=o),O.defined(a)&&(l.kind=a),O.defined(c)&&(l.collapsedText=c),l}t.create=e;function n(r){let s=r;return O.objectLiteral(s)&&O.uinteger(s.startLine)&&O.uinteger(s.startLine)&&(O.undefined(s.startCharacter)||O.uinteger(s.startCharacter))&&(O.undefined(s.endCharacter)||O.uinteger(s.endCharacter))&&(O.undefined(s.kind)||O.string(s.kind))}t.is=n})(RN||(RN={}));var kg;(function(t){function e(r,s){return{location:r,message:s}}t.create=e;function n(r){let s=r;return O.defined(s)&&Bd.is(s.location)&&O.string(s.message)}t.is=n})(kg||(kg={}));var En;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(En||(En={}));var DN;(function(t){t.Unnecessary=1,t.Deprecated=2})(DN||(DN={}));var CN;(function(t){function e(n){let r=n;return O.objectLiteral(r)&&O.string(r.href)}t.is=e})(CN||(CN={}));var Ud;(function(t){function e(r,s,i,o,a,c){let l={range:r,message:s};return O.defined(i)&&(l.severity=i),O.defined(o)&&(l.code=o),O.defined(a)&&(l.source=a),O.defined(c)&&(l.relatedInformation=c),l}t.create=e;function n(r){var s;let i=r;return O.defined(i)&&Tt.is(i.range)&&O.string(i.message)&&(O.number(i.severity)||O.undefined(i.severity))&&(O.integer(i.code)||O.string(i.code)||O.undefined(i.code))&&(O.undefined(i.codeDescription)||O.string((s=i.codeDescription)===null||s===void 0?void 0:s.href))&&(O.string(i.source)||O.undefined(i.source))&&(O.undefined(i.relatedInformation)||O.typedArray(i.relatedInformation,kg.is))}t.is=n})(Ud||(Ud={}));var Do;(function(t){function e(r,s,...i){let o={title:r,command:s};return O.defined(i)&&i.length>0&&(o.arguments=i),o}t.create=e;function n(r){let s=r;return O.defined(s)&&O.string(s.title)&&O.string(s.command)}t.is=n})(Do||(Do={}));var Co;(function(t){function e(i,o){return{range:i,newText:o}}t.replace=e;function n(i,o){return{range:{start:i,end:i},newText:o}}t.insert=n;function r(i){return{range:i,newText:""}}t.del=r;function s(i){let o=i;return O.objectLiteral(o)&&O.string(o.newText)&&Tt.is(o.range)}t.is=s})(Co||(Co={}));var Ng;(function(t){function e(r,s,i){let o={label:r};return s!==void 0&&(o.needsConfirmation=s),i!==void 0&&(o.description=i),o}t.create=e;function n(r){let s=r;return O.objectLiteral(s)&&O.string(s.label)&&(O.boolean(s.needsConfirmation)||s.needsConfirmation===void 0)&&(O.string(s.description)||s.description===void 0)}t.is=n})(Ng||(Ng={}));var Ao;(function(t){function e(n){let r=n;return O.string(r)}t.is=e})(Ao||(Ao={}));var AN;(function(t){function e(i,o,a){return{range:i,newText:o,annotationId:a}}t.replace=e;function n(i,o,a){return{range:{start:i,end:i},newText:o,annotationId:a}}t.insert=n;function r(i,o){return{range:i,newText:"",annotationId:o}}t.del=r;function s(i){let o=i;return Co.is(o)&&(Ng.is(o.annotationId)||Ao.is(o.annotationId))}t.is=s})(AN||(AN={}));var Pg;(function(t){function e(r,s){return{textDocument:r,edits:s}}t.create=e;function n(r){let s=r;return O.defined(s)&&Og.is(s.textDocument)&&Array.isArray(s.edits)}t.is=n})(Pg||(Pg={}));var Rg;(function(t){function e(r,s,i){let o={kind:"create",uri:r};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(o.options=s),i!==void 0&&(o.annotationId=i),o}t.create=e;function n(r){let s=r;return s&&s.kind==="create"&&O.string(s.uri)&&(s.options===void 0||(s.options.overwrite===void 0||O.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||O.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||Ao.is(s.annotationId))}t.is=n})(Rg||(Rg={}));var Dg;(function(t){function e(r,s,i,o){let a={kind:"rename",oldUri:r,newUri:s};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(a.options=i),o!==void 0&&(a.annotationId=o),a}t.create=e;function n(r){let s=r;return s&&s.kind==="rename"&&O.string(s.oldUri)&&O.string(s.newUri)&&(s.options===void 0||(s.options.overwrite===void 0||O.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||O.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||Ao.is(s.annotationId))}t.is=n})(Dg||(Dg={}));var Cg;(function(t){function e(r,s,i){let o={kind:"delete",uri:r};return s!==void 0&&(s.recursive!==void 0||s.ignoreIfNotExists!==void 0)&&(o.options=s),i!==void 0&&(o.annotationId=i),o}t.create=e;function n(r){let s=r;return s&&s.kind==="delete"&&O.string(s.uri)&&(s.options===void 0||(s.options.recursive===void 0||O.boolean(s.options.recursive))&&(s.options.ignoreIfNotExists===void 0||O.boolean(s.options.ignoreIfNotExists)))&&(s.annotationId===void 0||Ao.is(s.annotationId))}t.is=n})(Cg||(Cg={}));var Ag;(function(t){function e(n){let r=n;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(s=>O.string(s.kind)?Rg.is(s)||Dg.is(s)||Cg.is(s):Pg.is(s)))}t.is=e})(Ag||(Ag={}));var ON;(function(t){function e(r){return{uri:r}}t.create=e;function n(r){let s=r;return O.defined(s)&&O.string(s.uri)}t.is=n})(ON||(ON={}));var IN;(function(t){function e(r,s){return{uri:r,version:s}}t.create=e;function n(r){let s=r;return O.defined(s)&&O.string(s.uri)&&O.integer(s.version)}t.is=n})(IN||(IN={}));var Og;(function(t){function e(r,s){return{uri:r,version:s}}t.create=e;function n(r){let s=r;return O.defined(s)&&O.string(s.uri)&&(s.version===null||O.integer(s.version))}t.is=n})(Og||(Og={}));var xN;(function(t){function e(r,s,i,o){return{uri:r,languageId:s,version:i,text:o}}t.create=e;function n(r){let s=r;return O.defined(s)&&O.string(s.uri)&&O.string(s.languageId)&&O.integer(s.version)&&O.string(s.text)}t.is=n})(xN||(xN={}));var Ig;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(n){let r=n;return r===t.PlainText||r===t.Markdown}t.is=e})(Ig||(Ig={}));var Ya;(function(t){function e(n){let r=n;return O.objectLiteral(n)&&Ig.is(r.kind)&&O.string(r.value)}t.is=e})(Ya||(Ya={}));var MN;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(MN||(MN={}));var LN;(function(t){t.PlainText=1,t.Snippet=2})(LN||(LN={}));var $N;(function(t){t.Deprecated=1})($N||($N={}));var qN;(function(t){function e(r,s,i){return{newText:r,insert:s,replace:i}}t.create=e;function n(r){let s=r;return s&&O.string(s.newText)&&Tt.is(s.insert)&&Tt.is(s.replace)}t.is=n})(qN||(qN={}));var jN;(function(t){t.asIs=1,t.adjustIndentation=2})(jN||(jN={}));var FN;(function(t){function e(n){let r=n;return r&&(O.string(r.detail)||r.detail===void 0)&&(O.string(r.description)||r.description===void 0)}t.is=e})(FN||(FN={}));var BN;(function(t){function e(n){return{label:n}}t.create=e})(BN||(BN={}));var UN;(function(t){function e(n,r){return{items:n||[],isIncomplete:!!r}}t.create=e})(UN||(UN={}));var Vd;(function(t){function e(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function n(r){let s=r;return O.string(s)||O.objectLiteral(s)&&O.string(s.language)&&O.string(s.value)}t.is=n})(Vd||(Vd={}));var VN;(function(t){function e(n){let r=n;return!!r&&O.objectLiteral(r)&&(Ya.is(r.contents)||Vd.is(r.contents)||O.typedArray(r.contents,Vd.is))&&(n.range===void 0||Tt.is(n.range))}t.is=e})(VN||(VN={}));var zN;(function(t){function e(n,r){return r?{label:n,documentation:r}:{label:n}}t.create=e})(zN||(zN={}));var WN;(function(t){function e(n,r,...s){let i={label:n};return O.defined(r)&&(i.documentation=r),O.defined(s)?i.parameters=s:i.parameters=[],i}t.create=e})(WN||(WN={}));var HN;(function(t){t.Text=1,t.Read=2,t.Write=3})(HN||(HN={}));var GN;(function(t){function e(n,r){let s={range:n};return O.number(r)&&(s.kind=r),s}t.create=e})(GN||(GN={}));var KN;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(KN||(KN={}));var YN;(function(t){t.Deprecated=1})(YN||(YN={}));var XN;(function(t){function e(n,r,s,i,o){let a={name:n,kind:r,location:{uri:i,range:s}};return o&&(a.containerName=o),a}t.create=e})(XN||(XN={}));var JN;(function(t){function e(n,r,s,i){return i!==void 0?{name:n,kind:r,location:{uri:s,range:i}}:{name:n,kind:r,location:{uri:s}}}t.create=e})(JN||(JN={}));var QN;(function(t){function e(r,s,i,o,a,c){let l={name:r,detail:s,kind:i,range:o,selectionRange:a};return c!==void 0&&(l.children=c),l}t.create=e;function n(r){let s=r;return s&&O.string(s.name)&&O.number(s.kind)&&Tt.is(s.range)&&Tt.is(s.selectionRange)&&(s.detail===void 0||O.string(s.detail))&&(s.deprecated===void 0||O.boolean(s.deprecated))&&(s.children===void 0||Array.isArray(s.children))&&(s.tags===void 0||Array.isArray(s.tags))}t.is=n})(QN||(QN={}));var ZN;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(ZN||(ZN={}));var zd;(function(t){t.Invoked=1,t.Automatic=2})(zd||(zd={}));var eP;(function(t){function e(r,s,i){let o={diagnostics:r};return s!=null&&(o.only=s),i!=null&&(o.triggerKind=i),o}t.create=e;function n(r){let s=r;return O.defined(s)&&O.typedArray(s.diagnostics,Ud.is)&&(s.only===void 0||O.typedArray(s.only,O.string))&&(s.triggerKind===void 0||s.triggerKind===zd.Invoked||s.triggerKind===zd.Automatic)}t.is=n})(eP||(eP={}));var tP;(function(t){function e(r,s,i){let o={title:r},a=!0;return typeof s=="string"?(a=!1,o.kind=s):Do.is(s)?o.command=s:o.edit=s,a&&i!==void 0&&(o.kind=i),o}t.create=e;function n(r){let s=r;return s&&O.string(s.title)&&(s.diagnostics===void 0||O.typedArray(s.diagnostics,Ud.is))&&(s.kind===void 0||O.string(s.kind))&&(s.edit!==void 0||s.command!==void 0)&&(s.command===void 0||Do.is(s.command))&&(s.isPreferred===void 0||O.boolean(s.isPreferred))&&(s.edit===void 0||Ag.is(s.edit))}t.is=n})(tP||(tP={}));var nP;(function(t){function e(r,s){let i={range:r};return O.defined(s)&&(i.data=s),i}t.create=e;function n(r){let s=r;return O.defined(s)&&Tt.is(s.range)&&(O.undefined(s.command)||Do.is(s.command))}t.is=n})(nP||(nP={}));var rP;(function(t){function e(r,s){return{tabSize:r,insertSpaces:s}}t.create=e;function n(r){let s=r;return O.defined(s)&&O.uinteger(s.tabSize)&&O.boolean(s.insertSpaces)}t.is=n})(rP||(rP={}));var sP;(function(t){function e(r,s,i){return{range:r,target:s,data:i}}t.create=e;function n(r){let s=r;return O.defined(s)&&Tt.is(s.range)&&(O.undefined(s.target)||O.string(s.target))}t.is=n})(sP||(sP={}));var iP;(function(t){function e(r,s){return{range:r,parent:s}}t.create=e;function n(r){let s=r;return O.objectLiteral(s)&&Tt.is(s.range)&&(s.parent===void 0||t.is(s.parent))}t.is=n})(iP||(iP={}));var oP;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(oP||(oP={}));var aP;(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(aP||(aP={}));var cP;(function(t){function e(n){let r=n;return O.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}t.is=e})(cP||(cP={}));var lP;(function(t){function e(r,s){return{range:r,text:s}}t.create=e;function n(r){let s=r;return s!=null&&Tt.is(s.range)&&O.string(s.text)}t.is=n})(lP||(lP={}));var uP;(function(t){function e(r,s,i){return{range:r,variableName:s,caseSensitiveLookup:i}}t.create=e;function n(r){let s=r;return s!=null&&Tt.is(s.range)&&O.boolean(s.caseSensitiveLookup)&&(O.string(s.variableName)||s.variableName===void 0)}t.is=n})(uP||(uP={}));var dP;(function(t){function e(r,s){return{range:r,expression:s}}t.create=e;function n(r){let s=r;return s!=null&&Tt.is(s.range)&&(O.string(s.expression)||s.expression===void 0)}t.is=n})(dP||(dP={}));var fP;(function(t){function e(r,s){return{frameId:r,stoppedLocation:s}}t.create=e;function n(r){let s=r;return O.defined(s)&&Tt.is(r.stoppedLocation)}t.is=n})(fP||(fP={}));var xg;(function(t){t.Type=1,t.Parameter=2;function e(n){return n===1||n===2}t.is=e})(xg||(xg={}));var Mg;(function(t){function e(r){return{value:r}}t.create=e;function n(r){let s=r;return O.objectLiteral(s)&&(s.tooltip===void 0||O.string(s.tooltip)||Ya.is(s.tooltip))&&(s.location===void 0||Bd.is(s.location))&&(s.command===void 0||Do.is(s.command))}t.is=n})(Mg||(Mg={}));var hP;(function(t){function e(r,s,i){let o={position:r,label:s};return i!==void 0&&(o.kind=i),o}t.create=e;function n(r){let s=r;return O.objectLiteral(s)&&fr.is(s.position)&&(O.string(s.label)||O.typedArray(s.label,Mg.is))&&(s.kind===void 0||xg.is(s.kind))&&s.textEdits===void 0||O.typedArray(s.textEdits,Co.is)&&(s.tooltip===void 0||O.string(s.tooltip)||Ya.is(s.tooltip))&&(s.paddingLeft===void 0||O.boolean(s.paddingLeft))&&(s.paddingRight===void 0||O.boolean(s.paddingRight))}t.is=n})(hP||(hP={}));var pP;(function(t){function e(n){return{kind:"snippet",value:n}}t.createSnippet=e})(pP||(pP={}));var mP;(function(t){function e(n,r,s,i){return{insertText:n,filterText:r,range:s,command:i}}t.create=e})(mP||(mP={}));var gP;(function(t){function e(n){return{items:n}}t.create=e})(gP||(gP={}));var yP;(function(t){t.Invoked=0,t.Automatic=1})(yP||(yP={}));var bP;(function(t){function e(n,r){return{range:n,text:r}}t.create=e})(bP||(bP={}));var vP;(function(t){function e(n,r){return{triggerKind:n,selectedCompletionInfo:r}}t.create=e})(vP||(vP={}));var TP;(function(t){function e(n){let r=n;return O.objectLiteral(r)&&Eg.is(r.uri)&&O.string(r.name)}t.is=e})(TP||(TP={}));var _P;(function(t){function e(i,o,a,c){return new Lg(i,o,a,c)}t.create=e;function n(i){let o=i;return!!(O.defined(o)&&O.string(o.uri)&&(O.undefined(o.languageId)||O.string(o.languageId))&&O.uinteger(o.lineCount)&&O.func(o.getText)&&O.func(o.positionAt)&&O.func(o.offsetAt))}t.is=n;function r(i,o){let a=i.getText(),c=s(o,(u,d)=>{let f=u.range.start.line-d.range.start.line;return f===0?u.range.start.character-d.range.start.character:f}),l=a.length;for(let u=c.length-1;u>=0;u--){let d=c[u],f=i.offsetAt(d.range.start),h=i.offsetAt(d.range.end);if(h<=l)a=a.substring(0,f)+d.newText+a.substring(h,a.length);else throw new Error("Overlapping edit");l=f}return a}t.applyEdits=r;function s(i,o){if(i.length<=1)return i;let a=i.length/2|0,c=i.slice(0,a),l=i.slice(a);s(c,o),s(l,o);let u=0,d=0,f=0;for(;u<c.length&&d<l.length;)o(c[u],l[d])<=0?i[f++]=c[u++]:i[f++]=l[d++];for(;u<c.length;)i[f++]=c[u++];for(;d<l.length;)i[f++]=l[d++];return i}})(_P||(_P={}));var Lg=class{constructor(e,n,r,s){this._uri=e,this._languageId=n,this._version=r,this._content=s,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){this._content=e.text,this._version=n,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],n=this._content,r=!0;for(let s=0;s<n.length;s++){r&&(e.push(s),r=!1);let i=n.charAt(s);r=i==="\r"||i===`
231
+ `,i==="\r"&&s+1<n.length&&n.charAt(s+1)===`
232
+ `&&s++}r&&n.length>0&&e.push(n.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,s=n.length;if(s===0)return fr.create(0,e);for(;r<s;){let o=Math.floor((r+s)/2);n[o]>e?s=o:r=o+1}let i=r-1;return fr.create(i,e-n[i])}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],s=e.line+1<n.length?n[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,s),r)}get lineCount(){return this.getLineOffsets().length}},O;(function(t){let e=Object.prototype.toString;function n(h){return typeof h<"u"}t.defined=n;function r(h){return typeof h>"u"}t.undefined=r;function s(h){return h===!0||h===!1}t.boolean=s;function i(h){return e.call(h)==="[object String]"}t.string=i;function o(h){return e.call(h)==="[object Number]"}t.number=o;function a(h,y,m){return e.call(h)==="[object Number]"&&y<=h&&h<=m}t.numberRange=a;function c(h){return e.call(h)==="[object Number]"&&-2147483648<=h&&h<=2147483647}t.integer=c;function l(h){return e.call(h)==="[object Number]"&&0<=h&&h<=2147483647}t.uinteger=l;function u(h){return e.call(h)==="[object Function]"}t.func=u;function d(h){return h!==null&&typeof h=="object"}t.objectLiteral=d;function f(h,y){return Array.isArray(h)&&h.every(y)}t.typedArray=f})(O||(O={}));var SP=()=>{let t=new K("interrupt-map-mask",B("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,n)=>{let r=[],s=e.parent,i=Ee(e.ast.values);if(!i?.length)return[];let o=s.getProperty("#interrupt-cells");if(!o)return r;let a=s.addressCells(n),c=Pe(o,0,0,n);return c==null?r:(t.typeExample=`<${[...Array.from({length:a},()=>"AddressMask"),...Array.from({length:c},()=>"InterruptMask")].join(" ")}> `,i.length!==a+c&&r.push($(19,e.ast.values??e.ast,En.Error,[],[],[e.name,t.typeExample])),r)});return t.description=["An interrupt-map-mask property is specified for a nexus node in the interrupt tree. This property specifies a mask that is ANDed with the incoming unit interrupt specifier being looked up in the table specified in the interrupt-mapproperty."],t};var Ti=Y(Q());var EP=()=>{let t=new K(/^(?!interrupt-|no-).*?-map$/,B("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,n)=>{let r=e.name.split("-map",1)[0],s=[],i=e.parent,o=e.parent.root,a=i.getProperty(`#${r}-cells`);if(!a)return s.push($(16,e.ast,Ti.DiagnosticSeverity.Error,[...i.nodeNameOrLabelRef],[],[e.name,`#${r}-cells`,`/${i.path.slice(1).join("/")}`])),s;let c=Pe(a,0,0,n);if(c==null)return s;let l=Ee(e.ast.values);if(!l?.length)return[];let u={},d=0,f=0,h=[];for(;d<l.length;){let y=new j(G(l.at(d).firstToken,l.at(c+d-1).lastToken)),m="";for(let b=d;b<c+d;b++){let R=l[b];m+=`${R instanceof ft?R.evaluate(n).toString():R.toString()}:`}if(u[m]??=[],u[m].push(y),d+=c,t.typeExample??="",h.push([...Array.from({length:c},()=>"ChildSpecifier"),"SpecifierParent ParentSpecifier..."]),l.length<d+1){let b=c+1;s.push($(20,l[l.length-1],Ti.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${h.at(-1).slice((l.length-f)%b===0?b:(l.length-f)%b).join(" ")}`]));break}let _=Ln(l[d],o);if(!_){s.push($(17,l[d],Ti.DiagnosticSeverity.Error));break}let E=_.getProperty(`#${r}-cells`);if(!E)return s.push($(16,l[d],Ti.DiagnosticSeverity.Error,[..._.nodeNameOrLabelRef],[],[e.name,`#${r}-cells`,`/${i.path.slice(1).join("/")}`])),s;d++;let T=Pe(E,0,0,n);if(T==null)break;if(h.splice(-1,1,[...Array.from({length:c},()=>"ChildSpecifier"),"SpecifierParent",...Array.from({length:T},()=>"ParentSpecifier")]),d+=T,l.length<d){let b=c+1+T;s.push($(20,l[l.length-1],Ti.DiagnosticSeverity.Error,[],[],[e.name,`after the last value of ${h.at(-1).slice((l.length-f)%b===0?b:(l.length-f)%b).join(" ")}`]));break}f=d}return t.typeExample=h.map(y=>`<${y.join(" ")}>`).join(`
233
+ `),Object.values(u).forEach(y=>{y.length>1&&s.push($(30,y[y.length-1],Ti.DiagnosticSeverity.Error,y.slice(0,-1)))}),s});return t.description=["A `\u2039specifier>-map` is a property in a nexus node that bridges one specifier domain with a set of parent specifier domains and describes how specifiers in the child domain are mapped to their respective parent domains.","The map is a table where each row is a mapping entry consisting of three components: child specifier, specifier parent, and parent specifier.","- child specifier The specifier of the child node being mapped. The number of 32-bit cells required to specify this component is described by the `#<specifier>-cells` property of this node-the nexus node containing the \u2039specifier>-map property.","- Specifier parent A single <phandle > value that points to the specifier parent to which the child domain is being mapped.","- Parent specifier: The specifier in the parent domain. The number of 32-bit cells required to specify this component is described by the `#<specifier>-cells` property of the specifier parent node.","Lookups are performed on the mapping table by matching a specifier against the child specifier in the map. Because some fields in the specifier may not be relevant or need to be modified, a mask is applied before the lookup is done. This mask is defined in the `<specifier>-map-mask` property","Similarly, when the specifier is mapped, some fields in the unit specifier may need to be kept unmodified and passed through from the child node to the parent node. In this case, a `<specifier>-map-pass-thru` property may be specified to apply a mask to the child specifier and copy any bits that match to the parent unit specifier."],t.list=!0,t};var wP=()=>{let t=new K(/^(?!interrupt-).*?-map-mask$/,B("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,n)=>{let r=[],s=e.parent,i=Ee(e.ast.values);if(!i?.length)return[];let o=e.name.split("-map",1)[0],a=s.getProperty(`#${o}-cells`);if(!a)return r;let c=Pe(a,0,0,n);return c==null?r:(t.typeExample=`<${[...Array.from({length:c},()=>"mask")].join(" ")}> `,i.length!==c&&r.push($(19,e.ast.values??e.ast,En.Error,[],[],[e.name,t.typeExample])),r)});return t.description=["A `<specifier>-map-mask` property may be specified for a nexus node. This property specifies a mask that is ANDed with the child unit specifier being looked up in the table specified in the `<specifier>-map` property. If this propertyis notspecified, the maskis assumedto be a mask with all bits set."],t};var kP=()=>{let t=new K(/^(?!interrupt-).*?-map-pass-thru$/,B("PROP_ENCODED_ARRAY"),"optional",void 0,void 0,(e,n)=>{let r=[],s=e.parent,i=Ee(e.ast.values);if(!i?.length)return[];let o=e.name.split("-map",1)[0],a=s.getProperty(`#${o}-cells`);if(!a)return r;let c=Pe(a,0,0,n);return c==null?r:(t.typeExample=`<${[...Array.from({length:c},()=>"mask")].join(" ")}> `,i.length!==c&&r.push($(19,e.ast.values??e.ast,En.Error,[],[],[e.name,t.typeExample])),r)});return t.description=["A `<specifier>-map-pass-thru` property may be specified for a nexus node. This property specifies a mask that is applied to the child unit specifier being looked up in the table specified in the `<specifier>-map` property. Any matching bits in the child unit specifier are copied over to the parent specifier. If this property is not specified, the mask isassumedtobe amaskwithno bits set."],t};var NP=()=>{let t=new K(/^(?!#(?:address-|interrupt-|size-)).*-cells$/,B("U32"));return t.list=!0,t.description=["The `#<specifier>-cells` propertydefines the number of cells required to encode a specifier for adomain."],t};function wn(){let t=new Sn;return t.addProperty([rN(),vN(),bN(),gN(),qd(),$d(),mN(),pN(),Ld(),hN(),dN(),uN(),TN(),sN(),cN(),aN(),lN(),iN(),oN(),_N(),SP(),EP(),wP(),kP(),NP()]),t}var PP=()=>{let t=new K("chassis-type",B("STRING"),"optional",void 0,["desktop","laptop","convertible","server","tablet","handset","watch","embedded"]);return t.description=["Specifies a string that identifies the form-factor of the system."],t};var RP=()=>{let t=new K("serial-number",B("STRING"),"optional");return t.description=[`Specifies a string representing the device\u2019s se-
234
+ rialnumber.`],t};function DP(){let t=wn();t.noMismatchPropertiesAllowed=!0;let e=t.properties.find(i=>i.name==="#address-cells");e.required=()=>"required";let n=t.properties.find(i=>i.name==="#size-cells");n.required=()=>"required";let r=t.properties.find(i=>i.name==="model");r.required=()=>"required";let s=t.properties.find(i=>i.name==="compatible");return s.required=()=>"required",t.addProperty([PP(),RP()]),t}var Cs=Y(Q());function CP(){let t=new Sn((n,r)=>{let s=[];return r.parent?.name!=="/"&&s.push($(26,r.definitions[0],Cs.DiagnosticSeverity.Error,r.definitions.slice(1),[],["Aliases node can only be added to a root node"])),r.nodes.forEach(i=>{i.definitions.forEach(o=>{s.push($(26,o,Cs.DiagnosticSeverity.Error,[],[],["Aliases node can not have child nodes"],Cs.TextEdit.del(mi(o.firstToken.prevToken,o.lastToken,!1)),"Delete Node"))})}),s});t.noMismatchPropertiesAllowed=!0;let e=new K(/^[-A-Za-z0-9]+$/,B(["STRING","U32"]),void 0,void 0,void 0,n=>{let r=[],s=n.ast.quickValues;if(s?.length===1&&typeof s[0]=="string"){if(!s[0].startsWith("/"))return r.push($(23,n.ast.values??n.ast,Cs.DiagnosticSeverity.Error,[],[],[s[0],n.name])),r;if(s[0].trim().endsWith("/"))return r.push($(23,n.ast.values??n.ast,Cs.DiagnosticSeverity.Error,[],[],["",s[0]])),r;let i=n.parent.root,o=s[0].split("/").slice(1);for(;o[0];){let a=i,c=o.splice(0,1)[0],[l,u]=c.split("@"),d=u?.split(",").map(f=>Number.parseInt(f,16));if(i=l?a.getNode(l,d,!1):void 0,!i){r.push($(23,n.ast.values??n.ast,Cs.DiagnosticSeverity.Error,[],[],[l,a.fullName]));break}}}return r});return e.description=["Each property of the /aliases node defines an alias."],t.addProperty([e]),t}function AP(){let t=wn();t.noMismatchPropertiesAllowed=!0;let e=t.properties.find(n=>n.name==="reg");return e.required=()=>"required",t}var IP=Y(Q());var OP=(t,e,n)=>{let r=t?.(e,n)??[],s=e.parent.root.getProperty(e.name),i=s?Pe(s,0,0,n):void 0,o=e.parent.getProperty(e.name);return(o?Pe(o,0,0,n):void 0)!==i&&r.push($(28,e.ast,IP.DiagnosticSeverity.Error,[...s?.ast?[s.ast]:[]],void 0,[`${e.name} value in this node must match value of root node`])),r};function xP(){let t=new Sn;t.noMismatchPropertiesAllowed=!0;let e=qd(),n=e?.additionalTypeCheck;e.additionalTypeCheck=(o,a)=>OP(n,o,a),e.required=()=>"required";let r=$d(),s=r?.additionalTypeCheck;r.additionalTypeCheck=(o,a)=>OP(s,o,a),r.required=()=>"required";let i=Ld();return i.required=()=>"required",i.type=B("EMPTY"),i.additionalTypeCheck=void 0,t.addProperty([e,r,i]),t}var MP=Y(Q());function LP(){let t=wn();t.additionalValidations=(s,i)=>{let o=[];return i.parent?.name!=="/"&&o.push($(26,i.definitions[0],MP.DiagnosticSeverity.Error,i.definitions.slice(1),[],["Chosen node can only be added to a root node"])),o};let e=new K("bootargs",B("STRING"));e.description=[`A string that specifies the boot arguments for
232
235
  theclientprogram. Thevaluecouldpotentially
233
236
  be a null string if no boot arguments are re-
234
- quired.`];let t=new G("stdout-path ",W("STRING"));t.description=[`A string that specifies the full path to the node
237
+ quired.`];let n=new K("stdout-path ",B("STRING"));n.description=[`A string that specifies the full path to the node
235
238
  representingthedevicetobeusedforbootcon-
236
239
  soleoutput. Ifthecharacter\u201C:\u201Dispresentinthe
237
240
  valueit terminates thepath. Thevalue maybe
238
241
  an alias. If the stdin-path property is not spec-
239
242
  ified, stdout-path should be assumed to define
240
- theinput device.`];let r=new G("stdin-path ",W("STRING"));return r.description=[`A string that specifies the boot arguments for
243
+ theinput device.`];let r=new K("stdin-path ",B("STRING"));return r.description=[`A string that specifies the boot arguments for
241
244
  theclientprogram. Thevaluecouldpotentially
242
245
  be a null string if no boot arguments are re-
243
- quired.`],n.addProperty([e,t,r]),n}var ug=K(X());function fN(){let n=Wn();n.additionalValidations=(s,i)=>i.parent?.name!=="/"?[F(27,i.definitions[0],ug.DiagnosticSeverity.Error,i.definitions.slice(1),[],["Cpus node can only be added to a root node"])]:[];let e=n.properties.find(s=>s.name==="#address-cells");e.required=()=>"required";let t=n.properties.find(s=>s.name==="#size-cells");t.required=()=>"required";let r=t?.additionalTypeCheck;return t.additionalTypeCheck=(s,i)=>{let o=r?.(s,i)??[],a=s.parent.getProperty(s.name);return(a?at(a,0,0,i):void 0)!==0&&o.push(F(29,s.ast,ug.DiagnosticSeverity.Error,void 0,void 0,[`${s.name} value in cpus node must be '0'`])),o},n}var hN=K(X());function pN(){let n=Wn();n.additionalValidations=(r,s)=>s.parent?.name!=="cpus"?[F(27,s.definitions[0],hN.DiagnosticSeverity.Error,s.definitions.slice(1),[],["`cpu` node can only be a child of `cpus` node"])]:[];let e=n.properties.find(r=>r.name==="device_type");e.required=()=>"required";let t=n.properties.find(r=>r.name==="reg");return t.required=()=>"required",t.description=[`The value of reg is a \u2039prop-encoded-array> that defines a unique CPU/thread id for the
246
+ quired.`],t.addProperty([e,n,r]),t}var $g=Y(Q());function $P(){let t=wn();t.additionalValidations=(s,i)=>i.parent?.name!=="/"?[$(26,i.definitions[0],$g.DiagnosticSeverity.Error,i.definitions.slice(1),[],["Cpus node can only be added to a root node"])]:[];let e=t.properties.find(s=>s.name==="#address-cells");e.required=()=>"required";let n=t.properties.find(s=>s.name==="#size-cells");n.required=()=>"required";let r=n?.additionalTypeCheck;return n.additionalTypeCheck=(s,i)=>{let o=r?.(s,i)??[],a=s.parent.getProperty(s.name);return(a?Pe(a,0,0,i):void 0)!==0&&o.push($(28,s.ast,$g.DiagnosticSeverity.Error,void 0,void 0,[`${s.name} value in cpus node must be '0'`])),o},t}var qP=Y(Q());function jP(){let t=wn();t.additionalValidations=(r,s)=>s.parent?.name!=="cpus"?[$(26,s.definitions[0],qP.DiagnosticSeverity.Error,s.definitions.slice(1),[],["`cpu` node can only be a child of `cpus` node"])]:[];let e=t.properties.find(r=>r.name==="device_type");e.required=()=>"required";let n=t.properties.find(r=>r.name==="reg");return n.required=()=>"required",n.description=[`The value of reg is a \u2039prop-encoded-array> that defines a unique CPU/thread id for the
244
247
  CP U/threads represented by the CPU node.
245
248
  If a CPU supports more than one thread (i.e. multiple streams of execution) the reg property is an array with 1 element per thread.
246
249
  The #address-cells on the /cpus node specifies how many cells each element of the array takes. Software can determine the number of threads by dividing the size of reg by the parent node's #address-cells.
247
250
  If a CPU/thread can be the target of an external interrupt the reg property value must be a unique CPU/thread id that is addressable by the interrupt controller.
248
251
  If a CPU/thread cannot be the target of an external interrupt, then reg must be unique and out of bounds of the range addressed by the interrupt controller
249
252
  If a CPU/thread's PIR (pending interrupt reg-ister) is modifiable, a client program should modify PIR to match the reg property value.
250
- If PIR cannot be modified and the PIR value is distinct from the interrupt controller number space, the CPUs binding may define a binding-specific representation of PIR values if desired.`],n}function pi(n){switch(n?.name){case"/":return sN();case"aliases":return iN();case"memory":return oN();case"reserved-memory":return lN();case"chosen":return dN();case"cpus":return fN();case"cpu":return pN()}return Wn()}var Se=class n{constructor(e,t,r,s=null){this.bindingLoader=e;this.name=t;this.address=r;this.parent=s;this.referencedBy=[];this.definitions=[];this._properties=[];this._deletedProperties=[];this._deletedNodes=[];this.deletes=[];this._nodes=[];this.linkedNodeNamePaths=[];this.linkedRefLabels=[];s?.addNode(this)}static toJson(e){let t={};return e.property.forEach(r=>t[r.name]=r.ast.values?.toJson()??!0),e.nodes.forEach(r=>t[r.fullName]=n.toJson(r)),t}get nodeTypes(){if(this._nodeTypes)return this._nodeTypes;let e=this.parent?.nodeType?.childNodeType?.(this);return e?(this._nodeTypes=[e],this._nodeTypes):(this._nodeTypes=[pi(this)],this._nodeTypes)}get nodeType(){return this.nodeTypes.find(e=>!e.onBus||this.parent?.nodeType?.bus?.some(t=>t===e.onBus))}isChildOf(e){return this.parent?this.parent===e?!0:this.parent.isChildOf(e):!1}getReferenceBy(e){return this.referencedBy.some(t=>t===e)?this:[...this._nodes,...this._deletedNodes.map(t=>t.node)].map(t=>t.getReferenceBy(e)).find(t=>t)}get nodeNameOrLabelRef(){return go([...this.definitions,...this.referencedBy])}getDeepestAstNode(e,t){let r=[...this.definitions,...this.referencedBy].find(s=>On(s,e,t));if(r){let s=this.deletes.map(c=>({item:this,ast:Pr(c,e,t),beforeAst:La(c,e,t),afterAst:$a(c,e,t)})).find(c=>On(c.ast,e,t));if(s)return s;let i=[...this._properties.flatMap(c=>[c,...c.allReplaced]),...this._deletedProperties.flatMap(c=>[c.property,...c.property.allReplaced])].map(c=>({item:c,ast:c.ast})).find(c=>On(c.ast,e,t)||c.ast.lastToken.value!==";"&&pk(c.ast,e,t));if(i)return i.item.getDeepestAstNode(e,t);let o=[...this._nodes,...this._deletedNodes.map(c=>c.node)].map(c=>c.getDeepestAstNode(e,t)).find(c=>c);if(o)return o;let a=Pr(r,e,t);return{item:this,ast:a,beforeAst:La(a,e,t),afterAst:$a(a,e,t)}}}get labels(){return[...this.referencedBy.flatMap(e=>e.labels),...this.definitions.filter(e=>e instanceof Pe).flatMap(e=>e.labels)]}get labelsMapped(){return this.labels.map(e=>({label:e,owner:this}))}get allBindingsProperties(){return[...this.property.filter(e=>e.name==="compatible"),...this._nodes.flatMap(e=>e.allBindingsProperties)]}get allDescendantsLabels(){return[...this.labels,...this._nodes.flatMap(e=>e.allDescendantsLabels)]}get allDescendantsLabelsMapped(){return[...this.labelsMapped,...this.property.flatMap(e=>e.labelsMapped),...this._nodes.flatMap(e=>e.allDescendantsLabelsMapped)]}get issues(){let e=[...this.property.flatMap(t=>t.issues),...this._nodes.flatMap(t=>t.issues),...this._deletedNodes.flatMap(t=>t.node.issues),...this.deletedPropertiesIssues,...this.deletedNodesIssues];return this.name==="/"&&this.definitions.length&&(this._nodes.some(t=>t.name==="cpus")||e.push(Ot(9,this.definitions.at(-1),dr.DiagnosticSeverity.Error,this.definitions.slice(0,-1),void 0,["/","cpus"]))),e}get deletedPropertiesIssues(){return[...this._deletedProperties.flatMap(e=>[Ot(6,e.property.ast,dr.DiagnosticSeverity.Hint,[e.by],[dr.DiagnosticTag.Deprecated],[e.property.name]),...e.property.allReplaced.map(t=>Ot(6,t.ast,dr.DiagnosticSeverity.Hint,[e.by],[dr.DiagnosticTag.Deprecated],[e.property.name])),...e.property.issues])]}get deletedNodesIssues(){return this._deletedNodes.flatMap(e=>[...[...e.node.definitions.filter(t=>t instanceof Pe),...e.node.referencedBy].flatMap(t=>Ot(7,t,dr.DiagnosticSeverity.Hint,[e.by],[dr.DiagnosticTag.Deprecated],[t instanceof Pe?t.name.toString():t.labelReference.label.value]))])}get path(){return this.parent?[...this.parent.path,this.fullName]:[this.fullName]}get pathString(){return`/${this.path.slice(1).join("/")}`}get property(){return this._properties}get deletedProperties(){return this._deletedProperties}get nodes(){return this._nodes}get deletedNodes(){return this._deletedNodes}get propertyNames(){return this._properties.map(e=>e.name)}hasNode(e,t){return this._nodes.some(r=>r.name===e&&(r.address===t||r.address?.every((s,i)=>t?.at(i)===s)))}hasProperty(e){return this._properties.some(t=>t.name===e)}getProperty(e){return this._properties.find(t=>t.name===e)}deleteNode(e,t,r){let s=this._nodes.findIndex(i=>i.name===e&&(i.address===r||r?.every((o,a)=>i.address?.at(a)===o)));s!==-1&&(this._deletedNodes.push({node:this._nodes[s],by:t}),this._nodes.splice(s,1))}get root(){return this.parent?this.parent.root:this}getAllPhandle(e){let t=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(t instanceof St){let r=t.values[0].value;if(r instanceof It&&r.value===e)return[this,...this._nodes.flatMap(s=>s.getAllPhandle(e))]}return this._nodes.flatMap(r=>r.getAllPhandle(e))}getPhandle(e){let t=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(t instanceof St){let r=t.values[0].value;if(r instanceof It&&r.value===e)return this}return this._nodes.flatMap(r=>r.getPhandle(e)).find(r=>!!r)}getNode(e,t,r=!0){let s=r||!!t||this._nodes.filter(o=>o.name===e).length>1,i=this._nodes.findIndex(o=>o.name===e&&(!s||o.address===t||o.address?.every((a,c)=>t?.at(c)===a)));if(i!==-1)return this._nodes[i]}deleteProperty(e,t){let r=this._properties.findIndex(s=>s.name===e);r!==-1&&(this._deletedProperties.push({property:this._properties[r],by:t}),this._properties.splice(r,1))}addNode(e){this._nodes.push(e)}addProperty(e){let t=this._properties.findIndex(r=>r.name===e.name);if(t===-1)this._properties.push(e);else{let r=this._properties.splice(t,1)[0];this._properties.push(e),e.replaces=r,r.replacedBy=e}e.name==="compatible"&&(this.bindingLoader?this.bindingLoader.getNodeTypes(this).then(r=>this._nodeTypes=r):this._nodeTypes=[pi(this)])}getChild(e,t=!0){let r=[...e];r.splice(0,1);let s=r[0].split("@"),i=s[0],o=s[1]!==void 0?s[1].split(",").map(c=>Number.parseInt(c,16)):void 0,a=this.getNode(i,o,t);return r.length===1||!a?a:a.getChild(r)}getChildFromScope(e,t){if(e.length===1&&e[0]===this.fullName)return this;if(e[0]!==this.fullName)return;let r=[...e];return r.splice(0,1),[...this._nodes,...this._deletedNodes.filter(i=>!t(i.by)).map(i=>i.node)].find(i=>i.fullName===r[0])?.getChildFromScope(r,t)}get fullName(){return this.address!==void 0?`${this.name}@${this.address.map(e=>e.toString(16)).join(",")}`:this.name}#e;rangeMap(e){if(this.#e!==void 0)return this.#e;let t=this.getProperty("ranges");if(!t){this.#e=null;return}let r=this.sizeCells(e),s=this.addressCells(e),i=this.parentAddressCells(e),o=[],a=Mt(t.ast.values)?.reverse();for(;a?.length;){let c=Array.from({length:s}).map(()=>a.pop()),l=Array.from({length:i}).map(()=>a.pop()),u=Array.from({length:r}).map(()=>a.pop());[...c,...l,...u].every(y=>y instanceof Qt);let d=c.map(y=>y.evaluate(e)),f=l.map(y=>y.evaluate(e)),p=u.map(y=>y.evaluate(e));[...d,...f,...p].every(y=>typeof y=="number")&&o.push({childAddress:d,parentAddress:f,length:p,ast:new q(H(c[0].firstToken,u.at(-1).lastToken))})}return this.#e=o,this.#e}#t;dmaRangeMap(e){if(this.#t!==void 0)return this.#t;let t=this.getProperty("dma-ranges");if(!t){this.#t=null;return}let r=this.sizeCells(e),s=this.addressCells(e),i=this.parentAddressCells(e),o=[],a=Mt(t.ast.values)?.reverse();for(;a?.length;){let c=Array.from({length:s}).map(()=>a.pop()),l=Array.from({length:i}).map(()=>a.pop()),u=Array.from({length:r}).map(()=>a.pop());[...c,...l,...u].every(y=>y instanceof Qt);let d=c.map(y=>y.evaluate(e)),f=l.map(y=>y.evaluate(e)),p=u.map(y=>y.evaluate(e));[...d,...f,...p].every(y=>typeof y=="number")&&o.push({childAddress:d,parentAddress:f,length:p,ast:new q(H(c[0].firstToken,u.at(-1).lastToken))})}return this.#t=o,this.#t}parentAddressCells(e){return this.parent?.addressCells(e)??2}parentSizeCells(e){return this.parent?.sizeCells(e)??1}#i;addressCells(e){if(this.#i!==void 0)return this.#i;let t=this?.getProperty("#address-cells");return this.#i=t?at(t,0,0,e)??2:2,this.#i}#n;sizeCells(e){if(this.#n!==void 0)return this.#n;let t=this.getProperty("#size-cells");return this.#n=t?at(t,0,0,e)??1:1,this.#n}reg(e){let t=this.getProperty("reg");if(!t)return;let r=this.parentAddressCells(e),s=Array.from({length:r}).map((a,c)=>at(t,0,c,e));if(!s.every(a=>typeof a=="number"))return;let i=this.parentSizeCells(e),o=Array.from({length:i}).map((a,c)=>at(t,0,r+c,e));if(o.every(a=>typeof a=="number"))return{startAddress:s,size:o,endAddress:An(s,o),ast:t.ast}}#r;mappedReg(e){if(this.#r!==void 0)return this.#r;let t=this.getProperty("reg");if(!t)return;let r=this.parentAddressCells(e),s=Array.from({length:r}).map((d,f)=>at(t,0,f,e));if(!s.every(d=>typeof d=="number"))return;let i=this.parentSizeCells(e),o=Array.from({length:i}).map((d,f)=>at(t,0,r+f,e));if(!o.every(d=>typeof d=="number"))return;let a=this.parent?.rangeMap(e),c=An(s,o),l=this.parent?.mappedReg(e)?.endAddress;if(this.#r={startAddress:s,startAddressRaw:s,size:o,endAddress:c,endAddressRaw:c,inRange:!l||Ft(c,l)<=0,inMappingRange:!1,parentEnd:l,regAst:t.ast},!a)return this.#r;let u=vk(a,s);return u?(this.#r.mappedAst=u.ast,this.#r.startAddress=u.start,this.#r.endAddress=An(u.start,o),this.#r.inRange=!l||Ft(this.#r.endAddress,l)<=0,this.#r.inMappingRange=Ft(this.#r.endAddress,u.end)<=0,this.#r.mappingEnd=u.end,this.#r):this.#r}toTooltipString(e){return`${this.labels.map(t=>t.toString()).join(" ")}${this.labels.length?" ":""}${this.fullName} {${this.property.length?`
251
- `:""}${this.property.map(t=>t.toPrettyString(e)).join(`
253
+ If PIR cannot be modified and the PIR value is distinct from the interrupt controller number space, the CPUs binding may define a binding-specific representation of PIR values if desired.`],t}var FP=()=>{let t=new K("alignment",B("PROP_ENCODED_ARRAY"),"optional",void 0,[],(e,n)=>{let r=[],s=Ee(e.ast.values);return t.typeExample=`<${Array.from({length:e.parent.sizeCells(n)},()=>"size")}>`,s?.length!==e.parent.sizeCells(n)&&r.push($(19,e.ast.values??e.ast,En.Error,[],[],[e.name,t.typeExample])),r});return t.description=["Address boundary for alignment of allocation."],t};var BP=()=>{let t=new K("alloc-ranges",B("PROP_ENCODED_ARRAY"),"optional",void 0,[],(e,n)=>{let r=[],s=Ee(e.ast.values);return t.typeExample=`<${Array.from({length:e.parent.addressCells(n)},()=>"address")} ${Array.from({length:e.parent.sizeCells(n)},()=>"size")}>`,s?.length!==e.parent.addressCells(n)+e.parent.sizeCells(n)&&r.push($(19,e.ast.values??e.ast,En.Error,[],[],[e.name,t.typeExample])),r});return t.description=["Specifies regions of memory that are acceptable to allocate from"],t};var UP=()=>{let t=new K("no-map",B("EMPTY"),"optional");return t.description=[`Indicates the operating system must not create a virtual mapping of the region as part of its standard mapping of system memory, nor permit speculative access to it under
254
+ any circumstances other than under the control of the device driver using the region.`],t};var VP=()=>{let t=new K("reusable",B("EMPTY"),"optional");return t.description=["The operating system can use the memory in this region with the limitation that the device driver(s) owning the region need to be able to reclaim it back. Typically that means that the operating system can use that region to store volatile or cached data that can be otherwise regenerated or migrated elsewhere."],t};var zP=()=>{let t=new K("size",B("PROP_ENCODED_ARRAY"),"optional",void 0,[],(e,n)=>{let r=[],s=Ee(e.ast.values);return t.typeExample=`<${Array.from({length:e.parent.sizeCells(n)},()=>"size")}>`,s?.length!==e.parent.sizeCells(n)&&r.push($(19,e.ast.values??e.ast,En.Error,[],[],[e.name,t.typeExample])),r});return t.description=["Size in bytes of memory to reserve for dynamically allocated regions."],t};function WP(){let t=wn(),e=t.properties.find(n=>n.name==="reg");return e.required=()=>"optional",t.addProperty([zP(),FP(),BP(),UP(),VP()]),t}function _i(t){switch(t?.name){case"/":return DP();case"aliases":return CP();case"memory":return AP();case"reserved-memory":return xP();case"chosen":return LP();case"cpus":return $P();case"cpu":return jP()}return t?.parent?.name==="reserved-memory"?WP():wn()}var we=class t{constructor(e,n,r,s=null){this.bindingLoader=e;this.name=n;this.address=r;this.parent=s;this.referencedBy=[];this.definitions=[];this._properties=[];this._deletedProperties=[];this._deletedNodes=[];this.deletes=[];this._nodes=[];this.linkedNodeNamePaths=[];this.linkedRefLabels=[];s?.addNode(this)}static toJson(e){let n={};return e.property.forEach(r=>n[r.name]=r.ast.values?.toJson()??!0),e.nodes.forEach(r=>n[r.fullName]=t.toJson(r)),n}get nodeTypes(){if(this._nodeTypes)return this._nodeTypes;let e=this.parent?.nodeType?.childNodeType?.(this);return e?(this._nodeTypes=[e],this._nodeTypes):(this._nodeTypes=[_i(this)],this._nodeTypes)}get nodeType(){return this.nodeTypes.find(e=>!e.onBus||this.parent?.nodeType?.bus?.some(n=>n===e.onBus))}isChildOf(e){return this.parent?this.parent===e?!0:this.parent.isChildOf(e):!1}getReferenceBy(e){return this.referencedBy.some(n=>n===e)?this:[...this._nodes,...this._deletedNodes.map(n=>n.node)].map(n=>n.getReferenceBy(e)).find(n=>n)}get nodeNameOrLabelRef(){return Eo([...this.definitions,...this.referencedBy])}getDeepestAstNode(e,n){let r=[...this.definitions,...this.referencedBy].find(s=>xn(s,e,n));if(r){let s=this.deletes.map(c=>({item:this,ast:Or(c,e,n),beforeAst:Ha(c,e,n),afterAst:Wa(c,e,n)})).find(c=>xn(c.ast,e,n));if(s)return s;let i=[...this._properties.flatMap(c=>[c,...c.allReplaced]),...this._deletedProperties.flatMap(c=>[c.property,...c.property.allReplaced])].map(c=>({item:c,ast:c.ast})).find(c=>xn(c.ast,e,n)||c.ast.lastToken.value!==";"&&Fk(c.ast,e,n));if(i)return i.item.getDeepestAstNode(e,n);let o=[...this._nodes,...this._deletedNodes.map(c=>c.node)].map(c=>c.getDeepestAstNode(e,n)).find(c=>c);if(o)return o;let a=Or(r,e,n);return{item:this,ast:a,beforeAst:Ha(a,e,n),afterAst:Wa(a,e,n)}}}get labels(){return[...this.referencedBy.flatMap(e=>e.labels),...this.definitions.filter(e=>e instanceof Ae).flatMap(e=>e.labels)]}get labelsMapped(){return this.labels.map(e=>({label:e,owner:this}))}get allBindingsProperties(){return[...this.property.filter(e=>e.name==="compatible"),...this._nodes.flatMap(e=>e.allBindingsProperties)]}get allDescendantsLabels(){return[...this.labels,...this._nodes.flatMap(e=>e.allDescendantsLabels)]}get allDescendantsLabelsMapped(){return[...this.labelsMapped,...this.property.flatMap(e=>e.labelsMapped),...this._nodes.flatMap(e=>e.allDescendantsLabelsMapped)]}get issues(){let e=[...this.property.flatMap(n=>n.issues),...this._nodes.flatMap(n=>n.issues),...this._deletedNodes.flatMap(n=>n.node.issues),...this.deletedPropertiesIssues,...this.deletedNodesIssues];return this.name==="/"&&this.definitions.length&&(this._nodes.some(n=>n.name==="cpus")||e.push(Lt(9,this.definitions.at(-1).name??new j(G(this.definitions.at(-1).firstToken)),hr.DiagnosticSeverity.Error,this.definitions.slice(0,-1),void 0,["/","cpus"]))),e}get deletedPropertiesIssues(){return[...this._deletedProperties.flatMap(e=>[Lt(6,e.property.ast,hr.DiagnosticSeverity.Hint,[e.by],[hr.DiagnosticTag.Deprecated],[e.property.name]),...e.property.allReplaced.map(n=>Lt(6,n.ast,hr.DiagnosticSeverity.Hint,[e.by],[hr.DiagnosticTag.Deprecated],[e.property.name])),...e.property.issues])]}get deletedNodesIssues(){return this._deletedNodes.flatMap(e=>[...[...e.node.definitions.filter(n=>n instanceof Ae),...e.node.referencedBy].flatMap(n=>Lt(7,n,hr.DiagnosticSeverity.Hint,[e.by],[hr.DiagnosticTag.Deprecated],[n instanceof Ae?n.name.toString():n.labelReference.label.value]))])}get path(){return this.parent?[...this.parent.path,this.fullName]:[this.fullName]}get pathString(){return`/${this.path.slice(1).join("/")}`}get property(){return this._properties}get deletedProperties(){return this._deletedProperties}get nodes(){return this._nodes}get deletedNodes(){return this._deletedNodes}get propertyNames(){return this._properties.map(e=>e.name)}hasNode(e,n){return this._nodes.some(r=>r.name===e&&(r.address===n||r.address?.every((s,i)=>n?.at(i)===s)))}hasProperty(e){return this._properties.some(n=>n.name===e)}getProperty(e){return this._properties.find(n=>n.name===e)}deleteNode(e,n,r){let s=this._nodes.findIndex(i=>i.name===e&&(i.address===r||r?.every((o,a)=>i.address?.at(a)===o)));s!==-1&&(this._deletedNodes.push({node:this._nodes[s],by:n}),this._nodes.splice(s,1))}get root(){return this.parent?this.parent.root:this}getAllPhandle(e){let n=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(n instanceof Ct){let r=n.values[0].value;if(r instanceof Ut&&r.value===e)return[this,...this._nodes.flatMap(s=>s.getAllPhandle(e))]}return this._nodes.flatMap(r=>r.getAllPhandle(e))}getPhandle(e){let n=this.getProperty("phandle")?.ast.values?.values.at(0)?.value;if(n instanceof Ct){let r=n.values[0].value;if(r instanceof Ut&&r.value===e)return this}return this._nodes.flatMap(r=>r.getPhandle(e)).find(r=>!!r)}getNode(e,n,r=!0){let s=r||!!n||this._nodes.filter(o=>o.name===e).length>1,i=this._nodes.findIndex(o=>o.name===e&&(!s||o.address===n||o.address?.every((a,c)=>n?.at(c)===a)));if(i!==-1)return this._nodes[i]}deleteProperty(e,n){let r=this._properties.findIndex(s=>s.name===e);r!==-1&&(this._deletedProperties.push({property:this._properties[r],by:n}),this._properties.splice(r,1))}addNode(e){this._nodes.push(e)}addProperty(e){let n=this._properties.findIndex(r=>r.name===e.name);if(n===-1)this._properties.push(e);else{let r=this._properties.splice(n,1)[0];this._properties.push(e),e.replaces=r,r.replacedBy=e}e.name==="compatible"&&(this.bindingLoader?this.bindingLoader.getNodeTypes(this).then(r=>this._nodeTypes=r):this._nodeTypes=[_i(this)])}getChild(e,n=!0){let r=[...e];r.splice(0,1);let s=r[0].split("@"),i=s[0],o=s[1]!==void 0?s[1].split(",").map(c=>Number.parseInt(c,16)):void 0,a=this.getNode(i,o,n);return r.length===1||!a?a:a.getChild(r)}getChildFromScope(e,n){if(e.length===1&&e[0]===this.fullName)return this;if(e[0]!==this.fullName)return;let r=[...e];return r.splice(0,1),[...this._nodes,...this._deletedNodes.filter(i=>!n(i.by)).map(i=>i.node)].find(i=>i.fullName===r[0])?.getChildFromScope(r,n)}get fullName(){return this.address!==void 0?`${this.name}@${this.address.map(e=>e.toString(16)).join(",")}`:this.name}#e;regArray(e){if(this.#e!==void 0)return this.#e;let n=this.getProperty("reg");if(!n){this.#e=null;return}let r=this.parentAddressCells(e),s=this.parentSizeCells(e),i=[],o=Ee(n.ast.values)?.reverse();for(;o?.length;){let a=Array.from({length:r}).map(()=>o.pop()),c=Array.from({length:s}).map(()=>o.pop());if(![...a,...c].every(d=>d instanceof ft))continue;let l=a.map(d=>d.evaluate(e)),u=c.map(d=>d.evaluate(e));[...l,...u].every(d=>typeof d=="number")&&i.push({startAddress:l,endAddress:ws(l,u),size:u,ast:new j(G(a[0].firstToken,c.at(-1)?.lastToken??a.at(-1)?.lastToken))})}return this.#e=i,this.#e}#t;rangeMap(e){if(this.#t!==void 0)return this.#t;let n=this.getProperty("ranges");if(!n){this.#t=null;return}let r=this.sizeCells(e),s=this.addressCells(e),i=this.parentAddressCells(e),o=[],a=Ee(n.ast.values)?.reverse();for(;a?.length;){let c=Array.from({length:s}).map(()=>a.pop()),l=Array.from({length:i}).map(()=>a.pop()),u=Array.from({length:r}).map(()=>a.pop());[...c,...l,...u].every(y=>y instanceof ft);let d=c.map(y=>y.evaluate(e)),f=l.map(y=>y.evaluate(e)),h=u.map(y=>y.evaluate(e));[...d,...f,...h].every(y=>typeof y=="number")&&o.push({childAddress:d,parentAddress:f,length:h,ast:new j(G(c[0].firstToken,u.at(-1).lastToken))})}return this.#t=o,this.#t}#s;dmaRangeMap(e){if(this.#s!==void 0)return this.#s;let n=this.getProperty("dma-ranges");if(!n){this.#s=null;return}let r=this.sizeCells(e),s=this.addressCells(e),i=this.parentAddressCells(e),o=[],a=Ee(n.ast.values)?.reverse();for(;a?.length;){let c=Array.from({length:s}).map(()=>a.pop()),l=Array.from({length:i}).map(()=>a.pop()),u=Array.from({length:r}).map(()=>a.pop());[...c,...l,...u].every(y=>y instanceof ft);let d=c.map(y=>y.evaluate(e)),f=l.map(y=>y.evaluate(e)),h=u.map(y=>y.evaluate(e));[...d,...f,...h].every(y=>typeof y=="number")&&o.push({childAddress:d,parentAddress:f,length:h,ast:new j(G(c[0].firstToken,u.at(-1).lastToken))})}return this.#s=o,this.#s}parentAddressCells(e){return this.parent?.addressCells(e)??2}parentSizeCells(e){return this.parent?.sizeCells(e)??1}#n;addressCells(e){if(this.#n!==void 0)return this.#n;let n=this?.getProperty("#address-cells");return this.#n=n?Pe(n,0,0,e)??2:2,this.#n}#o;sizeCells(e){if(this.#o!==void 0)return this.#o;let n=this.getProperty("#size-cells");return this.#o=n?Pe(n,0,0,e)??1:1,this.#o}#f;mappedReg(e){if(this.#f!==void 0)return this.#f;let n=this.parent?.rangeMap(e),r=this.regArray(e);return this.#f=r?.flatMap(s=>{let i=s.startAddress,o=s.size,a=ws(i,o),c=this.parent?.mappedReg(e),l={startAddress:i,startAddressRaw:i,size:o,endAddress:a,endAddressRaw:a,inMappingRange:!1,regAst:s.ast};if(!n)return[l];let u=Wk(n,i);return u.length?u.map(d=>(l.mappedAst=d.ast,l.startAddress=d.start,l.endAddress=ws(d.start,o),l.inMappingRange=Ar(l.endAddress,d.end)<=0,l.mappingEnd=d.end,{...l,mappedAst:d.ast,startAddress:d.start,endAddress:ws(d.start,o),inMappingRange:Ar(l.endAddress,d.end)<=0,mappingEnd:d.end})):[l]}).sort((s,i)=>Ar(s.endAddress,i.endAddress))??[],this.#f}getNexusMapEntyMatch(e,n,r,s=[]){let i=new j(G(r[0].firstToken,r.at(-1).lastToken)),o=this.getNexusMap(e,n);if(o){let a=[...s.map((l,u)=>l&(o.mapMask.at(u)??4294967295)),...r.map((l,u)=>{let d=l instanceof ft?l.evaluate(n):l;return(typeof d=="number"?d&(o.mapMask.at(u+s.length)??4294967295):d).toString()})].join(":"),c=o.map.find(l=>l.mappingValues.map(u=>(u instanceof ft?u.evaluate(n):u).toString()).join(":")===a);return{entry:i,match:c}}return{entry:i}}getNexusMap(e,n){let r=this.getProperty(`${e}-map`),s=Ee(r?.ast.values);if(!s?.length)return;let i=this.root,o=this.getProperty(`#${e}-cells`);if(!o)return;let a=Pe(o,0,0,n);if(a==null)return;e==="interrupt"&&(a+=this.addressCells(n));let c=[],l=0;for(;l<s.length;){let f=s.slice(l,a+l);if(l+=a,s.length<l+1)break;let h=Ln(s[l],i);if(!h)break;let y=h.getProperty(`#${e}-cells`);if(!y)return;l++;let m=Pe(y,0,0,n);if(m==null||(e==="interrupt"&&(m+=h.addressCells(n)),l+=m,s.length<l))break;let _=s.slice(l-m,l);c.push({mappingValues:f,node:h,parentValues:_})}let u=this.getProperty(`${e}-map-mask`);return{mapMask:Array.from({length:a}).map((f,h)=>(u?Pe(u,0,h,n):void 0)??4294967295),map:c}}toTooltipString(e){return`${this.labels.map(n=>n.toString()).join(" ")}${this.labels.length?" ":""}${this.fullName} {${this.property.length?`
255
+ `:""}${this.property.map(n=>n.toPrettyString(e)).join(`
252
256
  `)}${this.nodes.length?`
253
- ${this.nodes.map(t=>`${t.fullName}{ /* ... */ };`).join(`
257
+ ${this.nodes.map(n=>`${n.fullName}{ /* ... */ };`).join(`
254
258
  `)}`:""}
255
- };`}toMarkupContent(e){return{kind:dr.MarkupKind.Markdown,value:["### Path",this.pathString,"### Current State","```devicetree",this.toTooltipString(e),"```",...this.nodeType?.maintainers?["### Maintainers",...this.nodeType?.maintainers??[]]:[],...this.nodeType?.description?["### Description",this.nodeType?.description]:[],...this.nodeType?.examples?["### Examples","```devicetree",...this.nodeType?.examples??[],"```"]:[]].join(`
256
- `)}}toFullString(e,t=1){let r=this.definitions.some(i=>i instanceof Pe&&i.omitIfNoRef),s=r&&this.linkedRefLabels.length===0&&this.linkedNodeNamePaths.length===0;return s?`/* /omit-if-no-ref/ ${this.labels.map(i=>i.toString()).join(" ")}${this.labels.length?" ":""}${this.fullName} {${this.property.length?`
257
- ${" ".repeat(t)}`:""}${this.property.map(i=>i.toString()).join(`
258
- ${" ".repeat(t)}`)}${this.nodes.length?`
259
- ${" ".repeat(t)}${this.nodes.map(i=>`${i.fullName}{ ... };`).join(`
260
- ${" ".repeat(t)}`)}`:""}
261
- ${" ".repeat(t-1)}}; */`:`${s?"/* /omit-if-no-ref/ ":r?`/* /omit-if-no-ref/ */
262
- ${" ".repeat(t-1)}`:""}${this.labels.map(i=>i.toString()).join(" ")}${this.labels.length?" ":""}${this.fullName} {${this.property.length?`
263
- ${" ".repeat(t)}`:""}${this.property.map(i=>i.toPrettyString(e)).join(`
264
- ${" ".repeat(t)}`)}${this.nodes.length?`
265
- ${" ".repeat(t)}${this.nodes.map(i=>i.toFullString(e,t+1)).join(`
266
- ${" ".repeat(t)}`)}`:""}
267
- ${" ".repeat(t-1)}}; ${s?" */":""}`}serialize(e){let t=this.mappedReg(e),r=[...this.definitions,...this.referencedBy],s=this.nodeType;return{nodeType:s instanceof Sn?{...this.nodeType,properties:s.properties.map(i=>({name:typeof i.name=="string"?i.name:i.name.toString(),allowedValues:i.allowedValues,type:i.type}))}:void 0,issues:r.flatMap(i=>i.serializeIssues),path:this.pathString,name:this.fullName,nodes:r.map(i=>i.serialize(e)),properties:this.property.map(i=>i.ast.serialize(e)),childNodes:this.nodes.map(i=>i.serialize(e)),reg:{mappedStartAddress:t?.startAddress,mappedEndAddress:t?.endAddress,startAddress:t?.startAddressRaw,endAddress:t?.endAddressRaw,size:t?.size,inRange:t?.inRange,inMappingRange:t?.inMappingRange}}}};var Od=K(X());var dg=K(X());var ks=class extends q{constructor(t,r){super(r);this.label=t;this.docSymbolsMeta={name:this.label.value,kind:dg.SymbolKind.Constant},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration",this.addChild(t)}toString(){return`${this.label.toString()}:`}},Bt=class extends q{constructor(t,r){super(r);this.value=t;this.docSymbolsMeta={name:this.value,kind:dg.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}buildSemanticTokens(t){let r=this.parentNode;if(!(r instanceof ye&&r.linksTo)){super.buildSemanticTokens(t);return}t(ui("type"),di("declaration"),{start:this.firstToken,end:this.lastToken})}toString(){return`${this.value}`}};var ze=class{constructor(e,t){this.ast=e;this.parent=t}getDeepestAstNode(e,t){let r=Pr(this.ast,e,t);return this.ast.assignOperatorToken&&rg(this.ast.assignOperatorToken,e,t)?{item:this,ast:r,beforeAst:La(this.ast,e,t),afterAst:$a(this.ast,e,t)}:{item:this,ast:r}}get name(){return this.ast.propertyName?.name??"[UNSET]"}get labels(){return this.ast.allDescendants.filter(e=>e instanceof ks)}get labelsMapped(){return this.labels.map(e=>({label:e,owner:this.ast.labels.some(t=>t===e)?this:null}))}get issues(){return this.replacedIssues}get replacedIssues(){return[...this.replaces?.replacedIssues??[],...this.replaces?[Ot(0,this.replaces.ast,Od.DiagnosticSeverity.Hint,[this.ast],[Od.DiagnosticTag.Unnecessary],[this.name])]:[]]}get allReplaced(){return this.replaces?[this.replaces,...this.replaces.allReplaced]:[]}toString(){return this.ast.toString()}toPrettyString(e){return this.ast.toPrettyString(e)}};var TN=K(X());var Fd=require("fs");var Id=class n{constructor(e,t){this.text=e;this.uri=t;this.inComment=!1;this.lineNumber=0;this.columnNumber=0;this.lineNumberOfEscapedChars=0;this.numberOfEscapedCharsLastString=0;this._tokens=[];this.lines=this.text.replace(`\r
259
+ };`}toMarkupContent(e){return{kind:hr.MarkupKind.Markdown,value:["### Path",this.pathString,"### Current State","```devicetree",this.toTooltipString(e),"```",...this.nodeType?.maintainers?["### Maintainers",...this.nodeType?.maintainers??[]]:[],...this.nodeType?.description?["### Description",this.nodeType?.description]:[],...this.nodeType?.examples?["### Examples","```devicetree",...this.nodeType?.examples??[],"```"]:[]].join(`
260
+ `)}}toFullString(e,n=1){let r=this.definitions.some(i=>i instanceof Ae&&i.omitIfNoRef),s=r&&this.linkedRefLabels.length===0&&this.linkedNodeNamePaths.length===0;return s?`/* /omit-if-no-ref/ ${this.labels.map(i=>i.toString()).join(" ")}${this.labels.length?" ":""}${this.fullName} {${this.property.length?`
261
+ ${" ".repeat(n)}`:""}${this.property.map(i=>i.toString()).join(`
262
+ ${" ".repeat(n)}`)}${this.nodes.length?`
263
+ ${" ".repeat(n)}${this.nodes.map(i=>`${i.fullName}{ ... };`).join(`
264
+ ${" ".repeat(n)}`)}`:""}
265
+ ${" ".repeat(n-1)}}; */`:`${s?"/* /omit-if-no-ref/ ":r?`/* /omit-if-no-ref/ */
266
+ ${" ".repeat(n-1)}`:""}${this.labels.map(i=>i.toString()).join(" ")}${this.labels.length?" ":""}${this.fullName} {${this.property.length?`
267
+ ${" ".repeat(n)}`:""}${this.property.map(i=>i.toPrettyString(e)).join(`
268
+ ${" ".repeat(n)}`)}${this.nodes.length?`
269
+ ${" ".repeat(n)}${this.nodes.map(i=>i.toFullString(e,n+1)).join(`
270
+ ${" ".repeat(n)}`)}`:""}
271
+ ${" ".repeat(n-1)}}; ${s?" */":""}`}serialize(e){let n=this.mappedReg(e),r=[...this.definitions,...this.referencedBy],s=this.nodeType;return{nodeType:s instanceof Sn?{...this.nodeType,properties:s.properties.map(i=>({name:typeof i.name=="string"?i.name:i.name.toString(),allowedValues:i.allowedValues,type:i.type}))}:void 0,issues:r.flatMap(i=>i.serializeIssues),path:this.pathString,name:this.fullName,nodes:r.map(i=>i.serialize(e)),properties:this.property.map(i=>i.ast.serialize(e)),childNodes:this.nodes.map(i=>i.serialize(e)),reg:n?.map(i=>({mappedStartAddress:i?.startAddress,mappedEndAddress:i?.endAddress,startAddress:i?.startAddressRaw,endAddress:i?.endAddressRaw,size:i?.size,inMappingRange:i?.inMappingRange}))}}};var Oo=Y(Q());var qg=Y(Q());var As=class extends j{constructor(n,r){super(r);this.label=n;this.docSymbolsMeta={name:this.label.value,kind:qg.SymbolKind.Constant},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration",this.addChild(n)}toString(){return`${this.label.toString()}:`}},Vt=class extends j{constructor(n,r){super(r);this.value=n;this.docSymbolsMeta={name:this.value,kind:qg.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}buildSemanticTokens(n){let r=this.parentNode;if(!(r instanceof be&&r.linksTo)){super.buildSemanticTokens(n);return}n(gi("type"),yi("declaration"),{start:this.firstToken,end:this.lastToken})}toString(){return`${this.value}`}};var Ye=class{constructor(e,n){this.ast=e;this.parent=n;this.nexusMapsTo=[]}getDeepestAstNode(e,n){let r=Or(this.ast,e,n);return this.ast.assignOperatorToken&&gg(this.ast.assignOperatorToken,e,n)?{item:this,ast:r,beforeAst:Ha(this.ast,e,n),afterAst:Wa(this.ast,e,n)}:{item:this,ast:r}}get name(){return this.ast.propertyName?.name??"[UNSET]"}get labels(){return this.ast.allDescendants.filter(e=>e instanceof As)}get labelsMapped(){return this.labels.map(e=>({label:e,owner:this.ast.labels.some(n=>n===e)?this:null}))}get issues(){return this.replacedIssues}get replacedIssues(){return[...this.replaces?.replacedIssues??[],...this.replaces?[Lt(0,this.replaces.ast,Oo.DiagnosticSeverity.Hint,[this.ast],[Oo.DiagnosticTag.Unnecessary],[this.name])]:[]]}onHover(){if(this.nexusMapsTo.length)return{kind:Oo.MarkupKind.Markdown,value:["### Nexus mappings",...this.nexusMapsTo.flatMap(e=>["```",`${this.name} = <... ${e.mappingValuesAst.map(n=>n.toString()).join(" ")} ...> maps to <... ${e.mapItem.mappingValues.map(n=>n.toString()).join(" ")} ...>;`,"```",`[Mapping (${e.mappingValuesAst.map(n=>n.toString()).join(" ")})](${`${e.mapItem.mappingValues[0].uri}#L${e.mapItem.mappingValues[0].firstToken.pos.line}`})`])].join(`
272
+ `)}}get allReplaced(){return this.replaces?[this.replaces,...this.replaces.allReplaced]:[]}toString(){return this.ast.toString()}toPrettyString(e){return this.ast.toPrettyString(e)}};var JP=Y(Q());var Qd=require("fs");var Wd=class t{constructor(e,n){this.text=e;this.uri=n;this.inComment=!1;this.lineNumber=0;this.columnNumber=0;this.lineNumberOfEscapedChars=0;this.numberOfEscapedCharsLastString=0;this._tokens=[];this.lines=this.text.replace(`\r
268
273
  `,`
269
274
  `).split(/\n/).map(r=>`${r}
270
275
  `),this.lines[this.lines.length-1]=this.lines[this.lines.length-1].slice(0,-1),e.endsWith(`
271
- `)&&this.lines.splice(-1,1),this.lexIt()}get tokens(){return this._tokens}isWhiteSpace(){return!!this.currentChar?.match(/\s/)}get endOfFile(){return this.isOnLastLine&&this.isOnLastCharOfLine}get isOnLastLine(){return this.lineNumber===this.lines.length-1}get isOnLastCharOfLine(){return this.lines[this.lineNumber].length<=this.columnNumber}moveToNextLine(){return this.isOnLastLine?!1:(this.columnNumber=0,this.lineNumberOfEscapedChars=0,this.lineNumber++,this.lines[this.lineNumber].length===0&&this.moveToNextLine(),!0)}moveOnLine(){return this.isOnLastCharOfLine?this.moveToNextLine():(this.columnNumber++,this.isOnLastCharOfLine&&this.moveToNextLine(),!0)}move(){return this.endOfFile?!1:this.moveOnLine()}get currentChar(){return this.endOfFile?null:this.lines[this.lineNumber].at(this.columnNumber)}static isSyntaxChar(e){return e==="^"||e==="~"||e==="|"||e==="!"||e==="\\"||e==="<"||e===">"||e===";"||e==="="||e==="/"||e==="{"||e==="}"||e==="["||e==="]"||e==="("||e===")"||e==="*"||e==="%"||e==="&"||e==="."||e===":"||e==="+"||e==="@"||e==="-"||e==="_"||e===","||e==="x"||e==="?"}getWord(){let e="";for(;!this.isWhiteSpace()&&(e.length&&!n.isSyntaxChar(this.currentChar)||!e.length);){if(e+=this.currentChar??"",e.length===1&&n.isSyntaxChar(this.currentChar)){this.move();break}let t=this.lineNumber;if(!this.move()||this.lineNumber!==t)return e}return e==="/"&&this.currentChar==="*"?this.inComment=!0:this.inComment&&e==="*"&&this.currentChar==="/"&&(this.inComment=!1),e}getString(e){let t=e;for(this.numberOfEscapedCharsLastString=0;this.currentChar!==e;){if(t+=this.currentChar??"",this.currentChar==="\\"){let r=this.lineNumber;if(this.move())this.lineNumberOfEscapedChars++,this.numberOfEscapedCharsLastString++,r===this.lineNumber&&(t+=this.currentChar??"");else return t}if(!this.move())return t}return this.move(),t+=e,t}lexIt(){for(;!this.endOfFile&&(this.whiteSpace(),!this.endOfFile);){let e=this.getWord();e&&this.process(e)}}process(e){let t=this.isString(e)||this.isCDefine(e)||this.isCInclude(e)||this.isCLine(e)||this.isCUndef(e)||this.isCError(e)||this.isCPragma(e)||this.isCDefined(e)||this.isCIfDef(e)||this.isCIfNDef(e)||this.isCIf(e)||this.isCElIf(e)||this.isCElse(e)||this.isCEndIf(e)||this.isCFalse(e)||this.isCTrue(e)||this.isDigit(e)||this.isHexDigit(e)||this.isLetters(e)||this.isComma(e)||this.isBitwiseNot(e)||this.isBitwiseXOr(e)||this.isBitwiseOr(e)||this.isLogicalNot(e)||this.isGtSym(e)||this.isLtSym(e)||this.isSemicolon(e)||this.isColon(e)||this.isAssignOperator(e)||this.isForwardSlash(e)||this.isRoundOpen(e)||this.isRoundClose(e)||this.isCurlyOpen(e)||this.isCurlyClose(e)||this.isSquareOpen(e)||this.isSquareClose(e)||this.isBackSlash(e)||this.isMultiplicationOperator(e)||this.isModulusOperator(e)||this.isAmpersand(e)||this.isNegateOperator(e)||this.isAddOperator(e)||this.isQuestionMark(e)||this.isPeriod(e)||this.isHash(e)||this.isUnderScore(e)||this.isAt(e)||this.unknownToken(e);if(!t)throw new Error(`Lexer is not complete!!! Could not find token for "${e}"`);let r=this._tokens.at(-1);return t&&!r?.tokens.some(s=>s===21)&&r&&r.pos.len<e.length?this.process(e.slice(r.pos.len)):!0}whiteSpace(){for(;this.isWhiteSpace();)this.move()}pushToken(e){let t={...e,uri:this.uri},r=this._tokens.at(-1);t.prevToken=r,r&&(r.nextToken=t),this._tokens.push(t)}isLetters(e){let t=e.match(/^[A-Za-z]+/);return t?.[0]?(this.pushToken({tokens:[47],value:t?.[0],pos:this.generatePos(e,t?.[0])}),!0):!1}isDigit(e){let t=e.match(/^[0-9]/);return t?.[0]?(this.pushToken({tokens:[20,19],value:t[0],pos:this.generatePos(e,t[0])}),!0):!1}isHexDigit(e){let t=e.match(/^[A-Fa-f]/);return t?.[0]?(this.pushToken({tokens:[20,47],value:t[0],pos:this.generatePos(e,t[0])}),!0):!1}isCurlyOpen(e){let t="{";return e===t?(this.pushToken({tokens:[2],pos:this.generatePos(e,t),value:"{"}),!0):!1}isCurlyClose(e){let t="}";return e===t?(this.pushToken({tokens:[3],pos:this.generatePos(e,t),value:"}"}),!0):!1}isSemicolon(e){let t=";";return e===t?(this.pushToken({tokens:[1],pos:this.generatePos(e,t),value:t}),!0):!1}isColon(e){let t=":";return e===t?(this.pushToken({tokens:[50],pos:this.generatePos(e,t),value:t}),!0):!1}isHash(e){let t="#";return e.startsWith(t)?(this.pushToken({tokens:[46],pos:this.generatePos(e,t),value:t}),!0):!1}unknownToken(e){return this.pushToken({tokens:[41],pos:this.generatePos(e," "),value:e}),!0}isAssignOperator(e){let t="=";return e===t?(this.pushToken({tokens:[0],pos:this.generatePos(e,t),value:t}),!0):!1}isGtSym(e){let t=">";return e===t?(this.pushToken({tokens:[4],pos:this.generatePos(e,t),value:t}),!0):!1}isLtSym(e){let t="<";return e===t?(this.pushToken({tokens:[5],pos:this.generatePos(e,t),value:t}),!0):!1}isLogicalNot(e){let t="!";return e===t?(this.pushToken({tokens:[6],pos:this.generatePos(e,t),value:t}),!0):!1}isBitwiseOr(e){let t="|";return e===t?(this.pushToken({tokens:[8],pos:this.generatePos(e,t),value:t}),!0):!1}isBitwiseXOr(e){let t="^";return e===t?(this.pushToken({tokens:[9],pos:this.generatePos(e,t),value:t}),!0):!1}isAmpersand(e){let t="&";return e===t?(this.pushToken({tokens:[40,7],pos:this.generatePos(e,t),value:t}),!0):!1}isBitwiseNot(e){let t="~";return e===t?(this.pushToken({tokens:[10],pos:this.generatePos(e,t),value:t}),!0):!1}isRoundOpen(e){let t="(";return e===t?(this.pushToken({tokens:[42],pos:this.generatePos(e,t),value:t}),!0):!1}isRoundClose(e){let t=")";return e===t?(this.pushToken({tokens:[43],pos:this.generatePos(e,t),value:t}),!0):!1}isSquareOpen(e){let t="[";return e===t?(this.pushToken({tokens:[11],pos:this.generatePos(e,t),value:t}),!0):!1}isSquareClose(e){let t="]";return e===t?(this.pushToken({tokens:[12],pos:this.generatePos(e,t),value:t}),!0):!1}isComma(e){let t=",";return e===t?(this.pushToken({tokens:[24],pos:this.generatePos(e,t),value:t}),!0):!1}rewind(e){if(this.columnNumber+1<e.length)throw new Error("Error while rewinding");this.columnNumber-=e.length}isString(e){if(this.inComment)return!1;let t=e.match(/^["']/);if(t?.[0]){this.rewind(e.slice(1));let r=this.lineNumber,s=this.columnNumber-1,i=this.getString(t[0]),o=i.length+this.numberOfEscapedCharsLastString;return this.pushToken({tokens:[21],value:i,pos:{col:s,line:r,len:o,colEnd:s+o}}),!0}return!1}isForwardSlash(e){let t="/";return e===t?(this.pushToken({tokens:[13],pos:this.generatePos(e,t),value:"/"}),!0):!1}isBackSlash(e){let t="\\";return e===t?(this.pushToken({tokens:[14],pos:this.generatePos(e,t),value:"\\"}),!0):!1}isAddOperator(e){let t="+";return e===t?(this.pushToken({tokens:[15],pos:this.generatePos(e,t),value:t}),!0):!1}isQuestionMark(e){let t="?";return e===t?(this.pushToken({tokens:[44],pos:this.generatePos(e,t),value:t}),!0):!1}isPeriod(e){let t=".";return e===t?(this.pushToken({tokens:[45],pos:this.generatePos(e,t),value:t}),!0):!1}isNegateOperator(e){let t="-";return e===t?(this.pushToken({tokens:[16],pos:this.generatePos(e,t),value:t}),!0):!1}isUnderScore(e){let t="_";return e===t?(this.pushToken({tokens:[48],pos:this.generatePos(e,t),value:t}),!0):!1}isAt(e){let t="@";return e===t?(this.pushToken({tokens:[49],pos:this.generatePos(e,t),value:t}),!0):!1}isMultiplicationOperator(e){let t="*";return e===t?(this.pushToken({tokens:[17],pos:this.generatePos(e,t),value:t}),!0):!1}isModulusOperator(e){let t="%";return e===t?(this.pushToken({tokens:[18],pos:this.generatePos(e,t),value:t}),!0):!1}isCDefine(e){let t="#define";return e.toLowerCase()===t?(this.pushToken({tokens:[25],pos:this.generatePos(e,t),value:t}),!0):!1}isCInclude(e){let t="#include";return e.toLowerCase()===t?(this.pushToken({tokens:[26],pos:this.generatePos(e,t),value:t}),!0):!1}isCLine(e){let t="#line";return e.toLowerCase()===t?(this.pushToken({tokens:[27],pos:this.generatePos(e,t),value:t}),!0):!1}isCUndef(e){let t="#undef";return e.toLowerCase()===t?(this.pushToken({tokens:[28],pos:this.generatePos(e,t),value:t}),!0):!1}isCError(e){let t="#error";return e.toLowerCase()===t?(this.pushToken({tokens:[29],pos:this.generatePos(e,t),value:t}),!0):!1}isCPragma(e){let t="#pragma";return e.toLowerCase()===t?(this.pushToken({tokens:[30],pos:this.generatePos(e,t),value:t}),!0):!1}isCDefined(e){let t="#defined";return e.toLowerCase()===t?(this.pushToken({tokens:[31],pos:this.generatePos(e,t),value:t}),!0):!1}isCIf(e){let t="#if";return e.toLowerCase()===t?(this.pushToken({tokens:[32],pos:this.generatePos(e,t),value:t}),!0):!1}isCIfDef(e){let t="#ifdef";return e.toLowerCase()===t?(this.pushToken({tokens:[33],pos:this.generatePos(e,t),value:t}),!0):!1}isCIfNDef(e){let t="#ifndef";return e.toLowerCase()===t?(this.pushToken({tokens:[34],pos:this.generatePos(e,t),value:t}),!0):!1}isCElIf(e){let t="#elif";return e.toLowerCase()===t?(this.pushToken({tokens:[35],pos:this.generatePos(e,t),value:t}),!0):!1}isCElse(e){let t="#else";return e.toLowerCase()===t?(this.pushToken({tokens:[36],pos:this.generatePos(e,t),value:t}),!0):!1}isCEndIf(e){let t="#endif";return e.toLowerCase()===t?(this.pushToken({tokens:[37],pos:this.generatePos(e,t),value:t}),!0):!1}isCTrue(e){let t="true";return e==t?(this.pushToken({tokens:[38],value:t,pos:this.generatePos(e,t)}),!0):!1}isCFalse(e){let t="false";return e==t?(this.pushToken({tokens:[39],value:t,pos:this.generatePos(e,t)}),!0):!1}generatePos(e,t){let r=this.columnNumber-e.length+this.lineNumberOfEscapedChars;return{line:this.lineNumber,col:r,len:t.length,colEnd:r+t.length}}};var nt=class extends q{constructor(e){super(e),this.semanticTokenType="keyword",this.semanticTokenModifiers="declaration"}};var hg=require("fs"),ko=require("path");var mN=K(X());var Ut=class extends Qt{constructor(t,r){super(r);this.name=t;this.docSymbolsMeta={name:this.name.toString(),kind:mN.SymbolKind.Variable},this.semanticTokenType="macro",this.semanticTokenModifiers="declaration"}toString(){return this.name}};var xd=class extends q{constructor(t,r){super(r);this.operator=t;this.semanticTokenType="operator",this.semanticTokenModifiers="declaration"}toString(){return this.operator}};var gN=K(X());var Md=class extends nt{toString(){return"..."}},Ns=class extends q{constructor(t,r){super();this.functionName=t;this.params=r;this.addChild(t),this.params.forEach(s=>this.addChild(s))}getDocumentSymbols(t){return le(this.uri,t)?[{name:this.functionName.name,kind:gN.SymbolKind.Function,range:Z(this),selectionRange:Z(this),children:this.params.flatMap(r=>r.getDocumentSymbols(t))}]:[]}toString(){return`${this.functionName}(${this.params.map(t=>t.toString()).join(",")})`}};var fg=K(X());var Cr=class extends Qt{constructor(t,r,s){super(r);this.value=t;this.docSymbolsMeta={name:`param${s+1}`,kind:fg.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.value}},Ps=class extends Qt{constructor(t,r){super();this.functionName=t;this.params=r;this.addChild(t),this.params.forEach(s=>this.addChild(s))}getDocumentSymbols(t){return le(this.uri,t)?[{name:this.functionName.name,kind:fg.SymbolKind.Function,range:Z(this),selectionRange:Z(this),children:this.params.flatMap(r=>r?.getDocumentSymbols(t)??[])}]:[]}toString(){return`${this.functionName.toString()}(${this.params.map(t=>t?.toString()??"<NULL>").join(",")})`}isTrue(t){return this.functionName.name==="defined"?!!(this.params.length===1&&this.params[0]&&t.has(this.params[0].value)):super.isTrue(t)}};var Rs=class{constructor(){this.positionStack=[];this._issues=[];this.issueLengthPositionStack=[];this.moveEndOfLine=(e,t=!0)=>{let r=e.pos.line;if(this.currentToken?.pos.line!==r||!le(this.currentToken?.uri,e.uri))return;let s=this.currentToken,i=s;for(;this.currentToken?.pos.line===r;)i=this.moveToNextToken;if(t){let o=new q(H(s,i));this._issues.push(V(22,o))}return i};this.parsing=new Promise(e=>{setTimeout(()=>{this.parse().then(e)})})}reset(){this.issueLengthPositionStack=[],this.positionStack=[],this._issues=[]}get issues(){return this._issues}get stable(){return this.parsing}get done(){return this.peekIndex()>=this.tokens.length}get moveToNextToken(){let e=this.currentToken;if(e)return this.moveStackIndex(),e}enqueueToStack(){this.issueLengthPositionStack.push(this._issues.length),this.positionStack.push(this.peekIndex())}popStack(){let e=this.issueLengthPositionStack.pop()??0;e!==this._issues.length&&this._issues.splice(e),this.positionStack.pop()}mergeStack(){let e=this.issueLengthPositionStack.pop(),t=this.positionStack.pop();if(t===void 0||e===void 0)throw new Error("Index out of bounds");this.positionStack[this.positionStack.length-1]=t}peekIndex(e=1){let t=this.positionStack.at(-1*e);if(t===void 0)throw new Error("Index out of bounds");return t}get currentToken(){return this.tokens.at(this.peekIndex())}get prevToken(){let e=this.peekIndex()-1;if(e!==-1)return this.tokens[e]}moveStackIndex(){let e=this.positionStack.length-1;if(this.positionStack[e]===void 0)throw new Error("Index out of bounds");this.positionStack[e]!==this.tokens.length&&this.positionStack[e]++}checkConcurrentTokens(e){this.enqueueToStack();let t=[];return e.every(r=>{let s=this.currentToken,i=r(s),o=!1;return i!=="no"&&s&&(t.push(s),this.moveToNextToken,o=an(s,this.currentToken)),i==="yes"&&o}),this.mergeStack(),t}consumeAnyConcurrentTokens(e){this.enqueueToStack();let t=[],r,s=!0;for(;e.some(i=>i(this.currentToken)==="yes"&&s);)t.push(this.currentToken),r=this.currentToken,this.moveToNextToken,s=an(r,this.currentToken);return this.mergeStack(),t}getDocumentSymbols(e){return this.allAstItems.flatMap(t=>t.getDocumentSymbols(e))}getWorkspaceSymbols(){return this.allAstItems.flatMap(e=>e.getWorkspaceSymbols())}buildSemanticTokens(e,t){let r=[],s=(i,o,a)=>{if(!a?.start||!a?.end||!le(a.start.uri,t)||!le(a.end.uri,t))return;let c=a.end.pos.colEnd-a.start.pos.col;r.push({line:a.start.pos.line,char:a.start.pos.col,length:a.end===a.start?a.end.pos.len:c,tokenType:i,tokenModifiers:o})};this.allAstItems.forEach(i=>{i.buildSemanticTokens(s)}),r.sort((i,o)=>i.line===o.line?i.char-o.char:i.line-o.line).forEach(i=>e.push(i.line,i.char,i.length,i.tokenType,i.tokenModifiers))}processCIdentifier(e,t){this.enqueueToStack();let r=this.consumeAnyConcurrentTokens([19,47,48].map(De));if(!r.length){this.popStack();return}let s=r.map(o=>o.value).join("");if(!s.match(/^[_A-Za-z]/)){this.popStack();return}let i=new Ut(s,H(r[0],r.at(-1)));return!t&&i.name!=="defined"&&(e.get(i.name)||this._issues.push(V(42,i))),this.mergeStack(),i}isOperator(){this.enqueueToStack();let e=this.moveToNextToken;if(!e){this.popStack();return}let t=e,r;if($(e,40)?(r="&",$(this.currentToken,40)&&(r="&&",t=this.moveToNextToken)):$(e,10)?(r="!",$(this.currentToken,0)&&(r="!=",t=this.moveToNextToken)):$(e,8)?(r="|",$(this.currentToken,8)&&(r="||",t=this.moveToNextToken)):$(e,9)?r="^":$(e,4)?(r=">",$(this.currentToken,4)?(r="<<",t=this.moveToNextToken):$(this.currentToken,0)&&(r=">=",t=this.moveToNextToken)):$(e,5)?(r="<",$(this.currentToken,5)?(r=">>",t=this.moveToNextToken):$(this.currentToken,0)&&(r="<=",t=this.moveToNextToken)):$(e,15)?r="+":$(e,16)?r="-":$(e,17)?r="*":$(e,13)?r="/":$(e,18)?r="%":$(e,46)?$(this.currentToken,46)&&(r="##",t=this.moveToNextToken):$(e,0)&&$(this.currentToken,0)&&(r="==",t=this.moveToNextToken),r){let s=new xd(r,H(e,t));return this.mergeStack(),s}this.popStack()}parseScopedBlock(e,t,r){this.enqueueToStack();let s=this.moveToNextToken;if(!s||!e(s)){this.popStack();return}let i=this.peekIndex(),o=()=>{this.positionStack[this.positionStack.length-1]=i},a=p=>p.flatMap(y=>"items"in y?a(y.items):y),c=[s],l=[];l[0]={rewind:o,tokens:[]};let u=this.currentToken;for(;u&&!t(u);){if(r?.(u)){let p=this.peekIndex()+1,y=()=>{this.positionStack[this.positionStack.length-1]=p};c.push(u),l[l.length]={rewind:y,tokens:[]}}else if(e(u)){let p=this.parseScopedBlock(e,t,r);p&&(c.push(p),l[l.length-1].tokens.push(...a(p.items))),u=this.currentToken;continue}else c.push(u),l[l.length-1].tokens.push(u);this.moveToNextToken,u=this.currentToken}let d=u;d&&t(d)&&(this.moveToNextToken,c.push(d));let f={startToken:s,items:c,splitTokens:l,endToken:d};return this.mergeStack(),f}isFunctionCall(e){this.enqueueToStack();let t=this.processCIdentifier(e,!1);if(!t){this.popStack();return}let r=this.processMacroCallParams();if(!r){this.popStack();return}if(t.name==="defined")r.length>1?this._issues.push(V(44,t)):r.length<1&&this._issues.push(V(45,t));else{let i=e.get(t.name)?.macro;i&&(i?.identifier instanceof Ns?r.length>i.identifier.params.length?this._issues.push(V(44,t,void 0,[i])):r.length<i.identifier.params.length&&this._issues.push(V(45,t,void 0,[i])):this._issues.push(V(43,t)))}let s=new Ps(t,r);return s.lastToken=this.prevToken,this.mergeStack(),s}processHex(){this.enqueueToStack();let e=this.checkConcurrentTokens([et("0"),et("x")]);if(e.length!==2){this.popStack();return}let t=this.consumeAnyConcurrentTokens([19,20].map(De));if(!t.length){this.popStack();return}let r=Number.parseInt(t.map(i=>i.value).join(""),16),s=new It(r,H(e[0],t.at(-1)));return this.mergeStack(),s}processDec(){this.enqueueToStack();let e=this.consumeAnyConcurrentTokens([19].map(De));if(!e.length){this.popStack();return}let t=Number.parseInt(e.map(s=>s.value).join(""),10),r=new It(t,H(e[0],e.at(-1)));return this.mergeStack(),r}processEnclosedExpression(e){this.enqueueToStack();let t,r,s;if($(this.currentToken,42))return t=this.moveToNextToken,r=t,s=this.processExpression(e,!0),s&&(s=new fi(new fi(s,!0),!1)),$(this.currentToken,43)?r=this.moveToNextToken:this._issues.push(V(26,new q(H(t)))),this.mergeStack(),s;this.popStack()}processExpression(e,t=!1){this.enqueueToStack();let r;if(r=this.processEnclosedExpression(e)||this.isFunctionCall(e)||this.processCIdentifier(e,!1)||this.processHex()||this.processDec(),!r){this.popStack();return}if(t){let s=this.isOperator();for(;s;){let i=this.processExpression(e);i?r instanceof fi?r.addExpression(s,i):r=new fi(r,!1,{operator:s,expression:i}):this._issues.push(V(27,s)),s=this.isOperator()}}return this.mergeStack(),r}processMacroCallParams(){if(!$(this.currentToken,42))return;let e=this.parseScopedBlock(r=>!!$(r,42),r=>!!$(r,43),r=>!!$(r,24));return e?.items.length===2&&$(e.endToken,43)?[]:e?.splitTokens.map((r,s)=>r.tokens.length===0?null:new Cr(r.tokens.map((i,o)=>{let a=i.value;return i.pos.line===r.tokens.at(o+1)?.pos.line&&(a=a.padEnd(r.tokens[o+1].pos.col-i.pos.col," ")),a}).join(""),H(r.tokens[0],r.tokens.at(-1)),s))}};var $d=class n extends Rs{constructor(t){super();this.uri=t;this.comments=[];this.tokens=[]}cleanUpComments(){let t=[];for(let r=0;r<this.tokens.length;r++){let s=n.processBlockComments(this.tokens,r)||n.processLineComments(this.tokens,r);s&&(r=s.index,t.push(...s.tokenUsed),this.comments.push(...s.comments))}t.reverse().forEach(r=>this.tokens.splice(r,1))}get allAstItems(){return this.comments}reset(){super.reset(),this.comments=[]}reparse(){return this.reset(),this.parse()}async parse(){this.tokens=fr().requestTokens(this.uri,!0),this.cleanUpComments()}static processBlockComments(t,r){let s=[],i=()=>(s.push(r++),t[r]),o=()=>t[r],a=()=>t[r-1],c=o(),l=c;if(!c||!$(c,13)||(l=i(),!$(l,17)||c.pos.line!==l.pos.line||c.pos.col+1!==l.pos.col))return;let u=()=>!(!$(a(),17)||!$(o(),13)||!an(a(),o())),d=l.pos.line,f=c,p=[];l=i();do{if(o()?.pos.line!==d){let m=new Dr(H(f,a()));p.push(m),d=o().pos.line??0,f=o()}l=i()}while(r<t.length&&!u());let y=new Dr(H(f,o()));return p.push(y),i(),{comments:p,tokenUsed:s,index:r-1}}static processLineComments(t,r){let s=[];if(!$(t[r],13)||t.length===r+1||!$(t[r+1],13)||!an(t[r],t[r+1]))return;let i=[];for(;t[r].pos.line===t.at(r+1)?.pos.line;)s.push(r++);s.push(r++);let o=t[s.at(-1)],a=new Dr(H(t[s[0]],t[s.at(-1)]));return i.push(a),{comments:i,tokenUsed:s,index:r-1}}};var yN=K(X()),Ld=class extends q{constructor(t,r){super(t);this.content=r}toString(){let t=this.content.filter(r=>!$(r,14));return t.map((r,s)=>{let i=r.value;return r.pos.line===t.at(s+1)?.pos.line?i=i.padEnd(t[s+1].pos.col-r.pos.col," "):t.at(s+1)&&(i=i.padEnd(i.length+1," ")),i}).join("")}},Ua=class extends q{constructor(t,r,s){super();this.keyword=t;this.identifier=r;this.content=s;this.addChild(t),this.addChild(this.identifier),this.content&&this.addChild(this.content)}get name(){return this.identifier instanceof Ut?this.identifier.name:this.identifier.functionName.name}toString(){return this.toStringCache??=[this.identifier.toString(),...this.content?[this.content?.toString()]:[]].join(" "),this.toStringCache}toMarkupContent(){return{kind:yN.MarkupKind.Markdown,value:["```cpp",`#define ${this.toString()}`,"```"].join(`
272
- `)}}};var mi=class extends q{constructor(e){super(e)}},Va=class extends q{constructor(t,r){super();this.keyword=t;this.content=r;this.active=!1;this.addChild(t)}},Wa=class extends Va{constructor(t,r,s){super(t,s);this.identifier=r;this.addChild(r),this.addChild(s)}useBlock(t){return this.identifier&&t.has(this.identifier.name)}},qd=class extends Va{constructor(t,r,s){super(t,s);this.expression=r;this.addChild(r),this.addChild(s)}useBlock(t){return this.expression instanceof Ps?this.expression.functionName.name==="defined"?this.expression&&t.has(this.expression.params.at(0)?.value??""):this.expression.isTrue(t):this.expression?.isTrue(t)}},jd=class extends Wa{useBlock(e){return this.identifier&&!e.has(this.identifier.name)}},za=class extends Va{};var wo=class extends q{constructor(t,r,s){super();this.ifDef=t;this.endIf=r;this.elseOption=s;this.addChild(t),s&&this.addChild(s),this.addChild(r)}getInValidTokenRange(t,r){let s=[],i=a=>r.findIndex(c=>c===a);if(!this.ifDef.identifier)return[{start:i(this.tokenIndexes.start),end:i(this.tokenIndexes.end)}];s.push({start:i(this.ifDef.tokenIndexes.start),end:i(this.ifDef.identifier.tokenIndexes.end)});let o=this.ifDef.useBlock(t);return o?this.ifDef.active=!0:this.elseOption&&(this.elseOption.active=!0),!o&&this.ifDef.content&&s.push({start:i(this.ifDef.content.tokenIndexes.start),end:i(this.ifDef.content.tokenIndexes.end)}),this.elseOption&&(s.push({start:i(this.elseOption.tokenIndexes.start),end:i(this.elseOption.keyword.tokenIndexes.end)}),o&&this.elseOption.content&&s.push({start:i(this.elseOption.content.tokenIndexes.start),end:i(this.elseOption.content.tokenIndexes.end)})),this.endIf&&s.push({start:i(this.endIf.tokenIndexes.start),end:i(this.endIf.tokenIndexes.end)}),s}},Ds=class extends q{constructor(t,r,s){super();this.ifBlocks=t;this.endIf=r;this.elseOption=s;t.forEach(i=>this.addChild(i)),s&&this.addChild(s),this.addChild(r)}getInValidTokenRange(t,r){let s=[],i=a=>r.findIndex(c=>c===a),o=!1;return this.ifBlocks.forEach((a,c)=>{s.push({start:i(a.tokenIndexes.start),end:i(a.expression?.tokenIndexes.end??a.keyword.tokenIndexes.end)}),!o&&a.useBlock(t)?(a.active=!0,o=!0):a.content&&s.push({start:i(a.content.tokenIndexes.start),end:i(a.content.tokenIndexes.end)})}),this.elseOption&&(s.push({start:i(this.elseOption.keyword.tokenIndexes.start),end:i(this.elseOption.keyword.tokenIndexes.end)}),o&&this.elseOption.content?s.push({start:i(this.elseOption.content.tokenIndexes.start),end:i(this.elseOption.content.tokenIndexes.end)}):this.elseOption.active=!0),this.endIf&&s.push({start:i(this.endIf.tokenIndexes.start),end:i(this.endIf.tokenIndexes.end)}),s}};var Ha=K(X());var No=class extends Rs{constructor(t,r,s){super();this.uri=t;this.incudes=r;this.tokens=[];this.nodes=[];this.dtsIncludes=[];this.macroSnapShot=new Map;this.macros=new Map;this.macroStart=!1;s&&(Array.from(s).forEach(([i,o])=>this.macroSnapShot.set(i,o)),Array.from(s).forEach(([i,o])=>this.macros.set(i,o)))}get currentToken(){let t=this.prevToken,r=Rr(t,this.tokens.at(this.peekIndex()))||!t||$(t,14)&&t.pos.line+1===this.tokens.at(this.peekIndex())?.pos.line;if(!(this.macroStart&&!r))return this.macroStart&&$(this.tokens.at(this.peekIndex()),14)?(this.moveStackIndex(),this.currentToken):this.tokens.at(this.peekIndex())}reset(t){super.reset(),this.macros.clear(),t?(this.macroSnapShot.clear(),Array.from(t).forEach(([r,s])=>this.macroSnapShot.set(r,s)),Array.from(t).forEach(([r,s])=>this.macros.set(r,s))):Array.from(this.macroSnapShot).forEach(([r,s])=>this.macros.set(r,s)),this.nodes=[],this.dtsIncludes=[]}async reparse(t){let r=this.stable;return this.parsing=new Promise(s=>{r.then(()=>{if(t&&t.size===this.macroSnapShot.size){let i=Array.from(t);if(Array.from(this.macroSnapShot).every(([o,a],c)=>{let[l,u]=i[c];return l===o&&u.macro.toString()===a.macro.toString()})){console.log("header file cache hit",this.uri),s();return}}this.reset(t),this.parse().then(s)})}),this.parsing}async parse(){let t=new $d(this.uri);if(await t.stable,this.tokens=t.tokens,this.nodes.push(...t.allAstItems),this.positionStack.push(0),this.tokens.length!==0){for(;!this.done;)await this.lineProcessor();if(this.positionStack.length!==1)throw new Error("Incorrect final stack size")}}async lineProcessor(){if(this.enqueueToStack(),!(!this.prevToken||this.prevToken.pos.line!==this.currentToken?.pos.line||!le(this.prevToken.uri,this.currentToken.uri))){this.moveEndOfLine(this.prevToken,!1),this.mergeStack();return}let r=this.currentToken,s=await this.processInclude()||this.processDefinitions()||this.processUndef()||this.processIfDefBlocks();r&&this.moveEndOfLine(r,!!s),this.mergeStack()}processDefinitions(){this.enqueueToStack();let t=this.peekIndex(),r=this.moveToNextToken;if(!r||!$(r,25))return this.popStack(),!1;this.macroStart=!0;let s=new nt(H(r)),i=this.isFunctionDefinition()||this.processCIdentifier(this.macros,!0);if(!i)return this._issues.push(V(30,s)),this.mergeStack(),this.macroStart=!1,!0;let o=this.consumeDefinitionContent(),a;o.length&&(a=new Ld(H(o[0],o.at(-1)),o));let c=new Ua(s,i,a);this.macros.set(c.name,{macro:c,resolver:yk(c.toString())}),this.nodes.push(c);let l=this.peekIndex();return this.tokens.splice(t,l-t),this.positionStack[this.positionStack.length-1]=t,this.mergeStack(),this.macroStart=!1,!0}processUndef(){this.enqueueToStack();let t=this.peekIndex(),r=this.moveToNextToken;if(!r||!$(r,28))return this.popStack(),!1;this.macroStart=!0;let s=new nt(H(r)),i=this.processCIdentifier(this.macros,!0);if(!i)return this._issues.push(V(30,s)),this.mergeStack(),this.macroStart=!1,!0;let o=new Ua(s,i);this.macros.delete(i.name),this.nodes.push(o);let a=this.peekIndex();return this.tokens.splice(t,a-t),this.positionStack[this.positionStack.length-1]=t,this.mergeStack(),this.macroStart=!1,!0}consumeDefinitionContent(){let t=[];for(;this.currentToken;){let r=this.moveToNextToken;r&&t.push(r)}return t}isFunctionDefinition(){this.enqueueToStack();let t=this.processCIdentifier(this.macros,!0);if(!t){this.popStack();return}let r=this.moveToNextToken;if(!$(r,42)||!an(t.lastToken,r)){this.popStack();return}let s=[],i=this.processCIdentifier(this.macros,!0)||this.processVariadic();for(;i;)s.push(i),!$(this.currentToken,24)&&!$(this.currentToken,43)?this._issues.push(V(28,i)):$(this.currentToken,43)||(r=this.moveToNextToken),i=this.processCIdentifier(this.macros,!0)||this.processVariadic();let o=new Ns(t,s);return $(this.currentToken,43)?(r=this.moveToNextToken,o.lastToken=r):(o.lastToken=this.prevToken,this._issues.push(V(26,s.at(-1)??o))),this.mergeStack(),o}processVariadic(){this.enqueueToStack();let t=this.checkConcurrentTokens([De(45),De(45),De(45)]);if(t.length!==3){this.popStack();return}let r=new Md(H(t[0],t.at(-1)));return this.mergeStack(),r}processIfDefBlocks(){let t=this.peekIndex(),r=this.parseScopedBlock(o=>!!o&&[33,34,32].some(a=>$(o,a))&&!Rr(o.prevToken,o),o=>!!o&&[37].some(a=>$(o,a))&&!Rr(o.prevToken,o),o=>!!o&&[36,35].some(a=>$(o,a))&&!Rr(o.prevToken,o));if(!r)return;let s;$(r.startToken,32)?s=this.processIfBlock(r,(o,a,c)=>new qd(o,a??null,c)):s=this.processIfDefBlock(r,(o,a,c)=>$(r.startToken,33)?new Wa(o,a??null,c):new jd(o,a??null,c)),this.nodes.push(s),s.getInValidTokenRange(this.macros,this.tokens).reverse().forEach(o=>{this.tokens.splice(o.start,o.end-o.start+1)}),[...s instanceof Ds?s.ifBlocks:[s.ifDef],...s.elseOption?[s.elseOption]:[]].forEach(o=>{!o.active&&o.content&&this._issues.push(V(47,o.content,Ha.DiagnosticSeverity.Hint,[],[Ha.DiagnosticTag.Unnecessary]))}),this.positionStack[this.positionStack.length-1]=t}processIfDefBlock(t,r){this.enqueueToStack(),this.macroStart=!0;let s=new nt(H(t.startToken));t.splitTokens[0].rewind();let i=this.processCIdentifier(this.macros,!0);i||this._issues.push(V(31,s)),this.macroStart=!1;let o,a=i?.lastToken.nextToken??s.lastToken.nextToken;a&&t.splitTokens[0].tokens.find(f=>f===a)&&(o=new mi(H(a,t.splitTokens[0].tokens.at(-1))));let c=r(s,i??null,o??null),l;if(t.splitTokens.length>1){let f=t.splitTokens[1].tokens[0].prevToken,p=new nt(H(f)),y;t.splitTokens[1].tokens.length&&(y=new mi(H(t.splitTokens[1].tokens[0],t.splitTokens[1].tokens.at(-1)))),l=new za(p,y??null)}let u;t.endToken?u=new nt(H(t.endToken)):this._issues.push(V(46,s));let d=new wo(c,u??null,l);return this.mergeStack(),d}processIfBlock(t,r){this.enqueueToStack();let s=new nt(H(t.startToken)),i=[],o;t.splitTokens.forEach((l,u)=>{l.rewind();let d=this.prevToken,f=new nt(H(d));this.macroStart=!0;let p=this.processExpression(this.macros,!0)||this.processCIdentifier(this.macros,!0);if(this.macroStart=!1,u===t.splitTokens.length-1&&$(d,36)){let m=d,S=new nt(H(m)),w;l.tokens.length&&(w=new mi(H(l.tokens[0],l.tokens.at(-1)))),o=new za(S,w??null)}else{p||this._issues.push(V(31,s));let m,S=p?.lastToken.nextToken??s.lastToken.nextToken;S&&l.tokens.find(T=>T===S)&&(m=new mi(H(S,t.splitTokens[u].tokens.at(-1))));let w=r(f,p??null,m??null);i.push(w)}});let a;t.endToken?a=new nt(H(t.endToken)):this._issues.push(V(46,s));let c=new Ds(i,a??null,o);return this.mergeStack(),c}get allAstItems(){return[...this.dtsIncludes,...this.nodes]}resolveInclude(t){if(t.path.path)return t.path.relative?[(0,ko.resolve)((0,ko.dirname)(t.uri),t.path.path),...this.incudes.map(r=>(0,ko.resolve)(r,t.path.path))].find(r=>(0,hg.existsSync)(r)):this.incudes.map(r=>(0,ko.resolve)(r,t.path.path)).find(r=>(0,hg.existsSync)(r))}async processInclude(){this.enqueueToStack();let t=this.peekIndex(),r=this.currentToken;if(!r)return this.popStack(),!1;let s=r,i=r;if($(r,26))this.moveToNextToken;else{let m=this.checkConcurrentTokens([De(13),et("include"),De(13)]);if(m.length!==3)return this.popStack(),!1;s=m[0],i=m.at(-1)}let o=s,a=new nt(H(s,i));r=this.moveToNextToken;let c=r,l=!!$(r,21);if(!c||!l&&!$(r,5))return o&&this.moveEndOfLine(o),this.mergeStack(),!0;let u="";if(l)u=r?.value??"";else for(;this.currentToken?.pos.line===o.pos.line&&!$(this.currentToken,4);)u+=this.currentToken?.value??"",r=this.moveToNextToken;let d=new yo(u,l,H(c,r)),f=new _s(a,d);this.dtsIncludes.push(f),l||(this.currentToken?.pos.line!==o.pos.line||!$(this.currentToken,4)?this._issues.push(V(12,f)):(r=this.moveToNextToken,d.lastToken=r)),this.mergeStack();let p=this.peekIndex(),y=this.resolveInclude(f);if(f.resolvedPath=y,y||this._issues.push(V(36,f.path,Ha.DiagnosticSeverity.Warning)),y){fr().requestTokens(y,!0);let m=await Ka().getCPreprocessorParser(y,this.incudes,this.macros,this.uri);await m.stable,this._issues.push(...m.issues),this.macros.clear(),Array.from(m.macros).forEach(([S,w])=>this.macros.set(S,w)),y.endsWith(".h")?this.tokens.splice(t,p-t):this.tokens.splice(t,p-t,...m.tokens),this.nodes.push(...m.nodes),this.dtsIncludes.push(...m.dtsIncludes)}else this.tokens.splice(t,p-t);return this.positionStack[this.positionStack.length-1]=t,!0}};var bN,pg=class{constructor(){this.headerFiles=new Map;this.includeOwners=new WeakMap}getCPreprocessorParser(e,t,r,s){e=Je(e);let i=`${Array.from(r).map(l=>l[1].macro.toString()).join("::")}`,o=this.headerFiles.get(e)?.get(i);if(o)return o.reparse(r),o;console.log("No cpreprocess cache",e);let a=new No(e,t,r),c=this.includeOwners.get(a)??new Set;return c.add(s),this.includeOwners.set(a,c),this.headerFiles.has(e)||this.headerFiles.set(e,new Map),this.headerFiles.get(e)?.set(i,a),a}reset(e){e=Je(e);let t=this.headerFiles.get(e);t&&Array.from(t).forEach(r=>{r[1]&&(console.log("disposing cpreprocessor cache for",e),Array.from(this.includeOwners.get(r[1])??[]).forEach(this.reset.bind(this)),this.headerFiles.delete(e))})}};function Ka(){return bN??=new pg,bN}var vN,mg=class n{constructor(){this.fileMap=new Map}static clone(e){let t=e.map(r=>({...r}));return t.forEach((r,s)=>{r.prevToken=t[s-1],r.nextToken=t[s+1]}),t}needsRenew(e,t){return e=Je(e),this.fileMap.get(e)?.text!==t}renewLexer(e,t){if(e=Je(e),Ka().reset(e),!e||!(0,Fd.existsSync)(e))return[];try{t??=(0,Fd.readFileSync)(e).toString();let r=new Id(t,e);return this.fileMap.set(e,r),n.clone(r.tokens)}catch{}return[]}requestTokens(e,t){e=Je(e);let r=this.fileMap.get(e)?.tokens;return!r&&t?[...this.renewLexer(e)]:n.clone(r??[])}reset(e){e=Je(e),Ka().reset(e),this.fileMap.delete(e)}};function fr(){return vN??=new mg,vN}var Po=class n{constructor(e){this.context=e;this.comments=[];this.includes=[];this.roots=[];this.references=[];this.unlinkedDeletes=[];this.unlinkedRefNodes=[];this.globalDeletes=[];this.rootNode=new Se(this.context.bindingLoader,"/");this.labelsUsedCache=new Map;this.fileTopMostAstCache=new Map}fileTopMostAsts(e){let t=this.fileTopMostAstCache.get(e);if(t)return t;let r=[...this.roots,...this.references,...this.unlinkedDeletes,...this.unlinkedRefNodes,...this.globalDeletes,...this.context.parser.cPreprocessorParser.allAstItems,...this.context.overlayParsers.flatMap(s=>s.cPreprocessorParser.allAstItems)].flatMap(s=>s.getTopMostAstNodeForFile(e));return this.fileTopMostAstCache.set(e,r),r}getDeepestAstNode(e,t){let s=this.fileTopMostAsts(e).find(i=>On(i,e,t)||mk(fr().requestTokens(e,!1),i,t));if(s instanceof xt){let o=this.rootNode.getReferenceBy(s)?.getDeepestAstNode(e,t);return o?{...o,runtime:this}:{item:null,runtime:this,ast:Pr(s,e,t)}}else if(s instanceof mt&&s.path){let i=this.rootNode.getDeepestAstNode(e,t);return i?{...i,runtime:this}:void 0}else if(s instanceof Pe&&s.path){let i=n.getNodeFromPath(s.path.slice(1),this.rootNode)?.getDeepestAstNode(e,t);return i?{...i,runtime:this}:void 0}else if(s)return{runtime:this,item:null,ast:Pr(s,e,t)}}static getNodeFromPath(e,t,r=!0){if(e.length===0)return t;let s=e[0].split("@"),i=s[0],a=s.at(1)?.split(",").map(u=>Number.parseInt(u,16)),c=e.slice(1),l=t.getNode(i,a,r);return l?n.getNodeFromPath(c,l,r):void 0}resolvePath(e,t){if(!e.at(0)?.startsWith("&"))return e;let r=this.labelsUsedCache.get(e[0].slice(1));return r||(t??=this.rootNode.allDescendantsLabels,t.find(i=>i.label.value===e.at(0)?.slice(1)&&i.parentNode instanceof Fe)?.lastLinkedTo?.path)}get issues(){return[...this.labelIssues(),...this.rootNode.issues]}labelIssues(){let e=[],t=new Map;return this.rootNode.allDescendantsLabelsMapped.forEach(r=>{t.has(r.label.label.value)?t.get(r.label.label.value)?.push(r):t.set(r.label.label.value,[r])}),Array.from(t).forEach(r=>{let s=r[1];if(s.length>1){let i=s.find(a=>a.owner instanceof Se);(!s.every(a=>a&&a.owner===i?.owner)||!i)&&e.push(Ot(4,s.at(0).label,TN.DiagnosticSeverity.Error,s.slice(1).map(a=>a.label),[],[s.at(0).label.label.value]))}}),e}get typesIssues(){let e=t=>[...t.nodeType?.getIssue(this,t)??[],...t.nodes.flatMap(r=>e(r))];return this.typesIssuesCache??=e(this.rootNode),this.typesIssuesCache}getOrderedNodeAst(e){return gk([...e.definitions,...e.referencedBy],this.context)}};var SN=K(X()),Bd=class extends q{constructor(t){super();this.values=t;this.docSymbolsMeta={name:"Values",kind:SN.SymbolKind.String},this.values.forEach(r=>this.addChild(r))}toString(){return this.values.map(t=>t?.toString()).join(",")}toJson(){return this.values.length===1?this.values[0]?.toJson():this.values.map(t=>t?.toJson())}};var _N=K(X()),Ud=class extends q{constructor(t){super();this.keyword=t;this.addChild(t),this.docSymbolsMeta={name:"DTS Document version",kind:_N.SymbolKind.Function}}};var Ar=class extends q{constructor(t,r){super();this.value=t;this.labels=r;this.labels.forEach(s=>{this.addChild(s)}),this.addChild(this.value)}toString(t){return`${this.labels.map(r=>r.toString()).join(" ")}${this.value?.toString(t)??"NULL"}`}toPrettyString(t){return`${this.labels.map(r=>r.toString()).join(" ")}${this.value?.toPrettyString(t)??"NULL"}`}};var EN=K(X()),Vd=class extends q{constructor(t,r,s){super();this.keyword=t;this.startAddress=r;this.endAddress=s;this.addChild(t),this.docSymbolsMeta={name:"Memreserve",kind:EN.SymbolKind.Function},this.addChild(r),this.addChild(s)}toString(){return`/memreserve/ 0x${this.startAddress?.value?.toString(16)} 0x${this.endAddress?.value?.toString(16)}`}};var wN=K(X()),Wd=class extends q{constructor(t,r){super();this.keyword=t;this.bitsSize=r;this.addChild(t),this.docSymbolsMeta={name:"bits",kind:wN.SymbolKind.Function},this.addChild(r)}toString(){return`/bits/ ${this.bitsSize?.value?.toString()}`}};var kN=K(X()),Ga=class extends Rs{constructor(t,r,s){super();this.uri=t;this.incudes=r;this.tokens=[];this.others=[];this.rootDocument=new Fe;this.unhandledStatements=new mt;this.cPreprocessorParser=new No(this.uri,this.incudes,s)}get issues(){return[...this._issues,...this.cPreprocessorParser.issues]}getFiles(){return[this.uri,...this.cPreprocessorParser.dtsIncludes.flatMap(t=>t.resolvedPath).filter(t=>!!t)]}reset(){super.reset(),this.others=[],this.rootDocument=new Fe,this._issues=[],this.unhandledStatements=new mt}async reparse(){let t=performance.now(),r=this.stable;return this.parsing=new Promise(s=>{r.then(async()=>{this.reset(),await this.cPreprocessorParser.reparse(),await this.parse(),console.log("parsing",performance.now()-t),s()})}),this.parsing}async parse(){let t=performance.now();if(await this.cPreprocessorParser.stable,this.tokens=this.cPreprocessorParser.tokens,Je(this.uri).endsWith(".h")||(this.positionStack.push(0),this.tokens.length===0))return;let r=async()=>{if(!(this.isDtsDocumentVersion()||this.isMemreserve()||this.isRootNodeDefinition(this.rootDocument)||this.isDeleteNode(this.rootDocument,"Ref")||this.isChildNode(this.rootDocument,"Ref")||this.isProperty(this.unhandledStatements)||this.isDeleteProperty(this.unhandledStatements))){let s=this.moveToNextToken;if(s){let i=new q(H(s));this._issues.push(V(22,i)),this.reportExtraEndStatements()}}};for(;!this.done;)await r();if(this.unhandledStatements.properties.forEach(s=>{this._issues.push(V(32,s))}),this.unhandledStatements.deleteProperties.forEach(s=>{this._issues.push(V(33,s))}),this.positionStack.length!==1)throw new Error("Incorrect final stack size")}isRootNodeDefinition(t){this.enqueueToStack();let r=this.moveToNextToken,s=r,i=13;if(!r||!$(r,i))return this.popStack(),!1;if(s=this.moveToNextToken,i=2,!s||!$(s,i))return this.popStack(),!1;let o=new mt;o.openScope=s,t.addNodeChild(o),this.processNode(o,"Name");let a=this.nodeEnd(o)??s;return o.firstToken=r,o.lastToken=a,this.mergeStack(),!0}nodeEnd(t){let r=this.currentToken;if($(r,3))this.moveToNextToken;else{let s=this.prevToken;if(s){let i=new q(H(s));this._issues.push(V(3,i))}return this.endStatement(!1)}return this.prevToken?.value==="}"&&(t.closeScope=this.prevToken),this.endStatement()}isNodeEnd(){return $(this.currentToken,3)||$(this.currentToken,1)}endStatement(t=!0){let r=this.currentToken;if(!$(r,1)){let s=this.prevToken;if(s&&t){let i=new q(H(this.prevToken));return this._issues.push(V(1,i)),s}}return this.moveToNextToken,this.reportExtraEndStatements(),r}reportExtraEndStatements(){for(;$(this.currentToken,1);){let t=this.moveToNextToken;if(t){let r=new q(H(t));this._issues.push(V(23,r))}}}processNode(t,r){if(this.done)return!1;let s=!1,i=!1;do{if(i=this.isChildNode(t,r)||this.isProperty(t)||this.isDeleteNode(t,r)||this.isDeleteProperty(t),!i&&!this.isNodeEnd()&&!this.done){let o=this.moveToNextToken;if(o){let a=new q(H(o));this._issues.push(V(22,a)),this.reportExtraEndStatements()}}else if(this.done)break;s=s||i}while(!this.isNodeEnd());return s}processOptionalLabelAssign(t=!1){let r=[],s=this.isLabelAssign(t);for(;s;)r.push(s),s=this.isLabelAssign(t);return r}isChildNode(t,r){this.enqueueToStack();let s;r==="Name"&&(s=this.isOmitIfNoRefNode());let i=this.processOptionalLabelAssign(),o,a,c=r==="Ref"?new xt(i):new Pe(i,s);if(r==="Ref"?a=this.isLabelRef():r==="Name"&&(o=this.isNodeName()),!a&&!o){if(!$(this.currentToken,2))return this.popStack(),!1;c.firstToken=this.currentToken,this._issues.push(V(r==="Name"?[7]:[10,11],c))}let l=!1;if(a&&c instanceof xt?(c.labelReference=a,l=!0):o&&c instanceof Pe&&(l=o.address!==void 0,c.name=o),$(this.currentToken,2)){this.moveToNextToken,c.openScope=this.prevToken;let u=!1;do u=this.processNode(c,"Name");while(u);let d=this.nodeEnd(c);c.lastToken=d}else if(l){let u=a??o;u&&this._issues.push(V(2,u))}else return this.popStack(),!1;return t.addNodeChild(c),this.mergeStack(),!0}processNodeAddress(){let t=this.prevToken,r=this.consumeAnyConcurrentTokens([19,20].map(De)),s=a=>{a=a.replace(/^0x/,"").replace(/\s+/g,""),a.length%8!==0&&(a=a.padStart(Math.ceil(a.length/8)*8,"0"));let c=[];for(let l=0;l<a.length;l+=8){let u=a.slice(l,l+8);c.push(parseInt(u,16)>>>0)}return c},i=r.length?s(r.map(a=>a.value).join("")):[NaN];if(t){if(i.some(a=>Number.isNaN(a))){let a=new q(H(t));this._issues.push(V(8,a))}else if(!Number.isNaN(i)&&!an(t,r[0])){let a=new q(H(t,r.at(0)));this._issues.push(V(29,a))}}return new Nd(i,H(r[0]??this.prevToken,r.at(-1)))}processNodeAddresses(t){this.enqueueToStack();let r=this.checkConcurrentTokens([De(49)]);if(r.length){if(!an(t.lastToken,r[0])){let o=new q(H(t.lastToken,r[0]));this._issues.push(V(29,o))}let s=[],i=()=>{if(s.push(this.processNodeAddress()),$(this.currentToken,24)){if(this.prevToken&&!an(this.prevToken,this.currentToken)){let o=new q(H(this.prevToken,this.currentToken));this._issues.push(V(29,o))}this.moveToNextToken,i()}};return i(),this.mergeStack(),s}this.popStack()}isNodeName(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16].map(De));if(!t.length){this.popStack();return}let r=t.map(o=>o.value).join("");if(!r.match(/^[A-Za-z]/)){this.popStack();return}let s=new Me(r,H(t[0],t.at(-1))),i=this.processNodeAddresses(s);return s.address=i,this.mergeStack(),s}isPropertyName(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16,44,46].map(De));if(!t.length){this.popStack();return}let r=new je(t.map(s=>s.value).join(""),H(t[0],t.at(-1)));return this.mergeStack(),r}isLabelName(){this.enqueueToStack();let t=this.consumeAnyConcurrentTokens([19,47,48].map(De));if(!t.length){this.popStack();return}let r=t.map(i=>i.value).join("");if(!r.match(/^[A-Za-z]/)){this.popStack();return}let s=new Bt(r,H(t[0],t.at(-1)));return this.mergeStack(),s}isLabelAssign(t){this.enqueueToStack();let r=this.consumeAnyConcurrentTokens([19,47,48].map(De));if(!r.length){this.popStack();return}let s=r.map(c=>c.value).join("");if(!s.match(/^[A-Za-z]/)){this.popStack();return}let i=this.currentToken,o=i&&$(i,50),a=new ks(new Bt(s,H(r[0],r.at(-1))),H(r[0],o?i:r.at(-1)));if(o){let c=r.at(-1);c&&(i.pos.line!==a.firstToken.pos.line||i.pos.col!==c.pos.colEnd)&&this._issues.push(V(29,new q(H(c,i)))),this.moveToNextToken}else if(t)this._issues.push(V(24,a));else{this.popStack();return}return this.mergeStack(),a}isProperty(t){this.enqueueToStack();let r=this.processOptionalLabelAssign(),s=this.isPropertyName();if(!s)return this.popStack(),!1;if($(this.currentToken,2)||$(this.currentToken,49))return this.popStack(),!1;let i=new xe(s,r),o;$(this.currentToken,0)?(i.assignOperatorToken=this.currentToken,this.moveToNextToken,o=this.processValue(i),o?.values.filter(c=>!!c).length||this._issues.push(V(0,i)),i.values=o??null):i.values=void 0;let a=this.endStatement();return i.lastToken=a,t.addNodeChild(i),this.mergeStack(),!0}isDtsDocumentVersion(){this.enqueueToStack();let t=this.checkConcurrentTokens([De(13),et("d"),et("ts"),De(16),et("v"),et("1")]);if(t.length!==6)return this.popStack(),!1;let r=t[0],s=r,i=new nt;i.firstToken=r;let o=new Ud(i);if(this.others.push(o),$(this.currentToken,13))s=this.moveToNextToken;else return i.lastToken=t.at(-1),this._issues.push(V(21,o)),this.mergeStack(),!0;return i.lastToken=s,o.lastToken=this.endStatement(),this.mergeStack(),!0}isMemreserve(){this.enqueueToStack();let t=this.checkConcurrentTokens([De(13),et("memreserve")]);if(t.length!==2)return this.popStack(),!1;let r=new nt;r.firstToken=t[0];let i=t[0];$(this.currentToken,13)?(i=this.moveToNextToken,r.lastToken=i):(r.lastToken=t.at(-1),this._issues.push(V(21,r)));let o=this.processHex()||this.processDec(),a=o&&(this.processHex()||this.processDec()),c=new Vd(r,o,a);return this.others.push(c),o||this._issues.push(V(37,r)),a||this._issues.push(V(38,o??r)),c.lastToken=this.endStatement(),this.mergeStack(),!0}processBits(){this.enqueueToStack();let t=this.checkConcurrentTokens([De(13),et("b"),et("its")]);if(t.length!==3){this.popStack();return}let r=new nt;r.firstToken=t[0];let i=t[0];$(this.currentToken,13)?(i=this.moveToNextToken,r.lastToken=i):(r.lastToken=t.at(-1),this._issues.push(V(21,r)));let o=this.processDec(),a=new Wd(r,o);return this.others.push(a),o?o.value!==8&&o.value!==16&&o.value!==32&&o.value!==64&&this._issues.push(V(40,o)):this._issues.push(V(39,r)),this._issues.push(V(41,a,kN.DiagnosticSeverity.Warning)),this.mergeStack(),a}isOmitIfNoRefNode(){this.enqueueToStack();let t=this.checkConcurrentTokens([De(13),et("omit"),De(16),et("if"),De(16),et("no"),De(16),et("ref"),De(13)]);if(t.length!==9){this.popStack();return}let r=new nt(H(t[0],t.at(-1)));return this.mergeStack(),r}isDeleteNode(t,r){this.enqueueToStack();let s=this.checkConcurrentTokens([De(13),et("d"),et("e"),et("lete"),De(16),et("node")]);if(!s.length)return this.popStack(),!1;let i=s[0],o=i,a=new nt;if(a.firstToken=i,s.length===1&&!$(this.currentToken,2)){this._issues.push(V(25,a)),a.lastToken=s.at(-1);let d=new Tn(a);return t.addNodeChild(d),this.mergeStack(),!0}let c=s.map(d=>d.value??"").join("");if(!"/delete-node/".startsWith(c)||c.endsWith("-"))return this.popStack(),!1;a.lastToken=s.at(-1),c!=="/delete-node"?this._issues.push(V(c.startsWith("/delete-n")?34:25,a)):$(this.currentToken,13)?(o=this.moveToNextToken,a.lastToken=o):this._issues.push(V(21,a));let l=new Tn(a);if(Rr(a.tokenIndexes?.end,i)){let d=this.processNodePathRef();d&&r==="Name"&&this._issues.push(V(7,d));let f=d?void 0:this.isLabelRef();f&&r==="Name"&&this._issues.push(V(7,f));let p=d||f?void 0:this.isNodeName();p&&r==="Ref"&&this._issues.push(V(10,p)),!d&&!p&&!f&&this._issues.push(V([7,10],l)),l.nodeNameOrRef=d??f??p??null}else r==="Name"?this._issues.push(V(7,a)):r==="Ref"&&this._issues.push(V(10,a));let u=this.endStatement();return l.lastToken=u,t.addNodeChild(l),this.mergeStack(),!0}isDeleteProperty(t){this.enqueueToStack();let r=this.checkConcurrentTokens([De(13),et("d"),et("e"),et("lete"),De(16),et("property")]);if(!r.length)return this.popStack(),!1;let s=r[0],i=s,o=new nt;if(o.firstToken=s,r.length===1&&!$(this.currentToken,2)){this._issues.push(V(25,o)),o.lastToken=r.at(-1);let u=new We(o);return t.addNodeChild(u),this.mergeStack(),!0}let a=r.map(u=>u.value??"").join("");if(!"/delete-property/".startsWith(a)||a.endsWith("-"))return this.popStack(),!1;o.lastToken=r.at(-1),a!=="/delete-property"?this._issues.push(V(a.startsWith("/delete-p")?35:25,o)):$(this.currentToken,13)?(i=this.moveToNextToken,o.lastToken=i):this._issues.push(V(21,o));let c=new We(o);if(Rr(o.tokenIndexes?.end,s)){let u=this.isPropertyName();u||this._issues.push(V(6,c)),c.propertyName=u??null}else this._issues.push(V(6,o));let l=this.endStatement();return c.lastToken=l,t.addNodeChild(c),this.mergeStack(),!0}isNodePathRef(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!0),r=this.processNodePathRef();if(!r){this.popStack();return}let s=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&s.push(...this.processOptionalLabelAssign(!0));let i=new ln(t,r,s);return this.mergeStack(),i}processValue(t){this.enqueueToStack();let s=(()=>{let o=()=>(this.processStringValue()||this.isNodePathRef()||this.isLabelRefValue(t)||this.arrayValues(t)||this.processByteStringValue()||this.isExpressionValue())??null,a=o();if(!a)return[];let c=[a];for(;!$(this.currentToken,1);){let l=this.prevToken,u=this.currentToken,d=$(this.currentToken,24);if(d)this.moveToNextToken;else if(!Rr(this.prevToken,this.currentToken))break;let f=o();if(u&&f===null&&d){let p=new q(H(u,this.currentToken));this._issues.push(V(0,p))}if(!d&&f===null)break;if(l&&!d&&f){let p=new q(H(l));this._issues.push(V(28,p))}c.push(f)}return c})();if(s.length===0){this.popStack();return}return this.mergeStack(),new Bd(s)}processStringValue(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!0),r=this.moveToNextToken;if(!$(r,21)){this.popStack();return}if(!r?.value)throw new Error("Token must have value");let s=r.value;s.match(/["']$/)&&(s=s.slice(1,-1));let i=new Ie(s,H(r));r.value.match(/["']$/)||this._issues.push(V(r.value.startsWith('"')?16:17,i));let o=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(o=this.processOptionalLabelAssign(!0));let a=new ln(t,i,o);return this.mergeStack(),a}arrayValues(t){this.enqueueToStack();let r=this.processOptionalLabelAssign(!0),s=this.processBits(),i=this.currentToken;if($(i,5))this.moveToNextToken;else{this.popStack();return}let o=this.processArrayValues(t)??null;o.openBracket=i;let a=this.processOptionalLabelAssign(!0)??[],c=new ln(r,o,a,s);$(this.currentToken,4)?(o&&(o.closeBracket=this.currentToken),this.moveToNextToken):this._issues.push(V(12,c));let l=[];return this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(l=this.processOptionalLabelAssign(!0)),this.mergeStack(),c.endLabels.push(...l),c.firstToken=i,c.lastToken=this.prevToken,c}processByteStringValue(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!0),r=this.moveToNextToken,s=r;if(!$(s,11)){this.popStack();return}let i=this.processLabeledValue(()=>this.processHexString()),o=this.processOptionalLabelAssign(!0)??[];i.forEach(u=>{let d=0;u.value?.tokenIndexes?.start===u.value?.tokenIndexes?.end&&(d=u.value?.tokenIndexes?.start?.pos.len??0),d%2!==0&&this._issues.push(V(15,u))});let a=new Ss(i??[]);a.openBracket=s,a.values.length===0&&(a.firstToken=r,this._issues.push(V(14,a)));let c=new ln(t,a,o);$(this.currentToken,12)?a.openBracket=this.moveToNextToken:this._issues.push(V(5,c));let l=[];return this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(l=this.processOptionalLabelAssign(!0)),this.mergeStack(),c.endLabels.push(...l),c.firstToken=r,a.lastToken=this.prevToken,c}processLabeledValue(t){this.enqueueToStack();let r=t(),s=[];if(!r)return this.popStack(),[];for(;r;)s=[...s,r],r=t();if(s){let i=t();i&&(s=[...s,i])}return this.mergeStack(),s}processArrayValues(t){this.enqueueToStack();let r=this.processLabeledValue(()=>this.processRefValue(!1,t)||this.processLabeledHex(!1)||this.processLabeledDec(!1)||this.processLabeledExpression(!0,!1)),s=new St(r);return r.length===0&&(s.firstToken=this.currentToken),this.mergeStack(),s}processLabeledHex(t){this.enqueueToStack();let r=this.processOptionalLabelAssign(t),s=this.processHex();if(!s){this.popStack();return}let i=new Ar(s,r);return this.mergeStack(),i}processHexString(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!1),r=this.checkConcurrentTokens([20,20].map(De));if(!r.length){this.popStack();return}let s=Number.parseInt(r.map(a=>a.value).join(""),16),i=new It(s,H(r[0],r.at(-1))),o=new Ar(i,t);return this.mergeStack(),o}processLabeledDec(t){this.enqueueToStack();let r=this.processOptionalLabelAssign(t),s=this.processDec();if(!s){this.popStack();return}let i=new Ar(s,r);return this.mergeStack(),i}processLabeledExpression(t=!0,r=t){this.enqueueToStack();let s=[];t&&(s=this.processOptionalLabelAssign(r));let i=this.processExpression(this.cPreprocessorParser.macros);if(!i){this.popStack();return}let o=new Ar(i,s);return this.mergeStack(),o}isExpressionValue(){this.enqueueToStack();let t=this.processOptionalLabelAssign(!1),r=this.processExpression(this.cPreprocessorParser.macros);if(!r){this.popStack();return}let s=this.processOptionalLabelAssign(!0),i=new ln(t,r,s);return this.mergeStack(),i}isLabelRef(t){this.enqueueToStack();let r=this.currentToken;if($(r,40))this.moveToNextToken;else{this.popStack();return}let s=this.isLabelName();if(!s){let o=new ye(null);return this._issues.push(V(18,t??o)),o.firstToken=r,this.mergeStack(),o}r&&(s.firstToken.pos.line!==r.pos.line||s.firstToken.pos.col!==r.pos.colEnd)&&this._issues.push(V(29,new q(H(r,s.firstToken))));let i=new ye(s);return i.firstToken=r,this.mergeStack(),i}isLabelRefValue(t){this.enqueueToStack();let r=this.processOptionalLabelAssign(!0),s=this.isLabelRef(t);if(!s){this.popStack();return}let i=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(i=this.processOptionalLabelAssign(!0));let o=new ln(r,s,i);return this.mergeStack(),o}processRefValue(t,r){this.enqueueToStack();let s=this.processOptionalLabelAssign(t),i=this.currentToken;if(!$(this.currentToken,40)){this.popStack();return}let o=this.processNodePathRef();if(o!==void 0){let l=new Ar(o,s);return this.mergeStack(),l}let a=this.isLabelRef(r);if(a===void 0){this._issues.push(V([18,9],r));let l=new Ar(null,s);return l.firstToken=s.at(0)?.firstToken??i,this.mergeStack(),l}let c=new Ar(a,s);return c.firstToken=s.at(0)?.firstToken??i,this.mergeStack(),c}processNodePath(t=!0,r=new Xr){this.enqueueToStack();let s;if($(this.currentToken,13))s=this.moveToNextToken;else{if(!t){this.popStack();return}this.prevToken&&this._issues.push(V(19,new q(H(this.prevToken))))}let i=this.isNodeName();if(i||this._issues.push(V(7,new q(H(s??this.prevToken)))),r.addPath(i??null,s?new q(H(s)):void 0),t&&!s&&r.children.length===0){this.mergeStack();return}return this.processNodePath(!1,r),this.mergeStack(),r}processNodePathRef(){this.enqueueToStack();let t=this.moveToNextToken,r=t;if(!$(r,40)){this.popStack();return}let s=this.moveToNextToken;if(r=s,!$(r,2)){this.popStack();return}let i=this.processNodePath(),o=new In(i??null),a=this.currentToken??this.prevToken,c=a;return i?.children.forEach((l,u)=>{if(u===i?.children.length-1&&l&&c&&!an(l.lastToken,c)){this._issues.push(V(29,new q(H(l.lastToken,c))));return}if(u===0&&s&&!an(s,l?.firstToken)){this._issues.push(V(29,new q(H(s,l?.firstToken))));return}let d=i?.children[u+1];l&&d&&!an(l.lastToken,d.firstToken)&&this._issues.push(V(29,new q(H(l.lastToken,d?.firstToken))))}),$(a,3)?this.moveToNextToken:this.prevToken&&this._issues.push(V(3,new q(H(this.prevToken)))),o.firstToken=t,o.lastToken=a??this.prevToken,this.mergeStack(),o}get includes(){return this.allAstItems.filter(t=>t instanceof _s)}get allAstItems(){return[...this.cPreprocessorParser.allAstItems,...this.rootDocument.children,...this.others,...this.unhandledStatements.properties,...this.unhandledStatements.deleteProperties]}};var Ro=K(X());var NN=require("fs");var PN=require("path"),zd=class{constructor(e,t){this.settings=e;this.bindingLoader=t;this._issues=[];this.overlayParsers=[];this.overlays=[];this.ctxNames_=new Set;this.sortKeys=new WeakMap;let r={includePaths:[],overlays:[],zephyrBindings:[],deviceOrgTreeBindings:[],deviceOrgBindingsMetaSchema:[],...e,ctxName:e.ctxName??(0,PN.basename)(e.dtsFile),lockRenameEdits:[]};this.overlays=r.overlays,this.overlays.filter(NN.existsSync),this.parser=new Ga(r.dtsFile,r.includePaths),this.ctxNames_.add(r.ctxName),this.id=Jr(r),this.parser.stable.then(()=>{this.overlayParsers=this.overlays?.map(s=>new Ga(s,r.includePaths,this.parser.cPreprocessorParser.macros))??[]})}get macros(){return[this.parser,...this.overlayParsers].at(-1).cPreprocessorParser.macros}get ctxNames(){return Array.from(this.ctxNames_)}addCtxName(e){this.ctxNames_.add(e)}removeCtxName(e){this.ctxNames_.delete(e)}async getContextIssues(){return[...(await this.getRuntime()).issues,...this._issues]}async getFileTree(){let e=new Map,t=s=>({file:s,includes:(e.get(s)??[]).map(i=>t(i.resolvedPath??i.path))});return(await this.getRuntime()).includes.forEach(s=>{let i=e.get(s.uri);i||(i=[],e.set(s.uri,i)),i.push({path:s.path.path,resolvedPath:s.resolvedPath})}),{mainDtsPath:t(this.parser.uri),overlays:this.overlays.map(t)}}async stable(){await Promise.all([this.parser.stable,...this.overlayParsers.map(e=>e.stable)])}async getRuntime(){return await this.stable(),this._runtime??=this.evaluate(),this._runtime}getContextFiles(){return[...this.overlayParsers.flatMap(e=>e.getFiles()),...this.parser.getFiles()]}isInContext(e){return this.getContextFiles().some(t=>le(t,e))}getUriParser(e){let t=this.overlayParsers.find(r=>r.getFiles().some(s=>le(s,e)));return t??=this.parser.getFiles().some(r=>le(r,e))?this.parser:void 0,t}async getAllParsers(){return await this.stable(),[this.parser,...this.overlayParsers]}async getDocumentLinks(e,t){if(!this.isInContext(e))return[];let s=(await this.getRuntime()).rootNode.allBindingsProperties.filter(i=>le(i.ast.uri,e)&&(!t||On(i.ast,e,t))).flatMap(i=>i.ast.values?.values.flatMap(o=>{let c=i.parent?.nodeTypes.find(l=>o?.value instanceof Ie&&l.compatible===o.value.value);return c?{range:Z(o.value),target:de(c.bindingsPath)}:void 0})).filter(i=>i)??[];return[...this.parser.cPreprocessorParser.dtsIncludes.filter(i=>le(i.uri,e)&&(!t||On(i,e,t))).map(i=>{let o=this.parser.cPreprocessorParser.resolveInclude(i);if(o)return{range:Z(i.path),target:de(o)}}).filter(i=>i)??[],...s]}linkPropertiesLabelsAndNodePaths(e){let t=i=>[...i.property,...i.nodes.flatMap(t)],r=t(e.rootNode),s=e.rootNode.allDescendantsLabels;r.forEach(i=>i.ast.allDescendants.forEach(o=>{if(o instanceof ye){let a=e.resolvePath([`&${o.label?.value}`],s);if(a){let c=e.rootNode.getChild(a);o.linksTo=c,c?.linkedRefLabels.push(o)}else o.value&&this._issues.push(Ot(3,o,Ro.DiagnosticSeverity.Error,[],[],[o.value]))}else if(o instanceof Xr){let a=e.rootNode,c=o.pathParts;for(let l=0;l<c.length&&c[l];l++){let u=!1,d=c[l];if(d){let f=a?.getNode(d.name,d.fullAddress,!1);d.linksTo=f,!u&&!f&&(u=!0,this._issues.push(Ot(8,d,Ro.DiagnosticSeverity.Error,[],[],[d.toString(),`${o.pathParts.filter(p=>p?.linksTo).map(p=>p?.toString()).join("/")}`]))),f?.linkedNodeNamePaths.push(d),a=f}else break}}}))}async reevaluate(e){let t=this.getUriParser(e);return t?(this.sortKeys=new WeakMap,await t.reparse(),this._runtime=this.evaluate(),this._runtime):this._runtime}getSortKey(e){if(e)return this.sortKeys.get(e.firstToken)}async evaluate(){let e=performance.now();await this.stable();let t=new Po(this);this._issues=[],this.processRoot(this.parser.rootDocument,t);for(let r=0;r<this.overlayParsers.length;r++)this.processRoot(this.overlayParsers[r].rootDocument,t);return t.includes=this.parser.includes,t.comments=this.parser.cPreprocessorParser.allAstItems.filter(r=>r instanceof Dr),(await this.getAllParsers()).flatMap(r=>r.tokens).forEach((r,s)=>this.sortKeys.set(r,s)),this.linkPropertiesLabelsAndNodePaths(t),console.log(`(ID: ${this.id}) evaluate`,performance.now()-e),t}processRoot(e,t){for(let r=0;r<e.children.length;r++){let s=e.children[r];this.processChild(s,t.rootNode,t)}}processChild(e,t,r){e instanceof Fe?this.processDtcBaseNode(e,t,r):e instanceof xe?this.processDtcProperty(e,t,r):e instanceof Tn?this.processDeleteNode(e,t,r):e instanceof We&&this.processDeleteProperty(e,t,r)}checkNodeUniqueNames(e,t){let r=(o,a)=>o.some(c=>c.name===a.name&&(c.address===void 0||a.fullAddress===void 0||Ft(c.address,a.fullAddress)===0)),s=t.nodes.map(o=>({name:o.name,address:o.address})),i=[];e.children.forEach(o=>{if(o instanceof Pe&&o.name)r(i.map(a=>({name:a.name,address:a.fullAddress})),o.name)&&this._issues.push(Ot(2,o.name)),i.push(o.name);else if(o instanceof Tn&&o.nodeNameOrRef instanceof Me){let a=o.nodeNameOrRef;r(s,a)&&(i=i.filter(c=>r(i.map(l=>({name:l.name,address:l.fullAddress})),c)))}})}processDtcBaseNode(e,t,r){e instanceof mt?this.processDtcRootNode(e,r):e instanceof Pe?this.processDtcChildNode(e,t,r):e instanceof xt&&this.processDtcRefNode(e,r)}processDtcRootNode(e,t){t.roots.push(e),t.rootNode.definitions.push(e),this.checkNodeUniqueNames(e,t.rootNode),[...e.children].sort((r,s)=>r instanceof xe&&s instanceof We||s instanceof xe&&r instanceof We?0:s instanceof xe?1:0).forEach(r=>this.processChild(r,t.rootNode,t))}processDtcChildNode(e,t,r){if(e.name?.name){let s=e.path?r.resolvePath(e.path):void 0,o=(s?r.rootNode.getChild(s):void 0)??new Se(this.bindingLoader,e.name.name,e.name.fullAddress,t);o.definitions.push(e),e.labels.forEach(a=>a.lastLinkedTo=o),t=o,this.checkNodeUniqueNames(e,o)}[...e.children].sort((s,i)=>s instanceof Fe&&i instanceof Fe?0:s instanceof Fe?-1:0).forEach(s=>this.processChild(s,t,r))}processDtcRefNode(e,t){let r;if(e.labelReference){let s=e.resolveNodePath??(e.pathName?t.resolvePath([e.pathName]):void 0);s?(e.resolveNodePath??=[...s],r=t.rootNode.getChild(s),e.labelReference.linksTo=r,e.labels.forEach(i=>i.lastLinkedTo=r),r?.linkedRefLabels.push(e.labelReference),r?.referencedBy.push(e),e.labels.forEach(i=>{t.labelsUsedCache.set(i.label.value,s)}),r?(t.references.push(e),this.checkNodeUniqueNames(e,r)):t.unlinkedRefNodes.push(e)):(this._issues.push(Ot(3,e.labelReference,Ro.DiagnosticSeverity.Error,[],[],[e.labelReference.label?.value??""])),t.unlinkedRefNodes.push(e))}else t.unlinkedRefNodes.push(e);[...e.children].sort((s,i)=>s instanceof Fe&&i instanceof Fe?0:s instanceof Fe?-1:0).forEach(s=>this.processChild(s,r??new Se(this.bindingLoader,""),t))}processDtcProperty(e,t,r){e.propertyName?.name&&t.addProperty(new ze(e,t)),e.children.forEach(s=>this.processChild(s,t,r))}processDeleteNode(e,t,r){if(e.nodeNameOrRef instanceof Me&&e.nodeNameOrRef.value){if(e.parentNode?.parentNode)if(!t.hasNode(e.nodeNameOrRef.name,e.nodeNameOrRef.fullAddress))this._issues.push(Ot(5,e.nodeNameOrRef));else{t.deletes.push(e);let s=t.getNode(e.nodeNameOrRef.name,e.nodeNameOrRef.fullAddress);e.nodeNameOrRef.linksTo=s,t.deleteNode(e.nodeNameOrRef.name,e,e.nodeNameOrRef.fullAddress),s?.labels.forEach(i=>{r.labelsUsedCache.delete(i.label.value)})}}else if(e.nodeNameOrRef instanceof ye&&e.nodeNameOrRef.value){let s=r.resolvePath([`&${e.nodeNameOrRef.value}`]),i;s?(i=r.rootNode.getChild(s),t.deletes.push(e),e.nodeNameOrRef.linksTo=i,i?.labels.forEach(o=>{r.labelsUsedCache.delete(o.label.value)}),i?.linkedRefLabels.push(e.nodeNameOrRef),i?.parent?.deleteNode(i.name,e,i.address),e.parentNode instanceof Fe&&!e.parentNode.pathName&&r.globalDeletes.push(e)):(r.unlinkedDeletes.push(e),this._issues.push(Ot(3,e.nodeNameOrRef,Ro.DiagnosticSeverity.Error,[],[],[e.nodeNameOrRef.value])))}else if(e.nodeNameOrRef instanceof In&&e.nodeNameOrRef.path&&!e.nodeNameOrRef.path.pathParts.some(s=>!s)){let s=["/",...e.nodeNameOrRef.path.pathParts.map(u=>u.toString())],i=r.rootNode,o=e.nodeNameOrRef.path.pathParts;for(let u=0;u<o.length&&o[u];u++){let d=o[u];if(d){let f=i?.getNode(d.name,d.fullAddress,!1);d.linksTo=f,f?.linkedNodeNamePaths.push(d),i=f}}let a=e.nodeNameOrRef.path.pathParts.every(u=>u),c=e.nodeNameOrRef.path.pathParts.find(u=>u&&!u.linksTo),l=e.nodeNameOrRef.path.pathParts.at(-1)?.linksTo;l||(r.unlinkedDeletes.push(e),c&&this._issues.push(Ot(8,c,Ro.DiagnosticSeverity.Error,[],[],[c.toString(),`${e.nodeNameOrRef.path.pathParts.filter(u=>u?.linksTo).map(u=>u?.toString()).join("/")}`]))),t.deletes.push(e),l?.labels.forEach(u=>{r.labelsUsedCache.delete(u.label.value)}),l?.parent?.deleteNode(l.name,e,l.address),e.parentNode instanceof Fe&&!e.parentNode.pathName&&r.globalDeletes.push(e)}else r.unlinkedDeletes.push(e);e.children.forEach(s=>this.processChild(s,t,r))}processDeleteProperty(e,t,r){e.propertyName?.name&&!t.hasProperty(e.propertyName.name)?this._issues.push(Ot(1,e.propertyName)):e.propertyName?.name&&(t.deletes.push(e),t.deleteProperty(e.propertyName.name,e)),e.children.forEach(s=>this.processChild(s,t,r))}async getDiagnostics(){let e=new Map,t=(r,s)=>{let i=e.get(s);i||(i=[],e.set(s,i)),i.push(r)};try{return(await this.getAllParsers()).forEach(i=>{i.issues.forEach(o=>t(o.diagnostic(),o.raw.astElement.uri))}),(await this.getContextIssues()??[]).forEach(i=>t(i.diagnostic(),i.raw.astElement.uri)),(await this.getRuntime())?.typesIssues.forEach(i=>t(i.diagnostic(),i.raw.astElement.uri)),e}catch(r){throw console.error(r),r}}async toFullString(){return`/dts-v1/;
273
- ${(await this.getRuntime()).rootNode.toFullString((await this.getAllParsers()).at(-1).cPreprocessorParser.macros)}`}async serialize(){return(await this?.getRuntime())?.rootNode.serialize((await this.getAllParsers()).at(-1).cPreprocessorParser.macros)}};var gt=K(X());var RN=require("fs"),Do=require("path");function r$(n){if(!n||!(n.ast instanceof yo))return[];let e=r=>r.flatMap(s=>(0,RN.readdirSync)(s,{withFileTypes:!0,recursive:!0}).filter(i=>i.name.toLowerCase().endsWith(".dtsi")||i.name.toLowerCase().endsWith(".h")).map(i=>({label:`${(0,Do.join)((0,Do.relative)(s,i.parentPath),i.name)}`,kind:gt.CompletionItemKind.File})));if(n.ast.relative)return e([(0,Do.dirname)(n.ast.uri)]);let t=n.runtime.context.settings.includePaths??[];return e(t)}var Kd=(n,e)=>[...n.labels.filter(e),...n.deletedNodes.filter(t=>!e(t.by)).flatMap(t=>Kd(t.node,e)),...n.nodes.flatMap(t=>Kd(t,e))],gg=(n,e)=>[...n.labels,...n.deletedNodes.filter(t=>!e(t.by)).flatMap(t=>gg(t.node,e)),...n.nodes.flatMap(t=>gg(t,e))];function s$(n,e){if(!n||!(n.item instanceof ze)||!(n.ast instanceof ye))return[];let t=r=>gg(r,e);return Array.from(new Set(t(n.runtime.rootNode).map(r=>r.label.value))).map(r=>({label:`${r}`,kind:gt.CompletionItemKind.Method}))}function i$(n,e){if(!n||n.item!==null||!(n.ast instanceof ye)||!(n.ast.parentNode instanceof xt))return[];let t=r=>Kd(r,e).filter(s=>e(s));return[...Array.from(new Set(t(n.runtime.rootNode).map(r=>r.label.value))).map(r=>({label:r,insertText:`${r} {
276
+ `)&&this.lines.splice(-1,1),this.lexIt()}get tokens(){return this._tokens}isWhiteSpace(){return!!this.currentChar?.match(/\s/)}get endOfFile(){return this.isOnLastLine&&this.isOnLastCharOfLine}get isOnLastLine(){return this.lineNumber===this.lines.length-1}get isOnLastCharOfLine(){return this.lines[this.lineNumber].length<=this.columnNumber}moveToNextLine(){return this.isOnLastLine?!1:(this.columnNumber=0,this.lineNumberOfEscapedChars=0,this.lineNumber++,this.lines[this.lineNumber].length===0&&this.moveToNextLine(),!0)}moveOnLine(){return this.isOnLastCharOfLine?this.moveToNextLine():(this.columnNumber++,this.isOnLastCharOfLine&&this.moveToNextLine(),!0)}move(){return this.endOfFile?!1:this.moveOnLine()}get currentChar(){return this.endOfFile?null:this.lines[this.lineNumber].at(this.columnNumber)}static isSyntaxChar(e){return e==="^"||e==="~"||e==="|"||e==="!"||e==="\\"||e==="<"||e===">"||e===";"||e==="="||e==="/"||e==="{"||e==="}"||e==="["||e==="]"||e==="("||e===")"||e==="*"||e==="%"||e==="&"||e==="."||e===":"||e==="+"||e==="@"||e==="-"||e==="_"||e===","||e==="x"||e==="?"}getWord(){let e="";for(;!this.isWhiteSpace()&&(e.length&&!t.isSyntaxChar(this.currentChar)||!e.length);){if(e+=this.currentChar??"",e.length===1&&t.isSyntaxChar(this.currentChar)){this.move();break}let n=this.lineNumber;if(!this.move()||this.lineNumber!==n)return e}return e==="/"&&this.currentChar==="*"?this.inComment=!0:this.inComment&&e==="*"&&this.currentChar==="/"&&(this.inComment=!1),e}getString(e){let n=e;for(this.numberOfEscapedCharsLastString=0;this.currentChar!==e;){if(n+=this.currentChar??"",this.currentChar==="\\"){let r=this.lineNumber;if(this.move())this.lineNumberOfEscapedChars++,this.numberOfEscapedCharsLastString++,r===this.lineNumber&&(n+=this.currentChar??"");else return n}if(!this.move())return n}return this.move(),n+=e,n}lexIt(){for(;!this.endOfFile&&(this.whiteSpace(),!this.endOfFile);){let e=this.getWord();e&&this.process(e)}}process(e){let n=this.isString(e)||this.isCDefine(e)||this.isCInclude(e)||this.isCLine(e)||this.isCUndef(e)||this.isCError(e)||this.isCPragma(e)||this.isCDefined(e)||this.isCIfDef(e)||this.isCIfNDef(e)||this.isCIf(e)||this.isCElIf(e)||this.isCElse(e)||this.isCEndIf(e)||this.isCFalse(e)||this.isCTrue(e)||this.isDigit(e)||this.isHexDigit(e)||this.isLetters(e)||this.isComma(e)||this.isBitwiseNot(e)||this.isBitwiseXOr(e)||this.isBitwiseOr(e)||this.isLogicalNot(e)||this.isGtSym(e)||this.isLtSym(e)||this.isSemicolon(e)||this.isColon(e)||this.isAssignOperator(e)||this.isForwardSlash(e)||this.isRoundOpen(e)||this.isRoundClose(e)||this.isCurlyOpen(e)||this.isCurlyClose(e)||this.isSquareOpen(e)||this.isSquareClose(e)||this.isBackSlash(e)||this.isMultiplicationOperator(e)||this.isModulusOperator(e)||this.isAmpersand(e)||this.isNegateOperator(e)||this.isAddOperator(e)||this.isQuestionMark(e)||this.isPeriod(e)||this.isHash(e)||this.isUnderScore(e)||this.isAt(e)||this.unknownToken(e);if(!n)throw new Error(`Lexer is not complete!!! Could not find token for "${e}"`);let r=this._tokens.at(-1);return n&&!r?.tokens.some(s=>s===21)&&r&&r.pos.len<e.length?this.process(e.slice(r.pos.len)):!0}whiteSpace(){for(;this.isWhiteSpace();)this.move()}pushToken(e){let n={...e,uri:this.uri},r=this._tokens.at(-1);n.prevToken=r,r&&(r.nextToken=n),this._tokens.push(n)}isLetters(e){let n=e.match(/^[A-Za-z]+/);return n?.[0]?(this.pushToken({tokens:[47],value:n?.[0],pos:this.generatePos(e,n?.[0])}),!0):!1}isDigit(e){let n=e.match(/^[0-9]/);return n?.[0]?(this.pushToken({tokens:[20,19],value:n[0],pos:this.generatePos(e,n[0])}),!0):!1}isHexDigit(e){let n=e.match(/^[A-Fa-f]/);return n?.[0]?(this.pushToken({tokens:[20,47],value:n[0],pos:this.generatePos(e,n[0])}),!0):!1}isCurlyOpen(e){let n="{";return e===n?(this.pushToken({tokens:[2],pos:this.generatePos(e,n),value:"{"}),!0):!1}isCurlyClose(e){let n="}";return e===n?(this.pushToken({tokens:[3],pos:this.generatePos(e,n),value:"}"}),!0):!1}isSemicolon(e){let n=";";return e===n?(this.pushToken({tokens:[1],pos:this.generatePos(e,n),value:n}),!0):!1}isColon(e){let n=":";return e===n?(this.pushToken({tokens:[50],pos:this.generatePos(e,n),value:n}),!0):!1}isHash(e){let n="#";return e.startsWith(n)?(this.pushToken({tokens:[46],pos:this.generatePos(e,n),value:n}),!0):!1}unknownToken(e){return this.pushToken({tokens:[41],pos:this.generatePos(e," "),value:e}),!0}isAssignOperator(e){let n="=";return e===n?(this.pushToken({tokens:[0],pos:this.generatePos(e,n),value:n}),!0):!1}isGtSym(e){let n=">";return e===n?(this.pushToken({tokens:[4],pos:this.generatePos(e,n),value:n}),!0):!1}isLtSym(e){let n="<";return e===n?(this.pushToken({tokens:[5],pos:this.generatePos(e,n),value:n}),!0):!1}isLogicalNot(e){let n="!";return e===n?(this.pushToken({tokens:[6],pos:this.generatePos(e,n),value:n}),!0):!1}isBitwiseOr(e){let n="|";return e===n?(this.pushToken({tokens:[8],pos:this.generatePos(e,n),value:n}),!0):!1}isBitwiseXOr(e){let n="^";return e===n?(this.pushToken({tokens:[9],pos:this.generatePos(e,n),value:n}),!0):!1}isAmpersand(e){let n="&";return e===n?(this.pushToken({tokens:[40,7],pos:this.generatePos(e,n),value:n}),!0):!1}isBitwiseNot(e){let n="~";return e===n?(this.pushToken({tokens:[10],pos:this.generatePos(e,n),value:n}),!0):!1}isRoundOpen(e){let n="(";return e===n?(this.pushToken({tokens:[42],pos:this.generatePos(e,n),value:n}),!0):!1}isRoundClose(e){let n=")";return e===n?(this.pushToken({tokens:[43],pos:this.generatePos(e,n),value:n}),!0):!1}isSquareOpen(e){let n="[";return e===n?(this.pushToken({tokens:[11],pos:this.generatePos(e,n),value:n}),!0):!1}isSquareClose(e){let n="]";return e===n?(this.pushToken({tokens:[12],pos:this.generatePos(e,n),value:n}),!0):!1}isComma(e){let n=",";return e===n?(this.pushToken({tokens:[24],pos:this.generatePos(e,n),value:n}),!0):!1}rewind(e){if(this.columnNumber+1<e.length)throw new Error("Error while rewinding");this.columnNumber-=e.length}isString(e){if(this.inComment)return!1;let n=e.match(/^["']/);if(n?.[0]){this.rewind(e.slice(1));let r=this.lineNumber,s=this.columnNumber-1,i=this.getString(n[0]),o=i.length+this.numberOfEscapedCharsLastString;return this.pushToken({tokens:[21],value:i,pos:{col:s,line:r,len:o,colEnd:s+o}}),!0}return!1}isForwardSlash(e){let n="/";return e===n?(this.pushToken({tokens:[13],pos:this.generatePos(e,n),value:"/"}),!0):!1}isBackSlash(e){let n="\\";return e===n?(this.pushToken({tokens:[14],pos:this.generatePos(e,n),value:"\\"}),!0):!1}isAddOperator(e){let n="+";return e===n?(this.pushToken({tokens:[15],pos:this.generatePos(e,n),value:n}),!0):!1}isQuestionMark(e){let n="?";return e===n?(this.pushToken({tokens:[44],pos:this.generatePos(e,n),value:n}),!0):!1}isPeriod(e){let n=".";return e===n?(this.pushToken({tokens:[45],pos:this.generatePos(e,n),value:n}),!0):!1}isNegateOperator(e){let n="-";return e===n?(this.pushToken({tokens:[16],pos:this.generatePos(e,n),value:n}),!0):!1}isUnderScore(e){let n="_";return e===n?(this.pushToken({tokens:[48],pos:this.generatePos(e,n),value:n}),!0):!1}isAt(e){let n="@";return e===n?(this.pushToken({tokens:[49],pos:this.generatePos(e,n),value:n}),!0):!1}isMultiplicationOperator(e){let n="*";return e===n?(this.pushToken({tokens:[17],pos:this.generatePos(e,n),value:n}),!0):!1}isModulusOperator(e){let n="%";return e===n?(this.pushToken({tokens:[18],pos:this.generatePos(e,n),value:n}),!0):!1}isCDefine(e){let n="#define";return e.toLowerCase()===n?(this.pushToken({tokens:[25],pos:this.generatePos(e,n),value:n}),!0):!1}isCInclude(e){let n="#include";return e.toLowerCase()===n?(this.pushToken({tokens:[26],pos:this.generatePos(e,n),value:n}),!0):!1}isCLine(e){let n="#line";return e.toLowerCase()===n?(this.pushToken({tokens:[27],pos:this.generatePos(e,n),value:n}),!0):!1}isCUndef(e){let n="#undef";return e.toLowerCase()===n?(this.pushToken({tokens:[28],pos:this.generatePos(e,n),value:n}),!0):!1}isCError(e){let n="#error";return e.toLowerCase()===n?(this.pushToken({tokens:[29],pos:this.generatePos(e,n),value:n}),!0):!1}isCPragma(e){let n="#pragma";return e.toLowerCase()===n?(this.pushToken({tokens:[30],pos:this.generatePos(e,n),value:n}),!0):!1}isCDefined(e){let n="#defined";return e.toLowerCase()===n?(this.pushToken({tokens:[31],pos:this.generatePos(e,n),value:n}),!0):!1}isCIf(e){let n="#if";return e.toLowerCase()===n?(this.pushToken({tokens:[32],pos:this.generatePos(e,n),value:n}),!0):!1}isCIfDef(e){let n="#ifdef";return e.toLowerCase()===n?(this.pushToken({tokens:[33],pos:this.generatePos(e,n),value:n}),!0):!1}isCIfNDef(e){let n="#ifndef";return e.toLowerCase()===n?(this.pushToken({tokens:[34],pos:this.generatePos(e,n),value:n}),!0):!1}isCElIf(e){let n="#elif";return e.toLowerCase()===n?(this.pushToken({tokens:[35],pos:this.generatePos(e,n),value:n}),!0):!1}isCElse(e){let n="#else";return e.toLowerCase()===n?(this.pushToken({tokens:[36],pos:this.generatePos(e,n),value:n}),!0):!1}isCEndIf(e){let n="#endif";return e.toLowerCase()===n?(this.pushToken({tokens:[37],pos:this.generatePos(e,n),value:n}),!0):!1}isCTrue(e){let n="true";return e==n?(this.pushToken({tokens:[38],value:n,pos:this.generatePos(e,n)}),!0):!1}isCFalse(e){let n="false";return e==n?(this.pushToken({tokens:[39],value:n,pos:this.generatePos(e,n)}),!0):!1}generatePos(e,n){let r=this.columnNumber-e.length+this.lineNumberOfEscapedChars;return{line:this.lineNumber,col:r,len:n.length,colEnd:r+n.length}}};var ot=class extends j{constructor(e){super(e),this.semanticTokenType="keyword",this.semanticTokenModifiers="declaration"}};var Fg=require("fs"),xo=require("path");var HP=Y(Q());var zt=class extends ft{constructor(n,r){super(r);this.name=n;this.docSymbolsMeta={name:this.name.toString(),kind:HP.SymbolKind.Variable},this.semanticTokenType="macro",this.semanticTokenModifiers="declaration"}toString(){return this.name}};var Hd=class extends j{constructor(n,r){super(r);this.operator=n;this.semanticTokenType="operator",this.semanticTokenModifiers="declaration"}toString(){return this.operator}};var GP=Y(Q());var Gd=class extends ot{toString(){return"..."}},Os=class extends j{constructor(n,r){super();this.functionName=n;this.params=r;this.addChild(n),this.params.forEach(s=>this.addChild(s))}getDocumentSymbols(n){return le(this.uri,n)?[{name:this.functionName.name,kind:GP.SymbolKind.Function,range:te(this),selectionRange:te(this),children:this.params.flatMap(r=>r.getDocumentSymbols(n))}]:[]}toString(){return`${this.functionName}(${this.params.map(n=>n.toString()).join(",")})`}};var jg=Y(Q());var Mr=class extends ft{constructor(n,r,s){super(r);this.value=n;this.docSymbolsMeta={name:`param${s+1}`,kind:jg.SymbolKind.Variable},this.semanticTokenType="variable",this.semanticTokenModifiers="declaration"}toString(){return this.value}},Is=class extends ft{constructor(n,r){super();this.functionName=n;this.params=r;this.addChild(n),this.params.forEach(s=>this.addChild(s))}getDocumentSymbols(n){return le(this.uri,n)?[{name:this.functionName.name,kind:jg.SymbolKind.Function,range:te(this),selectionRange:te(this),children:this.params.flatMap(r=>r?.getDocumentSymbols(n)??[])}]:[]}toString(){return`${this.functionName.toString()}(${this.params.map(n=>n?.toString()??"<NULL>").join(",")})`}isTrue(n){return this.functionName.name==="defined"?!!(this.params.length===1&&this.params[0]&&n.has(this.params[0].value)):super.isTrue(n)}};var xs=class{constructor(){this.positionStack=[];this._issues=[];this.issueLengthPositionStack=[];this.moveEndOfLine=(e,n=!0)=>{let r=e.pos.line;if(this.currentToken?.pos.line!==r||!le(this.currentToken?.uri,e.uri))return;let s=this.currentToken,i=s;for(;this.currentToken?.pos.line===r;)i=this.moveToNextToken;if(n){let o=new j(G(s,i));this._issues.push(W(22,o))}return i};this.parsing=new Promise(e=>{setTimeout(()=>{this.parse().then(e)})})}reset(){this.issueLengthPositionStack=[],this.positionStack=[],this._issues=[]}get issues(){return this._issues}get stable(){return this.parsing}get done(){return this.peekIndex()>=this.tokens.length}get moveToNextToken(){let e=this.currentToken;if(e)return this.moveStackIndex(),e}enqueueToStack(){this.issueLengthPositionStack.push(this._issues.length),this.positionStack.push(this.peekIndex())}popStack(){let e=this.issueLengthPositionStack.pop()??0;e!==this._issues.length&&this._issues.splice(e),this.positionStack.pop()}mergeStack(){let e=this.issueLengthPositionStack.pop(),n=this.positionStack.pop();if(n===void 0||e===void 0)throw new Error("Index out of bounds");this.positionStack[this.positionStack.length-1]=n}peekIndex(e=1){let n=this.positionStack.at(-1*e);if(n===void 0)throw new Error("Index out of bounds");return n}get currentToken(){return this.tokens.at(this.peekIndex())}get prevToken(){let e=this.peekIndex()-1;if(e!==-1)return this.tokens[e]}moveStackIndex(){let e=this.positionStack.length-1;if(this.positionStack[e]===void 0)throw new Error("Index out of bounds");this.positionStack[e]!==this.tokens.length&&this.positionStack[e]++}checkConcurrentTokens(e){this.enqueueToStack();let n=[];return e.every(r=>{let s=this.currentToken,i=r(s),o=!1;return i!=="no"&&s&&(n.push(s),this.moveToNextToken,o=cn(s,this.currentToken)),i==="yes"&&o}),this.mergeStack(),n}consumeAnyConcurrentTokens(e){this.enqueueToStack();let n=[],r,s=!0;for(;e.some(i=>i(this.currentToken)==="yes"&&s);)n.push(this.currentToken),r=this.currentToken,this.moveToNextToken,s=cn(r,this.currentToken);return this.mergeStack(),n}getDocumentSymbols(e){return this.allAstItems.flatMap(n=>n.getDocumentSymbols(e))}getWorkspaceSymbols(){return this.allAstItems.flatMap(e=>e.getWorkspaceSymbols())}buildSemanticTokens(e,n){let r=[],s=(i,o,a)=>{if(!a?.start||!a?.end||!le(a.start.uri,n)||!le(a.end.uri,n))return;let c=a.end.pos.colEnd-a.start.pos.col;r.push({line:a.start.pos.line,char:a.start.pos.col,length:a.end===a.start?a.end.pos.len:c,tokenType:i,tokenModifiers:o})};this.allAstItems.forEach(i=>{i.buildSemanticTokens(s)}),r.sort((i,o)=>i.line===o.line?i.char-o.char:i.line-o.line).forEach(i=>e.push(i.line,i.char,i.length,i.tokenType,i.tokenModifiers))}processCIdentifier(e,n){this.enqueueToStack();let r=this.consumeAnyConcurrentTokens([19,47,48].map(Ie));if(!r.length){this.popStack();return}let s=r.map(o=>o.value).join("");if(!s.match(/^[_A-Za-z]/)){this.popStack();return}let i=new zt(s,G(r[0],r.at(-1)));return!n&&i.name!=="defined"&&(e.get(i.name)||this._issues.push(W(42,i))),this.mergeStack(),i}isOperator(){this.enqueueToStack();let e=this.moveToNextToken;if(!e){this.popStack();return}let n=e,r;if(q(e,40)?(r="&",q(this.currentToken,40)&&(r="&&",n=this.moveToNextToken)):q(e,10)?(r="!",q(this.currentToken,0)&&(r="!=",n=this.moveToNextToken)):q(e,8)?(r="|",q(this.currentToken,8)&&(r="||",n=this.moveToNextToken)):q(e,9)?r="^":q(e,4)?(r=">",q(this.currentToken,4)?(r="<<",n=this.moveToNextToken):q(this.currentToken,0)&&(r=">=",n=this.moveToNextToken)):q(e,5)?(r="<",q(this.currentToken,5)?(r=">>",n=this.moveToNextToken):q(this.currentToken,0)&&(r="<=",n=this.moveToNextToken)):q(e,15)?r="+":q(e,16)?r="-":q(e,17)?r="*":q(e,13)?r="/":q(e,18)?r="%":q(e,46)?q(this.currentToken,46)&&(r="##",n=this.moveToNextToken):q(e,0)&&q(this.currentToken,0)&&(r="==",n=this.moveToNextToken),r){let s=new Hd(r,G(e,n));return this.mergeStack(),s}this.popStack()}parseScopedBlock(e,n,r){this.enqueueToStack();let s=this.moveToNextToken;if(!s||!e(s)){this.popStack();return}let i=this.peekIndex(),o=()=>{this.positionStack[this.positionStack.length-1]=i},a=h=>h.flatMap(y=>"items"in y?a(y.items):y),c=[s],l=[];l[0]={rewind:o,tokens:[]};let u=this.currentToken;for(;u&&!n(u);){if(r?.(u)){let h=this.peekIndex()+1,y=()=>{this.positionStack[this.positionStack.length-1]=h};c.push(u),l[l.length]={rewind:y,tokens:[]}}else if(e(u)){let h=this.parseScopedBlock(e,n,r);h&&(c.push(h),l[l.length-1].tokens.push(...a(h.items))),u=this.currentToken;continue}else c.push(u),l[l.length-1].tokens.push(u);this.moveToNextToken,u=this.currentToken}let d=u;d&&n(d)&&(this.moveToNextToken,c.push(d));let f={startToken:s,items:c,splitTokens:l,endToken:d};return this.mergeStack(),f}isFunctionCall(e){this.enqueueToStack();let n=this.processCIdentifier(e,!1);if(!n){this.popStack();return}let r=this.processMacroCallParams();if(!r){this.popStack();return}if(n.name==="defined")r.length>1?this._issues.push(W(44,n)):r.length<1&&this._issues.push(W(45,n));else{let i=e.get(n.name)?.macro;i&&(i?.identifier instanceof Os?r.length>i.identifier.params.length?this._issues.push(W(44,n,void 0,[i])):r.length<i.identifier.params.length&&this._issues.push(W(45,n,void 0,[i])):this._issues.push(W(43,n)))}let s=new Is(n,r);return s.lastToken=this.prevToken,this.mergeStack(),s}processHex(){this.enqueueToStack();let e=this.checkConcurrentTokens([it("0"),it("x")]);if(e.length!==2){this.popStack();return}let n=this.consumeAnyConcurrentTokens([19,20].map(Ie));if(!n.length){this.popStack();return}let r=Number.parseInt(n.map(i=>i.value).join(""),16),s=new Ut(r,G(e[0],n.at(-1)));return this.mergeStack(),s}processDec(){this.enqueueToStack();let e=this.consumeAnyConcurrentTokens([19].map(Ie));if(!e.length){this.popStack();return}let n=Number.parseInt(e.map(s=>s.value).join(""),10),r=new Ut(n,G(e[0],e.at(-1)));return this.mergeStack(),r}processEnclosedExpression(e){this.enqueueToStack();let n,r,s;if(q(this.currentToken,42))return n=this.moveToNextToken,r=n,s=this.processExpression(e,!0),s&&(s=new bi(new bi(s,!0),!1)),q(this.currentToken,43)?r=this.moveToNextToken:this._issues.push(W(26,new j(G(n)))),this.mergeStack(),s;this.popStack()}processExpression(e,n=!1){this.enqueueToStack();let r;if(r=this.processEnclosedExpression(e)||this.isFunctionCall(e)||this.processCIdentifier(e,!1)||this.processHex()||this.processDec(),!r){this.popStack();return}if(n){let s=this.isOperator();for(;s;){let i=this.processExpression(e);i?r instanceof bi?r.addExpression(s,i):r=new bi(r,!1,{operator:s,expression:i}):this._issues.push(W(27,s)),s=this.isOperator()}}return this.mergeStack(),r}processMacroCallParams(){if(!q(this.currentToken,42))return;let e=this.parseScopedBlock(r=>!!q(r,42),r=>!!q(r,43),r=>!!q(r,24));return e?.items.length===2&&q(e.endToken,43)?[]:e?.splitTokens.map((r,s)=>r.tokens.length===0?null:new Mr(r.tokens.map((i,o)=>{let a=i.value;return i.pos.line===r.tokens.at(o+1)?.pos.line&&(a=a.padEnd(r.tokens[o+1].pos.col-i.pos.col," ")),a}).join(""),G(r.tokens[0],r.tokens.at(-1)),s))}};var Kd=class t extends xs{constructor(n){super();this.uri=n;this.comments=[];this.tokens=[]}cleanUpComments(){let n=[];for(let r=0;r<this.tokens.length;r++){let s=t.processBlockComments(this.tokens,r)||t.processLineComments(this.tokens,r);s&&(r=s.index,n.push(...s.tokenUsed),this.comments.push(...s.comments))}n.reverse().forEach(r=>this.tokens.splice(r,1))}get allAstItems(){return this.comments}reset(){super.reset(),this.comments=[]}reparse(){return this.reset(),this.parse()}async parse(){this.tokens=pr().requestTokens(this.uri,!0),this.cleanUpComments()}static processBlockComments(n,r){let s=[],i=()=>(s.push(r++),n[r]),o=()=>n[r],a=()=>n[r-1],c=o(),l=c;if(!c||!q(c,13)||(l=i(),!q(l,17)||c.pos.line!==l.pos.line||c.pos.col+1!==l.pos.col))return;let u=()=>!(!q(a(),17)||!q(o(),13)||!cn(a(),o())),d=l.pos.line,f=c,h=[];l=i();do{if(o()?.pos.line!==d){let m=new xr(G(f,a()));h.push(m),d=o().pos.line??0,f=o()}l=i()}while(r<n.length&&!u());let y=new xr(G(f,o()));return h.push(y),i(),{comments:h,tokenUsed:s,index:r-1}}static processLineComments(n,r){let s=[];if(!q(n[r],13)||n.length===r+1||!q(n[r+1],13)||!cn(n[r],n[r+1]))return;let i=[];for(;n[r].pos.line===n.at(r+1)?.pos.line;)s.push(r++);s.push(r++);let o=n[s.at(-1)],a=new xr(G(n[s[0]],n[s.at(-1)]));return i.push(a),{comments:i,tokenUsed:s,index:r-1}}};var KP=Y(Q()),Yd=class extends j{constructor(n,r){super(n);this.content=r}toString(){let n=this.content.filter(r=>!q(r,14));return n.map((r,s)=>{let i=r.value;return r.pos.line===n.at(s+1)?.pos.line?i=i.padEnd(n[s+1].pos.col-r.pos.col," "):n.at(s+1)&&(i=i.padEnd(i.length+1," ")),i}).join("")}},Ja=class extends j{constructor(n,r,s){super();this.keyword=n;this.identifier=r;this.content=s;this.addChild(n),this.addChild(this.identifier),this.content&&this.addChild(this.content)}get name(){return this.identifier instanceof zt?this.identifier.name:this.identifier.functionName.name}toString(){return this.toStringCache??=[this.identifier.toString(),...this.content?[this.content?.toString()]:[]].join(" "),this.toStringCache}toMarkupContent(){return{kind:KP.MarkupKind.Markdown,value:["```cpp",`#define ${this.toString()}`,"```"].join(`
277
+ `)}}};var Si=class extends j{constructor(e){super(e)}},Qa=class extends j{constructor(n,r){super();this.keyword=n;this.content=r;this.active=!1;this.addChild(n)}},Za=class extends Qa{constructor(n,r,s){super(n,s);this.identifier=r;this.addChild(r),this.addChild(s)}useBlock(n){return this.identifier&&n.has(this.identifier.name)}},Xd=class extends Qa{constructor(n,r,s){super(n,s);this.expression=r;this.addChild(r),this.addChild(s)}useBlock(n){return this.expression instanceof Is?this.expression.functionName.name==="defined"?this.expression&&n.has(this.expression.params.at(0)?.value??""):this.expression.isTrue(n):this.expression?.isTrue(n)}},Jd=class extends Za{useBlock(e){return this.identifier&&!e.has(this.identifier.name)}},ec=class extends Qa{};var Io=class extends j{constructor(n,r,s){super();this.ifDef=n;this.endIf=r;this.elseOption=s;this.addChild(n),s&&this.addChild(s),this.addChild(r)}getInValidTokenRange(n,r){let s=[],i=a=>r.findIndex(c=>c===a);if(!this.ifDef.identifier)return[{start:i(this.tokenIndexes.start),end:i(this.tokenIndexes.end)}];s.push({start:i(this.ifDef.tokenIndexes.start),end:i(this.ifDef.identifier.tokenIndexes.end)});let o=this.ifDef.useBlock(n);return o?this.ifDef.active=!0:this.elseOption&&(this.elseOption.active=!0),!o&&this.ifDef.content&&s.push({start:i(this.ifDef.content.tokenIndexes.start),end:i(this.ifDef.content.tokenIndexes.end)}),this.elseOption&&(s.push({start:i(this.elseOption.tokenIndexes.start),end:i(this.elseOption.keyword.tokenIndexes.end)}),o&&this.elseOption.content&&s.push({start:i(this.elseOption.content.tokenIndexes.start),end:i(this.elseOption.content.tokenIndexes.end)})),this.endIf&&s.push({start:i(this.endIf.tokenIndexes.start),end:i(this.endIf.tokenIndexes.end)}),s}},Ms=class extends j{constructor(n,r,s){super();this.ifBlocks=n;this.endIf=r;this.elseOption=s;n.forEach(i=>this.addChild(i)),s&&this.addChild(s),this.addChild(r)}getInValidTokenRange(n,r){let s=[],i=a=>r.findIndex(c=>c===a),o=!1;return this.ifBlocks.forEach((a,c)=>{s.push({start:i(a.tokenIndexes.start),end:i(a.expression?.tokenIndexes.end??a.keyword.tokenIndexes.end)}),!o&&a.useBlock(n)?(a.active=!0,o=!0):a.content&&s.push({start:i(a.content.tokenIndexes.start),end:i(a.content.tokenIndexes.end)})}),this.elseOption&&(s.push({start:i(this.elseOption.keyword.tokenIndexes.start),end:i(this.elseOption.keyword.tokenIndexes.end)}),o&&this.elseOption.content?s.push({start:i(this.elseOption.content.tokenIndexes.start),end:i(this.elseOption.content.tokenIndexes.end)}):this.elseOption.active=!0),this.endIf&&s.push({start:i(this.endIf.tokenIndexes.start),end:i(this.endIf.tokenIndexes.end)}),s}};var tc=Y(Q());var Mo=class extends xs{constructor(n,r,s){super();this.uri=n;this.incudes=r;this.tokens=[];this.nodes=[];this.dtsIncludes=[];this.macroSnapShot=new Map;this.macros=new Map;this.macroStart=!1;s&&(Array.from(s).forEach(([i,o])=>this.macroSnapShot.set(i,o)),Array.from(s).forEach(([i,o])=>this.macros.set(i,o)))}get currentToken(){let n=this.prevToken,r=Ir(n,this.tokens.at(this.peekIndex()))||!n||q(n,14)&&n.pos.line+1===this.tokens.at(this.peekIndex())?.pos.line;if(!(this.macroStart&&!r))return this.macroStart&&q(this.tokens.at(this.peekIndex()),14)?(this.moveStackIndex(),this.currentToken):this.tokens.at(this.peekIndex())}reset(n){super.reset(),this.macros.clear(),n?(this.macroSnapShot.clear(),Array.from(n).forEach(([r,s])=>this.macroSnapShot.set(r,s)),Array.from(n).forEach(([r,s])=>this.macros.set(r,s))):Array.from(this.macroSnapShot).forEach(([r,s])=>this.macros.set(r,s)),this.nodes=[],this.dtsIncludes=[]}async reparse(n){let r=this.stable;return this.parsing=new Promise(s=>{r.then(()=>{if(n&&n.size===this.macroSnapShot.size){let i=Array.from(n);if(Array.from(this.macroSnapShot).every(([o,a],c)=>{let[l,u]=i[c];return l===o&&u.macro.toString()===a.macro.toString()})){console.log("header file cache hit",this.uri),s();return}}this.reset(n),this.parse().then(s)})}),this.parsing}async parse(){let n=new Kd(this.uri);if(await n.stable,this.tokens=n.tokens,this.nodes.push(...n.allAstItems),this.positionStack.push(0),this.tokens.length!==0){for(;!this.done;)await this.lineProcessor();if(this.positionStack.length!==1)throw new Error("Incorrect final stack size")}}async lineProcessor(){if(this.enqueueToStack(),!(!this.prevToken||this.prevToken.pos.line!==this.currentToken?.pos.line||!le(this.prevToken.uri,this.currentToken.uri))){this.moveEndOfLine(this.prevToken,!1),this.mergeStack();return}let r=this.currentToken,s=await this.processInclude()||this.processDefinitions()||this.processUndef()||this.processIfDefBlocks();r&&this.moveEndOfLine(r,!!s),this.mergeStack()}processDefinitions(){this.enqueueToStack();let n=this.peekIndex(),r=this.moveToNextToken;if(!r||!q(r,25))return this.popStack(),!1;this.macroStart=!0;let s=new ot(G(r)),i=this.isFunctionDefinition()||this.processCIdentifier(this.macros,!0);if(!i)return this._issues.push(W(30,s)),this.mergeStack(),this.macroStart=!1,!0;let o=this.consumeDefinitionContent(),a;o.length&&(a=new Yd(G(o[0],o.at(-1)),o));let c=new Ja(s,i,a);this.macros.set(c.name,{macro:c,resolver:Vk(c.toString())}),this.nodes.push(c);let l=this.peekIndex();return this.tokens.splice(n,l-n),this.positionStack[this.positionStack.length-1]=n,this.mergeStack(),this.macroStart=!1,!0}processUndef(){this.enqueueToStack();let n=this.peekIndex(),r=this.moveToNextToken;if(!r||!q(r,28))return this.popStack(),!1;this.macroStart=!0;let s=new ot(G(r)),i=this.processCIdentifier(this.macros,!0);if(!i)return this._issues.push(W(30,s)),this.mergeStack(),this.macroStart=!1,!0;let o=new Ja(s,i);this.macros.delete(i.name),this.nodes.push(o);let a=this.peekIndex();return this.tokens.splice(n,a-n),this.positionStack[this.positionStack.length-1]=n,this.mergeStack(),this.macroStart=!1,!0}consumeDefinitionContent(){let n=[];for(;this.currentToken;){let r=this.moveToNextToken;r&&n.push(r)}return n}isFunctionDefinition(){this.enqueueToStack();let n=this.processCIdentifier(this.macros,!0);if(!n){this.popStack();return}let r=this.moveToNextToken;if(!q(r,42)||!cn(n.lastToken,r)){this.popStack();return}let s=[],i=this.processCIdentifier(this.macros,!0)||this.processVariadic();for(;i;)s.push(i),!q(this.currentToken,24)&&!q(this.currentToken,43)?this._issues.push(W(28,i)):q(this.currentToken,43)||(r=this.moveToNextToken),i=this.processCIdentifier(this.macros,!0)||this.processVariadic();let o=new Os(n,s);return q(this.currentToken,43)?(r=this.moveToNextToken,o.lastToken=r):(o.lastToken=this.prevToken,this._issues.push(W(26,s.at(-1)??o))),this.mergeStack(),o}processVariadic(){this.enqueueToStack();let n=this.checkConcurrentTokens([Ie(45),Ie(45),Ie(45)]);if(n.length!==3){this.popStack();return}let r=new Gd(G(n[0],n.at(-1)));return this.mergeStack(),r}processIfDefBlocks(){let n=this.peekIndex(),r=this.parseScopedBlock(o=>!!o&&[33,34,32].some(a=>q(o,a))&&!Ir(o.prevToken,o),o=>!!o&&[37].some(a=>q(o,a))&&!Ir(o.prevToken,o),o=>!!o&&[36,35].some(a=>q(o,a))&&!Ir(o.prevToken,o));if(!r)return;let s;q(r.startToken,32)?s=this.processIfBlock(r,(o,a,c)=>new Xd(o,a??null,c)):s=this.processIfDefBlock(r,(o,a,c)=>q(r.startToken,33)?new Za(o,a??null,c):new Jd(o,a??null,c)),this.nodes.push(s),s.getInValidTokenRange(this.macros,this.tokens).reverse().forEach(o=>{this.tokens.splice(o.start,o.end-o.start+1)}),[...s instanceof Ms?s.ifBlocks:[s.ifDef],...s.elseOption?[s.elseOption]:[]].forEach(o=>{!o.active&&o.content&&this._issues.push(W(47,o.content,tc.DiagnosticSeverity.Hint,[],[tc.DiagnosticTag.Unnecessary]))}),this.positionStack[this.positionStack.length-1]=n}processIfDefBlock(n,r){this.enqueueToStack(),this.macroStart=!0;let s=new ot(G(n.startToken));n.splitTokens[0].rewind();let i=this.processCIdentifier(this.macros,!0);i||this._issues.push(W(31,s)),this.macroStart=!1;let o,a=i?.lastToken.nextToken??s.lastToken.nextToken;a&&n.splitTokens[0].tokens.find(f=>f===a)&&(o=new Si(G(a,n.splitTokens[0].tokens.at(-1))));let c=r(s,i??null,o??null),l;if(n.splitTokens.length>1){let f=n.splitTokens[1].tokens[0].prevToken,h=new ot(G(f)),y;n.splitTokens[1].tokens.length&&(y=new Si(G(n.splitTokens[1].tokens[0],n.splitTokens[1].tokens.at(-1)))),l=new ec(h,y??null)}let u;n.endToken?u=new ot(G(n.endToken)):this._issues.push(W(46,s));let d=new Io(c,u??null,l);return this.mergeStack(),d}processIfBlock(n,r){this.enqueueToStack();let s=new ot(G(n.startToken)),i=[],o;n.splitTokens.forEach((l,u)=>{l.rewind();let d=this.prevToken,f=new ot(G(d));this.macroStart=!0;let h=this.processExpression(this.macros,!0)||this.processCIdentifier(this.macros,!0);if(this.macroStart=!1,u===n.splitTokens.length-1&&q(d,36)){let m=d,_=new ot(G(m)),E;l.tokens.length&&(E=new Si(G(l.tokens[0],l.tokens.at(-1)))),o=new ec(_,E??null)}else{h||this._issues.push(W(31,s));let m,_=h?.lastToken.nextToken??s.lastToken.nextToken;_&&l.tokens.find(T=>T===_)&&(m=new Si(G(_,n.splitTokens[u].tokens.at(-1))));let E=r(f,h??null,m??null);i.push(E)}});let a;n.endToken?a=new ot(G(n.endToken)):this._issues.push(W(46,s));let c=new Ms(i,a??null,o);return this.mergeStack(),c}get allAstItems(){return[...this.dtsIncludes,...this.nodes]}resolveInclude(n){if(n.path.path)return n.path.relative?[(0,xo.resolve)((0,xo.dirname)(n.uri),n.path.path),...this.incudes.map(r=>(0,xo.resolve)(r,n.path.path))].find(r=>(0,Fg.existsSync)(r)):this.incudes.map(r=>(0,xo.resolve)(r,n.path.path)).find(r=>(0,Fg.existsSync)(r))}async processInclude(){this.enqueueToStack();let n=this.peekIndex(),r=this.currentToken;if(!r)return this.popStack(),!1;let s=r,i=r;if(q(r,26))this.moveToNextToken;else{let m=this.checkConcurrentTokens([Ie(13),it("include"),Ie(13)]);if(m.length!==3)return this.popStack(),!1;s=m[0],i=m.at(-1)}let o=s,a=new ot(G(s,i));r=this.moveToNextToken;let c=r,l=!!q(r,21);if(!c||!l&&!q(r,5))return o&&this.moveEndOfLine(o),this.mergeStack(),!0;let u="";if(l)u=r?.value??"";else for(;this.currentToken?.pos.line===o.pos.line&&!q(this.currentToken,4);)u+=this.currentToken?.value??"",r=this.moveToNextToken;let d=new wo(u,l,G(c,r)),f=new Ns(a,d);this.dtsIncludes.push(f),l||(this.currentToken?.pos.line!==o.pos.line||!q(this.currentToken,4)?this._issues.push(W(12,f)):(r=this.moveToNextToken,d.lastToken=r)),this.mergeStack();let h=this.peekIndex(),y=this.resolveInclude(f);if(f.resolvedPath=y,y||this._issues.push(W(36,f.path,tc.DiagnosticSeverity.Warning)),y){pr().requestTokens(y,!0);let m=await nc().getCPreprocessorParser(y,this.incudes,this.macros,this.uri);await m.stable,this._issues.push(...m.issues),this.macros.clear(),Array.from(m.macros).forEach(([_,E])=>this.macros.set(_,E)),y.endsWith(".h")?this.tokens.splice(n,h-n):this.tokens.splice(n,h-n,...m.tokens),this.nodes.push(...m.nodes),this.dtsIncludes.push(...m.dtsIncludes)}else this.tokens.splice(n,h-n);return this.positionStack[this.positionStack.length-1]=n,!0}};var YP,Bg=class{constructor(){this.headerFiles=new Map;this.includeOwners=new WeakMap}getCPreprocessorParser(e,n,r,s){e=Ze(e);let i=`${Array.from(r).map(l=>l[1].macro.toString()).join("::")}`,o=this.headerFiles.get(e)?.get(i);if(o)return o.reparse(r),o;console.log("No cpreprocess cache",e);let a=new Mo(e,n,r),c=this.includeOwners.get(a)??new Set;return c.add(s),this.includeOwners.set(a,c),this.headerFiles.has(e)||this.headerFiles.set(e,new Map),this.headerFiles.get(e)?.set(i,a),a}reset(e){e=Ze(e);let n=this.headerFiles.get(e);n&&Array.from(n).forEach(r=>{r[1]&&(console.log("disposing cpreprocessor cache for",e),Array.from(this.includeOwners.get(r[1])??[]).forEach(this.reset.bind(this)),this.headerFiles.delete(e))})}};function nc(){return YP??=new Bg,YP}var XP,Ug=class t{constructor(){this.fileMap=new Map}static clone(e){let n=e.map(r=>({...r}));return n.forEach((r,s)=>{r.prevToken=n[s-1],r.nextToken=n[s+1]}),n}needsRenew(e,n){return e=Ze(e),this.fileMap.get(e)?.text!==n}renewLexer(e,n){if(e=Ze(e),nc().reset(e),!e||!(0,Qd.existsSync)(e))return[];try{n??=(0,Qd.readFileSync)(e).toString();let r=new Wd(n,e);return this.fileMap.set(e,r),t.clone(r.tokens)}catch{}return[]}requestTokens(e,n){e=Ze(e);let r=this.fileMap.get(e)?.tokens;return!r&&n?[...this.renewLexer(e)]:t.clone(r??[])}reset(e){e=Ze(e),nc().reset(e),this.fileMap.delete(e)}};function pr(){return XP??=new Ug,XP}var Lo=class t{constructor(e){this.context=e;this.comments=[];this.includes=[];this.roots=[];this.references=[];this.unlinkedDeletes=[];this.unlinkedRefNodes=[];this.globalDeletes=[];this.rootNode=new we(this.context.bindingLoader,"/");this.labelsUsedCache=new Map;this.fileTopMostAstCache=new Map}fileTopMostAsts(e){let n=this.fileTopMostAstCache.get(e);if(n)return n;let r=[...this.roots,...this.references,...this.unlinkedDeletes,...this.unlinkedRefNodes,...this.globalDeletes,...this.context.parser.cPreprocessorParser.allAstItems,...this.context.overlayParsers.flatMap(s=>s.cPreprocessorParser.allAstItems)].flatMap(s=>s.getTopMostAstNodeForFile(e));return this.fileTopMostAstCache.set(e,r),r}getDeepestAstNode(e,n){let s=this.fileTopMostAsts(e).find(i=>xn(i,e,n)||Bk(pr().requestTokens(e,!1),i,n));if(s instanceof $t){let o=this.rootNode.getReferenceBy(s)?.getDeepestAstNode(e,n);return o?{...o,runtime:this}:{item:null,runtime:this,ast:Or(s,e,n)}}else if(s instanceof vt&&s.path){let i=this.rootNode.getDeepestAstNode(e,n);return i?{...i,runtime:this}:void 0}else if(s instanceof Ae&&s.path){let i=t.getNodeFromPath(s.path.slice(1),this.rootNode)?.getDeepestAstNode(e,n);return i?{...i,runtime:this}:void 0}else if(s)return{runtime:this,item:null,ast:Or(s,e,n)}}static getNodeFromPath(e,n,r=!0){if(e.length===0)return n;let s=e[0].split("@"),i=s[0],a=s.at(1)?.split(",").map(u=>Number.parseInt(u,16)),c=e.slice(1),l=n.getNode(i,a,r);return l?t.getNodeFromPath(c,l,r):void 0}resolvePath(e,n){if(!e.at(0)?.startsWith("&"))return e;let r=this.labelsUsedCache.get(e[0].slice(1));return r||(n??=this.rootNode.allDescendantsLabels,n.find(i=>i.label.value===e.at(0)?.slice(1)&&i.parentNode instanceof ze)?.lastLinkedTo?.path)}get issues(){return[...this.labelIssues(),...this.rootNode.issues]}labelIssues(){let e=[],n=new Map;return this.rootNode.allDescendantsLabelsMapped.forEach(r=>{n.has(r.label.label.value)?n.get(r.label.label.value)?.push(r):n.set(r.label.label.value,[r])}),Array.from(n).forEach(r=>{let s=r[1];if(s.length>1){let i=s.find(a=>a.owner instanceof we);(!s.every(a=>a&&a.owner===i?.owner)||!i)&&e.push(Lt(4,s.at(0).label,JP.DiagnosticSeverity.Error,s.slice(1).map(a=>a.label),[],[s.at(0).label.label.value]))}}),e}get typesIssues(){let e=n=>[...n.nodeType?.getIssue(this,n)??[],...n.nodes.flatMap(r=>e(r))];return this.typesIssuesCache??=e(this.rootNode),this.typesIssuesCache}getOrderedNodeAst(e){return Uk([...e.definitions,...e.referencedBy],this.context)}};var QP=Y(Q()),Zd=class extends j{constructor(n){super();this.values=n;this.docSymbolsMeta={name:"Values",kind:QP.SymbolKind.String},this.values.forEach(r=>this.addChild(r))}toString(){return this.values.map(n=>n?.toString()).join(",")}toJson(){return this.values.length===1?this.values[0]?.toJson():this.values.map(n=>n?.toJson())}};var ZP=Y(Q()),ef=class extends j{constructor(n){super();this.keyword=n;this.addChild(n),this.docSymbolsMeta={name:"DTS Document version",kind:ZP.SymbolKind.Function}}};var Lr=class extends j{constructor(n,r){super();this.value=n;this.labels=r;this.labels.forEach(s=>{this.addChild(s)}),this.addChild(this.value)}toString(n){return`${this.labels.map(r=>r.toString()).join(" ")}${this.value?.toString(n)??"NULL"}`}toPrettyString(n){return`${this.labels.map(r=>r.toString()).join(" ")}${this.value?.toPrettyString(n)??"NULL"}`}};var eR=Y(Q()),tf=class extends j{constructor(n,r,s){super();this.keyword=n;this.startAddress=r;this.endAddress=s;this.addChild(n),this.docSymbolsMeta={name:"Memreserve",kind:eR.SymbolKind.Function},this.addChild(r),this.addChild(s)}toString(){return`/memreserve/ 0x${this.startAddress?.value?.toString(16)} 0x${this.endAddress?.value?.toString(16)}`}};var tR=Y(Q()),nf=class extends j{constructor(n,r){super();this.keyword=n;this.bitsSize=r;this.addChild(n),this.docSymbolsMeta={name:"bits",kind:tR.SymbolKind.Function},this.addChild(r)}toString(){return`/bits/ ${this.bitsSize?.value?.toString()}`}};var nR=Y(Q()),rc=class extends xs{constructor(n,r,s){super();this.uri=n;this.incudes=r;this.tokens=[];this.others=[];this.rootDocument=new ze;this.unhandledStatements=new vt;this.cPreprocessorParser=new Mo(this.uri,this.incudes,s)}get issues(){return[...this._issues,...this.cPreprocessorParser.issues]}getFiles(){return[this.uri,...this.cPreprocessorParser.dtsIncludes.flatMap(n=>n.resolvedPath).filter(n=>!!n)]}reset(){super.reset(),this.others=[],this.rootDocument=new ze,this._issues=[],this.unhandledStatements=new vt}async reparse(){let n=performance.now(),r=this.stable;return this.parsing=new Promise(s=>{r.then(async()=>{this.reset(),await this.cPreprocessorParser.reparse(),await this.parse(),console.log("parsing",performance.now()-n),s()})}),this.parsing}async parse(){let n=performance.now();if(await this.cPreprocessorParser.stable,this.tokens=this.cPreprocessorParser.tokens,Ze(this.uri).endsWith(".h")||(this.positionStack.push(0),this.tokens.length===0))return;let r=async()=>{if(!(this.isDtsDocumentVersion()||this.isMemreserve()||this.isRootNodeDefinition(this.rootDocument)||this.isDeleteNode(this.rootDocument,"Ref")||this.isChildNode(this.rootDocument,"Ref")||this.isProperty(this.unhandledStatements)||this.isDeleteProperty(this.unhandledStatements))){let s=this.moveToNextToken;if(s){let i=new j(G(s));this._issues.push(W(22,i)),this.reportExtraEndStatements()}}};for(;!this.done;)await r();if(this.unhandledStatements.properties.forEach(s=>{this._issues.push(W(32,s))}),this.unhandledStatements.deleteProperties.forEach(s=>{this._issues.push(W(33,s))}),this.positionStack.length!==1)throw new Error("Incorrect final stack size")}isRootNodeDefinition(n){this.enqueueToStack();let r=this.moveToNextToken,s=r,i=13;if(!r||!q(r,i))return this.popStack(),!1;if(s=this.moveToNextToken,i=2,!s||!q(s,i))return this.popStack(),!1;let o=new vt;o.openScope=s,n.addNodeChild(o),this.processNode(o,"Name");let a=this.nodeEnd(o)??s;return o.firstToken=r,o.lastToken=a,this.mergeStack(),!0}nodeEnd(n){let r=this.currentToken;if(q(r,3))this.moveToNextToken;else{let s=this.prevToken;if(s){let i=new j(G(s));this._issues.push(W(3,i))}return this.endStatement(!1)}return this.prevToken?.value==="}"&&(n.closeScope=this.prevToken),this.endStatement()}isNodeEnd(){return q(this.currentToken,3)||q(this.currentToken,1)}endStatement(n=!0){let r=this.currentToken;if(!q(r,1)){let s=this.prevToken;if(s&&n){let i=new j(G(this.prevToken));return this._issues.push(W(1,i)),s}}return this.moveToNextToken,this.reportExtraEndStatements(),r}reportExtraEndStatements(){for(;q(this.currentToken,1);){let n=this.moveToNextToken;if(n){let r=new j(G(n));this._issues.push(W(23,r))}}}processNode(n,r){if(this.done)return!1;let s=!1,i=!1;do{if(i=this.isChildNode(n,r)||this.isProperty(n)||this.isDeleteNode(n,r)||this.isDeleteProperty(n),!i&&!this.isNodeEnd()&&!this.done){let o=this.moveToNextToken;if(o){let a=new j(G(o));this._issues.push(W(22,a)),this.reportExtraEndStatements()}}else if(this.done)break;s=s||i}while(!this.isNodeEnd());return s}processOptionalLabelAssign(n=!1){let r=[],s=this.isLabelAssign(n);for(;s;)r.push(s),s=this.isLabelAssign(n);return r}isChildNode(n,r){this.enqueueToStack();let s;r==="Name"&&(s=this.isOmitIfNoRefNode());let i=this.processOptionalLabelAssign(),o,a,c=r==="Ref"?new $t(i):new Ae(i,s);if(r==="Ref"?a=this.isLabelRef():r==="Name"&&(o=this.isNodeName()),!a&&!o){if(!q(this.currentToken,2))return this.popStack(),!1;c.firstToken=this.currentToken,this._issues.push(W(r==="Name"?[7]:[10,11],c))}let l=!1;if(a&&c instanceof $t?(c.labelReference=a,l=!0):o&&c instanceof Ae&&(l=o.address!==void 0,c.name=o),q(this.currentToken,2)){this.moveToNextToken,c.openScope=this.prevToken;let u=!1;do u=this.processNode(c,"Name");while(u);let d=this.nodeEnd(c);c.lastToken=d}else if(l){let u=a??o;u&&this._issues.push(W(2,u))}else return this.popStack(),!1;return n.addNodeChild(c),this.mergeStack(),!0}processNodeAddress(){let n=this.prevToken,r=this.consumeAnyConcurrentTokens([19,20].map(Ie)),s=a=>{a=a.replace(/^0x/,"").replace(/\s+/g,""),a.length%8!==0&&(a=a.padStart(Math.ceil(a.length/8)*8,"0"));let c=[];for(let l=0;l<a.length;l+=8){let u=a.slice(l,l+8);c.push(parseInt(u,16)>>>0)}return c},i=r.length?s(r.map(a=>a.value).join("")):[NaN];if(n){if(i.some(a=>Number.isNaN(a))){let a=new j(G(n));this._issues.push(W(8,a))}else if(!Number.isNaN(i)&&!cn(n,r[0])){let a=new j(G(n,r.at(0)));this._issues.push(W(29,a))}}return new xd(i,G(r[0]??this.prevToken,r.at(-1)))}processNodeAddresses(n){this.enqueueToStack();let r=this.checkConcurrentTokens([Ie(49)]);if(r.length){if(!cn(n.lastToken,r[0])){let o=new j(G(n.lastToken,r[0]));this._issues.push(W(29,o))}let s=[],i=()=>{if(s.push(this.processNodeAddress()),q(this.currentToken,24)){if(this.prevToken&&!cn(this.prevToken,this.currentToken)){let o=new j(G(this.prevToken,this.currentToken));this._issues.push(W(29,o))}this.moveToNextToken,i()}};return i(),this.mergeStack(),s}this.popStack()}isNodeName(){this.enqueueToStack();let n=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16].map(Ie));if(!n.length){this.popStack();return}let r=n.map(o=>o.value).join("");if(!r.match(/^[A-Za-z]/)){this.popStack();return}let s=new qe(r,G(n[0],n.at(-1))),i=this.processNodeAddresses(s);return s.address=i,this.mergeStack(),s}isPropertyName(){this.enqueueToStack();let n=this.consumeAnyConcurrentTokens([19,47,24,45,48,15,16,44,46].map(Ie));if(!n.length){this.popStack();return}let r=new Ve(n.map(s=>s.value).join(""),G(n[0],n.at(-1)));return this.mergeStack(),r}isLabelName(){this.enqueueToStack();let n=this.consumeAnyConcurrentTokens([19,47,48].map(Ie));if(!n.length){this.popStack();return}let r=n.map(i=>i.value).join("");if(!r.match(/^[A-Za-z]/)){this.popStack();return}let s=new Vt(r,G(n[0],n.at(-1)));return this.mergeStack(),s}isLabelAssign(n){this.enqueueToStack();let r=this.consumeAnyConcurrentTokens([19,47,48].map(Ie));if(!r.length){this.popStack();return}let s=r.map(c=>c.value).join("");if(!s.match(/^[A-Za-z]/)){this.popStack();return}let i=this.currentToken,o=i&&q(i,50),a=new As(new Vt(s,G(r[0],r.at(-1))),G(r[0],o?i:r.at(-1)));if(o){let c=r.at(-1);c&&(i.pos.line!==a.firstToken.pos.line||i.pos.col!==c.pos.colEnd)&&this._issues.push(W(29,new j(G(c,i)))),this.moveToNextToken}else if(n)this._issues.push(W(24,a));else{this.popStack();return}return this.mergeStack(),a}isProperty(n){this.enqueueToStack();let r=this.processOptionalLabelAssign(),s=this.isPropertyName();if(!s)return this.popStack(),!1;if(q(this.currentToken,2)||q(this.currentToken,49))return this.popStack(),!1;let i=new $e(s,r),o;q(this.currentToken,0)?(i.assignOperatorToken=this.currentToken,this.moveToNextToken,o=this.processValue(i),o?.values.filter(c=>!!c).length||this._issues.push(W(0,i)),i.values=o??null):i.values=void 0;let a=this.endStatement();return i.lastToken=a,n.addNodeChild(i),this.mergeStack(),!0}isDtsDocumentVersion(){this.enqueueToStack();let n=this.checkConcurrentTokens([Ie(13),it("d"),it("ts"),Ie(16),it("v"),it("1")]);if(n.length!==6)return this.popStack(),!1;let r=n[0],s=r,i=new ot;i.firstToken=r;let o=new ef(i);if(this.others.push(o),q(this.currentToken,13))s=this.moveToNextToken;else return i.lastToken=n.at(-1),this._issues.push(W(21,o)),this.mergeStack(),!0;return i.lastToken=s,o.lastToken=this.endStatement(),this.mergeStack(),!0}isMemreserve(){this.enqueueToStack();let n=this.checkConcurrentTokens([Ie(13),it("memreserve")]);if(n.length!==2)return this.popStack(),!1;let r=new ot;r.firstToken=n[0];let i=n[0];q(this.currentToken,13)?(i=this.moveToNextToken,r.lastToken=i):(r.lastToken=n.at(-1),this._issues.push(W(21,r)));let o=this.processHex()||this.processDec(),a=o&&(this.processHex()||this.processDec()),c=new tf(r,o,a);return this.others.push(c),o||this._issues.push(W(37,r)),a||this._issues.push(W(38,o??r)),c.lastToken=this.endStatement(),this.mergeStack(),!0}processBits(){this.enqueueToStack();let n=this.checkConcurrentTokens([Ie(13),it("b"),it("its")]);if(n.length!==3){this.popStack();return}let r=new ot;r.firstToken=n[0];let i=n[0];q(this.currentToken,13)?(i=this.moveToNextToken,r.lastToken=i):(r.lastToken=n.at(-1),this._issues.push(W(21,r)));let o=this.processDec(),a=new nf(r,o);return this.others.push(a),o?o.value!==8&&o.value!==16&&o.value!==32&&o.value!==64&&this._issues.push(W(40,o)):this._issues.push(W(39,r)),this._issues.push(W(41,a,nR.DiagnosticSeverity.Warning)),this.mergeStack(),a}isOmitIfNoRefNode(){this.enqueueToStack();let n=this.checkConcurrentTokens([Ie(13),it("omit"),Ie(16),it("if"),Ie(16),it("no"),Ie(16),it("ref"),Ie(13)]);if(n.length!==9){this.popStack();return}let r=new ot(G(n[0],n.at(-1)));return this.mergeStack(),r}isDeleteNode(n,r){this.enqueueToStack();let s=this.checkConcurrentTokens([Ie(13),it("d"),it("e"),it("lete"),Ie(16),it("node")]);if(!s.length)return this.popStack(),!1;let i=s[0],o=i,a=new ot;if(a.firstToken=i,s.length===1&&!q(this.currentToken,2)){this._issues.push(W(25,a)),a.lastToken=s.at(-1);let d=new _n(a);return n.addNodeChild(d),this.mergeStack(),!0}let c=s.map(d=>d.value??"").join("");if(!"/delete-node/".startsWith(c)||c.endsWith("-"))return this.popStack(),!1;a.lastToken=s.at(-1),c!=="/delete-node"?this._issues.push(W(c.startsWith("/delete-n")?34:25,a)):q(this.currentToken,13)?(o=this.moveToNextToken,a.lastToken=o):this._issues.push(W(21,a));let l=new _n(a);if(Ir(a.tokenIndexes?.end,i)){let d=this.processNodePathRef();d&&r==="Name"&&this._issues.push(W(7,d));let f=d?void 0:this.isLabelRef();f&&r==="Name"&&this._issues.push(W(7,f));let h=d||f?void 0:this.isNodeName();h&&r==="Ref"&&this._issues.push(W(10,h)),!d&&!h&&!f&&this._issues.push(W([7,10],l)),l.nodeNameOrRef=d??f??h??null}else r==="Name"?this._issues.push(W(7,a)):r==="Ref"&&this._issues.push(W(10,a));let u=this.endStatement();return l.lastToken=u,n.addNodeChild(l),this.mergeStack(),!0}isDeleteProperty(n){this.enqueueToStack();let r=this.checkConcurrentTokens([Ie(13),it("d"),it("e"),it("lete"),Ie(16),it("property")]);if(!r.length)return this.popStack(),!1;let s=r[0],i=s,o=new ot;if(o.firstToken=s,r.length===1&&!q(this.currentToken,2)){this._issues.push(W(25,o)),o.lastToken=r.at(-1);let u=new Ke(o);return n.addNodeChild(u),this.mergeStack(),!0}let a=r.map(u=>u.value??"").join("");if(!"/delete-property/".startsWith(a)||a.endsWith("-"))return this.popStack(),!1;o.lastToken=r.at(-1),a!=="/delete-property"?this._issues.push(W(a.startsWith("/delete-p")?35:25,o)):q(this.currentToken,13)?(i=this.moveToNextToken,o.lastToken=i):this._issues.push(W(21,o));let c=new Ke(o);if(Ir(o.tokenIndexes?.end,s)){let u=this.isPropertyName();u||this._issues.push(W(6,c)),c.propertyName=u??null}else this._issues.push(W(6,o));let l=this.endStatement();return c.lastToken=l,n.addNodeChild(c),this.mergeStack(),!0}isNodePathRef(){this.enqueueToStack();let n=this.processOptionalLabelAssign(!0),r=this.processNodePathRef();if(!r){this.popStack();return}let s=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&s.push(...this.processOptionalLabelAssign(!0));let i=new un(n,r,s);return this.mergeStack(),i}processValue(n){this.enqueueToStack();let s=(()=>{let o=()=>(this.processStringValue()||this.isNodePathRef()||this.isLabelRefValue(n)||this.arrayValues(n)||this.processByteStringValue()||this.isExpressionValue())??null,a=o();if(!a)return[];let c=[a];for(;!q(this.currentToken,1);){let l=this.prevToken,u=this.currentToken,d=q(this.currentToken,24);if(d)this.moveToNextToken;else if(!Ir(this.prevToken,this.currentToken))break;let f=o();if(u&&f===null&&d){let h=new j(G(u,this.currentToken));this._issues.push(W(0,h))}if(!d&&f===null)break;if(l&&!d&&f){let h=new j(G(l));this._issues.push(W(28,h))}c.push(f)}return c})();if(s.length===0){this.popStack();return}return this.mergeStack(),new Zd(s)}processStringValue(){this.enqueueToStack();let n=this.processOptionalLabelAssign(!0),r=this.moveToNextToken;if(!q(r,21)){this.popStack();return}if(!r?.value)throw new Error("Token must have value");let s=r.value;s.match(/["']$/)&&(s=s.slice(1,-1));let i=new Le(s,G(r));r.value.match(/["']$/)||this._issues.push(W(r.value.startsWith('"')?16:17,i));let o=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(o=this.processOptionalLabelAssign(!0));let a=new un(n,i,o);return this.mergeStack(),a}arrayValues(n){this.enqueueToStack();let r=this.processOptionalLabelAssign(!0),s=this.processBits(),i=this.currentToken;if(q(i,5))this.moveToNextToken;else{this.popStack();return}let o=this.processArrayValues(n)??null;o.openBracket=i;let a=this.processOptionalLabelAssign(!0)??[],c=new un(r,o,a,s);q(this.currentToken,4)?(o&&(o.closeBracket=this.currentToken),this.moveToNextToken):this._issues.push(W(12,c));let l=[];return this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(l=this.processOptionalLabelAssign(!0)),this.mergeStack(),c.endLabels.push(...l),c.firstToken=i,c.lastToken=this.prevToken,c}processByteStringValue(){this.enqueueToStack();let n=this.processOptionalLabelAssign(!0),r=this.moveToNextToken,s=r;if(!q(s,11)){this.popStack();return}let i=this.processLabeledValue(()=>this.processHexString()),o=this.processOptionalLabelAssign(!0)??[];i.forEach(u=>{let d=0;u.value?.tokenIndexes?.start===u.value?.tokenIndexes?.end&&(d=u.value?.tokenIndexes?.start?.pos.len??0),d%2!==0&&this._issues.push(W(15,u))});let a=new ks(i??[]);a.openBracket=s,a.values.length===0&&(a.firstToken=r,this._issues.push(W(14,a)));let c=new un(n,a,o);q(this.currentToken,12)?a.openBracket=this.moveToNextToken:this._issues.push(W(5,c));let l=[];return this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(l=this.processOptionalLabelAssign(!0)),this.mergeStack(),c.endLabels.push(...l),c.firstToken=r,a.lastToken=this.prevToken,c}processLabeledValue(n){this.enqueueToStack();let r=n(),s=[];if(!r)return this.popStack(),[];for(;r;)s=[...s,r],r=n();if(s){let i=n();i&&(s=[...s,i])}return this.mergeStack(),s}processArrayValues(n){this.enqueueToStack();let r=this.processLabeledValue(()=>this.processRefValue(!1,n)||this.processLabeledHex(!1)||this.processLabeledDec(!1)||this.processLabeledExpression(!0,!1)),s=new Ct(r);return r.length===0&&(s.firstToken=this.currentToken),this.mergeStack(),s}processLabeledHex(n){this.enqueueToStack();let r=this.processOptionalLabelAssign(n),s=this.processHex();if(!s){this.popStack();return}let i=new Lr(s,r);return this.mergeStack(),i}processHexString(){this.enqueueToStack();let n=this.processOptionalLabelAssign(!1),r=this.checkConcurrentTokens([20,20].map(Ie));if(!r.length){this.popStack();return}let s=Number.parseInt(r.map(a=>a.value).join(""),16),i=new Ut(s,G(r[0],r.at(-1))),o=new Lr(i,n);return this.mergeStack(),o}processLabeledDec(n){this.enqueueToStack();let r=this.processOptionalLabelAssign(n),s=this.processDec();if(!s){this.popStack();return}let i=new Lr(s,r);return this.mergeStack(),i}processLabeledExpression(n=!0,r=n){this.enqueueToStack();let s=[];n&&(s=this.processOptionalLabelAssign(r));let i=this.processExpression(this.cPreprocessorParser.macros);if(!i){this.popStack();return}let o=new Lr(i,s);return this.mergeStack(),o}isExpressionValue(){this.enqueueToStack();let n=this.processOptionalLabelAssign(!1),r=this.processExpression(this.cPreprocessorParser.macros);if(!r){this.popStack();return}let s=this.processOptionalLabelAssign(!0),i=new un(n,r,s);return this.mergeStack(),i}isLabelRef(n){this.enqueueToStack();let r=this.currentToken;if(q(r,40))this.moveToNextToken;else{this.popStack();return}let s=this.isLabelName();if(!s){let o=new be(null);return this._issues.push(W(18,n??o)),o.firstToken=r,this.mergeStack(),o}r&&(s.firstToken.pos.line!==r.pos.line||s.firstToken.pos.col!==r.pos.colEnd)&&this._issues.push(W(29,new j(G(r,s.firstToken))));let i=new be(s);return i.firstToken=r,this.mergeStack(),i}isLabelRefValue(n){this.enqueueToStack();let r=this.processOptionalLabelAssign(!0),s=this.isLabelRef(n);if(!s){this.popStack();return}let i=[];this.currentToken&&this.currentToken.pos.line===this.currentToken.prevToken?.pos.line&&(i=this.processOptionalLabelAssign(!0));let o=new un(r,s,i);return this.mergeStack(),o}processRefValue(n,r){this.enqueueToStack();let s=this.processOptionalLabelAssign(n),i=this.currentToken;if(!q(this.currentToken,40)){this.popStack();return}let o=this.processNodePathRef();if(o!==void 0){let l=new Lr(o,s);return this.mergeStack(),l}let a=this.isLabelRef(r);if(a===void 0){this._issues.push(W([18,9],r));let l=new Lr(null,s);return l.firstToken=s.at(0)?.firstToken??i,this.mergeStack(),l}let c=new Lr(a,s);return c.firstToken=s.at(0)?.firstToken??i,this.mergeStack(),c}processNodePath(n=!0,r=new es){this.enqueueToStack();let s;if(q(this.currentToken,13))s=this.moveToNextToken;else{if(!n){this.popStack();return}this.prevToken&&this._issues.push(W(19,new j(G(this.prevToken))))}let i=this.isNodeName();if(i||this._issues.push(W(7,new j(G(s??this.prevToken)))),r.addPath(i??null,s?new j(G(s)):void 0),n&&!s&&r.children.length===0){this.mergeStack();return}return this.processNodePath(!1,r),this.mergeStack(),r}processNodePathRef(){this.enqueueToStack();let n=this.moveToNextToken,r=n;if(!q(r,40)){this.popStack();return}let s=this.moveToNextToken;if(r=s,!q(r,2)){this.popStack();return}let i=this.processNodePath(),o=new Mn(i??null),a=this.currentToken??this.prevToken,c=a;return i?.children.forEach((l,u)=>{if(u===i?.children.length-1&&l&&c&&!cn(l.lastToken,c)){this._issues.push(W(29,new j(G(l.lastToken,c))));return}if(u===0&&s&&!cn(s,l?.firstToken)){this._issues.push(W(29,new j(G(s,l?.firstToken))));return}let d=i?.children[u+1];l&&d&&!cn(l.lastToken,d.firstToken)&&this._issues.push(W(29,new j(G(l.lastToken,d?.firstToken))))}),q(a,3)?this.moveToNextToken:this.prevToken&&this._issues.push(W(3,new j(G(this.prevToken)))),o.firstToken=n,o.lastToken=a??this.prevToken,this.mergeStack(),o}get includes(){return this.allAstItems.filter(n=>n instanceof Ns)}get allAstItems(){return[...this.cPreprocessorParser.allAstItems,...this.rootDocument.children,...this.others,...this.unhandledStatements.properties,...this.unhandledStatements.deleteProperties]}};var $o=Y(Q());var rR=require("fs");var sR=require("path"),rf=class{constructor(e,n){this.settings=e;this.bindingLoader=n;this._issues=[];this.overlayParsers=[];this.overlays=[];this.ctxNames_=new Set;this.sortKeys=new WeakMap;let r={includePaths:[],overlays:[],zephyrBindings:[],deviceOrgTreeBindings:[],deviceOrgBindingsMetaSchema:[],...e,ctxName:e.ctxName??(0,sR.basename)(e.dtsFile),lockRenameEdits:[]};this.overlays=r.overlays,this.overlays.filter(rR.existsSync),this.parser=new rc(r.dtsFile,r.includePaths),this.ctxNames_.add(r.ctxName),this.id=Zr(r),this.parser.stable.then(()=>{this.overlayParsers=this.overlays?.map(s=>new rc(s,r.includePaths,this.parser.cPreprocessorParser.macros))??[]})}get macros(){return[this.parser,...this.overlayParsers].at(-1).cPreprocessorParser.macros}get ctxNames(){return Array.from(this.ctxNames_)}addCtxName(e){this.ctxNames_.add(e)}removeCtxName(e){this.ctxNames_.delete(e)}async getContextIssues(){return[...(await this.getRuntime()).issues,...this._issues]}async getFileTree(){let e=new Map,n=s=>({file:s,includes:(e.get(s)??[]).map(i=>n(i.resolvedPath??i.path))});return(await this.getRuntime()).includes.forEach(s=>{let i=e.get(s.uri);i||(i=[],e.set(s.uri,i)),i.push({path:s.path.path,resolvedPath:s.resolvedPath})}),{mainDtsPath:n(this.parser.uri),overlays:this.overlays.map(n)}}async stable(){await Promise.all([this.parser.stable,...this.overlayParsers.map(e=>e.stable)])}async getRuntime(){return await this.stable(),this._runtime??=this.evaluate(),this._runtime}getContextFiles(){return[...this.overlayParsers.flatMap(e=>e.getFiles()),...this.parser.getFiles()]}isInContext(e){return this.getContextFiles().some(n=>le(n,e))}getUriParser(e){let n=this.overlayParsers.find(r=>r.getFiles().some(s=>le(s,e)));return n??=this.parser.getFiles().some(r=>le(r,e))?this.parser:void 0,n}async getAllParsers(){return await this.stable(),[this.parser,...this.overlayParsers]}async getDocumentLinks(e,n){if(!this.isInContext(e))return[];let s=(await this.getRuntime()).rootNode.allBindingsProperties.filter(i=>le(i.ast.uri,e)&&(!n||xn(i.ast,e,n))).flatMap(i=>i.ast.values?.values.flatMap(o=>{let c=i.parent?.nodeTypes.find(l=>o?.value instanceof Le&&l.compatible===o.value.value);return c?{range:te(o.value),target:fe(c.bindingsPath)}:void 0})).filter(i=>i)??[];return[...this.parser.cPreprocessorParser.dtsIncludes.filter(i=>le(i.uri,e)&&(!n||xn(i,e,n))).map(i=>{let o=this.parser.cPreprocessorParser.resolveInclude(i);if(o)return{range:te(i.path),target:fe(o)}}).filter(i=>i)??[],...s]}linkPropertiesLabelsAndNodePaths(e){let n=i=>[...i.property,...i.nodes.flatMap(n)],r=n(e.rootNode),s=e.rootNode.allDescendantsLabels;r.forEach(i=>i.ast.allDescendants.forEach(o=>{if(o instanceof be){let a=e.resolvePath([`&${o.label?.value}`],s);if(a){let c=e.rootNode.getChild(a);o.linksTo=c,c?.linkedRefLabels.push(o)}else o.value&&this._issues.push(Lt(3,o,$o.DiagnosticSeverity.Error,[],[],[o.value]))}else if(o instanceof es){let a=e.rootNode,c=o.pathParts;for(let l=0;l<c.length&&c[l];l++){let u=!1,d=c[l];if(d){let f=a?.getNode(d.name,d.fullAddress,!1);d.linksTo=f,!u&&!f&&(u=!0,this._issues.push(Lt(8,d,$o.DiagnosticSeverity.Error,[],[],[d.toString(),`${o.pathParts.filter(h=>h?.linksTo).map(h=>h?.toString()).join("/")}`]))),f?.linkedNodeNamePaths.push(d),a=f}else break}}}))}async reevaluate(e){let n=this.getUriParser(e);return n?(this.sortKeys=new WeakMap,await n.reparse(),this._runtime=this.evaluate(),this._runtime):this._runtime}getSortKey(e){if(e)return this.sortKeys.get(e.firstToken)}async evaluate(){let e=performance.now();await this.stable();let n=new Lo(this);this._issues=[],this.processRoot(this.parser.rootDocument,n);for(let r=0;r<this.overlayParsers.length;r++)this.processRoot(this.overlayParsers[r].rootDocument,n);return n.includes=this.parser.includes,n.comments=this.parser.cPreprocessorParser.allAstItems.filter(r=>r instanceof xr),(await this.getAllParsers()).flatMap(r=>r.tokens).forEach((r,s)=>this.sortKeys.set(r,s)),this.linkPropertiesLabelsAndNodePaths(n),console.log(`(ID: ${this.id}) evaluate`,performance.now()-e),n}processRoot(e,n){for(let r=0;r<e.children.length;r++){let s=e.children[r];this.processChild(s,n.rootNode,n)}}processChild(e,n,r){e instanceof ze?this.processDtcBaseNode(e,n,r):e instanceof $e?this.processDtcProperty(e,n,r):e instanceof _n?this.processDeleteNode(e,n,r):e instanceof Ke&&this.processDeleteProperty(e,n,r)}checkNodeUniqueNames(e,n){let r=(o,a)=>o.some(c=>c.name===a.name&&(c.address===void 0||a.fullAddress===void 0||Ar(c.address,a.fullAddress)===0)),s=n.nodes.map(o=>({name:o.name,address:o.address})),i=[];e.children.forEach(o=>{if(o instanceof Ae&&o.name)r(i.map(a=>({name:a.name,address:a.fullAddress})),o.name)&&this._issues.push(Lt(2,o.name)),i.push(o.name);else if(o instanceof _n&&o.nodeNameOrRef instanceof qe){let a=o.nodeNameOrRef;r(s,a)&&(i=i.filter(c=>r(i.map(l=>({name:l.name,address:l.fullAddress})),c)))}})}processDtcBaseNode(e,n,r){e instanceof vt?this.processDtcRootNode(e,r):e instanceof Ae?this.processDtcChildNode(e,n,r):e instanceof $t&&this.processDtcRefNode(e,r)}processDtcRootNode(e,n){n.roots.push(e),n.rootNode.definitions.push(e),this.checkNodeUniqueNames(e,n.rootNode),[...e.children].sort((r,s)=>r instanceof $e&&s instanceof Ke||s instanceof $e&&r instanceof Ke?0:s instanceof $e?1:0).forEach(r=>this.processChild(r,n.rootNode,n))}processDtcChildNode(e,n,r){if(e.name?.name){let s=e.path?r.resolvePath(e.path):void 0,o=(s?r.rootNode.getChild(s):void 0)??new we(this.bindingLoader,e.name.name,e.name.fullAddress,n);o.definitions.push(e),e.labels.forEach(a=>a.lastLinkedTo=o),n=o,this.checkNodeUniqueNames(e,o)}[...e.children].sort((s,i)=>s instanceof ze&&i instanceof ze?0:s instanceof ze?-1:0).forEach(s=>this.processChild(s,n,r))}processDtcRefNode(e,n){let r;if(e.labelReference){let s=e.resolveNodePath??(e.pathName?n.resolvePath([e.pathName]):void 0);s?(e.resolveNodePath??=[...s],r=n.rootNode.getChild(s),e.labelReference.linksTo=r,e.labels.forEach(i=>i.lastLinkedTo=r),r?.linkedRefLabels.push(e.labelReference),r?.referencedBy.push(e),e.labels.forEach(i=>{n.labelsUsedCache.set(i.label.value,s)}),r?(n.references.push(e),this.checkNodeUniqueNames(e,r)):n.unlinkedRefNodes.push(e)):(this._issues.push(Lt(3,e.labelReference,$o.DiagnosticSeverity.Error,[],[],[e.labelReference.label?.value??""])),n.unlinkedRefNodes.push(e))}else n.unlinkedRefNodes.push(e);[...e.children].sort((s,i)=>s instanceof ze&&i instanceof ze?0:s instanceof ze?-1:0).forEach(s=>this.processChild(s,r??new we(this.bindingLoader,""),n))}processDtcProperty(e,n,r){e.propertyName?.name&&n.addProperty(new Ye(e,n)),e.children.forEach(s=>this.processChild(s,n,r))}processDeleteNode(e,n,r){if(e.nodeNameOrRef instanceof qe&&e.nodeNameOrRef.value){if(e.parentNode?.parentNode)if(!n.hasNode(e.nodeNameOrRef.name,e.nodeNameOrRef.fullAddress))this._issues.push(Lt(5,e.nodeNameOrRef));else{n.deletes.push(e);let s=n.getNode(e.nodeNameOrRef.name,e.nodeNameOrRef.fullAddress);e.nodeNameOrRef.linksTo=s,n.deleteNode(e.nodeNameOrRef.name,e,e.nodeNameOrRef.fullAddress),s?.labels.forEach(i=>{r.labelsUsedCache.delete(i.label.value)})}}else if(e.nodeNameOrRef instanceof be&&e.nodeNameOrRef.value){let s=r.resolvePath([`&${e.nodeNameOrRef.value}`]),i;s?(i=r.rootNode.getChild(s),n.deletes.push(e),e.nodeNameOrRef.linksTo=i,i?.labels.forEach(o=>{r.labelsUsedCache.delete(o.label.value)}),i?.linkedRefLabels.push(e.nodeNameOrRef),i?.parent?.deleteNode(i.name,e,i.address),e.parentNode instanceof ze&&!e.parentNode.pathName&&r.globalDeletes.push(e)):(r.unlinkedDeletes.push(e),this._issues.push(Lt(3,e.nodeNameOrRef,$o.DiagnosticSeverity.Error,[],[],[e.nodeNameOrRef.value])))}else if(e.nodeNameOrRef instanceof Mn&&e.nodeNameOrRef.path&&!e.nodeNameOrRef.path.pathParts.some(s=>!s)){let s=["/",...e.nodeNameOrRef.path.pathParts.map(u=>u.toString())],i=r.rootNode,o=e.nodeNameOrRef.path.pathParts;for(let u=0;u<o.length&&o[u];u++){let d=o[u];if(d){let f=i?.getNode(d.name,d.fullAddress,!1);d.linksTo=f,f?.linkedNodeNamePaths.push(d),i=f}}let a=e.nodeNameOrRef.path.pathParts.every(u=>u),c=e.nodeNameOrRef.path.pathParts.find(u=>u&&!u.linksTo),l=e.nodeNameOrRef.path.pathParts.at(-1)?.linksTo;l||(r.unlinkedDeletes.push(e),c&&this._issues.push(Lt(8,c,$o.DiagnosticSeverity.Error,[],[],[c.toString(),`${e.nodeNameOrRef.path.pathParts.filter(u=>u?.linksTo).map(u=>u?.toString()).join("/")}`]))),n.deletes.push(e),l?.labels.forEach(u=>{r.labelsUsedCache.delete(u.label.value)}),l?.parent?.deleteNode(l.name,e,l.address),e.parentNode instanceof ze&&!e.parentNode.pathName&&r.globalDeletes.push(e)}else r.unlinkedDeletes.push(e);e.children.forEach(s=>this.processChild(s,n,r))}processDeleteProperty(e,n,r){e.propertyName?.name&&!n.hasProperty(e.propertyName.name)?this._issues.push(Lt(1,e.propertyName)):e.propertyName?.name&&(n.deletes.push(e),n.deleteProperty(e.propertyName.name,e)),e.children.forEach(s=>this.processChild(s,n,r))}async getDiagnostics(){let e=new Map,n=(r,s)=>{let i=e.get(s);i||(i=[],e.set(s,i)),i.push(r)};try{return(await this.getAllParsers()).forEach(i=>{i.issues.forEach(o=>n(o.diagnostic(),o.raw.astElement.uri))}),(await this.getContextIssues()??[]).forEach(i=>n(i.diagnostic(),i.raw.astElement.uri)),(await this.getRuntime())?.typesIssues.forEach(i=>n(i.diagnostic(),i.raw.astElement.uri)),e}catch(r){throw console.error(r),r}}async toFullString(){return`/dts-v1/;
278
+ ${(await this.getRuntime()).rootNode.toFullString((await this.getAllParsers()).at(-1).cPreprocessorParser.macros)}`}async serialize(){return(await this?.getRuntime())?.rootNode.serialize((await this.getAllParsers()).at(-1).cPreprocessorParser.macros)}};var _t=Y(Q());var iR=require("fs"),qo=require("path");function x1(t){if(!t||!(t.ast instanceof wo))return[];let e=r=>r.flatMap(s=>(0,iR.readdirSync)(s,{withFileTypes:!0,recursive:!0}).filter(i=>i.name.toLowerCase().endsWith(".dtsi")||i.name.toLowerCase().endsWith(".h")).map(i=>({label:`${(0,qo.join)((0,qo.relative)(s,i.parentPath),i.name)}`,kind:_t.CompletionItemKind.File})));if(t.ast.relative)return e([(0,qo.dirname)(t.ast.uri)]);let n=t.runtime.context.settings.includePaths??[];return e(n)}var of=(t,e)=>[...t.labels.filter(e),...t.deletedNodes.filter(n=>!e(n.by)).flatMap(n=>of(n.node,e)),...t.nodes.flatMap(n=>of(n,e))],Vg=(t,e)=>[...t.labels,...t.deletedNodes.filter(n=>!e(n.by)).flatMap(n=>Vg(n.node,e)),...t.nodes.flatMap(n=>Vg(n,e))];function M1(t,e){if(!t||!(t.item instanceof Ye)||!(t.ast instanceof be))return[];let n=r=>Vg(r,e);return Array.from(new Set(n(t.runtime.rootNode).map(r=>r.label.value))).map(r=>({label:`${r}`,kind:_t.CompletionItemKind.Method}))}function L1(t,e){if(!t||t.item!==null||!(t.ast instanceof be)||!(t.ast.parentNode instanceof $t))return[];let n=r=>of(r,e).filter(s=>e(s));return[...Array.from(new Set(n(t.runtime.rootNode).map(r=>r.label.value))).map(r=>({label:r,insertText:`${r} {
274
279
  $1
275
- };`,kind:gt.CompletionItemKind.Value,insertTextFormat:gt.InsertTextFormat.Snippet}))]}function o$(n,e){let t=s=>s?s.parentNode instanceof xt||s.parentNode instanceof mt||s.parentNode instanceof Pe?!1:t(s.parentNode):!0;if(!n||n.item!==null||!Pt(n.ast)||!t(n.ast))return[];let r=s=>Kd(s,e).filter(i=>e(i));return n.ast instanceof nt?r(n.runtime.rootNode).length?[{label:"/delete-node/",insertText:"/delete-node/ $1;",kind:gt.CompletionItemKind.Keyword,insertTextFormat:gt.InsertTextFormat.Snippet,sortText:"~"}]:n.runtime.rootNode.nodes.length?[{label:"/delete-node/ &{}",insertText:"/delete-node/ {/$1};",kind:gt.CompletionItemKind.Keyword,insertTextFormat:gt.InsertTextFormat.Snippet,sortText:"~"}]:[]:Array.from(new Set(r(n.runtime.rootNode).map(s=>s.label.value))).map(s=>({label:n.ast instanceof ye?`${s}`:`&${s}`,kind:gt.CompletionItemKind.Variable}))}function a$(n,e){if(!n||!(n.item instanceof Se)||n.item===null||n.beforeAst&&(!(n.beforeAst?.parentNode instanceof cn)||n.beforeAst?.parentNode instanceof We))return[];let t=r=>[...r.nodes,...r.deletedNodes.filter(s=>!e(s.by)).map(s=>s.node)].flatMap(s=>s.definitions.filter(i=>i instanceof Pe)).filter(s=>e(s));return n.ast instanceof Me||n.ast instanceof Tn||n.beforeAst?.parentNode instanceof Tn?Array.from(new Set(t(n.item).map(r=>r.name?.toString()))).map(r=>({label:`${r}`,kind:gt.CompletionItemKind.Variable})):t(n.item).length?[{label:"/delete-node/",kind:gt.CompletionItemKind.Keyword,insertTextFormat:gt.InsertTextFormat.Snippet,sortText:"~"}]:[]}function c$(n,e){if(!n||!(n.item instanceof Se)||n.beforeAst&&(!(n.beforeAst?.parentNode instanceof cn)||n.beforeAst?.parentNode instanceof Tn))return[];let t=r=>[...r.property,...r.deletedProperties.filter(s=>!e(s.by)).map(s=>s.property)].flatMap(s=>[s,...s.allReplaced]).filter(s=>e(s.ast));return n.ast instanceof je||n.ast instanceof We||n.beforeAst?.parentNode instanceof We?Array.from(new Set(t(n.item).map(r=>r.name))).map(r=>({label:`${r}`,kind:gt.CompletionItemKind.Variable})):t(n.item).length?[{label:"/delete-property/",insertText:"/delete-property/$1;",kind:gt.CompletionItemKind.Keyword,sortText:"~",insertTextFormat:gt.InsertTextFormat.Snippet}]:[]}function l$(n,e){let t=n?.ast instanceof Xr?n.ast:n?.ast.parentNode;if(!n||!t||!(t instanceof Xr))return[];let r=t.pathParts.slice(0,-1);if(r.some(o=>!o))return[];let s=r.map(o=>o.toString());return(()=>{let o=n.runtime.rootNode.getChildFromScope(["/",...s],e);return[...o?.nodes.filter(a=>!Pt(n.ast)||a.definitions.some(e))??[],...o?.deletedNodes.filter(a=>!e(a.by)).map(a=>a.node)??[]].map(a=>a.fullName)??[]})().map(o=>({label:`/${[...s,o].join("/")}`,kind:gt.CompletionItemKind.Variable}))}var Hd=n=>!n||n instanceof xe?!1:n instanceof ln||Hd(n.parentNode);function u$(n){return!n||!(n.item instanceof ze&&n.item.ast.assignOperatorToken)?[]:!Hd(n?.ast)&&!(n.ast instanceof xe&&n.item.ast.values===null)&&!Hd(n.beforeAst)&&!Hd(n.afterAst)?[]:n.item.parent.nodeType instanceof Sn?Array.from([n.runtime.context.parser,...n.runtime.context.overlayParsers].at(-1)?.cPreprocessorParser.macros??[]).map(([r,s])=>s.macro.identifier instanceof Ns?{label:`${s.macro.identifier.toString()} -> ${s.macro.content?.toString()??"__UNSET__"}`,insertText:`${s.macro.name}(${s.macro.identifier.params.map((i,o)=>i instanceof Ut?`$${o+1}`:"").join(", ")})`,kind:gt.CompletionItemKind.Function,sortText:`~${s.macro.name}`,insertTextFormat:gt.InsertTextFormat.Snippet}:{label:s.macro.identifier.name,kind:gt.CompletionItemKind.Variable,sortText:`~${s.macro.name}`}):[]}async function DN(n,e){return Nt(n,e,(t,r)=>[...c$(t,r),...a$(t,r),...o$(t,r),...l$(t,r),...i$(t,r),...s$(t,r),...r$(t),...u$(t)])}var Or=K(X());function d$(n){if(!n||n.item===null||!(n.ast instanceof je))return[];let e=r=>r.replacedBy?e(r.replacedBy):r,t=r=>[r.ast,...r.allReplaced.map(s=>s.ast),r.parent.deletedProperties.find(s=>s.property=r)?.by??[]].map(s=>{if(s instanceof xe)return Or.Location.create(de(s.uri),Z(s.propertyName??s));if(s instanceof We)return Or.Location.create(de(s.uri),Z(s.propertyName??s))}).filter(s=>s);if(n.item instanceof ze&&n.ast instanceof je)return t(e(n.item));if(n.item instanceof Se&&n.ast instanceof je&&n.ast.parentNode instanceof We){let r=n.item.deletedProperties.find(s=>s.by===n.ast.parentNode)?.property;if(r)return t(r)}return[]}function f$(n){if(!n)return[];let e=t=>{let s=n.runtime.rootNode.getNode("aliases")?.property.filter(o=>{let a=o.ast.quickValues;if(a?.length===1&&typeof a[0]=="string"&&n.runtime.rootNode.getChild(a[0].split("/"))===t)return!0}).map(o=>o.ast)??[],i=t.parent?.deletedNodes.filter(o=>o.node===t&&(o.by.nodeNameOrRef instanceof Me?o.by.nodeNameOrRef!==n.ast:!t.linkedRefLabels.some(a=>a!==n.ast))).map(o=>o.by.nodeNameOrRef)??[];return[...s,...t.linkedRefLabels,...t.linkedNodeNamePaths,...t.definitions,...i].map(o=>{if(o instanceof mt)return Or.Location.create(de(o.uri),Z(o.name??o));if(o instanceof Pe)return Or.Location.create(de(o.uri),Z(o.name??o));if(o instanceof Me)return Or.Location.create(de(o.uri),Z(o));if(o instanceof Me)return Or.Location.create(de(o.uri),Z(o));if(o instanceof ye)return Or.Location.create(de(o.uri),Z(o.label??o));if(o instanceof xe)return Or.Location.create(de((o.values??o)?.uri),Z(o.values??o))}).filter(o=>o)};if(n.item instanceof Se&&!Pt(n.ast))return e(n.item);if(n.ast instanceof Bt&&n.ast.parentNode instanceof ye&&n.ast.parentNode.linksTo)return e(n.ast.parentNode.linksTo);if(n.ast instanceof Me&&n.ast.linksTo)return Pt(n.ast)?[...e(n.ast.linksTo),Or.Location.create(de(n.ast.uri),Z(n.ast))]:e(n.ast.linksTo);if(n?.ast instanceof Ie&&n.item instanceof ze&&n.item.parent.name==="aliases"){let t=n.runtime.rootNode.getChild(n.ast.value.split("/"));if(t)return e(t)}return[]}async function CN(n,e){return Nt(n,e,t=>[...f$(t),...d$(t)])}var Qr=K(X());function AN(n){if(!n||n.item===null||!(n.ast instanceof je))return[];let e=r=>r.replacedBy?e(r.replacedBy):r,t=r=>[r.ast,...r.allReplaced.map(s=>s.ast),r.parent.deletedProperties.find(s=>s.property=r)?.by??[]].map(s=>{if((s instanceof xe||s instanceof We)&&s.propertyName)return Qr.Location.create(de(s.uri),Z(s.propertyName))}).filter(s=>s);if(n.item instanceof ze&&n.ast instanceof je)return t(e(n.item));if(n.item instanceof Se&&n.ast instanceof je&&n.ast.parentNode instanceof We){let r=n.item.deletedProperties.find(s=>s.by===n.ast.parentNode)?.property;if(r)return t(r)}return[]}function ON(n,e){if(!e||!(e.ast instanceof Bt))return[];"newName"in n&&(e.ast.parentNode instanceof ye&&n.newName.startsWith("&")?n.newName=n.newName.slice(1):e.ast.parentNode instanceof ks&&n.newName.endsWith(":")&&(n.newName=n.newName.slice(0,-1)));let t=e.ast.value,r=s=>[...s.definitions.filter(i=>i instanceof Pe).flatMap(i=>i.labels.map(o=>o.label)),...s.linkedRefLabels.map(i=>i.label)].filter(i=>i?.value===t).map(i=>{if(i)return Qr.Location.create(de(i.uri),Z(i))}).filter(i=>i);return e.item instanceof Se&&!Pt(e.ast)?r(e.item):e.ast instanceof Bt&&e.ast.parentNode instanceof ye&&e.ast.parentNode.linksTo?r(e.ast.parentNode.linksTo):[]}function IN(n){if(!n||!(n.ast instanceof Me))return[];let e=t=>{let s=n.runtime.rootNode.getNode("aliases")?.property.filter(o=>{let a=o.ast.quickValues;if(a?.length===1&&typeof a[0]=="string"){let c=n.runtime.rootNode.getChild(a[0].split("/"));if(c?.isChildOf(t)||c===t)return!0}}).map(o=>o.ast)??[],i=t.parent?.deletedNodes.filter(o=>o.node===t&&o.by.nodeNameOrRef!==n.ast).map(o=>o.by.nodeNameOrRef)??[];return[...s,...t.linkedNodeNamePaths,...t.definitions,...i].map(o=>{if(o instanceof Pe&&o.name)return Qr.Location.create(de(o.uri),Z(o.name));if(o instanceof Me)return Qr.Location.create(de(o.uri),Z(o));if(o instanceof xe&&o.values?.values[0]?.value&&o.values?.values[0]?.value instanceof Ie){let a=o.values.values[0].value,c=Z(a),l=a.value.split("/"),u=t.path,d=l.slice(0,u.length-1).join("/").length+1,f=a.value.length-l.slice(0,u.length).join("/").length;return c.start.character+=1+d,c.end.character-=1+f,Qr.Location.create(de(o.values.values[0].uri),c)}}).filter(o=>o)};return n.item instanceof Se&&!Pt(n.ast)?e(n.item):n.ast instanceof Me&&n.ast.linksTo?Pt(n.ast)?[...e(n.ast.linksTo),Qr.Location.create(de(n.ast.uri),Z(n.ast))]:e(n.ast.linksTo):[]}async function xN(n,e){let t={};return(await Nt(n,e,s=>[...IN(s),...ON(n,s),...AN(s)])).forEach(s=>{t[s.uri]??=[],t[s.uri].push(Qr.TextEdit.replace(s.range,n.newName))}),{changes:t}}async function MN(n,e){let t=await Nt(n,e,r=>[...IN(r),...ON(n,r),...AN(r)]);if(t.some(r=>e?.settings.lockRenameEdits?.some(s=>tt(r.uri).startsWith(s))))throw new Error('Path is locked by user setting "lockRenameEdits"');return{defaultBehavior:!!t.length}}var Co=K(X());function h$(n){if(!n||n.item===null||!(n.ast instanceof je))return[];let e=r=>r.replacedBy?e(r.replacedBy):r,t=r=>[r.ast,...r.allReplaced.map(s=>s.ast)].map(s=>{if(s instanceof xe)return Co.Location.create(de(s.uri),Z(s.propertyName??s))}).filter(s=>s);if(n.item instanceof ze&&n.ast instanceof je)return t(e(n.item));if(n.item instanceof Se&&n.ast instanceof je&&n.ast.parentNode instanceof We){let r=n.item.deletedProperties.find(s=>s.by===n.ast.parentNode)?.property;if(r)return t(r)}return[]}function p$(n){if(!n)return[];let e=t=>[...t.definitions,...t.referencedBy].map(r=>{if(r instanceof mt)return Co.Location.create(de(r.uri),Z(r));if(r instanceof Pe)return Co.Location.create(de(r.uri),Z(r));if(r instanceof xt)return Co.Location.create(de(r.uri),Z(r))}).filter(r=>r);if(n.item instanceof Se&&!Pt(n.ast))return e(n.item);if(n.ast instanceof Bt&&n.ast.parentNode instanceof ye&&n.ast.parentNode.linksTo)return e(n.ast.parentNode.linksTo);if(n.ast instanceof Me&&n.ast.linksTo)return e(n.ast.linksTo);if(n?.ast instanceof Ie&&n.item instanceof ze&&n.item.parent.name==="aliases"){let t=n.runtime.rootNode.getChild(n.ast.value.split("/"));if(t)return e(t)}return[]}function m$(n){if(n?.ast instanceof Ut||n?.ast instanceof Cr){let e=n.runtime.context.parser.cPreprocessorParser.macros.get(n.ast instanceof Ut?n.ast.name:n.ast.value);if(e)return[Co.Location.create(de(e.macro.uri),Z(e.macro.identifier))]}return[]}async function $N(n,e){return Nt(n,e,t=>[...p$(t),...h$(t),...m$(t)])}var Gd=K(X());function g$(n){if(!n||n.item===null||!(n.ast instanceof je))return;let e=r=>r.replaces?e(r.replaces):r,t=r=>Gd.Location.create(de(r.ast.uri),Z(r.ast.propertyName??r.ast));if(n.item instanceof ze&&n.ast instanceof je)return t(e(n.item));if(n.item instanceof Se&&n.ast instanceof je&&n.ast.parentNode instanceof We){let r=n.item.deletedProperties.find(s=>s.by===n.ast.parentNode)?.property;if(r)return t(e(r))}}function y$(n){if(!n)return;let e=t=>{let r=t.definitions.at(0);return r?Gd.Location.create(de(r.uri),Z(r)):void 0};if(n.item instanceof Se&&!Pt(n.ast))return e(n.item);if(n.ast instanceof Bt&&n.ast.parentNode instanceof ye&&n.ast.parentNode.linksTo)return e(n.ast.parentNode.linksTo);if(n.ast instanceof Me&&n.ast.linksTo)return e(n.ast.linksTo);if(n?.ast instanceof Ie&&n.item instanceof ze&&n.item.parent.name==="aliases"){let t=n.runtime.rootNode.getChild(n.ast.value.split("/"));if(t)return e(t)}}function b$(n){if(n?.ast instanceof Ut||n?.ast instanceof Cr){let e=n.runtime.context.parser.cPreprocessorParser.macros.get(n.ast instanceof Ut?n.ast.name:n.ast.value);if(e)return Gd.Location.create(de(e.macro.uri),Z(e.macro.identifier))}}async function LN(n,e){return(await Nt(n,e,t=>[y$(t)||g$(t)||b$(t)])).at(0)}var ne=K(X());var v$=(n,e,t,r,s)=>{switch(t){case 1:return[{title:"Add semicolon",diagnostics:[r],kind:ne.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ne.TextEdit.insert(ne.Position.create(r.range.end.line,r.range.end.character),";")]}}}];case 2:return[{title:"Add open curly",diagnostics:[r],kind:ne.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ne.TextEdit.insert(ne.Position.create(r.range.end.line,r.range.end.character)," {")]}}}];case 29:return[{title:"Remove white space",diagnostics:[r],kind:ne.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ne.TextEdit.replace(ne.Range.create(ne.Position.create(r.range.start.line,n.pos.colEnd),ne.Position.create(r.range.end.line,e.pos.col)),"")]}}}];case 3:return[{title:"Add close curly",diagnostics:[r],kind:ne.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[ne.TextEdit.insert(ne.Position.create(r.range.end.line,r.range.end.character),"}")]}}}];case 19:return[{title:"Add '/'",diagnostics:[r],kind:ne.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[ne.TextEdit.insert(ne.Position.create(r.range.end.line,r.range.end.character),"/")]}}}];case 28:return[{title:"Add comma",diagnostics:[r],kind:ne.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ne.TextEdit.insert(ne.Position.create(r.range.end.line,r.range.end.character),",")]}}}];case 21:return[{title:"Add '/'",diagnostics:[r],kind:ne.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ne.TextEdit.insert(ne.Position.create(r.range.end.line,r.range.end.character),"/")]}}}];case 23:return[{title:"Remove ';'",diagnostics:[r],kind:ne.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ne.TextEdit.del(r.range)]}}}];case 34:return[{title:"Complete Keyword '/delete-node/",diagnostics:[r],kind:ne.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ne.TextEdit.replace(r.range,"/delete-node/")]}}}];case 35:return[{title:"Complete Keyword '/delete-property/",diagnostics:[r],kind:ne.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ne.TextEdit.replace(r.range,"/delete-property/")]}}}];case 25:return[{title:"Complete Keyword '/delete-property/",diagnostics:[r],kind:ne.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[ne.TextEdit.replace(r.range,"/delete-property/")]}}},{title:"Complete Keyword '/delete-node/",diagnostics:[r],kind:ne.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[ne.TextEdit.replace(r.range,"/delete-node/")]}}}];case 12:return[{title:"Add '>'",diagnostics:[r],kind:ne.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[ne.TextEdit.insert(ne.Position.create(r.range.end.line,r.range.end.character),">")]}}}];default:return}},T$=(n,e,t,r,s)=>{if(!r)return[];switch(n){case 0:return[{title:s??`Add Property "${r.newText.split("=",1)[0].replace(";","").trim()}"`,diagnostics:[e],kind:ne.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[t]:[r]}}}];case 28:return[{title:s??"Remove Property",diagnostics:[e],kind:ne.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[t]:[r]}}}];case 27:return[{title:s??"TODO",diagnostics:[e],kind:ne.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[t]:[r]}}}];case 26:return r?[{title:s??"TODO",diagnostics:[e],kind:ne.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[t]:[r]}}}]:[];default:return}};function qN(n){let e=n.context.diagnostics.flatMap(a=>{let c=a.data;switch(c?.issues.type){case"SyntaxIssue":return c?.issues.items.flatMap(l=>v$(c.firstToken,c.lastToken,l,a,n.textDocument.uri));case"StandardTypeIssue":return c?.issues.items.flatMap(l=>T$(l,a,n.textDocument.uri,c.issues.edit,c.issues.codeActionTitle))}}).filter(a=>!!a),t=e.filter(a=>a.kind===ne.CodeActionKind.SourceFixAll),r=e.filter(a=>a.title.startsWith("Add Property")),s=e.filter(a=>a.kind!==ne.CodeActionKind.SourceFixAll),i=t.flatMap(a=>a.edit?.changes?.[n.textDocument.uri]??[]),o=new Map;return r.forEach(a=>{let c=a.edit.changes[n.textDocument.uri][0],l=c.range.start.line,u=c.range.start.character;o.has(`${l}:${u}`)||o.set(`${l}:${u}`,[]),o.get(`${l}:${u}`)?.push(c)}),[...s,...t.map(a=>({...a,kind:ne.CodeActionKind.QuickFix})),...i.length?[{title:"Fix All",kind:ne.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[n.textDocument.uri]:i}}}]:[],...Array.from(o.values()).flatMap(a=>a.length>1?{title:"Add All Missing Properties",kind:ne.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[n.textDocument.uri]:a}}}:[])]}var Yd=n=>!n||n instanceof xe?!1:n instanceof ln||Yd(n.parentNode);function S$(n){if(!n||!(n.item instanceof ze&&n.item.ast.assignOperatorToken))return[];let e=Yd(n?.ast);if(!e&&!(n.ast instanceof xe&&n.item.ast.values===null)&&!Yd(n.beforeAst)&&!Yd(n.afterAst))return[];let t=-1;n.item.ast.values===null?t=0:t=(n.item.ast.values?.values.findIndex(s=>s&&og(s,n.beforeAst))??-1)+1,t===-1&&(t=0);let r=n.item.parent.nodeType;return r instanceof Sn?r.properties.find(s=>s.name===n.item?.name)?.getPropertyCompletionItems(n.item,t,e)??[]:[]}function _$(n){if(!n||!(n.item instanceof ze&&n.ast instanceof je&&n.item.ast.values==null||n.item instanceof Se)||Pt(n.ast)||n.beforeAst?.parentNode instanceof cn)return[];let e=t=>t.nodeType?.getPropertyListCompletionItems(t)??[];return n.item instanceof ze?e(n.item.parent):e(n.item)}async function jN(n,e){return Nt(n,e,t=>[...S$(t),..._$(t)])}var yg=K(X());function FN(n){return!n||n instanceof Ps?n:FN(n.parentNode)}async function E$(n){if(n?.ast instanceof Ut||n?.ast instanceof Cr){let e=n.runtime.context.parser.cPreprocessorParser.macros.get(n?.ast instanceof Ut?n.ast.name:n.ast.value);if(e){let t=FN(n.ast),r=(await n.runtime.context.getAllParsers()).at(-1);if(t){let s=t?.evaluate(r.cPreprocessorParser.macros);return{contents:{kind:yg.MarkupKind.Markdown,value:["```cpp",`#define ${e.macro.toString()} // = ${s}${typeof s=="number"?` (0x${s.toString(16)})`:""}`,"```"].join(`
276
- `)},range:Z(n.ast)}}return{contents:{kind:yg.MarkupKind.Markdown,value:["```cpp",`#define ${e.macro.toString()} // = ${n.ast?.evaluate(r.cPreprocessorParser.macros)}`,"```"].join(`
277
- `)},range:Z(n.ast)}}}}async function w$(n){if(!n)return;let e=(await n.runtime.context.getAllParsers()).at(-1);if(n?.item instanceof Se)return{contents:n.item.toMarkupContent(e.cPreprocessorParser.macros),range:Z(n.ast)};if(n?.ast instanceof Me){let t=n.ast.linksTo;if(t)return{contents:t.toMarkupContent(e.cPreprocessorParser.macros),range:Z(n.ast)}}if(n?.ast.parentNode instanceof ye){let t=n.ast.parentNode.linksTo;if(t)return{contents:t.toMarkupContent(e.cPreprocessorParser.macros),range:Z(n.ast)}}if(n?.ast instanceof Ie&&n.item instanceof ze&&n.item.parent.name==="aliases"){let t=n.runtime.rootNode.getChild(n.ast.value.split("/"));if(t)return{contents:t.toMarkupContent(e.cPreprocessorParser.macros),range:Z(n.ast)}}}function k$(n){if(n?.item instanceof ze&&n.ast instanceof je){let e=n.item.parent.nodeType?.getOnPropertyHover(n.item.name);if(e)return{contents:e,range:Z(n.ast)}}}function BN(n,e){return Nt(n,e,async t=>[await w$(t)||k$(t)||await E$(t)])}var yT=K(Qy());var Y0=K(B0(),1);var Nc=n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>65536)throw new TypeError("pattern is too long")};var rF={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Pc=n=>n.replace(/[[\]\\-]/g,"\\$&"),sF=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),U0=n=>n.join(""),V0=(n,e)=>{let t=e;if(n.charAt(t)!=="[")throw new Error("not in a brace expression");let r=[],s=[],i=t+1,o=!1,a=!1,c=!1,l=!1,u=t,d="";e:for(;i<n.length;){let m=n.charAt(i);if((m==="!"||m==="^")&&i===t+1){l=!0,i++;continue}if(m==="]"&&o&&!c){u=i+1;break}if(o=!0,m==="\\"&&!c){c=!0,i++;continue}if(m==="["&&!c){for(let[S,[w,T,v]]of Object.entries(rF))if(n.startsWith(S,i)){if(d)return["$.",!1,n.length-t,!0];i+=S.length,v?s.push(w):r.push(w),a=a||T;continue e}}if(c=!1,d){m>d?r.push(Pc(d)+"-"+Pc(m)):m===d&&r.push(Pc(m)),d="",i++;continue}if(n.startsWith("-]",i+1)){r.push(Pc(m+"-")),i+=2;continue}if(n.startsWith("-",i+1)){d=m,i+=2;continue}r.push(Pc(m)),i++}if(u<i)return["",!1,0,!1];if(!r.length&&!s.length)return["$.",!1,n.length-t,!0];if(s.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let m=r[0].length===2?r[0].slice(-1):r[0];return[sF(m),!1,u-t,!1]}let f="["+(l?"^":"")+U0(r)+"]",p="["+(l?"":"^")+U0(s)+"]";return[r.length&&s.length?"("+f+"|"+p+")":r.length?f:p,a,u-t,!0]};var mr=(n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/\[([^\/\\])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var iF=new Set(["!","?","+","*","@"]),W0=n=>iF.has(n),oF="(?!(?:^|/)\\.\\.?(?:$|/))",Gf="(?!\\.)",aF=new Set(["[","."]),cF=new Set(["..","."]),lF=new Set("().*{}+?[]^$\\!"),uF=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),tb="[^/]",z0=tb+"*?",H0=tb+"+?",Bo=class n{type;#e;#t;#i=!1;#n=[];#r;#T;#l;#d=!1;#a;#c;#o=!1;constructor(e,t,r={}){this.type=e,e&&(this.#t=!0),this.#r=t,this.#e=this.#r?this.#r.#e:this,this.#a=this.#e===this?r:this.#e.#a,this.#l=this.#e===this?[]:this.#e.#l,e==="!"&&!this.#e.#d&&this.#l.push(this),this.#T=this.#r?this.#r.#n.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#n)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#n.map(e=>String(e)).join("|")+")":this.#c=this.#n.map(e=>String(e)).join("")}#g(){if(this!==this.#e)throw new Error("should only call on root");if(this.#d)return this;this.toString(),this.#d=!0;let e;for(;e=this.#l.pop();){if(e.type!=="!")continue;let t=e,r=t.#r;for(;r;){for(let s=t.#T+1;!r.type&&s<r.#n.length;s++)for(let i of e.#n){if(typeof i=="string")throw new Error("string part in extglob AST??");i.copyIn(r.#n[s])}t=r,r=t.#r}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof n&&t.#r===this))throw new Error("invalid part: "+t);this.#n.push(t)}}toJSON(){let e=this.type===null?this.#n.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#n.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#d&&this.#r?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#r?.isStart())return!1;if(this.#T===0)return!0;let e=this.#r;for(let t=0;t<this.#T;t++){let r=e.#n[t];if(!(r instanceof n&&r.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#r?.type==="!")return!0;if(!this.#r?.isEnd())return!1;if(!this.type)return this.#r?.isEnd();let e=this.#r?this.#r.#n.length:0;return this.#T===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new n(this.type,e);for(let r of this.#n)t.copyIn(r);return t}static#y(e,t,r,s){let i=!1,o=!1,a=-1,c=!1;if(t.type===null){let p=r,y="";for(;p<e.length;){let m=e.charAt(p++);if(i||m==="\\"){i=!i,y+=m;continue}if(o){p===a+1?(m==="^"||m==="!")&&(c=!0):m==="]"&&!(p===a+2&&c)&&(o=!1),y+=m;continue}else if(m==="["){o=!0,a=p,c=!1,y+=m;continue}if(!s.noext&&W0(m)&&e.charAt(p)==="("){t.push(y),y="";let S=new n(m,t);p=n.#y(e,S,p,s),t.push(S);continue}y+=m}return t.push(y),p}let l=r+1,u=new n(null,t),d=[],f="";for(;l<e.length;){let p=e.charAt(l++);if(i||p==="\\"){i=!i,f+=p;continue}if(o){l===a+1?(p==="^"||p==="!")&&(c=!0):p==="]"&&!(l===a+2&&c)&&(o=!1),f+=p;continue}else if(p==="["){o=!0,a=l,c=!1,f+=p;continue}if(W0(p)&&e.charAt(l)==="("){u.push(f),f="";let y=new n(p,u);u.push(y),l=n.#y(e,y,l,s);continue}if(p==="|"){u.push(f),f="",d.push(u),u=new n(null,t);continue}if(p===")")return f===""&&t.#n.length===0&&(t.#o=!0),u.push(f),f="",t.push(...d,u),l;f+=p}return t.type=null,t.#t=void 0,t.#n=[e.substring(r-1)],l}static fromGlob(e,t={}){let r=new n(null,void 0,t);return n.#y(e,r,0,t),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,r,s,i]=this.toRegExpSource();if(!(s||this.#t||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let a=(this.#a.nocase?"i":"")+(i?"u":"");return Object.assign(new RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#a}toRegExpSource(e){let t=e??!!this.#a.dot;if(this.#e===this&&this.#g(),!this.type){let c=this.isStart()&&this.isEnd(),l=this.#n.map(p=>{let[y,m,S,w]=typeof p=="string"?n.#f(p,this.#t,c):p.toRegExpSource(e);return this.#t=this.#t||S,this.#i=this.#i||w,y}).join(""),u="";if(this.isStart()&&typeof this.#n[0]=="string"&&!(this.#n.length===1&&cF.has(this.#n[0]))){let y=aF,m=t&&y.has(l.charAt(0))||l.startsWith("\\.")&&y.has(l.charAt(2))||l.startsWith("\\.\\.")&&y.has(l.charAt(4)),S=!t&&!e&&y.has(l.charAt(0));u=m?oF:S?Gf:""}let d="";return this.isEnd()&&this.#e.#d&&this.#r?.type==="!"&&(d="(?:$|\\/)"),[u+l+d,mr(l),this.#t=!!this.#t,this.#i]}let r=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:",i=this.#h(t);if(this.isStart()&&this.isEnd()&&!i&&this.type!=="!"){let c=this.toString();return this.#n=[c],this.type=null,this.#t=void 0,[c,mr(this.toString()),!1,!1]}let o=!r||e||t||!Gf?"":this.#h(!0);o===i&&(o=""),o&&(i=`(?:${i})(?:${o})*?`);let a="";if(this.type==="!"&&this.#o)a=(this.isStart()&&!t?Gf:"")+H0;else{let c=this.type==="!"?"))"+(this.isStart()&&!t&&!e?Gf:"")+z0+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=s+i+c}return[a,mr(i),this.#t=!!this.#t,this.#i]}#h(e){return this.#n.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[r,s,i,o]=t.toRegExpSource(e);return this.#i=this.#i||o,r}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#f(e,t,r=!1){let s=!1,i="",o=!1;for(let a=0;a<e.length;a++){let c=e.charAt(a);if(s){s=!1,i+=(lF.has(c)?"\\":"")+c;continue}if(c==="\\"){a===e.length-1?i+="\\\\":s=!0;continue}if(c==="["){let[l,u,d,f]=V0(e,a);if(d){i+=l,o=o||u,a+=d-1,t=t||f;continue}}if(c==="*"){r&&e==="*"?i+=H0:i+=z0,t=!0;continue}if(c==="?"){i+=tb,t=!0;continue}i+=uF(c)}return[i,mr(e),!!t,o]}};var Uo=(n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/[?*()[\]]/g,"[$&]"):n.replace(/[?*()[\]\\]/g,"\\$&");var un=(n,e,t={})=>(Nc(e),!t.nocomment&&e.charAt(0)==="#"?!1:new xn(e,t).match(n)),dF=/^\*+([^+@!?\*\[\(]*)$/,fF=n=>e=>!e.startsWith(".")&&e.endsWith(n),hF=n=>e=>e.endsWith(n),pF=n=>(n=n.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(n)),mF=n=>(n=n.toLowerCase(),e=>e.toLowerCase().endsWith(n)),gF=/^\*+\.\*+$/,yF=n=>!n.startsWith(".")&&n.includes("."),bF=n=>n!=="."&&n!==".."&&n.includes("."),vF=/^\.\*+$/,TF=n=>n!=="."&&n!==".."&&n.startsWith("."),SF=/^\*+$/,_F=n=>n.length!==0&&!n.startsWith("."),EF=n=>n.length!==0&&n!=="."&&n!=="..",wF=/^\?+([^+@!?\*\[\(]*)?$/,kF=([n,e=""])=>{let t=J0([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},NF=([n,e=""])=>{let t=X0([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},PF=([n,e=""])=>{let t=X0([n]);return e?r=>t(r)&&r.endsWith(e):t},RF=([n,e=""])=>{let t=J0([n]);return e?r=>t(r)&&r.endsWith(e):t},J0=([n])=>{let e=n.length;return t=>t.length===e&&!t.startsWith(".")},X0=([n])=>{let e=n.length;return t=>t.length===e&&t!=="."&&t!==".."},Q0=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",K0={win32:{sep:"\\"},posix:{sep:"/"}},DF=Q0==="win32"?K0.win32.sep:K0.posix.sep;un.sep=DF;var Wt=Symbol("globstar **");un.GLOBSTAR=Wt;var CF="[^/]",AF=CF+"*?",OF="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",IF="(?:(?!(?:\\/|^)\\.).)*?",xF=(n,e={})=>t=>un(t,n,e);un.filter=xF;var Hn=(n,e={})=>Object.assign({},n,e),MF=n=>{if(!n||typeof n!="object"||!Object.keys(n).length)return un;let e=un;return Object.assign((r,s,i={})=>e(r,s,Hn(n,i)),{Minimatch:class extends e.Minimatch{constructor(s,i={}){super(s,Hn(n,i))}static defaults(s){return e.defaults(Hn(n,s)).Minimatch}},AST:class extends e.AST{constructor(s,i,o={}){super(s,i,Hn(n,o))}static fromGlob(s,i={}){return e.AST.fromGlob(s,Hn(n,i))}},unescape:(r,s={})=>e.unescape(r,Hn(n,s)),escape:(r,s={})=>e.escape(r,Hn(n,s)),filter:(r,s={})=>e.filter(r,Hn(n,s)),defaults:r=>e.defaults(Hn(n,r)),makeRe:(r,s={})=>e.makeRe(r,Hn(n,s)),braceExpand:(r,s={})=>e.braceExpand(r,Hn(n,s)),match:(r,s,i={})=>e.match(r,s,Hn(n,i)),sep:e.sep,GLOBSTAR:Wt})};un.defaults=MF;var Z0=(n,e={})=>(Nc(n),e.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:(0,Y0.default)(n));un.braceExpand=Z0;var $F=(n,e={})=>new xn(n,e).makeRe();un.makeRe=$F;var LF=(n,e,t={})=>{let r=new xn(e,t);return n=n.filter(s=>r.match(s)),r.options.nonull&&!n.length&&n.push(e),n};un.match=LF;var G0=/[?*]|[+@!]\(.*?\)|\[|\]/,qF=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),xn=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){Nc(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||Q0,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...i)=>console.error(...i)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(i=>this.slashSplit(i));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let s=this.globParts.map((i,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=i[0]===""&&i[1]===""&&(i[2]==="?"||!G0.test(i[2]))&&!G0.test(i[3]),l=/^[a-z]:/i.test(i[0]);if(c)return[...i.slice(0,4),...i.slice(4).map(u=>this.parse(u))];if(l)return[i[0],...i.slice(1).map(u=>this.parse(u))]}return i.map(c=>this.parse(c))});if(this.debug(this.pattern,s),this.set=s.filter(i=>i.indexOf(!1)===-1),this.isWindows)for(let i=0;i<this.set.length;i++){let o=this.set[i];o[0]===""&&o[1]===""&&this.globParts[i][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let r=0;r<e.length;r++)for(let s=0;s<e[r].length;s++)e[r][s]==="**"&&(e[r][s]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let r=-1;for(;(r=t.indexOf("**",r+1))!==-1;){let s=r;for(;t[s+1]==="**";)s++;s!==r&&t.splice(r,s-r)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((r,s)=>{let i=r[r.length-1];return s==="**"&&i==="**"?r:s===".."&&i&&i!==".."&&i!=="."&&i!=="**"?(r.pop(),r):(r.push(s),r)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let s=1;s<e.length-1;s++){let i=e[s];s===1&&i===""&&e[0]===""||(i==="."||i==="")&&(t=!0,e.splice(s,1),s--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let s=e[r-1];s&&s!=="."&&s!==".."&&s!=="**"&&(t=!0,e.splice(r-1,2),r-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let r of e){let s=-1;for(;(s=r.indexOf("**",s+1))!==-1;){let o=s;for(;r[o+1]==="**";)o++;o>s&&r.splice(s+1,o-s);let a=r[s+1],c=r[s+2],l=r[s+3];if(a!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;t=!0,r.splice(s,1);let u=r.slice(0);u[s]="**",e.push(u),s--}if(!this.preserveMultipleSlashes){for(let o=1;o<r.length-1;o++){let a=r[o];o===1&&a===""&&r[0]===""||(a==="."||a==="")&&(t=!0,r.splice(o,1),o--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(t=!0,r.pop())}let i=0;for(;(i=r.indexOf("..",i+1))!==-1;){let o=r[i-1];if(o&&o!=="."&&o!==".."&&o!=="**"){t=!0;let c=i===1&&r[i+1]==="**"?["."]:[];r.splice(i-1,2,...c),r.length===0&&r.push(""),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let r=t+1;r<e.length;r++){let s=this.partsMatch(e[t],e[r],!this.preserveMultipleSlashes);if(s){e[t]=[],e[r]=s;break}}return e.filter(t=>t.length)}partsMatch(e,t,r=!1){let s=0,i=0,o=[],a="";for(;s<e.length&&i<t.length;)if(e[s]===t[i])o.push(a==="b"?t[i]:e[s]),s++,i++;else if(r&&e[s]==="**"&&t[i]===e[s+1])o.push(e[s]),s++;else if(r&&t[i]==="**"&&e[s]===t[i+1])o.push(t[i]),i++;else if(e[s]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(a==="b")return!1;a="a",o.push(e[s]),s++,i++}else if(t[i]==="*"&&e[s]&&(this.options.dot||!e[s].startsWith("."))&&e[s]!=="**"){if(a==="a")return!1;a="b",o.push(t[i]),s++,i++}else return!1;return e.length===t.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,r=0;for(let s=0;s<e.length&&e.charAt(s)==="!";s++)t=!t,r++;r&&(this.pattern=e.slice(r)),this.negate=t}matchOne(e,t,r=!1){let s=this.options;if(this.isWindows){let m=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),S=!m&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),w=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),T=!w&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),v=S?3:m?0:void 0,R=T?3:w?0:void 0;if(typeof v=="number"&&typeof R=="number"){let[A,M]=[e[v],t[R]];A.toLowerCase()===M.toLowerCase()&&(t[R]=A,R>v?t=t.slice(R):v>R&&(e=e.slice(v)))}}let{optimizationLevel:i=1}=this.options;i>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var o=0,a=0,c=e.length,l=t.length;o<c&&a<l;o++,a++){this.debug("matchOne loop");var u=t[a],d=e[o];if(this.debug(t,u,d),u===!1)return!1;if(u===Wt){this.debug("GLOBSTAR",[t,u,d]);var f=o,p=a+1;if(p===l){for(this.debug("** at the end");o<c;o++)if(e[o]==="."||e[o]===".."||!s.dot&&e[o].charAt(0)===".")return!1;return!0}for(;f<c;){var y=e[f];if(this.debug(`
278
- globstar while`,e,f,t,p,y),this.matchOne(e.slice(f),t.slice(p),r))return this.debug("globstar found match!",f,c,y),!0;if(y==="."||y===".."||!s.dot&&y.charAt(0)==="."){this.debug("dot detected!",e,f,t,p);break}this.debug("globstar swallow a segment, and continue"),f++}return!!(r&&(this.debug(`
279
- >>> no match, partial?`,e,f,t,p),f===c))}let m;if(typeof u=="string"?(m=d===u,this.debug("string match",u,d,m)):(m=u.test(d),this.debug("pattern match",u,d,m)),!m)return!1}if(o===c&&a===l)return!0;if(o===c)return r;if(a===l)return o===c-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return Z0(this.pattern,this.options)}parse(e){Nc(e);let t=this.options;if(e==="**")return Wt;if(e==="")return"";let r,s=null;(r=e.match(SF))?s=t.dot?EF:_F:(r=e.match(dF))?s=(t.nocase?t.dot?mF:pF:t.dot?hF:fF)(r[1]):(r=e.match(wF))?s=(t.nocase?t.dot?NF:kF:t.dot?PF:RF)(r):(r=e.match(gF))?s=t.dot?bF:yF:(r=e.match(vF))&&(s=TF);let i=Bo.fromGlob(e,this.options).toMMPattern();return s&&typeof i=="object"&&Reflect.defineProperty(i,"test",{value:s}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,r=t.noglobstar?AF:t.dot?OF:IF,s=new Set(t.nocase?["i"]:[]),i=e.map(c=>{let l=c.map(u=>{if(u instanceof RegExp)for(let d of u.flags.split(""))s.add(d);return typeof u=="string"?qF(u):u===Wt?Wt:u._src});return l.forEach((u,d)=>{let f=l[d+1],p=l[d-1];u!==Wt||p===Wt||(p===void 0?f!==void 0&&f!==Wt?l[d+1]="(?:\\/|"+r+"\\/)?"+f:l[d]=r:f===void 0?l[d-1]=p+"(?:\\/|"+r+")?":f!==Wt&&(l[d-1]=p+"(?:\\/|\\/"+r+"\\/)"+f,l[d+1]=Wt))}),l.filter(u=>u!==Wt).join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];i="^"+o+i+a+"$",this.negate&&(i="^(?!"+i+").+$");try{this.regexp=new RegExp(i,[...s].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let s=this.slashSplit(e);this.debug(this.pattern,"split",s);let i=this.set;this.debug(this.pattern,"set",i);let o=s[s.length-1];if(!o)for(let a=s.length-2;!o&&a>=0;a--)o=s[a];for(let a=0;a<i.length;a++){let c=i[a],l=s;if(r.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,t))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return un.defaults(e).Minimatch}};un.AST=Bo;un.Minimatch=xn;un.escape=Uo;un.unescape=mr;var ED=require("node:url");var Vo=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,tD=new Set,nb=typeof process=="object"&&process?process:{},nD=(n,e,t,r)=>{typeof nb.emitWarning=="function"?nb.emitWarning(n,e,t,r):console.error(`[${t}] ${e}: ${n}`)},Yf=globalThis.AbortController,eD=globalThis.AbortSignal;if(typeof Yf>"u"){eD=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(r,s){this._onabort.push(s)}},Yf=class{constructor(){e()}signal=new eD;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let s of this.signal._onabort)s(r);this.signal.onabort?.(r)}}};let n=nb.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{n&&(n=!1,nD("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var jF=n=>!tD.has(n),Hee=Symbol("type"),js=n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),rD=n=>js(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?Wo:null:null,Wo=class extends Array{constructor(e){super(e),this.fill(0)}},rb=class n{heap;length;static#e=!1;static create(e){let t=rD(e);if(!t)return[];n.#e=!0;let r=new n(e,t);return n.#e=!1,r}constructor(e,t){if(!n.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Rc=class n{#e;#t;#i;#n;#r;#T;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#d;#a;#c;#o;#g;#y;#h;#f;#E;#m;#w;#k;#v;#S;#_;#p;static unsafeExposeInternals(e){return{starts:e.#k,ttls:e.#v,sizes:e.#w,keyMap:e.#a,keyList:e.#c,valList:e.#o,next:e.#g,prev:e.#y,get head(){return e.#h},get tail(){return e.#f},free:e.#E,isBackgroundFetch:t=>e.#u(t),backgroundFetch:(t,r,s,i)=>e.#q(t,r,s,i),moveToTail:t=>e.#F(t),indexes:t=>e.#P(t),rindexes:t=>e.#R(t),isStale:t=>e.#b(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#d}get size(){return this.#l}get fetchMethod(){return this.#r}get memoMethod(){return this.#T}get dispose(){return this.#i}get disposeAfter(){return this.#n}constructor(e){let{max:t=0,ttl:r,ttlResolution:s=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:f,maxSize:p=0,maxEntrySize:y=0,sizeCalculation:m,fetchMethod:S,memoMethod:w,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:v,allowStaleOnFetchRejection:R,allowStaleOnFetchAbort:A,ignoreFetchAbort:M}=e;if(t!==0&&!js(t))throw new TypeError("max option must be a nonnegative integer");let z=t?rD(t):Array;if(!z)throw new Error("invalid max value: "+t);if(this.#e=t,this.#t=p,this.maxEntrySize=y||this.#t,this.sizeCalculation=m,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(w!==void 0&&typeof w!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#T=w,S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#r=S,this.#_=!!S,this.#a=new Map,this.#c=new Array(t).fill(void 0),this.#o=new Array(t).fill(void 0),this.#g=new z(t),this.#y=new z(t),this.#h=0,this.#f=0,this.#E=rb.create(t),this.#l=0,this.#d=0,typeof l=="function"&&(this.#i=l),typeof u=="function"?(this.#n=u,this.#m=[]):(this.#n=void 0,this.#m=void 0),this.#S=!!this.#i,this.#p=!!this.#n,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!T,this.allowStaleOnFetchRejection=!!R,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!M,this.maxEntrySize!==0){if(this.#t!==0&&!js(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!js(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#C()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!v,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=js(s)||s===0?s:1,this.ttlAutopurge=!!i,this.ttl=r||0,this.ttl){if(!js(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#D()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let j="LRU_CACHE_UNBOUNDED";jF(j)&&(tD.add(j),nD("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",j,n))}}getRemainingTTL(e){return this.#a.has(e)?1/0:0}#D(){let e=new Wo(this.#e),t=new Wo(this.#e);this.#v=e,this.#k=t,this.#O=(i,o,a=Vo.now())=>{if(t[i]=o!==0?a:0,e[i]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#b(i)&&this.#A(this.#c[i],"expire")},o+1);c.unref&&c.unref()}},this.#N=i=>{t[i]=e[i]!==0?Vo.now():0},this.#s=(i,o)=>{if(e[o]){let a=e[o],c=t[o];if(!a||!c)return;i.ttl=a,i.start=c,i.now=r||s();let l=i.now-c;i.remainingTTL=a-l}};let r=0,s=()=>{let i=Vo.now();if(this.ttlResolution>0){r=i;let o=setTimeout(()=>r=0,this.ttlResolution);o.unref&&o.unref()}return i};this.getRemainingTTL=i=>{let o=this.#a.get(i);if(o===void 0)return 0;let a=e[o],c=t[o];if(!a||!c)return 1/0;let l=(r||s())-c;return a-l},this.#b=i=>{let o=t[i],a=e[i];return!!a&&!!o&&(r||s())-o>a}}#N=()=>{};#s=()=>{};#O=()=>{};#b=()=>!1;#C(){let e=new Wo(this.#e);this.#d=0,this.#w=e,this.#I=t=>{this.#d-=e[t],e[t]=0},this.#M=(t,r,s,i)=>{if(this.#u(r))return 0;if(!js(s))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(s=i(r,t),!js(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#x=(t,r,s)=>{if(e[t]=r,this.#t){let i=this.#t-e[t];for(;this.#d>i;)this.#L(!0)}this.#d+=e[t],s&&(s.entrySize=r,s.totalCalculatedSize=this.#d)}}#I=e=>{};#x=(e,t,r)=>{};#M=(e,t,r,s)=>{if(r||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#P({allowStale:e=this.allowStale}={}){if(this.#l)for(let t=this.#f;!(!this.#$(t)||((e||!this.#b(t))&&(yield t),t===this.#h));)t=this.#y[t]}*#R({allowStale:e=this.allowStale}={}){if(this.#l)for(let t=this.#h;!(!this.#$(t)||((e||!this.#b(t))&&(yield t),t===this.#f));)t=this.#g[t]}#$(e){return e!==void 0&&this.#a.get(this.#c[e])===e}*entries(){for(let e of this.#P())this.#o[e]!==void 0&&this.#c[e]!==void 0&&!this.#u(this.#o[e])&&(yield[this.#c[e],this.#o[e]])}*rentries(){for(let e of this.#R())this.#o[e]!==void 0&&this.#c[e]!==void 0&&!this.#u(this.#o[e])&&(yield[this.#c[e],this.#o[e]])}*keys(){for(let e of this.#P()){let t=this.#c[e];t!==void 0&&!this.#u(this.#o[e])&&(yield t)}}*rkeys(){for(let e of this.#R()){let t=this.#c[e];t!==void 0&&!this.#u(this.#o[e])&&(yield t)}}*values(){for(let e of this.#P())this.#o[e]!==void 0&&!this.#u(this.#o[e])&&(yield this.#o[e])}*rvalues(){for(let e of this.#R())this.#o[e]!==void 0&&!this.#u(this.#o[e])&&(yield this.#o[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#P()){let s=this.#o[r],i=this.#u(s)?s.__staleWhileFetching:s;if(i!==void 0&&e(i,this.#c[r],this))return this.get(this.#c[r],t)}}forEach(e,t=this){for(let r of this.#P()){let s=this.#o[r],i=this.#u(s)?s.__staleWhileFetching:s;i!==void 0&&e.call(t,i,this.#c[r],this)}}rforEach(e,t=this){for(let r of this.#R()){let s=this.#o[r],i=this.#u(s)?s.__staleWhileFetching:s;i!==void 0&&e.call(t,i,this.#c[r],this)}}purgeStale(){let e=!1;for(let t of this.#R({allowStale:!0}))this.#b(t)&&(this.#A(this.#c[t],"expire"),e=!0);return e}info(e){let t=this.#a.get(e);if(t===void 0)return;let r=this.#o[t],s=this.#u(r)?r.__staleWhileFetching:r;if(s===void 0)return;let i={value:s};if(this.#v&&this.#k){let o=this.#v[t],a=this.#k[t];if(o&&a){let c=o-(Vo.now()-a);i.ttl=c,i.start=Date.now()}}return this.#w&&(i.size=this.#w[t]),i}dump(){let e=[];for(let t of this.#P({allowStale:!0})){let r=this.#c[t],s=this.#o[t],i=this.#u(s)?s.__staleWhileFetching:s;if(i===void 0||r===void 0)continue;let o={value:i};if(this.#v&&this.#k){o.ttl=this.#v[t];let a=Vo.now()-this.#k[t];o.start=Math.floor(Date.now()-a)}this.#w&&(o.size=this.#w[t]),e.unshift([r,o])}return e}load(e){this.clear();for(let[t,r]of e){if(r.start){let s=Date.now()-r.start;r.start=Vo.now()-s}this.set(t,r.value,r)}}set(e,t,r={}){if(t===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=r,{noUpdateTTL:l=this.noUpdateTTL}=r,u=this.#M(e,t,r.size||0,a);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#A(e,"set"),this;let d=this.#l===0?void 0:this.#a.get(e);if(d===void 0)d=this.#l===0?this.#f:this.#E.length!==0?this.#E.pop():this.#l===this.#e?this.#L(!1):this.#l,this.#c[d]=e,this.#o[d]=t,this.#a.set(e,d),this.#g[this.#f]=d,this.#y[d]=this.#f,this.#f=d,this.#l++,this.#x(d,u,c),c&&(c.set="add"),l=!1;else{this.#F(d);let f=this.#o[d];if(t!==f){if(this.#_&&this.#u(f)){f.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=f;p!==void 0&&!o&&(this.#S&&this.#i?.(p,e,"set"),this.#p&&this.#m?.push([p,e,"set"]))}else o||(this.#S&&this.#i?.(f,e,"set"),this.#p&&this.#m?.push([f,e,"set"]));if(this.#I(d),this.#x(d,u,c),this.#o[d]=t,c){c.set="replace";let p=f&&this.#u(f)?f.__staleWhileFetching:f;p!==void 0&&(c.oldValue=p)}}else c&&(c.set="update")}if(s!==0&&!this.#v&&this.#D(),this.#v&&(l||this.#O(d,s,i),c&&this.#s(c,d)),!o&&this.#p&&this.#m){let f=this.#m,p;for(;p=f?.shift();)this.#n?.(...p)}return this}pop(){try{for(;this.#l;){let e=this.#o[this.#h];if(this.#L(!0),this.#u(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#p&&this.#m){let e=this.#m,t;for(;t=e?.shift();)this.#n?.(...t)}}}#L(e){let t=this.#h,r=this.#c[t],s=this.#o[t];return this.#_&&this.#u(s)?s.__abortController.abort(new Error("evicted")):(this.#S||this.#p)&&(this.#S&&this.#i?.(s,r,"evict"),this.#p&&this.#m?.push([s,r,"evict"])),this.#I(t),e&&(this.#c[t]=void 0,this.#o[t]=void 0,this.#E.push(t)),this.#l===1?(this.#h=this.#f=0,this.#E.length=0):this.#h=this.#g[t],this.#a.delete(r),this.#l--,t}has(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:s}=t,i=this.#a.get(e);if(i!==void 0){let o=this.#o[i];if(this.#u(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#b(i))s&&(s.has="stale",this.#s(s,i));else return r&&this.#N(i),s&&(s.has="hit",this.#s(s,i)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{allowStale:r=this.allowStale}=t,s=this.#a.get(e);if(s===void 0||!r&&this.#b(s))return;let i=this.#o[s];return this.#u(i)?i.__staleWhileFetching:i}#q(e,t,r,s){let i=t===void 0?void 0:this.#o[t];if(this.#u(i))return i;let o=new Yf,{signal:a}=r;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:r,context:s},l=(m,S=!1)=>{let{aborted:w}=o.signal,T=r.ignoreFetchAbort&&m!==void 0;if(r.status&&(w&&!S?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,T&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),w&&!T&&!S)return d(o.signal.reason);let v=p;return this.#o[t]===p&&(m===void 0?v.__staleWhileFetching?this.#o[t]=v.__staleWhileFetching:this.#A(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,m,c.options))),m},u=m=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=m),d(m)),d=m=>{let{aborted:S}=o.signal,w=S&&r.allowStaleOnFetchAbort,T=w||r.allowStaleOnFetchRejection,v=T||r.noDeleteOnFetchRejection,R=p;if(this.#o[t]===p&&(!v||R.__staleWhileFetching===void 0?this.#A(e,"fetch"):w||(this.#o[t]=R.__staleWhileFetching)),T)return r.status&&R.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),R.__staleWhileFetching;if(R.__returned===R)throw m},f=(m,S)=>{let w=this.#r?.(e,i,c);w&&w instanceof Promise&&w.then(T=>m(T===void 0?void 0:T),S),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(m(void 0),r.allowStaleOnFetchAbort&&(m=T=>l(T,!0)))})};r.status&&(r.status.fetchDispatched=!0);let p=new Promise(f).then(l,u),y=Object.assign(p,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return t===void 0?(this.set(e,y,{...c.options,status:void 0}),t=this.#a.get(e)):this.#o[t]=y,y}#u(e){if(!this.#_)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Yf}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:m,forceRefresh:S=!1,status:w,signal:T}=t;if(!this.#_)return w&&(w.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:i,status:w});let v={allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:y,ignoreFetchAbort:p,status:w,signal:T},R=this.#a.get(e);if(R===void 0){w&&(w.fetch="miss");let A=this.#q(e,R,v,m);return A.__returned=A}else{let A=this.#o[R];if(this.#u(A)){let Le=r&&A.__staleWhileFetching!==void 0;return w&&(w.fetch="inflight",Le&&(w.returnedStale=!0)),Le?A.__staleWhileFetching:A.__returned=A}let M=this.#b(R);if(!S&&!M)return w&&(w.fetch="hit"),this.#F(R),s&&this.#N(R),w&&this.#s(w,R),A;let z=this.#q(e,R,v,m),ie=z.__staleWhileFetching!==void 0&&r;return w&&(w.fetch=M?"stale":"refresh",ie&&M&&(w.returnedStale=!0)),ie?z.__staleWhileFetching:z.__returned=z}}async forceFetch(e,t={}){let r=await this.fetch(e,t);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,t={}){let r=this.#T;if(!r)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:i,...o}=t,a=this.get(e,o);if(!i&&a!==void 0)return a;let c=r(e,a,{options:o,context:s});return this.set(e,c,o),c}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=t,a=this.#a.get(e);if(a!==void 0){let c=this.#o[a],l=this.#u(c);return o&&this.#s(o,a),this.#b(a)?(o&&(o.get="stale"),l?(o&&r&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),r?c.__staleWhileFetching:void 0):(i||this.#A(e,"expire"),o&&r&&(o.returnedStale=!0),r?c:void 0)):(o&&(o.get="hit"),l?c.__staleWhileFetching:(this.#F(a),s&&this.#N(a),c))}else o&&(o.get="miss")}#j(e,t){this.#y[t]=e,this.#g[e]=t}#F(e){e!==this.#f&&(e===this.#h?this.#h=this.#g[e]:this.#j(this.#y[e],this.#g[e]),this.#j(this.#f,e),this.#f=e)}delete(e){return this.#A(e,"delete")}#A(e,t){let r=!1;if(this.#l!==0){let s=this.#a.get(e);if(s!==void 0)if(r=!0,this.#l===1)this.#B(t);else{this.#I(s);let i=this.#o[s];if(this.#u(i)?i.__abortController.abort(new Error("deleted")):(this.#S||this.#p)&&(this.#S&&this.#i?.(i,e,t),this.#p&&this.#m?.push([i,e,t])),this.#a.delete(e),this.#c[s]=void 0,this.#o[s]=void 0,s===this.#f)this.#f=this.#y[s];else if(s===this.#h)this.#h=this.#g[s];else{let o=this.#y[s];this.#g[o]=this.#g[s];let a=this.#g[s];this.#y[a]=this.#y[s]}this.#l--,this.#E.push(s)}}if(this.#p&&this.#m?.length){let s=this.#m,i;for(;i=s?.shift();)this.#n?.(...i)}return r}clear(){return this.#B("delete")}#B(e){for(let t of this.#R({allowStale:!0})){let r=this.#o[t];if(this.#u(r))r.__abortController.abort(new Error("deleted"));else{let s=this.#c[t];this.#S&&this.#i?.(r,s,e),this.#p&&this.#m?.push([r,s,e])}}if(this.#a.clear(),this.#o.fill(void 0),this.#c.fill(void 0),this.#v&&this.#k&&(this.#v.fill(0),this.#k.fill(0)),this.#w&&this.#w.fill(0),this.#h=0,this.#f=0,this.#E.length=0,this.#d=0,this.#l=0,this.#p&&this.#m){let t=this.#m,r;for(;r=t?.shift();)this.#n?.(...r)}}};var Ko=require("node:path"),hD=require("node:url"),Lr=require("fs"),YF=K(require("node:fs"),1),Us=require("node:fs/promises");var nh=require("node:events"),ub=K(require("node:stream"),1),cD=require("node:string_decoder"),sD=typeof process=="object"&&process?process:{stdout:null,stderr:null},FF=n=>!!n&&typeof n=="object"&&(n instanceof Bs||n instanceof ub.default||BF(n)||UF(n)),BF=n=>!!n&&typeof n=="object"&&n instanceof nh.EventEmitter&&typeof n.pipe=="function"&&n.pipe!==ub.default.Writable.prototype.pipe,UF=n=>!!n&&typeof n=="object"&&n instanceof nh.EventEmitter&&typeof n.write=="function"&&typeof n.end=="function",ts=Symbol("EOF"),ns=Symbol("maybeEmitEnd"),Fs=Symbol("emittedEnd"),Jf=Symbol("emittingEnd"),Dc=Symbol("emittedError"),Xf=Symbol("closed"),iD=Symbol("read"),Qf=Symbol("flush"),oD=Symbol("flushChunk"),gr=Symbol("encoding"),zo=Symbol("decoder"),$t=Symbol("flowing"),Cc=Symbol("paused"),Ho=Symbol("resume"),Lt=Symbol("buffer"),dn=Symbol("pipes"),qt=Symbol("bufferLength"),sb=Symbol("bufferPush"),Zf=Symbol("bufferShift"),Zt=Symbol("objectMode"),yt=Symbol("destroyed"),ib=Symbol("error"),ob=Symbol("emitData"),aD=Symbol("emitEnd"),ab=Symbol("emitEnd2"),Mr=Symbol("async"),cb=Symbol("abort"),eh=Symbol("aborted"),Ac=Symbol("signal"),Ei=Symbol("dataListeners"),Mn=Symbol("discarded"),Oc=n=>Promise.resolve().then(n),VF=n=>n(),WF=n=>n==="end"||n==="finish"||n==="prefinish",zF=n=>n instanceof ArrayBuffer||!!n&&typeof n=="object"&&n.constructor&&n.constructor.name==="ArrayBuffer"&&n.byteLength>=0,HF=n=>!Buffer.isBuffer(n)&&ArrayBuffer.isView(n),th=class{src;dest;opts;ondrain;constructor(e,t,r){this.src=e,this.dest=t,this.opts=r,this.ondrain=()=>e[Ho](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},lb=class extends th{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,r){super(e,t,r),this.proxyErrors=s=>t.emit("error",s),e.on("error",this.proxyErrors)}},KF=n=>!!n.objectMode,GF=n=>!n.objectMode&&!!n.encoding&&n.encoding!=="buffer",Bs=class extends nh.EventEmitter{[$t]=!1;[Cc]=!1;[dn]=[];[Lt]=[];[Zt];[gr];[Mr];[zo];[ts]=!1;[Fs]=!1;[Jf]=!1;[Xf]=!1;[Dc]=null;[qt]=0;[yt]=!1;[Ac];[eh]=!1;[Ei]=0;[Mn]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");KF(t)?(this[Zt]=!0,this[gr]=null):GF(t)?(this[gr]=t.encoding,this[Zt]=!1):(this[Zt]=!1,this[gr]=null),this[Mr]=!!t.async,this[zo]=this[gr]?new cD.StringDecoder(this[gr]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Lt]}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[dn]});let{signal:r}=t;r&&(this[Ac]=r,r.aborted?this[cb]():r.addEventListener("abort",()=>this[cb]()))}get bufferLength(){return this[qt]}get encoding(){return this[gr]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[Zt]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Mr]}set async(e){this[Mr]=this[Mr]||!!e}[cb](){this[eh]=!0,this.emit("abort",this[Ac]?.reason),this.destroy(this[Ac]?.reason)}get aborted(){return this[eh]}set aborted(e){}write(e,t,r){if(this[eh])return!1;if(this[ts])throw new Error("write after end");if(this[yt])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let s=this[Mr]?Oc:VF;if(!this[Zt]&&!Buffer.isBuffer(e)){if(HF(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(zF(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Zt]?(this[$t]&&this[qt]!==0&&this[Qf](!0),this[$t]?this.emit("data",e):this[sb](e),this[qt]!==0&&this.emit("readable"),r&&s(r),this[$t]):e.length?(typeof e=="string"&&!(t===this[gr]&&!this[zo]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[gr]&&(e=this[zo].write(e)),this[$t]&&this[qt]!==0&&this[Qf](!0),this[$t]?this.emit("data",e):this[sb](e),this[qt]!==0&&this.emit("readable"),r&&s(r),this[$t]):(this[qt]!==0&&this.emit("readable"),r&&s(r),this[$t])}read(e){if(this[yt])return null;if(this[Mn]=!1,this[qt]===0||e===0||e&&e>this[qt])return this[ns](),null;this[Zt]&&(e=null),this[Lt].length>1&&!this[Zt]&&(this[Lt]=[this[gr]?this[Lt].join(""):Buffer.concat(this[Lt],this[qt])]);let t=this[iD](e||null,this[Lt][0]);return this[ns](),t}[iD](e,t){if(this[Zt])this[Zf]();else{let r=t;e===r.length||e===null?this[Zf]():typeof r=="string"?(this[Lt][0]=r.slice(e),t=r.slice(0,e),this[qt]-=e):(this[Lt][0]=r.subarray(e),t=r.subarray(0,e),this[qt]-=e)}return this.emit("data",t),!this[Lt].length&&!this[ts]&&this.emit("drain"),t}end(e,t,r){return typeof e=="function"&&(r=e,e=void 0),typeof t=="function"&&(r=t,t="utf8"),e!==void 0&&this.write(e,t),r&&this.once("end",r),this[ts]=!0,this.writable=!1,(this[$t]||!this[Cc])&&this[ns](),this}[Ho](){this[yt]||(!this[Ei]&&!this[dn].length&&(this[Mn]=!0),this[Cc]=!1,this[$t]=!0,this.emit("resume"),this[Lt].length?this[Qf]():this[ts]?this[ns]():this.emit("drain"))}resume(){return this[Ho]()}pause(){this[$t]=!1,this[Cc]=!0,this[Mn]=!1}get destroyed(){return this[yt]}get flowing(){return this[$t]}get paused(){return this[Cc]}[sb](e){this[Zt]?this[qt]+=1:this[qt]+=e.length,this[Lt].push(e)}[Zf](){return this[Zt]?this[qt]-=1:this[qt]-=this[Lt][0].length,this[Lt].shift()}[Qf](e=!1){do;while(this[oD](this[Zf]())&&this[Lt].length);!e&&!this[Lt].length&&!this[ts]&&this.emit("drain")}[oD](e){return this.emit("data",e),this[$t]}pipe(e,t){if(this[yt])return e;this[Mn]=!1;let r=this[Fs];return t=t||{},e===sD.stdout||e===sD.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this[dn].push(t.proxyErrors?new lb(this,e,t):new th(this,e,t)),this[Mr]?Oc(()=>this[Ho]()):this[Ho]()),e}unpipe(e){let t=this[dn].find(r=>r.dest===e);t&&(this[dn].length===1?(this[$t]&&this[Ei]===0&&(this[$t]=!1),this[dn]=[]):this[dn].splice(this[dn].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let r=super.on(e,t);if(e==="data")this[Mn]=!1,this[Ei]++,!this[dn].length&&!this[$t]&&this[Ho]();else if(e==="readable"&&this[qt]!==0)super.emit("readable");else if(WF(e)&&this[Fs])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Dc]){let s=t;this[Mr]?Oc(()=>s.call(this,this[Dc])):s.call(this,this[Dc])}return r}removeListener(e,t){return this.off(e,t)}off(e,t){let r=super.off(e,t);return e==="data"&&(this[Ei]=this.listeners("data").length,this[Ei]===0&&!this[Mn]&&!this[dn].length&&(this[$t]=!1)),r}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Ei]=0,!this[Mn]&&!this[dn].length&&(this[$t]=!1)),t}get emittedEnd(){return this[Fs]}[ns](){!this[Jf]&&!this[Fs]&&!this[yt]&&this[Lt].length===0&&this[ts]&&(this[Jf]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Xf]&&this.emit("close"),this[Jf]=!1)}emit(e,...t){let r=t[0];if(e!=="error"&&e!=="close"&&e!==yt&&this[yt])return!1;if(e==="data")return!this[Zt]&&!r?!1:this[Mr]?(Oc(()=>this[ob](r)),!0):this[ob](r);if(e==="end")return this[aD]();if(e==="close"){if(this[Xf]=!0,!this[Fs]&&!this[yt])return!1;let i=super.emit("close");return this.removeAllListeners("close"),i}else if(e==="error"){this[Dc]=r,super.emit(ib,r);let i=!this[Ac]||this.listeners("error").length?super.emit("error",r):!1;return this[ns](),i}else if(e==="resume"){let i=super.emit("resume");return this[ns](),i}else if(e==="finish"||e==="prefinish"){let i=super.emit(e);return this.removeAllListeners(e),i}let s=super.emit(e,...t);return this[ns](),s}[ob](e){for(let r of this[dn])r.dest.write(e)===!1&&this.pause();let t=this[Mn]?!1:super.emit("data",e);return this[ns](),t}[aD](){return this[Fs]?!1:(this[Fs]=!0,this.readable=!1,this[Mr]?(Oc(()=>this[ab]()),!0):this[ab]())}[ab](){if(this[zo]){let t=this[zo].end();if(t){for(let r of this[dn])r.dest.write(t);this[Mn]||super.emit("data",t)}}for(let t of this[dn])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[Zt]||(e.dataLength=0);let t=this.promise();return this.on("data",r=>{e.push(r),this[Zt]||(e.dataLength+=r.length)}),await t,e}async concat(){if(this[Zt])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[gr]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(yt,()=>t(new Error("stream destroyed"))),this.on("error",r=>t(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Mn]=!1;let e=!1,t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return t();let s=this.read();if(s!==null)return Promise.resolve({done:!1,value:s});if(this[ts])return t();let i,o,a=d=>{this.off("data",c),this.off("end",l),this.off(yt,u),t(),o(d)},c=d=>{this.off("error",a),this.off("end",l),this.off(yt,u),this.pause(),i({value:d,done:!!this[ts]})},l=()=>{this.off("error",a),this.off("data",c),this.off(yt,u),t(),i({done:!0,value:void 0})},u=()=>a(new Error("stream destroyed"));return new Promise((d,f)=>{o=f,i=d,this.once(yt,u),this.once("error",a),this.once("end",l),this.once("data",c)})},throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Mn]=!1;let e=!1,t=()=>(this.pause(),this.off(ib,t),this.off(yt,t),this.off("end",t),e=!0,{done:!0,value:void 0}),r=()=>{if(e)return t();let s=this.read();return s===null?t():{done:!1,value:s}};return this.once("end",t),this.once(ib,t),this.once(yt,t),{next:r,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[yt])return e?this.emit("error",e):this.emit(yt),this;this[yt]=!0,this[Mn]=!0,this[Lt].length=0,this[qt]=0;let t=this;return typeof t.close=="function"&&!this[Xf]&&t.close(),e?this.emit("error",e):this.emit(yt),this}static get isStream(){return FF}};var JF=Lr.realpathSync.native,xc={lstatSync:Lr.lstatSync,readdir:Lr.readdir,readdirSync:Lr.readdirSync,readlinkSync:Lr.readlinkSync,realpathSync:JF,promises:{lstat:Us.lstat,readdir:Us.readdir,readlink:Us.readlink,realpath:Us.realpath}},pD=n=>!n||n===xc||n===YF?xc:{...xc,...n,promises:{...xc.promises,...n.promises||{}}},mD=/^\\\\\?\\([a-z]:)\\?$/i,XF=n=>n.replace(/\//g,"\\").replace(mD,"$1\\"),QF=/[\\\/]/,Gn=0,gD=1,yD=2,$r=4,bD=6,vD=8,wi=10,TD=12,Kn=15,Ic=~Kn,db=16,lD=32,Mc=64,yr=128,rh=256,ih=512,uD=Mc|yr|ih,ZF=1023,fb=n=>n.isFile()?vD:n.isDirectory()?$r:n.isSymbolicLink()?wi:n.isCharacterDevice()?yD:n.isBlockDevice()?bD:n.isSocket()?TD:n.isFIFO()?gD:Gn,dD=new Map,$c=n=>{let e=dD.get(n);if(e)return e;let t=n.normalize("NFKD");return dD.set(n,t),t},fD=new Map,sh=n=>{let e=fD.get(n);if(e)return e;let t=$c(n.toLowerCase());return fD.set(n,t),t},oh=class extends Rc{constructor(){super({max:256})}},hb=class extends Rc{constructor(e=16*1024){super({maxSize:e,sizeCalculation:t=>t.length+1})}},SD=Symbol("PathScurry setAsCwd"),en=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#i;get mode(){return this.#i}#n;get nlink(){return this.#n}#r;get uid(){return this.#r}#T;get gid(){return this.#T}#l;get rdev(){return this.#l}#d;get blksize(){return this.#d}#a;get ino(){return this.#a}#c;get size(){return this.#c}#o;get blocks(){return this.#o}#g;get atimeMs(){return this.#g}#y;get mtimeMs(){return this.#y}#h;get ctimeMs(){return this.#h}#f;get birthtimeMs(){return this.#f}#E;get atime(){return this.#E}#m;get mtime(){return this.#m}#w;get ctime(){return this.#w}#k;get birthtime(){return this.#k}#v;#S;#_;#p;#D;#N;#s;#O;#b;#C;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=Gn,r,s,i,o,a){this.name=e,this.#v=i?sh(e):$c(e),this.#s=t&ZF,this.nocase=i,this.roots=s,this.root=r||this,this.#O=o,this.#_=a.fullpath,this.#D=a.relative,this.#N=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=pD(a.fs)}depth(){return this.#S!==void 0?this.#S:this.parent?this.#S=this.parent.depth()+1:this.#S=0}childrenCache(){return this.#O}resolve(e){if(!e)return this;let t=this.getRootString(e),s=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#I(s):this.#I(s)}#I(e){let t=this;for(let r of e)t=t.child(r);return t}children(){let e=this.#O.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#O.set(this,t),this.#s&=~db,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),s=this.nocase?sh(e):$c(e);for(let c of r)if(c.#v===s)return c;let i=this.parent?this.sep:"",o=this.#_?this.#_+i+e:void 0,a=this.newChild(e,Gn,{...t,parent:this,fullpath:o});return this.canReaddir()||(a.#s|=yr),r.push(a),a}relative(){if(this.isCWD)return"";if(this.#D!==void 0)return this.#D;let e=this.name,t=this.parent;if(!t)return this.#D=this.name;let r=t.relative();return r+(!r||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#N!==void 0)return this.#N;let e=this.name,t=this.parent;if(!t)return this.#N=this.fullpathPosix();let r=t.relativePosix();return r+(!r||!t.parent?"":"/")+e}fullpath(){if(this.#_!==void 0)return this.#_;let e=this.name,t=this.parent;if(!t)return this.#_=this.name;let s=t.fullpath()+(t.parent?this.sep:"")+e;return this.#_=s}fullpathPosix(){if(this.#p!==void 0)return this.#p;if(this.sep==="/")return this.#p=this.fullpath();if(!this.parent){let s=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(s)?this.#p=`//?/${s}`:this.#p=s}let e=this.parent,t=e.fullpathPosix(),r=t+(!t||!e.parent?"":"/")+this.name;return this.#p=r}isUnknown(){return(this.#s&Kn)===Gn}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#s&Kn)===vD}isDirectory(){return(this.#s&Kn)===$r}isCharacterDevice(){return(this.#s&Kn)===yD}isBlockDevice(){return(this.#s&Kn)===bD}isFIFO(){return(this.#s&Kn)===gD}isSocket(){return(this.#s&Kn)===TD}isSymbolicLink(){return(this.#s&wi)===wi}lstatCached(){return this.#s&lD?this:void 0}readlinkCached(){return this.#b}realpathCached(){return this.#C}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#b)return!0;if(!this.parent)return!1;let e=this.#s&Kn;return!(e!==Gn&&e!==wi||this.#s&rh||this.#s&yr)}calledReaddir(){return!!(this.#s&db)}isENOENT(){return!!(this.#s&yr)}isNamed(e){return this.nocase?this.#v===sh(e):this.#v===$c(e)}async readlink(){let e=this.#b;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#e.promises.readlink(this.fullpath()),r=(await this.parent.realpath())?.resolve(t);if(r)return this.#b=r}catch(t){this.#u(t.code);return}}readlinkSync(){let e=this.#b;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#e.readlinkSync(this.fullpath()),r=this.parent.realpathSync()?.resolve(t);if(r)return this.#b=r}catch(t){this.#u(t.code);return}}#x(e){this.#s|=db;for(let t=e.provisional;t<e.length;t++){let r=e[t];r&&r.#M()}}#M(){this.#s&yr||(this.#s=(this.#s|yr)&Ic,this.#P())}#P(){let e=this.children();e.provisional=0;for(let t of e)t.#M()}#R(){this.#s|=ih,this.#$()}#$(){if(this.#s&Mc)return;let e=this.#s;(e&Kn)===$r&&(e&=Ic),this.#s=e|Mc,this.#P()}#L(e=""){e==="ENOTDIR"||e==="EPERM"?this.#$():e==="ENOENT"?this.#M():this.children().provisional=0}#q(e=""){e==="ENOTDIR"?this.parent.#$():e==="ENOENT"&&this.#M()}#u(e=""){let t=this.#s;t|=rh,e==="ENOENT"&&(t|=yr),(e==="EINVAL"||e==="UNKNOWN")&&(t&=Ic),this.#s=t,e==="ENOTDIR"&&this.parent&&this.parent.#$()}#j(e,t){return this.#A(e,t)||this.#F(e,t)}#F(e,t){let r=fb(e),s=this.newChild(e.name,r,{parent:this}),i=s.#s&Kn;return i!==$r&&i!==wi&&i!==Gn&&(s.#s|=Mc),t.unshift(s),t.provisional++,s}#A(e,t){for(let r=t.provisional;r<t.length;r++){let s=t[r];if((this.nocase?sh(e.name):$c(e.name))===s.#v)return this.#B(e,s,r,t)}}#B(e,t,r,s){let i=t.name;return t.#s=t.#s&Ic|fb(e),i!==e.name&&(t.name=e.name),r!==s.provisional&&(r===s.length-1?s.pop():s.splice(r,1),s.unshift(t)),s.provisional++,t}async lstat(){if((this.#s&yr)===0)try{return this.#z(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#q(e.code)}}lstatSync(){if((this.#s&yr)===0)try{return this.#z(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#q(e.code)}}#z(e){let{atime:t,atimeMs:r,birthtime:s,birthtimeMs:i,blksize:o,blocks:a,ctime:c,ctimeMs:l,dev:u,gid:d,ino:f,mode:p,mtime:y,mtimeMs:m,nlink:S,rdev:w,size:T,uid:v}=e;this.#E=t,this.#g=r,this.#k=s,this.#f=i,this.#d=o,this.#o=a,this.#w=c,this.#h=l,this.#t=u,this.#T=d,this.#a=f,this.#i=p,this.#m=y,this.#y=m,this.#n=S,this.#l=w,this.#c=T,this.#r=v;let R=fb(e);this.#s=this.#s&Ic|R|lD,R!==Gn&&R!==$r&&R!==wi&&(this.#s|=Mc)}#V=[];#W=!1;#H(e){this.#W=!1;let t=this.#V.slice();this.#V.length=0,t.forEach(r=>r(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let r=this.children();if(this.calledReaddir()){let i=r.slice(0,r.provisional);t?e(null,i):queueMicrotask(()=>e(null,i));return}if(this.#V.push(e),this.#W)return;this.#W=!0;let s=this.fullpath();this.#e.readdir(s,{withFileTypes:!0},(i,o)=>{if(i)this.#L(i.code),r.provisional=0;else{for(let a of o)this.#j(a,r);this.#x(r)}this.#H(r.slice(0,r.provisional))})}#U;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#U)await this.#U;else{let r=()=>{};this.#U=new Promise(s=>r=s);try{for(let s of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#j(s,e);this.#x(e)}catch(s){this.#L(s.code),e.provisional=0}this.#U=void 0,r()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let r of this.#e.readdirSync(t,{withFileTypes:!0}))this.#j(r,e);this.#x(e)}catch(r){this.#L(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#s&uD)return!1;let e=Kn&this.#s;return e===Gn||e===$r||e===wi}shouldWalk(e,t){return(this.#s&$r)===$r&&!(this.#s&uD)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#C)return this.#C;if(!((ih|rh|yr)&this.#s))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#C=this.resolve(e)}catch{this.#R()}}realpathSync(){if(this.#C)return this.#C;if(!((ih|rh|yr)&this.#s))try{let e=this.#e.realpathSync(this.fullpath());return this.#C=this.resolve(e)}catch{this.#R()}}[SD](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),r=[],s=this;for(;s&&s.parent;)t.add(s),s.#D=r.join(this.sep),s.#N=r.join("/"),s=s.parent,r.push("..");for(s=e;s&&s.parent&&!t.has(s);)s.#D=void 0,s.#N=void 0,s=s.parent}},ah=class n extends en{sep="\\";splitSep=QF;constructor(e,t=Gn,r,s,i,o,a){super(e,t,r,s,i,o,a)}newChild(e,t=Gn,r={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return Ko.win32.parse(e).root}getRoot(e){if(e=XF(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,r]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=r;return this.roots[e]=new Go(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(mD,"$1\\"),e===t}},ch=class n extends en{splitSep="/";sep="/";constructor(e,t=Gn,r,s,i,o,a){super(e,t,r,s,i,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=Gn,r={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}},lh=class{root;rootPath;roots;cwd;#e;#t;#i;nocase;#n;constructor(e=process.cwd(),t,r,{nocase:s,childrenCacheSize:i=16*1024,fs:o=xc}={}){this.#n=pD(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,hD.fileURLToPath)(e));let a=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new oh,this.#t=new oh,this.#i=new hb(i);let c=a.substring(this.rootPath.length).split(r);if(c.length===1&&!c[0]&&c.pop(),s===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=s,this.root=this.newRoot(this.#n),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,d=t.sep,f=this.rootPath,p=!1;for(let y of c){let m=u--;l=l.child(y,{relative:new Array(m).fill("..").join(d),relativePosix:new Array(m).fill("..").join("/"),fullpath:f+=(p?"":d)+y}),p=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#i}resolve(...e){let t="";for(let i=e.length-1;i>=0;i--){let o=e[i];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let r=this.#e.get(t);if(r!==void 0)return r;let s=this.cwd.resolve(t).fullpath();return this.#e.set(t,s),s}resolvePosix(...e){let t="";for(let i=e.length-1;i>=0;i--){let o=e[i];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let r=this.#t.get(t);if(r!==void 0)return r;let s=this.cwd.resolve(t).fullpathPosix();return this.#t.set(t,s),s}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof en||(t=e,e=this.cwd);let{withFileTypes:r}=t;if(e.canReaddir()){let s=await e.readdir();return r?s:s.map(i=>i.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof en||(t=e,e=this.cwd);let{withFileTypes:r=!0}=t;return e.canReaddir()?r?e.readdirSync():e.readdirSync().map(s=>s.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof en||(t=e.withFileTypes,e=this.cwd);let r=await e.readlink();return t?r:r?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof en||(t=e.withFileTypes,e=this.cwd);let r=e.readlinkSync();return t?r:r?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof en||(t=e.withFileTypes,e=this.cwd);let r=await e.realpath();return t?r:r?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof en||(t=e.withFileTypes,e=this.cwd);let r=e.realpathSync();return t?r:r?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof en||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=t,a=[];(!i||i(e))&&a.push(r?e:e.fullpath());let c=new Set,l=(d,f)=>{c.add(d),d.readdirCB((p,y)=>{if(p)return f(p);let m=y.length;if(!m)return f();let S=()=>{--m===0&&f()};for(let w of y)(!i||i(w))&&a.push(r?w:w.fullpath()),s&&w.isSymbolicLink()?w.realpath().then(T=>T?.isUnknown()?T.lstat():T).then(T=>T?.shouldWalk(c,o)?l(T,S):S()):w.shouldWalk(c,o)?l(w,S):S()},!0)},u=e;return new Promise((d,f)=>{l(u,p=>{if(p)return f(p);d(a)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof en||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=t,a=[];(!i||i(e))&&a.push(r?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let d of u){(!i||i(d))&&a.push(r?d:d.fullpath());let f=d;if(d.isSymbolicLink()){if(!(s&&(f=d.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(c,o)&&c.add(f)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof en||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof en||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=t;(!i||i(e))&&(yield r?e:e.fullpath());let a=new Set([e]);for(let c of a){let l=c.readdirSync();for(let u of l){(!i||i(u))&&(yield r?u:u.fullpath());let d=u;if(u.isSymbolicLink()){if(!(s&&(d=u.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(a,o)&&a.add(d)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof en||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=t,a=new Bs({objectMode:!0});(!i||i(e))&&a.write(r?e:e.fullpath());let c=new Set,l=[e],u=0,d=()=>{let f=!1;for(;!f;){let p=l.shift();if(!p){u===0&&a.end();return}u++,c.add(p);let y=(S,w,T=!1)=>{if(S)return a.emit("error",S);if(s&&!T){let v=[];for(let R of w)R.isSymbolicLink()&&v.push(R.realpath().then(A=>A?.isUnknown()?A.lstat():A));if(v.length){Promise.all(v).then(()=>y(null,w,!0));return}}for(let v of w)v&&(!i||i(v))&&(a.write(r?v:v.fullpath())||(f=!0));u--;for(let v of w){let R=v.realpathCached()||v;R.shouldWalk(c,o)&&l.push(R)}f&&!a.flowing?a.once("drain",d):m||d()},m=!0;p.readdirCB(y,!0),m=!1}};return d(),a}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof en||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=t,a=new Bs({objectMode:!0}),c=new Set;(!i||i(e))&&a.write(r?e:e.fullpath());let l=[e],u=0,d=()=>{let f=!1;for(;!f;){let p=l.shift();if(!p){u===0&&a.end();return}u++,c.add(p);let y=p.readdirSync();for(let m of y)(!i||i(m))&&(a.write(r?m:m.fullpath())||(f=!0));u--;for(let m of y){let S=m;if(m.isSymbolicLink()){if(!(s&&(S=m.realpathSync())))continue;S.isUnknown()&&S.lstatSync()}S.shouldWalk(c,o)&&l.push(S)}}f&&!a.flowing&&a.once("drain",d)};return d(),a}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[SD](t)}},Go=class extends lh{sep="\\";constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,Ko.win32,"\\",{...t,nocase:r}),this.nocase=r;for(let s=this.cwd;s;s=s.parent)s.nocase=this.nocase}parseRootPath(e){return Ko.win32.parse(e).root.toUpperCase()}newRoot(e){return new ah(this.rootPath,$r,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},Yo=class extends lh{sep="/";constructor(e=process.cwd(),t={}){let{nocase:r=!1}=t;super(e,Ko.posix,"/",{...t,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new ch(this.rootPath,$r,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},Lc=class extends Yo{constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,{...t,nocase:r})}},Xee=process.platform==="win32"?ah:ch,_D=process.platform==="win32"?Go:process.platform==="darwin"?Lc:Yo;var eB=n=>n.length>=1,tB=n=>n.length>=1,Jo=class n{#e;#t;#i;length;#n;#r;#T;#l;#d;#a;#c=!0;constructor(e,t,r,s){if(!eB(e))throw new TypeError("empty pattern list");if(!tB(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,r<0||r>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=t,this.#i=r,this.#n=s,this.#i===0){if(this.isUNC()){let[i,o,a,c,...l]=this.#e,[u,d,f,p,...y]=this.#t;l[0]===""&&(l.shift(),y.shift());let m=[i,o,a,c,""].join("/"),S=[u,d,f,p,""].join("/");this.#e=[m,...l],this.#t=[S,...y],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[i,...o]=this.#e,[a,...c]=this.#t;o[0]===""&&(o.shift(),c.shift());let l=i+"/",u=a+"/";this.#e=[l,...o],this.#t=[u,...c],this.length=this.#e.length}}}pattern(){return this.#e[this.#i]}isString(){return typeof this.#e[this.#i]=="string"}isGlobstar(){return this.#e[this.#i]===Wt}isRegExp(){return this.#e[this.#i]instanceof RegExp}globString(){return this.#T=this.#T||(this.#i===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#i).join("/"))}hasMore(){return this.length>this.#i+1}rest(){return this.#r!==void 0?this.#r:this.hasMore()?(this.#r=new n(this.#e,this.#t,this.#i+1,this.#n),this.#r.#a=this.#a,this.#r.#d=this.#d,this.#r.#l=this.#l,this.#r):this.#r=null}isUNC(){let e=this.#e;return this.#d!==void 0?this.#d:this.#d=this.#n==="win32"&&this.#i===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#l!==void 0?this.#l:this.#l=this.#n==="win32"&&this.#i===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#i===0?e:""}checkFollowGlobstar(){return!(this.#i===0||!this.isGlobstar()||!this.#c)}markFollowGlobstar(){return this.#i===0||!this.isGlobstar()||!this.#c?!1:(this.#c=!1,!0)}};var nB=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Xo=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:r,noext:s,noglobstar:i,platform:o=nB}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:r,noext:s,noglobstar:i,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let t=new xn(e,this.mmopts);for(let r=0;r<t.set.length;r++){let s=t.set[r],i=t.globParts[r];if(!s||!i)throw new Error("invalid pattern object");for(;s[0]==="."&&i[0]===".";)s.shift(),i.shift();let o=new Jo(s,i,0,this.platform),a=new xn(o.globString(),this.mmopts),c=i[i.length-1]==="**",l=o.isAbsolute();l?this.absolute.push(a):this.relative.push(a),c&&(l?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(e){let t=e.fullpath(),r=`${t}/`,s=e.relative()||".",i=`${s}/`;for(let o of this.relative)if(o.match(s)||o.match(i))return!0;for(let o of this.absolute)if(o.match(t)||o.match(r))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",r=(e.relative()||".")+"/";for(let s of this.relativeChildren)if(s.match(r))return!0;for(let s of this.absoluteChildren)if(s.match(t))return!0;return!1}};var pb=class n{store;constructor(e=new Map){this.store=e}copy(){return new n(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let r=e.fullpath(),s=this.store.get(r);s?s.add(t.globString()):this.store.set(r,new Set([t.globString()]))}},mb=class{store=new Map;add(e,t,r){let s=(t?2:0)|(r?1:0),i=this.store.get(e);this.store.set(e,i===void 0?s:s&i)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},gb=class{store=new Map;add(e,t){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(s=>s.globString()===t.globString())||r.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},qc=class n{hasWalkedCache;matches=new mb;subwalks=new gb;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new pb}processPatterns(e,t){this.patterns=t;let r=t.map(s=>[e,s]);for(let[s,i]of r){this.hasWalkedCache.storeWalked(s,i);let o=i.root(),a=i.isAbsolute()&&this.opts.absolute!==!1;if(o){s=s.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let d=i.rest();if(d)i=d;else{this.matches.add(s,!0,!1);continue}}if(s.isENOENT())continue;let c,l,u=!1;for(;typeof(c=i.pattern())=="string"&&(l=i.rest());)s=s.resolve(c),i=l,u=!0;if(c=i.pattern(),l=i.rest(),u){if(this.hasWalkedCache.hasWalked(s,i))continue;this.hasWalkedCache.storeWalked(s,i)}if(typeof c=="string"){let d=c===".."||c===""||c===".";this.matches.add(s.resolve(c),a,d);continue}else if(c===Wt){(!s.isSymbolicLink()||this.follow||i.checkFollowGlobstar())&&this.subwalks.add(s,i);let d=l?.pattern(),f=l?.rest();if(!l||(d===""||d===".")&&!f)this.matches.add(s,a,d===""||d===".");else if(d===".."){let p=s.parent||s;f?this.hasWalkedCache.hasWalked(p,f)||this.subwalks.add(p,f):this.matches.add(p,a,!0)}}else c instanceof RegExp&&this.subwalks.add(s,i)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new n(this.opts,this.hasWalkedCache)}filterEntries(e,t){let r=this.subwalks.get(e),s=this.child();for(let i of t)for(let o of r){let a=o.isAbsolute(),c=o.pattern(),l=o.rest();c===Wt?s.testGlobstar(i,o,l,a):c instanceof RegExp?s.testRegExp(i,c,l,a):s.testString(i,c,l,a)}return s}testGlobstar(e,t,r,s){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,s,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(r&&t.checkFollowGlobstar()?this.subwalks.add(e,r):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),r){let i=r.pattern();if(typeof i=="string"&&i!==".."&&i!==""&&i!==".")this.testString(e,i,r.rest(),s);else if(i===".."){let o=e.parent||e;this.subwalks.add(o,r)}else i instanceof RegExp&&this.testRegExp(e,i,r.rest(),s)}}testRegExp(e,t,r,s){t.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,s,!1))}testString(e,t,r,s){e.isNamed(t)&&(r?this.subwalks.add(e,r):this.matches.add(e,s,!1))}};var rB=(n,e)=>typeof n=="string"?new Xo([n],e):Array.isArray(n)?new Xo(n,e):n,uh=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#i;signal;maxDepth;includeChildMatches;constructor(e,t,r){if(this.patterns=e,this.path=t,this.opts=r,this.#i=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#t=rB(r.ignore??[],r),!this.includeChildMatches&&typeof this.#t.add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#n(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#r(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||await e.realpath(),!r)return;e=r}let i=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&i?.isSymbolicLink()){let o=await i.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(i,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#n(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||e.realpathSync(),!r)return;e=r}let i=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&i?.isSymbolicLink()){let o=i.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(i,t)}matchFinish(e,t){if(this.#n(e))return;if(!this.includeChildMatches&&this.#t?.add){let i=`${e.relativePosix()}/**`;this.#t.add(i)}let r=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let s=this.opts.mark&&e.isDirectory()?this.#i:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(r){let i=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(i+s)}else{let i=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!i.startsWith(".."+this.#i)?"."+this.#i:"";this.matchEmit(i?o+i+s:"."+s)}}async match(e,t,r){let s=await this.matchCheck(e,r);s&&this.matchFinish(s,t)}matchSync(e,t,r){let s=this.matchCheckSync(e,r);s&&this.matchFinish(s,t)}walkCB(e,t,r){this.signal?.aborted&&r(),this.walkCB2(e,t,new qc(this.opts),r)}walkCB2(e,t,r,s){if(this.#r(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2(e,t,r,s));return}r.processPatterns(e,t);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of r.matches.entries())this.#n(a)||(i++,this.match(a,c,l).then(()=>o()));for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;i++;let c=a.readdirCached();a.calledReaddir()?this.walkCB3(a,c,r,o):a.readdirCB((l,u)=>this.walkCB3(a,u,r,o),!0)}o()}walkCB3(e,t,r,s){r=r.filterEntries(e,t);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of r.matches.entries())this.#n(a)||(i++,this.match(a,c,l).then(()=>o()));for(let[a,c]of r.subwalks.entries())i++,this.walkCB2(a,c,r.child(),o);o()}walkCBSync(e,t,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,t,new qc(this.opts),r)}walkCB2Sync(e,t,r,s){if(this.#r(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,r,s));return}r.processPatterns(e,t);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of r.matches.entries())this.#n(a)||this.matchSync(a,c,l);for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;i++;let c=a.readdirSync();this.walkCB3Sync(a,c,r,o)}o()}walkCB3Sync(e,t,r,s){r=r.filterEntries(e,t);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of r.matches.entries())this.#n(a)||this.matchSync(a,c,l);for(let[a,c]of r.subwalks.entries())i++,this.walkCB2Sync(a,c,r.child(),o);o()}},jc=class extends uh{matches=new Set;constructor(e,t,r){super(e,t,r)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},Fc=class extends uh{results;constructor(e,t,r){super(e,t,r),this.results=new Bs({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var sB=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",br=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,t){if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=(0,ED.fileURLToPath)(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==!1,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(c=>c.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=e,this.platform=t.platform||sB,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let c=t.platform==="win32"?Go:t.platform==="darwin"?Lc:t.platform?Yo:_D;this.scurry=new c(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let r=this.platform==="darwin"||this.platform==="win32",s={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:r,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},i=this.pattern.map(c=>new xn(c,s)),[o,a]=i.reduce((c,l)=>(c[0].push(...l.set),c[1].push(...l.globParts),c),[[],[]]);this.patterns=o.map((c,l)=>{let u=a[l];if(!u)throw new Error("invalid pattern object");return new Jo(c,u,0,this.platform)})}async walk(){return[...await new jc(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new jc(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new Fc(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new Fc(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var yb=(n,e={})=>{Array.isArray(n)||(n=[n]);for(let t of n)if(new xn(t,e).hasMagic())return!0;return!1};function dh(n,e={}){return new br(n,e).streamSync()}function kD(n,e={}){return new br(n,e).stream()}function ND(n,e={}){return new br(n,e).walkSync()}async function wD(n,e={}){return new br(n,e).walk()}function fh(n,e={}){return new br(n,e).iterateSync()}function PD(n,e={}){return new br(n,e).iterate()}var iB=dh,oB=Object.assign(kD,{sync:dh}),aB=fh,cB=Object.assign(PD,{sync:fh}),lB=Object.assign(ND,{stream:dh,iterate:fh}),ki=Object.assign(wD,{glob:wD,globSync:ND,sync:lB,globStream:kD,stream:oB,globStreamSync:dh,streamSync:iB,globIterate:PD,iterate:cB,globIterateSync:fh,iterateSync:aB,Glob:br,hasMagic:yb,escape:Uo,unescape:mr});ki.glob=ki;var bT=require("path"),vT=require("fs");var AO=K(RO());var gT={};pI(gT,{$id:()=>OH,$schema:()=>AH,default:()=>LH,definitions:()=>xH,properties:()=>$H,title:()=>IH,type:()=>MH});var AH="http://json-schema.org/draft-07/schema#",OH="http://json-schema.org/draft-07/schema#",IH="Core schema meta-schema",xH={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},MH=["object","boolean"],$H={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},LH={$schema:AH,$id:OH,title:IH,definitions:xH,type:MH,properties:$H,default:!0};var Dt=K(X());var Kh=class extends ja{constructor(t,r){super();this.ajv=t;this.schemaKey=r;this.validate=this.ajv.getSchema(this.schemaKey)}getIssue(t,r){let s=[],i=r.getProperty("status"),o=i?.ast.values?.values.at(0)?.value;if(o instanceof Ie&&o.value==="disabled")return[...r.definitions,...r.referencedBy].forEach(c=>s.push(F(22,c,Dt.DiagnosticSeverity.Hint,[...i?.ast.parentNode?[i?.ast.parentNode]:[]],[Dt.DiagnosticTag.Unnecessary]))),s;let a=Se.toJson(r);try{this.validate?(this.validate(a),this.validate.errors&&(this.validate.errors.forEach(c=>s.push(...qH(t,c,r,this.schemaKey))),console.log(this.schemaKey,`${r.pathString}`,this.validate.errors,a))):console.log("no validate")}catch(c){console.log(this.schemaKey,`${r.pathString}`,this.schemaKey,c)}return s}getOnPropertyHover(t){let r=(this.validate?.schema).properties?.[t];if(r&&typeof r=="object"&&"description"in r)return{kind:Dt.MarkupKind.Markdown,value:[...r.description?["### Description",Array.isArray(r.description)?r.description.join(`
280
+ };`,kind:_t.CompletionItemKind.Value,insertTextFormat:_t.InsertTextFormat.Snippet}))]}function $1(t,e){let n=s=>s?s.parentNode instanceof $t||s.parentNode instanceof vt||s.parentNode instanceof Ae?!1:n(s.parentNode):!0;if(!t||t.item!==null||!At(t.ast)||!n(t.ast))return[];let r=s=>of(s,e).filter(i=>e(i));return t.ast instanceof ot?r(t.runtime.rootNode).length?[{label:"/delete-node/",insertText:"/delete-node/ $1;",kind:_t.CompletionItemKind.Keyword,insertTextFormat:_t.InsertTextFormat.Snippet,sortText:"~"}]:t.runtime.rootNode.nodes.length?[{label:"/delete-node/ &{}",insertText:"/delete-node/ {/$1};",kind:_t.CompletionItemKind.Keyword,insertTextFormat:_t.InsertTextFormat.Snippet,sortText:"~"}]:[]:Array.from(new Set(r(t.runtime.rootNode).map(s=>s.label.value))).map(s=>({label:t.ast instanceof be?`${s}`:`&${s}`,kind:_t.CompletionItemKind.Variable}))}function q1(t,e){if(!t||!(t.item instanceof we)||t.item===null||t.beforeAst&&(!(t.beforeAst?.parentNode instanceof ln)||t.beforeAst?.parentNode instanceof Ke))return[];let n=r=>[...r.nodes,...r.deletedNodes.filter(s=>!e(s.by)).map(s=>s.node)].flatMap(s=>s.definitions.filter(i=>i instanceof Ae)).filter(s=>e(s));return t.ast instanceof qe||t.ast instanceof _n||t.beforeAst?.parentNode instanceof _n?Array.from(new Set(n(t.item).map(r=>r.name?.toString()))).map(r=>({label:`${r}`,kind:_t.CompletionItemKind.Variable})):n(t.item).length?[{label:"/delete-node/",kind:_t.CompletionItemKind.Keyword,insertTextFormat:_t.InsertTextFormat.Snippet,sortText:"~"}]:[]}function j1(t,e){if(!t||!(t.item instanceof we)||t.beforeAst&&(!(t.beforeAst?.parentNode instanceof ln)||t.beforeAst?.parentNode instanceof _n))return[];let n=r=>[...r.property,...r.deletedProperties.filter(s=>!e(s.by)).map(s=>s.property)].flatMap(s=>[s,...s.allReplaced]).filter(s=>e(s.ast));return t.ast instanceof Ve||t.ast instanceof Ke||t.beforeAst?.parentNode instanceof Ke?Array.from(new Set(n(t.item).map(r=>r.name))).map(r=>({label:`${r}`,kind:_t.CompletionItemKind.Variable})):n(t.item).length?[{label:"/delete-property/",insertText:"/delete-property/$1;",kind:_t.CompletionItemKind.Keyword,sortText:"~",insertTextFormat:_t.InsertTextFormat.Snippet}]:[]}function F1(t,e){let n=t?.ast instanceof es?t.ast:t?.ast.parentNode;if(!t||!n||!(n instanceof es))return[];let r=n.pathParts.slice(0,-1);if(r.some(o=>!o))return[];let s=r.map(o=>o.toString());return(()=>{let o=t.runtime.rootNode.getChildFromScope(["/",...s],e);return[...o?.nodes.filter(a=>!At(t.ast)||a.definitions.some(e))??[],...o?.deletedNodes.filter(a=>!e(a.by)).map(a=>a.node)??[]].map(a=>a.fullName)??[]})().map(o=>({label:`/${[...s,o].join("/")}`,kind:_t.CompletionItemKind.Variable}))}var sf=t=>!t||t instanceof $e?!1:t instanceof un||sf(t.parentNode);function B1(t){return!t||!(t.item instanceof Ye&&t.item.ast.assignOperatorToken)?[]:!sf(t?.ast)&&!(t.ast instanceof $e&&t.item.ast.values===null)&&!sf(t.beforeAst)&&!sf(t.afterAst)?[]:t.item.parent.nodeType instanceof Sn?Array.from([t.runtime.context.parser,...t.runtime.context.overlayParsers].at(-1)?.cPreprocessorParser.macros??[]).map(([r,s])=>s.macro.identifier instanceof Os?{label:`${s.macro.identifier.toString()} -> ${s.macro.content?.toString()??"__UNSET__"}`,insertText:`${s.macro.name}(${s.macro.identifier.params.map((i,o)=>i instanceof zt?`$${o+1}`:"").join(", ")})`,kind:_t.CompletionItemKind.Function,sortText:`~${s.macro.name}`,insertTextFormat:_t.InsertTextFormat.Snippet}:{label:s.macro.identifier.name,kind:_t.CompletionItemKind.Variable,sortText:`~${s.macro.name}`}):[]}async function oR(t,e){return Dt(t,e,(n,r)=>[...j1(n,r),...q1(n,r),...$1(n,r),...F1(n,r),...L1(n,r),...M1(n,r),...x1(n),...B1(n)])}var $r=Y(Q());function U1(t){if(!t||t.item===null||!(t.ast instanceof Ve))return[];let e=r=>r.replacedBy?e(r.replacedBy):r,n=r=>[r.ast,...r.allReplaced.map(s=>s.ast),r.parent.deletedProperties.find(s=>s.property=r)?.by??[]].map(s=>{if(s instanceof $e)return $r.Location.create(fe(s.uri),te(s.propertyName??s));if(s instanceof Ke)return $r.Location.create(fe(s.uri),te(s.propertyName??s))}).filter(s=>s);if(t.item instanceof Ye&&t.ast instanceof Ve)return n(e(t.item));if(t.item instanceof we&&t.ast instanceof Ve&&t.ast.parentNode instanceof Ke){let r=t.item.deletedProperties.find(s=>s.by===t.ast.parentNode)?.property;if(r)return n(r)}return[]}function V1(t){if(!t)return[];let e=n=>{let s=t.runtime.rootNode.getNode("aliases")?.property.filter(o=>{let a=o.ast.quickValues;if(a?.length===1&&typeof a[0]=="string"&&t.runtime.rootNode.getChild(a[0].split("/"))===n)return!0}).map(o=>o.ast)??[],i=n.parent?.deletedNodes.filter(o=>o.node===n&&(o.by.nodeNameOrRef instanceof qe?o.by.nodeNameOrRef!==t.ast:!n.linkedRefLabels.some(a=>a!==t.ast))).map(o=>o.by.nodeNameOrRef)??[];return[...s,...n.linkedRefLabels,...n.linkedNodeNamePaths,...n.definitions,...i].map(o=>{if(o instanceof vt)return $r.Location.create(fe(o.uri),te(o.name??o));if(o instanceof Ae)return $r.Location.create(fe(o.uri),te(o.name??o));if(o instanceof qe)return $r.Location.create(fe(o.uri),te(o));if(o instanceof qe)return $r.Location.create(fe(o.uri),te(o));if(o instanceof be)return $r.Location.create(fe(o.uri),te(o.label??o));if(o instanceof $e)return $r.Location.create(fe((o.values??o)?.uri),te(o.values??o))}).filter(o=>o)};if(t.item instanceof we&&!At(t.ast))return e(t.item);if(t.ast instanceof Vt&&t.ast.parentNode instanceof be&&t.ast.parentNode.linksTo)return e(t.ast.parentNode.linksTo);if(t.ast instanceof qe&&t.ast.linksTo)return At(t.ast)?[...e(t.ast.linksTo),$r.Location.create(fe(t.ast.uri),te(t.ast))]:e(t.ast.linksTo);if(t?.ast instanceof Le&&t.item instanceof Ye&&t.item.parent.name==="aliases"){let n=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(n)return e(n)}return[]}async function aR(t,e){return Dt(t,e,n=>[...V1(n),...U1(n)])}var ts=Y(Q());function cR(t){if(!t||t.item===null||!(t.ast instanceof Ve))return[];let e=r=>r.replacedBy?e(r.replacedBy):r,n=r=>[r.ast,...r.allReplaced.map(s=>s.ast),r.parent.deletedProperties.find(s=>s.property=r)?.by??[]].map(s=>{if((s instanceof $e||s instanceof Ke)&&s.propertyName)return ts.Location.create(fe(s.uri),te(s.propertyName))}).filter(s=>s);if(t.item instanceof Ye&&t.ast instanceof Ve)return n(e(t.item));if(t.item instanceof we&&t.ast instanceof Ve&&t.ast.parentNode instanceof Ke){let r=t.item.deletedProperties.find(s=>s.by===t.ast.parentNode)?.property;if(r)return n(r)}return[]}function lR(t,e){if(!e||!(e.ast instanceof Vt))return[];"newName"in t&&(e.ast.parentNode instanceof be&&t.newName.startsWith("&")?t.newName=t.newName.slice(1):e.ast.parentNode instanceof As&&t.newName.endsWith(":")&&(t.newName=t.newName.slice(0,-1)));let n=e.ast.value,r=s=>[...s.definitions.filter(i=>i instanceof Ae).flatMap(i=>i.labels.map(o=>o.label)),...s.linkedRefLabels.map(i=>i.label)].filter(i=>i?.value===n).map(i=>{if(i)return ts.Location.create(fe(i.uri),te(i))}).filter(i=>i);return e.item instanceof we&&!At(e.ast)?r(e.item):e.ast instanceof Vt&&e.ast.parentNode instanceof be&&e.ast.parentNode.linksTo?r(e.ast.parentNode.linksTo):[]}function uR(t){if(!t||!(t.ast instanceof qe))return[];let e=n=>{let s=t.runtime.rootNode.getNode("aliases")?.property.filter(o=>{let a=o.ast.quickValues;if(a?.length===1&&typeof a[0]=="string"){let c=t.runtime.rootNode.getChild(a[0].split("/"));if(c?.isChildOf(n)||c===n)return!0}}).map(o=>o.ast)??[],i=n.parent?.deletedNodes.filter(o=>o.node===n&&o.by.nodeNameOrRef!==t.ast).map(o=>o.by.nodeNameOrRef)??[];return[...s,...n.linkedNodeNamePaths,...n.definitions,...i].map(o=>{if(o instanceof Ae&&o.name)return ts.Location.create(fe(o.uri),te(o.name));if(o instanceof qe)return ts.Location.create(fe(o.uri),te(o));if(o instanceof $e&&o.values?.values[0]?.value&&o.values?.values[0]?.value instanceof Le){let a=o.values.values[0].value,c=te(a),l=a.value.split("/"),u=n.path,d=l.slice(0,u.length-1).join("/").length+1,f=a.value.length-l.slice(0,u.length).join("/").length;return c.start.character+=1+d,c.end.character-=1+f,ts.Location.create(fe(o.values.values[0].uri),c)}}).filter(o=>o)};return t.item instanceof we&&!At(t.ast)?e(t.item):t.ast instanceof qe&&t.ast.linksTo?At(t.ast)?[...e(t.ast.linksTo),ts.Location.create(fe(t.ast.uri),te(t.ast))]:e(t.ast.linksTo):[]}async function dR(t,e){let n={};return(await Dt(t,e,s=>[...uR(s),...lR(t,s),...cR(s)])).forEach(s=>{n[s.uri]??=[],n[s.uri].push(ts.TextEdit.replace(s.range,t.newName))}),{changes:n}}async function fR(t,e){let n=await Dt(t,e,r=>[...uR(r),...lR(t,r),...cR(r)]);if(n.some(r=>e?.settings.lockRenameEdits?.some(s=>et(r.uri).startsWith(s))))throw new Error('Path is locked by user setting "lockRenameEdits"');return{defaultBehavior:!!n.length}}var jo=Y(Q());function z1(t){if(!t||t.item===null||!(t.ast instanceof Ve))return[];let e=r=>r.replacedBy?e(r.replacedBy):r,n=r=>[r.ast,...r.allReplaced.map(s=>s.ast)].map(s=>{if(s instanceof $e)return jo.Location.create(fe(s.uri),te(s.propertyName??s))}).filter(s=>s);if(t.item instanceof Ye&&t.ast instanceof Ve)return n(e(t.item));if(t.item instanceof we&&t.ast instanceof Ve&&t.ast.parentNode instanceof Ke){let r=t.item.deletedProperties.find(s=>s.by===t.ast.parentNode)?.property;if(r)return n(r)}return[]}function W1(t){if(!t)return[];let e=n=>[...n.definitions,...n.referencedBy].map(r=>{if(r instanceof vt)return jo.Location.create(fe(r.uri),te(r));if(r instanceof Ae)return jo.Location.create(fe(r.uri),te(r));if(r instanceof $t)return jo.Location.create(fe(r.uri),te(r))}).filter(r=>r);if(t.item instanceof we&&!At(t.ast))return e(t.item);if(t.ast instanceof Vt&&t.ast.parentNode instanceof be&&t.ast.parentNode.linksTo)return e(t.ast.parentNode.linksTo);if(t.ast instanceof qe&&t.ast.linksTo)return e(t.ast.linksTo);if(t?.ast instanceof Le&&t.item instanceof Ye&&t.item.parent.name==="aliases"){let n=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(n)return e(n)}return[]}function H1(t){if(t?.ast instanceof zt||t?.ast instanceof Mr){let e=t.runtime.context.parser.cPreprocessorParser.macros.get(t.ast instanceof zt?t.ast.name:t.ast.value);if(e)return[jo.Location.create(fe(e.macro.uri),te(e.macro.identifier))]}return[]}async function hR(t,e){return Dt(t,e,n=>[...W1(n),...z1(n),...H1(n)])}var af=Y(Q());function G1(t){if(!t||t.item===null||!(t.ast instanceof Ve))return;let e=r=>r.replaces?e(r.replaces):r,n=r=>af.Location.create(fe(r.ast.uri),te(r.ast.propertyName??r.ast));if(t.item instanceof Ye&&t.ast instanceof Ve)return n(e(t.item));if(t.item instanceof we&&t.ast instanceof Ve&&t.ast.parentNode instanceof Ke){let r=t.item.deletedProperties.find(s=>s.by===t.ast.parentNode)?.property;if(r)return n(e(r))}}function K1(t){if(!t)return;let e=n=>{let r=n.definitions.at(0);return r?af.Location.create(fe(r.uri),te(r)):void 0};if(t.item instanceof we&&!At(t.ast))return e(t.item);if(t.ast instanceof Vt&&t.ast.parentNode instanceof be&&t.ast.parentNode.linksTo)return e(t.ast.parentNode.linksTo);if(t.ast instanceof qe&&t.ast.linksTo)return e(t.ast.linksTo);if(t?.ast instanceof Le&&t.item instanceof Ye&&t.item.parent.name==="aliases"){let n=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(n)return e(n)}}function Y1(t){if(t?.ast instanceof zt||t?.ast instanceof Mr){let e=t.runtime.context.parser.cPreprocessorParser.macros.get(t.ast instanceof zt?t.ast.name:t.ast.value);if(e)return af.Location.create(fe(e.macro.uri),te(e.macro.identifier))}}async function pR(t,e){return(await Dt(t,e,n=>[K1(n)||G1(n)||Y1(n)])).at(0)}var re=Y(Q());var X1=(t,e,n,r,s)=>{switch(n){case 1:return[{title:"Add semicolon",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[re.TextEdit.insert(re.Position.create(r.range.end.line,r.range.end.character),";")]}}}];case 2:return[{title:"Add open curly",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[re.TextEdit.insert(re.Position.create(r.range.end.line,r.range.end.character)," {")]}}}];case 29:return[{title:"Remove white space",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[re.TextEdit.replace(re.Range.create(re.Position.create(r.range.start.line,t.pos.colEnd),re.Position.create(r.range.end.line,e.pos.col)),"")]}}}];case 3:return[{title:"Add close curly",diagnostics:[r],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[re.TextEdit.insert(re.Position.create(r.range.end.line,r.range.end.character),"}")]}}}];case 19:return[{title:"Add '/'",diagnostics:[r],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[re.TextEdit.insert(re.Position.create(r.range.end.line,r.range.end.character),"/")]}}}];case 28:return[{title:"Add comma",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[re.TextEdit.insert(re.Position.create(r.range.end.line,r.range.end.character),",")]}}}];case 21:return[{title:"Add '/'",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[re.TextEdit.insert(re.Position.create(r.range.end.line,r.range.end.character),"/")]}}}];case 23:return[{title:"Remove ';'",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[re.TextEdit.del(r.range)]}}}];case 34:return[{title:"Complete Keyword '/delete-node/",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[re.TextEdit.replace(r.range,"/delete-node/")]}}}];case 35:return[{title:"Complete Keyword '/delete-property/",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[re.TextEdit.replace(r.range,"/delete-property/")]}}}];case 25:return[{title:"Complete Keyword '/delete-property/",diagnostics:[r],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[re.TextEdit.replace(r.range,"/delete-property/")]}}},{title:"Complete Keyword '/delete-node/",diagnostics:[r],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[s]:[re.TextEdit.replace(r.range,"/delete-node/")]}}}];case 12:return[{title:"Add '>'",diagnostics:[r],kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[s]:[re.TextEdit.insert(re.Position.create(r.range.end.line,r.range.end.character),">")]}}}];default:return}},J1=(t,e,n,r,s)=>{if(!r)return[];switch(t){case 0:return[{title:s??`Add Property "${r.newText.split("=",1)[0].replace(";","").trim()}"`,diagnostics:[e],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[n]:[r]}}}];case 27:return[{title:s??"Remove Property",diagnostics:[e],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[n]:[r]}}}];case 26:return[{title:s??"TODO",diagnostics:[e],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[n]:[r]}}}];case 25:return r?[{title:s??"TODO",diagnostics:[e],kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[n]:[r]}}}]:[];default:return}};function mR(t){let e=t.context.diagnostics.flatMap(a=>{let c=a.data;switch(c?.issues.type){case"SyntaxIssue":return c?.issues.items.flatMap(l=>X1(c.firstToken,c.lastToken,l,a,t.textDocument.uri));case"StandardTypeIssue":return c?.issues.items.flatMap(l=>J1(l,a,t.textDocument.uri,c.issues.edit,c.issues.codeActionTitle))}}).filter(a=>!!a),n=e.filter(a=>a.kind===re.CodeActionKind.SourceFixAll),r=e.filter(a=>a.title.startsWith("Add Property")),s=e.filter(a=>a.kind!==re.CodeActionKind.SourceFixAll),i=n.flatMap(a=>a.edit?.changes?.[t.textDocument.uri]??[]),o=new Map;return r.forEach(a=>{let c=a.edit.changes[t.textDocument.uri][0],l=c.range.start.line,u=c.range.start.character;o.has(`${l}:${u}`)||o.set(`${l}:${u}`,[]),o.get(`${l}:${u}`)?.push(c)}),[...s,...n.map(a=>({...a,kind:re.CodeActionKind.QuickFix})),...i.length?[{title:"Fix All",kind:re.CodeActionKind.SourceFixAll,isPreferred:!0,edit:{changes:{[t.textDocument.uri]:i}}}]:[],...Array.from(o.values()).flatMap(a=>a.length>1?{title:"Add All Missing Properties",kind:re.CodeActionKind.QuickFix,isPreferred:!0,edit:{changes:{[t.textDocument.uri]:a}}}:[])]}var cf=t=>!t||t instanceof $e?!1:t instanceof un||cf(t.parentNode);function Q1(t){if(!t||!(t.item instanceof Ye&&t.item.ast.assignOperatorToken))return[];let e=cf(t?.ast);if(!e&&!(t.ast instanceof $e&&t.item.ast.values===null)&&!cf(t.beforeAst)&&!cf(t.afterAst))return[];let n=-1;t.item.ast.values===null?n=0:n=(t.item.ast.values?.values.findIndex(s=>s&&vg(s,t.beforeAst))??-1)+1,n===-1&&(n=0);let r=t.item.parent.nodeType;return r instanceof Sn?r.properties.find(s=>s.name===t.item?.name)?.getPropertyCompletionItems(t.item,n,e)??[]:[]}function Z1(t){if(!t||!(t.item instanceof Ye&&t.ast instanceof Ve&&t.item.ast.values==null||t.item instanceof we)||At(t.ast)||t.beforeAst?.parentNode instanceof ln)return[];let e=n=>n.nodeType?.getPropertyListCompletionItems(n)??[];return t.item instanceof Ye?e(t.item.parent):e(t.item)}async function gR(t,e){return Dt(t,e,n=>[...Q1(n),...Z1(n)])}var lf=Y(Q());function yR(t){return!t||t instanceof Is?t:yR(t.parentNode)}async function e$(t){if(t?.ast instanceof zt||t?.ast instanceof Mr){let e=t.runtime.context.parser.cPreprocessorParser.macros.get(t?.ast instanceof zt?t.ast.name:t.ast.value);if(e){let n=yR(t.ast),r=(await t.runtime.context.getAllParsers()).at(-1);if(n){let s=n?.evaluate(r.cPreprocessorParser.macros);return{contents:{kind:lf.MarkupKind.Markdown,value:["```cpp",`#define ${e.macro.toString()} // = ${s}${typeof s=="number"?` (0x${s.toString(16)})`:""}`,"```"].join(`
281
+ `)},range:te(t.ast)}}return{contents:{kind:lf.MarkupKind.Markdown,value:["```cpp",`#define ${e.macro.toString()} // = ${t.ast?.evaluate(r.cPreprocessorParser.macros)}`,"```"].join(`
282
+ `)},range:te(t.ast)}}}}async function t$(t){if(!t)return;let e=(await t.runtime.context.getAllParsers()).at(-1);if(t?.item instanceof we)return{contents:t.item.toMarkupContent(e.cPreprocessorParser.macros),range:te(t.ast)};if(t?.ast instanceof qe){let n=t.ast.linksTo;if(n)return{contents:n.toMarkupContent(e.cPreprocessorParser.macros),range:te(t.ast)}}if(t?.ast.parentNode instanceof be){let n=t.ast.parentNode.linksTo;if(n)return{contents:n.toMarkupContent(e.cPreprocessorParser.macros),range:te(t.ast)}}if(t?.ast instanceof Le&&t.item instanceof Ye&&t.item.parent.name==="aliases"){let n=t.runtime.rootNode.getChild(t.ast.value.split("/"));if(n)return{contents:n.toMarkupContent(e.cPreprocessorParser.macros),range:te(t.ast)}}}function n$(t){if(t?.item instanceof Ye&&t.ast instanceof Ve){let e=t.item.onHover(),n=t.item.parent.nodeType?.getOnPropertyHover(t.item.name);if(e||n)return{contents:{kind:lf.MarkupKind.Markdown,value:`${e?.value??""}
283
+ ${n?.value??""}`},range:te(t.ast)}}}function bR(t,e){return Dt(t,e,async n=>[await t$(n)||n$(n)||await e$(n)])}var VT=Y(wb());var NC=Y(bC(),1);var Mc=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")};var xB={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Lc=t=>t.replace(/[[\]\\-]/g,"\\$&"),MB=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),vC=t=>t.join(""),TC=(t,e)=>{let n=e;if(t.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],s=[],i=n+1,o=!1,a=!1,c=!1,l=!1,u=n,d="";e:for(;i<t.length;){let m=t.charAt(i);if((m==="!"||m==="^")&&i===n+1){l=!0,i++;continue}if(m==="]"&&o&&!c){u=i+1;break}if(o=!0,m==="\\"&&!c){c=!0,i++;continue}if(m==="["&&!c){for(let[_,[E,T,b]]of Object.entries(xB))if(t.startsWith(_,i)){if(d)return["$.",!1,t.length-n,!0];i+=_.length,b?s.push(E):r.push(E),a=a||T;continue e}}if(c=!1,d){m>d?r.push(Lc(d)+"-"+Lc(m)):m===d&&r.push(Lc(m)),d="",i++;continue}if(t.startsWith("-]",i+1)){r.push(Lc(m+"-")),i+=2;continue}if(t.startsWith("-",i+1)){d=m,i+=2;continue}r.push(Lc(m)),i++}if(u<i)return["",!1,0,!1];if(!r.length&&!s.length)return["$.",!1,t.length-n,!0];if(s.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let m=r[0].length===2?r[0].slice(-1):r[0];return[MB(m),!1,u-n,!1]}let f="["+(l?"^":"")+vC(r)+"]",h="["+(l?"":"^")+vC(s)+"]";return[r.length&&s.length?"("+f+"|"+h+")":r.length?f:h,a,u-n,!0]};var yr=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var LB=new Set(["!","?","+","*","@"]),_C=t=>LB.has(t),$B="(?!(?:^|/)\\.\\.?(?:$|/))",ah="(?!\\.)",qB=new Set(["[","."]),jB=new Set(["..","."]),FB=new Set("().*{}+?[]^$\\!"),BB=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Pb="[^/]",SC=Pb+"*?",EC=Pb+"+?",Xo=class t{type;#e;#t;#s=!1;#n=[];#o;#f;#l;#d=!1;#a;#c;#i=!1;constructor(e,n,r={}){this.type=e,e&&(this.#t=!0),this.#o=n,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?r:this.#e.#a,this.#l=this.#e===this?[]:this.#e.#l,e==="!"&&!this.#e.#d&&this.#l.push(this),this.#f=this.#o?this.#o.#n.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#n)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#n.map(e=>String(e)).join("|")+")":this.#c=this.#n.map(e=>String(e)).join("")}#y(){if(this!==this.#e)throw new Error("should only call on root");if(this.#d)return this;this.toString(),this.#d=!0;let e;for(;e=this.#l.pop();){if(e.type!=="!")continue;let n=e,r=n.#o;for(;r;){for(let s=n.#f+1;!r.type&&s<r.#n.length;s++)for(let i of e.#n){if(typeof i=="string")throw new Error("string part in extglob AST??");i.copyIn(r.#n[s])}n=r,r=n.#o}}return this}push(...e){for(let n of e)if(n!==""){if(typeof n!="string"&&!(n instanceof t&&n.#o===this))throw new Error("invalid part: "+n);this.#n.push(n)}}toJSON(){let e=this.type===null?this.#n.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#n.map(n=>n.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#d&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#f===0)return!0;let e=this.#o;for(let n=0;n<this.#f;n++){let r=e.#n[n];if(!(r instanceof t&&r.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let e=this.#o?this.#o.#n.length:0;return this.#f===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let n=new t(this.type,e);for(let r of this.#n)n.copyIn(r);return n}static#b(e,n,r,s){let i=!1,o=!1,a=-1,c=!1;if(n.type===null){let h=r,y="";for(;h<e.length;){let m=e.charAt(h++);if(i||m==="\\"){i=!i,y+=m;continue}if(o){h===a+1?(m==="^"||m==="!")&&(c=!0):m==="]"&&!(h===a+2&&c)&&(o=!1),y+=m;continue}else if(m==="["){o=!0,a=h,c=!1,y+=m;continue}if(!s.noext&&_C(m)&&e.charAt(h)==="("){n.push(y),y="";let _=new t(m,n);h=t.#b(e,_,h,s),n.push(_);continue}y+=m}return n.push(y),h}let l=r+1,u=new t(null,n),d=[],f="";for(;l<e.length;){let h=e.charAt(l++);if(i||h==="\\"){i=!i,f+=h;continue}if(o){l===a+1?(h==="^"||h==="!")&&(c=!0):h==="]"&&!(l===a+2&&c)&&(o=!1),f+=h;continue}else if(h==="["){o=!0,a=l,c=!1,f+=h;continue}if(_C(h)&&e.charAt(l)==="("){u.push(f),f="";let y=new t(h,u);u.push(y),l=t.#b(e,y,l,s);continue}if(h==="|"){u.push(f),f="",d.push(u),u=new t(null,n);continue}if(h===")")return f===""&&n.#n.length===0&&(n.#i=!0),u.push(f),f="",n.push(...d,u),l;f+=h}return n.type=null,n.#t=void 0,n.#n=[e.substring(r-1)],l}static fromGlob(e,n={}){let r=new t(null,void 0,n);return t.#b(e,r,0,n),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[n,r,s,i]=this.toRegExpSource();if(!(s||this.#t||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let a=(this.#a.nocase?"i":"")+(i?"u":"");return Object.assign(new RegExp(`^${n}$`,a),{_src:n,_glob:e})}get options(){return this.#a}toRegExpSource(e){let n=e??!!this.#a.dot;if(this.#e===this&&this.#y(),!this.type){let c=this.isStart()&&this.isEnd(),l=this.#n.map(h=>{let[y,m,_,E]=typeof h=="string"?t.#h(h,this.#t,c):h.toRegExpSource(e);return this.#t=this.#t||_,this.#s=this.#s||E,y}).join(""),u="";if(this.isStart()&&typeof this.#n[0]=="string"&&!(this.#n.length===1&&jB.has(this.#n[0]))){let y=qB,m=n&&y.has(l.charAt(0))||l.startsWith("\\.")&&y.has(l.charAt(2))||l.startsWith("\\.\\.")&&y.has(l.charAt(4)),_=!n&&!e&&y.has(l.charAt(0));u=m?$B:_?ah:""}let d="";return this.isEnd()&&this.#e.#d&&this.#o?.type==="!"&&(d="(?:$|\\/)"),[u+l+d,yr(l),this.#t=!!this.#t,this.#s]}let r=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:",i=this.#p(n);if(this.isStart()&&this.isEnd()&&!i&&this.type!=="!"){let c=this.toString();return this.#n=[c],this.type=null,this.#t=void 0,[c,yr(this.toString()),!1,!1]}let o=!r||e||n||!ah?"":this.#p(!0);o===i&&(o=""),o&&(i=`(?:${i})(?:${o})*?`);let a="";if(this.type==="!"&&this.#i)a=(this.isStart()&&!n?ah:"")+EC;else{let c=this.type==="!"?"))"+(this.isStart()&&!n&&!e?ah:"")+SC+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=s+i+c}return[a,yr(i),this.#t=!!this.#t,this.#s]}#p(e){return this.#n.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,s,i,o]=n.toRegExpSource(e);return this.#s=this.#s||o,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#h(e,n,r=!1){let s=!1,i="",o=!1;for(let a=0;a<e.length;a++){let c=e.charAt(a);if(s){s=!1,i+=(FB.has(c)?"\\":"")+c;continue}if(c==="\\"){a===e.length-1?i+="\\\\":s=!0;continue}if(c==="["){let[l,u,d,f]=TC(e,a);if(d){i+=l,o=o||u,a+=d-1,n=n||f;continue}}if(c==="*"){r&&e==="*"?i+=EC:i+=SC,n=!0;continue}if(c==="?"){i+=Pb,n=!0;continue}i+=BB(c)}return[i,yr(e),!!n,o]}};var Jo=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");var dn=(t,e,n={})=>(Mc(e),!n.nocomment&&e.charAt(0)==="#"?!1:new $n(e,n).match(t)),UB=/^\*+([^+@!?\*\[\(]*)$/,VB=t=>e=>!e.startsWith(".")&&e.endsWith(t),zB=t=>e=>e.endsWith(t),WB=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),HB=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),GB=/^\*+\.\*+$/,KB=t=>!t.startsWith(".")&&t.includes("."),YB=t=>t!=="."&&t!==".."&&t.includes("."),XB=/^\.\*+$/,JB=t=>t!=="."&&t!==".."&&t.startsWith("."),QB=/^\*+$/,ZB=t=>t.length!==0&&!t.startsWith("."),eU=t=>t.length!==0&&t!=="."&&t!=="..",tU=/^\?+([^+@!?\*\[\(]*)?$/,nU=([t,e=""])=>{let n=PC([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},rU=([t,e=""])=>{let n=RC([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},sU=([t,e=""])=>{let n=RC([t]);return e?r=>n(r)&&r.endsWith(e):n},iU=([t,e=""])=>{let n=PC([t]);return e?r=>n(r)&&r.endsWith(e):n},PC=([t])=>{let e=t.length;return n=>n.length===e&&!n.startsWith(".")},RC=([t])=>{let e=t.length;return n=>n.length===e&&n!=="."&&n!==".."},DC=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",wC={win32:{sep:"\\"},posix:{sep:"/"}},oU=DC==="win32"?wC.win32.sep:wC.posix.sep;dn.sep=oU;var Ht=Symbol("globstar **");dn.GLOBSTAR=Ht;var aU="[^/]",cU=aU+"*?",lU="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",uU="(?:(?!(?:\\/|^)\\.).)*?",dU=(t,e={})=>n=>dn(n,t,e);dn.filter=dU;var Kn=(t,e={})=>Object.assign({},t,e),fU=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return dn;let e=dn;return Object.assign((r,s,i={})=>e(r,s,Kn(t,i)),{Minimatch:class extends e.Minimatch{constructor(s,i={}){super(s,Kn(t,i))}static defaults(s){return e.defaults(Kn(t,s)).Minimatch}},AST:class extends e.AST{constructor(s,i,o={}){super(s,i,Kn(t,o))}static fromGlob(s,i={}){return e.AST.fromGlob(s,Kn(t,i))}},unescape:(r,s={})=>e.unescape(r,Kn(t,s)),escape:(r,s={})=>e.escape(r,Kn(t,s)),filter:(r,s={})=>e.filter(r,Kn(t,s)),defaults:r=>e.defaults(Kn(t,r)),makeRe:(r,s={})=>e.makeRe(r,Kn(t,s)),braceExpand:(r,s={})=>e.braceExpand(r,Kn(t,s)),match:(r,s,i={})=>e.match(r,s,Kn(t,i)),sep:e.sep,GLOBSTAR:Ht})};dn.defaults=fU;var CC=(t,e={})=>(Mc(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,NC.default)(t));dn.braceExpand=CC;var hU=(t,e={})=>new $n(t,e).makeRe();dn.makeRe=hU;var pU=(t,e,n={})=>{let r=new $n(e,n);return t=t.filter(s=>r.match(s)),r.options.nonull&&!t.length&&t.push(e),t};dn.match=pU;var kC=/[?*]|[+@!]\(.*?\)|\[|\]/,mU=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),$n=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,n={}){Mc(e),n=n||{},this.options=n,this.pattern=e,this.platform=n.platform||DC,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let n of e)if(typeof n!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,n=this.options;if(!n.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...i)=>console.error(...i)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(i=>this.slashSplit(i));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let s=this.globParts.map((i,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=i[0]===""&&i[1]===""&&(i[2]==="?"||!kC.test(i[2]))&&!kC.test(i[3]),l=/^[a-z]:/i.test(i[0]);if(c)return[...i.slice(0,4),...i.slice(4).map(u=>this.parse(u))];if(l)return[i[0],...i.slice(1).map(u=>this.parse(u))]}return i.map(c=>this.parse(c))});if(this.debug(this.pattern,s),this.set=s.filter(i=>i.indexOf(!1)===-1),this.isWindows)for(let i=0;i<this.set.length;i++){let o=this.set[i];o[0]===""&&o[1]===""&&this.globParts[i][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let r=0;r<e.length;r++)for(let s=0;s<e[r].length;s++)e[r][s]==="**"&&(e[r][s]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):n>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let s=r;for(;n[s+1]==="**";)s++;s!==r&&n.splice(r,s-r)}return n})}levelOneOptimize(e){return e.map(n=>(n=n.reduce((r,s)=>{let i=r[r.length-1];return s==="**"&&i==="**"?r:s===".."&&i&&i!==".."&&i!=="."&&i!=="**"?(r.pop(),r):(r.push(s),r)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let s=1;s<e.length-1;s++){let i=e[s];s===1&&i===""&&e[0]===""||(i==="."||i==="")&&(n=!0,e.splice(s,1),s--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(n=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let s=e[r-1];s&&s!=="."&&s!==".."&&s!=="**"&&(n=!0,e.splice(r-1,2),r-=2)}}while(n);return e.length===0?[""]:e}firstPhasePreProcess(e){let n=!1;do{n=!1;for(let r of e){let s=-1;for(;(s=r.indexOf("**",s+1))!==-1;){let o=s;for(;r[o+1]==="**";)o++;o>s&&r.splice(s+1,o-s);let a=r[s+1],c=r[s+2],l=r[s+3];if(a!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;n=!0,r.splice(s,1);let u=r.slice(0);u[s]="**",e.push(u),s--}if(!this.preserveMultipleSlashes){for(let o=1;o<r.length-1;o++){let a=r[o];o===1&&a===""&&r[0]===""||(a==="."||a==="")&&(n=!0,r.splice(o,1),o--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(n=!0,r.pop())}let i=0;for(;(i=r.indexOf("..",i+1))!==-1;){let o=r[i-1];if(o&&o!=="."&&o!==".."&&o!=="**"){n=!0;let c=i===1&&r[i+1]==="**"?["."]:[];r.splice(i-1,2,...c),r.length===0&&r.push(""),i-=2}}}}while(n);return e}secondPhasePreProcess(e){for(let n=0;n<e.length-1;n++)for(let r=n+1;r<e.length;r++){let s=this.partsMatch(e[n],e[r],!this.preserveMultipleSlashes);if(s){e[n]=[],e[r]=s;break}}return e.filter(n=>n.length)}partsMatch(e,n,r=!1){let s=0,i=0,o=[],a="";for(;s<e.length&&i<n.length;)if(e[s]===n[i])o.push(a==="b"?n[i]:e[s]),s++,i++;else if(r&&e[s]==="**"&&n[i]===e[s+1])o.push(e[s]),s++;else if(r&&n[i]==="**"&&e[s]===n[i+1])o.push(n[i]),i++;else if(e[s]==="*"&&n[i]&&(this.options.dot||!n[i].startsWith("."))&&n[i]!=="**"){if(a==="b")return!1;a="a",o.push(e[s]),s++,i++}else if(n[i]==="*"&&e[s]&&(this.options.dot||!e[s].startsWith("."))&&e[s]!=="**"){if(a==="a")return!1;a="b",o.push(n[i]),s++,i++}else return!1;return e.length===n.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,n=!1,r=0;for(let s=0;s<e.length&&e.charAt(s)==="!";s++)n=!n,r++;r&&(this.pattern=e.slice(r)),this.negate=n}matchOne(e,n,r=!1){let s=this.options;if(this.isWindows){let m=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),_=!m&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),E=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),T=!E&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),b=_?3:m?0:void 0,R=T?3:E?0:void 0;if(typeof b=="number"&&typeof R=="number"){let[D,L]=[e[b],n[R]];D.toLowerCase()===L.toLowerCase()&&(n[R]=D,R>b?n=n.slice(R):b>R&&(e=e.slice(b)))}}let{optimizationLevel:i=1}=this.options;i>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:n}),this.debug("matchOne",e.length,n.length);for(var o=0,a=0,c=e.length,l=n.length;o<c&&a<l;o++,a++){this.debug("matchOne loop");var u=n[a],d=e[o];if(this.debug(n,u,d),u===!1)return!1;if(u===Ht){this.debug("GLOBSTAR",[n,u,d]);var f=o,h=a+1;if(h===l){for(this.debug("** at the end");o<c;o++)if(e[o]==="."||e[o]===".."||!s.dot&&e[o].charAt(0)===".")return!1;return!0}for(;f<c;){var y=e[f];if(this.debug(`
284
+ globstar while`,e,f,n,h,y),this.matchOne(e.slice(f),n.slice(h),r))return this.debug("globstar found match!",f,c,y),!0;if(y==="."||y===".."||!s.dot&&y.charAt(0)==="."){this.debug("dot detected!",e,f,n,h);break}this.debug("globstar swallow a segment, and continue"),f++}return!!(r&&(this.debug(`
285
+ >>> no match, partial?`,e,f,n,h),f===c))}let m;if(typeof u=="string"?(m=d===u,this.debug("string match",u,d,m)):(m=u.test(d),this.debug("pattern match",u,d,m)),!m)return!1}if(o===c&&a===l)return!0;if(o===c)return r;if(a===l)return o===c-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return CC(this.pattern,this.options)}parse(e){Mc(e);let n=this.options;if(e==="**")return Ht;if(e==="")return"";let r,s=null;(r=e.match(QB))?s=n.dot?eU:ZB:(r=e.match(UB))?s=(n.nocase?n.dot?HB:WB:n.dot?zB:VB)(r[1]):(r=e.match(tU))?s=(n.nocase?n.dot?rU:nU:n.dot?sU:iU)(r):(r=e.match(GB))?s=n.dot?YB:KB:(r=e.match(XB))&&(s=JB);let i=Xo.fromGlob(e,this.options).toMMPattern();return s&&typeof i=="object"&&Reflect.defineProperty(i,"test",{value:s}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?cU:n.dot?lU:uU,s=new Set(n.nocase?["i"]:[]),i=e.map(c=>{let l=c.map(u=>{if(u instanceof RegExp)for(let d of u.flags.split(""))s.add(d);return typeof u=="string"?mU(u):u===Ht?Ht:u._src});return l.forEach((u,d)=>{let f=l[d+1],h=l[d-1];u!==Ht||h===Ht||(h===void 0?f!==void 0&&f!==Ht?l[d+1]="(?:\\/|"+r+"\\/)?"+f:l[d]=r:f===void 0?l[d-1]=h+"(?:\\/|"+r+")?":f!==Ht&&(l[d-1]=h+"(?:\\/|\\/"+r+"\\/)"+f,l[d+1]=Ht))}),l.filter(u=>u!==Ht).join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];i="^"+o+i+a+"$",this.negate&&(i="^(?!"+i+").+$");try{this.regexp=new RegExp(i,[...s].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,n=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&n)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let s=this.slashSplit(e);this.debug(this.pattern,"split",s);let i=this.set;this.debug(this.pattern,"set",i);let o=s[s.length-1];if(!o)for(let a=s.length-2;!o&&a>=0;a--)o=s[a];for(let a=0;a<i.length;a++){let c=i[a],l=s;if(r.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return dn.defaults(e).Minimatch}};dn.AST=Xo;dn.Minimatch=$n;dn.escape=Jo;dn.unescape=yr;var eA=require("node:url");var Qo=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,OC=new Set,Rb=typeof process=="object"&&process?process:{},IC=(t,e,n,r)=>{typeof Rb.emitWarning=="function"?Rb.emitWarning(t,e,n,r):console.error(`[${n}] ${e}: ${t}`)},ch=globalThis.AbortController,AC=globalThis.AbortSignal;if(typeof ch>"u"){AC=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(r,s){this._onabort.push(s)}},ch=class{constructor(){e()}signal=new AC;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let s of this.signal._onabort)s(r);this.signal.onabort?.(r)}}};let t=Rb.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,IC("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var gU=t=>!OC.has(t),Ire=Symbol("type"),Ws=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),xC=t=>Ws(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Zo:null:null,Zo=class extends Array{constructor(e){super(e),this.fill(0)}},Db=class t{heap;length;static#e=!1;static create(e){let n=xC(e);if(!n)return[];t.#e=!0;let r=new t(e,n);return t.#e=!1,r}constructor(e,n){if(!t.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},$c=class t{#e;#t;#s;#n;#o;#f;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#d;#a;#c;#i;#y;#b;#p;#h;#E;#g;#w;#k;#T;#_;#S;#m;static unsafeExposeInternals(e){return{starts:e.#k,ttls:e.#T,sizes:e.#w,keyMap:e.#a,keyList:e.#c,valList:e.#i,next:e.#y,prev:e.#b,get head(){return e.#p},get tail(){return e.#h},free:e.#E,isBackgroundFetch:n=>e.#u(n),backgroundFetch:(n,r,s,i)=>e.#q(n,r,s,i),moveToTail:n=>e.#F(n),indexes:n=>e.#P(n),rindexes:n=>e.#R(n),isStale:n=>e.#v(n)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#d}get size(){return this.#l}get fetchMethod(){return this.#o}get memoMethod(){return this.#f}get dispose(){return this.#s}get disposeAfter(){return this.#n}constructor(e){let{max:n=0,ttl:r,ttlResolution:s=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:f,maxSize:h=0,maxEntrySize:y=0,sizeCalculation:m,fetchMethod:_,memoMethod:E,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:R,allowStaleOnFetchAbort:D,ignoreFetchAbort:L}=e;if(n!==0&&!Ws(n))throw new TypeError("max option must be a nonnegative integer");let H=n?xC(n):Array;if(!H)throw new Error("invalid max value: "+n);if(this.#e=n,this.#t=h,this.maxEntrySize=y||this.#t,this.sizeCalculation=m,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(E!==void 0&&typeof E!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#f=E,_!==void 0&&typeof _!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=_,this.#S=!!_,this.#a=new Map,this.#c=new Array(n).fill(void 0),this.#i=new Array(n).fill(void 0),this.#y=new H(n),this.#b=new H(n),this.#p=0,this.#h=0,this.#E=Db.create(n),this.#l=0,this.#d=0,typeof l=="function"&&(this.#s=l),typeof u=="function"?(this.#n=u,this.#g=[]):(this.#n=void 0,this.#g=void 0),this.#_=!!this.#s,this.#m=!!this.#n,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!T,this.allowStaleOnFetchRejection=!!R,this.allowStaleOnFetchAbort=!!D,this.ignoreFetchAbort=!!L,this.maxEntrySize!==0){if(this.#t!==0&&!Ws(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!Ws(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#C()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=Ws(s)||s===0?s:1,this.ttlAutopurge=!!i,this.ttl=r||0,this.ttl){if(!Ws(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#D()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let U="LRU_CACHE_UNBOUNDED";gU(U)&&(OC.add(U),IC("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",U,t))}}getRemainingTTL(e){return this.#a.has(e)?1/0:0}#D(){let e=new Zo(this.#e),n=new Zo(this.#e);this.#T=e,this.#k=n,this.#O=(i,o,a=Qo.now())=>{if(n[i]=o!==0?a:0,e[i]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#v(i)&&this.#A(this.#c[i],"expire")},o+1);c.unref&&c.unref()}},this.#N=i=>{n[i]=e[i]!==0?Qo.now():0},this.#r=(i,o)=>{if(e[o]){let a=e[o],c=n[o];if(!a||!c)return;i.ttl=a,i.start=c,i.now=r||s();let l=i.now-c;i.remainingTTL=a-l}};let r=0,s=()=>{let i=Qo.now();if(this.ttlResolution>0){r=i;let o=setTimeout(()=>r=0,this.ttlResolution);o.unref&&o.unref()}return i};this.getRemainingTTL=i=>{let o=this.#a.get(i);if(o===void 0)return 0;let a=e[o],c=n[o];if(!a||!c)return 1/0;let l=(r||s())-c;return a-l},this.#v=i=>{let o=n[i],a=e[i];return!!a&&!!o&&(r||s())-o>a}}#N=()=>{};#r=()=>{};#O=()=>{};#v=()=>!1;#C(){let e=new Zo(this.#e);this.#d=0,this.#w=e,this.#I=n=>{this.#d-=e[n],e[n]=0},this.#M=(n,r,s,i)=>{if(this.#u(r))return 0;if(!Ws(s))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(s=i(r,n),!Ws(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#x=(n,r,s)=>{if(e[n]=r,this.#t){let i=this.#t-e[n];for(;this.#d>i;)this.#$(!0)}this.#d+=e[n],s&&(s.entrySize=r,s.totalCalculatedSize=this.#d)}}#I=e=>{};#x=(e,n,r)=>{};#M=(e,n,r,s)=>{if(r||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#P({allowStale:e=this.allowStale}={}){if(this.#l)for(let n=this.#h;!(!this.#L(n)||((e||!this.#v(n))&&(yield n),n===this.#p));)n=this.#b[n]}*#R({allowStale:e=this.allowStale}={}){if(this.#l)for(let n=this.#p;!(!this.#L(n)||((e||!this.#v(n))&&(yield n),n===this.#h));)n=this.#y[n]}#L(e){return e!==void 0&&this.#a.get(this.#c[e])===e}*entries(){for(let e of this.#P())this.#i[e]!==void 0&&this.#c[e]!==void 0&&!this.#u(this.#i[e])&&(yield[this.#c[e],this.#i[e]])}*rentries(){for(let e of this.#R())this.#i[e]!==void 0&&this.#c[e]!==void 0&&!this.#u(this.#i[e])&&(yield[this.#c[e],this.#i[e]])}*keys(){for(let e of this.#P()){let n=this.#c[e];n!==void 0&&!this.#u(this.#i[e])&&(yield n)}}*rkeys(){for(let e of this.#R()){let n=this.#c[e];n!==void 0&&!this.#u(this.#i[e])&&(yield n)}}*values(){for(let e of this.#P())this.#i[e]!==void 0&&!this.#u(this.#i[e])&&(yield this.#i[e])}*rvalues(){for(let e of this.#R())this.#i[e]!==void 0&&!this.#u(this.#i[e])&&(yield this.#i[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,n={}){for(let r of this.#P()){let s=this.#i[r],i=this.#u(s)?s.__staleWhileFetching:s;if(i!==void 0&&e(i,this.#c[r],this))return this.get(this.#c[r],n)}}forEach(e,n=this){for(let r of this.#P()){let s=this.#i[r],i=this.#u(s)?s.__staleWhileFetching:s;i!==void 0&&e.call(n,i,this.#c[r],this)}}rforEach(e,n=this){for(let r of this.#R()){let s=this.#i[r],i=this.#u(s)?s.__staleWhileFetching:s;i!==void 0&&e.call(n,i,this.#c[r],this)}}purgeStale(){let e=!1;for(let n of this.#R({allowStale:!0}))this.#v(n)&&(this.#A(this.#c[n],"expire"),e=!0);return e}info(e){let n=this.#a.get(e);if(n===void 0)return;let r=this.#i[n],s=this.#u(r)?r.__staleWhileFetching:r;if(s===void 0)return;let i={value:s};if(this.#T&&this.#k){let o=this.#T[n],a=this.#k[n];if(o&&a){let c=o-(Qo.now()-a);i.ttl=c,i.start=Date.now()}}return this.#w&&(i.size=this.#w[n]),i}dump(){let e=[];for(let n of this.#P({allowStale:!0})){let r=this.#c[n],s=this.#i[n],i=this.#u(s)?s.__staleWhileFetching:s;if(i===void 0||r===void 0)continue;let o={value:i};if(this.#T&&this.#k){o.ttl=this.#T[n];let a=Qo.now()-this.#k[n];o.start=Math.floor(Date.now()-a)}this.#w&&(o.size=this.#w[n]),e.unshift([r,o])}return e}load(e){this.clear();for(let[n,r]of e){if(r.start){let s=Date.now()-r.start;r.start=Qo.now()-s}this.set(n,r.value,r)}}set(e,n,r={}){if(n===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=r,{noUpdateTTL:l=this.noUpdateTTL}=r,u=this.#M(e,n,r.size||0,a);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#A(e,"set"),this;let d=this.#l===0?void 0:this.#a.get(e);if(d===void 0)d=this.#l===0?this.#h:this.#E.length!==0?this.#E.pop():this.#l===this.#e?this.#$(!1):this.#l,this.#c[d]=e,this.#i[d]=n,this.#a.set(e,d),this.#y[this.#h]=d,this.#b[d]=this.#h,this.#h=d,this.#l++,this.#x(d,u,c),c&&(c.set="add"),l=!1;else{this.#F(d);let f=this.#i[d];if(n!==f){if(this.#S&&this.#u(f)){f.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:h}=f;h!==void 0&&!o&&(this.#_&&this.#s?.(h,e,"set"),this.#m&&this.#g?.push([h,e,"set"]))}else o||(this.#_&&this.#s?.(f,e,"set"),this.#m&&this.#g?.push([f,e,"set"]));if(this.#I(d),this.#x(d,u,c),this.#i[d]=n,c){c.set="replace";let h=f&&this.#u(f)?f.__staleWhileFetching:f;h!==void 0&&(c.oldValue=h)}}else c&&(c.set="update")}if(s!==0&&!this.#T&&this.#D(),this.#T&&(l||this.#O(d,s,i),c&&this.#r(c,d)),!o&&this.#m&&this.#g){let f=this.#g,h;for(;h=f?.shift();)this.#n?.(...h)}return this}pop(){try{for(;this.#l;){let e=this.#i[this.#p];if(this.#$(!0),this.#u(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#m&&this.#g){let e=this.#g,n;for(;n=e?.shift();)this.#n?.(...n)}}}#$(e){let n=this.#p,r=this.#c[n],s=this.#i[n];return this.#S&&this.#u(s)?s.__abortController.abort(new Error("evicted")):(this.#_||this.#m)&&(this.#_&&this.#s?.(s,r,"evict"),this.#m&&this.#g?.push([s,r,"evict"])),this.#I(n),e&&(this.#c[n]=void 0,this.#i[n]=void 0,this.#E.push(n)),this.#l===1?(this.#p=this.#h=0,this.#E.length=0):this.#p=this.#y[n],this.#a.delete(r),this.#l--,n}has(e,n={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:s}=n,i=this.#a.get(e);if(i!==void 0){let o=this.#i[i];if(this.#u(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#v(i))s&&(s.has="stale",this.#r(s,i));else return r&&this.#N(i),s&&(s.has="hit",this.#r(s,i)),!0}else s&&(s.has="miss");return!1}peek(e,n={}){let{allowStale:r=this.allowStale}=n,s=this.#a.get(e);if(s===void 0||!r&&this.#v(s))return;let i=this.#i[s];return this.#u(i)?i.__staleWhileFetching:i}#q(e,n,r,s){let i=n===void 0?void 0:this.#i[n];if(this.#u(i))return i;let o=new ch,{signal:a}=r;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:r,context:s},l=(m,_=!1)=>{let{aborted:E}=o.signal,T=r.ignoreFetchAbort&&m!==void 0;if(r.status&&(E&&!_?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,T&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),E&&!T&&!_)return d(o.signal.reason);let b=h;return this.#i[n]===h&&(m===void 0?b.__staleWhileFetching?this.#i[n]=b.__staleWhileFetching:this.#A(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,m,c.options))),m},u=m=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=m),d(m)),d=m=>{let{aborted:_}=o.signal,E=_&&r.allowStaleOnFetchAbort,T=E||r.allowStaleOnFetchRejection,b=T||r.noDeleteOnFetchRejection,R=h;if(this.#i[n]===h&&(!b||R.__staleWhileFetching===void 0?this.#A(e,"fetch"):E||(this.#i[n]=R.__staleWhileFetching)),T)return r.status&&R.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),R.__staleWhileFetching;if(R.__returned===R)throw m},f=(m,_)=>{let E=this.#o?.(e,i,c);E&&E instanceof Promise&&E.then(T=>m(T===void 0?void 0:T),_),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(m(void 0),r.allowStaleOnFetchAbort&&(m=T=>l(T,!0)))})};r.status&&(r.status.fetchDispatched=!0);let h=new Promise(f).then(l,u),y=Object.assign(h,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return n===void 0?(this.set(e,y,{...c.options,status:void 0}),n=this.#a.get(e)):this.#i[n]=y,y}#u(e){if(!this.#S)return!1;let n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof ch}async fetch(e,n={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:m,forceRefresh:_=!1,status:E,signal:T}=n;if(!this.#S)return E&&(E.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:i,status:E});let b={allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:y,ignoreFetchAbort:h,status:E,signal:T},R=this.#a.get(e);if(R===void 0){E&&(E.fetch="miss");let D=this.#q(e,R,b,m);return D.__returned=D}else{let D=this.#i[R];if(this.#u(D)){let Be=r&&D.__staleWhileFetching!==void 0;return E&&(E.fetch="inflight",Be&&(E.returnedStale=!0)),Be?D.__staleWhileFetching:D.__returned=D}let L=this.#v(R);if(!_&&!L)return E&&(E.fetch="hit"),this.#F(R),s&&this.#N(R),E&&this.#r(E,R),D;let H=this.#q(e,R,b,m),oe=H.__staleWhileFetching!==void 0&&r;return E&&(E.fetch=L?"stale":"refresh",oe&&L&&(E.returnedStale=!0)),oe?H.__staleWhileFetching:H.__returned=H}}async forceFetch(e,n={}){let r=await this.fetch(e,n);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,n={}){let r=this.#f;if(!r)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:i,...o}=n,a=this.get(e,o);if(!i&&a!==void 0)return a;let c=r(e,a,{options:o,context:s});return this.set(e,c,o),c}get(e,n={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=n,a=this.#a.get(e);if(a!==void 0){let c=this.#i[a],l=this.#u(c);return o&&this.#r(o,a),this.#v(a)?(o&&(o.get="stale"),l?(o&&r&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),r?c.__staleWhileFetching:void 0):(i||this.#A(e,"expire"),o&&r&&(o.returnedStale=!0),r?c:void 0)):(o&&(o.get="hit"),l?c.__staleWhileFetching:(this.#F(a),s&&this.#N(a),c))}else o&&(o.get="miss")}#j(e,n){this.#b[n]=e,this.#y[e]=n}#F(e){e!==this.#h&&(e===this.#p?this.#p=this.#y[e]:this.#j(this.#b[e],this.#y[e]),this.#j(this.#h,e),this.#h=e)}delete(e){return this.#A(e,"delete")}#A(e,n){let r=!1;if(this.#l!==0){let s=this.#a.get(e);if(s!==void 0)if(r=!0,this.#l===1)this.#B(n);else{this.#I(s);let i=this.#i[s];if(this.#u(i)?i.__abortController.abort(new Error("deleted")):(this.#_||this.#m)&&(this.#_&&this.#s?.(i,e,n),this.#m&&this.#g?.push([i,e,n])),this.#a.delete(e),this.#c[s]=void 0,this.#i[s]=void 0,s===this.#h)this.#h=this.#b[s];else if(s===this.#p)this.#p=this.#y[s];else{let o=this.#b[s];this.#y[o]=this.#y[s];let a=this.#y[s];this.#b[a]=this.#b[s]}this.#l--,this.#E.push(s)}}if(this.#m&&this.#g?.length){let s=this.#g,i;for(;i=s?.shift();)this.#n?.(...i)}return r}clear(){return this.#B("delete")}#B(e){for(let n of this.#R({allowStale:!0})){let r=this.#i[n];if(this.#u(r))r.__abortController.abort(new Error("deleted"));else{let s=this.#c[n];this.#_&&this.#s?.(r,s,e),this.#m&&this.#g?.push([r,s,e])}}if(this.#a.clear(),this.#i.fill(void 0),this.#c.fill(void 0),this.#T&&this.#k&&(this.#T.fill(0),this.#k.fill(0)),this.#w&&this.#w.fill(0),this.#p=0,this.#h=0,this.#E.length=0,this.#d=0,this.#l=0,this.#m&&this.#g){let n=this.#g,r;for(;r=n?.shift();)this.#n?.(...r)}}};var na=require("node:path"),zC=require("node:url"),Ur=require("fs"),NU=Y(require("node:fs"),1),Ks=require("node:fs/promises");var mh=require("node:events"),Lb=Y(require("node:stream"),1),jC=require("node:string_decoder"),MC=typeof process=="object"&&process?process:{stdout:null,stderr:null},yU=t=>!!t&&typeof t=="object"&&(t instanceof Gs||t instanceof Lb.default||bU(t)||vU(t)),bU=t=>!!t&&typeof t=="object"&&t instanceof mh.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==Lb.default.Writable.prototype.pipe,vU=t=>!!t&&typeof t=="object"&&t instanceof mh.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function",ss=Symbol("EOF"),is=Symbol("maybeEmitEnd"),Hs=Symbol("emittedEnd"),lh=Symbol("emittingEnd"),qc=Symbol("emittedError"),uh=Symbol("closed"),LC=Symbol("read"),dh=Symbol("flush"),$C=Symbol("flushChunk"),br=Symbol("encoding"),ea=Symbol("decoder"),qt=Symbol("flowing"),jc=Symbol("paused"),ta=Symbol("resume"),jt=Symbol("buffer"),fn=Symbol("pipes"),Ft=Symbol("bufferLength"),Cb=Symbol("bufferPush"),fh=Symbol("bufferShift"),en=Symbol("objectMode"),St=Symbol("destroyed"),Ab=Symbol("error"),Ob=Symbol("emitData"),qC=Symbol("emitEnd"),Ib=Symbol("emitEnd2"),Fr=Symbol("async"),xb=Symbol("abort"),hh=Symbol("aborted"),Fc=Symbol("signal"),Ci=Symbol("dataListeners"),qn=Symbol("discarded"),Bc=t=>Promise.resolve().then(t),TU=t=>t(),_U=t=>t==="end"||t==="finish"||t==="prefinish",SU=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,EU=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),ph=class{src;dest;opts;ondrain;constructor(e,n,r){this.src=e,this.dest=n,this.opts=r,this.ondrain=()=>e[ta](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Mb=class extends ph{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,n,r){super(e,n,r),this.proxyErrors=s=>n.emit("error",s),e.on("error",this.proxyErrors)}},wU=t=>!!t.objectMode,kU=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",Gs=class extends mh.EventEmitter{[qt]=!1;[jc]=!1;[fn]=[];[jt]=[];[en];[br];[Fr];[ea];[ss]=!1;[Hs]=!1;[lh]=!1;[uh]=!1;[qc]=null;[Ft]=0;[St]=!1;[Fc];[hh]=!1;[Ci]=0;[qn]=!1;writable=!0;readable=!0;constructor(...e){let n=e[0]||{};if(super(),n.objectMode&&typeof n.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");wU(n)?(this[en]=!0,this[br]=null):kU(n)?(this[br]=n.encoding,this[en]=!1):(this[en]=!1,this[br]=null),this[Fr]=!!n.async,this[ea]=this[br]?new jC.StringDecoder(this[br]):null,n&&n.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[jt]}),n&&n.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[fn]});let{signal:r}=n;r&&(this[Fc]=r,r.aborted?this[xb]():r.addEventListener("abort",()=>this[xb]()))}get bufferLength(){return this[Ft]}get encoding(){return this[br]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[en]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Fr]}set async(e){this[Fr]=this[Fr]||!!e}[xb](){this[hh]=!0,this.emit("abort",this[Fc]?.reason),this.destroy(this[Fc]?.reason)}get aborted(){return this[hh]}set aborted(e){}write(e,n,r){if(this[hh])return!1;if(this[ss])throw new Error("write after end");if(this[St])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof n=="function"&&(r=n,n="utf8"),n||(n="utf8");let s=this[Fr]?Bc:TU;if(!this[en]&&!Buffer.isBuffer(e)){if(EU(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(SU(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[en]?(this[qt]&&this[Ft]!==0&&this[dh](!0),this[qt]?this.emit("data",e):this[Cb](e),this[Ft]!==0&&this.emit("readable"),r&&s(r),this[qt]):e.length?(typeof e=="string"&&!(n===this[br]&&!this[ea]?.lastNeed)&&(e=Buffer.from(e,n)),Buffer.isBuffer(e)&&this[br]&&(e=this[ea].write(e)),this[qt]&&this[Ft]!==0&&this[dh](!0),this[qt]?this.emit("data",e):this[Cb](e),this[Ft]!==0&&this.emit("readable"),r&&s(r),this[qt]):(this[Ft]!==0&&this.emit("readable"),r&&s(r),this[qt])}read(e){if(this[St])return null;if(this[qn]=!1,this[Ft]===0||e===0||e&&e>this[Ft])return this[is](),null;this[en]&&(e=null),this[jt].length>1&&!this[en]&&(this[jt]=[this[br]?this[jt].join(""):Buffer.concat(this[jt],this[Ft])]);let n=this[LC](e||null,this[jt][0]);return this[is](),n}[LC](e,n){if(this[en])this[fh]();else{let r=n;e===r.length||e===null?this[fh]():typeof r=="string"?(this[jt][0]=r.slice(e),n=r.slice(0,e),this[Ft]-=e):(this[jt][0]=r.subarray(e),n=r.subarray(0,e),this[Ft]-=e)}return this.emit("data",n),!this[jt].length&&!this[ss]&&this.emit("drain"),n}end(e,n,r){return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n="utf8"),e!==void 0&&this.write(e,n),r&&this.once("end",r),this[ss]=!0,this.writable=!1,(this[qt]||!this[jc])&&this[is](),this}[ta](){this[St]||(!this[Ci]&&!this[fn].length&&(this[qn]=!0),this[jc]=!1,this[qt]=!0,this.emit("resume"),this[jt].length?this[dh]():this[ss]?this[is]():this.emit("drain"))}resume(){return this[ta]()}pause(){this[qt]=!1,this[jc]=!0,this[qn]=!1}get destroyed(){return this[St]}get flowing(){return this[qt]}get paused(){return this[jc]}[Cb](e){this[en]?this[Ft]+=1:this[Ft]+=e.length,this[jt].push(e)}[fh](){return this[en]?this[Ft]-=1:this[Ft]-=this[jt][0].length,this[jt].shift()}[dh](e=!1){do;while(this[$C](this[fh]())&&this[jt].length);!e&&!this[jt].length&&!this[ss]&&this.emit("drain")}[$C](e){return this.emit("data",e),this[qt]}pipe(e,n){if(this[St])return e;this[qn]=!1;let r=this[Hs];return n=n||{},e===MC.stdout||e===MC.stderr?n.end=!1:n.end=n.end!==!1,n.proxyErrors=!!n.proxyErrors,r?n.end&&e.end():(this[fn].push(n.proxyErrors?new Mb(this,e,n):new ph(this,e,n)),this[Fr]?Bc(()=>this[ta]()):this[ta]()),e}unpipe(e){let n=this[fn].find(r=>r.dest===e);n&&(this[fn].length===1?(this[qt]&&this[Ci]===0&&(this[qt]=!1),this[fn]=[]):this[fn].splice(this[fn].indexOf(n),1),n.unpipe())}addListener(e,n){return this.on(e,n)}on(e,n){let r=super.on(e,n);if(e==="data")this[qn]=!1,this[Ci]++,!this[fn].length&&!this[qt]&&this[ta]();else if(e==="readable"&&this[Ft]!==0)super.emit("readable");else if(_U(e)&&this[Hs])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[qc]){let s=n;this[Fr]?Bc(()=>s.call(this,this[qc])):s.call(this,this[qc])}return r}removeListener(e,n){return this.off(e,n)}off(e,n){let r=super.off(e,n);return e==="data"&&(this[Ci]=this.listeners("data").length,this[Ci]===0&&!this[qn]&&!this[fn].length&&(this[qt]=!1)),r}removeAllListeners(e){let n=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Ci]=0,!this[qn]&&!this[fn].length&&(this[qt]=!1)),n}get emittedEnd(){return this[Hs]}[is](){!this[lh]&&!this[Hs]&&!this[St]&&this[jt].length===0&&this[ss]&&(this[lh]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[uh]&&this.emit("close"),this[lh]=!1)}emit(e,...n){let r=n[0];if(e!=="error"&&e!=="close"&&e!==St&&this[St])return!1;if(e==="data")return!this[en]&&!r?!1:this[Fr]?(Bc(()=>this[Ob](r)),!0):this[Ob](r);if(e==="end")return this[qC]();if(e==="close"){if(this[uh]=!0,!this[Hs]&&!this[St])return!1;let i=super.emit("close");return this.removeAllListeners("close"),i}else if(e==="error"){this[qc]=r,super.emit(Ab,r);let i=!this[Fc]||this.listeners("error").length?super.emit("error",r):!1;return this[is](),i}else if(e==="resume"){let i=super.emit("resume");return this[is](),i}else if(e==="finish"||e==="prefinish"){let i=super.emit(e);return this.removeAllListeners(e),i}let s=super.emit(e,...n);return this[is](),s}[Ob](e){for(let r of this[fn])r.dest.write(e)===!1&&this.pause();let n=this[qn]?!1:super.emit("data",e);return this[is](),n}[qC](){return this[Hs]?!1:(this[Hs]=!0,this.readable=!1,this[Fr]?(Bc(()=>this[Ib]()),!0):this[Ib]())}[Ib](){if(this[ea]){let n=this[ea].end();if(n){for(let r of this[fn])r.dest.write(n);this[qn]||super.emit("data",n)}}for(let n of this[fn])n.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[en]||(e.dataLength=0);let n=this.promise();return this.on("data",r=>{e.push(r),this[en]||(e.dataLength+=r.length)}),await n,e}async concat(){if(this[en])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[br]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,n)=>{this.on(St,()=>n(new Error("stream destroyed"))),this.on("error",r=>n(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[qn]=!1;let e=!1,n=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return n();let s=this.read();if(s!==null)return Promise.resolve({done:!1,value:s});if(this[ss])return n();let i,o,a=d=>{this.off("data",c),this.off("end",l),this.off(St,u),n(),o(d)},c=d=>{this.off("error",a),this.off("end",l),this.off(St,u),this.pause(),i({value:d,done:!!this[ss]})},l=()=>{this.off("error",a),this.off("data",c),this.off(St,u),n(),i({done:!0,value:void 0})},u=()=>a(new Error("stream destroyed"));return new Promise((d,f)=>{o=f,i=d,this.once(St,u),this.once("error",a),this.once("end",l),this.once("data",c)})},throw:n,return:n,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[qn]=!1;let e=!1,n=()=>(this.pause(),this.off(Ab,n),this.off(St,n),this.off("end",n),e=!0,{done:!0,value:void 0}),r=()=>{if(e)return n();let s=this.read();return s===null?n():{done:!1,value:s}};return this.once("end",n),this.once(Ab,n),this.once(St,n),{next:r,throw:n,return:n,[Symbol.iterator](){return this}}}destroy(e){if(this[St])return e?this.emit("error",e):this.emit(St),this;this[St]=!0,this[qn]=!0,this[jt].length=0,this[Ft]=0;let n=this;return typeof n.close=="function"&&!this[uh]&&n.close(),e?this.emit("error",e):this.emit(St),this}static get isStream(){return yU}};var PU=Ur.realpathSync.native,Vc={lstatSync:Ur.lstatSync,readdir:Ur.readdir,readdirSync:Ur.readdirSync,readlinkSync:Ur.readlinkSync,realpathSync:PU,promises:{lstat:Ks.lstat,readdir:Ks.readdir,readlink:Ks.readlink,realpath:Ks.realpath}},WC=t=>!t||t===Vc||t===NU?Vc:{...Vc,...t,promises:{...Vc.promises,...t.promises||{}}},HC=/^\\\\\?\\([a-z]:)\\?$/i,RU=t=>t.replace(/\//g,"\\").replace(HC,"$1\\"),DU=/[\\\/]/,Xn=0,GC=1,KC=2,Br=4,YC=6,XC=8,Ai=10,JC=12,Yn=15,Uc=~Yn,$b=16,FC=32,zc=64,vr=128,gh=256,bh=512,BC=zc|vr|bh,CU=1023,qb=t=>t.isFile()?XC:t.isDirectory()?Br:t.isSymbolicLink()?Ai:t.isCharacterDevice()?KC:t.isBlockDevice()?YC:t.isSocket()?JC:t.isFIFO()?GC:Xn,UC=new Map,Wc=t=>{let e=UC.get(t);if(e)return e;let n=t.normalize("NFKD");return UC.set(t,n),n},VC=new Map,yh=t=>{let e=VC.get(t);if(e)return e;let n=Wc(t.toLowerCase());return VC.set(t,n),n},vh=class extends $c{constructor(){super({max:256})}},jb=class extends $c{constructor(e=16*1024){super({maxSize:e,sizeCalculation:n=>n.length+1})}},QC=Symbol("PathScurry setAsCwd"),tn=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#s;get mode(){return this.#s}#n;get nlink(){return this.#n}#o;get uid(){return this.#o}#f;get gid(){return this.#f}#l;get rdev(){return this.#l}#d;get blksize(){return this.#d}#a;get ino(){return this.#a}#c;get size(){return this.#c}#i;get blocks(){return this.#i}#y;get atimeMs(){return this.#y}#b;get mtimeMs(){return this.#b}#p;get ctimeMs(){return this.#p}#h;get birthtimeMs(){return this.#h}#E;get atime(){return this.#E}#g;get mtime(){return this.#g}#w;get ctime(){return this.#w}#k;get birthtime(){return this.#k}#T;#_;#S;#m;#D;#N;#r;#O;#v;#C;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,n=Xn,r,s,i,o,a){this.name=e,this.#T=i?yh(e):Wc(e),this.#r=n&CU,this.nocase=i,this.roots=s,this.root=r||this,this.#O=o,this.#S=a.fullpath,this.#D=a.relative,this.#N=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=WC(a.fs)}depth(){return this.#_!==void 0?this.#_:this.parent?this.#_=this.parent.depth()+1:this.#_=0}childrenCache(){return this.#O}resolve(e){if(!e)return this;let n=this.getRootString(e),s=e.substring(n.length).split(this.splitSep);return n?this.getRoot(n).#I(s):this.#I(s)}#I(e){let n=this;for(let r of e)n=n.child(r);return n}children(){let e=this.#O.get(this);if(e)return e;let n=Object.assign([],{provisional:0});return this.#O.set(this,n),this.#r&=~$b,n}child(e,n){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),s=this.nocase?yh(e):Wc(e);for(let c of r)if(c.#T===s)return c;let i=this.parent?this.sep:"",o=this.#S?this.#S+i+e:void 0,a=this.newChild(e,Xn,{...n,parent:this,fullpath:o});return this.canReaddir()||(a.#r|=vr),r.push(a),a}relative(){if(this.isCWD)return"";if(this.#D!==void 0)return this.#D;let e=this.name,n=this.parent;if(!n)return this.#D=this.name;let r=n.relative();return r+(!r||!n.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#N!==void 0)return this.#N;let e=this.name,n=this.parent;if(!n)return this.#N=this.fullpathPosix();let r=n.relativePosix();return r+(!r||!n.parent?"":"/")+e}fullpath(){if(this.#S!==void 0)return this.#S;let e=this.name,n=this.parent;if(!n)return this.#S=this.name;let s=n.fullpath()+(n.parent?this.sep:"")+e;return this.#S=s}fullpathPosix(){if(this.#m!==void 0)return this.#m;if(this.sep==="/")return this.#m=this.fullpath();if(!this.parent){let s=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(s)?this.#m=`//?/${s}`:this.#m=s}let e=this.parent,n=e.fullpathPosix(),r=n+(!n||!e.parent?"":"/")+this.name;return this.#m=r}isUnknown(){return(this.#r&Yn)===Xn}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#r&Yn)===XC}isDirectory(){return(this.#r&Yn)===Br}isCharacterDevice(){return(this.#r&Yn)===KC}isBlockDevice(){return(this.#r&Yn)===YC}isFIFO(){return(this.#r&Yn)===GC}isSocket(){return(this.#r&Yn)===JC}isSymbolicLink(){return(this.#r&Ai)===Ai}lstatCached(){return this.#r&FC?this:void 0}readlinkCached(){return this.#v}realpathCached(){return this.#C}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#v)return!0;if(!this.parent)return!1;let e=this.#r&Yn;return!(e!==Xn&&e!==Ai||this.#r&gh||this.#r&vr)}calledReaddir(){return!!(this.#r&$b)}isENOENT(){return!!(this.#r&vr)}isNamed(e){return this.nocase?this.#T===yh(e):this.#T===Wc(e)}async readlink(){let e=this.#v;if(e)return e;if(this.canReadlink()&&this.parent)try{let n=await this.#e.promises.readlink(this.fullpath()),r=(await this.parent.realpath())?.resolve(n);if(r)return this.#v=r}catch(n){this.#u(n.code);return}}readlinkSync(){let e=this.#v;if(e)return e;if(this.canReadlink()&&this.parent)try{let n=this.#e.readlinkSync(this.fullpath()),r=this.parent.realpathSync()?.resolve(n);if(r)return this.#v=r}catch(n){this.#u(n.code);return}}#x(e){this.#r|=$b;for(let n=e.provisional;n<e.length;n++){let r=e[n];r&&r.#M()}}#M(){this.#r&vr||(this.#r=(this.#r|vr)&Uc,this.#P())}#P(){let e=this.children();e.provisional=0;for(let n of e)n.#M()}#R(){this.#r|=bh,this.#L()}#L(){if(this.#r&zc)return;let e=this.#r;(e&Yn)===Br&&(e&=Uc),this.#r=e|zc,this.#P()}#$(e=""){e==="ENOTDIR"||e==="EPERM"?this.#L():e==="ENOENT"?this.#M():this.children().provisional=0}#q(e=""){e==="ENOTDIR"?this.parent.#L():e==="ENOENT"&&this.#M()}#u(e=""){let n=this.#r;n|=gh,e==="ENOENT"&&(n|=vr),(e==="EINVAL"||e==="UNKNOWN")&&(n&=Uc),this.#r=n,e==="ENOTDIR"&&this.parent&&this.parent.#L()}#j(e,n){return this.#A(e,n)||this.#F(e,n)}#F(e,n){let r=qb(e),s=this.newChild(e.name,r,{parent:this}),i=s.#r&Yn;return i!==Br&&i!==Ai&&i!==Xn&&(s.#r|=zc),n.unshift(s),n.provisional++,s}#A(e,n){for(let r=n.provisional;r<n.length;r++){let s=n[r];if((this.nocase?yh(e.name):Wc(e.name))===s.#T)return this.#B(e,s,r,n)}}#B(e,n,r,s){let i=n.name;return n.#r=n.#r&Uc|qb(e),i!==e.name&&(n.name=e.name),r!==s.provisional&&(r===s.length-1?s.pop():s.splice(r,1),s.unshift(n)),s.provisional++,n}async lstat(){if((this.#r&vr)===0)try{return this.#W(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#q(e.code)}}lstatSync(){if((this.#r&vr)===0)try{return this.#W(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#q(e.code)}}#W(e){let{atime:n,atimeMs:r,birthtime:s,birthtimeMs:i,blksize:o,blocks:a,ctime:c,ctimeMs:l,dev:u,gid:d,ino:f,mode:h,mtime:y,mtimeMs:m,nlink:_,rdev:E,size:T,uid:b}=e;this.#E=n,this.#y=r,this.#k=s,this.#h=i,this.#d=o,this.#i=a,this.#w=c,this.#p=l,this.#t=u,this.#f=d,this.#a=f,this.#s=h,this.#g=y,this.#b=m,this.#n=_,this.#l=E,this.#c=T,this.#o=b;let R=qb(e);this.#r=this.#r&Uc|R|FC,R!==Xn&&R!==Br&&R!==Ai&&(this.#r|=zc)}#V=[];#z=!1;#H(e){this.#z=!1;let n=this.#V.slice();this.#V.length=0,n.forEach(r=>r(null,e))}readdirCB(e,n=!1){if(!this.canReaddir()){n?e(null,[]):queueMicrotask(()=>e(null,[]));return}let r=this.children();if(this.calledReaddir()){let i=r.slice(0,r.provisional);n?e(null,i):queueMicrotask(()=>e(null,i));return}if(this.#V.push(e),this.#z)return;this.#z=!0;let s=this.fullpath();this.#e.readdir(s,{withFileTypes:!0},(i,o)=>{if(i)this.#$(i.code),r.provisional=0;else{for(let a of o)this.#j(a,r);this.#x(r)}this.#H(r.slice(0,r.provisional))})}#U;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let n=this.fullpath();if(this.#U)await this.#U;else{let r=()=>{};this.#U=new Promise(s=>r=s);try{for(let s of await this.#e.promises.readdir(n,{withFileTypes:!0}))this.#j(s,e);this.#x(e)}catch(s){this.#$(s.code),e.provisional=0}this.#U=void 0,r()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let n=this.fullpath();try{for(let r of this.#e.readdirSync(n,{withFileTypes:!0}))this.#j(r,e);this.#x(e)}catch(r){this.#$(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#r&BC)return!1;let e=Yn&this.#r;return e===Xn||e===Br||e===Ai}shouldWalk(e,n){return(this.#r&Br)===Br&&!(this.#r&BC)&&!e.has(this)&&(!n||n(this))}async realpath(){if(this.#C)return this.#C;if(!((bh|gh|vr)&this.#r))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#C=this.resolve(e)}catch{this.#R()}}realpathSync(){if(this.#C)return this.#C;if(!((bh|gh|vr)&this.#r))try{let e=this.#e.realpathSync(this.fullpath());return this.#C=this.resolve(e)}catch{this.#R()}}[QC](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let n=new Set([]),r=[],s=this;for(;s&&s.parent;)n.add(s),s.#D=r.join(this.sep),s.#N=r.join("/"),s=s.parent,r.push("..");for(s=e;s&&s.parent&&!n.has(s);)s.#D=void 0,s.#N=void 0,s=s.parent}},Th=class t extends tn{sep="\\";splitSep=DU;constructor(e,n=Xn,r,s,i,o,a){super(e,n,r,s,i,o,a)}newChild(e,n=Xn,r={}){return new t(e,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return na.win32.parse(e).root}getRoot(e){if(e=RU(e.toUpperCase()),e===this.root.name)return this.root;for(let[n,r]of Object.entries(this.roots))if(this.sameRoot(e,n))return this.roots[e]=r;return this.roots[e]=new ra(e,this).root}sameRoot(e,n=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(HC,"$1\\"),e===n}},_h=class t extends tn{splitSep="/";sep="/";constructor(e,n=Xn,r,s,i,o,a){super(e,n,r,s,i,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,n=Xn,r={}){return new t(e,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}},Sh=class{root;rootPath;roots;cwd;#e;#t;#s;nocase;#n;constructor(e=process.cwd(),n,r,{nocase:s,childrenCacheSize:i=16*1024,fs:o=Vc}={}){this.#n=WC(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,zC.fileURLToPath)(e));let a=n.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new vh,this.#t=new vh,this.#s=new jb(i);let c=a.substring(this.rootPath.length).split(r);if(c.length===1&&!c[0]&&c.pop(),s===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=s,this.root=this.newRoot(this.#n),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,d=n.sep,f=this.rootPath,h=!1;for(let y of c){let m=u--;l=l.child(y,{relative:new Array(m).fill("..").join(d),relativePosix:new Array(m).fill("..").join("/"),fullpath:f+=(h?"":d)+y}),h=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#s}resolve(...e){let n="";for(let i=e.length-1;i>=0;i--){let o=e[i];if(!(!o||o===".")&&(n=n?`${o}/${n}`:o,this.isAbsolute(o)))break}let r=this.#e.get(n);if(r!==void 0)return r;let s=this.cwd.resolve(n).fullpath();return this.#e.set(n,s),s}resolvePosix(...e){let n="";for(let i=e.length-1;i>=0;i--){let o=e[i];if(!(!o||o===".")&&(n=n?`${o}/${n}`:o,this.isAbsolute(o)))break}let r=this.#t.get(n);if(r!==void 0)return r;let s=this.cwd.resolve(n).fullpathPosix();return this.#t.set(n,s),s}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,n={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(n=e,e=this.cwd);let{withFileTypes:r}=n;if(e.canReaddir()){let s=await e.readdir();return r?s:s.map(i=>i.name)}else return[]}readdirSync(e=this.cwd,n={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(n=e,e=this.cwd);let{withFileTypes:r=!0}=n;return e.canReaddir()?r?e.readdirSync():e.readdirSync().map(s=>s.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(n=e.withFileTypes,e=this.cwd);let r=await e.readlink();return n?r:r?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(n=e.withFileTypes,e=this.cwd);let r=e.readlinkSync();return n?r:r?.fullpath()}async realpath(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(n=e.withFileTypes,e=this.cwd);let r=await e.realpath();return n?r:r?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:n}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(n=e.withFileTypes,e=this.cwd);let r=e.realpathSync();return n?r:r?.fullpath()}async walk(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=n,a=[];(!i||i(e))&&a.push(r?e:e.fullpath());let c=new Set,l=(d,f)=>{c.add(d),d.readdirCB((h,y)=>{if(h)return f(h);let m=y.length;if(!m)return f();let _=()=>{--m===0&&f()};for(let E of y)(!i||i(E))&&a.push(r?E:E.fullpath()),s&&E.isSymbolicLink()?E.realpath().then(T=>T?.isUnknown()?T.lstat():T).then(T=>T?.shouldWalk(c,o)?l(T,_):_()):E.shouldWalk(c,o)?l(E,_):_()},!0)},u=e;return new Promise((d,f)=>{l(u,h=>{if(h)return f(h);d(a)})})}walkSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=n,a=[];(!i||i(e))&&a.push(r?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let d of u){(!i||i(d))&&a.push(r?d:d.fullpath());let f=d;if(d.isSymbolicLink()){if(!(s&&(f=d.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(c,o)&&c.add(f)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,n={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(n=e,e=this.cwd),this.stream(e,n)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=n;(!i||i(e))&&(yield r?e:e.fullpath());let a=new Set([e]);for(let c of a){let l=c.readdirSync();for(let u of l){(!i||i(u))&&(yield r?u:u.fullpath());let d=u;if(u.isSymbolicLink()){if(!(s&&(d=u.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(a,o)&&a.add(d)}}}stream(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=n,a=new Gs({objectMode:!0});(!i||i(e))&&a.write(r?e:e.fullpath());let c=new Set,l=[e],u=0,d=()=>{let f=!1;for(;!f;){let h=l.shift();if(!h){u===0&&a.end();return}u++,c.add(h);let y=(_,E,T=!1)=>{if(_)return a.emit("error",_);if(s&&!T){let b=[];for(let R of E)R.isSymbolicLink()&&b.push(R.realpath().then(D=>D?.isUnknown()?D.lstat():D));if(b.length){Promise.all(b).then(()=>y(null,E,!0));return}}for(let b of E)b&&(!i||i(b))&&(a.write(r?b:b.fullpath())||(f=!0));u--;for(let b of E){let R=b.realpathCached()||b;R.shouldWalk(c,o)&&l.push(R)}f&&!a.flowing?a.once("drain",d):m||d()},m=!0;h.readdirCB(y,!0),m=!1}};return d(),a}streamSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:i,walkFilter:o}=n,a=new Gs({objectMode:!0}),c=new Set;(!i||i(e))&&a.write(r?e:e.fullpath());let l=[e],u=0,d=()=>{let f=!1;for(;!f;){let h=l.shift();if(!h){u===0&&a.end();return}u++,c.add(h);let y=h.readdirSync();for(let m of y)(!i||i(m))&&(a.write(r?m:m.fullpath())||(f=!0));u--;for(let m of y){let _=m;if(m.isSymbolicLink()){if(!(s&&(_=m.realpathSync())))continue;_.isUnknown()&&_.lstatSync()}_.shouldWalk(c,o)&&l.push(_)}}f&&!a.flowing&&a.once("drain",d)};return d(),a}chdir(e=this.cwd){let n=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[QC](n)}},ra=class extends Sh{sep="\\";constructor(e=process.cwd(),n={}){let{nocase:r=!0}=n;super(e,na.win32,"\\",{...n,nocase:r}),this.nocase=r;for(let s=this.cwd;s;s=s.parent)s.nocase=this.nocase}parseRootPath(e){return na.win32.parse(e).root.toUpperCase()}newRoot(e){return new Th(this.rootPath,Br,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},sa=class extends Sh{sep="/";constructor(e=process.cwd(),n={}){let{nocase:r=!1}=n;super(e,na.posix,"/",{...n,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new _h(this.rootPath,Br,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},Hc=class extends sa{constructor(e=process.cwd(),n={}){let{nocase:r=!0}=n;super(e,{...n,nocase:r})}},qre=process.platform==="win32"?Th:_h,ZC=process.platform==="win32"?ra:process.platform==="darwin"?Hc:sa;var AU=t=>t.length>=1,OU=t=>t.length>=1,ia=class t{#e;#t;#s;length;#n;#o;#f;#l;#d;#a;#c=!0;constructor(e,n,r,s){if(!AU(e))throw new TypeError("empty pattern list");if(!OU(n))throw new TypeError("empty glob list");if(n.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,r<0||r>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=n,this.#s=r,this.#n=s,this.#s===0){if(this.isUNC()){let[i,o,a,c,...l]=this.#e,[u,d,f,h,...y]=this.#t;l[0]===""&&(l.shift(),y.shift());let m=[i,o,a,c,""].join("/"),_=[u,d,f,h,""].join("/");this.#e=[m,...l],this.#t=[_,...y],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[i,...o]=this.#e,[a,...c]=this.#t;o[0]===""&&(o.shift(),c.shift());let l=i+"/",u=a+"/";this.#e=[l,...o],this.#t=[u,...c],this.length=this.#e.length}}}pattern(){return this.#e[this.#s]}isString(){return typeof this.#e[this.#s]=="string"}isGlobstar(){return this.#e[this.#s]===Ht}isRegExp(){return this.#e[this.#s]instanceof RegExp}globString(){return this.#f=this.#f||(this.#s===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#s).join("/"))}hasMore(){return this.length>this.#s+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new t(this.#e,this.#t,this.#s+1,this.#n),this.#o.#a=this.#a,this.#o.#d=this.#d,this.#o.#l=this.#l,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#d!==void 0?this.#d:this.#d=this.#n==="win32"&&this.#s===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#l!==void 0?this.#l:this.#l=this.#n==="win32"&&this.#s===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#s===0?e:""}checkFollowGlobstar(){return!(this.#s===0||!this.isGlobstar()||!this.#c)}markFollowGlobstar(){return this.#s===0||!this.isGlobstar()||!this.#c?!1:(this.#c=!1,!0)}};var IU=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",oa=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:n,nocase:r,noext:s,noglobstar:i,platform:o=IU}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:n,nocase:r,noext:s,noglobstar:i,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let n=new $n(e,this.mmopts);for(let r=0;r<n.set.length;r++){let s=n.set[r],i=n.globParts[r];if(!s||!i)throw new Error("invalid pattern object");for(;s[0]==="."&&i[0]===".";)s.shift(),i.shift();let o=new ia(s,i,0,this.platform),a=new $n(o.globString(),this.mmopts),c=i[i.length-1]==="**",l=o.isAbsolute();l?this.absolute.push(a):this.relative.push(a),c&&(l?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(e){let n=e.fullpath(),r=`${n}/`,s=e.relative()||".",i=`${s}/`;for(let o of this.relative)if(o.match(s)||o.match(i))return!0;for(let o of this.absolute)if(o.match(n)||o.match(r))return!0;return!1}childrenIgnored(e){let n=e.fullpath()+"/",r=(e.relative()||".")+"/";for(let s of this.relativeChildren)if(s.match(r))return!0;for(let s of this.absoluteChildren)if(s.match(n))return!0;return!1}};var Fb=class t{store;constructor(e=new Map){this.store=e}copy(){return new t(new Map(this.store))}hasWalked(e,n){return this.store.get(e.fullpath())?.has(n.globString())}storeWalked(e,n){let r=e.fullpath(),s=this.store.get(r);s?s.add(n.globString()):this.store.set(r,new Set([n.globString()]))}},Bb=class{store=new Map;add(e,n,r){let s=(n?2:0)|(r?1:0),i=this.store.get(e);this.store.set(e,i===void 0?s:s&i)}entries(){return[...this.store.entries()].map(([e,n])=>[e,!!(n&2),!!(n&1)])}},Ub=class{store=new Map;add(e,n){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(s=>s.globString()===n.globString())||r.push(n):this.store.set(e,[n])}get(e){let n=this.store.get(e);if(!n)throw new Error("attempting to walk unknown path");return n}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},Gc=class t{hasWalkedCache;matches=new Bb;subwalks=new Ub;patterns;follow;dot;opts;constructor(e,n){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=n?n.copy():new Fb}processPatterns(e,n){this.patterns=n;let r=n.map(s=>[e,s]);for(let[s,i]of r){this.hasWalkedCache.storeWalked(s,i);let o=i.root(),a=i.isAbsolute()&&this.opts.absolute!==!1;if(o){s=s.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let d=i.rest();if(d)i=d;else{this.matches.add(s,!0,!1);continue}}if(s.isENOENT())continue;let c,l,u=!1;for(;typeof(c=i.pattern())=="string"&&(l=i.rest());)s=s.resolve(c),i=l,u=!0;if(c=i.pattern(),l=i.rest(),u){if(this.hasWalkedCache.hasWalked(s,i))continue;this.hasWalkedCache.storeWalked(s,i)}if(typeof c=="string"){let d=c===".."||c===""||c===".";this.matches.add(s.resolve(c),a,d);continue}else if(c===Ht){(!s.isSymbolicLink()||this.follow||i.checkFollowGlobstar())&&this.subwalks.add(s,i);let d=l?.pattern(),f=l?.rest();if(!l||(d===""||d===".")&&!f)this.matches.add(s,a,d===""||d===".");else if(d===".."){let h=s.parent||s;f?this.hasWalkedCache.hasWalked(h,f)||this.subwalks.add(h,f):this.matches.add(h,a,!0)}}else c instanceof RegExp&&this.subwalks.add(s,i)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,n){let r=this.subwalks.get(e),s=this.child();for(let i of n)for(let o of r){let a=o.isAbsolute(),c=o.pattern(),l=o.rest();c===Ht?s.testGlobstar(i,o,l,a):c instanceof RegExp?s.testRegExp(i,c,l,a):s.testString(i,c,l,a)}return s}testGlobstar(e,n,r,s){if((this.dot||!e.name.startsWith("."))&&(n.hasMore()||this.matches.add(e,s,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,n):e.isSymbolicLink()&&(r&&n.checkFollowGlobstar()?this.subwalks.add(e,r):n.markFollowGlobstar()&&this.subwalks.add(e,n)))),r){let i=r.pattern();if(typeof i=="string"&&i!==".."&&i!==""&&i!==".")this.testString(e,i,r.rest(),s);else if(i===".."){let o=e.parent||e;this.subwalks.add(o,r)}else i instanceof RegExp&&this.testRegExp(e,i,r.rest(),s)}}testRegExp(e,n,r,s){n.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,s,!1))}testString(e,n,r,s){e.isNamed(n)&&(r?this.subwalks.add(e,r):this.matches.add(e,s,!1))}};var xU=(t,e)=>typeof t=="string"?new oa([t],e):Array.isArray(t)?new oa(t,e):t,Eh=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#s;signal;maxDepth;includeChildMatches;constructor(e,n,r){if(this.patterns=e,this.path=n,this.opts=r,this.#s=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#t=xU(r.ignore??[],r),!this.includeChildMatches&&typeof this.#t.add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#n(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#o(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,n){if(n&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||await e.realpath(),!r)return;e=r}let i=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&i?.isSymbolicLink()){let o=await i.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(i,n)}matchCheckTest(e,n){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!n||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#n(e)?e:void 0}matchCheckSync(e,n){if(n&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||e.realpathSync(),!r)return;e=r}let i=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&i?.isSymbolicLink()){let o=i.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(i,n)}matchFinish(e,n){if(this.#n(e))return;if(!this.includeChildMatches&&this.#t?.add){let i=`${e.relativePosix()}/**`;this.#t.add(i)}let r=this.opts.absolute===void 0?n:this.opts.absolute;this.seen.add(e);let s=this.opts.mark&&e.isDirectory()?this.#s:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(r){let i=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(i+s)}else{let i=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!i.startsWith(".."+this.#s)?"."+this.#s:"";this.matchEmit(i?o+i+s:"."+s)}}async match(e,n,r){let s=await this.matchCheck(e,r);s&&this.matchFinish(s,n)}matchSync(e,n,r){let s=this.matchCheckSync(e,r);s&&this.matchFinish(s,n)}walkCB(e,n,r){this.signal?.aborted&&r(),this.walkCB2(e,n,new Gc(this.opts),r)}walkCB2(e,n,r,s){if(this.#o(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2(e,n,r,s));return}r.processPatterns(e,n);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of r.matches.entries())this.#n(a)||(i++,this.match(a,c,l).then(()=>o()));for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;i++;let c=a.readdirCached();a.calledReaddir()?this.walkCB3(a,c,r,o):a.readdirCB((l,u)=>this.walkCB3(a,u,r,o),!0)}o()}walkCB3(e,n,r,s){r=r.filterEntries(e,n);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of r.matches.entries())this.#n(a)||(i++,this.match(a,c,l).then(()=>o()));for(let[a,c]of r.subwalks.entries())i++,this.walkCB2(a,c,r.child(),o);o()}walkCBSync(e,n,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,n,new Gc(this.opts),r)}walkCB2Sync(e,n,r,s){if(this.#o(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2Sync(e,n,r,s));return}r.processPatterns(e,n);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of r.matches.entries())this.#n(a)||this.matchSync(a,c,l);for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;i++;let c=a.readdirSync();this.walkCB3Sync(a,c,r,o)}o()}walkCB3Sync(e,n,r,s){r=r.filterEntries(e,n);let i=1,o=()=>{--i===0&&s()};for(let[a,c,l]of r.matches.entries())this.#n(a)||this.matchSync(a,c,l);for(let[a,c]of r.subwalks.entries())i++,this.walkCB2Sync(a,c,r.child(),o);o()}},Kc=class extends Eh{matches=new Set;constructor(e,n,r){super(e,n,r)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,n)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?n(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},Yc=class extends Eh{results;constructor(e,n,r){super(e,n,r),this.results=new Gs({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var MU=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Tr=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,n){if(!n)throw new TypeError("glob options required");if(this.withFileTypes=!!n.withFileTypes,this.signal=n.signal,this.follow=!!n.follow,this.dot=!!n.dot,this.dotRelative=!!n.dotRelative,this.nodir=!!n.nodir,this.mark=!!n.mark,n.cwd?(n.cwd instanceof URL||n.cwd.startsWith("file://"))&&(n.cwd=(0,eA.fileURLToPath)(n.cwd)):this.cwd="",this.cwd=n.cwd||"",this.root=n.root,this.magicalBraces=!!n.magicalBraces,this.nobrace=!!n.nobrace,this.noext=!!n.noext,this.realpath=!!n.realpath,this.absolute=n.absolute,this.includeChildMatches=n.includeChildMatches!==!1,this.noglobstar=!!n.noglobstar,this.matchBase=!!n.matchBase,this.maxDepth=typeof n.maxDepth=="number"?n.maxDepth:1/0,this.stat=!!n.stat,this.ignore=n.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(c=>c.replace(/\\/g,"/"))),this.matchBase){if(n.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=e,this.platform=n.platform||MU,this.opts={...n,platform:this.platform},n.scurry){if(this.scurry=n.scurry,n.nocase!==void 0&&n.nocase!==n.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let c=n.platform==="win32"?ra:n.platform==="darwin"?Hc:n.platform?sa:ZC;this.scurry=new c(this.cwd,{nocase:n.nocase,fs:n.fs})}this.nocase=this.scurry.nocase;let r=this.platform==="darwin"||this.platform==="win32",s={...n,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:r,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},i=this.pattern.map(c=>new $n(c,s)),[o,a]=i.reduce((c,l)=>(c[0].push(...l.set),c[1].push(...l.globParts),c),[[],[]]);this.patterns=o.map((c,l)=>{let u=a[l];if(!u)throw new Error("invalid pattern object");return new ia(c,u,0,this.platform)})}async walk(){return[...await new Kc(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new Kc(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new Yc(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new Yc(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var Vb=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let n of t)if(new $n(n,e).hasMagic())return!0;return!1};function wh(t,e={}){return new Tr(t,e).streamSync()}function nA(t,e={}){return new Tr(t,e).stream()}function rA(t,e={}){return new Tr(t,e).walkSync()}async function tA(t,e={}){return new Tr(t,e).walk()}function kh(t,e={}){return new Tr(t,e).iterateSync()}function sA(t,e={}){return new Tr(t,e).iterate()}var LU=wh,$U=Object.assign(nA,{sync:wh}),qU=kh,jU=Object.assign(sA,{sync:kh}),FU=Object.assign(rA,{stream:wh,iterate:kh}),Oi=Object.assign(tA,{glob:tA,globSync:rA,sync:FU,globStream:nA,stream:$U,globStreamSync:wh,streamSync:LU,globIterate:sA,iterate:jU,globIterateSync:kh,iterateSync:qU,Glob:Tr,hasMagic:Vb,escape:Jo,unescape:yr});Oi.glob=Oi;var zT=require("path"),WT=require("fs");var cx=Y(ix());var UT={};Wx(UT,{$id:()=>lK,$schema:()=>cK,default:()=>pK,definitions:()=>dK,properties:()=>hK,title:()=>uK,type:()=>fK});var cK="http://json-schema.org/draft-07/schema#",lK="http://json-schema.org/draft-07/schema#",uK="Core schema meta-schema",dK={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},fK=["object","boolean"],hK={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},pK={$schema:cK,$id:lK,title:uK,definitions:dK,type:fK,properties:hK,default:!0};var It=Y(Q());var op=class extends Ka{constructor(n,r){super();this.ajv=n;this.schemaKey=r;this.validate=this.ajv.getSchema(this.schemaKey)}getIssue(n,r){let s=[],i=r.getProperty("status"),o=i?.ast.values?.values.at(0)?.value;if(o instanceof Le&&o.value==="disabled")return[...r.definitions,...r.referencedBy].forEach(c=>s.push($(21,c,It.DiagnosticSeverity.Hint,[...i?.ast.parentNode?[i?.ast.parentNode]:[]],[It.DiagnosticTag.Unnecessary]))),s;let a=we.toJson(r);try{this.validate?(this.validate(a),this.validate.errors&&(this.validate.errors.forEach(c=>s.push(...mK(n,c,r,this.schemaKey))),console.log(this.schemaKey,`${r.pathString}`,this.validate.errors,a))):console.log("no validate")}catch(c){console.log(this.schemaKey,`${r.pathString}`,this.schemaKey,c)}return s}getOnPropertyHover(n){let r=(this.validate?.schema).properties?.[n];if(r&&typeof r=="object"&&"description"in r)return{kind:It.MarkupKind.Markdown,value:[...r.description?["### Description",Array.isArray(r.description)?r.description.join(`
280
286
 
281
287
  `):r.description]:[]].join(`
282
- `)}}getPropertyListCompletionItems(t){let r=Object.keys((this.validate?.schema).properties),s=(this.validate?.schema).required;return r.map(i=>{let o=t&&s.some(l=>l===i),a=!!t.property.some(l=>i===l.name),c="a";return o?c=a?"Y":"A":c=a?"Z":"B",{label:`${i}`,kind:Dt.CompletionItemKind.Property,sortText:`${c}${i}`}})??[]}},qH=(n,e,t,r)=>{let s=jH(t,e.instancePath),i=s.node;if(e.keyword==="additionalProperties"){let o=i.getProperty(e.params.additionalProperty);return o?[F(26,o.ast,Dt.DiagnosticSeverity.Error,[],[],[`Node "${i.name}" ${e.message}: ${o.name}`],Dt.TextEdit.del(li(o.ast.firstToken.prevToken,o.ast.lastToken,!1)),"Remove property")]:[]}else if(e.keyword==="type"){let o=i.getProperty(e.instancePath.split("/")[1]);return o?[F(26,o.ast,Dt.DiagnosticSeverity.Error,[],[],[`"${o.name}" ${e.message??"NO MESSAGE"}`])]:(console.warn("unable to find property in node",e),[])}else if(e.keyword==="required"){let o=e.params.missingProperty,a=n.getOrderedNodeAst(i),c=go(a);return a.map((l,u)=>{let d=l.openScope??c[u].lastToken;return F(0,c[u],Dt.DiagnosticSeverity.Error,[],[],[o],Dt.TextEdit.insert(Dt.Position.create(d.pos.line,d.pos.col+1),`
283
- ${"".padEnd(vo(c[u].uri,l)*mo().length,mo())}${o};`))})}else if(e.keyword==="const"){let o=s.property;return o?[F(26,o.ast,Dt.DiagnosticSeverity.Error,[],[],[`Property "${o.name}" ${e.message}: ${e.params.allowedValue}`])]:[]}else if(e.keyword==="enum"){let o=s.property;return o?[F(26,o.ast,Dt.DiagnosticSeverity.Error,[],[],[`Property "${o.name}" ${e.message}:
288
+ `)}}getPropertyListCompletionItems(n){let r=Object.keys((this.validate?.schema).properties),s=(this.validate?.schema).required;return r.map(i=>{let o=n&&s.some(l=>l===i),a=!!n.property.some(l=>i===l.name),c="a";return o?c=a?"Y":"A":c=a?"Z":"B",{label:`${i}`,kind:It.CompletionItemKind.Property,sortText:`${c}${i}`}})??[]}},mK=(t,e,n,r)=>{let s=gK(n,e.instancePath),i=s.node;if(e.keyword==="additionalProperties"){let o=i.getProperty(e.params.additionalProperty);return o?[$(25,o.ast,It.DiagnosticSeverity.Error,[],[],[`Node "${i.name}" ${e.message}: ${o.name}`],It.TextEdit.del(mi(o.ast.firstToken.prevToken,o.ast.lastToken,!1)),"Remove property")]:[]}else if(e.keyword==="type"){let o=i.getProperty(e.instancePath.split("/")[1]);return o?[$(25,o.ast,It.DiagnosticSeverity.Error,[],[],[`"${o.name}" ${e.message??"NO MESSAGE"}`])]:(console.warn("unable to find property in node",e),[])}else if(e.keyword==="required"){let o=e.params.missingProperty,a=t.getOrderedNodeAst(i),c=Eo(a);return a.map((l,u)=>{let d=l.openScope??c[u].lastToken;return $(0,c[u],It.DiagnosticSeverity.Error,[],[],[o],It.TextEdit.insert(It.Position.create(d.pos.line,d.pos.col+1),`
289
+ ${"".padEnd(No(c[u].uri,l)*So().length,So())}${o};`))})}else if(e.keyword==="const"){let o=s.property;return o?[$(25,o.ast,It.DiagnosticSeverity.Error,[],[],[`Property "${o.name}" ${e.message}: ${e.params.allowedValue}`])]:[]}else if(e.keyword==="enum"){let o=s.property;return o?[$(25,o.ast,It.DiagnosticSeverity.Error,[],[],[`Property "${o.name}" ${e.message}:
284
290
  ${e.params.allowedValues.join(`
285
291
  `)}
286
- ${r}`])]:[]}else if(e.keyword==="maxItems"||e.keyword==="minItems"){let o=i.getProperty(e.instancePath.split("/").at(-1)??"");return o?[F(26,o.ast,Dt.DiagnosticSeverity.Error,[],[],[`Property "${o.name}" ${e.message}`])]:[]}return s.property?[F(26,s.property.ast,void 0,void 0,void 0,[`${e.message??"NO MESSAGE"}:
292
+ ${r}`])]:[]}else if(e.keyword==="maxItems"||e.keyword==="minItems"){let o=i.getProperty(e.instancePath.split("/").at(-1)??"");return o?[$(25,o.ast,It.DiagnosticSeverity.Error,[],[],[`Property "${o.name}" ${e.message}`])]:[]}return s.property?[$(25,s.property.ast,void 0,void 0,void 0,[`${e.message??"NO MESSAGE"}:
287
293
  ${JSON.stringify(e)}
288
- ${r}`])]:[F(26,s.node.definitions[0]instanceof mt?s.node.definitions[0]:s.node.definitions[0].name??s.node.definitions[0],void 0,void 0,void 0,[`${e.message??"NO MESSAGE"}:
294
+ ${r}`])]:[$(25,s.node.definitions[0]instanceof vt?s.node.definitions[0]:s.node.definitions[0].name??s.node.definitions[0],void 0,void 0,void 0,[`${e.message??"NO MESSAGE"}:
289
295
  ${JSON.stringify(e)}
290
- ${r}`])]},jH=(n,e)=>DO(n,e.split("/").filter(t=>t)),DO=(n,e)=>{if(e.length===0)return{node:n,remainingInstancePath:""};let t=e[0].split("@"),r=t[0],s=t.at(1)?.split(",").map(o=>Number.parseInt(o,16)),i=n.getNode(r,s);return i?DO(i,e.slice(1)):{node:n,property:n.getProperty(e[0]),remainingInstancePath:e.slice(1).join("/")}};var TT=class n{constructor(){this.schemaIdValidators=new Map;this.ajvMap=new Map}static getNodeCompatible(e){let r=e.getProperty("compatible")?.ast.values;if(!r?.values.some(s=>!(s?.value instanceof Ie)))return r?.values.map(s=>(s?.value).value)}parseMetaSchema(e,t){ki.sync("**/*.yaml",{cwd:e}).forEach(s=>{s=(0,bT.resolve)(e,s);try{let i=yT.default.parse((0,vT.readFileSync)(s,"utf-8"));t.addMetaSchema(i),this.schemaIdValidators.set(i.$id,s)}catch{}})}parseBindings(e,t){ki.sync("**/*.yaml",{cwd:e}).forEach(s=>{s=(0,bT.resolve)(e,s);try{let i=yT.default.parse((0,vT.readFileSync)(s,"utf-8"));t.addSchema(i),this.schemaIdValidators.set(i.$id,s)}catch(i){console.warn(s,i.message)}})}getNodeTypes(e,t,r){let s=`${e.join(";")}::${t.join(";")}`,i=this.ajvMap.get(s);return i||(i=new AO.default({strict:!1,strictSchema:!1,strictNumbers:!1}),i.addMetaSchema(gT),this.ajvMap.set(s,i),e.forEach(c=>this.parseMetaSchema(c,i)),t.forEach(c=>this.parseBindings(c,i))),n.getNodeCompatible(r)?.map(c=>{try{let l=Array.from(this.schemaIdValidators.keys()).find(f=>f.endsWith(`/${c}.yaml#`));if(!l)return;let u=new Kh(i,l);u.bindingsPath=this.schemaIdValidators.get(l),u.compatible=c;let d=i.getSchema(l);return u.description=(d?.schema).description,u.examples=(d?.schema).examples,u.maintainers=(d?.schema).maintainers,u}catch(l){console.warn(l.message)}}).filter(c=>c)??[]}},CO,OO=()=>(CO??=new TT,CO);var LO=K(Qy());var fa=require("path"),qO=require("fs");var Ur=K(X());var IO=n=>{switch(n){case"string":return W("STRING");case"int":return W("U32");case"boolean":return W("EMPTY");case"array":return W("PROP_ENCODED_ARRAY");case"uint8-array":return W("BYTESTRING");case"string-array":return W("STRINGLIST");case"phandle":return W("U32");case"phandles":return W("PROP_ENCODED_ARRAY");case"phandle-array":return W("PROP_ENCODED_ARRAY");case"path":return W(["STRING","U32"]);case"compound":return W("ANY")}},xO=(n,e)=>{switch(n){case"string":return typeof e=="string"?e:void 0;case"int":return typeof e=="number"?e:void 0;case"boolean":return;case"array":return Array.isArray(e)&&e.every(t=>typeof t=="number")?e:void 0;case"uint8-array":return Array.isArray(e)&&e.every(t=>typeof t=="number")?e:void 0;case"string-array":return Array.isArray(e)&&e.every(t=>typeof t=="string")?e:void 0;case"phandle":return;case"phandles":return;case"phandle-array":return;case"path":return;case"compound":return}},Gh=(n,e)=>{if(e=e.include.reduce((t,r)=>{let s=n.find(i=>(0,fa.basename)(i.filePath)===r.name);if(s){let i=r["property-blocklist"];return t.include=t.include.filter(o=>o!==r),FH(n,s,t,i)??t}return console.warn(`Unable to find ${r}`),t},e),e["child-binding"]&&(e["child-binding"].include=jO(e["child-binding"].include),e["child-binding"]=Gh(n,e["child-binding"])),!e.include.length)return e},FH=(n,e,t,r=[])=>{let s=Gh(n,e),i=Gh(n,t);if(!s||!i)return;let o=new Set;Object.keys(s?.properties??{}).forEach(d=>o.add(d)),Object.keys(i?.properties??{}).forEach(d=>o.add(d));let a={};Array.from(o).forEach(d=>{let f=r?.some(y=>y===d)?{}:s.properties?.[d]??{},p=i.properties?.[d]??{};a={...a,[d]:{...f,...p}}}),i.properties=a;let c=new Set;return Object.keys(s).filter(d=>d.endsWith("-cells")).forEach(d=>c.add(d)),Object.keys(s).filter(d=>d.endsWith("-cells")).forEach(d=>c.add(d)),Array.from(c).forEach(d=>{let f=s[d]??[],p=i[d]??[];i[d]=Array.from([...f,...p])}),i},jO=n=>n?typeof n=="string"?[{name:n}]:n.map(e=>typeof e!="string"?e:{name:e}):[],ST=class n{constructor(){this.typeCache=new Map;this.readFolders=[]}static getNodeCompatible(e){let r=e.getProperty("compatible")?.ast.values;if(!r?.values.some(s=>!(s?.value instanceof Ie)))return r?.values.map(s=>(s?.value).value)}getNodeTypes(e,t){let r=n.getNodeCompatible(t);if(!r)return[pi(t)];let s=r.map(o=>this.typeCache.get(o)?.(t)).filter(o=>o);if(s.length)return s;this.loadTypeAndCache(e);let i=r.map(o=>this.typeCache.get(o)?.(t)).filter(o=>o);return i.length?i:[pi(t)]}loadTypeAndCache(e){e=Array.isArray(e)?e:[e],e.forEach(t=>{if(this.readFolders.indexOf(t)!==-1)return;this.readFolders.push(t);let s=ki.sync("**/*.yaml",{cwd:t,ignore:"test/*"}).map(o=>{o=(0,fa.resolve)(t,o);try{let a=LO.default.parse((0,qO.readFileSync)(o,"utf-8"));return{...a,include:jO(a?.include),filePath:o}}catch(a){console.warn(a)}}).filter(o=>!!o),i=s.map(o=>Gh(s,o)).filter(o=>!!o&&!o.include.length);BH(i,this.typeCache)})}},MO,FO=()=>(MO??=new ST,MO),BH=(n,e)=>n.forEach(t=>{let r=t.compatible??(t.filePath?(0,fa.basename)(t.filePath,"yaml"):void 0);r&&e.set(r,s=>BO(t,s))}),BO=(n,e)=>{let t=pi(e);t.compatible=n.compatible??(n.filePath?(0,fa.basename)(n.filePath,"yaml"):void 0),t.description=n.description,t.bindingsPath=n.filePath,t.bus=typeof n.bus=="string"?[n.bus]:n.bus,t.onBus=n["on-bus"];let s=Object.keys(n).filter(i=>i.endsWith("-cells")).map(i=>({specifier:i.replace(/-cells$/,""),values:n[i]}));if(n.properties&&Object.keys(n.properties).forEach(i=>{let o=n.properties[i];UH(t,i,o),t.cellsValues=s}),n["child-binding"]){let i=n["child-binding"];t.childNodeType=o=>BO(i,o)}return t},UH=(n,e,t)=>{let r=n.properties.find(s=>s.getNameMatch(e));if(r&&typeof r.name=="string"){r.required=()=>t.required?"required":"optional",r.values=()=>t.enum??[],r.constValue=xO(t.type,t.const),r.bindingType=t.type;let s=r.additionalTypeCheck;r.additionalTypeCheck=(i,o)=>[...$O(t,e,r)(i,o),...s?.(i,o)??[]]}else{let s=t.type==="compound"?r?.type:IO(t.type);s??=IO(t.type);let i=new G(e,s,t.required?"required":"optional",void 0,t.enum);i.additionalTypeCheck=(o,a)=>{let c=[...r?.additionalTypeCheck?.(o,a)??[],...$O(t,e,i)(o,a)];return i.typeExample??=r?.typeExample,c},i.description=t.description?[t.description]:r?.description,i.bindingType=t.type,i.constValue=xO(t.type,t.const),n.addProperty(i)}},$O=(n,e,t)=>{let r=n;return(s,i)=>{let o=s.parent.root,a=[];if(r.const){let c=s.ast.quickValues;if(c?.length==1){let l=Array.isArray(r.const)?r.const:[r.const];Array.isArray(c[0])&&l.length===c[0].length&&c[0].every((d,f)=>typeof d=="number"&&Number.isNaN(d)||l[f]===d)||a.push(F(25,s.ast.values??s.ast,Ur.DiagnosticSeverity.Error,[],[],[`Binding expects values to be "${r.type}" with value: ${r.const}`]))}}if(r.deprecated&&a.push(F(14,s.ast,Ur.DiagnosticSeverity.Warning,[],[Ur.DiagnosticTag.Deprecated],[s.name])),(r.type==="phandle"||r.type==="phandles"||r.type==="path")&&Mt(s.ast.values)?.forEach(l=>{ur(l,o)||a.push(F(23,l,Ur.DiagnosticSeverity.Error))}),r.type==="path"&&s.ast.values?.values.at(0)?.value instanceof Ie){let c=s.ast.values?.values.at(0)?.value,l=[];c.value.split("/").every(u=>{let d=o.getNode(u);return d?l.push(u):a.push(F(24,c,Ur.DiagnosticSeverity.Error,[],[],[u,`/${l.join("/")}`])),!d})}if(r.type==="phandle-array"){let c=Mt(s.ast.values),l=0;for(;c&&l<c.length;){let u=c.at(l),d=ur(u,o);if(!d){a.push(F(23,u??s.ast,Ur.DiagnosticSeverity.Error));break}let f="";e.endsWith("-gpios")?f="gpio":f=r["specifier-space"]??e.slice(0,-1);let p=d.getProperty(`#${f}-cells`);if(!p){a.push(F(16,s.ast,Ur.DiagnosticSeverity.Error,[...d.nodeNameOrLabelRef],[],[s.name,`#${f}-cells`,`/${d.path.slice(1).join("/")}`]));break}let y=p?at(p,0,0,i)??0:0,m=d.nodeType?.cellsValues?.find(S=>S.specifier===f)?.values;if(t.typeExample=`<${["phandel",...m??[],...Array.from({length:y-(m?.length??0)},()=>"cell")].join(" ")}>`,1+y>c.length-l){a.push(F(20,u??s.ast,Ur.DiagnosticSeverity.Error,[],[],[s.name,t.typeExample]));break}l+=1+y}}return a}};var UO=(n,e)=>({files:n,type:e,getNodeTypes:async t=>{switch(e){case"Zephyr":return FO().getNodeTypes(n.zephyrBindings,t);case"DevicetreeOrg":return OO().getNodeTypes(n.deviceOrgBindingsMetaSchema,n.deviceOrgTreeBindings,t)}}});var ET=K(X());var _T=n=>!n.openScope||!n.closeScope?.prevToken?n.nodes.flatMap(_T):[{startLine:n.openScope.pos.line,startCharacter:n.openScope.pos.col,endLine:n.closeScope.prevToken.pos.line,endCharacter:n.closeScope.prevToken.pos.col,kind:ET.FoldingRangeKind.Region},...n.nodes.flatMap(_T)],VO=n=>{let e=[];return[...n instanceof Ds?n.ifBlocks.map(t=>({start:(t.expression??t.keyword).lastToken,end:t.content?.lastToken??(t.expression??t.keyword).lastToken})):[{start:(n.ifDef.identifier??n.ifDef.keyword).lastToken,end:n.ifDef.content?.lastToken}],n.elseOption?{start:n.elseOption.keyword.lastToken,end:n.elseOption.content?.lastToken}:null].forEach(t=>{!t||!t.end||e.push({startLine:t.start.pos.line,startCharacter:t.start.pos.col,endLine:t.end.pos.line,endCharacter:t.end.pos.colEnd,kind:ET.FoldingRangeKind.Region})}),e},VH=n=>n instanceof Fe?_T(n):n instanceof wo||n instanceof Ds?VO(n):[];function WO(n,e){return e.allAstItems.flatMap(t=>[t,...t.allDescendants]).filter(t=>le(t.uri,n)).flatMap(VH)}var qi=K(X());function WH(n){if(!n||!(n.ast instanceof Me)&&!(n.ast instanceof Bt))return[];let e=t=>t.nodeType?.bindingsPath?[qi.Location.create(de(t.nodeType.bindingsPath),qi.Range.create(qi.Position.create(0,0),qi.Position.create(0,0)))]:[];return n.item instanceof Se&&!Pt(n.ast)?e(n.item):n.ast instanceof Bt&&n.ast.parentNode instanceof ye&&n.ast.parentNode.linksTo?e(n.ast.parentNode.linksTo):n.ast instanceof Me&&n.ast.linksTo?e(n.ast.linksTo):[]}async function zO(n,e){return Nt(n,e,t=>[...WH(t)])}var Jh=require("fs");var zH=(n,e)=>{fr().reset(n),fr().requestTokens(n,!0),e(n)},Yh=class{constructor(e,t,r){this.file=e;this.cb=t;this.hasDocumentOpen=r;this.count=0}watch(){if(this.count++,this.count===1){console.log("create watch for",this.file);let e=this.file,t=this.cb;this.onChange=()=>{if(this.hasDocumentOpen(e)){console.log("skipping on change document is open",e);return}console.log("onChange",e),zH(e,t)},(0,Jh.watchFile)(e,this.onChange)}}unwatch(){this.count--,this.count===0&&(console.log("dispose watch for",this.file),(0,Jh.unwatchFile)(this.file,this.onChange),this.onChange=void 0)}};var sn=K(require("path")),wT=require("fs");var er=async(n,e)=>(e&&(n=n.replaceAll("${workspaceFolder}",e)),n),ji={defaultBindingType:"Zephyr",defaultZephyrBindings:[],defaultIncludePaths:[],defaultDeviceOrgBindingsMetaSchema:[],defaultDeviceOrgTreeBindings:[],contexts:[],defaultLockRenameEdits:[],allowAdhocContexts:!0,autoChangeContext:!0},kT=async(n,e,t)=>{let r=(n.cwd?await er(n.cwd,t):void 0)??e.cwd,s=await Promise.all((n.includePaths??e.defaultIncludePaths).map(f=>er(f,t))),i=await Promise.all((n.zephyrBindings??e.defaultZephyrBindings).map(f=>er(f,t))),o=n.bindingType??e.defaultBindingType,a=await Promise.all((n.deviceOrgTreeBindings??e.defaultDeviceOrgTreeBindings).map(f=>er(f,t))),c=await Promise.all((n.deviceOrgBindingsMetaSchema??e.defaultDeviceOrgBindingsMetaSchema).map(f=>er(f,t))),l=await Promise.all((n.lockRenameEdits??e.defaultLockRenameEdits).map(f=>er(f,t)));r&&o==="Zephyr"&&(!i||i.length===0)&&(i=["./zephyr/dts/bindings"]);let u=n.dtsFile,d=n.overlays??[];return r&&(i=i.map(f=>(0,sn.resolve)(r,f)).filter(f=>(0,wT.existsSync)(f)),a=a?.map(f=>(0,sn.resolve)(r,f)),c=c.map(f=>(0,sn.resolve)(r,f)),s=s.map(f=>(0,sn.resolve)(r,f)),u=(0,sn.resolve)(r,u),d=d.map(f=>(0,sn.resolve)(r,f)),l=l.map(f=>(0,sn.resolve)(r,f))),{ctxName:n.ctxName??(0,sn.basename)(u),cwd:r?Je(r):void 0,includePaths:s.map(Je),zephyrBindings:i.map(Je),bindingType:o,deviceOrgTreeBindings:a.map(Je),deviceOrgBindingsMetaSchema:c.map(Je),dtsFile:Je(u),overlays:d.map(Je),lockRenameEdits:l.map(Je)}},bl=async(n,e)=>{let t=n.cwd?await er(n.cwd,e):void 0,r=n.defaultBindingType,s=n.defaultDeviceOrgBindingsMetaSchema=await Promise.all((n.defaultDeviceOrgBindingsMetaSchema??[]).map(d=>er(d,e))),i=n.defaultDeviceOrgTreeBindings=await Promise.all((n.defaultDeviceOrgTreeBindings??[]).map(d=>er(d,e))),o=n.defaultIncludePaths=await Promise.all((n.defaultIncludePaths??[]).map(d=>er(d,e))),a=n.defaultZephyrBindings=await Promise.all((n.defaultZephyrBindings??[]).map(d=>er(d,e))),c=n.defaultLockRenameEdits=await Promise.all((n.defaultLockRenameEdits??[]).map(d=>er(d,e)));t&&(o=n.defaultIncludePaths=(n.defaultIncludePaths??[]).map(d=>(0,sn.resolve)(t,d)),r==="Zephyr"&&!n.defaultZephyrBindings&&(a=["./zephyr/dts/bindings"]),a=a.map(d=>(0,sn.resolve)(t,d)),s=s.map(d=>(0,sn.resolve)(t,d))),n.defaultDeviceOrgTreeBindings=(n.defaultDeviceOrgTreeBindings??[]).map(d=>n.cwd?(0,sn.resolve)(n.cwd,d):d);let l={cwd:t,defaultDeviceOrgBindingsMetaSchema:s,defaultDeviceOrgTreeBindings:i,defaultIncludePaths:o,defaultZephyrBindings:a,defaultLockRenameEdits:c,defaultBindingType:r,autoChangeContext:n.autoChangeContext??ji.autoChangeContext,allowAdhocContexts:n.allowAdhocContexts??ji.allowAdhocContexts},u=(await Promise.all(n.contexts?.map(d=>kT(d,l,e))??[])).filter(d=>[d.dtsFile,...d.overlays].every(f=>(0,wT.existsSync)(f)&&sn.default.isAbsolute(f)));return{...l,contexts:u}};var YO=require("path");function HH(n,e){if(!n||!(n.item instanceof ze)||!(n.ast instanceof je))return[];let t=[];if(e.settings.bindingType==="Zephyr"){t.push({type:"dt_zephyr_macro_prop_node_path",data:`DT_PROP(${HO(n.item.parent)}, ${n.item.name.replaceAll("-","_")}))`});let r=n.item;n.item.parent.labels.forEach(s=>t.push({type:"dt_zephyr_macro_prop_node_label",data:`DT_PROP(DT_NODELABEL(${s.label.toString()}), ${r.name.replaceAll("-","_")})`}))}return t}var HO=n=>`DT_PATH(${n.path.slice(1).map(e=>e.replace("@","_").replaceAll("-","_")).join(",")})`;function KH(n,e){if(!n||n.item===null)return[];let t;if(n.item instanceof Se?t=n.item:n.ast.parentNode instanceof ye&&n.ast.parentNode.linksTo?t=n.ast.parentNode.linksTo:n.ast instanceof Me&&n.ast.linksTo&&(t=n.ast.linksTo),!t)return[];let r=[{type:"path",data:t.pathString}];if(e.settings.bindingType==="Zephyr"){t.labels.forEach(o=>{r.push({type:"dt_zephyr_macro_node_label",data:`DT_NODELABEL(${o.label.toString()})`})}),r.push({type:"dt_zephyr_macro_node_path",data:HO(t)});let i=Po.getNodeFromPath(["aliases"],t.root)?.property.find(o=>{if(o.ast.quickValues?.at(0)===t.pathString)return!0;let a=o.ast.values?.values.at(0)?.value;if(a instanceof ye&&a.linksTo===t||a instanceof In&&a.path?.pathParts.at(-1)?.linksTo===t)return!0});i&&r.push({type:"dt_zephyr_macro_prop_node_alias",data:`DT_ALIAS(${i.name.replaceAll("-","_")})`})}return r}async function KO(n,e){return e?Nt(n,e,t=>[...KH(t,e),...HH(t,e)]):[]}var Ae=[],Ke,pa,Qh=new WeakMap,Xh=new Map,JO=async n=>{await n.stable(),n.getContextFiles().forEach(e=>{Xh.has(e)||Xh.set(e,new Yh(e,AT,t=>!!Zh(t))),Xh.get(e)?.watch()})},DT=async n=>{let e=Ae.indexOf(n);if(e===-1)return;ep(n),Qh.delete(n),console.log(`(ID: ${n.id}) cleaning Context for [${n.ctxNames.join(",")}]`);let t=await Fi(n);if(ee.sendNotification("devicetree/contextDeleted",{ctxNames:n.ctxNames.map(r=>r.toString()),id:n.id,...await n.getFileTree(),settings:n.settings,active:Ke===n,type:t.type}),Ae.splice(e,1),await IT(),n===Ke&&(Ke=void 0,Ae.length)){let r=pa?cr(Ae,{uri:pa}):void 0;r??=Ae[0],console.log("Active context was deleted. Forcing active to",r.id),await on({id:r.id},!0)}XO(n)},XO=async n=>{await n.stable(),n.getContextFiles().forEach(e=>Xh.get(e)?.unwatch())},GH=n=>{let e=Qh.get(n);if(!e?.abort.signal.aborted)return Promise.all([e?.promise,n.getRuntime()])},Ue=async()=>{await Promise.all(Ae.map(GH))},CT=async n=>(await QO()).indexOf(n)!==-1,QO=async()=>{let n=await ZO();return Ae.filter(e=>!n.some(t=>t===e))},ZO=async()=>{let n=await RT();return Ae.filter(e=>n.contexts.find(t=>Jr(t)===e.id))},YH=async()=>{let n=await eK();return Ae.filter(e=>n.contexts.find(t=>Jr(t)===e.id))},JH=async n=>(await YH()).indexOf(n)!==-1,XH=async(n,e)=>{if(n===e)return!0;let t=(await n.getAllParsers()).flatMap(s=>s.cPreprocessorParser.dtsIncludes).filter(s=>s.resolvedPath),r=(await e.getAllParsers()).flatMap(s=>s.cPreprocessorParser.dtsIncludes).filter(s=>s.resolvedPath);return r.some(s=>le(s.resolvedPath,n.parser.uri))&&t.length?t.every(s=>r.some(i=>i.resolvedPath===s.resolvedPath&&i.firstToken.pos.col===s.firstToken.pos.col&&i.firstToken.pos.len===s.firstToken.pos.len&&i.firstToken.pos.line===s.firstToken.pos.line&&i.lastToken.pos.col===s.lastToken.pos.col&&i.lastToken.pos.len===s.lastToken.pos.len&&i.lastToken.pos.line===s.lastToken.pos.line)):e.getContextFiles().some(s=>le(s,n.parser.uri))},QH=async n=>{if(!await CT(n))return;let e=await QO(),t=await ZO(),r=await cd(e);if(Ae.indexOf(n)===-1)return;let s=await Promise.all(r.flatMap(a=>[...t,...e.filter(c=>c!==a.context)].map(async c=>({context:a.context,same:await XH(a.context,c)})))),i=n.getContextFiles(),o=r.filter(a=>s.some(c=>c.context===a.context&&c.same)||a.context!==n&&le(a.context.parser.uri,n.parser.uri)&&i.some(c=>c&&a.files.indexOf(c)!==-1)).map(a=>a.context);o.length&&o.forEach(DT)},ee=(0,Xe.createConnection)(Xe.ProposedFeatures.all),Vr=new Xe.TextDocuments(nd),eI=!1,NT=!1,tI=!1,nI=!1,rI=!1,PT;ee.onInitialize(n=>{PT=n.workspaceFolders,ee.console.log(`[Server(${process.pid}) ${PT?.[0].uri} Version 0.3.2 ] Started and initialize received`);let e=n.capabilities;eI=!!(e.workspace&&e.workspace.configuration),NT=!!(e.workspace&&e.workspace.workspaceFolders),tI=!!e.workspace?.diagnostics?.refreshSupport,nI=!!e.workspace?.semanticTokens?.refreshSupport,rI=!!e.workspace?.foldingRange?.refreshSupport;let t={capabilities:{typeDefinitionProvider:!0,workspaceSymbolProvider:!0,textDocumentSync:Xe.TextDocumentSyncKind.Incremental,renameProvider:{prepareProvider:!0},completionProvider:{resolveProvider:!0,triggerCharacters:["&","="," "]},codeActionProvider:{codeActionKinds:[Xe.CodeActionKind.QuickFix,Xe.CodeActionKind.SourceFixAll]},documentSymbolProvider:!0,semanticTokensProvider:{legend:{tokenTypes:rd,tokenModifiers:sd},full:!0},documentLinkProvider:{resolveProvider:!1},foldingRangeProvider:!0,definitionProvider:!0,declarationProvider:!0,referencesProvider:!0,documentFormattingProvider:!0,hoverProvider:!0}};return NT&&(t.capabilities.workspace={workspaceFolders:{changeNotifications:!0,supported:!0}}),t});ee.onInitialized(()=>{eI&&ee.client.register(Xe.DidChangeConfigurationNotification.type,{}),NT&&ee.workspace.onDidChangeWorkspaceFolders(async n=>{ee.console.log("Workspace folder change event received"),await _l()})});var ZH=async()=>{let n=sI();return n={...ji,...n},bl(n,await Sl())},RT=async()=>{let n=rK();return n={...ji,...n},bl(n,await Sl())},eK=async()=>{let n=sK();return n={...ji,...n},bl(n,await Sl())},Tl=async()=>{let n=nK();return n={...ji,...n},bl(n,await Sl())},tK=new Map,Sl=async()=>(await ee.workspace.getWorkspaceFolders()??PT)?.map(e=>tt(e.uri))?.at(0),GO=async n=>{let e=cr(Ae,{id:Jr(n)});if(e)return e.ctxNames.includes(n.ctxName)||console.log(`(ID: ${e.id}) Adding name ${n.ctxName} for [${e.ctxNames.join(",")}]`),e.addCtxName(n.ctxName),e;let t=Jr(n);console.log(`(ID: ${t}) New context [${n.ctxName}]`),console.log(`(ID: ${t}) Settings: ${JSON.stringify(n,void 0," ")}`);let r=new zd(n,n.bindingType?UO({zephyrBindings:n.zephyrBindings??[],deviceOrgBindingsMetaSchema:n.deviceOrgBindingsMetaSchema??[],deviceOrgTreeBindings:n.deviceOrgTreeBindings??[]},n.bindingType):void 0);Ae.push(r),JO(r),await r.stable();let s=await Fi(r);return ee.sendNotification("devicetree/contextCreated",{ctxNames:r.ctxNames.map(i=>i.toString()),id:r.id,...await r.getFileTree(),settings:r.settings,active:r===Ke,type:s.type}),await QH(r),await IT(),r},_l=async()=>{let n=await RT(),e=await Tl();e.allowAdhocContexts||(e=await RT());let t=e.contexts.map(Jr);Ae.filter(s=>!t.includes(s.id)).forEach(DT),await n.contexts?.reduce((s,i)=>s.then(async()=>{await GO(i)}),Promise.resolve()),e.allowAdhocContexts&&await(await ZH()).contexts?.reduce((i,o)=>i.then(async()=>{cr(Ae,{uri:o.dtsFile})||await GO(o)}),Promise.resolve()),pa?await on({uri:pa}):!Ke&&Ae.length&&(console.log(`No active context using first context (ID: ${Ae[0].id}) [${Ae[0].ctxNames.join(",")}]`),await on({id:Ae[0].id}))},tr,Xs,vl=new Map,ha=new Map,nK=()=>!Xs&&!tr?void 0:{...Xs,...tr,contexts:[...tr?.contexts??[],...Array.from(ha.values()),...Array.from(vl.values())]},sI=()=>!Xs&&!tr?void 0:{...Xs,...tr,contexts:[...Array.from(vl.values())]},rK=()=>!Xs&&!tr?void 0:{...Xs,...tr,contexts:[...tr?.contexts??[],...Array.from(ha.values())]},sK=()=>!Xs&&!tr?void 0:{...tr,contexts:[...tr?.contexts??[]]};function iK(n){let e={...n};for(let t in e)e[t]===null&&delete e[t];return e}var iI=async()=>{let n=await Tl();console.log("Resolved settings",JSON.stringify(n,void 0," ")),ee.sendNotification("devicetree/settingsChanged",n),await _l(),Ue().then(()=>{tI&&ee.languages.diagnostics.refresh()})};ee.onDidChangeConfiguration(async n=>{n?.settings?.devicetree&&(tr=iK(n.settings.devicetree),console.log("Configuration changed",JSON.stringify(n,void 0," ")),await iI())});var oI=()=>{let n=Ke?.getContextFiles();Array.from(Vr.keys()).forEach(e=>{n?.some(t=>le(t,tt(e)))||ee.sendDiagnostics({uri:e,version:Vr.get(e)?.version,diagnostics:[{severity:Xe.DiagnosticSeverity.Warning,range:Xe.Range.create(Xe.Position.create(0,0),Xe.Position.create(0,0)),message:"File not in active context",source:"devicetree"}]})})},AT=async n=>{let e=sg(Ae,n);if(e.length)e.forEach(t=>{Qh.get(t)?.abort.abort();let r=new AbortController,s=new Promise(i=>{setTimeout(async()=>{if(r.signal.aborted){i();return}let o=performance.now(),a=Ke===t,c=a?aI(t):[];XO(t),await t.reevaluate(n),JO(t),a&&OT(t).then(l=>{let u=l.items.map(d=>({uri:d.uri,version:d.version??void 0,diagnostics:d.items}));ep(t,c.filter(d=>u.every(f=>f.uri!==d.uri))),u.forEach(d=>{ee.sendDiagnostics(d)})}),i(),console.log("reevaluate",performance.now()-o)},50)});Qh.set(t,{abort:r,promise:s})});else{if((await Tl()).allowAdhocContexts===!1)return;await _l(),await on({uri:n})}},oK=n=>Vr.keys().find(e=>le(tt(e),n)),Zh=n=>{let e=oK(n);if(e)return Vr.get(e)},aI=n=>n.getContextFiles().map(e=>({uri:de(e),version:Zh(e)?.version,diagnostics:[]})),ep=async(n,e=aI(n))=>{n===Ke&&await Promise.all(e.map(t=>ee.sendDiagnostics({uri:t.uri,version:Vr.get(t.uri)?.version,diagnostics:[]})))},OT=async n=>{await n.stable();let e=performance.now(),t=await n.getDiagnostics(),r=n.getContextFiles().map(s=>({uri:de(s),kind:Xe.DocumentDiagnosticReportKind.Full,items:t.get(s)??[],version:Zh(s)?.version??null}));return console.log(`(ID: ${n.id})`,"workspace diagnostics",`[${n.ctxNames.join(",")}]`,performance.now()-e),{items:[...r]}},IT=async()=>{let n=await Promise.all(Ae.map(Fi));console.log("======== Context List ========"),n.forEach(e=>{console.log(`(ID: ${e.ctx.id}) [${e.ctx.ctxNames.join(",")}]`,`[${e.type}]`,Ke===e.ctx?" [ACTIVE]":"")}),console.log("==============================")},Fi=async n=>{let e=await CT(n),t=!e&&await JH(n);return{ctx:n,type:e?"Ad Hoc":t?"User":"3rd Party"}},on=async(n,e=!1)=>{"uri"in n&&(pa=n.uri,console.log("Active File Uri",pa));let t=await Tl();if(await Ue(),Ke&&!e&&!t.autoChangeContext||!e&&Ke?.getContextFiles().find(i=>"uri"in n&&le(i,n.uri)))return!1;let r=Ke,s=cr(Ae,n);return r!==s&&(r&&ep(r),Ke=s,s?(Fi(s).then(async i=>{let o=await s.getFileTree();s!==Ke&&!Ae.includes(s)||ee.sendNotification("devicetree/newActiveContext",{ctxNames:s.ctxNames.map(a=>a.toString()),id:s.id,...o,settings:s.settings,active:Ke===s,type:i.type})}),OT(s).then(i=>{i.items.map(o=>({uri:o.uri,version:o.version??void 0,diagnostics:o.items})).forEach(o=>{ee.sendDiagnostics(o)})}),await IT()):ee.sendNotification("devicetree/newActiveContext",void 0)),rI&&ee.languages.foldingRange.refresh(),nI&&ee.languages.semanticTokens.refresh(),oI(),!0};Vr.listen(ee);Vr.onDidClose(async n=>{let e=tt(n.document.uri),t=sg(Ae,e);if(t.length===0){vl.delete(e),ee.sendDiagnostics({uri:n.document.uri,version:Vr.get(n.document.uri)?.version,diagnostics:[]});return}await Promise.all(t.map(async r=>{(r?.getContextFiles()??[]).filter(o=>o!==e).some(o=>Zh(o))||(await CT(r)?(DT(r),vl.delete(r.settings.dtsFile)):ep(r))})),tK.delete(n.document.uri)});Vr.onDidOpen(async n=>{await Ue(),oI();let e=tt(n.document.uri),t=cr(Ae,{uri:e});if(t)t!==Ke&&await on({id:t.id});else{let r={ctxName:(0,YO.basename)(e),dtsFile:e};vl.set(e,r),await AT(e)}});Vr.onDidChangeContent(async n=>{let e=tt(n.document.uri),t=n.document.getText(),r=fr();r.needsRenew(e,t)&&(console.log("Content changed"),r.renewLexer(e,t),await AT(e))});ee.listen();ee.languages.diagnostics.onWorkspace(async()=>{await Ue();let n=Ke;return n?OT(n):{items:[]}});ee.onDidChangeWatchedFiles(n=>{ee.console.log("We received a file change event")});ee.onCompletion(async n=>{await Ue();let e=tt(n.textDocument.uri);on({uri:e});let t=$n(e);return t?[...await DN(n,t),...await jN(n,t)]:[]});ee.onCompletionResolve(n=>n);var $n=n=>{let e=sI();return cr(Ae,{uri:n},Ke,e?.preferredContext)};ee.onDocumentSymbol(async n=>{await Ue();let e=tt(n.textDocument.uri),t=$n(e);return t?t.getUriParser(e)?.getDocumentSymbols(e):[]});ee.onWorkspaceSymbol(async()=>{await Ue();let n=Ke;return n?(await n.getAllParsers()).flatMap(e=>e.getWorkspaceSymbols()):[]});ee.languages.semanticTokens.on(async n=>{try{await Ue();let e=tt(n.textDocument.uri),t=$n(e),r=new Xe.SemanticTokensBuilder,s=t?.isInContext(e);return!t||!s?{data:[]}:((await t.getAllParsers()).forEach(i=>i.buildSemanticTokens(r,e)),r.build())}catch(e){throw console.log(e),e}});ee.onDocumentLinks(async n=>{await Ue();let e=tt(n.textDocument.uri);return $n(e)?.getDocumentLinks(e)});ee.onPrepareRename(async n=>{await Ue();let e=tt(n.textDocument.uri);on({uri:e});let t=$n(e);return MN(n,t)});ee.onRenameRequest(async n=>{await Ue();let e=tt(n.textDocument.uri);on({uri:e});let t=$n(e);return xN(n,t)});ee.onReferences(async n=>{await Ue();let e=tt(n.textDocument.uri);on({uri:e});let t=$n(e);return CN(n,t)});ee.onDefinition(async n=>{await Ue();let e=tt(n.textDocument.uri);on({uri:e});let t=$n(e),r=(await t?.getDocumentLinks(e,n.position))?.filter(s=>s.target).map(s=>Xe.Location.create(s.target,s.range))??[];return r.length?r:$N(n,t)});ee.onDeclaration(async n=>{await Ue();let e=tt(n.textDocument.uri);on({uri:e});let t=$n(e);return LN(n,t)});ee.onCodeAction(async n=>qN(n));ee.onDocumentFormatting(async n=>{await Ue();let e=tt(n.textDocument.uri);on({uri:e});let t=$n(e);return t?Dk(n,t):[]});ee.onHover(async n=>{await Ue();let e=tt(n.textDocument.uri),t=$n(e);return(await BN(n,t)).at(0)});ee.onFoldingRanges(async n=>{await Ue();let e=tt(n.textDocument.uri),t=$n(e),r=t?.isInContext(e);if(!t||!r)return[];let s=(await t.getAllParsers()).find(i=>i.getFiles().some(o=>o===e));return s?WO(e,s):[]});ee.onTypeDefinition(async n=>{await Ue();let e=tt(n.textDocument.uri);on({uri:e});let t=$n(e);return zO(n,t)});ee.onRequest("devicetree/getContexts",async()=>(await Ue(),Promise.all(Ae.map(async n=>{let e=await Fi(n);return{ctxNames:n.ctxNames.map(t=>t.toString()),id:n.id,...await n.getFileTree(),settings:n.settings,active:Ke===n,type:e.type}}))));ee.onRequest("devicetree/setActive",async n=>(await Ue(),console.log("devicetree/setActive",n),await on(n,!0)));ee.onRequest("devicetree/getActiveContext",async n=>{if(await Ue(),console.log("devicetree/getActiveContext",n),await on({id:n},!0),!Ke)return;let e=await Fi(Ke);return Ke?{ctxNames:Ke.ctxNames.map(t=>t.toString()),id:n,...await Ke.getFileTree(),settings:Ke.settings,active:!0,type:e.type}:void 0});ee.onRequest("devicetree/setDefaultSettings",async n=>{await Ue(),Xs=n,console.log("Integration Settings",n),await iI()});ee.onRequest("devicetree/requestContext",async n=>{await Ue();let e=await Tl(),t=await kT(n,e,await Sl());console.log("devicetree/requestContext",t);let r=Jr(t),s=Array.from(ha).find(([,a])=>a.ctxName===n.ctxName);if(s){let a=s[0].split(":",1)[0];cr(Ae,{name:n.ctxName.toString()})?.removeCtxName(n.ctxName),console.log(`Removing integration context with ID ${a} and name ${n.ctxName}`),ha.delete(s[0])}ha.set(`${r}:${n.ctxName}`,n),await _l();let i=Ae.find(a=>a.id===r);if(!i)throw new Error("Failed to create context");let o=await Fi(i);return{ctxNames:i.ctxNames.map(a=>a.toString()),id:r,...await i.getFileTree(),settings:i.settings,active:!0,type:o.type}});ee.onRequest("devicetree/removeContext",async({id:n,name:e})=>{await Ue(),ha.delete(`${n}:${e}`);let t=cr(Ae,{id:n});if(t){if(t.removeCtxName(e),t.ctxNames.length){console.log("Context will not be deleted as it is still in use by others");return}await _l()}});ee.onRequest("devicetree/compiledDtsOutput",async n=>(await Ue(),n?cr(Ae,{id:n})?.toFullString():void 0));ee.onRequest("devicetree/serializedContext",async n=>(await Ue(),n?cr(Ae,{id:n})?.serialize():void 0));ee.onRequest("devicetree/customActions",async n=>(await Ue(),KO(n,Ke)));ee.onRequest("devicetree/activeFileUri",async n=>{await Ue(),on({uri:n})});
296
+ ${r}`])]},gK=(t,e)=>ox(t,e.split("/").filter(n=>n)),ox=(t,e)=>{if(e.length===0)return{node:t,remainingInstancePath:""};let n=e[0].split("@"),r=n[0],s=n.at(1)?.split(",").map(o=>Number.parseInt(o,16)),i=t.getNode(r,s);return i?ox(i,e.slice(1)):{node:t,property:t.getProperty(e[0]),remainingInstancePath:e.slice(1).join("/")}};var HT=class t{constructor(){this.schemaIdValidators=new Map;this.ajvMap=new Map}static getNodeCompatible(e){let r=e.getProperty("compatible")?.ast.values;if(!r?.values.some(s=>!(s?.value instanceof Le)))return r?.values.map(s=>(s?.value).value)}parseMetaSchema(e,n){Oi.sync("**/*.yaml",{cwd:e}).forEach(s=>{s=(0,zT.resolve)(e,s);try{let i=VT.default.parse((0,WT.readFileSync)(s,"utf-8"));n.addMetaSchema(i),this.schemaIdValidators.set(i.$id,s)}catch{}})}parseBindings(e,n){Oi.sync("**/*.yaml",{cwd:e}).forEach(s=>{s=(0,zT.resolve)(e,s);try{let i=VT.default.parse((0,WT.readFileSync)(s,"utf-8"));n.addSchema(i),this.schemaIdValidators.set(i.$id,s)}catch(i){console.warn(s,i.message)}})}getNodeTypes(e,n,r){let s=`${e.join(";")}::${n.join(";")}`,i=this.ajvMap.get(s);return i||(i=new cx.default({strict:!1,strictSchema:!1,strictNumbers:!1}),i.addMetaSchema(UT),this.ajvMap.set(s,i),e.forEach(c=>this.parseMetaSchema(c,i)),n.forEach(c=>this.parseBindings(c,i))),t.getNodeCompatible(r)?.map(c=>{try{let l=Array.from(this.schemaIdValidators.keys()).find(f=>f.endsWith(`/${c}.yaml#`));if(!l)return;let u=new op(i,l);u.bindingsPath=this.schemaIdValidators.get(l),u.compatible=c;let d=i.getSchema(l);return u.description=(d?.schema).description,u.examples=(d?.schema).examples,u.maintainers=(d?.schema).maintainers,u}catch(l){console.warn(l.message)}}).filter(c=>c)??[]}},ax,lx=()=>(ax??=new HT,ax);var px=Y(wb());var _a=require("path"),mx=require("fs");var kr=Y(Q());var ux=t=>{switch(t){case"string":return B("STRING");case"int":return B("U32");case"boolean":return B("EMPTY");case"array":return B("PROP_ENCODED_ARRAY");case"uint8-array":return B("BYTESTRING");case"string-array":return B("STRINGLIST");case"phandle":return B("U32");case"phandles":return B("PROP_ENCODED_ARRAY");case"phandle-array":return B("PROP_ENCODED_ARRAY");case"path":return B(["STRING","U32"]);case"compound":return B("ANY")}},dx=(t,e)=>{switch(t){case"string":return typeof e=="string"?e:void 0;case"int":return typeof e=="number"?e:void 0;case"boolean":return;case"array":return Array.isArray(e)&&e.every(n=>typeof n=="number")?e:void 0;case"uint8-array":return Array.isArray(e)&&e.every(n=>typeof n=="number")?e:void 0;case"string-array":return Array.isArray(e)&&e.every(n=>typeof n=="string")?e:void 0;case"phandle":return;case"phandles":return;case"phandle-array":return;case"path":return;case"compound":return}},ap=(t,e)=>{if(e=e.include.reduce((n,r)=>{let s=t.find(i=>(0,_a.basename)(i.filePath)===r.name);if(s){let i=r["property-blocklist"];return n.include=n.include.filter(o=>o!==r),yK(t,s,n,i)??n}return console.warn(`Unable to find ${r}`),n},e),e["child-binding"]&&(e["child-binding"].include=gx(e["child-binding"].include),e["child-binding"]=ap(t,e["child-binding"])),!e.include.length)return e},yK=(t,e,n,r=[])=>{let s=ap(t,e),i=ap(t,n);if(!s||!i)return;let o=new Set;Object.keys(s?.properties??{}).forEach(d=>o.add(d)),Object.keys(i?.properties??{}).forEach(d=>o.add(d));let a={};Array.from(o).forEach(d=>{let f=r?.some(y=>y===d)?{}:s.properties?.[d]??{},h=i.properties?.[d]??{};a={...a,[d]:{...f,...h}}}),i.properties=a;let c=new Set;return Object.keys(s).filter(d=>d.endsWith("-cells")).forEach(d=>c.add(d)),Object.keys(s).filter(d=>d.endsWith("-cells")).forEach(d=>c.add(d)),Array.from(c).forEach(d=>{let f=s[d]??[],h=i[d]??[];i[d]=Array.from([...f,...h])}),i},gx=t=>t?typeof t=="string"?[{name:t}]:t.map(e=>typeof e!="string"?e:{name:e}):[],GT=class t{constructor(){this.typeCache=new Map;this.readFolders=[]}static getNodeCompatible(e){let r=e.getProperty("compatible")?.ast.values;if(!r?.values.some(s=>!(s?.value instanceof Le)))return r?.values.map(s=>(s?.value).value)}getNodeTypes(e,n){let r=t.getNodeCompatible(n);if(!r)return[_i(n)];let s=r.map(o=>this.typeCache.get(o)?.(n)).filter(o=>o);if(s.length)return s;this.loadTypeAndCache(e);let i=r.map(o=>this.typeCache.get(o)?.(n)).filter(o=>o);return i.length?i:[_i(n)]}loadTypeAndCache(e){e=Array.isArray(e)?e:[e],e.forEach(n=>{if(this.readFolders.indexOf(n)!==-1)return;this.readFolders.push(n);let s=Oi.sync("**/*.yaml",{cwd:n,ignore:"test/*"}).map(o=>{o=(0,_a.resolve)(n,o);try{let a=px.default.parse((0,mx.readFileSync)(o,"utf-8"));return{...a,include:gx(a?.include),filePath:o}}catch(a){console.warn(a)}}).filter(o=>!!o),i=s.map(o=>ap(s,o)).filter(o=>!!o&&!o.include.length);bK(i,this.typeCache)})}},fx,yx=()=>(fx??=new GT,fx),bK=(t,e)=>t.forEach(n=>{let r=n.compatible??(n.filePath?(0,_a.basename)(n.filePath,"yaml"):void 0);r&&e.set(r,s=>bx(n,s))}),bx=(t,e)=>{let n=_i(e);n.compatible=t.compatible??(t.filePath?(0,_a.basename)(t.filePath,"yaml"):void 0),n.description=t.description,n.bindingsPath=t.filePath,n.bus=typeof t.bus=="string"?[t.bus]:t.bus,n.onBus=t["on-bus"];let s=Object.keys(t).filter(i=>i.endsWith("-cells")).map(i=>({specifier:i.replace(/-cells$/,""),values:t[i]}));if(t.properties&&Object.keys(t.properties).forEach(i=>{let o=t.properties[i];vK(n,i,o),n.cellsValues=s}),t["child-binding"]){let i=t["child-binding"];n.childNodeType=o=>bx(i,o)}return n},vK=(t,e,n)=>{let r=t.properties.find(s=>s.getNameMatch(e));if(r&&typeof r.name=="string"){r.required=()=>n.required?"required":"optional",r.values=()=>n.enum??[],r.constValue=dx(n.type,n.const),r.bindingType=n.type;let s=r.additionalTypeCheck;r.additionalTypeCheck=(i,o)=>[...hx(n,e,r)(i,o),...s?.(i,o)??[]]}else{let s=n.type==="compound"?r?.type:ux(n.type);s??=ux(n.type);let i=new K(e,s,n.required?"required":"optional",void 0,n.enum);i.additionalTypeCheck=(o,a)=>{let c=[...r?.additionalTypeCheck?.(o,a)??[],...hx(n,e,i)(o,a)];return i.typeExample??=r?.typeExample,c},i.description=n.description?[n.description]:r?.description,i.bindingType=n.type,i.constValue=dx(n.type,n.const),t.addProperty(i)}},hx=(t,e,n)=>{let r=t;return(s,i)=>{let o=s.parent.root,a=[];if(r.const){let c=s.ast.quickValues;if(c?.length==1){let l=Array.isArray(r.const)?r.const:[r.const];Array.isArray(c[0])&&l.length===c[0].length&&c[0].every((d,f)=>typeof d=="number"&&Number.isNaN(d)||l[f]===d)||a.push($(24,s.ast.values??s.ast,kr.DiagnosticSeverity.Error,[],[],[`Binding expects values to be "${r.type}" with value: ${r.const}`]))}}if(r.deprecated&&a.push($(14,s.ast,kr.DiagnosticSeverity.Warning,[],[kr.DiagnosticTag.Deprecated],[s.name])),(r.type==="phandle"||r.type==="phandles"||r.type==="path")&&Ee(s.ast.values)?.forEach(l=>{Ln(l,o)||a.push($(22,l,kr.DiagnosticSeverity.Error))}),r.type==="path"&&s.ast.values?.values.at(0)?.value instanceof Le){let c=s.ast.values?.values.at(0)?.value,l=[];c.value.split("/").every(u=>{let d=o.getNode(u);return d?l.push(u):a.push($(23,c,kr.DiagnosticSeverity.Error,[],[],[u,`/${l.join("/")}`])),!d})}if(r.type==="phandle-array"){let c=Ee(s.ast.values),l=0;for(;c&&l<c.length;){let u=c.at(l),d=Ln(u,o);if(!d){a.push($(22,u??s.ast,kr.DiagnosticSeverity.Error));break}let f="";e.endsWith("-gpios")?f="gpio":f=r["specifier-space"]??e.slice(0,-1);let h=d.getProperty(`#${f}-cells`);if(!h){a.push($(16,s.ast,kr.DiagnosticSeverity.Error,[...d.nodeNameOrLabelRef],[],[s.name,`#${f}-cells`,`/${d.path.slice(1).join("/")}`]));break}let y=h?Pe(h,0,0,i)??0:0,m=d.nodeType?.cellsValues?.find(T=>T.specifier===f)?.values;if(n.typeExample=`<${["phandel",...m??[],...Array.from({length:y-(m?.length??0)},()=>"cell")].join(" ")}>`,1+y>c.length-l){a.push($(19,u??s.ast,kr.DiagnosticSeverity.Error,[],[],[s.name,n.typeExample]));break}l+=1+y;let _=c.slice(l-y,l),E=d.getProperty(`${f}-map`);if(E){let T=d.getNexusMapEntyMatch(f,i,_);T?.match?s.nexusMapsTo.push({mappingValuesAst:_,mapItem:T.match}):a.push($(31,T.entry,kr.DiagnosticSeverity.Error,[E.ast]))}}}return a}};var vx=(t,e)=>({files:t,type:e,getNodeTypes:async n=>{switch(e){case"Zephyr":return yx().getNodeTypes(t.zephyrBindings,n);case"DevicetreeOrg":return lx().getNodeTypes(t.deviceOrgBindingsMetaSchema,t.deviceOrgTreeBindings,n)}}});var YT=Y(Q());var KT=t=>!t.openScope||!t.closeScope?.prevToken?t.nodes.flatMap(KT):[{startLine:t.openScope.pos.line,startCharacter:t.openScope.pos.col,endLine:t.closeScope.prevToken.pos.line,endCharacter:t.closeScope.prevToken.pos.col,kind:YT.FoldingRangeKind.Region},...t.nodes.flatMap(KT)],Tx=t=>{let e=[];return[...t instanceof Ms?t.ifBlocks.map(n=>({start:(n.expression??n.keyword).lastToken,end:n.content?.lastToken??(n.expression??n.keyword).lastToken})):[{start:(t.ifDef.identifier??t.ifDef.keyword).lastToken,end:t.ifDef.content?.lastToken}],t.elseOption?{start:t.elseOption.keyword.lastToken,end:t.elseOption.content?.lastToken}:null].forEach(n=>{!n||!n.end||e.push({startLine:n.start.pos.line,startCharacter:n.start.pos.col,endLine:n.end.pos.line,endCharacter:n.end.pos.colEnd,kind:YT.FoldingRangeKind.Region})}),e},TK=t=>t instanceof ze?KT(t):t instanceof Io||t instanceof Ms?Tx(t):[];function _x(t,e){return e.allAstItems.flatMap(n=>[n,...n.allDescendants]).filter(n=>le(n.uri,t)).flatMap(TK)}var Wi=Y(Q());function _K(t){if(!t||!(t.ast instanceof qe)&&!(t.ast instanceof Vt))return[];let e=n=>n.nodeType?.bindingsPath?[Wi.Location.create(fe(n.nodeType.bindingsPath),Wi.Range.create(Wi.Position.create(0,0),Wi.Position.create(0,0)))]:[];return t.item instanceof we&&!At(t.ast)?e(t.item):t.ast instanceof Vt&&t.ast.parentNode instanceof be&&t.ast.parentNode.linksTo?e(t.ast.parentNode.linksTo):t.ast instanceof qe&&t.ast.linksTo?e(t.ast.linksTo):[]}async function Sx(t,e){return Dt(t,e,n=>[..._K(n)])}var lp=require("fs");var SK=(t,e)=>{pr().reset(t),pr().requestTokens(t,!0),e(t)},cp=class{constructor(e,n,r){this.file=e;this.cb=n;this.hasDocumentOpen=r;this.count=0}watch(){if(this.count++,this.count===1){console.log("create watch for",this.file);let e=this.file,n=this.cb;this.onChange=()=>{if(this.hasDocumentOpen(e)){console.log("skipping on change document is open",e);return}console.log("onChange",e),SK(e,n)},(0,lp.watchFile)(e,this.onChange)}}unwatch(){this.count--,this.count===0&&(console.log("dispose watch for",this.file),(0,lp.unwatchFile)(this.file,this.onChange),this.onChange=void 0)}};var on=Y(require("path")),XT=require("fs");var nr=async(t,e)=>(e&&(t=t.replaceAll("${workspaceFolder}",e)),t),Hi={defaultBindingType:"Zephyr",defaultZephyrBindings:[],defaultIncludePaths:[],defaultDeviceOrgBindingsMetaSchema:[],defaultDeviceOrgTreeBindings:[],contexts:[],defaultLockRenameEdits:[],allowAdhocContexts:!0,autoChangeContext:!0},JT=async(t,e,n)=>{let r=(t.cwd?await nr(t.cwd,n):void 0)??e.cwd,s=await Promise.all((t.includePaths??e.defaultIncludePaths).map(f=>nr(f,n))),i=await Promise.all((t.zephyrBindings??e.defaultZephyrBindings).map(f=>nr(f,n))),o=t.bindingType??e.defaultBindingType,a=await Promise.all((t.deviceOrgTreeBindings??e.defaultDeviceOrgTreeBindings).map(f=>nr(f,n))),c=await Promise.all((t.deviceOrgBindingsMetaSchema??e.defaultDeviceOrgBindingsMetaSchema).map(f=>nr(f,n))),l=await Promise.all((t.lockRenameEdits??e.defaultLockRenameEdits).map(f=>nr(f,n)));r&&o==="Zephyr"&&(!i||i.length===0)&&(i=["./zephyr/dts/bindings"]);let u=t.dtsFile,d=t.overlays??[];return r&&(i=i.map(f=>(0,on.resolve)(r,f)).filter(f=>(0,XT.existsSync)(f)),a=a?.map(f=>(0,on.resolve)(r,f)),c=c.map(f=>(0,on.resolve)(r,f)),s=s.map(f=>(0,on.resolve)(r,f)),u=(0,on.resolve)(r,u),d=d.map(f=>(0,on.resolve)(r,f)),l=l.map(f=>(0,on.resolve)(r,f))),{ctxName:t.ctxName??(0,on.basename)(u),cwd:r?Ze(r):void 0,includePaths:s.map(Ze),zephyrBindings:i.map(Ze),bindingType:o,deviceOrgTreeBindings:a.map(Ze),deviceOrgBindingsMetaSchema:c.map(Ze),dtsFile:Ze(u),overlays:d.map(Ze),lockRenameEdits:l.map(Ze)}},Pl=async(t,e)=>{let n=t.cwd?await nr(t.cwd,e):void 0,r=t.defaultBindingType,s=t.defaultDeviceOrgBindingsMetaSchema=await Promise.all((t.defaultDeviceOrgBindingsMetaSchema??[]).map(d=>nr(d,e))),i=t.defaultDeviceOrgTreeBindings=await Promise.all((t.defaultDeviceOrgTreeBindings??[]).map(d=>nr(d,e))),o=t.defaultIncludePaths=await Promise.all((t.defaultIncludePaths??[]).map(d=>nr(d,e))),a=t.defaultZephyrBindings=await Promise.all((t.defaultZephyrBindings??[]).map(d=>nr(d,e))),c=t.defaultLockRenameEdits=await Promise.all((t.defaultLockRenameEdits??[]).map(d=>nr(d,e)));n&&(o=t.defaultIncludePaths=(t.defaultIncludePaths??[]).map(d=>(0,on.resolve)(n,d)),r==="Zephyr"&&!t.defaultZephyrBindings&&(a=["./zephyr/dts/bindings"]),a=a.map(d=>(0,on.resolve)(n,d)),s=s.map(d=>(0,on.resolve)(n,d))),t.defaultDeviceOrgTreeBindings=(t.defaultDeviceOrgTreeBindings??[]).map(d=>t.cwd?(0,on.resolve)(t.cwd,d):d);let l={cwd:n,defaultDeviceOrgBindingsMetaSchema:s,defaultDeviceOrgTreeBindings:i,defaultIncludePaths:o,defaultZephyrBindings:a,defaultLockRenameEdits:c,defaultBindingType:r,autoChangeContext:t.autoChangeContext??Hi.autoChangeContext,allowAdhocContexts:t.allowAdhocContexts??Hi.allowAdhocContexts},u=(await Promise.all(t.contexts?.map(d=>JT(d,l,e))??[])).filter(d=>[d.dtsFile,...d.overlays].every(f=>(0,XT.existsSync)(f)&&on.default.isAbsolute(f)));return{...l,contexts:u}};var Nx=require("path");function EK(t,e){if(!t||!(t.item instanceof Ye)||!(t.ast instanceof Ve))return[];let n=[];if(e.settings.bindingType==="Zephyr"){n.push({type:"dt_zephyr_macro_prop_node_path",data:`DT_PROP(${Ex(t.item.parent)}, ${t.item.name.replaceAll("-","_")}))`});let r=t.item;t.item.parent.labels.forEach(s=>n.push({type:"dt_zephyr_macro_prop_node_label",data:`DT_PROP(DT_NODELABEL(${s.label.toString()}), ${r.name.replaceAll("-","_")})`}))}return n}var Ex=t=>`DT_PATH(${t.path.slice(1).map(e=>e.replace("@","_").replaceAll("-","_")).join(",")})`;function wK(t,e){if(!t||t.item===null)return[];let n;if(t.item instanceof we?n=t.item:t.ast.parentNode instanceof be&&t.ast.parentNode.linksTo?n=t.ast.parentNode.linksTo:t.ast instanceof qe&&t.ast.linksTo&&(n=t.ast.linksTo),!n)return[];let r=[{type:"path",data:n.pathString}];if(e.settings.bindingType==="Zephyr"){n.labels.forEach(o=>{r.push({type:"dt_zephyr_macro_node_label",data:`DT_NODELABEL(${o.label.toString()})`})}),r.push({type:"dt_zephyr_macro_node_path",data:Ex(n)});let i=Lo.getNodeFromPath(["aliases"],n.root)?.property.find(o=>{if(o.ast.quickValues?.at(0)===n.pathString)return!0;let a=o.ast.values?.values.at(0)?.value;if(a instanceof be&&a.linksTo===n||a instanceof Mn&&a.path?.pathParts.at(-1)?.linksTo===n)return!0});i&&r.push({type:"dt_zephyr_macro_prop_node_alias",data:`DT_ALIAS(${i.name.replaceAll("-","_")})`})}return r}async function wx(t,e){return e?Dt(t,e,n=>[...wK(n,e),...EK(n,e)]):[]}var xe=[],Fe,Ea,dp=new WeakMap,up=new Map,Px=async t=>{await t.stable(),t.getContextFiles().forEach(e=>{up.has(e)||up.set(e,new cp(e,r_,n=>!!fp(n))),up.get(e)?.watch()})},t_=async t=>{let e=xe.indexOf(t);if(e===-1)return;hp(t,void 0,!0),dp.delete(t),console.log(`(ID: ${t.id}) cleaning Context for [${t.ctxNames.join(",")}]`);let n=await Gi(t);if(ee.sendNotification("devicetree/contextDeleted",{ctxNames:t.ctxNames.map(r=>r.toString()),id:t.id,...await t.getFileTree(),settings:t.settings,active:Fe===t,type:n.type}),xe.splice(e,1),await i_(),t===Fe&&(Fe=void 0,xe.length)){let r=Ea?ur(xe,{uri:Ea}):void 0;r??=xe[0],console.log("Active context was deleted. Forcing active to",r.id),await an({id:r.id},!0)}Rx(t)},Rx=async t=>{await t.stable(),t.getContextFiles().forEach(e=>up.get(e)?.unwatch())},kK=t=>{let e=dp.get(t);if(!e?.abort.signal.aborted)return Promise.all([e?.promise,t.getRuntime()])},He=async()=>{await Promise.all(xe.map(kK))},n_=async t=>(await Dx()).indexOf(t)!==-1,Dx=async()=>{let t=await Cx();return xe.filter(e=>!t.some(n=>n===e))},Cx=async()=>{let t=await e_();return xe.filter(e=>t.contexts.find(n=>Zr(n)===e.id))},NK=async()=>{let t=await AK();return xe.filter(e=>t.contexts.find(n=>Zr(n)===e.id))},PK=async t=>(await NK()).indexOf(t)!==-1,RK=async(t,e)=>{if(t===e)return!0;let n=(await t.getAllParsers()).flatMap(s=>s.cPreprocessorParser.dtsIncludes).filter(s=>s.resolvedPath),r=(await e.getAllParsers()).flatMap(s=>s.cPreprocessorParser.dtsIncludes).filter(s=>s.resolvedPath);return r.some(s=>le(s.resolvedPath,t.parser.uri))&&n.length?n.every(s=>r.some(i=>i.resolvedPath===s.resolvedPath&&i.firstToken.pos.col===s.firstToken.pos.col&&i.firstToken.pos.len===s.firstToken.pos.len&&i.firstToken.pos.line===s.firstToken.pos.line&&i.lastToken.pos.col===s.lastToken.pos.col&&i.lastToken.pos.len===s.lastToken.pos.len&&i.lastToken.pos.line===s.lastToken.pos.line)):e.getContextFiles().some(s=>le(s,t.parser.uri))},DK=async t=>{if(!await n_(t))return;let e=await Dx(),n=await Cx(),r=await yd(e);if(xe.indexOf(t)===-1)return;let s=await Promise.all(r.flatMap(a=>[...n,...e.filter(c=>c!==a.context)].map(async c=>({context:a.context,same:await RK(a.context,c)})))),i=t.getContextFiles(),o=r.filter(a=>s.some(c=>c.context===a.context&&c.same)||a.context!==t&&le(a.context.parser.uri,t.parser.uri)&&i.some(c=>c&&a.files.indexOf(c)!==-1)).map(a=>a.context);o.length&&o.forEach(t_)},ee=(0,tt.createConnection)(tt.ProposedFeatures.all),Nr=new tt.TextDocuments(dd),Ax=!1,QT=!1,Ox=!1,Ix=!1,xx=!1,ZT;ee.onInitialize(t=>{ZT=t.workspaceFolders,ee.console.log(`[Server(${process.pid}) ${ZT?.[0].uri} Version 0.4.0 ] Started and initialize received`);let e=t.capabilities;Ax=!!(e.workspace&&e.workspace.configuration),QT=!!(e.workspace&&e.workspace.workspaceFolders),Ox=!!e.workspace?.diagnostics?.refreshSupport,Ix=!!e.workspace?.semanticTokens?.refreshSupport,xx=!!e.workspace?.foldingRange?.refreshSupport;let n={capabilities:{typeDefinitionProvider:!0,workspaceSymbolProvider:!0,textDocumentSync:tt.TextDocumentSyncKind.Incremental,renameProvider:{prepareProvider:!0},completionProvider:{resolveProvider:!0,triggerCharacters:["&","="," "]},codeActionProvider:{codeActionKinds:[tt.CodeActionKind.QuickFix,tt.CodeActionKind.SourceFixAll]},documentSymbolProvider:!0,semanticTokensProvider:{legend:{tokenTypes:fd,tokenModifiers:hd},full:!0},documentLinkProvider:{resolveProvider:!1},foldingRangeProvider:!0,definitionProvider:!0,declarationProvider:!0,referencesProvider:!0,documentFormattingProvider:!0,hoverProvider:!0}};return QT&&(n.capabilities.workspace={workspaceFolders:{changeNotifications:!0,supported:!0}}),n});ee.onInitialized(()=>{Ax&&ee.client.register(tt.DidChangeConfigurationNotification.type,{}),QT&&ee.workspace.onDidChangeWorkspaceFolders(async t=>{ee.console.log("Workspace folder change event received"),await Al()})});var CK=async()=>{let t=Mx();return t={...Hi,...t},Pl(t,await Cl())},e_=async()=>{let t=xK();return t={...Hi,...t},Pl(t,await Cl())},AK=async()=>{let t=MK();return t={...Hi,...t},Pl(t,await Cl())},Dl=async()=>{let t=IK();return t={...Hi,...t},Pl(t,await Cl())},OK=new Map,Cl=async()=>(await ee.workspace.getWorkspaceFolders()??ZT)?.map(e=>et(e.uri))?.at(0),kx=async t=>{let e=ur(xe,{id:Zr(t)});if(e)return e.ctxNames.includes(t.ctxName)||console.log(`(ID: ${e.id}) Adding name ${t.ctxName} for [${e.ctxNames.join(",")}]`),e.addCtxName(t.ctxName),e;let n=Zr(t);console.log(`(ID: ${n}) New context [${t.ctxName}]`),console.log(`(ID: ${n}) Settings: ${JSON.stringify(t,void 0," ")}`);let r=new rf(t,t.bindingType?vx({zephyrBindings:t.zephyrBindings??[],deviceOrgBindingsMetaSchema:t.deviceOrgBindingsMetaSchema??[],deviceOrgTreeBindings:t.deviceOrgTreeBindings??[]},t.bindingType):void 0);xe.push(r),Px(r),await r.stable();let s=await Gi(r);return ee.sendNotification("devicetree/contextCreated",{ctxNames:r.ctxNames.map(i=>i.toString()),id:r.id,...await r.getFileTree(),settings:r.settings,active:r===Fe,type:s.type}),await DK(r),await i_(),r},Al=async()=>{let t=await e_(),e=await Dl();e.allowAdhocContexts||(e=await e_());let n=e.contexts.map(Zr);xe.filter(s=>!n.includes(s.id)).forEach(t_),await t.contexts?.reduce((s,i)=>s.then(async()=>{await kx(i)}),Promise.resolve()),e.allowAdhocContexts&&await(await CK()).contexts?.reduce((i,o)=>i.then(async()=>{ur(xe,{uri:o.dtsFile})||await kx(o)}),Promise.resolve()),Ea?await an({uri:Ea}):!Fe&&xe.length&&(console.log(`No active context using first context (ID: ${xe[0].id}) [${xe[0].ctxNames.join(",")}]`),await an({id:xe[0].id}))},rr,ri,Rl=new Map,Sa=new Map,IK=()=>!ri&&!rr?void 0:{...ri,...rr,contexts:[...rr?.contexts??[],...Array.from(Sa.values()),...Array.from(Rl.values())]},Mx=()=>!ri&&!rr?void 0:{...ri,...rr,contexts:[...Array.from(Rl.values())]},xK=()=>!ri&&!rr?void 0:{...ri,...rr,contexts:[...rr?.contexts??[],...Array.from(Sa.values())]},MK=()=>!ri&&!rr?void 0:{...rr,contexts:[...rr?.contexts??[]]};function LK(t){let e={...t};for(let n in e)e[n]===null&&delete e[n];return e}var Lx=async()=>{let t=await Dl();console.log("Resolved settings",JSON.stringify(t,void 0," ")),ee.sendNotification("devicetree/settingsChanged",t),await Al(),He().then(()=>{Ox&&ee.languages.diagnostics.refresh()})};ee.onDidChangeConfiguration(async t=>{t?.settings?.devicetree&&(rr=LK(t.settings.devicetree),console.log("Configuration changed",JSON.stringify(t,void 0," ")),await Lx())});var $x=()=>{let t=Fe?.getContextFiles();Array.from(Nr.keys()).forEach(e=>{t?.some(n=>le(n,et(e)))||ee.sendDiagnostics({uri:e,version:Nr.get(e)?.version,diagnostics:[{severity:tt.DiagnosticSeverity.Warning,range:tt.Range.create(tt.Position.create(0,0),tt.Position.create(0,0)),message:"File not in active context",source:"devicetree"}]})})},r_=async t=>{let e=yg(xe,t);if(e.length)e.forEach(n=>{dp.get(n)?.abort.abort();let r=new AbortController,s=new Promise(i=>{setTimeout(async()=>{if(r.signal.aborted){i();return}let o=performance.now(),a=Fe===n,c=a?qx(n):[];Rx(n),await n.reevaluate(t),Px(n),a&&s_(n).then(l=>{let u=l.items.map(d=>({uri:d.uri,version:d.version??void 0,diagnostics:d.items}));hp(n,c.filter(d=>u.every(f=>f.uri!==d.uri))),u.forEach(d=>{ee.sendDiagnostics(d)})}),i(),console.log("reevaluate",performance.now()-o)},50)});dp.set(n,{abort:r,promise:s})});else{if((await Dl()).allowAdhocContexts===!1)return;await Al(),await an({uri:t})}},$K=t=>Nr.keys().find(e=>le(et(e),t)),fp=t=>{let e=$K(t);if(e)return Nr.get(e)},qx=t=>t.getContextFiles().map(e=>({uri:fe(e),version:fp(e)?.version,diagnostics:[]})),hp=async(t,e=qx(t),n=!1)=>{!n&&t!==Fe||await Promise.all(e.filter(r=>t===Fe||!Fe?.getContextFiles().some(s=>le(et(r.uri),s))).map(r=>ee.sendDiagnostics({uri:r.uri,version:Nr.get(r.uri)?.version,diagnostics:[]})))},s_=async t=>{await t.stable();let e=performance.now(),n=await t.getDiagnostics(),r=t.getContextFiles().map(s=>({uri:fe(s),kind:tt.DocumentDiagnosticReportKind.Full,items:n.get(s)??[],version:fp(s)?.version??null}));return console.log(`(ID: ${t.id})`,"workspace diagnostics",`[${t.ctxNames.join(",")}]`,performance.now()-e),{items:[...r]}},i_=async()=>{let t=await Promise.all(xe.map(Gi));console.log("======== Context List ========"),t.forEach(e=>{console.log(`(ID: ${e.ctx.id}) [${e.ctx.ctxNames.join(",")}]`,`[${e.type}]`,Fe===e.ctx?" [ACTIVE]":"")}),console.log("==============================")},Gi=async t=>{let e=await n_(t),n=!e&&await PK(t);return{ctx:t,type:e?"Ad Hoc":n?"User":"3rd Party"}},an=async(t,e=!1)=>{"uri"in t&&(Ea=t.uri,console.log("Active File Uri",Ea));let n=await Dl();if(await He(),Fe&&!e&&!n.autoChangeContext||!e&&Fe?.getContextFiles().find(i=>"uri"in t&&le(i,t.uri)))return!1;let r=Fe,s=ur(xe,t);return r!==s&&(r&&hp(r),Fe=s,s?(Gi(s).then(async i=>{let o=await s.getFileTree();s!==Fe&&!xe.includes(s)||ee.sendNotification("devicetree/newActiveContext",{ctxNames:s.ctxNames.map(a=>a.toString()),id:s.id,...o,settings:s.settings,active:Fe===s,type:i.type})}),s_(s).then(i=>{i.items.map(o=>({uri:o.uri,version:o.version??void 0,diagnostics:o.items})).forEach(o=>{ee.sendDiagnostics(o)})}),await i_()):ee.sendNotification("devicetree/newActiveContext",void 0)),xx&&ee.languages.foldingRange.refresh(),Ix&&ee.languages.semanticTokens.refresh(),$x(),!0};Nr.listen(ee);Nr.onDidClose(async t=>{let e=et(t.document.uri),n=yg(xe,e);if(n.length===0){Rl.delete(e),ee.sendDiagnostics({uri:t.document.uri,version:Nr.get(t.document.uri)?.version,diagnostics:[]});return}await Promise.all(n.map(async r=>{(r?.getContextFiles()??[]).filter(o=>o!==e).some(o=>fp(o))?Fe?.getContextFiles().some(o=>le(o,e))||ee.sendDiagnostics({uri:t.document.uri,version:Nr.get(t.document.uri)?.version,diagnostics:[]}):await n_(r)?(t_(r),Rl.delete(r.settings.dtsFile)):hp(r)})),OK.delete(t.document.uri)});Nr.onDidOpen(async t=>{await He(),$x();let e=et(t.document.uri),n=ur(xe,{uri:e});if(n)n!==Fe&&await an({id:n.id});else{let r={ctxName:(0,Nx.basename)(e),dtsFile:e};Rl.set(e,r),await r_(e)}});Nr.onDidChangeContent(async t=>{let e=et(t.document.uri),n=t.document.getText(),r=pr();r.needsRenew(e,n)&&(console.log("Content changed"),r.renewLexer(e,n),await r_(e))});ee.listen();ee.languages.diagnostics.onWorkspace(async()=>{await He();let t=Fe;return t?s_(t):{items:[]}});ee.onDidChangeWatchedFiles(t=>{ee.console.log("We received a file change event")});ee.onCompletion(async t=>{await He();let e=et(t.textDocument.uri);an({uri:e});let n=jn(e);return n?[...await oR(t,n),...await gR(t,n)]:[]});ee.onCompletionResolve(t=>t);var jn=t=>{let e=Mx();return ur(xe,{uri:t},Fe,e?.preferredContext)};ee.onDocumentSymbol(async t=>{await He();let e=et(t.textDocument.uri),n=jn(e);return n?n.getUriParser(e)?.getDocumentSymbols(e):[]});ee.onWorkspaceSymbol(async()=>{await He();let t=Fe;return t?(await t.getAllParsers()).flatMap(e=>e.getWorkspaceSymbols()):[]});ee.languages.semanticTokens.on(async t=>{try{await He();let e=et(t.textDocument.uri),n=jn(e),r=new tt.SemanticTokensBuilder,s=n?.isInContext(e);return!n||!s?{data:[]}:((await n.getAllParsers()).forEach(i=>i.buildSemanticTokens(r,e)),r.build())}catch(e){throw console.log(e),e}});ee.onDocumentLinks(async t=>{await He();let e=et(t.textDocument.uri);return jn(e)?.getDocumentLinks(e)});ee.onPrepareRename(async t=>{await He();let e=et(t.textDocument.uri);an({uri:e});let n=jn(e);return fR(t,n)});ee.onRenameRequest(async t=>{await He();let e=et(t.textDocument.uri);an({uri:e});let n=jn(e);return dR(t,n)});ee.onReferences(async t=>{await He();let e=et(t.textDocument.uri);an({uri:e});let n=jn(e);return aR(t,n)});ee.onDefinition(async t=>{await He();let e=et(t.textDocument.uri);an({uri:e});let n=jn(e),r=(await n?.getDocumentLinks(e,t.position))?.filter(s=>s.target).map(s=>tt.Location.create(s.target,s.range))??[];return r.length?r:hR(t,n)});ee.onDeclaration(async t=>{await He();let e=et(t.textDocument.uri);an({uri:e});let n=jn(e);return pR(t,n)});ee.onCodeAction(async t=>mR(t));ee.onDocumentFormatting(async t=>{await He();let e=et(t.textDocument.uri);an({uri:e});let n=jn(e);return n?tN(t,n):[]});ee.onHover(async t=>{await He();let e=et(t.textDocument.uri),n=jn(e);return(await bR(t,n)).at(0)});ee.onFoldingRanges(async t=>{await He();let e=et(t.textDocument.uri),n=jn(e),r=n?.isInContext(e);if(!n||!r)return[];let s=(await n.getAllParsers()).find(i=>i.getFiles().some(o=>o===e));return s?_x(e,s):[]});ee.onTypeDefinition(async t=>{await He();let e=et(t.textDocument.uri);an({uri:e});let n=jn(e);return Sx(t,n)});ee.onRequest("devicetree/getContexts",async()=>(await He(),Promise.all(xe.map(async t=>{let e=await Gi(t);return{ctxNames:t.ctxNames.map(n=>n.toString()),id:t.id,...await t.getFileTree(),settings:t.settings,active:Fe===t,type:e.type}}))));ee.onRequest("devicetree/setActive",async t=>(await He(),console.log("devicetree/setActive",t),await an(t,!0)));ee.onRequest("devicetree/getActiveContext",async t=>{if(await He(),console.log("devicetree/getActiveContext",t),await an({id:t},!0),!Fe)return;let e=await Gi(Fe);return Fe?{ctxNames:Fe.ctxNames.map(n=>n.toString()),id:t,...await Fe.getFileTree(),settings:Fe.settings,active:!0,type:e.type}:void 0});ee.onRequest("devicetree/setDefaultSettings",async t=>{await He(),ri=t,console.log("Integration Settings",t),await Lx()});ee.onRequest("devicetree/requestContext",async t=>{await He();let e=await Dl(),n=await JT(t,e,await Cl());console.log("devicetree/requestContext",n);let r=Zr(n),s=Array.from(Sa).find(([,a])=>a.ctxName===t.ctxName);if(s){let a=s[0].split(":",1)[0];ur(xe,{name:t.ctxName.toString()})?.removeCtxName(t.ctxName),console.log(`Removing integration context with ID ${a} and name ${t.ctxName}`),Sa.delete(s[0])}Sa.set(`${r}:${t.ctxName}`,t),await Al();let i=xe.find(a=>a.id===r);if(!i)throw new Error("Failed to create context");let o=await Gi(i);return{ctxNames:i.ctxNames.map(a=>a.toString()),id:r,...await i.getFileTree(),settings:i.settings,active:!0,type:o.type}});ee.onRequest("devicetree/removeContext",async({id:t,name:e})=>{await He(),Sa.delete(`${t}:${e}`);let n=ur(xe,{id:t});if(n){if(n.removeCtxName(e),n.ctxNames.length){console.log("Context will not be deleted as it is still in use by others");return}await Al()}});ee.onRequest("devicetree/compiledDtsOutput",async t=>(await He(),t?ur(xe,{id:t})?.toFullString():void 0));ee.onRequest("devicetree/serializedContext",async t=>(await He(),t?ur(xe,{id:t})?.serialize():void 0));ee.onRequest("devicetree/customActions",async t=>(await He(),wx(t,Fe)));ee.onRequest("devicetree/activeFileUri",async t=>{await He(),an({uri:t})});