miniscript-languageserver 1.7.8 → 1.8.1

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/index.js +56 -56
  2. package/package.json +6 -6
package/index.js CHANGED
@@ -1,89 +1,89 @@
1
- "use strict";var _p=Object.defineProperty;var fP=Object.getOwnPropertyDescriptor;var pP=Object.getOwnPropertyNames;var gP=Object.prototype.hasOwnProperty;var mP=(t,e)=>()=>(t&&(e=t(t=0)),e);var m=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),yP=(t,e)=>{for(var n in e)_p(t,n,{get:e[n],enumerable:!0})},bP=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of pP(e))!gP.call(t,i)&&i!==n&&_p(t,i,{get:()=>e[i],enumerable:!(r=fP(e,i))||r.enumerable});return t};var _P=t=>bP(_p({},"__esModule",{value:!0}),t);var Ic=m(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.thenable=xt.typedArray=xt.stringArray=xt.array=xt.func=xt.error=xt.number=xt.string=xt.boolean=void 0;function vP(t){return t===!0||t===!1}xt.boolean=vP;function lw(t){return typeof t=="string"||t instanceof String}xt.string=lw;function SP(t){return typeof t=="number"||t instanceof Number}xt.number=SP;function wP(t){return t instanceof Error}xt.error=wP;function hw(t){return typeof t=="function"}xt.func=hw;function dw(t){return Array.isArray(t)}xt.array=dw;function TP(t){return dw(t)&&t.every(e=>lw(e))}xt.stringArray=TP;function EP(t,e){return Array.isArray(t)&&t.every(e)}xt.typedArray=EP;function xP(t){return t&&hw(t.then)}xt.thenable=xP});var to=m(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.stringArray=Jt.array=Jt.func=Jt.error=Jt.number=Jt.string=Jt.boolean=void 0;function kP(t){return t===!0||t===!1}Jt.boolean=kP;function fw(t){return typeof t=="string"||t instanceof String}Jt.string=fw;function AP(t){return typeof t=="number"||t instanceof Number}Jt.number=AP;function CP(t){return t instanceof Error}Jt.error=CP;function OP(t){return typeof t=="function"}Jt.func=OP;function pw(t){return Array.isArray(t)}Jt.array=pw;function RP(t){return pw(t)&&t.every(e=>fw(e))}Jt.stringArray=RP});var Hp=m(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.Message=re.NotificationType9=re.NotificationType8=re.NotificationType7=re.NotificationType6=re.NotificationType5=re.NotificationType4=re.NotificationType3=re.NotificationType2=re.NotificationType1=re.NotificationType0=re.NotificationType=re.RequestType9=re.RequestType8=re.RequestType7=re.RequestType6=re.RequestType5=re.RequestType4=re.RequestType3=re.RequestType2=re.RequestType1=re.RequestType=re.RequestType0=re.AbstractMessageSignature=re.ParameterStructures=re.ResponseError=re.ErrorCodes=void 0;var as=to(),vp;(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})(vp||(re.ErrorCodes=vp={}));var Sp=class t extends Error{constructor(e,n,r){super(n),this.code=as.number(e)?e:vp.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}};re.ResponseError=Sp;var bn=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};re.ParameterStructures=bn;bn.auto=new bn("auto");bn.byPosition=new bn("byPosition");bn.byName=new bn("byName");var Ye=class{constructor(e,n){this.method=e,this.numberOfParams=n}get parameterStructures(){return bn.auto}};re.AbstractMessageSignature=Ye;var wp=class extends Ye{constructor(e){super(e,0)}};re.RequestType0=wp;var Tp=class extends Ye{constructor(e,n=bn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};re.RequestType=Tp;var Ep=class extends Ye{constructor(e,n=bn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};re.RequestType1=Ep;var xp=class extends Ye{constructor(e){super(e,2)}};re.RequestType2=xp;var kp=class extends Ye{constructor(e){super(e,3)}};re.RequestType3=kp;var Ap=class extends Ye{constructor(e){super(e,4)}};re.RequestType4=Ap;var Cp=class extends Ye{constructor(e){super(e,5)}};re.RequestType5=Cp;var Op=class extends Ye{constructor(e){super(e,6)}};re.RequestType6=Op;var Rp=class extends Ye{constructor(e){super(e,7)}};re.RequestType7=Rp;var Pp=class extends Ye{constructor(e){super(e,8)}};re.RequestType8=Pp;var Dp=class extends Ye{constructor(e){super(e,9)}};re.RequestType9=Dp;var Ip=class extends Ye{constructor(e,n=bn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};re.NotificationType=Ip;var Mp=class extends Ye{constructor(e){super(e,0)}};re.NotificationType0=Mp;var Lp=class extends Ye{constructor(e,n=bn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};re.NotificationType1=Lp;var Np=class extends Ye{constructor(e){super(e,2)}};re.NotificationType2=Np;var qp=class extends Ye{constructor(e){super(e,3)}};re.NotificationType3=qp;var jp=class extends Ye{constructor(e){super(e,4)}};re.NotificationType4=jp;var Fp=class extends Ye{constructor(e){super(e,5)}};re.NotificationType5=Fp;var $p=class extends Ye{constructor(e){super(e,6)}};re.NotificationType6=$p;var Bp=class extends Ye{constructor(e){super(e,7)}};re.NotificationType7=Bp;var Up=class extends Ye{constructor(e){super(e,8)}};re.NotificationType8=Up;var Wp=class extends Ye{constructor(e){super(e,9)}};re.NotificationType9=Wp;var gw;(function(t){function e(i){let s=i;return s&&as.string(s.method)&&(as.string(s.id)||as.number(s.id))}t.isRequest=e;function n(i){let s=i;return s&&as.string(s.method)&&i.id===void 0}t.isNotification=n;function r(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&(as.string(s.id)||as.number(s.id)||s.id===null)}t.isResponse=r})(gw||(re.Message=gw={}))});var zp=m(wi=>{"use strict";var mw;Object.defineProperty(wi,"__esModule",{value:!0});wi.LRUCache=wi.LinkedMap=wi.Touch=void 0;var Qt;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Qt||(wi.Touch=Qt={}));var Mc=class{constructor(){this[mw]="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=Qt.None){let r=this._map.get(e);if(r)return n!==Qt.None&&this.touch(r,n),r.value}set(e,n,r=Qt.None){let i=this._map.get(e);if(i)i.value=n,r!==Qt.None&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case Qt.None:this.addItemLast(i);break;case Qt.First:this.addItemFirst(i);break;case Qt.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),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,i=this._head;for(;i;){if(n?e.bind(n)(i.value,i.key,this):e(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.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 i={value:n.key,done:!1};return n=n.next,i}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 i={value:n.value,done:!1};return n=n.next,i}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 i={value:[n.key,n.value],done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}[(mw=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!==Qt.First&&n!==Qt.Last)){if(n===Qt.First){if(e===this._head)return;let r=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===Qt.Last){if(e===this._tail)return;let r=e.next,i=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.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)}};wi.LinkedMap=Mc;var Gp=class extends Mc{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=Qt.AsNew){return super.get(e,n)}peek(e){return super.get(e,Qt.None)}set(e,n){return super.set(e,n,Qt.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};wi.LRUCache=Gp});var bw=m(Lc=>{"use strict";Object.defineProperty(Lc,"__esModule",{value:!0});Lc.Disposable=void 0;var yw;(function(t){function e(n){return{dispose:n}}t.create=e})(yw||(Lc.Disposable=yw={}))});var Ti=m(Xp=>{"use strict";Object.defineProperty(Xp,"__esModule",{value:!0});var Kp;function Vp(){if(Kp===void 0)throw new Error("No runtime abstraction layer installed");return Kp}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");Kp=n}t.install=e})(Vp||(Vp={}));Xp.default=Vp});var ro=m(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.Emitter=no.Event=void 0;var PP=Ti(),_w;(function(t){let e={dispose(){}};t.None=function(){return e}})(_w||(no.Event=_w={}));var Yp=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 i=0,s=this._callbacks.length;i<s;i++)if(this._callbacks[i]===e)if(this._contexts[i]===n){this._callbacks.splice(i,1),this._contexts.splice(i,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),i=this._contexts.slice(0);for(let s=0,o=r.length;s<o;s++)try{n.push(r[s].apply(i[s],e))}catch(a){(0,PP.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Nc=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,n,r)=>{this._callbacks||(this._callbacks=new Yp),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,n);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,n),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};no.Emitter=Nc;Nc._noop=function(){}});var Fc=m(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.CancellationTokenSource=io.CancellationToken=void 0;var DP=Ti(),IP=to(),Jp=ro(),qc;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Jp.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Jp.Event.None});function e(n){let r=n;return r&&(r===t.None||r===t.Cancelled||IP.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(qc||(io.CancellationToken=qc={}));var MP=Object.freeze(function(t,e){let n=(0,DP.default)().timer.setTimeout(t.bind(e),0);return{dispose(){n.dispose()}}}),jc=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?MP:(this._emitter||(this._emitter=new Jp.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Qp=class{get token(){return this._token||(this._token=new jc),this._token}cancel(){this._token?this._token.cancel():this._token=qc.Cancelled}dispose(){this._token?this._token instanceof jc&&this._token.dispose():this._token=qc.None}};io.CancellationTokenSource=Qp});var vw=m(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.SharedArrayReceiverStrategy=so.SharedArraySenderStrategy=void 0;var LP=Fc(),Ca;(function(t){t.Continue=0,t.Cancelled=1})(Ca||(Ca={}));var Zp=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 i=new Int32Array(r,0,1);Atomics.store(i,0,Ca.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};so.SharedArraySenderStrategy=Zp;var eg=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")}},tg=class{constructor(e){this.token=new eg(e)}cancel(){}dispose(){}},ng=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let n=e.$cancellationData;return n===void 0?new LP.CancellationTokenSource:new tg(n)}};so.SharedArrayReceiverStrategy=ng});var ig=m($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0});$c.Semaphore=void 0;var NP=Ti(),rg=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,NP.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()}}};$c.Semaphore=rg});var ww=m(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.ReadableStreamMessageReader=Ei.AbstractMessageReader=Ei.MessageReader=void 0;var og=Ti(),oo=to(),sg=ro(),qP=ig(),Sw;(function(t){function e(n){let r=n;return r&&oo.func(r.listen)&&oo.func(r.dispose)&&oo.func(r.onError)&&oo.func(r.onClose)&&oo.func(r.onPartialMessage)}t.is=e})(Sw||(Ei.MessageReader=Sw={}));var Bc=class{constructor(){this.errorEmitter=new sg.Emitter,this.closeEmitter=new sg.Emitter,this.partialMessageEmitter=new sg.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: ${oo.string(e.message)?e.message:"unknown"}`)}};Ei.AbstractMessageReader=Bc;var ag;(function(t){function e(n){let r,i,s,o=new Map,a,u=new Map;if(n===void 0||typeof n=="string")r=n??"utf-8";else{if(r=n.charset??"utf-8",n.contentDecoder!==void 0&&(s=n.contentDecoder,o.set(s.name,s)),n.contentDecoders!==void 0)for(let c of n.contentDecoders)o.set(c.name,c);if(n.contentTypeDecoder!==void 0&&(a=n.contentTypeDecoder,u.set(a.name,a)),n.contentTypeDecoders!==void 0)for(let c of n.contentTypeDecoders)u.set(c.name,c)}return a===void 0&&(a=(0,og.default)().applicationJson.decoder,u.set(a.name,a)),{charset:r,contentDecoder:s,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:u}}t.fromOptions=e})(ag||(ag={}));var ug=class extends Bc{constructor(e,n){super(),this.readable=e,this.options=ag.fromOptions(n),this.buffer=(0,og.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new qP.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 i=r.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
2
- ${JSON.stringify(Object.fromEntries(r))}`));return}let s=parseInt(i);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=s}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,i=await this.options.contentTypeDecoder.decode(r,this.options);this.callback(i)}).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,og.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))}};Ei.ReadableStreamMessageReader=ug});var Aw=m(xi=>{"use strict";Object.defineProperty(xi,"__esModule",{value:!0});xi.WriteableStreamMessageWriter=xi.AbstractMessageWriter=xi.MessageWriter=void 0;var Tw=Ti(),Oa=to(),jP=ig(),Ew=ro(),FP="Content-Length: ",xw=`\r
3
- `,kw;(function(t){function e(n){let r=n;return r&&Oa.func(r.dispose)&&Oa.func(r.onClose)&&Oa.func(r.onError)&&Oa.func(r.write)}t.is=e})(kw||(xi.MessageWriter=kw={}));var Uc=class{constructor(){this.errorEmitter=new Ew.Emitter,this.closeEmitter=new Ew.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: ${Oa.string(e.message)?e.message:"unknown"}`)}};xi.AbstractMessageWriter=Uc;var cg;(function(t){function e(n){return n===void 0||typeof n=="string"?{charset:n??"utf-8",contentTypeEncoder:(0,Tw.default)().applicationJson.encoder}:{charset:n.charset??"utf-8",contentEncoder:n.contentEncoder,contentTypeEncoder:n.contentTypeEncoder??(0,Tw.default)().applicationJson.encoder}}t.fromOptions=e})(cg||(cg={}));var lg=class extends Uc{constructor(e,n){super(),this.writable=e,this.options=cg.fromOptions(n),this.errorCount=0,this.writeSemaphore=new jP.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 i=[];return i.push(FP,r.byteLength.toString(),xw),i.push(xw),this.doWrite(e,i,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(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){this.writable.end()}};xi.WriteableStreamMessageWriter=lg});var Cw=m(Wc=>{"use strict";Object.defineProperty(Wc,"__esModule",{value:!0});Wc.AbstractMessageBuffer=void 0;var $P=13,BP=10,UP=`\r
4
- `,hg=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,i=0,s=0;e:for(;r<this._chunks.length;){let c=this._chunks[r];for(i=0;i<c.length;){switch(c[i]){case $P:switch(n){case 0:n=1;break;case 2:n=3;break;default:n=0}break;case BP:switch(n){case 1:n=2;break;case 3:n=4,i++;break e;default:n=0}break;default:n=0}i++}s+=c.byteLength,r++}if(n!==4)return;let o=this._read(s+i),a=new Map,u=this.toString(o,"ascii").split(UP);if(u.length<2)return a;for(let c=0;c<u.length-2;c++){let l=u[c],h=l.indexOf(":");if(h===-1)throw new Error(`Message header must separate key and value using ':'
5
- ${l}`);let d=l.substr(0,h),g=l.substr(h+1).trim();a.set(e?d.toLowerCase():d,g)}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 s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],o=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,o}let n=this.allocNative(e),r=0,i=0;for(;e>0;){let s=this._chunks[i];if(s.byteLength>e){let o=s.slice(0,e);n.set(o,r),r+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e}else n.set(s,r),r+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return n}};Wc.AbstractMessageBuffer=hg});var Iw=m(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.createMessageConnection=ye.ConnectionOptions=ye.MessageStrategy=ye.CancellationStrategy=ye.CancellationSenderStrategy=ye.CancellationReceiverStrategy=ye.RequestCancellationReceiverStrategy=ye.IdCancellationReceiverStrategy=ye.ConnectionStrategy=ye.ConnectionError=ye.ConnectionErrors=ye.LogTraceNotification=ye.SetTraceNotification=ye.TraceFormat=ye.TraceValues=ye.Trace=ye.NullLogger=ye.ProgressType=ye.ProgressToken=void 0;var Ow=Ti(),at=to(),le=Hp(),Rw=zp(),Ra=ro(),dg=Fc(),Ia;(function(t){t.type=new le.NotificationType("$/cancelRequest")})(Ia||(Ia={}));var fg;(function(t){function e(n){return typeof n=="string"||typeof n=="number"}t.is=e})(fg||(ye.ProgressToken=fg={}));var Pa;(function(t){t.type=new le.NotificationType("$/progress")})(Pa||(Pa={}));var pg=class{constructor(){}};ye.ProgressType=pg;var gg;(function(t){function e(n){return at.func(n)}t.is=e})(gg||(gg={}));ye.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Le;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(Le||(ye.Trace=Le={}));var Pw;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(Pw||(ye.TraceValues=Pw={}));(function(t){function e(r){if(!at.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})(Le||(ye.Trace=Le={}));var Rn;(function(t){t.Text="text",t.JSON="json"})(Rn||(ye.TraceFormat=Rn={}));(function(t){function e(n){return at.string(n)?(n=n.toLowerCase(),n==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(Rn||(ye.TraceFormat=Rn={}));var mg;(function(t){t.type=new le.NotificationType("$/setTrace")})(mg||(ye.SetTraceNotification=mg={}));var Hc;(function(t){t.type=new le.NotificationType("$/logTrace")})(Hc||(ye.LogTraceNotification=Hc={}));var Da;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(Da||(ye.ConnectionErrors=Da={}));var ao=class t extends Error{constructor(e,n){super(n),this.code=e,Object.setPrototypeOf(this,t.prototype)}};ye.ConnectionError=ao;var yg;(function(t){function e(n){let r=n;return r&&at.func(r.cancelUndispatched)}t.is=e})(yg||(ye.ConnectionStrategy=yg={}));var Gc;(function(t){function e(n){let r=n;return r&&(r.kind===void 0||r.kind==="id")&&at.func(r.createCancellationTokenSource)&&(r.dispose===void 0||at.func(r.dispose))}t.is=e})(Gc||(ye.IdCancellationReceiverStrategy=Gc={}));var bg;(function(t){function e(n){let r=n;return r&&r.kind==="request"&&at.func(r.createCancellationTokenSource)&&(r.dispose===void 0||at.func(r.dispose))}t.is=e})(bg||(ye.RequestCancellationReceiverStrategy=bg={}));var zc;(function(t){t.Message=Object.freeze({createCancellationTokenSource(n){return new dg.CancellationTokenSource}});function e(n){return Gc.is(n)||bg.is(n)}t.is=e})(zc||(ye.CancellationReceiverStrategy=zc={}));var Kc;(function(t){t.Message=Object.freeze({sendCancellation(n,r){return n.sendNotification(Ia.type,{id:r})},cleanup(n){}});function e(n){let r=n;return r&&at.func(r.sendCancellation)&&at.func(r.cleanup)}t.is=e})(Kc||(ye.CancellationSenderStrategy=Kc={}));var Vc;(function(t){t.Message=Object.freeze({receiver:zc.Message,sender:Kc.Message});function e(n){let r=n;return r&&zc.is(r.receiver)&&Kc.is(r.sender)}t.is=e})(Vc||(ye.CancellationStrategy=Vc={}));var Xc;(function(t){function e(n){let r=n;return r&&at.func(r.handleMessage)}t.is=e})(Xc||(ye.MessageStrategy=Xc={}));var Dw;(function(t){function e(n){let r=n;return r&&(Vc.is(r.cancellationStrategy)||yg.is(r.connectionStrategy)||Xc.is(r.messageStrategy))}t.is=e})(Dw||(ye.ConnectionOptions=Dw={}));var pr;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(pr||(pr={}));function WP(t,e,n,r){let i=n!==void 0?n:ye.NullLogger,s=0,o=0,a=0,u="2.0",c,l=new Map,h,d=new Map,g=new Map,y,_=new Rw.LinkedMap,C=new Map,k=new Set,T=new Map,w=Le.Off,v=Rn.Text,L,R=pr.New,U=new Ra.Emitter,te=new Ra.Emitter,se=new Ra.Emitter,W=new Ra.Emitter,O=new Ra.Emitter,M=r&&r.cancellationStrategy?r.cancellationStrategy:Vc.Message;function N(E){if(E===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+E.toString()}function j(E){return E===null?"res-unknown-"+(++a).toString():"res-"+E.toString()}function fe(){return"not-"+(++o).toString()}function he(E,F){le.Message.isRequest(F)?E.set(N(F.id),F):le.Message.isResponse(F)?E.set(j(F.id),F):E.set(fe(),F)}function Nt(E){}function bt(){return R===pr.Listening}function $e(){return R===pr.Closed}function yn(){return R===pr.Disposed}function Ys(){(R===pr.New||R===pr.Listening)&&(R=pr.Closed,te.fire(void 0))}function ss(E){U.fire([E,void 0,void 0])}function _c(E){U.fire(E)}t.onClose(Ys),t.onError(ss),e.onClose(Ys),e.onError(_c);function Ta(){y||_.size===0||(y=(0,Ow.default)().timer.setImmediate(()=>{y=void 0,vc()}))}function Ea(E){le.Message.isRequest(E)?wc(E):le.Message.isNotification(E)?Ec(E):le.Message.isResponse(E)?Tc(E):Js(E)}function vc(){if(_.size===0)return;let E=_.shift();try{let F=r?.messageStrategy;Xc.is(F)?F.handleMessage(E,Ea):Ea(E)}finally{Ta()}}let Sc=E=>{try{if(le.Message.isNotification(E)&&E.method===Ia.type.method){let F=E.params.id,G=N(F),Q=_.get(G);if(le.Message.isRequest(Q)){let Ne=r?.connectionStrategy,Xe=Ne&&Ne.cancelUndispatched?Ne.cancelUndispatched(Q,Nt):void 0;if(Xe&&(Xe.error!==void 0||Xe.result!==void 0)){_.delete(G),T.delete(F),Xe.id=Q.id,os(Xe,E.method,Date.now()),e.write(Xe).catch(()=>i.error("Sending response for canceled message failed."));return}}let He=T.get(F);if(He!==void 0){He.cancel(),Qs(E);return}else k.add(F)}he(_,E)}finally{Ta()}};function wc(E){if(yn())return;function F(we,Ge,De){let lt={jsonrpc:u,id:E.id};we instanceof le.ResponseError?lt.error=we.toJson():lt.result=we===void 0?null:we,os(lt,Ge,De),e.write(lt).catch(()=>i.error("Sending response failed."))}function G(we,Ge,De){let lt={jsonrpc:u,id:E.id,error:we.toJson()};os(lt,Ge,De),e.write(lt).catch(()=>i.error("Sending response failed."))}function Q(we,Ge,De){we===void 0&&(we=null);let lt={jsonrpc:u,id:E.id,result:we};os(lt,Ge,De),e.write(lt).catch(()=>i.error("Sending response failed."))}Ac(E);let He=l.get(E.method),Ne,Xe;He&&(Ne=He.type,Xe=He.handler);let tt=Date.now();if(Xe||c){let we=E.id??String(Date.now()),Ge=Gc.is(M.receiver)?M.receiver.createCancellationTokenSource(we):M.receiver.createCancellationTokenSource(E);E.id!==null&&k.has(E.id)&&Ge.cancel(),E.id!==null&&T.set(we,Ge);try{let De;if(Xe)if(E.params===void 0){if(Ne!==void 0&&Ne.numberOfParams!==0){G(new le.ResponseError(le.ErrorCodes.InvalidParams,`Request ${E.method} defines ${Ne.numberOfParams} params but received none.`),E.method,tt);return}De=Xe(Ge.token)}else if(Array.isArray(E.params)){if(Ne!==void 0&&Ne.parameterStructures===le.ParameterStructures.byName){G(new le.ResponseError(le.ErrorCodes.InvalidParams,`Request ${E.method} defines parameters by name but received parameters by position`),E.method,tt);return}De=Xe(...E.params,Ge.token)}else{if(Ne!==void 0&&Ne.parameterStructures===le.ParameterStructures.byPosition){G(new le.ResponseError(le.ErrorCodes.InvalidParams,`Request ${E.method} defines parameters by position but received parameters by name`),E.method,tt);return}De=Xe(E.params,Ge.token)}else c&&(De=c(E.method,E.params,Ge.token));let lt=De;De?lt.then?lt.then(qt=>{T.delete(we),F(qt,E.method,tt)},qt=>{T.delete(we),qt instanceof le.ResponseError?G(qt,E.method,tt):qt&&at.string(qt.message)?G(new le.ResponseError(le.ErrorCodes.InternalError,`Request ${E.method} failed with message: ${qt.message}`),E.method,tt):G(new le.ResponseError(le.ErrorCodes.InternalError,`Request ${E.method} failed unexpectedly without providing any details.`),E.method,tt)}):(T.delete(we),F(De,E.method,tt)):(T.delete(we),Q(De,E.method,tt))}catch(De){T.delete(we),De instanceof le.ResponseError?F(De,E.method,tt):De&&at.string(De.message)?G(new le.ResponseError(le.ErrorCodes.InternalError,`Request ${E.method} failed with message: ${De.message}`),E.method,tt):G(new le.ResponseError(le.ErrorCodes.InternalError,`Request ${E.method} failed unexpectedly without providing any details.`),E.method,tt)}}else G(new le.ResponseError(le.ErrorCodes.MethodNotFound,`Unhandled method ${E.method}`),E.method,tt)}function Tc(E){if(!yn())if(E.id===null)E.error?i.error(`Received response message without id: Error is:
6
- ${JSON.stringify(E.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let F=E.id,G=C.get(F);if(Cc(E,G),G!==void 0){C.delete(F);try{if(E.error){let Q=E.error;G.reject(new le.ResponseError(Q.code,Q.message,Q.data))}else if(E.result!==void 0)G.resolve(E.result);else throw new Error("Should never happen.")}catch(Q){Q.message?i.error(`Response handler '${G.method}' failed with message: ${Q.message}`):i.error(`Response handler '${G.method}' failed unexpectedly.`)}}}}function Ec(E){if(yn())return;let F,G;if(E.method===Ia.type.method){let Q=E.params.id;k.delete(Q),Qs(E);return}else{let Q=d.get(E.method);Q&&(G=Q.handler,F=Q.type)}if(G||h)try{if(Qs(E),G)if(E.params===void 0)F!==void 0&&F.numberOfParams!==0&&F.parameterStructures!==le.ParameterStructures.byName&&i.error(`Notification ${E.method} defines ${F.numberOfParams} params but received none.`),G();else if(Array.isArray(E.params)){let Q=E.params;E.method===Pa.type.method&&Q.length===2&&fg.is(Q[0])?G({token:Q[0],value:Q[1]}):(F!==void 0&&(F.parameterStructures===le.ParameterStructures.byName&&i.error(`Notification ${E.method} defines parameters by name but received parameters by position`),F.numberOfParams!==E.params.length&&i.error(`Notification ${E.method} defines ${F.numberOfParams} params but received ${Q.length} arguments`)),G(...Q))}else F!==void 0&&F.parameterStructures===le.ParameterStructures.byPosition&&i.error(`Notification ${E.method} defines parameters by position but received parameters by name`),G(E.params);else h&&h(E.method,E.params)}catch(Q){Q.message?i.error(`Notification handler '${E.method}' failed with message: ${Q.message}`):i.error(`Notification handler '${E.method}' failed unexpectedly.`)}else se.fire(E)}function Js(E){if(!E){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
7
- ${JSON.stringify(E,null,4)}`);let F=E;if(at.string(F.id)||at.number(F.id)){let G=F.id,Q=C.get(G);Q&&Q.reject(new Error("The received response has neither a result nor an error property."))}}function hr(E){if(E!=null)switch(w){case Le.Verbose:return JSON.stringify(E,null,4);case Le.Compact:return JSON.stringify(E);default:return}}function xc(E){if(!(w===Le.Off||!L))if(v===Rn.Text){let F;(w===Le.Verbose||w===Le.Compact)&&E.params&&(F=`Params: ${hr(E.params)}
1
+ "use strict";var Ap=Object.defineProperty;var AP=Object.getOwnPropertyDescriptor;var CP=Object.getOwnPropertyNames;var OP=Object.prototype.hasOwnProperty;var RP=(t,e)=>()=>(t&&(e=t(t=0)),e);var m=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),PP=(t,e)=>{for(var n in e)Ap(t,n,{get:e[n],enumerable:!0})},DP=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of CP(e))!OP.call(t,i)&&i!==n&&Ap(t,i,{get:()=>e[i],enumerable:!(r=AP(e,i))||r.enumerable});return t};var IP=t=>DP(Ap({},"__esModule",{value:!0}),t);var jc=m(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.thenable=At.typedArray=At.stringArray=At.array=At.func=At.error=At.number=At.string=At.boolean=void 0;function MP(t){return t===!0||t===!1}At.boolean=MP;function Tw(t){return typeof t=="string"||t instanceof String}At.string=Tw;function LP(t){return typeof t=="number"||t instanceof Number}At.number=LP;function NP(t){return t instanceof Error}At.error=NP;function Ew(t){return typeof t=="function"}At.func=Ew;function xw(t){return Array.isArray(t)}At.array=xw;function qP(t){return xw(t)&&t.every(e=>Tw(e))}At.stringArray=qP;function jP(t,e){return Array.isArray(t)&&t.every(e)}At.typedArray=jP;function FP(t){return t&&Ew(t.then)}At.thenable=FP});var io=m(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.stringArray=Zt.array=Zt.func=Zt.error=Zt.number=Zt.string=Zt.boolean=void 0;function $P(t){return t===!0||t===!1}Zt.boolean=$P;function kw(t){return typeof t=="string"||t instanceof String}Zt.string=kw;function BP(t){return typeof t=="number"||t instanceof Number}Zt.number=BP;function WP(t){return t instanceof Error}Zt.error=WP;function UP(t){return typeof t=="function"}Zt.func=UP;function Aw(t){return Array.isArray(t)}Zt.array=Aw;function HP(t){return Aw(t)&&t.every(e=>kw(e))}Zt.stringArray=HP});var Qp=m(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.Message=ie.NotificationType9=ie.NotificationType8=ie.NotificationType7=ie.NotificationType6=ie.NotificationType5=ie.NotificationType4=ie.NotificationType3=ie.NotificationType2=ie.NotificationType1=ie.NotificationType0=ie.NotificationType=ie.RequestType9=ie.RequestType8=ie.RequestType7=ie.RequestType6=ie.RequestType5=ie.RequestType4=ie.RequestType3=ie.RequestType2=ie.RequestType1=ie.RequestType=ie.RequestType0=ie.AbstractMessageSignature=ie.ParameterStructures=ie.ResponseError=ie.ErrorCodes=void 0;var ds=io(),Cp;(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})(Cp||(ie.ErrorCodes=Cp={}));var Op=class t extends Error{constructor(e,n,r){super(n),this.code=ds.number(e)?e:Cp.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}};ie.ResponseError=Op;var vn=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};ie.ParameterStructures=vn;vn.auto=new vn("auto");vn.byPosition=new vn("byPosition");vn.byName=new vn("byName");var Ye=class{constructor(e,n){this.method=e,this.numberOfParams=n}get parameterStructures(){return vn.auto}};ie.AbstractMessageSignature=Ye;var Rp=class extends Ye{constructor(e){super(e,0)}};ie.RequestType0=Rp;var Pp=class extends Ye{constructor(e,n=vn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ie.RequestType=Pp;var Dp=class extends Ye{constructor(e,n=vn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ie.RequestType1=Dp;var Ip=class extends Ye{constructor(e){super(e,2)}};ie.RequestType2=Ip;var Mp=class extends Ye{constructor(e){super(e,3)}};ie.RequestType3=Mp;var Lp=class extends Ye{constructor(e){super(e,4)}};ie.RequestType4=Lp;var Np=class extends Ye{constructor(e){super(e,5)}};ie.RequestType5=Np;var qp=class extends Ye{constructor(e){super(e,6)}};ie.RequestType6=qp;var jp=class extends Ye{constructor(e){super(e,7)}};ie.RequestType7=jp;var Fp=class extends Ye{constructor(e){super(e,8)}};ie.RequestType8=Fp;var $p=class extends Ye{constructor(e){super(e,9)}};ie.RequestType9=$p;var Bp=class extends Ye{constructor(e,n=vn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ie.NotificationType=Bp;var Wp=class extends Ye{constructor(e){super(e,0)}};ie.NotificationType0=Wp;var Up=class extends Ye{constructor(e,n=vn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};ie.NotificationType1=Up;var Hp=class extends Ye{constructor(e){super(e,2)}};ie.NotificationType2=Hp;var Gp=class extends Ye{constructor(e){super(e,3)}};ie.NotificationType3=Gp;var zp=class extends Ye{constructor(e){super(e,4)}};ie.NotificationType4=zp;var Kp=class extends Ye{constructor(e){super(e,5)}};ie.NotificationType5=Kp;var Vp=class extends Ye{constructor(e){super(e,6)}};ie.NotificationType6=Vp;var Xp=class extends Ye{constructor(e){super(e,7)}};ie.NotificationType7=Xp;var Yp=class extends Ye{constructor(e){super(e,8)}};ie.NotificationType8=Yp;var Jp=class extends Ye{constructor(e){super(e,9)}};ie.NotificationType9=Jp;var Cw;(function(t){function e(i){let s=i;return s&&ds.string(s.method)&&(ds.string(s.id)||ds.number(s.id))}t.isRequest=e;function n(i){let s=i;return s&&ds.string(s.method)&&i.id===void 0}t.isNotification=n;function r(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&(ds.string(s.id)||ds.number(s.id)||s.id===null)}t.isResponse=r})(Cw||(ie.Message=Cw={}))});var eg=m(ki=>{"use strict";var Ow;Object.defineProperty(ki,"__esModule",{value:!0});ki.LRUCache=ki.LinkedMap=ki.Touch=void 0;var en;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(en||(ki.Touch=en={}));var Fc=class{constructor(){this[Ow]="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=en.None){let r=this._map.get(e);if(r)return n!==en.None&&this.touch(r,n),r.value}set(e,n,r=en.None){let i=this._map.get(e);if(i)i.value=n,r!==en.None&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case en.None:this.addItemLast(i);break;case en.First:this.addItemFirst(i);break;case en.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),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,i=this._head;for(;i;){if(n?e.bind(n)(i.value,i.key,this):e(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.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 i={value:n.key,done:!1};return n=n.next,i}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 i={value:n.value,done:!1};return n=n.next,i}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 i={value:[n.key,n.value],done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}[(Ow=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!==en.First&&n!==en.Last)){if(n===en.First){if(e===this._head)return;let r=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===en.Last){if(e===this._tail)return;let r=e.next,i=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.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)}};ki.LinkedMap=Fc;var Zp=class extends Fc{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=en.AsNew){return super.get(e,n)}peek(e){return super.get(e,en.None)}set(e,n){return super.set(e,n,en.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};ki.LRUCache=Zp});var Pw=m($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0});$c.Disposable=void 0;var Rw;(function(t){function e(n){return{dispose:n}}t.create=e})(Rw||($c.Disposable=Rw={}))});var Ai=m(rg=>{"use strict";Object.defineProperty(rg,"__esModule",{value:!0});var tg;function ng(){if(tg===void 0)throw new Error("No runtime abstraction layer installed");return tg}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");tg=n}t.install=e})(ng||(ng={}));rg.default=ng});var oo=m(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.Emitter=so.Event=void 0;var GP=Ai(),Dw;(function(t){let e={dispose(){}};t.None=function(){return e}})(Dw||(so.Event=Dw={}));var ig=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 i=0,s=this._callbacks.length;i<s;i++)if(this._callbacks[i]===e)if(this._contexts[i]===n){this._callbacks.splice(i,1),this._contexts.splice(i,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),i=this._contexts.slice(0);for(let s=0,o=r.length;s<o;s++)try{n.push(r[s].apply(i[s],e))}catch(a){(0,GP.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Bc=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,n,r)=>{this._callbacks||(this._callbacks=new ig),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,n);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,n),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};so.Emitter=Bc;Bc._noop=function(){}});var Hc=m(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.CancellationTokenSource=ao.CancellationToken=void 0;var zP=Ai(),KP=io(),sg=oo(),Wc;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:sg.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:sg.Event.None});function e(n){let r=n;return r&&(r===t.None||r===t.Cancelled||KP.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(Wc||(ao.CancellationToken=Wc={}));var VP=Object.freeze(function(t,e){let n=(0,zP.default)().timer.setTimeout(t.bind(e),0);return{dispose(){n.dispose()}}}),Uc=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?VP:(this._emitter||(this._emitter=new sg.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},og=class{get token(){return this._token||(this._token=new Uc),this._token}cancel(){this._token?this._token.cancel():this._token=Wc.Cancelled}dispose(){this._token?this._token instanceof Uc&&this._token.dispose():this._token=Wc.None}};ao.CancellationTokenSource=og});var Iw=m(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.SharedArrayReceiverStrategy=uo.SharedArraySenderStrategy=void 0;var XP=Hc(),Oa;(function(t){t.Continue=0,t.Cancelled=1})(Oa||(Oa={}));var ag=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]=Oa.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 i=new Int32Array(r,0,1);Atomics.store(i,0,Oa.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};uo.SharedArraySenderStrategy=ag;var ug=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Oa.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},cg=class{constructor(e){this.token=new ug(e)}cancel(){}dispose(){}},lg=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let n=e.$cancellationData;return n===void 0?new XP.CancellationTokenSource:new cg(n)}};uo.SharedArrayReceiverStrategy=lg});var dg=m(Gc=>{"use strict";Object.defineProperty(Gc,"__esModule",{value:!0});Gc.Semaphore=void 0;var YP=Ai(),hg=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,YP.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()}}};Gc.Semaphore=hg});var Lw=m(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.ReadableStreamMessageReader=Ci.AbstractMessageReader=Ci.MessageReader=void 0;var pg=Ai(),co=io(),fg=oo(),JP=dg(),Mw;(function(t){function e(n){let r=n;return r&&co.func(r.listen)&&co.func(r.dispose)&&co.func(r.onError)&&co.func(r.onClose)&&co.func(r.onPartialMessage)}t.is=e})(Mw||(Ci.MessageReader=Mw={}));var zc=class{constructor(){this.errorEmitter=new fg.Emitter,this.closeEmitter=new fg.Emitter,this.partialMessageEmitter=new fg.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: ${co.string(e.message)?e.message:"unknown"}`)}};Ci.AbstractMessageReader=zc;var gg;(function(t){function e(n){let r,i,s,o=new Map,a,u=new Map;if(n===void 0||typeof n=="string")r=n??"utf-8";else{if(r=n.charset??"utf-8",n.contentDecoder!==void 0&&(s=n.contentDecoder,o.set(s.name,s)),n.contentDecoders!==void 0)for(let c of n.contentDecoders)o.set(c.name,c);if(n.contentTypeDecoder!==void 0&&(a=n.contentTypeDecoder,u.set(a.name,a)),n.contentTypeDecoders!==void 0)for(let c of n.contentTypeDecoders)u.set(c.name,c)}return a===void 0&&(a=(0,pg.default)().applicationJson.decoder,u.set(a.name,a)),{charset:r,contentDecoder:s,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:u}}t.fromOptions=e})(gg||(gg={}));var mg=class extends zc{constructor(e,n){super(),this.readable=e,this.options=gg.fromOptions(n),this.buffer=(0,pg.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new JP.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 i=r.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
2
+ ${JSON.stringify(Object.fromEntries(r))}`));return}let s=parseInt(i);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=s}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,i=await this.options.contentTypeDecoder.decode(r,this.options);this.callback(i)}).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,pg.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))}};Ci.ReadableStreamMessageReader=mg});var $w=m(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.WriteableStreamMessageWriter=Oi.AbstractMessageWriter=Oi.MessageWriter=void 0;var Nw=Ai(),Ra=io(),QP=dg(),qw=oo(),ZP="Content-Length: ",jw=`\r
3
+ `,Fw;(function(t){function e(n){let r=n;return r&&Ra.func(r.dispose)&&Ra.func(r.onClose)&&Ra.func(r.onError)&&Ra.func(r.write)}t.is=e})(Fw||(Oi.MessageWriter=Fw={}));var Kc=class{constructor(){this.errorEmitter=new qw.Emitter,this.closeEmitter=new qw.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: ${Ra.string(e.message)?e.message:"unknown"}`)}};Oi.AbstractMessageWriter=Kc;var yg;(function(t){function e(n){return n===void 0||typeof n=="string"?{charset:n??"utf-8",contentTypeEncoder:(0,Nw.default)().applicationJson.encoder}:{charset:n.charset??"utf-8",contentEncoder:n.contentEncoder,contentTypeEncoder:n.contentTypeEncoder??(0,Nw.default)().applicationJson.encoder}}t.fromOptions=e})(yg||(yg={}));var bg=class extends Kc{constructor(e,n){super(),this.writable=e,this.options=yg.fromOptions(n),this.errorCount=0,this.writeSemaphore=new QP.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 i=[];return i.push(ZP,r.byteLength.toString(),jw),i.push(jw),this.doWrite(e,i,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(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,n){this.errorCount++,this.fireError(e,n,this.errorCount)}end(){this.writable.end()}};Oi.WriteableStreamMessageWriter=bg});var Bw=m(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});Vc.AbstractMessageBuffer=void 0;var eD=13,tD=10,nD=`\r
4
+ `,_g=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,i=0,s=0;e:for(;r<this._chunks.length;){let c=this._chunks[r];for(i=0;i<c.length;){switch(c[i]){case eD:switch(n){case 0:n=1;break;case 2:n=3;break;default:n=0}break;case tD:switch(n){case 1:n=2;break;case 3:n=4,i++;break e;default:n=0}break;default:n=0}i++}s+=c.byteLength,r++}if(n!==4)return;let o=this._read(s+i),a=new Map,u=this.toString(o,"ascii").split(nD);if(u.length<2)return a;for(let c=0;c<u.length-2;c++){let l=u[c],h=l.indexOf(":");if(h===-1)throw new Error(`Message header must separate key and value using ':'
5
+ ${l}`);let d=l.substr(0,h),g=l.substr(h+1).trim();a.set(e?d.toLowerCase():d,g)}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 s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],o=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,o}let n=this.allocNative(e),r=0,i=0;for(;e>0;){let s=this._chunks[i];if(s.byteLength>e){let o=s.slice(0,e);n.set(o,r),r+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e}else n.set(s,r),r+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return n}};Vc.AbstractMessageBuffer=_g});var zw=m(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.createMessageConnection=ye.ConnectionOptions=ye.MessageStrategy=ye.CancellationStrategy=ye.CancellationSenderStrategy=ye.CancellationReceiverStrategy=ye.RequestCancellationReceiverStrategy=ye.IdCancellationReceiverStrategy=ye.ConnectionStrategy=ye.ConnectionError=ye.ConnectionErrors=ye.LogTraceNotification=ye.SetTraceNotification=ye.TraceFormat=ye.TraceValues=ye.Trace=ye.NullLogger=ye.ProgressType=ye.ProgressToken=void 0;var Ww=Ai(),ut=io(),le=Qp(),Uw=eg(),Pa=oo(),vg=Hc(),Ma;(function(t){t.type=new le.NotificationType("$/cancelRequest")})(Ma||(Ma={}));var Sg;(function(t){function e(n){return typeof n=="string"||typeof n=="number"}t.is=e})(Sg||(ye.ProgressToken=Sg={}));var Da;(function(t){t.type=new le.NotificationType("$/progress")})(Da||(Da={}));var wg=class{constructor(){}};ye.ProgressType=wg;var Tg;(function(t){function e(n){return ut.func(n)}t.is=e})(Tg||(Tg={}));ye.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Ne;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(Ne||(ye.Trace=Ne={}));var Hw;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(Hw||(ye.TraceValues=Hw={}));(function(t){function e(r){if(!ut.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})(Ne||(ye.Trace=Ne={}));var On;(function(t){t.Text="text",t.JSON="json"})(On||(ye.TraceFormat=On={}));(function(t){function e(n){return ut.string(n)?(n=n.toLowerCase(),n==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(On||(ye.TraceFormat=On={}));var Eg;(function(t){t.type=new le.NotificationType("$/setTrace")})(Eg||(ye.SetTraceNotification=Eg={}));var Xc;(function(t){t.type=new le.NotificationType("$/logTrace")})(Xc||(ye.LogTraceNotification=Xc={}));var Ia;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(Ia||(ye.ConnectionErrors=Ia={}));var lo=class t extends Error{constructor(e,n){super(n),this.code=e,Object.setPrototypeOf(this,t.prototype)}};ye.ConnectionError=lo;var xg;(function(t){function e(n){let r=n;return r&&ut.func(r.cancelUndispatched)}t.is=e})(xg||(ye.ConnectionStrategy=xg={}));var Yc;(function(t){function e(n){let r=n;return r&&(r.kind===void 0||r.kind==="id")&&ut.func(r.createCancellationTokenSource)&&(r.dispose===void 0||ut.func(r.dispose))}t.is=e})(Yc||(ye.IdCancellationReceiverStrategy=Yc={}));var kg;(function(t){function e(n){let r=n;return r&&r.kind==="request"&&ut.func(r.createCancellationTokenSource)&&(r.dispose===void 0||ut.func(r.dispose))}t.is=e})(kg||(ye.RequestCancellationReceiverStrategy=kg={}));var Jc;(function(t){t.Message=Object.freeze({createCancellationTokenSource(n){return new vg.CancellationTokenSource}});function e(n){return Yc.is(n)||kg.is(n)}t.is=e})(Jc||(ye.CancellationReceiverStrategy=Jc={}));var Qc;(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&&ut.func(r.sendCancellation)&&ut.func(r.cleanup)}t.is=e})(Qc||(ye.CancellationSenderStrategy=Qc={}));var Zc;(function(t){t.Message=Object.freeze({receiver:Jc.Message,sender:Qc.Message});function e(n){let r=n;return r&&Jc.is(r.receiver)&&Qc.is(r.sender)}t.is=e})(Zc||(ye.CancellationStrategy=Zc={}));var el;(function(t){function e(n){let r=n;return r&&ut.func(r.handleMessage)}t.is=e})(el||(ye.MessageStrategy=el={}));var Gw;(function(t){function e(n){let r=n;return r&&(Zc.is(r.cancellationStrategy)||xg.is(r.connectionStrategy)||el.is(r.messageStrategy))}t.is=e})(Gw||(ye.ConnectionOptions=Gw={}));var mr;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(mr||(mr={}));function rD(t,e,n,r){let i=n!==void 0?n:ye.NullLogger,s=0,o=0,a=0,u="2.0",c,l=new Map,h,d=new Map,g=new Map,y,_=new Uw.LinkedMap,C=new Map,k=new Set,T=new Map,w=Ne.Off,v=On.Text,L,R=mr.New,W=new Pa.Emitter,ne=new Pa.Emitter,se=new Pa.Emitter,U=new Pa.Emitter,O=new Pa.Emitter,M=r&&r.cancellationStrategy?r.cancellationStrategy:Zc.Message;function N(E){if(E===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+E.toString()}function j(E){return E===null?"res-unknown-"+(++a).toString():"res-"+E.toString()}function fe(){return"not-"+(++o).toString()}function he(E,F){le.Message.isRequest(F)?E.set(N(F.id),F):le.Message.isResponse(F)?E.set(j(F.id),F):E.set(fe(),F)}function jt(E){}function _t(){return R===mr.Listening}function $e(){return R===mr.Closed}function _n(){return R===mr.Disposed}function Zs(){(R===mr.New||R===mr.Listening)&&(R=mr.Closed,ne.fire(void 0))}function ls(E){W.fire([E,void 0,void 0])}function Ec(E){W.fire(E)}t.onClose(Zs),t.onError(ls),e.onClose(Zs),e.onError(Ec);function Ea(){y||_.size===0||(y=(0,Ww.default)().timer.setImmediate(()=>{y=void 0,xc()}))}function xa(E){le.Message.isRequest(E)?Ac(E):le.Message.isNotification(E)?Oc(E):le.Message.isResponse(E)?Cc(E):eo(E)}function xc(){if(_.size===0)return;let E=_.shift();try{let F=r?.messageStrategy;el.is(F)?F.handleMessage(E,xa):xa(E)}finally{Ea()}}let kc=E=>{try{if(le.Message.isNotification(E)&&E.method===Ma.type.method){let F=E.params.id,G=N(F),Q=_.get(G);if(le.Message.isRequest(Q)){let qe=r?.connectionStrategy,Xe=qe&&qe.cancelUndispatched?qe.cancelUndispatched(Q,jt):void 0;if(Xe&&(Xe.error!==void 0||Xe.result!==void 0)){_.delete(G),T.delete(F),Xe.id=Q.id,hs(Xe,E.method,Date.now()),e.write(Xe).catch(()=>i.error("Sending response for canceled message failed."));return}}let He=T.get(F);if(He!==void 0){He.cancel(),to(E);return}else k.add(F)}he(_,E)}finally{Ea()}};function Ac(E){if(_n())return;function F(xe,Ge,Ie){let ht={jsonrpc:u,id:E.id};xe instanceof le.ResponseError?ht.error=xe.toJson():ht.result=xe===void 0?null:xe,hs(ht,Ge,Ie),e.write(ht).catch(()=>i.error("Sending response failed."))}function G(xe,Ge,Ie){let ht={jsonrpc:u,id:E.id,error:xe.toJson()};hs(ht,Ge,Ie),e.write(ht).catch(()=>i.error("Sending response failed."))}function Q(xe,Ge,Ie){xe===void 0&&(xe=null);let ht={jsonrpc:u,id:E.id,result:xe};hs(ht,Ge,Ie),e.write(ht).catch(()=>i.error("Sending response failed."))}Dc(E);let He=l.get(E.method),qe,Xe;He&&(qe=He.type,Xe=He.handler);let tt=Date.now();if(Xe||c){let xe=E.id??String(Date.now()),Ge=Yc.is(M.receiver)?M.receiver.createCancellationTokenSource(xe):M.receiver.createCancellationTokenSource(E);E.id!==null&&k.has(E.id)&&Ge.cancel(),E.id!==null&&T.set(xe,Ge);try{let Ie;if(Xe)if(E.params===void 0){if(qe!==void 0&&qe.numberOfParams!==0){G(new le.ResponseError(le.ErrorCodes.InvalidParams,`Request ${E.method} defines ${qe.numberOfParams} params but received none.`),E.method,tt);return}Ie=Xe(Ge.token)}else if(Array.isArray(E.params)){if(qe!==void 0&&qe.parameterStructures===le.ParameterStructures.byName){G(new le.ResponseError(le.ErrorCodes.InvalidParams,`Request ${E.method} defines parameters by name but received parameters by position`),E.method,tt);return}Ie=Xe(...E.params,Ge.token)}else{if(qe!==void 0&&qe.parameterStructures===le.ParameterStructures.byPosition){G(new le.ResponseError(le.ErrorCodes.InvalidParams,`Request ${E.method} defines parameters by position but received parameters by name`),E.method,tt);return}Ie=Xe(E.params,Ge.token)}else c&&(Ie=c(E.method,E.params,Ge.token));let ht=Ie;Ie?ht.then?ht.then(Ft=>{T.delete(xe),F(Ft,E.method,tt)},Ft=>{T.delete(xe),Ft instanceof le.ResponseError?G(Ft,E.method,tt):Ft&&ut.string(Ft.message)?G(new le.ResponseError(le.ErrorCodes.InternalError,`Request ${E.method} failed with message: ${Ft.message}`),E.method,tt):G(new le.ResponseError(le.ErrorCodes.InternalError,`Request ${E.method} failed unexpectedly without providing any details.`),E.method,tt)}):(T.delete(xe),F(Ie,E.method,tt)):(T.delete(xe),Q(Ie,E.method,tt))}catch(Ie){T.delete(xe),Ie instanceof le.ResponseError?F(Ie,E.method,tt):Ie&&ut.string(Ie.message)?G(new le.ResponseError(le.ErrorCodes.InternalError,`Request ${E.method} failed with message: ${Ie.message}`),E.method,tt):G(new le.ResponseError(le.ErrorCodes.InternalError,`Request ${E.method} failed unexpectedly without providing any details.`),E.method,tt)}}else G(new le.ResponseError(le.ErrorCodes.MethodNotFound,`Unhandled method ${E.method}`),E.method,tt)}function Cc(E){if(!_n())if(E.id===null)E.error?i.error(`Received response message without id: Error is:
6
+ ${JSON.stringify(E.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let F=E.id,G=C.get(F);if(Ic(E,G),G!==void 0){C.delete(F);try{if(E.error){let Q=E.error;G.reject(new le.ResponseError(Q.code,Q.message,Q.data))}else if(E.result!==void 0)G.resolve(E.result);else throw new Error("Should never happen.")}catch(Q){Q.message?i.error(`Response handler '${G.method}' failed with message: ${Q.message}`):i.error(`Response handler '${G.method}' failed unexpectedly.`)}}}}function Oc(E){if(_n())return;let F,G;if(E.method===Ma.type.method){let Q=E.params.id;k.delete(Q),to(E);return}else{let Q=d.get(E.method);Q&&(G=Q.handler,F=Q.type)}if(G||h)try{if(to(E),G)if(E.params===void 0)F!==void 0&&F.numberOfParams!==0&&F.parameterStructures!==le.ParameterStructures.byName&&i.error(`Notification ${E.method} defines ${F.numberOfParams} params but received none.`),G();else if(Array.isArray(E.params)){let Q=E.params;E.method===Da.type.method&&Q.length===2&&Sg.is(Q[0])?G({token:Q[0],value:Q[1]}):(F!==void 0&&(F.parameterStructures===le.ParameterStructures.byName&&i.error(`Notification ${E.method} defines parameters by name but received parameters by position`),F.numberOfParams!==E.params.length&&i.error(`Notification ${E.method} defines ${F.numberOfParams} params but received ${Q.length} arguments`)),G(...Q))}else F!==void 0&&F.parameterStructures===le.ParameterStructures.byPosition&&i.error(`Notification ${E.method} defines parameters by position but received parameters by name`),G(E.params);else h&&h(E.method,E.params)}catch(Q){Q.message?i.error(`Notification handler '${E.method}' failed with message: ${Q.message}`):i.error(`Notification handler '${E.method}' failed unexpectedly.`)}else se.fire(E)}function eo(E){if(!E){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
7
+ ${JSON.stringify(E,null,4)}`);let F=E;if(ut.string(F.id)||ut.number(F.id)){let G=F.id,Q=C.get(G);Q&&Q.reject(new Error("The received response has neither a result nor an error property."))}}function fr(E){if(E!=null)switch(w){case Ne.Verbose:return JSON.stringify(E,null,4);case Ne.Compact:return JSON.stringify(E);default:return}}function Rc(E){if(!(w===Ne.Off||!L))if(v===On.Text){let F;(w===Ne.Verbose||w===Ne.Compact)&&E.params&&(F=`Params: ${fr(E.params)}
8
8
 
9
- `),L.log(`Sending request '${E.method} - (${E.id})'.`,F)}else ti("send-request",E)}function kc(E){if(!(w===Le.Off||!L))if(v===Rn.Text){let F;(w===Le.Verbose||w===Le.Compact)&&(E.params?F=`Params: ${hr(E.params)}
9
+ `),L.log(`Sending request '${E.method} - (${E.id})'.`,F)}else ri("send-request",E)}function Pc(E){if(!(w===Ne.Off||!L))if(v===On.Text){let F;(w===Ne.Verbose||w===Ne.Compact)&&(E.params?F=`Params: ${fr(E.params)}
10
10
 
11
11
  `:F=`No parameters provided.
12
12
 
13
- `),L.log(`Sending notification '${E.method}'.`,F)}else ti("send-notification",E)}function os(E,F,G){if(!(w===Le.Off||!L))if(v===Rn.Text){let Q;(w===Le.Verbose||w===Le.Compact)&&(E.error&&E.error.data?Q=`Error data: ${hr(E.error.data)}
13
+ `),L.log(`Sending notification '${E.method}'.`,F)}else ri("send-notification",E)}function hs(E,F,G){if(!(w===Ne.Off||!L))if(v===On.Text){let Q;(w===Ne.Verbose||w===Ne.Compact)&&(E.error&&E.error.data?Q=`Error data: ${fr(E.error.data)}
14
14
 
15
- `:E.result?Q=`Result: ${hr(E.result)}
15
+ `:E.result?Q=`Result: ${fr(E.result)}
16
16
 
17
17
  `:E.error===void 0&&(Q=`No result returned.
18
18
 
19
- `)),L.log(`Sending response '${F} - (${E.id})'. Processing request took ${Date.now()-G}ms`,Q)}else ti("send-response",E)}function Ac(E){if(!(w===Le.Off||!L))if(v===Rn.Text){let F;(w===Le.Verbose||w===Le.Compact)&&E.params&&(F=`Params: ${hr(E.params)}
19
+ `)),L.log(`Sending response '${F} - (${E.id})'. Processing request took ${Date.now()-G}ms`,Q)}else ri("send-response",E)}function Dc(E){if(!(w===Ne.Off||!L))if(v===On.Text){let F;(w===Ne.Verbose||w===Ne.Compact)&&E.params&&(F=`Params: ${fr(E.params)}
20
20
 
21
- `),L.log(`Received request '${E.method} - (${E.id})'.`,F)}else ti("receive-request",E)}function Qs(E){if(!(w===Le.Off||!L||E.method===Hc.type.method))if(v===Rn.Text){let F;(w===Le.Verbose||w===Le.Compact)&&(E.params?F=`Params: ${hr(E.params)}
21
+ `),L.log(`Received request '${E.method} - (${E.id})'.`,F)}else ri("receive-request",E)}function to(E){if(!(w===Ne.Off||!L||E.method===Xc.type.method))if(v===On.Text){let F;(w===Ne.Verbose||w===Ne.Compact)&&(E.params?F=`Params: ${fr(E.params)}
22
22
 
23
23
  `:F=`No parameters provided.
24
24
 
25
- `),L.log(`Received notification '${E.method}'.`,F)}else ti("receive-notification",E)}function Cc(E,F){if(!(w===Le.Off||!L))if(v===Rn.Text){let G;if((w===Le.Verbose||w===Le.Compact)&&(E.error&&E.error.data?G=`Error data: ${hr(E.error.data)}
25
+ `),L.log(`Received notification '${E.method}'.`,F)}else ri("receive-notification",E)}function Ic(E,F){if(!(w===Ne.Off||!L))if(v===On.Text){let G;if((w===Ne.Verbose||w===Ne.Compact)&&(E.error&&E.error.data?G=`Error data: ${fr(E.error.data)}
26
26
 
27
- `:E.result?G=`Result: ${hr(E.result)}
27
+ `:E.result?G=`Result: ${fr(E.result)}
28
28
 
29
29
  `:E.error===void 0&&(G=`No result returned.
30
30
 
31
- `)),F){let Q=E.error?` Request failed: ${E.error.message} (${E.error.code}).`:"";L.log(`Received response '${F.method} - (${E.id})' in ${Date.now()-F.timerStart}ms.${Q}`,G)}else L.log(`Received response ${E.id} without active response promise.`,G)}else ti("receive-response",E)}function ti(E,F){if(!L||w===Le.Off)return;let G={isLSPMessage:!0,type:E,message:F,timestamp:Date.now()};L.log(G)}function Si(){if($e())throw new ao(Da.Closed,"Connection is closed.");if(yn())throw new ao(Da.Disposed,"Connection is disposed.")}function Oc(){if(bt())throw new ao(Da.AlreadyListening,"Connection is already listening")}function Rc(){if(!bt())throw new Error("Call listen() first.")}function Rr(E){return E===void 0?null:E}function xa(E){if(E!==null)return E}function ka(E){return E!=null&&!Array.isArray(E)&&typeof E=="object"}function Zs(E,F){switch(E){case le.ParameterStructures.auto:return ka(F)?xa(F):[Rr(F)];case le.ParameterStructures.byName:if(!ka(F))throw new Error("Received parameters by name but param is not an object literal.");return xa(F);case le.ParameterStructures.byPosition:return[Rr(F)];default:throw new Error(`Unknown parameter structure ${E.toString()}`)}}function Aa(E,F){let G,Q=E.numberOfParams;switch(Q){case 0:G=void 0;break;case 1:G=Zs(E.parameterStructures,F[0]);break;default:G=[];for(let He=0;He<F.length&&He<Q;He++)G.push(Rr(F[He]));if(F.length<Q)for(let He=F.length;He<Q;He++)G.push(null);break}return G}let ni={sendNotification:(E,...F)=>{Si();let G,Q;if(at.string(E)){G=E;let Ne=F[0],Xe=0,tt=le.ParameterStructures.auto;le.ParameterStructures.is(Ne)&&(Xe=1,tt=Ne);let we=F.length,Ge=we-Xe;switch(Ge){case 0:Q=void 0;break;case 1:Q=Zs(tt,F[Xe]);break;default:if(tt===le.ParameterStructures.byName)throw new Error(`Received ${Ge} parameters for 'by Name' notification parameter structure.`);Q=F.slice(Xe,we).map(De=>Rr(De));break}}else{let Ne=F;G=E.method,Q=Aa(E,Ne)}let He={jsonrpc:u,method:G,params:Q};return kc(He),e.write(He).catch(Ne=>{throw i.error("Sending notification failed."),Ne})},onNotification:(E,F)=>{Si();let G;return at.func(E)?h=E:F&&(at.string(E)?(G=E,d.set(E,{type:void 0,handler:F})):(G=E.method,d.set(E.method,{type:E,handler:F}))),{dispose:()=>{G!==void 0?d.delete(G):h=void 0}}},onProgress:(E,F,G)=>{if(g.has(F))throw new Error(`Progress handler for token ${F} already registered`);return g.set(F,G),{dispose:()=>{g.delete(F)}}},sendProgress:(E,F,G)=>ni.sendNotification(Pa.type,{token:F,value:G}),onUnhandledProgress:W.event,sendRequest:(E,...F)=>{Si(),Rc();let G,Q,He;if(at.string(E)){G=E;let we=F[0],Ge=F[F.length-1],De=0,lt=le.ParameterStructures.auto;le.ParameterStructures.is(we)&&(De=1,lt=we);let qt=F.length;dg.CancellationToken.is(Ge)&&(qt=qt-1,He=Ge);let On=qt-De;switch(On){case 0:Q=void 0;break;case 1:Q=Zs(lt,F[De]);break;default:if(lt===le.ParameterStructures.byName)throw new Error(`Received ${On} parameters for 'by Name' request parameter structure.`);Q=F.slice(De,qt).map(Pc=>Rr(Pc));break}}else{let we=F;G=E.method,Q=Aa(E,we);let Ge=E.numberOfParams;He=dg.CancellationToken.is(we[Ge])?we[Ge]:void 0}let Ne=s++,Xe;He&&(Xe=He.onCancellationRequested(()=>{let we=M.sender.sendCancellation(ni,Ne);return we===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${Ne}`),Promise.resolve()):we.catch(()=>{i.log(`Sending cancellation messages for id ${Ne} failed`)})}));let tt={jsonrpc:u,id:Ne,method:G,params:Q};return xc(tt),typeof M.sender.enableCancellation=="function"&&M.sender.enableCancellation(tt),new Promise(async(we,Ge)=>{let De=On=>{we(On),M.sender.cleanup(Ne),Xe?.dispose()},lt=On=>{Ge(On),M.sender.cleanup(Ne),Xe?.dispose()},qt={method:G,timerStart:Date.now(),resolve:De,reject:lt};try{await e.write(tt),C.set(Ne,qt)}catch(On){throw i.error("Sending request failed."),qt.reject(new le.ResponseError(le.ErrorCodes.MessageWriteError,On.message?On.message:"Unknown reason")),On}})},onRequest:(E,F)=>{Si();let G=null;return gg.is(E)?(G=void 0,c=E):at.string(E)?(G=null,F!==void 0&&(G=E,l.set(E,{handler:F,type:void 0}))):F!==void 0&&(G=E.method,l.set(E.method,{type:E,handler:F})),{dispose:()=>{G!==null&&(G!==void 0?l.delete(G):c=void 0)}}},hasPendingResponse:()=>C.size>0,trace:async(E,F,G)=>{let Q=!1,He=Rn.Text;G!==void 0&&(at.boolean(G)?Q=G:(Q=G.sendNotification||!1,He=G.traceFormat||Rn.Text)),w=E,v=He,w===Le.Off?L=void 0:L=F,Q&&!$e()&&!yn()&&await ni.sendNotification(mg.type,{value:Le.toString(E)})},onError:U.event,onClose:te.event,onUnhandledNotification:se.event,onDispose:O.event,end:()=>{e.end()},dispose:()=>{if(yn())return;R=pr.Disposed,O.fire(void 0);let E=new le.ResponseError(le.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let F of C.values())F.reject(E);C=new Map,T=new Map,k=new Set,_=new Rw.LinkedMap,at.func(e.dispose)&&e.dispose(),at.func(t.dispose)&&t.dispose()},listen:()=>{Si(),Oc(),R=pr.Listening,t.listen(Sc)},inspect:()=>{(0,Ow.default)().console.log("inspect")}};return ni.onNotification(Hc.type,E=>{if(w===Le.Off||!L)return;let F=w===Le.Verbose||w===Le.Compact;L.log(E.message,F?E.verbose:void 0)}),ni.onNotification(Pa.type,E=>{let F=g.get(E.token);F?F(E.value):W.fire(E)}),ni}ye.createMessageConnection=WP});var Yc=m(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.ProgressType=q.ProgressToken=q.createMessageConnection=q.NullLogger=q.ConnectionOptions=q.ConnectionStrategy=q.AbstractMessageBuffer=q.WriteableStreamMessageWriter=q.AbstractMessageWriter=q.MessageWriter=q.ReadableStreamMessageReader=q.AbstractMessageReader=q.MessageReader=q.SharedArrayReceiverStrategy=q.SharedArraySenderStrategy=q.CancellationToken=q.CancellationTokenSource=q.Emitter=q.Event=q.Disposable=q.LRUCache=q.Touch=q.LinkedMap=q.ParameterStructures=q.NotificationType9=q.NotificationType8=q.NotificationType7=q.NotificationType6=q.NotificationType5=q.NotificationType4=q.NotificationType3=q.NotificationType2=q.NotificationType1=q.NotificationType0=q.NotificationType=q.ErrorCodes=q.ResponseError=q.RequestType9=q.RequestType8=q.RequestType7=q.RequestType6=q.RequestType5=q.RequestType4=q.RequestType3=q.RequestType2=q.RequestType1=q.RequestType0=q.RequestType=q.Message=q.RAL=void 0;q.MessageStrategy=q.CancellationStrategy=q.CancellationSenderStrategy=q.CancellationReceiverStrategy=q.ConnectionError=q.ConnectionErrors=q.LogTraceNotification=q.SetTraceNotification=q.TraceFormat=q.TraceValues=q.Trace=void 0;var Ve=Hp();Object.defineProperty(q,"Message",{enumerable:!0,get:function(){return Ve.Message}});Object.defineProperty(q,"RequestType",{enumerable:!0,get:function(){return Ve.RequestType}});Object.defineProperty(q,"RequestType0",{enumerable:!0,get:function(){return Ve.RequestType0}});Object.defineProperty(q,"RequestType1",{enumerable:!0,get:function(){return Ve.RequestType1}});Object.defineProperty(q,"RequestType2",{enumerable:!0,get:function(){return Ve.RequestType2}});Object.defineProperty(q,"RequestType3",{enumerable:!0,get:function(){return Ve.RequestType3}});Object.defineProperty(q,"RequestType4",{enumerable:!0,get:function(){return Ve.RequestType4}});Object.defineProperty(q,"RequestType5",{enumerable:!0,get:function(){return Ve.RequestType5}});Object.defineProperty(q,"RequestType6",{enumerable:!0,get:function(){return Ve.RequestType6}});Object.defineProperty(q,"RequestType7",{enumerable:!0,get:function(){return Ve.RequestType7}});Object.defineProperty(q,"RequestType8",{enumerable:!0,get:function(){return Ve.RequestType8}});Object.defineProperty(q,"RequestType9",{enumerable:!0,get:function(){return Ve.RequestType9}});Object.defineProperty(q,"ResponseError",{enumerable:!0,get:function(){return Ve.ResponseError}});Object.defineProperty(q,"ErrorCodes",{enumerable:!0,get:function(){return Ve.ErrorCodes}});Object.defineProperty(q,"NotificationType",{enumerable:!0,get:function(){return Ve.NotificationType}});Object.defineProperty(q,"NotificationType0",{enumerable:!0,get:function(){return Ve.NotificationType0}});Object.defineProperty(q,"NotificationType1",{enumerable:!0,get:function(){return Ve.NotificationType1}});Object.defineProperty(q,"NotificationType2",{enumerable:!0,get:function(){return Ve.NotificationType2}});Object.defineProperty(q,"NotificationType3",{enumerable:!0,get:function(){return Ve.NotificationType3}});Object.defineProperty(q,"NotificationType4",{enumerable:!0,get:function(){return Ve.NotificationType4}});Object.defineProperty(q,"NotificationType5",{enumerable:!0,get:function(){return Ve.NotificationType5}});Object.defineProperty(q,"NotificationType6",{enumerable:!0,get:function(){return Ve.NotificationType6}});Object.defineProperty(q,"NotificationType7",{enumerable:!0,get:function(){return Ve.NotificationType7}});Object.defineProperty(q,"NotificationType8",{enumerable:!0,get:function(){return Ve.NotificationType8}});Object.defineProperty(q,"NotificationType9",{enumerable:!0,get:function(){return Ve.NotificationType9}});Object.defineProperty(q,"ParameterStructures",{enumerable:!0,get:function(){return Ve.ParameterStructures}});var _g=zp();Object.defineProperty(q,"LinkedMap",{enumerable:!0,get:function(){return _g.LinkedMap}});Object.defineProperty(q,"LRUCache",{enumerable:!0,get:function(){return _g.LRUCache}});Object.defineProperty(q,"Touch",{enumerable:!0,get:function(){return _g.Touch}});var HP=bw();Object.defineProperty(q,"Disposable",{enumerable:!0,get:function(){return HP.Disposable}});var Mw=ro();Object.defineProperty(q,"Event",{enumerable:!0,get:function(){return Mw.Event}});Object.defineProperty(q,"Emitter",{enumerable:!0,get:function(){return Mw.Emitter}});var Lw=Fc();Object.defineProperty(q,"CancellationTokenSource",{enumerable:!0,get:function(){return Lw.CancellationTokenSource}});Object.defineProperty(q,"CancellationToken",{enumerable:!0,get:function(){return Lw.CancellationToken}});var Nw=vw();Object.defineProperty(q,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return Nw.SharedArraySenderStrategy}});Object.defineProperty(q,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return Nw.SharedArrayReceiverStrategy}});var vg=ww();Object.defineProperty(q,"MessageReader",{enumerable:!0,get:function(){return vg.MessageReader}});Object.defineProperty(q,"AbstractMessageReader",{enumerable:!0,get:function(){return vg.AbstractMessageReader}});Object.defineProperty(q,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return vg.ReadableStreamMessageReader}});var Sg=Aw();Object.defineProperty(q,"MessageWriter",{enumerable:!0,get:function(){return Sg.MessageWriter}});Object.defineProperty(q,"AbstractMessageWriter",{enumerable:!0,get:function(){return Sg.AbstractMessageWriter}});Object.defineProperty(q,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return Sg.WriteableStreamMessageWriter}});var GP=Cw();Object.defineProperty(q,"AbstractMessageBuffer",{enumerable:!0,get:function(){return GP.AbstractMessageBuffer}});var zt=Iw();Object.defineProperty(q,"ConnectionStrategy",{enumerable:!0,get:function(){return zt.ConnectionStrategy}});Object.defineProperty(q,"ConnectionOptions",{enumerable:!0,get:function(){return zt.ConnectionOptions}});Object.defineProperty(q,"NullLogger",{enumerable:!0,get:function(){return zt.NullLogger}});Object.defineProperty(q,"createMessageConnection",{enumerable:!0,get:function(){return zt.createMessageConnection}});Object.defineProperty(q,"ProgressToken",{enumerable:!0,get:function(){return zt.ProgressToken}});Object.defineProperty(q,"ProgressType",{enumerable:!0,get:function(){return zt.ProgressType}});Object.defineProperty(q,"Trace",{enumerable:!0,get:function(){return zt.Trace}});Object.defineProperty(q,"TraceValues",{enumerable:!0,get:function(){return zt.TraceValues}});Object.defineProperty(q,"TraceFormat",{enumerable:!0,get:function(){return zt.TraceFormat}});Object.defineProperty(q,"SetTraceNotification",{enumerable:!0,get:function(){return zt.SetTraceNotification}});Object.defineProperty(q,"LogTraceNotification",{enumerable:!0,get:function(){return zt.LogTraceNotification}});Object.defineProperty(q,"ConnectionErrors",{enumerable:!0,get:function(){return zt.ConnectionErrors}});Object.defineProperty(q,"ConnectionError",{enumerable:!0,get:function(){return zt.ConnectionError}});Object.defineProperty(q,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return zt.CancellationReceiverStrategy}});Object.defineProperty(q,"CancellationSenderStrategy",{enumerable:!0,get:function(){return zt.CancellationSenderStrategy}});Object.defineProperty(q,"CancellationStrategy",{enumerable:!0,get:function(){return zt.CancellationStrategy}});Object.defineProperty(q,"MessageStrategy",{enumerable:!0,get:function(){return zt.MessageStrategy}});var zP=Ti();q.RAL=zP.default});var Fw=m(xg=>{"use strict";Object.defineProperty(xg,"__esModule",{value:!0});var qw=require("util"),ii=Yc(),Jc=class t extends ii.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 qw.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)}};Jc.emptyBuffer=Buffer.allocUnsafe(0);var wg=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),ii.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),ii.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),ii.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),ii.Disposable.create(()=>this.stream.off("data",e))}},Tg=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),ii.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),ii.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),ii.Disposable.create(()=>this.stream.off("end",e))}write(e,n){return new Promise((r,i)=>{let s=o=>{o==null?r():i(o)};typeof e=="string"?this.stream.write(e,n,s):this.stream.write(e,s)})}end(){this.stream.end()}},jw=Object.freeze({messageBuffer:Object.freeze({create:t=>new Jc(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 qw.TextDecoder(e.charset).decode(t)))}catch(n){return Promise.reject(n)}}})}),stream:Object.freeze({asReadableStream:t=>new wg(t),asWritableStream:t=>new Tg(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 Eg(){return jw}(function(t){function e(){ii.RAL.install(jw)}t.install=e})(Eg||(Eg={}));xg.default=Eg});var ls=m(ke=>{"use strict";var KP=ke&&ke.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),VP=ke&&ke.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&KP(e,t,n)};Object.defineProperty(ke,"__esModule",{value:!0});ke.createMessageConnection=ke.createServerSocketTransport=ke.createClientSocketTransport=ke.createServerPipeTransport=ke.createClientPipeTransport=ke.generateRandomPipeName=ke.StreamMessageWriter=ke.StreamMessageReader=ke.SocketMessageWriter=ke.SocketMessageReader=ke.PortMessageWriter=ke.PortMessageReader=ke.IPCMessageWriter=ke.IPCMessageReader=void 0;var uo=Fw();uo.default.install();var $w=require("path"),XP=require("os"),YP=require("crypto"),el=require("net"),Pn=Yc();VP(Yc(),ke);var kg=class extends Pn.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),Pn.Disposable.create(()=>this.process.off("message",e))}};ke.IPCMessageReader=kg;var Ag=class extends Pn.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(){}};ke.IPCMessageWriter=Ag;var Cg=class extends Pn.AbstractMessageReader{constructor(e){super(),this.onData=new Pn.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)}};ke.PortMessageReader=Cg;var Og=class extends Pn.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(){}};ke.PortMessageWriter=Og;var us=class extends Pn.ReadableStreamMessageReader{constructor(e,n="utf-8"){super((0,uo.default)().stream.asReadableStream(e),n)}};ke.SocketMessageReader=us;var cs=class extends Pn.WriteableStreamMessageWriter{constructor(e,n){super((0,uo.default)().stream.asWritableStream(e),n),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};ke.SocketMessageWriter=cs;var Qc=class extends Pn.ReadableStreamMessageReader{constructor(e,n){super((0,uo.default)().stream.asReadableStream(e),n)}};ke.StreamMessageReader=Qc;var Zc=class extends Pn.WriteableStreamMessageWriter{constructor(e,n){super((0,uo.default)().stream.asWritableStream(e),n)}};ke.StreamMessageWriter=Zc;var Bw=process.env.XDG_RUNTIME_DIR,JP=new Map([["linux",107],["darwin",103]]);function QP(){let t=(0,YP.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;Bw?e=$w.join(Bw,`vscode-ipc-${t}.sock`):e=$w.join(XP.tmpdir(),`vscode-${t}.sock`);let n=JP.get(process.platform);return n!==void 0&&e.length>n&&(0,uo.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${n} characters.`),e}ke.generateRandomPipeName=QP;function ZP(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,el.createServer)(a=>{o.close(),n([new us(a,e),new cs(a,e)])});o.on("error",s),o.listen(t,()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}ke.createClientPipeTransport=ZP;function eD(t,e="utf-8"){let n=(0,el.createConnection)(t);return[new us(n,e),new cs(n,e)]}ke.createServerPipeTransport=eD;function tD(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,el.createServer)(a=>{o.close(),n([new us(a,e),new cs(a,e)])});o.on("error",s),o.listen(t,"127.0.0.1",()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}ke.createClientSocketTransport=tD;function nD(t,e="utf-8"){let n=(0,el.createConnection)(t,"127.0.0.1");return[new us(n,e),new cs(n,e)]}ke.createServerSocketTransport=nD;function rD(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function iD(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function sD(t,e,n,r){n||(n=Pn.NullLogger);let i=rD(t)?new Qc(t):t,s=iD(e)?new Zc(e):e;return Pn.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,Pn.createMessageConnection)(i,s,n,r)}ke.createMessageConnection=sD});var Rg=m((xH,Uw)=>{"use strict";Uw.exports=ls()});var nl=m((Ww,tl)=>{(function(t){if(typeof tl=="object"&&typeof tl.exports=="object"){var e=t(require,Ww);e!==void 0&&(tl.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(p){function x(A){return typeof A=="string"}p.is=x})(n||(e.DocumentUri=n={}));var r;(function(p){function x(A){return typeof A=="string"}p.is=x})(r||(e.URI=r={}));var i;(function(p){p.MIN_VALUE=-2147483648,p.MAX_VALUE=2147483647;function x(A){return typeof A=="number"&&p.MIN_VALUE<=A&&A<=p.MAX_VALUE}p.is=x})(i||(e.integer=i={}));var s;(function(p){p.MIN_VALUE=0,p.MAX_VALUE=2147483647;function x(A){return typeof A=="number"&&p.MIN_VALUE<=A&&A<=p.MAX_VALUE}p.is=x})(s||(e.uinteger=s={}));var o;(function(p){function x(b,f){return b===Number.MAX_VALUE&&(b=s.MAX_VALUE),f===Number.MAX_VALUE&&(f=s.MAX_VALUE),{line:b,character:f}}p.create=x;function A(b){var f=b;return I.objectLiteral(f)&&I.uinteger(f.line)&&I.uinteger(f.character)}p.is=A})(o||(e.Position=o={}));var a;(function(p){function x(b,f,D,$){if(I.uinteger(b)&&I.uinteger(f)&&I.uinteger(D)&&I.uinteger($))return{start:o.create(b,f),end:o.create(D,$)};if(o.is(b)&&o.is(f))return{start:b,end:f};throw new Error("Range#create called with invalid arguments[".concat(b,", ").concat(f,", ").concat(D,", ").concat($,"]"))}p.create=x;function A(b){var f=b;return I.objectLiteral(f)&&o.is(f.start)&&o.is(f.end)}p.is=A})(a||(e.Range=a={}));var u;(function(p){function x(b,f){return{uri:b,range:f}}p.create=x;function A(b){var f=b;return I.objectLiteral(f)&&a.is(f.range)&&(I.string(f.uri)||I.undefined(f.uri))}p.is=A})(u||(e.Location=u={}));var c;(function(p){function x(b,f,D,$){return{targetUri:b,targetRange:f,targetSelectionRange:D,originSelectionRange:$}}p.create=x;function A(b){var f=b;return I.objectLiteral(f)&&a.is(f.targetRange)&&I.string(f.targetUri)&&a.is(f.targetSelectionRange)&&(a.is(f.originSelectionRange)||I.undefined(f.originSelectionRange))}p.is=A})(c||(e.LocationLink=c={}));var l;(function(p){function x(b,f,D,$){return{red:b,green:f,blue:D,alpha:$}}p.create=x;function A(b){var f=b;return I.objectLiteral(f)&&I.numberRange(f.red,0,1)&&I.numberRange(f.green,0,1)&&I.numberRange(f.blue,0,1)&&I.numberRange(f.alpha,0,1)}p.is=A})(l||(e.Color=l={}));var h;(function(p){function x(b,f){return{range:b,color:f}}p.create=x;function A(b){var f=b;return I.objectLiteral(f)&&a.is(f.range)&&l.is(f.color)}p.is=A})(h||(e.ColorInformation=h={}));var d;(function(p){function x(b,f,D){return{label:b,textEdit:f,additionalTextEdits:D}}p.create=x;function A(b){var f=b;return I.objectLiteral(f)&&I.string(f.label)&&(I.undefined(f.textEdit)||L.is(f))&&(I.undefined(f.additionalTextEdits)||I.typedArray(f.additionalTextEdits,L.is))}p.is=A})(d||(e.ColorPresentation=d={}));var g;(function(p){p.Comment="comment",p.Imports="imports",p.Region="region"})(g||(e.FoldingRangeKind=g={}));var y;(function(p){function x(b,f,D,$,me,ht){var Ke={startLine:b,endLine:f};return I.defined(D)&&(Ke.startCharacter=D),I.defined($)&&(Ke.endCharacter=$),I.defined(me)&&(Ke.kind=me),I.defined(ht)&&(Ke.collapsedText=ht),Ke}p.create=x;function A(b){var f=b;return I.objectLiteral(f)&&I.uinteger(f.startLine)&&I.uinteger(f.startLine)&&(I.undefined(f.startCharacter)||I.uinteger(f.startCharacter))&&(I.undefined(f.endCharacter)||I.uinteger(f.endCharacter))&&(I.undefined(f.kind)||I.string(f.kind))}p.is=A})(y||(e.FoldingRange=y={}));var _;(function(p){function x(b,f){return{location:b,message:f}}p.create=x;function A(b){var f=b;return I.defined(f)&&u.is(f.location)&&I.string(f.message)}p.is=A})(_||(e.DiagnosticRelatedInformation=_={}));var C;(function(p){p.Error=1,p.Warning=2,p.Information=3,p.Hint=4})(C||(e.DiagnosticSeverity=C={}));var k;(function(p){p.Unnecessary=1,p.Deprecated=2})(k||(e.DiagnosticTag=k={}));var T;(function(p){function x(A){var b=A;return I.objectLiteral(b)&&I.string(b.href)}p.is=x})(T||(e.CodeDescription=T={}));var w;(function(p){function x(b,f,D,$,me,ht){var Ke={range:b,message:f};return I.defined(D)&&(Ke.severity=D),I.defined($)&&(Ke.code=$),I.defined(me)&&(Ke.source=me),I.defined(ht)&&(Ke.relatedInformation=ht),Ke}p.create=x;function A(b){var f,D=b;return I.defined(D)&&a.is(D.range)&&I.string(D.message)&&(I.number(D.severity)||I.undefined(D.severity))&&(I.integer(D.code)||I.string(D.code)||I.undefined(D.code))&&(I.undefined(D.codeDescription)||I.string((f=D.codeDescription)===null||f===void 0?void 0:f.href))&&(I.string(D.source)||I.undefined(D.source))&&(I.undefined(D.relatedInformation)||I.typedArray(D.relatedInformation,_.is))}p.is=A})(w||(e.Diagnostic=w={}));var v;(function(p){function x(b,f){for(var D=[],$=2;$<arguments.length;$++)D[$-2]=arguments[$];var me={title:b,command:f};return I.defined(D)&&D.length>0&&(me.arguments=D),me}p.create=x;function A(b){var f=b;return I.defined(f)&&I.string(f.title)&&I.string(f.command)}p.is=A})(v||(e.Command=v={}));var L;(function(p){function x(D,$){return{range:D,newText:$}}p.replace=x;function A(D,$){return{range:{start:D,end:D},newText:$}}p.insert=A;function b(D){return{range:D,newText:""}}p.del=b;function f(D){var $=D;return I.objectLiteral($)&&I.string($.newText)&&a.is($.range)}p.is=f})(L||(e.TextEdit=L={}));var R;(function(p){function x(b,f,D){var $={label:b};return f!==void 0&&($.needsConfirmation=f),D!==void 0&&($.description=D),$}p.create=x;function A(b){var f=b;return I.objectLiteral(f)&&I.string(f.label)&&(I.boolean(f.needsConfirmation)||f.needsConfirmation===void 0)&&(I.string(f.description)||f.description===void 0)}p.is=A})(R||(e.ChangeAnnotation=R={}));var U;(function(p){function x(A){var b=A;return I.string(b)}p.is=x})(U||(e.ChangeAnnotationIdentifier=U={}));var te;(function(p){function x(D,$,me){return{range:D,newText:$,annotationId:me}}p.replace=x;function A(D,$,me){return{range:{start:D,end:D},newText:$,annotationId:me}}p.insert=A;function b(D,$){return{range:D,newText:"",annotationId:$}}p.del=b;function f(D){var $=D;return L.is($)&&(R.is($.annotationId)||U.is($.annotationId))}p.is=f})(te||(e.AnnotatedTextEdit=te={}));var se;(function(p){function x(b,f){return{textDocument:b,edits:f}}p.create=x;function A(b){var f=b;return I.defined(f)&&$e.is(f.textDocument)&&Array.isArray(f.edits)}p.is=A})(se||(e.TextDocumentEdit=se={}));var W;(function(p){function x(b,f,D){var $={kind:"create",uri:b};return f!==void 0&&(f.overwrite!==void 0||f.ignoreIfExists!==void 0)&&($.options=f),D!==void 0&&($.annotationId=D),$}p.create=x;function A(b){var f=b;return f&&f.kind==="create"&&I.string(f.uri)&&(f.options===void 0||(f.options.overwrite===void 0||I.boolean(f.options.overwrite))&&(f.options.ignoreIfExists===void 0||I.boolean(f.options.ignoreIfExists)))&&(f.annotationId===void 0||U.is(f.annotationId))}p.is=A})(W||(e.CreateFile=W={}));var O;(function(p){function x(b,f,D,$){var me={kind:"rename",oldUri:b,newUri:f};return D!==void 0&&(D.overwrite!==void 0||D.ignoreIfExists!==void 0)&&(me.options=D),$!==void 0&&(me.annotationId=$),me}p.create=x;function A(b){var f=b;return f&&f.kind==="rename"&&I.string(f.oldUri)&&I.string(f.newUri)&&(f.options===void 0||(f.options.overwrite===void 0||I.boolean(f.options.overwrite))&&(f.options.ignoreIfExists===void 0||I.boolean(f.options.ignoreIfExists)))&&(f.annotationId===void 0||U.is(f.annotationId))}p.is=A})(O||(e.RenameFile=O={}));var M;(function(p){function x(b,f,D){var $={kind:"delete",uri:b};return f!==void 0&&(f.recursive!==void 0||f.ignoreIfNotExists!==void 0)&&($.options=f),D!==void 0&&($.annotationId=D),$}p.create=x;function A(b){var f=b;return f&&f.kind==="delete"&&I.string(f.uri)&&(f.options===void 0||(f.options.recursive===void 0||I.boolean(f.options.recursive))&&(f.options.ignoreIfNotExists===void 0||I.boolean(f.options.ignoreIfNotExists)))&&(f.annotationId===void 0||U.is(f.annotationId))}p.is=A})(M||(e.DeleteFile=M={}));var N;(function(p){function x(A){var b=A;return b&&(b.changes!==void 0||b.documentChanges!==void 0)&&(b.documentChanges===void 0||b.documentChanges.every(function(f){return I.string(f.kind)?W.is(f)||O.is(f)||M.is(f):se.is(f)}))}p.is=x})(N||(e.WorkspaceEdit=N={}));var j=function(){function p(x,A){this.edits=x,this.changeAnnotations=A}return p.prototype.insert=function(x,A,b){var f,D;if(b===void 0?f=L.insert(x,A):U.is(b)?(D=b,f=te.insert(x,A,b)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(b),f=te.insert(x,A,D)),this.edits.push(f),D!==void 0)return D},p.prototype.replace=function(x,A,b){var f,D;if(b===void 0?f=L.replace(x,A):U.is(b)?(D=b,f=te.replace(x,A,b)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(b),f=te.replace(x,A,D)),this.edits.push(f),D!==void 0)return D},p.prototype.delete=function(x,A){var b,f;if(A===void 0?b=L.del(x):U.is(A)?(f=A,b=te.del(x,A)):(this.assertChangeAnnotations(this.changeAnnotations),f=this.changeAnnotations.manage(A),b=te.del(x,f)),this.edits.push(b),f!==void 0)return f},p.prototype.add=function(x){this.edits.push(x)},p.prototype.all=function(){return this.edits},p.prototype.clear=function(){this.edits.splice(0,this.edits.length)},p.prototype.assertChangeAnnotations=function(x){if(x===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},p}(),fe=function(){function p(x){this._annotations=x===void 0?Object.create(null):x,this._counter=0,this._size=0}return p.prototype.all=function(){return this._annotations},Object.defineProperty(p.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),p.prototype.manage=function(x,A){var b;if(U.is(x)?b=x:(b=this.nextId(),A=x),this._annotations[b]!==void 0)throw new Error("Id ".concat(b," is already in use."));if(A===void 0)throw new Error("No annotation provided for id ".concat(b));return this._annotations[b]=A,this._size++,b},p.prototype.nextId=function(){return this._counter++,this._counter.toString()},p}(),he=function(){function p(x){var A=this;this._textEditChanges=Object.create(null),x!==void 0?(this._workspaceEdit=x,x.documentChanges?(this._changeAnnotations=new fe(x.changeAnnotations),x.changeAnnotations=this._changeAnnotations.all(),x.documentChanges.forEach(function(b){if(se.is(b)){var f=new j(b.edits,A._changeAnnotations);A._textEditChanges[b.textDocument.uri]=f}})):x.changes&&Object.keys(x.changes).forEach(function(b){var f=new j(x.changes[b]);A._textEditChanges[b]=f})):this._workspaceEdit={}}return Object.defineProperty(p.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}),p.prototype.getTextEditChange=function(x){if($e.is(x)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var A={uri:x.uri,version:x.version},b=this._textEditChanges[A.uri];if(!b){var f=[],D={textDocument:A,edits:f};this._workspaceEdit.documentChanges.push(D),b=new j(f,this._changeAnnotations),this._textEditChanges[A.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[x];if(!b){var f=[];this._workspaceEdit.changes[x]=f,b=new j(f),this._textEditChanges[x]=b}return b}},p.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new fe,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},p.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},p.prototype.createFile=function(x,A,b){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var f;R.is(A)||U.is(A)?f=A:b=A;var D,$;if(f===void 0?D=W.create(x,b):($=U.is(f)?f:this._changeAnnotations.manage(f),D=W.create(x,b,$)),this._workspaceEdit.documentChanges.push(D),$!==void 0)return $},p.prototype.renameFile=function(x,A,b,f){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var D;R.is(b)||U.is(b)?D=b:f=b;var $,me;if(D===void 0?$=O.create(x,A,f):(me=U.is(D)?D:this._changeAnnotations.manage(D),$=O.create(x,A,f,me)),this._workspaceEdit.documentChanges.push($),me!==void 0)return me},p.prototype.deleteFile=function(x,A,b){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var f;R.is(A)||U.is(A)?f=A:b=A;var D,$;if(f===void 0?D=M.create(x,b):($=U.is(f)?f:this._changeAnnotations.manage(f),D=M.create(x,b,$)),this._workspaceEdit.documentChanges.push(D),$!==void 0)return $},p}();e.WorkspaceChange=he;var Nt;(function(p){function x(b){return{uri:b}}p.create=x;function A(b){var f=b;return I.defined(f)&&I.string(f.uri)}p.is=A})(Nt||(e.TextDocumentIdentifier=Nt={}));var bt;(function(p){function x(b,f){return{uri:b,version:f}}p.create=x;function A(b){var f=b;return I.defined(f)&&I.string(f.uri)&&I.integer(f.version)}p.is=A})(bt||(e.VersionedTextDocumentIdentifier=bt={}));var $e;(function(p){function x(b,f){return{uri:b,version:f}}p.create=x;function A(b){var f=b;return I.defined(f)&&I.string(f.uri)&&(f.version===null||I.integer(f.version))}p.is=A})($e||(e.OptionalVersionedTextDocumentIdentifier=$e={}));var yn;(function(p){function x(b,f,D,$){return{uri:b,languageId:f,version:D,text:$}}p.create=x;function A(b){var f=b;return I.defined(f)&&I.string(f.uri)&&I.string(f.languageId)&&I.integer(f.version)&&I.string(f.text)}p.is=A})(yn||(e.TextDocumentItem=yn={}));var Ys;(function(p){p.PlainText="plaintext",p.Markdown="markdown";function x(A){var b=A;return b===p.PlainText||b===p.Markdown}p.is=x})(Ys||(e.MarkupKind=Ys={}));var ss;(function(p){function x(A){var b=A;return I.objectLiteral(A)&&Ys.is(b.kind)&&I.string(b.value)}p.is=x})(ss||(e.MarkupContent=ss={}));var _c;(function(p){p.Text=1,p.Method=2,p.Function=3,p.Constructor=4,p.Field=5,p.Variable=6,p.Class=7,p.Interface=8,p.Module=9,p.Property=10,p.Unit=11,p.Value=12,p.Enum=13,p.Keyword=14,p.Snippet=15,p.Color=16,p.File=17,p.Reference=18,p.Folder=19,p.EnumMember=20,p.Constant=21,p.Struct=22,p.Event=23,p.Operator=24,p.TypeParameter=25})(_c||(e.CompletionItemKind=_c={}));var Ta;(function(p){p.PlainText=1,p.Snippet=2})(Ta||(e.InsertTextFormat=Ta={}));var Ea;(function(p){p.Deprecated=1})(Ea||(e.CompletionItemTag=Ea={}));var vc;(function(p){function x(b,f,D){return{newText:b,insert:f,replace:D}}p.create=x;function A(b){var f=b;return f&&I.string(f.newText)&&a.is(f.insert)&&a.is(f.replace)}p.is=A})(vc||(e.InsertReplaceEdit=vc={}));var Sc;(function(p){p.asIs=1,p.adjustIndentation=2})(Sc||(e.InsertTextMode=Sc={}));var wc;(function(p){function x(A){var b=A;return b&&(I.string(b.detail)||b.detail===void 0)&&(I.string(b.description)||b.description===void 0)}p.is=x})(wc||(e.CompletionItemLabelDetails=wc={}));var Tc;(function(p){function x(A){return{label:A}}p.create=x})(Tc||(e.CompletionItem=Tc={}));var Ec;(function(p){function x(A,b){return{items:A||[],isIncomplete:!!b}}p.create=x})(Ec||(e.CompletionList=Ec={}));var Js;(function(p){function x(b){return b.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}p.fromPlainText=x;function A(b){var f=b;return I.string(f)||I.objectLiteral(f)&&I.string(f.language)&&I.string(f.value)}p.is=A})(Js||(e.MarkedString=Js={}));var hr;(function(p){function x(A){var b=A;return!!b&&I.objectLiteral(b)&&(ss.is(b.contents)||Js.is(b.contents)||I.typedArray(b.contents,Js.is))&&(A.range===void 0||a.is(A.range))}p.is=x})(hr||(e.Hover=hr={}));var xc;(function(p){function x(A,b){return b?{label:A,documentation:b}:{label:A}}p.create=x})(xc||(e.ParameterInformation=xc={}));var kc;(function(p){function x(A,b){for(var f=[],D=2;D<arguments.length;D++)f[D-2]=arguments[D];var $={label:A};return I.defined(b)&&($.documentation=b),I.defined(f)?$.parameters=f:$.parameters=[],$}p.create=x})(kc||(e.SignatureInformation=kc={}));var os;(function(p){p.Text=1,p.Read=2,p.Write=3})(os||(e.DocumentHighlightKind=os={}));var Ac;(function(p){function x(A,b){var f={range:A};return I.number(b)&&(f.kind=b),f}p.create=x})(Ac||(e.DocumentHighlight=Ac={}));var Qs;(function(p){p.File=1,p.Module=2,p.Namespace=3,p.Package=4,p.Class=5,p.Method=6,p.Property=7,p.Field=8,p.Constructor=9,p.Enum=10,p.Interface=11,p.Function=12,p.Variable=13,p.Constant=14,p.String=15,p.Number=16,p.Boolean=17,p.Array=18,p.Object=19,p.Key=20,p.Null=21,p.EnumMember=22,p.Struct=23,p.Event=24,p.Operator=25,p.TypeParameter=26})(Qs||(e.SymbolKind=Qs={}));var Cc;(function(p){p.Deprecated=1})(Cc||(e.SymbolTag=Cc={}));var ti;(function(p){function x(A,b,f,D,$){var me={name:A,kind:b,location:{uri:D,range:f}};return $&&(me.containerName=$),me}p.create=x})(ti||(e.SymbolInformation=ti={}));var Si;(function(p){function x(A,b,f,D){return D!==void 0?{name:A,kind:b,location:{uri:f,range:D}}:{name:A,kind:b,location:{uri:f}}}p.create=x})(Si||(e.WorkspaceSymbol=Si={}));var Oc;(function(p){function x(b,f,D,$,me,ht){var Ke={name:b,detail:f,kind:D,range:$,selectionRange:me};return ht!==void 0&&(Ke.children=ht),Ke}p.create=x;function A(b){var f=b;return f&&I.string(f.name)&&I.number(f.kind)&&a.is(f.range)&&a.is(f.selectionRange)&&(f.detail===void 0||I.string(f.detail))&&(f.deprecated===void 0||I.boolean(f.deprecated))&&(f.children===void 0||Array.isArray(f.children))&&(f.tags===void 0||Array.isArray(f.tags))}p.is=A})(Oc||(e.DocumentSymbol=Oc={}));var Rc;(function(p){p.Empty="",p.QuickFix="quickfix",p.Refactor="refactor",p.RefactorExtract="refactor.extract",p.RefactorInline="refactor.inline",p.RefactorRewrite="refactor.rewrite",p.Source="source",p.SourceOrganizeImports="source.organizeImports",p.SourceFixAll="source.fixAll"})(Rc||(e.CodeActionKind=Rc={}));var Rr;(function(p){p.Invoked=1,p.Automatic=2})(Rr||(e.CodeActionTriggerKind=Rr={}));var xa;(function(p){function x(b,f,D){var $={diagnostics:b};return f!=null&&($.only=f),D!=null&&($.triggerKind=D),$}p.create=x;function A(b){var f=b;return I.defined(f)&&I.typedArray(f.diagnostics,w.is)&&(f.only===void 0||I.typedArray(f.only,I.string))&&(f.triggerKind===void 0||f.triggerKind===Rr.Invoked||f.triggerKind===Rr.Automatic)}p.is=A})(xa||(e.CodeActionContext=xa={}));var ka;(function(p){function x(b,f,D){var $={title:b},me=!0;return typeof f=="string"?(me=!1,$.kind=f):v.is(f)?$.command=f:$.edit=f,me&&D!==void 0&&($.kind=D),$}p.create=x;function A(b){var f=b;return f&&I.string(f.title)&&(f.diagnostics===void 0||I.typedArray(f.diagnostics,w.is))&&(f.kind===void 0||I.string(f.kind))&&(f.edit!==void 0||f.command!==void 0)&&(f.command===void 0||v.is(f.command))&&(f.isPreferred===void 0||I.boolean(f.isPreferred))&&(f.edit===void 0||N.is(f.edit))}p.is=A})(ka||(e.CodeAction=ka={}));var Zs;(function(p){function x(b,f){var D={range:b};return I.defined(f)&&(D.data=f),D}p.create=x;function A(b){var f=b;return I.defined(f)&&a.is(f.range)&&(I.undefined(f.command)||v.is(f.command))}p.is=A})(Zs||(e.CodeLens=Zs={}));var Aa;(function(p){function x(b,f){return{tabSize:b,insertSpaces:f}}p.create=x;function A(b){var f=b;return I.defined(f)&&I.uinteger(f.tabSize)&&I.boolean(f.insertSpaces)}p.is=A})(Aa||(e.FormattingOptions=Aa={}));var ni;(function(p){function x(b,f,D){return{range:b,target:f,data:D}}p.create=x;function A(b){var f=b;return I.defined(f)&&a.is(f.range)&&(I.undefined(f.target)||I.string(f.target))}p.is=A})(ni||(e.DocumentLink=ni={}));var E;(function(p){function x(b,f){return{range:b,parent:f}}p.create=x;function A(b){var f=b;return I.objectLiteral(f)&&a.is(f.range)&&(f.parent===void 0||p.is(f.parent))}p.is=A})(E||(e.SelectionRange=E={}));var F;(function(p){p.namespace="namespace",p.type="type",p.class="class",p.enum="enum",p.interface="interface",p.struct="struct",p.typeParameter="typeParameter",p.parameter="parameter",p.variable="variable",p.property="property",p.enumMember="enumMember",p.event="event",p.function="function",p.method="method",p.macro="macro",p.keyword="keyword",p.modifier="modifier",p.comment="comment",p.string="string",p.number="number",p.regexp="regexp",p.operator="operator",p.decorator="decorator"})(F||(e.SemanticTokenTypes=F={}));var G;(function(p){p.declaration="declaration",p.definition="definition",p.readonly="readonly",p.static="static",p.deprecated="deprecated",p.abstract="abstract",p.async="async",p.modification="modification",p.documentation="documentation",p.defaultLibrary="defaultLibrary"})(G||(e.SemanticTokenModifiers=G={}));var Q;(function(p){function x(A){var b=A;return I.objectLiteral(b)&&(b.resultId===void 0||typeof b.resultId=="string")&&Array.isArray(b.data)&&(b.data.length===0||typeof b.data[0]=="number")}p.is=x})(Q||(e.SemanticTokens=Q={}));var He;(function(p){function x(b,f){return{range:b,text:f}}p.create=x;function A(b){var f=b;return f!=null&&a.is(f.range)&&I.string(f.text)}p.is=A})(He||(e.InlineValueText=He={}));var Ne;(function(p){function x(b,f,D){return{range:b,variableName:f,caseSensitiveLookup:D}}p.create=x;function A(b){var f=b;return f!=null&&a.is(f.range)&&I.boolean(f.caseSensitiveLookup)&&(I.string(f.variableName)||f.variableName===void 0)}p.is=A})(Ne||(e.InlineValueVariableLookup=Ne={}));var Xe;(function(p){function x(b,f){return{range:b,expression:f}}p.create=x;function A(b){var f=b;return f!=null&&a.is(f.range)&&(I.string(f.expression)||f.expression===void 0)}p.is=A})(Xe||(e.InlineValueEvaluatableExpression=Xe={}));var tt;(function(p){function x(b,f){return{frameId:b,stoppedLocation:f}}p.create=x;function A(b){var f=b;return I.defined(f)&&a.is(b.stoppedLocation)}p.is=A})(tt||(e.InlineValueContext=tt={}));var we;(function(p){p.Type=1,p.Parameter=2;function x(A){return A===1||A===2}p.is=x})(we||(e.InlayHintKind=we={}));var Ge;(function(p){function x(b){return{value:b}}p.create=x;function A(b){var f=b;return I.objectLiteral(f)&&(f.tooltip===void 0||I.string(f.tooltip)||ss.is(f.tooltip))&&(f.location===void 0||u.is(f.location))&&(f.command===void 0||v.is(f.command))}p.is=A})(Ge||(e.InlayHintLabelPart=Ge={}));var De;(function(p){function x(b,f,D){var $={position:b,label:f};return D!==void 0&&($.kind=D),$}p.create=x;function A(b){var f=b;return I.objectLiteral(f)&&o.is(f.position)&&(I.string(f.label)||I.typedArray(f.label,Ge.is))&&(f.kind===void 0||we.is(f.kind))&&f.textEdits===void 0||I.typedArray(f.textEdits,L.is)&&(f.tooltip===void 0||I.string(f.tooltip)||ss.is(f.tooltip))&&(f.paddingLeft===void 0||I.boolean(f.paddingLeft))&&(f.paddingRight===void 0||I.boolean(f.paddingRight))}p.is=A})(De||(e.InlayHint=De={}));var lt;(function(p){function x(A){return{kind:"snippet",value:A}}p.createSnippet=x})(lt||(e.StringValue=lt={}));var qt;(function(p){function x(A,b,f,D){return{insertText:A,filterText:b,range:f,command:D}}p.create=x})(qt||(e.InlineCompletionItem=qt={}));var On;(function(p){function x(A){return{items:A}}p.create=x})(On||(e.InlineCompletionList=On={}));var Pc;(function(p){p.Invoked=0,p.Automatic=1})(Pc||(e.InlineCompletionTriggerKind=Pc={}));var sw;(function(p){function x(A,b){return{range:A,text:b}}p.create=x})(sw||(e.SelectedCompletionInfo=sw={}));var ow;(function(p){function x(A,b){return{triggerKind:A,selectedCompletionInfo:b}}p.create=x})(ow||(e.InlineCompletionContext=ow={}));var aw;(function(p){function x(A){var b=A;return I.objectLiteral(b)&&r.is(b.uri)&&I.string(b.name)}p.is=x})(aw||(e.WorkspaceFolder=aw={})),e.EOL=[`
31
+ `)),F){let Q=E.error?` Request failed: ${E.error.message} (${E.error.code}).`:"";L.log(`Received response '${F.method} - (${E.id})' in ${Date.now()-F.timerStart}ms.${Q}`,G)}else L.log(`Received response ${E.id} without active response promise.`,G)}else ri("receive-response",E)}function ri(E,F){if(!L||w===Ne.Off)return;let G={isLSPMessage:!0,type:E,message:F,timestamp:Date.now()};L.log(G)}function xi(){if($e())throw new lo(Ia.Closed,"Connection is closed.");if(_n())throw new lo(Ia.Disposed,"Connection is disposed.")}function Mc(){if(_t())throw new lo(Ia.AlreadyListening,"Connection is already listening")}function Lc(){if(!_t())throw new Error("Call listen() first.")}function Dr(E){return E===void 0?null:E}function ka(E){if(E!==null)return E}function Aa(E){return E!=null&&!Array.isArray(E)&&typeof E=="object"}function no(E,F){switch(E){case le.ParameterStructures.auto:return Aa(F)?ka(F):[Dr(F)];case le.ParameterStructures.byName:if(!Aa(F))throw new Error("Received parameters by name but param is not an object literal.");return ka(F);case le.ParameterStructures.byPosition:return[Dr(F)];default:throw new Error(`Unknown parameter structure ${E.toString()}`)}}function Ca(E,F){let G,Q=E.numberOfParams;switch(Q){case 0:G=void 0;break;case 1:G=no(E.parameterStructures,F[0]);break;default:G=[];for(let He=0;He<F.length&&He<Q;He++)G.push(Dr(F[He]));if(F.length<Q)for(let He=F.length;He<Q;He++)G.push(null);break}return G}let ii={sendNotification:(E,...F)=>{xi();let G,Q;if(ut.string(E)){G=E;let qe=F[0],Xe=0,tt=le.ParameterStructures.auto;le.ParameterStructures.is(qe)&&(Xe=1,tt=qe);let xe=F.length,Ge=xe-Xe;switch(Ge){case 0:Q=void 0;break;case 1:Q=no(tt,F[Xe]);break;default:if(tt===le.ParameterStructures.byName)throw new Error(`Received ${Ge} parameters for 'by Name' notification parameter structure.`);Q=F.slice(Xe,xe).map(Ie=>Dr(Ie));break}}else{let qe=F;G=E.method,Q=Ca(E,qe)}let He={jsonrpc:u,method:G,params:Q};return Pc(He),e.write(He).catch(qe=>{throw i.error("Sending notification failed."),qe})},onNotification:(E,F)=>{xi();let G;return ut.func(E)?h=E:F&&(ut.string(E)?(G=E,d.set(E,{type:void 0,handler:F})):(G=E.method,d.set(E.method,{type:E,handler:F}))),{dispose:()=>{G!==void 0?d.delete(G):h=void 0}}},onProgress:(E,F,G)=>{if(g.has(F))throw new Error(`Progress handler for token ${F} already registered`);return g.set(F,G),{dispose:()=>{g.delete(F)}}},sendProgress:(E,F,G)=>ii.sendNotification(Da.type,{token:F,value:G}),onUnhandledProgress:U.event,sendRequest:(E,...F)=>{xi(),Lc();let G,Q,He;if(ut.string(E)){G=E;let xe=F[0],Ge=F[F.length-1],Ie=0,ht=le.ParameterStructures.auto;le.ParameterStructures.is(xe)&&(Ie=1,ht=xe);let Ft=F.length;vg.CancellationToken.is(Ge)&&(Ft=Ft-1,He=Ge);let Cn=Ft-Ie;switch(Cn){case 0:Q=void 0;break;case 1:Q=no(ht,F[Ie]);break;default:if(ht===le.ParameterStructures.byName)throw new Error(`Received ${Cn} parameters for 'by Name' request parameter structure.`);Q=F.slice(Ie,Ft).map(Nc=>Dr(Nc));break}}else{let xe=F;G=E.method,Q=Ca(E,xe);let Ge=E.numberOfParams;He=vg.CancellationToken.is(xe[Ge])?xe[Ge]:void 0}let qe=s++,Xe;He&&(Xe=He.onCancellationRequested(()=>{let xe=M.sender.sendCancellation(ii,qe);return xe===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${qe}`),Promise.resolve()):xe.catch(()=>{i.log(`Sending cancellation messages for id ${qe} failed`)})}));let tt={jsonrpc:u,id:qe,method:G,params:Q};return Rc(tt),typeof M.sender.enableCancellation=="function"&&M.sender.enableCancellation(tt),new Promise(async(xe,Ge)=>{let Ie=Cn=>{xe(Cn),M.sender.cleanup(qe),Xe?.dispose()},ht=Cn=>{Ge(Cn),M.sender.cleanup(qe),Xe?.dispose()},Ft={method:G,timerStart:Date.now(),resolve:Ie,reject:ht};try{await e.write(tt),C.set(qe,Ft)}catch(Cn){throw i.error("Sending request failed."),Ft.reject(new le.ResponseError(le.ErrorCodes.MessageWriteError,Cn.message?Cn.message:"Unknown reason")),Cn}})},onRequest:(E,F)=>{xi();let G=null;return Tg.is(E)?(G=void 0,c=E):ut.string(E)?(G=null,F!==void 0&&(G=E,l.set(E,{handler:F,type:void 0}))):F!==void 0&&(G=E.method,l.set(E.method,{type:E,handler:F})),{dispose:()=>{G!==null&&(G!==void 0?l.delete(G):c=void 0)}}},hasPendingResponse:()=>C.size>0,trace:async(E,F,G)=>{let Q=!1,He=On.Text;G!==void 0&&(ut.boolean(G)?Q=G:(Q=G.sendNotification||!1,He=G.traceFormat||On.Text)),w=E,v=He,w===Ne.Off?L=void 0:L=F,Q&&!$e()&&!_n()&&await ii.sendNotification(Eg.type,{value:Ne.toString(E)})},onError:W.event,onClose:ne.event,onUnhandledNotification:se.event,onDispose:O.event,end:()=>{e.end()},dispose:()=>{if(_n())return;R=mr.Disposed,O.fire(void 0);let E=new le.ResponseError(le.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let F of C.values())F.reject(E);C=new Map,T=new Map,k=new Set,_=new Uw.LinkedMap,ut.func(e.dispose)&&e.dispose(),ut.func(t.dispose)&&t.dispose()},listen:()=>{xi(),Mc(),R=mr.Listening,t.listen(kc)},inspect:()=>{(0,Ww.default)().console.log("inspect")}};return ii.onNotification(Xc.type,E=>{if(w===Ne.Off||!L)return;let F=w===Ne.Verbose||w===Ne.Compact;L.log(E.message,F?E.verbose:void 0)}),ii.onNotification(Da.type,E=>{let F=g.get(E.token);F?F(E.value):U.fire(E)}),ii}ye.createMessageConnection=rD});var tl=m(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.ProgressType=q.ProgressToken=q.createMessageConnection=q.NullLogger=q.ConnectionOptions=q.ConnectionStrategy=q.AbstractMessageBuffer=q.WriteableStreamMessageWriter=q.AbstractMessageWriter=q.MessageWriter=q.ReadableStreamMessageReader=q.AbstractMessageReader=q.MessageReader=q.SharedArrayReceiverStrategy=q.SharedArraySenderStrategy=q.CancellationToken=q.CancellationTokenSource=q.Emitter=q.Event=q.Disposable=q.LRUCache=q.Touch=q.LinkedMap=q.ParameterStructures=q.NotificationType9=q.NotificationType8=q.NotificationType7=q.NotificationType6=q.NotificationType5=q.NotificationType4=q.NotificationType3=q.NotificationType2=q.NotificationType1=q.NotificationType0=q.NotificationType=q.ErrorCodes=q.ResponseError=q.RequestType9=q.RequestType8=q.RequestType7=q.RequestType6=q.RequestType5=q.RequestType4=q.RequestType3=q.RequestType2=q.RequestType1=q.RequestType0=q.RequestType=q.Message=q.RAL=void 0;q.MessageStrategy=q.CancellationStrategy=q.CancellationSenderStrategy=q.CancellationReceiverStrategy=q.ConnectionError=q.ConnectionErrors=q.LogTraceNotification=q.SetTraceNotification=q.TraceFormat=q.TraceValues=q.Trace=void 0;var Ve=Qp();Object.defineProperty(q,"Message",{enumerable:!0,get:function(){return Ve.Message}});Object.defineProperty(q,"RequestType",{enumerable:!0,get:function(){return Ve.RequestType}});Object.defineProperty(q,"RequestType0",{enumerable:!0,get:function(){return Ve.RequestType0}});Object.defineProperty(q,"RequestType1",{enumerable:!0,get:function(){return Ve.RequestType1}});Object.defineProperty(q,"RequestType2",{enumerable:!0,get:function(){return Ve.RequestType2}});Object.defineProperty(q,"RequestType3",{enumerable:!0,get:function(){return Ve.RequestType3}});Object.defineProperty(q,"RequestType4",{enumerable:!0,get:function(){return Ve.RequestType4}});Object.defineProperty(q,"RequestType5",{enumerable:!0,get:function(){return Ve.RequestType5}});Object.defineProperty(q,"RequestType6",{enumerable:!0,get:function(){return Ve.RequestType6}});Object.defineProperty(q,"RequestType7",{enumerable:!0,get:function(){return Ve.RequestType7}});Object.defineProperty(q,"RequestType8",{enumerable:!0,get:function(){return Ve.RequestType8}});Object.defineProperty(q,"RequestType9",{enumerable:!0,get:function(){return Ve.RequestType9}});Object.defineProperty(q,"ResponseError",{enumerable:!0,get:function(){return Ve.ResponseError}});Object.defineProperty(q,"ErrorCodes",{enumerable:!0,get:function(){return Ve.ErrorCodes}});Object.defineProperty(q,"NotificationType",{enumerable:!0,get:function(){return Ve.NotificationType}});Object.defineProperty(q,"NotificationType0",{enumerable:!0,get:function(){return Ve.NotificationType0}});Object.defineProperty(q,"NotificationType1",{enumerable:!0,get:function(){return Ve.NotificationType1}});Object.defineProperty(q,"NotificationType2",{enumerable:!0,get:function(){return Ve.NotificationType2}});Object.defineProperty(q,"NotificationType3",{enumerable:!0,get:function(){return Ve.NotificationType3}});Object.defineProperty(q,"NotificationType4",{enumerable:!0,get:function(){return Ve.NotificationType4}});Object.defineProperty(q,"NotificationType5",{enumerable:!0,get:function(){return Ve.NotificationType5}});Object.defineProperty(q,"NotificationType6",{enumerable:!0,get:function(){return Ve.NotificationType6}});Object.defineProperty(q,"NotificationType7",{enumerable:!0,get:function(){return Ve.NotificationType7}});Object.defineProperty(q,"NotificationType8",{enumerable:!0,get:function(){return Ve.NotificationType8}});Object.defineProperty(q,"NotificationType9",{enumerable:!0,get:function(){return Ve.NotificationType9}});Object.defineProperty(q,"ParameterStructures",{enumerable:!0,get:function(){return Ve.ParameterStructures}});var Ag=eg();Object.defineProperty(q,"LinkedMap",{enumerable:!0,get:function(){return Ag.LinkedMap}});Object.defineProperty(q,"LRUCache",{enumerable:!0,get:function(){return Ag.LRUCache}});Object.defineProperty(q,"Touch",{enumerable:!0,get:function(){return Ag.Touch}});var iD=Pw();Object.defineProperty(q,"Disposable",{enumerable:!0,get:function(){return iD.Disposable}});var Kw=oo();Object.defineProperty(q,"Event",{enumerable:!0,get:function(){return Kw.Event}});Object.defineProperty(q,"Emitter",{enumerable:!0,get:function(){return Kw.Emitter}});var Vw=Hc();Object.defineProperty(q,"CancellationTokenSource",{enumerable:!0,get:function(){return Vw.CancellationTokenSource}});Object.defineProperty(q,"CancellationToken",{enumerable:!0,get:function(){return Vw.CancellationToken}});var Xw=Iw();Object.defineProperty(q,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return Xw.SharedArraySenderStrategy}});Object.defineProperty(q,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return Xw.SharedArrayReceiverStrategy}});var Cg=Lw();Object.defineProperty(q,"MessageReader",{enumerable:!0,get:function(){return Cg.MessageReader}});Object.defineProperty(q,"AbstractMessageReader",{enumerable:!0,get:function(){return Cg.AbstractMessageReader}});Object.defineProperty(q,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return Cg.ReadableStreamMessageReader}});var Og=$w();Object.defineProperty(q,"MessageWriter",{enumerable:!0,get:function(){return Og.MessageWriter}});Object.defineProperty(q,"AbstractMessageWriter",{enumerable:!0,get:function(){return Og.AbstractMessageWriter}});Object.defineProperty(q,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return Og.WriteableStreamMessageWriter}});var sD=Bw();Object.defineProperty(q,"AbstractMessageBuffer",{enumerable:!0,get:function(){return sD.AbstractMessageBuffer}});var Vt=zw();Object.defineProperty(q,"ConnectionStrategy",{enumerable:!0,get:function(){return Vt.ConnectionStrategy}});Object.defineProperty(q,"ConnectionOptions",{enumerable:!0,get:function(){return Vt.ConnectionOptions}});Object.defineProperty(q,"NullLogger",{enumerable:!0,get:function(){return Vt.NullLogger}});Object.defineProperty(q,"createMessageConnection",{enumerable:!0,get:function(){return Vt.createMessageConnection}});Object.defineProperty(q,"ProgressToken",{enumerable:!0,get:function(){return Vt.ProgressToken}});Object.defineProperty(q,"ProgressType",{enumerable:!0,get:function(){return Vt.ProgressType}});Object.defineProperty(q,"Trace",{enumerable:!0,get:function(){return Vt.Trace}});Object.defineProperty(q,"TraceValues",{enumerable:!0,get:function(){return Vt.TraceValues}});Object.defineProperty(q,"TraceFormat",{enumerable:!0,get:function(){return Vt.TraceFormat}});Object.defineProperty(q,"SetTraceNotification",{enumerable:!0,get:function(){return Vt.SetTraceNotification}});Object.defineProperty(q,"LogTraceNotification",{enumerable:!0,get:function(){return Vt.LogTraceNotification}});Object.defineProperty(q,"ConnectionErrors",{enumerable:!0,get:function(){return Vt.ConnectionErrors}});Object.defineProperty(q,"ConnectionError",{enumerable:!0,get:function(){return Vt.ConnectionError}});Object.defineProperty(q,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Vt.CancellationReceiverStrategy}});Object.defineProperty(q,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Vt.CancellationSenderStrategy}});Object.defineProperty(q,"CancellationStrategy",{enumerable:!0,get:function(){return Vt.CancellationStrategy}});Object.defineProperty(q,"MessageStrategy",{enumerable:!0,get:function(){return Vt.MessageStrategy}});var oD=Ai();q.RAL=oD.default});var Qw=m(Ig=>{"use strict";Object.defineProperty(Ig,"__esModule",{value:!0});var Yw=require("util"),oi=tl(),nl=class t extends oi.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 Yw.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)}};nl.emptyBuffer=Buffer.allocUnsafe(0);var Rg=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),oi.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),oi.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),oi.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),oi.Disposable.create(()=>this.stream.off("data",e))}},Pg=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),oi.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),oi.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),oi.Disposable.create(()=>this.stream.off("end",e))}write(e,n){return new Promise((r,i)=>{let s=o=>{o==null?r():i(o)};typeof e=="string"?this.stream.write(e,n,s):this.stream.write(e,s)})}end(){this.stream.end()}},Jw=Object.freeze({messageBuffer:Object.freeze({create:t=>new nl(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 Yw.TextDecoder(e.charset).decode(t)))}catch(n){return Promise.reject(n)}}})}),stream:Object.freeze({asReadableStream:t=>new Rg(t),asWritableStream:t=>new Pg(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 Dg(){return Jw}(function(t){function e(){oi.RAL.install(Jw)}t.install=e})(Dg||(Dg={}));Ig.default=Dg});var gs=m(Oe=>{"use strict";var aD=Oe&&Oe.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),uD=Oe&&Oe.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&aD(e,t,n)};Object.defineProperty(Oe,"__esModule",{value:!0});Oe.createMessageConnection=Oe.createServerSocketTransport=Oe.createClientSocketTransport=Oe.createServerPipeTransport=Oe.createClientPipeTransport=Oe.generateRandomPipeName=Oe.StreamMessageWriter=Oe.StreamMessageReader=Oe.SocketMessageWriter=Oe.SocketMessageReader=Oe.PortMessageWriter=Oe.PortMessageReader=Oe.IPCMessageWriter=Oe.IPCMessageReader=void 0;var ho=Qw();ho.default.install();var Zw=require("path"),cD=require("os"),lD=require("crypto"),sl=require("net"),Rn=tl();uD(tl(),Oe);var Mg=class extends Rn.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),Rn.Disposable.create(()=>this.process.off("message",e))}};Oe.IPCMessageReader=Mg;var Lg=class extends Rn.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(){}};Oe.IPCMessageWriter=Lg;var Ng=class extends Rn.AbstractMessageReader{constructor(e){super(),this.onData=new Rn.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)}};Oe.PortMessageReader=Ng;var qg=class extends Rn.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(){}};Oe.PortMessageWriter=qg;var fs=class extends Rn.ReadableStreamMessageReader{constructor(e,n="utf-8"){super((0,ho.default)().stream.asReadableStream(e),n)}};Oe.SocketMessageReader=fs;var ps=class extends Rn.WriteableStreamMessageWriter{constructor(e,n){super((0,ho.default)().stream.asWritableStream(e),n),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};Oe.SocketMessageWriter=ps;var rl=class extends Rn.ReadableStreamMessageReader{constructor(e,n){super((0,ho.default)().stream.asReadableStream(e),n)}};Oe.StreamMessageReader=rl;var il=class extends Rn.WriteableStreamMessageWriter{constructor(e,n){super((0,ho.default)().stream.asWritableStream(e),n)}};Oe.StreamMessageWriter=il;var eT=process.env.XDG_RUNTIME_DIR,hD=new Map([["linux",107],["darwin",103]]);function dD(){let t=(0,lD.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;eT?e=Zw.join(eT,`vscode-ipc-${t}.sock`):e=Zw.join(cD.tmpdir(),`vscode-${t}.sock`);let n=hD.get(process.platform);return n!==void 0&&e.length>n&&(0,ho.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${n} characters.`),e}Oe.generateRandomPipeName=dD;function fD(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,sl.createServer)(a=>{o.close(),n([new fs(a,e),new ps(a,e)])});o.on("error",s),o.listen(t,()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}Oe.createClientPipeTransport=fD;function pD(t,e="utf-8"){let n=(0,sl.createConnection)(t);return[new fs(n,e),new ps(n,e)]}Oe.createServerPipeTransport=pD;function gD(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,sl.createServer)(a=>{o.close(),n([new fs(a,e),new ps(a,e)])});o.on("error",s),o.listen(t,"127.0.0.1",()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}Oe.createClientSocketTransport=gD;function mD(t,e="utf-8"){let n=(0,sl.createConnection)(t,"127.0.0.1");return[new fs(n,e),new ps(n,e)]}Oe.createServerSocketTransport=mD;function yD(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function bD(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function _D(t,e,n,r){n||(n=Rn.NullLogger);let i=yD(t)?new rl(t):t,s=bD(e)?new il(e):e;return Rn.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,Rn.createMessageConnection)(i,s,n,r)}Oe.createMessageConnection=_D});var jg=m((YH,tT)=>{"use strict";tT.exports=gs()});var al=m((nT,ol)=>{(function(t){if(typeof ol=="object"&&typeof ol.exports=="object"){var e=t(require,nT);e!==void 0&&(ol.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(p){function x(A){return typeof A=="string"}p.is=x})(n||(e.DocumentUri=n={}));var r;(function(p){function x(A){return typeof A=="string"}p.is=x})(r||(e.URI=r={}));var i;(function(p){p.MIN_VALUE=-2147483648,p.MAX_VALUE=2147483647;function x(A){return typeof A=="number"&&p.MIN_VALUE<=A&&A<=p.MAX_VALUE}p.is=x})(i||(e.integer=i={}));var s;(function(p){p.MIN_VALUE=0,p.MAX_VALUE=2147483647;function x(A){return typeof A=="number"&&p.MIN_VALUE<=A&&A<=p.MAX_VALUE}p.is=x})(s||(e.uinteger=s={}));var o;(function(p){function x(b,f){return b===Number.MAX_VALUE&&(b=s.MAX_VALUE),f===Number.MAX_VALUE&&(f=s.MAX_VALUE),{line:b,character:f}}p.create=x;function A(b){var f=b;return I.objectLiteral(f)&&I.uinteger(f.line)&&I.uinteger(f.character)}p.is=A})(o||(e.Position=o={}));var a;(function(p){function x(b,f,D,$){if(I.uinteger(b)&&I.uinteger(f)&&I.uinteger(D)&&I.uinteger($))return{start:o.create(b,f),end:o.create(D,$)};if(o.is(b)&&o.is(f))return{start:b,end:f};throw new Error("Range#create called with invalid arguments[".concat(b,", ").concat(f,", ").concat(D,", ").concat($,"]"))}p.create=x;function A(b){var f=b;return I.objectLiteral(f)&&o.is(f.start)&&o.is(f.end)}p.is=A})(a||(e.Range=a={}));var u;(function(p){function x(b,f){return{uri:b,range:f}}p.create=x;function A(b){var f=b;return I.objectLiteral(f)&&a.is(f.range)&&(I.string(f.uri)||I.undefined(f.uri))}p.is=A})(u||(e.Location=u={}));var c;(function(p){function x(b,f,D,$){return{targetUri:b,targetRange:f,targetSelectionRange:D,originSelectionRange:$}}p.create=x;function A(b){var f=b;return I.objectLiteral(f)&&a.is(f.targetRange)&&I.string(f.targetUri)&&a.is(f.targetSelectionRange)&&(a.is(f.originSelectionRange)||I.undefined(f.originSelectionRange))}p.is=A})(c||(e.LocationLink=c={}));var l;(function(p){function x(b,f,D,$){return{red:b,green:f,blue:D,alpha:$}}p.create=x;function A(b){var f=b;return I.objectLiteral(f)&&I.numberRange(f.red,0,1)&&I.numberRange(f.green,0,1)&&I.numberRange(f.blue,0,1)&&I.numberRange(f.alpha,0,1)}p.is=A})(l||(e.Color=l={}));var h;(function(p){function x(b,f){return{range:b,color:f}}p.create=x;function A(b){var f=b;return I.objectLiteral(f)&&a.is(f.range)&&l.is(f.color)}p.is=A})(h||(e.ColorInformation=h={}));var d;(function(p){function x(b,f,D){return{label:b,textEdit:f,additionalTextEdits:D}}p.create=x;function A(b){var f=b;return I.objectLiteral(f)&&I.string(f.label)&&(I.undefined(f.textEdit)||L.is(f))&&(I.undefined(f.additionalTextEdits)||I.typedArray(f.additionalTextEdits,L.is))}p.is=A})(d||(e.ColorPresentation=d={}));var g;(function(p){p.Comment="comment",p.Imports="imports",p.Region="region"})(g||(e.FoldingRangeKind=g={}));var y;(function(p){function x(b,f,D,$,me,dt){var Ke={startLine:b,endLine:f};return I.defined(D)&&(Ke.startCharacter=D),I.defined($)&&(Ke.endCharacter=$),I.defined(me)&&(Ke.kind=me),I.defined(dt)&&(Ke.collapsedText=dt),Ke}p.create=x;function A(b){var f=b;return I.objectLiteral(f)&&I.uinteger(f.startLine)&&I.uinteger(f.startLine)&&(I.undefined(f.startCharacter)||I.uinteger(f.startCharacter))&&(I.undefined(f.endCharacter)||I.uinteger(f.endCharacter))&&(I.undefined(f.kind)||I.string(f.kind))}p.is=A})(y||(e.FoldingRange=y={}));var _;(function(p){function x(b,f){return{location:b,message:f}}p.create=x;function A(b){var f=b;return I.defined(f)&&u.is(f.location)&&I.string(f.message)}p.is=A})(_||(e.DiagnosticRelatedInformation=_={}));var C;(function(p){p.Error=1,p.Warning=2,p.Information=3,p.Hint=4})(C||(e.DiagnosticSeverity=C={}));var k;(function(p){p.Unnecessary=1,p.Deprecated=2})(k||(e.DiagnosticTag=k={}));var T;(function(p){function x(A){var b=A;return I.objectLiteral(b)&&I.string(b.href)}p.is=x})(T||(e.CodeDescription=T={}));var w;(function(p){function x(b,f,D,$,me,dt){var Ke={range:b,message:f};return I.defined(D)&&(Ke.severity=D),I.defined($)&&(Ke.code=$),I.defined(me)&&(Ke.source=me),I.defined(dt)&&(Ke.relatedInformation=dt),Ke}p.create=x;function A(b){var f,D=b;return I.defined(D)&&a.is(D.range)&&I.string(D.message)&&(I.number(D.severity)||I.undefined(D.severity))&&(I.integer(D.code)||I.string(D.code)||I.undefined(D.code))&&(I.undefined(D.codeDescription)||I.string((f=D.codeDescription)===null||f===void 0?void 0:f.href))&&(I.string(D.source)||I.undefined(D.source))&&(I.undefined(D.relatedInformation)||I.typedArray(D.relatedInformation,_.is))}p.is=A})(w||(e.Diagnostic=w={}));var v;(function(p){function x(b,f){for(var D=[],$=2;$<arguments.length;$++)D[$-2]=arguments[$];var me={title:b,command:f};return I.defined(D)&&D.length>0&&(me.arguments=D),me}p.create=x;function A(b){var f=b;return I.defined(f)&&I.string(f.title)&&I.string(f.command)}p.is=A})(v||(e.Command=v={}));var L;(function(p){function x(D,$){return{range:D,newText:$}}p.replace=x;function A(D,$){return{range:{start:D,end:D},newText:$}}p.insert=A;function b(D){return{range:D,newText:""}}p.del=b;function f(D){var $=D;return I.objectLiteral($)&&I.string($.newText)&&a.is($.range)}p.is=f})(L||(e.TextEdit=L={}));var R;(function(p){function x(b,f,D){var $={label:b};return f!==void 0&&($.needsConfirmation=f),D!==void 0&&($.description=D),$}p.create=x;function A(b){var f=b;return I.objectLiteral(f)&&I.string(f.label)&&(I.boolean(f.needsConfirmation)||f.needsConfirmation===void 0)&&(I.string(f.description)||f.description===void 0)}p.is=A})(R||(e.ChangeAnnotation=R={}));var W;(function(p){function x(A){var b=A;return I.string(b)}p.is=x})(W||(e.ChangeAnnotationIdentifier=W={}));var ne;(function(p){function x(D,$,me){return{range:D,newText:$,annotationId:me}}p.replace=x;function A(D,$,me){return{range:{start:D,end:D},newText:$,annotationId:me}}p.insert=A;function b(D,$){return{range:D,newText:"",annotationId:$}}p.del=b;function f(D){var $=D;return L.is($)&&(R.is($.annotationId)||W.is($.annotationId))}p.is=f})(ne||(e.AnnotatedTextEdit=ne={}));var se;(function(p){function x(b,f){return{textDocument:b,edits:f}}p.create=x;function A(b){var f=b;return I.defined(f)&&$e.is(f.textDocument)&&Array.isArray(f.edits)}p.is=A})(se||(e.TextDocumentEdit=se={}));var U;(function(p){function x(b,f,D){var $={kind:"create",uri:b};return f!==void 0&&(f.overwrite!==void 0||f.ignoreIfExists!==void 0)&&($.options=f),D!==void 0&&($.annotationId=D),$}p.create=x;function A(b){var f=b;return f&&f.kind==="create"&&I.string(f.uri)&&(f.options===void 0||(f.options.overwrite===void 0||I.boolean(f.options.overwrite))&&(f.options.ignoreIfExists===void 0||I.boolean(f.options.ignoreIfExists)))&&(f.annotationId===void 0||W.is(f.annotationId))}p.is=A})(U||(e.CreateFile=U={}));var O;(function(p){function x(b,f,D,$){var me={kind:"rename",oldUri:b,newUri:f};return D!==void 0&&(D.overwrite!==void 0||D.ignoreIfExists!==void 0)&&(me.options=D),$!==void 0&&(me.annotationId=$),me}p.create=x;function A(b){var f=b;return f&&f.kind==="rename"&&I.string(f.oldUri)&&I.string(f.newUri)&&(f.options===void 0||(f.options.overwrite===void 0||I.boolean(f.options.overwrite))&&(f.options.ignoreIfExists===void 0||I.boolean(f.options.ignoreIfExists)))&&(f.annotationId===void 0||W.is(f.annotationId))}p.is=A})(O||(e.RenameFile=O={}));var M;(function(p){function x(b,f,D){var $={kind:"delete",uri:b};return f!==void 0&&(f.recursive!==void 0||f.ignoreIfNotExists!==void 0)&&($.options=f),D!==void 0&&($.annotationId=D),$}p.create=x;function A(b){var f=b;return f&&f.kind==="delete"&&I.string(f.uri)&&(f.options===void 0||(f.options.recursive===void 0||I.boolean(f.options.recursive))&&(f.options.ignoreIfNotExists===void 0||I.boolean(f.options.ignoreIfNotExists)))&&(f.annotationId===void 0||W.is(f.annotationId))}p.is=A})(M||(e.DeleteFile=M={}));var N;(function(p){function x(A){var b=A;return b&&(b.changes!==void 0||b.documentChanges!==void 0)&&(b.documentChanges===void 0||b.documentChanges.every(function(f){return I.string(f.kind)?U.is(f)||O.is(f)||M.is(f):se.is(f)}))}p.is=x})(N||(e.WorkspaceEdit=N={}));var j=function(){function p(x,A){this.edits=x,this.changeAnnotations=A}return p.prototype.insert=function(x,A,b){var f,D;if(b===void 0?f=L.insert(x,A):W.is(b)?(D=b,f=ne.insert(x,A,b)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(b),f=ne.insert(x,A,D)),this.edits.push(f),D!==void 0)return D},p.prototype.replace=function(x,A,b){var f,D;if(b===void 0?f=L.replace(x,A):W.is(b)?(D=b,f=ne.replace(x,A,b)):(this.assertChangeAnnotations(this.changeAnnotations),D=this.changeAnnotations.manage(b),f=ne.replace(x,A,D)),this.edits.push(f),D!==void 0)return D},p.prototype.delete=function(x,A){var b,f;if(A===void 0?b=L.del(x):W.is(A)?(f=A,b=ne.del(x,A)):(this.assertChangeAnnotations(this.changeAnnotations),f=this.changeAnnotations.manage(A),b=ne.del(x,f)),this.edits.push(b),f!==void 0)return f},p.prototype.add=function(x){this.edits.push(x)},p.prototype.all=function(){return this.edits},p.prototype.clear=function(){this.edits.splice(0,this.edits.length)},p.prototype.assertChangeAnnotations=function(x){if(x===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},p}(),fe=function(){function p(x){this._annotations=x===void 0?Object.create(null):x,this._counter=0,this._size=0}return p.prototype.all=function(){return this._annotations},Object.defineProperty(p.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),p.prototype.manage=function(x,A){var b;if(W.is(x)?b=x:(b=this.nextId(),A=x),this._annotations[b]!==void 0)throw new Error("Id ".concat(b," is already in use."));if(A===void 0)throw new Error("No annotation provided for id ".concat(b));return this._annotations[b]=A,this._size++,b},p.prototype.nextId=function(){return this._counter++,this._counter.toString()},p}(),he=function(){function p(x){var A=this;this._textEditChanges=Object.create(null),x!==void 0?(this._workspaceEdit=x,x.documentChanges?(this._changeAnnotations=new fe(x.changeAnnotations),x.changeAnnotations=this._changeAnnotations.all(),x.documentChanges.forEach(function(b){if(se.is(b)){var f=new j(b.edits,A._changeAnnotations);A._textEditChanges[b.textDocument.uri]=f}})):x.changes&&Object.keys(x.changes).forEach(function(b){var f=new j(x.changes[b]);A._textEditChanges[b]=f})):this._workspaceEdit={}}return Object.defineProperty(p.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}),p.prototype.getTextEditChange=function(x){if($e.is(x)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var A={uri:x.uri,version:x.version},b=this._textEditChanges[A.uri];if(!b){var f=[],D={textDocument:A,edits:f};this._workspaceEdit.documentChanges.push(D),b=new j(f,this._changeAnnotations),this._textEditChanges[A.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[x];if(!b){var f=[];this._workspaceEdit.changes[x]=f,b=new j(f),this._textEditChanges[x]=b}return b}},p.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new fe,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},p.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},p.prototype.createFile=function(x,A,b){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var f;R.is(A)||W.is(A)?f=A:b=A;var D,$;if(f===void 0?D=U.create(x,b):($=W.is(f)?f:this._changeAnnotations.manage(f),D=U.create(x,b,$)),this._workspaceEdit.documentChanges.push(D),$!==void 0)return $},p.prototype.renameFile=function(x,A,b,f){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var D;R.is(b)||W.is(b)?D=b:f=b;var $,me;if(D===void 0?$=O.create(x,A,f):(me=W.is(D)?D:this._changeAnnotations.manage(D),$=O.create(x,A,f,me)),this._workspaceEdit.documentChanges.push($),me!==void 0)return me},p.prototype.deleteFile=function(x,A,b){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var f;R.is(A)||W.is(A)?f=A:b=A;var D,$;if(f===void 0?D=M.create(x,b):($=W.is(f)?f:this._changeAnnotations.manage(f),D=M.create(x,b,$)),this._workspaceEdit.documentChanges.push(D),$!==void 0)return $},p}();e.WorkspaceChange=he;var jt;(function(p){function x(b){return{uri:b}}p.create=x;function A(b){var f=b;return I.defined(f)&&I.string(f.uri)}p.is=A})(jt||(e.TextDocumentIdentifier=jt={}));var _t;(function(p){function x(b,f){return{uri:b,version:f}}p.create=x;function A(b){var f=b;return I.defined(f)&&I.string(f.uri)&&I.integer(f.version)}p.is=A})(_t||(e.VersionedTextDocumentIdentifier=_t={}));var $e;(function(p){function x(b,f){return{uri:b,version:f}}p.create=x;function A(b){var f=b;return I.defined(f)&&I.string(f.uri)&&(f.version===null||I.integer(f.version))}p.is=A})($e||(e.OptionalVersionedTextDocumentIdentifier=$e={}));var _n;(function(p){function x(b,f,D,$){return{uri:b,languageId:f,version:D,text:$}}p.create=x;function A(b){var f=b;return I.defined(f)&&I.string(f.uri)&&I.string(f.languageId)&&I.integer(f.version)&&I.string(f.text)}p.is=A})(_n||(e.TextDocumentItem=_n={}));var Zs;(function(p){p.PlainText="plaintext",p.Markdown="markdown";function x(A){var b=A;return b===p.PlainText||b===p.Markdown}p.is=x})(Zs||(e.MarkupKind=Zs={}));var ls;(function(p){function x(A){var b=A;return I.objectLiteral(A)&&Zs.is(b.kind)&&I.string(b.value)}p.is=x})(ls||(e.MarkupContent=ls={}));var Ec;(function(p){p.Text=1,p.Method=2,p.Function=3,p.Constructor=4,p.Field=5,p.Variable=6,p.Class=7,p.Interface=8,p.Module=9,p.Property=10,p.Unit=11,p.Value=12,p.Enum=13,p.Keyword=14,p.Snippet=15,p.Color=16,p.File=17,p.Reference=18,p.Folder=19,p.EnumMember=20,p.Constant=21,p.Struct=22,p.Event=23,p.Operator=24,p.TypeParameter=25})(Ec||(e.CompletionItemKind=Ec={}));var Ea;(function(p){p.PlainText=1,p.Snippet=2})(Ea||(e.InsertTextFormat=Ea={}));var xa;(function(p){p.Deprecated=1})(xa||(e.CompletionItemTag=xa={}));var xc;(function(p){function x(b,f,D){return{newText:b,insert:f,replace:D}}p.create=x;function A(b){var f=b;return f&&I.string(f.newText)&&a.is(f.insert)&&a.is(f.replace)}p.is=A})(xc||(e.InsertReplaceEdit=xc={}));var kc;(function(p){p.asIs=1,p.adjustIndentation=2})(kc||(e.InsertTextMode=kc={}));var Ac;(function(p){function x(A){var b=A;return b&&(I.string(b.detail)||b.detail===void 0)&&(I.string(b.description)||b.description===void 0)}p.is=x})(Ac||(e.CompletionItemLabelDetails=Ac={}));var Cc;(function(p){function x(A){return{label:A}}p.create=x})(Cc||(e.CompletionItem=Cc={}));var Oc;(function(p){function x(A,b){return{items:A||[],isIncomplete:!!b}}p.create=x})(Oc||(e.CompletionList=Oc={}));var eo;(function(p){function x(b){return b.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}p.fromPlainText=x;function A(b){var f=b;return I.string(f)||I.objectLiteral(f)&&I.string(f.language)&&I.string(f.value)}p.is=A})(eo||(e.MarkedString=eo={}));var fr;(function(p){function x(A){var b=A;return!!b&&I.objectLiteral(b)&&(ls.is(b.contents)||eo.is(b.contents)||I.typedArray(b.contents,eo.is))&&(A.range===void 0||a.is(A.range))}p.is=x})(fr||(e.Hover=fr={}));var Rc;(function(p){function x(A,b){return b?{label:A,documentation:b}:{label:A}}p.create=x})(Rc||(e.ParameterInformation=Rc={}));var Pc;(function(p){function x(A,b){for(var f=[],D=2;D<arguments.length;D++)f[D-2]=arguments[D];var $={label:A};return I.defined(b)&&($.documentation=b),I.defined(f)?$.parameters=f:$.parameters=[],$}p.create=x})(Pc||(e.SignatureInformation=Pc={}));var hs;(function(p){p.Text=1,p.Read=2,p.Write=3})(hs||(e.DocumentHighlightKind=hs={}));var Dc;(function(p){function x(A,b){var f={range:A};return I.number(b)&&(f.kind=b),f}p.create=x})(Dc||(e.DocumentHighlight=Dc={}));var to;(function(p){p.File=1,p.Module=2,p.Namespace=3,p.Package=4,p.Class=5,p.Method=6,p.Property=7,p.Field=8,p.Constructor=9,p.Enum=10,p.Interface=11,p.Function=12,p.Variable=13,p.Constant=14,p.String=15,p.Number=16,p.Boolean=17,p.Array=18,p.Object=19,p.Key=20,p.Null=21,p.EnumMember=22,p.Struct=23,p.Event=24,p.Operator=25,p.TypeParameter=26})(to||(e.SymbolKind=to={}));var Ic;(function(p){p.Deprecated=1})(Ic||(e.SymbolTag=Ic={}));var ri;(function(p){function x(A,b,f,D,$){var me={name:A,kind:b,location:{uri:D,range:f}};return $&&(me.containerName=$),me}p.create=x})(ri||(e.SymbolInformation=ri={}));var xi;(function(p){function x(A,b,f,D){return D!==void 0?{name:A,kind:b,location:{uri:f,range:D}}:{name:A,kind:b,location:{uri:f}}}p.create=x})(xi||(e.WorkspaceSymbol=xi={}));var Mc;(function(p){function x(b,f,D,$,me,dt){var Ke={name:b,detail:f,kind:D,range:$,selectionRange:me};return dt!==void 0&&(Ke.children=dt),Ke}p.create=x;function A(b){var f=b;return f&&I.string(f.name)&&I.number(f.kind)&&a.is(f.range)&&a.is(f.selectionRange)&&(f.detail===void 0||I.string(f.detail))&&(f.deprecated===void 0||I.boolean(f.deprecated))&&(f.children===void 0||Array.isArray(f.children))&&(f.tags===void 0||Array.isArray(f.tags))}p.is=A})(Mc||(e.DocumentSymbol=Mc={}));var Lc;(function(p){p.Empty="",p.QuickFix="quickfix",p.Refactor="refactor",p.RefactorExtract="refactor.extract",p.RefactorInline="refactor.inline",p.RefactorRewrite="refactor.rewrite",p.Source="source",p.SourceOrganizeImports="source.organizeImports",p.SourceFixAll="source.fixAll"})(Lc||(e.CodeActionKind=Lc={}));var Dr;(function(p){p.Invoked=1,p.Automatic=2})(Dr||(e.CodeActionTriggerKind=Dr={}));var ka;(function(p){function x(b,f,D){var $={diagnostics:b};return f!=null&&($.only=f),D!=null&&($.triggerKind=D),$}p.create=x;function A(b){var f=b;return I.defined(f)&&I.typedArray(f.diagnostics,w.is)&&(f.only===void 0||I.typedArray(f.only,I.string))&&(f.triggerKind===void 0||f.triggerKind===Dr.Invoked||f.triggerKind===Dr.Automatic)}p.is=A})(ka||(e.CodeActionContext=ka={}));var Aa;(function(p){function x(b,f,D){var $={title:b},me=!0;return typeof f=="string"?(me=!1,$.kind=f):v.is(f)?$.command=f:$.edit=f,me&&D!==void 0&&($.kind=D),$}p.create=x;function A(b){var f=b;return f&&I.string(f.title)&&(f.diagnostics===void 0||I.typedArray(f.diagnostics,w.is))&&(f.kind===void 0||I.string(f.kind))&&(f.edit!==void 0||f.command!==void 0)&&(f.command===void 0||v.is(f.command))&&(f.isPreferred===void 0||I.boolean(f.isPreferred))&&(f.edit===void 0||N.is(f.edit))}p.is=A})(Aa||(e.CodeAction=Aa={}));var no;(function(p){function x(b,f){var D={range:b};return I.defined(f)&&(D.data=f),D}p.create=x;function A(b){var f=b;return I.defined(f)&&a.is(f.range)&&(I.undefined(f.command)||v.is(f.command))}p.is=A})(no||(e.CodeLens=no={}));var Ca;(function(p){function x(b,f){return{tabSize:b,insertSpaces:f}}p.create=x;function A(b){var f=b;return I.defined(f)&&I.uinteger(f.tabSize)&&I.boolean(f.insertSpaces)}p.is=A})(Ca||(e.FormattingOptions=Ca={}));var ii;(function(p){function x(b,f,D){return{range:b,target:f,data:D}}p.create=x;function A(b){var f=b;return I.defined(f)&&a.is(f.range)&&(I.undefined(f.target)||I.string(f.target))}p.is=A})(ii||(e.DocumentLink=ii={}));var E;(function(p){function x(b,f){return{range:b,parent:f}}p.create=x;function A(b){var f=b;return I.objectLiteral(f)&&a.is(f.range)&&(f.parent===void 0||p.is(f.parent))}p.is=A})(E||(e.SelectionRange=E={}));var F;(function(p){p.namespace="namespace",p.type="type",p.class="class",p.enum="enum",p.interface="interface",p.struct="struct",p.typeParameter="typeParameter",p.parameter="parameter",p.variable="variable",p.property="property",p.enumMember="enumMember",p.event="event",p.function="function",p.method="method",p.macro="macro",p.keyword="keyword",p.modifier="modifier",p.comment="comment",p.string="string",p.number="number",p.regexp="regexp",p.operator="operator",p.decorator="decorator"})(F||(e.SemanticTokenTypes=F={}));var G;(function(p){p.declaration="declaration",p.definition="definition",p.readonly="readonly",p.static="static",p.deprecated="deprecated",p.abstract="abstract",p.async="async",p.modification="modification",p.documentation="documentation",p.defaultLibrary="defaultLibrary"})(G||(e.SemanticTokenModifiers=G={}));var Q;(function(p){function x(A){var b=A;return I.objectLiteral(b)&&(b.resultId===void 0||typeof b.resultId=="string")&&Array.isArray(b.data)&&(b.data.length===0||typeof b.data[0]=="number")}p.is=x})(Q||(e.SemanticTokens=Q={}));var He;(function(p){function x(b,f){return{range:b,text:f}}p.create=x;function A(b){var f=b;return f!=null&&a.is(f.range)&&I.string(f.text)}p.is=A})(He||(e.InlineValueText=He={}));var qe;(function(p){function x(b,f,D){return{range:b,variableName:f,caseSensitiveLookup:D}}p.create=x;function A(b){var f=b;return f!=null&&a.is(f.range)&&I.boolean(f.caseSensitiveLookup)&&(I.string(f.variableName)||f.variableName===void 0)}p.is=A})(qe||(e.InlineValueVariableLookup=qe={}));var Xe;(function(p){function x(b,f){return{range:b,expression:f}}p.create=x;function A(b){var f=b;return f!=null&&a.is(f.range)&&(I.string(f.expression)||f.expression===void 0)}p.is=A})(Xe||(e.InlineValueEvaluatableExpression=Xe={}));var tt;(function(p){function x(b,f){return{frameId:b,stoppedLocation:f}}p.create=x;function A(b){var f=b;return I.defined(f)&&a.is(b.stoppedLocation)}p.is=A})(tt||(e.InlineValueContext=tt={}));var xe;(function(p){p.Type=1,p.Parameter=2;function x(A){return A===1||A===2}p.is=x})(xe||(e.InlayHintKind=xe={}));var Ge;(function(p){function x(b){return{value:b}}p.create=x;function A(b){var f=b;return I.objectLiteral(f)&&(f.tooltip===void 0||I.string(f.tooltip)||ls.is(f.tooltip))&&(f.location===void 0||u.is(f.location))&&(f.command===void 0||v.is(f.command))}p.is=A})(Ge||(e.InlayHintLabelPart=Ge={}));var Ie;(function(p){function x(b,f,D){var $={position:b,label:f};return D!==void 0&&($.kind=D),$}p.create=x;function A(b){var f=b;return I.objectLiteral(f)&&o.is(f.position)&&(I.string(f.label)||I.typedArray(f.label,Ge.is))&&(f.kind===void 0||xe.is(f.kind))&&f.textEdits===void 0||I.typedArray(f.textEdits,L.is)&&(f.tooltip===void 0||I.string(f.tooltip)||ls.is(f.tooltip))&&(f.paddingLeft===void 0||I.boolean(f.paddingLeft))&&(f.paddingRight===void 0||I.boolean(f.paddingRight))}p.is=A})(Ie||(e.InlayHint=Ie={}));var ht;(function(p){function x(A){return{kind:"snippet",value:A}}p.createSnippet=x})(ht||(e.StringValue=ht={}));var Ft;(function(p){function x(A,b,f,D){return{insertText:A,filterText:b,range:f,command:D}}p.create=x})(Ft||(e.InlineCompletionItem=Ft={}));var Cn;(function(p){function x(A){return{items:A}}p.create=x})(Cn||(e.InlineCompletionList=Cn={}));var Nc;(function(p){p.Invoked=0,p.Automatic=1})(Nc||(e.InlineCompletionTriggerKind=Nc={}));var bw;(function(p){function x(A,b){return{range:A,text:b}}p.create=x})(bw||(e.SelectedCompletionInfo=bw={}));var _w;(function(p){function x(A,b){return{triggerKind:A,selectedCompletionInfo:b}}p.create=x})(_w||(e.InlineCompletionContext=_w={}));var vw;(function(p){function x(A){var b=A;return I.objectLiteral(b)&&r.is(b.uri)&&I.string(b.name)}p.is=x})(vw||(e.WorkspaceFolder=vw={})),e.EOL=[`
32
32
  `,`\r
33
- `,"\r"];var uw;(function(p){function x(D,$,me,ht){return new dP(D,$,me,ht)}p.create=x;function A(D){var $=D;return!!(I.defined($)&&I.string($.uri)&&(I.undefined($.languageId)||I.string($.languageId))&&I.uinteger($.lineCount)&&I.func($.getText)&&I.func($.positionAt)&&I.func($.offsetAt))}p.is=A;function b(D,$){for(var me=D.getText(),ht=f($,function(eo,Dc){var cw=eo.range.start.line-Dc.range.start.line;return cw===0?eo.range.start.character-Dc.range.start.character:cw}),Ke=me.length,dr=ht.length-1;dr>=0;dr--){var fr=ht[dr],ri=D.offsetAt(fr.range.start),xe=D.offsetAt(fr.range.end);if(xe<=Ke)me=me.substring(0,ri)+fr.newText+me.substring(xe,me.length);else throw new Error("Overlapping edit");Ke=ri}return me}p.applyEdits=b;function f(D,$){if(D.length<=1)return D;var me=D.length/2|0,ht=D.slice(0,me),Ke=D.slice(me);f(ht,$),f(Ke,$);for(var dr=0,fr=0,ri=0;dr<ht.length&&fr<Ke.length;){var xe=$(ht[dr],Ke[fr]);xe<=0?D[ri++]=ht[dr++]:D[ri++]=Ke[fr++]}for(;dr<ht.length;)D[ri++]=ht[dr++];for(;fr<Ke.length;)D[ri++]=Ke[fr++];return D}})(uw||(e.TextDocument=uw={}));var dP=function(){function p(x,A,b,f){this._uri=x,this._languageId=A,this._version=b,this._content=f,this._lineOffsets=void 0}return Object.defineProperty(p.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),p.prototype.getText=function(x){if(x){var A=this.offsetAt(x.start),b=this.offsetAt(x.end);return this._content.substring(A,b)}return this._content},p.prototype.update=function(x,A){this._content=x.text,this._version=A,this._lineOffsets=void 0},p.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var x=[],A=this._content,b=!0,f=0;f<A.length;f++){b&&(x.push(f),b=!1);var D=A.charAt(f);b=D==="\r"||D===`
33
+ `,"\r"];var Sw;(function(p){function x(D,$,me,dt){return new kP(D,$,me,dt)}p.create=x;function A(D){var $=D;return!!(I.defined($)&&I.string($.uri)&&(I.undefined($.languageId)||I.string($.languageId))&&I.uinteger($.lineCount)&&I.func($.getText)&&I.func($.positionAt)&&I.func($.offsetAt))}p.is=A;function b(D,$){for(var me=D.getText(),dt=f($,function(ro,qc){var ww=ro.range.start.line-qc.range.start.line;return ww===0?ro.range.start.character-qc.range.start.character:ww}),Ke=me.length,pr=dt.length-1;pr>=0;pr--){var gr=dt[pr],si=D.offsetAt(gr.range.start),Ce=D.offsetAt(gr.range.end);if(Ce<=Ke)me=me.substring(0,si)+gr.newText+me.substring(Ce,me.length);else throw new Error("Overlapping edit");Ke=si}return me}p.applyEdits=b;function f(D,$){if(D.length<=1)return D;var me=D.length/2|0,dt=D.slice(0,me),Ke=D.slice(me);f(dt,$),f(Ke,$);for(var pr=0,gr=0,si=0;pr<dt.length&&gr<Ke.length;){var Ce=$(dt[pr],Ke[gr]);Ce<=0?D[si++]=dt[pr++]:D[si++]=Ke[gr++]}for(;pr<dt.length;)D[si++]=dt[pr++];for(;gr<Ke.length;)D[si++]=Ke[gr++];return D}})(Sw||(e.TextDocument=Sw={}));var kP=function(){function p(x,A,b,f){this._uri=x,this._languageId=A,this._version=b,this._content=f,this._lineOffsets=void 0}return Object.defineProperty(p.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),p.prototype.getText=function(x){if(x){var A=this.offsetAt(x.start),b=this.offsetAt(x.end);return this._content.substring(A,b)}return this._content},p.prototype.update=function(x,A){this._content=x.text,this._version=A,this._lineOffsets=void 0},p.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var x=[],A=this._content,b=!0,f=0;f<A.length;f++){b&&(x.push(f),b=!1);var D=A.charAt(f);b=D==="\r"||D===`
34
34
  `,D==="\r"&&f+1<A.length&&A.charAt(f+1)===`
35
- `&&f++}b&&A.length>0&&x.push(A.length),this._lineOffsets=x}return this._lineOffsets},p.prototype.positionAt=function(x){x=Math.max(Math.min(x,this._content.length),0);var A=this.getLineOffsets(),b=0,f=A.length;if(f===0)return o.create(0,x);for(;b<f;){var D=Math.floor((b+f)/2);A[D]>x?f=D:b=D+1}var $=b-1;return o.create($,x-A[$])},p.prototype.offsetAt=function(x){var A=this.getLineOffsets();if(x.line>=A.length)return this._content.length;if(x.line<0)return 0;var b=A[x.line],f=x.line+1<A.length?A[x.line+1]:this._content.length;return Math.max(Math.min(b+x.character,f),b)},Object.defineProperty(p.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),p}(),I;(function(p){var x=Object.prototype.toString;function A(xe){return typeof xe<"u"}p.defined=A;function b(xe){return typeof xe>"u"}p.undefined=b;function f(xe){return xe===!0||xe===!1}p.boolean=f;function D(xe){return x.call(xe)==="[object String]"}p.string=D;function $(xe){return x.call(xe)==="[object Number]"}p.number=$;function me(xe,eo,Dc){return x.call(xe)==="[object Number]"&&eo<=xe&&xe<=Dc}p.numberRange=me;function ht(xe){return x.call(xe)==="[object Number]"&&-2147483648<=xe&&xe<=2147483647}p.integer=ht;function Ke(xe){return x.call(xe)==="[object Number]"&&0<=xe&&xe<=2147483647}p.uinteger=Ke;function dr(xe){return x.call(xe)==="[object Function]"}p.func=dr;function fr(xe){return xe!==null&&typeof xe=="object"}p.objectLiteral=fr;function ri(xe,eo){return Array.isArray(xe)&&xe.every(eo)}p.typedArray=ri})(I||(I={}))})});var nt=m(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.ProtocolNotificationType=_n.ProtocolNotificationType0=_n.ProtocolRequestType=_n.ProtocolRequestType0=_n.RegistrationType=_n.MessageDirection=void 0;var co=ls(),Hw;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(Hw||(_n.MessageDirection=Hw={}));var Pg=class{constructor(e){this.method=e}};_n.RegistrationType=Pg;var Dg=class extends co.RequestType0{constructor(e){super(e)}};_n.ProtocolRequestType0=Dg;var Ig=class extends co.RequestType{constructor(e){super(e,co.ParameterStructures.byName)}};_n.ProtocolRequestType=Ig;var Mg=class extends co.NotificationType0{constructor(e){super(e)}};_n.ProtocolNotificationType0=Mg;var Lg=class extends co.NotificationType{constructor(e){super(e,co.ParameterStructures.byName)}};_n.ProtocolNotificationType=Lg});var rl=m(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 oD(t){return t===!0||t===!1}kt.boolean=oD;function Gw(t){return typeof t=="string"||t instanceof String}kt.string=Gw;function aD(t){return typeof t=="number"||t instanceof Number}kt.number=aD;function uD(t){return t instanceof Error}kt.error=uD;function cD(t){return typeof t=="function"}kt.func=cD;function zw(t){return Array.isArray(t)}kt.array=zw;function lD(t){return zw(t)&&t.every(e=>Gw(e))}kt.stringArray=lD;function hD(t,e){return Array.isArray(t)&&t.every(e)}kt.typedArray=hD;function dD(t){return t!==null&&typeof t=="object"}kt.objectLiteral=dD});var Xw=m(il=>{"use strict";Object.defineProperty(il,"__esModule",{value:!0});il.ImplementationRequest=void 0;var Kw=nt(),Vw;(function(t){t.method="textDocument/implementation",t.messageDirection=Kw.MessageDirection.clientToServer,t.type=new Kw.ProtocolRequestType(t.method)})(Vw||(il.ImplementationRequest=Vw={}))});var Qw=m(sl=>{"use strict";Object.defineProperty(sl,"__esModule",{value:!0});sl.TypeDefinitionRequest=void 0;var Yw=nt(),Jw;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=Yw.MessageDirection.clientToServer,t.type=new Yw.ProtocolRequestType(t.method)})(Jw||(sl.TypeDefinitionRequest=Jw={}))});var tT=m(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.DidChangeWorkspaceFoldersNotification=lo.WorkspaceFoldersRequest=void 0;var ol=nt(),Zw;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=ol.MessageDirection.serverToClient,t.type=new ol.ProtocolRequestType0(t.method)})(Zw||(lo.WorkspaceFoldersRequest=Zw={}));var eT;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=ol.MessageDirection.clientToServer,t.type=new ol.ProtocolNotificationType(t.method)})(eT||(lo.DidChangeWorkspaceFoldersNotification=eT={}))});var iT=m(al=>{"use strict";Object.defineProperty(al,"__esModule",{value:!0});al.ConfigurationRequest=void 0;var nT=nt(),rT;(function(t){t.method="workspace/configuration",t.messageDirection=nT.MessageDirection.serverToClient,t.type=new nT.ProtocolRequestType(t.method)})(rT||(al.ConfigurationRequest=rT={}))});var aT=m(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.ColorPresentationRequest=ho.DocumentColorRequest=void 0;var ul=nt(),sT;(function(t){t.method="textDocument/documentColor",t.messageDirection=ul.MessageDirection.clientToServer,t.type=new ul.ProtocolRequestType(t.method)})(sT||(ho.DocumentColorRequest=sT={}));var oT;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=ul.MessageDirection.clientToServer,t.type=new ul.ProtocolRequestType(t.method)})(oT||(ho.ColorPresentationRequest=oT={}))});var lT=m(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.FoldingRangeRefreshRequest=fo.FoldingRangeRequest=void 0;var cl=nt(),uT;(function(t){t.method="textDocument/foldingRange",t.messageDirection=cl.MessageDirection.clientToServer,t.type=new cl.ProtocolRequestType(t.method)})(uT||(fo.FoldingRangeRequest=uT={}));var cT;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=cl.MessageDirection.serverToClient,t.type=new cl.ProtocolRequestType0(t.method)})(cT||(fo.FoldingRangeRefreshRequest=cT={}))});var fT=m(ll=>{"use strict";Object.defineProperty(ll,"__esModule",{value:!0});ll.DeclarationRequest=void 0;var hT=nt(),dT;(function(t){t.method="textDocument/declaration",t.messageDirection=hT.MessageDirection.clientToServer,t.type=new hT.ProtocolRequestType(t.method)})(dT||(ll.DeclarationRequest=dT={}))});var mT=m(hl=>{"use strict";Object.defineProperty(hl,"__esModule",{value:!0});hl.SelectionRangeRequest=void 0;var pT=nt(),gT;(function(t){t.method="textDocument/selectionRange",t.messageDirection=pT.MessageDirection.clientToServer,t.type=new pT.ProtocolRequestType(t.method)})(gT||(hl.SelectionRangeRequest=gT={}))});var vT=m(ki=>{"use strict";Object.defineProperty(ki,"__esModule",{value:!0});ki.WorkDoneProgressCancelNotification=ki.WorkDoneProgressCreateRequest=ki.WorkDoneProgress=void 0;var fD=ls(),dl=nt(),yT;(function(t){t.type=new fD.ProgressType;function e(n){return n===t.type}t.is=e})(yT||(ki.WorkDoneProgress=yT={}));var bT;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=dl.MessageDirection.serverToClient,t.type=new dl.ProtocolRequestType(t.method)})(bT||(ki.WorkDoneProgressCreateRequest=bT={}));var _T;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=dl.MessageDirection.clientToServer,t.type=new dl.ProtocolNotificationType(t.method)})(_T||(ki.WorkDoneProgressCancelNotification=_T={}))});var ET=m(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.CallHierarchyOutgoingCallsRequest=Ai.CallHierarchyIncomingCallsRequest=Ai.CallHierarchyPrepareRequest=void 0;var po=nt(),ST;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=po.MessageDirection.clientToServer,t.type=new po.ProtocolRequestType(t.method)})(ST||(Ai.CallHierarchyPrepareRequest=ST={}));var wT;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=po.MessageDirection.clientToServer,t.type=new po.ProtocolRequestType(t.method)})(wT||(Ai.CallHierarchyIncomingCallsRequest=wT={}));var TT;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=po.MessageDirection.clientToServer,t.type=new po.ProtocolRequestType(t.method)})(TT||(Ai.CallHierarchyOutgoingCallsRequest=TT={}))});var RT=m(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.SemanticTokensRefreshRequest=vn.SemanticTokensRangeRequest=vn.SemanticTokensDeltaRequest=vn.SemanticTokensRequest=vn.SemanticTokensRegistrationType=vn.TokenFormat=void 0;var si=nt(),xT;(function(t){t.Relative="relative"})(xT||(vn.TokenFormat=xT={}));var Ma;(function(t){t.method="textDocument/semanticTokens",t.type=new si.RegistrationType(t.method)})(Ma||(vn.SemanticTokensRegistrationType=Ma={}));var kT;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=si.MessageDirection.clientToServer,t.type=new si.ProtocolRequestType(t.method),t.registrationMethod=Ma.method})(kT||(vn.SemanticTokensRequest=kT={}));var AT;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=si.MessageDirection.clientToServer,t.type=new si.ProtocolRequestType(t.method),t.registrationMethod=Ma.method})(AT||(vn.SemanticTokensDeltaRequest=AT={}));var CT;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=si.MessageDirection.clientToServer,t.type=new si.ProtocolRequestType(t.method),t.registrationMethod=Ma.method})(CT||(vn.SemanticTokensRangeRequest=CT={}));var OT;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=si.MessageDirection.serverToClient,t.type=new si.ProtocolRequestType0(t.method)})(OT||(vn.SemanticTokensRefreshRequest=OT={}))});var IT=m(fl=>{"use strict";Object.defineProperty(fl,"__esModule",{value:!0});fl.ShowDocumentRequest=void 0;var PT=nt(),DT;(function(t){t.method="window/showDocument",t.messageDirection=PT.MessageDirection.serverToClient,t.type=new PT.ProtocolRequestType(t.method)})(DT||(fl.ShowDocumentRequest=DT={}))});var NT=m(pl=>{"use strict";Object.defineProperty(pl,"__esModule",{value:!0});pl.LinkedEditingRangeRequest=void 0;var MT=nt(),LT;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=MT.MessageDirection.clientToServer,t.type=new MT.ProtocolRequestType(t.method)})(LT||(pl.LinkedEditingRangeRequest=LT={}))});var HT=m(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.WillDeleteFilesRequest=Zt.DidDeleteFilesNotification=Zt.DidRenameFilesNotification=Zt.WillRenameFilesRequest=Zt.DidCreateFilesNotification=Zt.WillCreateFilesRequest=Zt.FileOperationPatternKind=void 0;var $n=nt(),qT;(function(t){t.file="file",t.folder="folder"})(qT||(Zt.FileOperationPatternKind=qT={}));var jT;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=$n.MessageDirection.clientToServer,t.type=new $n.ProtocolRequestType(t.method)})(jT||(Zt.WillCreateFilesRequest=jT={}));var FT;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=$n.MessageDirection.clientToServer,t.type=new $n.ProtocolNotificationType(t.method)})(FT||(Zt.DidCreateFilesNotification=FT={}));var $T;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=$n.MessageDirection.clientToServer,t.type=new $n.ProtocolRequestType(t.method)})($T||(Zt.WillRenameFilesRequest=$T={}));var BT;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=$n.MessageDirection.clientToServer,t.type=new $n.ProtocolNotificationType(t.method)})(BT||(Zt.DidRenameFilesNotification=BT={}));var UT;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=$n.MessageDirection.clientToServer,t.type=new $n.ProtocolNotificationType(t.method)})(UT||(Zt.DidDeleteFilesNotification=UT={}));var WT;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=$n.MessageDirection.clientToServer,t.type=new $n.ProtocolRequestType(t.method)})(WT||(Zt.WillDeleteFilesRequest=WT={}))});var XT=m(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.MonikerRequest=Ci.MonikerKind=Ci.UniquenessLevel=void 0;var GT=nt(),zT;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(zT||(Ci.UniquenessLevel=zT={}));var KT;(function(t){t.$import="import",t.$export="export",t.local="local"})(KT||(Ci.MonikerKind=KT={}));var VT;(function(t){t.method="textDocument/moniker",t.messageDirection=GT.MessageDirection.clientToServer,t.type=new GT.ProtocolRequestType(t.method)})(VT||(Ci.MonikerRequest=VT={}))});var ZT=m(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.TypeHierarchySubtypesRequest=Oi.TypeHierarchySupertypesRequest=Oi.TypeHierarchyPrepareRequest=void 0;var go=nt(),YT;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=go.MessageDirection.clientToServer,t.type=new go.ProtocolRequestType(t.method)})(YT||(Oi.TypeHierarchyPrepareRequest=YT={}));var JT;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=go.MessageDirection.clientToServer,t.type=new go.ProtocolRequestType(t.method)})(JT||(Oi.TypeHierarchySupertypesRequest=JT={}));var QT;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=go.MessageDirection.clientToServer,t.type=new go.ProtocolRequestType(t.method)})(QT||(Oi.TypeHierarchySubtypesRequest=QT={}))});var n0=m(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.InlineValueRefreshRequest=mo.InlineValueRequest=void 0;var gl=nt(),e0;(function(t){t.method="textDocument/inlineValue",t.messageDirection=gl.MessageDirection.clientToServer,t.type=new gl.ProtocolRequestType(t.method)})(e0||(mo.InlineValueRequest=e0={}));var t0;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=gl.MessageDirection.serverToClient,t.type=new gl.ProtocolRequestType0(t.method)})(t0||(mo.InlineValueRefreshRequest=t0={}))});var o0=m(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.InlayHintRefreshRequest=Ri.InlayHintResolveRequest=Ri.InlayHintRequest=void 0;var yo=nt(),r0;(function(t){t.method="textDocument/inlayHint",t.messageDirection=yo.MessageDirection.clientToServer,t.type=new yo.ProtocolRequestType(t.method)})(r0||(Ri.InlayHintRequest=r0={}));var i0;(function(t){t.method="inlayHint/resolve",t.messageDirection=yo.MessageDirection.clientToServer,t.type=new yo.ProtocolRequestType(t.method)})(i0||(Ri.InlayHintResolveRequest=i0={}));var s0;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=yo.MessageDirection.serverToClient,t.type=new yo.ProtocolRequestType0(t.method)})(s0||(Ri.InlayHintRefreshRequest=s0={}))});var f0=m(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.DiagnosticRefreshRequest=Bn.WorkspaceDiagnosticRequest=Bn.DocumentDiagnosticRequest=Bn.DocumentDiagnosticReportKind=Bn.DiagnosticServerCancellationData=void 0;var d0=ls(),pD=rl(),bo=nt(),a0;(function(t){function e(n){let r=n;return r&&pD.boolean(r.retriggerRequest)}t.is=e})(a0||(Bn.DiagnosticServerCancellationData=a0={}));var u0;(function(t){t.Full="full",t.Unchanged="unchanged"})(u0||(Bn.DocumentDiagnosticReportKind=u0={}));var c0;(function(t){t.method="textDocument/diagnostic",t.messageDirection=bo.MessageDirection.clientToServer,t.type=new bo.ProtocolRequestType(t.method),t.partialResult=new d0.ProgressType})(c0||(Bn.DocumentDiagnosticRequest=c0={}));var l0;(function(t){t.method="workspace/diagnostic",t.messageDirection=bo.MessageDirection.clientToServer,t.type=new bo.ProtocolRequestType(t.method),t.partialResult=new d0.ProgressType})(l0||(Bn.WorkspaceDiagnosticRequest=l0={}));var h0;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=bo.MessageDirection.serverToClient,t.type=new bo.ProtocolRequestType0(t.method)})(h0||(Bn.DiagnosticRefreshRequest=h0={}))});var v0=m(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.DidCloseNotebookDocumentNotification=dt.DidSaveNotebookDocumentNotification=dt.DidChangeNotebookDocumentNotification=dt.NotebookCellArrayChange=dt.DidOpenNotebookDocumentNotification=dt.NotebookDocumentSyncRegistrationType=dt.NotebookDocument=dt.NotebookCell=dt.ExecutionSummary=dt.NotebookCellKind=void 0;var La=nl(),gr=rl(),Pr=nt(),Ng;(function(t){t.Markup=1,t.Code=2;function e(n){return n===1||n===2}t.is=e})(Ng||(dt.NotebookCellKind=Ng={}));var qg;(function(t){function e(i,s){let o={executionOrder:i};return(s===!0||s===!1)&&(o.success=s),o}t.create=e;function n(i){let s=i;return gr.objectLiteral(s)&&La.uinteger.is(s.executionOrder)&&(s.success===void 0||gr.boolean(s.success))}t.is=n;function r(i,s){return i===s?!0:i==null||s===null||s===void 0?!1:i.executionOrder===s.executionOrder&&i.success===s.success}t.equals=r})(qg||(dt.ExecutionSummary=qg={}));var ml;(function(t){function e(s,o){return{kind:s,document:o}}t.create=e;function n(s){let o=s;return gr.objectLiteral(o)&&Ng.is(o.kind)&&La.DocumentUri.is(o.document)&&(o.metadata===void 0||gr.objectLiteral(o.metadata))}t.is=n;function r(s,o){let a=new Set;return s.document!==o.document&&a.add("document"),s.kind!==o.kind&&a.add("kind"),s.executionSummary!==o.executionSummary&&a.add("executionSummary"),(s.metadata!==void 0||o.metadata!==void 0)&&!i(s.metadata,o.metadata)&&a.add("metadata"),(s.executionSummary!==void 0||o.executionSummary!==void 0)&&!qg.equals(s.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}t.diff=r;function i(s,o){if(s===o)return!0;if(s==null||o===null||o===void 0||typeof s!=typeof o||typeof s!="object")return!1;let a=Array.isArray(s),u=Array.isArray(o);if(a!==u)return!1;if(a&&u){if(s.length!==o.length)return!1;for(let c=0;c<s.length;c++)if(!i(s[c],o[c]))return!1}if(gr.objectLiteral(s)&&gr.objectLiteral(o)){let c=Object.keys(s),l=Object.keys(o);if(c.length!==l.length||(c.sort(),l.sort(),!i(c,l)))return!1;for(let h=0;h<c.length;h++){let d=c[h];if(!i(s[d],o[d]))return!1}}return!0}})(ml||(dt.NotebookCell=ml={}));var p0;(function(t){function e(r,i,s,o){return{uri:r,notebookType:i,version:s,cells:o}}t.create=e;function n(r){let i=r;return gr.objectLiteral(i)&&gr.string(i.uri)&&La.integer.is(i.version)&&gr.typedArray(i.cells,ml.is)}t.is=n})(p0||(dt.NotebookDocument=p0={}));var _o;(function(t){t.method="notebookDocument/sync",t.messageDirection=Pr.MessageDirection.clientToServer,t.type=new Pr.RegistrationType(t.method)})(_o||(dt.NotebookDocumentSyncRegistrationType=_o={}));var g0;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=Pr.MessageDirection.clientToServer,t.type=new Pr.ProtocolNotificationType(t.method),t.registrationMethod=_o.method})(g0||(dt.DidOpenNotebookDocumentNotification=g0={}));var m0;(function(t){function e(r){let i=r;return gr.objectLiteral(i)&&La.uinteger.is(i.start)&&La.uinteger.is(i.deleteCount)&&(i.cells===void 0||gr.typedArray(i.cells,ml.is))}t.is=e;function n(r,i,s){let o={start:r,deleteCount:i};return s!==void 0&&(o.cells=s),o}t.create=n})(m0||(dt.NotebookCellArrayChange=m0={}));var y0;(function(t){t.method="notebookDocument/didChange",t.messageDirection=Pr.MessageDirection.clientToServer,t.type=new Pr.ProtocolNotificationType(t.method),t.registrationMethod=_o.method})(y0||(dt.DidChangeNotebookDocumentNotification=y0={}));var b0;(function(t){t.method="notebookDocument/didSave",t.messageDirection=Pr.MessageDirection.clientToServer,t.type=new Pr.ProtocolNotificationType(t.method),t.registrationMethod=_o.method})(b0||(dt.DidSaveNotebookDocumentNotification=b0={}));var _0;(function(t){t.method="notebookDocument/didClose",t.messageDirection=Pr.MessageDirection.clientToServer,t.type=new Pr.ProtocolNotificationType(t.method),t.registrationMethod=_o.method})(_0||(dt.DidCloseNotebookDocumentNotification=_0={}))});var T0=m(yl=>{"use strict";Object.defineProperty(yl,"__esModule",{value:!0});yl.InlineCompletionRequest=void 0;var S0=nt(),w0;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=S0.MessageDirection.clientToServer,t.type=new S0.ProtocolRequestType(t.method)})(w0||(yl.InlineCompletionRequest=w0={}))});var NE=m(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 H=nt(),E0=nl(),jt=rl(),gD=Xw();Object.defineProperty(S,"ImplementationRequest",{enumerable:!0,get:function(){return gD.ImplementationRequest}});var mD=Qw();Object.defineProperty(S,"TypeDefinitionRequest",{enumerable:!0,get:function(){return mD.TypeDefinitionRequest}});var DE=tT();Object.defineProperty(S,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return DE.WorkspaceFoldersRequest}});Object.defineProperty(S,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return DE.DidChangeWorkspaceFoldersNotification}});var yD=iT();Object.defineProperty(S,"ConfigurationRequest",{enumerable:!0,get:function(){return yD.ConfigurationRequest}});var IE=aT();Object.defineProperty(S,"DocumentColorRequest",{enumerable:!0,get:function(){return IE.DocumentColorRequest}});Object.defineProperty(S,"ColorPresentationRequest",{enumerable:!0,get:function(){return IE.ColorPresentationRequest}});var ME=lT();Object.defineProperty(S,"FoldingRangeRequest",{enumerable:!0,get:function(){return ME.FoldingRangeRequest}});Object.defineProperty(S,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return ME.FoldingRangeRefreshRequest}});var bD=fT();Object.defineProperty(S,"DeclarationRequest",{enumerable:!0,get:function(){return bD.DeclarationRequest}});var _D=mT();Object.defineProperty(S,"SelectionRangeRequest",{enumerable:!0,get:function(){return _D.SelectionRangeRequest}});var Ug=vT();Object.defineProperty(S,"WorkDoneProgress",{enumerable:!0,get:function(){return Ug.WorkDoneProgress}});Object.defineProperty(S,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return Ug.WorkDoneProgressCreateRequest}});Object.defineProperty(S,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return Ug.WorkDoneProgressCancelNotification}});var Wg=ET();Object.defineProperty(S,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Wg.CallHierarchyIncomingCallsRequest}});Object.defineProperty(S,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Wg.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(S,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Wg.CallHierarchyPrepareRequest}});var vo=RT();Object.defineProperty(S,"TokenFormat",{enumerable:!0,get:function(){return vo.TokenFormat}});Object.defineProperty(S,"SemanticTokensRequest",{enumerable:!0,get:function(){return vo.SemanticTokensRequest}});Object.defineProperty(S,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return vo.SemanticTokensDeltaRequest}});Object.defineProperty(S,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return vo.SemanticTokensRangeRequest}});Object.defineProperty(S,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return vo.SemanticTokensRefreshRequest}});Object.defineProperty(S,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return vo.SemanticTokensRegistrationType}});var vD=IT();Object.defineProperty(S,"ShowDocumentRequest",{enumerable:!0,get:function(){return vD.ShowDocumentRequest}});var SD=NT();Object.defineProperty(S,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return SD.LinkedEditingRangeRequest}});var hs=HT();Object.defineProperty(S,"FileOperationPatternKind",{enumerable:!0,get:function(){return hs.FileOperationPatternKind}});Object.defineProperty(S,"DidCreateFilesNotification",{enumerable:!0,get:function(){return hs.DidCreateFilesNotification}});Object.defineProperty(S,"WillCreateFilesRequest",{enumerable:!0,get:function(){return hs.WillCreateFilesRequest}});Object.defineProperty(S,"DidRenameFilesNotification",{enumerable:!0,get:function(){return hs.DidRenameFilesNotification}});Object.defineProperty(S,"WillRenameFilesRequest",{enumerable:!0,get:function(){return hs.WillRenameFilesRequest}});Object.defineProperty(S,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return hs.DidDeleteFilesNotification}});Object.defineProperty(S,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return hs.WillDeleteFilesRequest}});var Hg=XT();Object.defineProperty(S,"UniquenessLevel",{enumerable:!0,get:function(){return Hg.UniquenessLevel}});Object.defineProperty(S,"MonikerKind",{enumerable:!0,get:function(){return Hg.MonikerKind}});Object.defineProperty(S,"MonikerRequest",{enumerable:!0,get:function(){return Hg.MonikerRequest}});var Gg=ZT();Object.defineProperty(S,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return Gg.TypeHierarchyPrepareRequest}});Object.defineProperty(S,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return Gg.TypeHierarchySubtypesRequest}});Object.defineProperty(S,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return Gg.TypeHierarchySupertypesRequest}});var LE=n0();Object.defineProperty(S,"InlineValueRequest",{enumerable:!0,get:function(){return LE.InlineValueRequest}});Object.defineProperty(S,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return LE.InlineValueRefreshRequest}});var zg=o0();Object.defineProperty(S,"InlayHintRequest",{enumerable:!0,get:function(){return zg.InlayHintRequest}});Object.defineProperty(S,"InlayHintResolveRequest",{enumerable:!0,get:function(){return zg.InlayHintResolveRequest}});Object.defineProperty(S,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return zg.InlayHintRefreshRequest}});var Na=f0();Object.defineProperty(S,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Na.DiagnosticServerCancellationData}});Object.defineProperty(S,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Na.DocumentDiagnosticReportKind}});Object.defineProperty(S,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Na.DocumentDiagnosticRequest}});Object.defineProperty(S,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Na.WorkspaceDiagnosticRequest}});Object.defineProperty(S,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Na.DiagnosticRefreshRequest}});var Dr=v0();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 wD=T0();Object.defineProperty(S,"InlineCompletionRequest",{enumerable:!0,get:function(){return wD.InlineCompletionRequest}});var jg;(function(t){function e(n){let r=n;return jt.string(r)||jt.string(r.language)||jt.string(r.scheme)||jt.string(r.pattern)}t.is=e})(jg||(S.TextDocumentFilter=jg={}));var Fg;(function(t){function e(n){let r=n;return jt.objectLiteral(r)&&(jt.string(r.notebookType)||jt.string(r.scheme)||jt.string(r.pattern))}t.is=e})(Fg||(S.NotebookDocumentFilter=Fg={}));var $g;(function(t){function e(n){let r=n;return jt.objectLiteral(r)&&(jt.string(r.notebook)||Fg.is(r.notebook))&&(r.language===void 0||jt.string(r.language))}t.is=e})($g||(S.NotebookCellTextDocumentFilter=$g={}));var Bg;(function(t){function e(n){if(!Array.isArray(n))return!1;for(let r of n)if(!jt.string(r)&&!jg.is(r)&&!$g.is(r))return!1;return!0}t.is=e})(Bg||(S.DocumentSelector=Bg={}));var x0;(function(t){t.method="client/registerCapability",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolRequestType(t.method)})(x0||(S.RegistrationRequest=x0={}));var k0;(function(t){t.method="client/unregisterCapability",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolRequestType(t.method)})(k0||(S.UnregistrationRequest=k0={}));var A0;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(A0||(S.ResourceOperationKind=A0={}));var C0;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(C0||(S.FailureHandlingKind=C0={}));var O0;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(O0||(S.PositionEncodingKind=O0={}));var R0;(function(t){function e(n){let r=n;return r&&jt.string(r.id)&&r.id.length>0}t.hasId=e})(R0||(S.StaticRegistrationOptions=R0={}));var P0;(function(t){function e(n){let r=n;return r&&(r.documentSelector===null||Bg.is(r.documentSelector))}t.is=e})(P0||(S.TextDocumentRegistrationOptions=P0={}));var D0;(function(t){function e(r){let i=r;return jt.objectLiteral(i)&&(i.workDoneProgress===void 0||jt.boolean(i.workDoneProgress))}t.is=e;function n(r){let i=r;return i&&jt.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=n})(D0||(S.WorkDoneProgressOptions=D0={}));var I0;(function(t){t.method="initialize",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(I0||(S.InitializeRequest=I0={}));var M0;(function(t){t.unknownProtocolVersion=1})(M0||(S.InitializeErrorCodes=M0={}));var L0;(function(t){t.method="initialized",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})(L0||(S.InitializedNotification=L0={}));var N0;(function(t){t.method="shutdown",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType0(t.method)})(N0||(S.ShutdownRequest=N0={}));var q0;(function(t){t.method="exit",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType0(t.method)})(q0||(S.ExitNotification=q0={}));var j0;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})(j0||(S.DidChangeConfigurationNotification=j0={}));var F0;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(F0||(S.MessageType=F0={}));var $0;(function(t){t.method="window/showMessage",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolNotificationType(t.method)})($0||(S.ShowMessageNotification=$0={}));var B0;(function(t){t.method="window/showMessageRequest",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolRequestType(t.method)})(B0||(S.ShowMessageRequest=B0={}));var U0;(function(t){t.method="window/logMessage",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolNotificationType(t.method)})(U0||(S.LogMessageNotification=U0={}));var W0;(function(t){t.method="telemetry/event",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolNotificationType(t.method)})(W0||(S.TelemetryEventNotification=W0={}));var H0;(function(t){t.None=0,t.Full=1,t.Incremental=2})(H0||(S.TextDocumentSyncKind=H0={}));var G0;(function(t){t.method="textDocument/didOpen",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})(G0||(S.DidOpenTextDocumentNotification=G0={}));var z0;(function(t){function e(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}t.isIncremental=e;function n(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}t.isFull=n})(z0||(S.TextDocumentContentChangeEvent=z0={}));var K0;(function(t){t.method="textDocument/didChange",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})(K0||(S.DidChangeTextDocumentNotification=K0={}));var V0;(function(t){t.method="textDocument/didClose",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})(V0||(S.DidCloseTextDocumentNotification=V0={}));var X0;(function(t){t.method="textDocument/didSave",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})(X0||(S.DidSaveTextDocumentNotification=X0={}));var Y0;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(Y0||(S.TextDocumentSaveReason=Y0={}));var J0;(function(t){t.method="textDocument/willSave",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})(J0||(S.WillSaveTextDocumentNotification=J0={}));var Q0;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(Q0||(S.WillSaveTextDocumentWaitUntilRequest=Q0={}));var Z0;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})(Z0||(S.DidChangeWatchedFilesNotification=Z0={}));var eE;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(eE||(S.FileChangeType=eE={}));var tE;(function(t){function e(n){let r=n;return jt.objectLiteral(r)&&(E0.URI.is(r.baseUri)||E0.WorkspaceFolder.is(r.baseUri))&&jt.string(r.pattern)}t.is=e})(tE||(S.RelativePattern=tE={}));var nE;(function(t){t.Create=1,t.Change=2,t.Delete=4})(nE||(S.WatchKind=nE={}));var rE;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolNotificationType(t.method)})(rE||(S.PublishDiagnosticsNotification=rE={}));var iE;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(iE||(S.CompletionTriggerKind=iE={}));var sE;(function(t){t.method="textDocument/completion",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(sE||(S.CompletionRequest=sE={}));var oE;(function(t){t.method="completionItem/resolve",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(oE||(S.CompletionResolveRequest=oE={}));var aE;(function(t){t.method="textDocument/hover",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(aE||(S.HoverRequest=aE={}));var uE;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(uE||(S.SignatureHelpTriggerKind=uE={}));var cE;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(cE||(S.SignatureHelpRequest=cE={}));var lE;(function(t){t.method="textDocument/definition",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(lE||(S.DefinitionRequest=lE={}));var hE;(function(t){t.method="textDocument/references",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(hE||(S.ReferencesRequest=hE={}));var dE;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(dE||(S.DocumentHighlightRequest=dE={}));var fE;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(fE||(S.DocumentSymbolRequest=fE={}));var pE;(function(t){t.method="textDocument/codeAction",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(pE||(S.CodeActionRequest=pE={}));var gE;(function(t){t.method="codeAction/resolve",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(gE||(S.CodeActionResolveRequest=gE={}));var mE;(function(t){t.method="workspace/symbol",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(mE||(S.WorkspaceSymbolRequest=mE={}));var yE;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(yE||(S.WorkspaceSymbolResolveRequest=yE={}));var bE;(function(t){t.method="textDocument/codeLens",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(bE||(S.CodeLensRequest=bE={}));var _E;(function(t){t.method="codeLens/resolve",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(_E||(S.CodeLensResolveRequest=_E={}));var vE;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolRequestType0(t.method)})(vE||(S.CodeLensRefreshRequest=vE={}));var SE;(function(t){t.method="textDocument/documentLink",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(SE||(S.DocumentLinkRequest=SE={}));var wE;(function(t){t.method="documentLink/resolve",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(wE||(S.DocumentLinkResolveRequest=wE={}));var TE;(function(t){t.method="textDocument/formatting",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(TE||(S.DocumentFormattingRequest=TE={}));var EE;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(EE||(S.DocumentRangeFormattingRequest=EE={}));var xE;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(xE||(S.DocumentRangesFormattingRequest=xE={}));var kE;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(kE||(S.DocumentOnTypeFormattingRequest=kE={}));var AE;(function(t){t.Identifier=1})(AE||(S.PrepareSupportDefaultBehavior=AE={}));var CE;(function(t){t.method="textDocument/rename",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(CE||(S.RenameRequest=CE={}));var OE;(function(t){t.method="textDocument/prepareRename",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(OE||(S.PrepareRenameRequest=OE={}));var RE;(function(t){t.method="workspace/executeCommand",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(RE||(S.ExecuteCommandRequest=RE={}));var PE;(function(t){t.method="workspace/applyEdit",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolRequestType("workspace/applyEdit")})(PE||(S.ApplyWorkspaceEditRequest=PE={}))});var jE=m(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});bl.createProtocolConnection=void 0;var qE=ls();function TD(t,e,n,r){return qE.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,qE.createMessageConnection)(t,e,n,r)}bl.createProtocolConnection=TD});var $E=m(Sn=>{"use strict";var ED=Sn&&Sn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),_l=Sn&&Sn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&ED(e,t,n)};Object.defineProperty(Sn,"__esModule",{value:!0});Sn.LSPErrorCodes=Sn.createProtocolConnection=void 0;_l(ls(),Sn);_l(nl(),Sn);_l(nt(),Sn);_l(NE(),Sn);var xD=jE();Object.defineProperty(Sn,"createProtocolConnection",{enumerable:!0,get:function(){return xD.createProtocolConnection}});var FE;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(FE||(Sn.LSPErrorCodes=FE={}))});var _t=m(Ir=>{"use strict";var kD=Ir&&Ir.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),BE=Ir&&Ir.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&kD(e,t,n)};Object.defineProperty(Ir,"__esModule",{value:!0});Ir.createProtocolConnection=void 0;var AD=Rg();BE(Rg(),Ir);BE($E(),Ir);function CD(t,e,n,r){return(0,AD.createMessageConnection)(t,e,n,r)}Ir.createProtocolConnection=CD});var Kg=m(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.generateUuid=Un.parse=Un.isUUID=Un.v4=Un.empty=void 0;var qa=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},ja=class t extends qa{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(""))}};ja._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];ja._timeHighBits=["8","9","a","b"];Un.empty=new qa("00000000-0000-0000-0000-000000000000");function UE(){return new ja}Un.v4=UE;var OD=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function WE(t){return OD.test(t)}Un.isUUID=WE;function RD(t){if(!WE(t))throw new Error("invalid uuid");return new qa(t)}Un.parse=RD;function PD(){return UE().asHex()}Un.generateUuid=PD});var HE=m(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.attachPartialResult=Di.ProgressFeature=Di.attachWorkDone=void 0;var Pi=_t(),DD=Kg(),ds=class t{constructor(e,n){this._connection=e,this._token=n,t.Instances.set(this._token,this)}begin(e,n,r,i){let s={kind:"begin",title:e,percentage:n,message:r,cancellable:i};this._connection.sendProgress(Pi.WorkDoneProgress.type,this._token,s)}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(Pi.WorkDoneProgress.type,this._token,r)}done(){t.Instances.delete(this._token),this._connection.sendProgress(Pi.WorkDoneProgress.type,this._token,{kind:"end"})}};ds.Instances=new Map;var vl=class extends ds{constructor(e,n){super(e,n),this._source=new Pi.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},Fa=class{constructor(){}begin(){}report(){}done(){}},Sl=class extends Fa{constructor(){super(),this._source=new Pi.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function ID(t,e){if(e===void 0||e.workDoneToken===void 0)return new Fa;let n=e.workDoneToken;return delete e.workDoneToken,new ds(t,n)}Di.attachWorkDone=ID;var MD=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(Pi.WorkDoneProgressCancelNotification.type,n=>{let r=ds.Instances.get(n.token);(r instanceof vl||r instanceof Sl)&&r.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new Fa:new ds(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,DD.generateUuid)();return this.connection.sendRequest(Pi.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new vl(this.connection,e))}else return Promise.resolve(new Sl)}};Di.ProgressFeature=MD;var Vg;(function(t){t.type=new Pi.ProgressType})(Vg||(Vg={}));var Xg=class{constructor(e,n){this._connection=e,this._token=n}report(e){this._connection.sendProgress(Vg.type,this._token,e)}};function LD(t,e){if(e===void 0||e.partialResultToken===void 0)return;let n=e.partialResultToken;return delete e.partialResultToken,new Xg(t,n)}Di.attachPartialResult=LD});var GE=m(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});wl.ConfigurationFeature=void 0;var ND=_t(),qD=Ic(),jD=t=>class extends t{getConfiguration(e){return e?qD.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(ND.ConfigurationRequest.type,n).then(r=>Array.isArray(r)?Array.isArray(e)?r:r[0]:Array.isArray(e)?[]:null)}};wl.ConfigurationFeature=jD});var zE=m(El=>{"use strict";Object.defineProperty(El,"__esModule",{value:!0});El.WorkspaceFoldersFeature=void 0;var Tl=_t(),FD=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let n=e.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Tl.Emitter,this.connection.onNotification(Tl.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(Tl.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(Tl.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};El.WorkspaceFoldersFeature=FD});var KE=m(xl=>{"use strict";Object.defineProperty(xl,"__esModule",{value:!0});xl.CallHierarchyFeature=void 0;var Yg=_t(),$D=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(Yg.CallHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onIncomingCalls:e=>{let n=Yg.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onOutgoingCalls:e=>{let n=Yg.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};xl.CallHierarchyFeature=$D});var Qg=m(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.SemanticTokensBuilder=Ii.SemanticTokensDiff=Ii.SemanticTokensFeature=void 0;var kl=_t(),BD=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(kl.SemanticTokensRefreshRequest.type),on:e=>{let n=kl.SemanticTokensRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onDelta:e=>{let n=kl.SemanticTokensDeltaRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onRange:e=>{let n=kl.SemanticTokensRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Ii.SemanticTokensFeature=BD;var Al=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 i=e-1,s=n-1;for(;i>=r&&s>=r&&this.originalSequence[i]===this.modifiedSequence[s];)i--,s--;(i<r||s<r)&&(i++,s++);let o=i-r+1,a=this.modifiedSequence.slice(r,s+1);return a.length===1&&a[0]===this.originalSequence[i]?[{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}]:[]}};Ii.SemanticTokensDiff=Al;var Jg=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,i,s){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++]=i,this._data[this._dataLen++]=s,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 Al(this._prevData,this._data).computeDiff()}:this.build()}};Ii.SemanticTokensBuilder=Jg});var VE=m(Cl=>{"use strict";Object.defineProperty(Cl,"__esModule",{value:!0});Cl.ShowDocumentFeature=void 0;var UD=_t(),WD=t=>class extends t{showDocument(e){return this.connection.sendRequest(UD.ShowDocumentRequest.type,e)}};Cl.ShowDocumentFeature=WD});var XE=m(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});Ol.FileOperationsFeature=void 0;var So=_t(),HD=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(So.DidCreateFilesNotification.type,n=>{e(n)})}onDidRenameFiles(e){return this.connection.onNotification(So.DidRenameFilesNotification.type,n=>{e(n)})}onDidDeleteFiles(e){return this.connection.onNotification(So.DidDeleteFilesNotification.type,n=>{e(n)})}onWillCreateFiles(e){return this.connection.onRequest(So.WillCreateFilesRequest.type,(n,r)=>e(n,r))}onWillRenameFiles(e){return this.connection.onRequest(So.WillRenameFilesRequest.type,(n,r)=>e(n,r))}onWillDeleteFiles(e){return this.connection.onRequest(So.WillDeleteFilesRequest.type,(n,r)=>e(n,r))}};Ol.FileOperationsFeature=HD});var YE=m(Rl=>{"use strict";Object.defineProperty(Rl,"__esModule",{value:!0});Rl.LinkedEditingRangeFeature=void 0;var GD=_t(),zD=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(GD.LinkedEditingRangeRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))}};Rl.LinkedEditingRangeFeature=zD});var JE=m(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});Pl.TypeHierarchyFeature=void 0;var Zg=_t(),KD=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(Zg.TypeHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onSupertypes:e=>{let n=Zg.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onSubtypes:e=>{let n=Zg.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Pl.TypeHierarchyFeature=KD});var ZE=m(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});Dl.InlineValueFeature=void 0;var QE=_t(),VD=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(QE.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(QE.InlineValueRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};Dl.InlineValueFeature=VD});var tx=m(Il=>{"use strict";Object.defineProperty(Il,"__esModule",{value:!0});Il.FoldingRangeFeature=void 0;var ex=_t(),XD=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(ex.FoldingRangeRefreshRequest.type),on:e=>{let n=ex.FoldingRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Il.FoldingRangeFeature=XD});var nx=m(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});Ml.InlayHintFeature=void 0;var em=_t(),YD=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(em.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(em.InlayHintRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n))),resolve:e=>this.connection.onRequest(em.InlayHintResolveRequest.type,(n,r)=>e(n,r))}}};Ml.InlayHintFeature=YD});var rx=m(Ll=>{"use strict";Object.defineProperty(Ll,"__esModule",{value:!0});Ll.DiagnosticFeature=void 0;var $a=_t(),JD=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest($a.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest($a.DocumentDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress($a.DocumentDiagnosticRequest.partialResult,n))),onWorkspace:e=>this.connection.onRequest($a.WorkspaceDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress($a.WorkspaceDiagnosticRequest.partialResult,n)))}}};Ll.DiagnosticFeature=JD});var nm=m(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.TextDocuments=void 0;var fs=_t(),tm=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new fs.Emitter,this._onDidOpen=new fs.Emitter,this._onDidClose=new fs.Emitter,this._onDidSave=new fs.Emitter,this._onWillSave=new fs.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=fs.TextDocumentSyncKind.Incremental;let n=[];return n.push(e.onDidOpenTextDocument(r=>{let i=r.textDocument,s=this._configuration.create(i.uri,i.languageId,i.version,i.text);this._syncedDocuments.set(i.uri,s);let o=Object.freeze({document:s});this._onDidOpen.fire(o),this._onDidChangeContent.fire(o)})),n.push(e.onDidChangeTextDocument(r=>{let i=r.textDocument,s=r.contentChanges;if(s.length===0)return;let{version:o}=i;if(o==null)throw new Error(`Received document change event for ${i.uri} without valid version identifier`);let a=this._syncedDocuments.get(i.uri);a!==void 0&&(a=this._configuration.update(a,s,o),this._syncedDocuments.set(i.uri,a),this._onDidChangeContent.fire(Object.freeze({document:a})))})),n.push(e.onDidCloseTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&(this._syncedDocuments.delete(r.textDocument.uri),this._onDidClose.fire(Object.freeze({document:i})))})),n.push(e.onWillSaveTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:r.reason}))})),n.push(e.onWillSaveTextDocumentWaitUntil((r,i)=>{let s=this._syncedDocuments.get(r.textDocument.uri);return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:r.reason}),i):[]})),n.push(e.onDidSaveTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),fs.Disposable.create(()=>{n.forEach(r=>r.dispose())})}};Nl.TextDocuments=tm});var im=m(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});wo.NotebookDocuments=wo.NotebookSyncFeature=void 0;var Wn=_t(),ix=nm(),QD=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(Wn.DidOpenNotebookDocumentNotification.type,n=>{e(n)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(Wn.DidChangeNotebookDocumentNotification.type,n=>{e(n)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(Wn.DidSaveNotebookDocumentNotification.type,n=>{e(n)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(Wn.DidCloseNotebookDocumentNotification.type,n=>{e(n)})}}};wo.NotebookSyncFeature=QD;var ql=class t{onDidOpenTextDocument(e){return this.openHandler=e,Wn.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Wn.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Wn.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}};ql.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var rm=class{constructor(e){e instanceof ix.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new ix.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Wn.Emitter,this._onDidChange=new Wn.Emitter,this._onDidSave=new Wn.Emitter,this._onDidClose=new Wn.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 ql,r=[];return r.push(this.cellTextDocuments.listen(n)),r.push(e.notebooks.synchronization.onDidOpenNotebookDocument(i=>{this.notebookDocuments.set(i.notebookDocument.uri,i.notebookDocument);for(let s of i.cellTextDocuments)n.openTextDocument({textDocument:s});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument)})),r.push(e.notebooks.synchronization.onDidChangeNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);if(s===void 0)return;s.version=i.notebookDocument.version;let o=s.metadata,a=!1,u=i.change;u.metadata!==void 0&&(a=!0,s.metadata=u.metadata);let c=[],l=[],h=[],d=[];if(u.cells!==void 0){let k=u.cells;if(k.structure!==void 0){let T=k.structure.array;if(s.cells.splice(T.start,T.deleteCount,...T.cells!==void 0?T.cells:[]),k.structure.didOpen!==void 0)for(let w of k.structure.didOpen)n.openTextDocument({textDocument:w}),c.push(w.uri);if(k.structure.didClose)for(let w of k.structure.didClose)n.closeTextDocument({textDocument:w}),l.push(w.uri)}if(k.data!==void 0){let T=new Map(k.data.map(w=>[w.document,w]));for(let w=0;w<=s.cells.length;w++){let v=T.get(s.cells[w].document);if(v!==void 0){let L=s.cells.splice(w,1,v);if(h.push({old:L[0],new:v}),T.delete(v.document),T.size===0)break}}}if(k.textContent!==void 0)for(let T of k.textContent)n.changeTextDocument({textDocument:T.document,contentChanges:T.changes}),d.push(T.document.uri)}this.updateCellMap(s);let g={notebookDocument:s};a&&(g.metadata={old:o,new:s.metadata});let y=[];for(let k of c)y.push(this.getNotebookCell(k));let _=[];for(let k of l)_.push(this.getNotebookCell(k));let C=[];for(let k of d)C.push(this.getNotebookCell(k));(y.length>0||_.length>0||h.length>0||C.length>0)&&(g.cells={added:y,removed:_,changed:{data:h,textContent:C}}),(g.metadata!==void 0||g.cells!==void 0)&&this._onDidChange.fire(g)})),r.push(e.notebooks.synchronization.onDidSaveNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);s!==void 0&&this._onDidSave.fire(s)})),r.push(e.notebooks.synchronization.onDidCloseNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);if(s!==void 0){this._onDidClose.fire(s);for(let o of i.cellTextDocuments)n.closeTextDocument({textDocument:o});this.notebookDocuments.delete(i.notebookDocument.uri);for(let o of s.cells)this.notebookCellMap.delete(o.document)}})),Wn.Disposable.create(()=>{r.forEach(i=>i.dispose())})}updateCellMap(e){for(let n of e.cells)this.notebookCellMap.set(n.document,[n,e])}};wo.NotebookDocuments=rm});var sx=m(jl=>{"use strict";Object.defineProperty(jl,"__esModule",{value:!0});jl.MonikerFeature=void 0;var ZD=_t(),eI=t=>class extends t{get moniker(){return{on:e=>{let n=ZD.MonikerRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};jl.MonikerFeature=eI});var lm=m(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.createConnection=Ie.combineFeatures=Ie.combineNotebooksFeatures=Ie.combineLanguagesFeatures=Ie.combineWorkspaceFeatures=Ie.combineWindowFeatures=Ie.combineClientFeatures=Ie.combineTracerFeatures=Ie.combineTelemetryFeatures=Ie.combineConsoleFeatures=Ie._NotebooksImpl=Ie._LanguagesImpl=Ie.BulkUnregistration=Ie.BulkRegistration=Ie.ErrorMessageTracker=void 0;var V=_t(),Hn=Ic(),om=Kg(),pe=HE(),tI=GE(),nI=zE(),rI=KE(),iI=Qg(),sI=VE(),oI=XE(),aI=YE(),uI=JE(),cI=ZE(),lI=tx(),hI=nx(),dI=rx(),fI=im(),pI=sx();function sm(t){if(t!==null)return t}var am=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)})}};Ie.ErrorMessageTracker=am;var Fl=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(V.MessageType.Error,e)}warn(e){this.send(V.MessageType.Warning,e)}info(e){this.send(V.MessageType.Info,e)}log(e){this.send(V.MessageType.Log,e)}debug(e){this.send(V.MessageType.Debug,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(V.LogMessageNotification.type,{type:e,message:n}).catch(()=>{(0,V.RAL)().console.error("Sending log message failed")})}},um=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:V.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(V.ShowMessageRequest.type,r).then(sm)}showWarningMessage(e,...n){let r={type:V.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(V.ShowMessageRequest.type,r).then(sm)}showInformationMessage(e,...n){let r={type:V.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(V.ShowMessageRequest.type,r).then(sm)}},ox=(0,sI.ShowDocumentFeature)((0,pe.ProgressFeature)(um)),ax;(function(t){function e(){return new $l}t.create=e})(ax||(Ie.BulkRegistration=ax={}));var $l=class{constructor(){this._registrations=[],this._registered=new Set}add(e,n){let r=Hn.string(e)?e:e.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);let i=om.generateUuid();this._registrations.push({id:i,method:r,registerOptions:n||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}},ux;(function(t){function e(){return new Ba(void 0,[])}t.create=e})(ux||(Ie.BulkUnregistration=ux={}));var Ba=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(V.UnregistrationRequest.type,n).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let n=Hn.string(e)?e:e.method,r=this._unregistrations.get(n);if(!r)return!1;let i={unregisterations:[r]};return this._connection.sendRequest(V.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(n)},s=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}},Bl=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 $l?this.registerMany(e):e instanceof Ba?this.registerSingle1(e,n,r):this.registerSingle2(e,n)}registerSingle1(e,n,r){let i=Hn.string(n)?n:n.method,s=om.generateUuid(),o={registrations:[{id:s,method:i,registerOptions:r||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(V.RegistrationRequest.type,o).then(a=>(e.add({id:s,method:i}),e),a=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(a)))}registerSingle2(e,n){let r=Hn.string(e)?e:e.method,i=om.generateUuid(),s={registrations:[{id:i,method:r,registerOptions:n||{}}]};return this.connection.sendRequest(V.RegistrationRequest.type,s).then(o=>V.Disposable.create(()=>{this.unregisterSingle(i,r).catch(()=>{this.connection.console.info(`Un-registering capability with id ${i} 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(V.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(V.RegistrationRequest.type,n).then(()=>new Ba(this._connection,n.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}},cm=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(i){return i&&!!i.edit}let r=n(e)?e:{edit:e};return this.connection.sendRequest(V.ApplyWorkspaceEditRequest.type,r)}},cx=(0,oI.FileOperationsFeature)((0,nI.WorkspaceFoldersFeature)((0,tI.ConfigurationFeature)(cm))),Ul=class{constructor(){this._trace=V.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!==V.Trace.Off&&this.connection.sendNotification(V.LogTraceNotification.type,{message:e,verbose:this._trace===V.Trace.Verbose?n:void 0}).catch(()=>{})}},Wl=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(V.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},Hl=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,pe.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,pe.attachPartialResult)(this.connection,n)}};Ie._LanguagesImpl=Hl;var lx=(0,lI.FoldingRangeFeature)((0,pI.MonikerFeature)((0,dI.DiagnosticFeature)((0,hI.InlayHintFeature)((0,cI.InlineValueFeature)((0,uI.TypeHierarchyFeature)((0,aI.LinkedEditingRangeFeature)((0,iI.SemanticTokensFeature)((0,rI.CallHierarchyFeature)(Hl))))))))),Gl=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,pe.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,pe.attachPartialResult)(this.connection,n)}};Ie._NotebooksImpl=Gl;var hx=(0,fI.NotebookSyncFeature)(Gl);function dx(t,e){return function(n){return e(t(n))}}Ie.combineConsoleFeatures=dx;function fx(t,e){return function(n){return e(t(n))}}Ie.combineTelemetryFeatures=fx;function px(t,e){return function(n){return e(t(n))}}Ie.combineTracerFeatures=px;function gx(t,e){return function(n){return e(t(n))}}Ie.combineClientFeatures=gx;function mx(t,e){return function(n){return e(t(n))}}Ie.combineWindowFeatures=mx;function yx(t,e){return function(n){return e(t(n))}}Ie.combineWorkspaceFeatures=yx;function bx(t,e){return function(n){return e(t(n))}}Ie.combineLanguagesFeatures=bx;function _x(t,e){return function(n){return e(t(n))}}Ie.combineNotebooksFeatures=_x;function gI(t,e){function n(i,s,o){return i&&s?o(i,s):i||s}return{__brand:"features",console:n(t.console,e.console,dx),tracer:n(t.tracer,e.tracer,px),telemetry:n(t.telemetry,e.telemetry,fx),client:n(t.client,e.client,gx),window:n(t.window,e.window,mx),workspace:n(t.workspace,e.workspace,yx),languages:n(t.languages,e.languages,bx),notebooks:n(t.notebooks,e.notebooks,_x)}}Ie.combineFeatures=gI;function mI(t,e,n){let r=n&&n.console?new(n.console(Fl)):new Fl,i=t(r);r.rawAttach(i);let s=n&&n.tracer?new(n.tracer(Ul)):new Ul,o=n&&n.telemetry?new(n.telemetry(Wl)):new Wl,a=n&&n.client?new(n.client(Bl)):new Bl,u=n&&n.window?new(n.window(ox)):new ox,c=n&&n.workspace?new(n.workspace(cx)):new cx,l=n&&n.languages?new(n.languages(lx)):new lx,h=n&&n.notebooks?new(n.notebooks(hx)):new hx,d=[r,s,o,a,u,c,l,h];function g(T){return T instanceof Promise?T:Hn.thenable(T)?new Promise((w,v)=>{T.then(L=>w(L),L=>v(L))}):Promise.resolve(T)}let y,_,C,k={listen:()=>i.listen(),sendRequest:(T,...w)=>i.sendRequest(Hn.string(T)?T:T.method,...w),onRequest:(T,w)=>i.onRequest(T,w),sendNotification:(T,w)=>{let v=Hn.string(T)?T:T.method;return i.sendNotification(v,w)},onNotification:(T,w)=>i.onNotification(T,w),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:T=>(_=T,{dispose:()=>{_=void 0}}),onInitialized:T=>i.onNotification(V.InitializedNotification.type,T),onShutdown:T=>(y=T,{dispose:()=>{y=void 0}}),onExit:T=>(C=T,{dispose:()=>{C=void 0}}),get console(){return r},get telemetry(){return o},get tracer(){return s},get client(){return a},get window(){return u},get workspace(){return c},get languages(){return l},get notebooks(){return h},onDidChangeConfiguration:T=>i.onNotification(V.DidChangeConfigurationNotification.type,T),onDidChangeWatchedFiles:T=>i.onNotification(V.DidChangeWatchedFilesNotification.type,T),__textDocumentSync:void 0,onDidOpenTextDocument:T=>i.onNotification(V.DidOpenTextDocumentNotification.type,T),onDidChangeTextDocument:T=>i.onNotification(V.DidChangeTextDocumentNotification.type,T),onDidCloseTextDocument:T=>i.onNotification(V.DidCloseTextDocumentNotification.type,T),onWillSaveTextDocument:T=>i.onNotification(V.WillSaveTextDocumentNotification.type,T),onWillSaveTextDocumentWaitUntil:T=>i.onRequest(V.WillSaveTextDocumentWaitUntilRequest.type,T),onDidSaveTextDocument:T=>i.onNotification(V.DidSaveTextDocumentNotification.type,T),sendDiagnostics:T=>i.sendNotification(V.PublishDiagnosticsNotification.type,T),onHover:T=>i.onRequest(V.HoverRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),void 0)),onCompletion:T=>i.onRequest(V.CompletionRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onCompletionResolve:T=>i.onRequest(V.CompletionResolveRequest.type,T),onSignatureHelp:T=>i.onRequest(V.SignatureHelpRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),void 0)),onDeclaration:T=>i.onRequest(V.DeclarationRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onDefinition:T=>i.onRequest(V.DefinitionRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onTypeDefinition:T=>i.onRequest(V.TypeDefinitionRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onImplementation:T=>i.onRequest(V.ImplementationRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onReferences:T=>i.onRequest(V.ReferencesRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onDocumentHighlight:T=>i.onRequest(V.DocumentHighlightRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onDocumentSymbol:T=>i.onRequest(V.DocumentSymbolRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onWorkspaceSymbol:T=>i.onRequest(V.WorkspaceSymbolRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onWorkspaceSymbolResolve:T=>i.onRequest(V.WorkspaceSymbolResolveRequest.type,T),onCodeAction:T=>i.onRequest(V.CodeActionRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onCodeActionResolve:T=>i.onRequest(V.CodeActionResolveRequest.type,(w,v)=>T(w,v)),onCodeLens:T=>i.onRequest(V.CodeLensRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onCodeLensResolve:T=>i.onRequest(V.CodeLensResolveRequest.type,(w,v)=>T(w,v)),onDocumentFormatting:T=>i.onRequest(V.DocumentFormattingRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),void 0)),onDocumentRangeFormatting:T=>i.onRequest(V.DocumentRangeFormattingRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),void 0)),onDocumentOnTypeFormatting:T=>i.onRequest(V.DocumentOnTypeFormattingRequest.type,(w,v)=>T(w,v)),onRenameRequest:T=>i.onRequest(V.RenameRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),void 0)),onPrepareRename:T=>i.onRequest(V.PrepareRenameRequest.type,(w,v)=>T(w,v)),onDocumentLinks:T=>i.onRequest(V.DocumentLinkRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onDocumentLinkResolve:T=>i.onRequest(V.DocumentLinkResolveRequest.type,(w,v)=>T(w,v)),onDocumentColor:T=>i.onRequest(V.DocumentColorRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onColorPresentation:T=>i.onRequest(V.ColorPresentationRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onFoldingRanges:T=>i.onRequest(V.FoldingRangeRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onSelectionRanges:T=>i.onRequest(V.SelectionRangeRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onExecuteCommand:T=>i.onRequest(V.ExecuteCommandRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),void 0)),dispose:()=>i.dispose()};for(let T of d)T.attach(k);return i.onRequest(V.InitializeRequest.type,T=>{e.initialize(T),Hn.string(T.trace)&&(s.trace=V.Trace.fromString(T.trace));for(let w of d)w.initialize(T.capabilities);if(_){let w=_(T,new V.CancellationTokenSource().token,(0,pe.attachWorkDone)(i,T),void 0);return g(w).then(v=>{if(v instanceof V.ResponseError)return v;let L=v;L||(L={capabilities:{}});let R=L.capabilities;R||(R={},L.capabilities=R),R.textDocumentSync===void 0||R.textDocumentSync===null?R.textDocumentSync=Hn.number(k.__textDocumentSync)?k.__textDocumentSync:V.TextDocumentSyncKind.None:!Hn.number(R.textDocumentSync)&&!Hn.number(R.textDocumentSync.change)&&(R.textDocumentSync.change=Hn.number(k.__textDocumentSync)?k.__textDocumentSync:V.TextDocumentSyncKind.None);for(let U of d)U.fillServerCapabilities(R);return L})}else{let w={capabilities:{textDocumentSync:V.TextDocumentSyncKind.None}};for(let v of d)v.fillServerCapabilities(w.capabilities);return w}}),i.onRequest(V.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,y)return y(new V.CancellationTokenSource().token)}),i.onNotification(V.ExitNotification.type,()=>{try{C&&C()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(V.SetTraceNotification.type,T=>{s.trace=V.Trace.fromString(T.value)}),k}Ie.createConnection=mI});var vx=m(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.resolveModulePath=wn.FileSystem=wn.resolveGlobalYarnPath=wn.resolveGlobalNodePath=wn.resolve=wn.uriToFilePath=void 0;var yI=require("url"),mr=require("path"),hm=require("fs"),gm=require("child_process");function bI(t){let e=yI.parse(t);if(e.protocol!=="file:"||!e.path)return;let n=e.path.split("/");for(var r=0,i=n.length;r<i;r++)n[r]=decodeURIComponent(n[r]);if(process.platform==="win32"&&n.length>1){let s=n[0],o=n[1];s.length===0&&o.length>1&&o[1]===":"&&n.shift()}return mr.normalize(n.join("/"))}wn.uriToFilePath=bI;function dm(){return process.platform==="win32"}function zl(t,e,n,r){let i="NODE_PATH",s=["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 u=process.env,c=Object.create(null);Object.keys(u).forEach(l=>c[l]=u[l]),e&&hm.existsSync(e)&&(c[i]?c[i]=e+mr.delimiter+c[i]:c[i]=e,r&&r(`NODE_PATH value is: ${c[i]}`)),c.ELECTRON_RUN_AS_NODE="1";try{let l=(0,gm.fork)("",[],{cwd:n,env:c,execArgv:["-e",s]});if(l.pid===void 0){a(new Error(`Starting process to resolve node module ${t} failed`));return}l.on("error",d=>{a(d)}),l.on("message",d=>{d.c==="r"&&(l.send({c:"e"}),d.s?o(d.r):a(new Error(`Failed to resolve module: ${t}`)))});let h={c:"rs",a:t};l.send(h)}catch(l){a(l)}})}wn.resolve=zl;function fm(t){let e="npm",n=Object.create(null);Object.keys(process.env).forEach(s=>n[s]=process.env[s]),n.NO_UPDATE_NOTIFIER="true";let r={encoding:"utf8",env:n};dm()&&(e="npm.cmd",r.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let s=(0,gm.spawnSync)(e,["config","get","prefix"],r).stdout;if(!s){t&&t("'npm config get prefix' didn't return a value.");return}let o=s.trim();return t&&t(`'npm config get prefix' value is: ${o}`),o.length>0?dm()?mr.join(o,"node_modules"):mr.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i)}}wn.resolveGlobalNodePath=fm;function _I(t){let e="yarn",n={encoding:"utf8"};dm()&&(e="yarn.cmd",n.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let i=(0,gm.spawnSync)(e,["global","dir","--json"],n),s=i.stdout;if(!s){t&&(t("'yarn global dir' didn't return a value."),i.stderr&&t(i.stderr));return}let o=s.trim().split(/\r?\n/);for(let a of o)try{let u=JSON.parse(a);if(u.type==="log")return mr.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",r)}}wn.resolveGlobalYarnPath=_I;var pm;(function(t){let e;function n(){return e!==void 0||(process.platform==="win32"?e=!1:e=!hm.existsSync(__filename.toUpperCase())||!hm.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=n;function r(i,s){return n()?mr.normalize(s).indexOf(mr.normalize(i))===0:mr.normalize(s).toLowerCase().indexOf(mr.normalize(i).toLowerCase())===0}t.isParent=r})(pm||(wn.FileSystem=pm={}));function vI(t,e,n,r){return n?(mr.isAbsolute(n)||(n=mr.join(t,n)),zl(e,n,n,r).then(i=>pm.isParent(n,i)?i:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,i=>zl(e,fm(r),t,r))):zl(e,fm(r),t,r)}wn.resolveModulePath=vI});var mm=m((IG,Sx)=>{"use strict";Sx.exports=_t()});var wx=m(Kl=>{"use strict";Object.defineProperty(Kl,"__esModule",{value:!0});Kl.InlineCompletionFeature=void 0;var SI=_t(),wI=t=>class extends t{get inlineCompletion(){return{on:e=>this.connection.onRequest(SI.InlineCompletionRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};Kl.InlineCompletionFeature=wI});var xx=m(en=>{"use strict";var TI=en&&en.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Ex=en&&en.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&TI(e,t,n)};Object.defineProperty(en,"__esModule",{value:!0});en.ProposedFeatures=en.NotebookDocuments=en.TextDocuments=en.SemanticTokensBuilder=void 0;var EI=Qg();Object.defineProperty(en,"SemanticTokensBuilder",{enumerable:!0,get:function(){return EI.SemanticTokensBuilder}});var xI=wx();Ex(_t(),en);var kI=nm();Object.defineProperty(en,"TextDocuments",{enumerable:!0,get:function(){return kI.TextDocuments}});var AI=im();Object.defineProperty(en,"NotebookDocuments",{enumerable:!0,get:function(){return AI.NotebookDocuments}});Ex(lm(),en);var Tx;(function(t){t.all={__brand:"features",languages:xI.InlineCompletionFeature}})(Tx||(en.ProposedFeatures=Tx={}))});var bm=m(Gn=>{"use strict";var CI=Gn&&Gn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Ox=Gn&&Gn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&CI(e,t,n)};Object.defineProperty(Gn,"__esModule",{value:!0});Gn.createConnection=Gn.Files=void 0;var kx=require("node:util"),ym=Ic(),OI=lm(),Ua=vx(),ps=mm();Ox(mm(),Gn);Ox(xx(),Gn);var Ax;(function(t){t.uriToFilePath=Ua.uriToFilePath,t.resolveGlobalNodePath=Ua.resolveGlobalNodePath,t.resolveGlobalYarnPath=Ua.resolveGlobalYarnPath,t.resolve=Ua.resolve,t.resolveModulePath=Ua.resolveModulePath})(Ax||(Gn.Files=Ax={}));var Cx;function Vl(){if(Cx!==void 0)try{Cx.end()}catch{}}var To=!1,Rx;function RI(){let t="--clientProcessId";function e(n){try{let r=parseInt(n);isNaN(r)||(Rx=setInterval(()=>{try{process.kill(r,0)}catch{Vl(),process.exit(To?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 i=r.split("=");i[0]===t&&e(i[1])}}}RI();var PI={initialize:t=>{let e=t.processId;ym.number(e)&&Rx===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(To?0:1)}},3e3)},get shutdownReceived(){return To},set shutdownReceived(t){To=t},exit:t=>{Vl(),process.exit(t)}};function DI(t,e,n,r){let i,s,o,a;return t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=n,n=r),ps.ConnectionStrategy.is(t)||ps.ConnectionOptions.is(t)?a=t:(s=t,o=e,a=n),II(s,o,a,i)}Gn.createConnection=DI;function II(t,e,n,r){let i=!1;if(!t&&!e&&process.argv.length>2){let u,c,l=process.argv.slice(2);for(let h=0;h<l.length;h++){let d=l[h];if(d==="--node-ipc"){t=new ps.IPCMessageReader(process),e=new ps.IPCMessageWriter(process);break}else if(d==="--stdio"){i=!0,t=process.stdin,e=process.stdout;break}else if(d==="--socket"){u=parseInt(l[h+1]);break}else if(d==="--pipe"){c=l[h+1];break}else{var s=d.split("=");if(s[0]==="--socket"){u=parseInt(s[1]);break}else if(s[0]==="--pipe"){c=s[1];break}}}if(u){let h=(0,ps.createServerSocketTransport)(u);t=h[0],e=h[1]}else if(c){let h=(0,ps.createServerPipeTransport)(c);t=h[0],e=h[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(ym.func(t.read)&&ym.func(t.on)){let u=t;u.on("end",()=>{Vl(),process.exit(To?0:1)}),u.on("close",()=>{Vl(),process.exit(To?0:1)})}let a=u=>{let c=(0,ps.createProtocolConnection)(t,e,u,n);return i&&MI(u),c};return(0,OI.createConnection)(a,PI,r)}function MI(t){function e(r){return r.map(i=>typeof i=="string"?i:(0,kx.inspect)(i)).join(" ")}let n=new Map;console.assert=function(i,...s){if(!i)if(s.length===0)t.error("Assertion failed");else{let[o,...a]=s;t.error(`Assertion failed: ${o} ${e(a)}`)}},console.count=function(i="default"){let s=String(i),o=n.get(s)??0;o+=1,n.set(s,o),t.log(`${s}: ${s}`)},console.countReset=function(i){i===void 0?n.clear():n.delete(String(i))},console.debug=function(...i){t.log(e(i))},console.dir=function(i,s){t.log((0,kx.inspect)(i,s))},console.log=function(...i){t.log(e(i))},console.error=function(...i){t.error(e(i))},console.trace=function(...i){let s=new Error().stack.replace(/(.+\n){2}/,""),o="Trace";i.length!==0&&(o+=`: ${e(i)}`),t.log(`${o}
36
- ${s}`)},console.warn=function(...i){t.warn(e(i))}}});var _m=m((jG,Px)=>{"use strict";Px.exports=bm()});var gs=m(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.TypeAnalyzerStrategy=Tn.IndentationType=Tn.DefaultFileExtensions=Tn.ConfigurationNamespace=Tn.LanguageId=void 0;Tn.LanguageId="miniscript";Tn.ConfigurationNamespace="miniscript";Tn.DefaultFileExtensions=["ms"];var LI;(function(t){t.Tab="Tab",t.Whitespace="Whitespace"})(LI=Tn.IndentationType||(Tn.IndentationType={}));var NI;(function(t){t.Dependency="Dependency",t.Workspace="Workspace"})(NI=Tn.TypeAnalyzerStrategy||(Tn.TypeAnalyzerStrategy={}))});var Wa=m(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});Xl.Position=void 0;var vm=class{constructor(e,n){this.line=e,this.character=n}toString(){return`${this.line}:${this.character}`}};Xl.Position=vm});var Mi=m(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.LiteralToken=Dn.Token=Dn.BaseToken=Dn.BaseTokenOptions=Dn.TokenType=void 0;var Dx=Wa(),qI;(function(t){t.EOF="EOF",t.StringLiteral="StringLiteral",t.Keyword="Keyword",t.Identifier="Identifier",t.NumericLiteral="NumericLiteral",t.Punctuator="Punctuator",t.BooleanLiteral="BooleanLiteral",t.NilLiteral="NilLiteral",t.EOL="EOL",t.SliceOperator="SliceOperator",t.Comment="Comment",t.Invalid="Invalid"})(qI=Dn.TokenType||(Dn.TokenType={}));var Sm=class{};Dn.BaseTokenOptions=Sm;var Ha=class{constructor(e){this.type=e.type,this.value=e.value,this.line=e.line,this.lineStart=e.lineStart,this.range=e.range,this.lastLine=e.lastLine,this.lastLineStart=e.lastLineStart,this.afterSpace=e.afterSpace;let n=e.offsetRange,r=e.range;this.start=new Dx.Position(this.line,r[0]-n[0]+1),this.end=new Dx.Position(this.lastLine||this.line,r[1]-n[1]+1)}toString(){let e=this.line,n=this.lastLine!==void 0?this.lastLine:this.line,r=this.start.character,i=this.end.character,s=`${e}:${r} - ${n}:${i}`;return`${this.type}[${s}: value = '${this.value}']`}};Dn.BaseToken=Ha;var wm=class extends Ha{};Dn.Token=wm;var Tm=class extends Ha{constructor(e){super(e),this.raw=e.raw}toString(){let e=this.line,n=this.lastLine!==void 0?this.lastLine:this.line,r=this.start.character,i=this.end.character,s=`${e}:${r} - ${n}:${i}`;return`${this.type}[${s}: value = ${this.raw}]`}};Dn.LiteralToken=Tm});var Yl=m(Ga=>{"use strict";Object.defineProperty(Ga,"__esModule",{value:!0});Ga.CharacterCode=void 0;var jI;(function(t){t[t.WHITESPACE=32]="WHITESPACE",t[t.QUOTE=34]="QUOTE",t[t.NUMBER_0=48]="NUMBER_0",t[t.NUMBER_1=49]="NUMBER_1",t[t.NUMBER_2=50]="NUMBER_2",t[t.NUMBER_3=51]="NUMBER_3",t[t.NUMBER_4=52]="NUMBER_4",t[t.NUMBER_5=53]="NUMBER_5",t[t.NUMBER_6=54]="NUMBER_6",t[t.NUMBER_7=55]="NUMBER_7",t[t.NUMBER_8=56]="NUMBER_8",t[t.NUMBER_9=57]="NUMBER_9",t[t.TAB=9]="TAB",t[t.NEW_LINE=10]="NEW_LINE",t[t.RETURN_LINE=13]="RETURN_LINE",t[t.SLASH=47]="SLASH",t[t.DOT=46]="DOT",t[t.EQUAL=61]="EQUAL",t[t.ASTERISK=42]="ASTERISK",t[t.CARET=94]="CARET",t[t.PERCENT=37]="PERCENT",t[t.COMMA=44]="COMMA",t[t.CURLY_BRACKET_LEFT=123]="CURLY_BRACKET_LEFT",t[t.CURLY_BRACKET_RIGHT=125]="CURLY_BRACKET_RIGHT",t[t.SQUARE_BRACKETS_LEFT=91]="SQUARE_BRACKETS_LEFT",t[t.SQUARE_BRACKETS_RIGHT=93]="SQUARE_BRACKETS_RIGHT",t[t.PARENTHESIS_LEFT=40]="PARENTHESIS_LEFT",t[t.PARENTHESIS_RIGHT=41]="PARENTHESIS_RIGHT",t[t.SEMICOLON=59]="SEMICOLON",t[t.HASH=35]="HASH",t[t.MINUS=45]="MINUS",t[t.PLUS=43]="PLUS",t[t.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",t[t.AT_SIGN=64]="AT_SIGN",t[t.COLON=58]="COLON",t[t.ARROW_LEFT=60]="ARROW_LEFT",t[t.ARROW_RIGHT=62]="ARROW_RIGHT",t[t.LETTER_E=69]="LETTER_E",t[t.LETTER_e=101]="LETTER_e"})(jI=Ga.CharacterCode||(Ga.CharacterCode={}))});var Eo=m(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.Keyword=void 0;var FI;(function(t){t.If="if",t.In="in",t.Or="or",t.And="and",t.Isa="isa",t.For="for",t.Not="not",t.New="new",t.End="end",t.EndFor="end for",t.EndWhile="end while",t.EndFunction="end function",t.EndIf="end if",t.Then="then",t.Else="else",t.Break="break",t.While="while",t.ElseIf="else if",t.Return="return",t.Function="function",t.Continue="continue",t.Repeat="repeat"})(FI=za.Keyword||(za.Keyword={}))});var km=m(xm=>{"use strict";Object.defineProperty(xm,"__esModule",{value:!0});var zn=Yl(),$I=Eo(),Em=class{constructor(){this.isKeyword=Set.prototype.has.bind(new Set(Object.values($I.Keyword)))}isWhitespace(e){return zn.CharacterCode.WHITESPACE===e||zn.CharacterCode.TAB===e}isEndOfLine(e){return zn.CharacterCode.NEW_LINE===e||zn.CharacterCode.RETURN_LINE===e}isComment(e,n){return zn.CharacterCode.SLASH===e&&zn.CharacterCode.SLASH===n}isIdentifierStart(e){return(e|32)>=97&&(e|32)<=122||e>=128||e===95}isIdentifierPart(e){return(e|32)>=97&&(e|32)<=122||e>=48&&e<=57||e>=128||e===95}isDecDigit(e){return e>=zn.CharacterCode.NUMBER_0&&e<=zn.CharacterCode.NUMBER_9}isWinNewline(e,n){switch(e){case zn.CharacterCode.RETURN_LINE:return zn.CharacterCode.NEW_LINE===n;case zn.CharacterCode.NEW_LINE:return zn.CharacterCode.RETURN_LINE===n}return!1}};xm.default=Em});var Jl=m(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.ParserException=xo.LexerException=void 0;var Am=class extends Error{constructor(e,n){super(e),this.range=n}};xo.LexerException=Am;var Cm=class extends Error{constructor(e,n){super(e),this.range=n}};xo.ParserException=Cm});var Om=m(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});Ka.Literal=void 0;var BI;(function(t){t.True="true",t.False="false",t.Null="null"})(BI=Ka.Literal||(Ka.Literal={}))});var ko=m(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});Va.Operator=void 0;var UI;(function(t){t.Plus="+",t.Asterik="*",t.Minus="-",t.Slash="/",t.Power="^",t.Modulo="%",t.LessThan="<",t.GreaterThan=">",t.LessThanOrEqual="<=",t.GreaterThanOrEqual=">=",t.NotEqual="!=",t.Equal="==",t.Or="or",t.And="and",t.Not="not",t.Isa="isa",t.AddShorthand="+=",t.SubtractShorthand="-=",t.MultiplyShorthand="*=",t.DivideShorthand="/=",t.PowerShorthand="^=",t.ModuloShorthand="%=",t.Member=".",t.Assign="=",t.EndOfLine=";",t.EndOfFile="<eof>",t.SliceSeperator=":",t.Comma=",",t.Escape='"',t.SLBracket="[",t.SRBracket="]",t.CLBracket="{",t.CRBracket="}",t.LParenthesis="(",t.RParenthesis=")",t.Reference="@",t.New="new"})(UI=Va.Operator||(Va.Operator={}))});var Xa=m(Ql=>{"use strict";Object.defineProperty(Ql,"__esModule",{value:!0});Ql.Range=void 0;var Rm=class{constructor(e,n){this.start=e,this.end=n}toString(){return`${this.start} - ${this.end}`}};Ql.Range=Rm});var Im=m(Dm=>{"use strict";Object.defineProperty(Dm,"__esModule",{value:!0});var Pm=class{constructor(){this._head=null,this._tail=null,this._size=0}enqueue(e){let n={value:e};this._head?this._tail.next=n:this._head=n,this._tail=n,this._size++}dequeue(){let e=this._head.value;if(e)return this._head=this._head.next,this._size--,e}peek(){var e;return((e=this._head)===null||e===void 0?void 0:e.value)||null}clear(){this._head=null,this._tail=null,this._size=0}copyInto(e){this._head=e._head,this._tail=e._tail,this._size=e._size}get size(){return this._size}*[Symbol.iterator](){let e=this._head;for(;e;)yield e,e=e.next}};Dm.default=Pm});var Nm=m(Ja=>{"use strict";var Mx=Ja&&Ja.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ja,"__esModule",{value:!0});var rt=Mi(),WI=Mx(km()),be=Yl(),HI=Jl(),Mm=Eo(),Ya=Om(),it=ko(),Ao=Wa(),Lm=Xa(),Ix=Mx(Im());function Li(t){let e=this.content[this.index];return this.index+=e.length,this.createPunctuator(e,t)}var Zl=class t{constructor(e,n={}){let r=this;r.content=e,r.length=e.length,r.index=0,r.tokenStart=null,r.tabWidth=n.tabWidth||1,r.line=1,r.lineStart=0,r.offset=0,r.validator=n.validator||new WI.default,r.unsafe=n.unsafe,r.errors=[],r.backlog=new Ix.default,r.snapshot=new Ix.default}scan(e,n){let r=t.scanHandlers[e];return r?r.call(this,n):this.validator.isDecDigit(e)?this.scanNumericLiteral(n):(this.index++,null)}isAtWhitespace(){return this.validator.isWhitespace(this.codeAt())}codeAt(e=0){let n=this.index+e;return n<this.length?this.content.charCodeAt(n):0}createEOL(e){let n=this,r=new rt.Token({type:rt.TokenType.EOL,value:it.Operator.EndOfLine,line:n.line,lineStart:n.lineStart,range:[n.tokenStart,n.index],offsetRange:[n.offset,n.offset],afterSpace:e});return n.snapshot.enqueue(r),r}createIdentifier(e,n){let r=this,i=new rt.Token({type:rt.TokenType.Identifier,value:e,line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset],afterSpace:n});return r.snapshot.enqueue(i),i}createEOF(e){let n=this,r=new rt.Token({type:rt.TokenType.EOF,value:it.Operator.EndOfFile,line:n.line,lineStart:n.lineStart,range:[n.index,n.index],offsetRange:[n.offset,n.offset],afterSpace:e});return n.snapshot.enqueue(r),r}createBoolean(e,n){let r=this,i=new rt.LiteralToken({type:rt.TokenType.BooleanLiteral,value:e===Ya.Literal.True,raw:e,line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset],afterSpace:n});return r.snapshot.enqueue(i),i}createNull(e){let n=this,r=new rt.LiteralToken({type:rt.TokenType.NilLiteral,value:null,raw:Ya.Literal.Null,line:n.line,lineStart:n.lineStart,range:[n.tokenStart,n.index],offsetRange:[n.offset,n.offset],afterSpace:e});return n.snapshot.enqueue(r),r}createSlice(e){let n=new rt.Token({type:rt.TokenType.SliceOperator,value:it.Operator.SliceSeperator,line:this.line,lineStart:this.lineStart,range:[this.tokenStart,this.index],offsetRange:[this.offset,this.offset],afterSpace:e});return this.snapshot.enqueue(n),n}createPunctuator(e,n){let r=new rt.Token({type:rt.TokenType.Punctuator,value:e,line:this.line,lineStart:this.lineStart,range:[this.tokenStart,this.index],offsetRange:[this.offset,this.offset],afterSpace:n});return this.snapshot.enqueue(r),r}createNumericLiteral(e,n,r){let i=new rt.LiteralToken({type:rt.TokenType.NumericLiteral,value:e,raw:n,line:this.line,lineStart:this.lineStart,range:[this.tokenStart,this.index],offsetRange:[this.offset,this.offset],afterSpace:r});return this.snapshot.enqueue(i),i}scanStringLiteral(e){let n=this,r=n.validator,i=n.line,s=n.lineStart,o=n.index,a=n.offset,u=n.offset,c=!1;for(;n.index<n.length;){n.index++;let g=n.codeAt();if(n.validator.isEndOfLine(g))r.isWinNewline(g,n.codeAt(1))&&n.index++,n.line++,u=n.index+1;else if(be.CharacterCode.QUOTE===g){if(be.CharacterCode.QUOTE!==n.codeAt(1)){c=!0;break}n.index++}}if(!c)return n.raise("Unexpected string end of file.",new Lm.Range(new Ao.Position(i,o-a+1),new Ao.Position(n.line,n.index-u+2)));n.index++;let l=n.content.slice(n.tokenStart,n.index),h=l.slice(1,-1).replace(/""/g,it.Operator.Escape),d=new rt.LiteralToken({type:rt.TokenType.StringLiteral,value:h,raw:l,line:i,lineStart:s,range:[n.tokenStart,n.index],offsetRange:[a,u],afterSpace:e,lastLine:n.line,lastLineStart:n.lineStart});return n.offset=u,n.snapshot.enqueue(d),d}scanComment(e){let n=this,r=n.validator,i=n.line,s=n.lineStart;for(;this.index<this.length&&!r.isEndOfLine(n.codeAt());n.index++);r.isWinNewline(n.codeAt(),n.codeAt(1))&&n.index++;let o=n.content.slice(n.tokenStart+2,n.index),a=new rt.Token({type:rt.TokenType.Comment,value:o,line:i,lineStart:s,range:[n.tokenStart,n.index],offsetRange:[n.offset,n.offset],afterSpace:e});return n.snapshot.enqueue(a),a}scanNumericLiteral(e){let n=this.validator,r,i;for(;this.index<this.length&&(r=i,i=this.codeAt(),n.isDecDigit(i)||be.CharacterCode.DOT===i||be.CharacterCode.LETTER_E===i||be.CharacterCode.LETTER_e===i||(be.CharacterCode.MINUS===i||be.CharacterCode.PLUS===i)&&(be.CharacterCode.LETTER_E===r||be.CharacterCode.LETTER_e===r));)this.index++;let s=this.content.slice(this.tokenStart,this.index),o=Number(s);return isNaN(o)?this.raise(`Invalid numeric literal: ${s}`,new Lm.Range(new Ao.Position(this.line,this.tokenStart-this.offset+1),new Ao.Position(this.line,this.index-this.offset+1))):this.createNumericLiteral(o,s,e)}scanPunctuator(e,n){return this.index+=e.length,this.createPunctuator(e,n)}skipWhiteSpace(){let e=this;for(;e.index<e.length;e.index++){let n=e.content[e.index];if(n===" ")e.offset-=e.tabWidth-1;else if(n!==" ")return}}scanKeyword(e,n){let r=this,i=r.validator,s=e;switch(e){case Mm.Keyword.End:{for(r.index++;i.isIdentifierPart(r.codeAt());r.index++);s=r.content.slice(r.tokenStart,r.index);break}case Mm.Keyword.Else:{let a=r.content.slice(r.tokenStart,r.index+3);a===Mm.Keyword.ElseIf&&(r.index+=3,s=a);break}}let o=new rt.Token({type:rt.TokenType.Keyword,value:s,line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset],afterSpace:n});return r.snapshot.enqueue(o),o}scanIdentifierOrKeyword(e){let n=this,r=n.validator;for(n.index++;r.isIdentifierPart(n.codeAt());n.index++);let i=n.content.slice(n.tokenStart,n.index);if(r.isKeyword(i))return n.scanKeyword(i,e);switch(i){case Ya.Literal.True:case Ya.Literal.False:return n.createBoolean(i,e);case Ya.Literal.Null:return n.createNull(e)}return n.createIdentifier(i,e)}next(){let e=this;if(e.backlog.size)return e.backlog.dequeue();let n=e.index;e.skipWhiteSpace();let r=n<e.index,i=e.codeAt();if(e.validator.isComment(i,e.codeAt(1)))return e.tokenStart=e.index,e.scanComment(r);if(this.index>=this.length)return e.createEOF(r);if(e.tokenStart=e.index,e.validator.isEndOfLine(i)){e.validator.isWinNewline(i,e.codeAt(1))&&e.index++;let a=e.createEOL(r);return e.line++,e.offset=e.index+1,e.lineStart=++e.index,a}if(e.validator.isIdentifierStart(i))return e.scanIdentifierOrKeyword(r);let s=e.line,o=e.scan(i,r);return o||e.raise(`Invalid character ${i} (Code: ${String.fromCharCode(i)})`,new Lm.Range(new Ao.Position(s,e.tokenStart-e.offset+1),new Ao.Position(e.line,e.index-e.offset+1)))}recordSnapshot(){this.snapshot.clear()}recoverFromSnapshot(){this.backlog.copyInto(this.snapshot)}raise(e,n){let r=this,i=new HI.LexerException(e,n);if(r.errors.push(i),r.unsafe)return new rt.Token({type:rt.TokenType.Invalid,value:"",line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset]});throw i}};Ja.default=Zl;Zl.scanHandlers={[be.CharacterCode.QUOTE]:function(e){return this.scanStringLiteral(e)},[be.CharacterCode.DOT]:function(e){return this.validator.isDecDigit(this.codeAt(1))?this.scanNumericLiteral(e):(this.index++,this.createPunctuator(it.Operator.Member,e))},[be.CharacterCode.EQUAL]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(it.Operator.Equal,e):this.scanPunctuator(it.Operator.Assign,e)},[be.CharacterCode.ARROW_LEFT]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(it.Operator.LessThanOrEqual,e):this.scanPunctuator(it.Operator.LessThan,e)},[be.CharacterCode.ARROW_RIGHT]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(it.Operator.GreaterThanOrEqual,e):this.scanPunctuator(it.Operator.GreaterThan,e)},[be.CharacterCode.EXCLAMATION_MARK]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(it.Operator.NotEqual,e):(this.index++,null)},[be.CharacterCode.MINUS]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(it.Operator.SubtractShorthand,e):this.scanPunctuator(it.Operator.Minus,e)},[be.CharacterCode.PLUS]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(it.Operator.AddShorthand,e):this.scanPunctuator(it.Operator.Plus,e)},[be.CharacterCode.ASTERISK]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(it.Operator.MultiplyShorthand,e):this.scanPunctuator(it.Operator.Asterik,e)},[be.CharacterCode.SLASH]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(it.Operator.DivideShorthand,e):this.scanPunctuator(it.Operator.Slash,e)},[be.CharacterCode.COLON]:function(e){return this.index++,this.createSlice(e)},[be.CharacterCode.CARET]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(it.Operator.PowerShorthand,e):this.scanPunctuator(it.Operator.Power,e)},[be.CharacterCode.PERCENT]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(it.Operator.ModuloShorthand,e):this.scanPunctuator(it.Operator.Modulo,e)},[be.CharacterCode.SEMICOLON]:function(e){return this.index++,this.createEOL(e)},[be.CharacterCode.COMMA]:Li,[be.CharacterCode.CURLY_BRACKET_LEFT]:Li,[be.CharacterCode.CURLY_BRACKET_RIGHT]:Li,[be.CharacterCode.SQUARE_BRACKETS_LEFT]:Li,[be.CharacterCode.SQUARE_BRACKETS_RIGHT]:Li,[be.CharacterCode.PARENTHESIS_LEFT]:Li,[be.CharacterCode.PARENTHESIS_RIGHT]:Li,[be.CharacterCode.AT_SIGN]:Li}});var ft=m(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.ASTComment=In.ASTBaseBlockWithScope=In.ASTBaseBlock=In.ASTBase=In.ASTType=void 0;var Lx;(function(t){t.BreakStatement="BreakStatement",t.ContinueStatement="ContinueStatement",t.ReturnStatement="ReturnStatement",t.IfShortcutStatement="IfShortcutStatement",t.IfShortcutClause="IfShortcutClause",t.ElseifShortcutClause="ElseifShortcutClause",t.ElseShortcutClause="ElseShortcutClause",t.IfStatement="IfStatement",t.IfClause="IfClause",t.ElseifClause="ElseifClause",t.ElseClause="ElseClause",t.WhileStatement="WhileStatement",t.AssignmentStatement="AssignmentStatement",t.CallStatement="CallStatement",t.FunctionDeclaration="FunctionDeclaration",t.ForGenericStatement="ForGenericStatement",t.Chunk="Chunk",t.Identifier="Identifier",t.StringLiteral="StringLiteral",t.NumericLiteral="NumericLiteral",t.BooleanLiteral="BooleanLiteral",t.NilLiteral="NilLiteral",t.Unknown="Unknown",t.MemberExpression="MemberExpression",t.CallExpression="CallExpression",t.Comment="Comment",t.NegationExpression="NegationExpression",t.BinaryNegatedExpression="BinaryNegatedExpression",t.UnaryExpression="UnaryExpression",t.MapKeyString="MapKeyString",t.MapValue="MapValue",t.MapConstructorExpression="MapConstructorExpression",t.MapCallExpression="MapCallExpression",t.ListValue="ListValue",t.ListConstructorExpression="ListConstructorExpression",t.EmptyExpression="EmptyExpression",t.IndexExpression="IndexExpression",t.BinaryExpression="BinaryExpression",t.LogicalExpression="LogicalExpression",t.IsaExpression="IsaExpression",t.SliceExpression="SliceExpression",t.ImportCodeExpression="ImportCodeExpression",t.InvalidCodeExpression="InvalidCodeExpression",t.ParenthesisExpression="ParenthesisExpression",t.ComparisonGroupExpression="ComparisonGroupExpression"})(Lx=In.ASTType||(In.ASTType={}));var Qa=class t{constructor(e,n){this.type=e,this.start=n.start,this.end=n.end,this.range=n.range,this.scope=n.scope||null}toString(){return`${this.type}[${this.start}-${this.end}][]`}clone(){return new t(this.type,{start:this.start,end:this.end,range:this.range,scope:this.scope})}};In.ASTBase=Qa;var eh=class t extends Qa{constructor(e,n){super(e,n),this.body=n.body||[]}toString(){let e=this.body.map(n=>`${n}`).join(`
35
+ `&&f++}b&&A.length>0&&x.push(A.length),this._lineOffsets=x}return this._lineOffsets},p.prototype.positionAt=function(x){x=Math.max(Math.min(x,this._content.length),0);var A=this.getLineOffsets(),b=0,f=A.length;if(f===0)return o.create(0,x);for(;b<f;){var D=Math.floor((b+f)/2);A[D]>x?f=D:b=D+1}var $=b-1;return o.create($,x-A[$])},p.prototype.offsetAt=function(x){var A=this.getLineOffsets();if(x.line>=A.length)return this._content.length;if(x.line<0)return 0;var b=A[x.line],f=x.line+1<A.length?A[x.line+1]:this._content.length;return Math.max(Math.min(b+x.character,f),b)},Object.defineProperty(p.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),p}(),I;(function(p){var x=Object.prototype.toString;function A(Ce){return typeof Ce<"u"}p.defined=A;function b(Ce){return typeof Ce>"u"}p.undefined=b;function f(Ce){return Ce===!0||Ce===!1}p.boolean=f;function D(Ce){return x.call(Ce)==="[object String]"}p.string=D;function $(Ce){return x.call(Ce)==="[object Number]"}p.number=$;function me(Ce,ro,qc){return x.call(Ce)==="[object Number]"&&ro<=Ce&&Ce<=qc}p.numberRange=me;function dt(Ce){return x.call(Ce)==="[object Number]"&&-2147483648<=Ce&&Ce<=2147483647}p.integer=dt;function Ke(Ce){return x.call(Ce)==="[object Number]"&&0<=Ce&&Ce<=2147483647}p.uinteger=Ke;function pr(Ce){return x.call(Ce)==="[object Function]"}p.func=pr;function gr(Ce){return Ce!==null&&typeof Ce=="object"}p.objectLiteral=gr;function si(Ce,ro){return Array.isArray(Ce)&&Ce.every(ro)}p.typedArray=si})(I||(I={}))})});var nt=m(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.ProtocolNotificationType=Sn.ProtocolNotificationType0=Sn.ProtocolRequestType=Sn.ProtocolRequestType0=Sn.RegistrationType=Sn.MessageDirection=void 0;var fo=gs(),rT;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(rT||(Sn.MessageDirection=rT={}));var Fg=class{constructor(e){this.method=e}};Sn.RegistrationType=Fg;var $g=class extends fo.RequestType0{constructor(e){super(e)}};Sn.ProtocolRequestType0=$g;var Bg=class extends fo.RequestType{constructor(e){super(e,fo.ParameterStructures.byName)}};Sn.ProtocolRequestType=Bg;var Wg=class extends fo.NotificationType0{constructor(e){super(e)}};Sn.ProtocolNotificationType0=Wg;var Ug=class extends fo.NotificationType{constructor(e){super(e,fo.ParameterStructures.byName)}};Sn.ProtocolNotificationType=Ug});var ul=m(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.objectLiteral=Ct.typedArray=Ct.stringArray=Ct.array=Ct.func=Ct.error=Ct.number=Ct.string=Ct.boolean=void 0;function vD(t){return t===!0||t===!1}Ct.boolean=vD;function iT(t){return typeof t=="string"||t instanceof String}Ct.string=iT;function SD(t){return typeof t=="number"||t instanceof Number}Ct.number=SD;function wD(t){return t instanceof Error}Ct.error=wD;function TD(t){return typeof t=="function"}Ct.func=TD;function sT(t){return Array.isArray(t)}Ct.array=sT;function ED(t){return sT(t)&&t.every(e=>iT(e))}Ct.stringArray=ED;function xD(t,e){return Array.isArray(t)&&t.every(e)}Ct.typedArray=xD;function kD(t){return t!==null&&typeof t=="object"}Ct.objectLiteral=kD});var uT=m(cl=>{"use strict";Object.defineProperty(cl,"__esModule",{value:!0});cl.ImplementationRequest=void 0;var oT=nt(),aT;(function(t){t.method="textDocument/implementation",t.messageDirection=oT.MessageDirection.clientToServer,t.type=new oT.ProtocolRequestType(t.method)})(aT||(cl.ImplementationRequest=aT={}))});var hT=m(ll=>{"use strict";Object.defineProperty(ll,"__esModule",{value:!0});ll.TypeDefinitionRequest=void 0;var cT=nt(),lT;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=cT.MessageDirection.clientToServer,t.type=new cT.ProtocolRequestType(t.method)})(lT||(ll.TypeDefinitionRequest=lT={}))});var pT=m(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.DidChangeWorkspaceFoldersNotification=po.WorkspaceFoldersRequest=void 0;var hl=nt(),dT;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=hl.MessageDirection.serverToClient,t.type=new hl.ProtocolRequestType0(t.method)})(dT||(po.WorkspaceFoldersRequest=dT={}));var fT;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=hl.MessageDirection.clientToServer,t.type=new hl.ProtocolNotificationType(t.method)})(fT||(po.DidChangeWorkspaceFoldersNotification=fT={}))});var yT=m(dl=>{"use strict";Object.defineProperty(dl,"__esModule",{value:!0});dl.ConfigurationRequest=void 0;var gT=nt(),mT;(function(t){t.method="workspace/configuration",t.messageDirection=gT.MessageDirection.serverToClient,t.type=new gT.ProtocolRequestType(t.method)})(mT||(dl.ConfigurationRequest=mT={}))});var vT=m(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.ColorPresentationRequest=go.DocumentColorRequest=void 0;var fl=nt(),bT;(function(t){t.method="textDocument/documentColor",t.messageDirection=fl.MessageDirection.clientToServer,t.type=new fl.ProtocolRequestType(t.method)})(bT||(go.DocumentColorRequest=bT={}));var _T;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=fl.MessageDirection.clientToServer,t.type=new fl.ProtocolRequestType(t.method)})(_T||(go.ColorPresentationRequest=_T={}))});var TT=m(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.FoldingRangeRefreshRequest=mo.FoldingRangeRequest=void 0;var pl=nt(),ST;(function(t){t.method="textDocument/foldingRange",t.messageDirection=pl.MessageDirection.clientToServer,t.type=new pl.ProtocolRequestType(t.method)})(ST||(mo.FoldingRangeRequest=ST={}));var wT;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=pl.MessageDirection.serverToClient,t.type=new pl.ProtocolRequestType0(t.method)})(wT||(mo.FoldingRangeRefreshRequest=wT={}))});var kT=m(gl=>{"use strict";Object.defineProperty(gl,"__esModule",{value:!0});gl.DeclarationRequest=void 0;var ET=nt(),xT;(function(t){t.method="textDocument/declaration",t.messageDirection=ET.MessageDirection.clientToServer,t.type=new ET.ProtocolRequestType(t.method)})(xT||(gl.DeclarationRequest=xT={}))});var OT=m(ml=>{"use strict";Object.defineProperty(ml,"__esModule",{value:!0});ml.SelectionRangeRequest=void 0;var AT=nt(),CT;(function(t){t.method="textDocument/selectionRange",t.messageDirection=AT.MessageDirection.clientToServer,t.type=new AT.ProtocolRequestType(t.method)})(CT||(ml.SelectionRangeRequest=CT={}))});var IT=m(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.WorkDoneProgressCancelNotification=Ri.WorkDoneProgressCreateRequest=Ri.WorkDoneProgress=void 0;var AD=gs(),yl=nt(),RT;(function(t){t.type=new AD.ProgressType;function e(n){return n===t.type}t.is=e})(RT||(Ri.WorkDoneProgress=RT={}));var PT;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=yl.MessageDirection.serverToClient,t.type=new yl.ProtocolRequestType(t.method)})(PT||(Ri.WorkDoneProgressCreateRequest=PT={}));var DT;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=yl.MessageDirection.clientToServer,t.type=new yl.ProtocolNotificationType(t.method)})(DT||(Ri.WorkDoneProgressCancelNotification=DT={}))});var qT=m(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.CallHierarchyOutgoingCallsRequest=Pi.CallHierarchyIncomingCallsRequest=Pi.CallHierarchyPrepareRequest=void 0;var yo=nt(),MT;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=yo.MessageDirection.clientToServer,t.type=new yo.ProtocolRequestType(t.method)})(MT||(Pi.CallHierarchyPrepareRequest=MT={}));var LT;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=yo.MessageDirection.clientToServer,t.type=new yo.ProtocolRequestType(t.method)})(LT||(Pi.CallHierarchyIncomingCallsRequest=LT={}));var NT;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=yo.MessageDirection.clientToServer,t.type=new yo.ProtocolRequestType(t.method)})(NT||(Pi.CallHierarchyOutgoingCallsRequest=NT={}))});var UT=m(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.SemanticTokensRefreshRequest=wn.SemanticTokensRangeRequest=wn.SemanticTokensDeltaRequest=wn.SemanticTokensRequest=wn.SemanticTokensRegistrationType=wn.TokenFormat=void 0;var ai=nt(),jT;(function(t){t.Relative="relative"})(jT||(wn.TokenFormat=jT={}));var La;(function(t){t.method="textDocument/semanticTokens",t.type=new ai.RegistrationType(t.method)})(La||(wn.SemanticTokensRegistrationType=La={}));var FT;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=ai.MessageDirection.clientToServer,t.type=new ai.ProtocolRequestType(t.method),t.registrationMethod=La.method})(FT||(wn.SemanticTokensRequest=FT={}));var $T;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=ai.MessageDirection.clientToServer,t.type=new ai.ProtocolRequestType(t.method),t.registrationMethod=La.method})($T||(wn.SemanticTokensDeltaRequest=$T={}));var BT;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=ai.MessageDirection.clientToServer,t.type=new ai.ProtocolRequestType(t.method),t.registrationMethod=La.method})(BT||(wn.SemanticTokensRangeRequest=BT={}));var WT;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=ai.MessageDirection.serverToClient,t.type=new ai.ProtocolRequestType0(t.method)})(WT||(wn.SemanticTokensRefreshRequest=WT={}))});var zT=m(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});bl.ShowDocumentRequest=void 0;var HT=nt(),GT;(function(t){t.method="window/showDocument",t.messageDirection=HT.MessageDirection.serverToClient,t.type=new HT.ProtocolRequestType(t.method)})(GT||(bl.ShowDocumentRequest=GT={}))});var XT=m(_l=>{"use strict";Object.defineProperty(_l,"__esModule",{value:!0});_l.LinkedEditingRangeRequest=void 0;var KT=nt(),VT;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=KT.MessageDirection.clientToServer,t.type=new KT.ProtocolRequestType(t.method)})(VT||(_l.LinkedEditingRangeRequest=VT={}))});var r0=m(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.WillDeleteFilesRequest=tn.DidDeleteFilesNotification=tn.DidRenameFilesNotification=tn.WillRenameFilesRequest=tn.DidCreateFilesNotification=tn.WillCreateFilesRequest=tn.FileOperationPatternKind=void 0;var Wn=nt(),YT;(function(t){t.file="file",t.folder="folder"})(YT||(tn.FileOperationPatternKind=YT={}));var JT;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolRequestType(t.method)})(JT||(tn.WillCreateFilesRequest=JT={}));var QT;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolNotificationType(t.method)})(QT||(tn.DidCreateFilesNotification=QT={}));var ZT;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolRequestType(t.method)})(ZT||(tn.WillRenameFilesRequest=ZT={}));var e0;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolNotificationType(t.method)})(e0||(tn.DidRenameFilesNotification=e0={}));var t0;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolNotificationType(t.method)})(t0||(tn.DidDeleteFilesNotification=t0={}));var n0;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=Wn.MessageDirection.clientToServer,t.type=new Wn.ProtocolRequestType(t.method)})(n0||(tn.WillDeleteFilesRequest=n0={}))});var u0=m(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.MonikerRequest=Di.MonikerKind=Di.UniquenessLevel=void 0;var i0=nt(),s0;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(s0||(Di.UniquenessLevel=s0={}));var o0;(function(t){t.$import="import",t.$export="export",t.local="local"})(o0||(Di.MonikerKind=o0={}));var a0;(function(t){t.method="textDocument/moniker",t.messageDirection=i0.MessageDirection.clientToServer,t.type=new i0.ProtocolRequestType(t.method)})(a0||(Di.MonikerRequest=a0={}))});var d0=m(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.TypeHierarchySubtypesRequest=Ii.TypeHierarchySupertypesRequest=Ii.TypeHierarchyPrepareRequest=void 0;var bo=nt(),c0;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=bo.MessageDirection.clientToServer,t.type=new bo.ProtocolRequestType(t.method)})(c0||(Ii.TypeHierarchyPrepareRequest=c0={}));var l0;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=bo.MessageDirection.clientToServer,t.type=new bo.ProtocolRequestType(t.method)})(l0||(Ii.TypeHierarchySupertypesRequest=l0={}));var h0;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=bo.MessageDirection.clientToServer,t.type=new bo.ProtocolRequestType(t.method)})(h0||(Ii.TypeHierarchySubtypesRequest=h0={}))});var g0=m(_o=>{"use strict";Object.defineProperty(_o,"__esModule",{value:!0});_o.InlineValueRefreshRequest=_o.InlineValueRequest=void 0;var vl=nt(),f0;(function(t){t.method="textDocument/inlineValue",t.messageDirection=vl.MessageDirection.clientToServer,t.type=new vl.ProtocolRequestType(t.method)})(f0||(_o.InlineValueRequest=f0={}));var p0;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=vl.MessageDirection.serverToClient,t.type=new vl.ProtocolRequestType0(t.method)})(p0||(_o.InlineValueRefreshRequest=p0={}))});var _0=m(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.InlayHintRefreshRequest=Mi.InlayHintResolveRequest=Mi.InlayHintRequest=void 0;var vo=nt(),m0;(function(t){t.method="textDocument/inlayHint",t.messageDirection=vo.MessageDirection.clientToServer,t.type=new vo.ProtocolRequestType(t.method)})(m0||(Mi.InlayHintRequest=m0={}));var y0;(function(t){t.method="inlayHint/resolve",t.messageDirection=vo.MessageDirection.clientToServer,t.type=new vo.ProtocolRequestType(t.method)})(y0||(Mi.InlayHintResolveRequest=y0={}));var b0;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=vo.MessageDirection.serverToClient,t.type=new vo.ProtocolRequestType0(t.method)})(b0||(Mi.InlayHintRefreshRequest=b0={}))});var k0=m(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.DiagnosticRefreshRequest=Un.WorkspaceDiagnosticRequest=Un.DocumentDiagnosticRequest=Un.DocumentDiagnosticReportKind=Un.DiagnosticServerCancellationData=void 0;var x0=gs(),CD=ul(),So=nt(),v0;(function(t){function e(n){let r=n;return r&&CD.boolean(r.retriggerRequest)}t.is=e})(v0||(Un.DiagnosticServerCancellationData=v0={}));var S0;(function(t){t.Full="full",t.Unchanged="unchanged"})(S0||(Un.DocumentDiagnosticReportKind=S0={}));var w0;(function(t){t.method="textDocument/diagnostic",t.messageDirection=So.MessageDirection.clientToServer,t.type=new So.ProtocolRequestType(t.method),t.partialResult=new x0.ProgressType})(w0||(Un.DocumentDiagnosticRequest=w0={}));var T0;(function(t){t.method="workspace/diagnostic",t.messageDirection=So.MessageDirection.clientToServer,t.type=new So.ProtocolRequestType(t.method),t.partialResult=new x0.ProgressType})(T0||(Un.WorkspaceDiagnosticRequest=T0={}));var E0;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=So.MessageDirection.serverToClient,t.type=new So.ProtocolRequestType0(t.method)})(E0||(Un.DiagnosticRefreshRequest=E0={}))});var I0=m(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 Na=al(),yr=ul(),Ir=nt(),Hg;(function(t){t.Markup=1,t.Code=2;function e(n){return n===1||n===2}t.is=e})(Hg||(ft.NotebookCellKind=Hg={}));var Gg;(function(t){function e(i,s){let o={executionOrder:i};return(s===!0||s===!1)&&(o.success=s),o}t.create=e;function n(i){let s=i;return yr.objectLiteral(s)&&Na.uinteger.is(s.executionOrder)&&(s.success===void 0||yr.boolean(s.success))}t.is=n;function r(i,s){return i===s?!0:i==null||s===null||s===void 0?!1:i.executionOrder===s.executionOrder&&i.success===s.success}t.equals=r})(Gg||(ft.ExecutionSummary=Gg={}));var Sl;(function(t){function e(s,o){return{kind:s,document:o}}t.create=e;function n(s){let o=s;return yr.objectLiteral(o)&&Hg.is(o.kind)&&Na.DocumentUri.is(o.document)&&(o.metadata===void 0||yr.objectLiteral(o.metadata))}t.is=n;function r(s,o){let a=new Set;return s.document!==o.document&&a.add("document"),s.kind!==o.kind&&a.add("kind"),s.executionSummary!==o.executionSummary&&a.add("executionSummary"),(s.metadata!==void 0||o.metadata!==void 0)&&!i(s.metadata,o.metadata)&&a.add("metadata"),(s.executionSummary!==void 0||o.executionSummary!==void 0)&&!Gg.equals(s.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}t.diff=r;function i(s,o){if(s===o)return!0;if(s==null||o===null||o===void 0||typeof s!=typeof o||typeof s!="object")return!1;let a=Array.isArray(s),u=Array.isArray(o);if(a!==u)return!1;if(a&&u){if(s.length!==o.length)return!1;for(let c=0;c<s.length;c++)if(!i(s[c],o[c]))return!1}if(yr.objectLiteral(s)&&yr.objectLiteral(o)){let c=Object.keys(s),l=Object.keys(o);if(c.length!==l.length||(c.sort(),l.sort(),!i(c,l)))return!1;for(let h=0;h<c.length;h++){let d=c[h];if(!i(s[d],o[d]))return!1}}return!0}})(Sl||(ft.NotebookCell=Sl={}));var A0;(function(t){function e(r,i,s,o){return{uri:r,notebookType:i,version:s,cells:o}}t.create=e;function n(r){let i=r;return yr.objectLiteral(i)&&yr.string(i.uri)&&Na.integer.is(i.version)&&yr.typedArray(i.cells,Sl.is)}t.is=n})(A0||(ft.NotebookDocument=A0={}));var wo;(function(t){t.method="notebookDocument/sync",t.messageDirection=Ir.MessageDirection.clientToServer,t.type=new Ir.RegistrationType(t.method)})(wo||(ft.NotebookDocumentSyncRegistrationType=wo={}));var C0;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=Ir.MessageDirection.clientToServer,t.type=new Ir.ProtocolNotificationType(t.method),t.registrationMethod=wo.method})(C0||(ft.DidOpenNotebookDocumentNotification=C0={}));var O0;(function(t){function e(r){let i=r;return yr.objectLiteral(i)&&Na.uinteger.is(i.start)&&Na.uinteger.is(i.deleteCount)&&(i.cells===void 0||yr.typedArray(i.cells,Sl.is))}t.is=e;function n(r,i,s){let o={start:r,deleteCount:i};return s!==void 0&&(o.cells=s),o}t.create=n})(O0||(ft.NotebookCellArrayChange=O0={}));var R0;(function(t){t.method="notebookDocument/didChange",t.messageDirection=Ir.MessageDirection.clientToServer,t.type=new Ir.ProtocolNotificationType(t.method),t.registrationMethod=wo.method})(R0||(ft.DidChangeNotebookDocumentNotification=R0={}));var P0;(function(t){t.method="notebookDocument/didSave",t.messageDirection=Ir.MessageDirection.clientToServer,t.type=new Ir.ProtocolNotificationType(t.method),t.registrationMethod=wo.method})(P0||(ft.DidSaveNotebookDocumentNotification=P0={}));var D0;(function(t){t.method="notebookDocument/didClose",t.messageDirection=Ir.MessageDirection.clientToServer,t.type=new Ir.ProtocolNotificationType(t.method),t.registrationMethod=wo.method})(D0||(ft.DidCloseNotebookDocumentNotification=D0={}))});var N0=m(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});wl.InlineCompletionRequest=void 0;var M0=nt(),L0;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=M0.MessageDirection.clientToServer,t.type=new M0.ProtocolRequestType(t.method)})(L0||(wl.InlineCompletionRequest=L0={}))});var XE=m(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 H=nt(),q0=al(),$t=ul(),OD=uT();Object.defineProperty(S,"ImplementationRequest",{enumerable:!0,get:function(){return OD.ImplementationRequest}});var RD=hT();Object.defineProperty(S,"TypeDefinitionRequest",{enumerable:!0,get:function(){return RD.TypeDefinitionRequest}});var GE=pT();Object.defineProperty(S,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return GE.WorkspaceFoldersRequest}});Object.defineProperty(S,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return GE.DidChangeWorkspaceFoldersNotification}});var PD=yT();Object.defineProperty(S,"ConfigurationRequest",{enumerable:!0,get:function(){return PD.ConfigurationRequest}});var zE=vT();Object.defineProperty(S,"DocumentColorRequest",{enumerable:!0,get:function(){return zE.DocumentColorRequest}});Object.defineProperty(S,"ColorPresentationRequest",{enumerable:!0,get:function(){return zE.ColorPresentationRequest}});var KE=TT();Object.defineProperty(S,"FoldingRangeRequest",{enumerable:!0,get:function(){return KE.FoldingRangeRequest}});Object.defineProperty(S,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return KE.FoldingRangeRefreshRequest}});var DD=kT();Object.defineProperty(S,"DeclarationRequest",{enumerable:!0,get:function(){return DD.DeclarationRequest}});var ID=OT();Object.defineProperty(S,"SelectionRangeRequest",{enumerable:!0,get:function(){return ID.SelectionRangeRequest}});var Yg=IT();Object.defineProperty(S,"WorkDoneProgress",{enumerable:!0,get:function(){return Yg.WorkDoneProgress}});Object.defineProperty(S,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return Yg.WorkDoneProgressCreateRequest}});Object.defineProperty(S,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return Yg.WorkDoneProgressCancelNotification}});var Jg=qT();Object.defineProperty(S,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Jg.CallHierarchyIncomingCallsRequest}});Object.defineProperty(S,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Jg.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(S,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Jg.CallHierarchyPrepareRequest}});var To=UT();Object.defineProperty(S,"TokenFormat",{enumerable:!0,get:function(){return To.TokenFormat}});Object.defineProperty(S,"SemanticTokensRequest",{enumerable:!0,get:function(){return To.SemanticTokensRequest}});Object.defineProperty(S,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return To.SemanticTokensDeltaRequest}});Object.defineProperty(S,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return To.SemanticTokensRangeRequest}});Object.defineProperty(S,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return To.SemanticTokensRefreshRequest}});Object.defineProperty(S,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return To.SemanticTokensRegistrationType}});var MD=zT();Object.defineProperty(S,"ShowDocumentRequest",{enumerable:!0,get:function(){return MD.ShowDocumentRequest}});var LD=XT();Object.defineProperty(S,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return LD.LinkedEditingRangeRequest}});var ms=r0();Object.defineProperty(S,"FileOperationPatternKind",{enumerable:!0,get:function(){return ms.FileOperationPatternKind}});Object.defineProperty(S,"DidCreateFilesNotification",{enumerable:!0,get:function(){return ms.DidCreateFilesNotification}});Object.defineProperty(S,"WillCreateFilesRequest",{enumerable:!0,get:function(){return ms.WillCreateFilesRequest}});Object.defineProperty(S,"DidRenameFilesNotification",{enumerable:!0,get:function(){return ms.DidRenameFilesNotification}});Object.defineProperty(S,"WillRenameFilesRequest",{enumerable:!0,get:function(){return ms.WillRenameFilesRequest}});Object.defineProperty(S,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return ms.DidDeleteFilesNotification}});Object.defineProperty(S,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return ms.WillDeleteFilesRequest}});var Qg=u0();Object.defineProperty(S,"UniquenessLevel",{enumerable:!0,get:function(){return Qg.UniquenessLevel}});Object.defineProperty(S,"MonikerKind",{enumerable:!0,get:function(){return Qg.MonikerKind}});Object.defineProperty(S,"MonikerRequest",{enumerable:!0,get:function(){return Qg.MonikerRequest}});var Zg=d0();Object.defineProperty(S,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return Zg.TypeHierarchyPrepareRequest}});Object.defineProperty(S,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return Zg.TypeHierarchySubtypesRequest}});Object.defineProperty(S,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return Zg.TypeHierarchySupertypesRequest}});var VE=g0();Object.defineProperty(S,"InlineValueRequest",{enumerable:!0,get:function(){return VE.InlineValueRequest}});Object.defineProperty(S,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return VE.InlineValueRefreshRequest}});var em=_0();Object.defineProperty(S,"InlayHintRequest",{enumerable:!0,get:function(){return em.InlayHintRequest}});Object.defineProperty(S,"InlayHintResolveRequest",{enumerable:!0,get:function(){return em.InlayHintResolveRequest}});Object.defineProperty(S,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return em.InlayHintRefreshRequest}});var qa=k0();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 Mr=I0();Object.defineProperty(S,"NotebookCellKind",{enumerable:!0,get:function(){return Mr.NotebookCellKind}});Object.defineProperty(S,"ExecutionSummary",{enumerable:!0,get:function(){return Mr.ExecutionSummary}});Object.defineProperty(S,"NotebookCell",{enumerable:!0,get:function(){return Mr.NotebookCell}});Object.defineProperty(S,"NotebookDocument",{enumerable:!0,get:function(){return Mr.NotebookDocument}});Object.defineProperty(S,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return Mr.NotebookDocumentSyncRegistrationType}});Object.defineProperty(S,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return Mr.DidOpenNotebookDocumentNotification}});Object.defineProperty(S,"NotebookCellArrayChange",{enumerable:!0,get:function(){return Mr.NotebookCellArrayChange}});Object.defineProperty(S,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return Mr.DidChangeNotebookDocumentNotification}});Object.defineProperty(S,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return Mr.DidSaveNotebookDocumentNotification}});Object.defineProperty(S,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return Mr.DidCloseNotebookDocumentNotification}});var ND=N0();Object.defineProperty(S,"InlineCompletionRequest",{enumerable:!0,get:function(){return ND.InlineCompletionRequest}});var zg;(function(t){function e(n){let r=n;return $t.string(r)||$t.string(r.language)||$t.string(r.scheme)||$t.string(r.pattern)}t.is=e})(zg||(S.TextDocumentFilter=zg={}));var Kg;(function(t){function e(n){let r=n;return $t.objectLiteral(r)&&($t.string(r.notebookType)||$t.string(r.scheme)||$t.string(r.pattern))}t.is=e})(Kg||(S.NotebookDocumentFilter=Kg={}));var Vg;(function(t){function e(n){let r=n;return $t.objectLiteral(r)&&($t.string(r.notebook)||Kg.is(r.notebook))&&(r.language===void 0||$t.string(r.language))}t.is=e})(Vg||(S.NotebookCellTextDocumentFilter=Vg={}));var Xg;(function(t){function e(n){if(!Array.isArray(n))return!1;for(let r of n)if(!$t.string(r)&&!zg.is(r)&&!Vg.is(r))return!1;return!0}t.is=e})(Xg||(S.DocumentSelector=Xg={}));var j0;(function(t){t.method="client/registerCapability",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolRequestType(t.method)})(j0||(S.RegistrationRequest=j0={}));var F0;(function(t){t.method="client/unregisterCapability",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolRequestType(t.method)})(F0||(S.UnregistrationRequest=F0={}));var $0;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})($0||(S.ResourceOperationKind=$0={}));var B0;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(B0||(S.FailureHandlingKind=B0={}));var W0;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(W0||(S.PositionEncodingKind=W0={}));var U0;(function(t){function e(n){let r=n;return r&&$t.string(r.id)&&r.id.length>0}t.hasId=e})(U0||(S.StaticRegistrationOptions=U0={}));var H0;(function(t){function e(n){let r=n;return r&&(r.documentSelector===null||Xg.is(r.documentSelector))}t.is=e})(H0||(S.TextDocumentRegistrationOptions=H0={}));var G0;(function(t){function e(r){let i=r;return $t.objectLiteral(i)&&(i.workDoneProgress===void 0||$t.boolean(i.workDoneProgress))}t.is=e;function n(r){let i=r;return i&&$t.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=n})(G0||(S.WorkDoneProgressOptions=G0={}));var z0;(function(t){t.method="initialize",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(z0||(S.InitializeRequest=z0={}));var K0;(function(t){t.unknownProtocolVersion=1})(K0||(S.InitializeErrorCodes=K0={}));var V0;(function(t){t.method="initialized",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})(V0||(S.InitializedNotification=V0={}));var X0;(function(t){t.method="shutdown",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType0(t.method)})(X0||(S.ShutdownRequest=X0={}));var Y0;(function(t){t.method="exit",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType0(t.method)})(Y0||(S.ExitNotification=Y0={}));var J0;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})(J0||(S.DidChangeConfigurationNotification=J0={}));var Q0;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(Q0||(S.MessageType=Q0={}));var Z0;(function(t){t.method="window/showMessage",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolNotificationType(t.method)})(Z0||(S.ShowMessageNotification=Z0={}));var eE;(function(t){t.method="window/showMessageRequest",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolRequestType(t.method)})(eE||(S.ShowMessageRequest=eE={}));var tE;(function(t){t.method="window/logMessage",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolNotificationType(t.method)})(tE||(S.LogMessageNotification=tE={}));var nE;(function(t){t.method="telemetry/event",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolNotificationType(t.method)})(nE||(S.TelemetryEventNotification=nE={}));var rE;(function(t){t.None=0,t.Full=1,t.Incremental=2})(rE||(S.TextDocumentSyncKind=rE={}));var iE;(function(t){t.method="textDocument/didOpen",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})(iE||(S.DidOpenTextDocumentNotification=iE={}));var sE;(function(t){function e(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}t.isIncremental=e;function n(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}t.isFull=n})(sE||(S.TextDocumentContentChangeEvent=sE={}));var oE;(function(t){t.method="textDocument/didChange",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})(oE||(S.DidChangeTextDocumentNotification=oE={}));var aE;(function(t){t.method="textDocument/didClose",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})(aE||(S.DidCloseTextDocumentNotification=aE={}));var uE;(function(t){t.method="textDocument/didSave",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})(uE||(S.DidSaveTextDocumentNotification=uE={}));var cE;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(cE||(S.TextDocumentSaveReason=cE={}));var lE;(function(t){t.method="textDocument/willSave",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})(lE||(S.WillSaveTextDocumentNotification=lE={}));var hE;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(hE||(S.WillSaveTextDocumentWaitUntilRequest=hE={}));var dE;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolNotificationType(t.method)})(dE||(S.DidChangeWatchedFilesNotification=dE={}));var fE;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(fE||(S.FileChangeType=fE={}));var pE;(function(t){function e(n){let r=n;return $t.objectLiteral(r)&&(q0.URI.is(r.baseUri)||q0.WorkspaceFolder.is(r.baseUri))&&$t.string(r.pattern)}t.is=e})(pE||(S.RelativePattern=pE={}));var gE;(function(t){t.Create=1,t.Change=2,t.Delete=4})(gE||(S.WatchKind=gE={}));var mE;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolNotificationType(t.method)})(mE||(S.PublishDiagnosticsNotification=mE={}));var yE;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(yE||(S.CompletionTriggerKind=yE={}));var bE;(function(t){t.method="textDocument/completion",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(bE||(S.CompletionRequest=bE={}));var _E;(function(t){t.method="completionItem/resolve",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(_E||(S.CompletionResolveRequest=_E={}));var vE;(function(t){t.method="textDocument/hover",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(vE||(S.HoverRequest=vE={}));var SE;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(SE||(S.SignatureHelpTriggerKind=SE={}));var wE;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(wE||(S.SignatureHelpRequest=wE={}));var TE;(function(t){t.method="textDocument/definition",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(TE||(S.DefinitionRequest=TE={}));var EE;(function(t){t.method="textDocument/references",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(EE||(S.ReferencesRequest=EE={}));var xE;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(xE||(S.DocumentHighlightRequest=xE={}));var kE;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(kE||(S.DocumentSymbolRequest=kE={}));var AE;(function(t){t.method="textDocument/codeAction",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(AE||(S.CodeActionRequest=AE={}));var CE;(function(t){t.method="codeAction/resolve",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(CE||(S.CodeActionResolveRequest=CE={}));var OE;(function(t){t.method="workspace/symbol",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(OE||(S.WorkspaceSymbolRequest=OE={}));var RE;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(RE||(S.WorkspaceSymbolResolveRequest=RE={}));var PE;(function(t){t.method="textDocument/codeLens",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(PE||(S.CodeLensRequest=PE={}));var DE;(function(t){t.method="codeLens/resolve",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(DE||(S.CodeLensResolveRequest=DE={}));var IE;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolRequestType0(t.method)})(IE||(S.CodeLensRefreshRequest=IE={}));var ME;(function(t){t.method="textDocument/documentLink",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(ME||(S.DocumentLinkRequest=ME={}));var LE;(function(t){t.method="documentLink/resolve",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(LE||(S.DocumentLinkResolveRequest=LE={}));var NE;(function(t){t.method="textDocument/formatting",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(NE||(S.DocumentFormattingRequest=NE={}));var qE;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(qE||(S.DocumentRangeFormattingRequest=qE={}));var jE;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(jE||(S.DocumentRangesFormattingRequest=jE={}));var FE;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(FE||(S.DocumentOnTypeFormattingRequest=FE={}));var $E;(function(t){t.Identifier=1})($E||(S.PrepareSupportDefaultBehavior=$E={}));var BE;(function(t){t.method="textDocument/rename",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(BE||(S.RenameRequest=BE={}));var WE;(function(t){t.method="textDocument/prepareRename",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(WE||(S.PrepareRenameRequest=WE={}));var UE;(function(t){t.method="workspace/executeCommand",t.messageDirection=H.MessageDirection.clientToServer,t.type=new H.ProtocolRequestType(t.method)})(UE||(S.ExecuteCommandRequest=UE={}));var HE;(function(t){t.method="workspace/applyEdit",t.messageDirection=H.MessageDirection.serverToClient,t.type=new H.ProtocolRequestType("workspace/applyEdit")})(HE||(S.ApplyWorkspaceEditRequest=HE={}))});var JE=m(Tl=>{"use strict";Object.defineProperty(Tl,"__esModule",{value:!0});Tl.createProtocolConnection=void 0;var YE=gs();function qD(t,e,n,r){return YE.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,YE.createMessageConnection)(t,e,n,r)}Tl.createProtocolConnection=qD});var ZE=m(Tn=>{"use strict";var jD=Tn&&Tn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),El=Tn&&Tn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&jD(e,t,n)};Object.defineProperty(Tn,"__esModule",{value:!0});Tn.LSPErrorCodes=Tn.createProtocolConnection=void 0;El(gs(),Tn);El(al(),Tn);El(nt(),Tn);El(XE(),Tn);var FD=JE();Object.defineProperty(Tn,"createProtocolConnection",{enumerable:!0,get:function(){return FD.createProtocolConnection}});var QE;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(QE||(Tn.LSPErrorCodes=QE={}))});var vt=m(Lr=>{"use strict";var $D=Lr&&Lr.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),ex=Lr&&Lr.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&$D(e,t,n)};Object.defineProperty(Lr,"__esModule",{value:!0});Lr.createProtocolConnection=void 0;var BD=jg();ex(jg(),Lr);ex(ZE(),Lr);function WD(t,e,n,r){return(0,BD.createMessageConnection)(t,e,n,r)}Lr.createProtocolConnection=WD});var tm=m(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.generateUuid=Hn.parse=Hn.isUUID=Hn.v4=Hn.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"];Hn.empty=new ja("00000000-0000-0000-0000-000000000000");function tx(){return new Fa}Hn.v4=tx;var UD=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function nx(t){return UD.test(t)}Hn.isUUID=nx;function HD(t){if(!nx(t))throw new Error("invalid uuid");return new ja(t)}Hn.parse=HD;function GD(){return tx().asHex()}Hn.generateUuid=GD});var rx=m(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.attachPartialResult=Ni.ProgressFeature=Ni.attachWorkDone=void 0;var Li=vt(),zD=tm(),ys=class t{constructor(e,n){this._connection=e,this._token=n,t.Instances.set(this._token,this)}begin(e,n,r,i){let s={kind:"begin",title:e,percentage:n,message:r,cancellable:i};this._connection.sendProgress(Li.WorkDoneProgress.type,this._token,s)}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(Li.WorkDoneProgress.type,this._token,r)}done(){t.Instances.delete(this._token),this._connection.sendProgress(Li.WorkDoneProgress.type,this._token,{kind:"end"})}};ys.Instances=new Map;var xl=class extends ys{constructor(e,n){super(e,n),this._source=new Li.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},$a=class{constructor(){}begin(){}report(){}done(){}},kl=class extends $a{constructor(){super(),this._source=new Li.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function KD(t,e){if(e===void 0||e.workDoneToken===void 0)return new $a;let n=e.workDoneToken;return delete e.workDoneToken,new ys(t,n)}Ni.attachWorkDone=KD;var VD=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(Li.WorkDoneProgressCancelNotification.type,n=>{let r=ys.Instances.get(n.token);(r instanceof xl||r instanceof kl)&&r.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new $a:new ys(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,zD.generateUuid)();return this.connection.sendRequest(Li.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new xl(this.connection,e))}else return Promise.resolve(new kl)}};Ni.ProgressFeature=VD;var nm;(function(t){t.type=new Li.ProgressType})(nm||(nm={}));var rm=class{constructor(e,n){this._connection=e,this._token=n}report(e){this._connection.sendProgress(nm.type,this._token,e)}};function XD(t,e){if(e===void 0||e.partialResultToken===void 0)return;let n=e.partialResultToken;return delete e.partialResultToken,new rm(t,n)}Ni.attachPartialResult=XD});var ix=m(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});Al.ConfigurationFeature=void 0;var YD=vt(),JD=jc(),QD=t=>class extends t{getConfiguration(e){return e?JD.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(YD.ConfigurationRequest.type,n).then(r=>Array.isArray(r)?Array.isArray(e)?r:r[0]:Array.isArray(e)?[]:null)}};Al.ConfigurationFeature=QD});var sx=m(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});Ol.WorkspaceFoldersFeature=void 0;var Cl=vt(),ZD=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let n=e.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Cl.Emitter,this.connection.onNotification(Cl.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(Cl.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(Cl.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Ol.WorkspaceFoldersFeature=ZD});var ox=m(Rl=>{"use strict";Object.defineProperty(Rl,"__esModule",{value:!0});Rl.CallHierarchyFeature=void 0;var im=vt(),eI=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(im.CallHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onIncomingCalls:e=>{let n=im.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onOutgoingCalls:e=>{let n=im.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Rl.CallHierarchyFeature=eI});var om=m(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.SemanticTokensBuilder=qi.SemanticTokensDiff=qi.SemanticTokensFeature=void 0;var Pl=vt(),tI=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Pl.SemanticTokensRefreshRequest.type),on:e=>{let n=Pl.SemanticTokensRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onDelta:e=>{let n=Pl.SemanticTokensDeltaRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onRange:e=>{let n=Pl.SemanticTokensRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};qi.SemanticTokensFeature=tI;var Dl=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 i=e-1,s=n-1;for(;i>=r&&s>=r&&this.originalSequence[i]===this.modifiedSequence[s];)i--,s--;(i<r||s<r)&&(i++,s++);let o=i-r+1,a=this.modifiedSequence.slice(r,s+1);return a.length===1&&a[0]===this.originalSequence[i]?[{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}]:[]}};qi.SemanticTokensDiff=Dl;var sm=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,i,s){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++]=i,this._data[this._dataLen++]=s,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 Dl(this._prevData,this._data).computeDiff()}:this.build()}};qi.SemanticTokensBuilder=sm});var ax=m(Il=>{"use strict";Object.defineProperty(Il,"__esModule",{value:!0});Il.ShowDocumentFeature=void 0;var nI=vt(),rI=t=>class extends t{showDocument(e){return this.connection.sendRequest(nI.ShowDocumentRequest.type,e)}};Il.ShowDocumentFeature=rI});var ux=m(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});Ml.FileOperationsFeature=void 0;var Eo=vt(),iI=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(Eo.DidCreateFilesNotification.type,n=>{e(n)})}onDidRenameFiles(e){return this.connection.onNotification(Eo.DidRenameFilesNotification.type,n=>{e(n)})}onDidDeleteFiles(e){return this.connection.onNotification(Eo.DidDeleteFilesNotification.type,n=>{e(n)})}onWillCreateFiles(e){return this.connection.onRequest(Eo.WillCreateFilesRequest.type,(n,r)=>e(n,r))}onWillRenameFiles(e){return this.connection.onRequest(Eo.WillRenameFilesRequest.type,(n,r)=>e(n,r))}onWillDeleteFiles(e){return this.connection.onRequest(Eo.WillDeleteFilesRequest.type,(n,r)=>e(n,r))}};Ml.FileOperationsFeature=iI});var cx=m(Ll=>{"use strict";Object.defineProperty(Ll,"__esModule",{value:!0});Ll.LinkedEditingRangeFeature=void 0;var sI=vt(),oI=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(sI.LinkedEditingRangeRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))}};Ll.LinkedEditingRangeFeature=oI});var lx=m(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.TypeHierarchyFeature=void 0;var am=vt(),aI=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(am.TypeHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onSupertypes:e=>{let n=am.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onSubtypes:e=>{let n=am.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Nl.TypeHierarchyFeature=aI});var dx=m(ql=>{"use strict";Object.defineProperty(ql,"__esModule",{value:!0});ql.InlineValueFeature=void 0;var hx=vt(),uI=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(hx.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(hx.InlineValueRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};ql.InlineValueFeature=uI});var px=m(jl=>{"use strict";Object.defineProperty(jl,"__esModule",{value:!0});jl.FoldingRangeFeature=void 0;var fx=vt(),cI=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(fx.FoldingRangeRefreshRequest.type),on:e=>{let n=fx.FoldingRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};jl.FoldingRangeFeature=cI});var gx=m(Fl=>{"use strict";Object.defineProperty(Fl,"__esModule",{value:!0});Fl.InlayHintFeature=void 0;var um=vt(),lI=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(um.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(um.InlayHintRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n))),resolve:e=>this.connection.onRequest(um.InlayHintResolveRequest.type,(n,r)=>e(n,r))}}};Fl.InlayHintFeature=lI});var mx=m($l=>{"use strict";Object.defineProperty($l,"__esModule",{value:!0});$l.DiagnosticFeature=void 0;var Ba=vt(),hI=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(Ba.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(Ba.DocumentDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(Ba.DocumentDiagnosticRequest.partialResult,n))),onWorkspace:e=>this.connection.onRequest(Ba.WorkspaceDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(Ba.WorkspaceDiagnosticRequest.partialResult,n)))}}};$l.DiagnosticFeature=hI});var lm=m(Bl=>{"use strict";Object.defineProperty(Bl,"__esModule",{value:!0});Bl.TextDocuments=void 0;var bs=vt(),cm=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new bs.Emitter,this._onDidOpen=new bs.Emitter,this._onDidClose=new bs.Emitter,this._onDidSave=new bs.Emitter,this._onWillSave=new bs.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=bs.TextDocumentSyncKind.Incremental;let n=[];return n.push(e.onDidOpenTextDocument(r=>{let i=r.textDocument,s=this._configuration.create(i.uri,i.languageId,i.version,i.text);this._syncedDocuments.set(i.uri,s);let o=Object.freeze({document:s});this._onDidOpen.fire(o),this._onDidChangeContent.fire(o)})),n.push(e.onDidChangeTextDocument(r=>{let i=r.textDocument,s=r.contentChanges;if(s.length===0)return;let{version:o}=i;if(o==null)throw new Error(`Received document change event for ${i.uri} without valid version identifier`);let a=this._syncedDocuments.get(i.uri);a!==void 0&&(a=this._configuration.update(a,s,o),this._syncedDocuments.set(i.uri,a),this._onDidChangeContent.fire(Object.freeze({document:a})))})),n.push(e.onDidCloseTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&(this._syncedDocuments.delete(r.textDocument.uri),this._onDidClose.fire(Object.freeze({document:i})))})),n.push(e.onWillSaveTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:r.reason}))})),n.push(e.onWillSaveTextDocumentWaitUntil((r,i)=>{let s=this._syncedDocuments.get(r.textDocument.uri);return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:r.reason}),i):[]})),n.push(e.onDidSaveTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),bs.Disposable.create(()=>{n.forEach(r=>r.dispose())})}};Bl.TextDocuments=cm});var dm=m(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.NotebookDocuments=xo.NotebookSyncFeature=void 0;var Gn=vt(),yx=lm(),dI=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(Gn.DidOpenNotebookDocumentNotification.type,n=>{e(n)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(Gn.DidChangeNotebookDocumentNotification.type,n=>{e(n)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(Gn.DidSaveNotebookDocumentNotification.type,n=>{e(n)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(Gn.DidCloseNotebookDocumentNotification.type,n=>{e(n)})}}};xo.NotebookSyncFeature=dI;var Wl=class t{onDidOpenTextDocument(e){return this.openHandler=e,Gn.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Gn.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Gn.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}};Wl.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var hm=class{constructor(e){e instanceof yx.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new yx.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Gn.Emitter,this._onDidChange=new Gn.Emitter,this._onDidSave=new Gn.Emitter,this._onDidClose=new Gn.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 Wl,r=[];return r.push(this.cellTextDocuments.listen(n)),r.push(e.notebooks.synchronization.onDidOpenNotebookDocument(i=>{this.notebookDocuments.set(i.notebookDocument.uri,i.notebookDocument);for(let s of i.cellTextDocuments)n.openTextDocument({textDocument:s});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument)})),r.push(e.notebooks.synchronization.onDidChangeNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);if(s===void 0)return;s.version=i.notebookDocument.version;let o=s.metadata,a=!1,u=i.change;u.metadata!==void 0&&(a=!0,s.metadata=u.metadata);let c=[],l=[],h=[],d=[];if(u.cells!==void 0){let k=u.cells;if(k.structure!==void 0){let T=k.structure.array;if(s.cells.splice(T.start,T.deleteCount,...T.cells!==void 0?T.cells:[]),k.structure.didOpen!==void 0)for(let w of k.structure.didOpen)n.openTextDocument({textDocument:w}),c.push(w.uri);if(k.structure.didClose)for(let w of k.structure.didClose)n.closeTextDocument({textDocument:w}),l.push(w.uri)}if(k.data!==void 0){let T=new Map(k.data.map(w=>[w.document,w]));for(let w=0;w<=s.cells.length;w++){let v=T.get(s.cells[w].document);if(v!==void 0){let L=s.cells.splice(w,1,v);if(h.push({old:L[0],new:v}),T.delete(v.document),T.size===0)break}}}if(k.textContent!==void 0)for(let T of k.textContent)n.changeTextDocument({textDocument:T.document,contentChanges:T.changes}),d.push(T.document.uri)}this.updateCellMap(s);let g={notebookDocument:s};a&&(g.metadata={old:o,new:s.metadata});let y=[];for(let k of c)y.push(this.getNotebookCell(k));let _=[];for(let k of l)_.push(this.getNotebookCell(k));let C=[];for(let k of d)C.push(this.getNotebookCell(k));(y.length>0||_.length>0||h.length>0||C.length>0)&&(g.cells={added:y,removed:_,changed:{data:h,textContent:C}}),(g.metadata!==void 0||g.cells!==void 0)&&this._onDidChange.fire(g)})),r.push(e.notebooks.synchronization.onDidSaveNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);s!==void 0&&this._onDidSave.fire(s)})),r.push(e.notebooks.synchronization.onDidCloseNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);if(s!==void 0){this._onDidClose.fire(s);for(let o of i.cellTextDocuments)n.closeTextDocument({textDocument:o});this.notebookDocuments.delete(i.notebookDocument.uri);for(let o of s.cells)this.notebookCellMap.delete(o.document)}})),Gn.Disposable.create(()=>{r.forEach(i=>i.dispose())})}updateCellMap(e){for(let n of e.cells)this.notebookCellMap.set(n.document,[n,e])}};xo.NotebookDocuments=hm});var bx=m(Ul=>{"use strict";Object.defineProperty(Ul,"__esModule",{value:!0});Ul.MonikerFeature=void 0;var fI=vt(),pI=t=>class extends t{get moniker(){return{on:e=>{let n=fI.MonikerRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};Ul.MonikerFeature=pI});var bm=m(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.createConnection=Me.combineFeatures=Me.combineNotebooksFeatures=Me.combineLanguagesFeatures=Me.combineWorkspaceFeatures=Me.combineWindowFeatures=Me.combineClientFeatures=Me.combineTracerFeatures=Me.combineTelemetryFeatures=Me.combineConsoleFeatures=Me._NotebooksImpl=Me._LanguagesImpl=Me.BulkUnregistration=Me.BulkRegistration=Me.ErrorMessageTracker=void 0;var V=vt(),zn=jc(),pm=tm(),pe=rx(),gI=ix(),mI=sx(),yI=ox(),bI=om(),_I=ax(),vI=ux(),SI=cx(),wI=lx(),TI=dx(),EI=px(),xI=gx(),kI=mx(),AI=dm(),CI=bx();function fm(t){if(t!==null)return t}var gm=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)})}};Me.ErrorMessageTracker=gm;var Hl=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(V.MessageType.Error,e)}warn(e){this.send(V.MessageType.Warning,e)}info(e){this.send(V.MessageType.Info,e)}log(e){this.send(V.MessageType.Log,e)}debug(e){this.send(V.MessageType.Debug,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(V.LogMessageNotification.type,{type:e,message:n}).catch(()=>{(0,V.RAL)().console.error("Sending log message failed")})}},mm=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:V.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(V.ShowMessageRequest.type,r).then(fm)}showWarningMessage(e,...n){let r={type:V.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(V.ShowMessageRequest.type,r).then(fm)}showInformationMessage(e,...n){let r={type:V.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(V.ShowMessageRequest.type,r).then(fm)}},_x=(0,_I.ShowDocumentFeature)((0,pe.ProgressFeature)(mm)),vx;(function(t){function e(){return new Gl}t.create=e})(vx||(Me.BulkRegistration=vx={}));var Gl=class{constructor(){this._registrations=[],this._registered=new Set}add(e,n){let r=zn.string(e)?e:e.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);let i=pm.generateUuid();this._registrations.push({id:i,method:r,registerOptions:n||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}},Sx;(function(t){function e(){return new Wa(void 0,[])}t.create=e})(Sx||(Me.BulkUnregistration=Sx={}));var Wa=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(V.UnregistrationRequest.type,n).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let n=zn.string(e)?e:e.method,r=this._unregistrations.get(n);if(!r)return!1;let i={unregisterations:[r]};return this._connection.sendRequest(V.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(n)},s=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}},zl=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 Gl?this.registerMany(e):e instanceof Wa?this.registerSingle1(e,n,r):this.registerSingle2(e,n)}registerSingle1(e,n,r){let i=zn.string(n)?n:n.method,s=pm.generateUuid(),o={registrations:[{id:s,method:i,registerOptions:r||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(V.RegistrationRequest.type,o).then(a=>(e.add({id:s,method:i}),e),a=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(a)))}registerSingle2(e,n){let r=zn.string(e)?e:e.method,i=pm.generateUuid(),s={registrations:[{id:i,method:r,registerOptions:n||{}}]};return this.connection.sendRequest(V.RegistrationRequest.type,s).then(o=>V.Disposable.create(()=>{this.unregisterSingle(i,r).catch(()=>{this.connection.console.info(`Un-registering capability with id ${i} 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(V.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(V.RegistrationRequest.type,n).then(()=>new Wa(this._connection,n.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}},ym=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(i){return i&&!!i.edit}let r=n(e)?e:{edit:e};return this.connection.sendRequest(V.ApplyWorkspaceEditRequest.type,r)}},wx=(0,vI.FileOperationsFeature)((0,mI.WorkspaceFoldersFeature)((0,gI.ConfigurationFeature)(ym))),Kl=class{constructor(){this._trace=V.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!==V.Trace.Off&&this.connection.sendNotification(V.LogTraceNotification.type,{message:e,verbose:this._trace===V.Trace.Verbose?n:void 0}).catch(()=>{})}},Vl=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(V.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},Xl=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,pe.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,pe.attachPartialResult)(this.connection,n)}};Me._LanguagesImpl=Xl;var Tx=(0,EI.FoldingRangeFeature)((0,CI.MonikerFeature)((0,kI.DiagnosticFeature)((0,xI.InlayHintFeature)((0,TI.InlineValueFeature)((0,wI.TypeHierarchyFeature)((0,SI.LinkedEditingRangeFeature)((0,bI.SemanticTokensFeature)((0,yI.CallHierarchyFeature)(Xl))))))))),Yl=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,pe.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,pe.attachPartialResult)(this.connection,n)}};Me._NotebooksImpl=Yl;var Ex=(0,AI.NotebookSyncFeature)(Yl);function xx(t,e){return function(n){return e(t(n))}}Me.combineConsoleFeatures=xx;function kx(t,e){return function(n){return e(t(n))}}Me.combineTelemetryFeatures=kx;function Ax(t,e){return function(n){return e(t(n))}}Me.combineTracerFeatures=Ax;function Cx(t,e){return function(n){return e(t(n))}}Me.combineClientFeatures=Cx;function Ox(t,e){return function(n){return e(t(n))}}Me.combineWindowFeatures=Ox;function Rx(t,e){return function(n){return e(t(n))}}Me.combineWorkspaceFeatures=Rx;function Px(t,e){return function(n){return e(t(n))}}Me.combineLanguagesFeatures=Px;function Dx(t,e){return function(n){return e(t(n))}}Me.combineNotebooksFeatures=Dx;function OI(t,e){function n(i,s,o){return i&&s?o(i,s):i||s}return{__brand:"features",console:n(t.console,e.console,xx),tracer:n(t.tracer,e.tracer,Ax),telemetry:n(t.telemetry,e.telemetry,kx),client:n(t.client,e.client,Cx),window:n(t.window,e.window,Ox),workspace:n(t.workspace,e.workspace,Rx),languages:n(t.languages,e.languages,Px),notebooks:n(t.notebooks,e.notebooks,Dx)}}Me.combineFeatures=OI;function RI(t,e,n){let r=n&&n.console?new(n.console(Hl)):new Hl,i=t(r);r.rawAttach(i);let s=n&&n.tracer?new(n.tracer(Kl)):new Kl,o=n&&n.telemetry?new(n.telemetry(Vl)):new Vl,a=n&&n.client?new(n.client(zl)):new zl,u=n&&n.window?new(n.window(_x)):new _x,c=n&&n.workspace?new(n.workspace(wx)):new wx,l=n&&n.languages?new(n.languages(Tx)):new Tx,h=n&&n.notebooks?new(n.notebooks(Ex)):new Ex,d=[r,s,o,a,u,c,l,h];function g(T){return T instanceof Promise?T:zn.thenable(T)?new Promise((w,v)=>{T.then(L=>w(L),L=>v(L))}):Promise.resolve(T)}let y,_,C,k={listen:()=>i.listen(),sendRequest:(T,...w)=>i.sendRequest(zn.string(T)?T:T.method,...w),onRequest:(T,w)=>i.onRequest(T,w),sendNotification:(T,w)=>{let v=zn.string(T)?T:T.method;return i.sendNotification(v,w)},onNotification:(T,w)=>i.onNotification(T,w),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:T=>(_=T,{dispose:()=>{_=void 0}}),onInitialized:T=>i.onNotification(V.InitializedNotification.type,T),onShutdown:T=>(y=T,{dispose:()=>{y=void 0}}),onExit:T=>(C=T,{dispose:()=>{C=void 0}}),get console(){return r},get telemetry(){return o},get tracer(){return s},get client(){return a},get window(){return u},get workspace(){return c},get languages(){return l},get notebooks(){return h},onDidChangeConfiguration:T=>i.onNotification(V.DidChangeConfigurationNotification.type,T),onDidChangeWatchedFiles:T=>i.onNotification(V.DidChangeWatchedFilesNotification.type,T),__textDocumentSync:void 0,onDidOpenTextDocument:T=>i.onNotification(V.DidOpenTextDocumentNotification.type,T),onDidChangeTextDocument:T=>i.onNotification(V.DidChangeTextDocumentNotification.type,T),onDidCloseTextDocument:T=>i.onNotification(V.DidCloseTextDocumentNotification.type,T),onWillSaveTextDocument:T=>i.onNotification(V.WillSaveTextDocumentNotification.type,T),onWillSaveTextDocumentWaitUntil:T=>i.onRequest(V.WillSaveTextDocumentWaitUntilRequest.type,T),onDidSaveTextDocument:T=>i.onNotification(V.DidSaveTextDocumentNotification.type,T),sendDiagnostics:T=>i.sendNotification(V.PublishDiagnosticsNotification.type,T),onHover:T=>i.onRequest(V.HoverRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),void 0)),onCompletion:T=>i.onRequest(V.CompletionRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onCompletionResolve:T=>i.onRequest(V.CompletionResolveRequest.type,T),onSignatureHelp:T=>i.onRequest(V.SignatureHelpRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),void 0)),onDeclaration:T=>i.onRequest(V.DeclarationRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onDefinition:T=>i.onRequest(V.DefinitionRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onTypeDefinition:T=>i.onRequest(V.TypeDefinitionRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onImplementation:T=>i.onRequest(V.ImplementationRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onReferences:T=>i.onRequest(V.ReferencesRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onDocumentHighlight:T=>i.onRequest(V.DocumentHighlightRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onDocumentSymbol:T=>i.onRequest(V.DocumentSymbolRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onWorkspaceSymbol:T=>i.onRequest(V.WorkspaceSymbolRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onWorkspaceSymbolResolve:T=>i.onRequest(V.WorkspaceSymbolResolveRequest.type,T),onCodeAction:T=>i.onRequest(V.CodeActionRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onCodeActionResolve:T=>i.onRequest(V.CodeActionResolveRequest.type,(w,v)=>T(w,v)),onCodeLens:T=>i.onRequest(V.CodeLensRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onCodeLensResolve:T=>i.onRequest(V.CodeLensResolveRequest.type,(w,v)=>T(w,v)),onDocumentFormatting:T=>i.onRequest(V.DocumentFormattingRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),void 0)),onDocumentRangeFormatting:T=>i.onRequest(V.DocumentRangeFormattingRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),void 0)),onDocumentOnTypeFormatting:T=>i.onRequest(V.DocumentOnTypeFormattingRequest.type,(w,v)=>T(w,v)),onRenameRequest:T=>i.onRequest(V.RenameRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),void 0)),onPrepareRename:T=>i.onRequest(V.PrepareRenameRequest.type,(w,v)=>T(w,v)),onDocumentLinks:T=>i.onRequest(V.DocumentLinkRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onDocumentLinkResolve:T=>i.onRequest(V.DocumentLinkResolveRequest.type,(w,v)=>T(w,v)),onDocumentColor:T=>i.onRequest(V.DocumentColorRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onColorPresentation:T=>i.onRequest(V.ColorPresentationRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onFoldingRanges:T=>i.onRequest(V.FoldingRangeRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onSelectionRanges:T=>i.onRequest(V.SelectionRangeRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),(0,pe.attachPartialResult)(i,w))),onExecuteCommand:T=>i.onRequest(V.ExecuteCommandRequest.type,(w,v)=>T(w,v,(0,pe.attachWorkDone)(i,w),void 0)),dispose:()=>i.dispose()};for(let T of d)T.attach(k);return i.onRequest(V.InitializeRequest.type,T=>{e.initialize(T),zn.string(T.trace)&&(s.trace=V.Trace.fromString(T.trace));for(let w of d)w.initialize(T.capabilities);if(_){let w=_(T,new V.CancellationTokenSource().token,(0,pe.attachWorkDone)(i,T),void 0);return g(w).then(v=>{if(v instanceof V.ResponseError)return v;let L=v;L||(L={capabilities:{}});let R=L.capabilities;R||(R={},L.capabilities=R),R.textDocumentSync===void 0||R.textDocumentSync===null?R.textDocumentSync=zn.number(k.__textDocumentSync)?k.__textDocumentSync:V.TextDocumentSyncKind.None:!zn.number(R.textDocumentSync)&&!zn.number(R.textDocumentSync.change)&&(R.textDocumentSync.change=zn.number(k.__textDocumentSync)?k.__textDocumentSync:V.TextDocumentSyncKind.None);for(let W of d)W.fillServerCapabilities(R);return L})}else{let w={capabilities:{textDocumentSync:V.TextDocumentSyncKind.None}};for(let v of d)v.fillServerCapabilities(w.capabilities);return w}}),i.onRequest(V.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,y)return y(new V.CancellationTokenSource().token)}),i.onNotification(V.ExitNotification.type,()=>{try{C&&C()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(V.SetTraceNotification.type,T=>{s.trace=V.Trace.fromString(T.value)}),k}Me.createConnection=RI});var Ix=m(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.resolveModulePath=En.FileSystem=En.resolveGlobalYarnPath=En.resolveGlobalNodePath=En.resolve=En.uriToFilePath=void 0;var PI=require("url"),br=require("path"),_m=require("fs"),Tm=require("child_process");function DI(t){let e=PI.parse(t);if(e.protocol!=="file:"||!e.path)return;let n=e.path.split("/");for(var r=0,i=n.length;r<i;r++)n[r]=decodeURIComponent(n[r]);if(process.platform==="win32"&&n.length>1){let s=n[0],o=n[1];s.length===0&&o.length>1&&o[1]===":"&&n.shift()}return br.normalize(n.join("/"))}En.uriToFilePath=DI;function vm(){return process.platform==="win32"}function Jl(t,e,n,r){let i="NODE_PATH",s=["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 u=process.env,c=Object.create(null);Object.keys(u).forEach(l=>c[l]=u[l]),e&&_m.existsSync(e)&&(c[i]?c[i]=e+br.delimiter+c[i]:c[i]=e,r&&r(`NODE_PATH value is: ${c[i]}`)),c.ELECTRON_RUN_AS_NODE="1";try{let l=(0,Tm.fork)("",[],{cwd:n,env:c,execArgv:["-e",s]});if(l.pid===void 0){a(new Error(`Starting process to resolve node module ${t} failed`));return}l.on("error",d=>{a(d)}),l.on("message",d=>{d.c==="r"&&(l.send({c:"e"}),d.s?o(d.r):a(new Error(`Failed to resolve module: ${t}`)))});let h={c:"rs",a:t};l.send(h)}catch(l){a(l)}})}En.resolve=Jl;function Sm(t){let e="npm",n=Object.create(null);Object.keys(process.env).forEach(s=>n[s]=process.env[s]),n.NO_UPDATE_NOTIFIER="true";let r={encoding:"utf8",env:n};vm()&&(e="npm.cmd",r.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let s=(0,Tm.spawnSync)(e,["config","get","prefix"],r).stdout;if(!s){t&&t("'npm config get prefix' didn't return a value.");return}let o=s.trim();return t&&t(`'npm config get prefix' value is: ${o}`),o.length>0?vm()?br.join(o,"node_modules"):br.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i)}}En.resolveGlobalNodePath=Sm;function II(t){let e="yarn",n={encoding:"utf8"};vm()&&(e="yarn.cmd",n.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let i=(0,Tm.spawnSync)(e,["global","dir","--json"],n),s=i.stdout;if(!s){t&&(t("'yarn global dir' didn't return a value."),i.stderr&&t(i.stderr));return}let o=s.trim().split(/\r?\n/);for(let a of o)try{let u=JSON.parse(a);if(u.type==="log")return br.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",r)}}En.resolveGlobalYarnPath=II;var wm;(function(t){let e;function n(){return e!==void 0||(process.platform==="win32"?e=!1:e=!_m.existsSync(__filename.toUpperCase())||!_m.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=n;function r(i,s){return n()?br.normalize(s).indexOf(br.normalize(i))===0:br.normalize(s).toLowerCase().indexOf(br.normalize(i).toLowerCase())===0}t.isParent=r})(wm||(En.FileSystem=wm={}));function MI(t,e,n,r){return n?(br.isAbsolute(n)||(n=br.join(t,n)),Jl(e,n,n,r).then(i=>wm.isParent(n,i)?i:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,i=>Jl(e,Sm(r),t,r))):Jl(e,Sm(r),t,r)}En.resolveModulePath=MI});var Em=m((i3,Mx)=>{"use strict";Mx.exports=vt()});var Lx=m(Ql=>{"use strict";Object.defineProperty(Ql,"__esModule",{value:!0});Ql.InlineCompletionFeature=void 0;var LI=vt(),NI=t=>class extends t{get inlineCompletion(){return{on:e=>this.connection.onRequest(LI.InlineCompletionRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};Ql.InlineCompletionFeature=NI});var jx=m(nn=>{"use strict";var qI=nn&&nn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),qx=nn&&nn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&qI(e,t,n)};Object.defineProperty(nn,"__esModule",{value:!0});nn.ProposedFeatures=nn.NotebookDocuments=nn.TextDocuments=nn.SemanticTokensBuilder=void 0;var jI=om();Object.defineProperty(nn,"SemanticTokensBuilder",{enumerable:!0,get:function(){return jI.SemanticTokensBuilder}});var FI=Lx();qx(vt(),nn);var $I=lm();Object.defineProperty(nn,"TextDocuments",{enumerable:!0,get:function(){return $I.TextDocuments}});var BI=dm();Object.defineProperty(nn,"NotebookDocuments",{enumerable:!0,get:function(){return BI.NotebookDocuments}});qx(bm(),nn);var Nx;(function(t){t.all={__brand:"features",languages:FI.InlineCompletionFeature}})(Nx||(nn.ProposedFeatures=Nx={}))});var km=m(Kn=>{"use strict";var WI=Kn&&Kn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Wx=Kn&&Kn.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&WI(e,t,n)};Object.defineProperty(Kn,"__esModule",{value:!0});Kn.createConnection=Kn.Files=void 0;var Fx=require("node:util"),xm=jc(),UI=bm(),Ua=Ix(),_s=Em();Wx(Em(),Kn);Wx(jx(),Kn);var $x;(function(t){t.uriToFilePath=Ua.uriToFilePath,t.resolveGlobalNodePath=Ua.resolveGlobalNodePath,t.resolveGlobalYarnPath=Ua.resolveGlobalYarnPath,t.resolve=Ua.resolve,t.resolveModulePath=Ua.resolveModulePath})($x||(Kn.Files=$x={}));var Bx;function Zl(){if(Bx!==void 0)try{Bx.end()}catch{}}var ko=!1,Ux;function HI(){let t="--clientProcessId";function e(n){try{let r=parseInt(n);isNaN(r)||(Ux=setInterval(()=>{try{process.kill(r,0)}catch{Zl(),process.exit(ko?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 i=r.split("=");i[0]===t&&e(i[1])}}}HI();var GI={initialize:t=>{let e=t.processId;xm.number(e)&&Ux===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(ko?0:1)}},3e3)},get shutdownReceived(){return ko},set shutdownReceived(t){ko=t},exit:t=>{Zl(),process.exit(t)}};function zI(t,e,n,r){let i,s,o,a;return t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=n,n=r),_s.ConnectionStrategy.is(t)||_s.ConnectionOptions.is(t)?a=t:(s=t,o=e,a=n),KI(s,o,a,i)}Kn.createConnection=zI;function KI(t,e,n,r){let i=!1;if(!t&&!e&&process.argv.length>2){let u,c,l=process.argv.slice(2);for(let h=0;h<l.length;h++){let d=l[h];if(d==="--node-ipc"){t=new _s.IPCMessageReader(process),e=new _s.IPCMessageWriter(process);break}else if(d==="--stdio"){i=!0,t=process.stdin,e=process.stdout;break}else if(d==="--socket"){u=parseInt(l[h+1]);break}else if(d==="--pipe"){c=l[h+1];break}else{var s=d.split("=");if(s[0]==="--socket"){u=parseInt(s[1]);break}else if(s[0]==="--pipe"){c=s[1];break}}}if(u){let h=(0,_s.createServerSocketTransport)(u);t=h[0],e=h[1]}else if(c){let h=(0,_s.createServerPipeTransport)(c);t=h[0],e=h[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(xm.func(t.read)&&xm.func(t.on)){let u=t;u.on("end",()=>{Zl(),process.exit(ko?0:1)}),u.on("close",()=>{Zl(),process.exit(ko?0:1)})}let a=u=>{let c=(0,_s.createProtocolConnection)(t,e,u,n);return i&&VI(u),c};return(0,UI.createConnection)(a,GI,r)}function VI(t){function e(r){return r.map(i=>typeof i=="string"?i:(0,Fx.inspect)(i)).join(" ")}let n=new Map;console.assert=function(i,...s){if(!i)if(s.length===0)t.error("Assertion failed");else{let[o,...a]=s;t.error(`Assertion failed: ${o} ${e(a)}`)}},console.count=function(i="default"){let s=String(i),o=n.get(s)??0;o+=1,n.set(s,o),t.log(`${s}: ${s}`)},console.countReset=function(i){i===void 0?n.clear():n.delete(String(i))},console.debug=function(...i){t.log(e(i))},console.dir=function(i,s){t.log((0,Fx.inspect)(i,s))},console.log=function(...i){t.log(e(i))},console.error=function(...i){t.error(e(i))},console.trace=function(...i){let s=new Error().stack.replace(/(.+\n){2}/,""),o="Trace";i.length!==0&&(o+=`: ${e(i)}`),t.log(`${o}
36
+ ${s}`)},console.warn=function(...i){t.warn(e(i))}}});var Am=m((c3,Hx)=>{"use strict";Hx.exports=km()});var ji=m(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.parseDependencyRawLocation=St.parseDependencyLocation=St.DependencyType=St.TypeAnalyzerStrategy=St.IndentationType=St.DefaultFileExtensions=St.ConfigurationNamespace=St.LanguageId=void 0;St.LanguageId="miniscript";St.ConfigurationNamespace="miniscript";St.DefaultFileExtensions=["ms"];var XI;(function(t){t.Tab="Tab",t.Whitespace="Whitespace"})(XI=St.IndentationType||(St.IndentationType={}));var YI;(function(t){t.Dependency="Dependency",t.Workspace="Workspace"})(YI=St.TypeAnalyzerStrategy||(St.TypeAnalyzerStrategy={}));var JI;(function(t){t.Include="include",t.Import="import"})(JI=St.DependencyType||(St.DependencyType={}));function QI(t){return t.args&&t.args.length>0?`${t.type}:${t.args.join(":")}!${t.location}`:`${t.type}!${t.location}`}St.parseDependencyLocation=QI;function ZI(t){let e=t.indexOf("!"),[n,...r]=t.substring(0,e).split(":"),i=t.substring(e+1);return{type:n,location:i,args:r}}St.parseDependencyRawLocation=ZI});var Ha=m(eh=>{"use strict";Object.defineProperty(eh,"__esModule",{value:!0});eh.Position=void 0;var Cm=class{constructor(e,n){this.line=e,this.character=n}toString(){return`${this.line}:${this.character}`}};eh.Position=Cm});var Fi=m(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.LiteralToken=Pn.Token=Pn.BaseToken=Pn.BaseTokenOptions=Pn.TokenType=void 0;var Gx=Ha(),eM;(function(t){t.EOF="EOF",t.StringLiteral="StringLiteral",t.Keyword="Keyword",t.Identifier="Identifier",t.NumericLiteral="NumericLiteral",t.Punctuator="Punctuator",t.BooleanLiteral="BooleanLiteral",t.NilLiteral="NilLiteral",t.EOL="EOL",t.SliceOperator="SliceOperator",t.Comment="Comment",t.Invalid="Invalid"})(eM=Pn.TokenType||(Pn.TokenType={}));var Om=class{};Pn.BaseTokenOptions=Om;var Ga=class{constructor(e){this.type=e.type,this.value=e.value,this.line=e.line,this.lineStart=e.lineStart,this.range=e.range,this.lastLine=e.lastLine,this.lastLineStart=e.lastLineStart,this.afterSpace=e.afterSpace;let n=e.offsetRange,r=e.range;this.start=new Gx.Position(this.line,r[0]-n[0]+1),this.end=new Gx.Position(this.lastLine||this.line,r[1]-n[1]+1)}toString(){let e=this.line,n=this.lastLine!==void 0?this.lastLine:this.line,r=this.start.character,i=this.end.character,s=`${e}:${r} - ${n}:${i}`;return`${this.type}[${s}: value = '${this.value}']`}};Pn.BaseToken=Ga;var Rm=class extends Ga{};Pn.Token=Rm;var Pm=class extends Ga{constructor(e){super(e),this.raw=e.raw}toString(){let e=this.line,n=this.lastLine!==void 0?this.lastLine:this.line,r=this.start.character,i=this.end.character,s=`${e}:${r} - ${n}:${i}`;return`${this.type}[${s}: value = ${this.raw}]`}};Pn.LiteralToken=Pm});var th=m(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.CharacterCode=void 0;var tM;(function(t){t[t.WHITESPACE=32]="WHITESPACE",t[t.QUOTE=34]="QUOTE",t[t.NUMBER_0=48]="NUMBER_0",t[t.NUMBER_1=49]="NUMBER_1",t[t.NUMBER_2=50]="NUMBER_2",t[t.NUMBER_3=51]="NUMBER_3",t[t.NUMBER_4=52]="NUMBER_4",t[t.NUMBER_5=53]="NUMBER_5",t[t.NUMBER_6=54]="NUMBER_6",t[t.NUMBER_7=55]="NUMBER_7",t[t.NUMBER_8=56]="NUMBER_8",t[t.NUMBER_9=57]="NUMBER_9",t[t.TAB=9]="TAB",t[t.NEW_LINE=10]="NEW_LINE",t[t.RETURN_LINE=13]="RETURN_LINE",t[t.SLASH=47]="SLASH",t[t.DOT=46]="DOT",t[t.EQUAL=61]="EQUAL",t[t.ASTERISK=42]="ASTERISK",t[t.CARET=94]="CARET",t[t.PERCENT=37]="PERCENT",t[t.COMMA=44]="COMMA",t[t.CURLY_BRACKET_LEFT=123]="CURLY_BRACKET_LEFT",t[t.CURLY_BRACKET_RIGHT=125]="CURLY_BRACKET_RIGHT",t[t.SQUARE_BRACKETS_LEFT=91]="SQUARE_BRACKETS_LEFT",t[t.SQUARE_BRACKETS_RIGHT=93]="SQUARE_BRACKETS_RIGHT",t[t.PARENTHESIS_LEFT=40]="PARENTHESIS_LEFT",t[t.PARENTHESIS_RIGHT=41]="PARENTHESIS_RIGHT",t[t.SEMICOLON=59]="SEMICOLON",t[t.HASH=35]="HASH",t[t.MINUS=45]="MINUS",t[t.PLUS=43]="PLUS",t[t.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",t[t.AT_SIGN=64]="AT_SIGN",t[t.COLON=58]="COLON",t[t.ARROW_LEFT=60]="ARROW_LEFT",t[t.ARROW_RIGHT=62]="ARROW_RIGHT",t[t.LETTER_E=69]="LETTER_E",t[t.LETTER_e=101]="LETTER_e"})(tM=za.CharacterCode||(za.CharacterCode={}))});var Ao=m(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});Ka.Keyword=void 0;var nM;(function(t){t.If="if",t.In="in",t.Or="or",t.And="and",t.Isa="isa",t.For="for",t.Not="not",t.New="new",t.End="end",t.EndFor="end for",t.EndWhile="end while",t.EndFunction="end function",t.EndIf="end if",t.Then="then",t.Else="else",t.Break="break",t.While="while",t.ElseIf="else if",t.Return="return",t.Function="function",t.Continue="continue",t.Repeat="repeat"})(nM=Ka.Keyword||(Ka.Keyword={}))});var Mm=m(Im=>{"use strict";Object.defineProperty(Im,"__esModule",{value:!0});var Vn=th(),rM=Ao(),Dm=class{constructor(){this.isKeyword=Set.prototype.has.bind(new Set(Object.values(rM.Keyword)))}isWhitespace(e){return Vn.CharacterCode.WHITESPACE===e||Vn.CharacterCode.TAB===e}isEndOfLine(e){return Vn.CharacterCode.NEW_LINE===e||Vn.CharacterCode.RETURN_LINE===e}isComment(e,n){return Vn.CharacterCode.SLASH===e&&Vn.CharacterCode.SLASH===n}isIdentifierStart(e){return(e|32)>=97&&(e|32)<=122||e>=128||e===95}isIdentifierPart(e){return(e|32)>=97&&(e|32)<=122||e>=48&&e<=57||e>=128||e===95}isDecDigit(e){return e>=Vn.CharacterCode.NUMBER_0&&e<=Vn.CharacterCode.NUMBER_9}isWinNewline(e,n){switch(e){case Vn.CharacterCode.RETURN_LINE:return Vn.CharacterCode.NEW_LINE===n;case Vn.CharacterCode.NEW_LINE:return Vn.CharacterCode.RETURN_LINE===n}return!1}};Im.default=Dm});var nh=m(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.ParserException=Co.LexerException=void 0;var Lm=class extends Error{constructor(e,n){super(e),this.range=n}};Co.LexerException=Lm;var Nm=class extends Error{constructor(e,n){super(e),this.range=n}};Co.ParserException=Nm});var qm=m(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});Va.Literal=void 0;var iM;(function(t){t.True="true",t.False="false",t.Null="null"})(iM=Va.Literal||(Va.Literal={}))});var Oo=m(Xa=>{"use strict";Object.defineProperty(Xa,"__esModule",{value:!0});Xa.Operator=void 0;var sM;(function(t){t.Plus="+",t.Asterik="*",t.Minus="-",t.Slash="/",t.Power="^",t.Modulo="%",t.LessThan="<",t.GreaterThan=">",t.LessThanOrEqual="<=",t.GreaterThanOrEqual=">=",t.NotEqual="!=",t.Equal="==",t.Or="or",t.And="and",t.Not="not",t.Isa="isa",t.AddShorthand="+=",t.SubtractShorthand="-=",t.MultiplyShorthand="*=",t.DivideShorthand="/=",t.PowerShorthand="^=",t.ModuloShorthand="%=",t.Member=".",t.Assign="=",t.EndOfLine=";",t.EndOfFile="<eof>",t.SliceSeperator=":",t.Comma=",",t.Escape='"',t.SLBracket="[",t.SRBracket="]",t.CLBracket="{",t.CRBracket="}",t.LParenthesis="(",t.RParenthesis=")",t.Reference="@",t.New="new"})(sM=Xa.Operator||(Xa.Operator={}))});var Ya=m(rh=>{"use strict";Object.defineProperty(rh,"__esModule",{value:!0});rh.Range=void 0;var jm=class{constructor(e,n){this.start=e,this.end=n}toString(){return`${this.start} - ${this.end}`}};rh.Range=jm});var Bm=m($m=>{"use strict";Object.defineProperty($m,"__esModule",{value:!0});var Fm=class{constructor(){this._head=null,this._tail=null,this._size=0}enqueue(e){let n={value:e};this._head?this._tail.next=n:this._head=n,this._tail=n,this._size++}dequeue(){let e=this._head.value;if(e)return this._head=this._head.next,this._size--,e}peek(){var e;return((e=this._head)===null||e===void 0?void 0:e.value)||null}clear(){this._head=null,this._tail=null,this._size=0}copyInto(e){this._head=e._head,this._tail=e._tail,this._size=e._size}get size(){return this._size}*[Symbol.iterator](){let e=this._head;for(;e;)yield e,e=e.next}};$m.default=Fm});var Hm=m(Qa=>{"use strict";var Kx=Qa&&Qa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Qa,"__esModule",{value:!0});var rt=Fi(),oM=Kx(Mm()),be=th(),aM=nh(),Wm=Ao(),Ja=qm(),it=Oo(),Ro=Ha(),Um=Ya(),zx=Kx(Bm());function $i(t){let e=this.content[this.index];return this.index+=e.length,this.createPunctuator(e,t)}var ih=class t{constructor(e,n={}){let r=this;r.content=e,r.length=e.length,r.index=0,r.tokenStart=null,r.tabWidth=n.tabWidth||1,r.line=1,r.lineStart=0,r.offset=0,r.validator=n.validator||new oM.default,r.unsafe=n.unsafe,r.errors=[],r.backlog=new zx.default,r.snapshot=new zx.default}scan(e,n){let r=t.scanHandlers[e];return r?r.call(this,n):this.validator.isDecDigit(e)?this.scanNumericLiteral(n):(this.index++,null)}isAtWhitespace(){return this.validator.isWhitespace(this.codeAt())}codeAt(e=0){let n=this.index+e;return n<this.length?this.content.charCodeAt(n):0}createEOL(e){let n=this,r=new rt.Token({type:rt.TokenType.EOL,value:it.Operator.EndOfLine,line:n.line,lineStart:n.lineStart,range:[n.tokenStart,n.index],offsetRange:[n.offset,n.offset],afterSpace:e});return n.snapshot.enqueue(r),r}createIdentifier(e,n){let r=this,i=new rt.Token({type:rt.TokenType.Identifier,value:e,line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset],afterSpace:n});return r.snapshot.enqueue(i),i}createEOF(e){let n=this,r=new rt.Token({type:rt.TokenType.EOF,value:it.Operator.EndOfFile,line:n.line,lineStart:n.lineStart,range:[n.index,n.index],offsetRange:[n.offset,n.offset],afterSpace:e});return n.snapshot.enqueue(r),r}createBoolean(e,n){let r=this,i=new rt.LiteralToken({type:rt.TokenType.BooleanLiteral,value:e===Ja.Literal.True,raw:e,line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset],afterSpace:n});return r.snapshot.enqueue(i),i}createNull(e){let n=this,r=new rt.LiteralToken({type:rt.TokenType.NilLiteral,value:null,raw:Ja.Literal.Null,line:n.line,lineStart:n.lineStart,range:[n.tokenStart,n.index],offsetRange:[n.offset,n.offset],afterSpace:e});return n.snapshot.enqueue(r),r}createSlice(e){let n=new rt.Token({type:rt.TokenType.SliceOperator,value:it.Operator.SliceSeperator,line:this.line,lineStart:this.lineStart,range:[this.tokenStart,this.index],offsetRange:[this.offset,this.offset],afterSpace:e});return this.snapshot.enqueue(n),n}createPunctuator(e,n){let r=new rt.Token({type:rt.TokenType.Punctuator,value:e,line:this.line,lineStart:this.lineStart,range:[this.tokenStart,this.index],offsetRange:[this.offset,this.offset],afterSpace:n});return this.snapshot.enqueue(r),r}createNumericLiteral(e,n,r){let i=new rt.LiteralToken({type:rt.TokenType.NumericLiteral,value:e,raw:n,line:this.line,lineStart:this.lineStart,range:[this.tokenStart,this.index],offsetRange:[this.offset,this.offset],afterSpace:r});return this.snapshot.enqueue(i),i}scanStringLiteral(e){let n=this,r=n.validator,i=n.line,s=n.lineStart,o=n.index,a=n.offset,u=n.offset,c=!1;for(;n.index<n.length;){n.index++;let g=n.codeAt();if(n.validator.isEndOfLine(g))r.isWinNewline(g,n.codeAt(1))&&n.index++,n.line++,u=n.index+1;else if(be.CharacterCode.QUOTE===g){if(be.CharacterCode.QUOTE!==n.codeAt(1)){c=!0;break}n.index++}}if(!c)return n.raise("Unexpected string end of file.",new Um.Range(new Ro.Position(i,o-a+1),new Ro.Position(n.line,n.index-u+2)));n.index++;let l=n.content.slice(n.tokenStart,n.index),h=l.slice(1,-1).replace(/""/g,it.Operator.Escape),d=new rt.LiteralToken({type:rt.TokenType.StringLiteral,value:h,raw:l,line:i,lineStart:s,range:[n.tokenStart,n.index],offsetRange:[a,u],afterSpace:e,lastLine:n.line,lastLineStart:n.lineStart});return n.offset=u,n.snapshot.enqueue(d),d}scanComment(e){let n=this,r=n.validator,i=n.line,s=n.lineStart;for(;this.index<this.length&&!r.isEndOfLine(n.codeAt());n.index++);r.isWinNewline(n.codeAt(),n.codeAt(1))&&n.index++;let o=n.content.slice(n.tokenStart+2,n.index),a=new rt.Token({type:rt.TokenType.Comment,value:o,line:i,lineStart:s,range:[n.tokenStart,n.index],offsetRange:[n.offset,n.offset],afterSpace:e});return n.snapshot.enqueue(a),a}scanNumericLiteral(e){let n=this.validator,r,i;for(;this.index<this.length&&(r=i,i=this.codeAt(),n.isDecDigit(i)||be.CharacterCode.DOT===i||be.CharacterCode.LETTER_E===i||be.CharacterCode.LETTER_e===i||(be.CharacterCode.MINUS===i||be.CharacterCode.PLUS===i)&&(be.CharacterCode.LETTER_E===r||be.CharacterCode.LETTER_e===r));)this.index++;let s=this.content.slice(this.tokenStart,this.index),o=Number(s);return isNaN(o)?this.raise(`Invalid numeric literal: ${s}`,new Um.Range(new Ro.Position(this.line,this.tokenStart-this.offset+1),new Ro.Position(this.line,this.index-this.offset+1))):this.createNumericLiteral(o,s,e)}scanPunctuator(e,n){return this.index+=e.length,this.createPunctuator(e,n)}skipWhiteSpace(){let e=this;for(;e.index<e.length;e.index++){let n=e.content[e.index];if(n===" ")e.offset-=e.tabWidth-1;else if(n!==" ")return}}scanKeyword(e,n){let r=this,i=r.validator,s=e;switch(e){case Wm.Keyword.End:{for(r.index++;i.isIdentifierPart(r.codeAt());r.index++);s=r.content.slice(r.tokenStart,r.index);break}case Wm.Keyword.Else:{let a=r.content.slice(r.tokenStart,r.index+3);a===Wm.Keyword.ElseIf&&(r.index+=3,s=a);break}}let o=new rt.Token({type:rt.TokenType.Keyword,value:s,line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset],afterSpace:n});return r.snapshot.enqueue(o),o}scanIdentifierOrKeyword(e){let n=this,r=n.validator;for(n.index++;r.isIdentifierPart(n.codeAt());n.index++);let i=n.content.slice(n.tokenStart,n.index);if(r.isKeyword(i))return n.scanKeyword(i,e);switch(i){case Ja.Literal.True:case Ja.Literal.False:return n.createBoolean(i,e);case Ja.Literal.Null:return n.createNull(e)}return n.createIdentifier(i,e)}next(){let e=this;if(e.backlog.size)return e.backlog.dequeue();let n=e.index;e.skipWhiteSpace();let r=n<e.index,i=e.codeAt();if(e.validator.isComment(i,e.codeAt(1)))return e.tokenStart=e.index,e.scanComment(r);if(this.index>=this.length)return e.createEOF(r);if(e.tokenStart=e.index,e.validator.isEndOfLine(i)){e.validator.isWinNewline(i,e.codeAt(1))&&e.index++;let a=e.createEOL(r);return e.line++,e.offset=e.index+1,e.lineStart=++e.index,a}if(e.validator.isIdentifierStart(i))return e.scanIdentifierOrKeyword(r);let s=e.line,o=e.scan(i,r);return o||e.raise(`Invalid character ${i} (Code: ${String.fromCharCode(i)})`,new Um.Range(new Ro.Position(s,e.tokenStart-e.offset+1),new Ro.Position(e.line,e.index-e.offset+1)))}recordSnapshot(){this.snapshot.clear()}recoverFromSnapshot(){this.backlog.copyInto(this.snapshot)}raise(e,n){let r=this,i=new aM.LexerException(e,n);if(r.errors.push(i),r.unsafe)return new rt.Token({type:rt.TokenType.Invalid,value:"",line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offsetRange:[r.offset,r.offset]});throw i}};Qa.default=ih;ih.scanHandlers={[be.CharacterCode.QUOTE]:function(e){return this.scanStringLiteral(e)},[be.CharacterCode.DOT]:function(e){return this.validator.isDecDigit(this.codeAt(1))?this.scanNumericLiteral(e):(this.index++,this.createPunctuator(it.Operator.Member,e))},[be.CharacterCode.EQUAL]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(it.Operator.Equal,e):this.scanPunctuator(it.Operator.Assign,e)},[be.CharacterCode.ARROW_LEFT]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(it.Operator.LessThanOrEqual,e):this.scanPunctuator(it.Operator.LessThan,e)},[be.CharacterCode.ARROW_RIGHT]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(it.Operator.GreaterThanOrEqual,e):this.scanPunctuator(it.Operator.GreaterThan,e)},[be.CharacterCode.EXCLAMATION_MARK]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(it.Operator.NotEqual,e):(this.index++,null)},[be.CharacterCode.MINUS]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(it.Operator.SubtractShorthand,e):this.scanPunctuator(it.Operator.Minus,e)},[be.CharacterCode.PLUS]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(it.Operator.AddShorthand,e):this.scanPunctuator(it.Operator.Plus,e)},[be.CharacterCode.ASTERISK]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(it.Operator.MultiplyShorthand,e):this.scanPunctuator(it.Operator.Asterik,e)},[be.CharacterCode.SLASH]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(it.Operator.DivideShorthand,e):this.scanPunctuator(it.Operator.Slash,e)},[be.CharacterCode.COLON]:function(e){return this.index++,this.createSlice(e)},[be.CharacterCode.CARET]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(it.Operator.PowerShorthand,e):this.scanPunctuator(it.Operator.Power,e)},[be.CharacterCode.PERCENT]:function(e){return be.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(it.Operator.ModuloShorthand,e):this.scanPunctuator(it.Operator.Modulo,e)},[be.CharacterCode.SEMICOLON]:function(e){return this.index++,this.createEOL(e)},[be.CharacterCode.COMMA]:$i,[be.CharacterCode.CURLY_BRACKET_LEFT]:$i,[be.CharacterCode.CURLY_BRACKET_RIGHT]:$i,[be.CharacterCode.SQUARE_BRACKETS_LEFT]:$i,[be.CharacterCode.SQUARE_BRACKETS_RIGHT]:$i,[be.CharacterCode.PARENTHESIS_LEFT]:$i,[be.CharacterCode.PARENTHESIS_RIGHT]:$i,[be.CharacterCode.AT_SIGN]:$i}});var pt=m(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.ASTComment=Dn.ASTBaseBlockWithScope=Dn.ASTBaseBlock=Dn.ASTBase=Dn.ASTType=void 0;var Vx;(function(t){t.BreakStatement="BreakStatement",t.ContinueStatement="ContinueStatement",t.ReturnStatement="ReturnStatement",t.IfShortcutStatement="IfShortcutStatement",t.IfShortcutClause="IfShortcutClause",t.ElseifShortcutClause="ElseifShortcutClause",t.ElseShortcutClause="ElseShortcutClause",t.IfStatement="IfStatement",t.IfClause="IfClause",t.ElseifClause="ElseifClause",t.ElseClause="ElseClause",t.WhileStatement="WhileStatement",t.AssignmentStatement="AssignmentStatement",t.CallStatement="CallStatement",t.FunctionDeclaration="FunctionDeclaration",t.ForGenericStatement="ForGenericStatement",t.Chunk="Chunk",t.Identifier="Identifier",t.StringLiteral="StringLiteral",t.NumericLiteral="NumericLiteral",t.BooleanLiteral="BooleanLiteral",t.NilLiteral="NilLiteral",t.Unknown="Unknown",t.MemberExpression="MemberExpression",t.CallExpression="CallExpression",t.Comment="Comment",t.NegationExpression="NegationExpression",t.BinaryNegatedExpression="BinaryNegatedExpression",t.UnaryExpression="UnaryExpression",t.MapKeyString="MapKeyString",t.MapValue="MapValue",t.MapConstructorExpression="MapConstructorExpression",t.MapCallExpression="MapCallExpression",t.ListValue="ListValue",t.ListConstructorExpression="ListConstructorExpression",t.EmptyExpression="EmptyExpression",t.IndexExpression="IndexExpression",t.BinaryExpression="BinaryExpression",t.LogicalExpression="LogicalExpression",t.IsaExpression="IsaExpression",t.SliceExpression="SliceExpression",t.ImportCodeExpression="ImportCodeExpression",t.InvalidCodeExpression="InvalidCodeExpression",t.ParenthesisExpression="ParenthesisExpression",t.ComparisonGroupExpression="ComparisonGroupExpression"})(Vx=Dn.ASTType||(Dn.ASTType={}));var Za=class t{constructor(e,n){this.type=e,this.start=n.start,this.end=n.end,this.range=n.range,this.scope=n.scope||null}toString(){return`${this.type}[${this.start}-${this.end}][]`}clone(){return new t(this.type,{start:this.start,end:this.end,range:this.range,scope:this.scope})}};Dn.ASTBase=Za;var sh=class t extends Za{constructor(e,n){super(e,n),this.body=n.body||[]}toString(){let e=this.body.map(n=>`${n}`).join(`
37
37
  `).split(`
38
38
  `).map(n=>` ${n}`).join(`
39
39
  `);return`${this.type}[${this.start}-${this.end}][${e.length>0?`
40
40
  ${e}
41
- `:""}]`}clone(){return new t(this.type,{body:this.body.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};In.ASTBaseBlock=eh;var qm=class t extends eh{constructor(e,n){super(e,n),this.namespaces=n.namespaces||[],this.assignments=n.assignments||[],this.returns=n.returns||[]}clone(){return new t(this.type,{namespaces:this.namespaces,assignments:this.assignments.map(e=>e.clone()),returns:this.returns.map(e=>e.clone()),body:this.body.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};In.ASTBaseBlockWithScope=qm;var jm=class t extends Qa{constructor(e){super(Lx.Comment,e),this.value=e.value,this.isStatement=e.isStatement,this.isMultiline=e.isMultiline||!1}toString(){return`Comment[${this.start}-${this.end}][${this.value}]`}clone(){return new t({value:this.value,isMultiline:this.isMultiline,isStatement:this.isStatement,start:this.start,end:this.end,range:this.range,scope:this.scope})}};In.ASTComment=jm});var $m=m(th=>{"use strict";Object.defineProperty(th,"__esModule",{value:!0});th.ASTAssignmentStatement=void 0;var Nx=ft(),Fm=class t extends Nx.ASTBase{constructor(e){super(Nx.ASTType.AssignmentStatement,e),this.variable=e.variable,this.init=e.init}toString(){return`AssignmentStatement[${this.start}-${this.end}][${this.variable} = ${this.init}]`}clone(){return new t({variable:this.variable.clone(),init:this.init.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};th.ASTAssignmentStatement=Fm});var Um=m(nh=>{"use strict";Object.defineProperty(nh,"__esModule",{value:!0});nh.ASTBinaryExpression=void 0;var qx=ft(),Bm=class t extends qx.ASTBase{constructor(e){super(qx.ASTType.BinaryExpression,e),this.operator=e.operator,this.left=e.left,this.right=e.right}toString(){return`${this.type}[${this.start}-${this.end}][${this.left} ${this.operator} ${this.right}]`}clone(){return new t({operator:this.operator,left:this.left.clone(),right:this.right.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};nh.ASTBinaryExpression=Bm});var Gm=m(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.ASTCallExpression=Co.ASTCallStatement=void 0;var rh=ft(),Wm=class t extends rh.ASTBase{constructor(e){super(rh.ASTType.CallStatement,e),this.expression=e.expression}toString(){return`CallStatment[${this.start}-${this.end}][${this.expression}]`}clone(){return new t({expression:this.expression,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Co.ASTCallStatement=Wm;var Hm=class t extends rh.ASTBase{constructor(e){super(rh.ASTType.CallExpression,e),this.base=e.base,this.arguments=e.arguments||[]}toString(){return`CallExpression[${this.start}-${this.end}][${this.base}(${this.arguments.map(e=>e.toString()).join(", ")})]`}clone(){return new t({base:this.base.clone(),arguments:this.arguments.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Co.ASTCallExpression=Hm});var Km=m(ih=>{"use strict";Object.defineProperty(ih,"__esModule",{value:!0});ih.ASTChunk=void 0;var jx=ft(),zm=class t extends jx.ASTBaseBlockWithScope{constructor(e){super(jx.ASTType.Chunk,e),this.literals=e.literals||[],this.scopes=e.scopes||[],this.lines=e.lines||{}}toString(){if(this.body.length===0)return`Chunk[${this.start}-${this.end}][]`;let e=this.body.map(n=>`${n}`).join(`
41
+ `:""}]`}clone(){return new t(this.type,{body:this.body.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Dn.ASTBaseBlock=sh;var Gm=class t extends sh{constructor(e,n){super(e,n),this.namespaces=n.namespaces||[],this.definitions=n.definitions||[],this.returns=n.returns||[]}clone(){return new t(this.type,{namespaces:this.namespaces,definitions:this.definitions.map(e=>e.clone()),returns:this.returns.map(e=>e.clone()),body:this.body.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Dn.ASTBaseBlockWithScope=Gm;var zm=class t extends Za{constructor(e){super(Vx.Comment,e),this.value=e.value,this.isStatement=e.isStatement,this.isMultiline=e.isMultiline||!1}toString(){return`Comment[${this.start}-${this.end}][${this.value}]`}clone(){return new t({value:this.value,isMultiline:this.isMultiline,isStatement:this.isStatement,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Dn.ASTComment=zm});var Vm=m(oh=>{"use strict";Object.defineProperty(oh,"__esModule",{value:!0});oh.ASTAssignmentStatement=void 0;var Xx=pt(),Km=class t extends Xx.ASTBase{constructor(e){super(Xx.ASTType.AssignmentStatement,e),this.variable=e.variable,this.init=e.init}toString(){return`AssignmentStatement[${this.start}-${this.end}][${this.variable} = ${this.init}]`}clone(){return new t({variable:this.variable.clone(),init:this.init.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};oh.ASTAssignmentStatement=Km});var Ym=m(ah=>{"use strict";Object.defineProperty(ah,"__esModule",{value:!0});ah.ASTBinaryExpression=void 0;var Yx=pt(),Xm=class t extends Yx.ASTBase{constructor(e){super(Yx.ASTType.BinaryExpression,e),this.operator=e.operator,this.left=e.left,this.right=e.right}toString(){return`${this.type}[${this.start}-${this.end}][${this.left} ${this.operator} ${this.right}]`}clone(){return new t({operator:this.operator,left:this.left.clone(),right:this.right.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};ah.ASTBinaryExpression=Xm});var Zm=m(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.ASTCallExpression=Po.ASTCallStatement=void 0;var uh=pt(),Jm=class t extends uh.ASTBase{constructor(e){super(uh.ASTType.CallStatement,e),this.expression=e.expression}toString(){return`CallStatment[${this.start}-${this.end}][${this.expression}]`}clone(){return new t({expression:this.expression,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Po.ASTCallStatement=Jm;var Qm=class t extends uh.ASTBase{constructor(e){super(uh.ASTType.CallExpression,e),this.base=e.base,this.arguments=e.arguments||[]}toString(){return`CallExpression[${this.start}-${this.end}][${this.base}(${this.arguments.map(e=>e.toString()).join(", ")})]`}clone(){return new t({base:this.base.clone(),arguments:this.arguments.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Po.ASTCallExpression=Qm});var ty=m(ch=>{"use strict";Object.defineProperty(ch,"__esModule",{value:!0});ch.ASTChunk=void 0;var Jx=pt(),ey=class t extends Jx.ASTBaseBlockWithScope{constructor(e){super(Jx.ASTType.Chunk,e),this.literals=e.literals||[],this.scopes=e.scopes||[],this.lines=e.lines||{}}toString(){if(this.body.length===0)return`Chunk[${this.start}-${this.end}][]`;let e=this.body.map(n=>`${n}`).join(`
42
42
  `).split(`
43
43
  `).map(n=>` ${n}`).join(`
44
44
  `);return`Chunk[${this.start}-${this.end}][
45
45
  ${e}
46
- ]`}clone(){return new t({literals:this.literals.map(e=>e.clone()),scopes:this.scopes.map(e=>e.clone()),lines:this.lines,start:this.start,end:this.end,range:this.range,scope:this.scope})}};ih.ASTChunk=zm});var Xm=m(sh=>{"use strict";Object.defineProperty(sh,"__esModule",{value:!0});sh.ASTComparisonGroupExpression=void 0;var Fx=ft(),Vm=class t extends Fx.ASTBase{constructor(e){super(Fx.ASTType.ComparisonGroupExpression,e),this.operators=e.operators,this.expressions=e.expressions}toString(){let e=[this.expressions[0].toString()];for(let n=1;n<this.expressions.length;n++)e.push(this.operators[n-1],this.expressions[n].toString());return`${this.type}[${this.start}-${this.end}][${e.join(" ")}]`}clone(){return new t({operators:this.operators,expressions:this.expressions,start:this.start,end:this.end,range:this.range,scope:this.scope})}};sh.ASTComparisonGroupExpression=Vm});var Jm=m(oh=>{"use strict";Object.defineProperty(oh,"__esModule",{value:!0});oh.ASTForGenericStatement=void 0;var $x=ft(),Ym=class t extends $x.ASTBaseBlock{constructor(e){super($x.ASTType.ForGenericStatement,e),this.variable=e.variable,this.iterator=e.iterator}toString(){if(this.body.length===0)return`${this.type}[${this.start}-${this.end}][${this.variable} in ${this.iterator}]`;let e=this.body.map(n=>`${n}`).join(`
46
+ ]`}clone(){return new t({literals:this.literals.map(e=>e.clone()),scopes:this.scopes.map(e=>e.clone()),lines:this.lines,start:this.start,end:this.end,range:this.range,scope:this.scope})}};ch.ASTChunk=ey});var ry=m(lh=>{"use strict";Object.defineProperty(lh,"__esModule",{value:!0});lh.ASTComparisonGroupExpression=void 0;var Qx=pt(),ny=class t extends Qx.ASTBase{constructor(e){super(Qx.ASTType.ComparisonGroupExpression,e),this.operators=e.operators,this.expressions=e.expressions}toString(){let e=[this.expressions[0].toString()];for(let n=1;n<this.expressions.length;n++)e.push(this.operators[n-1],this.expressions[n].toString());return`${this.type}[${this.start}-${this.end}][${e.join(" ")}]`}clone(){return new t({operators:this.operators,expressions:this.expressions,start:this.start,end:this.end,range:this.range,scope:this.scope})}};lh.ASTComparisonGroupExpression=ny});var sy=m(hh=>{"use strict";Object.defineProperty(hh,"__esModule",{value:!0});hh.ASTForGenericStatement=void 0;var Zx=pt(),iy=class t extends Zx.ASTBaseBlock{constructor(e){super(Zx.ASTType.ForGenericStatement,e),this.variable=e.variable,this.iterator=e.iterator}toString(){if(this.body.length===0)return`${this.type}[${this.start}-${this.end}][${this.variable} in ${this.iterator}]`;let e=this.body.map(n=>`${n}`).join(`
47
47
  `).split(`
48
48
  `).map(n=>` ${n}`).join(`
49
49
  `);return`For[${this.start}-${this.end}][${this.variable} in ${this.iterator}
50
50
  ${e}
51
- ]`}clone(){return new t({variable:this.variable.clone(),iterator:this.iterator.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};oh.ASTForGenericStatement=Ym});var Zm=m(ah=>{"use strict";Object.defineProperty(ah,"__esModule",{value:!0});ah.ASTFunctionStatement=void 0;var Bx=ft(),Qm=class t extends Bx.ASTBaseBlockWithScope{constructor(e){super(Bx.ASTType.FunctionDeclaration,e),this.parameters=e.parameters||[],this.assignment=e.assignment}toString(){let e=this.parameters.map(r=>r).join(", ");if(this.body.length===0)return`${this.type}[${this.start}-${this.end}][${e}]`;let n=this.body.map(r=>`${r}`).join(`
51
+ ]`}clone(){return new t({variable:this.variable.clone(),iterator:this.iterator.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};hh.ASTForGenericStatement=iy});var ay=m(dh=>{"use strict";Object.defineProperty(dh,"__esModule",{value:!0});dh.ASTFunctionStatement=void 0;var ek=pt(),oy=class t extends ek.ASTBaseBlockWithScope{constructor(e){super(ek.ASTType.FunctionDeclaration,e),this.parameters=e.parameters||[],this.assignment=e.assignment}toString(){let e=this.parameters.map(r=>r).join(", ");if(this.body.length===0)return`${this.type}[${this.start}-${this.end}][${e}]`;let n=this.body.map(r=>`${r}`).join(`
52
52
  `).split(`
53
53
  `).map(r=>` ${r}`).join(`
54
54
  `);return`Function[${this.start}-${this.end}][${e} =>
55
55
  ${n}
56
- ]`}clone(){return new t({parameters:this.parameters.map(e=>e.clone()),assignment:this.assignment.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};ah.ASTFunctionStatement=Qm});var ry=m(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.ASTIndexExpression=yr.ASTMemberExpression=yr.ASTIdentifier=yr.ASTIdentifierKind=void 0;var Oo=ft(),GI;(function(t){t.Variable="variable",t.Argument="argument",t.ForInVariable="for-in-variable",t.ForInIdxVariable="for-in-idx-variable",t.Property="property"})(GI=yr.ASTIdentifierKind||(yr.ASTIdentifierKind={}));var ey=class t extends Oo.ASTBase{constructor(e){super(Oo.ASTType.Identifier,e),this.name=e.name,this.kind=e.kind}toString(){return`Identifier[${this.start}-${this.end}][${this.name}]`}clone(){return new t({name:this.name,kind:this.kind,start:this.start,end:this.end,range:this.range,scope:this.scope})}};yr.ASTIdentifier=ey;var ty=class t extends Oo.ASTBase{constructor(e){super(Oo.ASTType.MemberExpression,e),this.indexer=e.indexer,this.identifier=e.identifier,this.base=e.base}toString(){return`MemberExpression[${this.start}-${this.end}][${this.base}.${this.identifier}]`}clone(){return new t({indexer:this.indexer,identifier:this.identifier.clone(),base:this.base,start:this.start,end:this.end,range:this.range,scope:this.scope})}};yr.ASTMemberExpression=ty;var ny=class t extends Oo.ASTBase{constructor(e){super(Oo.ASTType.IndexExpression,e),this.base=e.base,this.index=e.index}toString(){return`IndexExpression[${this.start}-${this.end}][${this.base}[${this.index}]]`}clone(){return new t({base:this.base.clone(),index:this.index.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};yr.ASTIndexExpression=ny});var ay=m(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});Mr.ASTElseClause=Mr.ASTIfClause=Mr.ASTIfStatement=Mr.ASTClause=void 0;var Ux=ft(),Za=class extends Ux.ASTBaseBlock{};Mr.ASTClause=Za;var iy=class t extends Ux.ASTBase{constructor(e,n){super(e,n),this.clauses=n.clauses||[]}toString(){if(this.clauses.length===0)return`IfStatement[${this.start}-${this.end}][]`;let e=this.clauses.map(n=>`${n}`).join(`
56
+ ]`}clone(){return new t({parameters:this.parameters.map(e=>e.clone()),assignment:this.assignment.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};dh.ASTFunctionStatement=oy});var hy=m(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.ASTIndexExpression=_r.ASTMemberExpression=_r.ASTIdentifier=_r.ASTIdentifierKind=void 0;var Do=pt(),uM;(function(t){t.Variable="variable",t.Argument="argument",t.ForInVariable="for-in-variable",t.Property="property"})(uM=_r.ASTIdentifierKind||(_r.ASTIdentifierKind={}));var uy=class t extends Do.ASTBase{constructor(e){super(Do.ASTType.Identifier,e),this.name=e.name,this.kind=e.kind}toString(){return`Identifier[${this.start}-${this.end}][${this.name}]`}clone(){return new t({name:this.name,kind:this.kind,start:this.start,end:this.end,range:this.range,scope:this.scope})}};_r.ASTIdentifier=uy;var cy=class t extends Do.ASTBase{constructor(e){super(Do.ASTType.MemberExpression,e),this.indexer=e.indexer,this.identifier=e.identifier,this.base=e.base}toString(){return`MemberExpression[${this.start}-${this.end}][${this.base}.${this.identifier}]`}clone(){return new t({indexer:this.indexer,identifier:this.identifier.clone(),base:this.base,start:this.start,end:this.end,range:this.range,scope:this.scope})}};_r.ASTMemberExpression=cy;var ly=class t extends Do.ASTBase{constructor(e){super(Do.ASTType.IndexExpression,e),this.base=e.base,this.index=e.index}toString(){return`IndexExpression[${this.start}-${this.end}][${this.base}[${this.index}]]`}clone(){return new t({base:this.base.clone(),index:this.index.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};_r.ASTIndexExpression=ly});var gy=m(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.ASTElseClause=Nr.ASTIfClause=Nr.ASTIfStatement=Nr.ASTClause=void 0;var tk=pt(),eu=class extends tk.ASTBaseBlock{};Nr.ASTClause=eu;var dy=class t extends tk.ASTBase{constructor(e,n){super(e,n),this.clauses=n.clauses||[]}toString(){if(this.clauses.length===0)return`IfStatement[${this.start}-${this.end}][]`;let e=this.clauses.map(n=>`${n}`).join(`
57
57
  `).split(`
58
58
  `).map(n=>` ${n}`).join(`
59
59
  `);return`IfStatement[${this.start}-${this.end}][
60
60
  ${e}
61
- ]`}clone(){return new t(this.type,{clauses:this.clauses.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Mr.ASTIfStatement=iy;var sy=class t extends Za{constructor(e,n){super(e,n),this.condition=n.condition}toString(){if(this.body.length===0)return`${this.type}[${this.start}-${this.end}][${this.condition}]`;let e=this.body.map(n=>`${n}`).join(`
61
+ ]`}clone(){return new t(this.type,{clauses:this.clauses.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Nr.ASTIfStatement=dy;var fy=class t extends eu{constructor(e,n){super(e,n),this.condition=n.condition}toString(){if(this.body.length===0)return`${this.type}[${this.start}-${this.end}][${this.condition}]`;let e=this.body.map(n=>`${n}`).join(`
62
62
  `).split(`
63
63
  `).map(n=>` ${n}`).join(`
64
64
  `);return`${this.type}[${this.start}-${this.end}][${this.condition}
65
65
  ${e}
66
- ]`}clone(){return new t(this.type,{condition:this.condition.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Mr.ASTIfClause=sy;var oy=class t extends Za{constructor(e,n){super(e,n)}toString(){if(this.body.length===0)return`${this.type}[]`;let e=this.body.map(n=>`${n}`).join(`
66
+ ]`}clone(){return new t(this.type,{condition:this.condition.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Nr.ASTIfClause=fy;var py=class t extends eu{constructor(e,n){super(e,n)}toString(){if(this.body.length===0)return`${this.type}[]`;let e=this.body.map(n=>`${n}`).join(`
67
67
  `).split(`
68
68
  `).map(n=>` ${n}`).join(`
69
69
  `);return`${this.type}[${this.start}-${this.end}][
70
70
  ${e}
71
- }]`}clone(){return new t(this.type,{start:this.start,end:this.end,range:this.range,scope:this.scope})}};Mr.ASTElseClause=oy});var cy=m(uh=>{"use strict";Object.defineProperty(uh,"__esModule",{value:!0});uh.ASTIsaExpression=void 0;var Wx=ft(),uy=class t extends Wx.ASTBase{constructor(e){super(Wx.ASTType.IsaExpression,e),this.operator=e.operator,this.left=e.left,this.right=e.right}toString(){return`${this.type}[${this.start}-${this.end}][${this.left} ${this.operator} ${this.right}]`}clone(){return new t({operator:this.operator,left:this.left.clone(),right:this.right.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};uh.ASTIsaExpression=uy});var dy=m(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});Ro.ASTListConstructorExpression=Ro.ASTListValue=void 0;var ch=ft(),ly=class t extends ch.ASTBase{constructor(e){super(ch.ASTType.ListValue,e),this.value=e.value}toString(){return`ListValue[${this.start}-${this.end}][${this.value}]`}clone(){return new t({value:this.value.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Ro.ASTListValue=ly;var hy=class t extends ch.ASTBase{constructor(e){super(ch.ASTType.ListConstructorExpression,e),this.fields=e.fields||[]}toString(){if(this.fields.length===0)return`ListConstructor[${this.start}-${this.end}][]`;let e=this.fields.map(n=>`${n}`).join(`
71
+ }]`}clone(){return new t(this.type,{start:this.start,end:this.end,range:this.range,scope:this.scope})}};Nr.ASTElseClause=py});var yy=m(fh=>{"use strict";Object.defineProperty(fh,"__esModule",{value:!0});fh.ASTIsaExpression=void 0;var nk=pt(),my=class t extends nk.ASTBase{constructor(e){super(nk.ASTType.IsaExpression,e),this.operator=e.operator,this.left=e.left,this.right=e.right}toString(){return`${this.type}[${this.start}-${this.end}][${this.left} ${this.operator} ${this.right}]`}clone(){return new t({operator:this.operator,left:this.left.clone(),right:this.right.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};fh.ASTIsaExpression=my});var vy=m(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.ASTListConstructorExpression=Io.ASTListValue=void 0;var ph=pt(),by=class t extends ph.ASTBase{constructor(e){super(ph.ASTType.ListValue,e),this.value=e.value}toString(){return`ListValue[${this.start}-${this.end}][${this.value}]`}clone(){return new t({value:this.value.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Io.ASTListValue=by;var _y=class t extends ph.ASTBase{constructor(e){super(ph.ASTType.ListConstructorExpression,e),this.fields=e.fields||[]}toString(){if(this.fields.length===0)return`ListConstructor[${this.start}-${this.end}][]`;let e=this.fields.map(n=>`${n}`).join(`
72
72
  `).split(`
73
73
  `).map(n=>` ${n}`).join(`
74
74
  `);return`ListConstructor[${this.start}-${this.end}][
75
75
  ${e}
76
- ]`}clone(){return new t({fields:this.fields.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Ro.ASTListConstructorExpression=hy});var by=m(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.ASTNilLiteral=Kn.ASTStringLiteral=Kn.ASTBooleanLiteral=Kn.ASTNumericLiteral=Kn.ASTLiteral=void 0;var Hx=Mi(),yy=ft(),ms=class extends yy.ASTBase{};Kn.ASTLiteral=ms;var fy=class t extends ms{constructor(e){super(Hx.TokenType.NumericLiteral,e),this.value=e.value,this.raw=e.raw,this.negated=!1}toString(){return`Literal[${this.start}-${this.end}][${this.negated?"-":""}${this.value}]`}clone(){let e=new t({value:this.value,raw:this.raw,start:this.start,end:this.end,range:this.range,scope:this.scope});return e.negated=this.negated,e}};Kn.ASTNumericLiteral=fy;var py=class t extends ms{constructor(e){super(Hx.TokenType.BooleanLiteral,e),this.value=e.value,this.raw=e.raw,this.negated=!1}toString(){return`Literal[${this.start}-${this.end}][${this.negated?"-":""}${this.value}]`}clone(){let e=new t({value:this.value,raw:this.raw,start:this.start,end:this.end,range:this.range,scope:this.scope});return e.negated=this.negated,e}};Kn.ASTBooleanLiteral=py;var gy=class t extends ms{constructor(e){super(yy.ASTType.StringLiteral,e),this.value=e.value,this.raw=e.raw}toString(){return`Literal[${this.start}-${this.end}][${this.value}]`}clone(){return new t({value:this.value,raw:this.raw,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Kn.ASTStringLiteral=gy;var my=class t extends ms{constructor(e){super(yy.ASTType.NilLiteral,e),this.value=e.value,this.raw=e.raw}toString(){return`Literal[${this.start}-${this.end}][${this.value}]`}clone(){return new t({value:this.value,raw:this.raw,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Kn.ASTNilLiteral=my});var vy=m(lh=>{"use strict";Object.defineProperty(lh,"__esModule",{value:!0});lh.ASTLogicalExpression=void 0;var Gx=ft(),_y=class t extends Gx.ASTBase{constructor(e){super(Gx.ASTType.LogicalExpression,e),this.operator=e.operator,this.left=e.left,this.right=e.right}toString(){return`${this.type}[${this.start}-${this.end}][${this.left} ${this.operator} ${this.right}]`}clone(){return new t({operator:this.operator,left:this.left.clone(),right:this.right.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};lh.ASTLogicalExpression=_y});var Ty=m(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.ASTMapConstructorExpression=Po.ASTMapKeyString=void 0;var hh=ft(),Sy=class t extends hh.ASTBase{constructor(e){super(hh.ASTType.MapKeyString,e),this.key=e.key,this.value=e.value}toString(){return`MapKeyString[${this.start}-${this.end}][${this.key}: ${this.value}]`}clone(){return new t({key:this.key.clone(),value:this.value.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Po.ASTMapKeyString=Sy;var wy=class t extends hh.ASTBase{constructor(e){super(hh.ASTType.MapConstructorExpression,e),this.fields=e.fields||[]}toString(){if(this.fields.length===0)return`MapConstructor[${this.start}-${this.end}][]`;let e=this.fields.map(n=>`${n}`).join(`
76
+ ]`}clone(){return new t({fields:this.fields.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Io.ASTListConstructorExpression=_y});var ky=m(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.ASTNilLiteral=Xn.ASTStringLiteral=Xn.ASTBooleanLiteral=Xn.ASTNumericLiteral=Xn.ASTLiteral=void 0;var rk=Fi(),xy=pt(),vs=class extends xy.ASTBase{};Xn.ASTLiteral=vs;var Sy=class t extends vs{constructor(e){super(rk.TokenType.NumericLiteral,e),this.value=e.value,this.raw=e.raw,this.negated=!1}toString(){return`Literal[${this.start}-${this.end}][${this.negated?"-":""}${this.value}]`}clone(){let e=new t({value:this.value,raw:this.raw,start:this.start,end:this.end,range:this.range,scope:this.scope});return e.negated=this.negated,e}};Xn.ASTNumericLiteral=Sy;var wy=class t extends vs{constructor(e){super(rk.TokenType.BooleanLiteral,e),this.value=e.value,this.raw=e.raw,this.negated=!1}toString(){return`Literal[${this.start}-${this.end}][${this.negated?"-":""}${this.value}]`}clone(){let e=new t({value:this.value,raw:this.raw,start:this.start,end:this.end,range:this.range,scope:this.scope});return e.negated=this.negated,e}};Xn.ASTBooleanLiteral=wy;var Ty=class t extends vs{constructor(e){super(xy.ASTType.StringLiteral,e),this.value=e.value,this.raw=e.raw}toString(){return`Literal[${this.start}-${this.end}][${this.value}]`}clone(){return new t({value:this.value,raw:this.raw,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Xn.ASTStringLiteral=Ty;var Ey=class t extends vs{constructor(e){super(xy.ASTType.NilLiteral,e),this.value=e.value,this.raw=e.raw}toString(){return`Literal[${this.start}-${this.end}][${this.value}]`}clone(){return new t({value:this.value,raw:this.raw,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Xn.ASTNilLiteral=Ey});var Cy=m(gh=>{"use strict";Object.defineProperty(gh,"__esModule",{value:!0});gh.ASTLogicalExpression=void 0;var ik=pt(),Ay=class t extends ik.ASTBase{constructor(e){super(ik.ASTType.LogicalExpression,e),this.operator=e.operator,this.left=e.left,this.right=e.right}toString(){return`${this.type}[${this.start}-${this.end}][${this.left} ${this.operator} ${this.right}]`}clone(){return new t({operator:this.operator,left:this.left.clone(),right:this.right.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};gh.ASTLogicalExpression=Ay});var Py=m(Mo=>{"use strict";Object.defineProperty(Mo,"__esModule",{value:!0});Mo.ASTMapConstructorExpression=Mo.ASTMapKeyString=void 0;var mh=pt(),Oy=class t extends mh.ASTBase{constructor(e){super(mh.ASTType.MapKeyString,e),this.key=e.key,this.value=e.value}toString(){return`MapKeyString[${this.start}-${this.end}][${this.key}: ${this.value}]`}clone(){return new t({key:this.key.clone(),value:this.value.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Mo.ASTMapKeyString=Oy;var Ry=class t extends mh.ASTBase{constructor(e){super(mh.ASTType.MapConstructorExpression,e),this.fields=e.fields||[]}toString(){if(this.fields.length===0)return`MapConstructor[${this.start}-${this.end}][]`;let e=this.fields.map(n=>`${n}`).join(`
77
77
  `).split(`
78
78
  `).map(n=>` ${n}`).join(`
79
79
  `);return`MapConstructor[${this.start}-${this.end}][
80
80
  ${e}
81
- ]`}clone(){return new t({fields:this.fields.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Po.ASTMapConstructorExpression=wy});var xy=m(dh=>{"use strict";Object.defineProperty(dh,"__esModule",{value:!0});dh.ASTParenthesisExpression=void 0;var zx=ft(),Ey=class t extends zx.ASTBase{constructor(e){super(zx.ASTType.ParenthesisExpression,e),this.expression=e.expression}toString(){return this.expression.toString()}clone(){return new t({expression:this.expression.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};dh.ASTParenthesisExpression=Ey});var Ay=m(fh=>{"use strict";Object.defineProperty(fh,"__esModule",{value:!0});fh.ASTReturnStatement=void 0;var Kx=ft(),ky=class t extends Kx.ASTBase{constructor(e){super(Kx.ASTType.ReturnStatement,e),this.argument=e.argument}toString(){return`ReturnStatement[${this.start}-${this.end}][${this.argument}]`}clone(){return new t({argument:this.argument.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};fh.ASTReturnStatement=ky});var Oy=m(ph=>{"use strict";Object.defineProperty(ph,"__esModule",{value:!0});ph.ASTSliceExpression=void 0;var Vx=ft(),Cy=class t extends Vx.ASTBase{constructor(e){super(Vx.ASTType.SliceExpression,e),this.left=e.left,this.right=e.right,this.base=e.base}toString(){return`SliceExpression[${this.start}-${this.end}][${this.base}[${this.left}:${this.right}]]`}clone(){return new t({base:this.base.clone(),left:this.left.clone(),right:this.right.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};ph.ASTSliceExpression=Cy});var Dy=m(mh=>{"use strict";Object.defineProperty(mh,"__esModule",{value:!0});mh.ASTUnaryExpression=void 0;var Ry=ko(),gh=ft(),Py=class t extends gh.ASTBase{constructor(e){super(t.getUnaryType(e.operator),e),this.argument=e.argument,this.operator=e.operator}static getUnaryType(e){switch(e){case Ry.Operator.Not:return gh.ASTType.NegationExpression;case Ry.Operator.Plus:case Ry.Operator.Minus:return gh.ASTType.BinaryNegatedExpression;default:return gh.ASTType.UnaryExpression}}toString(){return`${this.type}[${this.start}-${this.end}][${this.operator} ${this.argument}]`}clone(){return new t({argument:this.argument.clone(),operator:this.operator,start:this.start,end:this.end,range:this.range,scope:this.scope})}};mh.ASTUnaryExpression=Py});var My=m(yh=>{"use strict";Object.defineProperty(yh,"__esModule",{value:!0});yh.ASTWhileStatement=void 0;var Xx=ft(),Iy=class t extends Xx.ASTBaseBlock{constructor(e){super(Xx.ASTType.WhileStatement,e),this.condition=e.condition}toString(){if(this.body.length===0)return`WhileStatement[${this.start}-${this.end}][${this.condition}]`;let e=this.body.map(n=>`${n}`).join(`
81
+ ]`}clone(){return new t({fields:this.fields.map(e=>e.clone()),start:this.start,end:this.end,range:this.range,scope:this.scope})}};Mo.ASTMapConstructorExpression=Ry});var Iy=m(yh=>{"use strict";Object.defineProperty(yh,"__esModule",{value:!0});yh.ASTParenthesisExpression=void 0;var sk=pt(),Dy=class t extends sk.ASTBase{constructor(e){super(sk.ASTType.ParenthesisExpression,e),this.expression=e.expression}toString(){return this.expression.toString()}clone(){return new t({expression:this.expression.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};yh.ASTParenthesisExpression=Dy});var Ly=m(bh=>{"use strict";Object.defineProperty(bh,"__esModule",{value:!0});bh.ASTReturnStatement=void 0;var ok=pt(),My=class t extends ok.ASTBase{constructor(e){super(ok.ASTType.ReturnStatement,e),this.argument=e.argument}toString(){return`ReturnStatement[${this.start}-${this.end}][${this.argument}]`}clone(){return new t({argument:this.argument.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};bh.ASTReturnStatement=My});var qy=m(_h=>{"use strict";Object.defineProperty(_h,"__esModule",{value:!0});_h.ASTSliceExpression=void 0;var ak=pt(),Ny=class t extends ak.ASTBase{constructor(e){super(ak.ASTType.SliceExpression,e),this.left=e.left,this.right=e.right,this.base=e.base}toString(){return`SliceExpression[${this.start}-${this.end}][${this.base}[${this.left}:${this.right}]]`}clone(){return new t({base:this.base.clone(),left:this.left.clone(),right:this.right.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};_h.ASTSliceExpression=Ny});var $y=m(Sh=>{"use strict";Object.defineProperty(Sh,"__esModule",{value:!0});Sh.ASTUnaryExpression=void 0;var jy=Oo(),vh=pt(),Fy=class t extends vh.ASTBase{constructor(e){super(t.getUnaryType(e.operator),e),this.argument=e.argument,this.operator=e.operator}static getUnaryType(e){switch(e){case jy.Operator.Not:return vh.ASTType.NegationExpression;case jy.Operator.Plus:case jy.Operator.Minus:return vh.ASTType.BinaryNegatedExpression;default:return vh.ASTType.UnaryExpression}}toString(){return`${this.type}[${this.start}-${this.end}][${this.operator} ${this.argument}]`}clone(){return new t({argument:this.argument.clone(),operator:this.operator,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Sh.ASTUnaryExpression=Fy});var Wy=m(wh=>{"use strict";Object.defineProperty(wh,"__esModule",{value:!0});wh.ASTWhileStatement=void 0;var uk=pt(),By=class t extends uk.ASTBaseBlock{constructor(e){super(uk.ASTType.WhileStatement,e),this.condition=e.condition}toString(){if(this.body.length===0)return`WhileStatement[${this.start}-${this.end}][${this.condition}]`;let e=this.body.map(n=>`${n}`).join(`
82
82
  `).split(`
83
83
  `).map(n=>` ${n}`).join(`
84
84
  `);return`WhileStatement[${this.start}-${this.end}][${this.condition}
85
85
  ${e}
86
- ]`}clone(){return new t({condition:this.condition.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};yh.ASTWhileStatement=Iy});var qy=m(K=>{"use strict";Object.defineProperty(K,"__esModule",{value:!0});K.ASTWhileStatement=K.ASTUnaryExpression=K.ASTSliceExpression=K.ASTReturnStatement=K.ASTParenthesisExpression=K.ASTMapKeyString=K.ASTMapConstructorExpression=K.ASTLogicalExpression=K.ASTStringLiteral=K.ASTNumericLiteral=K.ASTNilLiteral=K.ASTLiteral=K.ASTBooleanLiteral=K.ASTListValue=K.ASTListConstructorExpression=K.ASTIsaExpression=K.ASTIfStatement=K.ASTIfClause=K.ASTElseClause=K.ASTClause=K.ASTMemberExpression=K.ASTIndexExpression=K.ASTIdentifierKind=K.ASTIdentifier=K.ASTFunctionStatement=K.ASTForGenericStatement=K.ASTComparisonGroupExpression=K.ASTChunk=K.ASTCallStatement=K.ASTCallExpression=K.ASTBinaryExpression=K.ASTType=K.ASTComment=K.ASTBaseBlockWithScope=K.ASTBaseBlock=K.ASTBase=K.ASTAssignmentStatement=K.ASTProvider=void 0;var bh=Mi(),zI=$m(),Ct=ft(),KI=Um(),Yx=Gm(),VI=Km(),XI=Xm(),YI=Jm(),JI=Zm(),Ly=ry(),Ni=ay(),QI=cy(),Jx=dy(),_h=by(),ZI=vy(),Qx=Ty(),eM=xy(),tM=Ay(),nM=Oy(),rM=Dy(),iM=My(),Ny=class{breakStatement(e){return new Ct.ASTBase(Ct.ASTType.BreakStatement,e)}continueStatement(e){return new Ct.ASTBase(Ct.ASTType.ContinueStatement,e)}returnStatement(e){return new tM.ASTReturnStatement(e)}ifShortcutStatement(e){return new Ni.ASTIfStatement(Ct.ASTType.IfShortcutStatement,e)}ifShortcutClause(e){return new Ni.ASTIfClause(Ct.ASTType.IfShortcutClause,e)}elseifShortcutClause(e){return new Ni.ASTIfClause(Ct.ASTType.ElseifShortcutClause,e)}elseShortcutClause(e){return new Ni.ASTElseClause(Ct.ASTType.ElseShortcutClause,e)}ifStatement(e){return new Ni.ASTIfStatement(Ct.ASTType.IfStatement,e)}ifClause(e){return new Ni.ASTIfClause(Ct.ASTType.IfClause,e)}elseifClause(e){return new Ni.ASTIfClause(Ct.ASTType.ElseifClause,e)}elseClause(e){return new Ni.ASTElseClause(Ct.ASTType.ElseClause,e)}whileStatement(e){return new iM.ASTWhileStatement(e)}assignmentStatement(e){return new zI.ASTAssignmentStatement(e)}callStatement(e){return new Yx.ASTCallStatement(e)}functionStatement(e){return new JI.ASTFunctionStatement(e)}forGenericStatement(e){return new YI.ASTForGenericStatement(e)}chunk(e){return new VI.ASTChunk(e)}identifier(e){return new Ly.ASTIdentifier(e)}literal(e,n){switch(e){case bh.TokenType.StringLiteral:return new _h.ASTStringLiteral(n);case bh.TokenType.NumericLiteral:return new _h.ASTNumericLiteral(n);case bh.TokenType.BooleanLiteral:return new _h.ASTBooleanLiteral(n);case bh.TokenType.NilLiteral:return new _h.ASTNilLiteral(n)}}memberExpression(e){return new Ly.ASTMemberExpression(e)}callExpression(e){return new Yx.ASTCallExpression(e)}comment(e){return new Ct.ASTComment(e)}unaryExpression(e){return new rM.ASTUnaryExpression(e)}mapKeyString(e){return new Qx.ASTMapKeyString(e)}mapConstructorExpression(e){return new Qx.ASTMapConstructorExpression(e)}listValue(e){return new Jx.ASTListValue(e)}listConstructorExpression(e){return new Jx.ASTListConstructorExpression(e)}unknown(e){return new Ct.ASTBase(Ct.ASTType.Unknown,e)}emptyExpression(e){return new Ct.ASTBase(Ct.ASTType.EmptyExpression,e)}invalidCodeExpression(e){return new Ct.ASTBase(Ct.ASTType.InvalidCodeExpression,e)}indexExpression(e){return new Ly.ASTIndexExpression(e)}logicalExpression(e){return new ZI.ASTLogicalExpression(e)}isaExpression(e){return new QI.ASTIsaExpression(e)}binaryExpression(e){return new KI.ASTBinaryExpression(e)}sliceExpression(e){return new nM.ASTSliceExpression(e)}parenthesisExpression(e){return new eM.ASTParenthesisExpression(e)}comparisonGroupExpression(e){return new XI.ASTComparisonGroupExpression(e)}};K.ASTProvider=Ny;var sM=$m();Object.defineProperty(K,"ASTAssignmentStatement",{enumerable:!0,get:function(){return sM.ASTAssignmentStatement}});var eu=ft();Object.defineProperty(K,"ASTBase",{enumerable:!0,get:function(){return eu.ASTBase}});Object.defineProperty(K,"ASTBaseBlock",{enumerable:!0,get:function(){return eu.ASTBaseBlock}});Object.defineProperty(K,"ASTBaseBlockWithScope",{enumerable:!0,get:function(){return eu.ASTBaseBlockWithScope}});Object.defineProperty(K,"ASTComment",{enumerable:!0,get:function(){return eu.ASTComment}});Object.defineProperty(K,"ASTType",{enumerable:!0,get:function(){return eu.ASTType}});var oM=Um();Object.defineProperty(K,"ASTBinaryExpression",{enumerable:!0,get:function(){return oM.ASTBinaryExpression}});var Zx=Gm();Object.defineProperty(K,"ASTCallExpression",{enumerable:!0,get:function(){return Zx.ASTCallExpression}});Object.defineProperty(K,"ASTCallStatement",{enumerable:!0,get:function(){return Zx.ASTCallStatement}});var aM=Km();Object.defineProperty(K,"ASTChunk",{enumerable:!0,get:function(){return aM.ASTChunk}});var uM=Xm();Object.defineProperty(K,"ASTComparisonGroupExpression",{enumerable:!0,get:function(){return uM.ASTComparisonGroupExpression}});var cM=Jm();Object.defineProperty(K,"ASTForGenericStatement",{enumerable:!0,get:function(){return cM.ASTForGenericStatement}});var lM=Zm();Object.defineProperty(K,"ASTFunctionStatement",{enumerable:!0,get:function(){return lM.ASTFunctionStatement}});var vh=ry();Object.defineProperty(K,"ASTIdentifier",{enumerable:!0,get:function(){return vh.ASTIdentifier}});Object.defineProperty(K,"ASTIdentifierKind",{enumerable:!0,get:function(){return vh.ASTIdentifierKind}});Object.defineProperty(K,"ASTIndexExpression",{enumerable:!0,get:function(){return vh.ASTIndexExpression}});Object.defineProperty(K,"ASTMemberExpression",{enumerable:!0,get:function(){return vh.ASTMemberExpression}});var Sh=ay();Object.defineProperty(K,"ASTClause",{enumerable:!0,get:function(){return Sh.ASTClause}});Object.defineProperty(K,"ASTElseClause",{enumerable:!0,get:function(){return Sh.ASTElseClause}});Object.defineProperty(K,"ASTIfClause",{enumerable:!0,get:function(){return Sh.ASTIfClause}});Object.defineProperty(K,"ASTIfStatement",{enumerable:!0,get:function(){return Sh.ASTIfStatement}});var hM=cy();Object.defineProperty(K,"ASTIsaExpression",{enumerable:!0,get:function(){return hM.ASTIsaExpression}});var ek=dy();Object.defineProperty(K,"ASTListConstructorExpression",{enumerable:!0,get:function(){return ek.ASTListConstructorExpression}});Object.defineProperty(K,"ASTListValue",{enumerable:!0,get:function(){return ek.ASTListValue}});var tu=by();Object.defineProperty(K,"ASTBooleanLiteral",{enumerable:!0,get:function(){return tu.ASTBooleanLiteral}});Object.defineProperty(K,"ASTLiteral",{enumerable:!0,get:function(){return tu.ASTLiteral}});Object.defineProperty(K,"ASTNilLiteral",{enumerable:!0,get:function(){return tu.ASTNilLiteral}});Object.defineProperty(K,"ASTNumericLiteral",{enumerable:!0,get:function(){return tu.ASTNumericLiteral}});Object.defineProperty(K,"ASTStringLiteral",{enumerable:!0,get:function(){return tu.ASTStringLiteral}});var dM=vy();Object.defineProperty(K,"ASTLogicalExpression",{enumerable:!0,get:function(){return dM.ASTLogicalExpression}});var tk=Ty();Object.defineProperty(K,"ASTMapConstructorExpression",{enumerable:!0,get:function(){return tk.ASTMapConstructorExpression}});Object.defineProperty(K,"ASTMapKeyString",{enumerable:!0,get:function(){return tk.ASTMapKeyString}});var fM=xy();Object.defineProperty(K,"ASTParenthesisExpression",{enumerable:!0,get:function(){return fM.ASTParenthesisExpression}});var pM=Ay();Object.defineProperty(K,"ASTReturnStatement",{enumerable:!0,get:function(){return pM.ASTReturnStatement}});var gM=Oy();Object.defineProperty(K,"ASTSliceExpression",{enumerable:!0,get:function(){return gM.ASTSliceExpression}});var mM=Dy();Object.defineProperty(K,"ASTUnaryExpression",{enumerable:!0,get:function(){return mM.ASTUnaryExpression}});var yM=My();Object.defineProperty(K,"ASTWhileStatement",{enumerable:!0,get:function(){return yM.ASTWhileStatement}})});var $y=m(Fy=>{"use strict";Object.defineProperty(Fy,"__esModule",{value:!0});var qi=Mi(),jy=class{constructor(){this.isNonNilLiteral=Set.prototype.has.bind(new Set([qi.TokenType.StringLiteral,qi.TokenType.NumericLiteral,qi.TokenType.BooleanLiteral])),this.isLiteral=Set.prototype.has.bind(new Set([qi.TokenType.StringLiteral,qi.TokenType.NumericLiteral,qi.TokenType.BooleanLiteral,qi.TokenType.NilLiteral]))}isComment(e){return e===qi.TokenType.Comment}};Fy.default=jy});var Uy=m(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.SelectorGroups=ue.SelectorGroupType=ue.getSelectorsFromGroup=ue.createSelectorGroup=ue.Selectors=ue.getSelectorValue=ue.createSelector=ue.createSelectorOptions=ue.SelectorType=void 0;var ce=Mi(),br=Eo(),_e=ko(),bM;(function(t){t.EndOfLine="EndOfLine",t.EndOfFile="EndOfFile",t.LParenthesis="LParenthesis",t.RParenthesis="RParenthesis",t.CLBracket="CLBracket",t.CRBracket="CRBracket",t.SLBracket="SLBracket",t.SRBracket="SRBracket",t.Assign="Assign",t.AddShorthand="AddShorthand",t.SubtractShorthand="SubtractShorthand",t.MultiplyShorthand="MultiplyShorthand",t.DivideShorthand="DivideShorthand",t.PowerShorthand="PowerShorthand",t.ModuloShorthand="ModuloShorthand",t.Seperator="Seperator",t.Function="Function",t.EndFunction="EndFunction",t.EndWhile="EndWhile",t.EndFor="EndFor",t.EndIf="EndIf",t.SliceSeperator="SliceSeperator",t.MapKeyValueSeperator="MapKeyValueSeperator",t.MapSeperator="MapSeperator",t.ListSeperator="ListSeperator",t.CallSeperator="CallSeperator",t.ArgumentSeperator="ArgumentSeperator",t.ImportCodeSeperator="ImportCodeSeperator",t.ElseIf="ElseIf",t.Then="Then",t.Else="Else",t.In="In",t.MemberSeperator="MemberSeperator",t.NumberSeperator="NumberSeperator",t.Reference="Reference",t.Isa="Isa",t.Or="Or",t.And="And",t.Minus="Minus",t.Plus="Plus",t.Times="Times",t.Divide="Divide",t.Power="Power",t.Mod="Mod",t.Equal="Equal",t.NotEqual="NotEqual",t.Greater="Greater",t.GreaterEqual="GreaterEqual",t.Lesser="Lesser",t.LessEqual="LessEqual",t.New="New",t.Not="Not",t.Comment="Comment"})(bM=ue.SelectorType||(ue.SelectorType={}));var By=class{};ue.createSelectorOptions=By;function ae(t){let e;return t.value===void 0?(e=new Function("token",`if (token == null) return false;return token.type === '${t.type}';`),Object.defineProperty(e,"name",{value:`selector_${t.type}`,writable:!1})):(e=new Function("token",`if (token == null) return false;return token.value === '${t.value}' && token.type === '${t.type}';`),Object.defineProperty(e,"name",{value:`selector_${t.type}_${t.value}`,writable:!1})),e.data=t,e}ue.createSelector=ae;function _M(t){return t.data.value}ue.getSelectorValue=_M;ue.Selectors={EndOfLine:ae({type:ce.TokenType.EOL,value:_e.Operator.EndOfLine}),EndOfFile:ae({type:ce.TokenType.EOF,value:_e.Operator.EndOfFile}),LParenthesis:ae({type:ce.TokenType.Punctuator,value:_e.Operator.LParenthesis}),RParenthesis:ae({type:ce.TokenType.Punctuator,value:_e.Operator.RParenthesis}),CLBracket:ae({type:ce.TokenType.Punctuator,value:_e.Operator.CLBracket}),CRBracket:ae({type:ce.TokenType.Punctuator,value:_e.Operator.CRBracket}),SLBracket:ae({type:ce.TokenType.Punctuator,value:_e.Operator.SLBracket}),SRBracket:ae({type:ce.TokenType.Punctuator,value:_e.Operator.SRBracket}),Assign:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Assign}),AddShorthand:ae({type:ce.TokenType.Punctuator,value:_e.Operator.AddShorthand}),SubtractShorthand:ae({type:ce.TokenType.Punctuator,value:_e.Operator.SubtractShorthand}),MultiplyShorthand:ae({type:ce.TokenType.Punctuator,value:_e.Operator.MultiplyShorthand}),DivideShorthand:ae({type:ce.TokenType.Punctuator,value:_e.Operator.DivideShorthand}),PowerShorthand:ae({type:ce.TokenType.Punctuator,value:_e.Operator.PowerShorthand}),ModuloShorthand:ae({type:ce.TokenType.Punctuator,value:_e.Operator.ModuloShorthand}),Seperator:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Comma}),Function:ae({type:ce.TokenType.Keyword,value:br.Keyword.Function}),EndFunction:ae({type:ce.TokenType.Keyword,value:br.Keyword.EndFunction}),EndWhile:ae({type:ce.TokenType.Keyword,value:br.Keyword.EndWhile}),EndFor:ae({type:ce.TokenType.Keyword,value:br.Keyword.EndFor}),EndIf:ae({type:ce.TokenType.Keyword,value:br.Keyword.EndIf}),SliceSeperator:ae({type:ce.TokenType.SliceOperator,value:_e.Operator.SliceSeperator}),MapKeyValueSeperator:ae({type:ce.TokenType.SliceOperator,value:_e.Operator.SliceSeperator}),MapSeperator:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Comma}),ListSeperator:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Comma}),CallSeperator:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Comma}),ArgumentSeperator:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Comma}),ImportCodeSeperator:ae({type:ce.TokenType.SliceOperator,value:_e.Operator.SliceSeperator}),ElseIf:ae({type:ce.TokenType.Keyword,value:br.Keyword.ElseIf}),Then:ae({type:ce.TokenType.Keyword,value:br.Keyword.Then}),Else:ae({type:ce.TokenType.Keyword,value:br.Keyword.Else}),In:ae({type:ce.TokenType.Keyword,value:br.Keyword.In}),MemberSeperator:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Member}),NumberSeperator:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Member}),Reference:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Reference}),Isa:ae({type:ce.TokenType.Keyword,value:_e.Operator.Isa}),Or:ae({type:ce.TokenType.Keyword,value:_e.Operator.Or}),And:ae({type:ce.TokenType.Keyword,value:_e.Operator.And}),Minus:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Minus}),Plus:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Plus}),Times:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Asterik}),Power:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Power}),Divide:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Slash}),Mod:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Modulo}),Equal:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Equal}),NotEqual:ae({type:ce.TokenType.Punctuator,value:_e.Operator.NotEqual}),Greater:ae({type:ce.TokenType.Punctuator,value:_e.Operator.GreaterThan}),GreaterEqual:ae({type:ce.TokenType.Punctuator,value:_e.Operator.GreaterThanOrEqual}),Lesser:ae({type:ce.TokenType.Punctuator,value:_e.Operator.LessThan}),LessEqual:ae({type:ce.TokenType.Punctuator,value:_e.Operator.LessThanOrEqual}),New:ae({type:ce.TokenType.Keyword,value:br.Keyword.New}),Not:ae({type:ce.TokenType.Keyword,value:br.Keyword.Not}),Comment:ae({type:ce.TokenType.Comment})};function Lr(t,e){let r=e.filter(a=>a.data.value!==void 0).map(a=>`case '${a.data.value}': return token.type === '${a.data.type}';`).join(`
86
+ ]`}clone(){return new t({condition:this.condition.clone(),start:this.start,end:this.end,range:this.range,scope:this.scope})}};wh.ASTWhileStatement=By});var Gy=m(K=>{"use strict";Object.defineProperty(K,"__esModule",{value:!0});K.ASTWhileStatement=K.ASTUnaryExpression=K.ASTSliceExpression=K.ASTReturnStatement=K.ASTParenthesisExpression=K.ASTMapKeyString=K.ASTMapConstructorExpression=K.ASTLogicalExpression=K.ASTStringLiteral=K.ASTNumericLiteral=K.ASTNilLiteral=K.ASTLiteral=K.ASTBooleanLiteral=K.ASTListValue=K.ASTListConstructorExpression=K.ASTIsaExpression=K.ASTIfStatement=K.ASTIfClause=K.ASTElseClause=K.ASTClause=K.ASTMemberExpression=K.ASTIndexExpression=K.ASTIdentifierKind=K.ASTIdentifier=K.ASTFunctionStatement=K.ASTForGenericStatement=K.ASTComparisonGroupExpression=K.ASTChunk=K.ASTCallStatement=K.ASTCallExpression=K.ASTBinaryExpression=K.ASTType=K.ASTComment=K.ASTBaseBlockWithScope=K.ASTBaseBlock=K.ASTBase=K.ASTAssignmentStatement=K.ASTProvider=void 0;var Th=Fi(),cM=Vm(),Rt=pt(),lM=Ym(),ck=Zm(),hM=ty(),dM=ry(),fM=sy(),pM=ay(),Uy=hy(),Bi=gy(),gM=yy(),lk=vy(),Eh=ky(),mM=Cy(),hk=Py(),yM=Iy(),bM=Ly(),_M=qy(),vM=$y(),SM=Wy(),Hy=class{breakStatement(e){return new Rt.ASTBase(Rt.ASTType.BreakStatement,e)}continueStatement(e){return new Rt.ASTBase(Rt.ASTType.ContinueStatement,e)}returnStatement(e){return new bM.ASTReturnStatement(e)}ifShortcutStatement(e){return new Bi.ASTIfStatement(Rt.ASTType.IfShortcutStatement,e)}ifShortcutClause(e){return new Bi.ASTIfClause(Rt.ASTType.IfShortcutClause,e)}elseifShortcutClause(e){return new Bi.ASTIfClause(Rt.ASTType.ElseifShortcutClause,e)}elseShortcutClause(e){return new Bi.ASTElseClause(Rt.ASTType.ElseShortcutClause,e)}ifStatement(e){return new Bi.ASTIfStatement(Rt.ASTType.IfStatement,e)}ifClause(e){return new Bi.ASTIfClause(Rt.ASTType.IfClause,e)}elseifClause(e){return new Bi.ASTIfClause(Rt.ASTType.ElseifClause,e)}elseClause(e){return new Bi.ASTElseClause(Rt.ASTType.ElseClause,e)}whileStatement(e){return new SM.ASTWhileStatement(e)}assignmentStatement(e){return new cM.ASTAssignmentStatement(e)}callStatement(e){return new ck.ASTCallStatement(e)}functionStatement(e){return new pM.ASTFunctionStatement(e)}forGenericStatement(e){return new fM.ASTForGenericStatement(e)}chunk(e){return new hM.ASTChunk(e)}identifier(e){return new Uy.ASTIdentifier(e)}literal(e,n){switch(e){case Th.TokenType.StringLiteral:return new Eh.ASTStringLiteral(n);case Th.TokenType.NumericLiteral:return new Eh.ASTNumericLiteral(n);case Th.TokenType.BooleanLiteral:return new Eh.ASTBooleanLiteral(n);case Th.TokenType.NilLiteral:return new Eh.ASTNilLiteral(n)}}memberExpression(e){return new Uy.ASTMemberExpression(e)}callExpression(e){return new ck.ASTCallExpression(e)}comment(e){return new Rt.ASTComment(e)}unaryExpression(e){return new vM.ASTUnaryExpression(e)}mapKeyString(e){return new hk.ASTMapKeyString(e)}mapConstructorExpression(e){return new hk.ASTMapConstructorExpression(e)}listValue(e){return new lk.ASTListValue(e)}listConstructorExpression(e){return new lk.ASTListConstructorExpression(e)}unknown(e){return new Rt.ASTBase(Rt.ASTType.Unknown,e)}emptyExpression(e){return new Rt.ASTBase(Rt.ASTType.EmptyExpression,e)}invalidCodeExpression(e){return new Rt.ASTBase(Rt.ASTType.InvalidCodeExpression,e)}indexExpression(e){return new Uy.ASTIndexExpression(e)}logicalExpression(e){return new mM.ASTLogicalExpression(e)}isaExpression(e){return new gM.ASTIsaExpression(e)}binaryExpression(e){return new lM.ASTBinaryExpression(e)}sliceExpression(e){return new _M.ASTSliceExpression(e)}parenthesisExpression(e){return new yM.ASTParenthesisExpression(e)}comparisonGroupExpression(e){return new dM.ASTComparisonGroupExpression(e)}};K.ASTProvider=Hy;var wM=Vm();Object.defineProperty(K,"ASTAssignmentStatement",{enumerable:!0,get:function(){return wM.ASTAssignmentStatement}});var tu=pt();Object.defineProperty(K,"ASTBase",{enumerable:!0,get:function(){return tu.ASTBase}});Object.defineProperty(K,"ASTBaseBlock",{enumerable:!0,get:function(){return tu.ASTBaseBlock}});Object.defineProperty(K,"ASTBaseBlockWithScope",{enumerable:!0,get:function(){return tu.ASTBaseBlockWithScope}});Object.defineProperty(K,"ASTComment",{enumerable:!0,get:function(){return tu.ASTComment}});Object.defineProperty(K,"ASTType",{enumerable:!0,get:function(){return tu.ASTType}});var TM=Ym();Object.defineProperty(K,"ASTBinaryExpression",{enumerable:!0,get:function(){return TM.ASTBinaryExpression}});var dk=Zm();Object.defineProperty(K,"ASTCallExpression",{enumerable:!0,get:function(){return dk.ASTCallExpression}});Object.defineProperty(K,"ASTCallStatement",{enumerable:!0,get:function(){return dk.ASTCallStatement}});var EM=ty();Object.defineProperty(K,"ASTChunk",{enumerable:!0,get:function(){return EM.ASTChunk}});var xM=ry();Object.defineProperty(K,"ASTComparisonGroupExpression",{enumerable:!0,get:function(){return xM.ASTComparisonGroupExpression}});var kM=sy();Object.defineProperty(K,"ASTForGenericStatement",{enumerable:!0,get:function(){return kM.ASTForGenericStatement}});var AM=ay();Object.defineProperty(K,"ASTFunctionStatement",{enumerable:!0,get:function(){return AM.ASTFunctionStatement}});var xh=hy();Object.defineProperty(K,"ASTIdentifier",{enumerable:!0,get:function(){return xh.ASTIdentifier}});Object.defineProperty(K,"ASTIdentifierKind",{enumerable:!0,get:function(){return xh.ASTIdentifierKind}});Object.defineProperty(K,"ASTIndexExpression",{enumerable:!0,get:function(){return xh.ASTIndexExpression}});Object.defineProperty(K,"ASTMemberExpression",{enumerable:!0,get:function(){return xh.ASTMemberExpression}});var kh=gy();Object.defineProperty(K,"ASTClause",{enumerable:!0,get:function(){return kh.ASTClause}});Object.defineProperty(K,"ASTElseClause",{enumerable:!0,get:function(){return kh.ASTElseClause}});Object.defineProperty(K,"ASTIfClause",{enumerable:!0,get:function(){return kh.ASTIfClause}});Object.defineProperty(K,"ASTIfStatement",{enumerable:!0,get:function(){return kh.ASTIfStatement}});var CM=yy();Object.defineProperty(K,"ASTIsaExpression",{enumerable:!0,get:function(){return CM.ASTIsaExpression}});var fk=vy();Object.defineProperty(K,"ASTListConstructorExpression",{enumerable:!0,get:function(){return fk.ASTListConstructorExpression}});Object.defineProperty(K,"ASTListValue",{enumerable:!0,get:function(){return fk.ASTListValue}});var nu=ky();Object.defineProperty(K,"ASTBooleanLiteral",{enumerable:!0,get:function(){return nu.ASTBooleanLiteral}});Object.defineProperty(K,"ASTLiteral",{enumerable:!0,get:function(){return nu.ASTLiteral}});Object.defineProperty(K,"ASTNilLiteral",{enumerable:!0,get:function(){return nu.ASTNilLiteral}});Object.defineProperty(K,"ASTNumericLiteral",{enumerable:!0,get:function(){return nu.ASTNumericLiteral}});Object.defineProperty(K,"ASTStringLiteral",{enumerable:!0,get:function(){return nu.ASTStringLiteral}});var OM=Cy();Object.defineProperty(K,"ASTLogicalExpression",{enumerable:!0,get:function(){return OM.ASTLogicalExpression}});var pk=Py();Object.defineProperty(K,"ASTMapConstructorExpression",{enumerable:!0,get:function(){return pk.ASTMapConstructorExpression}});Object.defineProperty(K,"ASTMapKeyString",{enumerable:!0,get:function(){return pk.ASTMapKeyString}});var RM=Iy();Object.defineProperty(K,"ASTParenthesisExpression",{enumerable:!0,get:function(){return RM.ASTParenthesisExpression}});var PM=Ly();Object.defineProperty(K,"ASTReturnStatement",{enumerable:!0,get:function(){return PM.ASTReturnStatement}});var DM=qy();Object.defineProperty(K,"ASTSliceExpression",{enumerable:!0,get:function(){return DM.ASTSliceExpression}});var IM=$y();Object.defineProperty(K,"ASTUnaryExpression",{enumerable:!0,get:function(){return IM.ASTUnaryExpression}});var MM=Wy();Object.defineProperty(K,"ASTWhileStatement",{enumerable:!0,get:function(){return MM.ASTWhileStatement}})});var Vy=m(Ky=>{"use strict";Object.defineProperty(Ky,"__esModule",{value:!0});var Wi=Fi(),zy=class{constructor(){this.isNonNilLiteral=Set.prototype.has.bind(new Set([Wi.TokenType.StringLiteral,Wi.TokenType.NumericLiteral,Wi.TokenType.BooleanLiteral])),this.isLiteral=Set.prototype.has.bind(new Set([Wi.TokenType.StringLiteral,Wi.TokenType.NumericLiteral,Wi.TokenType.BooleanLiteral,Wi.TokenType.NilLiteral]))}isComment(e){return e===Wi.TokenType.Comment}};Ky.default=zy});var Yy=m(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.SelectorGroups=ue.SelectorGroupType=ue.getSelectorsFromGroup=ue.createSelectorGroup=ue.Selectors=ue.getSelectorValue=ue.createSelector=ue.createSelectorOptions=ue.SelectorType=void 0;var ce=Fi(),vr=Ao(),_e=Oo(),LM;(function(t){t.EndOfLine="EndOfLine",t.EndOfFile="EndOfFile",t.LParenthesis="LParenthesis",t.RParenthesis="RParenthesis",t.CLBracket="CLBracket",t.CRBracket="CRBracket",t.SLBracket="SLBracket",t.SRBracket="SRBracket",t.Assign="Assign",t.AddShorthand="AddShorthand",t.SubtractShorthand="SubtractShorthand",t.MultiplyShorthand="MultiplyShorthand",t.DivideShorthand="DivideShorthand",t.PowerShorthand="PowerShorthand",t.ModuloShorthand="ModuloShorthand",t.Seperator="Seperator",t.Function="Function",t.EndFunction="EndFunction",t.EndWhile="EndWhile",t.EndFor="EndFor",t.EndIf="EndIf",t.SliceSeperator="SliceSeperator",t.MapKeyValueSeperator="MapKeyValueSeperator",t.MapSeperator="MapSeperator",t.ListSeperator="ListSeperator",t.CallSeperator="CallSeperator",t.ArgumentSeperator="ArgumentSeperator",t.ImportCodeSeperator="ImportCodeSeperator",t.ElseIf="ElseIf",t.Then="Then",t.Else="Else",t.In="In",t.MemberSeperator="MemberSeperator",t.NumberSeperator="NumberSeperator",t.Reference="Reference",t.Isa="Isa",t.Or="Or",t.And="And",t.Minus="Minus",t.Plus="Plus",t.Times="Times",t.Divide="Divide",t.Power="Power",t.Mod="Mod",t.Equal="Equal",t.NotEqual="NotEqual",t.Greater="Greater",t.GreaterEqual="GreaterEqual",t.Lesser="Lesser",t.LessEqual="LessEqual",t.New="New",t.Not="Not",t.Comment="Comment"})(LM=ue.SelectorType||(ue.SelectorType={}));var Xy=class{};ue.createSelectorOptions=Xy;function ae(t){let e;return t.value===void 0?(e=new Function("token",`if (token == null) return false;return token.type === '${t.type}';`),Object.defineProperty(e,"name",{value:`selector_${t.type}`,writable:!1})):(e=new Function("token",`if (token == null) return false;return token.value === '${t.value}' && token.type === '${t.type}';`),Object.defineProperty(e,"name",{value:`selector_${t.type}_${t.value}`,writable:!1})),e.data=t,e}ue.createSelector=ae;function NM(t){return t.data.value}ue.getSelectorValue=NM;ue.Selectors={EndOfLine:ae({type:ce.TokenType.EOL,value:_e.Operator.EndOfLine}),EndOfFile:ae({type:ce.TokenType.EOF,value:_e.Operator.EndOfFile}),LParenthesis:ae({type:ce.TokenType.Punctuator,value:_e.Operator.LParenthesis}),RParenthesis:ae({type:ce.TokenType.Punctuator,value:_e.Operator.RParenthesis}),CLBracket:ae({type:ce.TokenType.Punctuator,value:_e.Operator.CLBracket}),CRBracket:ae({type:ce.TokenType.Punctuator,value:_e.Operator.CRBracket}),SLBracket:ae({type:ce.TokenType.Punctuator,value:_e.Operator.SLBracket}),SRBracket:ae({type:ce.TokenType.Punctuator,value:_e.Operator.SRBracket}),Assign:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Assign}),AddShorthand:ae({type:ce.TokenType.Punctuator,value:_e.Operator.AddShorthand}),SubtractShorthand:ae({type:ce.TokenType.Punctuator,value:_e.Operator.SubtractShorthand}),MultiplyShorthand:ae({type:ce.TokenType.Punctuator,value:_e.Operator.MultiplyShorthand}),DivideShorthand:ae({type:ce.TokenType.Punctuator,value:_e.Operator.DivideShorthand}),PowerShorthand:ae({type:ce.TokenType.Punctuator,value:_e.Operator.PowerShorthand}),ModuloShorthand:ae({type:ce.TokenType.Punctuator,value:_e.Operator.ModuloShorthand}),Seperator:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Comma}),Function:ae({type:ce.TokenType.Keyword,value:vr.Keyword.Function}),EndFunction:ae({type:ce.TokenType.Keyword,value:vr.Keyword.EndFunction}),EndWhile:ae({type:ce.TokenType.Keyword,value:vr.Keyword.EndWhile}),EndFor:ae({type:ce.TokenType.Keyword,value:vr.Keyword.EndFor}),EndIf:ae({type:ce.TokenType.Keyword,value:vr.Keyword.EndIf}),SliceSeperator:ae({type:ce.TokenType.SliceOperator,value:_e.Operator.SliceSeperator}),MapKeyValueSeperator:ae({type:ce.TokenType.SliceOperator,value:_e.Operator.SliceSeperator}),MapSeperator:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Comma}),ListSeperator:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Comma}),CallSeperator:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Comma}),ArgumentSeperator:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Comma}),ImportCodeSeperator:ae({type:ce.TokenType.SliceOperator,value:_e.Operator.SliceSeperator}),ElseIf:ae({type:ce.TokenType.Keyword,value:vr.Keyword.ElseIf}),Then:ae({type:ce.TokenType.Keyword,value:vr.Keyword.Then}),Else:ae({type:ce.TokenType.Keyword,value:vr.Keyword.Else}),In:ae({type:ce.TokenType.Keyword,value:vr.Keyword.In}),MemberSeperator:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Member}),NumberSeperator:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Member}),Reference:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Reference}),Isa:ae({type:ce.TokenType.Keyword,value:_e.Operator.Isa}),Or:ae({type:ce.TokenType.Keyword,value:_e.Operator.Or}),And:ae({type:ce.TokenType.Keyword,value:_e.Operator.And}),Minus:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Minus}),Plus:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Plus}),Times:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Asterik}),Power:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Power}),Divide:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Slash}),Mod:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Modulo}),Equal:ae({type:ce.TokenType.Punctuator,value:_e.Operator.Equal}),NotEqual:ae({type:ce.TokenType.Punctuator,value:_e.Operator.NotEqual}),Greater:ae({type:ce.TokenType.Punctuator,value:_e.Operator.GreaterThan}),GreaterEqual:ae({type:ce.TokenType.Punctuator,value:_e.Operator.GreaterThanOrEqual}),Lesser:ae({type:ce.TokenType.Punctuator,value:_e.Operator.LessThan}),LessEqual:ae({type:ce.TokenType.Punctuator,value:_e.Operator.LessThanOrEqual}),New:ae({type:ce.TokenType.Keyword,value:vr.Keyword.New}),Not:ae({type:ce.TokenType.Keyword,value:vr.Keyword.Not}),Comment:ae({type:ce.TokenType.Comment})};function qr(t,e){let r=e.filter(a=>a.data.value!==void 0).map(a=>`case '${a.data.value}': return token.type === '${a.data.type}';`).join(`
87
87
  `),s=e.filter(a=>a.data.value===void 0).map(a=>`case '${a.data.type}':`).join(`
88
88
  `),o=new Function("token",`
89
89
  ${s.length>0?`switch(token.type) {
@@ -93,31 +93,31 @@ ${e}
93
93
  ${r.length>0?`switch(token.value) {
94
94
  ${r}
95
95
  }`:""}
96
- return false;`);return Object.defineProperty(o,"name",{value:`selector_group_${t}`,writable:!1}),o.selectors=e,o}ue.createSelectorGroup=Lr;function vM(t){return t.selectors}ue.getSelectorsFromGroup=vM;var Nr;(function(t){t.BlockEndOfLine="BlockEndOfLine",t.AssignmentEndOfExpr="AssignmentEndOfExpr",t.AssignmentShorthand="AssignmentShorthand",t.AssignmentCommandArgs="AssignmentCommandArgs",t.ReturnStatementEnd="ReturnStatementEnd",t.FunctionDeclarationArgEnd="FunctionDeclarationArgEnd",t.ComparisonOperators="ComparisonOperators",t.MultiDivOperators="MultiDivOperators",t.CallArgsEnd="CallArgsEnd"})(Nr=ue.SelectorGroupType||(ue.SelectorGroupType={}));ue.SelectorGroups={BlockEndOfLine:Lr(Nr.AssignmentEndOfExpr,[ue.Selectors.EndOfLine,ue.Selectors.Comment]),AssignmentEndOfExpr:Lr(Nr.AssignmentEndOfExpr,[ue.Selectors.EndOfFile,ue.Selectors.EndOfLine,ue.Selectors.Else,ue.Selectors.Comment]),AssignmentShorthand:Lr(Nr.AssignmentShorthand,[ue.Selectors.AddShorthand,ue.Selectors.SubtractShorthand,ue.Selectors.MultiplyShorthand,ue.Selectors.DivideShorthand,ue.Selectors.PowerShorthand,ue.Selectors.ModuloShorthand]),AssignmentCommandArgs:Lr(Nr.AssignmentCommandArgs,[ue.Selectors.ArgumentSeperator,ue.Selectors.EndOfLine,ue.Selectors.EndOfFile]),ReturnStatementEnd:Lr(Nr.ReturnStatementEnd,[ue.Selectors.EndOfLine,ue.Selectors.Else,ue.Selectors.Comment]),FunctionDeclarationArgEnd:Lr(Nr.FunctionDeclarationArgEnd,[ue.Selectors.RParenthesis,ue.Selectors.EndOfFile,ue.Selectors.EndOfLine]),ComparisonOperators:Lr(Nr.ComparisonOperators,[ue.Selectors.Equal,ue.Selectors.NotEqual,ue.Selectors.Greater,ue.Selectors.GreaterEqual,ue.Selectors.Lesser,ue.Selectors.LessEqual]),MultiDivOperators:Lr(Nr.MultiDivOperators,[ue.Selectors.Times,ue.Selectors.Divide,ue.Selectors.Mod]),CallArgsEnd:Lr(Nr.CallArgsEnd,[ue.Selectors.ArgumentSeperator,ue.Selectors.RParenthesis])}});var Hy=m(wh=>{"use strict";Object.defineProperty(wh,"__esModule",{value:!0});wh.Stack=void 0;var Wy=class{constructor(){this._items=[],this._last=null,this._default=null}setDefault(e){this._default=e}push(e){return this._items.push(this._last=e)}pop(){switch(this._items.length){case 0:return this._default;case 1:return this._last=null,this._items.pop()}let e=this._items.pop();return this._last=this._items[this._items.length-1],e}peek(){return this._last||this._default}};wh.Stack=Wy});var Yy=m(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.PendingWhile=Je.isPendingWhile=Je.PendingIf=Je.isPendingIf=Je.PendingFunction=Je.isPendingFunction=Je.PendingFor=Je.isPendingFor=Je.PendingChunk=Je.isPendingChunk=Je.PendingBlockType=void 0;var _r;(function(t){t[t.Chunk=0]="Chunk",t[t.For=1]="For",t[t.Function=2]="Function",t[t.If=3]="If",t[t.While=4]="While"})(_r=Je.PendingBlockType||(Je.PendingBlockType={}));var ys=class{constructor(e,n,r){this.lineRegistry=r,this.block=e,this.body=[],this.type=n,this.onComplete=null}complete(e){var n;(n=this.onComplete)===null||n===void 0||n.call(this,this)}};function SM(t){return t.type===_r.Chunk}Je.isPendingChunk=SM;var Gy=class extends ys{constructor(e,n){super(e,_r.Chunk,n)}complete(e){this.block.body=this.body,this.block.end=e.end,this.block.range=[this.block.range[0],e.range[1]],super.complete(e)}};Je.PendingChunk=Gy;function wM(t){return t.type===_r.For}Je.isPendingFor=wM;var zy=class extends ys{constructor(e,n){super(e,_r.For,n),this.lineRegistry.addItemToLine(this.block.start.line,this.block)}complete(e){this.block.body=this.body,this.block.end=e.end,this.block.range=[this.block.range[0],e.range[1]],this.lineRegistry.addItemToRange(this.block.start.line+1,e.end.line,this.block),super.complete(e)}};Je.PendingFor=zy;function TM(t){return t.type===_r.Function}Je.isPendingFunction=TM;var Ky=class extends ys{constructor(e,n,r){super(e,_r.Function,r),this.base=n,this.lineRegistry.addItemToLine(this.block.start.line,this.block)}complete(e){this.block.body=this.body,this.block.end=e.end,this.block.range=[this.block.range[0],e.range[1]],this.base!==null?(this.base.end=this.block.end,this.base.range[1]=this.block.range[1],this.lineRegistry.addItemToRange(this.block.start.line+1,this.base.end.line,this.base)):this.lineRegistry.addItemToRange(this.block.start.line+1,this.block.end.line,this.block),super.complete(e)}};Je.PendingFunction=Ky;function EM(t){return t.type===_r.If}Je.isPendingIf=EM;var Vy=class extends ys{constructor(e,n,r){super(e,_r.If,r),this.lineRegistry.addItemToLine(this.block.start.line,this.block),this.currentClause=n}addCurrentClauseToLineRegistry(){this.currentClause.start.line===this.block.start.line?this.lineRegistry.addItemToRange(this.currentClause.start.line+1,this.currentClause.end.line,this.block):this.lineRegistry.addItemToRange(this.currentClause.start.line,this.currentClause.end.line,this.block)}next(e){this.currentClause.body=this.body,this.currentClause.end=e.end,this.currentClause.range=[this.currentClause.range[0],e.range[1]],this.addCurrentClauseToLineRegistry(),this.block.clauses.push(this.currentClause),super.complete(e),this.body=[]}complete(e){this.body.length>0&&this.next(e),this.block.end=e.end,this.block.range=[this.block.range[0],e.range[1]],this.lineRegistry.addItemToRange(this.currentClause.end.line+1,this.block.end.line,this.block),super.complete(e)}};Je.PendingIf=Vy;function xM(t){return t.type===_r.While}Je.isPendingWhile=xM;var Xy=class extends ys{constructor(e,n){super(e,_r.While,n),this.lineRegistry.addItemToLine(this.block.start.line,this.block)}complete(e){this.block.body=this.body,this.block.end=e.end,this.block.range=[this.block.range[0],e.range[1]],this.lineRegistry.addItemToRange(this.block.start.line+1,e.end.line,this.block),super.complete(e)}};Je.PendingWhile=Xy});var Qy=m(Th=>{"use strict";Object.defineProperty(Th,"__esModule",{value:!0});Th.LineRegistry=void 0;var Jy=class{constructor(){this._lines={}}get lines(){return this._lines}addItemToLines(e){this.addItemToRange(e.start.line,e.end.line,e)}addItemToLine(e,n){this.addItemToRange(e,e,n)}addItemToRange(e,n,r){let i=this._lines;for(let s=e;s<=n;s++){let o=i[s];o?o.push(r):i[s]=[r]}}};Th.LineRegistry=Jy});var rk=m(nu=>{"use strict";var nk=nu&&nu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(nu,"__esModule",{value:!0});var kM=nk(Nm()),bs=Mi(),En=qy(),AM=nk($y()),CM=Jl(),Kt=Eo(),oi=ko(),an=Xa(),X=Uy(),OM=Hy(),qr=Yy(),RM=Qy(),Zy=class{constructor(e,n={}){let r=this;r.content=e,r.backpatches=new OM.Stack,r.statementErrors=[],r.lexer=n.lexer||new kM.default(e,{unsafe:n.unsafe,tabWidth:n.tabWidth}),r.token=null,r.previousToken=null,r.lineRegistry=new RM.LineRegistry,r.scopes=[],r.currentScope=null,r.currentAssignment=null,r.outerScopes=[],r.literals=[],r.validator=n.validator||new AM.default,r.astProvider=n.astProvider||new En.ASTProvider,r.unsafe=n.unsafe||!1,r.errors=[]}next(){this.previousToken=this.token,this.token=this.lexer.next()}isType(e){return this.token!==null&&e===this.token.type}consume(e){return e(this.token)?(this.next(),!0):!1}consumeMany(e){return e(this.token)?(this.next(),!0):!1}requireType(e,n){let r=this.token;return this.token.type!==e?(this.raise(`got ${r} where ${e} is required`,new an.Range(n||r.start,r.end)),null):(this.next(),r)}requireToken(e,n){let r=this.token;return e(r)?(this.next(),r):(this.raise(`got ${r} where "${(0,X.getSelectorValue)(e)}" is required`,new an.Range(n||r.start,r.end)),null)}requireTokenOfAny(e,n){let r=this.token;return e(r)?(this.next(),r):(this.raise(`got ${r} where any of ${(0,X.getSelectorsFromGroup)(e).map(i=>`"${(0,X.getSelectorValue)(i)}"`).join(", ")} is required`,new an.Range(n||r.start,r.end)),null)}skipNewlines(){var e;let n=this,r=0;for(;;){if(X.Selectors.Comment(n.token)){let i=((e=n.previousToken)===null||e===void 0?void 0:e.line)!==n.token.line,s=n.astProvider.comment({value:n.token.value,start:n.token.start,end:n.token.end,range:n.token.range,scope:n.currentScope,isStatement:i});n.lineRegistry.addItemToLines(s)}else if(X.Selectors.EndOfLine(n.token))r++;else break;n.next()}return r}pushScope(e){let n=this;n.currentScope!==null&&(n.scopes.push(e),n.outerScopes.push(n.currentScope)),n.currentScope=e}popScope(){let e=this;e.currentScope=e.outerScopes.pop()}tryToRecover(){let e=this,n=e.statementErrors[0];if(e.errors.push(n),!e.unsafe)throw n;for(e.lexer.recoverFromSnapshot(),e.next();e.token.type!==bs.TokenType.EOL&&e.token.type!==bs.TokenType.EOF;e.next());}finishRemaingScopes(){let e=this,n=e.backpatches.pop();for(;!(0,qr.isPendingChunk)(n);){let r=e.raise(`found open block ${n.block.type}`,new an.Range(n.block.start,n.block.start));if(n.complete(e.previousToken),e.errors.push(r),!e.unsafe)throw r;n=e.backpatches.pop()}}parseChunk(){let e=this;e.next();let n=e.token.start,r=e.astProvider.chunk({start:n,end:null,range:[e.token.range[0],null]}),i=new qr.PendingChunk(r,e.lineRegistry);for(e.backpatches.setDefault(i),e.pushScope(r);!X.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!X.Selectors.EndOfFile(e.token));)e.lexer.recordSnapshot(),e.statementErrors=[],e.parseStatement(),e.statementErrors.length>0&&e.tryToRecover();return e.finishRemaingScopes(),e.popScope(),i.complete(e.token),r.literals=e.literals,r.scopes=e.scopes,r.lines=e.lineRegistry.lines,r}parseStatement(){let e=this;if(bs.TokenType.Keyword===e.token.type&&Kt.Keyword.Not!==e.token.value){e.parseKeyword();return}let n=e.backpatches.peek(),r=e.parseAssignment();r.end!==null&&e.lineRegistry.addItemToLines(r),n.body.push(r)}parseKeyword(){let e=this;switch(e.token.value){case Kt.Keyword.Return:{let r=e.backpatches.peek();e.next();let i=e.parseReturnStatement();i.end!==null&&e.lineRegistry.addItemToLines(i),r.body.push(i);return}case Kt.Keyword.If:{e.next(),e.parseIfStatement();return}case Kt.Keyword.ElseIf:{e.next(),e.nextIfClause(En.ASTType.ElseifClause);return}case Kt.Keyword.Else:{e.next(),e.nextIfClause(En.ASTType.ElseClause);return}case Kt.Keyword.While:{e.next(),e.parseWhileStatement();return}case Kt.Keyword.For:{e.next(),e.parseForStatement();return}case Kt.Keyword.EndFunction:{e.next(),e.finalizeFunction();return}case Kt.Keyword.EndFor:{e.next(),e.finalizeForStatement();return}case Kt.Keyword.EndWhile:{e.next(),e.finalizeWhileStatement();return}case Kt.Keyword.EndIf:{e.next(),e.nextIfClause(null);return}case Kt.Keyword.Continue:{let r=e.backpatches.peek();e.next();let i=e.astProvider.continueStatement({start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});e.lineRegistry.addItemToLines(i),r.body.push(i);return}case Kt.Keyword.Break:{let r=e.backpatches.peek();e.next();let i=e.astProvider.breakStatement({start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});e.lineRegistry.addItemToLines(i),r.body.push(i);return}}e.raise(`unexpected keyword ${e.token} at start of line`,new an.Range(e.token.start,e.token.end))}parseShortcutStatement(){let e=this;if(bs.TokenType.Keyword===e.token.type&&Kt.Keyword.Not!==e.token.value)switch(e.token.value){case Kt.Keyword.Return:return e.next(),e.parseReturnStatement();case Kt.Keyword.Continue:return e.next(),e.astProvider.continueStatement({start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});case Kt.Keyword.Break:return e.next(),e.astProvider.breakStatement({start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});default:return e.raise(`unexpected keyword ${e.token} in shorthand statement`,new an.Range(e.token.start,e.token.end)),e.parseInvalidCode()}return e.parseAssignment()}parseAssignment(){let e=this,n=e.currentScope,r=e.token,i=e.parseExpr(null,!0,!0);if(X.SelectorGroups.AssignmentEndOfExpr(e.token))return i;if(X.Selectors.Assign(e.token)){e.next();let o=e.astProvider.assignmentStatement({variable:i,init:null,start:r.start,range:[r.range[0],null],end:null,scope:n}),a=e.currentAssignment;return e.currentAssignment=o,o.init=e.parseExpr(o),o.end=e.previousToken.end,o.range[1]=e.previousToken.range[1],e.currentAssignment=a,n.assignments.push(o),o}else if(X.SelectorGroups.AssignmentShorthand(e.token)){let o=e.token;e.next();let a=e.astProvider.assignmentStatement({variable:i,init:null,start:r.start,range:[r.range[0],null],end:null,scope:n}),u=e.currentAssignment;e.currentAssignment=a;let c=e.token,l=o.value.charAt(0),h=e.parseExpr(a),d=e.astProvider.parenthesisExpression({start:h.start,end:h.end,range:h.range,expression:h});return a.init=e.astProvider.binaryExpression({operator:l,left:i.clone(),right:d,start:c.start,end:e.previousToken.end,range:[c.range[0],e.previousToken.range[1]],scope:n}),a.end=e.previousToken.end,a.range[1]=e.previousToken.range[1],e.currentAssignment=u,n.assignments.push(a),a}let s=[];for(;!X.Selectors.EndOfFile(e.token);){let o=e.parseExpr(null);if(s.push(o),X.SelectorGroups.BlockEndOfLine(e.token)||X.Selectors.Else(e.token))break;if(X.Selectors.ArgumentSeperator(e.token)){e.next(),e.skipNewlines();continue}let a=e.requireTokenOfAny(X.SelectorGroups.AssignmentCommandArgs,r.start);if(X.Selectors.EndOfLine(a)||X.Selectors.EndOfFile(a))break}return s.length===0?e.astProvider.callStatement({expression:i,start:r.start,end:e.previousToken.end,range:[r.range[0],e.previousToken.range[1]],scope:n}):e.astProvider.callStatement({expression:e.astProvider.callExpression({base:i,arguments:s,start:r.start,end:e.previousToken.end,range:[r.range[0],e.previousToken.range[1]],scope:n}),start:r.start,end:e.previousToken.end,range:[r.range[0],e.previousToken.range[1]],scope:n})}parseReturnStatement(){let e=this,n=e.currentScope,r=e.previousToken,i=null,s=e.astProvider.returnStatement({argument:null,start:r.start,end:null,range:[r.range[0],null],scope:n});return X.SelectorGroups.ReturnStatementEnd(e.token)?(s.end=e.previousToken.end,s.range[1]=e.previousToken.range[1]):(i=e.parseExpr(s),s.end=e.previousToken.end,s.range[1]=e.previousToken.range[1],s.argument=i),n.returns.push(s),s}parseIfStatement(){let e=this,n=e.previousToken,r=e.parseExpr(null);if(e.lineRegistry.addItemToLines(r),e.requireToken(X.Selectors.Then,n.start),!X.SelectorGroups.BlockEndOfLine(e.token)){e.parseIfShortcutStatement(r,n);return}let i=e.astProvider.ifStatement({clauses:[],start:n.start,end:null,range:[n.range[0],null],scope:e.currentScope}),s=e.astProvider.ifClause({condition:r,start:n.start,end:e.token.end,range:[n.range[0],e.token.range[1]],scope:e.currentScope}),o=new qr.PendingIf(i,s,e.lineRegistry);e.backpatches.push(o)}nextIfClause(e){let n=this,r=n.backpatches.peek();if(!(0,qr.isPendingIf)(r)){n.raise("no matching open if block",new an.Range(n.token.start,n.token.end));return}switch(r.next(n.previousToken),e){case En.ASTType.ElseifClause:{let i=n.token,s=n.parseExpr(null);n.requireToken(X.Selectors.Then,i.start),r.currentClause=n.astProvider.elseifClause({condition:s,start:i.start,end:null,range:[i.range[0],null],scope:n.currentScope});break}case En.ASTType.ElseClause:{let i=n.token;r.currentClause=n.astProvider.elseClause({start:i.start,end:null,range:[i.range[0],null],scope:n.currentScope});break}}e===null&&(r.complete(n.previousToken),n.backpatches.pop(),n.backpatches.peek().body.push(r.block))}parseIfShortcutStatement(e,n){let r=this,i=[],s=r.backpatches.peek(),o=r.astProvider.ifShortcutStatement({clauses:i,start:n.start,end:null,range:[n.range[0],null],scope:r.currentScope}),a=r.parseShortcutStatement();if(i.push(r.astProvider.ifShortcutClause({condition:e,body:[a],start:n.start,end:r.token.end,range:[n.range[0],r.token.range[1]],scope:r.currentScope})),X.Selectors.Else(r.token)){r.next();let u=r.token,c=r.parseShortcutStatement();i.push(r.astProvider.elseShortcutClause({body:[c],start:u.start,end:r.token.end,range:[u.range[0],r.token.range[1]],scope:r.currentScope}))}o.end=r.token.end,o.range[1]=r.token.range[1],r.lineRegistry.addItemToLines(o),s.body.push(o)}parseWhileStatement(){let e=this,n=e.previousToken,r=e.parseExpr(null);if(!r){e.raise("while requires a condition",new an.Range(n.start,e.token.end));return}if(!X.SelectorGroups.BlockEndOfLine(e.token))return e.parseWhileShortcutStatement(r,n);let i=e.astProvider.whileStatement({condition:r,start:n.start,end:null,range:[n.range[0],null],scope:e.currentScope}),s=new qr.PendingWhile(i,e.lineRegistry);e.backpatches.push(s)}finalizeWhileStatement(){let e=this,n=e.backpatches.peek();if(!(0,qr.isPendingWhile)(n)){e.raise("no matching open while block",new an.Range(e.token.start,e.token.end));return}n.complete(e.previousToken),e.backpatches.pop(),e.backpatches.peek().body.push(n.block)}parseWhileShortcutStatement(e,n){let r=this,i=r.backpatches.peek(),s=r.parseShortcutStatement(),o=r.astProvider.whileStatement({condition:e,body:[s],start:n.start,end:r.previousToken.end,range:[n.range[0],r.previousToken.range[1]],scope:r.currentScope});r.lineRegistry.addItemToLines(o),i.body.push(o)}parseForStatement(){let e=this,n=e.currentScope,r=e.previousToken,i=e.parseIdentifier(En.ASTIdentifierKind.ForInVariable),s=e.astProvider.assignmentStatement({variable:i,init:e.astProvider.unknown({start:i.start,end:i.end,range:i.range,scope:n}),start:i.start,end:i.end,range:i.range,scope:n}),o=e.astProvider.assignmentStatement({variable:e.astProvider.identifier({kind:En.ASTIdentifierKind.ForInIdxVariable,name:`__${i.name}_idx`,start:i.start,end:i.end,range:i.range,scope:n}),init:e.astProvider.literal(bs.TokenType.NumericLiteral,{value:0,raw:"0",start:i.start,end:i.end,range:i.range,scope:n}),start:i.start,end:i.end,range:i.range,scope:n});n.assignments.push(s,o),e.requireToken(X.Selectors.In,r.start);let a=e.parseExpr(null);if(!a){e.raise("sequence expression expected for 'for' loop",new an.Range(r.start,e.token.end));return}if(!X.SelectorGroups.BlockEndOfLine(e.token))return e.parseForShortcutStatement(i,a,r);let u=e.astProvider.forGenericStatement({variable:i,iterator:a,start:r.start,end:e.previousToken.end,range:[r.range[0],e.previousToken.range[1]],scope:n}),c=new qr.PendingFor(u,e.lineRegistry);e.backpatches.push(c)}finalizeForStatement(){let e=this,n=e.backpatches.peek();if(!(0,qr.isPendingFor)(n)){e.raise("no matching open for block",new an.Range(e.token.start,e.token.end));return}n.complete(e.previousToken),e.backpatches.pop(),e.backpatches.peek().body.push(n.block)}parseForShortcutStatement(e,n,r){let i=this,s=i.backpatches.peek(),o=i.parseShortcutStatement(),a=i.astProvider.forGenericStatement({variable:e,iterator:n,body:[o],start:r.start,end:i.previousToken.end,range:[r.range[0],i.previousToken.range[1]],scope:i.currentScope});i.lineRegistry.addItemToLines(a),s.body.push(a)}parseExpr(e,n=!1,r=!1){return this.parseFunctionDeclaration(e,n,r)}parseFunctionDeclaration(e,n=!1,r=!1){let i=this;if(!X.Selectors.Function(i.token))return i.parseOr(n,r);i.next();let s=i.previousToken,o=i.astProvider.functionStatement({start:s.start,end:null,range:[s.range[0],null],scope:i.currentScope,parent:i.outerScopes[i.outerScopes.length-1],assignment:i.currentAssignment}),a=[];if(i.pushScope(o),!X.SelectorGroups.BlockEndOfLine(i.token)){for(i.requireToken(X.Selectors.LParenthesis,s.start);!X.SelectorGroups.FunctionDeclarationArgEnd(i.token);){let c=i.parseIdentifier(En.ASTIdentifierKind.Argument),l=c;if(i.consume(X.Selectors.Assign)){let h=i.parseExpr(null);if(h instanceof En.ASTLiteral){let d=i.astProvider.assignmentStatement({variable:c,init:h,start:l.start,end:i.previousToken.end,range:[l.range[0],i.previousToken.range[1]],scope:i.currentScope});i.currentScope.assignments.push(d),a.push(d)}else i.raise("parameter default value must be a literal value",new an.Range(l.start,i.token.end)),a.push(i.astProvider.invalidCodeExpression({start:l.start,end:i.previousToken.end,range:[l.range[0],i.previousToken.range[1]]}))}else{let h=i.astProvider.assignmentStatement({variable:c,init:i.astProvider.unknown({start:l.start,end:i.previousToken.end,range:[l.range[0],i.previousToken.range[1]],scope:i.currentScope}),start:l.start,end:i.previousToken.end,range:[l.range[0],i.previousToken.range[1]],scope:i.currentScope});i.currentScope.assignments.push(h),a.push(c)}if(X.Selectors.RParenthesis(i.token))break;if(i.requireToken(X.Selectors.ArgumentSeperator,s.start),X.Selectors.RParenthesis(i.token)){i.raise("expected argument instead received right parenthesis",new an.Range(i.previousToken.end,i.previousToken.end));break}}i.requireToken(X.Selectors.RParenthesis,s.start)}o.parameters=a;let u=new qr.PendingFunction(o,e,i.lineRegistry);return i.backpatches.push(u),o}finalizeFunction(){let e=this,n=e.backpatches.peek();if(!(0,qr.isPendingFunction)(n)){e.raise("no matching open function block",new an.Range(e.token.start,e.token.end));return}e.popScope(),n.complete(e.previousToken),e.backpatches.pop()}parseOr(e=!1,n=!1){let r=this,i=r.token,o=r.parseAnd(e,n);for(;X.Selectors.Or(r.token);){r.next(),r.skipNewlines();let a=r.parseAnd();o=r.astProvider.logicalExpression({operator:oi.Operator.Or,left:o,right:a,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseAnd(e=!1,n=!1){let r=this,i=r.token,o=r.parseNot(e,n);for(;X.Selectors.And(r.token);){r.next(),r.skipNewlines();let a=r.parseNot();o=r.astProvider.logicalExpression({operator:oi.Operator.And,left:o,right:a,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseNot(e=!1,n=!1){let r=this,i=r.token;if(X.Selectors.Not(r.token)){r.next(),r.skipNewlines();let s=r.parseIsa();return r.astProvider.unaryExpression({operator:oi.Operator.Not,argument:s,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return r.parseIsa(e,n)}parseIsa(e=!1,n=!1){let r=this,i=r.token,s=r.parseComparisons(e,n);if(X.Selectors.Isa(r.token)){r.next(),r.skipNewlines();let o=r.parseComparisons();return r.astProvider.isaExpression({operator:oi.Operator.Isa,left:s,right:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return s}parseComparisons(e=!1,n=!1){let r=this,i=r.token,s=r.parseAddSub(e,n);if(!X.SelectorGroups.ComparisonOperators(r.token))return s;let o=[s],a=[];do{let u=r.token;r.next(),r.skipNewlines();let c=r.parseAddSub();a.push(u.value),o.push(c)}while(X.SelectorGroups.ComparisonOperators(r.token));return a.length===1?r.astProvider.binaryExpression({operator:a[0],left:o[0],right:o[1],start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope}):r.astProvider.comparisonGroupExpression({operators:a,expressions:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}parseAddSub(e=!1,n=!1){let r=this,i=r.token,o=r.parseMultDiv(e,n);for(;X.Selectors.Plus(r.token)||X.Selectors.Minus(r.token)&&(!n||!r.token.afterSpace||r.lexer.isAtWhitespace());){let a=r.token;r.next(),r.skipNewlines();let u=r.parseMultDiv();o=r.astProvider.binaryExpression({operator:a.value,left:o,right:u,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseMultDiv(e=!1,n=!1){let r=this,i=r.token,o=r.parseUnaryMinus(e,n);for(;X.SelectorGroups.MultiDivOperators(r.token);){let a=r.token;r.next(),r.skipNewlines();let u=r.parseUnaryMinus();o=r.astProvider.binaryExpression({operator:a.value,left:o,right:u,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseUnaryMinus(e=!1,n=!1){let r=this;if(!X.Selectors.Minus(r.token))return r.parseNew(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parseNew();return s instanceof En.ASTNumericLiteral||s instanceof En.ASTBooleanLiteral?(s.negated=!0,s):r.astProvider.unaryExpression({operator:oi.Operator.Minus,argument:s,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}parseNew(e=!1,n=!1){let r=this;if(!X.Selectors.New(r.token))return r.parseAddressOf(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parseNew();return r.astProvider.unaryExpression({operator:oi.Operator.New,argument:s,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}parseAddressOf(e=!1,n=!1){let r=this;if(!X.Selectors.Reference(r.token))return r.parsePower(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parsePower();return r.astProvider.unaryExpression({operator:oi.Operator.Reference,argument:s,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}parsePower(e=!1,n=!1){let r=this,i=r.token,s=r.parseCallExpr(e,n);if(X.Selectors.Power(r.token)){r.next(),r.skipNewlines();let o=r.parseCallExpr();return r.astProvider.binaryExpression({operator:oi.Operator.Power,left:s,right:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return s}parseCallExpr(e=!1,n=!1){let r=this,i=r.token,s=r.parseMap(e,n);for(;!X.Selectors.EndOfFile(r.token);)if(X.Selectors.MemberSeperator(r.token)){r.next(),r.skipNewlines();let o=r.parseIdentifier(En.ASTIdentifierKind.Property),a=r.astProvider.memberExpression({base:s,indexer:oi.Operator.Member,identifier:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope});r.currentScope.namespaces.push(a),s=a}else if(X.Selectors.SLBracket(r.token)&&!r.token.afterSpace){if(r.next(),r.skipNewlines(),X.Selectors.SliceSeperator(r.token)){let o=r.astProvider.emptyExpression({start:r.previousToken.start,end:r.previousToken.end,range:r.previousToken.range,scope:r.currentScope});r.next(),r.skipNewlines();let a=X.Selectors.SRBracket(r.token)?r.astProvider.emptyExpression({start:r.previousToken.start,end:r.previousToken.end,range:r.previousToken.range,scope:r.currentScope}):r.parseExpr(null);s=r.astProvider.sliceExpression({base:s,left:o,right:a,start:i.start,end:r.token.end,range:[i.range[0],r.token.range[1]],scope:r.currentScope})}else{let o=r.parseExpr(null);if(X.Selectors.SliceSeperator(r.token)){r.next(),r.skipNewlines();let a=X.Selectors.SRBracket(r.token)?r.astProvider.emptyExpression({start:r.previousToken.start,end:r.previousToken.end,range:r.previousToken.range,scope:r.currentScope}):r.parseExpr(null);s=r.astProvider.sliceExpression({base:s,left:o,right:a,start:i.start,end:r.token.end,range:[i.range[0],r.token.range[1]],scope:r.currentScope})}else s=r.astProvider.indexExpression({base:s,index:o,start:i.start,end:r.token.end,range:[i.range[0],r.token.range[1]],scope:r.currentScope})}r.requireToken(X.Selectors.SRBracket,i.start)}else if(X.Selectors.LParenthesis(r.token)&&(!e||!r.token.afterSpace)){let o=r.parseCallArgs();s=r.astProvider.callExpression({base:s,arguments:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}else break;return s}parseCallArgs(){let e=this,n=[];if(X.Selectors.LParenthesis(e.token))if(e.next(),X.Selectors.RParenthesis(e.token))e.next();else for(;!X.Selectors.EndOfFile(e.token);){e.skipNewlines();let r=e.parseExpr(null);if(n.push(r),e.skipNewlines(),X.Selectors.RParenthesis(e.requireTokenOfAny(X.SelectorGroups.CallArgsEnd,r.start)))break}return n}parseMap(e=!1,n=!1){let r=this;if(!X.Selectors.CLBracket(r.token))return r.parseList(e,n);let i=r.currentScope,s=r.token,o=[],a=r.astProvider.mapConstructorExpression({fields:o,start:s.start,end:null,range:[s.range[0],null],scope:i});if(r.next(),X.Selectors.CRBracket(r.token))r.next();else for(r.skipNewlines();!X.Selectors.EndOfFile(r.token);){if(X.Selectors.CRBracket(r.token)){r.next();break}let u=r.astProvider.mapKeyString({key:null,value:null,start:r.token.start,end:null,range:[r.token.range[0],null],scope:i});if(u.key=r.parseExpr(null),r.requireToken(X.Selectors.MapKeyValueSeperator),r.skipNewlines(),u.value=r.parseExpr(u),u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),X.Selectors.MapSeperator(r.token)&&(r.next(),r.skipNewlines()),X.Selectors.CRBracket(r.token)){r.next();break}}return a.end=r.token.start,a.range[1]=r.token.range[1],a}parseList(e=!1,n=!1){let r=this;if(!X.Selectors.SLBracket(r.token))return r.parseQuantity(e,n);let i=r.currentScope,s=r.token,o=[],a=r.astProvider.listConstructorExpression({fields:o,start:s.start,end:null,range:[s.range[0],null],scope:i});if(r.next(),X.Selectors.SRBracket(r.token))r.next();else for(r.skipNewlines();!X.Selectors.EndOfFile(r.token);){if(X.Selectors.SRBracket(r.token)){r.next();break}let u=r.astProvider.listValue({value:null,start:r.token.start,end:null,range:[r.token.range[0],null],scope:i});if(u.value=r.parseExpr(u),u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),X.Selectors.MapSeperator(r.token)&&(r.next(),r.skipNewlines()),X.Selectors.SRBracket(r.token)){r.next();break}}return a.end=r.token.start,a.range[1]=r.token.range[1],a}parseQuantity(e=!1,n=!1){let r=this;if(!X.Selectors.LParenthesis(r.token))return r.parseAtom(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parseExpr(null);return r.requireToken(X.Selectors.RParenthesis,i.start),r.astProvider.parenthesisExpression({expression:s,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}parseAtom(e=!1,n=!1){let r=this;return r.validator.isLiteral(r.token.type)?r.parseLiteral():r.isType(bs.TokenType.Identifier)?r.parseIdentifier(En.ASTIdentifierKind.Variable):(r.raise(`got ${r.token} where number, string, or identifier is required`,new an.Range(r.token.start,r.token.end)),r.parseInvalidCode())}parseLiteral(){let e=this,n=e.token,r=e.token.type,i=e.astProvider.literal(r,{value:e.token.value,raw:e.token.raw,start:n.start,end:e.token.end,range:[n.range[0],e.token.range[1]],scope:e.currentScope});return e.literals.push(i),e.next(),i}parseIdentifier(e){let n=this,r=n.requireType(bs.TokenType.Identifier);if(r===null)return n.parseInvalidCode();let i=n.astProvider.identifier({kind:e,name:r.value,start:r.start,end:r.end,range:r.range,scope:n.currentScope});return e!==En.ASTIdentifierKind.Property&&n.currentScope.namespaces.push(i),i}parseInvalidCode(){let e=this,n=e.token,r=e.astProvider.invalidCodeExpression({start:n.start,end:n.end,range:n.range});return e.next(),r}raise(e,n){let r=this,i=new CM.ParserException(e,n);return r.statementErrors.push(i),i}};nu.default=Zy});var Te=m(Oe=>{"use strict";var PM=Oe&&Oe.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),vr=Oe&&Oe.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&PM(e,t,n)},Eh=Oe&&Oe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Oe,"__esModule",{value:!0});Oe.ASTRange=Oe.ASTPosition=Oe.LineRegistry=Oe.ParserValidatorm=Oe.Parser=Oe.LexerValidator=Oe.Lexer=void 0;var DM=Nm();Object.defineProperty(Oe,"Lexer",{enumerable:!0,get:function(){return Eh(DM).default}});vr(Mi(),Oe);var IM=km();Object.defineProperty(Oe,"LexerValidator",{enumerable:!0,get:function(){return Eh(IM).default}});var MM=rk();Object.defineProperty(Oe,"Parser",{enumerable:!0,get:function(){return Eh(MM).default}});vr(qy(),Oe);var LM=$y();Object.defineProperty(Oe,"ParserValidatorm",{enumerable:!0,get:function(){return Eh(LM).default}});var NM=Qy();Object.defineProperty(Oe,"LineRegistry",{enumerable:!0,get:function(){return NM.LineRegistry}});vr(Yy(),Oe);vr(Hy(),Oe);vr(Im(),Oe);vr(Yl(),Oe);vr(Jl(),Oe);vr(Eo(),Oe);vr(Om(),Oe);vr(ko(),Oe);var qM=Wa();Object.defineProperty(Oe,"ASTPosition",{enumerable:!0,get:function(){return qM.Position}});var jM=Xa();Object.defineProperty(Oe,"ASTRange",{enumerable:!0,get:function(){return jM.Range}});vr(Uy(),Oe)});var ru=m(xh=>{"use strict";Object.defineProperty(xh,"__esModule",{value:!0});xh.isValidIdentifierLiteral=void 0;var FM=Te(),$M=t=>{if(t.type!==FM.ASTType.StringLiteral)return!1;let e=t.value.toString();return/^[_a-z][_a-z0-9]*$/i.test(e)};xh.isValidIdentifierLiteral=$M});var eb=m(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.getStringHashCode=ji.getHashCode=ji.rotateBits=void 0;function BM(t){return t>>1|t<<31}ji.rotateBits=BM;function UM(t,e=0){let n=t>>>0;return n=(n>>16^n)*73244475,n=(n>>16^n)*73244475,n=n>>16^n,(e<<5)-e+n|0}ji.getHashCode=UM;ji.getStringHashCode=function(){let t=new Map,e=n=>{let r,i;for(r=0,i=0;r<n.length;r++)i=Math.imul(31,i)+n.charCodeAt(r)|0;return i};return n=>{if(n.length===0)return 0;let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i}}()});var ik=m(kh=>{"use strict";Object.defineProperty(kh,"__esModule",{value:!0});kh.createExpressionHash=void 0;var ze=Te(),vt=eb(),WM=ru(),Vt=(t,e)=>t.$$hash=e,HM=t=>t.$$hash??null;function st(t){let e=HM(t);if(e!==null)return e;let n=(0,vt.getStringHashCode)(t.type);switch(t.type){case ze.ASTType.BinaryExpression:{let r=t;return n^=(0,vt.getStringHashCode)(r.operator),n^=st(r.left),n^=st(r.right),Vt(t,n)}case ze.ASTType.LogicalExpression:{let r=t;return n^=(0,vt.getStringHashCode)(r.operator),n^=st(r.left),n^=st(r.right),Vt(t,n)}case ze.ASTType.IsaExpression:{let r=t;return n^=(0,vt.getStringHashCode)(r.operator),n^=st(r.left),n^=st(r.right),Vt(t,n)}case ze.ASTType.ComparisonGroupExpression:{let r=t;for(let i=0;i<r.expressions.length;i++)n^=st(r.expressions[i]);for(let i=0;i<r.operators.length;i++)n^=(0,vt.getStringHashCode)(r.operators[i]);return Vt(t,n)}case ze.ASTType.FunctionDeclaration:{let r=t;n^=(0,vt.getHashCode)(r.parameters.length);for(let i=0;i<r.parameters.length;i++){let s=r.parameters[i];if(s.type===ze.ASTType.Identifier){n^=(0,vt.getStringHashCode)(s.name);continue}let o=s;n^=(0,vt.getStringHashCode)(o.variable.name),n^=st(o.init)}return Vt(t,n)}case ze.ASTType.ParenthesisExpression:return st(t.expression);case ze.ASTType.MemberExpression:{let r=t;if(r.base.type===ze.ASTType.Identifier){let i=r.base.name;if(i==="globals"||i==="locals"||i==="outer")return n=(0,vt.getStringHashCode)(ze.ASTType.Identifier),n^=(0,vt.getStringHashCode)(r.identifier.name),Vt(t,n)}return n^=st(r.base),n^=st(r.identifier),Vt(t,n)}case ze.ASTType.IndexExpression:{let r=t;if((0,WM.isValidIdentifierLiteral)(r.index)){if(r.base.type===ze.ASTType.Identifier){let s=r.base.name;if(s==="globals"||s==="locals"||s==="outer")return n=(0,vt.getStringHashCode)(ze.ASTType.Identifier),n^=(0,vt.getStringHashCode)(r.index.value.toString()),Vt(t,n)}n=(0,vt.getStringHashCode)(ze.ASTType.MemberExpression),n^=st(r.base);let i=(0,vt.getStringHashCode)(ze.ASTType.Identifier);i^=(0,vt.getStringHashCode)(r.index.value.toString()),n^=i}else n^=st(r.base),n^=st(r.index);return Vt(t,n)}case ze.ASTType.CallExpression:{let r=t;n^=st(r.base),n^=(0,vt.getHashCode)(r.arguments.length);for(let i=0;i<r.arguments.length;i++){let s=r.arguments[i];n^=st(s)}return Vt(t,n)}case ze.ASTType.NegationExpression:case ze.ASTType.BinaryNegatedExpression:case ze.ASTType.UnaryExpression:{let r=t;return n^=r.operator?(0,vt.getStringHashCode)(r.operator):1,n^=st(r.argument),Vt(t,n)}case ze.ASTType.Identifier:{let r=t;return n^=(0,vt.getStringHashCode)(r.name),Vt(t,n)}case ze.ASTType.BooleanLiteral:case ze.ASTType.NumericLiteral:case ze.ASTType.StringLiteral:case ze.ASTType.NilLiteral:return n^=(0,vt.getStringHashCode)(t.value.toString()),Vt(t,n);case ze.ASTType.MapConstructorExpression:{let r=t;n^=(0,vt.getHashCode)(r.fields.length);for(let i=0;i<r.fields.length;i++){let s=r.fields[i];n^=st(s.key),n^=st(s.value)}return Vt(t,n)}case ze.ASTType.ListConstructorExpression:{let r=t;n^=(0,vt.getHashCode)(r.fields.length);for(let i=0;i<r.fields.length;i++){let s=r.fields[i];n^=st(s.value)}return Vt(t,n)}case ze.ASTType.SliceExpression:{let r=t;return n^=st(r.base),n^=st(r.left),n^=st(r.right),Vt(t,n)}}return Vt(t,n)}function GM(t){return st(t)}kh.createExpressionHash=GM});var tb=m(Ah=>{"use strict";Object.defineProperty(Ah,"__esModule",{value:!0});Ah.createExpressionId=void 0;var St=Te(),zM=ru(),Ot=(t,e)=>t.$$id=e,KM=t=>t.$$id??null;function Qe(t){let e=KM(t);if(e!==null)return e;switch(t.type){case St.ASTType.BinaryExpression:{let n=t;return Ot(t,Qe(n.left)+n.operator+Qe(n.right))}case St.ASTType.LogicalExpression:{let n=t;return Ot(t,Qe(n.left)+n.operator+Qe(n.right))}case St.ASTType.IsaExpression:{let n=t;return Ot(t,Qe(n.left)+n.operator+Qe(n.right))}case St.ASTType.ComparisonGroupExpression:{let n=t,r=n.expressions.map(s=>Qe(s)),i=[r[0]];for(let s=0;s<n.operators.length;s++)i.push(n.operators[s],r[s+1]);return Ot(t,i.join(" "))}case St.ASTType.FunctionDeclaration:{let n=t,r="function",i=[];for(let s=0;s<n.parameters.length;s++){let o=n.parameters[s];if(o.type===St.ASTType.Identifier){i.push(o.name);continue}let a=o;i.push(a.variable.name+"="+Qe(a.init))}return i.length>0&&(r+="("+i.join(",")+")"),Ot(t,r)}case St.ASTType.ParenthesisExpression:return Ot(t,Qe(t.expression));case St.ASTType.MemberExpression:{let n=t;return Ot(t,Qe(n.base)+"."+n.identifier.name)}case St.ASTType.IndexExpression:{let n=t;return(0,zM.isValidIdentifierLiteral)(n.index)?Ot(t,Qe(n.base)+"."+n.index.value.toString()):Ot(t,Qe(n.base)+"["+Qe(n.index)+"]")}case St.ASTType.CallExpression:{let n=t,r=Qe(n.base),i=[];for(let s=0;s<n.arguments.length;s++){let o=n.arguments[s];i.push(Qe(o))}return i.length>0&&(r+="("+i.join(",")+")"),Ot(t,r)}case St.ASTType.NegationExpression:case St.ASTType.BinaryNegatedExpression:case St.ASTType.UnaryExpression:{let n=t;return n.operator==null?Ot(t,Qe(n.argument)):n.operator==="@"?Ot(t,n.operator+Qe(n.argument)):Ot(t,n.operator+" "+Qe(n.argument))}case St.ASTType.Identifier:return Ot(t,t.name);case St.ASTType.NumericLiteral:case St.ASTType.BooleanLiteral:case St.ASTType.StringLiteral:case St.ASTType.NilLiteral:return Ot(t,t.raw.toString());case St.ASTType.MapConstructorExpression:{let n=t,r=[];for(let i=0;i<n.fields.length;i++){let s=n.fields[i];r.push(Qe(s.key)+":"+Qe(s.value))}return Ot(t,"{"+r.join(",")+"}")}case St.ASTType.ListConstructorExpression:{let n=t,r=[];for(let i=0;i<n.fields.length;i++){let s=n.fields[i];r.push(Qe(s.value))}return Ot(t,"["+r.join(",")+"]")}case St.ASTType.SliceExpression:{let n=t;return Ot(t,Qe(n.base)+"["+Qe(n.left)+":"+Qe(n.right)+"]")}}return Ot(t,"")}function VM(t){return Qe(t)}Ah.createExpressionId=VM});var Do=m(iu=>{"use strict";Object.defineProperty(iu,"__esModule",{value:!0});iu.Markers=void 0;var XM;(function(t){t.start="/**",t.nostart="/***",t.delim="*",t.end="*/"})(XM=iu.Markers||(iu.Markers={}))});var Sr=m(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.rewireSpecs=pt.rewireSource=pt.seedTokens=pt.seedSpec=pt.seedBlock=pt.splitLines=pt.splitSpace=pt.splitCR=pt.hasCR=pt.isSpace=void 0;function YM(t){return/^\s+$/.test(t)}pt.isSpace=YM;function JM(t){return/\r$/.test(t)}pt.hasCR=JM;function QM(t){let e=t.match(/\r+$/);return e==null?["",t]:[t.slice(-e[0].length),t.slice(0,-e[0].length)]}pt.splitCR=QM;function ZM(t){let e=t.match(/^\s+/);return e==null?["",t]:[t.slice(0,e[0].length),t.slice(e[0].length)]}pt.splitSpace=ZM;function eL(t){return t.split(/\n/)}pt.splitLines=eL;function tL(t={}){return Object.assign({description:"",tags:[],source:[],problems:[]},t)}pt.seedBlock=tL;function nL(t={}){return Object.assign({tag:"",name:"",type:"",optional:!1,description:"",problems:[],source:[]},t)}pt.seedSpec=nL;function rL(t={}){return Object.assign({start:"",delimiter:"",postDelimiter:"",tag:"",postTag:"",name:"",postName:"",type:"",postType:"",description:"",end:"",lineEnd:""},t)}pt.seedTokens=rL;function iL(t){let e=t.source.reduce((n,r)=>n.set(r.number,r),new Map);for(let n of t.tags)n.source=n.source.map(r=>e.get(r.number));return t}pt.rewireSource=iL;function sL(t){let e=t.tags.reduce((n,r)=>r.source.reduce((i,s)=>i.set(s.number,s),n),new Map);return t.source=t.source.map(n=>e.get(n.number)||n),t}pt.rewireSpecs=sL});var sk=m(nb=>{"use strict";Object.defineProperty(nb,"__esModule",{value:!0});var oL=/^@\S+/;function aL({fence:t="```"}={}){let e=uL(t),n=(r,i)=>e(r)?!i:i;return function(i){let s=[[]],o=!1;for(let a of i)oL.test(a.tokens.description)&&!o?s.push([a]):s[s.length-1].push(a),o=n(a.tokens.description,o);return s}}nb.default=aL;function uL(t){return typeof t=="string"?e=>e.split(t).length%2===0:t}});var ok=m(rb=>{"use strict";Object.defineProperty(rb,"__esModule",{value:!0});var cL=Do(),su=Sr();function lL({startLine:t=0,markers:e=cL.Markers}={}){let n=null,r=t;return function(s){let o=s,a=(0,su.seedTokens)();if([a.lineEnd,o]=(0,su.splitCR)(o),[a.start,o]=(0,su.splitSpace)(o),n===null&&o.startsWith(e.start)&&!o.startsWith(e.nostart)&&(n=[],a.delimiter=o.slice(0,e.start.length),o=o.slice(e.start.length),[a.postDelimiter,o]=(0,su.splitSpace)(o)),n===null)return r++,null;let u=o.trimRight().endsWith(e.end);if(a.delimiter===""&&o.startsWith(e.delim)&&!o.startsWith(e.end)&&(a.delimiter=e.delim,o=o.slice(e.delim.length),[a.postDelimiter,o]=(0,su.splitSpace)(o)),u){let c=o.trimRight();a.end=o.slice(c.length-e.end.length),o=c.slice(0,-e.end.length)}if(a.description=o,n.push({number:r,source:s,tokens:a}),r++,u){let c=n.slice();return n=null,c}return null}}rb.default=lL});var ak=m(ib=>{"use strict";Object.defineProperty(ib,"__esModule",{value:!0});var hL=Sr();function dL({tokenizers:t}){return function(n){var r;let i=(0,hL.seedSpec)({source:n});for(let s of t)if(i=s(i),!((r=i.problems[i.problems.length-1])===null||r===void 0)&&r.critical)break;return i}}ib.default=dL});var ob=m(sb=>{"use strict";Object.defineProperty(sb,"__esModule",{value:!0});function fL(){return t=>{let{tokens:e}=t.source[0],n=e.description.match(/\s*(@(\S+))(\s*)/);return n===null?(t.problems.push({code:"spec:tag:prefix",message:'tag should start with "@" symbol',line:t.source[0].number,critical:!0}),t):(e.tag=n[1],e.postTag=n[3],e.description=e.description.slice(n[0].length),t.tag=n[2],t)}}sb.default=fL});var ub=m(ab=>{"use strict";Object.defineProperty(ab,"__esModule",{value:!0});var pL=Sr();function gL(t="compact"){let e=yL(t);return n=>{let r=0,i=[];for(let[a,{tokens:u}]of n.source.entries()){let c="";if(a===0&&u.description[0]!=="{")return n;for(let l of u.description)if(l==="{"&&r++,l==="}"&&r--,c+=l,r===0)break;if(i.push([u,c]),r===0)break}if(r!==0)return n.problems.push({code:"spec:type:unpaired-curlies",message:"unpaired curlies",line:n.source[0].number,critical:!0}),n;let s=[],o=i[0][0].postDelimiter.length;for(let[a,[u,c]]of i.entries())u.type=c,a>0&&(u.type=u.postDelimiter.slice(o)+c,u.postDelimiter=u.postDelimiter.slice(0,o)),[u.postType,u.description]=(0,pL.splitSpace)(u.description.slice(c.length)),s.push(u.type);return s[0]=s[0].slice(1),s[s.length-1]=s[s.length-1].slice(0,-1),n.type=e(s),n}}ab.default=gL;var mL=t=>t.trim();function yL(t){return t==="compact"?e=>e.map(mL).join(""):t==="preserve"?e=>e.join(`
97
- `):t}});var hb=m(lb=>{"use strict";Object.defineProperty(lb,"__esModule",{value:!0});var cb=Sr(),bL=t=>t&&t.startsWith('"')&&t.endsWith('"');function _L(){let t=(e,{tokens:n},r)=>n.type===""?e:r;return e=>{let{tokens:n}=e.source[e.source.reduce(t,0)],r=n.description.trimLeft(),i=r.split('"');if(i.length>1&&i[0]===""&&i.length%2===1)return e.name=i[1],n.name=`"${i[1]}"`,[n.postName,n.description]=(0,cb.splitSpace)(r.slice(n.name.length)),e;let s=0,o="",a=!1,u;for(let l of r){if(s===0&&(0,cb.isSpace)(l))break;l==="["&&s++,l==="]"&&s--,o+=l}if(s!==0)return e.problems.push({code:"spec:name:unpaired-brackets",message:"unpaired brackets",line:e.source[0].number,critical:!0}),e;let c=o;if(o[0]==="["&&o[o.length-1]==="]"){a=!0,o=o.slice(1,-1);let l=o.split("=");if(o=l[0].trim(),l[1]!==void 0&&(u=l.slice(1).join("=").trim()),o==="")return e.problems.push({code:"spec:name:empty-name",message:"empty name",line:e.source[0].number,critical:!0}),e;if(u==="")return e.problems.push({code:"spec:name:empty-default",message:"empty default value",line:e.source[0].number,critical:!0}),e;if(!bL(u)&&/=(?!>)/.test(u))return e.problems.push({code:"spec:name:invalid-default",message:"invalid default value syntax",line:e.source[0].number,critical:!0}),e}return e.optional=a,e.name=o,n.name=c,u!==void 0&&(e.default=u),[n.postName,n.description]=(0,cb.splitSpace)(r.slice(n.name.length)),e}}lb.default=_L});var fb=m(ou=>{"use strict";Object.defineProperty(ou,"__esModule",{value:!0});ou.getJoiner=void 0;var db=Do();function vL(t="compact",e=db.Markers){let n=uk(t);return r=>(r.description=n(r.source,e),r)}ou.default=vL;function uk(t){return t==="compact"?SL:t==="preserve"?EL:t}ou.getJoiner=uk;function SL(t,e=db.Markers){return t.map(({tokens:{description:n}})=>n.trim()).filter(n=>n!=="").join(" ")}var wL=(t,{tokens:e},n)=>e.type===""?t:n,TL=({tokens:t})=>(t.delimiter===""?t.start:t.postDelimiter.slice(1))+t.description;function EL(t,e=db.Markers){if(t.length===0)return"";t[0].tokens.description===""&&t[0].tokens.delimiter===e.start&&(t=t.slice(1));let n=t[t.length-1];return n!==void 0&&n.tokens.description===""&&n.tokens.end.endsWith(e.end)&&(t=t.slice(0,-1)),t=t.slice(t.reduce(wL,0)),t.map(TL).join(`
98
- `)}});var lk=m(pb=>{"use strict";Object.defineProperty(pb,"__esModule",{value:!0});var xL=Do(),kL=Sr(),AL=sk(),CL=ok(),OL=ak(),RL=ob(),PL=ub(),DL=hb(),ck=fb();function IL({startLine:t=0,fence:e="```",spacing:n="compact",markers:r=xL.Markers,tokenizers:i=[(0,RL.default)(),(0,PL.default)(n),(0,DL.default)(),(0,ck.default)(n)]}={}){if(t<0||t%1>0)throw new Error("Invalid startLine");let s=(0,CL.default)({startLine:t,markers:r}),o=(0,AL.default)({fence:e}),a=(0,OL.default)({tokenizers:i}),u=(0,ck.getJoiner)(n);return function(c){let l=[];for(let h of(0,kL.splitLines)(c)){let d=s(h);if(d===null)continue;let g=o(d),y=g.slice(1).map(a);l.push({description:u(g[0],r),tags:y,source:d,problems:y.reduce((_,C)=>_.concat(C.problems),[])})}return l}}pb.default=IL});var hk=m(gb=>{"use strict";Object.defineProperty(gb,"__esModule",{value:!0});function ML(t){return t.start+t.delimiter+t.postDelimiter+t.tag+t.postTag+t.type+t.postType+t.name+t.postName+t.description+t.end+t.lineEnd}function LL(){return t=>t.source.map(({tokens:e})=>ML(e)).join(`
99
- `)}gb.default=LL});var fk=m(au=>{"use strict";var NL=au&&au.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};Object.defineProperty(au,"__esModule",{value:!0});var dk=Do(),qL=Sr(),jL={start:0,tag:0,type:0,name:0},FL=(t=dk.Markers)=>(e,{tokens:n})=>({start:n.delimiter===t.start?n.start.length:e.start,tag:Math.max(e.tag,n.tag.length),type:Math.max(e.type,n.type.length),name:Math.max(e.name,n.name.length)}),_s=t=>"".padStart(t," ");function $L(t=dk.Markers){let e=!1,n;function r(i){let s=Object.assign({},i.tokens);s.tag!==""&&(e=!0);let o=s.tag===""&&s.name===""&&s.type===""&&s.description==="";if(s.end===t.end&&o)return s.start=_s(n.start+1),Object.assign(Object.assign({},i),{tokens:s});switch(s.delimiter){case t.start:s.start=_s(n.start);break;case t.delim:s.start=_s(n.start+1);break;default:s.delimiter="",s.start=_s(n.start+2)}if(!e)return s.postDelimiter=s.description===""?"":" ",Object.assign(Object.assign({},i),{tokens:s});let a={delim:!1,tag:!1,type:!1,name:!1};return s.description===""&&(a.name=!0,s.postName="",s.name===""&&(a.type=!0,s.postType="",s.type===""&&(a.tag=!0,s.postTag="",s.tag===""&&(a.delim=!0)))),s.postDelimiter=a.delim?"":" ",a.tag||(s.postTag=_s(n.tag-s.tag.length+1)),a.type||(s.postType=_s(n.type-s.type.length+1)),a.name||(s.postName=_s(n.name-s.name.length+1)),Object.assign(Object.assign({},i),{tokens:s})}return i=>{var{source:s}=i,o=NL(i,["source"]);return n=s.reduce(FL(t),Object.assign({},jL)),(0,qL.rewireSource)(Object.assign(Object.assign({},o),{source:s.map(r)}))}}au.default=$L});var pk=m(uu=>{"use strict";var BL=uu&&uu.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};Object.defineProperty(uu,"__esModule",{value:!0});var UL=Sr(),WL=t=>e=>e.slice(t),HL=t=>{let e="".padStart(t," ");return n=>n+e};function GL(t){let e,n=i=>{if(e===void 0){let s=t-i.length;e=s>0?HL(s):WL(-s)}return e(i)},r=i=>Object.assign(Object.assign({},i),{tokens:Object.assign(Object.assign({},i.tokens),{start:n(i.tokens.start)})});return i=>{var{source:s}=i,o=BL(i,["source"]);return(0,UL.rewireSource)(Object.assign(Object.assign({},o),{source:s.map(r)}))}}uu.default=GL});var gk=m(cu=>{"use strict";var zL=cu&&cu.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};Object.defineProperty(cu,"__esModule",{value:!0});var KL=Sr();function VL(t){function e(n){return Object.assign(Object.assign({},n),{tokens:Object.assign(Object.assign({},n.tokens),{lineEnd:t==="LF"?"":"\r"})})}return n=>{var{source:r}=n,i=zL(n,["source"]);return(0,KL.rewireSource)(Object.assign(Object.assign({},i),{source:r.map(e)}))}}cu.default=VL});var mk=m(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});Ch.flow=void 0;function XL(...t){return e=>t.reduce((n,r)=>r(n),e)}Ch.flow=XL});var vk=m(yb=>{"use strict";Object.defineProperty(yb,"__esModule",{value:!0});var YL=Sr(),bk={line:0,start:0,delimiter:0,postDelimiter:0,tag:0,postTag:0,name:0,postName:0,type:0,postType:0,description:0,end:0,lineEnd:0},yk={lineEnd:"CR"},mb=Object.keys(bk),_k=t=>(0,YL.isSpace)(t)?`{${t.length}}`:t,JL=t=>"|"+t.join("|")+"|",QL=(t,e)=>Object.keys(e).map(n=>_k(e[n]).padEnd(t[n]));function ZL({source:t}){var e,n;if(t.length===0)return"";let r=Object.assign({},bk);for(let s of mb)r[s]=((e=yk[s])!==null&&e!==void 0?e:s).length;for(let{number:s,tokens:o}of t){r.line=Math.max(r.line,s.toString().length);for(let a in o)r[a]=Math.max(r[a],_k(o[a]).length)}let i=[[],[]];for(let s of mb)i[0].push(((n=yk[s])!==null&&n!==void 0?n:s).padEnd(r[s]));for(let s of mb)i[1].push("-".padEnd(r[s],"-"));for(let{number:s,tokens:o}of t){let a=s.toString().padStart(r.line);i.push([a,...QL(r,o)])}return i.map(JL).join(`
100
- `)}yb.default=ZL});var bb=m(Rt=>{"use strict";var eN=Rt&&Rt.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),tN=Rt&&Rt.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&eN(e,t,n)};Object.defineProperty(Rt,"__esModule",{value:!0});Rt.util=Rt.tokenizers=Rt.transforms=Rt.inspect=Rt.stringify=Rt.parse=void 0;var nN=lk(),rN=fb(),iN=hb(),sN=ob(),oN=ub(),aN=hk(),uN=fk(),cN=pk(),lN=gk(),hN=mk(),Oh=Sr();tN(Do(),Rt);function dN(t,e={}){return(0,nN.default)(e)(t)}Rt.parse=dN;Rt.stringify=(0,aN.default)();var fN=vk();Object.defineProperty(Rt,"inspect",{enumerable:!0,get:function(){return fN.default}});Rt.transforms={flow:hN.flow,align:uN.default,indent:cN.default,crlf:lN.default};Rt.tokenizers={tag:sN.default,type:oN.default,name:iN.default,description:rN.default};Rt.util={rewireSpecs:Oh.rewireSpecs,rewireSource:Oh.rewireSource,seedBlock:Oh.seedBlock,seedTokens:Oh.seedTokens}});var vs=m(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.SignatureDefinitionBaseType=void 0;var pN;(function(t){t.Function="function",t.Number="number",t.String="string",t.Map="map",t.List="list",t.Any="any",t.General="general"})(pN=lu.SignatureDefinitionBaseType||(lu.SignatureDefinitionBaseType={}))});var hu=m(Io=>{"use strict";var Sk=Io&&Io.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s};Object.defineProperty(Io,"__esModule",{value:!0});Io.SignatureDefinitionTypeMeta=void 0;var un=vs(),gN=function(){function t(e){var n,r;this.type=e.type,this.keyType=(n=e.keyType)!==null&&n!==void 0?n:null,this.valueType=(r=e.valueType)!==null&&r!==void 0?r:null}return t.fromString=function(e){var n=e.match(/^([a-zA-Z]+)(?:<([^>]+)>)?$/);if(!n)return null;var r=null,i=null,s=Sk(n,3),o=s[0],a=s[1],u=s[2];if(a===un.SignatureDefinitionBaseType.Map?(r=un.SignatureDefinitionBaseType.Any,i=un.SignatureDefinitionBaseType.Any):a===un.SignatureDefinitionBaseType.List&&(r=un.SignatureDefinitionBaseType.Any),u){var c=u.split(",").map(function(g){return g.trim()});if(c.length>2)return null;var l=Sk(c,2),h=l[0],d=l[1];d!=null?(r=d,i=h):r=h}return new t({type:a,keyType:i,valueType:r})},t.parse=function(e){var n,r;if(typeof e=="string"){var i=e,s=null,o=null;return i===un.SignatureDefinitionBaseType.Map?(s=un.SignatureDefinitionBaseType.Any,o=un.SignatureDefinitionBaseType.Any):i===un.SignatureDefinitionBaseType.List&&(s=un.SignatureDefinitionBaseType.Any),new t({type:i,valueType:s,keyType:o})}else if(typeof e=="object"){var i=e.type,s=(n=e.valueType)!==null&&n!==void 0?n:null,o=(r=e.keyType)!==null&&r!==void 0?r:null;return i===un.SignatureDefinitionBaseType.Map?(s=s??un.SignatureDefinitionBaseType.Any,o=o??un.SignatureDefinitionBaseType.Any):i===un.SignatureDefinitionBaseType.List&&(s=s??un.SignatureDefinitionBaseType.Any),new t({type:i,valueType:s,keyType:o})}throw new Error("Unable to parse type definition!")},t.prototype.isEqual=function(e){return this.type===e.type},t.prototype.isEqualSafe=function(e){return this.type===e.type&&this.keyType===e.keyType&&this.valueType===e.valueType},t.prototype.toString=function(){return this.keyType===null?this.valueType===null?this.type:"".concat(this.type,"<").concat(this.valueType,">"):"".concat(this.type,"<").concat(this.keyType,",").concat(this.valueType,">")},t.prototype.toJSON=function(){return this.keyType===null?this.valueType===null?this.type:{type:this.type,valueType:this.valueType}:{type:this.type,keyType:this.keyType,valueType:this.valueType}},t.prototype.copy=function(){return new t({type:this.type,keyType:this.keyType,valueType:this.valueType})},t}();Io.SignatureDefinitionTypeMeta=gN});var _b=m(Fi=>{"use strict";var wk=Fi&&Fi.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},Tk=Fi&&Fi.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))};Object.defineProperty(Fi,"__esModule",{value:!0});Fi.SignatureDefinitionFunctionArg=void 0;var Ek=hu(),mN=function(){function t(e){this._label=e.label,this._types=e.types.reduce(function(n,r){return n.set(r.type,r)},new Map),this._opt=e.opt,this._default=e.default}return t.parse=function(e){var n,r,i=[];if(e.type)i.push(Ek.SignatureDefinitionTypeMeta.parse(e.type));else if(e.types)i.push.apply(i,Tk([],wk(e.types.map(Ek.SignatureDefinitionTypeMeta.parse)),!1));else throw new Error("Invalid signature definition function arg payload!");return new t({label:e.label,types:i,opt:(n=e.opt)!==null&&n!==void 0?n:!1,default:(r=e.default)!==null&&r!==void 0?r:null})},t.prototype.getLabel=function(){return this._label},t.prototype.isOptional=function(){return this._opt},t.prototype.getDefault=function(){return this._default},t.prototype.getTypes=function(){return Tk([],wk(this._types.values()),!1)},t.prototype.isValidType=function(e){return this._types.has(e.type)},t.prototype.isValidTypeSafe=function(e){var n;return!!(!((n=this._types.get(e.type))===null||n===void 0)&&n.isEqualSafe(e))},t.prototype.toJSON=function(){return{label:this._label,types:this.getTypes().map(function(e){return e.toJSON()}),opt:this._opt,default:this._default}},t.prototype.copy=function(){return new t({label:this._label,types:this.getTypes().map(function(e){return e.copy()}),opt:this._opt,default:this._default})},t}();Fi.SignatureDefinitionFunctionArg=mN});var Rh=m(jr=>{"use strict";var Ss=jr&&jr.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},ws=jr&&jr.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))},yN=jr&&jr.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(jr,"__esModule",{value:!0});jr.VariationRegistry=void 0;var bN=function(){function t(e){this._name=e,this._variations=new Set}return t.prototype.getName=function(){return this._name},t.prototype.push=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return this._variations=new Set(ws(ws([],Ss(e),!1),Ss(this._variations),!1)),this},t.prototype.getAll=function(){return ws([],Ss(this._variations),!1)},t}(),_N=function(){function t(){}return t.add=function(e,n){var r=new bN(e);return r.push.apply(r,ws([],Ss(n),!1)),this.variationContainers.set(e,r),this},t.get=function(e){var n;return(n=this.variationContainers.get(e))!==null&&n!==void 0?n:null},t.resolve=function(e){var n,r,i=new Set;try{for(var s=yN(e),o=s.next();!o.done;o=s.next()){var a=o.value;if(typeof a=="string"&&a.startsWith("!")){var u=a.slice(1),c=this.get(u);if(c!==null)i=new Set(ws(ws([],Ss(c.getAll()),!1),Ss(i),!1));else throw new Error("Cannot find variation container for ".concat(u));continue}i.add(a)}}catch(l){n={error:l}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return ws([],Ss(i),!1)},t.variationContainers=new Map,t}();jr.VariationRegistry=_N});var Ph=m($i=>{"use strict";var vN=$i&&$i.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},SN=$i&&$i.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))};Object.defineProperty($i,"__esModule",{value:!0});$i.SignatureDefinition=void 0;var wN=Rh(),TN=hu(),EN=function(){function t(e){this._type=e.type,this._isProtected=e.isProtected,this._description=e.description,this._example=e.example,this._variations=e.variations}return t.parse=function(e){var n,r,i;return new t({type:TN.SignatureDefinitionTypeMeta.parse(e.type),isProtected:!!e.isProtected,description:(n=e.description)!==null&&n!==void 0?n:null,example:(r=e.example)!==null&&r!==void 0?r:null,variations:(i=e.variations)!==null&&i!==void 0?i:null})},t.prototype.getType=function(){return this._type},t.prototype.isProtected=function(){return this._isProtected},t.prototype.getDescription=function(){return this._description},t.prototype.getExample=function(){return this._example},t.prototype.setDescription=function(e){var n;return this._description=e.description,this._example=(n=e.example)!==null&&n!==void 0?n:null,this},t.prototype.addVariation=function(e){return this._variations==null&&(this._variations=[]),this._variations.push(e),this},t.prototype.getVariations=function(){return wN.VariationRegistry.resolve(this._variations)},t.prototype.toJSON=function(){return{type:this._type.toJSON(),isProtected:this._isProtected,description:this._description,example:this._example?SN([],vN(this._example),!1):null}},t.prototype.withDescription=function(e){var n,r;return new t({type:this._type,isProtected:this._isProtected,description:(n=e?.description)!==null&&n!==void 0?n:this._description,example:(r=e?.example)!==null&&r!==void 0?r:this._example,variations:this._variations})},t.prototype.copy=function(){return new t({type:this._type.copy(),isProtected:this._isProtected,description:this._description,example:this._example,variations:this._variations})},t}();$i.SignatureDefinition=EN});var vb=m(Vn=>{"use strict";var xN=Vn&&Vn.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=i[s])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Dh=Vn&&Vn.__assign||function(){return Dh=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Dh.apply(this,arguments)},kN=Vn&&Vn.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},AN=Vn&&Vn.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))};Object.defineProperty(Vn,"__esModule",{value:!0});Vn.SignatureDefinitionFunction=void 0;var CN=vs(),ON=Rh(),RN=Ph(),PN=_b(),xk=hu(),DN=function(t){xN(e,t);function e(n){var r=t.call(this,{type:n.type,isProtected:n.isProtected,description:n.description,example:n.example,variations:n.variations})||this;return r._argList=n.arguments.map(function(i){return i.getLabel()}),r._argRefs=n.arguments.reduce(function(i,s){return i.set(s.getLabel(),s)},new Map),r._returns=n.returns.reduce(function(i,s){return i.set(s.type,s)},new Map),r._returnVariations=n.returnVariations,r}return e.parse=function(n){var r,i,s,o,a,u;return new e({type:new xk.SignatureDefinitionTypeMeta({type:CN.SignatureDefinitionBaseType.Function}),isProtected:(r=n.isProtected)!==null&&r!==void 0?r:!1,description:(i=n.description)!==null&&i!==void 0?i:null,example:(s=n.example)!==null&&s!==void 0?s:null,arguments:(a=(o=n.arguments)===null||o===void 0?void 0:o.map(PN.SignatureDefinitionFunctionArg.parse))!==null&&a!==void 0?a:[],returns:n.returns.map(xk.SignatureDefinitionTypeMeta.parse),variations:n.variations,returnVariations:(u=n.returnVariations)!==null&&u!==void 0?u:null})},e.prototype.getArguments=function(){var n=this;return this._argList.map(function(r){return n._argRefs.get(r)})},e.prototype.getArgument=function(n){var r;return(r=this._argRefs.get(n))!==null&&r!==void 0?r:null},e.prototype.getReturns=function(){return AN([],kN(this._returns.values()),!1)},e.prototype.addReturnVariation=function(n){return this._returnVariations==null&&(this._returnVariations=[]),this._returnVariations.push(n),this},e.prototype.getReturnVariations=function(){return this._returnVariations==null&&(this._returnVariations=[]),ON.VariationRegistry.resolve(this._returnVariations)},e.prototype.toJSON=function(){return Dh(Dh({},t.prototype.toJSON.call(this)),{arguments:this.getArguments().map(function(n){return n.toJSON()}),returns:this.getReturns().map(function(n){return n.toJSON()})})},e.prototype.withDescription=function(n){var r,i;return new e({type:this._type,isProtected:this._isProtected,arguments:this.getArguments(),returns:this.getReturns(),description:(r=n?.description)!==null&&r!==void 0?r:this._description,example:(i=n?.example)!==null&&i!==void 0?i:this._example,variations:this._variations,returnVariations:this._returnVariations})},e.prototype.copy=function(){return new e({type:this._type.copy(),isProtected:this._isProtected,arguments:this.getArguments().map(function(n){return n.copy()}),returns:this.getReturns().map(function(n){return n.copy()}),description:this._description,example:this._example,variations:this._variations,returnVariations:this._returnVariations})},e}(RN.SignatureDefinition);Vn.SignatureDefinitionFunction=DN});var Ak=m((Q3,kk)=>{"use strict";kk.exports=function(...t){try{return JSON.stringify(...t)}catch(e){return"[Cannot display object: "+e.message+"]"}}});var Sb=m((Ck,Ok)=>{"use strict";var IN=Ak();Ok.exports=class extends Error{constructor(t){let e=t.filter(n=>n!=="").map(n=>typeof n=="string"?n:n instanceof Error?n.message:IN(n));super(e.join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Ck.assert)}}});var Me=m((e4,Rk)=>{"use strict";var MN=Sb();Rk.exports=function(t,...e){if(!t)throw e.length===1&&e[0]instanceof Error?e[0]:new MN(e)}});var Ts=m((t4,Dk)=>{"use strict";var wb=Me(),Pk={};Dk.exports=function(t,e,n){if(e===!1||e===null||e===void 0)return t;n=n||{},typeof n=="string"&&(n={separator:n});let r=Array.isArray(e);wb(!r||!n.separator,"Separator option is not valid for array-based chain");let i=r?e:e.split(n.separator||"."),s=t;for(let o=0;o<i.length;++o){let a=i[o],u=n.iterables&&Pk.iterables(s);if(Array.isArray(s)||u==="set"){let c=Number(a);Number.isInteger(c)&&(a=c<0?s.length+c:c)}if(!s||typeof s=="function"&&n.functions===!1||!u&&s[a]===void 0){wb(!n.strict||o+1===i.length,"Missing segment",a,"in reach path ",e),wb(typeof s=="object"||n.functions===!0||typeof s!="function","Invalid segment",a,"in reach path ",e),s=n.default;break}u?u==="set"?s=[...s][a]:s=s.get(a):s=s[a]}return s};Pk.iterables=function(t){if(t instanceof Set)return"set";if(t instanceof Map)return"map"}});var Tb=m((cn,Mk)=>{"use strict";var Ik={};cn=Mk.exports={array:Array.prototype,buffer:Buffer&&Buffer.prototype,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype};Ik.typeMap=new Map([["[object Error]",cn.error],["[object Map]",cn.map],["[object Promise]",cn.promise],["[object Set]",cn.set],["[object WeakMap]",cn.weakMap],["[object WeakSet]",cn.weakSet]]);cn.getInternalProto=function(t){if(Array.isArray(t))return cn.array;if(Buffer&&t instanceof Buffer)return cn.buffer;if(t instanceof Date)return cn.date;if(t instanceof RegExp)return cn.regex;if(t instanceof Error)return cn.error;let e=Object.prototype.toString.call(t);return Ik.typeMap.get(e)||cn.generic}});var Eb=m(Lk=>{"use strict";Lk.keys=function(t,e={}){return e.symbols!==!1?Reflect.ownKeys(t):Object.getOwnPropertyNames(t)}});var ln=m((r4,Nk)=>{"use strict";var LN=Ts(),Mn=Tb(),NN=Eb(),ai={needsProtoHack:new Set([Mn.set,Mn.map,Mn.weakSet,Mn.weakMap])};Nk.exports=ai.clone=function(t,e={},n=null){if(typeof t!="object"||t===null)return t;let r=ai.clone,i=n;if(e.shallow){if(e.shallow!==!0)return ai.cloneWithShallow(t,e);r=u=>u}else if(i){let u=i.get(t);if(u)return u}else i=new Map;let s=Mn.getInternalProto(t);if(s===Mn.buffer)return Buffer&&Buffer.from(t);if(s===Mn.date)return new Date(t.getTime());if(s===Mn.regex)return new RegExp(t);let o=ai.base(t,s,e);if(o===t)return t;if(i&&i.set(t,o),s===Mn.set)for(let u of t)o.add(r(u,e,i));else if(s===Mn.map)for(let[u,c]of t)o.set(u,r(c,e,i));let a=NN.keys(t,e);for(let u of a){if(u==="__proto__")continue;if(s===Mn.array&&u==="length"){o.length=t.length;continue}let c=Object.getOwnPropertyDescriptor(t,u);c?c.get||c.set?Object.defineProperty(o,u,c):c.enumerable?o[u]=r(t[u],e,i):Object.defineProperty(o,u,{enumerable:!1,writable:!0,configurable:!0,value:r(t[u],e,i)}):Object.defineProperty(o,u,{enumerable:!0,writable:!0,configurable:!0,value:r(t[u],e,i)})}return o};ai.cloneWithShallow=function(t,e){let n=e.shallow;e=Object.assign({},e),e.shallow=!1;let r=new Map;for(let i of n){let s=LN(t,i);(typeof s=="object"||typeof s=="function")&&r.set(s,s)}return ai.clone(t,e,r)};ai.base=function(t,e,n){if(n.prototype===!1)return ai.needsProtoHack.has(e)?new e.constructor:e===Mn.array?[]:{};let r=Object.getPrototypeOf(t);if(r&&r.isImmutable)return t;if(e===Mn.array){let i=[];return r!==e&&Object.setPrototypeOf(i,r),i}if(ai.needsProtoHack.has(e)){let i=new r.constructor;return r!==e&&Object.setPrototypeOf(i,r),i}return Object.create(r)}});var qk=m((i4,qN)=>{qN.exports={name:"joi",description:"Object schema validation",version:"17.13.3",repository:"git://github.com/hapijs/joi",main:"lib/index.js",types:"lib/index.d.ts",browser:"dist/joi-browser.min.js",files:["lib/**/*","dist/*"],keywords:["schema","validation"],dependencies:{"@hapi/hoek":"^9.3.0","@hapi/topo":"^5.1.0","@sideway/address":"^4.1.5","@sideway/formula":"^3.0.1","@sideway/pinpoint":"^2.0.0"},devDependencies:{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"^25.1.3","@types/node":"^14.18.63",typescript:"4.3.x"},scripts:{prepublishOnly:"cd browser && npm install && npm run build",test:"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},license:"BSD-3-Clause"}});var Ih=m(du=>{"use strict";var P=Mh(),ge={};ge.wrap=P.string().min(1).max(2).allow(!1);du.preferences=P.object({allowUnknown:P.boolean(),abortEarly:P.boolean(),artifacts:P.boolean(),cache:P.boolean(),context:P.object(),convert:P.boolean(),dateFormat:P.valid("date","iso","string","time","utc"),debug:P.boolean(),errors:{escapeHtml:P.boolean(),label:P.valid("path","key",!1),language:[P.string(),P.object().ref()],render:P.boolean(),stack:P.boolean(),wrap:{label:ge.wrap,array:ge.wrap,string:ge.wrap}},externals:P.boolean(),messages:P.object(),noDefaults:P.boolean(),nonEnumerables:P.boolean(),presence:P.valid("required","optional","forbidden"),skipFunctions:P.boolean(),stripUnknown:P.object({arrays:P.boolean(),objects:P.boolean()}).or("arrays","objects").allow(!0,!1),warnings:P.boolean()}).strict();ge.nameRx=/^[a-zA-Z0-9]\w*$/;ge.rule=P.object({alias:P.array().items(P.string().pattern(ge.nameRx)).single(),args:P.array().items(P.string(),P.object({name:P.string().pattern(ge.nameRx).required(),ref:P.boolean(),assert:P.alternatives([P.function(),P.object().schema()]).conditional("ref",{is:!0,then:P.required()}),normalize:P.function(),message:P.string().when("assert",{is:P.function(),then:P.required()})})),convert:P.boolean(),manifest:P.boolean(),method:P.function().allow(!1),multi:P.boolean(),validate:P.function()});du.extension=P.object({type:P.alternatives([P.string(),P.object().regex()]).required(),args:P.function(),cast:P.object().pattern(ge.nameRx,P.object({from:P.function().maxArity(1).required(),to:P.function().minArity(1).maxArity(2).required()})),base:P.object().schema().when("type",{is:P.object().regex(),then:P.forbidden()}),coerce:[P.function().maxArity(3),P.object({method:P.function().maxArity(3).required(),from:P.array().items(P.string()).single()})],flags:P.object().pattern(ge.nameRx,P.object({setter:P.string(),default:P.any()})),manifest:{build:P.function().arity(2)},messages:[P.object(),P.string()],modifiers:P.object().pattern(ge.nameRx,P.function().minArity(1).maxArity(2)),overrides:P.object().pattern(ge.nameRx,P.function()),prepare:P.function().maxArity(3),rebuild:P.function().arity(1),rules:P.object().pattern(ge.nameRx,ge.rule),terms:P.object().pattern(ge.nameRx,P.object({init:P.array().allow(null).required(),manifest:P.object().pattern(/.+/,[P.valid("schema","single"),P.object({mapped:P.object({from:P.string().required(),to:P.string().required()}).required()})])})),validate:P.function().maxArity(3)}).strict();du.extensions=P.array().items(P.object(),P.function().arity(1)).strict();ge.desc={buffer:P.object({buffer:P.string()}),func:P.object({function:P.function().required(),options:{literal:!0}}),override:P.object({override:!0}),ref:P.object({ref:P.object({type:P.valid("value","global","local"),path:P.array().required(),separator:P.string().length(1).allow(!1),ancestor:P.number().min(0).integer().allow("root"),map:P.array().items(P.array().length(2)).min(1),adjust:P.function(),iterables:P.boolean(),in:P.boolean(),render:P.boolean()}).required()}),regex:P.object({regex:P.string().min(3)}),special:P.object({special:P.valid("deep").required()}),template:P.object({template:P.string().required(),options:P.object()}),value:P.object({value:P.alternatives([P.object(),P.array()]).required()})};ge.desc.entity=P.alternatives([P.array().items(P.link("...")),P.boolean(),P.function(),P.number(),P.string(),ge.desc.buffer,ge.desc.func,ge.desc.ref,ge.desc.regex,ge.desc.special,ge.desc.template,ge.desc.value,P.link("/")]);ge.desc.values=P.array().items(null,P.boolean(),P.function(),P.number().allow(1/0,-1/0),P.string().allow(""),P.symbol(),ge.desc.buffer,ge.desc.func,ge.desc.override,ge.desc.ref,ge.desc.regex,ge.desc.template,ge.desc.value);ge.desc.messages=P.object().pattern(/.+/,[P.string(),ge.desc.template,P.object().pattern(/.+/,[P.string(),ge.desc.template])]);du.description=P.object({type:P.string().required(),flags:P.object({cast:P.string(),default:P.any(),description:P.string(),empty:P.link("/"),failover:ge.desc.entity,id:P.string(),label:P.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:P.boolean(),unit:P.string()}).unknown(),preferences:{allowUnknown:P.boolean(),abortEarly:P.boolean(),artifacts:P.boolean(),cache:P.boolean(),convert:P.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:P.boolean(),label:["path","key"],language:[P.string(),ge.desc.ref],wrap:{label:ge.wrap,array:ge.wrap}},externals:P.boolean(),messages:ge.desc.messages,noDefaults:P.boolean(),nonEnumerables:P.boolean(),presence:["required","optional","forbidden"],skipFunctions:P.boolean(),stripUnknown:P.object({arrays:P.boolean(),objects:P.boolean()}).or("arrays","objects").allow(!0,!1),warnings:P.boolean()},allow:ge.desc.values,invalid:ge.desc.values,rules:P.array().min(1).items({name:P.string().required(),args:P.object().min(1),keep:P.boolean(),message:[P.string(),ge.desc.messages],warn:P.boolean()}),keys:P.object().pattern(/.*/,P.link("/")),link:ge.desc.ref}).pattern(/^[a-z]\w*$/,P.any())});var Fk=m((o4,jk)=>{"use strict";var Bi={};jk.exports=function(t){if(!t)return"";let e="";for(let n=0;n<t.length;++n){let r=t.charCodeAt(n);Bi.isSafe(r)?e+=t[n]:e+=Bi.escapeHtmlChar(r)}return e};Bi.escapeHtmlChar=function(t){let e=Bi.namedHtml.get(t);return e||(t>=256?"&#"+t+";":`&#x${t.toString(16).padStart(2,"0")};`)};Bi.isSafe=function(t){return Bi.safeCharCodes.has(t)};Bi.namedHtml=new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[34,"&quot;"],[160,"&nbsp;"],[162,"&cent;"],[163,"&pound;"],[164,"&curren;"],[169,"&copy;"],[174,"&reg;"]]);Bi.safeCharCodes=function(){let t=new Set;for(let e=32;e<123;++e)(e>=97||e>=65&&e<=90||e>=48&&e<=57||e===32||e===46||e===44||e===45||e===58||e===95)&&t.add(e);return t}()});var $k=m(fu=>{"use strict";var Re={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};fu.Parser=class{constructor(t,e={}){if(!e[Re.settings]&&e.constants)for(let n in e.constants){let r=e.constants[n];if(r!==null&&!["boolean","number","string"].includes(typeof r))throw new Error(`Formula constant ${n} contains invalid ${typeof r} value type`)}this.settings=e[Re.settings]?e:Object.assign({[Re.settings]:!0,constants:{},functions:{}},e),this.single=null,this._parts=null,this._parse(t)}_parse(t){let e=[],n="",r=0,i=!1,s=a=>{if(r)throw new Error("Formula missing closing parenthesis");let u=e.length?e[e.length-1]:null;if(!(!i&&!n&&!a)){if(u&&u.type==="reference"&&a===")"){u.type="function",u.value=this._subFormula(n,u.value),n="";return}if(a===")"){let c=new fu.Parser(n,this.settings);e.push({type:"segment",value:c})}else if(i){if(i==="]"){e.push({type:"reference",value:n}),n="";return}e.push({type:"literal",value:n})}else if(Re.operatorCharacters.includes(n))u&&u.type==="operator"&&Re.operators.includes(u.value+n)?u.value+=n:e.push({type:"operator",value:n});else if(n.match(Re.numberRx))e.push({type:"constant",value:parseFloat(n)});else if(this.settings.constants[n]!==void 0)e.push({type:"constant",value:this.settings.constants[n]});else{if(!n.match(Re.tokenRx))throw new Error(`Formula contains invalid token: ${n}`);e.push({type:"reference",value:n})}n=""}};for(let a of t)i?a===i?(s(),i=!1):n+=a:r?a==="("?(n+=a,++r):a===")"?(--r,r?n+=a:s(a)):n+=a:a in Re.literals?i=Re.literals[a]:a==="("?(s(),++r):Re.operatorCharacters.includes(a)?(s(),n=a,s()):a!==" "?n+=a:s();s(),e=e.map((a,u)=>a.type!=="operator"||a.value!=="-"||u&&e[u-1].type!=="operator"?a:{type:"operator",value:"n"});let o=!1;for(let a of e){if(a.type==="operator"){if(Re.operatorsPrefix.includes(a.value))continue;if(!o)throw new Error("Formula contains an operator in invalid position");if(!Re.operators.includes(a.value))throw new Error(`Formula contains an unknown operator ${a.value}`)}else if(o)throw new Error("Formula missing expected operator");o=!o}if(!o)throw new Error("Formula contains invalid trailing operator");e.length===1&&["reference","literal","constant"].includes(e[0].type)&&(this.single={type:e[0].type==="reference"?"reference":"value",value:e[0].value}),this._parts=e.map(a=>{if(a.type==="operator")return Re.operatorsPrefix.includes(a.value)?a:a.value;if(a.type!=="reference")return a.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(a.value))throw new Error(`Formula contains invalid reference ${a.value}`);return this.settings.reference?this.settings.reference(a.value):Re.reference(a.value)})}_subFormula(t,e){let n=this.settings.functions[e];if(typeof n!="function")throw new Error(`Formula contains unknown function ${e}`);let r=[];if(t){let i="",s=0,o=!1,a=()=>{if(!i)throw new Error(`Formula contains function ${e} with invalid arguments ${t}`);r.push(i),i=""};for(let u=0;u<t.length;++u){let c=t[u];o?(i+=c,c===o&&(o=!1)):c in Re.literals&&!s?(i+=c,o=Re.literals[c]):c===","&&!s?a():(i+=c,c==="("?++s:c===")"&&--s)}a()}return r=r.map(i=>new fu.Parser(i,this.settings)),function(i){let s=[];for(let o of r)s.push(o.evaluate(i));return n.call(i,...s)}}evaluate(t){let e=this._parts.slice();for(let n=e.length-2;n>=0;--n){let r=e[n];if(r&&r.type==="operator"){let i=e[n+1];e.splice(n+1,1);let s=Re.evaluate(i,t);e[n]=Re.single(r.value,s)}}return Re.operatorsOrder.forEach(n=>{for(let r=1;r<e.length-1;)if(n.includes(e[r])){let i=e[r],s=Re.evaluate(e[r-1],t),o=Re.evaluate(e[r+1],t);e.splice(r,2);let a=Re.calculate(i,s,o);e[r-1]=a===0?0:a}else r+=2}),Re.evaluate(e[0],t)}};fu.Parser.prototype[Re.symbol]=!0;Re.reference=function(t){return function(e){return e&&e[t]!==void 0?e[t]:null}};Re.evaluate=function(t,e){return t===null?null:typeof t=="function"?t(e):t[Re.symbol]?t.evaluate(e):t};Re.single=function(t,e){if(t==="!")return!e;let n=-e;return n===0?0:n};Re.calculate=function(t,e,n){if(t==="??")return Re.exists(e)?e:n;if(typeof e=="string"||typeof n=="string"){if(t==="+")return e=Re.exists(e)?e:"",n=Re.exists(n)?n:"",e+n}else switch(t){case"^":return Math.pow(e,n);case"*":return e*n;case"/":return e/n;case"%":return e%n;case"+":return e+n;case"-":return e-n}switch(t){case"<":return e<n;case"<=":return e<=n;case">":return e>n;case">=":return e>=n;case"==":return e===n;case"!=":return e!==n;case"&&":return e&&n;case"||":return e||n}return null};Re.exists=function(t){return t!=null}});var Uk=m(Bk=>{"use strict";var jN=ln(),FN=Ze(),Es={annotations:Symbol("annotations")};Bk.error=function(t){if(!this._original||typeof this._original!="object")return this.details[0].message;let e=t?"":"\x1B[31m",n=t?"":"\x1B[41m",r=t?"":"\x1B[0m",i=jN(this._original);for(let a=this.details.length-1;a>=0;--a){let u=a+1,c=this.details[a],l=c.path,h=i;for(let d=0;;++d){let g=l[d];if(FN.isSchema(h)&&(h=h.clone()),d+1<l.length&&typeof h[g]!="string")h=h[g];else{let y=h[Es.annotations]||{errors:{},missing:{}};h[Es.annotations]=y;let _=g||c.context.key;h[g]!==void 0?(y.errors[_]=y.errors[_]||[],y.errors[_].push(u)):y.missing[_]=u;break}}}let s={key:/_\$key\$_([, \d]+)_\$end\$_"/g,missing:/"_\$miss\$_([^|]+)\|(\d+)_\$end\$_": "__missing__"/g,arrayIndex:/\s*"_\$idx\$_([, \d]+)_\$end\$_",?\n(.*)/g,specials:/"\[(NaN|Symbol.*|-?Infinity|function.*|\(.*)]"/g},o=Es.safeStringify(i,2).replace(s.key,(a,u)=>`" ${e}[${u}]${r}`).replace(s.missing,(a,u,c)=>`${n}"${u}"${r}${e} [${c}]: -- missing --${r}`).replace(s.arrayIndex,(a,u,c)=>`
96
+ return false;`);return Object.defineProperty(o,"name",{value:`selector_group_${t}`,writable:!1}),o.selectors=e,o}ue.createSelectorGroup=qr;function qM(t){return t.selectors}ue.getSelectorsFromGroup=qM;var jr;(function(t){t.BlockEndOfLine="BlockEndOfLine",t.AssignmentEndOfExpr="AssignmentEndOfExpr",t.AssignmentShorthand="AssignmentShorthand",t.AssignmentCommandArgs="AssignmentCommandArgs",t.ReturnStatementEnd="ReturnStatementEnd",t.FunctionDeclarationArgEnd="FunctionDeclarationArgEnd",t.ComparisonOperators="ComparisonOperators",t.MultiDivOperators="MultiDivOperators",t.CallArgsEnd="CallArgsEnd"})(jr=ue.SelectorGroupType||(ue.SelectorGroupType={}));ue.SelectorGroups={BlockEndOfLine:qr(jr.AssignmentEndOfExpr,[ue.Selectors.EndOfLine,ue.Selectors.Comment]),AssignmentEndOfExpr:qr(jr.AssignmentEndOfExpr,[ue.Selectors.EndOfFile,ue.Selectors.EndOfLine,ue.Selectors.Else,ue.Selectors.Comment]),AssignmentShorthand:qr(jr.AssignmentShorthand,[ue.Selectors.AddShorthand,ue.Selectors.SubtractShorthand,ue.Selectors.MultiplyShorthand,ue.Selectors.DivideShorthand,ue.Selectors.PowerShorthand,ue.Selectors.ModuloShorthand]),AssignmentCommandArgs:qr(jr.AssignmentCommandArgs,[ue.Selectors.ArgumentSeperator,ue.Selectors.EndOfLine,ue.Selectors.EndOfFile]),ReturnStatementEnd:qr(jr.ReturnStatementEnd,[ue.Selectors.EndOfLine,ue.Selectors.Else,ue.Selectors.Comment]),FunctionDeclarationArgEnd:qr(jr.FunctionDeclarationArgEnd,[ue.Selectors.RParenthesis,ue.Selectors.EndOfFile,ue.Selectors.EndOfLine]),ComparisonOperators:qr(jr.ComparisonOperators,[ue.Selectors.Equal,ue.Selectors.NotEqual,ue.Selectors.Greater,ue.Selectors.GreaterEqual,ue.Selectors.Lesser,ue.Selectors.LessEqual]),MultiDivOperators:qr(jr.MultiDivOperators,[ue.Selectors.Times,ue.Selectors.Divide,ue.Selectors.Mod]),CallArgsEnd:qr(jr.CallArgsEnd,[ue.Selectors.ArgumentSeperator,ue.Selectors.RParenthesis])}});var Qy=m(Ah=>{"use strict";Object.defineProperty(Ah,"__esModule",{value:!0});Ah.Stack=void 0;var Jy=class{constructor(){this._items=[],this._last=null,this._default=null}setDefault(e){this._default=e}push(e){return this._items.push(this._last=e)}pop(){switch(this._items.length){case 0:return this._default;case 1:return this._last=null,this._items.pop()}let e=this._items.pop();return this._last=this._items[this._items.length-1],e}peek(){return this._last||this._default}};Ah.Stack=Jy});var ib=m(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.PendingWhile=Je.isPendingWhile=Je.PendingIf=Je.isPendingIf=Je.PendingFunction=Je.isPendingFunction=Je.PendingFor=Je.isPendingFor=Je.PendingChunk=Je.isPendingChunk=Je.PendingBlockType=void 0;var Sr;(function(t){t[t.Chunk=0]="Chunk",t[t.For=1]="For",t[t.Function=2]="Function",t[t.If=3]="If",t[t.While=4]="While"})(Sr=Je.PendingBlockType||(Je.PendingBlockType={}));var Ss=class{constructor(e,n,r){this.lineRegistry=r,this.block=e,this.body=[],this.type=n,this.onComplete=null}complete(e){var n;(n=this.onComplete)===null||n===void 0||n.call(this,this)}};function jM(t){return t.type===Sr.Chunk}Je.isPendingChunk=jM;var Zy=class extends Ss{constructor(e,n){super(e,Sr.Chunk,n)}complete(e){this.block.body=this.body,this.block.end=e.end,this.block.range=[this.block.range[0],e.range[1]],super.complete(e)}};Je.PendingChunk=Zy;function FM(t){return t.type===Sr.For}Je.isPendingFor=FM;var eb=class extends Ss{constructor(e,n){super(e,Sr.For,n),this.lineRegistry.addItemToLine(this.block.start.line,this.block)}complete(e){this.block.body=this.body,this.block.end=e.end,this.block.range=[this.block.range[0],e.range[1]],this.lineRegistry.addItemToRange(this.block.start.line+1,e.end.line,this.block),super.complete(e)}};Je.PendingFor=eb;function $M(t){return t.type===Sr.Function}Je.isPendingFunction=$M;var tb=class extends Ss{constructor(e,n,r){super(e,Sr.Function,r),this.base=n,this.lineRegistry.addItemToLine(this.block.start.line,this.block)}complete(e){this.block.body=this.body,this.block.end=e.end,this.block.range=[this.block.range[0],e.range[1]],this.base!==null?(this.base.end=this.block.end,this.base.range[1]=this.block.range[1],this.lineRegistry.addItemToRange(this.block.start.line+1,this.base.end.line,this.base)):this.lineRegistry.addItemToRange(this.block.start.line+1,this.block.end.line,this.block),super.complete(e)}};Je.PendingFunction=tb;function BM(t){return t.type===Sr.If}Je.isPendingIf=BM;var nb=class extends Ss{constructor(e,n,r){super(e,Sr.If,r),this.lineRegistry.addItemToLine(this.block.start.line,this.block),this.currentClause=n}addCurrentClauseToLineRegistry(){this.currentClause.start.line===this.block.start.line?this.lineRegistry.addItemToRange(this.currentClause.start.line+1,this.currentClause.end.line,this.block):this.lineRegistry.addItemToRange(this.currentClause.start.line,this.currentClause.end.line,this.block)}next(e){this.currentClause.body=this.body,this.currentClause.end=e.end,this.currentClause.range=[this.currentClause.range[0],e.range[1]],this.addCurrentClauseToLineRegistry(),this.block.clauses.push(this.currentClause),super.complete(e),this.body=[]}complete(e){this.body.length>0&&this.next(e),this.block.end=e.end,this.block.range=[this.block.range[0],e.range[1]],this.lineRegistry.addItemToRange(this.currentClause.end.line+1,this.block.end.line,this.block),super.complete(e)}};Je.PendingIf=nb;function WM(t){return t.type===Sr.While}Je.isPendingWhile=WM;var rb=class extends Ss{constructor(e,n){super(e,Sr.While,n),this.lineRegistry.addItemToLine(this.block.start.line,this.block)}complete(e){this.block.body=this.body,this.block.end=e.end,this.block.range=[this.block.range[0],e.range[1]],this.lineRegistry.addItemToRange(this.block.start.line+1,e.end.line,this.block),super.complete(e)}};Je.PendingWhile=rb});var ob=m(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});Ch.LineRegistry=void 0;var sb=class{constructor(){this._lines={}}get lines(){return this._lines}addItemToLines(e){this.addItemToRange(e.start.line,e.end.line,e)}addItemToLine(e,n){this.addItemToRange(e,e,n)}addItemToRange(e,n,r){let i=this._lines;for(let s=e;s<=n;s++){let o=i[s];o?o.push(r):i[s]=[r]}}};Ch.LineRegistry=sb});var mk=m(ru=>{"use strict";var gk=ru&&ru.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ru,"__esModule",{value:!0});var UM=gk(Hm()),Lo=Fi(),In=Gy(),HM=gk(Vy()),GM=nh(),Xt=Ao(),ui=Oo(),ln=Ya(),X=Yy(),zM=Qy(),Fr=ib(),KM=ob(),ab=class{constructor(e,n={}){let r=this;r.content=e,r.backpatches=new zM.Stack,r.statementErrors=[],r.lexer=n.lexer||new UM.default(e,{unsafe:n.unsafe,tabWidth:n.tabWidth}),r.token=null,r.previousToken=null,r.lineRegistry=new KM.LineRegistry,r.scopes=[],r.currentScope=null,r.currentAssignment=null,r.outerScopes=[],r.literals=[],r.validator=n.validator||new HM.default,r.astProvider=n.astProvider||new In.ASTProvider,r.unsafe=n.unsafe||!1,r.errors=[]}next(){this.previousToken=this.token,this.token=this.lexer.next()}isType(e){return this.token!==null&&e===this.token.type}consume(e){return e(this.token)?(this.next(),!0):!1}consumeMany(e){return e(this.token)?(this.next(),!0):!1}requireType(e,n){let r=this.token;return this.token.type!==e?(this.raise(`got ${r} where ${e} is required`,new ln.Range(n||r.start,r.end)),null):(this.next(),r)}requireToken(e,n){let r=this.token;return e(r)?(this.next(),r):(this.raise(`got ${r} where "${(0,X.getSelectorValue)(e)}" is required`,new ln.Range(n||r.start,r.end)),null)}requireTokenOfAny(e,n){let r=this.token;return e(r)?(this.next(),r):(this.raise(`got ${r} where any of ${(0,X.getSelectorsFromGroup)(e).map(i=>`"${(0,X.getSelectorValue)(i)}"`).join(", ")} is required`,new ln.Range(n||r.start,r.end)),null)}skipNewlines(){var e;let n=this,r=0;for(;;){if(X.Selectors.Comment(n.token)){let i=((e=n.previousToken)===null||e===void 0?void 0:e.line)!==n.token.line,s=n.astProvider.comment({value:n.token.value,start:n.token.start,end:n.token.end,range:n.token.range,scope:n.currentScope,isStatement:i});n.lineRegistry.addItemToLines(s)}else if(X.Selectors.EndOfLine(n.token))r++;else break;n.next()}return r}pushScope(e){let n=this;n.currentScope!==null&&(n.scopes.push(e),n.outerScopes.push(n.currentScope)),n.currentScope=e}popScope(){let e=this;e.currentScope=e.outerScopes.pop()}tryToRecover(){let e=this,n=e.statementErrors[0];if(e.errors.push(n),!e.unsafe)throw n;for(e.lexer.recoverFromSnapshot(),e.next();e.token.type!==Lo.TokenType.EOL&&e.token.type!==Lo.TokenType.EOF;e.next());}finishRemaingScopes(){let e=this,n=e.backpatches.pop();for(;!(0,Fr.isPendingChunk)(n);){let r=e.raise(`found open block ${n.block.type}`,new ln.Range(n.block.start,n.block.start));if(n.complete(e.previousToken),e.errors.push(r),!e.unsafe)throw r;n=e.backpatches.pop()}}parseChunk(){let e=this;e.next();let n=e.token.start,r=e.astProvider.chunk({start:n,end:null,range:[e.token.range[0],null]}),i=new Fr.PendingChunk(r,e.lineRegistry);for(e.backpatches.setDefault(i),e.pushScope(r);!X.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!X.Selectors.EndOfFile(e.token));)e.lexer.recordSnapshot(),e.statementErrors=[],e.parseStatement(),e.statementErrors.length>0&&e.tryToRecover();return e.finishRemaingScopes(),e.popScope(),i.complete(e.token),r.literals=e.literals,r.scopes=e.scopes,r.lines=e.lineRegistry.lines,r}parseStatement(){let e=this;if(Lo.TokenType.Keyword===e.token.type&&Xt.Keyword.Not!==e.token.value){e.parseKeyword();return}let n=e.backpatches.peek(),r=e.parseAssignment();r.end!==null&&e.lineRegistry.addItemToLines(r),n.body.push(r)}parseKeyword(){let e=this;switch(e.token.value){case Xt.Keyword.Return:{let r=e.backpatches.peek();e.next();let i=e.parseReturnStatement();i.end!==null&&e.lineRegistry.addItemToLines(i),r.body.push(i);return}case Xt.Keyword.If:{e.next(),e.parseIfStatement();return}case Xt.Keyword.ElseIf:{e.next(),e.nextIfClause(In.ASTType.ElseifClause);return}case Xt.Keyword.Else:{e.next(),e.nextIfClause(In.ASTType.ElseClause);return}case Xt.Keyword.While:{e.next(),e.parseWhileStatement();return}case Xt.Keyword.For:{e.next(),e.parseForStatement();return}case Xt.Keyword.EndFunction:{e.next(),e.finalizeFunction();return}case Xt.Keyword.EndFor:{e.next(),e.finalizeForStatement();return}case Xt.Keyword.EndWhile:{e.next(),e.finalizeWhileStatement();return}case Xt.Keyword.EndIf:{e.next(),e.nextIfClause(null);return}case Xt.Keyword.Continue:{let r=e.backpatches.peek();e.next();let i=e.astProvider.continueStatement({start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});e.lineRegistry.addItemToLines(i),r.body.push(i);return}case Xt.Keyword.Break:{let r=e.backpatches.peek();e.next();let i=e.astProvider.breakStatement({start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});e.lineRegistry.addItemToLines(i),r.body.push(i);return}}e.raise(`unexpected keyword ${e.token} at start of line`,new ln.Range(e.token.start,e.token.end))}parseShortcutStatement(){let e=this;if(Lo.TokenType.Keyword===e.token.type&&Xt.Keyword.Not!==e.token.value)switch(e.token.value){case Xt.Keyword.Return:return e.next(),e.parseReturnStatement();case Xt.Keyword.Continue:return e.next(),e.astProvider.continueStatement({start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});case Xt.Keyword.Break:return e.next(),e.astProvider.breakStatement({start:e.previousToken.start,end:e.previousToken.end,range:e.previousToken.range,scope:e.currentScope});default:return e.raise(`unexpected keyword ${e.token} in shorthand statement`,new ln.Range(e.token.start,e.token.end)),e.parseInvalidCode()}return e.parseAssignment()}parseAssignment(){let e=this,n=e.currentScope,r=e.token,i=e.parseExpr(null,!0,!0);if(X.SelectorGroups.AssignmentEndOfExpr(e.token))return i;if(X.Selectors.Assign(e.token)){e.next();let o=e.astProvider.assignmentStatement({variable:i,init:null,start:r.start,range:[r.range[0],null],end:null,scope:n}),a=e.currentAssignment;return e.currentAssignment=o,o.init=e.parseExpr(o),o.end=e.previousToken.end,o.range[1]=e.previousToken.range[1],e.currentAssignment=a,n.definitions.push(o),o}else if(X.SelectorGroups.AssignmentShorthand(e.token)){let o=e.token;e.next();let a=e.astProvider.assignmentStatement({variable:i,init:null,start:r.start,range:[r.range[0],null],end:null,scope:n}),u=e.currentAssignment;e.currentAssignment=a;let c=e.token,l=o.value.charAt(0),h=e.parseExpr(a),d=e.astProvider.parenthesisExpression({start:h.start,end:h.end,range:h.range,expression:h});return a.init=e.astProvider.binaryExpression({operator:l,left:i.clone(),right:d,start:c.start,end:e.previousToken.end,range:[c.range[0],e.previousToken.range[1]],scope:n}),a.end=e.previousToken.end,a.range[1]=e.previousToken.range[1],e.currentAssignment=u,n.definitions.push(a),a}let s=[];for(;!X.Selectors.EndOfFile(e.token);){let o=e.parseExpr(null);if(s.push(o),X.SelectorGroups.BlockEndOfLine(e.token)||X.Selectors.Else(e.token))break;if(X.Selectors.ArgumentSeperator(e.token)){e.next(),e.skipNewlines();continue}let a=e.requireTokenOfAny(X.SelectorGroups.AssignmentCommandArgs,r.start);if(X.Selectors.EndOfLine(a)||X.Selectors.EndOfFile(a))break}return s.length===0?e.astProvider.callStatement({expression:i,start:r.start,end:e.previousToken.end,range:[r.range[0],e.previousToken.range[1]],scope:n}):e.astProvider.callStatement({expression:e.astProvider.callExpression({base:i,arguments:s,start:r.start,end:e.previousToken.end,range:[r.range[0],e.previousToken.range[1]],scope:n}),start:r.start,end:e.previousToken.end,range:[r.range[0],e.previousToken.range[1]],scope:n})}parseReturnStatement(){let e=this,n=e.currentScope,r=e.previousToken,i=null,s=e.astProvider.returnStatement({argument:null,start:r.start,end:null,range:[r.range[0],null],scope:n});return X.SelectorGroups.ReturnStatementEnd(e.token)?(s.end=e.previousToken.end,s.range[1]=e.previousToken.range[1]):(i=e.parseExpr(s),s.end=e.previousToken.end,s.range[1]=e.previousToken.range[1],s.argument=i),n.returns.push(s),s}parseIfStatement(){let e=this,n=e.previousToken,r=e.parseExpr(null);if(e.lineRegistry.addItemToLines(r),e.requireToken(X.Selectors.Then,n.start),!X.SelectorGroups.BlockEndOfLine(e.token)){e.parseIfShortcutStatement(r,n);return}let i=e.astProvider.ifStatement({clauses:[],start:n.start,end:null,range:[n.range[0],null],scope:e.currentScope}),s=e.astProvider.ifClause({condition:r,start:n.start,end:e.token.end,range:[n.range[0],e.token.range[1]],scope:e.currentScope}),o=new Fr.PendingIf(i,s,e.lineRegistry);e.backpatches.push(o)}nextIfClause(e){let n=this,r=n.backpatches.peek();if(!(0,Fr.isPendingIf)(r)){n.raise("no matching open if block",new ln.Range(n.token.start,n.token.end));return}switch(r.next(n.previousToken),e){case In.ASTType.ElseifClause:{let i=n.token,s=n.parseExpr(null);n.requireToken(X.Selectors.Then,i.start),r.currentClause=n.astProvider.elseifClause({condition:s,start:i.start,end:null,range:[i.range[0],null],scope:n.currentScope});break}case In.ASTType.ElseClause:{let i=n.token;r.currentClause=n.astProvider.elseClause({start:i.start,end:null,range:[i.range[0],null],scope:n.currentScope});break}}e===null&&(r.complete(n.previousToken),n.backpatches.pop(),n.backpatches.peek().body.push(r.block))}parseIfShortcutStatement(e,n){let r=this,i=[],s=r.backpatches.peek(),o=r.astProvider.ifShortcutStatement({clauses:i,start:n.start,end:null,range:[n.range[0],null],scope:r.currentScope}),a=r.parseShortcutStatement();if(i.push(r.astProvider.ifShortcutClause({condition:e,body:[a],start:n.start,end:r.token.end,range:[n.range[0],r.token.range[1]],scope:r.currentScope})),X.Selectors.Else(r.token)){r.next();let u=r.token,c=r.parseShortcutStatement();i.push(r.astProvider.elseShortcutClause({body:[c],start:u.start,end:r.token.end,range:[u.range[0],r.token.range[1]],scope:r.currentScope}))}o.end=r.token.end,o.range[1]=r.token.range[1],r.lineRegistry.addItemToLines(o),s.body.push(o)}parseWhileStatement(){let e=this,n=e.previousToken,r=e.parseExpr(null);if(!r){e.raise("while requires a condition",new ln.Range(n.start,e.token.end));return}if(!X.SelectorGroups.BlockEndOfLine(e.token))return e.parseWhileShortcutStatement(r,n);let i=e.astProvider.whileStatement({condition:r,start:n.start,end:null,range:[n.range[0],null],scope:e.currentScope}),s=new Fr.PendingWhile(i,e.lineRegistry);e.backpatches.push(s)}finalizeWhileStatement(){let e=this,n=e.backpatches.peek();if(!(0,Fr.isPendingWhile)(n)){e.raise("no matching open while block",new ln.Range(e.token.start,e.token.end));return}n.complete(e.previousToken),e.backpatches.pop(),e.backpatches.peek().body.push(n.block)}parseWhileShortcutStatement(e,n){let r=this,i=r.backpatches.peek(),s=r.parseShortcutStatement(),o=r.astProvider.whileStatement({condition:e,body:[s],start:n.start,end:r.previousToken.end,range:[n.range[0],r.previousToken.range[1]],scope:r.currentScope});r.lineRegistry.addItemToLines(o),i.body.push(o)}parseForStatement(){let e=this,n=e.currentScope,r=e.previousToken,i=e.parseIdentifier(In.ASTIdentifierKind.ForInVariable);e.requireToken(X.Selectors.In,r.start);let s=e.parseExpr(null);if(!s){e.raise("sequence expression expected for 'for' loop",new ln.Range(r.start,e.token.end));return}if(!X.SelectorGroups.BlockEndOfLine(e.token))return e.parseForShortcutStatement(i,s,r);let o=e.astProvider.forGenericStatement({variable:i,iterator:s,start:r.start,end:e.previousToken.end,range:[r.range[0],e.previousToken.range[1]],scope:n});n.definitions.push(o);let a=new Fr.PendingFor(o,e.lineRegistry);e.backpatches.push(a)}finalizeForStatement(){let e=this,n=e.backpatches.peek();if(!(0,Fr.isPendingFor)(n)){e.raise("no matching open for block",new ln.Range(e.token.start,e.token.end));return}n.complete(e.previousToken),e.backpatches.pop(),e.backpatches.peek().body.push(n.block)}parseForShortcutStatement(e,n,r){let i=this,s=i.currentScope,o=i.backpatches.peek(),a=i.parseShortcutStatement(),u=i.astProvider.forGenericStatement({variable:e,iterator:n,body:[a],start:r.start,end:i.previousToken.end,range:[r.range[0],i.previousToken.range[1]],scope:i.currentScope});s.definitions.push(u),i.lineRegistry.addItemToLines(u),o.body.push(u)}parseExpr(e,n=!1,r=!1){return this.parseFunctionDeclaration(e,n,r)}parseFunctionDeclaration(e,n=!1,r=!1){let i=this;if(!X.Selectors.Function(i.token))return i.parseOr(n,r);i.next();let s=i.previousToken,o=i.astProvider.functionStatement({start:s.start,end:null,range:[s.range[0],null],scope:i.currentScope,parent:i.outerScopes[i.outerScopes.length-1],assignment:i.currentAssignment}),a=[];if(i.pushScope(o),!X.SelectorGroups.BlockEndOfLine(i.token)){for(i.requireToken(X.Selectors.LParenthesis,s.start);!X.SelectorGroups.FunctionDeclarationArgEnd(i.token);){let c=i.parseIdentifier(In.ASTIdentifierKind.Argument),l=c;if(i.consume(X.Selectors.Assign)){let h=i.parseExpr(null);if(h instanceof In.ASTLiteral){let d=i.astProvider.assignmentStatement({variable:c,init:h,start:l.start,end:i.previousToken.end,range:[l.range[0],i.previousToken.range[1]],scope:i.currentScope});i.currentScope.definitions.push(d),a.push(d)}else i.raise("parameter default value must be a literal value",new ln.Range(l.start,i.token.end)),a.push(i.astProvider.invalidCodeExpression({start:l.start,end:i.previousToken.end,range:[l.range[0],i.previousToken.range[1]]}))}else{let h=i.astProvider.assignmentStatement({variable:c,init:i.astProvider.unknown({start:l.start,end:i.previousToken.end,range:[l.range[0],i.previousToken.range[1]],scope:i.currentScope}),start:l.start,end:i.previousToken.end,range:[l.range[0],i.previousToken.range[1]],scope:i.currentScope});i.currentScope.definitions.push(h),a.push(c)}if(X.Selectors.RParenthesis(i.token))break;if(i.requireToken(X.Selectors.ArgumentSeperator,s.start),X.Selectors.RParenthesis(i.token)){i.raise("expected argument instead received right parenthesis",new ln.Range(i.previousToken.end,i.previousToken.end));break}}i.requireToken(X.Selectors.RParenthesis,s.start)}o.parameters=a;let u=new Fr.PendingFunction(o,e,i.lineRegistry);return i.backpatches.push(u),o}finalizeFunction(){let e=this,n=e.backpatches.peek();if(!(0,Fr.isPendingFunction)(n)){e.raise("no matching open function block",new ln.Range(e.token.start,e.token.end));return}e.popScope(),n.complete(e.previousToken),e.backpatches.pop()}parseOr(e=!1,n=!1){let r=this,i=r.token,o=r.parseAnd(e,n);for(;X.Selectors.Or(r.token);){r.next(),r.skipNewlines();let a=r.parseAnd();o=r.astProvider.logicalExpression({operator:ui.Operator.Or,left:o,right:a,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseAnd(e=!1,n=!1){let r=this,i=r.token,o=r.parseNot(e,n);for(;X.Selectors.And(r.token);){r.next(),r.skipNewlines();let a=r.parseNot();o=r.astProvider.logicalExpression({operator:ui.Operator.And,left:o,right:a,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseNot(e=!1,n=!1){let r=this,i=r.token;if(X.Selectors.Not(r.token)){r.next(),r.skipNewlines();let s=r.parseIsa();return r.astProvider.unaryExpression({operator:ui.Operator.Not,argument:s,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return r.parseIsa(e,n)}parseIsa(e=!1,n=!1){let r=this,i=r.token,s=r.parseComparisons(e,n);if(X.Selectors.Isa(r.token)){r.next(),r.skipNewlines();let o=r.parseComparisons();return r.astProvider.isaExpression({operator:ui.Operator.Isa,left:s,right:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return s}parseComparisons(e=!1,n=!1){let r=this,i=r.token,s=r.parseAddSub(e,n);if(!X.SelectorGroups.ComparisonOperators(r.token))return s;let o=[s],a=[];do{let u=r.token;r.next(),r.skipNewlines();let c=r.parseAddSub();a.push(u.value),o.push(c)}while(X.SelectorGroups.ComparisonOperators(r.token));return a.length===1?r.astProvider.binaryExpression({operator:a[0],left:o[0],right:o[1],start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope}):r.astProvider.comparisonGroupExpression({operators:a,expressions:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}parseAddSub(e=!1,n=!1){let r=this,i=r.token,o=r.parseMultDiv(e,n);for(;X.Selectors.Plus(r.token)||X.Selectors.Minus(r.token)&&(!n||!r.token.afterSpace||r.lexer.isAtWhitespace());){let a=r.token;r.next(),r.skipNewlines();let u=r.parseMultDiv();o=r.astProvider.binaryExpression({operator:a.value,left:o,right:u,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseMultDiv(e=!1,n=!1){let r=this,i=r.token,o=r.parseUnaryMinus(e,n);for(;X.SelectorGroups.MultiDivOperators(r.token);){let a=r.token;r.next(),r.skipNewlines();let u=r.parseUnaryMinus();o=r.astProvider.binaryExpression({operator:a.value,left:o,right:u,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseUnaryMinus(e=!1,n=!1){let r=this;if(!X.Selectors.Minus(r.token))return r.parseNew(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parseNew();return s instanceof In.ASTNumericLiteral||s instanceof In.ASTBooleanLiteral?(s.negated=!0,s):r.astProvider.unaryExpression({operator:ui.Operator.Minus,argument:s,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}parseNew(e=!1,n=!1){let r=this;if(!X.Selectors.New(r.token))return r.parseAddressOf(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parseNew();return r.astProvider.unaryExpression({operator:ui.Operator.New,argument:s,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}parseAddressOf(e=!1,n=!1){let r=this;if(!X.Selectors.Reference(r.token))return r.parsePower(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parsePower();return r.astProvider.unaryExpression({operator:ui.Operator.Reference,argument:s,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}parsePower(e=!1,n=!1){let r=this,i=r.token,s=r.parseCallExpr(e,n);if(X.Selectors.Power(r.token)){r.next(),r.skipNewlines();let o=r.parseCallExpr();return r.astProvider.binaryExpression({operator:ui.Operator.Power,left:s,right:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return s}parseCallExpr(e=!1,n=!1){let r=this,i=r.token,s=r.parseMap(e,n);for(;!X.Selectors.EndOfFile(r.token);)if(X.Selectors.MemberSeperator(r.token)){r.next(),r.skipNewlines();let o=r.parseIdentifier(In.ASTIdentifierKind.Property),a=r.astProvider.memberExpression({base:s,indexer:ui.Operator.Member,identifier:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope});r.currentScope.namespaces.push(a),s=a}else if(X.Selectors.SLBracket(r.token)&&!r.token.afterSpace){if(r.next(),r.skipNewlines(),X.Selectors.SliceSeperator(r.token)){let o=r.astProvider.emptyExpression({start:r.previousToken.start,end:r.previousToken.end,range:r.previousToken.range,scope:r.currentScope});r.next(),r.skipNewlines();let a=X.Selectors.SRBracket(r.token)?r.astProvider.emptyExpression({start:r.previousToken.start,end:r.previousToken.end,range:r.previousToken.range,scope:r.currentScope}):r.parseExpr(null);s=r.astProvider.sliceExpression({base:s,left:o,right:a,start:i.start,end:r.token.end,range:[i.range[0],r.token.range[1]],scope:r.currentScope})}else{let o=r.parseExpr(null);if(X.Selectors.SliceSeperator(r.token)){r.next(),r.skipNewlines();let a=X.Selectors.SRBracket(r.token)?r.astProvider.emptyExpression({start:r.previousToken.start,end:r.previousToken.end,range:r.previousToken.range,scope:r.currentScope}):r.parseExpr(null);s=r.astProvider.sliceExpression({base:s,left:o,right:a,start:i.start,end:r.token.end,range:[i.range[0],r.token.range[1]],scope:r.currentScope})}else s=r.astProvider.indexExpression({base:s,index:o,start:i.start,end:r.token.end,range:[i.range[0],r.token.range[1]],scope:r.currentScope})}r.requireToken(X.Selectors.SRBracket,i.start)}else if(X.Selectors.LParenthesis(r.token)&&(!e||!r.token.afterSpace)){let o=r.parseCallArgs();s=r.astProvider.callExpression({base:s,arguments:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}else break;return s}parseCallArgs(){let e=this,n=[];if(X.Selectors.LParenthesis(e.token))if(e.next(),X.Selectors.RParenthesis(e.token))e.next();else for(;!X.Selectors.EndOfFile(e.token);){e.skipNewlines();let r=e.parseExpr(null);if(n.push(r),e.skipNewlines(),X.Selectors.RParenthesis(e.requireTokenOfAny(X.SelectorGroups.CallArgsEnd,r.start)))break}return n}parseMap(e=!1,n=!1){let r=this;if(!X.Selectors.CLBracket(r.token))return r.parseList(e,n);let i=r.currentScope,s=r.token,o=[],a=r.astProvider.mapConstructorExpression({fields:o,start:s.start,end:null,range:[s.range[0],null],scope:i});if(r.next(),X.Selectors.CRBracket(r.token))r.next();else for(r.skipNewlines();!X.Selectors.EndOfFile(r.token);){if(X.Selectors.CRBracket(r.token)){r.next();break}let u=r.astProvider.mapKeyString({key:null,value:null,start:r.token.start,end:null,range:[r.token.range[0],null],scope:i});if(u.key=r.parseExpr(null),r.requireToken(X.Selectors.MapKeyValueSeperator),r.skipNewlines(),u.value=r.parseExpr(u),u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),X.Selectors.MapSeperator(r.token)&&(r.next(),r.skipNewlines()),X.Selectors.CRBracket(r.token)){r.next();break}}return a.end=r.token.start,a.range[1]=r.token.range[1],a}parseList(e=!1,n=!1){let r=this;if(!X.Selectors.SLBracket(r.token))return r.parseQuantity(e,n);let i=r.currentScope,s=r.token,o=[],a=r.astProvider.listConstructorExpression({fields:o,start:s.start,end:null,range:[s.range[0],null],scope:i});if(r.next(),X.Selectors.SRBracket(r.token))r.next();else for(r.skipNewlines();!X.Selectors.EndOfFile(r.token);){if(X.Selectors.SRBracket(r.token)){r.next();break}let u=r.astProvider.listValue({value:null,start:r.token.start,end:null,range:[r.token.range[0],null],scope:i});if(u.value=r.parseExpr(u),u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),X.Selectors.MapSeperator(r.token)&&(r.next(),r.skipNewlines()),X.Selectors.SRBracket(r.token)){r.next();break}}return a.end=r.token.start,a.range[1]=r.token.range[1],a}parseQuantity(e=!1,n=!1){let r=this;if(!X.Selectors.LParenthesis(r.token))return r.parseAtom(e,n);let i=r.token;r.next(),r.skipNewlines();let s=r.parseExpr(null);return r.requireToken(X.Selectors.RParenthesis,i.start),r.astProvider.parenthesisExpression({expression:s,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}parseAtom(e=!1,n=!1){let r=this;return r.validator.isLiteral(r.token.type)?r.parseLiteral():r.isType(Lo.TokenType.Identifier)?r.parseIdentifier(In.ASTIdentifierKind.Variable):(r.raise(`got ${r.token} where number, string, or identifier is required`,new ln.Range(r.token.start,r.token.end)),r.parseInvalidCode())}parseLiteral(){let e=this,n=e.token,r=e.token.type,i=e.astProvider.literal(r,{value:e.token.value,raw:e.token.raw,start:n.start,end:e.token.end,range:[n.range[0],e.token.range[1]],scope:e.currentScope});return e.literals.push(i),e.next(),i}parseIdentifier(e){let n=this,r=n.requireType(Lo.TokenType.Identifier);if(r===null)return n.parseInvalidCode();let i=n.astProvider.identifier({kind:e,name:r.value,start:r.start,end:r.end,range:r.range,scope:n.currentScope});return e!==In.ASTIdentifierKind.Property&&n.currentScope.namespaces.push(i),i}parseInvalidCode(){let e=this,n=e.token,r=e.astProvider.invalidCodeExpression({start:n.start,end:n.end,range:n.range});return e.next(),r}raise(e,n){let r=this,i=new GM.ParserException(e,n);return r.statementErrors.push(i),i}};ru.default=ab});var ke=m(Re=>{"use strict";var VM=Re&&Re.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),wr=Re&&Re.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&VM(e,t,n)},Oh=Re&&Re.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Re,"__esModule",{value:!0});Re.ASTRange=Re.ASTPosition=Re.LineRegistry=Re.ParserValidatorm=Re.Parser=Re.LexerValidator=Re.Lexer=void 0;var XM=Hm();Object.defineProperty(Re,"Lexer",{enumerable:!0,get:function(){return Oh(XM).default}});wr(Fi(),Re);var YM=Mm();Object.defineProperty(Re,"LexerValidator",{enumerable:!0,get:function(){return Oh(YM).default}});var JM=mk();Object.defineProperty(Re,"Parser",{enumerable:!0,get:function(){return Oh(JM).default}});wr(Gy(),Re);var QM=Vy();Object.defineProperty(Re,"ParserValidatorm",{enumerable:!0,get:function(){return Oh(QM).default}});var ZM=ob();Object.defineProperty(Re,"LineRegistry",{enumerable:!0,get:function(){return ZM.LineRegistry}});wr(ib(),Re);wr(Qy(),Re);wr(Bm(),Re);wr(th(),Re);wr(nh(),Re);wr(Ao(),Re);wr(qm(),Re);wr(Oo(),Re);var eL=Ha();Object.defineProperty(Re,"ASTPosition",{enumerable:!0,get:function(){return eL.Position}});var tL=Ya();Object.defineProperty(Re,"ASTRange",{enumerable:!0,get:function(){return tL.Range}});wr(Yy(),Re)});var iu=m(Rh=>{"use strict";Object.defineProperty(Rh,"__esModule",{value:!0});Rh.isValidIdentifierLiteral=void 0;var nL=ke(),rL=t=>{if(t.type!==nL.ASTType.StringLiteral)return!1;let e=t.value.toString();return/^[_a-z][_a-z0-9]*$/i.test(e)};Rh.isValidIdentifierLiteral=rL});var ub=m(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.getStringHashCode=Ui.getHashCode=Ui.rotateBits=void 0;function iL(t){return t>>1|t<<31}Ui.rotateBits=iL;function sL(t,e=0){let n=t>>>0;return n=(n>>16^n)*73244475,n=(n>>16^n)*73244475,n=n>>16^n,(e<<5)-e+n|0}Ui.getHashCode=sL;Ui.getStringHashCode=function(){let t=new Map,e=n=>{let r,i;for(r=0,i=0;r<n.length;r++)i=Math.imul(31,i)+n.charCodeAt(r)|0;return i};return n=>{if(n.length===0)return 0;let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i}}()});var yk=m(Ph=>{"use strict";Object.defineProperty(Ph,"__esModule",{value:!0});Ph.createExpressionHash=void 0;var ze=ke(),wt=ub(),oL=iu(),Yt=(t,e)=>t.$$hash=e,aL=t=>t.$$hash??null;function st(t){let e=aL(t);if(e!==null)return e;let n=(0,wt.getStringHashCode)(t.type);switch(t.type){case ze.ASTType.BinaryExpression:{let r=t;return n^=(0,wt.getStringHashCode)(r.operator),n^=st(r.left),n^=st(r.right),Yt(t,n)}case ze.ASTType.LogicalExpression:{let r=t;return n^=(0,wt.getStringHashCode)(r.operator),n^=st(r.left),n^=st(r.right),Yt(t,n)}case ze.ASTType.IsaExpression:{let r=t;return n^=(0,wt.getStringHashCode)(r.operator),n^=st(r.left),n^=st(r.right),Yt(t,n)}case ze.ASTType.ComparisonGroupExpression:{let r=t;for(let i=0;i<r.expressions.length;i++)n^=st(r.expressions[i]);for(let i=0;i<r.operators.length;i++)n^=(0,wt.getStringHashCode)(r.operators[i]);return Yt(t,n)}case ze.ASTType.FunctionDeclaration:{let r=t;n^=(0,wt.getHashCode)(r.parameters.length);for(let i=0;i<r.parameters.length;i++){let s=r.parameters[i];if(s.type===ze.ASTType.Identifier){n^=(0,wt.getStringHashCode)(s.name);continue}let o=s;n^=(0,wt.getStringHashCode)(o.variable.name),n^=st(o.init)}return Yt(t,n)}case ze.ASTType.ParenthesisExpression:return st(t.expression);case ze.ASTType.MemberExpression:{let r=t;if(r.base.type===ze.ASTType.Identifier){let i=r.base.name;if(i==="globals"||i==="locals"||i==="outer")return n=(0,wt.getStringHashCode)(ze.ASTType.Identifier),n^=(0,wt.getStringHashCode)(r.identifier.name),Yt(t,n)}return n^=st(r.base),n^=st(r.identifier),Yt(t,n)}case ze.ASTType.IndexExpression:{let r=t;if((0,oL.isValidIdentifierLiteral)(r.index)){if(r.base.type===ze.ASTType.Identifier){let s=r.base.name;if(s==="globals"||s==="locals"||s==="outer")return n=(0,wt.getStringHashCode)(ze.ASTType.Identifier),n^=(0,wt.getStringHashCode)(r.index.value.toString()),Yt(t,n)}n=(0,wt.getStringHashCode)(ze.ASTType.MemberExpression),n^=st(r.base);let i=(0,wt.getStringHashCode)(ze.ASTType.Identifier);i^=(0,wt.getStringHashCode)(r.index.value.toString()),n^=i}else n^=st(r.base),n^=st(r.index);return Yt(t,n)}case ze.ASTType.CallExpression:{let r=t;n^=st(r.base),n^=(0,wt.getHashCode)(r.arguments.length);for(let i=0;i<r.arguments.length;i++){let s=r.arguments[i];n^=st(s)}return Yt(t,n)}case ze.ASTType.NegationExpression:case ze.ASTType.BinaryNegatedExpression:case ze.ASTType.UnaryExpression:{let r=t;return n^=r.operator?(0,wt.getStringHashCode)(r.operator):1,n^=st(r.argument),Yt(t,n)}case ze.ASTType.Identifier:{let r=t;return n^=(0,wt.getStringHashCode)(r.name),Yt(t,n)}case ze.ASTType.BooleanLiteral:case ze.ASTType.NumericLiteral:case ze.ASTType.StringLiteral:case ze.ASTType.NilLiteral:return n^=(0,wt.getStringHashCode)(t.value.toString()),Yt(t,n);case ze.ASTType.MapConstructorExpression:{let r=t;n^=(0,wt.getHashCode)(r.fields.length);for(let i=0;i<r.fields.length;i++){let s=r.fields[i];n^=st(s.key),n^=st(s.value)}return Yt(t,n)}case ze.ASTType.ListConstructorExpression:{let r=t;n^=(0,wt.getHashCode)(r.fields.length);for(let i=0;i<r.fields.length;i++){let s=r.fields[i];n^=st(s.value)}return Yt(t,n)}case ze.ASTType.SliceExpression:{let r=t;return n^=st(r.base),n^=st(r.left),n^=st(r.right),Yt(t,n)}}return Yt(t,n)}function uL(t){return st(t)}Ph.createExpressionHash=uL});var cb=m(Dh=>{"use strict";Object.defineProperty(Dh,"__esModule",{value:!0});Dh.createExpressionId=void 0;var Tt=ke(),cL=iu(),Pt=(t,e)=>t.$$id=e,lL=t=>t.$$id??null;function Qe(t){let e=lL(t);if(e!==null)return e;switch(t.type){case Tt.ASTType.BinaryExpression:{let n=t;return Pt(t,Qe(n.left)+n.operator+Qe(n.right))}case Tt.ASTType.LogicalExpression:{let n=t;return Pt(t,Qe(n.left)+n.operator+Qe(n.right))}case Tt.ASTType.IsaExpression:{let n=t;return Pt(t,Qe(n.left)+n.operator+Qe(n.right))}case Tt.ASTType.ComparisonGroupExpression:{let n=t,r=n.expressions.map(s=>Qe(s)),i=[r[0]];for(let s=0;s<n.operators.length;s++)i.push(n.operators[s],r[s+1]);return Pt(t,i.join(" "))}case Tt.ASTType.FunctionDeclaration:{let n=t,r="function",i=[];for(let s=0;s<n.parameters.length;s++){let o=n.parameters[s];if(o.type===Tt.ASTType.Identifier){i.push(o.name);continue}let a=o;i.push(a.variable.name+"="+Qe(a.init))}return i.length>0&&(r+="("+i.join(",")+")"),Pt(t,r)}case Tt.ASTType.ParenthesisExpression:return Pt(t,Qe(t.expression));case Tt.ASTType.MemberExpression:{let n=t;return Pt(t,Qe(n.base)+"."+n.identifier.name)}case Tt.ASTType.IndexExpression:{let n=t;return(0,cL.isValidIdentifierLiteral)(n.index)?Pt(t,Qe(n.base)+"."+n.index.value.toString()):Pt(t,Qe(n.base)+"["+Qe(n.index)+"]")}case Tt.ASTType.CallExpression:{let n=t,r=Qe(n.base),i=[];for(let s=0;s<n.arguments.length;s++){let o=n.arguments[s];i.push(Qe(o))}return i.length>0&&(r+="("+i.join(",")+")"),Pt(t,r)}case Tt.ASTType.NegationExpression:case Tt.ASTType.BinaryNegatedExpression:case Tt.ASTType.UnaryExpression:{let n=t;return n.operator==null?Pt(t,Qe(n.argument)):n.operator==="@"?Pt(t,n.operator+Qe(n.argument)):Pt(t,n.operator+" "+Qe(n.argument))}case Tt.ASTType.Identifier:return Pt(t,t.name);case Tt.ASTType.NumericLiteral:case Tt.ASTType.BooleanLiteral:case Tt.ASTType.StringLiteral:case Tt.ASTType.NilLiteral:return Pt(t,t.raw.toString());case Tt.ASTType.MapConstructorExpression:{let n=t,r=[];for(let i=0;i<n.fields.length;i++){let s=n.fields[i];r.push(Qe(s.key)+":"+Qe(s.value))}return Pt(t,"{"+r.join(",")+"}")}case Tt.ASTType.ListConstructorExpression:{let n=t,r=[];for(let i=0;i<n.fields.length;i++){let s=n.fields[i];r.push(Qe(s.value))}return Pt(t,"["+r.join(",")+"]")}case Tt.ASTType.SliceExpression:{let n=t;return Pt(t,Qe(n.base)+"["+Qe(n.left)+":"+Qe(n.right)+"]")}}return Pt(t,"")}function hL(t){return Qe(t)}Dh.createExpressionId=hL});var No=m(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.Markers=void 0;var dL;(function(t){t.start="/**",t.nostart="/***",t.delim="*",t.end="*/"})(dL=su.Markers||(su.Markers={}))});var Tr=m(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.rewireSpecs=gt.rewireSource=gt.seedTokens=gt.seedSpec=gt.seedBlock=gt.splitLines=gt.splitSpace=gt.splitCR=gt.hasCR=gt.isSpace=void 0;function fL(t){return/^\s+$/.test(t)}gt.isSpace=fL;function pL(t){return/\r$/.test(t)}gt.hasCR=pL;function gL(t){let e=t.match(/\r+$/);return e==null?["",t]:[t.slice(-e[0].length),t.slice(0,-e[0].length)]}gt.splitCR=gL;function mL(t){let e=t.match(/^\s+/);return e==null?["",t]:[t.slice(0,e[0].length),t.slice(e[0].length)]}gt.splitSpace=mL;function yL(t){return t.split(/\n/)}gt.splitLines=yL;function bL(t={}){return Object.assign({description:"",tags:[],source:[],problems:[]},t)}gt.seedBlock=bL;function _L(t={}){return Object.assign({tag:"",name:"",type:"",optional:!1,description:"",problems:[],source:[]},t)}gt.seedSpec=_L;function vL(t={}){return Object.assign({start:"",delimiter:"",postDelimiter:"",tag:"",postTag:"",name:"",postName:"",type:"",postType:"",description:"",end:"",lineEnd:""},t)}gt.seedTokens=vL;function SL(t){let e=t.source.reduce((n,r)=>n.set(r.number,r),new Map);for(let n of t.tags)n.source=n.source.map(r=>e.get(r.number));return t}gt.rewireSource=SL;function wL(t){let e=t.tags.reduce((n,r)=>r.source.reduce((i,s)=>i.set(s.number,s),n),new Map);return t.source=t.source.map(n=>e.get(n.number)||n),t}gt.rewireSpecs=wL});var bk=m(lb=>{"use strict";Object.defineProperty(lb,"__esModule",{value:!0});var TL=/^@\S+/;function EL({fence:t="```"}={}){let e=xL(t),n=(r,i)=>e(r)?!i:i;return function(i){let s=[[]],o=!1;for(let a of i)TL.test(a.tokens.description)&&!o?s.push([a]):s[s.length-1].push(a),o=n(a.tokens.description,o);return s}}lb.default=EL;function xL(t){return typeof t=="string"?e=>e.split(t).length%2===0:t}});var _k=m(hb=>{"use strict";Object.defineProperty(hb,"__esModule",{value:!0});var kL=No(),ou=Tr();function AL({startLine:t=0,markers:e=kL.Markers}={}){let n=null,r=t;return function(s){let o=s,a=(0,ou.seedTokens)();if([a.lineEnd,o]=(0,ou.splitCR)(o),[a.start,o]=(0,ou.splitSpace)(o),n===null&&o.startsWith(e.start)&&!o.startsWith(e.nostart)&&(n=[],a.delimiter=o.slice(0,e.start.length),o=o.slice(e.start.length),[a.postDelimiter,o]=(0,ou.splitSpace)(o)),n===null)return r++,null;let u=o.trimRight().endsWith(e.end);if(a.delimiter===""&&o.startsWith(e.delim)&&!o.startsWith(e.end)&&(a.delimiter=e.delim,o=o.slice(e.delim.length),[a.postDelimiter,o]=(0,ou.splitSpace)(o)),u){let c=o.trimRight();a.end=o.slice(c.length-e.end.length),o=c.slice(0,-e.end.length)}if(a.description=o,n.push({number:r,source:s,tokens:a}),r++,u){let c=n.slice();return n=null,c}return null}}hb.default=AL});var vk=m(db=>{"use strict";Object.defineProperty(db,"__esModule",{value:!0});var CL=Tr();function OL({tokenizers:t}){return function(n){var r;let i=(0,CL.seedSpec)({source:n});for(let s of t)if(i=s(i),!((r=i.problems[i.problems.length-1])===null||r===void 0)&&r.critical)break;return i}}db.default=OL});var pb=m(fb=>{"use strict";Object.defineProperty(fb,"__esModule",{value:!0});function RL(){return t=>{let{tokens:e}=t.source[0],n=e.description.match(/\s*(@(\S+))(\s*)/);return n===null?(t.problems.push({code:"spec:tag:prefix",message:'tag should start with "@" symbol',line:t.source[0].number,critical:!0}),t):(e.tag=n[1],e.postTag=n[3],e.description=e.description.slice(n[0].length),t.tag=n[2],t)}}fb.default=RL});var mb=m(gb=>{"use strict";Object.defineProperty(gb,"__esModule",{value:!0});var PL=Tr();function DL(t="compact"){let e=ML(t);return n=>{let r=0,i=[];for(let[a,{tokens:u}]of n.source.entries()){let c="";if(a===0&&u.description[0]!=="{")return n;for(let l of u.description)if(l==="{"&&r++,l==="}"&&r--,c+=l,r===0)break;if(i.push([u,c]),r===0)break}if(r!==0)return n.problems.push({code:"spec:type:unpaired-curlies",message:"unpaired curlies",line:n.source[0].number,critical:!0}),n;let s=[],o=i[0][0].postDelimiter.length;for(let[a,[u,c]]of i.entries())u.type=c,a>0&&(u.type=u.postDelimiter.slice(o)+c,u.postDelimiter=u.postDelimiter.slice(0,o)),[u.postType,u.description]=(0,PL.splitSpace)(u.description.slice(c.length)),s.push(u.type);return s[0]=s[0].slice(1),s[s.length-1]=s[s.length-1].slice(0,-1),n.type=e(s),n}}gb.default=DL;var IL=t=>t.trim();function ML(t){return t==="compact"?e=>e.map(IL).join(""):t==="preserve"?e=>e.join(`
97
+ `):t}});var _b=m(bb=>{"use strict";Object.defineProperty(bb,"__esModule",{value:!0});var yb=Tr(),LL=t=>t&&t.startsWith('"')&&t.endsWith('"');function NL(){let t=(e,{tokens:n},r)=>n.type===""?e:r;return e=>{let{tokens:n}=e.source[e.source.reduce(t,0)],r=n.description.trimLeft(),i=r.split('"');if(i.length>1&&i[0]===""&&i.length%2===1)return e.name=i[1],n.name=`"${i[1]}"`,[n.postName,n.description]=(0,yb.splitSpace)(r.slice(n.name.length)),e;let s=0,o="",a=!1,u;for(let l of r){if(s===0&&(0,yb.isSpace)(l))break;l==="["&&s++,l==="]"&&s--,o+=l}if(s!==0)return e.problems.push({code:"spec:name:unpaired-brackets",message:"unpaired brackets",line:e.source[0].number,critical:!0}),e;let c=o;if(o[0]==="["&&o[o.length-1]==="]"){a=!0,o=o.slice(1,-1);let l=o.split("=");if(o=l[0].trim(),l[1]!==void 0&&(u=l.slice(1).join("=").trim()),o==="")return e.problems.push({code:"spec:name:empty-name",message:"empty name",line:e.source[0].number,critical:!0}),e;if(u==="")return e.problems.push({code:"spec:name:empty-default",message:"empty default value",line:e.source[0].number,critical:!0}),e;if(!LL(u)&&/=(?!>)/.test(u))return e.problems.push({code:"spec:name:invalid-default",message:"invalid default value syntax",line:e.source[0].number,critical:!0}),e}return e.optional=a,e.name=o,n.name=c,u!==void 0&&(e.default=u),[n.postName,n.description]=(0,yb.splitSpace)(r.slice(n.name.length)),e}}bb.default=NL});var Sb=m(au=>{"use strict";Object.defineProperty(au,"__esModule",{value:!0});au.getJoiner=void 0;var vb=No();function qL(t="compact",e=vb.Markers){let n=Sk(t);return r=>(r.description=n(r.source,e),r)}au.default=qL;function Sk(t){return t==="compact"?jL:t==="preserve"?BL:t}au.getJoiner=Sk;function jL(t,e=vb.Markers){return t.map(({tokens:{description:n}})=>n.trim()).filter(n=>n!=="").join(" ")}var FL=(t,{tokens:e},n)=>e.type===""?t:n,$L=({tokens:t})=>(t.delimiter===""?t.start:t.postDelimiter.slice(1))+t.description;function BL(t,e=vb.Markers){if(t.length===0)return"";t[0].tokens.description===""&&t[0].tokens.delimiter===e.start&&(t=t.slice(1));let n=t[t.length-1];return n!==void 0&&n.tokens.description===""&&n.tokens.end.endsWith(e.end)&&(t=t.slice(0,-1)),t=t.slice(t.reduce(FL,0)),t.map($L).join(`
98
+ `)}});var Tk=m(wb=>{"use strict";Object.defineProperty(wb,"__esModule",{value:!0});var WL=No(),UL=Tr(),HL=bk(),GL=_k(),zL=vk(),KL=pb(),VL=mb(),XL=_b(),wk=Sb();function YL({startLine:t=0,fence:e="```",spacing:n="compact",markers:r=WL.Markers,tokenizers:i=[(0,KL.default)(),(0,VL.default)(n),(0,XL.default)(),(0,wk.default)(n)]}={}){if(t<0||t%1>0)throw new Error("Invalid startLine");let s=(0,GL.default)({startLine:t,markers:r}),o=(0,HL.default)({fence:e}),a=(0,zL.default)({tokenizers:i}),u=(0,wk.getJoiner)(n);return function(c){let l=[];for(let h of(0,UL.splitLines)(c)){let d=s(h);if(d===null)continue;let g=o(d),y=g.slice(1).map(a);l.push({description:u(g[0],r),tags:y,source:d,problems:y.reduce((_,C)=>_.concat(C.problems),[])})}return l}}wb.default=YL});var Ek=m(Tb=>{"use strict";Object.defineProperty(Tb,"__esModule",{value:!0});function JL(t){return t.start+t.delimiter+t.postDelimiter+t.tag+t.postTag+t.type+t.postType+t.name+t.postName+t.description+t.end+t.lineEnd}function QL(){return t=>t.source.map(({tokens:e})=>JL(e)).join(`
99
+ `)}Tb.default=QL});var kk=m(uu=>{"use strict";var ZL=uu&&uu.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};Object.defineProperty(uu,"__esModule",{value:!0});var xk=No(),eN=Tr(),tN={start:0,tag:0,type:0,name:0},nN=(t=xk.Markers)=>(e,{tokens:n})=>({start:n.delimiter===t.start?n.start.length:e.start,tag:Math.max(e.tag,n.tag.length),type:Math.max(e.type,n.type.length),name:Math.max(e.name,n.name.length)}),ws=t=>"".padStart(t," ");function rN(t=xk.Markers){let e=!1,n;function r(i){let s=Object.assign({},i.tokens);s.tag!==""&&(e=!0);let o=s.tag===""&&s.name===""&&s.type===""&&s.description==="";if(s.end===t.end&&o)return s.start=ws(n.start+1),Object.assign(Object.assign({},i),{tokens:s});switch(s.delimiter){case t.start:s.start=ws(n.start);break;case t.delim:s.start=ws(n.start+1);break;default:s.delimiter="",s.start=ws(n.start+2)}if(!e)return s.postDelimiter=s.description===""?"":" ",Object.assign(Object.assign({},i),{tokens:s});let a={delim:!1,tag:!1,type:!1,name:!1};return s.description===""&&(a.name=!0,s.postName="",s.name===""&&(a.type=!0,s.postType="",s.type===""&&(a.tag=!0,s.postTag="",s.tag===""&&(a.delim=!0)))),s.postDelimiter=a.delim?"":" ",a.tag||(s.postTag=ws(n.tag-s.tag.length+1)),a.type||(s.postType=ws(n.type-s.type.length+1)),a.name||(s.postName=ws(n.name-s.name.length+1)),Object.assign(Object.assign({},i),{tokens:s})}return i=>{var{source:s}=i,o=ZL(i,["source"]);return n=s.reduce(nN(t),Object.assign({},tN)),(0,eN.rewireSource)(Object.assign(Object.assign({},o),{source:s.map(r)}))}}uu.default=rN});var Ak=m(cu=>{"use strict";var iN=cu&&cu.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};Object.defineProperty(cu,"__esModule",{value:!0});var sN=Tr(),oN=t=>e=>e.slice(t),aN=t=>{let e="".padStart(t," ");return n=>n+e};function uN(t){let e,n=i=>{if(e===void 0){let s=t-i.length;e=s>0?aN(s):oN(-s)}return e(i)},r=i=>Object.assign(Object.assign({},i),{tokens:Object.assign(Object.assign({},i.tokens),{start:n(i.tokens.start)})});return i=>{var{source:s}=i,o=iN(i,["source"]);return(0,sN.rewireSource)(Object.assign(Object.assign({},o),{source:s.map(r)}))}}cu.default=uN});var Ck=m(lu=>{"use strict";var cN=lu&&lu.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};Object.defineProperty(lu,"__esModule",{value:!0});var lN=Tr();function hN(t){function e(n){return Object.assign(Object.assign({},n),{tokens:Object.assign(Object.assign({},n.tokens),{lineEnd:t==="LF"?"":"\r"})})}return n=>{var{source:r}=n,i=cN(n,["source"]);return(0,lN.rewireSource)(Object.assign(Object.assign({},i),{source:r.map(e)}))}}lu.default=hN});var Ok=m(Ih=>{"use strict";Object.defineProperty(Ih,"__esModule",{value:!0});Ih.flow=void 0;function dN(...t){return e=>t.reduce((n,r)=>r(n),e)}Ih.flow=dN});var Ik=m(xb=>{"use strict";Object.defineProperty(xb,"__esModule",{value:!0});var fN=Tr(),Pk={line:0,start:0,delimiter:0,postDelimiter:0,tag:0,postTag:0,name:0,postName:0,type:0,postType:0,description:0,end:0,lineEnd:0},Rk={lineEnd:"CR"},Eb=Object.keys(Pk),Dk=t=>(0,fN.isSpace)(t)?`{${t.length}}`:t,pN=t=>"|"+t.join("|")+"|",gN=(t,e)=>Object.keys(e).map(n=>Dk(e[n]).padEnd(t[n]));function mN({source:t}){var e,n;if(t.length===0)return"";let r=Object.assign({},Pk);for(let s of Eb)r[s]=((e=Rk[s])!==null&&e!==void 0?e:s).length;for(let{number:s,tokens:o}of t){r.line=Math.max(r.line,s.toString().length);for(let a in o)r[a]=Math.max(r[a],Dk(o[a]).length)}let i=[[],[]];for(let s of Eb)i[0].push(((n=Rk[s])!==null&&n!==void 0?n:s).padEnd(r[s]));for(let s of Eb)i[1].push("-".padEnd(r[s],"-"));for(let{number:s,tokens:o}of t){let a=s.toString().padStart(r.line);i.push([a,...gN(r,o)])}return i.map(pN).join(`
100
+ `)}xb.default=mN});var kb=m(Dt=>{"use strict";var yN=Dt&&Dt.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),bN=Dt&&Dt.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&yN(e,t,n)};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.util=Dt.tokenizers=Dt.transforms=Dt.inspect=Dt.stringify=Dt.parse=void 0;var _N=Tk(),vN=Sb(),SN=_b(),wN=pb(),TN=mb(),EN=Ek(),xN=kk(),kN=Ak(),AN=Ck(),CN=Ok(),Mh=Tr();bN(No(),Dt);function ON(t,e={}){return(0,_N.default)(e)(t)}Dt.parse=ON;Dt.stringify=(0,EN.default)();var RN=Ik();Object.defineProperty(Dt,"inspect",{enumerable:!0,get:function(){return RN.default}});Dt.transforms={flow:CN.flow,align:xN.default,indent:kN.default,crlf:AN.default};Dt.tokenizers={tag:wN.default,type:TN.default,name:SN.default,description:vN.default};Dt.util={rewireSpecs:Mh.rewireSpecs,rewireSource:Mh.rewireSource,seedBlock:Mh.seedBlock,seedTokens:Mh.seedTokens}});var Ab=m(Lh=>{"use strict";Object.defineProperty(Lh,"__esModule",{value:!0});Lh.getSignaturePayloadDefinitionType=void 0;function PN(t){return t==null?null:typeof t=="object"?t.type:t}Lh.getSignaturePayloadDefinitionType=PN});var Hi=m(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});hu.SignatureDefinitionBaseType=void 0;var DN;(function(t){t.Function="function",t.Number="number",t.String="string",t.Map="map",t.List="list",t.Any="any",t.General="general"})(DN=hu.SignatureDefinitionBaseType||(hu.SignatureDefinitionBaseType={}))});var Cb=m(qh=>{"use strict";Object.defineProperty(qh,"__esModule",{value:!0});qh.TypeParser=void 0;var Nh=Hi(),IN=function(){function t(e){this._input=e,this._rx=/(\w+|<|>|,)/g,this._lastMatch=null}return t.prototype.next=function(){return this._lastMatch=this._rx.exec(this._input),this._lastMatch?this._lastMatch[0]:null},t.prototype.createDefault=function(){return{type:Nh.SignatureDefinitionBaseType.Any}},t.prototype.parseList=function(e){var n={type:e,valueType:Nh.SignatureDefinitionBaseType.Any};if(this.next()==="<"){var r=this.parse();if(n.valueType=r,this.next()!==">")return this.createDefault()}return n},t.prototype.parseMap=function(e){var n={type:e,keyType:Nh.SignatureDefinitionBaseType.Any,valueType:Nh.SignatureDefinitionBaseType.Any};if(this.next()==="<"){var r=this.parse();if(n.keyType=r,this.next()!==",")return this.createDefault();var i=this.parse();if(n.valueType=i,this.next()!==">")return this.createDefault()}return n},t.prototype.parse=function(){var e=this.next();if(!e)return this.createDefault();switch(e){case"list":return this.parseList(e);case"map":return this.parseMap(e)}return{type:e}},t}();qh.TypeParser=IN});var du=m(jh=>{"use strict";Object.defineProperty(jh,"__esModule",{value:!0});jh.SignatureDefinitionTypeMeta=void 0;var Ob=Ab(),rn=Hi(),MN=Cb(),LN=function(){function t(e){var n,r;this.type=e.type,this.keyType=(n=e.keyType)!==null&&n!==void 0?n:null,this.valueType=(r=e.valueType)!==null&&r!==void 0?r:null}return t.fromString=function(e){var n=new MN.TypeParser(e),r=n.parse();return t.parse(r)},t.parseValueString=function(e){var n=e,r=null,i=null;return n===rn.SignatureDefinitionBaseType.Map?(r=new t({type:rn.SignatureDefinitionBaseType.Any}),i=new t({type:rn.SignatureDefinitionBaseType.Any})):n===rn.SignatureDefinitionBaseType.List&&(r=new t({type:rn.SignatureDefinitionBaseType.Any})),new t({type:n,valueType:r,keyType:i})},t.parseValueObject=function(e){var n,r,i,s=e.type,o=null,a=null;if(s===rn.SignatureDefinitionBaseType.Map){var u=(n=(0,Ob.getSignaturePayloadDefinitionType)(e.keyType))!==null&&n!==void 0?n:rn.SignatureDefinitionBaseType.Any,c=(r=(0,Ob.getSignaturePayloadDefinitionType)(e.valueType))!==null&&r!==void 0?r:rn.SignatureDefinitionBaseType.Any;u===rn.SignatureDefinitionBaseType.Map||u===rn.SignatureDefinitionBaseType.List?a=t.parse(e.keyType):a=new t({type:u}),c===rn.SignatureDefinitionBaseType.Map||c===rn.SignatureDefinitionBaseType.List?o=t.parse(e.valueType):o=new t({type:c})}else if(s===rn.SignatureDefinitionBaseType.List){var c=(i=(0,Ob.getSignaturePayloadDefinitionType)(e.valueType))!==null&&i!==void 0?i:rn.SignatureDefinitionBaseType.Any;c===rn.SignatureDefinitionBaseType.Map||c===rn.SignatureDefinitionBaseType.List?o=t.parse(e.valueType):o=new t({type:c})}return new t({type:s,valueType:o,keyType:a})},t.parse=function(e){if(typeof e=="string")return t.parseValueString(e);if(typeof e=="object")return t.parseValueObject(e);throw new Error("Unable to parse type definition!")},t.prototype.isEqual=function(e){return this.type===e.type},t.prototype.isEqualSafe=function(e){return this.type===e.type&&this.keyType.type===e.keyType.type&&this.valueType.type===e.valueType.type},t.prototype.toString=function(){return this.keyType===null?this.valueType===null?this.type:"".concat(this.type,"<").concat(this.valueType.toString(),">"):"".concat(this.type,"<").concat(this.keyType.toString(),",").concat(this.valueType.toString(),">")},t.prototype.toJSON=function(){return this.keyType===null?this.valueType===null?this.type:{type:this.type,valueType:this.valueType.toJSON()}:{type:this.type,keyType:this.keyType.toJSON(),valueType:this.valueType.toJSON()}},t.prototype.copy=function(){var e,n;return new t({type:this.type,keyType:(e=this.keyType)===null||e===void 0?void 0:e.copy(),valueType:(n=this.valueType)===null||n===void 0?void 0:n.copy()})},t}();jh.SignatureDefinitionTypeMeta=LN});var Rb=m(Gi=>{"use strict";var Mk=Gi&&Gi.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},Lk=Gi&&Gi.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))};Object.defineProperty(Gi,"__esModule",{value:!0});Gi.SignatureDefinitionFunctionArg=void 0;var Nk=du(),NN=function(){function t(e){this._label=e.label,this._types=e.types.reduce(function(n,r){return n.set(r.type,r)},new Map),this._opt=e.opt,this._default=e.default}return t.parse=function(e){var n,r,i=[];if(e.type)i.push(Nk.SignatureDefinitionTypeMeta.parse(e.type));else if(e.types)i.push.apply(i,Lk([],Mk(e.types.map(Nk.SignatureDefinitionTypeMeta.parse)),!1));else throw new Error("Invalid signature definition function arg payload!");return new t({label:e.label,types:i,opt:(n=e.opt)!==null&&n!==void 0?n:!1,default:(r=e.default)!==null&&r!==void 0?r:null})},t.prototype.getLabel=function(){return this._label},t.prototype.isOptional=function(){return this._opt},t.prototype.getDefault=function(){return this._default},t.prototype.getTypes=function(){return Lk([],Mk(this._types.values()),!1)},t.prototype.isValidType=function(e){return this._types.has(e.type)},t.prototype.isValidTypeSafe=function(e){var n;return!!(!((n=this._types.get(e.type))===null||n===void 0)&&n.isEqualSafe(e))},t.prototype.toJSON=function(){return{label:this._label,types:this.getTypes().map(function(e){return e.toJSON()}),opt:this._opt,default:this._default}},t.prototype.copy=function(){return new t({label:this._label,types:this.getTypes().map(function(e){return e.copy()}),opt:this._opt,default:this._default})},t}();Gi.SignatureDefinitionFunctionArg=NN});var Fh=m($r=>{"use strict";var Ts=$r&&$r.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},Es=$r&&$r.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))},qN=$r&&$r.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty($r,"__esModule",{value:!0});$r.VariationRegistry=void 0;var jN=function(){function t(e){this._name=e,this._variations=new Set}return t.prototype.getName=function(){return this._name},t.prototype.push=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return this._variations=new Set(Es(Es([],Ts(e),!1),Ts(this._variations),!1)),this},t.prototype.getAll=function(){return Es([],Ts(this._variations),!1)},t}(),FN=function(){function t(){}return t.add=function(e,n){var r=new jN(e);return r.push.apply(r,Es([],Ts(n),!1)),this.variationContainers.set(e,r),this},t.get=function(e){var n;return(n=this.variationContainers.get(e))!==null&&n!==void 0?n:null},t.resolve=function(e){var n,r,i=new Set;try{for(var s=qN(e),o=s.next();!o.done;o=s.next()){var a=o.value;if(typeof a=="string"&&a.startsWith("!")){var u=a.slice(1),c=this.get(u);if(c!==null)i=new Set(Es(Es([],Ts(c.getAll()),!1),Ts(i),!1));else throw new Error("Cannot find variation container for ".concat(u));continue}i.add(a)}}catch(l){n={error:l}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return Es([],Ts(i),!1)},t.variationContainers=new Map,t}();$r.VariationRegistry=FN});var $h=m(zi=>{"use strict";var $N=zi&&zi.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},BN=zi&&zi.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))};Object.defineProperty(zi,"__esModule",{value:!0});zi.SignatureDefinition=void 0;var WN=Fh(),UN=du(),HN=function(){function t(e){this._type=e.type,this._isProtected=e.isProtected,this._description=e.description,this._example=e.example,this._variations=e.variations}return t.parse=function(e){var n,r,i;return new t({type:UN.SignatureDefinitionTypeMeta.parse(e.type),isProtected:!!e.isProtected,description:(n=e.description)!==null&&n!==void 0?n:null,example:(r=e.example)!==null&&r!==void 0?r:null,variations:(i=e.variations)!==null&&i!==void 0?i:null})},t.prototype.getType=function(){return this._type},t.prototype.isProtected=function(){return this._isProtected},t.prototype.getDescription=function(){return this._description},t.prototype.getExample=function(){return this._example},t.prototype.setDescription=function(e){var n;return this._description=e.description,this._example=(n=e.example)!==null&&n!==void 0?n:null,this},t.prototype.addVariation=function(e){return this._variations==null&&(this._variations=[]),this._variations.push(e),this},t.prototype.getVariations=function(){return WN.VariationRegistry.resolve(this._variations)},t.prototype.toJSON=function(){return{type:this._type.toJSON(),isProtected:this._isProtected,description:this._description,example:this._example?BN([],$N(this._example),!1):null}},t.prototype.withDescription=function(e){var n,r;return new t({type:this._type,isProtected:this._isProtected,description:(n=e?.description)!==null&&n!==void 0?n:this._description,example:(r=e?.example)!==null&&r!==void 0?r:this._example,variations:this._variations})},t.prototype.copy=function(){return new t({type:this._type.copy(),isProtected:this._isProtected,description:this._description,example:this._example,variations:this._variations})},t}();zi.SignatureDefinition=HN});var Pb=m(Yn=>{"use strict";var GN=Yn&&Yn.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=i[s])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Bh=Yn&&Yn.__assign||function(){return Bh=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Bh.apply(this,arguments)},zN=Yn&&Yn.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},KN=Yn&&Yn.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.SignatureDefinitionFunction=void 0;var VN=Hi(),XN=Fh(),YN=$h(),JN=Rb(),qk=du(),QN=function(t){GN(e,t);function e(n){var r=t.call(this,{type:n.type,isProtected:n.isProtected,description:n.description,example:n.example,variations:n.variations})||this;return r._argList=n.arguments.map(function(i){return i.getLabel()}),r._argRefs=n.arguments.reduce(function(i,s){return i.set(s.getLabel(),s)},new Map),r._returns=n.returns.reduce(function(i,s){return i.set(s.type,s)},new Map),r._returnVariations=n.returnVariations,r}return e.parse=function(n){var r,i,s,o,a,u;return new e({type:new qk.SignatureDefinitionTypeMeta({type:VN.SignatureDefinitionBaseType.Function}),isProtected:(r=n.isProtected)!==null&&r!==void 0?r:!1,description:(i=n.description)!==null&&i!==void 0?i:null,example:(s=n.example)!==null&&s!==void 0?s:null,arguments:(a=(o=n.arguments)===null||o===void 0?void 0:o.map(JN.SignatureDefinitionFunctionArg.parse))!==null&&a!==void 0?a:[],returns:n.returns.map(qk.SignatureDefinitionTypeMeta.parse),variations:n.variations,returnVariations:(u=n.returnVariations)!==null&&u!==void 0?u:null})},e.prototype.getArguments=function(){var n=this;return this._argList.map(function(r){return n._argRefs.get(r)})},e.prototype.getArgument=function(n){var r;return(r=this._argRefs.get(n))!==null&&r!==void 0?r:null},e.prototype.getReturns=function(){return KN([],zN(this._returns.values()),!1)},e.prototype.addReturnVariation=function(n){return this._returnVariations==null&&(this._returnVariations=[]),this._returnVariations.push(n),this},e.prototype.getReturnVariations=function(){return this._returnVariations==null&&(this._returnVariations=[]),XN.VariationRegistry.resolve(this._returnVariations)},e.prototype.toJSON=function(){return Bh(Bh({},t.prototype.toJSON.call(this)),{arguments:this.getArguments().map(function(n){return n.toJSON()}),returns:this.getReturns().map(function(n){return n.toJSON()})})},e.prototype.withDescription=function(n){var r,i;return new e({type:this._type,isProtected:this._isProtected,arguments:this.getArguments(),returns:this.getReturns(),description:(r=n?.description)!==null&&r!==void 0?r:this._description,example:(i=n?.example)!==null&&i!==void 0?i:this._example,variations:this._variations,returnVariations:this._returnVariations})},e.prototype.copy=function(){return new e({type:this._type.copy(),isProtected:this._isProtected,arguments:this.getArguments().map(function(n){return n.copy()}),returns:this.getReturns().map(function(n){return n.copy()}),description:this._description,example:this._example,variations:this._variations,returnVariations:this._returnVariations})},e}(YN.SignatureDefinition);Yn.SignatureDefinitionFunction=QN});var Fk=m((x4,jk)=>{"use strict";jk.exports=function(...t){try{return JSON.stringify(...t)}catch(e){return"[Cannot display object: "+e.message+"]"}}});var Db=m(($k,Bk)=>{"use strict";var ZN=Fk();Bk.exports=class extends Error{constructor(t){let e=t.filter(n=>n!=="").map(n=>typeof n=="string"?n:n instanceof Error?n.message:ZN(n));super(e.join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,$k.assert)}}});var Le=m((A4,Wk)=>{"use strict";var eq=Db();Wk.exports=function(t,...e){if(!t)throw e.length===1&&e[0]instanceof Error?e[0]:new eq(e)}});var xs=m((C4,Hk)=>{"use strict";var Ib=Le(),Uk={};Hk.exports=function(t,e,n){if(e===!1||e===null||e===void 0)return t;n=n||{},typeof n=="string"&&(n={separator:n});let r=Array.isArray(e);Ib(!r||!n.separator,"Separator option is not valid for array-based chain");let i=r?e:e.split(n.separator||"."),s=t;for(let o=0;o<i.length;++o){let a=i[o],u=n.iterables&&Uk.iterables(s);if(Array.isArray(s)||u==="set"){let c=Number(a);Number.isInteger(c)&&(a=c<0?s.length+c:c)}if(!s||typeof s=="function"&&n.functions===!1||!u&&s[a]===void 0){Ib(!n.strict||o+1===i.length,"Missing segment",a,"in reach path ",e),Ib(typeof s=="object"||n.functions===!0||typeof s!="function","Invalid segment",a,"in reach path ",e),s=n.default;break}u?u==="set"?s=[...s][a]:s=s.get(a):s=s[a]}return s};Uk.iterables=function(t){if(t instanceof Set)return"set";if(t instanceof Map)return"map"}});var Mb=m((hn,zk)=>{"use strict";var Gk={};hn=zk.exports={array:Array.prototype,buffer:Buffer&&Buffer.prototype,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype};Gk.typeMap=new Map([["[object Error]",hn.error],["[object Map]",hn.map],["[object Promise]",hn.promise],["[object Set]",hn.set],["[object WeakMap]",hn.weakMap],["[object WeakSet]",hn.weakSet]]);hn.getInternalProto=function(t){if(Array.isArray(t))return hn.array;if(Buffer&&t instanceof Buffer)return hn.buffer;if(t instanceof Date)return hn.date;if(t instanceof RegExp)return hn.regex;if(t instanceof Error)return hn.error;let e=Object.prototype.toString.call(t);return Gk.typeMap.get(e)||hn.generic}});var Lb=m(Kk=>{"use strict";Kk.keys=function(t,e={}){return e.symbols!==!1?Reflect.ownKeys(t):Object.getOwnPropertyNames(t)}});var dn=m((R4,Vk)=>{"use strict";var tq=xs(),Mn=Mb(),nq=Lb(),ci={needsProtoHack:new Set([Mn.set,Mn.map,Mn.weakSet,Mn.weakMap])};Vk.exports=ci.clone=function(t,e={},n=null){if(typeof t!="object"||t===null)return t;let r=ci.clone,i=n;if(e.shallow){if(e.shallow!==!0)return ci.cloneWithShallow(t,e);r=u=>u}else if(i){let u=i.get(t);if(u)return u}else i=new Map;let s=Mn.getInternalProto(t);if(s===Mn.buffer)return Buffer&&Buffer.from(t);if(s===Mn.date)return new Date(t.getTime());if(s===Mn.regex)return new RegExp(t);let o=ci.base(t,s,e);if(o===t)return t;if(i&&i.set(t,o),s===Mn.set)for(let u of t)o.add(r(u,e,i));else if(s===Mn.map)for(let[u,c]of t)o.set(u,r(c,e,i));let a=nq.keys(t,e);for(let u of a){if(u==="__proto__")continue;if(s===Mn.array&&u==="length"){o.length=t.length;continue}let c=Object.getOwnPropertyDescriptor(t,u);c?c.get||c.set?Object.defineProperty(o,u,c):c.enumerable?o[u]=r(t[u],e,i):Object.defineProperty(o,u,{enumerable:!1,writable:!0,configurable:!0,value:r(t[u],e,i)}):Object.defineProperty(o,u,{enumerable:!0,writable:!0,configurable:!0,value:r(t[u],e,i)})}return o};ci.cloneWithShallow=function(t,e){let n=e.shallow;e=Object.assign({},e),e.shallow=!1;let r=new Map;for(let i of n){let s=tq(t,i);(typeof s=="object"||typeof s=="function")&&r.set(s,s)}return ci.clone(t,e,r)};ci.base=function(t,e,n){if(n.prototype===!1)return ci.needsProtoHack.has(e)?new e.constructor:e===Mn.array?[]:{};let r=Object.getPrototypeOf(t);if(r&&r.isImmutable)return t;if(e===Mn.array){let i=[];return r!==e&&Object.setPrototypeOf(i,r),i}if(ci.needsProtoHack.has(e)){let i=new r.constructor;return r!==e&&Object.setPrototypeOf(i,r),i}return Object.create(r)}});var Xk=m((P4,rq)=>{rq.exports={name:"joi",description:"Object schema validation",version:"17.13.3",repository:"git://github.com/hapijs/joi",main:"lib/index.js",types:"lib/index.d.ts",browser:"dist/joi-browser.min.js",files:["lib/**/*","dist/*"],keywords:["schema","validation"],dependencies:{"@hapi/hoek":"^9.3.0","@hapi/topo":"^5.1.0","@sideway/address":"^4.1.5","@sideway/formula":"^3.0.1","@sideway/pinpoint":"^2.0.0"},devDependencies:{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"^25.1.3","@types/node":"^14.18.63",typescript:"4.3.x"},scripts:{prepublishOnly:"cd browser && npm install && npm run build",test:"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},license:"BSD-3-Clause"}});var Wh=m(fu=>{"use strict";var P=Uh(),ge={};ge.wrap=P.string().min(1).max(2).allow(!1);fu.preferences=P.object({allowUnknown:P.boolean(),abortEarly:P.boolean(),artifacts:P.boolean(),cache:P.boolean(),context:P.object(),convert:P.boolean(),dateFormat:P.valid("date","iso","string","time","utc"),debug:P.boolean(),errors:{escapeHtml:P.boolean(),label:P.valid("path","key",!1),language:[P.string(),P.object().ref()],render:P.boolean(),stack:P.boolean(),wrap:{label:ge.wrap,array:ge.wrap,string:ge.wrap}},externals:P.boolean(),messages:P.object(),noDefaults:P.boolean(),nonEnumerables:P.boolean(),presence:P.valid("required","optional","forbidden"),skipFunctions:P.boolean(),stripUnknown:P.object({arrays:P.boolean(),objects:P.boolean()}).or("arrays","objects").allow(!0,!1),warnings:P.boolean()}).strict();ge.nameRx=/^[a-zA-Z0-9]\w*$/;ge.rule=P.object({alias:P.array().items(P.string().pattern(ge.nameRx)).single(),args:P.array().items(P.string(),P.object({name:P.string().pattern(ge.nameRx).required(),ref:P.boolean(),assert:P.alternatives([P.function(),P.object().schema()]).conditional("ref",{is:!0,then:P.required()}),normalize:P.function(),message:P.string().when("assert",{is:P.function(),then:P.required()})})),convert:P.boolean(),manifest:P.boolean(),method:P.function().allow(!1),multi:P.boolean(),validate:P.function()});fu.extension=P.object({type:P.alternatives([P.string(),P.object().regex()]).required(),args:P.function(),cast:P.object().pattern(ge.nameRx,P.object({from:P.function().maxArity(1).required(),to:P.function().minArity(1).maxArity(2).required()})),base:P.object().schema().when("type",{is:P.object().regex(),then:P.forbidden()}),coerce:[P.function().maxArity(3),P.object({method:P.function().maxArity(3).required(),from:P.array().items(P.string()).single()})],flags:P.object().pattern(ge.nameRx,P.object({setter:P.string(),default:P.any()})),manifest:{build:P.function().arity(2)},messages:[P.object(),P.string()],modifiers:P.object().pattern(ge.nameRx,P.function().minArity(1).maxArity(2)),overrides:P.object().pattern(ge.nameRx,P.function()),prepare:P.function().maxArity(3),rebuild:P.function().arity(1),rules:P.object().pattern(ge.nameRx,ge.rule),terms:P.object().pattern(ge.nameRx,P.object({init:P.array().allow(null).required(),manifest:P.object().pattern(/.+/,[P.valid("schema","single"),P.object({mapped:P.object({from:P.string().required(),to:P.string().required()}).required()})])})),validate:P.function().maxArity(3)}).strict();fu.extensions=P.array().items(P.object(),P.function().arity(1)).strict();ge.desc={buffer:P.object({buffer:P.string()}),func:P.object({function:P.function().required(),options:{literal:!0}}),override:P.object({override:!0}),ref:P.object({ref:P.object({type:P.valid("value","global","local"),path:P.array().required(),separator:P.string().length(1).allow(!1),ancestor:P.number().min(0).integer().allow("root"),map:P.array().items(P.array().length(2)).min(1),adjust:P.function(),iterables:P.boolean(),in:P.boolean(),render:P.boolean()}).required()}),regex:P.object({regex:P.string().min(3)}),special:P.object({special:P.valid("deep").required()}),template:P.object({template:P.string().required(),options:P.object()}),value:P.object({value:P.alternatives([P.object(),P.array()]).required()})};ge.desc.entity=P.alternatives([P.array().items(P.link("...")),P.boolean(),P.function(),P.number(),P.string(),ge.desc.buffer,ge.desc.func,ge.desc.ref,ge.desc.regex,ge.desc.special,ge.desc.template,ge.desc.value,P.link("/")]);ge.desc.values=P.array().items(null,P.boolean(),P.function(),P.number().allow(1/0,-1/0),P.string().allow(""),P.symbol(),ge.desc.buffer,ge.desc.func,ge.desc.override,ge.desc.ref,ge.desc.regex,ge.desc.template,ge.desc.value);ge.desc.messages=P.object().pattern(/.+/,[P.string(),ge.desc.template,P.object().pattern(/.+/,[P.string(),ge.desc.template])]);fu.description=P.object({type:P.string().required(),flags:P.object({cast:P.string(),default:P.any(),description:P.string(),empty:P.link("/"),failover:ge.desc.entity,id:P.string(),label:P.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:P.boolean(),unit:P.string()}).unknown(),preferences:{allowUnknown:P.boolean(),abortEarly:P.boolean(),artifacts:P.boolean(),cache:P.boolean(),convert:P.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:P.boolean(),label:["path","key"],language:[P.string(),ge.desc.ref],wrap:{label:ge.wrap,array:ge.wrap}},externals:P.boolean(),messages:ge.desc.messages,noDefaults:P.boolean(),nonEnumerables:P.boolean(),presence:["required","optional","forbidden"],skipFunctions:P.boolean(),stripUnknown:P.object({arrays:P.boolean(),objects:P.boolean()}).or("arrays","objects").allow(!0,!1),warnings:P.boolean()},allow:ge.desc.values,invalid:ge.desc.values,rules:P.array().min(1).items({name:P.string().required(),args:P.object().min(1),keep:P.boolean(),message:[P.string(),ge.desc.messages],warn:P.boolean()}),keys:P.object().pattern(/.*/,P.link("/")),link:ge.desc.ref}).pattern(/^[a-z]\w*$/,P.any())});var Jk=m((I4,Yk)=>{"use strict";var Ki={};Yk.exports=function(t){if(!t)return"";let e="";for(let n=0;n<t.length;++n){let r=t.charCodeAt(n);Ki.isSafe(r)?e+=t[n]:e+=Ki.escapeHtmlChar(r)}return e};Ki.escapeHtmlChar=function(t){let e=Ki.namedHtml.get(t);return e||(t>=256?"&#"+t+";":`&#x${t.toString(16).padStart(2,"0")};`)};Ki.isSafe=function(t){return Ki.safeCharCodes.has(t)};Ki.namedHtml=new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[34,"&quot;"],[160,"&nbsp;"],[162,"&cent;"],[163,"&pound;"],[164,"&curren;"],[169,"&copy;"],[174,"&reg;"]]);Ki.safeCharCodes=function(){let t=new Set;for(let e=32;e<123;++e)(e>=97||e>=65&&e<=90||e>=48&&e<=57||e===32||e===46||e===44||e===45||e===58||e===95)&&t.add(e);return t}()});var Qk=m(pu=>{"use strict";var Pe={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};pu.Parser=class{constructor(t,e={}){if(!e[Pe.settings]&&e.constants)for(let n in e.constants){let r=e.constants[n];if(r!==null&&!["boolean","number","string"].includes(typeof r))throw new Error(`Formula constant ${n} contains invalid ${typeof r} value type`)}this.settings=e[Pe.settings]?e:Object.assign({[Pe.settings]:!0,constants:{},functions:{}},e),this.single=null,this._parts=null,this._parse(t)}_parse(t){let e=[],n="",r=0,i=!1,s=a=>{if(r)throw new Error("Formula missing closing parenthesis");let u=e.length?e[e.length-1]:null;if(!(!i&&!n&&!a)){if(u&&u.type==="reference"&&a===")"){u.type="function",u.value=this._subFormula(n,u.value),n="";return}if(a===")"){let c=new pu.Parser(n,this.settings);e.push({type:"segment",value:c})}else if(i){if(i==="]"){e.push({type:"reference",value:n}),n="";return}e.push({type:"literal",value:n})}else if(Pe.operatorCharacters.includes(n))u&&u.type==="operator"&&Pe.operators.includes(u.value+n)?u.value+=n:e.push({type:"operator",value:n});else if(n.match(Pe.numberRx))e.push({type:"constant",value:parseFloat(n)});else if(this.settings.constants[n]!==void 0)e.push({type:"constant",value:this.settings.constants[n]});else{if(!n.match(Pe.tokenRx))throw new Error(`Formula contains invalid token: ${n}`);e.push({type:"reference",value:n})}n=""}};for(let a of t)i?a===i?(s(),i=!1):n+=a:r?a==="("?(n+=a,++r):a===")"?(--r,r?n+=a:s(a)):n+=a:a in Pe.literals?i=Pe.literals[a]:a==="("?(s(),++r):Pe.operatorCharacters.includes(a)?(s(),n=a,s()):a!==" "?n+=a:s();s(),e=e.map((a,u)=>a.type!=="operator"||a.value!=="-"||u&&e[u-1].type!=="operator"?a:{type:"operator",value:"n"});let o=!1;for(let a of e){if(a.type==="operator"){if(Pe.operatorsPrefix.includes(a.value))continue;if(!o)throw new Error("Formula contains an operator in invalid position");if(!Pe.operators.includes(a.value))throw new Error(`Formula contains an unknown operator ${a.value}`)}else if(o)throw new Error("Formula missing expected operator");o=!o}if(!o)throw new Error("Formula contains invalid trailing operator");e.length===1&&["reference","literal","constant"].includes(e[0].type)&&(this.single={type:e[0].type==="reference"?"reference":"value",value:e[0].value}),this._parts=e.map(a=>{if(a.type==="operator")return Pe.operatorsPrefix.includes(a.value)?a:a.value;if(a.type!=="reference")return a.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(a.value))throw new Error(`Formula contains invalid reference ${a.value}`);return this.settings.reference?this.settings.reference(a.value):Pe.reference(a.value)})}_subFormula(t,e){let n=this.settings.functions[e];if(typeof n!="function")throw new Error(`Formula contains unknown function ${e}`);let r=[];if(t){let i="",s=0,o=!1,a=()=>{if(!i)throw new Error(`Formula contains function ${e} with invalid arguments ${t}`);r.push(i),i=""};for(let u=0;u<t.length;++u){let c=t[u];o?(i+=c,c===o&&(o=!1)):c in Pe.literals&&!s?(i+=c,o=Pe.literals[c]):c===","&&!s?a():(i+=c,c==="("?++s:c===")"&&--s)}a()}return r=r.map(i=>new pu.Parser(i,this.settings)),function(i){let s=[];for(let o of r)s.push(o.evaluate(i));return n.call(i,...s)}}evaluate(t){let e=this._parts.slice();for(let n=e.length-2;n>=0;--n){let r=e[n];if(r&&r.type==="operator"){let i=e[n+1];e.splice(n+1,1);let s=Pe.evaluate(i,t);e[n]=Pe.single(r.value,s)}}return Pe.operatorsOrder.forEach(n=>{for(let r=1;r<e.length-1;)if(n.includes(e[r])){let i=e[r],s=Pe.evaluate(e[r-1],t),o=Pe.evaluate(e[r+1],t);e.splice(r,2);let a=Pe.calculate(i,s,o);e[r-1]=a===0?0:a}else r+=2}),Pe.evaluate(e[0],t)}};pu.Parser.prototype[Pe.symbol]=!0;Pe.reference=function(t){return function(e){return e&&e[t]!==void 0?e[t]:null}};Pe.evaluate=function(t,e){return t===null?null:typeof t=="function"?t(e):t[Pe.symbol]?t.evaluate(e):t};Pe.single=function(t,e){if(t==="!")return!e;let n=-e;return n===0?0:n};Pe.calculate=function(t,e,n){if(t==="??")return Pe.exists(e)?e:n;if(typeof e=="string"||typeof n=="string"){if(t==="+")return e=Pe.exists(e)?e:"",n=Pe.exists(n)?n:"",e+n}else switch(t){case"^":return Math.pow(e,n);case"*":return e*n;case"/":return e/n;case"%":return e%n;case"+":return e+n;case"-":return e-n}switch(t){case"<":return e<n;case"<=":return e<=n;case">":return e>n;case">=":return e>=n;case"==":return e===n;case"!=":return e!==n;case"&&":return e&&n;case"||":return e||n}return null};Pe.exists=function(t){return t!=null}});var eA=m(Zk=>{"use strict";var iq=dn(),sq=Ze(),ks={annotations:Symbol("annotations")};Zk.error=function(t){if(!this._original||typeof this._original!="object")return this.details[0].message;let e=t?"":"\x1B[31m",n=t?"":"\x1B[41m",r=t?"":"\x1B[0m",i=iq(this._original);for(let a=this.details.length-1;a>=0;--a){let u=a+1,c=this.details[a],l=c.path,h=i;for(let d=0;;++d){let g=l[d];if(sq.isSchema(h)&&(h=h.clone()),d+1<l.length&&typeof h[g]!="string")h=h[g];else{let y=h[ks.annotations]||{errors:{},missing:{}};h[ks.annotations]=y;let _=g||c.context.key;h[g]!==void 0?(y.errors[_]=y.errors[_]||[],y.errors[_].push(u)):y.missing[_]=u;break}}}let s={key:/_\$key\$_([, \d]+)_\$end\$_"/g,missing:/"_\$miss\$_([^|]+)\|(\d+)_\$end\$_": "__missing__"/g,arrayIndex:/\s*"_\$idx\$_([, \d]+)_\$end\$_",?\n(.*)/g,specials:/"\[(NaN|Symbol.*|-?Infinity|function.*|\(.*)]"/g},o=ks.safeStringify(i,2).replace(s.key,(a,u)=>`" ${e}[${u}]${r}`).replace(s.missing,(a,u,c)=>`${n}"${u}"${r}${e} [${c}]: -- missing --${r}`).replace(s.arrayIndex,(a,u,c)=>`
101
101
  ${c} ${e}[${u}]${r}`).replace(s.specials,(a,u)=>u);o=`${o}
102
102
  ${e}`;for(let a=0;a<this.details.length;++a){let u=a+1;o=`${o}
103
- [${u}] ${this.details[a].message}`}return o=o+r,o};Es.safeStringify=function(t,e){return JSON.stringify(t,Es.serializer(),e)};Es.serializer=function(){let t=[],e=[],n=(r,i)=>e[0]===i?"[Circular ~]":"[Circular ~."+t.slice(0,e.indexOf(i)).join(".")+"]";return function(r,i){if(e.length>0){let s=e.indexOf(this);~s?(e.length=s+1,t.length=s+1,t[s]=r):(e.push(this),t.push(r)),~e.indexOf(i)&&(i=n.call(this,r,i))}else e.push(i);if(i){let s=i[Es.annotations];if(s){if(Array.isArray(i)){let o=[];for(let a=0;a<i.length;++a)s.errors[a]&&o.push(`_$idx$_${s.errors[a].sort().join(", ")}_$end$_`),o.push(i[a]);i=o}else{for(let o in s.errors)i[`${o}_$key$_${s.errors[o].sort().join(", ")}_$end$_`]=i[o],i[o]=void 0;for(let o in s.missing)i[`_$miss$_${o}|${s.missing[o]}_$end$_`]="__missing__"}return i}}return i===1/0||i===-1/0||Number.isNaN(i)||typeof i=="function"||typeof i=="symbol"?"["+i.toString()+"]":i}}});var ui=m(At=>{"use strict";var $N=Uk(),BN=Ze(),UN=Ui();At.Report=class{constructor(t,e,n,r,i,s,o){if(this.code=t,this.flags=r,this.messages=i,this.path=s.path,this.prefs=o,this.state=s,this.value=e,this.message=null,this.template=null,this.local=n||{},this.local.label=At.label(this.flags,this.state,this.prefs,this.messages),this.value!==void 0&&!this.local.hasOwnProperty("value")&&(this.local.value=this.value),this.path.length){let a=this.path[this.path.length-1];typeof a!="object"&&(this.local.key=a)}}_setTemplate(t){if(this.template=t,!this.flags.label&&this.path.length===0){let e=this._template(this.template,"root");e&&(this.local.label=e)}}toString(){if(this.message)return this.message;let t=this.code;if(!this.prefs.errors.render)return this.code;let e=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return e===void 0?`Error code "${t}" is not defined, your custom type is missing the correct messages definition`:(this.message=e.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(t,e){return At.template(this.value,t,e||this.code,this.state,this.prefs)}};At.path=function(t){let e="";for(let n of t)typeof n!="object"&&(typeof n=="string"?(e&&(e+="."),e+=n):e+=`[${n}]`);return e};At.template=function(t,e,n,r,i){if(!e)return;if(UN.isTemplate(e))return n!=="root"?e:null;let s=i.errors.language;if(BN.isResolvable(s)&&(s=s.resolve(t,r,i)),s&&e[s]){if(e[s][n]!==void 0)return e[s][n];if(e[s]["*"]!==void 0)return e[s]["*"]}return e[n]?e[n]:e["*"]};At.label=function(t,e,n,r){if(!n.errors.label)return"";if(t.label)return t.label;let i=e.path;n.errors.label==="key"&&e.path.length>1&&(i=e.path.slice(-1));let s=At.path(i);return s||At.template(null,n.messages,"root",e,n)||r&&At.template(null,r,"root",e,n)||"value"};At.process=function(t,e,n){if(!t)return null;let{override:r,message:i,details:s}=At.details(t);if(r)return r;if(n.errors.stack)return new At.ValidationError(i,s,e);let o=Error.stackTraceLimit;Error.stackTraceLimit=0;let a=new At.ValidationError(i,s,e);return Error.stackTraceLimit=o,a};At.details=function(t,e={}){let n=[],r=[];for(let i of t){if(i instanceof Error){if(e.override!==!1)return{override:i};let o=i.toString();n.push(o),r.push({message:o,type:"override",context:{error:i}});continue}let s=i.toString();n.push(s),r.push({message:s,path:i.path.filter(o=>typeof o!="object"),type:i.code,context:i.local})}return n.length>1&&(n=[...new Set(n)]),{message:n.join(". "),details:r}};At.ValidationError=class extends Error{constructor(t,e,n){super(t),this._original=n,this.details=e}static isError(t){return t instanceof At.ValidationError}};At.ValidationError.prototype.isJoi=!0;At.ValidationError.prototype.name="ValidationError";At.ValidationError.prototype.annotate=$N.error});var ci=m(Jn=>{"use strict";var Xn=Me(),WN=ln(),HN=Ts(),pu=Ze(),xb,Yn={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};Jn.create=function(t,e={}){Xn(typeof t=="string","Invalid reference key:",t),pu.assertOptions(e,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),Xn(!e.prefix||typeof e.prefix=="object","options.prefix must be of type object");let n=Object.assign({},Yn.defaults,e);delete n.prefix;let r=n.separator,i=Yn.context(t,r,e.prefix);if(n.type=i.type,t=i.key,n.type==="value")if(i.root&&(Xn(!r||t[0]!==r,"Cannot specify relative path with root prefix"),n.ancestor="root",t||(t=null)),r&&r===t)t=null,n.ancestor=0;else if(n.ancestor!==void 0)Xn(!r||!t||t[0]!==r,"Cannot combine prefix with ancestor option");else{let[s,o]=Yn.ancestor(t,r);o&&(t=t.slice(o),t===""&&(t=null)),n.ancestor=s}return n.path=r?t===null?[]:t.split(r):[t],new Yn.Ref(n)};Jn.in=function(t,e={}){return Jn.create(t,{...e,in:!0})};Jn.isRef=function(t){return t?!!t[pu.symbols.ref]:!1};Yn.Ref=class{constructor(t){Xn(typeof t=="object","Invalid reference construction"),pu.assertOptions(t,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),Xn([!1,void 0].includes(t.separator)||typeof t.separator=="string"&&t.separator.length===1,"Invalid separator"),Xn(!t.adjust||typeof t.adjust=="function","options.adjust must be a function"),Xn(!t.map||Array.isArray(t.map),"options.map must be an array"),Xn(!t.map||!t.adjust,"Cannot set both map and adjust options"),Object.assign(this,Yn.defaults,t),Xn(this.type==="value"||this.ancestor===void 0,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(t,e,n,r,i={}){return Xn(!this.in||i.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(n.context,e,i):this.type==="local"?this._resolve(r,e,i):this.ancestor?this.ancestor==="root"?this._resolve(e.ancestors[e.ancestors.length-1],e,i):(Xn(this.ancestor<=e.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(e.ancestors[this.ancestor-1],e,i)):this._resolve(t,e,i)}_resolve(t,e,n){let r;if(this.type==="value"&&e.mainstay.shadow&&n.shadow!==!1&&(r=e.mainstay.shadow.get(this.absolute(e))),r===void 0&&(r=HN(t,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(r=this.adjust(r)),this.map){let i=this.map.get(r);i!==void 0&&(r=i)}return e.mainstay&&e.mainstay.tracer.resolve(e,this,r),r}toString(){return this.display}absolute(t){return[...t.path.slice(0,-this.ancestor),...this.path]}clone(){return new Yn.Ref(this)}describe(){let t={path:this.path};this.type!=="value"&&(t.type=this.type),this.separator!=="."&&(t.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(t.ancestor=this.ancestor),this.map&&(t.map=[...this.map]);for(let e of["adjust","iterables","render"])this[e]!==null&&this[e]!==void 0&&(t[e]=this[e]);return this.in!==!1&&(t.in=!0),{ref:t}}updateDisplay(){let t=this.key!==null?this.key:"";if(this.type!=="value"){this.display=`ref:${this.type}:${t}`;return}if(!this.separator){this.display=`ref:${t}`;return}if(!this.ancestor){this.display=`ref:${this.separator}${t}`;return}if(this.ancestor==="root"){this.display=`ref:root:${t}`;return}if(this.ancestor===1){this.display=`ref:${t||".."}`;return}let e=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${e}${t||""}`}};Yn.Ref.prototype[pu.symbols.ref]=!0;Jn.build=function(t){return t=Object.assign({},Yn.defaults,t),t.type==="value"&&t.ancestor===void 0&&(t.ancestor=1),new Yn.Ref(t)};Yn.context=function(t,e,n={}){if(t=t.trim(),n){let r=n.global===void 0?"$":n.global;if(r!==e&&t.startsWith(r))return{key:t.slice(r.length),type:"global"};let i=n.local===void 0?"#":n.local;if(i!==e&&t.startsWith(i))return{key:t.slice(i.length),type:"local"};let s=n.root===void 0?"/":n.root;if(s!==e&&t.startsWith(s))return{key:t.slice(s.length),type:"value",root:!0}}return{key:t,type:"value"}};Yn.ancestor=function(t,e){if(!e)return[1,0];if(t[0]!==e)return[1,0];if(t[1]!==e)return[0,1];let n=2;for(;t[n]===e;)++n;return[n-1,n]};Jn.toSibling=0;Jn.toParent=1;Jn.Manager=class{constructor(){this.refs=[]}register(t,e){if(t){if(e=e===void 0?Jn.toParent:e,Array.isArray(t)){for(let n of t)this.register(n,e);return}if(pu.isSchema(t)){for(let n of t._refs.refs)n.ancestor-e>=0&&this.refs.push({ancestor:n.ancestor-e,root:n.root});return}Jn.isRef(t)&&t.type==="value"&&t.ancestor-e>=0&&this.refs.push({ancestor:t.ancestor-e,root:t.root}),xb=xb||Ui(),xb.isTemplate(t)&&this.register(t.refs(),e)}}get length(){return this.refs.length}clone(){let t=new Jn.Manager;return t.refs=WN(this.refs),t}reset(){this.refs=[]}roots(){return this.refs.filter(t=>!t.ancestor).map(t=>t.root)}}});var Ui=m((zk,Kk)=>{"use strict";var Lh=Me(),GN=ln(),zN=Fk(),KN=$k(),Hk=Ze(),Wk=ui(),Gk=ci(),Be={symbol:Symbol("template"),opens:new Array(1e3).join("\0"),closes:new Array(1e3).join(""),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};Kk.exports=zk=Be.Template=class{constructor(t,e){if(Lh(typeof t=="string","Template source must be a string"),Lh(!t.includes("\0")&&!t.includes(""),"Template source cannot contain reserved control characters"),this.source=t,this.rendered=t,this._template=null,e){let{functions:n,...r}=e;this._settings=Object.keys(r).length?GN(r):void 0,this._functions=n,this._functions&&(Lh(Object.keys(this._functions).every(i=>typeof i=="string"),"Functions keys must be strings"),Lh(Object.values(this._functions).every(i=>typeof i=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;let t=Be.encode(this.source),e=Be.split(t),n=!1,r=[],i=e.shift();i&&r.push(i);for(let s of e){let o=s[0]!=="{",a=o?"}":"}}",u=s.indexOf(a);if(u===-1||s[1]==="{"){r.push(`{${Be.decode(s)}`);continue}let c=s.slice(o?0:1,u),l=c[0]===":";l&&(c=c.slice(1));let h=this._ref(Be.decode(c),{raw:o,wrapped:l});r.push(h),typeof h!="string"&&(n=!0);let d=s.slice(u+a.length);d&&r.push(Be.decode(d))}if(!n){this.rendered=r.join("");return}this._template=r}static date(t,e){return Be.dateFormat[e.dateFormat].call(t)}describe(t={}){if(!this._settings&&t.compact)return this.source;let e={template:this.source};return this._settings&&(e.options=this._settings),this._functions&&(e.functions=this._functions),e}static build(t){return new Be.Template(t.template,t.options||t.functions?{...t.options,functions:t.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(t){return t?!!t[Hk.symbols.template]:!1}refs(){if(!this._template)return;let t=[];for(let e of this._template)typeof e!="string"&&t.push(...e.refs);return t}resolve(t,e,n,r){return this._template&&this._template.length===1?this._part(this._template[0],t,e,n,r,{}):this.render(t,e,n,r)}_part(t,...e){return t.ref?t.ref.resolve(...e):t.formula.evaluate(e)}render(t,e,n,r,i={}){if(!this.isDynamic())return this.rendered;let s=[];for(let o of this._template)if(typeof o=="string")s.push(o);else{let a=this._part(o,t,e,n,r,i),u=Be.stringify(a,t,e,n,r,i);if(u!==void 0){let c=o.raw||(i.errors&&i.errors.escapeHtml)===!1?u:zN(u);s.push(Be.wrap(c,o.wrapped&&n.errors.wrap.label))}}return s.join("")}_ref(t,{raw:e,wrapped:n}){let r=[],i=o=>{let a=Gk.create(o,this._settings);return r.push(a),u=>{let c=a.resolve(...u);return c!==void 0?c:null}};try{let o=this._functions?{...Be.functions,...this._functions}:Be.functions;var s=new KN.Parser(t,{reference:i,functions:o,constants:Be.constants})}catch(o){throw o.message=`Invalid template variable "${t}" fails due to: ${o.message}`,o}if(s.single){if(s.single.type==="reference"){let o=r[0];return{ref:o,raw:e,refs:r,wrapped:n||o.type==="local"&&o.key==="label"}}return Be.stringify(s.single.value)}return{formula:s,raw:e,refs:r}}toString(){return this.source}};Be.Template.prototype[Hk.symbols.template]=!0;Be.Template.prototype.isImmutable=!0;Be.encode=function(t){return t.replace(/\\(\{+)/g,(e,n)=>Be.opens.slice(0,n.length)).replace(/\\(\}+)/g,(e,n)=>Be.closes.slice(0,n.length))};Be.decode=function(t){return t.replace(/\u0000/g,"{").replace(/\u0001/g,"}")};Be.split=function(t){let e=[],n="";for(let r=0;r<t.length;++r){let i=t[r];if(i==="{"){let s="";for(;r+1<t.length&&t[r+1]==="{";)s+="{",++r;e.push(n),n=s}else n+=i}return e.push(n),e};Be.wrap=function(t,e){return e?e.length===1?`${e}${t}${e}`:`${e[0]}${t}${e[1]}`:t};Be.stringify=function(t,e,n,r,i,s={}){let o=typeof t,a=r&&r.errors&&r.errors.wrap||{},u=!1;if(Gk.isRef(t)&&t.render&&(u=t.in,t=t.resolve(e,n,r,i,{in:t.in,...s})),t===null)return"null";if(o==="string")return Be.wrap(t,s.arrayItems&&a.string);if(o==="number"||o==="function"||o==="symbol")return t.toString();if(o!=="object")return JSON.stringify(t);if(t instanceof Date)return Be.Template.date(t,r);if(t instanceof Map){let l=[];for(let[h,d]of t.entries())l.push(`${h.toString()} -> ${d.toString()}`);t=l}if(!Array.isArray(t))return t.toString();let c=[];for(let l of t)c.push(Be.stringify(l,e,n,r,i,{arrayItems:!0,...s}));return Be.wrap(c.join(", "),!u&&a.array)};Be.constants={true:!0,false:!1,null:null,second:1e3,minute:60*1e3,hour:60*60*1e3,day:24*60*60*1e3};Be.functions={if(t,e,n){return t?e:n},length(t){return typeof t=="string"?t.length:!t||typeof t!="object"?null:Array.isArray(t)?t.length:Object.keys(t).length},msg(t){let[e,n,r,i,s]=this,o=s.messages;if(!o)return"";let a=Wk.template(e,o[0],t,n,r)||Wk.template(e,o[1],t,n,r);return a?a.render(e,n,r,i,s):""},number(t){return typeof t=="number"?t:typeof t=="string"?parseFloat(t):typeof t=="boolean"?t?1:0:t instanceof Date?t.getTime():null}}});var Mo=m(gu=>{"use strict";var xs=Me(),Vk=ln(),Ln=Ui();gu.compile=function(t,e){if(typeof t=="string")return xs(!e,"Cannot set single message string"),new Ln(t);if(Ln.isTemplate(t))return xs(!e,"Cannot set single message template"),t;xs(typeof t=="object"&&!Array.isArray(t),"Invalid message options"),e=e?Vk(e):{};for(let n in t){let r=t[n];if(n==="root"||Ln.isTemplate(r)){e[n]=r;continue}if(typeof r=="string"){e[n]=new Ln(r);continue}xs(typeof r=="object"&&!Array.isArray(r),"Invalid message for",n);let i=n;e[i]=e[i]||{};for(n in r){let s=r[n];if(n==="root"||Ln.isTemplate(s)){e[i][n]=s;continue}xs(typeof s=="string","Invalid message for",n,"in",i),e[i][n]=new Ln(s)}}return e};gu.decompile=function(t){let e={};for(let n in t){let r=t[n];if(n==="root"){e.root=r;continue}if(Ln.isTemplate(r)){e[n]=r.describe({compact:!0});continue}let i=n;e[i]={};for(n in r){let s=r[n];if(n==="root"){e[i].root=s;continue}e[i][n]=s.describe({compact:!0})}}return e};gu.merge=function(t,e){if(!t)return gu.compile(e);if(!e)return t;if(typeof e=="string")return new Ln(e);if(Ln.isTemplate(e))return e;let n=Vk(t);for(let r in e){let i=e[r];if(r==="root"||Ln.isTemplate(i)){n[r]=i;continue}if(typeof i=="string"){n[r]=new Ln(i);continue}xs(typeof i=="object"&&!Array.isArray(i),"Invalid message for",r);let s=r;n[s]=n[s]||{};for(r in i){let o=i[r];if(r==="root"||Ln.isTemplate(o)){n[s][r]=o;continue}xs(typeof o=="string","Invalid message for",r,"in",s),n[s][r]=new Ln(o)}}return n}});var Ze=m(et=>{"use strict";var Nh=Me(),VN=Sb(),XN=qk(),kb,Ab,YN={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};et.version=XN.version;et.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1};et.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")};et.assertOptions=function(t,e,n="Options"){Nh(t&&typeof t=="object"&&!Array.isArray(t),"Options must be of type object");let r=Object.keys(t).filter(i=>!e.includes(i));Nh(r.length===0,`${n} contain unknown keys: ${r}`)};et.checkPreferences=function(t){Ab=Ab||Ih();let e=Ab.preferences.validate(t);if(e.error)throw new VN([e.error.details[0].message])};et.compare=function(t,e,n){switch(n){case"=":return t===e;case">":return t>e;case"<":return t<e;case">=":return t>=e;case"<=":return t<=e}};et.default=function(t,e){return t===void 0?e:t};et.isIsoDate=function(t){return YN.isoDate.test(t)};et.isNumber=function(t){return typeof t=="number"&&!isNaN(t)};et.isResolvable=function(t){return t?t[et.symbols.ref]||t[et.symbols.template]:!1};et.isSchema=function(t,e={}){let n=t&&t[et.symbols.any];return n?(Nh(e.legacy||n.version===et.version,"Cannot mix different versions of joi schemas"),!0):!1};et.isValues=function(t){return t[et.symbols.values]};et.limit=function(t){return Number.isSafeInteger(t)&&t>=0};et.preferences=function(t,e){kb=kb||Mo(),t=t||{},e=e||{};let n=Object.assign({},t,e);return e.errors&&t.errors&&(n.errors=Object.assign({},t.errors,e.errors),n.errors.wrap=Object.assign({},t.errors.wrap,e.errors.wrap)),e.messages&&(n.messages=kb.compile(e.messages,t.messages)),delete n[et.symbols.prefs],n};et.tryWithPath=function(t,e,n={}){try{return t()}catch(r){throw r.path!==void 0?r.path=e+"."+r.path:r.path=e,n.append&&(r.message=`${r.message} (${r.path})`),r}};et.validateArg=function(t,e,{assert:n,message:r}){if(et.isSchema(n)){let i=n.validate(t);return i.error?i.error.message:void 0}else if(!n(t))return e?`${e} ${r}`:r};et.verifyFlat=function(t,e){for(let n of t)Nh(!Array.isArray(n),"Method no longer accepts array arguments:",e)}});var Cb=m(Xk=>{"use strict";var JN=Me(),QN=ln(),ZN=Ze(),Lo={max:1e3,supported:new Set(["undefined","boolean","number","string"])};Xk.provider={provision(t){return new Lo.Cache(t)}};Lo.Cache=class{constructor(t={}){ZN.assertOptions(t,["max"]),JN(t.max===void 0||t.max&&t.max>0&&isFinite(t.max),"Invalid max cache size"),this._max=t.max||Lo.max,this._map=new Map,this._list=new Lo.List}get length(){return this._map.size}set(t,e){if(t!==null&&!Lo.supported.has(typeof t))return;let n=this._map.get(t);if(n){n.value=e,this._list.first(n);return}n=this._list.unshift({key:t,value:e}),this._map.set(t,n),this._compact()}get(t){let e=this._map.get(t);if(e)return this._list.first(e),QN(e.value)}_compact(){if(this._map.size>this._max){let t=this._list.pop();this._map.delete(t.key)}}};Lo.List=class{constructor(){this.tail=null,this.head=null}unshift(t){return t.next=null,t.prev=this.head,this.head&&(this.head.next=t),this.head=t,this.tail||(this.tail=t),t}first(t){t!==this.head&&(this._remove(t),this.unshift(t))}pop(){return this._remove(this.tail)}_remove(t){let{next:e,prev:n}=t;return e.prev=n,n&&(n.next=e),t===this.tail&&(this.tail=e),t.prev=null,t.next=null,t}}});var ks=m(li=>{"use strict";var gt=Me(),Nn=Ze(),No=ci(),Qn={};li.schema=function(t,e,n={}){Nn.assertOptions(n,["appendPath","override"]);try{return Qn.schema(t,e,n)}catch(r){throw n.appendPath&&r.path!==void 0&&(r.message=`${r.message} (${r.path})`),r}};Qn.schema=function(t,e,n){gt(e!==void 0,"Invalid undefined schema"),Array.isArray(e)&&(gt(e.length,"Invalid empty array schema"),e.length===1&&(e=e[0]));let r=(i,...s)=>n.override!==!1?i.valid(t.override,...s):i.valid(...s);if(Qn.simple(e))return r(t,e);if(typeof e=="function")return t.custom(e);if(gt(typeof e=="object","Invalid schema content:",typeof e),Nn.isResolvable(e))return r(t,e);if(Nn.isSchema(e))return e;if(Array.isArray(e)){for(let i of e)if(!Qn.simple(i))return t.alternatives().try(...e);return r(t,...e)}return e instanceof RegExp?t.string().regex(e):e instanceof Date?r(t.date(),e):(gt(Object.getPrototypeOf(e)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),t.object().keys(e))};li.ref=function(t,e){return No.isRef(t)?t:No.create(t,e)};li.compile=function(t,e,n={}){Nn.assertOptions(n,["legacy"]);let r=e&&e[Nn.symbols.any];if(r)return gt(n.legacy||r.version===Nn.version,"Cannot mix different versions of joi schemas:",r.version,Nn.version),e;if(typeof e!="object"||!n.legacy)return li.schema(t,e,{appendPath:!0});let i=Qn.walk(e);return i?i.compile(i.root,e):li.schema(t,e,{appendPath:!0})};Qn.walk=function(t){if(typeof t!="object")return null;if(Array.isArray(t)){for(let n of t){let r=Qn.walk(n);if(r)return r}return null}let e=t[Nn.symbols.any];if(e)return{root:t[e.root],compile:e.compile};gt(Object.getPrototypeOf(t)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(let n in t){let r=Qn.walk(t[n]);if(r)return r}return null};Qn.simple=function(t){return t===null||["boolean","string","number"].includes(typeof t)};li.when=function(t,e,n){if(n===void 0&&(gt(e&&typeof e=="object","Missing options"),n=e,e=No.create(".")),Array.isArray(n)&&(n={switch:n}),Nn.assertOptions(n,["is","not","then","otherwise","switch","break"]),Nn.isSchema(e))return gt(n.is===void 0,'"is" can not be used with a schema condition'),gt(n.not===void 0,'"not" can not be used with a schema condition'),gt(n.switch===void 0,'"switch" can not be used with a schema condition'),Qn.condition(t,{is:e,then:n.then,otherwise:n.otherwise,break:n.break});if(gt(No.isRef(e)||typeof e=="string","Invalid condition:",e),gt(n.not===void 0||n.is===void 0,'Cannot combine "is" with "not"'),n.switch===void 0){let i=n;n.not!==void 0&&(i={is:n.not,then:n.otherwise,otherwise:n.then,break:n.break});let s=i.is!==void 0?t.$_compile(i.is):t.$_root.invalid(null,!1,0,"").required();return gt(i.then!==void 0||i.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),gt(i.break===void 0||i.then===void 0||i.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),n.is!==void 0&&!No.isRef(n.is)&&!Nn.isSchema(n.is)&&(s=s.required()),Qn.condition(t,{ref:li.ref(e),is:s,then:i.then,otherwise:i.otherwise,break:i.break})}gt(Array.isArray(n.switch),'"switch" must be an array'),gt(n.is===void 0,'Cannot combine "switch" with "is"'),gt(n.not===void 0,'Cannot combine "switch" with "not"'),gt(n.then===void 0,'Cannot combine "switch" with "then"');let r={ref:li.ref(e),switch:[],break:n.break};for(let i=0;i<n.switch.length;++i){let s=n.switch[i],o=i===n.switch.length-1;Nn.assertOptions(s,o?["is","then","otherwise"]:["is","then"]),gt(s.is!==void 0,'Switch statement missing "is"'),gt(s.then!==void 0,'Switch statement missing "then"');let a={is:t.$_compile(s.is),then:t.$_compile(s.then)};if(!No.isRef(s.is)&&!Nn.isSchema(s.is)&&(a.is=a.is.required()),o){gt(n.otherwise===void 0||s.otherwise===void 0,'Cannot specify "otherwise" inside and outside a "switch"');let u=n.otherwise!==void 0?n.otherwise:s.otherwise;u!==void 0&&(gt(r.break===void 0,"Cannot specify both otherwise and break"),a.otherwise=t.$_compile(u))}r.switch.push(a)}return r};Qn.condition=function(t,e){for(let n of["then","otherwise"])e[n]===void 0?delete e[n]:e[n]=t.$_compile(e[n]);return e}});var Ob=m(Jk=>{"use strict";var Wi=Me(),eq=ln(),Yk=Ze(),tq=Mo(),Fr={};Jk.type=function(t,e){let n=Object.getPrototypeOf(t),r=eq(n),i=t._assign(Object.create(r)),s=Object.assign({},e);delete s.base,r._definition=s;let o=n._definition||{};s.messages=tq.merge(o.messages,s.messages),s.properties=Object.assign({},o.properties,s.properties),i.type=s.type,s.flags=Object.assign({},o.flags,s.flags);let a=Object.assign({},o.terms);if(s.terms)for(let h in s.terms){let d=s.terms[h];Wi(i.$_terms[h]===void 0,"Invalid term override for",s.type,h),i.$_terms[h]=d.init,a[h]=d}s.terms=a,s.args||(s.args=o.args),s.prepare=Fr.prepare(s.prepare,o.prepare),s.coerce&&(typeof s.coerce=="function"&&(s.coerce={method:s.coerce}),s.coerce.from&&!Array.isArray(s.coerce.from)&&(s.coerce={method:s.coerce.method,from:[].concat(s.coerce.from)})),s.coerce=Fr.coerce(s.coerce,o.coerce),s.validate=Fr.validate(s.validate,o.validate);let u=Object.assign({},o.rules);if(s.rules)for(let h in s.rules){let d=s.rules[h];Wi(typeof d=="object","Invalid rule definition for",s.type,h);let g=d.method;if(g===void 0&&(g=function(){return this.$_addRule(h)}),g&&(Wi(!r[h],"Rule conflict in",s.type,h),r[h]=g),Wi(!u[h],"Rule conflict in",s.type,h),u[h]=d,d.alias){let y=[].concat(d.alias);for(let _ of y)r[_]=d.method}d.args&&(d.argsByName=new Map,d.args=d.args.map(y=>(typeof y=="string"&&(y={name:y}),Wi(!d.argsByName.has(y.name),"Duplicated argument name",y.name),Yk.isSchema(y.assert)&&(y.assert=y.assert.strict().label(y.name)),d.argsByName.set(y.name,y),y)))}s.rules=u;let c=Object.assign({},o.modifiers);if(s.modifiers)for(let h in s.modifiers){Wi(!r[h],"Rule conflict in",s.type,h);let d=s.modifiers[h];Wi(typeof d=="function","Invalid modifier definition for",s.type,h);let g=function(y){return this.rule({[h]:y})};r[h]=g,c[h]=d}if(s.modifiers=c,s.overrides){r._super=n,i.$_super={};for(let h in s.overrides)Wi(n[h],"Cannot override missing",h),s.overrides[h][Yk.symbols.parent]=n[h],i.$_super[h]=n[h].bind(i);Object.assign(r,s.overrides)}s.cast=Object.assign({},o.cast,s.cast);let l=Object.assign({},o.manifest,s.manifest);return l.build=Fr.build(s.manifest&&s.manifest.build,o.manifest&&o.manifest.build),s.manifest=l,s.rebuild=Fr.rebuild(s.rebuild,o.rebuild),i};Fr.build=function(t,e){return!t||!e?t||e:function(n,r){return e(t(n,r),r)}};Fr.coerce=function(t,e){return!t||!e?t||e:{from:t.from&&e.from?[...new Set([...t.from,...e.from])]:null,method(n,r){let i;if((!e.from||e.from.includes(typeof n))&&(i=e.method(n,r),i)){if(i.errors||i.value===void 0)return i;n=i.value}if(!t.from||t.from.includes(typeof n)){let s=t.method(n,r);if(s)return s}return i}}};Fr.prepare=function(t,e){return!t||!e?t||e:function(n,r){let i=t(n,r);if(i){if(i.errors||i.value===void 0)return i;n=i.value}return e(n,r)||i}};Fr.rebuild=function(t,e){return!t||!e?t||e:function(n){e(n),t(n)}};Fr.validate=function(t,e){return!t||!e?t||e:function(n,r){let i=e(n,r);if(i){if(i.errors&&(!Array.isArray(i.errors)||i.errors.length))return i;n=i.value}return t(n,r)||i}}});var Db=m(Pb=>{"use strict";var $r=Me(),qh=ln(),As=Ze(),nq=Mo(),Qk=ci(),rq=Ui(),Rb,hn={};Pb.describe=function(t){let e=t._definition,n={type:t.type,flags:{},rules:[]};for(let r in t._flags)r[0]!=="_"&&(n.flags[r]=hn.describe(t._flags[r]));Object.keys(n.flags).length||delete n.flags,t._preferences&&(n.preferences=qh(t._preferences,{shallow:["messages"]}),delete n.preferences[As.symbols.prefs],n.preferences.messages&&(n.preferences.messages=nq.decompile(n.preferences.messages))),t._valids&&(n.allow=t._valids.describe()),t._invalids&&(n.invalid=t._invalids.describe());for(let r of t._rules){if(e.rules[r.name].manifest===!1)continue;let s={name:r.name};for(let o in e.modifiers)r[o]!==void 0&&(s[o]=hn.describe(r[o]));if(r.args){s.args={};for(let o in r.args){let a=r.args[o];o==="options"&&!Object.keys(a).length||(s.args[o]=hn.describe(a,{assign:o}))}Object.keys(s.args).length||delete s.args}n.rules.push(s)}n.rules.length||delete n.rules;for(let r in t.$_terms){if(r[0]==="_")continue;$r(!n[r],"Cannot describe schema due to internal name conflict with",r);let i=t.$_terms[r];if(!i)continue;if(i instanceof Map){i.size&&(n[r]=[...i.entries()]);continue}if(As.isValues(i)){n[r]=i.describe();continue}$r(e.terms[r],"Term",r,"missing configuration");let s=e.terms[r].manifest,o=typeof s=="object";if(!i.length&&!o)continue;let a=[];for(let u of i)a.push(hn.describe(u));if(o){let{from:u,to:c}=s.mapped;n[r]={};for(let l of a)n[r][l[c]]=l[u];continue}if(s==="single"){$r(a.length===1,"Term",r,"contains more than one item"),n[r]=a[0];continue}n[r]=a}return hn.validate(t.$_root,n),n};hn.describe=function(t,e={}){if(Array.isArray(t))return t.map(hn.describe);if(t===As.symbols.deepDefault)return{special:"deep"};if(typeof t!="object"||t===null)return t;if(e.assign==="options")return qh(t);if(Buffer&&Buffer.isBuffer(t))return{buffer:t.toString("binary")};if(t instanceof Date)return t.toISOString();if(t instanceof Error)return t;if(t instanceof RegExp)return e.assign==="regex"?t.toString():{regex:t.toString()};if(t[As.symbols.literal])return{function:t.literal};if(typeof t.describe=="function")return e.assign==="ref"?t.describe().ref:t.describe();let n={};for(let r in t){let i=t[r];i!==void 0&&(n[r]=hn.describe(i,{assign:r}))}return n};Pb.build=function(t,e){return new hn.Builder(t).parse(e)};hn.Builder=class{constructor(t){this.joi=t}parse(t){hn.validate(this.joi,t);let e=this.joi[t.type]()._bare(),n=e._definition;if(t.flags)for(let i in t.flags){let s=n.flags[i]&&n.flags[i].setter||i;$r(typeof e[s]=="function","Invalid flag",i,"for type",t.type),e=e[s](this.build(t.flags[i]))}if(t.preferences&&(e=e.preferences(this.build(t.preferences))),t.allow&&(e=e.allow(...this.build(t.allow))),t.invalid&&(e=e.invalid(...this.build(t.invalid))),t.rules)for(let i of t.rules){$r(typeof e[i.name]=="function","Invalid rule",i.name,"for type",t.type);let s=[];if(i.args){let a={};for(let l in i.args)a[l]=this.build(i.args[l],{assign:l});let u=Object.keys(a),c=n.rules[i.name].args;if(c){$r(u.length<=c.length,"Invalid number of arguments for",t.type,i.name,"(expected up to",c.length,", found",u.length,")");for(let{name:l}of c)s.push(a[l])}else $r(u.length===1,"Invalid number of arguments for",t.type,i.name,"(expected up to 1, found",u.length,")"),s.push(a[u[0]])}e=e[i.name](...s);let o={};for(let a in n.modifiers)i[a]!==void 0&&(o[a]=this.build(i[a]));Object.keys(o).length&&(e=e.rule(o))}let r={};for(let i in t){if(["allow","flags","invalid","whens","preferences","rules","type"].includes(i))continue;$r(n.terms[i],"Term",i,"missing configuration");let s=n.terms[i].manifest;if(s==="schema"){r[i]=t[i].map(o=>this.parse(o));continue}if(s==="values"){r[i]=t[i].map(o=>this.build(o));continue}if(s==="single"){r[i]=this.build(t[i]);continue}if(typeof s=="object"){r[i]={};for(let o in t[i]){let a=t[i][o];r[i][o]=this.parse(a)}continue}r[i]=this.build(t[i])}return t.whens&&(r.whens=t.whens.map(i=>this.build(i))),e=n.manifest.build(e,r),e.$_temp.ruleset=!1,e}build(t,e={}){if(t===null)return null;if(Array.isArray(t))return t.map(r=>this.build(r));if(t instanceof Error)return t;if(e.assign==="options")return qh(t);if(e.assign==="regex")return hn.regex(t);if(e.assign==="ref")return Qk.build(t);if(typeof t!="object")return t;if(Object.keys(t).length===1){if(t.buffer)return $r(Buffer,"Buffers are not supported"),Buffer&&Buffer.from(t.buffer,"binary");if(t.function)return{[As.symbols.literal]:!0,literal:t.function};if(t.override)return As.symbols.override;if(t.ref)return Qk.build(t.ref);if(t.regex)return hn.regex(t.regex);if(t.special)return $r(["deep"].includes(t.special),"Unknown special value",t.special),As.symbols.deepDefault;if(t.value)return qh(t.value)}if(t.type)return this.parse(t);if(t.template)return rq.build(t);let n={};for(let r in t)n[r]=this.build(t[r],{assign:r});return n}};hn.regex=function(t){let e=t.lastIndexOf("/"),n=t.slice(1,e),r=t.slice(e+1);return new RegExp(n,r)};hn.validate=function(t,e){Rb=Rb||Ih(),t.assert(e,Rb.description)}});var mu=m((k4,Zk)=>{"use strict";var Br=Tb(),tn={mismatched:null};Zk.exports=function(t,e,n){return n=Object.assign({prototype:!0},n),!!tn.isDeepEqual(t,e,n,[])};tn.isDeepEqual=function(t,e,n,r){if(t===e)return t!==0||1/t===1/e;let i=typeof t;if(i!==typeof e||t===null||e===null)return!1;if(i==="function"){if(!n.deepFunction||t.toString()!==e.toString())return!1}else if(i!=="object")return t!==t&&e!==e;let s=tn.getSharedType(t,e,!!n.prototype);switch(s){case Br.buffer:return Buffer&&Buffer.prototype.equals.call(t,e);case Br.promise:return t===e;case Br.regex:return t.toString()===e.toString();case tn.mismatched:return!1}for(let o=r.length-1;o>=0;--o)if(r[o].isSame(t,e))return!0;r.push(new tn.SeenEntry(t,e));try{return!!tn.isDeepEqualObj(s,t,e,n,r)}finally{r.pop()}};tn.getSharedType=function(t,e,n){if(n)return Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?tn.mismatched:Br.getInternalProto(t);let r=Br.getInternalProto(t);return r!==Br.getInternalProto(e)?tn.mismatched:r};tn.valueOf=function(t){let e=t.valueOf;if(e===void 0)return t;try{return e.call(t)}catch(n){return n}};tn.hasOwnEnumerableProperty=function(t,e){return Object.prototype.propertyIsEnumerable.call(t,e)};tn.isSetSimpleEqual=function(t,e){for(let n of Set.prototype.values.call(t))if(!Set.prototype.has.call(e,n))return!1;return!0};tn.isDeepEqualObj=function(t,e,n,r,i){let{isDeepEqual:s,valueOf:o,hasOwnEnumerableProperty:a}=tn,{keys:u,getOwnPropertySymbols:c}=Object;if(t===Br.array)if(r.part){for(let y of e)for(let _ of n)if(s(y,_,r,i))return!0}else{if(e.length!==n.length)return!1;for(let y=0;y<e.length;++y)if(!s(e[y],n[y],r,i))return!1;return!0}else if(t===Br.set){if(e.size!==n.size)return!1;if(!tn.isSetSimpleEqual(e,n)){let y=new Set(Set.prototype.values.call(n));for(let _ of Set.prototype.values.call(e)){if(y.delete(_))continue;let C=!1;for(let k of y)if(s(_,k,r,i)){y.delete(k),C=!0;break}if(!C)return!1}}}else if(t===Br.map){if(e.size!==n.size)return!1;for(let[y,_]of Map.prototype.entries.call(e))if(_===void 0&&!Map.prototype.has.call(n,y)||!s(_,Map.prototype.get.call(n,y),r,i))return!1}else if(t===Br.error&&(e.name!==n.name||e.message!==n.message))return!1;let l=o(e),h=o(n);if((e!==l||n!==h)&&!s(l,h,r,i))return!1;let d=u(e);if(!r.part&&d.length!==u(n).length&&!r.skip)return!1;let g=0;for(let y of d){if(r.skip&&r.skip.includes(y)){n[y]===void 0&&++g;continue}if(!a(n,y)||!s(e[y],n[y],r,i))return!1}if(!r.part&&d.length-g!==u(n).length)return!1;if(r.symbols!==!1){let y=c(e),_=new Set(c(n));for(let C of y){if(!r.skip||!r.skip.includes(C)){if(a(e,C)){if(!a(n,C)||!s(e[C],n[C],r,i))return!1}else if(a(n,C))return!1}_.delete(C)}for(let C of _)if(a(n,C))return!1}return!0};tn.SeenEntry=class{constructor(t,e){this.obj=t,this.ref=e}isSame(t,e){return this.obj===t&&this.ref===e}}});var tA=m(eA=>{"use strict";eA.location=function(t=0){let e=Error.prepareStackTrace;Error.prepareStackTrace=(i,s)=>s;let n={};Error.captureStackTrace(n,this);let r=n.stack[t+1];return Error.prepareStackTrace=e,{filename:r.getFileName(),line:r.getLineNumber()}}});var Mb=m(Ib=>{"use strict";var nA=mu(),rA=tA(),iq=ui(),nn={codes:{error:1,pass:2,full:3},labels:{0:"never used",1:"always error",2:"always pass"}};Ib.setup=function(t){let e=function(){return t._tracer=t._tracer||new nn.Tracer,t._tracer};t.trace=e,t[Symbol.for("@hapi/lab/coverage/initialize")]=e,t.untrace=()=>{t._tracer=null}};Ib.location=function(t){return t.$_setFlag("_tracerLocation",rA.location(2))};nn.Tracer=class{constructor(){this.name="Joi",this._schemas=new Map}_register(t){let e=this._schemas.get(t);if(e)return e.store;let n=new nn.Store(t),{filename:r,line:i}=t._flags._tracerLocation||rA.location(5);return this._schemas.set(t,{filename:r,line:i,store:n}),n}_combine(t,e){for(let{store:n}of this._schemas.values())n._combine(t,e)}report(t){let e=[];for(let{filename:n,line:r,store:i}of this._schemas.values()){if(t&&t!==n)continue;let s=[],o=[];for(let[a,u]of i._sources.entries()){if(nn.sub(u.paths,o))continue;if(!u.entry){s.push({status:"never reached",paths:[...u.paths]}),o.push(...u.paths);continue}for(let l of["valid","invalid"]){let h=a[`_${l}s`];if(!h)continue;let d=new Set(h._values),g=new Set(h._refs);for(let{value:y,ref:_}of u[l])d.delete(y),g.delete(_);(d.size||g.size)&&s.push({status:[...d,...[...g].map(y=>y.display)],rule:`${l}s`})}let c=a._rules.map(l=>l.name);for(let l of["default","failover"])a._flags[l]!==void 0&&c.push(l);for(let l of c){let h=nn.labels[u.rule[l]||0];if(h){let d={rule:l,status:h};u.paths.size&&(d.paths=[...u.paths]),s.push(d)}}}s.length&&e.push({filename:n,line:r,missing:s,severity:"error",message:`Schema missing tests for ${s.map(nn.message).join(", ")}`})}return e.length?e:null}};nn.Store=class{constructor(t){this.active=!0,this._sources=new Map,this._combos=new Map,this._scan(t)}debug(t,e,n,r){t.mainstay.debug&&t.mainstay.debug.push({type:e,name:n,result:r,path:t.path})}entry(t,e){nn.debug(e,{type:"entry"}),this._record(t,n=>{n.entry=!0})}filter(t,e,n,r){nn.debug(e,{type:n,...r}),this._record(t,i=>{i[n].add(r)})}log(t,e,n,r,i){nn.debug(e,{type:n,name:r,result:i==="full"?"pass":i}),this._record(t,s=>{s[n][r]=s[n][r]||0,s[n][r]|=nn.codes[i]})}resolve(t,e,n){if(!t.mainstay.debug)return;let r={type:"resolve",ref:e.display,to:n,path:t.path};t.mainstay.debug.push(r)}value(t,e,n,r,i){if(!t.mainstay.debug||nA(n,r))return;let s={type:"value",by:e,from:n,to:r,path:t.path};i&&(s.name=i),t.mainstay.debug.push(s)}_record(t,e){let n=this._sources.get(t);if(n){e(n);return}let r=this._combos.get(t);for(let i of r)this._record(i,e)}_scan(t,e){let n=e||[],r=this._sources.get(t);r||(r={paths:new Set,entry:!1,rule:{},valid:new Set,invalid:new Set},this._sources.set(t,r)),n.length&&r.paths.add(n);let i=(s,o)=>{let a=nn.id(s,o);this._scan(s,n.concat(a))};t.$_modify({each:i,ref:!1})}_combine(t,e){this._combos.set(t,e)}};nn.message=function(t){return`${t.paths?iq.path(t.paths[0])+(t.rule?":":""):""}${t.rule||""} (${t.status})`};nn.id=function(t,{source:e,name:n,path:r,key:i}){return t._flags.id?t._flags.id:i||(n=`@${n}`,e==="terms"?[n,r[Math.min(r.length-1,1)]]:n)};nn.sub=function(t,e){for(let n of t)for(let r of e)if(nA(n.slice(0,r.length),r))return!0;return!1};nn.debug=function(t,e){t.mainstay.debug&&(e.path=t.debug?[...t.path,t.debug]:t.path,t.mainstay.debug.push(e))}});var jh=m((D4,oA)=>{"use strict";var Lb=Me(),iA=ln(),sq=Eb(),sA={};oA.exports=sA.merge=function(t,e,n){if(Lb(t&&typeof t=="object","Invalid target value: must be an object"),Lb(e==null||typeof e=="object","Invalid source value: must be null, undefined, or an object"),!e)return t;if(n=Object.assign({nullOverride:!0,mergeArrays:!0},n),Array.isArray(e)){Lb(Array.isArray(t),"Cannot merge array onto an object"),n.mergeArrays||(t.length=0);for(let i=0;i<e.length;++i)t.push(iA(e[i],{symbols:n.symbols}));return t}let r=sq.keys(e,n);for(let i=0;i<r.length;++i){let s=r[i];if(s==="__proto__"||!Object.prototype.propertyIsEnumerable.call(e,s))continue;let o=e[s];if(o&&typeof o=="object"){if(t[s]===o)continue;!t[s]||typeof t[s]!="object"||Array.isArray(t[s])!==Array.isArray(o)||o instanceof Date||Buffer&&Buffer.isBuffer(o)||o instanceof RegExp?t[s]=iA(o,{symbols:n.symbols}):sA.merge(t[s],o,n)}else(o!=null||n.nullOverride)&&(t[s]=o)}return t}});var aA=m(Fh=>{"use strict";var hi=Me(),Nb=Ze(),oq=ci(),Ur={};Fh.Ids=Ur.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){let t=new Ur.Ids;return t._byId=new Map(this._byId),t._byKey=new Map(this._byKey),t._schemaChain=this._schemaChain,t}concat(t){t._schemaChain&&(this._schemaChain=!0);for(let[e,n]of t._byId.entries())hi(!this._byKey.has(e),"Schema id conflicts with existing key:",e),this._byId.set(e,n);for(let[e,n]of t._byKey.entries())hi(!this._byId.has(e),"Schema key conflicts with existing id:",e),this._byKey.set(e,n)}fork(t,e,n){let r=this._collect(t);r.push({schema:n});let i=r.shift(),s={id:i.id,schema:e(i.schema)};hi(Nb.isSchema(s.schema),"adjuster function failed to return a joi schema type");for(let o of r)s={id:o.id,schema:Ur.fork(o.schema,s.id,s.schema)};return s.schema}labels(t,e=[]){let n=t[0],r=this._get(n);if(!r)return[...e,...t].join(".");let i=t.slice(1);return e=[...e,r.schema._flags.label||n],i.length?r.schema._ids.labels(i,e):e.join(".")}reach(t,e=[]){let n=t[0],r=this._get(n);hi(r,"Schema does not contain path",[...e,...t].join("."));let i=t.slice(1);return i.length?r.schema._ids.reach(i,[...e,n]):r.schema}register(t,{key:e}={}){if(!t||!Nb.isSchema(t))return;(t.$_property("schemaChain")||t._ids._schemaChain)&&(this._schemaChain=!0);let n=t._flags.id;if(n){let r=this._byId.get(n);hi(!r||r.schema===t,"Cannot add different schemas with the same id:",n),hi(!this._byKey.has(n),"Schema id conflicts with existing key:",n),this._byId.set(n,{schema:t,id:n})}e&&(hi(!this._byKey.has(e),"Schema already contains key:",e),hi(!this._byId.has(e),"Schema key conflicts with existing id:",e),this._byKey.set(e,{schema:t,id:e}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(t,e=[],n=[]){let r=t[0],i=this._get(r);hi(i,"Schema does not contain path",[...e,...t].join(".")),n=[i,...n];let s=t.slice(1);return s.length?i.schema._ids._collect(s,[...e,r],n):n}_get(t){return this._byId.get(t)||this._byKey.get(t)}};Ur.fork=function(t,e,n){let r=(s,{key:o})=>{if(e===(s._flags.id||o))return n},i=Fh.schema(t,{each:r,ref:!1});return i?i.$_mutateRebuild():t};Fh.schema=function(t,e){let n;for(let r in t._flags){if(r[0]==="_")continue;let i=Ur.scan(t._flags[r],{source:"flags",name:r},e);i!==void 0&&(n=n||t.clone(),n._flags[r]=i)}for(let r=0;r<t._rules.length;++r){let i=t._rules[r],s=Ur.scan(i.args,{source:"rules",name:i.name},e);if(s!==void 0){n=n||t.clone();let o=Object.assign({},i);o.args=s,n._rules[r]=o,n._singleRules.get(i.name)===i&&n._singleRules.set(i.name,o)}}for(let r in t.$_terms){if(r[0]==="_")continue;let i=Ur.scan(t.$_terms[r],{source:"terms",name:r},e);i!==void 0&&(n=n||t.clone(),n.$_terms[r]=i)}return n};Ur.scan=function(t,e,n,r,i){let s=r||[];if(t===null||typeof t!="object")return;let o;if(Array.isArray(t)){for(let a=0;a<t.length;++a){let u=e.source==="terms"&&e.name==="keys"&&t[a].key,c=Ur.scan(t[a],e,n,[a,...s],u);c!==void 0&&(o=o||t.slice(),o[a]=c)}return o}if(n.schema!==!1&&Nb.isSchema(t)||n.ref!==!1&&oq.isRef(t)){let a=n.each(t,{...e,path:s,key:i});return a===t?void 0:a}for(let a in t){if(a[0]==="_")continue;let u=Ur.scan(t[a],e,n,[a,...s],i);u!==void 0&&(o=o||Object.assign({},t),o[a]=u)}return o}});var cA=m((L4,uA)=>{"use strict";uA.exports=function(){}});var dA=m((N4,hA)=>{"use strict";var aq=ln(),lA=Ts(),uq=Ze(),Wr={value:Symbol("value")};hA.exports=Wr.State=class{constructor(t,e,n){this.path=t,this.ancestors=e,this.mainstay=n.mainstay,this.schemas=n.schemas,this.debug=null}localize(t,e=null,n=null){let r=new Wr.State(t,e,this);return n&&r.schemas&&(r.schemas=[Wr.schemas(n),...r.schemas]),r}nest(t,e){let n=new Wr.State(this.path,this.ancestors,this);return n.schemas=n.schemas&&[Wr.schemas(t),...n.schemas],n.debug=e,n}shadow(t,e){this.mainstay.shadow=this.mainstay.shadow||new Wr.Shadow,this.mainstay.shadow.set(this.path,t,e)}snapshot(){this.mainstay.shadow&&(this._snapshot=aq(this.mainstay.shadow.node(this.path))),this.mainstay.snapshot()}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.restore()}commit(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.commit()}};Wr.schemas=function(t){return uq.isSchema(t)?{schema:t}:t};Wr.Shadow=class{constructor(){this._values=null}set(t,e,n){if(!t.length||n==="strip"&&typeof t[t.length-1]=="number")return;this._values=this._values||new Map;let r=this._values;for(let i=0;i<t.length;++i){let s=t[i],o=r.get(s);o||(o=new Map,r.set(s,o)),r=o}r[Wr.value]=e}get(t){let e=this.node(t);if(e)return e[Wr.value]}node(t){if(this._values)return lA(this._values,t,{iterables:!0})}override(t,e){if(!this._values)return;let n=t.slice(0,-1),r=t[t.length-1],i=lA(this._values,n,{iterables:!0});if(e){i.set(r,e);return}i&&i.delete(r)}}});var pA=m(bu=>{"use strict";var yu=Me(),fA=ln(),qo=cA(),cq=Ts(),Pt=Ze(),Hi=ui(),lq=dA(),ve={result:Symbol("result")};bu.entry=function(t,e,n){let r=Pt.defaults;n&&(yu(n.warnings===void 0,"Cannot override warnings preference in synchronous validation"),yu(n.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),r=Pt.preferences(Pt.defaults,n));let i=ve.entry(t,e,r);yu(!i.mainstay.externals.length,"Schema with external rules must use validateAsync()");let s={value:i.value};return i.error&&(s.error=i.error),i.mainstay.warnings.length&&(s.warning=Hi.details(i.mainstay.warnings)),i.mainstay.debug&&(s.debug=i.mainstay.debug),i.mainstay.artifacts&&(s.artifacts=i.mainstay.artifacts),s};bu.entryAsync=async function(t,e,n){let r=Pt.defaults;n&&(r=Pt.preferences(Pt.defaults,n));let i=ve.entry(t,e,r),s=i.mainstay;if(i.error)throw s.debug&&(i.error.debug=s.debug),i.error;if(s.externals.length){let a=i.value,u=[];for(let c of s.externals){let l=c.state.path,h=c.schema.type==="link"?s.links.get(c.schema):null,d=a,g,y,_=l.length?[a]:[],C=l.length?cq(t,l):t;if(l.length){g=l[l.length-1];let k=a;for(let T of l.slice(0,-1))k=k[T],_.unshift(k);y=_[0],d=y[g]}try{let k=(w,v)=>(h||c.schema).$_createError(w,d,v,c.state,r),T=await c.method(d,{schema:c.schema,linked:h,state:c.state,prefs:n,original:C,error:k,errorsArray:ve.errorsArray,warn:(w,v)=>s.warnings.push((h||c.schema).$_createError(w,d,v,c.state,r)),message:(w,v)=>(h||c.schema).$_createError("external",d,v,c.state,r,{messages:w})});if(T===void 0||T===d)continue;if(T instanceof Hi.Report){if(s.tracer.log(c.schema,c.state,"rule","external","error"),u.push(T),r.abortEarly)break;continue}if(Array.isArray(T)&&T[Pt.symbols.errors]){if(s.tracer.log(c.schema,c.state,"rule","external","error"),u.push(...T),r.abortEarly)break;continue}y?(s.tracer.value(c.state,"rule",d,T,"external"),y[g]=T):(s.tracer.value(c.state,"rule",a,T,"external"),a=T)}catch(k){throw r.errors.label&&(k.message+=` (${c.label})`),k}}if(i.value=a,u.length)throw i.error=Hi.process(u,t,r),s.debug&&(i.error.debug=s.debug),i.error}if(!r.warnings&&!r.debug&&!r.artifacts)return i.value;let o={value:i.value};return s.warnings.length&&(o.warning=Hi.details(s.warnings)),s.debug&&(o.debug=s.debug),s.artifacts&&(o.artifacts=s.artifacts),o};ve.Mainstay=class{constructor(t,e,n){this.externals=[],this.warnings=[],this.tracer=t,this.debug=e,this.links=n,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){let t=this._snapshots.pop();this.externals=t.externals,this.warnings=t.warnings}commit(){this._snapshots.pop()}};ve.entry=function(t,e,n){let{tracer:r,cleanup:i}=ve.tracer(e,n),s=n.debug?[]:null,o=e._ids._schemaChain?new Map:null,a=new ve.Mainstay(r,s,o),u=e._ids._schemaChain?[{schema:e}]:null,c=new lq([],[],{mainstay:a,schemas:u}),l=bu.validate(t,e,c,n);i&&e.$_root.untrace();let h=Hi.process(l.errors,t,n);return{value:l.value,error:h,mainstay:a}};ve.tracer=function(t,e){return t.$_root._tracer?{tracer:t.$_root._tracer._register(t)}:e.debug?(yu(t.$_root.trace,"Debug mode not supported"),{tracer:t.$_root.trace()._register(t),cleanup:!0}):{tracer:ve.ignore}};bu.validate=function(t,e,n,r,i={}){if(e.$_terms.whens&&(e=e._generate(t,n,r).schema),e._preferences&&(r=ve.prefs(e,r)),e._cache&&r.cache){let h=e._cache.get(t);if(n.mainstay.tracer.debug(n,"validate","cached",!!h),h)return h}let s=(h,d,g)=>e.$_createError(h,t,d,g||n,r),o={original:t,prefs:r,schema:e,state:n,error:s,errorsArray:ve.errorsArray,warn:(h,d,g)=>n.mainstay.warnings.push(s(h,d,g)),message:(h,d)=>e.$_createError("custom",t,d,n,r,{messages:h})};n.mainstay.tracer.entry(e,n);let a=e._definition;if(a.prepare&&t!==void 0&&r.convert){let h=a.prepare(t,o);if(h){if(n.mainstay.tracer.value(n,"prepare",t,h.value),h.errors)return ve.finalize(h.value,[].concat(h.errors),o);t=h.value}}if(a.coerce&&t!==void 0&&r.convert&&(!a.coerce.from||a.coerce.from.includes(typeof t))){let h=a.coerce.method(t,o);if(h){if(n.mainstay.tracer.value(n,"coerced",t,h.value),h.errors)return ve.finalize(h.value,[].concat(h.errors),o);t=h.value}}let u=e._flags.empty;u&&u.$_match(ve.trim(t,e),n.nest(u),Pt.defaults)&&(n.mainstay.tracer.value(n,"empty",t,void 0),t=void 0);let c=i.presence||e._flags.presence||(e._flags._endedSwitch?null:r.presence);if(t===void 0){if(c==="forbidden")return ve.finalize(t,null,o);if(c==="required")return ve.finalize(t,[e.$_createError("any.required",t,null,n,r)],o);if(c==="optional"){if(e._flags.default!==Pt.symbols.deepDefault)return ve.finalize(t,null,o);n.mainstay.tracer.value(n,"default",t,{}),t={}}}else if(c==="forbidden")return ve.finalize(t,[e.$_createError("any.unknown",t,null,n,r)],o);let l=[];if(e._valids){let h=e._valids.get(t,n,r,e._flags.insensitive);if(h)return r.convert&&(n.mainstay.tracer.value(n,"valids",t,h.value),t=h.value),n.mainstay.tracer.filter(e,n,"valid",h),ve.finalize(t,null,o);if(e._flags.only){let d=e.$_createError("any.only",t,{valids:e._valids.values({display:!0})},n,r);if(r.abortEarly)return ve.finalize(t,[d],o);l.push(d)}}if(e._invalids){let h=e._invalids.get(t,n,r,e._flags.insensitive);if(h){n.mainstay.tracer.filter(e,n,"invalid",h);let d=e.$_createError("any.invalid",t,{invalids:e._invalids.values({display:!0})},n,r);if(r.abortEarly)return ve.finalize(t,[d],o);l.push(d)}}if(a.validate){let h=a.validate(t,o);if(h&&(n.mainstay.tracer.value(n,"base",t,h.value),t=h.value,h.errors)){if(!Array.isArray(h.errors))return l.push(h.errors),ve.finalize(t,l,o);if(h.errors.length)return l.push(...h.errors),ve.finalize(t,l,o)}}return e._rules.length?ve.rules(t,l,o):ve.finalize(t,l,o)};ve.rules=function(t,e,n){let{schema:r,state:i,prefs:s}=n;for(let o of r._rules){let a=r._definition.rules[o.method];if(a.convert&&s.convert){i.mainstay.tracer.log(r,i,"rule",o.name,"full");continue}let u,c=o.args;if(o._resolve.length){c=Object.assign({},c);for(let h of o._resolve){let d=a.argsByName.get(h),g=c[h].resolve(t,i,s),y=d.normalize?d.normalize(g):g,_=Pt.validateArg(y,null,d);if(_){u=r.$_createError("any.ref",g,{arg:h,ref:c[h],reason:_},i,s);break}c[h]=y}}u=u||a.validate(t,n,c,o);let l=ve.rule(u,o);if(l.errors){if(i.mainstay.tracer.log(r,i,"rule",o.name,"error"),o.warn){i.mainstay.warnings.push(...l.errors);continue}if(s.abortEarly)return ve.finalize(t,l.errors,n);e.push(...l.errors)}else i.mainstay.tracer.log(r,i,"rule",o.name,"pass"),i.mainstay.tracer.value(i,"rule",t,l.value,o.name),t=l.value}return ve.finalize(t,e,n)};ve.rule=function(t,e){return t instanceof Hi.Report?(ve.error(t,e),{errors:[t],value:null}):Array.isArray(t)&&t[Pt.symbols.errors]?(t.forEach(n=>ve.error(n,e)),{errors:t,value:null}):{errors:null,value:t}};ve.error=function(t,e){return e.message&&t._setTemplate(e.message),t};ve.finalize=function(t,e,n){e=e||[];let{schema:r,state:i,prefs:s}=n;if(e.length){let a=ve.default("failover",void 0,e,n);a!==void 0&&(i.mainstay.tracer.value(i,"failover",t,a),t=a,e=[])}if(e.length&&r._flags.error)if(typeof r._flags.error=="function"){e=r._flags.error(e),Array.isArray(e)||(e=[e]);for(let a of e)yu(a instanceof Error||a instanceof Hi.Report,"error() must return an Error object")}else e=[r._flags.error];if(t===void 0){let a=ve.default("default",t,e,n);i.mainstay.tracer.value(i,"default",t,a),t=a}if(r._flags.cast&&t!==void 0){let a=r._definition.cast[r._flags.cast];if(a.from(t)){let u=a.to(t,n);i.mainstay.tracer.value(i,"cast",t,u,r._flags.cast),t=u}}if(r.$_terms.externals&&s.externals&&s._externals!==!1)for(let{method:a}of r.$_terms.externals)i.mainstay.externals.push({method:a,schema:r,state:i,label:Hi.label(r._flags,i,s)});let o={value:t,errors:e.length?e:null};return r._flags.result&&(o.value=r._flags.result==="strip"?void 0:n.original,i.mainstay.tracer.value(i,r._flags.result,t,o.value),i.shadow(t,r._flags.result)),r._cache&&s.cache!==!1&&!r._refs.length&&r._cache.set(n.original,o),t!==void 0&&!o.errors&&r._flags.artifact!==void 0&&(i.mainstay.artifacts=i.mainstay.artifacts||new Map,i.mainstay.artifacts.has(r._flags.artifact)||i.mainstay.artifacts.set(r._flags.artifact,[]),i.mainstay.artifacts.get(r._flags.artifact).push(i.path)),o};ve.prefs=function(t,e){let n=e===Pt.defaults;return n&&t._preferences[Pt.symbols.prefs]?t._preferences[Pt.symbols.prefs]:(e=Pt.preferences(e,t._preferences),n&&(t._preferences[Pt.symbols.prefs]=e),e)};ve.default=function(t,e,n,r){let{schema:i,state:s,prefs:o}=r,a=i._flags[t];if(o.noDefaults||a===void 0)return e;if(s.mainstay.tracer.log(i,s,"rule",t,"full"),!a)return a;if(typeof a=="function"){let u=a.length?[fA(s.ancestors[0]),r]:[];try{return a(...u)}catch(c){n.push(i.$_createError(`any.${t}`,null,{error:c},s,o));return}}return typeof a!="object"?a:a[Pt.symbols.literal]?a.literal:Pt.isResolvable(a)?a.resolve(e,s,o):fA(a)};ve.trim=function(t,e){if(typeof t!="string")return t;let n=e.$_getRule("trim");return!n||!n.args.enabled?t:t.trim()};ve.ignore={active:!1,debug:qo,entry:qo,filter:qo,log:qo,resolve:qo,value:qo};ve.errorsArray=function(){let t=[];return t[Pt.symbols.errors]=!0,t}});var jb=m((B4,mA)=>{"use strict";var hq=Me(),gA=mu(),qb=Ze(),di={};mA.exports=di.Values=class{constructor(t,e){this._values=new Set(t),this._refs=new Set(e),this._lowercase=di.lowercases(t),this._override=!1}get length(){return this._values.size+this._refs.size}add(t,e){if(qb.isResolvable(t)){this._refs.has(t)||(this._refs.add(t),e&&e.register(t));return}this.has(t,null,null,!1)||(this._values.add(t),typeof t=="string"&&this._lowercase.set(t.toLowerCase(),t))}static merge(t,e,n){if(t=t||new di.Values,e){if(e._override)return e.clone();for(let r of[...e._values,...e._refs])t.add(r)}if(n)for(let r of[...n._values,...n._refs])t.remove(r);return t.length?t:null}remove(t){if(qb.isResolvable(t)){this._refs.delete(t);return}this._values.delete(t),typeof t=="string"&&this._lowercase.delete(t.toLowerCase())}has(t,e,n,r){return!!this.get(t,e,n,r)}get(t,e,n,r){if(!this.length)return!1;if(this._values.has(t))return{value:t};if(typeof t=="string"&&t&&r){let i=this._lowercase.get(t.toLowerCase());if(i)return{value:i}}if(!this._refs.size&&typeof t!="object")return!1;if(typeof t=="object"){for(let i of this._values)if(gA(i,t))return{value:i}}if(e)for(let i of this._refs){let s=i.resolve(t,e,n,null,{in:!0});if(s===void 0)continue;let o=!i.in||typeof s!="object"?[s]:Array.isArray(s)?s:Object.keys(s);for(let a of o)if(typeof a==typeof t){if(r&&t&&typeof t=="string"){if(a.toLowerCase()===t.toLowerCase())return{value:a,ref:i}}else if(gA(a,t))return{value:a,ref:i}}}return!1}override(){this._override=!0}values(t){if(t&&t.display){let e=[];for(let n of[...this._values,...this._refs])n!==void 0&&e.push(n);return e}return Array.from([...this._values,...this._refs])}clone(){let t=new di.Values(this._values,this._refs);return t._override=this._override,t}concat(t){hq(!t._override,"Cannot concat override set of values");let e=new di.Values([...this._values,...t._values],[...this._refs,...t._refs]);return e._override=this._override,e}describe(){let t=[];this._override&&t.push({override:!0});for(let e of this._values.values())t.push(e&&typeof e=="object"?{value:e}:e);for(let e of this._refs.values())t.push(e.describe());return t}};di.Values.prototype[qb.symbols.values]=!0;di.Values.prototype.slice=di.Values.prototype.clone;di.lowercases=function(t){let e=new Map;if(t)for(let n of t)typeof n=="string"&&e.set(n.toLowerCase(),n);return e}});var EA=m((W4,TA)=>{"use strict";var Z=Me(),yA=ln(),bA=mu(),Fb=jh(),dq=Cb(),wt=Ze(),$b=ks(),fq=ui(),pq=Ob(),_A=Db(),gq=Mo(),vA=aA(),SA=ci(),wA=Mb(),$h=pA(),Bh=jb(),Ft={};Ft.Base=class{constructor(t){this.type=t,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new vA.Ids,this._preferences=null,this._refs=new SA.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return Z(typeof _A.describe=="function","Manifest functionality disabled"),_A.describe(this)}allow(...t){return wt.verifyFlat(t,"allow"),this._values(t,"_valids")}alter(t){Z(t&&typeof t=="object"&&!Array.isArray(t),"Invalid targets argument"),Z(!this._inRuleset(),"Cannot set alterations inside a ruleset");let e=this.clone();e.$_terms.alterations=e.$_terms.alterations||[];for(let n in t){let r=t[n];Z(typeof r=="function","Alteration adjuster for",n,"must be a function"),e.$_terms.alterations.push({target:n,adjuster:r})}return e.$_temp.ruleset=!1,e}artifact(t){return Z(t!==void 0,"Artifact cannot be undefined"),Z(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",t)}cast(t){return Z(t===!1||typeof t=="string","Invalid to value"),Z(t===!1||this._definition.cast[t],"Type",this.type,"does not support casting to",t),this.$_setFlag("cast",t===!1?void 0:t)}default(t,e){return this._default("default",t,e)}description(t){return Z(t&&typeof t=="string","Description must be a non-empty string"),this.$_setFlag("description",t)}empty(t){let e=this.clone();return t!==void 0&&(t=e.$_compile(t,{override:!1})),e.$_setFlag("empty",t,{clone:!1})}error(t){return Z(t,"Missing error"),Z(t instanceof Error||typeof t=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",t)}example(t,e={}){return Z(t!==void 0,"Missing example"),wt.assertOptions(e,["override"]),this._inner("examples",t,{single:!0,override:e.override})}external(t,e){return typeof t=="object"&&(Z(!e,"Cannot combine options with description"),e=t.description,t=t.method),Z(typeof t=="function","Method must be a function"),Z(e===void 0||e&&typeof e=="string","Description must be a non-empty string"),this._inner("externals",{method:t,description:e},{single:!0})}failover(t,e){return this._default("failover",t,e)}forbidden(){return this.presence("forbidden")}id(t){return t?(Z(typeof t=="string","id must be a non-empty string"),Z(/^[^\.]+$/.test(t),"id cannot contain period character"),this.$_setFlag("id",t)):this.$_setFlag("id",void 0)}invalid(...t){return this._values(t,"_invalids")}label(t){return Z(t&&typeof t=="string","Label name must be a non-empty string"),this.$_setFlag("label",t)}meta(t){return Z(t!==void 0,"Meta cannot be undefined"),this._inner("metas",t,{single:!0})}note(...t){Z(t.length,"Missing notes");for(let e of t)Z(e&&typeof e=="string","Notes must be non-empty strings");return this._inner("notes",t)}only(t=!0){return Z(typeof t=="boolean","Invalid mode:",t),this.$_setFlag("only",t)}optional(){return this.presence("optional")}prefs(t){Z(t,"Missing preferences"),Z(t.context===void 0,"Cannot override context"),Z(t.externals===void 0,"Cannot override externals"),Z(t.warnings===void 0,"Cannot override warnings"),Z(t.debug===void 0,"Cannot override debug"),wt.checkPreferences(t);let e=this.clone();return e._preferences=wt.preferences(e._preferences,t),e}presence(t){return Z(["optional","required","forbidden"].includes(t),"Unknown presence mode",t),this.$_setFlag("presence",t)}raw(t=!0){return this.$_setFlag("result",t?"raw":void 0)}result(t){return Z(["raw","strip"].includes(t),"Unknown result mode",t),this.$_setFlag("result",t)}required(){return this.presence("required")}strict(t){let e=this.clone(),n=t===void 0?!1:!t;return e._preferences=wt.preferences(e._preferences,{convert:n}),e}strip(t=!0){return this.$_setFlag("result",t?"strip":void 0)}tag(...t){Z(t.length,"Missing tags");for(let e of t)Z(e&&typeof e=="string","Tags must be non-empty strings");return this._inner("tags",t)}unit(t){return Z(t&&typeof t=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",t)}valid(...t){wt.verifyFlat(t,"valid");let e=this.allow(...t);return e.$_setFlag("only",!!e._valids,{clone:!1}),e}when(t,e){let n=this.clone();n.$_terms.whens||(n.$_terms.whens=[]);let r=$b.when(n,t,e);if(!["any","link"].includes(n.type)){let i=r.is?[r]:r.switch;for(let s of i)Z(!s.then||s.then.type==="any"||s.then.type===n.type,"Cannot combine",n.type,"with",s.then&&s.then.type),Z(!s.otherwise||s.otherwise.type==="any"||s.otherwise.type===n.type,"Cannot combine",n.type,"with",s.otherwise&&s.otherwise.type)}return n.$_terms.whens.push(r),n.$_mutateRebuild()}cache(t){Z(!this._inRuleset(),"Cannot set caching inside a ruleset"),Z(!this._cache,"Cannot override schema cache"),Z(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");let e=this.clone();return e._cache=t||dq.provider.provision(),e.$_temp.ruleset=!1,e}clone(){let t=Object.create(Object.getPrototypeOf(this));return this._assign(t)}concat(t){Z(wt.isSchema(t),"Invalid schema object"),Z(this.type==="any"||t.type==="any"||t.type===this.type,"Cannot merge type",this.type,"with another type:",t.type),Z(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),Z(!t._inRuleset(),"Cannot concatenate a schema with open ruleset");let e=this.clone();if(this.type==="any"&&t.type!=="any"){let n=t.clone();for(let r of Object.keys(e))r!=="type"&&(n[r]=e[r]);e=n}e._ids.concat(t._ids),e._refs.register(t,SA.toSibling),e._preferences=e._preferences?wt.preferences(e._preferences,t._preferences):t._preferences,e._valids=Bh.merge(e._valids,t._valids,t._invalids),e._invalids=Bh.merge(e._invalids,t._invalids,t._valids);for(let n of t._singleRules.keys())e._singleRules.has(n)&&(e._rules=e._rules.filter(r=>r.keep||r.name!==n),e._singleRules.delete(n));for(let n of t._rules)t._definition.rules[n.method].multi||e._singleRules.set(n.name,n),e._rules.push(n);if(e._flags.empty&&t._flags.empty){e._flags.empty=e._flags.empty.concat(t._flags.empty);let n=Object.assign({},t._flags);delete n.empty,Fb(e._flags,n)}else if(t._flags.empty){e._flags.empty=t._flags.empty;let n=Object.assign({},t._flags);delete n.empty,Fb(e._flags,n)}else Fb(e._flags,t._flags);for(let n in t.$_terms){let r=t.$_terms[n];if(!r){e.$_terms[n]||(e.$_terms[n]=r);continue}if(!e.$_terms[n]){e.$_terms[n]=r.slice();continue}e.$_terms[n]=e.$_terms[n].concat(r)}return this.$_root._tracer&&this.$_root._tracer._combine(e,[this,t]),e.$_mutateRebuild()}extend(t){return Z(!t.base,"Cannot extend type with another base"),pq.type(this,t)}extract(t){return t=Array.isArray(t)?t:t.split("."),this._ids.reach(t)}fork(t,e){Z(!this._inRuleset(),"Cannot fork inside a ruleset");let n=this;for(let r of[].concat(t))r=Array.isArray(r)?r:r.split("."),n=n._ids.fork(r,e,n);return n.$_temp.ruleset=!1,n}rule(t){let e=this._definition;wt.assertOptions(t,Object.keys(e.modifiers)),Z(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");let n=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;Z(n>=0&&n<this._rules.length,"Cannot apply rules to empty ruleset");let r=this.clone();for(let i=n;i<r._rules.length;++i){let s=r._rules[i],o=yA(s);for(let a in t)e.modifiers[a](o,t[a]),Z(o.name===s.name,"Cannot change rule name");r._rules[i]=o,r._singleRules.get(o.name)===s&&r._singleRules.set(o.name,o)}return r.$_temp.ruleset=!1,r.$_mutateRebuild()}get ruleset(){Z(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");let t=this.clone();return t.$_temp.ruleset=t._rules.length,t}get $(){return this.ruleset}tailor(t){t=[].concat(t),Z(!this._inRuleset(),"Cannot tailor inside a ruleset");let e=this;if(this.$_terms.alterations)for(let{target:n,adjuster:r}of this.$_terms.alterations)t.includes(n)&&(e=r(e),Z(wt.isSchema(e),"Alteration adjuster for",n,"failed to return a schema object"));return e=e.$_modify({each:n=>n.tailor(t),ref:!1}),e.$_temp.ruleset=!1,e.$_mutateRebuild()}tracer(){return wA.location?wA.location(this):this}validate(t,e){return $h.entry(t,this,e)}validateAsync(t,e){return $h.entryAsync(t,this,e)}$_addRule(t){typeof t=="string"&&(t={name:t}),Z(t&&typeof t=="object","Invalid options"),Z(t.name&&typeof t.name=="string","Invalid rule name");for(let s in t)Z(s[0]!=="_","Cannot set private rule properties");let e=Object.assign({},t);e._resolve=[],e.method=e.method||e.name;let n=this._definition.rules[e.method],r=e.args;Z(n,"Unknown rule",e.method);let i=this.clone();if(r){Z(Object.keys(r).length===1||Object.keys(r).length===this._definition.rules[e.name].args.length,"Invalid rule definition for",this.type,e.name);for(let s in r){let o=r[s];if(n.argsByName){let a=n.argsByName.get(s);if(a.ref&&wt.isResolvable(o))e._resolve.push(s),i.$_mutateRegister(o);else if(a.normalize&&(o=a.normalize(o),r[s]=o),a.assert){let u=wt.validateArg(o,s,a);Z(!u,u,"or reference")}}if(o===void 0){delete r[s];continue}r[s]=o}}return n.multi||(i._ruleRemove(e.name,{clone:!1}),i._singleRules.set(e.name,e)),i.$_temp.ruleset===!1&&(i.$_temp.ruleset=null),n.priority?i._rules.unshift(e):i._rules.push(e),i}$_compile(t,e){return $b.schema(this.$_root,t,e)}$_createError(t,e,n,r,i,s={}){let o=s.flags!==!1?this._flags:{},a=s.messages?gq.merge(this._definition.messages,s.messages):this._definition.messages;return new fq.Report(t,e,n,o,a,r,i)}$_getFlag(t){return this._flags[t]}$_getRule(t){return this._singleRules.get(t)}$_mapLabels(t){return t=Array.isArray(t)?t:t.split("."),this._ids.labels(t)}$_match(t,e,n,r){n=Object.assign({},n),n.abortEarly=!0,n._externals=!1,e.snapshot();let i=!$h.validate(t,this,e,n,r).errors;return e.restore(),i}$_modify(t){return wt.assertOptions(t,["each","once","ref","schema"]),vA.schema(this,t)||this}$_mutateRebuild(){Z(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset();let t=(e,{source:n,name:r,path:i,key:s})=>{let o=this._definition[n][r]&&this._definition[n][r].register;o!==!1&&this.$_mutateRegister(e,{family:o,key:s})};return this.$_modify({each:t}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(t,{family:e,key:n}={}){this._refs.register(t,e),this._ids.register(t,{key:n})}$_property(t){return this._definition.properties[t]}$_reach(t){return this._ids.reach(t)}$_rootReferences(){return this._refs.roots()}$_setFlag(t,e,n={}){Z(t[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");let r=this._definition.flags[t]||{};if(bA(e,r.default)&&(e=void 0),bA(e,this._flags[t]))return this;let i=n.clone!==!1?this.clone():this;return e!==void 0?(i._flags[t]=e,i.$_mutateRegister(e)):delete i._flags[t],t[0]!=="_"&&(i.$_temp.ruleset=!1),i}$_parent(t,...e){return this[t][wt.symbols.parent].call(this,...e)}$_validate(t,e,n){return $h.validate(t,this,e,n)}_assign(t){t.type=this.type,t.$_root=this.$_root,t.$_temp=Object.assign({},this.$_temp),t.$_temp.whens={},t._ids=this._ids.clone(),t._preferences=this._preferences,t._valids=this._valids&&this._valids.clone(),t._invalids=this._invalids&&this._invalids.clone(),t._rules=this._rules.slice(),t._singleRules=yA(this._singleRules,{shallow:!0}),t._refs=this._refs.clone(),t._flags=Object.assign({},this._flags),t._cache=null,t.$_terms={};for(let e in this.$_terms)t.$_terms[e]=this.$_terms[e]?this.$_terms[e].slice():null;t.$_super={};for(let e in this.$_super)t.$_super[e]=this._super[e].bind(t);return t}_bare(){let t=this.clone();t._reset();let e=t._definition.terms;for(let n in e){let r=e[n];t.$_terms[n]=r.init}return t.$_mutateRebuild()}_default(t,e,n={}){return wt.assertOptions(n,"literal"),Z(e!==void 0,"Missing",t,"value"),Z(typeof e=="function"||!n.literal,"Only function value supports literal option"),typeof e=="function"&&n.literal&&(e={[wt.symbols.literal]:!0,literal:e}),this.$_setFlag(t,e)}_generate(t,e,n){if(!this.$_terms.whens)return{schema:this};let r=[],i=[];for(let a=0;a<this.$_terms.whens.length;++a){let u=this.$_terms.whens[a];if(u.concat){r.push(u.concat),i.push(`${a}.concat`);continue}let c=u.ref?u.ref.resolve(t,e,n):t,l=u.is?[u]:u.switch,h=i.length;for(let d=0;d<l.length;++d){let{is:g,then:y,otherwise:_}=l[d],C=`${a}${u.switch?"."+d:""}`;if(g.$_match(c,e.nest(g,`${C}.is`),n)){if(y){let k=e.localize([...e.path,`${C}.then`],e.ancestors,e.schemas),{schema:T,id:w}=y._generate(t,k,n);r.push(T),i.push(`${C}.then${w?`(${w})`:""}`);break}}else if(_){let k=e.localize([...e.path,`${C}.otherwise`],e.ancestors,e.schemas),{schema:T,id:w}=_._generate(t,k,n);r.push(T),i.push(`${C}.otherwise${w?`(${w})`:""}`);break}}if(u.break&&i.length>h)break}let s=i.join(", ");if(e.mainstay.tracer.debug(e,"rule","when",s),!s)return{schema:this};if(!e.mainstay.tracer.active&&this.$_temp.whens[s])return{schema:this.$_temp.whens[s],id:s};let o=this;this._definition.generate&&(o=this._definition.generate(this,t,e,n));for(let a of r)o=o.concat(a);return this.$_root._tracer&&this.$_root._tracer._combine(o,[this,...r]),this.$_temp.whens[s]=o,{schema:o,id:s}}_inner(t,e,n={}){Z(!this._inRuleset(),`Cannot set ${t} inside a ruleset`);let r=this.clone();return(!r.$_terms[t]||n.override)&&(r.$_terms[t]=[]),n.single?r.$_terms[t].push(e):r.$_terms[t].push(...e),r.$_temp.ruleset=!1,r}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(t,e={}){if(!this._singleRules.has(t))return this;let n=e.clone!==!1?this.clone():this;n._singleRules.delete(t);let r=[];for(let i=0;i<n._rules.length;++i){let s=n._rules[i];if(s.name===t&&!s.keep){n._inRuleset()&&i<n.$_temp.ruleset&&--n.$_temp.ruleset;continue}r.push(s)}return n._rules=r,n}_values(t,e){wt.verifyFlat(t,e.slice(1,-1));let n=this.clone(),r=t[0]===wt.symbols.override;if(r&&(t=t.slice(1)),!n[e]&&t.length?n[e]=new Bh:r&&(n[e]=t.length?new Bh:null,n.$_mutateRebuild()),!n[e])return n;r&&n[e].override();for(let i of t){Z(i!==void 0,"Cannot call allow/valid/invalid with undefined"),Z(i!==wt.symbols.override,"Override must be the first value");let s=e==="_invalids"?"_valids":"_invalids";n[s]&&(n[s].remove(i),n[s].length||(Z(e==="_valids"||!n._flags.only,"Setting invalid value",i,"leaves schema rejecting all values due to previous valid rule"),n[s]=null)),n[e].add(i,n._refs)}return n}};Ft.Base.prototype[wt.symbols.any]={version:wt.version,compile:$b.compile,root:"$_root"};Ft.Base.prototype.isImmutable=!0;Ft.Base.prototype.deny=Ft.Base.prototype.invalid;Ft.Base.prototype.disallow=Ft.Base.prototype.invalid;Ft.Base.prototype.equal=Ft.Base.prototype.valid;Ft.Base.prototype.exist=Ft.Base.prototype.required;Ft.Base.prototype.not=Ft.Base.prototype.invalid;Ft.Base.prototype.options=Ft.Base.prototype.prefs;Ft.Base.prototype.preferences=Ft.Base.prototype.prefs;TA.exports=new Ft.Base});var Zn=m((G4,xA)=>{"use strict";var Uh=Me(),mq=EA(),yq=Ze(),bq=Mo();xA.exports=mq.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(t,e){return Uh(typeof t=="function","Method must be a function"),Uh(e===void 0||e&&typeof e=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:t,description:e}})},validate(t,e,{method:n}){try{return n(t,e)}catch(r){return e.error("any.custom",{error:r})}},args:["method","description"],multi:!0},messages:{method(t){return this.prefs({messages:t})}},shared:{method(t){Uh(yq.isSchema(t)&&t._flags.id,"Schema must be a schema with an id");let e=this.clone();return e.$_terms.shared=e.$_terms.shared||[],e.$_terms.shared.push(t),e.$_mutateRegister(t),e}},warning:{method(t,e){return Uh(t&&typeof t=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:t,local:e},warn:!0})},validate(t,e,{code:n,local:r}){return e.error(n,r)},args:["code","local"],multi:!0}},modifiers:{keep(t,e=!0){t.keep=e},message(t,e){t.message=bq.compile(e)},warn(t,e=!0){t.warn=e}},manifest:{build(t,e){for(let n in e){let r=e[n];if(["examples","externals","metas","notes","tags"].includes(n)){for(let i of r)t=t[n.slice(0,-1)](i);continue}if(n==="alterations"){let i={};for(let{target:s,adjuster:o}of r)i[s]=o;t=t.alter(i);continue}if(n==="whens"){for(let i of r){let{ref:s,is:o,not:a,then:u,otherwise:c,concat:l}=i;l?t=t.concat(l):s?t=t.when(s,{is:o,not:a,then:u,otherwise:c,switch:i.switch,break:i.break}):t=t.when(o,{then:u,otherwise:c,break:i.break})}continue}if(n==="shared")for(let i of r)t=t.shared(i)}return t}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})});var CA=m((z4,AA)=>{"use strict";var Cs=Me(),_q=jh(),vq=Zn(),kA=Ze(),Sq=ks(),Wh=ui(),wq=ci(),jo={};AA.exports=vq.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:wq.toSibling}},args(t,...e){return e.length===1&&Array.isArray(e[0])?t.try(...e[0]):t.try(...e)},validate(t,e){let{schema:n,error:r,state:i,prefs:s}=e;if(n._flags.match){let a=[],u=[];for(let l=0;l<n.$_terms.matches.length;++l){let h=n.$_terms.matches[l],d=i.nest(h.schema,`match.${l}`);d.snapshot();let g=h.schema.$_validate(t,d,s);g.errors?(u.push(g.errors),d.restore()):(a.push(g.value),d.commit())}if(a.length===0){let l={details:u.map(h=>Wh.details(h,{override:!1}))};return{errors:r("alternatives.any",l)}}if(n._flags.match==="one")return a.length===1?{value:a[0]}:{errors:r("alternatives.one")};if(a.length!==n.$_terms.matches.length){let l={details:u.map(h=>Wh.details(h,{override:!1}))};return{errors:r("alternatives.all",l)}}let c=l=>l.$_terms.matches.some(h=>h.schema.type==="object"||h.schema.type==="alternatives"&&c(h.schema));return c(n)?{value:a.reduce((l,h)=>_q(l,h,{mergeArrays:!1}))}:{value:a[a.length-1]}}let o=[];for(let a=0;a<n.$_terms.matches.length;++a){let u=n.$_terms.matches[a];if(u.schema){let h=i.nest(u.schema,`match.${a}`);h.snapshot();let d=u.schema.$_validate(t,h,s);if(!d.errors)return h.commit(),d;h.restore(),o.push({schema:u.schema,reports:d.errors});continue}let c=u.ref?u.ref.resolve(t,i,s):t,l=u.is?[u]:u.switch;for(let h=0;h<l.length;++h){let d=l[h],{is:g,then:y,otherwise:_}=d,C=`match.${a}${u.switch?"."+h:""}`;if(g.$_match(c,i.nest(g,`${C}.is`),s)){if(y)return y.$_validate(t,i.nest(y,`${C}.then`),s)}else if(_)return _.$_validate(t,i.nest(_,`${C}.otherwise`),s)}}return jo.errors(o,e)},rules:{conditional:{method(t,e){Cs(!this._flags._endedSwitch,"Unreachable condition"),Cs(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),Cs(e.break===void 0,"Cannot use break option with alternatives conditional");let n=this.clone(),r=Sq.when(n,t,e),i=r.is?[r]:r.switch;for(let s of i)if(s.then&&s.otherwise){n.$_setFlag("_endedSwitch",!0,{clone:!1});break}return n.$_terms.matches.push(r),n.$_mutateRebuild()}},match:{method(t){if(Cs(["any","one","all"].includes(t),"Invalid alternatives match mode",t),t!=="any")for(let e of this.$_terms.matches)Cs(e.schema,"Cannot combine match mode",t,"with conditional rules");return this.$_setFlag("match",t)}},try:{method(...t){Cs(t.length,"Missing alternative schemas"),kA.verifyFlat(t,"try"),Cs(!this._flags._endedSwitch,"Unreachable condition");let e=this.clone();for(let n of t)e.$_terms.matches.push({schema:e.$_compile(n)});return e.$_mutateRebuild()}}},overrides:{label(t){let e=this.$_parent("label",t),n=(r,i)=>i.path[0]!=="is"&&typeof r._flags.label!="string"?r.label(t):void 0;return e.$_modify({each:n,ref:!1})}},rebuild(t){let e=n=>{kA.isSchema(n)&&n.type==="array"&&t.$_setFlag("_arrayItems",!0,{clone:!1})};t.$_modify({each:e})},manifest:{build(t,e){if(e.matches)for(let n of e.matches){let{schema:r,ref:i,is:s,not:o,then:a,otherwise:u}=n;r?t=t.try(r):i?t=t.conditional(i,{is:s,then:a,not:o,otherwise:u,switch:n.switch}):t=t.conditional(s,{then:a,otherwise:u})}return t}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}});jo.errors=function(t,{error:e,state:n}){if(!t.length)return{errors:e("alternatives.any")};if(t.length===1)return{errors:t[0].reports};let r=new Set,i=[];for(let{reports:s,schema:o}of t){if(s.length>1)return jo.unmatched(t,e);let a=s[0];if(!(a instanceof Wh.Report))return jo.unmatched(t,e);if(a.state.path.length!==n.path.length){i.push({type:o.type,report:a});continue}if(a.code==="any.only"){for(let l of a.local.valids)r.add(l);continue}let[u,c]=a.code.split(".");c!=="base"?i.push({type:o.type,report:a}):a.code==="object.base"?r.add(a.local.type):r.add(u)}return i.length?i.length===1?{errors:i[0].report}:jo.unmatched(t,e):{errors:e("alternatives.types",{types:[...r]})}};jo.unmatched=function(t,e){let n=[];for(let r of t)n.push(...r.reports);return{errors:e("alternatives.match",Wh.details(n,{override:!1}))}}});var RA=m((K4,OA)=>{"use strict";var _u=Me(),Tq=mu(),Eq=Ts(),xq=Zn(),er=Ze(),kq=ks(),ut={};OA.exports=xq.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(t,{schema:e,state:n,prefs:r}){if(!Array.isArray(t))return;let i=e.$_getRule("sort");if(i)return ut.sort(e,t,i.args.options,n,r)}},validate(t,{schema:e,error:n}){if(!Array.isArray(t)){if(e._flags.single){let r=[t];return r[er.symbols.arraySingle]=!0,{value:r}}return{errors:n("array.base")}}if(!(!e.$_getRule("items")&&!e.$_terms.externals))return{value:t.slice()}},rules:{has:{method(t){t=this.$_compile(t,{appendPath:!0});let e=this.$_addRule({name:"has",args:{schema:t}});return e.$_mutateRegister(t),e},validate(t,{state:e,prefs:n,error:r},{schema:i}){let s=[t,...e.ancestors];for(let a=0;a<t.length;++a){let u=e.localize([...e.path,a],s,i);if(i.$_match(t[a],u,n))return t}let o=i._flags.label;return o?r("array.hasKnown",{patternLabel:o}):r("array.hasUnknown",null)},multi:!0},items:{method(...t){er.verifyFlat(t,"items");let e=this.$_addRule("items");for(let n=0;n<t.length;++n){let r=er.tryWithPath(()=>this.$_compile(t[n]),n,{append:!0});e.$_terms.items.push(r)}return e.$_mutateRebuild()},validate(t,{schema:e,error:n,state:r,prefs:i,errorsArray:s}){let o=e.$_terms._requireds.slice(),a=e.$_terms.ordered.slice(),u=[...e.$_terms._inclusions,...o],c=!t[er.symbols.arraySingle];delete t[er.symbols.arraySingle];let l=s(),h=t.length;for(let d=0;d<h;++d){let g=t[d],y=!1,_=!1,C=c?d:new Number(d),k=[...r.path,C];if(!e._flags.sparse&&g===void 0){if(l.push(n("array.sparse",{key:C,path:k,pos:d,value:void 0},r.localize(k))),i.abortEarly)return l;a.shift();continue}let T=[t,...r.ancestors];for(let R of e.$_terms._exclusions)if(R.$_match(g,r.localize(k,T,R),i,{presence:"ignore"})){if(l.push(n("array.excludes",{pos:d,value:g},r.localize(k))),i.abortEarly)return l;y=!0,a.shift();break}if(y)continue;if(e.$_terms.ordered.length){if(a.length){let R=a.shift(),U=R.$_validate(g,r.localize(k,T,R),i);if(U.errors){if(l.push(...U.errors),i.abortEarly)return l}else if(R._flags.result==="strip")ut.fastSplice(t,d),--d,--h;else if(!e._flags.sparse&&U.value===void 0){if(l.push(n("array.sparse",{key:C,path:k,pos:d,value:void 0},r.localize(k))),i.abortEarly)return l;continue}else t[d]=U.value;continue}else if(!e.$_terms.items.length){if(l.push(n("array.orderedLength",{pos:d,limit:e.$_terms.ordered.length})),i.abortEarly)return l;break}}let w=[],v=o.length;for(let R=0;R<v;++R){let U=r.localize(k,T,o[R]);U.snapshot();let te=o[R].$_validate(g,U,i);if(w[R]=te,!te.errors){if(U.commit(),t[d]=te.value,_=!0,ut.fastSplice(o,R),--R,--v,!e._flags.sparse&&te.value===void 0&&(l.push(n("array.sparse",{key:C,path:k,pos:d,value:void 0},r.localize(k))),i.abortEarly))return l;break}U.restore()}if(_)continue;let L=i.stripUnknown&&!!i.stripUnknown.arrays||!1;v=u.length;for(let R of u){let U,te=o.indexOf(R);if(te!==-1)U=w[te];else{let se=r.localize(k,T,R);if(se.snapshot(),U=R.$_validate(g,se,i),!U.errors){se.commit(),R._flags.result==="strip"?(ut.fastSplice(t,d),--d,--h):!e._flags.sparse&&U.value===void 0?(l.push(n("array.sparse",{key:C,path:k,pos:d,value:void 0},r.localize(k))),y=!0):t[d]=U.value,_=!0;break}se.restore()}if(v===1){if(L){ut.fastSplice(t,d),--d,--h,_=!0;break}if(l.push(...U.errors),i.abortEarly)return l;y=!0;break}}if(!y&&(e.$_terms._inclusions.length||e.$_terms._requireds.length)&&!_){if(L){ut.fastSplice(t,d),--d,--h;continue}if(l.push(n("array.includes",{pos:d,value:g},r.localize(k))),i.abortEarly)return l}}return o.length&&ut.fillMissedErrors(e,l,o,t,r,i),a.length&&(ut.fillOrderedErrors(e,l,a,t,r,i),l.length||ut.fillDefault(a,t,r,i)),l.length?l:t},priority:!0,manifest:!1},length:{method(t){return this.$_addRule({name:"length",args:{limit:t},operator:"="})},validate(t,e,{limit:n},{name:r,operator:i,args:s}){return er.compare(t.length,n,i)?t:e.error("array."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:er.limit,message:"must be a positive integer"}]},max:{method(t){return this.$_addRule({name:"max",method:"length",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"length",args:{limit:t},operator:">="})}},ordered:{method(...t){er.verifyFlat(t,"ordered");let e=this.$_addRule("items");for(let n=0;n<t.length;++n){let r=er.tryWithPath(()=>this.$_compile(t[n]),n,{append:!0});ut.validateSingle(r,e),e.$_mutateRegister(r),e.$_terms.ordered.push(r)}return e.$_mutateRebuild()}},single:{method(t){let e=t===void 0?!0:!!t;return _u(!e||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",e)}},sort:{method(t={}){er.assertOptions(t,["by","order"]);let e={order:t.order||"ascending"};return t.by&&(e.by=kq.ref(t.by,{ancestor:0}),_u(!e.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:e}})},validate(t,{error:e,state:n,prefs:r,schema:i},{options:s}){let{value:o,errors:a}=ut.sort(i,t,s,n,r);if(a)return a;for(let u=0;u<t.length;++u)if(t[u]!==o[u])return e("array.sort",{order:s.order,by:s.by?s.by.key:"value"});return t},convert:!0},sparse:{method(t){let e=t===void 0?!0:!!t;return this._flags.sparse===e?this:(e?this.clone():this.$_addRule("items")).$_setFlag("sparse",e,{clone:!1})}},unique:{method(t,e={}){_u(!t||typeof t=="function"||typeof t=="string","comparator must be a function or a string"),er.assertOptions(e,["ignoreUndefined","separator"]);let n={name:"unique",args:{options:e,comparator:t}};if(t)if(typeof t=="string"){let r=er.default(e.separator,".");n.path=r?t.split(r):[t]}else n.comparator=t;return this.$_addRule(n)},validate(t,{state:e,error:n,schema:r},{comparator:i,options:s},{comparator:o,path:a}){let u={string:Object.create(null),number:Object.create(null),undefined:Object.create(null),boolean:Object.create(null),bigint:Object.create(null),object:new Map,function:new Map,custom:new Map},c=o||Tq,l=s.ignoreUndefined;for(let h=0;h<t.length;++h){let d=a?Eq(t[h],a):t[h],g=o?u.custom:u[typeof d];if(_u(g,"Failed to find unique map container for type",typeof d),g instanceof Map){let y=g.entries(),_;for(;!(_=y.next()).done;)if(c(_.value[0],d)){let C=e.localize([...e.path,h],[t,...e.ancestors]),k={pos:h,value:t[h],dupePos:_.value[1],dupeValue:t[_.value[1]]};return a&&(k.path=i),n("array.unique",k,C)}g.set(d,h)}else{if((!l||d!==void 0)&&g[d]!==void 0){let y={pos:h,value:t[h],dupePos:g[d],dupeValue:t[g[d]]};a&&(y.path=i);let _=e.localize([...e.path,h],[t,...e.ancestors]);return n("array.unique",y,_)}g[d]=h}}return t},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to(t,e){return new Set(t)}}},rebuild(t){t.$_terms._inclusions=[],t.$_terms._exclusions=[],t.$_terms._requireds=[];for(let e of t.$_terms.items)ut.validateSingle(e,t),e._flags.presence==="required"?t.$_terms._requireds.push(e):e._flags.presence==="forbidden"?t.$_terms._exclusions.push(e):t.$_terms._inclusions.push(e);for(let e of t.$_terms.ordered)ut.validateSingle(e,t)},manifest:{build(t,e){return e.items&&(t=t.items(...e.items)),e.ordered&&(t=t.ordered(...e.ordered)),t}},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}});ut.fillMissedErrors=function(t,e,n,r,i,s){let o=[],a=0;for(let u of n){let c=u._flags.label;c?o.push(c):++a}o.length?a?e.push(t.$_createError("array.includesRequiredBoth",r,{knownMisses:o,unknownMisses:a},i,s)):e.push(t.$_createError("array.includesRequiredKnowns",r,{knownMisses:o},i,s)):e.push(t.$_createError("array.includesRequiredUnknowns",r,{unknownMisses:a},i,s))};ut.fillOrderedErrors=function(t,e,n,r,i,s){let o=[];for(let a of n)a._flags.presence==="required"&&o.push(a);o.length&&ut.fillMissedErrors(t,e,o,r,i,s)};ut.fillDefault=function(t,e,n,r){let i=[],s=!0;for(let o=t.length-1;o>=0;--o){let a=t[o],u=[e,...n.ancestors],c=a.$_validate(void 0,n.localize(n.path,u,a),r).value;if(s){if(c===void 0)continue;s=!1}i.unshift(c)}i.length&&e.push(...i)};ut.fastSplice=function(t,e){let n=e;for(;n<t.length;)t[n++]=t[n];--t.length};ut.validateSingle=function(t,e){(t.type==="array"||t._flags._arrayItems)&&(_u(!e._flags.single,"Cannot specify array item with single rule enabled"),e.$_setFlag("_arrayItems",!0,{clone:!1}))};ut.sort=function(t,e,n,r,i){let s=n.order==="ascending"?1:-1,o=-1*s,a=s,u=(c,l)=>{let h=ut.compare(c,l,o,a);if(h!==null||(n.by&&(c=n.by.resolve(c,r,i),l=n.by.resolve(l,r,i)),h=ut.compare(c,l,o,a),h!==null))return h;let d=typeof c;if(d!==typeof l)throw t.$_createError("array.sort.mismatching",e,null,r,i);if(d!=="number"&&d!=="string")throw t.$_createError("array.sort.unsupported",e,{type:d},r,i);return d==="number"?(c-l)*s:c<l?o:a};try{return{value:e.slice().sort(u)}}catch(c){return{errors:c}}};ut.compare=function(t,e,n,r){return t===e?0:t===void 0?1:e===void 0?-1:t===null?r:e===null?n:null}});var LA=m((V4,MA)=>{"use strict";var PA=Me(),Aq=Zn(),DA=Ze(),IA=jb(),Bb={};Bb.isBool=function(t){return typeof t=="boolean"};MA.exports=Aq.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(t,{schema:e}){if(typeof t!="boolean"){if(typeof t=="string"){let n=e._flags.sensitive?t:t.toLowerCase();t=n==="true"?!0:n==="false"?!1:t}return typeof t!="boolean"&&(t=e.$_terms.truthy&&e.$_terms.truthy.has(t,null,null,!e._flags.sensitive)||(e.$_terms.falsy&&e.$_terms.falsy.has(t,null,null,!e._flags.sensitive)?!1:t)),{value:t}}},validate(t,{error:e}){if(typeof t!="boolean")return{value:t,errors:e("boolean.base")}},rules:{truthy:{method(...t){DA.verifyFlat(t,"truthy");let e=this.clone();e.$_terms.truthy=e.$_terms.truthy||new IA;for(let n=0;n<t.length;++n){let r=t[n];PA(r!==void 0,"Cannot call truthy with undefined"),e.$_terms.truthy.add(r)}return e}},falsy:{method(...t){DA.verifyFlat(t,"falsy");let e=this.clone();e.$_terms.falsy=e.$_terms.falsy||new IA;for(let n=0;n<t.length;++n){let r=t[n];PA(r!==void 0,"Cannot call falsy with undefined"),e.$_terms.falsy.add(r)}return e}},sensitive:{method(t=!0){return this.$_setFlag("sensitive",t)}}},cast:{number:{from:Bb.isBool,to(t,e){return t?1:0}},string:{from:Bb.isBool,to(t,e){return t?"true":"false"}}},manifest:{build(t,e){return e.truthy&&(t=t.truthy(...e.truthy)),e.falsy&&(t=t.falsy(...e.falsy)),t}},messages:{"boolean.base":"{{#label}} must be a boolean"}})});var FA=m((X4,jA)=>{"use strict";var NA=Me(),Cq=Zn(),qA=Ze(),Oq=Ui(),wr={};wr.isDate=function(t){return t instanceof Date};jA.exports=Cq.extend({type:"date",coerce:{from:["number","string"],method(t,{schema:e}){return{value:wr.parse(t,e._flags.format)||t}}},validate(t,{schema:e,error:n,prefs:r}){if(t instanceof Date&&!isNaN(t.getTime()))return;let i=e._flags.format;return!r.convert||!i||typeof t!="string"?{value:t,errors:n("date.base")}:{value:t,errors:n("date.format",{format:i})}},rules:{compare:{method:!1,validate(t,e,{date:n},{name:r,operator:i,args:s}){let o=n==="now"?Date.now():n.getTime();return qA.compare(t.getTime(),o,i)?t:e.error("date."+r,{limit:s.date,value:t})},args:[{name:"date",ref:!0,normalize:t=>t==="now"?t:wr.parse(t),assert:t=>t!==null,message:"must have a valid date format"}]},format:{method(t){return NA(["iso","javascript","unix"].includes(t),"Unknown date format",t),this.$_setFlag("format",t)}},greater:{method(t){return this.$_addRule({name:"greater",method:"compare",args:{date:t},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(t){return this.$_addRule({name:"less",method:"compare",args:{date:t},operator:"<"})}},max:{method(t){return this.$_addRule({name:"max",method:"compare",args:{date:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"compare",args:{date:t},operator:">="})}},timestamp:{method(t="javascript"){return NA(["javascript","unix"].includes(t),'"type" must be one of "javascript, unix"'),this.format(t)}}},cast:{number:{from:wr.isDate,to(t,e){return t.getTime()}},string:{from:wr.isDate,to(t,{prefs:e}){return Oq.date(t,e)}}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}});wr.parse=function(t,e){if(t instanceof Date)return t;if(typeof t!="string"&&(isNaN(t)||!isFinite(t))||/^\s*$/.test(t))return null;if(e==="iso")return qA.isIsoDate(t)?wr.date(t.toString()):null;let n=t;if(typeof t=="string"&&/^[+-]?\d+(\.\d+)?$/.test(t)&&(t=parseFloat(t)),e){if(e==="javascript")return wr.date(1*t);if(e==="unix")return wr.date(1e3*t);if(typeof n=="string")return null}return wr.date(t)};wr.date=function(t){let e=new Date(t);return isNaN(e.getTime())?null:e}});var HA=m((Y4,WA)=>{"use strict";var Hh=Me(),BA=ln(),UA=jh(),$A=Ts(),Gh={};WA.exports=function(t,e,n={}){if(Hh(t&&typeof t=="object","Invalid defaults value: must be an object"),Hh(!e||e===!0||typeof e=="object","Invalid source value: must be true, falsy or an object"),Hh(typeof n=="object","Invalid options: must be an object"),!e)return null;if(n.shallow)return Gh.applyToDefaultsWithShallow(t,e,n);let r=BA(t);if(e===!0)return r;let i=n.nullOverride!==void 0?n.nullOverride:!1;return UA(r,e,{nullOverride:i,mergeArrays:!1})};Gh.applyToDefaultsWithShallow=function(t,e,n){let r=n.shallow;Hh(Array.isArray(r),"Invalid keys");let i=new Map,s=e===!0?null:new Set;for(let u of r){u=Array.isArray(u)?u:u.split(".");let c=$A(t,u);c&&typeof c=="object"?i.set(c,s&&$A(e,u)||c):s&&s.add(u)}let o=BA(t,{},i);if(!s)return o;for(let u of s)Gh.reachCopy(o,e,u);let a=n.nullOverride!==void 0?n.nullOverride:!1;return UA(o,e,{nullOverride:a,mergeArrays:!1})};Gh.reachCopy=function(t,e,n){for(let s of n){if(!(s in e))return;let o=e[s];if(typeof o!="object"||o===null)return;e=o}let r=e,i=t;for(let s=0;s<n.length-1;++s){let o=n[s];typeof i[o]!="object"&&(i[o]={}),i=i[o]}i[n[n.length-1]]=r}});var KA=m(zA=>{"use strict";var Os=Me(),GA={};zA.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(t,e){e=e||{};let n=[].concat(e.before||[]),r=[].concat(e.after||[]),i=e.group||"?",s=e.sort||0;Os(!n.includes(i),`Item cannot come before itself: ${i}`),Os(!n.includes("?"),"Item cannot come before unassociated items"),Os(!r.includes(i),`Item cannot come after itself: ${i}`),Os(!r.includes("?"),"Item cannot come after unassociated items"),Array.isArray(t)||(t=[t]);for(let o of t){let a={seq:this._items.length,sort:s,before:n,after:r,group:i,node:o};this._items.push(a)}if(!e.manual){let o=this._sort();Os(o,"item",i!=="?"?`added into group ${i}`:"","created a dependencies error")}return this.nodes}merge(t){Array.isArray(t)||(t=[t]);for(let n of t)if(n)for(let r of n._items)this._items.push(Object.assign({},r));this._items.sort(GA.mergeSort);for(let n=0;n<this._items.length;++n)this._items[n].seq=n;let e=this._sort();return Os(e,"merge created a dependencies error"),this.nodes}sort(){let t=this._sort();return Os(t,"sort created a dependencies error"),this.nodes}_sort(){let t={},e=Object.create(null),n=Object.create(null);for(let a of this._items){let u=a.seq,c=a.group;n[c]=n[c]||[],n[c].push(u),t[u]=a.before;for(let l of a.after)e[l]=e[l]||[],e[l].push(u)}for(let a in t){let u=[];for(let c in t[a]){let l=t[a][c];n[l]=n[l]||[],u.push(...n[l])}t[a]=u}for(let a in e)if(n[a])for(let u of n[a])t[u].push(...e[a]);let r={};for(let a in t){let u=t[a];for(let c of u)r[c]=r[c]||[],r[c].push(a)}let i={},s=[];for(let a=0;a<this._items.length;++a){let u=a;if(r[a]){u=null;for(let c=0;c<this._items.length;++c){if(i[c]===!0)continue;r[c]||(r[c]=[]);let l=r[c].length,h=0;for(let d=0;d<l;++d)i[r[c][d]]&&++h;if(h===l){u=c;break}}}u!==null&&(i[u]=!0,s.push(u))}if(s.length!==this._items.length)return!1;let o={};for(let a of this._items)o[a.seq]=a;this._items=[],this.nodes=[];for(let a of s){let u=o[a];this.nodes.push(u.node),this._items.push(u)}return!0}};GA.mergeSort=(t,e)=>t.sort===e.sort?0:t.sort<e.sort?-1:1});var Wb=m((Z4,YA)=>{"use strict";var Rq=HA(),tr=Me(),VA=ln(),Pq=KA(),Dq=Zn(),rn=Ze(),Ub=ks(),Iq=ui(),XA=ci(),zh=Ui(),de={renameDefaults:{alias:!1,multiple:!1,override:!1}};YA.exports=Dq.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:void 0}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args(t,e){return t.keys(e)},validate(t,{schema:e,error:n,state:r,prefs:i}){if(!t||typeof t!==e.$_property("typeof")||Array.isArray(t))return{value:t,errors:n("object.base",{type:e.$_property("typeof")})};if(!e.$_terms.renames&&!e.$_terms.dependencies&&!e.$_terms.keys&&!e.$_terms.patterns&&!e.$_terms.externals)return;t=de.clone(t,i);let s=[];if(e.$_terms.renames&&!de.rename(e,t,r,i,s))return{value:t,errors:s};if(!e.$_terms.keys&&!e.$_terms.patterns&&!e.$_terms.dependencies)return{value:t,errors:s};let o=new Set(Object.keys(t));if(e.$_terms.keys){let a=[t,...r.ancestors];for(let u of e.$_terms.keys){let c=u.key,l=t[c];o.delete(c);let h=r.localize([...r.path,c],a,u),d=u.schema.$_validate(l,h,i);if(d.errors){if(i.abortEarly)return{value:t,errors:d.errors};d.value!==void 0&&(t[c]=d.value),s.push(...d.errors)}else u.schema._flags.result==="strip"||d.value===void 0&&l!==void 0?delete t[c]:d.value!==void 0&&(t[c]=d.value)}}if(o.size||e._flags._hasPatternMatch){let a=de.unknown(e,t,o,s,r,i);if(a)return a}if(e.$_terms.dependencies)for(let a of e.$_terms.dependencies){if(a.key!==null&&de.isPresent(a.options)(a.key.resolve(t,r,i,null,{shadow:!1}))===!1)continue;let u=de.dependencies[a.rel](e,a,t,r,i);if(u){let c=e.$_createError(u.code,t,u.context,r,i);if(i.abortEarly)return{value:t,errors:c};s.push(c)}}return{value:t,errors:s}},rules:{and:{method(...t){return rn.verifyFlat(t,"and"),de.dependency(this,"and",null,t)}},append:{method(t){return t==null||Object.keys(t).length===0?this:this.keys(t)}},assert:{method(t,e,n){zh.isTemplate(t)||(t=Ub.ref(t)),tr(n===void 0||typeof n=="string","Message must be a string"),e=this.$_compile(e,{appendPath:!0});let r=this.$_addRule({name:"assert",args:{subject:t,schema:e,message:n}});return r.$_mutateRegister(t),r.$_mutateRegister(e),r},validate(t,{error:e,prefs:n,state:r},{subject:i,schema:s,message:o}){let a=i.resolve(t,r,n),u=XA.isRef(i)?i.absolute(r):[];return s.$_match(a,r.localize(u,[t,...r.ancestors],s),n)?t:e("object.assert",{subject:i,message:o})},args:["subject","schema","message"],multi:!0},instance:{method(t,e){return tr(typeof t=="function","constructor must be a function"),e=e||t.name,this.$_addRule({name:"instance",args:{constructor:t,name:e}})},validate(t,e,{constructor:n,name:r}){return t instanceof n?t:e.error("object.instance",{type:r,value:t})},args:["constructor","name"]},keys:{method(t){tr(t===void 0||typeof t=="object","Object schema must be a valid object"),tr(!rn.isSchema(t),"Object schema cannot be a joi schema");let e=this.clone();if(!t)e.$_terms.keys=null;else if(!Object.keys(t).length)e.$_terms.keys=new de.Keys;else{e.$_terms.keys=e.$_terms.keys?e.$_terms.keys.filter(n=>!t.hasOwnProperty(n.key)):new de.Keys;for(let n in t)rn.tryWithPath(()=>e.$_terms.keys.push({key:n,schema:this.$_compile(t[n])}),n)}return e.$_mutateRebuild()}},length:{method(t){return this.$_addRule({name:"length",args:{limit:t},operator:"="})},validate(t,e,{limit:n},{name:r,operator:i,args:s}){return rn.compare(Object.keys(t).length,n,i)?t:e.error("object."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:rn.limit,message:"must be a positive integer"}]},max:{method(t){return this.$_addRule({name:"max",method:"length",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"length",args:{limit:t},operator:">="})}},nand:{method(...t){return rn.verifyFlat(t,"nand"),de.dependency(this,"nand",null,t)}},or:{method(...t){return rn.verifyFlat(t,"or"),de.dependency(this,"or",null,t)}},oxor:{method(...t){return de.dependency(this,"oxor",null,t)}},pattern:{method(t,e,n={}){let r=t instanceof RegExp;r||(t=this.$_compile(t,{appendPath:!0})),tr(e!==void 0,"Invalid rule"),rn.assertOptions(n,["fallthrough","matches"]),r&&tr(!t.flags.includes("g")&&!t.flags.includes("y"),"pattern should not use global or sticky mode"),e=this.$_compile(e,{appendPath:!0});let i=this.clone();i.$_terms.patterns=i.$_terms.patterns||[];let s={[r?"regex":"schema"]:t,rule:e};return n.matches&&(s.matches=this.$_compile(n.matches),s.matches.type!=="array"&&(s.matches=s.matches.$_root.array().items(s.matches)),i.$_mutateRegister(s.matches),i.$_setFlag("_hasPatternMatch",!0,{clone:!1})),n.fallthrough&&(s.fallthrough=!0),i.$_terms.patterns.push(s),i.$_mutateRegister(e),i}},ref:{method(){return this.$_addRule("ref")},validate(t,e){return XA.isRef(t)?t:e.error("object.refType",{value:t})}},regex:{method(){return this.$_addRule("regex")},validate(t,e){return t instanceof RegExp?t:e.error("object.regex",{value:t})}},rename:{method(t,e,n={}){tr(typeof t=="string"||t instanceof RegExp,"Rename missing the from argument"),tr(typeof e=="string"||e instanceof zh,"Invalid rename to argument"),tr(e!==t,"Cannot rename key to same name:",t),rn.assertOptions(n,["alias","ignoreUndefined","override","multiple"]);let r=this.clone();r.$_terms.renames=r.$_terms.renames||[];for(let i of r.$_terms.renames)tr(i.from!==t,"Cannot rename the same key multiple times");return e instanceof zh&&r.$_mutateRegister(e),r.$_terms.renames.push({from:t,to:e,options:Rq(de.renameDefaults,n)}),r}},schema:{method(t="any"){return this.$_addRule({name:"schema",args:{type:t}})},validate(t,e,{type:n}){return rn.isSchema(t)&&(n==="any"||t.type===n)?t:e.error("object.schema",{type:n})}},unknown:{method(t){return this.$_setFlag("unknown",t!==!1)}},with:{method(t,e,n={}){return de.dependency(this,"with",t,e,n)}},without:{method(t,e,n={}){return de.dependency(this,"without",t,e,n)}},xor:{method(...t){return rn.verifyFlat(t,"xor"),de.dependency(this,"xor",null,t)}}},overrides:{default(t,e){return t===void 0&&(t=rn.symbols.deepDefault),this.$_parent("default",t,e)}},rebuild(t){if(t.$_terms.keys){let e=new Pq.Sorter;for(let n of t.$_terms.keys)rn.tryWithPath(()=>e.add(n,{after:n.schema.$_rootReferences(),group:n.key}),n.key);t.$_terms.keys=new de.Keys(...e.nodes)}},manifest:{build(t,e){if(e.keys&&(t=t.keys(e.keys)),e.dependencies)for(let{rel:n,key:r=null,peers:i,options:s}of e.dependencies)t=de.dependency(t,n,r,i,s);if(e.patterns)for(let{regex:n,schema:r,rule:i,fallthrough:s,matches:o}of e.patterns)t=t.pattern(n||r,i,{fallthrough:s,matches:o});if(e.renames)for(let{from:n,to:r,options:i}of e.renames)t=t.rename(n,r,i);return t}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}});de.clone=function(t,e){if(typeof t=="object"){if(e.nonEnumerables)return VA(t,{shallow:!0});let r=Object.create(Object.getPrototypeOf(t));return Object.assign(r,t),r}let n=function(...r){return t.apply(this,r)};return n.prototype=VA(t.prototype),Object.defineProperty(n,"name",{value:t.name,writable:!1}),Object.defineProperty(n,"length",{value:t.length,writable:!1}),Object.assign(n,t),n};de.dependency=function(t,e,n,r,i){tr(n===null||typeof n=="string",e,"key must be a strings"),i||(i=r.length>1&&typeof r[r.length-1]=="object"?r.pop():{}),rn.assertOptions(i,["separator","isPresent"]),r=[].concat(r);let s=rn.default(i.separator,"."),o=[];for(let u of r)tr(typeof u=="string",e,"peers must be strings"),o.push(Ub.ref(u,{separator:s,ancestor:0,prefix:!1}));n!==null&&(n=Ub.ref(n,{separator:s,ancestor:0,prefix:!1}));let a=t.clone();return a.$_terms.dependencies=a.$_terms.dependencies||[],a.$_terms.dependencies.push(new de.Dependency(e,n,o,r,i)),a};de.dependencies={and(t,e,n,r,i){let s=[],o=[],a=e.peers.length,u=de.isPresent(e.options);for(let c of e.peers)u(c.resolve(n,r,i,null,{shadow:!1}))===!1?s.push(c.key):o.push(c.key);if(s.length!==a&&o.length!==a)return{code:"object.and",context:{present:o,presentWithLabels:de.keysToLabels(t,o),missing:s,missingWithLabels:de.keysToLabels(t,s)}}},nand(t,e,n,r,i){let s=[],o=de.isPresent(e.options);for(let c of e.peers)o(c.resolve(n,r,i,null,{shadow:!1}))&&s.push(c.key);if(s.length!==e.peers.length)return;let a=e.paths[0],u=e.paths.slice(1);return{code:"object.nand",context:{main:a,mainWithLabel:de.keysToLabels(t,a),peers:u,peersWithLabels:de.keysToLabels(t,u)}}},or(t,e,n,r,i){let s=de.isPresent(e.options);for(let o of e.peers)if(s(o.resolve(n,r,i,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:e.paths,peersWithLabels:de.keysToLabels(t,e.paths)}}},oxor(t,e,n,r,i){let s=[],o=de.isPresent(e.options);for(let u of e.peers)o(u.resolve(n,r,i,null,{shadow:!1}))&&s.push(u.key);if(!s.length||s.length===1)return;let a={peers:e.paths,peersWithLabels:de.keysToLabels(t,e.paths)};return a.present=s,a.presentWithLabels=de.keysToLabels(t,s),{code:"object.oxor",context:a}},with(t,e,n,r,i){let s=de.isPresent(e.options);for(let o of e.peers)if(s(o.resolve(n,r,i,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:e.key.key,mainWithLabel:de.keysToLabels(t,e.key.key),peer:o.key,peerWithLabel:de.keysToLabels(t,o.key)}}},without(t,e,n,r,i){let s=de.isPresent(e.options);for(let o of e.peers)if(s(o.resolve(n,r,i,null,{shadow:!1})))return{code:"object.without",context:{main:e.key.key,mainWithLabel:de.keysToLabels(t,e.key.key),peer:o.key,peerWithLabel:de.keysToLabels(t,o.key)}}},xor(t,e,n,r,i){let s=[],o=de.isPresent(e.options);for(let u of e.peers)o(u.resolve(n,r,i,null,{shadow:!1}))&&s.push(u.key);if(s.length===1)return;let a={peers:e.paths,peersWithLabels:de.keysToLabels(t,e.paths)};return s.length===0?{code:"object.missing",context:a}:(a.present=s,a.presentWithLabels=de.keysToLabels(t,s),{code:"object.xor",context:a})}};de.keysToLabels=function(t,e){return Array.isArray(e)?e.map(n=>t.$_mapLabels(n)):t.$_mapLabels(e)};de.isPresent=function(t){return typeof t.isPresent=="function"?t.isPresent:e=>e!==void 0};de.rename=function(t,e,n,r,i){let s={};for(let o of t.$_terms.renames){let a=[],u=typeof o.from!="string";if(!u)Object.prototype.hasOwnProperty.call(e,o.from)&&(e[o.from]!==void 0||!o.options.ignoreUndefined)&&a.push(o);else for(let c in e){if(e[c]===void 0&&o.options.ignoreUndefined||c===o.to)continue;let l=o.from.exec(c);l&&a.push({from:c,to:o.to,match:l})}for(let c of a){let l=c.from,h=c.to;if(h instanceof zh&&(h=h.render(e,n,r,c.match)),l!==h){if(!o.options.multiple&&s[h]&&(i.push(t.$_createError("object.rename.multiple",e,{from:l,to:h,pattern:u},n,r)),r.abortEarly)||Object.prototype.hasOwnProperty.call(e,h)&&!o.options.override&&!s[h]&&(i.push(t.$_createError("object.rename.override",e,{from:l,to:h,pattern:u},n,r)),r.abortEarly))return!1;e[l]===void 0?delete e[h]:e[h]=e[l],s[h]=!0,o.options.alias||delete e[l]}}}return!0};de.unknown=function(t,e,n,r,i,s){if(t.$_terms.patterns){let a=!1,u=t.$_terms.patterns.map(l=>{if(l.matches)return a=!0,[]}),c=[e,...i.ancestors];for(let l of n){let h=e[l],d=[...i.path,l];for(let g=0;g<t.$_terms.patterns.length;++g){let y=t.$_terms.patterns[g];if(y.regex){let k=y.regex.test(l);if(i.mainstay.tracer.debug(i,"rule",`pattern.${g}`,k?"pass":"error"),!k)continue}else if(!y.schema.$_match(l,i.nest(y.schema,`pattern.${g}`),s))continue;n.delete(l);let _=i.localize(d,c,{schema:y.rule,key:l}),C=y.rule.$_validate(h,_,s);if(C.errors){if(s.abortEarly)return{value:e,errors:C.errors};r.push(...C.errors)}if(y.matches&&u[g].push(l),e[l]=C.value,!y.fallthrough)break}}if(a)for(let l=0;l<u.length;++l){let h=u[l];if(!h)continue;let d=t.$_terms.patterns[l].matches,g=i.localize(i.path,c,d),y=d.$_validate(h,g,s);if(y.errors){let _=Iq.details(y.errors,{override:!1});_.matches=h;let C=t.$_createError("object.pattern.match",e,_,i,s);if(s.abortEarly)return{value:e,errors:C};r.push(C)}}}if(!n.size||!t.$_terms.keys&&!t.$_terms.patterns)return;if(s.stripUnknown&&typeof t._flags.unknown>"u"||s.skipFunctions){let a=s.stripUnknown?s.stripUnknown===!0?!0:!!s.stripUnknown.objects:!1;for(let u of n)a?(delete e[u],n.delete(u)):typeof e[u]=="function"&&n.delete(u)}if(!rn.default(t._flags.unknown,s.allowUnknown))for(let a of n){let u=i.localize([...i.path,a],[]),c=t.$_createError("object.unknown",e[a],{child:a},u,s,{flags:!1});if(s.abortEarly)return{value:e,errors:c};r.push(c)}};de.Dependency=class{constructor(t,e,n,r,i){this.rel=t,this.key=e,this.peers=n,this.paths=r,this.options=i}describe(){let t={rel:this.rel,peers:this.paths};return this.key!==null&&(t.key=this.key.key),this.peers[0].separator!=="."&&(t.options={...t.options,separator:this.peers[0].separator}),this.options.isPresent&&(t.options={...t.options,isPresent:this.options.isPresent}),t}};de.Keys=class extends Array{concat(t){let e=this.slice(),n=new Map;for(let r=0;r<e.length;++r)n.set(e[r].key,r);for(let r of t){let i=r.key,s=n.get(i);s!==void 0?e[s]={key:i,schema:e[s].schema.concat(r.schema)}:e.push(r)}return e}}});var QA=m((nz,JA)=>{"use strict";var Hb=Me(),Mq=Wb();JA.exports=Mq.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(t){return Hb(Number.isSafeInteger(t)&&t>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:t}})},validate(t,e,{n}){return t.length===n?t:e.error("function.arity",{n})}},class:{method(){return this.$_addRule("class")},validate(t,e){return/^\s*class\s/.test(t.toString())?t:e.error("function.class",{value:t})}},minArity:{method(t){return Hb(Number.isSafeInteger(t)&&t>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:t}})},validate(t,e,{n}){return t.length>=n?t:e.error("function.minArity",{n})}},maxArity:{method(t){return Hb(Number.isSafeInteger(t)&&t>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:t}})},validate(t,e,{n}){return t.length<=n?t:e.error("function.maxArity",{n})}}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})});var e1=m((rz,ZA)=>{"use strict";var fi=Me(),Lq=Zn(),Nq=Ze(),qq=ks(),jq=ui(),pi={};ZA.exports=Lq.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args(t,e){return t.ref(e)},validate(t,{schema:e,state:n,prefs:r}){fi(e.$_terms.link,"Uninitialized link schema");let i=pi.generate(e,t,n,r),s=e.$_terms.link[0].ref;return i.$_validate(t,n.nest(i,`link:${s.display}:${i.type}`),r)},generate(t,e,n,r){return pi.generate(t,e,n,r)},rules:{ref:{method(t){fi(!this.$_terms.link,"Cannot reinitialize schema"),t=qq.ref(t),fi(t.type==="value"||t.type==="local","Invalid reference type:",t.type),fi(t.type==="local"||t.ancestor==="root"||t.ancestor>0,"Link cannot reference itself");let e=this.clone();return e.$_terms.link=[{ref:t}],e}},relative:{method(t=!0){return this.$_setFlag("relative",t)}}},overrides:{concat(t){fi(this.$_terms.link,"Uninitialized link schema"),fi(Nq.isSchema(t),"Invalid schema object"),fi(t.type!=="link","Cannot merge type link with another link");let e=this.clone();return e.$_terms.whens||(e.$_terms.whens=[]),e.$_terms.whens.push({concat:t}),e.$_mutateRebuild()}},manifest:{build(t,e){return fi(e.link,"Invalid link description missing link"),t.ref(e.link)}}});pi.generate=function(t,e,n,r){let i=n.mainstay.links.get(t);if(i)return i._generate(e,n,r).schema;let s=t.$_terms.link[0].ref,{perspective:o,path:a}=pi.perspective(s,n);pi.assert(o,"which is outside of schema boundaries",s,t,n,r);try{i=a.length?o.$_reach(a):o}catch{pi.assert(!1,"to non-existing schema",s,t,n,r)}return pi.assert(i.type!=="link","which is another link",s,t,n,r),t._flags.relative||n.mainstay.links.set(t,i),i._generate(e,n,r).schema};pi.perspective=function(t,e){if(t.type==="local"){for(let{schema:n,key:r}of e.schemas){if((n._flags.id||r)===t.path[0])return{perspective:n,path:t.path.slice(1)};if(n.$_terms.shared){for(let s of n.$_terms.shared)if(s._flags.id===t.path[0])return{perspective:s,path:t.path.slice(1)}}}return{perspective:null,path:null}}return t.ancestor==="root"?{perspective:e.schemas[e.schemas.length-1].schema,path:t.path}:{perspective:e.schemas[t.ancestor]&&e.schemas[t.ancestor].schema,path:t.path}};pi.assert=function(t,e,n,r,i,s){t||fi(!1,`"${jq.label(r._flags,i,s)}" contains link reference "${n.display}" ${e}`)}});var n1=m((iz,t1)=>{"use strict";var Gb=Me(),Fq=Zn(),zb=Ze(),qn={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(t){let e=t.toString(),n=e.indexOf("."),r=e.indexOf("e");return(n<0?0:(r<0?e.length:r)-n-1)+(r<0?0:Math.max(0,-parseInt(e.slice(r+1))))}};t1.exports=Fq.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(t,{schema:e,error:n}){if(!t.match(qn.numberRx))return;t=t.trim();let i={value:parseFloat(t)};if(i.value===0&&(i.value=0),!e._flags.unsafe)if(t.match(/e/i)){if(qn.extractSignificantDigits(t)!==qn.extractSignificantDigits(String(i.value)))return i.errors=n("number.unsafe"),i}else{let s=i.value.toString();if(s.match(/e/i))return i;if(s!==qn.normalizeDecimal(t))return i.errors=n("number.unsafe"),i}return i}},validate(t,{schema:e,error:n,prefs:r}){if(t===1/0||t===-1/0)return{value:t,errors:n("number.infinity")};if(!zb.isNumber(t))return{value:t,errors:n("number.base")};let i={value:t};if(r.convert){let s=e.$_getRule("precision");if(s){let o=Math.pow(10,s.args.limit);i.value=Math.round(i.value*o)/o}}return i.value===0&&(i.value=0),!e._flags.unsafe&&(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER)&&(i.errors=n("number.unsafe")),i},rules:{compare:{method:!1,validate(t,e,{limit:n},{name:r,operator:i,args:s}){return zb.compare(t,n,i)?t:e.error("number."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:zb.isNumber,message:"must be a number"}]},greater:{method(t){return this.$_addRule({name:"greater",method:"compare",args:{limit:t},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate(t,e){return Math.trunc(t)-t===0?t:e.error("number.integer")}},less:{method(t){return this.$_addRule({name:"less",method:"compare",args:{limit:t},operator:"<"})}},max:{method(t){return this.$_addRule({name:"max",method:"compare",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"compare",args:{limit:t},operator:">="})}},multiple:{method(t){let e=typeof t=="number"?qn.decimalPlaces(t):null,n=Math.pow(10,e);return this.$_addRule({name:"multiple",args:{base:t,baseDecimalPlace:e,pfactor:n}})},validate(t,e,{base:n,baseDecimalPlace:r,pfactor:i},s){return qn.decimalPlaces(t)>r?e.error("number.multiple",{multiple:s.args.base,value:t}):Math.round(i*t)%Math.round(i*n)===0?t:e.error("number.multiple",{multiple:s.args.base,value:t})},args:[{name:"base",ref:!0,assert:t=>typeof t=="number"&&isFinite(t)&&t>0,message:"must be a positive number"},"baseDecimalPlace","pfactor"],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate(t,e){return Number.isSafeInteger(t)&&t>=0&&t<=65535?t:e.error("number.port")}},positive:{method(){return this.sign("positive")}},precision:{method(t){return Gb(Number.isSafeInteger(t),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:t}})},validate(t,e,{limit:n}){let r=t.toString().match(qn.precisionRx);return Math.max((r[1]?r[1].length:0)-(r[2]?parseInt(r[2],10):0),0)<=n?t:e.error("number.precision",{limit:n,value:t})},convert:!0},sign:{method(t){return Gb(["negative","positive"].includes(t),"Invalid sign",t),this.$_addRule({name:"sign",args:{sign:t}})},validate(t,e,{sign:n}){return n==="negative"&&t<0||n==="positive"&&t>0?t:e.error(`number.${n}`)}},unsafe:{method(t=!0){return Gb(typeof t=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",t)}}},cast:{string:{from:t=>typeof t=="number",to(t,e){return t.toString()}}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}});qn.extractSignificantDigits=function(t){return t.replace(qn.exponentialPartRegex,"").replace(qn.dotRegex,"").replace(qn.trailingZerosRegex,"").replace(qn.leadingSignAndZerosRegex,"")};qn.normalizeDecimal=function(t){return t=t.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2"),t.includes(".")&&t.endsWith("0")&&(t=t.replace(/0+$/,"")),t==="-0"?"0":t}});var i1=m((sz,r1)=>{"use strict";var $q=Wb();r1.exports=$q.extend({type:"object",cast:{map:{from:t=>t&&typeof t=="object",to(t,e){return new Map(Object.entries(t))}}}})});var Kb=m(Kh=>{"use strict";Kh.codes={EMPTY_STRING:"Address must be a non-empty string",FORBIDDEN_UNICODE:"Address contains forbidden Unicode characters",MULTIPLE_AT_CHAR:"Address cannot contain more than one @ character",MISSING_AT_CHAR:"Address must contain one @ character",EMPTY_LOCAL:"Address local part cannot be empty",ADDRESS_TOO_LONG:"Address too long",LOCAL_TOO_LONG:"Address local part too long",EMPTY_LOCAL_SEGMENT:"Address local part contains empty dot-separated segment",INVALID_LOCAL_CHARS:"Address local part contains invalid character",DOMAIN_NON_EMPTY_STRING:"Domain must be a non-empty string",DOMAIN_TOO_LONG:"Domain too long",DOMAIN_INVALID_UNICODE_CHARS:"Domain contains forbidden Unicode characters",DOMAIN_INVALID_CHARS:"Domain contains invalid character",DOMAIN_INVALID_TLDS_CHARS:"Domain contains invalid tld character",DOMAIN_SEGMENTS_COUNT:"Domain lacks the minimum required number of segments",DOMAIN_SEGMENTS_COUNT_MAX:"Domain contains too many segments",DOMAIN_FORBIDDEN_TLDS:"Domain uses forbidden TLD",DOMAIN_EMPTY_SEGMENT:"Domain contains empty dot-separated segment",DOMAIN_LONG_SEGMENT:"Domain contains dot-separated segment that is too long"};Kh.code=function(t){return{code:t,error:Kh.codes[t]}}});var Vb=m(Vh=>{"use strict";var Bq=require("url"),Tr=Kb(),Gi={minDomainSegments:2,nonAsciiRx:/[^\x00-\x7f]/,domainControlRx:/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,tldSegmentRx:/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,domainSegmentRx:/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,URL:Bq.URL||URL};Vh.analyze=function(t,e={}){if(!t)return Tr.code("DOMAIN_NON_EMPTY_STRING");if(typeof t!="string")throw new Error("Invalid input: domain must be a string");if(t.length>256)return Tr.code("DOMAIN_TOO_LONG");if(!!Gi.nonAsciiRx.test(t)){if(e.allowUnicode===!1)return Tr.code("DOMAIN_INVALID_UNICODE_CHARS");t=t.normalize("NFC")}if(Gi.domainControlRx.test(t))return Tr.code("DOMAIN_INVALID_CHARS");t=Gi.punycode(t),e.allowFullyQualified&&t[t.length-1]==="."&&(t=t.slice(0,-1));let r=e.minDomainSegments||Gi.minDomainSegments,i=t.split(".");if(i.length<r)return Tr.code("DOMAIN_SEGMENTS_COUNT");if(e.maxDomainSegments&&i.length>e.maxDomainSegments)return Tr.code("DOMAIN_SEGMENTS_COUNT_MAX");let s=e.tlds;if(s){let o=i[i.length-1].toLowerCase();if(s.deny&&s.deny.has(o)||s.allow&&!s.allow.has(o))return Tr.code("DOMAIN_FORBIDDEN_TLDS")}for(let o=0;o<i.length;++o){let a=i[o];if(!a.length)return Tr.code("DOMAIN_EMPTY_SEGMENT");if(a.length>63)return Tr.code("DOMAIN_LONG_SEGMENT");if(o<i.length-1){if(!Gi.domainSegmentRx.test(a))return Tr.code("DOMAIN_INVALID_CHARS")}else if(!Gi.tldSegmentRx.test(a))return Tr.code("DOMAIN_INVALID_TLDS_CHARS")}return null};Vh.isValid=function(t,e){return!Vh.analyze(t,e)};Gi.punycode=function(t){t.includes("%")&&(t=t.replace(/%/g,"%25"));try{return new Gi.URL(`http://${t}`).host}catch{return t}}});var s1=m(Xb=>{"use strict";var Uq=require("util"),Wq=Vb(),Hr=Kb(),dn={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(Uq.TextEncoder||TextEncoder)};Xb.analyze=function(t,e){return dn.email(t,e)};Xb.isValid=function(t,e){return!dn.email(t,e)};dn.email=function(t,e={}){if(typeof t!="string")throw new Error("Invalid input: email must be a string");if(!t)return Hr.code("EMPTY_STRING");let n=!dn.nonAsciiRx.test(t);if(!n){if(e.allowUnicode===!1)return Hr.code("FORBIDDEN_UNICODE");t=t.normalize("NFC")}let r=t.split("@");if(r.length!==2)return r.length>2?Hr.code("MULTIPLE_AT_CHAR"):Hr.code("MISSING_AT_CHAR");let[i,s]=r;if(!i)return Hr.code("EMPTY_LOCAL");if(!e.ignoreLength){if(t.length>254)return Hr.code("ADDRESS_TOO_LONG");if(dn.encoder.encode(i).length>64)return Hr.code("LOCAL_TOO_LONG")}return dn.local(i,n)||Wq.analyze(s,e)};dn.local=function(t,e){let n=t.split(".");for(let r of n){if(!r.length)return Hr.code("EMPTY_LOCAL_SEGMENT");if(e){if(!dn.atextRx.test(r))return Hr.code("INVALID_LOCAL_CHARS");continue}for(let i of r){if(dn.atextRx.test(i))continue;let s=dn.binary(i);if(!dn.atomRx.test(s))return Hr.code("INVALID_LOCAL_CHARS")}}};dn.binary=function(t){return Array.from(dn.encoder.encode(t)).map(e=>String.fromCharCode(e)).join("")};dn.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/;dn.atomRx=new RegExp(["(?:[\\xc2-\\xdf][\\x80-\\xbf])","(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})","(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"].join("|"))});var Yb=m((cz,o1)=>{"use strict";o1.exports=function(t){return t.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}});var Qb=m(Jb=>{"use strict";var Xh=Me(),Hq=Yb(),Xt={};Xt.generate=function(){let t={},e="\\dA-Fa-f",n="["+e+"]",r="\\w-\\.~",i="!\\$&'\\(\\)\\*\\+,;=",s="%"+e,o=r+s+i+":@",a="["+o+"]",u="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";t.ipv4address="(?:"+u+"\\.){3}"+u;let c=n+"{1,4}",l="(?:"+c+":"+c+"|"+t.ipv4address+")",h="(?:"+c+":){6}"+l,d="::(?:"+c+":){5}"+l,g="(?:"+c+")?::(?:"+c+":){4}"+l,y="(?:(?:"+c+":){0,1}"+c+")?::(?:"+c+":){3}"+l,_="(?:(?:"+c+":){0,2}"+c+")?::(?:"+c+":){2}"+l,C="(?:(?:"+c+":){0,3}"+c+")?::"+c+":"+l,k="(?:(?:"+c+":){0,4}"+c+")?::"+l,T="(?:(?:"+c+":){0,5}"+c+")?::"+c,w="(?:(?:"+c+":){0,6}"+c+")?::";t.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",t.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",t.ipv6address="(?:"+h+"|"+d+"|"+g+"|"+y+"|"+_+"|"+C+"|"+k+"|"+T+"|"+w+")",t.ipvFuture="v"+n+"+\\.["+r+i+":]+",t.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",t.schemeRegex=new RegExp(t.scheme);let v="["+r+s+i+":]*",L="\\[(?:"+t.ipv6address+"|"+t.ipvFuture+")\\]",R="["+r+s+i+"]{1,255}",U="(?:"+L+"|"+t.ipv4address+"|"+R+")",te="\\d*",se="(?:"+v+"@)?"+U+"(?::"+te+")?",W="(?:"+v+"@)?("+U+")(?::"+te+")?",O=a+"*",M=a+"+",N="["+r+s+i+"@]+",j="",fe="(?:\\/"+O+")*",he="\\/(?:"+M+fe+")?",Nt=M+fe,bt=N+fe,$e="(?:\\/\\/\\/"+O+fe+")";return t.hierPart="(?:(?:\\/\\/"+se+fe+")|"+he+"|"+Nt+"|"+$e+")",t.hierPartCapture="(?:(?:\\/\\/"+W+fe+")|"+he+"|"+Nt+")",t.relativeRef="(?:(?:\\/\\/"+se+fe+")|"+he+"|"+bt+"|"+j+")",t.relativeRefCapture="(?:(?:\\/\\/"+W+fe+")|"+he+"|"+bt+"|"+j+")",t.query="["+o+"\\/\\?]*(?=#|$)",t.queryWithSquareBrackets="["+o+"\\[\\]\\/\\?]*(?=#|$)",t.fragment="["+o+"\\/\\?]*",t};Xt.rfc3986=Xt.generate();Jb.ip={v4Cidr:Xt.rfc3986.ipv4Cidr,v6Cidr:Xt.rfc3986.ipv6Cidr,ipv4:Xt.rfc3986.ipv4address,ipv6:Xt.rfc3986.ipv6address,ipvfuture:Xt.rfc3986.ipvFuture};Xt.createRegex=function(t){let e=Xt.rfc3986,r="(?:\\?"+(t.allowQuerySquareBrackets?e.queryWithSquareBrackets:e.query)+")?(?:#"+e.fragment+")?",i=t.domain?e.relativeRefCapture:e.relativeRef;if(t.relativeOnly)return Xt.wrap(i+r);let s="";if(t.scheme){Xh(t.scheme instanceof RegExp||typeof t.scheme=="string"||Array.isArray(t.scheme),"scheme must be a RegExp, String, or Array");let c=[].concat(t.scheme);Xh(c.length>=1,"scheme must have at least 1 scheme specified");let l=[];for(let h=0;h<c.length;++h){let d=c[h];Xh(d instanceof RegExp||typeof d=="string","scheme at position "+h+" must be a RegExp or String"),d instanceof RegExp?l.push(d.source.toString()):(Xh(e.schemeRegex.test(d),"scheme at position "+h+" must be a valid scheme"),l.push(Hq(d)))}s=l.join("|")}let a="(?:"+(s?"(?:"+s+")":e.scheme)+":"+(t.domain?e.hierPartCapture:e.hierPart)+")",u=t.allowRelative?"(?:"+a+"|"+i+")":a;return Xt.wrap(u+r,s)};Xt.wrap=function(t,e){return t=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${t}`,{raw:t,regex:new RegExp(`^${t}$`),scheme:e}};Xt.uriRegex=Xt.createRegex({});Jb.regex=function(t={}){return t.scheme||t.allowRelative||t.relativeOnly||t.allowQuerySquareBrackets||t.domain?Xt.createRegex(t):Xt.uriRegex}});var u1=m(a1=>{"use strict";var Fo=Me(),vu=Qb();a1.regex=function(t={}){Fo(t.cidr===void 0||typeof t.cidr=="string","options.cidr must be a string");let e=t.cidr?t.cidr.toLowerCase():"optional";Fo(["required","optional","forbidden"].includes(e),"options.cidr must be one of required, optional, forbidden"),Fo(t.version===void 0||typeof t.version=="string"||Array.isArray(t.version),"options.version must be a string or an array of string");let n=t.version||["ipv4","ipv6","ipvfuture"];Array.isArray(n)||(n=[n]),Fo(n.length>=1,"options.version must have at least 1 version specified");for(let o=0;o<n.length;++o)Fo(typeof n[o]=="string","options.version must only contain strings"),n[o]=n[o].toLowerCase(),Fo(["ipv4","ipv6","ipvfuture"].includes(n[o]),"options.version contains unknown version "+n[o]+" - must be one of ipv4, ipv6, ipvfuture");n=Array.from(new Set(n));let i=`(?:${n.map(o=>{if(e==="forbidden")return vu.ip[o];let a=`\\/${o==="ipv4"?vu.ip.v4Cidr:vu.ip.v6Cidr}`;return e==="required"?`${vu.ip[o]}${a}`:`${vu.ip[o]}(?:${a})?`}).join("|")})`,s=new RegExp(`^${i}$`);return{cidr:e,versions:n,regex:s,raw:i}}});var h1=m((dz,l1)=>{"use strict";var c1={};c1.tlds=["AAA","AARP","ABB","ABBOTT","ABBVIE","ABC","ABLE","ABOGADO","ABUDHABI","AC","ACADEMY","ACCENTURE","ACCOUNTANT","ACCOUNTANTS","ACO","ACTOR","AD","ADS","ADULT","AE","AEG","AERO","AETNA","AF","AFL","AFRICA","AG","AGAKHAN","AGENCY","AI","AIG","AIRBUS","AIRFORCE","AIRTEL","AKDN","AL","ALIBABA","ALIPAY","ALLFINANZ","ALLSTATE","ALLY","ALSACE","ALSTOM","AM","AMAZON","AMERICANEXPRESS","AMERICANFAMILY","AMEX","AMFAM","AMICA","AMSTERDAM","ANALYTICS","ANDROID","ANQUAN","ANZ","AO","AOL","APARTMENTS","APP","APPLE","AQ","AQUARELLE","AR","ARAB","ARAMCO","ARCHI","ARMY","ARPA","ART","ARTE","AS","ASDA","ASIA","ASSOCIATES","AT","ATHLETA","ATTORNEY","AU","AUCTION","AUDI","AUDIBLE","AUDIO","AUSPOST","AUTHOR","AUTO","AUTOS","AVIANCA","AW","AWS","AX","AXA","AZ","AZURE","BA","BABY","BAIDU","BANAMEX","BAND","BANK","BAR","BARCELONA","BARCLAYCARD","BARCLAYS","BAREFOOT","BARGAINS","BASEBALL","BASKETBALL","BAUHAUS","BAYERN","BB","BBC","BBT","BBVA","BCG","BCN","BD","BE","BEATS","BEAUTY","BEER","BENTLEY","BERLIN","BEST","BESTBUY","BET","BF","BG","BH","BHARTI","BI","BIBLE","BID","BIKE","BING","BINGO","BIO","BIZ","BJ","BLACK","BLACKFRIDAY","BLOCKBUSTER","BLOG","BLOOMBERG","BLUE","BM","BMS","BMW","BN","BNPPARIBAS","BO","BOATS","BOEHRINGER","BOFA","BOM","BOND","BOO","BOOK","BOOKING","BOSCH","BOSTIK","BOSTON","BOT","BOUTIQUE","BOX","BR","BRADESCO","BRIDGESTONE","BROADWAY","BROKER","BROTHER","BRUSSELS","BS","BT","BUILD","BUILDERS","BUSINESS","BUY","BUZZ","BV","BW","BY","BZ","BZH","CA","CAB","CAFE","CAL","CALL","CALVINKLEIN","CAM","CAMERA","CAMP","CANON","CAPETOWN","CAPITAL","CAPITALONE","CAR","CARAVAN","CARDS","CARE","CAREER","CAREERS","CARS","CASA","CASE","CASH","CASINO","CAT","CATERING","CATHOLIC","CBA","CBN","CBRE","CC","CD","CENTER","CEO","CERN","CF","CFA","CFD","CG","CH","CHANEL","CHANNEL","CHARITY","CHASE","CHAT","CHEAP","CHINTAI","CHRISTMAS","CHROME","CHURCH","CI","CIPRIANI","CIRCLE","CISCO","CITADEL","CITI","CITIC","CITY","CK","CL","CLAIMS","CLEANING","CLICK","CLINIC","CLINIQUE","CLOTHING","CLOUD","CLUB","CLUBMED","CM","CN","CO","COACH","CODES","COFFEE","COLLEGE","COLOGNE","COM","COMCAST","COMMBANK","COMMUNITY","COMPANY","COMPARE","COMPUTER","COMSEC","CONDOS","CONSTRUCTION","CONSULTING","CONTACT","CONTRACTORS","COOKING","COOL","COOP","CORSICA","COUNTRY","COUPON","COUPONS","COURSES","CPA","CR","CREDIT","CREDITCARD","CREDITUNION","CRICKET","CROWN","CRS","CRUISE","CRUISES","CU","CUISINELLA","CV","CW","CX","CY","CYMRU","CYOU","CZ","DABUR","DAD","DANCE","DATA","DATE","DATING","DATSUN","DAY","DCLK","DDS","DE","DEAL","DEALER","DEALS","DEGREE","DELIVERY","DELL","DELOITTE","DELTA","DEMOCRAT","DENTAL","DENTIST","DESI","DESIGN","DEV","DHL","DIAMONDS","DIET","DIGITAL","DIRECT","DIRECTORY","DISCOUNT","DISCOVER","DISH","DIY","DJ","DK","DM","DNP","DO","DOCS","DOCTOR","DOG","DOMAINS","DOT","DOWNLOAD","DRIVE","DTV","DUBAI","DUNLOP","DUPONT","DURBAN","DVAG","DVR","DZ","EARTH","EAT","EC","ECO","EDEKA","EDU","EDUCATION","EE","EG","EMAIL","EMERCK","ENERGY","ENGINEER","ENGINEERING","ENTERPRISES","EPSON","EQUIPMENT","ER","ERICSSON","ERNI","ES","ESQ","ESTATE","ET","EU","EUROVISION","EUS","EVENTS","EXCHANGE","EXPERT","EXPOSED","EXPRESS","EXTRASPACE","FAGE","FAIL","FAIRWINDS","FAITH","FAMILY","FAN","FANS","FARM","FARMERS","FASHION","FAST","FEDEX","FEEDBACK","FERRARI","FERRERO","FI","FIDELITY","FIDO","FILM","FINAL","FINANCE","FINANCIAL","FIRE","FIRESTONE","FIRMDALE","FISH","FISHING","FIT","FITNESS","FJ","FK","FLICKR","FLIGHTS","FLIR","FLORIST","FLOWERS","FLY","FM","FO","FOO","FOOD","FOOTBALL","FORD","FOREX","FORSALE","FORUM","FOUNDATION","FOX","FR","FREE","FRESENIUS","FRL","FROGANS","FRONTIER","FTR","FUJITSU","FUN","FUND","FURNITURE","FUTBOL","FYI","GA","GAL","GALLERY","GALLO","GALLUP","GAME","GAMES","GAP","GARDEN","GAY","GB","GBIZ","GD","GDN","GE","GEA","GENT","GENTING","GEORGE","GF","GG","GGEE","GH","GI","GIFT","GIFTS","GIVES","GIVING","GL","GLASS","GLE","GLOBAL","GLOBO","GM","GMAIL","GMBH","GMO","GMX","GN","GODADDY","GOLD","GOLDPOINT","GOLF","GOO","GOODYEAR","GOOG","GOOGLE","GOP","GOT","GOV","GP","GQ","GR","GRAINGER","GRAPHICS","GRATIS","GREEN","GRIPE","GROCERY","GROUP","GS","GT","GU","GUARDIAN","GUCCI","GUGE","GUIDE","GUITARS","GURU","GW","GY","HAIR","HAMBURG","HANGOUT","HAUS","HBO","HDFC","HDFCBANK","HEALTH","HEALTHCARE","HELP","HELSINKI","HERE","HERMES","HIPHOP","HISAMITSU","HITACHI","HIV","HK","HKT","HM","HN","HOCKEY","HOLDINGS","HOLIDAY","HOMEDEPOT","HOMEGOODS","HOMES","HOMESENSE","HONDA","HORSE","HOSPITAL","HOST","HOSTING","HOT","HOTELS","HOTMAIL","HOUSE","HOW","HR","HSBC","HT","HU","HUGHES","HYATT","HYUNDAI","IBM","ICBC","ICE","ICU","ID","IE","IEEE","IFM","IKANO","IL","IM","IMAMAT","IMDB","IMMO","IMMOBILIEN","IN","INC","INDUSTRIES","INFINITI","INFO","ING","INK","INSTITUTE","INSURANCE","INSURE","INT","INTERNATIONAL","INTUIT","INVESTMENTS","IO","IPIRANGA","IQ","IR","IRISH","IS","ISMAILI","IST","ISTANBUL","IT","ITAU","ITV","JAGUAR","JAVA","JCB","JE","JEEP","JETZT","JEWELRY","JIO","JLL","JM","JMP","JNJ","JO","JOBS","JOBURG","JOT","JOY","JP","JPMORGAN","JPRS","JUEGOS","JUNIPER","KAUFEN","KDDI","KE","KERRYHOTELS","KERRYLOGISTICS","KERRYPROPERTIES","KFH","KG","KH","KI","KIA","KIDS","KIM","KINDLE","KITCHEN","KIWI","KM","KN","KOELN","KOMATSU","KOSHER","KP","KPMG","KPN","KR","KRD","KRED","KUOKGROUP","KW","KY","KYOTO","KZ","LA","LACAIXA","LAMBORGHINI","LAMER","LANCASTER","LAND","LANDROVER","LANXESS","LASALLE","LAT","LATINO","LATROBE","LAW","LAWYER","LB","LC","LDS","LEASE","LECLERC","LEFRAK","LEGAL","LEGO","LEXUS","LGBT","LI","LIDL","LIFE","LIFEINSURANCE","LIFESTYLE","LIGHTING","LIKE","LILLY","LIMITED","LIMO","LINCOLN","LINK","LIPSY","LIVE","LIVING","LK","LLC","LLP","LOAN","LOANS","LOCKER","LOCUS","LOL","LONDON","LOTTE","LOTTO","LOVE","LPL","LPLFINANCIAL","LR","LS","LT","LTD","LTDA","LU","LUNDBECK","LUXE","LUXURY","LV","LY","MA","MADRID","MAIF","MAISON","MAKEUP","MAN","MANAGEMENT","MANGO","MAP","MARKET","MARKETING","MARKETS","MARRIOTT","MARSHALLS","MATTEL","MBA","MC","MCKINSEY","MD","ME","MED","MEDIA","MEET","MELBOURNE","MEME","MEMORIAL","MEN","MENU","MERCKMSD","MG","MH","MIAMI","MICROSOFT","MIL","MINI","MINT","MIT","MITSUBISHI","MK","ML","MLB","MLS","MM","MMA","MN","MO","MOBI","MOBILE","MODA","MOE","MOI","MOM","MONASH","MONEY","MONSTER","MORMON","MORTGAGE","MOSCOW","MOTO","MOTORCYCLES","MOV","MOVIE","MP","MQ","MR","MS","MSD","MT","MTN","MTR","MU","MUSEUM","MUSIC","MV","MW","MX","MY","MZ","NA","NAB","NAGOYA","NAME","NATURA","NAVY","NBA","NC","NE","NEC","NET","NETBANK","NETFLIX","NETWORK","NEUSTAR","NEW","NEWS","NEXT","NEXTDIRECT","NEXUS","NF","NFL","NG","NGO","NHK","NI","NICO","NIKE","NIKON","NINJA","NISSAN","NISSAY","NL","NO","NOKIA","NORTON","NOW","NOWRUZ","NOWTV","NP","NR","NRA","NRW","NTT","NU","NYC","NZ","OBI","OBSERVER","OFFICE","OKINAWA","OLAYAN","OLAYANGROUP","OLLO","OM","OMEGA","ONE","ONG","ONL","ONLINE","OOO","OPEN","ORACLE","ORANGE","ORG","ORGANIC","ORIGINS","OSAKA","OTSUKA","OTT","OVH","PA","PAGE","PANASONIC","PARIS","PARS","PARTNERS","PARTS","PARTY","PAY","PCCW","PE","PET","PF","PFIZER","PG","PH","PHARMACY","PHD","PHILIPS","PHONE","PHOTO","PHOTOGRAPHY","PHOTOS","PHYSIO","PICS","PICTET","PICTURES","PID","PIN","PING","PINK","PIONEER","PIZZA","PK","PL","PLACE","PLAY","PLAYSTATION","PLUMBING","PLUS","PM","PN","PNC","POHL","POKER","POLITIE","PORN","POST","PR","PRAMERICA","PRAXI","PRESS","PRIME","PRO","PROD","PRODUCTIONS","PROF","PROGRESSIVE","PROMO","PROPERTIES","PROPERTY","PROTECTION","PRU","PRUDENTIAL","PS","PT","PUB","PW","PWC","PY","QA","QPON","QUEBEC","QUEST","RACING","RADIO","RE","READ","REALESTATE","REALTOR","REALTY","RECIPES","RED","REDSTONE","REDUMBRELLA","REHAB","REISE","REISEN","REIT","RELIANCE","REN","RENT","RENTALS","REPAIR","REPORT","REPUBLICAN","REST","RESTAURANT","REVIEW","REVIEWS","REXROTH","RICH","RICHARDLI","RICOH","RIL","RIO","RIP","RO","ROCKS","RODEO","ROGERS","ROOM","RS","RSVP","RU","RUGBY","RUHR","RUN","RW","RWE","RYUKYU","SA","SAARLAND","SAFE","SAFETY","SAKURA","SALE","SALON","SAMSCLUB","SAMSUNG","SANDVIK","SANDVIKCOROMANT","SANOFI","SAP","SARL","SAS","SAVE","SAXO","SB","SBI","SBS","SC","SCB","SCHAEFFLER","SCHMIDT","SCHOLARSHIPS","SCHOOL","SCHULE","SCHWARZ","SCIENCE","SCOT","SD","SE","SEARCH","SEAT","SECURE","SECURITY","SEEK","SELECT","SENER","SERVICES","SEVEN","SEW","SEX","SEXY","SFR","SG","SH","SHANGRILA","SHARP","SHAW","SHELL","SHIA","SHIKSHA","SHOES","SHOP","SHOPPING","SHOUJI","SHOW","SI","SILK","SINA","SINGLES","SITE","SJ","SK","SKI","SKIN","SKY","SKYPE","SL","SLING","SM","SMART","SMILE","SN","SNCF","SO","SOCCER","SOCIAL","SOFTBANK","SOFTWARE","SOHU","SOLAR","SOLUTIONS","SONG","SONY","SOY","SPA","SPACE","SPORT","SPOT","SR","SRL","SS","ST","STADA","STAPLES","STAR","STATEBANK","STATEFARM","STC","STCGROUP","STOCKHOLM","STORAGE","STORE","STREAM","STUDIO","STUDY","STYLE","SU","SUCKS","SUPPLIES","SUPPLY","SUPPORT","SURF","SURGERY","SUZUKI","SV","SWATCH","SWISS","SX","SY","SYDNEY","SYSTEMS","SZ","TAB","TAIPEI","TALK","TAOBAO","TARGET","TATAMOTORS","TATAR","TATTOO","TAX","TAXI","TC","TCI","TD","TDK","TEAM","TECH","TECHNOLOGY","TEL","TEMASEK","TENNIS","TEVA","TF","TG","TH","THD","THEATER","THEATRE","TIAA","TICKETS","TIENDA","TIPS","TIRES","TIROL","TJ","TJMAXX","TJX","TK","TKMAXX","TL","TM","TMALL","TN","TO","TODAY","TOKYO","TOOLS","TOP","TORAY","TOSHIBA","TOTAL","TOURS","TOWN","TOYOTA","TOYS","TR","TRADE","TRADING","TRAINING","TRAVEL","TRAVELERS","TRAVELERSINSURANCE","TRUST","TRV","TT","TUBE","TUI","TUNES","TUSHU","TV","TVS","TW","TZ","UA","UBANK","UBS","UG","UK","UNICOM","UNIVERSITY","UNO","UOL","UPS","US","UY","UZ","VA","VACATIONS","VANA","VANGUARD","VC","VE","VEGAS","VENTURES","VERISIGN","VERSICHERUNG","VET","VG","VI","VIAJES","VIDEO","VIG","VIKING","VILLAS","VIN","VIP","VIRGIN","VISA","VISION","VIVA","VIVO","VLAANDEREN","VN","VODKA","VOLVO","VOTE","VOTING","VOTO","VOYAGE","VU","WALES","WALMART","WALTER","WANG","WANGGOU","WATCH","WATCHES","WEATHER","WEATHERCHANNEL","WEBCAM","WEBER","WEBSITE","WED","WEDDING","WEIBO","WEIR","WF","WHOSWHO","WIEN","WIKI","WILLIAMHILL","WIN","WINDOWS","WINE","WINNERS","WME","WOLTERSKLUWER","WOODSIDE","WORK","WORKS","WORLD","WOW","WS","WTC","WTF","XBOX","XEROX","XFINITY","XIHUAN","XIN","XN--11B4C3D","XN--1CK2E1B","XN--1QQW23A","XN--2SCRJ9C","XN--30RR7Y","XN--3BST00M","XN--3DS443G","XN--3E0B707E","XN--3HCRJ9C","XN--3PXU8K","XN--42C2D9A","XN--45BR5CYL","XN--45BRJ9C","XN--45Q11C","XN--4DBRK0CE","XN--4GBRIM","XN--54B7FTA0CC","XN--55QW42G","XN--55QX5D","XN--5SU34J936BGSG","XN--5TZM5G","XN--6FRZ82G","XN--6QQ986B3XL","XN--80ADXHKS","XN--80AO21A","XN--80AQECDR1A","XN--80ASEHDB","XN--80ASWG","XN--8Y0A063A","XN--90A3AC","XN--90AE","XN--90AIS","XN--9DBQ2A","XN--9ET52U","XN--9KRT00A","XN--B4W605FERD","XN--BCK1B9A5DRE4C","XN--C1AVG","XN--C2BR7G","XN--CCK2B3B","XN--CCKWCXETD","XN--CG4BKI","XN--CLCHC0EA0B2G2A9GCD","XN--CZR694B","XN--CZRS0T","XN--CZRU2D","XN--D1ACJ3B","XN--D1ALF","XN--E1A4C","XN--ECKVDTC9D","XN--EFVY88H","XN--FCT429K","XN--FHBEI","XN--FIQ228C5HS","XN--FIQ64B","XN--FIQS8S","XN--FIQZ9S","XN--FJQ720A","XN--FLW351E","XN--FPCRJ9C3D","XN--FZC2C9E2C","XN--FZYS8D69UVGM","XN--G2XX48C","XN--GCKR3F0F","XN--GECRJ9C","XN--GK3AT1E","XN--H2BREG3EVE","XN--H2BRJ9C","XN--H2BRJ9C8C","XN--HXT814E","XN--I1B6B1A6A2E","XN--IMR513N","XN--IO0A7I","XN--J1AEF","XN--J1AMH","XN--J6W193G","XN--JLQ480N2RG","XN--JVR189M","XN--KCRX77D1X4A","XN--KPRW13D","XN--KPRY57D","XN--KPUT3I","XN--L1ACC","XN--LGBBAT1AD8J","XN--MGB9AWBF","XN--MGBA3A3EJT","XN--MGBA3A4F16A","XN--MGBA7C0BBN0A","XN--MGBAAM7A8H","XN--MGBAB2BD","XN--MGBAH1A3HJKRD","XN--MGBAI9AZGQP6J","XN--MGBAYH7GPA","XN--MGBBH1A","XN--MGBBH1A71E","XN--MGBC0A9AZCG","XN--MGBCA7DZDO","XN--MGBCPQ6GPA1A","XN--MGBERP4A5D4AR","XN--MGBGU82A","XN--MGBI4ECEXP","XN--MGBPL2FH","XN--MGBT3DHD","XN--MGBTX2B","XN--MGBX4CD0AB","XN--MIX891F","XN--MK1BU44C","XN--MXTQ1M","XN--NGBC5AZD","XN--NGBE9E0A","XN--NGBRX","XN--NODE","XN--NQV7F","XN--NQV7FS00EMA","XN--NYQY26A","XN--O3CW4H","XN--OGBPF8FL","XN--OTU796D","XN--P1ACF","XN--P1AI","XN--PGBS0DH","XN--PSSY2U","XN--Q7CE6A","XN--Q9JYB4C","XN--QCKA1PMC","XN--QXA6A","XN--QXAM","XN--RHQV96G","XN--ROVU88B","XN--RVC1E0AM3E","XN--S9BRJ9C","XN--SES554G","XN--T60B56A","XN--TCKWE","XN--TIQ49XQYJ","XN--UNUP4Y","XN--VERMGENSBERATER-CTB","XN--VERMGENSBERATUNG-PWB","XN--VHQUV","XN--VUQ861B","XN--W4R85EL8FHU5DNRA","XN--W4RS40L","XN--WGBH1C","XN--WGBL6A","XN--XHQ521B","XN--XKC2AL3HYE2A","XN--XKC2DL3A5EE0H","XN--Y9A3AQ","XN--YFRO4I67O","XN--YGBI2AMMX","XN--ZFR164B","XXX","XYZ","YACHTS","YAHOO","YAMAXUN","YANDEX","YE","YODOBASHI","YOGA","YOKOHAMA","YOU","YOUTUBE","YT","YUN","ZA","ZAPPOS","ZARA","ZERO","ZIP","ZM","ZONE","ZUERICH","ZW"];l1.exports=new Set(c1.tlds.map(t=>t.toLowerCase()))});var m1=m((fz,g1)=>{"use strict";var Ue=Me(),Yh=Vb(),Gq=s1(),p1=u1(),d1=Yb(),f1=h1(),zq=Qb(),Kq=Zn(),fn=Ze(),Pe={tlds:f1 instanceof Set?{tlds:{allow:f1,deny:null}}:!1,base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:{withPrefix:/^0x[0-9a-f]+$/i,withOptionalPrefix:/^(?:0x)?[0-9a-f]+$/i,withoutPrefix:/^[0-9a-f]+$/i},ipRegex:p1.regex({cidr:"forbidden"}).regex,isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5",uuidv6:"6",uuidv7:"7",uuidv8:"8"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};g1.exports=Kq.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(t,{schema:e,state:n,prefs:r}){let i=e.$_getRule("normalize");i&&(t=t.normalize(i.args.form));let s=e.$_getRule("case");s&&(t=s.args.direction==="upper"?t.toLocaleUpperCase():t.toLocaleLowerCase());let o=e.$_getRule("trim");if(o&&o.args.enabled&&(t=t.trim()),e.$_terms.replacements)for(let u of e.$_terms.replacements)t=t.replace(u.pattern,u.replacement);let a=e.$_getRule("hex");if(a&&a.args.options.byteAligned&&t.length%2!==0&&(t=`0${t}`),e.$_getRule("isoDate")){let u=Pe.isoDate(t);u&&(t=u)}if(e._flags.truncate){let u=e.$_getRule("max");if(u){let c=u.args.limit;if(fn.isResolvable(c)&&(c=c.resolve(t,n,r),!fn.limit(c)))return{value:t,errors:e.$_createError("any.ref",c,{ref:u.args.limit,arg:"limit",reason:"must be a positive integer"},n,r)};t=t.slice(0,c)}}return{value:t}}},validate(t,{schema:e,error:n}){if(typeof t!="string")return{value:t,errors:n("string.base")};if(t===""){let r=e.$_getRule("min");return r&&r.args.limit===0?void 0:{value:t,errors:n("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate(t,e){return/^[a-zA-Z0-9]+$/.test(t)?t:e.error("string.alphanum")}},base64:{method(t={}){return fn.assertOptions(t,["paddingRequired","urlSafe"]),t={urlSafe:!1,paddingRequired:!0,...t},Ue(typeof t.paddingRequired=="boolean","paddingRequired must be boolean"),Ue(typeof t.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:t}})},validate(t,e,{options:n}){return Pe.base64Regex[n.paddingRequired][n.urlSafe].test(t)?t:e.error("string.base64")}},case:{method(t){return Ue(["lower","upper"].includes(t),"Invalid case:",t),this.$_addRule({name:"case",args:{direction:t}})},validate(t,e,{direction:n}){return n==="lower"&&t===t.toLocaleLowerCase()||n==="upper"&&t===t.toLocaleUpperCase()?t:e.error(`string.${n}case`)},convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(t,e){let n=t.length,r=0,i=1;for(;n--;){let s=t.charAt(n)*i;r=r+(s-(s>9)*9),i=i^3}return r>0&&r%10===0?t:e.error("string.creditCard")}},dataUri:{method(t={}){return fn.assertOptions(t,["paddingRequired"]),t={paddingRequired:!0,...t},Ue(typeof t.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:t}})},validate(t,e,{options:n}){let r=t.match(Pe.dataUriRegex);return r&&(!r[2]||r[2]!=="base64"||Pe.base64Regex[n.paddingRequired].false.test(r[3]))?t:e.error("string.dataUri")}},domain:{method(t){t&&fn.assertOptions(t,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);let e=Pe.addressOptions(t);return this.$_addRule({name:"domain",args:{options:t},address:e})},validate(t,e,n,{address:r}){return Yh.isValid(t,r)?t:e.error("string.domain")}},email:{method(t={}){fn.assertOptions(t,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),Ue(t.multiple===void 0||typeof t.multiple=="boolean","multiple option must be an boolean");let e=Pe.addressOptions(t),n=new RegExp(`\\s*[${t.separator?d1(t.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:t},regex:n,address:e})},validate(t,e,{options:n},{regex:r,address:i}){let s=n.multiple?t.split(r):[t],o=[];for(let a of s)Gq.isValid(a,i)||o.push(a);return o.length?e.error("string.email",{value:t,invalids:o}):t}},guid:{alias:"uuid",method(t={}){fn.assertOptions(t,["version","separator"]);let e="";if(t.version){let i=[].concat(t.version);Ue(i.length>=1,"version must have at least 1 valid version specified");let s=new Set;for(let o=0;o<i.length;++o){let a=i[o];Ue(typeof a=="string","version at position "+o+" must be a string");let u=Pe.guidVersions[a.toLowerCase()];Ue(u,"version at position "+o+" must be one of "+Object.keys(Pe.guidVersions).join(", ")),Ue(!s.has(u),"version at position "+o+" must not be a duplicate"),e+=u,s.add(u)}}Ue(Pe.guidSeparators.has(t.separator),'separator must be one of true, false, "-", or ":"');let n=t.separator===void 0?"[:-]?":t.separator===!0?"[:-]":t.separator===!1?"[]?":`\\${t.separator}`,r=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${n})[0-9A-F]{4}\\2?[${e||"0-9A-F"}][0-9A-F]{3}\\2?[${e?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:t},regex:r})},validate(t,e,n,{regex:r}){let i=r.exec(t);return!i||Pe.guidBrackets[i[1]]!==i[i.length-1]?e.error("string.guid"):t}},hex:{method(t={}){return fn.assertOptions(t,["byteAligned","prefix"]),t={byteAligned:!1,prefix:!1,...t},Ue(typeof t.byteAligned=="boolean","byteAligned must be boolean"),Ue(typeof t.prefix=="boolean"||t.prefix==="optional",'prefix must be boolean or "optional"'),this.$_addRule({name:"hex",args:{options:t}})},validate(t,e,{options:n}){return(n.prefix==="optional"?Pe.hexRegex.withOptionalPrefix:n.prefix===!0?Pe.hexRegex.withPrefix:Pe.hexRegex.withoutPrefix).test(t)?n.byteAligned&&t.length%2!==0?e.error("string.hexAlign"):t:e.error("string.hex")}},hostname:{method(){return this.$_addRule("hostname")},validate(t,e){return Yh.isValid(t,{minDomainSegments:1})||Pe.ipRegex.test(t)?t:e.error("string.hostname")}},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(t={}){fn.assertOptions(t,["cidr","version"]);let{cidr:e,versions:n,regex:r}=p1.regex(t),i=t.version?n:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:e,version:i}},regex:r})},validate(t,e,{options:n},{regex:r}){return r.test(t)?t:n.version?e.error("string.ipVersion",{value:t,cidr:n.cidr,version:n.version}):e.error("string.ip",{value:t,cidr:n.cidr})}},isoDate:{method(){return this.$_addRule("isoDate")},validate(t,{error:e}){return Pe.isoDate(t)?t:e("string.isoDate")}},isoDuration:{method(){return this.$_addRule("isoDuration")},validate(t,e){return Pe.isoDurationRegex.test(t)?t:e.error("string.isoDuration")}},length:{method(t,e){return Pe.length(this,"length",t,"=",e)},validate(t,e,{limit:n,encoding:r},{name:i,operator:s,args:o}){let a=r?Buffer&&Buffer.byteLength(t,r):t.length;return fn.compare(a,n,s)?t:e.error("string."+i,{limit:o.limit,value:t,encoding:r})},args:[{name:"limit",ref:!0,assert:fn.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(t,e){return Pe.length(this,"max",t,"<=",e)},args:["limit","encoding"]},min:{method(t,e){return Pe.length(this,"min",t,">=",e)},args:["limit","encoding"]},normalize:{method(t="NFC"){return Ue(Pe.normalizationForms.includes(t),"normalization form must be one of "+Pe.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:t}})},validate(t,{error:e},{form:n}){return t===t.normalize(n)?t:e("string.normalize",{value:t,form:n})},convert:!0},pattern:{alias:"regex",method(t,e={}){Ue(t instanceof RegExp,"regex must be a RegExp"),Ue(!t.flags.includes("g")&&!t.flags.includes("y"),"regex should not use global or sticky mode"),typeof e=="string"&&(e={name:e}),fn.assertOptions(e,["invert","name"]);let n=["string.pattern",e.invert?".invert":"",e.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:t,options:e},errorCode:n})},validate(t,e,{regex:n,options:r},{errorCode:i}){return n.test(t)^r.invert?t:e.error(i,{name:r.name,regex:n,value:t})},args:["regex","options"],multi:!0},replace:{method(t,e){typeof t=="string"&&(t=new RegExp(d1(t),"g")),Ue(t instanceof RegExp,"pattern must be a RegExp"),Ue(typeof e=="string","replacement must be a String");let n=this.clone();return n.$_terms.replacements||(n.$_terms.replacements=[]),n.$_terms.replacements.push({pattern:t,replacement:e}),n}},token:{method(){return this.$_addRule("token")},validate(t,e){return/^\w+$/.test(t)?t:e.error("string.token")}},trim:{method(t=!0){return Ue(typeof t=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:t}})},validate(t,e,{enabled:n}){return!n||t===t.trim()?t:e.error("string.trim")},convert:!0},truncate:{method(t=!0){return Ue(typeof t=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",t)}},uppercase:{method(){return this.case("upper")}},uri:{method(t={}){fn.assertOptions(t,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),t.domain&&fn.assertOptions(t.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);let{regex:e,scheme:n}=zq.regex(t),r=t.domain?Pe.addressOptions(t.domain):null;return this.$_addRule({name:"uri",args:{options:t},regex:e,domain:r,scheme:n})},validate(t,e,{options:n},{regex:r,domain:i,scheme:s}){if(["http:/","https:/"].includes(t))return e.error("string.uri");let o=r.exec(t);if(!o&&e.prefs.convert&&n.encodeUri){let a=encodeURI(t);o=r.exec(a),o&&(t=a)}if(o){let a=o[1]||o[2];return i&&(!n.allowRelative||a)&&!Yh.isValid(a,i)?e.error("string.domain",{value:a}):t}return n.relativeOnly?e.error("string.uriRelativeOnly"):n.scheme?e.error("string.uriCustomScheme",{scheme:s,value:t}):e.error("string.uri")}}},manifest:{build(t,e){if(e.replacements)for(let{pattern:n,replacement:r}of e.replacements)t=t.replace(n,r);return t}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}});Pe.addressOptions=function(t){if(!t)return Pe.tlds||t;if(Ue(t.minDomainSegments===void 0||Number.isSafeInteger(t.minDomainSegments)&&t.minDomainSegments>0,"minDomainSegments must be a positive integer"),Ue(t.maxDomainSegments===void 0||Number.isSafeInteger(t.maxDomainSegments)&&t.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),t.tlds===!1)return t;if(t.tlds===!0||t.tlds===void 0)return Ue(Pe.tlds,"Built-in TLD list disabled"),Object.assign({},t,Pe.tlds);Ue(typeof t.tlds=="object","tlds must be true, false, or an object");let e=t.tlds.deny;if(e)return Array.isArray(e)&&(t=Object.assign({},t,{tlds:{deny:new Set(e)}})),Ue(t.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),Ue(!t.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),Pe.validateTlds(t.tlds.deny,"tlds.deny"),t;let n=t.tlds.allow;return n?n===!0?(Ue(Pe.tlds,"Built-in TLD list disabled"),Object.assign({},t,Pe.tlds)):(Array.isArray(n)&&(t=Object.assign({},t,{tlds:{allow:new Set(n)}})),Ue(t.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),Pe.validateTlds(t.tlds.allow,"tlds.allow"),t):t};Pe.validateTlds=function(t,e){for(let n of t)Ue(Yh.isValid(n,{minDomainSegments:1,maxDomainSegments:1}),`${e} must contain valid top level domain names`)};Pe.isoDate=function(t){if(!fn.isIsoDate(t))return null;/.*T.*[+-]\d\d$/.test(t)&&(t+="00");let e=new Date(t);return isNaN(e.getTime())?null:e.toISOString()};Pe.length=function(t,e,n,r,i){return Ue(!i||Buffer&&Buffer.isEncoding(i),"Invalid encoding:",i),t.$_addRule({name:e,method:"length",args:{limit:n,encoding:i},operator:r})}});var b1=m((pz,y1)=>{"use strict";var Jh=Me(),Vq=Zn(),Zb={};Zb.Map=class extends Map{slice(){return new Zb.Map(this)}};y1.exports=Vq.extend({type:"symbol",terms:{map:{init:new Zb.Map}},coerce:{method(t,{schema:e,error:n}){let r=e.$_terms.map.get(t);return r&&(t=r),!e._flags.only||typeof t=="symbol"?{value:t}:{value:t,errors:n("symbol.map",{map:e.$_terms.map})}}},validate(t,{error:e}){if(typeof t!="symbol")return{value:t,errors:e("symbol.base")}},rules:{map:{method(t){t&&!t[Symbol.iterator]&&typeof t=="object"&&(t=Object.entries(t)),Jh(t&&t[Symbol.iterator],"Iterable must be an iterable or object");let e=this.clone(),n=[];for(let r of t){Jh(r&&r[Symbol.iterator],"Entry must be an iterable");let[i,s]=r;Jh(typeof i!="object"&&typeof i!="function"&&typeof i!="symbol","Key must not be of type object, function, or Symbol"),Jh(typeof s=="symbol","Value must be a Symbol"),e.$_terms.map.set(i,s),n.push(s)}return e.valid(...n)}}},manifest:{build(t,e){return e.map&&(t=t.map(e.map)),t}},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})});var S1=m((mz,v1)=>{"use strict";var Xq=Me(),Yq=Zn(),_1=Ze();v1.exports=Yq.extend({type:"binary",coerce:{from:["string","object"],method(t,{schema:e}){if(typeof t=="string"||t!==null&&t.type==="Buffer")try{return{value:Buffer.from(t,e._flags.encoding)}}catch{}}},validate(t,{error:e}){if(!Buffer.isBuffer(t))return{value:t,errors:e("binary.base")}},rules:{encoding:{method(t){return Xq(Buffer.isEncoding(t),"Invalid encoding:",t),this.$_setFlag("encoding",t)}},length:{method(t){return this.$_addRule({name:"length",method:"length",args:{limit:t},operator:"="})},validate(t,e,{limit:n},{name:r,operator:i,args:s}){return _1.compare(t.length,n,i)?t:e.error("binary."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:_1.limit,message:"must be a positive integer"}]},max:{method(t){return this.$_addRule({name:"max",method:"length",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"length",args:{limit:t},operator:">="})}}},cast:{string:{from:t=>Buffer.isBuffer(t),to(t,e){return t.toString()}}},messages:{"binary.base":"{{#label}} must be a buffer or a string","binary.length":"{{#label}} must be {{#limit}} bytes","binary.max":"{{#label}} must be less than or equal to {{#limit}} bytes","binary.min":"{{#label}} must be at least {{#limit}} bytes"}})});var Mh=m((yz,x1)=>{"use strict";var Ps=Me(),Jq=ln(),Qq=Cb(),Rs=Ze(),Zq=ks(),t_=ui(),ej=Ob(),w1=Db(),e_=ci(),T1=Ui(),E1=Mb(),Qh,Dt={types:{alternatives:CA(),any:Zn(),array:RA(),boolean:LA(),date:FA(),function:QA(),link:e1(),number:n1(),object:i1(),string:m1(),symbol:b1()},aliases:{alt:"alternatives",bool:"boolean",func:"function"}};Buffer&&(Dt.types.binary=S1());Dt.root=function(){let t={_types:new Set(Object.keys(Dt.types))};for(let e of t._types)t[e]=function(...n){return Ps(!n.length||["alternatives","link","object"].includes(e),"The",e,"type does not allow arguments"),Dt.generate(this,Dt.types[e],n)};for(let e of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])t[e]=function(...n){return this.any()[e](...n)};Object.assign(t,Dt.methods);for(let e in Dt.aliases){let n=Dt.aliases[e];t[e]=t[n]}return t.x=t.expression,E1.setup&&E1.setup(t),t};Dt.methods={ValidationError:t_.ValidationError,version:Rs.version,cache:Qq.provider,assert(t,e,...n){Dt.assert(t,e,!0,n)},attempt(t,e,...n){return Dt.assert(t,e,!1,n)},build(t){return Ps(typeof w1.build=="function","Manifest functionality disabled"),w1.build(this,t)},checkPreferences(t){Rs.checkPreferences(t)},compile(t,e){return Zq.compile(this,t,e)},defaults(t){Ps(typeof t=="function","modifier must be a function");let e=Object.assign({},this);for(let n of e._types){let r=t(e[n]());Ps(Rs.isSchema(r),"modifier must return a valid schema object"),e[n]=function(...i){return Dt.generate(this,r,i)}}return e},expression(...t){return new T1(...t)},extend(...t){Rs.verifyFlat(t,"extend"),Qh=Qh||Ih(),Ps(t.length,"You need to provide at least one extension"),this.assert(t,Qh.extensions);let e=Object.assign({},this);e._types=new Set(e._types);for(let n of t){typeof n=="function"&&(n=n(e)),this.assert(n,Qh.extension);let r=Dt.expandExtension(n,e);for(let i of r){Ps(e[i.type]===void 0||e._types.has(i.type),"Cannot override name",i.type);let s=i.base||this.any(),o=ej.type(s,i);e._types.add(i.type),e[i.type]=function(...a){return Dt.generate(this,o,a)}}}return e},isError:t_.ValidationError.isError,isExpression:T1.isTemplate,isRef:e_.isRef,isSchema:Rs.isSchema,in(...t){return e_.in(...t)},override:Rs.symbols.override,ref(...t){return e_.create(...t)},types(){let t={};for(let e of this._types)t[e]=this[e]();for(let e in Dt.aliases)t[e]=this[e]();return t}};Dt.assert=function(t,e,n,r){let i=r[0]instanceof Error||typeof r[0]=="string"?r[0]:null,s=i!==null?r[1]:r[0],o=e.validate(t,Rs.preferences({errors:{stack:!0}},s||{})),a=o.error;if(!a)return o.value;if(i instanceof Error)throw i;let u=n&&typeof a.annotate=="function"?a.annotate():a.message;throw a instanceof t_.ValidationError||(a=Jq(a)),a.message=i?`${i} ${u}`:u,a};Dt.generate=function(t,e,n){return Ps(t,"Must be invoked on a Joi instance."),e.$_root=t,!e._definition.args||!n.length?e:e._definition.args(e,...n)};Dt.expandExtension=function(t,e){if(typeof t.type=="string")return[t];let n=[];for(let r of e._types)if(t.type.test(r)){let i=Object.assign({},t);i.type=r,i.base=e[r](),n.push(i)}return n};x1.exports=Dt.root()});var k1=m(Se=>{"use strict";var tj=Se&&Se.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Se,"__esModule",{value:!0});Se.descriptionContainerSchema=Se.signatureSchema=Se.signatureDefinitionContainerSchema=Se.signatureDefinitionSchema=Se.signatureDefinitionFunctionSchema=Se.signatureDefinitionFunctionSchemaArg=Se.signatureDefinitionFunctionSchemaArgMultiTypes=Se.signatureDefinitionFunctionSchemaArgDefaultNumber=Se.signatureDefinitionFunctionSchemaArgDefaultString=Se.signatureDefinitionTypeSchema=Se.variationsSchema=void 0;var oe=tj(Mh()),Zh=vs();Se.variationsSchema=oe.default.array().items(oe.default.alternatives(oe.default.string(),oe.default.number()));Se.signatureDefinitionTypeSchema=oe.default.alternatives(oe.default.string(),oe.default.object({type:oe.default.string().required(),keyType:oe.default.string().optional(),valueType:oe.default.string().optional()}));Se.signatureDefinitionFunctionSchemaArgDefaultString=oe.default.object({type:oe.default.string().valid(Zh.SignatureDefinitionBaseType.String).required(),value:oe.default.string().allow("").required()});Se.signatureDefinitionFunctionSchemaArgDefaultNumber=oe.default.object({type:oe.default.string().valid(Zh.SignatureDefinitionBaseType.Number).required(),value:oe.default.number().required()});Se.signatureDefinitionFunctionSchemaArgMultiTypes=oe.default.object({label:oe.default.string().required(),types:oe.default.array().items(Se.signatureDefinitionTypeSchema).required(),opt:oe.default.boolean().optional(),default:oe.default.alternatives(Se.signatureDefinitionFunctionSchemaArgDefaultString,Se.signatureDefinitionFunctionSchemaArgDefaultNumber).optional()});Se.signatureDefinitionFunctionSchemaArg=oe.default.object({label:oe.default.string().required(),type:Se.signatureDefinitionTypeSchema.required(),opt:oe.default.boolean().optional(),default:oe.default.alternatives(Se.signatureDefinitionFunctionSchemaArgDefaultString,Se.signatureDefinitionFunctionSchemaArgDefaultNumber).optional()});Se.signatureDefinitionFunctionSchema=oe.default.object({type:oe.default.string().valid(Zh.SignatureDefinitionBaseType.Function).required(),description:oe.default.string().optional(),example:oe.default.string().optional(),isProtected:oe.default.boolean().optional(),arguments:oe.default.array().items(oe.default.alternatives(Se.signatureDefinitionFunctionSchemaArg,Se.signatureDefinitionFunctionSchemaArgMultiTypes)).optional(),returns:oe.default.array().items(Se.signatureDefinitionTypeSchema).required(),variations:Se.variationsSchema.optional(),returnVariations:Se.variationsSchema.optional()});Se.signatureDefinitionSchema=oe.default.object({type:Se.signatureDefinitionTypeSchema.invalid(Zh.SignatureDefinitionBaseType.Function).required(),description:oe.default.string().optional(),example:oe.default.string().optional(),isProtected:oe.default.boolean().optional(),variations:Se.variationsSchema.optional()});Se.signatureDefinitionContainerSchema=oe.default.object().pattern(oe.default.string(),oe.default.alternatives(Se.signatureDefinitionFunctionSchema,Se.signatureDefinitionSchema));Se.signatureSchema=oe.default.object({type:oe.default.string().required(),hidden:oe.default.boolean().optional(),extends:oe.default.string().optional(),definitions:oe.default.object().required()});Se.descriptionContainerSchema=oe.default.object({$meta:oe.default.object({description:oe.default.string().required(),example:oe.default.array().items(oe.default.string().allow("")).optional()}).optional()}).pattern(oe.default.string(),oe.default.object({description:oe.default.string().required(),example:oe.default.array().items(oe.default.string().allow("")).optional()}))});var s_=m(xn=>{"use strict";var $o=xn&&xn.__assign||function(){return $o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},$o.apply(this,arguments)},nj=xn&&xn.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},zi=xn&&xn.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},n_=xn&&xn.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},rj=xn&&xn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xn,"__esModule",{value:!0});xn.Signature=void 0;var r_=rj(Mh()),i_=k1(),ij=vs(),sj=Ph(),oj=vb(),aj=function(){function t(e){var n,r,i;this._type=e.type,this._extends=(n=e.extends)!==null&&n!==void 0?n:null,this._descriptions={},this._definitions=(r=e.definitions)!==null&&r!==void 0?r:{},this._hidden=(i=e.hidden)!==null&&i!==void 0?i:!1}return t.parseDefinitions=function(e){var n,r;r_.default.assert(e,i_.signatureDefinitionContainerSchema);var i={};try{for(var s=zi(Object.entries(e)),o=s.next();!o.done;o=s.next()){var a=n_(o.value,2),u=a[0],c=a[1],l=c.type===ij.SignatureDefinitionBaseType.Function?oj.SignatureDefinitionFunction.parse(c):sj.SignatureDefinition.parse(c);i[u]=l}}catch(h){n={error:h}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return i},t.parseDescriptions=function(e){var n,r,i,s,o;r_.default.assert(e,i_.descriptionContainerSchema);var a=e,u=null;if(a.$meta){var c=e.$meta,l=nj(e,["$meta"]);u=c,a=l}var h={};try{for(var d=zi(Object.entries(a)),g=d.next();!g.done;g=d.next()){var y=n_(g.value,2),_=y[0],C=y[1];h[_]={description:C.description,example:(i=C.example)!==null&&i!==void 0?i:null}}}catch(k){n={error:k}}finally{try{g&&!g.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}return $o({$meta:{description:(s=u?.description)!==null&&s!==void 0?s:"unknown",example:(o=u?.example)!==null&&o!==void 0?o:null}},h)},t.parse=function(e,n){var r,i;r_.default.assert(e,i_.signatureSchema);var s=new t({type:e.type,hidden:e.hidden,extends:e.extends}),o=t.parseDefinitions(e.definitions);if(s.setDefinition(o),n!=null)try{for(var a=zi(Object.entries(n)),u=a.next();!u.done;u=a.next()){var c=n_(u.value,2),l=c[0],h=c[1],d=t.parseDescriptions(h);s.addDescriptions(l,d)}}catch(g){r={error:g}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return s},t.prototype.getType=function(){return this._type},t.prototype.getExtendedType=function(){return this._extends},t.prototype.getDefinitions=function(){return this._definitions},t.prototype.getAllDescriptions=function(){return this._descriptions},t.prototype.isHidden=function(){return this._hidden},t.prototype.setExtend=function(e){return this._extends=e,this},t.prototype.setDefinition=function(e){return this._definitions=e,this},t.prototype.mergeDefinitions=function(e){var n,r,i=Object.keys(e);try{for(var s=zi(i),o=s.next();!o.done;o=s.next()){var a=o.value;this._definitions[a]=e[a]}}catch(u){n={error:u}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return this},t.prototype.getDefinition=function(e,n){if(!Object.prototype.hasOwnProperty.call(this._definitions,e))return null;var r=this._definitions[e],i=this.getDescriptions(n),s=i[e];return r.withDescription(s)},t.prototype.setDescriptions=function(e,n){return this._descriptions[e]=n,this},t.prototype.addDescriptions=function(e,n){var r,i,s=this._descriptions[e];s==null&&(s={},this._descriptions[e]=s);var o=Object.keys(n);try{for(var a=zi(o),u=a.next();!u.done;u=a.next()){var c=u.value;s[c]=$o($o({},s[c]),n[c])}}catch(l){r={error:l}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return this},t.prototype.getDescriptions=function(e){e===void 0&&(e="en");var n=this._descriptions[e];return n??{}},t.prototype.toJSON=function(){var e,n,r={},i=Object.keys(this._definitions);try{for(var s=zi(i),o=s.next();!o.done;o=s.next()){var a=o.value;r[a]=this._definitions[a].toJSON()}}catch(u){e={error:u}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}return{type:this._type,extend:this._extends,hidden:this._hidden,definitions:r}},t.prototype.copy=function(){var e,n,r,i,s=new t({type:this._type,hidden:this._hidden,extends:this._extends}),o={},a=Object.keys(this._definitions);try{for(var u=zi(a),c=u.next();!c.done;c=u.next()){var l=c.value;o[l]=this._definitions[l].copy()}}catch(_){e={error:_}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}var h={},d=Object.keys(this._descriptions);try{for(var g=zi(d),y=g.next();!y.done;y=g.next()){var l=y.value;h[l]=$o({},h[l])}}catch(_){r={error:_}}finally{try{y&&!y.done&&(i=g.return)&&i.call(g)}finally{if(r)throw r.error}}return s._descriptions=h,s._definitions=o,s},t}();xn.Signature=aj});var A1=m(zr=>{"use strict";var Ki=zr&&zr.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},Bo=zr&&zr.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))},Su=zr&&zr.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(zr,"__esModule",{value:!0});zr.Container=void 0;var Gr=s_(),Tt=vs(),uj=function(){function t(){this._primitives=new Map([[Tt.SignatureDefinitionBaseType.Any,new Gr.Signature({type:Tt.SignatureDefinitionBaseType.Any})],[Tt.SignatureDefinitionBaseType.General,new Gr.Signature({type:Tt.SignatureDefinitionBaseType.General})],[Tt.SignatureDefinitionBaseType.String,new Gr.Signature({type:Tt.SignatureDefinitionBaseType.String})],[Tt.SignatureDefinitionBaseType.Function,new Gr.Signature({type:Tt.SignatureDefinitionBaseType.Function})],[Tt.SignatureDefinitionBaseType.Number,new Gr.Signature({type:Tt.SignatureDefinitionBaseType.Number})],[Tt.SignatureDefinitionBaseType.List,new Gr.Signature({type:Tt.SignatureDefinitionBaseType.List})],[Tt.SignatureDefinitionBaseType.Map,new Gr.Signature({type:Tt.SignatureDefinitionBaseType.Map})]]),this._types=new Map,this._excludeFromSearch=new Set}return t.prototype.getOrCreateTypeSignature=function(e){var n=this.getTypeSignature(e);return n==null&&(n=new Gr.Signature({type:e}),this._types.set(e,n)),n},t.prototype.getPrimitives=function(){return this._primitives},t.prototype.getTypes=function(){return this._types},t.prototype.getAllVisibleTypes=function(){var e=this;return Bo(Bo([],Ki(this._primitives.keys()),!1),Ki(this._types.keys()),!1).filter(function(n){return!e.getTypeSignature(n).isHidden()&&n!==Tt.SignatureDefinitionBaseType.Any&&n!==Tt.SignatureDefinitionBaseType.General})},t.prototype.excludeFromSearch=function(e){return this._excludeFromSearch.add(e),this},t.prototype.includeToSearch=function(e){return this._excludeFromSearch.delete(e),this},t.prototype.getTypeSignature=function(e){var n,r;return(r=(n=this._primitives.get(e))!==null&&n!==void 0?n:this._types.get(e))!==null&&r!==void 0?r:null},t.prototype.getAllPrimitiveSignatures=function(){return Array.from(this._primitives.values())},t.prototype.getAllTypeSignatures=function(){return Array.from(this._types.values())},t.prototype.getAllSignatures=function(){return Bo(Bo([],Ki(this.getAllPrimitiveSignatures()),!1),Ki(this.getAllTypeSignatures()),!1)},t.prototype.getAllVisibleSignatures=function(){return Bo(Bo([],Ki(this.getAllPrimitiveSignatures()),!1),Ki(this.getAllTypeSignatures()),!1).filter(function(e){return e.isHidden()})},t.prototype.addTypeSignatureFromPayload=function(e){var n=Gr.Signature.parse(e);return this.addTypeSignature({type:n.getType(),extends:n.getExtendedType(),hidden:n.isHidden(),definitions:n.getDefinitions()}),this},t.prototype.addTypeSignature=function(e){var n=this.getOrCreateTypeSignature(e.type);return e.extends!==void 0&&n.setExtend(e.extends),n.mergeDefinitions(e.definitions),this},t.prototype.addMetaFromPayload=function(e,n){var r,i,s={},o=Object.keys(n);try{for(var a=Su(o),u=a.next();!u.done;u=a.next()){var c=u.value,l=Gr.Signature.parseDescriptions(n[c]);s[c]=l}}catch(h){r={error:h}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return this.addMeta(e,s),this},t.prototype.addMeta=function(e,n){var r,i,s=Object.keys(n);try{for(var o=Su(s),a=o.next();!a.done;a=o.next()){var u=a.value,c=this.getOrCreateTypeSignature(u);c.addDescriptions(e,n[u])}}catch(l){r={error:l}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return this},t.prototype.searchDefinitionMatches=function(e,n,r){var i,s;if(r===void 0&&(r="en"),typeof e=="string")return this.searchDefinitionMatches([e],n,r);var o=e.includes(Tt.SignatureDefinitionBaseType.Any)?new Set(this.getAllVisibleTypes()):new Set(e),a=new Set,u=new Map;try{for(var c=Su(o),l=c.next();!l.done;l=c.next()){var h=l.value;if(!this._excludeFromSearch.has(h)){for(var d=h,g=this.getTypeSignature(h),y=null;g!==null&&!a.has(g.getType())&&(a.add(g.getType()),g.isHidden()||(y=g.getDefinition(n,r)),y===null);)d=g.getExtendedType(),g=this.getTypeSignature(d);y!==null&&u.set(d,y)}}}catch(_){i={error:_}}finally{try{l&&!l.done&&(s=c.return)&&s.call(c)}finally{if(i)throw i.error}}return u},t.prototype.getDefinition=function(e,n,r){if(r===void 0&&(r="en"),typeof e=="string")return this.getDefinition([e],n,r);var i=this._primitives.get(Tt.SignatureDefinitionBaseType.Any).getDefinition(n,r);if(e.includes(Tt.SignatureDefinitionBaseType.Any)&&i)return i;var s=this.searchDefinitionMatches(e,n,r);return s.size===0?null:s.size===1?s.values().next().value:s.has(Tt.SignatureDefinitionBaseType.Any)?s.get(Tt.SignatureDefinitionBaseType.Any):i!==null?i:s.values().next().value},t.prototype.fork=function(){var e,n,r,i,s=new t;try{for(var o=Su(this._primitives),a=o.next();!a.done;a=o.next()){var u=Ki(a.value,2),c=u[0],l=u[1];s._primitives.set(c,l.copy())}}catch(y){e={error:y}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}try{for(var h=Su(this._types),d=h.next();!d.done;d=h.next()){var g=Ki(d.value,2),c=g[0],l=g[1];s._types.set(c,l.copy())}}catch(y){r={error:y}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}return s._excludeFromSearch=new Set(this._excludeFromSearch),s},t}();zr.Container=uj});var O1=m(C1=>{"use strict";Object.defineProperty(C1,"__esModule",{value:!0})});var nr=m(mt=>{"use strict";var cj=mt&&mt.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),R1=mt&&mt.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&cj(e,t,n)};Object.defineProperty(mt,"__esModule",{value:!0});mt.VariationRegistry=mt.Container=mt.Signature=mt.SignatureDefinition=mt.SignatureDefinitionTypeMeta=mt.SignatureDefinitionFunction=mt.SignatureDefinitionFunctionArg=void 0;var lj=_b();Object.defineProperty(mt,"SignatureDefinitionFunctionArg",{enumerable:!0,get:function(){return lj.SignatureDefinitionFunctionArg}});var hj=vb();Object.defineProperty(mt,"SignatureDefinitionFunction",{enumerable:!0,get:function(){return hj.SignatureDefinitionFunction}});var dj=hu();Object.defineProperty(mt,"SignatureDefinitionTypeMeta",{enumerable:!0,get:function(){return dj.SignatureDefinitionTypeMeta}});var fj=Ph();Object.defineProperty(mt,"SignatureDefinition",{enumerable:!0,get:function(){return fj.SignatureDefinition}});var pj=s_();Object.defineProperty(mt,"Signature",{enumerable:!0,get:function(){return pj.Signature}});var gj=A1();Object.defineProperty(mt,"Container",{enumerable:!0,get:function(){return gj.Container}});var mj=Rh();Object.defineProperty(mt,"VariationRegistry",{enumerable:!0,get:function(){return mj.VariationRegistry}});R1(O1(),mt);R1(vs(),mt)});var o_=m(Ds=>{"use strict";Object.defineProperty(Ds,"__esModule",{value:!0});Ds.enrichWithMetaInformation=Ds.FunctionBlockTag=void 0;var yj=bb(),P1=nr();function D1(t){return[t.name,t.description].filter(e=>e!==void 0).join(" ")}var wu;(function(t){t.Description="description",t.Param="param",t.Return="return",t.Example="example"})(wu=Ds.FunctionBlockTag||(Ds.FunctionBlockTag={}));function bj(t){let e=[t.description??"",...t.tags.filter(s=>s.tag===wu.Description).map(D1)].join(`
103
+ [${u}] ${this.details[a].message}`}return o=o+r,o};ks.safeStringify=function(t,e){return JSON.stringify(t,ks.serializer(),e)};ks.serializer=function(){let t=[],e=[],n=(r,i)=>e[0]===i?"[Circular ~]":"[Circular ~."+t.slice(0,e.indexOf(i)).join(".")+"]";return function(r,i){if(e.length>0){let s=e.indexOf(this);~s?(e.length=s+1,t.length=s+1,t[s]=r):(e.push(this),t.push(r)),~e.indexOf(i)&&(i=n.call(this,r,i))}else e.push(i);if(i){let s=i[ks.annotations];if(s){if(Array.isArray(i)){let o=[];for(let a=0;a<i.length;++a)s.errors[a]&&o.push(`_$idx$_${s.errors[a].sort().join(", ")}_$end$_`),o.push(i[a]);i=o}else{for(let o in s.errors)i[`${o}_$key$_${s.errors[o].sort().join(", ")}_$end$_`]=i[o],i[o]=void 0;for(let o in s.missing)i[`_$miss$_${o}|${s.missing[o]}_$end$_`]="__missing__"}return i}}return i===1/0||i===-1/0||Number.isNaN(i)||typeof i=="function"||typeof i=="symbol"?"["+i.toString()+"]":i}}});var li=m(Ot=>{"use strict";var oq=eA(),aq=Ze(),uq=Vi();Ot.Report=class{constructor(t,e,n,r,i,s,o){if(this.code=t,this.flags=r,this.messages=i,this.path=s.path,this.prefs=o,this.state=s,this.value=e,this.message=null,this.template=null,this.local=n||{},this.local.label=Ot.label(this.flags,this.state,this.prefs,this.messages),this.value!==void 0&&!this.local.hasOwnProperty("value")&&(this.local.value=this.value),this.path.length){let a=this.path[this.path.length-1];typeof a!="object"&&(this.local.key=a)}}_setTemplate(t){if(this.template=t,!this.flags.label&&this.path.length===0){let e=this._template(this.template,"root");e&&(this.local.label=e)}}toString(){if(this.message)return this.message;let t=this.code;if(!this.prefs.errors.render)return this.code;let e=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return e===void 0?`Error code "${t}" is not defined, your custom type is missing the correct messages definition`:(this.message=e.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(t,e){return Ot.template(this.value,t,e||this.code,this.state,this.prefs)}};Ot.path=function(t){let e="";for(let n of t)typeof n!="object"&&(typeof n=="string"?(e&&(e+="."),e+=n):e+=`[${n}]`);return e};Ot.template=function(t,e,n,r,i){if(!e)return;if(uq.isTemplate(e))return n!=="root"?e:null;let s=i.errors.language;if(aq.isResolvable(s)&&(s=s.resolve(t,r,i)),s&&e[s]){if(e[s][n]!==void 0)return e[s][n];if(e[s]["*"]!==void 0)return e[s]["*"]}return e[n]?e[n]:e["*"]};Ot.label=function(t,e,n,r){if(!n.errors.label)return"";if(t.label)return t.label;let i=e.path;n.errors.label==="key"&&e.path.length>1&&(i=e.path.slice(-1));let s=Ot.path(i);return s||Ot.template(null,n.messages,"root",e,n)||r&&Ot.template(null,r,"root",e,n)||"value"};Ot.process=function(t,e,n){if(!t)return null;let{override:r,message:i,details:s}=Ot.details(t);if(r)return r;if(n.errors.stack)return new Ot.ValidationError(i,s,e);let o=Error.stackTraceLimit;Error.stackTraceLimit=0;let a=new Ot.ValidationError(i,s,e);return Error.stackTraceLimit=o,a};Ot.details=function(t,e={}){let n=[],r=[];for(let i of t){if(i instanceof Error){if(e.override!==!1)return{override:i};let o=i.toString();n.push(o),r.push({message:o,type:"override",context:{error:i}});continue}let s=i.toString();n.push(s),r.push({message:s,path:i.path.filter(o=>typeof o!="object"),type:i.code,context:i.local})}return n.length>1&&(n=[...new Set(n)]),{message:n.join(". "),details:r}};Ot.ValidationError=class extends Error{constructor(t,e,n){super(t),this._original=n,this.details=e}static isError(t){return t instanceof Ot.ValidationError}};Ot.ValidationError.prototype.isJoi=!0;Ot.ValidationError.prototype.name="ValidationError";Ot.ValidationError.prototype.annotate=oq.error});var hi=m(Zn=>{"use strict";var Jn=Le(),cq=dn(),lq=xs(),gu=Ze(),Nb,Qn={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};Zn.create=function(t,e={}){Jn(typeof t=="string","Invalid reference key:",t),gu.assertOptions(e,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),Jn(!e.prefix||typeof e.prefix=="object","options.prefix must be of type object");let n=Object.assign({},Qn.defaults,e);delete n.prefix;let r=n.separator,i=Qn.context(t,r,e.prefix);if(n.type=i.type,t=i.key,n.type==="value")if(i.root&&(Jn(!r||t[0]!==r,"Cannot specify relative path with root prefix"),n.ancestor="root",t||(t=null)),r&&r===t)t=null,n.ancestor=0;else if(n.ancestor!==void 0)Jn(!r||!t||t[0]!==r,"Cannot combine prefix with ancestor option");else{let[s,o]=Qn.ancestor(t,r);o&&(t=t.slice(o),t===""&&(t=null)),n.ancestor=s}return n.path=r?t===null?[]:t.split(r):[t],new Qn.Ref(n)};Zn.in=function(t,e={}){return Zn.create(t,{...e,in:!0})};Zn.isRef=function(t){return t?!!t[gu.symbols.ref]:!1};Qn.Ref=class{constructor(t){Jn(typeof t=="object","Invalid reference construction"),gu.assertOptions(t,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),Jn([!1,void 0].includes(t.separator)||typeof t.separator=="string"&&t.separator.length===1,"Invalid separator"),Jn(!t.adjust||typeof t.adjust=="function","options.adjust must be a function"),Jn(!t.map||Array.isArray(t.map),"options.map must be an array"),Jn(!t.map||!t.adjust,"Cannot set both map and adjust options"),Object.assign(this,Qn.defaults,t),Jn(this.type==="value"||this.ancestor===void 0,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(t,e,n,r,i={}){return Jn(!this.in||i.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(n.context,e,i):this.type==="local"?this._resolve(r,e,i):this.ancestor?this.ancestor==="root"?this._resolve(e.ancestors[e.ancestors.length-1],e,i):(Jn(this.ancestor<=e.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(e.ancestors[this.ancestor-1],e,i)):this._resolve(t,e,i)}_resolve(t,e,n){let r;if(this.type==="value"&&e.mainstay.shadow&&n.shadow!==!1&&(r=e.mainstay.shadow.get(this.absolute(e))),r===void 0&&(r=lq(t,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(r=this.adjust(r)),this.map){let i=this.map.get(r);i!==void 0&&(r=i)}return e.mainstay&&e.mainstay.tracer.resolve(e,this,r),r}toString(){return this.display}absolute(t){return[...t.path.slice(0,-this.ancestor),...this.path]}clone(){return new Qn.Ref(this)}describe(){let t={path:this.path};this.type!=="value"&&(t.type=this.type),this.separator!=="."&&(t.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(t.ancestor=this.ancestor),this.map&&(t.map=[...this.map]);for(let e of["adjust","iterables","render"])this[e]!==null&&this[e]!==void 0&&(t[e]=this[e]);return this.in!==!1&&(t.in=!0),{ref:t}}updateDisplay(){let t=this.key!==null?this.key:"";if(this.type!=="value"){this.display=`ref:${this.type}:${t}`;return}if(!this.separator){this.display=`ref:${t}`;return}if(!this.ancestor){this.display=`ref:${this.separator}${t}`;return}if(this.ancestor==="root"){this.display=`ref:root:${t}`;return}if(this.ancestor===1){this.display=`ref:${t||".."}`;return}let e=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${e}${t||""}`}};Qn.Ref.prototype[gu.symbols.ref]=!0;Zn.build=function(t){return t=Object.assign({},Qn.defaults,t),t.type==="value"&&t.ancestor===void 0&&(t.ancestor=1),new Qn.Ref(t)};Qn.context=function(t,e,n={}){if(t=t.trim(),n){let r=n.global===void 0?"$":n.global;if(r!==e&&t.startsWith(r))return{key:t.slice(r.length),type:"global"};let i=n.local===void 0?"#":n.local;if(i!==e&&t.startsWith(i))return{key:t.slice(i.length),type:"local"};let s=n.root===void 0?"/":n.root;if(s!==e&&t.startsWith(s))return{key:t.slice(s.length),type:"value",root:!0}}return{key:t,type:"value"}};Qn.ancestor=function(t,e){if(!e)return[1,0];if(t[0]!==e)return[1,0];if(t[1]!==e)return[0,1];let n=2;for(;t[n]===e;)++n;return[n-1,n]};Zn.toSibling=0;Zn.toParent=1;Zn.Manager=class{constructor(){this.refs=[]}register(t,e){if(t){if(e=e===void 0?Zn.toParent:e,Array.isArray(t)){for(let n of t)this.register(n,e);return}if(gu.isSchema(t)){for(let n of t._refs.refs)n.ancestor-e>=0&&this.refs.push({ancestor:n.ancestor-e,root:n.root});return}Zn.isRef(t)&&t.type==="value"&&t.ancestor-e>=0&&this.refs.push({ancestor:t.ancestor-e,root:t.root}),Nb=Nb||Vi(),Nb.isTemplate(t)&&this.register(t.refs(),e)}}get length(){return this.refs.length}clone(){let t=new Zn.Manager;return t.refs=cq(this.refs),t}reset(){this.refs=[]}roots(){return this.refs.filter(t=>!t.ancestor).map(t=>t.root)}}});var Vi=m((iA,sA)=>{"use strict";var Hh=Le(),hq=dn(),dq=Jk(),fq=Qk(),nA=Ze(),tA=li(),rA=hi(),Be={symbol:Symbol("template"),opens:new Array(1e3).join("\0"),closes:new Array(1e3).join(""),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};sA.exports=iA=Be.Template=class{constructor(t,e){if(Hh(typeof t=="string","Template source must be a string"),Hh(!t.includes("\0")&&!t.includes(""),"Template source cannot contain reserved control characters"),this.source=t,this.rendered=t,this._template=null,e){let{functions:n,...r}=e;this._settings=Object.keys(r).length?hq(r):void 0,this._functions=n,this._functions&&(Hh(Object.keys(this._functions).every(i=>typeof i=="string"),"Functions keys must be strings"),Hh(Object.values(this._functions).every(i=>typeof i=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;let t=Be.encode(this.source),e=Be.split(t),n=!1,r=[],i=e.shift();i&&r.push(i);for(let s of e){let o=s[0]!=="{",a=o?"}":"}}",u=s.indexOf(a);if(u===-1||s[1]==="{"){r.push(`{${Be.decode(s)}`);continue}let c=s.slice(o?0:1,u),l=c[0]===":";l&&(c=c.slice(1));let h=this._ref(Be.decode(c),{raw:o,wrapped:l});r.push(h),typeof h!="string"&&(n=!0);let d=s.slice(u+a.length);d&&r.push(Be.decode(d))}if(!n){this.rendered=r.join("");return}this._template=r}static date(t,e){return Be.dateFormat[e.dateFormat].call(t)}describe(t={}){if(!this._settings&&t.compact)return this.source;let e={template:this.source};return this._settings&&(e.options=this._settings),this._functions&&(e.functions=this._functions),e}static build(t){return new Be.Template(t.template,t.options||t.functions?{...t.options,functions:t.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(t){return t?!!t[nA.symbols.template]:!1}refs(){if(!this._template)return;let t=[];for(let e of this._template)typeof e!="string"&&t.push(...e.refs);return t}resolve(t,e,n,r){return this._template&&this._template.length===1?this._part(this._template[0],t,e,n,r,{}):this.render(t,e,n,r)}_part(t,...e){return t.ref?t.ref.resolve(...e):t.formula.evaluate(e)}render(t,e,n,r,i={}){if(!this.isDynamic())return this.rendered;let s=[];for(let o of this._template)if(typeof o=="string")s.push(o);else{let a=this._part(o,t,e,n,r,i),u=Be.stringify(a,t,e,n,r,i);if(u!==void 0){let c=o.raw||(i.errors&&i.errors.escapeHtml)===!1?u:dq(u);s.push(Be.wrap(c,o.wrapped&&n.errors.wrap.label))}}return s.join("")}_ref(t,{raw:e,wrapped:n}){let r=[],i=o=>{let a=rA.create(o,this._settings);return r.push(a),u=>{let c=a.resolve(...u);return c!==void 0?c:null}};try{let o=this._functions?{...Be.functions,...this._functions}:Be.functions;var s=new fq.Parser(t,{reference:i,functions:o,constants:Be.constants})}catch(o){throw o.message=`Invalid template variable "${t}" fails due to: ${o.message}`,o}if(s.single){if(s.single.type==="reference"){let o=r[0];return{ref:o,raw:e,refs:r,wrapped:n||o.type==="local"&&o.key==="label"}}return Be.stringify(s.single.value)}return{formula:s,raw:e,refs:r}}toString(){return this.source}};Be.Template.prototype[nA.symbols.template]=!0;Be.Template.prototype.isImmutable=!0;Be.encode=function(t){return t.replace(/\\(\{+)/g,(e,n)=>Be.opens.slice(0,n.length)).replace(/\\(\}+)/g,(e,n)=>Be.closes.slice(0,n.length))};Be.decode=function(t){return t.replace(/\u0000/g,"{").replace(/\u0001/g,"}")};Be.split=function(t){let e=[],n="";for(let r=0;r<t.length;++r){let i=t[r];if(i==="{"){let s="";for(;r+1<t.length&&t[r+1]==="{";)s+="{",++r;e.push(n),n=s}else n+=i}return e.push(n),e};Be.wrap=function(t,e){return e?e.length===1?`${e}${t}${e}`:`${e[0]}${t}${e[1]}`:t};Be.stringify=function(t,e,n,r,i,s={}){let o=typeof t,a=r&&r.errors&&r.errors.wrap||{},u=!1;if(rA.isRef(t)&&t.render&&(u=t.in,t=t.resolve(e,n,r,i,{in:t.in,...s})),t===null)return"null";if(o==="string")return Be.wrap(t,s.arrayItems&&a.string);if(o==="number"||o==="function"||o==="symbol")return t.toString();if(o!=="object")return JSON.stringify(t);if(t instanceof Date)return Be.Template.date(t,r);if(t instanceof Map){let l=[];for(let[h,d]of t.entries())l.push(`${h.toString()} -> ${d.toString()}`);t=l}if(!Array.isArray(t))return t.toString();let c=[];for(let l of t)c.push(Be.stringify(l,e,n,r,i,{arrayItems:!0,...s}));return Be.wrap(c.join(", "),!u&&a.array)};Be.constants={true:!0,false:!1,null:null,second:1e3,minute:60*1e3,hour:60*60*1e3,day:24*60*60*1e3};Be.functions={if(t,e,n){return t?e:n},length(t){return typeof t=="string"?t.length:!t||typeof t!="object"?null:Array.isArray(t)?t.length:Object.keys(t).length},msg(t){let[e,n,r,i,s]=this,o=s.messages;if(!o)return"";let a=tA.template(e,o[0],t,n,r)||tA.template(e,o[1],t,n,r);return a?a.render(e,n,r,i,s):""},number(t){return typeof t=="number"?t:typeof t=="string"?parseFloat(t):typeof t=="boolean"?t?1:0:t instanceof Date?t.getTime():null}}});var qo=m(mu=>{"use strict";var As=Le(),oA=dn(),Ln=Vi();mu.compile=function(t,e){if(typeof t=="string")return As(!e,"Cannot set single message string"),new Ln(t);if(Ln.isTemplate(t))return As(!e,"Cannot set single message template"),t;As(typeof t=="object"&&!Array.isArray(t),"Invalid message options"),e=e?oA(e):{};for(let n in t){let r=t[n];if(n==="root"||Ln.isTemplate(r)){e[n]=r;continue}if(typeof r=="string"){e[n]=new Ln(r);continue}As(typeof r=="object"&&!Array.isArray(r),"Invalid message for",n);let i=n;e[i]=e[i]||{};for(n in r){let s=r[n];if(n==="root"||Ln.isTemplate(s)){e[i][n]=s;continue}As(typeof s=="string","Invalid message for",n,"in",i),e[i][n]=new Ln(s)}}return e};mu.decompile=function(t){let e={};for(let n in t){let r=t[n];if(n==="root"){e.root=r;continue}if(Ln.isTemplate(r)){e[n]=r.describe({compact:!0});continue}let i=n;e[i]={};for(n in r){let s=r[n];if(n==="root"){e[i].root=s;continue}e[i][n]=s.describe({compact:!0})}}return e};mu.merge=function(t,e){if(!t)return mu.compile(e);if(!e)return t;if(typeof e=="string")return new Ln(e);if(Ln.isTemplate(e))return e;let n=oA(t);for(let r in e){let i=e[r];if(r==="root"||Ln.isTemplate(i)){n[r]=i;continue}if(typeof i=="string"){n[r]=new Ln(i);continue}As(typeof i=="object"&&!Array.isArray(i),"Invalid message for",r);let s=r;n[s]=n[s]||{};for(r in i){let o=i[r];if(r==="root"||Ln.isTemplate(o)){n[s][r]=o;continue}As(typeof o=="string","Invalid message for",r,"in",s),n[s][r]=new Ln(o)}}return n}});var Ze=m(et=>{"use strict";var Gh=Le(),pq=Db(),gq=Xk(),qb,jb,mq={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};et.version=gq.version;et.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1};et.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")};et.assertOptions=function(t,e,n="Options"){Gh(t&&typeof t=="object"&&!Array.isArray(t),"Options must be of type object");let r=Object.keys(t).filter(i=>!e.includes(i));Gh(r.length===0,`${n} contain unknown keys: ${r}`)};et.checkPreferences=function(t){jb=jb||Wh();let e=jb.preferences.validate(t);if(e.error)throw new pq([e.error.details[0].message])};et.compare=function(t,e,n){switch(n){case"=":return t===e;case">":return t>e;case"<":return t<e;case">=":return t>=e;case"<=":return t<=e}};et.default=function(t,e){return t===void 0?e:t};et.isIsoDate=function(t){return mq.isoDate.test(t)};et.isNumber=function(t){return typeof t=="number"&&!isNaN(t)};et.isResolvable=function(t){return t?t[et.symbols.ref]||t[et.symbols.template]:!1};et.isSchema=function(t,e={}){let n=t&&t[et.symbols.any];return n?(Gh(e.legacy||n.version===et.version,"Cannot mix different versions of joi schemas"),!0):!1};et.isValues=function(t){return t[et.symbols.values]};et.limit=function(t){return Number.isSafeInteger(t)&&t>=0};et.preferences=function(t,e){qb=qb||qo(),t=t||{},e=e||{};let n=Object.assign({},t,e);return e.errors&&t.errors&&(n.errors=Object.assign({},t.errors,e.errors),n.errors.wrap=Object.assign({},t.errors.wrap,e.errors.wrap)),e.messages&&(n.messages=qb.compile(e.messages,t.messages)),delete n[et.symbols.prefs],n};et.tryWithPath=function(t,e,n={}){try{return t()}catch(r){throw r.path!==void 0?r.path=e+"."+r.path:r.path=e,n.append&&(r.message=`${r.message} (${r.path})`),r}};et.validateArg=function(t,e,{assert:n,message:r}){if(et.isSchema(n)){let i=n.validate(t);return i.error?i.error.message:void 0}else if(!n(t))return e?`${e} ${r}`:r};et.verifyFlat=function(t,e){for(let n of t)Gh(!Array.isArray(n),"Method no longer accepts array arguments:",e)}});var Fb=m(aA=>{"use strict";var yq=Le(),bq=dn(),_q=Ze(),jo={max:1e3,supported:new Set(["undefined","boolean","number","string"])};aA.provider={provision(t){return new jo.Cache(t)}};jo.Cache=class{constructor(t={}){_q.assertOptions(t,["max"]),yq(t.max===void 0||t.max&&t.max>0&&isFinite(t.max),"Invalid max cache size"),this._max=t.max||jo.max,this._map=new Map,this._list=new jo.List}get length(){return this._map.size}set(t,e){if(t!==null&&!jo.supported.has(typeof t))return;let n=this._map.get(t);if(n){n.value=e,this._list.first(n);return}n=this._list.unshift({key:t,value:e}),this._map.set(t,n),this._compact()}get(t){let e=this._map.get(t);if(e)return this._list.first(e),bq(e.value)}_compact(){if(this._map.size>this._max){let t=this._list.pop();this._map.delete(t.key)}}};jo.List=class{constructor(){this.tail=null,this.head=null}unshift(t){return t.next=null,t.prev=this.head,this.head&&(this.head.next=t),this.head=t,this.tail||(this.tail=t),t}first(t){t!==this.head&&(this._remove(t),this.unshift(t))}pop(){return this._remove(this.tail)}_remove(t){let{next:e,prev:n}=t;return e.prev=n,n&&(n.next=e),t===this.tail&&(this.tail=e),t.prev=null,t.next=null,t}}});var Cs=m(di=>{"use strict";var mt=Le(),Nn=Ze(),Fo=hi(),er={};di.schema=function(t,e,n={}){Nn.assertOptions(n,["appendPath","override"]);try{return er.schema(t,e,n)}catch(r){throw n.appendPath&&r.path!==void 0&&(r.message=`${r.message} (${r.path})`),r}};er.schema=function(t,e,n){mt(e!==void 0,"Invalid undefined schema"),Array.isArray(e)&&(mt(e.length,"Invalid empty array schema"),e.length===1&&(e=e[0]));let r=(i,...s)=>n.override!==!1?i.valid(t.override,...s):i.valid(...s);if(er.simple(e))return r(t,e);if(typeof e=="function")return t.custom(e);if(mt(typeof e=="object","Invalid schema content:",typeof e),Nn.isResolvable(e))return r(t,e);if(Nn.isSchema(e))return e;if(Array.isArray(e)){for(let i of e)if(!er.simple(i))return t.alternatives().try(...e);return r(t,...e)}return e instanceof RegExp?t.string().regex(e):e instanceof Date?r(t.date(),e):(mt(Object.getPrototypeOf(e)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),t.object().keys(e))};di.ref=function(t,e){return Fo.isRef(t)?t:Fo.create(t,e)};di.compile=function(t,e,n={}){Nn.assertOptions(n,["legacy"]);let r=e&&e[Nn.symbols.any];if(r)return mt(n.legacy||r.version===Nn.version,"Cannot mix different versions of joi schemas:",r.version,Nn.version),e;if(typeof e!="object"||!n.legacy)return di.schema(t,e,{appendPath:!0});let i=er.walk(e);return i?i.compile(i.root,e):di.schema(t,e,{appendPath:!0})};er.walk=function(t){if(typeof t!="object")return null;if(Array.isArray(t)){for(let n of t){let r=er.walk(n);if(r)return r}return null}let e=t[Nn.symbols.any];if(e)return{root:t[e.root],compile:e.compile};mt(Object.getPrototypeOf(t)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(let n in t){let r=er.walk(t[n]);if(r)return r}return null};er.simple=function(t){return t===null||["boolean","string","number"].includes(typeof t)};di.when=function(t,e,n){if(n===void 0&&(mt(e&&typeof e=="object","Missing options"),n=e,e=Fo.create(".")),Array.isArray(n)&&(n={switch:n}),Nn.assertOptions(n,["is","not","then","otherwise","switch","break"]),Nn.isSchema(e))return mt(n.is===void 0,'"is" can not be used with a schema condition'),mt(n.not===void 0,'"not" can not be used with a schema condition'),mt(n.switch===void 0,'"switch" can not be used with a schema condition'),er.condition(t,{is:e,then:n.then,otherwise:n.otherwise,break:n.break});if(mt(Fo.isRef(e)||typeof e=="string","Invalid condition:",e),mt(n.not===void 0||n.is===void 0,'Cannot combine "is" with "not"'),n.switch===void 0){let i=n;n.not!==void 0&&(i={is:n.not,then:n.otherwise,otherwise:n.then,break:n.break});let s=i.is!==void 0?t.$_compile(i.is):t.$_root.invalid(null,!1,0,"").required();return mt(i.then!==void 0||i.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),mt(i.break===void 0||i.then===void 0||i.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),n.is!==void 0&&!Fo.isRef(n.is)&&!Nn.isSchema(n.is)&&(s=s.required()),er.condition(t,{ref:di.ref(e),is:s,then:i.then,otherwise:i.otherwise,break:i.break})}mt(Array.isArray(n.switch),'"switch" must be an array'),mt(n.is===void 0,'Cannot combine "switch" with "is"'),mt(n.not===void 0,'Cannot combine "switch" with "not"'),mt(n.then===void 0,'Cannot combine "switch" with "then"');let r={ref:di.ref(e),switch:[],break:n.break};for(let i=0;i<n.switch.length;++i){let s=n.switch[i],o=i===n.switch.length-1;Nn.assertOptions(s,o?["is","then","otherwise"]:["is","then"]),mt(s.is!==void 0,'Switch statement missing "is"'),mt(s.then!==void 0,'Switch statement missing "then"');let a={is:t.$_compile(s.is),then:t.$_compile(s.then)};if(!Fo.isRef(s.is)&&!Nn.isSchema(s.is)&&(a.is=a.is.required()),o){mt(n.otherwise===void 0||s.otherwise===void 0,'Cannot specify "otherwise" inside and outside a "switch"');let u=n.otherwise!==void 0?n.otherwise:s.otherwise;u!==void 0&&(mt(r.break===void 0,"Cannot specify both otherwise and break"),a.otherwise=t.$_compile(u))}r.switch.push(a)}return r};er.condition=function(t,e){for(let n of["then","otherwise"])e[n]===void 0?delete e[n]:e[n]=t.$_compile(e[n]);return e}});var $b=m(cA=>{"use strict";var Xi=Le(),vq=dn(),uA=Ze(),Sq=qo(),Br={};cA.type=function(t,e){let n=Object.getPrototypeOf(t),r=vq(n),i=t._assign(Object.create(r)),s=Object.assign({},e);delete s.base,r._definition=s;let o=n._definition||{};s.messages=Sq.merge(o.messages,s.messages),s.properties=Object.assign({},o.properties,s.properties),i.type=s.type,s.flags=Object.assign({},o.flags,s.flags);let a=Object.assign({},o.terms);if(s.terms)for(let h in s.terms){let d=s.terms[h];Xi(i.$_terms[h]===void 0,"Invalid term override for",s.type,h),i.$_terms[h]=d.init,a[h]=d}s.terms=a,s.args||(s.args=o.args),s.prepare=Br.prepare(s.prepare,o.prepare),s.coerce&&(typeof s.coerce=="function"&&(s.coerce={method:s.coerce}),s.coerce.from&&!Array.isArray(s.coerce.from)&&(s.coerce={method:s.coerce.method,from:[].concat(s.coerce.from)})),s.coerce=Br.coerce(s.coerce,o.coerce),s.validate=Br.validate(s.validate,o.validate);let u=Object.assign({},o.rules);if(s.rules)for(let h in s.rules){let d=s.rules[h];Xi(typeof d=="object","Invalid rule definition for",s.type,h);let g=d.method;if(g===void 0&&(g=function(){return this.$_addRule(h)}),g&&(Xi(!r[h],"Rule conflict in",s.type,h),r[h]=g),Xi(!u[h],"Rule conflict in",s.type,h),u[h]=d,d.alias){let y=[].concat(d.alias);for(let _ of y)r[_]=d.method}d.args&&(d.argsByName=new Map,d.args=d.args.map(y=>(typeof y=="string"&&(y={name:y}),Xi(!d.argsByName.has(y.name),"Duplicated argument name",y.name),uA.isSchema(y.assert)&&(y.assert=y.assert.strict().label(y.name)),d.argsByName.set(y.name,y),y)))}s.rules=u;let c=Object.assign({},o.modifiers);if(s.modifiers)for(let h in s.modifiers){Xi(!r[h],"Rule conflict in",s.type,h);let d=s.modifiers[h];Xi(typeof d=="function","Invalid modifier definition for",s.type,h);let g=function(y){return this.rule({[h]:y})};r[h]=g,c[h]=d}if(s.modifiers=c,s.overrides){r._super=n,i.$_super={};for(let h in s.overrides)Xi(n[h],"Cannot override missing",h),s.overrides[h][uA.symbols.parent]=n[h],i.$_super[h]=n[h].bind(i);Object.assign(r,s.overrides)}s.cast=Object.assign({},o.cast,s.cast);let l=Object.assign({},o.manifest,s.manifest);return l.build=Br.build(s.manifest&&s.manifest.build,o.manifest&&o.manifest.build),s.manifest=l,s.rebuild=Br.rebuild(s.rebuild,o.rebuild),i};Br.build=function(t,e){return!t||!e?t||e:function(n,r){return e(t(n,r),r)}};Br.coerce=function(t,e){return!t||!e?t||e:{from:t.from&&e.from?[...new Set([...t.from,...e.from])]:null,method(n,r){let i;if((!e.from||e.from.includes(typeof n))&&(i=e.method(n,r),i)){if(i.errors||i.value===void 0)return i;n=i.value}if(!t.from||t.from.includes(typeof n)){let s=t.method(n,r);if(s)return s}return i}}};Br.prepare=function(t,e){return!t||!e?t||e:function(n,r){let i=t(n,r);if(i){if(i.errors||i.value===void 0)return i;n=i.value}return e(n,r)||i}};Br.rebuild=function(t,e){return!t||!e?t||e:function(n){e(n),t(n)}};Br.validate=function(t,e){return!t||!e?t||e:function(n,r){let i=e(n,r);if(i){if(i.errors&&(!Array.isArray(i.errors)||i.errors.length))return i;n=i.value}return t(n,r)||i}}});var Ub=m(Wb=>{"use strict";var Wr=Le(),zh=dn(),Os=Ze(),wq=qo(),lA=hi(),Tq=Vi(),Bb,fn={};Wb.describe=function(t){let e=t._definition,n={type:t.type,flags:{},rules:[]};for(let r in t._flags)r[0]!=="_"&&(n.flags[r]=fn.describe(t._flags[r]));Object.keys(n.flags).length||delete n.flags,t._preferences&&(n.preferences=zh(t._preferences,{shallow:["messages"]}),delete n.preferences[Os.symbols.prefs],n.preferences.messages&&(n.preferences.messages=wq.decompile(n.preferences.messages))),t._valids&&(n.allow=t._valids.describe()),t._invalids&&(n.invalid=t._invalids.describe());for(let r of t._rules){if(e.rules[r.name].manifest===!1)continue;let s={name:r.name};for(let o in e.modifiers)r[o]!==void 0&&(s[o]=fn.describe(r[o]));if(r.args){s.args={};for(let o in r.args){let a=r.args[o];o==="options"&&!Object.keys(a).length||(s.args[o]=fn.describe(a,{assign:o}))}Object.keys(s.args).length||delete s.args}n.rules.push(s)}n.rules.length||delete n.rules;for(let r in t.$_terms){if(r[0]==="_")continue;Wr(!n[r],"Cannot describe schema due to internal name conflict with",r);let i=t.$_terms[r];if(!i)continue;if(i instanceof Map){i.size&&(n[r]=[...i.entries()]);continue}if(Os.isValues(i)){n[r]=i.describe();continue}Wr(e.terms[r],"Term",r,"missing configuration");let s=e.terms[r].manifest,o=typeof s=="object";if(!i.length&&!o)continue;let a=[];for(let u of i)a.push(fn.describe(u));if(o){let{from:u,to:c}=s.mapped;n[r]={};for(let l of a)n[r][l[c]]=l[u];continue}if(s==="single"){Wr(a.length===1,"Term",r,"contains more than one item"),n[r]=a[0];continue}n[r]=a}return fn.validate(t.$_root,n),n};fn.describe=function(t,e={}){if(Array.isArray(t))return t.map(fn.describe);if(t===Os.symbols.deepDefault)return{special:"deep"};if(typeof t!="object"||t===null)return t;if(e.assign==="options")return zh(t);if(Buffer&&Buffer.isBuffer(t))return{buffer:t.toString("binary")};if(t instanceof Date)return t.toISOString();if(t instanceof Error)return t;if(t instanceof RegExp)return e.assign==="regex"?t.toString():{regex:t.toString()};if(t[Os.symbols.literal])return{function:t.literal};if(typeof t.describe=="function")return e.assign==="ref"?t.describe().ref:t.describe();let n={};for(let r in t){let i=t[r];i!==void 0&&(n[r]=fn.describe(i,{assign:r}))}return n};Wb.build=function(t,e){return new fn.Builder(t).parse(e)};fn.Builder=class{constructor(t){this.joi=t}parse(t){fn.validate(this.joi,t);let e=this.joi[t.type]()._bare(),n=e._definition;if(t.flags)for(let i in t.flags){let s=n.flags[i]&&n.flags[i].setter||i;Wr(typeof e[s]=="function","Invalid flag",i,"for type",t.type),e=e[s](this.build(t.flags[i]))}if(t.preferences&&(e=e.preferences(this.build(t.preferences))),t.allow&&(e=e.allow(...this.build(t.allow))),t.invalid&&(e=e.invalid(...this.build(t.invalid))),t.rules)for(let i of t.rules){Wr(typeof e[i.name]=="function","Invalid rule",i.name,"for type",t.type);let s=[];if(i.args){let a={};for(let l in i.args)a[l]=this.build(i.args[l],{assign:l});let u=Object.keys(a),c=n.rules[i.name].args;if(c){Wr(u.length<=c.length,"Invalid number of arguments for",t.type,i.name,"(expected up to",c.length,", found",u.length,")");for(let{name:l}of c)s.push(a[l])}else Wr(u.length===1,"Invalid number of arguments for",t.type,i.name,"(expected up to 1, found",u.length,")"),s.push(a[u[0]])}e=e[i.name](...s);let o={};for(let a in n.modifiers)i[a]!==void 0&&(o[a]=this.build(i[a]));Object.keys(o).length&&(e=e.rule(o))}let r={};for(let i in t){if(["allow","flags","invalid","whens","preferences","rules","type"].includes(i))continue;Wr(n.terms[i],"Term",i,"missing configuration");let s=n.terms[i].manifest;if(s==="schema"){r[i]=t[i].map(o=>this.parse(o));continue}if(s==="values"){r[i]=t[i].map(o=>this.build(o));continue}if(s==="single"){r[i]=this.build(t[i]);continue}if(typeof s=="object"){r[i]={};for(let o in t[i]){let a=t[i][o];r[i][o]=this.parse(a)}continue}r[i]=this.build(t[i])}return t.whens&&(r.whens=t.whens.map(i=>this.build(i))),e=n.manifest.build(e,r),e.$_temp.ruleset=!1,e}build(t,e={}){if(t===null)return null;if(Array.isArray(t))return t.map(r=>this.build(r));if(t instanceof Error)return t;if(e.assign==="options")return zh(t);if(e.assign==="regex")return fn.regex(t);if(e.assign==="ref")return lA.build(t);if(typeof t!="object")return t;if(Object.keys(t).length===1){if(t.buffer)return Wr(Buffer,"Buffers are not supported"),Buffer&&Buffer.from(t.buffer,"binary");if(t.function)return{[Os.symbols.literal]:!0,literal:t.function};if(t.override)return Os.symbols.override;if(t.ref)return lA.build(t.ref);if(t.regex)return fn.regex(t.regex);if(t.special)return Wr(["deep"].includes(t.special),"Unknown special value",t.special),Os.symbols.deepDefault;if(t.value)return zh(t.value)}if(t.type)return this.parse(t);if(t.template)return Tq.build(t);let n={};for(let r in t)n[r]=this.build(t[r],{assign:r});return n}};fn.regex=function(t){let e=t.lastIndexOf("/"),n=t.slice(1,e),r=t.slice(e+1);return new RegExp(n,r)};fn.validate=function(t,e){Bb=Bb||Wh(),t.assert(e,Bb.description)}});var yu=m((Z4,hA)=>{"use strict";var Ur=Mb(),sn={mismatched:null};hA.exports=function(t,e,n){return n=Object.assign({prototype:!0},n),!!sn.isDeepEqual(t,e,n,[])};sn.isDeepEqual=function(t,e,n,r){if(t===e)return t!==0||1/t===1/e;let i=typeof t;if(i!==typeof e||t===null||e===null)return!1;if(i==="function"){if(!n.deepFunction||t.toString()!==e.toString())return!1}else if(i!=="object")return t!==t&&e!==e;let s=sn.getSharedType(t,e,!!n.prototype);switch(s){case Ur.buffer:return Buffer&&Buffer.prototype.equals.call(t,e);case Ur.promise:return t===e;case Ur.regex:return t.toString()===e.toString();case sn.mismatched:return!1}for(let o=r.length-1;o>=0;--o)if(r[o].isSame(t,e))return!0;r.push(new sn.SeenEntry(t,e));try{return!!sn.isDeepEqualObj(s,t,e,n,r)}finally{r.pop()}};sn.getSharedType=function(t,e,n){if(n)return Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?sn.mismatched:Ur.getInternalProto(t);let r=Ur.getInternalProto(t);return r!==Ur.getInternalProto(e)?sn.mismatched:r};sn.valueOf=function(t){let e=t.valueOf;if(e===void 0)return t;try{return e.call(t)}catch(n){return n}};sn.hasOwnEnumerableProperty=function(t,e){return Object.prototype.propertyIsEnumerable.call(t,e)};sn.isSetSimpleEqual=function(t,e){for(let n of Set.prototype.values.call(t))if(!Set.prototype.has.call(e,n))return!1;return!0};sn.isDeepEqualObj=function(t,e,n,r,i){let{isDeepEqual:s,valueOf:o,hasOwnEnumerableProperty:a}=sn,{keys:u,getOwnPropertySymbols:c}=Object;if(t===Ur.array)if(r.part){for(let y of e)for(let _ of n)if(s(y,_,r,i))return!0}else{if(e.length!==n.length)return!1;for(let y=0;y<e.length;++y)if(!s(e[y],n[y],r,i))return!1;return!0}else if(t===Ur.set){if(e.size!==n.size)return!1;if(!sn.isSetSimpleEqual(e,n)){let y=new Set(Set.prototype.values.call(n));for(let _ of Set.prototype.values.call(e)){if(y.delete(_))continue;let C=!1;for(let k of y)if(s(_,k,r,i)){y.delete(k),C=!0;break}if(!C)return!1}}}else if(t===Ur.map){if(e.size!==n.size)return!1;for(let[y,_]of Map.prototype.entries.call(e))if(_===void 0&&!Map.prototype.has.call(n,y)||!s(_,Map.prototype.get.call(n,y),r,i))return!1}else if(t===Ur.error&&(e.name!==n.name||e.message!==n.message))return!1;let l=o(e),h=o(n);if((e!==l||n!==h)&&!s(l,h,r,i))return!1;let d=u(e);if(!r.part&&d.length!==u(n).length&&!r.skip)return!1;let g=0;for(let y of d){if(r.skip&&r.skip.includes(y)){n[y]===void 0&&++g;continue}if(!a(n,y)||!s(e[y],n[y],r,i))return!1}if(!r.part&&d.length-g!==u(n).length)return!1;if(r.symbols!==!1){let y=c(e),_=new Set(c(n));for(let C of y){if(!r.skip||!r.skip.includes(C)){if(a(e,C)){if(!a(n,C)||!s(e[C],n[C],r,i))return!1}else if(a(n,C))return!1}_.delete(C)}for(let C of _)if(a(n,C))return!1}return!0};sn.SeenEntry=class{constructor(t,e){this.obj=t,this.ref=e}isSame(t,e){return this.obj===t&&this.ref===e}}});var fA=m(dA=>{"use strict";dA.location=function(t=0){let e=Error.prepareStackTrace;Error.prepareStackTrace=(i,s)=>s;let n={};Error.captureStackTrace(n,this);let r=n.stack[t+1];return Error.prepareStackTrace=e,{filename:r.getFileName(),line:r.getLineNumber()}}});var Gb=m(Hb=>{"use strict";var pA=yu(),gA=fA(),Eq=li(),on={codes:{error:1,pass:2,full:3},labels:{0:"never used",1:"always error",2:"always pass"}};Hb.setup=function(t){let e=function(){return t._tracer=t._tracer||new on.Tracer,t._tracer};t.trace=e,t[Symbol.for("@hapi/lab/coverage/initialize")]=e,t.untrace=()=>{t._tracer=null}};Hb.location=function(t){return t.$_setFlag("_tracerLocation",gA.location(2))};on.Tracer=class{constructor(){this.name="Joi",this._schemas=new Map}_register(t){let e=this._schemas.get(t);if(e)return e.store;let n=new on.Store(t),{filename:r,line:i}=t._flags._tracerLocation||gA.location(5);return this._schemas.set(t,{filename:r,line:i,store:n}),n}_combine(t,e){for(let{store:n}of this._schemas.values())n._combine(t,e)}report(t){let e=[];for(let{filename:n,line:r,store:i}of this._schemas.values()){if(t&&t!==n)continue;let s=[],o=[];for(let[a,u]of i._sources.entries()){if(on.sub(u.paths,o))continue;if(!u.entry){s.push({status:"never reached",paths:[...u.paths]}),o.push(...u.paths);continue}for(let l of["valid","invalid"]){let h=a[`_${l}s`];if(!h)continue;let d=new Set(h._values),g=new Set(h._refs);for(let{value:y,ref:_}of u[l])d.delete(y),g.delete(_);(d.size||g.size)&&s.push({status:[...d,...[...g].map(y=>y.display)],rule:`${l}s`})}let c=a._rules.map(l=>l.name);for(let l of["default","failover"])a._flags[l]!==void 0&&c.push(l);for(let l of c){let h=on.labels[u.rule[l]||0];if(h){let d={rule:l,status:h};u.paths.size&&(d.paths=[...u.paths]),s.push(d)}}}s.length&&e.push({filename:n,line:r,missing:s,severity:"error",message:`Schema missing tests for ${s.map(on.message).join(", ")}`})}return e.length?e:null}};on.Store=class{constructor(t){this.active=!0,this._sources=new Map,this._combos=new Map,this._scan(t)}debug(t,e,n,r){t.mainstay.debug&&t.mainstay.debug.push({type:e,name:n,result:r,path:t.path})}entry(t,e){on.debug(e,{type:"entry"}),this._record(t,n=>{n.entry=!0})}filter(t,e,n,r){on.debug(e,{type:n,...r}),this._record(t,i=>{i[n].add(r)})}log(t,e,n,r,i){on.debug(e,{type:n,name:r,result:i==="full"?"pass":i}),this._record(t,s=>{s[n][r]=s[n][r]||0,s[n][r]|=on.codes[i]})}resolve(t,e,n){if(!t.mainstay.debug)return;let r={type:"resolve",ref:e.display,to:n,path:t.path};t.mainstay.debug.push(r)}value(t,e,n,r,i){if(!t.mainstay.debug||pA(n,r))return;let s={type:"value",by:e,from:n,to:r,path:t.path};i&&(s.name=i),t.mainstay.debug.push(s)}_record(t,e){let n=this._sources.get(t);if(n){e(n);return}let r=this._combos.get(t);for(let i of r)this._record(i,e)}_scan(t,e){let n=e||[],r=this._sources.get(t);r||(r={paths:new Set,entry:!1,rule:{},valid:new Set,invalid:new Set},this._sources.set(t,r)),n.length&&r.paths.add(n);let i=(s,o)=>{let a=on.id(s,o);this._scan(s,n.concat(a))};t.$_modify({each:i,ref:!1})}_combine(t,e){this._combos.set(t,e)}};on.message=function(t){return`${t.paths?Eq.path(t.paths[0])+(t.rule?":":""):""}${t.rule||""} (${t.status})`};on.id=function(t,{source:e,name:n,path:r,key:i}){return t._flags.id?t._flags.id:i||(n=`@${n}`,e==="terms"?[n,r[Math.min(r.length-1,1)]]:n)};on.sub=function(t,e){for(let n of t)for(let r of e)if(pA(n.slice(0,r.length),r))return!0;return!1};on.debug=function(t,e){t.mainstay.debug&&(e.path=t.debug?[...t.path,t.debug]:t.path,t.mainstay.debug.push(e))}});var Kh=m((sz,bA)=>{"use strict";var zb=Le(),mA=dn(),xq=Lb(),yA={};bA.exports=yA.merge=function(t,e,n){if(zb(t&&typeof t=="object","Invalid target value: must be an object"),zb(e==null||typeof e=="object","Invalid source value: must be null, undefined, or an object"),!e)return t;if(n=Object.assign({nullOverride:!0,mergeArrays:!0},n),Array.isArray(e)){zb(Array.isArray(t),"Cannot merge array onto an object"),n.mergeArrays||(t.length=0);for(let i=0;i<e.length;++i)t.push(mA(e[i],{symbols:n.symbols}));return t}let r=xq.keys(e,n);for(let i=0;i<r.length;++i){let s=r[i];if(s==="__proto__"||!Object.prototype.propertyIsEnumerable.call(e,s))continue;let o=e[s];if(o&&typeof o=="object"){if(t[s]===o)continue;!t[s]||typeof t[s]!="object"||Array.isArray(t[s])!==Array.isArray(o)||o instanceof Date||Buffer&&Buffer.isBuffer(o)||o instanceof RegExp?t[s]=mA(o,{symbols:n.symbols}):yA.merge(t[s],o,n)}else(o!=null||n.nullOverride)&&(t[s]=o)}return t}});var _A=m(Vh=>{"use strict";var fi=Le(),Kb=Ze(),kq=hi(),Hr={};Vh.Ids=Hr.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){let t=new Hr.Ids;return t._byId=new Map(this._byId),t._byKey=new Map(this._byKey),t._schemaChain=this._schemaChain,t}concat(t){t._schemaChain&&(this._schemaChain=!0);for(let[e,n]of t._byId.entries())fi(!this._byKey.has(e),"Schema id conflicts with existing key:",e),this._byId.set(e,n);for(let[e,n]of t._byKey.entries())fi(!this._byId.has(e),"Schema key conflicts with existing id:",e),this._byKey.set(e,n)}fork(t,e,n){let r=this._collect(t);r.push({schema:n});let i=r.shift(),s={id:i.id,schema:e(i.schema)};fi(Kb.isSchema(s.schema),"adjuster function failed to return a joi schema type");for(let o of r)s={id:o.id,schema:Hr.fork(o.schema,s.id,s.schema)};return s.schema}labels(t,e=[]){let n=t[0],r=this._get(n);if(!r)return[...e,...t].join(".");let i=t.slice(1);return e=[...e,r.schema._flags.label||n],i.length?r.schema._ids.labels(i,e):e.join(".")}reach(t,e=[]){let n=t[0],r=this._get(n);fi(r,"Schema does not contain path",[...e,...t].join("."));let i=t.slice(1);return i.length?r.schema._ids.reach(i,[...e,n]):r.schema}register(t,{key:e}={}){if(!t||!Kb.isSchema(t))return;(t.$_property("schemaChain")||t._ids._schemaChain)&&(this._schemaChain=!0);let n=t._flags.id;if(n){let r=this._byId.get(n);fi(!r||r.schema===t,"Cannot add different schemas with the same id:",n),fi(!this._byKey.has(n),"Schema id conflicts with existing key:",n),this._byId.set(n,{schema:t,id:n})}e&&(fi(!this._byKey.has(e),"Schema already contains key:",e),fi(!this._byId.has(e),"Schema key conflicts with existing id:",e),this._byKey.set(e,{schema:t,id:e}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(t,e=[],n=[]){let r=t[0],i=this._get(r);fi(i,"Schema does not contain path",[...e,...t].join(".")),n=[i,...n];let s=t.slice(1);return s.length?i.schema._ids._collect(s,[...e,r],n):n}_get(t){return this._byId.get(t)||this._byKey.get(t)}};Hr.fork=function(t,e,n){let r=(s,{key:o})=>{if(e===(s._flags.id||o))return n},i=Vh.schema(t,{each:r,ref:!1});return i?i.$_mutateRebuild():t};Vh.schema=function(t,e){let n;for(let r in t._flags){if(r[0]==="_")continue;let i=Hr.scan(t._flags[r],{source:"flags",name:r},e);i!==void 0&&(n=n||t.clone(),n._flags[r]=i)}for(let r=0;r<t._rules.length;++r){let i=t._rules[r],s=Hr.scan(i.args,{source:"rules",name:i.name},e);if(s!==void 0){n=n||t.clone();let o=Object.assign({},i);o.args=s,n._rules[r]=o,n._singleRules.get(i.name)===i&&n._singleRules.set(i.name,o)}}for(let r in t.$_terms){if(r[0]==="_")continue;let i=Hr.scan(t.$_terms[r],{source:"terms",name:r},e);i!==void 0&&(n=n||t.clone(),n.$_terms[r]=i)}return n};Hr.scan=function(t,e,n,r,i){let s=r||[];if(t===null||typeof t!="object")return;let o;if(Array.isArray(t)){for(let a=0;a<t.length;++a){let u=e.source==="terms"&&e.name==="keys"&&t[a].key,c=Hr.scan(t[a],e,n,[a,...s],u);c!==void 0&&(o=o||t.slice(),o[a]=c)}return o}if(n.schema!==!1&&Kb.isSchema(t)||n.ref!==!1&&kq.isRef(t)){let a=n.each(t,{...e,path:s,key:i});return a===t?void 0:a}for(let a in t){if(a[0]==="_")continue;let u=Hr.scan(t[a],e,n,[a,...s],i);u!==void 0&&(o=o||Object.assign({},t),o[a]=u)}return o}});var SA=m((uz,vA)=>{"use strict";vA.exports=function(){}});var EA=m((cz,TA)=>{"use strict";var Aq=dn(),wA=xs(),Cq=Ze(),Gr={value:Symbol("value")};TA.exports=Gr.State=class{constructor(t,e,n){this.path=t,this.ancestors=e,this.mainstay=n.mainstay,this.schemas=n.schemas,this.debug=null}localize(t,e=null,n=null){let r=new Gr.State(t,e,this);return n&&r.schemas&&(r.schemas=[Gr.schemas(n),...r.schemas]),r}nest(t,e){let n=new Gr.State(this.path,this.ancestors,this);return n.schemas=n.schemas&&[Gr.schemas(t),...n.schemas],n.debug=e,n}shadow(t,e){this.mainstay.shadow=this.mainstay.shadow||new Gr.Shadow,this.mainstay.shadow.set(this.path,t,e)}snapshot(){this.mainstay.shadow&&(this._snapshot=Aq(this.mainstay.shadow.node(this.path))),this.mainstay.snapshot()}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.restore()}commit(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.commit()}};Gr.schemas=function(t){return Cq.isSchema(t)?{schema:t}:t};Gr.Shadow=class{constructor(){this._values=null}set(t,e,n){if(!t.length||n==="strip"&&typeof t[t.length-1]=="number")return;this._values=this._values||new Map;let r=this._values;for(let i=0;i<t.length;++i){let s=t[i],o=r.get(s);o||(o=new Map,r.set(s,o)),r=o}r[Gr.value]=e}get(t){let e=this.node(t);if(e)return e[Gr.value]}node(t){if(this._values)return wA(this._values,t,{iterables:!0})}override(t,e){if(!this._values)return;let n=t.slice(0,-1),r=t[t.length-1],i=wA(this._values,n,{iterables:!0});if(e){i.set(r,e);return}i&&i.delete(r)}}});var kA=m(_u=>{"use strict";var bu=Le(),xA=dn(),$o=SA(),Oq=xs(),It=Ze(),Yi=li(),Rq=EA(),ve={result:Symbol("result")};_u.entry=function(t,e,n){let r=It.defaults;n&&(bu(n.warnings===void 0,"Cannot override warnings preference in synchronous validation"),bu(n.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),r=It.preferences(It.defaults,n));let i=ve.entry(t,e,r);bu(!i.mainstay.externals.length,"Schema with external rules must use validateAsync()");let s={value:i.value};return i.error&&(s.error=i.error),i.mainstay.warnings.length&&(s.warning=Yi.details(i.mainstay.warnings)),i.mainstay.debug&&(s.debug=i.mainstay.debug),i.mainstay.artifacts&&(s.artifacts=i.mainstay.artifacts),s};_u.entryAsync=async function(t,e,n){let r=It.defaults;n&&(r=It.preferences(It.defaults,n));let i=ve.entry(t,e,r),s=i.mainstay;if(i.error)throw s.debug&&(i.error.debug=s.debug),i.error;if(s.externals.length){let a=i.value,u=[];for(let c of s.externals){let l=c.state.path,h=c.schema.type==="link"?s.links.get(c.schema):null,d=a,g,y,_=l.length?[a]:[],C=l.length?Oq(t,l):t;if(l.length){g=l[l.length-1];let k=a;for(let T of l.slice(0,-1))k=k[T],_.unshift(k);y=_[0],d=y[g]}try{let k=(w,v)=>(h||c.schema).$_createError(w,d,v,c.state,r),T=await c.method(d,{schema:c.schema,linked:h,state:c.state,prefs:n,original:C,error:k,errorsArray:ve.errorsArray,warn:(w,v)=>s.warnings.push((h||c.schema).$_createError(w,d,v,c.state,r)),message:(w,v)=>(h||c.schema).$_createError("external",d,v,c.state,r,{messages:w})});if(T===void 0||T===d)continue;if(T instanceof Yi.Report){if(s.tracer.log(c.schema,c.state,"rule","external","error"),u.push(T),r.abortEarly)break;continue}if(Array.isArray(T)&&T[It.symbols.errors]){if(s.tracer.log(c.schema,c.state,"rule","external","error"),u.push(...T),r.abortEarly)break;continue}y?(s.tracer.value(c.state,"rule",d,T,"external"),y[g]=T):(s.tracer.value(c.state,"rule",a,T,"external"),a=T)}catch(k){throw r.errors.label&&(k.message+=` (${c.label})`),k}}if(i.value=a,u.length)throw i.error=Yi.process(u,t,r),s.debug&&(i.error.debug=s.debug),i.error}if(!r.warnings&&!r.debug&&!r.artifacts)return i.value;let o={value:i.value};return s.warnings.length&&(o.warning=Yi.details(s.warnings)),s.debug&&(o.debug=s.debug),s.artifacts&&(o.artifacts=s.artifacts),o};ve.Mainstay=class{constructor(t,e,n){this.externals=[],this.warnings=[],this.tracer=t,this.debug=e,this.links=n,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){let t=this._snapshots.pop();this.externals=t.externals,this.warnings=t.warnings}commit(){this._snapshots.pop()}};ve.entry=function(t,e,n){let{tracer:r,cleanup:i}=ve.tracer(e,n),s=n.debug?[]:null,o=e._ids._schemaChain?new Map:null,a=new ve.Mainstay(r,s,o),u=e._ids._schemaChain?[{schema:e}]:null,c=new Rq([],[],{mainstay:a,schemas:u}),l=_u.validate(t,e,c,n);i&&e.$_root.untrace();let h=Yi.process(l.errors,t,n);return{value:l.value,error:h,mainstay:a}};ve.tracer=function(t,e){return t.$_root._tracer?{tracer:t.$_root._tracer._register(t)}:e.debug?(bu(t.$_root.trace,"Debug mode not supported"),{tracer:t.$_root.trace()._register(t),cleanup:!0}):{tracer:ve.ignore}};_u.validate=function(t,e,n,r,i={}){if(e.$_terms.whens&&(e=e._generate(t,n,r).schema),e._preferences&&(r=ve.prefs(e,r)),e._cache&&r.cache){let h=e._cache.get(t);if(n.mainstay.tracer.debug(n,"validate","cached",!!h),h)return h}let s=(h,d,g)=>e.$_createError(h,t,d,g||n,r),o={original:t,prefs:r,schema:e,state:n,error:s,errorsArray:ve.errorsArray,warn:(h,d,g)=>n.mainstay.warnings.push(s(h,d,g)),message:(h,d)=>e.$_createError("custom",t,d,n,r,{messages:h})};n.mainstay.tracer.entry(e,n);let a=e._definition;if(a.prepare&&t!==void 0&&r.convert){let h=a.prepare(t,o);if(h){if(n.mainstay.tracer.value(n,"prepare",t,h.value),h.errors)return ve.finalize(h.value,[].concat(h.errors),o);t=h.value}}if(a.coerce&&t!==void 0&&r.convert&&(!a.coerce.from||a.coerce.from.includes(typeof t))){let h=a.coerce.method(t,o);if(h){if(n.mainstay.tracer.value(n,"coerced",t,h.value),h.errors)return ve.finalize(h.value,[].concat(h.errors),o);t=h.value}}let u=e._flags.empty;u&&u.$_match(ve.trim(t,e),n.nest(u),It.defaults)&&(n.mainstay.tracer.value(n,"empty",t,void 0),t=void 0);let c=i.presence||e._flags.presence||(e._flags._endedSwitch?null:r.presence);if(t===void 0){if(c==="forbidden")return ve.finalize(t,null,o);if(c==="required")return ve.finalize(t,[e.$_createError("any.required",t,null,n,r)],o);if(c==="optional"){if(e._flags.default!==It.symbols.deepDefault)return ve.finalize(t,null,o);n.mainstay.tracer.value(n,"default",t,{}),t={}}}else if(c==="forbidden")return ve.finalize(t,[e.$_createError("any.unknown",t,null,n,r)],o);let l=[];if(e._valids){let h=e._valids.get(t,n,r,e._flags.insensitive);if(h)return r.convert&&(n.mainstay.tracer.value(n,"valids",t,h.value),t=h.value),n.mainstay.tracer.filter(e,n,"valid",h),ve.finalize(t,null,o);if(e._flags.only){let d=e.$_createError("any.only",t,{valids:e._valids.values({display:!0})},n,r);if(r.abortEarly)return ve.finalize(t,[d],o);l.push(d)}}if(e._invalids){let h=e._invalids.get(t,n,r,e._flags.insensitive);if(h){n.mainstay.tracer.filter(e,n,"invalid",h);let d=e.$_createError("any.invalid",t,{invalids:e._invalids.values({display:!0})},n,r);if(r.abortEarly)return ve.finalize(t,[d],o);l.push(d)}}if(a.validate){let h=a.validate(t,o);if(h&&(n.mainstay.tracer.value(n,"base",t,h.value),t=h.value,h.errors)){if(!Array.isArray(h.errors))return l.push(h.errors),ve.finalize(t,l,o);if(h.errors.length)return l.push(...h.errors),ve.finalize(t,l,o)}}return e._rules.length?ve.rules(t,l,o):ve.finalize(t,l,o)};ve.rules=function(t,e,n){let{schema:r,state:i,prefs:s}=n;for(let o of r._rules){let a=r._definition.rules[o.method];if(a.convert&&s.convert){i.mainstay.tracer.log(r,i,"rule",o.name,"full");continue}let u,c=o.args;if(o._resolve.length){c=Object.assign({},c);for(let h of o._resolve){let d=a.argsByName.get(h),g=c[h].resolve(t,i,s),y=d.normalize?d.normalize(g):g,_=It.validateArg(y,null,d);if(_){u=r.$_createError("any.ref",g,{arg:h,ref:c[h],reason:_},i,s);break}c[h]=y}}u=u||a.validate(t,n,c,o);let l=ve.rule(u,o);if(l.errors){if(i.mainstay.tracer.log(r,i,"rule",o.name,"error"),o.warn){i.mainstay.warnings.push(...l.errors);continue}if(s.abortEarly)return ve.finalize(t,l.errors,n);e.push(...l.errors)}else i.mainstay.tracer.log(r,i,"rule",o.name,"pass"),i.mainstay.tracer.value(i,"rule",t,l.value,o.name),t=l.value}return ve.finalize(t,e,n)};ve.rule=function(t,e){return t instanceof Yi.Report?(ve.error(t,e),{errors:[t],value:null}):Array.isArray(t)&&t[It.symbols.errors]?(t.forEach(n=>ve.error(n,e)),{errors:t,value:null}):{errors:null,value:t}};ve.error=function(t,e){return e.message&&t._setTemplate(e.message),t};ve.finalize=function(t,e,n){e=e||[];let{schema:r,state:i,prefs:s}=n;if(e.length){let a=ve.default("failover",void 0,e,n);a!==void 0&&(i.mainstay.tracer.value(i,"failover",t,a),t=a,e=[])}if(e.length&&r._flags.error)if(typeof r._flags.error=="function"){e=r._flags.error(e),Array.isArray(e)||(e=[e]);for(let a of e)bu(a instanceof Error||a instanceof Yi.Report,"error() must return an Error object")}else e=[r._flags.error];if(t===void 0){let a=ve.default("default",t,e,n);i.mainstay.tracer.value(i,"default",t,a),t=a}if(r._flags.cast&&t!==void 0){let a=r._definition.cast[r._flags.cast];if(a.from(t)){let u=a.to(t,n);i.mainstay.tracer.value(i,"cast",t,u,r._flags.cast),t=u}}if(r.$_terms.externals&&s.externals&&s._externals!==!1)for(let{method:a}of r.$_terms.externals)i.mainstay.externals.push({method:a,schema:r,state:i,label:Yi.label(r._flags,i,s)});let o={value:t,errors:e.length?e:null};return r._flags.result&&(o.value=r._flags.result==="strip"?void 0:n.original,i.mainstay.tracer.value(i,r._flags.result,t,o.value),i.shadow(t,r._flags.result)),r._cache&&s.cache!==!1&&!r._refs.length&&r._cache.set(n.original,o),t!==void 0&&!o.errors&&r._flags.artifact!==void 0&&(i.mainstay.artifacts=i.mainstay.artifacts||new Map,i.mainstay.artifacts.has(r._flags.artifact)||i.mainstay.artifacts.set(r._flags.artifact,[]),i.mainstay.artifacts.get(r._flags.artifact).push(i.path)),o};ve.prefs=function(t,e){let n=e===It.defaults;return n&&t._preferences[It.symbols.prefs]?t._preferences[It.symbols.prefs]:(e=It.preferences(e,t._preferences),n&&(t._preferences[It.symbols.prefs]=e),e)};ve.default=function(t,e,n,r){let{schema:i,state:s,prefs:o}=r,a=i._flags[t];if(o.noDefaults||a===void 0)return e;if(s.mainstay.tracer.log(i,s,"rule",t,"full"),!a)return a;if(typeof a=="function"){let u=a.length?[xA(s.ancestors[0]),r]:[];try{return a(...u)}catch(c){n.push(i.$_createError(`any.${t}`,null,{error:c},s,o));return}}return typeof a!="object"?a:a[It.symbols.literal]?a.literal:It.isResolvable(a)?a.resolve(e,s,o):xA(a)};ve.trim=function(t,e){if(typeof t!="string")return t;let n=e.$_getRule("trim");return!n||!n.args.enabled?t:t.trim()};ve.ignore={active:!1,debug:$o,entry:$o,filter:$o,log:$o,resolve:$o,value:$o};ve.errorsArray=function(){let t=[];return t[It.symbols.errors]=!0,t}});var Xb=m((pz,CA)=>{"use strict";var Pq=Le(),AA=yu(),Vb=Ze(),pi={};CA.exports=pi.Values=class{constructor(t,e){this._values=new Set(t),this._refs=new Set(e),this._lowercase=pi.lowercases(t),this._override=!1}get length(){return this._values.size+this._refs.size}add(t,e){if(Vb.isResolvable(t)){this._refs.has(t)||(this._refs.add(t),e&&e.register(t));return}this.has(t,null,null,!1)||(this._values.add(t),typeof t=="string"&&this._lowercase.set(t.toLowerCase(),t))}static merge(t,e,n){if(t=t||new pi.Values,e){if(e._override)return e.clone();for(let r of[...e._values,...e._refs])t.add(r)}if(n)for(let r of[...n._values,...n._refs])t.remove(r);return t.length?t:null}remove(t){if(Vb.isResolvable(t)){this._refs.delete(t);return}this._values.delete(t),typeof t=="string"&&this._lowercase.delete(t.toLowerCase())}has(t,e,n,r){return!!this.get(t,e,n,r)}get(t,e,n,r){if(!this.length)return!1;if(this._values.has(t))return{value:t};if(typeof t=="string"&&t&&r){let i=this._lowercase.get(t.toLowerCase());if(i)return{value:i}}if(!this._refs.size&&typeof t!="object")return!1;if(typeof t=="object"){for(let i of this._values)if(AA(i,t))return{value:i}}if(e)for(let i of this._refs){let s=i.resolve(t,e,n,null,{in:!0});if(s===void 0)continue;let o=!i.in||typeof s!="object"?[s]:Array.isArray(s)?s:Object.keys(s);for(let a of o)if(typeof a==typeof t){if(r&&t&&typeof t=="string"){if(a.toLowerCase()===t.toLowerCase())return{value:a,ref:i}}else if(AA(a,t))return{value:a,ref:i}}}return!1}override(){this._override=!0}values(t){if(t&&t.display){let e=[];for(let n of[...this._values,...this._refs])n!==void 0&&e.push(n);return e}return Array.from([...this._values,...this._refs])}clone(){let t=new pi.Values(this._values,this._refs);return t._override=this._override,t}concat(t){Pq(!t._override,"Cannot concat override set of values");let e=new pi.Values([...this._values,...t._values],[...this._refs,...t._refs]);return e._override=this._override,e}describe(){let t=[];this._override&&t.push({override:!0});for(let e of this._values.values())t.push(e&&typeof e=="object"?{value:e}:e);for(let e of this._refs.values())t.push(e.describe());return t}};pi.Values.prototype[Vb.symbols.values]=!0;pi.Values.prototype.slice=pi.Values.prototype.clone;pi.lowercases=function(t){let e=new Map;if(t)for(let n of t)typeof n=="string"&&e.set(n.toLowerCase(),n);return e}});var NA=m((mz,LA)=>{"use strict";var Z=Le(),OA=dn(),RA=yu(),Yb=Kh(),Dq=Fb(),Et=Ze(),Jb=Cs(),Iq=li(),Mq=$b(),PA=Ub(),Lq=qo(),DA=_A(),IA=hi(),MA=Gb(),Xh=kA(),Yh=Xb(),Bt={};Bt.Base=class{constructor(t){this.type=t,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new DA.Ids,this._preferences=null,this._refs=new IA.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return Z(typeof PA.describe=="function","Manifest functionality disabled"),PA.describe(this)}allow(...t){return Et.verifyFlat(t,"allow"),this._values(t,"_valids")}alter(t){Z(t&&typeof t=="object"&&!Array.isArray(t),"Invalid targets argument"),Z(!this._inRuleset(),"Cannot set alterations inside a ruleset");let e=this.clone();e.$_terms.alterations=e.$_terms.alterations||[];for(let n in t){let r=t[n];Z(typeof r=="function","Alteration adjuster for",n,"must be a function"),e.$_terms.alterations.push({target:n,adjuster:r})}return e.$_temp.ruleset=!1,e}artifact(t){return Z(t!==void 0,"Artifact cannot be undefined"),Z(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",t)}cast(t){return Z(t===!1||typeof t=="string","Invalid to value"),Z(t===!1||this._definition.cast[t],"Type",this.type,"does not support casting to",t),this.$_setFlag("cast",t===!1?void 0:t)}default(t,e){return this._default("default",t,e)}description(t){return Z(t&&typeof t=="string","Description must be a non-empty string"),this.$_setFlag("description",t)}empty(t){let e=this.clone();return t!==void 0&&(t=e.$_compile(t,{override:!1})),e.$_setFlag("empty",t,{clone:!1})}error(t){return Z(t,"Missing error"),Z(t instanceof Error||typeof t=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",t)}example(t,e={}){return Z(t!==void 0,"Missing example"),Et.assertOptions(e,["override"]),this._inner("examples",t,{single:!0,override:e.override})}external(t,e){return typeof t=="object"&&(Z(!e,"Cannot combine options with description"),e=t.description,t=t.method),Z(typeof t=="function","Method must be a function"),Z(e===void 0||e&&typeof e=="string","Description must be a non-empty string"),this._inner("externals",{method:t,description:e},{single:!0})}failover(t,e){return this._default("failover",t,e)}forbidden(){return this.presence("forbidden")}id(t){return t?(Z(typeof t=="string","id must be a non-empty string"),Z(/^[^\.]+$/.test(t),"id cannot contain period character"),this.$_setFlag("id",t)):this.$_setFlag("id",void 0)}invalid(...t){return this._values(t,"_invalids")}label(t){return Z(t&&typeof t=="string","Label name must be a non-empty string"),this.$_setFlag("label",t)}meta(t){return Z(t!==void 0,"Meta cannot be undefined"),this._inner("metas",t,{single:!0})}note(...t){Z(t.length,"Missing notes");for(let e of t)Z(e&&typeof e=="string","Notes must be non-empty strings");return this._inner("notes",t)}only(t=!0){return Z(typeof t=="boolean","Invalid mode:",t),this.$_setFlag("only",t)}optional(){return this.presence("optional")}prefs(t){Z(t,"Missing preferences"),Z(t.context===void 0,"Cannot override context"),Z(t.externals===void 0,"Cannot override externals"),Z(t.warnings===void 0,"Cannot override warnings"),Z(t.debug===void 0,"Cannot override debug"),Et.checkPreferences(t);let e=this.clone();return e._preferences=Et.preferences(e._preferences,t),e}presence(t){return Z(["optional","required","forbidden"].includes(t),"Unknown presence mode",t),this.$_setFlag("presence",t)}raw(t=!0){return this.$_setFlag("result",t?"raw":void 0)}result(t){return Z(["raw","strip"].includes(t),"Unknown result mode",t),this.$_setFlag("result",t)}required(){return this.presence("required")}strict(t){let e=this.clone(),n=t===void 0?!1:!t;return e._preferences=Et.preferences(e._preferences,{convert:n}),e}strip(t=!0){return this.$_setFlag("result",t?"strip":void 0)}tag(...t){Z(t.length,"Missing tags");for(let e of t)Z(e&&typeof e=="string","Tags must be non-empty strings");return this._inner("tags",t)}unit(t){return Z(t&&typeof t=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",t)}valid(...t){Et.verifyFlat(t,"valid");let e=this.allow(...t);return e.$_setFlag("only",!!e._valids,{clone:!1}),e}when(t,e){let n=this.clone();n.$_terms.whens||(n.$_terms.whens=[]);let r=Jb.when(n,t,e);if(!["any","link"].includes(n.type)){let i=r.is?[r]:r.switch;for(let s of i)Z(!s.then||s.then.type==="any"||s.then.type===n.type,"Cannot combine",n.type,"with",s.then&&s.then.type),Z(!s.otherwise||s.otherwise.type==="any"||s.otherwise.type===n.type,"Cannot combine",n.type,"with",s.otherwise&&s.otherwise.type)}return n.$_terms.whens.push(r),n.$_mutateRebuild()}cache(t){Z(!this._inRuleset(),"Cannot set caching inside a ruleset"),Z(!this._cache,"Cannot override schema cache"),Z(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");let e=this.clone();return e._cache=t||Dq.provider.provision(),e.$_temp.ruleset=!1,e}clone(){let t=Object.create(Object.getPrototypeOf(this));return this._assign(t)}concat(t){Z(Et.isSchema(t),"Invalid schema object"),Z(this.type==="any"||t.type==="any"||t.type===this.type,"Cannot merge type",this.type,"with another type:",t.type),Z(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),Z(!t._inRuleset(),"Cannot concatenate a schema with open ruleset");let e=this.clone();if(this.type==="any"&&t.type!=="any"){let n=t.clone();for(let r of Object.keys(e))r!=="type"&&(n[r]=e[r]);e=n}e._ids.concat(t._ids),e._refs.register(t,IA.toSibling),e._preferences=e._preferences?Et.preferences(e._preferences,t._preferences):t._preferences,e._valids=Yh.merge(e._valids,t._valids,t._invalids),e._invalids=Yh.merge(e._invalids,t._invalids,t._valids);for(let n of t._singleRules.keys())e._singleRules.has(n)&&(e._rules=e._rules.filter(r=>r.keep||r.name!==n),e._singleRules.delete(n));for(let n of t._rules)t._definition.rules[n.method].multi||e._singleRules.set(n.name,n),e._rules.push(n);if(e._flags.empty&&t._flags.empty){e._flags.empty=e._flags.empty.concat(t._flags.empty);let n=Object.assign({},t._flags);delete n.empty,Yb(e._flags,n)}else if(t._flags.empty){e._flags.empty=t._flags.empty;let n=Object.assign({},t._flags);delete n.empty,Yb(e._flags,n)}else Yb(e._flags,t._flags);for(let n in t.$_terms){let r=t.$_terms[n];if(!r){e.$_terms[n]||(e.$_terms[n]=r);continue}if(!e.$_terms[n]){e.$_terms[n]=r.slice();continue}e.$_terms[n]=e.$_terms[n].concat(r)}return this.$_root._tracer&&this.$_root._tracer._combine(e,[this,t]),e.$_mutateRebuild()}extend(t){return Z(!t.base,"Cannot extend type with another base"),Mq.type(this,t)}extract(t){return t=Array.isArray(t)?t:t.split("."),this._ids.reach(t)}fork(t,e){Z(!this._inRuleset(),"Cannot fork inside a ruleset");let n=this;for(let r of[].concat(t))r=Array.isArray(r)?r:r.split("."),n=n._ids.fork(r,e,n);return n.$_temp.ruleset=!1,n}rule(t){let e=this._definition;Et.assertOptions(t,Object.keys(e.modifiers)),Z(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");let n=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;Z(n>=0&&n<this._rules.length,"Cannot apply rules to empty ruleset");let r=this.clone();for(let i=n;i<r._rules.length;++i){let s=r._rules[i],o=OA(s);for(let a in t)e.modifiers[a](o,t[a]),Z(o.name===s.name,"Cannot change rule name");r._rules[i]=o,r._singleRules.get(o.name)===s&&r._singleRules.set(o.name,o)}return r.$_temp.ruleset=!1,r.$_mutateRebuild()}get ruleset(){Z(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");let t=this.clone();return t.$_temp.ruleset=t._rules.length,t}get $(){return this.ruleset}tailor(t){t=[].concat(t),Z(!this._inRuleset(),"Cannot tailor inside a ruleset");let e=this;if(this.$_terms.alterations)for(let{target:n,adjuster:r}of this.$_terms.alterations)t.includes(n)&&(e=r(e),Z(Et.isSchema(e),"Alteration adjuster for",n,"failed to return a schema object"));return e=e.$_modify({each:n=>n.tailor(t),ref:!1}),e.$_temp.ruleset=!1,e.$_mutateRebuild()}tracer(){return MA.location?MA.location(this):this}validate(t,e){return Xh.entry(t,this,e)}validateAsync(t,e){return Xh.entryAsync(t,this,e)}$_addRule(t){typeof t=="string"&&(t={name:t}),Z(t&&typeof t=="object","Invalid options"),Z(t.name&&typeof t.name=="string","Invalid rule name");for(let s in t)Z(s[0]!=="_","Cannot set private rule properties");let e=Object.assign({},t);e._resolve=[],e.method=e.method||e.name;let n=this._definition.rules[e.method],r=e.args;Z(n,"Unknown rule",e.method);let i=this.clone();if(r){Z(Object.keys(r).length===1||Object.keys(r).length===this._definition.rules[e.name].args.length,"Invalid rule definition for",this.type,e.name);for(let s in r){let o=r[s];if(n.argsByName){let a=n.argsByName.get(s);if(a.ref&&Et.isResolvable(o))e._resolve.push(s),i.$_mutateRegister(o);else if(a.normalize&&(o=a.normalize(o),r[s]=o),a.assert){let u=Et.validateArg(o,s,a);Z(!u,u,"or reference")}}if(o===void 0){delete r[s];continue}r[s]=o}}return n.multi||(i._ruleRemove(e.name,{clone:!1}),i._singleRules.set(e.name,e)),i.$_temp.ruleset===!1&&(i.$_temp.ruleset=null),n.priority?i._rules.unshift(e):i._rules.push(e),i}$_compile(t,e){return Jb.schema(this.$_root,t,e)}$_createError(t,e,n,r,i,s={}){let o=s.flags!==!1?this._flags:{},a=s.messages?Lq.merge(this._definition.messages,s.messages):this._definition.messages;return new Iq.Report(t,e,n,o,a,r,i)}$_getFlag(t){return this._flags[t]}$_getRule(t){return this._singleRules.get(t)}$_mapLabels(t){return t=Array.isArray(t)?t:t.split("."),this._ids.labels(t)}$_match(t,e,n,r){n=Object.assign({},n),n.abortEarly=!0,n._externals=!1,e.snapshot();let i=!Xh.validate(t,this,e,n,r).errors;return e.restore(),i}$_modify(t){return Et.assertOptions(t,["each","once","ref","schema"]),DA.schema(this,t)||this}$_mutateRebuild(){Z(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset();let t=(e,{source:n,name:r,path:i,key:s})=>{let o=this._definition[n][r]&&this._definition[n][r].register;o!==!1&&this.$_mutateRegister(e,{family:o,key:s})};return this.$_modify({each:t}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(t,{family:e,key:n}={}){this._refs.register(t,e),this._ids.register(t,{key:n})}$_property(t){return this._definition.properties[t]}$_reach(t){return this._ids.reach(t)}$_rootReferences(){return this._refs.roots()}$_setFlag(t,e,n={}){Z(t[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");let r=this._definition.flags[t]||{};if(RA(e,r.default)&&(e=void 0),RA(e,this._flags[t]))return this;let i=n.clone!==!1?this.clone():this;return e!==void 0?(i._flags[t]=e,i.$_mutateRegister(e)):delete i._flags[t],t[0]!=="_"&&(i.$_temp.ruleset=!1),i}$_parent(t,...e){return this[t][Et.symbols.parent].call(this,...e)}$_validate(t,e,n){return Xh.validate(t,this,e,n)}_assign(t){t.type=this.type,t.$_root=this.$_root,t.$_temp=Object.assign({},this.$_temp),t.$_temp.whens={},t._ids=this._ids.clone(),t._preferences=this._preferences,t._valids=this._valids&&this._valids.clone(),t._invalids=this._invalids&&this._invalids.clone(),t._rules=this._rules.slice(),t._singleRules=OA(this._singleRules,{shallow:!0}),t._refs=this._refs.clone(),t._flags=Object.assign({},this._flags),t._cache=null,t.$_terms={};for(let e in this.$_terms)t.$_terms[e]=this.$_terms[e]?this.$_terms[e].slice():null;t.$_super={};for(let e in this.$_super)t.$_super[e]=this._super[e].bind(t);return t}_bare(){let t=this.clone();t._reset();let e=t._definition.terms;for(let n in e){let r=e[n];t.$_terms[n]=r.init}return t.$_mutateRebuild()}_default(t,e,n={}){return Et.assertOptions(n,"literal"),Z(e!==void 0,"Missing",t,"value"),Z(typeof e=="function"||!n.literal,"Only function value supports literal option"),typeof e=="function"&&n.literal&&(e={[Et.symbols.literal]:!0,literal:e}),this.$_setFlag(t,e)}_generate(t,e,n){if(!this.$_terms.whens)return{schema:this};let r=[],i=[];for(let a=0;a<this.$_terms.whens.length;++a){let u=this.$_terms.whens[a];if(u.concat){r.push(u.concat),i.push(`${a}.concat`);continue}let c=u.ref?u.ref.resolve(t,e,n):t,l=u.is?[u]:u.switch,h=i.length;for(let d=0;d<l.length;++d){let{is:g,then:y,otherwise:_}=l[d],C=`${a}${u.switch?"."+d:""}`;if(g.$_match(c,e.nest(g,`${C}.is`),n)){if(y){let k=e.localize([...e.path,`${C}.then`],e.ancestors,e.schemas),{schema:T,id:w}=y._generate(t,k,n);r.push(T),i.push(`${C}.then${w?`(${w})`:""}`);break}}else if(_){let k=e.localize([...e.path,`${C}.otherwise`],e.ancestors,e.schemas),{schema:T,id:w}=_._generate(t,k,n);r.push(T),i.push(`${C}.otherwise${w?`(${w})`:""}`);break}}if(u.break&&i.length>h)break}let s=i.join(", ");if(e.mainstay.tracer.debug(e,"rule","when",s),!s)return{schema:this};if(!e.mainstay.tracer.active&&this.$_temp.whens[s])return{schema:this.$_temp.whens[s],id:s};let o=this;this._definition.generate&&(o=this._definition.generate(this,t,e,n));for(let a of r)o=o.concat(a);return this.$_root._tracer&&this.$_root._tracer._combine(o,[this,...r]),this.$_temp.whens[s]=o,{schema:o,id:s}}_inner(t,e,n={}){Z(!this._inRuleset(),`Cannot set ${t} inside a ruleset`);let r=this.clone();return(!r.$_terms[t]||n.override)&&(r.$_terms[t]=[]),n.single?r.$_terms[t].push(e):r.$_terms[t].push(...e),r.$_temp.ruleset=!1,r}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(t,e={}){if(!this._singleRules.has(t))return this;let n=e.clone!==!1?this.clone():this;n._singleRules.delete(t);let r=[];for(let i=0;i<n._rules.length;++i){let s=n._rules[i];if(s.name===t&&!s.keep){n._inRuleset()&&i<n.$_temp.ruleset&&--n.$_temp.ruleset;continue}r.push(s)}return n._rules=r,n}_values(t,e){Et.verifyFlat(t,e.slice(1,-1));let n=this.clone(),r=t[0]===Et.symbols.override;if(r&&(t=t.slice(1)),!n[e]&&t.length?n[e]=new Yh:r&&(n[e]=t.length?new Yh:null,n.$_mutateRebuild()),!n[e])return n;r&&n[e].override();for(let i of t){Z(i!==void 0,"Cannot call allow/valid/invalid with undefined"),Z(i!==Et.symbols.override,"Override must be the first value");let s=e==="_invalids"?"_valids":"_invalids";n[s]&&(n[s].remove(i),n[s].length||(Z(e==="_valids"||!n._flags.only,"Setting invalid value",i,"leaves schema rejecting all values due to previous valid rule"),n[s]=null)),n[e].add(i,n._refs)}return n}};Bt.Base.prototype[Et.symbols.any]={version:Et.version,compile:Jb.compile,root:"$_root"};Bt.Base.prototype.isImmutable=!0;Bt.Base.prototype.deny=Bt.Base.prototype.invalid;Bt.Base.prototype.disallow=Bt.Base.prototype.invalid;Bt.Base.prototype.equal=Bt.Base.prototype.valid;Bt.Base.prototype.exist=Bt.Base.prototype.required;Bt.Base.prototype.not=Bt.Base.prototype.invalid;Bt.Base.prototype.options=Bt.Base.prototype.prefs;Bt.Base.prototype.preferences=Bt.Base.prototype.prefs;LA.exports=new Bt.Base});var tr=m((bz,qA)=>{"use strict";var Jh=Le(),Nq=NA(),qq=Ze(),jq=qo();qA.exports=Nq.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(t,e){return Jh(typeof t=="function","Method must be a function"),Jh(e===void 0||e&&typeof e=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:t,description:e}})},validate(t,e,{method:n}){try{return n(t,e)}catch(r){return e.error("any.custom",{error:r})}},args:["method","description"],multi:!0},messages:{method(t){return this.prefs({messages:t})}},shared:{method(t){Jh(qq.isSchema(t)&&t._flags.id,"Schema must be a schema with an id");let e=this.clone();return e.$_terms.shared=e.$_terms.shared||[],e.$_terms.shared.push(t),e.$_mutateRegister(t),e}},warning:{method(t,e){return Jh(t&&typeof t=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:t,local:e},warn:!0})},validate(t,e,{code:n,local:r}){return e.error(n,r)},args:["code","local"],multi:!0}},modifiers:{keep(t,e=!0){t.keep=e},message(t,e){t.message=jq.compile(e)},warn(t,e=!0){t.warn=e}},manifest:{build(t,e){for(let n in e){let r=e[n];if(["examples","externals","metas","notes","tags"].includes(n)){for(let i of r)t=t[n.slice(0,-1)](i);continue}if(n==="alterations"){let i={};for(let{target:s,adjuster:o}of r)i[s]=o;t=t.alter(i);continue}if(n==="whens"){for(let i of r){let{ref:s,is:o,not:a,then:u,otherwise:c,concat:l}=i;l?t=t.concat(l):s?t=t.when(s,{is:o,not:a,then:u,otherwise:c,switch:i.switch,break:i.break}):t=t.when(o,{then:u,otherwise:c,break:i.break})}continue}if(n==="shared")for(let i of r)t=t.shared(i)}return t}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})});var $A=m((_z,FA)=>{"use strict";var Rs=Le(),Fq=Kh(),$q=tr(),jA=Ze(),Bq=Cs(),Qh=li(),Wq=hi(),Bo={};FA.exports=$q.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:Wq.toSibling}},args(t,...e){return e.length===1&&Array.isArray(e[0])?t.try(...e[0]):t.try(...e)},validate(t,e){let{schema:n,error:r,state:i,prefs:s}=e;if(n._flags.match){let a=[],u=[];for(let l=0;l<n.$_terms.matches.length;++l){let h=n.$_terms.matches[l],d=i.nest(h.schema,`match.${l}`);d.snapshot();let g=h.schema.$_validate(t,d,s);g.errors?(u.push(g.errors),d.restore()):(a.push(g.value),d.commit())}if(a.length===0){let l={details:u.map(h=>Qh.details(h,{override:!1}))};return{errors:r("alternatives.any",l)}}if(n._flags.match==="one")return a.length===1?{value:a[0]}:{errors:r("alternatives.one")};if(a.length!==n.$_terms.matches.length){let l={details:u.map(h=>Qh.details(h,{override:!1}))};return{errors:r("alternatives.all",l)}}let c=l=>l.$_terms.matches.some(h=>h.schema.type==="object"||h.schema.type==="alternatives"&&c(h.schema));return c(n)?{value:a.reduce((l,h)=>Fq(l,h,{mergeArrays:!1}))}:{value:a[a.length-1]}}let o=[];for(let a=0;a<n.$_terms.matches.length;++a){let u=n.$_terms.matches[a];if(u.schema){let h=i.nest(u.schema,`match.${a}`);h.snapshot();let d=u.schema.$_validate(t,h,s);if(!d.errors)return h.commit(),d;h.restore(),o.push({schema:u.schema,reports:d.errors});continue}let c=u.ref?u.ref.resolve(t,i,s):t,l=u.is?[u]:u.switch;for(let h=0;h<l.length;++h){let d=l[h],{is:g,then:y,otherwise:_}=d,C=`match.${a}${u.switch?"."+h:""}`;if(g.$_match(c,i.nest(g,`${C}.is`),s)){if(y)return y.$_validate(t,i.nest(y,`${C}.then`),s)}else if(_)return _.$_validate(t,i.nest(_,`${C}.otherwise`),s)}}return Bo.errors(o,e)},rules:{conditional:{method(t,e){Rs(!this._flags._endedSwitch,"Unreachable condition"),Rs(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),Rs(e.break===void 0,"Cannot use break option with alternatives conditional");let n=this.clone(),r=Bq.when(n,t,e),i=r.is?[r]:r.switch;for(let s of i)if(s.then&&s.otherwise){n.$_setFlag("_endedSwitch",!0,{clone:!1});break}return n.$_terms.matches.push(r),n.$_mutateRebuild()}},match:{method(t){if(Rs(["any","one","all"].includes(t),"Invalid alternatives match mode",t),t!=="any")for(let e of this.$_terms.matches)Rs(e.schema,"Cannot combine match mode",t,"with conditional rules");return this.$_setFlag("match",t)}},try:{method(...t){Rs(t.length,"Missing alternative schemas"),jA.verifyFlat(t,"try"),Rs(!this._flags._endedSwitch,"Unreachable condition");let e=this.clone();for(let n of t)e.$_terms.matches.push({schema:e.$_compile(n)});return e.$_mutateRebuild()}}},overrides:{label(t){let e=this.$_parent("label",t),n=(r,i)=>i.path[0]!=="is"&&typeof r._flags.label!="string"?r.label(t):void 0;return e.$_modify({each:n,ref:!1})}},rebuild(t){let e=n=>{jA.isSchema(n)&&n.type==="array"&&t.$_setFlag("_arrayItems",!0,{clone:!1})};t.$_modify({each:e})},manifest:{build(t,e){if(e.matches)for(let n of e.matches){let{schema:r,ref:i,is:s,not:o,then:a,otherwise:u}=n;r?t=t.try(r):i?t=t.conditional(i,{is:s,then:a,not:o,otherwise:u,switch:n.switch}):t=t.conditional(s,{then:a,otherwise:u})}return t}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}});Bo.errors=function(t,{error:e,state:n}){if(!t.length)return{errors:e("alternatives.any")};if(t.length===1)return{errors:t[0].reports};let r=new Set,i=[];for(let{reports:s,schema:o}of t){if(s.length>1)return Bo.unmatched(t,e);let a=s[0];if(!(a instanceof Qh.Report))return Bo.unmatched(t,e);if(a.state.path.length!==n.path.length){i.push({type:o.type,report:a});continue}if(a.code==="any.only"){for(let l of a.local.valids)r.add(l);continue}let[u,c]=a.code.split(".");c!=="base"?i.push({type:o.type,report:a}):a.code==="object.base"?r.add(a.local.type):r.add(u)}return i.length?i.length===1?{errors:i[0].report}:Bo.unmatched(t,e):{errors:e("alternatives.types",{types:[...r]})}};Bo.unmatched=function(t,e){let n=[];for(let r of t)n.push(...r.reports);return{errors:e("alternatives.match",Qh.details(n,{override:!1}))}}});var WA=m((vz,BA)=>{"use strict";var vu=Le(),Uq=yu(),Hq=xs(),Gq=tr(),nr=Ze(),zq=Cs(),ct={};BA.exports=Gq.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(t,{schema:e,state:n,prefs:r}){if(!Array.isArray(t))return;let i=e.$_getRule("sort");if(i)return ct.sort(e,t,i.args.options,n,r)}},validate(t,{schema:e,error:n}){if(!Array.isArray(t)){if(e._flags.single){let r=[t];return r[nr.symbols.arraySingle]=!0,{value:r}}return{errors:n("array.base")}}if(!(!e.$_getRule("items")&&!e.$_terms.externals))return{value:t.slice()}},rules:{has:{method(t){t=this.$_compile(t,{appendPath:!0});let e=this.$_addRule({name:"has",args:{schema:t}});return e.$_mutateRegister(t),e},validate(t,{state:e,prefs:n,error:r},{schema:i}){let s=[t,...e.ancestors];for(let a=0;a<t.length;++a){let u=e.localize([...e.path,a],s,i);if(i.$_match(t[a],u,n))return t}let o=i._flags.label;return o?r("array.hasKnown",{patternLabel:o}):r("array.hasUnknown",null)},multi:!0},items:{method(...t){nr.verifyFlat(t,"items");let e=this.$_addRule("items");for(let n=0;n<t.length;++n){let r=nr.tryWithPath(()=>this.$_compile(t[n]),n,{append:!0});e.$_terms.items.push(r)}return e.$_mutateRebuild()},validate(t,{schema:e,error:n,state:r,prefs:i,errorsArray:s}){let o=e.$_terms._requireds.slice(),a=e.$_terms.ordered.slice(),u=[...e.$_terms._inclusions,...o],c=!t[nr.symbols.arraySingle];delete t[nr.symbols.arraySingle];let l=s(),h=t.length;for(let d=0;d<h;++d){let g=t[d],y=!1,_=!1,C=c?d:new Number(d),k=[...r.path,C];if(!e._flags.sparse&&g===void 0){if(l.push(n("array.sparse",{key:C,path:k,pos:d,value:void 0},r.localize(k))),i.abortEarly)return l;a.shift();continue}let T=[t,...r.ancestors];for(let R of e.$_terms._exclusions)if(R.$_match(g,r.localize(k,T,R),i,{presence:"ignore"})){if(l.push(n("array.excludes",{pos:d,value:g},r.localize(k))),i.abortEarly)return l;y=!0,a.shift();break}if(y)continue;if(e.$_terms.ordered.length){if(a.length){let R=a.shift(),W=R.$_validate(g,r.localize(k,T,R),i);if(W.errors){if(l.push(...W.errors),i.abortEarly)return l}else if(R._flags.result==="strip")ct.fastSplice(t,d),--d,--h;else if(!e._flags.sparse&&W.value===void 0){if(l.push(n("array.sparse",{key:C,path:k,pos:d,value:void 0},r.localize(k))),i.abortEarly)return l;continue}else t[d]=W.value;continue}else if(!e.$_terms.items.length){if(l.push(n("array.orderedLength",{pos:d,limit:e.$_terms.ordered.length})),i.abortEarly)return l;break}}let w=[],v=o.length;for(let R=0;R<v;++R){let W=r.localize(k,T,o[R]);W.snapshot();let ne=o[R].$_validate(g,W,i);if(w[R]=ne,!ne.errors){if(W.commit(),t[d]=ne.value,_=!0,ct.fastSplice(o,R),--R,--v,!e._flags.sparse&&ne.value===void 0&&(l.push(n("array.sparse",{key:C,path:k,pos:d,value:void 0},r.localize(k))),i.abortEarly))return l;break}W.restore()}if(_)continue;let L=i.stripUnknown&&!!i.stripUnknown.arrays||!1;v=u.length;for(let R of u){let W,ne=o.indexOf(R);if(ne!==-1)W=w[ne];else{let se=r.localize(k,T,R);if(se.snapshot(),W=R.$_validate(g,se,i),!W.errors){se.commit(),R._flags.result==="strip"?(ct.fastSplice(t,d),--d,--h):!e._flags.sparse&&W.value===void 0?(l.push(n("array.sparse",{key:C,path:k,pos:d,value:void 0},r.localize(k))),y=!0):t[d]=W.value,_=!0;break}se.restore()}if(v===1){if(L){ct.fastSplice(t,d),--d,--h,_=!0;break}if(l.push(...W.errors),i.abortEarly)return l;y=!0;break}}if(!y&&(e.$_terms._inclusions.length||e.$_terms._requireds.length)&&!_){if(L){ct.fastSplice(t,d),--d,--h;continue}if(l.push(n("array.includes",{pos:d,value:g},r.localize(k))),i.abortEarly)return l}}return o.length&&ct.fillMissedErrors(e,l,o,t,r,i),a.length&&(ct.fillOrderedErrors(e,l,a,t,r,i),l.length||ct.fillDefault(a,t,r,i)),l.length?l:t},priority:!0,manifest:!1},length:{method(t){return this.$_addRule({name:"length",args:{limit:t},operator:"="})},validate(t,e,{limit:n},{name:r,operator:i,args:s}){return nr.compare(t.length,n,i)?t:e.error("array."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:nr.limit,message:"must be a positive integer"}]},max:{method(t){return this.$_addRule({name:"max",method:"length",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"length",args:{limit:t},operator:">="})}},ordered:{method(...t){nr.verifyFlat(t,"ordered");let e=this.$_addRule("items");for(let n=0;n<t.length;++n){let r=nr.tryWithPath(()=>this.$_compile(t[n]),n,{append:!0});ct.validateSingle(r,e),e.$_mutateRegister(r),e.$_terms.ordered.push(r)}return e.$_mutateRebuild()}},single:{method(t){let e=t===void 0?!0:!!t;return vu(!e||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",e)}},sort:{method(t={}){nr.assertOptions(t,["by","order"]);let e={order:t.order||"ascending"};return t.by&&(e.by=zq.ref(t.by,{ancestor:0}),vu(!e.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:e}})},validate(t,{error:e,state:n,prefs:r,schema:i},{options:s}){let{value:o,errors:a}=ct.sort(i,t,s,n,r);if(a)return a;for(let u=0;u<t.length;++u)if(t[u]!==o[u])return e("array.sort",{order:s.order,by:s.by?s.by.key:"value"});return t},convert:!0},sparse:{method(t){let e=t===void 0?!0:!!t;return this._flags.sparse===e?this:(e?this.clone():this.$_addRule("items")).$_setFlag("sparse",e,{clone:!1})}},unique:{method(t,e={}){vu(!t||typeof t=="function"||typeof t=="string","comparator must be a function or a string"),nr.assertOptions(e,["ignoreUndefined","separator"]);let n={name:"unique",args:{options:e,comparator:t}};if(t)if(typeof t=="string"){let r=nr.default(e.separator,".");n.path=r?t.split(r):[t]}else n.comparator=t;return this.$_addRule(n)},validate(t,{state:e,error:n,schema:r},{comparator:i,options:s},{comparator:o,path:a}){let u={string:Object.create(null),number:Object.create(null),undefined:Object.create(null),boolean:Object.create(null),bigint:Object.create(null),object:new Map,function:new Map,custom:new Map},c=o||Uq,l=s.ignoreUndefined;for(let h=0;h<t.length;++h){let d=a?Hq(t[h],a):t[h],g=o?u.custom:u[typeof d];if(vu(g,"Failed to find unique map container for type",typeof d),g instanceof Map){let y=g.entries(),_;for(;!(_=y.next()).done;)if(c(_.value[0],d)){let C=e.localize([...e.path,h],[t,...e.ancestors]),k={pos:h,value:t[h],dupePos:_.value[1],dupeValue:t[_.value[1]]};return a&&(k.path=i),n("array.unique",k,C)}g.set(d,h)}else{if((!l||d!==void 0)&&g[d]!==void 0){let y={pos:h,value:t[h],dupePos:g[d],dupeValue:t[g[d]]};a&&(y.path=i);let _=e.localize([...e.path,h],[t,...e.ancestors]);return n("array.unique",y,_)}g[d]=h}}return t},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to(t,e){return new Set(t)}}},rebuild(t){t.$_terms._inclusions=[],t.$_terms._exclusions=[],t.$_terms._requireds=[];for(let e of t.$_terms.items)ct.validateSingle(e,t),e._flags.presence==="required"?t.$_terms._requireds.push(e):e._flags.presence==="forbidden"?t.$_terms._exclusions.push(e):t.$_terms._inclusions.push(e);for(let e of t.$_terms.ordered)ct.validateSingle(e,t)},manifest:{build(t,e){return e.items&&(t=t.items(...e.items)),e.ordered&&(t=t.ordered(...e.ordered)),t}},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}});ct.fillMissedErrors=function(t,e,n,r,i,s){let o=[],a=0;for(let u of n){let c=u._flags.label;c?o.push(c):++a}o.length?a?e.push(t.$_createError("array.includesRequiredBoth",r,{knownMisses:o,unknownMisses:a},i,s)):e.push(t.$_createError("array.includesRequiredKnowns",r,{knownMisses:o},i,s)):e.push(t.$_createError("array.includesRequiredUnknowns",r,{unknownMisses:a},i,s))};ct.fillOrderedErrors=function(t,e,n,r,i,s){let o=[];for(let a of n)a._flags.presence==="required"&&o.push(a);o.length&&ct.fillMissedErrors(t,e,o,r,i,s)};ct.fillDefault=function(t,e,n,r){let i=[],s=!0;for(let o=t.length-1;o>=0;--o){let a=t[o],u=[e,...n.ancestors],c=a.$_validate(void 0,n.localize(n.path,u,a),r).value;if(s){if(c===void 0)continue;s=!1}i.unshift(c)}i.length&&e.push(...i)};ct.fastSplice=function(t,e){let n=e;for(;n<t.length;)t[n++]=t[n];--t.length};ct.validateSingle=function(t,e){(t.type==="array"||t._flags._arrayItems)&&(vu(!e._flags.single,"Cannot specify array item with single rule enabled"),e.$_setFlag("_arrayItems",!0,{clone:!1}))};ct.sort=function(t,e,n,r,i){let s=n.order==="ascending"?1:-1,o=-1*s,a=s,u=(c,l)=>{let h=ct.compare(c,l,o,a);if(h!==null||(n.by&&(c=n.by.resolve(c,r,i),l=n.by.resolve(l,r,i)),h=ct.compare(c,l,o,a),h!==null))return h;let d=typeof c;if(d!==typeof l)throw t.$_createError("array.sort.mismatching",e,null,r,i);if(d!=="number"&&d!=="string")throw t.$_createError("array.sort.unsupported",e,{type:d},r,i);return d==="number"?(c-l)*s:c<l?o:a};try{return{value:e.slice().sort(u)}}catch(c){return{errors:c}}};ct.compare=function(t,e,n,r){return t===e?0:t===void 0?1:e===void 0?-1:t===null?r:e===null?n:null}});var KA=m((Sz,zA)=>{"use strict";var UA=Le(),Kq=tr(),HA=Ze(),GA=Xb(),Qb={};Qb.isBool=function(t){return typeof t=="boolean"};zA.exports=Kq.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(t,{schema:e}){if(typeof t!="boolean"){if(typeof t=="string"){let n=e._flags.sensitive?t:t.toLowerCase();t=n==="true"?!0:n==="false"?!1:t}return typeof t!="boolean"&&(t=e.$_terms.truthy&&e.$_terms.truthy.has(t,null,null,!e._flags.sensitive)||(e.$_terms.falsy&&e.$_terms.falsy.has(t,null,null,!e._flags.sensitive)?!1:t)),{value:t}}},validate(t,{error:e}){if(typeof t!="boolean")return{value:t,errors:e("boolean.base")}},rules:{truthy:{method(...t){HA.verifyFlat(t,"truthy");let e=this.clone();e.$_terms.truthy=e.$_terms.truthy||new GA;for(let n=0;n<t.length;++n){let r=t[n];UA(r!==void 0,"Cannot call truthy with undefined"),e.$_terms.truthy.add(r)}return e}},falsy:{method(...t){HA.verifyFlat(t,"falsy");let e=this.clone();e.$_terms.falsy=e.$_terms.falsy||new GA;for(let n=0;n<t.length;++n){let r=t[n];UA(r!==void 0,"Cannot call falsy with undefined"),e.$_terms.falsy.add(r)}return e}},sensitive:{method(t=!0){return this.$_setFlag("sensitive",t)}}},cast:{number:{from:Qb.isBool,to(t,e){return t?1:0}},string:{from:Qb.isBool,to(t,e){return t?"true":"false"}}},manifest:{build(t,e){return e.truthy&&(t=t.truthy(...e.truthy)),e.falsy&&(t=t.falsy(...e.falsy)),t}},messages:{"boolean.base":"{{#label}} must be a boolean"}})});var JA=m((wz,YA)=>{"use strict";var VA=Le(),Vq=tr(),XA=Ze(),Xq=Vi(),Er={};Er.isDate=function(t){return t instanceof Date};YA.exports=Vq.extend({type:"date",coerce:{from:["number","string"],method(t,{schema:e}){return{value:Er.parse(t,e._flags.format)||t}}},validate(t,{schema:e,error:n,prefs:r}){if(t instanceof Date&&!isNaN(t.getTime()))return;let i=e._flags.format;return!r.convert||!i||typeof t!="string"?{value:t,errors:n("date.base")}:{value:t,errors:n("date.format",{format:i})}},rules:{compare:{method:!1,validate(t,e,{date:n},{name:r,operator:i,args:s}){let o=n==="now"?Date.now():n.getTime();return XA.compare(t.getTime(),o,i)?t:e.error("date."+r,{limit:s.date,value:t})},args:[{name:"date",ref:!0,normalize:t=>t==="now"?t:Er.parse(t),assert:t=>t!==null,message:"must have a valid date format"}]},format:{method(t){return VA(["iso","javascript","unix"].includes(t),"Unknown date format",t),this.$_setFlag("format",t)}},greater:{method(t){return this.$_addRule({name:"greater",method:"compare",args:{date:t},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(t){return this.$_addRule({name:"less",method:"compare",args:{date:t},operator:"<"})}},max:{method(t){return this.$_addRule({name:"max",method:"compare",args:{date:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"compare",args:{date:t},operator:">="})}},timestamp:{method(t="javascript"){return VA(["javascript","unix"].includes(t),'"type" must be one of "javascript, unix"'),this.format(t)}}},cast:{number:{from:Er.isDate,to(t,e){return t.getTime()}},string:{from:Er.isDate,to(t,{prefs:e}){return Xq.date(t,e)}}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}});Er.parse=function(t,e){if(t instanceof Date)return t;if(typeof t!="string"&&(isNaN(t)||!isFinite(t))||/^\s*$/.test(t))return null;if(e==="iso")return XA.isIsoDate(t)?Er.date(t.toString()):null;let n=t;if(typeof t=="string"&&/^[+-]?\d+(\.\d+)?$/.test(t)&&(t=parseFloat(t)),e){if(e==="javascript")return Er.date(1*t);if(e==="unix")return Er.date(1e3*t);if(typeof n=="string")return null}return Er.date(t)};Er.date=function(t){let e=new Date(t);return isNaN(e.getTime())?null:e}});var n1=m((Tz,t1)=>{"use strict";var Zh=Le(),ZA=dn(),e1=Kh(),QA=xs(),ed={};t1.exports=function(t,e,n={}){if(Zh(t&&typeof t=="object","Invalid defaults value: must be an object"),Zh(!e||e===!0||typeof e=="object","Invalid source value: must be true, falsy or an object"),Zh(typeof n=="object","Invalid options: must be an object"),!e)return null;if(n.shallow)return ed.applyToDefaultsWithShallow(t,e,n);let r=ZA(t);if(e===!0)return r;let i=n.nullOverride!==void 0?n.nullOverride:!1;return e1(r,e,{nullOverride:i,mergeArrays:!1})};ed.applyToDefaultsWithShallow=function(t,e,n){let r=n.shallow;Zh(Array.isArray(r),"Invalid keys");let i=new Map,s=e===!0?null:new Set;for(let u of r){u=Array.isArray(u)?u:u.split(".");let c=QA(t,u);c&&typeof c=="object"?i.set(c,s&&QA(e,u)||c):s&&s.add(u)}let o=ZA(t,{},i);if(!s)return o;for(let u of s)ed.reachCopy(o,e,u);let a=n.nullOverride!==void 0?n.nullOverride:!1;return e1(o,e,{nullOverride:a,mergeArrays:!1})};ed.reachCopy=function(t,e,n){for(let s of n){if(!(s in e))return;let o=e[s];if(typeof o!="object"||o===null)return;e=o}let r=e,i=t;for(let s=0;s<n.length-1;++s){let o=n[s];typeof i[o]!="object"&&(i[o]={}),i=i[o]}i[n[n.length-1]]=r}});var s1=m(i1=>{"use strict";var Ps=Le(),r1={};i1.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(t,e){e=e||{};let n=[].concat(e.before||[]),r=[].concat(e.after||[]),i=e.group||"?",s=e.sort||0;Ps(!n.includes(i),`Item cannot come before itself: ${i}`),Ps(!n.includes("?"),"Item cannot come before unassociated items"),Ps(!r.includes(i),`Item cannot come after itself: ${i}`),Ps(!r.includes("?"),"Item cannot come after unassociated items"),Array.isArray(t)||(t=[t]);for(let o of t){let a={seq:this._items.length,sort:s,before:n,after:r,group:i,node:o};this._items.push(a)}if(!e.manual){let o=this._sort();Ps(o,"item",i!=="?"?`added into group ${i}`:"","created a dependencies error")}return this.nodes}merge(t){Array.isArray(t)||(t=[t]);for(let n of t)if(n)for(let r of n._items)this._items.push(Object.assign({},r));this._items.sort(r1.mergeSort);for(let n=0;n<this._items.length;++n)this._items[n].seq=n;let e=this._sort();return Ps(e,"merge created a dependencies error"),this.nodes}sort(){let t=this._sort();return Ps(t,"sort created a dependencies error"),this.nodes}_sort(){let t={},e=Object.create(null),n=Object.create(null);for(let a of this._items){let u=a.seq,c=a.group;n[c]=n[c]||[],n[c].push(u),t[u]=a.before;for(let l of a.after)e[l]=e[l]||[],e[l].push(u)}for(let a in t){let u=[];for(let c in t[a]){let l=t[a][c];n[l]=n[l]||[],u.push(...n[l])}t[a]=u}for(let a in e)if(n[a])for(let u of n[a])t[u].push(...e[a]);let r={};for(let a in t){let u=t[a];for(let c of u)r[c]=r[c]||[],r[c].push(a)}let i={},s=[];for(let a=0;a<this._items.length;++a){let u=a;if(r[a]){u=null;for(let c=0;c<this._items.length;++c){if(i[c]===!0)continue;r[c]||(r[c]=[]);let l=r[c].length,h=0;for(let d=0;d<l;++d)i[r[c][d]]&&++h;if(h===l){u=c;break}}}u!==null&&(i[u]=!0,s.push(u))}if(s.length!==this._items.length)return!1;let o={};for(let a of this._items)o[a.seq]=a;this._items=[],this.nodes=[];for(let a of s){let u=o[a];this.nodes.push(u.node),this._items.push(u)}return!0}};r1.mergeSort=(t,e)=>t.sort===e.sort?0:t.sort<e.sort?-1:1});var e_=m((kz,u1)=>{"use strict";var Yq=n1(),rr=Le(),o1=dn(),Jq=s1(),Qq=tr(),an=Ze(),Zb=Cs(),Zq=li(),a1=hi(),td=Vi(),de={renameDefaults:{alias:!1,multiple:!1,override:!1}};u1.exports=Qq.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:void 0}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args(t,e){return t.keys(e)},validate(t,{schema:e,error:n,state:r,prefs:i}){if(!t||typeof t!==e.$_property("typeof")||Array.isArray(t))return{value:t,errors:n("object.base",{type:e.$_property("typeof")})};if(!e.$_terms.renames&&!e.$_terms.dependencies&&!e.$_terms.keys&&!e.$_terms.patterns&&!e.$_terms.externals)return;t=de.clone(t,i);let s=[];if(e.$_terms.renames&&!de.rename(e,t,r,i,s))return{value:t,errors:s};if(!e.$_terms.keys&&!e.$_terms.patterns&&!e.$_terms.dependencies)return{value:t,errors:s};let o=new Set(Object.keys(t));if(e.$_terms.keys){let a=[t,...r.ancestors];for(let u of e.$_terms.keys){let c=u.key,l=t[c];o.delete(c);let h=r.localize([...r.path,c],a,u),d=u.schema.$_validate(l,h,i);if(d.errors){if(i.abortEarly)return{value:t,errors:d.errors};d.value!==void 0&&(t[c]=d.value),s.push(...d.errors)}else u.schema._flags.result==="strip"||d.value===void 0&&l!==void 0?delete t[c]:d.value!==void 0&&(t[c]=d.value)}}if(o.size||e._flags._hasPatternMatch){let a=de.unknown(e,t,o,s,r,i);if(a)return a}if(e.$_terms.dependencies)for(let a of e.$_terms.dependencies){if(a.key!==null&&de.isPresent(a.options)(a.key.resolve(t,r,i,null,{shadow:!1}))===!1)continue;let u=de.dependencies[a.rel](e,a,t,r,i);if(u){let c=e.$_createError(u.code,t,u.context,r,i);if(i.abortEarly)return{value:t,errors:c};s.push(c)}}return{value:t,errors:s}},rules:{and:{method(...t){return an.verifyFlat(t,"and"),de.dependency(this,"and",null,t)}},append:{method(t){return t==null||Object.keys(t).length===0?this:this.keys(t)}},assert:{method(t,e,n){td.isTemplate(t)||(t=Zb.ref(t)),rr(n===void 0||typeof n=="string","Message must be a string"),e=this.$_compile(e,{appendPath:!0});let r=this.$_addRule({name:"assert",args:{subject:t,schema:e,message:n}});return r.$_mutateRegister(t),r.$_mutateRegister(e),r},validate(t,{error:e,prefs:n,state:r},{subject:i,schema:s,message:o}){let a=i.resolve(t,r,n),u=a1.isRef(i)?i.absolute(r):[];return s.$_match(a,r.localize(u,[t,...r.ancestors],s),n)?t:e("object.assert",{subject:i,message:o})},args:["subject","schema","message"],multi:!0},instance:{method(t,e){return rr(typeof t=="function","constructor must be a function"),e=e||t.name,this.$_addRule({name:"instance",args:{constructor:t,name:e}})},validate(t,e,{constructor:n,name:r}){return t instanceof n?t:e.error("object.instance",{type:r,value:t})},args:["constructor","name"]},keys:{method(t){rr(t===void 0||typeof t=="object","Object schema must be a valid object"),rr(!an.isSchema(t),"Object schema cannot be a joi schema");let e=this.clone();if(!t)e.$_terms.keys=null;else if(!Object.keys(t).length)e.$_terms.keys=new de.Keys;else{e.$_terms.keys=e.$_terms.keys?e.$_terms.keys.filter(n=>!t.hasOwnProperty(n.key)):new de.Keys;for(let n in t)an.tryWithPath(()=>e.$_terms.keys.push({key:n,schema:this.$_compile(t[n])}),n)}return e.$_mutateRebuild()}},length:{method(t){return this.$_addRule({name:"length",args:{limit:t},operator:"="})},validate(t,e,{limit:n},{name:r,operator:i,args:s}){return an.compare(Object.keys(t).length,n,i)?t:e.error("object."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:an.limit,message:"must be a positive integer"}]},max:{method(t){return this.$_addRule({name:"max",method:"length",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"length",args:{limit:t},operator:">="})}},nand:{method(...t){return an.verifyFlat(t,"nand"),de.dependency(this,"nand",null,t)}},or:{method(...t){return an.verifyFlat(t,"or"),de.dependency(this,"or",null,t)}},oxor:{method(...t){return de.dependency(this,"oxor",null,t)}},pattern:{method(t,e,n={}){let r=t instanceof RegExp;r||(t=this.$_compile(t,{appendPath:!0})),rr(e!==void 0,"Invalid rule"),an.assertOptions(n,["fallthrough","matches"]),r&&rr(!t.flags.includes("g")&&!t.flags.includes("y"),"pattern should not use global or sticky mode"),e=this.$_compile(e,{appendPath:!0});let i=this.clone();i.$_terms.patterns=i.$_terms.patterns||[];let s={[r?"regex":"schema"]:t,rule:e};return n.matches&&(s.matches=this.$_compile(n.matches),s.matches.type!=="array"&&(s.matches=s.matches.$_root.array().items(s.matches)),i.$_mutateRegister(s.matches),i.$_setFlag("_hasPatternMatch",!0,{clone:!1})),n.fallthrough&&(s.fallthrough=!0),i.$_terms.patterns.push(s),i.$_mutateRegister(e),i}},ref:{method(){return this.$_addRule("ref")},validate(t,e){return a1.isRef(t)?t:e.error("object.refType",{value:t})}},regex:{method(){return this.$_addRule("regex")},validate(t,e){return t instanceof RegExp?t:e.error("object.regex",{value:t})}},rename:{method(t,e,n={}){rr(typeof t=="string"||t instanceof RegExp,"Rename missing the from argument"),rr(typeof e=="string"||e instanceof td,"Invalid rename to argument"),rr(e!==t,"Cannot rename key to same name:",t),an.assertOptions(n,["alias","ignoreUndefined","override","multiple"]);let r=this.clone();r.$_terms.renames=r.$_terms.renames||[];for(let i of r.$_terms.renames)rr(i.from!==t,"Cannot rename the same key multiple times");return e instanceof td&&r.$_mutateRegister(e),r.$_terms.renames.push({from:t,to:e,options:Yq(de.renameDefaults,n)}),r}},schema:{method(t="any"){return this.$_addRule({name:"schema",args:{type:t}})},validate(t,e,{type:n}){return an.isSchema(t)&&(n==="any"||t.type===n)?t:e.error("object.schema",{type:n})}},unknown:{method(t){return this.$_setFlag("unknown",t!==!1)}},with:{method(t,e,n={}){return de.dependency(this,"with",t,e,n)}},without:{method(t,e,n={}){return de.dependency(this,"without",t,e,n)}},xor:{method(...t){return an.verifyFlat(t,"xor"),de.dependency(this,"xor",null,t)}}},overrides:{default(t,e){return t===void 0&&(t=an.symbols.deepDefault),this.$_parent("default",t,e)}},rebuild(t){if(t.$_terms.keys){let e=new Jq.Sorter;for(let n of t.$_terms.keys)an.tryWithPath(()=>e.add(n,{after:n.schema.$_rootReferences(),group:n.key}),n.key);t.$_terms.keys=new de.Keys(...e.nodes)}},manifest:{build(t,e){if(e.keys&&(t=t.keys(e.keys)),e.dependencies)for(let{rel:n,key:r=null,peers:i,options:s}of e.dependencies)t=de.dependency(t,n,r,i,s);if(e.patterns)for(let{regex:n,schema:r,rule:i,fallthrough:s,matches:o}of e.patterns)t=t.pattern(n||r,i,{fallthrough:s,matches:o});if(e.renames)for(let{from:n,to:r,options:i}of e.renames)t=t.rename(n,r,i);return t}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}});de.clone=function(t,e){if(typeof t=="object"){if(e.nonEnumerables)return o1(t,{shallow:!0});let r=Object.create(Object.getPrototypeOf(t));return Object.assign(r,t),r}let n=function(...r){return t.apply(this,r)};return n.prototype=o1(t.prototype),Object.defineProperty(n,"name",{value:t.name,writable:!1}),Object.defineProperty(n,"length",{value:t.length,writable:!1}),Object.assign(n,t),n};de.dependency=function(t,e,n,r,i){rr(n===null||typeof n=="string",e,"key must be a strings"),i||(i=r.length>1&&typeof r[r.length-1]=="object"?r.pop():{}),an.assertOptions(i,["separator","isPresent"]),r=[].concat(r);let s=an.default(i.separator,"."),o=[];for(let u of r)rr(typeof u=="string",e,"peers must be strings"),o.push(Zb.ref(u,{separator:s,ancestor:0,prefix:!1}));n!==null&&(n=Zb.ref(n,{separator:s,ancestor:0,prefix:!1}));let a=t.clone();return a.$_terms.dependencies=a.$_terms.dependencies||[],a.$_terms.dependencies.push(new de.Dependency(e,n,o,r,i)),a};de.dependencies={and(t,e,n,r,i){let s=[],o=[],a=e.peers.length,u=de.isPresent(e.options);for(let c of e.peers)u(c.resolve(n,r,i,null,{shadow:!1}))===!1?s.push(c.key):o.push(c.key);if(s.length!==a&&o.length!==a)return{code:"object.and",context:{present:o,presentWithLabels:de.keysToLabels(t,o),missing:s,missingWithLabels:de.keysToLabels(t,s)}}},nand(t,e,n,r,i){let s=[],o=de.isPresent(e.options);for(let c of e.peers)o(c.resolve(n,r,i,null,{shadow:!1}))&&s.push(c.key);if(s.length!==e.peers.length)return;let a=e.paths[0],u=e.paths.slice(1);return{code:"object.nand",context:{main:a,mainWithLabel:de.keysToLabels(t,a),peers:u,peersWithLabels:de.keysToLabels(t,u)}}},or(t,e,n,r,i){let s=de.isPresent(e.options);for(let o of e.peers)if(s(o.resolve(n,r,i,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:e.paths,peersWithLabels:de.keysToLabels(t,e.paths)}}},oxor(t,e,n,r,i){let s=[],o=de.isPresent(e.options);for(let u of e.peers)o(u.resolve(n,r,i,null,{shadow:!1}))&&s.push(u.key);if(!s.length||s.length===1)return;let a={peers:e.paths,peersWithLabels:de.keysToLabels(t,e.paths)};return a.present=s,a.presentWithLabels=de.keysToLabels(t,s),{code:"object.oxor",context:a}},with(t,e,n,r,i){let s=de.isPresent(e.options);for(let o of e.peers)if(s(o.resolve(n,r,i,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:e.key.key,mainWithLabel:de.keysToLabels(t,e.key.key),peer:o.key,peerWithLabel:de.keysToLabels(t,o.key)}}},without(t,e,n,r,i){let s=de.isPresent(e.options);for(let o of e.peers)if(s(o.resolve(n,r,i,null,{shadow:!1})))return{code:"object.without",context:{main:e.key.key,mainWithLabel:de.keysToLabels(t,e.key.key),peer:o.key,peerWithLabel:de.keysToLabels(t,o.key)}}},xor(t,e,n,r,i){let s=[],o=de.isPresent(e.options);for(let u of e.peers)o(u.resolve(n,r,i,null,{shadow:!1}))&&s.push(u.key);if(s.length===1)return;let a={peers:e.paths,peersWithLabels:de.keysToLabels(t,e.paths)};return s.length===0?{code:"object.missing",context:a}:(a.present=s,a.presentWithLabels=de.keysToLabels(t,s),{code:"object.xor",context:a})}};de.keysToLabels=function(t,e){return Array.isArray(e)?e.map(n=>t.$_mapLabels(n)):t.$_mapLabels(e)};de.isPresent=function(t){return typeof t.isPresent=="function"?t.isPresent:e=>e!==void 0};de.rename=function(t,e,n,r,i){let s={};for(let o of t.$_terms.renames){let a=[],u=typeof o.from!="string";if(!u)Object.prototype.hasOwnProperty.call(e,o.from)&&(e[o.from]!==void 0||!o.options.ignoreUndefined)&&a.push(o);else for(let c in e){if(e[c]===void 0&&o.options.ignoreUndefined||c===o.to)continue;let l=o.from.exec(c);l&&a.push({from:c,to:o.to,match:l})}for(let c of a){let l=c.from,h=c.to;if(h instanceof td&&(h=h.render(e,n,r,c.match)),l!==h){if(!o.options.multiple&&s[h]&&(i.push(t.$_createError("object.rename.multiple",e,{from:l,to:h,pattern:u},n,r)),r.abortEarly)||Object.prototype.hasOwnProperty.call(e,h)&&!o.options.override&&!s[h]&&(i.push(t.$_createError("object.rename.override",e,{from:l,to:h,pattern:u},n,r)),r.abortEarly))return!1;e[l]===void 0?delete e[h]:e[h]=e[l],s[h]=!0,o.options.alias||delete e[l]}}}return!0};de.unknown=function(t,e,n,r,i,s){if(t.$_terms.patterns){let a=!1,u=t.$_terms.patterns.map(l=>{if(l.matches)return a=!0,[]}),c=[e,...i.ancestors];for(let l of n){let h=e[l],d=[...i.path,l];for(let g=0;g<t.$_terms.patterns.length;++g){let y=t.$_terms.patterns[g];if(y.regex){let k=y.regex.test(l);if(i.mainstay.tracer.debug(i,"rule",`pattern.${g}`,k?"pass":"error"),!k)continue}else if(!y.schema.$_match(l,i.nest(y.schema,`pattern.${g}`),s))continue;n.delete(l);let _=i.localize(d,c,{schema:y.rule,key:l}),C=y.rule.$_validate(h,_,s);if(C.errors){if(s.abortEarly)return{value:e,errors:C.errors};r.push(...C.errors)}if(y.matches&&u[g].push(l),e[l]=C.value,!y.fallthrough)break}}if(a)for(let l=0;l<u.length;++l){let h=u[l];if(!h)continue;let d=t.$_terms.patterns[l].matches,g=i.localize(i.path,c,d),y=d.$_validate(h,g,s);if(y.errors){let _=Zq.details(y.errors,{override:!1});_.matches=h;let C=t.$_createError("object.pattern.match",e,_,i,s);if(s.abortEarly)return{value:e,errors:C};r.push(C)}}}if(!n.size||!t.$_terms.keys&&!t.$_terms.patterns)return;if(s.stripUnknown&&typeof t._flags.unknown>"u"||s.skipFunctions){let a=s.stripUnknown?s.stripUnknown===!0?!0:!!s.stripUnknown.objects:!1;for(let u of n)a?(delete e[u],n.delete(u)):typeof e[u]=="function"&&n.delete(u)}if(!an.default(t._flags.unknown,s.allowUnknown))for(let a of n){let u=i.localize([...i.path,a],[]),c=t.$_createError("object.unknown",e[a],{child:a},u,s,{flags:!1});if(s.abortEarly)return{value:e,errors:c};r.push(c)}};de.Dependency=class{constructor(t,e,n,r,i){this.rel=t,this.key=e,this.peers=n,this.paths=r,this.options=i}describe(){let t={rel:this.rel,peers:this.paths};return this.key!==null&&(t.key=this.key.key),this.peers[0].separator!=="."&&(t.options={...t.options,separator:this.peers[0].separator}),this.options.isPresent&&(t.options={...t.options,isPresent:this.options.isPresent}),t}};de.Keys=class extends Array{concat(t){let e=this.slice(),n=new Map;for(let r=0;r<e.length;++r)n.set(e[r].key,r);for(let r of t){let i=r.key,s=n.get(i);s!==void 0?e[s]={key:i,schema:e[s].schema.concat(r.schema)}:e.push(r)}return e}}});var l1=m((Oz,c1)=>{"use strict";var t_=Le(),ej=e_();c1.exports=ej.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(t){return t_(Number.isSafeInteger(t)&&t>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:t}})},validate(t,e,{n}){return t.length===n?t:e.error("function.arity",{n})}},class:{method(){return this.$_addRule("class")},validate(t,e){return/^\s*class\s/.test(t.toString())?t:e.error("function.class",{value:t})}},minArity:{method(t){return t_(Number.isSafeInteger(t)&&t>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:t}})},validate(t,e,{n}){return t.length>=n?t:e.error("function.minArity",{n})}},maxArity:{method(t){return t_(Number.isSafeInteger(t)&&t>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:t}})},validate(t,e,{n}){return t.length<=n?t:e.error("function.maxArity",{n})}}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})});var d1=m((Rz,h1)=>{"use strict";var gi=Le(),tj=tr(),nj=Ze(),rj=Cs(),ij=li(),mi={};h1.exports=tj.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args(t,e){return t.ref(e)},validate(t,{schema:e,state:n,prefs:r}){gi(e.$_terms.link,"Uninitialized link schema");let i=mi.generate(e,t,n,r),s=e.$_terms.link[0].ref;return i.$_validate(t,n.nest(i,`link:${s.display}:${i.type}`),r)},generate(t,e,n,r){return mi.generate(t,e,n,r)},rules:{ref:{method(t){gi(!this.$_terms.link,"Cannot reinitialize schema"),t=rj.ref(t),gi(t.type==="value"||t.type==="local","Invalid reference type:",t.type),gi(t.type==="local"||t.ancestor==="root"||t.ancestor>0,"Link cannot reference itself");let e=this.clone();return e.$_terms.link=[{ref:t}],e}},relative:{method(t=!0){return this.$_setFlag("relative",t)}}},overrides:{concat(t){gi(this.$_terms.link,"Uninitialized link schema"),gi(nj.isSchema(t),"Invalid schema object"),gi(t.type!=="link","Cannot merge type link with another link");let e=this.clone();return e.$_terms.whens||(e.$_terms.whens=[]),e.$_terms.whens.push({concat:t}),e.$_mutateRebuild()}},manifest:{build(t,e){return gi(e.link,"Invalid link description missing link"),t.ref(e.link)}}});mi.generate=function(t,e,n,r){let i=n.mainstay.links.get(t);if(i)return i._generate(e,n,r).schema;let s=t.$_terms.link[0].ref,{perspective:o,path:a}=mi.perspective(s,n);mi.assert(o,"which is outside of schema boundaries",s,t,n,r);try{i=a.length?o.$_reach(a):o}catch{mi.assert(!1,"to non-existing schema",s,t,n,r)}return mi.assert(i.type!=="link","which is another link",s,t,n,r),t._flags.relative||n.mainstay.links.set(t,i),i._generate(e,n,r).schema};mi.perspective=function(t,e){if(t.type==="local"){for(let{schema:n,key:r}of e.schemas){if((n._flags.id||r)===t.path[0])return{perspective:n,path:t.path.slice(1)};if(n.$_terms.shared){for(let s of n.$_terms.shared)if(s._flags.id===t.path[0])return{perspective:s,path:t.path.slice(1)}}}return{perspective:null,path:null}}return t.ancestor==="root"?{perspective:e.schemas[e.schemas.length-1].schema,path:t.path}:{perspective:e.schemas[t.ancestor]&&e.schemas[t.ancestor].schema,path:t.path}};mi.assert=function(t,e,n,r,i,s){t||gi(!1,`"${ij.label(r._flags,i,s)}" contains link reference "${n.display}" ${e}`)}});var p1=m((Pz,f1)=>{"use strict";var n_=Le(),sj=tr(),r_=Ze(),qn={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(t){let e=t.toString(),n=e.indexOf("."),r=e.indexOf("e");return(n<0?0:(r<0?e.length:r)-n-1)+(r<0?0:Math.max(0,-parseInt(e.slice(r+1))))}};f1.exports=sj.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(t,{schema:e,error:n}){if(!t.match(qn.numberRx))return;t=t.trim();let i={value:parseFloat(t)};if(i.value===0&&(i.value=0),!e._flags.unsafe)if(t.match(/e/i)){if(qn.extractSignificantDigits(t)!==qn.extractSignificantDigits(String(i.value)))return i.errors=n("number.unsafe"),i}else{let s=i.value.toString();if(s.match(/e/i))return i;if(s!==qn.normalizeDecimal(t))return i.errors=n("number.unsafe"),i}return i}},validate(t,{schema:e,error:n,prefs:r}){if(t===1/0||t===-1/0)return{value:t,errors:n("number.infinity")};if(!r_.isNumber(t))return{value:t,errors:n("number.base")};let i={value:t};if(r.convert){let s=e.$_getRule("precision");if(s){let o=Math.pow(10,s.args.limit);i.value=Math.round(i.value*o)/o}}return i.value===0&&(i.value=0),!e._flags.unsafe&&(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER)&&(i.errors=n("number.unsafe")),i},rules:{compare:{method:!1,validate(t,e,{limit:n},{name:r,operator:i,args:s}){return r_.compare(t,n,i)?t:e.error("number."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:r_.isNumber,message:"must be a number"}]},greater:{method(t){return this.$_addRule({name:"greater",method:"compare",args:{limit:t},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate(t,e){return Math.trunc(t)-t===0?t:e.error("number.integer")}},less:{method(t){return this.$_addRule({name:"less",method:"compare",args:{limit:t},operator:"<"})}},max:{method(t){return this.$_addRule({name:"max",method:"compare",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"compare",args:{limit:t},operator:">="})}},multiple:{method(t){let e=typeof t=="number"?qn.decimalPlaces(t):null,n=Math.pow(10,e);return this.$_addRule({name:"multiple",args:{base:t,baseDecimalPlace:e,pfactor:n}})},validate(t,e,{base:n,baseDecimalPlace:r,pfactor:i},s){return qn.decimalPlaces(t)>r?e.error("number.multiple",{multiple:s.args.base,value:t}):Math.round(i*t)%Math.round(i*n)===0?t:e.error("number.multiple",{multiple:s.args.base,value:t})},args:[{name:"base",ref:!0,assert:t=>typeof t=="number"&&isFinite(t)&&t>0,message:"must be a positive number"},"baseDecimalPlace","pfactor"],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate(t,e){return Number.isSafeInteger(t)&&t>=0&&t<=65535?t:e.error("number.port")}},positive:{method(){return this.sign("positive")}},precision:{method(t){return n_(Number.isSafeInteger(t),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:t}})},validate(t,e,{limit:n}){let r=t.toString().match(qn.precisionRx);return Math.max((r[1]?r[1].length:0)-(r[2]?parseInt(r[2],10):0),0)<=n?t:e.error("number.precision",{limit:n,value:t})},convert:!0},sign:{method(t){return n_(["negative","positive"].includes(t),"Invalid sign",t),this.$_addRule({name:"sign",args:{sign:t}})},validate(t,e,{sign:n}){return n==="negative"&&t<0||n==="positive"&&t>0?t:e.error(`number.${n}`)}},unsafe:{method(t=!0){return n_(typeof t=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",t)}}},cast:{string:{from:t=>typeof t=="number",to(t,e){return t.toString()}}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}});qn.extractSignificantDigits=function(t){return t.replace(qn.exponentialPartRegex,"").replace(qn.dotRegex,"").replace(qn.trailingZerosRegex,"").replace(qn.leadingSignAndZerosRegex,"")};qn.normalizeDecimal=function(t){return t=t.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2"),t.includes(".")&&t.endsWith("0")&&(t=t.replace(/0+$/,"")),t==="-0"?"0":t}});var m1=m((Dz,g1)=>{"use strict";var oj=e_();g1.exports=oj.extend({type:"object",cast:{map:{from:t=>t&&typeof t=="object",to(t,e){return new Map(Object.entries(t))}}}})});var i_=m(nd=>{"use strict";nd.codes={EMPTY_STRING:"Address must be a non-empty string",FORBIDDEN_UNICODE:"Address contains forbidden Unicode characters",MULTIPLE_AT_CHAR:"Address cannot contain more than one @ character",MISSING_AT_CHAR:"Address must contain one @ character",EMPTY_LOCAL:"Address local part cannot be empty",ADDRESS_TOO_LONG:"Address too long",LOCAL_TOO_LONG:"Address local part too long",EMPTY_LOCAL_SEGMENT:"Address local part contains empty dot-separated segment",INVALID_LOCAL_CHARS:"Address local part contains invalid character",DOMAIN_NON_EMPTY_STRING:"Domain must be a non-empty string",DOMAIN_TOO_LONG:"Domain too long",DOMAIN_INVALID_UNICODE_CHARS:"Domain contains forbidden Unicode characters",DOMAIN_INVALID_CHARS:"Domain contains invalid character",DOMAIN_INVALID_TLDS_CHARS:"Domain contains invalid tld character",DOMAIN_SEGMENTS_COUNT:"Domain lacks the minimum required number of segments",DOMAIN_SEGMENTS_COUNT_MAX:"Domain contains too many segments",DOMAIN_FORBIDDEN_TLDS:"Domain uses forbidden TLD",DOMAIN_EMPTY_SEGMENT:"Domain contains empty dot-separated segment",DOMAIN_LONG_SEGMENT:"Domain contains dot-separated segment that is too long"};nd.code=function(t){return{code:t,error:nd.codes[t]}}});var s_=m(rd=>{"use strict";var aj=require("url"),xr=i_(),Ji={minDomainSegments:2,nonAsciiRx:/[^\x00-\x7f]/,domainControlRx:/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,tldSegmentRx:/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,domainSegmentRx:/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,URL:aj.URL||URL};rd.analyze=function(t,e={}){if(!t)return xr.code("DOMAIN_NON_EMPTY_STRING");if(typeof t!="string")throw new Error("Invalid input: domain must be a string");if(t.length>256)return xr.code("DOMAIN_TOO_LONG");if(!!Ji.nonAsciiRx.test(t)){if(e.allowUnicode===!1)return xr.code("DOMAIN_INVALID_UNICODE_CHARS");t=t.normalize("NFC")}if(Ji.domainControlRx.test(t))return xr.code("DOMAIN_INVALID_CHARS");t=Ji.punycode(t),e.allowFullyQualified&&t[t.length-1]==="."&&(t=t.slice(0,-1));let r=e.minDomainSegments||Ji.minDomainSegments,i=t.split(".");if(i.length<r)return xr.code("DOMAIN_SEGMENTS_COUNT");if(e.maxDomainSegments&&i.length>e.maxDomainSegments)return xr.code("DOMAIN_SEGMENTS_COUNT_MAX");let s=e.tlds;if(s){let o=i[i.length-1].toLowerCase();if(s.deny&&s.deny.has(o)||s.allow&&!s.allow.has(o))return xr.code("DOMAIN_FORBIDDEN_TLDS")}for(let o=0;o<i.length;++o){let a=i[o];if(!a.length)return xr.code("DOMAIN_EMPTY_SEGMENT");if(a.length>63)return xr.code("DOMAIN_LONG_SEGMENT");if(o<i.length-1){if(!Ji.domainSegmentRx.test(a))return xr.code("DOMAIN_INVALID_CHARS")}else if(!Ji.tldSegmentRx.test(a))return xr.code("DOMAIN_INVALID_TLDS_CHARS")}return null};rd.isValid=function(t,e){return!rd.analyze(t,e)};Ji.punycode=function(t){t.includes("%")&&(t=t.replace(/%/g,"%25"));try{return new Ji.URL(`http://${t}`).host}catch{return t}}});var y1=m(o_=>{"use strict";var uj=require("util"),cj=s_(),zr=i_(),pn={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(uj.TextEncoder||TextEncoder)};o_.analyze=function(t,e){return pn.email(t,e)};o_.isValid=function(t,e){return!pn.email(t,e)};pn.email=function(t,e={}){if(typeof t!="string")throw new Error("Invalid input: email must be a string");if(!t)return zr.code("EMPTY_STRING");let n=!pn.nonAsciiRx.test(t);if(!n){if(e.allowUnicode===!1)return zr.code("FORBIDDEN_UNICODE");t=t.normalize("NFC")}let r=t.split("@");if(r.length!==2)return r.length>2?zr.code("MULTIPLE_AT_CHAR"):zr.code("MISSING_AT_CHAR");let[i,s]=r;if(!i)return zr.code("EMPTY_LOCAL");if(!e.ignoreLength){if(t.length>254)return zr.code("ADDRESS_TOO_LONG");if(pn.encoder.encode(i).length>64)return zr.code("LOCAL_TOO_LONG")}return pn.local(i,n)||cj.analyze(s,e)};pn.local=function(t,e){let n=t.split(".");for(let r of n){if(!r.length)return zr.code("EMPTY_LOCAL_SEGMENT");if(e){if(!pn.atextRx.test(r))return zr.code("INVALID_LOCAL_CHARS");continue}for(let i of r){if(pn.atextRx.test(i))continue;let s=pn.binary(i);if(!pn.atomRx.test(s))return zr.code("INVALID_LOCAL_CHARS")}}};pn.binary=function(t){return Array.from(pn.encoder.encode(t)).map(e=>String.fromCharCode(e)).join("")};pn.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/;pn.atomRx=new RegExp(["(?:[\\xc2-\\xdf][\\x80-\\xbf])","(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})","(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"].join("|"))});var a_=m((Nz,b1)=>{"use strict";b1.exports=function(t){return t.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}});var c_=m(u_=>{"use strict";var id=Le(),lj=a_(),Jt={};Jt.generate=function(){let t={},e="\\dA-Fa-f",n="["+e+"]",r="\\w-\\.~",i="!\\$&'\\(\\)\\*\\+,;=",s="%"+e,o=r+s+i+":@",a="["+o+"]",u="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";t.ipv4address="(?:"+u+"\\.){3}"+u;let c=n+"{1,4}",l="(?:"+c+":"+c+"|"+t.ipv4address+")",h="(?:"+c+":){6}"+l,d="::(?:"+c+":){5}"+l,g="(?:"+c+")?::(?:"+c+":){4}"+l,y="(?:(?:"+c+":){0,1}"+c+")?::(?:"+c+":){3}"+l,_="(?:(?:"+c+":){0,2}"+c+")?::(?:"+c+":){2}"+l,C="(?:(?:"+c+":){0,3}"+c+")?::"+c+":"+l,k="(?:(?:"+c+":){0,4}"+c+")?::"+l,T="(?:(?:"+c+":){0,5}"+c+")?::"+c,w="(?:(?:"+c+":){0,6}"+c+")?::";t.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",t.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",t.ipv6address="(?:"+h+"|"+d+"|"+g+"|"+y+"|"+_+"|"+C+"|"+k+"|"+T+"|"+w+")",t.ipvFuture="v"+n+"+\\.["+r+i+":]+",t.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",t.schemeRegex=new RegExp(t.scheme);let v="["+r+s+i+":]*",L="\\[(?:"+t.ipv6address+"|"+t.ipvFuture+")\\]",R="["+r+s+i+"]{1,255}",W="(?:"+L+"|"+t.ipv4address+"|"+R+")",ne="\\d*",se="(?:"+v+"@)?"+W+"(?::"+ne+")?",U="(?:"+v+"@)?("+W+")(?::"+ne+")?",O=a+"*",M=a+"+",N="["+r+s+i+"@]+",j="",fe="(?:\\/"+O+")*",he="\\/(?:"+M+fe+")?",jt=M+fe,_t=N+fe,$e="(?:\\/\\/\\/"+O+fe+")";return t.hierPart="(?:(?:\\/\\/"+se+fe+")|"+he+"|"+jt+"|"+$e+")",t.hierPartCapture="(?:(?:\\/\\/"+U+fe+")|"+he+"|"+jt+")",t.relativeRef="(?:(?:\\/\\/"+se+fe+")|"+he+"|"+_t+"|"+j+")",t.relativeRefCapture="(?:(?:\\/\\/"+U+fe+")|"+he+"|"+_t+"|"+j+")",t.query="["+o+"\\/\\?]*(?=#|$)",t.queryWithSquareBrackets="["+o+"\\[\\]\\/\\?]*(?=#|$)",t.fragment="["+o+"\\/\\?]*",t};Jt.rfc3986=Jt.generate();u_.ip={v4Cidr:Jt.rfc3986.ipv4Cidr,v6Cidr:Jt.rfc3986.ipv6Cidr,ipv4:Jt.rfc3986.ipv4address,ipv6:Jt.rfc3986.ipv6address,ipvfuture:Jt.rfc3986.ipvFuture};Jt.createRegex=function(t){let e=Jt.rfc3986,r="(?:\\?"+(t.allowQuerySquareBrackets?e.queryWithSquareBrackets:e.query)+")?(?:#"+e.fragment+")?",i=t.domain?e.relativeRefCapture:e.relativeRef;if(t.relativeOnly)return Jt.wrap(i+r);let s="";if(t.scheme){id(t.scheme instanceof RegExp||typeof t.scheme=="string"||Array.isArray(t.scheme),"scheme must be a RegExp, String, or Array");let c=[].concat(t.scheme);id(c.length>=1,"scheme must have at least 1 scheme specified");let l=[];for(let h=0;h<c.length;++h){let d=c[h];id(d instanceof RegExp||typeof d=="string","scheme at position "+h+" must be a RegExp or String"),d instanceof RegExp?l.push(d.source.toString()):(id(e.schemeRegex.test(d),"scheme at position "+h+" must be a valid scheme"),l.push(lj(d)))}s=l.join("|")}let a="(?:"+(s?"(?:"+s+")":e.scheme)+":"+(t.domain?e.hierPartCapture:e.hierPart)+")",u=t.allowRelative?"(?:"+a+"|"+i+")":a;return Jt.wrap(u+r,s)};Jt.wrap=function(t,e){return t=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${t}`,{raw:t,regex:new RegExp(`^${t}$`),scheme:e}};Jt.uriRegex=Jt.createRegex({});u_.regex=function(t={}){return t.scheme||t.allowRelative||t.relativeOnly||t.allowQuerySquareBrackets||t.domain?Jt.createRegex(t):Jt.uriRegex}});var v1=m(_1=>{"use strict";var Wo=Le(),Su=c_();_1.regex=function(t={}){Wo(t.cidr===void 0||typeof t.cidr=="string","options.cidr must be a string");let e=t.cidr?t.cidr.toLowerCase():"optional";Wo(["required","optional","forbidden"].includes(e),"options.cidr must be one of required, optional, forbidden"),Wo(t.version===void 0||typeof t.version=="string"||Array.isArray(t.version),"options.version must be a string or an array of string");let n=t.version||["ipv4","ipv6","ipvfuture"];Array.isArray(n)||(n=[n]),Wo(n.length>=1,"options.version must have at least 1 version specified");for(let o=0;o<n.length;++o)Wo(typeof n[o]=="string","options.version must only contain strings"),n[o]=n[o].toLowerCase(),Wo(["ipv4","ipv6","ipvfuture"].includes(n[o]),"options.version contains unknown version "+n[o]+" - must be one of ipv4, ipv6, ipvfuture");n=Array.from(new Set(n));let i=`(?:${n.map(o=>{if(e==="forbidden")return Su.ip[o];let a=`\\/${o==="ipv4"?Su.ip.v4Cidr:Su.ip.v6Cidr}`;return e==="required"?`${Su.ip[o]}${a}`:`${Su.ip[o]}(?:${a})?`}).join("|")})`,s=new RegExp(`^${i}$`);return{cidr:e,versions:n,regex:s,raw:i}}});var T1=m((Fz,w1)=>{"use strict";var S1={};S1.tlds=["AAA","AARP","ABB","ABBOTT","ABBVIE","ABC","ABLE","ABOGADO","ABUDHABI","AC","ACADEMY","ACCENTURE","ACCOUNTANT","ACCOUNTANTS","ACO","ACTOR","AD","ADS","ADULT","AE","AEG","AERO","AETNA","AF","AFL","AFRICA","AG","AGAKHAN","AGENCY","AI","AIG","AIRBUS","AIRFORCE","AIRTEL","AKDN","AL","ALIBABA","ALIPAY","ALLFINANZ","ALLSTATE","ALLY","ALSACE","ALSTOM","AM","AMAZON","AMERICANEXPRESS","AMERICANFAMILY","AMEX","AMFAM","AMICA","AMSTERDAM","ANALYTICS","ANDROID","ANQUAN","ANZ","AO","AOL","APARTMENTS","APP","APPLE","AQ","AQUARELLE","AR","ARAB","ARAMCO","ARCHI","ARMY","ARPA","ART","ARTE","AS","ASDA","ASIA","ASSOCIATES","AT","ATHLETA","ATTORNEY","AU","AUCTION","AUDI","AUDIBLE","AUDIO","AUSPOST","AUTHOR","AUTO","AUTOS","AVIANCA","AW","AWS","AX","AXA","AZ","AZURE","BA","BABY","BAIDU","BANAMEX","BAND","BANK","BAR","BARCELONA","BARCLAYCARD","BARCLAYS","BAREFOOT","BARGAINS","BASEBALL","BASKETBALL","BAUHAUS","BAYERN","BB","BBC","BBT","BBVA","BCG","BCN","BD","BE","BEATS","BEAUTY","BEER","BENTLEY","BERLIN","BEST","BESTBUY","BET","BF","BG","BH","BHARTI","BI","BIBLE","BID","BIKE","BING","BINGO","BIO","BIZ","BJ","BLACK","BLACKFRIDAY","BLOCKBUSTER","BLOG","BLOOMBERG","BLUE","BM","BMS","BMW","BN","BNPPARIBAS","BO","BOATS","BOEHRINGER","BOFA","BOM","BOND","BOO","BOOK","BOOKING","BOSCH","BOSTIK","BOSTON","BOT","BOUTIQUE","BOX","BR","BRADESCO","BRIDGESTONE","BROADWAY","BROKER","BROTHER","BRUSSELS","BS","BT","BUILD","BUILDERS","BUSINESS","BUY","BUZZ","BV","BW","BY","BZ","BZH","CA","CAB","CAFE","CAL","CALL","CALVINKLEIN","CAM","CAMERA","CAMP","CANON","CAPETOWN","CAPITAL","CAPITALONE","CAR","CARAVAN","CARDS","CARE","CAREER","CAREERS","CARS","CASA","CASE","CASH","CASINO","CAT","CATERING","CATHOLIC","CBA","CBN","CBRE","CC","CD","CENTER","CEO","CERN","CF","CFA","CFD","CG","CH","CHANEL","CHANNEL","CHARITY","CHASE","CHAT","CHEAP","CHINTAI","CHRISTMAS","CHROME","CHURCH","CI","CIPRIANI","CIRCLE","CISCO","CITADEL","CITI","CITIC","CITY","CK","CL","CLAIMS","CLEANING","CLICK","CLINIC","CLINIQUE","CLOTHING","CLOUD","CLUB","CLUBMED","CM","CN","CO","COACH","CODES","COFFEE","COLLEGE","COLOGNE","COM","COMCAST","COMMBANK","COMMUNITY","COMPANY","COMPARE","COMPUTER","COMSEC","CONDOS","CONSTRUCTION","CONSULTING","CONTACT","CONTRACTORS","COOKING","COOL","COOP","CORSICA","COUNTRY","COUPON","COUPONS","COURSES","CPA","CR","CREDIT","CREDITCARD","CREDITUNION","CRICKET","CROWN","CRS","CRUISE","CRUISES","CU","CUISINELLA","CV","CW","CX","CY","CYMRU","CYOU","CZ","DABUR","DAD","DANCE","DATA","DATE","DATING","DATSUN","DAY","DCLK","DDS","DE","DEAL","DEALER","DEALS","DEGREE","DELIVERY","DELL","DELOITTE","DELTA","DEMOCRAT","DENTAL","DENTIST","DESI","DESIGN","DEV","DHL","DIAMONDS","DIET","DIGITAL","DIRECT","DIRECTORY","DISCOUNT","DISCOVER","DISH","DIY","DJ","DK","DM","DNP","DO","DOCS","DOCTOR","DOG","DOMAINS","DOT","DOWNLOAD","DRIVE","DTV","DUBAI","DUNLOP","DUPONT","DURBAN","DVAG","DVR","DZ","EARTH","EAT","EC","ECO","EDEKA","EDU","EDUCATION","EE","EG","EMAIL","EMERCK","ENERGY","ENGINEER","ENGINEERING","ENTERPRISES","EPSON","EQUIPMENT","ER","ERICSSON","ERNI","ES","ESQ","ESTATE","ET","EU","EUROVISION","EUS","EVENTS","EXCHANGE","EXPERT","EXPOSED","EXPRESS","EXTRASPACE","FAGE","FAIL","FAIRWINDS","FAITH","FAMILY","FAN","FANS","FARM","FARMERS","FASHION","FAST","FEDEX","FEEDBACK","FERRARI","FERRERO","FI","FIDELITY","FIDO","FILM","FINAL","FINANCE","FINANCIAL","FIRE","FIRESTONE","FIRMDALE","FISH","FISHING","FIT","FITNESS","FJ","FK","FLICKR","FLIGHTS","FLIR","FLORIST","FLOWERS","FLY","FM","FO","FOO","FOOD","FOOTBALL","FORD","FOREX","FORSALE","FORUM","FOUNDATION","FOX","FR","FREE","FRESENIUS","FRL","FROGANS","FRONTIER","FTR","FUJITSU","FUN","FUND","FURNITURE","FUTBOL","FYI","GA","GAL","GALLERY","GALLO","GALLUP","GAME","GAMES","GAP","GARDEN","GAY","GB","GBIZ","GD","GDN","GE","GEA","GENT","GENTING","GEORGE","GF","GG","GGEE","GH","GI","GIFT","GIFTS","GIVES","GIVING","GL","GLASS","GLE","GLOBAL","GLOBO","GM","GMAIL","GMBH","GMO","GMX","GN","GODADDY","GOLD","GOLDPOINT","GOLF","GOO","GOODYEAR","GOOG","GOOGLE","GOP","GOT","GOV","GP","GQ","GR","GRAINGER","GRAPHICS","GRATIS","GREEN","GRIPE","GROCERY","GROUP","GS","GT","GU","GUARDIAN","GUCCI","GUGE","GUIDE","GUITARS","GURU","GW","GY","HAIR","HAMBURG","HANGOUT","HAUS","HBO","HDFC","HDFCBANK","HEALTH","HEALTHCARE","HELP","HELSINKI","HERE","HERMES","HIPHOP","HISAMITSU","HITACHI","HIV","HK","HKT","HM","HN","HOCKEY","HOLDINGS","HOLIDAY","HOMEDEPOT","HOMEGOODS","HOMES","HOMESENSE","HONDA","HORSE","HOSPITAL","HOST","HOSTING","HOT","HOTELS","HOTMAIL","HOUSE","HOW","HR","HSBC","HT","HU","HUGHES","HYATT","HYUNDAI","IBM","ICBC","ICE","ICU","ID","IE","IEEE","IFM","IKANO","IL","IM","IMAMAT","IMDB","IMMO","IMMOBILIEN","IN","INC","INDUSTRIES","INFINITI","INFO","ING","INK","INSTITUTE","INSURANCE","INSURE","INT","INTERNATIONAL","INTUIT","INVESTMENTS","IO","IPIRANGA","IQ","IR","IRISH","IS","ISMAILI","IST","ISTANBUL","IT","ITAU","ITV","JAGUAR","JAVA","JCB","JE","JEEP","JETZT","JEWELRY","JIO","JLL","JM","JMP","JNJ","JO","JOBS","JOBURG","JOT","JOY","JP","JPMORGAN","JPRS","JUEGOS","JUNIPER","KAUFEN","KDDI","KE","KERRYHOTELS","KERRYLOGISTICS","KERRYPROPERTIES","KFH","KG","KH","KI","KIA","KIDS","KIM","KINDLE","KITCHEN","KIWI","KM","KN","KOELN","KOMATSU","KOSHER","KP","KPMG","KPN","KR","KRD","KRED","KUOKGROUP","KW","KY","KYOTO","KZ","LA","LACAIXA","LAMBORGHINI","LAMER","LANCASTER","LAND","LANDROVER","LANXESS","LASALLE","LAT","LATINO","LATROBE","LAW","LAWYER","LB","LC","LDS","LEASE","LECLERC","LEFRAK","LEGAL","LEGO","LEXUS","LGBT","LI","LIDL","LIFE","LIFEINSURANCE","LIFESTYLE","LIGHTING","LIKE","LILLY","LIMITED","LIMO","LINCOLN","LINK","LIPSY","LIVE","LIVING","LK","LLC","LLP","LOAN","LOANS","LOCKER","LOCUS","LOL","LONDON","LOTTE","LOTTO","LOVE","LPL","LPLFINANCIAL","LR","LS","LT","LTD","LTDA","LU","LUNDBECK","LUXE","LUXURY","LV","LY","MA","MADRID","MAIF","MAISON","MAKEUP","MAN","MANAGEMENT","MANGO","MAP","MARKET","MARKETING","MARKETS","MARRIOTT","MARSHALLS","MATTEL","MBA","MC","MCKINSEY","MD","ME","MED","MEDIA","MEET","MELBOURNE","MEME","MEMORIAL","MEN","MENU","MERCKMSD","MG","MH","MIAMI","MICROSOFT","MIL","MINI","MINT","MIT","MITSUBISHI","MK","ML","MLB","MLS","MM","MMA","MN","MO","MOBI","MOBILE","MODA","MOE","MOI","MOM","MONASH","MONEY","MONSTER","MORMON","MORTGAGE","MOSCOW","MOTO","MOTORCYCLES","MOV","MOVIE","MP","MQ","MR","MS","MSD","MT","MTN","MTR","MU","MUSEUM","MUSIC","MV","MW","MX","MY","MZ","NA","NAB","NAGOYA","NAME","NATURA","NAVY","NBA","NC","NE","NEC","NET","NETBANK","NETFLIX","NETWORK","NEUSTAR","NEW","NEWS","NEXT","NEXTDIRECT","NEXUS","NF","NFL","NG","NGO","NHK","NI","NICO","NIKE","NIKON","NINJA","NISSAN","NISSAY","NL","NO","NOKIA","NORTON","NOW","NOWRUZ","NOWTV","NP","NR","NRA","NRW","NTT","NU","NYC","NZ","OBI","OBSERVER","OFFICE","OKINAWA","OLAYAN","OLAYANGROUP","OLLO","OM","OMEGA","ONE","ONG","ONL","ONLINE","OOO","OPEN","ORACLE","ORANGE","ORG","ORGANIC","ORIGINS","OSAKA","OTSUKA","OTT","OVH","PA","PAGE","PANASONIC","PARIS","PARS","PARTNERS","PARTS","PARTY","PAY","PCCW","PE","PET","PF","PFIZER","PG","PH","PHARMACY","PHD","PHILIPS","PHONE","PHOTO","PHOTOGRAPHY","PHOTOS","PHYSIO","PICS","PICTET","PICTURES","PID","PIN","PING","PINK","PIONEER","PIZZA","PK","PL","PLACE","PLAY","PLAYSTATION","PLUMBING","PLUS","PM","PN","PNC","POHL","POKER","POLITIE","PORN","POST","PR","PRAMERICA","PRAXI","PRESS","PRIME","PRO","PROD","PRODUCTIONS","PROF","PROGRESSIVE","PROMO","PROPERTIES","PROPERTY","PROTECTION","PRU","PRUDENTIAL","PS","PT","PUB","PW","PWC","PY","QA","QPON","QUEBEC","QUEST","RACING","RADIO","RE","READ","REALESTATE","REALTOR","REALTY","RECIPES","RED","REDSTONE","REDUMBRELLA","REHAB","REISE","REISEN","REIT","RELIANCE","REN","RENT","RENTALS","REPAIR","REPORT","REPUBLICAN","REST","RESTAURANT","REVIEW","REVIEWS","REXROTH","RICH","RICHARDLI","RICOH","RIL","RIO","RIP","RO","ROCKS","RODEO","ROGERS","ROOM","RS","RSVP","RU","RUGBY","RUHR","RUN","RW","RWE","RYUKYU","SA","SAARLAND","SAFE","SAFETY","SAKURA","SALE","SALON","SAMSCLUB","SAMSUNG","SANDVIK","SANDVIKCOROMANT","SANOFI","SAP","SARL","SAS","SAVE","SAXO","SB","SBI","SBS","SC","SCB","SCHAEFFLER","SCHMIDT","SCHOLARSHIPS","SCHOOL","SCHULE","SCHWARZ","SCIENCE","SCOT","SD","SE","SEARCH","SEAT","SECURE","SECURITY","SEEK","SELECT","SENER","SERVICES","SEVEN","SEW","SEX","SEXY","SFR","SG","SH","SHANGRILA","SHARP","SHAW","SHELL","SHIA","SHIKSHA","SHOES","SHOP","SHOPPING","SHOUJI","SHOW","SI","SILK","SINA","SINGLES","SITE","SJ","SK","SKI","SKIN","SKY","SKYPE","SL","SLING","SM","SMART","SMILE","SN","SNCF","SO","SOCCER","SOCIAL","SOFTBANK","SOFTWARE","SOHU","SOLAR","SOLUTIONS","SONG","SONY","SOY","SPA","SPACE","SPORT","SPOT","SR","SRL","SS","ST","STADA","STAPLES","STAR","STATEBANK","STATEFARM","STC","STCGROUP","STOCKHOLM","STORAGE","STORE","STREAM","STUDIO","STUDY","STYLE","SU","SUCKS","SUPPLIES","SUPPLY","SUPPORT","SURF","SURGERY","SUZUKI","SV","SWATCH","SWISS","SX","SY","SYDNEY","SYSTEMS","SZ","TAB","TAIPEI","TALK","TAOBAO","TARGET","TATAMOTORS","TATAR","TATTOO","TAX","TAXI","TC","TCI","TD","TDK","TEAM","TECH","TECHNOLOGY","TEL","TEMASEK","TENNIS","TEVA","TF","TG","TH","THD","THEATER","THEATRE","TIAA","TICKETS","TIENDA","TIPS","TIRES","TIROL","TJ","TJMAXX","TJX","TK","TKMAXX","TL","TM","TMALL","TN","TO","TODAY","TOKYO","TOOLS","TOP","TORAY","TOSHIBA","TOTAL","TOURS","TOWN","TOYOTA","TOYS","TR","TRADE","TRADING","TRAINING","TRAVEL","TRAVELERS","TRAVELERSINSURANCE","TRUST","TRV","TT","TUBE","TUI","TUNES","TUSHU","TV","TVS","TW","TZ","UA","UBANK","UBS","UG","UK","UNICOM","UNIVERSITY","UNO","UOL","UPS","US","UY","UZ","VA","VACATIONS","VANA","VANGUARD","VC","VE","VEGAS","VENTURES","VERISIGN","VERSICHERUNG","VET","VG","VI","VIAJES","VIDEO","VIG","VIKING","VILLAS","VIN","VIP","VIRGIN","VISA","VISION","VIVA","VIVO","VLAANDEREN","VN","VODKA","VOLVO","VOTE","VOTING","VOTO","VOYAGE","VU","WALES","WALMART","WALTER","WANG","WANGGOU","WATCH","WATCHES","WEATHER","WEATHERCHANNEL","WEBCAM","WEBER","WEBSITE","WED","WEDDING","WEIBO","WEIR","WF","WHOSWHO","WIEN","WIKI","WILLIAMHILL","WIN","WINDOWS","WINE","WINNERS","WME","WOLTERSKLUWER","WOODSIDE","WORK","WORKS","WORLD","WOW","WS","WTC","WTF","XBOX","XEROX","XFINITY","XIHUAN","XIN","XN--11B4C3D","XN--1CK2E1B","XN--1QQW23A","XN--2SCRJ9C","XN--30RR7Y","XN--3BST00M","XN--3DS443G","XN--3E0B707E","XN--3HCRJ9C","XN--3PXU8K","XN--42C2D9A","XN--45BR5CYL","XN--45BRJ9C","XN--45Q11C","XN--4DBRK0CE","XN--4GBRIM","XN--54B7FTA0CC","XN--55QW42G","XN--55QX5D","XN--5SU34J936BGSG","XN--5TZM5G","XN--6FRZ82G","XN--6QQ986B3XL","XN--80ADXHKS","XN--80AO21A","XN--80AQECDR1A","XN--80ASEHDB","XN--80ASWG","XN--8Y0A063A","XN--90A3AC","XN--90AE","XN--90AIS","XN--9DBQ2A","XN--9ET52U","XN--9KRT00A","XN--B4W605FERD","XN--BCK1B9A5DRE4C","XN--C1AVG","XN--C2BR7G","XN--CCK2B3B","XN--CCKWCXETD","XN--CG4BKI","XN--CLCHC0EA0B2G2A9GCD","XN--CZR694B","XN--CZRS0T","XN--CZRU2D","XN--D1ACJ3B","XN--D1ALF","XN--E1A4C","XN--ECKVDTC9D","XN--EFVY88H","XN--FCT429K","XN--FHBEI","XN--FIQ228C5HS","XN--FIQ64B","XN--FIQS8S","XN--FIQZ9S","XN--FJQ720A","XN--FLW351E","XN--FPCRJ9C3D","XN--FZC2C9E2C","XN--FZYS8D69UVGM","XN--G2XX48C","XN--GCKR3F0F","XN--GECRJ9C","XN--GK3AT1E","XN--H2BREG3EVE","XN--H2BRJ9C","XN--H2BRJ9C8C","XN--HXT814E","XN--I1B6B1A6A2E","XN--IMR513N","XN--IO0A7I","XN--J1AEF","XN--J1AMH","XN--J6W193G","XN--JLQ480N2RG","XN--JVR189M","XN--KCRX77D1X4A","XN--KPRW13D","XN--KPRY57D","XN--KPUT3I","XN--L1ACC","XN--LGBBAT1AD8J","XN--MGB9AWBF","XN--MGBA3A3EJT","XN--MGBA3A4F16A","XN--MGBA7C0BBN0A","XN--MGBAAM7A8H","XN--MGBAB2BD","XN--MGBAH1A3HJKRD","XN--MGBAI9AZGQP6J","XN--MGBAYH7GPA","XN--MGBBH1A","XN--MGBBH1A71E","XN--MGBC0A9AZCG","XN--MGBCA7DZDO","XN--MGBCPQ6GPA1A","XN--MGBERP4A5D4AR","XN--MGBGU82A","XN--MGBI4ECEXP","XN--MGBPL2FH","XN--MGBT3DHD","XN--MGBTX2B","XN--MGBX4CD0AB","XN--MIX891F","XN--MK1BU44C","XN--MXTQ1M","XN--NGBC5AZD","XN--NGBE9E0A","XN--NGBRX","XN--NODE","XN--NQV7F","XN--NQV7FS00EMA","XN--NYQY26A","XN--O3CW4H","XN--OGBPF8FL","XN--OTU796D","XN--P1ACF","XN--P1AI","XN--PGBS0DH","XN--PSSY2U","XN--Q7CE6A","XN--Q9JYB4C","XN--QCKA1PMC","XN--QXA6A","XN--QXAM","XN--RHQV96G","XN--ROVU88B","XN--RVC1E0AM3E","XN--S9BRJ9C","XN--SES554G","XN--T60B56A","XN--TCKWE","XN--TIQ49XQYJ","XN--UNUP4Y","XN--VERMGENSBERATER-CTB","XN--VERMGENSBERATUNG-PWB","XN--VHQUV","XN--VUQ861B","XN--W4R85EL8FHU5DNRA","XN--W4RS40L","XN--WGBH1C","XN--WGBL6A","XN--XHQ521B","XN--XKC2AL3HYE2A","XN--XKC2DL3A5EE0H","XN--Y9A3AQ","XN--YFRO4I67O","XN--YGBI2AMMX","XN--ZFR164B","XXX","XYZ","YACHTS","YAHOO","YAMAXUN","YANDEX","YE","YODOBASHI","YOGA","YOKOHAMA","YOU","YOUTUBE","YT","YUN","ZA","ZAPPOS","ZARA","ZERO","ZIP","ZM","ZONE","ZUERICH","ZW"];w1.exports=new Set(S1.tlds.map(t=>t.toLowerCase()))});var C1=m(($z,A1)=>{"use strict";var We=Le(),sd=s_(),hj=y1(),k1=v1(),E1=a_(),x1=T1(),dj=c_(),fj=tr(),gn=Ze(),De={tlds:x1 instanceof Set?{tlds:{allow:x1,deny:null}}:!1,base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:{withPrefix:/^0x[0-9a-f]+$/i,withOptionalPrefix:/^(?:0x)?[0-9a-f]+$/i,withoutPrefix:/^[0-9a-f]+$/i},ipRegex:k1.regex({cidr:"forbidden"}).regex,isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5",uuidv6:"6",uuidv7:"7",uuidv8:"8"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};A1.exports=fj.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(t,{schema:e,state:n,prefs:r}){let i=e.$_getRule("normalize");i&&(t=t.normalize(i.args.form));let s=e.$_getRule("case");s&&(t=s.args.direction==="upper"?t.toLocaleUpperCase():t.toLocaleLowerCase());let o=e.$_getRule("trim");if(o&&o.args.enabled&&(t=t.trim()),e.$_terms.replacements)for(let u of e.$_terms.replacements)t=t.replace(u.pattern,u.replacement);let a=e.$_getRule("hex");if(a&&a.args.options.byteAligned&&t.length%2!==0&&(t=`0${t}`),e.$_getRule("isoDate")){let u=De.isoDate(t);u&&(t=u)}if(e._flags.truncate){let u=e.$_getRule("max");if(u){let c=u.args.limit;if(gn.isResolvable(c)&&(c=c.resolve(t,n,r),!gn.limit(c)))return{value:t,errors:e.$_createError("any.ref",c,{ref:u.args.limit,arg:"limit",reason:"must be a positive integer"},n,r)};t=t.slice(0,c)}}return{value:t}}},validate(t,{schema:e,error:n}){if(typeof t!="string")return{value:t,errors:n("string.base")};if(t===""){let r=e.$_getRule("min");return r&&r.args.limit===0?void 0:{value:t,errors:n("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate(t,e){return/^[a-zA-Z0-9]+$/.test(t)?t:e.error("string.alphanum")}},base64:{method(t={}){return gn.assertOptions(t,["paddingRequired","urlSafe"]),t={urlSafe:!1,paddingRequired:!0,...t},We(typeof t.paddingRequired=="boolean","paddingRequired must be boolean"),We(typeof t.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:t}})},validate(t,e,{options:n}){return De.base64Regex[n.paddingRequired][n.urlSafe].test(t)?t:e.error("string.base64")}},case:{method(t){return We(["lower","upper"].includes(t),"Invalid case:",t),this.$_addRule({name:"case",args:{direction:t}})},validate(t,e,{direction:n}){return n==="lower"&&t===t.toLocaleLowerCase()||n==="upper"&&t===t.toLocaleUpperCase()?t:e.error(`string.${n}case`)},convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(t,e){let n=t.length,r=0,i=1;for(;n--;){let s=t.charAt(n)*i;r=r+(s-(s>9)*9),i=i^3}return r>0&&r%10===0?t:e.error("string.creditCard")}},dataUri:{method(t={}){return gn.assertOptions(t,["paddingRequired"]),t={paddingRequired:!0,...t},We(typeof t.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:t}})},validate(t,e,{options:n}){let r=t.match(De.dataUriRegex);return r&&(!r[2]||r[2]!=="base64"||De.base64Regex[n.paddingRequired].false.test(r[3]))?t:e.error("string.dataUri")}},domain:{method(t){t&&gn.assertOptions(t,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);let e=De.addressOptions(t);return this.$_addRule({name:"domain",args:{options:t},address:e})},validate(t,e,n,{address:r}){return sd.isValid(t,r)?t:e.error("string.domain")}},email:{method(t={}){gn.assertOptions(t,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),We(t.multiple===void 0||typeof t.multiple=="boolean","multiple option must be an boolean");let e=De.addressOptions(t),n=new RegExp(`\\s*[${t.separator?E1(t.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:t},regex:n,address:e})},validate(t,e,{options:n},{regex:r,address:i}){let s=n.multiple?t.split(r):[t],o=[];for(let a of s)hj.isValid(a,i)||o.push(a);return o.length?e.error("string.email",{value:t,invalids:o}):t}},guid:{alias:"uuid",method(t={}){gn.assertOptions(t,["version","separator"]);let e="";if(t.version){let i=[].concat(t.version);We(i.length>=1,"version must have at least 1 valid version specified");let s=new Set;for(let o=0;o<i.length;++o){let a=i[o];We(typeof a=="string","version at position "+o+" must be a string");let u=De.guidVersions[a.toLowerCase()];We(u,"version at position "+o+" must be one of "+Object.keys(De.guidVersions).join(", ")),We(!s.has(u),"version at position "+o+" must not be a duplicate"),e+=u,s.add(u)}}We(De.guidSeparators.has(t.separator),'separator must be one of true, false, "-", or ":"');let n=t.separator===void 0?"[:-]?":t.separator===!0?"[:-]":t.separator===!1?"[]?":`\\${t.separator}`,r=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${n})[0-9A-F]{4}\\2?[${e||"0-9A-F"}][0-9A-F]{3}\\2?[${e?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:t},regex:r})},validate(t,e,n,{regex:r}){let i=r.exec(t);return!i||De.guidBrackets[i[1]]!==i[i.length-1]?e.error("string.guid"):t}},hex:{method(t={}){return gn.assertOptions(t,["byteAligned","prefix"]),t={byteAligned:!1,prefix:!1,...t},We(typeof t.byteAligned=="boolean","byteAligned must be boolean"),We(typeof t.prefix=="boolean"||t.prefix==="optional",'prefix must be boolean or "optional"'),this.$_addRule({name:"hex",args:{options:t}})},validate(t,e,{options:n}){return(n.prefix==="optional"?De.hexRegex.withOptionalPrefix:n.prefix===!0?De.hexRegex.withPrefix:De.hexRegex.withoutPrefix).test(t)?n.byteAligned&&t.length%2!==0?e.error("string.hexAlign"):t:e.error("string.hex")}},hostname:{method(){return this.$_addRule("hostname")},validate(t,e){return sd.isValid(t,{minDomainSegments:1})||De.ipRegex.test(t)?t:e.error("string.hostname")}},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(t={}){gn.assertOptions(t,["cidr","version"]);let{cidr:e,versions:n,regex:r}=k1.regex(t),i=t.version?n:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:e,version:i}},regex:r})},validate(t,e,{options:n},{regex:r}){return r.test(t)?t:n.version?e.error("string.ipVersion",{value:t,cidr:n.cidr,version:n.version}):e.error("string.ip",{value:t,cidr:n.cidr})}},isoDate:{method(){return this.$_addRule("isoDate")},validate(t,{error:e}){return De.isoDate(t)?t:e("string.isoDate")}},isoDuration:{method(){return this.$_addRule("isoDuration")},validate(t,e){return De.isoDurationRegex.test(t)?t:e.error("string.isoDuration")}},length:{method(t,e){return De.length(this,"length",t,"=",e)},validate(t,e,{limit:n,encoding:r},{name:i,operator:s,args:o}){let a=r?Buffer&&Buffer.byteLength(t,r):t.length;return gn.compare(a,n,s)?t:e.error("string."+i,{limit:o.limit,value:t,encoding:r})},args:[{name:"limit",ref:!0,assert:gn.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(t,e){return De.length(this,"max",t,"<=",e)},args:["limit","encoding"]},min:{method(t,e){return De.length(this,"min",t,">=",e)},args:["limit","encoding"]},normalize:{method(t="NFC"){return We(De.normalizationForms.includes(t),"normalization form must be one of "+De.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:t}})},validate(t,{error:e},{form:n}){return t===t.normalize(n)?t:e("string.normalize",{value:t,form:n})},convert:!0},pattern:{alias:"regex",method(t,e={}){We(t instanceof RegExp,"regex must be a RegExp"),We(!t.flags.includes("g")&&!t.flags.includes("y"),"regex should not use global or sticky mode"),typeof e=="string"&&(e={name:e}),gn.assertOptions(e,["invert","name"]);let n=["string.pattern",e.invert?".invert":"",e.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:t,options:e},errorCode:n})},validate(t,e,{regex:n,options:r},{errorCode:i}){return n.test(t)^r.invert?t:e.error(i,{name:r.name,regex:n,value:t})},args:["regex","options"],multi:!0},replace:{method(t,e){typeof t=="string"&&(t=new RegExp(E1(t),"g")),We(t instanceof RegExp,"pattern must be a RegExp"),We(typeof e=="string","replacement must be a String");let n=this.clone();return n.$_terms.replacements||(n.$_terms.replacements=[]),n.$_terms.replacements.push({pattern:t,replacement:e}),n}},token:{method(){return this.$_addRule("token")},validate(t,e){return/^\w+$/.test(t)?t:e.error("string.token")}},trim:{method(t=!0){return We(typeof t=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:t}})},validate(t,e,{enabled:n}){return!n||t===t.trim()?t:e.error("string.trim")},convert:!0},truncate:{method(t=!0){return We(typeof t=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",t)}},uppercase:{method(){return this.case("upper")}},uri:{method(t={}){gn.assertOptions(t,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),t.domain&&gn.assertOptions(t.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);let{regex:e,scheme:n}=dj.regex(t),r=t.domain?De.addressOptions(t.domain):null;return this.$_addRule({name:"uri",args:{options:t},regex:e,domain:r,scheme:n})},validate(t,e,{options:n},{regex:r,domain:i,scheme:s}){if(["http:/","https:/"].includes(t))return e.error("string.uri");let o=r.exec(t);if(!o&&e.prefs.convert&&n.encodeUri){let a=encodeURI(t);o=r.exec(a),o&&(t=a)}if(o){let a=o[1]||o[2];return i&&(!n.allowRelative||a)&&!sd.isValid(a,i)?e.error("string.domain",{value:a}):t}return n.relativeOnly?e.error("string.uriRelativeOnly"):n.scheme?e.error("string.uriCustomScheme",{scheme:s,value:t}):e.error("string.uri")}}},manifest:{build(t,e){if(e.replacements)for(let{pattern:n,replacement:r}of e.replacements)t=t.replace(n,r);return t}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}});De.addressOptions=function(t){if(!t)return De.tlds||t;if(We(t.minDomainSegments===void 0||Number.isSafeInteger(t.minDomainSegments)&&t.minDomainSegments>0,"minDomainSegments must be a positive integer"),We(t.maxDomainSegments===void 0||Number.isSafeInteger(t.maxDomainSegments)&&t.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),t.tlds===!1)return t;if(t.tlds===!0||t.tlds===void 0)return We(De.tlds,"Built-in TLD list disabled"),Object.assign({},t,De.tlds);We(typeof t.tlds=="object","tlds must be true, false, or an object");let e=t.tlds.deny;if(e)return Array.isArray(e)&&(t=Object.assign({},t,{tlds:{deny:new Set(e)}})),We(t.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),We(!t.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),De.validateTlds(t.tlds.deny,"tlds.deny"),t;let n=t.tlds.allow;return n?n===!0?(We(De.tlds,"Built-in TLD list disabled"),Object.assign({},t,De.tlds)):(Array.isArray(n)&&(t=Object.assign({},t,{tlds:{allow:new Set(n)}})),We(t.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),De.validateTlds(t.tlds.allow,"tlds.allow"),t):t};De.validateTlds=function(t,e){for(let n of t)We(sd.isValid(n,{minDomainSegments:1,maxDomainSegments:1}),`${e} must contain valid top level domain names`)};De.isoDate=function(t){if(!gn.isIsoDate(t))return null;/.*T.*[+-]\d\d$/.test(t)&&(t+="00");let e=new Date(t);return isNaN(e.getTime())?null:e.toISOString()};De.length=function(t,e,n,r,i){return We(!i||Buffer&&Buffer.isEncoding(i),"Invalid encoding:",i),t.$_addRule({name:e,method:"length",args:{limit:n,encoding:i},operator:r})}});var R1=m((Bz,O1)=>{"use strict";var od=Le(),pj=tr(),l_={};l_.Map=class extends Map{slice(){return new l_.Map(this)}};O1.exports=pj.extend({type:"symbol",terms:{map:{init:new l_.Map}},coerce:{method(t,{schema:e,error:n}){let r=e.$_terms.map.get(t);return r&&(t=r),!e._flags.only||typeof t=="symbol"?{value:t}:{value:t,errors:n("symbol.map",{map:e.$_terms.map})}}},validate(t,{error:e}){if(typeof t!="symbol")return{value:t,errors:e("symbol.base")}},rules:{map:{method(t){t&&!t[Symbol.iterator]&&typeof t=="object"&&(t=Object.entries(t)),od(t&&t[Symbol.iterator],"Iterable must be an iterable or object");let e=this.clone(),n=[];for(let r of t){od(r&&r[Symbol.iterator],"Entry must be an iterable");let[i,s]=r;od(typeof i!="object"&&typeof i!="function"&&typeof i!="symbol","Key must not be of type object, function, or Symbol"),od(typeof s=="symbol","Value must be a Symbol"),e.$_terms.map.set(i,s),n.push(s)}return e.valid(...n)}}},manifest:{build(t,e){return e.map&&(t=t.map(e.map)),t}},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})});var I1=m((Uz,D1)=>{"use strict";var gj=Le(),mj=tr(),P1=Ze();D1.exports=mj.extend({type:"binary",coerce:{from:["string","object"],method(t,{schema:e}){if(typeof t=="string"||t!==null&&t.type==="Buffer")try{return{value:Buffer.from(t,e._flags.encoding)}}catch{}}},validate(t,{error:e}){if(!Buffer.isBuffer(t))return{value:t,errors:e("binary.base")}},rules:{encoding:{method(t){return gj(Buffer.isEncoding(t),"Invalid encoding:",t),this.$_setFlag("encoding",t)}},length:{method(t){return this.$_addRule({name:"length",method:"length",args:{limit:t},operator:"="})},validate(t,e,{limit:n},{name:r,operator:i,args:s}){return P1.compare(t.length,n,i)?t:e.error("binary."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:P1.limit,message:"must be a positive integer"}]},max:{method(t){return this.$_addRule({name:"max",method:"length",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"length",args:{limit:t},operator:">="})}}},cast:{string:{from:t=>Buffer.isBuffer(t),to(t,e){return t.toString()}}},messages:{"binary.base":"{{#label}} must be a buffer or a string","binary.length":"{{#label}} must be {{#limit}} bytes","binary.max":"{{#label}} must be less than or equal to {{#limit}} bytes","binary.min":"{{#label}} must be at least {{#limit}} bytes"}})});var Uh=m((Hz,q1)=>{"use strict";var Is=Le(),yj=dn(),bj=Fb(),Ds=Ze(),_j=Cs(),d_=li(),vj=$b(),M1=Ub(),h_=hi(),L1=Vi(),N1=Gb(),ad,Mt={types:{alternatives:$A(),any:tr(),array:WA(),boolean:KA(),date:JA(),function:l1(),link:d1(),number:p1(),object:m1(),string:C1(),symbol:R1()},aliases:{alt:"alternatives",bool:"boolean",func:"function"}};Buffer&&(Mt.types.binary=I1());Mt.root=function(){let t={_types:new Set(Object.keys(Mt.types))};for(let e of t._types)t[e]=function(...n){return Is(!n.length||["alternatives","link","object"].includes(e),"The",e,"type does not allow arguments"),Mt.generate(this,Mt.types[e],n)};for(let e of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])t[e]=function(...n){return this.any()[e](...n)};Object.assign(t,Mt.methods);for(let e in Mt.aliases){let n=Mt.aliases[e];t[e]=t[n]}return t.x=t.expression,N1.setup&&N1.setup(t),t};Mt.methods={ValidationError:d_.ValidationError,version:Ds.version,cache:bj.provider,assert(t,e,...n){Mt.assert(t,e,!0,n)},attempt(t,e,...n){return Mt.assert(t,e,!1,n)},build(t){return Is(typeof M1.build=="function","Manifest functionality disabled"),M1.build(this,t)},checkPreferences(t){Ds.checkPreferences(t)},compile(t,e){return _j.compile(this,t,e)},defaults(t){Is(typeof t=="function","modifier must be a function");let e=Object.assign({},this);for(let n of e._types){let r=t(e[n]());Is(Ds.isSchema(r),"modifier must return a valid schema object"),e[n]=function(...i){return Mt.generate(this,r,i)}}return e},expression(...t){return new L1(...t)},extend(...t){Ds.verifyFlat(t,"extend"),ad=ad||Wh(),Is(t.length,"You need to provide at least one extension"),this.assert(t,ad.extensions);let e=Object.assign({},this);e._types=new Set(e._types);for(let n of t){typeof n=="function"&&(n=n(e)),this.assert(n,ad.extension);let r=Mt.expandExtension(n,e);for(let i of r){Is(e[i.type]===void 0||e._types.has(i.type),"Cannot override name",i.type);let s=i.base||this.any(),o=vj.type(s,i);e._types.add(i.type),e[i.type]=function(...a){return Mt.generate(this,o,a)}}}return e},isError:d_.ValidationError.isError,isExpression:L1.isTemplate,isRef:h_.isRef,isSchema:Ds.isSchema,in(...t){return h_.in(...t)},override:Ds.symbols.override,ref(...t){return h_.create(...t)},types(){let t={};for(let e of this._types)t[e]=this[e]();for(let e in Mt.aliases)t[e]=this[e]();return t}};Mt.assert=function(t,e,n,r){let i=r[0]instanceof Error||typeof r[0]=="string"?r[0]:null,s=i!==null?r[1]:r[0],o=e.validate(t,Ds.preferences({errors:{stack:!0}},s||{})),a=o.error;if(!a)return o.value;if(i instanceof Error)throw i;let u=n&&typeof a.annotate=="function"?a.annotate():a.message;throw a instanceof d_.ValidationError||(a=yj(a)),a.message=i?`${i} ${u}`:u,a};Mt.generate=function(t,e,n){return Is(t,"Must be invoked on a Joi instance."),e.$_root=t,!e._definition.args||!n.length?e:e._definition.args(e,...n)};Mt.expandExtension=function(t,e){if(typeof t.type=="string")return[t];let n=[];for(let r of e._types)if(t.type.test(r)){let i=Object.assign({},t);i.type=r,i.base=e[r](),n.push(i)}return n};q1.exports=Mt.root()});var j1=m(Se=>{"use strict";var Sj=Se&&Se.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Se,"__esModule",{value:!0});Se.descriptionContainerSchema=Se.signatureSchema=Se.signatureDefinitionContainerSchema=Se.signatureDefinitionSchema=Se.signatureDefinitionFunctionSchema=Se.signatureDefinitionFunctionSchemaArg=Se.signatureDefinitionFunctionSchemaArgMultiTypes=Se.signatureDefinitionFunctionSchemaArgDefaultNumber=Se.signatureDefinitionFunctionSchemaArgDefaultString=Se.signatureDefinitionTypeSchema=Se.variationsSchema=void 0;var oe=Sj(Uh()),ud=Hi();Se.variationsSchema=oe.default.array().items(oe.default.alternatives(oe.default.string(),oe.default.number()));Se.signatureDefinitionTypeSchema=oe.default.alternatives(oe.default.string(),oe.default.object({type:oe.default.string().required(),keyType:oe.default.link("#SignatureDefinitionTypeSchema").optional(),valueType:oe.default.link("#SignatureDefinitionTypeSchema").optional()})).id("SignatureDefinitionTypeSchema");Se.signatureDefinitionFunctionSchemaArgDefaultString=oe.default.object({type:oe.default.string().valid(ud.SignatureDefinitionBaseType.String).required(),value:oe.default.string().allow("").required()});Se.signatureDefinitionFunctionSchemaArgDefaultNumber=oe.default.object({type:oe.default.string().valid(ud.SignatureDefinitionBaseType.Number).required(),value:oe.default.number().required()});Se.signatureDefinitionFunctionSchemaArgMultiTypes=oe.default.object({label:oe.default.string().required(),types:oe.default.array().items(Se.signatureDefinitionTypeSchema).required(),opt:oe.default.boolean().optional(),default:oe.default.alternatives(Se.signatureDefinitionFunctionSchemaArgDefaultString,Se.signatureDefinitionFunctionSchemaArgDefaultNumber).optional()});Se.signatureDefinitionFunctionSchemaArg=oe.default.object({label:oe.default.string().required(),type:Se.signatureDefinitionTypeSchema.required(),opt:oe.default.boolean().optional(),default:oe.default.alternatives(Se.signatureDefinitionFunctionSchemaArgDefaultString,Se.signatureDefinitionFunctionSchemaArgDefaultNumber).optional()});Se.signatureDefinitionFunctionSchema=oe.default.object({type:oe.default.string().valid(ud.SignatureDefinitionBaseType.Function).required(),description:oe.default.string().optional(),example:oe.default.string().optional(),isProtected:oe.default.boolean().optional(),arguments:oe.default.array().items(oe.default.alternatives(Se.signatureDefinitionFunctionSchemaArg,Se.signatureDefinitionFunctionSchemaArgMultiTypes)).optional(),returns:oe.default.array().items(Se.signatureDefinitionTypeSchema).required(),variations:Se.variationsSchema.optional(),returnVariations:Se.variationsSchema.optional()});Se.signatureDefinitionSchema=oe.default.object({type:Se.signatureDefinitionTypeSchema.invalid(ud.SignatureDefinitionBaseType.Function).required(),description:oe.default.string().optional(),example:oe.default.string().optional(),isProtected:oe.default.boolean().optional(),variations:Se.variationsSchema.optional()});Se.signatureDefinitionContainerSchema=oe.default.object().pattern(oe.default.string(),oe.default.alternatives(Se.signatureDefinitionFunctionSchema,Se.signatureDefinitionSchema));Se.signatureSchema=oe.default.object({type:oe.default.string().required(),hidden:oe.default.boolean().optional(),extends:oe.default.string().optional(),definitions:oe.default.object().required()});Se.descriptionContainerSchema=oe.default.object({$meta:oe.default.object({description:oe.default.string().required(),example:oe.default.array().items(oe.default.string().allow("")).optional()}).optional()}).pattern(oe.default.string(),oe.default.object({description:oe.default.string().required(),example:oe.default.array().items(oe.default.string().allow("")).optional()}))});var m_=m(xn=>{"use strict";var Uo=xn&&xn.__assign||function(){return Uo=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Uo.apply(this,arguments)},wj=xn&&xn.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},Qi=xn&&xn.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},f_=xn&&xn.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},Tj=xn&&xn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xn,"__esModule",{value:!0});xn.Signature=void 0;var p_=Tj(Uh()),g_=j1(),Ej=Hi(),xj=$h(),kj=Pb(),Aj=function(){function t(e){var n,r,i;this._type=e.type,this._extends=(n=e.extends)!==null&&n!==void 0?n:null,this._descriptions={},this._definitions=(r=e.definitions)!==null&&r!==void 0?r:{},this._hidden=(i=e.hidden)!==null&&i!==void 0?i:!1}return t.parseDefinitions=function(e){var n,r;p_.default.assert(e,g_.signatureDefinitionContainerSchema);var i={};try{for(var s=Qi(Object.entries(e)),o=s.next();!o.done;o=s.next()){var a=f_(o.value,2),u=a[0],c=a[1],l=c.type===Ej.SignatureDefinitionBaseType.Function?kj.SignatureDefinitionFunction.parse(c):xj.SignatureDefinition.parse(c);i[u]=l}}catch(h){n={error:h}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return i},t.parseDescriptions=function(e){var n,r,i,s,o;p_.default.assert(e,g_.descriptionContainerSchema);var a=e,u=null;if(a.$meta){var c=e.$meta,l=wj(e,["$meta"]);u=c,a=l}var h={};try{for(var d=Qi(Object.entries(a)),g=d.next();!g.done;g=d.next()){var y=f_(g.value,2),_=y[0],C=y[1];h[_]={description:C.description,example:(i=C.example)!==null&&i!==void 0?i:null}}}catch(k){n={error:k}}finally{try{g&&!g.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}return Uo({$meta:{description:(s=u?.description)!==null&&s!==void 0?s:"unknown",example:(o=u?.example)!==null&&o!==void 0?o:null}},h)},t.parse=function(e,n){var r,i;p_.default.assert(e,g_.signatureSchema);var s=new t({type:e.type,hidden:e.hidden,extends:e.extends}),o=t.parseDefinitions(e.definitions);if(s.setDefinition(o),n!=null)try{for(var a=Qi(Object.entries(n)),u=a.next();!u.done;u=a.next()){var c=f_(u.value,2),l=c[0],h=c[1],d=t.parseDescriptions(h);s.addDescriptions(l,d)}}catch(g){r={error:g}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return s},t.prototype.getType=function(){return this._type},t.prototype.getExtendedType=function(){return this._extends},t.prototype.getDefinitions=function(){return this._definitions},t.prototype.getAllDescriptions=function(){return this._descriptions},t.prototype.isHidden=function(){return this._hidden},t.prototype.setExtend=function(e){return this._extends=e,this},t.prototype.setDefinition=function(e){return this._definitions=e,this},t.prototype.mergeDefinitions=function(e){var n,r,i=Object.keys(e);try{for(var s=Qi(i),o=s.next();!o.done;o=s.next()){var a=o.value;this._definitions[a]=e[a]}}catch(u){n={error:u}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return this},t.prototype.getDefinition=function(e,n){if(!Object.prototype.hasOwnProperty.call(this._definitions,e))return null;var r=this._definitions[e],i=this.getDescriptions(n),s=i[e];return r.withDescription(s)},t.prototype.setDescriptions=function(e,n){return this._descriptions[e]=n,this},t.prototype.addDescriptions=function(e,n){var r,i,s=this._descriptions[e];s==null&&(s={},this._descriptions[e]=s);var o=Object.keys(n);try{for(var a=Qi(o),u=a.next();!u.done;u=a.next()){var c=u.value;s[c]=Uo(Uo({},s[c]),n[c])}}catch(l){r={error:l}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return this},t.prototype.getDescriptions=function(e){e===void 0&&(e="en");var n=this._descriptions[e];return n??{}},t.prototype.toJSON=function(){var e,n,r={},i=Object.keys(this._definitions);try{for(var s=Qi(i),o=s.next();!o.done;o=s.next()){var a=o.value;r[a]=this._definitions[a].toJSON()}}catch(u){e={error:u}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}return{type:this._type,extend:this._extends,hidden:this._hidden,definitions:r}},t.prototype.copy=function(){var e,n,r,i,s=new t({type:this._type,hidden:this._hidden,extends:this._extends}),o={},a=Object.keys(this._definitions);try{for(var u=Qi(a),c=u.next();!c.done;c=u.next()){var l=c.value;o[l]=this._definitions[l].copy()}}catch(_){e={error:_}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}var h={},d=Object.keys(this._descriptions);try{for(var g=Qi(d),y=g.next();!y.done;y=g.next()){var l=y.value;h[l]=Uo({},h[l])}}catch(_){r={error:_}}finally{try{y&&!y.done&&(i=g.return)&&i.call(g)}finally{if(r)throw r.error}}return s._descriptions=h,s._definitions=o,s},t}();xn.Signature=Aj});var F1=m(Vr=>{"use strict";var Zi=Vr&&Vr.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},Ho=Vr&&Vr.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))},wu=Vr&&Vr.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(Vr,"__esModule",{value:!0});Vr.Container=void 0;var Kr=m_(),xt=Hi(),Cj=function(){function t(){this._primitives=new Map([[xt.SignatureDefinitionBaseType.Any,new Kr.Signature({type:xt.SignatureDefinitionBaseType.Any})],[xt.SignatureDefinitionBaseType.General,new Kr.Signature({type:xt.SignatureDefinitionBaseType.General})],[xt.SignatureDefinitionBaseType.String,new Kr.Signature({type:xt.SignatureDefinitionBaseType.String})],[xt.SignatureDefinitionBaseType.Function,new Kr.Signature({type:xt.SignatureDefinitionBaseType.Function})],[xt.SignatureDefinitionBaseType.Number,new Kr.Signature({type:xt.SignatureDefinitionBaseType.Number})],[xt.SignatureDefinitionBaseType.List,new Kr.Signature({type:xt.SignatureDefinitionBaseType.List})],[xt.SignatureDefinitionBaseType.Map,new Kr.Signature({type:xt.SignatureDefinitionBaseType.Map})]]),this._types=new Map,this._excludeFromSearch=new Set}return t.prototype.getOrCreateTypeSignature=function(e){var n=this.getTypeSignature(e);return n==null&&(n=new Kr.Signature({type:e}),this._types.set(e,n)),n},t.prototype.getPrimitives=function(){return this._primitives},t.prototype.getTypes=function(){return this._types},t.prototype.getAllVisibleTypes=function(){var e=this;return Ho(Ho([],Zi(this._primitives.keys()),!1),Zi(this._types.keys()),!1).filter(function(n){return!e.getTypeSignature(n).isHidden()&&n!==xt.SignatureDefinitionBaseType.Any&&n!==xt.SignatureDefinitionBaseType.General})},t.prototype.excludeFromSearch=function(e){return this._excludeFromSearch.add(e),this},t.prototype.includeToSearch=function(e){return this._excludeFromSearch.delete(e),this},t.prototype.getTypeSignature=function(e){var n,r;return(r=(n=this._primitives.get(e))!==null&&n!==void 0?n:this._types.get(e))!==null&&r!==void 0?r:null},t.prototype.getAllPrimitiveSignatures=function(){return Array.from(this._primitives.values())},t.prototype.getAllTypeSignatures=function(){return Array.from(this._types.values())},t.prototype.getAllSignatures=function(){return Ho(Ho([],Zi(this.getAllPrimitiveSignatures()),!1),Zi(this.getAllTypeSignatures()),!1)},t.prototype.getAllVisibleSignatures=function(){return Ho(Ho([],Zi(this.getAllPrimitiveSignatures()),!1),Zi(this.getAllTypeSignatures()),!1).filter(function(e){return e.isHidden()})},t.prototype.addTypeSignatureFromPayload=function(e){var n=Kr.Signature.parse(e);return this.addTypeSignature({type:n.getType(),extends:n.getExtendedType(),hidden:n.isHidden(),definitions:n.getDefinitions()}),this},t.prototype.addTypeSignature=function(e){var n=this.getOrCreateTypeSignature(e.type);return e.extends!==void 0&&n.setExtend(e.extends),n.mergeDefinitions(e.definitions),this},t.prototype.addMetaFromPayload=function(e,n){var r,i,s={},o=Object.keys(n);try{for(var a=wu(o),u=a.next();!u.done;u=a.next()){var c=u.value,l=Kr.Signature.parseDescriptions(n[c]);s[c]=l}}catch(h){r={error:h}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return this.addMeta(e,s),this},t.prototype.addMeta=function(e,n){var r,i,s=Object.keys(n);try{for(var o=wu(s),a=o.next();!a.done;a=o.next()){var u=a.value,c=this.getOrCreateTypeSignature(u);c.addDescriptions(e,n[u])}}catch(l){r={error:l}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return this},t.prototype.searchDefinitionMatches=function(e,n,r){var i,s;if(r===void 0&&(r="en"),typeof e=="string")return this.searchDefinitionMatches([e],n,r);var o=e.includes(xt.SignatureDefinitionBaseType.Any)?new Set(this.getAllVisibleTypes()):new Set(e),a=new Set,u=new Map;try{for(var c=wu(o),l=c.next();!l.done;l=c.next()){var h=l.value;if(!this._excludeFromSearch.has(h)){for(var d=h,g=this.getTypeSignature(h),y=null;g!==null&&!a.has(g.getType())&&(a.add(g.getType()),g.isHidden()||(y=g.getDefinition(n,r)),y===null);)d=g.getExtendedType(),g=this.getTypeSignature(d);y!==null&&u.set(d,y)}}}catch(_){i={error:_}}finally{try{l&&!l.done&&(s=c.return)&&s.call(c)}finally{if(i)throw i.error}}return u},t.prototype.getDefinition=function(e,n,r){if(r===void 0&&(r="en"),typeof e=="string")return this.getDefinition([e],n,r);var i=this._primitives.get(xt.SignatureDefinitionBaseType.Any).getDefinition(n,r);if(e.includes(xt.SignatureDefinitionBaseType.Any)&&i)return i;var s=this.searchDefinitionMatches(e,n,r);return s.size===0?null:s.size===1?s.values().next().value:s.has(xt.SignatureDefinitionBaseType.Any)?s.get(xt.SignatureDefinitionBaseType.Any):i!==null?i:s.values().next().value},t.prototype.fork=function(){var e,n,r,i,s=new t;try{for(var o=wu(this._primitives),a=o.next();!a.done;a=o.next()){var u=Zi(a.value,2),c=u[0],l=u[1];s._primitives.set(c,l.copy())}}catch(y){e={error:y}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}try{for(var h=wu(this._types),d=h.next();!d.done;d=h.next()){var g=Zi(d.value,2),c=g[0],l=g[1];s._types.set(c,l.copy())}}catch(y){r={error:y}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}return s._excludeFromSearch=new Set(this._excludeFromSearch),s},t}();Vr.Container=Cj});var jn=m(ot=>{"use strict";var Oj=ot&&ot.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),$1=ot&&ot.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Oj(e,t,n)};Object.defineProperty(ot,"__esModule",{value:!0});ot.TypeParser=ot.VariationRegistry=ot.Container=ot.Signature=ot.SignatureDefinition=ot.SignatureDefinitionTypeMeta=ot.SignatureDefinitionFunction=ot.SignatureDefinitionFunctionArg=void 0;var Rj=Rb();Object.defineProperty(ot,"SignatureDefinitionFunctionArg",{enumerable:!0,get:function(){return Rj.SignatureDefinitionFunctionArg}});var Pj=Pb();Object.defineProperty(ot,"SignatureDefinitionFunction",{enumerable:!0,get:function(){return Pj.SignatureDefinitionFunction}});var Dj=du();Object.defineProperty(ot,"SignatureDefinitionTypeMeta",{enumerable:!0,get:function(){return Dj.SignatureDefinitionTypeMeta}});var Ij=$h();Object.defineProperty(ot,"SignatureDefinition",{enumerable:!0,get:function(){return Ij.SignatureDefinition}});var Mj=m_();Object.defineProperty(ot,"Signature",{enumerable:!0,get:function(){return Mj.Signature}});var Lj=F1();Object.defineProperty(ot,"Container",{enumerable:!0,get:function(){return Lj.Container}});var Nj=Fh();Object.defineProperty(ot,"VariationRegistry",{enumerable:!0,get:function(){return Nj.VariationRegistry}});var qj=Cb();Object.defineProperty(ot,"TypeParser",{enumerable:!0,get:function(){return qj.TypeParser}});$1(Ab(),ot);$1(Hi(),ot)});var b_=m(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.enrichWithMetaInformation=Ms.FunctionBlockTag=void 0;var jj=kb(),y_=jn();function B1(t){return[t.name,t.description].filter(e=>e!==void 0).join(" ")}var Tu;(function(t){t.Description="description",t.Param="param",t.Return="return",t.Example="example"})(Tu=Ms.FunctionBlockTag||(Ms.FunctionBlockTag={}));function W1(t){return new y_.TypeParser(t).parse()}function Fj(t){return t.type.split("|").map(W1)}function $j(t){return{types:t.type.split("|").map(W1),label:t.name,opt:t.optional}}function Bj(t){let e=[t.description??"",...t.tags.filter(s=>s.tag===Tu.Description).map(B1)].join(`
104
104
 
105
- `),n=t.tags.filter(s=>s.tag===wu.Param).map(s=>({label:s.name,types:s.type.split("|"),opt:s.optional})),r=t.tags.find(s=>s.tag===wu.Return)??{type:"any"},i=t.tags.filter(s=>s.tag===wu.Example).map(D1);return{descriptions:e,args:n,returns:r,examples:i}}function _j(t){let e=(0,yj.parse)(`/**
105
+ `),n=t.tags.filter(s=>s.tag===Tu.Param).map($j),r=t.tags.filter(s=>s.tag===Tu.Return).flatMap(Fj),i=t.tags.filter(s=>s.tag===Tu.Example).map(B1);return{descriptions:e,args:n,returns:r,examples:i}}function Wj(t){let e=(0,jj.parse)(`/**
106
106
  ${t.getDescription()}
107
- */`),[n]=e;if(n.tags.length>0){let{descriptions:r,args:i,returns:s,examples:o}=bj(n);return P1.SignatureDefinitionFunction.parse({type:P1.SignatureDefinitionBaseType.Function,arguments:t.getArguments().map((a,u)=>{let c=a.getLabel(),l=a.getTypes().map(d=>d.toString()),h=a.isOptional();return{types:l,opt:h,...i[u],label:c}}),returns:s.type.split("|"),description:r,example:o})}return t}Ds.enrichWithMetaInformation=_j});var a_=m(ed=>{"use strict";Object.defineProperty(ed,"__esModule",{value:!0});ed.createResolveChain=void 0;var It=Te();function Vi(t,e,n=null,r=!1){switch(t.type){case It.ASTType.ParenthesisExpression:{Vi(t.expression,e,n);return}case It.ASTType.MemberExpression:{let i=t;Vi(i.base,e),e.push({ref:t,getter:i.identifier,unary:n,isInCallExpression:r});return}case It.ASTType.IndexExpression:{let i=t;Vi(i.base,e),e.push({ref:t,getter:i.index,unary:n,isInCallExpression:r});return}case It.ASTType.CallStatement:{Vi(t.expression,e,n,!0);return}case It.ASTType.CallExpression:{Vi(t.base,e,n,!0);return}case It.ASTType.NegationExpression:case It.ASTType.BinaryNegatedExpression:case It.ASTType.UnaryExpression:{let i=t;Vi(i.argument,e,i);return}case It.ASTType.Identifier:{e.push({ref:t,getter:t,unary:n,isInCallExpression:r});return}case It.ASTType.NumericLiteral:case It.ASTType.StringLiteral:case It.ASTType.NilLiteral:case It.ASTType.BooleanLiteral:case It.ASTType.MapConstructorExpression:case It.ASTType.ListConstructorExpression:case It.ASTType.BinaryExpression:case It.ASTType.LogicalExpression:case It.ASTType.ComparisonGroupExpression:{e.push({ref:t,value:t,unary:n,isInCallExpression:r});return}case It.ASTType.SliceExpression:Vi(t.base,e),e.push({ref:t,unary:n,isInCallExpression:r})}}function vj(t){let e=[];return Vi(t,e),e}ed.createResolveChain=vj});var M1=m(u_=>{function I1(t,e){return t>e?1:-1}u_.hash=function t(e,n){var r=5381;if(typeof e=="object"&&e!==null&&(e.toString===Object.prototype.toString||e.toString===Array.prototype.toString)){n||(n=new WeakSet);for(var i=Object.keys(e).sort(I1),s=0;s<i.length;s++){var o=i[s],a=e[o];if(r=33*r^t(o,n),typeof a=="object"&&a!==null&&(e.toString===Object.prototype.toString||e.toString===Array.prototype.toString)){if(n.has(a))continue;n.add(a)}r=33*r^t(a,n)}return 33*r^t(e.constructor,n)}var u=typeof e;try{e instanceof Date?u+=e.getTime():u+=String(e)}catch{u+=String(Object.assign({},e))}for(var c=0;c<u.length;c++)r=33*r^u.charCodeAt(c);return r},u_.sortNumbers=I1});var h_=m(Uo=>{"use strict";Object.defineProperty(Uo,"__esModule",{value:!0});Uo.ObjectSet=Uo.ObjectSetIterator=void 0;var c_=M1(),td=class{constructor(e){let n=this;n.value=e,n.index=0}next(){let e=this;return e.index>=e.value.length?{value:null,done:!0}:{value:e.value[e.index++],done:!1}}};Uo.ObjectSetIterator=td;var l_=class{constructor(e){let r=(e?Array.from(e):[]).map(i=>[(0,c_.hash)(i),i]);this._map=new Map(r),this._first=null,this._last=null,r.length>0&&(this._first=r[0][0],this._last=r[r.length-1][0])}[Symbol.iterator](){return new td(Array.from(this._map.values()))}first(){return this._first!=null?this._map.get(this._first)??null:null}last(){return this._last!=null?this._map.get(this._last)??null:null}toArray(){return Array.from(this._map.values())}add(e){let n=(0,c_.hash)(e);return this._map.set(n,e),this._first??(this._first=n),this._last=n,this}delete(e){let n=(0,c_.hash)(e);return this._map.delete(n)}extend(e){for(let[n,r]of e._map)this._map.set(n,r),this._first??(this._first=n),this._last=n;return this}toJSON(){return Array.from(this._map.values())}clear(){this._map.clear()}};Uo.ObjectSet=l_});var d_=m(nd=>{"use strict";Object.defineProperty(nd,"__esModule",{value:!0});nd.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION=void 0;nd.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION="This is a custom method. You can add a description for this method by adding a comment above or after the function.\n```\nmyFunction = function(a, b, c) // This function does xyz\n```\nor\n```\n/*\n This function does xyz\n*/\nmyFunction = function(a, b, c)\n```"});var Is=m(Tu=>{"use strict";Object.defineProperty(Tu,"__esModule",{value:!0});Tu.CompletionItemKind=void 0;var Sj;(function(t){t.Variable="var",t.Property="property",t.Function="function",t.Literal="literal",t.Constant="constant",t.Internal="internal",t.InternalFunction="internal-function",t.InternalProperty="internal-property",t.ListConstructor="list",t.MapConstructor="map",t.Expression="expr",t.Unknown="unknown"})(Sj=Tu.CompletionItemKind||(Tu.CompletionItemKind={}))});var f_=m(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.isResolveChainItemWithValue=Kr.isResolveChainItemWithIdentifier=Kr.isResolveChainItemWithMember=Kr.isResolveChainItemWithIndex=void 0;var rr=Te(),wj=t=>t!=null&&t.ref.type===rr.ASTType.IndexExpression;Kr.isResolveChainItemWithIndex=wj;var Tj=t=>t!=null&&t.ref.type===rr.ASTType.MemberExpression;Kr.isResolveChainItemWithMember=Tj;var Ej=t=>t!=null&&t.ref.type===rr.ASTType.Identifier;Kr.isResolveChainItemWithIdentifier=Ej;var xj=new Set([rr.ASTType.NumericLiteral,rr.ASTType.StringLiteral,rr.ASTType.NilLiteral,rr.ASTType.BooleanLiteral,rr.ASTType.MapConstructorExpression,rr.ASTType.ListConstructorExpression,rr.ASTType.BinaryExpression,rr.ASTType.LogicalExpression,rr.ASTType.ComparisonGroupExpression]),kj=t=>t!=null&&xj.has(t.ref.type);Kr.isResolveChainItemWithValue=kj});var p_=m(rd=>{"use strict";Object.defineProperty(rd,"__esModule",{value:!0});rd.isSignatureDefinitionFunction=void 0;var Aj=nr(),Cj=t=>t.getType().type===Aj.SignatureDefinitionBaseType.Function;rd.isSignatureDefinitionFunction=Cj});var g_=m(id=>{"use strict";Object.defineProperty(id,"__esModule",{value:!0});id.aggregateEntity=void 0;var Oj=t=>{let e=new Set,n=t;for(;n!=null&&!e.has(n);)e.add(n),n=n.getIsa();return Array.from(e)};id.aggregateEntity=Oj});var Eu=m(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});sd.injectIdentifers=void 0;var Rj=g_(),Pj=(t,e)=>{let n=(0,Rj.aggregateEntity)(e);for(let r=0;r<n.length;r++){let i=n[r];for(let[s,o]of i.values)if(s.startsWith("i:")){let a=s.slice(2);if(t.has(a))continue;t.set(a,{kind:o.kind,line:o.source===e.source?o.line:-1})}}};sd.injectIdentifers=Pj});var ad=m(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0});od.isEligibleForProperties=void 0;var m_=nr(),Dj=t=>t.types.has(m_.SignatureDefinitionBaseType.Map)||t.types.has(m_.SignatureDefinitionBaseType.List)||t.types.has(m_.SignatureDefinitionBaseType.Any);od.isEligibleForProperties=Dj});var cd=m(ud=>{"use strict";Object.defineProperty(ud,"__esModule",{value:!0});ud.lookupProperty=void 0;var Ij=ad(),Mj=(t,e)=>{let n=t,r=new Set([n]);for(;(0,Ij.isEligibleForProperties)(n);){let i=n.values.get(`i:${e}`);if(i!=null)return i;let s=n.getIsa();if(s==null||r.has(s))break;r.add(s),n=s}return null};ud.lookupProperty=Mj});var y_=m(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0});ld.mergeUnique=void 0;function Lj(t,e,n=1e4){let r=Array.from(new Set([...t,...e]));if(t.length=0,r.length<=n){Array.prototype.push.apply(t,r);return}for(let i=0;i<r.length;i+=n)Array.prototype.push.apply(t,r.slice(i,i+n))}ld.mergeUnique=Lj});var Go=m(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.Entity=Xi.resolveEntity=void 0;var Wo=nr(),Ho=Is(),Nj=p_(),qj=Eu(),hd=ad(),L1=cd(),jj=y_(),N1=h_(),Fj=(t,e,n=!1)=>{if(e.isCallable()&&!n){let r=e.getReturnEntity();if(r!==null)return r;let i=e.getCallableReturnTypes();return i?new Ms({source:e.source,kind:Ho.CompletionItemKind.Variable,container:t,label:e.label,context:e.context}).addTypes(i):new Ms({source:e.source,kind:Ho.CompletionItemKind.Variable,container:t,label:e.label,context:e.context}).addType(Wo.SignatureDefinitionBaseType.Any)}return e};Xi.resolveEntity=Fj;var b_={hasProperty(t,e,n){return!!(0,L1.lookupProperty)(t,n)||!t.isAPI()&&!!e.getDefinition(Array.from(t.types),n,!0)},resolveProperty(t,e,n,r=!1){let i=(0,L1.lookupProperty)(t,n)??null;return i==null?t.isAPI()?null:e.getDefinition(Array.from(t.types),n,r):(0,Xi.resolveEntity)(e,i,r)},setProperty(t,e,n,r){if(!(0,hd.isEligibleForProperties)(t))return!1;let i=`i:${n}`,s=t.values.get(i);return s?s.extend(r):t.values.set(i,r.copy({container:e,label:n,context:t,definitions:[]})),!0}},__={hasProperty(t,e,n){if(!(0,hd.isEligibleForProperties)(t))return!1;for(let r of n.types)if(t.values.has(`t:${r}`))return!0;return!1},resolveProperty(t,e,n,r=!1){if(!(0,hd.isEligibleForProperties)(t))return new Ms({source:t.source,kind:Ho.CompletionItemKind.Variable,container:e,label:n.label,context:t}).addType(Wo.SignatureDefinitionBaseType.Any);let i=new Ms({source:n.source,kind:Ho.CompletionItemKind.Variable,container:e,label:n.label,context:t});for(let s of n.types){let o=t.values.get(`t:${s}`);o&&i.extend(o)}return i.types.size===0&&i.addType(Wo.SignatureDefinitionBaseType.Any),(0,Xi.resolveEntity)(e,i,r)},setProperty(t,e,n,r){if(!(0,hd.isEligibleForProperties)(t))return!1;for(let i of n.types){let s=`t:${i}`,o=t.values.get(s);o?o.extend(r):t.values.set(s,r.copy({container:e,label:i,context:t,definitions:[]}))}return!0}},Ms=class t{get source(){return this._source}get definitions(){return this._definitions}get kind(){return this._kind}get line(){return this._line}get signatureDefinitions(){return this._signatureDefinitions}get context(){return this._context}get label(){return this._label}get types(){return this._types}get values(){return this._values}constructor(e){this._source=e.source,this._isAPI=e.isAPI??!1,this._isFromSignature=e.isFromSignature??!1,this._kind=e.kind,this._line=e.line??-1,this._label=e.label??"anonymous",this._signatureDefinitions=e.signatureDefinitions??new N1.ObjectSet,this._types=e.types??new Set,this._values=e.values??new Map,this._context=e.context??null,this._container=e.container,this._definitions=e.definitions??[],this._returnEntity=e.returnEntity??null}isFromSignature(){return this._isFromSignature}hasContext(){return this._context!=null&&!this._context.isAPI}getIsa(){return this._values.get("i:__isa")??null}hasIsa(){return this._values.has("i:__isa")}isAPI(){return this._isAPI}isCallable(){return this._types.has(Wo.SignatureDefinitionBaseType.Function)}getCallableReturnTypes(){if(!this.isCallable())return null;let e=Array.from(this._signatureDefinitions).filter(n=>(0,Nj.isSignatureDefinitionFunction)(n));return e.length===0?null:e.flatMap(n=>n.getReturns()).map(n=>n.type)}addSignatureType(e){return this._signatureDefinitions.add(e),this.addType(e.getType().type),this}setReturnEntity(e){return this._returnEntity=e,this}getReturnEntity(){return this._returnEntity}setKind(e){return this._kind=e,this}setLine(e){return this._line=e,this}setLabel(e){return this._label=e,this}setContext(e){return this._context=e,this}addType(e){return this._types.add(e),this}addTypes(e){for(let n=0;n<e.length;n++)this._types.add(e[n]);return this}hasProperty(e){switch(typeof e){case"object":return __.hasProperty(this,this._container,e);default:return b_.hasProperty(this,this._container,e)}}resolveProperty(e,n=!1){switch(typeof e){case"object":return __.resolveProperty(this,this._container,e,n);default:return b_.resolveProperty(this,this._container,e,n)}}setProperty(e,n){switch(typeof e){case"object":return __.setProperty(this,this._container,e,n);default:return b_.setProperty(this,this._container,e,n)}}extend(e,n=!1,r=!1){if(e===this)return this;let i=new WeakSet([e]),s=[{target:this,source:e}];for(;s.length>0;){let o=s.pop(),a=o.target,u=o.source;a._isFromSignature=!1,a._signatureDefinitions.extend(u._signatureDefinitions),n&&(r?a._definitions=[...a._definitions,...u._definitions]:(0,jj.mergeUnique)(a._definitions,u._definitions)),a.addTypes(Array.from(u.types));for(let[c,l]of u.values){let h=a._values.get(c);h==null?a._values.set(c,l.copy({container:a._container,context:a,deepCopy:r})):i.has(l)||(i.add(l),s.push({target:h,source:l}))}}return this}insertSignature(e){let n=Object.keys(e.getDefinitions());this.addType(Wo.SignatureDefinitionBaseType.Map);for(let r=0;r<n.length;r++){let i=n[r],s=e.getDefinition(i),o=new t({source:this._source,label:i,kind:s.getType().type===Wo.SignatureDefinitionBaseType.Function?Ho.CompletionItemKind.InternalFunction:Ho.CompletionItemKind.InternalProperty,container:this._container,isFromSignature:!0});o.addSignatureType(s),this.setProperty(i,o)}return this}getAllIdentifier(){let e=new Map;for(let n of this._types){let r=this._container.getAllIdentifier(n);for(let i of r)e.set(...i)}return(0,qj.injectIdentifers)(e,this),e}toJSONInternal(e=new WeakMap){if(e.has(this))return e.get(this);let n={};return e.set(this,n),n.kind=this.kind,n.signatureDefinitions=this._signatureDefinitions.toJSON(),n.types=Array.from(this._types),n.values=Array.from(this._values).reduce((r,[i,s])=>(r[i]=s?.toJSONInternal(e),r),{}),n}toJSON(){return this.toJSONInternal()}copy(e={}){let n=new t({source:e.source??this._source,kind:e.kind??this._kind,line:e.line??this._line,isFromSignature:e.isFromSignature??this._isFromSignature,isAPI:e.isAPI??this._isAPI,container:e.container??this._container,label:e.label??this._label,context:e.context??this._context,signatureDefinitions:new N1.ObjectSet(Array.from(this._signatureDefinitions,s=>s.copy())),types:new Set(this._types),returnEntity:this._returnEntity,values:e.values??this.values,definitions:e.definitions??this._definitions});if(!e.deepCopy)return n;let r=new WeakMap;function i(s,o){let a=r.get(o);if(a)return a;let u=o.copy({container:e.container,line:e.line,context:s,values:new Map});r.set(o,u);for(let[c,l]of o.values)u._values.set(c,i(u,l));return u._definitions=[...o.definitions],u}n._values=new Map;for(let[s,o]of this._values)n._values.set(s,i(n,o));return n._definitions=[...this._definitions],n}};Xi.Entity=Ms});var w_=m(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});pd.Scope=void 0;var dd=nr(),Ls=Is(),v_=Eu(),fd=Go(),S_=class t{get source(){return this._source}get definitions(){return[]}get signatureDefinitions(){return null}get kind(){return Ls.CompletionItemKind.Constant}get line(){return this._locals.line}get label(){return this._locals.label}get context(){return this._locals.context}get types(){return new Set(dd.SignatureDefinitionBaseType.Map)}get values(){return this._locals.values}get globals(){return this._globals}get outer(){return this._parent?.locals??null}get locals(){return this._locals}constructor(e){this._source=e.source,this._container=e.container,this._parent=e.parent??null,this._globals=e.globals,this._locals=e.locals??new fd.Entity({source:this._source,kind:Ls.CompletionItemKind.Constant,container:this._container,label:"locals"}).addType(dd.SignatureDefinitionBaseType.Map)}getIsa(){return null}hasIsa(){return!1}setCustomType(e,n){this._container.setCustomType(e,n)}addSignatureType(){throw new Error("Cannot add signature type to scope!")}hasProperty(e){return this._locals.hasProperty(e)}resolveProperty(e,n){return this._locals.resolveProperty(e,n)}resolveNamespace(e,n=!1){if(typeof e!="string")throw new Error("Invalid property type for scope!");if(e==="locals")return this._locals;if(e==="outer")return this._parent?.locals??this._globals;if(e==="globals")return this._globals;if(this._locals.values.has(`i:${e}`)){let r=this._locals.values.get(`i:${e}`);return(0,fd.resolveEntity)(this._container,r,n)}else if(this._parent?.locals.values.has(`i:${e}`)){let r=this._parent.locals.values.get(`i:${e}`);return(0,fd.resolveEntity)(this._container,r,n)}else if(this._globals.values.has(`i:${e}`)){let r=this._globals.values.get(`i:${e}`);return(0,fd.resolveEntity)(this._container,r,n)}return this._container.getGeneralDefinition(e,n)}setProperty(e,n){return this._locals.setProperty(e,n)}extend(e){return this._locals.extend(e),this}addType(){throw new Error("Scope cannot get type assigned!")}addTypes(){throw new Error("Scope cannot get types assigned!")}setReturnEntity(){throw new Error("Scope cannot set return entity!")}getReturnEntity(){throw new Error("Scope cannot get return entity!")}setKind(e){return this._locals.setKind(e),this}setLine(e){return this._locals.setLine(e),this}setLabel(e){return this._locals.setLabel(e),this}setContext(e){return this._locals.setContext(e),this}insertSignature(e){return this._locals.insertSignature(e),this}isAPI(){return!1}hasContext(){return!1}isFromSignature(){return!1}isCallable(){return!1}getCallableReturnTypes(){return null}getAllIdentifier(){let e=new Map([["globals",{kind:Ls.CompletionItemKind.Constant,line:-1}],["locals",{kind:Ls.CompletionItemKind.Constant,line:-1}],["outer",{kind:Ls.CompletionItemKind.Constant,line:-1}],...this._container.getAllIdentifier(dd.SignatureDefinitionBaseType.General)]);return this._locals!==this._globals&&(0,v_.injectIdentifers)(e,this._globals),this._parent&&(0,v_.injectIdentifers)(e,this._parent.locals),(0,v_.injectIdentifers)(e,this._locals),this.isSelfAvailable()&&e.set("self",{kind:Ls.CompletionItemKind.Constant,line:-1}),this.isSuperAvailable()&&e.set("super",{kind:Ls.CompletionItemKind.Constant,line:-1}),e}isSelfAvailable(){return this._locals.context!=null&&this._locals.context.types.has(dd.SignatureDefinitionBaseType.Map)}isSuperAvailable(){return this.isSelfAvailable()&&this._locals.context.hasProperty("__isa")}toJSON(){return this._locals.toJSON()}copy(e={}){return new t({source:this._source,container:e.container??this._container,parent:this._parent.copy({container:e.container,deepCopy:!0}),globals:this._globals.copy({container:e.container,deepCopy:!0}),locals:this._locals.copy({...e,deepCopy:!0})})}};pd.Scope=S_});var zo=m(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});xu.GreybelKeyword=void 0;var $j;(function(t){t.Envar="#envar",t.Import="#import",t.Include="#include",t.ImportWithComment="//import",t.IncludeWithComment="//include",t.Debugger="debugger",t.Line="#line",t.File="#filename",t.Inject="#inject"})($j=xu.GreybelKeyword||(xu.GreybelKeyword={}))});var x_=m(E_=>{"use strict";Object.defineProperty(E_,"__esModule",{value:!0});var Ns=Te(),Bj=zo(),T_=class extends Ns.LexerValidator{constructor(){super(...arguments),this.isKeyword=Set.prototype.has.bind(new Set([...Object.values(Ns.Keyword),...Object.values(Bj.GreybelKeyword)]))}isIdentifierStart(e){return super.isIdentifierStart(e)||e===Ns.CharacterCode.HASH}isMultilineComment(e,n){return Ns.CharacterCode.SLASH===e&&Ns.CharacterCode.ASTERISK===n}isMultilineCommentEnd(e,n){return Ns.CharacterCode.ASTERISK===e&&Ns.CharacterCode.SLASH===n}isComment(e,n){return super.isComment(e,n)||this.isMultilineComment(e,n)}};E_.default=T_});var k_=m(ku=>{"use strict";Object.defineProperty(ku,"__esModule",{value:!0});ku.CharacterCode=void 0;var Uj;(function(t){t[t.VERTICAL_LINE=124]="VERTICAL_LINE",t[t.AMPERSAND=38]="AMPERSAND"})(Uj=ku.CharacterCode||(ku.CharacterCode={}))});var Ko=m(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});Au.Operator=void 0;var Wj;(function(t){t.BitwiseAnd="&",t.BitwiseOr="|",t.LeftShift="<<",t.RightShift=">>",t.UnsignedRightShift=">>>"})(Wj=Au.Operator||(Au.Operator={}))});var C_=m(Cu=>{"use strict";var Hj=Cu&&Cu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Cu,"__esModule",{value:!0});var Er=Te(),Gj=Hj(x_()),q1=k_(),j1=zo(),A_=Ko();function F1(t){let e=this.content[this.index];return this.index+=e.length,this.createPunctuator(e,t)}var gd=class t extends Er.Lexer{constructor(e,n={}){n.validator=n.validator||new Gj.default,super(e,n)}scan(e,n){let r=t.greybelScanHandlers[e];return r?r.call(this,n)||super.scan(e,n):super.scan(e,n)}scanMultilineComment(e){let n=this,r=n.line,i=n.lineStart,s=n.index,o=n.offset,a=n.offset,u=!1;for(;n.index<n.length;){let h=n.codeAt();if(n.validator.isEndOfLine(h))n.validator.isWinNewline(h,n.codeAt(1))&&n.index++,n.line++,a=n.index+1;else if(n.validator.isMultilineCommentEnd(n.codeAt(),n.codeAt(1))){u=!0;break}n.index++}if(!u)return n.raise("Unexpected end of file in multiline comment.",new Er.ASTRange(new Er.ASTPosition(r,s-o+1),new Er.ASTPosition(n.line,n.index-a+3)));let c=n.content.slice(s+2,n.index);n.index+=2;let l=new Er.Token({type:Er.TokenType.Comment,value:c,line:r,lineStart:i,range:[n.tokenStart,n.index],offsetRange:[o,a],afterSpace:e,lastLine:n.line,lastLineStart:n.lineStart});return n.offset=a,n.snapshot.enqueue(l),l}scanComment(e){let n=this,r=n.validator;return n.content.startsWith(j1.GreybelKeyword.ImportWithComment,n.index)||n.content.startsWith(j1.GreybelKeyword.IncludeWithComment,n.index)?(n.index++,n.scanIdentifierOrKeyword(e)):r.isMultilineComment(n.codeAt(),n.codeAt(1))?n.scanMultilineComment(e):super.scanComment(e)}};Cu.default=gd;gd.greybelScanHandlers={[Er.CharacterCode.ARROW_LEFT]:function(e){if(Er.CharacterCode.ARROW_LEFT===this.codeAt(1))return this.scanPunctuator(A_.Operator.LeftShift,e)},[Er.CharacterCode.ARROW_RIGHT]:function(e){if(Er.CharacterCode.ARROW_RIGHT===this.codeAt(1))return Er.CharacterCode.ARROW_RIGHT===this.codeAt(2)?this.scanPunctuator(A_.Operator.UnsignedRightShift,e):this.scanPunctuator(A_.Operator.RightShift,e)},[q1.CharacterCode.AMPERSAND]:F1,[q1.CharacterCode.VERTICAL_LINE]:F1}});var md=m(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});Ou.ASTType=void 0;var zj;(function(t){t.FeatureImportExpression="FeatureImportExpression",t.FeatureIncludeExpression="FeatureIncludeExpression",t.FeatureEnvarExpression="FeatureEnvarExpression",t.FeatureInjectExpression="FeatureInjectExpression",t.FeatureDebuggerExpression="FeatureDebuggerExpression",t.FeatureLineExpression="FeatureLineExpression",t.FeatureFileExpression="FeatureFileExpression"})(zj=Ou.ASTType||(Ou.ASTType={}))});var R_=m(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:!0});yd.ASTChunkAdvanced=void 0;var Kj=Te(),O_=class t extends Kj.ASTChunk{constructor(e){super(e),this.imports=e.imports||[],this.includes=e.includes||[],this.injects=e.injects||[]}clone(){return new t({literals:this.literals.map(e=>e.clone()),scopes:this.scopes.map(e=>e.clone()),imports:this.imports.map(e=>e.clone()),includes:this.includes.map(e=>e.clone()),injects:this.injects.map(e=>e.clone()),lines:this.lines,start:this.start,end:this.end,range:this.range,scope:this.scope})}};yd.ASTChunkAdvanced=O_});var N_=m(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.ASTFeatureFileExpression=ir.ASTFeatureInjectExpression=ir.ASTFeatureEnvarExpression=ir.ASTFeatureIncludeExpression=ir.ASTFeatureImportExpression=void 0;var Ru=Te(),Pu=md(),P_=class t extends Ru.ASTBase{constructor(e){super(Pu.ASTType.FeatureImportExpression,e),this.name=e.name,this.path=e.path,this.chunk=e.chunk,this.namespace=e.namespace}toString(){return`FeatureImportExpression[${this.start}-${this.end}][name = ${this.name}, path = ${this.path}]`}clone(){return new t({name:this.name.clone(),path:this.path,chunk:this.chunk.clone(),namespace:this.namespace,start:this.start,end:this.end,range:this.range,scope:this.scope})}};ir.ASTFeatureImportExpression=P_;var D_=class t extends Ru.ASTBase{constructor(e){super(Pu.ASTType.FeatureIncludeExpression,e),this.path=e.path,this.chunk=e.chunk,this.namespace=e.namespace}toString(){return`FeatureIncludeExpression[${this.start}-${this.end}][path = ${this.path}]`}clone(){return new t({path:this.path,chunk:this.chunk.clone(),namespace:this.namespace,start:this.start,end:this.end,range:this.range,scope:this.scope})}};ir.ASTFeatureIncludeExpression=D_;var I_=class t extends Ru.ASTBase{constructor(e){super(Pu.ASTType.FeatureEnvarExpression,e),this.name=e.name}toString(){return`FeatureEnvarExpression[${this.start}-${this.end}][name = ${this.name}]`}clone(){return new t({name:this.name,start:this.start,end:this.end,range:this.range,scope:this.scope})}};ir.ASTFeatureEnvarExpression=I_;var M_=class t extends Ru.ASTBase{constructor(e){super(Pu.ASTType.FeatureInjectExpression,e),this.path=e.path}toString(){return`FeatureInjectExpression[${this.start}-${this.end}][path = ${this.path}]`}clone(){return new t({path:this.path,start:this.start,end:this.end,range:this.range,scope:this.scope})}};ir.ASTFeatureInjectExpression=M_;var L_=class t extends Ru.ASTBase{constructor(e){super(Pu.ASTType.FeatureFileExpression,e),this.filename=e.filename}toString(){return`FeatureFileExpression[${this.start}-${this.end}][path = ${this.filename}]`}clone(){return new t({filename:this.filename,start:this.start,end:this.end,range:this.range,scope:this.scope})}};ir.ASTFeatureFileExpression=L_});var F_=m($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.ASTFeatureInjectExpression=$t.ASTFeatureIncludeExpression=$t.ASTFeatureImportExpression=$t.ASTFeatureFileExpression=$t.ASTFeatureEnvarExpression=$t.ASTChunkAdvanced=$t.ASTType=$t.ASTProvider=void 0;var q_=Te(),$1=md(),Vj=R_(),Du=N_(),j_=class extends q_.ASTProvider{featureImportExpression(e){return new Du.ASTFeatureImportExpression(e)}featureIncludeExpression(e){return new Du.ASTFeatureIncludeExpression(e)}featureEnvarExpression(e){return new Du.ASTFeatureEnvarExpression(e)}featureInjectExpression(e){return new Du.ASTFeatureInjectExpression(e)}featureDebuggerExpression(e){return new q_.ASTBase($1.ASTType.FeatureDebuggerExpression,e)}featureLineExpression(e){return new q_.ASTBase($1.ASTType.FeatureLineExpression,e)}featureFileExpression(e){return new Du.ASTFeatureFileExpression(e)}chunkAdvanced(e){return new Vj.ASTChunkAdvanced(e)}};$t.ASTProvider=j_;var Xj=md();Object.defineProperty($t,"ASTType",{enumerable:!0,get:function(){return Xj.ASTType}});var Yj=R_();Object.defineProperty($t,"ASTChunkAdvanced",{enumerable:!0,get:function(){return Yj.ASTChunkAdvanced}});var Iu=N_();Object.defineProperty($t,"ASTFeatureEnvarExpression",{enumerable:!0,get:function(){return Iu.ASTFeatureEnvarExpression}});Object.defineProperty($t,"ASTFeatureFileExpression",{enumerable:!0,get:function(){return Iu.ASTFeatureFileExpression}});Object.defineProperty($t,"ASTFeatureImportExpression",{enumerable:!0,get:function(){return Iu.ASTFeatureImportExpression}});Object.defineProperty($t,"ASTFeatureIncludeExpression",{enumerable:!0,get:function(){return Iu.ASTFeatureIncludeExpression}});Object.defineProperty($t,"ASTFeatureInjectExpression",{enumerable:!0,get:function(){return Iu.ASTFeatureInjectExpression}})});var $_=m(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.SelectorGroups=yt.SelectorGroupType=yt.Selectors=yt.SelectorTypes=void 0;var We=Te(),bd=zo(),Mu=Ko(),Jj;(function(t){t.From="From",t.Envar="Envar",t.Inject="Inject",t.Line="Line",t.File="File",t.LeftShift="LeftShift",t.RightShift="RightShift",t.UnsignedRightShift="UnsignedRightShift",t.BitwiseOr="BitwiseOr",t.BitwiseAnd="BitwiseAnd",t.Escape="Escape"})(Jj=yt.SelectorTypes||(yt.SelectorTypes={}));yt.Selectors=Object.assign(Object.assign({},We.Selectors),{From:(0,We.createSelector)({type:We.TokenType.Identifier,value:"from"}),Envar:(0,We.createSelector)({type:We.TokenType.Keyword,value:bd.GreybelKeyword.Envar}),Inject:(0,We.createSelector)({type:We.TokenType.Keyword,value:bd.GreybelKeyword.Inject}),Line:(0,We.createSelector)({type:We.TokenType.Keyword,value:bd.GreybelKeyword.Line}),File:(0,We.createSelector)({type:We.TokenType.Keyword,value:bd.GreybelKeyword.File}),LeftShift:(0,We.createSelector)({type:We.TokenType.Punctuator,value:Mu.Operator.LeftShift}),RightShift:(0,We.createSelector)({type:We.TokenType.Punctuator,value:Mu.Operator.RightShift}),UnsignedRightShift:(0,We.createSelector)({type:We.TokenType.Punctuator,value:Mu.Operator.UnsignedRightShift}),BitwiseOr:(0,We.createSelector)({type:We.TokenType.Punctuator,value:Mu.Operator.BitwiseOr}),BitwiseAnd:(0,We.createSelector)({type:We.TokenType.Punctuator,value:Mu.Operator.BitwiseAnd}),Escape:(0,We.createSelector)({type:We.TokenType.Punctuator,value:We.Operator.Escape})});var gi;(function(t){t.MapSeparator="MapSeparator",t.ListSeparator="ListSeparator",t.PathSegmentEnd="PathSegmentEnd",t.BitwiseOperators="BitwiseOperators"})(gi=yt.SelectorGroupType||(yt.SelectorGroupType={}));yt.SelectorGroups=Object.assign(Object.assign({},We.SelectorGroups),{[gi.MapSeparator]:(0,We.createSelectorGroup)(gi.MapSeparator,[yt.Selectors.MapSeperator,yt.Selectors.CRBracket]),[gi.ListSeparator]:(0,We.createSelectorGroup)(gi.ListSeparator,[yt.Selectors.MapSeperator,yt.Selectors.SRBracket]),[gi.PathSegmentEnd]:(0,We.createSelectorGroup)(gi.PathSegmentEnd,[yt.Selectors.EndOfLine,yt.Selectors.Comment,yt.Selectors.EndOfFile]),[gi.BitwiseOperators]:(0,We.createSelectorGroup)(gi.BitwiseOperators,[yt.Selectors.LeftShift,yt.Selectors.RightShift,yt.Selectors.UnsignedRightShift])})});var W1=m(Lu=>{"use strict";var Qj=Lu&&Lu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Lu,"__esModule",{value:!0});var kn=Te(),Zj=Wa(),B1=Xa(),eF=Qj(C_()),tF=F_(),qs=zo(),U1=Ko(),qe=$_(),B_=class extends kn.Parser{constructor(e,n={}){var r;n.lexer=n.lexer||new eF.default(e,{unsafe:n.unsafe,tabWidth:n.tabWidth}),n.astProvider=n.astProvider||new tF.ASTProvider,super(e,n);let i=this;i.filename=(r=n.filename)!==null&&r!==void 0?r:"unknown",i.imports=[],i.includes=[],i.injects=[]}skipNewlines(){var e;let n=this,r=0;for(;;){if(qe.Selectors.Comment(n.token)){let i=((e=n.previousToken)===null||e===void 0?void 0:e.line)!==n.token.line,s=n.astProvider.comment({value:n.token.value,isMultiline:n.token.value.indexOf(`
108
- `)!==-1,start:n.token.start,end:n.token.end,range:n.token.range,scope:n.currentScope,isStatement:i});n.lineRegistry.addItemToLines(s)}else if(qe.Selectors.EndOfLine(n.token))r++;else break;n.next()}return r}parseMap(e=!1,n=!1){let r=this;if(!qe.Selectors.CLBracket(r.token))return r.parseList(e,n);let i=r.currentScope,s=r.token,o=[],a=r.astProvider.mapConstructorExpression({fields:o,start:s.start,end:null,range:[s.range[0],null],scope:i});if(r.next(),qe.Selectors.CRBracket(r.token))r.next();else for(;!qe.Selectors.EndOfFile(r.token);){if(r.skipNewlines(),qe.Selectors.CRBracket(r.token)){r.next();break}let u=r.astProvider.mapKeyString({key:null,value:null,start:r.token.start,end:null,range:[r.token.range[0],null],scope:i});u.key=r.parseExpr(null),r.requireToken(qe.Selectors.MapKeyValueSeperator),r.skipNewlines(),u.value=r.parseExpr(u),u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),r.skipNewlines();let c=r.requireTokenOfAny(qe.SelectorGroups.MapSeparator,s.start);if(qe.Selectors.CRBracket(c))break}return a.end=r.token.start,a.range[1]=r.token.range[1],a}parseList(e=!1,n=!1){let r=this;if(!qe.Selectors.SLBracket(r.token))return r.parseQuantity(e,n);let i=r.currentScope,s=r.token,o=[],a=r.astProvider.listConstructorExpression({fields:o,start:s.start,end:null,range:[s.range[0],null],scope:i});if(r.next(),qe.Selectors.SRBracket(r.token))r.next();else for(;!qe.Selectors.EndOfFile(r.token);){if(r.skipNewlines(),qe.Selectors.SRBracket(r.token)){r.next();break}let u=r.astProvider.listValue({value:null,start:r.token.start,end:null,range:[r.token.range[0],null],scope:i});u.value=r.parseExpr(u),u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),r.skipNewlines();let c=r.requireTokenOfAny(qe.SelectorGroups.ListSeparator,s.start);if(qe.Selectors.SRBracket(c))break}return a.end=r.token.start,a.range[1]=r.token.range[1],a}parsePathSegment(){let e=this;if(this.token.type===kn.ASTType.StringLiteral){let r=this.token.value;return this.next(),r}let n="";for(;!qe.SelectorGroups.PathSegmentEnd(e.token);)n=n+e.token.value,e.next();return e.consumeMany(qe.SelectorGroups.PathSegmentEnd),n}parseFeatureIncludeStatement(){let e=this,n=e.previousToken,r=e.parsePathSegment(),i=e.astProvider.featureIncludeExpression({path:r,start:n.start,end:e.previousToken.end,range:[n.range[0],e.previousToken.range[1]],scope:e.currentScope});return e.includes.push(i),i}parseFeatureImportStatement(){var e;let n=this,r=n.previousToken,i=n.parseIdentifier(kn.ASTIdentifierKind.Variable);if(!n.consume(qe.Selectors.From))return n.raise("expected from keyword",new B1.Range(r.start,new Zj.Position((e=n.token.lastLine)!==null&&e!==void 0?e:n.token.line,n.token.end.character))),n.parseInvalidCode();let s=n.parsePathSegment(),o=n.astProvider.featureImportExpression({name:i,path:s,start:r.start,end:n.previousToken.end,range:[r.range[0],n.previousToken.range[1]],scope:n.currentScope});n.imports.push(o);let a=n.astProvider.assignmentStatement({variable:i,init:n.astProvider.literal(kn.TokenType.NilLiteral,{value:null,raw:"null",start:i.start,end:i.end,range:i.range,scope:n.currentScope}),start:i.start,end:i.end,range:i.range,scope:n.currentScope});return n.currentScope.assignments.push(a),o}parseFeatureEnvarExpression(){let e=this,n=e.previousToken,r=e.token.value;return e.next(),e.astProvider.featureEnvarExpression({name:r,start:n.start,end:e.previousToken.end,range:[n.range[0],e.previousToken.range[1]],scope:e.currentScope})}parseFeatureInjectExpression(){let e=this,n=e.previousToken,r=this.parsePathSegment();e.next();let i=e.astProvider.featureInjectExpression({path:r,start:n.start,end:e.previousToken.end,range:[n.range[0],e.previousToken.range[1]],scope:e.currentScope});return e.injects.push(i),i}parseIsa(e=!1,n=!1){let r=this,i=r.token,s=r.parseBitwiseOr(e,n);if(qe.Selectors.Isa(r.token)){r.next(),r.skipNewlines();let o=r.parseBitwiseOr();return r.astProvider.isaExpression({operator:kn.Operator.Isa,left:s,right:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return s}parseBitwiseOr(e=!1,n=!1){let r=this,i=r.token,o=r.parseBitwiseAnd(e,n);for(;qe.Selectors.BitwiseOr(r.token);){r.next();let a=r.parseBitwiseAnd();o=r.astProvider.binaryExpression({operator:U1.Operator.BitwiseOr,left:o,right:a,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseBitwiseAnd(e=!1,n=!1){let r=this,i=r.token,o=r.parseComparisons(e,n);for(;qe.Selectors.BitwiseAnd(r.token);){r.next();let a=r.parseComparisons();o=r.astProvider.binaryExpression({operator:U1.Operator.BitwiseAnd,left:o,right:a,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseAddSub(e=!1,n=!1){let r=this,i=r.token,o=r.parseBitwise(e,n);for(;qe.Selectors.Plus(r.token)||qe.Selectors.Minus(r.token)&&(!n||!r.token.afterSpace||r.lexer.isAtWhitespace());){let a=r.token;r.next(),r.skipNewlines();let u=r.parseBitwise();o=r.astProvider.binaryExpression({operator:a.value,left:o,right:u,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseBitwise(e=!1,n=!1){let r=this,i=r.token,o=r.parseMultDiv(e,n);for(;qe.SelectorGroups.BitwiseOperators(r.token);){let a=r.token;r.next(),r.skipNewlines();let u=r.parseMultDiv();o=r.astProvider.binaryExpression({operator:a.value,left:o,right:u,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseAtom(){let e=this;return qe.Selectors.Envar(e.token)?(e.next(),e.parseFeatureEnvarExpression()):qe.Selectors.Inject(e.token)?(e.next(),e.parseFeatureInjectExpression()):qe.Selectors.Line(e.token)?(e.next(),e.astProvider.featureLineExpression({start:new kn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new kn.ASTPosition(e.previousToken.line,e.previousToken.end.character),range:e.previousToken.range,scope:e.currentScope})):qe.Selectors.File(e.token)?(e.next(),e.astProvider.featureFileExpression({filename:e.filename,start:new kn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new kn.ASTPosition(e.previousToken.line,e.previousToken.end.character),range:e.previousToken.range,scope:e.currentScope})):super.parseAtom()}parseStatement(){let e=this,n=e.backpatches.peek();if(e.isType(kn.TokenType.Keyword))switch(e.token.value){case qs.GreybelKeyword.Include:case qs.GreybelKeyword.IncludeWithComment:{e.next();let i=e.parseFeatureIncludeStatement();e.lineRegistry.addItemToLines(i),n.body.push(i);return}case qs.GreybelKeyword.Import:case qs.GreybelKeyword.ImportWithComment:{e.next();let i=e.parseFeatureImportStatement();e.lineRegistry.addItemToLines(i),n.body.push(i);return}case qs.GreybelKeyword.Envar:{e.next();let i=e.parseFeatureEnvarExpression();e.lineRegistry.addItemToLines(i),n.body.push(i);return}case qs.GreybelKeyword.Inject:{e.next();let i=e.parseFeatureInjectExpression();e.lineRegistry.addItemToLines(i),n.body.push(i);return}case qs.GreybelKeyword.Debugger:{e.next();let i=e.astProvider.featureDebuggerExpression({start:new kn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new kn.ASTPosition(e.previousToken.line,e.previousToken.end.character),range:e.previousToken.range,scope:e.currentScope});e.lineRegistry.addItemToLines(i),n.body.push(i);return}default:break}super.parseStatement()}parseChunk(){let e=this;e.next();let n=e.token,r=e.astProvider.chunkAdvanced({start:n.start,end:null,range:[n.range[0],null]}),i=new kn.PendingChunk(r,e.lineRegistry);for(e.backpatches.setDefault(i),e.pushScope(r);!qe.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!qe.Selectors.EndOfFile(e.token));)e.lexer.recordSnapshot(),e.statementErrors=[],e.parseStatement(),e.statementErrors.length>0&&e.tryToRecover();let s=e.backpatches.pop();for(;!(0,kn.isPendingChunk)(s);){let o=e.raise(`found open block ${s.block.type}`,new B1.Range(s.block.start,s.block.start));if(s.complete(e.previousToken),e.errors.push(o),!e.unsafe)throw o;s=e.backpatches.pop()}return e.finishRemaingScopes(),e.popScope(),i.complete(e.token),r.literals=e.literals,r.scopes=e.scopes,r.lines=e.lineRegistry.lines,r.imports=e.imports,r.includes=e.includes,r.injects=e.injects,r}};Lu.default=B_});var Vr=m(Mt=>{"use strict";var nF=Mt&&Mt.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Nu=Mt&&Mt.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&nF(e,t,n)},U_=Mt&&Mt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.Parser=Mt.LexerValidator=Mt.Lexer=void 0;var rF=C_();Object.defineProperty(Mt,"Lexer",{enumerable:!0,get:function(){return U_(rF).default}});var iF=x_();Object.defineProperty(Mt,"LexerValidator",{enumerable:!0,get:function(){return U_(iF).default}});var sF=W1();Object.defineProperty(Mt,"Parser",{enumerable:!0,get:function(){return U_(sF).default}});Nu(F_(),Mt);Nu(k_(),Mt);Nu(zo(),Mt);Nu(Ko(),Mt);Nu($_(),Mt)});var W_=m(_d=>{"use strict";Object.defineProperty(_d,"__esModule",{value:!0});_d.merge=void 0;function oF(t,e,n=1e4){if(e.length<=n){Array.prototype.push.apply(t,e);return}for(let r=0;r<e.length;r+=n)Array.prototype.push.apply(t,e.slice(r,r+n))}_d.merge=oF});var H1=m(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.parseMapDescription=void 0;var aF=bb();function uF(t){return{path:t.name,type:t.type}}function cF(t){let e=t.tags.find(r=>r.tag==="type");if(!e)return null;let n=t.tags.filter(r=>r.tag==="property");return{type:e.name,properties:n.map(uF)}}function lF(t){let e=(0,aF.parse)(`/**
107
+ */`),[n]=e;if(n.tags.length>0){let{descriptions:r,args:i,returns:s,examples:o}=Bj(n);return y_.SignatureDefinitionFunction.parse({type:y_.SignatureDefinitionBaseType.Function,arguments:t.getArguments().map((a,u)=>{let c=a.getLabel(),l=a.getTypes().map(d=>d.toString()),h=a.isOptional();return{types:l,opt:h,...i[u],label:c}}),returns:s,description:r,example:o})}return t}Ms.enrichWithMetaInformation=Wj});var __=m(cd=>{"use strict";Object.defineProperty(cd,"__esModule",{value:!0});cd.createResolveChain=void 0;var Lt=ke();function es(t,e,n=null,r=!1){switch(t.type){case Lt.ASTType.ParenthesisExpression:{es(t.expression,e,n);return}case Lt.ASTType.MemberExpression:{let i=t;es(i.base,e),e.push({ref:t,getter:i.identifier,unary:n,isInCallExpression:r});return}case Lt.ASTType.IndexExpression:{let i=t;es(i.base,e),e.push({ref:t,getter:i.index,unary:n,isInCallExpression:r});return}case Lt.ASTType.CallStatement:{es(t.expression,e,n,!0);return}case Lt.ASTType.CallExpression:{es(t.base,e,n,!0);return}case Lt.ASTType.NegationExpression:case Lt.ASTType.BinaryNegatedExpression:case Lt.ASTType.UnaryExpression:{let i=t;es(i.argument,e,i);return}case Lt.ASTType.Identifier:{e.push({ref:t,getter:t,unary:n,isInCallExpression:r});return}case Lt.ASTType.NumericLiteral:case Lt.ASTType.StringLiteral:case Lt.ASTType.NilLiteral:case Lt.ASTType.BooleanLiteral:case Lt.ASTType.MapConstructorExpression:case Lt.ASTType.ListConstructorExpression:case Lt.ASTType.BinaryExpression:case Lt.ASTType.LogicalExpression:case Lt.ASTType.ComparisonGroupExpression:{e.push({ref:t,value:t,unary:n,isInCallExpression:r});return}case Lt.ASTType.SliceExpression:es(t.base,e),e.push({ref:t,unary:n,isInCallExpression:r})}}function Uj(t){let e=[];return es(t,e),e}cd.createResolveChain=Uj});var H1=m(v_=>{function U1(t,e){return t>e?1:-1}v_.hash=function t(e,n){var r=5381;if(typeof e=="object"&&e!==null&&(e.toString===Object.prototype.toString||e.toString===Array.prototype.toString)){n||(n=new WeakSet);for(var i=Object.keys(e).sort(U1),s=0;s<i.length;s++){var o=i[s],a=e[o];if(r=33*r^t(o,n),typeof a=="object"&&a!==null&&(e.toString===Object.prototype.toString||e.toString===Array.prototype.toString)){if(n.has(a))continue;n.add(a)}r=33*r^t(a,n)}return 33*r^t(e.constructor,n)}var u=typeof e;try{e instanceof Date?u+=e.getTime():u+=String(e)}catch{u+=String(Object.assign({},e))}for(var c=0;c<u.length;c++)r=33*r^u.charCodeAt(c);return r},v_.sortNumbers=U1});var T_=m(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.ObjectSet=Go.ObjectSetIterator=void 0;var S_=H1(),ld=class{constructor(e){let n=this;n.value=e,n.index=0}next(){let e=this;return e.index>=e.value.length?{value:null,done:!0}:{value:e.value[e.index++],done:!1}}};Go.ObjectSetIterator=ld;var w_=class{constructor(e){let r=(e?Array.from(e):[]).map(i=>[(0,S_.hash)(i),i]);this._map=new Map(r),this._first=null,this._last=null,r.length>0&&(this._first=r[0][0],this._last=r[r.length-1][0])}[Symbol.iterator](){return new ld(Array.from(this._map.values()))}first(){return this._first!=null?this._map.get(this._first)??null:null}last(){return this._last!=null?this._map.get(this._last)??null:null}toArray(){return Array.from(this._map.values())}add(e){let n=(0,S_.hash)(e);return this._map.set(n,e),this._first??(this._first=n),this._last=n,this}delete(e){let n=(0,S_.hash)(e);return this._map.delete(n)}extend(e){return e._map.forEach((n,r)=>{this._map.set(r,n),this._first??(this._first=r),this._last=r}),this}toJSON(){return Array.from(this._map.values())}clear(){this._map.clear()}};Go.ObjectSet=w_});var E_=m(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0});hd.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION=void 0;hd.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION="This is a custom method. You can add a description for this method by adding a comment above or after the function.\n```\nmyFunction = function(a, b, c) // This function does xyz\n```\nor\n```\n/*\n This function does xyz\n*/\nmyFunction = function(a, b, c)\n```"});var Ls=m(Eu=>{"use strict";Object.defineProperty(Eu,"__esModule",{value:!0});Eu.CompletionItemKind=void 0;var Hj;(function(t){t.Variable="var",t.Property="property",t.Function="function",t.Literal="literal",t.Constant="constant",t.Internal="internal",t.InternalFunction="internal-function",t.InternalProperty="internal-property",t.ListConstructor="list",t.MapConstructor="map",t.Expression="expr",t.Unknown="unknown"})(Hj=Eu.CompletionItemKind||(Eu.CompletionItemKind={}))});var Ns=m(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.IsaPropertyPattern=yi.IdentifierPropertyPattern=yi.PropertyType=void 0;var x_;(function(t){t.Type="t",t.Identifier="i"})(x_=yi.PropertyType||(yi.PropertyType={}));yi.IdentifierPropertyPattern=`${x_.Identifier}:`;yi.IsaPropertyPattern=`${x_.Identifier}:__isa`});var k_=m(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.isResolveChainItemWithValue=Xr.isResolveChainItemWithIdentifier=Xr.isResolveChainItemWithMember=Xr.isResolveChainItemWithIndex=void 0;var ir=ke(),Gj=t=>t!=null&&t.ref.type===ir.ASTType.IndexExpression;Xr.isResolveChainItemWithIndex=Gj;var zj=t=>t!=null&&t.ref.type===ir.ASTType.MemberExpression;Xr.isResolveChainItemWithMember=zj;var Kj=t=>t!=null&&t.ref.type===ir.ASTType.Identifier;Xr.isResolveChainItemWithIdentifier=Kj;var Vj=new Set([ir.ASTType.NumericLiteral,ir.ASTType.StringLiteral,ir.ASTType.NilLiteral,ir.ASTType.BooleanLiteral,ir.ASTType.MapConstructorExpression,ir.ASTType.ListConstructorExpression,ir.ASTType.BinaryExpression,ir.ASTType.LogicalExpression,ir.ASTType.ComparisonGroupExpression]),Xj=t=>t!=null&&Vj.has(t.ref.type);Xr.isResolveChainItemWithValue=Xj});var A_=m(dd=>{"use strict";Object.defineProperty(dd,"__esModule",{value:!0});dd.isSignatureDefinitionFunction=void 0;var Yj=jn(),Jj=t=>t.getType().type===Yj.SignatureDefinitionBaseType.Function;dd.isSignatureDefinitionFunction=Jj});var C_=m(fd=>{"use strict";Object.defineProperty(fd,"__esModule",{value:!0});fd.aggregateEntity=void 0;var Qj=t=>{let e=new Set,n=t;for(;n!=null&&!e.has(n);)e.add(n),n=n.getIsa();return Array.from(e)};fd.aggregateEntity=Qj});var xu=m(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});pd.injectIdentifers=void 0;var Zj=Ns(),eF=C_(),tF=(t,e)=>{let n=(0,eF.aggregateEntity)(e);for(let r=0;r<n.length;r++)n[r].values.forEach((s,o)=>{if(o.startsWith(Zj.IdentifierPropertyPattern)){let a=o.slice(2);if(t.has(a))return;t.set(a,{kind:s.kind,line:s.source===e.source?s.line:-1})}})};pd.injectIdentifers=tF});var md=m(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});gd.isEligibleForProperties=void 0;var O_=jn(),nF=t=>t.types.has(O_.SignatureDefinitionBaseType.Map)||t.types.has(O_.SignatureDefinitionBaseType.List)||t.types.has(O_.SignatureDefinitionBaseType.Any);gd.isEligibleForProperties=nF});var bd=m(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:!0});yd.lookupProperty=void 0;var rF=md(),iF=(t,e,n)=>{let r=e,i=new Set([r]);for(;(0,rF.isEligibleForProperties)(r);){let s=r.values.get(`${t}:${n}`);if(s!=null)return s;let o=r.getIsa();if(o==null||i.has(o))break;i.add(o),r=o}return null};yd.lookupProperty=iF});var R_=m(_d=>{"use strict";Object.defineProperty(_d,"__esModule",{value:!0});_d.mergeUnique=void 0;function sF(t,e,n=1e4){let r=Array.from(new Set([...t,...e]));if(t.length=0,r.length<=n){Array.prototype.push.apply(t,r);return}for(let i=0;i<r.length;i+=n)Array.prototype.push.apply(t,r.slice(i,i+n))}_d.mergeUnique=sF});var zo=m(Sd=>{"use strict";Object.defineProperty(Sd,"__esModule",{value:!0});Sd.Entity=void 0;var yt=jn(),qs=Ls(),sr=Ns(),oF=A_(),aF=xu(),ku=md(),vd=bd(),uF=R_(),G1=T_(),bi=class t{static resolveEntity(e,n,r=!1){if(n.isCallable()&&!r){let i=n.getReturnEntity();if(i!==null)return i;let s=n.getCallableReturnTypes();return s?new t({source:n.source,kind:qs.CompletionItemKind.Variable,container:e,label:n.label,context:n.context}).addTypesWithMeta(s):new t({source:n.source,kind:qs.CompletionItemKind.Variable,container:e,label:n.label,context:n.context}).addType(yt.SignatureDefinitionBaseType.Any)}return n}get source(){return this._source}get definitions(){return this._definitions}get kind(){return this._kind}get line(){return this._line}get signatureDefinitions(){return this._signatureDefinitions}get context(){return this._context}get label(){return this._label}get types(){return this._types}get values(){return this._values}constructor(e){this._source=e.source,this._isAPI=e.isAPI??!1,this._isFromSignature=e.isFromSignature??!1,this._kind=e.kind,this._line=e.line??-1,this._label=e.label??"anonymous",this._signatureDefinitions=e.signatureDefinitions??new G1.ObjectSet,this._types=e.types??new Set,this._values=e.values??new Map,this._context=e.context??null,this._container=e.container,this._definitions=e.definitions??[],this._returnEntity=e.returnEntity??null}isFromSignature(){return this._isFromSignature}hasContext(){return this._context!=null&&!this._context.isAPI}getIsa(){return this._values.get(sr.IsaPropertyPattern)??null}hasIsa(){return this._values.has(sr.IsaPropertyPattern)}isAPI(){return this._isAPI}isCallable(){return this._types.has(yt.SignatureDefinitionBaseType.Function)}getCallableReturnTypes(){if(!this.isCallable())return null;let e=Array.from(this._signatureDefinitions).filter(n=>(0,oF.isSignatureDefinitionFunction)(n));return e.length===0?null:e.flatMap(n=>n.getReturns())}addSignatureType(e){return this._signatureDefinitions.add(e),this.addType(e.getType().type),this}setReturnEntity(e){return this._returnEntity=e,this}getReturnEntity(){return this._returnEntity}setKind(e){return this._kind=e,this}setLine(e){return this._line=e,this}setLabel(e){return this._label=e,this}setContext(e){return this._context=e,this}addType(e){return this._types.add(e),this}addTypes(e){for(let n=0;n<e.length;n++)this._types.add(e[n]);return this}addTypeWithMeta(e){if(this._types.add(e.type),e.type===yt.SignatureDefinitionBaseType.Map||e.type===yt.SignatureDefinitionBaseType.List){let n=e.type===yt.SignatureDefinitionBaseType.Map?e.keyType.type??yt.SignatureDefinitionBaseType.Any:yt.SignatureDefinitionBaseType.Number,r=new t({source:this._source,kind:qs.CompletionItemKind.Property,container:this._container,context:this});e.valueType.type===yt.SignatureDefinitionBaseType.Map||e.valueType.type===yt.SignatureDefinitionBaseType.List?r.addTypeWithMeta(e.valueType):r.addType(e.valueType.type??yt.SignatureDefinitionBaseType.Any),t.handlers.type.setProperty(this,this._container,n,r)}return this}addTypesWithMeta(e){for(let n=0;n<e.length;n++)this.addTypeWithMeta(e[n]);return this}hasProperty(e){switch(typeof e){case"object":return t.handlers.entity.hasProperty(this,this._container,e);default:return t.handlers.identifier.hasProperty(this,this._container,e)}}resolveProperty(e,n=!1){switch(typeof e){case"object":return t.handlers.entity.resolveProperty(this,this._container,e,n);default:return t.handlers.identifier.resolveProperty(this,this._container,e,n)}}setProperty(e,n,r=!1){switch(typeof e){case"object":return t.handlers.entity.setProperty(this,this._container,e,n,r);default:return t.handlers.identifier.setProperty(this,this._container,e,n,r)}}extend(e,n=!1,r=!1){if(e===this)return this;let i=new WeakSet([e]),s=[{target:this,source:e}];for(;s.length>0;){let o=s.pop(),a=o.target,u=o.source;a._isFromSignature=!1,a._signatureDefinitions.extend(u._signatureDefinitions),n&&(r?a._definitions=[...a._definitions,...u._definitions]:(0,uF.mergeUnique)(a._definitions,u._definitions)),a.addTypes(Array.from(u.types)),u.values.forEach((c,l)=>{let h=a._values.get(l);h==null?a._values.set(l,c.copy({container:a._container,context:a,deepCopy:r})):i.has(c)||(i.add(c),s.push({target:h,source:c}))})}return this}insertSignature(e){let n=Object.keys(e.getDefinitions());this.addType(yt.SignatureDefinitionBaseType.Map);for(let r=0;r<n.length;r++){let i=n[r],s=e.getDefinition(i),o=new t({source:this._source,label:i,kind:s.getType().type===yt.SignatureDefinitionBaseType.Function?qs.CompletionItemKind.InternalFunction:qs.CompletionItemKind.InternalProperty,container:this._container,isFromSignature:!0});o.addSignatureType(s),this.setProperty(i,o)}return this}getPropertyTypes(){let e=new Set;return this._values.forEach((n,r)=>{let[i,s]=r.split(":");i===sr.PropertyType.Type?e.add(s):e.add(yt.SignatureDefinitionBaseType.String)}),Array.from(e)}getValueTypes(){let e=new Set;return this._values.forEach(n=>{n.types.forEach(r=>{e.add(r)})}),Array.from(e)}getAvailableIdentifier(){let e=new Map;return this._types.forEach(n=>{this._container.getAvailableIdentifier(n).forEach((i,s)=>{e.set(s,i)})}),(0,aF.injectIdentifers)(e,this),e}toJSON(e=new WeakMap){if(e.has(this))return e.get(this);let n={};return e.set(this,n),n.kind=this.kind,n.signatureDefinitions=this._signatureDefinitions.toJSON(),n.types=Array.from(this._types),n.values=Array.from(this._values).reduce((r,[i,s])=>(r[i]=s?.toJSON(e),r),{}),n}toMeta(){let e=[];return this.types.forEach(n=>{let r={type:n};switch(n){case yt.SignatureDefinitionBaseType.Map:{let i=this.getPropertyTypes();i.length===1?r.keyType=i[0]:r.keyType=yt.SignatureDefinitionBaseType.Any;let s=this.getValueTypes();s.length===1?r.valueType=s[0]:r.valueType=yt.SignatureDefinitionBaseType.Any;break}case yt.SignatureDefinitionBaseType.List:{let i=t.handlers.type.resolveProperty(this,this._container,yt.SignatureDefinitionBaseType.Number);i!=null&&i.types.size===1?r.valueType=i.types.values().next().value:r.valueType=yt.SignatureDefinitionBaseType.Any;break}}e.push(r)}),e}copy(e={}){let n=new t({source:e.source??this._source,kind:e.kind??this._kind,line:e.line??this._line,isFromSignature:e.isFromSignature??this._isFromSignature,isAPI:e.isAPI??this._isAPI,container:e.container??this._container,label:e.label??this._label,context:e.context??this._context,signatureDefinitions:new G1.ObjectSet(Array.from(this._signatureDefinitions,s=>s.copy())),types:new Set(this._types),returnEntity:this._returnEntity,values:e.values??this.values,definitions:e.definitions??this._definitions});if(!e.deepCopy)return n;let r=new WeakMap;function i(s,o){let a=r.get(o);if(a)return a;let u=o.copy({container:e.container,line:e.line,context:s,values:new Map});return r.set(o,u),o.values.forEach((c,l)=>{u._values.set(l,i(u,c))}),u._definitions=[...o.definitions],u}return n._values=new Map,this._values.forEach((s,o)=>{n._values.set(o,i(n,s))}),n._definitions=[...this._definitions],n}};Sd.Entity=bi;bi.handlers={identifier:{hasProperty(t,e,n){return!!(0,vd.lookupProperty)(sr.PropertyType.Identifier,t,n)||!t.isAPI()&&!!e.getDefinition(Array.from(t.types),n,!0)},resolveProperty(t,e,n,r=!1){let i=(0,vd.lookupProperty)(sr.PropertyType.Identifier,t,n)??null;return i==null?t.isAPI()?null:e.getDefinition(Array.from(t.types),n,r):bi.resolveEntity(e,i,r)},setProperty(t,e,n,r,i=!1){if(!(0,ku.isEligibleForProperties)(t))return!1;let s=`${sr.PropertyType.Identifier}:${n}`,o=t.values.get(s);return o?o.extend(r,i):t.values.set(s,r.copy({container:e,label:n,context:t,definitions:i?r.definitions:[]})),!0}},entity:{hasProperty(t,e,n){if(!(0,ku.isEligibleForProperties)(t))return!1;for(let r of n.types)if(t.values.has(`${sr.PropertyType.Type}:${r}`))return!0;return!1},resolveProperty(t,e,n,r=!1){if(!(0,ku.isEligibleForProperties)(t))return new bi({source:t.source,kind:qs.CompletionItemKind.Variable,container:e,label:n.label,context:t}).addType(yt.SignatureDefinitionBaseType.Any);let i=new bi({source:n.source,kind:qs.CompletionItemKind.Variable,container:e,label:n.label,context:t});return n.types.has(yt.SignatureDefinitionBaseType.Any)?t.values.forEach(s=>{i.extend(s)}):n.types.forEach(s=>{let o=t.values.get(`${sr.PropertyType.Type}:${s}`);o&&i.extend(o)}),i.types.size===0&&i.addType(yt.SignatureDefinitionBaseType.Any),bi.resolveEntity(e,i,r)},setProperty(t,e,n,r,i=!1){return(0,ku.isEligibleForProperties)(t)?(n.types.forEach(s=>{let o=`${sr.PropertyType.Type}:${s}`,a=t.values.get(o);a?a.extend(r,i):t.values.set(o,r.copy({container:e,label:s,context:t,definitions:i?r.definitions:[]}))}),!0):!1}},type:{hasProperty(t,e,n){return!!(0,vd.lookupProperty)(sr.PropertyType.Type,t,n)},resolveProperty(t,e,n,r=!1){let i=(0,vd.lookupProperty)(sr.PropertyType.Type,t,n)??null;return i==null?null:bi.resolveEntity(e,i,r)},setProperty(t,e,n,r,i=!1){if(!(0,ku.isEligibleForProperties)(t))return!1;let s=`${sr.PropertyType.Type}:${n}`,o=t.values.get(s);return o?o.extend(r,i):t.values.set(s,r.copy({container:e,label:n,context:t,definitions:i?r.definitions:[]})),!0}}}});var I_=m(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});Ed.Scope=void 0;var wd=jn(),js=Ls(),cF=Ns(),P_=xu(),Td=zo(),D_=class t{get source(){return this._source}get definitions(){return[]}get signatureDefinitions(){return null}get kind(){return js.CompletionItemKind.Constant}get line(){return this._locals.line}get label(){return this._locals.label}get context(){return this._locals.context}get types(){return new Set(wd.SignatureDefinitionBaseType.Map)}get values(){return this._locals.values}get globals(){return this._globals}get outer(){return this._parent?.locals??null}get locals(){return this._locals}constructor(e){this._source=e.source,this._container=e.container,this._parent=e.parent??null,this._globals=e.globals,this._locals=e.locals??new Td.Entity({source:this._source,kind:js.CompletionItemKind.Constant,container:this._container,label:"locals"}).addType(wd.SignatureDefinitionBaseType.Map)}getIsa(){return null}hasIsa(){return!1}setCustomType(e,n){this._container.setCustomType(e,n)}addSignatureType(){throw new Error("Cannot add signature type to scope!")}hasProperty(e){return this._locals.hasProperty(e)}resolveProperty(e,n){return this._locals.resolveProperty(e,n)}resolveNamespace(e,n=!1){if(typeof e!="string")throw new Error("Invalid property type for scope!");if(e==="locals")return this._locals;if(e==="outer")return this._parent?.locals??this._globals;if(e==="globals")return this._globals;let r=`${cF.PropertyType.Identifier}:${e}`;if(this._locals.values.has(r)){let i=this._locals.values.get(r);return Td.Entity.resolveEntity(this._container,i,n)}else if(this._parent?.locals.values.has(r)){let i=this._parent.locals.values.get(r);return Td.Entity.resolveEntity(this._container,i,n)}else if(this._globals.values.has(r)){let i=this._globals.values.get(r);return Td.Entity.resolveEntity(this._container,i,n)}return this._container.getGeneralDefinition(e,n)}setProperty(e,n){return this._locals.setProperty(e,n)}extend(e){return this._locals.extend(e),this}addType(){throw new Error("Scope cannot get type assigned!")}addTypes(){throw new Error("Scope cannot get types assigned!")}addTypeWithMeta(){throw new Error("Scope cannot get meta type assigned!")}addTypesWithMeta(){throw new Error("Scope cannot get meta types assigned!")}setReturnEntity(){throw new Error("Scope cannot set return entity!")}getReturnEntity(){throw new Error("Scope cannot get return entity!")}setKind(e){return this._locals.setKind(e),this}setLine(e){return this._locals.setLine(e),this}setLabel(e){return this._locals.setLabel(e),this}setContext(e){return this._locals.setContext(e),this}insertSignature(e){return this._locals.insertSignature(e),this}isAPI(){return!1}hasContext(){return!1}isFromSignature(){return!1}isCallable(){return!1}getCallableReturnTypes(){return null}getPropertyTypes(){return this._locals.getPropertyTypes()}getValueTypes(){return this._locals.getValueTypes()}getAvailableIdentifier(){let e=new Map([["globals",{kind:js.CompletionItemKind.Constant,line:-1}],["locals",{kind:js.CompletionItemKind.Constant,line:-1}],["outer",{kind:js.CompletionItemKind.Constant,line:-1}],...this._container.getAvailableIdentifier(wd.SignatureDefinitionBaseType.General)]);return this._locals!==this._globals&&(0,P_.injectIdentifers)(e,this._globals),this._parent&&(0,P_.injectIdentifers)(e,this._parent.locals),(0,P_.injectIdentifers)(e,this._locals),this.isSelfAvailable()&&e.set("self",{kind:js.CompletionItemKind.Constant,line:-1}),this.isSuperAvailable()&&e.set("super",{kind:js.CompletionItemKind.Constant,line:-1}),e}isSelfAvailable(){return this._locals.context!=null&&this._locals.context.types.has(wd.SignatureDefinitionBaseType.Map)}isSuperAvailable(){return this.isSelfAvailable()&&this._locals.context.hasProperty("__isa")}toJSON(){return this._locals.toJSON()}toMeta(){return this._locals.toMeta()}copy(e={}){return new t({source:this._source,container:e.container??this._container,parent:this._parent.copy({container:e.container,deepCopy:!0}),globals:this._globals.copy({container:e.container,deepCopy:!0}),locals:this._locals.copy({...e,deepCopy:!0})})}};Ed.Scope=D_});var Ko=m(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});Au.GreybelKeyword=void 0;var lF;(function(t){t.Envar="#envar",t.Import="#import",t.Include="#include",t.ImportWithComment="//import",t.IncludeWithComment="//include",t.Debugger="debugger",t.Line="#line",t.File="#filename",t.Inject="#inject"})(lF=Au.GreybelKeyword||(Au.GreybelKeyword={}))});var N_=m(L_=>{"use strict";Object.defineProperty(L_,"__esModule",{value:!0});var Fs=ke(),hF=Ko(),M_=class extends Fs.LexerValidator{constructor(){super(...arguments),this.isKeyword=Set.prototype.has.bind(new Set([...Object.values(Fs.Keyword),...Object.values(hF.GreybelKeyword)]))}isIdentifierStart(e){return super.isIdentifierStart(e)||e===Fs.CharacterCode.HASH}isMultilineComment(e,n){return Fs.CharacterCode.SLASH===e&&Fs.CharacterCode.ASTERISK===n}isMultilineCommentEnd(e,n){return Fs.CharacterCode.ASTERISK===e&&Fs.CharacterCode.SLASH===n}isComment(e,n){return super.isComment(e,n)||this.isMultilineComment(e,n)}};L_.default=M_});var q_=m(Cu=>{"use strict";Object.defineProperty(Cu,"__esModule",{value:!0});Cu.CharacterCode=void 0;var dF;(function(t){t[t.VERTICAL_LINE=124]="VERTICAL_LINE",t[t.AMPERSAND=38]="AMPERSAND"})(dF=Cu.CharacterCode||(Cu.CharacterCode={}))});var Vo=m(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});Ou.Operator=void 0;var fF;(function(t){t.BitwiseAnd="&",t.BitwiseOr="|",t.LeftShift="<<",t.RightShift=">>",t.UnsignedRightShift=">>>"})(fF=Ou.Operator||(Ou.Operator={}))});var F_=m(Ru=>{"use strict";var pF=Ru&&Ru.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ru,"__esModule",{value:!0});var kr=ke(),gF=pF(N_()),z1=q_(),K1=Ko(),j_=Vo();function V1(t){let e=this.content[this.index];return this.index+=e.length,this.createPunctuator(e,t)}var xd=class t extends kr.Lexer{constructor(e,n={}){n.validator=n.validator||new gF.default,super(e,n)}scan(e,n){let r=t.greybelScanHandlers[e];return r?r.call(this,n)||super.scan(e,n):super.scan(e,n)}scanMultilineComment(e){let n=this,r=n.line,i=n.lineStart,s=n.index,o=n.offset,a=n.offset,u=!1;for(;n.index<n.length;){let h=n.codeAt();if(n.validator.isEndOfLine(h))n.validator.isWinNewline(h,n.codeAt(1))&&n.index++,n.line++,a=n.index+1;else if(n.validator.isMultilineCommentEnd(n.codeAt(),n.codeAt(1))){u=!0;break}n.index++}if(!u)return n.raise("Unexpected end of file in multiline comment.",new kr.ASTRange(new kr.ASTPosition(r,s-o+1),new kr.ASTPosition(n.line,n.index-a+3)));let c=n.content.slice(s+2,n.index);n.index+=2;let l=new kr.Token({type:kr.TokenType.Comment,value:c,line:r,lineStart:i,range:[n.tokenStart,n.index],offsetRange:[o,a],afterSpace:e,lastLine:n.line,lastLineStart:n.lineStart});return n.offset=a,n.snapshot.enqueue(l),l}scanComment(e){let n=this,r=n.validator;return n.content.startsWith(K1.GreybelKeyword.ImportWithComment,n.index)||n.content.startsWith(K1.GreybelKeyword.IncludeWithComment,n.index)?(n.index++,n.scanIdentifierOrKeyword(e)):r.isMultilineComment(n.codeAt(),n.codeAt(1))?n.scanMultilineComment(e):super.scanComment(e)}};Ru.default=xd;xd.greybelScanHandlers={[kr.CharacterCode.ARROW_LEFT]:function(e){if(kr.CharacterCode.ARROW_LEFT===this.codeAt(1))return this.scanPunctuator(j_.Operator.LeftShift,e)},[kr.CharacterCode.ARROW_RIGHT]:function(e){if(kr.CharacterCode.ARROW_RIGHT===this.codeAt(1))return kr.CharacterCode.ARROW_RIGHT===this.codeAt(2)?this.scanPunctuator(j_.Operator.UnsignedRightShift,e):this.scanPunctuator(j_.Operator.RightShift,e)},[z1.CharacterCode.AMPERSAND]:V1,[z1.CharacterCode.VERTICAL_LINE]:V1}});var kd=m(Pu=>{"use strict";Object.defineProperty(Pu,"__esModule",{value:!0});Pu.ASTType=void 0;var mF;(function(t){t.FeatureImportExpression="FeatureImportExpression",t.FeatureIncludeExpression="FeatureIncludeExpression",t.FeatureEnvarExpression="FeatureEnvarExpression",t.FeatureInjectExpression="FeatureInjectExpression",t.FeatureDebuggerExpression="FeatureDebuggerExpression",t.FeatureLineExpression="FeatureLineExpression",t.FeatureFileExpression="FeatureFileExpression"})(mF=Pu.ASTType||(Pu.ASTType={}))});var B_=m(Ad=>{"use strict";Object.defineProperty(Ad,"__esModule",{value:!0});Ad.ASTChunkGreybel=void 0;var yF=ke(),$_=class t extends yF.ASTChunk{constructor(e){super(e),this.imports=e.imports||[],this.includes=e.includes||[],this.injects=e.injects||[]}clone(){return new t({literals:this.literals.map(e=>e.clone()),scopes:this.scopes.map(e=>e.clone()),imports:this.imports.map(e=>e.clone()),includes:this.includes.map(e=>e.clone()),injects:this.injects.map(e=>e.clone()),lines:this.lines,start:this.start,end:this.end,range:this.range,scope:this.scope})}};Ad.ASTChunkGreybel=$_});var K_=m(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.ASTFeatureFileExpression=or.ASTFeatureInjectExpression=or.ASTFeatureEnvarExpression=or.ASTFeatureIncludeExpression=or.ASTFeatureImportExpression=void 0;var Du=ke(),Iu=kd(),W_=class t extends Du.ASTBase{constructor(e){super(Iu.ASTType.FeatureImportExpression,e),this.name=e.name,this.path=e.path,this.chunk=e.chunk,this.namespace=e.namespace}toString(){return`FeatureImportExpression[${this.start}-${this.end}][name = ${this.name}, path = ${this.path}]`}clone(){return new t({name:this.name.clone(),path:this.path,chunk:this.chunk.clone(),namespace:this.namespace,start:this.start,end:this.end,range:this.range,scope:this.scope})}};or.ASTFeatureImportExpression=W_;var U_=class t extends Du.ASTBase{constructor(e){super(Iu.ASTType.FeatureIncludeExpression,e),this.path=e.path,this.chunk=e.chunk,this.namespace=e.namespace}toString(){return`FeatureIncludeExpression[${this.start}-${this.end}][path = ${this.path}]`}clone(){return new t({path:this.path,chunk:this.chunk.clone(),namespace:this.namespace,start:this.start,end:this.end,range:this.range,scope:this.scope})}};or.ASTFeatureIncludeExpression=U_;var H_=class t extends Du.ASTBase{constructor(e){super(Iu.ASTType.FeatureEnvarExpression,e),this.name=e.name}toString(){return`FeatureEnvarExpression[${this.start}-${this.end}][name = ${this.name}]`}clone(){return new t({name:this.name,start:this.start,end:this.end,range:this.range,scope:this.scope})}};or.ASTFeatureEnvarExpression=H_;var G_=class t extends Du.ASTBase{constructor(e){super(Iu.ASTType.FeatureInjectExpression,e),this.path=e.path}toString(){return`FeatureInjectExpression[${this.start}-${this.end}][path = ${this.path}]`}clone(){return new t({path:this.path,start:this.start,end:this.end,range:this.range,scope:this.scope})}};or.ASTFeatureInjectExpression=G_;var z_=class t extends Du.ASTBase{constructor(e){super(Iu.ASTType.FeatureFileExpression,e),this.filename=e.filename}toString(){return`FeatureFileExpression[${this.start}-${this.end}][path = ${this.filename}]`}clone(){return new t({filename:this.filename,start:this.start,end:this.end,range:this.range,scope:this.scope})}};or.ASTFeatureFileExpression=z_});var Y_=m(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.ASTFeatureInjectExpression=Wt.ASTFeatureIncludeExpression=Wt.ASTFeatureImportExpression=Wt.ASTFeatureFileExpression=Wt.ASTFeatureEnvarExpression=Wt.ASTChunkGreybel=Wt.ASTType=Wt.ASTProvider=void 0;var V_=ke(),X1=kd(),bF=B_(),Mu=K_(),X_=class extends V_.ASTProvider{featureImportExpression(e){return new Mu.ASTFeatureImportExpression(e)}featureIncludeExpression(e){return new Mu.ASTFeatureIncludeExpression(e)}featureEnvarExpression(e){return new Mu.ASTFeatureEnvarExpression(e)}featureInjectExpression(e){return new Mu.ASTFeatureInjectExpression(e)}featureDebuggerExpression(e){return new V_.ASTBase(X1.ASTType.FeatureDebuggerExpression,e)}featureLineExpression(e){return new V_.ASTBase(X1.ASTType.FeatureLineExpression,e)}featureFileExpression(e){return new Mu.ASTFeatureFileExpression(e)}chunk(e){return new bF.ASTChunkGreybel(e)}};Wt.ASTProvider=X_;var _F=kd();Object.defineProperty(Wt,"ASTType",{enumerable:!0,get:function(){return _F.ASTType}});var vF=B_();Object.defineProperty(Wt,"ASTChunkGreybel",{enumerable:!0,get:function(){return vF.ASTChunkGreybel}});var Lu=K_();Object.defineProperty(Wt,"ASTFeatureEnvarExpression",{enumerable:!0,get:function(){return Lu.ASTFeatureEnvarExpression}});Object.defineProperty(Wt,"ASTFeatureFileExpression",{enumerable:!0,get:function(){return Lu.ASTFeatureFileExpression}});Object.defineProperty(Wt,"ASTFeatureImportExpression",{enumerable:!0,get:function(){return Lu.ASTFeatureImportExpression}});Object.defineProperty(Wt,"ASTFeatureIncludeExpression",{enumerable:!0,get:function(){return Lu.ASTFeatureIncludeExpression}});Object.defineProperty(Wt,"ASTFeatureInjectExpression",{enumerable:!0,get:function(){return Lu.ASTFeatureInjectExpression}})});var J_=m(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.SelectorGroups=bt.SelectorGroupType=bt.Selectors=bt.SelectorTypes=void 0;var Ue=ke(),Cd=Ko(),Nu=Vo(),SF;(function(t){t.From="From",t.Envar="Envar",t.Inject="Inject",t.Line="Line",t.File="File",t.LeftShift="LeftShift",t.RightShift="RightShift",t.UnsignedRightShift="UnsignedRightShift",t.BitwiseOr="BitwiseOr",t.BitwiseAnd="BitwiseAnd",t.Escape="Escape"})(SF=bt.SelectorTypes||(bt.SelectorTypes={}));bt.Selectors=Object.assign(Object.assign({},Ue.Selectors),{From:(0,Ue.createSelector)({type:Ue.TokenType.Identifier,value:"from"}),Envar:(0,Ue.createSelector)({type:Ue.TokenType.Keyword,value:Cd.GreybelKeyword.Envar}),Inject:(0,Ue.createSelector)({type:Ue.TokenType.Keyword,value:Cd.GreybelKeyword.Inject}),Line:(0,Ue.createSelector)({type:Ue.TokenType.Keyword,value:Cd.GreybelKeyword.Line}),File:(0,Ue.createSelector)({type:Ue.TokenType.Keyword,value:Cd.GreybelKeyword.File}),LeftShift:(0,Ue.createSelector)({type:Ue.TokenType.Punctuator,value:Nu.Operator.LeftShift}),RightShift:(0,Ue.createSelector)({type:Ue.TokenType.Punctuator,value:Nu.Operator.RightShift}),UnsignedRightShift:(0,Ue.createSelector)({type:Ue.TokenType.Punctuator,value:Nu.Operator.UnsignedRightShift}),BitwiseOr:(0,Ue.createSelector)({type:Ue.TokenType.Punctuator,value:Nu.Operator.BitwiseOr}),BitwiseAnd:(0,Ue.createSelector)({type:Ue.TokenType.Punctuator,value:Nu.Operator.BitwiseAnd}),Escape:(0,Ue.createSelector)({type:Ue.TokenType.Punctuator,value:Ue.Operator.Escape})});var _i;(function(t){t.MapSeparator="MapSeparator",t.ListSeparator="ListSeparator",t.PathSegmentEnd="PathSegmentEnd",t.BitwiseOperators="BitwiseOperators"})(_i=bt.SelectorGroupType||(bt.SelectorGroupType={}));bt.SelectorGroups=Object.assign(Object.assign({},Ue.SelectorGroups),{[_i.MapSeparator]:(0,Ue.createSelectorGroup)(_i.MapSeparator,[bt.Selectors.MapSeperator,bt.Selectors.CRBracket]),[_i.ListSeparator]:(0,Ue.createSelectorGroup)(_i.ListSeparator,[bt.Selectors.MapSeperator,bt.Selectors.SRBracket]),[_i.PathSegmentEnd]:(0,Ue.createSelectorGroup)(_i.PathSegmentEnd,[bt.Selectors.EndOfLine,bt.Selectors.Comment,bt.Selectors.EndOfFile]),[_i.BitwiseOperators]:(0,Ue.createSelectorGroup)(_i.BitwiseOperators,[bt.Selectors.LeftShift,bt.Selectors.RightShift,bt.Selectors.UnsignedRightShift])})});var Q1=m(qu=>{"use strict";var wF=qu&&qu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(qu,"__esModule",{value:!0});var Fn=ke(),TF=Ha(),Y1=Ya(),EF=wF(F_()),xF=Y_(),$s=Ko(),J1=Vo(),je=J_(),Q_=class extends Fn.Parser{constructor(e,n={}){var r;n.lexer=n.lexer||new EF.default(e,{unsafe:n.unsafe,tabWidth:n.tabWidth}),n.astProvider=n.astProvider||new xF.ASTProvider,super(e,n);let i=this;i.filename=(r=n.filename)!==null&&r!==void 0?r:"unknown",i.imports=[],i.includes=[],i.injects=[]}skipNewlines(){var e;let n=this,r=0;for(;;){if(je.Selectors.Comment(n.token)){let i=((e=n.previousToken)===null||e===void 0?void 0:e.line)!==n.token.line,s=n.astProvider.comment({value:n.token.value,isMultiline:n.token.value.indexOf(`
108
+ `)!==-1,start:n.token.start,end:n.token.end,range:n.token.range,scope:n.currentScope,isStatement:i});n.lineRegistry.addItemToLines(s)}else if(je.Selectors.EndOfLine(n.token))r++;else break;n.next()}return r}parseMap(e=!1,n=!1){let r=this;if(!je.Selectors.CLBracket(r.token))return r.parseList(e,n);let i=r.currentScope,s=r.token,o=[],a=r.astProvider.mapConstructorExpression({fields:o,start:s.start,end:null,range:[s.range[0],null],scope:i});if(r.next(),je.Selectors.CRBracket(r.token))r.next();else for(;!je.Selectors.EndOfFile(r.token);){if(r.skipNewlines(),je.Selectors.CRBracket(r.token)){r.next();break}let u=r.astProvider.mapKeyString({key:null,value:null,start:r.token.start,end:null,range:[r.token.range[0],null],scope:i});u.key=r.parseExpr(null),r.requireToken(je.Selectors.MapKeyValueSeperator),r.skipNewlines(),u.value=r.parseExpr(u),u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),r.skipNewlines();let c=r.requireTokenOfAny(je.SelectorGroups.MapSeparator,s.start);if(je.Selectors.CRBracket(c))break}return a.end=r.token.start,a.range[1]=r.token.range[1],a}parseList(e=!1,n=!1){let r=this;if(!je.Selectors.SLBracket(r.token))return r.parseQuantity(e,n);let i=r.currentScope,s=r.token,o=[],a=r.astProvider.listConstructorExpression({fields:o,start:s.start,end:null,range:[s.range[0],null],scope:i});if(r.next(),je.Selectors.SRBracket(r.token))r.next();else for(;!je.Selectors.EndOfFile(r.token);){if(r.skipNewlines(),je.Selectors.SRBracket(r.token)){r.next();break}let u=r.astProvider.listValue({value:null,start:r.token.start,end:null,range:[r.token.range[0],null],scope:i});u.value=r.parseExpr(u),u.end=r.previousToken.end,u.range[1]=r.previousToken.range[1],o.push(u),r.skipNewlines();let c=r.requireTokenOfAny(je.SelectorGroups.ListSeparator,s.start);if(je.Selectors.SRBracket(c))break}return a.end=r.token.start,a.range[1]=r.token.range[1],a}parsePathSegment(){let e=this;if(this.token.type===Fn.ASTType.StringLiteral){let r=this.token.value;return this.next(),r}let n="";for(;!je.SelectorGroups.PathSegmentEnd(e.token);)n=n+e.token.value,e.next();return e.consumeMany(je.SelectorGroups.PathSegmentEnd),n}parseFeatureIncludeStatement(){let e=this,n=e.previousToken,r=e.parsePathSegment(),i=e.astProvider.featureIncludeExpression({path:r,start:n.start,end:e.previousToken.end,range:[n.range[0],e.previousToken.range[1]],scope:e.currentScope});return e.includes.push(i),i}parseFeatureImportStatement(){var e;let n=this,r=n.previousToken,i=n.parseIdentifier(Fn.ASTIdentifierKind.Variable);if(!n.consume(je.Selectors.From))return n.raise("expected from keyword",new Y1.Range(r.start,new TF.Position((e=n.token.lastLine)!==null&&e!==void 0?e:n.token.line,n.token.end.character))),n.parseInvalidCode();let s=n.parsePathSegment(),o=n.astProvider.featureImportExpression({name:i,path:s,start:r.start,end:n.previousToken.end,range:[r.range[0],n.previousToken.range[1]],scope:n.currentScope});return n.imports.push(o),n.currentScope.definitions.push(o),o}parseFeatureEnvarExpression(){let e=this,n=e.previousToken,r=e.token.value;return e.next(),e.astProvider.featureEnvarExpression({name:r,start:n.start,end:e.previousToken.end,range:[n.range[0],e.previousToken.range[1]],scope:e.currentScope})}parseFeatureInjectExpression(){let e=this,n=e.previousToken,r=this.parsePathSegment();e.next();let i=e.astProvider.featureInjectExpression({path:r,start:n.start,end:e.previousToken.end,range:[n.range[0],e.previousToken.range[1]],scope:e.currentScope});return e.injects.push(i),i}parseIsa(e=!1,n=!1){let r=this,i=r.token,s=r.parseBitwiseOr(e,n);if(je.Selectors.Isa(r.token)){r.next(),r.skipNewlines();let o=r.parseBitwiseOr();return r.astProvider.isaExpression({operator:Fn.Operator.Isa,left:s,right:o,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return s}parseBitwiseOr(e=!1,n=!1){let r=this,i=r.token,o=r.parseBitwiseAnd(e,n);for(;je.Selectors.BitwiseOr(r.token);){r.next();let a=r.parseBitwiseAnd();o=r.astProvider.binaryExpression({operator:J1.Operator.BitwiseOr,left:o,right:a,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseBitwiseAnd(e=!1,n=!1){let r=this,i=r.token,o=r.parseComparisons(e,n);for(;je.Selectors.BitwiseAnd(r.token);){r.next();let a=r.parseComparisons();o=r.astProvider.binaryExpression({operator:J1.Operator.BitwiseAnd,left:o,right:a,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseAddSub(e=!1,n=!1){let r=this,i=r.token,o=r.parseBitwise(e,n);for(;je.Selectors.Plus(r.token)||je.Selectors.Minus(r.token)&&(!n||!r.token.afterSpace||r.lexer.isAtWhitespace());){let a=r.token;r.next(),r.skipNewlines();let u=r.parseBitwise();o=r.astProvider.binaryExpression({operator:a.value,left:o,right:u,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseBitwise(e=!1,n=!1){let r=this,i=r.token,o=r.parseMultDiv(e,n);for(;je.SelectorGroups.BitwiseOperators(r.token);){let a=r.token;r.next(),r.skipNewlines();let u=r.parseMultDiv();o=r.astProvider.binaryExpression({operator:a.value,left:o,right:u,start:i.start,end:r.previousToken.end,range:[i.range[0],r.previousToken.range[1]],scope:r.currentScope})}return o}parseAtom(){let e=this;return je.Selectors.Envar(e.token)?(e.next(),e.parseFeatureEnvarExpression()):je.Selectors.Inject(e.token)?(e.next(),e.parseFeatureInjectExpression()):je.Selectors.Line(e.token)?(e.next(),e.astProvider.featureLineExpression({start:new Fn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new Fn.ASTPosition(e.previousToken.line,e.previousToken.end.character),range:e.previousToken.range,scope:e.currentScope})):je.Selectors.File(e.token)?(e.next(),e.astProvider.featureFileExpression({filename:e.filename,start:new Fn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new Fn.ASTPosition(e.previousToken.line,e.previousToken.end.character),range:e.previousToken.range,scope:e.currentScope})):super.parseAtom()}parseStatement(){let e=this,n=e.backpatches.peek();if(e.isType(Fn.TokenType.Keyword))switch(e.token.value){case $s.GreybelKeyword.Include:case $s.GreybelKeyword.IncludeWithComment:{e.next();let i=e.parseFeatureIncludeStatement();e.lineRegistry.addItemToLines(i),n.body.push(i);return}case $s.GreybelKeyword.Import:case $s.GreybelKeyword.ImportWithComment:{e.next();let i=e.parseFeatureImportStatement();e.lineRegistry.addItemToLines(i),n.body.push(i);return}case $s.GreybelKeyword.Envar:{e.next();let i=e.parseFeatureEnvarExpression();e.lineRegistry.addItemToLines(i),n.body.push(i);return}case $s.GreybelKeyword.Inject:{e.next();let i=e.parseFeatureInjectExpression();e.lineRegistry.addItemToLines(i),n.body.push(i);return}case $s.GreybelKeyword.Debugger:{e.next();let i=e.astProvider.featureDebuggerExpression({start:new Fn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new Fn.ASTPosition(e.previousToken.line,e.previousToken.end.character),range:e.previousToken.range,scope:e.currentScope});e.lineRegistry.addItemToLines(i),n.body.push(i);return}default:break}super.parseStatement()}parseChunk(){let e=this;e.next();let n=e.token,r=e.astProvider.chunk({start:n.start,end:null,range:[n.range[0],null]}),i=new Fn.PendingChunk(r,e.lineRegistry);for(e.backpatches.setDefault(i),e.pushScope(r);!je.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!je.Selectors.EndOfFile(e.token));)e.lexer.recordSnapshot(),e.statementErrors=[],e.parseStatement(),e.statementErrors.length>0&&e.tryToRecover();let s=e.backpatches.pop();for(;!(0,Fn.isPendingChunk)(s);){let o=e.raise(`found open block ${s.block.type}`,new Y1.Range(s.block.start,s.block.start));if(s.complete(e.previousToken),e.errors.push(o),!e.unsafe)throw o;s=e.backpatches.pop()}return e.finishRemaingScopes(),e.popScope(),i.complete(e.token),r.literals=e.literals,r.scopes=e.scopes,r.lines=e.lineRegistry.lines,r.imports=e.imports,r.includes=e.includes,r.injects=e.injects,r}};qu.default=Q_});var Yr=m(Nt=>{"use strict";var kF=Nt&&Nt.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),ju=Nt&&Nt.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&kF(e,t,n)},Z_=Nt&&Nt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Nt,"__esModule",{value:!0});Nt.Parser=Nt.LexerValidator=Nt.Lexer=void 0;var AF=F_();Object.defineProperty(Nt,"Lexer",{enumerable:!0,get:function(){return Z_(AF).default}});var CF=N_();Object.defineProperty(Nt,"LexerValidator",{enumerable:!0,get:function(){return Z_(CF).default}});var OF=Q1();Object.defineProperty(Nt,"Parser",{enumerable:!0,get:function(){return Z_(OF).default}});ju(Y_(),Nt);ju(q_(),Nt);ju(Ko(),Nt);ju(Vo(),Nt);ju(J_(),Nt)});var ev=m(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});Od.merge=void 0;function RF(t,e,n=1e4){if(e.length<=n){Array.prototype.push.apply(t,e);return}for(let r=0;r<e.length;r+=n)Array.prototype.push.apply(t,e.slice(r,r+n))}Od.merge=RF});var Z1=m(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});Rd.parseMapDescription=void 0;var PF=kb(),DF=jn();function IF(t){return DF.SignatureDefinitionTypeMeta.fromString(t)}function MF(t){return{path:t.name,type:t.type.split("|").map(IF)}}function LF(t){let e=t.tags.find(r=>r.tag==="type");if(!e)return null;let n=t.tags.filter(r=>r.tag==="property");return{type:e.name,properties:n.map(MF)}}function NF(t){let e=(0,PF.parse)(`/**
109
109
  ${t}
110
- */`),[n]=e;return n.tags.length>0?cF(n):null}vd.parseMapDescription=lF});var G_=m(Vo=>{"use strict";Object.defineProperty(Vo,"__esModule",{value:!0});Vo.Aggregator=Vo.ASTChainIterator=void 0;var Sd=Vr(),je=nr(),Ae=Te(),hF=d_(),Ce=Is(),js=f_(),G1=tb(),z1=a_(),dF=o_(),V1=ru(),K1=W_(),fF=y_(),pF=H1(),gF=Go(),wd=class{constructor(e,n,r=!1,i=!1){this.aggregator=e,this.chain=n,this.noInvoke=r,this.assume=i,this.index=0,this.endIndex=this.chain.length-1,this.current=null}defineAssumedProperty(e,n){let r=this.aggregator.factory(this.index===0?Ce.CompletionItemKind.Variable:Ce.CompletionItemKind.Property);return typeof n=="string"&&r.setLabel(n),this.assume?(r.addType(je.SignatureDefinitionBaseType.Map),e.setProperty(n,r),e.resolveProperty(n,!0)):(r.addType(je.SignatureDefinitionBaseType.Any),r)}getInitial(){let e=null,n=this.aggregator.scope,r=this.aggregator.document,i=this.chain[0],s=i.unary?.operator==="@"&&!i.isInCallExpression||this.noInvoke&&this.index===this.endIndex;if((0,js.isResolveChainItemWithIdentifier)(i))if(i.getter.name==="globals")e=n.globals;else if(i.getter.name==="outer")e=n.outer;else if(i.getter.name==="locals")e=n.locals;else if(i.getter.name==="super"){let o=r.getScopeContext(i.ref.scope)?.scope.context?.getIsa();o==null?e=this.aggregator.factory(Ce.CompletionItemKind.Constant).addType("null").setLabel("super"):e=o.copy({kind:Ce.CompletionItemKind.Constant,label:"super",values:o.values})}else if(i.getter.name==="self"){let o=r.getScopeContext(i.ref.scope)?.scope.context;o==null?e=this.aggregator.factory(Ce.CompletionItemKind.Constant).addType("null").setLabel("self"):e=o.copy({kind:Ce.CompletionItemKind.Constant,label:"self",values:o.values})}else{let o=n.resolveNamespace(i.getter.name,s);o==null&&(o=this.defineAssumedProperty(n.globals,i.getter.name)),e=o}else if((0,js.isResolveChainItemWithValue)(i))e=this.aggregator.resolveTypeWithDefault(i.value,s);else return null;if(i.unary?.operator===Ae.Keyword.New&&e!==null){let o=this.aggregator.factory(Ce.CompletionItemKind.Variable).addType(je.SignatureDefinitionBaseType.Map).setLabel(e.label);o.setProperty("__isa",e),this.aggregator.createCustomTypeFromMap(i.unary,o),e=o}return e}getNext(){let e=this.current,n=this.chain[this.index],r=n.unary?.operator==="@"&&!n.isInCallExpression||this.noInvoke&&this.index===this.endIndex;if((0,js.isResolveChainItemWithMember)(n)){let i=e.resolveProperty(n.getter.name,r);i==null&&(i=this.defineAssumedProperty(e,n.getter.name)),e=i}else if((0,js.isResolveChainItemWithIndex)(n))if((0,V1.isValidIdentifierLiteral)(n.getter)){let i=n.getter.value.toString(),s=e.resolveProperty(i,n.isInCallExpression);s==null&&(s=this.defineAssumedProperty(e,i)),e=s}else{let i=this.aggregator.resolveTypeWithDefault(n.getter),s=e.resolveProperty(i,n.isInCallExpression);s==null&&(s=this.defineAssumedProperty(e,i)),e=s}else if(n.ref.type===Ae.ASTType.SliceExpression)e=e.copy();else return null;if(n.unary?.operator===Ae.Keyword.New&&this.current!==null){let i=this.aggregator.factory(Ce.CompletionItemKind.Property).addType(je.SignatureDefinitionBaseType.Map).setLabel(e.label);i.setProperty("__isa",e),this.aggregator.createCustomTypeFromMap(n.unary,i),e=i}return e}next(){if(this.index>=this.chain.length)return{value:null,done:!0};let e=this.index===0?this.getInitial():this.getNext();return e==null?{value:null,done:!0}:(this.index++,this.current=e,{value:e,done:!1})}};Vo.ASTChainIterator=wd;var H_=class{get definitions(){return this._definitions}get parent(){return this._parent}get scope(){return this._scope}get document(){return this._document}constructor(e){this._root=e.root,this._scope=e.scope,this._document=e.document,this._parent=e.parent??null,this._definitions=new Map,this._lastModifiedProperty=null}factory(e){return new gF.Entity({source:this._document.source,kind:e,container:this._document.container})}createMapDescription(e){let n=this._document.getLastASTItemOfLine(e.start.line-1),r=this._document.findASTItemInLine(e.start.line,Ae.ASTType.Comment);if(n instanceof Ae.ASTComment){let i=new Set,s=[],o=e.start.line-1;for(;o>=0;){let a=this._document.getLastASTItemOfLine(o--);if(!i.has(a))if(a instanceof Ae.ASTComment)i.add(a),s.unshift(a.value);else break}return s.join(`
111
- `)}else if(r instanceof Ae.ASTComment)return r.value;return null}createCustomTypeFromMap(e,n){let r=this.createMapDescription(e);if(r==null)return;let i=(0,pF.parseMapDescription)(r);i!=null&&(i.properties.forEach(s=>{if(s.path==="__isa")return;let o=s.path.split("."),a=this.factory(Ce.CompletionItemKind.Property).addType(s.type).setLabel(o[o.length-1]);this.setEntityInPath(n,o,a)}),this._scope.setCustomType(i.type,n))}createFunctionDescription(e,n=hF.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION){let r=this._document.getLastASTItemOfLine(e.start.line-1),i=this._document.findASTItemInLine(e.start.line,Ae.ASTType.Comment);if(r instanceof Ae.ASTComment){let s=new Set,o=[],a=e.start.line-1;for(;a>=0;){let u=this._document.getLastASTItemOfLine(a--);if(!s.has(u))if(u instanceof Ae.ASTComment)s.add(u),o.unshift(u.value);else break}return o.join(`
110
+ */`),[n]=e;return n.tags.length>0?LF(n):null}Rd.parseMapDescription=NF});var nv=m(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.Aggregator=Xo.ASTChainIterator=void 0;var Fu=Yr(),Te=jn(),Ee=ke(),qF=E_(),we=Ls(),eC=Ns(),Bs=k_(),tC=cb(),nC=__(),jF=b_(),iC=iu(),rC=ev(),FF=R_(),$F=Z1(),BF=zo(),Pd=class{constructor(e,n,r=!1,i=!1){this.aggregator=e,this.chain=n,this.noInvoke=r,this.assume=i,this.index=0,this.endIndex=this.chain.length-1,this.current=null}defineAssumedProperty(e,n){let r=this.aggregator.factory(this.index===0?we.CompletionItemKind.Variable:we.CompletionItemKind.Property);return typeof n=="string"&&r.setLabel(n),this.assume?(r.addType(Te.SignatureDefinitionBaseType.Map),e.setProperty(n,r),e.resolveProperty(n,!0)):(r.addType(Te.SignatureDefinitionBaseType.Any),r)}getInitial(){let e=null,n=this.aggregator.scope,r=this.aggregator.document,i=this.chain[0],s=i.unary?.operator==="@"&&!i.isInCallExpression||this.noInvoke&&this.index===this.endIndex;if((0,Bs.isResolveChainItemWithIdentifier)(i))if(i.getter.name==="globals")e=n.globals;else if(i.getter.name==="outer")e=n.outer;else if(i.getter.name==="locals")e=n.locals;else if(i.getter.name==="super"){let o=r.getScopeContext(i.ref.scope)?.scope.context?.getIsa();o==null?e=this.aggregator.factory(we.CompletionItemKind.Constant).addType("null").setLabel("super"):e=o.copy({kind:we.CompletionItemKind.Constant,label:"super",values:o.values})}else if(i.getter.name==="self"){let o=r.getScopeContext(i.ref.scope)?.scope.context;o==null?e=this.aggregator.factory(we.CompletionItemKind.Constant).addType("null").setLabel("self"):e=o.copy({kind:we.CompletionItemKind.Constant,label:"self",values:o.values})}else{let o=n.resolveNamespace(i.getter.name,s);o==null&&(o=this.defineAssumedProperty(n.globals,i.getter.name)),e=o}else if((0,Bs.isResolveChainItemWithValue)(i))e=this.aggregator.resolveTypeWithDefault(i.value,s);else return null;if(i.unary?.operator===Ee.Keyword.New&&e!==null){let o=this.aggregator.factory(we.CompletionItemKind.Variable).addType(Te.SignatureDefinitionBaseType.Map).setLabel(e.label);o.setProperty("__isa",e),this.aggregator.createCustomTypeFromMap(i.unary,o),e=o}return e}getNext(){let e=this.current,n=this.chain[this.index],r=n.unary?.operator==="@"&&!n.isInCallExpression||this.noInvoke&&this.index===this.endIndex;if((0,Bs.isResolveChainItemWithMember)(n)){let i=e.resolveProperty(n.getter.name,r);i==null&&(i=this.defineAssumedProperty(e,n.getter.name)),e=i}else if((0,Bs.isResolveChainItemWithIndex)(n))if((0,iC.isValidIdentifierLiteral)(n.getter)){let i=n.getter.value.toString(),s=e.resolveProperty(i,n.isInCallExpression);s==null&&(s=this.defineAssumedProperty(e,i)),e=s}else{let i=this.aggregator.resolveTypeWithDefault(n.getter),s=e.resolveProperty(i,n.isInCallExpression);s==null&&(s=this.defineAssumedProperty(e,i)),e=s}else if(n.ref.type===Ee.ASTType.SliceExpression)e=e.copy();else return null;if(n.unary?.operator===Ee.Keyword.New&&this.current!==null){let i=this.aggregator.factory(we.CompletionItemKind.Property).addType(Te.SignatureDefinitionBaseType.Map).setLabel(e.label);i.setProperty("__isa",e),this.aggregator.createCustomTypeFromMap(n.unary,i),e=i}return e}next(){if(this.index>=this.chain.length)return{value:null,done:!0};let e=this.index===0?this.getInitial():this.getNext();return e==null?{value:null,done:!0}:(this.index++,this.current=e,{value:e,done:!1})}};Xo.ASTChainIterator=Pd;var tv=class{get definitions(){return this._definitions}get parent(){return this._parent}get scope(){return this._scope}get document(){return this._document}constructor(e){this._root=e.root,this._scope=e.scope,this._document=e.document,this._parent=e.parent??null,this._definitions=new Map,this._lastModifiedProperty=null}factory(e){return new BF.Entity({source:this._document.source,kind:e,container:this._document.container})}createMapDescription(e){let n=this._document.getLastASTItemOfLine(e.start.line-1),r=this._document.findASTItemInLine(e.start.line,Ee.ASTType.Comment);if(n instanceof Ee.ASTComment){let i=new Set,s=[],o=e.start.line-1;for(;o>=0;){let a=this._document.getLastASTItemOfLine(o--);if(!i.has(a))if(a instanceof Ee.ASTComment)i.add(a),s.unshift(a.value);else break}return s.join(`
111
+ `)}else if(r instanceof Ee.ASTComment)return r.value;return null}createCustomTypeFromMap(e,n){let r=this.createMapDescription(e);if(r==null)return;let i=(0,$F.parseMapDescription)(r);i!=null&&(i.properties.forEach(s=>{if(s.path==="__isa")return;let o=s.path.split("."),a=this.factory(we.CompletionItemKind.Property).addTypesWithMeta(s.type).setLabel(o[o.length-1]);this.setEntityInPath(n,o,a)}),this._scope.setCustomType(i.type,n))}createFunctionDescription(e,n=qF.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION){let r=this._document.getLastASTItemOfLine(e.start.line-1),i=this._document.findASTItemInLine(e.start.line,Ee.ASTType.Comment);if(r instanceof Ee.ASTComment){let s=new Set,o=[],a=e.start.line-1;for(;a>=0;){let u=this._document.getLastASTItemOfLine(a--);if(!s.has(u))if(u instanceof Ee.ASTComment)s.add(u),o.unshift(u.value);else break}return o.join(`
112
112
 
113
- `)}else if(i instanceof Ae.ASTComment)return i.value;return n}resolveFunctionStatement(e){let n=je.SignatureDefinitionFunction.parse({type:je.SignatureDefinitionBaseType.Function,description:this.createFunctionDescription(e),arguments:e.parameters.map(r=>{if(r.type===Ae.ASTType.Identifier)return{label:r.name??"unknown",type:je.SignatureDefinitionBaseType.Any};let i=r;return{label:i.variable?.name??"unknown",types:Array.from(this.resolveTypeWithDefault(i.init).types)}}),returns:["any"]});return this.factory(Ce.CompletionItemKind.Function).addType(je.SignatureDefinitionBaseType.Function).addSignatureType((0,dF.enrichWithMetaInformation)(n)).setLine(e.start.line)}resolveParenthesisExpression(e){return this.resolveTypeWithDefault(e.expression)}resolveBinaryExpression(e){let n=this.factory(Ce.CompletionItemKind.Expression).setLabel("Binary Expr").setLine(e.start.line),r=this.resolveTypeWithDefault(e.left),i=this.resolveTypeWithDefault(e.right);return n.extend(r),n.extend(i),n}resolveLogicalExpression(e){return this.factory(Ce.CompletionItemKind.Expression).setLabel("Logical Expr").addType(je.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveComparisonGroupExpression(e){return this.factory(Ce.CompletionItemKind.Expression).setLabel("Comparison Group Expr").addType(je.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveIsaExpression(e){return this.factory(Ce.CompletionItemKind.Expression).setLabel("Isa Expr").addType(je.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveCallStatement(e){let n=this.resolveNamespace(e);return n===null?this.factory(Ce.CompletionItemKind.Variable).addType(je.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveCallExpression(e){let n=this.resolveNamespace(e);return n===null?this.factory(Ce.CompletionItemKind.Variable).addType(je.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveUnaryExpression(e){let n=this.resolveNamespace(e);return n===null?this.factory(Ce.CompletionItemKind.Variable).addType(je.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveMapConstructorExpression(e){let n=this.factory(Ce.CompletionItemKind.MapConstructor).addType(je.SignatureDefinitionBaseType.Map);for(let r=0;r<e.fields.length;r++){let i=e.fields[r],s=this.resolveTypeWithDefault(i.value).setLine(i.start.line);if(i.key.type===Ae.ASTType.StringLiteral){let o=i.key.value.toString();n.setProperty(o,s),n.values.get(`i:${o}`)?.definitions.push({source:this._document.source,node:i})}else{let o=this.resolveTypeWithDefault(i.key).setLine(i.start.line);n.setProperty(o,s)}}return this.createCustomTypeFromMap(e,n),n.setLabel("{}").setLine(e.start.line)}resolveListConstructorExpression(e){let n=this.factory(Ce.CompletionItemKind.ListConstructor).addType(je.SignatureDefinitionBaseType.List);for(let r=0;r<e.fields.length;r++){let i=e.fields[r],s=this.factory(Ce.CompletionItemKind.Variable).addType(je.SignatureDefinitionBaseType.Number).setLine(i.start.line),o=this.resolveTypeWithDefault(i.value).setLine(i.start.line);n.setProperty(s,o)}return n.setLabel("[]").setLine(e.start.line)}resolveSliceExpression(e){let n=this.resolveNamespace(e);return n===null?this.factory(Ce.CompletionItemKind.Variable).addType(je.SignatureDefinitionBaseType.Any).setLine(e.start.line):n.setLine(e.start.line)}resolveIndexExpression(e,n=!1){let r=this.resolveNamespace(e,n);return r===null?this.factory(Ce.CompletionItemKind.Variable).addType(je.SignatureDefinitionBaseType.Any).setLine(e.start.line):r}resolveMemberExpression(e,n=!1){let r=this.resolveNamespace(e,n);return r===null?this.factory(Ce.CompletionItemKind.Property).addType(je.SignatureDefinitionBaseType.Any).setLabel(e.identifier.name).setLine(e.start.line):r}resolveIdentifier(e,n=!1){let r=this.resolveNamespace(e,n);return r===null?this.factory(Ce.CompletionItemKind.Property).addType(je.SignatureDefinitionBaseType.Any).setLabel(e.name).setLine(e.start.line):r}resolveType(e,n=!1){if(e==null)return null;switch(e.type){case Ae.ASTType.ParenthesisExpression:return this.resolveParenthesisExpression(e);case Ae.ASTType.CallStatement:return this.resolveCallStatement(e);case Ae.ASTType.CallExpression:return this.resolveCallExpression(e);case Ae.ASTType.BinaryExpression:return this.resolveBinaryExpression(e);case Ae.ASTType.LogicalExpression:return this.resolveLogicalExpression(e);case Ae.ASTType.IsaExpression:return this.resolveIsaExpression(e);case Ae.ASTType.ComparisonGroupExpression:return this.resolveComparisonGroupExpression(e);case Ae.ASTType.FunctionDeclaration:return this.resolveFunctionStatement(e);case Ae.ASTType.SliceExpression:return this.resolveSliceExpression(e);case Ae.ASTType.IndexExpression:return this.resolveIndexExpression(e,n);case Ae.ASTType.MemberExpression:return this.resolveMemberExpression(e,n);case Ae.ASTType.Identifier:return this.resolveIdentifier(e,n);case Ae.ASTType.MapConstructorExpression:return this.resolveMapConstructorExpression(e);case Ae.ASTType.ListConstructorExpression:return this.resolveListConstructorExpression(e);case Ae.ASTType.NegationExpression:case Ae.ASTType.BinaryNegatedExpression:case Ae.ASTType.UnaryExpression:return this.resolveUnaryExpression(e);case Ae.ASTType.NilLiteral:return this.factory(Ce.CompletionItemKind.Literal).addType("null").setLabel("null").setLine(e.start.line);case Ae.ASTType.StringLiteral:{let r=e.value.toString();return this.factory(Ce.CompletionItemKind.Literal).addType(je.SignatureDefinitionBaseType.String).setLabel(`"${r.length>20?r.substr(0,20)+"...":r}"`).setLine(e.start.line)}case Ae.ASTType.NumericLiteral:case Ae.ASTType.BooleanLiteral:{let r=e.value.toString();return this.factory(Ce.CompletionItemKind.Literal).addType(je.SignatureDefinitionBaseType.Number).setLabel(r).setLine(e.start.line)}case Sd.ASTType.FeatureFileExpression:return this.factory(Ce.CompletionItemKind.Expression).addType(je.SignatureDefinitionBaseType.String).setLabel("File Expr").setLine(e.start.line);case Sd.ASTType.FeatureLineExpression:return this.factory(Ce.CompletionItemKind.Expression).addType(je.SignatureDefinitionBaseType.Number).setLabel("Line Expr").setLine(e.start.line);case Sd.ASTType.FeatureEnvarExpression:return this.factory(Ce.CompletionItemKind.Expression).addType(je.SignatureDefinitionBaseType.String).setLabel("Envar Expr").setLine(e.start.line);case Sd.ASTType.FeatureInjectExpression:return this.factory(Ce.CompletionItemKind.Expression).addType(je.SignatureDefinitionBaseType.String).setLabel("Inject Expr").setLine(e.start.line);default:return null}}resolveTypeWithDefault(e=null,n=!1){let r=this.resolveType(e,n);if(r==null){let i=this.factory(Ce.CompletionItemKind.Variable).addType(je.SignatureDefinitionBaseType.Any);return e!=null&&i.setLine(e.start.line),i}return r}resolveChain(e,n=!1,r=!1){if(e.length===0)return null;let i=new wd(this,e,n,r),s=null,o=i.next();for(;!o.done;)s=o.value,o=i.next();return s}setEntityInPath(e,n,r){let i=e;for(let s=0;s<n.length-1;s++){let o=n[s],a=i.resolveProperty(o);if(a==null){let u=this.factory(Ce.CompletionItemKind.Property).addType(je.SignatureDefinitionBaseType.Map).setLabel(o);i.setProperty(o,u),a=u}i=a}return i.setProperty(n[n.length-1],r)}getEntityInPath(e,n){let r=e;for(let i=0;i<n.length;i++){let s=n[i],o=r.resolveProperty(s);if(o==null)return null;r=o}return r}resolveNamespace(e,n=!1){let r=(0,z1.createResolveChain)(e);return this.resolveChain(r,n)}defineProperty(e,n,r){let i=e.setProperty(n,r);return this._lastModifiedProperty=e.resolveProperty(n,!0),i}defineNamespace(e,n){let r=(0,z1.createResolveChain)(e),i=r.pop();if(this._lastModifiedProperty=null,r.length>0){let o=this.resolveChain(r,!1,!0);if(o===null)return!1;if((0,js.isResolveChainItemWithMember)(i))return this.defineProperty(o,i.getter.name,n);if((0,js.isResolveChainItemWithIndex)(i)){if((0,V1.isValidIdentifierLiteral)(i.getter))return this.defineProperty(o,i.getter.value.toString(),n);{let a=this.resolveTypeWithDefault(i.getter);return this.defineProperty(o,a,n)}}return!1}let s=this._scope;return(0,js.isResolveChainItemWithIdentifier)(i)?this.defineProperty(s,i.getter.name,n):!1}addDefinition(e){this._lastModifiedProperty?.definitions.push({source:this._document.source,node:e});let n=(0,G1.createExpressionId)(e.variable),r=this._definitions;n.startsWith("globals.")?(r=this._document.getRootScopeContext().aggregator.definitions,n=n.slice(8)):n.startsWith("locals.")?(r=this._definitions,n=n.slice(7)):n.startsWith("outer.")&&(r=this.parent.definitions,n=n.slice(6));let i=r.get(n);i?i.push({source:this._document.source,node:e}):r.set(n,[{source:this._document.source,node:e}])}resolveAvailableAssignmentsWithQuery(e){let n=[],r=new Set([this,this._parent,this._document.getRootScopeContext().aggregator]);for(let i of r){let s=i.definitions;for(let o of s.keys())if(o.includes(e)){let a=s.get(o);(0,K1.merge)(n,a)}}return n}resolveAvailableAssignments(e){let n=(0,G1.createExpressionId)(e),r=this;n.startsWith("globals.")?(r=this._document.getRootScopeContext().aggregator,n=n.slice(8)):n.startsWith("locals.")?(r=this,n=n.slice(7)):n.startsWith("outer.")&&(r=this.parent,n=n.slice(6));let i=[],s=new Set([r,r._parent,r._document.getRootScopeContext().aggregator]);for(let o of s){if(o==null)continue;let a=o.resolveNamespace(e,!0);a!=null&&(0,K1.merge)(i,a.definitions)}return i}analyze(){for(let e=0;e<this._root.assignments.length;e++){let n=this._root.assignments[e],r=this.resolveType(n.init)?.copy({source:this._document.source}).setLine(n.start.line)??this.factory(Ce.CompletionItemKind.Variable).addType(je.SignatureDefinitionBaseType.Any).setLine(n.start.line);this.defineNamespace(n.variable,r),this.addDefinition(n)}}extend(e){for(let[n,r]of e.definitions){let i=this.definitions.get(n);i?(0,fF.mergeUnique)(i,r):this.definitions.set(n,r)}}};Vo.Aggregator=H_});var K_=m(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});Td.Document=void 0;var mi=nr(),mF=Te(),X1=Is(),yF=W_(),Y1=G_(),J1=Go(),Q1=w_(),z_=class t{get source(){return this._source}get root(){return this._root}get container(){return this._container}get intrinsics(){return this._intrinscis}get globals(){return this._globals}get api(){return this._api}constructor(e){this._source=e.source,this._root=e.root,this._container=e.container,this._scopeMapping=e.scopeMapping??new WeakMap,this._intrinscis=e.intrinsics??this.createIntrinscis(),this._api=e.api??this.initApi(),this._globals=e.globals??this.initGlobals()}createIntrinscis(){return{map:this._container.primitives.get(mi.SignatureDefinitionBaseType.Map),funcRef:this._container.primitives.get(mi.SignatureDefinitionBaseType.Function),number:this._container.primitives.get(mi.SignatureDefinitionBaseType.Number),string:this._container.primitives.get(mi.SignatureDefinitionBaseType.String),list:this._container.primitives.get(mi.SignatureDefinitionBaseType.List)}}initApi(){let e=this._container.primitives.get(mi.SignatureDefinitionBaseType.General);return e.resolveProperty("map",!0).setReturnEntity(this._intrinscis.map),e.resolveProperty("funcRef",!0).setReturnEntity(this._intrinscis.funcRef),e.resolveProperty("number",!0).setReturnEntity(this._intrinscis.number),e.resolveProperty("string",!0).setReturnEntity(this._intrinscis.string),e.resolveProperty("list",!0).setReturnEntity(this._intrinscis.list),e}initGlobals(){return new J1.Entity({source:this._source,kind:X1.CompletionItemKind.Constant,container:this._container,label:"globals"}).addType(mi.SignatureDefinitionBaseType.Map)}analyzeScope(e){let n=this._scopeMapping.get(e.scope),r=new Q1.Scope({source:this._source,container:this._container,parent:n?.scope,globals:this._globals}),i=new Y1.Aggregator({scope:r,root:e,document:this,parent:n?.aggregator});this._scopeMapping.set(e,{scope:r,aggregator:i});let s=e.assignment instanceof mF.ASTAssignmentStatement?this.resolveNamespace(e.assignment.variable,!0):null;if(s!==null){let o=s?.context;o!=null&&o.types.has(mi.SignatureDefinitionBaseType.Map)&&o!==this._globals&&r.setContext(o)}if(i.analyze(),s!==null){let o=s.signatureDefinitions.last();if(o!=null){let a=o.getArguments();for(let u=0;u<a.length;u++){let c=a[u],l=r.resolveProperty(c.getLabel(),!0),h=c.getTypes().map(d=>d.type);l===null?r.setProperty(c.getLabel(),new J1.Entity({source:this._source,kind:X1.CompletionItemKind.Variable,container:this._container}).addTypes(h)):(l.types.delete(mi.SignatureDefinitionBaseType.Any),l.addTypes(h))}}}}analyze(){let e=new Q1.Scope({source:this._source,container:this._container,globals:this._globals,locals:this._globals}),n=new Y1.Aggregator({scope:e,root:this._root,document:this});this._scopeMapping.set(this._root,{scope:e,aggregator:n}),n.analyze();for(let r=0;r<this._root.scopes.length;r++){let i=this._root.scopes[r];this.analyzeScope(i)}}getRootScopeContext(){return this._scopeMapping.get(this._root)}getAllScopeContexts(){return[this._root,...this._root.scopes].map(e=>this._scopeMapping.get(e))}getScopeContext(e){return this._scopeMapping.get(e)??null}getLastASTItemOfLine(e){let n=this._root.lines[e];return n&&n.length>0?n[n.length-1]:null}findASTItemInLine(e,n){let r=this._root.lines[e];if(r&&r.length>0){let i=r.find(s=>s.type===n);if(i)return i}return null}resolveAllAssignmentsWithQuery(e){let n=[],r=[this._root,...this._root.scopes];for(let i=0;i<r.length;i++){let o=this._scopeMapping.get(r[i]).aggregator.definitions;for(let a of o.keys())if(a.includes(e)){let u=o.get(a);(0,yF.merge)(n,u)}}return n}resolveAvailableAssignments(e){return this._scopeMapping.get(e.scope)?.aggregator.resolveAvailableAssignments(e)??[]}resolveType(e,n){return this._scopeMapping.get(e.scope)?.aggregator.resolveType(e,n)??null}resolveTypeWithDefault(e,n){return this._scopeMapping.get(e.scope)?.aggregator.resolveTypeWithDefault(e,n)}resolveNamespace(e,n=!1){return this._scopeMapping.get(e.scope)?.aggregator.resolveNamespace(e,n)??null}merge(...e){let n=new t({source:this._source,root:this._root,container:this._container.copy()});for(let r=0;r<e.length;r++){let i=e[r];n._globals.extend(i._globals,!0,!0),n._intrinscis.map.extend(i._intrinscis.map,!0,!0),n._intrinscis.funcRef.extend(i._intrinscis.funcRef,!0,!0),n._intrinscis.number.extend(i._intrinscis.number,!0,!0),n._intrinscis.string.extend(i._intrinscis.string,!0,!0),n._intrinscis.list.extend(i._intrinscis.list,!0,!0),n._container.mergeCustomTypes(i._container)}n.analyze();for(let r=0;r<e.length;r++){let i=e[r];n.getRootScopeContext().aggregator.extend(i.getRootScopeContext().aggregator)}return n}};Td.Document=z_});var Y_=m(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});Ed.ContainerProxy=void 0;var xr=nr(),yi=Go(),Z1=Is(),eC=Eu(),V_=cd(),X_=class t{get primitives(){return this._primitives}get types(){return this._types}constructor(e){this._container=e.container,this._primitives=e.primitives??this.createPrimitives(),this._types=e.types??this.createTypes(),this._customTypes=new Set}createPrimitives(){let e=new Map;for(let[n,r]of this._container.getPrimitives()){let i=new yi.Entity({source:"internal",kind:Z1.CompletionItemKind.Internal,container:this,isAPI:n===xr.SignatureDefinitionBaseType.General}).addType(xr.SignatureDefinitionBaseType.Map).insertSignature(r);e.set(n,i)}return e}createTypes(){let e=new Map;for(let[n,r]of this._container.getTypes()){let i=new yi.Entity({source:"internal",kind:Z1.CompletionItemKind.Internal,container:this}).addType(xr.SignatureDefinitionBaseType.Map).insertSignature(r);e.set(n,i)}return e}setCustomType(e,n){this._types.has(e)||(this._types.set(e,n),this._customTypes.add(e))}mergeCustomTypes(e){for(let n of e._customTypes){let r=e._types.get(n);r!=null&&this.setCustomType(n,r.copy({deepCopy:!0}))}}getTypeSignature(e){return this._primitives.get(e)??this._types.get(e)??null}searchDefinitionMatches(e,n){if(typeof e=="string")return this.searchDefinitionMatches([e],n);let r=e.includes(xr.SignatureDefinitionBaseType.Any)?new Set(this._container.getAllVisibleTypes()):new Set(e),i=new Map;for(let s of r){let o=this.getTypeSignature(s);if(o===null)continue;let a=(0,V_.lookupProperty)(o,n);a!==null&&i.set(s,a)}return i}getDefinition(e,n,r=!1){if(typeof e=="string")return this.getDefinition([e],n);let i=(0,V_.lookupProperty)(this._primitives.get(xr.SignatureDefinitionBaseType.Any),n);if(e.includes(xr.SignatureDefinitionBaseType.Any)&&i)return(0,yi.resolveEntity)(this,i,r);let s=this.searchDefinitionMatches(e,n);if(s.size===0)return null;if(s.size===1)return(0,yi.resolveEntity)(this,s.values().next().value,r);if(s.has(xr.SignatureDefinitionBaseType.Any))return(0,yi.resolveEntity)(this,s.get(xr.SignatureDefinitionBaseType.Any),r);if(i!==null)return(0,yi.resolveEntity)(this,i,r);let o=s.values().next().value,a=new yi.Entity({source:"internal",label:n,kind:o.kind,container:this});for(let u of s.values()){let c=(0,yi.resolveEntity)(this,u,r);a.extend(c,!0,!0)}return a}getGeneralDefinition(e,n=!1){let r=(0,V_.lookupProperty)(this._primitives.get(xr.SignatureDefinitionBaseType.General),e);return r==null?null:(0,yi.resolveEntity)(this,r,n)}injectTypeIdentifiers(e,n){let r=this.getTypeSignature(n);if(r!=null&&((0,eC.injectIdentifers)(e,r),this._types.has(n))){let i=this._primitives.get(xr.SignatureDefinitionBaseType.Map);(0,eC.injectIdentifers)(e,i)}}getAllIdentifier(e){let n=new Map;if(e===xr.SignatureDefinitionBaseType.Any){let r=this._container.getAllVisibleTypes();for(let i=0;i<r.length;i++)this.injectTypeIdentifiers(n,r[i]);return n}return this.injectTypeIdentifiers(n,e),n}copy(){return new t({container:this._container})}};Ed.ContainerProxy=X_});var tC=m(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});xd.TypeManager=void 0;var bF=K_(),_F=Y_(),J_=class{constructor(e){this._container=new _F.ContainerProxy({container:e.container}),this._types=new Map}analyze(e,n){let r=new bF.Document({source:e,container:this._container.copy(),root:n});try{r.analyze()}catch(i){console.error(i)}return this._types.set(e,r),r}get(e){return this._types.get(e)??null}};xd.TypeManager=J_});var Xo=m(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.TypeManager=ie.ContainerProxy=ie.Document=ie.Aggregator=ie.Scope=ie.Entity=ie.aggregateEntity=ie.lookupProperty=ie.isEligibleForProperties=ie.injectIdentifers=ie.isSignatureDefinitionFunction=ie.isResolveChainItemWithValue=ie.isResolveChainItemWithMember=ie.isResolveChainItemWithIndex=ie.isResolveChainItemWithIdentifier=ie.CompletionItemKind=ie.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION=ie.ObjectSetIterator=ie.ObjectSet=ie.rotateBits=ie.getStringHashCode=ie.getHashCode=ie.createResolveChain=ie.enrichWithMetaInformation=ie.createExpressionId=ie.createExpressionHash=ie.isValidIdentifierLiteral=void 0;var vF=ru();Object.defineProperty(ie,"isValidIdentifierLiteral",{enumerable:!0,get:function(){return vF.isValidIdentifierLiteral}});var SF=ik();Object.defineProperty(ie,"createExpressionHash",{enumerable:!0,get:function(){return SF.createExpressionHash}});var wF=tb();Object.defineProperty(ie,"createExpressionId",{enumerable:!0,get:function(){return wF.createExpressionId}});var TF=o_();Object.defineProperty(ie,"enrichWithMetaInformation",{enumerable:!0,get:function(){return TF.enrichWithMetaInformation}});var EF=a_();Object.defineProperty(ie,"createResolveChain",{enumerable:!0,get:function(){return EF.createResolveChain}});var Q_=eb();Object.defineProperty(ie,"getHashCode",{enumerable:!0,get:function(){return Q_.getHashCode}});Object.defineProperty(ie,"getStringHashCode",{enumerable:!0,get:function(){return Q_.getStringHashCode}});Object.defineProperty(ie,"rotateBits",{enumerable:!0,get:function(){return Q_.rotateBits}});var nC=h_();Object.defineProperty(ie,"ObjectSet",{enumerable:!0,get:function(){return nC.ObjectSet}});Object.defineProperty(ie,"ObjectSetIterator",{enumerable:!0,get:function(){return nC.ObjectSetIterator}});var xF=d_();Object.defineProperty(ie,"DEFAULT_CUSTOM_FUNCTION_DESCRIPTION",{enumerable:!0,get:function(){return xF.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION}});var kF=Is();Object.defineProperty(ie,"CompletionItemKind",{enumerable:!0,get:function(){return kF.CompletionItemKind}});var kd=f_();Object.defineProperty(ie,"isResolveChainItemWithIdentifier",{enumerable:!0,get:function(){return kd.isResolveChainItemWithIdentifier}});Object.defineProperty(ie,"isResolveChainItemWithIndex",{enumerable:!0,get:function(){return kd.isResolveChainItemWithIndex}});Object.defineProperty(ie,"isResolveChainItemWithMember",{enumerable:!0,get:function(){return kd.isResolveChainItemWithMember}});Object.defineProperty(ie,"isResolveChainItemWithValue",{enumerable:!0,get:function(){return kd.isResolveChainItemWithValue}});var AF=p_();Object.defineProperty(ie,"isSignatureDefinitionFunction",{enumerable:!0,get:function(){return AF.isSignatureDefinitionFunction}});var CF=Eu();Object.defineProperty(ie,"injectIdentifers",{enumerable:!0,get:function(){return CF.injectIdentifers}});var OF=ad();Object.defineProperty(ie,"isEligibleForProperties",{enumerable:!0,get:function(){return OF.isEligibleForProperties}});var RF=cd();Object.defineProperty(ie,"lookupProperty",{enumerable:!0,get:function(){return RF.lookupProperty}});var PF=g_();Object.defineProperty(ie,"aggregateEntity",{enumerable:!0,get:function(){return PF.aggregateEntity}});var DF=Go();Object.defineProperty(ie,"Entity",{enumerable:!0,get:function(){return DF.Entity}});var IF=w_();Object.defineProperty(ie,"Scope",{enumerable:!0,get:function(){return IF.Scope}});var MF=G_();Object.defineProperty(ie,"Aggregator",{enumerable:!0,get:function(){return MF.Aggregator}});var LF=K_();Object.defineProperty(ie,"Document",{enumerable:!0,get:function(){return LF.Document}});var NF=Y_();Object.defineProperty(ie,"ContainerProxy",{enumerable:!0,get:function(){return NF.ContainerProxy}});var qF=tC();Object.defineProperty(ie,"TypeManager",{enumerable:!0,get:function(){return qF.TypeManager}})});var Z_=m(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});Yo.getSymbolItemKind=Yo.getCompletionItemKind=void 0;var ot=Xo(),jF={[ot.CompletionItemKind.Constant]:21,[ot.CompletionItemKind.Internal]:21,[ot.CompletionItemKind.InternalFunction]:21,[ot.CompletionItemKind.InternalProperty]:21,[ot.CompletionItemKind.Property]:6,[ot.CompletionItemKind.Variable]:6,[ot.CompletionItemKind.Expression]:6,[ot.CompletionItemKind.Function]:3,[ot.CompletionItemKind.ListConstructor]:12,[ot.CompletionItemKind.MapConstructor]:12,[ot.CompletionItemKind.Literal]:12,[ot.CompletionItemKind.Unknown]:12},FF=t=>jF[t]??6;Yo.getCompletionItemKind=FF;var $F={[ot.CompletionItemKind.Constant]:14,[ot.CompletionItemKind.Internal]:14,[ot.CompletionItemKind.InternalFunction]:14,[ot.CompletionItemKind.InternalProperty]:14,[ot.CompletionItemKind.Variable]:13,[ot.CompletionItemKind.Property]:13,[ot.CompletionItemKind.Expression]:13,[ot.CompletionItemKind.Function]:12,[ot.CompletionItemKind.ListConstructor]:18,[ot.CompletionItemKind.MapConstructor]:19,[ot.CompletionItemKind.Literal]:13,[ot.CompletionItemKind.Unknown]:13},BF=t=>$F[t]??13;Yo.getSymbolItemKind=BF});var rC=m(Ad=>{"use strict";Object.defineProperty(Ad,"__esModule",{value:!0});Ad.CompletionListBuilder=void 0;var UF=Z_(),ev=class{constructor(){this.collection=new Map,this.default=[]}setDefault(e){this.default=e}addCollection(e){e!=null&&(this.collection=new Map([...this.collection,...e]))}build(){let e=[];for(let[n,r]of this.collection)e.push({label:n,kind:(0,UF.getCompletionItemKind)(r.kind)});return[...e,...this.default]}};Ad.CompletionListBuilder=ev});var Od=m(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.findEx=Jo.ScraperWalker=void 0;var WF=Te(),HF=function(t){return{ParenthesisExpression:(e,n)=>{t(e.expression,n)},AssignmentStatement:function(e,n){t(e.init,n),t(e.variable,n)},MemberExpression:function(e,n){t(e.base,n),t(e.identifier,n)},FunctionDeclaration:function(e,n){for(let r=0;r<e.parameters.length;r++)t(e.parameters[r],n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},MapConstructorExpression:function(e,n){for(let r=0;r<e.fields.length;r++)t(e.fields[r],n)},ReturnStatement:function(e,n){e.argument&&t(e.argument,n)},WhileStatement:function(e,n){t(e.condition,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},IndexExpression:function(e,n){t(e.base,n),t(e.index,n)},SliceExpression:function(e,n){t(e.base,n),t(e.left,n),t(e.right,n)},ListValue:function(e,n){t(e.value,n)},MapKeyString:function(e,n){t(e.key,n),t(e.value,n)},IfShortcutStatement:function(e,n){for(let r=0;r<e.clauses.length;r++)t(e.clauses[r],n)},IfShortcutClause:function(e,n){t(e.condition,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},ElseifShortcutClause:function(e,n){t(e.condition,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},ElseShortcutClause:function(e,n){for(let r=0;r<e.body.length;r++)t(e.body[r],n)},ForGenericStatement:function(e,n){t(e.variable,n),t(e.iterator,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},IfStatement:function(e,n){for(let r=0;r<e.clauses.length;r++)t(e.clauses[r],n)},IfClause:function(e,n){t(e.condition,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},ElseifClause:function(e,n){t(e.condition,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},ElseClause:function(e,n){for(let r=0;r<e.body.length;r++)t(e.body[r],n)},NegationExpression:function(e,n){t(e.argument,n)},CallExpression:function(e,n){t(e.base,n);for(let r=0;r<e.arguments.length;r++)t(e.arguments[r],n)},CallStatement:function(e,n){t(e.expression,n)},ListConstructorExpression:function(e,n){for(let r=0;r<e.fields.length;r++)t(e.fields[r],n)},BinaryExpression:function(e,n){t(e.left,n),t(e.right,n)},BinaryNegatedExpression:function(e,n){t(e.argument,n)},IsaExpression:function(e,n){t(e.left,n),t(e.right,n)},LogicalExpression:function(e,n){t(e.left,n),t(e.right,n)},ComparisonGroupExpression:function(e,n){for(let r=0;r<e.expressions.length;r++)t(e.expressions[r],n)},UnaryExpression:function(e,n){t(e.argument,n)},Chunk:function(e,n){for(let r=0;r<e.body.length;r++)t(e.body[r],n)},InvalidCodeExpression:()=>{}}},Cd=class{constructor(e,n={}){this.map=Object.assign(HF(this.visit.bind(this)),n),this.callback=e,this.state={exit:!1,skip:!1}}visit(e,n=0){if(e==null)return;if(e.type==null)throw console.error("Error ast type:",e),new Error("Unexpected as type");let r=this.callback(e,n);if(r!=null&&Object.assign(this.state,r),this.state.exit||this.state.skip){this.state.skip=!1;return}let i=this.map[e.type];i?.call(this,e,n+1)}};Jo.ScraperWalker=Cd;function GF(t,e){let n=[];return new Cd((i,s)=>{let o=t(i,s)||{};return o.valid&&i.type!==WF.ASTType.InvalidCodeExpression&&n.push(i),{exit:!!o.exit,skip:!!o.skip}}).visit(e),n}Jo.findEx=GF});var tv=m(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.lookupBase=pn.lookupIdentifier=pn.lookupScopes=pn.lookupRootScope=void 0;var bi=Te(),zF=t=>{let e=t;for(;e.scope;)e=e.scope;return e};pn.lookupRootScope=zF;var KF=t=>{if(!t.scope)return[t];let e=(0,pn.lookupRootScope)(t);return e===t.scope?[t,e]:[t,t.scope,e]};pn.lookupScopes=KF;var VF=t=>{switch(t.type){case bi.ASTType.CallStatement:return(0,pn.lookupIdentifier)(t.expression);case bi.ASTType.CallExpression:return(0,pn.lookupIdentifier)(t.base);case bi.ASTType.Identifier:return t;case bi.ASTType.MemberExpression:return(0,pn.lookupIdentifier)(t.identifier);case bi.ASTType.IndexExpression:return(0,pn.lookupIdentifier)(t.index);default:return null}};pn.lookupIdentifier=VF;var XF=(t=null)=>{switch(t?.type){case bi.ASTType.MemberExpression:return t.base;case bi.ASTType.IndexExpression:return t.base;case bi.ASTType.CallExpression:return t.base;case bi.ASTType.SliceExpression:return t.base;default:return null}};pn.lookupBase=XF});var Zo=m(Xr=>{"use strict";var YF=Xr&&Xr.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),JF=Xr&&Xr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),QF=Xr&&Xr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&YF(e,t,n);return JF(e,t),e};Object.defineProperty(Xr,"__esModule",{value:!0});Xr.LookupHelper=void 0;var ZF=nr(),iC=Te(),Qo=Xo(),e$=QF(Od()),t$=tv(),nv=class{constructor(e,n){this.document=e,this.context=n,this.mergedTypeMap=null}async getTypeMap(){return this.mergedTypeMap==null&&(this.mergedTypeMap=await this.context.documentMerger.build(this.document,this.context)),this.mergedTypeMap}async findAllAssignmentsOfIdentifier(e,n){let r=await this.getTypeMap();if(r==null)return[];let i=r.getScopeContext(n);return i==null?[]:i.aggregator.resolveAvailableAssignmentsWithQuery(e)}async findAllAssignmentsOfItem(e,n){let r=await this.getTypeMap();if(r==null)return[];let i=r.getScopeContext(n);return i==null?[]:i.aggregator.resolveAvailableAssignments(e)}async findAllAvailableIdentifierInRoot(){let e=await this.getTypeMap();return e==null?new Map:e.getRootScopeContext().scope.getAllIdentifier()}async findAllAvailableIdentifier(e){let n=await this.getTypeMap();if(n==null)return new Map;let r=n.getScopeContext(e);return r==null?new Map:r.scope.getAllIdentifier()}async findAllAvailableIdentifierRelatedToPosition(e){let n=await this.getTypeMap(),r=new Map;if(n==null)return r;for(let a of n.container.getAllIdentifier(ZF.SignatureDefinitionBaseType.General))r.set(...a);let i=n.getScopeContext(e.scope);if(i==null)return r;i.scope.isSelfAvailable()&&r.set("self",{kind:Qo.CompletionItemKind.Constant,line:-1}),i.scope.isSuperAvailable()&&r.set("super",{kind:Qo.CompletionItemKind.Constant,line:-1});let s=new Map;(0,Qo.injectIdentifers)(s,i.scope);let o=Array.from(s.entries()).map(([a,u])=>({identifier:a,...u})).sort((a,u)=>a.line-u.line);for(let a=0;a<o.length;a++){let u=o[a];if(u.line>=e.end.line)break;r.set(u.identifier,{kind:u.kind,line:u.line})}return i.scope.locals!==i.scope.globals&&(0,Qo.injectIdentifers)(r,i.scope.globals),i.scope.outer&&(0,Qo.injectIdentifers)(r,i.scope.outer),r}lookupAST(e){let n=this,i=this.context.documentManager.get(n.document).document.lines[e.line+1];if(!i)return null;for(let s=0;s<i.length;s++){let o=i[s],a=e$.findEx((c,l)=>{let h=c.start.line-1,d=c.start.character-1,g=c.end.line-1,y=c.end.character-1;return h>e.line?{exit:!0}:h<g?{valid:e.line>h&&e.line<g||e.line===h&&d<=e.character||e.line===g&&y>=e.character}:{valid:h<=e.line&&d<=e.character&&g>=e.line&&y>=e.character}},o),u=a.pop();if(u)return{closest:u,outer:a}}return null}async lookupBasePath(e){let n=await this.getTypeMap();if(n===null)return null;let r=(0,t$.lookupBase)(e);return r?n.resolveNamespace(r):null}async lookupTypeInfo({closest:e,outer:n}){let r=await this.getTypeMap();if(r===null)return null;let i=n.length>0?n[n.length-1]:void 0;return i?.type===iC.ASTType.MemberExpression&&e===i.identifier||i?.type===iC.ASTType.IndexExpression&&e===i.index&&(0,Qo.isValidIdentifierLiteral)(e)?r.resolveType(i,!0):r.resolveType(e,!0)}lookupType(e){let n=this,r=n.lookupAST(e);return r?n.lookupTypeInfo(r):null}};Xr.LookupHelper=nv});var sC=m(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});Rd.AVAILABLE_CONSTANTS=void 0;Rd.AVAILABLE_CONSTANTS=["true","false","null","params","globals","locals","outer"].map(t=>({label:t,kind:21}))});var oC=m(Pd=>{"use strict";Object.defineProperty(Pd,"__esModule",{value:!0});Pd.AVAILABLE_KEYWORDS=void 0;var ea=Vr(),sn=Te();Pd.AVAILABLE_KEYWORDS=[sn.Keyword.If,sn.Keyword.In,sn.Keyword.Or,sn.Keyword.And,sn.Keyword.Isa,sn.Keyword.For,sn.Keyword.New,sn.Keyword.Not,sn.Keyword.End,sn.Keyword.Then,sn.Keyword.Else,sn.Keyword.Break,sn.Keyword.While,sn.Keyword.Return,sn.Keyword.Function,sn.Keyword.Continue,ea.GreybelKeyword.Envar,ea.GreybelKeyword.Import,ea.GreybelKeyword.Include,ea.GreybelKeyword.Debugger,ea.GreybelKeyword.Line,ea.GreybelKeyword.File].map(t=>({label:t,kind:14}))});var aC=m(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});Dd.AVAILABLE_OPERATORS=void 0;var qu=Ko(),Bt=Te();Dd.AVAILABLE_OPERATORS=[Bt.Operator.Plus,Bt.Operator.Asterik,Bt.Operator.Minus,Bt.Operator.Slash,Bt.Operator.Power,Bt.Operator.Modulo,Bt.Operator.LessThan,Bt.Operator.GreaterThan,Bt.Operator.LessThanOrEqual,Bt.Operator.GreaterThanOrEqual,Bt.Operator.NotEqual,Bt.Operator.Equal,Bt.Operator.AddShorthand,Bt.Operator.SubtractShorthand,Bt.Operator.MultiplyShorthand,Bt.Operator.DivideShorthand,qu.Operator.BitwiseAnd,qu.Operator.BitwiseOr,qu.Operator.LeftShift,qu.Operator.RightShift,qu.Operator.UnsignedRightShift,Bt.Operator.Assign,Bt.Operator.Reference].map(t=>({label:t,kind:24}))});var cC=m(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.activate=sr.getDefaultCompletionList=sr.getPropertyCompletionList=void 0;var uC=Te(),n$=rC(),r$=Zo(),i$=sC(),s$=oC(),o$=aC(),a$=async(t,e)=>{let n=await t.lookupBasePath(e);return n===null?null:n.getAllIdentifier()};sr.getPropertyCompletionList=a$;var u$=()=>[...s$.AVAILABLE_KEYWORDS,...o$.AVAILABLE_OPERATORS,...i$.AVAILABLE_CONSTANTS];sr.getDefaultCompletionList=u$;function c$(t){t.connection.onCompletion(async e=>{if(!t.getConfiguration().autocomplete)return;let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=await t.documentManager.getLatest(n),i=new r$.LookupHelper(r.textDocument,t),s=i.lookupAST(e.position),o=new n$.CompletionListBuilder;if(s){let{closest:a}=s;a instanceof uC.ASTMemberExpression?o.addCollection(await(0,sr.getPropertyCompletionList)(i,a)):a instanceof uC.ASTIndexExpression?o.addCollection(await(0,sr.getPropertyCompletionList)(i,a)):(o.setDefault((0,sr.getDefaultCompletionList)()),o.addCollection(await i.findAllAvailableIdentifierRelatedToPosition(s.closest)))}else o.setDefault((0,sr.getDefaultCompletionList)()),o.addCollection(await i.findAllAvailableIdentifierInRoot());return o.build()}),t.connection.onCompletionResolve(e=>e)}sr.activate=c$});var hC=m((dK,lC)=>{"use strict";lC.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var rv=m((fK,fC)=>{var ju=hC(),dC={};for(let t of Object.keys(ju))dC[ju[t]]=t;var ne={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};fC.exports=ne;for(let t of Object.keys(ne)){if(!("channels"in ne[t]))throw new Error("missing channels property: "+t);if(!("labels"in ne[t]))throw new Error("missing channel labels property: "+t);if(ne[t].labels.length!==ne[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:n}=ne[t];delete ne[t].channels,delete ne[t].labels,Object.defineProperty(ne[t],"channels",{value:e}),Object.defineProperty(ne[t],"labels",{value:n})}ne.rgb.hsl=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(e,n,r),s=Math.max(e,n,r),o=s-i,a,u;s===i?a=0:e===s?a=(n-r)/o:n===s?a=2+(r-e)/o:r===s&&(a=4+(e-n)/o),a=Math.min(a*60,360),a<0&&(a+=360);let c=(i+s)/2;return s===i?u=0:c<=.5?u=o/(s+i):u=o/(2-s-i),[a,u*100,c*100]};ne.rgb.hsv=function(t){let e,n,r,i,s,o=t[0]/255,a=t[1]/255,u=t[2]/255,c=Math.max(o,a,u),l=c-Math.min(o,a,u),h=function(d){return(c-d)/6/l+1/2};return l===0?(i=0,s=0):(s=l/c,e=h(o),n=h(a),r=h(u),o===c?i=r-n:a===c?i=1/3+e-r:u===c&&(i=2/3+n-e),i<0?i+=1:i>1&&(i-=1)),[i*360,s*100,c*100]};ne.rgb.hwb=function(t){let e=t[0],n=t[1],r=t[2],i=ne.rgb.hsl(t)[0],s=1/255*Math.min(e,Math.min(n,r));return r=1-1/255*Math.max(e,Math.max(n,r)),[i,s*100,r*100]};ne.rgb.cmyk=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(1-e,1-n,1-r),s=(1-e-i)/(1-i)||0,o=(1-n-i)/(1-i)||0,a=(1-r-i)/(1-i)||0;return[s*100,o*100,a*100,i*100]};function l$(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}ne.rgb.keyword=function(t){let e=dC[t];if(e)return e;let n=1/0,r;for(let i of Object.keys(ju)){let s=ju[i],o=l$(t,s);o<n&&(n=o,r=i)}return r};ne.keyword.rgb=function(t){return ju[t]};ne.rgb.xyz=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;let i=e*.4124+n*.3576+r*.1805,s=e*.2126+n*.7152+r*.0722,o=e*.0193+n*.1192+r*.9505;return[i*100,s*100,o*100]};ne.rgb.lab=function(t){let e=ne.rgb.xyz(t),n=e[0],r=e[1],i=e[2];n/=95.047,r/=100,i/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let s=116*r-16,o=500*(n-r),a=200*(r-i);return[s,o,a]};ne.hsl.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100,i,s,o;if(n===0)return o=r*255,[o,o,o];r<.5?i=r*(1+n):i=r+n-r*n;let a=2*r-i,u=[0,0,0];for(let c=0;c<3;c++)s=e+1/3*-(c-1),s<0&&s++,s>1&&s--,6*s<1?o=a+(i-a)*6*s:2*s<1?o=i:3*s<2?o=a+(i-a)*(2/3-s)*6:o=a,u[c]=o*255;return u};ne.hsl.hsv=function(t){let e=t[0],n=t[1]/100,r=t[2]/100,i=n,s=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=s<=1?s:2-s;let o=(r+n)/2,a=r===0?2*i/(s+i):2*n/(r+n);return[e,a*100,o*100]};ne.hsv.rgb=function(t){let e=t[0]/60,n=t[1]/100,r=t[2]/100,i=Math.floor(e)%6,s=e-Math.floor(e),o=255*r*(1-n),a=255*r*(1-n*s),u=255*r*(1-n*(1-s));switch(r*=255,i){case 0:return[r,u,o];case 1:return[a,r,o];case 2:return[o,r,u];case 3:return[o,a,r];case 4:return[u,o,r];case 5:return[r,o,a]}};ne.hsv.hsl=function(t){let e=t[0],n=t[1]/100,r=t[2]/100,i=Math.max(r,.01),s,o;o=(2-n)*r;let a=(2-n)*i;return s=n*i,s/=a<=1?a:2-a,s=s||0,o/=2,[e,s*100,o*100]};ne.hwb.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100,i=n+r,s;i>1&&(n/=i,r/=i);let o=Math.floor(6*e),a=1-r;s=6*e-o,o&1&&(s=1-s);let u=n+s*(a-n),c,l,h;switch(o){default:case 6:case 0:c=a,l=u,h=n;break;case 1:c=u,l=a,h=n;break;case 2:c=n,l=a,h=u;break;case 3:c=n,l=u,h=a;break;case 4:c=u,l=n,h=a;break;case 5:c=a,l=n,h=u;break}return[c*255,l*255,h*255]};ne.cmyk.rgb=function(t){let e=t[0]/100,n=t[1]/100,r=t[2]/100,i=t[3]/100,s=1-Math.min(1,e*(1-i)+i),o=1-Math.min(1,n*(1-i)+i),a=1-Math.min(1,r*(1-i)+i);return[s*255,o*255,a*255]};ne.xyz.rgb=function(t){let e=t[0]/100,n=t[1]/100,r=t[2]/100,i,s,o;return i=e*3.2406+n*-1.5372+r*-.4986,s=e*-.9689+n*1.8758+r*.0415,o=e*.0557+n*-.204+r*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),[i*255,s*255,o*255]};ne.xyz.lab=function(t){let e=t[0],n=t[1],r=t[2];e/=95.047,n/=100,r/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;let i=116*n-16,s=500*(e-n),o=200*(n-r);return[i,s,o]};ne.lab.xyz=function(t){let e=t[0],n=t[1],r=t[2],i,s,o;s=(e+16)/116,i=n/500+s,o=s-r/200;let a=s**3,u=i**3,c=o**3;return s=a>.008856?a:(s-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,i*=95.047,s*=100,o*=108.883,[i,s,o]};ne.lab.lch=function(t){let e=t[0],n=t[1],r=t[2],i;i=Math.atan2(r,n)*360/2/Math.PI,i<0&&(i+=360);let o=Math.sqrt(n*n+r*r);return[e,o,i]};ne.lch.lab=function(t){let e=t[0],n=t[1],i=t[2]/360*2*Math.PI,s=n*Math.cos(i),o=n*Math.sin(i);return[e,s,o]};ne.rgb.ansi16=function(t,e=null){let[n,r,i]=t,s=e===null?ne.rgb.hsv(t)[2]:e;if(s=Math.round(s/50),s===0)return 30;let o=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return s===2&&(o+=60),o};ne.hsv.ansi16=function(t){return ne.rgb.ansi16(ne.hsv.rgb(t),t[2])};ne.rgb.ansi256=function(t){let e=t[0],n=t[1],r=t[2];return e===n&&n===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)};ne.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let n=(~~(t>50)+1)*.5,r=(e&1)*n*255,i=(e>>1&1)*n*255,s=(e>>2&1)*n*255;return[r,i,s]};ne.ansi256.rgb=function(t){if(t>=232){let s=(t-232)*10+8;return[s,s,s]}t-=16;let e,n=Math.floor(t/36)/5*255,r=Math.floor((e=t%36)/6)/5*255,i=e%6/5*255;return[n,r,i]};ne.rgb.hex=function(t){let n=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n};ne.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let n=e[0];e[0].length===3&&(n=n.split("").map(a=>a+a).join(""));let r=parseInt(n,16),i=r>>16&255,s=r>>8&255,o=r&255;return[i,s,o]};ne.rgb.hcg=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.max(Math.max(e,n),r),s=Math.min(Math.min(e,n),r),o=i-s,a,u;return o<1?a=s/(1-o):a=0,o<=0?u=0:i===e?u=(n-r)/o%6:i===n?u=2+(r-e)/o:u=4+(e-n)/o,u/=6,u%=1,[u*360,o*100,a*100]};ne.hsl.hcg=function(t){let e=t[1]/100,n=t[2]/100,r=n<.5?2*e*n:2*e*(1-n),i=0;return r<1&&(i=(n-.5*r)/(1-r)),[t[0],r*100,i*100]};ne.hsv.hcg=function(t){let e=t[1]/100,n=t[2]/100,r=e*n,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],r*100,i*100]};ne.hcg.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100;if(n===0)return[r*255,r*255,r*255];let i=[0,0,0],s=e%1*6,o=s%1,a=1-o,u=0;switch(Math.floor(s)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return u=(1-n)*r,[(n*i[0]+u)*255,(n*i[1]+u)*255,(n*i[2]+u)*255]};ne.hcg.hsv=function(t){let e=t[1]/100,n=t[2]/100,r=e+n*(1-e),i=0;return r>0&&(i=e/r),[t[0],i*100,r*100]};ne.hcg.hsl=function(t){let e=t[1]/100,r=t[2]/100*(1-e)+.5*e,i=0;return r>0&&r<.5?i=e/(2*r):r>=.5&&r<1&&(i=e/(2*(1-r))),[t[0],i*100,r*100]};ne.hcg.hwb=function(t){let e=t[1]/100,n=t[2]/100,r=e+n*(1-e);return[t[0],(r-e)*100,(1-r)*100]};ne.hwb.hcg=function(t){let e=t[1]/100,r=1-t[2]/100,i=r-e,s=0;return i<1&&(s=(r-i)/(1-i)),[t[0],i*100,s*100]};ne.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};ne.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};ne.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};ne.gray.hsl=function(t){return[0,0,t[0]]};ne.gray.hsv=ne.gray.hsl;ne.gray.hwb=function(t){return[0,100,t[0]]};ne.gray.cmyk=function(t){return[0,0,0,t[0]]};ne.gray.lab=function(t){return[t[0],0,0]};ne.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,r=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(r.length)+r};ne.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var gC=m((pK,pC)=>{var Id=rv();function h$(){let t={},e=Object.keys(Id);for(let n=e.length,r=0;r<n;r++)t[e[r]]={distance:-1,parent:null};return t}function d$(t){let e=h$(),n=[t];for(e[t].distance=0;n.length;){let r=n.pop(),i=Object.keys(Id[r]);for(let s=i.length,o=0;o<s;o++){let a=i[o],u=e[a];u.distance===-1&&(u.distance=e[r].distance+1,u.parent=r,n.unshift(a))}}return e}function f$(t,e){return function(n){return e(t(n))}}function p$(t,e){let n=[e[t].parent,t],r=Id[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)n.unshift(e[i].parent),r=f$(Id[e[i].parent][i],r),i=e[i].parent;return r.conversion=n,r}pC.exports=function(t){let e=d$(t),n={},r=Object.keys(e);for(let i=r.length,s=0;s<i;s++){let o=r[s];e[o].parent!==null&&(n[o]=p$(o,e))}return n}});var yC=m((gK,mC)=>{var iv=rv(),g$=gC(),ta={},m$=Object.keys(iv);function y$(t){let e=function(...n){let r=n[0];return r==null?r:(r.length>1&&(n=r),t(n))};return"conversion"in t&&(e.conversion=t.conversion),e}function b$(t){let e=function(...n){let r=n[0];if(r==null)return r;r.length>1&&(n=r);let i=t(n);if(typeof i=="object")for(let s=i.length,o=0;o<s;o++)i[o]=Math.round(i[o]);return i};return"conversion"in t&&(e.conversion=t.conversion),e}m$.forEach(t=>{ta[t]={},Object.defineProperty(ta[t],"channels",{value:iv[t].channels}),Object.defineProperty(ta[t],"labels",{value:iv[t].labels});let e=g$(t);Object.keys(e).forEach(r=>{let i=e[r];ta[t][r]=b$(i),ta[t][r].raw=y$(i)})});mC.exports=ta});var _C=m(na=>{"use strict";var _$=na&&na.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(na,"__esModule",{value:!0});na.activate=void 0;var sv=_$(yC()),v$=Te(),bC;(function(t){t.Black="black",t.Blue="blue",t.Green="green",t.Orange="orange",t.Purple="purple",t.Red="red",t.White="white",t.Yellow="yellow"})(bC||(bC={}));var ov={black:"#000000",blue:"#0000FF",green:"#00FF00",orange:"#FF8800",purple:"#CC8899",red:"#FF0000",white:"#FFFFFF",yellow:"#FFFF00"},S$=()=>new RegExp(`(?:mark|color)=(${Object.keys(ov).join("|")}|(?:#[0-9a-f]{6}|#[0-9a-f]{3}))`,"ig"),w$=Object.prototype.hasOwnProperty;function T$(t){t.connection.onColorPresentation(e=>[{label:`#${sv.default.rgb.hex(e.color.red*255,e.color.green*255,e.color.blue*255)}`}]),t.connection.onDocumentColor(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let s=(await t.documentManager.getLatest(n)).document.literals.filter(u=>u.type===v$.ASTType.StringLiteral),o=[],a=({match:u,markup:c,value:l,astPosition:h,lineIndex:d})=>{let g=u.index+c.indexOf("=")+1,y=g+l.length,_=h.line-1+d,C=g,k=y;return d===0&&(C+=h.character,k+=h.character),{start:{line:_,character:C},end:{line:_,character:k}}};for(let u=0;u<s.length;u++){let c=s[u];if(!c.start)continue;let l=c.start,h=c.value.toString().split(`
114
- `);for(let d=0;d<h.length;d++){let g=h[d],y=S$(),_;for(;_=y.exec(g);){let[C,k]=_,T=a({match:_,markup:C,value:k,astPosition:l,lineIndex:d});if(k.startsWith("#")){let[w,v,L]=sv.default.hex.rgb(k.slice(1));o.push({range:T,color:{red:w/255,green:v/255,blue:L/255,alpha:1}})}else if(w$.call(ov,k)){let[w,v,L]=sv.default.hex.rgb(ov[k].slice(1));o.push({range:T,color:{red:w/255,green:v/255,blue:L/255,alpha:1}})}else o.push({range:T,color:{red:0,green:0,blue:0,alpha:1}})}}}return o})}na.activate=T$});var vC=m(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});Md.activate=void 0;var E$=Te(),x$=Zo(),k$=t=>`${t.targetUri}:${t.targetRange.start.line}:${t.targetRange.start.character}-${t.targetRange.end.line}:${t.targetRange.end.character}`,A$=async(t,e,n)=>{let r=await t.findAllAssignmentsOfItem(e,n),i=[],s=new Set;for(let o of r){let a=o.node;if(!a.start||!a.end)continue;let u={line:a.start.line-1,character:a.start.character-1},c={line:a.end.line-1,character:a.end.character-1},l={targetUri:o.source,targetRange:{start:u,end:c},targetSelectionRange:{start:u,end:c}},h=k$(l);s.has(h)||(s.add(h),i.push(l))}return i};function C$(t){t.connection.onDefinition(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=new x$.LookupHelper(n,t),i=r.lookupAST(e.position);if(!i)return;let{outer:s,closest:o}=i,a=s.length>0?s[s.length-1]:void 0,u=o;return a&&a instanceof E$.ASTMemberExpression&&a.identifier===o&&(u=a),await A$(r,u,u.scope)})}Md.activate=C$});var SC=m(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});Ld.activate=void 0;async function O$(t,e){let n=await e.documentManager.getLatest(t);return n.errors.map(r=>{if(r?.range){let i=r.range;return{range:{start:{line:i.start.line-1,character:i.start.character-1},end:{line:i.end.line-1,character:i.end.character-1}},message:r.message,severity:1}}return{range:{start:n.document.start,end:n.document.end},message:r.message,severity:1}})}function R$(t){t.connection.languages.diagnostics.on(async e=>{if(!t.getConfiguration().diagnostic)return;let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=await O$(n,t);return r.length===0?{kind:"full",items:[]}:{kind:"full",items:r}})}Ld.activate=R$});var wC=m(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});Nd.getStringHashCode=void 0;Nd.getStringHashCode=function(){let t=new Map,e=n=>{let r,i;for(r=0,i=0;r<n.length;r++)i=Math.imul(31,i)+n.charCodeAt(r)|0;return i};return n=>{if(n.length===0)return 0;let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i}}()});var av=m(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});Fd.createExpressionHash=void 0;var qd=Te(),TC=wC(),jd=(t,e)=>t.$$hash=e,P$=t=>{var e;return(e=t.$$hash)!==null&&e!==void 0?e:null};function ra(t){let e=P$(t);if(e!==null)return e;let n=(0,TC.getStringHashCode)(t.type);switch(t.type){case qd.ASTType.ParenthesisExpression:return ra(t.expression);case qd.ASTType.MemberExpression:{let r=t;return n^=ra(r.base),n^=ra(r.identifier),jd(t,n)}case qd.ASTType.IndexExpression:{let r=t;return n^=ra(r.base),n^=ra(r.index),jd(t,n)}case qd.ASTType.Identifier:{let r=t;return n^=(0,TC.getStringHashCode)(r.name),jd(t,n)}}return jd(t,n)}function D$(t){return ra(t)}Fd.createExpressionHash=D$});var oa=m(sa=>{"use strict";Object.defineProperty(sa,"__esModule",{value:!0});sa.getLiteralValue=sa.getLiteralRawValue=void 0;var ia=Te(),I$=t=>{switch(t.type){case ia.ASTType.NilLiteral:return"null";case ia.ASTType.NumericLiteral:{let e=t;return`${e.negated?"-":""}${e.raw}`}case ia.ASTType.BooleanLiteral:{let e=t;return`${e.negated?"-":""}${e.raw}`}default:return t.raw.toString()}};sa.getLiteralRawValue=I$;var M$=t=>{switch(t.type){case ia.ASTType.NilLiteral:return"null";case ia.ASTType.NumericLiteral:{let e=t;return`${e.negated?"-":""}${e.value}`}case ia.ASTType.BooleanLiteral:{let e=t;return`${e.negated?"-":""}${e.value}`}default:return t.value.toString()}};sa.getLiteralValue=M$});var cv=m($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});$s.BeautifyBodyIterator=$s.FILLER_TYPE=void 0;var Fs=Te();$s.FILLER_TYPE="FILLER";var uv=class{constructor(e,n){this._base=e,this._items=n.sort((r,i)=>r.range[0]-i.range[0]),this._index=0,this._freeSpaceIndex=0,this._freeSpace=0,this._lastEndLine=0,this._checkedIndexes=new Set,this._previous=null}getBlockOpenerEndLine(e){switch(e.type){case Fs.ASTType.IfClause:return e.condition.end.line;case Fs.ASTType.WhileStatement:return e.condition.end.line;case Fs.ASTType.ForGenericStatement:return e.iterator.end.line;case Fs.ASTType.Chunk:return e.start.line-1}return e.start.line}getBlockCloseEndLine(e){switch(e.type){case Fs.ASTType.Chunk:return e.end.line+1}return e.end.line}getPreviousEndLine(e){if(e==null)return 0;if(e.type===Fs.ASTType.IfShortcutStatement){let n=e;return n.clauses[n.clauses.length-1].body[0].end.line}return e.end.line}getFreeSpaceItem(){let e={line:this._lastEndLine+this._freeSpaceIndex+1,character:0};return this._freeSpaceIndex++,this._freeSpace===this._freeSpaceIndex&&(this._lastEndLine=0,this._freeSpaceIndex=0,this._freeSpace=0),new Fs.ASTBase($s.FILLER_TYPE,{start:e,end:e,range:[0,0],scope:this._base.scope})}next(){if(this._freeSpace>this._freeSpaceIndex)return{value:this.getFreeSpaceItem(),done:!1};if(this._index>=this._items.length){if(!this._checkedIndexes.has(this._items.length)){let n=this._previous?this.getPreviousEndLine(this._previous):this.getBlockOpenerEndLine(this._base),r=Math.max(this.getBlockCloseEndLine(this._base)-n-1,0);if(r>0)return this._checkedIndexes.add(this._items.length),this._lastEndLine=n,this._freeSpace=r,{value:this.getFreeSpaceItem(),done:!1}}return{value:null,done:!0}}let e=this._items[this._index];if(!this._checkedIndexes.has(this._index)){let n=this._previous?this.getPreviousEndLine(this._previous):this.getBlockOpenerEndLine(this._base),r=Math.max(e.start.line-n-1,0);if(r>0)return this._checkedIndexes.add(this._index),this._lastEndLine=n,this._freeSpace=r,{value:this.getFreeSpaceItem(),done:!1}}return this._index++,this._previous=e,{value:e,done:!1}}};$s.BeautifyBodyIterator=uv});var hv=m(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.BeautifyContext=Us.IndentationType=void 0;var Bs=Te(),EC=cv(),xC;(function(t){t[t.Tab=0]="Tab",t[t.Whitespace=1]="Whitespace"})(xC=Us.IndentationType||(Us.IndentationType={}));var lv=class{get indent(){return this._indent}get isMultilineAllowed(){return this._isMultilineAllowed}constructor(e,n){this.factory=e,this.options=n,this._indent=0,this._stack=[],this._contexts=new Map,this._isMultilineAllowed=!0,this.getIndent=n.indentation===xC.Tab?(r=0)=>" ".repeat(this._indent+r):(r=0)=>" ".repeat(n.indentationSpaces).repeat(this._indent+r)}buildChunkContext(e){let n=new Map,r=Object.keys(e.lines),i=new Set;for(let s=0;s<r.length;s++){let o=Number(r[s]),u=e.lines[o].filter(c=>c.type===Bs.ASTType.Comment);for(let c=0;c<u.length;c++){let l=u[c];if(!i.has(l))if(i.add(l),l.isMultiline){let h=l.value.split(`
115
- `);h.forEach((d,g)=>{let y=o+g;n.has(y)||n.set(y,[]);let C=e.lines[y].filter(L=>L.type!==Bs.ASTType.Comment).map(L=>L.start.character),k=C.length>0?Math.min(...C):-1,T=y===o,w=y===o+h.length-1,v=w?l.end.character<k:!1;n.get(y).push({isMultiline:!0,isStart:T,isEnd:w,isBefore:v,value:d})})}else n.has(o)||n.set(o,[]),n.get(o).push({isMultiline:!1,isStart:!1,isEnd:!1,isBefore:!1,value:l.value})}}return{commentBuckets:n}}getChunkContext(e){return this._contexts.get(e)}getCurrentChunk(){return this._stack[this._stack.length-1]}pushStack(e){this._stack.push(e),this._contexts.set(e,this.buildChunkContext(e))}popStack(){this._stack.pop()}disableMultiline(){this._isMultilineAllowed=!1}enableMultiline(){this._isMultilineAllowed=!0}incIndent(){this._indent++}decIndent(){this._indent--}getBlockOpenerEndLine(e){return e instanceof Bs.ASTIfClause||e instanceof Bs.ASTWhileStatement?e.condition.end.line:e instanceof Bs.ASTForGenericStatement?e.iterator.end.line:e instanceof Bs.ASTChunk?e.start.line-1:e.start.line}getPreviousEndLine(e){if(e==null)return 0;if(e.type===Bs.ASTType.IfShortcutStatement){let n=e;return n.clauses[n.clauses.length-1].body[0].end.line}return e.end.line}buildBlock(e){let n=new EC.BeautifyBodyIterator(e,e.body),r=n.next();for(;!r.done;){let i=r.value;if(i.type===EC.FILLER_TYPE){this.factory.pushSegment(this.getIndent()),this.factory.pushComment(i.start.line),this.factory.eol(),r=n.next();continue}this.factory.pushSegment(this.getIndent()),this.factory.process(i,{isCommand:!0}),this.factory.eol(),r=n.next()}}};Us.BeautifyContext=lv});var dv=m(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.commentToText=Lt.hasEmptyBody=Lt.containsMultilineItemInShortcutClauses=Lt.getLastComment=Lt.unwrap=Lt.countRightBinaryExpressions=Lt.SHORTHAND_OPERATORS=void 0;var An=Te();Lt.SHORTHAND_OPERATORS=[An.Operator.Plus,An.Operator.Minus,An.Operator.Asterik,An.Operator.Slash,An.Operator.Modulo,An.Operator.Power];var L$=t=>{if(t=(0,Lt.unwrap)(t),t instanceof An.ASTComparisonGroupExpression)return t.expressions.length;let e=[t],n=0;for(;e.length>0;){let r=e.pop();r instanceof An.ASTBinaryExpression&&n++,(r instanceof An.ASTBinaryExpression||r instanceof An.ASTLogicalExpression||r instanceof An.ASTIsaExpression)&&(e.push((0,Lt.unwrap)(r.left)),e.push((0,Lt.unwrap)(r.right)))}return n};Lt.countRightBinaryExpressions=L$;var N$=t=>{for(;t instanceof An.ASTParenthesisExpression;)t=t.expression;return t};Lt.unwrap=N$;var q$=t=>{for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.type===An.ASTType.Comment)return n}return null};Lt.getLastComment=q$;var j$=(t,e)=>e.some(n=>t.line<n.body[0].end.line);Lt.containsMultilineItemInShortcutClauses=j$;var F$=t=>!t.some(e=>!(e instanceof An.ASTComment));Lt.hasEmptyBody=F$;var $$=t=>t.isMultiline?t.isStart&&!t.isEnd?"/* "+t.value.trim():!t.isStart&&t.isEnd?t.value.trim()+" */":t.isStart&&t.isEnd?"/* "+t.value.trim()+" */":t.value.trim():"// "+t.value.trim();Lt.commentToText=$$});var pv=m($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});$d.Stack=void 0;var fv=class{constructor(){let e=this;e.currentStack=[]}get(e){let r=this.currentStack;e==null&&(e=0);let i=r.length-e-1;return i<0?null:r[i]}depth(){return this.currentStack.filter(function(e){return Object.prototype.hasOwnProperty.call(e,"body")}).length}lookup(e){let n=this;for(let r=n.currentStack.length-2;r>=0;r--)if(e(n.currentStack[r]))return!0;return!1}push(e){let n=this;return n.currentStack.push(e),n}pop(){let e=this;return e.currentStack.pop(),e}};$d.Stack=fv});var Fu=m(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});Bd.Factory=void 0;var B$=pv(),gv=class{get activeLine(){return this._activeLine}get lines(){return this._lines}get currentStack(){return this._currentStack}get currentDependency(){return this._currentDependency}constructor(e){this.transformer=e,this._activeLine=this.createLine(),this._lines=[],this._currentDependency=null,this._currentStack=new B$.Stack}pushSegment(e,n){this._activeLine.segments.push(e)}pushComment(e){throw new Error("Not implemented")}createLine(){return{segments:[]}}eol(e){this._lines.push(this._activeLine),this._activeLine=this.createLine()}reset(){this._activeLine=this.createLine(),this._lines=[]}process(e,n={}){let r=this,i=r._currentStack;if(e==null)return;if(e.type==null)throw console.error("Error AST type:",e),new Error("Unexpected AST type");let s=r.handlers[e.type];if(s==null)throw console.error("Error AST:",e),new Error("Type does not exist "+e.type);i.push(e),s.call(this,e,n),i.pop()}};Bd.Factory=gv});var yv=m(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});Hd.BeautifyFactory=void 0;var $u=Te(),U$=require("path"),kC=av(),Ud=oa(),Wd=cv(),AC=hv(),kr=dv(),W$=Fu(),mv=class extends W$.Factory{constructor(e){super(e),this.handlers={ParenthesisExpression:function(o,a){this.pushSegment("(",o),this.process(o.expression,{hasLogicalIndentActive:a.hasLogicalIndentActive}),this.pushSegment(")",o)},Comment:function(o,a){},AssignmentStatement:function(o,a){let u=o.variable,c=o.init;if(this.process(u),(u instanceof $u.ASTIdentifier||u instanceof $u.ASTMemberExpression)&&c instanceof $u.ASTBinaryExpression&&(c.left instanceof $u.ASTIdentifier||c.left instanceof $u.ASTMemberExpression)&&kr.SHORTHAND_OPERATORS.includes(c.operator)&&(0,kC.createExpressionHash)(u)===(0,kC.createExpressionHash)(c.left)){this.pushSegment(" "+c.operator+"= ",o),this.process((0,kr.unwrap)(c.right));return}this.pushSegment(" = ",o),this.process(c)},MemberExpression:function(o,a){this.process(o.base),this.pushSegment(o.indexer,o),this.process(o.identifier)},FunctionDeclaration:function(o,a){if(o.parameters.length===0)this.pushSegment("function",{start:o.start,end:o.start});else{this.context.disableMultiline(),this.pushSegment("function(",{start:o.start,end:o.start});for(let u=0;u<o.parameters.length;u++){let c=o.parameters[u];this.process(c),u!==o.parameters.length-1&&this.pushSegment(", ",c)}this.pushSegment(")",{start:o.start,end:o.start}),this.context.enableMultiline()}this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent(),this.pushSegment(this.context.getIndent()+"end function",{start:o.end,end:o.end})},MapConstructorExpression:function(o,a){if(o.fields.length===0){this.pushSegment("{}",o);return}if(o.fields.length===1){this.pushSegment("{ ",o),this.process(o.fields[0]),this.pushSegment(" }",o);return}if(this.context.isMultilineAllowed){this.context.incIndent(),this.pushSegment("{",{start:o.start,end:o.start}),this.eol();let u=new Wd.BeautifyBodyIterator(o,o.fields),c=u.next();for(;!c.done;){let l=c.value;if(l.type===Wd.FILLER_TYPE){this.pushSegment(this.context.getIndent()),this.pushComment(l.start.line),this.eol(),c=u.next();continue}this.pushSegment(this.context.getIndent(),l),this.process(l),this.pushSegment(",",l),this.eol(),c=u.next()}this.context.decIndent(),this.pushSegment(this.context.getIndent()+"}",{start:o.end,end:o.end});return}this.pushSegment("{ ",{start:o.start,end:o.start});for(let u=0;u<o.fields.length;u++){let c=o.fields[u];this.process(c),u!==o.fields.length-1&&this.pushSegment(", ",c)}this.context.decIndent(),this.pushSegment(" }",{start:o.end,end:o.end})},MapKeyString:function(o,a){this.process(o.key),this.pushSegment(": ",o),this.process(o.value)},Identifier:function(o,a){this.pushSegment(o.name,o)},ReturnStatement:function(o,a){this.pushSegment("return ",o),o.argument&&this.process(o.argument)},NumericLiteral:function(o,a){this.pushSegment((0,Ud.getLiteralValue)(o),o)},WhileStatement:function(o,a){this.pushSegment("while ",{start:o.start,end:o.start}),this.context.disableMultiline(),this.process(o.condition),this.context.enableMultiline(),this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent(),this.pushSegment(this.context.getIndent()+"end while",{start:o.end,end:o.end})},CallExpression:function(o,a){let u=this.lines.length-1;if(this.process(o.base),o.arguments.length===0)return;if(o.arguments.length>3&&this.context.isMultilineAllowed){this.context.incIndent(),this.pushSegment("(",{start:o.start,end:o.start}),this.eol();for(let h=0;h<o.arguments.length;h++){let d=o.arguments[h];this.pushSegment(this.context.getIndent(),d),this.process(d),h!==o.arguments.length-1&&(this.pushSegment(",",d),this.eol())}this.context.decIndent(),this.pushSegment(")",{start:o.end,end:o.end});return}a.isCommand&&!this.transformer.buildOptions.keepParentheses?this.pushSegment(" ",{start:o.start,end:o.start}):this.pushSegment("(",{start:o.start,end:o.start});let c=this.lines.length;for(let h=0;h<o.arguments.length;h++){let d=o.arguments[h];this.process(d),h!==o.arguments.length-1&&this.pushSegment(", ",d)}let l=c!==this.lines.length;if(o.arguments.length>1&&l){this.eol(),this._lines=this._lines.slice(0,u+1),this.pushSegment(this.context.getIndent(),o.base),this.process(o.base),this.pushSegment("(",{start:o.start,end:o.start}),this.eol(),this.context.incIndent();for(let h=0;h<o.arguments.length;h++){let d=o.arguments[h];this.pushSegment(this.context.getIndent(),d),this.process(d),h!==o.arguments.length-1&&(this.pushSegment(",",d),this.eol())}this.context.decIndent(),this.pushSegment(")",{start:o.end,end:o.end});return}a.isCommand&&!this.transformer.buildOptions.keepParentheses||this.pushSegment(")",{start:o.end,end:o.end})},StringLiteral:function(o,a){this.pushSegment((0,Ud.getLiteralRawValue)(o),{start:o.end,end:o.end})},SliceExpression:function(o,a){this.process(o.base),this.pushSegment("[",o),this.process(o.left),this.pushSegment(" : ",o),this.process(o.right),this.pushSegment("]",o)},IndexExpression:function(o,a){this.process(o.base),this.pushSegment("[",o),this.process(o.index),this.pushSegment("]",o)},UnaryExpression:function(o,a){o.operator==="new"?this.pushSegment(o.operator+" ",o):this.pushSegment(o.operator,o),this.process(o.argument)},NegationExpression:function(o,a){this.pushSegment("not ",o),this.process(o.argument)},FeatureEnvarExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#envar ${o.name}`,o);return}let u=this.transformer.environmentVariables.get(o.name);if(!u){this.pushSegment("null",o);return}this.pushSegment(`"${u}"`,o)},IfShortcutStatement:function(o,a){for(let u=0;u<o.clauses.length;u++){let c=o.clauses[u];this.process(c),u!==o.clauses.length-1&&this.pushSegment(" ",o)}},IfShortcutClause:function(o,a){this.pushSegment("if ",o),this.process((0,kr.unwrap)(o.condition)),this.pushSegment(" then ",o),this.process(o.body[0])},ElseifShortcutClause:function(o,a){this.pushSegment("else if ",o),this.process((0,kr.unwrap)(o.condition)),this.pushSegment(" then ",o),this.process(o.body[0])},ElseShortcutClause:function(o,a){this.pushSegment("else ",o),this.process(o.body[0])},NilLiteral:function(o,a){this.pushSegment((0,Ud.getLiteralRawValue)(o),o)},ForGenericStatement:function(o,a){this.pushSegment("for ",{start:o.start,end:o.start}),this.process((0,kr.unwrap)(o.variable)),this.pushSegment(" in ",{start:o.start,end:o.start}),this.process((0,kr.unwrap)(o.iterator)),this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent(),this.pushSegment(this.context.getIndent()+"end for",{start:o.end,end:o.end})},IfStatement:function(o,a){for(let u of o.clauses)this.process(u);this.pushSegment(this.context.getIndent()+"end if",{start:o.end,end:o.end})},IfClause:function(o,a){this.pushSegment("if ",{start:o.start,end:o.start}),this.process((0,kr.unwrap)(o.condition)),this.pushSegment(" then",{start:o.start,end:o.start}),this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent()},ElseifClause:function(o,a){this.pushSegment(this.context.getIndent()+"else if ",{start:o.start,end:o.start}),this.process((0,kr.unwrap)(o.condition)),this.pushSegment(" then",{start:o.start,end:o.start}),this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent()},ElseClause:function(o,a){this.pushSegment(this.context.getIndent()+"else",{start:o.start,end:o.start}),this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent()},ContinueStatement:function(o,a){this.pushSegment("continue",o)},BreakStatement:function(o,a){this.pushSegment("break",o)},CallStatement:function(o,a){this.process(o.expression,{isCommand:!0})},FeatureInjectExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#inject "${o.path}";`,o);return}if(this.currentDependency===null){this.pushSegment(`#inject "${o.path}";`,o);return}let u=this.currentDependency.injections.get(o.path);if(u==null){this.pushSegment("null",o);return}this.pushSegment(`"${u.replace(/"/g,()=>'""')}"`,o)},FeatureImportExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#import ",o),this.process(o.name),this.pushSegment(` from "${o.path}";`,o);return}if(!o.chunk){this.pushSegment("#import ",o),this.process(o.name),this.pushSegment(` from "${o.path}";`,o);return}this.process(o.name),this.pushSegment(' = __REQUIRE("'+o.namespace+'")',o)},FeatureIncludeExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#include "${o.path}";`,o);return}if(!o.chunk){this.pushSegment(`#include "${o.path}";`,o);return}this.process(o.chunk)},FeatureDebuggerExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment("debugger",o);return}this.pushSegment("//debugger",o)},FeatureLineExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#line",o);return}this.pushSegment(`${o.start.line}`,o)},FeatureFileExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#filename",o);return}this.pushSegment(`"${(0,U$.basename)(o.filename).replace(/"/g,()=>'"')}"`,o)},ListConstructorExpression:function(o,a){if(o.fields.length===0){this.pushSegment("[]",o);return}if(o.fields.length===1){this.pushSegment("[ ",o),this.process(o.fields[0]),this.pushSegment(" ]",o);return}if(this.context.isMultilineAllowed){this.context.incIndent(),this.pushSegment("[",{start:o.start,end:o.start}),this.eol();let u=new Wd.BeautifyBodyIterator(o,o.fields),c=u.next();for(;!c.done;){let l=c.value;if(l.type===Wd.FILLER_TYPE){this.pushSegment(this.context.getIndent()),this.pushComment(l.start.line),this.eol(),c=u.next();continue}this.pushSegment(this.context.getIndent(),l),this.process(l),this.pushSegment(",",l),this.eol(),c=u.next()}this.context.decIndent(),this.pushSegment(this.context.getIndent()+"]",{start:o.end,end:o.end});return}this.pushSegment("[ ",o);for(let u=0;u<o.fields.length;u++){let c=o.fields[u];this.process(c),u!==o.fields.length-1&&this.pushSegment(", ",c)}this.pushSegment(" ]",o)},ListValue:function(o,a){this.process(o.value)},BooleanLiteral:function(o,a){this.pushSegment((0,Ud.getLiteralRawValue)(o),o)},EmptyExpression:function(o,a){this.pushSegment("",o)},IsaExpression:function(o,a){this.process(o.left,{hasLogicalIndentActive:a.hasLogicalIndentActive}),this.pushSegment(" "+o.operator+" ",o),this.process(o.right,{hasLogicalIndentActive:a.hasLogicalIndentActive})},LogicalExpression:function(o,a){if((0,kr.countRightBinaryExpressions)(o.right)>2){a.hasLogicalIndentActive||this.context.incIndent(),this.process(o.left,{hasLogicalIndentActive:!0}),this.pushSegment(" "+o.operator+" ",o),this.eol(),this.pushSegment(this.context.getIndent(),o),this.process(o.right,{hasLogicalIndentActive:!0}),a.hasLogicalIndentActive||this.context.decIndent();return}this.process(o.left,{hasLogicalIndentActive:a.hasLogicalIndentActive}),this.pushSegment(" "+o.operator+" ",o),this.process(o.right,{hasLogicalIndentActive:a.hasLogicalIndentActive})},BinaryExpression:function(o,a){if(o.operator==="|"){this.pushSegment("bitOr(",o),this.process(o.left),this.pushSegment(", ",o),this.process(o.right),this.pushSegment(")",o);return}else if(o.operator==="&"){this.pushSegment("bitAnd(",o),this.process(o.left),this.pushSegment(", ",o),this.process(o.right),this.pushSegment(")",o);return}else if(o.operator==="<<"||o.operator===">>"||o.operator===">>>")throw new Error("Operators in binary expression are not supported");this.process(o.left),this.pushSegment(" "+o.operator+" ",o),this.process(o.right)},BinaryNegatedExpression:function(o,a){this.pushSegment(o.operator,o),this.process(o.argument)},ComparisonGroupExpression:function(o,a){this.process(o.expressions[0]);for(let u=0;u<o.operators.length;u++)this.pushSegment(" "+o.operators[u]+" ",o),this.process(o.expressions[u+1])},Chunk:function(o,a){this.context.pushStack(o),this.context.buildBlock(o),this.context.popStack()}};let{keepParentheses:n=!1,indentation:r=AC.IndentationType.Tab,indentationSpaces:i=2,isDevMode:s=!1}=e.buildOptions;this.context=new AC.BeautifyContext(this,{keepParentheses:n,indentation:r,indentationSpaces:i,isDevMode:s})}createLine(){return{segments:[],comments:[]}}pushSegment(e,n){this._activeLine.segments.push(e),n!=null&&this.pushComment(n.start.line)}pushComment(e){let n=this.context.getCurrentChunk(),r=this.context.getChunkContext(n),i=r.commentBuckets.get(e);i&&(this._activeLine.comments.push(...i),r.commentBuckets.delete(e))}transform(e,n){return this.reset(),this._currentDependency=n,this.process(e),this._lines.map(r=>{let i=r.segments.join(""),s=i.trim();if(r.comments.length===0)return s.length===0?"":i;let o=r.comments.filter(l=>l.isBefore),a=o.map(kr.commentToText).join(""),u=r.comments.filter(l=>!l.isBefore),c=u.map(kr.commentToText).join("");return s.length===0&&o.length===0&&u.length===0?"":(s.length>0&&o.length>0&&(i=" "+i),s.length>0&&u.length>0&&(i=i+" "),a+i+c)}).join(`
116
- `)}generateOptimizations(){return[]}};Hd.BeautifyFactory=mv});var _v=m(zd=>{"use strict";Object.defineProperty(zd,"__esModule",{value:!0});zd.DefaultFactory=void 0;var H$=require("path"),Gd=oa(),G$=Fu(),bv=class extends G$.Factory{constructor(){super(...arguments),this.handlers={ParenthesisExpression:function(e,n){this.pushSegment("("),this.process(e.expression),this.pushSegment(")")},Comment:function(e,n){if(e.isMultiline){this.pushSegment(e.value.split(`
113
+ `)}else if(i instanceof Ee.ASTComment)return i.value;return n}resolveFunctionStatement(e){let n=Te.SignatureDefinitionFunction.parse({type:Te.SignatureDefinitionBaseType.Function,description:this.createFunctionDescription(e),arguments:e.parameters.map(r=>{if(r.type===Ee.ASTType.Identifier)return{label:r.name??"unknown",type:Te.SignatureDefinitionBaseType.Any};let i=r;return{label:i.variable?.name??"unknown",types:Array.from(this.resolveTypeWithDefault(i.init).types)}}),returns:["any"]});return this.factory(we.CompletionItemKind.Function).addType(Te.SignatureDefinitionBaseType.Function).addSignatureType((0,jF.enrichWithMetaInformation)(n)).setLine(e.start.line)}resolveParenthesisExpression(e){return this.resolveTypeWithDefault(e.expression)}resolveBinaryExpression(e){let n=this.factory(we.CompletionItemKind.Expression).setLabel("Binary Expr").setLine(e.start.line),r=this.resolveTypeWithDefault(e.left),i=this.resolveTypeWithDefault(e.right);return n.extend(r),n.extend(i),n}resolveLogicalExpression(e){return this.factory(we.CompletionItemKind.Expression).setLabel("Logical Expr").addType(Te.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveComparisonGroupExpression(e){return this.factory(we.CompletionItemKind.Expression).setLabel("Comparison Group Expr").addType(Te.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveIsaExpression(e){return this.factory(we.CompletionItemKind.Expression).setLabel("Isa Expr").addType(Te.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveCallStatement(e){let n=this.resolveNamespace(e);return n===null?this.factory(we.CompletionItemKind.Variable).addType(Te.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveCallExpression(e){let n=this.resolveNamespace(e);return n===null?this.factory(we.CompletionItemKind.Variable).addType(Te.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveUnaryExpression(e){let n=this.resolveNamespace(e);return n===null?this.factory(we.CompletionItemKind.Variable).addType(Te.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveMapConstructorExpression(e){let n=this.factory(we.CompletionItemKind.MapConstructor).addType(Te.SignatureDefinitionBaseType.Map);for(let r=0;r<e.fields.length;r++){let i=e.fields[r],s=this.resolveTypeWithDefault(i.value).setLine(i.start.line);if(i.key.type===Ee.ASTType.StringLiteral){let o=i.key.value.toString();n.setProperty(o,s),n.values.get(`${eC.PropertyType.Identifier}:${o}`)?.definitions.push({source:this._document.source,node:i})}else{let o=this.resolveTypeWithDefault(i.key).setLine(i.start.line);n.setProperty(o,s)}}return this.createCustomTypeFromMap(e,n),n.setLabel("{}").setLine(e.start.line)}resolveListConstructorExpression(e){let n=this.factory(we.CompletionItemKind.ListConstructor).addType(Te.SignatureDefinitionBaseType.List);for(let r=0;r<e.fields.length;r++){let i=e.fields[r],s=this.factory(we.CompletionItemKind.Variable).addType(Te.SignatureDefinitionBaseType.Number).setLine(i.start.line),o=this.resolveTypeWithDefault(i.value).setLine(i.start.line);n.setProperty(s,o)}return n.setLabel("[]").setLine(e.start.line)}resolveSliceExpression(e){let n=this.resolveNamespace(e);return n===null?this.factory(we.CompletionItemKind.Variable).addType(Te.SignatureDefinitionBaseType.Any).setLine(e.start.line):n.setLine(e.start.line)}resolveIndexExpression(e,n=!1){let r=this.resolveNamespace(e,n);return r===null?this.factory(we.CompletionItemKind.Variable).addType(Te.SignatureDefinitionBaseType.Any).setLine(e.start.line):r}resolveMemberExpression(e,n=!1){let r=this.resolveNamespace(e,n);return r===null?this.factory(we.CompletionItemKind.Property).addType(Te.SignatureDefinitionBaseType.Any).setLabel(e.identifier.name).setLine(e.start.line):r}resolveIdentifier(e,n=!1){let r=this.resolveNamespace(e,n);return r===null?this.factory(we.CompletionItemKind.Property).addType(Te.SignatureDefinitionBaseType.Any).setLabel(e.name).setLine(e.start.line):r}resolveType(e,n=!1){if(e==null)return null;switch(e.type){case Ee.ASTType.ParenthesisExpression:return this.resolveParenthesisExpression(e);case Ee.ASTType.CallStatement:return this.resolveCallStatement(e);case Ee.ASTType.CallExpression:return this.resolveCallExpression(e);case Ee.ASTType.BinaryExpression:return this.resolveBinaryExpression(e);case Ee.ASTType.LogicalExpression:return this.resolveLogicalExpression(e);case Ee.ASTType.IsaExpression:return this.resolveIsaExpression(e);case Ee.ASTType.ComparisonGroupExpression:return this.resolveComparisonGroupExpression(e);case Ee.ASTType.FunctionDeclaration:return this.resolveFunctionStatement(e);case Ee.ASTType.SliceExpression:return this.resolveSliceExpression(e);case Ee.ASTType.IndexExpression:return this.resolveIndexExpression(e,n);case Ee.ASTType.MemberExpression:return this.resolveMemberExpression(e,n);case Ee.ASTType.Identifier:return this.resolveIdentifier(e,n);case Ee.ASTType.MapConstructorExpression:return this.resolveMapConstructorExpression(e);case Ee.ASTType.ListConstructorExpression:return this.resolveListConstructorExpression(e);case Ee.ASTType.NegationExpression:case Ee.ASTType.BinaryNegatedExpression:case Ee.ASTType.UnaryExpression:return this.resolveUnaryExpression(e);case Ee.ASTType.NilLiteral:return this.factory(we.CompletionItemKind.Literal).addType("null").setLabel("null").setLine(e.start.line);case Ee.ASTType.StringLiteral:{let r=e.value.toString();return this.factory(we.CompletionItemKind.Literal).addType(Te.SignatureDefinitionBaseType.String).setLabel(`"${r.length>20?r.substr(0,20)+"...":r}"`).setLine(e.start.line)}case Ee.ASTType.NumericLiteral:case Ee.ASTType.BooleanLiteral:{let r=e.value.toString();return this.factory(we.CompletionItemKind.Literal).addType(Te.SignatureDefinitionBaseType.Number).setLabel(r).setLine(e.start.line)}case Fu.ASTType.FeatureFileExpression:return this.factory(we.CompletionItemKind.Expression).addType(Te.SignatureDefinitionBaseType.String).setLabel("File Expr").setLine(e.start.line);case Fu.ASTType.FeatureLineExpression:return this.factory(we.CompletionItemKind.Expression).addType(Te.SignatureDefinitionBaseType.Number).setLabel("Line Expr").setLine(e.start.line);case Fu.ASTType.FeatureEnvarExpression:return this.factory(we.CompletionItemKind.Expression).addType(Te.SignatureDefinitionBaseType.String).setLabel("Envar Expr").setLine(e.start.line);case Fu.ASTType.FeatureInjectExpression:return this.factory(we.CompletionItemKind.Expression).addType(Te.SignatureDefinitionBaseType.String).setLabel("Inject Expr").setLine(e.start.line);default:return null}}resolveTypeWithDefault(e=null,n=!1){let r=this.resolveType(e,n);if(r==null){let i=this.factory(we.CompletionItemKind.Variable).addType(Te.SignatureDefinitionBaseType.Any);return e!=null&&i.setLine(e.start.line),i}return r}resolveChain(e,n=!1,r=!1){if(e.length===0)return null;let i=new Pd(this,e,n,r),s=null,o=i.next();for(;!o.done;)s=o.value,o=i.next();return s}setEntityInPath(e,n,r){let i=e;for(let s=0;s<n.length-1;s++){let o=n[s],a=i.resolveProperty(o);if(a==null){let u=this.factory(we.CompletionItemKind.Property).addType(Te.SignatureDefinitionBaseType.Map).setLabel(o);i.setProperty(o,u),a=u}i=a}return i.setProperty(n[n.length-1],r)}getEntityInPath(e,n){let r=e;for(let i=0;i<n.length;i++){let s=n[i],o=r.resolveProperty(s);if(o==null)return null;r=o}return r}resolveNamespace(e,n=!1){let r=(0,nC.createResolveChain)(e);return this.resolveChain(r,n)}defineProperty(e,n,r){let i=e.setProperty(n,r);return this._lastModifiedProperty=e.resolveProperty(n,!0),i}defineNamespace(e,n){let r=(0,nC.createResolveChain)(e),i=r.pop();if(this._lastModifiedProperty=null,r.length>0){let o=this.resolveChain(r,!1,!0);if(o===null)return!1;if((0,Bs.isResolveChainItemWithMember)(i))return this.defineProperty(o,i.getter.name,n);if((0,Bs.isResolveChainItemWithIndex)(i)){if((0,iC.isValidIdentifierLiteral)(i.getter))return this.defineProperty(o,i.getter.value.toString(),n);{let a=this.resolveTypeWithDefault(i.getter);return this.defineProperty(o,a,n)}}return!1}let s=this._scope;return(0,Bs.isResolveChainItemWithIdentifier)(i)?this.defineProperty(s,i.getter.name,n):!1}addDefinition(e,n){this._lastModifiedProperty?.definitions.push({source:this._document.source,node:e});let r=(0,tC.createExpressionId)(n),i=this._definitions;r.startsWith("globals.")?(i=this._document.getRootScopeContext().aggregator.definitions,r=r.slice(8)):r.startsWith("locals.")?(i=this._definitions,r=r.slice(7)):r.startsWith("outer.")&&(i=this.parent.definitions,r=r.slice(6));let s=i.get(r);s?s.push({source:this._document.source,node:e}):i.set(r,[{source:this._document.source,node:e}])}resolveAvailableAssignmentsWithQuery(e){let n=[];return new Set([this,this._parent,this._document.getRootScopeContext().aggregator]).forEach(i=>{let s=i.definitions;s.forEach((o,a)=>{if(a.includes(e)){let u=s.get(a);(0,rC.merge)(n,u)}})}),n}resolveAvailableAssignments(e){let n=(0,tC.createExpressionId)(e),r=this;n.startsWith("globals.")?(r=this._document.getRootScopeContext().aggregator,n=n.slice(8)):n.startsWith("locals.")?(r=this,n=n.slice(7)):n.startsWith("outer.")&&(r=this.parent,n=n.slice(6));let i=[];return new Set([r,r._parent,r._document.getRootScopeContext().aggregator]).forEach(o=>{if(o==null)return;let a=o.resolveNamespace(e,!0);a!=null&&(0,rC.merge)(i,a.definitions)}),i}analyzeAssignmentDefinition(e){let n=this.resolveType(e.init)?.copy({source:this._document.source}).setLine(e.start.line)??this.factory(we.CompletionItemKind.Variable).addType(Te.SignatureDefinitionBaseType.Any).setLine(e.start.line);this.defineNamespace(e.variable,n),this.addDefinition(e,e.variable)}analyzeForDefinition(e){let n=this.resolveType(e.iterator)?.copy({source:this._document.source}).setLine(e.start.line)??this.factory(we.CompletionItemKind.Variable).addType(Te.SignatureDefinitionBaseType.Any).setLine(e.start.line),r=this.factory(we.CompletionItemKind.Variable).setLine(e.start.line);if(n.types.has(Te.SignatureDefinitionBaseType.List)){let o=n.values.get(`${eC.PropertyType.Type}:number`);o!=null&&r.extend(o)}if(n.types.has(Te.SignatureDefinitionBaseType.String)&&r.addType(Te.SignatureDefinitionBaseType.String),n.types.has(Te.SignatureDefinitionBaseType.Map)){let o=this.factory(we.CompletionItemKind.Variable).addTypes(n.getPropertyTypes()).setLine(e.start.line),a=this.factory(we.CompletionItemKind.Property).addTypes(n.getValueTypes()).setLine(e.start.line);r.addType(Te.SignatureDefinitionBaseType.Map),r.setProperty("key",o),r.setProperty("value",a)}r.types.size===0&&r.addType(Te.SignatureDefinitionBaseType.Any),this.defineNamespace(e.variable,r),this.addDefinition(e,e.variable);let i=this.factory(we.CompletionItemKind.Variable).addType(Te.SignatureDefinitionBaseType.Number).setLine(e.start.line),s=new Ee.ASTIdentifier({name:`__${e.variable.name}_idx`,kind:Ee.ASTIdentifierKind.Variable,range:e.range,start:e.start,end:e.end});this.defineNamespace(s,i),this.addDefinition(e,s)}analyzeImportDefinition(e){let n=e.name,r=this.scope.resolveProperty(n.name,!0);if(r!=null){this._lastModifiedProperty=r,this.addDefinition(e,e.name);return}let i=this.factory(we.CompletionItemKind.Variable).addType(Te.SignatureDefinitionBaseType.Any).setLine(e.start.line);this.defineNamespace(e.name,i),this.addDefinition(e,e.name)}analyze(){for(let e=0;e<this._root.definitions.length;e++){let n=this._root.definitions[e];switch(n.type){case Ee.ASTType.AssignmentStatement:{this.analyzeAssignmentDefinition(n);break}case Ee.ASTType.ForGenericStatement:{this.analyzeForDefinition(n);break}case Fu.ASTType.FeatureImportExpression:{this.analyzeImportDefinition(n);break}}}}extend(e){e.definitions.forEach((n,r)=>{let i=this.definitions.get(r);i?(0,FF.mergeUnique)(i,n):this.definitions.set(r,n)})}};Xo.Aggregator=tv});var iv=m(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});Dd.Document=void 0;var vi=jn(),WF=ke(),sC=Ls(),UF=ev(),oC=nv(),aC=zo(),uC=I_(),rv=class t{get source(){return this._source}get root(){return this._root}get container(){return this._container}get intrinsics(){return this._intrinscis}get globals(){return this._globals}get api(){return this._api}constructor(e){this._source=e.source,this._root=e.root,this._container=e.container,this._scopeMapping=e.scopeMapping??new WeakMap,this._intrinscis=e.intrinsics??this.createIntrinscis(),this._api=e.api??this.initApi(),this._globals=e.globals??this.initGlobals()}createIntrinscis(){return{map:this._container.primitives.get(vi.SignatureDefinitionBaseType.Map),funcRef:this._container.primitives.get(vi.SignatureDefinitionBaseType.Function),number:this._container.primitives.get(vi.SignatureDefinitionBaseType.Number),string:this._container.primitives.get(vi.SignatureDefinitionBaseType.String),list:this._container.primitives.get(vi.SignatureDefinitionBaseType.List)}}initApi(){let e=this._container.primitives.get(vi.SignatureDefinitionBaseType.General);return e.resolveProperty("map",!0).setReturnEntity(this._intrinscis.map),e.resolveProperty("funcRef",!0).setReturnEntity(this._intrinscis.funcRef),e.resolveProperty("number",!0).setReturnEntity(this._intrinscis.number),e.resolveProperty("string",!0).setReturnEntity(this._intrinscis.string),e.resolveProperty("list",!0).setReturnEntity(this._intrinscis.list),e}initGlobals(){return new aC.Entity({source:this._source,kind:sC.CompletionItemKind.Constant,container:this._container,label:"globals"}).addType(vi.SignatureDefinitionBaseType.Map)}analyzeScope(e){let n=this._scopeMapping.get(e.scope),r=new uC.Scope({source:this._source,container:this._container,parent:n?.scope,globals:this._globals}),i=new oC.Aggregator({scope:r,root:e,document:this,parent:n?.aggregator});this._scopeMapping.set(e,{scope:r,aggregator:i});let s=e.assignment instanceof WF.ASTAssignmentStatement?this.resolveNamespace(e.assignment.variable,!0):null;if(s!==null){let o=s?.context;o!=null&&o.types.has(vi.SignatureDefinitionBaseType.Map)&&o!==this._globals&&r.setContext(o)}if(i.analyze(),s!==null){let o=s.signatureDefinitions.last();if(o!=null){let a=o.getArguments();for(let u=0;u<a.length;u++){let c=a[u],l=r.resolveProperty(c.getLabel(),!0),h=c.getTypes();l===null?r.setProperty(c.getLabel(),new aC.Entity({source:this._source,kind:sC.CompletionItemKind.Variable,container:this._container}).addTypesWithMeta(h)):(l.types.delete(vi.SignatureDefinitionBaseType.Any),l.addTypesWithMeta(h))}}}}analyze(){let e=new uC.Scope({source:this._source,container:this._container,globals:this._globals,locals:this._globals}),n=new oC.Aggregator({scope:e,root:this._root,document:this});this._scopeMapping.set(this._root,{scope:e,aggregator:n}),n.analyze();for(let r=0;r<this._root.scopes.length;r++){let i=this._root.scopes[r];this.analyzeScope(i)}}getRootScopeContext(){return this._scopeMapping.get(this._root)}getAllScopeContexts(){return[this._root,...this._root.scopes].map(e=>this._scopeMapping.get(e))}getScopeContext(e){return this._scopeMapping.get(e)??null}getLastASTItemOfLine(e){let n=this._root.lines[e];return n&&n.length>0?n[n.length-1]:null}findASTItemInLine(e,n){let r=this._root.lines[e];if(r&&r.length>0){let i=r.find(s=>s.type===n);if(i)return i}return null}resolveAllAssignmentsWithQuery(e){let n=[],r=[this._root,...this._root.scopes];for(let i=0;i<r.length;i++){let o=this._scopeMapping.get(r[i]).aggregator.definitions;o.forEach((a,u)=>{if(u.includes(e)){let c=o.get(u);(0,UF.merge)(n,c)}})}return n}resolveAvailableAssignments(e){return this._scopeMapping.get(e.scope)?.aggregator.resolveAvailableAssignments(e)??[]}resolveType(e,n){return this._scopeMapping.get(e.scope)?.aggregator.resolveType(e,n)??null}resolveTypeWithDefault(e,n){return this._scopeMapping.get(e.scope)?.aggregator.resolveTypeWithDefault(e,n)}resolveNamespace(e,n=!1){return this._scopeMapping.get(e.scope)?.aggregator.resolveNamespace(e,n)??null}merge(...e){let n=new t({source:this._source,root:this._root,container:this._container.copy()});for(let r=0;r<e.length;r++){let i=e[r];n._globals.extend(i._globals,!0,!0),n._intrinscis.map.extend(i._intrinscis.map,!0,!0),n._intrinscis.funcRef.extend(i._intrinscis.funcRef,!0,!0),n._intrinscis.number.extend(i._intrinscis.number,!0,!0),n._intrinscis.string.extend(i._intrinscis.string,!0,!0),n._intrinscis.list.extend(i._intrinscis.list,!0,!0),n._container.mergeCustomTypes(i._container)}n.analyze();for(let r=0;r<e.length;r++){let i=e[r];n.getRootScopeContext().aggregator.extend(i.getRootScopeContext().aggregator)}return n}};Dd.Document=rv});var uv=m(Id=>{"use strict";Object.defineProperty(Id,"__esModule",{value:!0});Id.ContainerProxy=void 0;var Ar=jn(),sv=Ns(),Si=zo(),cC=Ls(),lC=xu(),ov=bd(),av=class t{get primitives(){return this._primitives}get types(){return this._types}constructor(e){this._container=e.container,this._primitives=e.primitives??this.createPrimitives(),this._types=e.types??this.createTypes(),this._customTypes=new Set}createPrimitives(){let e=new Map;return this._container.getPrimitives().forEach((n,r)=>{let i=new Si.Entity({source:"internal",kind:cC.CompletionItemKind.Internal,container:this,isAPI:r===Ar.SignatureDefinitionBaseType.General}).addType(Ar.SignatureDefinitionBaseType.Map).insertSignature(n);e.set(r,i)}),e}createTypes(){let e=new Map;return this._container.getTypes().forEach((n,r)=>{let i=new Si.Entity({source:"internal",kind:cC.CompletionItemKind.Internal,container:this}).addType(Ar.SignatureDefinitionBaseType.Map).insertSignature(n);e.set(r,i)}),e}setCustomType(e,n){this._types.has(e)||(this._types.set(e,n),this._customTypes.add(e))}mergeCustomTypes(e){e._customTypes.forEach(n=>{let r=e._types.get(n);r!=null&&this.setCustomType(n,r.copy({deepCopy:!0}))})}getTypeSignature(e){return this._primitives.get(e)??this._types.get(e)??null}searchDefinitionMatches(e,n){if(typeof e=="string")return this.searchDefinitionMatches([e],n);let r=e.includes(Ar.SignatureDefinitionBaseType.Any)?new Set(this._container.getAllVisibleTypes()):new Set(e),i=new Map;return r.forEach(s=>{let o=this.getTypeSignature(s);if(o===null)return;let a=(0,ov.lookupProperty)(sv.PropertyType.Identifier,o,n);a!==null&&i.set(s,a)}),i}getDefinition(e,n,r=!1){if(typeof e=="string")return this.getDefinition([e],n);let i=(0,ov.lookupProperty)(sv.PropertyType.Identifier,this._primitives.get(Ar.SignatureDefinitionBaseType.Any),n);if(e.includes(Ar.SignatureDefinitionBaseType.Any)&&i)return Si.Entity.resolveEntity(this,i,r);let s=this.searchDefinitionMatches(e,n);if(s.size===0)return null;if(s.size===1)return Si.Entity.resolveEntity(this,s.values().next().value,r);if(s.has(Ar.SignatureDefinitionBaseType.Any))return Si.Entity.resolveEntity(this,s.get(Ar.SignatureDefinitionBaseType.Any),r);if(i!==null)return Si.Entity.resolveEntity(this,i,r);let o=s.values().next().value,a=new Si.Entity({source:"internal",label:n,kind:o.kind,container:this});return s.forEach(u=>{let c=Si.Entity.resolveEntity(this,u,r);a.extend(c,!0,!0)}),a}getGeneralDefinition(e,n=!1){let r=(0,ov.lookupProperty)(sv.PropertyType.Identifier,this._primitives.get(Ar.SignatureDefinitionBaseType.General),e);return r==null?null:Si.Entity.resolveEntity(this,r,n)}injectTypeIdentifiers(e,n){let r=this.getTypeSignature(n);if(r!=null&&((0,lC.injectIdentifers)(e,r),this._types.has(n))){let i=this._primitives.get(Ar.SignatureDefinitionBaseType.Map);(0,lC.injectIdentifers)(e,i)}}getAvailableIdentifier(e){let n=new Map;if(e===Ar.SignatureDefinitionBaseType.Any){let r=this._container.getAllVisibleTypes();for(let i=0;i<r.length;i++)this.injectTypeIdentifiers(n,r[i]);return n}return this.injectTypeIdentifiers(n,e),n}copy(){return new t({container:this._container})}};Id.ContainerProxy=av});var hC=m(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});Md.TypeManager=void 0;var HF=iv(),GF=uv(),cv=class{constructor(e){this._container=new GF.ContainerProxy({container:e.container}),this._types=new Map}analyze(e,n){let r=new HF.Document({source:e,container:this._container.copy(),root:n});try{r.analyze()}catch(i){console.error(i)}return this._types.set(e,r),r}get(e){return this._types.get(e)??null}};Md.TypeManager=cv});var Yo=m(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.TypeManager=ee.ContainerProxy=ee.Document=ee.Aggregator=ee.Scope=ee.Entity=ee.aggregateEntity=ee.lookupProperty=ee.isEligibleForProperties=ee.injectIdentifers=ee.isSignatureDefinitionFunction=ee.isResolveChainItemWithValue=ee.isResolveChainItemWithMember=ee.isResolveChainItemWithIndex=ee.isResolveChainItemWithIdentifier=ee.IsaPropertyPattern=ee.IdentifierPropertyPattern=ee.PropertyType=ee.CompletionItemKind=ee.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION=ee.ObjectSetIterator=ee.ObjectSet=ee.rotateBits=ee.getStringHashCode=ee.getHashCode=ee.createResolveChain=ee.enrichWithMetaInformation=ee.createExpressionId=ee.createExpressionHash=ee.isValidIdentifierLiteral=void 0;var zF=iu();Object.defineProperty(ee,"isValidIdentifierLiteral",{enumerable:!0,get:function(){return zF.isValidIdentifierLiteral}});var KF=yk();Object.defineProperty(ee,"createExpressionHash",{enumerable:!0,get:function(){return KF.createExpressionHash}});var VF=cb();Object.defineProperty(ee,"createExpressionId",{enumerable:!0,get:function(){return VF.createExpressionId}});var XF=b_();Object.defineProperty(ee,"enrichWithMetaInformation",{enumerable:!0,get:function(){return XF.enrichWithMetaInformation}});var YF=__();Object.defineProperty(ee,"createResolveChain",{enumerable:!0,get:function(){return YF.createResolveChain}});var lv=ub();Object.defineProperty(ee,"getHashCode",{enumerable:!0,get:function(){return lv.getHashCode}});Object.defineProperty(ee,"getStringHashCode",{enumerable:!0,get:function(){return lv.getStringHashCode}});Object.defineProperty(ee,"rotateBits",{enumerable:!0,get:function(){return lv.rotateBits}});var dC=T_();Object.defineProperty(ee,"ObjectSet",{enumerable:!0,get:function(){return dC.ObjectSet}});Object.defineProperty(ee,"ObjectSetIterator",{enumerable:!0,get:function(){return dC.ObjectSetIterator}});var JF=E_();Object.defineProperty(ee,"DEFAULT_CUSTOM_FUNCTION_DESCRIPTION",{enumerable:!0,get:function(){return JF.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION}});var QF=Ls();Object.defineProperty(ee,"CompletionItemKind",{enumerable:!0,get:function(){return QF.CompletionItemKind}});var hv=Ns();Object.defineProperty(ee,"PropertyType",{enumerable:!0,get:function(){return hv.PropertyType}});Object.defineProperty(ee,"IdentifierPropertyPattern",{enumerable:!0,get:function(){return hv.IdentifierPropertyPattern}});Object.defineProperty(ee,"IsaPropertyPattern",{enumerable:!0,get:function(){return hv.IsaPropertyPattern}});var Ld=k_();Object.defineProperty(ee,"isResolveChainItemWithIdentifier",{enumerable:!0,get:function(){return Ld.isResolveChainItemWithIdentifier}});Object.defineProperty(ee,"isResolveChainItemWithIndex",{enumerable:!0,get:function(){return Ld.isResolveChainItemWithIndex}});Object.defineProperty(ee,"isResolveChainItemWithMember",{enumerable:!0,get:function(){return Ld.isResolveChainItemWithMember}});Object.defineProperty(ee,"isResolveChainItemWithValue",{enumerable:!0,get:function(){return Ld.isResolveChainItemWithValue}});var ZF=A_();Object.defineProperty(ee,"isSignatureDefinitionFunction",{enumerable:!0,get:function(){return ZF.isSignatureDefinitionFunction}});var e$=xu();Object.defineProperty(ee,"injectIdentifers",{enumerable:!0,get:function(){return e$.injectIdentifers}});var t$=md();Object.defineProperty(ee,"isEligibleForProperties",{enumerable:!0,get:function(){return t$.isEligibleForProperties}});var n$=bd();Object.defineProperty(ee,"lookupProperty",{enumerable:!0,get:function(){return n$.lookupProperty}});var r$=C_();Object.defineProperty(ee,"aggregateEntity",{enumerable:!0,get:function(){return r$.aggregateEntity}});var i$=zo();Object.defineProperty(ee,"Entity",{enumerable:!0,get:function(){return i$.Entity}});var s$=I_();Object.defineProperty(ee,"Scope",{enumerable:!0,get:function(){return s$.Scope}});var o$=nv();Object.defineProperty(ee,"Aggregator",{enumerable:!0,get:function(){return o$.Aggregator}});var a$=iv();Object.defineProperty(ee,"Document",{enumerable:!0,get:function(){return a$.Document}});var u$=uv();Object.defineProperty(ee,"ContainerProxy",{enumerable:!0,get:function(){return u$.ContainerProxy}});var c$=hC();Object.defineProperty(ee,"TypeManager",{enumerable:!0,get:function(){return c$.TypeManager}})});var dv=m(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.getSymbolItemKind=Jo.getCompletionItemKind=void 0;var at=Yo(),l$={[at.CompletionItemKind.Constant]:21,[at.CompletionItemKind.Internal]:21,[at.CompletionItemKind.InternalFunction]:21,[at.CompletionItemKind.InternalProperty]:21,[at.CompletionItemKind.Property]:6,[at.CompletionItemKind.Variable]:6,[at.CompletionItemKind.Expression]:6,[at.CompletionItemKind.Function]:3,[at.CompletionItemKind.ListConstructor]:12,[at.CompletionItemKind.MapConstructor]:12,[at.CompletionItemKind.Literal]:12,[at.CompletionItemKind.Unknown]:12},h$=t=>l$[t]??6;Jo.getCompletionItemKind=h$;var d$={[at.CompletionItemKind.Constant]:14,[at.CompletionItemKind.Internal]:14,[at.CompletionItemKind.InternalFunction]:14,[at.CompletionItemKind.InternalProperty]:14,[at.CompletionItemKind.Variable]:13,[at.CompletionItemKind.Property]:13,[at.CompletionItemKind.Expression]:13,[at.CompletionItemKind.Function]:12,[at.CompletionItemKind.ListConstructor]:18,[at.CompletionItemKind.MapConstructor]:19,[at.CompletionItemKind.Literal]:13,[at.CompletionItemKind.Unknown]:13},f$=t=>d$[t]??13;Jo.getSymbolItemKind=f$});var fC=m(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});Nd.CompletionListBuilder=void 0;var p$=dv(),fv=class{constructor(){this.collection=new Map,this.default=[]}setDefault(e){this.default=e}addCollection(e){e!=null&&(this.collection=new Map([...this.collection,...e]))}build(){let e=[];for(let[n,r]of this.collection)e.push({label:n,kind:(0,p$.getCompletionItemKind)(r.kind)});return[...e,...this.default]}};Nd.CompletionListBuilder=fv});var jd=m(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.findEx=Qo.ScraperWalker=void 0;var g$=ke(),m$=function(t){return{ParenthesisExpression:(e,n)=>{t(e.expression,n)},AssignmentStatement:function(e,n){t(e.init,n),t(e.variable,n)},MemberExpression:function(e,n){t(e.base,n),t(e.identifier,n)},FunctionDeclaration:function(e,n){for(let r=0;r<e.parameters.length;r++)t(e.parameters[r],n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},MapConstructorExpression:function(e,n){for(let r=0;r<e.fields.length;r++)t(e.fields[r],n)},ReturnStatement:function(e,n){e.argument&&t(e.argument,n)},WhileStatement:function(e,n){t(e.condition,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},IndexExpression:function(e,n){t(e.base,n),t(e.index,n)},SliceExpression:function(e,n){t(e.base,n),t(e.left,n),t(e.right,n)},ListValue:function(e,n){t(e.value,n)},MapKeyString:function(e,n){t(e.key,n),t(e.value,n)},IfShortcutStatement:function(e,n){for(let r=0;r<e.clauses.length;r++)t(e.clauses[r],n)},IfShortcutClause:function(e,n){t(e.condition,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},ElseifShortcutClause:function(e,n){t(e.condition,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},ElseShortcutClause:function(e,n){for(let r=0;r<e.body.length;r++)t(e.body[r],n)},ForGenericStatement:function(e,n){t(e.variable,n),t(e.iterator,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},IfStatement:function(e,n){for(let r=0;r<e.clauses.length;r++)t(e.clauses[r],n)},IfClause:function(e,n){t(e.condition,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},ElseifClause:function(e,n){t(e.condition,n);for(let r=0;r<e.body.length;r++)t(e.body[r],n)},ElseClause:function(e,n){for(let r=0;r<e.body.length;r++)t(e.body[r],n)},NegationExpression:function(e,n){t(e.argument,n)},CallExpression:function(e,n){t(e.base,n);for(let r=0;r<e.arguments.length;r++)t(e.arguments[r],n)},CallStatement:function(e,n){t(e.expression,n)},ListConstructorExpression:function(e,n){for(let r=0;r<e.fields.length;r++)t(e.fields[r],n)},BinaryExpression:function(e,n){t(e.left,n),t(e.right,n)},BinaryNegatedExpression:function(e,n){t(e.argument,n)},IsaExpression:function(e,n){t(e.left,n),t(e.right,n)},LogicalExpression:function(e,n){t(e.left,n),t(e.right,n)},ComparisonGroupExpression:function(e,n){for(let r=0;r<e.expressions.length;r++)t(e.expressions[r],n)},UnaryExpression:function(e,n){t(e.argument,n)},Chunk:function(e,n){for(let r=0;r<e.body.length;r++)t(e.body[r],n)},InvalidCodeExpression:()=>{}}},qd=class{constructor(e,n={}){this.map=Object.assign(m$(this.visit.bind(this)),n),this.callback=e,this.state={exit:!1,skip:!1}}visit(e,n=0){if(e==null)return;if(e.type==null)throw console.error("Error ast type:",e),new Error("Unexpected as type");let r=this.callback(e,n);if(r!=null&&Object.assign(this.state,r),this.state.exit||this.state.skip){this.state.skip=!1;return}let i=this.map[e.type];i?.call(this,e,n+1)}};Qo.ScraperWalker=qd;function y$(t,e){let n=[];return new qd((i,s)=>{let o=t(i,s)||{};return o.valid&&i.type!==g$.ASTType.InvalidCodeExpression&&n.push(i),{exit:!!o.exit,skip:!!o.skip}}).visit(e),n}Qo.findEx=y$});var pv=m(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.lookupBase=mn.lookupIdentifier=mn.lookupScopes=mn.lookupRootScope=void 0;var wi=ke(),b$=t=>{let e=t;for(;e.scope;)e=e.scope;return e};mn.lookupRootScope=b$;var _$=t=>{if(!t.scope)return[t];let e=(0,mn.lookupRootScope)(t);return e===t.scope?[t,e]:[t,t.scope,e]};mn.lookupScopes=_$;var v$=t=>{switch(t.type){case wi.ASTType.CallStatement:return(0,mn.lookupIdentifier)(t.expression);case wi.ASTType.CallExpression:return(0,mn.lookupIdentifier)(t.base);case wi.ASTType.Identifier:return t;case wi.ASTType.MemberExpression:return(0,mn.lookupIdentifier)(t.identifier);case wi.ASTType.IndexExpression:return(0,mn.lookupIdentifier)(t.index);default:return null}};mn.lookupIdentifier=v$;var S$=(t=null)=>{switch(t?.type){case wi.ASTType.MemberExpression:return t.base;case wi.ASTType.IndexExpression:return t.base;case wi.ASTType.CallExpression:return t.base;case wi.ASTType.SliceExpression:return t.base;default:return null}};mn.lookupBase=S$});var ea=m(Jr=>{"use strict";var w$=Jr&&Jr.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),T$=Jr&&Jr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),E$=Jr&&Jr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&w$(e,t,n);return T$(e,t),e};Object.defineProperty(Jr,"__esModule",{value:!0});Jr.LookupHelper=void 0;var x$=jn(),pC=ke(),Zo=Yo(),k$=E$(jd()),A$=pv(),gv=class{constructor(e,n){this.document=e,this.context=n,this.mergedTypeMap=null}async getTypeMap(){return this.mergedTypeMap==null&&(this.mergedTypeMap=await this.context.documentMerger.build(this.document,this.context)),this.mergedTypeMap}async findAllAssignmentsOfIdentifier(e,n){let r=await this.getTypeMap();if(r==null)return[];let i=r.getScopeContext(n);return i==null?[]:i.aggregator.resolveAvailableAssignmentsWithQuery(e)}async findAllAssignmentsOfItem(e,n){let r=await this.getTypeMap();if(r==null)return[];let i=r.getScopeContext(n);return i==null?[]:i.aggregator.resolveAvailableAssignments(e)}async findAllAvailableIdentifierInRoot(){let e=await this.getTypeMap();return e==null?new Map:e.getRootScopeContext().scope.getAvailableIdentifier()}async findAllAvailableIdentifier(e){let n=await this.getTypeMap();if(n==null)return new Map;let r=n.getScopeContext(e);return r==null?new Map:r.scope.getAvailableIdentifier()}async findAllAvailableIdentifierRelatedToPosition(e){let n=await this.getTypeMap(),r=new Map;if(n==null)return r;for(let a of n.container.getAvailableIdentifier(x$.SignatureDefinitionBaseType.General))r.set(...a);let i=n.getScopeContext(e.scope);if(i==null)return r;i.scope.isSelfAvailable()&&r.set("self",{kind:Zo.CompletionItemKind.Constant,line:-1}),i.scope.isSuperAvailable()&&r.set("super",{kind:Zo.CompletionItemKind.Constant,line:-1});let s=new Map;(0,Zo.injectIdentifers)(s,i.scope);let o=Array.from(s.entries()).map(([a,u])=>({identifier:a,...u})).sort((a,u)=>a.line-u.line);for(let a=0;a<o.length;a++){let u=o[a];if(u.line>=e.end.line)break;r.set(u.identifier,{kind:u.kind,line:u.line})}return i.scope.locals!==i.scope.globals&&(0,Zo.injectIdentifers)(r,i.scope.globals),i.scope.outer&&(0,Zo.injectIdentifers)(r,i.scope.outer),r}lookupAST(e){let n=this,i=this.context.documentManager.get(n.document).document.lines[e.line+1];if(!i)return null;for(let s=0;s<i.length;s++){let o=i[s],a=k$.findEx((c,l)=>{let h=c.start.line-1,d=c.start.character-1,g=c.end.line-1,y=c.end.character-1;return h>e.line?{exit:!0}:h<g?{valid:e.line>h&&e.line<g||e.line===h&&d<=e.character||e.line===g&&y>=e.character}:{valid:h<=e.line&&d<=e.character&&g>=e.line&&y>=e.character}},o),u=a.pop();if(u)return{closest:u,outer:a}}return null}async lookupBasePath(e){let n=await this.getTypeMap();if(n===null)return null;let r=(0,A$.lookupBase)(e);return r?n.resolveNamespace(r):null}async lookupTypeInfo({closest:e,outer:n}){let r=await this.getTypeMap();if(r===null)return null;let i=n.length>0?n[n.length-1]:void 0;return i?.type===pC.ASTType.MemberExpression&&e===i.identifier||i?.type===pC.ASTType.IndexExpression&&e===i.index&&(0,Zo.isValidIdentifierLiteral)(e)?r.resolveType(i,!0):r.resolveType(e,!0)}lookupType(e){let n=this,r=n.lookupAST(e);return r?n.lookupTypeInfo(r):null}};Jr.LookupHelper=gv});var gC=m(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});Fd.AVAILABLE_CONSTANTS=void 0;Fd.AVAILABLE_CONSTANTS=["true","false","null","params","globals","locals","outer"].map(t=>({label:t,kind:21}))});var mC=m($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});$d.AVAILABLE_KEYWORDS=void 0;var ta=Yr(),un=ke();$d.AVAILABLE_KEYWORDS=[un.Keyword.If,un.Keyword.In,un.Keyword.Or,un.Keyword.And,un.Keyword.Isa,un.Keyword.For,un.Keyword.New,un.Keyword.Not,un.Keyword.End,un.Keyword.Then,un.Keyword.Else,un.Keyword.Break,un.Keyword.While,un.Keyword.Return,un.Keyword.Function,un.Keyword.Continue,ta.GreybelKeyword.Envar,ta.GreybelKeyword.Import,ta.GreybelKeyword.Include,ta.GreybelKeyword.Debugger,ta.GreybelKeyword.Line,ta.GreybelKeyword.File].map(t=>({label:t,kind:14}))});var yC=m(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});Bd.AVAILABLE_OPERATORS=void 0;var $u=Vo(),Ut=ke();Bd.AVAILABLE_OPERATORS=[Ut.Operator.Plus,Ut.Operator.Asterik,Ut.Operator.Minus,Ut.Operator.Slash,Ut.Operator.Power,Ut.Operator.Modulo,Ut.Operator.LessThan,Ut.Operator.GreaterThan,Ut.Operator.LessThanOrEqual,Ut.Operator.GreaterThanOrEqual,Ut.Operator.NotEqual,Ut.Operator.Equal,Ut.Operator.AddShorthand,Ut.Operator.SubtractShorthand,Ut.Operator.MultiplyShorthand,Ut.Operator.DivideShorthand,$u.Operator.BitwiseAnd,$u.Operator.BitwiseOr,$u.Operator.LeftShift,$u.Operator.RightShift,$u.Operator.UnsignedRightShift,Ut.Operator.Assign,Ut.Operator.Reference].map(t=>({label:t,kind:24}))});var _C=m(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.activate=ar.getDefaultCompletionList=ar.getPropertyCompletionList=void 0;var bC=ke(),C$=fC(),O$=ea(),R$=gC(),P$=mC(),D$=yC(),I$=async(t,e)=>{let n=await t.lookupBasePath(e);return n===null?null:n.getAvailableIdentifier()};ar.getPropertyCompletionList=I$;var M$=()=>[...P$.AVAILABLE_KEYWORDS,...D$.AVAILABLE_OPERATORS,...R$.AVAILABLE_CONSTANTS];ar.getDefaultCompletionList=M$;function L$(t){t.connection.onCompletion(async e=>{if(!t.getConfiguration().autocomplete)return;let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=await t.documentManager.getLatest(n),i=new O$.LookupHelper(r.textDocument,t),s=i.lookupAST(e.position),o=new C$.CompletionListBuilder;if(s){let{closest:a}=s;a instanceof bC.ASTMemberExpression?o.addCollection(await(0,ar.getPropertyCompletionList)(i,a)):a instanceof bC.ASTIndexExpression?o.addCollection(await(0,ar.getPropertyCompletionList)(i,a)):(o.setDefault((0,ar.getDefaultCompletionList)()),o.addCollection(await i.findAllAvailableIdentifierRelatedToPosition(s.closest)))}else o.setDefault((0,ar.getDefaultCompletionList)()),o.addCollection(await i.findAllAvailableIdentifierInRoot());return o.build()}),t.connection.onCompletionResolve(e=>e)}ar.activate=L$});var SC=m((FK,vC)=>{"use strict";vC.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var mv=m(($K,TC)=>{var Bu=SC(),wC={};for(let t of Object.keys(Bu))wC[Bu[t]]=t;var re={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};TC.exports=re;for(let t of Object.keys(re)){if(!("channels"in re[t]))throw new Error("missing channels property: "+t);if(!("labels"in re[t]))throw new Error("missing channel labels property: "+t);if(re[t].labels.length!==re[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:n}=re[t];delete re[t].channels,delete re[t].labels,Object.defineProperty(re[t],"channels",{value:e}),Object.defineProperty(re[t],"labels",{value:n})}re.rgb.hsl=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(e,n,r),s=Math.max(e,n,r),o=s-i,a,u;s===i?a=0:e===s?a=(n-r)/o:n===s?a=2+(r-e)/o:r===s&&(a=4+(e-n)/o),a=Math.min(a*60,360),a<0&&(a+=360);let c=(i+s)/2;return s===i?u=0:c<=.5?u=o/(s+i):u=o/(2-s-i),[a,u*100,c*100]};re.rgb.hsv=function(t){let e,n,r,i,s,o=t[0]/255,a=t[1]/255,u=t[2]/255,c=Math.max(o,a,u),l=c-Math.min(o,a,u),h=function(d){return(c-d)/6/l+1/2};return l===0?(i=0,s=0):(s=l/c,e=h(o),n=h(a),r=h(u),o===c?i=r-n:a===c?i=1/3+e-r:u===c&&(i=2/3+n-e),i<0?i+=1:i>1&&(i-=1)),[i*360,s*100,c*100]};re.rgb.hwb=function(t){let e=t[0],n=t[1],r=t[2],i=re.rgb.hsl(t)[0],s=1/255*Math.min(e,Math.min(n,r));return r=1-1/255*Math.max(e,Math.max(n,r)),[i,s*100,r*100]};re.rgb.cmyk=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(1-e,1-n,1-r),s=(1-e-i)/(1-i)||0,o=(1-n-i)/(1-i)||0,a=(1-r-i)/(1-i)||0;return[s*100,o*100,a*100,i*100]};function N$(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}re.rgb.keyword=function(t){let e=wC[t];if(e)return e;let n=1/0,r;for(let i of Object.keys(Bu)){let s=Bu[i],o=N$(t,s);o<n&&(n=o,r=i)}return r};re.keyword.rgb=function(t){return Bu[t]};re.rgb.xyz=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;let i=e*.4124+n*.3576+r*.1805,s=e*.2126+n*.7152+r*.0722,o=e*.0193+n*.1192+r*.9505;return[i*100,s*100,o*100]};re.rgb.lab=function(t){let e=re.rgb.xyz(t),n=e[0],r=e[1],i=e[2];n/=95.047,r/=100,i/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let s=116*r-16,o=500*(n-r),a=200*(r-i);return[s,o,a]};re.hsl.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100,i,s,o;if(n===0)return o=r*255,[o,o,o];r<.5?i=r*(1+n):i=r+n-r*n;let a=2*r-i,u=[0,0,0];for(let c=0;c<3;c++)s=e+1/3*-(c-1),s<0&&s++,s>1&&s--,6*s<1?o=a+(i-a)*6*s:2*s<1?o=i:3*s<2?o=a+(i-a)*(2/3-s)*6:o=a,u[c]=o*255;return u};re.hsl.hsv=function(t){let e=t[0],n=t[1]/100,r=t[2]/100,i=n,s=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=s<=1?s:2-s;let o=(r+n)/2,a=r===0?2*i/(s+i):2*n/(r+n);return[e,a*100,o*100]};re.hsv.rgb=function(t){let e=t[0]/60,n=t[1]/100,r=t[2]/100,i=Math.floor(e)%6,s=e-Math.floor(e),o=255*r*(1-n),a=255*r*(1-n*s),u=255*r*(1-n*(1-s));switch(r*=255,i){case 0:return[r,u,o];case 1:return[a,r,o];case 2:return[o,r,u];case 3:return[o,a,r];case 4:return[u,o,r];case 5:return[r,o,a]}};re.hsv.hsl=function(t){let e=t[0],n=t[1]/100,r=t[2]/100,i=Math.max(r,.01),s,o;o=(2-n)*r;let a=(2-n)*i;return s=n*i,s/=a<=1?a:2-a,s=s||0,o/=2,[e,s*100,o*100]};re.hwb.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100,i=n+r,s;i>1&&(n/=i,r/=i);let o=Math.floor(6*e),a=1-r;s=6*e-o,o&1&&(s=1-s);let u=n+s*(a-n),c,l,h;switch(o){default:case 6:case 0:c=a,l=u,h=n;break;case 1:c=u,l=a,h=n;break;case 2:c=n,l=a,h=u;break;case 3:c=n,l=u,h=a;break;case 4:c=u,l=n,h=a;break;case 5:c=a,l=n,h=u;break}return[c*255,l*255,h*255]};re.cmyk.rgb=function(t){let e=t[0]/100,n=t[1]/100,r=t[2]/100,i=t[3]/100,s=1-Math.min(1,e*(1-i)+i),o=1-Math.min(1,n*(1-i)+i),a=1-Math.min(1,r*(1-i)+i);return[s*255,o*255,a*255]};re.xyz.rgb=function(t){let e=t[0]/100,n=t[1]/100,r=t[2]/100,i,s,o;return i=e*3.2406+n*-1.5372+r*-.4986,s=e*-.9689+n*1.8758+r*.0415,o=e*.0557+n*-.204+r*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),[i*255,s*255,o*255]};re.xyz.lab=function(t){let e=t[0],n=t[1],r=t[2];e/=95.047,n/=100,r/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;let i=116*n-16,s=500*(e-n),o=200*(n-r);return[i,s,o]};re.lab.xyz=function(t){let e=t[0],n=t[1],r=t[2],i,s,o;s=(e+16)/116,i=n/500+s,o=s-r/200;let a=s**3,u=i**3,c=o**3;return s=a>.008856?a:(s-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,i*=95.047,s*=100,o*=108.883,[i,s,o]};re.lab.lch=function(t){let e=t[0],n=t[1],r=t[2],i;i=Math.atan2(r,n)*360/2/Math.PI,i<0&&(i+=360);let o=Math.sqrt(n*n+r*r);return[e,o,i]};re.lch.lab=function(t){let e=t[0],n=t[1],i=t[2]/360*2*Math.PI,s=n*Math.cos(i),o=n*Math.sin(i);return[e,s,o]};re.rgb.ansi16=function(t,e=null){let[n,r,i]=t,s=e===null?re.rgb.hsv(t)[2]:e;if(s=Math.round(s/50),s===0)return 30;let o=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return s===2&&(o+=60),o};re.hsv.ansi16=function(t){return re.rgb.ansi16(re.hsv.rgb(t),t[2])};re.rgb.ansi256=function(t){let e=t[0],n=t[1],r=t[2];return e===n&&n===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)};re.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let n=(~~(t>50)+1)*.5,r=(e&1)*n*255,i=(e>>1&1)*n*255,s=(e>>2&1)*n*255;return[r,i,s]};re.ansi256.rgb=function(t){if(t>=232){let s=(t-232)*10+8;return[s,s,s]}t-=16;let e,n=Math.floor(t/36)/5*255,r=Math.floor((e=t%36)/6)/5*255,i=e%6/5*255;return[n,r,i]};re.rgb.hex=function(t){let n=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n};re.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let n=e[0];e[0].length===3&&(n=n.split("").map(a=>a+a).join(""));let r=parseInt(n,16),i=r>>16&255,s=r>>8&255,o=r&255;return[i,s,o]};re.rgb.hcg=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.max(Math.max(e,n),r),s=Math.min(Math.min(e,n),r),o=i-s,a,u;return o<1?a=s/(1-o):a=0,o<=0?u=0:i===e?u=(n-r)/o%6:i===n?u=2+(r-e)/o:u=4+(e-n)/o,u/=6,u%=1,[u*360,o*100,a*100]};re.hsl.hcg=function(t){let e=t[1]/100,n=t[2]/100,r=n<.5?2*e*n:2*e*(1-n),i=0;return r<1&&(i=(n-.5*r)/(1-r)),[t[0],r*100,i*100]};re.hsv.hcg=function(t){let e=t[1]/100,n=t[2]/100,r=e*n,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],r*100,i*100]};re.hcg.rgb=function(t){let e=t[0]/360,n=t[1]/100,r=t[2]/100;if(n===0)return[r*255,r*255,r*255];let i=[0,0,0],s=e%1*6,o=s%1,a=1-o,u=0;switch(Math.floor(s)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return u=(1-n)*r,[(n*i[0]+u)*255,(n*i[1]+u)*255,(n*i[2]+u)*255]};re.hcg.hsv=function(t){let e=t[1]/100,n=t[2]/100,r=e+n*(1-e),i=0;return r>0&&(i=e/r),[t[0],i*100,r*100]};re.hcg.hsl=function(t){let e=t[1]/100,r=t[2]/100*(1-e)+.5*e,i=0;return r>0&&r<.5?i=e/(2*r):r>=.5&&r<1&&(i=e/(2*(1-r))),[t[0],i*100,r*100]};re.hcg.hwb=function(t){let e=t[1]/100,n=t[2]/100,r=e+n*(1-e);return[t[0],(r-e)*100,(1-r)*100]};re.hwb.hcg=function(t){let e=t[1]/100,r=1-t[2]/100,i=r-e,s=0;return i<1&&(s=(r-i)/(1-i)),[t[0],i*100,s*100]};re.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};re.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};re.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};re.gray.hsl=function(t){return[0,0,t[0]]};re.gray.hsv=re.gray.hsl;re.gray.hwb=function(t){return[0,100,t[0]]};re.gray.cmyk=function(t){return[0,0,0,t[0]]};re.gray.lab=function(t){return[t[0],0,0]};re.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,r=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(r.length)+r};re.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var xC=m((BK,EC)=>{var Wd=mv();function q$(){let t={},e=Object.keys(Wd);for(let n=e.length,r=0;r<n;r++)t[e[r]]={distance:-1,parent:null};return t}function j$(t){let e=q$(),n=[t];for(e[t].distance=0;n.length;){let r=n.pop(),i=Object.keys(Wd[r]);for(let s=i.length,o=0;o<s;o++){let a=i[o],u=e[a];u.distance===-1&&(u.distance=e[r].distance+1,u.parent=r,n.unshift(a))}}return e}function F$(t,e){return function(n){return e(t(n))}}function $$(t,e){let n=[e[t].parent,t],r=Wd[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)n.unshift(e[i].parent),r=F$(Wd[e[i].parent][i],r),i=e[i].parent;return r.conversion=n,r}EC.exports=function(t){let e=j$(t),n={},r=Object.keys(e);for(let i=r.length,s=0;s<i;s++){let o=r[s];e[o].parent!==null&&(n[o]=$$(o,e))}return n}});var AC=m((WK,kC)=>{var yv=mv(),B$=xC(),na={},W$=Object.keys(yv);function U$(t){let e=function(...n){let r=n[0];return r==null?r:(r.length>1&&(n=r),t(n))};return"conversion"in t&&(e.conversion=t.conversion),e}function H$(t){let e=function(...n){let r=n[0];if(r==null)return r;r.length>1&&(n=r);let i=t(n);if(typeof i=="object")for(let s=i.length,o=0;o<s;o++)i[o]=Math.round(i[o]);return i};return"conversion"in t&&(e.conversion=t.conversion),e}W$.forEach(t=>{na[t]={},Object.defineProperty(na[t],"channels",{value:yv[t].channels}),Object.defineProperty(na[t],"labels",{value:yv[t].labels});let e=B$(t);Object.keys(e).forEach(r=>{let i=e[r];na[t][r]=H$(i),na[t][r].raw=U$(i)})});kC.exports=na});var OC=m(ra=>{"use strict";var G$=ra&&ra.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ra,"__esModule",{value:!0});ra.activate=void 0;var bv=G$(AC()),z$=ke(),CC;(function(t){t.Black="black",t.Blue="blue",t.Green="green",t.Orange="orange",t.Purple="purple",t.Red="red",t.White="white",t.Yellow="yellow"})(CC||(CC={}));var _v={black:"#000000",blue:"#0000FF",green:"#00FF00",orange:"#FF8800",purple:"#CC8899",red:"#FF0000",white:"#FFFFFF",yellow:"#FFFF00"},K$=()=>new RegExp(`(?:mark|color)=(${Object.keys(_v).join("|")}|(?:#[0-9a-f]{6}|#[0-9a-f]{3}))`,"ig"),V$=Object.prototype.hasOwnProperty;function X$(t){t.connection.onColorPresentation(e=>[{label:`#${bv.default.rgb.hex(e.color.red*255,e.color.green*255,e.color.blue*255)}`}]),t.connection.onDocumentColor(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let s=(await t.documentManager.getLatest(n)).document.literals.filter(u=>u.type===z$.ASTType.StringLiteral),o=[],a=({match:u,markup:c,value:l,astPosition:h,lineIndex:d})=>{let g=u.index+c.indexOf("=")+1,y=g+l.length,_=h.line-1+d,C=g,k=y;return d===0&&(C+=h.character,k+=h.character),{start:{line:_,character:C},end:{line:_,character:k}}};for(let u=0;u<s.length;u++){let c=s[u];if(!c.start)continue;let l=c.start,h=c.value.toString().split(`
114
+ `);for(let d=0;d<h.length;d++){let g=h[d],y=K$(),_;for(;_=y.exec(g);){let[C,k]=_,T=a({match:_,markup:C,value:k,astPosition:l,lineIndex:d});if(k.startsWith("#")){let[w,v,L]=bv.default.hex.rgb(k.slice(1));o.push({range:T,color:{red:w/255,green:v/255,blue:L/255,alpha:1}})}else if(V$.call(_v,k)){let[w,v,L]=bv.default.hex.rgb(_v[k].slice(1));o.push({range:T,color:{red:w/255,green:v/255,blue:L/255,alpha:1}})}else o.push({range:T,color:{red:0,green:0,blue:0,alpha:1}})}}}return o})}ra.activate=X$});var PC=m(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});Ud.activate=void 0;var RC=ke(),Y$=ea(),J$=t=>`${t.targetUri}:${t.targetRange.start.line}:${t.targetRange.start.character}-${t.targetRange.end.line}:${t.targetRange.end.character}`,Q$=t=>{let e=t.node,n,r;switch(e.type){case RC.ASTType.ForGenericStatement:{let i=e;n={line:i.variable.start.line-1,character:i.variable.start.character-1},r={line:i.variable.end.line-1,character:i.variable.end.character-1};break}default:n={line:e.start.line-1,character:e.start.character-1},r={line:e.end.line-1,character:e.end.character-1}}return{targetUri:t.source,targetRange:{start:n,end:r},targetSelectionRange:{start:n,end:r}}},Z$=async(t,e,n)=>{let r=await t.findAllAssignmentsOfItem(e,n),i=[],s=new Set;for(let o of r){let a=o.node;if(!a.start||!a.end)continue;let u=Q$(o),c=J$(u);s.has(c)||(s.add(c),i.push(u))}return i};function eB(t){t.connection.onDefinition(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=new Y$.LookupHelper(n,t),i=r.lookupAST(e.position);if(!i)return;let{outer:s,closest:o}=i,a=s.length>0?s[s.length-1]:void 0,u=o;return a&&a instanceof RC.ASTMemberExpression&&a.identifier===o&&(u=a),await Z$(r,u,u.scope)})}Ud.activate=eB});var DC=m(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});Hd.activate=void 0;async function tB(t,e){let n=await e.documentManager.getLatest(t);return n.errors.map(r=>{if(r?.range){let i=r.range;return{range:{start:{line:i.start.line-1,character:i.start.character-1},end:{line:i.end.line-1,character:i.end.character-1}},message:r.message,severity:1}}return{range:{start:n.document.start,end:n.document.end},message:r.message,severity:1}})}function nB(t){t.connection.languages.diagnostics.on(async e=>{if(!t.getConfiguration().diagnostic)return;let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=await tB(n,t);return r.length===0?{kind:"full",items:[]}:{kind:"full",items:r}})}Hd.activate=nB});var IC=m(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});Gd.getStringHashCode=void 0;Gd.getStringHashCode=function(){let t=new Map,e=n=>{let r,i;for(r=0,i=0;r<n.length;r++)i=Math.imul(31,i)+n.charCodeAt(r)|0;return i};return n=>{if(n.length===0)return 0;let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i}}()});var vv=m(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});Vd.createExpressionHash=void 0;var zd=ke(),MC=IC(),Kd=(t,e)=>t.$$hash=e,rB=t=>{var e;return(e=t.$$hash)!==null&&e!==void 0?e:null};function ia(t){let e=rB(t);if(e!==null)return e;let n=(0,MC.getStringHashCode)(t.type);switch(t.type){case zd.ASTType.ParenthesisExpression:return ia(t.expression);case zd.ASTType.MemberExpression:{let r=t;return n^=ia(r.base),n^=ia(r.identifier),Kd(t,n)}case zd.ASTType.IndexExpression:{let r=t;return n^=ia(r.base),n^=ia(r.index),Kd(t,n)}case zd.ASTType.Identifier:{let r=t;return n^=(0,MC.getStringHashCode)(r.name),Kd(t,n)}}return Kd(t,n)}function iB(t){return ia(t)}Vd.createExpressionHash=iB});var aa=m(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});oa.getLiteralValue=oa.getLiteralRawValue=void 0;var sa=ke(),sB=t=>{switch(t.type){case sa.ASTType.NilLiteral:return"null";case sa.ASTType.NumericLiteral:{let e=t;return`${e.negated?"-":""}${e.raw}`}case sa.ASTType.BooleanLiteral:{let e=t;return`${e.negated?"-":""}${e.raw}`}default:return t.raw.toString()}};oa.getLiteralRawValue=sB;var oB=t=>{switch(t.type){case sa.ASTType.NilLiteral:return"null";case sa.ASTType.NumericLiteral:{let e=t;return`${e.negated?"-":""}${e.value}`}case sa.ASTType.BooleanLiteral:{let e=t;return`${e.negated?"-":""}${e.value}`}default:return t.value.toString()}};oa.getLiteralValue=oB});var wv=m(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.BeautifyBodyIterator=Us.FILLER_TYPE=void 0;var Ws=ke();Us.FILLER_TYPE="FILLER";var Sv=class{constructor(e,n){this._base=e,this._items=n.sort((r,i)=>r.range[0]-i.range[0]),this._index=0,this._freeSpaceIndex=0,this._freeSpace=0,this._lastEndLine=0,this._checkedIndexes=new Set,this._previous=null}getBlockOpenerEndLine(e){switch(e.type){case Ws.ASTType.IfClause:return e.condition.end.line;case Ws.ASTType.WhileStatement:return e.condition.end.line;case Ws.ASTType.ForGenericStatement:return e.iterator.end.line;case Ws.ASTType.Chunk:return e.start.line-1}return e.start.line}getBlockCloseEndLine(e){switch(e.type){case Ws.ASTType.Chunk:return e.end.line+1}return e.end.line}getPreviousEndLine(e){if(e==null)return 0;if(e.type===Ws.ASTType.IfShortcutStatement){let n=e;return n.clauses[n.clauses.length-1].body[0].end.line}return e.end.line}getFreeSpaceItem(){let e={line:this._lastEndLine+this._freeSpaceIndex+1,character:0};return this._freeSpaceIndex++,this._freeSpace===this._freeSpaceIndex&&(this._lastEndLine=0,this._freeSpaceIndex=0,this._freeSpace=0),new Ws.ASTBase(Us.FILLER_TYPE,{start:e,end:e,range:[0,0],scope:this._base.scope})}next(){if(this._freeSpace>this._freeSpaceIndex)return{value:this.getFreeSpaceItem(),done:!1};if(this._index>=this._items.length){if(!this._checkedIndexes.has(this._items.length)){let n=this._previous?this.getPreviousEndLine(this._previous):this.getBlockOpenerEndLine(this._base),r=Math.max(this.getBlockCloseEndLine(this._base)-n-1,0);if(r>0)return this._checkedIndexes.add(this._items.length),this._lastEndLine=n,this._freeSpace=r,{value:this.getFreeSpaceItem(),done:!1}}return{value:null,done:!0}}let e=this._items[this._index];if(!this._checkedIndexes.has(this._index)){let n=this._previous?this.getPreviousEndLine(this._previous):this.getBlockOpenerEndLine(this._base),r=Math.max(e.start.line-n-1,0);if(r>0)return this._checkedIndexes.add(this._index),this._lastEndLine=n,this._freeSpace=r,{value:this.getFreeSpaceItem(),done:!1}}return this._index++,this._previous=e,{value:e,done:!1}}};Us.BeautifyBodyIterator=Sv});var Ev=m(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});Gs.BeautifyContext=Gs.IndentationType=void 0;var Hs=ke(),LC=wv(),NC;(function(t){t[t.Tab=0]="Tab",t[t.Whitespace=1]="Whitespace"})(NC=Gs.IndentationType||(Gs.IndentationType={}));var Tv=class{get indent(){return this._indent}get isMultilineAllowed(){return this._isMultilineAllowed}constructor(e,n){this.factory=e,this.options=n,this._indent=0,this._stack=[],this._contexts=new Map,this._isMultilineAllowed=!0,this.getIndent=n.indentation===NC.Tab?(r=0)=>" ".repeat(this._indent+r):(r=0)=>" ".repeat(n.indentationSpaces).repeat(this._indent+r)}buildChunkContext(e){let n=new Map,r=Object.keys(e.lines),i=new Set;for(let s=0;s<r.length;s++){let o=Number(r[s]),u=e.lines[o].filter(c=>c.type===Hs.ASTType.Comment);for(let c=0;c<u.length;c++){let l=u[c];if(!i.has(l))if(i.add(l),l.isMultiline){let h=l.value.split(`
115
+ `);h.forEach((d,g)=>{let y=o+g;n.has(y)||n.set(y,[]);let C=e.lines[y].filter(L=>L.type!==Hs.ASTType.Comment).map(L=>L.start.character),k=C.length>0?Math.min(...C):-1,T=y===o,w=y===o+h.length-1,v=w?l.end.character<k:!1;n.get(y).push({isMultiline:!0,isStart:T,isEnd:w,isBefore:v,value:d})})}else n.has(o)||n.set(o,[]),n.get(o).push({isMultiline:!1,isStart:!1,isEnd:!1,isBefore:!1,value:l.value})}}return{commentBuckets:n}}getChunkContext(e){return this._contexts.get(e)}getCurrentChunk(){return this._stack[this._stack.length-1]}pushStack(e){this._stack.push(e),this._contexts.set(e,this.buildChunkContext(e))}popStack(){this._stack.pop()}disableMultiline(){this._isMultilineAllowed=!1}enableMultiline(){this._isMultilineAllowed=!0}incIndent(){this._indent++}decIndent(){this._indent--}getBlockOpenerEndLine(e){return e instanceof Hs.ASTIfClause||e instanceof Hs.ASTWhileStatement?e.condition.end.line:e instanceof Hs.ASTForGenericStatement?e.iterator.end.line:e instanceof Hs.ASTChunk?e.start.line-1:e.start.line}getPreviousEndLine(e){if(e==null)return 0;if(e.type===Hs.ASTType.IfShortcutStatement){let n=e;return n.clauses[n.clauses.length-1].body[0].end.line}return e.end.line}buildBlock(e){let n=new LC.BeautifyBodyIterator(e,e.body),r=n.next();for(;!r.done;){let i=r.value;if(i.type===LC.FILLER_TYPE){this.factory.pushSegment(this.getIndent()),this.factory.pushComment(i.start.line),this.factory.eol(),r=n.next();continue}this.factory.pushSegment(this.getIndent()),this.factory.process(i,{isCommand:!0}),this.factory.eol(),r=n.next()}}};Gs.BeautifyContext=Tv});var xv=m(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.commentToText=qt.hasEmptyBody=qt.containsMultilineItemInShortcutClauses=qt.getLastComment=qt.unwrap=qt.countRightBinaryExpressions=qt.SHORTHAND_OPERATORS=void 0;var kn=ke();qt.SHORTHAND_OPERATORS=[kn.Operator.Plus,kn.Operator.Minus,kn.Operator.Asterik,kn.Operator.Slash,kn.Operator.Modulo,kn.Operator.Power];var aB=t=>{if(t=(0,qt.unwrap)(t),t instanceof kn.ASTComparisonGroupExpression)return t.expressions.length;let e=[t],n=0;for(;e.length>0;){let r=e.pop();r instanceof kn.ASTBinaryExpression&&n++,(r instanceof kn.ASTBinaryExpression||r instanceof kn.ASTLogicalExpression||r instanceof kn.ASTIsaExpression)&&(e.push((0,qt.unwrap)(r.left)),e.push((0,qt.unwrap)(r.right)))}return n};qt.countRightBinaryExpressions=aB;var uB=t=>{for(;t instanceof kn.ASTParenthesisExpression;)t=t.expression;return t};qt.unwrap=uB;var cB=t=>{for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.type===kn.ASTType.Comment)return n}return null};qt.getLastComment=cB;var lB=(t,e)=>e.some(n=>t.line<n.body[0].end.line);qt.containsMultilineItemInShortcutClauses=lB;var hB=t=>!t.some(e=>!(e instanceof kn.ASTComment));qt.hasEmptyBody=hB;var dB=t=>t.isMultiline?t.isStart&&!t.isEnd?"/* "+t.value.trim():!t.isStart&&t.isEnd?t.value.trim()+" */":t.isStart&&t.isEnd?"/* "+t.value.trim()+" */":t.value.trim():"// "+t.value.trim();qt.commentToText=dB});var Av=m(Xd=>{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});Xd.Stack=void 0;var kv=class{constructor(){let e=this;e.currentStack=[]}get(e){let r=this.currentStack;e==null&&(e=0);let i=r.length-e-1;return i<0?null:r[i]}depth(){return this.currentStack.filter(function(e){return Object.prototype.hasOwnProperty.call(e,"body")}).length}lookup(e){let n=this;for(let r=n.currentStack.length-2;r>=0;r--)if(e(n.currentStack[r]))return!0;return!1}push(e){let n=this;return n.currentStack.push(e),n}pop(){let e=this;return e.currentStack.pop(),e}};Xd.Stack=kv});var Wu=m(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});Yd.Factory=void 0;var fB=Av(),Cv=class{get activeLine(){return this._activeLine}get lines(){return this._lines}get currentStack(){return this._currentStack}get currentDependency(){return this._currentDependency}constructor(e){this.transformer=e,this._activeLine=this.createLine(),this._lines=[],this._currentDependency=null,this._currentStack=new fB.Stack}pushSegment(e,n){this._activeLine.segments.push(e)}pushComment(e){throw new Error("Not implemented")}createLine(){return{segments:[]}}eol(e){this._lines.push(this._activeLine),this._activeLine=this.createLine()}reset(){this._activeLine=this.createLine(),this._lines=[]}process(e,n={}){let r=this,i=r._currentStack;if(e==null)return;if(e.type==null)throw console.error("Error AST type:",e),new Error("Unexpected AST type");let s=r.handlers[e.type];if(s==null)throw console.error("Error AST:",e),new Error("Type does not exist "+e.type);i.push(e),s.call(this,e,n),i.pop()}};Yd.Factory=Cv});var Rv=m(Zd=>{"use strict";Object.defineProperty(Zd,"__esModule",{value:!0});Zd.BeautifyFactory=void 0;var Uu=ke(),pB=require("path"),qC=vv(),Jd=aa(),Qd=wv(),jC=Ev(),Cr=xv(),gB=Wu(),Ov=class extends gB.Factory{constructor(e){super(e),this.handlers={ParenthesisExpression:function(o,a){this.pushSegment("(",o),this.process(o.expression,{hasLogicalIndentActive:a.hasLogicalIndentActive}),this.pushSegment(")",o)},Comment:function(o,a){},AssignmentStatement:function(o,a){let u=o.variable,c=o.init;if(this.process(u),(u instanceof Uu.ASTIdentifier||u instanceof Uu.ASTMemberExpression)&&c instanceof Uu.ASTBinaryExpression&&(c.left instanceof Uu.ASTIdentifier||c.left instanceof Uu.ASTMemberExpression)&&Cr.SHORTHAND_OPERATORS.includes(c.operator)&&(0,qC.createExpressionHash)(u)===(0,qC.createExpressionHash)(c.left)){this.pushSegment(" "+c.operator+"= ",o),this.process((0,Cr.unwrap)(c.right));return}this.pushSegment(" = ",o),this.process(c)},MemberExpression:function(o,a){this.process(o.base),this.pushSegment(o.indexer,o),this.process(o.identifier)},FunctionDeclaration:function(o,a){if(o.parameters.length===0)this.pushSegment("function",{start:o.start,end:o.start});else{this.context.disableMultiline(),this.pushSegment("function(",{start:o.start,end:o.start});for(let u=0;u<o.parameters.length;u++){let c=o.parameters[u];this.process(c),u!==o.parameters.length-1&&this.pushSegment(", ",c)}this.pushSegment(")",{start:o.start,end:o.start}),this.context.enableMultiline()}this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent(),this.pushSegment(this.context.getIndent()+"end function",{start:o.end,end:o.end})},MapConstructorExpression:function(o,a){if(o.fields.length===0){this.pushSegment("{}",o);return}if(o.fields.length===1){this.pushSegment("{ ",o),this.process(o.fields[0]),this.pushSegment(" }",o);return}if(this.context.isMultilineAllowed){this.context.incIndent(),this.pushSegment("{",{start:o.start,end:o.start}),this.eol();let u=new Qd.BeautifyBodyIterator(o,o.fields),c=u.next();for(;!c.done;){let l=c.value;if(l.type===Qd.FILLER_TYPE){this.pushSegment(this.context.getIndent()),this.pushComment(l.start.line),this.eol(),c=u.next();continue}this.pushSegment(this.context.getIndent(),l),this.process(l),this.pushSegment(",",l),this.eol(),c=u.next()}this.context.decIndent(),this.pushSegment(this.context.getIndent()+"}",{start:o.end,end:o.end});return}this.pushSegment("{ ",{start:o.start,end:o.start});for(let u=0;u<o.fields.length;u++){let c=o.fields[u];this.process(c),u!==o.fields.length-1&&this.pushSegment(", ",c)}this.context.decIndent(),this.pushSegment(" }",{start:o.end,end:o.end})},MapKeyString:function(o,a){this.process(o.key),this.pushSegment(": ",o),this.process(o.value)},Identifier:function(o,a){this.pushSegment(o.name,o)},ReturnStatement:function(o,a){this.pushSegment("return ",o),o.argument&&this.process(o.argument)},NumericLiteral:function(o,a){this.pushSegment((0,Jd.getLiteralValue)(o),o)},WhileStatement:function(o,a){this.pushSegment("while ",{start:o.start,end:o.start}),this.context.disableMultiline(),this.process(o.condition),this.context.enableMultiline(),this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent(),this.pushSegment(this.context.getIndent()+"end while",{start:o.end,end:o.end})},CallExpression:function(o,a){let u=this.lines.length-1;if(this.process(o.base),o.arguments.length===0)return;if(o.arguments.length>3&&this.context.isMultilineAllowed){this.context.incIndent(),this.pushSegment("(",{start:o.start,end:o.start}),this.eol();for(let h=0;h<o.arguments.length;h++){let d=o.arguments[h];this.pushSegment(this.context.getIndent(),d),this.process(d),h!==o.arguments.length-1&&(this.pushSegment(",",d),this.eol())}this.context.decIndent(),this.pushSegment(")",{start:o.end,end:o.end});return}a.isCommand&&!this.transformer.buildOptions.keepParentheses?this.pushSegment(" ",{start:o.start,end:o.start}):this.pushSegment("(",{start:o.start,end:o.start});let c=this.lines.length;for(let h=0;h<o.arguments.length;h++){let d=o.arguments[h];this.process(d),h!==o.arguments.length-1&&this.pushSegment(", ",d)}let l=c!==this.lines.length;if(o.arguments.length>1&&l){this.eol(),this._lines=this._lines.slice(0,u+1),this.pushSegment(this.context.getIndent(),o.base),this.process(o.base),this.pushSegment("(",{start:o.start,end:o.start}),this.eol(),this.context.incIndent();for(let h=0;h<o.arguments.length;h++){let d=o.arguments[h];this.pushSegment(this.context.getIndent(),d),this.process(d),h!==o.arguments.length-1&&(this.pushSegment(",",d),this.eol())}this.context.decIndent(),this.pushSegment(")",{start:o.end,end:o.end});return}a.isCommand&&!this.transformer.buildOptions.keepParentheses||this.pushSegment(")",{start:o.end,end:o.end})},StringLiteral:function(o,a){this.pushSegment((0,Jd.getLiteralRawValue)(o),{start:o.end,end:o.end})},SliceExpression:function(o,a){this.process(o.base),this.pushSegment("[",o),this.process(o.left),this.pushSegment(" : ",o),this.process(o.right),this.pushSegment("]",o)},IndexExpression:function(o,a){this.process(o.base),this.pushSegment("[",o),this.process(o.index),this.pushSegment("]",o)},UnaryExpression:function(o,a){o.operator==="new"?this.pushSegment(o.operator+" ",o):this.pushSegment(o.operator,o),this.process(o.argument)},NegationExpression:function(o,a){this.pushSegment("not ",o),this.process(o.argument)},FeatureEnvarExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#envar ${o.name}`,o);return}let u=this.transformer.environmentVariables.get(o.name);if(!u){this.pushSegment("null",o);return}this.pushSegment(`"${u}"`,o)},IfShortcutStatement:function(o,a){for(let u=0;u<o.clauses.length;u++){let c=o.clauses[u];this.process(c),u!==o.clauses.length-1&&this.pushSegment(" ",o)}},IfShortcutClause:function(o,a){this.pushSegment("if ",o),this.process((0,Cr.unwrap)(o.condition)),this.pushSegment(" then ",o),this.process(o.body[0])},ElseifShortcutClause:function(o,a){this.pushSegment("else if ",o),this.process((0,Cr.unwrap)(o.condition)),this.pushSegment(" then ",o),this.process(o.body[0])},ElseShortcutClause:function(o,a){this.pushSegment("else ",o),this.process(o.body[0])},NilLiteral:function(o,a){this.pushSegment((0,Jd.getLiteralRawValue)(o),o)},ForGenericStatement:function(o,a){this.pushSegment("for ",{start:o.start,end:o.start}),this.process((0,Cr.unwrap)(o.variable)),this.pushSegment(" in ",{start:o.start,end:o.start}),this.process((0,Cr.unwrap)(o.iterator)),this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent(),this.pushSegment(this.context.getIndent()+"end for",{start:o.end,end:o.end})},IfStatement:function(o,a){for(let u of o.clauses)this.process(u);this.pushSegment(this.context.getIndent()+"end if",{start:o.end,end:o.end})},IfClause:function(o,a){this.pushSegment("if ",{start:o.start,end:o.start}),this.process((0,Cr.unwrap)(o.condition)),this.pushSegment(" then",{start:o.start,end:o.start}),this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent()},ElseifClause:function(o,a){this.pushSegment(this.context.getIndent()+"else if ",{start:o.start,end:o.start}),this.process((0,Cr.unwrap)(o.condition)),this.pushSegment(" then",{start:o.start,end:o.start}),this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent()},ElseClause:function(o,a){this.pushSegment(this.context.getIndent()+"else",{start:o.start,end:o.start}),this.eol(),this.context.incIndent(),this.context.buildBlock(o),this.context.decIndent()},ContinueStatement:function(o,a){this.pushSegment("continue",o)},BreakStatement:function(o,a){this.pushSegment("break",o)},CallStatement:function(o,a){this.process(o.expression,{isCommand:!0})},FeatureInjectExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#inject "${o.path}";`,o);return}if(this.currentDependency===null){this.pushSegment(`#inject "${o.path}";`,o);return}let u=this.currentDependency.injections.get(o.path);if(u==null){this.pushSegment("null",o);return}this.pushSegment(`"${u.replace(/"/g,()=>'""')}"`,o)},FeatureImportExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#import ",o),this.process(o.name),this.pushSegment(` from "${o.path}";`,o);return}if(!o.chunk){this.pushSegment("#import ",o),this.process(o.name),this.pushSegment(` from "${o.path}";`,o);return}this.process(o.name),this.pushSegment(' = __REQUIRE("'+o.namespace+'")',o)},FeatureIncludeExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#include "${o.path}";`,o);return}if(!o.chunk){this.pushSegment(`#include "${o.path}";`,o);return}this.process(o.chunk)},FeatureDebuggerExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment("debugger",o);return}this.pushSegment("//debugger",o)},FeatureLineExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#line",o);return}this.pushSegment(`${o.start.line}`,o)},FeatureFileExpression:function(o,a){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#filename",o);return}this.pushSegment(`"${(0,pB.basename)(o.filename).replace(/"/g,()=>'"')}"`,o)},ListConstructorExpression:function(o,a){if(o.fields.length===0){this.pushSegment("[]",o);return}if(o.fields.length===1){this.pushSegment("[ ",o),this.process(o.fields[0]),this.pushSegment(" ]",o);return}if(this.context.isMultilineAllowed){this.context.incIndent(),this.pushSegment("[",{start:o.start,end:o.start}),this.eol();let u=new Qd.BeautifyBodyIterator(o,o.fields),c=u.next();for(;!c.done;){let l=c.value;if(l.type===Qd.FILLER_TYPE){this.pushSegment(this.context.getIndent()),this.pushComment(l.start.line),this.eol(),c=u.next();continue}this.pushSegment(this.context.getIndent(),l),this.process(l),this.pushSegment(",",l),this.eol(),c=u.next()}this.context.decIndent(),this.pushSegment(this.context.getIndent()+"]",{start:o.end,end:o.end});return}this.pushSegment("[ ",o);for(let u=0;u<o.fields.length;u++){let c=o.fields[u];this.process(c),u!==o.fields.length-1&&this.pushSegment(", ",c)}this.pushSegment(" ]",o)},ListValue:function(o,a){this.process(o.value)},BooleanLiteral:function(o,a){this.pushSegment((0,Jd.getLiteralRawValue)(o),o)},EmptyExpression:function(o,a){this.pushSegment("",o)},IsaExpression:function(o,a){this.process(o.left,{hasLogicalIndentActive:a.hasLogicalIndentActive}),this.pushSegment(" "+o.operator+" ",o),this.process(o.right,{hasLogicalIndentActive:a.hasLogicalIndentActive})},LogicalExpression:function(o,a){if((0,Cr.countRightBinaryExpressions)(o.right)>2){a.hasLogicalIndentActive||this.context.incIndent(),this.process(o.left,{hasLogicalIndentActive:!0}),this.pushSegment(" "+o.operator+" ",o),this.eol(),this.pushSegment(this.context.getIndent(),o),this.process(o.right,{hasLogicalIndentActive:!0}),a.hasLogicalIndentActive||this.context.decIndent();return}this.process(o.left,{hasLogicalIndentActive:a.hasLogicalIndentActive}),this.pushSegment(" "+o.operator+" ",o),this.process(o.right,{hasLogicalIndentActive:a.hasLogicalIndentActive})},BinaryExpression:function(o,a){if(o.operator==="|"){this.pushSegment("bitOr(",o),this.process(o.left),this.pushSegment(", ",o),this.process(o.right),this.pushSegment(")",o);return}else if(o.operator==="&"){this.pushSegment("bitAnd(",o),this.process(o.left),this.pushSegment(", ",o),this.process(o.right),this.pushSegment(")",o);return}else if(o.operator==="<<"||o.operator===">>"||o.operator===">>>")throw new Error("Operators in binary expression are not supported");this.process(o.left),this.pushSegment(" "+o.operator+" ",o),this.process(o.right)},BinaryNegatedExpression:function(o,a){this.pushSegment(o.operator,o),this.process(o.argument)},ComparisonGroupExpression:function(o,a){this.process(o.expressions[0]);for(let u=0;u<o.operators.length;u++)this.pushSegment(" "+o.operators[u]+" ",o),this.process(o.expressions[u+1])},Chunk:function(o,a){this.context.pushStack(o),this.context.buildBlock(o),this.context.popStack()}};let{keepParentheses:n=!1,indentation:r=jC.IndentationType.Tab,indentationSpaces:i=2,isDevMode:s=!1}=e.buildOptions;this.context=new jC.BeautifyContext(this,{keepParentheses:n,indentation:r,indentationSpaces:i,isDevMode:s})}createLine(){return{segments:[],comments:[]}}pushSegment(e,n){this._activeLine.segments.push(e),n!=null&&this.pushComment(n.start.line)}pushComment(e){let n=this.context.getCurrentChunk(),r=this.context.getChunkContext(n),i=r.commentBuckets.get(e);i&&(this._activeLine.comments.push(...i),r.commentBuckets.delete(e))}transform(e,n){return this.reset(),this._currentDependency=n,this.process(e),this._lines.map(r=>{let i=r.segments.join(""),s=i.trim();if(r.comments.length===0)return s.length===0?"":i;let o=r.comments.filter(l=>l.isBefore),a=o.map(Cr.commentToText).join(""),u=r.comments.filter(l=>!l.isBefore),c=u.map(Cr.commentToText).join("");return s.length===0&&o.length===0&&u.length===0?"":(s.length>0&&o.length>0&&(i=" "+i),s.length>0&&u.length>0&&(i=i+" "),a+i+c)}).join(`
116
+ `)}generateOptimizations(){return[]}};Zd.BeautifyFactory=Ov});var Dv=m(tf=>{"use strict";Object.defineProperty(tf,"__esModule",{value:!0});tf.DefaultFactory=void 0;var mB=require("path"),ef=aa(),yB=Wu(),Pv=class extends yB.Factory{constructor(){super(...arguments),this.handlers={ParenthesisExpression:function(e,n){this.pushSegment("("),this.process(e.expression),this.pushSegment(")")},Comment:function(e,n){if(e.isMultiline){this.pushSegment(e.value.split(`
117
117
  `).map(r=>`//${r}`).join(`
118
- `));return}this.pushSegment("//"+e.value)},AssignmentStatement:function(e,n){let r=e.variable,i=e.init;this.process(r),this.pushSegment("="),this.process(i)},MemberExpression:function(e,n){this.process(e.base),this.pushSegment(e.indexer),this.process(e.identifier)},FunctionDeclaration:function(e,n){if(e.parameters.length===0)this.pushSegment("function");else{this.pushSegment("function(");for(let r=0;r<e.parameters.length;r++){let i=e.parameters[r];this.process(i),r!==e.parameters.length-1&&this.pushSegment(",")}this.pushSegment(")")}this.eol();for(let r of e.body)this.process(r),this.eol();this.pushSegment("end function")},MapConstructorExpression:function(e,n){this.pushSegment("{");for(let r=0;r<e.fields.length;r++){let i=e.fields[r];this.process(i),r!==e.fields.length-1&&this.pushSegment(",")}this.pushSegment("}")},MapKeyString:function(e,n){this.process(e.key),this.pushSegment(":"),this.process(e.value)},Identifier:function(e,n){this.pushSegment(e.name)},ReturnStatement:function(e,n){this.pushSegment("return "),e.argument&&this.process(e.argument)},NumericLiteral:function(e,n){this.pushSegment((0,Gd.getLiteralValue)(e))},WhileStatement:function(e,n){this.pushSegment("while "),this.process(e.condition),this.eol();for(let r of e.body)this.process(r),this.eol();this.pushSegment("end while")},CallExpression:function(e,n){if(this.process(e.base),e.arguments.length!==0){this.pushSegment("(");for(let r=0;r<e.arguments.length;r++){let i=e.arguments[r];this.process(i),r!==e.arguments.length-1&&this.pushSegment(",")}this.pushSegment(")")}},StringLiteral:function(e,n){this.pushSegment((0,Gd.getLiteralRawValue)(e))},SliceExpression:function(e,n){this.process(e.base),this.pushSegment("["),this.process(e.left),this.pushSegment(":"),this.process(e.right),this.pushSegment("]")},IndexExpression:function(e,n){this.process(e.base),this.pushSegment("["),this.process(e.index),this.pushSegment("]")},UnaryExpression:function(e,n){e.operator==="new"?this.pushSegment(e.operator+" "):this.pushSegment(e.operator),this.process(e.argument)},NegationExpression:function(e,n){this.pushSegment(e.operator+" "),this.process(e.argument)},FeatureEnvarExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#envar ${e.name}`);return}let r=this.transformer.environmentVariables.get(e.name);if(!r){this.pushSegment("null");return}this.pushSegment(`"${r}"`)},IfShortcutStatement:function(e,n){for(let r=0;r<e.clauses.length;r++){let i=e.clauses[r];this.process(i),r!==e.clauses.length-1&&this.pushSegment(" ")}},IfShortcutClause:function(e,n){this.pushSegment("if "),this.process(e.condition),this.pushSegment(" then "),this.process(e.body[0])},ElseifShortcutClause:function(e,n){this.pushSegment("else if "),this.process(e.condition),this.pushSegment(" then "),this.process(e.body[0])},ElseShortcutClause:function(e,n){this.pushSegment("else "),this.process(e.body[0])},NilLiteral:function(e,n){this.pushSegment((0,Gd.getLiteralRawValue)(e))},ForGenericStatement:function(e,n){this.pushSegment("for "),this.process(e.variable),this.pushSegment(" in "),this.process(e.iterator),this.eol();for(let r of e.body)this.process(r),this.eol();this.pushSegment("end for")},IfStatement:function(e,n){for(let r of e.clauses)this.process(r);this.pushSegment("end if")},IfClause:function(e,n){this.pushSegment("if "),this.process(e.condition),this.pushSegment(" then"),this.eol();for(let r of e.body)this.process(r),this.eol()},ElseifClause:function(e,n){this.pushSegment("else if "),this.process(e.condition),this.pushSegment(" then"),this.eol();for(let r of e.body)this.process(r),this.eol()},ElseClause:function(e,n){this.pushSegment("else"),this.eol();for(let r of e.body)this.process(r),this.eol()},ContinueStatement:function(e,n){this.pushSegment("continue")},BreakStatement:function(e,n){this.pushSegment("break")},CallStatement:function(e,n){this.process(e.expression)},FeatureInjectExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#inject "${e.path}"`);return}if(this.currentDependency===null){this.pushSegment(`#inject "${e.path}";`);return}let r=this.currentDependency.injections.get(e.path);if(r==null){this.pushSegment("null");return}this.pushSegment(`"${r.replace(/"/g,()=>'""')}"`)},FeatureImportExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#import "),this.process(e.name),this.pushSegment(` from "${e.path}";`);return}if(!e.chunk){this.pushSegment("#import "),this.process(e.name),this.pushSegment(` from "${e.path}";`);return}this.process(e.name),this.pushSegment(' = __REQUIRE("'+e.namespace+'")')},FeatureIncludeExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#include "${e.path}";`);return}if(!e.chunk){this.pushSegment(`#include "${e.path}";`);return}this.process(e.chunk)},FeatureDebuggerExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.pushSegment("debugger");return}this.pushSegment("//debugger")},FeatureLineExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#line");return}this.pushSegment(`${e.start.line}`)},FeatureFileExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#filename");return}this.pushSegment(`"${(0,H$.basename)(e.filename).replace(/"/g,()=>'"')}"`)},ListConstructorExpression:function(e,n){this.pushSegment("[");for(let r=0;r<e.fields.length;r++){let i=e.fields[r];this.process(i),r!==e.fields.length-1&&this.pushSegment(",")}this.pushSegment("]")},ListValue:function(e,n){this.process(e.value)},BooleanLiteral:function(e,n){this.pushSegment((0,Gd.getLiteralRawValue)(e))},EmptyExpression:function(e,n){this.pushSegment("")},IsaExpression:function(e,n){this.process(e.left),this.pushSegment(" "+e.operator+" "),this.process(e.right)},LogicalExpression:function(e,n){this.process(e.left),this.pushSegment(" "+e.operator+" "),this.process(e.right)},BinaryExpression:function(e,n){if(e.operator==="|"){this.pushSegment("bitOr("),this.process(e.left),this.pushSegment(","),this.process(e.right),this.pushSegment(")");return}else if(e.operator==="&"){this.pushSegment("bitAnd("),this.process(e.left),this.pushSegment(","),this.process(e.right),this.pushSegment(")");return}else if(e.operator==="<<"||e.operator===">>"||e.operator===">>>")throw new Error("Operators in binary expression are not supported");this.process(e.left),this.pushSegment(e.operator),this.process(e.right)},BinaryNegatedExpression:function(e,n){this.pushSegment(e.operator),this.process(e.argument)},ComparisonGroupExpression:function(e,n){this.process(e.expressions[0]);for(let r=0;r<e.operators.length;r++)this.pushSegment(e.operators[r]),this.process(e.expressions[r+1])},Chunk:function(e,n){for(let r of e.body)this.process(r),this.eol()}}}transform(e,n){return this.reset(),this._currentDependency=n,this.process(e),this._lines.map(r=>r.segments.join("")).join(`
119
- `)}generateOptimizations(){return[]}};zd.DefaultFactory=bv});var vv=m(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});Vd.createExpressionString=void 0;var Kd=Te();function Bu(t){switch(t.type){case Kd.ASTType.ParenthesisExpression:return Bu(t.expression);case Kd.ASTType.MemberExpression:{let e=t;return`${Bu(e.base)}.${Bu(e.identifier)}`}case Kd.ASTType.IndexExpression:return`${Bu(t.base)}[]`;case Kd.ASTType.Identifier:return t.name}}function z$(t){return Bu(t)}Vd.createExpressionString=z$});var Uu=m(Xd=>{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});Xd.merge=void 0;function K$(t,e,n=1e4){if(e.length<=n){Array.prototype.push.apply(t,e);return}for(let r=0;r<e.length;r+=n)Array.prototype.push.apply(t,e.slice(r,r+n))}Xd.merge=K$});var wv=m(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});Yd.UglifyFactory=void 0;var V$=require("path"),CC=vv(),Yr=oa(),X$=Uu(),Y$=Fu(),Sv=class extends Y$.Factory{constructor(e){var n,r;super(e),this.handlers={ParenthesisExpression:function(i,s){this.pushSegment("("),this.process(i.expression),this.pushSegment(")")},Comment:function(i,s){},AssignmentStatement:function(i,s){let o=i.variable,a=i.init;this.process(o),this.pushSegment("="),this.process(a)},MemberExpression:function(i,s){this.process(i.base),this.pushSegment(i.indexer);let o=(0,CC.createExpressionString)(i.base);this.process(i.identifier,{usesNativeVar:o==="globals"||o==="locals"||o==="outer",isMember:!0})},FunctionDeclaration:function(i,s){if(i.parameters.length===0)this.pushSegment("function");else{this.pushSegment("function("),this.isWithinArgument=!0;for(let o=0;o<i.parameters.length;o++){let a=i.parameters[o];this.process(a),o!==i.parameters.length-1&&this.pushSegment(",")}this.isWithinArgument=!1,this.pushSegment(")")}this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol();this.pushSegment("end function")},MapConstructorExpression:function(i,s){this.pushSegment("{");for(let o=0;o<i.fields.length;o++){let a=i.fields[o];this.process(a),o!==i.fields.length-1&&this.pushSegment(",")}this.pushSegment("}")},MapKeyString:function(i,s){this.process(i.key),this.pushSegment(":"),this.process(i.value)},Identifier:function(i,s){let o=i.name;if(this.disableNamespacesOptimization){this.pushSegment(o);return}if(s.isMember&&s.usesNativeVar?o=this.forIdxMapping.get(o)||this.transformer.context.variables.get(o)||o:s.isMember||(o=this.forIdxMapping.get(o)||this.transformer.context.variables.get(o)||o),s.isForVariable&&i.name!==o){let a=`__${i.name}_idx`,u=`__${o}_idx`;this.forIdxMapping.set(a,u)}this.pushSegment(o)},ReturnStatement:function(i,s){this.pushSegment("return "),i.argument&&this.process(i.argument)},NumericLiteral:function(i,s){if(this.disableLiteralsOptimization){this.pushSegment((0,Yr.getLiteralValue)(i));return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.pushSegment(o.namespace);return}this.pushSegment((0,Yr.getLiteralValue)(i))},WhileStatement:function(i,s){this.pushSegment("while "),this.process(i.condition),this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol();this.pushSegment("end while")},CallExpression:function(i,s){let o=(0,CC.createExpressionString)(i.base),a=o==="globals.hasIndex"||o==="locals.hasIndex"||o==="outer.hasIndex",u;if(this.process(i.base),a){if(u=i.arguments[0],u.type==="StringLiteral"){let c=(0,Yr.getLiteralValue)(u),l=this.transformer.context.variables.get(c);this.pushSegment('("'+(l??c)+'")');return}this.pushSegment("("),this.process(u),this.pushSegment(")");return}if(i.arguments.length!==0){this.pushSegment("(");for(let c=0;c<i.arguments.length;c++){let l=i.arguments[c];this.process(l),c!==i.arguments.length-1&&this.pushSegment(",")}this.pushSegment(")")}},StringLiteral:function(i,s){if(this.disableLiteralsOptimization){this.pushSegment((0,Yr.getLiteralRawValue)(i));return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.pushSegment(o.namespace);return}this.pushSegment((0,Yr.getLiteralRawValue)(i))},SliceExpression:function(i,s){this.process(i.base),this.pushSegment("["),this.process(i.left),this.pushSegment(":"),this.process(i.right),this.pushSegment("]")},IndexExpression:function(i,s){this.process(i.base),this.pushSegment("["),this.process(i.index),this.pushSegment("]")},UnaryExpression:function(i,s){i.operator==="new"?this.pushSegment(i.operator+" "):this.pushSegment(i.operator),this.process(i.argument)},NegationExpression:function(i,s){this.pushSegment(i.operator+" "),this.process(i.argument)},FeatureEnvarExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#envar ${i.name}`);return}let o=this.transformer.environmentVariables.get(i.name);if(!o){this.pushSegment("null");return}this.pushSegment(`"${o}"`)},FeatureDebuggerExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment("debugger");return}this.pushSegment("//debugger")},FeatureLineExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#line");return}this.pushSegment(`${i.start.line}`)},FeatureFileExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#filename");return}this.pushSegment(`"${(0,V$.basename)(i.filename).replace(/"/g,()=>'"')}"`)},IfShortcutStatement:function(i,s){for(let o=0;o<i.clauses.length;o++){let a=i.clauses[o];this.process(a),o!==i.clauses.length-1&&this.pushSegment(" ")}},IfShortcutClause:function(i,s){this.pushSegment("if "),this.process(i.condition),this.pushSegment(" then "),this.process(i.body[0])},ElseifShortcutClause:function(i,s){this.pushSegment(" else if "),this.process(i.condition),this.pushSegment(" then"),this.process(i.body[0])},ElseShortcutClause:function(i,s){this.pushSegment("else "),this.process(i.body[0])},NilLiteral:function(i,s){if(this.disableLiteralsOptimization){this.pushSegment((0,Yr.getLiteralRawValue)(i));return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.pushSegment(o.namespace);return}this.pushSegment((0,Yr.getLiteralRawValue)(i))},ForGenericStatement:function(i,s){this.pushSegment("for "),this.process(i.variable,{isForVariable:!0}),this.pushSegment(" in "),this.process(i.iterator),this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol();this.pushSegment("end for")},IfStatement:function(i,s){for(let o of i.clauses)this.process(o);this.pushSegment("end if")},IfClause:function(i,s){this.pushSegment("if "),this.process(i.condition),this.pushSegment(" then"),this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol()},ElseifClause:function(i,s){this.pushSegment("else if "),this.process(i.condition),this.pushSegment(" then"),this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol()},ElseClause:function(i,s){this.pushSegment("else"),this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol()},ContinueStatement:function(i,s){this.pushSegment("continue")},BreakStatement:function(i,s){this.pushSegment("break")},CallStatement:function(i,s){this.process(i.expression)},FeatureInjectExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#inject "${i.path}"`);return}if(this.currentDependency===null){this.pushSegment(`#inject "${i.path}";`);return}let o=this.currentDependency.injections.get(i.path);if(o==null){this.pushSegment("null");return}this.pushSegment(`"${o.replace(/"/g,()=>'""')}"`)},FeatureImportExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#import "),this.process(i.name),this.pushSegment(` from "${i.path}";`);return}if(!i.chunk){this.pushSegment("#import "),this.process(i.name),this.pushSegment(` from "${i.path}";`);return}if(this.process(i.name),this.disableNamespacesOptimization){this.pushSegment(`=__REQUIRE("${i.namespace}")`);return}let o=this.transformer.context.variables.get("__REQUIRE");this.pushSegment(`=${o}("${i.namespace}")`)},FeatureIncludeExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#include "${i.path}";`);return}if(!i.chunk){this.pushSegment(`#include "${i.path}";`);return}this.process(i.chunk)},ListConstructorExpression:function(i,s){this.pushSegment("[");for(let o=0;o<i.fields.length;o++){let a=i.fields[o];this.process(a),o!==i.fields.length-1&&this.pushSegment(",")}this.pushSegment("]")},ListValue:function(i,s){this.process(i.value)},BooleanLiteral:function(i,s){if(this.disableLiteralsOptimization){this.pushSegment((0,Yr.getLiteralRawValue)(i));return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.pushSegment(o.namespace);return}this.pushSegment((0,Yr.getLiteralRawValue)(i))},EmptyExpression:function(i,s){this.pushSegment("")},IsaExpression:function(i,s){this.process(i.left),this.pushSegment(" "+i.operator+" "),this.process(i.right)},LogicalExpression:function(i,s){this.process(i.left),this.pushSegment(" "+i.operator+" "),this.process(i.right)},BinaryExpression:function(i,s){if(i.operator==="|"){this.pushSegment("bitOr("),this.process(i.left),this.pushSegment(","),this.process(i.right),this.pushSegment(")");return}else if(i.operator==="&"){this.pushSegment("bitAnd("),this.process(i.left),this.pushSegment(","),this.process(i.right),this.pushSegment(")");return}else if(i.operator==="<<"||i.operator===">>"||i.operator===">>>")throw new Error("Operators in binary expression are not supported");this.process(i.left),this.pushSegment(i.operator),this.process(i.right)},BinaryNegatedExpression:function(i,s){this.pushSegment(i.operator),this.process(i.argument)},ComparisonGroupExpression:function(i,s){this.process(i.expressions[0]);for(let o=0;o<i.operators.length;o++)this.pushSegment(i.operators[o]),this.process(i.expressions[o+1])},Chunk:function(i,s){for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol()}},this.disableLiteralsOptimization=(n=e.buildOptions.disableLiteralsOptimization)!==null&&n!==void 0?n:!1,this.disableNamespacesOptimization=(r=e.buildOptions.disableNamespacesOptimization)!==null&&r!==void 0?r:!1,this.forIdxMapping=new Map,this.isWithinArgument=!1}transform(e,n){return this.reset(),this._currentDependency=n,this.process(e),this._lines.map(r=>r.segments.join("")).join(`
120
- `)}generateOptimizations(){let e=this.transformer.context,n=Array.from(e.literals.getMapping().values()).filter(s=>s.namespace!=null),r=e.variables.get("globals"),i=[];if((!this.disableNamespacesOptimization||n.length>0)&&i.push(`globals.${r}=globals`),n.length>0){let s=n.map(o=>`${r}.${o.namespace}=${(0,Yr.getLiteralRawValue)(o.literal)}`);(0,X$.merge)(i,s)}return i}};Yd.UglifyFactory=Sv});var Jd=m(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.getFactory=Ws.BuildType=void 0;var J$=yv(),Q$=_v(),Z$=wv(),Wu;(function(t){t[t.DEFAULT=0]="DEFAULT",t[t.UGLIFY=1]="UGLIFY",t[t.BEAUTIFY=2]="BEAUTIFY"})(Wu=Ws.BuildType||(Ws.BuildType={}));var eB={[Wu.DEFAULT]:Q$.DefaultFactory,[Wu.UGLIFY]:Z$.UglifyFactory,[Wu.BEAUTIFY]:J$.BeautifyFactory};function tB(t=Wu.DEFAULT){let e=eB[t];if(!e)throw new Error("Unknown build type.");return e}Ws.getFactory=tB});var Tv=m((OC,Qd)=>{(function(t){"use strict";function e(v,L){var R=(v&65535)+(L&65535),U=(v>>16)+(L>>16)+(R>>16);return U<<16|R&65535}function n(v,L){return v<<L|v>>>32-L}function r(v,L,R,U,te,se){return e(n(e(e(L,v),e(U,se)),te),R)}function i(v,L,R,U,te,se,W){return r(L&R|~L&U,v,L,te,se,W)}function s(v,L,R,U,te,se,W){return r(L&U|R&~U,v,L,te,se,W)}function o(v,L,R,U,te,se,W){return r(L^R^U,v,L,te,se,W)}function a(v,L,R,U,te,se,W){return r(R^(L|~U),v,L,te,se,W)}function u(v,L){v[L>>5]|=128<<L%32,v[(L+64>>>9<<4)+14]=L;var R,U,te,se,W,O=1732584193,M=-271733879,N=-1732584194,j=271733878;for(R=0;R<v.length;R+=16)U=O,te=M,se=N,W=j,O=i(O,M,N,j,v[R],7,-680876936),j=i(j,O,M,N,v[R+1],12,-389564586),N=i(N,j,O,M,v[R+2],17,606105819),M=i(M,N,j,O,v[R+3],22,-1044525330),O=i(O,M,N,j,v[R+4],7,-176418897),j=i(j,O,M,N,v[R+5],12,1200080426),N=i(N,j,O,M,v[R+6],17,-1473231341),M=i(M,N,j,O,v[R+7],22,-45705983),O=i(O,M,N,j,v[R+8],7,1770035416),j=i(j,O,M,N,v[R+9],12,-1958414417),N=i(N,j,O,M,v[R+10],17,-42063),M=i(M,N,j,O,v[R+11],22,-1990404162),O=i(O,M,N,j,v[R+12],7,1804603682),j=i(j,O,M,N,v[R+13],12,-40341101),N=i(N,j,O,M,v[R+14],17,-1502002290),M=i(M,N,j,O,v[R+15],22,1236535329),O=s(O,M,N,j,v[R+1],5,-165796510),j=s(j,O,M,N,v[R+6],9,-1069501632),N=s(N,j,O,M,v[R+11],14,643717713),M=s(M,N,j,O,v[R],20,-373897302),O=s(O,M,N,j,v[R+5],5,-701558691),j=s(j,O,M,N,v[R+10],9,38016083),N=s(N,j,O,M,v[R+15],14,-660478335),M=s(M,N,j,O,v[R+4],20,-405537848),O=s(O,M,N,j,v[R+9],5,568446438),j=s(j,O,M,N,v[R+14],9,-1019803690),N=s(N,j,O,M,v[R+3],14,-187363961),M=s(M,N,j,O,v[R+8],20,1163531501),O=s(O,M,N,j,v[R+13],5,-1444681467),j=s(j,O,M,N,v[R+2],9,-51403784),N=s(N,j,O,M,v[R+7],14,1735328473),M=s(M,N,j,O,v[R+12],20,-1926607734),O=o(O,M,N,j,v[R+5],4,-378558),j=o(j,O,M,N,v[R+8],11,-2022574463),N=o(N,j,O,M,v[R+11],16,1839030562),M=o(M,N,j,O,v[R+14],23,-35309556),O=o(O,M,N,j,v[R+1],4,-1530992060),j=o(j,O,M,N,v[R+4],11,1272893353),N=o(N,j,O,M,v[R+7],16,-155497632),M=o(M,N,j,O,v[R+10],23,-1094730640),O=o(O,M,N,j,v[R+13],4,681279174),j=o(j,O,M,N,v[R],11,-358537222),N=o(N,j,O,M,v[R+3],16,-722521979),M=o(M,N,j,O,v[R+6],23,76029189),O=o(O,M,N,j,v[R+9],4,-640364487),j=o(j,O,M,N,v[R+12],11,-421815835),N=o(N,j,O,M,v[R+15],16,530742520),M=o(M,N,j,O,v[R+2],23,-995338651),O=a(O,M,N,j,v[R],6,-198630844),j=a(j,O,M,N,v[R+7],10,1126891415),N=a(N,j,O,M,v[R+14],15,-1416354905),M=a(M,N,j,O,v[R+5],21,-57434055),O=a(O,M,N,j,v[R+12],6,1700485571),j=a(j,O,M,N,v[R+3],10,-1894986606),N=a(N,j,O,M,v[R+10],15,-1051523),M=a(M,N,j,O,v[R+1],21,-2054922799),O=a(O,M,N,j,v[R+8],6,1873313359),j=a(j,O,M,N,v[R+15],10,-30611744),N=a(N,j,O,M,v[R+6],15,-1560198380),M=a(M,N,j,O,v[R+13],21,1309151649),O=a(O,M,N,j,v[R+4],6,-145523070),j=a(j,O,M,N,v[R+11],10,-1120210379),N=a(N,j,O,M,v[R+2],15,718787259),M=a(M,N,j,O,v[R+9],21,-343485551),O=e(O,U),M=e(M,te),N=e(N,se),j=e(j,W);return[O,M,N,j]}function c(v){var L,R="",U=v.length*32;for(L=0;L<U;L+=8)R+=String.fromCharCode(v[L>>5]>>>L%32&255);return R}function l(v){var L,R=[];for(R[(v.length>>2)-1]=void 0,L=0;L<R.length;L+=1)R[L]=0;var U=v.length*8;for(L=0;L<U;L+=8)R[L>>5]|=(v.charCodeAt(L/8)&255)<<L%32;return R}function h(v){return c(u(l(v),v.length*8))}function d(v,L){var R,U=l(v),te=[],se=[],W;for(te[15]=se[15]=void 0,U.length>16&&(U=u(U,v.length*8)),R=0;R<16;R+=1)te[R]=U[R]^909522486,se[R]=U[R]^1549556828;return W=u(te.concat(l(L)),512+L.length*8),c(u(se.concat(W),640))}function g(v){var L="0123456789abcdef",R="",U,te;for(te=0;te<v.length;te+=1)U=v.charCodeAt(te),R+=L.charAt(U>>>4&15)+L.charAt(U&15);return R}function y(v){return unescape(encodeURIComponent(v))}function _(v){return h(y(v))}function C(v){return g(_(v))}function k(v,L){return d(y(v),y(L))}function T(v,L){return g(k(v,L))}function w(v,L,R){return L?R?k(L,v):T(L,v):R?_(v):C(v)}typeof define=="function"&&define.amd?define(function(){return w}):typeof Qd=="object"&&Qd.exports?Qd.exports=w:t.md5=w})(OC)});var xv=m(aa=>{"use strict";var nB=aa&&aa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(aa,"__esModule",{value:!0});aa.LiteralsMapper=void 0;var rB=nB(Tv()),RC=oa(),Ev=class{constructor(e){let n=this;n.mapping=new Map,n.variableNamespacesGenerator=e}reset(){let e=this;return e.mapping=new Map,e}add(e){let n=this,r=(0,RC.getLiteralRawValue)(e);if(!n.mapping.has(r))n.mapping.set(r,{literal:e,amount:1,length:r.length,namespace:null});else{let i=n.mapping.get(r),s=i.amount+1,o=i.length+r.length;i.amount=s,i.length=o,o>10&&s>2&&i.namespace==null&&(i.namespace=n.variableNamespacesGenerator.createNamespace((0,rB.default)(r)))}return n}get(e){let n=this,r=(0,RC.getLiteralRawValue)(e);return n.mapping.has(r)?n.mapping.get(r):null}getMapping(){return this.mapping}};aa.LiteralsMapper=Ev});var Av=m(Zd=>{"use strict";Object.defineProperty(Zd,"__esModule",{value:!0});Zd.NamespaceGenerator=void 0;var kv=class{constructor(e){let n=this;n.buffer=[0],n.mapping=new Map,n.rmapping=new Map,n.forbidden=e.forbidden||[],n.characters=e.characters||null,n.defaultNamespaces=e.defaultNamespaces||[];for(let r of n.defaultNamespaces)n.createNamespace(r)}exclude(e){let n=this;return Array.isArray(e)?n.forbidden=n.forbidden.concat(e):n.forbidden.push(e),n}setCharset(e){let n=this;return n.characters=e,n}reset(){let e=this;return e.buffer=[0],e.mapping=new Map,e.rmapping=new Map,e}get(e){let n=this.mapping;return n.has(e)?n.get(e):null}increaseBuffer(e){let n=this,r=n.buffer,i=n.characters.length;e==null&&(e=r.length-1);let s=r[e];return s=s+1,r[e]=s,s===i&&(r[e]=0,e===0?r.push(0):n.increaseBuffer(e-1)),n}generateNamespace(){let e=this,n=e.buffer,r=e.characters,i=e.forbidden,s="",o=0,a;for(;o<n.length;)a=n[o],s=s+r[a],o===n.length-1&&e.increaseBuffer(),o=o+1;return i.indexOf(s)!==-1||e.mapping.has(s)?e.generateNamespace():s}createNamespace(e,n=!1){let r=this,i=r.mapping,s=r.rmapping;if(r.forbidden.indexOf(e)!==-1)return e;if(i.has(e)&&!n)return i.get(e);let a=r.generateNamespace();if(i.set(e,a),s.set(a,e),s.has(e)){let u=s.get(e);s.delete(e),a=r.createNamespace(u,!0)}return a}};Zd.NamespaceGenerator=kv});var Hu=m(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.Context=Hs.ContextDataProperty=void 0;var iB=Te(),sB=xv(),PC=Av(),oB;(function(t){t.ResourceDependencyMap="resourceDependencyMap",t.DependencyCallStack="dependencyCallStack"})(oB=Hs.ContextDataProperty||(Hs.ContextDataProperty={}));var Cv=class{constructor(e){let n=this;n.modules=new PC.NamespaceGenerator({characters:e.modulesCharset}),n.variables=new PC.NamespaceGenerator({characters:e.variablesCharset,defaultNamespaces:["BACKSLASH_CODE","NEW_LINE_OPERATOR","MODULES","EXPORTED","__REQUIRE","MAIN","module","globals"],forbidden:["locals","outer","self","super","string","list","map","number","funcRef",...Object.values(iB.Keyword),...e.variablesExcluded||[]]}),n.literals=new sB.LiteralsMapper(n.variables),n.data=new Map}createModuleNamespace(e){return this.modules.createNamespace(e)}getOrCreateData(e,n){let r=this;if(r.data.has(e))return r.data.get(e);let i=n();return r.data.set(e,i),i}set(e,n){return this.data.set(e,n),this}get(e){return this.data.get(e)}};Hs.Context=Cv});var Ov=m(Gu=>{"use strict";Object.defineProperty(Gu,"__esModule",{value:!0});Gu.DependencyType=void 0;var aB;(function(t){t[t.Main=0]="Main",t[t.Import=1]="Import",t[t.Include=2]="Include"})(aB=Gu.DependencyType||(Gu.DependencyType={}))});var tf=m(ef=>{"use strict";Object.defineProperty(ef,"__esModule",{value:!0});ef.BuildError=void 0;var Rv=class extends Error{constructor(e,n){super(e),this.target=n.target,this.range=n.range}};ef.BuildError=Rv});var rf=m(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});nf.fetchNamespaces=void 0;var Pv=Te();function DC(t){if(t.type===Pv.ASTType.MemberExpression){let e=t;return e.identifier.type===Pv.ASTType.Identifier?e.identifier.name:null}else if(t.type===Pv.ASTType.Identifier)return t.name;return null}function uB(t){let e=new Set(t.namespaces.map(DC).filter(n=>n!==null));return t.scopes.reduce((n,r)=>(r.namespaces.map(DC).filter(s=>s!==null).forEach(s=>e.add(s)),n),e),Array.from(e)}nf.fetchNamespaces=uB});var Lv=m(Yi=>{"use strict";var Dv=Yi&&Yi.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{c(r.next(l))}catch(h){o(h)}}function u(l){try{c(r.throw(l))}catch(h){o(h)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})},qC=Yi&&Yi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Yi,"__esModule",{value:!0});Yi.Dependency=void 0;var IC=qC(Tv()),cB=qC(require("events")),MC=Vr(),sf=Hu(),Iv=Ov(),LC=tf(),lB=rf(),NC=Uu(),Mv=class t extends cB.default{constructor(e){super();let n=this;n.target=e.target,n.id=(0,IC.default)(e.target),n.resourceHandler=e.resourceHandler,n.chunk=e.chunk,n.dependencies=new Set,n.injections=new Map,n.type=e.type||Iv.DependencyType.Main,n.context=e.context,n.ref=e.ref;let r=n.context.createModuleNamespace(n.id);n.context.getOrCreateData(sf.ContextDataProperty.ResourceDependencyMap,()=>new Map).set(r,n),n.context.getOrCreateData(sf.ContextDataProperty.DependencyCallStack,()=>[])}getId(){return this.id}getNamespace(){let e=this;return e.context.modules.get(e.id)}resolve(e,n,r){return Dv(this,void 0,void 0,function*(){let i=this,s=i.context,{modules:o}=s,a=s.get(sf.ContextDataProperty.ResourceDependencyMap),u=i.resourceHandler,c=yield u.getTargetRelativeTo(i.target,e),l=(0,IC.default)(c),h=o.get(l);if(a.has(h))return a.get(h);if(!(yield u.has(c)))throw new Error("Dependency "+c+" does not exist...");let d=yield u.get(c);i.emit("parse-before",c);try{let y=new MC.Parser(d,{filename:c}).parseChunk(),_=new t({target:c,resourceHandler:u,chunk:y,type:n,context:s,ref:r});return i.emit("parse-after",_),_}catch(g){throw g instanceof LC.BuildError?g:new LC.BuildError(g.message,{target:c,range:g.range})}})}findInjections(){return Dv(this,void 0,void 0,function*(){let e=this,{injects:n}=e.chunk,r=new Map;for(let i of n){let s=yield e.resourceHandler.getTargetRelativeTo(e.target,i.path);if(!(yield e.resourceHandler.has(s)))throw new Error("Injection "+s+" does not exist...");let o=yield e.resourceHandler.get(s);r.set(i.path,o)}return e.injections=r,r})}findDependencies(){return Dv(this,void 0,void 0,function*(){let e=this,{imports:n,includes:r}=e.chunk,i=e.getNamespace(),s=e.context.get(sf.ContextDataProperty.DependencyCallStack),o=[...(0,lB.fetchNamespaces)(e.chunk)],a=[...e.chunk.literals],u=[];s.push(i);let c=[...n,...r];for(let h of c){let d=h instanceof MC.ASTFeatureIncludeExpression?Iv.DependencyType.Include:Iv.DependencyType.Import,g=yield e.resolve(h.path,d,h),y=g.getNamespace();if(s.includes(y))throw new Error(`Circular dependency from ${e.target} to ${g.target} detected.`);let _=g.chunk;h.chunk=_,h.namespace=y;let C=yield g.findDependencies();(0,NC.merge)(o,C.namespaces),(0,NC.merge)(a,C.literals),u.push(g)}yield this.findInjections();let l=new Set(u);return e.dependencies=l,s.pop(),{dependencies:l,namespaces:o,literals:a}})}};Yi.Dependency=Mv});var af=m(of=>{"use strict";Object.defineProperty(of,"__esModule",{value:!0});of.Transformer=void 0;var Nv=class{get factory(){return this._factory}get buildOptions(){return this._buildOptions}get context(){return this._context}get environmentVariables(){return this._environmentVariables}get resourceHandler(){return this._resourceHandler}constructor({buildOptions:e,factoryConstructor:n,context:r,environmentVariables:i,resourceHandler:s}){let o=this;o._buildOptions=e,o._context=r,o._environmentVariables=i,o._factory=new n(o),o._resourceHandler=s??null}transform(e,n=null){let r=this;if(e.type!=="Chunk")throw new Error("Expects chunk");return r._factory.transform(e,n)}};of.Transformer=Nv});var lf=m(cf=>{"use strict";Object.defineProperty(cf,"__esModule",{value:!0});cf.generateCharsetMap=void 0;function uf(t,e){let n="";for(;t<=e;)n=n+String.fromCharCode(t),t=t+1;return n}function hB(t=!1){let e=uf(65,90),n=uf(97,122),r=uf(48,57),i="_";return t&&(i=i+uf(1e3,2e3)),{variables:e+n+i,modules:e+n+r+i}}cf.generateCharsetMap=hB});var jv=m(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.MAIN_BOILERPLATE=Ji.MODULE_BOILERPLATE=Ji.HEADER_BOILERPLATE=void 0;var qv=Vr();Ji.HEADER_BOILERPLATE=new qv.Parser(`MODULES={}
118
+ `));return}this.pushSegment("//"+e.value)},AssignmentStatement:function(e,n){let r=e.variable,i=e.init;this.process(r),this.pushSegment("="),this.process(i)},MemberExpression:function(e,n){this.process(e.base),this.pushSegment(e.indexer),this.process(e.identifier)},FunctionDeclaration:function(e,n){if(e.parameters.length===0)this.pushSegment("function");else{this.pushSegment("function(");for(let r=0;r<e.parameters.length;r++){let i=e.parameters[r];this.process(i),r!==e.parameters.length-1&&this.pushSegment(",")}this.pushSegment(")")}this.eol();for(let r of e.body)this.process(r),this.eol();this.pushSegment("end function")},MapConstructorExpression:function(e,n){this.pushSegment("{");for(let r=0;r<e.fields.length;r++){let i=e.fields[r];this.process(i),r!==e.fields.length-1&&this.pushSegment(",")}this.pushSegment("}")},MapKeyString:function(e,n){this.process(e.key),this.pushSegment(":"),this.process(e.value)},Identifier:function(e,n){this.pushSegment(e.name)},ReturnStatement:function(e,n){this.pushSegment("return "),e.argument&&this.process(e.argument)},NumericLiteral:function(e,n){this.pushSegment((0,ef.getLiteralValue)(e))},WhileStatement:function(e,n){this.pushSegment("while "),this.process(e.condition),this.eol();for(let r of e.body)this.process(r),this.eol();this.pushSegment("end while")},CallExpression:function(e,n){if(this.process(e.base),e.arguments.length!==0){this.pushSegment("(");for(let r=0;r<e.arguments.length;r++){let i=e.arguments[r];this.process(i),r!==e.arguments.length-1&&this.pushSegment(",")}this.pushSegment(")")}},StringLiteral:function(e,n){this.pushSegment((0,ef.getLiteralRawValue)(e))},SliceExpression:function(e,n){this.process(e.base),this.pushSegment("["),this.process(e.left),this.pushSegment(":"),this.process(e.right),this.pushSegment("]")},IndexExpression:function(e,n){this.process(e.base),this.pushSegment("["),this.process(e.index),this.pushSegment("]")},UnaryExpression:function(e,n){e.operator==="new"?this.pushSegment(e.operator+" "):this.pushSegment(e.operator),this.process(e.argument)},NegationExpression:function(e,n){this.pushSegment(e.operator+" "),this.process(e.argument)},FeatureEnvarExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#envar ${e.name}`);return}let r=this.transformer.environmentVariables.get(e.name);if(!r){this.pushSegment("null");return}this.pushSegment(`"${r}"`)},IfShortcutStatement:function(e,n){for(let r=0;r<e.clauses.length;r++){let i=e.clauses[r];this.process(i),r!==e.clauses.length-1&&this.pushSegment(" ")}},IfShortcutClause:function(e,n){this.pushSegment("if "),this.process(e.condition),this.pushSegment(" then "),this.process(e.body[0])},ElseifShortcutClause:function(e,n){this.pushSegment("else if "),this.process(e.condition),this.pushSegment(" then "),this.process(e.body[0])},ElseShortcutClause:function(e,n){this.pushSegment("else "),this.process(e.body[0])},NilLiteral:function(e,n){this.pushSegment((0,ef.getLiteralRawValue)(e))},ForGenericStatement:function(e,n){this.pushSegment("for "),this.process(e.variable),this.pushSegment(" in "),this.process(e.iterator),this.eol();for(let r of e.body)this.process(r),this.eol();this.pushSegment("end for")},IfStatement:function(e,n){for(let r of e.clauses)this.process(r);this.pushSegment("end if")},IfClause:function(e,n){this.pushSegment("if "),this.process(e.condition),this.pushSegment(" then"),this.eol();for(let r of e.body)this.process(r),this.eol()},ElseifClause:function(e,n){this.pushSegment("else if "),this.process(e.condition),this.pushSegment(" then"),this.eol();for(let r of e.body)this.process(r),this.eol()},ElseClause:function(e,n){this.pushSegment("else"),this.eol();for(let r of e.body)this.process(r),this.eol()},ContinueStatement:function(e,n){this.pushSegment("continue")},BreakStatement:function(e,n){this.pushSegment("break")},CallStatement:function(e,n){this.process(e.expression)},FeatureInjectExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#inject "${e.path}"`);return}if(this.currentDependency===null){this.pushSegment(`#inject "${e.path}";`);return}let r=this.currentDependency.injections.get(e.path);if(r==null){this.pushSegment("null");return}this.pushSegment(`"${r.replace(/"/g,()=>'""')}"`)},FeatureImportExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#import "),this.process(e.name),this.pushSegment(` from "${e.path}";`);return}if(!e.chunk){this.pushSegment("#import "),this.process(e.name),this.pushSegment(` from "${e.path}";`);return}this.process(e.name),this.pushSegment(' = __REQUIRE("'+e.namespace+'")')},FeatureIncludeExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#include "${e.path}";`);return}if(!e.chunk){this.pushSegment(`#include "${e.path}";`);return}this.process(e.chunk)},FeatureDebuggerExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.pushSegment("debugger");return}this.pushSegment("//debugger")},FeatureLineExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#line");return}this.pushSegment(`${e.start.line}`)},FeatureFileExpression:function(e,n){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#filename");return}this.pushSegment(`"${(0,mB.basename)(e.filename).replace(/"/g,()=>'"')}"`)},ListConstructorExpression:function(e,n){this.pushSegment("[");for(let r=0;r<e.fields.length;r++){let i=e.fields[r];this.process(i),r!==e.fields.length-1&&this.pushSegment(",")}this.pushSegment("]")},ListValue:function(e,n){this.process(e.value)},BooleanLiteral:function(e,n){this.pushSegment((0,ef.getLiteralRawValue)(e))},EmptyExpression:function(e,n){this.pushSegment("")},IsaExpression:function(e,n){this.process(e.left),this.pushSegment(" "+e.operator+" "),this.process(e.right)},LogicalExpression:function(e,n){this.process(e.left),this.pushSegment(" "+e.operator+" "),this.process(e.right)},BinaryExpression:function(e,n){if(e.operator==="|"){this.pushSegment("bitOr("),this.process(e.left),this.pushSegment(","),this.process(e.right),this.pushSegment(")");return}else if(e.operator==="&"){this.pushSegment("bitAnd("),this.process(e.left),this.pushSegment(","),this.process(e.right),this.pushSegment(")");return}else if(e.operator==="<<"||e.operator===">>"||e.operator===">>>")throw new Error("Operators in binary expression are not supported");this.process(e.left),this.pushSegment(e.operator),this.process(e.right)},BinaryNegatedExpression:function(e,n){this.pushSegment(e.operator),this.process(e.argument)},ComparisonGroupExpression:function(e,n){this.process(e.expressions[0]);for(let r=0;r<e.operators.length;r++)this.pushSegment(e.operators[r]),this.process(e.expressions[r+1])},Chunk:function(e,n){for(let r of e.body)this.process(r),this.eol()}}}transform(e,n){return this.reset(),this._currentDependency=n,this.process(e),this._lines.map(r=>r.segments.join("")).join(`
119
+ `)}generateOptimizations(){return[]}};tf.DefaultFactory=Pv});var Iv=m(rf=>{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});rf.createExpressionString=void 0;var nf=ke();function Hu(t){switch(t.type){case nf.ASTType.ParenthesisExpression:return Hu(t.expression);case nf.ASTType.MemberExpression:{let e=t;return`${Hu(e.base)}.${Hu(e.identifier)}`}case nf.ASTType.IndexExpression:return`${Hu(t.base)}[]`;case nf.ASTType.Identifier:return t.name}}function bB(t){return Hu(t)}rf.createExpressionString=bB});var Gu=m(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});sf.merge=void 0;function _B(t,e,n=1e4){if(e.length<=n){Array.prototype.push.apply(t,e);return}for(let r=0;r<e.length;r+=n)Array.prototype.push.apply(t,e.slice(r,r+n))}sf.merge=_B});var Lv=m(of=>{"use strict";Object.defineProperty(of,"__esModule",{value:!0});of.UglifyFactory=void 0;var vB=require("path"),FC=Iv(),Qr=aa(),SB=Gu(),wB=Wu(),Mv=class extends wB.Factory{constructor(e){var n,r;super(e),this.handlers={ParenthesisExpression:function(i,s){this.pushSegment("("),this.process(i.expression),this.pushSegment(")")},Comment:function(i,s){},AssignmentStatement:function(i,s){let o=i.variable,a=i.init;this.process(o),this.pushSegment("="),this.process(a)},MemberExpression:function(i,s){this.process(i.base),this.pushSegment(i.indexer);let o=(0,FC.createExpressionString)(i.base);this.process(i.identifier,{usesNativeVar:o==="globals"||o==="locals"||o==="outer",isMember:!0})},FunctionDeclaration:function(i,s){if(i.parameters.length===0)this.pushSegment("function");else{this.pushSegment("function("),this.isWithinArgument=!0;for(let o=0;o<i.parameters.length;o++){let a=i.parameters[o];this.process(a),o!==i.parameters.length-1&&this.pushSegment(",")}this.isWithinArgument=!1,this.pushSegment(")")}this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol();this.pushSegment("end function")},MapConstructorExpression:function(i,s){this.pushSegment("{");for(let o=0;o<i.fields.length;o++){let a=i.fields[o];this.process(a),o!==i.fields.length-1&&this.pushSegment(",")}this.pushSegment("}")},MapKeyString:function(i,s){this.process(i.key),this.pushSegment(":"),this.process(i.value)},Identifier:function(i,s){let o=i.name;if(this.disableNamespacesOptimization){this.pushSegment(o);return}if(s.isMember&&s.usesNativeVar?o=this.forIdxMapping.get(o)||this.transformer.context.variables.get(o)||o:s.isMember||(o=this.forIdxMapping.get(o)||this.transformer.context.variables.get(o)||o),s.isForVariable&&i.name!==o){let a=`__${i.name}_idx`,u=`__${o}_idx`;this.forIdxMapping.set(a,u)}this.pushSegment(o)},ReturnStatement:function(i,s){this.pushSegment("return "),i.argument&&this.process(i.argument)},NumericLiteral:function(i,s){if(this.disableLiteralsOptimization){this.pushSegment((0,Qr.getLiteralValue)(i));return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.pushSegment(o.namespace);return}this.pushSegment((0,Qr.getLiteralValue)(i))},WhileStatement:function(i,s){this.pushSegment("while "),this.process(i.condition),this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol();this.pushSegment("end while")},CallExpression:function(i,s){let o=(0,FC.createExpressionString)(i.base),a=o==="globals.hasIndex"||o==="locals.hasIndex"||o==="outer.hasIndex",u;if(this.process(i.base),a){if(u=i.arguments[0],u.type==="StringLiteral"){let c=(0,Qr.getLiteralValue)(u),l=this.transformer.context.variables.get(c);this.pushSegment('("'+(l??c)+'")');return}this.pushSegment("("),this.process(u),this.pushSegment(")");return}if(i.arguments.length!==0){this.pushSegment("(");for(let c=0;c<i.arguments.length;c++){let l=i.arguments[c];this.process(l),c!==i.arguments.length-1&&this.pushSegment(",")}this.pushSegment(")")}},StringLiteral:function(i,s){if(this.disableLiteralsOptimization){this.pushSegment((0,Qr.getLiteralRawValue)(i));return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.pushSegment(o.namespace);return}this.pushSegment((0,Qr.getLiteralRawValue)(i))},SliceExpression:function(i,s){this.process(i.base),this.pushSegment("["),this.process(i.left),this.pushSegment(":"),this.process(i.right),this.pushSegment("]")},IndexExpression:function(i,s){this.process(i.base),this.pushSegment("["),this.process(i.index),this.pushSegment("]")},UnaryExpression:function(i,s){i.operator==="new"?this.pushSegment(i.operator+" "):this.pushSegment(i.operator),this.process(i.argument)},NegationExpression:function(i,s){this.pushSegment(i.operator+" "),this.process(i.argument)},FeatureEnvarExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#envar ${i.name}`);return}let o=this.transformer.environmentVariables.get(i.name);if(!o){this.pushSegment("null");return}this.pushSegment(`"${o}"`)},FeatureDebuggerExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment("debugger");return}this.pushSegment("//debugger")},FeatureLineExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#line");return}this.pushSegment(`${i.start.line}`)},FeatureFileExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#filename");return}this.pushSegment(`"${(0,vB.basename)(i.filename).replace(/"/g,()=>'"')}"`)},IfShortcutStatement:function(i,s){for(let o=0;o<i.clauses.length;o++){let a=i.clauses[o];this.process(a),o!==i.clauses.length-1&&this.pushSegment(" ")}},IfShortcutClause:function(i,s){this.pushSegment("if "),this.process(i.condition),this.pushSegment(" then "),this.process(i.body[0])},ElseifShortcutClause:function(i,s){this.pushSegment(" else if "),this.process(i.condition),this.pushSegment(" then"),this.process(i.body[0])},ElseShortcutClause:function(i,s){this.pushSegment("else "),this.process(i.body[0])},NilLiteral:function(i,s){if(this.disableLiteralsOptimization){this.pushSegment((0,Qr.getLiteralRawValue)(i));return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.pushSegment(o.namespace);return}this.pushSegment((0,Qr.getLiteralRawValue)(i))},ForGenericStatement:function(i,s){this.pushSegment("for "),this.process(i.variable,{isForVariable:!0}),this.pushSegment(" in "),this.process(i.iterator),this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol();this.pushSegment("end for")},IfStatement:function(i,s){for(let o of i.clauses)this.process(o);this.pushSegment("end if")},IfClause:function(i,s){this.pushSegment("if "),this.process(i.condition),this.pushSegment(" then"),this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol()},ElseifClause:function(i,s){this.pushSegment("else if "),this.process(i.condition),this.pushSegment(" then"),this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol()},ElseClause:function(i,s){this.pushSegment("else"),this.eol();for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol()},ContinueStatement:function(i,s){this.pushSegment("continue")},BreakStatement:function(i,s){this.pushSegment("break")},CallStatement:function(i,s){this.process(i.expression)},FeatureInjectExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#inject "${i.path}"`);return}if(this.currentDependency===null){this.pushSegment(`#inject "${i.path}";`);return}let o=this.currentDependency.injections.get(i.path);if(o==null){this.pushSegment("null");return}this.pushSegment(`"${o.replace(/"/g,()=>'""')}"`)},FeatureImportExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment("#import "),this.process(i.name),this.pushSegment(` from "${i.path}";`);return}if(!i.chunk){this.pushSegment("#import "),this.process(i.name),this.pushSegment(` from "${i.path}";`);return}if(this.process(i.name),this.disableNamespacesOptimization){this.pushSegment(`=__REQUIRE("${i.namespace}")`);return}let o=this.transformer.context.variables.get("__REQUIRE");this.pushSegment(`=${o}("${i.namespace}")`)},FeatureIncludeExpression:function(i,s){if(this.transformer.buildOptions.isDevMode){this.pushSegment(`#include "${i.path}";`);return}if(!i.chunk){this.pushSegment(`#include "${i.path}";`);return}this.process(i.chunk)},ListConstructorExpression:function(i,s){this.pushSegment("[");for(let o=0;o<i.fields.length;o++){let a=i.fields[o];this.process(a),o!==i.fields.length-1&&this.pushSegment(",")}this.pushSegment("]")},ListValue:function(i,s){this.process(i.value)},BooleanLiteral:function(i,s){if(this.disableLiteralsOptimization){this.pushSegment((0,Qr.getLiteralRawValue)(i));return}let o=this.transformer.context.literals.get(i);if(!this.isWithinArgument&&o!==null&&o.namespace!==null){this.pushSegment(o.namespace);return}this.pushSegment((0,Qr.getLiteralRawValue)(i))},EmptyExpression:function(i,s){this.pushSegment("")},IsaExpression:function(i,s){this.process(i.left),this.pushSegment(" "+i.operator+" "),this.process(i.right)},LogicalExpression:function(i,s){this.process(i.left),this.pushSegment(" "+i.operator+" "),this.process(i.right)},BinaryExpression:function(i,s){if(i.operator==="|"){this.pushSegment("bitOr("),this.process(i.left),this.pushSegment(","),this.process(i.right),this.pushSegment(")");return}else if(i.operator==="&"){this.pushSegment("bitAnd("),this.process(i.left),this.pushSegment(","),this.process(i.right),this.pushSegment(")");return}else if(i.operator==="<<"||i.operator===">>"||i.operator===">>>")throw new Error("Operators in binary expression are not supported");this.process(i.left),this.pushSegment(i.operator),this.process(i.right)},BinaryNegatedExpression:function(i,s){this.pushSegment(i.operator),this.process(i.argument)},ComparisonGroupExpression:function(i,s){this.process(i.expressions[0]);for(let o=0;o<i.operators.length;o++)this.pushSegment(i.operators[o]),this.process(i.expressions[o+1])},Chunk:function(i,s){for(let o of i.body)this.process(o),this._activeLine.segments.length>0&&this.eol()}},this.disableLiteralsOptimization=(n=e.buildOptions.disableLiteralsOptimization)!==null&&n!==void 0?n:!1,this.disableNamespacesOptimization=(r=e.buildOptions.disableNamespacesOptimization)!==null&&r!==void 0?r:!1,this.forIdxMapping=new Map,this.isWithinArgument=!1}transform(e,n){return this.reset(),this._currentDependency=n,this.process(e),this._lines.map(r=>r.segments.join("")).join(`
120
+ `)}generateOptimizations(){let e=this.transformer.context,n=Array.from(e.literals.getMapping().values()).filter(s=>s.namespace!=null),r=e.variables.get("globals"),i=[];if((!this.disableNamespacesOptimization||n.length>0)&&i.push(`globals.${r}=globals`),n.length>0){let s=n.map(o=>`${r}.${o.namespace}=${(0,Qr.getLiteralRawValue)(o.literal)}`);(0,SB.merge)(i,s)}return i}};of.UglifyFactory=Mv});var af=m(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});zs.getFactory=zs.BuildType=void 0;var TB=Rv(),EB=Dv(),xB=Lv(),zu;(function(t){t[t.DEFAULT=0]="DEFAULT",t[t.UGLIFY=1]="UGLIFY",t[t.BEAUTIFY=2]="BEAUTIFY"})(zu=zs.BuildType||(zs.BuildType={}));var kB={[zu.DEFAULT]:EB.DefaultFactory,[zu.UGLIFY]:xB.UglifyFactory,[zu.BEAUTIFY]:TB.BeautifyFactory};function AB(t=zu.DEFAULT){let e=kB[t];if(!e)throw new Error("Unknown build type.");return e}zs.getFactory=AB});var Nv=m(($C,uf)=>{(function(t){"use strict";function e(v,L){var R=(v&65535)+(L&65535),W=(v>>16)+(L>>16)+(R>>16);return W<<16|R&65535}function n(v,L){return v<<L|v>>>32-L}function r(v,L,R,W,ne,se){return e(n(e(e(L,v),e(W,se)),ne),R)}function i(v,L,R,W,ne,se,U){return r(L&R|~L&W,v,L,ne,se,U)}function s(v,L,R,W,ne,se,U){return r(L&W|R&~W,v,L,ne,se,U)}function o(v,L,R,W,ne,se,U){return r(L^R^W,v,L,ne,se,U)}function a(v,L,R,W,ne,se,U){return r(R^(L|~W),v,L,ne,se,U)}function u(v,L){v[L>>5]|=128<<L%32,v[(L+64>>>9<<4)+14]=L;var R,W,ne,se,U,O=1732584193,M=-271733879,N=-1732584194,j=271733878;for(R=0;R<v.length;R+=16)W=O,ne=M,se=N,U=j,O=i(O,M,N,j,v[R],7,-680876936),j=i(j,O,M,N,v[R+1],12,-389564586),N=i(N,j,O,M,v[R+2],17,606105819),M=i(M,N,j,O,v[R+3],22,-1044525330),O=i(O,M,N,j,v[R+4],7,-176418897),j=i(j,O,M,N,v[R+5],12,1200080426),N=i(N,j,O,M,v[R+6],17,-1473231341),M=i(M,N,j,O,v[R+7],22,-45705983),O=i(O,M,N,j,v[R+8],7,1770035416),j=i(j,O,M,N,v[R+9],12,-1958414417),N=i(N,j,O,M,v[R+10],17,-42063),M=i(M,N,j,O,v[R+11],22,-1990404162),O=i(O,M,N,j,v[R+12],7,1804603682),j=i(j,O,M,N,v[R+13],12,-40341101),N=i(N,j,O,M,v[R+14],17,-1502002290),M=i(M,N,j,O,v[R+15],22,1236535329),O=s(O,M,N,j,v[R+1],5,-165796510),j=s(j,O,M,N,v[R+6],9,-1069501632),N=s(N,j,O,M,v[R+11],14,643717713),M=s(M,N,j,O,v[R],20,-373897302),O=s(O,M,N,j,v[R+5],5,-701558691),j=s(j,O,M,N,v[R+10],9,38016083),N=s(N,j,O,M,v[R+15],14,-660478335),M=s(M,N,j,O,v[R+4],20,-405537848),O=s(O,M,N,j,v[R+9],5,568446438),j=s(j,O,M,N,v[R+14],9,-1019803690),N=s(N,j,O,M,v[R+3],14,-187363961),M=s(M,N,j,O,v[R+8],20,1163531501),O=s(O,M,N,j,v[R+13],5,-1444681467),j=s(j,O,M,N,v[R+2],9,-51403784),N=s(N,j,O,M,v[R+7],14,1735328473),M=s(M,N,j,O,v[R+12],20,-1926607734),O=o(O,M,N,j,v[R+5],4,-378558),j=o(j,O,M,N,v[R+8],11,-2022574463),N=o(N,j,O,M,v[R+11],16,1839030562),M=o(M,N,j,O,v[R+14],23,-35309556),O=o(O,M,N,j,v[R+1],4,-1530992060),j=o(j,O,M,N,v[R+4],11,1272893353),N=o(N,j,O,M,v[R+7],16,-155497632),M=o(M,N,j,O,v[R+10],23,-1094730640),O=o(O,M,N,j,v[R+13],4,681279174),j=o(j,O,M,N,v[R],11,-358537222),N=o(N,j,O,M,v[R+3],16,-722521979),M=o(M,N,j,O,v[R+6],23,76029189),O=o(O,M,N,j,v[R+9],4,-640364487),j=o(j,O,M,N,v[R+12],11,-421815835),N=o(N,j,O,M,v[R+15],16,530742520),M=o(M,N,j,O,v[R+2],23,-995338651),O=a(O,M,N,j,v[R],6,-198630844),j=a(j,O,M,N,v[R+7],10,1126891415),N=a(N,j,O,M,v[R+14],15,-1416354905),M=a(M,N,j,O,v[R+5],21,-57434055),O=a(O,M,N,j,v[R+12],6,1700485571),j=a(j,O,M,N,v[R+3],10,-1894986606),N=a(N,j,O,M,v[R+10],15,-1051523),M=a(M,N,j,O,v[R+1],21,-2054922799),O=a(O,M,N,j,v[R+8],6,1873313359),j=a(j,O,M,N,v[R+15],10,-30611744),N=a(N,j,O,M,v[R+6],15,-1560198380),M=a(M,N,j,O,v[R+13],21,1309151649),O=a(O,M,N,j,v[R+4],6,-145523070),j=a(j,O,M,N,v[R+11],10,-1120210379),N=a(N,j,O,M,v[R+2],15,718787259),M=a(M,N,j,O,v[R+9],21,-343485551),O=e(O,W),M=e(M,ne),N=e(N,se),j=e(j,U);return[O,M,N,j]}function c(v){var L,R="",W=v.length*32;for(L=0;L<W;L+=8)R+=String.fromCharCode(v[L>>5]>>>L%32&255);return R}function l(v){var L,R=[];for(R[(v.length>>2)-1]=void 0,L=0;L<R.length;L+=1)R[L]=0;var W=v.length*8;for(L=0;L<W;L+=8)R[L>>5]|=(v.charCodeAt(L/8)&255)<<L%32;return R}function h(v){return c(u(l(v),v.length*8))}function d(v,L){var R,W=l(v),ne=[],se=[],U;for(ne[15]=se[15]=void 0,W.length>16&&(W=u(W,v.length*8)),R=0;R<16;R+=1)ne[R]=W[R]^909522486,se[R]=W[R]^1549556828;return U=u(ne.concat(l(L)),512+L.length*8),c(u(se.concat(U),640))}function g(v){var L="0123456789abcdef",R="",W,ne;for(ne=0;ne<v.length;ne+=1)W=v.charCodeAt(ne),R+=L.charAt(W>>>4&15)+L.charAt(W&15);return R}function y(v){return unescape(encodeURIComponent(v))}function _(v){return h(y(v))}function C(v){return g(_(v))}function k(v,L){return d(y(v),y(L))}function T(v,L){return g(k(v,L))}function w(v,L,R){return L?R?k(L,v):T(L,v):R?_(v):C(v)}typeof define=="function"&&define.amd?define(function(){return w}):typeof uf=="object"&&uf.exports?uf.exports=w:t.md5=w})($C)});var jv=m(ua=>{"use strict";var CB=ua&&ua.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ua,"__esModule",{value:!0});ua.LiteralsMapper=void 0;var OB=CB(Nv()),BC=aa(),qv=class{constructor(e){let n=this;n.mapping=new Map,n.variableNamespacesGenerator=e}reset(){let e=this;return e.mapping=new Map,e}add(e){let n=this,r=(0,BC.getLiteralRawValue)(e);if(!n.mapping.has(r))n.mapping.set(r,{literal:e,amount:1,length:r.length,namespace:null});else{let i=n.mapping.get(r),s=i.amount+1,o=i.length+r.length;i.amount=s,i.length=o,o>10&&s>2&&i.namespace==null&&(i.namespace=n.variableNamespacesGenerator.createNamespace((0,OB.default)(r)))}return n}get(e){let n=this,r=(0,BC.getLiteralRawValue)(e);return n.mapping.has(r)?n.mapping.get(r):null}getMapping(){return this.mapping}};ua.LiteralsMapper=qv});var $v=m(cf=>{"use strict";Object.defineProperty(cf,"__esModule",{value:!0});cf.NamespaceGenerator=void 0;var Fv=class{constructor(e){let n=this;n.buffer=[0],n.mapping=new Map,n.rmapping=new Map,n.forbidden=e.forbidden||[],n.characters=e.characters||null,n.defaultNamespaces=e.defaultNamespaces||[];for(let r of n.defaultNamespaces)n.createNamespace(r)}exclude(e){let n=this;return Array.isArray(e)?n.forbidden=n.forbidden.concat(e):n.forbidden.push(e),n}setCharset(e){let n=this;return n.characters=e,n}reset(){let e=this;return e.buffer=[0],e.mapping=new Map,e.rmapping=new Map,e}get(e){let n=this.mapping;return n.has(e)?n.get(e):null}increaseBuffer(e){let n=this,r=n.buffer,i=n.characters.length;e==null&&(e=r.length-1);let s=r[e];return s=s+1,r[e]=s,s===i&&(r[e]=0,e===0?r.push(0):n.increaseBuffer(e-1)),n}generateNamespace(){let e=this,n=e.buffer,r=e.characters,i=e.forbidden,s="",o=0,a;for(;o<n.length;)a=n[o],s=s+r[a],o===n.length-1&&e.increaseBuffer(),o=o+1;return i.indexOf(s)!==-1||e.mapping.has(s)?e.generateNamespace():s}createNamespace(e,n=!1){let r=this,i=r.mapping,s=r.rmapping;if(r.forbidden.indexOf(e)!==-1)return e;if(i.has(e)&&!n)return i.get(e);let a=r.generateNamespace();if(i.set(e,a),s.set(a,e),s.has(e)){let u=s.get(e);s.delete(e),a=r.createNamespace(u,!0)}return a}};cf.NamespaceGenerator=Fv});var Ku=m(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});Ks.Context=Ks.ContextDataProperty=void 0;var RB=ke(),PB=jv(),WC=$v(),DB;(function(t){t.ResourceDependencyMap="resourceDependencyMap",t.DependencyCallStack="dependencyCallStack"})(DB=Ks.ContextDataProperty||(Ks.ContextDataProperty={}));var Bv=class{constructor(e){let n=this;n.modules=new WC.NamespaceGenerator({characters:e.modulesCharset}),n.variables=new WC.NamespaceGenerator({characters:e.variablesCharset,defaultNamespaces:["BACKSLASH_CODE","NEW_LINE_OPERATOR","MODULES","EXPORTED","__REQUIRE","MAIN","module","globals"],forbidden:["locals","outer","self","super","string","list","map","number","funcRef",...Object.values(RB.Keyword),...e.variablesExcluded||[]]}),n.literals=new PB.LiteralsMapper(n.variables),n.data=new Map}createModuleNamespace(e){return this.modules.createNamespace(e)}getOrCreateData(e,n){let r=this;if(r.data.has(e))return r.data.get(e);let i=n();return r.data.set(e,i),i}set(e,n){return this.data.set(e,n),this}get(e){return this.data.get(e)}};Ks.Context=Bv});var Wv=m(Vu=>{"use strict";Object.defineProperty(Vu,"__esModule",{value:!0});Vu.DependencyType=void 0;var IB;(function(t){t[t.Main=0]="Main",t[t.Import=1]="Import",t[t.Include=2]="Include"})(IB=Vu.DependencyType||(Vu.DependencyType={}))});var hf=m(lf=>{"use strict";Object.defineProperty(lf,"__esModule",{value:!0});lf.BuildError=void 0;var Uv=class extends Error{constructor(e,n){super(e),this.target=n.target,this.range=n.range}};lf.BuildError=Uv});var ff=m(df=>{"use strict";Object.defineProperty(df,"__esModule",{value:!0});df.fetchNamespaces=void 0;var Hv=ke();function UC(t){if(t.type===Hv.ASTType.MemberExpression){let e=t;return e.identifier.type===Hv.ASTType.Identifier?e.identifier.name:null}else if(t.type===Hv.ASTType.Identifier)return t.name;return null}function MB(t){let e=new Set(t.namespaces.map(UC).filter(n=>n!==null));return t.scopes.reduce((n,r)=>(r.namespaces.map(UC).filter(s=>s!==null).forEach(s=>e.add(s)),n),e),Array.from(e)}df.fetchNamespaces=MB});var Vv=m(ts=>{"use strict";var Gv=ts&&ts.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{c(r.next(l))}catch(h){o(h)}}function u(l){try{c(r.throw(l))}catch(h){o(h)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})},VC=ts&&ts.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ts,"__esModule",{value:!0});ts.Dependency=void 0;var HC=VC(Nv()),LB=VC(require("events")),GC=Yr(),pf=Ku(),zv=Wv(),zC=hf(),NB=ff(),KC=Gu(),Kv=class t extends LB.default{constructor(e){super();let n=this;n.target=e.target,n.id=(0,HC.default)(e.target),n.resourceHandler=e.resourceHandler,n.chunk=e.chunk,n.dependencies=new Set,n.injections=new Map,n.type=e.type||zv.DependencyType.Main,n.context=e.context,n.ref=e.ref;let r=n.context.createModuleNamespace(n.id);n.context.getOrCreateData(pf.ContextDataProperty.ResourceDependencyMap,()=>new Map).set(r,n),n.context.getOrCreateData(pf.ContextDataProperty.DependencyCallStack,()=>[])}getId(){return this.id}getNamespace(){let e=this;return e.context.modules.get(e.id)}resolve(e,n,r){return Gv(this,void 0,void 0,function*(){let i=this,s=i.context,{modules:o}=s,a=s.get(pf.ContextDataProperty.ResourceDependencyMap),u=i.resourceHandler,c=yield u.getTargetRelativeTo(i.target,e),l=(0,HC.default)(c),h=o.get(l);if(a.has(h))return a.get(h);if(!(yield u.has(c)))throw new Error("Dependency "+c+" does not exist...");let d=yield u.get(c);i.emit("parse-before",c);try{let y=new GC.Parser(d,{filename:c}).parseChunk(),_=new t({target:c,resourceHandler:u,chunk:y,type:n,context:s,ref:r});return i.emit("parse-after",_),_}catch(g){throw g instanceof zC.BuildError?g:new zC.BuildError(g.message,{target:c,range:g.range})}})}findInjections(){return Gv(this,void 0,void 0,function*(){let e=this,{injects:n}=e.chunk,r=new Map;for(let i of n){let s=yield e.resourceHandler.getTargetRelativeTo(e.target,i.path);if(!(yield e.resourceHandler.has(s)))throw new Error("Injection "+s+" does not exist...");let o=yield e.resourceHandler.get(s);r.set(i.path,o)}return e.injections=r,r})}findDependencies(){return Gv(this,void 0,void 0,function*(){let e=this,{imports:n,includes:r}=e.chunk,i=e.getNamespace(),s=e.context.get(pf.ContextDataProperty.DependencyCallStack),o=[...(0,NB.fetchNamespaces)(e.chunk)],a=[...e.chunk.literals],u=[];s.push(i);let c=[...n,...r];for(let h of c){let d=h instanceof GC.ASTFeatureIncludeExpression?zv.DependencyType.Include:zv.DependencyType.Import,g=yield e.resolve(h.path,d,h),y=g.getNamespace();if(s.includes(y))throw new Error(`Circular dependency from ${e.target} to ${g.target} detected.`);let _=g.chunk;h.chunk=_,h.namespace=y;let C=yield g.findDependencies();(0,KC.merge)(o,C.namespaces),(0,KC.merge)(a,C.literals),u.push(g)}yield this.findInjections();let l=new Set(u);return e.dependencies=l,s.pop(),{dependencies:l,namespaces:o,literals:a}})}};ts.Dependency=Kv});var mf=m(gf=>{"use strict";Object.defineProperty(gf,"__esModule",{value:!0});gf.Transformer=void 0;var Xv=class{get factory(){return this._factory}get buildOptions(){return this._buildOptions}get context(){return this._context}get environmentVariables(){return this._environmentVariables}get resourceHandler(){return this._resourceHandler}constructor({buildOptions:e,factoryConstructor:n,context:r,environmentVariables:i,resourceHandler:s}){let o=this;o._buildOptions=e,o._context=r,o._environmentVariables=i,o._factory=new n(o),o._resourceHandler=s??null}transform(e,n=null){let r=this;if(e.type!=="Chunk")throw new Error("Expects chunk");return r._factory.transform(e,n)}};gf.Transformer=Xv});var _f=m(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});bf.generateCharsetMap=void 0;function yf(t,e){let n="";for(;t<=e;)n=n+String.fromCharCode(t),t=t+1;return n}function qB(t=!1){let e=yf(65,90),n=yf(97,122),r=yf(48,57),i="_";return t&&(i=i+yf(1e3,2e3)),{variables:e+n+i,modules:e+n+r+i}}bf.generateCharsetMap=qB});var Jv=m(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.MAIN_BOILERPLATE=ns.MODULE_BOILERPLATE=ns.HEADER_BOILERPLATE=void 0;var Yv=Yr();ns.HEADER_BOILERPLATE=new Yv.Parser(`MODULES={}
121
121
  EXPORTED={}
122
122
  __REQUIRE=function(r)
123
123
  if (not MODULES.hasIndex(r)) then
@@ -126,7 +126,7 @@ ${e}`;for(let a=0;a<this.details.length;++a){let u=a+1;o=`${o}
126
126
  end if
127
127
  module=@MODULES[r]
128
128
  return @module(r).exports
129
- end function`).parseChunk();Ji.MODULE_BOILERPLATE=new qv.Parser(`MODULES["$0"]=function(r)
129
+ end function`).parseChunk();ns.MODULE_BOILERPLATE=new Yv.Parser(`MODULES["$0"]=function(r)
130
130
  module={}
131
131
  if (EXPORTED.hasIndex(r)) then
132
132
  module=EXPORTED[r]
@@ -136,18 +136,18 @@ ${e}`;for(let a=0;a<this.details.length;++a){let u=a+1;o=`${o}
136
136
  end if
137
137
  EXPORTED[r]=module
138
138
  return EXPORTED[r]
139
- end function`).parseChunk();Ji.MAIN_BOILERPLATE=new qv.Parser('"$0"').parseChunk()});var df=m(hf=>{"use strict";Object.defineProperty(hf,"__esModule",{value:!0});hf.OutputProcessor=void 0;var jC=jv(),dB=Uu(),Fv=class{constructor(e,n,{header:r=jC.HEADER_BOILERPLATE,main:i=jC.MAIN_BOILERPLATE}={}){this.context=e,this.transformer=n,this.processed=[],this.headerBoilerplate=this.transformer.transform(r),this.mainBoilerplate=this.transformer.transform(i)}addOptimizations(){return(0,dB.merge)(this.processed,this.transformer.factory.generateOptimizations()),this}addHeader(){return this.processed.push(this.headerBoilerplate),this}addCode(e,n=!1){if(n){let r=this.mainBoilerplate.replace('"$0"',()=>e);this.processed.push(r)}else this.processed.push(e);return this}build(){return this.processed.join(`
140
- `)}};hf.OutputProcessor=Fv});var $C=m(ua=>{"use strict";var fB=ua&&ua.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ua,"__esModule",{value:!0});ua.DirectTranspiler=void 0;var pB=fB(require("events")),gB=Vr(),FC=Jd(),mB=Hu(),yB=af(),bB=lf(),_B=rf(),vB=df(),SB=Object.prototype.hasOwnProperty,$v=class extends pB.default{constructor(e){super();let n=this;n.code=e.code,n.obfuscation=SB.call(e,"obfuscation")?e.obfuscation:!0,n.buildType=e.buildType||FC.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.environmentVariables=e.environmentVariables||new Map,n.excludedNamespaces=e.excludedNamespaces||[]}parse(){let e=this,n=(0,FC.getFactory)(e.buildType),i=new gB.Parser(e.code).parseChunk(),s=(0,_B.fetchNamespaces)(i),o=[].concat(i.literals),a=(0,bB.generateCharsetMap)(e.obfuscation),u=new mB.Context({variablesCharset:a.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:a.modules});new Set(s).forEach(g=>u.variables.createNamespace(g)),o.forEach(g=>u.literals.add(g));let l=new yB.Transformer({buildOptions:e.buildOptions,factoryConstructor:n,context:u,environmentVariables:e.environmentVariables}),h=new vB.OutputProcessor(u,l);h.addOptimizations();let d=l.transform(i);return h.addCode(d),h.build()}};ua.DirectTranspiler=$v});var Uv=m(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});ff.ResourceProvider=void 0;var Bv=class{getHandler(){let e=require("fs"),n=require("path");return{getTargetRelativeTo:(r,i)=>{let s=n.resolve(r,".."),o=n.resolve(s,i);return Promise.resolve(e.existsSync(o)?o:o+".src")},has:r=>Promise.resolve(e.existsSync(r)),get:r=>Promise.resolve(e.readFileSync(r,"utf8")),resolve:r=>Promise.resolve(n.resolve(r))}}};ff.ResourceProvider=Bv});var Hv=m(Qi=>{"use strict";var wB=Qi&&Qi.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{c(r.next(l))}catch(h){o(h)}}function u(l){try{c(r.throw(l))}catch(h){o(h)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})},TB=Qi&&Qi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Qi,"__esModule",{value:!0});Qi.Target=void 0;var EB=TB(require("events")),xB=Vr(),kB=Lv(),BC=tf(),Wv=class extends EB.default{constructor(e){super();let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler,n.context=e.context}parse(){return wB(this,void 0,void 0,function*(){let e=this,n=e.resourceHandler,r=yield n.resolve(e.target);if(!(yield n.has(r)))throw new Error("Target "+r+" does not exist...");let i=e.context,s=yield n.get(r);e.emit("parse-before",r);try{let a=new xB.Parser(s,{filename:r}).parseChunk(),u=new kB.Dependency({target:r,resourceHandler:n,chunk:a,context:i}),{namespaces:c,literals:l}=yield u.findDependencies(),h=new Set(c);for(let d of h)i.variables.createNamespace(d);for(let d of l)i.literals.add(d);return{main:{chunk:a,dependency:u}}}catch(o){throw o instanceof BC.BuildError?o:new BC.BuildError(o.message,{target:this.target,range:o.range})}})}};Qi.Target=Wv});var WC=m(ca=>{"use strict";var AB=ca&&ca.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{c(r.next(l))}catch(h){o(h)}}function u(l){try{c(r.throw(l))}catch(h){o(h)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})};Object.defineProperty(ca,"__esModule",{value:!0});ca.Transpiler=void 0;var CB=zv(),OB=jv(),UC=Jd(),RB=Hu(),PB=Uv(),DB=Hv(),IB=af(),MB=lf(),LB=df(),NB=Object.prototype.hasOwnProperty,Gv=class{constructor(e){let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler||new PB.ResourceProvider().getHandler(),n.obfuscation=NB.call(e,"obfuscation")?e.obfuscation:!0;let r=(0,MB.generateCharsetMap)(n.obfuscation);n.context=new RB.Context({variablesCharset:r.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:r.modules}),n.buildType=e.buildType||UC.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.installer=e.installer||!1,n.environmentVariables=e.environmentVariables||new Map}parse(){return AB(this,void 0,void 0,function*(){let e=this,n=(0,UC.getFactory)(e.buildType),r=e.context,s=yield new DB.Target({target:e.target,resourceHandler:e.resourceHandler,context:e.context}).parse(),o=new IB.Transformer({buildOptions:e.buildOptions,factoryConstructor:n,context:r,environmentVariables:e.environmentVariables,resourceHandler:e.resourceHandler}),a=s.main,u=o.transform(OB.MODULE_BOILERPLATE),c=l=>{let h=r.modules.get(l.getId()),d={},g=0,y=function(k){let T=k.getNamespace();if(!(T in d)){if(T!==h&&k.type===CB.DependencyType.Import){let w=o.transform(k.chunk,k);d[T]=u.replace('"$0"',()=>'"'+T+'"').replace('"$1"',()=>w),g++}for(let w of k.dependencies)y(w)}};y(l);let _=new LB.OutputProcessor(r,o);_.addOptimizations(),g>0&&_.addHeader(),Object.keys(d).forEach(k=>_.addCode(d[k]));let C=o.transform(l.chunk,l);return _.addCode(C,!0),_.build()};return{[e.target]:c(a.dependency)}})}};ca.Transpiler=Gv});var HC=m(pf=>{"use strict";Object.defineProperty(pf,"__esModule",{value:!0});pf.unwrap=void 0;var qB=Te();function jB(t){for(;t instanceof qB.ASTParenthesisExpression;)t=t.expression;return t}pf.unwrap=jB});var zv=m(J=>{"use strict";var GC=J&&J.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),FB=J&&J.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),$B=J&&J.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&GC(e,t,n);return FB(e,t),e},BB=J&&J.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&GC(e,t,n)};Object.defineProperty(J,"__esModule",{value:!0});J.unwrap=J.Stack=J.OutputProcessor=J.NamespaceGenerator=J.merge=J.LiteralsMapper=J.getLiteralValue=J.getLiteralRawValue=J.fetchNamespaces=J.BuildError=J.createExpressionString=J.createExpressionHash=J.generateCharsetMap=J.DependencyType=J.Transpiler=J.Transformer=J.Target=J.DirectTranspiler=J.Dependency=J.ContextDataProperty=J.Context=J.UglifyFactory=J.Factory=J.DefaultFactory=J.BeautifyUtils=J.BeautifyContext=J.BeautifyFactory=J.getFactory=J.BuildType=void 0;var zC=Jd();Object.defineProperty(J,"BuildType",{enumerable:!0,get:function(){return zC.BuildType}});Object.defineProperty(J,"getFactory",{enumerable:!0,get:function(){return zC.getFactory}});var UB=yv();Object.defineProperty(J,"BeautifyFactory",{enumerable:!0,get:function(){return UB.BeautifyFactory}});var WB=hv();Object.defineProperty(J,"BeautifyContext",{enumerable:!0,get:function(){return WB.BeautifyContext}});J.BeautifyUtils=$B(dv());var HB=_v();Object.defineProperty(J,"DefaultFactory",{enumerable:!0,get:function(){return HB.DefaultFactory}});var GB=Fu();Object.defineProperty(J,"Factory",{enumerable:!0,get:function(){return GB.Factory}});var zB=wv();Object.defineProperty(J,"UglifyFactory",{enumerable:!0,get:function(){return zB.UglifyFactory}});var KC=Hu();Object.defineProperty(J,"Context",{enumerable:!0,get:function(){return KC.Context}});Object.defineProperty(J,"ContextDataProperty",{enumerable:!0,get:function(){return KC.ContextDataProperty}});var KB=Lv();Object.defineProperty(J,"Dependency",{enumerable:!0,get:function(){return KB.Dependency}});var VB=$C();Object.defineProperty(J,"DirectTranspiler",{enumerable:!0,get:function(){return VB.DirectTranspiler}});BB(Uv(),J);var XB=Hv();Object.defineProperty(J,"Target",{enumerable:!0,get:function(){return XB.Target}});var YB=af();Object.defineProperty(J,"Transformer",{enumerable:!0,get:function(){return YB.Transformer}});var JB=WC();Object.defineProperty(J,"Transpiler",{enumerable:!0,get:function(){return JB.Transpiler}});var QB=Ov();Object.defineProperty(J,"DependencyType",{enumerable:!0,get:function(){return QB.DependencyType}});var ZB=lf();Object.defineProperty(J,"generateCharsetMap",{enumerable:!0,get:function(){return ZB.generateCharsetMap}});var e2=av();Object.defineProperty(J,"createExpressionHash",{enumerable:!0,get:function(){return e2.createExpressionHash}});var t2=vv();Object.defineProperty(J,"createExpressionString",{enumerable:!0,get:function(){return t2.createExpressionString}});var n2=tf();Object.defineProperty(J,"BuildError",{enumerable:!0,get:function(){return n2.BuildError}});var r2=rf();Object.defineProperty(J,"fetchNamespaces",{enumerable:!0,get:function(){return r2.fetchNamespaces}});var VC=oa();Object.defineProperty(J,"getLiteralRawValue",{enumerable:!0,get:function(){return VC.getLiteralRawValue}});Object.defineProperty(J,"getLiteralValue",{enumerable:!0,get:function(){return VC.getLiteralValue}});var i2=xv();Object.defineProperty(J,"LiteralsMapper",{enumerable:!0,get:function(){return i2.LiteralsMapper}});var s2=Uu();Object.defineProperty(J,"merge",{enumerable:!0,get:function(){return s2.merge}});var o2=Av();Object.defineProperty(J,"NamespaceGenerator",{enumerable:!0,get:function(){return o2.NamespaceGenerator}});var a2=df();Object.defineProperty(J,"OutputProcessor",{enumerable:!0,get:function(){return a2.OutputProcessor}});var u2=pv();Object.defineProperty(J,"Stack",{enumerable:!0,get:function(){return u2.Stack}});var c2=HC();Object.defineProperty(J,"unwrap",{enumerable:!0,get:function(){return c2.unwrap}})});var YC=m(gf=>{"use strict";Object.defineProperty(gf,"__esModule",{value:!0});gf.activate=void 0;var XC=zv();function l2(t){async function e(n){try{let r=t.getConfiguration();return new XC.DirectTranspiler({code:n,buildType:XC.BuildType.BEAUTIFY,buildOptions:{isDevMode:!0,keepParentheses:r.transpiler.beautify.keepParentheses,indentation:r.transpiler.beautify.indentation==="Tab"?0:1,indentationSpaces:r.transpiler.beautify.indentationSpaces}}).parse()}catch{return null}}t.connection.onDocumentFormatting(async n=>{if(!t.getConfiguration().formatter)return;let r=await t.fs.getTextDocument(n.textDocument.uri);if(r==null)return;let i=await t.documentManager.getLatest(r),s=await e(r.getText());return s===null?[]:[{range:{start:{line:0,character:0},end:i.document.end},newText:s}]})}gf.activate=l2});var mf=m((zu,Kv)=>{(function(t,e){if(typeof zu=="object"&&typeof Kv=="object")Kv.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var n=e();for(var r in n)(typeof zu=="object"?zu:t)[r]=n[r]}})(zu,()=>(()=>{"use strict";var t={470:i=>{function s(u){if(typeof u!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(u))}function o(u,c){for(var l,h="",d=0,g=-1,y=0,_=0;_<=u.length;++_){if(_<u.length)l=u.charCodeAt(_);else{if(l===47)break;l=47}if(l===47){if(!(g===_-1||y===1))if(g!==_-1&&y===2){if(h.length<2||d!==2||h.charCodeAt(h.length-1)!==46||h.charCodeAt(h.length-2)!==46){if(h.length>2){var C=h.lastIndexOf("/");if(C!==h.length-1){C===-1?(h="",d=0):d=(h=h.slice(0,C)).length-1-h.lastIndexOf("/"),g=_,y=0;continue}}else if(h.length===2||h.length===1){h="",d=0,g=_,y=0;continue}}c&&(h.length>0?h+="/..":h="..",d=2)}else h.length>0?h+="/"+u.slice(g+1,_):h=u.slice(g+1,_),d=_-g-1;g=_,y=0}else l===46&&y!==-1?++y:y=-1}return h}var a={resolve:function(){for(var u,c="",l=!1,h=arguments.length-1;h>=-1&&!l;h--){var d;h>=0?d=arguments[h]:(u===void 0&&(u=process.cwd()),d=u),s(d),d.length!==0&&(c=d+"/"+c,l=d.charCodeAt(0)===47)}return c=o(c,!l),l?c.length>0?"/"+c:"/":c.length>0?c:"."},normalize:function(u){if(s(u),u.length===0)return".";var c=u.charCodeAt(0)===47,l=u.charCodeAt(u.length-1)===47;return(u=o(u,!c)).length!==0||c||(u="."),u.length>0&&l&&(u+="/"),c?"/"+u:u},isAbsolute:function(u){return s(u),u.length>0&&u.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var u,c=0;c<arguments.length;++c){var l=arguments[c];s(l),l.length>0&&(u===void 0?u=l:u+="/"+l)}return u===void 0?".":a.normalize(u)},relative:function(u,c){if(s(u),s(c),u===c||(u=a.resolve(u))===(c=a.resolve(c)))return"";for(var l=1;l<u.length&&u.charCodeAt(l)===47;++l);for(var h=u.length,d=h-l,g=1;g<c.length&&c.charCodeAt(g)===47;++g);for(var y=c.length-g,_=d<y?d:y,C=-1,k=0;k<=_;++k){if(k===_){if(y>_){if(c.charCodeAt(g+k)===47)return c.slice(g+k+1);if(k===0)return c.slice(g+k)}else d>_&&(u.charCodeAt(l+k)===47?C=k:k===0&&(C=0));break}var T=u.charCodeAt(l+k);if(T!==c.charCodeAt(g+k))break;T===47&&(C=k)}var w="";for(k=l+C+1;k<=h;++k)k!==h&&u.charCodeAt(k)!==47||(w.length===0?w+="..":w+="/..");return w.length>0?w+c.slice(g+C):(g+=C,c.charCodeAt(g)===47&&++g,c.slice(g))},_makeLong:function(u){return u},dirname:function(u){if(s(u),u.length===0)return".";for(var c=u.charCodeAt(0),l=c===47,h=-1,d=!0,g=u.length-1;g>=1;--g)if((c=u.charCodeAt(g))===47){if(!d){h=g;break}}else d=!1;return h===-1?l?"/":".":l&&h===1?"//":u.slice(0,h)},basename:function(u,c){if(c!==void 0&&typeof c!="string")throw new TypeError('"ext" argument must be a string');s(u);var l,h=0,d=-1,g=!0;if(c!==void 0&&c.length>0&&c.length<=u.length){if(c.length===u.length&&c===u)return"";var y=c.length-1,_=-1;for(l=u.length-1;l>=0;--l){var C=u.charCodeAt(l);if(C===47){if(!g){h=l+1;break}}else _===-1&&(g=!1,_=l+1),y>=0&&(C===c.charCodeAt(y)?--y==-1&&(d=l):(y=-1,d=_))}return h===d?d=_:d===-1&&(d=u.length),u.slice(h,d)}for(l=u.length-1;l>=0;--l)if(u.charCodeAt(l)===47){if(!g){h=l+1;break}}else d===-1&&(g=!1,d=l+1);return d===-1?"":u.slice(h,d)},extname:function(u){s(u);for(var c=-1,l=0,h=-1,d=!0,g=0,y=u.length-1;y>=0;--y){var _=u.charCodeAt(y);if(_!==47)h===-1&&(d=!1,h=y+1),_===46?c===-1?c=y:g!==1&&(g=1):c!==-1&&(g=-1);else if(!d){l=y+1;break}}return c===-1||h===-1||g===0||g===1&&c===h-1&&c===l+1?"":u.slice(c,h)},format:function(u){if(u===null||typeof u!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof u);return function(c,l){var h=l.dir||l.root,d=l.base||(l.name||"")+(l.ext||"");return h?h===l.root?h+d:h+"/"+d:d}(0,u)},parse:function(u){s(u);var c={root:"",dir:"",base:"",ext:"",name:""};if(u.length===0)return c;var l,h=u.charCodeAt(0),d=h===47;d?(c.root="/",l=1):l=0;for(var g=-1,y=0,_=-1,C=!0,k=u.length-1,T=0;k>=l;--k)if((h=u.charCodeAt(k))!==47)_===-1&&(C=!1,_=k+1),h===46?g===-1?g=k:T!==1&&(T=1):g!==-1&&(T=-1);else if(!C){y=k+1;break}return g===-1||_===-1||T===0||T===1&&g===_-1&&g===y+1?_!==-1&&(c.base=c.name=y===0&&d?u.slice(1,_):u.slice(y,_)):(y===0&&d?(c.name=u.slice(1,g),c.base=u.slice(1,_)):(c.name=u.slice(y,g),c.base=u.slice(y,_)),c.ext=u.slice(g,_)),y>0?c.dir=u.slice(0,y-1):d&&(c.dir="/"),c},sep:"/",delimiter:":",win32:null,posix:null};a.posix=a,i.exports=a},674:(i,s)=>{if(Object.defineProperty(s,"__esModule",{value:!0}),s.isWindows=void 0,typeof process=="object")s.isWindows=process.platform==="win32";else if(typeof navigator=="object"){let o=navigator.userAgent;s.isWindows=o.indexOf("Windows")>=0}},796:(i,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.uriToFsPath=s.URI=void 0;let a=o(674),u=/^\w[\w\d+.-]*$/,c=/^\//,l=/^\/\//;function h(W,O){if(!W.scheme&&O)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${W.authority}", path: "${W.path}", query: "${W.query}", fragment: "${W.fragment}"}`);if(W.scheme&&!u.test(W.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(W.path){if(W.authority){if(!c.test(W.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(l.test(W.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}let d="",g="/",y=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class _{static isUri(O){return O instanceof _||!!O&&typeof O.authority=="string"&&typeof O.fragment=="string"&&typeof O.path=="string"&&typeof O.query=="string"&&typeof O.scheme=="string"&&typeof O.fsPath=="string"&&typeof O.with=="function"&&typeof O.toString=="function"}scheme;authority;path;query;fragment;constructor(O,M,N,j,fe,he=!1){typeof O=="object"?(this.scheme=O.scheme||d,this.authority=O.authority||d,this.path=O.path||d,this.query=O.query||d,this.fragment=O.fragment||d):(this.scheme=function(Nt,bt){return Nt||bt?Nt:"file"}(O,he),this.authority=M||d,this.path=function(Nt,bt){switch(Nt){case"https":case"http":case"file":bt?bt[0]!==g&&(bt=g+bt):bt=g}return bt}(this.scheme,N||d),this.query=j||d,this.fragment=fe||d,h(this,he))}get fsPath(){return L(this,!1)}with(O){if(!O)return this;let{scheme:M,authority:N,path:j,query:fe,fragment:he}=O;return M===void 0?M=this.scheme:M===null&&(M=d),N===void 0?N=this.authority:N===null&&(N=d),j===void 0?j=this.path:j===null&&(j=d),fe===void 0?fe=this.query:fe===null&&(fe=d),he===void 0?he=this.fragment:he===null&&(he=d),M===this.scheme&&N===this.authority&&j===this.path&&fe===this.query&&he===this.fragment?this:new k(M,N,j,fe,he)}static parse(O,M=!1){let N=y.exec(O);return N?new k(N[2]||d,se(N[4]||d),se(N[5]||d),se(N[7]||d),se(N[9]||d),M):new k(d,d,d,d,d)}static file(O){let M=d;if(a.isWindows&&(O=O.replace(/\\/g,g)),O[0]===g&&O[1]===g){let N=O.indexOf(g,2);N===-1?(M=O.substring(2),O=g):(M=O.substring(2,N),O=O.substring(N)||g)}return new k("file",M,O,d,d)}static from(O){let M=new k(O.scheme,O.authority,O.path,O.query,O.fragment);return h(M,!0),M}toString(O=!1){return R(this,O)}toJSON(){return this}static revive(O){if(O){if(O instanceof _)return O;{let M=new k(O);return M._formatted=O.external,M._fsPath=O._sep===C?O.fsPath:null,M}}return O}}s.URI=_;let C=a.isWindows?1:void 0;class k extends _{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=L(this,!1)),this._fsPath}toString(O=!1){return O?R(this,!0):(this._formatted||(this._formatted=R(this,!1)),this._formatted)}toJSON(){let O={$mid:1};return this._fsPath&&(O.fsPath=this._fsPath,O._sep=C),this._formatted&&(O.external=this._formatted),this.path&&(O.path=this.path),this.scheme&&(O.scheme=this.scheme),this.authority&&(O.authority=this.authority),this.query&&(O.query=this.query),this.fragment&&(O.fragment=this.fragment),O}}let T={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function w(W,O,M){let N,j=-1;for(let fe=0;fe<W.length;fe++){let he=W.charCodeAt(fe);if(he>=97&&he<=122||he>=65&&he<=90||he>=48&&he<=57||he===45||he===46||he===95||he===126||O&&he===47||M&&he===91||M&&he===93||M&&he===58)j!==-1&&(N+=encodeURIComponent(W.substring(j,fe)),j=-1),N!==void 0&&(N+=W.charAt(fe));else{N===void 0&&(N=W.substr(0,fe));let Nt=T[he];Nt!==void 0?(j!==-1&&(N+=encodeURIComponent(W.substring(j,fe)),j=-1),N+=Nt):j===-1&&(j=fe)}}return j!==-1&&(N+=encodeURIComponent(W.substring(j))),N!==void 0?N:W}function v(W){let O;for(let M=0;M<W.length;M++){let N=W.charCodeAt(M);N===35||N===63?(O===void 0&&(O=W.substr(0,M)),O+=T[N]):O!==void 0&&(O+=W[M])}return O!==void 0?O:W}function L(W,O){let M;return M=W.authority&&W.path.length>1&&W.scheme==="file"?`//${W.authority}${W.path}`:W.path.charCodeAt(0)===47&&(W.path.charCodeAt(1)>=65&&W.path.charCodeAt(1)<=90||W.path.charCodeAt(1)>=97&&W.path.charCodeAt(1)<=122)&&W.path.charCodeAt(2)===58?O?W.path.substr(1):W.path[1].toLowerCase()+W.path.substr(2):W.path,a.isWindows&&(M=M.replace(/\//g,"\\")),M}function R(W,O){let M=O?v:w,N="",{scheme:j,authority:fe,path:he,query:Nt,fragment:bt}=W;if(j&&(N+=j,N+=":"),(fe||j==="file")&&(N+=g,N+=g),fe){let $e=fe.indexOf("@");if($e!==-1){let yn=fe.substr(0,$e);fe=fe.substr($e+1),$e=yn.lastIndexOf(":"),$e===-1?N+=M(yn,!1,!1):(N+=M(yn.substr(0,$e),!1,!1),N+=":",N+=M(yn.substr($e+1),!1,!0)),N+="@"}fe=fe.toLowerCase(),$e=fe.lastIndexOf(":"),$e===-1?N+=M(fe,!1,!0):(N+=M(fe.substr(0,$e),!1,!0),N+=fe.substr($e))}if(he){if(he.length>=3&&he.charCodeAt(0)===47&&he.charCodeAt(2)===58){let $e=he.charCodeAt(1);$e>=65&&$e<=90&&(he=`/${String.fromCharCode($e+32)}:${he.substr(3)}`)}else if(he.length>=2&&he.charCodeAt(1)===58){let $e=he.charCodeAt(0);$e>=65&&$e<=90&&(he=`${String.fromCharCode($e+32)}:${he.substr(2)}`)}N+=M(he,!0,!1)}return Nt&&(N+="?",N+=M(Nt,!1,!1)),bt&&(N+="#",N+=O?bt:w(bt,!1,!1)),N}function U(W){try{return decodeURIComponent(W)}catch{return W.length>3?W.substr(0,3)+U(W.substr(3)):W}}s.uriToFsPath=L;let te=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function se(W){return W.match(te)?W.replace(te,O=>U(O)):W}},679:function(i,s,o){var a=this&&this.__createBinding||(Object.create?function(y,_,C,k){k===void 0&&(k=C);var T=Object.getOwnPropertyDescriptor(_,C);T&&!("get"in T?!_.__esModule:T.writable||T.configurable)||(T={enumerable:!0,get:function(){return _[C]}}),Object.defineProperty(y,k,T)}:function(y,_,C,k){k===void 0&&(k=C),y[k]=_[C]}),u=this&&this.__setModuleDefault||(Object.create?function(y,_){Object.defineProperty(y,"default",{enumerable:!0,value:_})}:function(y,_){y.default=_}),c=this&&this.__importStar||function(y){if(y&&y.__esModule)return y;var _={};if(y!=null)for(var C in y)C!=="default"&&Object.prototype.hasOwnProperty.call(y,C)&&a(_,y,C);return u(_,y),_};Object.defineProperty(s,"__esModule",{value:!0}),s.Utils=void 0;let l=c(o(470)),h=l.posix||l,d="/";var g;(function(y){y.joinPath=function(_,...C){return _.with({path:h.join(_.path,...C)})},y.resolvePath=function(_,...C){let k=_.path,T=!1;k[0]!==d&&(k=d+k,T=!0);let w=h.resolve(k,...C);return T&&w[0]===d&&!_.authority&&(w=w.substring(1)),_.with({path:w})},y.dirname=function(_){if(_.path.length===0||_.path===d)return _;let C=h.dirname(_.path);return C.length===1&&C.charCodeAt(0)===46&&(C=""),_.with({path:C})},y.basename=function(_){return h.basename(_.path)},y.extname=function(_){return h.extname(_.path)}})(g||(s.Utils=g={}))}},e={};function n(i){var s=e[i];if(s!==void 0)return s.exports;var o=e[i]={exports:{}};return t[i].call(o.exports,o,o.exports,n),o.exports}var r={};return(()=>{var i=r;Object.defineProperty(i,"__esModule",{value:!0}),i.Utils=i.URI=void 0;let s=n(796);Object.defineProperty(i,"URI",{enumerable:!0,get:function(){return s.URI}});let o=n(679);Object.defineProperty(i,"Utils",{enumerable:!0,get:function(){return o.Utils}})})(),r})())});var bf=m(yf=>{"use strict";Object.defineProperty(yf,"__esModule",{value:!0});yf.MarkdownString=void 0;var Vv=class{constructor(e=""){this.sanitize=!0,this.value=e}appendText(e){return this.value+=e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&"),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,n){return this.value+="\n```",this.value+=e,this.value+=`
141
- `,this.value+=n,this.value+="\n```\n",this}toString(){return this.value}};yf.MarkdownString=Vv});var _f=m(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.createHover=ct.createSignatureInfo=ct.appendTooltipBody=ct.appendTooltipHeader=ct.createTooltipHeader=ct.formatDefaultValue=ct.formatTypes=ct.formatKind=void 0;var or=Xo(),JC=gs(),QC=bf(),h2={[or.CompletionItemKind.Constant]:"constant",[or.CompletionItemKind.Expression]:"expr",[or.CompletionItemKind.Function]:"function",[or.CompletionItemKind.Internal]:"internal",[or.CompletionItemKind.InternalFunction]:"function",[or.CompletionItemKind.InternalProperty]:"var",[or.CompletionItemKind.ListConstructor]:"list",[or.CompletionItemKind.Literal]:"literal",[or.CompletionItemKind.MapConstructor]:"map",[or.CompletionItemKind.Property]:"var",[or.CompletionItemKind.Unknown]:"unknown",[or.CompletionItemKind.Variable]:"var"};function Xv(t){return h2[t]||"unknown"}ct.formatKind=Xv;function Yv(t){return t==null?"":t.map(e=>e.toString().replace(",","\u066B")).join(" or ")}ct.formatTypes=Yv;function ZC(t){return typeof t=="string"?`"${t}"`:t.toString()}ct.formatDefaultValue=ZC;var d2=(t,e)=>{let n=e.getArguments()||[],r=Yv(e.getReturns())||"null";if(n.length===0)return`(${Xv(t.kind)}) ${t.label} (): ${r}`;let i=n.map(s=>`${s.getLabel()}${s.isOptional()?"?":""}: ${Yv(s.getTypes())}${s.getDefault()?` = ${ZC(s.getDefault().value)}`:""}`).join(", ");return`(${Xv(t.kind)}) ${t.label} (${i}): ${r}`};ct.createTooltipHeader=d2;var f2=(t,e,n)=>{t.appendCodeblock(JC.LanguageId,(0,ct.createTooltipHeader)(e,n)),t.appendMarkdown(`***
142
- `)};ct.appendTooltipHeader=f2;var p2=(t,e)=>{let n=e.getExample()||[];t.appendMarkdown(e.getDescription()+`
139
+ end function`).parseChunk();ns.MAIN_BOILERPLATE=new Yv.Parser('"$0"').parseChunk()});var Sf=m(vf=>{"use strict";Object.defineProperty(vf,"__esModule",{value:!0});vf.OutputProcessor=void 0;var XC=Jv(),jB=Gu(),Qv=class{constructor(e,n,{header:r=XC.HEADER_BOILERPLATE,main:i=XC.MAIN_BOILERPLATE}={}){this.context=e,this.transformer=n,this.processed=[],this.headerBoilerplate=this.transformer.transform(r),this.mainBoilerplate=this.transformer.transform(i)}addOptimizations(){return(0,jB.merge)(this.processed,this.transformer.factory.generateOptimizations()),this}addHeader(){return this.processed.push(this.headerBoilerplate),this}addCode(e,n=!1){if(n){let r=this.mainBoilerplate.replace('"$0"',()=>e);this.processed.push(r)}else this.processed.push(e);return this}build(){return this.processed.join(`
140
+ `)}};vf.OutputProcessor=Qv});var JC=m(ca=>{"use strict";var FB=ca&&ca.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ca,"__esModule",{value:!0});ca.DirectTranspiler=void 0;var $B=FB(require("events")),BB=Yr(),YC=af(),WB=Ku(),UB=mf(),HB=_f(),GB=ff(),zB=Sf(),KB=Object.prototype.hasOwnProperty,Zv=class extends $B.default{constructor(e){super();let n=this;n.code=e.code,n.obfuscation=KB.call(e,"obfuscation")?e.obfuscation:!0,n.buildType=e.buildType||YC.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.environmentVariables=e.environmentVariables||new Map,n.excludedNamespaces=e.excludedNamespaces||[]}parse(){let e=this,n=(0,YC.getFactory)(e.buildType),i=new BB.Parser(e.code).parseChunk(),s=(0,GB.fetchNamespaces)(i),o=[].concat(i.literals),a=(0,HB.generateCharsetMap)(e.obfuscation),u=new WB.Context({variablesCharset:a.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:a.modules});new Set(s).forEach(g=>u.variables.createNamespace(g)),o.forEach(g=>u.literals.add(g));let l=new UB.Transformer({buildOptions:e.buildOptions,factoryConstructor:n,context:u,environmentVariables:e.environmentVariables}),h=new zB.OutputProcessor(u,l);h.addOptimizations();let d=l.transform(i);return h.addCode(d),h.build()}};ca.DirectTranspiler=Zv});var tS=m(wf=>{"use strict";Object.defineProperty(wf,"__esModule",{value:!0});wf.ResourceProvider=void 0;var eS=class{getHandler(){let e=require("fs"),n=require("path");return{getTargetRelativeTo:(r,i)=>{let s=n.resolve(r,".."),o=n.resolve(s,i);return Promise.resolve(e.existsSync(o)?o:o+".src")},has:r=>Promise.resolve(e.existsSync(r)),get:r=>Promise.resolve(e.readFileSync(r,"utf8")),resolve:r=>Promise.resolve(n.resolve(r))}}};wf.ResourceProvider=eS});var rS=m(rs=>{"use strict";var VB=rs&&rs.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{c(r.next(l))}catch(h){o(h)}}function u(l){try{c(r.throw(l))}catch(h){o(h)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})},XB=rs&&rs.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(rs,"__esModule",{value:!0});rs.Target=void 0;var YB=XB(require("events")),JB=Yr(),QB=Vv(),QC=hf(),nS=class extends YB.default{constructor(e){super();let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler,n.context=e.context}parse(){return VB(this,void 0,void 0,function*(){let e=this,n=e.resourceHandler,r=yield n.resolve(e.target);if(!(yield n.has(r)))throw new Error("Target "+r+" does not exist...");let i=e.context,s=yield n.get(r);e.emit("parse-before",r);try{let a=new JB.Parser(s,{filename:r}).parseChunk(),u=new QB.Dependency({target:r,resourceHandler:n,chunk:a,context:i}),{namespaces:c,literals:l}=yield u.findDependencies(),h=new Set(c);for(let d of h)i.variables.createNamespace(d);for(let d of l)i.literals.add(d);return{main:{chunk:a,dependency:u}}}catch(o){throw o instanceof QC.BuildError?o:new QC.BuildError(o.message,{target:this.target,range:o.range})}})}};rs.Target=nS});var eO=m(la=>{"use strict";var ZB=la&&la.__awaiter||function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{c(r.next(l))}catch(h){o(h)}}function u(l){try{c(r.throw(l))}catch(h){o(h)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})};Object.defineProperty(la,"__esModule",{value:!0});la.Transpiler=void 0;var e2=sS(),t2=Jv(),ZC=af(),n2=Ku(),r2=tS(),i2=rS(),s2=mf(),o2=_f(),a2=Sf(),u2=Object.prototype.hasOwnProperty,iS=class{constructor(e){let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler||new r2.ResourceProvider().getHandler(),n.obfuscation=u2.call(e,"obfuscation")?e.obfuscation:!0;let r=(0,o2.generateCharsetMap)(n.obfuscation);n.context=new n2.Context({variablesCharset:r.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:r.modules}),n.buildType=e.buildType||ZC.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.installer=e.installer||!1,n.environmentVariables=e.environmentVariables||new Map}parse(){return ZB(this,void 0,void 0,function*(){let e=this,n=(0,ZC.getFactory)(e.buildType),r=e.context,s=yield new i2.Target({target:e.target,resourceHandler:e.resourceHandler,context:e.context}).parse(),o=new s2.Transformer({buildOptions:e.buildOptions,factoryConstructor:n,context:r,environmentVariables:e.environmentVariables,resourceHandler:e.resourceHandler}),a=s.main,u=o.transform(t2.MODULE_BOILERPLATE),c=l=>{let h=r.modules.get(l.getId()),d={},g=0,y=function(k){let T=k.getNamespace();if(!(T in d)){if(T!==h&&k.type===e2.DependencyType.Import){let w=o.transform(k.chunk,k);d[T]=u.replace('"$0"',()=>'"'+T+'"').replace('"$1"',()=>w),g++}for(let w of k.dependencies)y(w)}};y(l);let _=new a2.OutputProcessor(r,o);_.addOptimizations(),g>0&&_.addHeader(),Object.keys(d).forEach(k=>_.addCode(d[k]));let C=o.transform(l.chunk,l);return _.addCode(C,!0),_.build()};return{[e.target]:c(a.dependency)}})}};la.Transpiler=iS});var tO=m(Tf=>{"use strict";Object.defineProperty(Tf,"__esModule",{value:!0});Tf.unwrap=void 0;var c2=ke();function l2(t){for(;t instanceof c2.ASTParenthesisExpression;)t=t.expression;return t}Tf.unwrap=l2});var sS=m(J=>{"use strict";var nO=J&&J.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),h2=J&&J.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),d2=J&&J.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&nO(e,t,n);return h2(e,t),e},f2=J&&J.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&nO(e,t,n)};Object.defineProperty(J,"__esModule",{value:!0});J.unwrap=J.Stack=J.OutputProcessor=J.NamespaceGenerator=J.merge=J.LiteralsMapper=J.getLiteralValue=J.getLiteralRawValue=J.fetchNamespaces=J.BuildError=J.createExpressionString=J.createExpressionHash=J.generateCharsetMap=J.DependencyType=J.Transpiler=J.Transformer=J.Target=J.DirectTranspiler=J.Dependency=J.ContextDataProperty=J.Context=J.UglifyFactory=J.Factory=J.DefaultFactory=J.BeautifyUtils=J.BeautifyContext=J.BeautifyFactory=J.getFactory=J.BuildType=void 0;var rO=af();Object.defineProperty(J,"BuildType",{enumerable:!0,get:function(){return rO.BuildType}});Object.defineProperty(J,"getFactory",{enumerable:!0,get:function(){return rO.getFactory}});var p2=Rv();Object.defineProperty(J,"BeautifyFactory",{enumerable:!0,get:function(){return p2.BeautifyFactory}});var g2=Ev();Object.defineProperty(J,"BeautifyContext",{enumerable:!0,get:function(){return g2.BeautifyContext}});J.BeautifyUtils=d2(xv());var m2=Dv();Object.defineProperty(J,"DefaultFactory",{enumerable:!0,get:function(){return m2.DefaultFactory}});var y2=Wu();Object.defineProperty(J,"Factory",{enumerable:!0,get:function(){return y2.Factory}});var b2=Lv();Object.defineProperty(J,"UglifyFactory",{enumerable:!0,get:function(){return b2.UglifyFactory}});var iO=Ku();Object.defineProperty(J,"Context",{enumerable:!0,get:function(){return iO.Context}});Object.defineProperty(J,"ContextDataProperty",{enumerable:!0,get:function(){return iO.ContextDataProperty}});var _2=Vv();Object.defineProperty(J,"Dependency",{enumerable:!0,get:function(){return _2.Dependency}});var v2=JC();Object.defineProperty(J,"DirectTranspiler",{enumerable:!0,get:function(){return v2.DirectTranspiler}});f2(tS(),J);var S2=rS();Object.defineProperty(J,"Target",{enumerable:!0,get:function(){return S2.Target}});var w2=mf();Object.defineProperty(J,"Transformer",{enumerable:!0,get:function(){return w2.Transformer}});var T2=eO();Object.defineProperty(J,"Transpiler",{enumerable:!0,get:function(){return T2.Transpiler}});var E2=Wv();Object.defineProperty(J,"DependencyType",{enumerable:!0,get:function(){return E2.DependencyType}});var x2=_f();Object.defineProperty(J,"generateCharsetMap",{enumerable:!0,get:function(){return x2.generateCharsetMap}});var k2=vv();Object.defineProperty(J,"createExpressionHash",{enumerable:!0,get:function(){return k2.createExpressionHash}});var A2=Iv();Object.defineProperty(J,"createExpressionString",{enumerable:!0,get:function(){return A2.createExpressionString}});var C2=hf();Object.defineProperty(J,"BuildError",{enumerable:!0,get:function(){return C2.BuildError}});var O2=ff();Object.defineProperty(J,"fetchNamespaces",{enumerable:!0,get:function(){return O2.fetchNamespaces}});var sO=aa();Object.defineProperty(J,"getLiteralRawValue",{enumerable:!0,get:function(){return sO.getLiteralRawValue}});Object.defineProperty(J,"getLiteralValue",{enumerable:!0,get:function(){return sO.getLiteralValue}});var R2=jv();Object.defineProperty(J,"LiteralsMapper",{enumerable:!0,get:function(){return R2.LiteralsMapper}});var P2=Gu();Object.defineProperty(J,"merge",{enumerable:!0,get:function(){return P2.merge}});var D2=$v();Object.defineProperty(J,"NamespaceGenerator",{enumerable:!0,get:function(){return D2.NamespaceGenerator}});var I2=Sf();Object.defineProperty(J,"OutputProcessor",{enumerable:!0,get:function(){return I2.OutputProcessor}});var M2=Av();Object.defineProperty(J,"Stack",{enumerable:!0,get:function(){return M2.Stack}});var L2=tO();Object.defineProperty(J,"unwrap",{enumerable:!0,get:function(){return L2.unwrap}})});var aO=m(Ef=>{"use strict";Object.defineProperty(Ef,"__esModule",{value:!0});Ef.activate=void 0;var oO=sS();function N2(t){async function e(n){try{let r=t.getConfiguration();return new oO.DirectTranspiler({code:n,buildType:oO.BuildType.BEAUTIFY,buildOptions:{isDevMode:!0,keepParentheses:r.transpiler.beautify.keepParentheses,indentation:r.transpiler.beautify.indentation==="Tab"?0:1,indentationSpaces:r.transpiler.beautify.indentationSpaces}}).parse()}catch{return null}}t.connection.onDocumentFormatting(async n=>{if(!t.getConfiguration().formatter)return;let r=await t.fs.getTextDocument(n.textDocument.uri);if(r==null)return;let i=await t.documentManager.getLatest(r),s=await e(r.getText());return s===null?[]:[{range:{start:{line:0,character:0},end:i.document.end},newText:s}]})}Ef.activate=N2});var xf=m((Xu,oS)=>{(function(t,e){if(typeof Xu=="object"&&typeof oS=="object")oS.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var n=e();for(var r in n)(typeof Xu=="object"?Xu:t)[r]=n[r]}})(Xu,()=>(()=>{"use strict";var t={470:i=>{function s(u){if(typeof u!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(u))}function o(u,c){for(var l,h="",d=0,g=-1,y=0,_=0;_<=u.length;++_){if(_<u.length)l=u.charCodeAt(_);else{if(l===47)break;l=47}if(l===47){if(!(g===_-1||y===1))if(g!==_-1&&y===2){if(h.length<2||d!==2||h.charCodeAt(h.length-1)!==46||h.charCodeAt(h.length-2)!==46){if(h.length>2){var C=h.lastIndexOf("/");if(C!==h.length-1){C===-1?(h="",d=0):d=(h=h.slice(0,C)).length-1-h.lastIndexOf("/"),g=_,y=0;continue}}else if(h.length===2||h.length===1){h="",d=0,g=_,y=0;continue}}c&&(h.length>0?h+="/..":h="..",d=2)}else h.length>0?h+="/"+u.slice(g+1,_):h=u.slice(g+1,_),d=_-g-1;g=_,y=0}else l===46&&y!==-1?++y:y=-1}return h}var a={resolve:function(){for(var u,c="",l=!1,h=arguments.length-1;h>=-1&&!l;h--){var d;h>=0?d=arguments[h]:(u===void 0&&(u=process.cwd()),d=u),s(d),d.length!==0&&(c=d+"/"+c,l=d.charCodeAt(0)===47)}return c=o(c,!l),l?c.length>0?"/"+c:"/":c.length>0?c:"."},normalize:function(u){if(s(u),u.length===0)return".";var c=u.charCodeAt(0)===47,l=u.charCodeAt(u.length-1)===47;return(u=o(u,!c)).length!==0||c||(u="."),u.length>0&&l&&(u+="/"),c?"/"+u:u},isAbsolute:function(u){return s(u),u.length>0&&u.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var u,c=0;c<arguments.length;++c){var l=arguments[c];s(l),l.length>0&&(u===void 0?u=l:u+="/"+l)}return u===void 0?".":a.normalize(u)},relative:function(u,c){if(s(u),s(c),u===c||(u=a.resolve(u))===(c=a.resolve(c)))return"";for(var l=1;l<u.length&&u.charCodeAt(l)===47;++l);for(var h=u.length,d=h-l,g=1;g<c.length&&c.charCodeAt(g)===47;++g);for(var y=c.length-g,_=d<y?d:y,C=-1,k=0;k<=_;++k){if(k===_){if(y>_){if(c.charCodeAt(g+k)===47)return c.slice(g+k+1);if(k===0)return c.slice(g+k)}else d>_&&(u.charCodeAt(l+k)===47?C=k:k===0&&(C=0));break}var T=u.charCodeAt(l+k);if(T!==c.charCodeAt(g+k))break;T===47&&(C=k)}var w="";for(k=l+C+1;k<=h;++k)k!==h&&u.charCodeAt(k)!==47||(w.length===0?w+="..":w+="/..");return w.length>0?w+c.slice(g+C):(g+=C,c.charCodeAt(g)===47&&++g,c.slice(g))},_makeLong:function(u){return u},dirname:function(u){if(s(u),u.length===0)return".";for(var c=u.charCodeAt(0),l=c===47,h=-1,d=!0,g=u.length-1;g>=1;--g)if((c=u.charCodeAt(g))===47){if(!d){h=g;break}}else d=!1;return h===-1?l?"/":".":l&&h===1?"//":u.slice(0,h)},basename:function(u,c){if(c!==void 0&&typeof c!="string")throw new TypeError('"ext" argument must be a string');s(u);var l,h=0,d=-1,g=!0;if(c!==void 0&&c.length>0&&c.length<=u.length){if(c.length===u.length&&c===u)return"";var y=c.length-1,_=-1;for(l=u.length-1;l>=0;--l){var C=u.charCodeAt(l);if(C===47){if(!g){h=l+1;break}}else _===-1&&(g=!1,_=l+1),y>=0&&(C===c.charCodeAt(y)?--y==-1&&(d=l):(y=-1,d=_))}return h===d?d=_:d===-1&&(d=u.length),u.slice(h,d)}for(l=u.length-1;l>=0;--l)if(u.charCodeAt(l)===47){if(!g){h=l+1;break}}else d===-1&&(g=!1,d=l+1);return d===-1?"":u.slice(h,d)},extname:function(u){s(u);for(var c=-1,l=0,h=-1,d=!0,g=0,y=u.length-1;y>=0;--y){var _=u.charCodeAt(y);if(_!==47)h===-1&&(d=!1,h=y+1),_===46?c===-1?c=y:g!==1&&(g=1):c!==-1&&(g=-1);else if(!d){l=y+1;break}}return c===-1||h===-1||g===0||g===1&&c===h-1&&c===l+1?"":u.slice(c,h)},format:function(u){if(u===null||typeof u!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof u);return function(c,l){var h=l.dir||l.root,d=l.base||(l.name||"")+(l.ext||"");return h?h===l.root?h+d:h+"/"+d:d}(0,u)},parse:function(u){s(u);var c={root:"",dir:"",base:"",ext:"",name:""};if(u.length===0)return c;var l,h=u.charCodeAt(0),d=h===47;d?(c.root="/",l=1):l=0;for(var g=-1,y=0,_=-1,C=!0,k=u.length-1,T=0;k>=l;--k)if((h=u.charCodeAt(k))!==47)_===-1&&(C=!1,_=k+1),h===46?g===-1?g=k:T!==1&&(T=1):g!==-1&&(T=-1);else if(!C){y=k+1;break}return g===-1||_===-1||T===0||T===1&&g===_-1&&g===y+1?_!==-1&&(c.base=c.name=y===0&&d?u.slice(1,_):u.slice(y,_)):(y===0&&d?(c.name=u.slice(1,g),c.base=u.slice(1,_)):(c.name=u.slice(y,g),c.base=u.slice(y,_)),c.ext=u.slice(g,_)),y>0?c.dir=u.slice(0,y-1):d&&(c.dir="/"),c},sep:"/",delimiter:":",win32:null,posix:null};a.posix=a,i.exports=a},674:(i,s)=>{if(Object.defineProperty(s,"__esModule",{value:!0}),s.isWindows=void 0,typeof process=="object")s.isWindows=process.platform==="win32";else if(typeof navigator=="object"){let o=navigator.userAgent;s.isWindows=o.indexOf("Windows")>=0}},796:(i,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.uriToFsPath=s.URI=void 0;let a=o(674),u=/^\w[\w\d+.-]*$/,c=/^\//,l=/^\/\//;function h(U,O){if(!U.scheme&&O)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${U.authority}", path: "${U.path}", query: "${U.query}", fragment: "${U.fragment}"}`);if(U.scheme&&!u.test(U.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(U.path){if(U.authority){if(!c.test(U.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(l.test(U.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}let d="",g="/",y=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class _{static isUri(O){return O instanceof _||!!O&&typeof O.authority=="string"&&typeof O.fragment=="string"&&typeof O.path=="string"&&typeof O.query=="string"&&typeof O.scheme=="string"&&typeof O.fsPath=="string"&&typeof O.with=="function"&&typeof O.toString=="function"}scheme;authority;path;query;fragment;constructor(O,M,N,j,fe,he=!1){typeof O=="object"?(this.scheme=O.scheme||d,this.authority=O.authority||d,this.path=O.path||d,this.query=O.query||d,this.fragment=O.fragment||d):(this.scheme=function(jt,_t){return jt||_t?jt:"file"}(O,he),this.authority=M||d,this.path=function(jt,_t){switch(jt){case"https":case"http":case"file":_t?_t[0]!==g&&(_t=g+_t):_t=g}return _t}(this.scheme,N||d),this.query=j||d,this.fragment=fe||d,h(this,he))}get fsPath(){return L(this,!1)}with(O){if(!O)return this;let{scheme:M,authority:N,path:j,query:fe,fragment:he}=O;return M===void 0?M=this.scheme:M===null&&(M=d),N===void 0?N=this.authority:N===null&&(N=d),j===void 0?j=this.path:j===null&&(j=d),fe===void 0?fe=this.query:fe===null&&(fe=d),he===void 0?he=this.fragment:he===null&&(he=d),M===this.scheme&&N===this.authority&&j===this.path&&fe===this.query&&he===this.fragment?this:new k(M,N,j,fe,he)}static parse(O,M=!1){let N=y.exec(O);return N?new k(N[2]||d,se(N[4]||d),se(N[5]||d),se(N[7]||d),se(N[9]||d),M):new k(d,d,d,d,d)}static file(O){let M=d;if(a.isWindows&&(O=O.replace(/\\/g,g)),O[0]===g&&O[1]===g){let N=O.indexOf(g,2);N===-1?(M=O.substring(2),O=g):(M=O.substring(2,N),O=O.substring(N)||g)}return new k("file",M,O,d,d)}static from(O){let M=new k(O.scheme,O.authority,O.path,O.query,O.fragment);return h(M,!0),M}toString(O=!1){return R(this,O)}toJSON(){return this}static revive(O){if(O){if(O instanceof _)return O;{let M=new k(O);return M._formatted=O.external,M._fsPath=O._sep===C?O.fsPath:null,M}}return O}}s.URI=_;let C=a.isWindows?1:void 0;class k extends _{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=L(this,!1)),this._fsPath}toString(O=!1){return O?R(this,!0):(this._formatted||(this._formatted=R(this,!1)),this._formatted)}toJSON(){let O={$mid:1};return this._fsPath&&(O.fsPath=this._fsPath,O._sep=C),this._formatted&&(O.external=this._formatted),this.path&&(O.path=this.path),this.scheme&&(O.scheme=this.scheme),this.authority&&(O.authority=this.authority),this.query&&(O.query=this.query),this.fragment&&(O.fragment=this.fragment),O}}let T={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function w(U,O,M){let N,j=-1;for(let fe=0;fe<U.length;fe++){let he=U.charCodeAt(fe);if(he>=97&&he<=122||he>=65&&he<=90||he>=48&&he<=57||he===45||he===46||he===95||he===126||O&&he===47||M&&he===91||M&&he===93||M&&he===58)j!==-1&&(N+=encodeURIComponent(U.substring(j,fe)),j=-1),N!==void 0&&(N+=U.charAt(fe));else{N===void 0&&(N=U.substr(0,fe));let jt=T[he];jt!==void 0?(j!==-1&&(N+=encodeURIComponent(U.substring(j,fe)),j=-1),N+=jt):j===-1&&(j=fe)}}return j!==-1&&(N+=encodeURIComponent(U.substring(j))),N!==void 0?N:U}function v(U){let O;for(let M=0;M<U.length;M++){let N=U.charCodeAt(M);N===35||N===63?(O===void 0&&(O=U.substr(0,M)),O+=T[N]):O!==void 0&&(O+=U[M])}return O!==void 0?O:U}function L(U,O){let M;return M=U.authority&&U.path.length>1&&U.scheme==="file"?`//${U.authority}${U.path}`:U.path.charCodeAt(0)===47&&(U.path.charCodeAt(1)>=65&&U.path.charCodeAt(1)<=90||U.path.charCodeAt(1)>=97&&U.path.charCodeAt(1)<=122)&&U.path.charCodeAt(2)===58?O?U.path.substr(1):U.path[1].toLowerCase()+U.path.substr(2):U.path,a.isWindows&&(M=M.replace(/\//g,"\\")),M}function R(U,O){let M=O?v:w,N="",{scheme:j,authority:fe,path:he,query:jt,fragment:_t}=U;if(j&&(N+=j,N+=":"),(fe||j==="file")&&(N+=g,N+=g),fe){let $e=fe.indexOf("@");if($e!==-1){let _n=fe.substr(0,$e);fe=fe.substr($e+1),$e=_n.lastIndexOf(":"),$e===-1?N+=M(_n,!1,!1):(N+=M(_n.substr(0,$e),!1,!1),N+=":",N+=M(_n.substr($e+1),!1,!0)),N+="@"}fe=fe.toLowerCase(),$e=fe.lastIndexOf(":"),$e===-1?N+=M(fe,!1,!0):(N+=M(fe.substr(0,$e),!1,!0),N+=fe.substr($e))}if(he){if(he.length>=3&&he.charCodeAt(0)===47&&he.charCodeAt(2)===58){let $e=he.charCodeAt(1);$e>=65&&$e<=90&&(he=`/${String.fromCharCode($e+32)}:${he.substr(3)}`)}else if(he.length>=2&&he.charCodeAt(1)===58){let $e=he.charCodeAt(0);$e>=65&&$e<=90&&(he=`${String.fromCharCode($e+32)}:${he.substr(2)}`)}N+=M(he,!0,!1)}return jt&&(N+="?",N+=M(jt,!1,!1)),_t&&(N+="#",N+=O?_t:w(_t,!1,!1)),N}function W(U){try{return decodeURIComponent(U)}catch{return U.length>3?U.substr(0,3)+W(U.substr(3)):U}}s.uriToFsPath=L;let ne=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function se(U){return U.match(ne)?U.replace(ne,O=>W(O)):U}},679:function(i,s,o){var a=this&&this.__createBinding||(Object.create?function(y,_,C,k){k===void 0&&(k=C);var T=Object.getOwnPropertyDescriptor(_,C);T&&!("get"in T?!_.__esModule:T.writable||T.configurable)||(T={enumerable:!0,get:function(){return _[C]}}),Object.defineProperty(y,k,T)}:function(y,_,C,k){k===void 0&&(k=C),y[k]=_[C]}),u=this&&this.__setModuleDefault||(Object.create?function(y,_){Object.defineProperty(y,"default",{enumerable:!0,value:_})}:function(y,_){y.default=_}),c=this&&this.__importStar||function(y){if(y&&y.__esModule)return y;var _={};if(y!=null)for(var C in y)C!=="default"&&Object.prototype.hasOwnProperty.call(y,C)&&a(_,y,C);return u(_,y),_};Object.defineProperty(s,"__esModule",{value:!0}),s.Utils=void 0;let l=c(o(470)),h=l.posix||l,d="/";var g;(function(y){y.joinPath=function(_,...C){return _.with({path:h.join(_.path,...C)})},y.resolvePath=function(_,...C){let k=_.path,T=!1;k[0]!==d&&(k=d+k,T=!0);let w=h.resolve(k,...C);return T&&w[0]===d&&!_.authority&&(w=w.substring(1)),_.with({path:w})},y.dirname=function(_){if(_.path.length===0||_.path===d)return _;let C=h.dirname(_.path);return C.length===1&&C.charCodeAt(0)===46&&(C=""),_.with({path:C})},y.basename=function(_){return h.basename(_.path)},y.extname=function(_){return h.extname(_.path)}})(g||(s.Utils=g={}))}},e={};function n(i){var s=e[i];if(s!==void 0)return s.exports;var o=e[i]={exports:{}};return t[i].call(o.exports,o,o.exports,n),o.exports}var r={};return(()=>{var i=r;Object.defineProperty(i,"__esModule",{value:!0}),i.Utils=i.URI=void 0;let s=n(796);Object.defineProperty(i,"URI",{enumerable:!0,get:function(){return s.URI}});let o=n(679);Object.defineProperty(i,"Utils",{enumerable:!0,get:function(){return o.Utils}})})(),r})())});var Af=m(kf=>{"use strict";Object.defineProperty(kf,"__esModule",{value:!0});kf.MarkdownString=void 0;var aS=class{constructor(e=""){this.sanitize=!0,this.value=e}appendText(e){return this.value+=e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&"),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,n){return this.value+="\n```",this.value+=e,this.value+=`
141
+ `,this.value+=n,this.value+="\n```\n",this}toString(){return this.value}};kf.MarkdownString=aS});var Cf=m(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.createHover=lt.createSignatureInfo=lt.appendTooltipBody=lt.appendTooltipHeader=lt.createTooltipHeader=lt.formatDefaultValue=lt.formatTypes=lt.formatKind=void 0;var ur=Yo(),uO=ji(),cO=Af(),q2={[ur.CompletionItemKind.Constant]:"constant",[ur.CompletionItemKind.Expression]:"expr",[ur.CompletionItemKind.Function]:"function",[ur.CompletionItemKind.Internal]:"internal",[ur.CompletionItemKind.InternalFunction]:"function",[ur.CompletionItemKind.InternalProperty]:"var",[ur.CompletionItemKind.ListConstructor]:"list",[ur.CompletionItemKind.Literal]:"literal",[ur.CompletionItemKind.MapConstructor]:"map",[ur.CompletionItemKind.Property]:"var",[ur.CompletionItemKind.Unknown]:"unknown",[ur.CompletionItemKind.Variable]:"var"};function uS(t){return q2[t]||"unknown"}lt.formatKind=uS;function cS(t){return t==null?"":t.map(e=>e.toString().replace(",","\u066B")).join(" or ")}lt.formatTypes=cS;function lO(t){return typeof t=="string"?`"${t}"`:t.toString()}lt.formatDefaultValue=lO;var j2=(t,e)=>{let n=e.getArguments()||[],r=cS(e.getReturns())||"null";if(n.length===0)return`(${uS(t.kind)}) ${t.label} (): ${r}`;let i=n.map(s=>`${s.getLabel()}${s.isOptional()?"?":""}: ${cS(s.getTypes())}${s.getDefault()?` = ${lO(s.getDefault().value)}`:""}`).join(", ");return`(${uS(t.kind)}) ${t.label} (${i}): ${r}`};lt.createTooltipHeader=j2;var F2=(t,e,n)=>{t.appendCodeblock(uO.LanguageId,(0,lt.createTooltipHeader)(e,n)),t.appendMarkdown(`***
142
+ `)};lt.appendTooltipHeader=F2;var $2=(t,e)=>{let n=e.getExample()||[];t.appendMarkdown(e.getDescription()+`
143
143
  `),n.length>0&&(t.appendMarkdown(`#### Examples:
144
- `),t.appendCodeblock(JC.LanguageId,n.join(`
145
- `)))};ct.appendTooltipBody=p2;var g2=t=>{let e=[];for(let n of t.signatureDefinitions){let r=n,s={label:(0,ct.createTooltipHeader)(t,r)},o=r.getArguments()??[],a=new QC.MarkdownString("");(0,ct.appendTooltipBody)(a,r),s.parameters=o.map(u=>({label:`${u.getLabel()}${u.isOptional()?"?":""}: ${u.getTypes().join(" or ")}`})),s.documentation=a.toString(),e.push(s)}return e};ct.createSignatureInfo=g2;var m2=t=>{let e=[];for(let n of t.signatureDefinitions){let r=new QC.MarkdownString(""),i=n;(0,ct.appendTooltipHeader)(r,t,i),(0,ct.appendTooltipBody)(r,i),e.push(r)}return{contents:e.map(n=>n.toString())}};ct.createHover=m2});var nO=m(la=>{"use strict";var y2=la&&la.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(la,"__esModule",{value:!0});la.activate=void 0;var eO=Vr(),Jv=nr(),b2=y2(require("path")),Ku=mf(),_2=Zo(),tO=bf(),vf=_f(),v2=gs(),S2=async(t,e,n)=>{let r=Ku.URI.parse(e.uri),i=await t.fs.getWorkspaceFolderUri(r);return i==null?Ku.Utils.joinPath(r,".."):n.startsWith("/")?i:Ku.Utils.joinPath(r,"..")};function w2(t){async function e(n,r){let i=new tO.MarkdownString(""),o=r.closest.path,a=await S2(t,n,o),u=Ku.Utils.joinPath(a,o),c=Ku.Utils.joinPath(a,`${o}`),l=await t.fs.findExistingPath(u.toString(),c.toString()),h=l==null?["Cannot open file."]:[`[Inserts file "${b2.default.basename(l)}" inside this code when building](${l.toString()})`,"***","Click the link above to open the file."];return i.appendMarkdown(h.join(`
146
- `)),{contents:i.toString()}}t.connection.onHover(async n=>{if(!t.getConfiguration().hoverdocs)return;let r=await t.fs.getTextDocument(n.textDocument.uri);if(r==null)return;let i=new _2.LookupHelper(r,t),s=i.lookupAST(n.position);if(!s)return;if(s.closest.type===eO.ASTType.FeatureImportExpression||s.closest.type===eO.ASTType.FeatureIncludeExpression)return await e(r,s);let o=await i.lookupTypeInfo(s);if(!o)return;if(o.isCallable())return(0,vf.createHover)(o);let a=new tO.MarkdownString(""),u=Array.from(o.types).map(Jv.SignatureDefinitionTypeMeta.parse),c=`(${(0,vf.formatKind)(o.kind)}) ${o.label}: ${(0,vf.formatTypes)(u)}`;if(o.types.has(Jv.SignatureDefinitionBaseType.Map)){let l={};for(let[h,d]of o.values){let g=Array.from(d.types).map(Jv.SignatureDefinitionTypeMeta.parse);l[h.slice(2)]=(0,vf.formatTypes)(g)}c+=" "+JSON.stringify(l,null,2)}return a.appendCodeblock(v2.LanguageId,c),{contents:a.toString()}})}la.activate=w2});var iO=m(Sf=>{"use strict";Object.defineProperty(Sf,"__esModule",{value:!0});Sf.activate=void 0;var rO=Te(),T2=Zo(),E2=_f(),x2=t=>{if(t.closest.type===rO.ASTType.CallExpression)return t.closest;for(let e=t.outer.length-1;e>=0;e--){let n=t.outer[e];if(n.type===rO.ASTType.CallExpression)return n}return null};function k2(t){t.connection.onSignatureHelp(async e=>{if(!t.getConfiguration().autocomplete)return;let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;await t.documentManager.getLatest(n);let r=new T2.LookupHelper(n,t),i=r.lookupAST(e.position);if(!i)return;let{closest:s}=i,o=x2(i);if(o===null)return;let a=await r.lookupTypeInfo({closest:o.base,outer:s.scope?[s.scope]:[]});if(!a||!a.isCallable())return;let c=o.arguments.findIndex(h=>{let d=h.start.character-1,g=h.end.character;return d<=e.position.character&&g>=e.position.character}),l={activeParameter:c===-1?0:c,signatures:[],activeSignature:0};return l.signatures.push(...(0,E2.createSignatureInfo)(a)),l})}Sf.activate=k2});var oO=m(wf=>{"use strict";Object.defineProperty(wf,"__esModule",{value:!0});wf.activate=void 0;var sO=gs();function A2(t){let e=r=>r.languageId!==sO.LanguageId?!1:t.documentManager.schedule(r),n=r=>{r.languageId===sO.LanguageId&&t.documentManager.clear(r)};t.fs.on("text-document-open",e),t.fs.on("text-document-change",e),t.fs.on("text-document-close",n)}wf.activate=A2});var aO=m((nV,C2)=>{C2.exports={insert:{description:"Depending on the data type this method will insert a value to the provided index. Due to the insertion, the object will be mutated. To get a better idea about the behaviour look into the `insert` method related to `list` or `string`.",example:["list = [2, 3, 4]","list.insert(2, 42)",'print("List with inserted item: " + list.join(", "))']},indexOf:{description:"Depending on the data type this function searches for the index of the provided value. To get a better idea about the behaviour look into the `indexOf` methods related to `string`, `list` and `map`.",example:['index = "test".indexOf("e")','print("e is at: " + index)']},hasIndex:{description:"Depending on data type this function checks if the provided index is available inside the value. To get a better idea about the behaviour look into the `hasIndex` methods related to `string`, `list` and `map`.",example:['print("List has index: " + [1, 2, 3].hasIndex(2)']},remove:{description:"Depending on the data type this function will remove a value in the provided object. As a result, the object will get mutated. To get a better idea about the behaviour look into the `remove` methods related to `list` and `map`.",example:["list = [9, 3, 5, 7]","list.remove(5)",'print("List after removal: " + list.join(", "))']},push:{description:"Depending on data type this function will append a value to the provided object. As a result, the object will get mutated. To get a better idea about the behaviour look into the `push` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]","list.push(42)",'print("The answer to everything is: " + list.pop)']},pull:{description:"Depending on data type this function will return the first item in the provided value. Additionally, this function removes the last item and therefore mutates the object. To get a better idea about the behaviour look into the `pop` methods related to `list` and `map`.",example:["myList = [42, 1, 3]","answer = myList.pull",'print("Answer to everything: " + answer)']},pop:{description:"Depending on data type this function will return the last item in the provided value. Additionally, this function removes the last item and therefore mutates the object. To get a better idea about the behaviour look into the `pop` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]",'print("The last item is: " + list.pop)']},shuffle:{description:"Depending on data type this function will shuffle data. Instead of returning the newly shuffled data, this function will mutate the data. To get a better idea about the behaviour look into the `shuffle` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]","list.shuffle",'print("And the winner is: " + list[0])']},sum:{description:"Depending on data type this function returns the sum of all items. To get a better idea about the behaviour look into the `sum` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]",'print("Sum of all items is: " + list.sum)']},indexes:{description:"Depending on data type this function returns a `list` with all available indexes. To get a better idea about the behaviour look into the `indexes` methods related to `string`, `list` and `map`.",example:['indexesOfStr = "test".indexes','print("Following indexes are available: " + indexesOfStr.join(", "))']},len:{description:"Depending on data type this function returns the length of the provided value. To get a better idea about the behaviour look into the `len` methods related to `string`, `list` and `map`.",example:['length = "test".len','print("Length of string is: " + length)']},values:{description:"Depending on data type this function returns a `list` with all available values. To get a better idea about the behaviour look into the `values` methods related to `string`, `list` and `map`.",example:['indexesOfStr = "test".values','print("Following values are available: " + indexesOfStr.join(", "))']}}});var uO=m((rV,O2)=>{O2.exports={hasIndex:{description:"Depending on data type this function checks if the provided index is available inside the value. To get a better idea about the behaviour look into the `hasIndex` methods related to `string`, `list` and `map`.",example:['print("List has index: " + hasIndex([1, 2, 3], 2)']},print:{description:"Print a message on the Terminal.",example:['print("hello world")']},indexes:{description:"Depending on data type this function returns a `list` with all available indexes. To get a better idea about the behaviour look into the `indexes` methods related to `string`, `list` and `map`.",example:['indexesOfStr = indexes("test")','print("Following indexes are available: " + indexesOfStr.join(", "))']},values:{description:"Depending on data type this function returns a `list` with all available values. To get a better idea about the behaviour look into the `values` methods related to `string`, `list` and `map`.",example:['indexesOfStr = values("test")','print("Following values are available: " + indexesOfStr.join(", "))']},indexOf:{description:"Depending on the data type this function searches for the index of the provided value. To get a better idea about the behaviour look into the `indexOf` methods related to `string`, `list` and `map`.",example:['index = indexOf("test", "e")','print("e is at: " + index)']},len:{description:"Depending on data type this function returns the length of the provided value. To get a better idea about the behaviour look into the `len` methods related to `string`, `list` and `map`.",example:['length = len("test")','print("Length of string is: " + length)']},shuffle:{description:"Depending on data type this function will shuffle data. Instead of returning the newly shuffled data, this function will mutate the data. To get a better idea about the behaviour look into the `shuffle` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]","shuffle(list)",'print("And the winner is: " + list[0])']},val:{description:"Casts a `string` to a `number`. In case the provided `string` does not represent a valid `number` the `number` zero will get returned.",example:['num = val("1.25")','print("Number in string is: " + num)']},lower:{description:"Returns a `string` which is the lowercase transformed version of the provided `string`.",example:['myString = lower("HELLO WORLD")',"print(myString)"]},upper:{description:"Returns a `string` which is the uppercase transformed version of the provided `string`.",example:['myString = upper("hello world")',"print(myString)"]},sum:{description:"Depending on data type this function returns the sum of all items. To get a better idea about the behaviour look into the `sum` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]",'print("Sum of all items is: " + sum(list))']},pop:{description:"Depending on data type this function will return the last item in the provided value. Additionally, this function removes the last item and therefore mutates the object. To get a better idea about the behaviour look into the `pop` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]",'print("The last item is: " + pop(list))']},pull:{description:"Depending on data type this function will return the first item in the provided value. Additionally, this function removes the first item and therefore mutates the object. To get a better idea about the behaviour look into the `pull` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]",'print("The first item is: " + pull(list))']},push:{description:"Depending on data type this function will append a value to the provided object. As a result, the object will get mutated. To get a better idea about the behaviour look into the `push` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]","push(list, 42)",'print("The answer to everything is: " + pop(list))']},sort:{description:"Depending on the data type this function will sort the values in the provided object. As a result, the object will get mutated. To get a better idea about the behaviour look into the `sort` methods related to `list` and `map`.",example:["list = [9, 3, 5, 7]","sort(list)",'print("Sorted list: " + list.join(", "))']},remove:{description:"Depending on the data type this function will remove a value in the provided object. As a result, the object will get mutated. To get a better idea about the behaviour look into the `remove` methods related to `list` and `map`.",example:["list = [9, 3, 5, 7]","remove(list, 5)",'print("List after removal: " + list.join(", "))']},wait:{description:"Puts script execution on hold. Optionally the duration can be provided via the time argument. By default, the duration will be 1 second. The duration cannot be below 0.01 or above 300.",example:["start = time","wait(5)","elapsed = time - start",'print("Waited: " + elapsed)']},bitwise:{description:'Enables to perform bitwise operations. Supported operators are: `"&"`, `"|"`, `"^"`, `"<<"`, `">>"`, `">>>"`. Returns a `number`.',example:["num = params[0].to_int",'isOdd = bitwise("&", num, 1) == 1',"if isOdd then",' print("Number is odd.")',"else",' print("Number is even.")',"end if"]},abs:{description:"Returns the absolute value of `number`.",example:["a = 1","b = 5","difference = abs(a - b)",'print("Difference between a and b is: " + difference)']},acos:{description:"Returns the inverse cosine (in radians) of a `number`.",example:["adjacent = 8","hypotenuse = 10","calcAngle = acos(adjacent / hypotenuse)",'print("Angle: " + calcAngle)']},asin:{description:"Returns the inverse sine (in radians) of a `number`.",example:["opposite = 6","hypotenuse = 10","calcAngle = acos(opposite / hypotenuse)",'print("Angle: " + calcAngle)']},atan:{description:"Returns the inverse tangent (in radians) of a `number`.",example:["opposite = 8","hypotenuse = 10","calcAngle = atan(opposite / hypotenuse)",'print("Angle: " + calcAngle)']},tan:{description:"Returns the tangent of a `number` in radians.",example:["degrees = 90","tanFromDegrees = tan(degress * pi / 180)",'print("Tan from degrees: " + tanFromDegrees)']},cos:{description:"Returns the cosine of a `number` in radians.",example:["radians = 1","radius = 10","circleX = cos(radians) * radius","print(circleX)"]},code:{description:"Returns the Unicode `number` of the first character of the string. In case an empty `string` is provided the script execution will crash.",example:['key = user_input("Press a key!", false, true)',"isA = key.code == 97","if isA then",' print("You pressed A.")',"else",' print("You did not press A.")',"end if"]},char:{description:"Returns the Unicode character `string` related to the provided unicode `number`. The provided `number` needs to be between 0 and 65535. Any `number` which is outside this range will cause the script to throw a runtime error.",example:['key = user_input("Press a key!", false, true)',"isA = key == char(97)","if isA then",' print("You pressed A.")',"else",' print("You did not press A.")',"end if"]},sin:{description:"Returns the sine of a `number` in radians.",example:["radians = 1","radius = 10","circleY = sin(radians) * radius","print(circleY)"]},floor:{description:"Returns `number` rounded down to the integer value of the provided `number`.",example:["price = 25.43467","floored = floor(price * 100) / 100",'print("Floored price: " + floored)']},range:{description:"Returns a `list` where each item is a `number`. By default, the `list` starts with the `number` zero and increments by one for each item. Optionally start and end can be defined. Additionally, the incremental value can be changed as well. In case the incremental value is zero this function will throw a runtime error.",example:['print("Countdown:")',"for num in range(10)"," print(num)","end for",'print("Done!")']},round:{description:"Returns `number` rounded to the integer value of the provided `number`.",example:["price = 25.43467","rounded = round(price * 100) / 100",'print("Price: " + rounded)']},rnd:{description:"Returns a random `number` between 0 and 1. Optionally a seed `number` can be provided.",example:["min = 10","max = 20","output = floor(rnd * (max - min + 1) + min)",'input = user_input("Guess a number between 10 and 20!").to_int',"if (input == output) then",' print("You guessed right!")',"else",' print("You failed! The number was " + output)',"end if"]},sign:{description:"Returns a one or minus one, indicating the sign of the number passed as argument. If the input is zero, it will be returned as-is.",example:["print(sign(40))","print(sign(-40))","print(sign(0))"]},sqrt:{description:"Returns the square root of a `number`.",example:["a = 3","b = 4","calcHypotenuse = sqrt((a * a) + (b * b))",'print("Hypotenuse: " + calcHypotenuse)']},str:{description:"Returns the `string` value of provided data. Can be used to turn a `number` into a `string` or to get the signature of a `function`.",example:["signature = str(@user_input)","argSegment = signature[9:signature.len - 1]",'args = argSegment.split(",")','print("Function has " + args.len + " arguments.")']},ceil:{description:"Returns `number` rounded up to the integer value of the provided `number`.",example:["price = 25.43467","upperPrice = ceil(price * 100) / 100",'print("Upper price: " + upperPrice)']},pi:{description:"Returns the `number` PI to the precision of six.",example:["radius = 10","circumference = 2 * pi * radius",'print("Circumference: " + circumference)']},slice:{description:"Returns a sliced `list`. Valid data types for slicing are `string` and `list`. The returned `list` will contain all elements related to the provided start and end index.",example:['myString = "not your text"','print("my " + slice(myString, 9))']},hash:{description:"Returns numeric hash for the provided data.",example:['hashA = hash({ "a": 2, "b": 1 })','hashB = hash({ "b": 1, "a": 2 })',"if (hashA == hashB) then",' print("Objects are alike!")',"else",' print("Objects are different!")',"end if"]},time:{description:"Returns a `number` of seconds representing the elapsed time since the script got started.",example:["start = time","for i in range(10000)"," var = i * 100","end for","endTime = time - start",'print("Script execution done within: " + endTime)']},bitAnd:{description:"Performs a bitwise AND for the provided values. Returns a `number`.",example:['print("Result of bitwise AND: " + bitAnd(1, 2))']},bitOr:{description:"Performs a bitwise OR for the provided values. Returns a `number`.",example:['print("Result of bitwise OR: " + bitOr(1, 2))']},bitXor:{description:"Permorms a bitwise XOR for the provided values. Returns a `number`.",example:['print("Result of bitwise XOR: " + bitXor(1, 2))']},log:{description:"Returns the natural logarithm of a `number`. By default, the base is 10. Optionally the base can be changed.",example:["a = 2","b = 8","baseLog = log(a) / log(b)",'print("Base log is: " + baseLog)']},yield:{description:"Waits for the next tick.",example:["while (true)"," yield",' print("tick")',"end while"]},get_custom_object:{description:"Returns `map` which is shared throughout all script executions. Can be helpful in case forwarding an entity is desired.",example:["get_custom_object.shouldEndScript = false","while (get_custom_object.shouldEndScript)",' print("Waiting...")'," wait(2)","end while"]},insert:{description:"Depending on the data type this function will insert a value to the provided index. Due to the insertion, the object will be mutated. To get a better idea about the behaviour look into the `insert` method related to `list` or `string`.",example:["list = [2, 3, 4]","insert(list, 2, 42)",'print("List with inserted item: " + list.join(", "))']},join:{description:"Returns a concatenated `string` containing all stringified values inside the `list`. These values will be separated via the provided separator.",example:["myList = [42, 1, 3]",`print(join(myList, " .-*'*-. "))`]},split:{description:"Returns a `list` where each item is a segment of the `string`. The separation depends on the provided separator `string`. Keep in mind that for some odd reason, this method is using regular expressions for matching.",example:['myString = "42 as an answer is wrong"','segments = split(myString, " ")','if segments[0] != "42" then',' print("Invalid information spotted!")',"else",' print("Information seems valid!")',"end if"]},replace:{description:"Depending on the data type this function will replace a value in the provided object. Due to the replacement, the object might get mutated. To get a better idea about the behaviour look into the `replace` method related to `map`, `list` or `string`.",example:['myString = "42 as an answer is wrong"','newString = replace(myString, "wrong", "right")',"print(newString)"]},refEquals:{description:"Tests whether two values refer to the very same object (rather than merely representing the same value). For numbers, this is the same as ==, but for strings, lists, and maps, it is reference equality."},version:{description:`Get a map with information about the version of MiniScript and the host environment that you're currently running. This will include at least the following keys:
144
+ `),t.appendCodeblock(uO.LanguageId,n.join(`
145
+ `)))};lt.appendTooltipBody=$2;var B2=t=>{let e=[];for(let n of t.signatureDefinitions){let r=n,s={label:(0,lt.createTooltipHeader)(t,r)},o=r.getArguments()??[],a=new cO.MarkdownString("");(0,lt.appendTooltipBody)(a,r),s.parameters=o.map(u=>({label:`${u.getLabel()}${u.isOptional()?"?":""}: ${u.getTypes().join(" or ")}`})),s.documentation=a.toString(),e.push(s)}return e};lt.createSignatureInfo=B2;var W2=t=>{let e=[];for(let n of t.signatureDefinitions){let r=new cO.MarkdownString(""),i=n;(0,lt.appendTooltipHeader)(r,t,i),(0,lt.appendTooltipBody)(r,i),e.push(r)}return{contents:e.map(n=>n.toString())}};lt.createHover=W2});var fO=m(ha=>{"use strict";var U2=ha&&ha.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ha,"__esModule",{value:!0});ha.activate=void 0;var hO=Yr(),lS=jn(),H2=U2(require("path")),Yu=xf(),G2=ea(),dO=Af(),Of=Cf(),z2=ji(),K2=async(t,e,n)=>{let r=Yu.URI.parse(e.uri),i=await t.fs.getWorkspaceFolderUri(r);return i==null?Yu.Utils.joinPath(r,".."):n.startsWith("/")?i:Yu.Utils.joinPath(r,"..")};function V2(t){async function e(n,r){let i=new dO.MarkdownString(""),o=r.closest.path,a=await K2(t,n,o),u=Yu.Utils.joinPath(a,o),c=Yu.Utils.joinPath(a,`${o}`),l=await t.fs.findExistingPath(u.toString(),c.toString()),h=l==null?["Cannot open file."]:[`[Inserts file "${H2.default.basename(l)}" inside this code when building](${l.toString()})`,"***","Click the link above to open the file."];return i.appendMarkdown(h.join(`
146
+ `)),{contents:i.toString()}}t.connection.onHover(async n=>{if(!t.getConfiguration().hoverdocs)return;let r=await t.fs.getTextDocument(n.textDocument.uri);if(r==null)return;let i=new G2.LookupHelper(r,t),s=i.lookupAST(n.position);if(!s)return;if(s.closest.type===hO.ASTType.FeatureImportExpression||s.closest.type===hO.ASTType.FeatureIncludeExpression)return await e(r,s);let o=await i.lookupTypeInfo(s);if(!o)return;if(o.isCallable())return(0,Of.createHover)(o);let a=new dO.MarkdownString(""),u=o.toMeta().map(lS.SignatureDefinitionTypeMeta.parse),c=`(${(0,Of.formatKind)(o.kind)}) ${o.label}: ${(0,Of.formatTypes)(u)}`;if(o.types.has(lS.SignatureDefinitionBaseType.Map)){let l={};for(let[h,d]of o.values){let g=d.toMeta().map(lS.SignatureDefinitionTypeMeta.parse);l[h.slice(2)]=(0,Of.formatTypes)(g)}c+=" "+JSON.stringify(l,null,2)}return a.appendCodeblock(z2.LanguageId,c),{contents:a.toString()}})}ha.activate=V2});var gO=m(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0});Rf.activate=void 0;var pO=ke(),X2=ea(),Y2=Cf(),J2=t=>{if(t.closest.type===pO.ASTType.CallExpression)return t.closest;for(let e=t.outer.length-1;e>=0;e--){let n=t.outer[e];if(n.type===pO.ASTType.CallExpression)return n}return null};function Q2(t){t.connection.onSignatureHelp(async e=>{if(!t.getConfiguration().autocomplete)return;let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;await t.documentManager.getLatest(n);let r=new X2.LookupHelper(n,t),i=r.lookupAST(e.position);if(!i)return;let{closest:s}=i,o=J2(i);if(o===null)return;let a=await r.lookupTypeInfo({closest:o.base,outer:s.scope?[s.scope]:[]});if(!a||!a.isCallable())return;let c=o.arguments.findIndex(h=>{let d=h.start.character-1,g=h.end.character;return d<=e.position.character&&g>=e.position.character}),l={activeParameter:c===-1?0:c,signatures:[],activeSignature:0};return l.signatures.push(...(0,Y2.createSignatureInfo)(a)),l})}Rf.activate=Q2});var yO=m(Pf=>{"use strict";Object.defineProperty(Pf,"__esModule",{value:!0});Pf.activate=void 0;var mO=ji();function Z2(t){let e=r=>r.languageId!==mO.LanguageId?!1:t.documentManager.schedule(r),n=r=>{r.languageId===mO.LanguageId&&t.documentManager.clear(r)};t.fs.on("text-document-open",e),t.fs.on("text-document-change",e),t.fs.on("text-document-close",n)}Pf.activate=Z2});var bO=m((OV,eW)=>{eW.exports={insert:{description:"Depending on the data type this method will insert a value to the provided index. Due to the insertion, the object will be mutated. To get a better idea about the behaviour look into the `insert` method related to `list` or `string`.",example:["list = [2, 3, 4]","list.insert(2, 42)",'print("List with inserted item: " + list.join(", "))']},indexOf:{description:"Depending on the data type this function searches for the index of the provided value. To get a better idea about the behaviour look into the `indexOf` methods related to `string`, `list` and `map`.",example:['index = "test".indexOf("e")','print("e is at: " + index)']},hasIndex:{description:"Depending on data type this function checks if the provided index is available inside the value. To get a better idea about the behaviour look into the `hasIndex` methods related to `string`, `list` and `map`.",example:['print("List has index: " + [1, 2, 3].hasIndex(2)']},remove:{description:"Depending on the data type this function will remove a value in the provided object. As a result, the object will get mutated. To get a better idea about the behaviour look into the `remove` methods related to `list` and `map`.",example:["list = [9, 3, 5, 7]","list.remove(5)",'print("List after removal: " + list.join(", "))']},push:{description:"Depending on data type this function will append a value to the provided object. As a result, the object will get mutated. To get a better idea about the behaviour look into the `push` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]","list.push(42)",'print("The answer to everything is: " + list.pop)']},pull:{description:"Depending on data type this function will return the first item in the provided value. Additionally, this function removes the last item and therefore mutates the object. To get a better idea about the behaviour look into the `pop` methods related to `list` and `map`.",example:["myList = [42, 1, 3]","answer = myList.pull",'print("Answer to everything: " + answer)']},pop:{description:"Depending on data type this function will return the last item in the provided value. Additionally, this function removes the last item and therefore mutates the object. To get a better idea about the behaviour look into the `pop` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]",'print("The last item is: " + list.pop)']},shuffle:{description:"Depending on data type this function will shuffle data. Instead of returning the newly shuffled data, this function will mutate the data. To get a better idea about the behaviour look into the `shuffle` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]","list.shuffle",'print("And the winner is: " + list[0])']},sum:{description:"Depending on data type this function returns the sum of all items. To get a better idea about the behaviour look into the `sum` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]",'print("Sum of all items is: " + list.sum)']},indexes:{description:"Depending on data type this function returns a `list` with all available indexes. To get a better idea about the behaviour look into the `indexes` methods related to `string`, `list` and `map`.",example:['indexesOfStr = "test".indexes','print("Following indexes are available: " + indexesOfStr.join(", "))']},len:{description:"Depending on data type this function returns the length of the provided value. To get a better idea about the behaviour look into the `len` methods related to `string`, `list` and `map`.",example:['length = "test".len','print("Length of string is: " + length)']},values:{description:"Depending on data type this function returns a `list` with all available values. To get a better idea about the behaviour look into the `values` methods related to `string`, `list` and `map`.",example:['indexesOfStr = "test".values','print("Following values are available: " + indexesOfStr.join(", "))']}}});var _O=m((RV,tW)=>{tW.exports={hasIndex:{description:"Depending on data type this function checks if the provided index is available inside the value. To get a better idea about the behaviour look into the `hasIndex` methods related to `string`, `list` and `map`.",example:['print("List has index: " + hasIndex([1, 2, 3], 2)']},print:{description:"Print a message on the Terminal.",example:['print("hello world")']},indexes:{description:"Depending on data type this function returns a `list` with all available indexes. To get a better idea about the behaviour look into the `indexes` methods related to `string`, `list` and `map`.",example:['indexesOfStr = indexes("test")','print("Following indexes are available: " + indexesOfStr.join(", "))']},values:{description:"Depending on data type this function returns a `list` with all available values. To get a better idea about the behaviour look into the `values` methods related to `string`, `list` and `map`.",example:['indexesOfStr = values("test")','print("Following values are available: " + indexesOfStr.join(", "))']},indexOf:{description:"Depending on the data type this function searches for the index of the provided value. To get a better idea about the behaviour look into the `indexOf` methods related to `string`, `list` and `map`.",example:['index = indexOf("test", "e")','print("e is at: " + index)']},len:{description:"Depending on data type this function returns the length of the provided value. To get a better idea about the behaviour look into the `len` methods related to `string`, `list` and `map`.",example:['length = len("test")','print("Length of string is: " + length)']},shuffle:{description:"Depending on data type this function will shuffle data. Instead of returning the newly shuffled data, this function will mutate the data. To get a better idea about the behaviour look into the `shuffle` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]","shuffle(list)",'print("And the winner is: " + list[0])']},val:{description:"Casts a `string` to a `number`. In case the provided `string` does not represent a valid `number` the `number` zero will get returned.",example:['num = val("1.25")','print("Number in string is: " + num)']},lower:{description:"Returns a `string` which is the lowercase transformed version of the provided `string`.",example:['myString = lower("HELLO WORLD")',"print(myString)"]},upper:{description:"Returns a `string` which is the uppercase transformed version of the provided `string`.",example:['myString = upper("hello world")',"print(myString)"]},sum:{description:"Depending on data type this function returns the sum of all items. To get a better idea about the behaviour look into the `sum` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]",'print("Sum of all items is: " + sum(list))']},pop:{description:"Depending on data type this function will return the last item in the provided value. Additionally, this function removes the last item and therefore mutates the object. To get a better idea about the behaviour look into the `pop` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]",'print("The last item is: " + pop(list))']},pull:{description:"Depending on data type this function will return the first item in the provided value. Additionally, this function removes the first item and therefore mutates the object. To get a better idea about the behaviour look into the `pull` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]",'print("The first item is: " + pull(list))']},push:{description:"Depending on data type this function will append a value to the provided object. As a result, the object will get mutated. To get a better idea about the behaviour look into the `push` methods related to `list` and `map`.",example:["list = [0, 1, 2, 3, 4, 5]","push(list, 42)",'print("The answer to everything is: " + pop(list))']},sort:{description:"Depending on the data type this function will sort the values in the provided object. As a result, the object will get mutated. To get a better idea about the behaviour look into the `sort` methods related to `list` and `map`.",example:["list = [9, 3, 5, 7]","sort(list)",'print("Sorted list: " + list.join(", "))']},remove:{description:"Depending on the data type this function will remove a value in the provided object. As a result, the object will get mutated. To get a better idea about the behaviour look into the `remove` methods related to `list` and `map`.",example:["list = [9, 3, 5, 7]","remove(list, 5)",'print("List after removal: " + list.join(", "))']},wait:{description:"Puts script execution on hold. Optionally the duration can be provided via the time argument. By default, the duration will be 1 second. The duration cannot be below 0.01 or above 300.",example:["start = time","wait(5)","elapsed = time - start",'print("Waited: " + elapsed)']},bitwise:{description:'Enables to perform bitwise operations. Supported operators are: `"&"`, `"|"`, `"^"`, `"<<"`, `">>"`, `">>>"`. Returns a `number`.',example:["num = params[0].to_int",'isOdd = bitwise("&", num, 1) == 1',"if isOdd then",' print("Number is odd.")',"else",' print("Number is even.")',"end if"]},abs:{description:"Returns the absolute value of `number`.",example:["a = 1","b = 5","difference = abs(a - b)",'print("Difference between a and b is: " + difference)']},acos:{description:"Returns the inverse cosine (in radians) of a `number`.",example:["adjacent = 8","hypotenuse = 10","calcAngle = acos(adjacent / hypotenuse)",'print("Angle: " + calcAngle)']},asin:{description:"Returns the inverse sine (in radians) of a `number`.",example:["opposite = 6","hypotenuse = 10","calcAngle = acos(opposite / hypotenuse)",'print("Angle: " + calcAngle)']},atan:{description:"Returns the inverse tangent (in radians) of a `number`.",example:["opposite = 8","hypotenuse = 10","calcAngle = atan(opposite / hypotenuse)",'print("Angle: " + calcAngle)']},tan:{description:"Returns the tangent of a `number` in radians.",example:["degrees = 90","tanFromDegrees = tan(degress * pi / 180)",'print("Tan from degrees: " + tanFromDegrees)']},cos:{description:"Returns the cosine of a `number` in radians.",example:["radians = 1","radius = 10","circleX = cos(radians) * radius","print(circleX)"]},code:{description:"Returns the Unicode `number` of the first character of the string. In case an empty `string` is provided the script execution will crash.",example:['key = user_input("Press a key!", false, true)',"isA = key.code == 97","if isA then",' print("You pressed A.")',"else",' print("You did not press A.")',"end if"]},char:{description:"Returns the Unicode character `string` related to the provided unicode `number`. The provided `number` needs to be between 0 and 65535. Any `number` which is outside this range will cause the script to throw a runtime error.",example:['key = user_input("Press a key!", false, true)',"isA = key == char(97)","if isA then",' print("You pressed A.")',"else",' print("You did not press A.")',"end if"]},sin:{description:"Returns the sine of a `number` in radians.",example:["radians = 1","radius = 10","circleY = sin(radians) * radius","print(circleY)"]},floor:{description:"Returns `number` rounded down to the integer value of the provided `number`.",example:["price = 25.43467","floored = floor(price * 100) / 100",'print("Floored price: " + floored)']},range:{description:"Returns a `list` where each item is a `number`. By default, the `list` starts with the `number` zero and increments by one for each item. Optionally start and end can be defined. Additionally, the incremental value can be changed as well. In case the incremental value is zero this function will throw a runtime error.",example:['print("Countdown:")',"for num in range(10)"," print(num)","end for",'print("Done!")']},round:{description:"Returns `number` rounded to the integer value of the provided `number`.",example:["price = 25.43467","rounded = round(price * 100) / 100",'print("Price: " + rounded)']},rnd:{description:"Returns a random `number` between 0 and 1. Optionally a seed `number` can be provided.",example:["min = 10","max = 20","output = floor(rnd * (max - min + 1) + min)",'input = user_input("Guess a number between 10 and 20!").to_int',"if (input == output) then",' print("You guessed right!")',"else",' print("You failed! The number was " + output)',"end if"]},sign:{description:"Returns a one or minus one, indicating the sign of the number passed as argument. If the input is zero, it will be returned as-is.",example:["print(sign(40))","print(sign(-40))","print(sign(0))"]},sqrt:{description:"Returns the square root of a `number`.",example:["a = 3","b = 4","calcHypotenuse = sqrt((a * a) + (b * b))",'print("Hypotenuse: " + calcHypotenuse)']},str:{description:"Returns the `string` value of provided data. Can be used to turn a `number` into a `string` or to get the signature of a `function`.",example:["signature = str(@user_input)","argSegment = signature[9:signature.len - 1]",'args = argSegment.split(",")','print("Function has " + args.len + " arguments.")']},ceil:{description:"Returns `number` rounded up to the integer value of the provided `number`.",example:["price = 25.43467","upperPrice = ceil(price * 100) / 100",'print("Upper price: " + upperPrice)']},pi:{description:"Returns the `number` PI to the precision of six.",example:["radius = 10","circumference = 2 * pi * radius",'print("Circumference: " + circumference)']},slice:{description:"Returns a sliced `list`. Valid data types for slicing are `string` and `list`. The returned `list` will contain all elements related to the provided start and end index.",example:['myString = "not your text"','print("my " + slice(myString, 9))']},hash:{description:"Returns numeric hash for the provided data.",example:['hashA = hash({ "a": 2, "b": 1 })','hashB = hash({ "b": 1, "a": 2 })',"if (hashA == hashB) then",' print("Objects are alike!")',"else",' print("Objects are different!")',"end if"]},time:{description:"Returns a `number` of seconds representing the elapsed time since the script got started.",example:["start = time","for i in range(10000)"," var = i * 100","end for","endTime = time - start",'print("Script execution done within: " + endTime)']},bitAnd:{description:"Performs a bitwise AND for the provided values. Returns a `number`.",example:['print("Result of bitwise AND: " + bitAnd(1, 2))']},bitOr:{description:"Performs a bitwise OR for the provided values. Returns a `number`.",example:['print("Result of bitwise OR: " + bitOr(1, 2))']},bitXor:{description:"Permorms a bitwise XOR for the provided values. Returns a `number`.",example:['print("Result of bitwise XOR: " + bitXor(1, 2))']},log:{description:"Returns the natural logarithm of a `number`. By default, the base is 10. Optionally the base can be changed.",example:["a = 2","b = 8","baseLog = log(a) / log(b)",'print("Base log is: " + baseLog)']},yield:{description:"Waits for the next tick.",example:["while (true)"," yield",' print("tick")',"end while"]},get_custom_object:{description:"Returns `map` which is shared throughout all script executions. Can be helpful in case forwarding an entity is desired.",example:["get_custom_object.shouldEndScript = false","while (get_custom_object.shouldEndScript)",' print("Waiting...")'," wait(2)","end while"]},insert:{description:"Depending on the data type this function will insert a value to the provided index. Due to the insertion, the object will be mutated. To get a better idea about the behaviour look into the `insert` method related to `list` or `string`.",example:["list = [2, 3, 4]","insert(list, 2, 42)",'print("List with inserted item: " + list.join(", "))']},join:{description:"Returns a concatenated `string` containing all stringified values inside the `list`. These values will be separated via the provided separator.",example:["myList = [42, 1, 3]",`print(join(myList, " .-*'*-. "))`]},split:{description:"Returns a `list` where each item is a segment of the `string`. The separation depends on the provided separator `string`. Keep in mind that for some odd reason, this method is using regular expressions for matching.",example:['myString = "42 as an answer is wrong"','segments = split(myString, " ")','if segments[0] != "42" then',' print("Invalid information spotted!")',"else",' print("Information seems valid!")',"end if"]},replace:{description:"Depending on the data type this function will replace a value in the provided object. Due to the replacement, the object might get mutated. To get a better idea about the behaviour look into the `replace` method related to `map`, `list` or `string`.",example:['myString = "42 as an answer is wrong"','newString = replace(myString, "wrong", "right")',"print(newString)"]},refEquals:{description:"Tests whether two values refer to the very same object (rather than merely representing the same value). For numbers, this is the same as ==, but for strings, lists, and maps, it is reference equality."},version:{description:`Get a map with information about the version of MiniScript and the host environment that you're currently running. This will include at least the following keys:
147
147
  miniscript: a string such as "1.5"
148
148
  buildDate: a date in yyyy-mm-dd format, like "2020-05-28"
149
149
  host: a number for the host major and minor version, like 0.9
150
150
  hostName: name of the host application, e.g. "Mini Micro"
151
- hostInfo: URL or other short info about the host app`},stackTrace:{description:"Get a list describing the call stack."}}});var cO=m((iV,R2)=>{R2.exports={$meta:{description:"Create a `list` with square brackets. Then iterate over the `list` with for, or pull out individual items with a 0-based index in square brackets. A negative index counts from the end. Get a slice (subset) of a `list` with two indices, separated by a colon.",example:["x = [2, 4, 6, 8]","print(x[0]) // get first item from list","print(x[-1]) // get last item from list","print(x[1:3]) // slice items from index 1 to 3","x[2] = 5 // set item at index 2 to 5","print(x)","print(x + [42]) // concatenate two lists"]},remove:{description:"Removes an item from the `list` with the provided index. Due to the removal the `list` will get mutated.",example:["myList = [1, 42, 3]","myList.remove(1)",'print("This list does not contain the answer to everything: " + myList.split(", "))']},insert:{description:"Inserts a value into the `list` at the index provided. Due to the insertion the `list` will get mutated. Returns the mutated `list`.",example:["myList = [1, 3]","myList.insert(1, 42)",'print("This list does contain the answer to everything: " + myList.split(", "))']},push:{description:"Appends a value to the end of the `list`. This operation will mutate the `list`. Additionally, this method will return the updated `list`.",example:["myList = [1, 3]","myList.push(42)",'print("This list does contain the answer to everything: " + myList.split(", "))']},pop:{description:"Returns and removes the last item in the `list`. This operation will mutate the `list`.",example:["myList = [1, 3, 42]","answer = myList.pop",'print("Answer to everything: " + answer)']},pull:{description:"Returns and removes the first item in the `list`. This operation will mutate the `list`.",example:["myList = [42, 1, 3]","answer = myList.pull",'print("Answer to everything: " + answer)']},shuffle:{description:"Shuffles all values in the `list`. This operation will mutate the `list`.",example:["myList = [42, 1, 3]","myList.shuffle",'print("New list order: " + myList.split(", "))']},sum:{description:"Returns sum of all values inside the `list`. Any non-numeric values will be considered a zero.",example:["myList = [42, 1, 3]","sum = myList.sum",'print("Sum of all items in list: " + sum)']},hasIndex:{description:"Returns `true` if the provided index is available in the `list`. Otherwise, this method will return `false`.",example:["myList = [42, 1, 3]","containsIndex = myList.hasIndex(1)","if containsIndex then",' print("List contains index of 1.")',"else",' print("List does not contain index of 1.")',"end if"]},indexOf:{description:"Returns a `number` which indicates the first matching index of the provided value inside the `list`. Optionally a start index can be provided. In case the value does not exist inside the `list` a `null` gets returned.",example:["myList = [42, 1, 3]","index = myList.indexOf(42)","if index != null then",' print("The answer for everything is at the following index: " + index)',"else",' print("No answer for everything found.")',"end if"]},sort:{description:"Sort `list` values alphanumerically. This operation will mutate the `list`. Optionally a key can be provided which which is used in case the items are maps. Additionally, this method will return the updated `list`.",example:['myList = [{ "key": 42 }, { "key": 2 }, { "key": 1 }]','myList.sort("key")',"print(myList)"]},join:{description:"Returns a concatenated `string` containing all stringified values inside the `list`. These values will be separated via the provided separator.",example:["myList = [42, 1, 3]",`print(myList.join(" .-*'*-. "))`]},indexes:{description:"Returns a `list` containing all available indexes.",example:["myList = [42, 1, 3]","for i in myList.indexes"," print(myList[i])","end for"]},len:{description:"Returns a `number` representing the count of values inside the `list`.",example:["myList = [42, 1, 3]",'print("myList contains " + myList.len + " items")']},values:{description:"Returns a `list` containing all available values.",example:["myList = [42, 1, 3]","for v in myList.values"," print(v)","end for"]},replace:{description:"Returns updated `list` where each value matching with the provided replace argument gets replaced. This operation will mutate the `list`.",example:["myList = [1, 2, 2, 7]","myList.replace(2, 3)",'print(myList.join(""))']}}});var lO=m((sV,P2)=>{P2.exports={$meta:{description:"A `map` is a set of values associated with unique keys. Create a `map` with curly braces; get or set a single value with square brackets. Keys and values may be any type.",example:['x = { "test": 123 }',"x.foo = 42 // set property foo to 42","print(x.foo) // get value of property foo",'print(x + { "bar": 2 }) // concatenate two maps']},remove:{description:"Removes an item from the `map` with the provided key. Due to the removal the `map` will get mutated.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','myMap.remove("answer")',"print(myMap)"]},push:{description:"Adds the value 1 to the provided key. This operation will mutate the `map`. Additionally, this method will return the updated `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','myMap.push("answer")',"print(myMap.answer)"]},pull:{description:"Returns and removes the first item in the `map`. This operation will mutate the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"print(myMap.pull)"]},pop:{description:"Returns and removes the last item in the `map`. This operation will mutate the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"print(myMap.pop)"]},shuffle:{description:"Shuffles all values in the `map`. This operation will mutate the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"myMap.shuffle","print(myMap)"]},sum:{description:"Returns sum of all values inside the `map`. Any non-numeric values will be considered a zero.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"sum = myMap.sum",'print("Sum of all items in map: " + sum)']},hasIndex:{description:"Returns `true` if the provided key is available in the `map`. Otherwise, this method will return `false`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','containsIndex = myList.hasIndex("answer")',"if containsIndex then",' print("Map contains the answer.")',"else",' print("Map does not contain the answer.")',"end if"]},indexOf:{description:"Returns `string` which indicates the key of the provided value inside the `map`. In case the value does not exist inside the `map` a `null` gets returned.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"key = myList.indexOf(42)","if key != null then",' print("Map contains the answer.")',"else",' print("Map does not contain the answer.")',"end if"]},indexes:{description:"Returns a `list` containing all available keys.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"for key in myMap.indexes"," print(myMap[key])","end for"]},len:{description:"Returns a `number` representing the count of items inside the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','print("myMap contains " + myMap.len + " items")']},values:{description:"Returns a `list` containing all available values.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"for value in myMap.values"," print(value)","end for"]},replace:{description:"Returns updated `map` where each value matching with the provided replace argument gets replaced. This operation will mutate the `map`.",example:['myObject = { "answer": 45 }',"myObject.replace(45, 42)","print(myObject.answer)"]}}});var hO=m((oV,D2)=>{D2.exports={$meta:{description:"All numbers are stored in full-precision format. Numbers also represent `true == 1` and `false == 0`.",example:["a = 20","b = 22","print(a + b) // addition","print(a - b) // substraction","print(a / b) // division","print(a * b) // multiply","print(a % b) // modulo","print(a - b) // substraction","print(a ^ b) // power","print(a and b) // logical and","print(a or b) // logical or","print(not a) // logical not","print(a == b) // comparison equal","print(a != b) // comparison unequal","print(a > b) // comparison greater than","print(a < b) // comparison lower than","print(a >= b) // comparison greater equal than","print(a <= b) // comparison lower equal than"]}}});var dO=m((aV,I2)=>{I2.exports={$meta:{description:"Text is stored in strings of Unicode characters. Write strings by surrounding them with quotes. If you need to include a quotation mark in the string, write it twice.",example:['a = "hello"','b = "world"',"print(a + b) // concatinate a and b","print(a * 10) // repeat hello ten times","print(a[0]) // prints h","print(a[1:3]) // prints ell"]},remove:{description:"Returns a new `string` where the provided `string` got removed.",example:['myString = "42 as an answer is wrong"','newString = myString.remove("wrong")','print(newString + "right")']},hasIndex:{description:"Returns `true` if the provided index is available in the `string`. Otherwise, this method will return `false`.",example:['myString = "42 as an answer is wrong"',"containsIndex = myString.hasIndex(1)","if containsIndex then",' print("String contains index of 1.")',"else",' print("String does not contain index of 1.")',"end if"]},insert:{description:"Returns a `string` with the newly inserted `string` at the provided index.",example:['myString = "42 as an answer is wrong"','index = myString.lastIndexOf("w") - 1','newString = myString.insert(index, "not ")',"print(newString)"]},indexOf:{description:"Returns a `number` which indicates the first matching index of the provided value inside the `list`. Optionally a start index can be provided. In case the value does not exist inside the `string` a `null` gets returned.",example:['myString = "42 as an answer is wrong"','index = myString.indexOf("wrong")',"if index != null then",' print("Invalid information spotted at: " + index)',"else",' print("Information seems valid.")',"end if"]},split:{description:"Returns a `list` where each item is a segment of the `string`. The separation depends on the provided separator `string`. Keep in mind that for some odd reason, this method is using regular expressions for matching.",example:['myString = "42 as an answer is wrong"','segments = myString.split(" ")','if segments[0] != "42" then',' print("Invalid information spotted!")',"else",' print("Information seems valid!")',"end if"]},replace:{description:"Returns a new `string` where the provided `string` got replaced by the second provided `string`.",example:['myString = "42 as an answer is wrong"','newString = myString.replace("wrong", "right")',"print(newString)"]},indexes:{description:"Returns a `list` where each item is a `number` representing all available indexes in the `string`.",example:['myString = "42"',"print(myString.indexes)"]},code:{description:"Returns a `number` representing the Unicode code of the first character of the `string`.",example:['myString = "HELLO WORLD"',"print(myString.code)"]},len:{description:"Returns a `number` representing the length of the `string`.",example:['myString = "HELLO WORLD"','print("Size of string is: " + myString.len)']},lower:{description:"Returns a new `string` in which all characters are transformed into lowercase.",example:['myString = "HELLO WORLD"',"print(myString.lower)"]},upper:{description:"Returns a new `string` in which all characters are transformed into uppercase.",example:['myString = "hello world"',"print(myString.upper)"]},val:{description:"Returns a `number` which is parsed from the `string`. In case the `string` is not numeric it will return a zero.",example:['myString = "1.25"',"print(myString.val + 40.75)"]},values:{description:"Returns a `list` where each item is a `string` representing all available characters in the `string`. Could be compared to using `split` but without any separator.",example:['myString = "hello world"',"print(myString.values)"]}}});var fO=m(Vu=>{"use strict";var ha=Vu&&Vu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Vu,"__esModule",{value:!0});var M2=ha(aO()),L2=ha(uO()),N2=ha(cO()),q2=ha(lO()),j2=ha(hO()),F2=ha(dO()),$2={any:M2.default,general:L2.default,list:N2.default,map:q2.default,string:F2.default,number:j2.default};Vu.default=$2});var pO=m((cV,B2)=>{B2.exports={type:"any",definitions:{insert:{type:"function",arguments:[{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list","string"]},indexOf:{type:"function",arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["any"]},hasIndex:{type:"function",arguments:[{label:"value",type:"any"}],returns:["number"]},remove:{type:"function",arguments:[{label:"value",type:"any"}],returns:["null"]},push:{type:"function",arguments:[{label:"value",type:"any"}],returns:["map","list","null"]},pull:{type:"function",returns:["any"]},pop:{type:"function",returns:["any"]},shuffle:{type:"function",returns:["null"]},sum:{type:"function",returns:["number"]},indexes:{type:"function",returns:["list"]},len:{type:"function",returns:["number"]},values:{type:"function",returns:["list"]}}}});var gO=m((lV,U2)=>{U2.exports={type:"general",definitions:{hasIndex:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"index",type:"any"}],returns:["number","null"]},print:{type:"function",arguments:[{label:"value",type:"any",default:{type:"string",value:""}},{label:"delimiter",type:"string",opt:!0}],returns:["null"]},indexes:{type:"function",arguments:[{label:"self",types:["map","list","string"]}],returns:["list","null"]},values:{type:"function",arguments:[{label:"self",types:["map","list","string"]}],returns:["list"]},indexOf:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"value",type:"any"},{label:"after",type:"any",opt:!0}],returns:["any","null"]},len:{type:"function",arguments:[{label:"self",types:["list","string","map"]}],returns:["number","null"]},shuffle:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["null"]},val:{type:"function",arguments:[{label:"self",type:"any"}],returns:["number","null"]},lower:{type:"function",arguments:[{label:"self",type:"string"}],returns:["string"]},upper:{type:"function",arguments:[{label:"self",type:"string"}],returns:["string"]},sum:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["number"]},pop:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["any","null"]},pull:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["any","null"]},push:{type:"function",arguments:[{label:"self",types:["list","map"]},{label:"value",type:"any"}],returns:["map","list","null"]},sort:{type:"function",arguments:[{label:"self",type:"list"},{label:"byKey",type:"any"},{label:"ascending",type:"number",default:{type:"number",value:1}}],returns:["list","null"]},remove:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"key",type:"any"}],returns:["list","map","string"]},wait:{type:"function",arguments:[{label:"seconds",type:"number",default:{type:"number",value:1}}],returns:["null"]},abs:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},acos:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},asin:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},atan:{type:"function",arguments:[{label:"y",type:"number",default:{type:"number",value:0}},{label:"x",type:"number",default:{type:"number",value:1}}],returns:["number"]},tan:{type:"function",arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},cos:{type:"function",arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},code:{type:"function",arguments:[{label:"value",type:"string"}],returns:["number"]},char:{type:"function",arguments:[{label:"codePoint",type:"number",default:{type:"number",value:65}}],returns:["string"]},sin:{type:"function",arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},floor:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},range:{type:"function",arguments:[{label:"start",type:"number",default:{type:"number",value:0}},{label:"end",type:"number",default:{type:"number",value:0}},{label:"inc",type:"number",opt:!0}],returns:[{type:"list",valueType:"number"}]},round:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}},{label:"decimalPlaces",type:"number",default:{type:"number",value:0}}],returns:["number"]},rnd:{type:"function",arguments:[{label:"seed",type:"number",opt:!0}],returns:["number"]},sign:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},sqrt:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},str:{type:"function",arguments:[{label:"value",type:"any"}],returns:["string"]},ceil:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},pi:{type:"function",returns:["number"]},slice:{type:"function",arguments:[{label:"seq",types:["list","string"]},{label:"from",type:"number",default:{type:"number",value:0}},{label:"to",type:"number",opt:!0}],returns:["list","string"]},hash:{type:"function",arguments:[{label:"value",type:"any"}],returns:["number"]},time:{type:"function",returns:["number"]},bitAnd:{type:"function",arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},bitOr:{type:"function",arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},bitXor:{type:"function",arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},log:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}},{label:"base",type:"number",default:{type:"number",value:10}}],returns:["number"]},yield:{type:"function",returns:["null"]},insert:{type:"function",arguments:[{label:"self",types:["list","string"]},{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list","string"]},join:{type:"function",arguments:[{label:"self",type:"list"},{label:"delimiter",type:"string",default:{type:"string",value:" "}}],returns:["string"]},split:{type:"function",arguments:[{label:"self",type:"string"},{label:"delimiter",type:"string",default:{type:"string",value:" "}},{label:"maxCount",type:"number",default:{type:"number",value:-1}}],returns:[{type:"list",valueType:"string"}]},replace:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"oldval",type:"any"},{label:"newval",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["list","map","string"]},funcRef:{type:"function",returns:[{type:"map",keyType:"string"}]},list:{type:"function",returns:[{type:"map",keyType:"string"}]},map:{type:"function",returns:[{type:"map",keyType:"string"}]},number:{type:"function",returns:[{type:"map",keyType:"string"}]},string:{type:"function",returns:[{type:"map",keyType:"string"}]},refEquals:{type:"function",arguments:[{label:"a",type:"any"},{label:"b",type:"any"}],returns:["number"]},stackTrace:{type:"function",returns:[{type:"list",valueType:"string"}]},version:{type:"function",returns:["version"]}}}});var mO=m((hV,W2)=>{W2.exports={type:"list",definitions:{remove:{type:"function",arguments:[{label:"index",type:"number"}],returns:["null"]},insert:{type:"function",arguments:[{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list"]},push:{type:"function",arguments:[{label:"value",type:"any"}],returns:["list"]},pop:{type:"function",returns:["any"]},pull:{type:"function",returns:["any"]},shuffle:{type:"function",returns:["null"]},sum:{type:"function",returns:["number"]},hasIndex:{type:"function",arguments:[{label:"index",type:"number"}],returns:["number"]},indexOf:{type:"function",arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["number","null"]},sort:{type:"function",arguments:[{label:"byKey",type:"string"},{label:"ascending",type:"number",default:{type:"number",value:1}}],returns:["list"]},join:{type:"function",arguments:[{label:"delimiter",type:"string",default:{type:"string",value:" "}}],returns:["string"]},indexes:{type:"function",returns:[{type:"list",valueType:"number"}]},len:{type:"function",returns:["number"]},values:{type:"function",returns:["list"]},replace:{type:"function",arguments:[{label:"oldVal",type:"any"},{label:"newVal",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["list"]}}}});var yO=m((dV,H2)=>{H2.exports={type:"map",definitions:{remove:{type:"function",arguments:[{label:"key",type:"string"}],returns:["number"]},push:{type:"function",arguments:[{label:"key",type:"string"}],returns:["map"]},pull:{type:"function",returns:["any"]},pop:{type:"function",returns:["any"]},shuffle:{type:"function",returns:["null"]},sum:{type:"function",returns:["number"]},hasIndex:{type:"function",arguments:[{label:"key",type:"string"}],returns:["number"]},indexOf:{type:"function",arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["any","null"]},indexes:{type:"function",returns:["list"]},len:{type:"function",returns:["number"]},values:{type:"function",returns:["list"]},replace:{type:"function",arguments:[{label:"oldVal",type:"any"},{label:"newVal",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["map"]}}}});var bO=m((fV,G2)=>{G2.exports={type:"number",definitions:{}}});var _O=m((pV,z2)=>{z2.exports={type:"string",definitions:{remove:{type:"function",arguments:[{label:"toDelete",type:"string"}],returns:["string"]},hasIndex:{type:"function",arguments:[{label:"index",type:"number"}],returns:["number"]},insert:{type:"function",arguments:[{label:"index",type:"number"},{label:"value",type:"string"}],returns:["string"]},indexOf:{type:"function",arguments:[{label:"value",type:"string"},{label:"offset",type:"number",opt:!0}],returns:["number","null"]},split:{type:"function",arguments:[{label:"delimiter",type:"string",default:{type:"string",value:" "}},{label:"maxCount",type:"number",default:{type:"number",value:-1}}],returns:[{type:"list",valueType:"string"}]},replace:{type:"function",arguments:[{label:"oldVal",type:"string"},{label:"newVal",type:"string"},{label:"maxCount",type:"number",opt:!0}],returns:["string"]},indexes:{type:"function",returns:[{type:"list",valueType:"number"}]},code:{type:"function",returns:["number"]},len:{type:"function",returns:["number"]},lower:{type:"function",returns:["string"]},upper:{type:"function",returns:["string"]},val:{type:"function",returns:["number"]},values:{type:"function",returns:[{type:"list",valueType:"string"}]}}}});var vO=m((gV,K2)=>{K2.exports={type:"version",extends:"map",definitions:{miniscript:{type:"string"},buildDate:{type:"string"},host:{type:"number"},hostName:{type:"string"},hostInfo:{type:"string"}}}});var Qv=m(Cn=>{"use strict";var Zi=Cn&&Cn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Cn,"__esModule",{value:!0});Cn.miniscriptMeta=void 0;var V2=nr(),X2=Zi(fO()),Y2=Zi(pO()),J2=Zi(gO()),Q2=Zi(mO()),Z2=Zi(yO()),eU=Zi(bO()),tU=Zi(_O()),nU=Zi(vO());Cn.miniscriptMeta=new V2.Container;Cn.miniscriptMeta.addTypeSignatureFromPayload(Y2.default);Cn.miniscriptMeta.addTypeSignatureFromPayload(J2.default);Cn.miniscriptMeta.addTypeSignatureFromPayload(Q2.default);Cn.miniscriptMeta.addTypeSignatureFromPayload(Z2.default);Cn.miniscriptMeta.addTypeSignatureFromPayload(eU.default);Cn.miniscriptMeta.addTypeSignatureFromPayload(tU.default);Cn.miniscriptMeta.addTypeSignatureFromPayload(nU.default);Cn.miniscriptMeta.addMetaFromPayload("en",X2.default)});var Xu=m(Zv=>{"use strict";Object.defineProperty(Zv,"__esModule",{value:!0});var rU=Qv(),iU=Xo();Zv.default=new iU.TypeManager({container:rU.miniscriptMeta})});var wO=m(da=>{"use strict";var sU=da&&da.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(da,"__esModule",{value:!0});da.activate=void 0;var oU=Te(),aU=Xo(),uU=Z_(),cU=sU(Xu()),SO=(t,e)=>{let n=cU.default.get(t.uri),r=n.resolveAllAssignmentsWithQuery(e),i=[];for(let s of r){if(s.node.type!==oU.ASTType.AssignmentStatement)continue;let o=s.node,a=n.resolveNamespace(o.variable,!0);if(a==null)continue;let u=(0,aU.createExpressionId)(o.variable),c=a?.kind?(0,uU.getSymbolItemKind)(a.kind):13,l={line:o.variable.start.line-1,character:o.variable.start.character-1},h={line:o.variable.end.line-1,character:o.variable.end.character-1};i.push({name:u,kind:c,location:{uri:t.uri,range:{start:l,end:h}}})}return i};function lU(t){t.connection.onDocumentSymbol(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);return n==null?void 0:t.documentManager.get(n).document?SO(n,""):[]}),t.connection.onWorkspaceSymbol(e=>{let n=[];for(let r of t.fs.getAllTextDocuments())t.documentManager.get(r).document&&n.push(...SO(r,e.query));return n})}da.activate=lU});var Tf=m(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.buildTokens=ar.semanticTokensLegend=ar.SemanticTokenModifier=ar.SemanticTokenType=void 0;var Ut=Vr(),B=Te(),hU=Qv(),TO=(t,e)=>!!hU.miniscriptMeta.getDefinition(t,e),Y;(function(t){t[t.Keyword=0]="Keyword",t[t.String=1]="String",t[t.Number=2]="Number",t[t.Variable=3]="Variable",t[t.Property=4]="Property",t[t.Function=5]="Function",t[t.Parameter=6]="Parameter",t[t.Operator=7]="Operator",t[t.Comment=8]="Comment",t[t.Constant=9]="Constant",t[t.Punctuator=10]="Punctuator"})(Y=ar.SemanticTokenType||(ar.SemanticTokenType={}));var eS;(function(t){t[t.Declaration=0]="Declaration",t[t.Definition=1]="Definition",t[t.Readonly=2]="Readonly",t[t.Static=3]="Static",t[t.Deprecated=4]="Deprecated",t[t.Abstract=5]="Abstract",t[t.Async=6]="Async",t[t.Modification=7]="Modification",t[t.Documentation=8]="Documentation",t[t.DefaultLibrary=9]="DefaultLibrary"})(eS=ar.SemanticTokenModifier||(ar.SemanticTokenModifier={}));ar.semanticTokensLegend={tokenTypes:["keyword","string","number","variable","property","function","parameter","operator","comment","constant","punctuator"],tokenModifiers:["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"]};var EO=t=>1<<t,tS=class{constructor(e,n){this._lexer=e,this._builder=n,this._validator=new B.ParserValidatorm}next(){this.previousToken=this.token,this.token=this._lexer.next()}isType(e){return this.token!==null&&e===this.token.type}consume(e){return e(this.token)?(this.next(),!0):!1}consumeMany(e){return e(this.token)?(this.next(),!0):!1}requireType(e){let n=this.token;return this.token.type!==e?null:(this.next(),n)}requireToken(e){let n=this.token;return e(n)?(this.next(),n):null}requireTokenOfAny(e){let n=this.token;return e(n)?(this.next(),n):null}skipNewlines(){let e=this;for(;;){if(B.Selectors.Comment(e.token))this._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length+2,Y.Comment,0);else if(!B.Selectors.EndOfLine(e.token))break;e.next()}}processIdentifier(e=!1,n=!1){let r=this,i=r.requireType(B.TokenType.Identifier);if(i)if(n)r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Y.Parameter,0);else if(e){let o=TO(["any"],i.value)?EO(eS.DefaultLibrary):0;r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Y.Property,o)}else{let o=TO(["general"],i.value)?EO(eS.DefaultLibrary):0;r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Y.Variable,o)}}processLiteral(){let e=this.token;switch(e.type){case B.TokenType.StringLiteral:{this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,Y.String,0);break}case B.TokenType.NumericLiteral:{this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,Y.Number,0);break}case B.TokenType.BooleanLiteral:case B.TokenType.NilLiteral:{this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,Y.Constant,0);break}}this.next()}processAtom(e=!1,n=!1){let r=this;if(Ut.Selectors.Envar(r.token))return r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Keyword,0),r.next(),r.processFeatureEnvarExpression();if(Ut.Selectors.Inject(r.token))return r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Keyword,0),r.next(),r.processFeatureInjectExpression();if(Ut.Selectors.Line(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Keyword,0),r.next();return}else if(Ut.Selectors.File(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Keyword,0),r.next();return}if(r._validator.isLiteral(r.token.type))return r.processLiteral();if(r.isType(B.TokenType.Identifier))return r.processIdentifier()}processQuantity(e=!1,n=!1){let r=this;if(!B.Selectors.LParenthesis(r.token))return r.processAtom(e,n);r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next(),r.skipNewlines(),r.processExpr();let i=r.requireToken(B.Selectors.RParenthesis);i&&r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Y.Punctuator,0)}processList(e=!1,n=!1){let r=this;if(!B.Selectors.SLBracket(r.token))return r.processQuantity(e,n);if(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next(),B.Selectors.SRBracket(r.token))r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next();else for(r.skipNewlines();!B.Selectors.EndOfFile(r.token);){if(B.Selectors.SRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next();break}if(r.processExpr(),B.Selectors.MapSeperator(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next(),r.skipNewlines()),B.Selectors.SRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next();break}}}processMap(e=!1,n=!1){let r=this;if(!B.Selectors.CLBracket(r.token))return r.processList(e,n);if(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next(),B.Selectors.CRBracket(r.token))r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next();else for(r.skipNewlines();!B.Selectors.EndOfFile(r.token);){if(B.Selectors.CRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next();break}r.processExpr();let i=r.requireToken(B.Selectors.MapKeyValueSeperator);if(!i)return;if(r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Y.Punctuator,0),r.skipNewlines(),r.processExpr(),B.Selectors.MapSeperator(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next(),r.skipNewlines()),B.Selectors.CRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next();break}}}processCallArgs(){let e=this;if(B.Selectors.LParenthesis(e.token))if(e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Y.Punctuator,0),e.next(),B.Selectors.RParenthesis(e.token))e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Y.Punctuator,0),e.next();else for(;!B.Selectors.EndOfFile(e.token);){e.skipNewlines(),e.processExpr(),e.skipNewlines();let n=e.requireTokenOfAny(B.SelectorGroups.CallArgsEnd);if(!n)return;if(B.Selectors.RParenthesis(n)){e._builder.push(n.start.line-1,n.start.character-1,n.value.length,Y.Punctuator,0);break}else if(!B.Selectors.ArgumentSeperator(n))break}}processCallExpr(e=!1,n=!1){let r=this;for(r.processMap(e,n);!B.Selectors.EndOfFile(r.token);)if(B.Selectors.MemberSeperator(r.token))r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next(),r.skipNewlines(),r.processIdentifier(!0);else if(B.Selectors.SLBracket(r.token)&&!r.token.afterSpace){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next(),r.skipNewlines(),B.Selectors.SliceSeperator(r.token)?(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next(),r.skipNewlines(),B.Selectors.SRBracket(r.token)?r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0):r.processExpr()):(r.processExpr(),B.Selectors.SliceSeperator(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next(),r.skipNewlines(),B.Selectors.SRBracket(r.token)?r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0):r.processExpr()));let i=r.requireToken(B.Selectors.SRBracket);if(!i)return;r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Y.Punctuator,0)}else if(B.Selectors.LParenthesis(r.token)&&(!e||!r.token.afterSpace))r.processCallArgs();else break}processPower(e=!1,n=!1){let r=this;r.processCallExpr(e,n),B.Selectors.Power(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Operator,0),r.next(),r.skipNewlines(),r.processCallExpr())}processAddressOf(e=!1,n=!1){let r=this;if(!B.Selectors.Reference(r.token))return r.processPower(e,n);r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next(),r.skipNewlines(),r.processPower()}processNew(e=!1,n=!1){let r=this;if(!B.Selectors.New(r.token))return r.processAddressOf(e,n);r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Keyword,0),r.next(),r.skipNewlines(),r.processNew()}processUnaryMinus(e=!1,n=!1){let r=this;if(!B.Selectors.Minus(r.token))return r.processNew(e,n);r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Operator,0),r.next(),r.skipNewlines(),r.processNew()}processMultDiv(e=!1,n=!1){let r=this;for(r.processUnaryMinus(e,n);B.SelectorGroups.MultiDivOperators(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Operator,0),r.next(),r.skipNewlines(),r.processUnaryMinus()}processBitwise(e=!1,n=!1){let r=this;for(r.processMultDiv(e,n);Ut.SelectorGroups.BitwiseOperators(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Operator,0),r.next(),r.skipNewlines(),r.processMultDiv()}processAddSub(e=!1,n=!1){let r=this;for(r.processBitwise(e,n);B.Selectors.Plus(r.token)||B.Selectors.Minus(r.token)&&(!n||!r.token.afterSpace||r._lexer.isAtWhitespace());)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Operator,0),r.next(),r.skipNewlines(),r.processBitwise()}processComparisons(e=!1,n=!1){let r=this;if(r.processAddSub(e,n),!!B.SelectorGroups.ComparisonOperators(r.token))do r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Operator,0),r.next(),r.skipNewlines(),r.processAddSub();while(B.SelectorGroups.ComparisonOperators(r.token))}processBitwiseAnd(e=!1,n=!1){let r=this;for(r.processComparisons(e,n);Ut.Selectors.BitwiseAnd(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next(),r.processComparisons()}processBitwiseOr(e=!1,n=!1){let r=this;for(r.processBitwiseAnd(e,n);Ut.Selectors.BitwiseOr(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next(),r.processBitwiseAnd()}processIsa(e=!1,n=!1){let r=this;r.processBitwiseOr(e,n),B.Selectors.Isa(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Keyword,0),r.next(),r.skipNewlines(),r.processBitwiseOr())}processNot(e=!1,n=!1){let r=this;if(B.Selectors.Not(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Keyword,0),r.next(),r.skipNewlines(),r.processIsa();return}r.processIsa(e,n)}processAnd(e=!1,n=!1){let r=this;for(r.processNot(e,n);B.Selectors.And(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Keyword,0),r.next(),r.skipNewlines(),r.processNot()}processOr(e=!1,n=!1){let r=this;for(r.processAnd(e,n);B.Selectors.Or(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Keyword,0),r.next(),r.skipNewlines(),r.processAnd()}processFunctionDeclaration(e=!1,n=!1){let r=this;if(!B.Selectors.Function(r.token))return r.processOr(e,n);if(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Keyword,0),r.next(),!B.SelectorGroups.BlockEndOfLine(r.token)){let i=r.requireToken(B.Selectors.LParenthesis);if(!i)return;for(r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Y.Punctuator,0);!B.SelectorGroups.FunctionDeclarationArgEnd(r.token)&&(r.processIdentifier(!1,!0),r.consume(B.Selectors.Assign)&&(r._builder.push(r.previousToken.start.line-1,r.previousToken.start.character-1,r.previousToken.value.length,Y.Operator,0),r.processExpr()),!B.Selectors.RParenthesis(r.token));){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0);let o=r.requireToken(B.Selectors.ArgumentSeperator);if(!o)return;if(r._builder.push(o.start.line-1,o.start.character-1,o.value.length,Y.Punctuator,0),B.Selectors.RParenthesis(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0);break}}let s=r.requireToken(B.Selectors.RParenthesis);if(!s)return;r._builder.push(s.start.line-1,s.start.character-1,s.value.length,Y.Punctuator,0)}}processExpr(e=!1,n=!1){this.processFunctionDeclaration(e,n)}processForShortcutStatement(){this.processShortcutStatement()}processForStatement(){let e=this;e.processIdentifier();let n=e.requireToken(B.Selectors.In);n&&(e._builder.push(n.start.line-1,n.start.character-1,n.value.length,Y.Keyword,0),e.processExpr(),B.SelectorGroups.BlockEndOfLine(e.token)||e.processForShortcutStatement())}processWhileShortcutStatement(){this.processShortcutStatement()}processWhileStatement(){let e=this;if(e.processExpr(),!B.SelectorGroups.BlockEndOfLine(e.token))return e.processWhileShortcutStatement()}processIfShortcutStatement(){let e=this;e.processShortcutStatement(),B.Selectors.Else(e.token)&&(e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Y.Keyword,0),e.next(),e.processShortcutStatement())}processNextIfClause(e){let n=this;switch(e){case B.ASTType.ElseifClause:{n.processExpr();let r=n.requireToken(B.Selectors.Then);if(!r)return;n._builder.push(r.start.line-1,r.start.character-1,r.value.length,Y.Keyword,0);break}case B.ASTType.ElseClause:break}}processIfStatement(){let e=this;e.processExpr();let n=e.requireToken(B.Selectors.Then);n&&(e._builder.push(n.start.line-1,n.start.character-1,n.value.length,Y.Keyword,0),B.SelectorGroups.BlockEndOfLine(e.token)||e.processIfShortcutStatement())}processReturnStatement(){let e=this;B.SelectorGroups.ReturnStatementEnd(e.token)||e.processExpr()}processAssignment(){let e=this,n=e.token;if(e.processExpr(!0,!0),B.SelectorGroups.AssignmentEndOfExpr(e.token))return;if(B.Selectors.Assign(e.token)){e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Y.Operator,0),e.next(),e.processExpr();return}else if(B.SelectorGroups.AssignmentShorthand(e.token)){let i=e.token;e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Y.Operator,0),e.next(),e.processExpr();return}let r=[];for(;!B.Selectors.EndOfFile(e.token)&&(e.processExpr(),!(B.SelectorGroups.BlockEndOfLine(e.token)||B.Selectors.Else(e.token)));){if(B.Selectors.ArgumentSeperator(e.token)){e.next(),e.skipNewlines();continue}let i=e.requireTokenOfAny(B.SelectorGroups.AssignmentCommandArgs);if(!i)return;if(B.Selectors.EndOfLine(i)||B.Selectors.EndOfFile(i))break}r.length}processShortcutStatement(){let e=this;if(B.TokenType.Keyword===e.token.type&&B.Keyword.Not!==e.token.value){let n=e.token.value;switch(this._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Y.Keyword,0),n){case B.Keyword.Return:e.next(),e.processReturnStatement();case B.Keyword.Continue:{e.next();return}case B.Keyword.Break:{e.next();return}default:}}return e.processAssignment()}processPathSegment(){let e=this;if(this.token.type===B.ASTType.StringLiteral){let r=this.token;e._builder.push(r.start.line-1,r.start.character-1,r.raw.length,Y.String,0),this.next();return}let n="";for(;!Ut.SelectorGroups.PathSegmentEnd(e.token);)e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Y.String,0),n=n+e.token.value,e.next();return e.consumeMany(Ut.SelectorGroups.PathSegmentEnd)&&e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Y.Punctuator,0),n}processFeatureEnvarExpression(){let e=this;e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Y.String,0),e.next()}processFeatureInjectExpression(){this.processPathSegment()}processFeatureImportStatement(){let e=this;e.processIdentifier(),e.consume(Ut.Selectors.From)&&(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Y.Keyword,0),e.processPathSegment())}processFeatureIncludeStatement(){this.processPathSegment()}processNativeImportCodeStatement(){let e=this;if(e.consume(B.Selectors.LParenthesis)){if(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Y.Punctuator,0),B.TokenType.StringLiteral===e.token.type){let n=e.token;e._builder.push(n.start.line-1,n.start.character-1,n.raw.length,Y.String,0),e.next()}else return;if(e.consume(B.Selectors.ImportCodeSeperator)){if(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Y.Punctuator,0),!e.isType(B.TokenType.StringLiteral))return;let n=e.token;e._builder.push(n.start.line-1,n.start.character-1,n.raw.length,Y.String,0),e.next()}e.consume(B.Selectors.RParenthesis)&&e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Y.Punctuator,0)}}processKeyword(){let e=this,n=e.token.value;switch(this._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Y.Keyword,0),n){case B.Keyword.Return:{e.next(),e.processReturnStatement();return}case B.Keyword.If:{e.next(),e.processIfStatement();return}case B.Keyword.ElseIf:{e.next(),e.processNextIfClause(B.ASTType.ElseifClause);return}case B.Keyword.Else:{e.next(),e.processNextIfClause(B.ASTType.ElseClause);return}case B.Keyword.While:{e.next(),e.processWhileStatement();return}case B.Keyword.For:{e.next(),e.processForStatement();return}case B.Keyword.EndFunction:{e.next();return}case B.Keyword.EndFor:{e.next();return}case B.Keyword.EndWhile:{e.next();return}case B.Keyword.EndIf:{e.next();return}case B.Keyword.Continue:{e.next();return}case B.Keyword.Break:{e.next();return}case Ut.GreybelKeyword.Include:case Ut.GreybelKeyword.IncludeWithComment:{e.next(),e.processFeatureIncludeStatement();return}case Ut.GreybelKeyword.Import:case Ut.GreybelKeyword.ImportWithComment:{e.next(),e.processFeatureImportStatement();return}case Ut.GreybelKeyword.Envar:{e.next(),e.processFeatureEnvarExpression();return}case Ut.GreybelKeyword.Inject:{e.next(),e.processFeatureInjectExpression();return}case Ut.GreybelKeyword.Debugger:e.next()}}processStatement(){let e=this;if(B.TokenType.Keyword===e.token.type&&B.Keyword.Not!==e.token.value){e.processKeyword();return}e.processAssignment()}process(){let e=this;for(e.next();!B.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!B.Selectors.EndOfFile(e.token));)e.processStatement()}};function dU(t,e){let n=new Ut.Lexer(e.content,{unsafe:!0});return new tS(n,t).process(),t}ar.buildTokens=dU});var xO=m(Ef=>{"use strict";Object.defineProperty(Ef,"__esModule",{value:!0});Ef.activate=void 0;var fU=Tf();function pU(t){t.connection.languages.semanticTokens.on(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=t.documentManager.get(n);if(!r.document)return;let i=t.createSemanticTokensBuilder();return(0,fU.buildTokens)(i,r),i.build()})}Ef.activate=pU});var kO=m(xf=>{"use strict";Object.defineProperty(xf,"__esModule",{value:!0});xf.buildFoldingRanges=void 0;var Jr=Te(),nS=bm(),gU=Od();function mU(t){let e=[];return new gU.ScraperWalker((r,i)=>{if(r.start.line===r.end.line)return null;switch(r.type){case Jr.ASTType.Comment:return e.push({startLine:r.start.line-1,endLine:r.end.line-1,kind:nS.FoldingRangeKind.Comment}),null;case Jr.ASTType.MapConstructorExpression:case Jr.ASTType.ListConstructorExpression:case Jr.ASTType.StringLiteral:case Jr.ASTType.WhileStatement:case Jr.ASTType.ForGenericStatement:case Jr.ASTType.FunctionDeclaration:return e.push({startLine:r.start.line-1,endLine:r.end.line-1,kind:nS.FoldingRangeKind.Region}),null;case Jr.ASTType.IfClause:case Jr.ASTType.ElseifClause:case Jr.ASTType.ElseClause:return e.push({startLine:r.start.line-1,endLine:r.end.line-2,kind:nS.FoldingRangeKind.Region}),null}return null}).visit(t.document),e}xf.buildFoldingRanges=mU});var AO=m(kf=>{"use strict";Object.defineProperty(kf,"__esModule",{value:!0});kf.activate=void 0;var yU=kO();function bU(t){t.connection.languages.foldingRange.on(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=t.documentManager.get(n);if(r.document)return(0,yU.buildFoldingRanges)(r)})}kf.activate=bU});var Of=m((xV,PO)=>{var Yu=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,_U=typeof AbortController=="function",Af=_U?AbortController:class{constructor(){this.signal=new CO}abort(e=new Error("This operation was aborted")){this.signal.reason=this.signal.reason||e,this.signal.aborted=!0,this.signal.dispatchEvent({type:"abort",target:this.signal})}},vU=typeof AbortSignal=="function",SU=typeof Af.AbortSignal=="function",CO=vU?AbortSignal:SU?Af.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(e){e.type==="abort"&&(this.aborted=!0,this.onabort(e),this._listeners.forEach(n=>n(e),this))}onabort(){}addEventListener(e,n){e==="abort"&&this._listeners.push(n)}removeEventListener(e,n){e==="abort"&&(this._listeners=this._listeners.filter(r=>r!==n))}},oS=new Set,rS=(t,e)=>{let n=`LRU_CACHE_OPTION_${t}`;Cf(n)&&aS(n,`${t} option`,`options.${e}`,pa)},iS=(t,e)=>{let n=`LRU_CACHE_METHOD_${t}`;if(Cf(n)){let{prototype:r}=pa,{get:i}=Object.getOwnPropertyDescriptor(r,t);aS(n,`${t} method`,`cache.${e}()`,i)}},wU=(t,e)=>{let n=`LRU_CACHE_PROPERTY_${t}`;if(Cf(n)){let{prototype:r}=pa,{get:i}=Object.getOwnPropertyDescriptor(r,t);aS(n,`${t} property`,`cache.${e}`,i)}},OO=(...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},Cf=t=>!oS.has(t),aS=(t,e,n,r)=>{oS.add(t);let i=`The ${e} is deprecated. Please use ${n} instead.`;OO(i,"DeprecationWarning",t,r)},es=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),RO=t=>es(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?fa:null:null,fa=class extends Array{constructor(e){super(e),this.fill(0)}},sS=class{constructor(e){if(e===0)return[];let n=RO(e);this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},pa=class t{constructor(e={}){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:c,disposeAfter:l,noDisposeOnSet:h,noUpdateTTL:d,maxSize:g=0,maxEntrySize:y=0,sizeCalculation:_,fetchMethod:C,fetchContext:k,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:v,allowStaleOnFetchAbort:L,ignoreFetchAbort:R}=e,{length:U,maxAge:te,stale:se}=e instanceof t?{}:e;if(n!==0&&!es(n))throw new TypeError("max option must be a nonnegative integer");let W=n?RO(n):Array;if(!W)throw new Error("invalid max value: "+n);if(this.max=n,this.maxSize=g,this.maxEntrySize=y||this.maxSize,this.sizeCalculation=_||U,this.sizeCalculation){if(!this.maxSize&&!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(this.fetchMethod=C||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=k,!this.fetchMethod&&k!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(n).fill(null),this.valList=new Array(n).fill(null),this.next=new W(n),this.prev=new W(n),this.head=0,this.tail=0,this.free=new sS(n),this.initialFill=1,this.size=0,typeof c=="function"&&(this.dispose=c),typeof l=="function"?(this.disposeAfter=l,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!h,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!T,this.allowStaleOnFetchRejection=!!v,this.allowStaleOnFetchAbort=!!L,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.maxSize!==0&&!es(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!es(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!u||!!se,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=es(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||te||0,this.ttl){if(!es(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){let O="LRU_CACHE_UNBOUNDED";Cf(O)&&(oS.add(O),OO("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",O,t))}se&&rS("stale","allowStale"),te&&rS("maxAge","ttl"),U&&rS("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new fa(this.max),this.starts=new fa(this.max),this.setItemTTL=(r,i,s=Yu.now())=>{if(this.starts[r]=i!==0?s:0,this.ttls[r]=i,i!==0&&this.ttlAutopurge){let o=setTimeout(()=>{this.isStale(r)&&this.delete(this.keyList[r])},i+1);o.unref&&o.unref()}},this.updateItemAge=r=>{this.starts[r]=this.ttls[r]!==0?Yu.now():0},this.statusTTL=(r,i)=>{r&&(r.ttl=this.ttls[i],r.start=this.starts[i],r.now=e||n(),r.remainingTTL=r.now+r.ttl-r.start)};let e=0,n=()=>{let r=Yu.now();if(this.ttlResolution>0){e=r;let i=setTimeout(()=>e=0,this.ttlResolution);i.unref&&i.unref()}return r};this.getRemainingTTL=r=>{let i=this.keyMap.get(r);return i===void 0?0:this.ttls[i]===0||this.starts[i]===0?1/0:this.starts[i]+this.ttls[i]-(e||n())},this.isStale=r=>this.ttls[r]!==0&&this.starts[r]!==0&&(e||n())-this.starts[r]>this.ttls[r]}updateItemAge(e){}statusTTL(e,n){}setItemTTL(e,n,r){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new fa(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,n,r,i)=>{if(this.isBackgroundFetch(n))return 0;if(!es(r))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(r=i(n,e),!es(r))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 r},this.addItemSize=(e,n,r)=>{if(this.sizes[e]=n,this.maxSize){let i=this.maxSize-this.sizes[e];for(;this.calculatedSize>i;)this.evict(!0)}this.calculatedSize+=this.sizes[e],r&&(r.entrySize=n,r.totalCalculatedSize=this.calculatedSize)}}removeItemSize(e){}addItemSize(e,n){}requireSize(e,n,r,i){if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let n=this.tail;!(!this.isValidIndex(n)||((e||!this.isStale(n))&&(yield n),n===this.head));)n=this.prev[n]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let n=this.head;!(!this.isValidIndex(n)||((e||!this.isStale(n))&&(yield n),n===this.tail));)n=this.next[n]}isValidIndex(e){return e!==void 0&&this.keyMap.get(this.keyList[e])===e}*entries(){for(let e of this.indexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*rentries(){for(let e of this.rindexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*keys(){for(let e of this.indexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*rkeys(){for(let e of this.rindexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*values(){for(let e of this.indexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}*rvalues(){for(let e of this.rindexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}[Symbol.iterator](){return this.entries()}find(e,n){for(let r of this.indexes()){let i=this.valList[r],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.keyList[r],this))return this.get(this.keyList[r],n)}}forEach(e,n=this){for(let r of this.indexes()){let i=this.valList[r],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.keyList[r],this)}}rforEach(e,n=this){for(let r of this.rindexes()){let i=this.valList[r],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.keyList[r],this)}}get prune(){return iS("prune","purgeStale"),this.purgeStale}purgeStale(){let e=!1;for(let n of this.rindexes({allowStale:!0}))this.isStale(n)&&(this.delete(this.keyList[n]),e=!0);return e}dump(){let e=[];for(let n of this.indexes({allowStale:!0})){let r=this.keyList[n],i=this.valList[n],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;if(s===void 0)continue;let o={value:s};if(this.ttls){o.ttl=this.ttls[n];let a=Yu.now()-this.starts[n];o.start=Math.floor(Date.now()-a)}this.sizes&&(o.size=this.sizes[n]),e.unshift([r,o])}return e}load(e){this.clear();for(let[n,r]of e){if(r.start){let i=Date.now()-r.start;r.start=Yu.now()-i}this.set(n,r.value,r)}}dispose(e,n,r){}set(e,n,{ttl:r=this.ttl,start:i,noDisposeOnSet:s=this.noDisposeOnSet,size:o=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,status:c}={}){if(o=this.requireSize(e,n,o,a),this.maxEntrySize&&o>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.delete(e),this;let l=this.size===0?void 0:this.keyMap.get(e);if(l===void 0)l=this.newIndex(),this.keyList[l]=e,this.valList[l]=n,this.keyMap.set(e,l),this.next[this.tail]=l,this.prev[l]=this.tail,this.tail=l,this.size++,this.addItemSize(l,o,c),c&&(c.set="add"),u=!1;else{this.moveToTail(l);let h=this.valList[l];if(n!==h){if(this.isBackgroundFetch(h)?h.__abortController.abort(new Error("replaced")):s||(this.dispose(h,e,"set"),this.disposeAfter&&this.disposed.push([h,e,"set"])),this.removeItemSize(l),this.valList[l]=n,this.addItemSize(l,o,c),c){c.set="replace";let d=h&&this.isBackgroundFetch(h)?h.__staleWhileFetching:h;d!==void 0&&(c.oldValue=d)}}else c&&(c.set="update")}if(r!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),u||this.setItemTTL(l,r,i),this.statusTTL(c,l),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){let e=this.valList[this.head];return this.evict(!0),e}}evict(e){let n=this.head,r=this.keyList[n],i=this.valList[n];return this.isBackgroundFetch(i)?i.__abortController.abort(new Error("evicted")):(this.dispose(i,r,"evict"),this.disposeAfter&&this.disposed.push([i,r,"evict"])),this.removeItemSize(n),e&&(this.keyList[n]=null,this.valList[n]=null,this.free.push(n)),this.head=this.next[n],this.keyMap.delete(r),this.size--,n}has(e,{updateAgeOnHas:n=this.updateAgeOnHas,status:r}={}){let i=this.keyMap.get(e);if(i!==void 0)if(this.isStale(i))r&&(r.has="stale",this.statusTTL(r,i));else return n&&this.updateItemAge(i),r&&(r.has="hit"),this.statusTTL(r,i),!0;else r&&(r.has="miss");return!1}peek(e,{allowStale:n=this.allowStale}={}){let r=this.keyMap.get(e);if(r!==void 0&&(n||!this.isStale(r))){let i=this.valList[r];return this.isBackgroundFetch(i)?i.__staleWhileFetching:i}}backgroundFetch(e,n,r,i){let s=n===void 0?void 0:this.valList[n];if(this.isBackgroundFetch(s))return s;let o=new Af;r.signal&&r.signal.addEventListener("abort",()=>o.abort(r.signal.reason));let a={signal:o.signal,options:r,context:i},u=(g,y=!1)=>{let{aborted:_}=o.signal,C=r.ignoreFetchAbort&&g!==void 0;return r.status&&(_&&!y?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,C&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),_&&!C&&!y?l(o.signal.reason):(this.valList[n]===d&&(g===void 0?d.__staleWhileFetching?this.valList[n]=d.__staleWhileFetching:this.delete(e):(r.status&&(r.status.fetchUpdated=!0),this.set(e,g,a.options))),g)},c=g=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=g),l(g)),l=g=>{let{aborted:y}=o.signal,_=y&&r.allowStaleOnFetchAbort,C=_||r.allowStaleOnFetchRejection,k=C||r.noDeleteOnFetchRejection;if(this.valList[n]===d&&(!k||d.__staleWhileFetching===void 0?this.delete(e):_||(this.valList[n]=d.__staleWhileFetching)),C)return r.status&&d.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),d.__staleWhileFetching;if(d.__returned===d)throw g},h=(g,y)=>{this.fetchMethod(e,s,a).then(_=>g(_),y),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(g(),r.allowStaleOnFetchAbort&&(g=_=>u(_,!0)))})};r.status&&(r.status.fetchDispatched=!0);let d=new Promise(h).then(u,c);return d.__abortController=o,d.__staleWhileFetching=s,d.__returned=null,n===void 0?(this.set(e,d,{...a.options,status:void 0}),n=this.keyMap.get(e)):this.valList[n]=d,d}isBackgroundFetch(e){return e&&typeof e=="object"&&typeof e.then=="function"&&Object.prototype.hasOwnProperty.call(e,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(e,"__returned")&&(e.__returned===e||e.__returned===null)}async fetch(e,{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:a=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:l=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,fetchContext:y=this.fetchContext,forceRefresh:_=!1,status:C,signal:k}={}){if(!this.fetchMethod)return C&&(C.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:C});let T={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:s,noDisposeOnSet:o,size:a,sizeCalculation:u,noUpdateTTL:c,noDeleteOnFetchRejection:l,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:g,ignoreFetchAbort:d,status:C,signal:k},w=this.keyMap.get(e);if(w===void 0){C&&(C.fetch="miss");let v=this.backgroundFetch(e,w,T,y);return v.__returned=v}else{let v=this.valList[w];if(this.isBackgroundFetch(v)){let se=n&&v.__staleWhileFetching!==void 0;return C&&(C.fetch="inflight",se&&(C.returnedStale=!0)),se?v.__staleWhileFetching:v.__returned=v}let L=this.isStale(w);if(!_&&!L)return C&&(C.fetch="hit"),this.moveToTail(w),r&&this.updateItemAge(w),this.statusTTL(C,w),v;let R=this.backgroundFetch(e,w,T,y),U=R.__staleWhileFetching!==void 0,te=U&&n;return C&&(C.fetch=U&&L?"stale":"refresh",te&&L&&(C.returnedStale=!0)),te?R.__staleWhileFetching:R.__returned=R}}get(e,{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:s}={}){let o=this.keyMap.get(e);if(o!==void 0){let a=this.valList[o],u=this.isBackgroundFetch(a);return this.statusTTL(s,o),this.isStale(o)?(s&&(s.get="stale"),u?(s&&(s.returnedStale=n&&a.__staleWhileFetching!==void 0),n?a.__staleWhileFetching:void 0):(i||this.delete(e),s&&(s.returnedStale=n),n?a:void 0)):(s&&(s.get="hit"),u?a.__staleWhileFetching:(this.moveToTail(o),r&&this.updateItemAge(o),a))}else s&&(s.get="miss")}connect(e,n){this.prev[n]=e,this.next[e]=n}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return iS("del","delete"),this.delete}delete(e){let n=!1;if(this.size!==0){let r=this.keyMap.get(e);if(r!==void 0)if(n=!0,this.size===1)this.clear();else{this.removeItemSize(r);let i=this.valList[r];this.isBackgroundFetch(i)?i.__abortController.abort(new Error("deleted")):(this.dispose(i,e,"delete"),this.disposeAfter&&this.disposed.push([i,e,"delete"])),this.keyMap.delete(e),this.keyList[r]=null,this.valList[r]=null,r===this.tail?this.tail=this.prev[r]:r===this.head?this.head=this.next[r]:(this.next[this.prev[r]]=this.next[r],this.prev[this.next[r]]=this.prev[r]),this.size--,this.free.push(r)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return n}clear(){for(let e of this.rindexes({allowStale:!0})){let n=this.valList[e];if(this.isBackgroundFetch(n))n.__abortController.abort(new Error("deleted"));else{let r=this.keyList[e];this.dispose(n,r,"delete"),this.disposeAfter&&this.disposed.push([n,r,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return iS("reset","clear"),this.clear}get length(){return wU("length","size"),this.size}static get AbortController(){return Af}static get AbortSignal(){return CO}};PO.exports=pa});var jO=m((kV,qO)=>{var hS=Object.defineProperty,TU=Object.getOwnPropertyDescriptor,EU=Object.getOwnPropertyNames,xU=Object.prototype.hasOwnProperty,kU=(t,e)=>{for(var n in e)hS(t,n,{get:e[n],enumerable:!0})},AU=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of EU(e))!xU.call(t,i)&&i!==n&&hS(t,i,{get:()=>e[i],enumerable:!(r=TU(e,i))||r.enumerable});return t},CU=t=>AU(hS({},"__esModule",{value:!0}),t),DO={};kU(DO,{ScheduleIntervalHelper:()=>uS,SchedulePostMessageHelper:()=>cS,ScheduleSetImmmediateHelper:()=>lS,schedule:()=>PU,scheduleProvider:()=>NO});qO.exports=CU(DO);var OU=Promise.prototype.then.bind(Promise.resolve()),dS=class Rf{constructor(){this.queue=[],this.sleep=0}static{this.SLEEP_LIMIT=512}static{this.QUEUE_LIMIT=1024}static isApplicable(){return!1}static createCallback(){throw new Error("Cannot create callback from base schedule helper!")}tick(){let e=this.queue,n=Math.min(e.length,Rf.QUEUE_LIMIT);this.queue=this.queue.slice(Rf.QUEUE_LIMIT);for(let r=0;r<n;OU(e[r++]));if(this.queue.length>0&&(this.sleep=0),this.sleep++<=Rf.SLEEP_LIMIT){this.nextTick();return}this.endTick()}start(){this.isTickActive()||(this.sleep=0,this.startTick())}add(e){this.queue.push(e),this.start()}},uS=class IO extends dS{constructor(){super(...arguments),this.timer=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setInterval}static createCallback(){let e=new IO;return e.add.bind(e)}isTickActive(){return this.timer!==null}startTick(){this.timer=setInterval(this.boundTick,0)}nextTick(){}endTick(){clearInterval(this.timer),this.timer=null}},RU=()=>{try{return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}catch{}return!1},cS=class MO extends dS{constructor(){super(),this.id=(Math.random()+1).toString(36).substring(7),this.active=!1,self.addEventListener("message",this.onMessage.bind(this))}static isApplicable(){return!RU()&&!!self.postMessage&&!!self.addEventListener}static createCallback(){let e=new MO;return e.add.bind(e)}onMessage(e){e.source!==self||e.data!==this.id||this.tick()}isTickActive(){return this.active}startTick(){this.active=!0,self.postMessage(this.id)}nextTick(){self.postMessage(this.id)}endTick(){this.active=!1}},lS=class LO extends dS{constructor(){super(...arguments),this.immediate=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setImmediate}static createCallback(){let e=new LO;return e.add.bind(e)}isTickActive(){return this.immediate!==null}startTick(){this.immediate=setImmediate(this.boundTick)}nextTick(){this.immediate=setImmediate(this.boundTick)}endTick(){clearImmediate(this.immediate),this.immediate=null}};function NO(){if(lS.isApplicable())return lS.createCallback();if(cS.isApplicable())return cS.createCallback();if(uS.isApplicable())return uS.createCallback();throw new Error("No schedule helper fulfills requirements!")}var PU=NO()});var FO=m(jn=>{"use strict";var gS=jn&&jn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(jn,"__esModule",{value:!0});jn.DocumentManager=jn.PROCESSING_TIMEOUT=jn.ActiveDocument=jn.DocumentURIBuilder=void 0;var DU=gS(require("events")),IU=Vr(),MU=gS(Of()),fS=jO(),ga=mf(),LU=gS(Xu()),Pf=class{constructor(e,n=null){this.workspaceFolderUri=n,this.rootPath=e}getFromWorkspaceFolder(e){return this.workspaceFolderUri==null?(console.warn("Workspace folders are not available. Falling back to only relative paths."),ga.Utils.joinPath(this.rootPath,e).toString()):ga.Utils.joinPath(this.workspaceFolderUri,e).toString()}getFromRootPath(e){return ga.Utils.joinPath(this.rootPath,e).toString()}};jn.DocumentURIBuilder=Pf;var Df=class{constructor(e){this.documentManager=e.documentManager,this.content=e.content,this.textDocument=e.textDocument,this.document=e.document,this.errors=e.errors}getDirectory(){return ga.Utils.joinPath(ga.URI.parse(this.textDocument.uri),"..")}async getImportsAndIncludes(e=null){if(this.document==null)return[];let n=this.document,r=this.getDirectory(),i=this.documentManager.context,s=new Pf(r,e),o=u=>u.startsWith("/")?i.fs.findExistingPath(s.getFromWorkspaceFolder(u),s.getFromWorkspaceFolder(`${u}.src`)):i.fs.findExistingPath(s.getFromRootPath(u),s.getFromRootPath(`${u}.src`));return(await Promise.all([...n.imports.filter(u=>u.path).map(u=>o(u.path)),...n.includes.filter(u=>u.path).map(u=>o(u.path))])).filter(u=>u!=null)}async getDependencies(){if(this.document==null)return[];if(this.dependencies)return this.dependencies;let e=await this.documentManager.context.fs.getWorkspaceFolderUri(ga.URI.parse(this.textDocument.uri)),n=await this.getImportsAndIncludes(e),r=new Set([...n]);return this.dependencies=Array.from(r),this.dependencies}async getImports(e=!0){if(this.document==null)return[];let n=new Set,r=new Set([this.textDocument.uri]),i=async s=>{let o=await s.getDependencies();for(let a of o){if(r.has(a))continue;let u=await this.documentManager.open(a);r.add(a),u!==null&&(n.add(u),u.document!==null&&e&&await i(u))}};return await i(this),Array.from(n)}};jn.ActiveDocument=Df;jn.PROCESSING_TIMEOUT=100;var pS=class extends DU.default{get context(){return this._context}setContext(e){return this._context=e,this}constructor(e=jn.PROCESSING_TIMEOUT){super(),this._context=null,this._timer=null,this.results=new MU.default({ttl:1e3*60*20,ttlAutopurge:!0}),this.scheduledItems=new Map,this.tickRef=this.tick.bind(this),this.processingTimeout=e,(0,fS.schedule)(this.tickRef)}tick(){if(this.scheduledItems.size===0){this._timer=null;return}let e=Date.now(),n=Array.from(this.scheduledItems.values());for(let r=0;r<n.length;r++){let i=n[r];e-i.createdAt>this.processingTimeout&&(0,fS.schedule)(()=>this.refresh(i.document))}this._timer=setTimeout(this.tickRef,0)}refresh(e){let n=e.uri;if(!this.scheduledItems.has(n)&&this.results.has(n))return this.results.get(n);let r=this.create(e);return this.results.set(n,r),this.emit("parsed",e,r),this.scheduledItems.delete(n),r}create(e){let n=e.getText(),r=new IU.Parser(n,{unsafe:!0}),i=r.parseChunk();return this._context.documentMerger.flushCacheKey(e.uri),LU.default.analyze(e.uri,i),new Df({documentManager:this,content:n,textDocument:e,document:i,errors:[...r.lexer.errors,...r.errors]})}schedule(e){let n=e.uri,r=e.getText();return this.results.get(n)?.content===r?!1:(this.scheduledItems.set(n,{document:e,createdAt:Date.now()}),this._timer===null&&(this._timer=setTimeout(this.tickRef,0)),!0)}async open(e){try{let n=await this.context.fs.getTextDocument(e);return n==null?null:this.get(n)}catch{return null}}get(e){return this.results.get(e.uri)||this.refresh(e)}getLatest(e,n=5e3){return new Promise(r=>{(0,fS.schedule)(()=>{if(!this.scheduledItems.has(e.uri))return r(this.get(e));let i=()=>{this.removeListener("parsed",s),r(this.get(e))},s=a=>{a.uri===e.uri&&(this.removeListener("parsed",s),clearTimeout(o),r(this.get(e)))},o=setTimeout(i,n);this.addListener("parsed",s)})})}clear(e){this.results.delete(e.uri),this.emit("cleared",e)}};jn.DocumentManager=pS});var BO=m((CV,mS)=>{mS.exports=function(t){return $O(NU(t),t)};mS.exports.array=$O;function $O(t,e){var n=t.length,r=new Array(n),i={},s=n,o=qU(e),a=jU(t);for(e.forEach(function(c){if(!a.has(c[0])||!a.has(c[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});s--;)i[s]||u(t[s],s,new Set);return r;function u(c,l,h){if(h.has(c)){var d;try{d=", node was:"+JSON.stringify(c)}catch{d=""}throw new Error("Cyclic dependency"+d)}if(!a.has(c))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(c));if(!i[l]){i[l]=!0;var g=o.get(c)||new Set;if(g=Array.from(g),l=g.length){h.add(c);do{var y=g[--l];u(y,a.get(y),h)}while(l);h.delete(c)}r[--n]=c}}}function NU(t){for(var e=new Set,n=0,r=t.length;n<r;n++){var i=t[n];e.add(i[0]),e.add(i[1])}return Array.from(e)}function qU(t){for(var e=new Map,n=0,r=t.length;n<r;n++){var i=t[n];e.has(i[0])||e.set(i[0],new Set),e.has(i[1])||e.set(i[1],new Set),e.get(i[0]).add(i[1])}return e}function jU(t){for(var e=new Map,n=0,r=t.length;n<r;n++)e.set(t[n],n);return e}});var UO=m(If=>{"use strict";Object.defineProperty(If,"__esModule",{value:!0});If.hash=void 0;function FU(t){let e=5381,n=t.length;for(;n;)e=e*33^t.charCodeAt(--n);return e>>>0}If.hash=FU});var HO=m(ma=>{"use strict";var bS=ma&&ma.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ma,"__esModule",{value:!0});ma.DocumentMerger=void 0;var $U=bS(Of()),BU=bS(BO()),UU=gs(),WO=UO(),Mf=bS(Xu()),yS=class{constructor(){this.keyToDocumentUriMap=new Map,this.results=new $U.default({ttl:1e3*60*20,ttlAutopurge:!0})}createCacheKey(e,n){let r=(0,WO.hash)(`main-${e.uri}-${e.version}`);for(let i=0;i<n.length;i++){let s=n[i];r^=(0,WO.hash)(`${s.textDocument.uri}-${s.textDocument.version}`),r=r>>>0}return r}registerCacheKey(e,n){this.flushCacheKey(n),this.keyToDocumentUriMap.set(n,e)}flushCacheKey(e){let n=this.keyToDocumentUriMap.get(e);n&&(this.results.delete(n),this.keyToDocumentUriMap.delete(e))}flushCache(){this.results.clear()}async processByDependencies(e,n,r){let i=e.uri;if(r.has(i))return r.get(i);let s=Mf.default.get(i);if(r.set(i,null),!s)return null;let o=[],a=await n.documentManager.get(e).getImports(),u=this.createCacheKey(e,a);if(this.results.has(u))return this.results.get(u);this.registerCacheKey(u,i);let c=await n.documentManager.get(e).getDependencies();await Promise.all(c.map(async h=>{let d=n.documentManager.results.get(h);if(!d)return;let{document:g,textDocument:y}=d;if(!g)return;let _=await this.processByDependencies(y,n,r);_!==null&&o.push(_)}));let l=s.merge(...o);return r.set(i,l),this.results.set(u,l),l}async buildByDependencies(e,n){let r=e.uri,i=Mf.default.get(r);if(!i)return null;let s=[],o=await n.documentManager.get(e).getImports(),a=this.createCacheKey(e,o);if(this.results.has(a))return this.results.get(a);this.registerCacheKey(a,r);let u=await n.documentManager.get(e).getDependencies(),c=new Map([[r,null]]);await Promise.all(u.map(async h=>{let d=n.documentManager.results.get(h);if(!d)return;let{document:g,textDocument:y}=d;if(!g)return;let _=await this.processByDependencies(y,n,c);_!==null&&s.push(_)}));let l=i.merge(...s);return this.results.set(a,l),l}async buildByWorkspace(e,n){let r=e.uri,i=Mf.default.get(r);if(!i)return null;let s=[],o=await n.fs.getWorkspaceRelatedFiles(),a=await Promise.all(o.map(async g=>await n.documentManager.open(g.toString()))),u=this.createCacheKey(e,a);if(this.results.has(u))return this.results.get(u);this.registerCacheKey(u,r);let c=a.map(g=>g.textDocument.uri),l=await Promise.all(a.map(async g=>(await g.getDependencies()).map(_=>[g.textDocument.uri,_]))),h=BU.default.array(c,l.flat());for(let g=h.length-1;g>=0;g--){let y=h[g];if(y===r)continue;let _=Mf.default.get(y);if(_===null)return;s.push(_)}let d=i.merge(...s);return this.results.set(u,d),d}async build(e,n){return n.getConfiguration().typeAnalyzer.strategy===UU.TypeAnalyzerStrategy.Workspace?this.buildByWorkspace(e,n):this.buildByDependencies(e,n)}};ma.DocumentMerger=yS});var KO=m(ya=>{"use strict";var WU=ya&&ya.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ya,"__esModule",{value:!0});ya.CoreContext=void 0;var HU=WU(require("events")),Ju=gs(),GO=Tf();function zO(t){return{fileExtensions:t?.fileExtensions?t.fileExtensions.split(","):Ju.DefaultFileExtensions,formatter:t?.formatter??!0,autocomplete:t?.autocomplete??!0,hoverdocs:t?.hoverdocs??!0,diagnostic:t?.diagnostic??!0,transpiler:{beautify:{keepParentheses:t?.transpiler?.beautify?.keepParentheses??!0,indentation:t?.transpiler?.beautify?.indentation??Ju.IndentationType.Tab,indentationSpaces:t?.transpiler?.beautify?.indentationSpaces??2}},typeAnalyzer:{strategy:t?.typeAnalyzer?.strategy??Ju.TypeAnalyzerStrategy.Dependency,exclude:t?.typeAnalyzer?.exclude??void 0}}}var _S=class extends HU.default{constructor(){super(),this._configuration=zO(),this._features={configuration:!1,workspaceFolder:!1}}get features(){return this._features}getConfiguration(){return this._configuration}async syncConfiguraton(){let e=await this.connection.workspace.getConfiguration(Ju.ConfigurationNamespace),n=zO(e),r=n.typeAnalyzer,i=this._configuration.typeAnalyzer;(r.strategy!==i.strategy||r.exclude!==i.exclude)&&this.documentMerger.flushCache(),this._configuration=n}configureCapabilties(e){this._features.configuration=!!(e.workspace&&e.workspace.configuration),this._features.workspaceFolder=!!(e.workspace&&e.workspace.workspaceFolders)}async onInitialize(e){this.configureCapabilties(e.capabilities);let n={capabilities:{completionProvider:{triggerCharacters:["."],resolveProvider:!0},hoverProvider:!0,colorProvider:!0,definitionProvider:!0,documentFormattingProvider:!0,foldingRangeProvider:!0,signatureHelpProvider:{triggerCharacters:[",","("]},documentSymbolProvider:!0,workspaceSymbolProvider:!0,diagnosticProvider:{identifier:Ju.LanguageId,interFileDependencies:!1,workspaceDiagnostics:!1},semanticTokensProvider:{legend:{tokenTypes:GO.semanticTokensLegend.tokenTypes,tokenModifiers:GO.semanticTokensLegend.tokenModifiers},full:!0},textDocumentSync:2}};return this._features.workspaceFolder&&(n.capabilities.workspace={workspaceFolders:{supported:!0}}),this.emit("ready",this),n}async onInitialized(e){this._features.configuration&&(await this.syncConfiguraton(),this.connection.onDidChangeConfiguration(async()=>{let n=this._configuration;await this.syncConfiguraton(),this.emit("configuration-change",this,this._configuration,n)})),this.emit("loaded",this)}async listen(){this.fs.listen(this.connection),this.connection.onInitialize(this.onInitialize.bind(this)),this.connection.onInitialized(this.onInitialized.bind(this)),this.connection.listen()}};ya.CoreContext=_S});var Lf=m(z=>{"use strict";var GU=z&&z.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),zU=z&&z.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),KU=z&&z.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&GU(e,t,n);return zU(e,t),e},VU=z&&z.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(z,"__esModule",{value:!0});z.CoreContext=z.buildTokens=z.semanticTokensLegend=z.lookupBase=z.lookupIdentifier=z.typeAnalyzer=z.appendTooltipHeader=z.appendTooltipBody=z.formatTypes=z.formatDefaultValue=z.createTooltipHeader=z.createSignatureInfo=z.createHover=z.MarkdownString=z.LookupHelper=z.DocumentMerger=z.DocumentManager=z.ActiveDocument=z.ASTScraper=z.activateFoldingRange=z.activateSemantic=z.activateSymbol=z.activateSubscriptions=z.activateSignature=z.activateHover=z.activateFormatter=z.activateDiagnostic=z.activateDefinition=z.activateColor=z.activateAutocomplete=z.DefaultFileExtensions=z.TypeAnalyzerStrategy=z.ConfigurationNamespace=z.LanguageId=z.IndentationType=void 0;var Qu=gs();Object.defineProperty(z,"IndentationType",{enumerable:!0,get:function(){return Qu.IndentationType}});Object.defineProperty(z,"LanguageId",{enumerable:!0,get:function(){return Qu.LanguageId}});Object.defineProperty(z,"ConfigurationNamespace",{enumerable:!0,get:function(){return Qu.ConfigurationNamespace}});Object.defineProperty(z,"TypeAnalyzerStrategy",{enumerable:!0,get:function(){return Qu.TypeAnalyzerStrategy}});Object.defineProperty(z,"DefaultFileExtensions",{enumerable:!0,get:function(){return Qu.DefaultFileExtensions}});var XU=cC();Object.defineProperty(z,"activateAutocomplete",{enumerable:!0,get:function(){return XU.activate}});var YU=_C();Object.defineProperty(z,"activateColor",{enumerable:!0,get:function(){return YU.activate}});var JU=vC();Object.defineProperty(z,"activateDefinition",{enumerable:!0,get:function(){return JU.activate}});var QU=SC();Object.defineProperty(z,"activateDiagnostic",{enumerable:!0,get:function(){return QU.activate}});var ZU=YC();Object.defineProperty(z,"activateFormatter",{enumerable:!0,get:function(){return ZU.activate}});var eW=nO();Object.defineProperty(z,"activateHover",{enumerable:!0,get:function(){return eW.activate}});var tW=iO();Object.defineProperty(z,"activateSignature",{enumerable:!0,get:function(){return tW.activate}});var nW=oO();Object.defineProperty(z,"activateSubscriptions",{enumerable:!0,get:function(){return nW.activate}});var rW=wO();Object.defineProperty(z,"activateSymbol",{enumerable:!0,get:function(){return rW.activate}});var iW=xO();Object.defineProperty(z,"activateSemantic",{enumerable:!0,get:function(){return iW.activate}});var sW=AO();Object.defineProperty(z,"activateFoldingRange",{enumerable:!0,get:function(){return sW.activate}});z.ASTScraper=KU(Od());var VO=FO();Object.defineProperty(z,"ActiveDocument",{enumerable:!0,get:function(){return VO.ActiveDocument}});Object.defineProperty(z,"DocumentManager",{enumerable:!0,get:function(){return VO.DocumentManager}});var oW=HO();Object.defineProperty(z,"DocumentMerger",{enumerable:!0,get:function(){return oW.DocumentMerger}});var aW=Zo();Object.defineProperty(z,"LookupHelper",{enumerable:!0,get:function(){return aW.LookupHelper}});var uW=bf();Object.defineProperty(z,"MarkdownString",{enumerable:!0,get:function(){return uW.MarkdownString}});var Gs=_f();Object.defineProperty(z,"createHover",{enumerable:!0,get:function(){return Gs.createHover}});Object.defineProperty(z,"createSignatureInfo",{enumerable:!0,get:function(){return Gs.createSignatureInfo}});Object.defineProperty(z,"createTooltipHeader",{enumerable:!0,get:function(){return Gs.createTooltipHeader}});Object.defineProperty(z,"formatDefaultValue",{enumerable:!0,get:function(){return Gs.formatDefaultValue}});Object.defineProperty(z,"formatTypes",{enumerable:!0,get:function(){return Gs.formatTypes}});Object.defineProperty(z,"appendTooltipBody",{enumerable:!0,get:function(){return Gs.appendTooltipBody}});Object.defineProperty(z,"appendTooltipHeader",{enumerable:!0,get:function(){return Gs.appendTooltipHeader}});var cW=Xu();Object.defineProperty(z,"typeAnalyzer",{enumerable:!0,get:function(){return VU(cW).default}});var XO=tv();Object.defineProperty(z,"lookupIdentifier",{enumerable:!0,get:function(){return XO.lookupIdentifier}});Object.defineProperty(z,"lookupBase",{enumerable:!0,get:function(){return XO.lookupBase}});var YO=Tf();Object.defineProperty(z,"semanticTokensLegend",{enumerable:!0,get:function(){return YO.semanticTokensLegend}});Object.defineProperty(z,"buildTokens",{enumerable:!0,get:function(){return YO.buildTokens}});var lW=KO();Object.defineProperty(z,"CoreContext",{enumerable:!0,get:function(){return lW.CoreContext}})});var eR={};yP(eR,{TextDocument:()=>vS});function SS(t,e){if(t.length<=1)return t;let n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);SS(r,e),SS(i,e);let s=0,o=0,a=0;for(;s<r.length&&o<i.length;)e(r[s],i[o])<=0?t[a++]=r[s++]:t[a++]=i[o++];for(;s<r.length;)t[a++]=r[s++];for(;o<i.length;)t[a++]=i[o++];return t}function JO(t,e,n=0){let r=e?[n]:[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);QO(s)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function QO(t){return t===13||t===10}function ZO(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 hW(t){let e=ZO(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var Nf,vS,tR=mP(()=>{"use strict";Nf=class t{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,this._content=i,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 i=ZO(r.range),s=this.offsetAt(i.start),o=this.offsetAt(i.end);this._content=this._content.substring(0,s)+r.text+this._content.substring(o,this._content.length);let a=Math.max(i.start.line,0),u=Math.max(i.end.line,0),c=this._lineOffsets,l=JO(r.text,!1,s);if(u-a===l.length)for(let d=0,g=l.length;d<g;d++)c[d+a+1]=l[d];else l.length<1e4?c.splice(a+1,u-a,...l):this._lineOffsets=c=c.slice(0,a+1).concat(l,c.slice(u+1));let h=r.text.length-(o-s);if(h!==0)for(let d=a+1+l.length,g=c.length;d<g;d++)c[d]=c[d]+h}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=JO(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return{line:0,character:e};for(;r<i;){let o=Math.floor((r+i)/2);n[o]>e?i=o:r=o+1}let s=r-1;return e=this.ensureBeforeEOL(e,n[s]),{line:s,character:e-n[s]}}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];if(e.character<=0)return r;let i=e.line+1<n.length?n[e.line+1]:this._content.length,s=Math.min(r+e.character,i);return this.ensureBeforeEOL(s,r)}ensureBeforeEOL(e,n){for(;e>n&&QO(this._content.charCodeAt(e-1));)e--;return e}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}};(function(t){function e(i,s,o,a){return new Nf(i,s,o,a)}t.create=e;function n(i,s,o){if(i instanceof Nf)return i.update(s,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=n;function r(i,s){let o=i.getText(),a=SS(s.map(hW),(l,h)=>{let d=l.range.start.line-h.range.start.line;return d===0?l.range.start.character-h.range.start.character:d}),u=0,c=[];for(let l of a){let h=i.offsetAt(l.range.start);if(h<u)throw new Error("Overlapping edit");h>u&&c.push(o.substring(u,h)),l.newText.length&&c.push(l.newText),u=i.offsetAt(l.range.end)}return c.push(o.substr(u)),c.join("")}t.applyEdits=r})(vS||(vS={}))});var oR=m((IV,sR)=>{"use strict";sR.exports=rR;function rR(t,e,n){t instanceof RegExp&&(t=nR(t,n)),e instanceof RegExp&&(e=nR(e,n));var r=iR(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 nR(t,e){var n=e.match(t);return n?n[0]:null}rR.range=iR;function iR(t,e,n){var r,i,s,o,a,u=n.indexOf(t),c=n.indexOf(e,u+1),l=u;if(u>=0&&c>0){if(t===e)return[u,c];for(r=[],s=n.length;l>=0&&!a;)l==u?(r.push(l),u=n.indexOf(t,l+1)):r.length==1?a=[r.pop(),c]:(i=r.pop(),i<s&&(s=i,o=c),c=n.indexOf(e,l+1)),l=u<c&&u>=0?u:c;r.length&&(a=[s,o])}return a}});var pR=m((MV,fR)=>{var aR=oR();fR.exports=pW;var uR="\0SLASH"+Math.random()+"\0",cR="\0OPEN"+Math.random()+"\0",TS="\0CLOSE"+Math.random()+"\0",lR="\0COMMA"+Math.random()+"\0",hR="\0PERIOD"+Math.random()+"\0";function wS(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function dW(t){return t.split("\\\\").join(uR).split("\\{").join(cR).split("\\}").join(TS).split("\\,").join(lR).split("\\.").join(hR)}function fW(t){return t.split(uR).join("\\").split(cR).join("{").split(TS).join("}").split(lR).join(",").split(hR).join(".")}function dR(t){if(!t)return[""];var e=[],n=aR("{","}",t);if(!n)return t.split(",");var r=n.pre,i=n.body,s=n.post,o=r.split(",");o[o.length-1]+="{"+i+"}";var a=dR(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function pW(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),Zu(dW(t),!0).map(fW)):[]}function gW(t){return"{"+t+"}"}function mW(t){return/^-?0\d/.test(t)}function yW(t,e){return t<=e}function bW(t,e){return t>=e}function Zu(t,e){var n=[],r=aR("{","}",t);if(!r)return[t];var i=r.pre,s=r.post.length?Zu(r.post,!1):[""];if(/\$$/.test(r.pre))for(var o=0;o<s.length;o++){var a=i+"{"+r.body+"}"+s[o];n.push(a)}else{var u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),l=u||c,h=r.body.indexOf(",")>=0;if(!l&&!h)return r.post.match(/,.*\}/)?(t=r.pre+"{"+r.body+TS+r.post,Zu(t)):[t];var d;if(l)d=r.body.split(/\.\./);else if(d=dR(r.body),d.length===1&&(d=Zu(d[0],!1).map(gW),d.length===1))return s.map(function(W){return r.pre+d[0]+W});var g;if(l){var y=wS(d[0]),_=wS(d[1]),C=Math.max(d[0].length,d[1].length),k=d.length==3?Math.abs(wS(d[2])):1,T=yW,w=_<y;w&&(k*=-1,T=bW);var v=d.some(mW);g=[];for(var L=y;T(L,_);L+=k){var R;if(c)R=String.fromCharCode(L),R==="\\"&&(R="");else if(R=String(L),v){var U=C-R.length;if(U>0){var te=new Array(U+1).join("0");L<0?R="-"+te+R.slice(1):R=te+R}}g.push(R)}}else{g=[];for(var se=0;se<d.length;se++)g.push.apply(g,Zu(d[se],!1))}for(var se=0;se<g.length;se++)for(var o=0;o<s.length;o++){var a=i+g[se]+s[o];(!e||l||a)&&n.push(a)}}return n}});var gR=m(qf=>{"use strict";Object.defineProperty(qf,"__esModule",{value:!0});qf.assertValidPattern=void 0;var _W=1024*64,vW=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>_W)throw new TypeError("pattern is too long")};qf.assertValidPattern=vW});var yR=m(jf=>{"use strict";Object.defineProperty(jf,"__esModule",{value:!0});jf.parseClass=void 0;var SW={"[: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]},ec=t=>t.replace(/[[\]\\-]/g,"\\$&"),wW=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),mR=t=>t.join(""),TW=(t,e)=>{let n=e;if(t.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],i=[],s=n+1,o=!1,a=!1,u=!1,c=!1,l=n,h="";e:for(;s<t.length;){let _=t.charAt(s);if((_==="!"||_==="^")&&s===n+1){c=!0,s++;continue}if(_==="]"&&o&&!u){l=s+1;break}if(o=!0,_==="\\"&&!u){u=!0,s++;continue}if(_==="["&&!u){for(let[C,[k,T,w]]of Object.entries(SW))if(t.startsWith(C,s)){if(h)return["$.",!1,t.length-n,!0];s+=C.length,w?i.push(k):r.push(k),a=a||T;continue e}}if(u=!1,h){_>h?r.push(ec(h)+"-"+ec(_)):_===h&&r.push(ec(_)),h="",s++;continue}if(t.startsWith("-]",s+1)){r.push(ec(_+"-")),s+=2;continue}if(t.startsWith("-",s+1)){h=_,s+=2;continue}r.push(ec(_)),s++}if(l<s)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,t.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!c){let _=r[0].length===2?r[0].slice(-1):r[0];return[wW(_),!1,l-n,!1]}let d="["+(c?"^":"")+mR(r)+"]",g="["+(c?"":"^")+mR(i)+"]";return[r.length&&i.length?"("+d+"|"+g+")":r.length?d:g,a,l-n,!0]};jf.parseClass=TW});var $f=m(Ff=>{"use strict";Object.defineProperty(Ff,"__esModule",{value:!0});Ff.unescape=void 0;var EW=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");Ff.unescape=EW});var kS=m(Wf=>{"use strict";Object.defineProperty(Wf,"__esModule",{value:!0});Wf.AST=void 0;var xW=yR(),Bf=$f(),kW=new Set(["!","?","+","*","@"]),bR=t=>kW.has(t),AW="(?!(?:^|/)\\.\\.?(?:$|/))",Uf="(?!\\.)",CW=new Set(["[","."]),OW=new Set(["..","."]),RW=new Set("().*{}+?[]^$\\!"),PW=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),xS="[^/]",_R=xS+"*?",vR=xS+"+?",ES=class t{type;#e;#t;#s=!1;#r=[];#o;#v;#c;#h=!1;#a;#u;#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.#c=this.#e===this?[]:this.#e.#c,e==="!"&&!this.#e.#h&&this.#c.push(this),this.#v=this.#o?this.#o.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#u!==void 0?this.#u:this.type?this.#u=this.type+"("+this.#r.map(e=>String(e)).join("|")+")":this.#u=this.#r.map(e=>String(e)).join("")}#m(){if(this!==this.#e)throw new Error("should only call on root");if(this.#h)return this;this.toString(),this.#h=!0;let e;for(;e=this.#c.pop();){if(e.type!=="!")continue;let n=e,r=n.#o;for(;r;){for(let i=n.#v+1;!r.type&&i<r.#r.length;i++)for(let s of e.#r){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#r[i])}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.#r.push(n)}}toJSON(){let e=this.type===null?this.#r.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#r.map(n=>n.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#h&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#v===0)return!0;let e=this.#o;for(let n=0;n<this.#v;n++){let r=e.#r[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.#r.length:0;return this.#v===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.#r)n.copyIn(r);return n}static#y(e,n,r,i){let s=!1,o=!1,a=-1,u=!1;if(n.type===null){let g=r,y="";for(;g<e.length;){let _=e.charAt(g++);if(s||_==="\\"){s=!s,y+=_;continue}if(o){g===a+1?(_==="^"||_==="!")&&(u=!0):_==="]"&&!(g===a+2&&u)&&(o=!1),y+=_;continue}else if(_==="["){o=!0,a=g,u=!1,y+=_;continue}if(!i.noext&&bR(_)&&e.charAt(g)==="("){n.push(y),y="";let C=new t(_,n);g=t.#y(e,C,g,i),n.push(C);continue}y+=_}return n.push(y),g}let c=r+1,l=new t(null,n),h=[],d="";for(;c<e.length;){let g=e.charAt(c++);if(s||g==="\\"){s=!s,d+=g;continue}if(o){c===a+1?(g==="^"||g==="!")&&(u=!0):g==="]"&&!(c===a+2&&u)&&(o=!1),d+=g;continue}else if(g==="["){o=!0,a=c,u=!1,d+=g;continue}if(bR(g)&&e.charAt(c)==="("){l.push(d),d="";let y=new t(g,l);l.push(y),c=t.#y(e,y,c,i);continue}if(g==="|"){l.push(d),d="",h.push(l),l=new t(null,n);continue}if(g===")")return d===""&&n.#r.length===0&&(n.#i=!0),l.push(d),d="",n.push(...h,l),c;d+=g}return n.type=null,n.#t=void 0,n.#r=[e.substring(r-1)],c}static fromGlob(e,n={}){let r=new t(null,void 0,n);return t.#y(e,r,0,n),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[n,r,i,s]=this.toRegExpSource();if(!(i||this.#t||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let a=(this.#a.nocase?"i":"")+(s?"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.#m(),!this.type){let u=this.isStart()&&this.isEnd(),c=this.#r.map(g=>{let[y,_,C,k]=typeof g=="string"?t.#d(g,this.#t,u):g.toRegExpSource(e);return this.#t=this.#t||C,this.#s=this.#s||k,y}).join(""),l="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&OW.has(this.#r[0]))){let y=CW,_=n&&y.has(c.charAt(0))||c.startsWith("\\.")&&y.has(c.charAt(2))||c.startsWith("\\.\\.")&&y.has(c.charAt(4)),C=!n&&!e&&y.has(c.charAt(0));l=_?AW:C?Uf:""}let h="";return this.isEnd()&&this.#e.#h&&this.#o?.type==="!"&&(h="(?:$|\\/)"),[l+c+h,(0,Bf.unescape)(c),this.#t=!!this.#t,this.#s]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#f(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let u=this.toString();return this.#r=[u],this.type=null,this.#t=void 0,[u,(0,Bf.unescape)(this.toString()),!1,!1]}let o=!r||e||n||!Uf?"":this.#f(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#i)a=(this.isStart()&&!n?Uf:"")+vR;else{let u=this.type==="!"?"))"+(this.isStart()&&!n&&!e?Uf:"")+_R+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+u}return[a,(0,Bf.unescape)(s),this.#t=!!this.#t,this.#s]}#f(e){return this.#r.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,i,s,o]=n.toRegExpSource(e);return this.#s=this.#s||o,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#d(e,n,r=!1){let i=!1,s="",o=!1;for(let a=0;a<e.length;a++){let u=e.charAt(a);if(i){i=!1,s+=(RW.has(u)?"\\":"")+u;continue}if(u==="\\"){a===e.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[c,l,h,d]=(0,xW.parseClass)(e,a);if(h){s+=c,o=o||l,a+=h-1,n=n||d;continue}}if(u==="*"){r&&e==="*"?s+=vR:s+=_R,n=!0;continue}if(u==="?"){s+=xS,n=!0;continue}s+=PW(u)}return[s,(0,Bf.unescape)(e),!!n,o]}};Wf.AST=ES});var AS=m(Hf=>{"use strict";Object.defineProperty(Hf,"__esModule",{value:!0});Hf.escape=void 0;var DW=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");Hf.escape=DW});var ts=m(ee=>{"use strict";var IW=ee&&ee.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ee,"__esModule",{value:!0});ee.unescape=ee.escape=ee.AST=ee.Minimatch=ee.match=ee.makeRe=ee.braceExpand=ee.defaults=ee.filter=ee.GLOBSTAR=ee.sep=ee.minimatch=void 0;var MW=IW(pR()),Gf=gR(),TR=kS(),LW=AS(),NW=$f(),qW=(t,e,n={})=>((0,Gf.assertValidPattern)(e),!n.nocomment&&e.charAt(0)==="#"?!1:new zs(e,n).match(t));ee.minimatch=qW;var jW=/^\*+([^+@!?\*\[\(]*)$/,FW=t=>e=>!e.startsWith(".")&&e.endsWith(t),$W=t=>e=>e.endsWith(t),BW=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),UW=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),WW=/^\*+\.\*+$/,HW=t=>!t.startsWith(".")&&t.includes("."),GW=t=>t!=="."&&t!==".."&&t.includes("."),zW=/^\.\*+$/,KW=t=>t!=="."&&t!==".."&&t.startsWith("."),VW=/^\*+$/,XW=t=>t.length!==0&&!t.startsWith("."),YW=t=>t.length!==0&&t!=="."&&t!=="..",JW=/^\?+([^+@!?\*\[\(]*)?$/,QW=([t,e=""])=>{let n=ER([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},ZW=([t,e=""])=>{let n=xR([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},e5=([t,e=""])=>{let n=xR([t]);return e?r=>n(r)&&r.endsWith(e):n},t5=([t,e=""])=>{let n=ER([t]);return e?r=>n(r)&&r.endsWith(e):n},ER=([t])=>{let e=t.length;return n=>n.length===e&&!n.startsWith(".")},xR=([t])=>{let e=t.length;return n=>n.length===e&&n!=="."&&n!==".."},kR=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",SR={win32:{sep:"\\"},posix:{sep:"/"}};ee.sep=kR==="win32"?SR.win32.sep:SR.posix.sep;ee.minimatch.sep=ee.sep;ee.GLOBSTAR=Symbol("globstar **");ee.minimatch.GLOBSTAR=ee.GLOBSTAR;var n5="[^/]",r5=n5+"*?",i5="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",s5="(?:(?!(?:\\/|^)\\.).)*?",o5=(t,e={})=>n=>(0,ee.minimatch)(n,t,e);ee.filter=o5;ee.minimatch.filter=ee.filter;var ur=(t,e={})=>Object.assign({},t,e),a5=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return ee.minimatch;let e=ee.minimatch;return Object.assign((r,i,s={})=>e(r,i,ur(t,s)),{Minimatch:class extends e.Minimatch{constructor(i,s={}){super(i,ur(t,s))}static defaults(i){return e.defaults(ur(t,i)).Minimatch}},AST:class extends e.AST{constructor(i,s,o={}){super(i,s,ur(t,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,ur(t,s))}},unescape:(r,i={})=>e.unescape(r,ur(t,i)),escape:(r,i={})=>e.escape(r,ur(t,i)),filter:(r,i={})=>e.filter(r,ur(t,i)),defaults:r=>e.defaults(ur(t,r)),makeRe:(r,i={})=>e.makeRe(r,ur(t,i)),braceExpand:(r,i={})=>e.braceExpand(r,ur(t,i)),match:(r,i,s={})=>e.match(r,i,ur(t,s)),sep:e.sep,GLOBSTAR:ee.GLOBSTAR})};ee.defaults=a5;ee.minimatch.defaults=ee.defaults;var u5=(t,e={})=>((0,Gf.assertValidPattern)(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,MW.default)(t));ee.braceExpand=u5;ee.minimatch.braceExpand=ee.braceExpand;var c5=(t,e={})=>new zs(t,e).makeRe();ee.makeRe=c5;ee.minimatch.makeRe=ee.makeRe;var l5=(t,e,n={})=>{let r=new zs(e,n);return t=t.filter(i=>r.match(i)),r.options.nonull&&!t.length&&t.push(e),t};ee.match=l5;ee.minimatch.match=ee.match;var wR=/[?*]|[+@!]\(.*?\)|\[|\]/,h5=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),zs=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,n={}){(0,Gf.assertValidPattern)(e),n=n||{},this.options=n,this.pattern=e,this.platform=n.platform||kR,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=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=s[0]===""&&s[1]===""&&(s[2]==="?"||!wR.test(s[2]))&&!wR.test(s[3]),c=/^[a-z]:/i.test(s[0]);if(u)return[...s.slice(0,4),...s.slice(4).map(l=>this.parse(l))];if(c)return[s[0],...s.slice(1).map(l=>this.parse(l))]}return s.map(u=>this.parse(u))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][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 i=0;i<e[r].length;i++)e[r][i]==="**"&&(e[r][i]="*");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 i=r;for(;n[i+1]==="**";)i++;i!==r&&n.splice(r,i-r)}return n})}levelOneOptimize(e){return e.map(n=>(n=n.reduce((r,i)=>{let s=r[r.length-1];return i==="**"&&s==="**"?r:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(i),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 i=1;i<e.length-1;i++){let s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(n=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(n=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let i=e[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&(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 i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let o=i;for(;r[o+1]==="**";)o++;o>i&&r.splice(i+1,o-i);let a=r[i+1],u=r[i+2],c=r[i+3];if(a!==".."||!u||u==="."||u===".."||!c||c==="."||c==="..")continue;n=!0,r.splice(i,1);let l=r.slice(0);l[i]="**",e.push(l),i--}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 s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let o=r[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){n=!0;let u=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...u),r.length===0&&r.push(""),s-=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 i=this.partsMatch(e[n],e[r],!this.preserveMultipleSlashes);if(i){e[n]=[],e[r]=i;break}}return e.filter(n=>n.length)}partsMatch(e,n,r=!1){let i=0,s=0,o=[],a="";for(;i<e.length&&s<n.length;)if(e[i]===n[s])o.push(a==="b"?n[s]:e[i]),i++,s++;else if(r&&e[i]==="**"&&n[s]===e[i+1])o.push(e[i]),i++;else if(r&&n[s]==="**"&&e[i]===n[s+1])o.push(n[s]),s++;else if(e[i]==="*"&&n[s]&&(this.options.dot||!n[s].startsWith("."))&&n[s]!=="**"){if(a==="b")return!1;a="a",o.push(e[i]),i++,s++}else if(n[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(a==="a")return!1;a="b",o.push(n[s]),i++,s++}else return!1;return e.length===n.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,n=!1,r=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)n=!n,r++;r&&(this.pattern=e.slice(r)),this.negate=n}matchOne(e,n,r=!1){let i=this.options;if(this.isWindows){let _=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),C=!_&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),k=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),T=!k&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),w=C?3:_?0:void 0,v=T?3:k?0:void 0;if(typeof w=="number"&&typeof v=="number"){let[L,R]=[e[w],n[v]];L.toLowerCase()===R.toLowerCase()&&(n[v]=L,v>w?n=n.slice(v):w>v&&(e=e.slice(w)))}}let{optimizationLevel:s=1}=this.options;s>=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,u=e.length,c=n.length;o<u&&a<c;o++,a++){this.debug("matchOne loop");var l=n[a],h=e[o];if(this.debug(n,l,h),l===!1)return!1;if(l===ee.GLOBSTAR){this.debug("GLOBSTAR",[n,l,h]);var d=o,g=a+1;if(g===c){for(this.debug("** at the end");o<u;o++)if(e[o]==="."||e[o]===".."||!i.dot&&e[o].charAt(0)===".")return!1;return!0}for(;d<u;){var y=e[d];if(this.debug(`
151
+ hostInfo: URL or other short info about the host app`},stackTrace:{description:"Get a list describing the call stack."},funcRef:{description:"Returns a `map` which enables to extend function references with custom methods.",example:["funcRef.signature = function"," return str(@self)","end function","print (@print).signature"]},list:{description:"Returns a `map` which enables to extend list types with custom methods.",example:["list.map = function(callback)"," newList = []"," for item in self"," newList.push(callback(item, __item_idx))"," end for"," return newList","end function","myMapFunction = function(item, index)",' print "Mapping value at index: " + index'," return item.myValue","end function",'print [{ "myValue": 24 }].map(@myMapFunction)']},number:{description:"Returns a `map` which enables to extend number types with custom methods.",example:["number.add = function(right)"," return self + right","end function","print (1234).add(1)"]},string:{description:"Returns a `map` which enables to extend string types with custom methods.",example:['string.color = function(colorValue = "red")',' return "<color=" + colorValue + ">" + self + "</color>"',"end function",'print "My text: ".color + "Hello world".color("yellow")']},map:{description:"Returns a `map` which enables to extend map types with custom methods.",example:["map.extend = function(value)"," for item in value"," self[item.key] = item.value"," end for"," return self","end function",'test = {"123":123}','test.extend({"bar": "foo"})','print "My extended value: " + test.bar']}}});var vO=m((PV,nW)=>{nW.exports={$meta:{description:"Create a `list` with square brackets. Then iterate over the `list` with for, or pull out individual items with a 0-based index in square brackets. A negative index counts from the end. Get a slice (subset) of a `list` with two indices, separated by a colon.",example:["x = [2, 4, 6, 8]","print(x[0]) // get first item from list","print(x[-1]) // get last item from list","print(x[1:3]) // slice items from index 1 to 3","x[2] = 5 // set item at index 2 to 5","print(x)","print(x + [42]) // concatenate two lists"]},remove:{description:"Removes an item from the `list` with the provided index. Due to the removal the `list` will get mutated.",example:["myList = [1, 42, 3]","myList.remove(1)",'print("This list does not contain the answer to everything: " + myList.split(", "))']},insert:{description:"Inserts a value into the `list` at the index provided. Due to the insertion the `list` will get mutated. Returns the mutated `list`.",example:["myList = [1, 3]","myList.insert(1, 42)",'print("This list does contain the answer to everything: " + myList.split(", "))']},push:{description:"Appends a value to the end of the `list`. This operation will mutate the `list`. Additionally, this method will return the updated `list`.",example:["myList = [1, 3]","myList.push(42)",'print("This list does contain the answer to everything: " + myList.split(", "))']},pop:{description:"Returns and removes the last item in the `list`. This operation will mutate the `list`.",example:["myList = [1, 3, 42]","answer = myList.pop",'print("Answer to everything: " + answer)']},pull:{description:"Returns and removes the first item in the `list`. This operation will mutate the `list`.",example:["myList = [42, 1, 3]","answer = myList.pull",'print("Answer to everything: " + answer)']},shuffle:{description:"Shuffles all values in the `list`. This operation will mutate the `list`.",example:["myList = [42, 1, 3]","myList.shuffle",'print("New list order: " + myList.split(", "))']},sum:{description:"Returns sum of all values inside the `list`. Any non-numeric values will be considered a zero.",example:["myList = [42, 1, 3]","sum = myList.sum",'print("Sum of all items in list: " + sum)']},hasIndex:{description:"Returns `true` if the provided index is available in the `list`. Otherwise, this method will return `false`.",example:["myList = [42, 1, 3]","containsIndex = myList.hasIndex(1)","if containsIndex then",' print("List contains index of 1.")',"else",' print("List does not contain index of 1.")',"end if"]},indexOf:{description:"Returns a `number` which indicates the first matching index of the provided value inside the `list`. Optionally a start index can be provided. In case the value does not exist inside the `list` a `null` gets returned.",example:["myList = [42, 1, 3]","index = myList.indexOf(42)","if index != null then",' print("The answer for everything is at the following index: " + index)',"else",' print("No answer for everything found.")',"end if"]},sort:{description:"Sort `list` values alphanumerically. This operation will mutate the `list`. Optionally a key can be provided which which is used in case the items are maps. Additionally, this method will return the updated `list`.",example:['myList = [{ "key": 42 }, { "key": 2 }, { "key": 1 }]','myList.sort("key")',"print(myList)"]},join:{description:"Returns a concatenated `string` containing all stringified values inside the `list`. These values will be separated via the provided separator.",example:["myList = [42, 1, 3]",`print(myList.join(" .-*'*-. "))`]},indexes:{description:"Returns a `list` containing all available indexes.",example:["myList = [42, 1, 3]","for i in myList.indexes"," print(myList[i])","end for"]},len:{description:"Returns a `number` representing the count of values inside the `list`.",example:["myList = [42, 1, 3]",'print("myList contains " + myList.len + " items")']},values:{description:"Returns a `list` containing all available values.",example:["myList = [42, 1, 3]","for v in myList.values"," print(v)","end for"]},replace:{description:"Returns updated `list` where each value matching with the provided replace argument gets replaced. This operation will mutate the `list`.",example:["myList = [1, 2, 2, 7]","myList.replace(2, 3)",'print(myList.join(""))']}}});var SO=m((DV,rW)=>{rW.exports={$meta:{description:"A `map` is a set of values associated with unique keys. Create a `map` with curly braces; get or set a single value with square brackets. Keys and values may be any type.",example:['x = { "test": 123 }',"x.foo = 42 // set property foo to 42","print(x.foo) // get value of property foo",'print(x + { "bar": 2 }) // concatenate two maps']},remove:{description:"Removes an item from the `map` with the provided key. Due to the removal the `map` will get mutated.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','myMap.remove("answer")',"print(myMap)"]},push:{description:"Adds the value 1 to the provided key. This operation will mutate the `map`. Additionally, this method will return the updated `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','myMap.push("answer")',"print(myMap.answer)"]},pull:{description:"Returns and removes the first item in the `map`. This operation will mutate the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"print(myMap.pull)"]},pop:{description:"Returns and removes the last item in the `map`. This operation will mutate the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"print(myMap.pop)"]},shuffle:{description:"Shuffles all values in the `map`. This operation will mutate the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"myMap.shuffle","print(myMap)"]},sum:{description:"Returns sum of all values inside the `map`. Any non-numeric values will be considered a zero.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"sum = myMap.sum",'print("Sum of all items in map: " + sum)']},hasIndex:{description:"Returns `true` if the provided key is available in the `map`. Otherwise, this method will return `false`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','containsIndex = myList.hasIndex("answer")',"if containsIndex then",' print("Map contains the answer.")',"else",' print("Map does not contain the answer.")',"end if"]},indexOf:{description:"Returns `string` which indicates the key of the provided value inside the `map`. In case the value does not exist inside the `map` a `null` gets returned.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"key = myList.indexOf(42)","if key != null then",' print("Map contains the answer.")',"else",' print("Map does not contain the answer.")',"end if"]},indexes:{description:"Returns a `list` containing all available keys.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"for key in myMap.indexes"," print(myMap[key])","end for"]},len:{description:"Returns a `number` representing the count of items inside the `map`.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }','print("myMap contains " + myMap.len + " items")']},values:{description:"Returns a `list` containing all available values.",example:['myMap = { "answer": 42, "bar": 23, "foo": "moo" }',"for value in myMap.values"," print(value)","end for"]},replace:{description:"Returns updated `map` where each value matching with the provided replace argument gets replaced. This operation will mutate the `map`.",example:['myObject = { "answer": 45 }',"myObject.replace(45, 42)","print(myObject.answer)"]}}});var wO=m((IV,iW)=>{iW.exports={$meta:{description:"All numbers are stored in full-precision format. Numbers also represent `true == 1` and `false == 0`.",example:["a = 20","b = 22","print(a + b) // addition","print(a - b) // substraction","print(a / b) // division","print(a * b) // multiply","print(a % b) // modulo","print(a - b) // substraction","print(a ^ b) // power","print(a and b) // logical and","print(a or b) // logical or","print(not a) // logical not","print(a == b) // comparison equal","print(a != b) // comparison unequal","print(a > b) // comparison greater than","print(a < b) // comparison lower than","print(a >= b) // comparison greater equal than","print(a <= b) // comparison lower equal than"]}}});var TO=m((MV,sW)=>{sW.exports={$meta:{description:"Text is stored in strings of Unicode characters. Write strings by surrounding them with quotes. If you need to include a quotation mark in the string, write it twice.",example:['a = "hello"','b = "world"',"print(a + b) // concatinate a and b","print(a * 10) // repeat hello ten times","print(a[0]) // prints h","print(a[1:3]) // prints ell"]},remove:{description:"Returns a new `string` where the provided `string` got removed.",example:['myString = "42 as an answer is wrong"','newString = myString.remove("wrong")','print(newString + "right")']},hasIndex:{description:"Returns `true` if the provided index is available in the `string`. Otherwise, this method will return `false`.",example:['myString = "42 as an answer is wrong"',"containsIndex = myString.hasIndex(1)","if containsIndex then",' print("String contains index of 1.")',"else",' print("String does not contain index of 1.")',"end if"]},insert:{description:"Returns a `string` with the newly inserted `string` at the provided index.",example:['myString = "42 as an answer is wrong"','index = myString.lastIndexOf("w") - 1','newString = myString.insert(index, "not ")',"print(newString)"]},indexOf:{description:"Returns a `number` which indicates the first matching index of the provided value inside the `list`. Optionally a start index can be provided. In case the value does not exist inside the `string` a `null` gets returned.",example:['myString = "42 as an answer is wrong"','index = myString.indexOf("wrong")',"if index != null then",' print("Invalid information spotted at: " + index)',"else",' print("Information seems valid.")',"end if"]},split:{description:"Returns a `list` where each item is a segment of the `string`. The separation depends on the provided separator `string`. Keep in mind that for some odd reason, this method is using regular expressions for matching.",example:['myString = "42 as an answer is wrong"','segments = myString.split(" ")','if segments[0] != "42" then',' print("Invalid information spotted!")',"else",' print("Information seems valid!")',"end if"]},replace:{description:"Returns a new `string` where the provided `string` got replaced by the second provided `string`.",example:['myString = "42 as an answer is wrong"','newString = myString.replace("wrong", "right")',"print(newString)"]},indexes:{description:"Returns a `list` where each item is a `number` representing all available indexes in the `string`.",example:['myString = "42"',"print(myString.indexes)"]},code:{description:"Returns a `number` representing the Unicode code of the first character of the `string`.",example:['myString = "HELLO WORLD"',"print(myString.code)"]},len:{description:"Returns a `number` representing the length of the `string`.",example:['myString = "HELLO WORLD"','print("Size of string is: " + myString.len)']},lower:{description:"Returns a new `string` in which all characters are transformed into lowercase.",example:['myString = "HELLO WORLD"',"print(myString.lower)"]},upper:{description:"Returns a new `string` in which all characters are transformed into uppercase.",example:['myString = "hello world"',"print(myString.upper)"]},val:{description:"Returns a `number` which is parsed from the `string`. In case the `string` is not numeric it will return a zero.",example:['myString = "1.25"',"print(myString.val + 40.75)"]},values:{description:"Returns a `list` where each item is a `string` representing all available characters in the `string`. Could be compared to using `split` but without any separator.",example:['myString = "hello world"',"print(myString.values)"]}}});var EO=m(Ju=>{"use strict";var da=Ju&&Ju.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ju,"__esModule",{value:!0});var oW=da(bO()),aW=da(_O()),uW=da(vO()),cW=da(SO()),lW=da(wO()),hW=da(TO()),dW={any:oW.default,general:aW.default,list:uW.default,map:cW.default,string:hW.default,number:lW.default};Ju.default=dW});var xO=m((NV,fW)=>{fW.exports={type:"any",definitions:{insert:{type:"function",arguments:[{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list","string"]},indexOf:{type:"function",arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["any"]},hasIndex:{type:"function",arguments:[{label:"value",type:"any"}],returns:["number"]},remove:{type:"function",arguments:[{label:"value",type:"any"}],returns:["null"]},push:{type:"function",arguments:[{label:"value",type:"any"}],returns:["map","list","null"]},pull:{type:"function",returns:["any"]},pop:{type:"function",returns:["any"]},shuffle:{type:"function",returns:["null"]},sum:{type:"function",returns:["number"]},indexes:{type:"function",returns:["list"]},len:{type:"function",returns:["number"]},values:{type:"function",returns:["list"]}}}});var kO=m((qV,pW)=>{pW.exports={type:"general",definitions:{hasIndex:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"index",type:"any"}],returns:["number","null"]},print:{type:"function",arguments:[{label:"value",type:"any",default:{type:"string",value:""}},{label:"delimiter",type:"string",opt:!0}],returns:["null"]},indexes:{type:"function",arguments:[{label:"self",types:["map","list","string"]}],returns:["list","null"]},values:{type:"function",arguments:[{label:"self",types:["map","list","string"]}],returns:["list"]},indexOf:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"value",type:"any"},{label:"after",type:"any",opt:!0}],returns:["any","null"]},len:{type:"function",arguments:[{label:"self",types:["list","string","map"]}],returns:["number","null"]},shuffle:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["null"]},val:{type:"function",arguments:[{label:"self",type:"any"}],returns:["number","null"]},lower:{type:"function",arguments:[{label:"self",type:"string"}],returns:["string"]},upper:{type:"function",arguments:[{label:"self",type:"string"}],returns:["string"]},sum:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["number"]},pop:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["any","null"]},pull:{type:"function",arguments:[{label:"self",types:["list","map"]}],returns:["any","null"]},push:{type:"function",arguments:[{label:"self",types:["list","map"]},{label:"value",type:"any"}],returns:["map","list","null"]},sort:{type:"function",arguments:[{label:"self",type:"list"},{label:"byKey",type:"any"},{label:"ascending",type:"number",default:{type:"number",value:1}}],returns:["list","null"]},remove:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"key",type:"any"}],returns:["list","map","string"]},wait:{type:"function",arguments:[{label:"seconds",type:"number",default:{type:"number",value:1}}],returns:["null"]},abs:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},acos:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},asin:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}}],returns:["number"]},atan:{type:"function",arguments:[{label:"y",type:"number",default:{type:"number",value:0}},{label:"x",type:"number",default:{type:"number",value:1}}],returns:["number"]},tan:{type:"function",arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},cos:{type:"function",arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},code:{type:"function",arguments:[{label:"value",type:"string"}],returns:["number"]},char:{type:"function",arguments:[{label:"codePoint",type:"number",default:{type:"number",value:65}}],returns:["string"]},sin:{type:"function",arguments:[{label:"radians",type:"number",default:{type:"number",value:0}}],returns:["number"]},floor:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},range:{type:"function",arguments:[{label:"start",type:"number",default:{type:"number",value:0}},{label:"end",type:"number",default:{type:"number",value:0}},{label:"inc",type:"number",opt:!0}],returns:[{type:"list",valueType:"number"}]},round:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}},{label:"decimalPlaces",type:"number",default:{type:"number",value:0}}],returns:["number"]},rnd:{type:"function",arguments:[{label:"seed",type:"number",opt:!0}],returns:["number"]},sign:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},sqrt:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},str:{type:"function",arguments:[{label:"value",type:"any"}],returns:["string"]},ceil:{type:"function",arguments:[{label:"x",type:"number",default:{type:"number",value:0}}],returns:["number"]},pi:{type:"function",returns:["number"]},slice:{type:"function",arguments:[{label:"seq",types:["list","string"]},{label:"from",type:"number",default:{type:"number",value:0}},{label:"to",type:"number",opt:!0}],returns:["list","string"]},hash:{type:"function",arguments:[{label:"value",type:"any"}],returns:["number"]},time:{type:"function",returns:["number"]},bitAnd:{type:"function",arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},bitOr:{type:"function",arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},bitXor:{type:"function",arguments:[{label:"a",type:"number",default:{type:"number",value:0}},{label:"b",type:"number",default:{type:"number",value:0}}],returns:["number"]},log:{type:"function",arguments:[{label:"value",type:"number",default:{type:"number",value:0}},{label:"base",type:"number",default:{type:"number",value:10}}],returns:["number"]},yield:{type:"function",returns:["null"]},insert:{type:"function",arguments:[{label:"self",types:["list","string"]},{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list","string"]},join:{type:"function",arguments:[{label:"self",type:"list"},{label:"delimiter",type:"string",default:{type:"string",value:" "}}],returns:["string"]},split:{type:"function",arguments:[{label:"self",type:"string"},{label:"delimiter",type:"string",default:{type:"string",value:" "}},{label:"maxCount",type:"number",default:{type:"number",value:-1}}],returns:[{type:"list",valueType:"string"}]},replace:{type:"function",arguments:[{label:"self",types:["list","map","string"]},{label:"oldval",type:"any"},{label:"newval",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["list","map","string"]},funcRef:{type:"function",returns:[{type:"map",keyType:"string"}]},list:{type:"function",returns:[{type:"map",keyType:"string"}]},map:{type:"function",returns:[{type:"map",keyType:"string"}]},number:{type:"function",returns:[{type:"map",keyType:"string"}]},string:{type:"function",returns:[{type:"map",keyType:"string"}]},refEquals:{type:"function",arguments:[{label:"a",type:"any"},{label:"b",type:"any"}],returns:["number"]},stackTrace:{type:"function",returns:[{type:"list",valueType:"string"}]},version:{type:"function",returns:["version"]}}}});var AO=m((jV,gW)=>{gW.exports={type:"list",definitions:{remove:{type:"function",arguments:[{label:"index",type:"number"}],returns:["null"]},insert:{type:"function",arguments:[{label:"index",type:"number"},{label:"value",type:"any"}],returns:["list"]},push:{type:"function",arguments:[{label:"value",type:"any"}],returns:["list"]},pop:{type:"function",returns:["any"]},pull:{type:"function",returns:["any"]},shuffle:{type:"function",returns:["null"]},sum:{type:"function",returns:["number"]},hasIndex:{type:"function",arguments:[{label:"index",type:"number"}],returns:["number"]},indexOf:{type:"function",arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["number","null"]},sort:{type:"function",arguments:[{label:"byKey",type:"string"},{label:"ascending",type:"number",default:{type:"number",value:1}}],returns:["list"]},join:{type:"function",arguments:[{label:"delimiter",type:"string",default:{type:"string",value:" "}}],returns:["string"]},indexes:{type:"function",returns:[{type:"list",valueType:"number"}]},len:{type:"function",returns:["number"]},values:{type:"function",returns:["list"]},replace:{type:"function",arguments:[{label:"oldVal",type:"any"},{label:"newVal",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["list"]}}}});var CO=m((FV,mW)=>{mW.exports={type:"map",definitions:{remove:{type:"function",arguments:[{label:"key",type:"string"}],returns:["number"]},push:{type:"function",arguments:[{label:"key",type:"string"}],returns:["map"]},pull:{type:"function",returns:["any"]},pop:{type:"function",returns:["any"]},shuffle:{type:"function",returns:["null"]},sum:{type:"function",returns:["number"]},hasIndex:{type:"function",arguments:[{label:"key",type:"string"}],returns:["number"]},indexOf:{type:"function",arguments:[{label:"value",type:"any"},{label:"offset",type:"number",opt:!0}],returns:["any","null"]},indexes:{type:"function",returns:["list"]},len:{type:"function",returns:["number"]},values:{type:"function",returns:["list"]},replace:{type:"function",arguments:[{label:"oldVal",type:"any"},{label:"newVal",type:"any"},{label:"maxCount",type:"number",opt:!0}],returns:["map"]}}}});var OO=m(($V,yW)=>{yW.exports={type:"number",definitions:{}}});var RO=m((BV,bW)=>{bW.exports={type:"string",definitions:{remove:{type:"function",arguments:[{label:"toDelete",type:"string"}],returns:["string"]},hasIndex:{type:"function",arguments:[{label:"index",type:"number"}],returns:["number"]},insert:{type:"function",arguments:[{label:"index",type:"number"},{label:"value",type:"string"}],returns:["string"]},indexOf:{type:"function",arguments:[{label:"value",type:"string"},{label:"offset",type:"number",opt:!0}],returns:["number","null"]},split:{type:"function",arguments:[{label:"delimiter",type:"string",default:{type:"string",value:" "}},{label:"maxCount",type:"number",default:{type:"number",value:-1}}],returns:[{type:"list",valueType:"string"}]},replace:{type:"function",arguments:[{label:"oldVal",type:"string"},{label:"newVal",type:"string"},{label:"maxCount",type:"number",opt:!0}],returns:["string"]},indexes:{type:"function",returns:[{type:"list",valueType:"number"}]},code:{type:"function",returns:["number"]},len:{type:"function",returns:["number"]},lower:{type:"function",returns:["string"]},upper:{type:"function",returns:["string"]},val:{type:"function",returns:["number"]},values:{type:"function",returns:[{type:"list",valueType:"string"}]}}}});var PO=m((WV,_W)=>{_W.exports={type:"version",extends:"map",definitions:{miniscript:{type:"string"},buildDate:{type:"string"},host:{type:"number"},hostName:{type:"string"},hostInfo:{type:"string"}}}});var hS=m(An=>{"use strict";var is=An&&An.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(An,"__esModule",{value:!0});An.miniscriptMeta=void 0;var vW=jn(),SW=is(EO()),wW=is(xO()),TW=is(kO()),EW=is(AO()),xW=is(CO()),kW=is(OO()),AW=is(RO()),CW=is(PO());An.miniscriptMeta=new vW.Container;An.miniscriptMeta.addTypeSignatureFromPayload(wW.default);An.miniscriptMeta.addTypeSignatureFromPayload(TW.default);An.miniscriptMeta.addTypeSignatureFromPayload(EW.default);An.miniscriptMeta.addTypeSignatureFromPayload(xW.default);An.miniscriptMeta.addTypeSignatureFromPayload(kW.default);An.miniscriptMeta.addTypeSignatureFromPayload(AW.default);An.miniscriptMeta.addTypeSignatureFromPayload(CW.default);An.miniscriptMeta.addMetaFromPayload("en",SW.default)});var Qu=m(dS=>{"use strict";Object.defineProperty(dS,"__esModule",{value:!0});var OW=hS(),RW=Yo();dS.default=new RW.TypeManager({container:OW.miniscriptMeta})});var LO=m(fa=>{"use strict";var PW=fa&&fa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fa,"__esModule",{value:!0});fa.activate=void 0;var DO=ke(),DW=Yo(),IW=dv(),MW=PW(Qu()),IO=(t,e,n)=>{let r=e.resolveNamespace(n.variable,!0);if(r==null)return null;let i=(0,DW.createExpressionId)(n.variable),s=r?.kind?(0,IW.getSymbolItemKind)(r.kind):13,o={line:n.variable.start.line-1,character:n.variable.start.character-1},a={line:n.variable.end.line-1,character:n.variable.end.character-1};return{name:i,kind:s,location:{uri:t.uri,range:{start:o,end:a}}}},LW=(t,e,n)=>{switch(n.node.type){case DO.ASTType.AssignmentStatement:return IO(t,e,n.node);case DO.ASTType.ForGenericStatement:return IO(t,e,n.node);default:return null}},MO=(t,e)=>{let n=MW.default.get(t.uri),r=n.resolveAllAssignmentsWithQuery(e),i=[];for(let s of r){let o=LW(t,n,s);o!=null&&i.push(o)}return i};function NW(t){t.connection.onDocumentSymbol(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);return n==null?void 0:t.documentManager.get(n).document?MO(n,""):[]}),t.connection.onWorkspaceSymbol(e=>{let n=[];for(let r of t.fs.getAllTextDocuments())t.documentManager.get(r).document&&n.push(...MO(r,e.query));return n})}fa.activate=NW});var Df=m(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.buildTokens=cr.semanticTokensLegend=cr.SemanticTokenModifier=cr.SemanticTokenType=void 0;var Ht=Yr(),B=ke(),qW=hS(),NO=(t,e)=>!!qW.miniscriptMeta.getDefinition(t,e),Y;(function(t){t[t.Keyword=0]="Keyword",t[t.String=1]="String",t[t.Number=2]="Number",t[t.Variable=3]="Variable",t[t.Property=4]="Property",t[t.Function=5]="Function",t[t.Parameter=6]="Parameter",t[t.Operator=7]="Operator",t[t.Comment=8]="Comment",t[t.Constant=9]="Constant",t[t.Punctuator=10]="Punctuator"})(Y=cr.SemanticTokenType||(cr.SemanticTokenType={}));var fS;(function(t){t[t.Declaration=0]="Declaration",t[t.Definition=1]="Definition",t[t.Readonly=2]="Readonly",t[t.Static=3]="Static",t[t.Deprecated=4]="Deprecated",t[t.Abstract=5]="Abstract",t[t.Async=6]="Async",t[t.Modification=7]="Modification",t[t.Documentation=8]="Documentation",t[t.DefaultLibrary=9]="DefaultLibrary"})(fS=cr.SemanticTokenModifier||(cr.SemanticTokenModifier={}));cr.semanticTokensLegend={tokenTypes:["keyword","string","number","variable","property","function","parameter","operator","comment","constant","punctuator"],tokenModifiers:["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"]};var qO=t=>1<<t,pS=class{constructor(e,n){this._lexer=e,this._builder=n,this._validator=new B.ParserValidatorm}next(){this.previousToken=this.token,this.token=this._lexer.next()}isType(e){return this.token!==null&&e===this.token.type}consume(e){return e(this.token)?(this.next(),!0):!1}consumeMany(e){return e(this.token)?(this.next(),!0):!1}requireType(e){let n=this.token;return this.token.type!==e?null:(this.next(),n)}requireToken(e){let n=this.token;return e(n)?(this.next(),n):null}requireTokenOfAny(e){let n=this.token;return e(n)?(this.next(),n):null}skipNewlines(){let e=this;for(;;){if(B.Selectors.Comment(e.token))this._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length+2,Y.Comment,0);else if(!B.Selectors.EndOfLine(e.token))break;e.next()}}processIdentifier(e=!1,n=!1){let r=this,i=r.requireType(B.TokenType.Identifier);if(i)if(n)r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Y.Parameter,0);else if(e){let o=NO(["any"],i.value)?qO(fS.DefaultLibrary):0;r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Y.Property,o)}else{let o=NO(["general"],i.value)?qO(fS.DefaultLibrary):0;r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Y.Variable,o)}}processLiteral(){let e=this.token;switch(e.type){case B.TokenType.StringLiteral:{this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,Y.String,0);break}case B.TokenType.NumericLiteral:{this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,Y.Number,0);break}case B.TokenType.BooleanLiteral:case B.TokenType.NilLiteral:{this._builder.push(e.start.line-1,e.start.character-1,e.raw.length,Y.Constant,0);break}}this.next()}processAtom(e=!1,n=!1){let r=this;if(Ht.Selectors.Envar(r.token))return r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Keyword,0),r.next(),r.processFeatureEnvarExpression();if(Ht.Selectors.Inject(r.token))return r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Keyword,0),r.next(),r.processFeatureInjectExpression();if(Ht.Selectors.Line(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Keyword,0),r.next();return}else if(Ht.Selectors.File(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Keyword,0),r.next();return}if(r._validator.isLiteral(r.token.type))return r.processLiteral();if(r.isType(B.TokenType.Identifier))return r.processIdentifier()}processQuantity(e=!1,n=!1){let r=this;if(!B.Selectors.LParenthesis(r.token))return r.processAtom(e,n);r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next(),r.skipNewlines(),r.processExpr();let i=r.requireToken(B.Selectors.RParenthesis);i&&r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Y.Punctuator,0)}processList(e=!1,n=!1){let r=this;if(!B.Selectors.SLBracket(r.token))return r.processQuantity(e,n);if(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next(),B.Selectors.SRBracket(r.token))r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next();else for(r.skipNewlines();!B.Selectors.EndOfFile(r.token);){if(B.Selectors.SRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next();break}if(r.processExpr(),B.Selectors.MapSeperator(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next(),r.skipNewlines()),B.Selectors.SRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next();break}}}processMap(e=!1,n=!1){let r=this;if(!B.Selectors.CLBracket(r.token))return r.processList(e,n);if(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next(),B.Selectors.CRBracket(r.token))r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next();else for(r.skipNewlines();!B.Selectors.EndOfFile(r.token);){if(B.Selectors.CRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next();break}r.processExpr();let i=r.requireToken(B.Selectors.MapKeyValueSeperator);if(!i)return;if(r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Y.Punctuator,0),r.skipNewlines(),r.processExpr(),B.Selectors.MapSeperator(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next(),r.skipNewlines()),B.Selectors.CRBracket(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next();break}}}processCallArgs(){let e=this;if(B.Selectors.LParenthesis(e.token))if(e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Y.Punctuator,0),e.next(),B.Selectors.RParenthesis(e.token))e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Y.Punctuator,0),e.next();else for(;!B.Selectors.EndOfFile(e.token);){e.skipNewlines(),e.processExpr(),e.skipNewlines();let n=e.requireTokenOfAny(B.SelectorGroups.CallArgsEnd);if(!n)return;if(B.Selectors.RParenthesis(n)){e._builder.push(n.start.line-1,n.start.character-1,n.value.length,Y.Punctuator,0);break}else if(!B.Selectors.ArgumentSeperator(n))break}}processCallExpr(e=!1,n=!1){let r=this;for(r.processMap(e,n);!B.Selectors.EndOfFile(r.token);)if(B.Selectors.MemberSeperator(r.token))r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next(),r.skipNewlines(),r.processIdentifier(!0);else if(B.Selectors.SLBracket(r.token)&&!r.token.afterSpace){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next(),r.skipNewlines(),B.Selectors.SliceSeperator(r.token)?(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next(),r.skipNewlines(),B.Selectors.SRBracket(r.token)?r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0):r.processExpr()):(r.processExpr(),B.Selectors.SliceSeperator(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next(),r.skipNewlines(),B.Selectors.SRBracket(r.token)?r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0):r.processExpr()));let i=r.requireToken(B.Selectors.SRBracket);if(!i)return;r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Y.Punctuator,0)}else if(B.Selectors.LParenthesis(r.token)&&(!e||!r.token.afterSpace))r.processCallArgs();else break}processPower(e=!1,n=!1){let r=this;r.processCallExpr(e,n),B.Selectors.Power(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Operator,0),r.next(),r.skipNewlines(),r.processCallExpr())}processAddressOf(e=!1,n=!1){let r=this;if(!B.Selectors.Reference(r.token))return r.processPower(e,n);r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next(),r.skipNewlines(),r.processPower()}processNew(e=!1,n=!1){let r=this;if(!B.Selectors.New(r.token))return r.processAddressOf(e,n);r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Keyword,0),r.next(),r.skipNewlines(),r.processNew()}processUnaryMinus(e=!1,n=!1){let r=this;if(!B.Selectors.Minus(r.token))return r.processNew(e,n);r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Operator,0),r.next(),r.skipNewlines(),r.processNew()}processMultDiv(e=!1,n=!1){let r=this;for(r.processUnaryMinus(e,n);B.SelectorGroups.MultiDivOperators(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Operator,0),r.next(),r.skipNewlines(),r.processUnaryMinus()}processBitwise(e=!1,n=!1){let r=this;for(r.processMultDiv(e,n);Ht.SelectorGroups.BitwiseOperators(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Operator,0),r.next(),r.skipNewlines(),r.processMultDiv()}processAddSub(e=!1,n=!1){let r=this;for(r.processBitwise(e,n);B.Selectors.Plus(r.token)||B.Selectors.Minus(r.token)&&(!n||!r.token.afterSpace||r._lexer.isAtWhitespace());)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Operator,0),r.next(),r.skipNewlines(),r.processBitwise()}processComparisons(e=!1,n=!1){let r=this;if(r.processAddSub(e,n),!!B.SelectorGroups.ComparisonOperators(r.token))do r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Operator,0),r.next(),r.skipNewlines(),r.processAddSub();while(B.SelectorGroups.ComparisonOperators(r.token))}processBitwiseAnd(e=!1,n=!1){let r=this;for(r.processComparisons(e,n);Ht.Selectors.BitwiseAnd(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next(),r.processComparisons()}processBitwiseOr(e=!1,n=!1){let r=this;for(r.processBitwiseAnd(e,n);Ht.Selectors.BitwiseOr(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0),r.next(),r.processBitwiseAnd()}processIsa(e=!1,n=!1){let r=this;r.processBitwiseOr(e,n),B.Selectors.Isa(r.token)&&(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Keyword,0),r.next(),r.skipNewlines(),r.processBitwiseOr())}processNot(e=!1,n=!1){let r=this;if(B.Selectors.Not(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Keyword,0),r.next(),r.skipNewlines(),r.processIsa();return}r.processIsa(e,n)}processAnd(e=!1,n=!1){let r=this;for(r.processNot(e,n);B.Selectors.And(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Keyword,0),r.next(),r.skipNewlines(),r.processNot()}processOr(e=!1,n=!1){let r=this;for(r.processAnd(e,n);B.Selectors.Or(r.token);)r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Keyword,0),r.next(),r.skipNewlines(),r.processAnd()}processFunctionDeclaration(e=!1,n=!1){let r=this;if(!B.Selectors.Function(r.token))return r.processOr(e,n);if(r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Keyword,0),r.next(),!B.SelectorGroups.BlockEndOfLine(r.token)){let i=r.requireToken(B.Selectors.LParenthesis);if(!i)return;for(r._builder.push(i.start.line-1,i.start.character-1,i.value.length,Y.Punctuator,0);!B.SelectorGroups.FunctionDeclarationArgEnd(r.token)&&(r.processIdentifier(!1,!0),r.consume(B.Selectors.Assign)&&(r._builder.push(r.previousToken.start.line-1,r.previousToken.start.character-1,r.previousToken.value.length,Y.Operator,0),r.processExpr()),!B.Selectors.RParenthesis(r.token));){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0);let o=r.requireToken(B.Selectors.ArgumentSeperator);if(!o)return;if(r._builder.push(o.start.line-1,o.start.character-1,o.value.length,Y.Punctuator,0),B.Selectors.RParenthesis(r.token)){r._builder.push(r.token.start.line-1,r.token.start.character-1,r.token.value.length,Y.Punctuator,0);break}}let s=r.requireToken(B.Selectors.RParenthesis);if(!s)return;r._builder.push(s.start.line-1,s.start.character-1,s.value.length,Y.Punctuator,0)}}processExpr(e=!1,n=!1){this.processFunctionDeclaration(e,n)}processForShortcutStatement(){this.processShortcutStatement()}processForStatement(){let e=this;e.processIdentifier();let n=e.requireToken(B.Selectors.In);n&&(e._builder.push(n.start.line-1,n.start.character-1,n.value.length,Y.Keyword,0),e.processExpr(),B.SelectorGroups.BlockEndOfLine(e.token)||e.processForShortcutStatement())}processWhileShortcutStatement(){this.processShortcutStatement()}processWhileStatement(){let e=this;if(e.processExpr(),!B.SelectorGroups.BlockEndOfLine(e.token))return e.processWhileShortcutStatement()}processIfShortcutStatement(){let e=this;e.processShortcutStatement(),B.Selectors.Else(e.token)&&(e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Y.Keyword,0),e.next(),e.processShortcutStatement())}processNextIfClause(e){let n=this;switch(e){case B.ASTType.ElseifClause:{n.processExpr();let r=n.requireToken(B.Selectors.Then);if(!r)return;n._builder.push(r.start.line-1,r.start.character-1,r.value.length,Y.Keyword,0);break}case B.ASTType.ElseClause:break}}processIfStatement(){let e=this;e.processExpr();let n=e.requireToken(B.Selectors.Then);n&&(e._builder.push(n.start.line-1,n.start.character-1,n.value.length,Y.Keyword,0),B.SelectorGroups.BlockEndOfLine(e.token)||e.processIfShortcutStatement())}processReturnStatement(){let e=this;B.SelectorGroups.ReturnStatementEnd(e.token)||e.processExpr()}processAssignment(){let e=this,n=e.token;if(e.processExpr(!0,!0),B.SelectorGroups.AssignmentEndOfExpr(e.token))return;if(B.Selectors.Assign(e.token)){e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Y.Operator,0),e.next(),e.processExpr();return}else if(B.SelectorGroups.AssignmentShorthand(e.token)){let i=e.token;e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Y.Operator,0),e.next(),e.processExpr();return}let r=[];for(;!B.Selectors.EndOfFile(e.token)&&(e.processExpr(),!(B.SelectorGroups.BlockEndOfLine(e.token)||B.Selectors.Else(e.token)));){if(B.Selectors.ArgumentSeperator(e.token)){e.next(),e.skipNewlines();continue}let i=e.requireTokenOfAny(B.SelectorGroups.AssignmentCommandArgs);if(!i)return;if(B.Selectors.EndOfLine(i)||B.Selectors.EndOfFile(i))break}r.length}processShortcutStatement(){let e=this;if(B.TokenType.Keyword===e.token.type&&B.Keyword.Not!==e.token.value){let n=e.token.value;switch(this._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Y.Keyword,0),n){case B.Keyword.Return:e.next(),e.processReturnStatement();case B.Keyword.Continue:{e.next();return}case B.Keyword.Break:{e.next();return}default:}}return e.processAssignment()}processPathSegment(){let e=this;if(this.token.type===B.ASTType.StringLiteral){let r=this.token;e._builder.push(r.start.line-1,r.start.character-1,r.raw.length,Y.String,0),this.next();return}let n="";for(;!Ht.SelectorGroups.PathSegmentEnd(e.token);)e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Y.String,0),n=n+e.token.value,e.next();return e.consumeMany(Ht.SelectorGroups.PathSegmentEnd)&&e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Y.Punctuator,0),n}processFeatureEnvarExpression(){let e=this;e._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Y.String,0),e.next()}processFeatureInjectExpression(){this.processPathSegment()}processFeatureImportStatement(){let e=this;e.processIdentifier(),e.consume(Ht.Selectors.From)&&(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Y.Keyword,0),e.processPathSegment())}processFeatureIncludeStatement(){this.processPathSegment()}processNativeImportCodeStatement(){let e=this;if(e.consume(B.Selectors.LParenthesis)){if(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Y.Punctuator,0),B.TokenType.StringLiteral===e.token.type){let n=e.token;e._builder.push(n.start.line-1,n.start.character-1,n.raw.length,Y.String,0),e.next()}else return;if(e.consume(B.Selectors.ImportCodeSeperator)){if(e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Y.Punctuator,0),!e.isType(B.TokenType.StringLiteral))return;let n=e.token;e._builder.push(n.start.line-1,n.start.character-1,n.raw.length,Y.String,0),e.next()}e.consume(B.Selectors.RParenthesis)&&e._builder.push(e.previousToken.start.line-1,e.previousToken.start.character-1,e.previousToken.value.length,Y.Punctuator,0)}}processKeyword(){let e=this,n=e.token.value;switch(this._builder.push(e.token.start.line-1,e.token.start.character-1,e.token.value.length,Y.Keyword,0),n){case B.Keyword.Return:{e.next(),e.processReturnStatement();return}case B.Keyword.If:{e.next(),e.processIfStatement();return}case B.Keyword.ElseIf:{e.next(),e.processNextIfClause(B.ASTType.ElseifClause);return}case B.Keyword.Else:{e.next(),e.processNextIfClause(B.ASTType.ElseClause);return}case B.Keyword.While:{e.next(),e.processWhileStatement();return}case B.Keyword.For:{e.next(),e.processForStatement();return}case B.Keyword.EndFunction:{e.next();return}case B.Keyword.EndFor:{e.next();return}case B.Keyword.EndWhile:{e.next();return}case B.Keyword.EndIf:{e.next();return}case B.Keyword.Continue:{e.next();return}case B.Keyword.Break:{e.next();return}case Ht.GreybelKeyword.Include:case Ht.GreybelKeyword.IncludeWithComment:{e.next(),e.processFeatureIncludeStatement();return}case Ht.GreybelKeyword.Import:case Ht.GreybelKeyword.ImportWithComment:{e.next(),e.processFeatureImportStatement();return}case Ht.GreybelKeyword.Envar:{e.next(),e.processFeatureEnvarExpression();return}case Ht.GreybelKeyword.Inject:{e.next(),e.processFeatureInjectExpression();return}case Ht.GreybelKeyword.Debugger:e.next()}}processStatement(){let e=this;if(B.TokenType.Keyword===e.token.type&&B.Keyword.Not!==e.token.value){e.processKeyword();return}e.processAssignment()}process(){let e=this;for(e.next();!B.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!B.Selectors.EndOfFile(e.token));)e.processStatement()}};function jW(t,e){let n=new Ht.Lexer(e.content,{unsafe:!0});return new pS(n,t).process(),t}cr.buildTokens=jW});var jO=m(If=>{"use strict";Object.defineProperty(If,"__esModule",{value:!0});If.activate=void 0;var FW=Df();function $W(t){t.connection.languages.semanticTokens.on(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=t.documentManager.get(n);if(!r.document)return;let i=t.createSemanticTokensBuilder();return(0,FW.buildTokens)(i,r),i.build()})}If.activate=$W});var FO=m(Mf=>{"use strict";Object.defineProperty(Mf,"__esModule",{value:!0});Mf.buildFoldingRanges=void 0;var Zr=ke(),gS=km(),BW=jd();function WW(t){let e=[];return new BW.ScraperWalker((r,i)=>{if(r.start.line===r.end.line)return null;switch(r.type){case Zr.ASTType.Comment:return e.push({startLine:r.start.line-1,endLine:r.end.line-1,kind:gS.FoldingRangeKind.Comment}),null;case Zr.ASTType.MapConstructorExpression:case Zr.ASTType.ListConstructorExpression:case Zr.ASTType.StringLiteral:case Zr.ASTType.WhileStatement:case Zr.ASTType.ForGenericStatement:case Zr.ASTType.FunctionDeclaration:return e.push({startLine:r.start.line-1,endLine:r.end.line-1,kind:gS.FoldingRangeKind.Region}),null;case Zr.ASTType.IfClause:case Zr.ASTType.ElseifClause:case Zr.ASTType.ElseClause:return e.push({startLine:r.start.line-1,endLine:r.end.line-2,kind:gS.FoldingRangeKind.Region}),null}return null}).visit(t.document),e}Mf.buildFoldingRanges=WW});var $O=m(Lf=>{"use strict";Object.defineProperty(Lf,"__esModule",{value:!0});Lf.activate=void 0;var UW=FO();function HW(t){t.connection.languages.foldingRange.on(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=t.documentManager.get(n);if(r.document)return(0,UW.buildFoldingRanges)(r)})}Lf.activate=HW});var jf=m((QV,HO)=>{var Zu=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,GW=typeof AbortController=="function",Nf=GW?AbortController:class{constructor(){this.signal=new BO}abort(e=new Error("This operation was aborted")){this.signal.reason=this.signal.reason||e,this.signal.aborted=!0,this.signal.dispatchEvent({type:"abort",target:this.signal})}},zW=typeof AbortSignal=="function",KW=typeof Nf.AbortSignal=="function",BO=zW?AbortSignal:KW?Nf.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(e){e.type==="abort"&&(this.aborted=!0,this.onabort(e),this._listeners.forEach(n=>n(e),this))}onabort(){}addEventListener(e,n){e==="abort"&&this._listeners.push(n)}removeEventListener(e,n){e==="abort"&&(this._listeners=this._listeners.filter(r=>r!==n))}},_S=new Set,mS=(t,e)=>{let n=`LRU_CACHE_OPTION_${t}`;qf(n)&&vS(n,`${t} option`,`options.${e}`,ga)},yS=(t,e)=>{let n=`LRU_CACHE_METHOD_${t}`;if(qf(n)){let{prototype:r}=ga,{get:i}=Object.getOwnPropertyDescriptor(r,t);vS(n,`${t} method`,`cache.${e}()`,i)}},VW=(t,e)=>{let n=`LRU_CACHE_PROPERTY_${t}`;if(qf(n)){let{prototype:r}=ga,{get:i}=Object.getOwnPropertyDescriptor(r,t);vS(n,`${t} property`,`cache.${e}`,i)}},WO=(...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},qf=t=>!_S.has(t),vS=(t,e,n,r)=>{_S.add(t);let i=`The ${e} is deprecated. Please use ${n} instead.`;WO(i,"DeprecationWarning",t,r)},ss=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),UO=t=>ss(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?pa:null:null,pa=class extends Array{constructor(e){super(e),this.fill(0)}},bS=class{constructor(e){if(e===0)return[];let n=UO(e);this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},ga=class t{constructor(e={}){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:c,disposeAfter:l,noDisposeOnSet:h,noUpdateTTL:d,maxSize:g=0,maxEntrySize:y=0,sizeCalculation:_,fetchMethod:C,fetchContext:k,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:v,allowStaleOnFetchAbort:L,ignoreFetchAbort:R}=e,{length:W,maxAge:ne,stale:se}=e instanceof t?{}:e;if(n!==0&&!ss(n))throw new TypeError("max option must be a nonnegative integer");let U=n?UO(n):Array;if(!U)throw new Error("invalid max value: "+n);if(this.max=n,this.maxSize=g,this.maxEntrySize=y||this.maxSize,this.sizeCalculation=_||W,this.sizeCalculation){if(!this.maxSize&&!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(this.fetchMethod=C||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=k,!this.fetchMethod&&k!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(n).fill(null),this.valList=new Array(n).fill(null),this.next=new U(n),this.prev=new U(n),this.head=0,this.tail=0,this.free=new bS(n),this.initialFill=1,this.size=0,typeof c=="function"&&(this.dispose=c),typeof l=="function"?(this.disposeAfter=l,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!h,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!T,this.allowStaleOnFetchRejection=!!v,this.allowStaleOnFetchAbort=!!L,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.maxSize!==0&&!ss(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!ss(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!u||!!se,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=ss(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||ne||0,this.ttl){if(!ss(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){let O="LRU_CACHE_UNBOUNDED";qf(O)&&(_S.add(O),WO("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",O,t))}se&&mS("stale","allowStale"),ne&&mS("maxAge","ttl"),W&&mS("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new pa(this.max),this.starts=new pa(this.max),this.setItemTTL=(r,i,s=Zu.now())=>{if(this.starts[r]=i!==0?s:0,this.ttls[r]=i,i!==0&&this.ttlAutopurge){let o=setTimeout(()=>{this.isStale(r)&&this.delete(this.keyList[r])},i+1);o.unref&&o.unref()}},this.updateItemAge=r=>{this.starts[r]=this.ttls[r]!==0?Zu.now():0},this.statusTTL=(r,i)=>{r&&(r.ttl=this.ttls[i],r.start=this.starts[i],r.now=e||n(),r.remainingTTL=r.now+r.ttl-r.start)};let e=0,n=()=>{let r=Zu.now();if(this.ttlResolution>0){e=r;let i=setTimeout(()=>e=0,this.ttlResolution);i.unref&&i.unref()}return r};this.getRemainingTTL=r=>{let i=this.keyMap.get(r);return i===void 0?0:this.ttls[i]===0||this.starts[i]===0?1/0:this.starts[i]+this.ttls[i]-(e||n())},this.isStale=r=>this.ttls[r]!==0&&this.starts[r]!==0&&(e||n())-this.starts[r]>this.ttls[r]}updateItemAge(e){}statusTTL(e,n){}setItemTTL(e,n,r){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new pa(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,n,r,i)=>{if(this.isBackgroundFetch(n))return 0;if(!ss(r))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(r=i(n,e),!ss(r))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 r},this.addItemSize=(e,n,r)=>{if(this.sizes[e]=n,this.maxSize){let i=this.maxSize-this.sizes[e];for(;this.calculatedSize>i;)this.evict(!0)}this.calculatedSize+=this.sizes[e],r&&(r.entrySize=n,r.totalCalculatedSize=this.calculatedSize)}}removeItemSize(e){}addItemSize(e,n){}requireSize(e,n,r,i){if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let n=this.tail;!(!this.isValidIndex(n)||((e||!this.isStale(n))&&(yield n),n===this.head));)n=this.prev[n]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let n=this.head;!(!this.isValidIndex(n)||((e||!this.isStale(n))&&(yield n),n===this.tail));)n=this.next[n]}isValidIndex(e){return e!==void 0&&this.keyMap.get(this.keyList[e])===e}*entries(){for(let e of this.indexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*rentries(){for(let e of this.rindexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*keys(){for(let e of this.indexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*rkeys(){for(let e of this.rindexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*values(){for(let e of this.indexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}*rvalues(){for(let e of this.rindexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}[Symbol.iterator](){return this.entries()}find(e,n){for(let r of this.indexes()){let i=this.valList[r],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.keyList[r],this))return this.get(this.keyList[r],n)}}forEach(e,n=this){for(let r of this.indexes()){let i=this.valList[r],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.keyList[r],this)}}rforEach(e,n=this){for(let r of this.rindexes()){let i=this.valList[r],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.keyList[r],this)}}get prune(){return yS("prune","purgeStale"),this.purgeStale}purgeStale(){let e=!1;for(let n of this.rindexes({allowStale:!0}))this.isStale(n)&&(this.delete(this.keyList[n]),e=!0);return e}dump(){let e=[];for(let n of this.indexes({allowStale:!0})){let r=this.keyList[n],i=this.valList[n],s=this.isBackgroundFetch(i)?i.__staleWhileFetching:i;if(s===void 0)continue;let o={value:s};if(this.ttls){o.ttl=this.ttls[n];let a=Zu.now()-this.starts[n];o.start=Math.floor(Date.now()-a)}this.sizes&&(o.size=this.sizes[n]),e.unshift([r,o])}return e}load(e){this.clear();for(let[n,r]of e){if(r.start){let i=Date.now()-r.start;r.start=Zu.now()-i}this.set(n,r.value,r)}}dispose(e,n,r){}set(e,n,{ttl:r=this.ttl,start:i,noDisposeOnSet:s=this.noDisposeOnSet,size:o=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,status:c}={}){if(o=this.requireSize(e,n,o,a),this.maxEntrySize&&o>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.delete(e),this;let l=this.size===0?void 0:this.keyMap.get(e);if(l===void 0)l=this.newIndex(),this.keyList[l]=e,this.valList[l]=n,this.keyMap.set(e,l),this.next[this.tail]=l,this.prev[l]=this.tail,this.tail=l,this.size++,this.addItemSize(l,o,c),c&&(c.set="add"),u=!1;else{this.moveToTail(l);let h=this.valList[l];if(n!==h){if(this.isBackgroundFetch(h)?h.__abortController.abort(new Error("replaced")):s||(this.dispose(h,e,"set"),this.disposeAfter&&this.disposed.push([h,e,"set"])),this.removeItemSize(l),this.valList[l]=n,this.addItemSize(l,o,c),c){c.set="replace";let d=h&&this.isBackgroundFetch(h)?h.__staleWhileFetching:h;d!==void 0&&(c.oldValue=d)}}else c&&(c.set="update")}if(r!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),u||this.setItemTTL(l,r,i),this.statusTTL(c,l),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){let e=this.valList[this.head];return this.evict(!0),e}}evict(e){let n=this.head,r=this.keyList[n],i=this.valList[n];return this.isBackgroundFetch(i)?i.__abortController.abort(new Error("evicted")):(this.dispose(i,r,"evict"),this.disposeAfter&&this.disposed.push([i,r,"evict"])),this.removeItemSize(n),e&&(this.keyList[n]=null,this.valList[n]=null,this.free.push(n)),this.head=this.next[n],this.keyMap.delete(r),this.size--,n}has(e,{updateAgeOnHas:n=this.updateAgeOnHas,status:r}={}){let i=this.keyMap.get(e);if(i!==void 0)if(this.isStale(i))r&&(r.has="stale",this.statusTTL(r,i));else return n&&this.updateItemAge(i),r&&(r.has="hit"),this.statusTTL(r,i),!0;else r&&(r.has="miss");return!1}peek(e,{allowStale:n=this.allowStale}={}){let r=this.keyMap.get(e);if(r!==void 0&&(n||!this.isStale(r))){let i=this.valList[r];return this.isBackgroundFetch(i)?i.__staleWhileFetching:i}}backgroundFetch(e,n,r,i){let s=n===void 0?void 0:this.valList[n];if(this.isBackgroundFetch(s))return s;let o=new Nf;r.signal&&r.signal.addEventListener("abort",()=>o.abort(r.signal.reason));let a={signal:o.signal,options:r,context:i},u=(g,y=!1)=>{let{aborted:_}=o.signal,C=r.ignoreFetchAbort&&g!==void 0;return r.status&&(_&&!y?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,C&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),_&&!C&&!y?l(o.signal.reason):(this.valList[n]===d&&(g===void 0?d.__staleWhileFetching?this.valList[n]=d.__staleWhileFetching:this.delete(e):(r.status&&(r.status.fetchUpdated=!0),this.set(e,g,a.options))),g)},c=g=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=g),l(g)),l=g=>{let{aborted:y}=o.signal,_=y&&r.allowStaleOnFetchAbort,C=_||r.allowStaleOnFetchRejection,k=C||r.noDeleteOnFetchRejection;if(this.valList[n]===d&&(!k||d.__staleWhileFetching===void 0?this.delete(e):_||(this.valList[n]=d.__staleWhileFetching)),C)return r.status&&d.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),d.__staleWhileFetching;if(d.__returned===d)throw g},h=(g,y)=>{this.fetchMethod(e,s,a).then(_=>g(_),y),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(g(),r.allowStaleOnFetchAbort&&(g=_=>u(_,!0)))})};r.status&&(r.status.fetchDispatched=!0);let d=new Promise(h).then(u,c);return d.__abortController=o,d.__staleWhileFetching=s,d.__returned=null,n===void 0?(this.set(e,d,{...a.options,status:void 0}),n=this.keyMap.get(e)):this.valList[n]=d,d}isBackgroundFetch(e){return e&&typeof e=="object"&&typeof e.then=="function"&&Object.prototype.hasOwnProperty.call(e,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(e,"__returned")&&(e.__returned===e||e.__returned===null)}async fetch(e,{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:a=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:l=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,fetchContext:y=this.fetchContext,forceRefresh:_=!1,status:C,signal:k}={}){if(!this.fetchMethod)return C&&(C.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:C});let T={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:s,noDisposeOnSet:o,size:a,sizeCalculation:u,noUpdateTTL:c,noDeleteOnFetchRejection:l,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:g,ignoreFetchAbort:d,status:C,signal:k},w=this.keyMap.get(e);if(w===void 0){C&&(C.fetch="miss");let v=this.backgroundFetch(e,w,T,y);return v.__returned=v}else{let v=this.valList[w];if(this.isBackgroundFetch(v)){let se=n&&v.__staleWhileFetching!==void 0;return C&&(C.fetch="inflight",se&&(C.returnedStale=!0)),se?v.__staleWhileFetching:v.__returned=v}let L=this.isStale(w);if(!_&&!L)return C&&(C.fetch="hit"),this.moveToTail(w),r&&this.updateItemAge(w),this.statusTTL(C,w),v;let R=this.backgroundFetch(e,w,T,y),W=R.__staleWhileFetching!==void 0,ne=W&&n;return C&&(C.fetch=W&&L?"stale":"refresh",ne&&L&&(C.returnedStale=!0)),ne?R.__staleWhileFetching:R.__returned=R}}get(e,{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:s}={}){let o=this.keyMap.get(e);if(o!==void 0){let a=this.valList[o],u=this.isBackgroundFetch(a);return this.statusTTL(s,o),this.isStale(o)?(s&&(s.get="stale"),u?(s&&(s.returnedStale=n&&a.__staleWhileFetching!==void 0),n?a.__staleWhileFetching:void 0):(i||this.delete(e),s&&(s.returnedStale=n),n?a:void 0)):(s&&(s.get="hit"),u?a.__staleWhileFetching:(this.moveToTail(o),r&&this.updateItemAge(o),a))}else s&&(s.get="miss")}connect(e,n){this.prev[n]=e,this.next[e]=n}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return yS("del","delete"),this.delete}delete(e){let n=!1;if(this.size!==0){let r=this.keyMap.get(e);if(r!==void 0)if(n=!0,this.size===1)this.clear();else{this.removeItemSize(r);let i=this.valList[r];this.isBackgroundFetch(i)?i.__abortController.abort(new Error("deleted")):(this.dispose(i,e,"delete"),this.disposeAfter&&this.disposed.push([i,e,"delete"])),this.keyMap.delete(e),this.keyList[r]=null,this.valList[r]=null,r===this.tail?this.tail=this.prev[r]:r===this.head?this.head=this.next[r]:(this.next[this.prev[r]]=this.next[r],this.prev[this.next[r]]=this.prev[r]),this.size--,this.free.push(r)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return n}clear(){for(let e of this.rindexes({allowStale:!0})){let n=this.valList[e];if(this.isBackgroundFetch(n))n.__abortController.abort(new Error("deleted"));else{let r=this.keyList[e];this.dispose(n,r,"delete"),this.disposeAfter&&this.disposed.push([n,r,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return yS("reset","clear"),this.clear}get length(){return VW("length","size"),this.size}static get AbortController(){return Nf}static get AbortSignal(){return BO}};HO.exports=ga});var JO=m((ZV,YO)=>{var ES=Object.defineProperty,XW=Object.getOwnPropertyDescriptor,YW=Object.getOwnPropertyNames,JW=Object.prototype.hasOwnProperty,QW=(t,e)=>{for(var n in e)ES(t,n,{get:e[n],enumerable:!0})},ZW=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of YW(e))!JW.call(t,i)&&i!==n&&ES(t,i,{get:()=>e[i],enumerable:!(r=XW(e,i))||r.enumerable});return t},eU=t=>ZW(ES({},"__esModule",{value:!0}),t),GO={};QW(GO,{ScheduleIntervalHelper:()=>SS,SchedulePostMessageHelper:()=>wS,ScheduleSetImmmediateHelper:()=>TS,schedule:()=>rU,scheduleProvider:()=>XO});YO.exports=eU(GO);var tU=Promise.prototype.then.bind(Promise.resolve()),xS=class Ff{constructor(){this.queue=[],this.sleep=0}static{this.SLEEP_LIMIT=512}static{this.QUEUE_LIMIT=1024}static isApplicable(){return!1}static createCallback(){throw new Error("Cannot create callback from base schedule helper!")}tick(){let e=this.queue,n=Math.min(e.length,Ff.QUEUE_LIMIT);this.queue=this.queue.slice(Ff.QUEUE_LIMIT);for(let r=0;r<n;tU(e[r++]));if(this.queue.length>0&&(this.sleep=0),this.sleep++<=Ff.SLEEP_LIMIT){this.nextTick();return}this.endTick()}start(){this.isTickActive()||(this.sleep=0,this.startTick())}add(e){this.queue.push(e),this.start()}},SS=class zO extends xS{constructor(){super(...arguments),this.timer=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setInterval}static createCallback(){let e=new zO;return e.add.bind(e)}isTickActive(){return this.timer!==null}startTick(){this.timer=setInterval(this.boundTick,0)}nextTick(){}endTick(){clearInterval(this.timer),this.timer=null}},nU=()=>{try{return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}catch{}return!1},wS=class KO extends xS{constructor(){super(),this.id=(Math.random()+1).toString(36).substring(7),this.active=!1,self.addEventListener("message",this.onMessage.bind(this))}static isApplicable(){return!nU()&&!!self.postMessage&&!!self.addEventListener}static createCallback(){let e=new KO;return e.add.bind(e)}onMessage(e){e.source!==self||e.data!==this.id||this.tick()}isTickActive(){return this.active}startTick(){this.active=!0,self.postMessage(this.id)}nextTick(){self.postMessage(this.id)}endTick(){this.active=!1}},TS=class VO extends xS{constructor(){super(...arguments),this.immediate=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setImmediate}static createCallback(){let e=new VO;return e.add.bind(e)}isTickActive(){return this.immediate!==null}startTick(){this.immediate=setImmediate(this.boundTick)}nextTick(){this.immediate=setImmediate(this.boundTick)}endTick(){clearImmediate(this.immediate),this.immediate=null}};function XO(){if(TS.isApplicable())return TS.createCallback();if(wS.isApplicable())return wS.createCallback();if(SS.isApplicable())return SS.createCallback();throw new Error("No schedule helper fulfills requirements!")}var rU=XO()});var QO=m($n=>{"use strict";var CS=$n&&$n.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty($n,"__esModule",{value:!0});$n.DocumentManager=$n.PROCESSING_TIMEOUT=$n.ActiveDocument=$n.DocumentURIBuilder=void 0;var iU=CS(require("events")),sU=Yr(),oU=CS(jf()),kS=JO(),ma=xf(),ec=ji(),aU=CS(Qu()),tc=class{constructor(e,n=null){this.workspaceFolderUri=n,this.rootPath=e}getFromWorkspaceFolder(e){return this.workspaceFolderUri==null?(console.warn("Workspace folders are not available. Falling back to only relative paths."),ma.Utils.joinPath(this.rootPath,e).toString()):ma.Utils.joinPath(this.workspaceFolderUri,e).toString()}getFromRootPath(e){return ma.Utils.joinPath(this.rootPath,e).toString()}async getPathWithContext(e,n){return e.startsWith("/")?n.fs.findExistingPath(this.getFromWorkspaceFolder(e),this.getFromWorkspaceFolder(`${e}.src`)):n.fs.findExistingPath(this.getFromRootPath(e),this.getFromRootPath(`${e}.src`))}};$n.DocumentURIBuilder=tc;var $f=class{constructor(e){this.documentManager=e.documentManager,this.content=e.content,this.textDocument=e.textDocument,this.document=e.document,this.errors=e.errors}getDirectory(){return ma.Utils.joinPath(ma.URI.parse(this.textDocument.uri),"..")}async getImportUris(e=null){if(this.document==null)return[];let n=this.document,r=this.getDirectory(),i=this.documentManager.context,s=new tc(r,e);return(await Promise.all([...n.imports.filter(a=>a.path).map(async a=>{let u=await s.getPathWithContext(a.path,i);return u==null?null:(0,ec.parseDependencyLocation)({type:ec.DependencyType.Import,location:u,args:[a.name?.name]})})])).filter(a=>a!=null)}async getIncludeUris(e=null){if(this.document==null)return[];let n=this.document,r=this.getDirectory(),i=this.documentManager.context,s=new tc(r,e);return(await Promise.all([...n.includes.filter(a=>a.path).map(async a=>{let u=await s.getPathWithContext(a.path,i);return u==null?null:(0,ec.parseDependencyLocation)({type:ec.DependencyType.Include,location:u})})])).filter(a=>a!=null)}async getDependencies(){if(this.document==null)return[];if(this.dependencies)return this.dependencies;let e=await this.documentManager.context.fs.getWorkspaceFolderUri(ma.URI.parse(this.textDocument.uri)),[n,r]=await Promise.all([this.getImportUris(e),this.getIncludeUris(e)]),i=new Set([...n,...r]);return this.dependencies=Array.from(i).map(ec.parseDependencyRawLocation),this.dependencies}async getImports(e=!0){if(this.document==null)return[];let n=new Set,r=new Set([this.textDocument.uri]),i=async s=>{let o=await s.getDependencies();for(let a of o){if(r.has(a.location))continue;let u=await this.documentManager.open(a.location);r.add(a.location),u!==null&&(n.add({document:u,location:a}),u.document!==null&&e&&await i(u))}};return await i(this),Array.from(n)}};$n.ActiveDocument=$f;$n.PROCESSING_TIMEOUT=100;var AS=class extends iU.default{get context(){return this._context}setContext(e){return this._context=e,this}constructor(e=$n.PROCESSING_TIMEOUT){super(),this._context=null,this._timer=null,this.results=new oU.default({ttl:1e3*60*20,ttlAutopurge:!0}),this.scheduledItems=new Map,this.tickRef=this.tick.bind(this),this.processingTimeout=e,(0,kS.schedule)(this.tickRef)}tick(){if(this.scheduledItems.size===0){this._timer=null;return}let e=Date.now(),n=Array.from(this.scheduledItems.values());for(let r=0;r<n.length;r++){let i=n[r];e-i.createdAt>this.processingTimeout&&(0,kS.schedule)(()=>this.refresh(i.document))}this._timer=setTimeout(this.tickRef,0)}refresh(e){let n=e.uri;if(!this.scheduledItems.has(n)&&this.results.has(n))return this.results.get(n);let r=this.create(e);return this.results.set(n,r),this.emit("parsed",e,r),this.scheduledItems.delete(n),r}create(e){let n=e.getText(),r=new sU.Parser(n,{unsafe:!0}),i=r.parseChunk();return this._context.documentMerger.flushCacheKey(e.uri),aU.default.analyze(e.uri,i),new $f({documentManager:this,content:n,textDocument:e,document:i,errors:[...r.lexer.errors,...r.errors]})}schedule(e){let n=e.uri,r=e.getText();return this.results.get(n)?.content===r?!1:(this.scheduledItems.set(n,{document:e,createdAt:Date.now()}),this._timer===null&&(this._timer=setTimeout(this.tickRef,0)),!0)}async open(e){try{let n=await this.context.fs.getTextDocument(e);return n==null?null:this.get(n)}catch{return null}}get(e){return this.results.get(e.uri)||this.refresh(e)}getLatest(e,n=5e3){return new Promise(r=>{(0,kS.schedule)(()=>{if(!this.scheduledItems.has(e.uri))return r(this.get(e));let i=()=>{this.removeListener("parsed",s),r(this.get(e))},s=a=>{a.uri===e.uri&&(this.removeListener("parsed",s),clearTimeout(o),r(this.get(e)))},o=setTimeout(i,n);this.addListener("parsed",s)})})}clear(e){this.results.delete(e.uri),this.emit("cleared",e)}};$n.DocumentManager=AS});var eR=m((t6,OS)=>{OS.exports=function(t){return ZO(uU(t),t)};OS.exports.array=ZO;function ZO(t,e){var n=t.length,r=new Array(n),i={},s=n,o=cU(e),a=lU(t);for(e.forEach(function(c){if(!a.has(c[0])||!a.has(c[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});s--;)i[s]||u(t[s],s,new Set);return r;function u(c,l,h){if(h.has(c)){var d;try{d=", node was:"+JSON.stringify(c)}catch{d=""}throw new Error("Cyclic dependency"+d)}if(!a.has(c))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(c));if(!i[l]){i[l]=!0;var g=o.get(c)||new Set;if(g=Array.from(g),l=g.length){h.add(c);do{var y=g[--l];u(y,a.get(y),h)}while(l);h.delete(c)}r[--n]=c}}}function uU(t){for(var e=new Set,n=0,r=t.length;n<r;n++){var i=t[n];e.add(i[0]),e.add(i[1])}return Array.from(e)}function cU(t){for(var e=new Map,n=0,r=t.length;n<r;n++){var i=t[n];e.has(i[0])||e.set(i[0],new Set),e.has(i[1])||e.set(i[1],new Set),e.get(i[0]).add(i[1])}return e}function lU(t){for(var e=new Map,n=0,r=t.length;n<r;n++)e.set(t[n],n);return e}});var tR=m(Bf=>{"use strict";Object.defineProperty(Bf,"__esModule",{value:!0});Bf.hash=void 0;function hU(t){let e=5381,n=t.length;for(;n;)e=e*33^t.charCodeAt(--n);return e>>>0}Bf.hash=hU});var iR=m(ya=>{"use strict";var PS=ya&&ya.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ya,"__esModule",{value:!0});ya.DocumentMerger=void 0;var dU=PS(jf()),fU=PS(eR()),nR=ji(),rR=tR(),Wf=PS(Qu()),RS=class{constructor(){this.keyToDocumentUriMap=new Map,this.results=new dU.default({ttl:1e3*60*20,ttlAutopurge:!0})}createCacheKey(e,n){let r=(0,rR.hash)(`main-${e.uri}-${e.version}`);for(let i=0;i<n.length;i++){let s=n[i];r^=(0,rR.hash)(`${s.textDocument.uri}-${s.textDocument.version}`),r=r>>>0}return r}registerCacheKey(e,n){this.flushCacheKey(n),this.keyToDocumentUriMap.set(n,e)}flushCacheKey(e){let n=this.keyToDocumentUriMap.get(e);n&&(this.results.delete(n),this.keyToDocumentUriMap.delete(e))}flushCache(){this.results.clear()}async processByDependencies(e,n,r){let i=e.uri;if(r.has(i))return r.get(i);let s=Wf.default.get(i);if(r.set(i,null),!s)return null;let o=[],a=await n.documentManager.get(e).getImports(),u=this.createCacheKey(e,a.map(h=>h.document));if(this.results.has(u))return this.results.get(u);this.registerCacheKey(u,i);let c=await n.documentManager.get(e).getDependencies();await Promise.all(c.map(async h=>{let d=n.documentManager.results.get(h.location);if(!d)return;let{document:g,textDocument:y}=d;if(!g)return;let _=await this.processByDependencies(y,n,r);_!==null&&o.push(_)}));let l=s.merge(...o);return r.set(i,l),this.results.set(u,l),l}async buildByDependencies(e,n){let r=e.uri,i=Wf.default.get(r);if(!i)return null;let s=await n.documentManager.get(e).getImports(),o=this.createCacheKey(e,s.map(d=>d.document));if(this.results.has(o))return this.results.get(o);let a=[],u=[];this.registerCacheKey(o,r);let c=await n.documentManager.get(e).getDependencies(),l=new Map([[r,null]]);await Promise.all(c.map(async d=>{let g=n.documentManager.results.get(d.location);if(!g)return;let{document:y,textDocument:_}=g;if(!y)return;let C=await this.processByDependencies(_,n,l);if(C!==null){if(d.type===nR.DependencyType.Import){u.push({namespace:d.args[0],typeDoc:C});return}a.push(C)}}));let h=i.merge(...a);return u.forEach((d,g)=>{let y=d.typeDoc.getRootScopeContext().scope.resolveNamespace("module",!0)?.resolveProperty("exports",!0);y!=null&&h.getRootScopeContext().scope.setProperty(d.namespace??`unknown${g}`,y,!0)}),this.results.set(o,h),h}async buildByWorkspace(e,n){let r=e.uri,i=Wf.default.get(r);if(!i)return null;let s=[],o=await n.fs.getWorkspaceRelatedFiles(),a=await Promise.all(o.map(async g=>await n.documentManager.open(g.toString()))),u=this.createCacheKey(e,a);if(this.results.has(u))return this.results.get(u);this.registerCacheKey(u,r);let c=a.map(g=>g.textDocument.uri),l=await Promise.all(a.map(async g=>(await g.getDependencies()).map(_=>[g.textDocument.uri,_.location]))),h=fU.default.array(c,l.flat());for(let g=h.length-1;g>=0;g--){let y=h[g];if(y===r)continue;let _=Wf.default.get(y);if(_===null)return;s.push(_)}let d=i.merge(...s);return this.results.set(u,d),d}async build(e,n){return n.getConfiguration().typeAnalyzer.strategy===nR.TypeAnalyzerStrategy.Workspace?this.buildByWorkspace(e,n):this.buildByDependencies(e,n)}};ya.DocumentMerger=RS});var aR=m(ba=>{"use strict";var pU=ba&&ba.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ba,"__esModule",{value:!0});ba.CoreContext=void 0;var gU=pU(require("events")),nc=ji(),sR=Df();function oR(t){return{fileExtensions:t?.fileExtensions?t.fileExtensions.split(","):nc.DefaultFileExtensions,formatter:t?.formatter??!0,autocomplete:t?.autocomplete??!0,hoverdocs:t?.hoverdocs??!0,diagnostic:t?.diagnostic??!0,transpiler:{beautify:{keepParentheses:t?.transpiler?.beautify?.keepParentheses??!0,indentation:t?.transpiler?.beautify?.indentation??nc.IndentationType.Tab,indentationSpaces:t?.transpiler?.beautify?.indentationSpaces??2}},typeAnalyzer:{strategy:t?.typeAnalyzer?.strategy??nc.TypeAnalyzerStrategy.Dependency,exclude:t?.typeAnalyzer?.exclude??void 0}}}var DS=class extends gU.default{constructor(){super(),this._configuration=oR(),this._features={configuration:!1,workspaceFolder:!1}}get features(){return this._features}getConfiguration(){return this._configuration}async syncConfiguraton(){let e=await this.connection.workspace.getConfiguration(nc.ConfigurationNamespace),n=oR(e),r=n.typeAnalyzer,i=this._configuration.typeAnalyzer;(r.strategy!==i.strategy||r.exclude!==i.exclude)&&this.documentMerger.flushCache(),this._configuration=n}configureCapabilties(e){this._features.configuration=!!(e.workspace&&e.workspace.configuration),this._features.workspaceFolder=!!(e.workspace&&e.workspace.workspaceFolders)}async onInitialize(e){this.configureCapabilties(e.capabilities);let n={capabilities:{completionProvider:{triggerCharacters:["."],resolveProvider:!0},hoverProvider:!0,colorProvider:!0,definitionProvider:!0,documentFormattingProvider:!0,foldingRangeProvider:!0,signatureHelpProvider:{triggerCharacters:[",","("]},documentSymbolProvider:!0,workspaceSymbolProvider:!0,diagnosticProvider:{identifier:nc.LanguageId,interFileDependencies:!1,workspaceDiagnostics:!1},semanticTokensProvider:{legend:{tokenTypes:sR.semanticTokensLegend.tokenTypes,tokenModifiers:sR.semanticTokensLegend.tokenModifiers},full:!0},textDocumentSync:2}};return this._features.workspaceFolder&&(n.capabilities.workspace={workspaceFolders:{supported:!0}}),this.emit("ready",this),n}async onInitialized(e){this._features.configuration&&(await this.syncConfiguraton(),this.connection.onDidChangeConfiguration(async()=>{let n=this._configuration;await this.syncConfiguraton(),this.emit("configuration-change",this,this._configuration,n)})),this.emit("loaded",this)}async listen(){this.fs.listen(this.connection),this.connection.onInitialize(this.onInitialize.bind(this)),this.connection.onInitialized(this.onInitialized.bind(this)),this.connection.listen()}};ba.CoreContext=DS});var Uf=m(z=>{"use strict";var mU=z&&z.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),yU=z&&z.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),bU=z&&z.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&mU(e,t,n);return yU(e,t),e},_U=z&&z.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(z,"__esModule",{value:!0});z.CoreContext=z.buildTokens=z.semanticTokensLegend=z.lookupBase=z.lookupIdentifier=z.typeAnalyzer=z.appendTooltipHeader=z.appendTooltipBody=z.formatTypes=z.formatDefaultValue=z.createTooltipHeader=z.createSignatureInfo=z.createHover=z.MarkdownString=z.LookupHelper=z.DocumentMerger=z.DocumentManager=z.ActiveDocument=z.ASTScraper=z.activateFoldingRange=z.activateSemantic=z.activateSymbol=z.activateSubscriptions=z.activateSignature=z.activateHover=z.activateFormatter=z.activateDiagnostic=z.activateDefinition=z.activateColor=z.activateAutocomplete=z.DefaultFileExtensions=z.TypeAnalyzerStrategy=z.ConfigurationNamespace=z.LanguageId=z.IndentationType=void 0;var rc=ji();Object.defineProperty(z,"IndentationType",{enumerable:!0,get:function(){return rc.IndentationType}});Object.defineProperty(z,"LanguageId",{enumerable:!0,get:function(){return rc.LanguageId}});Object.defineProperty(z,"ConfigurationNamespace",{enumerable:!0,get:function(){return rc.ConfigurationNamespace}});Object.defineProperty(z,"TypeAnalyzerStrategy",{enumerable:!0,get:function(){return rc.TypeAnalyzerStrategy}});Object.defineProperty(z,"DefaultFileExtensions",{enumerable:!0,get:function(){return rc.DefaultFileExtensions}});var vU=_C();Object.defineProperty(z,"activateAutocomplete",{enumerable:!0,get:function(){return vU.activate}});var SU=OC();Object.defineProperty(z,"activateColor",{enumerable:!0,get:function(){return SU.activate}});var wU=PC();Object.defineProperty(z,"activateDefinition",{enumerable:!0,get:function(){return wU.activate}});var TU=DC();Object.defineProperty(z,"activateDiagnostic",{enumerable:!0,get:function(){return TU.activate}});var EU=aO();Object.defineProperty(z,"activateFormatter",{enumerable:!0,get:function(){return EU.activate}});var xU=fO();Object.defineProperty(z,"activateHover",{enumerable:!0,get:function(){return xU.activate}});var kU=gO();Object.defineProperty(z,"activateSignature",{enumerable:!0,get:function(){return kU.activate}});var AU=yO();Object.defineProperty(z,"activateSubscriptions",{enumerable:!0,get:function(){return AU.activate}});var CU=LO();Object.defineProperty(z,"activateSymbol",{enumerable:!0,get:function(){return CU.activate}});var OU=jO();Object.defineProperty(z,"activateSemantic",{enumerable:!0,get:function(){return OU.activate}});var RU=$O();Object.defineProperty(z,"activateFoldingRange",{enumerable:!0,get:function(){return RU.activate}});z.ASTScraper=bU(jd());var uR=QO();Object.defineProperty(z,"ActiveDocument",{enumerable:!0,get:function(){return uR.ActiveDocument}});Object.defineProperty(z,"DocumentManager",{enumerable:!0,get:function(){return uR.DocumentManager}});var PU=iR();Object.defineProperty(z,"DocumentMerger",{enumerable:!0,get:function(){return PU.DocumentMerger}});var DU=ea();Object.defineProperty(z,"LookupHelper",{enumerable:!0,get:function(){return DU.LookupHelper}});var IU=Af();Object.defineProperty(z,"MarkdownString",{enumerable:!0,get:function(){return IU.MarkdownString}});var Vs=Cf();Object.defineProperty(z,"createHover",{enumerable:!0,get:function(){return Vs.createHover}});Object.defineProperty(z,"createSignatureInfo",{enumerable:!0,get:function(){return Vs.createSignatureInfo}});Object.defineProperty(z,"createTooltipHeader",{enumerable:!0,get:function(){return Vs.createTooltipHeader}});Object.defineProperty(z,"formatDefaultValue",{enumerable:!0,get:function(){return Vs.formatDefaultValue}});Object.defineProperty(z,"formatTypes",{enumerable:!0,get:function(){return Vs.formatTypes}});Object.defineProperty(z,"appendTooltipBody",{enumerable:!0,get:function(){return Vs.appendTooltipBody}});Object.defineProperty(z,"appendTooltipHeader",{enumerable:!0,get:function(){return Vs.appendTooltipHeader}});var MU=Qu();Object.defineProperty(z,"typeAnalyzer",{enumerable:!0,get:function(){return _U(MU).default}});var cR=pv();Object.defineProperty(z,"lookupIdentifier",{enumerable:!0,get:function(){return cR.lookupIdentifier}});Object.defineProperty(z,"lookupBase",{enumerable:!0,get:function(){return cR.lookupBase}});var lR=Df();Object.defineProperty(z,"semanticTokensLegend",{enumerable:!0,get:function(){return lR.semanticTokensLegend}});Object.defineProperty(z,"buildTokens",{enumerable:!0,get:function(){return lR.buildTokens}});var LU=aR();Object.defineProperty(z,"CoreContext",{enumerable:!0,get:function(){return LU.CoreContext}})});var pR={};PP(pR,{TextDocument:()=>IS});function MS(t,e){if(t.length<=1)return t;let n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);MS(r,e),MS(i,e);let s=0,o=0,a=0;for(;s<r.length&&o<i.length;)e(r[s],i[o])<=0?t[a++]=r[s++]:t[a++]=i[o++];for(;s<r.length;)t[a++]=r[s++];for(;o<i.length;)t[a++]=i[o++];return t}function hR(t,e,n=0){let r=e?[n]:[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);dR(s)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function dR(t){return t===13||t===10}function fR(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 NU(t){let e=fR(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var Hf,IS,gR=RP(()=>{"use strict";Hf=class t{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,this._content=i,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 i=fR(r.range),s=this.offsetAt(i.start),o=this.offsetAt(i.end);this._content=this._content.substring(0,s)+r.text+this._content.substring(o,this._content.length);let a=Math.max(i.start.line,0),u=Math.max(i.end.line,0),c=this._lineOffsets,l=hR(r.text,!1,s);if(u-a===l.length)for(let d=0,g=l.length;d<g;d++)c[d+a+1]=l[d];else l.length<1e4?c.splice(a+1,u-a,...l):this._lineOffsets=c=c.slice(0,a+1).concat(l,c.slice(u+1));let h=r.text.length-(o-s);if(h!==0)for(let d=a+1+l.length,g=c.length;d<g;d++)c[d]=c[d]+h}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=hR(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return{line:0,character:e};for(;r<i;){let o=Math.floor((r+i)/2);n[o]>e?i=o:r=o+1}let s=r-1;return e=this.ensureBeforeEOL(e,n[s]),{line:s,character:e-n[s]}}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];if(e.character<=0)return r;let i=e.line+1<n.length?n[e.line+1]:this._content.length,s=Math.min(r+e.character,i);return this.ensureBeforeEOL(s,r)}ensureBeforeEOL(e,n){for(;e>n&&dR(this._content.charCodeAt(e-1));)e--;return e}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}};(function(t){function e(i,s,o,a){return new Hf(i,s,o,a)}t.create=e;function n(i,s,o){if(i instanceof Hf)return i.update(s,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=n;function r(i,s){let o=i.getText(),a=MS(s.map(NU),(l,h)=>{let d=l.range.start.line-h.range.start.line;return d===0?l.range.start.character-h.range.start.character:d}),u=0,c=[];for(let l of a){let h=i.offsetAt(l.range.start);if(h<u)throw new Error("Overlapping edit");h>u&&c.push(o.substring(u,h)),l.newText.length&&c.push(l.newText),u=i.offsetAt(l.range.end)}return c.push(o.substr(u)),c.join("")}t.applyEdits=r})(IS||(IS={}))});var vR=m((o6,_R)=>{"use strict";_R.exports=yR;function yR(t,e,n){t instanceof RegExp&&(t=mR(t,n)),e instanceof RegExp&&(e=mR(e,n));var r=bR(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 mR(t,e){var n=e.match(t);return n?n[0]:null}yR.range=bR;function bR(t,e,n){var r,i,s,o,a,u=n.indexOf(t),c=n.indexOf(e,u+1),l=u;if(u>=0&&c>0){if(t===e)return[u,c];for(r=[],s=n.length;l>=0&&!a;)l==u?(r.push(l),u=n.indexOf(t,l+1)):r.length==1?a=[r.pop(),c]:(i=r.pop(),i<s&&(s=i,o=c),c=n.indexOf(e,l+1)),l=u<c&&u>=0?u:c;r.length&&(a=[s,o])}return a}});var CR=m((a6,AR)=>{var SR=vR();AR.exports=FU;var wR="\0SLASH"+Math.random()+"\0",TR="\0OPEN"+Math.random()+"\0",NS="\0CLOSE"+Math.random()+"\0",ER="\0COMMA"+Math.random()+"\0",xR="\0PERIOD"+Math.random()+"\0";function LS(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function qU(t){return t.split("\\\\").join(wR).split("\\{").join(TR).split("\\}").join(NS).split("\\,").join(ER).split("\\.").join(xR)}function jU(t){return t.split(wR).join("\\").split(TR).join("{").split(NS).join("}").split(ER).join(",").split(xR).join(".")}function kR(t){if(!t)return[""];var e=[],n=SR("{","}",t);if(!n)return t.split(",");var r=n.pre,i=n.body,s=n.post,o=r.split(",");o[o.length-1]+="{"+i+"}";var a=kR(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function FU(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),ic(qU(t),!0).map(jU)):[]}function $U(t){return"{"+t+"}"}function BU(t){return/^-?0\d/.test(t)}function WU(t,e){return t<=e}function UU(t,e){return t>=e}function ic(t,e){var n=[],r=SR("{","}",t);if(!r)return[t];var i=r.pre,s=r.post.length?ic(r.post,!1):[""];if(/\$$/.test(r.pre))for(var o=0;o<s.length;o++){var a=i+"{"+r.body+"}"+s[o];n.push(a)}else{var u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),l=u||c,h=r.body.indexOf(",")>=0;if(!l&&!h)return r.post.match(/,.*\}/)?(t=r.pre+"{"+r.body+NS+r.post,ic(t)):[t];var d;if(l)d=r.body.split(/\.\./);else if(d=kR(r.body),d.length===1&&(d=ic(d[0],!1).map($U),d.length===1))return s.map(function(U){return r.pre+d[0]+U});var g;if(l){var y=LS(d[0]),_=LS(d[1]),C=Math.max(d[0].length,d[1].length),k=d.length==3?Math.abs(LS(d[2])):1,T=WU,w=_<y;w&&(k*=-1,T=UU);var v=d.some(BU);g=[];for(var L=y;T(L,_);L+=k){var R;if(c)R=String.fromCharCode(L),R==="\\"&&(R="");else if(R=String(L),v){var W=C-R.length;if(W>0){var ne=new Array(W+1).join("0");L<0?R="-"+ne+R.slice(1):R=ne+R}}g.push(R)}}else{g=[];for(var se=0;se<d.length;se++)g.push.apply(g,ic(d[se],!1))}for(var se=0;se<g.length;se++)for(var o=0;o<s.length;o++){var a=i+g[se]+s[o];(!e||l||a)&&n.push(a)}}return n}});var OR=m(Gf=>{"use strict";Object.defineProperty(Gf,"__esModule",{value:!0});Gf.assertValidPattern=void 0;var HU=1024*64,GU=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>HU)throw new TypeError("pattern is too long")};Gf.assertValidPattern=GU});var PR=m(zf=>{"use strict";Object.defineProperty(zf,"__esModule",{value:!0});zf.parseClass=void 0;var zU={"[: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]},sc=t=>t.replace(/[[\]\\-]/g,"\\$&"),KU=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),RR=t=>t.join(""),VU=(t,e)=>{let n=e;if(t.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],i=[],s=n+1,o=!1,a=!1,u=!1,c=!1,l=n,h="";e:for(;s<t.length;){let _=t.charAt(s);if((_==="!"||_==="^")&&s===n+1){c=!0,s++;continue}if(_==="]"&&o&&!u){l=s+1;break}if(o=!0,_==="\\"&&!u){u=!0,s++;continue}if(_==="["&&!u){for(let[C,[k,T,w]]of Object.entries(zU))if(t.startsWith(C,s)){if(h)return["$.",!1,t.length-n,!0];s+=C.length,w?i.push(k):r.push(k),a=a||T;continue e}}if(u=!1,h){_>h?r.push(sc(h)+"-"+sc(_)):_===h&&r.push(sc(_)),h="",s++;continue}if(t.startsWith("-]",s+1)){r.push(sc(_+"-")),s+=2;continue}if(t.startsWith("-",s+1)){h=_,s+=2;continue}r.push(sc(_)),s++}if(l<s)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,t.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!c){let _=r[0].length===2?r[0].slice(-1):r[0];return[KU(_),!1,l-n,!1]}let d="["+(c?"^":"")+RR(r)+"]",g="["+(c?"":"^")+RR(i)+"]";return[r.length&&i.length?"("+d+"|"+g+")":r.length?d:g,a,l-n,!0]};zf.parseClass=VU});var Vf=m(Kf=>{"use strict";Object.defineProperty(Kf,"__esModule",{value:!0});Kf.unescape=void 0;var XU=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");Kf.unescape=XU});var FS=m(Jf=>{"use strict";Object.defineProperty(Jf,"__esModule",{value:!0});Jf.AST=void 0;var YU=PR(),Xf=Vf(),JU=new Set(["!","?","+","*","@"]),DR=t=>JU.has(t),QU="(?!(?:^|/)\\.\\.?(?:$|/))",Yf="(?!\\.)",ZU=new Set(["[","."]),e5=new Set(["..","."]),t5=new Set("().*{}+?[]^$\\!"),n5=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),jS="[^/]",IR=jS+"*?",MR=jS+"+?",qS=class t{type;#e;#t;#s=!1;#r=[];#o;#v;#c;#h=!1;#a;#u;#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.#c=this.#e===this?[]:this.#e.#c,e==="!"&&!this.#e.#h&&this.#c.push(this),this.#v=this.#o?this.#o.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#u!==void 0?this.#u:this.type?this.#u=this.type+"("+this.#r.map(e=>String(e)).join("|")+")":this.#u=this.#r.map(e=>String(e)).join("")}#m(){if(this!==this.#e)throw new Error("should only call on root");if(this.#h)return this;this.toString(),this.#h=!0;let e;for(;e=this.#c.pop();){if(e.type!=="!")continue;let n=e,r=n.#o;for(;r;){for(let i=n.#v+1;!r.type&&i<r.#r.length;i++)for(let s of e.#r){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#r[i])}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.#r.push(n)}}toJSON(){let e=this.type===null?this.#r.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#r.map(n=>n.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#h&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#v===0)return!0;let e=this.#o;for(let n=0;n<this.#v;n++){let r=e.#r[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.#r.length:0;return this.#v===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.#r)n.copyIn(r);return n}static#y(e,n,r,i){let s=!1,o=!1,a=-1,u=!1;if(n.type===null){let g=r,y="";for(;g<e.length;){let _=e.charAt(g++);if(s||_==="\\"){s=!s,y+=_;continue}if(o){g===a+1?(_==="^"||_==="!")&&(u=!0):_==="]"&&!(g===a+2&&u)&&(o=!1),y+=_;continue}else if(_==="["){o=!0,a=g,u=!1,y+=_;continue}if(!i.noext&&DR(_)&&e.charAt(g)==="("){n.push(y),y="";let C=new t(_,n);g=t.#y(e,C,g,i),n.push(C);continue}y+=_}return n.push(y),g}let c=r+1,l=new t(null,n),h=[],d="";for(;c<e.length;){let g=e.charAt(c++);if(s||g==="\\"){s=!s,d+=g;continue}if(o){c===a+1?(g==="^"||g==="!")&&(u=!0):g==="]"&&!(c===a+2&&u)&&(o=!1),d+=g;continue}else if(g==="["){o=!0,a=c,u=!1,d+=g;continue}if(DR(g)&&e.charAt(c)==="("){l.push(d),d="";let y=new t(g,l);l.push(y),c=t.#y(e,y,c,i);continue}if(g==="|"){l.push(d),d="",h.push(l),l=new t(null,n);continue}if(g===")")return d===""&&n.#r.length===0&&(n.#i=!0),l.push(d),d="",n.push(...h,l),c;d+=g}return n.type=null,n.#t=void 0,n.#r=[e.substring(r-1)],c}static fromGlob(e,n={}){let r=new t(null,void 0,n);return t.#y(e,r,0,n),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[n,r,i,s]=this.toRegExpSource();if(!(i||this.#t||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let a=(this.#a.nocase?"i":"")+(s?"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.#m(),!this.type){let u=this.isStart()&&this.isEnd(),c=this.#r.map(g=>{let[y,_,C,k]=typeof g=="string"?t.#d(g,this.#t,u):g.toRegExpSource(e);return this.#t=this.#t||C,this.#s=this.#s||k,y}).join(""),l="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&e5.has(this.#r[0]))){let y=ZU,_=n&&y.has(c.charAt(0))||c.startsWith("\\.")&&y.has(c.charAt(2))||c.startsWith("\\.\\.")&&y.has(c.charAt(4)),C=!n&&!e&&y.has(c.charAt(0));l=_?QU:C?Yf:""}let h="";return this.isEnd()&&this.#e.#h&&this.#o?.type==="!"&&(h="(?:$|\\/)"),[l+c+h,(0,Xf.unescape)(c),this.#t=!!this.#t,this.#s]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#f(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let u=this.toString();return this.#r=[u],this.type=null,this.#t=void 0,[u,(0,Xf.unescape)(this.toString()),!1,!1]}let o=!r||e||n||!Yf?"":this.#f(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#i)a=(this.isStart()&&!n?Yf:"")+MR;else{let u=this.type==="!"?"))"+(this.isStart()&&!n&&!e?Yf:"")+IR+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+u}return[a,(0,Xf.unescape)(s),this.#t=!!this.#t,this.#s]}#f(e){return this.#r.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,i,s,o]=n.toRegExpSource(e);return this.#s=this.#s||o,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#d(e,n,r=!1){let i=!1,s="",o=!1;for(let a=0;a<e.length;a++){let u=e.charAt(a);if(i){i=!1,s+=(t5.has(u)?"\\":"")+u;continue}if(u==="\\"){a===e.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[c,l,h,d]=(0,YU.parseClass)(e,a);if(h){s+=c,o=o||l,a+=h-1,n=n||d;continue}}if(u==="*"){r&&e==="*"?s+=MR:s+=IR,n=!0;continue}if(u==="?"){s+=jS,n=!0;continue}s+=n5(u)}return[s,(0,Xf.unescape)(e),!!n,o]}};Jf.AST=qS});var $S=m(Qf=>{"use strict";Object.defineProperty(Qf,"__esModule",{value:!0});Qf.escape=void 0;var r5=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");Qf.escape=r5});var os=m(te=>{"use strict";var i5=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(te,"__esModule",{value:!0});te.unescape=te.escape=te.AST=te.Minimatch=te.match=te.makeRe=te.braceExpand=te.defaults=te.filter=te.GLOBSTAR=te.sep=te.minimatch=void 0;var s5=i5(CR()),Zf=OR(),qR=FS(),o5=$S(),a5=Vf(),u5=(t,e,n={})=>((0,Zf.assertValidPattern)(e),!n.nocomment&&e.charAt(0)==="#"?!1:new Xs(e,n).match(t));te.minimatch=u5;var c5=/^\*+([^+@!?\*\[\(]*)$/,l5=t=>e=>!e.startsWith(".")&&e.endsWith(t),h5=t=>e=>e.endsWith(t),d5=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),f5=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),p5=/^\*+\.\*+$/,g5=t=>!t.startsWith(".")&&t.includes("."),m5=t=>t!=="."&&t!==".."&&t.includes("."),y5=/^\.\*+$/,b5=t=>t!=="."&&t!==".."&&t.startsWith("."),_5=/^\*+$/,v5=t=>t.length!==0&&!t.startsWith("."),S5=t=>t.length!==0&&t!=="."&&t!=="..",w5=/^\?+([^+@!?\*\[\(]*)?$/,T5=([t,e=""])=>{let n=jR([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},E5=([t,e=""])=>{let n=FR([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},x5=([t,e=""])=>{let n=FR([t]);return e?r=>n(r)&&r.endsWith(e):n},k5=([t,e=""])=>{let n=jR([t]);return e?r=>n(r)&&r.endsWith(e):n},jR=([t])=>{let e=t.length;return n=>n.length===e&&!n.startsWith(".")},FR=([t])=>{let e=t.length;return n=>n.length===e&&n!=="."&&n!==".."},$R=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",LR={win32:{sep:"\\"},posix:{sep:"/"}};te.sep=$R==="win32"?LR.win32.sep:LR.posix.sep;te.minimatch.sep=te.sep;te.GLOBSTAR=Symbol("globstar **");te.minimatch.GLOBSTAR=te.GLOBSTAR;var A5="[^/]",C5=A5+"*?",O5="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",R5="(?:(?!(?:\\/|^)\\.).)*?",P5=(t,e={})=>n=>(0,te.minimatch)(n,t,e);te.filter=P5;te.minimatch.filter=te.filter;var lr=(t,e={})=>Object.assign({},t,e),D5=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return te.minimatch;let e=te.minimatch;return Object.assign((r,i,s={})=>e(r,i,lr(t,s)),{Minimatch:class extends e.Minimatch{constructor(i,s={}){super(i,lr(t,s))}static defaults(i){return e.defaults(lr(t,i)).Minimatch}},AST:class extends e.AST{constructor(i,s,o={}){super(i,s,lr(t,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,lr(t,s))}},unescape:(r,i={})=>e.unescape(r,lr(t,i)),escape:(r,i={})=>e.escape(r,lr(t,i)),filter:(r,i={})=>e.filter(r,lr(t,i)),defaults:r=>e.defaults(lr(t,r)),makeRe:(r,i={})=>e.makeRe(r,lr(t,i)),braceExpand:(r,i={})=>e.braceExpand(r,lr(t,i)),match:(r,i,s={})=>e.match(r,i,lr(t,s)),sep:e.sep,GLOBSTAR:te.GLOBSTAR})};te.defaults=D5;te.minimatch.defaults=te.defaults;var I5=(t,e={})=>((0,Zf.assertValidPattern)(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,s5.default)(t));te.braceExpand=I5;te.minimatch.braceExpand=te.braceExpand;var M5=(t,e={})=>new Xs(t,e).makeRe();te.makeRe=M5;te.minimatch.makeRe=te.makeRe;var L5=(t,e,n={})=>{let r=new Xs(e,n);return t=t.filter(i=>r.match(i)),r.options.nonull&&!t.length&&t.push(e),t};te.match=L5;te.minimatch.match=te.match;var NR=/[?*]|[+@!]\(.*?\)|\[|\]/,N5=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Xs=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,n={}){(0,Zf.assertValidPattern)(e),n=n||{},this.options=n,this.pattern=e,this.platform=n.platform||$R,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=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=s[0]===""&&s[1]===""&&(s[2]==="?"||!NR.test(s[2]))&&!NR.test(s[3]),c=/^[a-z]:/i.test(s[0]);if(u)return[...s.slice(0,4),...s.slice(4).map(l=>this.parse(l))];if(c)return[s[0],...s.slice(1).map(l=>this.parse(l))]}return s.map(u=>this.parse(u))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][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 i=0;i<e[r].length;i++)e[r][i]==="**"&&(e[r][i]="*");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 i=r;for(;n[i+1]==="**";)i++;i!==r&&n.splice(r,i-r)}return n})}levelOneOptimize(e){return e.map(n=>(n=n.reduce((r,i)=>{let s=r[r.length-1];return i==="**"&&s==="**"?r:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(i),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 i=1;i<e.length-1;i++){let s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(n=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(n=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let i=e[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&(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 i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let o=i;for(;r[o+1]==="**";)o++;o>i&&r.splice(i+1,o-i);let a=r[i+1],u=r[i+2],c=r[i+3];if(a!==".."||!u||u==="."||u===".."||!c||c==="."||c==="..")continue;n=!0,r.splice(i,1);let l=r.slice(0);l[i]="**",e.push(l),i--}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 s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let o=r[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){n=!0;let u=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...u),r.length===0&&r.push(""),s-=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 i=this.partsMatch(e[n],e[r],!this.preserveMultipleSlashes);if(i){e[n]=[],e[r]=i;break}}return e.filter(n=>n.length)}partsMatch(e,n,r=!1){let i=0,s=0,o=[],a="";for(;i<e.length&&s<n.length;)if(e[i]===n[s])o.push(a==="b"?n[s]:e[i]),i++,s++;else if(r&&e[i]==="**"&&n[s]===e[i+1])o.push(e[i]),i++;else if(r&&n[s]==="**"&&e[i]===n[s+1])o.push(n[s]),s++;else if(e[i]==="*"&&n[s]&&(this.options.dot||!n[s].startsWith("."))&&n[s]!=="**"){if(a==="b")return!1;a="a",o.push(e[i]),i++,s++}else if(n[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(a==="a")return!1;a="b",o.push(n[s]),i++,s++}else return!1;return e.length===n.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,n=!1,r=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)n=!n,r++;r&&(this.pattern=e.slice(r)),this.negate=n}matchOne(e,n,r=!1){let i=this.options;if(this.isWindows){let _=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),C=!_&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),k=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),T=!k&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),w=C?3:_?0:void 0,v=T?3:k?0:void 0;if(typeof w=="number"&&typeof v=="number"){let[L,R]=[e[w],n[v]];L.toLowerCase()===R.toLowerCase()&&(n[v]=L,v>w?n=n.slice(v):w>v&&(e=e.slice(w)))}}let{optimizationLevel:s=1}=this.options;s>=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,u=e.length,c=n.length;o<u&&a<c;o++,a++){this.debug("matchOne loop");var l=n[a],h=e[o];if(this.debug(n,l,h),l===!1)return!1;if(l===te.GLOBSTAR){this.debug("GLOBSTAR",[n,l,h]);var d=o,g=a+1;if(g===c){for(this.debug("** at the end");o<u;o++)if(e[o]==="."||e[o]===".."||!i.dot&&e[o].charAt(0)===".")return!1;return!0}for(;d<u;){var y=e[d];if(this.debug(`
152
152
  globstar while`,e,d,n,g,y),this.matchOne(e.slice(d),n.slice(g),r))return this.debug("globstar found match!",d,u,y),!0;if(y==="."||y===".."||!i.dot&&y.charAt(0)==="."){this.debug("dot detected!",e,d,n,g);break}this.debug("globstar swallow a segment, and continue"),d++}return!!(r&&(this.debug(`
153
- >>> no match, partial?`,e,d,n,g),d===u))}let _;if(typeof l=="string"?(_=h===l,this.debug("string match",l,h,_)):(_=l.test(h),this.debug("pattern match",l,h,_)),!_)return!1}if(o===u&&a===c)return!0;if(o===u)return r;if(a===c)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return(0,ee.braceExpand)(this.pattern,this.options)}parse(e){(0,Gf.assertValidPattern)(e);let n=this.options;if(e==="**")return ee.GLOBSTAR;if(e==="")return"";let r,i=null;(r=e.match(VW))?i=n.dot?YW:XW:(r=e.match(jW))?i=(n.nocase?n.dot?UW:BW:n.dot?$W:FW)(r[1]):(r=e.match(JW))?i=(n.nocase?n.dot?ZW:QW:n.dot?e5:t5)(r):(r=e.match(WW))?i=n.dot?GW:HW:(r=e.match(zW))&&(i=KW);let s=TR.AST.fromGlob(e,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}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?r5:n.dot?i5:s5,i=new Set(n.nocase?["i"]:[]),s=e.map(u=>{let c=u.map(l=>{if(l instanceof RegExp)for(let h of l.flags.split(""))i.add(h);return typeof l=="string"?h5(l):l===ee.GLOBSTAR?ee.GLOBSTAR:l._src});return c.forEach((l,h)=>{let d=c[h+1],g=c[h-1];l!==ee.GLOBSTAR||g===ee.GLOBSTAR||(g===void 0?d!==void 0&&d!==ee.GLOBSTAR?c[h+1]="(?:\\/|"+r+"\\/)?"+d:c[h]=r:d===void 0?c[h-1]=g+"(?:\\/|"+r+")?":d!==ee.GLOBSTAR&&(c[h-1]=g+"(?:\\/|\\/"+r+"\\/)"+d,c[h+1]=ee.GLOBSTAR))}),c.filter(l=>l!==ee.GLOBSTAR).join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+a+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].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 i=this.slashSplit(e);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let a=i.length-2;!o&&a>=0;a--)o=i[a];for(let a=0;a<s.length;a++){let u=s[a],c=i;if(r.matchBase&&u.length===1&&(c=[o]),this.matchOne(c,u,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return ee.minimatch.defaults(e).Minimatch}};ee.Minimatch=zs;var d5=kS();Object.defineProperty(ee,"AST",{enumerable:!0,get:function(){return d5.AST}});var f5=AS();Object.defineProperty(ee,"escape",{enumerable:!0,get:function(){return f5.escape}});var p5=$f();Object.defineProperty(ee,"unescape",{enumerable:!0,get:function(){return p5.unescape}});ee.minimatch.AST=TR.AST;ee.minimatch.Minimatch=zs;ee.minimatch.escape=LW.escape;ee.minimatch.unescape=NW.unescape});var PR=m(Kf=>{"use strict";Object.defineProperty(Kf,"__esModule",{value:!0});Kf.LRUCache=void 0;var ba=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,CR=new Set,CS=typeof process=="object"&&process?process:{},OR=(t,e,n,r)=>{typeof CS.emitWarning=="function"?CS.emitWarning(t,e,n,r):console.error(`[${n}] ${e}: ${t}`)},zf=globalThis.AbortController,AR=globalThis.AbortSignal;if(typeof zf>"u"){AR=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(r,i){this._onabort.push(i)}},zf=class{constructor(){e()}signal=new AR;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let i of this.signal._onabort)i(r);this.signal.onabort?.(r)}}};let t=CS.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,OR("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 g5=t=>!CR.has(t),GV=Symbol("type"),ns=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),RR=t=>ns(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?_a:null:null,_a=class extends Array{constructor(e){super(e),this.fill(0)}},OS=class t{heap;length;static#e=!1;static create(e){let n=RR(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]}},RS=class t{#e;#t;#s;#r;#o;#v;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#c;#h;#a;#u;#i;#m;#y;#f;#d;#T;#g;#E;#x;#_;#S;#w;#p;static unsafeExposeInternals(e){return{starts:e.#x,ttls:e.#_,sizes:e.#E,keyMap:e.#a,keyList:e.#u,valList:e.#i,next:e.#m,prev:e.#y,get head(){return e.#f},get tail(){return e.#d},free:e.#T,isBackgroundFetch:n=>e.#l(n),backgroundFetch:(n,r,i,s)=>e.#j(n,r,i,s),moveToTail:n=>e.#$(n),indexes:n=>e.#A(n),rindexes:n=>e.#C(n),isStale:n=>e.#b(n)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#h}get size(){return this.#c}get fetchMethod(){return this.#o}get memoMethod(){return this.#v}get dispose(){return this.#s}get disposeAfter(){return this.#r}constructor(e){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:c,disposeAfter:l,noDisposeOnSet:h,noUpdateTTL:d,maxSize:g=0,maxEntrySize:y=0,sizeCalculation:_,fetchMethod:C,memoMethod:k,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:v,allowStaleOnFetchAbort:L,ignoreFetchAbort:R}=e;if(n!==0&&!ns(n))throw new TypeError("max option must be a nonnegative integer");let U=n?RR(n):Array;if(!U)throw new Error("invalid max value: "+n);if(this.#e=n,this.#t=g,this.maxEntrySize=y||this.#t,this.sizeCalculation=_,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(k!==void 0&&typeof k!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#v=k,C!==void 0&&typeof C!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=C,this.#w=!!C,this.#a=new Map,this.#u=new Array(n).fill(void 0),this.#i=new Array(n).fill(void 0),this.#m=new U(n),this.#y=new U(n),this.#f=0,this.#d=0,this.#T=OS.create(n),this.#c=0,this.#h=0,typeof c=="function"&&(this.#s=c),typeof l=="function"?(this.#r=l,this.#g=[]):(this.#r=void 0,this.#g=void 0),this.#S=!!this.#s,this.#p=!!this.#r,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!T,this.allowStaleOnFetchRejection=!!v,this.allowStaleOnFetchAbort=!!L,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.#t!==0&&!ns(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!ns(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#R()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=ns(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||0,this.ttl){if(!ns(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#O()}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 te="LRU_CACHE_UNBOUNDED";g5(te)&&(CR.add(te),OR("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",te,t))}}getRemainingTTL(e){return this.#a.has(e)?1/0:0}#O(){let e=new _a(this.#e),n=new _a(this.#e);this.#_=e,this.#x=n,this.#D=(s,o,a=ba.now())=>{if(n[s]=o!==0?a:0,e[s]=o,o!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#b(s)&&this.#P(this.#u[s],"expire")},o+1);u.unref&&u.unref()}},this.#k=s=>{n[s]=e[s]!==0?ba.now():0},this.#n=(s,o)=>{if(e[o]){let a=e[o],u=n[o];if(!a||!u)return;s.ttl=a,s.start=u,s.now=r||i();let c=s.now-u;s.remainingTTL=a-c}};let r=0,i=()=>{let s=ba.now();if(this.ttlResolution>0){r=s;let o=setTimeout(()=>r=0,this.ttlResolution);o.unref&&o.unref()}return s};this.getRemainingTTL=s=>{let o=this.#a.get(s);if(o===void 0)return 0;let a=e[o],u=n[o];if(!a||!u)return 1/0;let c=(r||i())-u;return a-c},this.#b=s=>{let o=n[s],a=e[s];return!!a&&!!o&&(r||i())-o>a}}#k=()=>{};#n=()=>{};#D=()=>{};#b=()=>!1;#R(){let e=new _a(this.#e);this.#h=0,this.#E=e,this.#I=n=>{this.#h-=e[n],e[n]=0},this.#L=(n,r,i,s)=>{if(this.#l(r))return 0;if(!ns(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(r,n),!ns(i))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 i},this.#M=(n,r,i)=>{if(e[n]=r,this.#t){let s=this.#t-e[n];for(;this.#h>s;)this.#q(!0)}this.#h+=e[n],i&&(i.entrySize=r,i.totalCalculatedSize=this.#h)}}#I=e=>{};#M=(e,n,r)=>{};#L=(e,n,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:e=this.allowStale}={}){if(this.#c)for(let n=this.#d;!(!this.#N(n)||((e||!this.#b(n))&&(yield n),n===this.#f));)n=this.#y[n]}*#C({allowStale:e=this.allowStale}={}){if(this.#c)for(let n=this.#f;!(!this.#N(n)||((e||!this.#b(n))&&(yield n),n===this.#d));)n=this.#m[n]}#N(e){return e!==void 0&&this.#a.get(this.#u[e])===e}*entries(){for(let e of this.#A())this.#i[e]!==void 0&&this.#u[e]!==void 0&&!this.#l(this.#i[e])&&(yield[this.#u[e],this.#i[e]])}*rentries(){for(let e of this.#C())this.#i[e]!==void 0&&this.#u[e]!==void 0&&!this.#l(this.#i[e])&&(yield[this.#u[e],this.#i[e]])}*keys(){for(let e of this.#A()){let n=this.#u[e];n!==void 0&&!this.#l(this.#i[e])&&(yield n)}}*rkeys(){for(let e of this.#C()){let n=this.#u[e];n!==void 0&&!this.#l(this.#i[e])&&(yield n)}}*values(){for(let e of this.#A())this.#i[e]!==void 0&&!this.#l(this.#i[e])&&(yield this.#i[e])}*rvalues(){for(let e of this.#C())this.#i[e]!==void 0&&!this.#l(this.#i[e])&&(yield this.#i[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,n={}){for(let r of this.#A()){let i=this.#i[r],s=this.#l(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#u[r],this))return this.get(this.#u[r],n)}}forEach(e,n=this){for(let r of this.#A()){let i=this.#i[r],s=this.#l(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.#u[r],this)}}rforEach(e,n=this){for(let r of this.#C()){let i=this.#i[r],s=this.#l(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.#u[r],this)}}purgeStale(){let e=!1;for(let n of this.#C({allowStale:!0}))this.#b(n)&&(this.#P(this.#u[n],"expire"),e=!0);return e}info(e){let n=this.#a.get(e);if(n===void 0)return;let r=this.#i[n],i=this.#l(r)?r.__staleWhileFetching:r;if(i===void 0)return;let s={value:i};if(this.#_&&this.#x){let o=this.#_[n],a=this.#x[n];if(o&&a){let u=o-(ba.now()-a);s.ttl=u,s.start=Date.now()}}return this.#E&&(s.size=this.#E[n]),s}dump(){let e=[];for(let n of this.#A({allowStale:!0})){let r=this.#u[n],i=this.#i[n],s=this.#l(i)?i.__staleWhileFetching:i;if(s===void 0||r===void 0)continue;let o={value:s};if(this.#_&&this.#x){o.ttl=this.#_[n];let a=ba.now()-this.#x[n];o.start=Math.floor(Date.now()-a)}this.#E&&(o.size=this.#E[n]),e.unshift([r,o])}return e}load(e){this.clear();for(let[n,r]of e){if(r.start){let i=Date.now()-r.start;r.start=ba.now()-i}this.set(n,r.value,r)}}set(e,n,r={}){if(n===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:u}=r,{noUpdateTTL:c=this.noUpdateTTL}=r,l=this.#L(e,n,r.size||0,a);if(this.maxEntrySize&&l>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#P(e,"set"),this;let h=this.#c===0?void 0:this.#a.get(e);if(h===void 0)h=this.#c===0?this.#d:this.#T.length!==0?this.#T.pop():this.#c===this.#e?this.#q(!1):this.#c,this.#u[h]=e,this.#i[h]=n,this.#a.set(e,h),this.#m[this.#d]=h,this.#y[h]=this.#d,this.#d=h,this.#c++,this.#M(h,l,u),u&&(u.set="add"),c=!1;else{this.#$(h);let d=this.#i[h];if(n!==d){if(this.#w&&this.#l(d)){d.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=d;g!==void 0&&!o&&(this.#S&&this.#s?.(g,e,"set"),this.#p&&this.#g?.push([g,e,"set"]))}else o||(this.#S&&this.#s?.(d,e,"set"),this.#p&&this.#g?.push([d,e,"set"]));if(this.#I(h),this.#M(h,l,u),this.#i[h]=n,u){u.set="replace";let g=d&&this.#l(d)?d.__staleWhileFetching:d;g!==void 0&&(u.oldValue=g)}}else u&&(u.set="update")}if(i!==0&&!this.#_&&this.#O(),this.#_&&(c||this.#D(h,i,s),u&&this.#n(u,h)),!o&&this.#p&&this.#g){let d=this.#g,g;for(;g=d?.shift();)this.#r?.(...g)}return this}pop(){try{for(;this.#c;){let e=this.#i[this.#f];if(this.#q(!0),this.#l(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#p&&this.#g){let e=this.#g,n;for(;n=e?.shift();)this.#r?.(...n)}}}#q(e){let n=this.#f,r=this.#u[n],i=this.#i[n];return this.#w&&this.#l(i)?i.__abortController.abort(new Error("evicted")):(this.#S||this.#p)&&(this.#S&&this.#s?.(i,r,"evict"),this.#p&&this.#g?.push([i,r,"evict"])),this.#I(n),e&&(this.#u[n]=void 0,this.#i[n]=void 0,this.#T.push(n)),this.#c===1?(this.#f=this.#d=0,this.#T.length=0):this.#f=this.#m[n],this.#a.delete(r),this.#c--,n}has(e,n={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:i}=n,s=this.#a.get(e);if(s!==void 0){let o=this.#i[s];if(this.#l(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#b(s))i&&(i.has="stale",this.#n(i,s));else return r&&this.#k(s),i&&(i.has="hit",this.#n(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,n={}){let{allowStale:r=this.allowStale}=n,i=this.#a.get(e);if(i===void 0||!r&&this.#b(i))return;let s=this.#i[i];return this.#l(s)?s.__staleWhileFetching:s}#j(e,n,r,i){let s=n===void 0?void 0:this.#i[n];if(this.#l(s))return s;let o=new zf,{signal:a}=r;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:r,context:i},c=(_,C=!1)=>{let{aborted:k}=o.signal,T=r.ignoreFetchAbort&&_!==void 0;if(r.status&&(k&&!C?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,T&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),k&&!T&&!C)return h(o.signal.reason);let w=g;return this.#i[n]===g&&(_===void 0?w.__staleWhileFetching?this.#i[n]=w.__staleWhileFetching:this.#P(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,_,u.options))),_},l=_=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=_),h(_)),h=_=>{let{aborted:C}=o.signal,k=C&&r.allowStaleOnFetchAbort,T=k||r.allowStaleOnFetchRejection,w=T||r.noDeleteOnFetchRejection,v=g;if(this.#i[n]===g&&(!w||v.__staleWhileFetching===void 0?this.#P(e,"fetch"):k||(this.#i[n]=v.__staleWhileFetching)),T)return r.status&&v.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),v.__staleWhileFetching;if(v.__returned===v)throw _},d=(_,C)=>{let k=this.#o?.(e,s,u);k&&k instanceof Promise&&k.then(T=>_(T===void 0?void 0:T),C),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(_(void 0),r.allowStaleOnFetchAbort&&(_=T=>c(T,!0)))})};r.status&&(r.status.fetchDispatched=!0);let g=new Promise(d).then(c,l),y=Object.assign(g,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return n===void 0?(this.set(e,y,{...u.options,status:void 0}),n=this.#a.get(e)):this.#i[n]=y,y}#l(e){if(!this.#w)return!1;let n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof zf}async fetch(e,n={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:u=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:_,forceRefresh:C=!1,status:k,signal:T}=n;if(!this.#w)return k&&(k.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:k});let w={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:y,ignoreFetchAbort:g,status:k,signal:T},v=this.#a.get(e);if(v===void 0){k&&(k.fetch="miss");let L=this.#j(e,v,w,_);return L.__returned=L}else{let L=this.#i[v];if(this.#l(L)){let W=r&&L.__staleWhileFetching!==void 0;return k&&(k.fetch="inflight",W&&(k.returnedStale=!0)),W?L.__staleWhileFetching:L.__returned=L}let R=this.#b(v);if(!C&&!R)return k&&(k.fetch="hit"),this.#$(v),i&&this.#k(v),k&&this.#n(k,v),L;let U=this.#j(e,v,w,_),se=U.__staleWhileFetching!==void 0&&r;return k&&(k.fetch=R?"stale":"refresh",se&&R&&(k.returnedStale=!0)),se?U.__staleWhileFetching:U.__returned=U}}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.#v;if(!r)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:s,...o}=n,a=this.get(e,o);if(!s&&a!==void 0)return a;let u=r(e,a,{options:o,context:i});return this.set(e,u,o),u}get(e,n={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=n,a=this.#a.get(e);if(a!==void 0){let u=this.#i[a],c=this.#l(u);return o&&this.#n(o,a),this.#b(a)?(o&&(o.get="stale"),c?(o&&r&&u.__staleWhileFetching!==void 0&&(o.returnedStale=!0),r?u.__staleWhileFetching:void 0):(s||this.#P(e,"expire"),o&&r&&(o.returnedStale=!0),r?u:void 0)):(o&&(o.get="hit"),c?u.__staleWhileFetching:(this.#$(a),i&&this.#k(a),u))}else o&&(o.get="miss")}#F(e,n){this.#y[n]=e,this.#m[e]=n}#$(e){e!==this.#d&&(e===this.#f?this.#f=this.#m[e]:this.#F(this.#y[e],this.#m[e]),this.#F(this.#d,e),this.#d=e)}delete(e){return this.#P(e,"delete")}#P(e,n){let r=!1;if(this.#c!==0){let i=this.#a.get(e);if(i!==void 0)if(r=!0,this.#c===1)this.#B(n);else{this.#I(i);let s=this.#i[i];if(this.#l(s)?s.__abortController.abort(new Error("deleted")):(this.#S||this.#p)&&(this.#S&&this.#s?.(s,e,n),this.#p&&this.#g?.push([s,e,n])),this.#a.delete(e),this.#u[i]=void 0,this.#i[i]=void 0,i===this.#d)this.#d=this.#y[i];else if(i===this.#f)this.#f=this.#m[i];else{let o=this.#y[i];this.#m[o]=this.#m[i];let a=this.#m[i];this.#y[a]=this.#y[i]}this.#c--,this.#T.push(i)}}if(this.#p&&this.#g?.length){let i=this.#g,s;for(;s=i?.shift();)this.#r?.(...s)}return r}clear(){return this.#B("delete")}#B(e){for(let n of this.#C({allowStale:!0})){let r=this.#i[n];if(this.#l(r))r.__abortController.abort(new Error("deleted"));else{let i=this.#u[n];this.#S&&this.#s?.(r,i,e),this.#p&&this.#g?.push([r,i,e])}}if(this.#a.clear(),this.#i.fill(void 0),this.#u.fill(void 0),this.#_&&this.#x&&(this.#_.fill(0),this.#x.fill(0)),this.#E&&this.#E.fill(0),this.#f=0,this.#d=0,this.#T.length=0,this.#h=0,this.#c=0,this.#p&&this.#g){let n=this.#g,r;for(;r=n?.shift();)this.#r?.(...r)}}};Kf.LRUCache=RS});var jS=m(mn=>{"use strict";var m5=mn&&mn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(mn,"__esModule",{value:!0});mn.Minipass=mn.isWritable=mn.isReadable=mn.isStream=void 0;var DR=typeof process=="object"&&process?process:{stdout:null,stderr:null},qS=require("node:events"),NR=m5(require("node:stream")),y5=require("node:string_decoder"),b5=t=>!!t&&typeof t=="object"&&(t instanceof ep||t instanceof NR.default||(0,mn.isReadable)(t)||(0,mn.isWritable)(t));mn.isStream=b5;var _5=t=>!!t&&typeof t=="object"&&t instanceof qS.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==NR.default.Writable.prototype.pipe;mn.isReadable=_5;var v5=t=>!!t&&typeof t=="object"&&t instanceof qS.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function";mn.isWritable=v5;var _i=Symbol("EOF"),vi=Symbol("maybeEmitEnd"),rs=Symbol("emittedEnd"),Vf=Symbol("emittingEnd"),tc=Symbol("emittedError"),Xf=Symbol("closed"),IR=Symbol("read"),Yf=Symbol("flush"),MR=Symbol("flushChunk"),Ar=Symbol("encoding"),va=Symbol("decoder"),Wt=Symbol("flowing"),nc=Symbol("paused"),Sa=Symbol("resume"),Ht=Symbol("buffer"),gn=Symbol("pipes"),Gt=Symbol("bufferLength"),PS=Symbol("bufferPush"),Jf=Symbol("bufferShift"),on=Symbol("objectMode"),Et=Symbol("destroyed"),DS=Symbol("error"),IS=Symbol("emitData"),LR=Symbol("emitEnd"),MS=Symbol("emitEnd2"),Qr=Symbol("async"),LS=Symbol("abort"),Qf=Symbol("aborted"),rc=Symbol("signal"),Ks=Symbol("dataListeners"),Fn=Symbol("discarded"),ic=t=>Promise.resolve().then(t),S5=t=>t(),w5=t=>t==="end"||t==="finish"||t==="prefinish",T5=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,E5=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),Zf=class{src;dest;opts;ondrain;constructor(e,n,r){this.src=e,this.dest=n,this.opts=r,this.ondrain=()=>e[Sa](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},NS=class extends Zf{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,n,r){super(e,n,r),this.proxyErrors=i=>n.emit("error",i),e.on("error",this.proxyErrors)}},x5=t=>!!t.objectMode,k5=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",ep=class extends qS.EventEmitter{[Wt]=!1;[nc]=!1;[gn]=[];[Ht]=[];[on];[Ar];[Qr];[va];[_i]=!1;[rs]=!1;[Vf]=!1;[Xf]=!1;[tc]=null;[Gt]=0;[Et]=!1;[rc];[Qf]=!1;[Ks]=0;[Fn]=!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");x5(n)?(this[on]=!0,this[Ar]=null):k5(n)?(this[Ar]=n.encoding,this[on]=!1):(this[on]=!1,this[Ar]=null),this[Qr]=!!n.async,this[va]=this[Ar]?new y5.StringDecoder(this[Ar]):null,n&&n.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Ht]}),n&&n.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[gn]});let{signal:r}=n;r&&(this[rc]=r,r.aborted?this[LS]():r.addEventListener("abort",()=>this[LS]()))}get bufferLength(){return this[Gt]}get encoding(){return this[Ar]}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[on]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Qr]}set async(e){this[Qr]=this[Qr]||!!e}[LS](){this[Qf]=!0,this.emit("abort",this[rc]?.reason),this.destroy(this[rc]?.reason)}get aborted(){return this[Qf]}set aborted(e){}write(e,n,r){if(this[Qf])return!1;if(this[_i])throw new Error("write after end");if(this[Et])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 i=this[Qr]?ic:S5;if(!this[on]&&!Buffer.isBuffer(e)){if(E5(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(T5(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[on]?(this[Wt]&&this[Gt]!==0&&this[Yf](!0),this[Wt]?this.emit("data",e):this[PS](e),this[Gt]!==0&&this.emit("readable"),r&&i(r),this[Wt]):e.length?(typeof e=="string"&&!(n===this[Ar]&&!this[va]?.lastNeed)&&(e=Buffer.from(e,n)),Buffer.isBuffer(e)&&this[Ar]&&(e=this[va].write(e)),this[Wt]&&this[Gt]!==0&&this[Yf](!0),this[Wt]?this.emit("data",e):this[PS](e),this[Gt]!==0&&this.emit("readable"),r&&i(r),this[Wt]):(this[Gt]!==0&&this.emit("readable"),r&&i(r),this[Wt])}read(e){if(this[Et])return null;if(this[Fn]=!1,this[Gt]===0||e===0||e&&e>this[Gt])return this[vi](),null;this[on]&&(e=null),this[Ht].length>1&&!this[on]&&(this[Ht]=[this[Ar]?this[Ht].join(""):Buffer.concat(this[Ht],this[Gt])]);let n=this[IR](e||null,this[Ht][0]);return this[vi](),n}[IR](e,n){if(this[on])this[Jf]();else{let r=n;e===r.length||e===null?this[Jf]():typeof r=="string"?(this[Ht][0]=r.slice(e),n=r.slice(0,e),this[Gt]-=e):(this[Ht][0]=r.subarray(e),n=r.subarray(0,e),this[Gt]-=e)}return this.emit("data",n),!this[Ht].length&&!this[_i]&&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[_i]=!0,this.writable=!1,(this[Wt]||!this[nc])&&this[vi](),this}[Sa](){this[Et]||(!this[Ks]&&!this[gn].length&&(this[Fn]=!0),this[nc]=!1,this[Wt]=!0,this.emit("resume"),this[Ht].length?this[Yf]():this[_i]?this[vi]():this.emit("drain"))}resume(){return this[Sa]()}pause(){this[Wt]=!1,this[nc]=!0,this[Fn]=!1}get destroyed(){return this[Et]}get flowing(){return this[Wt]}get paused(){return this[nc]}[PS](e){this[on]?this[Gt]+=1:this[Gt]+=e.length,this[Ht].push(e)}[Jf](){return this[on]?this[Gt]-=1:this[Gt]-=this[Ht][0].length,this[Ht].shift()}[Yf](e=!1){do;while(this[MR](this[Jf]())&&this[Ht].length);!e&&!this[Ht].length&&!this[_i]&&this.emit("drain")}[MR](e){return this.emit("data",e),this[Wt]}pipe(e,n){if(this[Et])return e;this[Fn]=!1;let r=this[rs];return n=n||{},e===DR.stdout||e===DR.stderr?n.end=!1:n.end=n.end!==!1,n.proxyErrors=!!n.proxyErrors,r?n.end&&e.end():(this[gn].push(n.proxyErrors?new NS(this,e,n):new Zf(this,e,n)),this[Qr]?ic(()=>this[Sa]()):this[Sa]()),e}unpipe(e){let n=this[gn].find(r=>r.dest===e);n&&(this[gn].length===1?(this[Wt]&&this[Ks]===0&&(this[Wt]=!1),this[gn]=[]):this[gn].splice(this[gn].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[Fn]=!1,this[Ks]++,!this[gn].length&&!this[Wt]&&this[Sa]();else if(e==="readable"&&this[Gt]!==0)super.emit("readable");else if(w5(e)&&this[rs])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[tc]){let i=n;this[Qr]?ic(()=>i.call(this,this[tc])):i.call(this,this[tc])}return r}removeListener(e,n){return this.off(e,n)}off(e,n){let r=super.off(e,n);return e==="data"&&(this[Ks]=this.listeners("data").length,this[Ks]===0&&!this[Fn]&&!this[gn].length&&(this[Wt]=!1)),r}removeAllListeners(e){let n=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Ks]=0,!this[Fn]&&!this[gn].length&&(this[Wt]=!1)),n}get emittedEnd(){return this[rs]}[vi](){!this[Vf]&&!this[rs]&&!this[Et]&&this[Ht].length===0&&this[_i]&&(this[Vf]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Xf]&&this.emit("close"),this[Vf]=!1)}emit(e,...n){let r=n[0];if(e!=="error"&&e!=="close"&&e!==Et&&this[Et])return!1;if(e==="data")return!this[on]&&!r?!1:this[Qr]?(ic(()=>this[IS](r)),!0):this[IS](r);if(e==="end")return this[LR]();if(e==="close"){if(this[Xf]=!0,!this[rs]&&!this[Et])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[tc]=r,super.emit(DS,r);let s=!this[rc]||this.listeners("error").length?super.emit("error",r):!1;return this[vi](),s}else if(e==="resume"){let s=super.emit("resume");return this[vi](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let i=super.emit(e,...n);return this[vi](),i}[IS](e){for(let r of this[gn])r.dest.write(e)===!1&&this.pause();let n=this[Fn]?!1:super.emit("data",e);return this[vi](),n}[LR](){return this[rs]?!1:(this[rs]=!0,this.readable=!1,this[Qr]?(ic(()=>this[MS]()),!0):this[MS]())}[MS](){if(this[va]){let n=this[va].end();if(n){for(let r of this[gn])r.dest.write(n);this[Fn]||super.emit("data",n)}}for(let n of this[gn])n.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[on]||(e.dataLength=0);let n=this.promise();return this.on("data",r=>{e.push(r),this[on]||(e.dataLength+=r.length)}),await n,e}async concat(){if(this[on])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Ar]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,n)=>{this.on(Et,()=>n(new Error("stream destroyed"))),this.on("error",r=>n(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Fn]=!1;let e=!1,n=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return n();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[_i])return n();let s,o,a=h=>{this.off("data",u),this.off("end",c),this.off(Et,l),n(),o(h)},u=h=>{this.off("error",a),this.off("end",c),this.off(Et,l),this.pause(),s({value:h,done:!!this[_i]})},c=()=>{this.off("error",a),this.off("data",u),this.off(Et,l),n(),s({done:!0,value:void 0})},l=()=>a(new Error("stream destroyed"));return new Promise((h,d)=>{o=d,s=h,this.once(Et,l),this.once("error",a),this.once("end",c),this.once("data",u)})},throw:n,return:n,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Fn]=!1;let e=!1,n=()=>(this.pause(),this.off(DS,n),this.off(Et,n),this.off("end",n),e=!0,{done:!0,value:void 0}),r=()=>{if(e)return n();let i=this.read();return i===null?n():{done:!1,value:i}};return this.once("end",n),this.once(DS,n),this.once(Et,n),{next:r,throw:n,return:n,[Symbol.iterator](){return this}}}destroy(e){if(this[Et])return e?this.emit("error",e):this.emit(Et),this;this[Et]=!0,this[Fn]=!0,this[Ht].length=0,this[Gt]=0;let n=this;return typeof n.close=="function"&&!this[Xf]&&n.close(),e?this.emit("error",e):this.emit(Et),this}static get isStream(){return mn.isStream}};mn.Minipass=ep});var JR=m(Fe=>{"use strict";var A5=Fe&&Fe.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),C5=Fe&&Fe.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),O5=Fe&&Fe.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&A5(e,t,n);return C5(e,t),e};Object.defineProperty(Fe,"__esModule",{value:!0});Fe.PathScurry=Fe.Path=Fe.PathScurryDarwin=Fe.PathScurryPosix=Fe.PathScurryWin32=Fe.PathScurryBase=Fe.PathPosix=Fe.PathWin32=Fe.PathBase=Fe.ChildrenCache=Fe.ResolveCache=void 0;var UR=PR(),sp=require("node:path"),R5=require("node:url"),oc=require("fs"),P5=O5(require("node:fs")),D5=oc.realpathSync.native,tp=require("node:fs/promises"),qR=jS(),ac={lstatSync:oc.lstatSync,readdir:oc.readdir,readdirSync:oc.readdirSync,readlinkSync:oc.readlinkSync,realpathSync:D5,promises:{lstat:tp.lstat,readdir:tp.readdir,readlink:tp.readlink,realpath:tp.realpath}},WR=t=>!t||t===ac||t===P5?ac:{...ac,...t,promises:{...ac.promises,...t.promises||{}}},HR=/^\\\\\?\\([a-z]:)\\?$/i,I5=t=>t.replace(/\//g,"\\").replace(HR,"$1\\"),M5=/[\\\/]/,lr=0,GR=1,zR=2,Zr=4,KR=6,VR=8,Vs=10,XR=12,cr=15,sc=~cr,FS=16,jR=32,uc=64,Cr=128,np=256,ip=512,FR=uc|Cr|ip,L5=1023,$S=t=>t.isFile()?VR:t.isDirectory()?Zr:t.isSymbolicLink()?Vs:t.isCharacterDevice()?zR:t.isBlockDevice()?KR:t.isSocket()?XR:t.isFIFO()?GR:lr,$R=new Map,cc=t=>{let e=$R.get(t);if(e)return e;let n=t.normalize("NFKD");return $R.set(t,n),n},BR=new Map,rp=t=>{let e=BR.get(t);if(e)return e;let n=cc(t.toLowerCase());return BR.set(t,n),n},lc=class extends UR.LRUCache{constructor(){super({max:256})}};Fe.ResolveCache=lc;var op=class extends UR.LRUCache{constructor(e=16*1024){super({maxSize:e,sizeCalculation:n=>n.length+1})}};Fe.ChildrenCache=op;var YR=Symbol("PathScurry setAsCwd"),Yt=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#s;get mode(){return this.#s}#r;get nlink(){return this.#r}#o;get uid(){return this.#o}#v;get gid(){return this.#v}#c;get rdev(){return this.#c}#h;get blksize(){return this.#h}#a;get ino(){return this.#a}#u;get size(){return this.#u}#i;get blocks(){return this.#i}#m;get atimeMs(){return this.#m}#y;get mtimeMs(){return this.#y}#f;get ctimeMs(){return this.#f}#d;get birthtimeMs(){return this.#d}#T;get atime(){return this.#T}#g;get mtime(){return this.#g}#E;get ctime(){return this.#E}#x;get birthtime(){return this.#x}#_;#S;#w;#p;#O;#k;#n;#D;#b;#R;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,n=lr,r,i,s,o,a){this.name=e,this.#_=s?rp(e):cc(e),this.#n=n&L5,this.nocase=s,this.roots=i,this.root=r||this,this.#D=o,this.#w=a.fullpath,this.#O=a.relative,this.#k=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=WR(a.fs)}depth(){return this.#S!==void 0?this.#S:this.parent?this.#S=this.parent.depth()+1:this.#S=0}childrenCache(){return this.#D}resolve(e){if(!e)return this;let n=this.getRootString(e),i=e.substring(n.length).split(this.splitSep);return n?this.getRoot(n).#I(i):this.#I(i)}#I(e){let n=this;for(let r of e)n=n.child(r);return n}children(){let e=this.#D.get(this);if(e)return e;let n=Object.assign([],{provisional:0});return this.#D.set(this,n),this.#n&=~FS,n}child(e,n){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),i=this.nocase?rp(e):cc(e);for(let u of r)if(u.#_===i)return u;let s=this.parent?this.sep:"",o=this.#w?this.#w+s+e:void 0,a=this.newChild(e,lr,{...n,parent:this,fullpath:o});return this.canReaddir()||(a.#n|=Cr),r.push(a),a}relative(){if(this.isCWD)return"";if(this.#O!==void 0)return this.#O;let e=this.name,n=this.parent;if(!n)return this.#O=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.#k!==void 0)return this.#k;let e=this.name,n=this.parent;if(!n)return this.#k=this.fullpathPosix();let r=n.relativePosix();return r+(!r||!n.parent?"":"/")+e}fullpath(){if(this.#w!==void 0)return this.#w;let e=this.name,n=this.parent;if(!n)return this.#w=this.name;let i=n.fullpath()+(n.parent?this.sep:"")+e;return this.#w=i}fullpathPosix(){if(this.#p!==void 0)return this.#p;if(this.sep==="/")return this.#p=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#p=`//?/${i}`:this.#p=i}let e=this.parent,n=e.fullpathPosix(),r=n+(!n||!e.parent?"":"/")+this.name;return this.#p=r}isUnknown(){return(this.#n&cr)===lr}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.#n&cr)===VR}isDirectory(){return(this.#n&cr)===Zr}isCharacterDevice(){return(this.#n&cr)===zR}isBlockDevice(){return(this.#n&cr)===KR}isFIFO(){return(this.#n&cr)===GR}isSocket(){return(this.#n&cr)===XR}isSymbolicLink(){return(this.#n&Vs)===Vs}lstatCached(){return this.#n&jR?this:void 0}readlinkCached(){return this.#b}realpathCached(){return this.#R}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.#n&cr;return!(e!==lr&&e!==Vs||this.#n&np||this.#n&Cr)}calledReaddir(){return!!(this.#n&FS)}isENOENT(){return!!(this.#n&Cr)}isNamed(e){return this.nocase?this.#_===rp(e):this.#_===cc(e)}async readlink(){let e=this.#b;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.#b=r}catch(n){this.#l(n.code);return}}readlinkSync(){let e=this.#b;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.#b=r}catch(n){this.#l(n.code);return}}#M(e){this.#n|=FS;for(let n=e.provisional;n<e.length;n++){let r=e[n];r&&r.#L()}}#L(){this.#n&Cr||(this.#n=(this.#n|Cr)&sc,this.#A())}#A(){let e=this.children();e.provisional=0;for(let n of e)n.#L()}#C(){this.#n|=ip,this.#N()}#N(){if(this.#n&uc)return;let e=this.#n;(e&cr)===Zr&&(e&=sc),this.#n=e|uc,this.#A()}#q(e=""){e==="ENOTDIR"||e==="EPERM"?this.#N():e==="ENOENT"?this.#L():this.children().provisional=0}#j(e=""){e==="ENOTDIR"?this.parent.#N():e==="ENOENT"&&this.#L()}#l(e=""){let n=this.#n;n|=np,e==="ENOENT"&&(n|=Cr),(e==="EINVAL"||e==="UNKNOWN")&&(n&=sc),this.#n=n,e==="ENOTDIR"&&this.parent&&this.parent.#N()}#F(e,n){return this.#P(e,n)||this.#$(e,n)}#$(e,n){let r=$S(e),i=this.newChild(e.name,r,{parent:this}),s=i.#n&cr;return s!==Zr&&s!==Vs&&s!==lr&&(i.#n|=uc),n.unshift(i),n.provisional++,i}#P(e,n){for(let r=n.provisional;r<n.length;r++){let i=n[r];if((this.nocase?rp(e.name):cc(e.name))===i.#_)return this.#B(e,i,r,n)}}#B(e,n,r,i){let s=n.name;return n.#n=n.#n&sc|$S(e),s!==e.name&&(n.name=e.name),r!==i.provisional&&(r===i.length-1?i.pop():i.splice(r,1),i.unshift(n)),i.provisional++,n}async lstat(){if(!(this.#n&Cr))try{return this.#G(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#j(e.code)}}lstatSync(){if(!(this.#n&Cr))try{return this.#G(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#j(e.code)}}#G(e){let{atime:n,atimeMs:r,birthtime:i,birthtimeMs:s,blksize:o,blocks:a,ctime:u,ctimeMs:c,dev:l,gid:h,ino:d,mode:g,mtime:y,mtimeMs:_,nlink:C,rdev:k,size:T,uid:w}=e;this.#T=n,this.#m=r,this.#x=i,this.#d=s,this.#h=o,this.#i=a,this.#E=u,this.#f=c,this.#t=l,this.#v=h,this.#a=d,this.#s=g,this.#g=y,this.#y=_,this.#r=C,this.#c=k,this.#u=T,this.#o=w;let v=$S(e);this.#n=this.#n&sc|v|jR,v!==lr&&v!==Zr&&v!==Vs&&(this.#n|=uc)}#W=[];#H=!1;#z(e){this.#H=!1;let n=this.#W.slice();this.#W.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 s=r.slice(0,r.provisional);n?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#W.push(e),this.#H)return;this.#H=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(s,o)=>{if(s)this.#q(s.code),r.provisional=0;else{for(let a of o)this.#F(a,r);this.#M(r)}this.#z(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(i=>r=i);try{for(let i of await this.#e.promises.readdir(n,{withFileTypes:!0}))this.#F(i,e);this.#M(e)}catch(i){this.#q(i.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.#F(r,e);this.#M(e)}catch(r){this.#q(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#n&FR)return!1;let e=cr&this.#n;return e===lr||e===Zr||e===Vs}shouldWalk(e,n){return(this.#n&Zr)===Zr&&!(this.#n&FR)&&!e.has(this)&&(!n||n(this))}async realpath(){if(this.#R)return this.#R;if(!((ip|np|Cr)&this.#n))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#R=this.resolve(e)}catch{this.#C()}}realpathSync(){if(this.#R)return this.#R;if(!((ip|np|Cr)&this.#n))try{let e=this.#e.realpathSync(this.fullpath());return this.#R=this.resolve(e)}catch{this.#C()}}[YR](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let n=new Set([]),r=[],i=this;for(;i&&i.parent;)n.add(i),i.#O=r.join(this.sep),i.#k=r.join("/"),i=i.parent,r.push("..");for(i=e;i&&i.parent&&!n.has(i);)i.#O=void 0,i.#k=void 0,i=i.parent}};Fe.PathBase=Yt;var hc=class t extends Yt{sep="\\";splitSep=M5;constructor(e,n=lr,r,i,s,o,a){super(e,n,r,i,s,o,a)}newChild(e,n=lr,r={}){return new t(e,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return sp.win32.parse(e).root}getRoot(e){if(e=I5(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 pc(e,this).root}sameRoot(e,n=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(HR,"$1\\"),e===n}};Fe.PathWin32=hc;var dc=class t extends Yt{splitSep="/";sep="/";constructor(e,n=lr,r,i,s,o,a){super(e,n,r,i,s,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,n=lr,r={}){return new t(e,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}};Fe.PathPosix=dc;var fc=class{root;rootPath;roots;cwd;#e;#t;#s;nocase;#r;constructor(e=process.cwd(),n,r,{nocase:i,childrenCacheSize:s=16*1024,fs:o=ac}={}){this.#r=WR(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,R5.fileURLToPath)(e));let a=n.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new lc,this.#t=new lc,this.#s=new op(s);let u=a.substring(this.rootPath.length).split(r);if(u.length===1&&!u[0]&&u.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let c=this.root,l=u.length-1,h=n.sep,d=this.rootPath,g=!1;for(let y of u){let _=l--;c=c.child(y,{relative:new Array(_).fill("..").join(h),relativePosix:new Array(_).fill("..").join("/"),fullpath:d+=(g?"":h)+y}),g=!0}this.cwd=c}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 s=e.length-1;s>=0;s--){let o=e[s];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 i=this.cwd.resolve(n).fullpath();return this.#e.set(n,i),i}resolvePosix(...e){let n="";for(let s=e.length-1;s>=0;s--){let o=e[s];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 i=this.cwd.resolve(n).fullpathPosix();return this.#t.set(n,i),i}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 Yt||(n=e,e=this.cwd);let{withFileTypes:r}=n;if(e.canReaddir()){let i=await e.readdir();return r?i:i.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,n={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Yt||(n=e,e=this.cwd);let{withFileTypes:r=!0}=n;return e.canReaddir()?r?e.readdirSync():e.readdirSync().map(i=>i.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 Yt||(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 Yt||(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 Yt||(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 Yt||(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 Yt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=[];(!s||s(e))&&a.push(r?e:e.fullpath());let u=new Set,c=(h,d)=>{u.add(h),h.readdirCB((g,y)=>{if(g)return d(g);let _=y.length;if(!_)return d();let C=()=>{--_===0&&d()};for(let k of y)(!s||s(k))&&a.push(r?k:k.fullpath()),i&&k.isSymbolicLink()?k.realpath().then(T=>T?.isUnknown()?T.lstat():T).then(T=>T?.shouldWalk(u,o)?c(T,C):C()):k.shouldWalk(u,o)?c(k,C):C()},!0)},l=e;return new Promise((h,d)=>{c(l,g=>{if(g)return d(g);h(a)})})}walkSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Yt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=[];(!s||s(e))&&a.push(r?e:e.fullpath());let u=new Set([e]);for(let c of u){let l=c.readdirSync();for(let h of l){(!s||s(h))&&a.push(r?h:h.fullpath());let d=h;if(h.isSymbolicLink()){if(!(i&&(d=h.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(u,o)&&u.add(d)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,n={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof Yt||(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 Yt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n;(!s||s(e))&&(yield r?e:e.fullpath());let a=new Set([e]);for(let u of a){let c=u.readdirSync();for(let l of c){(!s||s(l))&&(yield r?l:l.fullpath());let h=l;if(l.isSymbolicLink()){if(!(i&&(h=l.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(a,o)&&a.add(h)}}}stream(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Yt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=new qR.Minipass({objectMode:!0});(!s||s(e))&&a.write(r?e:e.fullpath());let u=new Set,c=[e],l=0,h=()=>{let d=!1;for(;!d;){let g=c.shift();if(!g){l===0&&a.end();return}l++,u.add(g);let y=(C,k,T=!1)=>{if(C)return a.emit("error",C);if(i&&!T){let w=[];for(let v of k)v.isSymbolicLink()&&w.push(v.realpath().then(L=>L?.isUnknown()?L.lstat():L));if(w.length){Promise.all(w).then(()=>y(null,k,!0));return}}for(let w of k)w&&(!s||s(w))&&(a.write(r?w:w.fullpath())||(d=!0));l--;for(let w of k){let v=w.realpathCached()||w;v.shouldWalk(u,o)&&c.push(v)}d&&!a.flowing?a.once("drain",h):_||h()},_=!0;g.readdirCB(y,!0),_=!1}};return h(),a}streamSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Yt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=new qR.Minipass({objectMode:!0}),u=new Set;(!s||s(e))&&a.write(r?e:e.fullpath());let c=[e],l=0,h=()=>{let d=!1;for(;!d;){let g=c.shift();if(!g){l===0&&a.end();return}l++,u.add(g);let y=g.readdirSync();for(let _ of y)(!s||s(_))&&(a.write(r?_:_.fullpath())||(d=!0));l--;for(let _ of y){let C=_;if(_.isSymbolicLink()){if(!(i&&(C=_.realpathSync())))continue;C.isUnknown()&&C.lstatSync()}C.shouldWalk(u,o)&&c.push(C)}}d&&!a.flowing&&a.once("drain",h)};return h(),a}chdir(e=this.cwd){let n=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[YR](n)}};Fe.PathScurryBase=fc;var pc=class extends fc{sep="\\";constructor(e=process.cwd(),n={}){let{nocase:r=!0}=n;super(e,sp.win32,"\\",{...n,nocase:r}),this.nocase=r;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return sp.win32.parse(e).root.toUpperCase()}newRoot(e){return new hc(this.rootPath,Zr,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}};Fe.PathScurryWin32=pc;var gc=class extends fc{sep="/";constructor(e=process.cwd(),n={}){let{nocase:r=!1}=n;super(e,sp.posix,"/",{...n,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new dc(this.rootPath,Zr,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}};Fe.PathScurryPosix=gc;var ap=class extends gc{constructor(e=process.cwd(),n={}){let{nocase:r=!0}=n;super(e,{...n,nocase:r})}};Fe.PathScurryDarwin=ap;Fe.Path=process.platform==="win32"?hc:dc;Fe.PathScurry=process.platform==="win32"?pc:process.platform==="darwin"?ap:gc});var US=m(up=>{"use strict";Object.defineProperty(up,"__esModule",{value:!0});up.Pattern=void 0;var N5=ts(),q5=t=>t.length>=1,j5=t=>t.length>=1,BS=class t{#e;#t;#s;length;#r;#o;#v;#c;#h;#a;#u=!0;constructor(e,n,r,i){if(!q5(e))throw new TypeError("empty pattern list");if(!j5(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.#r=i,this.#s===0){if(this.isUNC()){let[s,o,a,u,...c]=this.#e,[l,h,d,g,...y]=this.#t;c[0]===""&&(c.shift(),y.shift());let _=[s,o,a,u,""].join("/"),C=[l,h,d,g,""].join("/");this.#e=[_,...c],this.#t=[C,...y],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...o]=this.#e,[a,...u]=this.#t;o[0]===""&&(o.shift(),u.shift());let c=s+"/",l=a+"/";this.#e=[c,...o],this.#t=[l,...u],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]===N5.GLOBSTAR}isRegExp(){return this.#e[this.#s]instanceof RegExp}globString(){return this.#v=this.#v||(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.#r),this.#o.#a=this.#a,this.#o.#h=this.#h,this.#o.#c=this.#c,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#h!==void 0?this.#h:this.#h=this.#r==="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.#c!==void 0?this.#c:this.#c=this.#r==="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.#u)}markFollowGlobstar(){return this.#s===0||!this.isGlobstar()||!this.#u?!1:(this.#u=!1,!0)}};up.Pattern=BS});var HS=m(cp=>{"use strict";Object.defineProperty(cp,"__esModule",{value:!0});cp.Ignore=void 0;var QR=ts(),F5=US(),$5=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",WS=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:n,nocase:r,noext:i,noglobstar:s,platform:o=$5}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:n,nocase:r,noext:i,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let n=new QR.Minimatch(e,this.mmopts);for(let r=0;r<n.set.length;r++){let i=n.set[r],s=n.globParts[r];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let o=new F5.Pattern(i,s,0,this.platform),a=new QR.Minimatch(o.globString(),this.mmopts),u=s[s.length-1]==="**",c=o.isAbsolute();c?this.absolute.push(a):this.relative.push(a),u&&(c?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(e){let n=e.fullpath(),r=`${n}/`,i=e.relative()||".",s=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(s))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 i of this.relativeChildren)if(i.match(r))return!0;for(let i of this.absoluteChildren)if(i.match(n))return!0;return!1}};cp.Ignore=WS});var eP=m(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.Processor=ei.SubWalks=ei.MatchRecord=ei.HasWalkedCache=void 0;var ZR=ts(),lp=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(),i=this.store.get(r);i?i.add(n.globString()):this.store.set(r,new Set([n.globString()]))}};ei.HasWalkedCache=lp;var hp=class{store=new Map;add(e,n,r){let i=(n?2:0)|(r?1:0),s=this.store.get(e);this.store.set(e,s===void 0?i:i&s)}entries(){return[...this.store.entries()].map(([e,n])=>[e,!!(n&2),!!(n&1)])}};ei.MatchRecord=hp;var dp=class{store=new Map;add(e,n){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(i=>i.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())}};ei.SubWalks=dp;var GS=class t{hasWalkedCache;matches=new hp;subwalks=new dp;patterns;follow;dot;opts;constructor(e,n){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=n?n.copy():new lp}processPatterns(e,n){this.patterns=n;let r=n.map(i=>[e,i]);for(let[i,s]of r){this.hasWalkedCache.storeWalked(i,s);let o=s.root(),a=s.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let h=s.rest();if(h)s=h;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let u,c,l=!1;for(;typeof(u=s.pattern())=="string"&&(c=s.rest());)i=i.resolve(u),s=c,l=!0;if(u=s.pattern(),c=s.rest(),l){if(this.hasWalkedCache.hasWalked(i,s))continue;this.hasWalkedCache.storeWalked(i,s)}if(typeof u=="string"){let h=u===".."||u===""||u===".";this.matches.add(i.resolve(u),a,h);continue}else if(u===ZR.GLOBSTAR){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let h=c?.pattern(),d=c?.rest();if(!c||(h===""||h===".")&&!d)this.matches.add(i,a,h===""||h===".");else if(h===".."){let g=i.parent||i;d?this.hasWalkedCache.hasWalked(g,d)||this.subwalks.add(g,d):this.matches.add(g,a,!0)}}else u instanceof RegExp&&this.subwalks.add(i,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,n){let r=this.subwalks.get(e),i=this.child();for(let s of n)for(let o of r){let a=o.isAbsolute(),u=o.pattern(),c=o.rest();u===ZR.GLOBSTAR?i.testGlobstar(s,o,c,a):u instanceof RegExp?i.testRegExp(s,u,c,a):i.testString(s,u,c,a)}return i}testGlobstar(e,n,r,i){if((this.dot||!e.name.startsWith("."))&&(n.hasMore()||this.matches.add(e,i,!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 s=r.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,r.rest(),i);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,r)}else s instanceof RegExp&&this.testRegExp(e,s,r.rest(),i)}}testRegExp(e,n,r,i){n.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}testString(e,n,r,i){e.isNamed(n)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}};ei.Processor=GS});var rP=m(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.GlobStream=is.GlobWalker=is.GlobUtil=void 0;var B5=jS(),tP=HS(),nP=eP(),U5=(t,e)=>typeof t=="string"?new tP.Ignore([t],e):Array.isArray(t)?new tP.Ignore(t,e):t,mc=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=U5(r.ignore??[],r),!this.includeChildMatches&&typeof this.#t.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#r(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 s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=await s.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(s,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.#r(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 s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=s.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(s,n)}matchFinish(e,n){if(this.#r(e))return;if(!this.includeChildMatches&&this.#t?.add){let s=`${e.relativePosix()}/**`;this.#t.add(s)}let r=this.opts.absolute===void 0?n:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#s:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(r){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+i)}else{let s=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!s.startsWith(".."+this.#s)?"."+this.#s:"";this.matchEmit(s?o+s+i:"."+i)}}async match(e,n,r){let i=await this.matchCheck(e,r);i&&this.matchFinish(i,n)}matchSync(e,n,r){let i=this.matchCheckSync(e,r);i&&this.matchFinish(i,n)}walkCB(e,n,r){this.signal?.aborted&&r(),this.walkCB2(e,n,new nP.Processor(this.opts),r)}walkCB2(e,n,r,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,n,r,i));return}r.processPatterns(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of r.matches.entries())this.#r(a)||(s++,this.match(a,u,c).then(()=>o()));for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let u=a.readdirCached();a.calledReaddir()?this.walkCB3(a,u,r,o):a.readdirCB((c,l)=>this.walkCB3(a,l,r,o),!0)}o()}walkCB3(e,n,r,i){r=r.filterEntries(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of r.matches.entries())this.#r(a)||(s++,this.match(a,u,c).then(()=>o()));for(let[a,u]of r.subwalks.entries())s++,this.walkCB2(a,u,r.child(),o);o()}walkCBSync(e,n,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,n,new nP.Processor(this.opts),r)}walkCB2Sync(e,n,r,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,n,r,i));return}r.processPatterns(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of r.matches.entries())this.#r(a)||this.matchSync(a,u,c);for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let u=a.readdirSync();this.walkCB3Sync(a,u,r,o)}o()}walkCB3Sync(e,n,r,i){r=r.filterEntries(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of r.matches.entries())this.#r(a)||this.matchSync(a,u,c);for(let[a,u]of r.subwalks.entries())s++,this.walkCB2Sync(a,u,r.child(),o);o()}};is.GlobUtil=mc;var zS=class extends mc{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}};is.GlobWalker=zS;var KS=class extends mc{results;constructor(e,n,r){super(e,n,r),this.results=new B5.Minipass({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}};is.GlobStream=KS});var XS=m(gp=>{"use strict";Object.defineProperty(gp,"__esModule",{value:!0});gp.Glob=void 0;var W5=ts(),H5=require("node:url"),fp=JR(),G5=US(),pp=rP(),z5=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",VS=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,H5.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(u=>u.replace(/\\/g,"/"))),this.matchBase){if(n.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(u=>u.includes("/")?u:`./**/${u}`)}if(this.pattern=e,this.platform=n.platform||z5,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 u=n.platform==="win32"?fp.PathScurryWin32:n.platform==="darwin"?fp.PathScurryDarwin:n.platform?fp.PathScurryPosix:fp.PathScurry;this.scurry=new u(this.cwd,{nocase:n.nocase,fs:n.fs})}this.nocase=this.scurry.nocase;let r=this.platform==="darwin"||this.platform==="win32",i={...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},s=this.pattern.map(u=>new W5.Minimatch(u,i)),[o,a]=s.reduce((u,c)=>(u[0].push(...c.set),u[1].push(...c.globParts),u),[[],[]]);this.patterns=o.map((u,c)=>{let l=a[c];if(!l)throw new Error("invalid pattern object");return new G5.Pattern(u,l,0,this.platform)})}async walk(){return[...await new pp.GlobWalker(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 pp.GlobWalker(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 pp.GlobStream(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 pp.GlobStream(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()}};gp.Glob=VS});var YS=m(mp=>{"use strict";Object.defineProperty(mp,"__esModule",{value:!0});mp.hasMagic=void 0;var K5=ts(),V5=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let n of t)if(new K5.Minimatch(n,e).hasMagic())return!0;return!1};mp.hasMagic=V5});var aP=m(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.glob=Ee.sync=Ee.iterate=Ee.iterateSync=Ee.stream=Ee.streamSync=Ee.Ignore=Ee.hasMagic=Ee.Glob=Ee.unescape=Ee.escape=void 0;Ee.globStreamSync=yc;Ee.globStream=JS;Ee.globSync=QS;Ee.globIterateSync=bc;Ee.globIterate=ZS;var iP=ts(),Xs=XS(),X5=YS(),oP=ts();Object.defineProperty(Ee,"escape",{enumerable:!0,get:function(){return oP.escape}});Object.defineProperty(Ee,"unescape",{enumerable:!0,get:function(){return oP.unescape}});var Y5=XS();Object.defineProperty(Ee,"Glob",{enumerable:!0,get:function(){return Y5.Glob}});var J5=YS();Object.defineProperty(Ee,"hasMagic",{enumerable:!0,get:function(){return J5.hasMagic}});var Q5=HS();Object.defineProperty(Ee,"Ignore",{enumerable:!0,get:function(){return Q5.Ignore}});function yc(t,e={}){return new Xs.Glob(t,e).streamSync()}function JS(t,e={}){return new Xs.Glob(t,e).stream()}function QS(t,e={}){return new Xs.Glob(t,e).walkSync()}async function sP(t,e={}){return new Xs.Glob(t,e).walk()}function bc(t,e={}){return new Xs.Glob(t,e).iterateSync()}function ZS(t,e={}){return new Xs.Glob(t,e).iterate()}Ee.streamSync=yc;Ee.stream=Object.assign(JS,{sync:yc});Ee.iterateSync=bc;Ee.iterate=Object.assign(ZS,{sync:bc});Ee.sync=Object.assign(QS,{stream:yc,iterate:bc});Ee.glob=Object.assign(sP,{glob:sP,globSync:QS,sync:Ee.sync,globStream:JS,stream:Ee.stream,globStreamSync:yc,streamSync:Ee.streamSync,globIterate:ZS,iterate:Ee.iterate,globIterateSync:bc,iterateSync:Ee.iterateSync,Glob:Xs.Glob,hasMagic:X5.hasMagic,escape:iP.escape,unescape:iP.unescape});Ee.glob.glob=Ee.glob});var cP=m(wa=>{"use strict";var tw=wa&&wa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(wa,"__esModule",{value:!0});wa.FileSystem=void 0;var Z5=_m(),uP=(tR(),_P(eR)),eH=tw(require("events")),yp=mf(),tH=tw(require("fs")),nH=Lf(),rH=tw(Of()),iH=aP(),ew=class extends eH.default{constructor(e){super(),this._context=e,this._textDocumentManager=new Z5.TextDocuments(uP.TextDocument),this._tempTextDocumentCache=new rH.default({ttl:1e3,max:100})}async getWorkspaceFolderUris(){if(!this._context.features.workspaceFolder)return[];if(this._workspace==null)return[];let e=await this._workspace.getWorkspaceFolders();return e==null?[]:Array.from(new Set(e.map(n=>n.uri))).map(n=>yp.URI.parse(n))}async getWorkspaceFolderUri(e){return(await this.getWorkspaceFolderUris()).find(r=>e.path.startsWith(r.path))||null}async getWorkspaceRelatedFiles(){let e=this._context.getConfiguration(),n=e.fileExtensions,r=e.typeAnalyzer.exclude,i=await this.getWorkspaceFolderUris();return(await Promise.all(i.flatMap(async o=>(0,iH.glob)(n.map(a=>`**/*.${a}`),{cwd:o.fsPath,absolute:!0,ignore:r})))).flat().map(o=>yp.URI.file(o))}async findExistingPath(...e){if(e.length===0)return null;for(let n=0;n<e.length;n++)if(await this.getTextDocument(e[n])!=null)return e[n];return null}getAllTextDocuments(){return this._textDocumentManager.all()}async fetchTextDocument(e){let n=yp.URI.parse(e),r=this._tempTextDocumentCache.get(e);if(r!=null)return r;let i=null;try{let s=await tH.default.promises.readFile(n.fsPath,{encoding:"utf-8"});i=uP.TextDocument.create(e,nH.LanguageId,0,s)}catch{}return this._tempTextDocumentCache.set(e,i),i}async getTextDocument(e){let n=this._textDocumentManager.get(e);return n||(yp.URI.parse(e).scheme=="file"?await this.fetchTextDocument(e):null)}async readFile(e){return(await this.getTextDocument(e)).getText()}listen(e){this._workspace=e.workspace,this._textDocumentManager.listen(e),this._textDocumentManager.onDidOpen(n=>{this.emit("text-document-open",n.document)}),this._textDocumentManager.onDidChangeContent(n=>{this.emit("text-document-change",n.document)}),this._textDocumentManager.onDidClose(n=>{this.emit("text-document-close",n.document)})}};wa.FileSystem=ew});var lP=m(bp=>{"use strict";Object.defineProperty(bp,"__esModule",{value:!0});bp.NodeContext=void 0;var nw=_m(),rw=Lf(),sH=cP(),iw=class extends rw.CoreContext{constructor(){super(),this.documentManager=new rw.DocumentManager().setContext(this),this.documentMerger=new rw.DocumentMerger,this.connection=(0,nw.createConnection)(nw.ProposedFeatures.all),this.fs=new sH.FileSystem(this)}createSemanticTokensBuilder(){return new nw.SemanticTokensBuilder}};bp.NodeContext=iw});Object.defineProperty(exports,"__esModule",{value:!0});var oH=lP(),Or=Lf(),hP=new oH.NodeContext;hP.on("ready",t=>{(0,Or.activateAutocomplete)(t),(0,Or.activateColor)(t),(0,Or.activateDefinition)(t),(0,Or.activateDiagnostic)(t),(0,Or.activateFormatter)(t),(0,Or.activateHover)(t),(0,Or.activateSignature)(t),(0,Or.activateSubscriptions)(t),(0,Or.activateSymbol)(t),(0,Or.activateSemantic)(t),(0,Or.activateFoldingRange)(t)});hP.listen();
153
+ >>> no match, partial?`,e,d,n,g),d===u))}let _;if(typeof l=="string"?(_=h===l,this.debug("string match",l,h,_)):(_=l.test(h),this.debug("pattern match",l,h,_)),!_)return!1}if(o===u&&a===c)return!0;if(o===u)return r;if(a===c)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return(0,te.braceExpand)(this.pattern,this.options)}parse(e){(0,Zf.assertValidPattern)(e);let n=this.options;if(e==="**")return te.GLOBSTAR;if(e==="")return"";let r,i=null;(r=e.match(_5))?i=n.dot?S5:v5:(r=e.match(c5))?i=(n.nocase?n.dot?f5:d5:n.dot?h5:l5)(r[1]):(r=e.match(w5))?i=(n.nocase?n.dot?E5:T5:n.dot?x5:k5)(r):(r=e.match(p5))?i=n.dot?m5:g5:(r=e.match(y5))&&(i=b5);let s=qR.AST.fromGlob(e,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}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?C5:n.dot?O5:R5,i=new Set(n.nocase?["i"]:[]),s=e.map(u=>{let c=u.map(l=>{if(l instanceof RegExp)for(let h of l.flags.split(""))i.add(h);return typeof l=="string"?N5(l):l===te.GLOBSTAR?te.GLOBSTAR:l._src});return c.forEach((l,h)=>{let d=c[h+1],g=c[h-1];l!==te.GLOBSTAR||g===te.GLOBSTAR||(g===void 0?d!==void 0&&d!==te.GLOBSTAR?c[h+1]="(?:\\/|"+r+"\\/)?"+d:c[h]=r:d===void 0?c[h-1]=g+"(?:\\/|"+r+")?":d!==te.GLOBSTAR&&(c[h-1]=g+"(?:\\/|\\/"+r+"\\/)"+d,c[h+1]=te.GLOBSTAR))}),c.filter(l=>l!==te.GLOBSTAR).join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+a+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].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 i=this.slashSplit(e);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let a=i.length-2;!o&&a>=0;a--)o=i[a];for(let a=0;a<s.length;a++){let u=s[a],c=i;if(r.matchBase&&u.length===1&&(c=[o]),this.matchOne(c,u,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return te.minimatch.defaults(e).Minimatch}};te.Minimatch=Xs;var q5=FS();Object.defineProperty(te,"AST",{enumerable:!0,get:function(){return q5.AST}});var j5=$S();Object.defineProperty(te,"escape",{enumerable:!0,get:function(){return j5.escape}});var F5=Vf();Object.defineProperty(te,"unescape",{enumerable:!0,get:function(){return F5.unescape}});te.minimatch.AST=qR.AST;te.minimatch.Minimatch=Xs;te.minimatch.escape=o5.escape;te.minimatch.unescape=a5.unescape});var GR=m(tp=>{"use strict";Object.defineProperty(tp,"__esModule",{value:!0});tp.LRUCache=void 0;var _a=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,WR=new Set,BS=typeof process=="object"&&process?process:{},UR=(t,e,n,r)=>{typeof BS.emitWarning=="function"?BS.emitWarning(t,e,n,r):console.error(`[${n}] ${e}: ${t}`)},ep=globalThis.AbortController,BR=globalThis.AbortSignal;if(typeof ep>"u"){BR=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(r,i){this._onabort.push(i)}},ep=class{constructor(){e()}signal=new BR;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let i of this.signal._onabort)i(r);this.signal.onabort?.(r)}}};let t=BS.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,UR("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 $5=t=>!WR.has(t),b6=Symbol("type"),as=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),HR=t=>as(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?va:null:null,va=class extends Array{constructor(e){super(e),this.fill(0)}},WS=class t{heap;length;static#e=!1;static create(e){let n=HR(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]}},US=class t{#e;#t;#s;#r;#o;#v;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#c;#h;#a;#u;#i;#m;#y;#f;#d;#T;#g;#E;#x;#_;#S;#w;#p;static unsafeExposeInternals(e){return{starts:e.#x,ttls:e.#_,sizes:e.#E,keyMap:e.#a,keyList:e.#u,valList:e.#i,next:e.#m,prev:e.#y,get head(){return e.#f},get tail(){return e.#d},free:e.#T,isBackgroundFetch:n=>e.#l(n),backgroundFetch:(n,r,i,s)=>e.#j(n,r,i,s),moveToTail:n=>e.#$(n),indexes:n=>e.#A(n),rindexes:n=>e.#C(n),isStale:n=>e.#b(n)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#h}get size(){return this.#c}get fetchMethod(){return this.#o}get memoMethod(){return this.#v}get dispose(){return this.#s}get disposeAfter(){return this.#r}constructor(e){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:c,disposeAfter:l,noDisposeOnSet:h,noUpdateTTL:d,maxSize:g=0,maxEntrySize:y=0,sizeCalculation:_,fetchMethod:C,memoMethod:k,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:v,allowStaleOnFetchAbort:L,ignoreFetchAbort:R}=e;if(n!==0&&!as(n))throw new TypeError("max option must be a nonnegative integer");let W=n?HR(n):Array;if(!W)throw new Error("invalid max value: "+n);if(this.#e=n,this.#t=g,this.maxEntrySize=y||this.#t,this.sizeCalculation=_,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(k!==void 0&&typeof k!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#v=k,C!==void 0&&typeof C!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=C,this.#w=!!C,this.#a=new Map,this.#u=new Array(n).fill(void 0),this.#i=new Array(n).fill(void 0),this.#m=new W(n),this.#y=new W(n),this.#f=0,this.#d=0,this.#T=WS.create(n),this.#c=0,this.#h=0,typeof c=="function"&&(this.#s=c),typeof l=="function"?(this.#r=l,this.#g=[]):(this.#r=void 0,this.#g=void 0),this.#S=!!this.#s,this.#p=!!this.#r,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!T,this.allowStaleOnFetchRejection=!!v,this.allowStaleOnFetchAbort=!!L,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.#t!==0&&!as(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!as(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#R()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=as(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||0,this.ttl){if(!as(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#O()}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 ne="LRU_CACHE_UNBOUNDED";$5(ne)&&(WR.add(ne),UR("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ne,t))}}getRemainingTTL(e){return this.#a.has(e)?1/0:0}#O(){let e=new va(this.#e),n=new va(this.#e);this.#_=e,this.#x=n,this.#D=(s,o,a=_a.now())=>{if(n[s]=o!==0?a:0,e[s]=o,o!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#b(s)&&this.#P(this.#u[s],"expire")},o+1);u.unref&&u.unref()}},this.#k=s=>{n[s]=e[s]!==0?_a.now():0},this.#n=(s,o)=>{if(e[o]){let a=e[o],u=n[o];if(!a||!u)return;s.ttl=a,s.start=u,s.now=r||i();let c=s.now-u;s.remainingTTL=a-c}};let r=0,i=()=>{let s=_a.now();if(this.ttlResolution>0){r=s;let o=setTimeout(()=>r=0,this.ttlResolution);o.unref&&o.unref()}return s};this.getRemainingTTL=s=>{let o=this.#a.get(s);if(o===void 0)return 0;let a=e[o],u=n[o];if(!a||!u)return 1/0;let c=(r||i())-u;return a-c},this.#b=s=>{let o=n[s],a=e[s];return!!a&&!!o&&(r||i())-o>a}}#k=()=>{};#n=()=>{};#D=()=>{};#b=()=>!1;#R(){let e=new va(this.#e);this.#h=0,this.#E=e,this.#I=n=>{this.#h-=e[n],e[n]=0},this.#L=(n,r,i,s)=>{if(this.#l(r))return 0;if(!as(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(r,n),!as(i))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 i},this.#M=(n,r,i)=>{if(e[n]=r,this.#t){let s=this.#t-e[n];for(;this.#h>s;)this.#q(!0)}this.#h+=e[n],i&&(i.entrySize=r,i.totalCalculatedSize=this.#h)}}#I=e=>{};#M=(e,n,r)=>{};#L=(e,n,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:e=this.allowStale}={}){if(this.#c)for(let n=this.#d;!(!this.#N(n)||((e||!this.#b(n))&&(yield n),n===this.#f));)n=this.#y[n]}*#C({allowStale:e=this.allowStale}={}){if(this.#c)for(let n=this.#f;!(!this.#N(n)||((e||!this.#b(n))&&(yield n),n===this.#d));)n=this.#m[n]}#N(e){return e!==void 0&&this.#a.get(this.#u[e])===e}*entries(){for(let e of this.#A())this.#i[e]!==void 0&&this.#u[e]!==void 0&&!this.#l(this.#i[e])&&(yield[this.#u[e],this.#i[e]])}*rentries(){for(let e of this.#C())this.#i[e]!==void 0&&this.#u[e]!==void 0&&!this.#l(this.#i[e])&&(yield[this.#u[e],this.#i[e]])}*keys(){for(let e of this.#A()){let n=this.#u[e];n!==void 0&&!this.#l(this.#i[e])&&(yield n)}}*rkeys(){for(let e of this.#C()){let n=this.#u[e];n!==void 0&&!this.#l(this.#i[e])&&(yield n)}}*values(){for(let e of this.#A())this.#i[e]!==void 0&&!this.#l(this.#i[e])&&(yield this.#i[e])}*rvalues(){for(let e of this.#C())this.#i[e]!==void 0&&!this.#l(this.#i[e])&&(yield this.#i[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,n={}){for(let r of this.#A()){let i=this.#i[r],s=this.#l(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#u[r],this))return this.get(this.#u[r],n)}}forEach(e,n=this){for(let r of this.#A()){let i=this.#i[r],s=this.#l(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.#u[r],this)}}rforEach(e,n=this){for(let r of this.#C()){let i=this.#i[r],s=this.#l(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(n,s,this.#u[r],this)}}purgeStale(){let e=!1;for(let n of this.#C({allowStale:!0}))this.#b(n)&&(this.#P(this.#u[n],"expire"),e=!0);return e}info(e){let n=this.#a.get(e);if(n===void 0)return;let r=this.#i[n],i=this.#l(r)?r.__staleWhileFetching:r;if(i===void 0)return;let s={value:i};if(this.#_&&this.#x){let o=this.#_[n],a=this.#x[n];if(o&&a){let u=o-(_a.now()-a);s.ttl=u,s.start=Date.now()}}return this.#E&&(s.size=this.#E[n]),s}dump(){let e=[];for(let n of this.#A({allowStale:!0})){let r=this.#u[n],i=this.#i[n],s=this.#l(i)?i.__staleWhileFetching:i;if(s===void 0||r===void 0)continue;let o={value:s};if(this.#_&&this.#x){o.ttl=this.#_[n];let a=_a.now()-this.#x[n];o.start=Math.floor(Date.now()-a)}this.#E&&(o.size=this.#E[n]),e.unshift([r,o])}return e}load(e){this.clear();for(let[n,r]of e){if(r.start){let i=Date.now()-r.start;r.start=_a.now()-i}this.set(n,r.value,r)}}set(e,n,r={}){if(n===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:u}=r,{noUpdateTTL:c=this.noUpdateTTL}=r,l=this.#L(e,n,r.size||0,a);if(this.maxEntrySize&&l>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#P(e,"set"),this;let h=this.#c===0?void 0:this.#a.get(e);if(h===void 0)h=this.#c===0?this.#d:this.#T.length!==0?this.#T.pop():this.#c===this.#e?this.#q(!1):this.#c,this.#u[h]=e,this.#i[h]=n,this.#a.set(e,h),this.#m[this.#d]=h,this.#y[h]=this.#d,this.#d=h,this.#c++,this.#M(h,l,u),u&&(u.set="add"),c=!1;else{this.#$(h);let d=this.#i[h];if(n!==d){if(this.#w&&this.#l(d)){d.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=d;g!==void 0&&!o&&(this.#S&&this.#s?.(g,e,"set"),this.#p&&this.#g?.push([g,e,"set"]))}else o||(this.#S&&this.#s?.(d,e,"set"),this.#p&&this.#g?.push([d,e,"set"]));if(this.#I(h),this.#M(h,l,u),this.#i[h]=n,u){u.set="replace";let g=d&&this.#l(d)?d.__staleWhileFetching:d;g!==void 0&&(u.oldValue=g)}}else u&&(u.set="update")}if(i!==0&&!this.#_&&this.#O(),this.#_&&(c||this.#D(h,i,s),u&&this.#n(u,h)),!o&&this.#p&&this.#g){let d=this.#g,g;for(;g=d?.shift();)this.#r?.(...g)}return this}pop(){try{for(;this.#c;){let e=this.#i[this.#f];if(this.#q(!0),this.#l(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#p&&this.#g){let e=this.#g,n;for(;n=e?.shift();)this.#r?.(...n)}}}#q(e){let n=this.#f,r=this.#u[n],i=this.#i[n];return this.#w&&this.#l(i)?i.__abortController.abort(new Error("evicted")):(this.#S||this.#p)&&(this.#S&&this.#s?.(i,r,"evict"),this.#p&&this.#g?.push([i,r,"evict"])),this.#I(n),e&&(this.#u[n]=void 0,this.#i[n]=void 0,this.#T.push(n)),this.#c===1?(this.#f=this.#d=0,this.#T.length=0):this.#f=this.#m[n],this.#a.delete(r),this.#c--,n}has(e,n={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:i}=n,s=this.#a.get(e);if(s!==void 0){let o=this.#i[s];if(this.#l(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#b(s))i&&(i.has="stale",this.#n(i,s));else return r&&this.#k(s),i&&(i.has="hit",this.#n(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,n={}){let{allowStale:r=this.allowStale}=n,i=this.#a.get(e);if(i===void 0||!r&&this.#b(i))return;let s=this.#i[i];return this.#l(s)?s.__staleWhileFetching:s}#j(e,n,r,i){let s=n===void 0?void 0:this.#i[n];if(this.#l(s))return s;let o=new ep,{signal:a}=r;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:r,context:i},c=(_,C=!1)=>{let{aborted:k}=o.signal,T=r.ignoreFetchAbort&&_!==void 0;if(r.status&&(k&&!C?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,T&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),k&&!T&&!C)return h(o.signal.reason);let w=g;return this.#i[n]===g&&(_===void 0?w.__staleWhileFetching?this.#i[n]=w.__staleWhileFetching:this.#P(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,_,u.options))),_},l=_=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=_),h(_)),h=_=>{let{aborted:C}=o.signal,k=C&&r.allowStaleOnFetchAbort,T=k||r.allowStaleOnFetchRejection,w=T||r.noDeleteOnFetchRejection,v=g;if(this.#i[n]===g&&(!w||v.__staleWhileFetching===void 0?this.#P(e,"fetch"):k||(this.#i[n]=v.__staleWhileFetching)),T)return r.status&&v.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),v.__staleWhileFetching;if(v.__returned===v)throw _},d=(_,C)=>{let k=this.#o?.(e,s,u);k&&k instanceof Promise&&k.then(T=>_(T===void 0?void 0:T),C),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(_(void 0),r.allowStaleOnFetchAbort&&(_=T=>c(T,!0)))})};r.status&&(r.status.fetchDispatched=!0);let g=new Promise(d).then(c,l),y=Object.assign(g,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return n===void 0?(this.set(e,y,{...u.options,status:void 0}),n=this.#a.get(e)):this.#i[n]=y,y}#l(e){if(!this.#w)return!1;let n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof ep}async fetch(e,n={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:u=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:_,forceRefresh:C=!1,status:k,signal:T}=n;if(!this.#w)return k&&(k.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:k});let w={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:y,ignoreFetchAbort:g,status:k,signal:T},v=this.#a.get(e);if(v===void 0){k&&(k.fetch="miss");let L=this.#j(e,v,w,_);return L.__returned=L}else{let L=this.#i[v];if(this.#l(L)){let U=r&&L.__staleWhileFetching!==void 0;return k&&(k.fetch="inflight",U&&(k.returnedStale=!0)),U?L.__staleWhileFetching:L.__returned=L}let R=this.#b(v);if(!C&&!R)return k&&(k.fetch="hit"),this.#$(v),i&&this.#k(v),k&&this.#n(k,v),L;let W=this.#j(e,v,w,_),se=W.__staleWhileFetching!==void 0&&r;return k&&(k.fetch=R?"stale":"refresh",se&&R&&(k.returnedStale=!0)),se?W.__staleWhileFetching:W.__returned=W}}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.#v;if(!r)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:s,...o}=n,a=this.get(e,o);if(!s&&a!==void 0)return a;let u=r(e,a,{options:o,context:i});return this.set(e,u,o),u}get(e,n={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=n,a=this.#a.get(e);if(a!==void 0){let u=this.#i[a],c=this.#l(u);return o&&this.#n(o,a),this.#b(a)?(o&&(o.get="stale"),c?(o&&r&&u.__staleWhileFetching!==void 0&&(o.returnedStale=!0),r?u.__staleWhileFetching:void 0):(s||this.#P(e,"expire"),o&&r&&(o.returnedStale=!0),r?u:void 0)):(o&&(o.get="hit"),c?u.__staleWhileFetching:(this.#$(a),i&&this.#k(a),u))}else o&&(o.get="miss")}#F(e,n){this.#y[n]=e,this.#m[e]=n}#$(e){e!==this.#d&&(e===this.#f?this.#f=this.#m[e]:this.#F(this.#y[e],this.#m[e]),this.#F(this.#d,e),this.#d=e)}delete(e){return this.#P(e,"delete")}#P(e,n){let r=!1;if(this.#c!==0){let i=this.#a.get(e);if(i!==void 0)if(r=!0,this.#c===1)this.#B(n);else{this.#I(i);let s=this.#i[i];if(this.#l(s)?s.__abortController.abort(new Error("deleted")):(this.#S||this.#p)&&(this.#S&&this.#s?.(s,e,n),this.#p&&this.#g?.push([s,e,n])),this.#a.delete(e),this.#u[i]=void 0,this.#i[i]=void 0,i===this.#d)this.#d=this.#y[i];else if(i===this.#f)this.#f=this.#m[i];else{let o=this.#y[i];this.#m[o]=this.#m[i];let a=this.#m[i];this.#y[a]=this.#y[i]}this.#c--,this.#T.push(i)}}if(this.#p&&this.#g?.length){let i=this.#g,s;for(;s=i?.shift();)this.#r?.(...s)}return r}clear(){return this.#B("delete")}#B(e){for(let n of this.#C({allowStale:!0})){let r=this.#i[n];if(this.#l(r))r.__abortController.abort(new Error("deleted"));else{let i=this.#u[n];this.#S&&this.#s?.(r,i,e),this.#p&&this.#g?.push([r,i,e])}}if(this.#a.clear(),this.#i.fill(void 0),this.#u.fill(void 0),this.#_&&this.#x&&(this.#_.fill(0),this.#x.fill(0)),this.#E&&this.#E.fill(0),this.#f=0,this.#d=0,this.#T.length=0,this.#h=0,this.#c=0,this.#p&&this.#g){let n=this.#g,r;for(;r=n?.shift();)this.#r?.(...r)}}};tp.LRUCache=US});var JS=m(bn=>{"use strict";var B5=bn&&bn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(bn,"__esModule",{value:!0});bn.Minipass=bn.isWritable=bn.isReadable=bn.isStream=void 0;var zR=typeof process=="object"&&process?process:{stdout:null,stderr:null},YS=require("node:events"),YR=B5(require("node:stream")),W5=require("node:string_decoder"),U5=t=>!!t&&typeof t=="object"&&(t instanceof up||t instanceof YR.default||(0,bn.isReadable)(t)||(0,bn.isWritable)(t));bn.isStream=U5;var H5=t=>!!t&&typeof t=="object"&&t instanceof YS.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==YR.default.Writable.prototype.pipe;bn.isReadable=H5;var G5=t=>!!t&&typeof t=="object"&&t instanceof YS.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function";bn.isWritable=G5;var Ti=Symbol("EOF"),Ei=Symbol("maybeEmitEnd"),us=Symbol("emittedEnd"),np=Symbol("emittingEnd"),oc=Symbol("emittedError"),rp=Symbol("closed"),KR=Symbol("read"),ip=Symbol("flush"),VR=Symbol("flushChunk"),Or=Symbol("encoding"),Sa=Symbol("decoder"),Gt=Symbol("flowing"),ac=Symbol("paused"),wa=Symbol("resume"),zt=Symbol("buffer"),yn=Symbol("pipes"),Kt=Symbol("bufferLength"),HS=Symbol("bufferPush"),sp=Symbol("bufferShift"),cn=Symbol("objectMode"),kt=Symbol("destroyed"),GS=Symbol("error"),zS=Symbol("emitData"),XR=Symbol("emitEnd"),KS=Symbol("emitEnd2"),ei=Symbol("async"),VS=Symbol("abort"),op=Symbol("aborted"),uc=Symbol("signal"),Ys=Symbol("dataListeners"),Bn=Symbol("discarded"),cc=t=>Promise.resolve().then(t),z5=t=>t(),K5=t=>t==="end"||t==="finish"||t==="prefinish",V5=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,X5=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),ap=class{src;dest;opts;ondrain;constructor(e,n,r){this.src=e,this.dest=n,this.opts=r,this.ondrain=()=>e[wa](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},XS=class extends ap{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,n,r){super(e,n,r),this.proxyErrors=i=>n.emit("error",i),e.on("error",this.proxyErrors)}},Y5=t=>!!t.objectMode,J5=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",up=class extends YS.EventEmitter{[Gt]=!1;[ac]=!1;[yn]=[];[zt]=[];[cn];[Or];[ei];[Sa];[Ti]=!1;[us]=!1;[np]=!1;[rp]=!1;[oc]=null;[Kt]=0;[kt]=!1;[uc];[op]=!1;[Ys]=0;[Bn]=!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");Y5(n)?(this[cn]=!0,this[Or]=null):J5(n)?(this[Or]=n.encoding,this[cn]=!1):(this[cn]=!1,this[Or]=null),this[ei]=!!n.async,this[Sa]=this[Or]?new W5.StringDecoder(this[Or]):null,n&&n.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[zt]}),n&&n.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[yn]});let{signal:r}=n;r&&(this[uc]=r,r.aborted?this[VS]():r.addEventListener("abort",()=>this[VS]()))}get bufferLength(){return this[Kt]}get encoding(){return this[Or]}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[cn]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[ei]}set async(e){this[ei]=this[ei]||!!e}[VS](){this[op]=!0,this.emit("abort",this[uc]?.reason),this.destroy(this[uc]?.reason)}get aborted(){return this[op]}set aborted(e){}write(e,n,r){if(this[op])return!1;if(this[Ti])throw new Error("write after end");if(this[kt])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 i=this[ei]?cc:z5;if(!this[cn]&&!Buffer.isBuffer(e)){if(X5(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(V5(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[cn]?(this[Gt]&&this[Kt]!==0&&this[ip](!0),this[Gt]?this.emit("data",e):this[HS](e),this[Kt]!==0&&this.emit("readable"),r&&i(r),this[Gt]):e.length?(typeof e=="string"&&!(n===this[Or]&&!this[Sa]?.lastNeed)&&(e=Buffer.from(e,n)),Buffer.isBuffer(e)&&this[Or]&&(e=this[Sa].write(e)),this[Gt]&&this[Kt]!==0&&this[ip](!0),this[Gt]?this.emit("data",e):this[HS](e),this[Kt]!==0&&this.emit("readable"),r&&i(r),this[Gt]):(this[Kt]!==0&&this.emit("readable"),r&&i(r),this[Gt])}read(e){if(this[kt])return null;if(this[Bn]=!1,this[Kt]===0||e===0||e&&e>this[Kt])return this[Ei](),null;this[cn]&&(e=null),this[zt].length>1&&!this[cn]&&(this[zt]=[this[Or]?this[zt].join(""):Buffer.concat(this[zt],this[Kt])]);let n=this[KR](e||null,this[zt][0]);return this[Ei](),n}[KR](e,n){if(this[cn])this[sp]();else{let r=n;e===r.length||e===null?this[sp]():typeof r=="string"?(this[zt][0]=r.slice(e),n=r.slice(0,e),this[Kt]-=e):(this[zt][0]=r.subarray(e),n=r.subarray(0,e),this[Kt]-=e)}return this.emit("data",n),!this[zt].length&&!this[Ti]&&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[Ti]=!0,this.writable=!1,(this[Gt]||!this[ac])&&this[Ei](),this}[wa](){this[kt]||(!this[Ys]&&!this[yn].length&&(this[Bn]=!0),this[ac]=!1,this[Gt]=!0,this.emit("resume"),this[zt].length?this[ip]():this[Ti]?this[Ei]():this.emit("drain"))}resume(){return this[wa]()}pause(){this[Gt]=!1,this[ac]=!0,this[Bn]=!1}get destroyed(){return this[kt]}get flowing(){return this[Gt]}get paused(){return this[ac]}[HS](e){this[cn]?this[Kt]+=1:this[Kt]+=e.length,this[zt].push(e)}[sp](){return this[cn]?this[Kt]-=1:this[Kt]-=this[zt][0].length,this[zt].shift()}[ip](e=!1){do;while(this[VR](this[sp]())&&this[zt].length);!e&&!this[zt].length&&!this[Ti]&&this.emit("drain")}[VR](e){return this.emit("data",e),this[Gt]}pipe(e,n){if(this[kt])return e;this[Bn]=!1;let r=this[us];return n=n||{},e===zR.stdout||e===zR.stderr?n.end=!1:n.end=n.end!==!1,n.proxyErrors=!!n.proxyErrors,r?n.end&&e.end():(this[yn].push(n.proxyErrors?new XS(this,e,n):new ap(this,e,n)),this[ei]?cc(()=>this[wa]()):this[wa]()),e}unpipe(e){let n=this[yn].find(r=>r.dest===e);n&&(this[yn].length===1?(this[Gt]&&this[Ys]===0&&(this[Gt]=!1),this[yn]=[]):this[yn].splice(this[yn].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[Bn]=!1,this[Ys]++,!this[yn].length&&!this[Gt]&&this[wa]();else if(e==="readable"&&this[Kt]!==0)super.emit("readable");else if(K5(e)&&this[us])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[oc]){let i=n;this[ei]?cc(()=>i.call(this,this[oc])):i.call(this,this[oc])}return r}removeListener(e,n){return this.off(e,n)}off(e,n){let r=super.off(e,n);return e==="data"&&(this[Ys]=this.listeners("data").length,this[Ys]===0&&!this[Bn]&&!this[yn].length&&(this[Gt]=!1)),r}removeAllListeners(e){let n=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Ys]=0,!this[Bn]&&!this[yn].length&&(this[Gt]=!1)),n}get emittedEnd(){return this[us]}[Ei](){!this[np]&&!this[us]&&!this[kt]&&this[zt].length===0&&this[Ti]&&(this[np]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[rp]&&this.emit("close"),this[np]=!1)}emit(e,...n){let r=n[0];if(e!=="error"&&e!=="close"&&e!==kt&&this[kt])return!1;if(e==="data")return!this[cn]&&!r?!1:this[ei]?(cc(()=>this[zS](r)),!0):this[zS](r);if(e==="end")return this[XR]();if(e==="close"){if(this[rp]=!0,!this[us]&&!this[kt])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[oc]=r,super.emit(GS,r);let s=!this[uc]||this.listeners("error").length?super.emit("error",r):!1;return this[Ei](),s}else if(e==="resume"){let s=super.emit("resume");return this[Ei](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let i=super.emit(e,...n);return this[Ei](),i}[zS](e){for(let r of this[yn])r.dest.write(e)===!1&&this.pause();let n=this[Bn]?!1:super.emit("data",e);return this[Ei](),n}[XR](){return this[us]?!1:(this[us]=!0,this.readable=!1,this[ei]?(cc(()=>this[KS]()),!0):this[KS]())}[KS](){if(this[Sa]){let n=this[Sa].end();if(n){for(let r of this[yn])r.dest.write(n);this[Bn]||super.emit("data",n)}}for(let n of this[yn])n.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[cn]||(e.dataLength=0);let n=this.promise();return this.on("data",r=>{e.push(r),this[cn]||(e.dataLength+=r.length)}),await n,e}async concat(){if(this[cn])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Or]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,n)=>{this.on(kt,()=>n(new Error("stream destroyed"))),this.on("error",r=>n(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Bn]=!1;let e=!1,n=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return n();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[Ti])return n();let s,o,a=h=>{this.off("data",u),this.off("end",c),this.off(kt,l),n(),o(h)},u=h=>{this.off("error",a),this.off("end",c),this.off(kt,l),this.pause(),s({value:h,done:!!this[Ti]})},c=()=>{this.off("error",a),this.off("data",u),this.off(kt,l),n(),s({done:!0,value:void 0})},l=()=>a(new Error("stream destroyed"));return new Promise((h,d)=>{o=d,s=h,this.once(kt,l),this.once("error",a),this.once("end",c),this.once("data",u)})},throw:n,return:n,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Bn]=!1;let e=!1,n=()=>(this.pause(),this.off(GS,n),this.off(kt,n),this.off("end",n),e=!0,{done:!0,value:void 0}),r=()=>{if(e)return n();let i=this.read();return i===null?n():{done:!1,value:i}};return this.once("end",n),this.once(GS,n),this.once(kt,n),{next:r,throw:n,return:n,[Symbol.iterator](){return this}}}destroy(e){if(this[kt])return e?this.emit("error",e):this.emit(kt),this;this[kt]=!0,this[Bn]=!0,this[zt].length=0,this[Kt]=0;let n=this;return typeof n.close=="function"&&!this[rp]&&n.close(),e?this.emit("error",e):this.emit(kt),this}static get isStream(){return bn.isStream}};bn.Minipass=up});var hP=m(Fe=>{"use strict";var Q5=Fe&&Fe.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Z5=Fe&&Fe.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),eH=Fe&&Fe.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Q5(e,t,n);return Z5(e,t),e};Object.defineProperty(Fe,"__esModule",{value:!0});Fe.PathScurry=Fe.Path=Fe.PathScurryDarwin=Fe.PathScurryPosix=Fe.PathScurryWin32=Fe.PathScurryBase=Fe.PathPosix=Fe.PathWin32=Fe.PathBase=Fe.ChildrenCache=Fe.ResolveCache=void 0;var nP=GR(),fp=require("node:path"),tH=require("node:url"),hc=require("fs"),nH=eH(require("node:fs")),rH=hc.realpathSync.native,cp=require("node:fs/promises"),JR=JS(),dc={lstatSync:hc.lstatSync,readdir:hc.readdir,readdirSync:hc.readdirSync,readlinkSync:hc.readlinkSync,realpathSync:rH,promises:{lstat:cp.lstat,readdir:cp.readdir,readlink:cp.readlink,realpath:cp.realpath}},rP=t=>!t||t===dc||t===nH?dc:{...dc,...t,promises:{...dc.promises,...t.promises||{}}},iP=/^\\\\\?\\([a-z]:)\\?$/i,iH=t=>t.replace(/\//g,"\\").replace(iP,"$1\\"),sH=/[\\\/]/,dr=0,sP=1,oP=2,ti=4,aP=6,uP=8,Js=10,cP=12,hr=15,lc=~hr,QS=16,QR=32,fc=64,Rr=128,lp=256,dp=512,ZR=fc|Rr|dp,oH=1023,ZS=t=>t.isFile()?uP:t.isDirectory()?ti:t.isSymbolicLink()?Js:t.isCharacterDevice()?oP:t.isBlockDevice()?aP:t.isSocket()?cP:t.isFIFO()?sP:dr,eP=new Map,pc=t=>{let e=eP.get(t);if(e)return e;let n=t.normalize("NFKD");return eP.set(t,n),n},tP=new Map,hp=t=>{let e=tP.get(t);if(e)return e;let n=pc(t.toLowerCase());return tP.set(t,n),n},gc=class extends nP.LRUCache{constructor(){super({max:256})}};Fe.ResolveCache=gc;var pp=class extends nP.LRUCache{constructor(e=16*1024){super({maxSize:e,sizeCalculation:n=>n.length+1})}};Fe.ChildrenCache=pp;var lP=Symbol("PathScurry setAsCwd"),Qt=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#s;get mode(){return this.#s}#r;get nlink(){return this.#r}#o;get uid(){return this.#o}#v;get gid(){return this.#v}#c;get rdev(){return this.#c}#h;get blksize(){return this.#h}#a;get ino(){return this.#a}#u;get size(){return this.#u}#i;get blocks(){return this.#i}#m;get atimeMs(){return this.#m}#y;get mtimeMs(){return this.#y}#f;get ctimeMs(){return this.#f}#d;get birthtimeMs(){return this.#d}#T;get atime(){return this.#T}#g;get mtime(){return this.#g}#E;get ctime(){return this.#E}#x;get birthtime(){return this.#x}#_;#S;#w;#p;#O;#k;#n;#D;#b;#R;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,n=dr,r,i,s,o,a){this.name=e,this.#_=s?hp(e):pc(e),this.#n=n&oH,this.nocase=s,this.roots=i,this.root=r||this,this.#D=o,this.#w=a.fullpath,this.#O=a.relative,this.#k=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=rP(a.fs)}depth(){return this.#S!==void 0?this.#S:this.parent?this.#S=this.parent.depth()+1:this.#S=0}childrenCache(){return this.#D}resolve(e){if(!e)return this;let n=this.getRootString(e),i=e.substring(n.length).split(this.splitSep);return n?this.getRoot(n).#I(i):this.#I(i)}#I(e){let n=this;for(let r of e)n=n.child(r);return n}children(){let e=this.#D.get(this);if(e)return e;let n=Object.assign([],{provisional:0});return this.#D.set(this,n),this.#n&=~QS,n}child(e,n){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),i=this.nocase?hp(e):pc(e);for(let u of r)if(u.#_===i)return u;let s=this.parent?this.sep:"",o=this.#w?this.#w+s+e:void 0,a=this.newChild(e,dr,{...n,parent:this,fullpath:o});return this.canReaddir()||(a.#n|=Rr),r.push(a),a}relative(){if(this.isCWD)return"";if(this.#O!==void 0)return this.#O;let e=this.name,n=this.parent;if(!n)return this.#O=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.#k!==void 0)return this.#k;let e=this.name,n=this.parent;if(!n)return this.#k=this.fullpathPosix();let r=n.relativePosix();return r+(!r||!n.parent?"":"/")+e}fullpath(){if(this.#w!==void 0)return this.#w;let e=this.name,n=this.parent;if(!n)return this.#w=this.name;let i=n.fullpath()+(n.parent?this.sep:"")+e;return this.#w=i}fullpathPosix(){if(this.#p!==void 0)return this.#p;if(this.sep==="/")return this.#p=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#p=`//?/${i}`:this.#p=i}let e=this.parent,n=e.fullpathPosix(),r=n+(!n||!e.parent?"":"/")+this.name;return this.#p=r}isUnknown(){return(this.#n&hr)===dr}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.#n&hr)===uP}isDirectory(){return(this.#n&hr)===ti}isCharacterDevice(){return(this.#n&hr)===oP}isBlockDevice(){return(this.#n&hr)===aP}isFIFO(){return(this.#n&hr)===sP}isSocket(){return(this.#n&hr)===cP}isSymbolicLink(){return(this.#n&Js)===Js}lstatCached(){return this.#n&QR?this:void 0}readlinkCached(){return this.#b}realpathCached(){return this.#R}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.#n&hr;return!(e!==dr&&e!==Js||this.#n&lp||this.#n&Rr)}calledReaddir(){return!!(this.#n&QS)}isENOENT(){return!!(this.#n&Rr)}isNamed(e){return this.nocase?this.#_===hp(e):this.#_===pc(e)}async readlink(){let e=this.#b;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.#b=r}catch(n){this.#l(n.code);return}}readlinkSync(){let e=this.#b;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.#b=r}catch(n){this.#l(n.code);return}}#M(e){this.#n|=QS;for(let n=e.provisional;n<e.length;n++){let r=e[n];r&&r.#L()}}#L(){this.#n&Rr||(this.#n=(this.#n|Rr)&lc,this.#A())}#A(){let e=this.children();e.provisional=0;for(let n of e)n.#L()}#C(){this.#n|=dp,this.#N()}#N(){if(this.#n&fc)return;let e=this.#n;(e&hr)===ti&&(e&=lc),this.#n=e|fc,this.#A()}#q(e=""){e==="ENOTDIR"||e==="EPERM"?this.#N():e==="ENOENT"?this.#L():this.children().provisional=0}#j(e=""){e==="ENOTDIR"?this.parent.#N():e==="ENOENT"&&this.#L()}#l(e=""){let n=this.#n;n|=lp,e==="ENOENT"&&(n|=Rr),(e==="EINVAL"||e==="UNKNOWN")&&(n&=lc),this.#n=n,e==="ENOTDIR"&&this.parent&&this.parent.#N()}#F(e,n){return this.#P(e,n)||this.#$(e,n)}#$(e,n){let r=ZS(e),i=this.newChild(e.name,r,{parent:this}),s=i.#n&hr;return s!==ti&&s!==Js&&s!==dr&&(i.#n|=fc),n.unshift(i),n.provisional++,i}#P(e,n){for(let r=n.provisional;r<n.length;r++){let i=n[r];if((this.nocase?hp(e.name):pc(e.name))===i.#_)return this.#B(e,i,r,n)}}#B(e,n,r,i){let s=n.name;return n.#n=n.#n&lc|ZS(e),s!==e.name&&(n.name=e.name),r!==i.provisional&&(r===i.length-1?i.pop():i.splice(r,1),i.unshift(n)),i.provisional++,n}async lstat(){if(!(this.#n&Rr))try{return this.#G(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#j(e.code)}}lstatSync(){if(!(this.#n&Rr))try{return this.#G(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#j(e.code)}}#G(e){let{atime:n,atimeMs:r,birthtime:i,birthtimeMs:s,blksize:o,blocks:a,ctime:u,ctimeMs:c,dev:l,gid:h,ino:d,mode:g,mtime:y,mtimeMs:_,nlink:C,rdev:k,size:T,uid:w}=e;this.#T=n,this.#m=r,this.#x=i,this.#d=s,this.#h=o,this.#i=a,this.#E=u,this.#f=c,this.#t=l,this.#v=h,this.#a=d,this.#s=g,this.#g=y,this.#y=_,this.#r=C,this.#c=k,this.#u=T,this.#o=w;let v=ZS(e);this.#n=this.#n&lc|v|QR,v!==dr&&v!==ti&&v!==Js&&(this.#n|=fc)}#U=[];#H=!1;#z(e){this.#H=!1;let n=this.#U.slice();this.#U.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 s=r.slice(0,r.provisional);n?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#U.push(e),this.#H)return;this.#H=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(s,o)=>{if(s)this.#q(s.code),r.provisional=0;else{for(let a of o)this.#F(a,r);this.#M(r)}this.#z(r.slice(0,r.provisional))})}#W;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.#W)await this.#W;else{let r=()=>{};this.#W=new Promise(i=>r=i);try{for(let i of await this.#e.promises.readdir(n,{withFileTypes:!0}))this.#F(i,e);this.#M(e)}catch(i){this.#q(i.code),e.provisional=0}this.#W=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.#F(r,e);this.#M(e)}catch(r){this.#q(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#n&ZR)return!1;let e=hr&this.#n;return e===dr||e===ti||e===Js}shouldWalk(e,n){return(this.#n&ti)===ti&&!(this.#n&ZR)&&!e.has(this)&&(!n||n(this))}async realpath(){if(this.#R)return this.#R;if(!((dp|lp|Rr)&this.#n))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#R=this.resolve(e)}catch{this.#C()}}realpathSync(){if(this.#R)return this.#R;if(!((dp|lp|Rr)&this.#n))try{let e=this.#e.realpathSync(this.fullpath());return this.#R=this.resolve(e)}catch{this.#C()}}[lP](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let n=new Set([]),r=[],i=this;for(;i&&i.parent;)n.add(i),i.#O=r.join(this.sep),i.#k=r.join("/"),i=i.parent,r.push("..");for(i=e;i&&i.parent&&!n.has(i);)i.#O=void 0,i.#k=void 0,i=i.parent}};Fe.PathBase=Qt;var mc=class t extends Qt{sep="\\";splitSep=sH;constructor(e,n=dr,r,i,s,o,a){super(e,n,r,i,s,o,a)}newChild(e,n=dr,r={}){return new t(e,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return fp.win32.parse(e).root}getRoot(e){if(e=iH(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 _c(e,this).root}sameRoot(e,n=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(iP,"$1\\"),e===n}};Fe.PathWin32=mc;var yc=class t extends Qt{splitSep="/";sep="/";constructor(e,n=dr,r,i,s,o,a){super(e,n,r,i,s,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,n=dr,r={}){return new t(e,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}};Fe.PathPosix=yc;var bc=class{root;rootPath;roots;cwd;#e;#t;#s;nocase;#r;constructor(e=process.cwd(),n,r,{nocase:i,childrenCacheSize:s=16*1024,fs:o=dc}={}){this.#r=rP(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,tH.fileURLToPath)(e));let a=n.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new gc,this.#t=new gc,this.#s=new pp(s);let u=a.substring(this.rootPath.length).split(r);if(u.length===1&&!u[0]&&u.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let c=this.root,l=u.length-1,h=n.sep,d=this.rootPath,g=!1;for(let y of u){let _=l--;c=c.child(y,{relative:new Array(_).fill("..").join(h),relativePosix:new Array(_).fill("..").join("/"),fullpath:d+=(g?"":h)+y}),g=!0}this.cwd=c}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 s=e.length-1;s>=0;s--){let o=e[s];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 i=this.cwd.resolve(n).fullpath();return this.#e.set(n,i),i}resolvePosix(...e){let n="";for(let s=e.length-1;s>=0;s--){let o=e[s];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 i=this.cwd.resolve(n).fullpathPosix();return this.#t.set(n,i),i}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 Qt||(n=e,e=this.cwd);let{withFileTypes:r}=n;if(e.canReaddir()){let i=await e.readdir();return r?i:i.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,n={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Qt||(n=e,e=this.cwd);let{withFileTypes:r=!0}=n;return e.canReaddir()?r?e.readdirSync():e.readdirSync().map(i=>i.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 Qt||(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 Qt||(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 Qt||(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 Qt||(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 Qt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=[];(!s||s(e))&&a.push(r?e:e.fullpath());let u=new Set,c=(h,d)=>{u.add(h),h.readdirCB((g,y)=>{if(g)return d(g);let _=y.length;if(!_)return d();let C=()=>{--_===0&&d()};for(let k of y)(!s||s(k))&&a.push(r?k:k.fullpath()),i&&k.isSymbolicLink()?k.realpath().then(T=>T?.isUnknown()?T.lstat():T).then(T=>T?.shouldWalk(u,o)?c(T,C):C()):k.shouldWalk(u,o)?c(k,C):C()},!0)},l=e;return new Promise((h,d)=>{c(l,g=>{if(g)return d(g);h(a)})})}walkSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Qt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=[];(!s||s(e))&&a.push(r?e:e.fullpath());let u=new Set([e]);for(let c of u){let l=c.readdirSync();for(let h of l){(!s||s(h))&&a.push(r?h:h.fullpath());let d=h;if(h.isSymbolicLink()){if(!(i&&(d=h.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(u,o)&&u.add(d)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,n={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof Qt||(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 Qt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n;(!s||s(e))&&(yield r?e:e.fullpath());let a=new Set([e]);for(let u of a){let c=u.readdirSync();for(let l of c){(!s||s(l))&&(yield r?l:l.fullpath());let h=l;if(l.isSymbolicLink()){if(!(i&&(h=l.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(a,o)&&a.add(h)}}}stream(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Qt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=new JR.Minipass({objectMode:!0});(!s||s(e))&&a.write(r?e:e.fullpath());let u=new Set,c=[e],l=0,h=()=>{let d=!1;for(;!d;){let g=c.shift();if(!g){l===0&&a.end();return}l++,u.add(g);let y=(C,k,T=!1)=>{if(C)return a.emit("error",C);if(i&&!T){let w=[];for(let v of k)v.isSymbolicLink()&&w.push(v.realpath().then(L=>L?.isUnknown()?L.lstat():L));if(w.length){Promise.all(w).then(()=>y(null,k,!0));return}}for(let w of k)w&&(!s||s(w))&&(a.write(r?w:w.fullpath())||(d=!0));l--;for(let w of k){let v=w.realpathCached()||w;v.shouldWalk(u,o)&&c.push(v)}d&&!a.flowing?a.once("drain",h):_||h()},_=!0;g.readdirCB(y,!0),_=!1}};return h(),a}streamSync(e=this.cwd,n={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Qt||(n=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=n,a=new JR.Minipass({objectMode:!0}),u=new Set;(!s||s(e))&&a.write(r?e:e.fullpath());let c=[e],l=0,h=()=>{let d=!1;for(;!d;){let g=c.shift();if(!g){l===0&&a.end();return}l++,u.add(g);let y=g.readdirSync();for(let _ of y)(!s||s(_))&&(a.write(r?_:_.fullpath())||(d=!0));l--;for(let _ of y){let C=_;if(_.isSymbolicLink()){if(!(i&&(C=_.realpathSync())))continue;C.isUnknown()&&C.lstatSync()}C.shouldWalk(u,o)&&c.push(C)}}d&&!a.flowing&&a.once("drain",h)};return h(),a}chdir(e=this.cwd){let n=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[lP](n)}};Fe.PathScurryBase=bc;var _c=class extends bc{sep="\\";constructor(e=process.cwd(),n={}){let{nocase:r=!0}=n;super(e,fp.win32,"\\",{...n,nocase:r}),this.nocase=r;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return fp.win32.parse(e).root.toUpperCase()}newRoot(e){return new mc(this.rootPath,ti,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}};Fe.PathScurryWin32=_c;var vc=class extends bc{sep="/";constructor(e=process.cwd(),n={}){let{nocase:r=!1}=n;super(e,fp.posix,"/",{...n,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new yc(this.rootPath,ti,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}};Fe.PathScurryPosix=vc;var gp=class extends vc{constructor(e=process.cwd(),n={}){let{nocase:r=!0}=n;super(e,{...n,nocase:r})}};Fe.PathScurryDarwin=gp;Fe.Path=process.platform==="win32"?mc:yc;Fe.PathScurry=process.platform==="win32"?_c:process.platform==="darwin"?gp:vc});var tw=m(mp=>{"use strict";Object.defineProperty(mp,"__esModule",{value:!0});mp.Pattern=void 0;var aH=os(),uH=t=>t.length>=1,cH=t=>t.length>=1,ew=class t{#e;#t;#s;length;#r;#o;#v;#c;#h;#a;#u=!0;constructor(e,n,r,i){if(!uH(e))throw new TypeError("empty pattern list");if(!cH(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.#r=i,this.#s===0){if(this.isUNC()){let[s,o,a,u,...c]=this.#e,[l,h,d,g,...y]=this.#t;c[0]===""&&(c.shift(),y.shift());let _=[s,o,a,u,""].join("/"),C=[l,h,d,g,""].join("/");this.#e=[_,...c],this.#t=[C,...y],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...o]=this.#e,[a,...u]=this.#t;o[0]===""&&(o.shift(),u.shift());let c=s+"/",l=a+"/";this.#e=[c,...o],this.#t=[l,...u],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]===aH.GLOBSTAR}isRegExp(){return this.#e[this.#s]instanceof RegExp}globString(){return this.#v=this.#v||(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.#r),this.#o.#a=this.#a,this.#o.#h=this.#h,this.#o.#c=this.#c,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#h!==void 0?this.#h:this.#h=this.#r==="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.#c!==void 0?this.#c:this.#c=this.#r==="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.#u)}markFollowGlobstar(){return this.#s===0||!this.isGlobstar()||!this.#u?!1:(this.#u=!1,!0)}};mp.Pattern=ew});var rw=m(yp=>{"use strict";Object.defineProperty(yp,"__esModule",{value:!0});yp.Ignore=void 0;var dP=os(),lH=tw(),hH=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",nw=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:n,nocase:r,noext:i,noglobstar:s,platform:o=hH}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:n,nocase:r,noext:i,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let n=new dP.Minimatch(e,this.mmopts);for(let r=0;r<n.set.length;r++){let i=n.set[r],s=n.globParts[r];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let o=new lH.Pattern(i,s,0,this.platform),a=new dP.Minimatch(o.globString(),this.mmopts),u=s[s.length-1]==="**",c=o.isAbsolute();c?this.absolute.push(a):this.relative.push(a),u&&(c?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(e){let n=e.fullpath(),r=`${n}/`,i=e.relative()||".",s=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(s))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 i of this.relativeChildren)if(i.match(r))return!0;for(let i of this.absoluteChildren)if(i.match(n))return!0;return!1}};yp.Ignore=nw});var pP=m(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.Processor=ni.SubWalks=ni.MatchRecord=ni.HasWalkedCache=void 0;var fP=os(),bp=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(),i=this.store.get(r);i?i.add(n.globString()):this.store.set(r,new Set([n.globString()]))}};ni.HasWalkedCache=bp;var _p=class{store=new Map;add(e,n,r){let i=(n?2:0)|(r?1:0),s=this.store.get(e);this.store.set(e,s===void 0?i:i&s)}entries(){return[...this.store.entries()].map(([e,n])=>[e,!!(n&2),!!(n&1)])}};ni.MatchRecord=_p;var vp=class{store=new Map;add(e,n){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(i=>i.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())}};ni.SubWalks=vp;var iw=class t{hasWalkedCache;matches=new _p;subwalks=new vp;patterns;follow;dot;opts;constructor(e,n){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=n?n.copy():new bp}processPatterns(e,n){this.patterns=n;let r=n.map(i=>[e,i]);for(let[i,s]of r){this.hasWalkedCache.storeWalked(i,s);let o=s.root(),a=s.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let h=s.rest();if(h)s=h;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let u,c,l=!1;for(;typeof(u=s.pattern())=="string"&&(c=s.rest());)i=i.resolve(u),s=c,l=!0;if(u=s.pattern(),c=s.rest(),l){if(this.hasWalkedCache.hasWalked(i,s))continue;this.hasWalkedCache.storeWalked(i,s)}if(typeof u=="string"){let h=u===".."||u===""||u===".";this.matches.add(i.resolve(u),a,h);continue}else if(u===fP.GLOBSTAR){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let h=c?.pattern(),d=c?.rest();if(!c||(h===""||h===".")&&!d)this.matches.add(i,a,h===""||h===".");else if(h===".."){let g=i.parent||i;d?this.hasWalkedCache.hasWalked(g,d)||this.subwalks.add(g,d):this.matches.add(g,a,!0)}}else u instanceof RegExp&&this.subwalks.add(i,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,n){let r=this.subwalks.get(e),i=this.child();for(let s of n)for(let o of r){let a=o.isAbsolute(),u=o.pattern(),c=o.rest();u===fP.GLOBSTAR?i.testGlobstar(s,o,c,a):u instanceof RegExp?i.testRegExp(s,u,c,a):i.testString(s,u,c,a)}return i}testGlobstar(e,n,r,i){if((this.dot||!e.name.startsWith("."))&&(n.hasMore()||this.matches.add(e,i,!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 s=r.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,r.rest(),i);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,r)}else s instanceof RegExp&&this.testRegExp(e,s,r.rest(),i)}}testRegExp(e,n,r,i){n.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}testString(e,n,r,i){e.isNamed(n)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}};ni.Processor=iw});var yP=m(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.GlobStream=cs.GlobWalker=cs.GlobUtil=void 0;var dH=JS(),gP=rw(),mP=pP(),fH=(t,e)=>typeof t=="string"?new gP.Ignore([t],e):Array.isArray(t)?new gP.Ignore(t,e):t,Sc=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=fH(r.ignore??[],r),!this.includeChildMatches&&typeof this.#t.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#r(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 s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=await s.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(s,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.#r(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 s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=s.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(s,n)}matchFinish(e,n){if(this.#r(e))return;if(!this.includeChildMatches&&this.#t?.add){let s=`${e.relativePosix()}/**`;this.#t.add(s)}let r=this.opts.absolute===void 0?n:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#s:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(r){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+i)}else{let s=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!s.startsWith(".."+this.#s)?"."+this.#s:"";this.matchEmit(s?o+s+i:"."+i)}}async match(e,n,r){let i=await this.matchCheck(e,r);i&&this.matchFinish(i,n)}matchSync(e,n,r){let i=this.matchCheckSync(e,r);i&&this.matchFinish(i,n)}walkCB(e,n,r){this.signal?.aborted&&r(),this.walkCB2(e,n,new mP.Processor(this.opts),r)}walkCB2(e,n,r,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,n,r,i));return}r.processPatterns(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of r.matches.entries())this.#r(a)||(s++,this.match(a,u,c).then(()=>o()));for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let u=a.readdirCached();a.calledReaddir()?this.walkCB3(a,u,r,o):a.readdirCB((c,l)=>this.walkCB3(a,l,r,o),!0)}o()}walkCB3(e,n,r,i){r=r.filterEntries(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of r.matches.entries())this.#r(a)||(s++,this.match(a,u,c).then(()=>o()));for(let[a,u]of r.subwalks.entries())s++,this.walkCB2(a,u,r.child(),o);o()}walkCBSync(e,n,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,n,new mP.Processor(this.opts),r)}walkCB2Sync(e,n,r,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,n,r,i));return}r.processPatterns(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of r.matches.entries())this.#r(a)||this.matchSync(a,u,c);for(let a of r.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let u=a.readdirSync();this.walkCB3Sync(a,u,r,o)}o()}walkCB3Sync(e,n,r,i){r=r.filterEntries(e,n);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of r.matches.entries())this.#r(a)||this.matchSync(a,u,c);for(let[a,u]of r.subwalks.entries())s++,this.walkCB2Sync(a,u,r.child(),o);o()}};cs.GlobUtil=Sc;var sw=class extends Sc{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}};cs.GlobWalker=sw;var ow=class extends Sc{results;constructor(e,n,r){super(e,n,r),this.results=new dH.Minipass({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}};cs.GlobStream=ow});var uw=m(Tp=>{"use strict";Object.defineProperty(Tp,"__esModule",{value:!0});Tp.Glob=void 0;var pH=os(),gH=require("node:url"),Sp=hP(),mH=tw(),wp=yP(),yH=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",aw=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,gH.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(u=>u.replace(/\\/g,"/"))),this.matchBase){if(n.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(u=>u.includes("/")?u:`./**/${u}`)}if(this.pattern=e,this.platform=n.platform||yH,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 u=n.platform==="win32"?Sp.PathScurryWin32:n.platform==="darwin"?Sp.PathScurryDarwin:n.platform?Sp.PathScurryPosix:Sp.PathScurry;this.scurry=new u(this.cwd,{nocase:n.nocase,fs:n.fs})}this.nocase=this.scurry.nocase;let r=this.platform==="darwin"||this.platform==="win32",i={...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},s=this.pattern.map(u=>new pH.Minimatch(u,i)),[o,a]=s.reduce((u,c)=>(u[0].push(...c.set),u[1].push(...c.globParts),u),[[],[]]);this.patterns=o.map((u,c)=>{let l=a[c];if(!l)throw new Error("invalid pattern object");return new mH.Pattern(u,l,0,this.platform)})}async walk(){return[...await new wp.GlobWalker(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 wp.GlobWalker(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 wp.GlobStream(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 wp.GlobStream(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()}};Tp.Glob=aw});var cw=m(Ep=>{"use strict";Object.defineProperty(Ep,"__esModule",{value:!0});Ep.hasMagic=void 0;var bH=os(),_H=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let n of t)if(new bH.Minimatch(n,e).hasMagic())return!0;return!1};Ep.hasMagic=_H});var SP=m(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.glob=Ae.sync=Ae.iterate=Ae.iterateSync=Ae.stream=Ae.streamSync=Ae.Ignore=Ae.hasMagic=Ae.Glob=Ae.unescape=Ae.escape=void 0;Ae.globStreamSync=wc;Ae.globStream=lw;Ae.globSync=hw;Ae.globIterateSync=Tc;Ae.globIterate=dw;var bP=os(),Qs=uw(),vH=cw(),vP=os();Object.defineProperty(Ae,"escape",{enumerable:!0,get:function(){return vP.escape}});Object.defineProperty(Ae,"unescape",{enumerable:!0,get:function(){return vP.unescape}});var SH=uw();Object.defineProperty(Ae,"Glob",{enumerable:!0,get:function(){return SH.Glob}});var wH=cw();Object.defineProperty(Ae,"hasMagic",{enumerable:!0,get:function(){return wH.hasMagic}});var TH=rw();Object.defineProperty(Ae,"Ignore",{enumerable:!0,get:function(){return TH.Ignore}});function wc(t,e={}){return new Qs.Glob(t,e).streamSync()}function lw(t,e={}){return new Qs.Glob(t,e).stream()}function hw(t,e={}){return new Qs.Glob(t,e).walkSync()}async function _P(t,e={}){return new Qs.Glob(t,e).walk()}function Tc(t,e={}){return new Qs.Glob(t,e).iterateSync()}function dw(t,e={}){return new Qs.Glob(t,e).iterate()}Ae.streamSync=wc;Ae.stream=Object.assign(lw,{sync:wc});Ae.iterateSync=Tc;Ae.iterate=Object.assign(dw,{sync:Tc});Ae.sync=Object.assign(hw,{stream:wc,iterate:Tc});Ae.glob=Object.assign(_P,{glob:_P,globSync:hw,sync:Ae.sync,globStream:lw,stream:Ae.stream,globStreamSync:wc,streamSync:Ae.streamSync,globIterate:dw,iterate:Ae.iterate,globIterateSync:Tc,iterateSync:Ae.iterateSync,Glob:Qs.Glob,hasMagic:vH.hasMagic,escape:bP.escape,unescape:bP.unescape});Ae.glob.glob=Ae.glob});var TP=m(Ta=>{"use strict";var pw=Ta&&Ta.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ta,"__esModule",{value:!0});Ta.FileSystem=void 0;var EH=Am(),wP=(gR(),IP(pR)),xH=pw(require("events")),xp=xf(),kH=pw(require("fs")),AH=Uf(),CH=pw(jf()),OH=SP(),fw=class extends xH.default{constructor(e){super(),this._context=e,this._textDocumentManager=new EH.TextDocuments(wP.TextDocument),this._tempTextDocumentCache=new CH.default({ttl:1e3,max:100})}async getWorkspaceFolderUris(){if(!this._context.features.workspaceFolder)return[];if(this._workspace==null)return[];let e=await this._workspace.getWorkspaceFolders();return e==null?[]:Array.from(new Set(e.map(n=>n.uri))).map(n=>xp.URI.parse(n))}async getWorkspaceFolderUri(e){return(await this.getWorkspaceFolderUris()).find(r=>e.path.startsWith(r.path))||null}async getWorkspaceRelatedFiles(){let e=this._context.getConfiguration(),n=e.fileExtensions,r=e.typeAnalyzer.exclude,i=await this.getWorkspaceFolderUris();return(await Promise.all(i.flatMap(async o=>(0,OH.glob)(n.map(a=>`**/*.${a}`),{cwd:o.fsPath,absolute:!0,ignore:r})))).flat().map(o=>xp.URI.file(o))}async findExistingPath(...e){if(e.length===0)return null;for(let n=0;n<e.length;n++)if(await this.getTextDocument(e[n])!=null)return e[n];return null}getAllTextDocuments(){return this._textDocumentManager.all()}async fetchTextDocument(e){let n=xp.URI.parse(e),r=this._tempTextDocumentCache.get(e);if(r!=null)return r;let i=null;try{let s=await kH.default.promises.readFile(n.fsPath,{encoding:"utf-8"});i=wP.TextDocument.create(e,AH.LanguageId,0,s)}catch{}return this._tempTextDocumentCache.set(e,i),i}async getTextDocument(e){let n=this._textDocumentManager.get(e);return n||(xp.URI.parse(e).scheme=="file"?await this.fetchTextDocument(e):null)}async readFile(e){return(await this.getTextDocument(e)).getText()}listen(e){this._workspace=e.workspace,this._textDocumentManager.listen(e),this._textDocumentManager.onDidOpen(n=>{this.emit("text-document-open",n.document)}),this._textDocumentManager.onDidChangeContent(n=>{this.emit("text-document-change",n.document)}),this._textDocumentManager.onDidClose(n=>{this.emit("text-document-close",n.document)})}};Ta.FileSystem=fw});var EP=m(kp=>{"use strict";Object.defineProperty(kp,"__esModule",{value:!0});kp.NodeContext=void 0;var gw=Am(),mw=Uf(),RH=TP(),yw=class extends mw.CoreContext{constructor(){super(),this.documentManager=new mw.DocumentManager().setContext(this),this.documentMerger=new mw.DocumentMerger,this.connection=(0,gw.createConnection)(gw.ProposedFeatures.all),this.fs=new RH.FileSystem(this)}createSemanticTokensBuilder(){return new gw.SemanticTokensBuilder}};kp.NodeContext=yw});Object.defineProperty(exports,"__esModule",{value:!0});var PH=EP(),Pr=Uf(),xP=new PH.NodeContext;xP.on("ready",t=>{(0,Pr.activateAutocomplete)(t),(0,Pr.activateColor)(t),(0,Pr.activateDefinition)(t),(0,Pr.activateDiagnostic)(t),(0,Pr.activateFormatter)(t),(0,Pr.activateHover)(t),(0,Pr.activateSignature)(t),(0,Pr.activateSubscriptions)(t),(0,Pr.activateSymbol)(t),(0,Pr.activateSemantic)(t),(0,Pr.activateFoldingRange)(t)});xP.listen();