miniscript-languageserver 1.1.0 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +39 -39
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -1,9 +1,9 @@
1
- "use strict";var Jd=Object.defineProperty;var Ck=Object.getOwnPropertyDescriptor;var Ok=Object.getOwnPropertyNames;var Rk=Object.prototype.hasOwnProperty;var Dk=(t,e)=>()=>(t&&(e=t(t=0)),e);var m=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ik=(t,e)=>{for(var n in e)Jd(t,n,{get:e[n],enumerable:!0})},Pk=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ok(e))!Rk.call(t,i)&&i!==n&&Jd(t,i,{get:()=>e[i],enumerable:!(r=Ck(e,i))||r.enumerable});return t};var Mk=t=>Pk(Jd({},"__esModule",{value:!0}),t);var du=m(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.thenable=yt.typedArray=yt.stringArray=yt.array=yt.func=yt.error=yt.number=yt.string=yt.boolean=void 0;function Lk(t){return t===!0||t===!1}yt.boolean=Lk;function Wb(t){return typeof t=="string"||t instanceof String}yt.string=Wb;function Nk(t){return typeof t=="number"||t instanceof Number}yt.number=Nk;function qk(t){return t instanceof Error}yt.error=qk;function Gb(t){return typeof t=="function"}yt.func=Gb;function Vb(t){return Array.isArray(t)}yt.array=Vb;function jk(t){return Vb(t)&&t.every(e=>Wb(e))}yt.stringArray=jk;function Fk(t,e){return Array.isArray(t)&&t.every(e)}yt.typedArray=Fk;function $k(t){return t&&Gb(t.then)}yt.thenable=$k});var ms=m(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.stringArray=Ft.array=Ft.func=Ft.error=Ft.number=Ft.string=Ft.boolean=void 0;function Bk(t){return t===!0||t===!1}Ft.boolean=Bk;function zb(t){return typeof t=="string"||t instanceof String}Ft.string=zb;function Uk(t){return typeof t=="number"||t instanceof Number}Ft.number=Uk;function Hk(t){return t instanceof Error}Ft.error=Hk;function Wk(t){return typeof t=="function"}Ft.func=Wk;function Kb(t){return Array.isArray(t)}Ft.array=Kb;function Gk(t){return Kb(t)&&t.every(e=>zb(e))}Ft.stringArray=Gk});var wf=m(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.Message=Q.NotificationType9=Q.NotificationType8=Q.NotificationType7=Q.NotificationType6=Q.NotificationType5=Q.NotificationType4=Q.NotificationType3=Q.NotificationType2=Q.NotificationType1=Q.NotificationType0=Q.NotificationType=Q.RequestType9=Q.RequestType8=Q.RequestType7=Q.RequestType6=Q.RequestType5=Q.RequestType4=Q.RequestType3=Q.RequestType2=Q.RequestType1=Q.RequestType=Q.RequestType0=Q.AbstractMessageSignature=Q.ParameterStructures=Q.ResponseError=Q.ErrorCodes=void 0;var Oi=ms(),Qd;(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})(Qd||(Q.ErrorCodes=Qd={}));var Zd=class t extends Error{constructor(e,n,r){super(n),this.code=Oi.number(e)?e:Qd.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}};Q.ResponseError=Zd;var sn=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};Q.ParameterStructures=sn;sn.auto=new sn("auto");sn.byPosition=new sn("byPosition");sn.byName=new sn("byName");var Ge=class{constructor(e,n){this.method=e,this.numberOfParams=n}get parameterStructures(){return sn.auto}};Q.AbstractMessageSignature=Ge;var ef=class extends Ge{constructor(e){super(e,0)}};Q.RequestType0=ef;var tf=class extends Ge{constructor(e,n=sn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Q.RequestType=tf;var nf=class extends Ge{constructor(e,n=sn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Q.RequestType1=nf;var rf=class extends Ge{constructor(e){super(e,2)}};Q.RequestType2=rf;var sf=class extends Ge{constructor(e){super(e,3)}};Q.RequestType3=sf;var of=class extends Ge{constructor(e){super(e,4)}};Q.RequestType4=of;var af=class extends Ge{constructor(e){super(e,5)}};Q.RequestType5=af;var uf=class extends Ge{constructor(e){super(e,6)}};Q.RequestType6=uf;var cf=class extends Ge{constructor(e){super(e,7)}};Q.RequestType7=cf;var lf=class extends Ge{constructor(e){super(e,8)}};Q.RequestType8=lf;var df=class extends Ge{constructor(e){super(e,9)}};Q.RequestType9=df;var ff=class extends Ge{constructor(e,n=sn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Q.NotificationType=ff;var pf=class extends Ge{constructor(e){super(e,0)}};Q.NotificationType0=pf;var hf=class extends Ge{constructor(e,n=sn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Q.NotificationType1=hf;var mf=class extends Ge{constructor(e){super(e,2)}};Q.NotificationType2=mf;var gf=class extends Ge{constructor(e){super(e,3)}};Q.NotificationType3=gf;var yf=class extends Ge{constructor(e){super(e,4)}};Q.NotificationType4=yf;var bf=class extends Ge{constructor(e){super(e,5)}};Q.NotificationType5=bf;var _f=class extends Ge{constructor(e){super(e,6)}};Q.NotificationType6=_f;var vf=class extends Ge{constructor(e){super(e,7)}};Q.NotificationType7=vf;var Sf=class extends Ge{constructor(e){super(e,8)}};Q.NotificationType8=Sf;var Tf=class extends Ge{constructor(e){super(e,9)}};Q.NotificationType9=Tf;var Xb;(function(t){function e(i){let s=i;return s&&Oi.string(s.method)&&(Oi.string(s.id)||Oi.number(s.id))}t.isRequest=e;function n(i){let s=i;return s&&Oi.string(s.method)&&i.id===void 0}t.isNotification=n;function r(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&(Oi.string(s.id)||Oi.number(s.id)||s.id===null)}t.isResponse=r})(Xb||(Q.Message=Xb={}))});var Af=m(Wr=>{"use strict";var Yb;Object.defineProperty(Wr,"__esModule",{value:!0});Wr.LRUCache=Wr.LinkedMap=Wr.Touch=void 0;var $t;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})($t||(Wr.Touch=$t={}));var fu=class{constructor(){this[Yb]="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=$t.None){let r=this._map.get(e);if(r)return n!==$t.None&&this.touch(r,n),r.value}set(e,n,r=$t.None){let i=this._map.get(e);if(i)i.value=n,r!==$t.None&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case $t.None:this.addItemLast(i);break;case $t.First:this.addItemFirst(i);break;case $t.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}[(Yb=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!==$t.First&&n!==$t.Last)){if(n===$t.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===$t.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)}};Wr.LinkedMap=fu;var Ef=class extends fu{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=$t.AsNew){return super.get(e,n)}peek(e){return super.get(e,$t.None)}set(e,n){return super.set(e,n,$t.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Wr.LRUCache=Ef});var Qb=m(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.Disposable=void 0;var Jb;(function(t){function e(n){return{dispose:n}}t.create=e})(Jb||(pu.Disposable=Jb={}))});var Gr=m(Cf=>{"use strict";Object.defineProperty(Cf,"__esModule",{value:!0});var xf;function kf(){if(xf===void 0)throw new Error("No runtime abstraction layer installed");return xf}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");xf=n}t.install=e})(kf||(kf={}));Cf.default=kf});var ys=m(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.Emitter=gs.Event=void 0;var Vk=Gr(),Zb;(function(t){let e={dispose(){}};t.None=function(){return e}})(Zb||(gs.Event=Zb={}));var Of=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,Vk.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},hu=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,n,r)=>{this._callbacks||(this._callbacks=new Of),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)}};gs.Emitter=hu;hu._noop=function(){}});var yu=m(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});bs.CancellationTokenSource=bs.CancellationToken=void 0;var zk=Gr(),Kk=ms(),Rf=ys(),mu;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Rf.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Rf.Event.None});function e(n){let r=n;return r&&(r===t.None||r===t.Cancelled||Kk.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(mu||(bs.CancellationToken=mu={}));var Xk=Object.freeze(function(t,e){let n=(0,zk.default)().timer.setTimeout(t.bind(e),0);return{dispose(){n.dispose()}}}),gu=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?Xk:(this._emitter||(this._emitter=new Rf.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Df=class{get token(){return this._token||(this._token=new gu),this._token}cancel(){this._token?this._token.cancel():this._token=mu.Cancelled}dispose(){this._token?this._token instanceof gu&&this._token.dispose():this._token=mu.None}};bs.CancellationTokenSource=Df});var e_=m(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.SharedArrayReceiverStrategy=_s.SharedArraySenderStrategy=void 0;var Yk=yu(),Io;(function(t){t.Continue=0,t.Cancelled=1})(Io||(Io={}));var If=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]=Io.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,Io.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};_s.SharedArraySenderStrategy=If;var Pf=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Io.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},Mf=class{constructor(e){this.token=new Pf(e)}cancel(){}dispose(){}},Lf=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let n=e.$cancellationData;return n===void 0?new Yk.CancellationTokenSource:new Mf(n)}};_s.SharedArrayReceiverStrategy=Lf});var qf=m(bu=>{"use strict";Object.defineProperty(bu,"__esModule",{value:!0});bu.Semaphore=void 0;var Jk=Gr(),Nf=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,Jk.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()}}};bu.Semaphore=Nf});var n_=m(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.ReadableStreamMessageReader=Vr.AbstractMessageReader=Vr.MessageReader=void 0;var Ff=Gr(),vs=ms(),jf=ys(),Qk=qf(),t_;(function(t){function e(n){let r=n;return r&&vs.func(r.listen)&&vs.func(r.dispose)&&vs.func(r.onError)&&vs.func(r.onClose)&&vs.func(r.onPartialMessage)}t.is=e})(t_||(Vr.MessageReader=t_={}));var _u=class{constructor(){this.errorEmitter=new jf.Emitter,this.closeEmitter=new jf.Emitter,this.partialMessageEmitter=new jf.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: ${vs.string(e.message)?e.message:"unknown"}`)}};Vr.AbstractMessageReader=_u;var $f;(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,Ff.default)().applicationJson.decoder,u.set(a.name,a)),{charset:r,contentDecoder:s,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:u}}t.fromOptions=e})($f||($f={}));var Bf=class extends _u{constructor(e,n){super(),this.readable=e,this.options=$f.fromOptions(n),this.buffer=(0,Ff.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new Qk.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,Ff.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))}};Vr.ReadableStreamMessageReader=Bf});var a_=m(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.WriteableStreamMessageWriter=zr.AbstractMessageWriter=zr.MessageWriter=void 0;var r_=Gr(),Po=ms(),Zk=qf(),i_=ys(),eC="Content-Length: ",s_=`\r
3
- `,o_;(function(t){function e(n){let r=n;return r&&Po.func(r.dispose)&&Po.func(r.onClose)&&Po.func(r.onError)&&Po.func(r.write)}t.is=e})(o_||(zr.MessageWriter=o_={}));var vu=class{constructor(){this.errorEmitter=new i_.Emitter,this.closeEmitter=new i_.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: ${Po.string(e.message)?e.message:"unknown"}`)}};zr.AbstractMessageWriter=vu;var Uf;(function(t){function e(n){return n===void 0||typeof n=="string"?{charset:n??"utf-8",contentTypeEncoder:(0,r_.default)().applicationJson.encoder}:{charset:n.charset??"utf-8",contentEncoder:n.contentEncoder,contentTypeEncoder:n.contentTypeEncoder??(0,r_.default)().applicationJson.encoder}}t.fromOptions=e})(Uf||(Uf={}));var Hf=class extends vu{constructor(e,n){super(),this.writable=e,this.options=Uf.fromOptions(n),this.errorCount=0,this.writeSemaphore=new Zk.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(eC,r.byteLength.toString(),s_),i.push(s_),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()}};zr.WriteableStreamMessageWriter=Hf});var u_=m(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});Su.AbstractMessageBuffer=void 0;var tC=13,nC=10,rC=`\r
4
- `,Wf=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 tC:switch(n){case 0:n=1;break;case 2:n=3;break;default:n=0}break;case nC: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(rC);if(u.length<2)return a;for(let c=0;c<u.length-2;c++){let l=u[c],d=l.indexOf(":");if(d===-1)throw new Error(`Message header must separate key and value using ':'
5
- ${l}`);let p=l.substr(0,d),y=l.substr(d+1).trim();a.set(e?p.toLowerCase():p,y)}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}};Su.AbstractMessageBuffer=Wf});var p_=m(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.createMessageConnection=he.ConnectionOptions=he.MessageStrategy=he.CancellationStrategy=he.CancellationSenderStrategy=he.CancellationReceiverStrategy=he.RequestCancellationReceiverStrategy=he.IdCancellationReceiverStrategy=he.ConnectionStrategy=he.ConnectionError=he.ConnectionErrors=he.LogTraceNotification=he.SetTraceNotification=he.TraceFormat=he.TraceValues=he.Trace=he.NullLogger=he.ProgressType=he.ProgressToken=void 0;var c_=Gr(),tt=ms(),oe=wf(),l_=Af(),Mo=ys(),Gf=yu(),qo;(function(t){t.type=new oe.NotificationType("$/cancelRequest")})(qo||(qo={}));var Vf;(function(t){function e(n){return typeof n=="string"||typeof n=="number"}t.is=e})(Vf||(he.ProgressToken=Vf={}));var Lo;(function(t){t.type=new oe.NotificationType("$/progress")})(Lo||(Lo={}));var zf=class{constructor(){}};he.ProgressType=zf;var Kf;(function(t){function e(n){return tt.func(n)}t.is=e})(Kf||(Kf={}));he.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Ce;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(Ce||(he.Trace=Ce={}));var d_;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(d_||(he.TraceValues=d_={}));(function(t){function e(r){if(!tt.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})(Ce||(he.Trace=Ce={}));var mn;(function(t){t.Text="text",t.JSON="json"})(mn||(he.TraceFormat=mn={}));(function(t){function e(n){return tt.string(n)?(n=n.toLowerCase(),n==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(mn||(he.TraceFormat=mn={}));var Xf;(function(t){t.type=new oe.NotificationType("$/setTrace")})(Xf||(he.SetTraceNotification=Xf={}));var Tu;(function(t){t.type=new oe.NotificationType("$/logTrace")})(Tu||(he.LogTraceNotification=Tu={}));var No;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(No||(he.ConnectionErrors=No={}));var Ss=class t extends Error{constructor(e,n){super(n),this.code=e,Object.setPrototypeOf(this,t.prototype)}};he.ConnectionError=Ss;var Yf;(function(t){function e(n){let r=n;return r&&tt.func(r.cancelUndispatched)}t.is=e})(Yf||(he.ConnectionStrategy=Yf={}));var wu;(function(t){function e(n){let r=n;return r&&(r.kind===void 0||r.kind==="id")&&tt.func(r.createCancellationTokenSource)&&(r.dispose===void 0||tt.func(r.dispose))}t.is=e})(wu||(he.IdCancellationReceiverStrategy=wu={}));var Jf;(function(t){function e(n){let r=n;return r&&r.kind==="request"&&tt.func(r.createCancellationTokenSource)&&(r.dispose===void 0||tt.func(r.dispose))}t.is=e})(Jf||(he.RequestCancellationReceiverStrategy=Jf={}));var Eu;(function(t){t.Message=Object.freeze({createCancellationTokenSource(n){return new Gf.CancellationTokenSource}});function e(n){return wu.is(n)||Jf.is(n)}t.is=e})(Eu||(he.CancellationReceiverStrategy=Eu={}));var Au;(function(t){t.Message=Object.freeze({sendCancellation(n,r){return n.sendNotification(qo.type,{id:r})},cleanup(n){}});function e(n){let r=n;return r&&tt.func(r.sendCancellation)&&tt.func(r.cleanup)}t.is=e})(Au||(he.CancellationSenderStrategy=Au={}));var xu;(function(t){t.Message=Object.freeze({receiver:Eu.Message,sender:Au.Message});function e(n){let r=n;return r&&Eu.is(r.receiver)&&Au.is(r.sender)}t.is=e})(xu||(he.CancellationStrategy=xu={}));var ku;(function(t){function e(n){let r=n;return r&&tt.func(r.handleMessage)}t.is=e})(ku||(he.MessageStrategy=ku={}));var f_;(function(t){function e(n){let r=n;return r&&(xu.is(r.cancellationStrategy)||Yf.is(r.connectionStrategy)||ku.is(r.messageStrategy))}t.is=e})(f_||(he.ConnectionOptions=f_={}));var Vn;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(Vn||(Vn={}));function iC(t,e,n,r){let i=n!==void 0?n:he.NullLogger,s=0,o=0,a=0,u="2.0",c,l=new Map,d,p=new Map,y=new Map,v,x=new l_.LinkedMap,I=new Map,P=new Set,w=new Map,E=Ce.Off,_=mn.Text,j,O=Vn.New,H=new Mo.Emitter,re=new Mo.Emitter,fe=new Mo.Emitter,U=new Mo.Emitter,k=new Mo.Emitter,M=r&&r.cancellationStrategy?r.cancellationStrategy:xu.Message;function L(S){if(S===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+S.toString()}function q(S){return S===null?"res-unknown-"+(++a).toString():"res-"+S.toString()}function ce(){return"not-"+(++o).toString()}function ae(S,F){oe.Message.isRequest(F)?S.set(L(F.id),F):oe.Message.isResponse(F)?S.set(q(F.id),F):S.set(ce(),F)}function Ct(S){}function dt(){return O===Vn.Listening}function Pe(){return O===Vn.Closed}function rn(){return O===Vn.Disposed}function ls(){(O===Vn.New||O===Vn.Listening)&&(O=Vn.Closed,re.fire(void 0))}function ki(S){H.fire([S,void 0,void 0])}function Ja(S){H.fire(S)}t.onClose(ls),t.onError(ki),e.onClose(ls),e.onError(Ja);function ko(){v||x.size===0||(v=(0,c_.default)().timer.setImmediate(()=>{v=void 0,Qa()}))}function Co(S){oe.Message.isRequest(S)?eu(S):oe.Message.isNotification(S)?nu(S):oe.Message.isResponse(S)?tu(S):ds(S)}function Qa(){if(x.size===0)return;let S=x.shift();try{let F=r?.messageStrategy;ku.is(F)?F.handleMessage(S,Co):Co(S)}finally{ko()}}let Za=S=>{try{if(oe.Message.isNotification(S)&&S.method===qo.type.method){let F=S.params.id,W=L(F),X=x.get(W);if(oe.Message.isRequest(X)){let De=r?.connectionStrategy,We=De&&De.cancelUndispatched?De.cancelUndispatched(X,Ct):void 0;if(We&&(We.error!==void 0||We.result!==void 0)){x.delete(W),w.delete(F),We.id=X.id,Ci(We,S.method,Date.now()),e.write(We).catch(()=>i.error("Sending response for canceled message failed."));return}}let qe=w.get(F);if(qe!==void 0){qe.cancel(),fs(S);return}else P.add(F)}ae(x,S)}finally{ko()}};function eu(S){if(rn())return;function F(_e,$e,Ae){let rt={jsonrpc:u,id:S.id};_e instanceof oe.ResponseError?rt.error=_e.toJson():rt.result=_e===void 0?null:_e,Ci(rt,$e,Ae),e.write(rt).catch(()=>i.error("Sending response failed."))}function W(_e,$e,Ae){let rt={jsonrpc:u,id:S.id,error:_e.toJson()};Ci(rt,$e,Ae),e.write(rt).catch(()=>i.error("Sending response failed."))}function X(_e,$e,Ae){_e===void 0&&(_e=null);let rt={jsonrpc:u,id:S.id,result:_e};Ci(rt,$e,Ae),e.write(rt).catch(()=>i.error("Sending response failed."))}su(S);let qe=l.get(S.method),De,We;qe&&(De=qe.type,We=qe.handler);let Ye=Date.now();if(We||c){let _e=S.id??String(Date.now()),$e=wu.is(M.receiver)?M.receiver.createCancellationTokenSource(_e):M.receiver.createCancellationTokenSource(S);S.id!==null&&P.has(S.id)&&$e.cancel(),S.id!==null&&w.set(_e,$e);try{let Ae;if(We)if(S.params===void 0){if(De!==void 0&&De.numberOfParams!==0){W(new oe.ResponseError(oe.ErrorCodes.InvalidParams,`Request ${S.method} defines ${De.numberOfParams} params but received none.`),S.method,Ye);return}Ae=We($e.token)}else if(Array.isArray(S.params)){if(De!==void 0&&De.parameterStructures===oe.ParameterStructures.byName){W(new oe.ResponseError(oe.ErrorCodes.InvalidParams,`Request ${S.method} defines parameters by name but received parameters by position`),S.method,Ye);return}Ae=We(...S.params,$e.token)}else{if(De!==void 0&&De.parameterStructures===oe.ParameterStructures.byPosition){W(new oe.ResponseError(oe.ErrorCodes.InvalidParams,`Request ${S.method} defines parameters by position but received parameters by name`),S.method,Ye);return}Ae=We(S.params,$e.token)}else c&&(Ae=c(S.method,S.params,$e.token));let rt=Ae;Ae?rt.then?rt.then(Ot=>{w.delete(_e),F(Ot,S.method,Ye)},Ot=>{w.delete(_e),Ot instanceof oe.ResponseError?W(Ot,S.method,Ye):Ot&&tt.string(Ot.message)?W(new oe.ResponseError(oe.ErrorCodes.InternalError,`Request ${S.method} failed with message: ${Ot.message}`),S.method,Ye):W(new oe.ResponseError(oe.ErrorCodes.InternalError,`Request ${S.method} failed unexpectedly without providing any details.`),S.method,Ye)}):(w.delete(_e),F(Ae,S.method,Ye)):(w.delete(_e),X(Ae,S.method,Ye))}catch(Ae){w.delete(_e),Ae instanceof oe.ResponseError?F(Ae,S.method,Ye):Ae&&tt.string(Ae.message)?W(new oe.ResponseError(oe.ErrorCodes.InternalError,`Request ${S.method} failed with message: ${Ae.message}`),S.method,Ye):W(new oe.ResponseError(oe.ErrorCodes.InternalError,`Request ${S.method} failed unexpectedly without providing any details.`),S.method,Ye)}}else W(new oe.ResponseError(oe.ErrorCodes.MethodNotFound,`Unhandled method ${S.method}`),S.method,Ye)}function tu(S){if(!rn())if(S.id===null)S.error?i.error(`Received response message without id: Error is:
6
- ${JSON.stringify(S.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let F=S.id,W=I.get(F);if(ou(S,W),W!==void 0){I.delete(F);try{if(S.error){let X=S.error;W.reject(new oe.ResponseError(X.code,X.message,X.data))}else if(S.result!==void 0)W.resolve(S.result);else throw new Error("Should never happen.")}catch(X){X.message?i.error(`Response handler '${W.method}' failed with message: ${X.message}`):i.error(`Response handler '${W.method}' failed unexpectedly.`)}}}}function nu(S){if(rn())return;let F,W;if(S.method===qo.type.method){let X=S.params.id;P.delete(X),fs(S);return}else{let X=p.get(S.method);X&&(W=X.handler,F=X.type)}if(W||d)try{if(fs(S),W)if(S.params===void 0)F!==void 0&&F.numberOfParams!==0&&F.parameterStructures!==oe.ParameterStructures.byName&&i.error(`Notification ${S.method} defines ${F.numberOfParams} params but received none.`),W();else if(Array.isArray(S.params)){let X=S.params;S.method===Lo.type.method&&X.length===2&&Vf.is(X[0])?W({token:X[0],value:X[1]}):(F!==void 0&&(F.parameterStructures===oe.ParameterStructures.byName&&i.error(`Notification ${S.method} defines parameters by name but received parameters by position`),F.numberOfParams!==S.params.length&&i.error(`Notification ${S.method} defines ${F.numberOfParams} params but received ${X.length} arguments`)),W(...X))}else F!==void 0&&F.parameterStructures===oe.ParameterStructures.byPosition&&i.error(`Notification ${S.method} defines parameters by position but received parameters by name`),W(S.params);else d&&d(S.method,S.params)}catch(X){X.message?i.error(`Notification handler '${S.method}' failed with message: ${X.message}`):i.error(`Notification handler '${S.method}' failed unexpectedly.`)}else fe.fire(S)}function ds(S){if(!S){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
1
+ "use strict";var Yd=Object.defineProperty;var Ck=Object.getOwnPropertyDescriptor;var Ok=Object.getOwnPropertyNames;var Rk=Object.prototype.hasOwnProperty;var Dk=(t,e)=>()=>(t&&(e=t(t=0)),e);var m=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ik=(t,e)=>{for(var n in e)Yd(t,n,{get:e[n],enumerable:!0})},Pk=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ok(e))!Rk.call(t,i)&&i!==n&&Yd(t,i,{get:()=>e[i],enumerable:!(r=Ck(e,i))||r.enumerable});return t};var Mk=t=>Pk(Yd({},"__esModule",{value:!0}),t);var du=m(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.thenable=yt.typedArray=yt.stringArray=yt.array=yt.func=yt.error=yt.number=yt.string=yt.boolean=void 0;function Lk(t){return t===!0||t===!1}yt.boolean=Lk;function Wb(t){return typeof t=="string"||t instanceof String}yt.string=Wb;function Nk(t){return typeof t=="number"||t instanceof Number}yt.number=Nk;function qk(t){return t instanceof Error}yt.error=qk;function Gb(t){return typeof t=="function"}yt.func=Gb;function Vb(t){return Array.isArray(t)}yt.array=Vb;function jk(t){return Vb(t)&&t.every(e=>Wb(e))}yt.stringArray=jk;function Fk(t,e){return Array.isArray(t)&&t.every(e)}yt.typedArray=Fk;function $k(t){return t&&Gb(t.then)}yt.thenable=$k});var ms=m(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.stringArray=Ft.array=Ft.func=Ft.error=Ft.number=Ft.string=Ft.boolean=void 0;function Bk(t){return t===!0||t===!1}Ft.boolean=Bk;function zb(t){return typeof t=="string"||t instanceof String}Ft.string=zb;function Uk(t){return typeof t=="number"||t instanceof Number}Ft.number=Uk;function Hk(t){return t instanceof Error}Ft.error=Hk;function Wk(t){return typeof t=="function"}Ft.func=Wk;function Kb(t){return Array.isArray(t)}Ft.array=Kb;function Gk(t){return Kb(t)&&t.every(e=>zb(e))}Ft.stringArray=Gk});var Tf=m(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.Message=Q.NotificationType9=Q.NotificationType8=Q.NotificationType7=Q.NotificationType6=Q.NotificationType5=Q.NotificationType4=Q.NotificationType3=Q.NotificationType2=Q.NotificationType1=Q.NotificationType0=Q.NotificationType=Q.RequestType9=Q.RequestType8=Q.RequestType7=Q.RequestType6=Q.RequestType5=Q.RequestType4=Q.RequestType3=Q.RequestType2=Q.RequestType1=Q.RequestType=Q.RequestType0=Q.AbstractMessageSignature=Q.ParameterStructures=Q.ResponseError=Q.ErrorCodes=void 0;var Oi=ms(),Jd;(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})(Jd||(Q.ErrorCodes=Jd={}));var Qd=class t extends Error{constructor(e,n,r){super(n),this.code=Oi.number(e)?e:Jd.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}};Q.ResponseError=Qd;var sn=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};Q.ParameterStructures=sn;sn.auto=new sn("auto");sn.byPosition=new sn("byPosition");sn.byName=new sn("byName");var Ge=class{constructor(e,n){this.method=e,this.numberOfParams=n}get parameterStructures(){return sn.auto}};Q.AbstractMessageSignature=Ge;var Zd=class extends Ge{constructor(e){super(e,0)}};Q.RequestType0=Zd;var ef=class extends Ge{constructor(e,n=sn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Q.RequestType=ef;var tf=class extends Ge{constructor(e,n=sn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Q.RequestType1=tf;var nf=class extends Ge{constructor(e){super(e,2)}};Q.RequestType2=nf;var rf=class extends Ge{constructor(e){super(e,3)}};Q.RequestType3=rf;var sf=class extends Ge{constructor(e){super(e,4)}};Q.RequestType4=sf;var of=class extends Ge{constructor(e){super(e,5)}};Q.RequestType5=of;var af=class extends Ge{constructor(e){super(e,6)}};Q.RequestType6=af;var uf=class extends Ge{constructor(e){super(e,7)}};Q.RequestType7=uf;var cf=class extends Ge{constructor(e){super(e,8)}};Q.RequestType8=cf;var lf=class extends Ge{constructor(e){super(e,9)}};Q.RequestType9=lf;var df=class extends Ge{constructor(e,n=sn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Q.NotificationType=df;var ff=class extends Ge{constructor(e){super(e,0)}};Q.NotificationType0=ff;var pf=class extends Ge{constructor(e,n=sn.auto){super(e,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};Q.NotificationType1=pf;var hf=class extends Ge{constructor(e){super(e,2)}};Q.NotificationType2=hf;var mf=class extends Ge{constructor(e){super(e,3)}};Q.NotificationType3=mf;var gf=class extends Ge{constructor(e){super(e,4)}};Q.NotificationType4=gf;var yf=class extends Ge{constructor(e){super(e,5)}};Q.NotificationType5=yf;var bf=class extends Ge{constructor(e){super(e,6)}};Q.NotificationType6=bf;var _f=class extends Ge{constructor(e){super(e,7)}};Q.NotificationType7=_f;var vf=class extends Ge{constructor(e){super(e,8)}};Q.NotificationType8=vf;var Sf=class extends Ge{constructor(e){super(e,9)}};Q.NotificationType9=Sf;var Xb;(function(t){function e(i){let s=i;return s&&Oi.string(s.method)&&(Oi.string(s.id)||Oi.number(s.id))}t.isRequest=e;function n(i){let s=i;return s&&Oi.string(s.method)&&i.id===void 0}t.isNotification=n;function r(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&(Oi.string(s.id)||Oi.number(s.id)||s.id===null)}t.isResponse=r})(Xb||(Q.Message=Xb={}))});var Ef=m(Wr=>{"use strict";var Yb;Object.defineProperty(Wr,"__esModule",{value:!0});Wr.LRUCache=Wr.LinkedMap=Wr.Touch=void 0;var $t;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})($t||(Wr.Touch=$t={}));var fu=class{constructor(){this[Yb]="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=$t.None){let r=this._map.get(e);if(r)return n!==$t.None&&this.touch(r,n),r.value}set(e,n,r=$t.None){let i=this._map.get(e);if(i)i.value=n,r!==$t.None&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case $t.None:this.addItemLast(i);break;case $t.First:this.addItemFirst(i);break;case $t.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}[(Yb=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!==$t.First&&n!==$t.Last)){if(n===$t.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===$t.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)}};Wr.LinkedMap=fu;var wf=class extends fu{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=$t.AsNew){return super.get(e,n)}peek(e){return super.get(e,$t.None)}set(e,n){return super.set(e,n,$t.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Wr.LRUCache=wf});var Qb=m(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.Disposable=void 0;var Jb;(function(t){function e(n){return{dispose:n}}t.create=e})(Jb||(pu.Disposable=Jb={}))});var Gr=m(kf=>{"use strict";Object.defineProperty(kf,"__esModule",{value:!0});var Af;function xf(){if(Af===void 0)throw new Error("No runtime abstraction layer installed");return Af}(function(t){function e(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");Af=n}t.install=e})(xf||(xf={}));kf.default=xf});var ys=m(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.Emitter=gs.Event=void 0;var Vk=Gr(),Zb;(function(t){let e={dispose(){}};t.None=function(){return e}})(Zb||(gs.Event=Zb={}));var Cf=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,Vk.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},hu=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,n,r)=>{this._callbacks||(this._callbacks=new Cf),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)}};gs.Emitter=hu;hu._noop=function(){}});var yu=m(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});bs.CancellationTokenSource=bs.CancellationToken=void 0;var zk=Gr(),Kk=ms(),Of=ys(),mu;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Of.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Of.Event.None});function e(n){let r=n;return r&&(r===t.None||r===t.Cancelled||Kk.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}t.is=e})(mu||(bs.CancellationToken=mu={}));var Xk=Object.freeze(function(t,e){let n=(0,zk.default)().timer.setTimeout(t.bind(e),0);return{dispose(){n.dispose()}}}),gu=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?Xk:(this._emitter||(this._emitter=new Of.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Rf=class{get token(){return this._token||(this._token=new gu),this._token}cancel(){this._token?this._token.cancel():this._token=mu.Cancelled}dispose(){this._token?this._token instanceof gu&&this._token.dispose():this._token=mu.None}};bs.CancellationTokenSource=Rf});var e_=m(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.SharedArrayReceiverStrategy=_s.SharedArraySenderStrategy=void 0;var Yk=yu(),Io;(function(t){t.Continue=0,t.Cancelled=1})(Io||(Io={}));var Df=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]=Io.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,Io.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};_s.SharedArraySenderStrategy=Df;var If=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Io.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},Pf=class{constructor(e){this.token=new If(e)}cancel(){}dispose(){}},Mf=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let n=e.$cancellationData;return n===void 0?new Yk.CancellationTokenSource:new Pf(n)}};_s.SharedArrayReceiverStrategy=Mf});var Nf=m(bu=>{"use strict";Object.defineProperty(bu,"__esModule",{value:!0});bu.Semaphore=void 0;var Jk=Gr(),Lf=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,Jk.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()}}};bu.Semaphore=Lf});var n_=m(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.ReadableStreamMessageReader=Vr.AbstractMessageReader=Vr.MessageReader=void 0;var jf=Gr(),vs=ms(),qf=ys(),Qk=Nf(),t_;(function(t){function e(n){let r=n;return r&&vs.func(r.listen)&&vs.func(r.dispose)&&vs.func(r.onError)&&vs.func(r.onClose)&&vs.func(r.onPartialMessage)}t.is=e})(t_||(Vr.MessageReader=t_={}));var _u=class{constructor(){this.errorEmitter=new qf.Emitter,this.closeEmitter=new qf.Emitter,this.partialMessageEmitter=new qf.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: ${vs.string(e.message)?e.message:"unknown"}`)}};Vr.AbstractMessageReader=_u;var Ff;(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,jf.default)().applicationJson.decoder,u.set(a.name,a)),{charset:r,contentDecoder:s,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:u}}t.fromOptions=e})(Ff||(Ff={}));var $f=class extends _u{constructor(e,n){super(),this.readable=e,this.options=Ff.fromOptions(n),this.buffer=(0,jf.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new Qk.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,jf.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))}};Vr.ReadableStreamMessageReader=$f});var a_=m(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.WriteableStreamMessageWriter=zr.AbstractMessageWriter=zr.MessageWriter=void 0;var r_=Gr(),Po=ms(),Zk=Nf(),i_=ys(),eC="Content-Length: ",s_=`\r
3
+ `,o_;(function(t){function e(n){let r=n;return r&&Po.func(r.dispose)&&Po.func(r.onClose)&&Po.func(r.onError)&&Po.func(r.write)}t.is=e})(o_||(zr.MessageWriter=o_={}));var vu=class{constructor(){this.errorEmitter=new i_.Emitter,this.closeEmitter=new i_.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: ${Po.string(e.message)?e.message:"unknown"}`)}};zr.AbstractMessageWriter=vu;var Bf;(function(t){function e(n){return n===void 0||typeof n=="string"?{charset:n??"utf-8",contentTypeEncoder:(0,r_.default)().applicationJson.encoder}:{charset:n.charset??"utf-8",contentEncoder:n.contentEncoder,contentTypeEncoder:n.contentTypeEncoder??(0,r_.default)().applicationJson.encoder}}t.fromOptions=e})(Bf||(Bf={}));var Uf=class extends vu{constructor(e,n){super(),this.writable=e,this.options=Bf.fromOptions(n),this.errorCount=0,this.writeSemaphore=new Zk.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(eC,r.byteLength.toString(),s_),i.push(s_),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()}};zr.WriteableStreamMessageWriter=Uf});var u_=m(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});Su.AbstractMessageBuffer=void 0;var tC=13,nC=10,rC=`\r
4
+ `,Hf=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 tC:switch(n){case 0:n=1;break;case 2:n=3;break;default:n=0}break;case nC: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(rC);if(u.length<2)return a;for(let c=0;c<u.length-2;c++){let l=u[c],d=l.indexOf(":");if(d===-1)throw new Error(`Message header must separate key and value using ':'
5
+ ${l}`);let p=l.substr(0,d),y=l.substr(d+1).trim();a.set(e?p.toLowerCase():p,y)}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}};Su.AbstractMessageBuffer=Hf});var p_=m(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.createMessageConnection=he.ConnectionOptions=he.MessageStrategy=he.CancellationStrategy=he.CancellationSenderStrategy=he.CancellationReceiverStrategy=he.RequestCancellationReceiverStrategy=he.IdCancellationReceiverStrategy=he.ConnectionStrategy=he.ConnectionError=he.ConnectionErrors=he.LogTraceNotification=he.SetTraceNotification=he.TraceFormat=he.TraceValues=he.Trace=he.NullLogger=he.ProgressType=he.ProgressToken=void 0;var c_=Gr(),tt=ms(),oe=Tf(),l_=Ef(),Mo=ys(),Wf=yu(),qo;(function(t){t.type=new oe.NotificationType("$/cancelRequest")})(qo||(qo={}));var Gf;(function(t){function e(n){return typeof n=="string"||typeof n=="number"}t.is=e})(Gf||(he.ProgressToken=Gf={}));var Lo;(function(t){t.type=new oe.NotificationType("$/progress")})(Lo||(Lo={}));var Vf=class{constructor(){}};he.ProgressType=Vf;var zf;(function(t){function e(n){return tt.func(n)}t.is=e})(zf||(zf={}));he.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Ce;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(Ce||(he.Trace=Ce={}));var d_;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(d_||(he.TraceValues=d_={}));(function(t){function e(r){if(!tt.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})(Ce||(he.Trace=Ce={}));var mn;(function(t){t.Text="text",t.JSON="json"})(mn||(he.TraceFormat=mn={}));(function(t){function e(n){return tt.string(n)?(n=n.toLowerCase(),n==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(mn||(he.TraceFormat=mn={}));var Kf;(function(t){t.type=new oe.NotificationType("$/setTrace")})(Kf||(he.SetTraceNotification=Kf={}));var Tu;(function(t){t.type=new oe.NotificationType("$/logTrace")})(Tu||(he.LogTraceNotification=Tu={}));var No;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(No||(he.ConnectionErrors=No={}));var Ss=class t extends Error{constructor(e,n){super(n),this.code=e,Object.setPrototypeOf(this,t.prototype)}};he.ConnectionError=Ss;var Xf;(function(t){function e(n){let r=n;return r&&tt.func(r.cancelUndispatched)}t.is=e})(Xf||(he.ConnectionStrategy=Xf={}));var wu;(function(t){function e(n){let r=n;return r&&(r.kind===void 0||r.kind==="id")&&tt.func(r.createCancellationTokenSource)&&(r.dispose===void 0||tt.func(r.dispose))}t.is=e})(wu||(he.IdCancellationReceiverStrategy=wu={}));var Yf;(function(t){function e(n){let r=n;return r&&r.kind==="request"&&tt.func(r.createCancellationTokenSource)&&(r.dispose===void 0||tt.func(r.dispose))}t.is=e})(Yf||(he.RequestCancellationReceiverStrategy=Yf={}));var Eu;(function(t){t.Message=Object.freeze({createCancellationTokenSource(n){return new Wf.CancellationTokenSource}});function e(n){return wu.is(n)||Yf.is(n)}t.is=e})(Eu||(he.CancellationReceiverStrategy=Eu={}));var Au;(function(t){t.Message=Object.freeze({sendCancellation(n,r){return n.sendNotification(qo.type,{id:r})},cleanup(n){}});function e(n){let r=n;return r&&tt.func(r.sendCancellation)&&tt.func(r.cleanup)}t.is=e})(Au||(he.CancellationSenderStrategy=Au={}));var xu;(function(t){t.Message=Object.freeze({receiver:Eu.Message,sender:Au.Message});function e(n){let r=n;return r&&Eu.is(r.receiver)&&Au.is(r.sender)}t.is=e})(xu||(he.CancellationStrategy=xu={}));var ku;(function(t){function e(n){let r=n;return r&&tt.func(r.handleMessage)}t.is=e})(ku||(he.MessageStrategy=ku={}));var f_;(function(t){function e(n){let r=n;return r&&(xu.is(r.cancellationStrategy)||Xf.is(r.connectionStrategy)||ku.is(r.messageStrategy))}t.is=e})(f_||(he.ConnectionOptions=f_={}));var Vn;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(Vn||(Vn={}));function iC(t,e,n,r){let i=n!==void 0?n:he.NullLogger,s=0,o=0,a=0,u="2.0",c,l=new Map,d,p=new Map,y=new Map,v,x=new l_.LinkedMap,I=new Map,P=new Set,w=new Map,E=Ce.Off,_=mn.Text,j,O=Vn.New,H=new Mo.Emitter,re=new Mo.Emitter,fe=new Mo.Emitter,U=new Mo.Emitter,k=new Mo.Emitter,M=r&&r.cancellationStrategy?r.cancellationStrategy:xu.Message;function L(S){if(S===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+S.toString()}function q(S){return S===null?"res-unknown-"+(++a).toString():"res-"+S.toString()}function ce(){return"not-"+(++o).toString()}function ae(S,F){oe.Message.isRequest(F)?S.set(L(F.id),F):oe.Message.isResponse(F)?S.set(q(F.id),F):S.set(ce(),F)}function Ct(S){}function dt(){return O===Vn.Listening}function Pe(){return O===Vn.Closed}function rn(){return O===Vn.Disposed}function ls(){(O===Vn.New||O===Vn.Listening)&&(O=Vn.Closed,re.fire(void 0))}function ki(S){H.fire([S,void 0,void 0])}function Ja(S){H.fire(S)}t.onClose(ls),t.onError(ki),e.onClose(ls),e.onError(Ja);function ko(){v||x.size===0||(v=(0,c_.default)().timer.setImmediate(()=>{v=void 0,Qa()}))}function Co(S){oe.Message.isRequest(S)?eu(S):oe.Message.isNotification(S)?nu(S):oe.Message.isResponse(S)?tu(S):ds(S)}function Qa(){if(x.size===0)return;let S=x.shift();try{let F=r?.messageStrategy;ku.is(F)?F.handleMessage(S,Co):Co(S)}finally{ko()}}let Za=S=>{try{if(oe.Message.isNotification(S)&&S.method===qo.type.method){let F=S.params.id,W=L(F),X=x.get(W);if(oe.Message.isRequest(X)){let De=r?.connectionStrategy,We=De&&De.cancelUndispatched?De.cancelUndispatched(X,Ct):void 0;if(We&&(We.error!==void 0||We.result!==void 0)){x.delete(W),w.delete(F),We.id=X.id,Ci(We,S.method,Date.now()),e.write(We).catch(()=>i.error("Sending response for canceled message failed."));return}}let qe=w.get(F);if(qe!==void 0){qe.cancel(),fs(S);return}else P.add(F)}ae(x,S)}finally{ko()}};function eu(S){if(rn())return;function F(_e,$e,Ae){let rt={jsonrpc:u,id:S.id};_e instanceof oe.ResponseError?rt.error=_e.toJson():rt.result=_e===void 0?null:_e,Ci(rt,$e,Ae),e.write(rt).catch(()=>i.error("Sending response failed."))}function W(_e,$e,Ae){let rt={jsonrpc:u,id:S.id,error:_e.toJson()};Ci(rt,$e,Ae),e.write(rt).catch(()=>i.error("Sending response failed."))}function X(_e,$e,Ae){_e===void 0&&(_e=null);let rt={jsonrpc:u,id:S.id,result:_e};Ci(rt,$e,Ae),e.write(rt).catch(()=>i.error("Sending response failed."))}su(S);let qe=l.get(S.method),De,We;qe&&(De=qe.type,We=qe.handler);let Ye=Date.now();if(We||c){let _e=S.id??String(Date.now()),$e=wu.is(M.receiver)?M.receiver.createCancellationTokenSource(_e):M.receiver.createCancellationTokenSource(S);S.id!==null&&P.has(S.id)&&$e.cancel(),S.id!==null&&w.set(_e,$e);try{let Ae;if(We)if(S.params===void 0){if(De!==void 0&&De.numberOfParams!==0){W(new oe.ResponseError(oe.ErrorCodes.InvalidParams,`Request ${S.method} defines ${De.numberOfParams} params but received none.`),S.method,Ye);return}Ae=We($e.token)}else if(Array.isArray(S.params)){if(De!==void 0&&De.parameterStructures===oe.ParameterStructures.byName){W(new oe.ResponseError(oe.ErrorCodes.InvalidParams,`Request ${S.method} defines parameters by name but received parameters by position`),S.method,Ye);return}Ae=We(...S.params,$e.token)}else{if(De!==void 0&&De.parameterStructures===oe.ParameterStructures.byPosition){W(new oe.ResponseError(oe.ErrorCodes.InvalidParams,`Request ${S.method} defines parameters by position but received parameters by name`),S.method,Ye);return}Ae=We(S.params,$e.token)}else c&&(Ae=c(S.method,S.params,$e.token));let rt=Ae;Ae?rt.then?rt.then(Ot=>{w.delete(_e),F(Ot,S.method,Ye)},Ot=>{w.delete(_e),Ot instanceof oe.ResponseError?W(Ot,S.method,Ye):Ot&&tt.string(Ot.message)?W(new oe.ResponseError(oe.ErrorCodes.InternalError,`Request ${S.method} failed with message: ${Ot.message}`),S.method,Ye):W(new oe.ResponseError(oe.ErrorCodes.InternalError,`Request ${S.method} failed unexpectedly without providing any details.`),S.method,Ye)}):(w.delete(_e),F(Ae,S.method,Ye)):(w.delete(_e),X(Ae,S.method,Ye))}catch(Ae){w.delete(_e),Ae instanceof oe.ResponseError?F(Ae,S.method,Ye):Ae&&tt.string(Ae.message)?W(new oe.ResponseError(oe.ErrorCodes.InternalError,`Request ${S.method} failed with message: ${Ae.message}`),S.method,Ye):W(new oe.ResponseError(oe.ErrorCodes.InternalError,`Request ${S.method} failed unexpectedly without providing any details.`),S.method,Ye)}}else W(new oe.ResponseError(oe.ErrorCodes.MethodNotFound,`Unhandled method ${S.method}`),S.method,Ye)}function tu(S){if(!rn())if(S.id===null)S.error?i.error(`Received response message without id: Error is:
6
+ ${JSON.stringify(S.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let F=S.id,W=I.get(F);if(ou(S,W),W!==void 0){I.delete(F);try{if(S.error){let X=S.error;W.reject(new oe.ResponseError(X.code,X.message,X.data))}else if(S.result!==void 0)W.resolve(S.result);else throw new Error("Should never happen.")}catch(X){X.message?i.error(`Response handler '${W.method}' failed with message: ${X.message}`):i.error(`Response handler '${W.method}' failed unexpectedly.`)}}}}function nu(S){if(rn())return;let F,W;if(S.method===qo.type.method){let X=S.params.id;P.delete(X),fs(S);return}else{let X=p.get(S.method);X&&(W=X.handler,F=X.type)}if(W||d)try{if(fs(S),W)if(S.params===void 0)F!==void 0&&F.numberOfParams!==0&&F.parameterStructures!==oe.ParameterStructures.byName&&i.error(`Notification ${S.method} defines ${F.numberOfParams} params but received none.`),W();else if(Array.isArray(S.params)){let X=S.params;S.method===Lo.type.method&&X.length===2&&Gf.is(X[0])?W({token:X[0],value:X[1]}):(F!==void 0&&(F.parameterStructures===oe.ParameterStructures.byName&&i.error(`Notification ${S.method} defines parameters by name but received parameters by position`),F.numberOfParams!==S.params.length&&i.error(`Notification ${S.method} defines ${F.numberOfParams} params but received ${X.length} arguments`)),W(...X))}else F!==void 0&&F.parameterStructures===oe.ParameterStructures.byPosition&&i.error(`Notification ${S.method} defines parameters by position but received parameters by name`),W(S.params);else d&&d(S.method,S.params)}catch(X){X.message?i.error(`Notification handler '${S.method}' failed with message: ${X.message}`):i.error(`Notification handler '${S.method}' failed unexpectedly.`)}else fe.fire(S)}function ds(S){if(!S){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
7
7
  ${JSON.stringify(S,null,4)}`);let F=S;if(tt.string(F.id)||tt.number(F.id)){let W=F.id,X=I.get(W);X&&X.reject(new Error("The received response has neither a result nor an error property."))}}function Hn(S){if(S!=null)switch(E){case Ce.Verbose:return JSON.stringify(S,null,4);case Ce.Compact:return JSON.stringify(S);default:return}}function ru(S){if(!(E===Ce.Off||!j))if(_===mn.Text){let F;(E===Ce.Verbose||E===Ce.Compact)&&S.params&&(F=`Params: ${Hn(S.params)}
8
8
 
9
9
  `),j.log(`Sending request '${S.method} - (${S.id})'.`,F)}else wr("send-request",S)}function iu(S){if(!(E===Ce.Off||!j))if(_===mn.Text){let F;(E===Ce.Verbose||E===Ce.Compact)&&(S.params?F=`Params: ${Hn(S.params)}
@@ -28,62 +28,62 @@ ${JSON.stringify(S,null,4)}`);let F=S;if(tt.string(F.id)||tt.number(F.id)){let W
28
28
 
29
29
  `:S.error===void 0&&(W=`No result returned.
30
30
 
31
- `)),F){let X=S.error?` Request failed: ${S.error.message} (${S.error.code}).`:"";j.log(`Received response '${F.method} - (${S.id})' in ${Date.now()-F.timerStart}ms.${X}`,W)}else j.log(`Received response ${S.id} without active response promise.`,W)}else wr("receive-response",S)}function wr(S,F){if(!j||E===Ce.Off)return;let W={isLSPMessage:!0,type:S,message:F,timestamp:Date.now()};j.log(W)}function Hr(){if(Pe())throw new Ss(No.Closed,"Connection is closed.");if(rn())throw new Ss(No.Disposed,"Connection is disposed.")}function au(){if(dt())throw new Ss(No.AlreadyListening,"Connection is already listening")}function uu(){if(!dt())throw new Error("Call listen() first.")}function rr(S){return S===void 0?null:S}function Oo(S){if(S!==null)return S}function Ro(S){return S!=null&&!Array.isArray(S)&&typeof S=="object"}function ps(S,F){switch(S){case oe.ParameterStructures.auto:return Ro(F)?Oo(F):[rr(F)];case oe.ParameterStructures.byName:if(!Ro(F))throw new Error("Received parameters by name but param is not an object literal.");return Oo(F);case oe.ParameterStructures.byPosition:return[rr(F)];default:throw new Error(`Unknown parameter structure ${S.toString()}`)}}function Do(S,F){let W,X=S.numberOfParams;switch(X){case 0:W=void 0;break;case 1:W=ps(S.parameterStructures,F[0]);break;default:W=[];for(let qe=0;qe<F.length&&qe<X;qe++)W.push(rr(F[qe]));if(F.length<X)for(let qe=F.length;qe<X;qe++)W.push(null);break}return W}let Er={sendNotification:(S,...F)=>{Hr();let W,X;if(tt.string(S)){W=S;let De=F[0],We=0,Ye=oe.ParameterStructures.auto;oe.ParameterStructures.is(De)&&(We=1,Ye=De);let _e=F.length,$e=_e-We;switch($e){case 0:X=void 0;break;case 1:X=ps(Ye,F[We]);break;default:if(Ye===oe.ParameterStructures.byName)throw new Error(`Received ${$e} parameters for 'by Name' notification parameter structure.`);X=F.slice(We,_e).map(Ae=>rr(Ae));break}}else{let De=F;W=S.method,X=Do(S,De)}let qe={jsonrpc:u,method:W,params:X};return iu(qe),e.write(qe).catch(De=>{throw i.error("Sending notification failed."),De})},onNotification:(S,F)=>{Hr();let W;return tt.func(S)?d=S:F&&(tt.string(S)?(W=S,p.set(S,{type:void 0,handler:F})):(W=S.method,p.set(S.method,{type:S,handler:F}))),{dispose:()=>{W!==void 0?p.delete(W):d=void 0}}},onProgress:(S,F,W)=>{if(y.has(F))throw new Error(`Progress handler for token ${F} already registered`);return y.set(F,W),{dispose:()=>{y.delete(F)}}},sendProgress:(S,F,W)=>Er.sendNotification(Lo.type,{token:F,value:W}),onUnhandledProgress:U.event,sendRequest:(S,...F)=>{Hr(),uu();let W,X,qe;if(tt.string(S)){W=S;let _e=F[0],$e=F[F.length-1],Ae=0,rt=oe.ParameterStructures.auto;oe.ParameterStructures.is(_e)&&(Ae=1,rt=_e);let Ot=F.length;Gf.CancellationToken.is($e)&&(Ot=Ot-1,qe=$e);let hn=Ot-Ae;switch(hn){case 0:X=void 0;break;case 1:X=ps(rt,F[Ae]);break;default:if(rt===oe.ParameterStructures.byName)throw new Error(`Received ${hn} parameters for 'by Name' request parameter structure.`);X=F.slice(Ae,Ot).map(cu=>rr(cu));break}}else{let _e=F;W=S.method,X=Do(S,_e);let $e=S.numberOfParams;qe=Gf.CancellationToken.is(_e[$e])?_e[$e]:void 0}let De=s++,We;qe&&(We=qe.onCancellationRequested(()=>{let _e=M.sender.sendCancellation(Er,De);return _e===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${De}`),Promise.resolve()):_e.catch(()=>{i.log(`Sending cancellation messages for id ${De} failed`)})}));let Ye={jsonrpc:u,id:De,method:W,params:X};return ru(Ye),typeof M.sender.enableCancellation=="function"&&M.sender.enableCancellation(Ye),new Promise(async(_e,$e)=>{let Ae=hn=>{_e(hn),M.sender.cleanup(De),We?.dispose()},rt=hn=>{$e(hn),M.sender.cleanup(De),We?.dispose()},Ot={method:W,timerStart:Date.now(),resolve:Ae,reject:rt};try{await e.write(Ye),I.set(De,Ot)}catch(hn){throw i.error("Sending request failed."),Ot.reject(new oe.ResponseError(oe.ErrorCodes.MessageWriteError,hn.message?hn.message:"Unknown reason")),hn}})},onRequest:(S,F)=>{Hr();let W=null;return Kf.is(S)?(W=void 0,c=S):tt.string(S)?(W=null,F!==void 0&&(W=S,l.set(S,{handler:F,type:void 0}))):F!==void 0&&(W=S.method,l.set(S.method,{type:S,handler:F})),{dispose:()=>{W!==null&&(W!==void 0?l.delete(W):c=void 0)}}},hasPendingResponse:()=>I.size>0,trace:async(S,F,W)=>{let X=!1,qe=mn.Text;W!==void 0&&(tt.boolean(W)?X=W:(X=W.sendNotification||!1,qe=W.traceFormat||mn.Text)),E=S,_=qe,E===Ce.Off?j=void 0:j=F,X&&!Pe()&&!rn()&&await Er.sendNotification(Xf.type,{value:Ce.toString(S)})},onError:H.event,onClose:re.event,onUnhandledNotification:fe.event,onDispose:k.event,end:()=>{e.end()},dispose:()=>{if(rn())return;O=Vn.Disposed,k.fire(void 0);let S=new oe.ResponseError(oe.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let F of I.values())F.reject(S);I=new Map,w=new Map,P=new Set,x=new l_.LinkedMap,tt.func(e.dispose)&&e.dispose(),tt.func(t.dispose)&&t.dispose()},listen:()=>{Hr(),au(),O=Vn.Listening,t.listen(Za)},inspect:()=>{(0,c_.default)().console.log("inspect")}};return Er.onNotification(Tu.type,S=>{if(E===Ce.Off||!j)return;let F=E===Ce.Verbose||E===Ce.Compact;j.log(S.message,F?S.verbose:void 0)}),Er.onNotification(Lo.type,S=>{let F=y.get(S.token);F?F(S.value):U.fire(S)}),Er}he.createMessageConnection=iC});var Cu=m(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.ProgressType=N.ProgressToken=N.createMessageConnection=N.NullLogger=N.ConnectionOptions=N.ConnectionStrategy=N.AbstractMessageBuffer=N.WriteableStreamMessageWriter=N.AbstractMessageWriter=N.MessageWriter=N.ReadableStreamMessageReader=N.AbstractMessageReader=N.MessageReader=N.SharedArrayReceiverStrategy=N.SharedArraySenderStrategy=N.CancellationToken=N.CancellationTokenSource=N.Emitter=N.Event=N.Disposable=N.LRUCache=N.Touch=N.LinkedMap=N.ParameterStructures=N.NotificationType9=N.NotificationType8=N.NotificationType7=N.NotificationType6=N.NotificationType5=N.NotificationType4=N.NotificationType3=N.NotificationType2=N.NotificationType1=N.NotificationType0=N.NotificationType=N.ErrorCodes=N.ResponseError=N.RequestType9=N.RequestType8=N.RequestType7=N.RequestType6=N.RequestType5=N.RequestType4=N.RequestType3=N.RequestType2=N.RequestType1=N.RequestType0=N.RequestType=N.Message=N.RAL=void 0;N.MessageStrategy=N.CancellationStrategy=N.CancellationSenderStrategy=N.CancellationReceiverStrategy=N.ConnectionError=N.ConnectionErrors=N.LogTraceNotification=N.SetTraceNotification=N.TraceFormat=N.TraceValues=N.Trace=void 0;var Ue=wf();Object.defineProperty(N,"Message",{enumerable:!0,get:function(){return Ue.Message}});Object.defineProperty(N,"RequestType",{enumerable:!0,get:function(){return Ue.RequestType}});Object.defineProperty(N,"RequestType0",{enumerable:!0,get:function(){return Ue.RequestType0}});Object.defineProperty(N,"RequestType1",{enumerable:!0,get:function(){return Ue.RequestType1}});Object.defineProperty(N,"RequestType2",{enumerable:!0,get:function(){return Ue.RequestType2}});Object.defineProperty(N,"RequestType3",{enumerable:!0,get:function(){return Ue.RequestType3}});Object.defineProperty(N,"RequestType4",{enumerable:!0,get:function(){return Ue.RequestType4}});Object.defineProperty(N,"RequestType5",{enumerable:!0,get:function(){return Ue.RequestType5}});Object.defineProperty(N,"RequestType6",{enumerable:!0,get:function(){return Ue.RequestType6}});Object.defineProperty(N,"RequestType7",{enumerable:!0,get:function(){return Ue.RequestType7}});Object.defineProperty(N,"RequestType8",{enumerable:!0,get:function(){return Ue.RequestType8}});Object.defineProperty(N,"RequestType9",{enumerable:!0,get:function(){return Ue.RequestType9}});Object.defineProperty(N,"ResponseError",{enumerable:!0,get:function(){return Ue.ResponseError}});Object.defineProperty(N,"ErrorCodes",{enumerable:!0,get:function(){return Ue.ErrorCodes}});Object.defineProperty(N,"NotificationType",{enumerable:!0,get:function(){return Ue.NotificationType}});Object.defineProperty(N,"NotificationType0",{enumerable:!0,get:function(){return Ue.NotificationType0}});Object.defineProperty(N,"NotificationType1",{enumerable:!0,get:function(){return Ue.NotificationType1}});Object.defineProperty(N,"NotificationType2",{enumerable:!0,get:function(){return Ue.NotificationType2}});Object.defineProperty(N,"NotificationType3",{enumerable:!0,get:function(){return Ue.NotificationType3}});Object.defineProperty(N,"NotificationType4",{enumerable:!0,get:function(){return Ue.NotificationType4}});Object.defineProperty(N,"NotificationType5",{enumerable:!0,get:function(){return Ue.NotificationType5}});Object.defineProperty(N,"NotificationType6",{enumerable:!0,get:function(){return Ue.NotificationType6}});Object.defineProperty(N,"NotificationType7",{enumerable:!0,get:function(){return Ue.NotificationType7}});Object.defineProperty(N,"NotificationType8",{enumerable:!0,get:function(){return Ue.NotificationType8}});Object.defineProperty(N,"NotificationType9",{enumerable:!0,get:function(){return Ue.NotificationType9}});Object.defineProperty(N,"ParameterStructures",{enumerable:!0,get:function(){return Ue.ParameterStructures}});var Qf=Af();Object.defineProperty(N,"LinkedMap",{enumerable:!0,get:function(){return Qf.LinkedMap}});Object.defineProperty(N,"LRUCache",{enumerable:!0,get:function(){return Qf.LRUCache}});Object.defineProperty(N,"Touch",{enumerable:!0,get:function(){return Qf.Touch}});var sC=Qb();Object.defineProperty(N,"Disposable",{enumerable:!0,get:function(){return sC.Disposable}});var h_=ys();Object.defineProperty(N,"Event",{enumerable:!0,get:function(){return h_.Event}});Object.defineProperty(N,"Emitter",{enumerable:!0,get:function(){return h_.Emitter}});var m_=yu();Object.defineProperty(N,"CancellationTokenSource",{enumerable:!0,get:function(){return m_.CancellationTokenSource}});Object.defineProperty(N,"CancellationToken",{enumerable:!0,get:function(){return m_.CancellationToken}});var g_=e_();Object.defineProperty(N,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return g_.SharedArraySenderStrategy}});Object.defineProperty(N,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return g_.SharedArrayReceiverStrategy}});var Zf=n_();Object.defineProperty(N,"MessageReader",{enumerable:!0,get:function(){return Zf.MessageReader}});Object.defineProperty(N,"AbstractMessageReader",{enumerable:!0,get:function(){return Zf.AbstractMessageReader}});Object.defineProperty(N,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return Zf.ReadableStreamMessageReader}});var ep=a_();Object.defineProperty(N,"MessageWriter",{enumerable:!0,get:function(){return ep.MessageWriter}});Object.defineProperty(N,"AbstractMessageWriter",{enumerable:!0,get:function(){return ep.AbstractMessageWriter}});Object.defineProperty(N,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return ep.WriteableStreamMessageWriter}});var oC=u_();Object.defineProperty(N,"AbstractMessageBuffer",{enumerable:!0,get:function(){return oC.AbstractMessageBuffer}});var Lt=p_();Object.defineProperty(N,"ConnectionStrategy",{enumerable:!0,get:function(){return Lt.ConnectionStrategy}});Object.defineProperty(N,"ConnectionOptions",{enumerable:!0,get:function(){return Lt.ConnectionOptions}});Object.defineProperty(N,"NullLogger",{enumerable:!0,get:function(){return Lt.NullLogger}});Object.defineProperty(N,"createMessageConnection",{enumerable:!0,get:function(){return Lt.createMessageConnection}});Object.defineProperty(N,"ProgressToken",{enumerable:!0,get:function(){return Lt.ProgressToken}});Object.defineProperty(N,"ProgressType",{enumerable:!0,get:function(){return Lt.ProgressType}});Object.defineProperty(N,"Trace",{enumerable:!0,get:function(){return Lt.Trace}});Object.defineProperty(N,"TraceValues",{enumerable:!0,get:function(){return Lt.TraceValues}});Object.defineProperty(N,"TraceFormat",{enumerable:!0,get:function(){return Lt.TraceFormat}});Object.defineProperty(N,"SetTraceNotification",{enumerable:!0,get:function(){return Lt.SetTraceNotification}});Object.defineProperty(N,"LogTraceNotification",{enumerable:!0,get:function(){return Lt.LogTraceNotification}});Object.defineProperty(N,"ConnectionErrors",{enumerable:!0,get:function(){return Lt.ConnectionErrors}});Object.defineProperty(N,"ConnectionError",{enumerable:!0,get:function(){return Lt.ConnectionError}});Object.defineProperty(N,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Lt.CancellationReceiverStrategy}});Object.defineProperty(N,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Lt.CancellationSenderStrategy}});Object.defineProperty(N,"CancellationStrategy",{enumerable:!0,get:function(){return Lt.CancellationStrategy}});Object.defineProperty(N,"MessageStrategy",{enumerable:!0,get:function(){return Lt.MessageStrategy}});var aC=Gr();N.RAL=aC.default});var __=m(ip=>{"use strict";Object.defineProperty(ip,"__esModule",{value:!0});var y_=require("util"),xr=Cu(),Ou=class t extends xr.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 y_.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)}};Ou.emptyBuffer=Buffer.allocUnsafe(0);var tp=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),xr.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),xr.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),xr.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),xr.Disposable.create(()=>this.stream.off("data",e))}},np=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),xr.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),xr.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),xr.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()}},b_=Object.freeze({messageBuffer:Object.freeze({create:t=>new Ou(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 y_.TextDecoder(e.charset).decode(t)))}catch(n){return Promise.reject(n)}}})}),stream:Object.freeze({asReadableStream:t=>new tp(t),asWritableStream:t=>new np(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 rp(){return b_}(function(t){function e(){xr.RAL.install(b_)}t.install=e})(rp||(rp={}));ip.default=rp});var Ii=m(Se=>{"use strict";var uC=Se&&Se.__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]}),cC=Se&&Se.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&uC(e,t,n)};Object.defineProperty(Se,"__esModule",{value:!0});Se.createMessageConnection=Se.createServerSocketTransport=Se.createClientSocketTransport=Se.createServerPipeTransport=Se.createClientPipeTransport=Se.generateRandomPipeName=Se.StreamMessageWriter=Se.StreamMessageReader=Se.SocketMessageWriter=Se.SocketMessageReader=Se.PortMessageWriter=Se.PortMessageReader=Se.IPCMessageWriter=Se.IPCMessageReader=void 0;var Ts=__();Ts.default.install();var v_=require("path"),lC=require("os"),dC=require("crypto"),Iu=require("net"),gn=Cu();cC(Cu(),Se);var sp=class extends gn.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),gn.Disposable.create(()=>this.process.off("message",e))}};Se.IPCMessageReader=sp;var op=class extends gn.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(){}};Se.IPCMessageWriter=op;var ap=class extends gn.AbstractMessageReader{constructor(e){super(),this.onData=new gn.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)}};Se.PortMessageReader=ap;var up=class extends gn.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(){}};Se.PortMessageWriter=up;var Ri=class extends gn.ReadableStreamMessageReader{constructor(e,n="utf-8"){super((0,Ts.default)().stream.asReadableStream(e),n)}};Se.SocketMessageReader=Ri;var Di=class extends gn.WriteableStreamMessageWriter{constructor(e,n){super((0,Ts.default)().stream.asWritableStream(e),n),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};Se.SocketMessageWriter=Di;var Ru=class extends gn.ReadableStreamMessageReader{constructor(e,n){super((0,Ts.default)().stream.asReadableStream(e),n)}};Se.StreamMessageReader=Ru;var Du=class extends gn.WriteableStreamMessageWriter{constructor(e,n){super((0,Ts.default)().stream.asWritableStream(e),n)}};Se.StreamMessageWriter=Du;var S_=process.env.XDG_RUNTIME_DIR,fC=new Map([["linux",107],["darwin",103]]);function pC(){let t=(0,dC.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;S_?e=v_.join(S_,`vscode-ipc-${t}.sock`):e=v_.join(lC.tmpdir(),`vscode-${t}.sock`);let n=fC.get(process.platform);return n!==void 0&&e.length>n&&(0,Ts.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${n} characters.`),e}Se.generateRandomPipeName=pC;function hC(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,Iu.createServer)(a=>{o.close(),n([new Ri(a,e),new Di(a,e)])});o.on("error",s),o.listen(t,()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}Se.createClientPipeTransport=hC;function mC(t,e="utf-8"){let n=(0,Iu.createConnection)(t);return[new Ri(n,e),new Di(n,e)]}Se.createServerPipeTransport=mC;function gC(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,Iu.createServer)(a=>{o.close(),n([new Ri(a,e),new Di(a,e)])});o.on("error",s),o.listen(t,"127.0.0.1",()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}Se.createClientSocketTransport=gC;function yC(t,e="utf-8"){let n=(0,Iu.createConnection)(t,"127.0.0.1");return[new Ri(n,e),new Di(n,e)]}Se.createServerSocketTransport=yC;function bC(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function _C(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function vC(t,e,n,r){n||(n=gn.NullLogger);let i=bC(t)?new Ru(t):t,s=_C(e)?new Du(e):e;return gn.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,gn.createMessageConnection)(i,s,n,r)}Se.createMessageConnection=vC});var cp=m(($j,T_)=>{"use strict";T_.exports=Ii()});var Mu=m((w_,Pu)=>{(function(t){if(typeof Pu=="object"&&typeof Pu.exports=="object"){var e=t(require,w_);e!==void 0&&(Pu.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(h){function T(A){return typeof A=="string"}h.is=T})(n||(e.DocumentUri=n={}));var r;(function(h){function T(A){return typeof A=="string"}h.is=T})(r||(e.URI=r={}));var i;(function(h){h.MIN_VALUE=-2147483648,h.MAX_VALUE=2147483647;function T(A){return typeof A=="number"&&h.MIN_VALUE<=A&&A<=h.MAX_VALUE}h.is=T})(i||(e.integer=i={}));var s;(function(h){h.MIN_VALUE=0,h.MAX_VALUE=2147483647;function T(A){return typeof A=="number"&&h.MIN_VALUE<=A&&A<=h.MAX_VALUE}h.is=T})(s||(e.uinteger=s={}));var o;(function(h){function T(g,f){return g===Number.MAX_VALUE&&(g=s.MAX_VALUE),f===Number.MAX_VALUE&&(f=s.MAX_VALUE),{line:g,character:f}}h.create=T;function A(g){var f=g;return D.objectLiteral(f)&&D.uinteger(f.line)&&D.uinteger(f.character)}h.is=A})(o||(e.Position=o={}));var a;(function(h){function T(g,f,R,$){if(D.uinteger(g)&&D.uinteger(f)&&D.uinteger(R)&&D.uinteger($))return{start:o.create(g,f),end:o.create(R,$)};if(o.is(g)&&o.is(f))return{start:g,end:f};throw new Error("Range#create called with invalid arguments[".concat(g,", ").concat(f,", ").concat(R,", ").concat($,"]"))}h.create=T;function A(g){var f=g;return D.objectLiteral(f)&&o.is(f.start)&&o.is(f.end)}h.is=A})(a||(e.Range=a={}));var u;(function(h){function T(g,f){return{uri:g,range:f}}h.create=T;function A(g){var f=g;return D.objectLiteral(f)&&a.is(f.range)&&(D.string(f.uri)||D.undefined(f.uri))}h.is=A})(u||(e.Location=u={}));var c;(function(h){function T(g,f,R,$){return{targetUri:g,targetRange:f,targetSelectionRange:R,originSelectionRange:$}}h.create=T;function A(g){var f=g;return D.objectLiteral(f)&&a.is(f.targetRange)&&D.string(f.targetUri)&&a.is(f.targetSelectionRange)&&(a.is(f.originSelectionRange)||D.undefined(f.originSelectionRange))}h.is=A})(c||(e.LocationLink=c={}));var l;(function(h){function T(g,f,R,$){return{red:g,green:f,blue:R,alpha:$}}h.create=T;function A(g){var f=g;return D.objectLiteral(f)&&D.numberRange(f.red,0,1)&&D.numberRange(f.green,0,1)&&D.numberRange(f.blue,0,1)&&D.numberRange(f.alpha,0,1)}h.is=A})(l||(e.Color=l={}));var d;(function(h){function T(g,f){return{range:g,color:f}}h.create=T;function A(g){var f=g;return D.objectLiteral(f)&&a.is(f.range)&&l.is(f.color)}h.is=A})(d||(e.ColorInformation=d={}));var p;(function(h){function T(g,f,R){return{label:g,textEdit:f,additionalTextEdits:R}}h.create=T;function A(g){var f=g;return D.objectLiteral(f)&&D.string(f.label)&&(D.undefined(f.textEdit)||j.is(f))&&(D.undefined(f.additionalTextEdits)||D.typedArray(f.additionalTextEdits,j.is))}h.is=A})(p||(e.ColorPresentation=p={}));var y;(function(h){h.Comment="comment",h.Imports="imports",h.Region="region"})(y||(e.FoldingRangeKind=y={}));var v;(function(h){function T(g,f,R,$,pe,it){var Be={startLine:g,endLine:f};return D.defined(R)&&(Be.startCharacter=R),D.defined($)&&(Be.endCharacter=$),D.defined(pe)&&(Be.kind=pe),D.defined(it)&&(Be.collapsedText=it),Be}h.create=T;function A(g){var f=g;return D.objectLiteral(f)&&D.uinteger(f.startLine)&&D.uinteger(f.startLine)&&(D.undefined(f.startCharacter)||D.uinteger(f.startCharacter))&&(D.undefined(f.endCharacter)||D.uinteger(f.endCharacter))&&(D.undefined(f.kind)||D.string(f.kind))}h.is=A})(v||(e.FoldingRange=v={}));var x;(function(h){function T(g,f){return{location:g,message:f}}h.create=T;function A(g){var f=g;return D.defined(f)&&u.is(f.location)&&D.string(f.message)}h.is=A})(x||(e.DiagnosticRelatedInformation=x={}));var I;(function(h){h.Error=1,h.Warning=2,h.Information=3,h.Hint=4})(I||(e.DiagnosticSeverity=I={}));var P;(function(h){h.Unnecessary=1,h.Deprecated=2})(P||(e.DiagnosticTag=P={}));var w;(function(h){function T(A){var g=A;return D.objectLiteral(g)&&D.string(g.href)}h.is=T})(w||(e.CodeDescription=w={}));var E;(function(h){function T(g,f,R,$,pe,it){var Be={range:g,message:f};return D.defined(R)&&(Be.severity=R),D.defined($)&&(Be.code=$),D.defined(pe)&&(Be.source=pe),D.defined(it)&&(Be.relatedInformation=it),Be}h.create=T;function A(g){var f,R=g;return D.defined(R)&&a.is(R.range)&&D.string(R.message)&&(D.number(R.severity)||D.undefined(R.severity))&&(D.integer(R.code)||D.string(R.code)||D.undefined(R.code))&&(D.undefined(R.codeDescription)||D.string((f=R.codeDescription)===null||f===void 0?void 0:f.href))&&(D.string(R.source)||D.undefined(R.source))&&(D.undefined(R.relatedInformation)||D.typedArray(R.relatedInformation,x.is))}h.is=A})(E||(e.Diagnostic=E={}));var _;(function(h){function T(g,f){for(var R=[],$=2;$<arguments.length;$++)R[$-2]=arguments[$];var pe={title:g,command:f};return D.defined(R)&&R.length>0&&(pe.arguments=R),pe}h.create=T;function A(g){var f=g;return D.defined(f)&&D.string(f.title)&&D.string(f.command)}h.is=A})(_||(e.Command=_={}));var j;(function(h){function T(R,$){return{range:R,newText:$}}h.replace=T;function A(R,$){return{range:{start:R,end:R},newText:$}}h.insert=A;function g(R){return{range:R,newText:""}}h.del=g;function f(R){var $=R;return D.objectLiteral($)&&D.string($.newText)&&a.is($.range)}h.is=f})(j||(e.TextEdit=j={}));var O;(function(h){function T(g,f,R){var $={label:g};return f!==void 0&&($.needsConfirmation=f),R!==void 0&&($.description=R),$}h.create=T;function A(g){var f=g;return D.objectLiteral(f)&&D.string(f.label)&&(D.boolean(f.needsConfirmation)||f.needsConfirmation===void 0)&&(D.string(f.description)||f.description===void 0)}h.is=A})(O||(e.ChangeAnnotation=O={}));var H;(function(h){function T(A){var g=A;return D.string(g)}h.is=T})(H||(e.ChangeAnnotationIdentifier=H={}));var re;(function(h){function T(R,$,pe){return{range:R,newText:$,annotationId:pe}}h.replace=T;function A(R,$,pe){return{range:{start:R,end:R},newText:$,annotationId:pe}}h.insert=A;function g(R,$){return{range:R,newText:"",annotationId:$}}h.del=g;function f(R){var $=R;return j.is($)&&(O.is($.annotationId)||H.is($.annotationId))}h.is=f})(re||(e.AnnotatedTextEdit=re={}));var fe;(function(h){function T(g,f){return{textDocument:g,edits:f}}h.create=T;function A(g){var f=g;return D.defined(f)&&Pe.is(f.textDocument)&&Array.isArray(f.edits)}h.is=A})(fe||(e.TextDocumentEdit=fe={}));var U;(function(h){function T(g,f,R){var $={kind:"create",uri:g};return f!==void 0&&(f.overwrite!==void 0||f.ignoreIfExists!==void 0)&&($.options=f),R!==void 0&&($.annotationId=R),$}h.create=T;function A(g){var f=g;return f&&f.kind==="create"&&D.string(f.uri)&&(f.options===void 0||(f.options.overwrite===void 0||D.boolean(f.options.overwrite))&&(f.options.ignoreIfExists===void 0||D.boolean(f.options.ignoreIfExists)))&&(f.annotationId===void 0||H.is(f.annotationId))}h.is=A})(U||(e.CreateFile=U={}));var k;(function(h){function T(g,f,R,$){var pe={kind:"rename",oldUri:g,newUri:f};return R!==void 0&&(R.overwrite!==void 0||R.ignoreIfExists!==void 0)&&(pe.options=R),$!==void 0&&(pe.annotationId=$),pe}h.create=T;function A(g){var f=g;return f&&f.kind==="rename"&&D.string(f.oldUri)&&D.string(f.newUri)&&(f.options===void 0||(f.options.overwrite===void 0||D.boolean(f.options.overwrite))&&(f.options.ignoreIfExists===void 0||D.boolean(f.options.ignoreIfExists)))&&(f.annotationId===void 0||H.is(f.annotationId))}h.is=A})(k||(e.RenameFile=k={}));var M;(function(h){function T(g,f,R){var $={kind:"delete",uri:g};return f!==void 0&&(f.recursive!==void 0||f.ignoreIfNotExists!==void 0)&&($.options=f),R!==void 0&&($.annotationId=R),$}h.create=T;function A(g){var f=g;return f&&f.kind==="delete"&&D.string(f.uri)&&(f.options===void 0||(f.options.recursive===void 0||D.boolean(f.options.recursive))&&(f.options.ignoreIfNotExists===void 0||D.boolean(f.options.ignoreIfNotExists)))&&(f.annotationId===void 0||H.is(f.annotationId))}h.is=A})(M||(e.DeleteFile=M={}));var L;(function(h){function T(A){var g=A;return g&&(g.changes!==void 0||g.documentChanges!==void 0)&&(g.documentChanges===void 0||g.documentChanges.every(function(f){return D.string(f.kind)?U.is(f)||k.is(f)||M.is(f):fe.is(f)}))}h.is=T})(L||(e.WorkspaceEdit=L={}));var q=function(){function h(T,A){this.edits=T,this.changeAnnotations=A}return h.prototype.insert=function(T,A,g){var f,R;if(g===void 0?f=j.insert(T,A):H.is(g)?(R=g,f=re.insert(T,A,g)):(this.assertChangeAnnotations(this.changeAnnotations),R=this.changeAnnotations.manage(g),f=re.insert(T,A,R)),this.edits.push(f),R!==void 0)return R},h.prototype.replace=function(T,A,g){var f,R;if(g===void 0?f=j.replace(T,A):H.is(g)?(R=g,f=re.replace(T,A,g)):(this.assertChangeAnnotations(this.changeAnnotations),R=this.changeAnnotations.manage(g),f=re.replace(T,A,R)),this.edits.push(f),R!==void 0)return R},h.prototype.delete=function(T,A){var g,f;if(A===void 0?g=j.del(T):H.is(A)?(f=A,g=re.del(T,A)):(this.assertChangeAnnotations(this.changeAnnotations),f=this.changeAnnotations.manage(A),g=re.del(T,f)),this.edits.push(g),f!==void 0)return f},h.prototype.add=function(T){this.edits.push(T)},h.prototype.all=function(){return this.edits},h.prototype.clear=function(){this.edits.splice(0,this.edits.length)},h.prototype.assertChangeAnnotations=function(T){if(T===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},h}(),ce=function(){function h(T){this._annotations=T===void 0?Object.create(null):T,this._counter=0,this._size=0}return h.prototype.all=function(){return this._annotations},Object.defineProperty(h.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),h.prototype.manage=function(T,A){var g;if(H.is(T)?g=T:(g=this.nextId(),A=T),this._annotations[g]!==void 0)throw new Error("Id ".concat(g," is already in use."));if(A===void 0)throw new Error("No annotation provided for id ".concat(g));return this._annotations[g]=A,this._size++,g},h.prototype.nextId=function(){return this._counter++,this._counter.toString()},h}(),ae=function(){function h(T){var A=this;this._textEditChanges=Object.create(null),T!==void 0?(this._workspaceEdit=T,T.documentChanges?(this._changeAnnotations=new ce(T.changeAnnotations),T.changeAnnotations=this._changeAnnotations.all(),T.documentChanges.forEach(function(g){if(fe.is(g)){var f=new q(g.edits,A._changeAnnotations);A._textEditChanges[g.textDocument.uri]=f}})):T.changes&&Object.keys(T.changes).forEach(function(g){var f=new q(T.changes[g]);A._textEditChanges[g]=f})):this._workspaceEdit={}}return Object.defineProperty(h.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}),h.prototype.getTextEditChange=function(T){if(Pe.is(T)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var A={uri:T.uri,version:T.version},g=this._textEditChanges[A.uri];if(!g){var f=[],R={textDocument:A,edits:f};this._workspaceEdit.documentChanges.push(R),g=new q(f,this._changeAnnotations),this._textEditChanges[A.uri]=g}return g}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var g=this._textEditChanges[T];if(!g){var f=[];this._workspaceEdit.changes[T]=f,g=new q(f),this._textEditChanges[T]=g}return g}},h.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new ce,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},h.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},h.prototype.createFile=function(T,A,g){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var f;O.is(A)||H.is(A)?f=A:g=A;var R,$;if(f===void 0?R=U.create(T,g):($=H.is(f)?f:this._changeAnnotations.manage(f),R=U.create(T,g,$)),this._workspaceEdit.documentChanges.push(R),$!==void 0)return $},h.prototype.renameFile=function(T,A,g,f){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var R;O.is(g)||H.is(g)?R=g:f=g;var $,pe;if(R===void 0?$=k.create(T,A,f):(pe=H.is(R)?R:this._changeAnnotations.manage(R),$=k.create(T,A,f,pe)),this._workspaceEdit.documentChanges.push($),pe!==void 0)return pe},h.prototype.deleteFile=function(T,A,g){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var f;O.is(A)||H.is(A)?f=A:g=A;var R,$;if(f===void 0?R=M.create(T,g):($=H.is(f)?f:this._changeAnnotations.manage(f),R=M.create(T,g,$)),this._workspaceEdit.documentChanges.push(R),$!==void 0)return $},h}();e.WorkspaceChange=ae;var Ct;(function(h){function T(g){return{uri:g}}h.create=T;function A(g){var f=g;return D.defined(f)&&D.string(f.uri)}h.is=A})(Ct||(e.TextDocumentIdentifier=Ct={}));var dt;(function(h){function T(g,f){return{uri:g,version:f}}h.create=T;function A(g){var f=g;return D.defined(f)&&D.string(f.uri)&&D.integer(f.version)}h.is=A})(dt||(e.VersionedTextDocumentIdentifier=dt={}));var Pe;(function(h){function T(g,f){return{uri:g,version:f}}h.create=T;function A(g){var f=g;return D.defined(f)&&D.string(f.uri)&&(f.version===null||D.integer(f.version))}h.is=A})(Pe||(e.OptionalVersionedTextDocumentIdentifier=Pe={}));var rn;(function(h){function T(g,f,R,$){return{uri:g,languageId:f,version:R,text:$}}h.create=T;function A(g){var f=g;return D.defined(f)&&D.string(f.uri)&&D.string(f.languageId)&&D.integer(f.version)&&D.string(f.text)}h.is=A})(rn||(e.TextDocumentItem=rn={}));var ls;(function(h){h.PlainText="plaintext",h.Markdown="markdown";function T(A){var g=A;return g===h.PlainText||g===h.Markdown}h.is=T})(ls||(e.MarkupKind=ls={}));var ki;(function(h){function T(A){var g=A;return D.objectLiteral(A)&&ls.is(g.kind)&&D.string(g.value)}h.is=T})(ki||(e.MarkupContent=ki={}));var Ja;(function(h){h.Text=1,h.Method=2,h.Function=3,h.Constructor=4,h.Field=5,h.Variable=6,h.Class=7,h.Interface=8,h.Module=9,h.Property=10,h.Unit=11,h.Value=12,h.Enum=13,h.Keyword=14,h.Snippet=15,h.Color=16,h.File=17,h.Reference=18,h.Folder=19,h.EnumMember=20,h.Constant=21,h.Struct=22,h.Event=23,h.Operator=24,h.TypeParameter=25})(Ja||(e.CompletionItemKind=Ja={}));var ko;(function(h){h.PlainText=1,h.Snippet=2})(ko||(e.InsertTextFormat=ko={}));var Co;(function(h){h.Deprecated=1})(Co||(e.CompletionItemTag=Co={}));var Qa;(function(h){function T(g,f,R){return{newText:g,insert:f,replace:R}}h.create=T;function A(g){var f=g;return f&&D.string(f.newText)&&a.is(f.insert)&&a.is(f.replace)}h.is=A})(Qa||(e.InsertReplaceEdit=Qa={}));var Za;(function(h){h.asIs=1,h.adjustIndentation=2})(Za||(e.InsertTextMode=Za={}));var eu;(function(h){function T(A){var g=A;return g&&(D.string(g.detail)||g.detail===void 0)&&(D.string(g.description)||g.description===void 0)}h.is=T})(eu||(e.CompletionItemLabelDetails=eu={}));var tu;(function(h){function T(A){return{label:A}}h.create=T})(tu||(e.CompletionItem=tu={}));var nu;(function(h){function T(A,g){return{items:A||[],isIncomplete:!!g}}h.create=T})(nu||(e.CompletionList=nu={}));var ds;(function(h){function T(g){return g.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}h.fromPlainText=T;function A(g){var f=g;return D.string(f)||D.objectLiteral(f)&&D.string(f.language)&&D.string(f.value)}h.is=A})(ds||(e.MarkedString=ds={}));var Hn;(function(h){function T(A){var g=A;return!!g&&D.objectLiteral(g)&&(ki.is(g.contents)||ds.is(g.contents)||D.typedArray(g.contents,ds.is))&&(A.range===void 0||a.is(A.range))}h.is=T})(Hn||(e.Hover=Hn={}));var ru;(function(h){function T(A,g){return g?{label:A,documentation:g}:{label:A}}h.create=T})(ru||(e.ParameterInformation=ru={}));var iu;(function(h){function T(A,g){for(var f=[],R=2;R<arguments.length;R++)f[R-2]=arguments[R];var $={label:A};return D.defined(g)&&($.documentation=g),D.defined(f)?$.parameters=f:$.parameters=[],$}h.create=T})(iu||(e.SignatureInformation=iu={}));var Ci;(function(h){h.Text=1,h.Read=2,h.Write=3})(Ci||(e.DocumentHighlightKind=Ci={}));var su;(function(h){function T(A,g){var f={range:A};return D.number(g)&&(f.kind=g),f}h.create=T})(su||(e.DocumentHighlight=su={}));var fs;(function(h){h.File=1,h.Module=2,h.Namespace=3,h.Package=4,h.Class=5,h.Method=6,h.Property=7,h.Field=8,h.Constructor=9,h.Enum=10,h.Interface=11,h.Function=12,h.Variable=13,h.Constant=14,h.String=15,h.Number=16,h.Boolean=17,h.Array=18,h.Object=19,h.Key=20,h.Null=21,h.EnumMember=22,h.Struct=23,h.Event=24,h.Operator=25,h.TypeParameter=26})(fs||(e.SymbolKind=fs={}));var ou;(function(h){h.Deprecated=1})(ou||(e.SymbolTag=ou={}));var wr;(function(h){function T(A,g,f,R,$){var pe={name:A,kind:g,location:{uri:R,range:f}};return $&&(pe.containerName=$),pe}h.create=T})(wr||(e.SymbolInformation=wr={}));var Hr;(function(h){function T(A,g,f,R){return R!==void 0?{name:A,kind:g,location:{uri:f,range:R}}:{name:A,kind:g,location:{uri:f}}}h.create=T})(Hr||(e.WorkspaceSymbol=Hr={}));var au;(function(h){function T(g,f,R,$,pe,it){var Be={name:g,detail:f,kind:R,range:$,selectionRange:pe};return it!==void 0&&(Be.children=it),Be}h.create=T;function A(g){var f=g;return f&&D.string(f.name)&&D.number(f.kind)&&a.is(f.range)&&a.is(f.selectionRange)&&(f.detail===void 0||D.string(f.detail))&&(f.deprecated===void 0||D.boolean(f.deprecated))&&(f.children===void 0||Array.isArray(f.children))&&(f.tags===void 0||Array.isArray(f.tags))}h.is=A})(au||(e.DocumentSymbol=au={}));var uu;(function(h){h.Empty="",h.QuickFix="quickfix",h.Refactor="refactor",h.RefactorExtract="refactor.extract",h.RefactorInline="refactor.inline",h.RefactorRewrite="refactor.rewrite",h.Source="source",h.SourceOrganizeImports="source.organizeImports",h.SourceFixAll="source.fixAll"})(uu||(e.CodeActionKind=uu={}));var rr;(function(h){h.Invoked=1,h.Automatic=2})(rr||(e.CodeActionTriggerKind=rr={}));var Oo;(function(h){function T(g,f,R){var $={diagnostics:g};return f!=null&&($.only=f),R!=null&&($.triggerKind=R),$}h.create=T;function A(g){var f=g;return D.defined(f)&&D.typedArray(f.diagnostics,E.is)&&(f.only===void 0||D.typedArray(f.only,D.string))&&(f.triggerKind===void 0||f.triggerKind===rr.Invoked||f.triggerKind===rr.Automatic)}h.is=A})(Oo||(e.CodeActionContext=Oo={}));var Ro;(function(h){function T(g,f,R){var $={title:g},pe=!0;return typeof f=="string"?(pe=!1,$.kind=f):_.is(f)?$.command=f:$.edit=f,pe&&R!==void 0&&($.kind=R),$}h.create=T;function A(g){var f=g;return f&&D.string(f.title)&&(f.diagnostics===void 0||D.typedArray(f.diagnostics,E.is))&&(f.kind===void 0||D.string(f.kind))&&(f.edit!==void 0||f.command!==void 0)&&(f.command===void 0||_.is(f.command))&&(f.isPreferred===void 0||D.boolean(f.isPreferred))&&(f.edit===void 0||L.is(f.edit))}h.is=A})(Ro||(e.CodeAction=Ro={}));var ps;(function(h){function T(g,f){var R={range:g};return D.defined(f)&&(R.data=f),R}h.create=T;function A(g){var f=g;return D.defined(f)&&a.is(f.range)&&(D.undefined(f.command)||_.is(f.command))}h.is=A})(ps||(e.CodeLens=ps={}));var Do;(function(h){function T(g,f){return{tabSize:g,insertSpaces:f}}h.create=T;function A(g){var f=g;return D.defined(f)&&D.uinteger(f.tabSize)&&D.boolean(f.insertSpaces)}h.is=A})(Do||(e.FormattingOptions=Do={}));var Er;(function(h){function T(g,f,R){return{range:g,target:f,data:R}}h.create=T;function A(g){var f=g;return D.defined(f)&&a.is(f.range)&&(D.undefined(f.target)||D.string(f.target))}h.is=A})(Er||(e.DocumentLink=Er={}));var S;(function(h){function T(g,f){return{range:g,parent:f}}h.create=T;function A(g){var f=g;return D.objectLiteral(f)&&a.is(f.range)&&(f.parent===void 0||h.is(f.parent))}h.is=A})(S||(e.SelectionRange=S={}));var F;(function(h){h.namespace="namespace",h.type="type",h.class="class",h.enum="enum",h.interface="interface",h.struct="struct",h.typeParameter="typeParameter",h.parameter="parameter",h.variable="variable",h.property="property",h.enumMember="enumMember",h.event="event",h.function="function",h.method="method",h.macro="macro",h.keyword="keyword",h.modifier="modifier",h.comment="comment",h.string="string",h.number="number",h.regexp="regexp",h.operator="operator",h.decorator="decorator"})(F||(e.SemanticTokenTypes=F={}));var W;(function(h){h.declaration="declaration",h.definition="definition",h.readonly="readonly",h.static="static",h.deprecated="deprecated",h.abstract="abstract",h.async="async",h.modification="modification",h.documentation="documentation",h.defaultLibrary="defaultLibrary"})(W||(e.SemanticTokenModifiers=W={}));var X;(function(h){function T(A){var g=A;return D.objectLiteral(g)&&(g.resultId===void 0||typeof g.resultId=="string")&&Array.isArray(g.data)&&(g.data.length===0||typeof g.data[0]=="number")}h.is=T})(X||(e.SemanticTokens=X={}));var qe;(function(h){function T(g,f){return{range:g,text:f}}h.create=T;function A(g){var f=g;return f!=null&&a.is(f.range)&&D.string(f.text)}h.is=A})(qe||(e.InlineValueText=qe={}));var De;(function(h){function T(g,f,R){return{range:g,variableName:f,caseSensitiveLookup:R}}h.create=T;function A(g){var f=g;return f!=null&&a.is(f.range)&&D.boolean(f.caseSensitiveLookup)&&(D.string(f.variableName)||f.variableName===void 0)}h.is=A})(De||(e.InlineValueVariableLookup=De={}));var We;(function(h){function T(g,f){return{range:g,expression:f}}h.create=T;function A(g){var f=g;return f!=null&&a.is(f.range)&&(D.string(f.expression)||f.expression===void 0)}h.is=A})(We||(e.InlineValueEvaluatableExpression=We={}));var Ye;(function(h){function T(g,f){return{frameId:g,stoppedLocation:f}}h.create=T;function A(g){var f=g;return D.defined(f)&&a.is(g.stoppedLocation)}h.is=A})(Ye||(e.InlineValueContext=Ye={}));var _e;(function(h){h.Type=1,h.Parameter=2;function T(A){return A===1||A===2}h.is=T})(_e||(e.InlayHintKind=_e={}));var $e;(function(h){function T(g){return{value:g}}h.create=T;function A(g){var f=g;return D.objectLiteral(f)&&(f.tooltip===void 0||D.string(f.tooltip)||ki.is(f.tooltip))&&(f.location===void 0||u.is(f.location))&&(f.command===void 0||_.is(f.command))}h.is=A})($e||(e.InlayHintLabelPart=$e={}));var Ae;(function(h){function T(g,f,R){var $={position:g,label:f};return R!==void 0&&($.kind=R),$}h.create=T;function A(g){var f=g;return D.objectLiteral(f)&&o.is(f.position)&&(D.string(f.label)||D.typedArray(f.label,$e.is))&&(f.kind===void 0||_e.is(f.kind))&&f.textEdits===void 0||D.typedArray(f.textEdits,j.is)&&(f.tooltip===void 0||D.string(f.tooltip)||ki.is(f.tooltip))&&(f.paddingLeft===void 0||D.boolean(f.paddingLeft))&&(f.paddingRight===void 0||D.boolean(f.paddingRight))}h.is=A})(Ae||(e.InlayHint=Ae={}));var rt;(function(h){function T(A){return{kind:"snippet",value:A}}h.createSnippet=T})(rt||(e.StringValue=rt={}));var Ot;(function(h){function T(A,g,f,R){return{insertText:A,filterText:g,range:f,command:R}}h.create=T})(Ot||(e.InlineCompletionItem=Ot={}));var hn;(function(h){function T(A){return{items:A}}h.create=T})(hn||(e.InlineCompletionList=hn={}));var cu;(function(h){h.Invoked=0,h.Automatic=1})(cu||(e.InlineCompletionTriggerKind=cu={}));var Fb;(function(h){function T(A,g){return{range:A,text:g}}h.create=T})(Fb||(e.SelectedCompletionInfo=Fb={}));var $b;(function(h){function T(A,g){return{triggerKind:A,selectedCompletionInfo:g}}h.create=T})($b||(e.InlineCompletionContext=$b={}));var Bb;(function(h){function T(A){var g=A;return D.objectLiteral(g)&&r.is(g.uri)&&D.string(g.name)}h.is=T})(Bb||(e.WorkspaceFolder=Bb={})),e.EOL=[`
31
+ `)),F){let X=S.error?` Request failed: ${S.error.message} (${S.error.code}).`:"";j.log(`Received response '${F.method} - (${S.id})' in ${Date.now()-F.timerStart}ms.${X}`,W)}else j.log(`Received response ${S.id} without active response promise.`,W)}else wr("receive-response",S)}function wr(S,F){if(!j||E===Ce.Off)return;let W={isLSPMessage:!0,type:S,message:F,timestamp:Date.now()};j.log(W)}function Hr(){if(Pe())throw new Ss(No.Closed,"Connection is closed.");if(rn())throw new Ss(No.Disposed,"Connection is disposed.")}function au(){if(dt())throw new Ss(No.AlreadyListening,"Connection is already listening")}function uu(){if(!dt())throw new Error("Call listen() first.")}function rr(S){return S===void 0?null:S}function Oo(S){if(S!==null)return S}function Ro(S){return S!=null&&!Array.isArray(S)&&typeof S=="object"}function ps(S,F){switch(S){case oe.ParameterStructures.auto:return Ro(F)?Oo(F):[rr(F)];case oe.ParameterStructures.byName:if(!Ro(F))throw new Error("Received parameters by name but param is not an object literal.");return Oo(F);case oe.ParameterStructures.byPosition:return[rr(F)];default:throw new Error(`Unknown parameter structure ${S.toString()}`)}}function Do(S,F){let W,X=S.numberOfParams;switch(X){case 0:W=void 0;break;case 1:W=ps(S.parameterStructures,F[0]);break;default:W=[];for(let qe=0;qe<F.length&&qe<X;qe++)W.push(rr(F[qe]));if(F.length<X)for(let qe=F.length;qe<X;qe++)W.push(null);break}return W}let Er={sendNotification:(S,...F)=>{Hr();let W,X;if(tt.string(S)){W=S;let De=F[0],We=0,Ye=oe.ParameterStructures.auto;oe.ParameterStructures.is(De)&&(We=1,Ye=De);let _e=F.length,$e=_e-We;switch($e){case 0:X=void 0;break;case 1:X=ps(Ye,F[We]);break;default:if(Ye===oe.ParameterStructures.byName)throw new Error(`Received ${$e} parameters for 'by Name' notification parameter structure.`);X=F.slice(We,_e).map(Ae=>rr(Ae));break}}else{let De=F;W=S.method,X=Do(S,De)}let qe={jsonrpc:u,method:W,params:X};return iu(qe),e.write(qe).catch(De=>{throw i.error("Sending notification failed."),De})},onNotification:(S,F)=>{Hr();let W;return tt.func(S)?d=S:F&&(tt.string(S)?(W=S,p.set(S,{type:void 0,handler:F})):(W=S.method,p.set(S.method,{type:S,handler:F}))),{dispose:()=>{W!==void 0?p.delete(W):d=void 0}}},onProgress:(S,F,W)=>{if(y.has(F))throw new Error(`Progress handler for token ${F} already registered`);return y.set(F,W),{dispose:()=>{y.delete(F)}}},sendProgress:(S,F,W)=>Er.sendNotification(Lo.type,{token:F,value:W}),onUnhandledProgress:U.event,sendRequest:(S,...F)=>{Hr(),uu();let W,X,qe;if(tt.string(S)){W=S;let _e=F[0],$e=F[F.length-1],Ae=0,rt=oe.ParameterStructures.auto;oe.ParameterStructures.is(_e)&&(Ae=1,rt=_e);let Ot=F.length;Wf.CancellationToken.is($e)&&(Ot=Ot-1,qe=$e);let hn=Ot-Ae;switch(hn){case 0:X=void 0;break;case 1:X=ps(rt,F[Ae]);break;default:if(rt===oe.ParameterStructures.byName)throw new Error(`Received ${hn} parameters for 'by Name' request parameter structure.`);X=F.slice(Ae,Ot).map(cu=>rr(cu));break}}else{let _e=F;W=S.method,X=Do(S,_e);let $e=S.numberOfParams;qe=Wf.CancellationToken.is(_e[$e])?_e[$e]:void 0}let De=s++,We;qe&&(We=qe.onCancellationRequested(()=>{let _e=M.sender.sendCancellation(Er,De);return _e===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${De}`),Promise.resolve()):_e.catch(()=>{i.log(`Sending cancellation messages for id ${De} failed`)})}));let Ye={jsonrpc:u,id:De,method:W,params:X};return ru(Ye),typeof M.sender.enableCancellation=="function"&&M.sender.enableCancellation(Ye),new Promise(async(_e,$e)=>{let Ae=hn=>{_e(hn),M.sender.cleanup(De),We?.dispose()},rt=hn=>{$e(hn),M.sender.cleanup(De),We?.dispose()},Ot={method:W,timerStart:Date.now(),resolve:Ae,reject:rt};try{await e.write(Ye),I.set(De,Ot)}catch(hn){throw i.error("Sending request failed."),Ot.reject(new oe.ResponseError(oe.ErrorCodes.MessageWriteError,hn.message?hn.message:"Unknown reason")),hn}})},onRequest:(S,F)=>{Hr();let W=null;return zf.is(S)?(W=void 0,c=S):tt.string(S)?(W=null,F!==void 0&&(W=S,l.set(S,{handler:F,type:void 0}))):F!==void 0&&(W=S.method,l.set(S.method,{type:S,handler:F})),{dispose:()=>{W!==null&&(W!==void 0?l.delete(W):c=void 0)}}},hasPendingResponse:()=>I.size>0,trace:async(S,F,W)=>{let X=!1,qe=mn.Text;W!==void 0&&(tt.boolean(W)?X=W:(X=W.sendNotification||!1,qe=W.traceFormat||mn.Text)),E=S,_=qe,E===Ce.Off?j=void 0:j=F,X&&!Pe()&&!rn()&&await Er.sendNotification(Kf.type,{value:Ce.toString(S)})},onError:H.event,onClose:re.event,onUnhandledNotification:fe.event,onDispose:k.event,end:()=>{e.end()},dispose:()=>{if(rn())return;O=Vn.Disposed,k.fire(void 0);let S=new oe.ResponseError(oe.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let F of I.values())F.reject(S);I=new Map,w=new Map,P=new Set,x=new l_.LinkedMap,tt.func(e.dispose)&&e.dispose(),tt.func(t.dispose)&&t.dispose()},listen:()=>{Hr(),au(),O=Vn.Listening,t.listen(Za)},inspect:()=>{(0,c_.default)().console.log("inspect")}};return Er.onNotification(Tu.type,S=>{if(E===Ce.Off||!j)return;let F=E===Ce.Verbose||E===Ce.Compact;j.log(S.message,F?S.verbose:void 0)}),Er.onNotification(Lo.type,S=>{let F=y.get(S.token);F?F(S.value):U.fire(S)}),Er}he.createMessageConnection=iC});var Cu=m(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.ProgressType=N.ProgressToken=N.createMessageConnection=N.NullLogger=N.ConnectionOptions=N.ConnectionStrategy=N.AbstractMessageBuffer=N.WriteableStreamMessageWriter=N.AbstractMessageWriter=N.MessageWriter=N.ReadableStreamMessageReader=N.AbstractMessageReader=N.MessageReader=N.SharedArrayReceiverStrategy=N.SharedArraySenderStrategy=N.CancellationToken=N.CancellationTokenSource=N.Emitter=N.Event=N.Disposable=N.LRUCache=N.Touch=N.LinkedMap=N.ParameterStructures=N.NotificationType9=N.NotificationType8=N.NotificationType7=N.NotificationType6=N.NotificationType5=N.NotificationType4=N.NotificationType3=N.NotificationType2=N.NotificationType1=N.NotificationType0=N.NotificationType=N.ErrorCodes=N.ResponseError=N.RequestType9=N.RequestType8=N.RequestType7=N.RequestType6=N.RequestType5=N.RequestType4=N.RequestType3=N.RequestType2=N.RequestType1=N.RequestType0=N.RequestType=N.Message=N.RAL=void 0;N.MessageStrategy=N.CancellationStrategy=N.CancellationSenderStrategy=N.CancellationReceiverStrategy=N.ConnectionError=N.ConnectionErrors=N.LogTraceNotification=N.SetTraceNotification=N.TraceFormat=N.TraceValues=N.Trace=void 0;var Ue=Tf();Object.defineProperty(N,"Message",{enumerable:!0,get:function(){return Ue.Message}});Object.defineProperty(N,"RequestType",{enumerable:!0,get:function(){return Ue.RequestType}});Object.defineProperty(N,"RequestType0",{enumerable:!0,get:function(){return Ue.RequestType0}});Object.defineProperty(N,"RequestType1",{enumerable:!0,get:function(){return Ue.RequestType1}});Object.defineProperty(N,"RequestType2",{enumerable:!0,get:function(){return Ue.RequestType2}});Object.defineProperty(N,"RequestType3",{enumerable:!0,get:function(){return Ue.RequestType3}});Object.defineProperty(N,"RequestType4",{enumerable:!0,get:function(){return Ue.RequestType4}});Object.defineProperty(N,"RequestType5",{enumerable:!0,get:function(){return Ue.RequestType5}});Object.defineProperty(N,"RequestType6",{enumerable:!0,get:function(){return Ue.RequestType6}});Object.defineProperty(N,"RequestType7",{enumerable:!0,get:function(){return Ue.RequestType7}});Object.defineProperty(N,"RequestType8",{enumerable:!0,get:function(){return Ue.RequestType8}});Object.defineProperty(N,"RequestType9",{enumerable:!0,get:function(){return Ue.RequestType9}});Object.defineProperty(N,"ResponseError",{enumerable:!0,get:function(){return Ue.ResponseError}});Object.defineProperty(N,"ErrorCodes",{enumerable:!0,get:function(){return Ue.ErrorCodes}});Object.defineProperty(N,"NotificationType",{enumerable:!0,get:function(){return Ue.NotificationType}});Object.defineProperty(N,"NotificationType0",{enumerable:!0,get:function(){return Ue.NotificationType0}});Object.defineProperty(N,"NotificationType1",{enumerable:!0,get:function(){return Ue.NotificationType1}});Object.defineProperty(N,"NotificationType2",{enumerable:!0,get:function(){return Ue.NotificationType2}});Object.defineProperty(N,"NotificationType3",{enumerable:!0,get:function(){return Ue.NotificationType3}});Object.defineProperty(N,"NotificationType4",{enumerable:!0,get:function(){return Ue.NotificationType4}});Object.defineProperty(N,"NotificationType5",{enumerable:!0,get:function(){return Ue.NotificationType5}});Object.defineProperty(N,"NotificationType6",{enumerable:!0,get:function(){return Ue.NotificationType6}});Object.defineProperty(N,"NotificationType7",{enumerable:!0,get:function(){return Ue.NotificationType7}});Object.defineProperty(N,"NotificationType8",{enumerable:!0,get:function(){return Ue.NotificationType8}});Object.defineProperty(N,"NotificationType9",{enumerable:!0,get:function(){return Ue.NotificationType9}});Object.defineProperty(N,"ParameterStructures",{enumerable:!0,get:function(){return Ue.ParameterStructures}});var Jf=Ef();Object.defineProperty(N,"LinkedMap",{enumerable:!0,get:function(){return Jf.LinkedMap}});Object.defineProperty(N,"LRUCache",{enumerable:!0,get:function(){return Jf.LRUCache}});Object.defineProperty(N,"Touch",{enumerable:!0,get:function(){return Jf.Touch}});var sC=Qb();Object.defineProperty(N,"Disposable",{enumerable:!0,get:function(){return sC.Disposable}});var h_=ys();Object.defineProperty(N,"Event",{enumerable:!0,get:function(){return h_.Event}});Object.defineProperty(N,"Emitter",{enumerable:!0,get:function(){return h_.Emitter}});var m_=yu();Object.defineProperty(N,"CancellationTokenSource",{enumerable:!0,get:function(){return m_.CancellationTokenSource}});Object.defineProperty(N,"CancellationToken",{enumerable:!0,get:function(){return m_.CancellationToken}});var g_=e_();Object.defineProperty(N,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return g_.SharedArraySenderStrategy}});Object.defineProperty(N,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return g_.SharedArrayReceiverStrategy}});var Qf=n_();Object.defineProperty(N,"MessageReader",{enumerable:!0,get:function(){return Qf.MessageReader}});Object.defineProperty(N,"AbstractMessageReader",{enumerable:!0,get:function(){return Qf.AbstractMessageReader}});Object.defineProperty(N,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return Qf.ReadableStreamMessageReader}});var Zf=a_();Object.defineProperty(N,"MessageWriter",{enumerable:!0,get:function(){return Zf.MessageWriter}});Object.defineProperty(N,"AbstractMessageWriter",{enumerable:!0,get:function(){return Zf.AbstractMessageWriter}});Object.defineProperty(N,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return Zf.WriteableStreamMessageWriter}});var oC=u_();Object.defineProperty(N,"AbstractMessageBuffer",{enumerable:!0,get:function(){return oC.AbstractMessageBuffer}});var Lt=p_();Object.defineProperty(N,"ConnectionStrategy",{enumerable:!0,get:function(){return Lt.ConnectionStrategy}});Object.defineProperty(N,"ConnectionOptions",{enumerable:!0,get:function(){return Lt.ConnectionOptions}});Object.defineProperty(N,"NullLogger",{enumerable:!0,get:function(){return Lt.NullLogger}});Object.defineProperty(N,"createMessageConnection",{enumerable:!0,get:function(){return Lt.createMessageConnection}});Object.defineProperty(N,"ProgressToken",{enumerable:!0,get:function(){return Lt.ProgressToken}});Object.defineProperty(N,"ProgressType",{enumerable:!0,get:function(){return Lt.ProgressType}});Object.defineProperty(N,"Trace",{enumerable:!0,get:function(){return Lt.Trace}});Object.defineProperty(N,"TraceValues",{enumerable:!0,get:function(){return Lt.TraceValues}});Object.defineProperty(N,"TraceFormat",{enumerable:!0,get:function(){return Lt.TraceFormat}});Object.defineProperty(N,"SetTraceNotification",{enumerable:!0,get:function(){return Lt.SetTraceNotification}});Object.defineProperty(N,"LogTraceNotification",{enumerable:!0,get:function(){return Lt.LogTraceNotification}});Object.defineProperty(N,"ConnectionErrors",{enumerable:!0,get:function(){return Lt.ConnectionErrors}});Object.defineProperty(N,"ConnectionError",{enumerable:!0,get:function(){return Lt.ConnectionError}});Object.defineProperty(N,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Lt.CancellationReceiverStrategy}});Object.defineProperty(N,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Lt.CancellationSenderStrategy}});Object.defineProperty(N,"CancellationStrategy",{enumerable:!0,get:function(){return Lt.CancellationStrategy}});Object.defineProperty(N,"MessageStrategy",{enumerable:!0,get:function(){return Lt.MessageStrategy}});var aC=Gr();N.RAL=aC.default});var __=m(rp=>{"use strict";Object.defineProperty(rp,"__esModule",{value:!0});var y_=require("util"),xr=Cu(),Ou=class t extends xr.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 y_.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)}};Ou.emptyBuffer=Buffer.allocUnsafe(0);var ep=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),xr.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),xr.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),xr.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),xr.Disposable.create(()=>this.stream.off("data",e))}},tp=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),xr.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),xr.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),xr.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()}},b_=Object.freeze({messageBuffer:Object.freeze({create:t=>new Ou(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 y_.TextDecoder(e.charset).decode(t)))}catch(n){return Promise.reject(n)}}})}),stream:Object.freeze({asReadableStream:t=>new ep(t),asWritableStream:t=>new tp(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 np(){return b_}(function(t){function e(){xr.RAL.install(b_)}t.install=e})(np||(np={}));rp.default=np});var Ii=m(Se=>{"use strict";var uC=Se&&Se.__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]}),cC=Se&&Se.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&uC(e,t,n)};Object.defineProperty(Se,"__esModule",{value:!0});Se.createMessageConnection=Se.createServerSocketTransport=Se.createClientSocketTransport=Se.createServerPipeTransport=Se.createClientPipeTransport=Se.generateRandomPipeName=Se.StreamMessageWriter=Se.StreamMessageReader=Se.SocketMessageWriter=Se.SocketMessageReader=Se.PortMessageWriter=Se.PortMessageReader=Se.IPCMessageWriter=Se.IPCMessageReader=void 0;var Ts=__();Ts.default.install();var v_=require("path"),lC=require("os"),dC=require("crypto"),Iu=require("net"),gn=Cu();cC(Cu(),Se);var ip=class extends gn.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),gn.Disposable.create(()=>this.process.off("message",e))}};Se.IPCMessageReader=ip;var sp=class extends gn.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(){}};Se.IPCMessageWriter=sp;var op=class extends gn.AbstractMessageReader{constructor(e){super(),this.onData=new gn.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)}};Se.PortMessageReader=op;var ap=class extends gn.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(){}};Se.PortMessageWriter=ap;var Ri=class extends gn.ReadableStreamMessageReader{constructor(e,n="utf-8"){super((0,Ts.default)().stream.asReadableStream(e),n)}};Se.SocketMessageReader=Ri;var Di=class extends gn.WriteableStreamMessageWriter{constructor(e,n){super((0,Ts.default)().stream.asWritableStream(e),n),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};Se.SocketMessageWriter=Di;var Ru=class extends gn.ReadableStreamMessageReader{constructor(e,n){super((0,Ts.default)().stream.asReadableStream(e),n)}};Se.StreamMessageReader=Ru;var Du=class extends gn.WriteableStreamMessageWriter{constructor(e,n){super((0,Ts.default)().stream.asWritableStream(e),n)}};Se.StreamMessageWriter=Du;var S_=process.env.XDG_RUNTIME_DIR,fC=new Map([["linux",107],["darwin",103]]);function pC(){let t=(0,dC.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;S_?e=v_.join(S_,`vscode-ipc-${t}.sock`):e=v_.join(lC.tmpdir(),`vscode-${t}.sock`);let n=fC.get(process.platform);return n!==void 0&&e.length>n&&(0,Ts.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${n} characters.`),e}Se.generateRandomPipeName=pC;function hC(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,Iu.createServer)(a=>{o.close(),n([new Ri(a,e),new Di(a,e)])});o.on("error",s),o.listen(t,()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}Se.createClientPipeTransport=hC;function mC(t,e="utf-8"){let n=(0,Iu.createConnection)(t);return[new Ri(n,e),new Di(n,e)]}Se.createServerPipeTransport=mC;function gC(t,e="utf-8"){let n,r=new Promise((i,s)=>{n=i});return new Promise((i,s)=>{let o=(0,Iu.createServer)(a=>{o.close(),n([new Ri(a,e),new Di(a,e)])});o.on("error",s),o.listen(t,"127.0.0.1",()=>{o.removeListener("error",s),i({onConnected:()=>r})})})}Se.createClientSocketTransport=gC;function yC(t,e="utf-8"){let n=(0,Iu.createConnection)(t,"127.0.0.1");return[new Ri(n,e),new Di(n,e)]}Se.createServerSocketTransport=yC;function bC(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function _C(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function vC(t,e,n,r){n||(n=gn.NullLogger);let i=bC(t)?new Ru(t):t,s=_C(e)?new Du(e):e;return gn.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,gn.createMessageConnection)(i,s,n,r)}Se.createMessageConnection=vC});var up=m(($j,T_)=>{"use strict";T_.exports=Ii()});var Mu=m((w_,Pu)=>{(function(t){if(typeof Pu=="object"&&typeof Pu.exports=="object"){var e=t(require,w_);e!==void 0&&(Pu.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(h){function T(A){return typeof A=="string"}h.is=T})(n||(e.DocumentUri=n={}));var r;(function(h){function T(A){return typeof A=="string"}h.is=T})(r||(e.URI=r={}));var i;(function(h){h.MIN_VALUE=-2147483648,h.MAX_VALUE=2147483647;function T(A){return typeof A=="number"&&h.MIN_VALUE<=A&&A<=h.MAX_VALUE}h.is=T})(i||(e.integer=i={}));var s;(function(h){h.MIN_VALUE=0,h.MAX_VALUE=2147483647;function T(A){return typeof A=="number"&&h.MIN_VALUE<=A&&A<=h.MAX_VALUE}h.is=T})(s||(e.uinteger=s={}));var o;(function(h){function T(g,f){return g===Number.MAX_VALUE&&(g=s.MAX_VALUE),f===Number.MAX_VALUE&&(f=s.MAX_VALUE),{line:g,character:f}}h.create=T;function A(g){var f=g;return D.objectLiteral(f)&&D.uinteger(f.line)&&D.uinteger(f.character)}h.is=A})(o||(e.Position=o={}));var a;(function(h){function T(g,f,R,$){if(D.uinteger(g)&&D.uinteger(f)&&D.uinteger(R)&&D.uinteger($))return{start:o.create(g,f),end:o.create(R,$)};if(o.is(g)&&o.is(f))return{start:g,end:f};throw new Error("Range#create called with invalid arguments[".concat(g,", ").concat(f,", ").concat(R,", ").concat($,"]"))}h.create=T;function A(g){var f=g;return D.objectLiteral(f)&&o.is(f.start)&&o.is(f.end)}h.is=A})(a||(e.Range=a={}));var u;(function(h){function T(g,f){return{uri:g,range:f}}h.create=T;function A(g){var f=g;return D.objectLiteral(f)&&a.is(f.range)&&(D.string(f.uri)||D.undefined(f.uri))}h.is=A})(u||(e.Location=u={}));var c;(function(h){function T(g,f,R,$){return{targetUri:g,targetRange:f,targetSelectionRange:R,originSelectionRange:$}}h.create=T;function A(g){var f=g;return D.objectLiteral(f)&&a.is(f.targetRange)&&D.string(f.targetUri)&&a.is(f.targetSelectionRange)&&(a.is(f.originSelectionRange)||D.undefined(f.originSelectionRange))}h.is=A})(c||(e.LocationLink=c={}));var l;(function(h){function T(g,f,R,$){return{red:g,green:f,blue:R,alpha:$}}h.create=T;function A(g){var f=g;return D.objectLiteral(f)&&D.numberRange(f.red,0,1)&&D.numberRange(f.green,0,1)&&D.numberRange(f.blue,0,1)&&D.numberRange(f.alpha,0,1)}h.is=A})(l||(e.Color=l={}));var d;(function(h){function T(g,f){return{range:g,color:f}}h.create=T;function A(g){var f=g;return D.objectLiteral(f)&&a.is(f.range)&&l.is(f.color)}h.is=A})(d||(e.ColorInformation=d={}));var p;(function(h){function T(g,f,R){return{label:g,textEdit:f,additionalTextEdits:R}}h.create=T;function A(g){var f=g;return D.objectLiteral(f)&&D.string(f.label)&&(D.undefined(f.textEdit)||j.is(f))&&(D.undefined(f.additionalTextEdits)||D.typedArray(f.additionalTextEdits,j.is))}h.is=A})(p||(e.ColorPresentation=p={}));var y;(function(h){h.Comment="comment",h.Imports="imports",h.Region="region"})(y||(e.FoldingRangeKind=y={}));var v;(function(h){function T(g,f,R,$,pe,it){var Be={startLine:g,endLine:f};return D.defined(R)&&(Be.startCharacter=R),D.defined($)&&(Be.endCharacter=$),D.defined(pe)&&(Be.kind=pe),D.defined(it)&&(Be.collapsedText=it),Be}h.create=T;function A(g){var f=g;return D.objectLiteral(f)&&D.uinteger(f.startLine)&&D.uinteger(f.startLine)&&(D.undefined(f.startCharacter)||D.uinteger(f.startCharacter))&&(D.undefined(f.endCharacter)||D.uinteger(f.endCharacter))&&(D.undefined(f.kind)||D.string(f.kind))}h.is=A})(v||(e.FoldingRange=v={}));var x;(function(h){function T(g,f){return{location:g,message:f}}h.create=T;function A(g){var f=g;return D.defined(f)&&u.is(f.location)&&D.string(f.message)}h.is=A})(x||(e.DiagnosticRelatedInformation=x={}));var I;(function(h){h.Error=1,h.Warning=2,h.Information=3,h.Hint=4})(I||(e.DiagnosticSeverity=I={}));var P;(function(h){h.Unnecessary=1,h.Deprecated=2})(P||(e.DiagnosticTag=P={}));var w;(function(h){function T(A){var g=A;return D.objectLiteral(g)&&D.string(g.href)}h.is=T})(w||(e.CodeDescription=w={}));var E;(function(h){function T(g,f,R,$,pe,it){var Be={range:g,message:f};return D.defined(R)&&(Be.severity=R),D.defined($)&&(Be.code=$),D.defined(pe)&&(Be.source=pe),D.defined(it)&&(Be.relatedInformation=it),Be}h.create=T;function A(g){var f,R=g;return D.defined(R)&&a.is(R.range)&&D.string(R.message)&&(D.number(R.severity)||D.undefined(R.severity))&&(D.integer(R.code)||D.string(R.code)||D.undefined(R.code))&&(D.undefined(R.codeDescription)||D.string((f=R.codeDescription)===null||f===void 0?void 0:f.href))&&(D.string(R.source)||D.undefined(R.source))&&(D.undefined(R.relatedInformation)||D.typedArray(R.relatedInformation,x.is))}h.is=A})(E||(e.Diagnostic=E={}));var _;(function(h){function T(g,f){for(var R=[],$=2;$<arguments.length;$++)R[$-2]=arguments[$];var pe={title:g,command:f};return D.defined(R)&&R.length>0&&(pe.arguments=R),pe}h.create=T;function A(g){var f=g;return D.defined(f)&&D.string(f.title)&&D.string(f.command)}h.is=A})(_||(e.Command=_={}));var j;(function(h){function T(R,$){return{range:R,newText:$}}h.replace=T;function A(R,$){return{range:{start:R,end:R},newText:$}}h.insert=A;function g(R){return{range:R,newText:""}}h.del=g;function f(R){var $=R;return D.objectLiteral($)&&D.string($.newText)&&a.is($.range)}h.is=f})(j||(e.TextEdit=j={}));var O;(function(h){function T(g,f,R){var $={label:g};return f!==void 0&&($.needsConfirmation=f),R!==void 0&&($.description=R),$}h.create=T;function A(g){var f=g;return D.objectLiteral(f)&&D.string(f.label)&&(D.boolean(f.needsConfirmation)||f.needsConfirmation===void 0)&&(D.string(f.description)||f.description===void 0)}h.is=A})(O||(e.ChangeAnnotation=O={}));var H;(function(h){function T(A){var g=A;return D.string(g)}h.is=T})(H||(e.ChangeAnnotationIdentifier=H={}));var re;(function(h){function T(R,$,pe){return{range:R,newText:$,annotationId:pe}}h.replace=T;function A(R,$,pe){return{range:{start:R,end:R},newText:$,annotationId:pe}}h.insert=A;function g(R,$){return{range:R,newText:"",annotationId:$}}h.del=g;function f(R){var $=R;return j.is($)&&(O.is($.annotationId)||H.is($.annotationId))}h.is=f})(re||(e.AnnotatedTextEdit=re={}));var fe;(function(h){function T(g,f){return{textDocument:g,edits:f}}h.create=T;function A(g){var f=g;return D.defined(f)&&Pe.is(f.textDocument)&&Array.isArray(f.edits)}h.is=A})(fe||(e.TextDocumentEdit=fe={}));var U;(function(h){function T(g,f,R){var $={kind:"create",uri:g};return f!==void 0&&(f.overwrite!==void 0||f.ignoreIfExists!==void 0)&&($.options=f),R!==void 0&&($.annotationId=R),$}h.create=T;function A(g){var f=g;return f&&f.kind==="create"&&D.string(f.uri)&&(f.options===void 0||(f.options.overwrite===void 0||D.boolean(f.options.overwrite))&&(f.options.ignoreIfExists===void 0||D.boolean(f.options.ignoreIfExists)))&&(f.annotationId===void 0||H.is(f.annotationId))}h.is=A})(U||(e.CreateFile=U={}));var k;(function(h){function T(g,f,R,$){var pe={kind:"rename",oldUri:g,newUri:f};return R!==void 0&&(R.overwrite!==void 0||R.ignoreIfExists!==void 0)&&(pe.options=R),$!==void 0&&(pe.annotationId=$),pe}h.create=T;function A(g){var f=g;return f&&f.kind==="rename"&&D.string(f.oldUri)&&D.string(f.newUri)&&(f.options===void 0||(f.options.overwrite===void 0||D.boolean(f.options.overwrite))&&(f.options.ignoreIfExists===void 0||D.boolean(f.options.ignoreIfExists)))&&(f.annotationId===void 0||H.is(f.annotationId))}h.is=A})(k||(e.RenameFile=k={}));var M;(function(h){function T(g,f,R){var $={kind:"delete",uri:g};return f!==void 0&&(f.recursive!==void 0||f.ignoreIfNotExists!==void 0)&&($.options=f),R!==void 0&&($.annotationId=R),$}h.create=T;function A(g){var f=g;return f&&f.kind==="delete"&&D.string(f.uri)&&(f.options===void 0||(f.options.recursive===void 0||D.boolean(f.options.recursive))&&(f.options.ignoreIfNotExists===void 0||D.boolean(f.options.ignoreIfNotExists)))&&(f.annotationId===void 0||H.is(f.annotationId))}h.is=A})(M||(e.DeleteFile=M={}));var L;(function(h){function T(A){var g=A;return g&&(g.changes!==void 0||g.documentChanges!==void 0)&&(g.documentChanges===void 0||g.documentChanges.every(function(f){return D.string(f.kind)?U.is(f)||k.is(f)||M.is(f):fe.is(f)}))}h.is=T})(L||(e.WorkspaceEdit=L={}));var q=function(){function h(T,A){this.edits=T,this.changeAnnotations=A}return h.prototype.insert=function(T,A,g){var f,R;if(g===void 0?f=j.insert(T,A):H.is(g)?(R=g,f=re.insert(T,A,g)):(this.assertChangeAnnotations(this.changeAnnotations),R=this.changeAnnotations.manage(g),f=re.insert(T,A,R)),this.edits.push(f),R!==void 0)return R},h.prototype.replace=function(T,A,g){var f,R;if(g===void 0?f=j.replace(T,A):H.is(g)?(R=g,f=re.replace(T,A,g)):(this.assertChangeAnnotations(this.changeAnnotations),R=this.changeAnnotations.manage(g),f=re.replace(T,A,R)),this.edits.push(f),R!==void 0)return R},h.prototype.delete=function(T,A){var g,f;if(A===void 0?g=j.del(T):H.is(A)?(f=A,g=re.del(T,A)):(this.assertChangeAnnotations(this.changeAnnotations),f=this.changeAnnotations.manage(A),g=re.del(T,f)),this.edits.push(g),f!==void 0)return f},h.prototype.add=function(T){this.edits.push(T)},h.prototype.all=function(){return this.edits},h.prototype.clear=function(){this.edits.splice(0,this.edits.length)},h.prototype.assertChangeAnnotations=function(T){if(T===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},h}(),ce=function(){function h(T){this._annotations=T===void 0?Object.create(null):T,this._counter=0,this._size=0}return h.prototype.all=function(){return this._annotations},Object.defineProperty(h.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),h.prototype.manage=function(T,A){var g;if(H.is(T)?g=T:(g=this.nextId(),A=T),this._annotations[g]!==void 0)throw new Error("Id ".concat(g," is already in use."));if(A===void 0)throw new Error("No annotation provided for id ".concat(g));return this._annotations[g]=A,this._size++,g},h.prototype.nextId=function(){return this._counter++,this._counter.toString()},h}(),ae=function(){function h(T){var A=this;this._textEditChanges=Object.create(null),T!==void 0?(this._workspaceEdit=T,T.documentChanges?(this._changeAnnotations=new ce(T.changeAnnotations),T.changeAnnotations=this._changeAnnotations.all(),T.documentChanges.forEach(function(g){if(fe.is(g)){var f=new q(g.edits,A._changeAnnotations);A._textEditChanges[g.textDocument.uri]=f}})):T.changes&&Object.keys(T.changes).forEach(function(g){var f=new q(T.changes[g]);A._textEditChanges[g]=f})):this._workspaceEdit={}}return Object.defineProperty(h.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}),h.prototype.getTextEditChange=function(T){if(Pe.is(T)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var A={uri:T.uri,version:T.version},g=this._textEditChanges[A.uri];if(!g){var f=[],R={textDocument:A,edits:f};this._workspaceEdit.documentChanges.push(R),g=new q(f,this._changeAnnotations),this._textEditChanges[A.uri]=g}return g}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var g=this._textEditChanges[T];if(!g){var f=[];this._workspaceEdit.changes[T]=f,g=new q(f),this._textEditChanges[T]=g}return g}},h.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new ce,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},h.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},h.prototype.createFile=function(T,A,g){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var f;O.is(A)||H.is(A)?f=A:g=A;var R,$;if(f===void 0?R=U.create(T,g):($=H.is(f)?f:this._changeAnnotations.manage(f),R=U.create(T,g,$)),this._workspaceEdit.documentChanges.push(R),$!==void 0)return $},h.prototype.renameFile=function(T,A,g,f){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var R;O.is(g)||H.is(g)?R=g:f=g;var $,pe;if(R===void 0?$=k.create(T,A,f):(pe=H.is(R)?R:this._changeAnnotations.manage(R),$=k.create(T,A,f,pe)),this._workspaceEdit.documentChanges.push($),pe!==void 0)return pe},h.prototype.deleteFile=function(T,A,g){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var f;O.is(A)||H.is(A)?f=A:g=A;var R,$;if(f===void 0?R=M.create(T,g):($=H.is(f)?f:this._changeAnnotations.manage(f),R=M.create(T,g,$)),this._workspaceEdit.documentChanges.push(R),$!==void 0)return $},h}();e.WorkspaceChange=ae;var Ct;(function(h){function T(g){return{uri:g}}h.create=T;function A(g){var f=g;return D.defined(f)&&D.string(f.uri)}h.is=A})(Ct||(e.TextDocumentIdentifier=Ct={}));var dt;(function(h){function T(g,f){return{uri:g,version:f}}h.create=T;function A(g){var f=g;return D.defined(f)&&D.string(f.uri)&&D.integer(f.version)}h.is=A})(dt||(e.VersionedTextDocumentIdentifier=dt={}));var Pe;(function(h){function T(g,f){return{uri:g,version:f}}h.create=T;function A(g){var f=g;return D.defined(f)&&D.string(f.uri)&&(f.version===null||D.integer(f.version))}h.is=A})(Pe||(e.OptionalVersionedTextDocumentIdentifier=Pe={}));var rn;(function(h){function T(g,f,R,$){return{uri:g,languageId:f,version:R,text:$}}h.create=T;function A(g){var f=g;return D.defined(f)&&D.string(f.uri)&&D.string(f.languageId)&&D.integer(f.version)&&D.string(f.text)}h.is=A})(rn||(e.TextDocumentItem=rn={}));var ls;(function(h){h.PlainText="plaintext",h.Markdown="markdown";function T(A){var g=A;return g===h.PlainText||g===h.Markdown}h.is=T})(ls||(e.MarkupKind=ls={}));var ki;(function(h){function T(A){var g=A;return D.objectLiteral(A)&&ls.is(g.kind)&&D.string(g.value)}h.is=T})(ki||(e.MarkupContent=ki={}));var Ja;(function(h){h.Text=1,h.Method=2,h.Function=3,h.Constructor=4,h.Field=5,h.Variable=6,h.Class=7,h.Interface=8,h.Module=9,h.Property=10,h.Unit=11,h.Value=12,h.Enum=13,h.Keyword=14,h.Snippet=15,h.Color=16,h.File=17,h.Reference=18,h.Folder=19,h.EnumMember=20,h.Constant=21,h.Struct=22,h.Event=23,h.Operator=24,h.TypeParameter=25})(Ja||(e.CompletionItemKind=Ja={}));var ko;(function(h){h.PlainText=1,h.Snippet=2})(ko||(e.InsertTextFormat=ko={}));var Co;(function(h){h.Deprecated=1})(Co||(e.CompletionItemTag=Co={}));var Qa;(function(h){function T(g,f,R){return{newText:g,insert:f,replace:R}}h.create=T;function A(g){var f=g;return f&&D.string(f.newText)&&a.is(f.insert)&&a.is(f.replace)}h.is=A})(Qa||(e.InsertReplaceEdit=Qa={}));var Za;(function(h){h.asIs=1,h.adjustIndentation=2})(Za||(e.InsertTextMode=Za={}));var eu;(function(h){function T(A){var g=A;return g&&(D.string(g.detail)||g.detail===void 0)&&(D.string(g.description)||g.description===void 0)}h.is=T})(eu||(e.CompletionItemLabelDetails=eu={}));var tu;(function(h){function T(A){return{label:A}}h.create=T})(tu||(e.CompletionItem=tu={}));var nu;(function(h){function T(A,g){return{items:A||[],isIncomplete:!!g}}h.create=T})(nu||(e.CompletionList=nu={}));var ds;(function(h){function T(g){return g.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}h.fromPlainText=T;function A(g){var f=g;return D.string(f)||D.objectLiteral(f)&&D.string(f.language)&&D.string(f.value)}h.is=A})(ds||(e.MarkedString=ds={}));var Hn;(function(h){function T(A){var g=A;return!!g&&D.objectLiteral(g)&&(ki.is(g.contents)||ds.is(g.contents)||D.typedArray(g.contents,ds.is))&&(A.range===void 0||a.is(A.range))}h.is=T})(Hn||(e.Hover=Hn={}));var ru;(function(h){function T(A,g){return g?{label:A,documentation:g}:{label:A}}h.create=T})(ru||(e.ParameterInformation=ru={}));var iu;(function(h){function T(A,g){for(var f=[],R=2;R<arguments.length;R++)f[R-2]=arguments[R];var $={label:A};return D.defined(g)&&($.documentation=g),D.defined(f)?$.parameters=f:$.parameters=[],$}h.create=T})(iu||(e.SignatureInformation=iu={}));var Ci;(function(h){h.Text=1,h.Read=2,h.Write=3})(Ci||(e.DocumentHighlightKind=Ci={}));var su;(function(h){function T(A,g){var f={range:A};return D.number(g)&&(f.kind=g),f}h.create=T})(su||(e.DocumentHighlight=su={}));var fs;(function(h){h.File=1,h.Module=2,h.Namespace=3,h.Package=4,h.Class=5,h.Method=6,h.Property=7,h.Field=8,h.Constructor=9,h.Enum=10,h.Interface=11,h.Function=12,h.Variable=13,h.Constant=14,h.String=15,h.Number=16,h.Boolean=17,h.Array=18,h.Object=19,h.Key=20,h.Null=21,h.EnumMember=22,h.Struct=23,h.Event=24,h.Operator=25,h.TypeParameter=26})(fs||(e.SymbolKind=fs={}));var ou;(function(h){h.Deprecated=1})(ou||(e.SymbolTag=ou={}));var wr;(function(h){function T(A,g,f,R,$){var pe={name:A,kind:g,location:{uri:R,range:f}};return $&&(pe.containerName=$),pe}h.create=T})(wr||(e.SymbolInformation=wr={}));var Hr;(function(h){function T(A,g,f,R){return R!==void 0?{name:A,kind:g,location:{uri:f,range:R}}:{name:A,kind:g,location:{uri:f}}}h.create=T})(Hr||(e.WorkspaceSymbol=Hr={}));var au;(function(h){function T(g,f,R,$,pe,it){var Be={name:g,detail:f,kind:R,range:$,selectionRange:pe};return it!==void 0&&(Be.children=it),Be}h.create=T;function A(g){var f=g;return f&&D.string(f.name)&&D.number(f.kind)&&a.is(f.range)&&a.is(f.selectionRange)&&(f.detail===void 0||D.string(f.detail))&&(f.deprecated===void 0||D.boolean(f.deprecated))&&(f.children===void 0||Array.isArray(f.children))&&(f.tags===void 0||Array.isArray(f.tags))}h.is=A})(au||(e.DocumentSymbol=au={}));var uu;(function(h){h.Empty="",h.QuickFix="quickfix",h.Refactor="refactor",h.RefactorExtract="refactor.extract",h.RefactorInline="refactor.inline",h.RefactorRewrite="refactor.rewrite",h.Source="source",h.SourceOrganizeImports="source.organizeImports",h.SourceFixAll="source.fixAll"})(uu||(e.CodeActionKind=uu={}));var rr;(function(h){h.Invoked=1,h.Automatic=2})(rr||(e.CodeActionTriggerKind=rr={}));var Oo;(function(h){function T(g,f,R){var $={diagnostics:g};return f!=null&&($.only=f),R!=null&&($.triggerKind=R),$}h.create=T;function A(g){var f=g;return D.defined(f)&&D.typedArray(f.diagnostics,E.is)&&(f.only===void 0||D.typedArray(f.only,D.string))&&(f.triggerKind===void 0||f.triggerKind===rr.Invoked||f.triggerKind===rr.Automatic)}h.is=A})(Oo||(e.CodeActionContext=Oo={}));var Ro;(function(h){function T(g,f,R){var $={title:g},pe=!0;return typeof f=="string"?(pe=!1,$.kind=f):_.is(f)?$.command=f:$.edit=f,pe&&R!==void 0&&($.kind=R),$}h.create=T;function A(g){var f=g;return f&&D.string(f.title)&&(f.diagnostics===void 0||D.typedArray(f.diagnostics,E.is))&&(f.kind===void 0||D.string(f.kind))&&(f.edit!==void 0||f.command!==void 0)&&(f.command===void 0||_.is(f.command))&&(f.isPreferred===void 0||D.boolean(f.isPreferred))&&(f.edit===void 0||L.is(f.edit))}h.is=A})(Ro||(e.CodeAction=Ro={}));var ps;(function(h){function T(g,f){var R={range:g};return D.defined(f)&&(R.data=f),R}h.create=T;function A(g){var f=g;return D.defined(f)&&a.is(f.range)&&(D.undefined(f.command)||_.is(f.command))}h.is=A})(ps||(e.CodeLens=ps={}));var Do;(function(h){function T(g,f){return{tabSize:g,insertSpaces:f}}h.create=T;function A(g){var f=g;return D.defined(f)&&D.uinteger(f.tabSize)&&D.boolean(f.insertSpaces)}h.is=A})(Do||(e.FormattingOptions=Do={}));var Er;(function(h){function T(g,f,R){return{range:g,target:f,data:R}}h.create=T;function A(g){var f=g;return D.defined(f)&&a.is(f.range)&&(D.undefined(f.target)||D.string(f.target))}h.is=A})(Er||(e.DocumentLink=Er={}));var S;(function(h){function T(g,f){return{range:g,parent:f}}h.create=T;function A(g){var f=g;return D.objectLiteral(f)&&a.is(f.range)&&(f.parent===void 0||h.is(f.parent))}h.is=A})(S||(e.SelectionRange=S={}));var F;(function(h){h.namespace="namespace",h.type="type",h.class="class",h.enum="enum",h.interface="interface",h.struct="struct",h.typeParameter="typeParameter",h.parameter="parameter",h.variable="variable",h.property="property",h.enumMember="enumMember",h.event="event",h.function="function",h.method="method",h.macro="macro",h.keyword="keyword",h.modifier="modifier",h.comment="comment",h.string="string",h.number="number",h.regexp="regexp",h.operator="operator",h.decorator="decorator"})(F||(e.SemanticTokenTypes=F={}));var W;(function(h){h.declaration="declaration",h.definition="definition",h.readonly="readonly",h.static="static",h.deprecated="deprecated",h.abstract="abstract",h.async="async",h.modification="modification",h.documentation="documentation",h.defaultLibrary="defaultLibrary"})(W||(e.SemanticTokenModifiers=W={}));var X;(function(h){function T(A){var g=A;return D.objectLiteral(g)&&(g.resultId===void 0||typeof g.resultId=="string")&&Array.isArray(g.data)&&(g.data.length===0||typeof g.data[0]=="number")}h.is=T})(X||(e.SemanticTokens=X={}));var qe;(function(h){function T(g,f){return{range:g,text:f}}h.create=T;function A(g){var f=g;return f!=null&&a.is(f.range)&&D.string(f.text)}h.is=A})(qe||(e.InlineValueText=qe={}));var De;(function(h){function T(g,f,R){return{range:g,variableName:f,caseSensitiveLookup:R}}h.create=T;function A(g){var f=g;return f!=null&&a.is(f.range)&&D.boolean(f.caseSensitiveLookup)&&(D.string(f.variableName)||f.variableName===void 0)}h.is=A})(De||(e.InlineValueVariableLookup=De={}));var We;(function(h){function T(g,f){return{range:g,expression:f}}h.create=T;function A(g){var f=g;return f!=null&&a.is(f.range)&&(D.string(f.expression)||f.expression===void 0)}h.is=A})(We||(e.InlineValueEvaluatableExpression=We={}));var Ye;(function(h){function T(g,f){return{frameId:g,stoppedLocation:f}}h.create=T;function A(g){var f=g;return D.defined(f)&&a.is(g.stoppedLocation)}h.is=A})(Ye||(e.InlineValueContext=Ye={}));var _e;(function(h){h.Type=1,h.Parameter=2;function T(A){return A===1||A===2}h.is=T})(_e||(e.InlayHintKind=_e={}));var $e;(function(h){function T(g){return{value:g}}h.create=T;function A(g){var f=g;return D.objectLiteral(f)&&(f.tooltip===void 0||D.string(f.tooltip)||ki.is(f.tooltip))&&(f.location===void 0||u.is(f.location))&&(f.command===void 0||_.is(f.command))}h.is=A})($e||(e.InlayHintLabelPart=$e={}));var Ae;(function(h){function T(g,f,R){var $={position:g,label:f};return R!==void 0&&($.kind=R),$}h.create=T;function A(g){var f=g;return D.objectLiteral(f)&&o.is(f.position)&&(D.string(f.label)||D.typedArray(f.label,$e.is))&&(f.kind===void 0||_e.is(f.kind))&&f.textEdits===void 0||D.typedArray(f.textEdits,j.is)&&(f.tooltip===void 0||D.string(f.tooltip)||ki.is(f.tooltip))&&(f.paddingLeft===void 0||D.boolean(f.paddingLeft))&&(f.paddingRight===void 0||D.boolean(f.paddingRight))}h.is=A})(Ae||(e.InlayHint=Ae={}));var rt;(function(h){function T(A){return{kind:"snippet",value:A}}h.createSnippet=T})(rt||(e.StringValue=rt={}));var Ot;(function(h){function T(A,g,f,R){return{insertText:A,filterText:g,range:f,command:R}}h.create=T})(Ot||(e.InlineCompletionItem=Ot={}));var hn;(function(h){function T(A){return{items:A}}h.create=T})(hn||(e.InlineCompletionList=hn={}));var cu;(function(h){h.Invoked=0,h.Automatic=1})(cu||(e.InlineCompletionTriggerKind=cu={}));var Fb;(function(h){function T(A,g){return{range:A,text:g}}h.create=T})(Fb||(e.SelectedCompletionInfo=Fb={}));var $b;(function(h){function T(A,g){return{triggerKind:A,selectedCompletionInfo:g}}h.create=T})($b||(e.InlineCompletionContext=$b={}));var Bb;(function(h){function T(A){var g=A;return D.objectLiteral(g)&&r.is(g.uri)&&D.string(g.name)}h.is=T})(Bb||(e.WorkspaceFolder=Bb={})),e.EOL=[`
32
32
  `,`\r
33
33
  `,"\r"];var Ub;(function(h){function T(R,$,pe,it){return new kk(R,$,pe,it)}h.create=T;function A(R){var $=R;return!!(D.defined($)&&D.string($.uri)&&(D.undefined($.languageId)||D.string($.languageId))&&D.uinteger($.lineCount)&&D.func($.getText)&&D.func($.positionAt)&&D.func($.offsetAt))}h.is=A;function g(R,$){for(var pe=R.getText(),it=f($,function(hs,lu){var Hb=hs.range.start.line-lu.range.start.line;return Hb===0?hs.range.start.character-lu.range.start.character:Hb}),Be=pe.length,Wn=it.length-1;Wn>=0;Wn--){var Gn=it[Wn],Ar=R.offsetAt(Gn.range.start),ve=R.offsetAt(Gn.range.end);if(ve<=Be)pe=pe.substring(0,Ar)+Gn.newText+pe.substring(ve,pe.length);else throw new Error("Overlapping edit");Be=Ar}return pe}h.applyEdits=g;function f(R,$){if(R.length<=1)return R;var pe=R.length/2|0,it=R.slice(0,pe),Be=R.slice(pe);f(it,$),f(Be,$);for(var Wn=0,Gn=0,Ar=0;Wn<it.length&&Gn<Be.length;){var ve=$(it[Wn],Be[Gn]);ve<=0?R[Ar++]=it[Wn++]:R[Ar++]=Be[Gn++]}for(;Wn<it.length;)R[Ar++]=it[Wn++];for(;Gn<Be.length;)R[Ar++]=Be[Gn++];return R}})(Ub||(e.TextDocument=Ub={}));var kk=function(){function h(T,A,g,f){this._uri=T,this._languageId=A,this._version=g,this._content=f,this._lineOffsets=void 0}return Object.defineProperty(h.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),h.prototype.getText=function(T){if(T){var A=this.offsetAt(T.start),g=this.offsetAt(T.end);return this._content.substring(A,g)}return this._content},h.prototype.update=function(T,A){this._content=T.text,this._version=A,this._lineOffsets=void 0},h.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var T=[],A=this._content,g=!0,f=0;f<A.length;f++){g&&(T.push(f),g=!1);var R=A.charAt(f);g=R==="\r"||R===`
34
34
  `,R==="\r"&&f+1<A.length&&A.charAt(f+1)===`
35
- `&&f++}g&&A.length>0&&T.push(A.length),this._lineOffsets=T}return this._lineOffsets},h.prototype.positionAt=function(T){T=Math.max(Math.min(T,this._content.length),0);var A=this.getLineOffsets(),g=0,f=A.length;if(f===0)return o.create(0,T);for(;g<f;){var R=Math.floor((g+f)/2);A[R]>T?f=R:g=R+1}var $=g-1;return o.create($,T-A[$])},h.prototype.offsetAt=function(T){var A=this.getLineOffsets();if(T.line>=A.length)return this._content.length;if(T.line<0)return 0;var g=A[T.line],f=T.line+1<A.length?A[T.line+1]:this._content.length;return Math.max(Math.min(g+T.character,f),g)},Object.defineProperty(h.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),h}(),D;(function(h){var T=Object.prototype.toString;function A(ve){return typeof ve<"u"}h.defined=A;function g(ve){return typeof ve>"u"}h.undefined=g;function f(ve){return ve===!0||ve===!1}h.boolean=f;function R(ve){return T.call(ve)==="[object String]"}h.string=R;function $(ve){return T.call(ve)==="[object Number]"}h.number=$;function pe(ve,hs,lu){return T.call(ve)==="[object Number]"&&hs<=ve&&ve<=lu}h.numberRange=pe;function it(ve){return T.call(ve)==="[object Number]"&&-2147483648<=ve&&ve<=2147483647}h.integer=it;function Be(ve){return T.call(ve)==="[object Number]"&&0<=ve&&ve<=2147483647}h.uinteger=Be;function Wn(ve){return T.call(ve)==="[object Function]"}h.func=Wn;function Gn(ve){return ve!==null&&typeof ve=="object"}h.objectLiteral=Gn;function Ar(ve,hs){return Array.isArray(ve)&&ve.every(hs)}h.typedArray=Ar})(D||(D={}))})});var Je=m(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.ProtocolNotificationType=on.ProtocolNotificationType0=on.ProtocolRequestType=on.ProtocolRequestType0=on.RegistrationType=on.MessageDirection=void 0;var ws=Ii(),E_;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(E_||(on.MessageDirection=E_={}));var lp=class{constructor(e){this.method=e}};on.RegistrationType=lp;var dp=class extends ws.RequestType0{constructor(e){super(e)}};on.ProtocolRequestType0=dp;var fp=class extends ws.RequestType{constructor(e){super(e,ws.ParameterStructures.byName)}};on.ProtocolRequestType=fp;var pp=class extends ws.NotificationType0{constructor(e){super(e)}};on.ProtocolNotificationType0=pp;var hp=class extends ws.NotificationType{constructor(e){super(e,ws.ParameterStructures.byName)}};on.ProtocolNotificationType=hp});var Lu=m(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.objectLiteral=bt.typedArray=bt.stringArray=bt.array=bt.func=bt.error=bt.number=bt.string=bt.boolean=void 0;function SC(t){return t===!0||t===!1}bt.boolean=SC;function A_(t){return typeof t=="string"||t instanceof String}bt.string=A_;function TC(t){return typeof t=="number"||t instanceof Number}bt.number=TC;function wC(t){return t instanceof Error}bt.error=wC;function EC(t){return typeof t=="function"}bt.func=EC;function x_(t){return Array.isArray(t)}bt.array=x_;function AC(t){return x_(t)&&t.every(e=>A_(e))}bt.stringArray=AC;function xC(t,e){return Array.isArray(t)&&t.every(e)}bt.typedArray=xC;function kC(t){return t!==null&&typeof t=="object"}bt.objectLiteral=kC});var O_=m(Nu=>{"use strict";Object.defineProperty(Nu,"__esModule",{value:!0});Nu.ImplementationRequest=void 0;var k_=Je(),C_;(function(t){t.method="textDocument/implementation",t.messageDirection=k_.MessageDirection.clientToServer,t.type=new k_.ProtocolRequestType(t.method)})(C_||(Nu.ImplementationRequest=C_={}))});var I_=m(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});qu.TypeDefinitionRequest=void 0;var R_=Je(),D_;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=R_.MessageDirection.clientToServer,t.type=new R_.ProtocolRequestType(t.method)})(D_||(qu.TypeDefinitionRequest=D_={}))});var L_=m(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.DidChangeWorkspaceFoldersNotification=Es.WorkspaceFoldersRequest=void 0;var ju=Je(),P_;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=ju.MessageDirection.serverToClient,t.type=new ju.ProtocolRequestType0(t.method)})(P_||(Es.WorkspaceFoldersRequest=P_={}));var M_;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=ju.MessageDirection.clientToServer,t.type=new ju.ProtocolNotificationType(t.method)})(M_||(Es.DidChangeWorkspaceFoldersNotification=M_={}))});var j_=m(Fu=>{"use strict";Object.defineProperty(Fu,"__esModule",{value:!0});Fu.ConfigurationRequest=void 0;var N_=Je(),q_;(function(t){t.method="workspace/configuration",t.messageDirection=N_.MessageDirection.serverToClient,t.type=new N_.ProtocolRequestType(t.method)})(q_||(Fu.ConfigurationRequest=q_={}))});var B_=m(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.ColorPresentationRequest=As.DocumentColorRequest=void 0;var $u=Je(),F_;(function(t){t.method="textDocument/documentColor",t.messageDirection=$u.MessageDirection.clientToServer,t.type=new $u.ProtocolRequestType(t.method)})(F_||(As.DocumentColorRequest=F_={}));var $_;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=$u.MessageDirection.clientToServer,t.type=new $u.ProtocolRequestType(t.method)})($_||(As.ColorPresentationRequest=$_={}))});var W_=m(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});xs.FoldingRangeRefreshRequest=xs.FoldingRangeRequest=void 0;var Bu=Je(),U_;(function(t){t.method="textDocument/foldingRange",t.messageDirection=Bu.MessageDirection.clientToServer,t.type=new Bu.ProtocolRequestType(t.method)})(U_||(xs.FoldingRangeRequest=U_={}));var H_;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=Bu.MessageDirection.serverToClient,t.type=new Bu.ProtocolRequestType0(t.method)})(H_||(xs.FoldingRangeRefreshRequest=H_={}))});var z_=m(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});Uu.DeclarationRequest=void 0;var G_=Je(),V_;(function(t){t.method="textDocument/declaration",t.messageDirection=G_.MessageDirection.clientToServer,t.type=new G_.ProtocolRequestType(t.method)})(V_||(Uu.DeclarationRequest=V_={}))});var Y_=m(Hu=>{"use strict";Object.defineProperty(Hu,"__esModule",{value:!0});Hu.SelectionRangeRequest=void 0;var K_=Je(),X_;(function(t){t.method="textDocument/selectionRange",t.messageDirection=K_.MessageDirection.clientToServer,t.type=new K_.ProtocolRequestType(t.method)})(X_||(Hu.SelectionRangeRequest=X_={}))});var ev=m(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.WorkDoneProgressCancelNotification=Kr.WorkDoneProgressCreateRequest=Kr.WorkDoneProgress=void 0;var CC=Ii(),Wu=Je(),J_;(function(t){t.type=new CC.ProgressType;function e(n){return n===t.type}t.is=e})(J_||(Kr.WorkDoneProgress=J_={}));var Q_;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=Wu.MessageDirection.serverToClient,t.type=new Wu.ProtocolRequestType(t.method)})(Q_||(Kr.WorkDoneProgressCreateRequest=Q_={}));var Z_;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=Wu.MessageDirection.clientToServer,t.type=new Wu.ProtocolNotificationType(t.method)})(Z_||(Kr.WorkDoneProgressCancelNotification=Z_={}))});var iv=m(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.CallHierarchyOutgoingCallsRequest=Xr.CallHierarchyIncomingCallsRequest=Xr.CallHierarchyPrepareRequest=void 0;var ks=Je(),tv;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=ks.MessageDirection.clientToServer,t.type=new ks.ProtocolRequestType(t.method)})(tv||(Xr.CallHierarchyPrepareRequest=tv={}));var nv;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=ks.MessageDirection.clientToServer,t.type=new ks.ProtocolRequestType(t.method)})(nv||(Xr.CallHierarchyIncomingCallsRequest=nv={}));var rv;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=ks.MessageDirection.clientToServer,t.type=new ks.ProtocolRequestType(t.method)})(rv||(Xr.CallHierarchyOutgoingCallsRequest=rv={}))});var lv=m(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.SemanticTokensRefreshRequest=an.SemanticTokensRangeRequest=an.SemanticTokensDeltaRequest=an.SemanticTokensRequest=an.SemanticTokensRegistrationType=an.TokenFormat=void 0;var kr=Je(),sv;(function(t){t.Relative="relative"})(sv||(an.TokenFormat=sv={}));var jo;(function(t){t.method="textDocument/semanticTokens",t.type=new kr.RegistrationType(t.method)})(jo||(an.SemanticTokensRegistrationType=jo={}));var ov;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=kr.MessageDirection.clientToServer,t.type=new kr.ProtocolRequestType(t.method),t.registrationMethod=jo.method})(ov||(an.SemanticTokensRequest=ov={}));var av;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=kr.MessageDirection.clientToServer,t.type=new kr.ProtocolRequestType(t.method),t.registrationMethod=jo.method})(av||(an.SemanticTokensDeltaRequest=av={}));var uv;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=kr.MessageDirection.clientToServer,t.type=new kr.ProtocolRequestType(t.method),t.registrationMethod=jo.method})(uv||(an.SemanticTokensRangeRequest=uv={}));var cv;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=kr.MessageDirection.serverToClient,t.type=new kr.ProtocolRequestType0(t.method)})(cv||(an.SemanticTokensRefreshRequest=cv={}))});var pv=m(Gu=>{"use strict";Object.defineProperty(Gu,"__esModule",{value:!0});Gu.ShowDocumentRequest=void 0;var dv=Je(),fv;(function(t){t.method="window/showDocument",t.messageDirection=dv.MessageDirection.serverToClient,t.type=new dv.ProtocolRequestType(t.method)})(fv||(Gu.ShowDocumentRequest=fv={}))});var gv=m(Vu=>{"use strict";Object.defineProperty(Vu,"__esModule",{value:!0});Vu.LinkedEditingRangeRequest=void 0;var hv=Je(),mv;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=hv.MessageDirection.clientToServer,t.type=new hv.ProtocolRequestType(t.method)})(mv||(Vu.LinkedEditingRangeRequest=mv={}))});var Ev=m(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.WillDeleteFilesRequest=Bt.DidDeleteFilesNotification=Bt.DidRenameFilesNotification=Bt.WillRenameFilesRequest=Bt.DidCreateFilesNotification=Bt.WillCreateFilesRequest=Bt.FileOperationPatternKind=void 0;var En=Je(),yv;(function(t){t.file="file",t.folder="folder"})(yv||(Bt.FileOperationPatternKind=yv={}));var bv;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=En.MessageDirection.clientToServer,t.type=new En.ProtocolRequestType(t.method)})(bv||(Bt.WillCreateFilesRequest=bv={}));var _v;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=En.MessageDirection.clientToServer,t.type=new En.ProtocolNotificationType(t.method)})(_v||(Bt.DidCreateFilesNotification=_v={}));var vv;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=En.MessageDirection.clientToServer,t.type=new En.ProtocolRequestType(t.method)})(vv||(Bt.WillRenameFilesRequest=vv={}));var Sv;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=En.MessageDirection.clientToServer,t.type=new En.ProtocolNotificationType(t.method)})(Sv||(Bt.DidRenameFilesNotification=Sv={}));var Tv;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=En.MessageDirection.clientToServer,t.type=new En.ProtocolNotificationType(t.method)})(Tv||(Bt.DidDeleteFilesNotification=Tv={}));var wv;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=En.MessageDirection.clientToServer,t.type=new En.ProtocolRequestType(t.method)})(wv||(Bt.WillDeleteFilesRequest=wv={}))});var Ov=m(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.MonikerRequest=Yr.MonikerKind=Yr.UniquenessLevel=void 0;var Av=Je(),xv;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(xv||(Yr.UniquenessLevel=xv={}));var kv;(function(t){t.$import="import",t.$export="export",t.local="local"})(kv||(Yr.MonikerKind=kv={}));var Cv;(function(t){t.method="textDocument/moniker",t.messageDirection=Av.MessageDirection.clientToServer,t.type=new Av.ProtocolRequestType(t.method)})(Cv||(Yr.MonikerRequest=Cv={}))});var Pv=m(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.TypeHierarchySubtypesRequest=Jr.TypeHierarchySupertypesRequest=Jr.TypeHierarchyPrepareRequest=void 0;var Cs=Je(),Rv;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=Cs.MessageDirection.clientToServer,t.type=new Cs.ProtocolRequestType(t.method)})(Rv||(Jr.TypeHierarchyPrepareRequest=Rv={}));var Dv;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=Cs.MessageDirection.clientToServer,t.type=new Cs.ProtocolRequestType(t.method)})(Dv||(Jr.TypeHierarchySupertypesRequest=Dv={}));var Iv;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=Cs.MessageDirection.clientToServer,t.type=new Cs.ProtocolRequestType(t.method)})(Iv||(Jr.TypeHierarchySubtypesRequest=Iv={}))});var Nv=m(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.InlineValueRefreshRequest=Os.InlineValueRequest=void 0;var zu=Je(),Mv;(function(t){t.method="textDocument/inlineValue",t.messageDirection=zu.MessageDirection.clientToServer,t.type=new zu.ProtocolRequestType(t.method)})(Mv||(Os.InlineValueRequest=Mv={}));var Lv;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=zu.MessageDirection.serverToClient,t.type=new zu.ProtocolRequestType0(t.method)})(Lv||(Os.InlineValueRefreshRequest=Lv={}))});var $v=m(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.InlayHintRefreshRequest=Qr.InlayHintResolveRequest=Qr.InlayHintRequest=void 0;var Rs=Je(),qv;(function(t){t.method="textDocument/inlayHint",t.messageDirection=Rs.MessageDirection.clientToServer,t.type=new Rs.ProtocolRequestType(t.method)})(qv||(Qr.InlayHintRequest=qv={}));var jv;(function(t){t.method="inlayHint/resolve",t.messageDirection=Rs.MessageDirection.clientToServer,t.type=new Rs.ProtocolRequestType(t.method)})(jv||(Qr.InlayHintResolveRequest=jv={}));var Fv;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=Rs.MessageDirection.serverToClient,t.type=new Rs.ProtocolRequestType0(t.method)})(Fv||(Qr.InlayHintRefreshRequest=Fv={}))});var zv=m(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.DiagnosticRefreshRequest=An.WorkspaceDiagnosticRequest=An.DocumentDiagnosticRequest=An.DocumentDiagnosticReportKind=An.DiagnosticServerCancellationData=void 0;var Vv=Ii(),OC=Lu(),Ds=Je(),Bv;(function(t){function e(n){let r=n;return r&&OC.boolean(r.retriggerRequest)}t.is=e})(Bv||(An.DiagnosticServerCancellationData=Bv={}));var Uv;(function(t){t.Full="full",t.Unchanged="unchanged"})(Uv||(An.DocumentDiagnosticReportKind=Uv={}));var Hv;(function(t){t.method="textDocument/diagnostic",t.messageDirection=Ds.MessageDirection.clientToServer,t.type=new Ds.ProtocolRequestType(t.method),t.partialResult=new Vv.ProgressType})(Hv||(An.DocumentDiagnosticRequest=Hv={}));var Wv;(function(t){t.method="workspace/diagnostic",t.messageDirection=Ds.MessageDirection.clientToServer,t.type=new Ds.ProtocolRequestType(t.method),t.partialResult=new Vv.ProgressType})(Wv||(An.WorkspaceDiagnosticRequest=Wv={}));var Gv;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=Ds.MessageDirection.serverToClient,t.type=new Ds.ProtocolRequestType0(t.method)})(Gv||(An.DiagnosticRefreshRequest=Gv={}))});var eS=m(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.DidCloseNotebookDocumentNotification=st.DidSaveNotebookDocumentNotification=st.DidChangeNotebookDocumentNotification=st.NotebookCellArrayChange=st.DidOpenNotebookDocumentNotification=st.NotebookDocumentSyncRegistrationType=st.NotebookDocument=st.NotebookCell=st.ExecutionSummary=st.NotebookCellKind=void 0;var Fo=Mu(),zn=Lu(),ir=Je(),mp;(function(t){t.Markup=1,t.Code=2;function e(n){return n===1||n===2}t.is=e})(mp||(st.NotebookCellKind=mp={}));var gp;(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 zn.objectLiteral(s)&&Fo.uinteger.is(s.executionOrder)&&(s.success===void 0||zn.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})(gp||(st.ExecutionSummary=gp={}));var Ku;(function(t){function e(s,o){return{kind:s,document:o}}t.create=e;function n(s){let o=s;return zn.objectLiteral(o)&&mp.is(o.kind)&&Fo.DocumentUri.is(o.document)&&(o.metadata===void 0||zn.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)&&!gp.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(zn.objectLiteral(s)&&zn.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 d=0;d<c.length;d++){let p=c[d];if(!i(s[p],o[p]))return!1}}return!0}})(Ku||(st.NotebookCell=Ku={}));var Kv;(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 zn.objectLiteral(i)&&zn.string(i.uri)&&Fo.integer.is(i.version)&&zn.typedArray(i.cells,Ku.is)}t.is=n})(Kv||(st.NotebookDocument=Kv={}));var Is;(function(t){t.method="notebookDocument/sync",t.messageDirection=ir.MessageDirection.clientToServer,t.type=new ir.RegistrationType(t.method)})(Is||(st.NotebookDocumentSyncRegistrationType=Is={}));var Xv;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=ir.MessageDirection.clientToServer,t.type=new ir.ProtocolNotificationType(t.method),t.registrationMethod=Is.method})(Xv||(st.DidOpenNotebookDocumentNotification=Xv={}));var Yv;(function(t){function e(r){let i=r;return zn.objectLiteral(i)&&Fo.uinteger.is(i.start)&&Fo.uinteger.is(i.deleteCount)&&(i.cells===void 0||zn.typedArray(i.cells,Ku.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})(Yv||(st.NotebookCellArrayChange=Yv={}));var Jv;(function(t){t.method="notebookDocument/didChange",t.messageDirection=ir.MessageDirection.clientToServer,t.type=new ir.ProtocolNotificationType(t.method),t.registrationMethod=Is.method})(Jv||(st.DidChangeNotebookDocumentNotification=Jv={}));var Qv;(function(t){t.method="notebookDocument/didSave",t.messageDirection=ir.MessageDirection.clientToServer,t.type=new ir.ProtocolNotificationType(t.method),t.registrationMethod=Is.method})(Qv||(st.DidSaveNotebookDocumentNotification=Qv={}));var Zv;(function(t){t.method="notebookDocument/didClose",t.messageDirection=ir.MessageDirection.clientToServer,t.type=new ir.ProtocolNotificationType(t.method),t.registrationMethod=Is.method})(Zv||(st.DidCloseNotebookDocumentNotification=Zv={}))});var rS=m(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});Xu.InlineCompletionRequest=void 0;var tS=Je(),nS;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=tS.MessageDirection.clientToServer,t.type=new tS.ProtocolRequestType(t.method)})(nS||(Xu.InlineCompletionRequest=nS={}))});var gT=m(b=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});b.WorkspaceSymbolRequest=b.CodeActionResolveRequest=b.CodeActionRequest=b.DocumentSymbolRequest=b.DocumentHighlightRequest=b.ReferencesRequest=b.DefinitionRequest=b.SignatureHelpRequest=b.SignatureHelpTriggerKind=b.HoverRequest=b.CompletionResolveRequest=b.CompletionRequest=b.CompletionTriggerKind=b.PublishDiagnosticsNotification=b.WatchKind=b.RelativePattern=b.FileChangeType=b.DidChangeWatchedFilesNotification=b.WillSaveTextDocumentWaitUntilRequest=b.WillSaveTextDocumentNotification=b.TextDocumentSaveReason=b.DidSaveTextDocumentNotification=b.DidCloseTextDocumentNotification=b.DidChangeTextDocumentNotification=b.TextDocumentContentChangeEvent=b.DidOpenTextDocumentNotification=b.TextDocumentSyncKind=b.TelemetryEventNotification=b.LogMessageNotification=b.ShowMessageRequest=b.ShowMessageNotification=b.MessageType=b.DidChangeConfigurationNotification=b.ExitNotification=b.ShutdownRequest=b.InitializedNotification=b.InitializeErrorCodes=b.InitializeRequest=b.WorkDoneProgressOptions=b.TextDocumentRegistrationOptions=b.StaticRegistrationOptions=b.PositionEncodingKind=b.FailureHandlingKind=b.ResourceOperationKind=b.UnregistrationRequest=b.RegistrationRequest=b.DocumentSelector=b.NotebookCellTextDocumentFilter=b.NotebookDocumentFilter=b.TextDocumentFilter=void 0;b.MonikerRequest=b.MonikerKind=b.UniquenessLevel=b.WillDeleteFilesRequest=b.DidDeleteFilesNotification=b.WillRenameFilesRequest=b.DidRenameFilesNotification=b.WillCreateFilesRequest=b.DidCreateFilesNotification=b.FileOperationPatternKind=b.LinkedEditingRangeRequest=b.ShowDocumentRequest=b.SemanticTokensRegistrationType=b.SemanticTokensRefreshRequest=b.SemanticTokensRangeRequest=b.SemanticTokensDeltaRequest=b.SemanticTokensRequest=b.TokenFormat=b.CallHierarchyPrepareRequest=b.CallHierarchyOutgoingCallsRequest=b.CallHierarchyIncomingCallsRequest=b.WorkDoneProgressCancelNotification=b.WorkDoneProgressCreateRequest=b.WorkDoneProgress=b.SelectionRangeRequest=b.DeclarationRequest=b.FoldingRangeRefreshRequest=b.FoldingRangeRequest=b.ColorPresentationRequest=b.DocumentColorRequest=b.ConfigurationRequest=b.DidChangeWorkspaceFoldersNotification=b.WorkspaceFoldersRequest=b.TypeDefinitionRequest=b.ImplementationRequest=b.ApplyWorkspaceEditRequest=b.ExecuteCommandRequest=b.PrepareRenameRequest=b.RenameRequest=b.PrepareSupportDefaultBehavior=b.DocumentOnTypeFormattingRequest=b.DocumentRangesFormattingRequest=b.DocumentRangeFormattingRequest=b.DocumentFormattingRequest=b.DocumentLinkResolveRequest=b.DocumentLinkRequest=b.CodeLensRefreshRequest=b.CodeLensResolveRequest=b.CodeLensRequest=b.WorkspaceSymbolResolveRequest=void 0;b.InlineCompletionRequest=b.DidCloseNotebookDocumentNotification=b.DidSaveNotebookDocumentNotification=b.DidChangeNotebookDocumentNotification=b.NotebookCellArrayChange=b.DidOpenNotebookDocumentNotification=b.NotebookDocumentSyncRegistrationType=b.NotebookDocument=b.NotebookCell=b.ExecutionSummary=b.NotebookCellKind=b.DiagnosticRefreshRequest=b.WorkspaceDiagnosticRequest=b.DocumentDiagnosticRequest=b.DocumentDiagnosticReportKind=b.DiagnosticServerCancellationData=b.InlayHintRefreshRequest=b.InlayHintResolveRequest=b.InlayHintRequest=b.InlineValueRefreshRequest=b.InlineValueRequest=b.TypeHierarchySupertypesRequest=b.TypeHierarchySubtypesRequest=b.TypeHierarchyPrepareRequest=void 0;var B=Je(),iS=Mu(),Rt=Lu(),RC=O_();Object.defineProperty(b,"ImplementationRequest",{enumerable:!0,get:function(){return RC.ImplementationRequest}});var DC=I_();Object.defineProperty(b,"TypeDefinitionRequest",{enumerable:!0,get:function(){return DC.TypeDefinitionRequest}});var fT=L_();Object.defineProperty(b,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return fT.WorkspaceFoldersRequest}});Object.defineProperty(b,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return fT.DidChangeWorkspaceFoldersNotification}});var IC=j_();Object.defineProperty(b,"ConfigurationRequest",{enumerable:!0,get:function(){return IC.ConfigurationRequest}});var pT=B_();Object.defineProperty(b,"DocumentColorRequest",{enumerable:!0,get:function(){return pT.DocumentColorRequest}});Object.defineProperty(b,"ColorPresentationRequest",{enumerable:!0,get:function(){return pT.ColorPresentationRequest}});var hT=W_();Object.defineProperty(b,"FoldingRangeRequest",{enumerable:!0,get:function(){return hT.FoldingRangeRequest}});Object.defineProperty(b,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return hT.FoldingRangeRefreshRequest}});var PC=z_();Object.defineProperty(b,"DeclarationRequest",{enumerable:!0,get:function(){return PC.DeclarationRequest}});var MC=Y_();Object.defineProperty(b,"SelectionRangeRequest",{enumerable:!0,get:function(){return MC.SelectionRangeRequest}});var Sp=ev();Object.defineProperty(b,"WorkDoneProgress",{enumerable:!0,get:function(){return Sp.WorkDoneProgress}});Object.defineProperty(b,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return Sp.WorkDoneProgressCreateRequest}});Object.defineProperty(b,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return Sp.WorkDoneProgressCancelNotification}});var Tp=iv();Object.defineProperty(b,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Tp.CallHierarchyIncomingCallsRequest}});Object.defineProperty(b,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Tp.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(b,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Tp.CallHierarchyPrepareRequest}});var Ps=lv();Object.defineProperty(b,"TokenFormat",{enumerable:!0,get:function(){return Ps.TokenFormat}});Object.defineProperty(b,"SemanticTokensRequest",{enumerable:!0,get:function(){return Ps.SemanticTokensRequest}});Object.defineProperty(b,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return Ps.SemanticTokensDeltaRequest}});Object.defineProperty(b,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return Ps.SemanticTokensRangeRequest}});Object.defineProperty(b,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return Ps.SemanticTokensRefreshRequest}});Object.defineProperty(b,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return Ps.SemanticTokensRegistrationType}});var LC=pv();Object.defineProperty(b,"ShowDocumentRequest",{enumerable:!0,get:function(){return LC.ShowDocumentRequest}});var NC=gv();Object.defineProperty(b,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return NC.LinkedEditingRangeRequest}});var Pi=Ev();Object.defineProperty(b,"FileOperationPatternKind",{enumerable:!0,get:function(){return Pi.FileOperationPatternKind}});Object.defineProperty(b,"DidCreateFilesNotification",{enumerable:!0,get:function(){return Pi.DidCreateFilesNotification}});Object.defineProperty(b,"WillCreateFilesRequest",{enumerable:!0,get:function(){return Pi.WillCreateFilesRequest}});Object.defineProperty(b,"DidRenameFilesNotification",{enumerable:!0,get:function(){return Pi.DidRenameFilesNotification}});Object.defineProperty(b,"WillRenameFilesRequest",{enumerable:!0,get:function(){return Pi.WillRenameFilesRequest}});Object.defineProperty(b,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return Pi.DidDeleteFilesNotification}});Object.defineProperty(b,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return Pi.WillDeleteFilesRequest}});var wp=Ov();Object.defineProperty(b,"UniquenessLevel",{enumerable:!0,get:function(){return wp.UniquenessLevel}});Object.defineProperty(b,"MonikerKind",{enumerable:!0,get:function(){return wp.MonikerKind}});Object.defineProperty(b,"MonikerRequest",{enumerable:!0,get:function(){return wp.MonikerRequest}});var Ep=Pv();Object.defineProperty(b,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return Ep.TypeHierarchyPrepareRequest}});Object.defineProperty(b,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return Ep.TypeHierarchySubtypesRequest}});Object.defineProperty(b,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return Ep.TypeHierarchySupertypesRequest}});var mT=Nv();Object.defineProperty(b,"InlineValueRequest",{enumerable:!0,get:function(){return mT.InlineValueRequest}});Object.defineProperty(b,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return mT.InlineValueRefreshRequest}});var Ap=$v();Object.defineProperty(b,"InlayHintRequest",{enumerable:!0,get:function(){return Ap.InlayHintRequest}});Object.defineProperty(b,"InlayHintResolveRequest",{enumerable:!0,get:function(){return Ap.InlayHintResolveRequest}});Object.defineProperty(b,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return Ap.InlayHintRefreshRequest}});var $o=zv();Object.defineProperty(b,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return $o.DiagnosticServerCancellationData}});Object.defineProperty(b,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return $o.DocumentDiagnosticReportKind}});Object.defineProperty(b,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return $o.DocumentDiagnosticRequest}});Object.defineProperty(b,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return $o.WorkspaceDiagnosticRequest}});Object.defineProperty(b,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return $o.DiagnosticRefreshRequest}});var sr=eS();Object.defineProperty(b,"NotebookCellKind",{enumerable:!0,get:function(){return sr.NotebookCellKind}});Object.defineProperty(b,"ExecutionSummary",{enumerable:!0,get:function(){return sr.ExecutionSummary}});Object.defineProperty(b,"NotebookCell",{enumerable:!0,get:function(){return sr.NotebookCell}});Object.defineProperty(b,"NotebookDocument",{enumerable:!0,get:function(){return sr.NotebookDocument}});Object.defineProperty(b,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return sr.NotebookDocumentSyncRegistrationType}});Object.defineProperty(b,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return sr.DidOpenNotebookDocumentNotification}});Object.defineProperty(b,"NotebookCellArrayChange",{enumerable:!0,get:function(){return sr.NotebookCellArrayChange}});Object.defineProperty(b,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return sr.DidChangeNotebookDocumentNotification}});Object.defineProperty(b,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return sr.DidSaveNotebookDocumentNotification}});Object.defineProperty(b,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return sr.DidCloseNotebookDocumentNotification}});var qC=rS();Object.defineProperty(b,"InlineCompletionRequest",{enumerable:!0,get:function(){return qC.InlineCompletionRequest}});var yp;(function(t){function e(n){let r=n;return Rt.string(r)||Rt.string(r.language)||Rt.string(r.scheme)||Rt.string(r.pattern)}t.is=e})(yp||(b.TextDocumentFilter=yp={}));var bp;(function(t){function e(n){let r=n;return Rt.objectLiteral(r)&&(Rt.string(r.notebookType)||Rt.string(r.scheme)||Rt.string(r.pattern))}t.is=e})(bp||(b.NotebookDocumentFilter=bp={}));var _p;(function(t){function e(n){let r=n;return Rt.objectLiteral(r)&&(Rt.string(r.notebook)||bp.is(r.notebook))&&(r.language===void 0||Rt.string(r.language))}t.is=e})(_p||(b.NotebookCellTextDocumentFilter=_p={}));var vp;(function(t){function e(n){if(!Array.isArray(n))return!1;for(let r of n)if(!Rt.string(r)&&!yp.is(r)&&!_p.is(r))return!1;return!0}t.is=e})(vp||(b.DocumentSelector=vp={}));var sS;(function(t){t.method="client/registerCapability",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolRequestType(t.method)})(sS||(b.RegistrationRequest=sS={}));var oS;(function(t){t.method="client/unregisterCapability",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolRequestType(t.method)})(oS||(b.UnregistrationRequest=oS={}));var aS;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(aS||(b.ResourceOperationKind=aS={}));var uS;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(uS||(b.FailureHandlingKind=uS={}));var cS;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(cS||(b.PositionEncodingKind=cS={}));var lS;(function(t){function e(n){let r=n;return r&&Rt.string(r.id)&&r.id.length>0}t.hasId=e})(lS||(b.StaticRegistrationOptions=lS={}));var dS;(function(t){function e(n){let r=n;return r&&(r.documentSelector===null||vp.is(r.documentSelector))}t.is=e})(dS||(b.TextDocumentRegistrationOptions=dS={}));var fS;(function(t){function e(r){let i=r;return Rt.objectLiteral(i)&&(i.workDoneProgress===void 0||Rt.boolean(i.workDoneProgress))}t.is=e;function n(r){let i=r;return i&&Rt.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=n})(fS||(b.WorkDoneProgressOptions=fS={}));var pS;(function(t){t.method="initialize",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(pS||(b.InitializeRequest=pS={}));var hS;(function(t){t.unknownProtocolVersion=1})(hS||(b.InitializeErrorCodes=hS={}));var mS;(function(t){t.method="initialized",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(mS||(b.InitializedNotification=mS={}));var gS;(function(t){t.method="shutdown",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType0(t.method)})(gS||(b.ShutdownRequest=gS={}));var yS;(function(t){t.method="exit",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType0(t.method)})(yS||(b.ExitNotification=yS={}));var bS;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(bS||(b.DidChangeConfigurationNotification=bS={}));var _S;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(_S||(b.MessageType=_S={}));var vS;(function(t){t.method="window/showMessage",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolNotificationType(t.method)})(vS||(b.ShowMessageNotification=vS={}));var SS;(function(t){t.method="window/showMessageRequest",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolRequestType(t.method)})(SS||(b.ShowMessageRequest=SS={}));var TS;(function(t){t.method="window/logMessage",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolNotificationType(t.method)})(TS||(b.LogMessageNotification=TS={}));var wS;(function(t){t.method="telemetry/event",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolNotificationType(t.method)})(wS||(b.TelemetryEventNotification=wS={}));var ES;(function(t){t.None=0,t.Full=1,t.Incremental=2})(ES||(b.TextDocumentSyncKind=ES={}));var AS;(function(t){t.method="textDocument/didOpen",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(AS||(b.DidOpenTextDocumentNotification=AS={}));var xS;(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})(xS||(b.TextDocumentContentChangeEvent=xS={}));var kS;(function(t){t.method="textDocument/didChange",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(kS||(b.DidChangeTextDocumentNotification=kS={}));var CS;(function(t){t.method="textDocument/didClose",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(CS||(b.DidCloseTextDocumentNotification=CS={}));var OS;(function(t){t.method="textDocument/didSave",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(OS||(b.DidSaveTextDocumentNotification=OS={}));var RS;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(RS||(b.TextDocumentSaveReason=RS={}));var DS;(function(t){t.method="textDocument/willSave",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(DS||(b.WillSaveTextDocumentNotification=DS={}));var IS;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(IS||(b.WillSaveTextDocumentWaitUntilRequest=IS={}));var PS;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(PS||(b.DidChangeWatchedFilesNotification=PS={}));var MS;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(MS||(b.FileChangeType=MS={}));var LS;(function(t){function e(n){let r=n;return Rt.objectLiteral(r)&&(iS.URI.is(r.baseUri)||iS.WorkspaceFolder.is(r.baseUri))&&Rt.string(r.pattern)}t.is=e})(LS||(b.RelativePattern=LS={}));var NS;(function(t){t.Create=1,t.Change=2,t.Delete=4})(NS||(b.WatchKind=NS={}));var qS;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolNotificationType(t.method)})(qS||(b.PublishDiagnosticsNotification=qS={}));var jS;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(jS||(b.CompletionTriggerKind=jS={}));var FS;(function(t){t.method="textDocument/completion",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(FS||(b.CompletionRequest=FS={}));var $S;(function(t){t.method="completionItem/resolve",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})($S||(b.CompletionResolveRequest=$S={}));var BS;(function(t){t.method="textDocument/hover",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(BS||(b.HoverRequest=BS={}));var US;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(US||(b.SignatureHelpTriggerKind=US={}));var HS;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(HS||(b.SignatureHelpRequest=HS={}));var WS;(function(t){t.method="textDocument/definition",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(WS||(b.DefinitionRequest=WS={}));var GS;(function(t){t.method="textDocument/references",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(GS||(b.ReferencesRequest=GS={}));var VS;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(VS||(b.DocumentHighlightRequest=VS={}));var zS;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(zS||(b.DocumentSymbolRequest=zS={}));var KS;(function(t){t.method="textDocument/codeAction",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(KS||(b.CodeActionRequest=KS={}));var XS;(function(t){t.method="codeAction/resolve",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(XS||(b.CodeActionResolveRequest=XS={}));var YS;(function(t){t.method="workspace/symbol",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(YS||(b.WorkspaceSymbolRequest=YS={}));var JS;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(JS||(b.WorkspaceSymbolResolveRequest=JS={}));var QS;(function(t){t.method="textDocument/codeLens",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(QS||(b.CodeLensRequest=QS={}));var ZS;(function(t){t.method="codeLens/resolve",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(ZS||(b.CodeLensResolveRequest=ZS={}));var eT;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolRequestType0(t.method)})(eT||(b.CodeLensRefreshRequest=eT={}));var tT;(function(t){t.method="textDocument/documentLink",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(tT||(b.DocumentLinkRequest=tT={}));var nT;(function(t){t.method="documentLink/resolve",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(nT||(b.DocumentLinkResolveRequest=nT={}));var rT;(function(t){t.method="textDocument/formatting",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(rT||(b.DocumentFormattingRequest=rT={}));var iT;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(iT||(b.DocumentRangeFormattingRequest=iT={}));var sT;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(sT||(b.DocumentRangesFormattingRequest=sT={}));var oT;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(oT||(b.DocumentOnTypeFormattingRequest=oT={}));var aT;(function(t){t.Identifier=1})(aT||(b.PrepareSupportDefaultBehavior=aT={}));var uT;(function(t){t.method="textDocument/rename",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(uT||(b.RenameRequest=uT={}));var cT;(function(t){t.method="textDocument/prepareRename",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(cT||(b.PrepareRenameRequest=cT={}));var lT;(function(t){t.method="workspace/executeCommand",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(lT||(b.ExecuteCommandRequest=lT={}));var dT;(function(t){t.method="workspace/applyEdit",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolRequestType("workspace/applyEdit")})(dT||(b.ApplyWorkspaceEditRequest=dT={}))});var bT=m(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});Yu.createProtocolConnection=void 0;var yT=Ii();function jC(t,e,n,r){return yT.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,yT.createMessageConnection)(t,e,n,r)}Yu.createProtocolConnection=jC});var vT=m(un=>{"use strict";var FC=un&&un.__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=un&&un.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&FC(e,t,n)};Object.defineProperty(un,"__esModule",{value:!0});un.LSPErrorCodes=un.createProtocolConnection=void 0;Ju(Ii(),un);Ju(Mu(),un);Ju(Je(),un);Ju(gT(),un);var $C=bT();Object.defineProperty(un,"createProtocolConnection",{enumerable:!0,get:function(){return $C.createProtocolConnection}});var _T;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(_T||(un.LSPErrorCodes=_T={}))});var ft=m(or=>{"use strict";var BC=or&&or.__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]}),ST=or&&or.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&BC(e,t,n)};Object.defineProperty(or,"__esModule",{value:!0});or.createProtocolConnection=void 0;var UC=cp();ST(cp(),or);ST(vT(),or);function HC(t,e,n,r){return(0,UC.createMessageConnection)(t,e,n,r)}or.createProtocolConnection=HC});var xp=m(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.generateUuid=xn.parse=xn.isUUID=xn.v4=xn.empty=void 0;var Bo=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},Uo=class t extends Bo{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(""))}};Uo._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];Uo._timeHighBits=["8","9","a","b"];xn.empty=new Bo("00000000-0000-0000-0000-000000000000");function TT(){return new Uo}xn.v4=TT;var WC=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function wT(t){return WC.test(t)}xn.isUUID=wT;function GC(t){if(!wT(t))throw new Error("invalid uuid");return new Bo(t)}xn.parse=GC;function VC(){return TT().asHex()}xn.generateUuid=VC});var ET=m(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.attachPartialResult=ei.ProgressFeature=ei.attachWorkDone=void 0;var Zr=ft(),zC=xp(),Mi=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(Zr.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(Zr.WorkDoneProgress.type,this._token,r)}done(){t.Instances.delete(this._token),this._connection.sendProgress(Zr.WorkDoneProgress.type,this._token,{kind:"end"})}};Mi.Instances=new Map;var Qu=class extends Mi{constructor(e,n){super(e,n),this._source=new Zr.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},Ho=class{constructor(){}begin(){}report(){}done(){}},Zu=class extends Ho{constructor(){super(),this._source=new Zr.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function KC(t,e){if(e===void 0||e.workDoneToken===void 0)return new Ho;let n=e.workDoneToken;return delete e.workDoneToken,new Mi(t,n)}ei.attachWorkDone=KC;var XC=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(Zr.WorkDoneProgressCancelNotification.type,n=>{let r=Mi.Instances.get(n.token);(r instanceof Qu||r instanceof Zu)&&r.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new Ho:new Mi(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,zC.generateUuid)();return this.connection.sendRequest(Zr.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Qu(this.connection,e))}else return Promise.resolve(new Zu)}};ei.ProgressFeature=XC;var kp;(function(t){t.type=new Zr.ProgressType})(kp||(kp={}));var Cp=class{constructor(e,n){this._connection=e,this._token=n}report(e){this._connection.sendProgress(kp.type,this._token,e)}};function YC(t,e){if(e===void 0||e.partialResultToken===void 0)return;let n=e.partialResultToken;return delete e.partialResultToken,new Cp(t,n)}ei.attachPartialResult=YC});var AT=m(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});ec.ConfigurationFeature=void 0;var JC=ft(),QC=du(),ZC=t=>class extends t{getConfiguration(e){return e?QC.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(JC.ConfigurationRequest.type,n).then(r=>Array.isArray(r)?Array.isArray(e)?r:r[0]:Array.isArray(e)?[]:null)}};ec.ConfigurationFeature=ZC});var xT=m(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});nc.WorkspaceFoldersFeature=void 0;var tc=ft(),eO=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let n=e.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new tc.Emitter,this.connection.onNotification(tc.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(tc.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(tc.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};nc.WorkspaceFoldersFeature=eO});var kT=m(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.CallHierarchyFeature=void 0;var Op=ft(),tO=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(Op.CallHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onIncomingCalls:e=>{let n=Op.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onOutgoingCalls:e=>{let n=Op.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};rc.CallHierarchyFeature=tO});var Dp=m(ti=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.SemanticTokensBuilder=ti.SemanticTokensDiff=ti.SemanticTokensFeature=void 0;var ic=ft(),nO=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(ic.SemanticTokensRefreshRequest.type),on:e=>{let n=ic.SemanticTokensRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onDelta:e=>{let n=ic.SemanticTokensDeltaRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onRange:e=>{let n=ic.SemanticTokensRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};ti.SemanticTokensFeature=nO;var sc=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}]:[]}};ti.SemanticTokensDiff=sc;var Rp=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 sc(this._prevData,this._data).computeDiff()}:this.build()}};ti.SemanticTokensBuilder=Rp});var CT=m(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.ShowDocumentFeature=void 0;var rO=ft(),iO=t=>class extends t{showDocument(e){return this.connection.sendRequest(rO.ShowDocumentRequest.type,e)}};oc.ShowDocumentFeature=iO});var OT=m(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.FileOperationsFeature=void 0;var Ms=ft(),sO=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(Ms.DidCreateFilesNotification.type,n=>{e(n)})}onDidRenameFiles(e){return this.connection.onNotification(Ms.DidRenameFilesNotification.type,n=>{e(n)})}onDidDeleteFiles(e){return this.connection.onNotification(Ms.DidDeleteFilesNotification.type,n=>{e(n)})}onWillCreateFiles(e){return this.connection.onRequest(Ms.WillCreateFilesRequest.type,(n,r)=>e(n,r))}onWillRenameFiles(e){return this.connection.onRequest(Ms.WillRenameFilesRequest.type,(n,r)=>e(n,r))}onWillDeleteFiles(e){return this.connection.onRequest(Ms.WillDeleteFilesRequest.type,(n,r)=>e(n,r))}};ac.FileOperationsFeature=sO});var RT=m(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.LinkedEditingRangeFeature=void 0;var oO=ft(),aO=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(oO.LinkedEditingRangeRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))}};uc.LinkedEditingRangeFeature=aO});var DT=m(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.TypeHierarchyFeature=void 0;var Ip=ft(),uO=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(Ip.TypeHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onSupertypes:e=>{let n=Ip.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onSubtypes:e=>{let n=Ip.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};cc.TypeHierarchyFeature=uO});var PT=m(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc.InlineValueFeature=void 0;var IT=ft(),cO=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(IT.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(IT.InlineValueRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};lc.InlineValueFeature=cO});var LT=m(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.FoldingRangeFeature=void 0;var MT=ft(),lO=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(MT.FoldingRangeRefreshRequest.type),on:e=>{let n=MT.FoldingRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};dc.FoldingRangeFeature=lO});var NT=m(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.InlayHintFeature=void 0;var Pp=ft(),dO=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(Pp.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(Pp.InlayHintRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n))),resolve:e=>this.connection.onRequest(Pp.InlayHintResolveRequest.type,(n,r)=>e(n,r))}}};fc.InlayHintFeature=dO});var qT=m(pc=>{"use strict";Object.defineProperty(pc,"__esModule",{value:!0});pc.DiagnosticFeature=void 0;var Wo=ft(),fO=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(Wo.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(Wo.DocumentDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(Wo.DocumentDiagnosticRequest.partialResult,n))),onWorkspace:e=>this.connection.onRequest(Wo.WorkspaceDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(Wo.WorkspaceDiagnosticRequest.partialResult,n)))}}};pc.DiagnosticFeature=fO});var Lp=m(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});hc.TextDocuments=void 0;var Li=ft(),Mp=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new Li.Emitter,this._onDidOpen=new Li.Emitter,this._onDidClose=new Li.Emitter,this._onDidSave=new Li.Emitter,this._onWillSave=new Li.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=Li.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}))})),Li.Disposable.create(()=>{n.forEach(r=>r.dispose())})}};hc.TextDocuments=Mp});var qp=m(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.NotebookDocuments=Ls.NotebookSyncFeature=void 0;var kn=ft(),jT=Lp(),pO=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(kn.DidOpenNotebookDocumentNotification.type,n=>{e(n)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(kn.DidChangeNotebookDocumentNotification.type,n=>{e(n)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(kn.DidSaveNotebookDocumentNotification.type,n=>{e(n)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(kn.DidCloseNotebookDocumentNotification.type,n=>{e(n)})}}};Ls.NotebookSyncFeature=pO;var mc=class t{onDidOpenTextDocument(e){return this.openHandler=e,kn.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,kn.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,kn.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}};mc.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var Np=class{constructor(e){e instanceof jT.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new jT.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new kn.Emitter,this._onDidChange=new kn.Emitter,this._onDidSave=new kn.Emitter,this._onDidClose=new kn.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 mc,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=[],d=[],p=[];if(u.cells!==void 0){let P=u.cells;if(P.structure!==void 0){let w=P.structure.array;if(s.cells.splice(w.start,w.deleteCount,...w.cells!==void 0?w.cells:[]),P.structure.didOpen!==void 0)for(let E of P.structure.didOpen)n.openTextDocument({textDocument:E}),c.push(E.uri);if(P.structure.didClose)for(let E of P.structure.didClose)n.closeTextDocument({textDocument:E}),l.push(E.uri)}if(P.data!==void 0){let w=new Map(P.data.map(E=>[E.document,E]));for(let E=0;E<=s.cells.length;E++){let _=w.get(s.cells[E].document);if(_!==void 0){let j=s.cells.splice(E,1,_);if(d.push({old:j[0],new:_}),w.delete(_.document),w.size===0)break}}}if(P.textContent!==void 0)for(let w of P.textContent)n.changeTextDocument({textDocument:w.document,contentChanges:w.changes}),p.push(w.document.uri)}this.updateCellMap(s);let y={notebookDocument:s};a&&(y.metadata={old:o,new:s.metadata});let v=[];for(let P of c)v.push(this.getNotebookCell(P));let x=[];for(let P of l)x.push(this.getNotebookCell(P));let I=[];for(let P of p)I.push(this.getNotebookCell(P));(v.length>0||x.length>0||d.length>0||I.length>0)&&(y.cells={added:v,removed:x,changed:{data:d,textContent:I}}),(y.metadata!==void 0||y.cells!==void 0)&&this._onDidChange.fire(y)})),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)}})),kn.Disposable.create(()=>{r.forEach(i=>i.dispose())})}updateCellMap(e){for(let n of e.cells)this.notebookCellMap.set(n.document,[n,e])}};Ls.NotebookDocuments=Np});var FT=m(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});gc.MonikerFeature=void 0;var hO=ft(),mO=t=>class extends t{get moniker(){return{on:e=>{let n=hO.MonikerRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};gc.MonikerFeature=mO});var Hp=m(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.createConnection=xe.combineFeatures=xe.combineNotebooksFeatures=xe.combineLanguagesFeatures=xe.combineWorkspaceFeatures=xe.combineWindowFeatures=xe.combineClientFeatures=xe.combineTracerFeatures=xe.combineTelemetryFeatures=xe.combineConsoleFeatures=xe._NotebooksImpl=xe._LanguagesImpl=xe.BulkUnregistration=xe.BulkRegistration=xe.ErrorMessageTracker=void 0;var G=ft(),Cn=du(),Fp=xp(),le=ET(),gO=AT(),yO=xT(),bO=kT(),_O=Dp(),vO=CT(),SO=OT(),TO=RT(),wO=DT(),EO=PT(),AO=LT(),xO=NT(),kO=qT(),CO=qp(),OO=FT();function jp(t){if(t!==null)return t}var $p=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)})}};xe.ErrorMessageTracker=$p;var yc=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(G.MessageType.Error,e)}warn(e){this.send(G.MessageType.Warning,e)}info(e){this.send(G.MessageType.Info,e)}log(e){this.send(G.MessageType.Log,e)}debug(e){this.send(G.MessageType.Debug,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(G.LogMessageNotification.type,{type:e,message:n}).catch(()=>{(0,G.RAL)().console.error("Sending log message failed")})}},Bp=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:G.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(G.ShowMessageRequest.type,r).then(jp)}showWarningMessage(e,...n){let r={type:G.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(G.ShowMessageRequest.type,r).then(jp)}showInformationMessage(e,...n){let r={type:G.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(G.ShowMessageRequest.type,r).then(jp)}},$T=(0,vO.ShowDocumentFeature)((0,le.ProgressFeature)(Bp)),BT;(function(t){function e(){return new bc}t.create=e})(BT||(xe.BulkRegistration=BT={}));var bc=class{constructor(){this._registrations=[],this._registered=new Set}add(e,n){let r=Cn.string(e)?e:e.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);let i=Fp.generateUuid();this._registrations.push({id:i,method:r,registerOptions:n||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}},UT;(function(t){function e(){return new Go(void 0,[])}t.create=e})(UT||(xe.BulkUnregistration=UT={}));var Go=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(G.UnregistrationRequest.type,n).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let n=Cn.string(e)?e:e.method,r=this._unregistrations.get(n);if(!r)return!1;let i={unregisterations:[r]};return this._connection.sendRequest(G.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(n)},s=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}},_c=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 bc?this.registerMany(e):e instanceof Go?this.registerSingle1(e,n,r):this.registerSingle2(e,n)}registerSingle1(e,n,r){let i=Cn.string(n)?n:n.method,s=Fp.generateUuid(),o={registrations:[{id:s,method:i,registerOptions:r||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(G.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=Cn.string(e)?e:e.method,i=Fp.generateUuid(),s={registrations:[{id:i,method:r,registerOptions:n||{}}]};return this.connection.sendRequest(G.RegistrationRequest.type,s).then(o=>G.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(G.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(G.RegistrationRequest.type,n).then(()=>new Go(this._connection,n.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}},Up=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(G.ApplyWorkspaceEditRequest.type,r)}},HT=(0,SO.FileOperationsFeature)((0,yO.WorkspaceFoldersFeature)((0,gO.ConfigurationFeature)(Up))),vc=class{constructor(){this._trace=G.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!==G.Trace.Off&&this.connection.sendNotification(G.LogTraceNotification.type,{message:e,verbose:this._trace===G.Trace.Verbose?n:void 0}).catch(()=>{})}},Sc=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(G.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},Tc=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,le.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,le.attachPartialResult)(this.connection,n)}};xe._LanguagesImpl=Tc;var WT=(0,AO.FoldingRangeFeature)((0,OO.MonikerFeature)((0,kO.DiagnosticFeature)((0,xO.InlayHintFeature)((0,EO.InlineValueFeature)((0,wO.TypeHierarchyFeature)((0,TO.LinkedEditingRangeFeature)((0,_O.SemanticTokensFeature)((0,bO.CallHierarchyFeature)(Tc))))))))),wc=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,le.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,le.attachPartialResult)(this.connection,n)}};xe._NotebooksImpl=wc;var GT=(0,CO.NotebookSyncFeature)(wc);function VT(t,e){return function(n){return e(t(n))}}xe.combineConsoleFeatures=VT;function zT(t,e){return function(n){return e(t(n))}}xe.combineTelemetryFeatures=zT;function KT(t,e){return function(n){return e(t(n))}}xe.combineTracerFeatures=KT;function XT(t,e){return function(n){return e(t(n))}}xe.combineClientFeatures=XT;function YT(t,e){return function(n){return e(t(n))}}xe.combineWindowFeatures=YT;function JT(t,e){return function(n){return e(t(n))}}xe.combineWorkspaceFeatures=JT;function QT(t,e){return function(n){return e(t(n))}}xe.combineLanguagesFeatures=QT;function ZT(t,e){return function(n){return e(t(n))}}xe.combineNotebooksFeatures=ZT;function RO(t,e){function n(i,s,o){return i&&s?o(i,s):i||s}return{__brand:"features",console:n(t.console,e.console,VT),tracer:n(t.tracer,e.tracer,KT),telemetry:n(t.telemetry,e.telemetry,zT),client:n(t.client,e.client,XT),window:n(t.window,e.window,YT),workspace:n(t.workspace,e.workspace,JT),languages:n(t.languages,e.languages,QT),notebooks:n(t.notebooks,e.notebooks,ZT)}}xe.combineFeatures=RO;function DO(t,e,n){let r=n&&n.console?new(n.console(yc)):new yc,i=t(r);r.rawAttach(i);let s=n&&n.tracer?new(n.tracer(vc)):new vc,o=n&&n.telemetry?new(n.telemetry(Sc)):new Sc,a=n&&n.client?new(n.client(_c)):new _c,u=n&&n.window?new(n.window($T)):new $T,c=n&&n.workspace?new(n.workspace(HT)):new HT,l=n&&n.languages?new(n.languages(WT)):new WT,d=n&&n.notebooks?new(n.notebooks(GT)):new GT,p=[r,s,o,a,u,c,l,d];function y(w){return w instanceof Promise?w:Cn.thenable(w)?new Promise((E,_)=>{w.then(j=>E(j),j=>_(j))}):Promise.resolve(w)}let v,x,I,P={listen:()=>i.listen(),sendRequest:(w,...E)=>i.sendRequest(Cn.string(w)?w:w.method,...E),onRequest:(w,E)=>i.onRequest(w,E),sendNotification:(w,E)=>{let _=Cn.string(w)?w:w.method;return i.sendNotification(_,E)},onNotification:(w,E)=>i.onNotification(w,E),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:w=>(x=w,{dispose:()=>{x=void 0}}),onInitialized:w=>i.onNotification(G.InitializedNotification.type,w),onShutdown:w=>(v=w,{dispose:()=>{v=void 0}}),onExit:w=>(I=w,{dispose:()=>{I=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 d},onDidChangeConfiguration:w=>i.onNotification(G.DidChangeConfigurationNotification.type,w),onDidChangeWatchedFiles:w=>i.onNotification(G.DidChangeWatchedFilesNotification.type,w),__textDocumentSync:void 0,onDidOpenTextDocument:w=>i.onNotification(G.DidOpenTextDocumentNotification.type,w),onDidChangeTextDocument:w=>i.onNotification(G.DidChangeTextDocumentNotification.type,w),onDidCloseTextDocument:w=>i.onNotification(G.DidCloseTextDocumentNotification.type,w),onWillSaveTextDocument:w=>i.onNotification(G.WillSaveTextDocumentNotification.type,w),onWillSaveTextDocumentWaitUntil:w=>i.onRequest(G.WillSaveTextDocumentWaitUntilRequest.type,w),onDidSaveTextDocument:w=>i.onNotification(G.DidSaveTextDocumentNotification.type,w),sendDiagnostics:w=>i.sendNotification(G.PublishDiagnosticsNotification.type,w),onHover:w=>i.onRequest(G.HoverRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),void 0)),onCompletion:w=>i.onRequest(G.CompletionRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onCompletionResolve:w=>i.onRequest(G.CompletionResolveRequest.type,w),onSignatureHelp:w=>i.onRequest(G.SignatureHelpRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),void 0)),onDeclaration:w=>i.onRequest(G.DeclarationRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onDefinition:w=>i.onRequest(G.DefinitionRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onTypeDefinition:w=>i.onRequest(G.TypeDefinitionRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onImplementation:w=>i.onRequest(G.ImplementationRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onReferences:w=>i.onRequest(G.ReferencesRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onDocumentHighlight:w=>i.onRequest(G.DocumentHighlightRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onDocumentSymbol:w=>i.onRequest(G.DocumentSymbolRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onWorkspaceSymbol:w=>i.onRequest(G.WorkspaceSymbolRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onWorkspaceSymbolResolve:w=>i.onRequest(G.WorkspaceSymbolResolveRequest.type,w),onCodeAction:w=>i.onRequest(G.CodeActionRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onCodeActionResolve:w=>i.onRequest(G.CodeActionResolveRequest.type,(E,_)=>w(E,_)),onCodeLens:w=>i.onRequest(G.CodeLensRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onCodeLensResolve:w=>i.onRequest(G.CodeLensResolveRequest.type,(E,_)=>w(E,_)),onDocumentFormatting:w=>i.onRequest(G.DocumentFormattingRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),void 0)),onDocumentRangeFormatting:w=>i.onRequest(G.DocumentRangeFormattingRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),void 0)),onDocumentOnTypeFormatting:w=>i.onRequest(G.DocumentOnTypeFormattingRequest.type,(E,_)=>w(E,_)),onRenameRequest:w=>i.onRequest(G.RenameRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),void 0)),onPrepareRename:w=>i.onRequest(G.PrepareRenameRequest.type,(E,_)=>w(E,_)),onDocumentLinks:w=>i.onRequest(G.DocumentLinkRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onDocumentLinkResolve:w=>i.onRequest(G.DocumentLinkResolveRequest.type,(E,_)=>w(E,_)),onDocumentColor:w=>i.onRequest(G.DocumentColorRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onColorPresentation:w=>i.onRequest(G.ColorPresentationRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onFoldingRanges:w=>i.onRequest(G.FoldingRangeRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onSelectionRanges:w=>i.onRequest(G.SelectionRangeRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onExecuteCommand:w=>i.onRequest(G.ExecuteCommandRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),void 0)),dispose:()=>i.dispose()};for(let w of p)w.attach(P);return i.onRequest(G.InitializeRequest.type,w=>{e.initialize(w),Cn.string(w.trace)&&(s.trace=G.Trace.fromString(w.trace));for(let E of p)E.initialize(w.capabilities);if(x){let E=x(w,new G.CancellationTokenSource().token,(0,le.attachWorkDone)(i,w),void 0);return y(E).then(_=>{if(_ instanceof G.ResponseError)return _;let j=_;j||(j={capabilities:{}});let O=j.capabilities;O||(O={},j.capabilities=O),O.textDocumentSync===void 0||O.textDocumentSync===null?O.textDocumentSync=Cn.number(P.__textDocumentSync)?P.__textDocumentSync:G.TextDocumentSyncKind.None:!Cn.number(O.textDocumentSync)&&!Cn.number(O.textDocumentSync.change)&&(O.textDocumentSync.change=Cn.number(P.__textDocumentSync)?P.__textDocumentSync:G.TextDocumentSyncKind.None);for(let H of p)H.fillServerCapabilities(O);return j})}else{let E={capabilities:{textDocumentSync:G.TextDocumentSyncKind.None}};for(let _ of p)_.fillServerCapabilities(E.capabilities);return E}}),i.onRequest(G.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,v)return v(new G.CancellationTokenSource().token)}),i.onNotification(G.ExitNotification.type,()=>{try{I&&I()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(G.SetTraceNotification.type,w=>{s.trace=G.Trace.fromString(w.value)}),P}xe.createConnection=DO});var ew=m(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.resolveModulePath=cn.FileSystem=cn.resolveGlobalYarnPath=cn.resolveGlobalNodePath=cn.resolve=cn.uriToFilePath=void 0;var IO=require("url"),Kn=require("path"),Wp=require("fs"),Kp=require("child_process");function PO(t){let e=IO.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 Kn.normalize(n.join("/"))}cn.uriToFilePath=PO;function Gp(){return process.platform==="win32"}function Ec(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&&Wp.existsSync(e)&&(c[i]?c[i]=e+Kn.delimiter+c[i]:c[i]=e,r&&r(`NODE_PATH value is: ${c[i]}`)),c.ELECTRON_RUN_AS_NODE="1";try{let l=(0,Kp.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",p=>{a(p)}),l.on("message",p=>{p.c==="r"&&(l.send({c:"e"}),p.s?o(p.r):a(new Error(`Failed to resolve module: ${t}`)))});let d={c:"rs",a:t};l.send(d)}catch(l){a(l)}})}cn.resolve=Ec;function Vp(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};Gp()&&(e="npm.cmd",r.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let s=(0,Kp.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?Gp()?Kn.join(o,"node_modules"):Kn.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i)}}cn.resolveGlobalNodePath=Vp;function MO(t){let e="yarn",n={encoding:"utf8"};Gp()&&(e="yarn.cmd",n.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let i=(0,Kp.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 Kn.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",r)}}cn.resolveGlobalYarnPath=MO;var zp;(function(t){let e;function n(){return e!==void 0||(process.platform==="win32"?e=!1:e=!Wp.existsSync(__filename.toUpperCase())||!Wp.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=n;function r(i,s){return n()?Kn.normalize(s).indexOf(Kn.normalize(i))===0:Kn.normalize(s).toLowerCase().indexOf(Kn.normalize(i).toLowerCase())===0}t.isParent=r})(zp||(cn.FileSystem=zp={}));function LO(t,e,n,r){return n?(Kn.isAbsolute(n)||(n=Kn.join(t,n)),Ec(e,n,n,r).then(i=>zp.isParent(n,i)?i:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,i=>Ec(e,Vp(r),t,r))):Ec(e,Vp(r),t,r)}cn.resolveModulePath=LO});var Xp=m((KF,tw)=>{"use strict";tw.exports=ft()});var nw=m(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});Ac.InlineCompletionFeature=void 0;var NO=ft(),qO=t=>class extends t{get inlineCompletion(){return{on:e=>this.connection.onRequest(NO.InlineCompletionRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};Ac.InlineCompletionFeature=qO});var sw=m(Ut=>{"use strict";var jO=Ut&&Ut.__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]}),iw=Ut&&Ut.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&jO(e,t,n)};Object.defineProperty(Ut,"__esModule",{value:!0});Ut.ProposedFeatures=Ut.NotebookDocuments=Ut.TextDocuments=Ut.SemanticTokensBuilder=void 0;var FO=Dp();Object.defineProperty(Ut,"SemanticTokensBuilder",{enumerable:!0,get:function(){return FO.SemanticTokensBuilder}});var $O=nw();iw(ft(),Ut);var BO=Lp();Object.defineProperty(Ut,"TextDocuments",{enumerable:!0,get:function(){return BO.TextDocuments}});var UO=qp();Object.defineProperty(Ut,"NotebookDocuments",{enumerable:!0,get:function(){return UO.NotebookDocuments}});iw(Hp(),Ut);var rw;(function(t){t.all={__brand:"features",languages:$O.InlineCompletionFeature}})(rw||(Ut.ProposedFeatures=rw={}))});var dw=m(On=>{"use strict";var HO=On&&On.__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]}),cw=On&&On.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&HO(e,t,n)};Object.defineProperty(On,"__esModule",{value:!0});On.createConnection=On.Files=void 0;var ow=require("node:util"),Yp=du(),WO=Hp(),Vo=ew(),Ni=Xp();cw(Xp(),On);cw(sw(),On);var aw;(function(t){t.uriToFilePath=Vo.uriToFilePath,t.resolveGlobalNodePath=Vo.resolveGlobalNodePath,t.resolveGlobalYarnPath=Vo.resolveGlobalYarnPath,t.resolve=Vo.resolve,t.resolveModulePath=Vo.resolveModulePath})(aw||(On.Files=aw={}));var uw;function xc(){if(uw!==void 0)try{uw.end()}catch{}}var Ns=!1,lw;function GO(){let t="--clientProcessId";function e(n){try{let r=parseInt(n);isNaN(r)||(lw=setInterval(()=>{try{process.kill(r,0)}catch{xc(),process.exit(Ns?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])}}}GO();var VO={initialize:t=>{let e=t.processId;Yp.number(e)&&lw===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(Ns?0:1)}},3e3)},get shutdownReceived(){return Ns},set shutdownReceived(t){Ns=t},exit:t=>{xc(),process.exit(t)}};function zO(t,e,n,r){let i,s,o,a;return t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=n,n=r),Ni.ConnectionStrategy.is(t)||Ni.ConnectionOptions.is(t)?a=t:(s=t,o=e,a=n),KO(s,o,a,i)}On.createConnection=zO;function KO(t,e,n,r){let i=!1;if(!t&&!e&&process.argv.length>2){let u,c,l=process.argv.slice(2);for(let d=0;d<l.length;d++){let p=l[d];if(p==="--node-ipc"){t=new Ni.IPCMessageReader(process),e=new Ni.IPCMessageWriter(process);break}else if(p==="--stdio"){i=!0,t=process.stdin,e=process.stdout;break}else if(p==="--socket"){u=parseInt(l[d+1]);break}else if(p==="--pipe"){c=l[d+1];break}else{var s=p.split("=");if(s[0]==="--socket"){u=parseInt(s[1]);break}else if(s[0]==="--pipe"){c=s[1];break}}}if(u){let d=(0,Ni.createServerSocketTransport)(u);t=d[0],e=d[1]}else if(c){let d=(0,Ni.createServerPipeTransport)(c);t=d[0],e=d[1]}}var o="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!t)throw new Error("Connection input stream is not set. "+o);if(!e)throw new Error("Connection output stream is not set. "+o);if(Yp.func(t.read)&&Yp.func(t.on)){let u=t;u.on("end",()=>{xc(),process.exit(Ns?0:1)}),u.on("close",()=>{xc(),process.exit(Ns?0:1)})}let a=u=>{let c=(0,Ni.createProtocolConnection)(t,e,u,n);return i&&XO(u),c};return(0,WO.createConnection)(a,VO,r)}function XO(t){function e(r){return r.map(i=>typeof i=="string"?i:(0,ow.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,ow.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 Jp=m((ZF,fw)=>{"use strict";fw.exports=dw()});var qs=m(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.IndentationType=Cr.ConfigurationNamespace=Cr.LanguageId=void 0;Cr.LanguageId="miniscript";Cr.ConfigurationNamespace="miniscript";var YO;(function(t){t.Tab="Tab",t.Whitespace="Whitespace"})(YO=Cr.IndentationType||(Cr.IndentationType={}))});var zo=m(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});kc.Position=void 0;var Qp=class{constructor(e,n){this.line=e,this.character=n}toString(){return`${this.line}:${this.character}`}};kc.Position=Qp});var ni=m(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.LiteralToken=yn.Token=yn.BaseToken=yn.BaseTokenOptions=yn.TokenType=void 0;var pw=zo(),JO;(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"})(JO=yn.TokenType||(yn.TokenType={}));var Zp=class{};yn.BaseTokenOptions=Zp;var Ko=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.offset,r=e.range;this.start=new pw.Position(this.line,r[0]-n+1),this.end=new pw.Position(this.lastLine||this.line,r[1]-n+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}']`}};yn.BaseToken=Ko;var eh=class extends Ko{};yn.Token=eh;var th=class extends Ko{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}]`}};yn.LiteralToken=th});var Cc=m(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.CharacterCode=void 0;var QO;(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"})(QO=Xo.CharacterCode||(Xo.CharacterCode={}))});var js=m(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});Yo.Keyword=void 0;var ZO;(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"})(ZO=Yo.Keyword||(Yo.Keyword={}))});var ih=m(rh=>{"use strict";Object.defineProperty(rh,"__esModule",{value:!0});var Rn=Cc(),eR=js(),nh=class{constructor(){this.isKeyword=Set.prototype.has.bind(new Set(Object.values(eR.Keyword)))}isWhitespace(e){return Rn.CharacterCode.WHITESPACE===e||Rn.CharacterCode.TAB===e}isEndOfLine(e){return Rn.CharacterCode.NEW_LINE===e||Rn.CharacterCode.RETURN_LINE===e}isComment(e,n){return Rn.CharacterCode.SLASH===e&&Rn.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>=Rn.CharacterCode.NUMBER_0&&e<=Rn.CharacterCode.NUMBER_9}isWinNewline(e,n){switch(e){case Rn.CharacterCode.RETURN_LINE:return Rn.CharacterCode.NEW_LINE===n;case Rn.CharacterCode.NEW_LINE:return Rn.CharacterCode.RETURN_LINE===n}return!1}};rh.default=nh});var Oc=m(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.ParserException=Fs.LexerException=void 0;var sh=class extends Error{constructor(e,n){super(e),this.range=n}};Fs.LexerException=sh;var oh=class extends Error{constructor(e,n){super(e),this.range=n}};Fs.ParserException=oh});var ah=m(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.Literal=void 0;var tR;(function(t){t.True="true",t.False="false",t.Null="null"})(tR=Jo.Literal||(Jo.Literal={}))});var $s=m(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.Operator=void 0;var nR;(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"})(nR=Qo.Operator||(Qo.Operator={}))});var Zo=m(Rc=>{"use strict";Object.defineProperty(Rc,"__esModule",{value:!0});Rc.Range=void 0;var uh=class{constructor(e,n){this.start=e,this.end=n}toString(){return`${this.start} - ${this.end}`}};Rc.Range=uh});var dh=m(lh=>{"use strict";Object.defineProperty(lh,"__esModule",{value:!0});var ch=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}};lh.default=ch});var hh=m(ta=>{"use strict";var mw=ta&&ta.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ta,"__esModule",{value:!0});var Qe=ni(),rR=mw(ih()),me=Cc(),iR=Oc(),fh=js(),ea=ah(),Ze=$s(),Bs=zo(),ph=Zo(),hw=mw(dh());function ri(t){let e=this.content[this.index];return this.index+=e.length,this.createPunctuator(e,t)}var Dc=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 rR.default,r.unsafe=n.unsafe,r.errors=[],r.backlog=new hw.default,r.snapshot=new hw.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 Qe.Token({type:Qe.TokenType.EOL,value:Ze.Operator.EndOfLine,line:n.line,lineStart:n.lineStart,range:[n.tokenStart,n.index],offset:n.offset,afterSpace:e});return n.snapshot.enqueue(r),r}createIdentifier(e,n){let r=this,i=new Qe.Token({type:Qe.TokenType.Identifier,value:e,line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offset:r.offset,afterSpace:n});return r.snapshot.enqueue(i),i}createEOF(e){let n=this,r=new Qe.Token({type:Qe.TokenType.EOF,value:Ze.Operator.EndOfFile,line:n.line,lineStart:n.lineStart,range:[n.index,n.index],offset:n.offset,afterSpace:e});return n.snapshot.enqueue(r),r}createBoolean(e,n){let r=this,i=new Qe.LiteralToken({type:Qe.TokenType.BooleanLiteral,value:e===ea.Literal.True,raw:e,line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offset:r.offset,afterSpace:n});return r.snapshot.enqueue(i),i}createNull(e){let n=this,r=new Qe.LiteralToken({type:Qe.TokenType.NilLiteral,value:null,raw:ea.Literal.Null,line:n.line,lineStart:n.lineStart,range:[n.tokenStart,n.index],offset:n.offset,afterSpace:e});return n.snapshot.enqueue(r),r}createSlice(e){let n=new Qe.Token({type:Qe.TokenType.SliceOperator,value:Ze.Operator.SliceSeperator,line:this.line,lineStart:this.lineStart,range:[this.tokenStart,this.index],offset:this.offset,afterSpace:e});return this.snapshot.enqueue(n),n}createPunctuator(e,n){let r=new Qe.Token({type:Qe.TokenType.Punctuator,value:e,line:this.line,lineStart:this.lineStart,range:[this.tokenStart,this.index],offset:this.offset,afterSpace:n});return this.snapshot.enqueue(r),r}createNumericLiteral(e,n,r){let i=new Qe.LiteralToken({type:Qe.TokenType.NumericLiteral,value:e,raw:n,line:this.line,lineStart:this.lineStart,range:[this.tokenStart,this.index],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=0,a=n.offset,u=!1;for(;n.index<n.length;){n.index++;let p=n.codeAt();if(n.validator.isEndOfLine(p))r.isWinNewline(p,n.codeAt(1))&&n.index++,n.line++,o=n.index+1-n.offset,a=n.index+1;else if(me.CharacterCode.QUOTE===p){if(me.CharacterCode.QUOTE!==n.codeAt(1)){u=!0;break}n.index++}}if(!u)return n.raise("Unexpected string end of file.",new ph.Range(new Bs.Position(i,s-a+1),new Bs.Position(n.line,n.index-a+1)));n.index++;let c=n.content.slice(n.tokenStart,n.index),l=c.slice(1,-1).replace(/""/g,Ze.Operator.Escape),d=new Qe.LiteralToken({type:Qe.TokenType.StringLiteral,value:l,raw:c,line:i,lineStart:s,range:[n.tokenStart,n.index-o],offset:n.offset,afterSpace:e,lastLine:n.line,lastLineStart:n.lineStart});return n.offset=a,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++);let o=n.content.slice(n.tokenStart+2,n.index),a=new Qe.Token({type:Qe.TokenType.Comment,value:o,line:i,lineStart:s,range:[n.tokenStart,n.index],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)||me.CharacterCode.DOT===i||me.CharacterCode.LETTER_E===i||me.CharacterCode.LETTER_e===i||(me.CharacterCode.MINUS===i||me.CharacterCode.PLUS===i)&&(me.CharacterCode.LETTER_E===r||me.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 ph.Range(new Bs.Position(this.line,this.tokenStart-this.offset+1),new Bs.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 fh.Keyword.End:{for(r.index++;i.isIdentifierPart(r.codeAt());r.index++);s=r.content.slice(r.tokenStart,r.index);break}case fh.Keyword.Else:{let a=r.content.slice(r.tokenStart,r.index+3);a===fh.Keyword.ElseIf&&(r.index+=3,s=a);break}}let o=new Qe.Token({type:Qe.TokenType.Keyword,value:s,line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],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 ea.Literal.True:case ea.Literal.False:return n.createBoolean(i,e);case ea.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 ph.Range(new Bs.Position(s,e.tokenStart-e.offset+1),new Bs.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 iR.LexerException(e,n);if(r.errors.push(i),r.unsafe)return new Qe.Token({type:Qe.TokenType.Invalid,value:"",line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offset:r.offset});throw i}};ta.default=Dc;Dc.scanHandlers={[me.CharacterCode.QUOTE]:function(e){return this.scanStringLiteral(e)},[me.CharacterCode.DOT]:function(e){return this.validator.isDecDigit(this.codeAt(1))?this.scanNumericLiteral(e):(this.index++,this.createPunctuator(Ze.Operator.Member,e))},[me.CharacterCode.EQUAL]:function(e){return me.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(Ze.Operator.Equal,e):this.scanPunctuator(Ze.Operator.Assign,e)},[me.CharacterCode.ARROW_LEFT]:function(e){return me.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(Ze.Operator.LessThanOrEqual,e):this.scanPunctuator(Ze.Operator.LessThan,e)},[me.CharacterCode.ARROW_RIGHT]:function(e){return me.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(Ze.Operator.GreaterThanOrEqual,e):this.scanPunctuator(Ze.Operator.GreaterThan,e)},[me.CharacterCode.EXCLAMATION_MARK]:function(e){return me.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(Ze.Operator.NotEqual,e):(this.index++,null)},[me.CharacterCode.MINUS]:function(e){return me.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(Ze.Operator.SubtractShorthand,e):this.scanPunctuator(Ze.Operator.Minus,e)},[me.CharacterCode.PLUS]:function(e){return me.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(Ze.Operator.AddShorthand,e):this.scanPunctuator(Ze.Operator.Plus,e)},[me.CharacterCode.ASTERISK]:function(e){return me.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(Ze.Operator.MultiplyShorthand,e):this.scanPunctuator(Ze.Operator.Asterik,e)},[me.CharacterCode.SLASH]:function(e){return me.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(Ze.Operator.DivideShorthand,e):this.scanPunctuator(Ze.Operator.Slash,e)},[me.CharacterCode.COLON]:function(e){return this.index++,this.createSlice(e)},[me.CharacterCode.CARET]:function(e){return me.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(Ze.Operator.PowerShorthand,e):this.scanPunctuator(Ze.Operator.Power,e)},[me.CharacterCode.PERCENT]:function(e){return me.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(Ze.Operator.ModuloShorthand,e):this.scanPunctuator(Ze.Operator.Modulo,e)},[me.CharacterCode.SEMICOLON]:function(e){return this.index++,this.createEOL(e)},[me.CharacterCode.COMMA]:ri,[me.CharacterCode.CURLY_BRACKET_LEFT]:ri,[me.CharacterCode.CURLY_BRACKET_RIGHT]:ri,[me.CharacterCode.SQUARE_BRACKETS_LEFT]:ri,[me.CharacterCode.SQUARE_BRACKETS_RIGHT]:ri,[me.CharacterCode.PARENTHESIS_LEFT]:ri,[me.CharacterCode.PARENTHESIS_RIGHT]:ri,[me.CharacterCode.AT_SIGN]:ri}});var ot=m(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.ASTComment=bn.ASTBaseBlockWithScope=bn.ASTBaseBlock=bn.ASTBase=bn.ASTType=void 0;var gw;(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"})(gw=bn.ASTType||(bn.ASTType={}));var na=class t{constructor(e,n){this.type=e,this.start=n.start,this.end=n.end,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,scope:this.scope})}};bn.ASTBase=na;var Ic=class t extends na{constructor(e,n){super(e,n),this.body=n.body||[]}toString(){let e=this.body.map(n=>`${n}`).join(`
35
+ `&&f++}g&&A.length>0&&T.push(A.length),this._lineOffsets=T}return this._lineOffsets},h.prototype.positionAt=function(T){T=Math.max(Math.min(T,this._content.length),0);var A=this.getLineOffsets(),g=0,f=A.length;if(f===0)return o.create(0,T);for(;g<f;){var R=Math.floor((g+f)/2);A[R]>T?f=R:g=R+1}var $=g-1;return o.create($,T-A[$])},h.prototype.offsetAt=function(T){var A=this.getLineOffsets();if(T.line>=A.length)return this._content.length;if(T.line<0)return 0;var g=A[T.line],f=T.line+1<A.length?A[T.line+1]:this._content.length;return Math.max(Math.min(g+T.character,f),g)},Object.defineProperty(h.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),h}(),D;(function(h){var T=Object.prototype.toString;function A(ve){return typeof ve<"u"}h.defined=A;function g(ve){return typeof ve>"u"}h.undefined=g;function f(ve){return ve===!0||ve===!1}h.boolean=f;function R(ve){return T.call(ve)==="[object String]"}h.string=R;function $(ve){return T.call(ve)==="[object Number]"}h.number=$;function pe(ve,hs,lu){return T.call(ve)==="[object Number]"&&hs<=ve&&ve<=lu}h.numberRange=pe;function it(ve){return T.call(ve)==="[object Number]"&&-2147483648<=ve&&ve<=2147483647}h.integer=it;function Be(ve){return T.call(ve)==="[object Number]"&&0<=ve&&ve<=2147483647}h.uinteger=Be;function Wn(ve){return T.call(ve)==="[object Function]"}h.func=Wn;function Gn(ve){return ve!==null&&typeof ve=="object"}h.objectLiteral=Gn;function Ar(ve,hs){return Array.isArray(ve)&&ve.every(hs)}h.typedArray=Ar})(D||(D={}))})});var Je=m(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.ProtocolNotificationType=on.ProtocolNotificationType0=on.ProtocolRequestType=on.ProtocolRequestType0=on.RegistrationType=on.MessageDirection=void 0;var ws=Ii(),E_;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(E_||(on.MessageDirection=E_={}));var cp=class{constructor(e){this.method=e}};on.RegistrationType=cp;var lp=class extends ws.RequestType0{constructor(e){super(e)}};on.ProtocolRequestType0=lp;var dp=class extends ws.RequestType{constructor(e){super(e,ws.ParameterStructures.byName)}};on.ProtocolRequestType=dp;var fp=class extends ws.NotificationType0{constructor(e){super(e)}};on.ProtocolNotificationType0=fp;var pp=class extends ws.NotificationType{constructor(e){super(e,ws.ParameterStructures.byName)}};on.ProtocolNotificationType=pp});var Lu=m(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.objectLiteral=bt.typedArray=bt.stringArray=bt.array=bt.func=bt.error=bt.number=bt.string=bt.boolean=void 0;function SC(t){return t===!0||t===!1}bt.boolean=SC;function A_(t){return typeof t=="string"||t instanceof String}bt.string=A_;function TC(t){return typeof t=="number"||t instanceof Number}bt.number=TC;function wC(t){return t instanceof Error}bt.error=wC;function EC(t){return typeof t=="function"}bt.func=EC;function x_(t){return Array.isArray(t)}bt.array=x_;function AC(t){return x_(t)&&t.every(e=>A_(e))}bt.stringArray=AC;function xC(t,e){return Array.isArray(t)&&t.every(e)}bt.typedArray=xC;function kC(t){return t!==null&&typeof t=="object"}bt.objectLiteral=kC});var O_=m(Nu=>{"use strict";Object.defineProperty(Nu,"__esModule",{value:!0});Nu.ImplementationRequest=void 0;var k_=Je(),C_;(function(t){t.method="textDocument/implementation",t.messageDirection=k_.MessageDirection.clientToServer,t.type=new k_.ProtocolRequestType(t.method)})(C_||(Nu.ImplementationRequest=C_={}))});var I_=m(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});qu.TypeDefinitionRequest=void 0;var R_=Je(),D_;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=R_.MessageDirection.clientToServer,t.type=new R_.ProtocolRequestType(t.method)})(D_||(qu.TypeDefinitionRequest=D_={}))});var L_=m(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.DidChangeWorkspaceFoldersNotification=Es.WorkspaceFoldersRequest=void 0;var ju=Je(),P_;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=ju.MessageDirection.serverToClient,t.type=new ju.ProtocolRequestType0(t.method)})(P_||(Es.WorkspaceFoldersRequest=P_={}));var M_;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=ju.MessageDirection.clientToServer,t.type=new ju.ProtocolNotificationType(t.method)})(M_||(Es.DidChangeWorkspaceFoldersNotification=M_={}))});var j_=m(Fu=>{"use strict";Object.defineProperty(Fu,"__esModule",{value:!0});Fu.ConfigurationRequest=void 0;var N_=Je(),q_;(function(t){t.method="workspace/configuration",t.messageDirection=N_.MessageDirection.serverToClient,t.type=new N_.ProtocolRequestType(t.method)})(q_||(Fu.ConfigurationRequest=q_={}))});var B_=m(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.ColorPresentationRequest=As.DocumentColorRequest=void 0;var $u=Je(),F_;(function(t){t.method="textDocument/documentColor",t.messageDirection=$u.MessageDirection.clientToServer,t.type=new $u.ProtocolRequestType(t.method)})(F_||(As.DocumentColorRequest=F_={}));var $_;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=$u.MessageDirection.clientToServer,t.type=new $u.ProtocolRequestType(t.method)})($_||(As.ColorPresentationRequest=$_={}))});var W_=m(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});xs.FoldingRangeRefreshRequest=xs.FoldingRangeRequest=void 0;var Bu=Je(),U_;(function(t){t.method="textDocument/foldingRange",t.messageDirection=Bu.MessageDirection.clientToServer,t.type=new Bu.ProtocolRequestType(t.method)})(U_||(xs.FoldingRangeRequest=U_={}));var H_;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=Bu.MessageDirection.serverToClient,t.type=new Bu.ProtocolRequestType0(t.method)})(H_||(xs.FoldingRangeRefreshRequest=H_={}))});var z_=m(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});Uu.DeclarationRequest=void 0;var G_=Je(),V_;(function(t){t.method="textDocument/declaration",t.messageDirection=G_.MessageDirection.clientToServer,t.type=new G_.ProtocolRequestType(t.method)})(V_||(Uu.DeclarationRequest=V_={}))});var Y_=m(Hu=>{"use strict";Object.defineProperty(Hu,"__esModule",{value:!0});Hu.SelectionRangeRequest=void 0;var K_=Je(),X_;(function(t){t.method="textDocument/selectionRange",t.messageDirection=K_.MessageDirection.clientToServer,t.type=new K_.ProtocolRequestType(t.method)})(X_||(Hu.SelectionRangeRequest=X_={}))});var ev=m(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.WorkDoneProgressCancelNotification=Kr.WorkDoneProgressCreateRequest=Kr.WorkDoneProgress=void 0;var CC=Ii(),Wu=Je(),J_;(function(t){t.type=new CC.ProgressType;function e(n){return n===t.type}t.is=e})(J_||(Kr.WorkDoneProgress=J_={}));var Q_;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=Wu.MessageDirection.serverToClient,t.type=new Wu.ProtocolRequestType(t.method)})(Q_||(Kr.WorkDoneProgressCreateRequest=Q_={}));var Z_;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=Wu.MessageDirection.clientToServer,t.type=new Wu.ProtocolNotificationType(t.method)})(Z_||(Kr.WorkDoneProgressCancelNotification=Z_={}))});var iv=m(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.CallHierarchyOutgoingCallsRequest=Xr.CallHierarchyIncomingCallsRequest=Xr.CallHierarchyPrepareRequest=void 0;var ks=Je(),tv;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=ks.MessageDirection.clientToServer,t.type=new ks.ProtocolRequestType(t.method)})(tv||(Xr.CallHierarchyPrepareRequest=tv={}));var nv;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=ks.MessageDirection.clientToServer,t.type=new ks.ProtocolRequestType(t.method)})(nv||(Xr.CallHierarchyIncomingCallsRequest=nv={}));var rv;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=ks.MessageDirection.clientToServer,t.type=new ks.ProtocolRequestType(t.method)})(rv||(Xr.CallHierarchyOutgoingCallsRequest=rv={}))});var lv=m(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.SemanticTokensRefreshRequest=an.SemanticTokensRangeRequest=an.SemanticTokensDeltaRequest=an.SemanticTokensRequest=an.SemanticTokensRegistrationType=an.TokenFormat=void 0;var kr=Je(),sv;(function(t){t.Relative="relative"})(sv||(an.TokenFormat=sv={}));var jo;(function(t){t.method="textDocument/semanticTokens",t.type=new kr.RegistrationType(t.method)})(jo||(an.SemanticTokensRegistrationType=jo={}));var ov;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=kr.MessageDirection.clientToServer,t.type=new kr.ProtocolRequestType(t.method),t.registrationMethod=jo.method})(ov||(an.SemanticTokensRequest=ov={}));var av;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=kr.MessageDirection.clientToServer,t.type=new kr.ProtocolRequestType(t.method),t.registrationMethod=jo.method})(av||(an.SemanticTokensDeltaRequest=av={}));var uv;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=kr.MessageDirection.clientToServer,t.type=new kr.ProtocolRequestType(t.method),t.registrationMethod=jo.method})(uv||(an.SemanticTokensRangeRequest=uv={}));var cv;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=kr.MessageDirection.serverToClient,t.type=new kr.ProtocolRequestType0(t.method)})(cv||(an.SemanticTokensRefreshRequest=cv={}))});var pv=m(Gu=>{"use strict";Object.defineProperty(Gu,"__esModule",{value:!0});Gu.ShowDocumentRequest=void 0;var dv=Je(),fv;(function(t){t.method="window/showDocument",t.messageDirection=dv.MessageDirection.serverToClient,t.type=new dv.ProtocolRequestType(t.method)})(fv||(Gu.ShowDocumentRequest=fv={}))});var gv=m(Vu=>{"use strict";Object.defineProperty(Vu,"__esModule",{value:!0});Vu.LinkedEditingRangeRequest=void 0;var hv=Je(),mv;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=hv.MessageDirection.clientToServer,t.type=new hv.ProtocolRequestType(t.method)})(mv||(Vu.LinkedEditingRangeRequest=mv={}))});var Ev=m(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.WillDeleteFilesRequest=Bt.DidDeleteFilesNotification=Bt.DidRenameFilesNotification=Bt.WillRenameFilesRequest=Bt.DidCreateFilesNotification=Bt.WillCreateFilesRequest=Bt.FileOperationPatternKind=void 0;var En=Je(),yv;(function(t){t.file="file",t.folder="folder"})(yv||(Bt.FileOperationPatternKind=yv={}));var bv;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=En.MessageDirection.clientToServer,t.type=new En.ProtocolRequestType(t.method)})(bv||(Bt.WillCreateFilesRequest=bv={}));var _v;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=En.MessageDirection.clientToServer,t.type=new En.ProtocolNotificationType(t.method)})(_v||(Bt.DidCreateFilesNotification=_v={}));var vv;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=En.MessageDirection.clientToServer,t.type=new En.ProtocolRequestType(t.method)})(vv||(Bt.WillRenameFilesRequest=vv={}));var Sv;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=En.MessageDirection.clientToServer,t.type=new En.ProtocolNotificationType(t.method)})(Sv||(Bt.DidRenameFilesNotification=Sv={}));var Tv;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=En.MessageDirection.clientToServer,t.type=new En.ProtocolNotificationType(t.method)})(Tv||(Bt.DidDeleteFilesNotification=Tv={}));var wv;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=En.MessageDirection.clientToServer,t.type=new En.ProtocolRequestType(t.method)})(wv||(Bt.WillDeleteFilesRequest=wv={}))});var Ov=m(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.MonikerRequest=Yr.MonikerKind=Yr.UniquenessLevel=void 0;var Av=Je(),xv;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(xv||(Yr.UniquenessLevel=xv={}));var kv;(function(t){t.$import="import",t.$export="export",t.local="local"})(kv||(Yr.MonikerKind=kv={}));var Cv;(function(t){t.method="textDocument/moniker",t.messageDirection=Av.MessageDirection.clientToServer,t.type=new Av.ProtocolRequestType(t.method)})(Cv||(Yr.MonikerRequest=Cv={}))});var Pv=m(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.TypeHierarchySubtypesRequest=Jr.TypeHierarchySupertypesRequest=Jr.TypeHierarchyPrepareRequest=void 0;var Cs=Je(),Rv;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=Cs.MessageDirection.clientToServer,t.type=new Cs.ProtocolRequestType(t.method)})(Rv||(Jr.TypeHierarchyPrepareRequest=Rv={}));var Dv;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=Cs.MessageDirection.clientToServer,t.type=new Cs.ProtocolRequestType(t.method)})(Dv||(Jr.TypeHierarchySupertypesRequest=Dv={}));var Iv;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=Cs.MessageDirection.clientToServer,t.type=new Cs.ProtocolRequestType(t.method)})(Iv||(Jr.TypeHierarchySubtypesRequest=Iv={}))});var Nv=m(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.InlineValueRefreshRequest=Os.InlineValueRequest=void 0;var zu=Je(),Mv;(function(t){t.method="textDocument/inlineValue",t.messageDirection=zu.MessageDirection.clientToServer,t.type=new zu.ProtocolRequestType(t.method)})(Mv||(Os.InlineValueRequest=Mv={}));var Lv;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=zu.MessageDirection.serverToClient,t.type=new zu.ProtocolRequestType0(t.method)})(Lv||(Os.InlineValueRefreshRequest=Lv={}))});var $v=m(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.InlayHintRefreshRequest=Qr.InlayHintResolveRequest=Qr.InlayHintRequest=void 0;var Rs=Je(),qv;(function(t){t.method="textDocument/inlayHint",t.messageDirection=Rs.MessageDirection.clientToServer,t.type=new Rs.ProtocolRequestType(t.method)})(qv||(Qr.InlayHintRequest=qv={}));var jv;(function(t){t.method="inlayHint/resolve",t.messageDirection=Rs.MessageDirection.clientToServer,t.type=new Rs.ProtocolRequestType(t.method)})(jv||(Qr.InlayHintResolveRequest=jv={}));var Fv;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=Rs.MessageDirection.serverToClient,t.type=new Rs.ProtocolRequestType0(t.method)})(Fv||(Qr.InlayHintRefreshRequest=Fv={}))});var zv=m(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.DiagnosticRefreshRequest=An.WorkspaceDiagnosticRequest=An.DocumentDiagnosticRequest=An.DocumentDiagnosticReportKind=An.DiagnosticServerCancellationData=void 0;var Vv=Ii(),OC=Lu(),Ds=Je(),Bv;(function(t){function e(n){let r=n;return r&&OC.boolean(r.retriggerRequest)}t.is=e})(Bv||(An.DiagnosticServerCancellationData=Bv={}));var Uv;(function(t){t.Full="full",t.Unchanged="unchanged"})(Uv||(An.DocumentDiagnosticReportKind=Uv={}));var Hv;(function(t){t.method="textDocument/diagnostic",t.messageDirection=Ds.MessageDirection.clientToServer,t.type=new Ds.ProtocolRequestType(t.method),t.partialResult=new Vv.ProgressType})(Hv||(An.DocumentDiagnosticRequest=Hv={}));var Wv;(function(t){t.method="workspace/diagnostic",t.messageDirection=Ds.MessageDirection.clientToServer,t.type=new Ds.ProtocolRequestType(t.method),t.partialResult=new Vv.ProgressType})(Wv||(An.WorkspaceDiagnosticRequest=Wv={}));var Gv;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=Ds.MessageDirection.serverToClient,t.type=new Ds.ProtocolRequestType0(t.method)})(Gv||(An.DiagnosticRefreshRequest=Gv={}))});var eS=m(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.DidCloseNotebookDocumentNotification=st.DidSaveNotebookDocumentNotification=st.DidChangeNotebookDocumentNotification=st.NotebookCellArrayChange=st.DidOpenNotebookDocumentNotification=st.NotebookDocumentSyncRegistrationType=st.NotebookDocument=st.NotebookCell=st.ExecutionSummary=st.NotebookCellKind=void 0;var Fo=Mu(),zn=Lu(),ir=Je(),hp;(function(t){t.Markup=1,t.Code=2;function e(n){return n===1||n===2}t.is=e})(hp||(st.NotebookCellKind=hp={}));var mp;(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 zn.objectLiteral(s)&&Fo.uinteger.is(s.executionOrder)&&(s.success===void 0||zn.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})(mp||(st.ExecutionSummary=mp={}));var Ku;(function(t){function e(s,o){return{kind:s,document:o}}t.create=e;function n(s){let o=s;return zn.objectLiteral(o)&&hp.is(o.kind)&&Fo.DocumentUri.is(o.document)&&(o.metadata===void 0||zn.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)&&!mp.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(zn.objectLiteral(s)&&zn.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 d=0;d<c.length;d++){let p=c[d];if(!i(s[p],o[p]))return!1}}return!0}})(Ku||(st.NotebookCell=Ku={}));var Kv;(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 zn.objectLiteral(i)&&zn.string(i.uri)&&Fo.integer.is(i.version)&&zn.typedArray(i.cells,Ku.is)}t.is=n})(Kv||(st.NotebookDocument=Kv={}));var Is;(function(t){t.method="notebookDocument/sync",t.messageDirection=ir.MessageDirection.clientToServer,t.type=new ir.RegistrationType(t.method)})(Is||(st.NotebookDocumentSyncRegistrationType=Is={}));var Xv;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=ir.MessageDirection.clientToServer,t.type=new ir.ProtocolNotificationType(t.method),t.registrationMethod=Is.method})(Xv||(st.DidOpenNotebookDocumentNotification=Xv={}));var Yv;(function(t){function e(r){let i=r;return zn.objectLiteral(i)&&Fo.uinteger.is(i.start)&&Fo.uinteger.is(i.deleteCount)&&(i.cells===void 0||zn.typedArray(i.cells,Ku.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})(Yv||(st.NotebookCellArrayChange=Yv={}));var Jv;(function(t){t.method="notebookDocument/didChange",t.messageDirection=ir.MessageDirection.clientToServer,t.type=new ir.ProtocolNotificationType(t.method),t.registrationMethod=Is.method})(Jv||(st.DidChangeNotebookDocumentNotification=Jv={}));var Qv;(function(t){t.method="notebookDocument/didSave",t.messageDirection=ir.MessageDirection.clientToServer,t.type=new ir.ProtocolNotificationType(t.method),t.registrationMethod=Is.method})(Qv||(st.DidSaveNotebookDocumentNotification=Qv={}));var Zv;(function(t){t.method="notebookDocument/didClose",t.messageDirection=ir.MessageDirection.clientToServer,t.type=new ir.ProtocolNotificationType(t.method),t.registrationMethod=Is.method})(Zv||(st.DidCloseNotebookDocumentNotification=Zv={}))});var rS=m(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});Xu.InlineCompletionRequest=void 0;var tS=Je(),nS;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=tS.MessageDirection.clientToServer,t.type=new tS.ProtocolRequestType(t.method)})(nS||(Xu.InlineCompletionRequest=nS={}))});var gT=m(b=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});b.WorkspaceSymbolRequest=b.CodeActionResolveRequest=b.CodeActionRequest=b.DocumentSymbolRequest=b.DocumentHighlightRequest=b.ReferencesRequest=b.DefinitionRequest=b.SignatureHelpRequest=b.SignatureHelpTriggerKind=b.HoverRequest=b.CompletionResolveRequest=b.CompletionRequest=b.CompletionTriggerKind=b.PublishDiagnosticsNotification=b.WatchKind=b.RelativePattern=b.FileChangeType=b.DidChangeWatchedFilesNotification=b.WillSaveTextDocumentWaitUntilRequest=b.WillSaveTextDocumentNotification=b.TextDocumentSaveReason=b.DidSaveTextDocumentNotification=b.DidCloseTextDocumentNotification=b.DidChangeTextDocumentNotification=b.TextDocumentContentChangeEvent=b.DidOpenTextDocumentNotification=b.TextDocumentSyncKind=b.TelemetryEventNotification=b.LogMessageNotification=b.ShowMessageRequest=b.ShowMessageNotification=b.MessageType=b.DidChangeConfigurationNotification=b.ExitNotification=b.ShutdownRequest=b.InitializedNotification=b.InitializeErrorCodes=b.InitializeRequest=b.WorkDoneProgressOptions=b.TextDocumentRegistrationOptions=b.StaticRegistrationOptions=b.PositionEncodingKind=b.FailureHandlingKind=b.ResourceOperationKind=b.UnregistrationRequest=b.RegistrationRequest=b.DocumentSelector=b.NotebookCellTextDocumentFilter=b.NotebookDocumentFilter=b.TextDocumentFilter=void 0;b.MonikerRequest=b.MonikerKind=b.UniquenessLevel=b.WillDeleteFilesRequest=b.DidDeleteFilesNotification=b.WillRenameFilesRequest=b.DidRenameFilesNotification=b.WillCreateFilesRequest=b.DidCreateFilesNotification=b.FileOperationPatternKind=b.LinkedEditingRangeRequest=b.ShowDocumentRequest=b.SemanticTokensRegistrationType=b.SemanticTokensRefreshRequest=b.SemanticTokensRangeRequest=b.SemanticTokensDeltaRequest=b.SemanticTokensRequest=b.TokenFormat=b.CallHierarchyPrepareRequest=b.CallHierarchyOutgoingCallsRequest=b.CallHierarchyIncomingCallsRequest=b.WorkDoneProgressCancelNotification=b.WorkDoneProgressCreateRequest=b.WorkDoneProgress=b.SelectionRangeRequest=b.DeclarationRequest=b.FoldingRangeRefreshRequest=b.FoldingRangeRequest=b.ColorPresentationRequest=b.DocumentColorRequest=b.ConfigurationRequest=b.DidChangeWorkspaceFoldersNotification=b.WorkspaceFoldersRequest=b.TypeDefinitionRequest=b.ImplementationRequest=b.ApplyWorkspaceEditRequest=b.ExecuteCommandRequest=b.PrepareRenameRequest=b.RenameRequest=b.PrepareSupportDefaultBehavior=b.DocumentOnTypeFormattingRequest=b.DocumentRangesFormattingRequest=b.DocumentRangeFormattingRequest=b.DocumentFormattingRequest=b.DocumentLinkResolveRequest=b.DocumentLinkRequest=b.CodeLensRefreshRequest=b.CodeLensResolveRequest=b.CodeLensRequest=b.WorkspaceSymbolResolveRequest=void 0;b.InlineCompletionRequest=b.DidCloseNotebookDocumentNotification=b.DidSaveNotebookDocumentNotification=b.DidChangeNotebookDocumentNotification=b.NotebookCellArrayChange=b.DidOpenNotebookDocumentNotification=b.NotebookDocumentSyncRegistrationType=b.NotebookDocument=b.NotebookCell=b.ExecutionSummary=b.NotebookCellKind=b.DiagnosticRefreshRequest=b.WorkspaceDiagnosticRequest=b.DocumentDiagnosticRequest=b.DocumentDiagnosticReportKind=b.DiagnosticServerCancellationData=b.InlayHintRefreshRequest=b.InlayHintResolveRequest=b.InlayHintRequest=b.InlineValueRefreshRequest=b.InlineValueRequest=b.TypeHierarchySupertypesRequest=b.TypeHierarchySubtypesRequest=b.TypeHierarchyPrepareRequest=void 0;var B=Je(),iS=Mu(),Rt=Lu(),RC=O_();Object.defineProperty(b,"ImplementationRequest",{enumerable:!0,get:function(){return RC.ImplementationRequest}});var DC=I_();Object.defineProperty(b,"TypeDefinitionRequest",{enumerable:!0,get:function(){return DC.TypeDefinitionRequest}});var fT=L_();Object.defineProperty(b,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return fT.WorkspaceFoldersRequest}});Object.defineProperty(b,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return fT.DidChangeWorkspaceFoldersNotification}});var IC=j_();Object.defineProperty(b,"ConfigurationRequest",{enumerable:!0,get:function(){return IC.ConfigurationRequest}});var pT=B_();Object.defineProperty(b,"DocumentColorRequest",{enumerable:!0,get:function(){return pT.DocumentColorRequest}});Object.defineProperty(b,"ColorPresentationRequest",{enumerable:!0,get:function(){return pT.ColorPresentationRequest}});var hT=W_();Object.defineProperty(b,"FoldingRangeRequest",{enumerable:!0,get:function(){return hT.FoldingRangeRequest}});Object.defineProperty(b,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return hT.FoldingRangeRefreshRequest}});var PC=z_();Object.defineProperty(b,"DeclarationRequest",{enumerable:!0,get:function(){return PC.DeclarationRequest}});var MC=Y_();Object.defineProperty(b,"SelectionRangeRequest",{enumerable:!0,get:function(){return MC.SelectionRangeRequest}});var vp=ev();Object.defineProperty(b,"WorkDoneProgress",{enumerable:!0,get:function(){return vp.WorkDoneProgress}});Object.defineProperty(b,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return vp.WorkDoneProgressCreateRequest}});Object.defineProperty(b,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return vp.WorkDoneProgressCancelNotification}});var Sp=iv();Object.defineProperty(b,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Sp.CallHierarchyIncomingCallsRequest}});Object.defineProperty(b,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Sp.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(b,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Sp.CallHierarchyPrepareRequest}});var Ps=lv();Object.defineProperty(b,"TokenFormat",{enumerable:!0,get:function(){return Ps.TokenFormat}});Object.defineProperty(b,"SemanticTokensRequest",{enumerable:!0,get:function(){return Ps.SemanticTokensRequest}});Object.defineProperty(b,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return Ps.SemanticTokensDeltaRequest}});Object.defineProperty(b,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return Ps.SemanticTokensRangeRequest}});Object.defineProperty(b,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return Ps.SemanticTokensRefreshRequest}});Object.defineProperty(b,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return Ps.SemanticTokensRegistrationType}});var LC=pv();Object.defineProperty(b,"ShowDocumentRequest",{enumerable:!0,get:function(){return LC.ShowDocumentRequest}});var NC=gv();Object.defineProperty(b,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return NC.LinkedEditingRangeRequest}});var Pi=Ev();Object.defineProperty(b,"FileOperationPatternKind",{enumerable:!0,get:function(){return Pi.FileOperationPatternKind}});Object.defineProperty(b,"DidCreateFilesNotification",{enumerable:!0,get:function(){return Pi.DidCreateFilesNotification}});Object.defineProperty(b,"WillCreateFilesRequest",{enumerable:!0,get:function(){return Pi.WillCreateFilesRequest}});Object.defineProperty(b,"DidRenameFilesNotification",{enumerable:!0,get:function(){return Pi.DidRenameFilesNotification}});Object.defineProperty(b,"WillRenameFilesRequest",{enumerable:!0,get:function(){return Pi.WillRenameFilesRequest}});Object.defineProperty(b,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return Pi.DidDeleteFilesNotification}});Object.defineProperty(b,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return Pi.WillDeleteFilesRequest}});var Tp=Ov();Object.defineProperty(b,"UniquenessLevel",{enumerable:!0,get:function(){return Tp.UniquenessLevel}});Object.defineProperty(b,"MonikerKind",{enumerable:!0,get:function(){return Tp.MonikerKind}});Object.defineProperty(b,"MonikerRequest",{enumerable:!0,get:function(){return Tp.MonikerRequest}});var wp=Pv();Object.defineProperty(b,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return wp.TypeHierarchyPrepareRequest}});Object.defineProperty(b,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return wp.TypeHierarchySubtypesRequest}});Object.defineProperty(b,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return wp.TypeHierarchySupertypesRequest}});var mT=Nv();Object.defineProperty(b,"InlineValueRequest",{enumerable:!0,get:function(){return mT.InlineValueRequest}});Object.defineProperty(b,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return mT.InlineValueRefreshRequest}});var Ep=$v();Object.defineProperty(b,"InlayHintRequest",{enumerable:!0,get:function(){return Ep.InlayHintRequest}});Object.defineProperty(b,"InlayHintResolveRequest",{enumerable:!0,get:function(){return Ep.InlayHintResolveRequest}});Object.defineProperty(b,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return Ep.InlayHintRefreshRequest}});var $o=zv();Object.defineProperty(b,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return $o.DiagnosticServerCancellationData}});Object.defineProperty(b,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return $o.DocumentDiagnosticReportKind}});Object.defineProperty(b,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return $o.DocumentDiagnosticRequest}});Object.defineProperty(b,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return $o.WorkspaceDiagnosticRequest}});Object.defineProperty(b,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return $o.DiagnosticRefreshRequest}});var sr=eS();Object.defineProperty(b,"NotebookCellKind",{enumerable:!0,get:function(){return sr.NotebookCellKind}});Object.defineProperty(b,"ExecutionSummary",{enumerable:!0,get:function(){return sr.ExecutionSummary}});Object.defineProperty(b,"NotebookCell",{enumerable:!0,get:function(){return sr.NotebookCell}});Object.defineProperty(b,"NotebookDocument",{enumerable:!0,get:function(){return sr.NotebookDocument}});Object.defineProperty(b,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return sr.NotebookDocumentSyncRegistrationType}});Object.defineProperty(b,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return sr.DidOpenNotebookDocumentNotification}});Object.defineProperty(b,"NotebookCellArrayChange",{enumerable:!0,get:function(){return sr.NotebookCellArrayChange}});Object.defineProperty(b,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return sr.DidChangeNotebookDocumentNotification}});Object.defineProperty(b,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return sr.DidSaveNotebookDocumentNotification}});Object.defineProperty(b,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return sr.DidCloseNotebookDocumentNotification}});var qC=rS();Object.defineProperty(b,"InlineCompletionRequest",{enumerable:!0,get:function(){return qC.InlineCompletionRequest}});var gp;(function(t){function e(n){let r=n;return Rt.string(r)||Rt.string(r.language)||Rt.string(r.scheme)||Rt.string(r.pattern)}t.is=e})(gp||(b.TextDocumentFilter=gp={}));var yp;(function(t){function e(n){let r=n;return Rt.objectLiteral(r)&&(Rt.string(r.notebookType)||Rt.string(r.scheme)||Rt.string(r.pattern))}t.is=e})(yp||(b.NotebookDocumentFilter=yp={}));var bp;(function(t){function e(n){let r=n;return Rt.objectLiteral(r)&&(Rt.string(r.notebook)||yp.is(r.notebook))&&(r.language===void 0||Rt.string(r.language))}t.is=e})(bp||(b.NotebookCellTextDocumentFilter=bp={}));var _p;(function(t){function e(n){if(!Array.isArray(n))return!1;for(let r of n)if(!Rt.string(r)&&!gp.is(r)&&!bp.is(r))return!1;return!0}t.is=e})(_p||(b.DocumentSelector=_p={}));var sS;(function(t){t.method="client/registerCapability",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolRequestType(t.method)})(sS||(b.RegistrationRequest=sS={}));var oS;(function(t){t.method="client/unregisterCapability",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolRequestType(t.method)})(oS||(b.UnregistrationRequest=oS={}));var aS;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(aS||(b.ResourceOperationKind=aS={}));var uS;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(uS||(b.FailureHandlingKind=uS={}));var cS;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(cS||(b.PositionEncodingKind=cS={}));var lS;(function(t){function e(n){let r=n;return r&&Rt.string(r.id)&&r.id.length>0}t.hasId=e})(lS||(b.StaticRegistrationOptions=lS={}));var dS;(function(t){function e(n){let r=n;return r&&(r.documentSelector===null||_p.is(r.documentSelector))}t.is=e})(dS||(b.TextDocumentRegistrationOptions=dS={}));var fS;(function(t){function e(r){let i=r;return Rt.objectLiteral(i)&&(i.workDoneProgress===void 0||Rt.boolean(i.workDoneProgress))}t.is=e;function n(r){let i=r;return i&&Rt.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=n})(fS||(b.WorkDoneProgressOptions=fS={}));var pS;(function(t){t.method="initialize",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(pS||(b.InitializeRequest=pS={}));var hS;(function(t){t.unknownProtocolVersion=1})(hS||(b.InitializeErrorCodes=hS={}));var mS;(function(t){t.method="initialized",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(mS||(b.InitializedNotification=mS={}));var gS;(function(t){t.method="shutdown",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType0(t.method)})(gS||(b.ShutdownRequest=gS={}));var yS;(function(t){t.method="exit",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType0(t.method)})(yS||(b.ExitNotification=yS={}));var bS;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(bS||(b.DidChangeConfigurationNotification=bS={}));var _S;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(_S||(b.MessageType=_S={}));var vS;(function(t){t.method="window/showMessage",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolNotificationType(t.method)})(vS||(b.ShowMessageNotification=vS={}));var SS;(function(t){t.method="window/showMessageRequest",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolRequestType(t.method)})(SS||(b.ShowMessageRequest=SS={}));var TS;(function(t){t.method="window/logMessage",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolNotificationType(t.method)})(TS||(b.LogMessageNotification=TS={}));var wS;(function(t){t.method="telemetry/event",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolNotificationType(t.method)})(wS||(b.TelemetryEventNotification=wS={}));var ES;(function(t){t.None=0,t.Full=1,t.Incremental=2})(ES||(b.TextDocumentSyncKind=ES={}));var AS;(function(t){t.method="textDocument/didOpen",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(AS||(b.DidOpenTextDocumentNotification=AS={}));var xS;(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})(xS||(b.TextDocumentContentChangeEvent=xS={}));var kS;(function(t){t.method="textDocument/didChange",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(kS||(b.DidChangeTextDocumentNotification=kS={}));var CS;(function(t){t.method="textDocument/didClose",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(CS||(b.DidCloseTextDocumentNotification=CS={}));var OS;(function(t){t.method="textDocument/didSave",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(OS||(b.DidSaveTextDocumentNotification=OS={}));var RS;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(RS||(b.TextDocumentSaveReason=RS={}));var DS;(function(t){t.method="textDocument/willSave",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(DS||(b.WillSaveTextDocumentNotification=DS={}));var IS;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(IS||(b.WillSaveTextDocumentWaitUntilRequest=IS={}));var PS;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolNotificationType(t.method)})(PS||(b.DidChangeWatchedFilesNotification=PS={}));var MS;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(MS||(b.FileChangeType=MS={}));var LS;(function(t){function e(n){let r=n;return Rt.objectLiteral(r)&&(iS.URI.is(r.baseUri)||iS.WorkspaceFolder.is(r.baseUri))&&Rt.string(r.pattern)}t.is=e})(LS||(b.RelativePattern=LS={}));var NS;(function(t){t.Create=1,t.Change=2,t.Delete=4})(NS||(b.WatchKind=NS={}));var qS;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolNotificationType(t.method)})(qS||(b.PublishDiagnosticsNotification=qS={}));var jS;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(jS||(b.CompletionTriggerKind=jS={}));var FS;(function(t){t.method="textDocument/completion",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(FS||(b.CompletionRequest=FS={}));var $S;(function(t){t.method="completionItem/resolve",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})($S||(b.CompletionResolveRequest=$S={}));var BS;(function(t){t.method="textDocument/hover",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(BS||(b.HoverRequest=BS={}));var US;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(US||(b.SignatureHelpTriggerKind=US={}));var HS;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(HS||(b.SignatureHelpRequest=HS={}));var WS;(function(t){t.method="textDocument/definition",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(WS||(b.DefinitionRequest=WS={}));var GS;(function(t){t.method="textDocument/references",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(GS||(b.ReferencesRequest=GS={}));var VS;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(VS||(b.DocumentHighlightRequest=VS={}));var zS;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(zS||(b.DocumentSymbolRequest=zS={}));var KS;(function(t){t.method="textDocument/codeAction",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(KS||(b.CodeActionRequest=KS={}));var XS;(function(t){t.method="codeAction/resolve",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(XS||(b.CodeActionResolveRequest=XS={}));var YS;(function(t){t.method="workspace/symbol",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(YS||(b.WorkspaceSymbolRequest=YS={}));var JS;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(JS||(b.WorkspaceSymbolResolveRequest=JS={}));var QS;(function(t){t.method="textDocument/codeLens",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(QS||(b.CodeLensRequest=QS={}));var ZS;(function(t){t.method="codeLens/resolve",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(ZS||(b.CodeLensResolveRequest=ZS={}));var eT;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolRequestType0(t.method)})(eT||(b.CodeLensRefreshRequest=eT={}));var tT;(function(t){t.method="textDocument/documentLink",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(tT||(b.DocumentLinkRequest=tT={}));var nT;(function(t){t.method="documentLink/resolve",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(nT||(b.DocumentLinkResolveRequest=nT={}));var rT;(function(t){t.method="textDocument/formatting",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(rT||(b.DocumentFormattingRequest=rT={}));var iT;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(iT||(b.DocumentRangeFormattingRequest=iT={}));var sT;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(sT||(b.DocumentRangesFormattingRequest=sT={}));var oT;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(oT||(b.DocumentOnTypeFormattingRequest=oT={}));var aT;(function(t){t.Identifier=1})(aT||(b.PrepareSupportDefaultBehavior=aT={}));var uT;(function(t){t.method="textDocument/rename",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(uT||(b.RenameRequest=uT={}));var cT;(function(t){t.method="textDocument/prepareRename",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(cT||(b.PrepareRenameRequest=cT={}));var lT;(function(t){t.method="workspace/executeCommand",t.messageDirection=B.MessageDirection.clientToServer,t.type=new B.ProtocolRequestType(t.method)})(lT||(b.ExecuteCommandRequest=lT={}));var dT;(function(t){t.method="workspace/applyEdit",t.messageDirection=B.MessageDirection.serverToClient,t.type=new B.ProtocolRequestType("workspace/applyEdit")})(dT||(b.ApplyWorkspaceEditRequest=dT={}))});var bT=m(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});Yu.createProtocolConnection=void 0;var yT=Ii();function jC(t,e,n,r){return yT.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,yT.createMessageConnection)(t,e,n,r)}Yu.createProtocolConnection=jC});var vT=m(un=>{"use strict";var FC=un&&un.__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=un&&un.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&FC(e,t,n)};Object.defineProperty(un,"__esModule",{value:!0});un.LSPErrorCodes=un.createProtocolConnection=void 0;Ju(Ii(),un);Ju(Mu(),un);Ju(Je(),un);Ju(gT(),un);var $C=bT();Object.defineProperty(un,"createProtocolConnection",{enumerable:!0,get:function(){return $C.createProtocolConnection}});var _T;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(_T||(un.LSPErrorCodes=_T={}))});var ft=m(or=>{"use strict";var BC=or&&or.__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]}),ST=or&&or.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&BC(e,t,n)};Object.defineProperty(or,"__esModule",{value:!0});or.createProtocolConnection=void 0;var UC=up();ST(up(),or);ST(vT(),or);function HC(t,e,n,r){return(0,UC.createMessageConnection)(t,e,n,r)}or.createProtocolConnection=HC});var Ap=m(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.generateUuid=xn.parse=xn.isUUID=xn.v4=xn.empty=void 0;var Bo=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},Uo=class t extends Bo{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(""))}};Uo._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];Uo._timeHighBits=["8","9","a","b"];xn.empty=new Bo("00000000-0000-0000-0000-000000000000");function TT(){return new Uo}xn.v4=TT;var WC=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function wT(t){return WC.test(t)}xn.isUUID=wT;function GC(t){if(!wT(t))throw new Error("invalid uuid");return new Bo(t)}xn.parse=GC;function VC(){return TT().asHex()}xn.generateUuid=VC});var ET=m(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.attachPartialResult=ei.ProgressFeature=ei.attachWorkDone=void 0;var Zr=ft(),zC=Ap(),Mi=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(Zr.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(Zr.WorkDoneProgress.type,this._token,r)}done(){t.Instances.delete(this._token),this._connection.sendProgress(Zr.WorkDoneProgress.type,this._token,{kind:"end"})}};Mi.Instances=new Map;var Qu=class extends Mi{constructor(e,n){super(e,n),this._source=new Zr.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},Ho=class{constructor(){}begin(){}report(){}done(){}},Zu=class extends Ho{constructor(){super(),this._source=new Zr.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function KC(t,e){if(e===void 0||e.workDoneToken===void 0)return new Ho;let n=e.workDoneToken;return delete e.workDoneToken,new Mi(t,n)}ei.attachWorkDone=KC;var XC=t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(Zr.WorkDoneProgressCancelNotification.type,n=>{let r=Mi.Instances.get(n.token);(r instanceof Qu||r instanceof Zu)&&r.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new Ho:new Mi(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,zC.generateUuid)();return this.connection.sendRequest(Zr.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Qu(this.connection,e))}else return Promise.resolve(new Zu)}};ei.ProgressFeature=XC;var xp;(function(t){t.type=new Zr.ProgressType})(xp||(xp={}));var kp=class{constructor(e,n){this._connection=e,this._token=n}report(e){this._connection.sendProgress(xp.type,this._token,e)}};function YC(t,e){if(e===void 0||e.partialResultToken===void 0)return;let n=e.partialResultToken;return delete e.partialResultToken,new kp(t,n)}ei.attachPartialResult=YC});var AT=m(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});ec.ConfigurationFeature=void 0;var JC=ft(),QC=du(),ZC=t=>class extends t{getConfiguration(e){return e?QC.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(JC.ConfigurationRequest.type,n).then(r=>Array.isArray(r)?Array.isArray(e)?r:r[0]:Array.isArray(e)?[]:null)}};ec.ConfigurationFeature=ZC});var xT=m(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});nc.WorkspaceFoldersFeature=void 0;var tc=ft(),eO=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let n=e.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new tc.Emitter,this.connection.onNotification(tc.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(tc.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(tc.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};nc.WorkspaceFoldersFeature=eO});var kT=m(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.CallHierarchyFeature=void 0;var Cp=ft(),tO=t=>class extends t{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(Cp.CallHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onIncomingCalls:e=>{let n=Cp.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onOutgoingCalls:e=>{let n=Cp.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};rc.CallHierarchyFeature=tO});var Rp=m(ti=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.SemanticTokensBuilder=ti.SemanticTokensDiff=ti.SemanticTokensFeature=void 0;var ic=ft(),nO=t=>class extends t{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(ic.SemanticTokensRefreshRequest.type),on:e=>{let n=ic.SemanticTokensRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onDelta:e=>{let n=ic.SemanticTokensDeltaRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onRange:e=>{let n=ic.SemanticTokensRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};ti.SemanticTokensFeature=nO;var sc=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}]:[]}};ti.SemanticTokensDiff=sc;var Op=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 sc(this._prevData,this._data).computeDiff()}:this.build()}};ti.SemanticTokensBuilder=Op});var CT=m(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.ShowDocumentFeature=void 0;var rO=ft(),iO=t=>class extends t{showDocument(e){return this.connection.sendRequest(rO.ShowDocumentRequest.type,e)}};oc.ShowDocumentFeature=iO});var OT=m(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.FileOperationsFeature=void 0;var Ms=ft(),sO=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(Ms.DidCreateFilesNotification.type,n=>{e(n)})}onDidRenameFiles(e){return this.connection.onNotification(Ms.DidRenameFilesNotification.type,n=>{e(n)})}onDidDeleteFiles(e){return this.connection.onNotification(Ms.DidDeleteFilesNotification.type,n=>{e(n)})}onWillCreateFiles(e){return this.connection.onRequest(Ms.WillCreateFilesRequest.type,(n,r)=>e(n,r))}onWillRenameFiles(e){return this.connection.onRequest(Ms.WillRenameFilesRequest.type,(n,r)=>e(n,r))}onWillDeleteFiles(e){return this.connection.onRequest(Ms.WillDeleteFilesRequest.type,(n,r)=>e(n,r))}};ac.FileOperationsFeature=sO});var RT=m(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.LinkedEditingRangeFeature=void 0;var oO=ft(),aO=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(oO.LinkedEditingRangeRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0))}};uc.LinkedEditingRangeFeature=aO});var DT=m(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.TypeHierarchyFeature=void 0;var Dp=ft(),uO=t=>class extends t{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(Dp.TypeHierarchyPrepareRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),void 0)),onSupertypes:e=>{let n=Dp.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onSubtypes:e=>{let n=Dp.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};cc.TypeHierarchyFeature=uO});var PT=m(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc.InlineValueFeature=void 0;var IT=ft(),cO=t=>class extends t{get inlineValue(){return{refresh:()=>this.connection.sendRequest(IT.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(IT.InlineValueRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};lc.InlineValueFeature=cO});var LT=m(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.FoldingRangeFeature=void 0;var MT=ft(),lO=t=>class extends t{get foldingRange(){return{refresh:()=>this.connection.sendRequest(MT.FoldingRangeRefreshRequest.type),on:e=>{let n=MT.FoldingRangeRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};dc.FoldingRangeFeature=lO});var NT=m(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.InlayHintFeature=void 0;var Ip=ft(),dO=t=>class extends t{get inlayHint(){return{refresh:()=>this.connection.sendRequest(Ip.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(Ip.InlayHintRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n))),resolve:e=>this.connection.onRequest(Ip.InlayHintResolveRequest.type,(n,r)=>e(n,r))}}};fc.InlayHintFeature=dO});var qT=m(pc=>{"use strict";Object.defineProperty(pc,"__esModule",{value:!0});pc.DiagnosticFeature=void 0;var Wo=ft(),fO=t=>class extends t{get diagnostics(){return{refresh:()=>this.connection.sendRequest(Wo.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(Wo.DocumentDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(Wo.DocumentDiagnosticRequest.partialResult,n))),onWorkspace:e=>this.connection.onRequest(Wo.WorkspaceDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(Wo.WorkspaceDiagnosticRequest.partialResult,n)))}}};pc.DiagnosticFeature=fO});var Mp=m(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});hc.TextDocuments=void 0;var Li=ft(),Pp=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new Li.Emitter,this._onDidOpen=new Li.Emitter,this._onDidClose=new Li.Emitter,this._onDidSave=new Li.Emitter,this._onWillSave=new Li.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=Li.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}))})),Li.Disposable.create(()=>{n.forEach(r=>r.dispose())})}};hc.TextDocuments=Pp});var Np=m(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.NotebookDocuments=Ls.NotebookSyncFeature=void 0;var kn=ft(),jT=Mp(),pO=t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(kn.DidOpenNotebookDocumentNotification.type,n=>{e(n)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(kn.DidChangeNotebookDocumentNotification.type,n=>{e(n)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(kn.DidSaveNotebookDocumentNotification.type,n=>{e(n)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(kn.DidCloseNotebookDocumentNotification.type,n=>{e(n)})}}};Ls.NotebookSyncFeature=pO;var mc=class t{onDidOpenTextDocument(e){return this.openHandler=e,kn.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,kn.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,kn.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}};mc.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var Lp=class{constructor(e){e instanceof jT.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new jT.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new kn.Emitter,this._onDidChange=new kn.Emitter,this._onDidSave=new kn.Emitter,this._onDidClose=new kn.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 mc,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=[],d=[],p=[];if(u.cells!==void 0){let P=u.cells;if(P.structure!==void 0){let w=P.structure.array;if(s.cells.splice(w.start,w.deleteCount,...w.cells!==void 0?w.cells:[]),P.structure.didOpen!==void 0)for(let E of P.structure.didOpen)n.openTextDocument({textDocument:E}),c.push(E.uri);if(P.structure.didClose)for(let E of P.structure.didClose)n.closeTextDocument({textDocument:E}),l.push(E.uri)}if(P.data!==void 0){let w=new Map(P.data.map(E=>[E.document,E]));for(let E=0;E<=s.cells.length;E++){let _=w.get(s.cells[E].document);if(_!==void 0){let j=s.cells.splice(E,1,_);if(d.push({old:j[0],new:_}),w.delete(_.document),w.size===0)break}}}if(P.textContent!==void 0)for(let w of P.textContent)n.changeTextDocument({textDocument:w.document,contentChanges:w.changes}),p.push(w.document.uri)}this.updateCellMap(s);let y={notebookDocument:s};a&&(y.metadata={old:o,new:s.metadata});let v=[];for(let P of c)v.push(this.getNotebookCell(P));let x=[];for(let P of l)x.push(this.getNotebookCell(P));let I=[];for(let P of p)I.push(this.getNotebookCell(P));(v.length>0||x.length>0||d.length>0||I.length>0)&&(y.cells={added:v,removed:x,changed:{data:d,textContent:I}}),(y.metadata!==void 0||y.cells!==void 0)&&this._onDidChange.fire(y)})),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)}})),kn.Disposable.create(()=>{r.forEach(i=>i.dispose())})}updateCellMap(e){for(let n of e.cells)this.notebookCellMap.set(n.document,[n,e])}};Ls.NotebookDocuments=Lp});var FT=m(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});gc.MonikerFeature=void 0;var hO=ft(),mO=t=>class extends t{get moniker(){return{on:e=>{let n=hO.MonikerRequest.type;return this.connection.onRequest(n,(r,i)=>e(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};gc.MonikerFeature=mO});var Up=m(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.createConnection=xe.combineFeatures=xe.combineNotebooksFeatures=xe.combineLanguagesFeatures=xe.combineWorkspaceFeatures=xe.combineWindowFeatures=xe.combineClientFeatures=xe.combineTracerFeatures=xe.combineTelemetryFeatures=xe.combineConsoleFeatures=xe._NotebooksImpl=xe._LanguagesImpl=xe.BulkUnregistration=xe.BulkRegistration=xe.ErrorMessageTracker=void 0;var G=ft(),Cn=du(),jp=Ap(),le=ET(),gO=AT(),yO=xT(),bO=kT(),_O=Rp(),vO=CT(),SO=OT(),TO=RT(),wO=DT(),EO=PT(),AO=LT(),xO=NT(),kO=qT(),CO=Np(),OO=FT();function qp(t){if(t!==null)return t}var Fp=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)})}};xe.ErrorMessageTracker=Fp;var yc=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(G.MessageType.Error,e)}warn(e){this.send(G.MessageType.Warning,e)}info(e){this.send(G.MessageType.Info,e)}log(e){this.send(G.MessageType.Log,e)}debug(e){this.send(G.MessageType.Debug,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(G.LogMessageNotification.type,{type:e,message:n}).catch(()=>{(0,G.RAL)().console.error("Sending log message failed")})}},$p=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:G.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(G.ShowMessageRequest.type,r).then(qp)}showWarningMessage(e,...n){let r={type:G.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(G.ShowMessageRequest.type,r).then(qp)}showInformationMessage(e,...n){let r={type:G.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(G.ShowMessageRequest.type,r).then(qp)}},$T=(0,vO.ShowDocumentFeature)((0,le.ProgressFeature)($p)),BT;(function(t){function e(){return new bc}t.create=e})(BT||(xe.BulkRegistration=BT={}));var bc=class{constructor(){this._registrations=[],this._registered=new Set}add(e,n){let r=Cn.string(e)?e:e.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);let i=jp.generateUuid();this._registrations.push({id:i,method:r,registerOptions:n||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}},UT;(function(t){function e(){return new Go(void 0,[])}t.create=e})(UT||(xe.BulkUnregistration=UT={}));var Go=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(G.UnregistrationRequest.type,n).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let n=Cn.string(e)?e:e.method,r=this._unregistrations.get(n);if(!r)return!1;let i={unregisterations:[r]};return this._connection.sendRequest(G.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(n)},s=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}},_c=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 bc?this.registerMany(e):e instanceof Go?this.registerSingle1(e,n,r):this.registerSingle2(e,n)}registerSingle1(e,n,r){let i=Cn.string(n)?n:n.method,s=jp.generateUuid(),o={registrations:[{id:s,method:i,registerOptions:r||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(G.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=Cn.string(e)?e:e.method,i=jp.generateUuid(),s={registrations:[{id:i,method:r,registerOptions:n||{}}]};return this.connection.sendRequest(G.RegistrationRequest.type,s).then(o=>G.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(G.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(G.RegistrationRequest.type,n).then(()=>new Go(this._connection,n.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}},Bp=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(G.ApplyWorkspaceEditRequest.type,r)}},HT=(0,SO.FileOperationsFeature)((0,yO.WorkspaceFoldersFeature)((0,gO.ConfigurationFeature)(Bp))),vc=class{constructor(){this._trace=G.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!==G.Trace.Off&&this.connection.sendNotification(G.LogTraceNotification.type,{message:e,verbose:this._trace===G.Trace.Verbose?n:void 0}).catch(()=>{})}},Sc=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(G.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},Tc=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,le.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,le.attachPartialResult)(this.connection,n)}};xe._LanguagesImpl=Tc;var WT=(0,AO.FoldingRangeFeature)((0,OO.MonikerFeature)((0,kO.DiagnosticFeature)((0,xO.InlayHintFeature)((0,EO.InlineValueFeature)((0,wO.TypeHierarchyFeature)((0,TO.LinkedEditingRangeFeature)((0,_O.SemanticTokensFeature)((0,bO.CallHierarchyFeature)(Tc))))))))),wc=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,le.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,n){return(0,le.attachPartialResult)(this.connection,n)}};xe._NotebooksImpl=wc;var GT=(0,CO.NotebookSyncFeature)(wc);function VT(t,e){return function(n){return e(t(n))}}xe.combineConsoleFeatures=VT;function zT(t,e){return function(n){return e(t(n))}}xe.combineTelemetryFeatures=zT;function KT(t,e){return function(n){return e(t(n))}}xe.combineTracerFeatures=KT;function XT(t,e){return function(n){return e(t(n))}}xe.combineClientFeatures=XT;function YT(t,e){return function(n){return e(t(n))}}xe.combineWindowFeatures=YT;function JT(t,e){return function(n){return e(t(n))}}xe.combineWorkspaceFeatures=JT;function QT(t,e){return function(n){return e(t(n))}}xe.combineLanguagesFeatures=QT;function ZT(t,e){return function(n){return e(t(n))}}xe.combineNotebooksFeatures=ZT;function RO(t,e){function n(i,s,o){return i&&s?o(i,s):i||s}return{__brand:"features",console:n(t.console,e.console,VT),tracer:n(t.tracer,e.tracer,KT),telemetry:n(t.telemetry,e.telemetry,zT),client:n(t.client,e.client,XT),window:n(t.window,e.window,YT),workspace:n(t.workspace,e.workspace,JT),languages:n(t.languages,e.languages,QT),notebooks:n(t.notebooks,e.notebooks,ZT)}}xe.combineFeatures=RO;function DO(t,e,n){let r=n&&n.console?new(n.console(yc)):new yc,i=t(r);r.rawAttach(i);let s=n&&n.tracer?new(n.tracer(vc)):new vc,o=n&&n.telemetry?new(n.telemetry(Sc)):new Sc,a=n&&n.client?new(n.client(_c)):new _c,u=n&&n.window?new(n.window($T)):new $T,c=n&&n.workspace?new(n.workspace(HT)):new HT,l=n&&n.languages?new(n.languages(WT)):new WT,d=n&&n.notebooks?new(n.notebooks(GT)):new GT,p=[r,s,o,a,u,c,l,d];function y(w){return w instanceof Promise?w:Cn.thenable(w)?new Promise((E,_)=>{w.then(j=>E(j),j=>_(j))}):Promise.resolve(w)}let v,x,I,P={listen:()=>i.listen(),sendRequest:(w,...E)=>i.sendRequest(Cn.string(w)?w:w.method,...E),onRequest:(w,E)=>i.onRequest(w,E),sendNotification:(w,E)=>{let _=Cn.string(w)?w:w.method;return i.sendNotification(_,E)},onNotification:(w,E)=>i.onNotification(w,E),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:w=>(x=w,{dispose:()=>{x=void 0}}),onInitialized:w=>i.onNotification(G.InitializedNotification.type,w),onShutdown:w=>(v=w,{dispose:()=>{v=void 0}}),onExit:w=>(I=w,{dispose:()=>{I=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 d},onDidChangeConfiguration:w=>i.onNotification(G.DidChangeConfigurationNotification.type,w),onDidChangeWatchedFiles:w=>i.onNotification(G.DidChangeWatchedFilesNotification.type,w),__textDocumentSync:void 0,onDidOpenTextDocument:w=>i.onNotification(G.DidOpenTextDocumentNotification.type,w),onDidChangeTextDocument:w=>i.onNotification(G.DidChangeTextDocumentNotification.type,w),onDidCloseTextDocument:w=>i.onNotification(G.DidCloseTextDocumentNotification.type,w),onWillSaveTextDocument:w=>i.onNotification(G.WillSaveTextDocumentNotification.type,w),onWillSaveTextDocumentWaitUntil:w=>i.onRequest(G.WillSaveTextDocumentWaitUntilRequest.type,w),onDidSaveTextDocument:w=>i.onNotification(G.DidSaveTextDocumentNotification.type,w),sendDiagnostics:w=>i.sendNotification(G.PublishDiagnosticsNotification.type,w),onHover:w=>i.onRequest(G.HoverRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),void 0)),onCompletion:w=>i.onRequest(G.CompletionRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onCompletionResolve:w=>i.onRequest(G.CompletionResolveRequest.type,w),onSignatureHelp:w=>i.onRequest(G.SignatureHelpRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),void 0)),onDeclaration:w=>i.onRequest(G.DeclarationRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onDefinition:w=>i.onRequest(G.DefinitionRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onTypeDefinition:w=>i.onRequest(G.TypeDefinitionRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onImplementation:w=>i.onRequest(G.ImplementationRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onReferences:w=>i.onRequest(G.ReferencesRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onDocumentHighlight:w=>i.onRequest(G.DocumentHighlightRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onDocumentSymbol:w=>i.onRequest(G.DocumentSymbolRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onWorkspaceSymbol:w=>i.onRequest(G.WorkspaceSymbolRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onWorkspaceSymbolResolve:w=>i.onRequest(G.WorkspaceSymbolResolveRequest.type,w),onCodeAction:w=>i.onRequest(G.CodeActionRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onCodeActionResolve:w=>i.onRequest(G.CodeActionResolveRequest.type,(E,_)=>w(E,_)),onCodeLens:w=>i.onRequest(G.CodeLensRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onCodeLensResolve:w=>i.onRequest(G.CodeLensResolveRequest.type,(E,_)=>w(E,_)),onDocumentFormatting:w=>i.onRequest(G.DocumentFormattingRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),void 0)),onDocumentRangeFormatting:w=>i.onRequest(G.DocumentRangeFormattingRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),void 0)),onDocumentOnTypeFormatting:w=>i.onRequest(G.DocumentOnTypeFormattingRequest.type,(E,_)=>w(E,_)),onRenameRequest:w=>i.onRequest(G.RenameRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),void 0)),onPrepareRename:w=>i.onRequest(G.PrepareRenameRequest.type,(E,_)=>w(E,_)),onDocumentLinks:w=>i.onRequest(G.DocumentLinkRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onDocumentLinkResolve:w=>i.onRequest(G.DocumentLinkResolveRequest.type,(E,_)=>w(E,_)),onDocumentColor:w=>i.onRequest(G.DocumentColorRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onColorPresentation:w=>i.onRequest(G.ColorPresentationRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onFoldingRanges:w=>i.onRequest(G.FoldingRangeRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onSelectionRanges:w=>i.onRequest(G.SelectionRangeRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),(0,le.attachPartialResult)(i,E))),onExecuteCommand:w=>i.onRequest(G.ExecuteCommandRequest.type,(E,_)=>w(E,_,(0,le.attachWorkDone)(i,E),void 0)),dispose:()=>i.dispose()};for(let w of p)w.attach(P);return i.onRequest(G.InitializeRequest.type,w=>{e.initialize(w),Cn.string(w.trace)&&(s.trace=G.Trace.fromString(w.trace));for(let E of p)E.initialize(w.capabilities);if(x){let E=x(w,new G.CancellationTokenSource().token,(0,le.attachWorkDone)(i,w),void 0);return y(E).then(_=>{if(_ instanceof G.ResponseError)return _;let j=_;j||(j={capabilities:{}});let O=j.capabilities;O||(O={},j.capabilities=O),O.textDocumentSync===void 0||O.textDocumentSync===null?O.textDocumentSync=Cn.number(P.__textDocumentSync)?P.__textDocumentSync:G.TextDocumentSyncKind.None:!Cn.number(O.textDocumentSync)&&!Cn.number(O.textDocumentSync.change)&&(O.textDocumentSync.change=Cn.number(P.__textDocumentSync)?P.__textDocumentSync:G.TextDocumentSyncKind.None);for(let H of p)H.fillServerCapabilities(O);return j})}else{let E={capabilities:{textDocumentSync:G.TextDocumentSyncKind.None}};for(let _ of p)_.fillServerCapabilities(E.capabilities);return E}}),i.onRequest(G.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,v)return v(new G.CancellationTokenSource().token)}),i.onNotification(G.ExitNotification.type,()=>{try{I&&I()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),i.onNotification(G.SetTraceNotification.type,w=>{s.trace=G.Trace.fromString(w.value)}),P}xe.createConnection=DO});var ew=m(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.resolveModulePath=cn.FileSystem=cn.resolveGlobalYarnPath=cn.resolveGlobalNodePath=cn.resolve=cn.uriToFilePath=void 0;var IO=require("url"),Kn=require("path"),Hp=require("fs"),zp=require("child_process");function PO(t){let e=IO.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 Kn.normalize(n.join("/"))}cn.uriToFilePath=PO;function Wp(){return process.platform==="win32"}function Ec(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&&Hp.existsSync(e)&&(c[i]?c[i]=e+Kn.delimiter+c[i]:c[i]=e,r&&r(`NODE_PATH value is: ${c[i]}`)),c.ELECTRON_RUN_AS_NODE="1";try{let l=(0,zp.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",p=>{a(p)}),l.on("message",p=>{p.c==="r"&&(l.send({c:"e"}),p.s?o(p.r):a(new Error(`Failed to resolve module: ${t}`)))});let d={c:"rs",a:t};l.send(d)}catch(l){a(l)}})}cn.resolve=Ec;function Gp(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};Wp()&&(e="npm.cmd",r.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let s=(0,zp.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?Wp()?Kn.join(o,"node_modules"):Kn.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i)}}cn.resolveGlobalNodePath=Gp;function MO(t){let e="yarn",n={encoding:"utf8"};Wp()&&(e="yarn.cmd",n.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let i=(0,zp.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 Kn.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",r)}}cn.resolveGlobalYarnPath=MO;var Vp;(function(t){let e;function n(){return e!==void 0||(process.platform==="win32"?e=!1:e=!Hp.existsSync(__filename.toUpperCase())||!Hp.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=n;function r(i,s){return n()?Kn.normalize(s).indexOf(Kn.normalize(i))===0:Kn.normalize(s).toLowerCase().indexOf(Kn.normalize(i).toLowerCase())===0}t.isParent=r})(Vp||(cn.FileSystem=Vp={}));function LO(t,e,n,r){return n?(Kn.isAbsolute(n)||(n=Kn.join(t,n)),Ec(e,n,n,r).then(i=>Vp.isParent(n,i)?i:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,i=>Ec(e,Gp(r),t,r))):Ec(e,Gp(r),t,r)}cn.resolveModulePath=LO});var Kp=m((KF,tw)=>{"use strict";tw.exports=ft()});var nw=m(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});Ac.InlineCompletionFeature=void 0;var NO=ft(),qO=t=>class extends t{get inlineCompletion(){return{on:e=>this.connection.onRequest(NO.InlineCompletionRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n)))}}};Ac.InlineCompletionFeature=qO});var sw=m(Ut=>{"use strict";var jO=Ut&&Ut.__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]}),iw=Ut&&Ut.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&jO(e,t,n)};Object.defineProperty(Ut,"__esModule",{value:!0});Ut.ProposedFeatures=Ut.NotebookDocuments=Ut.TextDocuments=Ut.SemanticTokensBuilder=void 0;var FO=Rp();Object.defineProperty(Ut,"SemanticTokensBuilder",{enumerable:!0,get:function(){return FO.SemanticTokensBuilder}});var $O=nw();iw(ft(),Ut);var BO=Mp();Object.defineProperty(Ut,"TextDocuments",{enumerable:!0,get:function(){return BO.TextDocuments}});var UO=Np();Object.defineProperty(Ut,"NotebookDocuments",{enumerable:!0,get:function(){return UO.NotebookDocuments}});iw(Up(),Ut);var rw;(function(t){t.all={__brand:"features",languages:$O.InlineCompletionFeature}})(rw||(Ut.ProposedFeatures=rw={}))});var dw=m(On=>{"use strict";var HO=On&&On.__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]}),cw=On&&On.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&HO(e,t,n)};Object.defineProperty(On,"__esModule",{value:!0});On.createConnection=On.Files=void 0;var ow=require("node:util"),Xp=du(),WO=Up(),Vo=ew(),Ni=Kp();cw(Kp(),On);cw(sw(),On);var aw;(function(t){t.uriToFilePath=Vo.uriToFilePath,t.resolveGlobalNodePath=Vo.resolveGlobalNodePath,t.resolveGlobalYarnPath=Vo.resolveGlobalYarnPath,t.resolve=Vo.resolve,t.resolveModulePath=Vo.resolveModulePath})(aw||(On.Files=aw={}));var uw;function xc(){if(uw!==void 0)try{uw.end()}catch{}}var Ns=!1,lw;function GO(){let t="--clientProcessId";function e(n){try{let r=parseInt(n);isNaN(r)||(lw=setInterval(()=>{try{process.kill(r,0)}catch{xc(),process.exit(Ns?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])}}}GO();var VO={initialize:t=>{let e=t.processId;Xp.number(e)&&lw===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(Ns?0:1)}},3e3)},get shutdownReceived(){return Ns},set shutdownReceived(t){Ns=t},exit:t=>{xc(),process.exit(t)}};function zO(t,e,n,r){let i,s,o,a;return t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=n,n=r),Ni.ConnectionStrategy.is(t)||Ni.ConnectionOptions.is(t)?a=t:(s=t,o=e,a=n),KO(s,o,a,i)}On.createConnection=zO;function KO(t,e,n,r){let i=!1;if(!t&&!e&&process.argv.length>2){let u,c,l=process.argv.slice(2);for(let d=0;d<l.length;d++){let p=l[d];if(p==="--node-ipc"){t=new Ni.IPCMessageReader(process),e=new Ni.IPCMessageWriter(process);break}else if(p==="--stdio"){i=!0,t=process.stdin,e=process.stdout;break}else if(p==="--socket"){u=parseInt(l[d+1]);break}else if(p==="--pipe"){c=l[d+1];break}else{var s=p.split("=");if(s[0]==="--socket"){u=parseInt(s[1]);break}else if(s[0]==="--pipe"){c=s[1];break}}}if(u){let d=(0,Ni.createServerSocketTransport)(u);t=d[0],e=d[1]}else if(c){let d=(0,Ni.createServerPipeTransport)(c);t=d[0],e=d[1]}}var o="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!t)throw new Error("Connection input stream is not set. "+o);if(!e)throw new Error("Connection output stream is not set. "+o);if(Xp.func(t.read)&&Xp.func(t.on)){let u=t;u.on("end",()=>{xc(),process.exit(Ns?0:1)}),u.on("close",()=>{xc(),process.exit(Ns?0:1)})}let a=u=>{let c=(0,Ni.createProtocolConnection)(t,e,u,n);return i&&XO(u),c};return(0,WO.createConnection)(a,VO,r)}function XO(t){function e(r){return r.map(i=>typeof i=="string"?i:(0,ow.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,ow.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 Yp=m((ZF,fw)=>{"use strict";fw.exports=dw()});var qs=m(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.IndentationType=Cr.ConfigurationNamespace=Cr.LanguageId=void 0;Cr.LanguageId="miniscript";Cr.ConfigurationNamespace="miniscript";var YO;(function(t){t.Tab="Tab",t.Whitespace="Whitespace"})(YO=Cr.IndentationType||(Cr.IndentationType={}))});var zo=m(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});kc.Position=void 0;var Jp=class{constructor(e,n){this.line=e,this.character=n}toString(){return`${this.line}:${this.character}`}};kc.Position=Jp});var ni=m(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.LiteralToken=yn.Token=yn.BaseToken=yn.BaseTokenOptions=yn.TokenType=void 0;var pw=zo(),JO;(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"})(JO=yn.TokenType||(yn.TokenType={}));var Qp=class{};yn.BaseTokenOptions=Qp;var Ko=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.offset,r=e.range;this.start=new pw.Position(this.line,r[0]-n+1),this.end=new pw.Position(this.lastLine||this.line,r[1]-n+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}']`}};yn.BaseToken=Ko;var Zp=class extends Ko{};yn.Token=Zp;var eh=class extends Ko{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}]`}};yn.LiteralToken=eh});var Cc=m(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.CharacterCode=void 0;var QO;(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"})(QO=Xo.CharacterCode||(Xo.CharacterCode={}))});var js=m(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});Yo.Keyword=void 0;var ZO;(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"})(ZO=Yo.Keyword||(Yo.Keyword={}))});var rh=m(nh=>{"use strict";Object.defineProperty(nh,"__esModule",{value:!0});var Rn=Cc(),eR=js(),th=class{constructor(){this.isKeyword=Set.prototype.has.bind(new Set(Object.values(eR.Keyword)))}isWhitespace(e){return Rn.CharacterCode.WHITESPACE===e||Rn.CharacterCode.TAB===e}isEndOfLine(e){return Rn.CharacterCode.NEW_LINE===e||Rn.CharacterCode.RETURN_LINE===e}isComment(e,n){return Rn.CharacterCode.SLASH===e&&Rn.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>=Rn.CharacterCode.NUMBER_0&&e<=Rn.CharacterCode.NUMBER_9}isWinNewline(e,n){switch(e){case Rn.CharacterCode.RETURN_LINE:return Rn.CharacterCode.NEW_LINE===n;case Rn.CharacterCode.NEW_LINE:return Rn.CharacterCode.RETURN_LINE===n}return!1}};nh.default=th});var Oc=m(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.ParserException=Fs.LexerException=void 0;var ih=class extends Error{constructor(e,n){super(e),this.range=n}};Fs.LexerException=ih;var sh=class extends Error{constructor(e,n){super(e),this.range=n}};Fs.ParserException=sh});var oh=m(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.Literal=void 0;var tR;(function(t){t.True="true",t.False="false",t.Null="null"})(tR=Jo.Literal||(Jo.Literal={}))});var $s=m(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.Operator=void 0;var nR;(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"})(nR=Qo.Operator||(Qo.Operator={}))});var Zo=m(Rc=>{"use strict";Object.defineProperty(Rc,"__esModule",{value:!0});Rc.Range=void 0;var ah=class{constructor(e,n){this.start=e,this.end=n}toString(){return`${this.start} - ${this.end}`}};Rc.Range=ah});var lh=m(ch=>{"use strict";Object.defineProperty(ch,"__esModule",{value:!0});var uh=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}};ch.default=uh});var ph=m(ta=>{"use strict";var mw=ta&&ta.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ta,"__esModule",{value:!0});var Qe=ni(),rR=mw(rh()),me=Cc(),iR=Oc(),dh=js(),ea=oh(),Ze=$s(),Bs=zo(),fh=Zo(),hw=mw(lh());function ri(t){let e=this.content[this.index];return this.index+=e.length,this.createPunctuator(e,t)}var Dc=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 rR.default,r.unsafe=n.unsafe,r.errors=[],r.backlog=new hw.default,r.snapshot=new hw.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 Qe.Token({type:Qe.TokenType.EOL,value:Ze.Operator.EndOfLine,line:n.line,lineStart:n.lineStart,range:[n.tokenStart,n.index],offset:n.offset,afterSpace:e});return n.snapshot.enqueue(r),r}createIdentifier(e,n){let r=this,i=new Qe.Token({type:Qe.TokenType.Identifier,value:e,line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offset:r.offset,afterSpace:n});return r.snapshot.enqueue(i),i}createEOF(e){let n=this,r=new Qe.Token({type:Qe.TokenType.EOF,value:Ze.Operator.EndOfFile,line:n.line,lineStart:n.lineStart,range:[n.index,n.index],offset:n.offset,afterSpace:e});return n.snapshot.enqueue(r),r}createBoolean(e,n){let r=this,i=new Qe.LiteralToken({type:Qe.TokenType.BooleanLiteral,value:e===ea.Literal.True,raw:e,line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offset:r.offset,afterSpace:n});return r.snapshot.enqueue(i),i}createNull(e){let n=this,r=new Qe.LiteralToken({type:Qe.TokenType.NilLiteral,value:null,raw:ea.Literal.Null,line:n.line,lineStart:n.lineStart,range:[n.tokenStart,n.index],offset:n.offset,afterSpace:e});return n.snapshot.enqueue(r),r}createSlice(e){let n=new Qe.Token({type:Qe.TokenType.SliceOperator,value:Ze.Operator.SliceSeperator,line:this.line,lineStart:this.lineStart,range:[this.tokenStart,this.index],offset:this.offset,afterSpace:e});return this.snapshot.enqueue(n),n}createPunctuator(e,n){let r=new Qe.Token({type:Qe.TokenType.Punctuator,value:e,line:this.line,lineStart:this.lineStart,range:[this.tokenStart,this.index],offset:this.offset,afterSpace:n});return this.snapshot.enqueue(r),r}createNumericLiteral(e,n,r){let i=new Qe.LiteralToken({type:Qe.TokenType.NumericLiteral,value:e,raw:n,line:this.line,lineStart:this.lineStart,range:[this.tokenStart,this.index],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=0,a=n.offset,u=!1;for(;n.index<n.length;){n.index++;let p=n.codeAt();if(n.validator.isEndOfLine(p))r.isWinNewline(p,n.codeAt(1))&&n.index++,n.line++,o=n.index+1-n.offset,a=n.index+1;else if(me.CharacterCode.QUOTE===p){if(me.CharacterCode.QUOTE!==n.codeAt(1)){u=!0;break}n.index++}}if(!u)return n.raise("Unexpected string end of file.",new fh.Range(new Bs.Position(i,s-a+1),new Bs.Position(n.line,n.index-a+1)));n.index++;let c=n.content.slice(n.tokenStart,n.index),l=c.slice(1,-1).replace(/""/g,Ze.Operator.Escape),d=new Qe.LiteralToken({type:Qe.TokenType.StringLiteral,value:l,raw:c,line:i,lineStart:s,range:[n.tokenStart,n.index-o],offset:n.offset,afterSpace:e,lastLine:n.line,lastLineStart:n.lineStart});return n.offset=a,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++);let o=n.content.slice(n.tokenStart+2,n.index),a=new Qe.Token({type:Qe.TokenType.Comment,value:o,line:i,lineStart:s,range:[n.tokenStart,n.index],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)||me.CharacterCode.DOT===i||me.CharacterCode.LETTER_E===i||me.CharacterCode.LETTER_e===i||(me.CharacterCode.MINUS===i||me.CharacterCode.PLUS===i)&&(me.CharacterCode.LETTER_E===r||me.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 fh.Range(new Bs.Position(this.line,this.tokenStart-this.offset+1),new Bs.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 dh.Keyword.End:{for(r.index++;i.isIdentifierPart(r.codeAt());r.index++);s=r.content.slice(r.tokenStart,r.index);break}case dh.Keyword.Else:{let a=r.content.slice(r.tokenStart,r.index+3);a===dh.Keyword.ElseIf&&(r.index+=3,s=a);break}}let o=new Qe.Token({type:Qe.TokenType.Keyword,value:s,line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],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 ea.Literal.True:case ea.Literal.False:return n.createBoolean(i,e);case ea.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 fh.Range(new Bs.Position(s,e.tokenStart-e.offset+1),new Bs.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 iR.LexerException(e,n);if(r.errors.push(i),r.unsafe)return new Qe.Token({type:Qe.TokenType.Invalid,value:"",line:r.line,lineStart:r.lineStart,range:[r.tokenStart,r.index],offset:r.offset});throw i}};ta.default=Dc;Dc.scanHandlers={[me.CharacterCode.QUOTE]:function(e){return this.scanStringLiteral(e)},[me.CharacterCode.DOT]:function(e){return this.validator.isDecDigit(this.codeAt(1))?this.scanNumericLiteral(e):(this.index++,this.createPunctuator(Ze.Operator.Member,e))},[me.CharacterCode.EQUAL]:function(e){return me.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(Ze.Operator.Equal,e):this.scanPunctuator(Ze.Operator.Assign,e)},[me.CharacterCode.ARROW_LEFT]:function(e){return me.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(Ze.Operator.LessThanOrEqual,e):this.scanPunctuator(Ze.Operator.LessThan,e)},[me.CharacterCode.ARROW_RIGHT]:function(e){return me.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(Ze.Operator.GreaterThanOrEqual,e):this.scanPunctuator(Ze.Operator.GreaterThan,e)},[me.CharacterCode.EXCLAMATION_MARK]:function(e){return me.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(Ze.Operator.NotEqual,e):(this.index++,null)},[me.CharacterCode.MINUS]:function(e){return me.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(Ze.Operator.SubtractShorthand,e):this.scanPunctuator(Ze.Operator.Minus,e)},[me.CharacterCode.PLUS]:function(e){return me.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(Ze.Operator.AddShorthand,e):this.scanPunctuator(Ze.Operator.Plus,e)},[me.CharacterCode.ASTERISK]:function(e){return me.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(Ze.Operator.MultiplyShorthand,e):this.scanPunctuator(Ze.Operator.Asterik,e)},[me.CharacterCode.SLASH]:function(e){return me.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(Ze.Operator.DivideShorthand,e):this.scanPunctuator(Ze.Operator.Slash,e)},[me.CharacterCode.COLON]:function(e){return this.index++,this.createSlice(e)},[me.CharacterCode.CARET]:function(e){return me.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(Ze.Operator.PowerShorthand,e):this.scanPunctuator(Ze.Operator.Power,e)},[me.CharacterCode.PERCENT]:function(e){return me.CharacterCode.EQUAL===this.codeAt(1)?this.scanPunctuator(Ze.Operator.ModuloShorthand,e):this.scanPunctuator(Ze.Operator.Modulo,e)},[me.CharacterCode.SEMICOLON]:function(e){return this.index++,this.createEOL(e)},[me.CharacterCode.COMMA]:ri,[me.CharacterCode.CURLY_BRACKET_LEFT]:ri,[me.CharacterCode.CURLY_BRACKET_RIGHT]:ri,[me.CharacterCode.SQUARE_BRACKETS_LEFT]:ri,[me.CharacterCode.SQUARE_BRACKETS_RIGHT]:ri,[me.CharacterCode.PARENTHESIS_LEFT]:ri,[me.CharacterCode.PARENTHESIS_RIGHT]:ri,[me.CharacterCode.AT_SIGN]:ri}});var ot=m(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.ASTComment=bn.ASTBaseBlockWithScope=bn.ASTBaseBlock=bn.ASTBase=bn.ASTType=void 0;var gw;(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"})(gw=bn.ASTType||(bn.ASTType={}));var na=class t{constructor(e,n){this.type=e,this.start=n.start,this.end=n.end,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,scope:this.scope})}};bn.ASTBase=na;var Ic=class t extends na{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,scope:this.scope})}};bn.ASTBaseBlock=Ic;var mh=class t extends Ic{constructor(e,n){super(e,n),this.namespaces=n.namespaces||new Set,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,scope:this.scope})}};bn.ASTBaseBlockWithScope=mh;var gh=class t extends na{constructor(e){super(gw.Comment,e),this.value=e.value,this.isMultiline=e.isMultiline||!1}toString(){return`Comment[${this.start}-${this.end}][${this.value}]`}clone(){return new t({value:this.value,isMultiline:this.isMultiline,start:this.start,end:this.end,scope:this.scope})}};bn.ASTComment=gh});var bh=m(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});Pc.ASTAssignmentStatement=void 0;var yw=ot(),yh=class t extends yw.ASTBase{constructor(e){super(yw.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,scope:this.scope})}};Pc.ASTAssignmentStatement=yh});var vh=m(Mc=>{"use strict";Object.defineProperty(Mc,"__esModule",{value:!0});Mc.ASTBinaryExpression=void 0;var bw=ot(),_h=class t extends bw.ASTBase{constructor(e){super(bw.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,scope:this.scope})}};Mc.ASTBinaryExpression=_h});var wh=m(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.ASTCallExpression=Us.ASTCallStatement=void 0;var Lc=ot(),Sh=class t extends Lc.ASTBase{constructor(e){super(Lc.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,scope:this.scope})}};Us.ASTCallStatement=Sh;var Th=class t extends Lc.ASTBase{constructor(e){super(Lc.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,scope:this.scope})}};Us.ASTCallExpression=Th});var Ah=m(Nc=>{"use strict";Object.defineProperty(Nc,"__esModule",{value:!0});Nc.ASTChunk=void 0;var _w=ot(),Eh=class t extends _w.ASTBaseBlockWithScope{constructor(e){super(_w.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,scope:this.scope})}};bn.ASTBaseBlock=Ic;var hh=class t extends Ic{constructor(e,n){super(e,n),this.namespaces=n.namespaces||new Set,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,scope:this.scope})}};bn.ASTBaseBlockWithScope=hh;var mh=class t extends na{constructor(e){super(gw.Comment,e),this.value=e.value,this.isMultiline=e.isMultiline||!1}toString(){return`Comment[${this.start}-${this.end}][${this.value}]`}clone(){return new t({value:this.value,isMultiline:this.isMultiline,start:this.start,end:this.end,scope:this.scope})}};bn.ASTComment=mh});var yh=m(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});Pc.ASTAssignmentStatement=void 0;var yw=ot(),gh=class t extends yw.ASTBase{constructor(e){super(yw.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,scope:this.scope})}};Pc.ASTAssignmentStatement=gh});var _h=m(Mc=>{"use strict";Object.defineProperty(Mc,"__esModule",{value:!0});Mc.ASTBinaryExpression=void 0;var bw=ot(),bh=class t extends bw.ASTBase{constructor(e){super(bw.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,scope:this.scope})}};Mc.ASTBinaryExpression=bh});var Th=m(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.ASTCallExpression=Us.ASTCallStatement=void 0;var Lc=ot(),vh=class t extends Lc.ASTBase{constructor(e){super(Lc.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,scope:this.scope})}};Us.ASTCallStatement=vh;var Sh=class t extends Lc.ASTBase{constructor(e){super(Lc.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,scope:this.scope})}};Us.ASTCallExpression=Sh});var Eh=m(Nc=>{"use strict";Object.defineProperty(Nc,"__esModule",{value:!0});Nc.ASTChunk=void 0;var _w=ot(),wh=class t extends _w.ASTBaseBlockWithScope{constructor(e){super(_w.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,scope:this.scope})}};Nc.ASTChunk=Eh});var kh=m(qc=>{"use strict";Object.defineProperty(qc,"__esModule",{value:!0});qc.ASTComparisonGroupExpression=void 0;var vw=ot(),xh=class t extends vw.ASTBase{constructor(e){super(vw.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,scope:this.scope})}};qc.ASTComparisonGroupExpression=xh});var Oh=m(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc.ASTForGenericStatement=void 0;var Sw=ot(),Ch=class t extends Sw.ASTBaseBlock{constructor(e){super(Sw.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,scope:this.scope})}};Nc.ASTChunk=wh});var xh=m(qc=>{"use strict";Object.defineProperty(qc,"__esModule",{value:!0});qc.ASTComparisonGroupExpression=void 0;var vw=ot(),Ah=class t extends vw.ASTBase{constructor(e){super(vw.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,scope:this.scope})}};qc.ASTComparisonGroupExpression=Ah});var Ch=m(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc.ASTForGenericStatement=void 0;var Sw=ot(),kh=class t extends Sw.ASTBaseBlock{constructor(e){super(Sw.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,scope:this.scope})}};jc.ASTForGenericStatement=Ch});var Dh=m(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.ASTFunctionStatement=void 0;var Tw=ot(),Rh=class t extends Tw.ASTBaseBlockWithScope{constructor(e){super(Tw.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,scope:this.scope})}};jc.ASTForGenericStatement=kh});var Rh=m(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.ASTFunctionStatement=void 0;var Tw=ot(),Oh=class t extends Tw.ASTBaseBlockWithScope{constructor(e){super(Tw.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,scope:this.scope})}};Fc.ASTFunctionStatement=Rh});var Lh=m(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.ASTIndexExpression=ii.ASTMemberExpression=ii.ASTIdentifier=void 0;var Hs=ot(),Ih=class t extends Hs.ASTBase{constructor(e){super(Hs.ASTType.Identifier,e),this.name=e.name}toString(){return`Identifier[${this.start}-${this.end}][${this.name}]`}clone(){return new t({name:this.name,start:this.start,end:this.end,scope:this.scope})}};ii.ASTIdentifier=Ih;var Ph=class t extends Hs.ASTBase{constructor(e){super(Hs.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,scope:this.scope})}};ii.ASTMemberExpression=Ph;var Mh=class t extends Hs.ASTBase{constructor(e){super(Hs.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,scope:this.scope})}};ii.ASTIndexExpression=Mh});var Fh=m(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.ASTElseClause=ar.ASTIfClause=ar.ASTIfStatement=ar.ASTClause=void 0;var ww=ot(),ra=class extends ww.ASTBaseBlock{};ar.ASTClause=ra;var Nh=class t extends ww.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,scope:this.scope})}};Fc.ASTFunctionStatement=Oh});var Mh=m(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.ASTIndexExpression=ii.ASTMemberExpression=ii.ASTIdentifier=void 0;var Hs=ot(),Dh=class t extends Hs.ASTBase{constructor(e){super(Hs.ASTType.Identifier,e),this.name=e.name}toString(){return`Identifier[${this.start}-${this.end}][${this.name}]`}clone(){return new t({name:this.name,start:this.start,end:this.end,scope:this.scope})}};ii.ASTIdentifier=Dh;var Ih=class t extends Hs.ASTBase{constructor(e){super(Hs.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,scope:this.scope})}};ii.ASTMemberExpression=Ih;var Ph=class t extends Hs.ASTBase{constructor(e){super(Hs.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,scope:this.scope})}};ii.ASTIndexExpression=Ph});var jh=m(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.ASTElseClause=ar.ASTIfClause=ar.ASTIfStatement=ar.ASTClause=void 0;var ww=ot(),ra=class extends ww.ASTBaseBlock{};ar.ASTClause=ra;var Lh=class t extends ww.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,scope:this.scope})}};ar.ASTIfStatement=Nh;var qh=class t extends ra{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,scope:this.scope})}};ar.ASTIfStatement=Lh;var Nh=class t extends ra{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,scope:this.scope})}};ar.ASTIfClause=qh;var jh=class t extends ra{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,scope:this.scope})}};ar.ASTIfClause=Nh;var qh=class t extends ra{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,scope:this.scope})}};ar.ASTElseClause=jh});var Bh=m($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0});$c.ASTIsaExpression=void 0;var Ew=ot(),$h=class t extends Ew.ASTBase{constructor(e){super(Ew.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,scope:this.scope})}};$c.ASTIsaExpression=$h});var Wh=m(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.ASTListConstructorExpression=Ws.ASTListValue=void 0;var Bc=ot(),Uh=class t extends Bc.ASTBase{constructor(e){super(Bc.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,scope:this.scope})}};Ws.ASTListValue=Uh;var Hh=class t extends Bc.ASTBase{constructor(e){super(Bc.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,scope:this.scope})}};ar.ASTElseClause=qh});var $h=m($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0});$c.ASTIsaExpression=void 0;var Ew=ot(),Fh=class t extends Ew.ASTBase{constructor(e){super(Ew.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,scope:this.scope})}};$c.ASTIsaExpression=Fh});var Hh=m(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.ASTListConstructorExpression=Ws.ASTListValue=void 0;var Bc=ot(),Bh=class t extends Bc.ASTBase{constructor(e){super(Bc.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,scope:this.scope})}};Ws.ASTListValue=Bh;var Uh=class t extends Bc.ASTBase{constructor(e){super(Bc.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,scope:this.scope})}};Ws.ASTListConstructorExpression=Hh});var Yh=m(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.ASTNilLiteral=Dn.ASTStringLiteral=Dn.ASTBooleanLiteral=Dn.ASTNumericLiteral=Dn.ASTLiteral=void 0;var Aw=ni(),Xh=ot(),qi=class extends Xh.ASTBase{};Dn.ASTLiteral=qi;var Gh=class t extends qi{constructor(e){super(Aw.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,scope:this.scope});return e.negated=this.negated,e}};Dn.ASTNumericLiteral=Gh;var Vh=class t extends qi{constructor(e){super(Aw.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,scope:this.scope});return e.negated=this.negated,e}};Dn.ASTBooleanLiteral=Vh;var zh=class t extends qi{constructor(e){super(Xh.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,scope:this.scope})}};Dn.ASTStringLiteral=zh;var Kh=class t extends qi{constructor(e){super(Xh.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,scope:this.scope})}};Dn.ASTNilLiteral=Kh});var Qh=m(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});Uc.ASTLogicalExpression=void 0;var xw=ot(),Jh=class t extends xw.ASTBase{constructor(e){super(xw.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,scope:this.scope})}};Uc.ASTLogicalExpression=Jh});var tm=m(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});Gs.ASTMapConstructorExpression=Gs.ASTMapKeyString=void 0;var Hc=ot(),Zh=class t extends Hc.ASTBase{constructor(e){super(Hc.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,scope:this.scope})}};Gs.ASTMapKeyString=Zh;var em=class t extends Hc.ASTBase{constructor(e){super(Hc.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,scope:this.scope})}};Ws.ASTListConstructorExpression=Uh});var Xh=m(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.ASTNilLiteral=Dn.ASTStringLiteral=Dn.ASTBooleanLiteral=Dn.ASTNumericLiteral=Dn.ASTLiteral=void 0;var Aw=ni(),Kh=ot(),qi=class extends Kh.ASTBase{};Dn.ASTLiteral=qi;var Wh=class t extends qi{constructor(e){super(Aw.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,scope:this.scope});return e.negated=this.negated,e}};Dn.ASTNumericLiteral=Wh;var Gh=class t extends qi{constructor(e){super(Aw.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,scope:this.scope});return e.negated=this.negated,e}};Dn.ASTBooleanLiteral=Gh;var Vh=class t extends qi{constructor(e){super(Kh.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,scope:this.scope})}};Dn.ASTStringLiteral=Vh;var zh=class t extends qi{constructor(e){super(Kh.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,scope:this.scope})}};Dn.ASTNilLiteral=zh});var Jh=m(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});Uc.ASTLogicalExpression=void 0;var xw=ot(),Yh=class t extends xw.ASTBase{constructor(e){super(xw.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,scope:this.scope})}};Uc.ASTLogicalExpression=Yh});var em=m(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});Gs.ASTMapConstructorExpression=Gs.ASTMapKeyString=void 0;var Hc=ot(),Qh=class t extends Hc.ASTBase{constructor(e){super(Hc.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,scope:this.scope})}};Gs.ASTMapKeyString=Qh;var Zh=class t extends Hc.ASTBase{constructor(e){super(Hc.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,scope:this.scope})}};Gs.ASTMapConstructorExpression=em});var rm=m(Wc=>{"use strict";Object.defineProperty(Wc,"__esModule",{value:!0});Wc.ASTParenthesisExpression=void 0;var kw=ot(),nm=class t extends kw.ASTBase{constructor(e){super(kw.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,scope:this.scope})}};Wc.ASTParenthesisExpression=nm});var sm=m(Gc=>{"use strict";Object.defineProperty(Gc,"__esModule",{value:!0});Gc.ASTReturnStatement=void 0;var Cw=ot(),im=class t extends Cw.ASTBase{constructor(e){super(Cw.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,scope:this.scope})}};Gc.ASTReturnStatement=im});var am=m(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});Vc.ASTSliceExpression=void 0;var Ow=ot(),om=class t extends Ow.ASTBase{constructor(e){super(Ow.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,scope:this.scope})}};Vc.ASTSliceExpression=om});var lm=m(Kc=>{"use strict";Object.defineProperty(Kc,"__esModule",{value:!0});Kc.ASTUnaryExpression=void 0;var um=$s(),zc=ot(),cm=class t extends zc.ASTBase{constructor(e){super(t.getUnaryType(e.operator),e),this.argument=e.argument,this.operator=e.operator}static getUnaryType(e){switch(e){case um.Operator.Not:return zc.ASTType.NegationExpression;case um.Operator.Plus:case um.Operator.Minus:return zc.ASTType.BinaryNegatedExpression;default:return zc.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,scope:this.scope})}};Kc.ASTUnaryExpression=cm});var fm=m(Xc=>{"use strict";Object.defineProperty(Xc,"__esModule",{value:!0});Xc.ASTWhileStatement=void 0;var Rw=ot(),dm=class t extends Rw.ASTBaseBlock{constructor(e){super(Rw.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,scope:this.scope})}};Gs.ASTMapConstructorExpression=Zh});var nm=m(Wc=>{"use strict";Object.defineProperty(Wc,"__esModule",{value:!0});Wc.ASTParenthesisExpression=void 0;var kw=ot(),tm=class t extends kw.ASTBase{constructor(e){super(kw.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,scope:this.scope})}};Wc.ASTParenthesisExpression=tm});var im=m(Gc=>{"use strict";Object.defineProperty(Gc,"__esModule",{value:!0});Gc.ASTReturnStatement=void 0;var Cw=ot(),rm=class t extends Cw.ASTBase{constructor(e){super(Cw.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,scope:this.scope})}};Gc.ASTReturnStatement=rm});var om=m(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});Vc.ASTSliceExpression=void 0;var Ow=ot(),sm=class t extends Ow.ASTBase{constructor(e){super(Ow.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,scope:this.scope})}};Vc.ASTSliceExpression=sm});var cm=m(Kc=>{"use strict";Object.defineProperty(Kc,"__esModule",{value:!0});Kc.ASTUnaryExpression=void 0;var am=$s(),zc=ot(),um=class t extends zc.ASTBase{constructor(e){super(t.getUnaryType(e.operator),e),this.argument=e.argument,this.operator=e.operator}static getUnaryType(e){switch(e){case am.Operator.Not:return zc.ASTType.NegationExpression;case am.Operator.Plus:case am.Operator.Minus:return zc.ASTType.BinaryNegatedExpression;default:return zc.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,scope:this.scope})}};Kc.ASTUnaryExpression=um});var dm=m(Xc=>{"use strict";Object.defineProperty(Xc,"__esModule",{value:!0});Xc.ASTWhileStatement=void 0;var Rw=ot(),lm=class t extends Rw.ASTBaseBlock{constructor(e){super(Rw.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,scope:this.scope})}};Xc.ASTWhileStatement=dm});var gm=m(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.ASTWhileStatement=V.ASTUnaryExpression=V.ASTSliceExpression=V.ASTReturnStatement=V.ASTParenthesisExpression=V.ASTMapKeyString=V.ASTMapConstructorExpression=V.ASTLogicalExpression=V.ASTStringLiteral=V.ASTNumericLiteral=V.ASTNilLiteral=V.ASTLiteral=V.ASTBooleanLiteral=V.ASTListValue=V.ASTListConstructorExpression=V.ASTIsaExpression=V.ASTIfStatement=V.ASTIfClause=V.ASTElseClause=V.ASTClause=V.ASTMemberExpression=V.ASTIndexExpression=V.ASTIdentifier=V.ASTFunctionStatement=V.ASTForGenericStatement=V.ASTComparisonGroupExpression=V.ASTChunk=V.ASTCallStatement=V.ASTCallExpression=V.ASTBinaryExpression=V.ASTType=V.ASTComment=V.ASTBaseBlockWithScope=V.ASTBaseBlock=V.ASTBase=V.ASTAssignmentStatement=V.ASTProvider=void 0;var Yc=ni(),sR=bh(),St=ot(),oR=vh(),Dw=wh(),aR=Ah(),uR=kh(),cR=Oh(),lR=Dh(),pm=Lh(),si=Fh(),dR=Bh(),Iw=Wh(),Jc=Yh(),fR=Qh(),Pw=tm(),pR=rm(),hR=sm(),mR=am(),gR=lm(),yR=fm(),hm=class{breakStatement(e){return new St.ASTBase(St.ASTType.BreakStatement,e)}continueStatement(e){return new St.ASTBase(St.ASTType.ContinueStatement,e)}returnStatement(e){return new hR.ASTReturnStatement(e)}ifShortcutStatement(e){return new si.ASTIfStatement(St.ASTType.IfShortcutStatement,e)}ifShortcutClause(e){return new si.ASTIfClause(St.ASTType.IfShortcutClause,e)}elseifShortcutClause(e){return new si.ASTIfClause(St.ASTType.ElseifShortcutClause,e)}elseShortcutClause(e){return new si.ASTElseClause(St.ASTType.ElseShortcutClause,e)}ifStatement(e){return new si.ASTIfStatement(St.ASTType.IfStatement,e)}ifClause(e){return new si.ASTIfClause(St.ASTType.IfClause,e)}elseifClause(e){return new si.ASTIfClause(St.ASTType.ElseifClause,e)}elseClause(e){return new si.ASTElseClause(St.ASTType.ElseClause,e)}whileStatement(e){return new yR.ASTWhileStatement(e)}assignmentStatement(e){return new sR.ASTAssignmentStatement(e)}callStatement(e){return new Dw.ASTCallStatement(e)}functionStatement(e){return new lR.ASTFunctionStatement(e)}forGenericStatement(e){return new cR.ASTForGenericStatement(e)}chunk(e){return new aR.ASTChunk(e)}identifier(e){return new pm.ASTIdentifier(e)}literal(e,n){switch(e){case Yc.TokenType.StringLiteral:return new Jc.ASTStringLiteral(n);case Yc.TokenType.NumericLiteral:return new Jc.ASTNumericLiteral(n);case Yc.TokenType.BooleanLiteral:return new Jc.ASTBooleanLiteral(n);case Yc.TokenType.NilLiteral:return new Jc.ASTNilLiteral(n)}}memberExpression(e){return new pm.ASTMemberExpression(e)}callExpression(e){return new Dw.ASTCallExpression(e)}comment(e){return new St.ASTComment(e)}unaryExpression(e){return new gR.ASTUnaryExpression(e)}mapKeyString(e){return new Pw.ASTMapKeyString(e)}mapConstructorExpression(e){return new Pw.ASTMapConstructorExpression(e)}listValue(e){return new Iw.ASTListValue(e)}listConstructorExpression(e){return new Iw.ASTListConstructorExpression(e)}unknown(e){return new St.ASTBase(St.ASTType.Unknown,e)}emptyExpression(e){return new St.ASTBase(St.ASTType.EmptyExpression,e)}invalidCodeExpression(e){return new St.ASTBase(St.ASTType.InvalidCodeExpression,e)}indexExpression(e){return new pm.ASTIndexExpression(e)}logicalExpression(e){return new fR.ASTLogicalExpression(e)}isaExpression(e){return new dR.ASTIsaExpression(e)}binaryExpression(e){return new oR.ASTBinaryExpression(e)}sliceExpression(e){return new mR.ASTSliceExpression(e)}parenthesisExpression(e){return new pR.ASTParenthesisExpression(e)}comparisonGroupExpression(e){return new uR.ASTComparisonGroupExpression(e)}};V.ASTProvider=hm;var bR=bh();Object.defineProperty(V,"ASTAssignmentStatement",{enumerable:!0,get:function(){return bR.ASTAssignmentStatement}});var ia=ot();Object.defineProperty(V,"ASTBase",{enumerable:!0,get:function(){return ia.ASTBase}});Object.defineProperty(V,"ASTBaseBlock",{enumerable:!0,get:function(){return ia.ASTBaseBlock}});Object.defineProperty(V,"ASTBaseBlockWithScope",{enumerable:!0,get:function(){return ia.ASTBaseBlockWithScope}});Object.defineProperty(V,"ASTComment",{enumerable:!0,get:function(){return ia.ASTComment}});Object.defineProperty(V,"ASTType",{enumerable:!0,get:function(){return ia.ASTType}});var _R=vh();Object.defineProperty(V,"ASTBinaryExpression",{enumerable:!0,get:function(){return _R.ASTBinaryExpression}});var Mw=wh();Object.defineProperty(V,"ASTCallExpression",{enumerable:!0,get:function(){return Mw.ASTCallExpression}});Object.defineProperty(V,"ASTCallStatement",{enumerable:!0,get:function(){return Mw.ASTCallStatement}});var vR=Ah();Object.defineProperty(V,"ASTChunk",{enumerable:!0,get:function(){return vR.ASTChunk}});var SR=kh();Object.defineProperty(V,"ASTComparisonGroupExpression",{enumerable:!0,get:function(){return SR.ASTComparisonGroupExpression}});var TR=Oh();Object.defineProperty(V,"ASTForGenericStatement",{enumerable:!0,get:function(){return TR.ASTForGenericStatement}});var wR=Dh();Object.defineProperty(V,"ASTFunctionStatement",{enumerable:!0,get:function(){return wR.ASTFunctionStatement}});var mm=Lh();Object.defineProperty(V,"ASTIdentifier",{enumerable:!0,get:function(){return mm.ASTIdentifier}});Object.defineProperty(V,"ASTIndexExpression",{enumerable:!0,get:function(){return mm.ASTIndexExpression}});Object.defineProperty(V,"ASTMemberExpression",{enumerable:!0,get:function(){return mm.ASTMemberExpression}});var Qc=Fh();Object.defineProperty(V,"ASTClause",{enumerable:!0,get:function(){return Qc.ASTClause}});Object.defineProperty(V,"ASTElseClause",{enumerable:!0,get:function(){return Qc.ASTElseClause}});Object.defineProperty(V,"ASTIfClause",{enumerable:!0,get:function(){return Qc.ASTIfClause}});Object.defineProperty(V,"ASTIfStatement",{enumerable:!0,get:function(){return Qc.ASTIfStatement}});var ER=Bh();Object.defineProperty(V,"ASTIsaExpression",{enumerable:!0,get:function(){return ER.ASTIsaExpression}});var Lw=Wh();Object.defineProperty(V,"ASTListConstructorExpression",{enumerable:!0,get:function(){return Lw.ASTListConstructorExpression}});Object.defineProperty(V,"ASTListValue",{enumerable:!0,get:function(){return Lw.ASTListValue}});var sa=Yh();Object.defineProperty(V,"ASTBooleanLiteral",{enumerable:!0,get:function(){return sa.ASTBooleanLiteral}});Object.defineProperty(V,"ASTLiteral",{enumerable:!0,get:function(){return sa.ASTLiteral}});Object.defineProperty(V,"ASTNilLiteral",{enumerable:!0,get:function(){return sa.ASTNilLiteral}});Object.defineProperty(V,"ASTNumericLiteral",{enumerable:!0,get:function(){return sa.ASTNumericLiteral}});Object.defineProperty(V,"ASTStringLiteral",{enumerable:!0,get:function(){return sa.ASTStringLiteral}});var AR=Qh();Object.defineProperty(V,"ASTLogicalExpression",{enumerable:!0,get:function(){return AR.ASTLogicalExpression}});var Nw=tm();Object.defineProperty(V,"ASTMapConstructorExpression",{enumerable:!0,get:function(){return Nw.ASTMapConstructorExpression}});Object.defineProperty(V,"ASTMapKeyString",{enumerable:!0,get:function(){return Nw.ASTMapKeyString}});var xR=rm();Object.defineProperty(V,"ASTParenthesisExpression",{enumerable:!0,get:function(){return xR.ASTParenthesisExpression}});var kR=sm();Object.defineProperty(V,"ASTReturnStatement",{enumerable:!0,get:function(){return kR.ASTReturnStatement}});var CR=am();Object.defineProperty(V,"ASTSliceExpression",{enumerable:!0,get:function(){return CR.ASTSliceExpression}});var OR=lm();Object.defineProperty(V,"ASTUnaryExpression",{enumerable:!0,get:function(){return OR.ASTUnaryExpression}});var RR=fm();Object.defineProperty(V,"ASTWhileStatement",{enumerable:!0,get:function(){return RR.ASTWhileStatement}})});var _m=m(bm=>{"use strict";Object.defineProperty(bm,"__esModule",{value:!0});var oi=ni(),ym=class{constructor(){this.isNonNilLiteral=Set.prototype.has.bind(new Set([oi.TokenType.StringLiteral,oi.TokenType.NumericLiteral,oi.TokenType.BooleanLiteral])),this.isLiteral=Set.prototype.has.bind(new Set([oi.TokenType.StringLiteral,oi.TokenType.NumericLiteral,oi.TokenType.BooleanLiteral,oi.TokenType.NilLiteral]))}isComment(e){return e===oi.TokenType.Comment}};bm.default=ym});var Sm=m(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.SelectorGroups=se.SelectorGroupType=se.getSelectorsFromGroup=se.createSelectorGroup=se.Selectors=se.getSelectorValue=se.createSelector=se.createSelectorOptions=se.SelectorType=void 0;var ie=ni(),Xn=js(),ge=$s(),DR;(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"})(DR=se.SelectorType||(se.SelectorType={}));var vm=class{};se.createSelectorOptions=vm;function te(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}se.createSelector=te;function IR(t){return t.data.value}se.getSelectorValue=IR;se.Selectors={EndOfLine:te({type:ie.TokenType.EOL,value:ge.Operator.EndOfLine}),EndOfFile:te({type:ie.TokenType.EOF,value:ge.Operator.EndOfFile}),LParenthesis:te({type:ie.TokenType.Punctuator,value:ge.Operator.LParenthesis}),RParenthesis:te({type:ie.TokenType.Punctuator,value:ge.Operator.RParenthesis}),CLBracket:te({type:ie.TokenType.Punctuator,value:ge.Operator.CLBracket}),CRBracket:te({type:ie.TokenType.Punctuator,value:ge.Operator.CRBracket}),SLBracket:te({type:ie.TokenType.Punctuator,value:ge.Operator.SLBracket}),SRBracket:te({type:ie.TokenType.Punctuator,value:ge.Operator.SRBracket}),Assign:te({type:ie.TokenType.Punctuator,value:ge.Operator.Assign}),AddShorthand:te({type:ie.TokenType.Punctuator,value:ge.Operator.AddShorthand}),SubtractShorthand:te({type:ie.TokenType.Punctuator,value:ge.Operator.SubtractShorthand}),MultiplyShorthand:te({type:ie.TokenType.Punctuator,value:ge.Operator.MultiplyShorthand}),DivideShorthand:te({type:ie.TokenType.Punctuator,value:ge.Operator.DivideShorthand}),PowerShorthand:te({type:ie.TokenType.Punctuator,value:ge.Operator.PowerShorthand}),ModuloShorthand:te({type:ie.TokenType.Punctuator,value:ge.Operator.ModuloShorthand}),Seperator:te({type:ie.TokenType.Punctuator,value:ge.Operator.Comma}),Function:te({type:ie.TokenType.Keyword,value:Xn.Keyword.Function}),EndFunction:te({type:ie.TokenType.Keyword,value:Xn.Keyword.EndFunction}),EndWhile:te({type:ie.TokenType.Keyword,value:Xn.Keyword.EndWhile}),EndFor:te({type:ie.TokenType.Keyword,value:Xn.Keyword.EndFor}),EndIf:te({type:ie.TokenType.Keyword,value:Xn.Keyword.EndIf}),SliceSeperator:te({type:ie.TokenType.SliceOperator,value:ge.Operator.SliceSeperator}),MapKeyValueSeperator:te({type:ie.TokenType.SliceOperator,value:ge.Operator.SliceSeperator}),MapSeperator:te({type:ie.TokenType.Punctuator,value:ge.Operator.Comma}),ListSeperator:te({type:ie.TokenType.Punctuator,value:ge.Operator.Comma}),CallSeperator:te({type:ie.TokenType.Punctuator,value:ge.Operator.Comma}),ArgumentSeperator:te({type:ie.TokenType.Punctuator,value:ge.Operator.Comma}),ImportCodeSeperator:te({type:ie.TokenType.SliceOperator,value:ge.Operator.SliceSeperator}),ElseIf:te({type:ie.TokenType.Keyword,value:Xn.Keyword.ElseIf}),Then:te({type:ie.TokenType.Keyword,value:Xn.Keyword.Then}),Else:te({type:ie.TokenType.Keyword,value:Xn.Keyword.Else}),In:te({type:ie.TokenType.Keyword,value:Xn.Keyword.In}),MemberSeperator:te({type:ie.TokenType.Punctuator,value:ge.Operator.Member}),NumberSeperator:te({type:ie.TokenType.Punctuator,value:ge.Operator.Member}),Reference:te({type:ie.TokenType.Punctuator,value:ge.Operator.Reference}),Isa:te({type:ie.TokenType.Keyword,value:ge.Operator.Isa}),Or:te({type:ie.TokenType.Keyword,value:ge.Operator.Or}),And:te({type:ie.TokenType.Keyword,value:ge.Operator.And}),Minus:te({type:ie.TokenType.Punctuator,value:ge.Operator.Minus}),Plus:te({type:ie.TokenType.Punctuator,value:ge.Operator.Plus}),Times:te({type:ie.TokenType.Punctuator,value:ge.Operator.Asterik}),Power:te({type:ie.TokenType.Punctuator,value:ge.Operator.Power}),Divide:te({type:ie.TokenType.Punctuator,value:ge.Operator.Slash}),Mod:te({type:ie.TokenType.Punctuator,value:ge.Operator.Modulo}),Equal:te({type:ie.TokenType.Punctuator,value:ge.Operator.Equal}),NotEqual:te({type:ie.TokenType.Punctuator,value:ge.Operator.NotEqual}),Greater:te({type:ie.TokenType.Punctuator,value:ge.Operator.GreaterThan}),GreaterEqual:te({type:ie.TokenType.Punctuator,value:ge.Operator.GreaterThanOrEqual}),Lesser:te({type:ie.TokenType.Punctuator,value:ge.Operator.LessThan}),LessEqual:te({type:ie.TokenType.Punctuator,value:ge.Operator.LessThanOrEqual}),New:te({type:ie.TokenType.Keyword,value:Xn.Keyword.New}),Not:te({type:ie.TokenType.Keyword,value:Xn.Keyword.Not}),Comment:te({type:ie.TokenType.Comment})};function ur(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,scope:this.scope})}};Xc.ASTWhileStatement=lm});var mm=m(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.ASTWhileStatement=V.ASTUnaryExpression=V.ASTSliceExpression=V.ASTReturnStatement=V.ASTParenthesisExpression=V.ASTMapKeyString=V.ASTMapConstructorExpression=V.ASTLogicalExpression=V.ASTStringLiteral=V.ASTNumericLiteral=V.ASTNilLiteral=V.ASTLiteral=V.ASTBooleanLiteral=V.ASTListValue=V.ASTListConstructorExpression=V.ASTIsaExpression=V.ASTIfStatement=V.ASTIfClause=V.ASTElseClause=V.ASTClause=V.ASTMemberExpression=V.ASTIndexExpression=V.ASTIdentifier=V.ASTFunctionStatement=V.ASTForGenericStatement=V.ASTComparisonGroupExpression=V.ASTChunk=V.ASTCallStatement=V.ASTCallExpression=V.ASTBinaryExpression=V.ASTType=V.ASTComment=V.ASTBaseBlockWithScope=V.ASTBaseBlock=V.ASTBase=V.ASTAssignmentStatement=V.ASTProvider=void 0;var Yc=ni(),sR=yh(),St=ot(),oR=_h(),Dw=Th(),aR=Eh(),uR=xh(),cR=Ch(),lR=Rh(),fm=Mh(),si=jh(),dR=$h(),Iw=Hh(),Jc=Xh(),fR=Jh(),Pw=em(),pR=nm(),hR=im(),mR=om(),gR=cm(),yR=dm(),pm=class{breakStatement(e){return new St.ASTBase(St.ASTType.BreakStatement,e)}continueStatement(e){return new St.ASTBase(St.ASTType.ContinueStatement,e)}returnStatement(e){return new hR.ASTReturnStatement(e)}ifShortcutStatement(e){return new si.ASTIfStatement(St.ASTType.IfShortcutStatement,e)}ifShortcutClause(e){return new si.ASTIfClause(St.ASTType.IfShortcutClause,e)}elseifShortcutClause(e){return new si.ASTIfClause(St.ASTType.ElseifShortcutClause,e)}elseShortcutClause(e){return new si.ASTElseClause(St.ASTType.ElseShortcutClause,e)}ifStatement(e){return new si.ASTIfStatement(St.ASTType.IfStatement,e)}ifClause(e){return new si.ASTIfClause(St.ASTType.IfClause,e)}elseifClause(e){return new si.ASTIfClause(St.ASTType.ElseifClause,e)}elseClause(e){return new si.ASTElseClause(St.ASTType.ElseClause,e)}whileStatement(e){return new yR.ASTWhileStatement(e)}assignmentStatement(e){return new sR.ASTAssignmentStatement(e)}callStatement(e){return new Dw.ASTCallStatement(e)}functionStatement(e){return new lR.ASTFunctionStatement(e)}forGenericStatement(e){return new cR.ASTForGenericStatement(e)}chunk(e){return new aR.ASTChunk(e)}identifier(e){return new fm.ASTIdentifier(e)}literal(e,n){switch(e){case Yc.TokenType.StringLiteral:return new Jc.ASTStringLiteral(n);case Yc.TokenType.NumericLiteral:return new Jc.ASTNumericLiteral(n);case Yc.TokenType.BooleanLiteral:return new Jc.ASTBooleanLiteral(n);case Yc.TokenType.NilLiteral:return new Jc.ASTNilLiteral(n)}}memberExpression(e){return new fm.ASTMemberExpression(e)}callExpression(e){return new Dw.ASTCallExpression(e)}comment(e){return new St.ASTComment(e)}unaryExpression(e){return new gR.ASTUnaryExpression(e)}mapKeyString(e){return new Pw.ASTMapKeyString(e)}mapConstructorExpression(e){return new Pw.ASTMapConstructorExpression(e)}listValue(e){return new Iw.ASTListValue(e)}listConstructorExpression(e){return new Iw.ASTListConstructorExpression(e)}unknown(e){return new St.ASTBase(St.ASTType.Unknown,e)}emptyExpression(e){return new St.ASTBase(St.ASTType.EmptyExpression,e)}invalidCodeExpression(e){return new St.ASTBase(St.ASTType.InvalidCodeExpression,e)}indexExpression(e){return new fm.ASTIndexExpression(e)}logicalExpression(e){return new fR.ASTLogicalExpression(e)}isaExpression(e){return new dR.ASTIsaExpression(e)}binaryExpression(e){return new oR.ASTBinaryExpression(e)}sliceExpression(e){return new mR.ASTSliceExpression(e)}parenthesisExpression(e){return new pR.ASTParenthesisExpression(e)}comparisonGroupExpression(e){return new uR.ASTComparisonGroupExpression(e)}};V.ASTProvider=pm;var bR=yh();Object.defineProperty(V,"ASTAssignmentStatement",{enumerable:!0,get:function(){return bR.ASTAssignmentStatement}});var ia=ot();Object.defineProperty(V,"ASTBase",{enumerable:!0,get:function(){return ia.ASTBase}});Object.defineProperty(V,"ASTBaseBlock",{enumerable:!0,get:function(){return ia.ASTBaseBlock}});Object.defineProperty(V,"ASTBaseBlockWithScope",{enumerable:!0,get:function(){return ia.ASTBaseBlockWithScope}});Object.defineProperty(V,"ASTComment",{enumerable:!0,get:function(){return ia.ASTComment}});Object.defineProperty(V,"ASTType",{enumerable:!0,get:function(){return ia.ASTType}});var _R=_h();Object.defineProperty(V,"ASTBinaryExpression",{enumerable:!0,get:function(){return _R.ASTBinaryExpression}});var Mw=Th();Object.defineProperty(V,"ASTCallExpression",{enumerable:!0,get:function(){return Mw.ASTCallExpression}});Object.defineProperty(V,"ASTCallStatement",{enumerable:!0,get:function(){return Mw.ASTCallStatement}});var vR=Eh();Object.defineProperty(V,"ASTChunk",{enumerable:!0,get:function(){return vR.ASTChunk}});var SR=xh();Object.defineProperty(V,"ASTComparisonGroupExpression",{enumerable:!0,get:function(){return SR.ASTComparisonGroupExpression}});var TR=Ch();Object.defineProperty(V,"ASTForGenericStatement",{enumerable:!0,get:function(){return TR.ASTForGenericStatement}});var wR=Rh();Object.defineProperty(V,"ASTFunctionStatement",{enumerable:!0,get:function(){return wR.ASTFunctionStatement}});var hm=Mh();Object.defineProperty(V,"ASTIdentifier",{enumerable:!0,get:function(){return hm.ASTIdentifier}});Object.defineProperty(V,"ASTIndexExpression",{enumerable:!0,get:function(){return hm.ASTIndexExpression}});Object.defineProperty(V,"ASTMemberExpression",{enumerable:!0,get:function(){return hm.ASTMemberExpression}});var Qc=jh();Object.defineProperty(V,"ASTClause",{enumerable:!0,get:function(){return Qc.ASTClause}});Object.defineProperty(V,"ASTElseClause",{enumerable:!0,get:function(){return Qc.ASTElseClause}});Object.defineProperty(V,"ASTIfClause",{enumerable:!0,get:function(){return Qc.ASTIfClause}});Object.defineProperty(V,"ASTIfStatement",{enumerable:!0,get:function(){return Qc.ASTIfStatement}});var ER=$h();Object.defineProperty(V,"ASTIsaExpression",{enumerable:!0,get:function(){return ER.ASTIsaExpression}});var Lw=Hh();Object.defineProperty(V,"ASTListConstructorExpression",{enumerable:!0,get:function(){return Lw.ASTListConstructorExpression}});Object.defineProperty(V,"ASTListValue",{enumerable:!0,get:function(){return Lw.ASTListValue}});var sa=Xh();Object.defineProperty(V,"ASTBooleanLiteral",{enumerable:!0,get:function(){return sa.ASTBooleanLiteral}});Object.defineProperty(V,"ASTLiteral",{enumerable:!0,get:function(){return sa.ASTLiteral}});Object.defineProperty(V,"ASTNilLiteral",{enumerable:!0,get:function(){return sa.ASTNilLiteral}});Object.defineProperty(V,"ASTNumericLiteral",{enumerable:!0,get:function(){return sa.ASTNumericLiteral}});Object.defineProperty(V,"ASTStringLiteral",{enumerable:!0,get:function(){return sa.ASTStringLiteral}});var AR=Jh();Object.defineProperty(V,"ASTLogicalExpression",{enumerable:!0,get:function(){return AR.ASTLogicalExpression}});var Nw=em();Object.defineProperty(V,"ASTMapConstructorExpression",{enumerable:!0,get:function(){return Nw.ASTMapConstructorExpression}});Object.defineProperty(V,"ASTMapKeyString",{enumerable:!0,get:function(){return Nw.ASTMapKeyString}});var xR=nm();Object.defineProperty(V,"ASTParenthesisExpression",{enumerable:!0,get:function(){return xR.ASTParenthesisExpression}});var kR=im();Object.defineProperty(V,"ASTReturnStatement",{enumerable:!0,get:function(){return kR.ASTReturnStatement}});var CR=om();Object.defineProperty(V,"ASTSliceExpression",{enumerable:!0,get:function(){return CR.ASTSliceExpression}});var OR=cm();Object.defineProperty(V,"ASTUnaryExpression",{enumerable:!0,get:function(){return OR.ASTUnaryExpression}});var RR=dm();Object.defineProperty(V,"ASTWhileStatement",{enumerable:!0,get:function(){return RR.ASTWhileStatement}})});var bm=m(ym=>{"use strict";Object.defineProperty(ym,"__esModule",{value:!0});var oi=ni(),gm=class{constructor(){this.isNonNilLiteral=Set.prototype.has.bind(new Set([oi.TokenType.StringLiteral,oi.TokenType.NumericLiteral,oi.TokenType.BooleanLiteral])),this.isLiteral=Set.prototype.has.bind(new Set([oi.TokenType.StringLiteral,oi.TokenType.NumericLiteral,oi.TokenType.BooleanLiteral,oi.TokenType.NilLiteral]))}isComment(e){return e===oi.TokenType.Comment}};ym.default=gm});var vm=m(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.SelectorGroups=se.SelectorGroupType=se.getSelectorsFromGroup=se.createSelectorGroup=se.Selectors=se.getSelectorValue=se.createSelector=se.createSelectorOptions=se.SelectorType=void 0;var ie=ni(),Xn=js(),ge=$s(),DR;(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"})(DR=se.SelectorType||(se.SelectorType={}));var _m=class{};se.createSelectorOptions=_m;function te(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}se.createSelector=te;function IR(t){return t.data.value}se.getSelectorValue=IR;se.Selectors={EndOfLine:te({type:ie.TokenType.EOL,value:ge.Operator.EndOfLine}),EndOfFile:te({type:ie.TokenType.EOF,value:ge.Operator.EndOfFile}),LParenthesis:te({type:ie.TokenType.Punctuator,value:ge.Operator.LParenthesis}),RParenthesis:te({type:ie.TokenType.Punctuator,value:ge.Operator.RParenthesis}),CLBracket:te({type:ie.TokenType.Punctuator,value:ge.Operator.CLBracket}),CRBracket:te({type:ie.TokenType.Punctuator,value:ge.Operator.CRBracket}),SLBracket:te({type:ie.TokenType.Punctuator,value:ge.Operator.SLBracket}),SRBracket:te({type:ie.TokenType.Punctuator,value:ge.Operator.SRBracket}),Assign:te({type:ie.TokenType.Punctuator,value:ge.Operator.Assign}),AddShorthand:te({type:ie.TokenType.Punctuator,value:ge.Operator.AddShorthand}),SubtractShorthand:te({type:ie.TokenType.Punctuator,value:ge.Operator.SubtractShorthand}),MultiplyShorthand:te({type:ie.TokenType.Punctuator,value:ge.Operator.MultiplyShorthand}),DivideShorthand:te({type:ie.TokenType.Punctuator,value:ge.Operator.DivideShorthand}),PowerShorthand:te({type:ie.TokenType.Punctuator,value:ge.Operator.PowerShorthand}),ModuloShorthand:te({type:ie.TokenType.Punctuator,value:ge.Operator.ModuloShorthand}),Seperator:te({type:ie.TokenType.Punctuator,value:ge.Operator.Comma}),Function:te({type:ie.TokenType.Keyword,value:Xn.Keyword.Function}),EndFunction:te({type:ie.TokenType.Keyword,value:Xn.Keyword.EndFunction}),EndWhile:te({type:ie.TokenType.Keyword,value:Xn.Keyword.EndWhile}),EndFor:te({type:ie.TokenType.Keyword,value:Xn.Keyword.EndFor}),EndIf:te({type:ie.TokenType.Keyword,value:Xn.Keyword.EndIf}),SliceSeperator:te({type:ie.TokenType.SliceOperator,value:ge.Operator.SliceSeperator}),MapKeyValueSeperator:te({type:ie.TokenType.SliceOperator,value:ge.Operator.SliceSeperator}),MapSeperator:te({type:ie.TokenType.Punctuator,value:ge.Operator.Comma}),ListSeperator:te({type:ie.TokenType.Punctuator,value:ge.Operator.Comma}),CallSeperator:te({type:ie.TokenType.Punctuator,value:ge.Operator.Comma}),ArgumentSeperator:te({type:ie.TokenType.Punctuator,value:ge.Operator.Comma}),ImportCodeSeperator:te({type:ie.TokenType.SliceOperator,value:ge.Operator.SliceSeperator}),ElseIf:te({type:ie.TokenType.Keyword,value:Xn.Keyword.ElseIf}),Then:te({type:ie.TokenType.Keyword,value:Xn.Keyword.Then}),Else:te({type:ie.TokenType.Keyword,value:Xn.Keyword.Else}),In:te({type:ie.TokenType.Keyword,value:Xn.Keyword.In}),MemberSeperator:te({type:ie.TokenType.Punctuator,value:ge.Operator.Member}),NumberSeperator:te({type:ie.TokenType.Punctuator,value:ge.Operator.Member}),Reference:te({type:ie.TokenType.Punctuator,value:ge.Operator.Reference}),Isa:te({type:ie.TokenType.Keyword,value:ge.Operator.Isa}),Or:te({type:ie.TokenType.Keyword,value:ge.Operator.Or}),And:te({type:ie.TokenType.Keyword,value:ge.Operator.And}),Minus:te({type:ie.TokenType.Punctuator,value:ge.Operator.Minus}),Plus:te({type:ie.TokenType.Punctuator,value:ge.Operator.Plus}),Times:te({type:ie.TokenType.Punctuator,value:ge.Operator.Asterik}),Power:te({type:ie.TokenType.Punctuator,value:ge.Operator.Power}),Divide:te({type:ie.TokenType.Punctuator,value:ge.Operator.Slash}),Mod:te({type:ie.TokenType.Punctuator,value:ge.Operator.Modulo}),Equal:te({type:ie.TokenType.Punctuator,value:ge.Operator.Equal}),NotEqual:te({type:ie.TokenType.Punctuator,value:ge.Operator.NotEqual}),Greater:te({type:ie.TokenType.Punctuator,value:ge.Operator.GreaterThan}),GreaterEqual:te({type:ie.TokenType.Punctuator,value:ge.Operator.GreaterThanOrEqual}),Lesser:te({type:ie.TokenType.Punctuator,value:ge.Operator.LessThan}),LessEqual:te({type:ie.TokenType.Punctuator,value:ge.Operator.LessThanOrEqual}),New:te({type:ie.TokenType.Keyword,value:Xn.Keyword.New}),Not:te({type:ie.TokenType.Keyword,value:Xn.Keyword.Not}),Comment:te({type:ie.TokenType.Comment})};function ur(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,27 +93,27 @@ ${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}se.createSelectorGroup=ur;function PR(t){return t.selectors}se.getSelectorsFromGroup=PR;var cr;(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"})(cr=se.SelectorGroupType||(se.SelectorGroupType={}));se.SelectorGroups={BlockEndOfLine:ur(cr.AssignmentEndOfExpr,[se.Selectors.EndOfLine,se.Selectors.Comment]),AssignmentEndOfExpr:ur(cr.AssignmentEndOfExpr,[se.Selectors.EndOfFile,se.Selectors.EndOfLine,se.Selectors.Else,se.Selectors.Comment]),AssignmentShorthand:ur(cr.AssignmentShorthand,[se.Selectors.AddShorthand,se.Selectors.SubtractShorthand,se.Selectors.MultiplyShorthand,se.Selectors.DivideShorthand,se.Selectors.PowerShorthand,se.Selectors.ModuloShorthand]),AssignmentCommandArgs:ur(cr.AssignmentCommandArgs,[se.Selectors.ArgumentSeperator,se.Selectors.EndOfLine,se.Selectors.EndOfFile]),ReturnStatementEnd:ur(cr.ReturnStatementEnd,[se.Selectors.EndOfLine,se.Selectors.Else,se.Selectors.Comment]),FunctionDeclarationArgEnd:ur(cr.FunctionDeclarationArgEnd,[se.Selectors.RParenthesis,se.Selectors.EndOfFile]),ComparisonOperators:ur(cr.ComparisonOperators,[se.Selectors.Equal,se.Selectors.NotEqual,se.Selectors.Greater,se.Selectors.GreaterEqual,se.Selectors.Lesser,se.Selectors.LessEqual]),MultiDivOperators:ur(cr.MultiDivOperators,[se.Selectors.Times,se.Selectors.Divide,se.Selectors.Mod]),CallArgsEnd:ur(cr.CallArgsEnd,[se.Selectors.ArgumentSeperator,se.Selectors.RParenthesis])}});var wm=m(Zc=>{"use strict";Object.defineProperty(Zc,"__esModule",{value:!0});Zc.Stack=void 0;var Tm=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}};Zc.Stack=Tm});var Om=m(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.PendingWhile=Ve.isPendingWhile=Ve.PendingIf=Ve.isPendingIf=Ve.PendingFunction=Ve.isPendingFunction=Ve.PendingFor=Ve.isPendingFor=Ve.PendingChunk=Ve.isPendingChunk=Ve.PendingBlockType=void 0;var Yn;(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"})(Yn=Ve.PendingBlockType||(Ve.PendingBlockType={}));var ji=class{constructor(e,n){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 MR(t){return t.type===Yn.Chunk}Ve.isPendingChunk=MR;var Em=class extends ji{constructor(e){super(e,Yn.Chunk)}complete(e){this.block.body=this.body,this.block.end=e.end,super.complete(e)}};Ve.PendingChunk=Em;function LR(t){return t.type===Yn.For}Ve.isPendingFor=LR;var Am=class extends ji{constructor(e){super(e,Yn.For)}complete(e){this.block.body=this.body,this.block.end=e.end,super.complete(e)}};Ve.PendingFor=Am;function NR(t){return t.type===Yn.Function}Ve.isPendingFunction=NR;var xm=class extends ji{constructor(e){super(e,Yn.Function)}complete(e){this.block.body=this.body,this.block.end=e.end,super.complete(e)}};Ve.PendingFunction=xm;function qR(t){return t.type===Yn.If}Ve.isPendingIf=qR;var km=class extends ji{constructor(e,n){super(e,Yn.If),this.currentClause=n}next(e){this.currentClause.body=this.body,this.currentClause.end=e.end,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,super.complete(e)}};Ve.PendingIf=km;function jR(t){return t.type===Yn.While}Ve.isPendingWhile=jR;var Cm=class extends ji{constructor(e){super(e,Yn.While)}complete(e){this.block.body=this.body,this.block.end=e.end,super.complete(e)}};Ve.PendingWhile=Cm});var jw=m(oa=>{"use strict";var qw=oa&&oa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(oa,"__esModule",{value:!0});var FR=qw(hh()),ai=ni(),lr=gm(),$R=qw(_m()),BR=Oc(),Nt=js(),Or=$s(),Kt=Zo(),z=Sm(),UR=wm(),dr=Om(),Rm=class{constructor(e,n={}){let r=this;r.content=e,r.backpatches=new UR.Stack,r.statementErrors=[],r.lexer=n.lexer||new FR.default(e,{unsafe:n.unsafe,tabWidth:n.tabWidth}),r.token=null,r.previousToken=null,r.lines={},r.scopes=[],r.currentScope=null,r.currentAssignment=null,r.outerScopes=[],r.literals=[],r.validator=n.validator||new $R.default,r.astProvider=n.astProvider||new lr.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 Kt.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,z.getSelectorValue)(e)}" is required`,new Kt.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,z.getSelectorsFromGroup)(e).map(i=>`"${(0,z.getSelectorValue)(i)}"`).join(", ")} is required`,new Kt.Range(n||r.start,r.end)),null)}addItemToLines(e){let n=this.lines,r=e.end.line;for(let i=e.start.line;i<=r;i++){let s=n[i];s?s.push(e):n[i]=[e]}}skipNewlines(){let e=this,n=0;for(;;){if(z.Selectors.Comment(e.token)){let r=e.astProvider.comment({value:e.token.value,start:e.token.start,end:e.token.end,scope:e.currentScope});e.addItemToLines(r),e.backpatches.peek().body.push(r)}else if(z.Selectors.EndOfLine(e.token))n++;else break;e.next()}return n}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!==ai.TokenType.EOL&&e.token.type!==ai.TokenType.EOF;e.next());}finishRemaingScopes(){let e=this,n=e.backpatches.pop();for(;!(0,dr.isPendingChunk)(n);){let r=e.raise(`found open block ${n.block.type}`,new Kt.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}),i=new dr.PendingChunk(r);for(e.backpatches.setDefault(i),e.pushScope(r);!z.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!z.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.lines,r}parseStatement(){let e=this;if(ai.TokenType.Keyword===e.token.type&&Nt.Keyword.Not!==e.token.value){e.parseKeyword();return}let n=e.backpatches.peek(),r=e.parseAssignment();r.end!==null&&e.addItemToLines(r),n.body.push(r)}parseKeyword(){let e=this;switch(e.token.value){case Nt.Keyword.Return:{let r=e.backpatches.peek();e.next();let i=e.parseReturnStatement();i.end!==null&&e.addItemToLines(i),r.body.push(i);return}case Nt.Keyword.If:{e.next(),e.parseIfStatement();return}case Nt.Keyword.ElseIf:{e.next(),e.nextIfClause(lr.ASTType.ElseifClause);return}case Nt.Keyword.Else:{e.next(),e.nextIfClause(lr.ASTType.ElseClause);return}case Nt.Keyword.While:{e.next(),e.parseWhileStatement();return}case Nt.Keyword.For:{e.next(),e.parseForStatement();return}case Nt.Keyword.EndFunction:{e.next(),e.finalizeFunction();return}case Nt.Keyword.EndFor:{e.next(),e.finalizeForStatement();return}case Nt.Keyword.EndWhile:{e.next(),e.finalizeWhileStatement();return}case Nt.Keyword.EndIf:{e.next(),e.nextIfClause(null);return}case Nt.Keyword.Continue:{let r=e.backpatches.peek();e.next();let i=e.astProvider.continueStatement({start:e.previousToken.start,end:e.previousToken.end,scope:e.currentScope});e.addItemToLines(i),r.body.push(i);return}case Nt.Keyword.Break:{let r=e.backpatches.peek();e.next();let i=e.astProvider.breakStatement({start:e.previousToken.start,end:e.previousToken.end,scope:e.currentScope});e.addItemToLines(i),r.body.push(i);return}}e.raise(`unexpected keyword ${e.token} at start of line`,new Kt.Range(e.token.start,e.token.end))}parseShortcutStatement(){let e=this;if(ai.TokenType.Keyword===e.token.type&&Nt.Keyword.Not!==e.token.value)switch(e.token.value){case Nt.Keyword.Return:return e.next(),e.parseReturnStatement();case Nt.Keyword.Continue:return e.next(),e.astProvider.continueStatement({start:e.previousToken.start,end:e.previousToken.end,scope:e.currentScope});case Nt.Keyword.Break:return e.next(),e.astProvider.breakStatement({start:e.previousToken.start,end:e.previousToken.end,scope:e.currentScope});default:return e.raise(`unexpected keyword ${e.token} in shorthand statement`,new Kt.Range(e.token.start,e.token.end)),e.parseInvalidCode()}return e.parseAssignment()}parseAssignment(){let e=this,n=e.currentScope,r=e.token.start,i=e.parseExpr(null,!0,!0);if(z.SelectorGroups.AssignmentEndOfExpr(e.token))return i;if(z.Selectors.Assign(e.token)){e.next();let o=e.astProvider.assignmentStatement({variable:i,init:null,start:r,end:null,scope:n}),a=e.currentAssignment;if(e.currentAssignment=o,o.init=e.parseExpr(o),o.end=e.previousToken.end,o.init.type===lr.ASTType.FunctionDeclaration){let u=e.backpatches.peek();u.onComplete=c=>o.end=c.block.end}return e.currentAssignment=a,n.assignments.push(o),o}else if(z.SelectorGroups.AssignmentShorthand(e.token)){let o=e.token;e.next();let a=e.astProvider.assignmentStatement({variable:i,init:null,start:r,end:null,scope:n}),u=e.currentAssignment;e.currentAssignment=a;let c=e.token.start,l=o.value.charAt(0),d=e.parseExpr(a),p=e.astProvider.parenthesisExpression({start:d.start,end:d.end,expression:d});return a.init=e.astProvider.binaryExpression({operator:l,left:i.clone(),right:p,start:c,end:e.previousToken.end,scope:n}),a.end=e.previousToken.end,e.currentAssignment=u,n.assignments.push(a),a}let s=[];for(;!z.Selectors.EndOfFile(e.token);){let o=e.parseExpr(null);if(s.push(o),z.SelectorGroups.BlockEndOfLine(e.token)||z.Selectors.Else(e.token))break;if(z.Selectors.ArgumentSeperator(e.token)){e.next(),e.skipNewlines();continue}let a=e.requireTokenOfAny(z.SelectorGroups.AssignmentCommandArgs,r);if(z.Selectors.EndOfLine(a)||z.Selectors.EndOfFile(a))break}return s.length===0?e.astProvider.callStatement({expression:i,start:r,end:e.previousToken.end,scope:n}):e.astProvider.callStatement({expression:e.astProvider.callExpression({base:i,arguments:s,start:r,end:e.previousToken.end,scope:n}),start:r,end:e.previousToken.end,scope:n})}parseReturnStatement(){let e=this,n=e.currentScope,r=e.previousToken.start,i=null,s=e.astProvider.returnStatement({argument:null,start:r,end:null,scope:n});if(z.SelectorGroups.ReturnStatementEnd(e.token))s.end=e.previousToken.end;else{if(i=e.parseExpr(s),i.type===lr.ASTType.FunctionDeclaration){let o=e.backpatches.peek();o.onComplete=a=>s.end=a.block.end}else s.end=e.previousToken.end;s.argument=i}return n.returns.push(s),s}parseIfStatement(){let e=this,n=e.previousToken.start,r=e.parseExpr(null);if(e.addItemToLines(r),e.requireToken(z.Selectors.Then,n),!z.SelectorGroups.BlockEndOfLine(e.token)){e.parseIfShortcutStatement(r,n);return}let i=e.astProvider.ifStatement({clauses:[],start:n,end:null,scope:e.currentScope}),s=e.astProvider.ifClause({condition:r,start:n,end:e.token.end,scope:e.currentScope}),o=new dr.PendingIf(i,s);e.backpatches.push(o)}nextIfClause(e){let n=this,r=n.backpatches.peek();if(!(0,dr.isPendingIf)(r)){n.raise("no matching open if block",new Kt.Range(n.token.start,n.token.end));return}switch(r.next(n.previousToken),e){case lr.ASTType.ElseifClause:{let i=n.token.start,s=n.parseExpr(null);n.requireToken(z.Selectors.Then,i),r.currentClause=n.astProvider.elseifClause({condition:s,start:i,end:null,scope:n.currentScope});break}case lr.ASTType.ElseClause:{let i=n.token.start;r.currentClause=n.astProvider.elseClause({start:i,end:null,scope:n.currentScope});break}}e===null&&(r.complete(n.previousToken),n.addItemToLines(r.block),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,end:null,scope:r.currentScope}),a=r.parseShortcutStatement();if(i.push(r.astProvider.ifShortcutClause({condition:e,body:[a],start:n,end:r.token.end,scope:r.currentScope})),z.Selectors.Else(r.token)){r.next();let u=r.token.start,c=r.parseShortcutStatement();i.push(r.astProvider.elseShortcutClause({body:[c],start:u,end:r.token.end,scope:r.currentScope}))}o.end=r.token.end,r.addItemToLines(o),s.body.push(o)}parseWhileStatement(){let e=this,n=e.previousToken.start,r=e.parseExpr(null);if(!r){e.raise("while requires a condition",new Kt.Range(n,e.token.end));return}if(!z.SelectorGroups.BlockEndOfLine(e.token))return e.parseWhileShortcutStatement(r,n);let i=e.astProvider.whileStatement({condition:r,start:n,end:null,scope:e.currentScope}),s=new dr.PendingWhile(i);e.backpatches.push(s),s.onComplete=o=>{e.addItemToLines(o.block),e.backpatches.pop(),e.backpatches.peek().body.push(o.block)}}finalizeWhileStatement(){let e=this,n=e.backpatches.peek();if(!(0,dr.isPendingWhile)(n)){e.raise("no matching open while block",new Kt.Range(e.token.start,e.token.end));return}n.complete(e.previousToken)}parseWhileShortcutStatement(e,n){let r=this,i=r.backpatches.peek(),s=r.parseShortcutStatement(),o=r.astProvider.whileStatement({condition:e,body:[s],start:n,end:r.previousToken.end,scope:r.currentScope});r.addItemToLines(o),i.body.push(o)}parseForStatement(){let e=this,n=e.currentScope,r=e.previousToken.start,i=e.parseIdentifier(),s=e.astProvider.assignmentStatement({variable:i,init:e.astProvider.unknown({start:i.start,end:i.end,scope:n}),start:i.start,end:i.end,scope:n}),o=e.astProvider.assignmentStatement({variable:e.astProvider.identifier({name:`__${i.name}_idx`,start:i.start,end:i.end,scope:n}),init:e.astProvider.literal(ai.TokenType.NumericLiteral,{value:0,raw:"0",start:i.start,end:i.end,scope:n}),start:i.start,end:i.end,scope:n});n.assignments.push(s,o),e.requireToken(z.Selectors.In,r);let a=e.parseExpr(null);if(!a){e.raise("sequence expression expected for 'for' loop",new Kt.Range(r,e.token.end));return}if(!z.SelectorGroups.BlockEndOfLine(e.token))return e.parseForShortcutStatement(i,a,r);let u=e.astProvider.forGenericStatement({variable:i,iterator:a,start:r,end:e.previousToken.end,scope:n}),c=new dr.PendingFor(u);e.backpatches.push(c)}finalizeForStatement(){let e=this,n=e.backpatches.peek();if(!(0,dr.isPendingFor)(n)){e.raise("no matching open for block",new Kt.Range(e.token.start,e.token.end));return}n.complete(e.previousToken),e.addItemToLines(n.block),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,end:i.previousToken.end,scope:i.currentScope});i.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(!z.Selectors.Function(i.token))return i.parseOr(n,r);i.next();let s=i.previousToken.start,o=i.astProvider.functionStatement({start:s,end:null,scope:i.currentScope,parent:i.outerScopes[i.outerScopes.length-1],assignment:i.currentAssignment}),a=[];if(i.pushScope(o),!z.SelectorGroups.BlockEndOfLine(i.token)){for(i.requireToken(z.Selectors.LParenthesis,s);!z.SelectorGroups.FunctionDeclarationArgEnd(i.token);){let c=i.parseIdentifier(),l=c.start;if(i.consume(z.Selectors.Assign)){let d=i.parseExpr(null);if(d instanceof lr.ASTLiteral){let p=i.astProvider.assignmentStatement({variable:c,init:d,start:l,end:i.previousToken.end,scope:i.currentScope});i.currentScope.assignments.push(p),a.push(p)}else i.raise("parameter default value must be a literal value",new Kt.Range(l,i.token.end)),a.push(i.astProvider.invalidCodeExpression({start:l,end:i.previousToken.end}))}else{let d=i.astProvider.assignmentStatement({variable:c,init:i.astProvider.unknown({start:l,end:i.previousToken.end,scope:i.currentScope}),start:l,end:i.previousToken.end,scope:i.currentScope});i.currentScope.assignments.push(d),a.push(c)}if(z.Selectors.RParenthesis(i.token))break;if(i.requireToken(z.Selectors.ArgumentSeperator,s),z.Selectors.RParenthesis(i.token)){i.raise("expected argument instead received right parenthesis",new Kt.Range(i.previousToken.end,i.previousToken.end));break}}i.requireToken(z.Selectors.RParenthesis,s)}o.parameters=a;let u=new dr.PendingFunction(o);return i.backpatches.push(u),u.onComplete=c=>{e!==null?(e.end=c.block.end,i.addItemToLines(e)):i.addItemToLines(c.block)},o}finalizeFunction(){let e=this,n=e.backpatches.peek();if(!(0,dr.isPendingFunction)(n)){e.raise("no matching open function block",new Kt.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.start,o=r.parseAnd(e,n);for(;z.Selectors.Or(r.token);){r.next(),r.skipNewlines();let a=r.parseAnd();o=r.astProvider.logicalExpression({operator:Or.Operator.Or,left:o,right:a,start:i,end:r.previousToken.end,scope:r.currentScope})}return o}parseAnd(e=!1,n=!1){let r=this,i=r.token.start,o=r.parseNot(e,n);for(;z.Selectors.And(r.token);){r.next(),r.skipNewlines();let a=r.parseNot();o=r.astProvider.logicalExpression({operator:Or.Operator.And,left:o,right:a,start:i,end:r.previousToken.end,scope:r.currentScope})}return o}parseNot(e=!1,n=!1){let r=this,i=r.token.start;if(z.Selectors.Not(r.token)){r.next(),r.skipNewlines();let s=r.parseIsa();return r.astProvider.unaryExpression({operator:Or.Operator.Not,argument:s,start:i,end:r.previousToken.end,scope:r.currentScope})}return r.parseIsa(e,n)}parseIsa(e=!1,n=!1){let r=this,i=r.token.start,s=r.parseComparisons(e,n);if(z.Selectors.Isa(r.token)){r.next(),r.skipNewlines();let o=r.parseComparisons();return r.astProvider.isaExpression({operator:Or.Operator.Isa,left:s,right:o,start:i,end:r.previousToken.end,scope:r.currentScope})}return s}parseComparisons(e=!1,n=!1){let r=this,i=r.token.start,s=r.parseAddSub(e,n);if(!z.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(z.SelectorGroups.ComparisonOperators(r.token));return a.length===1?r.astProvider.binaryExpression({operator:a[0],left:o[0],right:o[1],start:i,end:r.previousToken.end,scope:r.currentScope}):r.astProvider.comparisonGroupExpression({operators:a,expressions:o,start:i,end:r.previousToken.end,scope:r.currentScope})}parseAddSub(e=!1,n=!1){let r=this,i=r.token.start,o=r.parseMultDiv(e,n);for(;z.Selectors.Plus(r.token)||z.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,end:r.previousToken.end,scope:r.currentScope})}return o}parseMultDiv(e=!1,n=!1){let r=this,i=r.token.start,o=r.parseUnaryMinus(e,n);for(;z.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,end:r.previousToken.end,scope:r.currentScope})}return o}parseUnaryMinus(e=!1,n=!1){let r=this;if(!z.Selectors.Minus(r.token))return r.parseNew(e,n);let i=r.token.start;r.next(),r.skipNewlines();let s=r.parseNew();return s instanceof lr.ASTNumericLiteral||s instanceof lr.ASTBooleanLiteral?(s.negated=!0,s):r.astProvider.unaryExpression({operator:Or.Operator.Minus,argument:s,start:i,end:r.previousToken.end,scope:r.currentScope})}parseNew(e=!1,n=!1){let r=this;if(!z.Selectors.New(r.token))return r.parseAddressOf(e,n);let i=r.token.start;r.next(),r.skipNewlines();let s=r.parseNew();return r.astProvider.unaryExpression({operator:Or.Operator.New,argument:s,start:i,end:r.previousToken.end,scope:r.currentScope})}parseAddressOf(e=!1,n=!1){let r=this;if(!z.Selectors.Reference(r.token))return r.parsePower(e,n);let i=r.token.start;r.next(),r.skipNewlines();let s=r.parsePower();return r.astProvider.unaryExpression({operator:Or.Operator.Reference,argument:s,start:i,end:r.previousToken.end,scope:r.currentScope})}parsePower(e=!1,n=!1){let r=this,i=r.token.start,s=r.parseCallExpr(e,n);if(z.Selectors.Power(r.token)){r.next(),r.skipNewlines();let o=r.parseCallExpr();return r.astProvider.binaryExpression({operator:Or.Operator.Power,left:s,right:o,start:i,end:r.previousToken.end,scope:r.currentScope})}return s}parseCallExpr(e=!1,n=!1){let r=this,i=r.token.start,s=r.parseMap(e,n);for(;!z.Selectors.EndOfFile(r.token);)if(z.Selectors.MemberSeperator(r.token)){r.next(),r.skipNewlines();let o=r.parseIdentifier();s=r.astProvider.memberExpression({base:s,indexer:Or.Operator.Member,identifier:o,start:i,end:r.previousToken.end,scope:r.currentScope})}else if(z.Selectors.SLBracket(r.token)&&!r.token.afterSpace){if(r.next(),r.skipNewlines(),z.Selectors.SliceSeperator(r.token)){let o=r.astProvider.emptyExpression({start:r.previousToken.start,end:r.previousToken.end,scope:r.currentScope});r.next(),r.skipNewlines();let a=z.Selectors.SRBracket(r.token)?r.astProvider.emptyExpression({start:r.previousToken.start,end:r.previousToken.end,scope:r.currentScope}):r.parseExpr(null);s=r.astProvider.sliceExpression({base:s,left:o,right:a,start:i,end:r.token.end,scope:r.currentScope})}else{let o=r.parseExpr(null);if(z.Selectors.SliceSeperator(r.token)){r.next(),r.skipNewlines();let a=z.Selectors.SRBracket(r.token)?r.astProvider.emptyExpression({start:r.previousToken.start,end:r.previousToken.end,scope:r.currentScope}):r.parseExpr(null);s=r.astProvider.sliceExpression({base:s,left:o,right:a,start:i,end:r.token.end,scope:r.currentScope})}else s=r.astProvider.indexExpression({base:s,index:o,start:i,end:r.token.end,scope:r.currentScope})}r.requireToken(z.Selectors.SRBracket,i)}else if(z.Selectors.LParenthesis(r.token)&&(!e||!r.token.afterSpace)){let o=r.parseCallArgs();s=r.astProvider.callExpression({base:s,arguments:o,start:i,end:r.previousToken.end,scope:r.currentScope})}else break;return s}parseCallArgs(){let e=this,n=[];if(z.Selectors.LParenthesis(e.token))if(e.next(),z.Selectors.RParenthesis(e.token))e.next();else for(;!z.Selectors.EndOfFile(e.token);){e.skipNewlines();let r=e.parseExpr(null);if(n.push(r),e.skipNewlines(),z.Selectors.RParenthesis(e.requireTokenOfAny(z.SelectorGroups.CallArgsEnd,r.start)))break}return n}parseMap(e=!1,n=!1){let r=this;if(!z.Selectors.CLBracket(r.token))return r.parseList(e,n);let i=r.currentScope,s=r.token.start,o=[],a=r.astProvider.mapConstructorExpression({fields:o,start:s,end:null,scope:i});if(r.next(),z.Selectors.CRBracket(r.token))r.next();else for(r.skipNewlines();!z.Selectors.EndOfFile(r.token);){if(z.Selectors.CRBracket(r.token)){r.next();break}let u=r.astProvider.mapKeyString({key:null,value:null,start:r.token.start,end:null,scope:i});if(u.key=r.parseExpr(null),r.requireToken(z.Selectors.MapKeyValueSeperator),r.skipNewlines(),r.currentAssignment){let c=r.astProvider.assignmentStatement({variable:r.astProvider.indexExpression({index:u.key,base:r.currentAssignment.variable,start:u.start,end:r.token.end,scope:i}),init:null,start:u.start,end:null}),l=r.currentAssignment;r.currentAssignment=c,u.value=r.parseExpr(u),r.currentAssignment=l,c.init=u.value,c.end=r.previousToken.end,i.assignments.push(c)}else u.value=r.parseExpr(u);if(u.end=r.previousToken.end,o.push(u),z.Selectors.MapSeperator(r.token)&&(r.next(),r.skipNewlines()),z.Selectors.CRBracket(r.token)){r.next();break}}return a.end=r.token.start,a}parseList(e=!1,n=!1){let r=this;if(!z.Selectors.SLBracket(r.token))return r.parseQuantity(e,n);let i=r.currentScope,s=r.token.start,o=[],a=r.astProvider.listConstructorExpression({fields:o,start:s,end:null,scope:i});if(r.next(),z.Selectors.SRBracket(r.token))r.next();else for(r.skipNewlines();!z.Selectors.EndOfFile(r.token);){if(z.Selectors.SRBracket(r.token)){r.next();break}let u=r.astProvider.listValue({value:null,start:r.token.start,end:null,scope:i});if(r.currentAssignment){let c=r.astProvider.assignmentStatement({variable:r.astProvider.indexExpression({index:r.astProvider.literal(ai.TokenType.NumericLiteral,{value:o.length,raw:`${o.length}`,start:s,end:r.token.end,scope:i}),base:r.currentAssignment.variable,start:null,end:null,scope:i}),init:null,start:null,end:null}),l=r.currentAssignment,d=r.token;r.currentAssignment=l,u.value=r.parseExpr(u),r.currentAssignment=l,c.variable.start=d.start,c.variable.end=r.previousToken.end,c.init=u.value,c.start=u.start,c.end=r.previousToken.end,i.assignments.push(c)}else u.value=r.parseExpr(u);if(u.end=r.previousToken.end,o.push(u),z.Selectors.MapSeperator(r.token)&&(r.next(),r.skipNewlines()),z.Selectors.SRBracket(r.token)){r.next();break}}return a.end=r.token.start,a}parseQuantity(e=!1,n=!1){let r=this;if(!z.Selectors.LParenthesis(r.token))return r.parseAtom(e,n);let i=r.token.start;r.next(),r.skipNewlines();let s=r.parseExpr(null);return r.requireToken(z.Selectors.RParenthesis,i),r.astProvider.parenthesisExpression({expression:s,start:i,end:r.previousToken.end,scope:r.currentScope})}parseAtom(e=!1,n=!1){let r=this;return r.validator.isLiteral(r.token.type)?r.parseLiteral():r.isType(ai.TokenType.Identifier)?r.parseIdentifier():(r.raise(`got ${r.token} where number, string, or identifier is required`,new Kt.Range(r.token.start,r.token.end)),r.parseInvalidCode())}parseLiteral(){let e=this,n=e.token.start,r=e.token.type,i=e.astProvider.literal(r,{value:e.token.value,raw:e.token.raw,start:n,end:e.token.end,scope:e.currentScope});return e.literals.push(i),e.next(),i}parseIdentifier(){let e=this,n=e.token.start,r=e.token.end,i=e.requireType(ai.TokenType.Identifier);return i===null?e.parseInvalidCode():(e.currentScope.namespaces.add(i.value),e.astProvider.identifier({name:i.value,start:n,end:r,scope:e.currentScope}))}parseInvalidCode(){let e=this,n=e.token.start,r=e.token.end,i=e.astProvider.invalidCodeExpression({start:n,end:r});return e.next(),i}raise(e,n){let r=this,i=new BR.ParserException(e,n);return r.statementErrors.push(i),i}};oa.default=Rm});var je=m(Oe=>{"use strict";var HR=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]}),Jn=Oe&&Oe.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&HR(e,t,n)},el=Oe&&Oe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Oe,"__esModule",{value:!0});Oe.ASTRange=Oe.ASTPosition=Oe.ParserValidatorm=Oe.Parser=Oe.LexerValidator=Oe.Lexer=void 0;var WR=hh();Object.defineProperty(Oe,"Lexer",{enumerable:!0,get:function(){return el(WR).default}});Jn(ni(),Oe);var GR=ih();Object.defineProperty(Oe,"LexerValidator",{enumerable:!0,get:function(){return el(GR).default}});var VR=jw();Object.defineProperty(Oe,"Parser",{enumerable:!0,get:function(){return el(VR).default}});Jn(gm(),Oe);var zR=_m();Object.defineProperty(Oe,"ParserValidatorm",{enumerable:!0,get:function(){return el(zR).default}});Jn(Om(),Oe);Jn(wm(),Oe);Jn(dh(),Oe);Jn(Cc(),Oe);Jn(Oc(),Oe);Jn(js(),Oe);Jn(ah(),Oe);Jn($s(),Oe);var KR=zo();Object.defineProperty(Oe,"ASTPosition",{enumerable:!0,get:function(){return KR.Position}});var XR=Zo();Object.defineProperty(Oe,"ASTRange",{enumerable:!0,get:function(){return XR.Range}});Jn(Sm(),Oe)});var aa=m(tl=>{"use strict";Object.defineProperty(tl,"__esModule",{value:!0});tl.isValidIdentifierLiteral=void 0;var YR=je(),JR=t=>{if(t.type!==YR.ASTType.StringLiteral)return!1;let e=t.value.toString();return/^[_a-z][_a-z0-9]*$/i.test(e)};tl.isValidIdentifierLiteral=JR});var Dm=m(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.getStringHashCode=ui.getHashCode=ui.rotateBits=void 0;function QR(t){return t>>1|t<<31}ui.rotateBits=QR;function ZR(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=ZR;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 Fw=m(nl=>{"use strict";Object.defineProperty(nl,"__esModule",{value:!0});nl.createExpressionHash=void 0;var He=je(),pt=Dm(),e1=aa(),qt=(t,e)=>t.$$hash=e,t1=t=>t.$$hash??null;function et(t){let e=t1(t);if(e!==null)return e;let n=(0,pt.getStringHashCode)(t.type);switch(t.type){case He.ASTType.BinaryExpression:{let r=t;return n^=(0,pt.getStringHashCode)(r.operator),n^=et(r.left),n^=et(r.right),qt(t,n)}case He.ASTType.LogicalExpression:{let r=t;return n^=(0,pt.getStringHashCode)(r.operator),n^=et(r.left),n^=et(r.right),qt(t,n)}case He.ASTType.IsaExpression:{let r=t;return n^=(0,pt.getStringHashCode)(r.operator),n^=et(r.left),n^=et(r.right),qt(t,n)}case He.ASTType.ComparisonGroupExpression:{let r=t;for(let i=0;i<r.expressions.length;i++)n^=et(r.expressions[i]);for(let i=0;i<r.operators.length;i++)n^=(0,pt.getStringHashCode)(r.operators[i]);return qt(t,n)}case He.ASTType.FunctionDeclaration:{let r=t;n^=(0,pt.getHashCode)(r.parameters.length);for(let i=0;i<r.parameters.length;i++){let s=r.parameters[i];if(s.type===He.ASTType.Identifier){n^=(0,pt.getStringHashCode)(s.name);continue}let o=s;n^=(0,pt.getStringHashCode)(o.variable.name),n^=et(o.init)}return qt(t,n)}case He.ASTType.ParenthesisExpression:return et(t.expression);case He.ASTType.MemberExpression:{let r=t;if(r.base.type===He.ASTType.Identifier){let i=r.base.name;if(i==="globals"||i==="locals"||i==="outer")return n=(0,pt.getStringHashCode)(He.ASTType.Identifier),n^=(0,pt.getStringHashCode)(r.identifier.name),qt(t,n)}return n^=et(r.base),n^=et(r.identifier),qt(t,n)}case He.ASTType.IndexExpression:{let r=t;if((0,e1.isValidIdentifierLiteral)(r.index)){if(r.base.type===He.ASTType.Identifier){let s=r.base.name;if(s==="globals"||s==="locals"||s==="outer")return n=(0,pt.getStringHashCode)(He.ASTType.Identifier),n^=(0,pt.getStringHashCode)(r.index.value.toString()),qt(t,n)}n=(0,pt.getStringHashCode)(He.ASTType.MemberExpression),n^=et(r.base);let i=(0,pt.getStringHashCode)(He.ASTType.Identifier);i^=(0,pt.getStringHashCode)(r.index.value.toString()),n^=i}else n^=et(r.base),n^=et(r.index);return qt(t,n)}case He.ASTType.CallExpression:{let r=t;n^=et(r.base),n^=(0,pt.getHashCode)(r.arguments.length);for(let i=0;i<r.arguments.length;i++){let s=r.arguments[i];n^=et(s)}return qt(t,n)}case He.ASTType.NegationExpression:case He.ASTType.BinaryNegatedExpression:case He.ASTType.UnaryExpression:{let r=t;return n^=r.operator?(0,pt.getStringHashCode)(r.operator):1,n^=et(r.argument),qt(t,n)}case He.ASTType.Identifier:{let r=t;return n^=(0,pt.getStringHashCode)(r.name),qt(t,n)}case He.ASTType.NumericLiteral:case He.ASTType.StringLiteral:case He.ASTType.NilLiteral:return n^=(0,pt.getStringHashCode)(t.value.toString()),qt(t,n);case He.ASTType.MapConstructorExpression:{let r=t;n^=(0,pt.getHashCode)(r.fields.length);for(let i=0;i<r.fields.length;i++){let s=r.fields[i];n^=et(s.key),n^=et(s.value)}return qt(t,n)}case He.ASTType.ListConstructorExpression:{let r=t;n^=(0,pt.getHashCode)(r.fields.length);for(let i=0;i<r.fields.length;i++){let s=r.fields[i];n^=et(s.value)}return qt(t,n)}case He.ASTType.SliceExpression:{let r=t;return n^=et(r.base),n^=et(r.left),n^=et(r.right),qt(t,n)}}return console.warn(`Unexpected ast type ${t.type} in hash handler!`),qt(t,n)}function n1(t){return et(t)}nl.createExpressionHash=n1});var Im=m(rl=>{"use strict";Object.defineProperty(rl,"__esModule",{value:!0});rl.createExpressionId=void 0;var _t=je(),r1=aa(),Tt=(t,e)=>t.$$id=e,i1=t=>t.$$id??null;function ze(t){let e=i1(t);if(e!==null)return e;switch(t.type){case _t.ASTType.BinaryExpression:{let n=t;return Tt(t,ze(n.left)+n.operator+ze(n.right))}case _t.ASTType.LogicalExpression:{let n=t;return Tt(t,ze(n.left)+n.operator+ze(n.right))}case _t.ASTType.IsaExpression:{let n=t;return Tt(t,ze(n.left)+n.operator+ze(n.right))}case _t.ASTType.ComparisonGroupExpression:{let n=t,r=n.expressions.map(s=>ze(s)),i=[r[0]];for(let s=0;s<n.operators.length;s++)i.push(n.operators[s],r[s+1]);return Tt(t,i.join(" "))}case _t.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===_t.ASTType.Identifier){i.push(o.name);continue}let a=o;i.push(a.variable.name+"="+ze(a.init))}return i.length>0&&(r+="("+i.join(",")+")"),Tt(t,r)}case _t.ASTType.ParenthesisExpression:return Tt(t,ze(t.expression));case _t.ASTType.MemberExpression:{let n=t;return Tt(t,ze(n.base)+"."+n.identifier.name)}case _t.ASTType.IndexExpression:{let n=t;return(0,r1.isValidIdentifierLiteral)(n.index)?Tt(t,ze(n.base)+"."+n.index.value.toString()):Tt(t,ze(n.base)+"["+ze(n.index)+"]")}case _t.ASTType.CallExpression:{let n=t,r=ze(n.base),i=[];for(let s=0;s<n.arguments.length;s++){let o=n.arguments[s];i.push(ze(o))}return i.length>0&&(r+="("+i.join(",")+")"),Tt(t,r)}case _t.ASTType.NegationExpression:case _t.ASTType.BinaryNegatedExpression:case _t.ASTType.UnaryExpression:{let n=t;return n.operator==null?Tt(t,ze(n.argument)):n.operator==="@"?Tt(t,n.operator+ze(n.argument)):Tt(t,n.operator+" "+ze(n.argument))}case _t.ASTType.Identifier:return Tt(t,t.name);case _t.ASTType.NumericLiteral:case _t.ASTType.StringLiteral:case _t.ASTType.NilLiteral:return Tt(t,t.raw.toString());case _t.ASTType.MapConstructorExpression:{let n=t,r=[];for(let i=0;i<n.fields.length;i++){let s=n.fields[i];r.push(ze(s.key)+":"+ze(s.value))}return Tt(t,"{"+r.join(",")+"}")}case _t.ASTType.ListConstructorExpression:{let n=t,r=[];for(let i=0;i<n.fields.length;i++){let s=n.fields[i];r.push(ze(s.value))}return Tt(t,"["+r.join(",")+"]")}case _t.ASTType.SliceExpression:{let n=t;return Tt(t,ze(n.base)+"["+ze(n.left)+":"+ze(n.right)+"]")}}return console.warn(`Unexpected ast type ${t.type} in hash handler!`),Tt(t,"")}function s1(t){return ze(t)}rl.createExpressionId=s1});var Vs=m(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});ua.Markers=void 0;var o1;(function(t){t.start="/**",t.nostart="/***",t.delim="*",t.end="*/"})(o1=ua.Markers||(ua.Markers={}))});var Qn=m(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.rewireSpecs=at.rewireSource=at.seedTokens=at.seedSpec=at.seedBlock=at.splitLines=at.splitSpace=at.splitCR=at.hasCR=at.isSpace=void 0;function a1(t){return/^\s+$/.test(t)}at.isSpace=a1;function u1(t){return/\r$/.test(t)}at.hasCR=u1;function c1(t){let e=t.match(/\r+$/);return e==null?["",t]:[t.slice(-e[0].length),t.slice(0,-e[0].length)]}at.splitCR=c1;function l1(t){let e=t.match(/^\s+/);return e==null?["",t]:[t.slice(0,e[0].length),t.slice(e[0].length)]}at.splitSpace=l1;function d1(t){return t.split(/\n/)}at.splitLines=d1;function f1(t={}){return Object.assign({description:"",tags:[],source:[],problems:[]},t)}at.seedBlock=f1;function p1(t={}){return Object.assign({tag:"",name:"",type:"",optional:!1,description:"",problems:[],source:[]},t)}at.seedSpec=p1;function h1(t={}){return Object.assign({start:"",delimiter:"",postDelimiter:"",tag:"",postTag:"",name:"",postName:"",type:"",postType:"",description:"",end:"",lineEnd:""},t)}at.seedTokens=h1;function m1(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}at.rewireSource=m1;function g1(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}at.rewireSpecs=g1});var $w=m(Pm=>{"use strict";Object.defineProperty(Pm,"__esModule",{value:!0});var y1=/^@\S+/;function b1({fence:t="```"}={}){let e=_1(t),n=(r,i)=>e(r)?!i:i;return function(i){let s=[[]],o=!1;for(let a of i)y1.test(a.tokens.description)&&!o?s.push([a]):s[s.length-1].push(a),o=n(a.tokens.description,o);return s}}Pm.default=b1;function _1(t){return typeof t=="string"?e=>e.split(t).length%2===0:t}});var Bw=m(Mm=>{"use strict";Object.defineProperty(Mm,"__esModule",{value:!0});var v1=Vs(),ca=Qn();function S1({startLine:t=0,markers:e=v1.Markers}={}){let n=null,r=t;return function(s){let o=s,a=(0,ca.seedTokens)();if([a.lineEnd,o]=(0,ca.splitCR)(o),[a.start,o]=(0,ca.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,ca.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,ca.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}}Mm.default=S1});var Uw=m(Lm=>{"use strict";Object.defineProperty(Lm,"__esModule",{value:!0});var T1=Qn();function w1({tokenizers:t}){return function(n){var r;let i=(0,T1.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}}Lm.default=w1});var qm=m(Nm=>{"use strict";Object.defineProperty(Nm,"__esModule",{value:!0});function E1(){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)}}Nm.default=E1});var Fm=m(jm=>{"use strict";Object.defineProperty(jm,"__esModule",{value:!0});var A1=Qn();function x1(t="compact"){let e=C1(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,A1.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}}jm.default=x1;var k1=t=>t.trim();function C1(t){return t==="compact"?e=>e.map(k1).join(""):t==="preserve"?e=>e.join(`
97
- `):t}});var Um=m(Bm=>{"use strict";Object.defineProperty(Bm,"__esModule",{value:!0});var $m=Qn(),O1=t=>t&&t.startsWith('"')&&t.endsWith('"');function R1(){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,$m.splitSpace)(r.slice(n.name.length)),e;let s=0,o="",a=!1,u;for(let l of r){if(s===0&&(0,$m.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(!O1(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,$m.splitSpace)(r.slice(n.name.length)),e}}Bm.default=R1});var Wm=m(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});la.getJoiner=void 0;var Hm=Vs();function D1(t="compact",e=Hm.Markers){let n=Hw(t);return r=>(r.description=n(r.source,e),r)}la.default=D1;function Hw(t){return t==="compact"?I1:t==="preserve"?L1:t}la.getJoiner=Hw;function I1(t,e=Hm.Markers){return t.map(({tokens:{description:n}})=>n.trim()).filter(n=>n!=="").join(" ")}var P1=(t,{tokens:e},n)=>e.type===""?t:n,M1=({tokens:t})=>(t.delimiter===""?t.start:t.postDelimiter.slice(1))+t.description;function L1(t,e=Hm.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(P1,0)),t.map(M1).join(`
98
- `)}});var Gw=m(Gm=>{"use strict";Object.defineProperty(Gm,"__esModule",{value:!0});var N1=Vs(),q1=Qn(),j1=$w(),F1=Bw(),$1=Uw(),B1=qm(),U1=Fm(),H1=Um(),Ww=Wm();function W1({startLine:t=0,fence:e="```",spacing:n="compact",markers:r=N1.Markers,tokenizers:i=[(0,B1.default)(),(0,U1.default)(n),(0,H1.default)(),(0,Ww.default)(n)]}={}){if(t<0||t%1>0)throw new Error("Invalid startLine");let s=(0,F1.default)({startLine:t,markers:r}),o=(0,j1.default)({fence:e}),a=(0,$1.default)({tokenizers:i}),u=(0,Ww.getJoiner)(n);return function(c){let l=[];for(let d of(0,q1.splitLines)(c)){let p=s(d);if(p===null)continue;let y=o(p),v=y.slice(1).map(a);l.push({description:u(y[0],r),tags:v,source:p,problems:v.reduce((x,I)=>x.concat(I.problems),[])})}return l}}Gm.default=W1});var Vw=m(Vm=>{"use strict";Object.defineProperty(Vm,"__esModule",{value:!0});function G1(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 V1(){return t=>t.source.map(({tokens:e})=>G1(e)).join(`
99
- `)}Vm.default=V1});var Kw=m(da=>{"use strict";var z1=da&&da.__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(da,"__esModule",{value:!0});var zw=Vs(),K1=Qn(),X1={start:0,tag:0,type:0,name:0},Y1=(t=zw.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)}),Fi=t=>"".padStart(t," ");function J1(t=zw.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=Fi(n.start+1),Object.assign(Object.assign({},i),{tokens:s});switch(s.delimiter){case t.start:s.start=Fi(n.start);break;case t.delim:s.start=Fi(n.start+1);break;default:s.delimiter="",s.start=Fi(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=Fi(n.tag-s.tag.length+1)),a.type||(s.postType=Fi(n.type-s.type.length+1)),a.name||(s.postName=Fi(n.name-s.name.length+1)),Object.assign(Object.assign({},i),{tokens:s})}return i=>{var{source:s}=i,o=z1(i,["source"]);return n=s.reduce(Y1(t),Object.assign({},X1)),(0,K1.rewireSource)(Object.assign(Object.assign({},o),{source:s.map(r)}))}}da.default=J1});var Xw=m(fa=>{"use strict";var Q1=fa&&fa.__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(fa,"__esModule",{value:!0});var Z1=Qn(),eD=t=>e=>e.slice(t),tD=t=>{let e="".padStart(t," ");return n=>n+e};function nD(t){let e,n=i=>{if(e===void 0){let s=t-i.length;e=s>0?tD(s):eD(-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=Q1(i,["source"]);return(0,Z1.rewireSource)(Object.assign(Object.assign({},o),{source:s.map(r)}))}}fa.default=nD});var Yw=m(pa=>{"use strict";var rD=pa&&pa.__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(pa,"__esModule",{value:!0});var iD=Qn();function sD(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=rD(n,["source"]);return(0,iD.rewireSource)(Object.assign(Object.assign({},i),{source:r.map(e)}))}}pa.default=sD});var Jw=m(il=>{"use strict";Object.defineProperty(il,"__esModule",{value:!0});il.flow=void 0;function oD(...t){return e=>t.reduce((n,r)=>r(n),e)}il.flow=oD});var t0=m(Km=>{"use strict";Object.defineProperty(Km,"__esModule",{value:!0});var aD=Qn(),Zw={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},Qw={lineEnd:"CR"},zm=Object.keys(Zw),e0=t=>(0,aD.isSpace)(t)?`{${t.length}}`:t,uD=t=>"|"+t.join("|")+"|",cD=(t,e)=>Object.keys(e).map(n=>e0(e[n]).padEnd(t[n]));function lD({source:t}){var e,n;if(t.length===0)return"";let r=Object.assign({},Zw);for(let s of zm)r[s]=((e=Qw[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],e0(o[a]).length)}let i=[[],[]];for(let s of zm)i[0].push(((n=Qw[s])!==null&&n!==void 0?n:s).padEnd(r[s]));for(let s of zm)i[1].push("-".padEnd(r[s],"-"));for(let{number:s,tokens:o}of t){let a=s.toString().padStart(r.line);i.push([a,...cD(r,o)])}return i.map(uD).join(`
100
- `)}Km.default=lD});var n0=m(wt=>{"use strict";var dD=wt&&wt.__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]}),fD=wt&&wt.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&dD(e,t,n)};Object.defineProperty(wt,"__esModule",{value:!0});wt.util=wt.tokenizers=wt.transforms=wt.inspect=wt.stringify=wt.parse=void 0;var pD=Gw(),hD=Wm(),mD=Um(),gD=qm(),yD=Fm(),bD=Vw(),_D=Kw(),vD=Xw(),SD=Yw(),TD=Jw(),sl=Qn();fD(Vs(),wt);function wD(t,e={}){return(0,pD.default)(e)(t)}wt.parse=wD;wt.stringify=(0,bD.default)();var ED=t0();Object.defineProperty(wt,"inspect",{enumerable:!0,get:function(){return ED.default}});wt.transforms={flow:TD.flow,align:_D.default,indent:vD.default,crlf:SD.default};wt.tokenizers={tag:gD.default,type:yD.default,name:mD.default,description:hD.default};wt.util={rewireSpecs:sl.rewireSpecs,rewireSource:sl.rewireSource,seedBlock:sl.seedBlock,seedTokens:sl.seedTokens}});var $i=m(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});ha.SignatureDefinitionBaseType=void 0;var AD;(function(t){t.Function="function",t.Number="number",t.String="string",t.Map="map",t.List="list",t.Any="any",t.General="general"})(AD=ha.SignatureDefinitionBaseType||(ha.SignatureDefinitionBaseType={}))});var ma=m(zs=>{"use strict";var r0=zs&&zs.__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(zs,"__esModule",{value:!0});zs.SignatureDefinitionTypeMeta=void 0;var Xt=$i(),xD=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=r0(n,3),o=s[0],a=s[1],u=s[2];if(a===Xt.SignatureDefinitionBaseType.Map?(r=Xt.SignatureDefinitionBaseType.Any,i=Xt.SignatureDefinitionBaseType.Any):a===Xt.SignatureDefinitionBaseType.List&&(r=Xt.SignatureDefinitionBaseType.Any),u){var c=u.split(",").map(function(y){return y.trim()});if(c.length>2)return null;var l=r0(c,2),d=l[0],p=l[1];p!=null?(r=p,i=d):r=d}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===Xt.SignatureDefinitionBaseType.Map?(s=Xt.SignatureDefinitionBaseType.Any,o=Xt.SignatureDefinitionBaseType.Any):i===Xt.SignatureDefinitionBaseType.List&&(s=Xt.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===Xt.SignatureDefinitionBaseType.Map?(s=s??Xt.SignatureDefinitionBaseType.Any,o=o??Xt.SignatureDefinitionBaseType.Any):i===Xt.SignatureDefinitionBaseType.List&&(s=s??Xt.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}();zs.SignatureDefinitionTypeMeta=xD});var Xm=m(ci=>{"use strict";var i0=ci&&ci.__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},s0=ci&&ci.__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(ci,"__esModule",{value:!0});ci.SignatureDefinitionFunctionArg=void 0;var o0=ma(),kD=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(o0.SignatureDefinitionTypeMeta.parse(e.type));else if(e.types)i.push.apply(i,s0([],i0(e.types.map(o0.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 s0([],i0(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}();ci.SignatureDefinitionFunctionArg=kD});var ol=m(fr=>{"use strict";var Bi=fr&&fr.__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},Ui=fr&&fr.__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))},CD=fr&&fr.__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(fr,"__esModule",{value:!0});fr.VariationRegistry=void 0;var OD=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(Ui(Ui([],Bi(e),!1),Bi(this._variations),!1)),this},t.prototype.getAll=function(){return Ui([],Bi(this._variations),!1)},t}(),RD=function(){function t(){}return t.add=function(e,n){var r=new OD(e);return r.push.apply(r,Ui([],Bi(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=CD(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(Ui(Ui([],Bi(c.getAll()),!1),Bi(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 Ui([],Bi(i),!1)},t.variationContainers=new Map,t}();fr.VariationRegistry=RD});var al=m(li=>{"use strict";var DD=li&&li.__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},ID=li&&li.__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(li,"__esModule",{value:!0});li.SignatureDefinition=void 0;var PD=ol(),MD=ma(),LD=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:MD.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 PD.VariationRegistry.resolve(this._variations)},t.prototype.toJSON=function(){return{type:this._type.toJSON(),isProtected:this._isProtected,description:this._description,example:this._example?ID([],DD(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}();li.SignatureDefinition=LD});var Ym=m(In=>{"use strict";var ND=In&&In.__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)}}(),ul=In&&In.__assign||function(){return ul=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},ul.apply(this,arguments)},qD=In&&In.__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},jD=In&&In.__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(In,"__esModule",{value:!0});In.SignatureDefinitionFunction=void 0;var FD=$i(),$D=ol(),BD=al(),UD=Xm(),a0=ma(),HD=function(t){ND(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 a0.SignatureDefinitionTypeMeta({type:FD.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(UD.SignatureDefinitionFunctionArg.parse))!==null&&a!==void 0?a:[],returns:n.returns.map(a0.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 jD([],qD(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=[]),$D.VariationRegistry.resolve(this._returnVariations)},e.prototype.toJSON=function(){return ul(ul({},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}(BD.SignatureDefinition);In.SignatureDefinitionFunction=HD});var c0=m((f2,u0)=>{"use strict";u0.exports=function(...t){try{return JSON.stringify(...t)}catch(e){return"[Cannot display object: "+e.message+"]"}}});var Jm=m((l0,d0)=>{"use strict";var WD=c0();d0.exports=class extends Error{constructor(t){let e=t.filter(n=>n!=="").map(n=>typeof n=="string"?n:n instanceof Error?n.message:WD(n));super(e.join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,l0.assert)}}});var ke=m((h2,f0)=>{"use strict";var GD=Jm();f0.exports=function(t,...e){if(!t)throw e.length===1&&e[0]instanceof Error?e[0]:new GD(e)}});var Hi=m((m2,h0)=>{"use strict";var Qm=ke(),p0={};h0.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);Qm(!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&&p0.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){Qm(!n.strict||o+1===i.length,"Missing segment",a,"in reach path ",e),Qm(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};p0.iterables=function(t){if(t instanceof Set)return"set";if(t instanceof Map)return"map"}});var Zm=m((Yt,g0)=>{"use strict";var m0={};Yt=g0.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};m0.typeMap=new Map([["[object Error]",Yt.error],["[object Map]",Yt.map],["[object Promise]",Yt.promise],["[object Set]",Yt.set],["[object WeakMap]",Yt.weakMap],["[object WeakSet]",Yt.weakSet]]);Yt.getInternalProto=function(t){if(Array.isArray(t))return Yt.array;if(Buffer&&t instanceof Buffer)return Yt.buffer;if(t instanceof Date)return Yt.date;if(t instanceof RegExp)return Yt.regex;if(t instanceof Error)return Yt.error;let e=Object.prototype.toString.call(t);return m0.typeMap.get(e)||Yt.generic}});var eg=m(y0=>{"use strict";y0.keys=function(t,e={}){return e.symbols!==!1?Reflect.ownKeys(t):Object.getOwnPropertyNames(t)}});var Jt=m((y2,b0)=>{"use strict";var VD=Hi(),_n=Zm(),zD=eg(),Rr={needsProtoHack:new Set([_n.set,_n.map,_n.weakSet,_n.weakMap])};b0.exports=Rr.clone=function(t,e={},n=null){if(typeof t!="object"||t===null)return t;let r=Rr.clone,i=n;if(e.shallow){if(e.shallow!==!0)return Rr.cloneWithShallow(t,e);r=u=>u}else if(i){let u=i.get(t);if(u)return u}else i=new Map;let s=_n.getInternalProto(t);if(s===_n.buffer)return Buffer&&Buffer.from(t);if(s===_n.date)return new Date(t.getTime());if(s===_n.regex)return new RegExp(t);let o=Rr.base(t,s,e);if(o===t)return t;if(i&&i.set(t,o),s===_n.set)for(let u of t)o.add(r(u,e,i));else if(s===_n.map)for(let[u,c]of t)o.set(u,r(c,e,i));let a=zD.keys(t,e);for(let u of a){if(u==="__proto__")continue;if(s===_n.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};Rr.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=VD(t,i);(typeof s=="object"||typeof s=="function")&&r.set(s,s)}return Rr.clone(t,e,r)};Rr.base=function(t,e,n){if(n.prototype===!1)return Rr.needsProtoHack.has(e)?new e.constructor:e===_n.array?[]:{};let r=Object.getPrototypeOf(t);if(r&&r.isImmutable)return t;if(e===_n.array){let i=[];return r!==e&&Object.setPrototypeOf(i,r),i}if(Rr.needsProtoHack.has(e)){let i=new r.constructor;return r!==e&&Object.setPrototypeOf(i,r),i}return Object.create(r)}});var _0=m((b2,KD)=>{KD.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 cl=m(ga=>{"use strict";var C=ll(),de={};de.wrap=C.string().min(1).max(2).allow(!1);ga.preferences=C.object({allowUnknown:C.boolean(),abortEarly:C.boolean(),artifacts:C.boolean(),cache:C.boolean(),context:C.object(),convert:C.boolean(),dateFormat:C.valid("date","iso","string","time","utc"),debug:C.boolean(),errors:{escapeHtml:C.boolean(),label:C.valid("path","key",!1),language:[C.string(),C.object().ref()],render:C.boolean(),stack:C.boolean(),wrap:{label:de.wrap,array:de.wrap,string:de.wrap}},externals:C.boolean(),messages:C.object(),noDefaults:C.boolean(),nonEnumerables:C.boolean(),presence:C.valid("required","optional","forbidden"),skipFunctions:C.boolean(),stripUnknown:C.object({arrays:C.boolean(),objects:C.boolean()}).or("arrays","objects").allow(!0,!1),warnings:C.boolean()}).strict();de.nameRx=/^[a-zA-Z0-9]\w*$/;de.rule=C.object({alias:C.array().items(C.string().pattern(de.nameRx)).single(),args:C.array().items(C.string(),C.object({name:C.string().pattern(de.nameRx).required(),ref:C.boolean(),assert:C.alternatives([C.function(),C.object().schema()]).conditional("ref",{is:!0,then:C.required()}),normalize:C.function(),message:C.string().when("assert",{is:C.function(),then:C.required()})})),convert:C.boolean(),manifest:C.boolean(),method:C.function().allow(!1),multi:C.boolean(),validate:C.function()});ga.extension=C.object({type:C.alternatives([C.string(),C.object().regex()]).required(),args:C.function(),cast:C.object().pattern(de.nameRx,C.object({from:C.function().maxArity(1).required(),to:C.function().minArity(1).maxArity(2).required()})),base:C.object().schema().when("type",{is:C.object().regex(),then:C.forbidden()}),coerce:[C.function().maxArity(3),C.object({method:C.function().maxArity(3).required(),from:C.array().items(C.string()).single()})],flags:C.object().pattern(de.nameRx,C.object({setter:C.string(),default:C.any()})),manifest:{build:C.function().arity(2)},messages:[C.object(),C.string()],modifiers:C.object().pattern(de.nameRx,C.function().minArity(1).maxArity(2)),overrides:C.object().pattern(de.nameRx,C.function()),prepare:C.function().maxArity(3),rebuild:C.function().arity(1),rules:C.object().pattern(de.nameRx,de.rule),terms:C.object().pattern(de.nameRx,C.object({init:C.array().allow(null).required(),manifest:C.object().pattern(/.+/,[C.valid("schema","single"),C.object({mapped:C.object({from:C.string().required(),to:C.string().required()}).required()})])})),validate:C.function().maxArity(3)}).strict();ga.extensions=C.array().items(C.object(),C.function().arity(1)).strict();de.desc={buffer:C.object({buffer:C.string()}),func:C.object({function:C.function().required(),options:{literal:!0}}),override:C.object({override:!0}),ref:C.object({ref:C.object({type:C.valid("value","global","local"),path:C.array().required(),separator:C.string().length(1).allow(!1),ancestor:C.number().min(0).integer().allow("root"),map:C.array().items(C.array().length(2)).min(1),adjust:C.function(),iterables:C.boolean(),in:C.boolean(),render:C.boolean()}).required()}),regex:C.object({regex:C.string().min(3)}),special:C.object({special:C.valid("deep").required()}),template:C.object({template:C.string().required(),options:C.object()}),value:C.object({value:C.alternatives([C.object(),C.array()]).required()})};de.desc.entity=C.alternatives([C.array().items(C.link("...")),C.boolean(),C.function(),C.number(),C.string(),de.desc.buffer,de.desc.func,de.desc.ref,de.desc.regex,de.desc.special,de.desc.template,de.desc.value,C.link("/")]);de.desc.values=C.array().items(null,C.boolean(),C.function(),C.number().allow(1/0,-1/0),C.string().allow(""),C.symbol(),de.desc.buffer,de.desc.func,de.desc.override,de.desc.ref,de.desc.regex,de.desc.template,de.desc.value);de.desc.messages=C.object().pattern(/.+/,[C.string(),de.desc.template,C.object().pattern(/.+/,[C.string(),de.desc.template])]);ga.description=C.object({type:C.string().required(),flags:C.object({cast:C.string(),default:C.any(),description:C.string(),empty:C.link("/"),failover:de.desc.entity,id:C.string(),label:C.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:C.boolean(),unit:C.string()}).unknown(),preferences:{allowUnknown:C.boolean(),abortEarly:C.boolean(),artifacts:C.boolean(),cache:C.boolean(),convert:C.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:C.boolean(),label:["path","key"],language:[C.string(),de.desc.ref],wrap:{label:de.wrap,array:de.wrap}},externals:C.boolean(),messages:de.desc.messages,noDefaults:C.boolean(),nonEnumerables:C.boolean(),presence:["required","optional","forbidden"],skipFunctions:C.boolean(),stripUnknown:C.object({arrays:C.boolean(),objects:C.boolean()}).or("arrays","objects").allow(!0,!1),warnings:C.boolean()},allow:de.desc.values,invalid:de.desc.values,rules:C.array().min(1).items({name:C.string().required(),args:C.object().min(1),keep:C.boolean(),message:[C.string(),de.desc.messages],warn:C.boolean()}),keys:C.object().pattern(/.*/,C.link("/")),link:de.desc.ref}).pattern(/^[a-z]\w*$/,C.any())});var S0=m((v2,v0)=>{"use strict";var di={};v0.exports=function(t){if(!t)return"";let e="";for(let n=0;n<t.length;++n){let r=t.charCodeAt(n);di.isSafe(r)?e+=t[n]:e+=di.escapeHtmlChar(r)}return e};di.escapeHtmlChar=function(t){let e=di.namedHtml.get(t);return e||(t>=256?"&#"+t+";":`&#x${t.toString(16).padStart(2,"0")};`)};di.isSafe=function(t){return di.safeCharCodes.has(t)};di.namedHtml=new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[34,"&quot;"],[160,"&nbsp;"],[162,"&cent;"],[163,"&pound;"],[164,"&curren;"],[169,"&copy;"],[174,"&reg;"]]);di.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 T0=m(ya=>{"use strict";var we={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};ya.Parser=class{constructor(t,e={}){if(!e[we.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[we.settings]?e:Object.assign({[we.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 ya.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(we.operatorCharacters.includes(n))u&&u.type==="operator"&&we.operators.includes(u.value+n)?u.value+=n:e.push({type:"operator",value:n});else if(n.match(we.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(we.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 we.literals?i=we.literals[a]:a==="("?(s(),++r):we.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(we.operatorsPrefix.includes(a.value))continue;if(!o)throw new Error("Formula contains an operator in invalid position");if(!we.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 we.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):we.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 we.literals&&!s?(i+=c,o=we.literals[c]):c===","&&!s?a():(i+=c,c==="("?++s:c===")"&&--s)}a()}return r=r.map(i=>new ya.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=we.evaluate(i,t);e[n]=we.single(r.value,s)}}return we.operatorsOrder.forEach(n=>{for(let r=1;r<e.length-1;)if(n.includes(e[r])){let i=e[r],s=we.evaluate(e[r-1],t),o=we.evaluate(e[r+1],t);e.splice(r,2);let a=we.calculate(i,s,o);e[r-1]=a===0?0:a}else r+=2}),we.evaluate(e[0],t)}};ya.Parser.prototype[we.symbol]=!0;we.reference=function(t){return function(e){return e&&e[t]!==void 0?e[t]:null}};we.evaluate=function(t,e){return t===null?null:typeof t=="function"?t(e):t[we.symbol]?t.evaluate(e):t};we.single=function(t,e){if(t==="!")return!e;let n=-e;return n===0?0:n};we.calculate=function(t,e,n){if(t==="??")return we.exists(e)?e:n;if(typeof e=="string"||typeof n=="string"){if(t==="+")return e=we.exists(e)?e:"",n=we.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};we.exists=function(t){return t!=null}});var E0=m(w0=>{"use strict";var XD=Jt(),YD=Ke(),Wi={annotations:Symbol("annotations")};w0.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=XD(this._original);for(let a=this.details.length-1;a>=0;--a){let u=a+1,c=this.details[a],l=c.path,d=i;for(let p=0;;++p){let y=l[p];if(YD.isSchema(d)&&(d=d.clone()),p+1<l.length&&typeof d[y]!="string")d=d[y];else{let v=d[Wi.annotations]||{errors:{},missing:{}};d[Wi.annotations]=v;let x=y||c.context.key;d[y]!==void 0?(v.errors[x]=v.errors[x]||[],v.errors[x].push(u)):v.missing[x]=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=Wi.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}se.createSelectorGroup=ur;function PR(t){return t.selectors}se.getSelectorsFromGroup=PR;var cr;(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"})(cr=se.SelectorGroupType||(se.SelectorGroupType={}));se.SelectorGroups={BlockEndOfLine:ur(cr.AssignmentEndOfExpr,[se.Selectors.EndOfLine,se.Selectors.Comment]),AssignmentEndOfExpr:ur(cr.AssignmentEndOfExpr,[se.Selectors.EndOfFile,se.Selectors.EndOfLine,se.Selectors.Else,se.Selectors.Comment]),AssignmentShorthand:ur(cr.AssignmentShorthand,[se.Selectors.AddShorthand,se.Selectors.SubtractShorthand,se.Selectors.MultiplyShorthand,se.Selectors.DivideShorthand,se.Selectors.PowerShorthand,se.Selectors.ModuloShorthand]),AssignmentCommandArgs:ur(cr.AssignmentCommandArgs,[se.Selectors.ArgumentSeperator,se.Selectors.EndOfLine,se.Selectors.EndOfFile]),ReturnStatementEnd:ur(cr.ReturnStatementEnd,[se.Selectors.EndOfLine,se.Selectors.Else,se.Selectors.Comment]),FunctionDeclarationArgEnd:ur(cr.FunctionDeclarationArgEnd,[se.Selectors.RParenthesis,se.Selectors.EndOfFile]),ComparisonOperators:ur(cr.ComparisonOperators,[se.Selectors.Equal,se.Selectors.NotEqual,se.Selectors.Greater,se.Selectors.GreaterEqual,se.Selectors.Lesser,se.Selectors.LessEqual]),MultiDivOperators:ur(cr.MultiDivOperators,[se.Selectors.Times,se.Selectors.Divide,se.Selectors.Mod]),CallArgsEnd:ur(cr.CallArgsEnd,[se.Selectors.ArgumentSeperator,se.Selectors.RParenthesis])}});var Tm=m(Zc=>{"use strict";Object.defineProperty(Zc,"__esModule",{value:!0});Zc.Stack=void 0;var Sm=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}};Zc.Stack=Sm});var Cm=m(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.PendingWhile=Ve.isPendingWhile=Ve.PendingIf=Ve.isPendingIf=Ve.PendingFunction=Ve.isPendingFunction=Ve.PendingFor=Ve.isPendingFor=Ve.PendingChunk=Ve.isPendingChunk=Ve.PendingBlockType=void 0;var Yn;(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"})(Yn=Ve.PendingBlockType||(Ve.PendingBlockType={}));var ji=class{constructor(e,n){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 MR(t){return t.type===Yn.Chunk}Ve.isPendingChunk=MR;var wm=class extends ji{constructor(e){super(e,Yn.Chunk)}complete(e){this.block.body=this.body,this.block.end=e.end,super.complete(e)}};Ve.PendingChunk=wm;function LR(t){return t.type===Yn.For}Ve.isPendingFor=LR;var Em=class extends ji{constructor(e){super(e,Yn.For)}complete(e){this.block.body=this.body,this.block.end=e.end,super.complete(e)}};Ve.PendingFor=Em;function NR(t){return t.type===Yn.Function}Ve.isPendingFunction=NR;var Am=class extends ji{constructor(e){super(e,Yn.Function)}complete(e){this.block.body=this.body,this.block.end=e.end,super.complete(e)}};Ve.PendingFunction=Am;function qR(t){return t.type===Yn.If}Ve.isPendingIf=qR;var xm=class extends ji{constructor(e,n){super(e,Yn.If),this.currentClause=n}next(e){this.currentClause.body=this.body,this.currentClause.end=e.end,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,super.complete(e)}};Ve.PendingIf=xm;function jR(t){return t.type===Yn.While}Ve.isPendingWhile=jR;var km=class extends ji{constructor(e){super(e,Yn.While)}complete(e){this.block.body=this.body,this.block.end=e.end,super.complete(e)}};Ve.PendingWhile=km});var jw=m(oa=>{"use strict";var qw=oa&&oa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(oa,"__esModule",{value:!0});var FR=qw(ph()),ai=ni(),lr=mm(),$R=qw(bm()),BR=Oc(),Nt=js(),Or=$s(),Kt=Zo(),z=vm(),UR=Tm(),dr=Cm(),Om=class{constructor(e,n={}){let r=this;r.content=e,r.backpatches=new UR.Stack,r.statementErrors=[],r.lexer=n.lexer||new FR.default(e,{unsafe:n.unsafe,tabWidth:n.tabWidth}),r.token=null,r.previousToken=null,r.lines={},r.scopes=[],r.currentScope=null,r.currentAssignment=null,r.outerScopes=[],r.literals=[],r.validator=n.validator||new $R.default,r.astProvider=n.astProvider||new lr.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 Kt.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,z.getSelectorValue)(e)}" is required`,new Kt.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,z.getSelectorsFromGroup)(e).map(i=>`"${(0,z.getSelectorValue)(i)}"`).join(", ")} is required`,new Kt.Range(n||r.start,r.end)),null)}addItemToLines(e){let n=this.lines,r=e.end.line;for(let i=e.start.line;i<=r;i++){let s=n[i];s?s.push(e):n[i]=[e]}}skipNewlines(){let e=this,n=0;for(;;){if(z.Selectors.Comment(e.token)){let r=e.astProvider.comment({value:e.token.value,start:e.token.start,end:e.token.end,scope:e.currentScope});e.addItemToLines(r),e.backpatches.peek().body.push(r)}else if(z.Selectors.EndOfLine(e.token))n++;else break;e.next()}return n}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!==ai.TokenType.EOL&&e.token.type!==ai.TokenType.EOF;e.next());}finishRemaingScopes(){let e=this,n=e.backpatches.pop();for(;!(0,dr.isPendingChunk)(n);){let r=e.raise(`found open block ${n.block.type}`,new Kt.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}),i=new dr.PendingChunk(r);for(e.backpatches.setDefault(i),e.pushScope(r);!z.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!z.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.lines,r}parseStatement(){let e=this;if(ai.TokenType.Keyword===e.token.type&&Nt.Keyword.Not!==e.token.value){e.parseKeyword();return}let n=e.backpatches.peek(),r=e.parseAssignment();r.end!==null&&e.addItemToLines(r),n.body.push(r)}parseKeyword(){let e=this;switch(e.token.value){case Nt.Keyword.Return:{let r=e.backpatches.peek();e.next();let i=e.parseReturnStatement();i.end!==null&&e.addItemToLines(i),r.body.push(i);return}case Nt.Keyword.If:{e.next(),e.parseIfStatement();return}case Nt.Keyword.ElseIf:{e.next(),e.nextIfClause(lr.ASTType.ElseifClause);return}case Nt.Keyword.Else:{e.next(),e.nextIfClause(lr.ASTType.ElseClause);return}case Nt.Keyword.While:{e.next(),e.parseWhileStatement();return}case Nt.Keyword.For:{e.next(),e.parseForStatement();return}case Nt.Keyword.EndFunction:{e.next(),e.finalizeFunction();return}case Nt.Keyword.EndFor:{e.next(),e.finalizeForStatement();return}case Nt.Keyword.EndWhile:{e.next(),e.finalizeWhileStatement();return}case Nt.Keyword.EndIf:{e.next(),e.nextIfClause(null);return}case Nt.Keyword.Continue:{let r=e.backpatches.peek();e.next();let i=e.astProvider.continueStatement({start:e.previousToken.start,end:e.previousToken.end,scope:e.currentScope});e.addItemToLines(i),r.body.push(i);return}case Nt.Keyword.Break:{let r=e.backpatches.peek();e.next();let i=e.astProvider.breakStatement({start:e.previousToken.start,end:e.previousToken.end,scope:e.currentScope});e.addItemToLines(i),r.body.push(i);return}}e.raise(`unexpected keyword ${e.token} at start of line`,new Kt.Range(e.token.start,e.token.end))}parseShortcutStatement(){let e=this;if(ai.TokenType.Keyword===e.token.type&&Nt.Keyword.Not!==e.token.value)switch(e.token.value){case Nt.Keyword.Return:return e.next(),e.parseReturnStatement();case Nt.Keyword.Continue:return e.next(),e.astProvider.continueStatement({start:e.previousToken.start,end:e.previousToken.end,scope:e.currentScope});case Nt.Keyword.Break:return e.next(),e.astProvider.breakStatement({start:e.previousToken.start,end:e.previousToken.end,scope:e.currentScope});default:return e.raise(`unexpected keyword ${e.token} in shorthand statement`,new Kt.Range(e.token.start,e.token.end)),e.parseInvalidCode()}return e.parseAssignment()}parseAssignment(){let e=this,n=e.currentScope,r=e.token.start,i=e.parseExpr(null,!0,!0);if(z.SelectorGroups.AssignmentEndOfExpr(e.token))return i;if(z.Selectors.Assign(e.token)){e.next();let o=e.astProvider.assignmentStatement({variable:i,init:null,start:r,end:null,scope:n}),a=e.currentAssignment;if(e.currentAssignment=o,o.init=e.parseExpr(o),o.end=e.previousToken.end,o.init.type===lr.ASTType.FunctionDeclaration){let u=e.backpatches.peek();u.onComplete=c=>o.end=c.block.end}return e.currentAssignment=a,n.assignments.push(o),o}else if(z.SelectorGroups.AssignmentShorthand(e.token)){let o=e.token;e.next();let a=e.astProvider.assignmentStatement({variable:i,init:null,start:r,end:null,scope:n}),u=e.currentAssignment;e.currentAssignment=a;let c=e.token.start,l=o.value.charAt(0),d=e.parseExpr(a),p=e.astProvider.parenthesisExpression({start:d.start,end:d.end,expression:d});return a.init=e.astProvider.binaryExpression({operator:l,left:i.clone(),right:p,start:c,end:e.previousToken.end,scope:n}),a.end=e.previousToken.end,e.currentAssignment=u,n.assignments.push(a),a}let s=[];for(;!z.Selectors.EndOfFile(e.token);){let o=e.parseExpr(null);if(s.push(o),z.SelectorGroups.BlockEndOfLine(e.token)||z.Selectors.Else(e.token))break;if(z.Selectors.ArgumentSeperator(e.token)){e.next(),e.skipNewlines();continue}let a=e.requireTokenOfAny(z.SelectorGroups.AssignmentCommandArgs,r);if(z.Selectors.EndOfLine(a)||z.Selectors.EndOfFile(a))break}return s.length===0?e.astProvider.callStatement({expression:i,start:r,end:e.previousToken.end,scope:n}):e.astProvider.callStatement({expression:e.astProvider.callExpression({base:i,arguments:s,start:r,end:e.previousToken.end,scope:n}),start:r,end:e.previousToken.end,scope:n})}parseReturnStatement(){let e=this,n=e.currentScope,r=e.previousToken.start,i=null,s=e.astProvider.returnStatement({argument:null,start:r,end:null,scope:n});if(z.SelectorGroups.ReturnStatementEnd(e.token))s.end=e.previousToken.end;else{if(i=e.parseExpr(s),i.type===lr.ASTType.FunctionDeclaration){let o=e.backpatches.peek();o.onComplete=a=>s.end=a.block.end}else s.end=e.previousToken.end;s.argument=i}return n.returns.push(s),s}parseIfStatement(){let e=this,n=e.previousToken.start,r=e.parseExpr(null);if(e.addItemToLines(r),e.requireToken(z.Selectors.Then,n),!z.SelectorGroups.BlockEndOfLine(e.token)){e.parseIfShortcutStatement(r,n);return}let i=e.astProvider.ifStatement({clauses:[],start:n,end:null,scope:e.currentScope}),s=e.astProvider.ifClause({condition:r,start:n,end:e.token.end,scope:e.currentScope}),o=new dr.PendingIf(i,s);e.backpatches.push(o)}nextIfClause(e){let n=this,r=n.backpatches.peek();if(!(0,dr.isPendingIf)(r)){n.raise("no matching open if block",new Kt.Range(n.token.start,n.token.end));return}switch(r.next(n.previousToken),e){case lr.ASTType.ElseifClause:{let i=n.token.start,s=n.parseExpr(null);n.requireToken(z.Selectors.Then,i),r.currentClause=n.astProvider.elseifClause({condition:s,start:i,end:null,scope:n.currentScope});break}case lr.ASTType.ElseClause:{let i=n.token.start;r.currentClause=n.astProvider.elseClause({start:i,end:null,scope:n.currentScope});break}}e===null&&(r.complete(n.previousToken),n.addItemToLines(r.block),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,end:null,scope:r.currentScope}),a=r.parseShortcutStatement();if(i.push(r.astProvider.ifShortcutClause({condition:e,body:[a],start:n,end:r.token.end,scope:r.currentScope})),z.Selectors.Else(r.token)){r.next();let u=r.token.start,c=r.parseShortcutStatement();i.push(r.astProvider.elseShortcutClause({body:[c],start:u,end:r.token.end,scope:r.currentScope}))}o.end=r.token.end,r.addItemToLines(o),s.body.push(o)}parseWhileStatement(){let e=this,n=e.previousToken.start,r=e.parseExpr(null);if(!r){e.raise("while requires a condition",new Kt.Range(n,e.token.end));return}if(!z.SelectorGroups.BlockEndOfLine(e.token))return e.parseWhileShortcutStatement(r,n);let i=e.astProvider.whileStatement({condition:r,start:n,end:null,scope:e.currentScope}),s=new dr.PendingWhile(i);e.backpatches.push(s),s.onComplete=o=>{e.addItemToLines(o.block),e.backpatches.pop(),e.backpatches.peek().body.push(o.block)}}finalizeWhileStatement(){let e=this,n=e.backpatches.peek();if(!(0,dr.isPendingWhile)(n)){e.raise("no matching open while block",new Kt.Range(e.token.start,e.token.end));return}n.complete(e.previousToken)}parseWhileShortcutStatement(e,n){let r=this,i=r.backpatches.peek(),s=r.parseShortcutStatement(),o=r.astProvider.whileStatement({condition:e,body:[s],start:n,end:r.previousToken.end,scope:r.currentScope});r.addItemToLines(o),i.body.push(o)}parseForStatement(){let e=this,n=e.currentScope,r=e.previousToken.start,i=e.parseIdentifier(),s=e.astProvider.assignmentStatement({variable:i,init:e.astProvider.unknown({start:i.start,end:i.end,scope:n}),start:i.start,end:i.end,scope:n}),o=e.astProvider.assignmentStatement({variable:e.astProvider.identifier({name:`__${i.name}_idx`,start:i.start,end:i.end,scope:n}),init:e.astProvider.literal(ai.TokenType.NumericLiteral,{value:0,raw:"0",start:i.start,end:i.end,scope:n}),start:i.start,end:i.end,scope:n});n.assignments.push(s,o),e.requireToken(z.Selectors.In,r);let a=e.parseExpr(null);if(!a){e.raise("sequence expression expected for 'for' loop",new Kt.Range(r,e.token.end));return}if(!z.SelectorGroups.BlockEndOfLine(e.token))return e.parseForShortcutStatement(i,a,r);let u=e.astProvider.forGenericStatement({variable:i,iterator:a,start:r,end:e.previousToken.end,scope:n}),c=new dr.PendingFor(u);e.backpatches.push(c)}finalizeForStatement(){let e=this,n=e.backpatches.peek();if(!(0,dr.isPendingFor)(n)){e.raise("no matching open for block",new Kt.Range(e.token.start,e.token.end));return}n.complete(e.previousToken),e.addItemToLines(n.block),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,end:i.previousToken.end,scope:i.currentScope});i.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(!z.Selectors.Function(i.token))return i.parseOr(n,r);i.next();let s=i.previousToken.start,o=i.astProvider.functionStatement({start:s,end:null,scope:i.currentScope,parent:i.outerScopes[i.outerScopes.length-1],assignment:i.currentAssignment}),a=[];if(i.pushScope(o),!z.SelectorGroups.BlockEndOfLine(i.token)){for(i.requireToken(z.Selectors.LParenthesis,s);!z.SelectorGroups.FunctionDeclarationArgEnd(i.token);){let c=i.parseIdentifier(),l=c.start;if(i.consume(z.Selectors.Assign)){let d=i.parseExpr(null);if(d instanceof lr.ASTLiteral){let p=i.astProvider.assignmentStatement({variable:c,init:d,start:l,end:i.previousToken.end,scope:i.currentScope});i.currentScope.assignments.push(p),a.push(p)}else i.raise("parameter default value must be a literal value",new Kt.Range(l,i.token.end)),a.push(i.astProvider.invalidCodeExpression({start:l,end:i.previousToken.end}))}else{let d=i.astProvider.assignmentStatement({variable:c,init:i.astProvider.unknown({start:l,end:i.previousToken.end,scope:i.currentScope}),start:l,end:i.previousToken.end,scope:i.currentScope});i.currentScope.assignments.push(d),a.push(c)}if(z.Selectors.RParenthesis(i.token))break;if(i.requireToken(z.Selectors.ArgumentSeperator,s),z.Selectors.RParenthesis(i.token)){i.raise("expected argument instead received right parenthesis",new Kt.Range(i.previousToken.end,i.previousToken.end));break}}i.requireToken(z.Selectors.RParenthesis,s)}o.parameters=a;let u=new dr.PendingFunction(o);return i.backpatches.push(u),u.onComplete=c=>{e!==null?(e.end=c.block.end,i.addItemToLines(e)):i.addItemToLines(c.block)},o}finalizeFunction(){let e=this,n=e.backpatches.peek();if(!(0,dr.isPendingFunction)(n)){e.raise("no matching open function block",new Kt.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.start,o=r.parseAnd(e,n);for(;z.Selectors.Or(r.token);){r.next(),r.skipNewlines();let a=r.parseAnd();o=r.astProvider.logicalExpression({operator:Or.Operator.Or,left:o,right:a,start:i,end:r.previousToken.end,scope:r.currentScope})}return o}parseAnd(e=!1,n=!1){let r=this,i=r.token.start,o=r.parseNot(e,n);for(;z.Selectors.And(r.token);){r.next(),r.skipNewlines();let a=r.parseNot();o=r.astProvider.logicalExpression({operator:Or.Operator.And,left:o,right:a,start:i,end:r.previousToken.end,scope:r.currentScope})}return o}parseNot(e=!1,n=!1){let r=this,i=r.token.start;if(z.Selectors.Not(r.token)){r.next(),r.skipNewlines();let s=r.parseIsa();return r.astProvider.unaryExpression({operator:Or.Operator.Not,argument:s,start:i,end:r.previousToken.end,scope:r.currentScope})}return r.parseIsa(e,n)}parseIsa(e=!1,n=!1){let r=this,i=r.token.start,s=r.parseComparisons(e,n);if(z.Selectors.Isa(r.token)){r.next(),r.skipNewlines();let o=r.parseComparisons();return r.astProvider.isaExpression({operator:Or.Operator.Isa,left:s,right:o,start:i,end:r.previousToken.end,scope:r.currentScope})}return s}parseComparisons(e=!1,n=!1){let r=this,i=r.token.start,s=r.parseAddSub(e,n);if(!z.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(z.SelectorGroups.ComparisonOperators(r.token));return a.length===1?r.astProvider.binaryExpression({operator:a[0],left:o[0],right:o[1],start:i,end:r.previousToken.end,scope:r.currentScope}):r.astProvider.comparisonGroupExpression({operators:a,expressions:o,start:i,end:r.previousToken.end,scope:r.currentScope})}parseAddSub(e=!1,n=!1){let r=this,i=r.token.start,o=r.parseMultDiv(e,n);for(;z.Selectors.Plus(r.token)||z.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,end:r.previousToken.end,scope:r.currentScope})}return o}parseMultDiv(e=!1,n=!1){let r=this,i=r.token.start,o=r.parseUnaryMinus(e,n);for(;z.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,end:r.previousToken.end,scope:r.currentScope})}return o}parseUnaryMinus(e=!1,n=!1){let r=this;if(!z.Selectors.Minus(r.token))return r.parseNew(e,n);let i=r.token.start;r.next(),r.skipNewlines();let s=r.parseNew();return s instanceof lr.ASTNumericLiteral||s instanceof lr.ASTBooleanLiteral?(s.negated=!0,s):r.astProvider.unaryExpression({operator:Or.Operator.Minus,argument:s,start:i,end:r.previousToken.end,scope:r.currentScope})}parseNew(e=!1,n=!1){let r=this;if(!z.Selectors.New(r.token))return r.parseAddressOf(e,n);let i=r.token.start;r.next(),r.skipNewlines();let s=r.parseNew();return r.astProvider.unaryExpression({operator:Or.Operator.New,argument:s,start:i,end:r.previousToken.end,scope:r.currentScope})}parseAddressOf(e=!1,n=!1){let r=this;if(!z.Selectors.Reference(r.token))return r.parsePower(e,n);let i=r.token.start;r.next(),r.skipNewlines();let s=r.parsePower();return r.astProvider.unaryExpression({operator:Or.Operator.Reference,argument:s,start:i,end:r.previousToken.end,scope:r.currentScope})}parsePower(e=!1,n=!1){let r=this,i=r.token.start,s=r.parseCallExpr(e,n);if(z.Selectors.Power(r.token)){r.next(),r.skipNewlines();let o=r.parseCallExpr();return r.astProvider.binaryExpression({operator:Or.Operator.Power,left:s,right:o,start:i,end:r.previousToken.end,scope:r.currentScope})}return s}parseCallExpr(e=!1,n=!1){let r=this,i=r.token.start,s=r.parseMap(e,n);for(;!z.Selectors.EndOfFile(r.token);)if(z.Selectors.MemberSeperator(r.token)){r.next(),r.skipNewlines();let o=r.parseIdentifier();s=r.astProvider.memberExpression({base:s,indexer:Or.Operator.Member,identifier:o,start:i,end:r.previousToken.end,scope:r.currentScope})}else if(z.Selectors.SLBracket(r.token)&&!r.token.afterSpace){if(r.next(),r.skipNewlines(),z.Selectors.SliceSeperator(r.token)){let o=r.astProvider.emptyExpression({start:r.previousToken.start,end:r.previousToken.end,scope:r.currentScope});r.next(),r.skipNewlines();let a=z.Selectors.SRBracket(r.token)?r.astProvider.emptyExpression({start:r.previousToken.start,end:r.previousToken.end,scope:r.currentScope}):r.parseExpr(null);s=r.astProvider.sliceExpression({base:s,left:o,right:a,start:i,end:r.token.end,scope:r.currentScope})}else{let o=r.parseExpr(null);if(z.Selectors.SliceSeperator(r.token)){r.next(),r.skipNewlines();let a=z.Selectors.SRBracket(r.token)?r.astProvider.emptyExpression({start:r.previousToken.start,end:r.previousToken.end,scope:r.currentScope}):r.parseExpr(null);s=r.astProvider.sliceExpression({base:s,left:o,right:a,start:i,end:r.token.end,scope:r.currentScope})}else s=r.astProvider.indexExpression({base:s,index:o,start:i,end:r.token.end,scope:r.currentScope})}r.requireToken(z.Selectors.SRBracket,i)}else if(z.Selectors.LParenthesis(r.token)&&(!e||!r.token.afterSpace)){let o=r.parseCallArgs();s=r.astProvider.callExpression({base:s,arguments:o,start:i,end:r.previousToken.end,scope:r.currentScope})}else break;return s}parseCallArgs(){let e=this,n=[];if(z.Selectors.LParenthesis(e.token))if(e.next(),z.Selectors.RParenthesis(e.token))e.next();else for(;!z.Selectors.EndOfFile(e.token);){e.skipNewlines();let r=e.parseExpr(null);if(n.push(r),e.skipNewlines(),z.Selectors.RParenthesis(e.requireTokenOfAny(z.SelectorGroups.CallArgsEnd,r.start)))break}return n}parseMap(e=!1,n=!1){let r=this;if(!z.Selectors.CLBracket(r.token))return r.parseList(e,n);let i=r.currentScope,s=r.token.start,o=[],a=r.astProvider.mapConstructorExpression({fields:o,start:s,end:null,scope:i});if(r.next(),z.Selectors.CRBracket(r.token))r.next();else for(r.skipNewlines();!z.Selectors.EndOfFile(r.token);){if(z.Selectors.CRBracket(r.token)){r.next();break}let u=r.astProvider.mapKeyString({key:null,value:null,start:r.token.start,end:null,scope:i});if(u.key=r.parseExpr(null),r.requireToken(z.Selectors.MapKeyValueSeperator),r.skipNewlines(),r.currentAssignment){let c=r.astProvider.assignmentStatement({variable:r.astProvider.indexExpression({index:u.key,base:r.currentAssignment.variable,start:u.start,end:r.token.end,scope:i}),init:null,start:u.start,end:null}),l=r.currentAssignment;r.currentAssignment=c,u.value=r.parseExpr(u),r.currentAssignment=l,c.init=u.value,c.end=r.previousToken.end,i.assignments.push(c)}else u.value=r.parseExpr(u);if(u.end=r.previousToken.end,o.push(u),z.Selectors.MapSeperator(r.token)&&(r.next(),r.skipNewlines()),z.Selectors.CRBracket(r.token)){r.next();break}}return a.end=r.token.start,a}parseList(e=!1,n=!1){let r=this;if(!z.Selectors.SLBracket(r.token))return r.parseQuantity(e,n);let i=r.currentScope,s=r.token.start,o=[],a=r.astProvider.listConstructorExpression({fields:o,start:s,end:null,scope:i});if(r.next(),z.Selectors.SRBracket(r.token))r.next();else for(r.skipNewlines();!z.Selectors.EndOfFile(r.token);){if(z.Selectors.SRBracket(r.token)){r.next();break}let u=r.astProvider.listValue({value:null,start:r.token.start,end:null,scope:i});if(r.currentAssignment){let c=r.astProvider.assignmentStatement({variable:r.astProvider.indexExpression({index:r.astProvider.literal(ai.TokenType.NumericLiteral,{value:o.length,raw:`${o.length}`,start:s,end:r.token.end,scope:i}),base:r.currentAssignment.variable,start:null,end:null,scope:i}),init:null,start:null,end:null}),l=r.currentAssignment,d=r.token;r.currentAssignment=l,u.value=r.parseExpr(u),r.currentAssignment=l,c.variable.start=d.start,c.variable.end=r.previousToken.end,c.init=u.value,c.start=u.start,c.end=r.previousToken.end,i.assignments.push(c)}else u.value=r.parseExpr(u);if(u.end=r.previousToken.end,o.push(u),z.Selectors.MapSeperator(r.token)&&(r.next(),r.skipNewlines()),z.Selectors.SRBracket(r.token)){r.next();break}}return a.end=r.token.start,a}parseQuantity(e=!1,n=!1){let r=this;if(!z.Selectors.LParenthesis(r.token))return r.parseAtom(e,n);let i=r.token.start;r.next(),r.skipNewlines();let s=r.parseExpr(null);return r.requireToken(z.Selectors.RParenthesis,i),r.astProvider.parenthesisExpression({expression:s,start:i,end:r.previousToken.end,scope:r.currentScope})}parseAtom(e=!1,n=!1){let r=this;return r.validator.isLiteral(r.token.type)?r.parseLiteral():r.isType(ai.TokenType.Identifier)?r.parseIdentifier():(r.raise(`got ${r.token} where number, string, or identifier is required`,new Kt.Range(r.token.start,r.token.end)),r.parseInvalidCode())}parseLiteral(){let e=this,n=e.token.start,r=e.token.type,i=e.astProvider.literal(r,{value:e.token.value,raw:e.token.raw,start:n,end:e.token.end,scope:e.currentScope});return e.literals.push(i),e.next(),i}parseIdentifier(){let e=this,n=e.token.start,r=e.token.end,i=e.requireType(ai.TokenType.Identifier);return i===null?e.parseInvalidCode():(e.currentScope.namespaces.add(i.value),e.astProvider.identifier({name:i.value,start:n,end:r,scope:e.currentScope}))}parseInvalidCode(){let e=this,n=e.token.start,r=e.token.end,i=e.astProvider.invalidCodeExpression({start:n,end:r});return e.next(),i}raise(e,n){let r=this,i=new BR.ParserException(e,n);return r.statementErrors.push(i),i}};oa.default=Om});var je=m(Oe=>{"use strict";var HR=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]}),Jn=Oe&&Oe.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&HR(e,t,n)},el=Oe&&Oe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Oe,"__esModule",{value:!0});Oe.ASTRange=Oe.ASTPosition=Oe.ParserValidatorm=Oe.Parser=Oe.LexerValidator=Oe.Lexer=void 0;var WR=ph();Object.defineProperty(Oe,"Lexer",{enumerable:!0,get:function(){return el(WR).default}});Jn(ni(),Oe);var GR=rh();Object.defineProperty(Oe,"LexerValidator",{enumerable:!0,get:function(){return el(GR).default}});var VR=jw();Object.defineProperty(Oe,"Parser",{enumerable:!0,get:function(){return el(VR).default}});Jn(mm(),Oe);var zR=bm();Object.defineProperty(Oe,"ParserValidatorm",{enumerable:!0,get:function(){return el(zR).default}});Jn(Cm(),Oe);Jn(Tm(),Oe);Jn(lh(),Oe);Jn(Cc(),Oe);Jn(Oc(),Oe);Jn(js(),Oe);Jn(oh(),Oe);Jn($s(),Oe);var KR=zo();Object.defineProperty(Oe,"ASTPosition",{enumerable:!0,get:function(){return KR.Position}});var XR=Zo();Object.defineProperty(Oe,"ASTRange",{enumerable:!0,get:function(){return XR.Range}});Jn(vm(),Oe)});var aa=m(tl=>{"use strict";Object.defineProperty(tl,"__esModule",{value:!0});tl.isValidIdentifierLiteral=void 0;var YR=je(),JR=t=>{if(t.type!==YR.ASTType.StringLiteral)return!1;let e=t.value.toString();return/^[_a-z][_a-z0-9]*$/i.test(e)};tl.isValidIdentifierLiteral=JR});var Rm=m(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.getStringHashCode=ui.getHashCode=ui.rotateBits=void 0;function QR(t){return t>>1|t<<31}ui.rotateBits=QR;function ZR(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=ZR;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 Fw=m(nl=>{"use strict";Object.defineProperty(nl,"__esModule",{value:!0});nl.createExpressionHash=void 0;var He=je(),pt=Rm(),e1=aa(),qt=(t,e)=>t.$$hash=e,t1=t=>t.$$hash??null;function et(t){let e=t1(t);if(e!==null)return e;let n=(0,pt.getStringHashCode)(t.type);switch(t.type){case He.ASTType.BinaryExpression:{let r=t;return n^=(0,pt.getStringHashCode)(r.operator),n^=et(r.left),n^=et(r.right),qt(t,n)}case He.ASTType.LogicalExpression:{let r=t;return n^=(0,pt.getStringHashCode)(r.operator),n^=et(r.left),n^=et(r.right),qt(t,n)}case He.ASTType.IsaExpression:{let r=t;return n^=(0,pt.getStringHashCode)(r.operator),n^=et(r.left),n^=et(r.right),qt(t,n)}case He.ASTType.ComparisonGroupExpression:{let r=t;for(let i=0;i<r.expressions.length;i++)n^=et(r.expressions[i]);for(let i=0;i<r.operators.length;i++)n^=(0,pt.getStringHashCode)(r.operators[i]);return qt(t,n)}case He.ASTType.FunctionDeclaration:{let r=t;n^=(0,pt.getHashCode)(r.parameters.length);for(let i=0;i<r.parameters.length;i++){let s=r.parameters[i];if(s.type===He.ASTType.Identifier){n^=(0,pt.getStringHashCode)(s.name);continue}let o=s;n^=(0,pt.getStringHashCode)(o.variable.name),n^=et(o.init)}return qt(t,n)}case He.ASTType.ParenthesisExpression:return et(t.expression);case He.ASTType.MemberExpression:{let r=t;if(r.base.type===He.ASTType.Identifier){let i=r.base.name;if(i==="globals"||i==="locals"||i==="outer")return n=(0,pt.getStringHashCode)(He.ASTType.Identifier),n^=(0,pt.getStringHashCode)(r.identifier.name),qt(t,n)}return n^=et(r.base),n^=et(r.identifier),qt(t,n)}case He.ASTType.IndexExpression:{let r=t;if((0,e1.isValidIdentifierLiteral)(r.index)){if(r.base.type===He.ASTType.Identifier){let s=r.base.name;if(s==="globals"||s==="locals"||s==="outer")return n=(0,pt.getStringHashCode)(He.ASTType.Identifier),n^=(0,pt.getStringHashCode)(r.index.value.toString()),qt(t,n)}n=(0,pt.getStringHashCode)(He.ASTType.MemberExpression),n^=et(r.base);let i=(0,pt.getStringHashCode)(He.ASTType.Identifier);i^=(0,pt.getStringHashCode)(r.index.value.toString()),n^=i}else n^=et(r.base),n^=et(r.index);return qt(t,n)}case He.ASTType.CallExpression:{let r=t;n^=et(r.base),n^=(0,pt.getHashCode)(r.arguments.length);for(let i=0;i<r.arguments.length;i++){let s=r.arguments[i];n^=et(s)}return qt(t,n)}case He.ASTType.NegationExpression:case He.ASTType.BinaryNegatedExpression:case He.ASTType.UnaryExpression:{let r=t;return n^=r.operator?(0,pt.getStringHashCode)(r.operator):1,n^=et(r.argument),qt(t,n)}case He.ASTType.Identifier:{let r=t;return n^=(0,pt.getStringHashCode)(r.name),qt(t,n)}case He.ASTType.NumericLiteral:case He.ASTType.StringLiteral:case He.ASTType.NilLiteral:return n^=(0,pt.getStringHashCode)(t.value.toString()),qt(t,n);case He.ASTType.MapConstructorExpression:{let r=t;n^=(0,pt.getHashCode)(r.fields.length);for(let i=0;i<r.fields.length;i++){let s=r.fields[i];n^=et(s.key),n^=et(s.value)}return qt(t,n)}case He.ASTType.ListConstructorExpression:{let r=t;n^=(0,pt.getHashCode)(r.fields.length);for(let i=0;i<r.fields.length;i++){let s=r.fields[i];n^=et(s.value)}return qt(t,n)}case He.ASTType.SliceExpression:{let r=t;return n^=et(r.base),n^=et(r.left),n^=et(r.right),qt(t,n)}}return console.warn(`Unexpected ast type ${t.type} in hash handler!`),qt(t,n)}function n1(t){return et(t)}nl.createExpressionHash=n1});var Dm=m(rl=>{"use strict";Object.defineProperty(rl,"__esModule",{value:!0});rl.createExpressionId=void 0;var _t=je(),r1=aa(),Tt=(t,e)=>t.$$id=e,i1=t=>t.$$id??null;function ze(t){let e=i1(t);if(e!==null)return e;switch(t.type){case _t.ASTType.BinaryExpression:{let n=t;return Tt(t,ze(n.left)+n.operator+ze(n.right))}case _t.ASTType.LogicalExpression:{let n=t;return Tt(t,ze(n.left)+n.operator+ze(n.right))}case _t.ASTType.IsaExpression:{let n=t;return Tt(t,ze(n.left)+n.operator+ze(n.right))}case _t.ASTType.ComparisonGroupExpression:{let n=t,r=n.expressions.map(s=>ze(s)),i=[r[0]];for(let s=0;s<n.operators.length;s++)i.push(n.operators[s],r[s+1]);return Tt(t,i.join(" "))}case _t.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===_t.ASTType.Identifier){i.push(o.name);continue}let a=o;i.push(a.variable.name+"="+ze(a.init))}return i.length>0&&(r+="("+i.join(",")+")"),Tt(t,r)}case _t.ASTType.ParenthesisExpression:return Tt(t,ze(t.expression));case _t.ASTType.MemberExpression:{let n=t;return Tt(t,ze(n.base)+"."+n.identifier.name)}case _t.ASTType.IndexExpression:{let n=t;return(0,r1.isValidIdentifierLiteral)(n.index)?Tt(t,ze(n.base)+"."+n.index.value.toString()):Tt(t,ze(n.base)+"["+ze(n.index)+"]")}case _t.ASTType.CallExpression:{let n=t,r=ze(n.base),i=[];for(let s=0;s<n.arguments.length;s++){let o=n.arguments[s];i.push(ze(o))}return i.length>0&&(r+="("+i.join(",")+")"),Tt(t,r)}case _t.ASTType.NegationExpression:case _t.ASTType.BinaryNegatedExpression:case _t.ASTType.UnaryExpression:{let n=t;return n.operator==null?Tt(t,ze(n.argument)):n.operator==="@"?Tt(t,n.operator+ze(n.argument)):Tt(t,n.operator+" "+ze(n.argument))}case _t.ASTType.Identifier:return Tt(t,t.name);case _t.ASTType.NumericLiteral:case _t.ASTType.StringLiteral:case _t.ASTType.NilLiteral:return Tt(t,t.raw.toString());case _t.ASTType.MapConstructorExpression:{let n=t,r=[];for(let i=0;i<n.fields.length;i++){let s=n.fields[i];r.push(ze(s.key)+":"+ze(s.value))}return Tt(t,"{"+r.join(",")+"}")}case _t.ASTType.ListConstructorExpression:{let n=t,r=[];for(let i=0;i<n.fields.length;i++){let s=n.fields[i];r.push(ze(s.value))}return Tt(t,"["+r.join(",")+"]")}case _t.ASTType.SliceExpression:{let n=t;return Tt(t,ze(n.base)+"["+ze(n.left)+":"+ze(n.right)+"]")}}return console.warn(`Unexpected ast type ${t.type} in hash handler!`),Tt(t,"")}function s1(t){return ze(t)}rl.createExpressionId=s1});var Vs=m(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});ua.Markers=void 0;var o1;(function(t){t.start="/**",t.nostart="/***",t.delim="*",t.end="*/"})(o1=ua.Markers||(ua.Markers={}))});var Qn=m(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.rewireSpecs=at.rewireSource=at.seedTokens=at.seedSpec=at.seedBlock=at.splitLines=at.splitSpace=at.splitCR=at.hasCR=at.isSpace=void 0;function a1(t){return/^\s+$/.test(t)}at.isSpace=a1;function u1(t){return/\r$/.test(t)}at.hasCR=u1;function c1(t){let e=t.match(/\r+$/);return e==null?["",t]:[t.slice(-e[0].length),t.slice(0,-e[0].length)]}at.splitCR=c1;function l1(t){let e=t.match(/^\s+/);return e==null?["",t]:[t.slice(0,e[0].length),t.slice(e[0].length)]}at.splitSpace=l1;function d1(t){return t.split(/\n/)}at.splitLines=d1;function f1(t={}){return Object.assign({description:"",tags:[],source:[],problems:[]},t)}at.seedBlock=f1;function p1(t={}){return Object.assign({tag:"",name:"",type:"",optional:!1,description:"",problems:[],source:[]},t)}at.seedSpec=p1;function h1(t={}){return Object.assign({start:"",delimiter:"",postDelimiter:"",tag:"",postTag:"",name:"",postName:"",type:"",postType:"",description:"",end:"",lineEnd:""},t)}at.seedTokens=h1;function m1(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}at.rewireSource=m1;function g1(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}at.rewireSpecs=g1});var $w=m(Im=>{"use strict";Object.defineProperty(Im,"__esModule",{value:!0});var y1=/^@\S+/;function b1({fence:t="```"}={}){let e=_1(t),n=(r,i)=>e(r)?!i:i;return function(i){let s=[[]],o=!1;for(let a of i)y1.test(a.tokens.description)&&!o?s.push([a]):s[s.length-1].push(a),o=n(a.tokens.description,o);return s}}Im.default=b1;function _1(t){return typeof t=="string"?e=>e.split(t).length%2===0:t}});var Bw=m(Pm=>{"use strict";Object.defineProperty(Pm,"__esModule",{value:!0});var v1=Vs(),ca=Qn();function S1({startLine:t=0,markers:e=v1.Markers}={}){let n=null,r=t;return function(s){let o=s,a=(0,ca.seedTokens)();if([a.lineEnd,o]=(0,ca.splitCR)(o),[a.start,o]=(0,ca.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,ca.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,ca.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}}Pm.default=S1});var Uw=m(Mm=>{"use strict";Object.defineProperty(Mm,"__esModule",{value:!0});var T1=Qn();function w1({tokenizers:t}){return function(n){var r;let i=(0,T1.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}}Mm.default=w1});var Nm=m(Lm=>{"use strict";Object.defineProperty(Lm,"__esModule",{value:!0});function E1(){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)}}Lm.default=E1});var jm=m(qm=>{"use strict";Object.defineProperty(qm,"__esModule",{value:!0});var A1=Qn();function x1(t="compact"){let e=C1(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,A1.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}}qm.default=x1;var k1=t=>t.trim();function C1(t){return t==="compact"?e=>e.map(k1).join(""):t==="preserve"?e=>e.join(`
97
+ `):t}});var Bm=m($m=>{"use strict";Object.defineProperty($m,"__esModule",{value:!0});var Fm=Qn(),O1=t=>t&&t.startsWith('"')&&t.endsWith('"');function R1(){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,Fm.splitSpace)(r.slice(n.name.length)),e;let s=0,o="",a=!1,u;for(let l of r){if(s===0&&(0,Fm.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(!O1(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,Fm.splitSpace)(r.slice(n.name.length)),e}}$m.default=R1});var Hm=m(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});la.getJoiner=void 0;var Um=Vs();function D1(t="compact",e=Um.Markers){let n=Hw(t);return r=>(r.description=n(r.source,e),r)}la.default=D1;function Hw(t){return t==="compact"?I1:t==="preserve"?L1:t}la.getJoiner=Hw;function I1(t,e=Um.Markers){return t.map(({tokens:{description:n}})=>n.trim()).filter(n=>n!=="").join(" ")}var P1=(t,{tokens:e},n)=>e.type===""?t:n,M1=({tokens:t})=>(t.delimiter===""?t.start:t.postDelimiter.slice(1))+t.description;function L1(t,e=Um.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(P1,0)),t.map(M1).join(`
98
+ `)}});var Gw=m(Wm=>{"use strict";Object.defineProperty(Wm,"__esModule",{value:!0});var N1=Vs(),q1=Qn(),j1=$w(),F1=Bw(),$1=Uw(),B1=Nm(),U1=jm(),H1=Bm(),Ww=Hm();function W1({startLine:t=0,fence:e="```",spacing:n="compact",markers:r=N1.Markers,tokenizers:i=[(0,B1.default)(),(0,U1.default)(n),(0,H1.default)(),(0,Ww.default)(n)]}={}){if(t<0||t%1>0)throw new Error("Invalid startLine");let s=(0,F1.default)({startLine:t,markers:r}),o=(0,j1.default)({fence:e}),a=(0,$1.default)({tokenizers:i}),u=(0,Ww.getJoiner)(n);return function(c){let l=[];for(let d of(0,q1.splitLines)(c)){let p=s(d);if(p===null)continue;let y=o(p),v=y.slice(1).map(a);l.push({description:u(y[0],r),tags:v,source:p,problems:v.reduce((x,I)=>x.concat(I.problems),[])})}return l}}Wm.default=W1});var Vw=m(Gm=>{"use strict";Object.defineProperty(Gm,"__esModule",{value:!0});function G1(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 V1(){return t=>t.source.map(({tokens:e})=>G1(e)).join(`
99
+ `)}Gm.default=V1});var Kw=m(da=>{"use strict";var z1=da&&da.__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(da,"__esModule",{value:!0});var zw=Vs(),K1=Qn(),X1={start:0,tag:0,type:0,name:0},Y1=(t=zw.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)}),Fi=t=>"".padStart(t," ");function J1(t=zw.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=Fi(n.start+1),Object.assign(Object.assign({},i),{tokens:s});switch(s.delimiter){case t.start:s.start=Fi(n.start);break;case t.delim:s.start=Fi(n.start+1);break;default:s.delimiter="",s.start=Fi(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=Fi(n.tag-s.tag.length+1)),a.type||(s.postType=Fi(n.type-s.type.length+1)),a.name||(s.postName=Fi(n.name-s.name.length+1)),Object.assign(Object.assign({},i),{tokens:s})}return i=>{var{source:s}=i,o=z1(i,["source"]);return n=s.reduce(Y1(t),Object.assign({},X1)),(0,K1.rewireSource)(Object.assign(Object.assign({},o),{source:s.map(r)}))}}da.default=J1});var Xw=m(fa=>{"use strict";var Q1=fa&&fa.__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(fa,"__esModule",{value:!0});var Z1=Qn(),eD=t=>e=>e.slice(t),tD=t=>{let e="".padStart(t," ");return n=>n+e};function nD(t){let e,n=i=>{if(e===void 0){let s=t-i.length;e=s>0?tD(s):eD(-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=Q1(i,["source"]);return(0,Z1.rewireSource)(Object.assign(Object.assign({},o),{source:s.map(r)}))}}fa.default=nD});var Yw=m(pa=>{"use strict";var rD=pa&&pa.__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(pa,"__esModule",{value:!0});var iD=Qn();function sD(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=rD(n,["source"]);return(0,iD.rewireSource)(Object.assign(Object.assign({},i),{source:r.map(e)}))}}pa.default=sD});var Jw=m(il=>{"use strict";Object.defineProperty(il,"__esModule",{value:!0});il.flow=void 0;function oD(...t){return e=>t.reduce((n,r)=>r(n),e)}il.flow=oD});var t0=m(zm=>{"use strict";Object.defineProperty(zm,"__esModule",{value:!0});var aD=Qn(),Zw={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},Qw={lineEnd:"CR"},Vm=Object.keys(Zw),e0=t=>(0,aD.isSpace)(t)?`{${t.length}}`:t,uD=t=>"|"+t.join("|")+"|",cD=(t,e)=>Object.keys(e).map(n=>e0(e[n]).padEnd(t[n]));function lD({source:t}){var e,n;if(t.length===0)return"";let r=Object.assign({},Zw);for(let s of Vm)r[s]=((e=Qw[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],e0(o[a]).length)}let i=[[],[]];for(let s of Vm)i[0].push(((n=Qw[s])!==null&&n!==void 0?n:s).padEnd(r[s]));for(let s of Vm)i[1].push("-".padEnd(r[s],"-"));for(let{number:s,tokens:o}of t){let a=s.toString().padStart(r.line);i.push([a,...cD(r,o)])}return i.map(uD).join(`
100
+ `)}zm.default=lD});var n0=m(wt=>{"use strict";var dD=wt&&wt.__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]}),fD=wt&&wt.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&dD(e,t,n)};Object.defineProperty(wt,"__esModule",{value:!0});wt.util=wt.tokenizers=wt.transforms=wt.inspect=wt.stringify=wt.parse=void 0;var pD=Gw(),hD=Hm(),mD=Bm(),gD=Nm(),yD=jm(),bD=Vw(),_D=Kw(),vD=Xw(),SD=Yw(),TD=Jw(),sl=Qn();fD(Vs(),wt);function wD(t,e={}){return(0,pD.default)(e)(t)}wt.parse=wD;wt.stringify=(0,bD.default)();var ED=t0();Object.defineProperty(wt,"inspect",{enumerable:!0,get:function(){return ED.default}});wt.transforms={flow:TD.flow,align:_D.default,indent:vD.default,crlf:SD.default};wt.tokenizers={tag:gD.default,type:yD.default,name:mD.default,description:hD.default};wt.util={rewireSpecs:sl.rewireSpecs,rewireSource:sl.rewireSource,seedBlock:sl.seedBlock,seedTokens:sl.seedTokens}});var $i=m(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});ha.SignatureDefinitionBaseType=void 0;var AD;(function(t){t.Function="function",t.Number="number",t.String="string",t.Map="map",t.List="list",t.Any="any",t.General="general"})(AD=ha.SignatureDefinitionBaseType||(ha.SignatureDefinitionBaseType={}))});var ma=m(zs=>{"use strict";var r0=zs&&zs.__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(zs,"__esModule",{value:!0});zs.SignatureDefinitionTypeMeta=void 0;var Xt=$i(),xD=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=r0(n,3),o=s[0],a=s[1],u=s[2];if(a===Xt.SignatureDefinitionBaseType.Map?(r=Xt.SignatureDefinitionBaseType.Any,i=Xt.SignatureDefinitionBaseType.Any):a===Xt.SignatureDefinitionBaseType.List&&(r=Xt.SignatureDefinitionBaseType.Any),u){var c=u.split(",").map(function(y){return y.trim()});if(c.length>2)return null;var l=r0(c,2),d=l[0],p=l[1];p!=null?(r=p,i=d):r=d}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===Xt.SignatureDefinitionBaseType.Map?(s=Xt.SignatureDefinitionBaseType.Any,o=Xt.SignatureDefinitionBaseType.Any):i===Xt.SignatureDefinitionBaseType.List&&(s=Xt.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===Xt.SignatureDefinitionBaseType.Map?(s=s??Xt.SignatureDefinitionBaseType.Any,o=o??Xt.SignatureDefinitionBaseType.Any):i===Xt.SignatureDefinitionBaseType.List&&(s=s??Xt.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}();zs.SignatureDefinitionTypeMeta=xD});var Km=m(ci=>{"use strict";var i0=ci&&ci.__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},s0=ci&&ci.__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(ci,"__esModule",{value:!0});ci.SignatureDefinitionFunctionArg=void 0;var o0=ma(),kD=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(o0.SignatureDefinitionTypeMeta.parse(e.type));else if(e.types)i.push.apply(i,s0([],i0(e.types.map(o0.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 s0([],i0(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}();ci.SignatureDefinitionFunctionArg=kD});var ol=m(fr=>{"use strict";var Bi=fr&&fr.__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},Ui=fr&&fr.__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))},CD=fr&&fr.__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(fr,"__esModule",{value:!0});fr.VariationRegistry=void 0;var OD=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(Ui(Ui([],Bi(e),!1),Bi(this._variations),!1)),this},t.prototype.getAll=function(){return Ui([],Bi(this._variations),!1)},t}(),RD=function(){function t(){}return t.add=function(e,n){var r=new OD(e);return r.push.apply(r,Ui([],Bi(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=CD(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(Ui(Ui([],Bi(c.getAll()),!1),Bi(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 Ui([],Bi(i),!1)},t.variationContainers=new Map,t}();fr.VariationRegistry=RD});var al=m(li=>{"use strict";var DD=li&&li.__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},ID=li&&li.__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(li,"__esModule",{value:!0});li.SignatureDefinition=void 0;var PD=ol(),MD=ma(),LD=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:MD.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 PD.VariationRegistry.resolve(this._variations)},t.prototype.toJSON=function(){return{type:this._type.toJSON(),isProtected:this._isProtected,description:this._description,example:this._example?ID([],DD(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}();li.SignatureDefinition=LD});var Xm=m(In=>{"use strict";var ND=In&&In.__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)}}(),ul=In&&In.__assign||function(){return ul=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},ul.apply(this,arguments)},qD=In&&In.__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},jD=In&&In.__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(In,"__esModule",{value:!0});In.SignatureDefinitionFunction=void 0;var FD=$i(),$D=ol(),BD=al(),UD=Km(),a0=ma(),HD=function(t){ND(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 a0.SignatureDefinitionTypeMeta({type:FD.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(UD.SignatureDefinitionFunctionArg.parse))!==null&&a!==void 0?a:[],returns:n.returns.map(a0.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 jD([],qD(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=[]),$D.VariationRegistry.resolve(this._returnVariations)},e.prototype.toJSON=function(){return ul(ul({},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}(BD.SignatureDefinition);In.SignatureDefinitionFunction=HD});var c0=m((f2,u0)=>{"use strict";u0.exports=function(...t){try{return JSON.stringify(...t)}catch(e){return"[Cannot display object: "+e.message+"]"}}});var Ym=m((l0,d0)=>{"use strict";var WD=c0();d0.exports=class extends Error{constructor(t){let e=t.filter(n=>n!=="").map(n=>typeof n=="string"?n:n instanceof Error?n.message:WD(n));super(e.join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,l0.assert)}}});var ke=m((h2,f0)=>{"use strict";var GD=Ym();f0.exports=function(t,...e){if(!t)throw e.length===1&&e[0]instanceof Error?e[0]:new GD(e)}});var Hi=m((m2,h0)=>{"use strict";var Jm=ke(),p0={};h0.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);Jm(!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&&p0.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){Jm(!n.strict||o+1===i.length,"Missing segment",a,"in reach path ",e),Jm(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};p0.iterables=function(t){if(t instanceof Set)return"set";if(t instanceof Map)return"map"}});var Qm=m((Yt,g0)=>{"use strict";var m0={};Yt=g0.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};m0.typeMap=new Map([["[object Error]",Yt.error],["[object Map]",Yt.map],["[object Promise]",Yt.promise],["[object Set]",Yt.set],["[object WeakMap]",Yt.weakMap],["[object WeakSet]",Yt.weakSet]]);Yt.getInternalProto=function(t){if(Array.isArray(t))return Yt.array;if(Buffer&&t instanceof Buffer)return Yt.buffer;if(t instanceof Date)return Yt.date;if(t instanceof RegExp)return Yt.regex;if(t instanceof Error)return Yt.error;let e=Object.prototype.toString.call(t);return m0.typeMap.get(e)||Yt.generic}});var Zm=m(y0=>{"use strict";y0.keys=function(t,e={}){return e.symbols!==!1?Reflect.ownKeys(t):Object.getOwnPropertyNames(t)}});var Jt=m((y2,b0)=>{"use strict";var VD=Hi(),_n=Qm(),zD=Zm(),Rr={needsProtoHack:new Set([_n.set,_n.map,_n.weakSet,_n.weakMap])};b0.exports=Rr.clone=function(t,e={},n=null){if(typeof t!="object"||t===null)return t;let r=Rr.clone,i=n;if(e.shallow){if(e.shallow!==!0)return Rr.cloneWithShallow(t,e);r=u=>u}else if(i){let u=i.get(t);if(u)return u}else i=new Map;let s=_n.getInternalProto(t);if(s===_n.buffer)return Buffer&&Buffer.from(t);if(s===_n.date)return new Date(t.getTime());if(s===_n.regex)return new RegExp(t);let o=Rr.base(t,s,e);if(o===t)return t;if(i&&i.set(t,o),s===_n.set)for(let u of t)o.add(r(u,e,i));else if(s===_n.map)for(let[u,c]of t)o.set(u,r(c,e,i));let a=zD.keys(t,e);for(let u of a){if(u==="__proto__")continue;if(s===_n.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};Rr.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=VD(t,i);(typeof s=="object"||typeof s=="function")&&r.set(s,s)}return Rr.clone(t,e,r)};Rr.base=function(t,e,n){if(n.prototype===!1)return Rr.needsProtoHack.has(e)?new e.constructor:e===_n.array?[]:{};let r=Object.getPrototypeOf(t);if(r&&r.isImmutable)return t;if(e===_n.array){let i=[];return r!==e&&Object.setPrototypeOf(i,r),i}if(Rr.needsProtoHack.has(e)){let i=new r.constructor;return r!==e&&Object.setPrototypeOf(i,r),i}return Object.create(r)}});var _0=m((b2,KD)=>{KD.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 cl=m(ga=>{"use strict";var C=ll(),de={};de.wrap=C.string().min(1).max(2).allow(!1);ga.preferences=C.object({allowUnknown:C.boolean(),abortEarly:C.boolean(),artifacts:C.boolean(),cache:C.boolean(),context:C.object(),convert:C.boolean(),dateFormat:C.valid("date","iso","string","time","utc"),debug:C.boolean(),errors:{escapeHtml:C.boolean(),label:C.valid("path","key",!1),language:[C.string(),C.object().ref()],render:C.boolean(),stack:C.boolean(),wrap:{label:de.wrap,array:de.wrap,string:de.wrap}},externals:C.boolean(),messages:C.object(),noDefaults:C.boolean(),nonEnumerables:C.boolean(),presence:C.valid("required","optional","forbidden"),skipFunctions:C.boolean(),stripUnknown:C.object({arrays:C.boolean(),objects:C.boolean()}).or("arrays","objects").allow(!0,!1),warnings:C.boolean()}).strict();de.nameRx=/^[a-zA-Z0-9]\w*$/;de.rule=C.object({alias:C.array().items(C.string().pattern(de.nameRx)).single(),args:C.array().items(C.string(),C.object({name:C.string().pattern(de.nameRx).required(),ref:C.boolean(),assert:C.alternatives([C.function(),C.object().schema()]).conditional("ref",{is:!0,then:C.required()}),normalize:C.function(),message:C.string().when("assert",{is:C.function(),then:C.required()})})),convert:C.boolean(),manifest:C.boolean(),method:C.function().allow(!1),multi:C.boolean(),validate:C.function()});ga.extension=C.object({type:C.alternatives([C.string(),C.object().regex()]).required(),args:C.function(),cast:C.object().pattern(de.nameRx,C.object({from:C.function().maxArity(1).required(),to:C.function().minArity(1).maxArity(2).required()})),base:C.object().schema().when("type",{is:C.object().regex(),then:C.forbidden()}),coerce:[C.function().maxArity(3),C.object({method:C.function().maxArity(3).required(),from:C.array().items(C.string()).single()})],flags:C.object().pattern(de.nameRx,C.object({setter:C.string(),default:C.any()})),manifest:{build:C.function().arity(2)},messages:[C.object(),C.string()],modifiers:C.object().pattern(de.nameRx,C.function().minArity(1).maxArity(2)),overrides:C.object().pattern(de.nameRx,C.function()),prepare:C.function().maxArity(3),rebuild:C.function().arity(1),rules:C.object().pattern(de.nameRx,de.rule),terms:C.object().pattern(de.nameRx,C.object({init:C.array().allow(null).required(),manifest:C.object().pattern(/.+/,[C.valid("schema","single"),C.object({mapped:C.object({from:C.string().required(),to:C.string().required()}).required()})])})),validate:C.function().maxArity(3)}).strict();ga.extensions=C.array().items(C.object(),C.function().arity(1)).strict();de.desc={buffer:C.object({buffer:C.string()}),func:C.object({function:C.function().required(),options:{literal:!0}}),override:C.object({override:!0}),ref:C.object({ref:C.object({type:C.valid("value","global","local"),path:C.array().required(),separator:C.string().length(1).allow(!1),ancestor:C.number().min(0).integer().allow("root"),map:C.array().items(C.array().length(2)).min(1),adjust:C.function(),iterables:C.boolean(),in:C.boolean(),render:C.boolean()}).required()}),regex:C.object({regex:C.string().min(3)}),special:C.object({special:C.valid("deep").required()}),template:C.object({template:C.string().required(),options:C.object()}),value:C.object({value:C.alternatives([C.object(),C.array()]).required()})};de.desc.entity=C.alternatives([C.array().items(C.link("...")),C.boolean(),C.function(),C.number(),C.string(),de.desc.buffer,de.desc.func,de.desc.ref,de.desc.regex,de.desc.special,de.desc.template,de.desc.value,C.link("/")]);de.desc.values=C.array().items(null,C.boolean(),C.function(),C.number().allow(1/0,-1/0),C.string().allow(""),C.symbol(),de.desc.buffer,de.desc.func,de.desc.override,de.desc.ref,de.desc.regex,de.desc.template,de.desc.value);de.desc.messages=C.object().pattern(/.+/,[C.string(),de.desc.template,C.object().pattern(/.+/,[C.string(),de.desc.template])]);ga.description=C.object({type:C.string().required(),flags:C.object({cast:C.string(),default:C.any(),description:C.string(),empty:C.link("/"),failover:de.desc.entity,id:C.string(),label:C.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:C.boolean(),unit:C.string()}).unknown(),preferences:{allowUnknown:C.boolean(),abortEarly:C.boolean(),artifacts:C.boolean(),cache:C.boolean(),convert:C.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:C.boolean(),label:["path","key"],language:[C.string(),de.desc.ref],wrap:{label:de.wrap,array:de.wrap}},externals:C.boolean(),messages:de.desc.messages,noDefaults:C.boolean(),nonEnumerables:C.boolean(),presence:["required","optional","forbidden"],skipFunctions:C.boolean(),stripUnknown:C.object({arrays:C.boolean(),objects:C.boolean()}).or("arrays","objects").allow(!0,!1),warnings:C.boolean()},allow:de.desc.values,invalid:de.desc.values,rules:C.array().min(1).items({name:C.string().required(),args:C.object().min(1),keep:C.boolean(),message:[C.string(),de.desc.messages],warn:C.boolean()}),keys:C.object().pattern(/.*/,C.link("/")),link:de.desc.ref}).pattern(/^[a-z]\w*$/,C.any())});var S0=m((v2,v0)=>{"use strict";var di={};v0.exports=function(t){if(!t)return"";let e="";for(let n=0;n<t.length;++n){let r=t.charCodeAt(n);di.isSafe(r)?e+=t[n]:e+=di.escapeHtmlChar(r)}return e};di.escapeHtmlChar=function(t){let e=di.namedHtml.get(t);return e||(t>=256?"&#"+t+";":`&#x${t.toString(16).padStart(2,"0")};`)};di.isSafe=function(t){return di.safeCharCodes.has(t)};di.namedHtml=new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[34,"&quot;"],[160,"&nbsp;"],[162,"&cent;"],[163,"&pound;"],[164,"&curren;"],[169,"&copy;"],[174,"&reg;"]]);di.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 T0=m(ya=>{"use strict";var we={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};ya.Parser=class{constructor(t,e={}){if(!e[we.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[we.settings]?e:Object.assign({[we.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 ya.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(we.operatorCharacters.includes(n))u&&u.type==="operator"&&we.operators.includes(u.value+n)?u.value+=n:e.push({type:"operator",value:n});else if(n.match(we.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(we.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 we.literals?i=we.literals[a]:a==="("?(s(),++r):we.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(we.operatorsPrefix.includes(a.value))continue;if(!o)throw new Error("Formula contains an operator in invalid position");if(!we.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 we.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):we.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 we.literals&&!s?(i+=c,o=we.literals[c]):c===","&&!s?a():(i+=c,c==="("?++s:c===")"&&--s)}a()}return r=r.map(i=>new ya.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=we.evaluate(i,t);e[n]=we.single(r.value,s)}}return we.operatorsOrder.forEach(n=>{for(let r=1;r<e.length-1;)if(n.includes(e[r])){let i=e[r],s=we.evaluate(e[r-1],t),o=we.evaluate(e[r+1],t);e.splice(r,2);let a=we.calculate(i,s,o);e[r-1]=a===0?0:a}else r+=2}),we.evaluate(e[0],t)}};ya.Parser.prototype[we.symbol]=!0;we.reference=function(t){return function(e){return e&&e[t]!==void 0?e[t]:null}};we.evaluate=function(t,e){return t===null?null:typeof t=="function"?t(e):t[we.symbol]?t.evaluate(e):t};we.single=function(t,e){if(t==="!")return!e;let n=-e;return n===0?0:n};we.calculate=function(t,e,n){if(t==="??")return we.exists(e)?e:n;if(typeof e=="string"||typeof n=="string"){if(t==="+")return e=we.exists(e)?e:"",n=we.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};we.exists=function(t){return t!=null}});var E0=m(w0=>{"use strict";var XD=Jt(),YD=Ke(),Wi={annotations:Symbol("annotations")};w0.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=XD(this._original);for(let a=this.details.length-1;a>=0;--a){let u=a+1,c=this.details[a],l=c.path,d=i;for(let p=0;;++p){let y=l[p];if(YD.isSchema(d)&&(d=d.clone()),p+1<l.length&&typeof d[y]!="string")d=d[y];else{let v=d[Wi.annotations]||{errors:{},missing:{}};d[Wi.annotations]=v;let x=y||c.context.key;d[y]!==void 0?(v.errors[x]=v.errors[x]||[],v.errors[x].push(u)):v.missing[x]=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=Wi.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};Wi.safeStringify=function(t,e){return JSON.stringify(t,Wi.serializer(),e)};Wi.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[Wi.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 Dr=m(vt=>{"use strict";var JD=E0(),QD=Ke(),ZD=fi();vt.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=vt.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 vt.template(this.value,t,e||this.code,this.state,this.prefs)}};vt.path=function(t){let e="";for(let n of t)typeof n!="object"&&(typeof n=="string"?(e&&(e+="."),e+=n):e+=`[${n}]`);return e};vt.template=function(t,e,n,r,i){if(!e)return;if(ZD.isTemplate(e))return n!=="root"?e:null;let s=i.errors.language;if(QD.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["*"]};vt.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=vt.path(i);return s||vt.template(null,n.messages,"root",e,n)||r&&vt.template(null,r,"root",e,n)||"value"};vt.process=function(t,e,n){if(!t)return null;let{override:r,message:i,details:s}=vt.details(t);if(r)return r;if(n.errors.stack)return new vt.ValidationError(i,s,e);let o=Error.stackTraceLimit;Error.stackTraceLimit=0;let a=new vt.ValidationError(i,s,e);return Error.stackTraceLimit=o,a};vt.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}};vt.ValidationError=class extends Error{constructor(t,e,n){super(t),this._original=n,this.details=e}static isError(t){return t instanceof vt.ValidationError}};vt.ValidationError.prototype.isJoi=!0;vt.ValidationError.prototype.name="ValidationError";vt.ValidationError.prototype.annotate=JD.error});var Ir=m(Ln=>{"use strict";var Pn=ke(),eI=Jt(),tI=Hi(),ba=Ke(),tg,Mn={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};Ln.create=function(t,e={}){Pn(typeof t=="string","Invalid reference key:",t),ba.assertOptions(e,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),Pn(!e.prefix||typeof e.prefix=="object","options.prefix must be of type object");let n=Object.assign({},Mn.defaults,e);delete n.prefix;let r=n.separator,i=Mn.context(t,r,e.prefix);if(n.type=i.type,t=i.key,n.type==="value")if(i.root&&(Pn(!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)Pn(!r||!t||t[0]!==r,"Cannot combine prefix with ancestor option");else{let[s,o]=Mn.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 Mn.Ref(n)};Ln.in=function(t,e={}){return Ln.create(t,{...e,in:!0})};Ln.isRef=function(t){return t?!!t[ba.symbols.ref]:!1};Mn.Ref=class{constructor(t){Pn(typeof t=="object","Invalid reference construction"),ba.assertOptions(t,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),Pn([!1,void 0].includes(t.separator)||typeof t.separator=="string"&&t.separator.length===1,"Invalid separator"),Pn(!t.adjust||typeof t.adjust=="function","options.adjust must be a function"),Pn(!t.map||Array.isArray(t.map),"options.map must be an array"),Pn(!t.map||!t.adjust,"Cannot set both map and adjust options"),Object.assign(this,Mn.defaults,t),Pn(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 Pn(!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):(Pn(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=tI(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 Mn.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||""}`}};Mn.Ref.prototype[ba.symbols.ref]=!0;Ln.build=function(t){return t=Object.assign({},Mn.defaults,t),t.type==="value"&&t.ancestor===void 0&&(t.ancestor=1),new Mn.Ref(t)};Mn.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"}};Mn.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]};Ln.toSibling=0;Ln.toParent=1;Ln.Manager=class{constructor(){this.refs=[]}register(t,e){if(t){if(e=e===void 0?Ln.toParent:e,Array.isArray(t)){for(let n of t)this.register(n,e);return}if(ba.isSchema(t)){for(let n of t._refs.refs)n.ancestor-e>=0&&this.refs.push({ancestor:n.ancestor-e,root:n.root});return}Ln.isRef(t)&&t.type==="value"&&t.ancestor-e>=0&&this.refs.push({ancestor:t.ancestor-e,root:t.root}),tg=tg||fi(),tg.isTemplate(t)&&this.register(t.refs(),e)}}get length(){return this.refs.length}clone(){let t=new Ln.Manager;return t.refs=eI(this.refs),t}reset(){this.refs=[]}roots(){return this.refs.filter(t=>!t.ancestor).map(t=>t.root)}}});var fi=m((C0,O0)=>{"use strict";var dl=ke(),nI=Jt(),rI=S0(),iI=T0(),x0=Ke(),A0=Dr(),k0=Ir(),Me={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}};O0.exports=C0=Me.Template=class{constructor(t,e){if(dl(typeof t=="string","Template source must be a string"),dl(!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?nI(r):void 0,this._functions=n,this._functions&&(dl(Object.keys(this._functions).every(i=>typeof i=="string"),"Functions keys must be strings"),dl(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=Me.encode(this.source),e=Me.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(`{${Me.decode(s)}`);continue}let c=s.slice(o?0:1,u),l=c[0]===":";l&&(c=c.slice(1));let d=this._ref(Me.decode(c),{raw:o,wrapped:l});r.push(d),typeof d!="string"&&(n=!0);let p=s.slice(u+a.length);p&&r.push(Me.decode(p))}if(!n){this.rendered=r.join("");return}this._template=r}static date(t,e){return Me.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 Me.Template(t.template,t.options||t.functions?{...t.options,functions:t.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(t){return t?!!t[x0.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=Me.stringify(a,t,e,n,r,i);if(u!==void 0){let c=o.raw||(i.errors&&i.errors.escapeHtml)===!1?u:rI(u);s.push(Me.wrap(c,o.wrapped&&n.errors.wrap.label))}}return s.join("")}_ref(t,{raw:e,wrapped:n}){let r=[],i=o=>{let a=k0.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?{...Me.functions,...this._functions}:Me.functions;var s=new iI.Parser(t,{reference:i,functions:o,constants:Me.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 Me.stringify(s.single.value)}return{formula:s,raw:e,refs:r}}toString(){return this.source}};Me.Template.prototype[x0.symbols.template]=!0;Me.Template.prototype.isImmutable=!0;Me.encode=function(t){return t.replace(/\\(\{+)/g,(e,n)=>Me.opens.slice(0,n.length)).replace(/\\(\}+)/g,(e,n)=>Me.closes.slice(0,n.length))};Me.decode=function(t){return t.replace(/\u0000/g,"{").replace(/\u0001/g,"}")};Me.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};Me.wrap=function(t,e){return e?e.length===1?`${e}${t}${e}`:`${e[0]}${t}${e[1]}`:t};Me.stringify=function(t,e,n,r,i,s={}){let o=typeof t,a=r&&r.errors&&r.errors.wrap||{},u=!1;if(k0.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 Me.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 Me.Template.date(t,r);if(t instanceof Map){let l=[];for(let[d,p]of t.entries())l.push(`${d.toString()} -> ${p.toString()}`);t=l}if(!Array.isArray(t))return t.toString();let c=[];for(let l of t)c.push(Me.stringify(l,e,n,r,i,{arrayItems:!0,...s}));return Me.wrap(c.join(", "),!u&&a.array)};Me.constants={true:!0,false:!1,null:null,second:1e3,minute:60*1e3,hour:60*60*1e3,day:24*60*60*1e3};Me.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=A0.template(e,o[0],t,n,r)||A0.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 Ks=m(_a=>{"use strict";var Gi=ke(),R0=Jt(),vn=fi();_a.compile=function(t,e){if(typeof t=="string")return Gi(!e,"Cannot set single message string"),new vn(t);if(vn.isTemplate(t))return Gi(!e,"Cannot set single message template"),t;Gi(typeof t=="object"&&!Array.isArray(t),"Invalid message options"),e=e?R0(e):{};for(let n in t){let r=t[n];if(n==="root"||vn.isTemplate(r)){e[n]=r;continue}if(typeof r=="string"){e[n]=new vn(r);continue}Gi(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"||vn.isTemplate(s)){e[i][n]=s;continue}Gi(typeof s=="string","Invalid message for",n,"in",i),e[i][n]=new vn(s)}}return e};_a.decompile=function(t){let e={};for(let n in t){let r=t[n];if(n==="root"){e.root=r;continue}if(vn.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};_a.merge=function(t,e){if(!t)return _a.compile(e);if(!e)return t;if(typeof e=="string")return new vn(e);if(vn.isTemplate(e))return e;let n=R0(t);for(let r in e){let i=e[r];if(r==="root"||vn.isTemplate(i)){n[r]=i;continue}if(typeof i=="string"){n[r]=new vn(i);continue}Gi(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"||vn.isTemplate(o)){n[s][r]=o;continue}Gi(typeof o=="string","Invalid message for",r,"in",s),n[s][r]=new vn(o)}}return n}});var Ke=m(Xe=>{"use strict";var fl=ke(),sI=Jm(),oI=_0(),ng,rg,aI={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)?)?)?)?$/};Xe.version=oI.version;Xe.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};Xe.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")};Xe.assertOptions=function(t,e,n="Options"){fl(t&&typeof t=="object"&&!Array.isArray(t),"Options must be of type object");let r=Object.keys(t).filter(i=>!e.includes(i));fl(r.length===0,`${n} contain unknown keys: ${r}`)};Xe.checkPreferences=function(t){rg=rg||cl();let e=rg.preferences.validate(t);if(e.error)throw new sI([e.error.details[0].message])};Xe.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}};Xe.default=function(t,e){return t===void 0?e:t};Xe.isIsoDate=function(t){return aI.isoDate.test(t)};Xe.isNumber=function(t){return typeof t=="number"&&!isNaN(t)};Xe.isResolvable=function(t){return t?t[Xe.symbols.ref]||t[Xe.symbols.template]:!1};Xe.isSchema=function(t,e={}){let n=t&&t[Xe.symbols.any];return n?(fl(e.legacy||n.version===Xe.version,"Cannot mix different versions of joi schemas"),!0):!1};Xe.isValues=function(t){return t[Xe.symbols.values]};Xe.limit=function(t){return Number.isSafeInteger(t)&&t>=0};Xe.preferences=function(t,e){ng=ng||Ks(),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=ng.compile(e.messages,t.messages)),delete n[Xe.symbols.prefs],n};Xe.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}};Xe.validateArg=function(t,e,{assert:n,message:r}){if(Xe.isSchema(n)){let i=n.validate(t);return i.error?i.error.message:void 0}else if(!n(t))return e?`${e} ${r}`:r};Xe.verifyFlat=function(t,e){for(let n of t)fl(!Array.isArray(n),"Method no longer accepts array arguments:",e)}});var ig=m(D0=>{"use strict";var uI=ke(),cI=Jt(),lI=Ke(),Xs={max:1e3,supported:new Set(["undefined","boolean","number","string"])};D0.provider={provision(t){return new Xs.Cache(t)}};Xs.Cache=class{constructor(t={}){lI.assertOptions(t,["max"]),uI(t.max===void 0||t.max&&t.max>0&&isFinite(t.max),"Invalid max cache size"),this._max=t.max||Xs.max,this._map=new Map,this._list=new Xs.List}get length(){return this._map.size}set(t,e){if(t!==null&&!Xs.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),cI(e.value)}_compact(){if(this._map.size>this._max){let t=this._list.pop();this._map.delete(t.key)}}};Xs.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 Vi=m(Pr=>{"use strict";var ut=ke(),Sn=Ke(),Ys=Ir(),Nn={};Pr.schema=function(t,e,n={}){Sn.assertOptions(n,["appendPath","override"]);try{return Nn.schema(t,e,n)}catch(r){throw n.appendPath&&r.path!==void 0&&(r.message=`${r.message} (${r.path})`),r}};Nn.schema=function(t,e,n){ut(e!==void 0,"Invalid undefined schema"),Array.isArray(e)&&(ut(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(Nn.simple(e))return r(t,e);if(typeof e=="function")return t.custom(e);if(ut(typeof e=="object","Invalid schema content:",typeof e),Sn.isResolvable(e))return r(t,e);if(Sn.isSchema(e))return e;if(Array.isArray(e)){for(let i of e)if(!Nn.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):(ut(Object.getPrototypeOf(e)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),t.object().keys(e))};Pr.ref=function(t,e){return Ys.isRef(t)?t:Ys.create(t,e)};Pr.compile=function(t,e,n={}){Sn.assertOptions(n,["legacy"]);let r=e&&e[Sn.symbols.any];if(r)return ut(n.legacy||r.version===Sn.version,"Cannot mix different versions of joi schemas:",r.version,Sn.version),e;if(typeof e!="object"||!n.legacy)return Pr.schema(t,e,{appendPath:!0});let i=Nn.walk(e);return i?i.compile(i.root,e):Pr.schema(t,e,{appendPath:!0})};Nn.walk=function(t){if(typeof t!="object")return null;if(Array.isArray(t)){for(let n of t){let r=Nn.walk(n);if(r)return r}return null}let e=t[Sn.symbols.any];if(e)return{root:t[e.root],compile:e.compile};ut(Object.getPrototypeOf(t)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(let n in t){let r=Nn.walk(t[n]);if(r)return r}return null};Nn.simple=function(t){return t===null||["boolean","string","number"].includes(typeof t)};Pr.when=function(t,e,n){if(n===void 0&&(ut(e&&typeof e=="object","Missing options"),n=e,e=Ys.create(".")),Array.isArray(n)&&(n={switch:n}),Sn.assertOptions(n,["is","not","then","otherwise","switch","break"]),Sn.isSchema(e))return ut(n.is===void 0,'"is" can not be used with a schema condition'),ut(n.not===void 0,'"not" can not be used with a schema condition'),ut(n.switch===void 0,'"switch" can not be used with a schema condition'),Nn.condition(t,{is:e,then:n.then,otherwise:n.otherwise,break:n.break});if(ut(Ys.isRef(e)||typeof e=="string","Invalid condition:",e),ut(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 ut(i.then!==void 0||i.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),ut(i.break===void 0||i.then===void 0||i.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),n.is!==void 0&&!Ys.isRef(n.is)&&!Sn.isSchema(n.is)&&(s=s.required()),Nn.condition(t,{ref:Pr.ref(e),is:s,then:i.then,otherwise:i.otherwise,break:i.break})}ut(Array.isArray(n.switch),'"switch" must be an array'),ut(n.is===void 0,'Cannot combine "switch" with "is"'),ut(n.not===void 0,'Cannot combine "switch" with "not"'),ut(n.then===void 0,'Cannot combine "switch" with "then"');let r={ref:Pr.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;Sn.assertOptions(s,o?["is","then","otherwise"]:["is","then"]),ut(s.is!==void 0,'Switch statement missing "is"'),ut(s.then!==void 0,'Switch statement missing "then"');let a={is:t.$_compile(s.is),then:t.$_compile(s.then)};if(!Ys.isRef(s.is)&&!Sn.isSchema(s.is)&&(a.is=a.is.required()),o){ut(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&&(ut(r.break===void 0,"Cannot specify both otherwise and break"),a.otherwise=t.$_compile(u))}r.switch.push(a)}return r};Nn.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 sg=m(P0=>{"use strict";var pi=ke(),dI=Jt(),I0=Ke(),fI=Ks(),pr={};P0.type=function(t,e){let n=Object.getPrototypeOf(t),r=dI(n),i=t._assign(Object.create(r)),s=Object.assign({},e);delete s.base,r._definition=s;let o=n._definition||{};s.messages=fI.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 d in s.terms){let p=s.terms[d];pi(i.$_terms[d]===void 0,"Invalid term override for",s.type,d),i.$_terms[d]=p.init,a[d]=p}s.terms=a,s.args||(s.args=o.args),s.prepare=pr.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=pr.coerce(s.coerce,o.coerce),s.validate=pr.validate(s.validate,o.validate);let u=Object.assign({},o.rules);if(s.rules)for(let d in s.rules){let p=s.rules[d];pi(typeof p=="object","Invalid rule definition for",s.type,d);let y=p.method;if(y===void 0&&(y=function(){return this.$_addRule(d)}),y&&(pi(!r[d],"Rule conflict in",s.type,d),r[d]=y),pi(!u[d],"Rule conflict in",s.type,d),u[d]=p,p.alias){let v=[].concat(p.alias);for(let x of v)r[x]=p.method}p.args&&(p.argsByName=new Map,p.args=p.args.map(v=>(typeof v=="string"&&(v={name:v}),pi(!p.argsByName.has(v.name),"Duplicated argument name",v.name),I0.isSchema(v.assert)&&(v.assert=v.assert.strict().label(v.name)),p.argsByName.set(v.name,v),v)))}s.rules=u;let c=Object.assign({},o.modifiers);if(s.modifiers)for(let d in s.modifiers){pi(!r[d],"Rule conflict in",s.type,d);let p=s.modifiers[d];pi(typeof p=="function","Invalid modifier definition for",s.type,d);let y=function(v){return this.rule({[d]:v})};r[d]=y,c[d]=p}if(s.modifiers=c,s.overrides){r._super=n,i.$_super={};for(let d in s.overrides)pi(n[d],"Cannot override missing",d),s.overrides[d][I0.symbols.parent]=n[d],i.$_super[d]=n[d].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=pr.build(s.manifest&&s.manifest.build,o.manifest&&o.manifest.build),s.manifest=l,s.rebuild=pr.rebuild(s.rebuild,o.rebuild),i};pr.build=function(t,e){return!t||!e?t||e:function(n,r){return e(t(n,r),r)}};pr.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}}};pr.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}};pr.rebuild=function(t,e){return!t||!e?t||e:function(n){e(n),t(n)}};pr.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 ug=m(ag=>{"use strict";var hr=ke(),pl=Jt(),zi=Ke(),pI=Ks(),M0=Ir(),hI=fi(),og,Qt={};ag.describe=function(t){let e=t._definition,n={type:t.type,flags:{},rules:[]};for(let r in t._flags)r[0]!=="_"&&(n.flags[r]=Qt.describe(t._flags[r]));Object.keys(n.flags).length||delete n.flags,t._preferences&&(n.preferences=pl(t._preferences,{shallow:["messages"]}),delete n.preferences[zi.symbols.prefs],n.preferences.messages&&(n.preferences.messages=pI.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]=Qt.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]=Qt.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;hr(!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(zi.isValues(i)){n[r]=i.describe();continue}hr(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(Qt.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"){hr(a.length===1,"Term",r,"contains more than one item"),n[r]=a[0];continue}n[r]=a}return Qt.validate(t.$_root,n),n};Qt.describe=function(t,e={}){if(Array.isArray(t))return t.map(Qt.describe);if(t===zi.symbols.deepDefault)return{special:"deep"};if(typeof t!="object"||t===null)return t;if(e.assign==="options")return pl(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[zi.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]=Qt.describe(i,{assign:r}))}return n};ag.build=function(t,e){return new Qt.Builder(t).parse(e)};Qt.Builder=class{constructor(t){this.joi=t}parse(t){Qt.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;hr(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){hr(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){hr(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 hr(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;hr(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 pl(t);if(e.assign==="regex")return Qt.regex(t);if(e.assign==="ref")return M0.build(t);if(typeof t!="object")return t;if(Object.keys(t).length===1){if(t.buffer)return hr(Buffer,"Buffers are not supported"),Buffer&&Buffer.from(t.buffer,"binary");if(t.function)return{[zi.symbols.literal]:!0,literal:t.function};if(t.override)return zi.symbols.override;if(t.ref)return M0.build(t.ref);if(t.regex)return Qt.regex(t.regex);if(t.special)return hr(["deep"].includes(t.special),"Unknown special value",t.special),zi.symbols.deepDefault;if(t.value)return pl(t.value)}if(t.type)return this.parse(t);if(t.template)return hI.build(t);let n={};for(let r in t)n[r]=this.build(t[r],{assign:r});return n}};Qt.regex=function(t){let e=t.lastIndexOf("/"),n=t.slice(1,e),r=t.slice(e+1);return new RegExp(n,r)};Qt.validate=function(t,e){og=og||cl(),t.assert(e,og.description)}});var va=m(($2,L0)=>{"use strict";var mr=Zm(),Ht={mismatched:null};L0.exports=function(t,e,n){return n=Object.assign({prototype:!0},n),!!Ht.isDeepEqual(t,e,n,[])};Ht.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=Ht.getSharedType(t,e,!!n.prototype);switch(s){case mr.buffer:return Buffer&&Buffer.prototype.equals.call(t,e);case mr.promise:return t===e;case mr.regex:return t.toString()===e.toString();case Ht.mismatched:return!1}for(let o=r.length-1;o>=0;--o)if(r[o].isSame(t,e))return!0;r.push(new Ht.SeenEntry(t,e));try{return!!Ht.isDeepEqualObj(s,t,e,n,r)}finally{r.pop()}};Ht.getSharedType=function(t,e,n){if(n)return Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?Ht.mismatched:mr.getInternalProto(t);let r=mr.getInternalProto(t);return r!==mr.getInternalProto(e)?Ht.mismatched:r};Ht.valueOf=function(t){let e=t.valueOf;if(e===void 0)return t;try{return e.call(t)}catch(n){return n}};Ht.hasOwnEnumerableProperty=function(t,e){return Object.prototype.propertyIsEnumerable.call(t,e)};Ht.isSetSimpleEqual=function(t,e){for(let n of Set.prototype.values.call(t))if(!Set.prototype.has.call(e,n))return!1;return!0};Ht.isDeepEqualObj=function(t,e,n,r,i){let{isDeepEqual:s,valueOf:o,hasOwnEnumerableProperty:a}=Ht,{keys:u,getOwnPropertySymbols:c}=Object;if(t===mr.array)if(r.part){for(let v of e)for(let x of n)if(s(v,x,r,i))return!0}else{if(e.length!==n.length)return!1;for(let v=0;v<e.length;++v)if(!s(e[v],n[v],r,i))return!1;return!0}else if(t===mr.set){if(e.size!==n.size)return!1;if(!Ht.isSetSimpleEqual(e,n)){let v=new Set(Set.prototype.values.call(n));for(let x of Set.prototype.values.call(e)){if(v.delete(x))continue;let I=!1;for(let P of v)if(s(x,P,r,i)){v.delete(P),I=!0;break}if(!I)return!1}}}else if(t===mr.map){if(e.size!==n.size)return!1;for(let[v,x]of Map.prototype.entries.call(e))if(x===void 0&&!Map.prototype.has.call(n,v)||!s(x,Map.prototype.get.call(n,v),r,i))return!1}else if(t===mr.error&&(e.name!==n.name||e.message!==n.message))return!1;let l=o(e),d=o(n);if((e!==l||n!==d)&&!s(l,d,r,i))return!1;let p=u(e);if(!r.part&&p.length!==u(n).length&&!r.skip)return!1;let y=0;for(let v of p){if(r.skip&&r.skip.includes(v)){n[v]===void 0&&++y;continue}if(!a(n,v)||!s(e[v],n[v],r,i))return!1}if(!r.part&&p.length-y!==u(n).length)return!1;if(r.symbols!==!1){let v=c(e),x=new Set(c(n));for(let I of v){if(!r.skip||!r.skip.includes(I)){if(a(e,I)){if(!a(n,I)||!s(e[I],n[I],r,i))return!1}else if(a(n,I))return!1}x.delete(I)}for(let I of x)if(a(n,I))return!1}return!0};Ht.SeenEntry=class{constructor(t,e){this.obj=t,this.ref=e}isSame(t,e){return this.obj===t&&this.ref===e}}});var q0=m(N0=>{"use strict";N0.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 lg=m(cg=>{"use strict";var j0=va(),F0=q0(),mI=Dr(),Wt={codes:{error:1,pass:2,full:3},labels:{0:"never used",1:"always error",2:"always pass"}};cg.setup=function(t){let e=function(){return t._tracer=t._tracer||new Wt.Tracer,t._tracer};t.trace=e,t[Symbol.for("@hapi/lab/coverage/initialize")]=e,t.untrace=()=>{t._tracer=null}};cg.location=function(t){return t.$_setFlag("_tracerLocation",F0.location(2))};Wt.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 Wt.Store(t),{filename:r,line:i}=t._flags._tracerLocation||F0.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(Wt.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 d=a[`_${l}s`];if(!d)continue;let p=new Set(d._values),y=new Set(d._refs);for(let{value:v,ref:x}of u[l])p.delete(v),y.delete(x);(p.size||y.size)&&s.push({status:[...p,...[...y].map(v=>v.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 d=Wt.labels[u.rule[l]||0];if(d){let p={rule:l,status:d};u.paths.size&&(p.paths=[...u.paths]),s.push(p)}}}s.length&&e.push({filename:n,line:r,missing:s,severity:"error",message:`Schema missing tests for ${s.map(Wt.message).join(", ")}`})}return e.length?e:null}};Wt.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){Wt.debug(e,{type:"entry"}),this._record(t,n=>{n.entry=!0})}filter(t,e,n,r){Wt.debug(e,{type:n,...r}),this._record(t,i=>{i[n].add(r)})}log(t,e,n,r,i){Wt.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]|=Wt.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||j0(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=Wt.id(s,o);this._scan(s,n.concat(a))};t.$_modify({each:i,ref:!1})}_combine(t,e){this._combos.set(t,e)}};Wt.message=function(t){return`${t.paths?mI.path(t.paths[0])+(t.rule?":":""):""}${t.rule||""} (${t.status})`};Wt.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)};Wt.sub=function(t,e){for(let n of t)for(let r of e)if(j0(n.slice(0,r.length),r))return!0;return!1};Wt.debug=function(t,e){t.mainstay.debug&&(e.path=t.debug?[...t.path,t.debug]:t.path,t.mainstay.debug.push(e))}});var hl=m((V2,U0)=>{"use strict";var dg=ke(),$0=Jt(),gI=eg(),B0={};U0.exports=B0.merge=function(t,e,n){if(dg(t&&typeof t=="object","Invalid target value: must be an object"),dg(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)){dg(Array.isArray(t),"Cannot merge array onto an object"),n.mergeArrays||(t.length=0);for(let i=0;i<e.length;++i)t.push($0(e[i],{symbols:n.symbols}));return t}let r=gI.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]=$0(o,{symbols:n.symbols}):B0.merge(t[s],o,n)}else(o!=null||n.nullOverride)&&(t[s]=o)}return t}});var H0=m(ml=>{"use strict";var Mr=ke(),fg=Ke(),yI=Ir(),gr={};ml.Ids=gr.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){let t=new gr.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())Mr(!this._byKey.has(e),"Schema id conflicts with existing key:",e),this._byId.set(e,n);for(let[e,n]of t._byKey.entries())Mr(!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)};Mr(fg.isSchema(s.schema),"adjuster function failed to return a joi schema type");for(let o of r)s={id:o.id,schema:gr.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);Mr(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||!fg.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);Mr(!r||r.schema===t,"Cannot add different schemas with the same id:",n),Mr(!this._byKey.has(n),"Schema id conflicts with existing key:",n),this._byId.set(n,{schema:t,id:n})}e&&(Mr(!this._byKey.has(e),"Schema already contains key:",e),Mr(!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);Mr(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)}};gr.fork=function(t,e,n){let r=(s,{key:o})=>{if(e===(s._flags.id||o))return n},i=ml.schema(t,{each:r,ref:!1});return i?i.$_mutateRebuild():t};ml.schema=function(t,e){let n;for(let r in t._flags){if(r[0]==="_")continue;let i=gr.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=gr.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=gr.scan(t.$_terms[r],{source:"terms",name:r},e);i!==void 0&&(n=n||t.clone(),n.$_terms[r]=i)}return n};gr.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=gr.scan(t[a],e,n,[a,...s],u);c!==void 0&&(o=o||t.slice(),o[a]=c)}return o}if(n.schema!==!1&&fg.isSchema(t)||n.ref!==!1&&yI.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=gr.scan(t[a],e,n,[a,...s],i);u!==void 0&&(o=o||Object.assign({},t),o[a]=u)}return o}});var G0=m((X2,W0)=>{"use strict";W0.exports=function(){}});var K0=m((Y2,z0)=>{"use strict";var bI=Jt(),V0=Hi(),_I=Ke(),yr={value:Symbol("value")};z0.exports=yr.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 yr.State(t,e,this);return n&&r.schemas&&(r.schemas=[yr.schemas(n),...r.schemas]),r}nest(t,e){let n=new yr.State(this.path,this.ancestors,this);return n.schemas=n.schemas&&[yr.schemas(t),...n.schemas],n.debug=e,n}shadow(t,e){this.mainstay.shadow=this.mainstay.shadow||new yr.Shadow,this.mainstay.shadow.set(this.path,t,e)}snapshot(){this.mainstay.shadow&&(this._snapshot=bI(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()}};yr.schemas=function(t){return _I.isSchema(t)?{schema:t}:t};yr.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[yr.value]=e}get(t){let e=this.node(t);if(e)return e[yr.value]}node(t){if(this._values)return V0(this._values,t,{iterables:!0})}override(t,e){if(!this._values)return;let n=t.slice(0,-1),r=t[t.length-1],i=V0(this._values,n,{iterables:!0});if(e){i.set(r,e);return}i&&i.delete(r)}}});var Y0=m(Ta=>{"use strict";var Sa=ke(),X0=Jt(),Js=G0(),vI=Hi(),Et=Ke(),hi=Dr(),SI=K0(),ye={result:Symbol("result")};Ta.entry=function(t,e,n){let r=Et.defaults;n&&(Sa(n.warnings===void 0,"Cannot override warnings preference in synchronous validation"),Sa(n.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),r=Et.preferences(Et.defaults,n));let i=ye.entry(t,e,r);Sa(!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};Ta.entryAsync=async function(t,e,n){let r=Et.defaults;n&&(r=Et.preferences(Et.defaults,n));let i=ye.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,d=c.schema.type==="link"?s.links.get(c.schema):null,p=a,y,v,x=l.length?[a]:[],I=l.length?vI(t,l):t;if(l.length){y=l[l.length-1];let P=a;for(let w of l.slice(0,-1))P=P[w],x.unshift(P);v=x[0],p=v[y]}try{let P=(E,_)=>(d||c.schema).$_createError(E,p,_,c.state,r),w=await c.method(p,{schema:c.schema,linked:d,state:c.state,prefs:n,original:I,error:P,errorsArray:ye.errorsArray,warn:(E,_)=>s.warnings.push((d||c.schema).$_createError(E,p,_,c.state,r)),message:(E,_)=>(d||c.schema).$_createError("external",p,_,c.state,r,{messages:E})});if(w===void 0||w===p)continue;if(w instanceof hi.Report){if(s.tracer.log(c.schema,c.state,"rule","external","error"),u.push(w),r.abortEarly)break;continue}if(Array.isArray(w)&&w[Et.symbols.errors]){if(s.tracer.log(c.schema,c.state,"rule","external","error"),u.push(...w),r.abortEarly)break;continue}v?(s.tracer.value(c.state,"rule",p,w,"external"),v[y]=w):(s.tracer.value(c.state,"rule",a,w,"external"),a=w)}catch(P){throw r.errors.label&&(P.message+=` (${c.label})`),P}}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};ye.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()}};ye.entry=function(t,e,n){let{tracer:r,cleanup:i}=ye.tracer(e,n),s=n.debug?[]:null,o=e._ids._schemaChain?new Map:null,a=new ye.Mainstay(r,s,o),u=e._ids._schemaChain?[{schema:e}]:null,c=new SI([],[],{mainstay:a,schemas:u}),l=Ta.validate(t,e,c,n);i&&e.$_root.untrace();let d=hi.process(l.errors,t,n);return{value:l.value,error:d,mainstay:a}};ye.tracer=function(t,e){return t.$_root._tracer?{tracer:t.$_root._tracer._register(t)}:e.debug?(Sa(t.$_root.trace,"Debug mode not supported"),{tracer:t.$_root.trace()._register(t),cleanup:!0}):{tracer:ye.ignore}};Ta.validate=function(t,e,n,r,i={}){if(e.$_terms.whens&&(e=e._generate(t,n,r).schema),e._preferences&&(r=ye.prefs(e,r)),e._cache&&r.cache){let d=e._cache.get(t);if(n.mainstay.tracer.debug(n,"validate","cached",!!d),d)return d}let s=(d,p,y)=>e.$_createError(d,t,p,y||n,r),o={original:t,prefs:r,schema:e,state:n,error:s,errorsArray:ye.errorsArray,warn:(d,p,y)=>n.mainstay.warnings.push(s(d,p,y)),message:(d,p)=>e.$_createError("custom",t,p,n,r,{messages:d})};n.mainstay.tracer.entry(e,n);let a=e._definition;if(a.prepare&&t!==void 0&&r.convert){let d=a.prepare(t,o);if(d){if(n.mainstay.tracer.value(n,"prepare",t,d.value),d.errors)return ye.finalize(d.value,[].concat(d.errors),o);t=d.value}}if(a.coerce&&t!==void 0&&r.convert&&(!a.coerce.from||a.coerce.from.includes(typeof t))){let d=a.coerce.method(t,o);if(d){if(n.mainstay.tracer.value(n,"coerced",t,d.value),d.errors)return ye.finalize(d.value,[].concat(d.errors),o);t=d.value}}let u=e._flags.empty;u&&u.$_match(ye.trim(t,e),n.nest(u),Et.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 ye.finalize(t,null,o);if(c==="required")return ye.finalize(t,[e.$_createError("any.required",t,null,n,r)],o);if(c==="optional"){if(e._flags.default!==Et.symbols.deepDefault)return ye.finalize(t,null,o);n.mainstay.tracer.value(n,"default",t,{}),t={}}}else if(c==="forbidden")return ye.finalize(t,[e.$_createError("any.unknown",t,null,n,r)],o);let l=[];if(e._valids){let d=e._valids.get(t,n,r,e._flags.insensitive);if(d)return r.convert&&(n.mainstay.tracer.value(n,"valids",t,d.value),t=d.value),n.mainstay.tracer.filter(e,n,"valid",d),ye.finalize(t,null,o);if(e._flags.only){let p=e.$_createError("any.only",t,{valids:e._valids.values({display:!0})},n,r);if(r.abortEarly)return ye.finalize(t,[p],o);l.push(p)}}if(e._invalids){let d=e._invalids.get(t,n,r,e._flags.insensitive);if(d){n.mainstay.tracer.filter(e,n,"invalid",d);let p=e.$_createError("any.invalid",t,{invalids:e._invalids.values({display:!0})},n,r);if(r.abortEarly)return ye.finalize(t,[p],o);l.push(p)}}if(a.validate){let d=a.validate(t,o);if(d&&(n.mainstay.tracer.value(n,"base",t,d.value),t=d.value,d.errors)){if(!Array.isArray(d.errors))return l.push(d.errors),ye.finalize(t,l,o);if(d.errors.length)return l.push(...d.errors),ye.finalize(t,l,o)}}return e._rules.length?ye.rules(t,l,o):ye.finalize(t,l,o)};ye.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 d of o._resolve){let p=a.argsByName.get(d),y=c[d].resolve(t,i,s),v=p.normalize?p.normalize(y):y,x=Et.validateArg(v,null,p);if(x){u=r.$_createError("any.ref",y,{arg:d,ref:c[d],reason:x},i,s);break}c[d]=v}}u=u||a.validate(t,n,c,o);let l=ye.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 ye.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 ye.finalize(t,e,n)};ye.rule=function(t,e){return t instanceof hi.Report?(ye.error(t,e),{errors:[t],value:null}):Array.isArray(t)&&t[Et.symbols.errors]?(t.forEach(n=>ye.error(n,e)),{errors:t,value:null}):{errors:null,value:t}};ye.error=function(t,e){return e.message&&t._setTemplate(e.message),t};ye.finalize=function(t,e,n){e=e||[];let{schema:r,state:i,prefs:s}=n;if(e.length){let a=ye.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)Sa(a instanceof Error||a instanceof hi.Report,"error() must return an Error object")}else e=[r._flags.error];if(t===void 0){let a=ye.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};ye.prefs=function(t,e){let n=e===Et.defaults;return n&&t._preferences[Et.symbols.prefs]?t._preferences[Et.symbols.prefs]:(e=Et.preferences(e,t._preferences),n&&(t._preferences[Et.symbols.prefs]=e),e)};ye.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?[X0(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[Et.symbols.literal]?a.literal:Et.isResolvable(a)?a.resolve(e,s,o):X0(a)};ye.trim=function(t,e){if(typeof t!="string")return t;let n=e.$_getRule("trim");return!n||!n.args.enabled?t:t.trim()};ye.ignore={active:!1,debug:Js,entry:Js,filter:Js,log:Js,resolve:Js,value:Js};ye.errorsArray=function(){let t=[];return t[Et.symbols.errors]=!0,t}});var hg=m((tB,Q0)=>{"use strict";var TI=ke(),J0=va(),pg=Ke(),Lr={};Q0.exports=Lr.Values=class{constructor(t,e){this._values=new Set(t),this._refs=new Set(e),this._lowercase=Lr.lowercases(t),this._override=!1}get length(){return this._values.size+this._refs.size}add(t,e){if(pg.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 Lr.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(pg.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(J0(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(J0(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 Lr.Values(this._values,this._refs);return t._override=this._override,t}concat(t){TI(!t._override,"Cannot concat override set of values");let e=new Lr.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}};Lr.Values.prototype[pg.symbols.values]=!0;Lr.Values.prototype.slice=Lr.Values.prototype.clone;Lr.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 oE=m((rB,sE)=>{"use strict";var Y=ke(),Z0=Jt(),eE=va(),mg=hl(),wI=ig(),ht=Ke(),gg=Vi(),EI=Dr(),AI=sg(),tE=ug(),xI=Ks(),nE=H0(),rE=Ir(),iE=lg(),gl=Y0(),yl=hg(),Dt={};Dt.Base=class{constructor(t){this.type=t,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new nE.Ids,this._preferences=null,this._refs=new rE.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 Y(typeof tE.describe=="function","Manifest functionality disabled"),tE.describe(this)}allow(...t){return ht.verifyFlat(t,"allow"),this._values(t,"_valids")}alter(t){Y(t&&typeof t=="object"&&!Array.isArray(t),"Invalid targets argument"),Y(!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];Y(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 Y(t!==void 0,"Artifact cannot be undefined"),Y(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",t)}cast(t){return Y(t===!1||typeof t=="string","Invalid to value"),Y(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 Y(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 Y(t,"Missing error"),Y(t instanceof Error||typeof t=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",t)}example(t,e={}){return Y(t!==void 0,"Missing example"),ht.assertOptions(e,["override"]),this._inner("examples",t,{single:!0,override:e.override})}external(t,e){return typeof t=="object"&&(Y(!e,"Cannot combine options with description"),e=t.description,t=t.method),Y(typeof t=="function","Method must be a function"),Y(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?(Y(typeof t=="string","id must be a non-empty string"),Y(/^[^\.]+$/.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 Y(t&&typeof t=="string","Label name must be a non-empty string"),this.$_setFlag("label",t)}meta(t){return Y(t!==void 0,"Meta cannot be undefined"),this._inner("metas",t,{single:!0})}note(...t){Y(t.length,"Missing notes");for(let e of t)Y(e&&typeof e=="string","Notes must be non-empty strings");return this._inner("notes",t)}only(t=!0){return Y(typeof t=="boolean","Invalid mode:",t),this.$_setFlag("only",t)}optional(){return this.presence("optional")}prefs(t){Y(t,"Missing preferences"),Y(t.context===void 0,"Cannot override context"),Y(t.externals===void 0,"Cannot override externals"),Y(t.warnings===void 0,"Cannot override warnings"),Y(t.debug===void 0,"Cannot override debug"),ht.checkPreferences(t);let e=this.clone();return e._preferences=ht.preferences(e._preferences,t),e}presence(t){return Y(["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 Y(["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=ht.preferences(e._preferences,{convert:n}),e}strip(t=!0){return this.$_setFlag("result",t?"strip":void 0)}tag(...t){Y(t.length,"Missing tags");for(let e of t)Y(e&&typeof e=="string","Tags must be non-empty strings");return this._inner("tags",t)}unit(t){return Y(t&&typeof t=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",t)}valid(...t){ht.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=gg.when(n,t,e);if(!["any","link"].includes(n.type)){let i=r.is?[r]:r.switch;for(let s of i)Y(!s.then||s.then.type==="any"||s.then.type===n.type,"Cannot combine",n.type,"with",s.then&&s.then.type),Y(!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){Y(!this._inRuleset(),"Cannot set caching inside a ruleset"),Y(!this._cache,"Cannot override schema cache"),Y(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");let e=this.clone();return e._cache=t||wI.provider.provision(),e.$_temp.ruleset=!1,e}clone(){let t=Object.create(Object.getPrototypeOf(this));return this._assign(t)}concat(t){Y(ht.isSchema(t),"Invalid schema object"),Y(this.type==="any"||t.type==="any"||t.type===this.type,"Cannot merge type",this.type,"with another type:",t.type),Y(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),Y(!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,rE.toSibling),e._preferences=e._preferences?ht.preferences(e._preferences,t._preferences):t._preferences,e._valids=yl.merge(e._valids,t._valids,t._invalids),e._invalids=yl.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,mg(e._flags,n)}else if(t._flags.empty){e._flags.empty=t._flags.empty;let n=Object.assign({},t._flags);delete n.empty,mg(e._flags,n)}else mg(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 Y(!t.base,"Cannot extend type with another base"),AI.type(this,t)}extract(t){return t=Array.isArray(t)?t:t.split("."),this._ids.reach(t)}fork(t,e){Y(!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;ht.assertOptions(t,Object.keys(e.modifiers)),Y(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;Y(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=Z0(s);for(let a in t)e.modifiers[a](o,t[a]),Y(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(){Y(!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),Y(!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),Y(ht.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 iE.location?iE.location(this):this}validate(t,e){return gl.entry(t,this,e)}validateAsync(t,e){return gl.entryAsync(t,this,e)}$_addRule(t){typeof t=="string"&&(t={name:t}),Y(t&&typeof t=="object","Invalid options"),Y(t.name&&typeof t.name=="string","Invalid rule name");for(let s in t)Y(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;Y(n,"Unknown rule",e.method);let i=this.clone();if(r){Y(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&&ht.isResolvable(o))e._resolve.push(s),i.$_mutateRegister(o);else if(a.normalize&&(o=a.normalize(o),r[s]=o),a.assert){let u=ht.validateArg(o,s,a);Y(!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 gg.schema(this.$_root,t,e)}$_createError(t,e,n,r,i,s={}){let o=s.flags!==!1?this._flags:{},a=s.messages?xI.merge(this._definition.messages,s.messages):this._definition.messages;return new EI.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=!gl.validate(t,this,e,n,r).errors;return e.restore(),i}$_modify(t){return ht.assertOptions(t,["each","once","ref","schema"]),nE.schema(this,t)||this}$_mutateRebuild(){Y(!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={}){Y(t[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");let r=this._definition.flags[t]||{};if(eE(e,r.default)&&(e=void 0),eE(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][ht.symbols.parent].call(this,...e)}$_validate(t,e,n){return gl.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=Z0(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 ht.assertOptions(n,"literal"),Y(e!==void 0,"Missing",t,"value"),Y(typeof e=="function"||!n.literal,"Only function value supports literal option"),typeof e=="function"&&n.literal&&(e={[ht.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,d=i.length;for(let p=0;p<l.length;++p){let{is:y,then:v,otherwise:x}=l[p],I=`${a}${u.switch?"."+p:""}`;if(y.$_match(c,e.nest(y,`${I}.is`),n)){if(v){let P=e.localize([...e.path,`${I}.then`],e.ancestors,e.schemas),{schema:w,id:E}=v._generate(t,P,n);r.push(w),i.push(`${I}.then${E?`(${E})`:""}`);break}}else if(x){let P=e.localize([...e.path,`${I}.otherwise`],e.ancestors,e.schemas),{schema:w,id:E}=x._generate(t,P,n);r.push(w),i.push(`${I}.otherwise${E?`(${E})`:""}`);break}}if(u.break&&i.length>d)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={}){Y(!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){ht.verifyFlat(t,e.slice(1,-1));let n=this.clone(),r=t[0]===ht.symbols.override;if(r&&(t=t.slice(1)),!n[e]&&t.length?n[e]=new yl:r&&(n[e]=t.length?new yl:null,n.$_mutateRebuild()),!n[e])return n;r&&n[e].override();for(let i of t){Y(i!==void 0,"Cannot call allow/valid/invalid with undefined"),Y(i!==ht.symbols.override,"Override must be the first value");let s=e==="_invalids"?"_valids":"_invalids";n[s]&&(n[s].remove(i),n[s].length||(Y(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}};Dt.Base.prototype[ht.symbols.any]={version:ht.version,compile:gg.compile,root:"$_root"};Dt.Base.prototype.isImmutable=!0;Dt.Base.prototype.deny=Dt.Base.prototype.invalid;Dt.Base.prototype.disallow=Dt.Base.prototype.invalid;Dt.Base.prototype.equal=Dt.Base.prototype.valid;Dt.Base.prototype.exist=Dt.Base.prototype.required;Dt.Base.prototype.not=Dt.Base.prototype.invalid;Dt.Base.prototype.options=Dt.Base.prototype.prefs;Dt.Base.prototype.preferences=Dt.Base.prototype.prefs;sE.exports=new Dt.Base});var qn=m((sB,aE)=>{"use strict";var bl=ke(),kI=oE(),CI=Ke(),OI=Ks();aE.exports=kI.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 bl(typeof t=="function","Method must be a function"),bl(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){bl(CI.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 bl(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=OI.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 lE=m((oB,cE)=>{"use strict";var Ki=ke(),RI=hl(),DI=qn(),uE=Ke(),II=Vi(),_l=Dr(),PI=Ir(),Qs={};cE.exports=DI.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:PI.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 d=n.$_terms.matches[l],p=i.nest(d.schema,`match.${l}`);p.snapshot();let y=d.schema.$_validate(t,p,s);y.errors?(u.push(y.errors),p.restore()):(a.push(y.value),p.commit())}if(a.length===0){let l={details:u.map(d=>_l.details(d,{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(d=>_l.details(d,{override:!1}))};return{errors:r("alternatives.all",l)}}let c=l=>l.$_terms.matches.some(d=>d.schema.type==="object"||d.schema.type==="alternatives"&&c(d.schema));return c(n)?{value:a.reduce((l,d)=>RI(l,d,{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 d=i.nest(u.schema,`match.${a}`);d.snapshot();let p=u.schema.$_validate(t,d,s);if(!p.errors)return d.commit(),p;d.restore(),o.push({schema:u.schema,reports:p.errors});continue}let c=u.ref?u.ref.resolve(t,i,s):t,l=u.is?[u]:u.switch;for(let d=0;d<l.length;++d){let p=l[d],{is:y,then:v,otherwise:x}=p,I=`match.${a}${u.switch?"."+d:""}`;if(y.$_match(c,i.nest(y,`${I}.is`),s)){if(v)return v.$_validate(t,i.nest(v,`${I}.then`),s)}else if(x)return x.$_validate(t,i.nest(x,`${I}.otherwise`),s)}}return Qs.errors(o,e)},rules:{conditional:{method(t,e){Ki(!this._flags._endedSwitch,"Unreachable condition"),Ki(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),Ki(e.break===void 0,"Cannot use break option with alternatives conditional");let n=this.clone(),r=II.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(Ki(["any","one","all"].includes(t),"Invalid alternatives match mode",t),t!=="any")for(let e of this.$_terms.matches)Ki(e.schema,"Cannot combine match mode",t,"with conditional rules");return this.$_setFlag("match",t)}},try:{method(...t){Ki(t.length,"Missing alternative schemas"),uE.verifyFlat(t,"try"),Ki(!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=>{uE.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}}"}});Qs.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 Qs.unmatched(t,e);let a=s[0];if(!(a instanceof _l.Report))return Qs.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}:Qs.unmatched(t,e):{errors:e("alternatives.types",{types:[...r]})}};Qs.unmatched=function(t,e){let n=[];for(let r of t)n.push(...r.reports);return{errors:e("alternatives.match",_l.details(n,{override:!1}))}}});var fE=m((aB,dE)=>{"use strict";var wa=ke(),MI=va(),LI=Hi(),NI=qn(),jn=Ke(),qI=Vi(),nt={};dE.exports=NI.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 nt.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[jn.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){jn.verifyFlat(t,"items");let e=this.$_addRule("items");for(let n=0;n<t.length;++n){let r=jn.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[jn.symbols.arraySingle];delete t[jn.symbols.arraySingle];let l=s(),d=t.length;for(let p=0;p<d;++p){let y=t[p],v=!1,x=!1,I=c?p:new Number(p),P=[...r.path,I];if(!e._flags.sparse&&y===void 0){if(l.push(n("array.sparse",{key:I,path:P,pos:p,value:void 0},r.localize(P))),i.abortEarly)return l;a.shift();continue}let w=[t,...r.ancestors];for(let O of e.$_terms._exclusions)if(O.$_match(y,r.localize(P,w,O),i,{presence:"ignore"})){if(l.push(n("array.excludes",{pos:p,value:y},r.localize(P))),i.abortEarly)return l;v=!0,a.shift();break}if(v)continue;if(e.$_terms.ordered.length){if(a.length){let O=a.shift(),H=O.$_validate(y,r.localize(P,w,O),i);if(H.errors){if(l.push(...H.errors),i.abortEarly)return l}else if(O._flags.result==="strip")nt.fastSplice(t,p),--p,--d;else if(!e._flags.sparse&&H.value===void 0){if(l.push(n("array.sparse",{key:I,path:P,pos:p,value:void 0},r.localize(P))),i.abortEarly)return l;continue}else t[p]=H.value;continue}else if(!e.$_terms.items.length){if(l.push(n("array.orderedLength",{pos:p,limit:e.$_terms.ordered.length})),i.abortEarly)return l;break}}let E=[],_=o.length;for(let O=0;O<_;++O){let H=r.localize(P,w,o[O]);H.snapshot();let re=o[O].$_validate(y,H,i);if(E[O]=re,!re.errors){if(H.commit(),t[p]=re.value,x=!0,nt.fastSplice(o,O),--O,--_,!e._flags.sparse&&re.value===void 0&&(l.push(n("array.sparse",{key:I,path:P,pos:p,value:void 0},r.localize(P))),i.abortEarly))return l;break}H.restore()}if(x)continue;let j=i.stripUnknown&&!!i.stripUnknown.arrays||!1;_=u.length;for(let O of u){let H,re=o.indexOf(O);if(re!==-1)H=E[re];else{let fe=r.localize(P,w,O);if(fe.snapshot(),H=O.$_validate(y,fe,i),!H.errors){fe.commit(),O._flags.result==="strip"?(nt.fastSplice(t,p),--p,--d):!e._flags.sparse&&H.value===void 0?(l.push(n("array.sparse",{key:I,path:P,pos:p,value:void 0},r.localize(P))),v=!0):t[p]=H.value,x=!0;break}fe.restore()}if(_===1){if(j){nt.fastSplice(t,p),--p,--d,x=!0;break}if(l.push(...H.errors),i.abortEarly)return l;v=!0;break}}if(!v&&(e.$_terms._inclusions.length||e.$_terms._requireds.length)&&!x){if(j){nt.fastSplice(t,p),--p,--d;continue}if(l.push(n("array.includes",{pos:p,value:y},r.localize(P))),i.abortEarly)return l}}return o.length&&nt.fillMissedErrors(e,l,o,t,r,i),a.length&&(nt.fillOrderedErrors(e,l,a,t,r,i),l.length||nt.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 jn.compare(t.length,n,i)?t:e.error("array."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:jn.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){jn.verifyFlat(t,"ordered");let e=this.$_addRule("items");for(let n=0;n<t.length;++n){let r=jn.tryWithPath(()=>this.$_compile(t[n]),n,{append:!0});nt.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 wa(!e||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",e)}},sort:{method(t={}){jn.assertOptions(t,["by","order"]);let e={order:t.order||"ascending"};return t.by&&(e.by=qI.ref(t.by,{ancestor:0}),wa(!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}=nt.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={}){wa(!t||typeof t=="function"||typeof t=="string","comparator must be a function or a string"),jn.assertOptions(e,["ignoreUndefined","separator"]);let n={name:"unique",args:{options:e,comparator:t}};if(t)if(typeof t=="string"){let r=jn.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||MI,l=s.ignoreUndefined;for(let d=0;d<t.length;++d){let p=a?LI(t[d],a):t[d],y=o?u.custom:u[typeof p];if(wa(y,"Failed to find unique map container for type",typeof p),y instanceof Map){let v=y.entries(),x;for(;!(x=v.next()).done;)if(c(x.value[0],p)){let I=e.localize([...e.path,d],[t,...e.ancestors]),P={pos:d,value:t[d],dupePos:x.value[1],dupeValue:t[x.value[1]]};return a&&(P.path=i),n("array.unique",P,I)}y.set(p,d)}else{if((!l||p!==void 0)&&y[p]!==void 0){let v={pos:d,value:t[d],dupePos:y[p],dupeValue:t[y[p]]};a&&(v.path=i);let x=e.localize([...e.path,d],[t,...e.ancestors]);return n("array.unique",v,x)}y[p]=d}}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)nt.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)nt.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"}});nt.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))};nt.fillOrderedErrors=function(t,e,n,r,i,s){let o=[];for(let a of n)a._flags.presence==="required"&&o.push(a);o.length&&nt.fillMissedErrors(t,e,o,r,i,s)};nt.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)};nt.fastSplice=function(t,e){let n=e;for(;n<t.length;)t[n++]=t[n];--t.length};nt.validateSingle=function(t,e){(t.type==="array"||t._flags._arrayItems)&&(wa(!e._flags.single,"Cannot specify array item with single rule enabled"),e.$_setFlag("_arrayItems",!0,{clone:!1}))};nt.sort=function(t,e,n,r,i){let s=n.order==="ascending"?1:-1,o=-1*s,a=s,u=(c,l)=>{let d=nt.compare(c,l,o,a);if(d!==null||(n.by&&(c=n.by.resolve(c,r,i),l=n.by.resolve(l,r,i)),d=nt.compare(c,l,o,a),d!==null))return d;let p=typeof c;if(p!==typeof l)throw t.$_createError("array.sort.mismatching",e,null,r,i);if(p!=="number"&&p!=="string")throw t.$_createError("array.sort.unsupported",e,{type:p},r,i);return p==="number"?(c-l)*s:c<l?o:a};try{return{value:e.slice().sort(u)}}catch(c){return{errors:c}}};nt.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 yE=m((uB,gE)=>{"use strict";var pE=ke(),jI=qn(),hE=Ke(),mE=hg(),yg={};yg.isBool=function(t){return typeof t=="boolean"};gE.exports=jI.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){hE.verifyFlat(t,"truthy");let e=this.clone();e.$_terms.truthy=e.$_terms.truthy||new mE;for(let n=0;n<t.length;++n){let r=t[n];pE(r!==void 0,"Cannot call truthy with undefined"),e.$_terms.truthy.add(r)}return e}},falsy:{method(...t){hE.verifyFlat(t,"falsy");let e=this.clone();e.$_terms.falsy=e.$_terms.falsy||new mE;for(let n=0;n<t.length;++n){let r=t[n];pE(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:yg.isBool,to(t,e){return t?1:0}},string:{from:yg.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 SE=m((cB,vE)=>{"use strict";var bE=ke(),FI=qn(),_E=Ke(),$I=fi(),Zn={};Zn.isDate=function(t){return t instanceof Date};vE.exports=FI.extend({type:"date",coerce:{from:["number","string"],method(t,{schema:e}){return{value:Zn.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 _E.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:Zn.parse(t),assert:t=>t!==null,message:"must have a valid date format"}]},format:{method(t){return bE(["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 bE(["javascript","unix"].includes(t),'"type" must be one of "javascript, unix"'),this.format(t)}}},cast:{number:{from:Zn.isDate,to(t,e){return t.getTime()}},string:{from:Zn.isDate,to(t,{prefs:e}){return $I.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"}});Zn.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 _E.isIsoDate(t)?Zn.date(t.toString()):null;let n=t;if(typeof t=="string"&&/^[+-]?\d+(\.\d+)?$/.test(t)&&(t=parseFloat(t)),e){if(e==="javascript")return Zn.date(1*t);if(e==="unix")return Zn.date(1e3*t);if(typeof n=="string")return null}return Zn.date(t)};Zn.date=function(t){let e=new Date(t);return isNaN(e.getTime())?null:e}});var xE=m((lB,AE)=>{"use strict";var vl=ke(),wE=Jt(),EE=hl(),TE=Hi(),Sl={};AE.exports=function(t,e,n={}){if(vl(t&&typeof t=="object","Invalid defaults value: must be an object"),vl(!e||e===!0||typeof e=="object","Invalid source value: must be true, falsy or an object"),vl(typeof n=="object","Invalid options: must be an object"),!e)return null;if(n.shallow)return Sl.applyToDefaultsWithShallow(t,e,n);let r=wE(t);if(e===!0)return r;let i=n.nullOverride!==void 0?n.nullOverride:!1;return EE(r,e,{nullOverride:i,mergeArrays:!1})};Sl.applyToDefaultsWithShallow=function(t,e,n){let r=n.shallow;vl(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=TE(t,u);c&&typeof c=="object"?i.set(c,s&&TE(e,u)||c):s&&s.add(u)}let o=wE(t,{},i);if(!s)return o;for(let u of s)Sl.reachCopy(o,e,u);let a=n.nullOverride!==void 0?n.nullOverride:!1;return EE(o,e,{nullOverride:a,mergeArrays:!1})};Sl.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 OE=m(CE=>{"use strict";var Xi=ke(),kE={};CE.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;Xi(!n.includes(i),`Item cannot come before itself: ${i}`),Xi(!n.includes("?"),"Item cannot come before unassociated items"),Xi(!r.includes(i),`Item cannot come after itself: ${i}`),Xi(!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();Xi(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(kE.mergeSort);for(let n=0;n<this._items.length;++n)this._items[n].seq=n;let e=this._sort();return Xi(e,"merge created a dependencies error"),this.nodes}sort(){let t=this._sort();return Xi(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,d=0;for(let p=0;p<l;++p)i[r[c][p]]&&++d;if(d===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}};kE.mergeSort=(t,e)=>t.sort===e.sort?0:t.sort<e.sort?-1:1});var _g=m((pB,IE)=>{"use strict";var BI=xE(),Fn=ke(),RE=Jt(),UI=OE(),HI=qn(),Gt=Ke(),bg=Vi(),WI=Dr(),DE=Ir(),Tl=fi(),ue={renameDefaults:{alias:!1,multiple:!1,override:!1}};IE.exports=HI.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=ue.clone(t,i);let s=[];if(e.$_terms.renames&&!ue.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 d=r.localize([...r.path,c],a,u),p=u.schema.$_validate(l,d,i);if(p.errors){if(i.abortEarly)return{value:t,errors:p.errors};p.value!==void 0&&(t[c]=p.value),s.push(...p.errors)}else u.schema._flags.result==="strip"||p.value===void 0&&l!==void 0?delete t[c]:p.value!==void 0&&(t[c]=p.value)}}if(o.size||e._flags._hasPatternMatch){let a=ue.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&&ue.isPresent(a.options)(a.key.resolve(t,r,i,null,{shadow:!1}))===!1)continue;let u=ue.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 Gt.verifyFlat(t,"and"),ue.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){Tl.isTemplate(t)||(t=bg.ref(t)),Fn(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=DE.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 Fn(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){Fn(t===void 0||typeof t=="object","Object schema must be a valid object"),Fn(!Gt.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 ue.Keys;else{e.$_terms.keys=e.$_terms.keys?e.$_terms.keys.filter(n=>!t.hasOwnProperty(n.key)):new ue.Keys;for(let n in t)Gt.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 Gt.compare(Object.keys(t).length,n,i)?t:e.error("object."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:Gt.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 Gt.verifyFlat(t,"nand"),ue.dependency(this,"nand",null,t)}},or:{method(...t){return Gt.verifyFlat(t,"or"),ue.dependency(this,"or",null,t)}},oxor:{method(...t){return ue.dependency(this,"oxor",null,t)}},pattern:{method(t,e,n={}){let r=t instanceof RegExp;r||(t=this.$_compile(t,{appendPath:!0})),Fn(e!==void 0,"Invalid rule"),Gt.assertOptions(n,["fallthrough","matches"]),r&&Fn(!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 DE.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={}){Fn(typeof t=="string"||t instanceof RegExp,"Rename missing the from argument"),Fn(typeof e=="string"||e instanceof Tl,"Invalid rename to argument"),Fn(e!==t,"Cannot rename key to same name:",t),Gt.assertOptions(n,["alias","ignoreUndefined","override","multiple"]);let r=this.clone();r.$_terms.renames=r.$_terms.renames||[];for(let i of r.$_terms.renames)Fn(i.from!==t,"Cannot rename the same key multiple times");return e instanceof Tl&&r.$_mutateRegister(e),r.$_terms.renames.push({from:t,to:e,options:BI(ue.renameDefaults,n)}),r}},schema:{method(t="any"){return this.$_addRule({name:"schema",args:{type:t}})},validate(t,e,{type:n}){return Gt.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 ue.dependency(this,"with",t,e,n)}},without:{method(t,e,n={}){return ue.dependency(this,"without",t,e,n)}},xor:{method(...t){return Gt.verifyFlat(t,"xor"),ue.dependency(this,"xor",null,t)}}},overrides:{default(t,e){return t===void 0&&(t=Gt.symbols.deepDefault),this.$_parent("default",t,e)}},rebuild(t){if(t.$_terms.keys){let e=new UI.Sorter;for(let n of t.$_terms.keys)Gt.tryWithPath(()=>e.add(n,{after:n.schema.$_rootReferences(),group:n.key}),n.key);t.$_terms.keys=new ue.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=ue.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}}"}});ue.clone=function(t,e){if(typeof t=="object"){if(e.nonEnumerables)return RE(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=RE(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};ue.dependency=function(t,e,n,r,i){Fn(n===null||typeof n=="string",e,"key must be a strings"),i||(i=r.length>1&&typeof r[r.length-1]=="object"?r.pop():{}),Gt.assertOptions(i,["separator","isPresent"]),r=[].concat(r);let s=Gt.default(i.separator,"."),o=[];for(let u of r)Fn(typeof u=="string",e,"peers must be strings"),o.push(bg.ref(u,{separator:s,ancestor:0,prefix:!1}));n!==null&&(n=bg.ref(n,{separator:s,ancestor:0,prefix:!1}));let a=t.clone();return a.$_terms.dependencies=a.$_terms.dependencies||[],a.$_terms.dependencies.push(new ue.Dependency(e,n,o,r,i)),a};ue.dependencies={and(t,e,n,r,i){let s=[],o=[],a=e.peers.length,u=ue.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:ue.keysToLabels(t,o),missing:s,missingWithLabels:ue.keysToLabels(t,s)}}},nand(t,e,n,r,i){let s=[],o=ue.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:ue.keysToLabels(t,a),peers:u,peersWithLabels:ue.keysToLabels(t,u)}}},or(t,e,n,r,i){let s=ue.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:ue.keysToLabels(t,e.paths)}}},oxor(t,e,n,r,i){let s=[],o=ue.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:ue.keysToLabels(t,e.paths)};return a.present=s,a.presentWithLabels=ue.keysToLabels(t,s),{code:"object.oxor",context:a}},with(t,e,n,r,i){let s=ue.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:ue.keysToLabels(t,e.key.key),peer:o.key,peerWithLabel:ue.keysToLabels(t,o.key)}}},without(t,e,n,r,i){let s=ue.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:ue.keysToLabels(t,e.key.key),peer:o.key,peerWithLabel:ue.keysToLabels(t,o.key)}}},xor(t,e,n,r,i){let s=[],o=ue.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:ue.keysToLabels(t,e.paths)};return s.length===0?{code:"object.missing",context:a}:(a.present=s,a.presentWithLabels=ue.keysToLabels(t,s),{code:"object.xor",context:a})}};ue.keysToLabels=function(t,e){return Array.isArray(e)?e.map(n=>t.$_mapLabels(n)):t.$_mapLabels(e)};ue.isPresent=function(t){return typeof t.isPresent=="function"?t.isPresent:e=>e!==void 0};ue.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,d=c.to;if(d instanceof Tl&&(d=d.render(e,n,r,c.match)),l!==d){if(!o.options.multiple&&s[d]&&(i.push(t.$_createError("object.rename.multiple",e,{from:l,to:d,pattern:u},n,r)),r.abortEarly)||Object.prototype.hasOwnProperty.call(e,d)&&!o.options.override&&!s[d]&&(i.push(t.$_createError("object.rename.override",e,{from:l,to:d,pattern:u},n,r)),r.abortEarly))return!1;e[l]===void 0?delete e[d]:e[d]=e[l],s[d]=!0,o.options.alias||delete e[l]}}}return!0};ue.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 d=e[l],p=[...i.path,l];for(let y=0;y<t.$_terms.patterns.length;++y){let v=t.$_terms.patterns[y];if(v.regex){let P=v.regex.test(l);if(i.mainstay.tracer.debug(i,"rule",`pattern.${y}`,P?"pass":"error"),!P)continue}else if(!v.schema.$_match(l,i.nest(v.schema,`pattern.${y}`),s))continue;n.delete(l);let x=i.localize(p,c,{schema:v.rule,key:l}),I=v.rule.$_validate(d,x,s);if(I.errors){if(s.abortEarly)return{value:e,errors:I.errors};r.push(...I.errors)}if(v.matches&&u[y].push(l),e[l]=I.value,!v.fallthrough)break}}if(a)for(let l=0;l<u.length;++l){let d=u[l];if(!d)continue;let p=t.$_terms.patterns[l].matches,y=i.localize(i.path,c,p),v=p.$_validate(d,y,s);if(v.errors){let x=WI.details(v.errors,{override:!1});x.matches=d;let I=t.$_createError("object.pattern.match",e,x,i,s);if(s.abortEarly)return{value:e,errors:I};r.push(I)}}}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(!Gt.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)}};ue.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}};ue.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 ME=m((gB,PE)=>{"use strict";var vg=ke(),GI=_g();PE.exports=GI.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(t){return vg(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 vg(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 vg(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 NE=m((yB,LE)=>{"use strict";var Nr=ke(),VI=qn(),zI=Ke(),KI=Vi(),XI=Dr(),qr={};LE.exports=VI.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}){Nr(e.$_terms.link,"Uninitialized link schema");let i=qr.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 qr.generate(t,e,n,r)},rules:{ref:{method(t){Nr(!this.$_terms.link,"Cannot reinitialize schema"),t=KI.ref(t),Nr(t.type==="value"||t.type==="local","Invalid reference type:",t.type),Nr(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){Nr(this.$_terms.link,"Uninitialized link schema"),Nr(zI.isSchema(t),"Invalid schema object"),Nr(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 Nr(e.link,"Invalid link description missing link"),t.ref(e.link)}}});qr.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}=qr.perspective(s,n);qr.assert(o,"which is outside of schema boundaries",s,t,n,r);try{i=a.length?o.$_reach(a):o}catch{qr.assert(!1,"to non-existing schema",s,t,n,r)}return qr.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};qr.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}};qr.assert=function(t,e,n,r,i,s){t||Nr(!1,`"${XI.label(r._flags,i,s)}" contains link reference "${n.display}" ${e}`)}});var jE=m((bB,qE)=>{"use strict";var Sg=ke(),YI=qn(),Tg=Ke(),Tn={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))))}};qE.exports=YI.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(t,{schema:e,error:n}){if(!t.match(Tn.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(Tn.extractSignificantDigits(t)!==Tn.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!==Tn.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(!Tg.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 Tg.compare(t,n,i)?t:e.error("number."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:Tg.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"?Tn.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 Tn.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 Sg(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(Tn.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 Sg(["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 Sg(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"}});Tn.extractSignificantDigits=function(t){return t.replace(Tn.exponentialPartRegex,"").replace(Tn.dotRegex,"").replace(Tn.trailingZerosRegex,"").replace(Tn.leadingSignAndZerosRegex,"")};Tn.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 $E=m((_B,FE)=>{"use strict";var JI=_g();FE.exports=JI.extend({type:"object",cast:{map:{from:t=>t&&typeof t=="object",to(t,e){return new Map(Object.entries(t))}}}})});var wg=m(wl=>{"use strict";wl.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"};wl.code=function(t){return{code:t,error:wl.codes[t]}}});var Eg=m(El=>{"use strict";var QI=require("url"),er=wg(),mi={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:QI.URL||URL};El.analyze=function(t,e={}){if(!t)return er.code("DOMAIN_NON_EMPTY_STRING");if(typeof t!="string")throw new Error("Invalid input: domain must be a string");if(t.length>256)return er.code("DOMAIN_TOO_LONG");if(!!mi.nonAsciiRx.test(t)){if(e.allowUnicode===!1)return er.code("DOMAIN_INVALID_UNICODE_CHARS");t=t.normalize("NFC")}if(mi.domainControlRx.test(t))return er.code("DOMAIN_INVALID_CHARS");t=mi.punycode(t),e.allowFullyQualified&&t[t.length-1]==="."&&(t=t.slice(0,-1));let r=e.minDomainSegments||mi.minDomainSegments,i=t.split(".");if(i.length<r)return er.code("DOMAIN_SEGMENTS_COUNT");if(e.maxDomainSegments&&i.length>e.maxDomainSegments)return er.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 er.code("DOMAIN_FORBIDDEN_TLDS")}for(let o=0;o<i.length;++o){let a=i[o];if(!a.length)return er.code("DOMAIN_EMPTY_SEGMENT");if(a.length>63)return er.code("DOMAIN_LONG_SEGMENT");if(o<i.length-1){if(!mi.domainSegmentRx.test(a))return er.code("DOMAIN_INVALID_CHARS")}else if(!mi.tldSegmentRx.test(a))return er.code("DOMAIN_INVALID_TLDS_CHARS")}return null};El.isValid=function(t,e){return!El.analyze(t,e)};mi.punycode=function(t){t.includes("%")&&(t=t.replace(/%/g,"%25"));try{return new mi.URL(`http://${t}`).host}catch{return t}}});var BE=m(Ag=>{"use strict";var ZI=require("util"),eP=Eg(),br=wg(),Zt={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(ZI.TextEncoder||TextEncoder)};Ag.analyze=function(t,e){return Zt.email(t,e)};Ag.isValid=function(t,e){return!Zt.email(t,e)};Zt.email=function(t,e={}){if(typeof t!="string")throw new Error("Invalid input: email must be a string");if(!t)return br.code("EMPTY_STRING");let n=!Zt.nonAsciiRx.test(t);if(!n){if(e.allowUnicode===!1)return br.code("FORBIDDEN_UNICODE");t=t.normalize("NFC")}let r=t.split("@");if(r.length!==2)return r.length>2?br.code("MULTIPLE_AT_CHAR"):br.code("MISSING_AT_CHAR");let[i,s]=r;if(!i)return br.code("EMPTY_LOCAL");if(!e.ignoreLength){if(t.length>254)return br.code("ADDRESS_TOO_LONG");if(Zt.encoder.encode(i).length>64)return br.code("LOCAL_TOO_LONG")}return Zt.local(i,n)||eP.analyze(s,e)};Zt.local=function(t,e){let n=t.split(".");for(let r of n){if(!r.length)return br.code("EMPTY_LOCAL_SEGMENT");if(e){if(!Zt.atextRx.test(r))return br.code("INVALID_LOCAL_CHARS");continue}for(let i of r){if(Zt.atextRx.test(i))continue;let s=Zt.binary(i);if(!Zt.atomRx.test(s))return br.code("INVALID_LOCAL_CHARS")}}};Zt.binary=function(t){return Array.from(Zt.encoder.encode(t)).map(e=>String.fromCharCode(e)).join("")};Zt.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/;Zt.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 xg=m((wB,UE)=>{"use strict";UE.exports=function(t){return t.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}});var Cg=m(kg=>{"use strict";var Al=ke(),tP=xg(),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+")",d="(?:"+c+":){6}"+l,p="::(?:"+c+":){5}"+l,y="(?:"+c+")?::(?:"+c+":){4}"+l,v="(?:(?:"+c+":){0,1}"+c+")?::(?:"+c+":){3}"+l,x="(?:(?:"+c+":){0,2}"+c+")?::(?:"+c+":){2}"+l,I="(?:(?:"+c+":){0,3}"+c+")?::"+c+":"+l,P="(?:(?:"+c+":){0,4}"+c+")?::"+l,w="(?:(?:"+c+":){0,5}"+c+")?::"+c,E="(?:(?:"+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="(?:"+d+"|"+p+"|"+y+"|"+v+"|"+x+"|"+I+"|"+P+"|"+w+"|"+E+")",t.ipvFuture="v"+n+"+\\.["+r+i+":]+",t.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",t.schemeRegex=new RegExp(t.scheme);let _="["+r+s+i+":]*",j="\\[(?:"+t.ipv6address+"|"+t.ipvFuture+")\\]",O="["+r+s+i+"]{1,255}",H="(?:"+j+"|"+t.ipv4address+"|"+O+")",re="\\d*",fe="(?:"+_+"@)?"+H+"(?::"+re+")?",U="(?:"+_+"@)?("+H+")(?::"+re+")?",k=a+"*",M=a+"+",L="["+r+s+i+"@]+",q="",ce="(?:\\/"+k+")*",ae="\\/(?:"+M+ce+")?",Ct=M+ce,dt=L+ce,Pe="(?:\\/\\/\\/"+k+ce+")";return t.hierPart="(?:(?:\\/\\/"+fe+ce+")|"+ae+"|"+Ct+"|"+Pe+")",t.hierPartCapture="(?:(?:\\/\\/"+U+ce+")|"+ae+"|"+Ct+")",t.relativeRef="(?:(?:\\/\\/"+fe+ce+")|"+ae+"|"+dt+"|"+q+")",t.relativeRefCapture="(?:(?:\\/\\/"+U+ce+")|"+ae+"|"+dt+"|"+q+")",t.query="["+o+"\\/\\?]*(?=#|$)",t.queryWithSquareBrackets="["+o+"\\[\\]\\/\\?]*(?=#|$)",t.fragment="["+o+"\\/\\?]*",t};jt.rfc3986=jt.generate();kg.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){Al(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);Al(c.length>=1,"scheme must have at least 1 scheme specified");let l=[];for(let d=0;d<c.length;++d){let p=c[d];Al(p instanceof RegExp||typeof p=="string","scheme at position "+d+" must be a RegExp or String"),p instanceof RegExp?l.push(p.source.toString()):(Al(e.schemeRegex.test(p),"scheme at position "+d+" must be a valid scheme"),l.push(tP(p)))}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({});kg.regex=function(t={}){return t.scheme||t.allowRelative||t.relativeOnly||t.allowQuerySquareBrackets||t.domain?jt.createRegex(t):jt.uriRegex}});var WE=m(HE=>{"use strict";var Zs=ke(),Ea=Cg();HE.regex=function(t={}){Zs(t.cidr===void 0||typeof t.cidr=="string","options.cidr must be a string");let e=t.cidr?t.cidr.toLowerCase():"optional";Zs(["required","optional","forbidden"].includes(e),"options.cidr must be one of required, optional, forbidden"),Zs(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]),Zs(n.length>=1,"options.version must have at least 1 version specified");for(let o=0;o<n.length;++o)Zs(typeof n[o]=="string","options.version must only contain strings"),n[o]=n[o].toLowerCase(),Zs(["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 Ea.ip[o];let a=`\\/${o==="ipv4"?Ea.ip.v4Cidr:Ea.ip.v6Cidr}`;return e==="required"?`${Ea.ip[o]}${a}`:`${Ea.ip[o]}(?:${a})?`}).join("|")})`,s=new RegExp(`^${i}$`);return{cidr:e,versions:n,regex:s,raw:i}}});var zE=m((xB,VE)=>{"use strict";var GE={};GE.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"];VE.exports=new Set(GE.tlds.map(t=>t.toLowerCase()))});var QE=m((kB,JE)=>{"use strict";var Le=ke(),xl=Eg(),nP=BE(),YE=WE(),KE=xg(),XE=zE(),rP=Cg(),iP=qn(),en=Ke(),Ee={tlds:XE instanceof Set?{tlds:{allow:XE,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:YE.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"]};JE.exports=iP.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=Ee.isoDate(t);u&&(t=u)}if(e._flags.truncate){let u=e.$_getRule("max");if(u){let c=u.args.limit;if(en.isResolvable(c)&&(c=c.resolve(t,n,r),!en.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 en.assertOptions(t,["paddingRequired","urlSafe"]),t={urlSafe:!1,paddingRequired:!0,...t},Le(typeof t.paddingRequired=="boolean","paddingRequired must be boolean"),Le(typeof t.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:t}})},validate(t,e,{options:n}){return Ee.base64Regex[n.paddingRequired][n.urlSafe].test(t)?t:e.error("string.base64")}},case:{method(t){return Le(["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 en.assertOptions(t,["paddingRequired"]),t={paddingRequired:!0,...t},Le(typeof t.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:t}})},validate(t,e,{options:n}){let r=t.match(Ee.dataUriRegex);return r&&(!r[2]||r[2]!=="base64"||Ee.base64Regex[n.paddingRequired].false.test(r[3]))?t:e.error("string.dataUri")}},domain:{method(t){t&&en.assertOptions(t,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);let e=Ee.addressOptions(t);return this.$_addRule({name:"domain",args:{options:t},address:e})},validate(t,e,n,{address:r}){return xl.isValid(t,r)?t:e.error("string.domain")}},email:{method(t={}){en.assertOptions(t,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),Le(t.multiple===void 0||typeof t.multiple=="boolean","multiple option must be an boolean");let e=Ee.addressOptions(t),n=new RegExp(`\\s*[${t.separator?KE(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)nP.isValid(a,i)||o.push(a);return o.length?e.error("string.email",{value:t,invalids:o}):t}},guid:{alias:"uuid",method(t={}){en.assertOptions(t,["version","separator"]);let e="";if(t.version){let i=[].concat(t.version);Le(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];Le(typeof a=="string","version at position "+o+" must be a string");let u=Ee.guidVersions[a.toLowerCase()];Le(u,"version at position "+o+" must be one of "+Object.keys(Ee.guidVersions).join(", ")),Le(!s.has(u),"version at position "+o+" must not be a duplicate"),e+=u,s.add(u)}}Le(Ee.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||Ee.guidBrackets[i[1]]!==i[i.length-1]?e.error("string.guid"):t}},hex:{method(t={}){return en.assertOptions(t,["byteAligned","prefix"]),t={byteAligned:!1,prefix:!1,...t},Le(typeof t.byteAligned=="boolean","byteAligned must be boolean"),Le(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"?Ee.hexRegex.withOptionalPrefix:n.prefix===!0?Ee.hexRegex.withPrefix:Ee.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 xl.isValid(t,{minDomainSegments:1})||Ee.ipRegex.test(t)?t:e.error("string.hostname")}},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(t={}){en.assertOptions(t,["cidr","version"]);let{cidr:e,versions:n,regex:r}=YE.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 Ee.isoDate(t)?t:e("string.isoDate")}},isoDuration:{method(){return this.$_addRule("isoDuration")},validate(t,e){return Ee.isoDurationRegex.test(t)?t:e.error("string.isoDuration")}},length:{method(t,e){return Ee.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 en.compare(a,n,s)?t:e.error("string."+i,{limit:o.limit,value:t,encoding:r})},args:[{name:"limit",ref:!0,assert:en.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(t,e){return Ee.length(this,"max",t,"<=",e)},args:["limit","encoding"]},min:{method(t,e){return Ee.length(this,"min",t,">=",e)},args:["limit","encoding"]},normalize:{method(t="NFC"){return Le(Ee.normalizationForms.includes(t),"normalization form must be one of "+Ee.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={}){Le(t instanceof RegExp,"regex must be a RegExp"),Le(!t.flags.includes("g")&&!t.flags.includes("y"),"regex should not use global or sticky mode"),typeof e=="string"&&(e={name:e}),en.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(KE(t),"g")),Le(t instanceof RegExp,"pattern must be a RegExp"),Le(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 Le(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 Le(typeof t=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",t)}},uppercase:{method(){return this.case("upper")}},uri:{method(t={}){en.assertOptions(t,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),t.domain&&en.assertOptions(t.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);let{regex:e,scheme:n}=rP.regex(t),r=t.domain?Ee.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)&&!xl.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"}});Ee.addressOptions=function(t){if(!t)return Ee.tlds||t;if(Le(t.minDomainSegments===void 0||Number.isSafeInteger(t.minDomainSegments)&&t.minDomainSegments>0,"minDomainSegments must be a positive integer"),Le(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 Le(Ee.tlds,"Built-in TLD list disabled"),Object.assign({},t,Ee.tlds);Le(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)}})),Le(t.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),Le(!t.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),Ee.validateTlds(t.tlds.deny,"tlds.deny"),t;let n=t.tlds.allow;return n?n===!0?(Le(Ee.tlds,"Built-in TLD list disabled"),Object.assign({},t,Ee.tlds)):(Array.isArray(n)&&(t=Object.assign({},t,{tlds:{allow:new Set(n)}})),Le(t.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),Ee.validateTlds(t.tlds.allow,"tlds.allow"),t):t};Ee.validateTlds=function(t,e){for(let n of t)Le(xl.isValid(n,{minDomainSegments:1,maxDomainSegments:1}),`${e} must contain valid top level domain names`)};Ee.isoDate=function(t){if(!en.isIsoDate(t))return null;/.*T.*[+-]\d\d$/.test(t)&&(t+="00");let e=new Date(t);return isNaN(e.getTime())?null:e.toISOString()};Ee.length=function(t,e,n,r,i){return Le(!i||Buffer&&Buffer.isEncoding(i),"Invalid encoding:",i),t.$_addRule({name:e,method:"length",args:{limit:n,encoding:i},operator:r})}});var eA=m((CB,ZE)=>{"use strict";var kl=ke(),sP=qn(),Og={};Og.Map=class extends Map{slice(){return new Og.Map(this)}};ZE.exports=sP.extend({type:"symbol",terms:{map:{init:new Og.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)),kl(t&&t[Symbol.iterator],"Iterable must be an iterable or object");let e=this.clone(),n=[];for(let r of t){kl(r&&r[Symbol.iterator],"Entry must be an iterable");let[i,s]=r;kl(typeof i!="object"&&typeof i!="function"&&typeof i!="symbol","Key must not be of type object, function, or Symbol"),kl(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 rA=m((RB,nA)=>{"use strict";var oP=ke(),aP=qn(),tA=Ke();nA.exports=aP.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 oP(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 tA.compare(t.length,n,i)?t:e.error("binary."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:tA.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 ll=m((DB,aA)=>{"use strict";var Ji=ke(),uP=Jt(),cP=ig(),Yi=Ke(),lP=Vi(),Dg=Dr(),dP=sg(),iA=ug(),Rg=Ir(),sA=fi(),oA=lg(),Cl,At={types:{alternatives:lE(),any:qn(),array:fE(),boolean:yE(),date:SE(),function:ME(),link:NE(),number:jE(),object:$E(),string:QE(),symbol:eA()},aliases:{alt:"alternatives",bool:"boolean",func:"function"}};Buffer&&(At.types.binary=rA());At.root=function(){let t={_types:new Set(Object.keys(At.types))};for(let e of t._types)t[e]=function(...n){return Ji(!n.length||["alternatives","link","object"].includes(e),"The",e,"type does not allow arguments"),At.generate(this,At.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,At.methods);for(let e in At.aliases){let n=At.aliases[e];t[e]=t[n]}return t.x=t.expression,oA.setup&&oA.setup(t),t};At.methods={ValidationError:Dg.ValidationError,version:Yi.version,cache:cP.provider,assert(t,e,...n){At.assert(t,e,!0,n)},attempt(t,e,...n){return At.assert(t,e,!1,n)},build(t){return Ji(typeof iA.build=="function","Manifest functionality disabled"),iA.build(this,t)},checkPreferences(t){Yi.checkPreferences(t)},compile(t,e){return lP.compile(this,t,e)},defaults(t){Ji(typeof t=="function","modifier must be a function");let e=Object.assign({},this);for(let n of e._types){let r=t(e[n]());Ji(Yi.isSchema(r),"modifier must return a valid schema object"),e[n]=function(...i){return At.generate(this,r,i)}}return e},expression(...t){return new sA(...t)},extend(...t){Yi.verifyFlat(t,"extend"),Cl=Cl||cl(),Ji(t.length,"You need to provide at least one extension"),this.assert(t,Cl.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,Cl.extension);let r=At.expandExtension(n,e);for(let i of r){Ji(e[i.type]===void 0||e._types.has(i.type),"Cannot override name",i.type);let s=i.base||this.any(),o=dP.type(s,i);e._types.add(i.type),e[i.type]=function(...a){return At.generate(this,o,a)}}}return e},isError:Dg.ValidationError.isError,isExpression:sA.isTemplate,isRef:Rg.isRef,isSchema:Yi.isSchema,in(...t){return Rg.in(...t)},override:Yi.symbols.override,ref(...t){return Rg.create(...t)},types(){let t={};for(let e of this._types)t[e]=this[e]();for(let e in At.aliases)t[e]=this[e]();return t}};At.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,Yi.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 Dg.ValidationError||(a=uP(a)),a.message=i?`${i} ${u}`:u,a};At.generate=function(t,e,n){return Ji(t,"Must be invoked on a Joi instance."),e.$_root=t,!e._definition.args||!n.length?e:e._definition.args(e,...n)};At.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};aA.exports=At.root()});var uA=m(be=>{"use strict";var fP=be&&be.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(be,"__esModule",{value:!0});be.descriptionContainerSchema=be.signatureSchema=be.signatureDefinitionContainerSchema=be.signatureDefinitionSchema=be.signatureDefinitionFunctionSchema=be.signatureDefinitionFunctionSchemaArg=be.signatureDefinitionFunctionSchemaArgMultiTypes=be.signatureDefinitionFunctionSchemaArgDefaultNumber=be.signatureDefinitionFunctionSchemaArgDefaultString=be.signatureDefinitionTypeSchema=be.variationsSchema=void 0;var Z=fP(ll()),Ol=$i();be.variationsSchema=Z.default.array().items(Z.default.alternatives(Z.default.string(),Z.default.number()));be.signatureDefinitionTypeSchema=Z.default.alternatives(Z.default.string(),Z.default.object({type:Z.default.string().required(),keyType:Z.default.string().optional(),valueType:Z.default.string().optional()}));be.signatureDefinitionFunctionSchemaArgDefaultString=Z.default.object({type:Z.default.string().valid(Ol.SignatureDefinitionBaseType.String).required(),value:Z.default.string().allow("").required()});be.signatureDefinitionFunctionSchemaArgDefaultNumber=Z.default.object({type:Z.default.string().valid(Ol.SignatureDefinitionBaseType.Number).required(),value:Z.default.number().required()});be.signatureDefinitionFunctionSchemaArgMultiTypes=Z.default.object({label:Z.default.string().required(),types:Z.default.array().items(be.signatureDefinitionTypeSchema).required(),opt:Z.default.boolean().optional(),default:Z.default.alternatives(be.signatureDefinitionFunctionSchemaArgDefaultString,be.signatureDefinitionFunctionSchemaArgDefaultNumber).optional()});be.signatureDefinitionFunctionSchemaArg=Z.default.object({label:Z.default.string().required(),type:be.signatureDefinitionTypeSchema.required(),opt:Z.default.boolean().optional(),default:Z.default.alternatives(be.signatureDefinitionFunctionSchemaArgDefaultString,be.signatureDefinitionFunctionSchemaArgDefaultNumber).optional()});be.signatureDefinitionFunctionSchema=Z.default.object({type:Z.default.string().valid(Ol.SignatureDefinitionBaseType.Function).required(),description:Z.default.string().optional(),example:Z.default.string().optional(),isProtected:Z.default.boolean().optional(),arguments:Z.default.array().items(Z.default.alternatives(be.signatureDefinitionFunctionSchemaArg,be.signatureDefinitionFunctionSchemaArgMultiTypes)).optional(),returns:Z.default.array().items(be.signatureDefinitionTypeSchema).required(),variations:be.variationsSchema.optional(),returnVariations:be.variationsSchema.optional()});be.signatureDefinitionSchema=Z.default.object({type:be.signatureDefinitionTypeSchema.invalid(Ol.SignatureDefinitionBaseType.Function).required(),description:Z.default.string().optional(),example:Z.default.string().optional(),isProtected:Z.default.boolean().optional(),variations:be.variationsSchema.optional()});be.signatureDefinitionContainerSchema=Z.default.object().pattern(Z.default.string(),Z.default.alternatives(be.signatureDefinitionFunctionSchema,be.signatureDefinitionSchema));be.signatureSchema=Z.default.object({type:Z.default.string().required(),hidden:Z.default.boolean().optional(),extends:Z.default.string().optional(),definitions:Z.default.object().required()});be.descriptionContainerSchema=Z.default.object({$meta:Z.default.object({description:Z.default.string().required(),example:Z.default.array().items(Z.default.string().allow("")).optional()}).optional()}).pattern(Z.default.string(),Z.default.object({description:Z.default.string().required(),example:Z.default.array().items(Z.default.string().allow("")).optional()}))});var Lg=m(ln=>{"use strict";var eo=ln&&ln.__assign||function(){return eo=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},eo.apply(this,arguments)},pP=ln&&ln.__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},gi=ln&&ln.__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.")},Ig=ln&&ln.__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},hP=ln&&ln.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ln,"__esModule",{value:!0});ln.Signature=void 0;var Pg=hP(ll()),Mg=uA(),mP=$i(),gP=al(),yP=Ym(),bP=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;Pg.default.assert(e,Mg.signatureDefinitionContainerSchema);var i={};try{for(var s=gi(Object.entries(e)),o=s.next();!o.done;o=s.next()){var a=Ig(o.value,2),u=a[0],c=a[1],l=c.type===mP.SignatureDefinitionBaseType.Function?yP.SignatureDefinitionFunction.parse(c):gP.SignatureDefinition.parse(c);i[u]=l}}catch(d){n={error:d}}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;Pg.default.assert(e,Mg.descriptionContainerSchema);var a=e,u=null;if(a.$meta){var c=e.$meta,l=pP(e,["$meta"]);u=c,a=l}var d={};try{for(var p=gi(Object.entries(a)),y=p.next();!y.done;y=p.next()){var v=Ig(y.value,2),x=v[0],I=v[1];d[x]={description:I.description,example:(i=I.example)!==null&&i!==void 0?i:null}}}catch(P){n={error:P}}finally{try{y&&!y.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}return eo({$meta:{description:(s=u?.description)!==null&&s!==void 0?s:"unknown",example:(o=u?.example)!==null&&o!==void 0?o:null}},d)},t.parse=function(e,n){var r,i;Pg.default.assert(e,Mg.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=gi(Object.entries(n)),u=a.next();!u.done;u=a.next()){var c=Ig(u.value,2),l=c[0],d=c[1],p=t.parseDescriptions(d);s.addDescriptions(l,p)}}catch(y){r={error:y}}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=gi(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=gi(o),u=a.next();!u.done;u=a.next()){var c=u.value;s[c]=eo(eo({},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=gi(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=gi(a),c=u.next();!c.done;c=u.next()){var l=c.value;o[l]=this._definitions[l].copy()}}catch(x){e={error:x}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}var d={},p=Object.keys(this._descriptions);try{for(var y=gi(p),v=y.next();!v.done;v=y.next()){var l=v.value;d[l]=eo({},d[l])}}catch(x){r={error:x}}finally{try{v&&!v.done&&(i=y.return)&&i.call(y)}finally{if(r)throw r.error}}return s._descriptions=d,s._definitions=o,s},t}();ln.Signature=bP});var cA=m(vr=>{"use strict";var yi=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},to=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))},Aa=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 _r=Lg(),mt=$i(),_P=function(){function t(){this._primitives=new Map([[mt.SignatureDefinitionBaseType.Any,new _r.Signature({type:mt.SignatureDefinitionBaseType.Any})],[mt.SignatureDefinitionBaseType.General,new _r.Signature({type:mt.SignatureDefinitionBaseType.General})],[mt.SignatureDefinitionBaseType.String,new _r.Signature({type:mt.SignatureDefinitionBaseType.String})],[mt.SignatureDefinitionBaseType.Function,new _r.Signature({type:mt.SignatureDefinitionBaseType.Function})],[mt.SignatureDefinitionBaseType.Number,new _r.Signature({type:mt.SignatureDefinitionBaseType.Number})],[mt.SignatureDefinitionBaseType.List,new _r.Signature({type:mt.SignatureDefinitionBaseType.List})],[mt.SignatureDefinitionBaseType.Map,new _r.Signature({type:mt.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 _r.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 to(to([],yi(this._primitives.keys()),!1),yi(this._types.keys()),!1).filter(function(n){return!e.getTypeSignature(n).isHidden()&&n!==mt.SignatureDefinitionBaseType.Any&&n!==mt.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 to(to([],yi(this.getAllPrimitiveSignatures()),!1),yi(this.getAllTypeSignatures()),!1)},t.prototype.getAllVisibleSignatures=function(){return to(to([],yi(this.getAllPrimitiveSignatures()),!1),yi(this.getAllTypeSignatures()),!1).filter(function(e){return e.isHidden()})},t.prototype.addTypeSignatureFromPayload=function(e){var n=_r.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=Aa(o),u=a.next();!u.done;u=a.next()){var c=u.value,l=_r.Signature.parseDescriptions(n[c]);s[c]=l}}catch(d){r={error:d}}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=Aa(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(mt.SignatureDefinitionBaseType.Any)?new Set(this.getAllVisibleTypes()):new Set(e),a=new Set,u=new Map;try{for(var c=Aa(o),l=c.next();!l.done;l=c.next()){var d=l.value;if(!this._excludeFromSearch.has(d)){for(var p=d,y=this.getTypeSignature(d),v=null;y!==null&&!a.has(y.getType())&&(a.add(y.getType()),y.isHidden()||(v=y.getDefinition(n,r)),v===null);)p=y.getExtendedType(),y=this.getTypeSignature(p);v!==null&&u.set(p,v)}}}catch(x){i={error:x}}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(mt.SignatureDefinitionBaseType.Any).getDefinition(n,r);if(e.includes(mt.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(mt.SignatureDefinitionBaseType.Any)?s.get(mt.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=Aa(this._primitives),a=o.next();!a.done;a=o.next()){var u=yi(a.value,2),c=u[0],l=u[1];s._primitives.set(c,l.copy())}}catch(v){e={error:v}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}try{for(var d=Aa(this._types),p=d.next();!p.done;p=d.next()){var y=yi(p.value,2),c=y[0],l=y[1];s._types.set(c,l.copy())}}catch(v){r={error:v}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}return s._excludeFromSearch=new Set(this._excludeFromSearch),s},t}();vr.Container=_P});var dA=m(lA=>{"use strict";Object.defineProperty(lA,"__esModule",{value:!0})});var $n=m(ct=>{"use strict";var vP=ct&&ct.__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]}),fA=ct&&ct.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&vP(e,t,n)};Object.defineProperty(ct,"__esModule",{value:!0});ct.VariationRegistry=ct.Container=ct.Signature=ct.SignatureDefinition=ct.SignatureDefinitionTypeMeta=ct.SignatureDefinitionFunction=ct.SignatureDefinitionFunctionArg=void 0;var SP=Xm();Object.defineProperty(ct,"SignatureDefinitionFunctionArg",{enumerable:!0,get:function(){return SP.SignatureDefinitionFunctionArg}});var TP=Ym();Object.defineProperty(ct,"SignatureDefinitionFunction",{enumerable:!0,get:function(){return TP.SignatureDefinitionFunction}});var wP=ma();Object.defineProperty(ct,"SignatureDefinitionTypeMeta",{enumerable:!0,get:function(){return wP.SignatureDefinitionTypeMeta}});var EP=al();Object.defineProperty(ct,"SignatureDefinition",{enumerable:!0,get:function(){return EP.SignatureDefinition}});var AP=Lg();Object.defineProperty(ct,"Signature",{enumerable:!0,get:function(){return AP.Signature}});var xP=cA();Object.defineProperty(ct,"Container",{enumerable:!0,get:function(){return xP.Container}});var kP=ol();Object.defineProperty(ct,"VariationRegistry",{enumerable:!0,get:function(){return kP.VariationRegistry}});fA(dA(),ct);fA($i(),ct)});var Ng=m(Rl=>{"use strict";Object.defineProperty(Rl,"__esModule",{value:!0});Rl.enrichWithMetaInformation=void 0;var CP=n0(),pA=$n();function hA(t){return[t.name,t.description].filter(e=>e!==void 0).join(" ")}function OP(t){let e=(0,CP.parse)(`/**
103
+ [${u}] ${this.details[a].message}`}return o=o+r,o};Wi.safeStringify=function(t,e){return JSON.stringify(t,Wi.serializer(),e)};Wi.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[Wi.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 Dr=m(vt=>{"use strict";var JD=E0(),QD=Ke(),ZD=fi();vt.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=vt.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 vt.template(this.value,t,e||this.code,this.state,this.prefs)}};vt.path=function(t){let e="";for(let n of t)typeof n!="object"&&(typeof n=="string"?(e&&(e+="."),e+=n):e+=`[${n}]`);return e};vt.template=function(t,e,n,r,i){if(!e)return;if(ZD.isTemplate(e))return n!=="root"?e:null;let s=i.errors.language;if(QD.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["*"]};vt.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=vt.path(i);return s||vt.template(null,n.messages,"root",e,n)||r&&vt.template(null,r,"root",e,n)||"value"};vt.process=function(t,e,n){if(!t)return null;let{override:r,message:i,details:s}=vt.details(t);if(r)return r;if(n.errors.stack)return new vt.ValidationError(i,s,e);let o=Error.stackTraceLimit;Error.stackTraceLimit=0;let a=new vt.ValidationError(i,s,e);return Error.stackTraceLimit=o,a};vt.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}};vt.ValidationError=class extends Error{constructor(t,e,n){super(t),this._original=n,this.details=e}static isError(t){return t instanceof vt.ValidationError}};vt.ValidationError.prototype.isJoi=!0;vt.ValidationError.prototype.name="ValidationError";vt.ValidationError.prototype.annotate=JD.error});var Ir=m(Ln=>{"use strict";var Pn=ke(),eI=Jt(),tI=Hi(),ba=Ke(),eg,Mn={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};Ln.create=function(t,e={}){Pn(typeof t=="string","Invalid reference key:",t),ba.assertOptions(e,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),Pn(!e.prefix||typeof e.prefix=="object","options.prefix must be of type object");let n=Object.assign({},Mn.defaults,e);delete n.prefix;let r=n.separator,i=Mn.context(t,r,e.prefix);if(n.type=i.type,t=i.key,n.type==="value")if(i.root&&(Pn(!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)Pn(!r||!t||t[0]!==r,"Cannot combine prefix with ancestor option");else{let[s,o]=Mn.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 Mn.Ref(n)};Ln.in=function(t,e={}){return Ln.create(t,{...e,in:!0})};Ln.isRef=function(t){return t?!!t[ba.symbols.ref]:!1};Mn.Ref=class{constructor(t){Pn(typeof t=="object","Invalid reference construction"),ba.assertOptions(t,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),Pn([!1,void 0].includes(t.separator)||typeof t.separator=="string"&&t.separator.length===1,"Invalid separator"),Pn(!t.adjust||typeof t.adjust=="function","options.adjust must be a function"),Pn(!t.map||Array.isArray(t.map),"options.map must be an array"),Pn(!t.map||!t.adjust,"Cannot set both map and adjust options"),Object.assign(this,Mn.defaults,t),Pn(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 Pn(!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):(Pn(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=tI(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 Mn.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||""}`}};Mn.Ref.prototype[ba.symbols.ref]=!0;Ln.build=function(t){return t=Object.assign({},Mn.defaults,t),t.type==="value"&&t.ancestor===void 0&&(t.ancestor=1),new Mn.Ref(t)};Mn.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"}};Mn.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]};Ln.toSibling=0;Ln.toParent=1;Ln.Manager=class{constructor(){this.refs=[]}register(t,e){if(t){if(e=e===void 0?Ln.toParent:e,Array.isArray(t)){for(let n of t)this.register(n,e);return}if(ba.isSchema(t)){for(let n of t._refs.refs)n.ancestor-e>=0&&this.refs.push({ancestor:n.ancestor-e,root:n.root});return}Ln.isRef(t)&&t.type==="value"&&t.ancestor-e>=0&&this.refs.push({ancestor:t.ancestor-e,root:t.root}),eg=eg||fi(),eg.isTemplate(t)&&this.register(t.refs(),e)}}get length(){return this.refs.length}clone(){let t=new Ln.Manager;return t.refs=eI(this.refs),t}reset(){this.refs=[]}roots(){return this.refs.filter(t=>!t.ancestor).map(t=>t.root)}}});var fi=m((C0,O0)=>{"use strict";var dl=ke(),nI=Jt(),rI=S0(),iI=T0(),x0=Ke(),A0=Dr(),k0=Ir(),Me={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}};O0.exports=C0=Me.Template=class{constructor(t,e){if(dl(typeof t=="string","Template source must be a string"),dl(!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?nI(r):void 0,this._functions=n,this._functions&&(dl(Object.keys(this._functions).every(i=>typeof i=="string"),"Functions keys must be strings"),dl(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=Me.encode(this.source),e=Me.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(`{${Me.decode(s)}`);continue}let c=s.slice(o?0:1,u),l=c[0]===":";l&&(c=c.slice(1));let d=this._ref(Me.decode(c),{raw:o,wrapped:l});r.push(d),typeof d!="string"&&(n=!0);let p=s.slice(u+a.length);p&&r.push(Me.decode(p))}if(!n){this.rendered=r.join("");return}this._template=r}static date(t,e){return Me.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 Me.Template(t.template,t.options||t.functions?{...t.options,functions:t.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(t){return t?!!t[x0.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=Me.stringify(a,t,e,n,r,i);if(u!==void 0){let c=o.raw||(i.errors&&i.errors.escapeHtml)===!1?u:rI(u);s.push(Me.wrap(c,o.wrapped&&n.errors.wrap.label))}}return s.join("")}_ref(t,{raw:e,wrapped:n}){let r=[],i=o=>{let a=k0.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?{...Me.functions,...this._functions}:Me.functions;var s=new iI.Parser(t,{reference:i,functions:o,constants:Me.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 Me.stringify(s.single.value)}return{formula:s,raw:e,refs:r}}toString(){return this.source}};Me.Template.prototype[x0.symbols.template]=!0;Me.Template.prototype.isImmutable=!0;Me.encode=function(t){return t.replace(/\\(\{+)/g,(e,n)=>Me.opens.slice(0,n.length)).replace(/\\(\}+)/g,(e,n)=>Me.closes.slice(0,n.length))};Me.decode=function(t){return t.replace(/\u0000/g,"{").replace(/\u0001/g,"}")};Me.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};Me.wrap=function(t,e){return e?e.length===1?`${e}${t}${e}`:`${e[0]}${t}${e[1]}`:t};Me.stringify=function(t,e,n,r,i,s={}){let o=typeof t,a=r&&r.errors&&r.errors.wrap||{},u=!1;if(k0.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 Me.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 Me.Template.date(t,r);if(t instanceof Map){let l=[];for(let[d,p]of t.entries())l.push(`${d.toString()} -> ${p.toString()}`);t=l}if(!Array.isArray(t))return t.toString();let c=[];for(let l of t)c.push(Me.stringify(l,e,n,r,i,{arrayItems:!0,...s}));return Me.wrap(c.join(", "),!u&&a.array)};Me.constants={true:!0,false:!1,null:null,second:1e3,minute:60*1e3,hour:60*60*1e3,day:24*60*60*1e3};Me.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=A0.template(e,o[0],t,n,r)||A0.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 Ks=m(_a=>{"use strict";var Gi=ke(),R0=Jt(),vn=fi();_a.compile=function(t,e){if(typeof t=="string")return Gi(!e,"Cannot set single message string"),new vn(t);if(vn.isTemplate(t))return Gi(!e,"Cannot set single message template"),t;Gi(typeof t=="object"&&!Array.isArray(t),"Invalid message options"),e=e?R0(e):{};for(let n in t){let r=t[n];if(n==="root"||vn.isTemplate(r)){e[n]=r;continue}if(typeof r=="string"){e[n]=new vn(r);continue}Gi(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"||vn.isTemplate(s)){e[i][n]=s;continue}Gi(typeof s=="string","Invalid message for",n,"in",i),e[i][n]=new vn(s)}}return e};_a.decompile=function(t){let e={};for(let n in t){let r=t[n];if(n==="root"){e.root=r;continue}if(vn.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};_a.merge=function(t,e){if(!t)return _a.compile(e);if(!e)return t;if(typeof e=="string")return new vn(e);if(vn.isTemplate(e))return e;let n=R0(t);for(let r in e){let i=e[r];if(r==="root"||vn.isTemplate(i)){n[r]=i;continue}if(typeof i=="string"){n[r]=new vn(i);continue}Gi(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"||vn.isTemplate(o)){n[s][r]=o;continue}Gi(typeof o=="string","Invalid message for",r,"in",s),n[s][r]=new vn(o)}}return n}});var Ke=m(Xe=>{"use strict";var fl=ke(),sI=Ym(),oI=_0(),tg,ng,aI={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)?)?)?)?$/};Xe.version=oI.version;Xe.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};Xe.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")};Xe.assertOptions=function(t,e,n="Options"){fl(t&&typeof t=="object"&&!Array.isArray(t),"Options must be of type object");let r=Object.keys(t).filter(i=>!e.includes(i));fl(r.length===0,`${n} contain unknown keys: ${r}`)};Xe.checkPreferences=function(t){ng=ng||cl();let e=ng.preferences.validate(t);if(e.error)throw new sI([e.error.details[0].message])};Xe.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}};Xe.default=function(t,e){return t===void 0?e:t};Xe.isIsoDate=function(t){return aI.isoDate.test(t)};Xe.isNumber=function(t){return typeof t=="number"&&!isNaN(t)};Xe.isResolvable=function(t){return t?t[Xe.symbols.ref]||t[Xe.symbols.template]:!1};Xe.isSchema=function(t,e={}){let n=t&&t[Xe.symbols.any];return n?(fl(e.legacy||n.version===Xe.version,"Cannot mix different versions of joi schemas"),!0):!1};Xe.isValues=function(t){return t[Xe.symbols.values]};Xe.limit=function(t){return Number.isSafeInteger(t)&&t>=0};Xe.preferences=function(t,e){tg=tg||Ks(),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=tg.compile(e.messages,t.messages)),delete n[Xe.symbols.prefs],n};Xe.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}};Xe.validateArg=function(t,e,{assert:n,message:r}){if(Xe.isSchema(n)){let i=n.validate(t);return i.error?i.error.message:void 0}else if(!n(t))return e?`${e} ${r}`:r};Xe.verifyFlat=function(t,e){for(let n of t)fl(!Array.isArray(n),"Method no longer accepts array arguments:",e)}});var rg=m(D0=>{"use strict";var uI=ke(),cI=Jt(),lI=Ke(),Xs={max:1e3,supported:new Set(["undefined","boolean","number","string"])};D0.provider={provision(t){return new Xs.Cache(t)}};Xs.Cache=class{constructor(t={}){lI.assertOptions(t,["max"]),uI(t.max===void 0||t.max&&t.max>0&&isFinite(t.max),"Invalid max cache size"),this._max=t.max||Xs.max,this._map=new Map,this._list=new Xs.List}get length(){return this._map.size}set(t,e){if(t!==null&&!Xs.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),cI(e.value)}_compact(){if(this._map.size>this._max){let t=this._list.pop();this._map.delete(t.key)}}};Xs.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 Vi=m(Pr=>{"use strict";var ut=ke(),Sn=Ke(),Ys=Ir(),Nn={};Pr.schema=function(t,e,n={}){Sn.assertOptions(n,["appendPath","override"]);try{return Nn.schema(t,e,n)}catch(r){throw n.appendPath&&r.path!==void 0&&(r.message=`${r.message} (${r.path})`),r}};Nn.schema=function(t,e,n){ut(e!==void 0,"Invalid undefined schema"),Array.isArray(e)&&(ut(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(Nn.simple(e))return r(t,e);if(typeof e=="function")return t.custom(e);if(ut(typeof e=="object","Invalid schema content:",typeof e),Sn.isResolvable(e))return r(t,e);if(Sn.isSchema(e))return e;if(Array.isArray(e)){for(let i of e)if(!Nn.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):(ut(Object.getPrototypeOf(e)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),t.object().keys(e))};Pr.ref=function(t,e){return Ys.isRef(t)?t:Ys.create(t,e)};Pr.compile=function(t,e,n={}){Sn.assertOptions(n,["legacy"]);let r=e&&e[Sn.symbols.any];if(r)return ut(n.legacy||r.version===Sn.version,"Cannot mix different versions of joi schemas:",r.version,Sn.version),e;if(typeof e!="object"||!n.legacy)return Pr.schema(t,e,{appendPath:!0});let i=Nn.walk(e);return i?i.compile(i.root,e):Pr.schema(t,e,{appendPath:!0})};Nn.walk=function(t){if(typeof t!="object")return null;if(Array.isArray(t)){for(let n of t){let r=Nn.walk(n);if(r)return r}return null}let e=t[Sn.symbols.any];if(e)return{root:t[e.root],compile:e.compile};ut(Object.getPrototypeOf(t)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(let n in t){let r=Nn.walk(t[n]);if(r)return r}return null};Nn.simple=function(t){return t===null||["boolean","string","number"].includes(typeof t)};Pr.when=function(t,e,n){if(n===void 0&&(ut(e&&typeof e=="object","Missing options"),n=e,e=Ys.create(".")),Array.isArray(n)&&(n={switch:n}),Sn.assertOptions(n,["is","not","then","otherwise","switch","break"]),Sn.isSchema(e))return ut(n.is===void 0,'"is" can not be used with a schema condition'),ut(n.not===void 0,'"not" can not be used with a schema condition'),ut(n.switch===void 0,'"switch" can not be used with a schema condition'),Nn.condition(t,{is:e,then:n.then,otherwise:n.otherwise,break:n.break});if(ut(Ys.isRef(e)||typeof e=="string","Invalid condition:",e),ut(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 ut(i.then!==void 0||i.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),ut(i.break===void 0||i.then===void 0||i.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),n.is!==void 0&&!Ys.isRef(n.is)&&!Sn.isSchema(n.is)&&(s=s.required()),Nn.condition(t,{ref:Pr.ref(e),is:s,then:i.then,otherwise:i.otherwise,break:i.break})}ut(Array.isArray(n.switch),'"switch" must be an array'),ut(n.is===void 0,'Cannot combine "switch" with "is"'),ut(n.not===void 0,'Cannot combine "switch" with "not"'),ut(n.then===void 0,'Cannot combine "switch" with "then"');let r={ref:Pr.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;Sn.assertOptions(s,o?["is","then","otherwise"]:["is","then"]),ut(s.is!==void 0,'Switch statement missing "is"'),ut(s.then!==void 0,'Switch statement missing "then"');let a={is:t.$_compile(s.is),then:t.$_compile(s.then)};if(!Ys.isRef(s.is)&&!Sn.isSchema(s.is)&&(a.is=a.is.required()),o){ut(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&&(ut(r.break===void 0,"Cannot specify both otherwise and break"),a.otherwise=t.$_compile(u))}r.switch.push(a)}return r};Nn.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 ig=m(P0=>{"use strict";var pi=ke(),dI=Jt(),I0=Ke(),fI=Ks(),pr={};P0.type=function(t,e){let n=Object.getPrototypeOf(t),r=dI(n),i=t._assign(Object.create(r)),s=Object.assign({},e);delete s.base,r._definition=s;let o=n._definition||{};s.messages=fI.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 d in s.terms){let p=s.terms[d];pi(i.$_terms[d]===void 0,"Invalid term override for",s.type,d),i.$_terms[d]=p.init,a[d]=p}s.terms=a,s.args||(s.args=o.args),s.prepare=pr.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=pr.coerce(s.coerce,o.coerce),s.validate=pr.validate(s.validate,o.validate);let u=Object.assign({},o.rules);if(s.rules)for(let d in s.rules){let p=s.rules[d];pi(typeof p=="object","Invalid rule definition for",s.type,d);let y=p.method;if(y===void 0&&(y=function(){return this.$_addRule(d)}),y&&(pi(!r[d],"Rule conflict in",s.type,d),r[d]=y),pi(!u[d],"Rule conflict in",s.type,d),u[d]=p,p.alias){let v=[].concat(p.alias);for(let x of v)r[x]=p.method}p.args&&(p.argsByName=new Map,p.args=p.args.map(v=>(typeof v=="string"&&(v={name:v}),pi(!p.argsByName.has(v.name),"Duplicated argument name",v.name),I0.isSchema(v.assert)&&(v.assert=v.assert.strict().label(v.name)),p.argsByName.set(v.name,v),v)))}s.rules=u;let c=Object.assign({},o.modifiers);if(s.modifiers)for(let d in s.modifiers){pi(!r[d],"Rule conflict in",s.type,d);let p=s.modifiers[d];pi(typeof p=="function","Invalid modifier definition for",s.type,d);let y=function(v){return this.rule({[d]:v})};r[d]=y,c[d]=p}if(s.modifiers=c,s.overrides){r._super=n,i.$_super={};for(let d in s.overrides)pi(n[d],"Cannot override missing",d),s.overrides[d][I0.symbols.parent]=n[d],i.$_super[d]=n[d].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=pr.build(s.manifest&&s.manifest.build,o.manifest&&o.manifest.build),s.manifest=l,s.rebuild=pr.rebuild(s.rebuild,o.rebuild),i};pr.build=function(t,e){return!t||!e?t||e:function(n,r){return e(t(n,r),r)}};pr.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}}};pr.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}};pr.rebuild=function(t,e){return!t||!e?t||e:function(n){e(n),t(n)}};pr.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 ag=m(og=>{"use strict";var hr=ke(),pl=Jt(),zi=Ke(),pI=Ks(),M0=Ir(),hI=fi(),sg,Qt={};og.describe=function(t){let e=t._definition,n={type:t.type,flags:{},rules:[]};for(let r in t._flags)r[0]!=="_"&&(n.flags[r]=Qt.describe(t._flags[r]));Object.keys(n.flags).length||delete n.flags,t._preferences&&(n.preferences=pl(t._preferences,{shallow:["messages"]}),delete n.preferences[zi.symbols.prefs],n.preferences.messages&&(n.preferences.messages=pI.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]=Qt.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]=Qt.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;hr(!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(zi.isValues(i)){n[r]=i.describe();continue}hr(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(Qt.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"){hr(a.length===1,"Term",r,"contains more than one item"),n[r]=a[0];continue}n[r]=a}return Qt.validate(t.$_root,n),n};Qt.describe=function(t,e={}){if(Array.isArray(t))return t.map(Qt.describe);if(t===zi.symbols.deepDefault)return{special:"deep"};if(typeof t!="object"||t===null)return t;if(e.assign==="options")return pl(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[zi.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]=Qt.describe(i,{assign:r}))}return n};og.build=function(t,e){return new Qt.Builder(t).parse(e)};Qt.Builder=class{constructor(t){this.joi=t}parse(t){Qt.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;hr(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){hr(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){hr(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 hr(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;hr(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 pl(t);if(e.assign==="regex")return Qt.regex(t);if(e.assign==="ref")return M0.build(t);if(typeof t!="object")return t;if(Object.keys(t).length===1){if(t.buffer)return hr(Buffer,"Buffers are not supported"),Buffer&&Buffer.from(t.buffer,"binary");if(t.function)return{[zi.symbols.literal]:!0,literal:t.function};if(t.override)return zi.symbols.override;if(t.ref)return M0.build(t.ref);if(t.regex)return Qt.regex(t.regex);if(t.special)return hr(["deep"].includes(t.special),"Unknown special value",t.special),zi.symbols.deepDefault;if(t.value)return pl(t.value)}if(t.type)return this.parse(t);if(t.template)return hI.build(t);let n={};for(let r in t)n[r]=this.build(t[r],{assign:r});return n}};Qt.regex=function(t){let e=t.lastIndexOf("/"),n=t.slice(1,e),r=t.slice(e+1);return new RegExp(n,r)};Qt.validate=function(t,e){sg=sg||cl(),t.assert(e,sg.description)}});var va=m(($2,L0)=>{"use strict";var mr=Qm(),Ht={mismatched:null};L0.exports=function(t,e,n){return n=Object.assign({prototype:!0},n),!!Ht.isDeepEqual(t,e,n,[])};Ht.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=Ht.getSharedType(t,e,!!n.prototype);switch(s){case mr.buffer:return Buffer&&Buffer.prototype.equals.call(t,e);case mr.promise:return t===e;case mr.regex:return t.toString()===e.toString();case Ht.mismatched:return!1}for(let o=r.length-1;o>=0;--o)if(r[o].isSame(t,e))return!0;r.push(new Ht.SeenEntry(t,e));try{return!!Ht.isDeepEqualObj(s,t,e,n,r)}finally{r.pop()}};Ht.getSharedType=function(t,e,n){if(n)return Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?Ht.mismatched:mr.getInternalProto(t);let r=mr.getInternalProto(t);return r!==mr.getInternalProto(e)?Ht.mismatched:r};Ht.valueOf=function(t){let e=t.valueOf;if(e===void 0)return t;try{return e.call(t)}catch(n){return n}};Ht.hasOwnEnumerableProperty=function(t,e){return Object.prototype.propertyIsEnumerable.call(t,e)};Ht.isSetSimpleEqual=function(t,e){for(let n of Set.prototype.values.call(t))if(!Set.prototype.has.call(e,n))return!1;return!0};Ht.isDeepEqualObj=function(t,e,n,r,i){let{isDeepEqual:s,valueOf:o,hasOwnEnumerableProperty:a}=Ht,{keys:u,getOwnPropertySymbols:c}=Object;if(t===mr.array)if(r.part){for(let v of e)for(let x of n)if(s(v,x,r,i))return!0}else{if(e.length!==n.length)return!1;for(let v=0;v<e.length;++v)if(!s(e[v],n[v],r,i))return!1;return!0}else if(t===mr.set){if(e.size!==n.size)return!1;if(!Ht.isSetSimpleEqual(e,n)){let v=new Set(Set.prototype.values.call(n));for(let x of Set.prototype.values.call(e)){if(v.delete(x))continue;let I=!1;for(let P of v)if(s(x,P,r,i)){v.delete(P),I=!0;break}if(!I)return!1}}}else if(t===mr.map){if(e.size!==n.size)return!1;for(let[v,x]of Map.prototype.entries.call(e))if(x===void 0&&!Map.prototype.has.call(n,v)||!s(x,Map.prototype.get.call(n,v),r,i))return!1}else if(t===mr.error&&(e.name!==n.name||e.message!==n.message))return!1;let l=o(e),d=o(n);if((e!==l||n!==d)&&!s(l,d,r,i))return!1;let p=u(e);if(!r.part&&p.length!==u(n).length&&!r.skip)return!1;let y=0;for(let v of p){if(r.skip&&r.skip.includes(v)){n[v]===void 0&&++y;continue}if(!a(n,v)||!s(e[v],n[v],r,i))return!1}if(!r.part&&p.length-y!==u(n).length)return!1;if(r.symbols!==!1){let v=c(e),x=new Set(c(n));for(let I of v){if(!r.skip||!r.skip.includes(I)){if(a(e,I)){if(!a(n,I)||!s(e[I],n[I],r,i))return!1}else if(a(n,I))return!1}x.delete(I)}for(let I of x)if(a(n,I))return!1}return!0};Ht.SeenEntry=class{constructor(t,e){this.obj=t,this.ref=e}isSame(t,e){return this.obj===t&&this.ref===e}}});var q0=m(N0=>{"use strict";N0.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 cg=m(ug=>{"use strict";var j0=va(),F0=q0(),mI=Dr(),Wt={codes:{error:1,pass:2,full:3},labels:{0:"never used",1:"always error",2:"always pass"}};ug.setup=function(t){let e=function(){return t._tracer=t._tracer||new Wt.Tracer,t._tracer};t.trace=e,t[Symbol.for("@hapi/lab/coverage/initialize")]=e,t.untrace=()=>{t._tracer=null}};ug.location=function(t){return t.$_setFlag("_tracerLocation",F0.location(2))};Wt.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 Wt.Store(t),{filename:r,line:i}=t._flags._tracerLocation||F0.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(Wt.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 d=a[`_${l}s`];if(!d)continue;let p=new Set(d._values),y=new Set(d._refs);for(let{value:v,ref:x}of u[l])p.delete(v),y.delete(x);(p.size||y.size)&&s.push({status:[...p,...[...y].map(v=>v.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 d=Wt.labels[u.rule[l]||0];if(d){let p={rule:l,status:d};u.paths.size&&(p.paths=[...u.paths]),s.push(p)}}}s.length&&e.push({filename:n,line:r,missing:s,severity:"error",message:`Schema missing tests for ${s.map(Wt.message).join(", ")}`})}return e.length?e:null}};Wt.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){Wt.debug(e,{type:"entry"}),this._record(t,n=>{n.entry=!0})}filter(t,e,n,r){Wt.debug(e,{type:n,...r}),this._record(t,i=>{i[n].add(r)})}log(t,e,n,r,i){Wt.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]|=Wt.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||j0(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=Wt.id(s,o);this._scan(s,n.concat(a))};t.$_modify({each:i,ref:!1})}_combine(t,e){this._combos.set(t,e)}};Wt.message=function(t){return`${t.paths?mI.path(t.paths[0])+(t.rule?":":""):""}${t.rule||""} (${t.status})`};Wt.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)};Wt.sub=function(t,e){for(let n of t)for(let r of e)if(j0(n.slice(0,r.length),r))return!0;return!1};Wt.debug=function(t,e){t.mainstay.debug&&(e.path=t.debug?[...t.path,t.debug]:t.path,t.mainstay.debug.push(e))}});var hl=m((V2,U0)=>{"use strict";var lg=ke(),$0=Jt(),gI=Zm(),B0={};U0.exports=B0.merge=function(t,e,n){if(lg(t&&typeof t=="object","Invalid target value: must be an object"),lg(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)){lg(Array.isArray(t),"Cannot merge array onto an object"),n.mergeArrays||(t.length=0);for(let i=0;i<e.length;++i)t.push($0(e[i],{symbols:n.symbols}));return t}let r=gI.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]=$0(o,{symbols:n.symbols}):B0.merge(t[s],o,n)}else(o!=null||n.nullOverride)&&(t[s]=o)}return t}});var H0=m(ml=>{"use strict";var Mr=ke(),dg=Ke(),yI=Ir(),gr={};ml.Ids=gr.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){let t=new gr.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())Mr(!this._byKey.has(e),"Schema id conflicts with existing key:",e),this._byId.set(e,n);for(let[e,n]of t._byKey.entries())Mr(!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)};Mr(dg.isSchema(s.schema),"adjuster function failed to return a joi schema type");for(let o of r)s={id:o.id,schema:gr.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);Mr(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||!dg.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);Mr(!r||r.schema===t,"Cannot add different schemas with the same id:",n),Mr(!this._byKey.has(n),"Schema id conflicts with existing key:",n),this._byId.set(n,{schema:t,id:n})}e&&(Mr(!this._byKey.has(e),"Schema already contains key:",e),Mr(!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);Mr(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)}};gr.fork=function(t,e,n){let r=(s,{key:o})=>{if(e===(s._flags.id||o))return n},i=ml.schema(t,{each:r,ref:!1});return i?i.$_mutateRebuild():t};ml.schema=function(t,e){let n;for(let r in t._flags){if(r[0]==="_")continue;let i=gr.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=gr.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=gr.scan(t.$_terms[r],{source:"terms",name:r},e);i!==void 0&&(n=n||t.clone(),n.$_terms[r]=i)}return n};gr.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=gr.scan(t[a],e,n,[a,...s],u);c!==void 0&&(o=o||t.slice(),o[a]=c)}return o}if(n.schema!==!1&&dg.isSchema(t)||n.ref!==!1&&yI.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=gr.scan(t[a],e,n,[a,...s],i);u!==void 0&&(o=o||Object.assign({},t),o[a]=u)}return o}});var G0=m((X2,W0)=>{"use strict";W0.exports=function(){}});var K0=m((Y2,z0)=>{"use strict";var bI=Jt(),V0=Hi(),_I=Ke(),yr={value:Symbol("value")};z0.exports=yr.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 yr.State(t,e,this);return n&&r.schemas&&(r.schemas=[yr.schemas(n),...r.schemas]),r}nest(t,e){let n=new yr.State(this.path,this.ancestors,this);return n.schemas=n.schemas&&[yr.schemas(t),...n.schemas],n.debug=e,n}shadow(t,e){this.mainstay.shadow=this.mainstay.shadow||new yr.Shadow,this.mainstay.shadow.set(this.path,t,e)}snapshot(){this.mainstay.shadow&&(this._snapshot=bI(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()}};yr.schemas=function(t){return _I.isSchema(t)?{schema:t}:t};yr.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[yr.value]=e}get(t){let e=this.node(t);if(e)return e[yr.value]}node(t){if(this._values)return V0(this._values,t,{iterables:!0})}override(t,e){if(!this._values)return;let n=t.slice(0,-1),r=t[t.length-1],i=V0(this._values,n,{iterables:!0});if(e){i.set(r,e);return}i&&i.delete(r)}}});var Y0=m(Ta=>{"use strict";var Sa=ke(),X0=Jt(),Js=G0(),vI=Hi(),Et=Ke(),hi=Dr(),SI=K0(),ye={result:Symbol("result")};Ta.entry=function(t,e,n){let r=Et.defaults;n&&(Sa(n.warnings===void 0,"Cannot override warnings preference in synchronous validation"),Sa(n.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),r=Et.preferences(Et.defaults,n));let i=ye.entry(t,e,r);Sa(!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};Ta.entryAsync=async function(t,e,n){let r=Et.defaults;n&&(r=Et.preferences(Et.defaults,n));let i=ye.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,d=c.schema.type==="link"?s.links.get(c.schema):null,p=a,y,v,x=l.length?[a]:[],I=l.length?vI(t,l):t;if(l.length){y=l[l.length-1];let P=a;for(let w of l.slice(0,-1))P=P[w],x.unshift(P);v=x[0],p=v[y]}try{let P=(E,_)=>(d||c.schema).$_createError(E,p,_,c.state,r),w=await c.method(p,{schema:c.schema,linked:d,state:c.state,prefs:n,original:I,error:P,errorsArray:ye.errorsArray,warn:(E,_)=>s.warnings.push((d||c.schema).$_createError(E,p,_,c.state,r)),message:(E,_)=>(d||c.schema).$_createError("external",p,_,c.state,r,{messages:E})});if(w===void 0||w===p)continue;if(w instanceof hi.Report){if(s.tracer.log(c.schema,c.state,"rule","external","error"),u.push(w),r.abortEarly)break;continue}if(Array.isArray(w)&&w[Et.symbols.errors]){if(s.tracer.log(c.schema,c.state,"rule","external","error"),u.push(...w),r.abortEarly)break;continue}v?(s.tracer.value(c.state,"rule",p,w,"external"),v[y]=w):(s.tracer.value(c.state,"rule",a,w,"external"),a=w)}catch(P){throw r.errors.label&&(P.message+=` (${c.label})`),P}}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};ye.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()}};ye.entry=function(t,e,n){let{tracer:r,cleanup:i}=ye.tracer(e,n),s=n.debug?[]:null,o=e._ids._schemaChain?new Map:null,a=new ye.Mainstay(r,s,o),u=e._ids._schemaChain?[{schema:e}]:null,c=new SI([],[],{mainstay:a,schemas:u}),l=Ta.validate(t,e,c,n);i&&e.$_root.untrace();let d=hi.process(l.errors,t,n);return{value:l.value,error:d,mainstay:a}};ye.tracer=function(t,e){return t.$_root._tracer?{tracer:t.$_root._tracer._register(t)}:e.debug?(Sa(t.$_root.trace,"Debug mode not supported"),{tracer:t.$_root.trace()._register(t),cleanup:!0}):{tracer:ye.ignore}};Ta.validate=function(t,e,n,r,i={}){if(e.$_terms.whens&&(e=e._generate(t,n,r).schema),e._preferences&&(r=ye.prefs(e,r)),e._cache&&r.cache){let d=e._cache.get(t);if(n.mainstay.tracer.debug(n,"validate","cached",!!d),d)return d}let s=(d,p,y)=>e.$_createError(d,t,p,y||n,r),o={original:t,prefs:r,schema:e,state:n,error:s,errorsArray:ye.errorsArray,warn:(d,p,y)=>n.mainstay.warnings.push(s(d,p,y)),message:(d,p)=>e.$_createError("custom",t,p,n,r,{messages:d})};n.mainstay.tracer.entry(e,n);let a=e._definition;if(a.prepare&&t!==void 0&&r.convert){let d=a.prepare(t,o);if(d){if(n.mainstay.tracer.value(n,"prepare",t,d.value),d.errors)return ye.finalize(d.value,[].concat(d.errors),o);t=d.value}}if(a.coerce&&t!==void 0&&r.convert&&(!a.coerce.from||a.coerce.from.includes(typeof t))){let d=a.coerce.method(t,o);if(d){if(n.mainstay.tracer.value(n,"coerced",t,d.value),d.errors)return ye.finalize(d.value,[].concat(d.errors),o);t=d.value}}let u=e._flags.empty;u&&u.$_match(ye.trim(t,e),n.nest(u),Et.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 ye.finalize(t,null,o);if(c==="required")return ye.finalize(t,[e.$_createError("any.required",t,null,n,r)],o);if(c==="optional"){if(e._flags.default!==Et.symbols.deepDefault)return ye.finalize(t,null,o);n.mainstay.tracer.value(n,"default",t,{}),t={}}}else if(c==="forbidden")return ye.finalize(t,[e.$_createError("any.unknown",t,null,n,r)],o);let l=[];if(e._valids){let d=e._valids.get(t,n,r,e._flags.insensitive);if(d)return r.convert&&(n.mainstay.tracer.value(n,"valids",t,d.value),t=d.value),n.mainstay.tracer.filter(e,n,"valid",d),ye.finalize(t,null,o);if(e._flags.only){let p=e.$_createError("any.only",t,{valids:e._valids.values({display:!0})},n,r);if(r.abortEarly)return ye.finalize(t,[p],o);l.push(p)}}if(e._invalids){let d=e._invalids.get(t,n,r,e._flags.insensitive);if(d){n.mainstay.tracer.filter(e,n,"invalid",d);let p=e.$_createError("any.invalid",t,{invalids:e._invalids.values({display:!0})},n,r);if(r.abortEarly)return ye.finalize(t,[p],o);l.push(p)}}if(a.validate){let d=a.validate(t,o);if(d&&(n.mainstay.tracer.value(n,"base",t,d.value),t=d.value,d.errors)){if(!Array.isArray(d.errors))return l.push(d.errors),ye.finalize(t,l,o);if(d.errors.length)return l.push(...d.errors),ye.finalize(t,l,o)}}return e._rules.length?ye.rules(t,l,o):ye.finalize(t,l,o)};ye.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 d of o._resolve){let p=a.argsByName.get(d),y=c[d].resolve(t,i,s),v=p.normalize?p.normalize(y):y,x=Et.validateArg(v,null,p);if(x){u=r.$_createError("any.ref",y,{arg:d,ref:c[d],reason:x},i,s);break}c[d]=v}}u=u||a.validate(t,n,c,o);let l=ye.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 ye.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 ye.finalize(t,e,n)};ye.rule=function(t,e){return t instanceof hi.Report?(ye.error(t,e),{errors:[t],value:null}):Array.isArray(t)&&t[Et.symbols.errors]?(t.forEach(n=>ye.error(n,e)),{errors:t,value:null}):{errors:null,value:t}};ye.error=function(t,e){return e.message&&t._setTemplate(e.message),t};ye.finalize=function(t,e,n){e=e||[];let{schema:r,state:i,prefs:s}=n;if(e.length){let a=ye.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)Sa(a instanceof Error||a instanceof hi.Report,"error() must return an Error object")}else e=[r._flags.error];if(t===void 0){let a=ye.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};ye.prefs=function(t,e){let n=e===Et.defaults;return n&&t._preferences[Et.symbols.prefs]?t._preferences[Et.symbols.prefs]:(e=Et.preferences(e,t._preferences),n&&(t._preferences[Et.symbols.prefs]=e),e)};ye.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?[X0(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[Et.symbols.literal]?a.literal:Et.isResolvable(a)?a.resolve(e,s,o):X0(a)};ye.trim=function(t,e){if(typeof t!="string")return t;let n=e.$_getRule("trim");return!n||!n.args.enabled?t:t.trim()};ye.ignore={active:!1,debug:Js,entry:Js,filter:Js,log:Js,resolve:Js,value:Js};ye.errorsArray=function(){let t=[];return t[Et.symbols.errors]=!0,t}});var pg=m((tB,Q0)=>{"use strict";var TI=ke(),J0=va(),fg=Ke(),Lr={};Q0.exports=Lr.Values=class{constructor(t,e){this._values=new Set(t),this._refs=new Set(e),this._lowercase=Lr.lowercases(t),this._override=!1}get length(){return this._values.size+this._refs.size}add(t,e){if(fg.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 Lr.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(fg.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(J0(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(J0(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 Lr.Values(this._values,this._refs);return t._override=this._override,t}concat(t){TI(!t._override,"Cannot concat override set of values");let e=new Lr.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}};Lr.Values.prototype[fg.symbols.values]=!0;Lr.Values.prototype.slice=Lr.Values.prototype.clone;Lr.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 oE=m((rB,sE)=>{"use strict";var Y=ke(),Z0=Jt(),eE=va(),hg=hl(),wI=rg(),ht=Ke(),mg=Vi(),EI=Dr(),AI=ig(),tE=ag(),xI=Ks(),nE=H0(),rE=Ir(),iE=cg(),gl=Y0(),yl=pg(),Dt={};Dt.Base=class{constructor(t){this.type=t,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new nE.Ids,this._preferences=null,this._refs=new rE.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 Y(typeof tE.describe=="function","Manifest functionality disabled"),tE.describe(this)}allow(...t){return ht.verifyFlat(t,"allow"),this._values(t,"_valids")}alter(t){Y(t&&typeof t=="object"&&!Array.isArray(t),"Invalid targets argument"),Y(!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];Y(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 Y(t!==void 0,"Artifact cannot be undefined"),Y(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",t)}cast(t){return Y(t===!1||typeof t=="string","Invalid to value"),Y(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 Y(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 Y(t,"Missing error"),Y(t instanceof Error||typeof t=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",t)}example(t,e={}){return Y(t!==void 0,"Missing example"),ht.assertOptions(e,["override"]),this._inner("examples",t,{single:!0,override:e.override})}external(t,e){return typeof t=="object"&&(Y(!e,"Cannot combine options with description"),e=t.description,t=t.method),Y(typeof t=="function","Method must be a function"),Y(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?(Y(typeof t=="string","id must be a non-empty string"),Y(/^[^\.]+$/.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 Y(t&&typeof t=="string","Label name must be a non-empty string"),this.$_setFlag("label",t)}meta(t){return Y(t!==void 0,"Meta cannot be undefined"),this._inner("metas",t,{single:!0})}note(...t){Y(t.length,"Missing notes");for(let e of t)Y(e&&typeof e=="string","Notes must be non-empty strings");return this._inner("notes",t)}only(t=!0){return Y(typeof t=="boolean","Invalid mode:",t),this.$_setFlag("only",t)}optional(){return this.presence("optional")}prefs(t){Y(t,"Missing preferences"),Y(t.context===void 0,"Cannot override context"),Y(t.externals===void 0,"Cannot override externals"),Y(t.warnings===void 0,"Cannot override warnings"),Y(t.debug===void 0,"Cannot override debug"),ht.checkPreferences(t);let e=this.clone();return e._preferences=ht.preferences(e._preferences,t),e}presence(t){return Y(["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 Y(["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=ht.preferences(e._preferences,{convert:n}),e}strip(t=!0){return this.$_setFlag("result",t?"strip":void 0)}tag(...t){Y(t.length,"Missing tags");for(let e of t)Y(e&&typeof e=="string","Tags must be non-empty strings");return this._inner("tags",t)}unit(t){return Y(t&&typeof t=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",t)}valid(...t){ht.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=mg.when(n,t,e);if(!["any","link"].includes(n.type)){let i=r.is?[r]:r.switch;for(let s of i)Y(!s.then||s.then.type==="any"||s.then.type===n.type,"Cannot combine",n.type,"with",s.then&&s.then.type),Y(!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){Y(!this._inRuleset(),"Cannot set caching inside a ruleset"),Y(!this._cache,"Cannot override schema cache"),Y(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");let e=this.clone();return e._cache=t||wI.provider.provision(),e.$_temp.ruleset=!1,e}clone(){let t=Object.create(Object.getPrototypeOf(this));return this._assign(t)}concat(t){Y(ht.isSchema(t),"Invalid schema object"),Y(this.type==="any"||t.type==="any"||t.type===this.type,"Cannot merge type",this.type,"with another type:",t.type),Y(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),Y(!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,rE.toSibling),e._preferences=e._preferences?ht.preferences(e._preferences,t._preferences):t._preferences,e._valids=yl.merge(e._valids,t._valids,t._invalids),e._invalids=yl.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,hg(e._flags,n)}else if(t._flags.empty){e._flags.empty=t._flags.empty;let n=Object.assign({},t._flags);delete n.empty,hg(e._flags,n)}else hg(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 Y(!t.base,"Cannot extend type with another base"),AI.type(this,t)}extract(t){return t=Array.isArray(t)?t:t.split("."),this._ids.reach(t)}fork(t,e){Y(!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;ht.assertOptions(t,Object.keys(e.modifiers)),Y(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;Y(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=Z0(s);for(let a in t)e.modifiers[a](o,t[a]),Y(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(){Y(!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),Y(!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),Y(ht.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 iE.location?iE.location(this):this}validate(t,e){return gl.entry(t,this,e)}validateAsync(t,e){return gl.entryAsync(t,this,e)}$_addRule(t){typeof t=="string"&&(t={name:t}),Y(t&&typeof t=="object","Invalid options"),Y(t.name&&typeof t.name=="string","Invalid rule name");for(let s in t)Y(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;Y(n,"Unknown rule",e.method);let i=this.clone();if(r){Y(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&&ht.isResolvable(o))e._resolve.push(s),i.$_mutateRegister(o);else if(a.normalize&&(o=a.normalize(o),r[s]=o),a.assert){let u=ht.validateArg(o,s,a);Y(!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 mg.schema(this.$_root,t,e)}$_createError(t,e,n,r,i,s={}){let o=s.flags!==!1?this._flags:{},a=s.messages?xI.merge(this._definition.messages,s.messages):this._definition.messages;return new EI.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=!gl.validate(t,this,e,n,r).errors;return e.restore(),i}$_modify(t){return ht.assertOptions(t,["each","once","ref","schema"]),nE.schema(this,t)||this}$_mutateRebuild(){Y(!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={}){Y(t[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");let r=this._definition.flags[t]||{};if(eE(e,r.default)&&(e=void 0),eE(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][ht.symbols.parent].call(this,...e)}$_validate(t,e,n){return gl.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=Z0(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 ht.assertOptions(n,"literal"),Y(e!==void 0,"Missing",t,"value"),Y(typeof e=="function"||!n.literal,"Only function value supports literal option"),typeof e=="function"&&n.literal&&(e={[ht.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,d=i.length;for(let p=0;p<l.length;++p){let{is:y,then:v,otherwise:x}=l[p],I=`${a}${u.switch?"."+p:""}`;if(y.$_match(c,e.nest(y,`${I}.is`),n)){if(v){let P=e.localize([...e.path,`${I}.then`],e.ancestors,e.schemas),{schema:w,id:E}=v._generate(t,P,n);r.push(w),i.push(`${I}.then${E?`(${E})`:""}`);break}}else if(x){let P=e.localize([...e.path,`${I}.otherwise`],e.ancestors,e.schemas),{schema:w,id:E}=x._generate(t,P,n);r.push(w),i.push(`${I}.otherwise${E?`(${E})`:""}`);break}}if(u.break&&i.length>d)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={}){Y(!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){ht.verifyFlat(t,e.slice(1,-1));let n=this.clone(),r=t[0]===ht.symbols.override;if(r&&(t=t.slice(1)),!n[e]&&t.length?n[e]=new yl:r&&(n[e]=t.length?new yl:null,n.$_mutateRebuild()),!n[e])return n;r&&n[e].override();for(let i of t){Y(i!==void 0,"Cannot call allow/valid/invalid with undefined"),Y(i!==ht.symbols.override,"Override must be the first value");let s=e==="_invalids"?"_valids":"_invalids";n[s]&&(n[s].remove(i),n[s].length||(Y(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}};Dt.Base.prototype[ht.symbols.any]={version:ht.version,compile:mg.compile,root:"$_root"};Dt.Base.prototype.isImmutable=!0;Dt.Base.prototype.deny=Dt.Base.prototype.invalid;Dt.Base.prototype.disallow=Dt.Base.prototype.invalid;Dt.Base.prototype.equal=Dt.Base.prototype.valid;Dt.Base.prototype.exist=Dt.Base.prototype.required;Dt.Base.prototype.not=Dt.Base.prototype.invalid;Dt.Base.prototype.options=Dt.Base.prototype.prefs;Dt.Base.prototype.preferences=Dt.Base.prototype.prefs;sE.exports=new Dt.Base});var qn=m((sB,aE)=>{"use strict";var bl=ke(),kI=oE(),CI=Ke(),OI=Ks();aE.exports=kI.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 bl(typeof t=="function","Method must be a function"),bl(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){bl(CI.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 bl(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=OI.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 lE=m((oB,cE)=>{"use strict";var Ki=ke(),RI=hl(),DI=qn(),uE=Ke(),II=Vi(),_l=Dr(),PI=Ir(),Qs={};cE.exports=DI.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:PI.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 d=n.$_terms.matches[l],p=i.nest(d.schema,`match.${l}`);p.snapshot();let y=d.schema.$_validate(t,p,s);y.errors?(u.push(y.errors),p.restore()):(a.push(y.value),p.commit())}if(a.length===0){let l={details:u.map(d=>_l.details(d,{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(d=>_l.details(d,{override:!1}))};return{errors:r("alternatives.all",l)}}let c=l=>l.$_terms.matches.some(d=>d.schema.type==="object"||d.schema.type==="alternatives"&&c(d.schema));return c(n)?{value:a.reduce((l,d)=>RI(l,d,{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 d=i.nest(u.schema,`match.${a}`);d.snapshot();let p=u.schema.$_validate(t,d,s);if(!p.errors)return d.commit(),p;d.restore(),o.push({schema:u.schema,reports:p.errors});continue}let c=u.ref?u.ref.resolve(t,i,s):t,l=u.is?[u]:u.switch;for(let d=0;d<l.length;++d){let p=l[d],{is:y,then:v,otherwise:x}=p,I=`match.${a}${u.switch?"."+d:""}`;if(y.$_match(c,i.nest(y,`${I}.is`),s)){if(v)return v.$_validate(t,i.nest(v,`${I}.then`),s)}else if(x)return x.$_validate(t,i.nest(x,`${I}.otherwise`),s)}}return Qs.errors(o,e)},rules:{conditional:{method(t,e){Ki(!this._flags._endedSwitch,"Unreachable condition"),Ki(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),Ki(e.break===void 0,"Cannot use break option with alternatives conditional");let n=this.clone(),r=II.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(Ki(["any","one","all"].includes(t),"Invalid alternatives match mode",t),t!=="any")for(let e of this.$_terms.matches)Ki(e.schema,"Cannot combine match mode",t,"with conditional rules");return this.$_setFlag("match",t)}},try:{method(...t){Ki(t.length,"Missing alternative schemas"),uE.verifyFlat(t,"try"),Ki(!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=>{uE.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}}"}});Qs.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 Qs.unmatched(t,e);let a=s[0];if(!(a instanceof _l.Report))return Qs.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}:Qs.unmatched(t,e):{errors:e("alternatives.types",{types:[...r]})}};Qs.unmatched=function(t,e){let n=[];for(let r of t)n.push(...r.reports);return{errors:e("alternatives.match",_l.details(n,{override:!1}))}}});var fE=m((aB,dE)=>{"use strict";var wa=ke(),MI=va(),LI=Hi(),NI=qn(),jn=Ke(),qI=Vi(),nt={};dE.exports=NI.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 nt.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[jn.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){jn.verifyFlat(t,"items");let e=this.$_addRule("items");for(let n=0;n<t.length;++n){let r=jn.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[jn.symbols.arraySingle];delete t[jn.symbols.arraySingle];let l=s(),d=t.length;for(let p=0;p<d;++p){let y=t[p],v=!1,x=!1,I=c?p:new Number(p),P=[...r.path,I];if(!e._flags.sparse&&y===void 0){if(l.push(n("array.sparse",{key:I,path:P,pos:p,value:void 0},r.localize(P))),i.abortEarly)return l;a.shift();continue}let w=[t,...r.ancestors];for(let O of e.$_terms._exclusions)if(O.$_match(y,r.localize(P,w,O),i,{presence:"ignore"})){if(l.push(n("array.excludes",{pos:p,value:y},r.localize(P))),i.abortEarly)return l;v=!0,a.shift();break}if(v)continue;if(e.$_terms.ordered.length){if(a.length){let O=a.shift(),H=O.$_validate(y,r.localize(P,w,O),i);if(H.errors){if(l.push(...H.errors),i.abortEarly)return l}else if(O._flags.result==="strip")nt.fastSplice(t,p),--p,--d;else if(!e._flags.sparse&&H.value===void 0){if(l.push(n("array.sparse",{key:I,path:P,pos:p,value:void 0},r.localize(P))),i.abortEarly)return l;continue}else t[p]=H.value;continue}else if(!e.$_terms.items.length){if(l.push(n("array.orderedLength",{pos:p,limit:e.$_terms.ordered.length})),i.abortEarly)return l;break}}let E=[],_=o.length;for(let O=0;O<_;++O){let H=r.localize(P,w,o[O]);H.snapshot();let re=o[O].$_validate(y,H,i);if(E[O]=re,!re.errors){if(H.commit(),t[p]=re.value,x=!0,nt.fastSplice(o,O),--O,--_,!e._flags.sparse&&re.value===void 0&&(l.push(n("array.sparse",{key:I,path:P,pos:p,value:void 0},r.localize(P))),i.abortEarly))return l;break}H.restore()}if(x)continue;let j=i.stripUnknown&&!!i.stripUnknown.arrays||!1;_=u.length;for(let O of u){let H,re=o.indexOf(O);if(re!==-1)H=E[re];else{let fe=r.localize(P,w,O);if(fe.snapshot(),H=O.$_validate(y,fe,i),!H.errors){fe.commit(),O._flags.result==="strip"?(nt.fastSplice(t,p),--p,--d):!e._flags.sparse&&H.value===void 0?(l.push(n("array.sparse",{key:I,path:P,pos:p,value:void 0},r.localize(P))),v=!0):t[p]=H.value,x=!0;break}fe.restore()}if(_===1){if(j){nt.fastSplice(t,p),--p,--d,x=!0;break}if(l.push(...H.errors),i.abortEarly)return l;v=!0;break}}if(!v&&(e.$_terms._inclusions.length||e.$_terms._requireds.length)&&!x){if(j){nt.fastSplice(t,p),--p,--d;continue}if(l.push(n("array.includes",{pos:p,value:y},r.localize(P))),i.abortEarly)return l}}return o.length&&nt.fillMissedErrors(e,l,o,t,r,i),a.length&&(nt.fillOrderedErrors(e,l,a,t,r,i),l.length||nt.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 jn.compare(t.length,n,i)?t:e.error("array."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:jn.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){jn.verifyFlat(t,"ordered");let e=this.$_addRule("items");for(let n=0;n<t.length;++n){let r=jn.tryWithPath(()=>this.$_compile(t[n]),n,{append:!0});nt.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 wa(!e||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",e)}},sort:{method(t={}){jn.assertOptions(t,["by","order"]);let e={order:t.order||"ascending"};return t.by&&(e.by=qI.ref(t.by,{ancestor:0}),wa(!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}=nt.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={}){wa(!t||typeof t=="function"||typeof t=="string","comparator must be a function or a string"),jn.assertOptions(e,["ignoreUndefined","separator"]);let n={name:"unique",args:{options:e,comparator:t}};if(t)if(typeof t=="string"){let r=jn.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||MI,l=s.ignoreUndefined;for(let d=0;d<t.length;++d){let p=a?LI(t[d],a):t[d],y=o?u.custom:u[typeof p];if(wa(y,"Failed to find unique map container for type",typeof p),y instanceof Map){let v=y.entries(),x;for(;!(x=v.next()).done;)if(c(x.value[0],p)){let I=e.localize([...e.path,d],[t,...e.ancestors]),P={pos:d,value:t[d],dupePos:x.value[1],dupeValue:t[x.value[1]]};return a&&(P.path=i),n("array.unique",P,I)}y.set(p,d)}else{if((!l||p!==void 0)&&y[p]!==void 0){let v={pos:d,value:t[d],dupePos:y[p],dupeValue:t[y[p]]};a&&(v.path=i);let x=e.localize([...e.path,d],[t,...e.ancestors]);return n("array.unique",v,x)}y[p]=d}}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)nt.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)nt.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"}});nt.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))};nt.fillOrderedErrors=function(t,e,n,r,i,s){let o=[];for(let a of n)a._flags.presence==="required"&&o.push(a);o.length&&nt.fillMissedErrors(t,e,o,r,i,s)};nt.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)};nt.fastSplice=function(t,e){let n=e;for(;n<t.length;)t[n++]=t[n];--t.length};nt.validateSingle=function(t,e){(t.type==="array"||t._flags._arrayItems)&&(wa(!e._flags.single,"Cannot specify array item with single rule enabled"),e.$_setFlag("_arrayItems",!0,{clone:!1}))};nt.sort=function(t,e,n,r,i){let s=n.order==="ascending"?1:-1,o=-1*s,a=s,u=(c,l)=>{let d=nt.compare(c,l,o,a);if(d!==null||(n.by&&(c=n.by.resolve(c,r,i),l=n.by.resolve(l,r,i)),d=nt.compare(c,l,o,a),d!==null))return d;let p=typeof c;if(p!==typeof l)throw t.$_createError("array.sort.mismatching",e,null,r,i);if(p!=="number"&&p!=="string")throw t.$_createError("array.sort.unsupported",e,{type:p},r,i);return p==="number"?(c-l)*s:c<l?o:a};try{return{value:e.slice().sort(u)}}catch(c){return{errors:c}}};nt.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 yE=m((uB,gE)=>{"use strict";var pE=ke(),jI=qn(),hE=Ke(),mE=pg(),gg={};gg.isBool=function(t){return typeof t=="boolean"};gE.exports=jI.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){hE.verifyFlat(t,"truthy");let e=this.clone();e.$_terms.truthy=e.$_terms.truthy||new mE;for(let n=0;n<t.length;++n){let r=t[n];pE(r!==void 0,"Cannot call truthy with undefined"),e.$_terms.truthy.add(r)}return e}},falsy:{method(...t){hE.verifyFlat(t,"falsy");let e=this.clone();e.$_terms.falsy=e.$_terms.falsy||new mE;for(let n=0;n<t.length;++n){let r=t[n];pE(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:gg.isBool,to(t,e){return t?1:0}},string:{from:gg.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 SE=m((cB,vE)=>{"use strict";var bE=ke(),FI=qn(),_E=Ke(),$I=fi(),Zn={};Zn.isDate=function(t){return t instanceof Date};vE.exports=FI.extend({type:"date",coerce:{from:["number","string"],method(t,{schema:e}){return{value:Zn.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 _E.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:Zn.parse(t),assert:t=>t!==null,message:"must have a valid date format"}]},format:{method(t){return bE(["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 bE(["javascript","unix"].includes(t),'"type" must be one of "javascript, unix"'),this.format(t)}}},cast:{number:{from:Zn.isDate,to(t,e){return t.getTime()}},string:{from:Zn.isDate,to(t,{prefs:e}){return $I.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"}});Zn.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 _E.isIsoDate(t)?Zn.date(t.toString()):null;let n=t;if(typeof t=="string"&&/^[+-]?\d+(\.\d+)?$/.test(t)&&(t=parseFloat(t)),e){if(e==="javascript")return Zn.date(1*t);if(e==="unix")return Zn.date(1e3*t);if(typeof n=="string")return null}return Zn.date(t)};Zn.date=function(t){let e=new Date(t);return isNaN(e.getTime())?null:e}});var xE=m((lB,AE)=>{"use strict";var vl=ke(),wE=Jt(),EE=hl(),TE=Hi(),Sl={};AE.exports=function(t,e,n={}){if(vl(t&&typeof t=="object","Invalid defaults value: must be an object"),vl(!e||e===!0||typeof e=="object","Invalid source value: must be true, falsy or an object"),vl(typeof n=="object","Invalid options: must be an object"),!e)return null;if(n.shallow)return Sl.applyToDefaultsWithShallow(t,e,n);let r=wE(t);if(e===!0)return r;let i=n.nullOverride!==void 0?n.nullOverride:!1;return EE(r,e,{nullOverride:i,mergeArrays:!1})};Sl.applyToDefaultsWithShallow=function(t,e,n){let r=n.shallow;vl(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=TE(t,u);c&&typeof c=="object"?i.set(c,s&&TE(e,u)||c):s&&s.add(u)}let o=wE(t,{},i);if(!s)return o;for(let u of s)Sl.reachCopy(o,e,u);let a=n.nullOverride!==void 0?n.nullOverride:!1;return EE(o,e,{nullOverride:a,mergeArrays:!1})};Sl.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 OE=m(CE=>{"use strict";var Xi=ke(),kE={};CE.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;Xi(!n.includes(i),`Item cannot come before itself: ${i}`),Xi(!n.includes("?"),"Item cannot come before unassociated items"),Xi(!r.includes(i),`Item cannot come after itself: ${i}`),Xi(!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();Xi(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(kE.mergeSort);for(let n=0;n<this._items.length;++n)this._items[n].seq=n;let e=this._sort();return Xi(e,"merge created a dependencies error"),this.nodes}sort(){let t=this._sort();return Xi(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,d=0;for(let p=0;p<l;++p)i[r[c][p]]&&++d;if(d===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}};kE.mergeSort=(t,e)=>t.sort===e.sort?0:t.sort<e.sort?-1:1});var bg=m((pB,IE)=>{"use strict";var BI=xE(),Fn=ke(),RE=Jt(),UI=OE(),HI=qn(),Gt=Ke(),yg=Vi(),WI=Dr(),DE=Ir(),Tl=fi(),ue={renameDefaults:{alias:!1,multiple:!1,override:!1}};IE.exports=HI.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=ue.clone(t,i);let s=[];if(e.$_terms.renames&&!ue.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 d=r.localize([...r.path,c],a,u),p=u.schema.$_validate(l,d,i);if(p.errors){if(i.abortEarly)return{value:t,errors:p.errors};p.value!==void 0&&(t[c]=p.value),s.push(...p.errors)}else u.schema._flags.result==="strip"||p.value===void 0&&l!==void 0?delete t[c]:p.value!==void 0&&(t[c]=p.value)}}if(o.size||e._flags._hasPatternMatch){let a=ue.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&&ue.isPresent(a.options)(a.key.resolve(t,r,i,null,{shadow:!1}))===!1)continue;let u=ue.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 Gt.verifyFlat(t,"and"),ue.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){Tl.isTemplate(t)||(t=yg.ref(t)),Fn(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=DE.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 Fn(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){Fn(t===void 0||typeof t=="object","Object schema must be a valid object"),Fn(!Gt.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 ue.Keys;else{e.$_terms.keys=e.$_terms.keys?e.$_terms.keys.filter(n=>!t.hasOwnProperty(n.key)):new ue.Keys;for(let n in t)Gt.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 Gt.compare(Object.keys(t).length,n,i)?t:e.error("object."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:Gt.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 Gt.verifyFlat(t,"nand"),ue.dependency(this,"nand",null,t)}},or:{method(...t){return Gt.verifyFlat(t,"or"),ue.dependency(this,"or",null,t)}},oxor:{method(...t){return ue.dependency(this,"oxor",null,t)}},pattern:{method(t,e,n={}){let r=t instanceof RegExp;r||(t=this.$_compile(t,{appendPath:!0})),Fn(e!==void 0,"Invalid rule"),Gt.assertOptions(n,["fallthrough","matches"]),r&&Fn(!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 DE.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={}){Fn(typeof t=="string"||t instanceof RegExp,"Rename missing the from argument"),Fn(typeof e=="string"||e instanceof Tl,"Invalid rename to argument"),Fn(e!==t,"Cannot rename key to same name:",t),Gt.assertOptions(n,["alias","ignoreUndefined","override","multiple"]);let r=this.clone();r.$_terms.renames=r.$_terms.renames||[];for(let i of r.$_terms.renames)Fn(i.from!==t,"Cannot rename the same key multiple times");return e instanceof Tl&&r.$_mutateRegister(e),r.$_terms.renames.push({from:t,to:e,options:BI(ue.renameDefaults,n)}),r}},schema:{method(t="any"){return this.$_addRule({name:"schema",args:{type:t}})},validate(t,e,{type:n}){return Gt.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 ue.dependency(this,"with",t,e,n)}},without:{method(t,e,n={}){return ue.dependency(this,"without",t,e,n)}},xor:{method(...t){return Gt.verifyFlat(t,"xor"),ue.dependency(this,"xor",null,t)}}},overrides:{default(t,e){return t===void 0&&(t=Gt.symbols.deepDefault),this.$_parent("default",t,e)}},rebuild(t){if(t.$_terms.keys){let e=new UI.Sorter;for(let n of t.$_terms.keys)Gt.tryWithPath(()=>e.add(n,{after:n.schema.$_rootReferences(),group:n.key}),n.key);t.$_terms.keys=new ue.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=ue.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}}"}});ue.clone=function(t,e){if(typeof t=="object"){if(e.nonEnumerables)return RE(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=RE(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};ue.dependency=function(t,e,n,r,i){Fn(n===null||typeof n=="string",e,"key must be a strings"),i||(i=r.length>1&&typeof r[r.length-1]=="object"?r.pop():{}),Gt.assertOptions(i,["separator","isPresent"]),r=[].concat(r);let s=Gt.default(i.separator,"."),o=[];for(let u of r)Fn(typeof u=="string",e,"peers must be strings"),o.push(yg.ref(u,{separator:s,ancestor:0,prefix:!1}));n!==null&&(n=yg.ref(n,{separator:s,ancestor:0,prefix:!1}));let a=t.clone();return a.$_terms.dependencies=a.$_terms.dependencies||[],a.$_terms.dependencies.push(new ue.Dependency(e,n,o,r,i)),a};ue.dependencies={and(t,e,n,r,i){let s=[],o=[],a=e.peers.length,u=ue.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:ue.keysToLabels(t,o),missing:s,missingWithLabels:ue.keysToLabels(t,s)}}},nand(t,e,n,r,i){let s=[],o=ue.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:ue.keysToLabels(t,a),peers:u,peersWithLabels:ue.keysToLabels(t,u)}}},or(t,e,n,r,i){let s=ue.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:ue.keysToLabels(t,e.paths)}}},oxor(t,e,n,r,i){let s=[],o=ue.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:ue.keysToLabels(t,e.paths)};return a.present=s,a.presentWithLabels=ue.keysToLabels(t,s),{code:"object.oxor",context:a}},with(t,e,n,r,i){let s=ue.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:ue.keysToLabels(t,e.key.key),peer:o.key,peerWithLabel:ue.keysToLabels(t,o.key)}}},without(t,e,n,r,i){let s=ue.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:ue.keysToLabels(t,e.key.key),peer:o.key,peerWithLabel:ue.keysToLabels(t,o.key)}}},xor(t,e,n,r,i){let s=[],o=ue.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:ue.keysToLabels(t,e.paths)};return s.length===0?{code:"object.missing",context:a}:(a.present=s,a.presentWithLabels=ue.keysToLabels(t,s),{code:"object.xor",context:a})}};ue.keysToLabels=function(t,e){return Array.isArray(e)?e.map(n=>t.$_mapLabels(n)):t.$_mapLabels(e)};ue.isPresent=function(t){return typeof t.isPresent=="function"?t.isPresent:e=>e!==void 0};ue.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,d=c.to;if(d instanceof Tl&&(d=d.render(e,n,r,c.match)),l!==d){if(!o.options.multiple&&s[d]&&(i.push(t.$_createError("object.rename.multiple",e,{from:l,to:d,pattern:u},n,r)),r.abortEarly)||Object.prototype.hasOwnProperty.call(e,d)&&!o.options.override&&!s[d]&&(i.push(t.$_createError("object.rename.override",e,{from:l,to:d,pattern:u},n,r)),r.abortEarly))return!1;e[l]===void 0?delete e[d]:e[d]=e[l],s[d]=!0,o.options.alias||delete e[l]}}}return!0};ue.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 d=e[l],p=[...i.path,l];for(let y=0;y<t.$_terms.patterns.length;++y){let v=t.$_terms.patterns[y];if(v.regex){let P=v.regex.test(l);if(i.mainstay.tracer.debug(i,"rule",`pattern.${y}`,P?"pass":"error"),!P)continue}else if(!v.schema.$_match(l,i.nest(v.schema,`pattern.${y}`),s))continue;n.delete(l);let x=i.localize(p,c,{schema:v.rule,key:l}),I=v.rule.$_validate(d,x,s);if(I.errors){if(s.abortEarly)return{value:e,errors:I.errors};r.push(...I.errors)}if(v.matches&&u[y].push(l),e[l]=I.value,!v.fallthrough)break}}if(a)for(let l=0;l<u.length;++l){let d=u[l];if(!d)continue;let p=t.$_terms.patterns[l].matches,y=i.localize(i.path,c,p),v=p.$_validate(d,y,s);if(v.errors){let x=WI.details(v.errors,{override:!1});x.matches=d;let I=t.$_createError("object.pattern.match",e,x,i,s);if(s.abortEarly)return{value:e,errors:I};r.push(I)}}}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(!Gt.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)}};ue.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}};ue.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 ME=m((gB,PE)=>{"use strict";var _g=ke(),GI=bg();PE.exports=GI.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(t){return _g(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 _g(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 _g(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 NE=m((yB,LE)=>{"use strict";var Nr=ke(),VI=qn(),zI=Ke(),KI=Vi(),XI=Dr(),qr={};LE.exports=VI.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}){Nr(e.$_terms.link,"Uninitialized link schema");let i=qr.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 qr.generate(t,e,n,r)},rules:{ref:{method(t){Nr(!this.$_terms.link,"Cannot reinitialize schema"),t=KI.ref(t),Nr(t.type==="value"||t.type==="local","Invalid reference type:",t.type),Nr(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){Nr(this.$_terms.link,"Uninitialized link schema"),Nr(zI.isSchema(t),"Invalid schema object"),Nr(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 Nr(e.link,"Invalid link description missing link"),t.ref(e.link)}}});qr.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}=qr.perspective(s,n);qr.assert(o,"which is outside of schema boundaries",s,t,n,r);try{i=a.length?o.$_reach(a):o}catch{qr.assert(!1,"to non-existing schema",s,t,n,r)}return qr.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};qr.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}};qr.assert=function(t,e,n,r,i,s){t||Nr(!1,`"${XI.label(r._flags,i,s)}" contains link reference "${n.display}" ${e}`)}});var jE=m((bB,qE)=>{"use strict";var vg=ke(),YI=qn(),Sg=Ke(),Tn={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))))}};qE.exports=YI.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(t,{schema:e,error:n}){if(!t.match(Tn.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(Tn.extractSignificantDigits(t)!==Tn.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!==Tn.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(!Sg.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 Sg.compare(t,n,i)?t:e.error("number."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:Sg.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"?Tn.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 Tn.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 vg(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(Tn.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 vg(["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 vg(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"}});Tn.extractSignificantDigits=function(t){return t.replace(Tn.exponentialPartRegex,"").replace(Tn.dotRegex,"").replace(Tn.trailingZerosRegex,"").replace(Tn.leadingSignAndZerosRegex,"")};Tn.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 $E=m((_B,FE)=>{"use strict";var JI=bg();FE.exports=JI.extend({type:"object",cast:{map:{from:t=>t&&typeof t=="object",to(t,e){return new Map(Object.entries(t))}}}})});var Tg=m(wl=>{"use strict";wl.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"};wl.code=function(t){return{code:t,error:wl.codes[t]}}});var wg=m(El=>{"use strict";var QI=require("url"),er=Tg(),mi={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:QI.URL||URL};El.analyze=function(t,e={}){if(!t)return er.code("DOMAIN_NON_EMPTY_STRING");if(typeof t!="string")throw new Error("Invalid input: domain must be a string");if(t.length>256)return er.code("DOMAIN_TOO_LONG");if(!!mi.nonAsciiRx.test(t)){if(e.allowUnicode===!1)return er.code("DOMAIN_INVALID_UNICODE_CHARS");t=t.normalize("NFC")}if(mi.domainControlRx.test(t))return er.code("DOMAIN_INVALID_CHARS");t=mi.punycode(t),e.allowFullyQualified&&t[t.length-1]==="."&&(t=t.slice(0,-1));let r=e.minDomainSegments||mi.minDomainSegments,i=t.split(".");if(i.length<r)return er.code("DOMAIN_SEGMENTS_COUNT");if(e.maxDomainSegments&&i.length>e.maxDomainSegments)return er.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 er.code("DOMAIN_FORBIDDEN_TLDS")}for(let o=0;o<i.length;++o){let a=i[o];if(!a.length)return er.code("DOMAIN_EMPTY_SEGMENT");if(a.length>63)return er.code("DOMAIN_LONG_SEGMENT");if(o<i.length-1){if(!mi.domainSegmentRx.test(a))return er.code("DOMAIN_INVALID_CHARS")}else if(!mi.tldSegmentRx.test(a))return er.code("DOMAIN_INVALID_TLDS_CHARS")}return null};El.isValid=function(t,e){return!El.analyze(t,e)};mi.punycode=function(t){t.includes("%")&&(t=t.replace(/%/g,"%25"));try{return new mi.URL(`http://${t}`).host}catch{return t}}});var BE=m(Eg=>{"use strict";var ZI=require("util"),eP=wg(),br=Tg(),Zt={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(ZI.TextEncoder||TextEncoder)};Eg.analyze=function(t,e){return Zt.email(t,e)};Eg.isValid=function(t,e){return!Zt.email(t,e)};Zt.email=function(t,e={}){if(typeof t!="string")throw new Error("Invalid input: email must be a string");if(!t)return br.code("EMPTY_STRING");let n=!Zt.nonAsciiRx.test(t);if(!n){if(e.allowUnicode===!1)return br.code("FORBIDDEN_UNICODE");t=t.normalize("NFC")}let r=t.split("@");if(r.length!==2)return r.length>2?br.code("MULTIPLE_AT_CHAR"):br.code("MISSING_AT_CHAR");let[i,s]=r;if(!i)return br.code("EMPTY_LOCAL");if(!e.ignoreLength){if(t.length>254)return br.code("ADDRESS_TOO_LONG");if(Zt.encoder.encode(i).length>64)return br.code("LOCAL_TOO_LONG")}return Zt.local(i,n)||eP.analyze(s,e)};Zt.local=function(t,e){let n=t.split(".");for(let r of n){if(!r.length)return br.code("EMPTY_LOCAL_SEGMENT");if(e){if(!Zt.atextRx.test(r))return br.code("INVALID_LOCAL_CHARS");continue}for(let i of r){if(Zt.atextRx.test(i))continue;let s=Zt.binary(i);if(!Zt.atomRx.test(s))return br.code("INVALID_LOCAL_CHARS")}}};Zt.binary=function(t){return Array.from(Zt.encoder.encode(t)).map(e=>String.fromCharCode(e)).join("")};Zt.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/;Zt.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 Ag=m((wB,UE)=>{"use strict";UE.exports=function(t){return t.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}});var kg=m(xg=>{"use strict";var Al=ke(),tP=Ag(),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+")",d="(?:"+c+":){6}"+l,p="::(?:"+c+":){5}"+l,y="(?:"+c+")?::(?:"+c+":){4}"+l,v="(?:(?:"+c+":){0,1}"+c+")?::(?:"+c+":){3}"+l,x="(?:(?:"+c+":){0,2}"+c+")?::(?:"+c+":){2}"+l,I="(?:(?:"+c+":){0,3}"+c+")?::"+c+":"+l,P="(?:(?:"+c+":){0,4}"+c+")?::"+l,w="(?:(?:"+c+":){0,5}"+c+")?::"+c,E="(?:(?:"+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="(?:"+d+"|"+p+"|"+y+"|"+v+"|"+x+"|"+I+"|"+P+"|"+w+"|"+E+")",t.ipvFuture="v"+n+"+\\.["+r+i+":]+",t.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",t.schemeRegex=new RegExp(t.scheme);let _="["+r+s+i+":]*",j="\\[(?:"+t.ipv6address+"|"+t.ipvFuture+")\\]",O="["+r+s+i+"]{1,255}",H="(?:"+j+"|"+t.ipv4address+"|"+O+")",re="\\d*",fe="(?:"+_+"@)?"+H+"(?::"+re+")?",U="(?:"+_+"@)?("+H+")(?::"+re+")?",k=a+"*",M=a+"+",L="["+r+s+i+"@]+",q="",ce="(?:\\/"+k+")*",ae="\\/(?:"+M+ce+")?",Ct=M+ce,dt=L+ce,Pe="(?:\\/\\/\\/"+k+ce+")";return t.hierPart="(?:(?:\\/\\/"+fe+ce+")|"+ae+"|"+Ct+"|"+Pe+")",t.hierPartCapture="(?:(?:\\/\\/"+U+ce+")|"+ae+"|"+Ct+")",t.relativeRef="(?:(?:\\/\\/"+fe+ce+")|"+ae+"|"+dt+"|"+q+")",t.relativeRefCapture="(?:(?:\\/\\/"+U+ce+")|"+ae+"|"+dt+"|"+q+")",t.query="["+o+"\\/\\?]*(?=#|$)",t.queryWithSquareBrackets="["+o+"\\[\\]\\/\\?]*(?=#|$)",t.fragment="["+o+"\\/\\?]*",t};jt.rfc3986=jt.generate();xg.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){Al(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);Al(c.length>=1,"scheme must have at least 1 scheme specified");let l=[];for(let d=0;d<c.length;++d){let p=c[d];Al(p instanceof RegExp||typeof p=="string","scheme at position "+d+" must be a RegExp or String"),p instanceof RegExp?l.push(p.source.toString()):(Al(e.schemeRegex.test(p),"scheme at position "+d+" must be a valid scheme"),l.push(tP(p)))}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({});xg.regex=function(t={}){return t.scheme||t.allowRelative||t.relativeOnly||t.allowQuerySquareBrackets||t.domain?jt.createRegex(t):jt.uriRegex}});var WE=m(HE=>{"use strict";var Zs=ke(),Ea=kg();HE.regex=function(t={}){Zs(t.cidr===void 0||typeof t.cidr=="string","options.cidr must be a string");let e=t.cidr?t.cidr.toLowerCase():"optional";Zs(["required","optional","forbidden"].includes(e),"options.cidr must be one of required, optional, forbidden"),Zs(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]),Zs(n.length>=1,"options.version must have at least 1 version specified");for(let o=0;o<n.length;++o)Zs(typeof n[o]=="string","options.version must only contain strings"),n[o]=n[o].toLowerCase(),Zs(["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 Ea.ip[o];let a=`\\/${o==="ipv4"?Ea.ip.v4Cidr:Ea.ip.v6Cidr}`;return e==="required"?`${Ea.ip[o]}${a}`:`${Ea.ip[o]}(?:${a})?`}).join("|")})`,s=new RegExp(`^${i}$`);return{cidr:e,versions:n,regex:s,raw:i}}});var zE=m((xB,VE)=>{"use strict";var GE={};GE.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"];VE.exports=new Set(GE.tlds.map(t=>t.toLowerCase()))});var QE=m((kB,JE)=>{"use strict";var Le=ke(),xl=wg(),nP=BE(),YE=WE(),KE=Ag(),XE=zE(),rP=kg(),iP=qn(),en=Ke(),Ee={tlds:XE instanceof Set?{tlds:{allow:XE,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:YE.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"]};JE.exports=iP.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=Ee.isoDate(t);u&&(t=u)}if(e._flags.truncate){let u=e.$_getRule("max");if(u){let c=u.args.limit;if(en.isResolvable(c)&&(c=c.resolve(t,n,r),!en.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 en.assertOptions(t,["paddingRequired","urlSafe"]),t={urlSafe:!1,paddingRequired:!0,...t},Le(typeof t.paddingRequired=="boolean","paddingRequired must be boolean"),Le(typeof t.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:t}})},validate(t,e,{options:n}){return Ee.base64Regex[n.paddingRequired][n.urlSafe].test(t)?t:e.error("string.base64")}},case:{method(t){return Le(["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 en.assertOptions(t,["paddingRequired"]),t={paddingRequired:!0,...t},Le(typeof t.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:t}})},validate(t,e,{options:n}){let r=t.match(Ee.dataUriRegex);return r&&(!r[2]||r[2]!=="base64"||Ee.base64Regex[n.paddingRequired].false.test(r[3]))?t:e.error("string.dataUri")}},domain:{method(t){t&&en.assertOptions(t,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);let e=Ee.addressOptions(t);return this.$_addRule({name:"domain",args:{options:t},address:e})},validate(t,e,n,{address:r}){return xl.isValid(t,r)?t:e.error("string.domain")}},email:{method(t={}){en.assertOptions(t,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),Le(t.multiple===void 0||typeof t.multiple=="boolean","multiple option must be an boolean");let e=Ee.addressOptions(t),n=new RegExp(`\\s*[${t.separator?KE(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)nP.isValid(a,i)||o.push(a);return o.length?e.error("string.email",{value:t,invalids:o}):t}},guid:{alias:"uuid",method(t={}){en.assertOptions(t,["version","separator"]);let e="";if(t.version){let i=[].concat(t.version);Le(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];Le(typeof a=="string","version at position "+o+" must be a string");let u=Ee.guidVersions[a.toLowerCase()];Le(u,"version at position "+o+" must be one of "+Object.keys(Ee.guidVersions).join(", ")),Le(!s.has(u),"version at position "+o+" must not be a duplicate"),e+=u,s.add(u)}}Le(Ee.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||Ee.guidBrackets[i[1]]!==i[i.length-1]?e.error("string.guid"):t}},hex:{method(t={}){return en.assertOptions(t,["byteAligned","prefix"]),t={byteAligned:!1,prefix:!1,...t},Le(typeof t.byteAligned=="boolean","byteAligned must be boolean"),Le(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"?Ee.hexRegex.withOptionalPrefix:n.prefix===!0?Ee.hexRegex.withPrefix:Ee.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 xl.isValid(t,{minDomainSegments:1})||Ee.ipRegex.test(t)?t:e.error("string.hostname")}},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(t={}){en.assertOptions(t,["cidr","version"]);let{cidr:e,versions:n,regex:r}=YE.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 Ee.isoDate(t)?t:e("string.isoDate")}},isoDuration:{method(){return this.$_addRule("isoDuration")},validate(t,e){return Ee.isoDurationRegex.test(t)?t:e.error("string.isoDuration")}},length:{method(t,e){return Ee.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 en.compare(a,n,s)?t:e.error("string."+i,{limit:o.limit,value:t,encoding:r})},args:[{name:"limit",ref:!0,assert:en.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(t,e){return Ee.length(this,"max",t,"<=",e)},args:["limit","encoding"]},min:{method(t,e){return Ee.length(this,"min",t,">=",e)},args:["limit","encoding"]},normalize:{method(t="NFC"){return Le(Ee.normalizationForms.includes(t),"normalization form must be one of "+Ee.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={}){Le(t instanceof RegExp,"regex must be a RegExp"),Le(!t.flags.includes("g")&&!t.flags.includes("y"),"regex should not use global or sticky mode"),typeof e=="string"&&(e={name:e}),en.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(KE(t),"g")),Le(t instanceof RegExp,"pattern must be a RegExp"),Le(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 Le(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 Le(typeof t=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",t)}},uppercase:{method(){return this.case("upper")}},uri:{method(t={}){en.assertOptions(t,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),t.domain&&en.assertOptions(t.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);let{regex:e,scheme:n}=rP.regex(t),r=t.domain?Ee.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)&&!xl.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"}});Ee.addressOptions=function(t){if(!t)return Ee.tlds||t;if(Le(t.minDomainSegments===void 0||Number.isSafeInteger(t.minDomainSegments)&&t.minDomainSegments>0,"minDomainSegments must be a positive integer"),Le(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 Le(Ee.tlds,"Built-in TLD list disabled"),Object.assign({},t,Ee.tlds);Le(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)}})),Le(t.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),Le(!t.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),Ee.validateTlds(t.tlds.deny,"tlds.deny"),t;let n=t.tlds.allow;return n?n===!0?(Le(Ee.tlds,"Built-in TLD list disabled"),Object.assign({},t,Ee.tlds)):(Array.isArray(n)&&(t=Object.assign({},t,{tlds:{allow:new Set(n)}})),Le(t.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),Ee.validateTlds(t.tlds.allow,"tlds.allow"),t):t};Ee.validateTlds=function(t,e){for(let n of t)Le(xl.isValid(n,{minDomainSegments:1,maxDomainSegments:1}),`${e} must contain valid top level domain names`)};Ee.isoDate=function(t){if(!en.isIsoDate(t))return null;/.*T.*[+-]\d\d$/.test(t)&&(t+="00");let e=new Date(t);return isNaN(e.getTime())?null:e.toISOString()};Ee.length=function(t,e,n,r,i){return Le(!i||Buffer&&Buffer.isEncoding(i),"Invalid encoding:",i),t.$_addRule({name:e,method:"length",args:{limit:n,encoding:i},operator:r})}});var eA=m((CB,ZE)=>{"use strict";var kl=ke(),sP=qn(),Cg={};Cg.Map=class extends Map{slice(){return new Cg.Map(this)}};ZE.exports=sP.extend({type:"symbol",terms:{map:{init:new Cg.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)),kl(t&&t[Symbol.iterator],"Iterable must be an iterable or object");let e=this.clone(),n=[];for(let r of t){kl(r&&r[Symbol.iterator],"Entry must be an iterable");let[i,s]=r;kl(typeof i!="object"&&typeof i!="function"&&typeof i!="symbol","Key must not be of type object, function, or Symbol"),kl(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 rA=m((RB,nA)=>{"use strict";var oP=ke(),aP=qn(),tA=Ke();nA.exports=aP.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 oP(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 tA.compare(t.length,n,i)?t:e.error("binary."+r,{limit:s.limit,value:t})},args:[{name:"limit",ref:!0,assert:tA.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 ll=m((DB,aA)=>{"use strict";var Ji=ke(),uP=Jt(),cP=rg(),Yi=Ke(),lP=Vi(),Rg=Dr(),dP=ig(),iA=ag(),Og=Ir(),sA=fi(),oA=cg(),Cl,At={types:{alternatives:lE(),any:qn(),array:fE(),boolean:yE(),date:SE(),function:ME(),link:NE(),number:jE(),object:$E(),string:QE(),symbol:eA()},aliases:{alt:"alternatives",bool:"boolean",func:"function"}};Buffer&&(At.types.binary=rA());At.root=function(){let t={_types:new Set(Object.keys(At.types))};for(let e of t._types)t[e]=function(...n){return Ji(!n.length||["alternatives","link","object"].includes(e),"The",e,"type does not allow arguments"),At.generate(this,At.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,At.methods);for(let e in At.aliases){let n=At.aliases[e];t[e]=t[n]}return t.x=t.expression,oA.setup&&oA.setup(t),t};At.methods={ValidationError:Rg.ValidationError,version:Yi.version,cache:cP.provider,assert(t,e,...n){At.assert(t,e,!0,n)},attempt(t,e,...n){return At.assert(t,e,!1,n)},build(t){return Ji(typeof iA.build=="function","Manifest functionality disabled"),iA.build(this,t)},checkPreferences(t){Yi.checkPreferences(t)},compile(t,e){return lP.compile(this,t,e)},defaults(t){Ji(typeof t=="function","modifier must be a function");let e=Object.assign({},this);for(let n of e._types){let r=t(e[n]());Ji(Yi.isSchema(r),"modifier must return a valid schema object"),e[n]=function(...i){return At.generate(this,r,i)}}return e},expression(...t){return new sA(...t)},extend(...t){Yi.verifyFlat(t,"extend"),Cl=Cl||cl(),Ji(t.length,"You need to provide at least one extension"),this.assert(t,Cl.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,Cl.extension);let r=At.expandExtension(n,e);for(let i of r){Ji(e[i.type]===void 0||e._types.has(i.type),"Cannot override name",i.type);let s=i.base||this.any(),o=dP.type(s,i);e._types.add(i.type),e[i.type]=function(...a){return At.generate(this,o,a)}}}return e},isError:Rg.ValidationError.isError,isExpression:sA.isTemplate,isRef:Og.isRef,isSchema:Yi.isSchema,in(...t){return Og.in(...t)},override:Yi.symbols.override,ref(...t){return Og.create(...t)},types(){let t={};for(let e of this._types)t[e]=this[e]();for(let e in At.aliases)t[e]=this[e]();return t}};At.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,Yi.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 Rg.ValidationError||(a=uP(a)),a.message=i?`${i} ${u}`:u,a};At.generate=function(t,e,n){return Ji(t,"Must be invoked on a Joi instance."),e.$_root=t,!e._definition.args||!n.length?e:e._definition.args(e,...n)};At.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};aA.exports=At.root()});var uA=m(be=>{"use strict";var fP=be&&be.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(be,"__esModule",{value:!0});be.descriptionContainerSchema=be.signatureSchema=be.signatureDefinitionContainerSchema=be.signatureDefinitionSchema=be.signatureDefinitionFunctionSchema=be.signatureDefinitionFunctionSchemaArg=be.signatureDefinitionFunctionSchemaArgMultiTypes=be.signatureDefinitionFunctionSchemaArgDefaultNumber=be.signatureDefinitionFunctionSchemaArgDefaultString=be.signatureDefinitionTypeSchema=be.variationsSchema=void 0;var Z=fP(ll()),Ol=$i();be.variationsSchema=Z.default.array().items(Z.default.alternatives(Z.default.string(),Z.default.number()));be.signatureDefinitionTypeSchema=Z.default.alternatives(Z.default.string(),Z.default.object({type:Z.default.string().required(),keyType:Z.default.string().optional(),valueType:Z.default.string().optional()}));be.signatureDefinitionFunctionSchemaArgDefaultString=Z.default.object({type:Z.default.string().valid(Ol.SignatureDefinitionBaseType.String).required(),value:Z.default.string().allow("").required()});be.signatureDefinitionFunctionSchemaArgDefaultNumber=Z.default.object({type:Z.default.string().valid(Ol.SignatureDefinitionBaseType.Number).required(),value:Z.default.number().required()});be.signatureDefinitionFunctionSchemaArgMultiTypes=Z.default.object({label:Z.default.string().required(),types:Z.default.array().items(be.signatureDefinitionTypeSchema).required(),opt:Z.default.boolean().optional(),default:Z.default.alternatives(be.signatureDefinitionFunctionSchemaArgDefaultString,be.signatureDefinitionFunctionSchemaArgDefaultNumber).optional()});be.signatureDefinitionFunctionSchemaArg=Z.default.object({label:Z.default.string().required(),type:be.signatureDefinitionTypeSchema.required(),opt:Z.default.boolean().optional(),default:Z.default.alternatives(be.signatureDefinitionFunctionSchemaArgDefaultString,be.signatureDefinitionFunctionSchemaArgDefaultNumber).optional()});be.signatureDefinitionFunctionSchema=Z.default.object({type:Z.default.string().valid(Ol.SignatureDefinitionBaseType.Function).required(),description:Z.default.string().optional(),example:Z.default.string().optional(),isProtected:Z.default.boolean().optional(),arguments:Z.default.array().items(Z.default.alternatives(be.signatureDefinitionFunctionSchemaArg,be.signatureDefinitionFunctionSchemaArgMultiTypes)).optional(),returns:Z.default.array().items(be.signatureDefinitionTypeSchema).required(),variations:be.variationsSchema.optional(),returnVariations:be.variationsSchema.optional()});be.signatureDefinitionSchema=Z.default.object({type:be.signatureDefinitionTypeSchema.invalid(Ol.SignatureDefinitionBaseType.Function).required(),description:Z.default.string().optional(),example:Z.default.string().optional(),isProtected:Z.default.boolean().optional(),variations:be.variationsSchema.optional()});be.signatureDefinitionContainerSchema=Z.default.object().pattern(Z.default.string(),Z.default.alternatives(be.signatureDefinitionFunctionSchema,be.signatureDefinitionSchema));be.signatureSchema=Z.default.object({type:Z.default.string().required(),hidden:Z.default.boolean().optional(),extends:Z.default.string().optional(),definitions:Z.default.object().required()});be.descriptionContainerSchema=Z.default.object({$meta:Z.default.object({description:Z.default.string().required(),example:Z.default.array().items(Z.default.string().allow("")).optional()}).optional()}).pattern(Z.default.string(),Z.default.object({description:Z.default.string().required(),example:Z.default.array().items(Z.default.string().allow("")).optional()}))});var Mg=m(ln=>{"use strict";var eo=ln&&ln.__assign||function(){return eo=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},eo.apply(this,arguments)},pP=ln&&ln.__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},gi=ln&&ln.__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.")},Dg=ln&&ln.__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},hP=ln&&ln.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ln,"__esModule",{value:!0});ln.Signature=void 0;var Ig=hP(ll()),Pg=uA(),mP=$i(),gP=al(),yP=Xm(),bP=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;Ig.default.assert(e,Pg.signatureDefinitionContainerSchema);var i={};try{for(var s=gi(Object.entries(e)),o=s.next();!o.done;o=s.next()){var a=Dg(o.value,2),u=a[0],c=a[1],l=c.type===mP.SignatureDefinitionBaseType.Function?yP.SignatureDefinitionFunction.parse(c):gP.SignatureDefinition.parse(c);i[u]=l}}catch(d){n={error:d}}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;Ig.default.assert(e,Pg.descriptionContainerSchema);var a=e,u=null;if(a.$meta){var c=e.$meta,l=pP(e,["$meta"]);u=c,a=l}var d={};try{for(var p=gi(Object.entries(a)),y=p.next();!y.done;y=p.next()){var v=Dg(y.value,2),x=v[0],I=v[1];d[x]={description:I.description,example:(i=I.example)!==null&&i!==void 0?i:null}}}catch(P){n={error:P}}finally{try{y&&!y.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}return eo({$meta:{description:(s=u?.description)!==null&&s!==void 0?s:"unknown",example:(o=u?.example)!==null&&o!==void 0?o:null}},d)},t.parse=function(e,n){var r,i;Ig.default.assert(e,Pg.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=gi(Object.entries(n)),u=a.next();!u.done;u=a.next()){var c=Dg(u.value,2),l=c[0],d=c[1],p=t.parseDescriptions(d);s.addDescriptions(l,p)}}catch(y){r={error:y}}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=gi(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=gi(o),u=a.next();!u.done;u=a.next()){var c=u.value;s[c]=eo(eo({},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=gi(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=gi(a),c=u.next();!c.done;c=u.next()){var l=c.value;o[l]=this._definitions[l].copy()}}catch(x){e={error:x}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}var d={},p=Object.keys(this._descriptions);try{for(var y=gi(p),v=y.next();!v.done;v=y.next()){var l=v.value;d[l]=eo({},d[l])}}catch(x){r={error:x}}finally{try{v&&!v.done&&(i=y.return)&&i.call(y)}finally{if(r)throw r.error}}return s._descriptions=d,s._definitions=o,s},t}();ln.Signature=bP});var cA=m(vr=>{"use strict";var yi=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},to=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))},Aa=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 _r=Mg(),mt=$i(),_P=function(){function t(){this._primitives=new Map([[mt.SignatureDefinitionBaseType.Any,new _r.Signature({type:mt.SignatureDefinitionBaseType.Any})],[mt.SignatureDefinitionBaseType.General,new _r.Signature({type:mt.SignatureDefinitionBaseType.General})],[mt.SignatureDefinitionBaseType.String,new _r.Signature({type:mt.SignatureDefinitionBaseType.String})],[mt.SignatureDefinitionBaseType.Function,new _r.Signature({type:mt.SignatureDefinitionBaseType.Function})],[mt.SignatureDefinitionBaseType.Number,new _r.Signature({type:mt.SignatureDefinitionBaseType.Number})],[mt.SignatureDefinitionBaseType.List,new _r.Signature({type:mt.SignatureDefinitionBaseType.List})],[mt.SignatureDefinitionBaseType.Map,new _r.Signature({type:mt.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 _r.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 to(to([],yi(this._primitives.keys()),!1),yi(this._types.keys()),!1).filter(function(n){return!e.getTypeSignature(n).isHidden()&&n!==mt.SignatureDefinitionBaseType.Any&&n!==mt.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 to(to([],yi(this.getAllPrimitiveSignatures()),!1),yi(this.getAllTypeSignatures()),!1)},t.prototype.getAllVisibleSignatures=function(){return to(to([],yi(this.getAllPrimitiveSignatures()),!1),yi(this.getAllTypeSignatures()),!1).filter(function(e){return e.isHidden()})},t.prototype.addTypeSignatureFromPayload=function(e){var n=_r.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=Aa(o),u=a.next();!u.done;u=a.next()){var c=u.value,l=_r.Signature.parseDescriptions(n[c]);s[c]=l}}catch(d){r={error:d}}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=Aa(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(mt.SignatureDefinitionBaseType.Any)?new Set(this.getAllVisibleTypes()):new Set(e),a=new Set,u=new Map;try{for(var c=Aa(o),l=c.next();!l.done;l=c.next()){var d=l.value;if(!this._excludeFromSearch.has(d)){for(var p=d,y=this.getTypeSignature(d),v=null;y!==null&&!a.has(y.getType())&&(a.add(y.getType()),y.isHidden()||(v=y.getDefinition(n,r)),v===null);)p=y.getExtendedType(),y=this.getTypeSignature(p);v!==null&&u.set(p,v)}}}catch(x){i={error:x}}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(mt.SignatureDefinitionBaseType.Any).getDefinition(n,r);if(e.includes(mt.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(mt.SignatureDefinitionBaseType.Any)?s.get(mt.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=Aa(this._primitives),a=o.next();!a.done;a=o.next()){var u=yi(a.value,2),c=u[0],l=u[1];s._primitives.set(c,l.copy())}}catch(v){e={error:v}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}try{for(var d=Aa(this._types),p=d.next();!p.done;p=d.next()){var y=yi(p.value,2),c=y[0],l=y[1];s._types.set(c,l.copy())}}catch(v){r={error:v}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}return s._excludeFromSearch=new Set(this._excludeFromSearch),s},t}();vr.Container=_P});var dA=m(lA=>{"use strict";Object.defineProperty(lA,"__esModule",{value:!0})});var $n=m(ct=>{"use strict";var vP=ct&&ct.__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]}),fA=ct&&ct.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&vP(e,t,n)};Object.defineProperty(ct,"__esModule",{value:!0});ct.VariationRegistry=ct.Container=ct.Signature=ct.SignatureDefinition=ct.SignatureDefinitionTypeMeta=ct.SignatureDefinitionFunction=ct.SignatureDefinitionFunctionArg=void 0;var SP=Km();Object.defineProperty(ct,"SignatureDefinitionFunctionArg",{enumerable:!0,get:function(){return SP.SignatureDefinitionFunctionArg}});var TP=Xm();Object.defineProperty(ct,"SignatureDefinitionFunction",{enumerable:!0,get:function(){return TP.SignatureDefinitionFunction}});var wP=ma();Object.defineProperty(ct,"SignatureDefinitionTypeMeta",{enumerable:!0,get:function(){return wP.SignatureDefinitionTypeMeta}});var EP=al();Object.defineProperty(ct,"SignatureDefinition",{enumerable:!0,get:function(){return EP.SignatureDefinition}});var AP=Mg();Object.defineProperty(ct,"Signature",{enumerable:!0,get:function(){return AP.Signature}});var xP=cA();Object.defineProperty(ct,"Container",{enumerable:!0,get:function(){return xP.Container}});var kP=ol();Object.defineProperty(ct,"VariationRegistry",{enumerable:!0,get:function(){return kP.VariationRegistry}});fA(dA(),ct);fA($i(),ct)});var Lg=m(Rl=>{"use strict";Object.defineProperty(Rl,"__esModule",{value:!0});Rl.enrichWithMetaInformation=void 0;var CP=n0(),pA=$n();function hA(t){return[t.name,t.description].filter(e=>e!==void 0).join(" ")}function OP(t){let e=(0,CP.parse)(`/**
104
104
  ${t.getDescription()}
105
105
  */`),[n]=e;if(n.tags.length>0){let r=[n.description??"",...n.tags.filter(a=>a.tag==="description").map(hA)].join(`
106
106
 
107
- `),i=n.tags.filter(a=>a.tag==="param").map(a=>({label:a.name,types:a.type.split("|"),opt:a.optional})),s=n.tags.find(a=>a.tag==="return")??{type:"any"},o=n.tags.filter(a=>a.tag==="example").map(hA);return pA.SignatureDefinitionFunction.parse({type:pA.SignatureDefinitionBaseType.Function,arguments:t.getArguments().map((a,u)=>{let c=a.getLabel(),l=a.getTypes().map(p=>p.toString()),d=a.isOptional();return{types:l,opt:d,...i[u],label:c}}),returns:s.type.split("|"),description:r,example:o})}return t}Rl.enrichWithMetaInformation=OP});var qg=m(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});Dl.createResolveChain=void 0;var tn=je();function bi(t,e,n=null,r=!1){switch(t.type){case tn.ASTType.ParenthesisExpression:{bi(t.expression,e,n);return}case tn.ASTType.MemberExpression:{let i=t;bi(i.base,e),e.push({ref:t,getter:i.identifier,unary:n,isInCallExpression:r});return}case tn.ASTType.IndexExpression:{let i=t;bi(i.base,e),e.push({ref:t,getter:i.index,unary:n,isInCallExpression:r});return}case tn.ASTType.CallStatement:{bi(t.expression,e,n,!0);return}case tn.ASTType.CallExpression:{bi(t.base,e,n,!0);return}case tn.ASTType.NegationExpression:case tn.ASTType.BinaryNegatedExpression:case tn.ASTType.UnaryExpression:{let i=t;bi(i.argument,e,i);return}case tn.ASTType.Identifier:{e.push({ref:t,getter:t,unary:n,isInCallExpression:r});return}case tn.ASTType.NumericLiteral:case tn.ASTType.StringLiteral:case tn.ASTType.NilLiteral:case tn.ASTType.MapConstructorExpression:case tn.ASTType.ListConstructorExpression:{e.push({ref:t,value:t,unary:n,isInCallExpression:r});return}case tn.ASTType.SliceExpression:bi(t.base,e),e.push({ref:t,unary:n,isInCallExpression:r})}}function RP(t){let e=[];return bi(t,e),e}Dl.createResolveChain=RP});var gA=m(jg=>{function mA(t,e){return t>e?1:-1}jg.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(mA),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},jg.sortNumbers=mA});var Bg=m(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.ObjectSet=no.ObjectSetIterator=void 0;var Fg=gA(),Il=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}}};no.ObjectSetIterator=Il;var $g=class{constructor(e){let r=(e?Array.from(e):[]).map(i=>[(0,Fg.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 Il(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,Fg.hash)(e);return this._map.set(n,e),this._first??(this._first=n),this._last=n,this}delete(e){let n=(0,Fg.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()}};no.ObjectSet=$g});var Ug=m(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});Pl.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION=void 0;Pl.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 Qi=m(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});xa.CompletionItemKind=void 0;var DP;(function(t){t.Variable="var",t.Property="var",t.Function="function",t.Literal="literal",t.Constant="constant",t.ListConstructor="list",t.MapConstructor="map",t.Expression="expr",t.Unknown="unknown"})(DP=xa.CompletionItemKind||(xa.CompletionItemKind={}))});var Hg=m(Sr=>{"use strict";Object.defineProperty(Sr,"__esModule",{value:!0});Sr.isResolveChainItemWithValue=Sr.isResolveChainItemWithIdentifier=Sr.isResolveChainItemWithMember=Sr.isResolveChainItemWithIndex=void 0;var _i=je(),IP=t=>t!=null&&t.ref.type===_i.ASTType.IndexExpression;Sr.isResolveChainItemWithIndex=IP;var PP=t=>t!=null&&t.ref.type===_i.ASTType.MemberExpression;Sr.isResolveChainItemWithMember=PP;var MP=t=>t!=null&&t.ref.type===_i.ASTType.Identifier;Sr.isResolveChainItemWithIdentifier=MP;var LP=t=>t!=null&&(t.ref.type===_i.ASTType.NumericLiteral||t.ref.type===_i.ASTType.StringLiteral||t.ref.type===_i.ASTType.NilLiteral||t.ref.type===_i.ASTType.MapConstructorExpression||t.ref.type===_i.ASTType.ListConstructorExpression);Sr.isResolveChainItemWithValue=LP});var Wg=m(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});Ml.isSignatureDefinitionFunction=void 0;var NP=$n(),qP=t=>t.getType().type===NP.SignatureDefinitionBaseType.Function;Ml.isSignatureDefinitionFunction=qP});var ka=m(Ll=>{"use strict";Object.defineProperty(Ll,"__esModule",{value:!0});Ll.injectIdentifers=void 0;var jP=(t,e)=>{for(let[n,r]of e.values)n.startsWith("i:")&&t.set(n.slice(2),{kind:r.kind,line:r.line})};Ll.injectIdentifers=jP});var ql=m(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.isEligibleForProperties=void 0;var Gg=$n(),FP=t=>t.types.has(Gg.SignatureDefinitionBaseType.Map)||t.types.has(Gg.SignatureDefinitionBaseType.List)||t.types.has(Gg.SignatureDefinitionBaseType.Any);Nl.isEligibleForProperties=FP});var Fl=m(jl=>{"use strict";Object.defineProperty(jl,"__esModule",{value:!0});jl.lookupProperty=void 0;var $P=ql(),BP=(t,e)=>{let n=t;for(;(0,$P.isEligibleForProperties)(n);){let r=n.values.get(`i:${e}`);if(r!=null)return r;let i=n.values.get("i:__isa");if(i==null)break;n=i}return null};jl.lookupProperty=BP});var so=m(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.Entity=vi.resolveEntity=void 0;var ro=$n(),io=Qi(),UP=Wg(),HP=ka(),$l=ql(),yA=Fl(),bA=Bg(),WP=(t,e,n=!1)=>{if(e.isCallable()&&!n){let r=e.getReturnEntity();if(r!==null)return r;let i=e.getCallableReturnTypes();return i?new Zi({kind:io.CompletionItemKind.Variable,container:t,label:e.label,context:e.context}).addType(...i):new Zi({kind:io.CompletionItemKind.Variable,container:t,label:e.label,context:e.context}).addType(ro.SignatureDefinitionBaseType.Any)}return e};vi.resolveEntity=WP;var Vg={hasProperty(t,e,n){return!!(0,yA.lookupProperty)(t,n)||!t.isAPI()&&!!e.getDefinition(Array.from(t.types),n,!0)},resolveProperty(t,e,n,r=!1){let i=(0,yA.lookupProperty)(t,n)??null;return i==null?t.isAPI()?null:e.getDefinition(Array.from(t.types),n,r):(0,vi.resolveEntity)(e,i,r)},setProperty(t,e,n,r){if(!(0,$l.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})),!0}},zg={hasProperty(t,e,n){if(!(0,$l.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,$l.isEligibleForProperties)(t))return new Zi({kind:io.CompletionItemKind.Variable,container:e,label:n.label,context:t}).addType(ro.SignatureDefinitionBaseType.Any);let i=new Zi({kind:io.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(ro.SignatureDefinitionBaseType.Any),(0,vi.resolveEntity)(e,i,r)},setProperty(t,e,n,r){if(!(0,$l.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}))}return!0}},Zi=class t{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._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 bA.ObjectSet,this._types=e.types??new Set,this._values=e.values??new Map,this._context=e.context??null,this._container=e.container,this._returnEntity=e.returnEntity??null}isFromSignature(){return this._isFromSignature}hasContext(){return this._context!=null&&!this._context.isAPI}isAPI(){return this._isAPI}isCallable(){return this._types.has(ro.SignatureDefinitionBaseType.Function)}getCallableReturnTypes(){if(!this.isCallable())return null;let e=Array.from(this._signatureDefinitions).filter(n=>(0,UP.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){for(let n of e)this._types.add(n);return this}hasProperty(e){switch(typeof e){case"object":return zg.hasProperty(this,this._container,e);default:return Vg.hasProperty(this,this._container,e)}}resolveProperty(e,n=!1){switch(typeof e){case"object":return zg.resolveProperty(this,this._container,e,n);default:return Vg.resolveProperty(this,this._container,e,n)}}setProperty(e,n){switch(typeof e){case"object":return zg.setProperty(this,this._container,e,n);default:return Vg.setProperty(this,this._container,e,n)}}extend(e){if(e===this)return this;this._isFromSignature=!1,this._signatureDefinitions.extend(e.signatureDefinitions),this.addType(...e.types);for(let[n,r]of e.values){let i=this.values.get(n);i==null?this.values.set(n,r.copy({container:this._container,context:this})):i.extend(r)}return this}insertSignature(e){let n=Object.keys(e.getDefinitions());this.addType(ro.SignatureDefinitionBaseType.Map);for(let r=0;r<n.length;r++){let i=n[r],s=e.getDefinition(i),o=new t({label:i,kind:s.getType().type===ro.SignatureDefinitionBaseType.Function?io.CompletionItemKind.Function:io.CompletionItemKind.Property,container:this._container,isFromSignature:!0});o.addSignatureType(s),this.setProperty(i,o)}return this}getAllIdentifier(){let e=new Map,n=this._values.get("i:__isa");if(n!=null)for(let r of n.getAllIdentifier())e.set(...r);for(let r of this._types){let i=this._container.getAllIdentifier(r);for(let s of i)e.set(...s)}return(0,HP.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({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 bA.ObjectSet(Array.from(this._signatureDefinitions,r=>r.copy())),types:new Set(this._types),returnEntity:this._returnEntity});return e.values?n._values=e.values:n._values=new Map(Array.from(this._values,([r,i])=>[r,i.copy({container:e.container,line:e.line,context:n,values:i.values})])),n}};vi.Entity=Zi});var Yg=m(Hl=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});Hl.Scope=void 0;var Bl=$n(),es=Qi(),Kg=ka(),Ul=so(),Xg=class t{get signatureDefinitions(){return null}get kind(){return es.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(Bl.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._container=e.container,this._parent=e.parent??null,this._globals=e.globals,this._locals=e.locals??new Ul.Entity({kind:es.CompletionItemKind.Constant,container:this._container,label:"locals"}).addType(Bl.SignatureDefinitionBaseType.Map)}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,Ul.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,Ul.resolveEntity)(this._container,r,n)}else if(this._globals.values.has(`i:${e}`)){let r=this._globals.values.get(`i:${e}`);return(0,Ul.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!")}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:es.CompletionItemKind.Constant,line:-1}],["locals",{kind:es.CompletionItemKind.Constant,line:-1}],["outer",{kind:es.CompletionItemKind.Constant,line:-1}],...this._container.getAllIdentifier(Bl.SignatureDefinitionBaseType.General)]);return this._locals!==this._globals&&(0,Kg.injectIdentifers)(e,this._globals),this._parent&&(0,Kg.injectIdentifers)(e,this._parent.locals),(0,Kg.injectIdentifers)(e,this._locals),this.isSelfAvailable()&&e.set("self",{kind:es.CompletionItemKind.Constant,line:-1}),this.isSuperAvailable()&&e.set("super",{kind:es.CompletionItemKind.Constant,line:-1}),e}isSelfAvailable(){return this._locals.context!=null&&this._locals.context.types.has(Bl.SignatureDefinitionBaseType.Map)}isSuperAvailable(){return this.isSelfAvailable()&&this._locals.context.hasProperty("__isa")}toJSON(){return this._locals.toJSON()}copy(e={}){return new t({container:e.container??this._container,parent:this._parent.copy({container:e.container}),globals:this._globals.copy({container:e.container}),locals:this._locals.copy(e)})}};Hl.Scope=Xg});var oo=m(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});Ca.GreybelKeyword=void 0;var GP;(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"})(GP=Ca.GreybelKeyword||(Ca.GreybelKeyword={}))});var Zg=m(Qg=>{"use strict";Object.defineProperty(Qg,"__esModule",{value:!0});var ts=je(),VP=oo(),Jg=class extends ts.LexerValidator{constructor(){super(...arguments),this.isKeyword=Set.prototype.has.bind(new Set([...Object.values(ts.Keyword),...Object.values(VP.GreybelKeyword)]))}isIdentifierStart(e){return super.isIdentifierStart(e)||e===ts.CharacterCode.HASH}isMultilineComment(e,n){return ts.CharacterCode.SLASH===e&&ts.CharacterCode.ASTERISK===n}isMultilineCommentEnd(e,n){return ts.CharacterCode.ASTERISK===e&&ts.CharacterCode.SLASH===n}isComment(e,n){return super.isComment(e,n)||this.isMultilineComment(e,n)}};Qg.default=Jg});var ey=m(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});Oa.CharacterCode=void 0;var zP;(function(t){t[t.VERTICAL_LINE=124]="VERTICAL_LINE",t[t.AMPERSAND=38]="AMPERSAND"})(zP=Oa.CharacterCode||(Oa.CharacterCode={}))});var ao=m(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});Ra.Operator=void 0;var KP;(function(t){t.BitwiseAnd="&",t.BitwiseOr="|",t.LeftShift="<<",t.RightShift=">>",t.UnsignedRightShift=">>>"})(KP=Ra.Operator||(Ra.Operator={}))});var ny=m(Da=>{"use strict";var XP=Da&&Da.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Da,"__esModule",{value:!0});var tr=je(),YP=XP(Zg()),_A=ey(),vA=oo(),ty=ao();function SA(t){let e=this.content[this.index];return this.index+=e.length,this.createPunctuator(e,t)}var Wl=class t extends tr.Lexer{constructor(e,n={}){n.validator=n.validator||new YP.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+2,o=0,a=n.offset,u=!1;for(;n.index<n.length;){let d=n.codeAt();if(n.validator.isEndOfLine(d))n.validator.isWinNewline(d,n.codeAt(1))&&n.index++,n.line++,o=n.index+1-n.offset,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 tr.ASTRange(new tr.ASTPosition(r,i-a+1),new tr.ASTPosition(n.line,n.index-a+1)));let c=n.content.slice(s,n.index);n.index+=2;let l=new tr.Token({type:tr.TokenType.Comment,value:c,line:r,lineStart:i,range:[n.tokenStart,n.index-o],offset:n.offset,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(vA.GreybelKeyword.ImportWithComment,n.index)||n.content.startsWith(vA.GreybelKeyword.IncludeWithComment,n.index)?(n.index++,n.scanIdentifierOrKeyword(e)):r.isMultilineComment(n.codeAt(),n.codeAt(1))?n.scanMultilineComment(e):super.scanComment(e)}};Da.default=Wl;Wl.greybelScanHandlers={[tr.CharacterCode.ARROW_LEFT]:function(e){if(tr.CharacterCode.ARROW_LEFT===this.codeAt(1))return this.scanPunctuator(ty.Operator.LeftShift,e)},[tr.CharacterCode.ARROW_RIGHT]:function(e){if(tr.CharacterCode.ARROW_RIGHT===this.codeAt(1))return tr.CharacterCode.ARROW_RIGHT===this.codeAt(2)?this.scanPunctuator(ty.Operator.UnsignedRightShift,e):this.scanPunctuator(ty.Operator.RightShift,e)},[_A.CharacterCode.AMPERSAND]:SA,[_A.CharacterCode.VERTICAL_LINE]:SA}});var Gl=m(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});Ia.ASTType=void 0;var JP;(function(t){t.FeatureImportExpression="FeatureImportExpression",t.FeatureIncludeExpression="FeatureIncludeExpression",t.FeatureEnvarExpression="FeatureEnvarExpression",t.FeatureInjectExpression="FeatureInjectExpression",t.FeatureDebuggerExpression="FeatureDebuggerExpression",t.FeatureLineExpression="FeatureLineExpression",t.FeatureFileExpression="FeatureFileExpression"})(JP=Ia.ASTType||(Ia.ASTType={}))});var iy=m(Vl=>{"use strict";Object.defineProperty(Vl,"__esModule",{value:!0});Vl.ASTChunkAdvanced=void 0;var QP=je(),ry=class t extends QP.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,scope:this.scope})}};Vl.ASTChunkAdvanced=ry});var ly=m(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.ASTFeatureFileExpression=Bn.ASTFeatureInjectExpression=Bn.ASTFeatureEnvarExpression=Bn.ASTFeatureIncludeExpression=Bn.ASTFeatureImportExpression=void 0;var Pa=je(),Ma=Gl(),sy=class t extends Pa.ASTBase{constructor(e){super(Ma.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,scope:this.scope})}};Bn.ASTFeatureImportExpression=sy;var oy=class t extends Pa.ASTBase{constructor(e){super(Ma.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,scope:this.scope})}};Bn.ASTFeatureIncludeExpression=oy;var ay=class t extends Pa.ASTBase{constructor(e){super(Ma.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,scope:this.scope})}};Bn.ASTFeatureEnvarExpression=ay;var uy=class t extends Pa.ASTBase{constructor(e){super(Ma.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,scope:this.scope})}};Bn.ASTFeatureInjectExpression=uy;var cy=class t extends Pa.ASTBase{constructor(e){super(Ma.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,scope:this.scope})}};Bn.ASTFeatureFileExpression=cy});var py=m(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.ASTFeatureInjectExpression=It.ASTFeatureIncludeExpression=It.ASTFeatureImportExpression=It.ASTFeatureFileExpression=It.ASTFeatureEnvarExpression=It.ASTChunkAdvanced=It.ASTType=It.ASTProvider=void 0;var dy=je(),TA=Gl(),ZP=iy(),La=ly(),fy=class extends dy.ASTProvider{featureImportExpression(e){return new La.ASTFeatureImportExpression(e)}featureIncludeExpression(e){return new La.ASTFeatureIncludeExpression(e)}featureEnvarExpression(e){return new La.ASTFeatureEnvarExpression(e)}featureInjectExpression(e){return new La.ASTFeatureInjectExpression(e)}featureDebuggerExpression(e){return new dy.ASTBase(TA.ASTType.FeatureDebuggerExpression,e)}featureLineExpression(e){return new dy.ASTBase(TA.ASTType.FeatureLineExpression,e)}featureFileExpression(e){return new La.ASTFeatureFileExpression(e)}chunkAdvanced(e){return new ZP.ASTChunkAdvanced(e)}};It.ASTProvider=fy;var eM=Gl();Object.defineProperty(It,"ASTType",{enumerable:!0,get:function(){return eM.ASTType}});var tM=iy();Object.defineProperty(It,"ASTChunkAdvanced",{enumerable:!0,get:function(){return tM.ASTChunkAdvanced}});var Na=ly();Object.defineProperty(It,"ASTFeatureEnvarExpression",{enumerable:!0,get:function(){return Na.ASTFeatureEnvarExpression}});Object.defineProperty(It,"ASTFeatureFileExpression",{enumerable:!0,get:function(){return Na.ASTFeatureFileExpression}});Object.defineProperty(It,"ASTFeatureImportExpression",{enumerable:!0,get:function(){return Na.ASTFeatureImportExpression}});Object.defineProperty(It,"ASTFeatureIncludeExpression",{enumerable:!0,get:function(){return Na.ASTFeatureIncludeExpression}});Object.defineProperty(It,"ASTFeatureInjectExpression",{enumerable:!0,get:function(){return Na.ASTFeatureInjectExpression}})});var hy=m(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.SelectorGroups=lt.SelectorGroupType=lt.Selectors=lt.SelectorTypes=void 0;var Ne=je(),zl=oo(),qa=ao(),nM;(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"})(nM=lt.SelectorTypes||(lt.SelectorTypes={}));lt.Selectors=Object.assign(Object.assign({},Ne.Selectors),{From:(0,Ne.createSelector)({type:Ne.TokenType.Identifier,value:"from"}),Envar:(0,Ne.createSelector)({type:Ne.TokenType.Keyword,value:zl.GreybelKeyword.Envar}),Inject:(0,Ne.createSelector)({type:Ne.TokenType.Keyword,value:zl.GreybelKeyword.Inject}),Line:(0,Ne.createSelector)({type:Ne.TokenType.Keyword,value:zl.GreybelKeyword.Line}),File:(0,Ne.createSelector)({type:Ne.TokenType.Keyword,value:zl.GreybelKeyword.File}),LeftShift:(0,Ne.createSelector)({type:Ne.TokenType.Punctuator,value:qa.Operator.LeftShift}),RightShift:(0,Ne.createSelector)({type:Ne.TokenType.Punctuator,value:qa.Operator.RightShift}),UnsignedRightShift:(0,Ne.createSelector)({type:Ne.TokenType.Punctuator,value:qa.Operator.UnsignedRightShift}),BitwiseOr:(0,Ne.createSelector)({type:Ne.TokenType.Punctuator,value:qa.Operator.BitwiseOr}),BitwiseAnd:(0,Ne.createSelector)({type:Ne.TokenType.Punctuator,value:qa.Operator.BitwiseAnd}),Escape:(0,Ne.createSelector)({type:Ne.TokenType.Punctuator,value:Ne.Operator.Escape})});var jr;(function(t){t.MapSeparator="MapSeparator",t.ListSeparator="ListSeparator",t.PathSegmentEnd="PathSegmentEnd",t.BitwiseOperators="BitwiseOperators"})(jr=lt.SelectorGroupType||(lt.SelectorGroupType={}));lt.SelectorGroups=Object.assign(Object.assign({},Ne.SelectorGroups),{[jr.MapSeparator]:(0,Ne.createSelectorGroup)(jr.MapSeparator,[lt.Selectors.MapSeperator,lt.Selectors.CRBracket]),[jr.ListSeparator]:(0,Ne.createSelectorGroup)(jr.ListSeparator,[lt.Selectors.MapSeperator,lt.Selectors.SRBracket]),[jr.PathSegmentEnd]:(0,Ne.createSelectorGroup)(jr.PathSegmentEnd,[lt.Selectors.EndOfLine,lt.Selectors.Comment,lt.Selectors.EndOfFile]),[jr.BitwiseOperators]:(0,Ne.createSelectorGroup)(jr.BitwiseOperators,[lt.Selectors.LeftShift,lt.Selectors.RightShift,lt.Selectors.UnsignedRightShift])})});var AA=m(ja=>{"use strict";var rM=ja&&ja.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ja,"__esModule",{value:!0});var dn=je(),iM=zo(),wA=Zo(),sM=rM(ny()),oM=py(),ns=oo(),EA=ao(),Ie=hy(),my=class extends dn.Parser{constructor(e,n={}){var r;n.lexer=n.lexer||new sM.default(e,{unsafe:n.unsafe,tabWidth:n.tabWidth}),n.astProvider=n.astProvider||new oM.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(){let e=this,n=0;for(;;){if(Ie.Selectors.Comment(e.token)){let r=e.astProvider.comment({value:e.token.value,isMultiline:e.token.value.indexOf(`
108
- `)!==-1,start:e.token.start,end:e.token.end,scope:e.currentScope});e.addItemToLines(r),e.backpatches.peek().body.push(r)}else if(Ie.Selectors.EndOfLine(e.token))n++;else break;e.next()}return n}parseMap(e=!1,n=!1){let r=this;if(!Ie.Selectors.CLBracket(r.token))return r.parseList(e,n);let i=r.currentScope,s=r.token.start,o=[],a=r.astProvider.mapConstructorExpression({fields:o,start:s,end:null,scope:i});if(r.next(),Ie.Selectors.CRBracket(r.token))r.next();else for(;!Ie.Selectors.EndOfFile(r.token);){if(r.skipNewlines(),Ie.Selectors.CRBracket(r.token)){r.next();break}let u=r.astProvider.mapKeyString({key:null,value:null,start:r.token.start,end:null,scope:i});if(u.key=r.parseExpr(null),r.requireToken(Ie.Selectors.MapKeyValueSeperator),r.skipNewlines(),r.currentAssignment){let l=r.astProvider.assignmentStatement({variable:r.astProvider.indexExpression({index:u.key,base:r.currentAssignment.variable,start:u.start,end:r.token.end,scope:i}),init:null,start:u.start,end:null}),d=r.currentAssignment;r.currentAssignment=l,u.value=r.parseExpr(u),r.currentAssignment=d,l.init=u.value,l.end=r.previousToken.end,i.assignments.push(l)}else u.value=r.parseExpr(u);u.end=r.previousToken.end,o.push(u),r.skipNewlines();let c=r.requireTokenOfAny(Ie.SelectorGroups.MapSeparator,s);if(Ie.Selectors.CRBracket(c))break}return a.end=r.token.start,a}parseList(e=!1,n=!1){let r=this;if(!Ie.Selectors.SLBracket(r.token))return r.parseQuantity(e,n);let i=r.currentScope,s=r.token.start,o=[],a=r.astProvider.listConstructorExpression({fields:o,start:s,end:null,scope:i});if(r.next(),Ie.Selectors.SRBracket(r.token))r.next();else for(;!Ie.Selectors.EndOfFile(r.token);){if(r.skipNewlines(),Ie.Selectors.SRBracket(r.token)){r.next();break}let u=r.astProvider.listValue({value:null,start:r.token.start,end:null,scope:i});if(r.currentAssignment){let l=r.astProvider.assignmentStatement({variable:r.astProvider.indexExpression({index:r.astProvider.literal(dn.TokenType.NumericLiteral,{value:o.length,raw:`${o.length}`,start:s,end:r.token.end,scope:i}),base:r.currentAssignment.variable,start:null,end:null,scope:i}),init:null,start:null,end:null}),d=r.currentAssignment,p=r.token;r.currentAssignment=d,u.value=r.parseExpr(u),r.currentAssignment=d,l.variable.start=p.start,l.variable.end=r.previousToken.end,l.init=u.value,l.start=u.start,l.end=r.previousToken.end,i.assignments.push(l)}else u.value=r.parseExpr(u);u.end=r.previousToken.end,o.push(u),r.skipNewlines();let c=r.requireTokenOfAny(Ie.SelectorGroups.ListSeparator,s);if(Ie.Selectors.SRBracket(c))break}return a.end=r.token.start,a}parsePathSegment(){let e=this;if(this.token.type===dn.ASTType.StringLiteral){let r=this.token.value;return this.next(),r}let n="";for(;!Ie.SelectorGroups.PathSegmentEnd(e.token);)n=n+e.token.value,e.next();return e.consumeMany(Ie.SelectorGroups.PathSegmentEnd),n}parseFeatureIncludeStatement(){let e=this,n=e.previousToken.start,r=e.parsePathSegment(),i=e.astProvider.featureIncludeExpression({path:r,start:n,end:e.previousToken.end,scope:e.currentScope});return e.includes.push(i),i}parseFeatureImportStatement(){var e;let n=this,r=n.previousToken.start,i=n.parseIdentifier();if(!n.consume(Ie.Selectors.From))return n.raise("expected from keyword",new wA.Range(r,new iM.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,end:n.previousToken.end,scope:n.currentScope});n.imports.push(o);let a=n.astProvider.assignmentStatement({variable:i,init:n.astProvider.literal(dn.TokenType.NilLiteral,{value:null,raw:"null",start:i.start,end:i.end,scope:n.currentScope}),start:i.start,end:i.end,scope:n.currentScope});return n.currentScope.assignments.push(a),o}parseFeatureEnvarExpression(){let e=this,n=e.previousToken.start,r=e.token.value;return e.next(),e.astProvider.featureEnvarExpression({name:r,start:n,end:e.previousToken.end,scope:e.currentScope})}parseFeatureInjectExpression(){let e=this,n=e.previousToken.start,r=this.parsePathSegment();e.next();let i=e.astProvider.featureInjectExpression({path:r,start:n,end:e.previousToken.end,scope:e.currentScope});return e.injects.push(i),i}parseIsa(e=!1,n=!1){let r=this,i=r.token.start,s=r.parseBitwiseOr(e,n);if(Ie.Selectors.Isa(r.token)){r.next(),r.skipNewlines();let o=r.parseBitwiseOr();return r.astProvider.isaExpression({operator:dn.Operator.Isa,left:s,right:o,start:i,end:r.previousToken.end,scope:r.currentScope})}return s}parseBitwiseOr(e=!1,n=!1){let r=this,i=r.token.start,o=r.parseBitwiseAnd(e,n);for(;Ie.Selectors.BitwiseOr(r.token);){r.next();let a=r.parseBitwiseAnd();o=r.astProvider.binaryExpression({operator:EA.Operator.BitwiseOr,left:o,right:a,start:i,end:r.previousToken.end,scope:r.currentScope})}return o}parseBitwiseAnd(e=!1,n=!1){let r=this,i=r.token.start,o=r.parseComparisons(e,n);for(;Ie.Selectors.BitwiseAnd(r.token);){r.next();let a=r.parseComparisons();o=r.astProvider.binaryExpression({operator:EA.Operator.BitwiseAnd,left:o,right:a,start:i,end:r.previousToken.end,scope:r.currentScope})}return o}parseAddSub(e=!1,n=!1){let r=this,i=r.token.start,o=r.parseBitwise(e,n);for(;Ie.Selectors.Plus(r.token)||Ie.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,end:r.previousToken.end,scope:r.currentScope})}return o}parseBitwise(e=!1,n=!1){let r=this,i=r.token.start,o=r.parseMultDiv(e,n);for(;Ie.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,end:r.previousToken.end,scope:r.currentScope})}return o}parseAtom(){let e=this;return Ie.Selectors.Envar(e.token)?(e.next(),e.parseFeatureEnvarExpression()):Ie.Selectors.Inject(e.token)?(e.next(),e.parseFeatureInjectExpression()):Ie.Selectors.Line(e.token)?(e.next(),e.astProvider.featureLineExpression({start:new dn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new dn.ASTPosition(e.previousToken.line,e.previousToken.end.character),scope:e.currentScope})):Ie.Selectors.File(e.token)?(e.next(),e.astProvider.featureFileExpression({filename:e.filename,start:new dn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new dn.ASTPosition(e.previousToken.line,e.previousToken.end.character),scope:e.currentScope})):super.parseAtom()}parseStatement(){let e=this,n=e.backpatches.peek();if(e.isType(dn.TokenType.Keyword))switch(e.token.value){case ns.GreybelKeyword.Include:case ns.GreybelKeyword.IncludeWithComment:{e.next();let i=e.parseFeatureIncludeStatement();e.addItemToLines(i),n.body.push(i);return}case ns.GreybelKeyword.Import:case ns.GreybelKeyword.ImportWithComment:{e.next();let i=e.parseFeatureImportStatement();e.addItemToLines(i),n.body.push(i);return}case ns.GreybelKeyword.Envar:{e.next();let i=e.parseFeatureEnvarExpression();e.addItemToLines(i),n.body.push(i);return}case ns.GreybelKeyword.Inject:{e.next();let i=e.parseFeatureInjectExpression();e.addItemToLines(i),n.body.push(i);return}case ns.GreybelKeyword.Debugger:{e.next();let i=e.astProvider.featureDebuggerExpression({start:new dn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new dn.ASTPosition(e.previousToken.line,e.previousToken.end.character),scope:e.currentScope});e.addItemToLines(i),n.body.push(i);return}default:break}super.parseStatement()}parseChunk(){let e=this;e.next();let n=e.token.start,r=e.astProvider.chunkAdvanced({start:n,end:null}),i=new dn.PendingChunk(r);for(e.backpatches.setDefault(i),e.pushScope(r);!Ie.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!Ie.Selectors.EndOfFile(e.token));)e.lexer.recordSnapshot(),e.statementErrors=[],e.parseStatement(),e.statementErrors.length>0&&e.tryToRecover();let s=e.backpatches.pop();for(;!(0,dn.isPendingChunk)(s);){let o=e.raise(`found open block ${s.block.type}`,new wA.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.lines,r.imports=e.imports,r.includes=e.includes,r.injects=e.injects,r}};ja.default=my});var Fr=m(xt=>{"use strict";var aM=xt&&xt.__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]}),Fa=xt&&xt.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&aM(e,t,n)},gy=xt&&xt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xt,"__esModule",{value:!0});xt.Parser=xt.LexerValidator=xt.Lexer=void 0;var uM=ny();Object.defineProperty(xt,"Lexer",{enumerable:!0,get:function(){return gy(uM).default}});var cM=Zg();Object.defineProperty(xt,"LexerValidator",{enumerable:!0,get:function(){return gy(cM).default}});var lM=AA();Object.defineProperty(xt,"Parser",{enumerable:!0,get:function(){return gy(lM).default}});Fa(py(),xt);Fa(ey(),xt);Fa(oo(),xt);Fa(ao(),xt);Fa(hy(),xt)});var by=m(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});Xl.Aggregator=void 0;var Kl=Fr(),Re=$n(),Fe=je(),dM=Ug(),Te=Qi(),rs=Hg(),xA=Im(),fM=Ng(),kA=qg(),CA=aa(),pM=so(),yy=class{get definitions(){return this._definitions}get parent(){return this._parent}constructor(e){this._root=e.root,this._scope=e.scope,this._document=e.document,this._parent=e.parent??null,this._definitions=new Map}factory(e){return new pM.Entity({kind:e,container:this._document.container})}createFunctionDescription(e,n=dM.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION){let r=this._document.getLastASTItemOfLine(e.start.line-1),i=this._document.findASTItemInLine(e.start.line,Fe.ASTType.Comment);if(r instanceof Fe.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 Fe.ASTComment)s.add(u),o.unshift(u.value);else break}return o.join(`
107
+ `),i=n.tags.filter(a=>a.tag==="param").map(a=>({label:a.name,types:a.type.split("|"),opt:a.optional})),s=n.tags.find(a=>a.tag==="return")??{type:"any"},o=n.tags.filter(a=>a.tag==="example").map(hA);return pA.SignatureDefinitionFunction.parse({type:pA.SignatureDefinitionBaseType.Function,arguments:t.getArguments().map((a,u)=>{let c=a.getLabel(),l=a.getTypes().map(p=>p.toString()),d=a.isOptional();return{types:l,opt:d,...i[u],label:c}}),returns:s.type.split("|"),description:r,example:o})}return t}Rl.enrichWithMetaInformation=OP});var Ng=m(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});Dl.createResolveChain=void 0;var tn=je();function bi(t,e,n=null,r=!1){switch(t.type){case tn.ASTType.ParenthesisExpression:{bi(t.expression,e,n);return}case tn.ASTType.MemberExpression:{let i=t;bi(i.base,e),e.push({ref:t,getter:i.identifier,unary:n,isInCallExpression:r});return}case tn.ASTType.IndexExpression:{let i=t;bi(i.base,e),e.push({ref:t,getter:i.index,unary:n,isInCallExpression:r});return}case tn.ASTType.CallStatement:{bi(t.expression,e,n,!0);return}case tn.ASTType.CallExpression:{bi(t.base,e,n,!0);return}case tn.ASTType.NegationExpression:case tn.ASTType.BinaryNegatedExpression:case tn.ASTType.UnaryExpression:{let i=t;bi(i.argument,e,i);return}case tn.ASTType.Identifier:{e.push({ref:t,getter:t,unary:n,isInCallExpression:r});return}case tn.ASTType.NumericLiteral:case tn.ASTType.StringLiteral:case tn.ASTType.NilLiteral:case tn.ASTType.MapConstructorExpression:case tn.ASTType.ListConstructorExpression:{e.push({ref:t,value:t,unary:n,isInCallExpression:r});return}case tn.ASTType.SliceExpression:bi(t.base,e),e.push({ref:t,unary:n,isInCallExpression:r})}}function RP(t){let e=[];return bi(t,e),e}Dl.createResolveChain=RP});var gA=m(qg=>{function mA(t,e){return t>e?1:-1}qg.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(mA),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},qg.sortNumbers=mA});var $g=m(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.ObjectSet=no.ObjectSetIterator=void 0;var jg=gA(),Il=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}}};no.ObjectSetIterator=Il;var Fg=class{constructor(e){let r=(e?Array.from(e):[]).map(i=>[(0,jg.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 Il(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,jg.hash)(e);return this._map.set(n,e),this._first??(this._first=n),this._last=n,this}delete(e){let n=(0,jg.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()}};no.ObjectSet=Fg});var Bg=m(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});Pl.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION=void 0;Pl.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 Qi=m(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});xa.CompletionItemKind=void 0;var DP;(function(t){t.Variable="var",t.Property="var",t.Function="function",t.Literal="literal",t.Constant="constant",t.ListConstructor="list",t.MapConstructor="map",t.Expression="expr",t.Unknown="unknown"})(DP=xa.CompletionItemKind||(xa.CompletionItemKind={}))});var Ug=m(Sr=>{"use strict";Object.defineProperty(Sr,"__esModule",{value:!0});Sr.isResolveChainItemWithValue=Sr.isResolveChainItemWithIdentifier=Sr.isResolveChainItemWithMember=Sr.isResolveChainItemWithIndex=void 0;var _i=je(),IP=t=>t!=null&&t.ref.type===_i.ASTType.IndexExpression;Sr.isResolveChainItemWithIndex=IP;var PP=t=>t!=null&&t.ref.type===_i.ASTType.MemberExpression;Sr.isResolveChainItemWithMember=PP;var MP=t=>t!=null&&t.ref.type===_i.ASTType.Identifier;Sr.isResolveChainItemWithIdentifier=MP;var LP=t=>t!=null&&(t.ref.type===_i.ASTType.NumericLiteral||t.ref.type===_i.ASTType.StringLiteral||t.ref.type===_i.ASTType.NilLiteral||t.ref.type===_i.ASTType.MapConstructorExpression||t.ref.type===_i.ASTType.ListConstructorExpression);Sr.isResolveChainItemWithValue=LP});var Hg=m(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});Ml.isSignatureDefinitionFunction=void 0;var NP=$n(),qP=t=>t.getType().type===NP.SignatureDefinitionBaseType.Function;Ml.isSignatureDefinitionFunction=qP});var ka=m(Ll=>{"use strict";Object.defineProperty(Ll,"__esModule",{value:!0});Ll.injectIdentifers=void 0;var jP=(t,e)=>{for(let[n,r]of e.values)n.startsWith("i:")&&t.set(n.slice(2),{kind:r.kind,line:r.line})};Ll.injectIdentifers=jP});var ql=m(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.isEligibleForProperties=void 0;var Wg=$n(),FP=t=>t.types.has(Wg.SignatureDefinitionBaseType.Map)||t.types.has(Wg.SignatureDefinitionBaseType.List)||t.types.has(Wg.SignatureDefinitionBaseType.Any);Nl.isEligibleForProperties=FP});var Fl=m(jl=>{"use strict";Object.defineProperty(jl,"__esModule",{value:!0});jl.lookupProperty=void 0;var $P=ql(),BP=(t,e)=>{let n=t;for(;(0,$P.isEligibleForProperties)(n);){let r=n.values.get(`i:${e}`);if(r!=null)return r;let i=n.values.get("i:__isa");if(i==null)break;n=i}return null};jl.lookupProperty=BP});var so=m(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.Entity=vi.resolveEntity=void 0;var ro=$n(),io=Qi(),UP=Hg(),HP=ka(),$l=ql(),yA=Fl(),bA=$g(),WP=(t,e,n=!1)=>{if(e.isCallable()&&!n){let r=e.getReturnEntity();if(r!==null)return r;let i=e.getCallableReturnTypes();return i?new Zi({kind:io.CompletionItemKind.Variable,container:t,label:e.label,context:e.context}).addType(...i):new Zi({kind:io.CompletionItemKind.Variable,container:t,label:e.label,context:e.context}).addType(ro.SignatureDefinitionBaseType.Any)}return e};vi.resolveEntity=WP;var Gg={hasProperty(t,e,n){return!!(0,yA.lookupProperty)(t,n)||!t.isAPI()&&!!e.getDefinition(Array.from(t.types),n,!0)},resolveProperty(t,e,n,r=!1){let i=(0,yA.lookupProperty)(t,n)??null;return i==null?t.isAPI()?null:e.getDefinition(Array.from(t.types),n,r):(0,vi.resolveEntity)(e,i,r)},setProperty(t,e,n,r){if(!(0,$l.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})),!0}},Vg={hasProperty(t,e,n){if(!(0,$l.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,$l.isEligibleForProperties)(t))return new Zi({kind:io.CompletionItemKind.Variable,container:e,label:n.label,context:t}).addType(ro.SignatureDefinitionBaseType.Any);let i=new Zi({kind:io.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(ro.SignatureDefinitionBaseType.Any),(0,vi.resolveEntity)(e,i,r)},setProperty(t,e,n,r){if(!(0,$l.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}))}return!0}},Zi=class t{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._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 bA.ObjectSet,this._types=e.types??new Set,this._values=e.values??new Map,this._context=e.context??null,this._container=e.container,this._returnEntity=e.returnEntity??null}isFromSignature(){return this._isFromSignature}hasContext(){return this._context!=null&&!this._context.isAPI}isAPI(){return this._isAPI}isCallable(){return this._types.has(ro.SignatureDefinitionBaseType.Function)}getCallableReturnTypes(){if(!this.isCallable())return null;let e=Array.from(this._signatureDefinitions).filter(n=>(0,UP.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){for(let n of e)this._types.add(n);return this}hasProperty(e){switch(typeof e){case"object":return Vg.hasProperty(this,this._container,e);default:return Gg.hasProperty(this,this._container,e)}}resolveProperty(e,n=!1){switch(typeof e){case"object":return Vg.resolveProperty(this,this._container,e,n);default:return Gg.resolveProperty(this,this._container,e,n)}}setProperty(e,n){switch(typeof e){case"object":return Vg.setProperty(this,this._container,e,n);default:return Gg.setProperty(this,this._container,e,n)}}extend(e){if(e===this)return this;this._isFromSignature=!1,this._signatureDefinitions.extend(e.signatureDefinitions),this.addType(...e.types);for(let[n,r]of e.values){let i=this.values.get(n);i==null?this.values.set(n,r.copy({container:this._container,context:this})):i.extend(r)}return this}insertSignature(e){let n=Object.keys(e.getDefinitions());this.addType(ro.SignatureDefinitionBaseType.Map);for(let r=0;r<n.length;r++){let i=n[r],s=e.getDefinition(i),o=new t({label:i,kind:s.getType().type===ro.SignatureDefinitionBaseType.Function?io.CompletionItemKind.Function:io.CompletionItemKind.Property,container:this._container,isFromSignature:!0});o.addSignatureType(s),this.setProperty(i,o)}return this}getAllIdentifier(){let e=new Map,n=this._values.get("i:__isa");if(n!=null)for(let r of n.getAllIdentifier())e.set(...r);for(let r of this._types){let i=this._container.getAllIdentifier(r);for(let s of i)e.set(...s)}return(0,HP.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({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 bA.ObjectSet(Array.from(this._signatureDefinitions,r=>r.copy())),types:new Set(this._types),returnEntity:this._returnEntity});return e.values?n._values=e.values:n._values=new Map(Array.from(this._values,([r,i])=>[r,i.copy({container:e.container,line:e.line,context:n,values:i.values})])),n}};vi.Entity=Zi});var Xg=m(Hl=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});Hl.Scope=void 0;var Bl=$n(),es=Qi(),zg=ka(),Ul=so(),Kg=class t{get signatureDefinitions(){return null}get kind(){return es.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(Bl.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._container=e.container,this._parent=e.parent??null,this._globals=e.globals,this._locals=e.locals??new Ul.Entity({kind:es.CompletionItemKind.Constant,container:this._container,label:"locals"}).addType(Bl.SignatureDefinitionBaseType.Map)}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,Ul.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,Ul.resolveEntity)(this._container,r,n)}else if(this._globals.values.has(`i:${e}`)){let r=this._globals.values.get(`i:${e}`);return(0,Ul.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!")}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:es.CompletionItemKind.Constant,line:-1}],["locals",{kind:es.CompletionItemKind.Constant,line:-1}],["outer",{kind:es.CompletionItemKind.Constant,line:-1}],...this._container.getAllIdentifier(Bl.SignatureDefinitionBaseType.General)]);return this._locals!==this._globals&&(0,zg.injectIdentifers)(e,this._globals),this._parent&&(0,zg.injectIdentifers)(e,this._parent.locals),(0,zg.injectIdentifers)(e,this._locals),this.isSelfAvailable()&&e.set("self",{kind:es.CompletionItemKind.Constant,line:-1}),this.isSuperAvailable()&&e.set("super",{kind:es.CompletionItemKind.Constant,line:-1}),e}isSelfAvailable(){return this._locals.context!=null&&this._locals.context.types.has(Bl.SignatureDefinitionBaseType.Map)}isSuperAvailable(){return this.isSelfAvailable()&&this._locals.context.hasProperty("__isa")}toJSON(){return this._locals.toJSON()}copy(e={}){return new t({container:e.container??this._container,parent:this._parent.copy({container:e.container}),globals:this._globals.copy({container:e.container}),locals:this._locals.copy(e)})}};Hl.Scope=Kg});var oo=m(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});Ca.GreybelKeyword=void 0;var GP;(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"})(GP=Ca.GreybelKeyword||(Ca.GreybelKeyword={}))});var Qg=m(Jg=>{"use strict";Object.defineProperty(Jg,"__esModule",{value:!0});var ts=je(),VP=oo(),Yg=class extends ts.LexerValidator{constructor(){super(...arguments),this.isKeyword=Set.prototype.has.bind(new Set([...Object.values(ts.Keyword),...Object.values(VP.GreybelKeyword)]))}isIdentifierStart(e){return super.isIdentifierStart(e)||e===ts.CharacterCode.HASH}isMultilineComment(e,n){return ts.CharacterCode.SLASH===e&&ts.CharacterCode.ASTERISK===n}isMultilineCommentEnd(e,n){return ts.CharacterCode.ASTERISK===e&&ts.CharacterCode.SLASH===n}isComment(e,n){return super.isComment(e,n)||this.isMultilineComment(e,n)}};Jg.default=Yg});var Zg=m(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});Oa.CharacterCode=void 0;var zP;(function(t){t[t.VERTICAL_LINE=124]="VERTICAL_LINE",t[t.AMPERSAND=38]="AMPERSAND"})(zP=Oa.CharacterCode||(Oa.CharacterCode={}))});var ao=m(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});Ra.Operator=void 0;var KP;(function(t){t.BitwiseAnd="&",t.BitwiseOr="|",t.LeftShift="<<",t.RightShift=">>",t.UnsignedRightShift=">>>"})(KP=Ra.Operator||(Ra.Operator={}))});var ty=m(Da=>{"use strict";var XP=Da&&Da.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Da,"__esModule",{value:!0});var tr=je(),YP=XP(Qg()),_A=Zg(),vA=oo(),ey=ao();function SA(t){let e=this.content[this.index];return this.index+=e.length,this.createPunctuator(e,t)}var Wl=class t extends tr.Lexer{constructor(e,n={}){n.validator=n.validator||new YP.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+2,o=0,a=n.offset,u=!1;for(;n.index<n.length;){let d=n.codeAt();if(n.validator.isEndOfLine(d))n.validator.isWinNewline(d,n.codeAt(1))&&n.index++,n.line++,o=n.index+1-n.offset,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 tr.ASTRange(new tr.ASTPosition(r,i-a+1),new tr.ASTPosition(n.line,n.index-a+1)));let c=n.content.slice(s,n.index);n.index+=2;let l=new tr.Token({type:tr.TokenType.Comment,value:c,line:r,lineStart:i,range:[n.tokenStart,n.index-o],offset:n.offset,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(vA.GreybelKeyword.ImportWithComment,n.index)||n.content.startsWith(vA.GreybelKeyword.IncludeWithComment,n.index)?(n.index++,n.scanIdentifierOrKeyword(e)):r.isMultilineComment(n.codeAt(),n.codeAt(1))?n.scanMultilineComment(e):super.scanComment(e)}};Da.default=Wl;Wl.greybelScanHandlers={[tr.CharacterCode.ARROW_LEFT]:function(e){if(tr.CharacterCode.ARROW_LEFT===this.codeAt(1))return this.scanPunctuator(ey.Operator.LeftShift,e)},[tr.CharacterCode.ARROW_RIGHT]:function(e){if(tr.CharacterCode.ARROW_RIGHT===this.codeAt(1))return tr.CharacterCode.ARROW_RIGHT===this.codeAt(2)?this.scanPunctuator(ey.Operator.UnsignedRightShift,e):this.scanPunctuator(ey.Operator.RightShift,e)},[_A.CharacterCode.AMPERSAND]:SA,[_A.CharacterCode.VERTICAL_LINE]:SA}});var Gl=m(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});Ia.ASTType=void 0;var JP;(function(t){t.FeatureImportExpression="FeatureImportExpression",t.FeatureIncludeExpression="FeatureIncludeExpression",t.FeatureEnvarExpression="FeatureEnvarExpression",t.FeatureInjectExpression="FeatureInjectExpression",t.FeatureDebuggerExpression="FeatureDebuggerExpression",t.FeatureLineExpression="FeatureLineExpression",t.FeatureFileExpression="FeatureFileExpression"})(JP=Ia.ASTType||(Ia.ASTType={}))});var ry=m(Vl=>{"use strict";Object.defineProperty(Vl,"__esModule",{value:!0});Vl.ASTChunkAdvanced=void 0;var QP=je(),ny=class t extends QP.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,scope:this.scope})}};Vl.ASTChunkAdvanced=ny});var cy=m(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.ASTFeatureFileExpression=Bn.ASTFeatureInjectExpression=Bn.ASTFeatureEnvarExpression=Bn.ASTFeatureIncludeExpression=Bn.ASTFeatureImportExpression=void 0;var Pa=je(),Ma=Gl(),iy=class t extends Pa.ASTBase{constructor(e){super(Ma.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,scope:this.scope})}};Bn.ASTFeatureImportExpression=iy;var sy=class t extends Pa.ASTBase{constructor(e){super(Ma.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,scope:this.scope})}};Bn.ASTFeatureIncludeExpression=sy;var oy=class t extends Pa.ASTBase{constructor(e){super(Ma.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,scope:this.scope})}};Bn.ASTFeatureEnvarExpression=oy;var ay=class t extends Pa.ASTBase{constructor(e){super(Ma.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,scope:this.scope})}};Bn.ASTFeatureInjectExpression=ay;var uy=class t extends Pa.ASTBase{constructor(e){super(Ma.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,scope:this.scope})}};Bn.ASTFeatureFileExpression=uy});var fy=m(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.ASTFeatureInjectExpression=It.ASTFeatureIncludeExpression=It.ASTFeatureImportExpression=It.ASTFeatureFileExpression=It.ASTFeatureEnvarExpression=It.ASTChunkAdvanced=It.ASTType=It.ASTProvider=void 0;var ly=je(),TA=Gl(),ZP=ry(),La=cy(),dy=class extends ly.ASTProvider{featureImportExpression(e){return new La.ASTFeatureImportExpression(e)}featureIncludeExpression(e){return new La.ASTFeatureIncludeExpression(e)}featureEnvarExpression(e){return new La.ASTFeatureEnvarExpression(e)}featureInjectExpression(e){return new La.ASTFeatureInjectExpression(e)}featureDebuggerExpression(e){return new ly.ASTBase(TA.ASTType.FeatureDebuggerExpression,e)}featureLineExpression(e){return new ly.ASTBase(TA.ASTType.FeatureLineExpression,e)}featureFileExpression(e){return new La.ASTFeatureFileExpression(e)}chunkAdvanced(e){return new ZP.ASTChunkAdvanced(e)}};It.ASTProvider=dy;var eM=Gl();Object.defineProperty(It,"ASTType",{enumerable:!0,get:function(){return eM.ASTType}});var tM=ry();Object.defineProperty(It,"ASTChunkAdvanced",{enumerable:!0,get:function(){return tM.ASTChunkAdvanced}});var Na=cy();Object.defineProperty(It,"ASTFeatureEnvarExpression",{enumerable:!0,get:function(){return Na.ASTFeatureEnvarExpression}});Object.defineProperty(It,"ASTFeatureFileExpression",{enumerable:!0,get:function(){return Na.ASTFeatureFileExpression}});Object.defineProperty(It,"ASTFeatureImportExpression",{enumerable:!0,get:function(){return Na.ASTFeatureImportExpression}});Object.defineProperty(It,"ASTFeatureIncludeExpression",{enumerable:!0,get:function(){return Na.ASTFeatureIncludeExpression}});Object.defineProperty(It,"ASTFeatureInjectExpression",{enumerable:!0,get:function(){return Na.ASTFeatureInjectExpression}})});var py=m(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.SelectorGroups=lt.SelectorGroupType=lt.Selectors=lt.SelectorTypes=void 0;var Ne=je(),zl=oo(),qa=ao(),nM;(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"})(nM=lt.SelectorTypes||(lt.SelectorTypes={}));lt.Selectors=Object.assign(Object.assign({},Ne.Selectors),{From:(0,Ne.createSelector)({type:Ne.TokenType.Identifier,value:"from"}),Envar:(0,Ne.createSelector)({type:Ne.TokenType.Keyword,value:zl.GreybelKeyword.Envar}),Inject:(0,Ne.createSelector)({type:Ne.TokenType.Keyword,value:zl.GreybelKeyword.Inject}),Line:(0,Ne.createSelector)({type:Ne.TokenType.Keyword,value:zl.GreybelKeyword.Line}),File:(0,Ne.createSelector)({type:Ne.TokenType.Keyword,value:zl.GreybelKeyword.File}),LeftShift:(0,Ne.createSelector)({type:Ne.TokenType.Punctuator,value:qa.Operator.LeftShift}),RightShift:(0,Ne.createSelector)({type:Ne.TokenType.Punctuator,value:qa.Operator.RightShift}),UnsignedRightShift:(0,Ne.createSelector)({type:Ne.TokenType.Punctuator,value:qa.Operator.UnsignedRightShift}),BitwiseOr:(0,Ne.createSelector)({type:Ne.TokenType.Punctuator,value:qa.Operator.BitwiseOr}),BitwiseAnd:(0,Ne.createSelector)({type:Ne.TokenType.Punctuator,value:qa.Operator.BitwiseAnd}),Escape:(0,Ne.createSelector)({type:Ne.TokenType.Punctuator,value:Ne.Operator.Escape})});var jr;(function(t){t.MapSeparator="MapSeparator",t.ListSeparator="ListSeparator",t.PathSegmentEnd="PathSegmentEnd",t.BitwiseOperators="BitwiseOperators"})(jr=lt.SelectorGroupType||(lt.SelectorGroupType={}));lt.SelectorGroups=Object.assign(Object.assign({},Ne.SelectorGroups),{[jr.MapSeparator]:(0,Ne.createSelectorGroup)(jr.MapSeparator,[lt.Selectors.MapSeperator,lt.Selectors.CRBracket]),[jr.ListSeparator]:(0,Ne.createSelectorGroup)(jr.ListSeparator,[lt.Selectors.MapSeperator,lt.Selectors.SRBracket]),[jr.PathSegmentEnd]:(0,Ne.createSelectorGroup)(jr.PathSegmentEnd,[lt.Selectors.EndOfLine,lt.Selectors.Comment,lt.Selectors.EndOfFile]),[jr.BitwiseOperators]:(0,Ne.createSelectorGroup)(jr.BitwiseOperators,[lt.Selectors.LeftShift,lt.Selectors.RightShift,lt.Selectors.UnsignedRightShift])})});var AA=m(ja=>{"use strict";var rM=ja&&ja.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ja,"__esModule",{value:!0});var dn=je(),iM=zo(),wA=Zo(),sM=rM(ty()),oM=fy(),ns=oo(),EA=ao(),Ie=py(),hy=class extends dn.Parser{constructor(e,n={}){var r;n.lexer=n.lexer||new sM.default(e,{unsafe:n.unsafe,tabWidth:n.tabWidth}),n.astProvider=n.astProvider||new oM.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(){let e=this,n=0;for(;;){if(Ie.Selectors.Comment(e.token)){let r=e.astProvider.comment({value:e.token.value,isMultiline:e.token.value.indexOf(`
108
+ `)!==-1,start:e.token.start,end:e.token.end,scope:e.currentScope});e.addItemToLines(r),e.backpatches.peek().body.push(r)}else if(Ie.Selectors.EndOfLine(e.token))n++;else break;e.next()}return n}parseMap(e=!1,n=!1){let r=this;if(!Ie.Selectors.CLBracket(r.token))return r.parseList(e,n);let i=r.currentScope,s=r.token.start,o=[],a=r.astProvider.mapConstructorExpression({fields:o,start:s,end:null,scope:i});if(r.next(),Ie.Selectors.CRBracket(r.token))r.next();else for(;!Ie.Selectors.EndOfFile(r.token);){if(r.skipNewlines(),Ie.Selectors.CRBracket(r.token)){r.next();break}let u=r.astProvider.mapKeyString({key:null,value:null,start:r.token.start,end:null,scope:i});if(u.key=r.parseExpr(null),r.requireToken(Ie.Selectors.MapKeyValueSeperator),r.skipNewlines(),r.currentAssignment){let l=r.astProvider.assignmentStatement({variable:r.astProvider.indexExpression({index:u.key,base:r.currentAssignment.variable,start:u.start,end:r.token.end,scope:i}),init:null,start:u.start,end:null}),d=r.currentAssignment;r.currentAssignment=l,u.value=r.parseExpr(u),r.currentAssignment=d,l.init=u.value,l.end=r.previousToken.end,i.assignments.push(l)}else u.value=r.parseExpr(u);u.end=r.previousToken.end,o.push(u),r.skipNewlines();let c=r.requireTokenOfAny(Ie.SelectorGroups.MapSeparator,s);if(Ie.Selectors.CRBracket(c))break}return a.end=r.token.start,a}parseList(e=!1,n=!1){let r=this;if(!Ie.Selectors.SLBracket(r.token))return r.parseQuantity(e,n);let i=r.currentScope,s=r.token.start,o=[],a=r.astProvider.listConstructorExpression({fields:o,start:s,end:null,scope:i});if(r.next(),Ie.Selectors.SRBracket(r.token))r.next();else for(;!Ie.Selectors.EndOfFile(r.token);){if(r.skipNewlines(),Ie.Selectors.SRBracket(r.token)){r.next();break}let u=r.astProvider.listValue({value:null,start:r.token.start,end:null,scope:i});if(r.currentAssignment){let l=r.astProvider.assignmentStatement({variable:r.astProvider.indexExpression({index:r.astProvider.literal(dn.TokenType.NumericLiteral,{value:o.length,raw:`${o.length}`,start:s,end:r.token.end,scope:i}),base:r.currentAssignment.variable,start:null,end:null,scope:i}),init:null,start:null,end:null}),d=r.currentAssignment,p=r.token;r.currentAssignment=d,u.value=r.parseExpr(u),r.currentAssignment=d,l.variable.start=p.start,l.variable.end=r.previousToken.end,l.init=u.value,l.start=u.start,l.end=r.previousToken.end,i.assignments.push(l)}else u.value=r.parseExpr(u);u.end=r.previousToken.end,o.push(u),r.skipNewlines();let c=r.requireTokenOfAny(Ie.SelectorGroups.ListSeparator,s);if(Ie.Selectors.SRBracket(c))break}return a.end=r.token.start,a}parsePathSegment(){let e=this;if(this.token.type===dn.ASTType.StringLiteral){let r=this.token.value;return this.next(),r}let n="";for(;!Ie.SelectorGroups.PathSegmentEnd(e.token);)n=n+e.token.value,e.next();return e.consumeMany(Ie.SelectorGroups.PathSegmentEnd),n}parseFeatureIncludeStatement(){let e=this,n=e.previousToken.start,r=e.parsePathSegment(),i=e.astProvider.featureIncludeExpression({path:r,start:n,end:e.previousToken.end,scope:e.currentScope});return e.includes.push(i),i}parseFeatureImportStatement(){var e;let n=this,r=n.previousToken.start,i=n.parseIdentifier();if(!n.consume(Ie.Selectors.From))return n.raise("expected from keyword",new wA.Range(r,new iM.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,end:n.previousToken.end,scope:n.currentScope});n.imports.push(o);let a=n.astProvider.assignmentStatement({variable:i,init:n.astProvider.literal(dn.TokenType.NilLiteral,{value:null,raw:"null",start:i.start,end:i.end,scope:n.currentScope}),start:i.start,end:i.end,scope:n.currentScope});return n.currentScope.assignments.push(a),o}parseFeatureEnvarExpression(){let e=this,n=e.previousToken.start,r=e.token.value;return e.next(),e.astProvider.featureEnvarExpression({name:r,start:n,end:e.previousToken.end,scope:e.currentScope})}parseFeatureInjectExpression(){let e=this,n=e.previousToken.start,r=this.parsePathSegment();e.next();let i=e.astProvider.featureInjectExpression({path:r,start:n,end:e.previousToken.end,scope:e.currentScope});return e.injects.push(i),i}parseIsa(e=!1,n=!1){let r=this,i=r.token.start,s=r.parseBitwiseOr(e,n);if(Ie.Selectors.Isa(r.token)){r.next(),r.skipNewlines();let o=r.parseBitwiseOr();return r.astProvider.isaExpression({operator:dn.Operator.Isa,left:s,right:o,start:i,end:r.previousToken.end,scope:r.currentScope})}return s}parseBitwiseOr(e=!1,n=!1){let r=this,i=r.token.start,o=r.parseBitwiseAnd(e,n);for(;Ie.Selectors.BitwiseOr(r.token);){r.next();let a=r.parseBitwiseAnd();o=r.astProvider.binaryExpression({operator:EA.Operator.BitwiseOr,left:o,right:a,start:i,end:r.previousToken.end,scope:r.currentScope})}return o}parseBitwiseAnd(e=!1,n=!1){let r=this,i=r.token.start,o=r.parseComparisons(e,n);for(;Ie.Selectors.BitwiseAnd(r.token);){r.next();let a=r.parseComparisons();o=r.astProvider.binaryExpression({operator:EA.Operator.BitwiseAnd,left:o,right:a,start:i,end:r.previousToken.end,scope:r.currentScope})}return o}parseAddSub(e=!1,n=!1){let r=this,i=r.token.start,o=r.parseBitwise(e,n);for(;Ie.Selectors.Plus(r.token)||Ie.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,end:r.previousToken.end,scope:r.currentScope})}return o}parseBitwise(e=!1,n=!1){let r=this,i=r.token.start,o=r.parseMultDiv(e,n);for(;Ie.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,end:r.previousToken.end,scope:r.currentScope})}return o}parseAtom(){let e=this;return Ie.Selectors.Envar(e.token)?(e.next(),e.parseFeatureEnvarExpression()):Ie.Selectors.Inject(e.token)?(e.next(),e.parseFeatureInjectExpression()):Ie.Selectors.Line(e.token)?(e.next(),e.astProvider.featureLineExpression({start:new dn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new dn.ASTPosition(e.previousToken.line,e.previousToken.end.character),scope:e.currentScope})):Ie.Selectors.File(e.token)?(e.next(),e.astProvider.featureFileExpression({filename:e.filename,start:new dn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new dn.ASTPosition(e.previousToken.line,e.previousToken.end.character),scope:e.currentScope})):super.parseAtom()}parseStatement(){let e=this,n=e.backpatches.peek();if(e.isType(dn.TokenType.Keyword))switch(e.token.value){case ns.GreybelKeyword.Include:case ns.GreybelKeyword.IncludeWithComment:{e.next();let i=e.parseFeatureIncludeStatement();e.addItemToLines(i),n.body.push(i);return}case ns.GreybelKeyword.Import:case ns.GreybelKeyword.ImportWithComment:{e.next();let i=e.parseFeatureImportStatement();e.addItemToLines(i),n.body.push(i);return}case ns.GreybelKeyword.Envar:{e.next();let i=e.parseFeatureEnvarExpression();e.addItemToLines(i),n.body.push(i);return}case ns.GreybelKeyword.Inject:{e.next();let i=e.parseFeatureInjectExpression();e.addItemToLines(i),n.body.push(i);return}case ns.GreybelKeyword.Debugger:{e.next();let i=e.astProvider.featureDebuggerExpression({start:new dn.ASTPosition(e.previousToken.line,e.previousToken.start.character),end:new dn.ASTPosition(e.previousToken.line,e.previousToken.end.character),scope:e.currentScope});e.addItemToLines(i),n.body.push(i);return}default:break}super.parseStatement()}parseChunk(){let e=this;e.next();let n=e.token.start,r=e.astProvider.chunkAdvanced({start:n,end:null}),i=new dn.PendingChunk(r);for(e.backpatches.setDefault(i),e.pushScope(r);!Ie.Selectors.EndOfFile(e.token)&&(e.skipNewlines(),!Ie.Selectors.EndOfFile(e.token));)e.lexer.recordSnapshot(),e.statementErrors=[],e.parseStatement(),e.statementErrors.length>0&&e.tryToRecover();let s=e.backpatches.pop();for(;!(0,dn.isPendingChunk)(s);){let o=e.raise(`found open block ${s.block.type}`,new wA.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.lines,r.imports=e.imports,r.includes=e.includes,r.injects=e.injects,r}};ja.default=hy});var Fr=m(xt=>{"use strict";var aM=xt&&xt.__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]}),Fa=xt&&xt.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&aM(e,t,n)},my=xt&&xt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xt,"__esModule",{value:!0});xt.Parser=xt.LexerValidator=xt.Lexer=void 0;var uM=ty();Object.defineProperty(xt,"Lexer",{enumerable:!0,get:function(){return my(uM).default}});var cM=Qg();Object.defineProperty(xt,"LexerValidator",{enumerable:!0,get:function(){return my(cM).default}});var lM=AA();Object.defineProperty(xt,"Parser",{enumerable:!0,get:function(){return my(lM).default}});Fa(fy(),xt);Fa(Zg(),xt);Fa(oo(),xt);Fa(ao(),xt);Fa(py(),xt)});var yy=m(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});Xl.Aggregator=void 0;var Kl=Fr(),Re=$n(),Fe=je(),dM=Bg(),Te=Qi(),rs=Ug(),xA=Dm(),fM=Lg(),kA=Ng(),CA=aa(),pM=so(),gy=class{get definitions(){return this._definitions}get parent(){return this._parent}constructor(e){this._root=e.root,this._scope=e.scope,this._document=e.document,this._parent=e.parent??null,this._definitions=new Map}factory(e){return new pM.Entity({kind:e,container:this._document.container})}createFunctionDescription(e,n=dM.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION){let r=this._document.getLastASTItemOfLine(e.start.line-1),i=this._document.findASTItemInLine(e.start.line,Fe.ASTType.Comment);if(r instanceof Fe.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 Fe.ASTComment)s.add(u),o.unshift(u.value);else break}return o.join(`
109
109
 
110
- `)}else if(i instanceof Fe.ASTComment)return i.value;return n}resolveFunctionStatement(e){let n=Re.SignatureDefinitionFunction.parse({type:Re.SignatureDefinitionBaseType.Function,description:this.createFunctionDescription(e),arguments:e.parameters.map(r=>{if(r.type===Fe.ASTType.Identifier)return{label:r.name??"unknown",type:Re.SignatureDefinitionBaseType.Any};let i=r;return{label:i.variable?.name??"unknown",types:Array.from(this.resolveTypeWithDefault(i.init).types)}}),returns:["any"]});return this.factory(Te.CompletionItemKind.Function).addType(Re.SignatureDefinitionBaseType.Function).addSignatureType((0,fM.enrichWithMetaInformation)(n)).setLine(e.start.line)}resolveParenthesisExpression(e){return this.resolveTypeWithDefault(e.expression)}resolveBinaryExpression(e){let n=this.factory(Te.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(Te.CompletionItemKind.Expression).setLabel("Logical Expr").addType(Re.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveComparisonGroupExpression(e){return this.factory(Te.CompletionItemKind.Expression).setLabel("Comparison Group Expr").addType(Re.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveIsaExpression(e){return this.factory(Te.CompletionItemKind.Expression).setLabel("Isa Expr").addType(Re.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveCallStatement(e){let n=this.resolveNamespace(e);return n===null?this.factory(Te.CompletionItemKind.Variable).addType(Re.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveCallExpression(e){let n=this.resolveNamespace(e);return n===null?this.factory(Te.CompletionItemKind.Variable).addType(Re.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveUnaryExpression(e){let n=this.resolveNamespace(e);return n===null?this.factory(Te.CompletionItemKind.Variable).addType(Re.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveMapConstructorExpression(e){let n=this.factory(Te.CompletionItemKind.MapConstructor).addType(Re.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===Fe.ASTType.StringLiteral)n.setProperty(i.key.value.toString(),s);else{let o=this.resolveTypeWithDefault(i.key).setLine(i.start.line);n.setProperty(o,s)}}return n.setLabel("{}").setLine(e.start.line)}resolveListConstructorExpression(e){let n=this.factory(Te.CompletionItemKind.ListConstructor).addType(Re.SignatureDefinitionBaseType.List);for(let r=0;r<e.fields.length;r++){let i=e.fields[r],s=this.factory(Te.CompletionItemKind.Variable).addType(Re.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).setLine(e.start.line);return n===null?this.factory(Te.CompletionItemKind.Variable).addType(Re.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveIndexExpression(e,n=!1){let r=this.resolveNamespace(e,n);return r===null?this.factory(Te.CompletionItemKind.Variable).addType(Re.SignatureDefinitionBaseType.Any).setLine(e.start.line):r}resolveMemberExpression(e,n=!1){let r=this.resolveNamespace(e,n);return r===null?this.factory(Te.CompletionItemKind.Property).addType(Re.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(Te.CompletionItemKind.Property).addType(Re.SignatureDefinitionBaseType.Any).setLabel(e.name).setLine(e.start.line):r}resolveType(e,n=!1){if(e==null)return null;switch(e.type){case Fe.ASTType.ParenthesisExpression:return this.resolveParenthesisExpression(e);case Fe.ASTType.CallStatement:return this.resolveCallStatement(e);case Fe.ASTType.CallExpression:return this.resolveCallExpression(e);case Fe.ASTType.BinaryExpression:return this.resolveBinaryExpression(e);case Fe.ASTType.LogicalExpression:return this.resolveLogicalExpression(e);case Fe.ASTType.IsaExpression:return this.resolveIsaExpression(e);case Fe.ASTType.ComparisonGroupExpression:return this.resolveComparisonGroupExpression(e);case Fe.ASTType.FunctionDeclaration:return this.resolveFunctionStatement(e);case Fe.ASTType.SliceExpression:return this.resolveSliceExpression(e);case Fe.ASTType.IndexExpression:return this.resolveIndexExpression(e,n);case Fe.ASTType.MemberExpression:return this.resolveMemberExpression(e,n);case Fe.ASTType.Identifier:return this.resolveIdentifier(e,n);case Fe.ASTType.MapConstructorExpression:return this.resolveMapConstructorExpression(e);case Fe.ASTType.ListConstructorExpression:return this.resolveListConstructorExpression(e);case Fe.ASTType.NegationExpression:case Fe.ASTType.BinaryNegatedExpression:case Fe.ASTType.UnaryExpression:return this.resolveUnaryExpression(e);case Fe.ASTType.NilLiteral:return this.factory(Te.CompletionItemKind.Literal).addType("null").setLabel("null").setLine(e.start.line);case Fe.ASTType.StringLiteral:{let r=e.value.toString();return this.factory(Te.CompletionItemKind.Literal).addType(Re.SignatureDefinitionBaseType.String).setLabel(`"${r.length>20?r.substr(0,20)+"...":r}"`).setLine(e.start.line)}case Fe.ASTType.NumericLiteral:case Fe.ASTType.BooleanLiteral:{let r=e.value.toString();return this.factory(Te.CompletionItemKind.Literal).addType(Re.SignatureDefinitionBaseType.Number).setLabel(r).setLine(e.start.line)}case Kl.ASTType.FeatureFileExpression:return this.factory(Te.CompletionItemKind.Expression).addType(Re.SignatureDefinitionBaseType.String).setLabel("File Expr").setLine(e.start.line);case Kl.ASTType.FeatureLineExpression:return this.factory(Te.CompletionItemKind.Expression).addType(Re.SignatureDefinitionBaseType.Number).setLabel("Line Expr").setLine(e.start.line);case Kl.ASTType.FeatureEnvarExpression:return this.factory(Te.CompletionItemKind.Expression).addType(Re.SignatureDefinitionBaseType.String).setLabel("Envar Expr").setLine(e.start.line);case Kl.ASTType.FeatureInjectExpression:return this.factory(Te.CompletionItemKind.Expression).addType(Re.SignatureDefinitionBaseType.String).setLabel("Inject Expr").setLine(e.start.line);default:return null}}resolveTypeWithDefault(e,n=!1){return this.resolveType(e,n)??this.factory(Te.CompletionItemKind.Variable).addType(Re.SignatureDefinitionBaseType.Any).setLine(e.start.line)}resolveChain(e,n=!1){if(e.length===0)return null;let r=null,i=e[0],s=i.unary?.operator==="@"&&!i.isInCallExpression||n&&e.length===1;if((0,rs.isResolveChainItemWithIdentifier)(i))if(i.getter.name==="globals")r=this._scope.globals;else if(i.getter.name==="outer")r=this._scope.outer;else if(i.getter.name==="locals")r=this._scope.locals;else if(i.getter.name==="super"){let a=this._document.getScopeContext(i.ref.scope)?.scope.context?.values.get("i:__isa");a==null?r=this.factory(Te.CompletionItemKind.Constant).addType("null").setLabel("super"):r=a.copy({kind:Te.CompletionItemKind.Constant,label:"super",values:a.values})}else if(i.getter.name==="self"){let a=this._document.getScopeContext(i.ref.scope)?.scope.context;a==null?r=this.factory(Te.CompletionItemKind.Constant).addType("null").setLabel("self"):r=a.copy({kind:Te.CompletionItemKind.Constant,label:"self",values:a.values})}else r=this._scope.resolveNamespace(i.getter.name,s)??this.factory(Te.CompletionItemKind.Variable).addType(Re.SignatureDefinitionBaseType.Any).setLabel(i.getter.name);else if((0,rs.isResolveChainItemWithValue)(i))r=this.resolveTypeWithDefault(i.value,s);else return null;if(i.unary?.operator==="new"&&r!==null){let a=this.factory(Te.CompletionItemKind.Variable).addType(Re.SignatureDefinitionBaseType.Map).setLabel(r.label);a.setProperty("__isa",r),r=a}let o=e.length;for(let a=1;a<o&&r!==null;a++){let u=e[a],c=u.unary?.operator==="@"&&!u.isInCallExpression||n&&e.length-1===a;if((0,rs.isResolveChainItemWithMember)(u))r=r.resolveProperty(u.getter.name,c)??this.factory(Te.CompletionItemKind.Variable).addType(Re.SignatureDefinitionBaseType.Any).setLabel(u.getter.name);else if((0,rs.isResolveChainItemWithIndex)(u))if((0,CA.isValidIdentifierLiteral)(u.getter)){let l=u.getter.value.toString();r=r.resolveProperty(l,u.isInCallExpression)??this.factory(Te.CompletionItemKind.Variable).addType(Re.SignatureDefinitionBaseType.Any).setLabel(l)}else{let l=this.resolveTypeWithDefault(u.getter);r=r.resolveProperty(l,u.isInCallExpression)??this.factory(Te.CompletionItemKind.Variable).addType(Re.SignatureDefinitionBaseType.Any)}else if(u.ref.type===Fe.ASTType.SliceExpression)r=r.copy();else return null;if(u.unary?.operator==="new"&&r!==null){let l=this.factory(Te.CompletionItemKind.Property).addType(Re.SignatureDefinitionBaseType.Map).setLabel(r.label);l.setProperty("__isa",r),r=l}}return r}resolveNamespace(e,n=!1){let r=(0,kA.createResolveChain)(e);return this.resolveChain(r,n)}defineNamespace(e,n){let r=(0,kA.createResolveChain)(e),i=r.pop();if(r.length>0){let o=this.resolveChain(r);if(o===null)return!1;if((0,rs.isResolveChainItemWithMember)(i))return o.setProperty(i.getter.name,n);if((0,rs.isResolveChainItemWithIndex)(i)){if((0,CA.isValidIdentifierLiteral)(i.getter))return o.setProperty(i.getter.value.toString(),n);{let a=this.resolveTypeWithDefault(i.getter);return o.setProperty(a,n)}}return!1}let s=this._scope;return(0,rs.isResolveChainItemWithIdentifier)(i)?s.setProperty(i.getter.name,n):!1}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);n.push(...a)}}return n}resolveAvailableAssignments(e){let n=(0,xA.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._definitions.get(n);a!=null&&i.push(...a)}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().setLine(n.start.line)??this.factory(Te.CompletionItemKind.Variable).addType(Re.SignatureDefinitionBaseType.Any).setLine(n.start.line);this.defineNamespace(n.variable,r);let i=(0,xA.createExpressionId)(n.variable),s=this._definitions;i.startsWith("globals.")?(s=this._document.getRootScopeContext().aggregator.definitions,i=i.slice(8)):i.startsWith("locals.")?(s=this._definitions,i=i.slice(7)):i.startsWith("outer.")&&(s=this.parent.definitions,i=i.slice(6));let o=s.get(i);o?o.push(n):s.set(i,[n])}}};Xl.Aggregator=yy});var vy=m(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});Yl.Document=void 0;var $r=$n(),hM=je(),OA=Qi(),RA=by(),DA=so(),IA=Yg(),_y=class t{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._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($r.SignatureDefinitionBaseType.Map),funcRef:this._container.primitives.get($r.SignatureDefinitionBaseType.Function),number:this._container.primitives.get($r.SignatureDefinitionBaseType.Number),string:this._container.primitives.get($r.SignatureDefinitionBaseType.String),list:this._container.primitives.get($r.SignatureDefinitionBaseType.List)}}initApi(){let e=this._container.primitives.get($r.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 DA.Entity({kind:OA.CompletionItemKind.Constant,container:this._container,label:"globals"}).addType($r.SignatureDefinitionBaseType.Map)}analyzeScope(e){let n=this._scopeMapping.get(e.scope),r=new IA.Scope({container:this._container,parent:n?.scope,globals:this._globals}),i=new RA.Aggregator({scope:r,root:e,document:this,parent:n?.aggregator});this._scopeMapping.set(e,{scope:r,aggregator:i});let s=e.assignment instanceof hM.ASTAssignmentStatement?this.resolveNamespace(e.assignment.variable,!0):null;if(s!==null){let o=s?.context;o!=null&&o.types.has($r.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),d=c.getTypes().map(p=>p.type);l===null?r.setProperty(c.getLabel(),new DA.Entity({kind:OA.CompletionItemKind.Variable,container:this._container}).addType(...d)):(l.types.delete($r.SignatureDefinitionBaseType.Any),l.addType(...d))}}}}analyze(){let e=new IA.Scope({container:this._container,globals:this._globals,locals:this._globals}),n=new RA.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);n.push(...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({root:this._root,container:this._container.copy()});for(let r of e)n._globals.extend(r._globals.copy({line:-1})),n._intrinscis.map.extend(r._intrinscis.map.copy({line:-1})),n._intrinscis.funcRef.extend(r._intrinscis.funcRef.copy({line:-1})),n._intrinscis.number.extend(r._intrinscis.number.copy({line:-1})),n._intrinscis.string.extend(r._intrinscis.string.copy({line:-1})),n._intrinscis.list.extend(r._intrinscis.list.copy({line:-1}));return n.analyze(),n}};Yl.Document=_y});var wy=m(Jl=>{"use strict";Object.defineProperty(Jl,"__esModule",{value:!0});Jl.ContainerProxy=void 0;var Tr=$n(),Si=so(),PA=Qi(),MA=ka(),Sy=Fl(),Ty=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()}createPrimitives(){let e=new Map;for(let[n,r]of this._container.getPrimitives()){let i=new Si.Entity({kind:PA.CompletionItemKind.Constant,container:this,isAPI:n===Tr.SignatureDefinitionBaseType.General}).addType(Tr.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 Si.Entity({kind:PA.CompletionItemKind.Constant,container:this}).addType(Tr.SignatureDefinitionBaseType.Map).insertSignature(r);e.set(n,i)}return e}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(Tr.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,Sy.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,Sy.lookupProperty)(this._primitives.get(Tr.SignatureDefinitionBaseType.Any),n);if(e.includes(Tr.SignatureDefinitionBaseType.Any)&&i)return(0,Si.resolveEntity)(this,i,r);let s=this.searchDefinitionMatches(e,n);return s.size===0?null:s.size===1?(0,Si.resolveEntity)(this,s.values().next().value,r):s.has(Tr.SignatureDefinitionBaseType.Any)?(0,Si.resolveEntity)(this,s.get(Tr.SignatureDefinitionBaseType.Any),r):i!==null?(0,Si.resolveEntity)(this,i,r):(0,Si.resolveEntity)(this,s.values().next().value,r)}getGeneralDefinition(e,n=!1){let r=(0,Sy.lookupProperty)(this._primitives.get(Tr.SignatureDefinitionBaseType.General),e);return r==null?null:(0,Si.resolveEntity)(this,r,n)}getAllIdentifier(e){let n=new Map;if(e===Tr.SignatureDefinitionBaseType.Any){for(let i of this._container.getAllVisibleTypes()){let s=this.getTypeSignature(i);s!=null&&(0,MA.injectIdentifers)(n,s)}return n}let r=this.getTypeSignature(e);return r!=null&&(0,MA.injectIdentifers)(n,r),n}copy(){return new t({container:this._container})}};Jl.ContainerProxy=Ty});var LA=m(Ql=>{"use strict";Object.defineProperty(Ql,"__esModule",{value:!0});Ql.TypeManager=void 0;var mM=vy(),gM=wy(),Ey=class{constructor(e){this._container=new gM.ContainerProxy({container:e.container}),this._types=new Map}analyze(e,n){let r=new mM.Document({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}};Ql.TypeManager=Ey});var $a=m(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.TypeManager=ne.ContainerProxy=ne.Document=ne.Aggregator=ne.Scope=ne.Entity=ne.lookupProperty=ne.isEligibleForProperties=ne.injectIdentifers=ne.isSignatureDefinitionFunction=ne.isResolveChainItemWithValue=ne.isResolveChainItemWithMember=ne.isResolveChainItemWithIndex=ne.isResolveChainItemWithIdentifier=ne.CompletionItemKind=ne.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION=ne.ObjectSetIterator=ne.ObjectSet=ne.rotateBits=ne.getStringHashCode=ne.getHashCode=ne.createResolveChain=ne.enrichWithMetaInformation=ne.createExpressionId=ne.createExpressionHash=ne.isValidIdentifierLiteral=void 0;var yM=aa();Object.defineProperty(ne,"isValidIdentifierLiteral",{enumerable:!0,get:function(){return yM.isValidIdentifierLiteral}});var bM=Fw();Object.defineProperty(ne,"createExpressionHash",{enumerable:!0,get:function(){return bM.createExpressionHash}});var _M=Im();Object.defineProperty(ne,"createExpressionId",{enumerable:!0,get:function(){return _M.createExpressionId}});var vM=Ng();Object.defineProperty(ne,"enrichWithMetaInformation",{enumerable:!0,get:function(){return vM.enrichWithMetaInformation}});var SM=qg();Object.defineProperty(ne,"createResolveChain",{enumerable:!0,get:function(){return SM.createResolveChain}});var Ay=Dm();Object.defineProperty(ne,"getHashCode",{enumerable:!0,get:function(){return Ay.getHashCode}});Object.defineProperty(ne,"getStringHashCode",{enumerable:!0,get:function(){return Ay.getStringHashCode}});Object.defineProperty(ne,"rotateBits",{enumerable:!0,get:function(){return Ay.rotateBits}});var NA=Bg();Object.defineProperty(ne,"ObjectSet",{enumerable:!0,get:function(){return NA.ObjectSet}});Object.defineProperty(ne,"ObjectSetIterator",{enumerable:!0,get:function(){return NA.ObjectSetIterator}});var TM=Ug();Object.defineProperty(ne,"DEFAULT_CUSTOM_FUNCTION_DESCRIPTION",{enumerable:!0,get:function(){return TM.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION}});var wM=Qi();Object.defineProperty(ne,"CompletionItemKind",{enumerable:!0,get:function(){return wM.CompletionItemKind}});var Zl=Hg();Object.defineProperty(ne,"isResolveChainItemWithIdentifier",{enumerable:!0,get:function(){return Zl.isResolveChainItemWithIdentifier}});Object.defineProperty(ne,"isResolveChainItemWithIndex",{enumerable:!0,get:function(){return Zl.isResolveChainItemWithIndex}});Object.defineProperty(ne,"isResolveChainItemWithMember",{enumerable:!0,get:function(){return Zl.isResolveChainItemWithMember}});Object.defineProperty(ne,"isResolveChainItemWithValue",{enumerable:!0,get:function(){return Zl.isResolveChainItemWithValue}});var EM=Wg();Object.defineProperty(ne,"isSignatureDefinitionFunction",{enumerable:!0,get:function(){return EM.isSignatureDefinitionFunction}});var AM=ka();Object.defineProperty(ne,"injectIdentifers",{enumerable:!0,get:function(){return AM.injectIdentifers}});var xM=ql();Object.defineProperty(ne,"isEligibleForProperties",{enumerable:!0,get:function(){return xM.isEligibleForProperties}});var kM=Fl();Object.defineProperty(ne,"lookupProperty",{enumerable:!0,get:function(){return kM.lookupProperty}});var CM=so();Object.defineProperty(ne,"Entity",{enumerable:!0,get:function(){return CM.Entity}});var OM=Yg();Object.defineProperty(ne,"Scope",{enumerable:!0,get:function(){return OM.Scope}});var RM=by();Object.defineProperty(ne,"Aggregator",{enumerable:!0,get:function(){return RM.Aggregator}});var DM=vy();Object.defineProperty(ne,"Document",{enumerable:!0,get:function(){return DM.Document}});var IM=wy();Object.defineProperty(ne,"ContainerProxy",{enumerable:!0,get:function(){return IM.ContainerProxy}});var PM=LA();Object.defineProperty(ne,"TypeManager",{enumerable:!0,get:function(){return PM.TypeManager}})});var xy=m(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.getSymbolItemKind=uo.getCompletionItemKind=void 0;var Vt=$a(),MM=t=>{switch(t){case Vt.CompletionItemKind.Constant:return 21;case Vt.CompletionItemKind.Variable:return 6;case Vt.CompletionItemKind.Expression:return 6;case Vt.CompletionItemKind.Function:return 3;case Vt.CompletionItemKind.ListConstructor:case Vt.CompletionItemKind.MapConstructor:case Vt.CompletionItemKind.Literal:case Vt.CompletionItemKind.Unknown:return 12}};uo.getCompletionItemKind=MM;var LM=t=>{switch(t){case Vt.CompletionItemKind.Constant:return 14;case Vt.CompletionItemKind.Variable:return 13;case Vt.CompletionItemKind.Expression:return 13;case Vt.CompletionItemKind.Function:return 12;case Vt.CompletionItemKind.ListConstructor:return 18;case Vt.CompletionItemKind.MapConstructor:return 19;case Vt.CompletionItemKind.Literal:case Vt.CompletionItemKind.Unknown:return 13}};uo.getSymbolItemKind=LM});var Cy=m(ed=>{"use strict";Object.defineProperty(ed,"__esModule",{value:!0});ed.findEx=void 0;var NM=je(),qM=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:()=>{}}},ky=class{constructor(e){this.map=qM(this.visit.bind(this)),this.callback=e,this.state={exit:!1}}visit(e,n=0){let r=this;if(e==null)return;if(e.type==null)throw console.error("Error ast type:",e),new Error("Unexpected as type");if(r.state=r.callback(e,n),r.state.exit||r.state.skip)return;let i=r.map[e.type];i?.call(r,e,n+1)}};function jM(t,e){let n=[];return new ky((i,s)=>{let o=t(i,s)||{};return o.valid&&i.type!==NM.ASTType.InvalidCodeExpression&&n.push(i),{exit:!!o.exit,skip:!!o.skip}}).visit(e),n}ed.findEx=jM});var qA=m((m5,FM)=>{FM.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 jA=m((g5,$M)=>{$M.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:
110
+ `)}else if(i instanceof Fe.ASTComment)return i.value;return n}resolveFunctionStatement(e){let n=Re.SignatureDefinitionFunction.parse({type:Re.SignatureDefinitionBaseType.Function,description:this.createFunctionDescription(e),arguments:e.parameters.map(r=>{if(r.type===Fe.ASTType.Identifier)return{label:r.name??"unknown",type:Re.SignatureDefinitionBaseType.Any};let i=r;return{label:i.variable?.name??"unknown",types:Array.from(this.resolveTypeWithDefault(i.init).types)}}),returns:["any"]});return this.factory(Te.CompletionItemKind.Function).addType(Re.SignatureDefinitionBaseType.Function).addSignatureType((0,fM.enrichWithMetaInformation)(n)).setLine(e.start.line)}resolveParenthesisExpression(e){return this.resolveTypeWithDefault(e.expression)}resolveBinaryExpression(e){let n=this.factory(Te.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(Te.CompletionItemKind.Expression).setLabel("Logical Expr").addType(Re.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveComparisonGroupExpression(e){return this.factory(Te.CompletionItemKind.Expression).setLabel("Comparison Group Expr").addType(Re.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveIsaExpression(e){return this.factory(Te.CompletionItemKind.Expression).setLabel("Isa Expr").addType(Re.SignatureDefinitionBaseType.Number).setLine(e.start.line)}resolveCallStatement(e){let n=this.resolveNamespace(e);return n===null?this.factory(Te.CompletionItemKind.Variable).addType(Re.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveCallExpression(e){let n=this.resolveNamespace(e);return n===null?this.factory(Te.CompletionItemKind.Variable).addType(Re.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveUnaryExpression(e){let n=this.resolveNamespace(e);return n===null?this.factory(Te.CompletionItemKind.Variable).addType(Re.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveMapConstructorExpression(e){let n=this.factory(Te.CompletionItemKind.MapConstructor).addType(Re.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===Fe.ASTType.StringLiteral)n.setProperty(i.key.value.toString(),s);else{let o=this.resolveTypeWithDefault(i.key).setLine(i.start.line);n.setProperty(o,s)}}return n.setLabel("{}").setLine(e.start.line)}resolveListConstructorExpression(e){let n=this.factory(Te.CompletionItemKind.ListConstructor).addType(Re.SignatureDefinitionBaseType.List);for(let r=0;r<e.fields.length;r++){let i=e.fields[r],s=this.factory(Te.CompletionItemKind.Variable).addType(Re.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).setLine(e.start.line);return n===null?this.factory(Te.CompletionItemKind.Variable).addType(Re.SignatureDefinitionBaseType.Any).setLine(e.start.line):n}resolveIndexExpression(e,n=!1){let r=this.resolveNamespace(e,n);return r===null?this.factory(Te.CompletionItemKind.Variable).addType(Re.SignatureDefinitionBaseType.Any).setLine(e.start.line):r}resolveMemberExpression(e,n=!1){let r=this.resolveNamespace(e,n);return r===null?this.factory(Te.CompletionItemKind.Property).addType(Re.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(Te.CompletionItemKind.Property).addType(Re.SignatureDefinitionBaseType.Any).setLabel(e.name).setLine(e.start.line):r}resolveType(e,n=!1){if(e==null)return null;switch(e.type){case Fe.ASTType.ParenthesisExpression:return this.resolveParenthesisExpression(e);case Fe.ASTType.CallStatement:return this.resolveCallStatement(e);case Fe.ASTType.CallExpression:return this.resolveCallExpression(e);case Fe.ASTType.BinaryExpression:return this.resolveBinaryExpression(e);case Fe.ASTType.LogicalExpression:return this.resolveLogicalExpression(e);case Fe.ASTType.IsaExpression:return this.resolveIsaExpression(e);case Fe.ASTType.ComparisonGroupExpression:return this.resolveComparisonGroupExpression(e);case Fe.ASTType.FunctionDeclaration:return this.resolveFunctionStatement(e);case Fe.ASTType.SliceExpression:return this.resolveSliceExpression(e);case Fe.ASTType.IndexExpression:return this.resolveIndexExpression(e,n);case Fe.ASTType.MemberExpression:return this.resolveMemberExpression(e,n);case Fe.ASTType.Identifier:return this.resolveIdentifier(e,n);case Fe.ASTType.MapConstructorExpression:return this.resolveMapConstructorExpression(e);case Fe.ASTType.ListConstructorExpression:return this.resolveListConstructorExpression(e);case Fe.ASTType.NegationExpression:case Fe.ASTType.BinaryNegatedExpression:case Fe.ASTType.UnaryExpression:return this.resolveUnaryExpression(e);case Fe.ASTType.NilLiteral:return this.factory(Te.CompletionItemKind.Literal).addType("null").setLabel("null").setLine(e.start.line);case Fe.ASTType.StringLiteral:{let r=e.value.toString();return this.factory(Te.CompletionItemKind.Literal).addType(Re.SignatureDefinitionBaseType.String).setLabel(`"${r.length>20?r.substr(0,20)+"...":r}"`).setLine(e.start.line)}case Fe.ASTType.NumericLiteral:case Fe.ASTType.BooleanLiteral:{let r=e.value.toString();return this.factory(Te.CompletionItemKind.Literal).addType(Re.SignatureDefinitionBaseType.Number).setLabel(r).setLine(e.start.line)}case Kl.ASTType.FeatureFileExpression:return this.factory(Te.CompletionItemKind.Expression).addType(Re.SignatureDefinitionBaseType.String).setLabel("File Expr").setLine(e.start.line);case Kl.ASTType.FeatureLineExpression:return this.factory(Te.CompletionItemKind.Expression).addType(Re.SignatureDefinitionBaseType.Number).setLabel("Line Expr").setLine(e.start.line);case Kl.ASTType.FeatureEnvarExpression:return this.factory(Te.CompletionItemKind.Expression).addType(Re.SignatureDefinitionBaseType.String).setLabel("Envar Expr").setLine(e.start.line);case Kl.ASTType.FeatureInjectExpression:return this.factory(Te.CompletionItemKind.Expression).addType(Re.SignatureDefinitionBaseType.String).setLabel("Inject Expr").setLine(e.start.line);default:return null}}resolveTypeWithDefault(e,n=!1){return this.resolveType(e,n)??this.factory(Te.CompletionItemKind.Variable).addType(Re.SignatureDefinitionBaseType.Any).setLine(e.start.line)}resolveChain(e,n=!1){if(e.length===0)return null;let r=null,i=e[0],s=i.unary?.operator==="@"&&!i.isInCallExpression||n&&e.length===1;if((0,rs.isResolveChainItemWithIdentifier)(i))if(i.getter.name==="globals")r=this._scope.globals;else if(i.getter.name==="outer")r=this._scope.outer;else if(i.getter.name==="locals")r=this._scope.locals;else if(i.getter.name==="super"){let a=this._document.getScopeContext(i.ref.scope)?.scope.context?.values.get("i:__isa");a==null?r=this.factory(Te.CompletionItemKind.Constant).addType("null").setLabel("super"):r=a.copy({kind:Te.CompletionItemKind.Constant,label:"super",values:a.values})}else if(i.getter.name==="self"){let a=this._document.getScopeContext(i.ref.scope)?.scope.context;a==null?r=this.factory(Te.CompletionItemKind.Constant).addType("null").setLabel("self"):r=a.copy({kind:Te.CompletionItemKind.Constant,label:"self",values:a.values})}else r=this._scope.resolveNamespace(i.getter.name,s)??this.factory(Te.CompletionItemKind.Variable).addType(Re.SignatureDefinitionBaseType.Any).setLabel(i.getter.name);else if((0,rs.isResolveChainItemWithValue)(i))r=this.resolveTypeWithDefault(i.value,s);else return null;if(i.unary?.operator==="new"&&r!==null){let a=this.factory(Te.CompletionItemKind.Variable).addType(Re.SignatureDefinitionBaseType.Map).setLabel(r.label);a.setProperty("__isa",r),r=a}let o=e.length;for(let a=1;a<o&&r!==null;a++){let u=e[a],c=u.unary?.operator==="@"&&!u.isInCallExpression||n&&e.length-1===a;if((0,rs.isResolveChainItemWithMember)(u))r=r.resolveProperty(u.getter.name,c)??this.factory(Te.CompletionItemKind.Variable).addType(Re.SignatureDefinitionBaseType.Any).setLabel(u.getter.name);else if((0,rs.isResolveChainItemWithIndex)(u))if((0,CA.isValidIdentifierLiteral)(u.getter)){let l=u.getter.value.toString();r=r.resolveProperty(l,u.isInCallExpression)??this.factory(Te.CompletionItemKind.Variable).addType(Re.SignatureDefinitionBaseType.Any).setLabel(l)}else{let l=this.resolveTypeWithDefault(u.getter);r=r.resolveProperty(l,u.isInCallExpression)??this.factory(Te.CompletionItemKind.Variable).addType(Re.SignatureDefinitionBaseType.Any)}else if(u.ref.type===Fe.ASTType.SliceExpression)r=r.copy();else return null;if(u.unary?.operator==="new"&&r!==null){let l=this.factory(Te.CompletionItemKind.Property).addType(Re.SignatureDefinitionBaseType.Map).setLabel(r.label);l.setProperty("__isa",r),r=l}}return r}resolveNamespace(e,n=!1){let r=(0,kA.createResolveChain)(e);return this.resolveChain(r,n)}defineNamespace(e,n){let r=(0,kA.createResolveChain)(e),i=r.pop();if(r.length>0){let o=this.resolveChain(r);if(o===null)return!1;if((0,rs.isResolveChainItemWithMember)(i))return o.setProperty(i.getter.name,n);if((0,rs.isResolveChainItemWithIndex)(i)){if((0,CA.isValidIdentifierLiteral)(i.getter))return o.setProperty(i.getter.value.toString(),n);{let a=this.resolveTypeWithDefault(i.getter);return o.setProperty(a,n)}}return!1}let s=this._scope;return(0,rs.isResolveChainItemWithIdentifier)(i)?s.setProperty(i.getter.name,n):!1}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);n.push(...a)}}return n}resolveAvailableAssignments(e){let n=(0,xA.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._definitions.get(n);a!=null&&i.push(...a)}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().setLine(n.start.line)??this.factory(Te.CompletionItemKind.Variable).addType(Re.SignatureDefinitionBaseType.Any).setLine(n.start.line);this.defineNamespace(n.variable,r);let i=(0,xA.createExpressionId)(n.variable),s=this._definitions;i.startsWith("globals.")?(s=this._document.getRootScopeContext().aggregator.definitions,i=i.slice(8)):i.startsWith("locals.")?(s=this._definitions,i=i.slice(7)):i.startsWith("outer.")&&(s=this.parent.definitions,i=i.slice(6));let o=s.get(i);o?o.push(n):s.set(i,[n])}}};Xl.Aggregator=gy});var _y=m(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});Yl.Document=void 0;var $r=$n(),hM=je(),OA=Qi(),RA=yy(),DA=so(),IA=Xg(),by=class t{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._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($r.SignatureDefinitionBaseType.Map),funcRef:this._container.primitives.get($r.SignatureDefinitionBaseType.Function),number:this._container.primitives.get($r.SignatureDefinitionBaseType.Number),string:this._container.primitives.get($r.SignatureDefinitionBaseType.String),list:this._container.primitives.get($r.SignatureDefinitionBaseType.List)}}initApi(){let e=this._container.primitives.get($r.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 DA.Entity({kind:OA.CompletionItemKind.Constant,container:this._container,label:"globals"}).addType($r.SignatureDefinitionBaseType.Map)}analyzeScope(e){let n=this._scopeMapping.get(e.scope),r=new IA.Scope({container:this._container,parent:n?.scope,globals:this._globals}),i=new RA.Aggregator({scope:r,root:e,document:this,parent:n?.aggregator});this._scopeMapping.set(e,{scope:r,aggregator:i});let s=e.assignment instanceof hM.ASTAssignmentStatement?this.resolveNamespace(e.assignment.variable,!0):null;if(s!==null){let o=s?.context;o!=null&&o.types.has($r.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),d=c.getTypes().map(p=>p.type);l===null?r.setProperty(c.getLabel(),new DA.Entity({kind:OA.CompletionItemKind.Variable,container:this._container}).addType(...d)):(l.types.delete($r.SignatureDefinitionBaseType.Any),l.addType(...d))}}}}analyze(){let e=new IA.Scope({container:this._container,globals:this._globals,locals:this._globals}),n=new RA.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);n.push(...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({root:this._root,container:this._container.copy()});for(let r of e)n._globals.extend(r._globals.copy({line:-1})),n._intrinscis.map.extend(r._intrinscis.map.copy({line:-1})),n._intrinscis.funcRef.extend(r._intrinscis.funcRef.copy({line:-1})),n._intrinscis.number.extend(r._intrinscis.number.copy({line:-1})),n._intrinscis.string.extend(r._intrinscis.string.copy({line:-1})),n._intrinscis.list.extend(r._intrinscis.list.copy({line:-1}));return n.analyze(),n}};Yl.Document=by});var Ty=m(Jl=>{"use strict";Object.defineProperty(Jl,"__esModule",{value:!0});Jl.ContainerProxy=void 0;var Tr=$n(),Si=so(),PA=Qi(),MA=ka(),vy=Fl(),Sy=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()}createPrimitives(){let e=new Map;for(let[n,r]of this._container.getPrimitives()){let i=new Si.Entity({kind:PA.CompletionItemKind.Constant,container:this,isAPI:n===Tr.SignatureDefinitionBaseType.General}).addType(Tr.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 Si.Entity({kind:PA.CompletionItemKind.Constant,container:this}).addType(Tr.SignatureDefinitionBaseType.Map).insertSignature(r);e.set(n,i)}return e}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(Tr.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,vy.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,vy.lookupProperty)(this._primitives.get(Tr.SignatureDefinitionBaseType.Any),n);if(e.includes(Tr.SignatureDefinitionBaseType.Any)&&i)return(0,Si.resolveEntity)(this,i,r);let s=this.searchDefinitionMatches(e,n);return s.size===0?null:s.size===1?(0,Si.resolveEntity)(this,s.values().next().value,r):s.has(Tr.SignatureDefinitionBaseType.Any)?(0,Si.resolveEntity)(this,s.get(Tr.SignatureDefinitionBaseType.Any),r):i!==null?(0,Si.resolveEntity)(this,i,r):(0,Si.resolveEntity)(this,s.values().next().value,r)}getGeneralDefinition(e,n=!1){let r=(0,vy.lookupProperty)(this._primitives.get(Tr.SignatureDefinitionBaseType.General),e);return r==null?null:(0,Si.resolveEntity)(this,r,n)}getAllIdentifier(e){let n=new Map;if(e===Tr.SignatureDefinitionBaseType.Any){for(let i of this._container.getAllVisibleTypes()){let s=this.getTypeSignature(i);s!=null&&(0,MA.injectIdentifers)(n,s)}return n}let r=this.getTypeSignature(e);return r!=null&&(0,MA.injectIdentifers)(n,r),n}copy(){return new t({container:this._container})}};Jl.ContainerProxy=Sy});var LA=m(Ql=>{"use strict";Object.defineProperty(Ql,"__esModule",{value:!0});Ql.TypeManager=void 0;var mM=_y(),gM=Ty(),wy=class{constructor(e){this._container=new gM.ContainerProxy({container:e.container}),this._types=new Map}analyze(e,n){let r=new mM.Document({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}};Ql.TypeManager=wy});var $a=m(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.TypeManager=ne.ContainerProxy=ne.Document=ne.Aggregator=ne.Scope=ne.Entity=ne.lookupProperty=ne.isEligibleForProperties=ne.injectIdentifers=ne.isSignatureDefinitionFunction=ne.isResolveChainItemWithValue=ne.isResolveChainItemWithMember=ne.isResolveChainItemWithIndex=ne.isResolveChainItemWithIdentifier=ne.CompletionItemKind=ne.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION=ne.ObjectSetIterator=ne.ObjectSet=ne.rotateBits=ne.getStringHashCode=ne.getHashCode=ne.createResolveChain=ne.enrichWithMetaInformation=ne.createExpressionId=ne.createExpressionHash=ne.isValidIdentifierLiteral=void 0;var yM=aa();Object.defineProperty(ne,"isValidIdentifierLiteral",{enumerable:!0,get:function(){return yM.isValidIdentifierLiteral}});var bM=Fw();Object.defineProperty(ne,"createExpressionHash",{enumerable:!0,get:function(){return bM.createExpressionHash}});var _M=Dm();Object.defineProperty(ne,"createExpressionId",{enumerable:!0,get:function(){return _M.createExpressionId}});var vM=Lg();Object.defineProperty(ne,"enrichWithMetaInformation",{enumerable:!0,get:function(){return vM.enrichWithMetaInformation}});var SM=Ng();Object.defineProperty(ne,"createResolveChain",{enumerable:!0,get:function(){return SM.createResolveChain}});var Ey=Rm();Object.defineProperty(ne,"getHashCode",{enumerable:!0,get:function(){return Ey.getHashCode}});Object.defineProperty(ne,"getStringHashCode",{enumerable:!0,get:function(){return Ey.getStringHashCode}});Object.defineProperty(ne,"rotateBits",{enumerable:!0,get:function(){return Ey.rotateBits}});var NA=$g();Object.defineProperty(ne,"ObjectSet",{enumerable:!0,get:function(){return NA.ObjectSet}});Object.defineProperty(ne,"ObjectSetIterator",{enumerable:!0,get:function(){return NA.ObjectSetIterator}});var TM=Bg();Object.defineProperty(ne,"DEFAULT_CUSTOM_FUNCTION_DESCRIPTION",{enumerable:!0,get:function(){return TM.DEFAULT_CUSTOM_FUNCTION_DESCRIPTION}});var wM=Qi();Object.defineProperty(ne,"CompletionItemKind",{enumerable:!0,get:function(){return wM.CompletionItemKind}});var Zl=Ug();Object.defineProperty(ne,"isResolveChainItemWithIdentifier",{enumerable:!0,get:function(){return Zl.isResolveChainItemWithIdentifier}});Object.defineProperty(ne,"isResolveChainItemWithIndex",{enumerable:!0,get:function(){return Zl.isResolveChainItemWithIndex}});Object.defineProperty(ne,"isResolveChainItemWithMember",{enumerable:!0,get:function(){return Zl.isResolveChainItemWithMember}});Object.defineProperty(ne,"isResolveChainItemWithValue",{enumerable:!0,get:function(){return Zl.isResolveChainItemWithValue}});var EM=Hg();Object.defineProperty(ne,"isSignatureDefinitionFunction",{enumerable:!0,get:function(){return EM.isSignatureDefinitionFunction}});var AM=ka();Object.defineProperty(ne,"injectIdentifers",{enumerable:!0,get:function(){return AM.injectIdentifers}});var xM=ql();Object.defineProperty(ne,"isEligibleForProperties",{enumerable:!0,get:function(){return xM.isEligibleForProperties}});var kM=Fl();Object.defineProperty(ne,"lookupProperty",{enumerable:!0,get:function(){return kM.lookupProperty}});var CM=so();Object.defineProperty(ne,"Entity",{enumerable:!0,get:function(){return CM.Entity}});var OM=Xg();Object.defineProperty(ne,"Scope",{enumerable:!0,get:function(){return OM.Scope}});var RM=yy();Object.defineProperty(ne,"Aggregator",{enumerable:!0,get:function(){return RM.Aggregator}});var DM=_y();Object.defineProperty(ne,"Document",{enumerable:!0,get:function(){return DM.Document}});var IM=Ty();Object.defineProperty(ne,"ContainerProxy",{enumerable:!0,get:function(){return IM.ContainerProxy}});var PM=LA();Object.defineProperty(ne,"TypeManager",{enumerable:!0,get:function(){return PM.TypeManager}})});var Ay=m(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.getSymbolItemKind=uo.getCompletionItemKind=void 0;var Vt=$a(),MM=t=>{switch(t){case Vt.CompletionItemKind.Constant:return 21;case Vt.CompletionItemKind.Variable:return 6;case Vt.CompletionItemKind.Expression:return 6;case Vt.CompletionItemKind.Function:return 3;case Vt.CompletionItemKind.ListConstructor:case Vt.CompletionItemKind.MapConstructor:case Vt.CompletionItemKind.Literal:case Vt.CompletionItemKind.Unknown:return 12}};uo.getCompletionItemKind=MM;var LM=t=>{switch(t){case Vt.CompletionItemKind.Constant:return 14;case Vt.CompletionItemKind.Variable:return 13;case Vt.CompletionItemKind.Expression:return 13;case Vt.CompletionItemKind.Function:return 12;case Vt.CompletionItemKind.ListConstructor:return 18;case Vt.CompletionItemKind.MapConstructor:return 19;case Vt.CompletionItemKind.Literal:case Vt.CompletionItemKind.Unknown:return 13}};uo.getSymbolItemKind=LM});var ky=m(ed=>{"use strict";Object.defineProperty(ed,"__esModule",{value:!0});ed.findEx=void 0;var NM=je(),qM=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:()=>{}}},xy=class{constructor(e){this.map=qM(this.visit.bind(this)),this.callback=e,this.state={exit:!1}}visit(e,n=0){let r=this;if(e==null)return;if(e.type==null)throw console.error("Error ast type:",e),new Error("Unexpected as type");if(r.state=r.callback(e,n),r.state.exit||r.state.skip)return;let i=r.map[e.type];i?.call(r,e,n+1)}};function jM(t,e){let n=[];return new xy((i,s)=>{let o=t(i,s)||{};return o.valid&&i.type!==NM.ASTType.InvalidCodeExpression&&n.push(i),{exit:!!o.exit,skip:!!o.skip}}).visit(e),n}ed.findEx=jM});var qA=m((m5,FM)=>{FM.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 jA=m((g5,$M)=>{$M.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:
111
111
  miniscript: a string such as "1.5"
112
112
  buildDate: a date in yyyy-mm-dd format, like "2020-05-28"
113
113
  host: a number for the host major and minor version, like 0.9
114
114
  hostName: name of the host application, e.g. "Mini Micro"
115
- hostInfo: URL or other short info about the host app`},stackTrace:{description:"Get a list describing the call stack."}}});var FA=m((y5,BM)=>{BM.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 $A=m((b5,UM)=>{UM.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 BA=m((_5,HM)=>{HM.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 UA=m((v5,WM)=>{WM.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 HA=m(Ba=>{"use strict";var co=Ba&&Ba.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ba,"__esModule",{value:!0});var GM=co(qA()),VM=co(jA()),zM=co(FA()),KM=co($A()),XM=co(BA()),YM=co(UA()),JM={any:GM.default,general:VM.default,list:zM.default,map:KM.default,string:YM.default,number:XM.default};Ba.default=JM});var WA=m((T5,QM)=>{QM.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 GA=m((w5,ZM)=>{ZM.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 VA=m((E5,eL)=>{eL.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 zA=m((A5,tL)=>{tL.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 KA=m((x5,nL)=>{nL.exports={type:"number",definitions:{}}});var XA=m((k5,rL)=>{rL.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 YA=m((C5,iL)=>{iL.exports={type:"version",extends:"map",definitions:{miniscript:{type:"string"},buildDate:{type:"string"},host:{type:"number"},hostName:{type:"string"},hostInfo:{type:"string"}}}});var JA=m(fn=>{"use strict";var Ti=fn&&fn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fn,"__esModule",{value:!0});fn.miniscriptMeta=void 0;var sL=$n(),oL=Ti(HA()),aL=Ti(WA()),uL=Ti(GA()),cL=Ti(VA()),lL=Ti(zA()),dL=Ti(KA()),fL=Ti(XA()),pL=Ti(YA());fn.miniscriptMeta=new sL.Container;fn.miniscriptMeta.addTypeSignatureFromPayload(aL.default);fn.miniscriptMeta.addTypeSignatureFromPayload(uL.default);fn.miniscriptMeta.addTypeSignatureFromPayload(cL.default);fn.miniscriptMeta.addTypeSignatureFromPayload(lL.default);fn.miniscriptMeta.addTypeSignatureFromPayload(dL.default);fn.miniscriptMeta.addTypeSignatureFromPayload(fL.default);fn.miniscriptMeta.addTypeSignatureFromPayload(pL.default);fn.miniscriptMeta.addMetaFromPayload("en",oL.default)});var Ua=m(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.lookupBase=nr.lookupIdentifier=void 0;var Br=je(),hL=JA(),mL=$a(),gL=t=>{switch(t.type){case Br.ASTType.CallStatement:return(0,nr.lookupIdentifier)(t.expression);case Br.ASTType.CallExpression:return(0,nr.lookupIdentifier)(t.base);case Br.ASTType.Identifier:return t;case Br.ASTType.MemberExpression:return(0,nr.lookupIdentifier)(t.identifier);case Br.ASTType.IndexExpression:return(0,nr.lookupIdentifier)(t.index);default:return null}};nr.lookupIdentifier=gL;var yL=(t=null)=>{switch(t?.type){case Br.ASTType.MemberExpression:return t.base;case Br.ASTType.IndexExpression:return t.base;case Br.ASTType.CallExpression:return t.base;case Br.ASTType.SliceExpression:return t.base;default:return null}};nr.lookupBase=yL;nr.default=new mL.TypeManager({container:hL.miniscriptMeta})});var fo=m(Un=>{"use strict";var bL=Un&&Un.__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=Un&&Un.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ZA=Un&&Un.__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)&&bL(e,t,n);return _L(e,t),e};Object.defineProperty(Un,"__esModule",{value:!0});Un.LookupHelper=Un.buildTypeDocument=void 0;var vL=$n(),QA=je(),lo=$a(),SL=ZA(Cy()),is=ZA(Ua());async function Ry(t,e,n=new Map){let r=t.uri;if(n.has(r))return n.get(r);let i=is.default.get(r);if(n.set(r,null),!i)return null;let s=[],o=await e.documentManager.get(t).getImports();await Promise.all(o.map(async u=>{let{document:c,textDocument:l}=u;if(!c)return;let d=await Ry(l,e,n);d!==null&&s.push(d)}));let a=i.merge(...s);return n.set(r,a),a}Un.buildTypeDocument=Ry;var Oy=class{constructor(e,n){this.document=e,this.context=n}findAllAssignmentsOfIdentifier(e,n){return is.default.get(this.document.uri).getScopeContext(n).aggregator.resolveAvailableAssignmentsWithQuery(e)}findAllAssignmentsOfItem(e,n){return is.default.get(this.document.uri).getScopeContext(n).aggregator.resolveAvailableAssignments(e)}findAllAvailableIdentifierInRoot(){return is.default.get(this.document.uri).getRootScopeContext().scope.getAllIdentifier()}findAllAvailableIdentifier(e){return is.default.get(this.document.uri).getScopeContext(e).scope.getAllIdentifier()}findAllAvailableIdentifierRelatedToPosition(e){let n=is.default.get(this.document.uri),r=new Map,i=n.getScopeContext(e.scope);i.scope.isSelfAvailable()&&r.set("self",{kind:lo.CompletionItemKind.Constant,line:-1}),i.scope.isSuperAvailable()&&r.set("super",{kind:lo.CompletionItemKind.Constant,line:-1});let s=new Map;(0,lo.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})}i.scope.locals!==i.scope.globals&&(0,lo.injectIdentifers)(r,i.scope.globals),i.scope.outer&&(0,lo.injectIdentifers)(r,i.scope.outer);for(let a of n.container.getAllIdentifier(vL.SignatureDefinitionBaseType.General))r.set(...a);return 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=SL.findEx((c,l)=>{let d=c.start.line-1,p=c.start.character-1,y=c.end.line-1,v=c.end.character-1;return d>e.line?{exit:!0}:d<y?{valid:e.line>d&&e.line<y||e.line===d&&p<=e.character||e.line===y&&v>=e.character}:{valid:d<=e.line&&p<=e.character&&y>=e.line&&v>=e.character}},o),u=a.pop();if(u)return{closest:u,outer:a}}return null}async lookupBasePath(e){let n=await this.buildTypeMap();if(n===null)return null;let r=(0,is.lookupBase)(e);return r?n.resolveNamespace(r):null}async buildTypeMap(){return await Ry(this.document,this.context)}async lookupTypeInfo({closest:e,outer:n}){let r=await this.buildTypeMap();if(r===null)return null;let i=n.length>0?n[n.length-1]:void 0;return i?.type===QA.ASTType.MemberExpression&&e===i.identifier||i?.type===QA.ASTType.IndexExpression&&e===i.index&&(0,lo.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}};Un.LookupHelper=Oy});var ex=m(td=>{"use strict";Object.defineProperty(td,"__esModule",{value:!0});td.AVAILABLE_CONSTANTS=void 0;td.AVAILABLE_CONSTANTS=["true","false","null","params","globals","locals","outer"].map(t=>({label:t,kind:21}))});var tx=m(nd=>{"use strict";Object.defineProperty(nd,"__esModule",{value:!0});nd.AVAILABLE_KEYWORDS=void 0;var po=Fr(),zt=je();nd.AVAILABLE_KEYWORDS=[zt.Keyword.If,zt.Keyword.In,zt.Keyword.Or,zt.Keyword.And,zt.Keyword.Isa,zt.Keyword.For,zt.Keyword.New,zt.Keyword.Not,zt.Keyword.End,zt.Keyword.Then,zt.Keyword.Else,zt.Keyword.Break,zt.Keyword.While,zt.Keyword.Return,zt.Keyword.Function,zt.Keyword.Continue,po.GreybelKeyword.Envar,po.GreybelKeyword.Import,po.GreybelKeyword.Include,po.GreybelKeyword.Debugger,po.GreybelKeyword.Line,po.GreybelKeyword.File].map(t=>({label:t,kind:14}))});var nx=m(rd=>{"use strict";Object.defineProperty(rd,"__esModule",{value:!0});rd.AVAILABLE_OPERATORS=void 0;var Ha=ao(),Pt=je();rd.AVAILABLE_OPERATORS=[Pt.Operator.Plus,Pt.Operator.Asterik,Pt.Operator.Minus,Pt.Operator.Slash,Pt.Operator.Power,Pt.Operator.Modulo,Pt.Operator.LessThan,Pt.Operator.GreaterThan,Pt.Operator.LessThanOrEqual,Pt.Operator.GreaterThanOrEqual,Pt.Operator.NotEqual,Pt.Operator.Equal,Pt.Operator.AddShorthand,Pt.Operator.SubtractShorthand,Pt.Operator.MultiplyShorthand,Pt.Operator.DivideShorthand,Ha.Operator.BitwiseAnd,Ha.Operator.BitwiseOr,Ha.Operator.LeftShift,Ha.Operator.RightShift,Ha.Operator.UnsignedRightShift,Pt.Operator.Assign,Pt.Operator.Reference].map(t=>({label:t,kind:24}))});var sx=m(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.activate=Mt.getDefaultCompletionList=Mt.getPropertyCompletionList=Mt.transformToCompletionItems=void 0;var rx=je(),TL=xy(),ix=fo(),wL=ex(),EL=tx(),AL=nx(),xL=t=>{let e=[];for(let[n,r]of t)e.push({label:n,kind:(0,TL.getCompletionItemKind)(r.kind)});return e};Mt.transformToCompletionItems=xL;var kL=async(t,e)=>{let n=await t.lookupBasePath(e);return n===null?[]:(0,Mt.transformToCompletionItems)(n.getAllIdentifier())};Mt.getPropertyCompletionList=kL;var CL=()=>[...EL.AVAILABLE_KEYWORDS,...AL.AVAILABLE_OPERATORS,...wL.AVAILABLE_CONSTANTS];Mt.getDefaultCompletionList=CL;function OL(t){t.connection.onCompletion(async e=>{if(!t.getConfiguration().autocomplete)return;let n=await t.fs.getTextDocument(e.textDocument.uri),r=await t.documentManager.getLatest(n),i=new ix.LookupHelper(r.textDocument,t),s=i.lookupAST(e.position),o=[],a=!1;if(s){let{closest:l}=s;l instanceof rx.ASTMemberExpression?(o.push(...await(0,Mt.getPropertyCompletionList)(i,l)),a=!0):l instanceof rx.ASTIndexExpression?(o.push(...await(0,Mt.getPropertyCompletionList)(i,l)),a=!0):o.push(...(0,Mt.getDefaultCompletionList)())}else o.push(...(0,Mt.getDefaultCompletionList)()),o.push(...(0,Mt.transformToCompletionItems)(i.findAllAvailableIdentifierInRoot()));if(!s||a)return o;let u=new Set([...o.map(l=>l.label)]),c=await r.getImports();for(let l of c){let{document:d}=l;if(!d)continue;let p=new ix.LookupHelper(l.textDocument,t);o.push(...(0,Mt.transformToCompletionItems)(p.findAllAvailableIdentifier(d)).filter(y=>!u.has(y.label)).map(y=>(u.add(y.label),y)))}return o.push(...(0,Mt.transformToCompletionItems)(i.findAllAvailableIdentifierRelatedToPosition(s.closest)).filter(l=>!u.has(l.label))),o}),t.connection.onCompletionResolve(e=>e)}Mt.activate=OL});var ax=m((N5,ox)=>{"use strict";ox.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 Dy=m((q5,cx)=>{var Wa=ax(),ux={};for(let t of Object.keys(Wa))ux[Wa[t]]=t;var J={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"]}};cx.exports=J;for(let t of Object.keys(J)){if(!("channels"in J[t]))throw new Error("missing channels property: "+t);if(!("labels"in J[t]))throw new Error("missing channel labels property: "+t);if(J[t].labels.length!==J[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:n}=J[t];delete J[t].channels,delete J[t].labels,Object.defineProperty(J[t],"channels",{value:e}),Object.defineProperty(J[t],"labels",{value:n})}J.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]};J.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),d=function(p){return(c-p)/6/l+1/2};return l===0?(i=0,s=0):(s=l/c,e=d(o),n=d(a),r=d(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]};J.rgb.hwb=function(t){let e=t[0],n=t[1],r=t[2],i=J.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]};J.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 RL(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}J.rgb.keyword=function(t){let e=ux[t];if(e)return e;let n=1/0,r;for(let i of Object.keys(Wa)){let s=Wa[i],o=RL(t,s);o<n&&(n=o,r=i)}return r};J.keyword.rgb=function(t){return Wa[t]};J.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]};J.rgb.lab=function(t){let e=J.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]};J.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};J.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]};J.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]}};J.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]};J.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,d;switch(o){default:case 6:case 0:c=a,l=u,d=n;break;case 1:c=u,l=a,d=n;break;case 2:c=n,l=a,d=u;break;case 3:c=n,l=u,d=a;break;case 4:c=u,l=n,d=a;break;case 5:c=a,l=n,d=u;break}return[c*255,l*255,d*255]};J.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]};J.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]};J.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]};J.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]};J.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]};J.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]};J.rgb.ansi16=function(t,e=null){let[n,r,i]=t,s=e===null?J.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};J.hsv.ansi16=function(t){return J.rgb.ansi16(J.hsv.rgb(t),t[2])};J.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)};J.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]};J.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]};J.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};J.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]};J.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]};J.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]};J.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]};J.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]};J.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]};J.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]};J.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]};J.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]};J.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};J.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};J.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};J.gray.hsl=function(t){return[0,0,t[0]]};J.gray.hsv=J.gray.hsl;J.gray.hwb=function(t){return[0,100,t[0]]};J.gray.cmyk=function(t){return[0,0,0,t[0]]};J.gray.lab=function(t){return[t[0],0,0]};J.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};J.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var dx=m((j5,lx)=>{var id=Dy();function DL(){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 IL(t){let e=DL(),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 PL(t,e){return function(n){return e(t(n))}}function ML(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=PL(id[e[i].parent][i],r),i=e[i].parent;return r.conversion=n,r}lx.exports=function(t){let e=IL(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]=ML(o,e))}return n}});var px=m((F5,fx)=>{var Iy=Dy(),LL=dx(),ho={},NL=Object.keys(Iy);function qL(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 jL(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}NL.forEach(t=>{ho[t]={},Object.defineProperty(ho[t],"channels",{value:Iy[t].channels}),Object.defineProperty(ho[t],"labels",{value:Iy[t].labels});let e=LL(t);Object.keys(e).forEach(r=>{let i=e[r];ho[t][r]=jL(i),ho[t][r].raw=qL(i)})});fx.exports=ho});var mx=m(mo=>{"use strict";var FL=mo&&mo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(mo,"__esModule",{value:!0});mo.activate=void 0;var Py=FL(px()),$L=je(),hx;(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"})(hx||(hx={}));var My={black:"#000000",blue:"#0000FF",green:"#00FF00",orange:"#FF8800",purple:"#CC8899",red:"#FF0000",white:"#FFFFFF",yellow:"#FFFF00"},BL=()=>new RegExp(`(?:mark|color)=(${Object.keys(My).join("|")}|(?:#[0-9a-f]{6}|#[0-9a-f]{3}))`,"ig"),UL=Object.prototype.hasOwnProperty;function HL(t){t.connection.onColorPresentation(e=>[{label:`#${Py.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),s=(await t.documentManager.getLatest(n)).document.literals.filter(u=>u.type===$L.ASTType.StringLiteral),o=[],a=({match:u,markup:c,value:l,astPosition:d,lineIndex:p})=>{let y=u.index+c.indexOf("=")+1,v=y+l.length,x=d.line-1+p,I=y,P=v;return p===0&&(I+=d.character,P+=d.character),{start:{line:x,character:I},end:{line:x,character:P}}};for(let u=0;u<s.length;u++){let c=s[u];if(!c.start)continue;let l=c.start,d=c.value.toString().split(`
116
- `);for(let p=0;p<d.length;p++){let y=d[p],v=BL(),x;for(;x=v.exec(y);){let[I,P]=x,w=a({match:x,markup:I,value:P,astPosition:l,lineIndex:p});if(P.startsWith("#")){let[E,_,j]=Py.default.hex.rgb(P.slice(1));o.push({range:w,color:{red:E/255,green:_/255,blue:j/255,alpha:1}})}else if(UL.call(My,P)){let[E,_,j]=Py.default.hex.rgb(My[P].slice(1));o.push({range:w,color:{red:E/255,green:_/255,blue:j/255,alpha:1}})}else o.push({range:w,color:{red:0,green:0,blue:0,alpha:1}})}}}return o})}mo.activate=HL});var bx=m(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});sd.activate=void 0;var WL=je(),gx=fo(),yx=(t,e,n)=>{let r=t.findAllAssignmentsOfItem(e,n),i=[];for(let s of r){if(!s.start||!s.end)continue;let o={line:s.start.line-1,character:s.start.character-1},a={line:s.end.line-1,character:s.end.character-1},u={targetUri:t.document.uri,targetRange:{start:o,end:a},targetSelectionRange:{start:o,end:a}};i.push(u)}return i};function GL(t){t.connection.onDefinition(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri),r=new gx.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;a&&a instanceof WL.ASTMemberExpression&&a.identifier===o&&(u=a);let c=yx(r,u,u.scope),l=await t.documentManager.get(n).getImports();for(let d of l){let{document:p,textDocument:y}=d;if(!p)continue;let v=new gx.LookupHelper(y,t),x=yx(v,u,p);c.push(...x)}return c})}sd.activate=GL});var _x=m(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0});od.activate=void 0;async function VL(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 zL(t){t.connection.languages.diagnostics.on(async e=>{if(!t.getConfiguration().diagnostic)return;let n=await t.fs.getTextDocument(e.textDocument.uri),r=await VL(n,t);return r.length===0?{kind:"full",items:[]}:{kind:"full",items:r}})}od.activate=zL});var vx=m(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});ad.getStringHashCode=void 0;ad.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 Tx=m(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0});ld.createExpressionHash=void 0;var ud=je(),Sx=vx(),cd=(t,e)=>t.$$hash=e,KL=t=>{var e;return(e=t.$$hash)!==null&&e!==void 0?e:null};function go(t){let e=KL(t);if(e!==null)return e;let n=(0,Sx.getStringHashCode)(t.type);switch(t.type){case ud.ASTType.ParenthesisExpression:return go(t.expression);case ud.ASTType.MemberExpression:{let r=t;return n^=go(r.base),n^=go(r.identifier),cd(t,n)}case ud.ASTType.IndexExpression:{let r=t;return n^=go(r.base),n^=go(r.index),cd(t,n)}case ud.ASTType.Identifier:{let r=t;return n^=(0,Sx.getStringHashCode)(r.name),cd(t,n)}}return cd(t,n)}function XL(t){return go(t)}ld.createExpressionHash=XL});var dd=m(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.hasEmptyBody=kt.containsMultilineItemInShortcutClauses=kt.getLastComment=kt.unwrap=kt.transformBitOperation=kt.countRightBinaryExpressions=kt.SHORTHAND_OPERATORS=void 0;var pn=je();kt.SHORTHAND_OPERATORS=[pn.Operator.Plus,pn.Operator.Minus,pn.Operator.Asterik,pn.Operator.Slash,pn.Operator.Modulo,pn.Operator.Power];var YL=t=>{if(t=(0,kt.unwrap)(t),t instanceof pn.ASTComparisonGroupExpression)return t.expressions.length;let e=[t],n=0;for(;e.length>0;){let r=e.pop();r instanceof pn.ASTBinaryExpression&&n++,(r instanceof pn.ASTBinaryExpression||r instanceof pn.ASTLogicalExpression||r instanceof pn.ASTIsaExpression)&&(e.push((0,kt.unwrap)(r.left)),e.push((0,kt.unwrap)(r.right)))}return n};kt.countRightBinaryExpressions=YL;var JL=(t,e,n,r)=>{if(r==="|")return"bitOr("+[e,n].join(", ")+")";if(r==="&")return"bitAnd("+[e,n].join(", ")+")";if(r==="<<"||r===">>"||r===">>>")throw new Error("Operators in binary expression are not supported");return t};kt.transformBitOperation=JL;var QL=t=>{for(;t instanceof pn.ASTParenthesisExpression;)t=t.expression;return t};kt.unwrap=QL;var ZL=t=>{for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.type===pn.ASTType.Comment)return n}return null};kt.getLastComment=ZL;var eN=(t,e)=>e.some(n=>t.line<n.body[0].end.line);kt.containsMultilineItemInShortcutClauses=eN;var tN=t=>!t.some(e=>!(e instanceof pn.ASTComment));kt.hasEmptyBody=tN});var Ny=m(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.BeautifyContext=os.IndentationType=void 0;var ss=je(),nN=dd(),wx;(function(t){t[t.Tab=0]="Tab",t[t.Whitespace=1]="Whitespace"})(wx=os.IndentationType||(os.IndentationType={}));var Ly=class{get indent(){return this._indent}get isMultilineAllowed(){return this._isMultilineAllowed}constructor(e,n){this.transformer=e,this.options=n,this._indent=0,this._isMultilineAllowed=!0,this.chunks=[],this.usedComments=new Set,this.putIndent=n.indentation===wx.Tab?(r,i=0)=>`${" ".repeat(this._indent+i)}${r}`:(r,i=0)=>`${" ".repeat(n.indentationSpaces).repeat(this._indent+i)}${r}`}pushLines(e){this.chunks.push(e)}popLines(){return this.chunks.pop()}getLines(){return this.chunks[this.chunks.length-1]}useComment(e,n=" "){let r=this.getLines()[e.line];if(r==null)return"";let i=(0,nN.getLastComment)(r);return i!=null&&!this.usedComments.has(i)?(this.usedComments.add(i),n+this.transformer.make(i)):""}appendComment(e,n){return n+this.useComment(e)}disableMultiline(){this._isMultilineAllowed=!1}enableMultiline(){this._isMultilineAllowed=!0}incIndent(){this._indent++}decIndent(){this._indent--}getBlockOpenerEndLine(e){return e instanceof ss.ASTIfClause||e instanceof ss.ASTWhileStatement?e.condition.end.line:e instanceof ss.ASTForGenericStatement?e.iterator.end.line:e.start.line}getPreviousEndLine(e){if(e==null)return 0;if(e.type===ss.ASTType.IfShortcutStatement){let n=e;return n.clauses[n.clauses.length-1].body[0].end.line}return e.end.line}buildBlock(e){var n;if(e.body.length===0)return[];let r=[...e.body].sort((u,c)=>u.start.line-c.start.line),i=[],s=null;for(let u=0;u<r.length;u++){let c=r[u],l=(n=r[u+1])!==null&&n!==void 0?n:null;if(c.type!==ss.ASTType.Comment&&s?.end.line===c.start.line){let p=this.transformer.make(c,{isCommand:!0});i.push(this.putIndent(this.appendComment(c.end,p))),s=c;continue}if(this.usedComments.has(c)){c.isMultiline&&(s=c);continue}if(c.type===ss.ASTType.Comment&&c.start.line===l?.start.line)continue;let d=Math.max(s?c.start.line-this.getPreviousEndLine(s)-1:c.start.line-this.getBlockOpenerEndLine(e)-1,0);if(d>0&&i.push(...new Array(d).fill("")),c instanceof ss.ASTComment){this.usedComments.add(c);let p=this.transformer.make(c,{isCommand:!0});i.push(this.putIndent(p))}else{let p=this.transformer.make(c,{isCommand:!0});i.push(this.putIndent(this.appendComment(c.end,p)))}s=c}let o=e.body[e.body.length-1],a=Math.max(e.end.line-this.getPreviousEndLine(o)-1,0);return a>0&&i.push(...new Array(a).fill("")),i}};os.BeautifyContext=Ly});var qy=m(fd=>{"use strict";Object.defineProperty(fd,"__esModule",{value:!0});fd.beautifyFactory=void 0;var Ga=je(),rN=require("path"),Ex=Tx(),Ax=Ny(),nn=dd(),iN=t=>{let{keepParentheses:e=!1,indentation:n=Ax.IndentationType.Tab,indentationSpaces:r=2,isDevMode:i=!1}=t.buildOptions,s=new Ax.BeautifyContext(t,{keepParentheses:e,indentation:n,indentationSpaces:r,isDevMode:i});return{ParenthesisExpression:(o,a)=>"("+t.make(o.expression,{hasLogicalIndentActive:a.hasLogicalIndentActive})+")",Comment:(o,a)=>o.isMultiline?i?`/*${o.value}*/`:o.value.split(`
115
+ hostInfo: URL or other short info about the host app`},stackTrace:{description:"Get a list describing the call stack."}}});var FA=m((y5,BM)=>{BM.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 $A=m((b5,UM)=>{UM.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 BA=m((_5,HM)=>{HM.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 UA=m((v5,WM)=>{WM.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 HA=m(Ba=>{"use strict";var co=Ba&&Ba.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ba,"__esModule",{value:!0});var GM=co(qA()),VM=co(jA()),zM=co(FA()),KM=co($A()),XM=co(BA()),YM=co(UA()),JM={any:GM.default,general:VM.default,list:zM.default,map:KM.default,string:YM.default,number:XM.default};Ba.default=JM});var WA=m((T5,QM)=>{QM.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 GA=m((w5,ZM)=>{ZM.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 VA=m((E5,eL)=>{eL.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 zA=m((A5,tL)=>{tL.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 KA=m((x5,nL)=>{nL.exports={type:"number",definitions:{}}});var XA=m((k5,rL)=>{rL.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 YA=m((C5,iL)=>{iL.exports={type:"version",extends:"map",definitions:{miniscript:{type:"string"},buildDate:{type:"string"},host:{type:"number"},hostName:{type:"string"},hostInfo:{type:"string"}}}});var JA=m(fn=>{"use strict";var Ti=fn&&fn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fn,"__esModule",{value:!0});fn.miniscriptMeta=void 0;var sL=$n(),oL=Ti(HA()),aL=Ti(WA()),uL=Ti(GA()),cL=Ti(VA()),lL=Ti(zA()),dL=Ti(KA()),fL=Ti(XA()),pL=Ti(YA());fn.miniscriptMeta=new sL.Container;fn.miniscriptMeta.addTypeSignatureFromPayload(aL.default);fn.miniscriptMeta.addTypeSignatureFromPayload(uL.default);fn.miniscriptMeta.addTypeSignatureFromPayload(cL.default);fn.miniscriptMeta.addTypeSignatureFromPayload(lL.default);fn.miniscriptMeta.addTypeSignatureFromPayload(dL.default);fn.miniscriptMeta.addTypeSignatureFromPayload(fL.default);fn.miniscriptMeta.addTypeSignatureFromPayload(pL.default);fn.miniscriptMeta.addMetaFromPayload("en",oL.default)});var Ua=m(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.lookupBase=nr.lookupIdentifier=void 0;var Br=je(),hL=JA(),mL=$a(),gL=t=>{switch(t.type){case Br.ASTType.CallStatement:return(0,nr.lookupIdentifier)(t.expression);case Br.ASTType.CallExpression:return(0,nr.lookupIdentifier)(t.base);case Br.ASTType.Identifier:return t;case Br.ASTType.MemberExpression:return(0,nr.lookupIdentifier)(t.identifier);case Br.ASTType.IndexExpression:return(0,nr.lookupIdentifier)(t.index);default:return null}};nr.lookupIdentifier=gL;var yL=(t=null)=>{switch(t?.type){case Br.ASTType.MemberExpression:return t.base;case Br.ASTType.IndexExpression:return t.base;case Br.ASTType.CallExpression:return t.base;case Br.ASTType.SliceExpression:return t.base;default:return null}};nr.lookupBase=yL;nr.default=new mL.TypeManager({container:hL.miniscriptMeta})});var fo=m(Un=>{"use strict";var bL=Un&&Un.__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=Un&&Un.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ZA=Un&&Un.__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)&&bL(e,t,n);return _L(e,t),e};Object.defineProperty(Un,"__esModule",{value:!0});Un.LookupHelper=Un.buildTypeDocument=void 0;var vL=$n(),QA=je(),lo=$a(),SL=ZA(ky()),is=ZA(Ua());async function Oy(t,e,n=new Map){let r=t.uri;if(n.has(r))return n.get(r);let i=is.default.get(r);if(n.set(r,null),!i)return null;let s=[],o=await e.documentManager.get(t).getImports();await Promise.all(o.map(async u=>{let{document:c,textDocument:l}=u;if(!c)return;let d=await Oy(l,e,n);d!==null&&s.push(d)}));let a=i.merge(...s);return n.set(r,a),a}Un.buildTypeDocument=Oy;var Cy=class{constructor(e,n){this.document=e,this.context=n}findAllAssignmentsOfIdentifier(e,n){return is.default.get(this.document.uri).getScopeContext(n).aggregator.resolveAvailableAssignmentsWithQuery(e)}findAllAssignmentsOfItem(e,n){return is.default.get(this.document.uri).getScopeContext(n).aggregator.resolveAvailableAssignments(e)}findAllAvailableIdentifierInRoot(){return is.default.get(this.document.uri).getRootScopeContext().scope.getAllIdentifier()}findAllAvailableIdentifier(e){return is.default.get(this.document.uri).getScopeContext(e).scope.getAllIdentifier()}findAllAvailableIdentifierRelatedToPosition(e){let n=is.default.get(this.document.uri),r=new Map,i=n.getScopeContext(e.scope);i.scope.isSelfAvailable()&&r.set("self",{kind:lo.CompletionItemKind.Constant,line:-1}),i.scope.isSuperAvailable()&&r.set("super",{kind:lo.CompletionItemKind.Constant,line:-1});let s=new Map;(0,lo.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})}i.scope.locals!==i.scope.globals&&(0,lo.injectIdentifers)(r,i.scope.globals),i.scope.outer&&(0,lo.injectIdentifers)(r,i.scope.outer);for(let a of n.container.getAllIdentifier(vL.SignatureDefinitionBaseType.General))r.set(...a);return 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=SL.findEx((c,l)=>{let d=c.start.line-1,p=c.start.character-1,y=c.end.line-1,v=c.end.character-1;return d>e.line?{exit:!0}:d<y?{valid:e.line>d&&e.line<y||e.line===d&&p<=e.character||e.line===y&&v>=e.character}:{valid:d<=e.line&&p<=e.character&&y>=e.line&&v>=e.character}},o),u=a.pop();if(u)return{closest:u,outer:a}}return null}async lookupBasePath(e){let n=await this.buildTypeMap();if(n===null)return null;let r=(0,is.lookupBase)(e);return r?n.resolveNamespace(r):null}async buildTypeMap(){return await Oy(this.document,this.context)}async lookupTypeInfo({closest:e,outer:n}){let r=await this.buildTypeMap();if(r===null)return null;let i=n.length>0?n[n.length-1]:void 0;return i?.type===QA.ASTType.MemberExpression&&e===i.identifier||i?.type===QA.ASTType.IndexExpression&&e===i.index&&(0,lo.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}};Un.LookupHelper=Cy});var ex=m(td=>{"use strict";Object.defineProperty(td,"__esModule",{value:!0});td.AVAILABLE_CONSTANTS=void 0;td.AVAILABLE_CONSTANTS=["true","false","null","params","globals","locals","outer"].map(t=>({label:t,kind:21}))});var tx=m(nd=>{"use strict";Object.defineProperty(nd,"__esModule",{value:!0});nd.AVAILABLE_KEYWORDS=void 0;var po=Fr(),zt=je();nd.AVAILABLE_KEYWORDS=[zt.Keyword.If,zt.Keyword.In,zt.Keyword.Or,zt.Keyword.And,zt.Keyword.Isa,zt.Keyword.For,zt.Keyword.New,zt.Keyword.Not,zt.Keyword.End,zt.Keyword.Then,zt.Keyword.Else,zt.Keyword.Break,zt.Keyword.While,zt.Keyword.Return,zt.Keyword.Function,zt.Keyword.Continue,po.GreybelKeyword.Envar,po.GreybelKeyword.Import,po.GreybelKeyword.Include,po.GreybelKeyword.Debugger,po.GreybelKeyword.Line,po.GreybelKeyword.File].map(t=>({label:t,kind:14}))});var nx=m(rd=>{"use strict";Object.defineProperty(rd,"__esModule",{value:!0});rd.AVAILABLE_OPERATORS=void 0;var Ha=ao(),Pt=je();rd.AVAILABLE_OPERATORS=[Pt.Operator.Plus,Pt.Operator.Asterik,Pt.Operator.Minus,Pt.Operator.Slash,Pt.Operator.Power,Pt.Operator.Modulo,Pt.Operator.LessThan,Pt.Operator.GreaterThan,Pt.Operator.LessThanOrEqual,Pt.Operator.GreaterThanOrEqual,Pt.Operator.NotEqual,Pt.Operator.Equal,Pt.Operator.AddShorthand,Pt.Operator.SubtractShorthand,Pt.Operator.MultiplyShorthand,Pt.Operator.DivideShorthand,Ha.Operator.BitwiseAnd,Ha.Operator.BitwiseOr,Ha.Operator.LeftShift,Ha.Operator.RightShift,Ha.Operator.UnsignedRightShift,Pt.Operator.Assign,Pt.Operator.Reference].map(t=>({label:t,kind:24}))});var sx=m(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.activate=Mt.getDefaultCompletionList=Mt.getPropertyCompletionList=Mt.transformToCompletionItems=void 0;var rx=je(),TL=Ay(),ix=fo(),wL=ex(),EL=tx(),AL=nx(),xL=t=>{let e=[];for(let[n,r]of t)e.push({label:n,kind:(0,TL.getCompletionItemKind)(r.kind)});return e};Mt.transformToCompletionItems=xL;var kL=async(t,e)=>{let n=await t.lookupBasePath(e);return n===null?[]:(0,Mt.transformToCompletionItems)(n.getAllIdentifier())};Mt.getPropertyCompletionList=kL;var CL=()=>[...EL.AVAILABLE_KEYWORDS,...AL.AVAILABLE_OPERATORS,...wL.AVAILABLE_CONSTANTS];Mt.getDefaultCompletionList=CL;function OL(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 ix.LookupHelper(r.textDocument,t),s=i.lookupAST(e.position),o=[],a=!1;if(s){let{closest:l}=s;l instanceof rx.ASTMemberExpression?(o.push(...await(0,Mt.getPropertyCompletionList)(i,l)),a=!0):l instanceof rx.ASTIndexExpression?(o.push(...await(0,Mt.getPropertyCompletionList)(i,l)),a=!0):o.push(...(0,Mt.getDefaultCompletionList)())}else o.push(...(0,Mt.getDefaultCompletionList)()),o.push(...(0,Mt.transformToCompletionItems)(i.findAllAvailableIdentifierInRoot()));if(!s||a)return o;let u=new Set([...o.map(l=>l.label)]),c=await r.getImports();for(let l of c){let{document:d}=l;if(!d)continue;let p=new ix.LookupHelper(l.textDocument,t);o.push(...(0,Mt.transformToCompletionItems)(p.findAllAvailableIdentifier(d)).filter(y=>!u.has(y.label)).map(y=>(u.add(y.label),y)))}return o.push(...(0,Mt.transformToCompletionItems)(i.findAllAvailableIdentifierRelatedToPosition(s.closest)).filter(l=>!u.has(l.label))),o}),t.connection.onCompletionResolve(e=>e)}Mt.activate=OL});var ax=m((N5,ox)=>{"use strict";ox.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 Ry=m((q5,cx)=>{var Wa=ax(),ux={};for(let t of Object.keys(Wa))ux[Wa[t]]=t;var J={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"]}};cx.exports=J;for(let t of Object.keys(J)){if(!("channels"in J[t]))throw new Error("missing channels property: "+t);if(!("labels"in J[t]))throw new Error("missing channel labels property: "+t);if(J[t].labels.length!==J[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:n}=J[t];delete J[t].channels,delete J[t].labels,Object.defineProperty(J[t],"channels",{value:e}),Object.defineProperty(J[t],"labels",{value:n})}J.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]};J.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),d=function(p){return(c-p)/6/l+1/2};return l===0?(i=0,s=0):(s=l/c,e=d(o),n=d(a),r=d(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]};J.rgb.hwb=function(t){let e=t[0],n=t[1],r=t[2],i=J.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]};J.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 RL(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}J.rgb.keyword=function(t){let e=ux[t];if(e)return e;let n=1/0,r;for(let i of Object.keys(Wa)){let s=Wa[i],o=RL(t,s);o<n&&(n=o,r=i)}return r};J.keyword.rgb=function(t){return Wa[t]};J.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]};J.rgb.lab=function(t){let e=J.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]};J.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};J.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]};J.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]}};J.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]};J.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,d;switch(o){default:case 6:case 0:c=a,l=u,d=n;break;case 1:c=u,l=a,d=n;break;case 2:c=n,l=a,d=u;break;case 3:c=n,l=u,d=a;break;case 4:c=u,l=n,d=a;break;case 5:c=a,l=n,d=u;break}return[c*255,l*255,d*255]};J.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]};J.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]};J.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]};J.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]};J.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]};J.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]};J.rgb.ansi16=function(t,e=null){let[n,r,i]=t,s=e===null?J.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};J.hsv.ansi16=function(t){return J.rgb.ansi16(J.hsv.rgb(t),t[2])};J.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)};J.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]};J.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]};J.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};J.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]};J.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]};J.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]};J.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]};J.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]};J.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]};J.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]};J.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]};J.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]};J.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};J.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};J.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};J.gray.hsl=function(t){return[0,0,t[0]]};J.gray.hsv=J.gray.hsl;J.gray.hwb=function(t){return[0,100,t[0]]};J.gray.cmyk=function(t){return[0,0,0,t[0]]};J.gray.lab=function(t){return[t[0],0,0]};J.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};J.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var dx=m((j5,lx)=>{var id=Ry();function DL(){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 IL(t){let e=DL(),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 PL(t,e){return function(n){return e(t(n))}}function ML(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=PL(id[e[i].parent][i],r),i=e[i].parent;return r.conversion=n,r}lx.exports=function(t){let e=IL(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]=ML(o,e))}return n}});var px=m((F5,fx)=>{var Dy=Ry(),LL=dx(),ho={},NL=Object.keys(Dy);function qL(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 jL(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}NL.forEach(t=>{ho[t]={},Object.defineProperty(ho[t],"channels",{value:Dy[t].channels}),Object.defineProperty(ho[t],"labels",{value:Dy[t].labels});let e=LL(t);Object.keys(e).forEach(r=>{let i=e[r];ho[t][r]=jL(i),ho[t][r].raw=qL(i)})});fx.exports=ho});var mx=m(mo=>{"use strict";var FL=mo&&mo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(mo,"__esModule",{value:!0});mo.activate=void 0;var Iy=FL(px()),$L=je(),hx;(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"})(hx||(hx={}));var Py={black:"#000000",blue:"#0000FF",green:"#00FF00",orange:"#FF8800",purple:"#CC8899",red:"#FF0000",white:"#FFFFFF",yellow:"#FFFF00"},BL=()=>new RegExp(`(?:mark|color)=(${Object.keys(Py).join("|")}|(?:#[0-9a-f]{6}|#[0-9a-f]{3}))`,"ig"),UL=Object.prototype.hasOwnProperty;function HL(t){t.connection.onColorPresentation(e=>[{label:`#${Iy.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===$L.ASTType.StringLiteral),o=[],a=({match:u,markup:c,value:l,astPosition:d,lineIndex:p})=>{let y=u.index+c.indexOf("=")+1,v=y+l.length,x=d.line-1+p,I=y,P=v;return p===0&&(I+=d.character,P+=d.character),{start:{line:x,character:I},end:{line:x,character:P}}};for(let u=0;u<s.length;u++){let c=s[u];if(!c.start)continue;let l=c.start,d=c.value.toString().split(`
116
+ `);for(let p=0;p<d.length;p++){let y=d[p],v=BL(),x;for(;x=v.exec(y);){let[I,P]=x,w=a({match:x,markup:I,value:P,astPosition:l,lineIndex:p});if(P.startsWith("#")){let[E,_,j]=Iy.default.hex.rgb(P.slice(1));o.push({range:w,color:{red:E/255,green:_/255,blue:j/255,alpha:1}})}else if(UL.call(Py,P)){let[E,_,j]=Iy.default.hex.rgb(Py[P].slice(1));o.push({range:w,color:{red:E/255,green:_/255,blue:j/255,alpha:1}})}else o.push({range:w,color:{red:0,green:0,blue:0,alpha:1}})}}}return o})}mo.activate=HL});var bx=m(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});sd.activate=void 0;var WL=je(),gx=fo(),yx=(t,e,n)=>{let r=t.findAllAssignmentsOfItem(e,n),i=[];for(let s of r){if(!s.start||!s.end)continue;let o={line:s.start.line-1,character:s.start.character-1},a={line:s.end.line-1,character:s.end.character-1},u={targetUri:t.document.uri,targetRange:{start:o,end:a},targetSelectionRange:{start:o,end:a}};i.push(u)}return i};function GL(t){t.connection.onDefinition(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);if(n==null)return;let r=new gx.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;a&&a instanceof WL.ASTMemberExpression&&a.identifier===o&&(u=a);let c=yx(r,u,u.scope),l=await t.documentManager.get(n).getImports();for(let d of l){let{document:p,textDocument:y}=d;if(!p)continue;let v=new gx.LookupHelper(y,t),x=yx(v,u,p);c.push(...x)}return c})}sd.activate=GL});var _x=m(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0});od.activate=void 0;async function VL(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 zL(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 VL(n,t);return r.length===0?{kind:"full",items:[]}:{kind:"full",items:r}})}od.activate=zL});var vx=m(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});ad.getStringHashCode=void 0;ad.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 Tx=m(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0});ld.createExpressionHash=void 0;var ud=je(),Sx=vx(),cd=(t,e)=>t.$$hash=e,KL=t=>{var e;return(e=t.$$hash)!==null&&e!==void 0?e:null};function go(t){let e=KL(t);if(e!==null)return e;let n=(0,Sx.getStringHashCode)(t.type);switch(t.type){case ud.ASTType.ParenthesisExpression:return go(t.expression);case ud.ASTType.MemberExpression:{let r=t;return n^=go(r.base),n^=go(r.identifier),cd(t,n)}case ud.ASTType.IndexExpression:{let r=t;return n^=go(r.base),n^=go(r.index),cd(t,n)}case ud.ASTType.Identifier:{let r=t;return n^=(0,Sx.getStringHashCode)(r.name),cd(t,n)}}return cd(t,n)}function XL(t){return go(t)}ld.createExpressionHash=XL});var dd=m(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.hasEmptyBody=kt.containsMultilineItemInShortcutClauses=kt.getLastComment=kt.unwrap=kt.transformBitOperation=kt.countRightBinaryExpressions=kt.SHORTHAND_OPERATORS=void 0;var pn=je();kt.SHORTHAND_OPERATORS=[pn.Operator.Plus,pn.Operator.Minus,pn.Operator.Asterik,pn.Operator.Slash,pn.Operator.Modulo,pn.Operator.Power];var YL=t=>{if(t=(0,kt.unwrap)(t),t instanceof pn.ASTComparisonGroupExpression)return t.expressions.length;let e=[t],n=0;for(;e.length>0;){let r=e.pop();r instanceof pn.ASTBinaryExpression&&n++,(r instanceof pn.ASTBinaryExpression||r instanceof pn.ASTLogicalExpression||r instanceof pn.ASTIsaExpression)&&(e.push((0,kt.unwrap)(r.left)),e.push((0,kt.unwrap)(r.right)))}return n};kt.countRightBinaryExpressions=YL;var JL=(t,e,n,r)=>{if(r==="|")return"bitOr("+[e,n].join(", ")+")";if(r==="&")return"bitAnd("+[e,n].join(", ")+")";if(r==="<<"||r===">>"||r===">>>")throw new Error("Operators in binary expression are not supported");return t};kt.transformBitOperation=JL;var QL=t=>{for(;t instanceof pn.ASTParenthesisExpression;)t=t.expression;return t};kt.unwrap=QL;var ZL=t=>{for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.type===pn.ASTType.Comment)return n}return null};kt.getLastComment=ZL;var eN=(t,e)=>e.some(n=>t.line<n.body[0].end.line);kt.containsMultilineItemInShortcutClauses=eN;var tN=t=>!t.some(e=>!(e instanceof pn.ASTComment));kt.hasEmptyBody=tN});var Ly=m(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.BeautifyContext=os.IndentationType=void 0;var ss=je(),nN=dd(),wx;(function(t){t[t.Tab=0]="Tab",t[t.Whitespace=1]="Whitespace"})(wx=os.IndentationType||(os.IndentationType={}));var My=class{get indent(){return this._indent}get isMultilineAllowed(){return this._isMultilineAllowed}constructor(e,n){this.transformer=e,this.options=n,this._indent=0,this._isMultilineAllowed=!0,this.chunks=[],this.usedComments=new Set,this.putIndent=n.indentation===wx.Tab?(r,i=0)=>`${" ".repeat(this._indent+i)}${r}`:(r,i=0)=>`${" ".repeat(n.indentationSpaces).repeat(this._indent+i)}${r}`}pushLines(e){this.chunks.push(e)}popLines(){return this.chunks.pop()}getLines(){return this.chunks[this.chunks.length-1]}useComment(e,n=" "){let r=this.getLines()[e.line];if(r==null)return"";let i=(0,nN.getLastComment)(r);return i!=null&&!this.usedComments.has(i)?(this.usedComments.add(i),n+this.transformer.make(i)):""}appendComment(e,n){return n+this.useComment(e)}disableMultiline(){this._isMultilineAllowed=!1}enableMultiline(){this._isMultilineAllowed=!0}incIndent(){this._indent++}decIndent(){this._indent--}getBlockOpenerEndLine(e){return e instanceof ss.ASTIfClause||e instanceof ss.ASTWhileStatement?e.condition.end.line:e instanceof ss.ASTForGenericStatement?e.iterator.end.line:e.start.line}getPreviousEndLine(e){if(e==null)return 0;if(e.type===ss.ASTType.IfShortcutStatement){let n=e;return n.clauses[n.clauses.length-1].body[0].end.line}return e.end.line}buildBlock(e){var n;if(e.body.length===0)return[];let r=[...e.body].sort((u,c)=>u.start.line-c.start.line),i=[],s=null;for(let u=0;u<r.length;u++){let c=r[u],l=(n=r[u+1])!==null&&n!==void 0?n:null;if(c.type!==ss.ASTType.Comment&&s?.end.line===c.start.line){let p=this.transformer.make(c,{isCommand:!0});i.push(this.putIndent(this.appendComment(c.end,p))),s=c;continue}if(this.usedComments.has(c)){c.isMultiline&&(s=c);continue}if(c.type===ss.ASTType.Comment&&c.start.line===l?.start.line)continue;let d=Math.max(s?c.start.line-this.getPreviousEndLine(s)-1:c.start.line-this.getBlockOpenerEndLine(e)-1,0);if(d>0&&i.push(...new Array(d).fill("")),c instanceof ss.ASTComment){this.usedComments.add(c);let p=this.transformer.make(c,{isCommand:!0});i.push(this.putIndent(p))}else{let p=this.transformer.make(c,{isCommand:!0});i.push(this.putIndent(this.appendComment(c.end,p)))}s=c}let o=e.body[e.body.length-1],a=Math.max(e.end.line-this.getPreviousEndLine(o)-1,0);return a>0&&i.push(...new Array(a).fill("")),i}};os.BeautifyContext=My});var Ny=m(fd=>{"use strict";Object.defineProperty(fd,"__esModule",{value:!0});fd.beautifyFactory=void 0;var Ga=je(),rN=require("path"),Ex=Tx(),Ax=Ly(),nn=dd(),iN=t=>{let{keepParentheses:e=!1,indentation:n=Ax.IndentationType.Tab,indentationSpaces:r=2,isDevMode:i=!1}=t.buildOptions,s=new Ax.BeautifyContext(t,{keepParentheses:e,indentation:n,indentationSpaces:r,isDevMode:i});return{ParenthesisExpression:(o,a)=>"("+t.make(o.expression,{hasLogicalIndentActive:a.hasLogicalIndentActive})+")",Comment:(o,a)=>o.isMultiline?i?`/*${o.value}*/`:o.value.split(`
117
117
  `).map(u=>`//${u}`).join(`
118
118
  `):"// "+o.value.trimStart(),AssignmentStatement:(o,a)=>{let u=o.variable,c=o.init,l=t.make(u);if((u instanceof Ga.ASTIdentifier||u instanceof Ga.ASTMemberExpression)&&c instanceof Ga.ASTBinaryExpression&&(c.left instanceof Ga.ASTIdentifier||c.left instanceof Ga.ASTMemberExpression)&&nn.SHORTHAND_OPERATORS.includes(c.operator)&&(0,Ex.createExpressionHash)(u)===(0,Ex.createExpressionHash)(c.left)){let p=t.make((0,nn.unwrap)(c.right));return l+" "+c.operator+"= "+p}let d=t.make(c);return l+" = "+d},MemberExpression:(o,a)=>{let u=t.make(o.identifier);return[t.make(o.base),u].join(o.indexer)},FunctionDeclaration:(o,a)=>{s.disableMultiline();let u=o.parameters.map(p=>t.make(p));s.enableMultiline();let c=s.appendComment(o.start,u.length===0?"function":"function("+u.join(", ")+")"),l=s.putIndent("end function");if((0,nn.hasEmptyBody)(o.body))return c+`
119
119
  `+l;s.incIndent();let d=s.buildBlock(o);return s.decIndent(),c+`
@@ -146,7 +146,7 @@ ${e}`;for(let a=0;a<this.details.length;++a){let u=a+1;o=`${o}
146
146
  `)+`
147
147
  `+v}let p=s.putIndent("]"+u),y="[";for(d of o.fields)l.push(t.make(d));return y+" "+l.join(", ")+" "+p},ListValue:(o,a)=>t.make(o.value),BooleanLiteral:(o,a)=>(o.negated?"-":"")+o.raw.toString(),EmptyExpression:(o,a)=>"",IsaExpression:(o,a)=>{let u=t.make(o.left,{hasLogicalIndentActive:a.hasLogicalIndentActive}),c=t.make(o.right,{hasLogicalIndentActive:a.hasLogicalIndentActive});return u+" "+o.operator+" "+c},LogicalExpression:(o,a)=>{if((0,nn.countRightBinaryExpressions)(o.right)>2){a.hasLogicalIndentActive||s.incIndent();let d=t.make(o.left,{hasLogicalIndentActive:!0}),p=t.make(o.right,{hasLogicalIndentActive:!0}),y=o.operator,v=d+" "+y+`
148
148
  `+s.putIndent(p);return a.hasLogicalIndentActive||s.decIndent(),v}let c=t.make(o.left,{hasLogicalIndentActive:a.hasLogicalIndentActive}),l=t.make(o.right,{hasLogicalIndentActive:a.hasLogicalIndentActive});return c+" "+o.operator+" "+l},BinaryExpression:(o,a)=>{let u=t.make(o.left,{hasLogicalIndentActive:a.hasLogicalIndentActive}),c=t.make(o.right,{hasLogicalIndentActive:a.hasLogicalIndentActive}),l=o.operator;return(0,nn.transformBitOperation)(u+" "+l+" "+c,u,c,l)},BinaryNegatedExpression:(o,a)=>{let u=t.make(o.argument);return o.operator+u},ComparisonGroupExpression:(o,a)=>{let u=o.expressions.map(l=>t.make(l)),c=[u[0]];for(let l=0;l<o.operators.length;l++)c.push(o.operators[l],u[l+1]);return c.join(" ")},Chunk:(o,a)=>{s.pushLines(o.lines);let u=s.buildBlock(o).join(`
149
- `);return s.popLines(),u}}};fd.beautifyFactory=iN});var jy=m(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});pd.defaultFactory=void 0;var sN=require("path"),oN=t=>{let{isDevMode:e=!1}=t.buildOptions;return{ParenthesisExpression:(n,r)=>"("+t.make(n.expression)+")",Comment:(n,r)=>n.isMultiline?n.value.split(`
149
+ `);return s.popLines(),u}}};fd.beautifyFactory=iN});var qy=m(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});pd.defaultFactory=void 0;var sN=require("path"),oN=t=>{let{isDevMode:e=!1}=t.buildOptions;return{ParenthesisExpression:(n,r)=>"("+t.make(n.expression)+")",Comment:(n,r)=>n.isMultiline?n.value.split(`
150
150
  `).map(i=>`//${i}`).join(`
151
151
  `):"//"+n.value,AssignmentStatement:(n,r)=>{let i=n.variable,s=n.init,o=t.make(i),a=t.make(s);return o+"="+a},MemberExpression:(n,r)=>{let i=t.make(n.identifier);return[t.make(n.base),i].join(n.indexer)},FunctionDeclaration:(n,r)=>{let i=[],s=[],o,a;for(o of n.parameters)i.push(t.make(o));for(a of n.body){let u=t.make(a);u!==""&&s.push(u)}return"function("+i.join(",")+`)
152
152
  `+s.join(`
@@ -171,7 +171,7 @@ end if`},IfClause:(n,r)=>{let i=t.make(n.condition),s=[],o;for(o of n.body){let
171
171
  `)},ElseClause:(n,r)=>{let i=[],s;for(s of n.body){let o=t.make(s);o!==""&&i.push(o)}return`else
172
172
  `+i.join(`
173
173
  `)},ContinueStatement:(n,r)=>"continue",BreakStatement:(n,r)=>"break",CallStatement:(n,r)=>t.make(n.expression),FeatureInjectExpression:(n,r)=>{if(e)return`#inject "${n.path}";`;if(t.currentDependency===null)return`#inject "${n.path}";`;let i=t.currentDependency.injections.get(n.path);return i==null?"null":`"${i.replace(/"/g,'""')}"`},FeatureImportExpression:(n,r)=>e||!n.chunk?"#import "+t.make(n.name)+' from "'+n.path+'";':t.make(n.name)+' = __REQUIRE("'+n.namespace+'")',FeatureIncludeExpression:(n,r)=>e||!n.chunk?'#include "'+n.path+'";':t.make(n.chunk),FeatureDebuggerExpression:(n,r)=>e?"debugger":"//debugger",FeatureLineExpression:(n,r)=>e?"#line":`${n.start.line}`,FeatureFileExpression:(n,r)=>e?"#filename":`"${(0,sN.basename)(n.filename).replace(/"/g,'"')}"`,ListConstructorExpression:(n,r)=>{let i=[],s;for(s of n.fields)i.push(t.make(s));return"["+i.join(",")+"]"},ListValue:(n,r)=>t.make(n.value),BooleanLiteral:(n,r)=>(n.negated?"-":"")+n.raw.toString(),EmptyExpression:(n,r)=>"",IsaExpression:(n,r)=>{let i=t.make(n.left),s=t.make(n.right);return i+" "+n.operator+" "+s},LogicalExpression:(n,r)=>{let i=t.make(n.left),s=t.make(n.right);return i+" "+n.operator+" "+s},BinaryExpression:(n,r)=>{let i=t.make(n.left),s=t.make(n.right),o=n.operator,a=i+o+s;if(o==="|")a="bitOr("+[i,s].join(",")+")";else if(o==="&")a="bitAnd("+[i,s].join(",")+")";else if(o==="<<"||o===">>"||o===">>>")throw new Error("Operators in binary expression are not supported");return a},BinaryNegatedExpression:(n,r)=>{let i=t.make(n.argument);return n.operator+i},ComparisonGroupExpression:(n,r)=>{let i=n.expressions.map(o=>t.make(o)),s=[i[0]];for(let o=0;o<n.operators.length;o++)s.push(n.operators[o],i[o+1]);return s.join(" ")},Chunk:(n,r)=>{let i=[],s;for(s of n.body){let o=t.make(s);o!==""&&i.push(o)}return i.join(`
174
- `)}}};pd.defaultFactory=oN});var Fy=m(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0});hd.uglifyFactory=void 0;var aN=require("path"),uN=t=>{let{isDevMode:e=!1}=t.buildOptions;return{ParenthesisExpression:(n,r)=>"("+t.make(n.expression)+")",Comment:(n,r)=>"",AssignmentStatement:(n,r)=>{let i=n.variable,s=n.init,o=t.make(i),a=t.make(s,r);return o+"="+a},MemberExpression:(n,r)=>{let i=n.identifier,s=t.make(n.base),o=t.context.variables.get("globals"),a=t.make(i,{usesNativeVar:s===o||s==="locals"||s==="outer",isMember:!0});return[s,a].join(n.indexer)},FunctionDeclaration:(n,r)=>{let i=[],s=[],o,a;for(o of n.parameters)i.push(t.make(o,{isArgument:!0}));for(a of n.body){let u=t.make(a);u!==""&&s.push(u)}return i.length===0?`function
174
+ `)}}};pd.defaultFactory=oN});var jy=m(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0});hd.uglifyFactory=void 0;var aN=require("path"),uN=t=>{let{isDevMode:e=!1}=t.buildOptions;return{ParenthesisExpression:(n,r)=>"("+t.make(n.expression)+")",Comment:(n,r)=>"",AssignmentStatement:(n,r)=>{let i=n.variable,s=n.init,o=t.make(i),a=t.make(s,r);return o+"="+a},MemberExpression:(n,r)=>{let i=n.identifier,s=t.make(n.base),o=t.context.variables.get("globals"),a=t.make(i,{usesNativeVar:s===o||s==="locals"||s==="outer",isMember:!0});return[s,a].join(n.indexer)},FunctionDeclaration:(n,r)=>{let i=[],s=[],o,a;for(o of n.parameters)i.push(t.make(o,{isArgument:!0}));for(a of n.body){let u=t.make(a);u!==""&&s.push(u)}return i.length===0?`function
175
175
  `+s.join(`
176
176
  `)+`
177
177
  end function`:"function("+i.join(",")+`)
@@ -197,7 +197,7 @@ end if`},IfClause:(n,r)=>{let i=t.make(n.condition),s=[],o;for(o of n.body){let
197
197
  `)},ElseClause:(n,r)=>{let i=[],s;for(s of n.body){let o=t.make(s);o!==""&&i.push(o)}return`else
198
198
  `+i.join(`
199
199
  `)},ContinueStatement:(n,r)=>"continue",BreakStatement:(n,r)=>"break",CallStatement:(n,r)=>t.make(n.expression),FeatureInjectExpression:(n,r)=>{if(e)return`#inject "${n.path}";`;if(t.currentDependency===null)return`#inject "${n.path}";`;let i=t.currentDependency.injections.get(n.path);return i==null?"null":`"${i.replace(/"/g,'""')}"`},FeatureImportExpression:(n,r)=>{if(e||!n.chunk)return"#import "+t.make(n.name)+' from "'+n.path+'";';let i=t.context.variables.get("__REQUIRE");return t.make(n.name)+"="+i+'("'+n.namespace+'")'},FeatureIncludeExpression:(n,r)=>e||!n.chunk?'#include "'+n.path+'";':t.make(n.chunk),ListConstructorExpression:(n,r)=>{let i=[],s;for(s of n.fields)i.push(t.make(s));return"["+i.join(",")+"]"},ListValue:(n,r)=>t.make(n.value),BooleanLiteral:(n,{isArgument:r=!1})=>{let i=t.context.literals.get(n);return!r&&i!=null&&i.namespace!=null?i.namespace:(n.negated?"-":"")+n.raw.toString()},EmptyExpression:(n,r)=>"",IsaExpression:(n,r)=>{let i=t.make(n.left),s=t.make(n.right);return i+" "+n.operator+" "+s},LogicalExpression:(n,r)=>{let i=t.make(n.left),s=t.make(n.right);return i+" "+n.operator+" "+s},BinaryExpression:(n,r)=>{let i=t.make(n.left),s=t.make(n.right),o=n.operator,a=i+o+s;if(o==="|")a="bitOr("+[i,s].join(",")+")";else if(o==="&")a="bitAnd("+[i,s].join(",")+")";else if(o==="<<"||o===">>"||o===">>>")throw new Error("Operators in binary expression are not supported");return a},BinaryNegatedExpression:(n,r)=>{let i=t.make(n.argument);return n.operator+i},ComparisonGroupExpression:(n,r)=>{let i=n.expressions.map(o=>t.make(o)),s=[i[0]];for(let o=0;o<n.operators.length;o++)s.push(n.operators[o],i[o+1]);return s.join("")},Chunk:(n,r)=>{let i=[],s;for(s of n.body){let o=t.make(s);o!==""&&i.push(o)}return i.join(`
200
- `)}}};hd.uglifyFactory=uN});var md=m(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.getFactory=as.BuildType=void 0;var cN=qy(),lN=jy(),dN=Fy(),Va;(function(t){t[t.DEFAULT=0]="DEFAULT",t[t.UGLIFY=1]="UGLIFY",t[t.BEAUTIFY=2]="BEAUTIFY"})(Va=as.BuildType||(as.BuildType={}));var fN={[Va.DEFAULT]:lN.defaultFactory,[Va.UGLIFY]:dN.uglifyFactory,[Va.BEAUTIFY]:cN.beautifyFactory};function pN(t=Va.DEFAULT){let e=fN[t];if(!e)throw new Error("Unknown build type.");return e}as.getFactory=pN});var $y=m((xx,gd)=>{(function(t){"use strict";function e(_,j){var O=(_&65535)+(j&65535),H=(_>>16)+(j>>16)+(O>>16);return H<<16|O&65535}function n(_,j){return _<<j|_>>>32-j}function r(_,j,O,H,re,fe){return e(n(e(e(j,_),e(H,fe)),re),O)}function i(_,j,O,H,re,fe,U){return r(j&O|~j&H,_,j,re,fe,U)}function s(_,j,O,H,re,fe,U){return r(j&H|O&~H,_,j,re,fe,U)}function o(_,j,O,H,re,fe,U){return r(j^O^H,_,j,re,fe,U)}function a(_,j,O,H,re,fe,U){return r(O^(j|~H),_,j,re,fe,U)}function u(_,j){_[j>>5]|=128<<j%32,_[(j+64>>>9<<4)+14]=j;var O,H,re,fe,U,k=1732584193,M=-271733879,L=-1732584194,q=271733878;for(O=0;O<_.length;O+=16)H=k,re=M,fe=L,U=q,k=i(k,M,L,q,_[O],7,-680876936),q=i(q,k,M,L,_[O+1],12,-389564586),L=i(L,q,k,M,_[O+2],17,606105819),M=i(M,L,q,k,_[O+3],22,-1044525330),k=i(k,M,L,q,_[O+4],7,-176418897),q=i(q,k,M,L,_[O+5],12,1200080426),L=i(L,q,k,M,_[O+6],17,-1473231341),M=i(M,L,q,k,_[O+7],22,-45705983),k=i(k,M,L,q,_[O+8],7,1770035416),q=i(q,k,M,L,_[O+9],12,-1958414417),L=i(L,q,k,M,_[O+10],17,-42063),M=i(M,L,q,k,_[O+11],22,-1990404162),k=i(k,M,L,q,_[O+12],7,1804603682),q=i(q,k,M,L,_[O+13],12,-40341101),L=i(L,q,k,M,_[O+14],17,-1502002290),M=i(M,L,q,k,_[O+15],22,1236535329),k=s(k,M,L,q,_[O+1],5,-165796510),q=s(q,k,M,L,_[O+6],9,-1069501632),L=s(L,q,k,M,_[O+11],14,643717713),M=s(M,L,q,k,_[O],20,-373897302),k=s(k,M,L,q,_[O+5],5,-701558691),q=s(q,k,M,L,_[O+10],9,38016083),L=s(L,q,k,M,_[O+15],14,-660478335),M=s(M,L,q,k,_[O+4],20,-405537848),k=s(k,M,L,q,_[O+9],5,568446438),q=s(q,k,M,L,_[O+14],9,-1019803690),L=s(L,q,k,M,_[O+3],14,-187363961),M=s(M,L,q,k,_[O+8],20,1163531501),k=s(k,M,L,q,_[O+13],5,-1444681467),q=s(q,k,M,L,_[O+2],9,-51403784),L=s(L,q,k,M,_[O+7],14,1735328473),M=s(M,L,q,k,_[O+12],20,-1926607734),k=o(k,M,L,q,_[O+5],4,-378558),q=o(q,k,M,L,_[O+8],11,-2022574463),L=o(L,q,k,M,_[O+11],16,1839030562),M=o(M,L,q,k,_[O+14],23,-35309556),k=o(k,M,L,q,_[O+1],4,-1530992060),q=o(q,k,M,L,_[O+4],11,1272893353),L=o(L,q,k,M,_[O+7],16,-155497632),M=o(M,L,q,k,_[O+10],23,-1094730640),k=o(k,M,L,q,_[O+13],4,681279174),q=o(q,k,M,L,_[O],11,-358537222),L=o(L,q,k,M,_[O+3],16,-722521979),M=o(M,L,q,k,_[O+6],23,76029189),k=o(k,M,L,q,_[O+9],4,-640364487),q=o(q,k,M,L,_[O+12],11,-421815835),L=o(L,q,k,M,_[O+15],16,530742520),M=o(M,L,q,k,_[O+2],23,-995338651),k=a(k,M,L,q,_[O],6,-198630844),q=a(q,k,M,L,_[O+7],10,1126891415),L=a(L,q,k,M,_[O+14],15,-1416354905),M=a(M,L,q,k,_[O+5],21,-57434055),k=a(k,M,L,q,_[O+12],6,1700485571),q=a(q,k,M,L,_[O+3],10,-1894986606),L=a(L,q,k,M,_[O+10],15,-1051523),M=a(M,L,q,k,_[O+1],21,-2054922799),k=a(k,M,L,q,_[O+8],6,1873313359),q=a(q,k,M,L,_[O+15],10,-30611744),L=a(L,q,k,M,_[O+6],15,-1560198380),M=a(M,L,q,k,_[O+13],21,1309151649),k=a(k,M,L,q,_[O+4],6,-145523070),q=a(q,k,M,L,_[O+11],10,-1120210379),L=a(L,q,k,M,_[O+2],15,718787259),M=a(M,L,q,k,_[O+9],21,-343485551),k=e(k,H),M=e(M,re),L=e(L,fe),q=e(q,U);return[k,M,L,q]}function c(_){var j,O="",H=_.length*32;for(j=0;j<H;j+=8)O+=String.fromCharCode(_[j>>5]>>>j%32&255);return O}function l(_){var j,O=[];for(O[(_.length>>2)-1]=void 0,j=0;j<O.length;j+=1)O[j]=0;var H=_.length*8;for(j=0;j<H;j+=8)O[j>>5]|=(_.charCodeAt(j/8)&255)<<j%32;return O}function d(_){return c(u(l(_),_.length*8))}function p(_,j){var O,H=l(_),re=[],fe=[],U;for(re[15]=fe[15]=void 0,H.length>16&&(H=u(H,_.length*8)),O=0;O<16;O+=1)re[O]=H[O]^909522486,fe[O]=H[O]^1549556828;return U=u(re.concat(l(j)),512+j.length*8),c(u(fe.concat(U),640))}function y(_){var j="0123456789abcdef",O="",H,re;for(re=0;re<_.length;re+=1)H=_.charCodeAt(re),O+=j.charAt(H>>>4&15)+j.charAt(H&15);return O}function v(_){return unescape(encodeURIComponent(_))}function x(_){return d(v(_))}function I(_){return y(x(_))}function P(_,j){return p(v(_),v(j))}function w(_,j){return y(P(_,j))}function E(_,j,O){return j?O?P(j,_):w(j,_):O?x(_):I(_)}typeof define=="function"&&define.amd?define(function(){return E}):typeof gd=="object"&&gd.exports?gd.exports=E:t.md5=E})(xx)});var Uy=m(yo=>{"use strict";var hN=yo&&yo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(yo,"__esModule",{value:!0});yo.LiteralsMapper=void 0;var mN=hN($y()),By=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=e.raw.toString();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,mN.default)(r)))}return n}get(e){let n=this,r=e.raw.toString();return n.mapping.has(r)?n.mapping.get(r):null}getMapping(){return this.mapping}};yo.LiteralsMapper=By});var Wy=m(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:!0});yd.NamespaceGenerator=void 0;var Hy=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.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}};yd.NamespaceGenerator=Hy});var za=m(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.Context=us.ContextDataProperty=void 0;var gN=Uy(),kx=Wy(),yN;(function(t){t.ResourceDependencyMap="resourceDependencyMap",t.DependencyCallStack="dependencyCallStack"})(yN=us.ContextDataProperty||(us.ContextDataProperty={}));var Gy=class{constructor(e){let n=this;n.modules=new kx.NamespaceGenerator({characters:e.modulesCharset}),n.variables=new kx.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",...e.variablesExcluded||[]]}),n.literals=new gN.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)}};us.Context=Gy});var Vy=m(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});Ka.DependencyType=void 0;var bN;(function(t){t[t.Main=0]="Main",t[t.Import=1]="Import",t[t.Include=2]="Include"})(bN=Ka.DependencyType||(Ka.DependencyType={}))});var _d=m(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});bd.BuildError=void 0;var zy=class extends Error{constructor(e,n){super(e),this.target=n.target,this.range=n.range}};bd.BuildError=zy});var Sd=m(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.fetchNamespaces=void 0;function _N(t){let e=new Set(t.namespaces);return t.scopes.reduce((n,r)=>(r.namespaces.forEach(i=>e.add(i)),n),e),Array.from(e)}vd.fetchNamespaces=_N});var Jy=m(wi=>{"use strict";var Ky=wi&&wi.__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(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})},Dx=wi&&wi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(wi,"__esModule",{value:!0});wi.Dependency=void 0;var Cx=Dx($y()),vN=Dx(require("events")),Ox=Fr(),Td=za(),Xy=Vy(),Rx=_d(),SN=Sd(),Yy=class t extends vN.default{constructor(e){super();let n=this;n.target=e.target,n.id=(0,Cx.default)(e.target),n.resourceHandler=e.resourceHandler,n.chunk=e.chunk,n.dependencies=new Set,n.injections=new Map,n.type=e.type||Xy.DependencyType.Main,n.context=e.context,n.ref=e.ref;let r=n.context.createModuleNamespace(n.id);n.context.getOrCreateData(Td.ContextDataProperty.ResourceDependencyMap,()=>new Map).set(r,n),n.context.getOrCreateData(Td.ContextDataProperty.DependencyCallStack,()=>[])}getId(){return this.id}getNamespace(){let e=this;return e.context.modules.get(e.id)}resolve(e,n,r){return Ky(this,void 0,void 0,function*(){let i=this,s=i.context,{modules:o}=s,a=s.get(Td.ContextDataProperty.ResourceDependencyMap),u=i.resourceHandler,c=yield u.getTargetRelativeTo(i.target,e),l=(0,Cx.default)(c),d=o.get(l);if(a.has(d))return a.get(d);if(!(yield u.has(c)))throw new Error("Dependency "+c+" does not exist...");let p=yield u.get(c);i.emit("parse-before",c);try{let v=new Ox.Parser(p,{filename:c}).parseChunk(),x=new t({target:c,resourceHandler:u,chunk:v,type:n,context:s,ref:r});return i.emit("parse-after",x),x}catch(y){throw y instanceof Rx.BuildError?y:new Rx.BuildError(y.message,{target:c,range:y.range})}})}findInjections(){return Ky(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 Ky(this,void 0,void 0,function*(){let e=this,{imports:n,includes:r}=e.chunk,i=e.getNamespace(),s=e.context.get(Td.ContextDataProperty.DependencyCallStack),o=[...(0,SN.fetchNamespaces)(e.chunk)],a=[...e.chunk.literals],u=[];s.push(i);let c=[...n,...r];for(let d of c){let p=d instanceof Ox.ASTFeatureIncludeExpression?Xy.DependencyType.Include:Xy.DependencyType.Import,y=yield e.resolve(d.path,p,d),v=y.getNamespace();if(s.includes(v))throw new Error(`Circular dependency from ${e.target} to ${y.target} detected.`);let x=y.chunk;d.chunk=x,d.namespace=v;let I=yield y.findDependencies();o.push(...I.namespaces),a.push(...I.literals),u.push(y)}yield this.findInjections();let l=new Set(u);return e.dependencies=l,s.pop(),{dependencies:l,namespaces:o,literals:a}})}};wi.Dependency=Yy});var Zy=m(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0});wd.Stack=void 0;var Qy=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}};wd.Stack=Qy});var Ad=m(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});Ed.Transformer=void 0;var TN=Zy(),eb=class{get buildOptions(){return this._buildOptions}get currentStack(){return this._currentStack}get currentDependency(){return this._currentDependency}get context(){return this._context}get environmentVariables(){return this._environmentVariables}get buildMap(){return this._buildMap}get resourceHandler(){return this._resourceHandler}constructor({buildOptions:e,mapFactory:n,context:r,environmentVariables:i,resourceHandler:s}){let o=this;o._buildOptions=e,o._context=r,o._environmentVariables=i,o._buildMap=n(o),o._resourceHandler=s??null,o._currentDependency=null,o._currentStack=new TN.Stack}make(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._buildMap[e.type];if(s==null)throw console.error("Error AST:",e),new Error("Type does not exist "+e.type);i.push(e);let o=s(e,n);return i.pop(),o}transform(e,n=null){let r=this;if(e.type!=="Chunk")throw new Error("Expects chunk");return r._currentDependency=n,r.make(e)}};Ed.Transformer=eb});var Cd=m(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});kd.generateCharsetMap=void 0;function xd(t,e){let n="";for(;t<=e;)n=n+String.fromCharCode(t),t=t+1;return n}function wN(t=!1){let e=xd(65,90),n=xd(97,122),r=xd(48,57),i="_";return t&&(i=i+xd(1e3,2e3)),{variables:e+n+i,modules:e+n+r+i}}kd.generateCharsetMap=wN});var nb=m(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.MAIN_BOILERPLATE=Ei.MODULE_BOILERPLATE=Ei.HEADER_BOILERPLATE=void 0;var tb=Fr();Ei.HEADER_BOILERPLATE=new tb.Parser(`MODULES={}
200
+ `)}}};hd.uglifyFactory=uN});var md=m(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.getFactory=as.BuildType=void 0;var cN=Ny(),lN=qy(),dN=jy(),Va;(function(t){t[t.DEFAULT=0]="DEFAULT",t[t.UGLIFY=1]="UGLIFY",t[t.BEAUTIFY=2]="BEAUTIFY"})(Va=as.BuildType||(as.BuildType={}));var fN={[Va.DEFAULT]:lN.defaultFactory,[Va.UGLIFY]:dN.uglifyFactory,[Va.BEAUTIFY]:cN.beautifyFactory};function pN(t=Va.DEFAULT){let e=fN[t];if(!e)throw new Error("Unknown build type.");return e}as.getFactory=pN});var Fy=m((xx,gd)=>{(function(t){"use strict";function e(_,j){var O=(_&65535)+(j&65535),H=(_>>16)+(j>>16)+(O>>16);return H<<16|O&65535}function n(_,j){return _<<j|_>>>32-j}function r(_,j,O,H,re,fe){return e(n(e(e(j,_),e(H,fe)),re),O)}function i(_,j,O,H,re,fe,U){return r(j&O|~j&H,_,j,re,fe,U)}function s(_,j,O,H,re,fe,U){return r(j&H|O&~H,_,j,re,fe,U)}function o(_,j,O,H,re,fe,U){return r(j^O^H,_,j,re,fe,U)}function a(_,j,O,H,re,fe,U){return r(O^(j|~H),_,j,re,fe,U)}function u(_,j){_[j>>5]|=128<<j%32,_[(j+64>>>9<<4)+14]=j;var O,H,re,fe,U,k=1732584193,M=-271733879,L=-1732584194,q=271733878;for(O=0;O<_.length;O+=16)H=k,re=M,fe=L,U=q,k=i(k,M,L,q,_[O],7,-680876936),q=i(q,k,M,L,_[O+1],12,-389564586),L=i(L,q,k,M,_[O+2],17,606105819),M=i(M,L,q,k,_[O+3],22,-1044525330),k=i(k,M,L,q,_[O+4],7,-176418897),q=i(q,k,M,L,_[O+5],12,1200080426),L=i(L,q,k,M,_[O+6],17,-1473231341),M=i(M,L,q,k,_[O+7],22,-45705983),k=i(k,M,L,q,_[O+8],7,1770035416),q=i(q,k,M,L,_[O+9],12,-1958414417),L=i(L,q,k,M,_[O+10],17,-42063),M=i(M,L,q,k,_[O+11],22,-1990404162),k=i(k,M,L,q,_[O+12],7,1804603682),q=i(q,k,M,L,_[O+13],12,-40341101),L=i(L,q,k,M,_[O+14],17,-1502002290),M=i(M,L,q,k,_[O+15],22,1236535329),k=s(k,M,L,q,_[O+1],5,-165796510),q=s(q,k,M,L,_[O+6],9,-1069501632),L=s(L,q,k,M,_[O+11],14,643717713),M=s(M,L,q,k,_[O],20,-373897302),k=s(k,M,L,q,_[O+5],5,-701558691),q=s(q,k,M,L,_[O+10],9,38016083),L=s(L,q,k,M,_[O+15],14,-660478335),M=s(M,L,q,k,_[O+4],20,-405537848),k=s(k,M,L,q,_[O+9],5,568446438),q=s(q,k,M,L,_[O+14],9,-1019803690),L=s(L,q,k,M,_[O+3],14,-187363961),M=s(M,L,q,k,_[O+8],20,1163531501),k=s(k,M,L,q,_[O+13],5,-1444681467),q=s(q,k,M,L,_[O+2],9,-51403784),L=s(L,q,k,M,_[O+7],14,1735328473),M=s(M,L,q,k,_[O+12],20,-1926607734),k=o(k,M,L,q,_[O+5],4,-378558),q=o(q,k,M,L,_[O+8],11,-2022574463),L=o(L,q,k,M,_[O+11],16,1839030562),M=o(M,L,q,k,_[O+14],23,-35309556),k=o(k,M,L,q,_[O+1],4,-1530992060),q=o(q,k,M,L,_[O+4],11,1272893353),L=o(L,q,k,M,_[O+7],16,-155497632),M=o(M,L,q,k,_[O+10],23,-1094730640),k=o(k,M,L,q,_[O+13],4,681279174),q=o(q,k,M,L,_[O],11,-358537222),L=o(L,q,k,M,_[O+3],16,-722521979),M=o(M,L,q,k,_[O+6],23,76029189),k=o(k,M,L,q,_[O+9],4,-640364487),q=o(q,k,M,L,_[O+12],11,-421815835),L=o(L,q,k,M,_[O+15],16,530742520),M=o(M,L,q,k,_[O+2],23,-995338651),k=a(k,M,L,q,_[O],6,-198630844),q=a(q,k,M,L,_[O+7],10,1126891415),L=a(L,q,k,M,_[O+14],15,-1416354905),M=a(M,L,q,k,_[O+5],21,-57434055),k=a(k,M,L,q,_[O+12],6,1700485571),q=a(q,k,M,L,_[O+3],10,-1894986606),L=a(L,q,k,M,_[O+10],15,-1051523),M=a(M,L,q,k,_[O+1],21,-2054922799),k=a(k,M,L,q,_[O+8],6,1873313359),q=a(q,k,M,L,_[O+15],10,-30611744),L=a(L,q,k,M,_[O+6],15,-1560198380),M=a(M,L,q,k,_[O+13],21,1309151649),k=a(k,M,L,q,_[O+4],6,-145523070),q=a(q,k,M,L,_[O+11],10,-1120210379),L=a(L,q,k,M,_[O+2],15,718787259),M=a(M,L,q,k,_[O+9],21,-343485551),k=e(k,H),M=e(M,re),L=e(L,fe),q=e(q,U);return[k,M,L,q]}function c(_){var j,O="",H=_.length*32;for(j=0;j<H;j+=8)O+=String.fromCharCode(_[j>>5]>>>j%32&255);return O}function l(_){var j,O=[];for(O[(_.length>>2)-1]=void 0,j=0;j<O.length;j+=1)O[j]=0;var H=_.length*8;for(j=0;j<H;j+=8)O[j>>5]|=(_.charCodeAt(j/8)&255)<<j%32;return O}function d(_){return c(u(l(_),_.length*8))}function p(_,j){var O,H=l(_),re=[],fe=[],U;for(re[15]=fe[15]=void 0,H.length>16&&(H=u(H,_.length*8)),O=0;O<16;O+=1)re[O]=H[O]^909522486,fe[O]=H[O]^1549556828;return U=u(re.concat(l(j)),512+j.length*8),c(u(fe.concat(U),640))}function y(_){var j="0123456789abcdef",O="",H,re;for(re=0;re<_.length;re+=1)H=_.charCodeAt(re),O+=j.charAt(H>>>4&15)+j.charAt(H&15);return O}function v(_){return unescape(encodeURIComponent(_))}function x(_){return d(v(_))}function I(_){return y(x(_))}function P(_,j){return p(v(_),v(j))}function w(_,j){return y(P(_,j))}function E(_,j,O){return j?O?P(j,_):w(j,_):O?x(_):I(_)}typeof define=="function"&&define.amd?define(function(){return E}):typeof gd=="object"&&gd.exports?gd.exports=E:t.md5=E})(xx)});var By=m(yo=>{"use strict";var hN=yo&&yo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(yo,"__esModule",{value:!0});yo.LiteralsMapper=void 0;var mN=hN(Fy()),$y=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=e.raw.toString();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,mN.default)(r)))}return n}get(e){let n=this,r=e.raw.toString();return n.mapping.has(r)?n.mapping.get(r):null}getMapping(){return this.mapping}};yo.LiteralsMapper=$y});var Hy=m(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:!0});yd.NamespaceGenerator=void 0;var Uy=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.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}};yd.NamespaceGenerator=Uy});var za=m(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.Context=us.ContextDataProperty=void 0;var gN=By(),kx=Hy(),yN;(function(t){t.ResourceDependencyMap="resourceDependencyMap",t.DependencyCallStack="dependencyCallStack"})(yN=us.ContextDataProperty||(us.ContextDataProperty={}));var Wy=class{constructor(e){let n=this;n.modules=new kx.NamespaceGenerator({characters:e.modulesCharset}),n.variables=new kx.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",...e.variablesExcluded||[]]}),n.literals=new gN.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)}};us.Context=Wy});var Gy=m(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});Ka.DependencyType=void 0;var bN;(function(t){t[t.Main=0]="Main",t[t.Import=1]="Import",t[t.Include=2]="Include"})(bN=Ka.DependencyType||(Ka.DependencyType={}))});var _d=m(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});bd.BuildError=void 0;var Vy=class extends Error{constructor(e,n){super(e),this.target=n.target,this.range=n.range}};bd.BuildError=Vy});var Sd=m(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.fetchNamespaces=void 0;function _N(t){let e=new Set(t.namespaces);return t.scopes.reduce((n,r)=>(r.namespaces.forEach(i=>e.add(i)),n),e),Array.from(e)}vd.fetchNamespaces=_N});var Yy=m(wi=>{"use strict";var zy=wi&&wi.__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(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})},Dx=wi&&wi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(wi,"__esModule",{value:!0});wi.Dependency=void 0;var Cx=Dx(Fy()),vN=Dx(require("events")),Ox=Fr(),Td=za(),Ky=Gy(),Rx=_d(),SN=Sd(),Xy=class t extends vN.default{constructor(e){super();let n=this;n.target=e.target,n.id=(0,Cx.default)(e.target),n.resourceHandler=e.resourceHandler,n.chunk=e.chunk,n.dependencies=new Set,n.injections=new Map,n.type=e.type||Ky.DependencyType.Main,n.context=e.context,n.ref=e.ref;let r=n.context.createModuleNamespace(n.id);n.context.getOrCreateData(Td.ContextDataProperty.ResourceDependencyMap,()=>new Map).set(r,n),n.context.getOrCreateData(Td.ContextDataProperty.DependencyCallStack,()=>[])}getId(){return this.id}getNamespace(){let e=this;return e.context.modules.get(e.id)}resolve(e,n,r){return zy(this,void 0,void 0,function*(){let i=this,s=i.context,{modules:o}=s,a=s.get(Td.ContextDataProperty.ResourceDependencyMap),u=i.resourceHandler,c=yield u.getTargetRelativeTo(i.target,e),l=(0,Cx.default)(c),d=o.get(l);if(a.has(d))return a.get(d);if(!(yield u.has(c)))throw new Error("Dependency "+c+" does not exist...");let p=yield u.get(c);i.emit("parse-before",c);try{let v=new Ox.Parser(p,{filename:c}).parseChunk(),x=new t({target:c,resourceHandler:u,chunk:v,type:n,context:s,ref:r});return i.emit("parse-after",x),x}catch(y){throw y instanceof Rx.BuildError?y:new Rx.BuildError(y.message,{target:c,range:y.range})}})}findInjections(){return zy(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 zy(this,void 0,void 0,function*(){let e=this,{imports:n,includes:r}=e.chunk,i=e.getNamespace(),s=e.context.get(Td.ContextDataProperty.DependencyCallStack),o=[...(0,SN.fetchNamespaces)(e.chunk)],a=[...e.chunk.literals],u=[];s.push(i);let c=[...n,...r];for(let d of c){let p=d instanceof Ox.ASTFeatureIncludeExpression?Ky.DependencyType.Include:Ky.DependencyType.Import,y=yield e.resolve(d.path,p,d),v=y.getNamespace();if(s.includes(v))throw new Error(`Circular dependency from ${e.target} to ${y.target} detected.`);let x=y.chunk;d.chunk=x,d.namespace=v;let I=yield y.findDependencies();o.push(...I.namespaces),a.push(...I.literals),u.push(y)}yield this.findInjections();let l=new Set(u);return e.dependencies=l,s.pop(),{dependencies:l,namespaces:o,literals:a}})}};wi.Dependency=Xy});var Qy=m(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0});wd.Stack=void 0;var Jy=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}};wd.Stack=Jy});var Ad=m(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});Ed.Transformer=void 0;var TN=Qy(),Zy=class{get buildOptions(){return this._buildOptions}get currentStack(){return this._currentStack}get currentDependency(){return this._currentDependency}get context(){return this._context}get environmentVariables(){return this._environmentVariables}get buildMap(){return this._buildMap}get resourceHandler(){return this._resourceHandler}constructor({buildOptions:e,mapFactory:n,context:r,environmentVariables:i,resourceHandler:s}){let o=this;o._buildOptions=e,o._context=r,o._environmentVariables=i,o._buildMap=n(o),o._resourceHandler=s??null,o._currentDependency=null,o._currentStack=new TN.Stack}make(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._buildMap[e.type];if(s==null)throw console.error("Error AST:",e),new Error("Type does not exist "+e.type);i.push(e);let o=s(e,n);return i.pop(),o}transform(e,n=null){let r=this;if(e.type!=="Chunk")throw new Error("Expects chunk");return r._currentDependency=n,r.make(e)}};Ed.Transformer=Zy});var Cd=m(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});kd.generateCharsetMap=void 0;function xd(t,e){let n="";for(;t<=e;)n=n+String.fromCharCode(t),t=t+1;return n}function wN(t=!1){let e=xd(65,90),n=xd(97,122),r=xd(48,57),i="_";return t&&(i=i+xd(1e3,2e3)),{variables:e+n+i,modules:e+n+r+i}}kd.generateCharsetMap=wN});var tb=m(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.MAIN_BOILERPLATE=Ei.MODULE_BOILERPLATE=Ei.HEADER_BOILERPLATE=void 0;var eb=Fr();Ei.HEADER_BOILERPLATE=new eb.Parser(`MODULES={}
201
201
  EXPORTED={}
202
202
  __REQUIRE=function(r)
203
203
  if (not MODULES.hasIndex(r)) then
@@ -206,7 +206,7 @@ end if`},IfClause:(n,r)=>{let i=t.make(n.condition),s=[],o;for(o of n.body){let
206
206
  end if
207
207
  module=@MODULES[r]
208
208
  return @module(r).exports
209
- end function`).parseChunk();Ei.MODULE_BOILERPLATE=new tb.Parser(`MODULES["$0"]=function(r)
209
+ end function`).parseChunk();Ei.MODULE_BOILERPLATE=new eb.Parser(`MODULES["$0"]=function(r)
210
210
  module={}
211
211
  if (EXPORTED.hasIndex(r)) then
212
212
  module=EXPORTED[r]
@@ -216,11 +216,11 @@ end if`},IfClause:(n,r)=>{let i=t.make(n.condition),s=[],o;for(o of n.body){let
216
216
  end if
217
217
  EXPORTED[r]=module
218
218
  return EXPORTED[r]
219
- end function`).parseChunk();Ei.MAIN_BOILERPLATE=new tb.Parser('"$0"').parseChunk()});var Rd=m(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});Od.OutputProcessor=void 0;var Ix=nb(),rb=class{constructor(e,n,{header:r=Ix.HEADER_BOILERPLATE,main:i=Ix.MAIN_BOILERPLATE}={}){this.context=e,this.transformer=n,this.processed=[],this.headerBoilerplate=this.transformer.transform(r),this.mainBoilerplate=this.transformer.transform(i)}addLiteralsOptimization(){let e=this.context,n=Array.from(e.literals.getMapping().values()).filter(i=>i.namespace!=null),r=e.variables.get("globals");return n.length>0&&this.processed.push("globals."+r+"=globals",...n.map(i=>`${r}.${i.namespace}=${i.literal.raw}`)),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(`
220
- `)}};Od.OutputProcessor=rb});var Px=m(bo=>{"use strict";var EN=bo&&bo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(bo,"__esModule",{value:!0});bo.DirectTranspiler=void 0;var AN=EN(require("events")),xN=Fr(),Dd=md(),kN=za(),CN=Ad(),ON=Cd(),RN=Sd(),DN=Rd(),IN=Object.prototype.hasOwnProperty,ib=class extends AN.default{constructor(e){super();let n=this;n.code=e.code,n.obfuscation=IN.call(e,"obfuscation")?e.obfuscation:!0,n.buildType=e.buildType||Dd.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.disableLiteralsOptimization=e.disableLiteralsOptimization||n.buildType!==Dd.BuildType.UGLIFY,n.disableNamespacesOptimization=e.disableNamespacesOptimization||n.buildType!==Dd.BuildType.UGLIFY,n.environmentVariables=e.environmentVariables||new Map,n.excludedNamespaces=e.excludedNamespaces||[]}parse(){let e=this,n=(0,Dd.getFactory)(e.buildType),i=new xN.Parser(e.code).parseChunk(),s=(0,RN.fetchNamespaces)(i),o=[].concat(i.literals),a=(0,ON.generateCharsetMap)(e.obfuscation),u=new kN.Context({variablesCharset:a.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:a.modules});e.disableNamespacesOptimization||new Set(s).forEach(y=>u.variables.createNamespace(y)),e.disableLiteralsOptimization||o.forEach(p=>u.literals.add(p));let c=new CN.Transformer({buildOptions:e.buildOptions,mapFactory:n,context:u,environmentVariables:e.environmentVariables}),l=new DN.OutputProcessor(u,c);e.disableLiteralsOptimization||l.addLiteralsOptimization();let d=c.transform(i);return l.addCode(d),l.build()}};bo.DirectTranspiler=ib});var ob=m(Id=>{"use strict";Object.defineProperty(Id,"__esModule",{value:!0});Id.ResourceProvider=void 0;var sb=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))}}};Id.ResourceProvider=sb});var ub=m(Ai=>{"use strict";var PN=Ai&&Ai.__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(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})},MN=Ai&&Ai.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ai,"__esModule",{value:!0});Ai.Target=void 0;var LN=MN(require("events")),NN=Fr(),qN=Jy(),Mx=_d(),ab=class extends LN.default{constructor(e){super();let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler,n.context=e.context}parse(e){return PN(this,void 0,void 0,function*(){let n=this,r=n.resourceHandler,i=yield r.resolve(n.target);if(!(yield r.has(i)))throw new Error("Target "+i+" does not exist...");let s=n.context,o=yield r.get(i);n.emit("parse-before",i);try{let u=new NN.Parser(o,{filename:i}).parseChunk(),c=new qN.Dependency({target:i,resourceHandler:r,chunk:u,context:s}),{namespaces:l,literals:d}=yield c.findDependencies();if(!e.disableNamespacesOptimization){let p=new Set(l);for(let y of p)s.variables.createNamespace(y)}if(!e.disableLiteralsOptimization)for(let p of d)s.literals.add(p);return{main:{chunk:u,dependency:c}}}catch(a){throw a instanceof Mx.BuildError?a:new Mx.BuildError(a.message,{target:this.target,range:a.range})}})}};Ai.Target=ab});var Lx=m(_o=>{"use strict";var jN=_o&&_o.__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(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})};Object.defineProperty(_o,"__esModule",{value:!0});_o.Transpiler=void 0;var FN=lb(),$N=nb(),Pd=md(),BN=za(),UN=ob(),HN=ub(),WN=Ad(),GN=Cd(),VN=Rd(),zN=Object.prototype.hasOwnProperty,cb=class{constructor(e){let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler||new UN.ResourceProvider().getHandler(),n.obfuscation=zN.call(e,"obfuscation")?e.obfuscation:!0;let r=(0,GN.generateCharsetMap)(n.obfuscation);n.context=new BN.Context({variablesCharset:r.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:r.modules}),n.buildType=e.buildType||Pd.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.installer=e.installer||!1,n.disableLiteralsOptimization=e.disableLiteralsOptimization||n.buildType!==Pd.BuildType.UGLIFY,n.disableNamespacesOptimization=e.disableNamespacesOptimization||n.buildType!==Pd.BuildType.UGLIFY,n.environmentVariables=e.environmentVariables||new Map}parse(){return jN(this,void 0,void 0,function*(){let e=this,n=(0,Pd.getFactory)(e.buildType),r=e.context,s=yield new HN.Target({target:e.target,resourceHandler:e.resourceHandler,context:e.context}).parse({disableLiteralsOptimization:e.disableLiteralsOptimization,disableNamespacesOptimization:e.disableNamespacesOptimization}),o=new WN.Transformer({buildOptions:e.buildOptions,mapFactory:n,context:r,environmentVariables:e.environmentVariables,resourceHandler:e.resourceHandler}),a=s.main,u=o.transform($N.MODULE_BOILERPLATE),c=(l,d)=>{let p=r.modules.get(l.getId()),y={},v=0,x=function(w){let E=w.getNamespace();if(!(E in y)){if(E!==p&&w.type===FN.DependencyType.Import){let _=o.transform(w.chunk,w);y[E]=u.replace('"$0"','"'+E+'"').replace('"$1"',_),v++}for(let _ of w.dependencies)x(_)}};x(l);let I=new VN.OutputProcessor(r,o);d&&I.addLiteralsOptimization(),v>0&&I.addHeader(),Object.keys(y).forEach(w=>I.addCode(y[w]));let P=o.transform(l.chunk,l);return I.addCode(P,!0),I.build()};return{[e.target]:c(a.dependency,!e.disableLiteralsOptimization)}})}};_o.Transpiler=cb});var lb=m(ee=>{"use strict";var Nx=ee&&ee.__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]}),KN=ee&&ee.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),XN=ee&&ee.__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)&&Nx(e,t,n);return KN(e,t),e},YN=ee&&ee.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Nx(e,t,n)};Object.defineProperty(ee,"__esModule",{value:!0});ee.Stack=ee.OutputProcessor=ee.NamespaceGenerator=ee.LiteralsMapper=ee.fetchNamespaces=ee.BuildError=ee.generateCharsetMap=ee.DependencyType=ee.Transpiler=ee.Transformer=ee.Target=ee.DirectTranspiler=ee.Dependency=ee.ContextDataProperty=ee.Context=ee.uglifyFactory=ee.defaultFactory=ee.BeautifyUtils=ee.BeautifyContext=ee.beautifyFactory=ee.getFactory=ee.BuildType=void 0;var qx=md();Object.defineProperty(ee,"BuildType",{enumerable:!0,get:function(){return qx.BuildType}});Object.defineProperty(ee,"getFactory",{enumerable:!0,get:function(){return qx.getFactory}});var JN=qy();Object.defineProperty(ee,"beautifyFactory",{enumerable:!0,get:function(){return JN.beautifyFactory}});var QN=Ny();Object.defineProperty(ee,"BeautifyContext",{enumerable:!0,get:function(){return QN.BeautifyContext}});ee.BeautifyUtils=XN(dd());var ZN=jy();Object.defineProperty(ee,"defaultFactory",{enumerable:!0,get:function(){return ZN.defaultFactory}});var eq=Fy();Object.defineProperty(ee,"uglifyFactory",{enumerable:!0,get:function(){return eq.uglifyFactory}});var jx=za();Object.defineProperty(ee,"Context",{enumerable:!0,get:function(){return jx.Context}});Object.defineProperty(ee,"ContextDataProperty",{enumerable:!0,get:function(){return jx.ContextDataProperty}});var tq=Jy();Object.defineProperty(ee,"Dependency",{enumerable:!0,get:function(){return tq.Dependency}});var nq=Px();Object.defineProperty(ee,"DirectTranspiler",{enumerable:!0,get:function(){return nq.DirectTranspiler}});YN(ob(),ee);var rq=ub();Object.defineProperty(ee,"Target",{enumerable:!0,get:function(){return rq.Target}});var iq=Ad();Object.defineProperty(ee,"Transformer",{enumerable:!0,get:function(){return iq.Transformer}});var sq=Lx();Object.defineProperty(ee,"Transpiler",{enumerable:!0,get:function(){return sq.Transpiler}});var oq=Vy();Object.defineProperty(ee,"DependencyType",{enumerable:!0,get:function(){return oq.DependencyType}});var aq=Cd();Object.defineProperty(ee,"generateCharsetMap",{enumerable:!0,get:function(){return aq.generateCharsetMap}});var uq=_d();Object.defineProperty(ee,"BuildError",{enumerable:!0,get:function(){return uq.BuildError}});var cq=Sd();Object.defineProperty(ee,"fetchNamespaces",{enumerable:!0,get:function(){return cq.fetchNamespaces}});var lq=Uy();Object.defineProperty(ee,"LiteralsMapper",{enumerable:!0,get:function(){return lq.LiteralsMapper}});var dq=Wy();Object.defineProperty(ee,"NamespaceGenerator",{enumerable:!0,get:function(){return dq.NamespaceGenerator}});var fq=Rd();Object.defineProperty(ee,"OutputProcessor",{enumerable:!0,get:function(){return fq.OutputProcessor}});var pq=Zy();Object.defineProperty(ee,"Stack",{enumerable:!0,get:function(){return pq.Stack}})});var $x=m(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});Md.activate=void 0;var Fx=lb();function hq(t){async function e(n){try{let r=t.getConfiguration();return new Fx.DirectTranspiler({code:n,buildType:Fx.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),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}]})}Md.activate=hq});var Ld=m((Xa,db)=>{(function(t,e){if(typeof Xa=="object"&&typeof db=="object")db.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var n=e();for(var r in n)(typeof Xa=="object"?Xa:t)[r]=n[r]}})(Xa,()=>(()=>{"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,d="",p=0,y=-1,v=0,x=0;x<=u.length;++x){if(x<u.length)l=u.charCodeAt(x);else{if(l===47)break;l=47}if(l===47){if(!(y===x-1||v===1))if(y!==x-1&&v===2){if(d.length<2||p!==2||d.charCodeAt(d.length-1)!==46||d.charCodeAt(d.length-2)!==46){if(d.length>2){var I=d.lastIndexOf("/");if(I!==d.length-1){I===-1?(d="",p=0):p=(d=d.slice(0,I)).length-1-d.lastIndexOf("/"),y=x,v=0;continue}}else if(d.length===2||d.length===1){d="",p=0,y=x,v=0;continue}}c&&(d.length>0?d+="/..":d="..",p=2)}else d.length>0?d+="/"+u.slice(y+1,x):d=u.slice(y+1,x),p=x-y-1;y=x,v=0}else l===46&&v!==-1?++v:v=-1}return d}var a={resolve:function(){for(var u,c="",l=!1,d=arguments.length-1;d>=-1&&!l;d--){var p;d>=0?p=arguments[d]:(u===void 0&&(u=process.cwd()),p=u),s(p),p.length!==0&&(c=p+"/"+c,l=p.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 d=u.length,p=d-l,y=1;y<c.length&&c.charCodeAt(y)===47;++y);for(var v=c.length-y,x=p<v?p:v,I=-1,P=0;P<=x;++P){if(P===x){if(v>x){if(c.charCodeAt(y+P)===47)return c.slice(y+P+1);if(P===0)return c.slice(y+P)}else p>x&&(u.charCodeAt(l+P)===47?I=P:P===0&&(I=0));break}var w=u.charCodeAt(l+P);if(w!==c.charCodeAt(y+P))break;w===47&&(I=P)}var E="";for(P=l+I+1;P<=d;++P)P!==d&&u.charCodeAt(P)!==47||(E.length===0?E+="..":E+="/..");return E.length>0?E+c.slice(y+I):(y+=I,c.charCodeAt(y)===47&&++y,c.slice(y))},_makeLong:function(u){return u},dirname:function(u){if(s(u),u.length===0)return".";for(var c=u.charCodeAt(0),l=c===47,d=-1,p=!0,y=u.length-1;y>=1;--y)if((c=u.charCodeAt(y))===47){if(!p){d=y;break}}else p=!1;return d===-1?l?"/":".":l&&d===1?"//":u.slice(0,d)},basename:function(u,c){if(c!==void 0&&typeof c!="string")throw new TypeError('"ext" argument must be a string');s(u);var l,d=0,p=-1,y=!0;if(c!==void 0&&c.length>0&&c.length<=u.length){if(c.length===u.length&&c===u)return"";var v=c.length-1,x=-1;for(l=u.length-1;l>=0;--l){var I=u.charCodeAt(l);if(I===47){if(!y){d=l+1;break}}else x===-1&&(y=!1,x=l+1),v>=0&&(I===c.charCodeAt(v)?--v==-1&&(p=l):(v=-1,p=x))}return d===p?p=x:p===-1&&(p=u.length),u.slice(d,p)}for(l=u.length-1;l>=0;--l)if(u.charCodeAt(l)===47){if(!y){d=l+1;break}}else p===-1&&(y=!1,p=l+1);return p===-1?"":u.slice(d,p)},extname:function(u){s(u);for(var c=-1,l=0,d=-1,p=!0,y=0,v=u.length-1;v>=0;--v){var x=u.charCodeAt(v);if(x!==47)d===-1&&(p=!1,d=v+1),x===46?c===-1?c=v:y!==1&&(y=1):c!==-1&&(y=-1);else if(!p){l=v+1;break}}return c===-1||d===-1||y===0||y===1&&c===d-1&&c===l+1?"":u.slice(c,d)},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 d=l.dir||l.root,p=l.base||(l.name||"")+(l.ext||"");return d?d===l.root?d+p:d+"/"+p:p}(0,u)},parse:function(u){s(u);var c={root:"",dir:"",base:"",ext:"",name:""};if(u.length===0)return c;var l,d=u.charCodeAt(0),p=d===47;p?(c.root="/",l=1):l=0;for(var y=-1,v=0,x=-1,I=!0,P=u.length-1,w=0;P>=l;--P)if((d=u.charCodeAt(P))!==47)x===-1&&(I=!1,x=P+1),d===46?y===-1?y=P:w!==1&&(w=1):y!==-1&&(w=-1);else if(!I){v=P+1;break}return y===-1||x===-1||w===0||w===1&&y===x-1&&y===v+1?x!==-1&&(c.base=c.name=v===0&&p?u.slice(1,x):u.slice(v,x)):(v===0&&p?(c.name=u.slice(1,y),c.base=u.slice(1,x)):(c.name=u.slice(v,y),c.base=u.slice(v,x)),c.ext=u.slice(y,x)),v>0?c.dir=u.slice(0,v-1):p&&(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 d(U,k){if(!U.scheme&&k)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 p="",y="/",v=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class x{static isUri(k){return k instanceof x||!!k&&typeof k.authority=="string"&&typeof k.fragment=="string"&&typeof k.path=="string"&&typeof k.query=="string"&&typeof k.scheme=="string"&&typeof k.fsPath=="string"&&typeof k.with=="function"&&typeof k.toString=="function"}scheme;authority;path;query;fragment;constructor(k,M,L,q,ce,ae=!1){typeof k=="object"?(this.scheme=k.scheme||p,this.authority=k.authority||p,this.path=k.path||p,this.query=k.query||p,this.fragment=k.fragment||p):(this.scheme=function(Ct,dt){return Ct||dt?Ct:"file"}(k,ae),this.authority=M||p,this.path=function(Ct,dt){switch(Ct){case"https":case"http":case"file":dt?dt[0]!==y&&(dt=y+dt):dt=y}return dt}(this.scheme,L||p),this.query=q||p,this.fragment=ce||p,d(this,ae))}get fsPath(){return j(this,!1)}with(k){if(!k)return this;let{scheme:M,authority:L,path:q,query:ce,fragment:ae}=k;return M===void 0?M=this.scheme:M===null&&(M=p),L===void 0?L=this.authority:L===null&&(L=p),q===void 0?q=this.path:q===null&&(q=p),ce===void 0?ce=this.query:ce===null&&(ce=p),ae===void 0?ae=this.fragment:ae===null&&(ae=p),M===this.scheme&&L===this.authority&&q===this.path&&ce===this.query&&ae===this.fragment?this:new P(M,L,q,ce,ae)}static parse(k,M=!1){let L=v.exec(k);return L?new P(L[2]||p,fe(L[4]||p),fe(L[5]||p),fe(L[7]||p),fe(L[9]||p),M):new P(p,p,p,p,p)}static file(k){let M=p;if(a.isWindows&&(k=k.replace(/\\/g,y)),k[0]===y&&k[1]===y){let L=k.indexOf(y,2);L===-1?(M=k.substring(2),k=y):(M=k.substring(2,L),k=k.substring(L)||y)}return new P("file",M,k,p,p)}static from(k){let M=new P(k.scheme,k.authority,k.path,k.query,k.fragment);return d(M,!0),M}toString(k=!1){return O(this,k)}toJSON(){return this}static revive(k){if(k){if(k instanceof x)return k;{let M=new P(k);return M._formatted=k.external,M._fsPath=k._sep===I?k.fsPath:null,M}}return k}}s.URI=x;let I=a.isWindows?1:void 0;class P extends x{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=j(this,!1)),this._fsPath}toString(k=!1){return k?O(this,!0):(this._formatted||(this._formatted=O(this,!1)),this._formatted)}toJSON(){let k={$mid:1};return this._fsPath&&(k.fsPath=this._fsPath,k._sep=I),this._formatted&&(k.external=this._formatted),this.path&&(k.path=this.path),this.scheme&&(k.scheme=this.scheme),this.authority&&(k.authority=this.authority),this.query&&(k.query=this.query),this.fragment&&(k.fragment=this.fragment),k}}let w={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 E(U,k,M){let L,q=-1;for(let ce=0;ce<U.length;ce++){let ae=U.charCodeAt(ce);if(ae>=97&&ae<=122||ae>=65&&ae<=90||ae>=48&&ae<=57||ae===45||ae===46||ae===95||ae===126||k&&ae===47||M&&ae===91||M&&ae===93||M&&ae===58)q!==-1&&(L+=encodeURIComponent(U.substring(q,ce)),q=-1),L!==void 0&&(L+=U.charAt(ce));else{L===void 0&&(L=U.substr(0,ce));let Ct=w[ae];Ct!==void 0?(q!==-1&&(L+=encodeURIComponent(U.substring(q,ce)),q=-1),L+=Ct):q===-1&&(q=ce)}}return q!==-1&&(L+=encodeURIComponent(U.substring(q))),L!==void 0?L:U}function _(U){let k;for(let M=0;M<U.length;M++){let L=U.charCodeAt(M);L===35||L===63?(k===void 0&&(k=U.substr(0,M)),k+=w[L]):k!==void 0&&(k+=U[M])}return k!==void 0?k:U}function j(U,k){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?k?U.path.substr(1):U.path[1].toLowerCase()+U.path.substr(2):U.path,a.isWindows&&(M=M.replace(/\//g,"\\")),M}function O(U,k){let M=k?_:E,L="",{scheme:q,authority:ce,path:ae,query:Ct,fragment:dt}=U;if(q&&(L+=q,L+=":"),(ce||q==="file")&&(L+=y,L+=y),ce){let Pe=ce.indexOf("@");if(Pe!==-1){let rn=ce.substr(0,Pe);ce=ce.substr(Pe+1),Pe=rn.lastIndexOf(":"),Pe===-1?L+=M(rn,!1,!1):(L+=M(rn.substr(0,Pe),!1,!1),L+=":",L+=M(rn.substr(Pe+1),!1,!0)),L+="@"}ce=ce.toLowerCase(),Pe=ce.lastIndexOf(":"),Pe===-1?L+=M(ce,!1,!0):(L+=M(ce.substr(0,Pe),!1,!0),L+=ce.substr(Pe))}if(ae){if(ae.length>=3&&ae.charCodeAt(0)===47&&ae.charCodeAt(2)===58){let Pe=ae.charCodeAt(1);Pe>=65&&Pe<=90&&(ae=`/${String.fromCharCode(Pe+32)}:${ae.substr(3)}`)}else if(ae.length>=2&&ae.charCodeAt(1)===58){let Pe=ae.charCodeAt(0);Pe>=65&&Pe<=90&&(ae=`${String.fromCharCode(Pe+32)}:${ae.substr(2)}`)}L+=M(ae,!0,!1)}return Ct&&(L+="?",L+=M(Ct,!1,!1)),dt&&(L+="#",L+=k?dt:E(dt,!1,!1)),L}function H(U){try{return decodeURIComponent(U)}catch{return U.length>3?U.substr(0,3)+H(U.substr(3)):U}}s.uriToFsPath=j;let re=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function fe(U){return U.match(re)?U.replace(re,k=>H(k)):U}},679:function(i,s,o){var a=this&&this.__createBinding||(Object.create?function(v,x,I,P){P===void 0&&(P=I);var w=Object.getOwnPropertyDescriptor(x,I);w&&!("get"in w?!x.__esModule:w.writable||w.configurable)||(w={enumerable:!0,get:function(){return x[I]}}),Object.defineProperty(v,P,w)}:function(v,x,I,P){P===void 0&&(P=I),v[P]=x[I]}),u=this&&this.__setModuleDefault||(Object.create?function(v,x){Object.defineProperty(v,"default",{enumerable:!0,value:x})}:function(v,x){v.default=x}),c=this&&this.__importStar||function(v){if(v&&v.__esModule)return v;var x={};if(v!=null)for(var I in v)I!=="default"&&Object.prototype.hasOwnProperty.call(v,I)&&a(x,v,I);return u(x,v),x};Object.defineProperty(s,"__esModule",{value:!0}),s.Utils=void 0;let l=c(o(470)),d=l.posix||l,p="/";var y;(function(v){v.joinPath=function(x,...I){return x.with({path:d.join(x.path,...I)})},v.resolvePath=function(x,...I){let P=x.path,w=!1;P[0]!==p&&(P=p+P,w=!0);let E=d.resolve(P,...I);return w&&E[0]===p&&!x.authority&&(E=E.substring(1)),x.with({path:E})},v.dirname=function(x){if(x.path.length===0||x.path===p)return x;let I=d.dirname(x.path);return I.length===1&&I.charCodeAt(0)===46&&(I=""),x.with({path:I})},v.basename=function(x){return d.basename(x.path)},v.extname=function(x){return d.extname(x.path)}})(y||(s.Utils=y={}))}},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 qd=m(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});Nd.MarkdownString=void 0;var fb=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+=`
221
- `,this.value+=n,this.value+="\n```\n",this}toString(){return this.value}};Nd.MarkdownString=fb});var jd=m(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.createHover=gt.createSignatureInfo=gt.appendTooltipBody=gt.appendTooltipHeader=gt.createTooltipHeader=gt.formatDefaultValue=gt.formatTypes=void 0;var Bx=qs(),Ux=qd();function pb(t=[]){return t.map(e=>e.toString().replace(",","\u066B")).join(" or ")}gt.formatTypes=pb;function Hx(t){return typeof t=="string"?`"${t}"`:t.toString()}gt.formatDefaultValue=Hx;var mq=(t,e)=>{let n=e.getArguments()||[],r=pb(e.getReturns())||"null";if(n.length===0)return`(${t.kind}) ${t.label} (): ${r}`;let i=n.map(s=>`${s.getLabel()}${s.isOptional()?"?":""}: ${pb(s.getTypes())}${s.getDefault()?` = ${Hx(s.getDefault().value)}`:""}`).join(", ");return`(${t.kind}) ${t.label} (${i}): ${r}`};gt.createTooltipHeader=mq;var gq=(t,e,n)=>{t.appendCodeblock(Bx.LanguageId,(0,gt.createTooltipHeader)(e,n)),t.appendMarkdown(`***
219
+ end function`).parseChunk();Ei.MAIN_BOILERPLATE=new eb.Parser('"$0"').parseChunk()});var Rd=m(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});Od.OutputProcessor=void 0;var Ix=tb(),nb=class{constructor(e,n,{header:r=Ix.HEADER_BOILERPLATE,main:i=Ix.MAIN_BOILERPLATE}={}){this.context=e,this.transformer=n,this.processed=[],this.headerBoilerplate=this.transformer.transform(r),this.mainBoilerplate=this.transformer.transform(i)}addLiteralsOptimization(){let e=this.context,n=Array.from(e.literals.getMapping().values()).filter(i=>i.namespace!=null),r=e.variables.get("globals");return n.length>0&&this.processed.push("globals."+r+"=globals",...n.map(i=>`${r}.${i.namespace}=${i.literal.raw}`)),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(`
220
+ `)}};Od.OutputProcessor=nb});var Px=m(bo=>{"use strict";var EN=bo&&bo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(bo,"__esModule",{value:!0});bo.DirectTranspiler=void 0;var AN=EN(require("events")),xN=Fr(),Dd=md(),kN=za(),CN=Ad(),ON=Cd(),RN=Sd(),DN=Rd(),IN=Object.prototype.hasOwnProperty,rb=class extends AN.default{constructor(e){super();let n=this;n.code=e.code,n.obfuscation=IN.call(e,"obfuscation")?e.obfuscation:!0,n.buildType=e.buildType||Dd.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.disableLiteralsOptimization=e.disableLiteralsOptimization||n.buildType!==Dd.BuildType.UGLIFY,n.disableNamespacesOptimization=e.disableNamespacesOptimization||n.buildType!==Dd.BuildType.UGLIFY,n.environmentVariables=e.environmentVariables||new Map,n.excludedNamespaces=e.excludedNamespaces||[]}parse(){let e=this,n=(0,Dd.getFactory)(e.buildType),i=new xN.Parser(e.code).parseChunk(),s=(0,RN.fetchNamespaces)(i),o=[].concat(i.literals),a=(0,ON.generateCharsetMap)(e.obfuscation),u=new kN.Context({variablesCharset:a.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:a.modules});e.disableNamespacesOptimization||new Set(s).forEach(y=>u.variables.createNamespace(y)),e.disableLiteralsOptimization||o.forEach(p=>u.literals.add(p));let c=new CN.Transformer({buildOptions:e.buildOptions,mapFactory:n,context:u,environmentVariables:e.environmentVariables}),l=new DN.OutputProcessor(u,c);e.disableLiteralsOptimization||l.addLiteralsOptimization();let d=c.transform(i);return l.addCode(d),l.build()}};bo.DirectTranspiler=rb});var sb=m(Id=>{"use strict";Object.defineProperty(Id,"__esModule",{value:!0});Id.ResourceProvider=void 0;var ib=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))}}};Id.ResourceProvider=ib});var ab=m(Ai=>{"use strict";var PN=Ai&&Ai.__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(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})},MN=Ai&&Ai.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ai,"__esModule",{value:!0});Ai.Target=void 0;var LN=MN(require("events")),NN=Fr(),qN=Yy(),Mx=_d(),ob=class extends LN.default{constructor(e){super();let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler,n.context=e.context}parse(e){return PN(this,void 0,void 0,function*(){let n=this,r=n.resourceHandler,i=yield r.resolve(n.target);if(!(yield r.has(i)))throw new Error("Target "+i+" does not exist...");let s=n.context,o=yield r.get(i);n.emit("parse-before",i);try{let u=new NN.Parser(o,{filename:i}).parseChunk(),c=new qN.Dependency({target:i,resourceHandler:r,chunk:u,context:s}),{namespaces:l,literals:d}=yield c.findDependencies();if(!e.disableNamespacesOptimization){let p=new Set(l);for(let y of p)s.variables.createNamespace(y)}if(!e.disableLiteralsOptimization)for(let p of d)s.literals.add(p);return{main:{chunk:u,dependency:c}}}catch(a){throw a instanceof Mx.BuildError?a:new Mx.BuildError(a.message,{target:this.target,range:a.range})}})}};Ai.Target=ob});var Lx=m(_o=>{"use strict";var jN=_o&&_o.__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(d){o(d)}}function u(l){try{c(r.throw(l))}catch(d){o(d)}}function c(l){l.done?s(l.value):i(l.value).then(a,u)}c((r=r.apply(t,e||[])).next())})};Object.defineProperty(_o,"__esModule",{value:!0});_o.Transpiler=void 0;var FN=cb(),$N=tb(),Pd=md(),BN=za(),UN=sb(),HN=ab(),WN=Ad(),GN=Cd(),VN=Rd(),zN=Object.prototype.hasOwnProperty,ub=class{constructor(e){let n=this;n.target=e.target,n.resourceHandler=e.resourceHandler||new UN.ResourceProvider().getHandler(),n.obfuscation=zN.call(e,"obfuscation")?e.obfuscation:!0;let r=(0,GN.generateCharsetMap)(n.obfuscation);n.context=new BN.Context({variablesCharset:r.variables,variablesExcluded:e.excludedNamespaces,modulesCharset:r.modules}),n.buildType=e.buildType||Pd.BuildType.DEFAULT,n.buildOptions=e.buildOptions||{isDevMode:!1},n.installer=e.installer||!1,n.disableLiteralsOptimization=e.disableLiteralsOptimization||n.buildType!==Pd.BuildType.UGLIFY,n.disableNamespacesOptimization=e.disableNamespacesOptimization||n.buildType!==Pd.BuildType.UGLIFY,n.environmentVariables=e.environmentVariables||new Map}parse(){return jN(this,void 0,void 0,function*(){let e=this,n=(0,Pd.getFactory)(e.buildType),r=e.context,s=yield new HN.Target({target:e.target,resourceHandler:e.resourceHandler,context:e.context}).parse({disableLiteralsOptimization:e.disableLiteralsOptimization,disableNamespacesOptimization:e.disableNamespacesOptimization}),o=new WN.Transformer({buildOptions:e.buildOptions,mapFactory:n,context:r,environmentVariables:e.environmentVariables,resourceHandler:e.resourceHandler}),a=s.main,u=o.transform($N.MODULE_BOILERPLATE),c=(l,d)=>{let p=r.modules.get(l.getId()),y={},v=0,x=function(w){let E=w.getNamespace();if(!(E in y)){if(E!==p&&w.type===FN.DependencyType.Import){let _=o.transform(w.chunk,w);y[E]=u.replace('"$0"','"'+E+'"').replace('"$1"',_),v++}for(let _ of w.dependencies)x(_)}};x(l);let I=new VN.OutputProcessor(r,o);d&&I.addLiteralsOptimization(),v>0&&I.addHeader(),Object.keys(y).forEach(w=>I.addCode(y[w]));let P=o.transform(l.chunk,l);return I.addCode(P,!0),I.build()};return{[e.target]:c(a.dependency,!e.disableLiteralsOptimization)}})}};_o.Transpiler=ub});var cb=m(ee=>{"use strict";var Nx=ee&&ee.__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]}),KN=ee&&ee.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),XN=ee&&ee.__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)&&Nx(e,t,n);return KN(e,t),e},YN=ee&&ee.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Nx(e,t,n)};Object.defineProperty(ee,"__esModule",{value:!0});ee.Stack=ee.OutputProcessor=ee.NamespaceGenerator=ee.LiteralsMapper=ee.fetchNamespaces=ee.BuildError=ee.generateCharsetMap=ee.DependencyType=ee.Transpiler=ee.Transformer=ee.Target=ee.DirectTranspiler=ee.Dependency=ee.ContextDataProperty=ee.Context=ee.uglifyFactory=ee.defaultFactory=ee.BeautifyUtils=ee.BeautifyContext=ee.beautifyFactory=ee.getFactory=ee.BuildType=void 0;var qx=md();Object.defineProperty(ee,"BuildType",{enumerable:!0,get:function(){return qx.BuildType}});Object.defineProperty(ee,"getFactory",{enumerable:!0,get:function(){return qx.getFactory}});var JN=Ny();Object.defineProperty(ee,"beautifyFactory",{enumerable:!0,get:function(){return JN.beautifyFactory}});var QN=Ly();Object.defineProperty(ee,"BeautifyContext",{enumerable:!0,get:function(){return QN.BeautifyContext}});ee.BeautifyUtils=XN(dd());var ZN=qy();Object.defineProperty(ee,"defaultFactory",{enumerable:!0,get:function(){return ZN.defaultFactory}});var eq=jy();Object.defineProperty(ee,"uglifyFactory",{enumerable:!0,get:function(){return eq.uglifyFactory}});var jx=za();Object.defineProperty(ee,"Context",{enumerable:!0,get:function(){return jx.Context}});Object.defineProperty(ee,"ContextDataProperty",{enumerable:!0,get:function(){return jx.ContextDataProperty}});var tq=Yy();Object.defineProperty(ee,"Dependency",{enumerable:!0,get:function(){return tq.Dependency}});var nq=Px();Object.defineProperty(ee,"DirectTranspiler",{enumerable:!0,get:function(){return nq.DirectTranspiler}});YN(sb(),ee);var rq=ab();Object.defineProperty(ee,"Target",{enumerable:!0,get:function(){return rq.Target}});var iq=Ad();Object.defineProperty(ee,"Transformer",{enumerable:!0,get:function(){return iq.Transformer}});var sq=Lx();Object.defineProperty(ee,"Transpiler",{enumerable:!0,get:function(){return sq.Transpiler}});var oq=Gy();Object.defineProperty(ee,"DependencyType",{enumerable:!0,get:function(){return oq.DependencyType}});var aq=Cd();Object.defineProperty(ee,"generateCharsetMap",{enumerable:!0,get:function(){return aq.generateCharsetMap}});var uq=_d();Object.defineProperty(ee,"BuildError",{enumerable:!0,get:function(){return uq.BuildError}});var cq=Sd();Object.defineProperty(ee,"fetchNamespaces",{enumerable:!0,get:function(){return cq.fetchNamespaces}});var lq=By();Object.defineProperty(ee,"LiteralsMapper",{enumerable:!0,get:function(){return lq.LiteralsMapper}});var dq=Hy();Object.defineProperty(ee,"NamespaceGenerator",{enumerable:!0,get:function(){return dq.NamespaceGenerator}});var fq=Rd();Object.defineProperty(ee,"OutputProcessor",{enumerable:!0,get:function(){return fq.OutputProcessor}});var pq=Qy();Object.defineProperty(ee,"Stack",{enumerable:!0,get:function(){return pq.Stack}})});var $x=m(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});Md.activate=void 0;var Fx=cb();function hq(t){async function e(n){try{let r=t.getConfiguration();return new Fx.DirectTranspiler({code:n,buildType:Fx.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}]})}Md.activate=hq});var Ld=m((Xa,lb)=>{(function(t,e){if(typeof Xa=="object"&&typeof lb=="object")lb.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var n=e();for(var r in n)(typeof Xa=="object"?Xa:t)[r]=n[r]}})(Xa,()=>(()=>{"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,d="",p=0,y=-1,v=0,x=0;x<=u.length;++x){if(x<u.length)l=u.charCodeAt(x);else{if(l===47)break;l=47}if(l===47){if(!(y===x-1||v===1))if(y!==x-1&&v===2){if(d.length<2||p!==2||d.charCodeAt(d.length-1)!==46||d.charCodeAt(d.length-2)!==46){if(d.length>2){var I=d.lastIndexOf("/");if(I!==d.length-1){I===-1?(d="",p=0):p=(d=d.slice(0,I)).length-1-d.lastIndexOf("/"),y=x,v=0;continue}}else if(d.length===2||d.length===1){d="",p=0,y=x,v=0;continue}}c&&(d.length>0?d+="/..":d="..",p=2)}else d.length>0?d+="/"+u.slice(y+1,x):d=u.slice(y+1,x),p=x-y-1;y=x,v=0}else l===46&&v!==-1?++v:v=-1}return d}var a={resolve:function(){for(var u,c="",l=!1,d=arguments.length-1;d>=-1&&!l;d--){var p;d>=0?p=arguments[d]:(u===void 0&&(u=process.cwd()),p=u),s(p),p.length!==0&&(c=p+"/"+c,l=p.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 d=u.length,p=d-l,y=1;y<c.length&&c.charCodeAt(y)===47;++y);for(var v=c.length-y,x=p<v?p:v,I=-1,P=0;P<=x;++P){if(P===x){if(v>x){if(c.charCodeAt(y+P)===47)return c.slice(y+P+1);if(P===0)return c.slice(y+P)}else p>x&&(u.charCodeAt(l+P)===47?I=P:P===0&&(I=0));break}var w=u.charCodeAt(l+P);if(w!==c.charCodeAt(y+P))break;w===47&&(I=P)}var E="";for(P=l+I+1;P<=d;++P)P!==d&&u.charCodeAt(P)!==47||(E.length===0?E+="..":E+="/..");return E.length>0?E+c.slice(y+I):(y+=I,c.charCodeAt(y)===47&&++y,c.slice(y))},_makeLong:function(u){return u},dirname:function(u){if(s(u),u.length===0)return".";for(var c=u.charCodeAt(0),l=c===47,d=-1,p=!0,y=u.length-1;y>=1;--y)if((c=u.charCodeAt(y))===47){if(!p){d=y;break}}else p=!1;return d===-1?l?"/":".":l&&d===1?"//":u.slice(0,d)},basename:function(u,c){if(c!==void 0&&typeof c!="string")throw new TypeError('"ext" argument must be a string');s(u);var l,d=0,p=-1,y=!0;if(c!==void 0&&c.length>0&&c.length<=u.length){if(c.length===u.length&&c===u)return"";var v=c.length-1,x=-1;for(l=u.length-1;l>=0;--l){var I=u.charCodeAt(l);if(I===47){if(!y){d=l+1;break}}else x===-1&&(y=!1,x=l+1),v>=0&&(I===c.charCodeAt(v)?--v==-1&&(p=l):(v=-1,p=x))}return d===p?p=x:p===-1&&(p=u.length),u.slice(d,p)}for(l=u.length-1;l>=0;--l)if(u.charCodeAt(l)===47){if(!y){d=l+1;break}}else p===-1&&(y=!1,p=l+1);return p===-1?"":u.slice(d,p)},extname:function(u){s(u);for(var c=-1,l=0,d=-1,p=!0,y=0,v=u.length-1;v>=0;--v){var x=u.charCodeAt(v);if(x!==47)d===-1&&(p=!1,d=v+1),x===46?c===-1?c=v:y!==1&&(y=1):c!==-1&&(y=-1);else if(!p){l=v+1;break}}return c===-1||d===-1||y===0||y===1&&c===d-1&&c===l+1?"":u.slice(c,d)},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 d=l.dir||l.root,p=l.base||(l.name||"")+(l.ext||"");return d?d===l.root?d+p:d+"/"+p:p}(0,u)},parse:function(u){s(u);var c={root:"",dir:"",base:"",ext:"",name:""};if(u.length===0)return c;var l,d=u.charCodeAt(0),p=d===47;p?(c.root="/",l=1):l=0;for(var y=-1,v=0,x=-1,I=!0,P=u.length-1,w=0;P>=l;--P)if((d=u.charCodeAt(P))!==47)x===-1&&(I=!1,x=P+1),d===46?y===-1?y=P:w!==1&&(w=1):y!==-1&&(w=-1);else if(!I){v=P+1;break}return y===-1||x===-1||w===0||w===1&&y===x-1&&y===v+1?x!==-1&&(c.base=c.name=v===0&&p?u.slice(1,x):u.slice(v,x)):(v===0&&p?(c.name=u.slice(1,y),c.base=u.slice(1,x)):(c.name=u.slice(v,y),c.base=u.slice(v,x)),c.ext=u.slice(y,x)),v>0?c.dir=u.slice(0,v-1):p&&(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 d(U,k){if(!U.scheme&&k)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 p="",y="/",v=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class x{static isUri(k){return k instanceof x||!!k&&typeof k.authority=="string"&&typeof k.fragment=="string"&&typeof k.path=="string"&&typeof k.query=="string"&&typeof k.scheme=="string"&&typeof k.fsPath=="string"&&typeof k.with=="function"&&typeof k.toString=="function"}scheme;authority;path;query;fragment;constructor(k,M,L,q,ce,ae=!1){typeof k=="object"?(this.scheme=k.scheme||p,this.authority=k.authority||p,this.path=k.path||p,this.query=k.query||p,this.fragment=k.fragment||p):(this.scheme=function(Ct,dt){return Ct||dt?Ct:"file"}(k,ae),this.authority=M||p,this.path=function(Ct,dt){switch(Ct){case"https":case"http":case"file":dt?dt[0]!==y&&(dt=y+dt):dt=y}return dt}(this.scheme,L||p),this.query=q||p,this.fragment=ce||p,d(this,ae))}get fsPath(){return j(this,!1)}with(k){if(!k)return this;let{scheme:M,authority:L,path:q,query:ce,fragment:ae}=k;return M===void 0?M=this.scheme:M===null&&(M=p),L===void 0?L=this.authority:L===null&&(L=p),q===void 0?q=this.path:q===null&&(q=p),ce===void 0?ce=this.query:ce===null&&(ce=p),ae===void 0?ae=this.fragment:ae===null&&(ae=p),M===this.scheme&&L===this.authority&&q===this.path&&ce===this.query&&ae===this.fragment?this:new P(M,L,q,ce,ae)}static parse(k,M=!1){let L=v.exec(k);return L?new P(L[2]||p,fe(L[4]||p),fe(L[5]||p),fe(L[7]||p),fe(L[9]||p),M):new P(p,p,p,p,p)}static file(k){let M=p;if(a.isWindows&&(k=k.replace(/\\/g,y)),k[0]===y&&k[1]===y){let L=k.indexOf(y,2);L===-1?(M=k.substring(2),k=y):(M=k.substring(2,L),k=k.substring(L)||y)}return new P("file",M,k,p,p)}static from(k){let M=new P(k.scheme,k.authority,k.path,k.query,k.fragment);return d(M,!0),M}toString(k=!1){return O(this,k)}toJSON(){return this}static revive(k){if(k){if(k instanceof x)return k;{let M=new P(k);return M._formatted=k.external,M._fsPath=k._sep===I?k.fsPath:null,M}}return k}}s.URI=x;let I=a.isWindows?1:void 0;class P extends x{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=j(this,!1)),this._fsPath}toString(k=!1){return k?O(this,!0):(this._formatted||(this._formatted=O(this,!1)),this._formatted)}toJSON(){let k={$mid:1};return this._fsPath&&(k.fsPath=this._fsPath,k._sep=I),this._formatted&&(k.external=this._formatted),this.path&&(k.path=this.path),this.scheme&&(k.scheme=this.scheme),this.authority&&(k.authority=this.authority),this.query&&(k.query=this.query),this.fragment&&(k.fragment=this.fragment),k}}let w={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 E(U,k,M){let L,q=-1;for(let ce=0;ce<U.length;ce++){let ae=U.charCodeAt(ce);if(ae>=97&&ae<=122||ae>=65&&ae<=90||ae>=48&&ae<=57||ae===45||ae===46||ae===95||ae===126||k&&ae===47||M&&ae===91||M&&ae===93||M&&ae===58)q!==-1&&(L+=encodeURIComponent(U.substring(q,ce)),q=-1),L!==void 0&&(L+=U.charAt(ce));else{L===void 0&&(L=U.substr(0,ce));let Ct=w[ae];Ct!==void 0?(q!==-1&&(L+=encodeURIComponent(U.substring(q,ce)),q=-1),L+=Ct):q===-1&&(q=ce)}}return q!==-1&&(L+=encodeURIComponent(U.substring(q))),L!==void 0?L:U}function _(U){let k;for(let M=0;M<U.length;M++){let L=U.charCodeAt(M);L===35||L===63?(k===void 0&&(k=U.substr(0,M)),k+=w[L]):k!==void 0&&(k+=U[M])}return k!==void 0?k:U}function j(U,k){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?k?U.path.substr(1):U.path[1].toLowerCase()+U.path.substr(2):U.path,a.isWindows&&(M=M.replace(/\//g,"\\")),M}function O(U,k){let M=k?_:E,L="",{scheme:q,authority:ce,path:ae,query:Ct,fragment:dt}=U;if(q&&(L+=q,L+=":"),(ce||q==="file")&&(L+=y,L+=y),ce){let Pe=ce.indexOf("@");if(Pe!==-1){let rn=ce.substr(0,Pe);ce=ce.substr(Pe+1),Pe=rn.lastIndexOf(":"),Pe===-1?L+=M(rn,!1,!1):(L+=M(rn.substr(0,Pe),!1,!1),L+=":",L+=M(rn.substr(Pe+1),!1,!0)),L+="@"}ce=ce.toLowerCase(),Pe=ce.lastIndexOf(":"),Pe===-1?L+=M(ce,!1,!0):(L+=M(ce.substr(0,Pe),!1,!0),L+=ce.substr(Pe))}if(ae){if(ae.length>=3&&ae.charCodeAt(0)===47&&ae.charCodeAt(2)===58){let Pe=ae.charCodeAt(1);Pe>=65&&Pe<=90&&(ae=`/${String.fromCharCode(Pe+32)}:${ae.substr(3)}`)}else if(ae.length>=2&&ae.charCodeAt(1)===58){let Pe=ae.charCodeAt(0);Pe>=65&&Pe<=90&&(ae=`${String.fromCharCode(Pe+32)}:${ae.substr(2)}`)}L+=M(ae,!0,!1)}return Ct&&(L+="?",L+=M(Ct,!1,!1)),dt&&(L+="#",L+=k?dt:E(dt,!1,!1)),L}function H(U){try{return decodeURIComponent(U)}catch{return U.length>3?U.substr(0,3)+H(U.substr(3)):U}}s.uriToFsPath=j;let re=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function fe(U){return U.match(re)?U.replace(re,k=>H(k)):U}},679:function(i,s,o){var a=this&&this.__createBinding||(Object.create?function(v,x,I,P){P===void 0&&(P=I);var w=Object.getOwnPropertyDescriptor(x,I);w&&!("get"in w?!x.__esModule:w.writable||w.configurable)||(w={enumerable:!0,get:function(){return x[I]}}),Object.defineProperty(v,P,w)}:function(v,x,I,P){P===void 0&&(P=I),v[P]=x[I]}),u=this&&this.__setModuleDefault||(Object.create?function(v,x){Object.defineProperty(v,"default",{enumerable:!0,value:x})}:function(v,x){v.default=x}),c=this&&this.__importStar||function(v){if(v&&v.__esModule)return v;var x={};if(v!=null)for(var I in v)I!=="default"&&Object.prototype.hasOwnProperty.call(v,I)&&a(x,v,I);return u(x,v),x};Object.defineProperty(s,"__esModule",{value:!0}),s.Utils=void 0;let l=c(o(470)),d=l.posix||l,p="/";var y;(function(v){v.joinPath=function(x,...I){return x.with({path:d.join(x.path,...I)})},v.resolvePath=function(x,...I){let P=x.path,w=!1;P[0]!==p&&(P=p+P,w=!0);let E=d.resolve(P,...I);return w&&E[0]===p&&!x.authority&&(E=E.substring(1)),x.with({path:E})},v.dirname=function(x){if(x.path.length===0||x.path===p)return x;let I=d.dirname(x.path);return I.length===1&&I.charCodeAt(0)===46&&(I=""),x.with({path:I})},v.basename=function(x){return d.basename(x.path)},v.extname=function(x){return d.extname(x.path)}})(y||(s.Utils=y={}))}},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 qd=m(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});Nd.MarkdownString=void 0;var db=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+=`
221
+ `,this.value+=n,this.value+="\n```\n",this}toString(){return this.value}};Nd.MarkdownString=db});var jd=m(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.createHover=gt.createSignatureInfo=gt.appendTooltipBody=gt.appendTooltipHeader=gt.createTooltipHeader=gt.formatDefaultValue=gt.formatTypes=void 0;var Bx=qs(),Ux=qd();function fb(t=[]){return t.map(e=>e.toString().replace(",","\u066B")).join(" or ")}gt.formatTypes=fb;function Hx(t){return typeof t=="string"?`"${t}"`:t.toString()}gt.formatDefaultValue=Hx;var mq=(t,e)=>{let n=e.getArguments()||[],r=fb(e.getReturns())||"null";if(n.length===0)return`(${t.kind}) ${t.label} (): ${r}`;let i=n.map(s=>`${s.getLabel()}${s.isOptional()?"?":""}: ${fb(s.getTypes())}${s.getDefault()?` = ${Hx(s.getDefault().value)}`:""}`).join(", ");return`(${t.kind}) ${t.label} (${i}): ${r}`};gt.createTooltipHeader=mq;var gq=(t,e,n)=>{t.appendCodeblock(Bx.LanguageId,(0,gt.createTooltipHeader)(e,n)),t.appendMarkdown(`***
222
222
  `)};gt.appendTooltipHeader=gq;var yq=(t,e)=>{let n=e.getExample()||[];t.appendMarkdown(e.getDescription()+`
223
223
  `),n.length>0&&(t.appendMarkdown(`#### Examples:
224
224
  `),t.appendCodeblock(Bx.LanguageId,n.join(`
225
- `)))};gt.appendTooltipBody=yq;var bq=t=>{let e=[];for(let n of t.signatureDefinitions){let r=n,s={label:(0,gt.createTooltipHeader)(t,r)},o=r.getArguments()??[],a=new Ux.MarkdownString("");(0,gt.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};gt.createSignatureInfo=bq;var _q=t=>{let e=[];for(let n of t.signatureDefinitions){let r=new Ux.MarkdownString(""),i=n;(0,gt.appendTooltipHeader)(r,t,i),(0,gt.appendTooltipBody)(r,i),e.push(r)}return{contents:e.map(n=>n.toString())}};gt.createHover=_q});var Vx=m(vo=>{"use strict";var vq=vo&&vo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(vo,"__esModule",{value:!0});vo.activate=void 0;var Wx=Fr(),hb=$n(),Sq=vq(require("path")),Fd=Ld(),Tq=fo(),Gx=qd(),mb=jd(),wq=qs();function Eq(t){async function e(n,r){let i=new Gx.MarkdownString(""),o=r.closest.path,a=await t.fs.getWorkspaceFolderUris(),u=o.startsWith("/")?a[0]:Fd.Utils.joinPath(Fd.URI.parse(n.uri),".."),c=Fd.Utils.joinPath(u,o),l=Fd.Utils.joinPath(u,`${o}`),d=await t.fs.findExistingPath(c.toString(),l.toString()),p=[`[Inserts file "${Sq.default.basename(d)}" inside this code when building](${d.toString()})`,"***","Click the link above to open the file."];return i.appendMarkdown(p.join(`
226
- `)),{contents:i.toString()}}t.connection.onHover(async n=>{if(!t.getConfiguration().hoverdocs)return;let r=await t.fs.getTextDocument(n.textDocument.uri),i=new Tq.LookupHelper(r,t),s=i.lookupAST(n.position);if(!s)return;if(s.closest.type===Wx.ASTType.FeatureImportExpression||s.closest.type===Wx.ASTType.FeatureIncludeExpression)return await e(r,s);let o=await i.lookupTypeInfo(s);if(!o)return;if(o.isCallable())return(0,mb.createHover)(o);let a=new Gx.MarkdownString(""),u=Array.from(o.types).map(hb.SignatureDefinitionTypeMeta.parse),c=`(${o.kind}) ${o.label}: ${(0,mb.formatTypes)(u)}`;if(o.types.has(hb.SignatureDefinitionBaseType.Map)){let l={};for(let[d,p]of o.values){let y=Array.from(p.types).map(hb.SignatureDefinitionTypeMeta.parse);l[d.slice(2)]=(0,mb.formatTypes)(y)}c+=" "+JSON.stringify(l,null,2)}return a.appendCodeblock(wq.LanguageId,c),{contents:a.toString()}})}vo.activate=Eq});var Kx=m($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});$d.activate=void 0;var zx=je(),Aq=fo(),xq=jd(),kq=t=>{if(t.closest.type===zx.ASTType.CallExpression)return t.closest;for(let e=t.outer.length-1;e>=0;e--){let n=t.outer[e];if(n.type===zx.ASTType.CallExpression)return n}return null};function Cq(t){t.connection.onSignatureHelp(async e=>{if(!t.getConfiguration().autocomplete)return;let n=await t.fs.getTextDocument(e.textDocument.uri);await t.documentManager.getLatest(n);let r=new Aq.LookupHelper(n,t),i=r.lookupAST(e.position);if(!i)return;let{closest:s}=i,o=kq(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(d=>{let p=d.start.character-1,y=d.end.character;return p<=e.position.character&&y>=e.position.character}),l={activeParameter:c===-1?0:c,signatures:[],activeSignature:0};return l.signatures.push(...(0,xq.createSignatureInfo)(a)),l})}$d.activate=Cq});var Yx=m(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});Bd.activate=void 0;var Xx=qs();function Oq(t){let e=r=>r.languageId!==Xx.LanguageId?!1:t.documentManager.schedule(r),n=r=>{r.languageId===Xx.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)}Bd.activate=Oq});var Qx=m(So=>{"use strict";var Rq=So&&So.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(So,"__esModule",{value:!0});So.activate=void 0;var Dq=$a(),Iq=xy(),Pq=Rq(Ua()),Jx=(t,e)=>{let n=Pq.default.get(t.uri),r=n.resolveAllAssignmentsWithQuery(e),i=[];for(let s of r){let o=s,a=n.resolveNamespace(o.variable,!0),u=a?.label??(0,Dq.createExpressionId)(s.variable),c=a?.kind?(0,Iq.getSymbolItemKind)(a.kind):13,l={line:o.variable.start.line-1,character:o.variable.start.character-1},d={line:o.variable.end.line-1,character:o.variable.end.character-1};i.push({name:u,containerName:u,kind:c,location:{uri:t.uri,range:{start:l,end:d}}})}return i};function Mq(t){t.connection.onDocumentSymbol(async e=>{let n=await t.fs.getTextDocument(e.textDocument.uri);return t.documentManager.get(n).document?Jx(n,""):[]}),t.connection.onWorkspaceSymbol(e=>{let n=[];for(let r of t.fs.getAllTextDocuments())t.documentManager.get(r).document&&n.push(...Jx(r,e.query));return n})}So.activate=Mq});var Sb=m((wU,nk)=>{var Ya=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Lq=typeof AbortController=="function",Ud=Lq?AbortController:class{constructor(){this.signal=new Zx}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})}},Nq=typeof AbortSignal=="function",qq=typeof Ud.AbortSignal=="function",Zx=Nq?AbortSignal:qq?Ud.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))}},_b=new Set,gb=(t,e)=>{let n=`LRU_CACHE_OPTION_${t}`;Hd(n)&&vb(n,`${t} option`,`options.${e}`,wo)},yb=(t,e)=>{let n=`LRU_CACHE_METHOD_${t}`;if(Hd(n)){let{prototype:r}=wo,{get:i}=Object.getOwnPropertyDescriptor(r,t);vb(n,`${t} method`,`cache.${e}()`,i)}},jq=(t,e)=>{let n=`LRU_CACHE_PROPERTY_${t}`;if(Hd(n)){let{prototype:r}=wo,{get:i}=Object.getOwnPropertyDescriptor(r,t);vb(n,`${t} property`,`cache.${e}`,i)}},ek=(...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},Hd=t=>!_b.has(t),vb=(t,e,n,r)=>{_b.add(t);let i=`The ${e} is deprecated. Please use ${n} instead.`;ek(i,"DeprecationWarning",t,r)},xi=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),tk=t=>xi(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?To:null:null,To=class extends Array{constructor(e){super(e),this.fill(0)}},bb=class{constructor(e){if(e===0)return[];let n=tk(e);this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},wo=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:d,noUpdateTTL:p,maxSize:y=0,maxEntrySize:v=0,sizeCalculation:x,fetchMethod:I,fetchContext:P,noDeleteOnFetchRejection:w,noDeleteOnStaleGet:E,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:j,ignoreFetchAbort:O}=e,{length:H,maxAge:re,stale:fe}=e instanceof t?{}:e;if(n!==0&&!xi(n))throw new TypeError("max option must be a nonnegative integer");let U=n?tk(n):Array;if(!U)throw new Error("invalid max value: "+n);if(this.max=n,this.maxSize=y,this.maxEntrySize=v||this.maxSize,this.sizeCalculation=x||H,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=I||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=P,!this.fetchMethod&&P!==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 bb(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=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!w,this.allowStaleOnFetchRejection=!!_,this.allowStaleOnFetchAbort=!!j,this.ignoreFetchAbort=!!O,this.maxEntrySize!==0){if(this.maxSize!==0&&!xi(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!xi(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!u||!!fe,this.noDeleteOnStaleGet=!!E,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=xi(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||re||0,this.ttl){if(!xi(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 k="LRU_CACHE_UNBOUNDED";Hd(k)&&(_b.add(k),ek("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",k,t))}fe&&gb("stale","allowStale"),re&&gb("maxAge","ttl"),H&&gb("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new To(this.max),this.starts=new To(this.max),this.setItemTTL=(r,i,s=Ya.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?Ya.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=Ya.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 To(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(!xi(r))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(r=i(n,e),!xi(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 yb("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=Ya.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=Ya.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 d=this.valList[l];if(n!==d){if(this.isBackgroundFetch(d)?d.__abortController.abort(new Error("replaced")):s||(this.dispose(d,e,"set"),this.disposeAfter&&this.disposed.push([d,e,"set"])),this.removeItemSize(l),this.valList[l]=n,this.addItemSize(l,o,c),c){c.set="replace";let p=d&&this.isBackgroundFetch(d)?d.__staleWhileFetching:d;p!==void 0&&(c.oldValue=p)}}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 Ud;r.signal&&r.signal.addEventListener("abort",()=>o.abort(r.signal.reason));let a={signal:o.signal,options:r,context:i},u=(y,v=!1)=>{let{aborted:x}=o.signal,I=r.ignoreFetchAbort&&y!==void 0;return r.status&&(x&&!v?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,I&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),x&&!I&&!v?l(o.signal.reason):(this.valList[n]===p&&(y===void 0?p.__staleWhileFetching?this.valList[n]=p.__staleWhileFetching:this.delete(e):(r.status&&(r.status.fetchUpdated=!0),this.set(e,y,a.options))),y)},c=y=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=y),l(y)),l=y=>{let{aborted:v}=o.signal,x=v&&r.allowStaleOnFetchAbort,I=x||r.allowStaleOnFetchRejection,P=I||r.noDeleteOnFetchRejection;if(this.valList[n]===p&&(!P||p.__staleWhileFetching===void 0?this.delete(e):x||(this.valList[n]=p.__staleWhileFetching)),I)return r.status&&p.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw y},d=(y,v)=>{this.fetchMethod(e,s,a).then(x=>y(x),v),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(y(),r.allowStaleOnFetchAbort&&(y=x=>u(x,!0)))})};r.status&&(r.status.fetchDispatched=!0);let p=new Promise(d).then(u,c);return p.__abortController=o,p.__staleWhileFetching=s,p.__returned=null,n===void 0?(this.set(e,p,{...a.options,status:void 0}),n=this.keyMap.get(e)):this.valList[n]=p,p}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:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,fetchContext:v=this.fetchContext,forceRefresh:x=!1,status:I,signal:P}={}){if(!this.fetchMethod)return I&&(I.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:I});let w={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:s,noDisposeOnSet:o,size:a,sizeCalculation:u,noUpdateTTL:c,noDeleteOnFetchRejection:l,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:y,ignoreFetchAbort:p,status:I,signal:P},E=this.keyMap.get(e);if(E===void 0){I&&(I.fetch="miss");let _=this.backgroundFetch(e,E,w,v);return _.__returned=_}else{let _=this.valList[E];if(this.isBackgroundFetch(_)){let fe=n&&_.__staleWhileFetching!==void 0;return I&&(I.fetch="inflight",fe&&(I.returnedStale=!0)),fe?_.__staleWhileFetching:_.__returned=_}let j=this.isStale(E);if(!x&&!j)return I&&(I.fetch="hit"),this.moveToTail(E),r&&this.updateItemAge(E),this.statusTTL(I,E),_;let O=this.backgroundFetch(e,E,w,v),H=O.__staleWhileFetching!==void 0,re=H&&n;return I&&(I.fetch=H&&j?"stale":"refresh",re&&j&&(I.returnedStale=!0)),re?O.__staleWhileFetching:O.__returned=O}}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 yb("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 yb("reset","clear"),this.clear}get length(){return jq("length","size"),this.size}static get AbortController(){return Ud}static get AbortSignal(){return Zx}};nk.exports=wo});var ck=m((EU,uk)=>{var Ab=Object.defineProperty,Fq=Object.getOwnPropertyDescriptor,$q=Object.getOwnPropertyNames,Bq=Object.prototype.hasOwnProperty,Uq=(t,e)=>{for(var n in e)Ab(t,n,{get:e[n],enumerable:!0})},Hq=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of $q(e))!Bq.call(t,i)&&i!==n&&Ab(t,i,{get:()=>e[i],enumerable:!(r=Fq(e,i))||r.enumerable});return t},Wq=t=>Hq(Ab({},"__esModule",{value:!0}),t),rk={};Uq(rk,{ScheduleIntervalHelper:()=>Tb,SchedulePostMessageHelper:()=>wb,ScheduleSetImmmediateHelper:()=>Eb,schedule:()=>zq,scheduleProvider:()=>ak});uk.exports=Wq(rk);var Gq=Promise.prototype.then.bind(Promise.resolve()),xb=class Wd{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,Wd.QUEUE_LIMIT);this.queue=this.queue.slice(Wd.QUEUE_LIMIT);for(let r=0;r<n;Gq(e[r++]));if(this.queue.length>0&&(this.sleep=0),this.sleep++<=Wd.SLEEP_LIMIT){this.nextTick();return}this.endTick()}start(){this.isTickActive()||(this.sleep=0,this.startTick())}add(e){this.queue.push(e),this.start()}},Tb=class ik extends xb{constructor(){super(...arguments),this.timer=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setInterval}static createCallback(){let e=new ik;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}},Vq=()=>{try{return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}catch{}return!1},wb=class sk extends xb{constructor(){super(),this.id=(Math.random()+1).toString(36).substring(7),this.active=!1,self.addEventListener("message",this.onMessage.bind(this))}static isApplicable(){return!Vq()&&!!self.postMessage&&!!self.addEventListener}static createCallback(){let e=new sk;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}},Eb=class ok extends xb{constructor(){super(...arguments),this.immediate=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setImmediate}static createCallback(){let e=new ok;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 ak(){if(Eb.isApplicable())return Eb.createCallback();if(wb.isApplicable())return wb.createCallback();if(Tb.isApplicable())return Tb.createCallback();throw new Error("No schedule helper fulfills requirements!")}var zq=ak()});var fk=m(wn=>{"use strict";var Cb=wn&&wn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(wn,"__esModule",{value:!0});wn.DocumentManager=wn.PROCESSING_TIMEOUT=wn.ActiveDocument=wn.DocumentURIBuilder=void 0;var Kq=Cb(require("events")),lk=Fr(),Xq=Cb(Sb()),Gd=ck(),Vd=Ld(),dk=Cb(Ua()),zd=class{constructor(e,n=null){this.workspaceFolderUri=n,this.rootPath=e}getFromWorkspaceFolder(e){if(this.workspaceFolderUri==null)throw new Error("Workspace folder is not defined!");return Vd.Utils.joinPath(this.workspaceFolderUri,e).toString()}getFromRootPath(e){return Vd.Utils.joinPath(this.rootPath,e).toString()}};wn.DocumentURIBuilder=zd;var Eo=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 Vd.Utils.joinPath(Vd.URI.parse(this.textDocument.uri),"..")}getImportsAndIncludes(e=null){if(this.document==null)return[];let n=this.document,r=this.getDirectory(),i=this.documentManager.context,s=new zd(r,e),o=a=>a.startsWith("/")?i.fs.findExistingPath(s.getFromWorkspaceFolder(a),s.getFromWorkspaceFolder(`${a}.src`)):i.fs.findExistingPath(s.getFromRootPath(a),s.getFromRootPath(`${a}.src`));return[...n.imports.filter(a=>a.path).map(a=>o(a.path)),...n.includes.filter(a=>a.path).map(a=>o(a.path))]}async getDependencies(){if(this.document==null)return[];if(this.dependencies)return this.dependencies;let e=await this.documentManager.context.fs.getWorkspaceFolderUris(),n=this.getImportsAndIncludes(e[0]),r=new Set([...n]);return this.dependencies=Array.from(r),this.dependencies}async getImports(){if(this.document==null)return[];let e=new Set,n=new Set([this.textDocument.uri]),r=async i=>{let s=await i.getDependencies();for(let o of s){if(n.has(o))continue;let a=await this.documentManager.open(o);n.add(o),a!==null&&(e.add(a),a.document!==null&&await r(a))}};return await r(this),Array.from(e)}};wn.ActiveDocument=Eo;wn.PROCESSING_TIMEOUT=100;var kb=class extends Kq.default{get context(){return this._context}setContext(e){return this._context=e,this}constructor(e=wn.PROCESSING_TIMEOUT){super(),this._context=null,this.results=new Xq.default({ttl:1e3*60*20,ttlAutopurge:!0}),this.scheduledItems=new Map,this.tickRef=this.tick.bind(this),this.processingTimeout=e,(0,Gd.schedule)(this.tickRef)}tick(){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,Gd.schedule)(()=>this.refresh(i.document))}(0,Gd.schedule)(this.tickRef)}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 lk.Parser(n,{unsafe:!0}),i=r.parseChunk();if(i.body?.length>0)return dk.default.analyze(e.uri,i),new Eo({documentManager:this,content:n,textDocument:e,document:i,errors:[...r.lexer.errors,...r.errors]});try{let o=new lk.Parser(e.getText()).parseChunk();return dk.default.analyze(e.uri,o),new Eo({documentManager:this,content:n,textDocument:e,document:o,errors:[]})}catch(s){return new Eo({documentManager:this,content:n,textDocument:e,document:null,errors:[s]})}}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()}),!0)}async open(e){try{let n=await this.context.fs.getTextDocument(e);return 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,Gd.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)}};wn.DocumentManager=kb});var hk=m(Ao=>{"use strict";var Yq=Ao&&Ao.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ao,"__esModule",{value:!0});Ao.CoreContext=void 0;var Jq=Yq(require("events")),Ob=qs();function pk(t){return{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??Ob.IndentationType.Tab,indentationSpaces:t?.transpiler?.beautify?.indentationSpaces??2}}}}var Rb=class extends Jq.default{constructor(){super(),this._configuration=pk(),this._features={configuration:!1,workspaceFolder:!1}}get features(){return this._features}getConfiguration(){return this._configuration}async syncConfiguraton(){let e=await this.connection.workspace.getConfiguration(Ob.ConfigurationNamespace);this._configuration=pk(e)}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,signatureHelpProvider:{triggerCharacters:[",","("]},documentSymbolProvider:!0,workspaceSymbolProvider:!0,diagnosticProvider:{identifier:Ob.LanguageId,interFileDependencies:!1,workspaceDiagnostics:!1},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()}};Ao.CoreContext=Rb});var Kd=m(K=>{"use strict";var Qq=K&&K.__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]}),Zq=K&&K.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ej=K&&K.__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)&&Qq(e,t,n);return Zq(e,t),e},tj=K&&K.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(K,"__esModule",{value:!0});K.CoreContext=K.typeAnalyzer=K.lookupBase=K.lookupIdentifier=K.appendTooltipHeader=K.appendTooltipBody=K.formatTypes=K.formatDefaultValue=K.createTooltipHeader=K.createSignatureInfo=K.createHover=K.MarkdownString=K.LookupHelper=K.DocumentManager=K.ActiveDocument=K.ASTScraper=K.activateSymbol=K.activateSubscriptions=K.activateSignature=K.activateHover=K.activateFormatter=K.activateDiagnostic=K.activateDefinition=K.activateColor=K.activateAutocomplete=K.ConfigurationNamespace=K.LanguageId=K.IndentationType=void 0;var Db=qs();Object.defineProperty(K,"IndentationType",{enumerable:!0,get:function(){return Db.IndentationType}});Object.defineProperty(K,"LanguageId",{enumerable:!0,get:function(){return Db.LanguageId}});Object.defineProperty(K,"ConfigurationNamespace",{enumerable:!0,get:function(){return Db.ConfigurationNamespace}});var nj=sx();Object.defineProperty(K,"activateAutocomplete",{enumerable:!0,get:function(){return nj.activate}});var rj=mx();Object.defineProperty(K,"activateColor",{enumerable:!0,get:function(){return rj.activate}});var ij=bx();Object.defineProperty(K,"activateDefinition",{enumerable:!0,get:function(){return ij.activate}});var sj=_x();Object.defineProperty(K,"activateDiagnostic",{enumerable:!0,get:function(){return sj.activate}});var oj=$x();Object.defineProperty(K,"activateFormatter",{enumerable:!0,get:function(){return oj.activate}});var aj=Vx();Object.defineProperty(K,"activateHover",{enumerable:!0,get:function(){return aj.activate}});var uj=Kx();Object.defineProperty(K,"activateSignature",{enumerable:!0,get:function(){return uj.activate}});var cj=Yx();Object.defineProperty(K,"activateSubscriptions",{enumerable:!0,get:function(){return cj.activate}});var lj=Qx();Object.defineProperty(K,"activateSymbol",{enumerable:!0,get:function(){return lj.activate}});K.ASTScraper=ej(Cy());var mk=fk();Object.defineProperty(K,"ActiveDocument",{enumerable:!0,get:function(){return mk.ActiveDocument}});Object.defineProperty(K,"DocumentManager",{enumerable:!0,get:function(){return mk.DocumentManager}});var dj=fo();Object.defineProperty(K,"LookupHelper",{enumerable:!0,get:function(){return dj.LookupHelper}});var fj=qd();Object.defineProperty(K,"MarkdownString",{enumerable:!0,get:function(){return fj.MarkdownString}});var cs=jd();Object.defineProperty(K,"createHover",{enumerable:!0,get:function(){return cs.createHover}});Object.defineProperty(K,"createSignatureInfo",{enumerable:!0,get:function(){return cs.createSignatureInfo}});Object.defineProperty(K,"createTooltipHeader",{enumerable:!0,get:function(){return cs.createTooltipHeader}});Object.defineProperty(K,"formatDefaultValue",{enumerable:!0,get:function(){return cs.formatDefaultValue}});Object.defineProperty(K,"formatTypes",{enumerable:!0,get:function(){return cs.formatTypes}});Object.defineProperty(K,"appendTooltipBody",{enumerable:!0,get:function(){return cs.appendTooltipBody}});Object.defineProperty(K,"appendTooltipHeader",{enumerable:!0,get:function(){return cs.appendTooltipHeader}});var Ib=Ua();Object.defineProperty(K,"lookupIdentifier",{enumerable:!0,get:function(){return Ib.lookupIdentifier}});Object.defineProperty(K,"lookupBase",{enumerable:!0,get:function(){return Ib.lookupBase}});Object.defineProperty(K,"typeAnalyzer",{enumerable:!0,get:function(){return tj(Ib).default}});var pj=hk();Object.defineProperty(K,"CoreContext",{enumerable:!0,get:function(){return pj.CoreContext}})});var _k={};Ik(_k,{TextDocument:()=>Pb});function Mb(t,e){if(t.length<=1)return t;let n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);Mb(r,e),Mb(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 gk(t,e,n=0){let r=e?[n]:[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);yk(s)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function yk(t){return t===13||t===10}function bk(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 hj(t){let e=bk(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var Xd,Pb,vk=Dk(()=>{"use strict";Xd=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=bk(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=gk(r.text,!1,s);if(u-a===l.length)for(let p=0,y=l.length;p<y;p++)c[p+a+1]=l[p];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 d=r.text.length-(o-s);if(d!==0)for(let p=a+1+l.length,y=c.length;p<y;p++)c[p]=c[p]+d}else if(t.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=gk(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&&yk(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 Xd(i,s,o,a)}t.create=e;function n(i,s,o){if(i instanceof Xd)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=Mb(s.map(hj),(l,d)=>{let p=l.range.start.line-d.range.start.line;return p===0?l.range.start.character-d.range.start.character:p}),u=0,c=[];for(let l of a){let d=i.offsetAt(l.range.start);if(d<u)throw new Error("Overlapping edit");d>u&&c.push(o.substring(u,d)),l.newText.length&&c.push(l.newText),u=i.offsetAt(l.range.end)}return c.push(o.substr(u)),c.join("")}t.applyEdits=r})(Pb||(Pb={}))});var Tk=m(xo=>{"use strict";var qb=xo&&xo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xo,"__esModule",{value:!0});xo.FileSystem=void 0;var mj=Jp(),Sk=(vk(),Mk(_k)),gj=qb(require("events")),Lb=Ld(),yj=qb(require("fs")),bj=Kd(),_j=qb(Sb()),Nb=class extends gj.default{constructor(e){super(),this._context=e,this._textDocumentManager=new mj.TextDocuments(Sk.TextDocument),this._tempTextDocumentCache=new _j.default({ttl:1e3,max:100})}async getWorkspaceFolderUris(){if(!this._context.features.workspaceFolder)return[];let e=await this._workspace.getWorkspaceFolders();return Array.from(new Set(e.map(n=>n.uri))).map(n=>Lb.URI.parse(n))}findExistingPath(...e){if(e.length===0)return"";for(let n=0;n<e.length;n++)if(this.getTextDocument(e[n])!=null)return e[n];return e[0]}getAllTextDocuments(){return this._textDocumentManager.all()}async fetchTextDocument(e){let n=Lb.URI.parse(e),r=this._tempTextDocumentCache.get(e);if(r!=null)return r;let i=null;try{let s=await yj.default.promises.readFile(n.fsPath,{encoding:"utf-8"});i=Sk.TextDocument.create(e,bj.LanguageId,0,s)}catch{}return this._tempTextDocumentCache.set(e,i),i}async getTextDocument(e){let n=this._textDocumentManager.get(e);return n||(Lb.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)})}};xo.FileSystem=Nb});var Ak=m(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});Yd.NodeContext=void 0;var wk=Jp(),Ek=Kd(),vj=Tk(),jb=class extends Ek.CoreContext{constructor(){super(),this.documentManager=new Ek.DocumentManager().setContext(this),this.connection=(0,wk.createConnection)(wk.ProposedFeatures.all),this.fs=new vj.FileSystem(this)}};Yd.NodeContext=jb});Object.defineProperty(exports,"__esModule",{value:!0});var Sj=Ak(),Ur=Kd(),xk=new Sj.NodeContext;xk.on("ready",t=>{(0,Ur.activateAutocomplete)(t),(0,Ur.activateColor)(t),(0,Ur.activateDefinition)(t),(0,Ur.activateDiagnostic)(t),(0,Ur.activateFormatter)(t),(0,Ur.activateHover)(t),(0,Ur.activateSignature)(t),(0,Ur.activateSubscriptions)(t),(0,Ur.activateSymbol)(t)});xk.listen();
225
+ `)))};gt.appendTooltipBody=yq;var bq=t=>{let e=[];for(let n of t.signatureDefinitions){let r=n,s={label:(0,gt.createTooltipHeader)(t,r)},o=r.getArguments()??[],a=new Ux.MarkdownString("");(0,gt.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};gt.createSignatureInfo=bq;var _q=t=>{let e=[];for(let n of t.signatureDefinitions){let r=new Ux.MarkdownString(""),i=n;(0,gt.appendTooltipHeader)(r,t,i),(0,gt.appendTooltipBody)(r,i),e.push(r)}return{contents:e.map(n=>n.toString())}};gt.createHover=_q});var Vx=m(vo=>{"use strict";var vq=vo&&vo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(vo,"__esModule",{value:!0});vo.activate=void 0;var Wx=Fr(),pb=$n(),Sq=vq(require("path")),Fd=Ld(),Tq=fo(),Gx=qd(),hb=jd(),wq=qs();function Eq(t){async function e(n,r){let i=new Gx.MarkdownString(""),o=r.closest.path,a=await t.fs.getWorkspaceFolderUris(),u=o.startsWith("/")?a[0]:Fd.Utils.joinPath(Fd.URI.parse(n.uri),".."),c=Fd.Utils.joinPath(u,o),l=Fd.Utils.joinPath(u,`${o}`),d=await t.fs.findExistingPath(c.toString(),l.toString()),p=[`[Inserts file "${Sq.default.basename(d)}" inside this code when building](${d.toString()})`,"***","Click the link above to open the file."];return i.appendMarkdown(p.join(`
226
+ `)),{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 Tq.LookupHelper(r,t),s=i.lookupAST(n.position);if(!s)return;if(s.closest.type===Wx.ASTType.FeatureImportExpression||s.closest.type===Wx.ASTType.FeatureIncludeExpression)return await e(r,s);let o=await i.lookupTypeInfo(s);if(!o)return;if(o.isCallable())return(0,hb.createHover)(o);let a=new Gx.MarkdownString(""),u=Array.from(o.types).map(pb.SignatureDefinitionTypeMeta.parse),c=`(${o.kind}) ${o.label}: ${(0,hb.formatTypes)(u)}`;if(o.types.has(pb.SignatureDefinitionBaseType.Map)){let l={};for(let[d,p]of o.values){let y=Array.from(p.types).map(pb.SignatureDefinitionTypeMeta.parse);l[d.slice(2)]=(0,hb.formatTypes)(y)}c+=" "+JSON.stringify(l,null,2)}return a.appendCodeblock(wq.LanguageId,c),{contents:a.toString()}})}vo.activate=Eq});var Kx=m($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});$d.activate=void 0;var zx=je(),Aq=fo(),xq=jd(),kq=t=>{if(t.closest.type===zx.ASTType.CallExpression)return t.closest;for(let e=t.outer.length-1;e>=0;e--){let n=t.outer[e];if(n.type===zx.ASTType.CallExpression)return n}return null};function Cq(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 Aq.LookupHelper(n,t),i=r.lookupAST(e.position);if(!i)return;let{closest:s}=i,o=kq(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(d=>{let p=d.start.character-1,y=d.end.character;return p<=e.position.character&&y>=e.position.character}),l={activeParameter:c===-1?0:c,signatures:[],activeSignature:0};return l.signatures.push(...(0,xq.createSignatureInfo)(a)),l})}$d.activate=Cq});var Yx=m(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});Bd.activate=void 0;var Xx=qs();function Oq(t){let e=r=>r.languageId!==Xx.LanguageId?!1:t.documentManager.schedule(r),n=r=>{r.languageId===Xx.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)}Bd.activate=Oq});var Qx=m(So=>{"use strict";var Rq=So&&So.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(So,"__esModule",{value:!0});So.activate=void 0;var Dq=$a(),Iq=Ay(),Pq=Rq(Ua()),Jx=(t,e)=>{let n=Pq.default.get(t.uri),r=n.resolveAllAssignmentsWithQuery(e),i=[];for(let s of r){let o=s,a=n.resolveNamespace(o.variable,!0),u=a?.label??(0,Dq.createExpressionId)(s.variable),c=a?.kind?(0,Iq.getSymbolItemKind)(a.kind):13,l={line:o.variable.start.line-1,character:o.variable.start.character-1},d={line:o.variable.end.line-1,character:o.variable.end.character-1};i.push({name:u,containerName:u,kind:c,location:{uri:t.uri,range:{start:l,end:d}}})}return i};function Mq(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?Jx(n,""):[]}),t.connection.onWorkspaceSymbol(e=>{let n=[];for(let r of t.fs.getAllTextDocuments())t.documentManager.get(r).document&&n.push(...Jx(r,e.query));return n})}So.activate=Mq});var vb=m((wU,nk)=>{var Ya=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Lq=typeof AbortController=="function",Ud=Lq?AbortController:class{constructor(){this.signal=new Zx}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})}},Nq=typeof AbortSignal=="function",qq=typeof Ud.AbortSignal=="function",Zx=Nq?AbortSignal:qq?Ud.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))}},bb=new Set,mb=(t,e)=>{let n=`LRU_CACHE_OPTION_${t}`;Hd(n)&&_b(n,`${t} option`,`options.${e}`,wo)},gb=(t,e)=>{let n=`LRU_CACHE_METHOD_${t}`;if(Hd(n)){let{prototype:r}=wo,{get:i}=Object.getOwnPropertyDescriptor(r,t);_b(n,`${t} method`,`cache.${e}()`,i)}},jq=(t,e)=>{let n=`LRU_CACHE_PROPERTY_${t}`;if(Hd(n)){let{prototype:r}=wo,{get:i}=Object.getOwnPropertyDescriptor(r,t);_b(n,`${t} property`,`cache.${e}`,i)}},ek=(...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},Hd=t=>!bb.has(t),_b=(t,e,n,r)=>{bb.add(t);let i=`The ${e} is deprecated. Please use ${n} instead.`;ek(i,"DeprecationWarning",t,r)},xi=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),tk=t=>xi(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?To:null:null,To=class extends Array{constructor(e){super(e),this.fill(0)}},yb=class{constructor(e){if(e===0)return[];let n=tk(e);this.heap=new n(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},wo=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:d,noUpdateTTL:p,maxSize:y=0,maxEntrySize:v=0,sizeCalculation:x,fetchMethod:I,fetchContext:P,noDeleteOnFetchRejection:w,noDeleteOnStaleGet:E,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:j,ignoreFetchAbort:O}=e,{length:H,maxAge:re,stale:fe}=e instanceof t?{}:e;if(n!==0&&!xi(n))throw new TypeError("max option must be a nonnegative integer");let U=n?tk(n):Array;if(!U)throw new Error("invalid max value: "+n);if(this.max=n,this.maxSize=y,this.maxEntrySize=v||this.maxSize,this.sizeCalculation=x||H,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=I||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=P,!this.fetchMethod&&P!==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 yb(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=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!w,this.allowStaleOnFetchRejection=!!_,this.allowStaleOnFetchAbort=!!j,this.ignoreFetchAbort=!!O,this.maxEntrySize!==0){if(this.maxSize!==0&&!xi(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!xi(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!u||!!fe,this.noDeleteOnStaleGet=!!E,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=xi(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||re||0,this.ttl){if(!xi(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 k="LRU_CACHE_UNBOUNDED";Hd(k)&&(bb.add(k),ek("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",k,t))}fe&&mb("stale","allowStale"),re&&mb("maxAge","ttl"),H&&mb("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new To(this.max),this.starts=new To(this.max),this.setItemTTL=(r,i,s=Ya.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?Ya.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=Ya.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 To(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(!xi(r))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(r=i(n,e),!xi(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 gb("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=Ya.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=Ya.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 d=this.valList[l];if(n!==d){if(this.isBackgroundFetch(d)?d.__abortController.abort(new Error("replaced")):s||(this.dispose(d,e,"set"),this.disposeAfter&&this.disposed.push([d,e,"set"])),this.removeItemSize(l),this.valList[l]=n,this.addItemSize(l,o,c),c){c.set="replace";let p=d&&this.isBackgroundFetch(d)?d.__staleWhileFetching:d;p!==void 0&&(c.oldValue=p)}}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 Ud;r.signal&&r.signal.addEventListener("abort",()=>o.abort(r.signal.reason));let a={signal:o.signal,options:r,context:i},u=(y,v=!1)=>{let{aborted:x}=o.signal,I=r.ignoreFetchAbort&&y!==void 0;return r.status&&(x&&!v?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,I&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),x&&!I&&!v?l(o.signal.reason):(this.valList[n]===p&&(y===void 0?p.__staleWhileFetching?this.valList[n]=p.__staleWhileFetching:this.delete(e):(r.status&&(r.status.fetchUpdated=!0),this.set(e,y,a.options))),y)},c=y=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=y),l(y)),l=y=>{let{aborted:v}=o.signal,x=v&&r.allowStaleOnFetchAbort,I=x||r.allowStaleOnFetchRejection,P=I||r.noDeleteOnFetchRejection;if(this.valList[n]===p&&(!P||p.__staleWhileFetching===void 0?this.delete(e):x||(this.valList[n]=p.__staleWhileFetching)),I)return r.status&&p.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw y},d=(y,v)=>{this.fetchMethod(e,s,a).then(x=>y(x),v),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(y(),r.allowStaleOnFetchAbort&&(y=x=>u(x,!0)))})};r.status&&(r.status.fetchDispatched=!0);let p=new Promise(d).then(u,c);return p.__abortController=o,p.__staleWhileFetching=s,p.__returned=null,n===void 0?(this.set(e,p,{...a.options,status:void 0}),n=this.keyMap.get(e)):this.valList[n]=p,p}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:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,fetchContext:v=this.fetchContext,forceRefresh:x=!1,status:I,signal:P}={}){if(!this.fetchMethod)return I&&(I.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:I});let w={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:s,noDisposeOnSet:o,size:a,sizeCalculation:u,noUpdateTTL:c,noDeleteOnFetchRejection:l,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:y,ignoreFetchAbort:p,status:I,signal:P},E=this.keyMap.get(e);if(E===void 0){I&&(I.fetch="miss");let _=this.backgroundFetch(e,E,w,v);return _.__returned=_}else{let _=this.valList[E];if(this.isBackgroundFetch(_)){let fe=n&&_.__staleWhileFetching!==void 0;return I&&(I.fetch="inflight",fe&&(I.returnedStale=!0)),fe?_.__staleWhileFetching:_.__returned=_}let j=this.isStale(E);if(!x&&!j)return I&&(I.fetch="hit"),this.moveToTail(E),r&&this.updateItemAge(E),this.statusTTL(I,E),_;let O=this.backgroundFetch(e,E,w,v),H=O.__staleWhileFetching!==void 0,re=H&&n;return I&&(I.fetch=H&&j?"stale":"refresh",re&&j&&(I.returnedStale=!0)),re?O.__staleWhileFetching:O.__returned=O}}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 gb("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 gb("reset","clear"),this.clear}get length(){return jq("length","size"),this.size}static get AbortController(){return Ud}static get AbortSignal(){return Zx}};nk.exports=wo});var ck=m((EU,uk)=>{var Eb=Object.defineProperty,Fq=Object.getOwnPropertyDescriptor,$q=Object.getOwnPropertyNames,Bq=Object.prototype.hasOwnProperty,Uq=(t,e)=>{for(var n in e)Eb(t,n,{get:e[n],enumerable:!0})},Hq=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of $q(e))!Bq.call(t,i)&&i!==n&&Eb(t,i,{get:()=>e[i],enumerable:!(r=Fq(e,i))||r.enumerable});return t},Wq=t=>Hq(Eb({},"__esModule",{value:!0}),t),rk={};Uq(rk,{ScheduleIntervalHelper:()=>Sb,SchedulePostMessageHelper:()=>Tb,ScheduleSetImmmediateHelper:()=>wb,schedule:()=>zq,scheduleProvider:()=>ak});uk.exports=Wq(rk);var Gq=Promise.prototype.then.bind(Promise.resolve()),Ab=class Wd{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,Wd.QUEUE_LIMIT);this.queue=this.queue.slice(Wd.QUEUE_LIMIT);for(let r=0;r<n;Gq(e[r++]));if(this.queue.length>0&&(this.sleep=0),this.sleep++<=Wd.SLEEP_LIMIT){this.nextTick();return}this.endTick()}start(){this.isTickActive()||(this.sleep=0,this.startTick())}add(e){this.queue.push(e),this.start()}},Sb=class ik extends Ab{constructor(){super(...arguments),this.timer=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setInterval}static createCallback(){let e=new ik;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}},Vq=()=>{try{return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}catch{}return!1},Tb=class sk extends Ab{constructor(){super(),this.id=(Math.random()+1).toString(36).substring(7),this.active=!1,self.addEventListener("message",this.onMessage.bind(this))}static isApplicable(){return!Vq()&&!!self.postMessage&&!!self.addEventListener}static createCallback(){let e=new sk;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}},wb=class ok extends Ab{constructor(){super(...arguments),this.immediate=null,this.boundTick=this.tick.bind(this)}static isApplicable(){return!!globalThis.setImmediate}static createCallback(){let e=new ok;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 ak(){if(wb.isApplicable())return wb.createCallback();if(Tb.isApplicable())return Tb.createCallback();if(Sb.isApplicable())return Sb.createCallback();throw new Error("No schedule helper fulfills requirements!")}var zq=ak()});var fk=m(wn=>{"use strict";var Cb=wn&&wn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(wn,"__esModule",{value:!0});wn.DocumentManager=wn.PROCESSING_TIMEOUT=wn.ActiveDocument=wn.DocumentURIBuilder=void 0;var Kq=Cb(require("events")),lk=Fr(),Xq=Cb(vb()),xb=ck(),Gd=Ld(),dk=Cb(Ua()),Vd=class{constructor(e,n=null){this.workspaceFolderUri=n,this.rootPath=e}getFromWorkspaceFolder(e){if(this.workspaceFolderUri==null)throw new Error("Workspace folder is not defined!");return Gd.Utils.joinPath(this.workspaceFolderUri,e).toString()}getFromRootPath(e){return Gd.Utils.joinPath(this.rootPath,e).toString()}};wn.DocumentURIBuilder=Vd;var Eo=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 Gd.Utils.joinPath(Gd.URI.parse(this.textDocument.uri),"..")}getImportsAndIncludes(e=null){if(this.document==null)return[];let n=this.document,r=this.getDirectory(),i=this.documentManager.context,s=new Vd(r,e),o=a=>a.startsWith("/")?i.fs.findExistingPath(s.getFromWorkspaceFolder(a),s.getFromWorkspaceFolder(`${a}.src`)):i.fs.findExistingPath(s.getFromRootPath(a),s.getFromRootPath(`${a}.src`));return[...n.imports.filter(a=>a.path).map(a=>o(a.path)),...n.includes.filter(a=>a.path).map(a=>o(a.path))]}async getDependencies(){if(this.document==null)return[];if(this.dependencies)return this.dependencies;let e=await this.documentManager.context.fs.getWorkspaceFolderUris(),n=this.getImportsAndIncludes(e[0]),r=new Set([...n]);return this.dependencies=Array.from(r),this.dependencies}async getImports(){if(this.document==null)return[];let e=new Set,n=new Set([this.textDocument.uri]),r=async i=>{let s=await i.getDependencies();for(let o of s){if(n.has(o))continue;let a=await this.documentManager.open(o);n.add(o),a!==null&&(e.add(a),a.document!==null&&await r(a))}};return await r(this),Array.from(e)}};wn.ActiveDocument=Eo;wn.PROCESSING_TIMEOUT=100;var kb=class extends Kq.default{get context(){return this._context}setContext(e){return this._context=e,this}constructor(e=wn.PROCESSING_TIMEOUT){super(),this._context=null,this._timer=null,this.results=new Xq.default({ttl:1e3*60*20,ttlAutopurge:!0}),this.scheduledItems=new Map,this.tickRef=this.tick.bind(this),this.processingTimeout=e,(0,xb.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,xb.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 lk.Parser(n,{unsafe:!0}),i=r.parseChunk();if(i.body?.length>0)return dk.default.analyze(e.uri,i),new Eo({documentManager:this,content:n,textDocument:e,document:i,errors:[...r.lexer.errors,...r.errors]});try{let o=new lk.Parser(e.getText()).parseChunk();return dk.default.analyze(e.uri,o),new Eo({documentManager:this,content:n,textDocument:e,document:o,errors:[]})}catch(s){return new Eo({documentManager:this,content:n,textDocument:e,document:null,errors:[s]})}}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,xb.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)}};wn.DocumentManager=kb});var hk=m(Ao=>{"use strict";var Yq=Ao&&Ao.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ao,"__esModule",{value:!0});Ao.CoreContext=void 0;var Jq=Yq(require("events")),Ob=qs();function pk(t){return{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??Ob.IndentationType.Tab,indentationSpaces:t?.transpiler?.beautify?.indentationSpaces??2}}}}var Rb=class extends Jq.default{constructor(){super(),this._configuration=pk(),this._features={configuration:!1,workspaceFolder:!1}}get features(){return this._features}getConfiguration(){return this._configuration}async syncConfiguraton(){let e=await this.connection.workspace.getConfiguration(Ob.ConfigurationNamespace);this._configuration=pk(e)}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,signatureHelpProvider:{triggerCharacters:[",","("]},documentSymbolProvider:!0,workspaceSymbolProvider:!0,diagnosticProvider:{identifier:Ob.LanguageId,interFileDependencies:!1,workspaceDiagnostics:!1},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()}};Ao.CoreContext=Rb});var zd=m(K=>{"use strict";var Qq=K&&K.__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]}),Zq=K&&K.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ej=K&&K.__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)&&Qq(e,t,n);return Zq(e,t),e},tj=K&&K.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(K,"__esModule",{value:!0});K.CoreContext=K.typeAnalyzer=K.lookupBase=K.lookupIdentifier=K.appendTooltipHeader=K.appendTooltipBody=K.formatTypes=K.formatDefaultValue=K.createTooltipHeader=K.createSignatureInfo=K.createHover=K.MarkdownString=K.LookupHelper=K.DocumentManager=K.ActiveDocument=K.ASTScraper=K.activateSymbol=K.activateSubscriptions=K.activateSignature=K.activateHover=K.activateFormatter=K.activateDiagnostic=K.activateDefinition=K.activateColor=K.activateAutocomplete=K.ConfigurationNamespace=K.LanguageId=K.IndentationType=void 0;var Db=qs();Object.defineProperty(K,"IndentationType",{enumerable:!0,get:function(){return Db.IndentationType}});Object.defineProperty(K,"LanguageId",{enumerable:!0,get:function(){return Db.LanguageId}});Object.defineProperty(K,"ConfigurationNamespace",{enumerable:!0,get:function(){return Db.ConfigurationNamespace}});var nj=sx();Object.defineProperty(K,"activateAutocomplete",{enumerable:!0,get:function(){return nj.activate}});var rj=mx();Object.defineProperty(K,"activateColor",{enumerable:!0,get:function(){return rj.activate}});var ij=bx();Object.defineProperty(K,"activateDefinition",{enumerable:!0,get:function(){return ij.activate}});var sj=_x();Object.defineProperty(K,"activateDiagnostic",{enumerable:!0,get:function(){return sj.activate}});var oj=$x();Object.defineProperty(K,"activateFormatter",{enumerable:!0,get:function(){return oj.activate}});var aj=Vx();Object.defineProperty(K,"activateHover",{enumerable:!0,get:function(){return aj.activate}});var uj=Kx();Object.defineProperty(K,"activateSignature",{enumerable:!0,get:function(){return uj.activate}});var cj=Yx();Object.defineProperty(K,"activateSubscriptions",{enumerable:!0,get:function(){return cj.activate}});var lj=Qx();Object.defineProperty(K,"activateSymbol",{enumerable:!0,get:function(){return lj.activate}});K.ASTScraper=ej(ky());var mk=fk();Object.defineProperty(K,"ActiveDocument",{enumerable:!0,get:function(){return mk.ActiveDocument}});Object.defineProperty(K,"DocumentManager",{enumerable:!0,get:function(){return mk.DocumentManager}});var dj=fo();Object.defineProperty(K,"LookupHelper",{enumerable:!0,get:function(){return dj.LookupHelper}});var fj=qd();Object.defineProperty(K,"MarkdownString",{enumerable:!0,get:function(){return fj.MarkdownString}});var cs=jd();Object.defineProperty(K,"createHover",{enumerable:!0,get:function(){return cs.createHover}});Object.defineProperty(K,"createSignatureInfo",{enumerable:!0,get:function(){return cs.createSignatureInfo}});Object.defineProperty(K,"createTooltipHeader",{enumerable:!0,get:function(){return cs.createTooltipHeader}});Object.defineProperty(K,"formatDefaultValue",{enumerable:!0,get:function(){return cs.formatDefaultValue}});Object.defineProperty(K,"formatTypes",{enumerable:!0,get:function(){return cs.formatTypes}});Object.defineProperty(K,"appendTooltipBody",{enumerable:!0,get:function(){return cs.appendTooltipBody}});Object.defineProperty(K,"appendTooltipHeader",{enumerable:!0,get:function(){return cs.appendTooltipHeader}});var Ib=Ua();Object.defineProperty(K,"lookupIdentifier",{enumerable:!0,get:function(){return Ib.lookupIdentifier}});Object.defineProperty(K,"lookupBase",{enumerable:!0,get:function(){return Ib.lookupBase}});Object.defineProperty(K,"typeAnalyzer",{enumerable:!0,get:function(){return tj(Ib).default}});var pj=hk();Object.defineProperty(K,"CoreContext",{enumerable:!0,get:function(){return pj.CoreContext}})});var _k={};Ik(_k,{TextDocument:()=>Pb});function Mb(t,e){if(t.length<=1)return t;let n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);Mb(r,e),Mb(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 gk(t,e,n=0){let r=e?[n]:[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);yk(s)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function yk(t){return t===13||t===10}function bk(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 hj(t){let e=bk(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var Kd,Pb,vk=Dk(()=>{"use strict";Kd=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=bk(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=gk(r.text,!1,s);if(u-a===l.length)for(let p=0,y=l.length;p<y;p++)c[p+a+1]=l[p];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 d=r.text.length-(o-s);if(d!==0)for(let p=a+1+l.length,y=c.length;p<y;p++)c[p]=c[p]+d}else if(t.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=gk(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&&yk(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 Kd(i,s,o,a)}t.create=e;function n(i,s,o){if(i instanceof Kd)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=Mb(s.map(hj),(l,d)=>{let p=l.range.start.line-d.range.start.line;return p===0?l.range.start.character-d.range.start.character:p}),u=0,c=[];for(let l of a){let d=i.offsetAt(l.range.start);if(d<u)throw new Error("Overlapping edit");d>u&&c.push(o.substring(u,d)),l.newText.length&&c.push(l.newText),u=i.offsetAt(l.range.end)}return c.push(o.substr(u)),c.join("")}t.applyEdits=r})(Pb||(Pb={}))});var Tk=m(xo=>{"use strict";var qb=xo&&xo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xo,"__esModule",{value:!0});xo.FileSystem=void 0;var mj=Yp(),Sk=(vk(),Mk(_k)),gj=qb(require("events")),Lb=Ld(),yj=qb(require("fs")),bj=zd(),_j=qb(vb()),Nb=class extends gj.default{constructor(e){super(),this._context=e,this._textDocumentManager=new mj.TextDocuments(Sk.TextDocument),this._tempTextDocumentCache=new _j.default({ttl:1e3,max:100})}async getWorkspaceFolderUris(){if(!this._context.features.workspaceFolder)return[];let e=await this._workspace.getWorkspaceFolders();return Array.from(new Set(e.map(n=>n.uri))).map(n=>Lb.URI.parse(n))}findExistingPath(...e){if(e.length===0)return"";for(let n=0;n<e.length;n++)if(this.getTextDocument(e[n])!=null)return e[n];return e[0]}getAllTextDocuments(){return this._textDocumentManager.all()}async fetchTextDocument(e){let n=Lb.URI.parse(e),r=this._tempTextDocumentCache.get(e);if(r!=null)return r;let i=null;try{let s=await yj.default.promises.readFile(n.fsPath,{encoding:"utf-8"});i=Sk.TextDocument.create(e,bj.LanguageId,0,s)}catch{}return this._tempTextDocumentCache.set(e,i),i}async getTextDocument(e){let n=this._textDocumentManager.get(e);return n||(Lb.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)})}};xo.FileSystem=Nb});var Ak=m(Xd=>{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});Xd.NodeContext=void 0;var wk=Yp(),Ek=zd(),vj=Tk(),jb=class extends Ek.CoreContext{constructor(){super(),this.documentManager=new Ek.DocumentManager().setContext(this),this.connection=(0,wk.createConnection)(wk.ProposedFeatures.all),this.fs=new vj.FileSystem(this)}};Xd.NodeContext=jb});Object.defineProperty(exports,"__esModule",{value:!0});var Sj=Ak(),Ur=zd(),xk=new Sj.NodeContext;xk.on("ready",t=>{(0,Ur.activateAutocomplete)(t),(0,Ur.activateColor)(t),(0,Ur.activateDefinition)(t),(0,Ur.activateDiagnostic)(t),(0,Ur.activateFormatter)(t),(0,Ur.activateHover)(t),(0,Ur.activateSignature)(t),(0,Ur.activateSubscriptions)(t),(0,Ur.activateSymbol)(t)});xk.listen();