@rescript/language-server 1.71.0-next-7554adb.0 → 1.71.0-next-ae73a0a.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/out/cli.js
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var Iy=Object.create;var hu=Object.defineProperty;var Ay=Object.getOwnPropertyDescriptor;var Oy=Object.getOwnPropertyNames;var Fy=Object.getPrototypeOf,My=Object.prototype.hasOwnProperty;var x=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ly=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Oy(t))!My.call(e,i)&&i!==n&&hu(e,i,{get:()=>t[i],enumerable:!(r=Ay(t,i))||r.enumerable});return e};var te=(e,t,n)=>(n=e!=null?Iy(Fy(e)):{},Ly(t||!e||!e.__esModule?hu(n,"default",{value:e,enumerable:!0}):n,e));var Tn=x(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.stringArray=Oe.array=Oe.func=Oe.error=Oe.number=Oe.string=Oe.boolean=void 0;function $y(e){return e===!0||e===!1}Oe.boolean=$y;function gu(e){return typeof e=="string"||e instanceof String}Oe.string=gu;function Wy(e){return typeof e=="number"||e instanceof Number}Oe.number=Wy;function Hy(e){return e instanceof Error}Oe.error=Hy;function Uy(e){return typeof e=="function"}Oe.func=Uy;function mu(e){return Array.isArray(e)}Oe.array=mu;function Vy(e){return mu(e)&&e.every(t=>gu(t))}Oe.stringArray=Vy});var qs=x(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});M.Message=M.NotificationType9=M.NotificationType8=M.NotificationType7=M.NotificationType6=M.NotificationType5=M.NotificationType4=M.NotificationType3=M.NotificationType2=M.NotificationType1=M.NotificationType0=M.NotificationType=M.RequestType9=M.RequestType8=M.RequestType7=M.RequestType6=M.RequestType5=M.RequestType4=M.RequestType3=M.RequestType2=M.RequestType1=M.RequestType=M.RequestType0=M.AbstractMessageSignature=M.ParameterStructures=M.ResponseError=M.ErrorCodes=void 0;var un=Tn(),as;(function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.jsonrpcReservedErrorRangeStart=-32099,e.serverErrorStart=-32099,e.MessageWriteError=-32099,e.MessageReadError=-32098,e.PendingResponseRejected=-32097,e.ConnectionInactive=-32096,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.jsonrpcReservedErrorRangeEnd=-32e3,e.serverErrorEnd=-32e3})(as||(M.ErrorCodes=as={}));var cs=class e extends Error{constructor(t,n,r){super(n),this.code=un.number(t)?t:as.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,e.prototype)}toJson(){let t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),t}};M.ResponseError=cs;var Ve=class e{constructor(t){this.kind=t}static is(t){return t===e.auto||t===e.byName||t===e.byPosition}toString(){return this.kind}};M.ParameterStructures=Ve;Ve.auto=new Ve("auto");Ve.byPosition=new Ve("byPosition");Ve.byName=new Ve("byName");var ge=class{constructor(t,n){this.method=t,this.numberOfParams=n}get parameterStructures(){return Ve.auto}};M.AbstractMessageSignature=ge;var us=class extends ge{constructor(t){super(t,0)}};M.RequestType0=us;var ls=class extends ge{constructor(t,n=Ve.auto){super(t,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};M.RequestType=ls;var ds=class extends ge{constructor(t,n=Ve.auto){super(t,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};M.RequestType1=ds;var fs=class extends ge{constructor(t){super(t,2)}};M.RequestType2=fs;var ps=class extends ge{constructor(t){super(t,3)}};M.RequestType3=ps;var hs=class extends ge{constructor(t){super(t,4)}};M.RequestType4=hs;var gs=class extends ge{constructor(t){super(t,5)}};M.RequestType5=gs;var ms=class extends ge{constructor(t){super(t,6)}};M.RequestType6=ms;var ys=class extends ge{constructor(t){super(t,7)}};M.RequestType7=ys;var vs=class extends ge{constructor(t){super(t,8)}};M.RequestType8=vs;var bs=class extends ge{constructor(t){super(t,9)}};M.RequestType9=bs;var Rs=class extends ge{constructor(t,n=Ve.auto){super(t,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};M.NotificationType=Rs;var Ds=class extends ge{constructor(t){super(t,0)}};M.NotificationType0=Ds;var _s=class extends ge{constructor(t,n=Ve.auto){super(t,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};M.NotificationType1=_s;var ws=class extends ge{constructor(t){super(t,2)}};M.NotificationType2=ws;var Ps=class extends ge{constructor(t){super(t,3)}};M.NotificationType3=Ps;var Cs=class extends ge{constructor(t){super(t,4)}};M.NotificationType4=Cs;var Es=class extends ge{constructor(t){super(t,5)}};M.NotificationType5=Es;var xs=class extends ge{constructor(t){super(t,6)}};M.NotificationType6=xs;var Ss=class extends ge{constructor(t){super(t,7)}};M.NotificationType7=Ss;var Ts=class extends ge{constructor(t){super(t,8)}};M.NotificationType8=Ts;var ks=class extends ge{constructor(t){super(t,9)}};M.NotificationType9=ks;var yu;(function(e){function t(i){let o=i;return o&&un.string(o.method)&&(un.string(o.id)||un.number(o.id))}e.isRequest=t;function n(i){let o=i;return o&&un.string(o.method)&&i.id===void 0}e.isNotification=n;function r(i){let o=i;return o&&(o.result!==void 0||!!o.error)&&(un.string(o.id)||un.number(o.id)||o.id===null)}e.isResponse=r})(yu||(M.Message=yu={}))});var Ns=x(Vt=>{"use strict";var vu;Object.defineProperty(Vt,"__esModule",{value:!0});Vt.LRUCache=Vt.LinkedMap=Vt.Touch=void 0;var Fe;(function(e){e.None=0,e.First=1,e.AsOld=e.First,e.Last=2,e.AsNew=e.Last})(Fe||(Vt.Touch=Fe={}));var ci=class{constructor(){this[vu]="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(t){return this._map.has(t)}get(t,n=Fe.None){let r=this._map.get(t);if(r)return n!==Fe.None&&this.touch(r,n),r.value}set(t,n,r=Fe.None){let i=this._map.get(t);if(i)i.value=n,r!==Fe.None&&this.touch(i,r);else{switch(i={key:t,value:n,next:void 0,previous:void 0},r){case Fe.None:this.addItemLast(i);break;case Fe.First:this.addItemFirst(i);break;case Fe.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(t,i),this._size++}return this}delete(t){return!!this.remove(t)}remove(t){let n=this._map.get(t);if(n)return this._map.delete(t),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 t=this._head;return this._map.delete(t.key),this.removeItem(t),this._size--,t.value}forEach(t,n){let r=this._state,i=this._head;for(;i;){if(n?t.bind(n)(i.value,i.key,this):t(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let t=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==t)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 t=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==t)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 t=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==t)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}[(vu=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(t){if(t>=this.size)return;if(t===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>t;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.previous=void 0),this._state++}addItemFirst(t){if(!this._head&&!this._tail)this._tail=t;else if(this._head)t.next=this._head,this._head.previous=t;else throw new Error("Invalid list");this._head=t,this._state++}addItemLast(t){if(!this._head&&!this._tail)this._head=t;else if(this._tail)t.previous=this._tail,this._tail.next=t;else throw new Error("Invalid list");this._tail=t,this._state++}removeItem(t){if(t===this._head&&t===this._tail)this._head=void 0,this._tail=void 0;else if(t===this._head){if(!t.next)throw new Error("Invalid list");t.next.previous=void 0,this._head=t.next}else if(t===this._tail){if(!t.previous)throw new Error("Invalid list");t.previous.next=void 0,this._tail=t.previous}else{let n=t.next,r=t.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}t.next=void 0,t.previous=void 0,this._state++}touch(t,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==Fe.First&&n!==Fe.Last)){if(n===Fe.First){if(t===this._head)return;let r=t.next,i=t.previous;t===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),t.previous=void 0,t.next=this._head,this._head.previous=t,this._head=t,this._state++}else if(n===Fe.Last){if(t===this._tail)return;let r=t.next,i=t.previous;t===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),t.next=void 0,t.previous=this._tail,this._tail.next=t,this._tail=t,this._state++}}}toJSON(){let t=[];return this.forEach((n,r)=>{t.push([r,n])}),t}fromJSON(t){this.clear();for(let[n,r]of t)this.set(n,r)}};Vt.LinkedMap=ci;var js=class extends ci{constructor(t,n=1){super(),this._limit=t,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(t){this._limit=t,this.checkTrim()}get ratio(){return this._ratio}set ratio(t){this._ratio=Math.min(Math.max(0,t),1),this.checkTrim()}get(t,n=Fe.AsNew){return super.get(t,n)}peek(t){return super.get(t,Fe.None)}set(t,n){return super.set(t,n,Fe.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Vt.LRUCache=js});var Ru=x(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.Disposable=void 0;var bu;(function(e){function t(n){return{dispose:n}}e.create=t})(bu||(ui.Disposable=bu={}))});var Bt=x(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});var Is;function As(){if(Is===void 0)throw new Error("No runtime abstraction layer installed");return Is}(function(e){function t(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");Is=n}e.install=t})(As||(As={}));Os.default=As});var qn=x(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.Emitter=kn.Event=void 0;var By=Bt(),Du;(function(e){let t={dispose(){}};e.None=function(){return t}})(Du||(kn.Event=Du={}));var Fs=class{add(t,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(t),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(t,n)})}remove(t,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,o=this._callbacks.length;i<o;i++)if(this._callbacks[i]===t)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(...t){if(!this._callbacks)return[];let n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,s=r.length;o<s;o++)try{n.push(r[o].apply(i[o],t))}catch(u){(0,By.default)().console.error(u)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},li=class e{constructor(t){this._options=t}get event(){return this._event||(this._event=(t,n,r)=>{this._callbacks||(this._callbacks=new Fs),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(t,n);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(t,n),i.dispose=e._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(t){this._callbacks&&this._callbacks.invoke.call(this._callbacks,t)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};kn.Emitter=li;li._noop=function(){}});var pi=x(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.CancellationTokenSource=jn.CancellationToken=void 0;var zy=Bt(),Gy=Tn(),Ms=qn(),di;(function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Ms.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Ms.Event.None});function t(n){let r=n;return r&&(r===e.None||r===e.Cancelled||Gy.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}e.is=t})(di||(jn.CancellationToken=di={}));var Xy=Object.freeze(function(e,t){let n=(0,zy.default)().timer.setTimeout(e.bind(t),0);return{dispose(){n.dispose()}}}),fi=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?Xy:(this._emitter||(this._emitter=new Ms.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Ls=class{get token(){return this._token||(this._token=new fi),this._token}cancel(){this._token?this._token.cancel():this._token=di.Cancelled}dispose(){this._token?this._token instanceof fi&&this._token.dispose():this._token=di.None}};jn.CancellationTokenSource=Ls});var _u=x(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.SharedArrayReceiverStrategy=Nn.SharedArraySenderStrategy=void 0;var Jy=pi(),dr;(function(e){e.Continue=0,e.Cancelled=1})(dr||(dr={}));var $s=class{constructor(){this.buffers=new Map}enableCancellation(t){if(t.id===null)return;let n=new SharedArrayBuffer(4),r=new Int32Array(n,0,1);r[0]=dr.Continue,this.buffers.set(t.id,n),t.$cancellationData=n}async sendCancellation(t,n){let r=this.buffers.get(n);if(r===void 0)return;let i=new Int32Array(r,0,1);Atomics.store(i,0,dr.Cancelled)}cleanup(t){this.buffers.delete(t)}dispose(){this.buffers.clear()}};Nn.SharedArraySenderStrategy=$s;var Ws=class{constructor(t){this.data=new Int32Array(t,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===dr.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},Hs=class{constructor(t){this.token=new Ws(t)}cancel(){}dispose(){}},Us=class{constructor(){this.kind="request"}createCancellationTokenSource(t){let n=t.$cancellationData;return n===void 0?new Jy.CancellationTokenSource:new Hs(n)}};Nn.SharedArrayReceiverStrategy=Us});var Bs=x(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.Semaphore=void 0;var Yy=Bt(),Vs=class{constructor(t=1){if(t<=0)throw new Error("Capacity must be greater than 0");this._capacity=t,this._active=0,this._waiting=[]}lock(t){return new Promise((n,r)=>{this._waiting.push({thunk:t,resolve:n,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,Yy.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let t=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let n=t.thunk();n instanceof Promise?n.then(r=>{this._active--,t.resolve(r),this.runNext()},r=>{this._active--,t.reject(r),this.runNext()}):(this._active--,t.resolve(n),this.runNext())}catch(n){this._active--,t.reject(n),this.runNext()}}};hi.Semaphore=Vs});var Pu=x(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.ReadableStreamMessageReader=zt.AbstractMessageReader=zt.MessageReader=void 0;var Gs=Bt(),In=Tn(),zs=qn(),Qy=Bs(),wu;(function(e){function t(n){let r=n;return r&&In.func(r.listen)&&In.func(r.dispose)&&In.func(r.onError)&&In.func(r.onClose)&&In.func(r.onPartialMessage)}e.is=t})(wu||(zt.MessageReader=wu={}));var gi=class{constructor(){this.errorEmitter=new zs.Emitter,this.closeEmitter=new zs.Emitter,this.partialMessageEmitter=new zs.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(t){this.errorEmitter.fire(this.asError(t))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(t){this.partialMessageEmitter.fire(t)}asError(t){return t instanceof Error?t:new Error(`Reader received error. Reason: ${In.string(t.message)?t.message:"unknown"}`)}};zt.AbstractMessageReader=gi;var Xs;(function(e){function t(n){let r,i,o,s=new Map,u,d=new Map;if(n===void 0||typeof n=="string")r=n??"utf-8";else{if(r=n.charset??"utf-8",n.contentDecoder!==void 0&&(o=n.contentDecoder,s.set(o.name,o)),n.contentDecoders!==void 0)for(let p of n.contentDecoders)s.set(p.name,p);if(n.contentTypeDecoder!==void 0&&(u=n.contentTypeDecoder,d.set(u.name,u)),n.contentTypeDecoders!==void 0)for(let p of n.contentTypeDecoders)d.set(p.name,p)}return u===void 0&&(u=(0,Gs.default)().applicationJson.decoder,d.set(u.name,u)),{charset:r,contentDecoder:o,contentDecoders:s,contentTypeDecoder:u,contentTypeDecoders:d}}e.fromOptions=t})(Xs||(Xs={}));var Js=class extends gi{constructor(t,n){super(),this.readable=t,this.options=Xs.fromOptions(n),this.buffer=(0,Gs.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new Qy.Semaphore(1)}set partialMessageTimeout(t){this._partialMessageTimeout=t}get partialMessageTimeout(){return this._partialMessageTimeout}listen(t){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=t;let n=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),n}onData(t){try{for(this.buffer.append(t);;){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.
|
|
3
|
-
${JSON.stringify(Object.fromEntries(r))}`));return}let o=parseInt(i);if(isNaN(o)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=o}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,Gs.default)().timer.setTimeout((t,n)=>{this.partialMessageTimer=void 0,t===this.messageToken&&(this.firePartialMessage({messageToken:t,waitingTime:n}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};zt.ReadableStreamMessageReader=Js});var Tu=x(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.WriteableStreamMessageWriter=Gt.AbstractMessageWriter=Gt.MessageWriter=void 0;var Cu=Bt(),fr=Tn(),
|
|
4
|
-
`,Su;(function(e){function t(n){let r=n;return r&&fr.func(r.dispose)&&fr.func(r.onClose)&&fr.func(r.onError)&&fr.func(r.write)}e.is=t})(Su||(Gt.MessageWriter=Su={}));var mi=class{constructor(){this.errorEmitter=new Eu.Emitter,this.closeEmitter=new Eu.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(t,n,r){this.errorEmitter.fire([this.asError(t),n,r])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(t){return t instanceof Error?t:new Error(`Writer received error. Reason: ${fr.string(t.message)?t.message:"unknown"}`)}};Gt.AbstractMessageWriter=mi;var Ys;(function(e){function t(n){return n===void 0||typeof n=="string"?{charset:n??"utf-8",contentTypeEncoder:(0,Cu.default)().applicationJson.encoder}:{charset:n.charset??"utf-8",contentEncoder:n.contentEncoder,contentTypeEncoder:n.contentTypeEncoder??(0,Cu.default)().applicationJson.encoder}}e.fromOptions=t})(Ys||(Ys={}));var Qs=class extends mi{constructor(t,n){super(),this.writable=t,this.options=Ys.fromOptions(n),this.errorCount=0,this.writeSemaphore=new
|
|
5
|
-
`,Zs=class{constructor(t="utf-8"){this._encoding=t,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(t){let n=typeof t=="string"?this.fromString(t,this._encoding):t;this._chunks.push(n),this._totalLength+=n.byteLength}tryReadHeaders(t=!1){if(this._chunks.length===0)return;let n=0,r=0,i=0,o=0;e:for(;r<this._chunks.length;){let p=this._chunks[r];for(i=0;i<p.length;){switch(p[i]){case
|
|
6
|
-
${_}`);let T=_.substr(0,w),P=_.substr(w+1).trim();u.set(t?T.toLowerCase():T,P)}return u}tryReadBody(t){if(!(this._totalLength<t))return this._read(t)}get numberOfBytes(){return this._totalLength}_read(t){if(t===0)return this.emptyBuffer();if(t>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===t){let o=this._chunks[0];return this._chunks.shift(),this._totalLength-=t,this.asNative(o)}if(this._chunks[0].byteLength>t){let o=this._chunks[0],s=this.asNative(o,t);return this._chunks[0]=o.slice(t),this._totalLength-=t,s}let n=this.allocNative(t),r=0,i=0;for(;t>0;){let o=this._chunks[i];if(o.byteLength>t){let s=o.slice(0,t);n.set(s,r),r+=t,this._chunks[i]=o.slice(t),this._totalLength-=t,t-=t}else n.set(o,r),r+=o.byteLength,this._chunks.shift(),this._totalLength-=o.byteLength,t-=o.byteLength}return n}};yi.AbstractMessageBuffer=Zs});var Au=x(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.createMessageConnection=z.ConnectionOptions=z.MessageStrategy=z.CancellationStrategy=z.CancellationSenderStrategy=z.CancellationReceiverStrategy=z.RequestCancellationReceiverStrategy=z.IdCancellationReceiverStrategy=z.ConnectionStrategy=z.ConnectionError=z.ConnectionErrors=z.LogTraceNotification=z.SetTraceNotification=z.TraceFormat=z.TraceValues=z.Trace=z.NullLogger=z.ProgressType=z.ProgressToken=void 0;var qu=Bt(),De=Tn(),$=qs(),ju=Ns(),pr=qn(),Ks=pi(),mr;(function(e){e.type=new $.NotificationType("$/cancelRequest")})(mr||(mr={}));var ea;(function(e){function t(n){return typeof n=="string"||typeof n=="number"}e.is=t})(ea||(z.ProgressToken=ea={}));var hr;(function(e){e.type=new $.NotificationType("$/progress")})(hr||(hr={}));var ta=class{constructor(){}};z.ProgressType=ta;var na;(function(e){function t(n){return De.func(n)}e.is=t})(na||(na={}));z.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var re;(function(e){e[e.Off=0]="Off",e[e.Messages=1]="Messages",e[e.Compact=2]="Compact",e[e.Verbose=3]="Verbose"})(re||(z.Trace=re={}));var Nu;(function(e){e.Off="off",e.Messages="messages",e.Compact="compact",e.Verbose="verbose"})(Nu||(z.TraceValues=Nu={}));(function(e){function t(r){if(!De.string(r))return e.Off;switch(r=r.toLowerCase(),r){case"off":return e.Off;case"messages":return e.Messages;case"compact":return e.Compact;case"verbose":return e.Verbose;default:return e.Off}}e.fromString=t;function n(r){switch(r){case e.Off:return"off";case e.Messages:return"messages";case e.Compact:return"compact";case e.Verbose:return"verbose";default:return"off"}}e.toString=n})(re||(z.Trace=re={}));var Ze;(function(e){e.Text="text",e.JSON="json"})(Ze||(z.TraceFormat=Ze={}));(function(e){function t(n){return De.string(n)?(n=n.toLowerCase(),n==="json"?e.JSON:e.Text):e.Text}e.fromString=t})(Ze||(z.TraceFormat=Ze={}));var ra;(function(e){e.type=new $.NotificationType("$/setTrace")})(ra||(z.SetTraceNotification=ra={}));var vi;(function(e){e.type=new $.NotificationType("$/logTrace")})(vi||(z.LogTraceNotification=vi={}));var gr;(function(e){e[e.Closed=1]="Closed",e[e.Disposed=2]="Disposed",e[e.AlreadyListening=3]="AlreadyListening"})(gr||(z.ConnectionErrors=gr={}));var An=class e extends Error{constructor(t,n){super(n),this.code=t,Object.setPrototypeOf(this,e.prototype)}};z.ConnectionError=An;var ia;(function(e){function t(n){let r=n;return r&&De.func(r.cancelUndispatched)}e.is=t})(ia||(z.ConnectionStrategy=ia={}));var bi;(function(e){function t(n){let r=n;return r&&(r.kind===void 0||r.kind==="id")&&De.func(r.createCancellationTokenSource)&&(r.dispose===void 0||De.func(r.dispose))}e.is=t})(bi||(z.IdCancellationReceiverStrategy=bi={}));var oa;(function(e){function t(n){let r=n;return r&&r.kind==="request"&&De.func(r.createCancellationTokenSource)&&(r.dispose===void 0||De.func(r.dispose))}e.is=t})(oa||(z.RequestCancellationReceiverStrategy=oa={}));var Ri;(function(e){e.Message=Object.freeze({createCancellationTokenSource(n){return new Ks.CancellationTokenSource}});function t(n){return bi.is(n)||oa.is(n)}e.is=t})(Ri||(z.CancellationReceiverStrategy=Ri={}));var Di;(function(e){e.Message=Object.freeze({sendCancellation(n,r){return n.sendNotification(mr.type,{id:r})},cleanup(n){}});function t(n){let r=n;return r&&De.func(r.sendCancellation)&&De.func(r.cleanup)}e.is=t})(Di||(z.CancellationSenderStrategy=Di={}));var _i;(function(e){e.Message=Object.freeze({receiver:Ri.Message,sender:Di.Message});function t(n){let r=n;return r&&Ri.is(r.receiver)&&Di.is(r.sender)}e.is=t})(_i||(z.CancellationStrategy=_i={}));var wi;(function(e){function t(n){let r=n;return r&&De.func(r.handleMessage)}e.is=t})(wi||(z.MessageStrategy=wi={}));var Iu;(function(e){function t(n){let r=n;return r&&(_i.is(r.cancellationStrategy)||ia.is(r.connectionStrategy)||wi.is(r.messageStrategy))}e.is=t})(Iu||(z.ConnectionOptions=Iu={}));var
|
|
2
|
+
"use strict";var Ay=Object.create;var hu=Object.defineProperty;var Oy=Object.getOwnPropertyDescriptor;var Fy=Object.getOwnPropertyNames;var My=Object.getPrototypeOf,Ly=Object.prototype.hasOwnProperty;var x=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var $y=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Fy(t))!Ly.call(e,i)&&i!==n&&hu(e,i,{get:()=>t[i],enumerable:!(r=Oy(t,i))||r.enumerable});return e};var te=(e,t,n)=>(n=e!=null?Ay(My(e)):{},$y(t||!e||!e.__esModule?hu(n,"default",{value:e,enumerable:!0}):n,e));var Tn=x(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.stringArray=Oe.array=Oe.func=Oe.error=Oe.number=Oe.string=Oe.boolean=void 0;function Wy(e){return e===!0||e===!1}Oe.boolean=Wy;function gu(e){return typeof e=="string"||e instanceof String}Oe.string=gu;function Hy(e){return typeof e=="number"||e instanceof Number}Oe.number=Hy;function Uy(e){return e instanceof Error}Oe.error=Uy;function Vy(e){return typeof e=="function"}Oe.func=Vy;function mu(e){return Array.isArray(e)}Oe.array=mu;function By(e){return mu(e)&&e.every(t=>gu(t))}Oe.stringArray=By});var qs=x(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});M.Message=M.NotificationType9=M.NotificationType8=M.NotificationType7=M.NotificationType6=M.NotificationType5=M.NotificationType4=M.NotificationType3=M.NotificationType2=M.NotificationType1=M.NotificationType0=M.NotificationType=M.RequestType9=M.RequestType8=M.RequestType7=M.RequestType6=M.RequestType5=M.RequestType4=M.RequestType3=M.RequestType2=M.RequestType1=M.RequestType=M.RequestType0=M.AbstractMessageSignature=M.ParameterStructures=M.ResponseError=M.ErrorCodes=void 0;var un=Tn(),as;(function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.jsonrpcReservedErrorRangeStart=-32099,e.serverErrorStart=-32099,e.MessageWriteError=-32099,e.MessageReadError=-32098,e.PendingResponseRejected=-32097,e.ConnectionInactive=-32096,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.jsonrpcReservedErrorRangeEnd=-32e3,e.serverErrorEnd=-32e3})(as||(M.ErrorCodes=as={}));var cs=class e extends Error{constructor(t,n,r){super(n),this.code=un.number(t)?t:as.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,e.prototype)}toJson(){let t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),t}};M.ResponseError=cs;var Ve=class e{constructor(t){this.kind=t}static is(t){return t===e.auto||t===e.byName||t===e.byPosition}toString(){return this.kind}};M.ParameterStructures=Ve;Ve.auto=new Ve("auto");Ve.byPosition=new Ve("byPosition");Ve.byName=new Ve("byName");var ge=class{constructor(t,n){this.method=t,this.numberOfParams=n}get parameterStructures(){return Ve.auto}};M.AbstractMessageSignature=ge;var us=class extends ge{constructor(t){super(t,0)}};M.RequestType0=us;var ls=class extends ge{constructor(t,n=Ve.auto){super(t,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};M.RequestType=ls;var ds=class extends ge{constructor(t,n=Ve.auto){super(t,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};M.RequestType1=ds;var fs=class extends ge{constructor(t){super(t,2)}};M.RequestType2=fs;var ps=class extends ge{constructor(t){super(t,3)}};M.RequestType3=ps;var hs=class extends ge{constructor(t){super(t,4)}};M.RequestType4=hs;var gs=class extends ge{constructor(t){super(t,5)}};M.RequestType5=gs;var ms=class extends ge{constructor(t){super(t,6)}};M.RequestType6=ms;var ys=class extends ge{constructor(t){super(t,7)}};M.RequestType7=ys;var vs=class extends ge{constructor(t){super(t,8)}};M.RequestType8=vs;var bs=class extends ge{constructor(t){super(t,9)}};M.RequestType9=bs;var Rs=class extends ge{constructor(t,n=Ve.auto){super(t,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};M.NotificationType=Rs;var Ds=class extends ge{constructor(t){super(t,0)}};M.NotificationType0=Ds;var _s=class extends ge{constructor(t,n=Ve.auto){super(t,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}};M.NotificationType1=_s;var ws=class extends ge{constructor(t){super(t,2)}};M.NotificationType2=ws;var Ps=class extends ge{constructor(t){super(t,3)}};M.NotificationType3=Ps;var Cs=class extends ge{constructor(t){super(t,4)}};M.NotificationType4=Cs;var Es=class extends ge{constructor(t){super(t,5)}};M.NotificationType5=Es;var xs=class extends ge{constructor(t){super(t,6)}};M.NotificationType6=xs;var Ss=class extends ge{constructor(t){super(t,7)}};M.NotificationType7=Ss;var Ts=class extends ge{constructor(t){super(t,8)}};M.NotificationType8=Ts;var ks=class extends ge{constructor(t){super(t,9)}};M.NotificationType9=ks;var yu;(function(e){function t(i){let o=i;return o&&un.string(o.method)&&(un.string(o.id)||un.number(o.id))}e.isRequest=t;function n(i){let o=i;return o&&un.string(o.method)&&i.id===void 0}e.isNotification=n;function r(i){let o=i;return o&&(o.result!==void 0||!!o.error)&&(un.string(o.id)||un.number(o.id)||o.id===null)}e.isResponse=r})(yu||(M.Message=yu={}))});var Ns=x(Vt=>{"use strict";var vu;Object.defineProperty(Vt,"__esModule",{value:!0});Vt.LRUCache=Vt.LinkedMap=Vt.Touch=void 0;var Fe;(function(e){e.None=0,e.First=1,e.AsOld=e.First,e.Last=2,e.AsNew=e.Last})(Fe||(Vt.Touch=Fe={}));var ci=class{constructor(){this[vu]="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(t){return this._map.has(t)}get(t,n=Fe.None){let r=this._map.get(t);if(r)return n!==Fe.None&&this.touch(r,n),r.value}set(t,n,r=Fe.None){let i=this._map.get(t);if(i)i.value=n,r!==Fe.None&&this.touch(i,r);else{switch(i={key:t,value:n,next:void 0,previous:void 0},r){case Fe.None:this.addItemLast(i);break;case Fe.First:this.addItemFirst(i);break;case Fe.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(t,i),this._size++}return this}delete(t){return!!this.remove(t)}remove(t){let n=this._map.get(t);if(n)return this._map.delete(t),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 t=this._head;return this._map.delete(t.key),this.removeItem(t),this._size--,t.value}forEach(t,n){let r=this._state,i=this._head;for(;i;){if(n?t.bind(n)(i.value,i.key,this):t(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let t=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==t)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 t=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==t)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 t=this._state,n=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==t)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}[(vu=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(t){if(t>=this.size)return;if(t===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>t;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.previous=void 0),this._state++}addItemFirst(t){if(!this._head&&!this._tail)this._tail=t;else if(this._head)t.next=this._head,this._head.previous=t;else throw new Error("Invalid list");this._head=t,this._state++}addItemLast(t){if(!this._head&&!this._tail)this._head=t;else if(this._tail)t.previous=this._tail,this._tail.next=t;else throw new Error("Invalid list");this._tail=t,this._state++}removeItem(t){if(t===this._head&&t===this._tail)this._head=void 0,this._tail=void 0;else if(t===this._head){if(!t.next)throw new Error("Invalid list");t.next.previous=void 0,this._head=t.next}else if(t===this._tail){if(!t.previous)throw new Error("Invalid list");t.previous.next=void 0,this._tail=t.previous}else{let n=t.next,r=t.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}t.next=void 0,t.previous=void 0,this._state++}touch(t,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==Fe.First&&n!==Fe.Last)){if(n===Fe.First){if(t===this._head)return;let r=t.next,i=t.previous;t===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),t.previous=void 0,t.next=this._head,this._head.previous=t,this._head=t,this._state++}else if(n===Fe.Last){if(t===this._tail)return;let r=t.next,i=t.previous;t===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),t.next=void 0,t.previous=this._tail,this._tail.next=t,this._tail=t,this._state++}}}toJSON(){let t=[];return this.forEach((n,r)=>{t.push([r,n])}),t}fromJSON(t){this.clear();for(let[n,r]of t)this.set(n,r)}};Vt.LinkedMap=ci;var js=class extends ci{constructor(t,n=1){super(),this._limit=t,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(t){this._limit=t,this.checkTrim()}get ratio(){return this._ratio}set ratio(t){this._ratio=Math.min(Math.max(0,t),1),this.checkTrim()}get(t,n=Fe.AsNew){return super.get(t,n)}peek(t){return super.get(t,Fe.None)}set(t,n){return super.set(t,n,Fe.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Vt.LRUCache=js});var Ru=x(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.Disposable=void 0;var bu;(function(e){function t(n){return{dispose:n}}e.create=t})(bu||(ui.Disposable=bu={}))});var Bt=x(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});var Is;function As(){if(Is===void 0)throw new Error("No runtime abstraction layer installed");return Is}(function(e){function t(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");Is=n}e.install=t})(As||(As={}));Os.default=As});var qn=x(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.Emitter=kn.Event=void 0;var zy=Bt(),Du;(function(e){let t={dispose(){}};e.None=function(){return t}})(Du||(kn.Event=Du={}));var Fs=class{add(t,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(t),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(t,n)})}remove(t,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,o=this._callbacks.length;i<o;i++)if(this._callbacks[i]===t)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(...t){if(!this._callbacks)return[];let n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,s=r.length;o<s;o++)try{n.push(r[o].apply(i[o],t))}catch(u){(0,zy.default)().console.error(u)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},li=class e{constructor(t){this._options=t}get event(){return this._event||(this._event=(t,n,r)=>{this._callbacks||(this._callbacks=new Fs),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(t,n);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(t,n),i.dispose=e._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(t){this._callbacks&&this._callbacks.invoke.call(this._callbacks,t)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};kn.Emitter=li;li._noop=function(){}});var pi=x(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.CancellationTokenSource=jn.CancellationToken=void 0;var Gy=Bt(),Xy=Tn(),Ms=qn(),di;(function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Ms.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Ms.Event.None});function t(n){let r=n;return r&&(r===e.None||r===e.Cancelled||Xy.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}e.is=t})(di||(jn.CancellationToken=di={}));var Jy=Object.freeze(function(e,t){let n=(0,Gy.default)().timer.setTimeout(e.bind(t),0);return{dispose(){n.dispose()}}}),fi=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?Jy:(this._emitter||(this._emitter=new Ms.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Ls=class{get token(){return this._token||(this._token=new fi),this._token}cancel(){this._token?this._token.cancel():this._token=di.Cancelled}dispose(){this._token?this._token instanceof fi&&this._token.dispose():this._token=di.None}};jn.CancellationTokenSource=Ls});var _u=x(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.SharedArrayReceiverStrategy=Nn.SharedArraySenderStrategy=void 0;var Yy=pi(),dr;(function(e){e.Continue=0,e.Cancelled=1})(dr||(dr={}));var $s=class{constructor(){this.buffers=new Map}enableCancellation(t){if(t.id===null)return;let n=new SharedArrayBuffer(4),r=new Int32Array(n,0,1);r[0]=dr.Continue,this.buffers.set(t.id,n),t.$cancellationData=n}async sendCancellation(t,n){let r=this.buffers.get(n);if(r===void 0)return;let i=new Int32Array(r,0,1);Atomics.store(i,0,dr.Cancelled)}cleanup(t){this.buffers.delete(t)}dispose(){this.buffers.clear()}};Nn.SharedArraySenderStrategy=$s;var Ws=class{constructor(t){this.data=new Int32Array(t,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===dr.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},Hs=class{constructor(t){this.token=new Ws(t)}cancel(){}dispose(){}},Us=class{constructor(){this.kind="request"}createCancellationTokenSource(t){let n=t.$cancellationData;return n===void 0?new Yy.CancellationTokenSource:new Hs(n)}};Nn.SharedArrayReceiverStrategy=Us});var Bs=x(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.Semaphore=void 0;var Qy=Bt(),Vs=class{constructor(t=1){if(t<=0)throw new Error("Capacity must be greater than 0");this._capacity=t,this._active=0,this._waiting=[]}lock(t){return new Promise((n,r)=>{this._waiting.push({thunk:t,resolve:n,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,Qy.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let t=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let n=t.thunk();n instanceof Promise?n.then(r=>{this._active--,t.resolve(r),this.runNext()},r=>{this._active--,t.reject(r),this.runNext()}):(this._active--,t.resolve(n),this.runNext())}catch(n){this._active--,t.reject(n),this.runNext()}}};hi.Semaphore=Vs});var Pu=x(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.ReadableStreamMessageReader=zt.AbstractMessageReader=zt.MessageReader=void 0;var Gs=Bt(),In=Tn(),zs=qn(),Zy=Bs(),wu;(function(e){function t(n){let r=n;return r&&In.func(r.listen)&&In.func(r.dispose)&&In.func(r.onError)&&In.func(r.onClose)&&In.func(r.onPartialMessage)}e.is=t})(wu||(zt.MessageReader=wu={}));var gi=class{constructor(){this.errorEmitter=new zs.Emitter,this.closeEmitter=new zs.Emitter,this.partialMessageEmitter=new zs.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(t){this.errorEmitter.fire(this.asError(t))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(t){this.partialMessageEmitter.fire(t)}asError(t){return t instanceof Error?t:new Error(`Reader received error. Reason: ${In.string(t.message)?t.message:"unknown"}`)}};zt.AbstractMessageReader=gi;var Xs;(function(e){function t(n){let r,i,o,s=new Map,u,d=new Map;if(n===void 0||typeof n=="string")r=n??"utf-8";else{if(r=n.charset??"utf-8",n.contentDecoder!==void 0&&(o=n.contentDecoder,s.set(o.name,o)),n.contentDecoders!==void 0)for(let p of n.contentDecoders)s.set(p.name,p);if(n.contentTypeDecoder!==void 0&&(u=n.contentTypeDecoder,d.set(u.name,u)),n.contentTypeDecoders!==void 0)for(let p of n.contentTypeDecoders)d.set(p.name,p)}return u===void 0&&(u=(0,Gs.default)().applicationJson.decoder,d.set(u.name,u)),{charset:r,contentDecoder:o,contentDecoders:s,contentTypeDecoder:u,contentTypeDecoders:d}}e.fromOptions=t})(Xs||(Xs={}));var Js=class extends gi{constructor(t,n){super(),this.readable=t,this.options=Xs.fromOptions(n),this.buffer=(0,Gs.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new Zy.Semaphore(1)}set partialMessageTimeout(t){this._partialMessageTimeout=t}get partialMessageTimeout(){return this._partialMessageTimeout}listen(t){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=t;let n=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),n}onData(t){try{for(this.buffer.append(t);;){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.
|
|
3
|
+
${JSON.stringify(Object.fromEntries(r))}`));return}let o=parseInt(i);if(isNaN(o)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=o}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,Gs.default)().timer.setTimeout((t,n)=>{this.partialMessageTimer=void 0,t===this.messageToken&&(this.firePartialMessage({messageToken:t,waitingTime:n}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};zt.ReadableStreamMessageReader=Js});var Tu=x(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.WriteableStreamMessageWriter=Gt.AbstractMessageWriter=Gt.MessageWriter=void 0;var Cu=Bt(),fr=Tn(),Ky=Bs(),Eu=qn(),ev="Content-Length: ",xu=`\r
|
|
4
|
+
`,Su;(function(e){function t(n){let r=n;return r&&fr.func(r.dispose)&&fr.func(r.onClose)&&fr.func(r.onError)&&fr.func(r.write)}e.is=t})(Su||(Gt.MessageWriter=Su={}));var mi=class{constructor(){this.errorEmitter=new Eu.Emitter,this.closeEmitter=new Eu.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(t,n,r){this.errorEmitter.fire([this.asError(t),n,r])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(t){return t instanceof Error?t:new Error(`Writer received error. Reason: ${fr.string(t.message)?t.message:"unknown"}`)}};Gt.AbstractMessageWriter=mi;var Ys;(function(e){function t(n){return n===void 0||typeof n=="string"?{charset:n??"utf-8",contentTypeEncoder:(0,Cu.default)().applicationJson.encoder}:{charset:n.charset??"utf-8",contentEncoder:n.contentEncoder,contentTypeEncoder:n.contentTypeEncoder??(0,Cu.default)().applicationJson.encoder}}e.fromOptions=t})(Ys||(Ys={}));var Qs=class extends mi{constructor(t,n){super(),this.writable=t,this.options=Ys.fromOptions(n),this.errorCount=0,this.writeSemaphore=new Ky.Semaphore(1),this.writable.onError(r=>this.fireError(r)),this.writable.onClose(()=>this.fireClose())}async write(t){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(t,this.options).then(r=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(r):r).then(r=>{let i=[];return i.push(ev,r.byteLength.toString(),xu),i.push(xu),this.doWrite(t,i,r)},r=>{throw this.fireError(r),r}))}async doWrite(t,n,r){try{return await this.writable.write(n.join(""),"ascii"),this.writable.write(r)}catch(i){return this.handleError(i,t),Promise.reject(i)}}handleError(t,n){this.errorCount++,this.fireError(t,n,this.errorCount)}end(){this.writable.end()}};Gt.WriteableStreamMessageWriter=Qs});var ku=x(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.AbstractMessageBuffer=void 0;var tv=13,nv=10,rv=`\r
|
|
5
|
+
`,Zs=class{constructor(t="utf-8"){this._encoding=t,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(t){let n=typeof t=="string"?this.fromString(t,this._encoding):t;this._chunks.push(n),this._totalLength+=n.byteLength}tryReadHeaders(t=!1){if(this._chunks.length===0)return;let n=0,r=0,i=0,o=0;e:for(;r<this._chunks.length;){let p=this._chunks[r];for(i=0;i<p.length;){switch(p[i]){case tv:switch(n){case 0:n=1;break;case 2:n=3;break;default:n=0}break;case nv:switch(n){case 1:n=2;break;case 3:n=4,i++;break e;default:n=0}break;default:n=0}i++}o+=p.byteLength,r++}if(n!==4)return;let s=this._read(o+i),u=new Map,d=this.toString(s,"ascii").split(rv);if(d.length<2)return u;for(let p=0;p<d.length-2;p++){let _=d[p],w=_.indexOf(":");if(w===-1)throw new Error(`Message header must separate key and value using ':'
|
|
6
|
+
${_}`);let T=_.substr(0,w),P=_.substr(w+1).trim();u.set(t?T.toLowerCase():T,P)}return u}tryReadBody(t){if(!(this._totalLength<t))return this._read(t)}get numberOfBytes(){return this._totalLength}_read(t){if(t===0)return this.emptyBuffer();if(t>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===t){let o=this._chunks[0];return this._chunks.shift(),this._totalLength-=t,this.asNative(o)}if(this._chunks[0].byteLength>t){let o=this._chunks[0],s=this.asNative(o,t);return this._chunks[0]=o.slice(t),this._totalLength-=t,s}let n=this.allocNative(t),r=0,i=0;for(;t>0;){let o=this._chunks[i];if(o.byteLength>t){let s=o.slice(0,t);n.set(s,r),r+=t,this._chunks[i]=o.slice(t),this._totalLength-=t,t-=t}else n.set(o,r),r+=o.byteLength,this._chunks.shift(),this._totalLength-=o.byteLength,t-=o.byteLength}return n}};yi.AbstractMessageBuffer=Zs});var Au=x(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.createMessageConnection=z.ConnectionOptions=z.MessageStrategy=z.CancellationStrategy=z.CancellationSenderStrategy=z.CancellationReceiverStrategy=z.RequestCancellationReceiverStrategy=z.IdCancellationReceiverStrategy=z.ConnectionStrategy=z.ConnectionError=z.ConnectionErrors=z.LogTraceNotification=z.SetTraceNotification=z.TraceFormat=z.TraceValues=z.Trace=z.NullLogger=z.ProgressType=z.ProgressToken=void 0;var qu=Bt(),De=Tn(),$=qs(),ju=Ns(),pr=qn(),Ks=pi(),mr;(function(e){e.type=new $.NotificationType("$/cancelRequest")})(mr||(mr={}));var ea;(function(e){function t(n){return typeof n=="string"||typeof n=="number"}e.is=t})(ea||(z.ProgressToken=ea={}));var hr;(function(e){e.type=new $.NotificationType("$/progress")})(hr||(hr={}));var ta=class{constructor(){}};z.ProgressType=ta;var na;(function(e){function t(n){return De.func(n)}e.is=t})(na||(na={}));z.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var re;(function(e){e[e.Off=0]="Off",e[e.Messages=1]="Messages",e[e.Compact=2]="Compact",e[e.Verbose=3]="Verbose"})(re||(z.Trace=re={}));var Nu;(function(e){e.Off="off",e.Messages="messages",e.Compact="compact",e.Verbose="verbose"})(Nu||(z.TraceValues=Nu={}));(function(e){function t(r){if(!De.string(r))return e.Off;switch(r=r.toLowerCase(),r){case"off":return e.Off;case"messages":return e.Messages;case"compact":return e.Compact;case"verbose":return e.Verbose;default:return e.Off}}e.fromString=t;function n(r){switch(r){case e.Off:return"off";case e.Messages:return"messages";case e.Compact:return"compact";case e.Verbose:return"verbose";default:return"off"}}e.toString=n})(re||(z.Trace=re={}));var Ze;(function(e){e.Text="text",e.JSON="json"})(Ze||(z.TraceFormat=Ze={}));(function(e){function t(n){return De.string(n)?(n=n.toLowerCase(),n==="json"?e.JSON:e.Text):e.Text}e.fromString=t})(Ze||(z.TraceFormat=Ze={}));var ra;(function(e){e.type=new $.NotificationType("$/setTrace")})(ra||(z.SetTraceNotification=ra={}));var vi;(function(e){e.type=new $.NotificationType("$/logTrace")})(vi||(z.LogTraceNotification=vi={}));var gr;(function(e){e[e.Closed=1]="Closed",e[e.Disposed=2]="Disposed",e[e.AlreadyListening=3]="AlreadyListening"})(gr||(z.ConnectionErrors=gr={}));var An=class e extends Error{constructor(t,n){super(n),this.code=t,Object.setPrototypeOf(this,e.prototype)}};z.ConnectionError=An;var ia;(function(e){function t(n){let r=n;return r&&De.func(r.cancelUndispatched)}e.is=t})(ia||(z.ConnectionStrategy=ia={}));var bi;(function(e){function t(n){let r=n;return r&&(r.kind===void 0||r.kind==="id")&&De.func(r.createCancellationTokenSource)&&(r.dispose===void 0||De.func(r.dispose))}e.is=t})(bi||(z.IdCancellationReceiverStrategy=bi={}));var oa;(function(e){function t(n){let r=n;return r&&r.kind==="request"&&De.func(r.createCancellationTokenSource)&&(r.dispose===void 0||De.func(r.dispose))}e.is=t})(oa||(z.RequestCancellationReceiverStrategy=oa={}));var Ri;(function(e){e.Message=Object.freeze({createCancellationTokenSource(n){return new Ks.CancellationTokenSource}});function t(n){return bi.is(n)||oa.is(n)}e.is=t})(Ri||(z.CancellationReceiverStrategy=Ri={}));var Di;(function(e){e.Message=Object.freeze({sendCancellation(n,r){return n.sendNotification(mr.type,{id:r})},cleanup(n){}});function t(n){let r=n;return r&&De.func(r.sendCancellation)&&De.func(r.cleanup)}e.is=t})(Di||(z.CancellationSenderStrategy=Di={}));var _i;(function(e){e.Message=Object.freeze({receiver:Ri.Message,sender:Di.Message});function t(n){let r=n;return r&&Ri.is(r.receiver)&&Di.is(r.sender)}e.is=t})(_i||(z.CancellationStrategy=_i={}));var wi;(function(e){function t(n){let r=n;return r&&De.func(r.handleMessage)}e.is=t})(wi||(z.MessageStrategy=wi={}));var Iu;(function(e){function t(n){let r=n;return r&&(_i.is(r.cancellationStrategy)||ia.is(r.connectionStrategy)||wi.is(r.messageStrategy))}e.is=t})(Iu||(z.ConnectionOptions=Iu={}));var mt;(function(e){e[e.New=1]="New",e[e.Listening=2]="Listening",e[e.Closed=3]="Closed",e[e.Disposed=4]="Disposed"})(mt||(mt={}));function iv(e,t,n,r){let i=n!==void 0?n:z.NullLogger,o=0,s=0,u=0,d="2.0",p,_=new Map,w,T=new Map,P=new Map,L,H=new ju.LinkedMap,se=new Map,U=new Set,y=new Map,v=re.Off,q=Ze.Text,J,le=mt.New,_e=new pr.Emitter,ft=new pr.Emitter,on=new pr.Emitter,Wt=new pr.Emitter,Ht=new pr.Emitter,Ue=r&&r.cancellationStrategy?r.cancellationStrategy:_i.Message;function _n(h){if(h===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+h.toString()}function wn(h){return h===null?"res-unknown-"+(++u).toString():"res-"+h.toString()}function zr(){return"not-"+(++s).toString()}function ss(h,E){$.Message.isRequest(E)?h.set(_n(E.id),E):$.Message.isResponse(E)?h.set(wn(E.id),E):h.set(zr(),E)}function Gr(h){}function or(){return le===mt.Listening}function sn(){return le===mt.Closed}function kt(){return le===mt.Disposed}function Pn(){(le===mt.New||le===mt.Listening)&&(le=mt.Closed,ft.fire(void 0))}function an(h){_e.fire([h,void 0,void 0])}function Xr(h){_e.fire(h)}e.onClose(Pn),e.onError(an),t.onClose(Pn),t.onError(Xr);function sr(){L||H.size===0||(L=(0,qu.default)().timer.setImmediate(()=>{L=void 0,Jr()}))}function ar(h){$.Message.isRequest(h)?Qr(h):$.Message.isNotification(h)?Kr(h):$.Message.isResponse(h)?Zr(h):Cn(h)}function Jr(){if(H.size===0)return;let h=H.shift();try{let E=r?.messageStrategy;wi.is(E)?E.handleMessage(h,ar):ar(h)}finally{sr()}}let Yr=h=>{try{if($.Message.isNotification(h)&&h.method===mr.type.method){let E=h.params.id,j=_n(E),F=H.get(j);if($.Message.isRequest(F)){let ie=r?.connectionStrategy,he=ie&&ie.cancelUndispatched?ie.cancelUndispatched(F,Gr):void 0;if(he&&(he.error!==void 0||he.result!==void 0)){H.delete(j),y.delete(E),he.id=F.id,cn(he,h.method,Date.now()),t.write(he).catch(()=>i.error("Sending response for canceled message failed."));return}}let ae=y.get(E);if(ae!==void 0){ae.cancel(),En(h);return}else U.add(E)}ss(H,h)}finally{sr()}};function Qr(h){if(kt())return;function E(Y,ce,ee){let we={jsonrpc:d,id:h.id};Y instanceof $.ResponseError?we.error=Y.toJson():we.result=Y===void 0?null:Y,cn(we,ce,ee),t.write(we).catch(()=>i.error("Sending response failed."))}function j(Y,ce,ee){let we={jsonrpc:d,id:h.id,error:Y.toJson()};cn(we,ce,ee),t.write(we).catch(()=>i.error("Sending response failed."))}function F(Y,ce,ee){Y===void 0&&(Y=null);let we={jsonrpc:d,id:h.id,result:Y};cn(we,ce,ee),t.write(we).catch(()=>i.error("Sending response failed."))}ni(h);let ae=_.get(h.method),ie,he;ae&&(ie=ae.type,he=ae.handler);let ve=Date.now();if(he||p){let Y=h.id??String(Date.now()),ce=bi.is(Ue.receiver)?Ue.receiver.createCancellationTokenSource(Y):Ue.receiver.createCancellationTokenSource(h);h.id!==null&&U.has(h.id)&&ce.cancel(),h.id!==null&&y.set(Y,ce);try{let ee;if(he)if(h.params===void 0){if(ie!==void 0&&ie.numberOfParams!==0){j(new $.ResponseError($.ErrorCodes.InvalidParams,`Request ${h.method} defines ${ie.numberOfParams} params but received none.`),h.method,ve);return}ee=he(ce.token)}else if(Array.isArray(h.params)){if(ie!==void 0&&ie.parameterStructures===$.ParameterStructures.byName){j(new $.ResponseError($.ErrorCodes.InvalidParams,`Request ${h.method} defines parameters by name but received parameters by position`),h.method,ve);return}ee=he(...h.params,ce.token)}else{if(ie!==void 0&&ie.parameterStructures===$.ParameterStructures.byPosition){j(new $.ResponseError($.ErrorCodes.InvalidParams,`Request ${h.method} defines parameters by position but received parameters by name`),h.method,ve);return}ee=he(h.params,ce.token)}else p&&(ee=p(h.method,h.params,ce.token));let we=ee;ee?we.then?we.then(je=>{y.delete(Y),E(je,h.method,ve)},je=>{y.delete(Y),je instanceof $.ResponseError?j(je,h.method,ve):je&&De.string(je.message)?j(new $.ResponseError($.ErrorCodes.InternalError,`Request ${h.method} failed with message: ${je.message}`),h.method,ve):j(new $.ResponseError($.ErrorCodes.InternalError,`Request ${h.method} failed unexpectedly without providing any details.`),h.method,ve)}):(y.delete(Y),E(ee,h.method,ve)):(y.delete(Y),F(ee,h.method,ve))}catch(ee){y.delete(Y),ee instanceof $.ResponseError?E(ee,h.method,ve):ee&&De.string(ee.message)?j(new $.ResponseError($.ErrorCodes.InternalError,`Request ${h.method} failed with message: ${ee.message}`),h.method,ve):j(new $.ResponseError($.ErrorCodes.InternalError,`Request ${h.method} failed unexpectedly without providing any details.`),h.method,ve)}}else j(new $.ResponseError($.ErrorCodes.MethodNotFound,`Unhandled method ${h.method}`),h.method,ve)}function Zr(h){if(!kt())if(h.id===null)h.error?i.error(`Received response message without id: Error is:
|
|
7
7
|
${JSON.stringify(h.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let E=h.id,j=se.get(E);if(ri(h,j),j!==void 0){se.delete(E);try{if(h.error){let F=h.error;j.reject(new $.ResponseError(F.code,F.message,F.data))}else if(h.result!==void 0)j.resolve(h.result);else throw new Error("Should never happen.")}catch(F){F.message?i.error(`Response handler '${j.method}' failed with message: ${F.message}`):i.error(`Response handler '${j.method}' failed unexpectedly.`)}}}}function Kr(h){if(kt())return;let E,j;if(h.method===mr.type.method){let F=h.params.id;U.delete(F),En(h);return}else{let F=T.get(h.method);F&&(j=F.handler,E=F.type)}if(j||w)try{if(En(h),j)if(h.params===void 0)E!==void 0&&E.numberOfParams!==0&&E.parameterStructures!==$.ParameterStructures.byName&&i.error(`Notification ${h.method} defines ${E.numberOfParams} params but received none.`),j();else if(Array.isArray(h.params)){let F=h.params;h.method===hr.type.method&&F.length===2&&ea.is(F[0])?j({token:F[0],value:F[1]}):(E!==void 0&&(E.parameterStructures===$.ParameterStructures.byName&&i.error(`Notification ${h.method} defines parameters by name but received parameters by position`),E.numberOfParams!==h.params.length&&i.error(`Notification ${h.method} defines ${E.numberOfParams} params but received ${F.length} arguments`)),j(...F))}else E!==void 0&&E.parameterStructures===$.ParameterStructures.byPosition&&i.error(`Notification ${h.method} defines parameters by position but received parameters by name`),j(h.params);else w&&w(h.method,h.params)}catch(F){F.message?i.error(`Notification handler '${h.method}' failed with message: ${F.message}`):i.error(`Notification handler '${h.method}' failed unexpectedly.`)}else on.fire(h)}function Cn(h){if(!h){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
|
|
8
|
-
${JSON.stringify(h,null,4)}`);let E=h;if(De.string(E.id)||De.number(E.id)){let j=E.id,F=se.get(j);F&&F.reject(new Error("The received response has neither a result nor an error property."))}}function
|
|
8
|
+
${JSON.stringify(h,null,4)}`);let E=h;if(De.string(E.id)||De.number(E.id)){let j=E.id,F=se.get(j);F&&F.reject(new Error("The received response has neither a result nor an error property."))}}function pt(h){if(h!=null)switch(v){case re.Verbose:return JSON.stringify(h,null,4);case re.Compact:return JSON.stringify(h);default:return}}function ei(h){if(!(v===re.Off||!J))if(q===Ze.Text){let E;(v===re.Verbose||v===re.Compact)&&h.params&&(E=`Params: ${pt(h.params)}
|
|
9
9
|
|
|
10
|
-
`),J.log(`Sending request '${h.method} - (${h.id})'.`,E)}else qt("send-request",h)}function ti(h){if(!(v===re.Off||!J))if(q===Ze.Text){let E;(v===re.Verbose||v===re.Compact)&&(h.params?E=`Params: ${
|
|
10
|
+
`),J.log(`Sending request '${h.method} - (${h.id})'.`,E)}else qt("send-request",h)}function ti(h){if(!(v===re.Off||!J))if(q===Ze.Text){let E;(v===re.Verbose||v===re.Compact)&&(h.params?E=`Params: ${pt(h.params)}
|
|
11
11
|
|
|
12
12
|
`:E=`No parameters provided.
|
|
13
13
|
|
|
14
|
-
`),J.log(`Sending notification '${h.method}'.`,E)}else qt("send-notification",h)}function cn(h,E,j){if(!(v===re.Off||!J))if(q===Ze.Text){let F;(v===re.Verbose||v===re.Compact)&&(h.error&&h.error.data?F=`Error data: ${
|
|
14
|
+
`),J.log(`Sending notification '${h.method}'.`,E)}else qt("send-notification",h)}function cn(h,E,j){if(!(v===re.Off||!J))if(q===Ze.Text){let F;(v===re.Verbose||v===re.Compact)&&(h.error&&h.error.data?F=`Error data: ${pt(h.error.data)}
|
|
15
15
|
|
|
16
|
-
`:h.result?F=`Result: ${
|
|
16
|
+
`:h.result?F=`Result: ${pt(h.result)}
|
|
17
17
|
|
|
18
18
|
`:h.error===void 0&&(F=`No result returned.
|
|
19
19
|
|
|
20
|
-
`)),J.log(`Sending response '${E} - (${h.id})'. Processing request took ${Date.now()-j}ms`,F)}else qt("send-response",h)}function ni(h){if(!(v===re.Off||!J))if(q===Ze.Text){let E;(v===re.Verbose||v===re.Compact)&&h.params&&(E=`Params: ${
|
|
20
|
+
`)),J.log(`Sending response '${E} - (${h.id})'. Processing request took ${Date.now()-j}ms`,F)}else qt("send-response",h)}function ni(h){if(!(v===re.Off||!J))if(q===Ze.Text){let E;(v===re.Verbose||v===re.Compact)&&h.params&&(E=`Params: ${pt(h.params)}
|
|
21
21
|
|
|
22
|
-
`),J.log(`Received request '${h.method} - (${h.id})'.`,E)}else qt("receive-request",h)}function En(h){if(!(v===re.Off||!J||h.method===vi.type.method))if(q===Ze.Text){let E;(v===re.Verbose||v===re.Compact)&&(h.params?E=`Params: ${
|
|
22
|
+
`),J.log(`Received request '${h.method} - (${h.id})'.`,E)}else qt("receive-request",h)}function En(h){if(!(v===re.Off||!J||h.method===vi.type.method))if(q===Ze.Text){let E;(v===re.Verbose||v===re.Compact)&&(h.params?E=`Params: ${pt(h.params)}
|
|
23
23
|
|
|
24
24
|
`:E=`No parameters provided.
|
|
25
25
|
|
|
26
|
-
`),J.log(`Received notification '${h.method}'.`,E)}else qt("receive-notification",h)}function ri(h,E){if(!(v===re.Off||!J))if(q===Ze.Text){let j;if((v===re.Verbose||v===re.Compact)&&(h.error&&h.error.data?j=`Error data: ${
|
|
26
|
+
`),J.log(`Received notification '${h.method}'.`,E)}else qt("receive-notification",h)}function ri(h,E){if(!(v===re.Off||!J))if(q===Ze.Text){let j;if((v===re.Verbose||v===re.Compact)&&(h.error&&h.error.data?j=`Error data: ${pt(h.error.data)}
|
|
27
27
|
|
|
28
|
-
`:h.result?j=`Result: ${
|
|
28
|
+
`:h.result?j=`Result: ${pt(h.result)}
|
|
29
29
|
|
|
30
30
|
`:h.error===void 0&&(j=`No result returned.
|
|
31
31
|
|
|
32
|
-
`)),E){let F=h.error?` Request failed: ${h.error.message} (${h.error.code}).`:"";J.log(`Received response '${E.method} - (${h.id})' in ${Date.now()-E.timerStart}ms.${F}`,j)}else J.log(`Received response ${h.id} without active response promise.`,j)}else qt("receive-response",h)}function qt(h,E){if(!J||v===re.Off)return;let j={isLSPMessage:!0,type:h,message:E,timestamp:Date.now()};J.log(j)}function Ut(){if(sn())throw new An(gr.Closed,"Connection is closed.");if(kt())throw new An(gr.Disposed,"Connection is disposed.")}function ii(){if(or())throw new An(gr.AlreadyListening,"Connection is already listening")}function oi(){if(!or())throw new Error("Call listen() first.")}function _t(h){return h===void 0?null:h}function cr(h){if(h!==null)return h}function ur(h){return h!=null&&!Array.isArray(h)&&typeof h=="object"}function xn(h,E){switch(h){case $.ParameterStructures.auto:return ur(E)?cr(E):[_t(E)];case $.ParameterStructures.byName:if(!ur(E))throw new Error("Received parameters by name but param is not an object literal.");return cr(E);case $.ParameterStructures.byPosition:return[_t(E)];default:throw new Error(`Unknown parameter structure ${h.toString()}`)}}function lr(h,E){let j,F=h.numberOfParams;switch(F){case 0:j=void 0;break;case 1:j=xn(h.parameterStructures,E[0]);break;default:j=[];for(let ae=0;ae<E.length&&ae<F;ae++)j.push(_t(E[ae]));if(E.length<F)for(let ae=E.length;ae<F;ae++)j.push(null);break}return j}let jt={sendNotification:(h,...E)=>{Ut();let j,F;if(De.string(h)){j=h;let ie=E[0],he=0,ve=$.ParameterStructures.auto;$.ParameterStructures.is(ie)&&(he=1,ve=ie);let Y=E.length,ce=Y-he;switch(ce){case 0:F=void 0;break;case 1:F=xn(ve,E[he]);break;default:if(ve===$.ParameterStructures.byName)throw new Error(`Received ${ce} parameters for 'by Name' notification parameter structure.`);F=E.slice(he,Y).map(ee=>_t(ee));break}}else{let ie=E;j=h.method,F=lr(h,ie)}let ae={jsonrpc:d,method:j,params:F};return ti(ae),t.write(ae).catch(ie=>{throw i.error("Sending notification failed."),ie})},onNotification:(h,E)=>{Ut();let j;return De.func(h)?w=h:E&&(De.string(h)?(j=h,T.set(h,{type:void 0,handler:E})):(j=h.method,T.set(h.method,{type:h,handler:E}))),{dispose:()=>{j!==void 0?T.delete(j):w=void 0}}},onProgress:(h,E,j)=>{if(P.has(E))throw new Error(`Progress handler for token ${E} already registered`);return P.set(E,j),{dispose:()=>{P.delete(E)}}},sendProgress:(h,E,j)=>jt.sendNotification(hr.type,{token:E,value:j}),onUnhandledProgress:Wt.event,sendRequest:(h,...E)=>{Ut(),oi();let j,F,ae;if(De.string(h)){j=h;let Y=E[0],ce=E[E.length-1],ee=0,we=$.ParameterStructures.auto;$.ParameterStructures.is(Y)&&(ee=1,we=Y);let je=E.length;Ks.CancellationToken.is(ce)&&(je=je-1,ae=ce);let Qe=je-ee;switch(Qe){case 0:F=void 0;break;case 1:F=xn(we,E[ee]);break;default:if(we===$.ParameterStructures.byName)throw new Error(`Received ${Qe} parameters for 'by Name' request parameter structure.`);F=E.slice(ee,je).map(si=>_t(si));break}}else{let Y=E;j=h.method,F=lr(h,Y);let ce=h.numberOfParams;ae=Ks.CancellationToken.is(Y[ce])?Y[ce]:void 0}let ie=o++,he;ae&&(he=ae.onCancellationRequested(()=>{let Y=Ue.sender.sendCancellation(jt,ie);return Y===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${ie}`),Promise.resolve()):Y.catch(()=>{i.log(`Sending cancellation messages for id ${ie} failed`)})}));let ve={jsonrpc:d,id:ie,method:j,params:F};return ei(ve),typeof Ue.sender.enableCancellation=="function"&&Ue.sender.enableCancellation(ve),new Promise(async(Y,ce)=>{let ee=Qe=>{Y(Qe),Ue.sender.cleanup(ie),he?.dispose()},we=Qe=>{ce(Qe),Ue.sender.cleanup(ie),he?.dispose()},je={method:j,timerStart:Date.now(),resolve:ee,reject:we};try{await t.write(ve),se.set(ie,je)}catch(Qe){throw i.error("Sending request failed."),je.reject(new $.ResponseError($.ErrorCodes.MessageWriteError,Qe.message?Qe.message:"Unknown reason")),Qe}})},onRequest:(h,E)=>{Ut();let j=null;return na.is(h)?(j=void 0,p=h):De.string(h)?(j=null,E!==void 0&&(j=h,_.set(h,{handler:E,type:void 0}))):E!==void 0&&(j=h.method,_.set(h.method,{type:h,handler:E})),{dispose:()=>{j!==null&&(j!==void 0?_.delete(j):p=void 0)}}},hasPendingResponse:()=>se.size>0,trace:async(h,E,j)=>{let F=!1,ae=Ze.Text;j!==void 0&&(De.boolean(j)?F=j:(F=j.sendNotification||!1,ae=j.traceFormat||Ze.Text)),v=h,q=ae,v===re.Off?J=void 0:J=E,F&&!sn()&&!kt()&&await jt.sendNotification(ra.type,{value:re.toString(h)})},onError:_e.event,onClose:dt.event,onUnhandledNotification:on.event,onDispose:Ht.event,end:()=>{t.end()},dispose:()=>{if(kt())return;le=gt.Disposed,Ht.fire(void 0);let h=new $.ResponseError($.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let E of se.values())E.reject(h);se=new Map,y=new Map,U=new Set,H=new ju.LinkedMap,De.func(t.dispose)&&t.dispose(),De.func(e.dispose)&&e.dispose()},listen:()=>{Ut(),ii(),le=gt.Listening,e.listen(Yr)},inspect:()=>{(0,qu.default)().console.log("inspect")}};return jt.onNotification(vi.type,h=>{if(v===re.Off||!J)return;let E=v===re.Verbose||v===re.Compact;J.log(h.message,E?h.verbose:void 0)}),jt.onNotification(hr.type,h=>{let E=P.get(h.token);E?E(h.value):Wt.fire(h)}),jt}z.createMessageConnection=rv});var Pi=x(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.ProgressType=C.ProgressToken=C.createMessageConnection=C.NullLogger=C.ConnectionOptions=C.ConnectionStrategy=C.AbstractMessageBuffer=C.WriteableStreamMessageWriter=C.AbstractMessageWriter=C.MessageWriter=C.ReadableStreamMessageReader=C.AbstractMessageReader=C.MessageReader=C.SharedArrayReceiverStrategy=C.SharedArraySenderStrategy=C.CancellationToken=C.CancellationTokenSource=C.Emitter=C.Event=C.Disposable=C.LRUCache=C.Touch=C.LinkedMap=C.ParameterStructures=C.NotificationType9=C.NotificationType8=C.NotificationType7=C.NotificationType6=C.NotificationType5=C.NotificationType4=C.NotificationType3=C.NotificationType2=C.NotificationType1=C.NotificationType0=C.NotificationType=C.ErrorCodes=C.ResponseError=C.RequestType9=C.RequestType8=C.RequestType7=C.RequestType6=C.RequestType5=C.RequestType4=C.RequestType3=C.RequestType2=C.RequestType1=C.RequestType0=C.RequestType=C.Message=C.RAL=void 0;C.MessageStrategy=C.CancellationStrategy=C.CancellationSenderStrategy=C.CancellationReceiverStrategy=C.ConnectionError=C.ConnectionErrors=C.LogTraceNotification=C.SetTraceNotification=C.TraceFormat=C.TraceValues=C.Trace=void 0;var fe=qs();Object.defineProperty(C,"Message",{enumerable:!0,get:function(){return fe.Message}});Object.defineProperty(C,"RequestType",{enumerable:!0,get:function(){return fe.RequestType}});Object.defineProperty(C,"RequestType0",{enumerable:!0,get:function(){return fe.RequestType0}});Object.defineProperty(C,"RequestType1",{enumerable:!0,get:function(){return fe.RequestType1}});Object.defineProperty(C,"RequestType2",{enumerable:!0,get:function(){return fe.RequestType2}});Object.defineProperty(C,"RequestType3",{enumerable:!0,get:function(){return fe.RequestType3}});Object.defineProperty(C,"RequestType4",{enumerable:!0,get:function(){return fe.RequestType4}});Object.defineProperty(C,"RequestType5",{enumerable:!0,get:function(){return fe.RequestType5}});Object.defineProperty(C,"RequestType6",{enumerable:!0,get:function(){return fe.RequestType6}});Object.defineProperty(C,"RequestType7",{enumerable:!0,get:function(){return fe.RequestType7}});Object.defineProperty(C,"RequestType8",{enumerable:!0,get:function(){return fe.RequestType8}});Object.defineProperty(C,"RequestType9",{enumerable:!0,get:function(){return fe.RequestType9}});Object.defineProperty(C,"ResponseError",{enumerable:!0,get:function(){return fe.ResponseError}});Object.defineProperty(C,"ErrorCodes",{enumerable:!0,get:function(){return fe.ErrorCodes}});Object.defineProperty(C,"NotificationType",{enumerable:!0,get:function(){return fe.NotificationType}});Object.defineProperty(C,"NotificationType0",{enumerable:!0,get:function(){return fe.NotificationType0}});Object.defineProperty(C,"NotificationType1",{enumerable:!0,get:function(){return fe.NotificationType1}});Object.defineProperty(C,"NotificationType2",{enumerable:!0,get:function(){return fe.NotificationType2}});Object.defineProperty(C,"NotificationType3",{enumerable:!0,get:function(){return fe.NotificationType3}});Object.defineProperty(C,"NotificationType4",{enumerable:!0,get:function(){return fe.NotificationType4}});Object.defineProperty(C,"NotificationType5",{enumerable:!0,get:function(){return fe.NotificationType5}});Object.defineProperty(C,"NotificationType6",{enumerable:!0,get:function(){return fe.NotificationType6}});Object.defineProperty(C,"NotificationType7",{enumerable:!0,get:function(){return fe.NotificationType7}});Object.defineProperty(C,"NotificationType8",{enumerable:!0,get:function(){return fe.NotificationType8}});Object.defineProperty(C,"NotificationType9",{enumerable:!0,get:function(){return fe.NotificationType9}});Object.defineProperty(C,"ParameterStructures",{enumerable:!0,get:function(){return fe.ParameterStructures}});var sa=Ns();Object.defineProperty(C,"LinkedMap",{enumerable:!0,get:function(){return sa.LinkedMap}});Object.defineProperty(C,"LRUCache",{enumerable:!0,get:function(){return sa.LRUCache}});Object.defineProperty(C,"Touch",{enumerable:!0,get:function(){return sa.Touch}});var iv=Ru();Object.defineProperty(C,"Disposable",{enumerable:!0,get:function(){return iv.Disposable}});var Ou=qn();Object.defineProperty(C,"Event",{enumerable:!0,get:function(){return Ou.Event}});Object.defineProperty(C,"Emitter",{enumerable:!0,get:function(){return Ou.Emitter}});var Fu=pi();Object.defineProperty(C,"CancellationTokenSource",{enumerable:!0,get:function(){return Fu.CancellationTokenSource}});Object.defineProperty(C,"CancellationToken",{enumerable:!0,get:function(){return Fu.CancellationToken}});var Mu=_u();Object.defineProperty(C,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return Mu.SharedArraySenderStrategy}});Object.defineProperty(C,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return Mu.SharedArrayReceiverStrategy}});var aa=Pu();Object.defineProperty(C,"MessageReader",{enumerable:!0,get:function(){return aa.MessageReader}});Object.defineProperty(C,"AbstractMessageReader",{enumerable:!0,get:function(){return aa.AbstractMessageReader}});Object.defineProperty(C,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return aa.ReadableStreamMessageReader}});var ca=Tu();Object.defineProperty(C,"MessageWriter",{enumerable:!0,get:function(){return ca.MessageWriter}});Object.defineProperty(C,"AbstractMessageWriter",{enumerable:!0,get:function(){return ca.AbstractMessageWriter}});Object.defineProperty(C,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return ca.WriteableStreamMessageWriter}});var ov=ku();Object.defineProperty(C,"AbstractMessageBuffer",{enumerable:!0,get:function(){return ov.AbstractMessageBuffer}});var Ae=Au();Object.defineProperty(C,"ConnectionStrategy",{enumerable:!0,get:function(){return Ae.ConnectionStrategy}});Object.defineProperty(C,"ConnectionOptions",{enumerable:!0,get:function(){return Ae.ConnectionOptions}});Object.defineProperty(C,"NullLogger",{enumerable:!0,get:function(){return Ae.NullLogger}});Object.defineProperty(C,"createMessageConnection",{enumerable:!0,get:function(){return Ae.createMessageConnection}});Object.defineProperty(C,"ProgressToken",{enumerable:!0,get:function(){return Ae.ProgressToken}});Object.defineProperty(C,"ProgressType",{enumerable:!0,get:function(){return Ae.ProgressType}});Object.defineProperty(C,"Trace",{enumerable:!0,get:function(){return Ae.Trace}});Object.defineProperty(C,"TraceValues",{enumerable:!0,get:function(){return Ae.TraceValues}});Object.defineProperty(C,"TraceFormat",{enumerable:!0,get:function(){return Ae.TraceFormat}});Object.defineProperty(C,"SetTraceNotification",{enumerable:!0,get:function(){return Ae.SetTraceNotification}});Object.defineProperty(C,"LogTraceNotification",{enumerable:!0,get:function(){return Ae.LogTraceNotification}});Object.defineProperty(C,"ConnectionErrors",{enumerable:!0,get:function(){return Ae.ConnectionErrors}});Object.defineProperty(C,"ConnectionError",{enumerable:!0,get:function(){return Ae.ConnectionError}});Object.defineProperty(C,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Ae.CancellationReceiverStrategy}});Object.defineProperty(C,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Ae.CancellationSenderStrategy}});Object.defineProperty(C,"CancellationStrategy",{enumerable:!0,get:function(){return Ae.CancellationStrategy}});Object.defineProperty(C,"MessageStrategy",{enumerable:!0,get:function(){return Ae.MessageStrategy}});var sv=Bt();C.RAL=sv.default});var Wu=x(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});var Lu=require("util"),It=Pi(),Ci=class e extends It.AbstractMessageBuffer{constructor(t="utf-8"){super(t)}emptyBuffer(){return e.emptyBuffer}fromString(t,n){return Buffer.from(t,n)}toString(t,n){return t instanceof Buffer?t.toString(n):new Lu.TextDecoder(n).decode(t)}asNative(t,n){return n===void 0?t instanceof Buffer?t:Buffer.from(t):t instanceof Buffer?t.slice(0,n):Buffer.from(t,0,n)}allocNative(t){return Buffer.allocUnsafe(t)}};Ci.emptyBuffer=Buffer.allocUnsafe(0);var ua=class{constructor(t){this.stream=t}onClose(t){return this.stream.on("close",t),It.Disposable.create(()=>this.stream.off("close",t))}onError(t){return this.stream.on("error",t),It.Disposable.create(()=>this.stream.off("error",t))}onEnd(t){return this.stream.on("end",t),It.Disposable.create(()=>this.stream.off("end",t))}onData(t){return this.stream.on("data",t),It.Disposable.create(()=>this.stream.off("data",t))}},la=class{constructor(t){this.stream=t}onClose(t){return this.stream.on("close",t),It.Disposable.create(()=>this.stream.off("close",t))}onError(t){return this.stream.on("error",t),It.Disposable.create(()=>this.stream.off("error",t))}onEnd(t){return this.stream.on("end",t),It.Disposable.create(()=>this.stream.off("end",t))}write(t,n){return new Promise((r,i)=>{let o=s=>{s==null?r():i(s)};typeof t=="string"?this.stream.write(t,n,o):this.stream.write(t,o)})}end(){this.stream.end()}},$u=Object.freeze({messageBuffer:Object.freeze({create:e=>new Ci(e)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(e,t)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(e,void 0,0),t.charset))}catch(n){return Promise.reject(n)}}}),decoder:Object.freeze({name:"application/json",decode:(e,t)=>{try{return e instanceof Buffer?Promise.resolve(JSON.parse(e.toString(t.charset))):Promise.resolve(JSON.parse(new Lu.TextDecoder(t.charset).decode(e)))}catch(n){return Promise.reject(n)}}})}),stream:Object.freeze({asReadableStream:e=>new ua(e),asWritableStream:e=>new la(e)}),console,timer:Object.freeze({setTimeout(e,t,...n){let r=setTimeout(e,t,...n);return{dispose:()=>clearTimeout(r)}},setImmediate(e,...t){let n=setImmediate(e,...t);return{dispose:()=>clearImmediate(n)}},setInterval(e,t,...n){let r=setInterval(e,t,...n);return{dispose:()=>clearInterval(r)}}})});function da(){return $u}(function(e){function t(){It.RAL.install($u)}e.install=t})(da||(da={}));fa.default=da});var fn=x(Z=>{"use strict";var av=Z&&Z.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),cv=Z&&Z.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&av(t,e,n)};Object.defineProperty(Z,"__esModule",{value:!0});Z.createMessageConnection=Z.createServerSocketTransport=Z.createClientSocketTransport=Z.createServerPipeTransport=Z.createClientPipeTransport=Z.generateRandomPipeName=Z.StreamMessageWriter=Z.StreamMessageReader=Z.SocketMessageWriter=Z.SocketMessageReader=Z.PortMessageWriter=Z.PortMessageReader=Z.IPCMessageWriter=Z.IPCMessageReader=void 0;var On=Wu();On.default.install();var Hu=require("path"),uv=require("os"),lv=require("crypto"),Si=require("net"),Ke=Pi();cv(Pi(),Z);var pa=class extends Ke.AbstractMessageReader{constructor(t){super(),this.process=t;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose())}listen(t){return this.process.on("message",t),Ke.Disposable.create(()=>this.process.off("message",t))}};Z.IPCMessageReader=pa;var ha=class extends Ke.AbstractMessageWriter{constructor(t){super(),this.process=t,this.errorCount=0;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose)}write(t){try{return typeof this.process.send=="function"&&this.process.send(t,void 0,void 0,n=>{n?(this.errorCount++,this.handleError(n,t)):this.errorCount=0}),Promise.resolve()}catch(n){return this.handleError(n,t),Promise.reject(n)}}handleError(t,n){this.errorCount++,this.fireError(t,n,this.errorCount)}end(){}};Z.IPCMessageWriter=ha;var ga=class extends Ke.AbstractMessageReader{constructor(t){super(),this.onData=new Ke.Emitter,t.on("close",()=>this.fireClose),t.on("error",n=>this.fireError(n)),t.on("message",n=>{this.onData.fire(n)})}listen(t){return this.onData.event(t)}};Z.PortMessageReader=ga;var ma=class extends Ke.AbstractMessageWriter{constructor(t){super(),this.port=t,this.errorCount=0,t.on("close",()=>this.fireClose()),t.on("error",n=>this.fireError(n))}write(t){try{return this.port.postMessage(t),Promise.resolve()}catch(n){return this.handleError(n,t),Promise.reject(n)}}handleError(t,n){this.errorCount++,this.fireError(t,n,this.errorCount)}end(){}};Z.PortMessageWriter=ma;var ln=class extends Ke.ReadableStreamMessageReader{constructor(t,n="utf-8"){super((0,On.default)().stream.asReadableStream(t),n)}};Z.SocketMessageReader=ln;var dn=class extends Ke.WriteableStreamMessageWriter{constructor(t,n){super((0,On.default)().stream.asWritableStream(t),n),this.socket=t}dispose(){super.dispose(),this.socket.destroy()}};Z.SocketMessageWriter=dn;var Ei=class extends Ke.ReadableStreamMessageReader{constructor(t,n){super((0,On.default)().stream.asReadableStream(t),n)}};Z.StreamMessageReader=Ei;var xi=class extends Ke.WriteableStreamMessageWriter{constructor(t,n){super((0,On.default)().stream.asWritableStream(t),n)}};Z.StreamMessageWriter=xi;var Uu=process.env.XDG_RUNTIME_DIR,dv=new Map([["linux",107],["darwin",103]]);function fv(){let e=(0,lv.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${e}-sock`;let t;Uu?t=Hu.join(Uu,`vscode-ipc-${e}.sock`):t=Hu.join(uv.tmpdir(),`vscode-${e}.sock`);let n=dv.get(process.platform);return n!==void 0&&t.length>n&&(0,On.default)().console.warn(`WARNING: IPC handle "${t}" is longer than ${n} characters.`),t}Z.generateRandomPipeName=fv;function pv(e,t="utf-8"){let n,r=new Promise((i,o)=>{n=i});return new Promise((i,o)=>{let s=(0,Si.createServer)(u=>{s.close(),n([new ln(u,t),new dn(u,t)])});s.on("error",o),s.listen(e,()=>{s.removeListener("error",o),i({onConnected:()=>r})})})}Z.createClientPipeTransport=pv;function hv(e,t="utf-8"){let n=(0,Si.createConnection)(e);return[new ln(n,t),new dn(n,t)]}Z.createServerPipeTransport=hv;function gv(e,t="utf-8"){let n,r=new Promise((i,o)=>{n=i});return new Promise((i,o)=>{let s=(0,Si.createServer)(u=>{s.close(),n([new ln(u,t),new dn(u,t)])});s.on("error",o),s.listen(e,"127.0.0.1",()=>{s.removeListener("error",o),i({onConnected:()=>r})})})}Z.createClientSocketTransport=gv;function mv(e,t="utf-8"){let n=(0,Si.createConnection)(e,"127.0.0.1");return[new ln(n,t),new dn(n,t)]}Z.createServerSocketTransport=mv;function yv(e){let t=e;return t.read!==void 0&&t.addListener!==void 0}function vv(e){let t=e;return t.write!==void 0&&t.addListener!==void 0}function bv(e,t,n,r){n||(n=Ke.NullLogger);let i=yv(e)?new Ei(e):e,o=vv(t)?new xi(t):t;return Ke.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,Ke.createMessageConnection)(i,o,n,r)}Z.createMessageConnection=bv});var Ti=x((yP,Vu)=>{"use strict";Vu.exports=fn()});var qi=x((Bu,ki)=>{(function(e){if(typeof ki=="object"&&typeof ki.exports=="object"){var t=e(require,Bu);t!==void 0&&(ki.exports=t)}else typeof define=="function"&&define.amd&&define(["require","exports"],e)})(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextDocument=t.EOL=t.WorkspaceFolder=t.InlineCompletionContext=t.SelectedCompletionInfo=t.InlineCompletionTriggerKind=t.InlineCompletionList=t.InlineCompletionItem=t.StringValue=t.InlayHint=t.InlayHintLabelPart=t.InlayHintKind=t.InlineValueContext=t.InlineValueEvaluatableExpression=t.InlineValueVariableLookup=t.InlineValueText=t.SemanticTokens=t.SemanticTokenModifiers=t.SemanticTokenTypes=t.SelectionRange=t.DocumentLink=t.FormattingOptions=t.CodeLens=t.CodeAction=t.CodeActionContext=t.CodeActionTriggerKind=t.CodeActionKind=t.DocumentSymbol=t.WorkspaceSymbol=t.SymbolInformation=t.SymbolTag=t.SymbolKind=t.DocumentHighlight=t.DocumentHighlightKind=t.SignatureInformation=t.ParameterInformation=t.Hover=t.MarkedString=t.CompletionList=t.CompletionItem=t.CompletionItemLabelDetails=t.InsertTextMode=t.InsertReplaceEdit=t.CompletionItemTag=t.InsertTextFormat=t.CompletionItemKind=t.MarkupContent=t.MarkupKind=t.TextDocumentItem=t.OptionalVersionedTextDocumentIdentifier=t.VersionedTextDocumentIdentifier=t.TextDocumentIdentifier=t.WorkspaceChange=t.WorkspaceEdit=t.DeleteFile=t.RenameFile=t.CreateFile=t.TextDocumentEdit=t.AnnotatedTextEdit=t.ChangeAnnotationIdentifier=t.ChangeAnnotation=t.TextEdit=t.Command=t.Diagnostic=t.CodeDescription=t.DiagnosticTag=t.DiagnosticSeverity=t.DiagnosticRelatedInformation=t.FoldingRange=t.FoldingRangeKind=t.ColorPresentation=t.ColorInformation=t.Color=t.LocationLink=t.Location=t.Range=t.Position=t.uinteger=t.integer=t.URI=t.DocumentUri=void 0;var n;(function(c){function g(m){return typeof m=="string"}c.is=g})(n||(t.DocumentUri=n={}));var r;(function(c){function g(m){return typeof m=="string"}c.is=g})(r||(t.URI=r={}));var i;(function(c){c.MIN_VALUE=-2147483648,c.MAX_VALUE=2147483647;function g(m){return typeof m=="number"&&c.MIN_VALUE<=m&&m<=c.MAX_VALUE}c.is=g})(i||(t.integer=i={}));var o;(function(c){c.MIN_VALUE=0,c.MAX_VALUE=2147483647;function g(m){return typeof m=="number"&&c.MIN_VALUE<=m&&m<=c.MAX_VALUE}c.is=g})(o||(t.uinteger=o={}));var s;(function(c){function g(l,a){return l===Number.MAX_VALUE&&(l=o.MAX_VALUE),a===Number.MAX_VALUE&&(a=o.MAX_VALUE),{line:l,character:a}}c.create=g;function m(l){var a=l;return R.objectLiteral(a)&&R.uinteger(a.line)&&R.uinteger(a.character)}c.is=m})(s||(t.Position=s={}));var u;(function(c){function g(l,a,b,S){if(R.uinteger(l)&&R.uinteger(a)&&R.uinteger(b)&&R.uinteger(S))return{start:s.create(l,a),end:s.create(b,S)};if(s.is(l)&&s.is(a))return{start:l,end:a};throw new Error("Range#create called with invalid arguments[".concat(l,", ").concat(a,", ").concat(b,", ").concat(S,"]"))}c.create=g;function m(l){var a=l;return R.objectLiteral(a)&&s.is(a.start)&&s.is(a.end)}c.is=m})(u||(t.Range=u={}));var d;(function(c){function g(l,a){return{uri:l,range:a}}c.create=g;function m(l){var a=l;return R.objectLiteral(a)&&u.is(a.range)&&(R.string(a.uri)||R.undefined(a.uri))}c.is=m})(d||(t.Location=d={}));var p;(function(c){function g(l,a,b,S){return{targetUri:l,targetRange:a,targetSelectionRange:b,originSelectionRange:S}}c.create=g;function m(l){var a=l;return R.objectLiteral(a)&&u.is(a.targetRange)&&R.string(a.targetUri)&&u.is(a.targetSelectionRange)&&(u.is(a.originSelectionRange)||R.undefined(a.originSelectionRange))}c.is=m})(p||(t.LocationLink=p={}));var _;(function(c){function g(l,a,b,S){return{red:l,green:a,blue:b,alpha:S}}c.create=g;function m(l){var a=l;return R.objectLiteral(a)&&R.numberRange(a.red,0,1)&&R.numberRange(a.green,0,1)&&R.numberRange(a.blue,0,1)&&R.numberRange(a.alpha,0,1)}c.is=m})(_||(t.Color=_={}));var w;(function(c){function g(l,a){return{range:l,color:a}}c.create=g;function m(l){var a=l;return R.objectLiteral(a)&&u.is(a.range)&&_.is(a.color)}c.is=m})(w||(t.ColorInformation=w={}));var T;(function(c){function g(l,a,b){return{label:l,textEdit:a,additionalTextEdits:b}}c.create=g;function m(l){var a=l;return R.objectLiteral(a)&&R.string(a.label)&&(R.undefined(a.textEdit)||J.is(a))&&(R.undefined(a.additionalTextEdits)||R.typedArray(a.additionalTextEdits,J.is))}c.is=m})(T||(t.ColorPresentation=T={}));var P;(function(c){c.Comment="comment",c.Imports="imports",c.Region="region"})(P||(t.FoldingRangeKind=P={}));var L;(function(c){function g(l,a,b,S,B,Pe){var de={startLine:l,endLine:a};return R.defined(b)&&(de.startCharacter=b),R.defined(S)&&(de.endCharacter=S),R.defined(B)&&(de.kind=B),R.defined(Pe)&&(de.collapsedText=Pe),de}c.create=g;function m(l){var a=l;return R.objectLiteral(a)&&R.uinteger(a.startLine)&&R.uinteger(a.startLine)&&(R.undefined(a.startCharacter)||R.uinteger(a.startCharacter))&&(R.undefined(a.endCharacter)||R.uinteger(a.endCharacter))&&(R.undefined(a.kind)||R.string(a.kind))}c.is=m})(L||(t.FoldingRange=L={}));var H;(function(c){function g(l,a){return{location:l,message:a}}c.create=g;function m(l){var a=l;return R.defined(a)&&d.is(a.location)&&R.string(a.message)}c.is=m})(H||(t.DiagnosticRelatedInformation=H={}));var se;(function(c){c.Error=1,c.Warning=2,c.Information=3,c.Hint=4})(se||(t.DiagnosticSeverity=se={}));var U;(function(c){c.Unnecessary=1,c.Deprecated=2})(U||(t.DiagnosticTag=U={}));var y;(function(c){function g(m){var l=m;return R.objectLiteral(l)&&R.string(l.href)}c.is=g})(y||(t.CodeDescription=y={}));var v;(function(c){function g(l,a,b,S,B,Pe){var de={range:l,message:a};return R.defined(b)&&(de.severity=b),R.defined(S)&&(de.code=S),R.defined(B)&&(de.source=B),R.defined(Pe)&&(de.relatedInformation=Pe),de}c.create=g;function m(l){var a,b=l;return R.defined(b)&&u.is(b.range)&&R.string(b.message)&&(R.number(b.severity)||R.undefined(b.severity))&&(R.integer(b.code)||R.string(b.code)||R.undefined(b.code))&&(R.undefined(b.codeDescription)||R.string((a=b.codeDescription)===null||a===void 0?void 0:a.href))&&(R.string(b.source)||R.undefined(b.source))&&(R.undefined(b.relatedInformation)||R.typedArray(b.relatedInformation,H.is))}c.is=m})(v||(t.Diagnostic=v={}));var q;(function(c){function g(l,a){for(var b=[],S=2;S<arguments.length;S++)b[S-2]=arguments[S];var B={title:l,command:a};return R.defined(b)&&b.length>0&&(B.arguments=b),B}c.create=g;function m(l){var a=l;return R.defined(a)&&R.string(a.title)&&R.string(a.command)}c.is=m})(q||(t.Command=q={}));var J;(function(c){function g(b,S){return{range:b,newText:S}}c.replace=g;function m(b,S){return{range:{start:b,end:b},newText:S}}c.insert=m;function l(b){return{range:b,newText:""}}c.del=l;function a(b){var S=b;return R.objectLiteral(S)&&R.string(S.newText)&&u.is(S.range)}c.is=a})(J||(t.TextEdit=J={}));var le;(function(c){function g(l,a,b){var S={label:l};return a!==void 0&&(S.needsConfirmation=a),b!==void 0&&(S.description=b),S}c.create=g;function m(l){var a=l;return R.objectLiteral(a)&&R.string(a.label)&&(R.boolean(a.needsConfirmation)||a.needsConfirmation===void 0)&&(R.string(a.description)||a.description===void 0)}c.is=m})(le||(t.ChangeAnnotation=le={}));var _e;(function(c){function g(m){var l=m;return R.string(l)}c.is=g})(_e||(t.ChangeAnnotationIdentifier=_e={}));var dt;(function(c){function g(b,S,B){return{range:b,newText:S,annotationId:B}}c.replace=g;function m(b,S,B){return{range:{start:b,end:b},newText:S,annotationId:B}}c.insert=m;function l(b,S){return{range:b,newText:"",annotationId:S}}c.del=l;function a(b){var S=b;return J.is(S)&&(le.is(S.annotationId)||_e.is(S.annotationId))}c.is=a})(dt||(t.AnnotatedTextEdit=dt={}));var on;(function(c){function g(l,a){return{textDocument:l,edits:a}}c.create=g;function m(l){var a=l;return R.defined(a)&&sn.is(a.textDocument)&&Array.isArray(a.edits)}c.is=m})(on||(t.TextDocumentEdit=on={}));var Wt;(function(c){function g(l,a,b){var S={kind:"create",uri:l};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(S.options=a),b!==void 0&&(S.annotationId=b),S}c.create=g;function m(l){var a=l;return a&&a.kind==="create"&&R.string(a.uri)&&(a.options===void 0||(a.options.overwrite===void 0||R.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||R.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||_e.is(a.annotationId))}c.is=m})(Wt||(t.CreateFile=Wt={}));var Ht;(function(c){function g(l,a,b,S){var B={kind:"rename",oldUri:l,newUri:a};return b!==void 0&&(b.overwrite!==void 0||b.ignoreIfExists!==void 0)&&(B.options=b),S!==void 0&&(B.annotationId=S),B}c.create=g;function m(l){var a=l;return a&&a.kind==="rename"&&R.string(a.oldUri)&&R.string(a.newUri)&&(a.options===void 0||(a.options.overwrite===void 0||R.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||R.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||_e.is(a.annotationId))}c.is=m})(Ht||(t.RenameFile=Ht={}));var Ue;(function(c){function g(l,a,b){var S={kind:"delete",uri:l};return a!==void 0&&(a.recursive!==void 0||a.ignoreIfNotExists!==void 0)&&(S.options=a),b!==void 0&&(S.annotationId=b),S}c.create=g;function m(l){var a=l;return a&&a.kind==="delete"&&R.string(a.uri)&&(a.options===void 0||(a.options.recursive===void 0||R.boolean(a.options.recursive))&&(a.options.ignoreIfNotExists===void 0||R.boolean(a.options.ignoreIfNotExists)))&&(a.annotationId===void 0||_e.is(a.annotationId))}c.is=m})(Ue||(t.DeleteFile=Ue={}));var _n;(function(c){function g(m){var l=m;return l&&(l.changes!==void 0||l.documentChanges!==void 0)&&(l.documentChanges===void 0||l.documentChanges.every(function(a){return R.string(a.kind)?Wt.is(a)||Ht.is(a)||Ue.is(a):on.is(a)}))}c.is=g})(_n||(t.WorkspaceEdit=_n={}));var wn=function(){function c(g,m){this.edits=g,this.changeAnnotations=m}return c.prototype.insert=function(g,m,l){var a,b;if(l===void 0?a=J.insert(g,m):_e.is(l)?(b=l,a=dt.insert(g,m,l)):(this.assertChangeAnnotations(this.changeAnnotations),b=this.changeAnnotations.manage(l),a=dt.insert(g,m,b)),this.edits.push(a),b!==void 0)return b},c.prototype.replace=function(g,m,l){var a,b;if(l===void 0?a=J.replace(g,m):_e.is(l)?(b=l,a=dt.replace(g,m,l)):(this.assertChangeAnnotations(this.changeAnnotations),b=this.changeAnnotations.manage(l),a=dt.replace(g,m,b)),this.edits.push(a),b!==void 0)return b},c.prototype.delete=function(g,m){var l,a;if(m===void 0?l=J.del(g):_e.is(m)?(a=m,l=dt.del(g,m)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(m),l=dt.del(g,a)),this.edits.push(l),a!==void 0)return a},c.prototype.add=function(g){this.edits.push(g)},c.prototype.all=function(){return this.edits},c.prototype.clear=function(){this.edits.splice(0,this.edits.length)},c.prototype.assertChangeAnnotations=function(g){if(g===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},c}(),zr=function(){function c(g){this._annotations=g===void 0?Object.create(null):g,this._counter=0,this._size=0}return c.prototype.all=function(){return this._annotations},Object.defineProperty(c.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),c.prototype.manage=function(g,m){var l;if(_e.is(g)?l=g:(l=this.nextId(),m=g),this._annotations[l]!==void 0)throw new Error("Id ".concat(l," is already in use."));if(m===void 0)throw new Error("No annotation provided for id ".concat(l));return this._annotations[l]=m,this._size++,l},c.prototype.nextId=function(){return this._counter++,this._counter.toString()},c}(),ss=function(){function c(g){var m=this;this._textEditChanges=Object.create(null),g!==void 0?(this._workspaceEdit=g,g.documentChanges?(this._changeAnnotations=new zr(g.changeAnnotations),g.changeAnnotations=this._changeAnnotations.all(),g.documentChanges.forEach(function(l){if(on.is(l)){var a=new wn(l.edits,m._changeAnnotations);m._textEditChanges[l.textDocument.uri]=a}})):g.changes&&Object.keys(g.changes).forEach(function(l){var a=new wn(g.changes[l]);m._textEditChanges[l]=a})):this._workspaceEdit={}}return Object.defineProperty(c.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}),c.prototype.getTextEditChange=function(g){if(sn.is(g)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m={uri:g.uri,version:g.version},l=this._textEditChanges[m.uri];if(!l){var a=[],b={textDocument:m,edits:a};this._workspaceEdit.documentChanges.push(b),l=new wn(a,this._changeAnnotations),this._textEditChanges[m.uri]=l}return l}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var l=this._textEditChanges[g];if(!l){var a=[];this._workspaceEdit.changes[g]=a,l=new wn(a),this._textEditChanges[g]=l}return l}},c.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new zr,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},c.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},c.prototype.createFile=function(g,m,l){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var a;le.is(m)||_e.is(m)?a=m:l=m;var b,S;if(a===void 0?b=Wt.create(g,l):(S=_e.is(a)?a:this._changeAnnotations.manage(a),b=Wt.create(g,l,S)),this._workspaceEdit.documentChanges.push(b),S!==void 0)return S},c.prototype.renameFile=function(g,m,l,a){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var b;le.is(l)||_e.is(l)?b=l:a=l;var S,B;if(b===void 0?S=Ht.create(g,m,a):(B=_e.is(b)?b:this._changeAnnotations.manage(b),S=Ht.create(g,m,a,B)),this._workspaceEdit.documentChanges.push(S),B!==void 0)return B},c.prototype.deleteFile=function(g,m,l){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var a;le.is(m)||_e.is(m)?a=m:l=m;var b,S;if(a===void 0?b=Ue.create(g,l):(S=_e.is(a)?a:this._changeAnnotations.manage(a),b=Ue.create(g,l,S)),this._workspaceEdit.documentChanges.push(b),S!==void 0)return S},c}();t.WorkspaceChange=ss;var Gr;(function(c){function g(l){return{uri:l}}c.create=g;function m(l){var a=l;return R.defined(a)&&R.string(a.uri)}c.is=m})(Gr||(t.TextDocumentIdentifier=Gr={}));var or;(function(c){function g(l,a){return{uri:l,version:a}}c.create=g;function m(l){var a=l;return R.defined(a)&&R.string(a.uri)&&R.integer(a.version)}c.is=m})(or||(t.VersionedTextDocumentIdentifier=or={}));var sn;(function(c){function g(l,a){return{uri:l,version:a}}c.create=g;function m(l){var a=l;return R.defined(a)&&R.string(a.uri)&&(a.version===null||R.integer(a.version))}c.is=m})(sn||(t.OptionalVersionedTextDocumentIdentifier=sn={}));var kt;(function(c){function g(l,a,b,S){return{uri:l,languageId:a,version:b,text:S}}c.create=g;function m(l){var a=l;return R.defined(a)&&R.string(a.uri)&&R.string(a.languageId)&&R.integer(a.version)&&R.string(a.text)}c.is=m})(kt||(t.TextDocumentItem=kt={}));var Pn;(function(c){c.PlainText="plaintext",c.Markdown="markdown";function g(m){var l=m;return l===c.PlainText||l===c.Markdown}c.is=g})(Pn||(t.MarkupKind=Pn={}));var an;(function(c){function g(m){var l=m;return R.objectLiteral(m)&&Pn.is(l.kind)&&R.string(l.value)}c.is=g})(an||(t.MarkupContent=an={}));var Xr;(function(c){c.Text=1,c.Method=2,c.Function=3,c.Constructor=4,c.Field=5,c.Variable=6,c.Class=7,c.Interface=8,c.Module=9,c.Property=10,c.Unit=11,c.Value=12,c.Enum=13,c.Keyword=14,c.Snippet=15,c.Color=16,c.File=17,c.Reference=18,c.Folder=19,c.EnumMember=20,c.Constant=21,c.Struct=22,c.Event=23,c.Operator=24,c.TypeParameter=25})(Xr||(t.CompletionItemKind=Xr={}));var sr;(function(c){c.PlainText=1,c.Snippet=2})(sr||(t.InsertTextFormat=sr={}));var ar;(function(c){c.Deprecated=1})(ar||(t.CompletionItemTag=ar={}));var Jr;(function(c){function g(l,a,b){return{newText:l,insert:a,replace:b}}c.create=g;function m(l){var a=l;return a&&R.string(a.newText)&&u.is(a.insert)&&u.is(a.replace)}c.is=m})(Jr||(t.InsertReplaceEdit=Jr={}));var Yr;(function(c){c.asIs=1,c.adjustIndentation=2})(Yr||(t.InsertTextMode=Yr={}));var Qr;(function(c){function g(m){var l=m;return l&&(R.string(l.detail)||l.detail===void 0)&&(R.string(l.description)||l.description===void 0)}c.is=g})(Qr||(t.CompletionItemLabelDetails=Qr={}));var Zr;(function(c){function g(m){return{label:m}}c.create=g})(Zr||(t.CompletionItem=Zr={}));var Kr;(function(c){function g(m,l){return{items:m||[],isIncomplete:!!l}}c.create=g})(Kr||(t.CompletionList=Kr={}));var Cn;(function(c){function g(l){return l.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}c.fromPlainText=g;function m(l){var a=l;return R.string(a)||R.objectLiteral(a)&&R.string(a.language)&&R.string(a.value)}c.is=m})(Cn||(t.MarkedString=Cn={}));var ft;(function(c){function g(m){var l=m;return!!l&&R.objectLiteral(l)&&(an.is(l.contents)||Cn.is(l.contents)||R.typedArray(l.contents,Cn.is))&&(m.range===void 0||u.is(m.range))}c.is=g})(ft||(t.Hover=ft={}));var ei;(function(c){function g(m,l){return l?{label:m,documentation:l}:{label:m}}c.create=g})(ei||(t.ParameterInformation=ei={}));var ti;(function(c){function g(m,l){for(var a=[],b=2;b<arguments.length;b++)a[b-2]=arguments[b];var S={label:m};return R.defined(l)&&(S.documentation=l),R.defined(a)?S.parameters=a:S.parameters=[],S}c.create=g})(ti||(t.SignatureInformation=ti={}));var cn;(function(c){c.Text=1,c.Read=2,c.Write=3})(cn||(t.DocumentHighlightKind=cn={}));var ni;(function(c){function g(m,l){var a={range:m};return R.number(l)&&(a.kind=l),a}c.create=g})(ni||(t.DocumentHighlight=ni={}));var En;(function(c){c.File=1,c.Module=2,c.Namespace=3,c.Package=4,c.Class=5,c.Method=6,c.Property=7,c.Field=8,c.Constructor=9,c.Enum=10,c.Interface=11,c.Function=12,c.Variable=13,c.Constant=14,c.String=15,c.Number=16,c.Boolean=17,c.Array=18,c.Object=19,c.Key=20,c.Null=21,c.EnumMember=22,c.Struct=23,c.Event=24,c.Operator=25,c.TypeParameter=26})(En||(t.SymbolKind=En={}));var ri;(function(c){c.Deprecated=1})(ri||(t.SymbolTag=ri={}));var qt;(function(c){function g(m,l,a,b,S){var B={name:m,kind:l,location:{uri:b,range:a}};return S&&(B.containerName=S),B}c.create=g})(qt||(t.SymbolInformation=qt={}));var Ut;(function(c){function g(m,l,a,b){return b!==void 0?{name:m,kind:l,location:{uri:a,range:b}}:{name:m,kind:l,location:{uri:a}}}c.create=g})(Ut||(t.WorkspaceSymbol=Ut={}));var ii;(function(c){function g(l,a,b,S,B,Pe){var de={name:l,detail:a,kind:b,range:S,selectionRange:B};return Pe!==void 0&&(de.children=Pe),de}c.create=g;function m(l){var a=l;return a&&R.string(a.name)&&R.number(a.kind)&&u.is(a.range)&&u.is(a.selectionRange)&&(a.detail===void 0||R.string(a.detail))&&(a.deprecated===void 0||R.boolean(a.deprecated))&&(a.children===void 0||Array.isArray(a.children))&&(a.tags===void 0||Array.isArray(a.tags))}c.is=m})(ii||(t.DocumentSymbol=ii={}));var oi;(function(c){c.Empty="",c.QuickFix="quickfix",c.Refactor="refactor",c.RefactorExtract="refactor.extract",c.RefactorInline="refactor.inline",c.RefactorRewrite="refactor.rewrite",c.Source="source",c.SourceOrganizeImports="source.organizeImports",c.SourceFixAll="source.fixAll"})(oi||(t.CodeActionKind=oi={}));var _t;(function(c){c.Invoked=1,c.Automatic=2})(_t||(t.CodeActionTriggerKind=_t={}));var cr;(function(c){function g(l,a,b){var S={diagnostics:l};return a!=null&&(S.only=a),b!=null&&(S.triggerKind=b),S}c.create=g;function m(l){var a=l;return R.defined(a)&&R.typedArray(a.diagnostics,v.is)&&(a.only===void 0||R.typedArray(a.only,R.string))&&(a.triggerKind===void 0||a.triggerKind===_t.Invoked||a.triggerKind===_t.Automatic)}c.is=m})(cr||(t.CodeActionContext=cr={}));var ur;(function(c){function g(l,a,b){var S={title:l},B=!0;return typeof a=="string"?(B=!1,S.kind=a):q.is(a)?S.command=a:S.edit=a,B&&b!==void 0&&(S.kind=b),S}c.create=g;function m(l){var a=l;return a&&R.string(a.title)&&(a.diagnostics===void 0||R.typedArray(a.diagnostics,v.is))&&(a.kind===void 0||R.string(a.kind))&&(a.edit!==void 0||a.command!==void 0)&&(a.command===void 0||q.is(a.command))&&(a.isPreferred===void 0||R.boolean(a.isPreferred))&&(a.edit===void 0||_n.is(a.edit))}c.is=m})(ur||(t.CodeAction=ur={}));var xn;(function(c){function g(l,a){var b={range:l};return R.defined(a)&&(b.data=a),b}c.create=g;function m(l){var a=l;return R.defined(a)&&u.is(a.range)&&(R.undefined(a.command)||q.is(a.command))}c.is=m})(xn||(t.CodeLens=xn={}));var lr;(function(c){function g(l,a){return{tabSize:l,insertSpaces:a}}c.create=g;function m(l){var a=l;return R.defined(a)&&R.uinteger(a.tabSize)&&R.boolean(a.insertSpaces)}c.is=m})(lr||(t.FormattingOptions=lr={}));var jt;(function(c){function g(l,a,b){return{range:l,target:a,data:b}}c.create=g;function m(l){var a=l;return R.defined(a)&&u.is(a.range)&&(R.undefined(a.target)||R.string(a.target))}c.is=m})(jt||(t.DocumentLink=jt={}));var h;(function(c){function g(l,a){return{range:l,parent:a}}c.create=g;function m(l){var a=l;return R.objectLiteral(a)&&u.is(a.range)&&(a.parent===void 0||c.is(a.parent))}c.is=m})(h||(t.SelectionRange=h={}));var E;(function(c){c.namespace="namespace",c.type="type",c.class="class",c.enum="enum",c.interface="interface",c.struct="struct",c.typeParameter="typeParameter",c.parameter="parameter",c.variable="variable",c.property="property",c.enumMember="enumMember",c.event="event",c.function="function",c.method="method",c.macro="macro",c.keyword="keyword",c.modifier="modifier",c.comment="comment",c.string="string",c.number="number",c.regexp="regexp",c.operator="operator",c.decorator="decorator"})(E||(t.SemanticTokenTypes=E={}));var j;(function(c){c.declaration="declaration",c.definition="definition",c.readonly="readonly",c.static="static",c.deprecated="deprecated",c.abstract="abstract",c.async="async",c.modification="modification",c.documentation="documentation",c.defaultLibrary="defaultLibrary"})(j||(t.SemanticTokenModifiers=j={}));var F;(function(c){function g(m){var l=m;return R.objectLiteral(l)&&(l.resultId===void 0||typeof l.resultId=="string")&&Array.isArray(l.data)&&(l.data.length===0||typeof l.data[0]=="number")}c.is=g})(F||(t.SemanticTokens=F={}));var ae;(function(c){function g(l,a){return{range:l,text:a}}c.create=g;function m(l){var a=l;return a!=null&&u.is(a.range)&&R.string(a.text)}c.is=m})(ae||(t.InlineValueText=ae={}));var ie;(function(c){function g(l,a,b){return{range:l,variableName:a,caseSensitiveLookup:b}}c.create=g;function m(l){var a=l;return a!=null&&u.is(a.range)&&R.boolean(a.caseSensitiveLookup)&&(R.string(a.variableName)||a.variableName===void 0)}c.is=m})(ie||(t.InlineValueVariableLookup=ie={}));var he;(function(c){function g(l,a){return{range:l,expression:a}}c.create=g;function m(l){var a=l;return a!=null&&u.is(a.range)&&(R.string(a.expression)||a.expression===void 0)}c.is=m})(he||(t.InlineValueEvaluatableExpression=he={}));var ve;(function(c){function g(l,a){return{frameId:l,stoppedLocation:a}}c.create=g;function m(l){var a=l;return R.defined(a)&&u.is(l.stoppedLocation)}c.is=m})(ve||(t.InlineValueContext=ve={}));var Y;(function(c){c.Type=1,c.Parameter=2;function g(m){return m===1||m===2}c.is=g})(Y||(t.InlayHintKind=Y={}));var ce;(function(c){function g(l){return{value:l}}c.create=g;function m(l){var a=l;return R.objectLiteral(a)&&(a.tooltip===void 0||R.string(a.tooltip)||an.is(a.tooltip))&&(a.location===void 0||d.is(a.location))&&(a.command===void 0||q.is(a.command))}c.is=m})(ce||(t.InlayHintLabelPart=ce={}));var ee;(function(c){function g(l,a,b){var S={position:l,label:a};return b!==void 0&&(S.kind=b),S}c.create=g;function m(l){var a=l;return R.objectLiteral(a)&&s.is(a.position)&&(R.string(a.label)||R.typedArray(a.label,ce.is))&&(a.kind===void 0||Y.is(a.kind))&&a.textEdits===void 0||R.typedArray(a.textEdits,J.is)&&(a.tooltip===void 0||R.string(a.tooltip)||an.is(a.tooltip))&&(a.paddingLeft===void 0||R.boolean(a.paddingLeft))&&(a.paddingRight===void 0||R.boolean(a.paddingRight))}c.is=m})(ee||(t.InlayHint=ee={}));var we;(function(c){function g(m){return{kind:"snippet",value:m}}c.createSnippet=g})(we||(t.StringValue=we={}));var je;(function(c){function g(m,l,a,b){return{insertText:m,filterText:l,range:a,command:b}}c.create=g})(je||(t.InlineCompletionItem=je={}));var Qe;(function(c){function g(m){return{items:m}}c.create=g})(Qe||(t.InlineCompletionList=Qe={}));var si;(function(c){c.Invoked=0,c.Automatic=1})(si||(t.InlineCompletionTriggerKind=si={}));var uu;(function(c){function g(m,l){return{range:m,text:l}}c.create=g})(uu||(t.SelectedCompletionInfo=uu={}));var lu;(function(c){function g(m,l){return{triggerKind:m,selectedCompletionInfo:l}}c.create=g})(lu||(t.InlineCompletionContext=lu={}));var du;(function(c){function g(m){var l=m;return R.objectLiteral(l)&&r.is(l.uri)&&R.string(l.name)}c.is=g})(du||(t.WorkspaceFolder=du={})),t.EOL=[`
|
|
32
|
+
`)),E){let F=h.error?` Request failed: ${h.error.message} (${h.error.code}).`:"";J.log(`Received response '${E.method} - (${h.id})' in ${Date.now()-E.timerStart}ms.${F}`,j)}else J.log(`Received response ${h.id} without active response promise.`,j)}else qt("receive-response",h)}function qt(h,E){if(!J||v===re.Off)return;let j={isLSPMessage:!0,type:h,message:E,timestamp:Date.now()};J.log(j)}function Ut(){if(sn())throw new An(gr.Closed,"Connection is closed.");if(kt())throw new An(gr.Disposed,"Connection is disposed.")}function ii(){if(or())throw new An(gr.AlreadyListening,"Connection is already listening")}function oi(){if(!or())throw new Error("Call listen() first.")}function _t(h){return h===void 0?null:h}function cr(h){if(h!==null)return h}function ur(h){return h!=null&&!Array.isArray(h)&&typeof h=="object"}function xn(h,E){switch(h){case $.ParameterStructures.auto:return ur(E)?cr(E):[_t(E)];case $.ParameterStructures.byName:if(!ur(E))throw new Error("Received parameters by name but param is not an object literal.");return cr(E);case $.ParameterStructures.byPosition:return[_t(E)];default:throw new Error(`Unknown parameter structure ${h.toString()}`)}}function lr(h,E){let j,F=h.numberOfParams;switch(F){case 0:j=void 0;break;case 1:j=xn(h.parameterStructures,E[0]);break;default:j=[];for(let ae=0;ae<E.length&&ae<F;ae++)j.push(_t(E[ae]));if(E.length<F)for(let ae=E.length;ae<F;ae++)j.push(null);break}return j}let jt={sendNotification:(h,...E)=>{Ut();let j,F;if(De.string(h)){j=h;let ie=E[0],he=0,ve=$.ParameterStructures.auto;$.ParameterStructures.is(ie)&&(he=1,ve=ie);let Y=E.length,ce=Y-he;switch(ce){case 0:F=void 0;break;case 1:F=xn(ve,E[he]);break;default:if(ve===$.ParameterStructures.byName)throw new Error(`Received ${ce} parameters for 'by Name' notification parameter structure.`);F=E.slice(he,Y).map(ee=>_t(ee));break}}else{let ie=E;j=h.method,F=lr(h,ie)}let ae={jsonrpc:d,method:j,params:F};return ti(ae),t.write(ae).catch(ie=>{throw i.error("Sending notification failed."),ie})},onNotification:(h,E)=>{Ut();let j;return De.func(h)?w=h:E&&(De.string(h)?(j=h,T.set(h,{type:void 0,handler:E})):(j=h.method,T.set(h.method,{type:h,handler:E}))),{dispose:()=>{j!==void 0?T.delete(j):w=void 0}}},onProgress:(h,E,j)=>{if(P.has(E))throw new Error(`Progress handler for token ${E} already registered`);return P.set(E,j),{dispose:()=>{P.delete(E)}}},sendProgress:(h,E,j)=>jt.sendNotification(hr.type,{token:E,value:j}),onUnhandledProgress:Wt.event,sendRequest:(h,...E)=>{Ut(),oi();let j,F,ae;if(De.string(h)){j=h;let Y=E[0],ce=E[E.length-1],ee=0,we=$.ParameterStructures.auto;$.ParameterStructures.is(Y)&&(ee=1,we=Y);let je=E.length;Ks.CancellationToken.is(ce)&&(je=je-1,ae=ce);let Qe=je-ee;switch(Qe){case 0:F=void 0;break;case 1:F=xn(we,E[ee]);break;default:if(we===$.ParameterStructures.byName)throw new Error(`Received ${Qe} parameters for 'by Name' request parameter structure.`);F=E.slice(ee,je).map(si=>_t(si));break}}else{let Y=E;j=h.method,F=lr(h,Y);let ce=h.numberOfParams;ae=Ks.CancellationToken.is(Y[ce])?Y[ce]:void 0}let ie=o++,he;ae&&(he=ae.onCancellationRequested(()=>{let Y=Ue.sender.sendCancellation(jt,ie);return Y===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${ie}`),Promise.resolve()):Y.catch(()=>{i.log(`Sending cancellation messages for id ${ie} failed`)})}));let ve={jsonrpc:d,id:ie,method:j,params:F};return ei(ve),typeof Ue.sender.enableCancellation=="function"&&Ue.sender.enableCancellation(ve),new Promise(async(Y,ce)=>{let ee=Qe=>{Y(Qe),Ue.sender.cleanup(ie),he?.dispose()},we=Qe=>{ce(Qe),Ue.sender.cleanup(ie),he?.dispose()},je={method:j,timerStart:Date.now(),resolve:ee,reject:we};try{await t.write(ve),se.set(ie,je)}catch(Qe){throw i.error("Sending request failed."),je.reject(new $.ResponseError($.ErrorCodes.MessageWriteError,Qe.message?Qe.message:"Unknown reason")),Qe}})},onRequest:(h,E)=>{Ut();let j=null;return na.is(h)?(j=void 0,p=h):De.string(h)?(j=null,E!==void 0&&(j=h,_.set(h,{handler:E,type:void 0}))):E!==void 0&&(j=h.method,_.set(h.method,{type:h,handler:E})),{dispose:()=>{j!==null&&(j!==void 0?_.delete(j):p=void 0)}}},hasPendingResponse:()=>se.size>0,trace:async(h,E,j)=>{let F=!1,ae=Ze.Text;j!==void 0&&(De.boolean(j)?F=j:(F=j.sendNotification||!1,ae=j.traceFormat||Ze.Text)),v=h,q=ae,v===re.Off?J=void 0:J=E,F&&!sn()&&!kt()&&await jt.sendNotification(ra.type,{value:re.toString(h)})},onError:_e.event,onClose:ft.event,onUnhandledNotification:on.event,onDispose:Ht.event,end:()=>{t.end()},dispose:()=>{if(kt())return;le=mt.Disposed,Ht.fire(void 0);let h=new $.ResponseError($.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let E of se.values())E.reject(h);se=new Map,y=new Map,U=new Set,H=new ju.LinkedMap,De.func(t.dispose)&&t.dispose(),De.func(e.dispose)&&e.dispose()},listen:()=>{Ut(),ii(),le=mt.Listening,e.listen(Yr)},inspect:()=>{(0,qu.default)().console.log("inspect")}};return jt.onNotification(vi.type,h=>{if(v===re.Off||!J)return;let E=v===re.Verbose||v===re.Compact;J.log(h.message,E?h.verbose:void 0)}),jt.onNotification(hr.type,h=>{let E=P.get(h.token);E?E(h.value):Wt.fire(h)}),jt}z.createMessageConnection=iv});var Pi=x(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.ProgressType=C.ProgressToken=C.createMessageConnection=C.NullLogger=C.ConnectionOptions=C.ConnectionStrategy=C.AbstractMessageBuffer=C.WriteableStreamMessageWriter=C.AbstractMessageWriter=C.MessageWriter=C.ReadableStreamMessageReader=C.AbstractMessageReader=C.MessageReader=C.SharedArrayReceiverStrategy=C.SharedArraySenderStrategy=C.CancellationToken=C.CancellationTokenSource=C.Emitter=C.Event=C.Disposable=C.LRUCache=C.Touch=C.LinkedMap=C.ParameterStructures=C.NotificationType9=C.NotificationType8=C.NotificationType7=C.NotificationType6=C.NotificationType5=C.NotificationType4=C.NotificationType3=C.NotificationType2=C.NotificationType1=C.NotificationType0=C.NotificationType=C.ErrorCodes=C.ResponseError=C.RequestType9=C.RequestType8=C.RequestType7=C.RequestType6=C.RequestType5=C.RequestType4=C.RequestType3=C.RequestType2=C.RequestType1=C.RequestType0=C.RequestType=C.Message=C.RAL=void 0;C.MessageStrategy=C.CancellationStrategy=C.CancellationSenderStrategy=C.CancellationReceiverStrategy=C.ConnectionError=C.ConnectionErrors=C.LogTraceNotification=C.SetTraceNotification=C.TraceFormat=C.TraceValues=C.Trace=void 0;var fe=qs();Object.defineProperty(C,"Message",{enumerable:!0,get:function(){return fe.Message}});Object.defineProperty(C,"RequestType",{enumerable:!0,get:function(){return fe.RequestType}});Object.defineProperty(C,"RequestType0",{enumerable:!0,get:function(){return fe.RequestType0}});Object.defineProperty(C,"RequestType1",{enumerable:!0,get:function(){return fe.RequestType1}});Object.defineProperty(C,"RequestType2",{enumerable:!0,get:function(){return fe.RequestType2}});Object.defineProperty(C,"RequestType3",{enumerable:!0,get:function(){return fe.RequestType3}});Object.defineProperty(C,"RequestType4",{enumerable:!0,get:function(){return fe.RequestType4}});Object.defineProperty(C,"RequestType5",{enumerable:!0,get:function(){return fe.RequestType5}});Object.defineProperty(C,"RequestType6",{enumerable:!0,get:function(){return fe.RequestType6}});Object.defineProperty(C,"RequestType7",{enumerable:!0,get:function(){return fe.RequestType7}});Object.defineProperty(C,"RequestType8",{enumerable:!0,get:function(){return fe.RequestType8}});Object.defineProperty(C,"RequestType9",{enumerable:!0,get:function(){return fe.RequestType9}});Object.defineProperty(C,"ResponseError",{enumerable:!0,get:function(){return fe.ResponseError}});Object.defineProperty(C,"ErrorCodes",{enumerable:!0,get:function(){return fe.ErrorCodes}});Object.defineProperty(C,"NotificationType",{enumerable:!0,get:function(){return fe.NotificationType}});Object.defineProperty(C,"NotificationType0",{enumerable:!0,get:function(){return fe.NotificationType0}});Object.defineProperty(C,"NotificationType1",{enumerable:!0,get:function(){return fe.NotificationType1}});Object.defineProperty(C,"NotificationType2",{enumerable:!0,get:function(){return fe.NotificationType2}});Object.defineProperty(C,"NotificationType3",{enumerable:!0,get:function(){return fe.NotificationType3}});Object.defineProperty(C,"NotificationType4",{enumerable:!0,get:function(){return fe.NotificationType4}});Object.defineProperty(C,"NotificationType5",{enumerable:!0,get:function(){return fe.NotificationType5}});Object.defineProperty(C,"NotificationType6",{enumerable:!0,get:function(){return fe.NotificationType6}});Object.defineProperty(C,"NotificationType7",{enumerable:!0,get:function(){return fe.NotificationType7}});Object.defineProperty(C,"NotificationType8",{enumerable:!0,get:function(){return fe.NotificationType8}});Object.defineProperty(C,"NotificationType9",{enumerable:!0,get:function(){return fe.NotificationType9}});Object.defineProperty(C,"ParameterStructures",{enumerable:!0,get:function(){return fe.ParameterStructures}});var sa=Ns();Object.defineProperty(C,"LinkedMap",{enumerable:!0,get:function(){return sa.LinkedMap}});Object.defineProperty(C,"LRUCache",{enumerable:!0,get:function(){return sa.LRUCache}});Object.defineProperty(C,"Touch",{enumerable:!0,get:function(){return sa.Touch}});var ov=Ru();Object.defineProperty(C,"Disposable",{enumerable:!0,get:function(){return ov.Disposable}});var Ou=qn();Object.defineProperty(C,"Event",{enumerable:!0,get:function(){return Ou.Event}});Object.defineProperty(C,"Emitter",{enumerable:!0,get:function(){return Ou.Emitter}});var Fu=pi();Object.defineProperty(C,"CancellationTokenSource",{enumerable:!0,get:function(){return Fu.CancellationTokenSource}});Object.defineProperty(C,"CancellationToken",{enumerable:!0,get:function(){return Fu.CancellationToken}});var Mu=_u();Object.defineProperty(C,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return Mu.SharedArraySenderStrategy}});Object.defineProperty(C,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return Mu.SharedArrayReceiverStrategy}});var aa=Pu();Object.defineProperty(C,"MessageReader",{enumerable:!0,get:function(){return aa.MessageReader}});Object.defineProperty(C,"AbstractMessageReader",{enumerable:!0,get:function(){return aa.AbstractMessageReader}});Object.defineProperty(C,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return aa.ReadableStreamMessageReader}});var ca=Tu();Object.defineProperty(C,"MessageWriter",{enumerable:!0,get:function(){return ca.MessageWriter}});Object.defineProperty(C,"AbstractMessageWriter",{enumerable:!0,get:function(){return ca.AbstractMessageWriter}});Object.defineProperty(C,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return ca.WriteableStreamMessageWriter}});var sv=ku();Object.defineProperty(C,"AbstractMessageBuffer",{enumerable:!0,get:function(){return sv.AbstractMessageBuffer}});var Ae=Au();Object.defineProperty(C,"ConnectionStrategy",{enumerable:!0,get:function(){return Ae.ConnectionStrategy}});Object.defineProperty(C,"ConnectionOptions",{enumerable:!0,get:function(){return Ae.ConnectionOptions}});Object.defineProperty(C,"NullLogger",{enumerable:!0,get:function(){return Ae.NullLogger}});Object.defineProperty(C,"createMessageConnection",{enumerable:!0,get:function(){return Ae.createMessageConnection}});Object.defineProperty(C,"ProgressToken",{enumerable:!0,get:function(){return Ae.ProgressToken}});Object.defineProperty(C,"ProgressType",{enumerable:!0,get:function(){return Ae.ProgressType}});Object.defineProperty(C,"Trace",{enumerable:!0,get:function(){return Ae.Trace}});Object.defineProperty(C,"TraceValues",{enumerable:!0,get:function(){return Ae.TraceValues}});Object.defineProperty(C,"TraceFormat",{enumerable:!0,get:function(){return Ae.TraceFormat}});Object.defineProperty(C,"SetTraceNotification",{enumerable:!0,get:function(){return Ae.SetTraceNotification}});Object.defineProperty(C,"LogTraceNotification",{enumerable:!0,get:function(){return Ae.LogTraceNotification}});Object.defineProperty(C,"ConnectionErrors",{enumerable:!0,get:function(){return Ae.ConnectionErrors}});Object.defineProperty(C,"ConnectionError",{enumerable:!0,get:function(){return Ae.ConnectionError}});Object.defineProperty(C,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Ae.CancellationReceiverStrategy}});Object.defineProperty(C,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Ae.CancellationSenderStrategy}});Object.defineProperty(C,"CancellationStrategy",{enumerable:!0,get:function(){return Ae.CancellationStrategy}});Object.defineProperty(C,"MessageStrategy",{enumerable:!0,get:function(){return Ae.MessageStrategy}});var av=Bt();C.RAL=av.default});var Wu=x(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});var Lu=require("util"),It=Pi(),Ci=class e extends It.AbstractMessageBuffer{constructor(t="utf-8"){super(t)}emptyBuffer(){return e.emptyBuffer}fromString(t,n){return Buffer.from(t,n)}toString(t,n){return t instanceof Buffer?t.toString(n):new Lu.TextDecoder(n).decode(t)}asNative(t,n){return n===void 0?t instanceof Buffer?t:Buffer.from(t):t instanceof Buffer?t.slice(0,n):Buffer.from(t,0,n)}allocNative(t){return Buffer.allocUnsafe(t)}};Ci.emptyBuffer=Buffer.allocUnsafe(0);var ua=class{constructor(t){this.stream=t}onClose(t){return this.stream.on("close",t),It.Disposable.create(()=>this.stream.off("close",t))}onError(t){return this.stream.on("error",t),It.Disposable.create(()=>this.stream.off("error",t))}onEnd(t){return this.stream.on("end",t),It.Disposable.create(()=>this.stream.off("end",t))}onData(t){return this.stream.on("data",t),It.Disposable.create(()=>this.stream.off("data",t))}},la=class{constructor(t){this.stream=t}onClose(t){return this.stream.on("close",t),It.Disposable.create(()=>this.stream.off("close",t))}onError(t){return this.stream.on("error",t),It.Disposable.create(()=>this.stream.off("error",t))}onEnd(t){return this.stream.on("end",t),It.Disposable.create(()=>this.stream.off("end",t))}write(t,n){return new Promise((r,i)=>{let o=s=>{s==null?r():i(s)};typeof t=="string"?this.stream.write(t,n,o):this.stream.write(t,o)})}end(){this.stream.end()}},$u=Object.freeze({messageBuffer:Object.freeze({create:e=>new Ci(e)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(e,t)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(e,void 0,0),t.charset))}catch(n){return Promise.reject(n)}}}),decoder:Object.freeze({name:"application/json",decode:(e,t)=>{try{return e instanceof Buffer?Promise.resolve(JSON.parse(e.toString(t.charset))):Promise.resolve(JSON.parse(new Lu.TextDecoder(t.charset).decode(e)))}catch(n){return Promise.reject(n)}}})}),stream:Object.freeze({asReadableStream:e=>new ua(e),asWritableStream:e=>new la(e)}),console,timer:Object.freeze({setTimeout(e,t,...n){let r=setTimeout(e,t,...n);return{dispose:()=>clearTimeout(r)}},setImmediate(e,...t){let n=setImmediate(e,...t);return{dispose:()=>clearImmediate(n)}},setInterval(e,t,...n){let r=setInterval(e,t,...n);return{dispose:()=>clearInterval(r)}}})});function da(){return $u}(function(e){function t(){It.RAL.install($u)}e.install=t})(da||(da={}));fa.default=da});var fn=x(Z=>{"use strict";var cv=Z&&Z.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),uv=Z&&Z.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&cv(t,e,n)};Object.defineProperty(Z,"__esModule",{value:!0});Z.createMessageConnection=Z.createServerSocketTransport=Z.createClientSocketTransport=Z.createServerPipeTransport=Z.createClientPipeTransport=Z.generateRandomPipeName=Z.StreamMessageWriter=Z.StreamMessageReader=Z.SocketMessageWriter=Z.SocketMessageReader=Z.PortMessageWriter=Z.PortMessageReader=Z.IPCMessageWriter=Z.IPCMessageReader=void 0;var On=Wu();On.default.install();var Hu=require("path"),lv=require("os"),dv=require("crypto"),Si=require("net"),Ke=Pi();uv(Pi(),Z);var pa=class extends Ke.AbstractMessageReader{constructor(t){super(),this.process=t;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose())}listen(t){return this.process.on("message",t),Ke.Disposable.create(()=>this.process.off("message",t))}};Z.IPCMessageReader=pa;var ha=class extends Ke.AbstractMessageWriter{constructor(t){super(),this.process=t,this.errorCount=0;let n=this.process;n.on("error",r=>this.fireError(r)),n.on("close",()=>this.fireClose)}write(t){try{return typeof this.process.send=="function"&&this.process.send(t,void 0,void 0,n=>{n?(this.errorCount++,this.handleError(n,t)):this.errorCount=0}),Promise.resolve()}catch(n){return this.handleError(n,t),Promise.reject(n)}}handleError(t,n){this.errorCount++,this.fireError(t,n,this.errorCount)}end(){}};Z.IPCMessageWriter=ha;var ga=class extends Ke.AbstractMessageReader{constructor(t){super(),this.onData=new Ke.Emitter,t.on("close",()=>this.fireClose),t.on("error",n=>this.fireError(n)),t.on("message",n=>{this.onData.fire(n)})}listen(t){return this.onData.event(t)}};Z.PortMessageReader=ga;var ma=class extends Ke.AbstractMessageWriter{constructor(t){super(),this.port=t,this.errorCount=0,t.on("close",()=>this.fireClose()),t.on("error",n=>this.fireError(n))}write(t){try{return this.port.postMessage(t),Promise.resolve()}catch(n){return this.handleError(n,t),Promise.reject(n)}}handleError(t,n){this.errorCount++,this.fireError(t,n,this.errorCount)}end(){}};Z.PortMessageWriter=ma;var ln=class extends Ke.ReadableStreamMessageReader{constructor(t,n="utf-8"){super((0,On.default)().stream.asReadableStream(t),n)}};Z.SocketMessageReader=ln;var dn=class extends Ke.WriteableStreamMessageWriter{constructor(t,n){super((0,On.default)().stream.asWritableStream(t),n),this.socket=t}dispose(){super.dispose(),this.socket.destroy()}};Z.SocketMessageWriter=dn;var Ei=class extends Ke.ReadableStreamMessageReader{constructor(t,n){super((0,On.default)().stream.asReadableStream(t),n)}};Z.StreamMessageReader=Ei;var xi=class extends Ke.WriteableStreamMessageWriter{constructor(t,n){super((0,On.default)().stream.asWritableStream(t),n)}};Z.StreamMessageWriter=xi;var Uu=process.env.XDG_RUNTIME_DIR,fv=new Map([["linux",107],["darwin",103]]);function pv(){let e=(0,dv.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${e}-sock`;let t;Uu?t=Hu.join(Uu,`vscode-ipc-${e}.sock`):t=Hu.join(lv.tmpdir(),`vscode-${e}.sock`);let n=fv.get(process.platform);return n!==void 0&&t.length>n&&(0,On.default)().console.warn(`WARNING: IPC handle "${t}" is longer than ${n} characters.`),t}Z.generateRandomPipeName=pv;function hv(e,t="utf-8"){let n,r=new Promise((i,o)=>{n=i});return new Promise((i,o)=>{let s=(0,Si.createServer)(u=>{s.close(),n([new ln(u,t),new dn(u,t)])});s.on("error",o),s.listen(e,()=>{s.removeListener("error",o),i({onConnected:()=>r})})})}Z.createClientPipeTransport=hv;function gv(e,t="utf-8"){let n=(0,Si.createConnection)(e);return[new ln(n,t),new dn(n,t)]}Z.createServerPipeTransport=gv;function mv(e,t="utf-8"){let n,r=new Promise((i,o)=>{n=i});return new Promise((i,o)=>{let s=(0,Si.createServer)(u=>{s.close(),n([new ln(u,t),new dn(u,t)])});s.on("error",o),s.listen(e,"127.0.0.1",()=>{s.removeListener("error",o),i({onConnected:()=>r})})})}Z.createClientSocketTransport=mv;function yv(e,t="utf-8"){let n=(0,Si.createConnection)(e,"127.0.0.1");return[new ln(n,t),new dn(n,t)]}Z.createServerSocketTransport=yv;function vv(e){let t=e;return t.read!==void 0&&t.addListener!==void 0}function bv(e){let t=e;return t.write!==void 0&&t.addListener!==void 0}function Rv(e,t,n,r){n||(n=Ke.NullLogger);let i=vv(e)?new Ei(e):e,o=bv(t)?new xi(t):t;return Ke.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,Ke.createMessageConnection)(i,o,n,r)}Z.createMessageConnection=Rv});var Ti=x((yP,Vu)=>{"use strict";Vu.exports=fn()});var qi=x((Bu,ki)=>{(function(e){if(typeof ki=="object"&&typeof ki.exports=="object"){var t=e(require,Bu);t!==void 0&&(ki.exports=t)}else typeof define=="function"&&define.amd&&define(["require","exports"],e)})(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextDocument=t.EOL=t.WorkspaceFolder=t.InlineCompletionContext=t.SelectedCompletionInfo=t.InlineCompletionTriggerKind=t.InlineCompletionList=t.InlineCompletionItem=t.StringValue=t.InlayHint=t.InlayHintLabelPart=t.InlayHintKind=t.InlineValueContext=t.InlineValueEvaluatableExpression=t.InlineValueVariableLookup=t.InlineValueText=t.SemanticTokens=t.SemanticTokenModifiers=t.SemanticTokenTypes=t.SelectionRange=t.DocumentLink=t.FormattingOptions=t.CodeLens=t.CodeAction=t.CodeActionContext=t.CodeActionTriggerKind=t.CodeActionKind=t.DocumentSymbol=t.WorkspaceSymbol=t.SymbolInformation=t.SymbolTag=t.SymbolKind=t.DocumentHighlight=t.DocumentHighlightKind=t.SignatureInformation=t.ParameterInformation=t.Hover=t.MarkedString=t.CompletionList=t.CompletionItem=t.CompletionItemLabelDetails=t.InsertTextMode=t.InsertReplaceEdit=t.CompletionItemTag=t.InsertTextFormat=t.CompletionItemKind=t.MarkupContent=t.MarkupKind=t.TextDocumentItem=t.OptionalVersionedTextDocumentIdentifier=t.VersionedTextDocumentIdentifier=t.TextDocumentIdentifier=t.WorkspaceChange=t.WorkspaceEdit=t.DeleteFile=t.RenameFile=t.CreateFile=t.TextDocumentEdit=t.AnnotatedTextEdit=t.ChangeAnnotationIdentifier=t.ChangeAnnotation=t.TextEdit=t.Command=t.Diagnostic=t.CodeDescription=t.DiagnosticTag=t.DiagnosticSeverity=t.DiagnosticRelatedInformation=t.FoldingRange=t.FoldingRangeKind=t.ColorPresentation=t.ColorInformation=t.Color=t.LocationLink=t.Location=t.Range=t.Position=t.uinteger=t.integer=t.URI=t.DocumentUri=void 0;var n;(function(c){function g(m){return typeof m=="string"}c.is=g})(n||(t.DocumentUri=n={}));var r;(function(c){function g(m){return typeof m=="string"}c.is=g})(r||(t.URI=r={}));var i;(function(c){c.MIN_VALUE=-2147483648,c.MAX_VALUE=2147483647;function g(m){return typeof m=="number"&&c.MIN_VALUE<=m&&m<=c.MAX_VALUE}c.is=g})(i||(t.integer=i={}));var o;(function(c){c.MIN_VALUE=0,c.MAX_VALUE=2147483647;function g(m){return typeof m=="number"&&c.MIN_VALUE<=m&&m<=c.MAX_VALUE}c.is=g})(o||(t.uinteger=o={}));var s;(function(c){function g(l,a){return l===Number.MAX_VALUE&&(l=o.MAX_VALUE),a===Number.MAX_VALUE&&(a=o.MAX_VALUE),{line:l,character:a}}c.create=g;function m(l){var a=l;return R.objectLiteral(a)&&R.uinteger(a.line)&&R.uinteger(a.character)}c.is=m})(s||(t.Position=s={}));var u;(function(c){function g(l,a,b,S){if(R.uinteger(l)&&R.uinteger(a)&&R.uinteger(b)&&R.uinteger(S))return{start:s.create(l,a),end:s.create(b,S)};if(s.is(l)&&s.is(a))return{start:l,end:a};throw new Error("Range#create called with invalid arguments[".concat(l,", ").concat(a,", ").concat(b,", ").concat(S,"]"))}c.create=g;function m(l){var a=l;return R.objectLiteral(a)&&s.is(a.start)&&s.is(a.end)}c.is=m})(u||(t.Range=u={}));var d;(function(c){function g(l,a){return{uri:l,range:a}}c.create=g;function m(l){var a=l;return R.objectLiteral(a)&&u.is(a.range)&&(R.string(a.uri)||R.undefined(a.uri))}c.is=m})(d||(t.Location=d={}));var p;(function(c){function g(l,a,b,S){return{targetUri:l,targetRange:a,targetSelectionRange:b,originSelectionRange:S}}c.create=g;function m(l){var a=l;return R.objectLiteral(a)&&u.is(a.targetRange)&&R.string(a.targetUri)&&u.is(a.targetSelectionRange)&&(u.is(a.originSelectionRange)||R.undefined(a.originSelectionRange))}c.is=m})(p||(t.LocationLink=p={}));var _;(function(c){function g(l,a,b,S){return{red:l,green:a,blue:b,alpha:S}}c.create=g;function m(l){var a=l;return R.objectLiteral(a)&&R.numberRange(a.red,0,1)&&R.numberRange(a.green,0,1)&&R.numberRange(a.blue,0,1)&&R.numberRange(a.alpha,0,1)}c.is=m})(_||(t.Color=_={}));var w;(function(c){function g(l,a){return{range:l,color:a}}c.create=g;function m(l){var a=l;return R.objectLiteral(a)&&u.is(a.range)&&_.is(a.color)}c.is=m})(w||(t.ColorInformation=w={}));var T;(function(c){function g(l,a,b){return{label:l,textEdit:a,additionalTextEdits:b}}c.create=g;function m(l){var a=l;return R.objectLiteral(a)&&R.string(a.label)&&(R.undefined(a.textEdit)||J.is(a))&&(R.undefined(a.additionalTextEdits)||R.typedArray(a.additionalTextEdits,J.is))}c.is=m})(T||(t.ColorPresentation=T={}));var P;(function(c){c.Comment="comment",c.Imports="imports",c.Region="region"})(P||(t.FoldingRangeKind=P={}));var L;(function(c){function g(l,a,b,S,B,Pe){var de={startLine:l,endLine:a};return R.defined(b)&&(de.startCharacter=b),R.defined(S)&&(de.endCharacter=S),R.defined(B)&&(de.kind=B),R.defined(Pe)&&(de.collapsedText=Pe),de}c.create=g;function m(l){var a=l;return R.objectLiteral(a)&&R.uinteger(a.startLine)&&R.uinteger(a.startLine)&&(R.undefined(a.startCharacter)||R.uinteger(a.startCharacter))&&(R.undefined(a.endCharacter)||R.uinteger(a.endCharacter))&&(R.undefined(a.kind)||R.string(a.kind))}c.is=m})(L||(t.FoldingRange=L={}));var H;(function(c){function g(l,a){return{location:l,message:a}}c.create=g;function m(l){var a=l;return R.defined(a)&&d.is(a.location)&&R.string(a.message)}c.is=m})(H||(t.DiagnosticRelatedInformation=H={}));var se;(function(c){c.Error=1,c.Warning=2,c.Information=3,c.Hint=4})(se||(t.DiagnosticSeverity=se={}));var U;(function(c){c.Unnecessary=1,c.Deprecated=2})(U||(t.DiagnosticTag=U={}));var y;(function(c){function g(m){var l=m;return R.objectLiteral(l)&&R.string(l.href)}c.is=g})(y||(t.CodeDescription=y={}));var v;(function(c){function g(l,a,b,S,B,Pe){var de={range:l,message:a};return R.defined(b)&&(de.severity=b),R.defined(S)&&(de.code=S),R.defined(B)&&(de.source=B),R.defined(Pe)&&(de.relatedInformation=Pe),de}c.create=g;function m(l){var a,b=l;return R.defined(b)&&u.is(b.range)&&R.string(b.message)&&(R.number(b.severity)||R.undefined(b.severity))&&(R.integer(b.code)||R.string(b.code)||R.undefined(b.code))&&(R.undefined(b.codeDescription)||R.string((a=b.codeDescription)===null||a===void 0?void 0:a.href))&&(R.string(b.source)||R.undefined(b.source))&&(R.undefined(b.relatedInformation)||R.typedArray(b.relatedInformation,H.is))}c.is=m})(v||(t.Diagnostic=v={}));var q;(function(c){function g(l,a){for(var b=[],S=2;S<arguments.length;S++)b[S-2]=arguments[S];var B={title:l,command:a};return R.defined(b)&&b.length>0&&(B.arguments=b),B}c.create=g;function m(l){var a=l;return R.defined(a)&&R.string(a.title)&&R.string(a.command)}c.is=m})(q||(t.Command=q={}));var J;(function(c){function g(b,S){return{range:b,newText:S}}c.replace=g;function m(b,S){return{range:{start:b,end:b},newText:S}}c.insert=m;function l(b){return{range:b,newText:""}}c.del=l;function a(b){var S=b;return R.objectLiteral(S)&&R.string(S.newText)&&u.is(S.range)}c.is=a})(J||(t.TextEdit=J={}));var le;(function(c){function g(l,a,b){var S={label:l};return a!==void 0&&(S.needsConfirmation=a),b!==void 0&&(S.description=b),S}c.create=g;function m(l){var a=l;return R.objectLiteral(a)&&R.string(a.label)&&(R.boolean(a.needsConfirmation)||a.needsConfirmation===void 0)&&(R.string(a.description)||a.description===void 0)}c.is=m})(le||(t.ChangeAnnotation=le={}));var _e;(function(c){function g(m){var l=m;return R.string(l)}c.is=g})(_e||(t.ChangeAnnotationIdentifier=_e={}));var ft;(function(c){function g(b,S,B){return{range:b,newText:S,annotationId:B}}c.replace=g;function m(b,S,B){return{range:{start:b,end:b},newText:S,annotationId:B}}c.insert=m;function l(b,S){return{range:b,newText:"",annotationId:S}}c.del=l;function a(b){var S=b;return J.is(S)&&(le.is(S.annotationId)||_e.is(S.annotationId))}c.is=a})(ft||(t.AnnotatedTextEdit=ft={}));var on;(function(c){function g(l,a){return{textDocument:l,edits:a}}c.create=g;function m(l){var a=l;return R.defined(a)&&sn.is(a.textDocument)&&Array.isArray(a.edits)}c.is=m})(on||(t.TextDocumentEdit=on={}));var Wt;(function(c){function g(l,a,b){var S={kind:"create",uri:l};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(S.options=a),b!==void 0&&(S.annotationId=b),S}c.create=g;function m(l){var a=l;return a&&a.kind==="create"&&R.string(a.uri)&&(a.options===void 0||(a.options.overwrite===void 0||R.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||R.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||_e.is(a.annotationId))}c.is=m})(Wt||(t.CreateFile=Wt={}));var Ht;(function(c){function g(l,a,b,S){var B={kind:"rename",oldUri:l,newUri:a};return b!==void 0&&(b.overwrite!==void 0||b.ignoreIfExists!==void 0)&&(B.options=b),S!==void 0&&(B.annotationId=S),B}c.create=g;function m(l){var a=l;return a&&a.kind==="rename"&&R.string(a.oldUri)&&R.string(a.newUri)&&(a.options===void 0||(a.options.overwrite===void 0||R.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||R.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||_e.is(a.annotationId))}c.is=m})(Ht||(t.RenameFile=Ht={}));var Ue;(function(c){function g(l,a,b){var S={kind:"delete",uri:l};return a!==void 0&&(a.recursive!==void 0||a.ignoreIfNotExists!==void 0)&&(S.options=a),b!==void 0&&(S.annotationId=b),S}c.create=g;function m(l){var a=l;return a&&a.kind==="delete"&&R.string(a.uri)&&(a.options===void 0||(a.options.recursive===void 0||R.boolean(a.options.recursive))&&(a.options.ignoreIfNotExists===void 0||R.boolean(a.options.ignoreIfNotExists)))&&(a.annotationId===void 0||_e.is(a.annotationId))}c.is=m})(Ue||(t.DeleteFile=Ue={}));var _n;(function(c){function g(m){var l=m;return l&&(l.changes!==void 0||l.documentChanges!==void 0)&&(l.documentChanges===void 0||l.documentChanges.every(function(a){return R.string(a.kind)?Wt.is(a)||Ht.is(a)||Ue.is(a):on.is(a)}))}c.is=g})(_n||(t.WorkspaceEdit=_n={}));var wn=function(){function c(g,m){this.edits=g,this.changeAnnotations=m}return c.prototype.insert=function(g,m,l){var a,b;if(l===void 0?a=J.insert(g,m):_e.is(l)?(b=l,a=ft.insert(g,m,l)):(this.assertChangeAnnotations(this.changeAnnotations),b=this.changeAnnotations.manage(l),a=ft.insert(g,m,b)),this.edits.push(a),b!==void 0)return b},c.prototype.replace=function(g,m,l){var a,b;if(l===void 0?a=J.replace(g,m):_e.is(l)?(b=l,a=ft.replace(g,m,l)):(this.assertChangeAnnotations(this.changeAnnotations),b=this.changeAnnotations.manage(l),a=ft.replace(g,m,b)),this.edits.push(a),b!==void 0)return b},c.prototype.delete=function(g,m){var l,a;if(m===void 0?l=J.del(g):_e.is(m)?(a=m,l=ft.del(g,m)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(m),l=ft.del(g,a)),this.edits.push(l),a!==void 0)return a},c.prototype.add=function(g){this.edits.push(g)},c.prototype.all=function(){return this.edits},c.prototype.clear=function(){this.edits.splice(0,this.edits.length)},c.prototype.assertChangeAnnotations=function(g){if(g===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},c}(),zr=function(){function c(g){this._annotations=g===void 0?Object.create(null):g,this._counter=0,this._size=0}return c.prototype.all=function(){return this._annotations},Object.defineProperty(c.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),c.prototype.manage=function(g,m){var l;if(_e.is(g)?l=g:(l=this.nextId(),m=g),this._annotations[l]!==void 0)throw new Error("Id ".concat(l," is already in use."));if(m===void 0)throw new Error("No annotation provided for id ".concat(l));return this._annotations[l]=m,this._size++,l},c.prototype.nextId=function(){return this._counter++,this._counter.toString()},c}(),ss=function(){function c(g){var m=this;this._textEditChanges=Object.create(null),g!==void 0?(this._workspaceEdit=g,g.documentChanges?(this._changeAnnotations=new zr(g.changeAnnotations),g.changeAnnotations=this._changeAnnotations.all(),g.documentChanges.forEach(function(l){if(on.is(l)){var a=new wn(l.edits,m._changeAnnotations);m._textEditChanges[l.textDocument.uri]=a}})):g.changes&&Object.keys(g.changes).forEach(function(l){var a=new wn(g.changes[l]);m._textEditChanges[l]=a})):this._workspaceEdit={}}return Object.defineProperty(c.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}),c.prototype.getTextEditChange=function(g){if(sn.is(g)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m={uri:g.uri,version:g.version},l=this._textEditChanges[m.uri];if(!l){var a=[],b={textDocument:m,edits:a};this._workspaceEdit.documentChanges.push(b),l=new wn(a,this._changeAnnotations),this._textEditChanges[m.uri]=l}return l}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var l=this._textEditChanges[g];if(!l){var a=[];this._workspaceEdit.changes[g]=a,l=new wn(a),this._textEditChanges[g]=l}return l}},c.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new zr,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},c.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},c.prototype.createFile=function(g,m,l){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var a;le.is(m)||_e.is(m)?a=m:l=m;var b,S;if(a===void 0?b=Wt.create(g,l):(S=_e.is(a)?a:this._changeAnnotations.manage(a),b=Wt.create(g,l,S)),this._workspaceEdit.documentChanges.push(b),S!==void 0)return S},c.prototype.renameFile=function(g,m,l,a){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var b;le.is(l)||_e.is(l)?b=l:a=l;var S,B;if(b===void 0?S=Ht.create(g,m,a):(B=_e.is(b)?b:this._changeAnnotations.manage(b),S=Ht.create(g,m,a,B)),this._workspaceEdit.documentChanges.push(S),B!==void 0)return B},c.prototype.deleteFile=function(g,m,l){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var a;le.is(m)||_e.is(m)?a=m:l=m;var b,S;if(a===void 0?b=Ue.create(g,l):(S=_e.is(a)?a:this._changeAnnotations.manage(a),b=Ue.create(g,l,S)),this._workspaceEdit.documentChanges.push(b),S!==void 0)return S},c}();t.WorkspaceChange=ss;var Gr;(function(c){function g(l){return{uri:l}}c.create=g;function m(l){var a=l;return R.defined(a)&&R.string(a.uri)}c.is=m})(Gr||(t.TextDocumentIdentifier=Gr={}));var or;(function(c){function g(l,a){return{uri:l,version:a}}c.create=g;function m(l){var a=l;return R.defined(a)&&R.string(a.uri)&&R.integer(a.version)}c.is=m})(or||(t.VersionedTextDocumentIdentifier=or={}));var sn;(function(c){function g(l,a){return{uri:l,version:a}}c.create=g;function m(l){var a=l;return R.defined(a)&&R.string(a.uri)&&(a.version===null||R.integer(a.version))}c.is=m})(sn||(t.OptionalVersionedTextDocumentIdentifier=sn={}));var kt;(function(c){function g(l,a,b,S){return{uri:l,languageId:a,version:b,text:S}}c.create=g;function m(l){var a=l;return R.defined(a)&&R.string(a.uri)&&R.string(a.languageId)&&R.integer(a.version)&&R.string(a.text)}c.is=m})(kt||(t.TextDocumentItem=kt={}));var Pn;(function(c){c.PlainText="plaintext",c.Markdown="markdown";function g(m){var l=m;return l===c.PlainText||l===c.Markdown}c.is=g})(Pn||(t.MarkupKind=Pn={}));var an;(function(c){function g(m){var l=m;return R.objectLiteral(m)&&Pn.is(l.kind)&&R.string(l.value)}c.is=g})(an||(t.MarkupContent=an={}));var Xr;(function(c){c.Text=1,c.Method=2,c.Function=3,c.Constructor=4,c.Field=5,c.Variable=6,c.Class=7,c.Interface=8,c.Module=9,c.Property=10,c.Unit=11,c.Value=12,c.Enum=13,c.Keyword=14,c.Snippet=15,c.Color=16,c.File=17,c.Reference=18,c.Folder=19,c.EnumMember=20,c.Constant=21,c.Struct=22,c.Event=23,c.Operator=24,c.TypeParameter=25})(Xr||(t.CompletionItemKind=Xr={}));var sr;(function(c){c.PlainText=1,c.Snippet=2})(sr||(t.InsertTextFormat=sr={}));var ar;(function(c){c.Deprecated=1})(ar||(t.CompletionItemTag=ar={}));var Jr;(function(c){function g(l,a,b){return{newText:l,insert:a,replace:b}}c.create=g;function m(l){var a=l;return a&&R.string(a.newText)&&u.is(a.insert)&&u.is(a.replace)}c.is=m})(Jr||(t.InsertReplaceEdit=Jr={}));var Yr;(function(c){c.asIs=1,c.adjustIndentation=2})(Yr||(t.InsertTextMode=Yr={}));var Qr;(function(c){function g(m){var l=m;return l&&(R.string(l.detail)||l.detail===void 0)&&(R.string(l.description)||l.description===void 0)}c.is=g})(Qr||(t.CompletionItemLabelDetails=Qr={}));var Zr;(function(c){function g(m){return{label:m}}c.create=g})(Zr||(t.CompletionItem=Zr={}));var Kr;(function(c){function g(m,l){return{items:m||[],isIncomplete:!!l}}c.create=g})(Kr||(t.CompletionList=Kr={}));var Cn;(function(c){function g(l){return l.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}c.fromPlainText=g;function m(l){var a=l;return R.string(a)||R.objectLiteral(a)&&R.string(a.language)&&R.string(a.value)}c.is=m})(Cn||(t.MarkedString=Cn={}));var pt;(function(c){function g(m){var l=m;return!!l&&R.objectLiteral(l)&&(an.is(l.contents)||Cn.is(l.contents)||R.typedArray(l.contents,Cn.is))&&(m.range===void 0||u.is(m.range))}c.is=g})(pt||(t.Hover=pt={}));var ei;(function(c){function g(m,l){return l?{label:m,documentation:l}:{label:m}}c.create=g})(ei||(t.ParameterInformation=ei={}));var ti;(function(c){function g(m,l){for(var a=[],b=2;b<arguments.length;b++)a[b-2]=arguments[b];var S={label:m};return R.defined(l)&&(S.documentation=l),R.defined(a)?S.parameters=a:S.parameters=[],S}c.create=g})(ti||(t.SignatureInformation=ti={}));var cn;(function(c){c.Text=1,c.Read=2,c.Write=3})(cn||(t.DocumentHighlightKind=cn={}));var ni;(function(c){function g(m,l){var a={range:m};return R.number(l)&&(a.kind=l),a}c.create=g})(ni||(t.DocumentHighlight=ni={}));var En;(function(c){c.File=1,c.Module=2,c.Namespace=3,c.Package=4,c.Class=5,c.Method=6,c.Property=7,c.Field=8,c.Constructor=9,c.Enum=10,c.Interface=11,c.Function=12,c.Variable=13,c.Constant=14,c.String=15,c.Number=16,c.Boolean=17,c.Array=18,c.Object=19,c.Key=20,c.Null=21,c.EnumMember=22,c.Struct=23,c.Event=24,c.Operator=25,c.TypeParameter=26})(En||(t.SymbolKind=En={}));var ri;(function(c){c.Deprecated=1})(ri||(t.SymbolTag=ri={}));var qt;(function(c){function g(m,l,a,b,S){var B={name:m,kind:l,location:{uri:b,range:a}};return S&&(B.containerName=S),B}c.create=g})(qt||(t.SymbolInformation=qt={}));var Ut;(function(c){function g(m,l,a,b){return b!==void 0?{name:m,kind:l,location:{uri:a,range:b}}:{name:m,kind:l,location:{uri:a}}}c.create=g})(Ut||(t.WorkspaceSymbol=Ut={}));var ii;(function(c){function g(l,a,b,S,B,Pe){var de={name:l,detail:a,kind:b,range:S,selectionRange:B};return Pe!==void 0&&(de.children=Pe),de}c.create=g;function m(l){var a=l;return a&&R.string(a.name)&&R.number(a.kind)&&u.is(a.range)&&u.is(a.selectionRange)&&(a.detail===void 0||R.string(a.detail))&&(a.deprecated===void 0||R.boolean(a.deprecated))&&(a.children===void 0||Array.isArray(a.children))&&(a.tags===void 0||Array.isArray(a.tags))}c.is=m})(ii||(t.DocumentSymbol=ii={}));var oi;(function(c){c.Empty="",c.QuickFix="quickfix",c.Refactor="refactor",c.RefactorExtract="refactor.extract",c.RefactorInline="refactor.inline",c.RefactorRewrite="refactor.rewrite",c.Source="source",c.SourceOrganizeImports="source.organizeImports",c.SourceFixAll="source.fixAll"})(oi||(t.CodeActionKind=oi={}));var _t;(function(c){c.Invoked=1,c.Automatic=2})(_t||(t.CodeActionTriggerKind=_t={}));var cr;(function(c){function g(l,a,b){var S={diagnostics:l};return a!=null&&(S.only=a),b!=null&&(S.triggerKind=b),S}c.create=g;function m(l){var a=l;return R.defined(a)&&R.typedArray(a.diagnostics,v.is)&&(a.only===void 0||R.typedArray(a.only,R.string))&&(a.triggerKind===void 0||a.triggerKind===_t.Invoked||a.triggerKind===_t.Automatic)}c.is=m})(cr||(t.CodeActionContext=cr={}));var ur;(function(c){function g(l,a,b){var S={title:l},B=!0;return typeof a=="string"?(B=!1,S.kind=a):q.is(a)?S.command=a:S.edit=a,B&&b!==void 0&&(S.kind=b),S}c.create=g;function m(l){var a=l;return a&&R.string(a.title)&&(a.diagnostics===void 0||R.typedArray(a.diagnostics,v.is))&&(a.kind===void 0||R.string(a.kind))&&(a.edit!==void 0||a.command!==void 0)&&(a.command===void 0||q.is(a.command))&&(a.isPreferred===void 0||R.boolean(a.isPreferred))&&(a.edit===void 0||_n.is(a.edit))}c.is=m})(ur||(t.CodeAction=ur={}));var xn;(function(c){function g(l,a){var b={range:l};return R.defined(a)&&(b.data=a),b}c.create=g;function m(l){var a=l;return R.defined(a)&&u.is(a.range)&&(R.undefined(a.command)||q.is(a.command))}c.is=m})(xn||(t.CodeLens=xn={}));var lr;(function(c){function g(l,a){return{tabSize:l,insertSpaces:a}}c.create=g;function m(l){var a=l;return R.defined(a)&&R.uinteger(a.tabSize)&&R.boolean(a.insertSpaces)}c.is=m})(lr||(t.FormattingOptions=lr={}));var jt;(function(c){function g(l,a,b){return{range:l,target:a,data:b}}c.create=g;function m(l){var a=l;return R.defined(a)&&u.is(a.range)&&(R.undefined(a.target)||R.string(a.target))}c.is=m})(jt||(t.DocumentLink=jt={}));var h;(function(c){function g(l,a){return{range:l,parent:a}}c.create=g;function m(l){var a=l;return R.objectLiteral(a)&&u.is(a.range)&&(a.parent===void 0||c.is(a.parent))}c.is=m})(h||(t.SelectionRange=h={}));var E;(function(c){c.namespace="namespace",c.type="type",c.class="class",c.enum="enum",c.interface="interface",c.struct="struct",c.typeParameter="typeParameter",c.parameter="parameter",c.variable="variable",c.property="property",c.enumMember="enumMember",c.event="event",c.function="function",c.method="method",c.macro="macro",c.keyword="keyword",c.modifier="modifier",c.comment="comment",c.string="string",c.number="number",c.regexp="regexp",c.operator="operator",c.decorator="decorator"})(E||(t.SemanticTokenTypes=E={}));var j;(function(c){c.declaration="declaration",c.definition="definition",c.readonly="readonly",c.static="static",c.deprecated="deprecated",c.abstract="abstract",c.async="async",c.modification="modification",c.documentation="documentation",c.defaultLibrary="defaultLibrary"})(j||(t.SemanticTokenModifiers=j={}));var F;(function(c){function g(m){var l=m;return R.objectLiteral(l)&&(l.resultId===void 0||typeof l.resultId=="string")&&Array.isArray(l.data)&&(l.data.length===0||typeof l.data[0]=="number")}c.is=g})(F||(t.SemanticTokens=F={}));var ae;(function(c){function g(l,a){return{range:l,text:a}}c.create=g;function m(l){var a=l;return a!=null&&u.is(a.range)&&R.string(a.text)}c.is=m})(ae||(t.InlineValueText=ae={}));var ie;(function(c){function g(l,a,b){return{range:l,variableName:a,caseSensitiveLookup:b}}c.create=g;function m(l){var a=l;return a!=null&&u.is(a.range)&&R.boolean(a.caseSensitiveLookup)&&(R.string(a.variableName)||a.variableName===void 0)}c.is=m})(ie||(t.InlineValueVariableLookup=ie={}));var he;(function(c){function g(l,a){return{range:l,expression:a}}c.create=g;function m(l){var a=l;return a!=null&&u.is(a.range)&&(R.string(a.expression)||a.expression===void 0)}c.is=m})(he||(t.InlineValueEvaluatableExpression=he={}));var ve;(function(c){function g(l,a){return{frameId:l,stoppedLocation:a}}c.create=g;function m(l){var a=l;return R.defined(a)&&u.is(l.stoppedLocation)}c.is=m})(ve||(t.InlineValueContext=ve={}));var Y;(function(c){c.Type=1,c.Parameter=2;function g(m){return m===1||m===2}c.is=g})(Y||(t.InlayHintKind=Y={}));var ce;(function(c){function g(l){return{value:l}}c.create=g;function m(l){var a=l;return R.objectLiteral(a)&&(a.tooltip===void 0||R.string(a.tooltip)||an.is(a.tooltip))&&(a.location===void 0||d.is(a.location))&&(a.command===void 0||q.is(a.command))}c.is=m})(ce||(t.InlayHintLabelPart=ce={}));var ee;(function(c){function g(l,a,b){var S={position:l,label:a};return b!==void 0&&(S.kind=b),S}c.create=g;function m(l){var a=l;return R.objectLiteral(a)&&s.is(a.position)&&(R.string(a.label)||R.typedArray(a.label,ce.is))&&(a.kind===void 0||Y.is(a.kind))&&a.textEdits===void 0||R.typedArray(a.textEdits,J.is)&&(a.tooltip===void 0||R.string(a.tooltip)||an.is(a.tooltip))&&(a.paddingLeft===void 0||R.boolean(a.paddingLeft))&&(a.paddingRight===void 0||R.boolean(a.paddingRight))}c.is=m})(ee||(t.InlayHint=ee={}));var we;(function(c){function g(m){return{kind:"snippet",value:m}}c.createSnippet=g})(we||(t.StringValue=we={}));var je;(function(c){function g(m,l,a,b){return{insertText:m,filterText:l,range:a,command:b}}c.create=g})(je||(t.InlineCompletionItem=je={}));var Qe;(function(c){function g(m){return{items:m}}c.create=g})(Qe||(t.InlineCompletionList=Qe={}));var si;(function(c){c.Invoked=0,c.Automatic=1})(si||(t.InlineCompletionTriggerKind=si={}));var uu;(function(c){function g(m,l){return{range:m,text:l}}c.create=g})(uu||(t.SelectedCompletionInfo=uu={}));var lu;(function(c){function g(m,l){return{triggerKind:m,selectedCompletionInfo:l}}c.create=g})(lu||(t.InlineCompletionContext=lu={}));var du;(function(c){function g(m){var l=m;return R.objectLiteral(l)&&r.is(l.uri)&&R.string(l.name)}c.is=g})(du||(t.WorkspaceFolder=du={})),t.EOL=[`
|
|
33
33
|
`,`\r
|
|
34
|
-
`,"\r"];var fu;(function(c){function g(b,S,B,Pe){return new
|
|
34
|
+
`,"\r"];var fu;(function(c){function g(b,S,B,Pe){return new Iy(b,S,B,Pe)}c.create=g;function m(b){var S=b;return!!(R.defined(S)&&R.string(S.uri)&&(R.undefined(S.languageId)||R.string(S.languageId))&&R.uinteger(S.lineCount)&&R.func(S.getText)&&R.func(S.positionAt)&&R.func(S.offsetAt))}c.is=m;function l(b,S){for(var B=b.getText(),Pe=a(S,function(Sn,ai){var pu=Sn.range.start.line-ai.range.start.line;return pu===0?Sn.range.start.character-ai.range.start.character:pu}),de=B.length,ht=Pe.length-1;ht>=0;ht--){var gt=Pe[ht],Nt=b.offsetAt(gt.range.start),Q=b.offsetAt(gt.range.end);if(Q<=de)B=B.substring(0,Nt)+gt.newText+B.substring(Q,B.length);else throw new Error("Overlapping edit");de=Nt}return B}c.applyEdits=l;function a(b,S){if(b.length<=1)return b;var B=b.length/2|0,Pe=b.slice(0,B),de=b.slice(B);a(Pe,S),a(de,S);for(var ht=0,gt=0,Nt=0;ht<Pe.length&><de.length;){var Q=S(Pe[ht],de[gt]);Q<=0?b[Nt++]=Pe[ht++]:b[Nt++]=de[gt++]}for(;ht<Pe.length;)b[Nt++]=Pe[ht++];for(;gt<de.length;)b[Nt++]=de[gt++];return b}})(fu||(t.TextDocument=fu={}));var Iy=function(){function c(g,m,l,a){this._uri=g,this._languageId=m,this._version=l,this._content=a,this._lineOffsets=void 0}return Object.defineProperty(c.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),c.prototype.getText=function(g){if(g){var m=this.offsetAt(g.start),l=this.offsetAt(g.end);return this._content.substring(m,l)}return this._content},c.prototype.update=function(g,m){this._content=g.text,this._version=m,this._lineOffsets=void 0},c.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var g=[],m=this._content,l=!0,a=0;a<m.length;a++){l&&(g.push(a),l=!1);var b=m.charAt(a);l=b==="\r"||b===`
|
|
35
35
|
`,b==="\r"&&a+1<m.length&&m.charAt(a+1)===`
|
|
36
|
-
`&&a++}l&&m.length>0&&g.push(m.length),this._lineOffsets=g}return this._lineOffsets},c.prototype.positionAt=function(g){g=Math.max(Math.min(g,this._content.length),0);var m=this.getLineOffsets(),l=0,a=m.length;if(a===0)return s.create(0,g);for(;l<a;){var b=Math.floor((l+a)/2);m[b]>g?a=b:l=b+1}var S=l-1;return s.create(S,g-m[S])},c.prototype.offsetAt=function(g){var m=this.getLineOffsets();if(g.line>=m.length)return this._content.length;if(g.line<0)return 0;var l=m[g.line],a=g.line+1<m.length?m[g.line+1]:this._content.length;return Math.max(Math.min(l+g.character,a),l)},Object.defineProperty(c.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),c}(),R;(function(c){var g=Object.prototype.toString;function m(Q){return typeof Q<"u"}c.defined=m;function l(Q){return typeof Q>"u"}c.undefined=l;function a(Q){return Q===!0||Q===!1}c.boolean=a;function b(Q){return g.call(Q)==="[object String]"}c.string=b;function S(Q){return g.call(Q)==="[object Number]"}c.number=S;function B(Q,Sn,ai){return g.call(Q)==="[object Number]"&&Sn<=Q&&Q<=ai}c.numberRange=B;function Pe(Q){return g.call(Q)==="[object Number]"&&-2147483648<=Q&&Q<=2147483647}c.integer=Pe;function de(Q){return g.call(Q)==="[object Number]"&&0<=Q&&Q<=2147483647}c.uinteger=de;function pt(Q){return g.call(Q)==="[object Function]"}c.func=pt;function ht(Q){return Q!==null&&typeof Q=="object"}c.objectLiteral=ht;function Nt(Q,Sn){return Array.isArray(Q)&&Q.every(Sn)}c.typedArray=Nt})(R||(R={}))})});var be=x(Be=>{"use strict";Object.defineProperty(Be,"__esModule",{value:!0});Be.ProtocolNotificationType=Be.ProtocolNotificationType0=Be.ProtocolRequestType=Be.ProtocolRequestType0=Be.RegistrationType=Be.MessageDirection=void 0;var Fn=fn(),zu;(function(e){e.clientToServer="clientToServer",e.serverToClient="serverToClient",e.both="both"})(zu||(Be.MessageDirection=zu={}));var ya=class{constructor(t){this.method=t}};Be.RegistrationType=ya;var va=class extends Fn.RequestType0{constructor(t){super(t)}};Be.ProtocolRequestType0=va;var ba=class extends Fn.RequestType{constructor(t){super(t,Fn.ParameterStructures.byName)}};Be.ProtocolRequestType=ba;var Ra=class extends Fn.NotificationType0{constructor(t){super(t)}};Be.ProtocolNotificationType0=Ra;var Da=class extends Fn.NotificationType{constructor(t){super(t,Fn.ParameterStructures.byName)}};Be.ProtocolNotificationType=Da});var ji=x(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.objectLiteral=Te.typedArray=Te.stringArray=Te.array=Te.func=Te.error=Te.number=Te.string=Te.boolean=void 0;function Rv(e){return e===!0||e===!1}Te.boolean=Rv;function Gu(e){return typeof e=="string"||e instanceof String}Te.string=Gu;function Dv(e){return typeof e=="number"||e instanceof Number}Te.number=Dv;function _v(e){return e instanceof Error}Te.error=_v;function wv(e){return typeof e=="function"}Te.func=wv;function Xu(e){return Array.isArray(e)}Te.array=Xu;function Pv(e){return Xu(e)&&e.every(t=>Gu(t))}Te.stringArray=Pv;function Cv(e,t){return Array.isArray(e)&&e.every(t)}Te.typedArray=Cv;function Ev(e){return e!==null&&typeof e=="object"}Te.objectLiteral=Ev});var Qu=x(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.ImplementationRequest=void 0;var Ju=be(),Yu;(function(e){e.method="textDocument/implementation",e.messageDirection=Ju.MessageDirection.clientToServer,e.type=new Ju.ProtocolRequestType(e.method)})(Yu||(Ni.ImplementationRequest=Yu={}))});var el=x(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.TypeDefinitionRequest=void 0;var Zu=be(),Ku;(function(e){e.method="textDocument/typeDefinition",e.messageDirection=Zu.MessageDirection.clientToServer,e.type=new Zu.ProtocolRequestType(e.method)})(Ku||(Ii.TypeDefinitionRequest=Ku={}))});var rl=x(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.DidChangeWorkspaceFoldersNotification=Mn.WorkspaceFoldersRequest=void 0;var Ai=be(),tl;(function(e){e.method="workspace/workspaceFolders",e.messageDirection=Ai.MessageDirection.serverToClient,e.type=new Ai.ProtocolRequestType0(e.method)})(tl||(Mn.WorkspaceFoldersRequest=tl={}));var nl;(function(e){e.method="workspace/didChangeWorkspaceFolders",e.messageDirection=Ai.MessageDirection.clientToServer,e.type=new Ai.ProtocolNotificationType(e.method)})(nl||(Mn.DidChangeWorkspaceFoldersNotification=nl={}))});var sl=x(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.ConfigurationRequest=void 0;var il=be(),ol;(function(e){e.method="workspace/configuration",e.messageDirection=il.MessageDirection.serverToClient,e.type=new il.ProtocolRequestType(e.method)})(ol||(Oi.ConfigurationRequest=ol={}))});var ul=x(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.ColorPresentationRequest=Ln.DocumentColorRequest=void 0;var Fi=be(),al;(function(e){e.method="textDocument/documentColor",e.messageDirection=Fi.MessageDirection.clientToServer,e.type=new Fi.ProtocolRequestType(e.method)})(al||(Ln.DocumentColorRequest=al={}));var cl;(function(e){e.method="textDocument/colorPresentation",e.messageDirection=Fi.MessageDirection.clientToServer,e.type=new Fi.ProtocolRequestType(e.method)})(cl||(Ln.ColorPresentationRequest=cl={}))});var fl=x($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.FoldingRangeRefreshRequest=$n.FoldingRangeRequest=void 0;var Mi=be(),ll;(function(e){e.method="textDocument/foldingRange",e.messageDirection=Mi.MessageDirection.clientToServer,e.type=new Mi.ProtocolRequestType(e.method)})(ll||($n.FoldingRangeRequest=ll={}));var dl;(function(e){e.method="workspace/foldingRange/refresh",e.messageDirection=Mi.MessageDirection.serverToClient,e.type=new Mi.ProtocolRequestType0(e.method)})(dl||($n.FoldingRangeRefreshRequest=dl={}))});var gl=x(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.DeclarationRequest=void 0;var pl=be(),hl;(function(e){e.method="textDocument/declaration",e.messageDirection=pl.MessageDirection.clientToServer,e.type=new pl.ProtocolRequestType(e.method)})(hl||(Li.DeclarationRequest=hl={}))});var vl=x($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});$i.SelectionRangeRequest=void 0;var ml=be(),yl;(function(e){e.method="textDocument/selectionRange",e.messageDirection=ml.MessageDirection.clientToServer,e.type=new ml.ProtocolRequestType(e.method)})(yl||($i.SelectionRangeRequest=yl={}))});var _l=x(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.WorkDoneProgressCancelNotification=Xt.WorkDoneProgressCreateRequest=Xt.WorkDoneProgress=void 0;var xv=fn(),Wi=be(),bl;(function(e){e.type=new xv.ProgressType;function t(n){return n===e.type}e.is=t})(bl||(Xt.WorkDoneProgress=bl={}));var Rl;(function(e){e.method="window/workDoneProgress/create",e.messageDirection=Wi.MessageDirection.serverToClient,e.type=new Wi.ProtocolRequestType(e.method)})(Rl||(Xt.WorkDoneProgressCreateRequest=Rl={}));var Dl;(function(e){e.method="window/workDoneProgress/cancel",e.messageDirection=Wi.MessageDirection.clientToServer,e.type=new Wi.ProtocolNotificationType(e.method)})(Dl||(Xt.WorkDoneProgressCancelNotification=Dl={}))});var El=x(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.CallHierarchyOutgoingCallsRequest=Jt.CallHierarchyIncomingCallsRequest=Jt.CallHierarchyPrepareRequest=void 0;var Wn=be(),wl;(function(e){e.method="textDocument/prepareCallHierarchy",e.messageDirection=Wn.MessageDirection.clientToServer,e.type=new Wn.ProtocolRequestType(e.method)})(wl||(Jt.CallHierarchyPrepareRequest=wl={}));var Pl;(function(e){e.method="callHierarchy/incomingCalls",e.messageDirection=Wn.MessageDirection.clientToServer,e.type=new Wn.ProtocolRequestType(e.method)})(Pl||(Jt.CallHierarchyIncomingCallsRequest=Pl={}));var Cl;(function(e){e.method="callHierarchy/outgoingCalls",e.messageDirection=Wn.MessageDirection.clientToServer,e.type=new Wn.ProtocolRequestType(e.method)})(Cl||(Jt.CallHierarchyOutgoingCallsRequest=Cl={}))});var jl=x(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.SemanticTokensRefreshRequest=ze.SemanticTokensRangeRequest=ze.SemanticTokensDeltaRequest=ze.SemanticTokensRequest=ze.SemanticTokensRegistrationType=ze.TokenFormat=void 0;var At=be(),xl;(function(e){e.Relative="relative"})(xl||(ze.TokenFormat=xl={}));var yr;(function(e){e.method="textDocument/semanticTokens",e.type=new At.RegistrationType(e.method)})(yr||(ze.SemanticTokensRegistrationType=yr={}));var Sl;(function(e){e.method="textDocument/semanticTokens/full",e.messageDirection=At.MessageDirection.clientToServer,e.type=new At.ProtocolRequestType(e.method),e.registrationMethod=yr.method})(Sl||(ze.SemanticTokensRequest=Sl={}));var Tl;(function(e){e.method="textDocument/semanticTokens/full/delta",e.messageDirection=At.MessageDirection.clientToServer,e.type=new At.ProtocolRequestType(e.method),e.registrationMethod=yr.method})(Tl||(ze.SemanticTokensDeltaRequest=Tl={}));var kl;(function(e){e.method="textDocument/semanticTokens/range",e.messageDirection=At.MessageDirection.clientToServer,e.type=new At.ProtocolRequestType(e.method),e.registrationMethod=yr.method})(kl||(ze.SemanticTokensRangeRequest=kl={}));var ql;(function(e){e.method="workspace/semanticTokens/refresh",e.messageDirection=At.MessageDirection.serverToClient,e.type=new At.ProtocolRequestType0(e.method)})(ql||(ze.SemanticTokensRefreshRequest=ql={}))});var Al=x(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.ShowDocumentRequest=void 0;var Nl=be(),Il;(function(e){e.method="window/showDocument",e.messageDirection=Nl.MessageDirection.serverToClient,e.type=new Nl.ProtocolRequestType(e.method)})(Il||(Hi.ShowDocumentRequest=Il={}))});var Ml=x(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.LinkedEditingRangeRequest=void 0;var Ol=be(),Fl;(function(e){e.method="textDocument/linkedEditingRange",e.messageDirection=Ol.MessageDirection.clientToServer,e.type=new Ol.ProtocolRequestType(e.method)})(Fl||(Ui.LinkedEditingRangeRequest=Fl={}))});var zl=x(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.WillDeleteFilesRequest=Me.DidDeleteFilesNotification=Me.DidRenameFilesNotification=Me.WillRenameFilesRequest=Me.DidCreateFilesNotification=Me.WillCreateFilesRequest=Me.FileOperationPatternKind=void 0;var nt=be(),Ll;(function(e){e.file="file",e.folder="folder"})(Ll||(Me.FileOperationPatternKind=Ll={}));var $l;(function(e){e.method="workspace/willCreateFiles",e.messageDirection=nt.MessageDirection.clientToServer,e.type=new nt.ProtocolRequestType(e.method)})($l||(Me.WillCreateFilesRequest=$l={}));var Wl;(function(e){e.method="workspace/didCreateFiles",e.messageDirection=nt.MessageDirection.clientToServer,e.type=new nt.ProtocolNotificationType(e.method)})(Wl||(Me.DidCreateFilesNotification=Wl={}));var Hl;(function(e){e.method="workspace/willRenameFiles",e.messageDirection=nt.MessageDirection.clientToServer,e.type=new nt.ProtocolRequestType(e.method)})(Hl||(Me.WillRenameFilesRequest=Hl={}));var Ul;(function(e){e.method="workspace/didRenameFiles",e.messageDirection=nt.MessageDirection.clientToServer,e.type=new nt.ProtocolNotificationType(e.method)})(Ul||(Me.DidRenameFilesNotification=Ul={}));var Vl;(function(e){e.method="workspace/didDeleteFiles",e.messageDirection=nt.MessageDirection.clientToServer,e.type=new nt.ProtocolNotificationType(e.method)})(Vl||(Me.DidDeleteFilesNotification=Vl={}));var Bl;(function(e){e.method="workspace/willDeleteFiles",e.messageDirection=nt.MessageDirection.clientToServer,e.type=new nt.ProtocolRequestType(e.method)})(Bl||(Me.WillDeleteFilesRequest=Bl={}))});var Ql=x(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.MonikerRequest=Yt.MonikerKind=Yt.UniquenessLevel=void 0;var Gl=be(),Xl;(function(e){e.document="document",e.project="project",e.group="group",e.scheme="scheme",e.global="global"})(Xl||(Yt.UniquenessLevel=Xl={}));var Jl;(function(e){e.$import="import",e.$export="export",e.local="local"})(Jl||(Yt.MonikerKind=Jl={}));var Yl;(function(e){e.method="textDocument/moniker",e.messageDirection=Gl.MessageDirection.clientToServer,e.type=new Gl.ProtocolRequestType(e.method)})(Yl||(Yt.MonikerRequest=Yl={}))});var td=x(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.TypeHierarchySubtypesRequest=Qt.TypeHierarchySupertypesRequest=Qt.TypeHierarchyPrepareRequest=void 0;var Hn=be(),Zl;(function(e){e.method="textDocument/prepareTypeHierarchy",e.messageDirection=Hn.MessageDirection.clientToServer,e.type=new Hn.ProtocolRequestType(e.method)})(Zl||(Qt.TypeHierarchyPrepareRequest=Zl={}));var Kl;(function(e){e.method="typeHierarchy/supertypes",e.messageDirection=Hn.MessageDirection.clientToServer,e.type=new Hn.ProtocolRequestType(e.method)})(Kl||(Qt.TypeHierarchySupertypesRequest=Kl={}));var ed;(function(e){e.method="typeHierarchy/subtypes",e.messageDirection=Hn.MessageDirection.clientToServer,e.type=new Hn.ProtocolRequestType(e.method)})(ed||(Qt.TypeHierarchySubtypesRequest=ed={}))});var id=x(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.InlineValueRefreshRequest=Un.InlineValueRequest=void 0;var Vi=be(),nd;(function(e){e.method="textDocument/inlineValue",e.messageDirection=Vi.MessageDirection.clientToServer,e.type=new Vi.ProtocolRequestType(e.method)})(nd||(Un.InlineValueRequest=nd={}));var rd;(function(e){e.method="workspace/inlineValue/refresh",e.messageDirection=Vi.MessageDirection.serverToClient,e.type=new Vi.ProtocolRequestType0(e.method)})(rd||(Un.InlineValueRefreshRequest=rd={}))});var cd=x(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.InlayHintRefreshRequest=Zt.InlayHintResolveRequest=Zt.InlayHintRequest=void 0;var Vn=be(),od;(function(e){e.method="textDocument/inlayHint",e.messageDirection=Vn.MessageDirection.clientToServer,e.type=new Vn.ProtocolRequestType(e.method)})(od||(Zt.InlayHintRequest=od={}));var sd;(function(e){e.method="inlayHint/resolve",e.messageDirection=Vn.MessageDirection.clientToServer,e.type=new Vn.ProtocolRequestType(e.method)})(sd||(Zt.InlayHintResolveRequest=sd={}));var ad;(function(e){e.method="workspace/inlayHint/refresh",e.messageDirection=Vn.MessageDirection.serverToClient,e.type=new Vn.ProtocolRequestType0(e.method)})(ad||(Zt.InlayHintRefreshRequest=ad={}))});var gd=x(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.DiagnosticRefreshRequest=rt.WorkspaceDiagnosticRequest=rt.DocumentDiagnosticRequest=rt.DocumentDiagnosticReportKind=rt.DiagnosticServerCancellationData=void 0;var hd=fn(),Sv=ji(),Bn=be(),ud;(function(e){function t(n){let r=n;return r&&Sv.boolean(r.retriggerRequest)}e.is=t})(ud||(rt.DiagnosticServerCancellationData=ud={}));var ld;(function(e){e.Full="full",e.Unchanged="unchanged"})(ld||(rt.DocumentDiagnosticReportKind=ld={}));var dd;(function(e){e.method="textDocument/diagnostic",e.messageDirection=Bn.MessageDirection.clientToServer,e.type=new Bn.ProtocolRequestType(e.method),e.partialResult=new hd.ProgressType})(dd||(rt.DocumentDiagnosticRequest=dd={}));var fd;(function(e){e.method="workspace/diagnostic",e.messageDirection=Bn.MessageDirection.clientToServer,e.type=new Bn.ProtocolRequestType(e.method),e.partialResult=new hd.ProgressType})(fd||(rt.WorkspaceDiagnosticRequest=fd={}));var pd;(function(e){e.method="workspace/diagnostic/refresh",e.messageDirection=Bn.MessageDirection.serverToClient,e.type=new Bn.ProtocolRequestType0(e.method)})(pd||(rt.DiagnosticRefreshRequest=pd={}))});var _d=x(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.DidCloseNotebookDocumentNotification=Ce.DidSaveNotebookDocumentNotification=Ce.DidChangeNotebookDocumentNotification=Ce.NotebookCellArrayChange=Ce.DidOpenNotebookDocumentNotification=Ce.NotebookDocumentSyncRegistrationType=Ce.NotebookDocument=Ce.NotebookCell=Ce.ExecutionSummary=Ce.NotebookCellKind=void 0;var vr=qi(),mt=ji(),wt=be(),_a;(function(e){e.Markup=1,e.Code=2;function t(n){return n===1||n===2}e.is=t})(_a||(Ce.NotebookCellKind=_a={}));var wa;(function(e){function t(i,o){let s={executionOrder:i};return(o===!0||o===!1)&&(s.success=o),s}e.create=t;function n(i){let o=i;return mt.objectLiteral(o)&&vr.uinteger.is(o.executionOrder)&&(o.success===void 0||mt.boolean(o.success))}e.is=n;function r(i,o){return i===o?!0:i==null||o===null||o===void 0?!1:i.executionOrder===o.executionOrder&&i.success===o.success}e.equals=r})(wa||(Ce.ExecutionSummary=wa={}));var Bi;(function(e){function t(o,s){return{kind:o,document:s}}e.create=t;function n(o){let s=o;return mt.objectLiteral(s)&&_a.is(s.kind)&&vr.DocumentUri.is(s.document)&&(s.metadata===void 0||mt.objectLiteral(s.metadata))}e.is=n;function r(o,s){let u=new Set;return o.document!==s.document&&u.add("document"),o.kind!==s.kind&&u.add("kind"),o.executionSummary!==s.executionSummary&&u.add("executionSummary"),(o.metadata!==void 0||s.metadata!==void 0)&&!i(o.metadata,s.metadata)&&u.add("metadata"),(o.executionSummary!==void 0||s.executionSummary!==void 0)&&!wa.equals(o.executionSummary,s.executionSummary)&&u.add("executionSummary"),u}e.diff=r;function i(o,s){if(o===s)return!0;if(o==null||s===null||s===void 0||typeof o!=typeof s||typeof o!="object")return!1;let u=Array.isArray(o),d=Array.isArray(s);if(u!==d)return!1;if(u&&d){if(o.length!==s.length)return!1;for(let p=0;p<o.length;p++)if(!i(o[p],s[p]))return!1}if(mt.objectLiteral(o)&&mt.objectLiteral(s)){let p=Object.keys(o),_=Object.keys(s);if(p.length!==_.length||(p.sort(),_.sort(),!i(p,_)))return!1;for(let w=0;w<p.length;w++){let T=p[w];if(!i(o[T],s[T]))return!1}}return!0}})(Bi||(Ce.NotebookCell=Bi={}));var md;(function(e){function t(r,i,o,s){return{uri:r,notebookType:i,version:o,cells:s}}e.create=t;function n(r){let i=r;return mt.objectLiteral(i)&&mt.string(i.uri)&&vr.integer.is(i.version)&&mt.typedArray(i.cells,Bi.is)}e.is=n})(md||(Ce.NotebookDocument=md={}));var zn;(function(e){e.method="notebookDocument/sync",e.messageDirection=wt.MessageDirection.clientToServer,e.type=new wt.RegistrationType(e.method)})(zn||(Ce.NotebookDocumentSyncRegistrationType=zn={}));var yd;(function(e){e.method="notebookDocument/didOpen",e.messageDirection=wt.MessageDirection.clientToServer,e.type=new wt.ProtocolNotificationType(e.method),e.registrationMethod=zn.method})(yd||(Ce.DidOpenNotebookDocumentNotification=yd={}));var vd;(function(e){function t(r){let i=r;return mt.objectLiteral(i)&&vr.uinteger.is(i.start)&&vr.uinteger.is(i.deleteCount)&&(i.cells===void 0||mt.typedArray(i.cells,Bi.is))}e.is=t;function n(r,i,o){let s={start:r,deleteCount:i};return o!==void 0&&(s.cells=o),s}e.create=n})(vd||(Ce.NotebookCellArrayChange=vd={}));var bd;(function(e){e.method="notebookDocument/didChange",e.messageDirection=wt.MessageDirection.clientToServer,e.type=new wt.ProtocolNotificationType(e.method),e.registrationMethod=zn.method})(bd||(Ce.DidChangeNotebookDocumentNotification=bd={}));var Rd;(function(e){e.method="notebookDocument/didSave",e.messageDirection=wt.MessageDirection.clientToServer,e.type=new wt.ProtocolNotificationType(e.method),e.registrationMethod=zn.method})(Rd||(Ce.DidSaveNotebookDocumentNotification=Rd={}));var Dd;(function(e){e.method="notebookDocument/didClose",e.messageDirection=wt.MessageDirection.clientToServer,e.type=new wt.ProtocolNotificationType(e.method),e.registrationMethod=zn.method})(Dd||(Ce.DidCloseNotebookDocumentNotification=Dd={}))});var Cd=x(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.InlineCompletionRequest=void 0;var wd=be(),Pd;(function(e){e.method="textDocument/inlineCompletion",e.messageDirection=wd.MessageDirection.clientToServer,e.type=new wd.ProtocolRequestType(e.method)})(Pd||(zi.InlineCompletionRequest=Pd={}))});var Lf=x(f=>{"use strict";Object.defineProperty(f,"__esModule",{value:!0});f.WorkspaceSymbolRequest=f.CodeActionResolveRequest=f.CodeActionRequest=f.DocumentSymbolRequest=f.DocumentHighlightRequest=f.ReferencesRequest=f.DefinitionRequest=f.SignatureHelpRequest=f.SignatureHelpTriggerKind=f.HoverRequest=f.CompletionResolveRequest=f.CompletionRequest=f.CompletionTriggerKind=f.PublishDiagnosticsNotification=f.WatchKind=f.RelativePattern=f.FileChangeType=f.DidChangeWatchedFilesNotification=f.WillSaveTextDocumentWaitUntilRequest=f.WillSaveTextDocumentNotification=f.TextDocumentSaveReason=f.DidSaveTextDocumentNotification=f.DidCloseTextDocumentNotification=f.DidChangeTextDocumentNotification=f.TextDocumentContentChangeEvent=f.DidOpenTextDocumentNotification=f.TextDocumentSyncKind=f.TelemetryEventNotification=f.LogMessageNotification=f.ShowMessageRequest=f.ShowMessageNotification=f.MessageType=f.DidChangeConfigurationNotification=f.ExitNotification=f.ShutdownRequest=f.InitializedNotification=f.InitializeErrorCodes=f.InitializeRequest=f.WorkDoneProgressOptions=f.TextDocumentRegistrationOptions=f.StaticRegistrationOptions=f.PositionEncodingKind=f.FailureHandlingKind=f.ResourceOperationKind=f.UnregistrationRequest=f.RegistrationRequest=f.DocumentSelector=f.NotebookCellTextDocumentFilter=f.NotebookDocumentFilter=f.TextDocumentFilter=void 0;f.MonikerRequest=f.MonikerKind=f.UniquenessLevel=f.WillDeleteFilesRequest=f.DidDeleteFilesNotification=f.WillRenameFilesRequest=f.DidRenameFilesNotification=f.WillCreateFilesRequest=f.DidCreateFilesNotification=f.FileOperationPatternKind=f.LinkedEditingRangeRequest=f.ShowDocumentRequest=f.SemanticTokensRegistrationType=f.SemanticTokensRefreshRequest=f.SemanticTokensRangeRequest=f.SemanticTokensDeltaRequest=f.SemanticTokensRequest=f.TokenFormat=f.CallHierarchyPrepareRequest=f.CallHierarchyOutgoingCallsRequest=f.CallHierarchyIncomingCallsRequest=f.WorkDoneProgressCancelNotification=f.WorkDoneProgressCreateRequest=f.WorkDoneProgress=f.SelectionRangeRequest=f.DeclarationRequest=f.FoldingRangeRefreshRequest=f.FoldingRangeRequest=f.ColorPresentationRequest=f.DocumentColorRequest=f.ConfigurationRequest=f.DidChangeWorkspaceFoldersNotification=f.WorkspaceFoldersRequest=f.TypeDefinitionRequest=f.ImplementationRequest=f.ApplyWorkspaceEditRequest=f.ExecuteCommandRequest=f.PrepareRenameRequest=f.RenameRequest=f.PrepareSupportDefaultBehavior=f.DocumentOnTypeFormattingRequest=f.DocumentRangesFormattingRequest=f.DocumentRangeFormattingRequest=f.DocumentFormattingRequest=f.DocumentLinkResolveRequest=f.DocumentLinkRequest=f.CodeLensRefreshRequest=f.CodeLensResolveRequest=f.CodeLensRequest=f.WorkspaceSymbolResolveRequest=void 0;f.InlineCompletionRequest=f.DidCloseNotebookDocumentNotification=f.DidSaveNotebookDocumentNotification=f.DidChangeNotebookDocumentNotification=f.NotebookCellArrayChange=f.DidOpenNotebookDocumentNotification=f.NotebookDocumentSyncRegistrationType=f.NotebookDocument=f.NotebookCell=f.ExecutionSummary=f.NotebookCellKind=f.DiagnosticRefreshRequest=f.WorkspaceDiagnosticRequest=f.DocumentDiagnosticRequest=f.DocumentDiagnosticReportKind=f.DiagnosticServerCancellationData=f.InlayHintRefreshRequest=f.InlayHintResolveRequest=f.InlayHintRequest=f.InlineValueRefreshRequest=f.InlineValueRequest=f.TypeHierarchySupertypesRequest=f.TypeHierarchySubtypesRequest=f.TypeHierarchyPrepareRequest=void 0;var k=be(),Ed=qi(),Ne=ji(),Tv=Qu();Object.defineProperty(f,"ImplementationRequest",{enumerable:!0,get:function(){return Tv.ImplementationRequest}});var kv=el();Object.defineProperty(f,"TypeDefinitionRequest",{enumerable:!0,get:function(){return kv.TypeDefinitionRequest}});var Af=rl();Object.defineProperty(f,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return Af.WorkspaceFoldersRequest}});Object.defineProperty(f,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return Af.DidChangeWorkspaceFoldersNotification}});var qv=sl();Object.defineProperty(f,"ConfigurationRequest",{enumerable:!0,get:function(){return qv.ConfigurationRequest}});var Of=ul();Object.defineProperty(f,"DocumentColorRequest",{enumerable:!0,get:function(){return Of.DocumentColorRequest}});Object.defineProperty(f,"ColorPresentationRequest",{enumerable:!0,get:function(){return Of.ColorPresentationRequest}});var Ff=fl();Object.defineProperty(f,"FoldingRangeRequest",{enumerable:!0,get:function(){return Ff.FoldingRangeRequest}});Object.defineProperty(f,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return Ff.FoldingRangeRefreshRequest}});var jv=gl();Object.defineProperty(f,"DeclarationRequest",{enumerable:!0,get:function(){return jv.DeclarationRequest}});var Nv=vl();Object.defineProperty(f,"SelectionRangeRequest",{enumerable:!0,get:function(){return Nv.SelectionRangeRequest}});var Sa=_l();Object.defineProperty(f,"WorkDoneProgress",{enumerable:!0,get:function(){return Sa.WorkDoneProgress}});Object.defineProperty(f,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return Sa.WorkDoneProgressCreateRequest}});Object.defineProperty(f,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return Sa.WorkDoneProgressCancelNotification}});var Ta=El();Object.defineProperty(f,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Ta.CallHierarchyIncomingCallsRequest}});Object.defineProperty(f,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Ta.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(f,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Ta.CallHierarchyPrepareRequest}});var Gn=jl();Object.defineProperty(f,"TokenFormat",{enumerable:!0,get:function(){return Gn.TokenFormat}});Object.defineProperty(f,"SemanticTokensRequest",{enumerable:!0,get:function(){return Gn.SemanticTokensRequest}});Object.defineProperty(f,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return Gn.SemanticTokensDeltaRequest}});Object.defineProperty(f,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return Gn.SemanticTokensRangeRequest}});Object.defineProperty(f,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return Gn.SemanticTokensRefreshRequest}});Object.defineProperty(f,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return Gn.SemanticTokensRegistrationType}});var Iv=Al();Object.defineProperty(f,"ShowDocumentRequest",{enumerable:!0,get:function(){return Iv.ShowDocumentRequest}});var Av=Ml();Object.defineProperty(f,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return Av.LinkedEditingRangeRequest}});var pn=zl();Object.defineProperty(f,"FileOperationPatternKind",{enumerable:!0,get:function(){return pn.FileOperationPatternKind}});Object.defineProperty(f,"DidCreateFilesNotification",{enumerable:!0,get:function(){return pn.DidCreateFilesNotification}});Object.defineProperty(f,"WillCreateFilesRequest",{enumerable:!0,get:function(){return pn.WillCreateFilesRequest}});Object.defineProperty(f,"DidRenameFilesNotification",{enumerable:!0,get:function(){return pn.DidRenameFilesNotification}});Object.defineProperty(f,"WillRenameFilesRequest",{enumerable:!0,get:function(){return pn.WillRenameFilesRequest}});Object.defineProperty(f,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return pn.DidDeleteFilesNotification}});Object.defineProperty(f,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return pn.WillDeleteFilesRequest}});var ka=Ql();Object.defineProperty(f,"UniquenessLevel",{enumerable:!0,get:function(){return ka.UniquenessLevel}});Object.defineProperty(f,"MonikerKind",{enumerable:!0,get:function(){return ka.MonikerKind}});Object.defineProperty(f,"MonikerRequest",{enumerable:!0,get:function(){return ka.MonikerRequest}});var qa=td();Object.defineProperty(f,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return qa.TypeHierarchyPrepareRequest}});Object.defineProperty(f,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return qa.TypeHierarchySubtypesRequest}});Object.defineProperty(f,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return qa.TypeHierarchySupertypesRequest}});var Mf=id();Object.defineProperty(f,"InlineValueRequest",{enumerable:!0,get:function(){return Mf.InlineValueRequest}});Object.defineProperty(f,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return Mf.InlineValueRefreshRequest}});var ja=cd();Object.defineProperty(f,"InlayHintRequest",{enumerable:!0,get:function(){return ja.InlayHintRequest}});Object.defineProperty(f,"InlayHintResolveRequest",{enumerable:!0,get:function(){return ja.InlayHintResolveRequest}});Object.defineProperty(f,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return ja.InlayHintRefreshRequest}});var br=gd();Object.defineProperty(f,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return br.DiagnosticServerCancellationData}});Object.defineProperty(f,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return br.DocumentDiagnosticReportKind}});Object.defineProperty(f,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return br.DocumentDiagnosticRequest}});Object.defineProperty(f,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return br.WorkspaceDiagnosticRequest}});Object.defineProperty(f,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return br.DiagnosticRefreshRequest}});var Pt=_d();Object.defineProperty(f,"NotebookCellKind",{enumerable:!0,get:function(){return Pt.NotebookCellKind}});Object.defineProperty(f,"ExecutionSummary",{enumerable:!0,get:function(){return Pt.ExecutionSummary}});Object.defineProperty(f,"NotebookCell",{enumerable:!0,get:function(){return Pt.NotebookCell}});Object.defineProperty(f,"NotebookDocument",{enumerable:!0,get:function(){return Pt.NotebookDocument}});Object.defineProperty(f,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return Pt.NotebookDocumentSyncRegistrationType}});Object.defineProperty(f,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return Pt.DidOpenNotebookDocumentNotification}});Object.defineProperty(f,"NotebookCellArrayChange",{enumerable:!0,get:function(){return Pt.NotebookCellArrayChange}});Object.defineProperty(f,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return Pt.DidChangeNotebookDocumentNotification}});Object.defineProperty(f,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return Pt.DidSaveNotebookDocumentNotification}});Object.defineProperty(f,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return Pt.DidCloseNotebookDocumentNotification}});var Ov=Cd();Object.defineProperty(f,"InlineCompletionRequest",{enumerable:!0,get:function(){return Ov.InlineCompletionRequest}});var Pa;(function(e){function t(n){let r=n;return Ne.string(r)||Ne.string(r.language)||Ne.string(r.scheme)||Ne.string(r.pattern)}e.is=t})(Pa||(f.TextDocumentFilter=Pa={}));var Ca;(function(e){function t(n){let r=n;return Ne.objectLiteral(r)&&(Ne.string(r.notebookType)||Ne.string(r.scheme)||Ne.string(r.pattern))}e.is=t})(Ca||(f.NotebookDocumentFilter=Ca={}));var Ea;(function(e){function t(n){let r=n;return Ne.objectLiteral(r)&&(Ne.string(r.notebook)||Ca.is(r.notebook))&&(r.language===void 0||Ne.string(r.language))}e.is=t})(Ea||(f.NotebookCellTextDocumentFilter=Ea={}));var xa;(function(e){function t(n){if(!Array.isArray(n))return!1;for(let r of n)if(!Ne.string(r)&&!Pa.is(r)&&!Ea.is(r))return!1;return!0}e.is=t})(xa||(f.DocumentSelector=xa={}));var xd;(function(e){e.method="client/registerCapability",e.messageDirection=k.MessageDirection.serverToClient,e.type=new k.ProtocolRequestType(e.method)})(xd||(f.RegistrationRequest=xd={}));var Sd;(function(e){e.method="client/unregisterCapability",e.messageDirection=k.MessageDirection.serverToClient,e.type=new k.ProtocolRequestType(e.method)})(Sd||(f.UnregistrationRequest=Sd={}));var Td;(function(e){e.Create="create",e.Rename="rename",e.Delete="delete"})(Td||(f.ResourceOperationKind=Td={}));var kd;(function(e){e.Abort="abort",e.Transactional="transactional",e.TextOnlyTransactional="textOnlyTransactional",e.Undo="undo"})(kd||(f.FailureHandlingKind=kd={}));var qd;(function(e){e.UTF8="utf-8",e.UTF16="utf-16",e.UTF32="utf-32"})(qd||(f.PositionEncodingKind=qd={}));var jd;(function(e){function t(n){let r=n;return r&&Ne.string(r.id)&&r.id.length>0}e.hasId=t})(jd||(f.StaticRegistrationOptions=jd={}));var Nd;(function(e){function t(n){let r=n;return r&&(r.documentSelector===null||xa.is(r.documentSelector))}e.is=t})(Nd||(f.TextDocumentRegistrationOptions=Nd={}));var Id;(function(e){function t(r){let i=r;return Ne.objectLiteral(i)&&(i.workDoneProgress===void 0||Ne.boolean(i.workDoneProgress))}e.is=t;function n(r){let i=r;return i&&Ne.boolean(i.workDoneProgress)}e.hasWorkDoneProgress=n})(Id||(f.WorkDoneProgressOptions=Id={}));var Ad;(function(e){e.method="initialize",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(Ad||(f.InitializeRequest=Ad={}));var Od;(function(e){e.unknownProtocolVersion=1})(Od||(f.InitializeErrorCodes=Od={}));var Fd;(function(e){e.method="initialized",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolNotificationType(e.method)})(Fd||(f.InitializedNotification=Fd={}));var Md;(function(e){e.method="shutdown",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType0(e.method)})(Md||(f.ShutdownRequest=Md={}));var Ld;(function(e){e.method="exit",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolNotificationType0(e.method)})(Ld||(f.ExitNotification=Ld={}));var $d;(function(e){e.method="workspace/didChangeConfiguration",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolNotificationType(e.method)})($d||(f.DidChangeConfigurationNotification=$d={}));var Wd;(function(e){e.Error=1,e.Warning=2,e.Info=3,e.Log=4,e.Debug=5})(Wd||(f.MessageType=Wd={}));var Hd;(function(e){e.method="window/showMessage",e.messageDirection=k.MessageDirection.serverToClient,e.type=new k.ProtocolNotificationType(e.method)})(Hd||(f.ShowMessageNotification=Hd={}));var Ud;(function(e){e.method="window/showMessageRequest",e.messageDirection=k.MessageDirection.serverToClient,e.type=new k.ProtocolRequestType(e.method)})(Ud||(f.ShowMessageRequest=Ud={}));var Vd;(function(e){e.method="window/logMessage",e.messageDirection=k.MessageDirection.serverToClient,e.type=new k.ProtocolNotificationType(e.method)})(Vd||(f.LogMessageNotification=Vd={}));var Bd;(function(e){e.method="telemetry/event",e.messageDirection=k.MessageDirection.serverToClient,e.type=new k.ProtocolNotificationType(e.method)})(Bd||(f.TelemetryEventNotification=Bd={}));var zd;(function(e){e.None=0,e.Full=1,e.Incremental=2})(zd||(f.TextDocumentSyncKind=zd={}));var Gd;(function(e){e.method="textDocument/didOpen",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolNotificationType(e.method)})(Gd||(f.DidOpenTextDocumentNotification=Gd={}));var Xd;(function(e){function t(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}e.isIncremental=t;function n(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}e.isFull=n})(Xd||(f.TextDocumentContentChangeEvent=Xd={}));var Jd;(function(e){e.method="textDocument/didChange",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolNotificationType(e.method)})(Jd||(f.DidChangeTextDocumentNotification=Jd={}));var Yd;(function(e){e.method="textDocument/didClose",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolNotificationType(e.method)})(Yd||(f.DidCloseTextDocumentNotification=Yd={}));var Qd;(function(e){e.method="textDocument/didSave",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolNotificationType(e.method)})(Qd||(f.DidSaveTextDocumentNotification=Qd={}));var Zd;(function(e){e.Manual=1,e.AfterDelay=2,e.FocusOut=3})(Zd||(f.TextDocumentSaveReason=Zd={}));var Kd;(function(e){e.method="textDocument/willSave",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolNotificationType(e.method)})(Kd||(f.WillSaveTextDocumentNotification=Kd={}));var ef;(function(e){e.method="textDocument/willSaveWaitUntil",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(ef||(f.WillSaveTextDocumentWaitUntilRequest=ef={}));var tf;(function(e){e.method="workspace/didChangeWatchedFiles",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolNotificationType(e.method)})(tf||(f.DidChangeWatchedFilesNotification=tf={}));var nf;(function(e){e.Created=1,e.Changed=2,e.Deleted=3})(nf||(f.FileChangeType=nf={}));var rf;(function(e){function t(n){let r=n;return Ne.objectLiteral(r)&&(Ed.URI.is(r.baseUri)||Ed.WorkspaceFolder.is(r.baseUri))&&Ne.string(r.pattern)}e.is=t})(rf||(f.RelativePattern=rf={}));var of;(function(e){e.Create=1,e.Change=2,e.Delete=4})(of||(f.WatchKind=of={}));var sf;(function(e){e.method="textDocument/publishDiagnostics",e.messageDirection=k.MessageDirection.serverToClient,e.type=new k.ProtocolNotificationType(e.method)})(sf||(f.PublishDiagnosticsNotification=sf={}));var af;(function(e){e.Invoked=1,e.TriggerCharacter=2,e.TriggerForIncompleteCompletions=3})(af||(f.CompletionTriggerKind=af={}));var cf;(function(e){e.method="textDocument/completion",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(cf||(f.CompletionRequest=cf={}));var uf;(function(e){e.method="completionItem/resolve",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(uf||(f.CompletionResolveRequest=uf={}));var lf;(function(e){e.method="textDocument/hover",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(lf||(f.HoverRequest=lf={}));var df;(function(e){e.Invoked=1,e.TriggerCharacter=2,e.ContentChange=3})(df||(f.SignatureHelpTriggerKind=df={}));var ff;(function(e){e.method="textDocument/signatureHelp",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(ff||(f.SignatureHelpRequest=ff={}));var pf;(function(e){e.method="textDocument/definition",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(pf||(f.DefinitionRequest=pf={}));var hf;(function(e){e.method="textDocument/references",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(hf||(f.ReferencesRequest=hf={}));var gf;(function(e){e.method="textDocument/documentHighlight",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(gf||(f.DocumentHighlightRequest=gf={}));var mf;(function(e){e.method="textDocument/documentSymbol",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(mf||(f.DocumentSymbolRequest=mf={}));var yf;(function(e){e.method="textDocument/codeAction",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(yf||(f.CodeActionRequest=yf={}));var vf;(function(e){e.method="codeAction/resolve",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(vf||(f.CodeActionResolveRequest=vf={}));var bf;(function(e){e.method="workspace/symbol",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(bf||(f.WorkspaceSymbolRequest=bf={}));var Rf;(function(e){e.method="workspaceSymbol/resolve",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(Rf||(f.WorkspaceSymbolResolveRequest=Rf={}));var Df;(function(e){e.method="textDocument/codeLens",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(Df||(f.CodeLensRequest=Df={}));var _f;(function(e){e.method="codeLens/resolve",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(_f||(f.CodeLensResolveRequest=_f={}));var wf;(function(e){e.method="workspace/codeLens/refresh",e.messageDirection=k.MessageDirection.serverToClient,e.type=new k.ProtocolRequestType0(e.method)})(wf||(f.CodeLensRefreshRequest=wf={}));var Pf;(function(e){e.method="textDocument/documentLink",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(Pf||(f.DocumentLinkRequest=Pf={}));var Cf;(function(e){e.method="documentLink/resolve",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(Cf||(f.DocumentLinkResolveRequest=Cf={}));var Ef;(function(e){e.method="textDocument/formatting",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(Ef||(f.DocumentFormattingRequest=Ef={}));var xf;(function(e){e.method="textDocument/rangeFormatting",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(xf||(f.DocumentRangeFormattingRequest=xf={}));var Sf;(function(e){e.method="textDocument/rangesFormatting",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(Sf||(f.DocumentRangesFormattingRequest=Sf={}));var Tf;(function(e){e.method="textDocument/onTypeFormatting",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(Tf||(f.DocumentOnTypeFormattingRequest=Tf={}));var kf;(function(e){e.Identifier=1})(kf||(f.PrepareSupportDefaultBehavior=kf={}));var qf;(function(e){e.method="textDocument/rename",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(qf||(f.RenameRequest=qf={}));var jf;(function(e){e.method="textDocument/prepareRename",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(jf||(f.PrepareRenameRequest=jf={}));var Nf;(function(e){e.method="workspace/executeCommand",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(Nf||(f.ExecuteCommandRequest=Nf={}));var If;(function(e){e.method="workspace/applyEdit",e.messageDirection=k.MessageDirection.serverToClient,e.type=new k.ProtocolRequestType("workspace/applyEdit")})(If||(f.ApplyWorkspaceEditRequest=If={}))});var Wf=x(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.createProtocolConnection=void 0;var $f=fn();function Fv(e,t,n,r){return $f.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,$f.createMessageConnection)(e,t,n,r)}Gi.createProtocolConnection=Fv});var Uf=x(Ge=>{"use strict";var Mv=Ge&&Ge.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),Xi=Ge&&Ge.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Mv(t,e,n)};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.LSPErrorCodes=Ge.createProtocolConnection=void 0;Xi(fn(),Ge);Xi(qi(),Ge);Xi(be(),Ge);Xi(Lf(),Ge);var Lv=Wf();Object.defineProperty(Ge,"createProtocolConnection",{enumerable:!0,get:function(){return Lv.createProtocolConnection}});var Hf;(function(e){e.lspReservedErrorRangeStart=-32899,e.RequestFailed=-32803,e.ServerCancelled=-32802,e.ContentModified=-32801,e.RequestCancelled=-32800,e.lspReservedErrorRangeEnd=-32800})(Hf||(Ge.LSPErrorCodes=Hf={}))});var pe=x(Ct=>{"use strict";var $v=Ct&&Ct.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),Vf=Ct&&Ct.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&$v(t,e,n)};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.createProtocolConnection=void 0;var Wv=Ti();Vf(Ti(),Ct);Vf(Uf(),Ct);function Hv(e,t,n,r){return(0,Wv.createMessageConnection)(e,t,n,r)}Ct.createProtocolConnection=Hv});var Ji=x(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.thenable=ke.typedArray=ke.stringArray=ke.array=ke.func=ke.error=ke.number=ke.string=ke.boolean=void 0;function Uv(e){return e===!0||e===!1}ke.boolean=Uv;function Bf(e){return typeof e=="string"||e instanceof String}ke.string=Bf;function Vv(e){return typeof e=="number"||e instanceof Number}ke.number=Vv;function Bv(e){return e instanceof Error}ke.error=Bv;function zf(e){return typeof e=="function"}ke.func=zf;function Gf(e){return Array.isArray(e)}ke.array=Gf;function zv(e){return Gf(e)&&e.every(t=>Bf(t))}ke.stringArray=zv;function Gv(e,t){return Array.isArray(e)&&e.every(t)}ke.typedArray=Gv;function Xv(e){return e&&zf(e.then)}ke.thenable=Xv});var Na=x(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.generateUuid=it.parse=it.isUUID=it.v4=it.empty=void 0;var Rr=class{constructor(t){this._value=t}asHex(){return this._value}equals(t){return this.asHex()===t.asHex()}},Dr=class e extends Rr{static _oneOf(t){return t[Math.floor(t.length*Math.random())]}static _randomHex(){return e._oneOf(e._chars)}constructor(){super([e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),"-",e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),"-","4",e._randomHex(),e._randomHex(),e._randomHex(),"-",e._oneOf(e._timeHighBits),e._randomHex(),e._randomHex(),e._randomHex(),"-",e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex()].join(""))}};Dr._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];Dr._timeHighBits=["8","9","a","b"];it.empty=new Rr("00000000-0000-0000-0000-000000000000");function Xf(){return new Dr}it.v4=Xf;var Jv=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Jf(e){return Jv.test(e)}it.isUUID=Jf;function Yv(e){if(!Jf(e))throw new Error("invalid uuid");return new Rr(e)}it.parse=Yv;function Qv(){return Xf().asHex()}it.generateUuid=Qv});var Yf=x(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.attachPartialResult=en.ProgressFeature=en.attachWorkDone=void 0;var Kt=pe(),Zv=Na(),hn=class e{constructor(t,n){this._connection=t,this._token=n,e.Instances.set(this._token,this)}begin(t,n,r,i){let o={kind:"begin",title:t,percentage:n,message:r,cancellable:i};this._connection.sendProgress(Kt.WorkDoneProgress.type,this._token,o)}report(t,n){let r={kind:"report"};typeof t=="number"?(r.percentage=t,n!==void 0&&(r.message=n)):r.message=t,this._connection.sendProgress(Kt.WorkDoneProgress.type,this._token,r)}done(){e.Instances.delete(this._token),this._connection.sendProgress(Kt.WorkDoneProgress.type,this._token,{kind:"end"})}};hn.Instances=new Map;var Yi=class extends hn{constructor(t,n){super(t,n),this._source=new Kt.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},_r=class{constructor(){}begin(){}report(){}done(){}},Qi=class extends _r{constructor(){super(),this._source=new Kt.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function Kv(e,t){if(t===void 0||t.workDoneToken===void 0)return new _r;let n=t.workDoneToken;return delete t.workDoneToken,new hn(e,n)}en.attachWorkDone=Kv;var eb=e=>class extends e{constructor(){super(),this._progressSupported=!1}initialize(t){super.initialize(t),t?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(Kt.WorkDoneProgressCancelNotification.type,n=>{let r=hn.Instances.get(n.token);(r instanceof Yi||r instanceof Qi)&&r.cancel()}))}attachWorkDoneProgress(t){return t===void 0?new _r:new hn(this.connection,t)}createWorkDoneProgress(){if(this._progressSupported){let t=(0,Zv.generateUuid)();return this.connection.sendRequest(Kt.WorkDoneProgressCreateRequest.type,{token:t}).then(()=>new Yi(this.connection,t))}else return Promise.resolve(new Qi)}};en.ProgressFeature=eb;var Ia;(function(e){e.type=new Kt.ProgressType})(Ia||(Ia={}));var Aa=class{constructor(t,n){this._connection=t,this._token=n}report(t){this._connection.sendProgress(Ia.type,this._token,t)}};function tb(e,t){if(t===void 0||t.partialResultToken===void 0)return;let n=t.partialResultToken;return delete t.partialResultToken,new Aa(e,n)}en.attachPartialResult=tb});var Qf=x(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.ConfigurationFeature=void 0;var nb=pe(),rb=Ji(),ib=e=>class extends e{getConfiguration(t){return t?rb.string(t)?this._getConfiguration({section:t}):this._getConfiguration(t):this._getConfiguration({})}_getConfiguration(t){let n={items:Array.isArray(t)?t:[t]};return this.connection.sendRequest(nb.ConfigurationRequest.type,n).then(r=>Array.isArray(r)?Array.isArray(t)?r:r[0]:Array.isArray(t)?[]:null)}};Zi.ConfigurationFeature=ib});var Zf=x(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.WorkspaceFoldersFeature=void 0;var Ki=pe(),ob=e=>class extends e{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(t){super.initialize(t);let n=t.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Ki.Emitter,this.connection.onNotification(Ki.DidChangeWorkspaceFoldersNotification.type,r=>{this._onDidChangeWorkspaceFolders.fire(r.event)}))}fillServerCapabilities(t){super.fillServerCapabilities(t);let n=t.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=n===!0||typeof n=="string"}getWorkspaceFolders(){return this.connection.sendRequest(Ki.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(Ki.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};eo.WorkspaceFoldersFeature=ob});var Kf=x(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.CallHierarchyFeature=void 0;var Oa=pe(),sb=e=>class extends e{get callHierarchy(){return{onPrepare:t=>this.connection.onRequest(Oa.CallHierarchyPrepareRequest.type,(n,r)=>t(n,r,this.attachWorkDoneProgress(n),void 0)),onIncomingCalls:t=>{let n=Oa.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>t(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onOutgoingCalls:t=>{let n=Oa.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>t(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};to.CallHierarchyFeature=sb});var Ma=x(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.SemanticTokensBuilder=tn.SemanticTokensDiff=tn.SemanticTokensFeature=void 0;var no=pe(),ab=e=>class extends e{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(no.SemanticTokensRefreshRequest.type),on:t=>{let n=no.SemanticTokensRequest.type;return this.connection.onRequest(n,(r,i)=>t(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onDelta:t=>{let n=no.SemanticTokensDeltaRequest.type;return this.connection.onRequest(n,(r,i)=>t(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onRange:t=>{let n=no.SemanticTokensRangeRequest.type;return this.connection.onRequest(n,(r,i)=>t(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};tn.SemanticTokensFeature=ab;var ro=class{constructor(t,n){this.originalSequence=t,this.modifiedSequence=n}computeDiff(){let t=this.originalSequence.length,n=this.modifiedSequence.length,r=0;for(;r<n&&r<t&&this.originalSequence[r]===this.modifiedSequence[r];)r++;if(r<n&&r<t){let i=t-1,o=n-1;for(;i>=r&&o>=r&&this.originalSequence[i]===this.modifiedSequence[o];)i--,o--;(i<r||o<r)&&(i++,o++);let s=i-r+1,u=this.modifiedSequence.slice(r,o+1);return u.length===1&&u[0]===this.originalSequence[i]?[{start:r,deleteCount:s-1}]:[{start:r,deleteCount:s,data:u}]}else return r<n?[{start:r,deleteCount:0,data:this.modifiedSequence.slice(r)}]:r<t?[{start:r,deleteCount:t-r}]:[]}};tn.SemanticTokensDiff=ro;var Fa=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(t,n,r,i,o){let s=t,u=n;this._dataLen>0&&(s-=this._prevLine,s===0&&(u-=this._prevChar)),this._data[this._dataLen++]=s,this._data[this._dataLen++]=u,this._data[this._dataLen++]=r,this._data[this._dataLen++]=i,this._data[this._dataLen++]=o,this._prevLine=t,this._prevChar=n}get id(){return this._id.toString()}previousResult(t){this.id===t&&(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 ro(this._prevData,this._data).computeDiff()}:this.build()}};tn.SemanticTokensBuilder=Fa});var ep=x(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.ShowDocumentFeature=void 0;var cb=pe(),ub=e=>class extends e{showDocument(t){return this.connection.sendRequest(cb.ShowDocumentRequest.type,t)}};io.ShowDocumentFeature=ub});var tp=x(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.FileOperationsFeature=void 0;var Xn=pe(),lb=e=>class extends e{onDidCreateFiles(t){return this.connection.onNotification(Xn.DidCreateFilesNotification.type,n=>{t(n)})}onDidRenameFiles(t){return this.connection.onNotification(Xn.DidRenameFilesNotification.type,n=>{t(n)})}onDidDeleteFiles(t){return this.connection.onNotification(Xn.DidDeleteFilesNotification.type,n=>{t(n)})}onWillCreateFiles(t){return this.connection.onRequest(Xn.WillCreateFilesRequest.type,(n,r)=>t(n,r))}onWillRenameFiles(t){return this.connection.onRequest(Xn.WillRenameFilesRequest.type,(n,r)=>t(n,r))}onWillDeleteFiles(t){return this.connection.onRequest(Xn.WillDeleteFilesRequest.type,(n,r)=>t(n,r))}};oo.FileOperationsFeature=lb});var np=x(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.LinkedEditingRangeFeature=void 0;var db=pe(),fb=e=>class extends e{onLinkedEditingRange(t){return this.connection.onRequest(db.LinkedEditingRangeRequest.type,(n,r)=>t(n,r,this.attachWorkDoneProgress(n),void 0))}};so.LinkedEditingRangeFeature=fb});var rp=x(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.TypeHierarchyFeature=void 0;var La=pe(),pb=e=>class extends e{get typeHierarchy(){return{onPrepare:t=>this.connection.onRequest(La.TypeHierarchyPrepareRequest.type,(n,r)=>t(n,r,this.attachWorkDoneProgress(n),void 0)),onSupertypes:t=>{let n=La.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(n,(r,i)=>t(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onSubtypes:t=>{let n=La.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(n,(r,i)=>t(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};ao.TypeHierarchyFeature=pb});var op=x(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.InlineValueFeature=void 0;var ip=pe(),hb=e=>class extends e{get inlineValue(){return{refresh:()=>this.connection.sendRequest(ip.InlineValueRefreshRequest.type),on:t=>this.connection.onRequest(ip.InlineValueRequest.type,(n,r)=>t(n,r,this.attachWorkDoneProgress(n)))}}};co.InlineValueFeature=hb});var ap=x(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.FoldingRangeFeature=void 0;var sp=pe(),gb=e=>class extends e{get foldingRange(){return{refresh:()=>this.connection.sendRequest(sp.FoldingRangeRefreshRequest.type),on:t=>{let n=sp.FoldingRangeRequest.type;return this.connection.onRequest(n,(r,i)=>t(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};uo.FoldingRangeFeature=gb});var cp=x(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.InlayHintFeature=void 0;var $a=pe(),mb=e=>class extends e{get inlayHint(){return{refresh:()=>this.connection.sendRequest($a.InlayHintRefreshRequest.type),on:t=>this.connection.onRequest($a.InlayHintRequest.type,(n,r)=>t(n,r,this.attachWorkDoneProgress(n))),resolve:t=>this.connection.onRequest($a.InlayHintResolveRequest.type,(n,r)=>t(n,r))}}};lo.InlayHintFeature=mb});var up=x(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.DiagnosticFeature=void 0;var wr=pe(),yb=e=>class extends e{get diagnostics(){return{refresh:()=>this.connection.sendRequest(wr.DiagnosticRefreshRequest.type),on:t=>this.connection.onRequest(wr.DocumentDiagnosticRequest.type,(n,r)=>t(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(wr.DocumentDiagnosticRequest.partialResult,n))),onWorkspace:t=>this.connection.onRequest(wr.WorkspaceDiagnosticRequest.type,(n,r)=>t(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(wr.WorkspaceDiagnosticRequest.partialResult,n)))}}};fo.DiagnosticFeature=yb});var Ha=x(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.TextDocuments=void 0;var gn=pe(),Wa=class{constructor(t){this._configuration=t,this._syncedDocuments=new Map,this._onDidChangeContent=new gn.Emitter,this._onDidOpen=new gn.Emitter,this._onDidClose=new gn.Emitter,this._onDidSave=new gn.Emitter,this._onWillSave=new gn.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(t){this._willSaveWaitUntil=t}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(t){return this._syncedDocuments.get(t)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(t){t.__textDocumentSync=gn.TextDocumentSyncKind.Incremental;let n=[];return n.push(t.onDidOpenTextDocument(r=>{let i=r.textDocument,o=this._configuration.create(i.uri,i.languageId,i.version,i.text);this._syncedDocuments.set(i.uri,o);let s=Object.freeze({document:o});this._onDidOpen.fire(s),this._onDidChangeContent.fire(s)})),n.push(t.onDidChangeTextDocument(r=>{let i=r.textDocument,o=r.contentChanges;if(o.length===0)return;let{version:s}=i;if(s==null)throw new Error(`Received document change event for ${i.uri} without valid version identifier`);let u=this._syncedDocuments.get(i.uri);u!==void 0&&(u=this._configuration.update(u,o,s),this._syncedDocuments.set(i.uri,u),this._onDidChangeContent.fire(Object.freeze({document:u})))})),n.push(t.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(t.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(t.onWillSaveTextDocumentWaitUntil((r,i)=>{let o=this._syncedDocuments.get(r.textDocument.uri);return o!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:o,reason:r.reason}),i):[]})),n.push(t.onDidSaveTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),gn.Disposable.create(()=>{n.forEach(r=>r.dispose())})}};po.TextDocuments=Wa});var Va=x(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.NotebookDocuments=Jn.NotebookSyncFeature=void 0;var ot=pe(),lp=Ha(),vb=e=>class extends e{get synchronization(){return{onDidOpenNotebookDocument:t=>this.connection.onNotification(ot.DidOpenNotebookDocumentNotification.type,n=>{t(n)}),onDidChangeNotebookDocument:t=>this.connection.onNotification(ot.DidChangeNotebookDocumentNotification.type,n=>{t(n)}),onDidSaveNotebookDocument:t=>this.connection.onNotification(ot.DidSaveNotebookDocumentNotification.type,n=>{t(n)}),onDidCloseNotebookDocument:t=>this.connection.onNotification(ot.DidCloseNotebookDocumentNotification.type,n=>{t(n)})}}};Jn.NotebookSyncFeature=vb;var ho=class e{onDidOpenTextDocument(t){return this.openHandler=t,ot.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(t){this.openHandler&&this.openHandler(t)}onDidChangeTextDocument(t){return this.changeHandler=t,ot.Disposable.create(()=>{this.changeHandler=t})}changeTextDocument(t){this.changeHandler&&this.changeHandler(t)}onDidCloseTextDocument(t){return this.closeHandler=t,ot.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(t){this.closeHandler&&this.closeHandler(t)}onWillSaveTextDocument(){return e.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return e.NULL_DISPOSE}onDidSaveTextDocument(){return e.NULL_DISPOSE}};ho.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var Ua=class{constructor(t){t instanceof lp.TextDocuments?this._cellTextDocuments=t:this._cellTextDocuments=new lp.TextDocuments(t),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new ot.Emitter,this._onDidChange=new ot.Emitter,this._onDidSave=new ot.Emitter,this._onDidClose=new ot.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(t){return this._cellTextDocuments.get(t.document)}getNotebookDocument(t){return this.notebookDocuments.get(t)}getNotebookCell(t){let n=this.notebookCellMap.get(t);return n&&n[0]}findNotebookDocumentForCell(t){let n=typeof t=="string"?t:t.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(t){let n=new ho,r=[];return r.push(this.cellTextDocuments.listen(n)),r.push(t.notebooks.synchronization.onDidOpenNotebookDocument(i=>{this.notebookDocuments.set(i.notebookDocument.uri,i.notebookDocument);for(let o of i.cellTextDocuments)n.openTextDocument({textDocument:o});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument)})),r.push(t.notebooks.synchronization.onDidChangeNotebookDocument(i=>{let o=this.notebookDocuments.get(i.notebookDocument.uri);if(o===void 0)return;o.version=i.notebookDocument.version;let s=o.metadata,u=!1,d=i.change;d.metadata!==void 0&&(u=!0,o.metadata=d.metadata);let p=[],_=[],w=[],T=[];if(d.cells!==void 0){let U=d.cells;if(U.structure!==void 0){let y=U.structure.array;if(o.cells.splice(y.start,y.deleteCount,...y.cells!==void 0?y.cells:[]),U.structure.didOpen!==void 0)for(let v of U.structure.didOpen)n.openTextDocument({textDocument:v}),p.push(v.uri);if(U.structure.didClose)for(let v of U.structure.didClose)n.closeTextDocument({textDocument:v}),_.push(v.uri)}if(U.data!==void 0){let y=new Map(U.data.map(v=>[v.document,v]));for(let v=0;v<=o.cells.length;v++){let q=y.get(o.cells[v].document);if(q!==void 0){let J=o.cells.splice(v,1,q);if(w.push({old:J[0],new:q}),y.delete(q.document),y.size===0)break}}}if(U.textContent!==void 0)for(let y of U.textContent)n.changeTextDocument({textDocument:y.document,contentChanges:y.changes}),T.push(y.document.uri)}this.updateCellMap(o);let P={notebookDocument:o};u&&(P.metadata={old:s,new:o.metadata});let L=[];for(let U of p)L.push(this.getNotebookCell(U));let H=[];for(let U of _)H.push(this.getNotebookCell(U));let se=[];for(let U of T)se.push(this.getNotebookCell(U));(L.length>0||H.length>0||w.length>0||se.length>0)&&(P.cells={added:L,removed:H,changed:{data:w,textContent:se}}),(P.metadata!==void 0||P.cells!==void 0)&&this._onDidChange.fire(P)})),r.push(t.notebooks.synchronization.onDidSaveNotebookDocument(i=>{let o=this.notebookDocuments.get(i.notebookDocument.uri);o!==void 0&&this._onDidSave.fire(o)})),r.push(t.notebooks.synchronization.onDidCloseNotebookDocument(i=>{let o=this.notebookDocuments.get(i.notebookDocument.uri);if(o!==void 0){this._onDidClose.fire(o);for(let s of i.cellTextDocuments)n.closeTextDocument({textDocument:s});this.notebookDocuments.delete(i.notebookDocument.uri);for(let s of o.cells)this.notebookCellMap.delete(s.document)}})),ot.Disposable.create(()=>{r.forEach(i=>i.dispose())})}updateCellMap(t){for(let n of t.cells)this.notebookCellMap.set(n.document,[n,t])}};Jn.NotebookDocuments=Ua});var dp=x(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.MonikerFeature=void 0;var bb=pe(),Rb=e=>class extends e{get moniker(){return{on:t=>{let n=bb.MonikerRequest.type;return this.connection.onRequest(n,(r,i)=>t(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};go.MonikerFeature=Rb});var Ya=x(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.createConnection=ne.combineFeatures=ne.combineNotebooksFeatures=ne.combineLanguagesFeatures=ne.combineWorkspaceFeatures=ne.combineWindowFeatures=ne.combineClientFeatures=ne.combineTracerFeatures=ne.combineTelemetryFeatures=ne.combineConsoleFeatures=ne._NotebooksImpl=ne._LanguagesImpl=ne.BulkUnregistration=ne.BulkRegistration=ne.ErrorMessageTracker=void 0;var N=pe(),st=Ji(),za=Na(),V=Yf(),Db=Qf(),_b=Zf(),wb=Kf(),Pb=Ma(),Cb=ep(),Eb=tp(),xb=np(),Sb=rp(),Tb=op(),kb=ap(),qb=cp(),jb=up(),Nb=Va(),Ib=dp();function Ba(e){if(e!==null)return e}var Ga=class{constructor(){this._messages=Object.create(null)}add(t){let n=this._messages[t];n||(n=0),n++,this._messages[t]=n}sendErrors(t){Object.keys(this._messages).forEach(n=>{t.window.showErrorMessage(n)})}};ne.ErrorMessageTracker=Ga;var mo=class{constructor(){}rawAttach(t){this._rawConnection=t}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(t){}initialize(t){}error(t){this.send(N.MessageType.Error,t)}warn(t){this.send(N.MessageType.Warning,t)}info(t){this.send(N.MessageType.Info,t)}log(t){this.send(N.MessageType.Log,t)}debug(t){this.send(N.MessageType.Debug,t)}send(t,n){this._rawConnection&&this._rawConnection.sendNotification(N.LogMessageNotification.type,{type:t,message:n}).catch(()=>{(0,N.RAL)().console.error("Sending log message failed")})}},Xa=class{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}showErrorMessage(t,...n){let r={type:N.MessageType.Error,message:t,actions:n};return this.connection.sendRequest(N.ShowMessageRequest.type,r).then(Ba)}showWarningMessage(t,...n){let r={type:N.MessageType.Warning,message:t,actions:n};return this.connection.sendRequest(N.ShowMessageRequest.type,r).then(Ba)}showInformationMessage(t,...n){let r={type:N.MessageType.Info,message:t,actions:n};return this.connection.sendRequest(N.ShowMessageRequest.type,r).then(Ba)}},fp=(0,Cb.ShowDocumentFeature)((0,V.ProgressFeature)(Xa)),pp;(function(e){function t(){return new yo}e.create=t})(pp||(ne.BulkRegistration=pp={}));var yo=class{constructor(){this._registrations=[],this._registered=new Set}add(t,n){let r=st.string(t)?t:t.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);let i=za.generateUuid();this._registrations.push({id:i,method:r,registerOptions:n||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}},hp;(function(e){function t(){return new Pr(void 0,[])}e.create=t})(hp||(ne.BulkUnregistration=hp={}));var Pr=class{constructor(t,n){this._connection=t,this._unregistrations=new Map,n.forEach(r=>{this._unregistrations.set(r.method,r)})}get isAttached(){return!!this._connection}attach(t){this._connection=t}add(t){this._unregistrations.set(t.method,t)}dispose(){let t=[];for(let r of this._unregistrations.values())t.push(r);let n={unregisterations:t};this._connection.sendRequest(N.UnregistrationRequest.type,n).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(t){let n=st.string(t)?t:t.method,r=this._unregistrations.get(n);if(!r)return!1;let i={unregisterations:[r]};return this._connection.sendRequest(N.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(n)},o=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}},vo=class{attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}register(t,n,r){return t instanceof yo?this.registerMany(t):t instanceof Pr?this.registerSingle1(t,n,r):this.registerSingle2(t,n)}registerSingle1(t,n,r){let i=st.string(n)?n:n.method,o=za.generateUuid(),s={registrations:[{id:o,method:i,registerOptions:r||{}}]};return t.isAttached||t.attach(this.connection),this.connection.sendRequest(N.RegistrationRequest.type,s).then(u=>(t.add({id:o,method:i}),t),u=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(u)))}registerSingle2(t,n){let r=st.string(t)?t:t.method,i=za.generateUuid(),o={registrations:[{id:i,method:r,registerOptions:n||{}}]};return this.connection.sendRequest(N.RegistrationRequest.type,o).then(s=>N.Disposable.create(()=>{this.unregisterSingle(i,r).catch(()=>{this.connection.console.info(`Un-registering capability with id ${i} failed.`)})}),s=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(s)))}unregisterSingle(t,n){let r={unregisterations:[{id:t,method:n}]};return this.connection.sendRequest(N.UnregistrationRequest.type,r).catch(()=>{this.connection.console.info(`Un-registering request handler for ${t} failed.`)})}registerMany(t){let n=t.asRegistrationParams();return this.connection.sendRequest(N.RegistrationRequest.type,n).then(()=>new Pr(this._connection,n.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}},Ja=class{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}applyEdit(t){function n(i){return i&&!!i.edit}let r=n(t)?t:{edit:t};return this.connection.sendRequest(N.ApplyWorkspaceEditRequest.type,r)}},gp=(0,Eb.FileOperationsFeature)((0,_b.WorkspaceFoldersFeature)((0,Db.ConfigurationFeature)(Ja))),bo=class{constructor(){this._trace=N.Trace.Off}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}set trace(t){this._trace=t}log(t,n){this._trace!==N.Trace.Off&&this.connection.sendNotification(N.LogTraceNotification.type,{message:t,verbose:this._trace===N.Trace.Verbose?n:void 0}).catch(()=>{})}},Ro=class{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}logEvent(t){this.connection.sendNotification(N.TelemetryEventNotification.type,t).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},Do=class{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}attachWorkDoneProgress(t){return(0,V.attachWorkDone)(this.connection,t)}attachPartialResultProgress(t,n){return(0,V.attachPartialResult)(this.connection,n)}};ne._LanguagesImpl=Do;var mp=(0,kb.FoldingRangeFeature)((0,Ib.MonikerFeature)((0,jb.DiagnosticFeature)((0,qb.InlayHintFeature)((0,Tb.InlineValueFeature)((0,Sb.TypeHierarchyFeature)((0,xb.LinkedEditingRangeFeature)((0,Pb.SemanticTokensFeature)((0,wb.CallHierarchyFeature)(Do))))))))),_o=class{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}attachWorkDoneProgress(t){return(0,V.attachWorkDone)(this.connection,t)}attachPartialResultProgress(t,n){return(0,V.attachPartialResult)(this.connection,n)}};ne._NotebooksImpl=_o;var yp=(0,Nb.NotebookSyncFeature)(_o);function vp(e,t){return function(n){return t(e(n))}}ne.combineConsoleFeatures=vp;function bp(e,t){return function(n){return t(e(n))}}ne.combineTelemetryFeatures=bp;function Rp(e,t){return function(n){return t(e(n))}}ne.combineTracerFeatures=Rp;function Dp(e,t){return function(n){return t(e(n))}}ne.combineClientFeatures=Dp;function _p(e,t){return function(n){return t(e(n))}}ne.combineWindowFeatures=_p;function wp(e,t){return function(n){return t(e(n))}}ne.combineWorkspaceFeatures=wp;function Pp(e,t){return function(n){return t(e(n))}}ne.combineLanguagesFeatures=Pp;function Cp(e,t){return function(n){return t(e(n))}}ne.combineNotebooksFeatures=Cp;function Ab(e,t){function n(i,o,s){return i&&o?s(i,o):i||o}return{__brand:"features",console:n(e.console,t.console,vp),tracer:n(e.tracer,t.tracer,Rp),telemetry:n(e.telemetry,t.telemetry,bp),client:n(e.client,t.client,Dp),window:n(e.window,t.window,_p),workspace:n(e.workspace,t.workspace,wp),languages:n(e.languages,t.languages,Pp),notebooks:n(e.notebooks,t.notebooks,Cp)}}ne.combineFeatures=Ab;function Ob(e,t,n){let r=n&&n.console?new(n.console(mo)):new mo,i=e(r);r.rawAttach(i);let o=n&&n.tracer?new(n.tracer(bo)):new bo,s=n&&n.telemetry?new(n.telemetry(Ro)):new Ro,u=n&&n.client?new(n.client(vo)):new vo,d=n&&n.window?new(n.window(fp)):new fp,p=n&&n.workspace?new(n.workspace(gp)):new gp,_=n&&n.languages?new(n.languages(mp)):new mp,w=n&&n.notebooks?new(n.notebooks(yp)):new yp,T=[r,o,s,u,d,p,_,w];function P(y){return y instanceof Promise?y:st.thenable(y)?new Promise((v,q)=>{y.then(J=>v(J),J=>q(J))}):Promise.resolve(y)}let L,H,se,U={listen:()=>i.listen(),sendRequest:(y,...v)=>i.sendRequest(st.string(y)?y:y.method,...v),onRequest:(y,v)=>i.onRequest(y,v),sendNotification:(y,v)=>{let q=st.string(y)?y:y.method;return i.sendNotification(q,v)},onNotification:(y,v)=>i.onNotification(y,v),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:y=>(H=y,{dispose:()=>{H=void 0}}),onInitialized:y=>i.onNotification(N.InitializedNotification.type,y),onShutdown:y=>(L=y,{dispose:()=>{L=void 0}}),onExit:y=>(se=y,{dispose:()=>{se=void 0}}),get console(){return r},get telemetry(){return s},get tracer(){return o},get client(){return u},get window(){return d},get workspace(){return p},get languages(){return _},get notebooks(){return w},onDidChangeConfiguration:y=>i.onNotification(N.DidChangeConfigurationNotification.type,y),onDidChangeWatchedFiles:y=>i.onNotification(N.DidChangeWatchedFilesNotification.type,y),__textDocumentSync:void 0,onDidOpenTextDocument:y=>i.onNotification(N.DidOpenTextDocumentNotification.type,y),onDidChangeTextDocument:y=>i.onNotification(N.DidChangeTextDocumentNotification.type,y),onDidCloseTextDocument:y=>i.onNotification(N.DidCloseTextDocumentNotification.type,y),onWillSaveTextDocument:y=>i.onNotification(N.WillSaveTextDocumentNotification.type,y),onWillSaveTextDocumentWaitUntil:y=>i.onRequest(N.WillSaveTextDocumentWaitUntilRequest.type,y),onDidSaveTextDocument:y=>i.onNotification(N.DidSaveTextDocumentNotification.type,y),sendDiagnostics:y=>i.sendNotification(N.PublishDiagnosticsNotification.type,y),onHover:y=>i.onRequest(N.HoverRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),void 0)),onCompletion:y=>i.onRequest(N.CompletionRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onCompletionResolve:y=>i.onRequest(N.CompletionResolveRequest.type,y),onSignatureHelp:y=>i.onRequest(N.SignatureHelpRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),void 0)),onDeclaration:y=>i.onRequest(N.DeclarationRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onDefinition:y=>i.onRequest(N.DefinitionRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onTypeDefinition:y=>i.onRequest(N.TypeDefinitionRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onImplementation:y=>i.onRequest(N.ImplementationRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onReferences:y=>i.onRequest(N.ReferencesRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onDocumentHighlight:y=>i.onRequest(N.DocumentHighlightRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onDocumentSymbol:y=>i.onRequest(N.DocumentSymbolRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onWorkspaceSymbol:y=>i.onRequest(N.WorkspaceSymbolRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onWorkspaceSymbolResolve:y=>i.onRequest(N.WorkspaceSymbolResolveRequest.type,y),onCodeAction:y=>i.onRequest(N.CodeActionRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onCodeActionResolve:y=>i.onRequest(N.CodeActionResolveRequest.type,(v,q)=>y(v,q)),onCodeLens:y=>i.onRequest(N.CodeLensRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onCodeLensResolve:y=>i.onRequest(N.CodeLensResolveRequest.type,(v,q)=>y(v,q)),onDocumentFormatting:y=>i.onRequest(N.DocumentFormattingRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),void 0)),onDocumentRangeFormatting:y=>i.onRequest(N.DocumentRangeFormattingRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),void 0)),onDocumentOnTypeFormatting:y=>i.onRequest(N.DocumentOnTypeFormattingRequest.type,(v,q)=>y(v,q)),onRenameRequest:y=>i.onRequest(N.RenameRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),void 0)),onPrepareRename:y=>i.onRequest(N.PrepareRenameRequest.type,(v,q)=>y(v,q)),onDocumentLinks:y=>i.onRequest(N.DocumentLinkRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onDocumentLinkResolve:y=>i.onRequest(N.DocumentLinkResolveRequest.type,(v,q)=>y(v,q)),onDocumentColor:y=>i.onRequest(N.DocumentColorRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onColorPresentation:y=>i.onRequest(N.ColorPresentationRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onFoldingRanges:y=>i.onRequest(N.FoldingRangeRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onSelectionRanges:y=>i.onRequest(N.SelectionRangeRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onExecuteCommand:y=>i.onRequest(N.ExecuteCommandRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),void 0)),dispose:()=>i.dispose()};for(let y of T)y.attach(U);return i.onRequest(N.InitializeRequest.type,y=>{t.initialize(y),st.string(y.trace)&&(o.trace=N.Trace.fromString(y.trace));for(let v of T)v.initialize(y.capabilities);if(H){let v=H(y,new N.CancellationTokenSource().token,(0,V.attachWorkDone)(i,y),void 0);return P(v).then(q=>{if(q instanceof N.ResponseError)return q;let J=q;J||(J={capabilities:{}});let le=J.capabilities;le||(le={},J.capabilities=le),le.textDocumentSync===void 0||le.textDocumentSync===null?le.textDocumentSync=st.number(U.__textDocumentSync)?U.__textDocumentSync:N.TextDocumentSyncKind.None:!st.number(le.textDocumentSync)&&!st.number(le.textDocumentSync.change)&&(le.textDocumentSync.change=st.number(U.__textDocumentSync)?U.__textDocumentSync:N.TextDocumentSyncKind.None);for(let _e of T)_e.fillServerCapabilities(le);return J})}else{let v={capabilities:{textDocumentSync:N.TextDocumentSyncKind.None}};for(let q of T)q.fillServerCapabilities(v.capabilities);return v}}),i.onRequest(N.ShutdownRequest.type,()=>{if(t.shutdownReceived=!0,L)return L(new N.CancellationTokenSource().token)}),i.onNotification(N.ExitNotification.type,()=>{try{se&&se()}finally{t.shutdownReceived?t.exit(0):t.exit(1)}}),i.onNotification(N.SetTraceNotification.type,y=>{o.trace=N.Trace.fromString(y.value)}),U}ne.createConnection=Ob});var Ep=x(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.resolveModulePath=Xe.FileSystem=Xe.resolveGlobalYarnPath=Xe.resolveGlobalNodePath=Xe.resolve=Xe.uriToFilePath=void 0;var Fb=require("url"),yt=require("path"),Qa=require("fs"),tc=require("child_process");function Mb(e){let t=Fb.parse(e);if(t.protocol!=="file:"||!t.path)return;let n=t.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 o=n[0],s=n[1];o.length===0&&s.length>1&&s[1]===":"&&n.shift()}return yt.normalize(n.join("/"))}Xe.uriToFilePath=Mb;function Za(){return process.platform==="win32"}function wo(e,t,n,r){let i="NODE_PATH",o=["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((s,u)=>{let d=process.env,p=Object.create(null);Object.keys(d).forEach(_=>p[_]=d[_]),t&&Qa.existsSync(t)&&(p[i]?p[i]=t+yt.delimiter+p[i]:p[i]=t,r&&r(`NODE_PATH value is: ${p[i]}`)),p.ELECTRON_RUN_AS_NODE="1";try{let _=(0,tc.fork)("",[],{cwd:n,env:p,execArgv:["-e",o]});if(_.pid===void 0){u(new Error(`Starting process to resolve node module ${e} failed`));return}_.on("error",T=>{u(T)}),_.on("message",T=>{T.c==="r"&&(_.send({c:"e"}),T.s?s(T.r):u(new Error(`Failed to resolve module: ${e}`)))});let w={c:"rs",a:e};_.send(w)}catch(_){u(_)}})}Xe.resolve=wo;function Ka(e){let t="npm",n=Object.create(null);Object.keys(process.env).forEach(o=>n[o]=process.env[o]),n.NO_UPDATE_NOTIFIER="true";let r={encoding:"utf8",env:n};Za()&&(t="npm.cmd",r.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let o=(0,tc.spawnSync)(t,["config","get","prefix"],r).stdout;if(!o){e&&e("'npm config get prefix' didn't return a value.");return}let s=o.trim();return e&&e(`'npm config get prefix' value is: ${s}`),s.length>0?Za()?yt.join(s,"node_modules"):yt.join(s,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i)}}Xe.resolveGlobalNodePath=Ka;function Lb(e){let t="yarn",n={encoding:"utf8"};Za()&&(t="yarn.cmd",n.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let i=(0,tc.spawnSync)(t,["global","dir","--json"],n),o=i.stdout;if(!o){e&&(e("'yarn global dir' didn't return a value."),i.stderr&&e(i.stderr));return}let s=o.trim().split(/\r?\n/);for(let u of s)try{let d=JSON.parse(u);if(d.type==="log")return yt.join(d.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",r)}}Xe.resolveGlobalYarnPath=Lb;var ec;(function(e){let t;function n(){return t!==void 0||(process.platform==="win32"?t=!1:t=!Qa.existsSync(__filename.toUpperCase())||!Qa.existsSync(__filename.toLowerCase())),t}e.isCaseSensitive=n;function r(i,o){return n()?yt.normalize(o).indexOf(yt.normalize(i))===0:yt.normalize(o).toLowerCase().indexOf(yt.normalize(i).toLowerCase())===0}e.isParent=r})(ec||(Xe.FileSystem=ec={}));function $b(e,t,n,r){return n?(yt.isAbsolute(n)||(n=yt.join(e,n)),wo(t,n,n,r).then(i=>ec.isParent(n,i)?i:Promise.reject(new Error(`Failed to load ${t} from node path location.`))).then(void 0,i=>wo(t,Ka(r),e,r))):wo(t,Ka(r),e,r)}Xe.resolveModulePath=$b});var nc=x((EC,xp)=>{"use strict";xp.exports=pe()});var Sp=x(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.InlineCompletionFeature=void 0;var Wb=pe(),Hb=e=>class extends e{get inlineCompletion(){return{on:t=>this.connection.onRequest(Wb.InlineCompletionRequest.type,(n,r)=>t(n,r,this.attachWorkDoneProgress(n)))}}};Po.InlineCompletionFeature=Hb});var qp=x(Le=>{"use strict";var Ub=Le&&Le.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),kp=Le&&Le.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Ub(t,e,n)};Object.defineProperty(Le,"__esModule",{value:!0});Le.ProposedFeatures=Le.NotebookDocuments=Le.TextDocuments=Le.SemanticTokensBuilder=void 0;var Vb=Ma();Object.defineProperty(Le,"SemanticTokensBuilder",{enumerable:!0,get:function(){return Vb.SemanticTokensBuilder}});var Bb=Sp();kp(pe(),Le);var zb=Ha();Object.defineProperty(Le,"TextDocuments",{enumerable:!0,get:function(){return zb.TextDocuments}});var Gb=Va();Object.defineProperty(Le,"NotebookDocuments",{enumerable:!0,get:function(){return Gb.NotebookDocuments}});kp(Ya(),Le);var Tp;(function(e){e.all={__brand:"features",languages:Bb.InlineCompletionFeature}})(Tp||(Le.ProposedFeatures=Tp={}))});var Fp=x(at=>{"use strict";var Xb=at&&at.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),Ap=at&&at.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Xb(t,e,n)};Object.defineProperty(at,"__esModule",{value:!0});at.createConnection=at.Files=void 0;var jp=require("node:util"),rc=Ji(),Jb=Ya(),Cr=Ep(),mn=nc();Ap(nc(),at);Ap(qp(),at);var Np;(function(e){e.uriToFilePath=Cr.uriToFilePath,e.resolveGlobalNodePath=Cr.resolveGlobalNodePath,e.resolveGlobalYarnPath=Cr.resolveGlobalYarnPath,e.resolve=Cr.resolve,e.resolveModulePath=Cr.resolveModulePath})(Np||(at.Files=Np={}));var Ip;function Co(){if(Ip!==void 0)try{Ip.end()}catch{}}var Yn=!1,Op;function Yb(){let e="--clientProcessId";function t(n){try{let r=parseInt(n);isNaN(r)||(Op=setInterval(()=>{try{process.kill(r,0)}catch{Co(),process.exit(Yn?0:1)}},3e3))}catch{}}for(let n=2;n<process.argv.length;n++){let r=process.argv[n];if(r===e&&n+1<process.argv.length){t(process.argv[n+1]);return}else{let i=r.split("=");i[0]===e&&t(i[1])}}}Yb();var Qb={initialize:e=>{let t=e.processId;rc.number(t)&&Op===void 0&&setInterval(()=>{try{process.kill(t,0)}catch{process.exit(Yn?0:1)}},3e3)},get shutdownReceived(){return Yn},set shutdownReceived(e){Yn=e},exit:e=>{Co(),process.exit(e)}};function Zb(e,t,n,r){let i,o,s,u;return e!==void 0&&e.__brand==="features"&&(i=e,e=t,t=n,n=r),mn.ConnectionStrategy.is(e)||mn.ConnectionOptions.is(e)?u=e:(o=e,s=t,u=n),Kb(o,s,u,i)}at.createConnection=Zb;function Kb(e,t,n,r){let i=!1;if(!e&&!t&&process.argv.length>2){let d,p,_=process.argv.slice(2);for(let w=0;w<_.length;w++){let T=_[w];if(T==="--node-ipc"){e=new mn.IPCMessageReader(process),t=new mn.IPCMessageWriter(process);break}else if(T==="--stdio"){i=!0,e=process.stdin,t=process.stdout;break}else if(T==="--socket"){d=parseInt(_[w+1]);break}else if(T==="--pipe"){p=_[w+1];break}else{var o=T.split("=");if(o[0]==="--socket"){d=parseInt(o[1]);break}else if(o[0]==="--pipe"){p=o[1];break}}}if(d){let w=(0,mn.createServerSocketTransport)(d);e=w[0],t=w[1]}else if(p){let w=(0,mn.createServerPipeTransport)(p);e=w[0],t=w[1]}}var s="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!e)throw new Error("Connection input stream is not set. "+s);if(!t)throw new Error("Connection output stream is not set. "+s);if(rc.func(e.read)&&rc.func(e.on)){let d=e;d.on("end",()=>{Co(),process.exit(Yn?0:1)}),d.on("close",()=>{Co(),process.exit(Yn?0:1)})}let u=d=>{let p=(0,mn.createProtocolConnection)(e,t,d,n);return i&&eR(d),p};return(0,Jb.createConnection)(u,Qb,r)}function eR(e){function t(r){return r.map(i=>typeof i=="string"?i:(0,jp.inspect)(i)).join(" ")}let n=new Map;console.assert=function(i,...o){if(!i)if(o.length===0)e.error("Assertion failed");else{let[s,...u]=o;e.error(`Assertion failed: ${s} ${t(u)}`)}},console.count=function(i="default"){let o=String(i),s=n.get(o)??0;s+=1,n.set(o,s),e.log(`${o}: ${o}`)},console.countReset=function(i){i===void 0?n.clear():n.delete(String(i))},console.debug=function(...i){e.log(t(i))},console.dir=function(i,o){e.log((0,jp.inspect)(i,o))},console.log=function(...i){e.log(t(i))},console.error=function(...i){e.error(t(i))},console.trace=function(...i){let o=new Error().stack.replace(/(.+\n){2}/,""),s="Trace";i.length!==0&&(s+=`: ${t(i)}`),e.log(`${s}
|
|
37
|
-
${o}`)},console.warn=function(...i){e.warn(t(i))}}});var Er=x((qC,Mp)=>{"use strict";var tR="2.0.0",nR=Number.MAX_SAFE_INTEGER||9007199254740991,rR=16,iR=250,oR=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Mp.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:rR,MAX_SAFE_BUILD_LENGTH:iR,MAX_SAFE_INTEGER:nR,RELEASE_TYPES:oR,SEMVER_SPEC_VERSION:tR,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var xr=x((jC,Lp)=>{"use strict";var sR=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};Lp.exports=sR});var Qn=x((Et,$p)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:ic,MAX_SAFE_BUILD_LENGTH:aR,MAX_LENGTH:cR}=Er(),uR=xr();Et=$p.exports={};var lR=Et.re=[],dR=Et.safeRe=[],A=Et.src=[],fR=Et.safeSrc=[],O=Et.t={},pR=0,oc="[a-zA-Z0-9-]",hR=[["\\s",1],["\\d",cR],[oc,aR]],gR=e=>{for(let[t,n]of hR)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},G=(e,t,n)=>{let r=gR(t),i=pR++;uR(e,i,t),O[e]=i,A[i]=t,fR[i]=r,lR[i]=new RegExp(t,n?"g":void 0),dR[i]=new RegExp(r,n?"g":void 0)};G("NUMERICIDENTIFIER","0|[1-9]\\d*");G("NUMERICIDENTIFIERLOOSE","\\d+");G("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${oc}*`);G("MAINVERSION",`(${A[O.NUMERICIDENTIFIER]})\\.(${A[O.NUMERICIDENTIFIER]})\\.(${A[O.NUMERICIDENTIFIER]})`);G("MAINVERSIONLOOSE",`(${A[O.NUMERICIDENTIFIERLOOSE]})\\.(${A[O.NUMERICIDENTIFIERLOOSE]})\\.(${A[O.NUMERICIDENTIFIERLOOSE]})`);G("PRERELEASEIDENTIFIER",`(?:${A[O.NONNUMERICIDENTIFIER]}|${A[O.NUMERICIDENTIFIER]})`);G("PRERELEASEIDENTIFIERLOOSE",`(?:${A[O.NONNUMERICIDENTIFIER]}|${A[O.NUMERICIDENTIFIERLOOSE]})`);G("PRERELEASE",`(?:-(${A[O.PRERELEASEIDENTIFIER]}(?:\\.${A[O.PRERELEASEIDENTIFIER]})*))`);G("PRERELEASELOOSE",`(?:-?(${A[O.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${A[O.PRERELEASEIDENTIFIERLOOSE]})*))`);G("BUILDIDENTIFIER",`${oc}+`);G("BUILD",`(?:\\+(${A[O.BUILDIDENTIFIER]}(?:\\.${A[O.BUILDIDENTIFIER]})*))`);G("FULLPLAIN",`v?${A[O.MAINVERSION]}${A[O.PRERELEASE]}?${A[O.BUILD]}?`);G("FULL",`^${A[O.FULLPLAIN]}$`);G("LOOSEPLAIN",`[v=\\s]*${A[O.MAINVERSIONLOOSE]}${A[O.PRERELEASELOOSE]}?${A[O.BUILD]}?`);G("LOOSE",`^${A[O.LOOSEPLAIN]}$`);G("GTLT","((?:<|>)?=?)");G("XRANGEIDENTIFIERLOOSE",`${A[O.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);G("XRANGEIDENTIFIER",`${A[O.NUMERICIDENTIFIER]}|x|X|\\*`);G("XRANGEPLAIN",`[v=\\s]*(${A[O.XRANGEIDENTIFIER]})(?:\\.(${A[O.XRANGEIDENTIFIER]})(?:\\.(${A[O.XRANGEIDENTIFIER]})(?:${A[O.PRERELEASE]})?${A[O.BUILD]}?)?)?`);G("XRANGEPLAINLOOSE",`[v=\\s]*(${A[O.XRANGEIDENTIFIERLOOSE]})(?:\\.(${A[O.XRANGEIDENTIFIERLOOSE]})(?:\\.(${A[O.XRANGEIDENTIFIERLOOSE]})(?:${A[O.PRERELEASELOOSE]})?${A[O.BUILD]}?)?)?`);G("XRANGE",`^${A[O.GTLT]}\\s*${A[O.XRANGEPLAIN]}$`);G("XRANGELOOSE",`^${A[O.GTLT]}\\s*${A[O.XRANGEPLAINLOOSE]}$`);G("COERCEPLAIN",`(^|[^\\d])(\\d{1,${ic}})(?:\\.(\\d{1,${ic}}))?(?:\\.(\\d{1,${ic}}))?`);G("COERCE",`${A[O.COERCEPLAIN]}(?:$|[^\\d])`);G("COERCEFULL",A[O.COERCEPLAIN]+`(?:${A[O.PRERELEASE]})?(?:${A[O.BUILD]})?(?:$|[^\\d])`);G("COERCERTL",A[O.COERCE],!0);G("COERCERTLFULL",A[O.COERCEFULL],!0);G("LONETILDE","(?:~>?)");G("TILDETRIM",`(\\s*)${A[O.LONETILDE]}\\s+`,!0);Et.tildeTrimReplace="$1~";G("TILDE",`^${A[O.LONETILDE]}${A[O.XRANGEPLAIN]}$`);G("TILDELOOSE",`^${A[O.LONETILDE]}${A[O.XRANGEPLAINLOOSE]}$`);G("LONECARET","(?:\\^)");G("CARETTRIM",`(\\s*)${A[O.LONECARET]}\\s+`,!0);Et.caretTrimReplace="$1^";G("CARET",`^${A[O.LONECARET]}${A[O.XRANGEPLAIN]}$`);G("CARETLOOSE",`^${A[O.LONECARET]}${A[O.XRANGEPLAINLOOSE]}$`);G("COMPARATORLOOSE",`^${A[O.GTLT]}\\s*(${A[O.LOOSEPLAIN]})$|^$`);G("COMPARATOR",`^${A[O.GTLT]}\\s*(${A[O.FULLPLAIN]})$|^$`);G("COMPARATORTRIM",`(\\s*)${A[O.GTLT]}\\s*(${A[O.LOOSEPLAIN]}|${A[O.XRANGEPLAIN]})`,!0);Et.comparatorTrimReplace="$1$2$3";G("HYPHENRANGE",`^\\s*(${A[O.XRANGEPLAIN]})\\s+-\\s+(${A[O.XRANGEPLAIN]})\\s*$`);G("HYPHENRANGELOOSE",`^\\s*(${A[O.XRANGEPLAINLOOSE]})\\s+-\\s+(${A[O.XRANGEPLAINLOOSE]})\\s*$`);G("STAR","(<|>)?=?\\s*\\*");G("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");G("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Eo=x((NC,Wp)=>{"use strict";var mR=Object.freeze({loose:!0}),yR=Object.freeze({}),vR=e=>e?typeof e!="object"?mR:e:yR;Wp.exports=vR});var sc=x((IC,Vp)=>{"use strict";var Hp=/^[0-9]+$/,Up=(e,t)=>{let n=Hp.test(e),r=Hp.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1},bR=(e,t)=>Up(t,e);Vp.exports={compareIdentifiers:Up,rcompareIdentifiers:bR}});var $e=x((AC,zp)=>{"use strict";var xo=xr(),{MAX_LENGTH:Bp,MAX_SAFE_INTEGER:So}=Er(),{safeRe:To,t:ko}=Qn(),RR=Eo(),{compareIdentifiers:Zn}=sc(),ac=class e{constructor(t,n){if(n=RR(n),t instanceof e){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>Bp)throw new TypeError(`version is longer than ${Bp} characters`);xo("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let r=t.trim().match(n.loose?To[ko.LOOSE]:To[ko.FULL]);if(!r)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>So||this.major<0)throw new TypeError("Invalid major version");if(this.minor>So||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>So||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let o=+i;if(o>=0&&o<So)return o}return i}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(xo("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if(typeof t=="string"&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),Zn(this.major,t.major)||Zn(this.minor,t.minor)||Zn(this.patch,t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{let r=this.prerelease[n],i=t.prerelease[n];if(xo("prerelease compare",n,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return Zn(r,i)}while(++n)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let n=0;do{let r=this.build[n],i=t.build[n];if(xo("build compare",n,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return Zn(r,i)}while(++n)}inc(t,n,r){if(t.startsWith("pre")){if(!n&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(n){let i=`-${n}`.match(this.options.loose?To[ko.PRERELEASELOOSE]:To[ko.PRERELEASE]);if(!i||i[1]!==n)throw new Error(`invalid identifier: ${n}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,r),this.inc("pre",n,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,r),this.inc("pre",n,r);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(n===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(n){let o=[n,i];r===!1&&(o=[n]),Zn(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};zp.exports=ac});var yn=x((OC,Xp)=>{"use strict";var Gp=$e(),DR=(e,t,n=!1)=>{if(e instanceof Gp)return e;try{return new Gp(e,t)}catch(r){if(!n)return null;throw r}};Xp.exports=DR});var Yp=x((FC,Jp)=>{"use strict";var _R=yn(),wR=(e,t)=>{let n=_R(e,t);return n?n.version:null};Jp.exports=wR});var Zp=x((MC,Qp)=>{"use strict";var PR=yn(),CR=(e,t)=>{let n=PR(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null};Qp.exports=CR});var th=x((LC,eh)=>{"use strict";var Kp=$e(),ER=(e,t,n,r,i)=>{typeof n=="string"&&(i=r,r=n,n=void 0);try{return new Kp(e instanceof Kp?e.version:e,n).inc(t,r,i).version}catch{return null}};eh.exports=ER});var ih=x(($C,rh)=>{"use strict";var nh=yn(),xR=(e,t)=>{let n=nh(e,null,!0),r=nh(t,null,!0),i=n.compare(r);if(i===0)return null;let o=i>0,s=o?n:r,u=o?r:n,d=!!s.prerelease.length;if(!!u.prerelease.length&&!d){if(!u.patch&&!u.minor)return"major";if(u.compareMain(s)===0)return u.minor&&!u.patch?"minor":"patch"}let _=d?"pre":"";return n.major!==r.major?_+"major":n.minor!==r.minor?_+"minor":n.patch!==r.patch?_+"patch":"prerelease"};rh.exports=xR});var sh=x((WC,oh)=>{"use strict";var SR=$e(),TR=(e,t)=>new SR(e,t).major;oh.exports=TR});var ch=x((HC,ah)=>{"use strict";var kR=$e(),qR=(e,t)=>new kR(e,t).minor;ah.exports=qR});var lh=x((UC,uh)=>{"use strict";var jR=$e(),NR=(e,t)=>new jR(e,t).patch;uh.exports=NR});var fh=x((VC,dh)=>{"use strict";var IR=yn(),AR=(e,t)=>{let n=IR(e,t);return n&&n.prerelease.length?n.prerelease:null};dh.exports=AR});var ct=x((BC,hh)=>{"use strict";var ph=$e(),OR=(e,t,n)=>new ph(e,n).compare(new ph(t,n));hh.exports=OR});var mh=x((zC,gh)=>{"use strict";var FR=ct(),MR=(e,t,n)=>FR(t,e,n);gh.exports=MR});var vh=x((GC,yh)=>{"use strict";var LR=ct(),$R=(e,t)=>LR(e,t,!0);yh.exports=$R});var qo=x((XC,Rh)=>{"use strict";var bh=$e(),WR=(e,t,n)=>{let r=new bh(e,n),i=new bh(t,n);return r.compare(i)||r.compareBuild(i)};Rh.exports=WR});var _h=x((JC,Dh)=>{"use strict";var HR=qo(),UR=(e,t)=>e.sort((n,r)=>HR(n,r,t));Dh.exports=UR});var Ph=x((YC,wh)=>{"use strict";var VR=qo(),BR=(e,t)=>e.sort((n,r)=>VR(r,n,t));wh.exports=BR});var Sr=x((QC,Ch)=>{"use strict";var zR=ct(),GR=(e,t,n)=>zR(e,t,n)>0;Ch.exports=GR});var jo=x((ZC,Eh)=>{"use strict";var XR=ct(),JR=(e,t,n)=>XR(e,t,n)<0;Eh.exports=JR});var cc=x((KC,xh)=>{"use strict";var YR=ct(),QR=(e,t,n)=>YR(e,t,n)===0;xh.exports=QR});var uc=x((eE,Sh)=>{"use strict";var ZR=ct(),KR=(e,t,n)=>ZR(e,t,n)!==0;Sh.exports=KR});var No=x((tE,Th)=>{"use strict";var eD=ct(),tD=(e,t,n)=>eD(e,t,n)>=0;Th.exports=tD});var Io=x((nE,kh)=>{"use strict";var nD=ct(),rD=(e,t,n)=>nD(e,t,n)<=0;kh.exports=rD});var lc=x((rE,qh)=>{"use strict";var iD=cc(),oD=uc(),sD=Sr(),aD=No(),cD=jo(),uD=Io(),lD=(e,t,n,r)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e===n;case"!==":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e!==n;case"":case"=":case"==":return iD(e,n,r);case"!=":return oD(e,n,r);case">":return sD(e,n,r);case">=":return aD(e,n,r);case"<":return cD(e,n,r);case"<=":return uD(e,n,r);default:throw new TypeError(`Invalid operator: ${t}`)}};qh.exports=lD});var Nh=x((iE,jh)=>{"use strict";var dD=$e(),fD=yn(),{safeRe:Ao,t:Oo}=Qn(),pD=(e,t)=>{if(e instanceof dD)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let n=null;if(!t.rtl)n=e.match(t.includePrerelease?Ao[Oo.COERCEFULL]:Ao[Oo.COERCE]);else{let d=t.includePrerelease?Ao[Oo.COERCERTLFULL]:Ao[Oo.COERCERTL],p;for(;(p=d.exec(e))&&(!n||n.index+n[0].length!==e.length);)(!n||p.index+p[0].length!==n.index+n[0].length)&&(n=p),d.lastIndex=p.index+p[1].length+p[2].length;d.lastIndex=-1}if(n===null)return null;let r=n[2],i=n[3]||"0",o=n[4]||"0",s=t.includePrerelease&&n[5]?`-${n[5]}`:"",u=t.includePrerelease&&n[6]?`+${n[6]}`:"";return fD(`${r}.${i}.${o}${s}${u}`,t)};jh.exports=pD});var Ah=x((oE,Ih)=>{"use strict";var dc=class{constructor(){this.max=1e3,this.map=new Map}get(t){let n=this.map.get(t);if(n!==void 0)return this.map.delete(t),this.map.set(t,n),n}delete(t){return this.map.delete(t)}set(t,n){if(!this.delete(t)&&n!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(t,n)}return this}};Ih.exports=dc});var ut=x((sE,Lh)=>{"use strict";var hD=/\s+/g,fc=class e{constructor(t,n){if(n=mD(n),t instanceof e)return t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease?t:new e(t.raw,n);if(t instanceof pc)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=t.trim().replace(hD," "),this.set=this.raw.split("||").map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter(i=>!Fh(i[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&wD(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t<this.set.length;t++){t>0&&(this.formatted+="||");let n=this.set[t];for(let r=0;r<n.length;r++)r>0&&(this.formatted+=" "),this.formatted+=n[r].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){let r=((this.options.includePrerelease&&DD)|(this.options.loose&&_D))+":"+t,i=Oh.get(r);if(i)return i;let o=this.options.loose,s=o?Je[We.HYPHENRANGELOOSE]:Je[We.HYPHENRANGE];t=t.replace(s,ND(this.options.includePrerelease)),me("hyphen replace",t),t=t.replace(Je[We.COMPARATORTRIM],vD),me("comparator trim",t),t=t.replace(Je[We.TILDETRIM],bD),me("tilde trim",t),t=t.replace(Je[We.CARETTRIM],RD),me("caret trim",t);let u=t.split(" ").map(w=>PD(w,this.options)).join(" ").split(/\s+/).map(w=>jD(w,this.options));o&&(u=u.filter(w=>(me("loose invalid filter",w,this.options),!!w.match(Je[We.COMPARATORLOOSE])))),me("range list",u);let d=new Map,p=u.map(w=>new pc(w,this.options));for(let w of p){if(Fh(w))return[w];d.set(w.value,w)}d.size>1&&d.has("")&&d.delete("");let _=[...d.values()];return Oh.set(r,_),_}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(r=>Mh(r,n)&&t.set.some(i=>Mh(i,n)&&r.every(o=>i.every(s=>o.intersects(s,n)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new yD(t,this.options)}catch{return!1}for(let n=0;n<this.set.length;n++)if(ID(this.set[n],t,this.options))return!0;return!1}};Lh.exports=fc;var gD=Ah(),Oh=new gD,mD=Eo(),pc=Tr(),me=xr(),yD=$e(),{safeRe:Je,t:We,comparatorTrimReplace:vD,tildeTrimReplace:bD,caretTrimReplace:RD}=Qn(),{FLAG_INCLUDE_PRERELEASE:DD,FLAG_LOOSE:_D}=Er(),Fh=e=>e.value==="<0.0.0-0",wD=e=>e.value==="",Mh=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(o=>i.intersects(o,t)),i=r.pop();return n},PD=(e,t)=>(me("comp",e,t),e=xD(e,t),me("caret",e),e=CD(e,t),me("tildes",e),e=TD(e,t),me("xrange",e),e=qD(e,t),me("stars",e),e),He=e=>!e||e.toLowerCase()==="x"||e==="*",CD=(e,t)=>e.trim().split(/\s+/).map(n=>ED(n,t)).join(" "),ED=(e,t)=>{let n=t.loose?Je[We.TILDELOOSE]:Je[We.TILDE];return e.replace(n,(r,i,o,s,u)=>{me("tilde",e,r,i,o,s,u);let d;return He(i)?d="":He(o)?d=`>=${i}.0.0 <${+i+1}.0.0-0`:He(s)?d=`>=${i}.${o}.0 <${i}.${+o+1}.0-0`:u?(me("replaceTilde pr",u),d=`>=${i}.${o}.${s}-${u} <${i}.${+o+1}.0-0`):d=`>=${i}.${o}.${s} <${i}.${+o+1}.0-0`,me("tilde return",d),d})},xD=(e,t)=>e.trim().split(/\s+/).map(n=>SD(n,t)).join(" "),SD=(e,t)=>{me("caret",e,t);let n=t.loose?Je[We.CARETLOOSE]:Je[We.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,(i,o,s,u,d)=>{me("caret",e,i,o,s,u,d);let p;return He(o)?p="":He(s)?p=`>=${o}.0.0${r} <${+o+1}.0.0-0`:He(u)?o==="0"?p=`>=${o}.${s}.0${r} <${o}.${+s+1}.0-0`:p=`>=${o}.${s}.0${r} <${+o+1}.0.0-0`:d?(me("replaceCaret pr",d),o==="0"?s==="0"?p=`>=${o}.${s}.${u}-${d} <${o}.${s}.${+u+1}-0`:p=`>=${o}.${s}.${u}-${d} <${o}.${+s+1}.0-0`:p=`>=${o}.${s}.${u}-${d} <${+o+1}.0.0-0`):(me("no pr"),o==="0"?s==="0"?p=`>=${o}.${s}.${u}${r} <${o}.${s}.${+u+1}-0`:p=`>=${o}.${s}.${u}${r} <${o}.${+s+1}.0-0`:p=`>=${o}.${s}.${u} <${+o+1}.0.0-0`),me("caret return",p),p})},TD=(e,t)=>(me("replaceXRanges",e,t),e.split(/\s+/).map(n=>kD(n,t)).join(" ")),kD=(e,t)=>{e=e.trim();let n=t.loose?Je[We.XRANGELOOSE]:Je[We.XRANGE];return e.replace(n,(r,i,o,s,u,d)=>{me("xRange",e,r,i,o,s,u,d);let p=He(o),_=p||He(s),w=_||He(u),T=w;return i==="="&&T&&(i=""),d=t.includePrerelease?"-0":"",p?i===">"||i==="<"?r="<0.0.0-0":r="*":i&&T?(_&&(s=0),u=0,i===">"?(i=">=",_?(o=+o+1,s=0,u=0):(s=+s+1,u=0)):i==="<="&&(i="<",_?o=+o+1:s=+s+1),i==="<"&&(d="-0"),r=`${i+o}.${s}.${u}${d}`):_?r=`>=${o}.0.0${d} <${+o+1}.0.0-0`:w&&(r=`>=${o}.${s}.0${d} <${o}.${+s+1}.0-0`),me("xRange return",r),r})},qD=(e,t)=>(me("replaceStars",e,t),e.trim().replace(Je[We.STAR],"")),jD=(e,t)=>(me("replaceGTE0",e,t),e.trim().replace(Je[t.includePrerelease?We.GTE0PRE:We.GTE0],"")),ND=e=>(t,n,r,i,o,s,u,d,p,_,w,T)=>(He(r)?n="":He(i)?n=`>=${r}.0.0${e?"-0":""}`:He(o)?n=`>=${r}.${i}.0${e?"-0":""}`:s?n=`>=${n}`:n=`>=${n}${e?"-0":""}`,He(p)?d="":He(_)?d=`<${+p+1}.0.0-0`:He(w)?d=`<${p}.${+_+1}.0-0`:T?d=`<=${p}.${_}.${w}-${T}`:e?d=`<${p}.${_}.${+w+1}-0`:d=`<=${d}`,`${n} ${d}`.trim()),ID=(e,t,n)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let r=0;r<e.length;r++)if(me(e[r].semver),e[r].semver!==pc.ANY&&e[r].semver.prerelease.length>0){let i=e[r].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}});var Tr=x((aE,Bh)=>{"use strict";var kr=Symbol("SemVer ANY"),mc=class e{static get ANY(){return kr}constructor(t,n){if(n=$h(n),t instanceof e){if(t.loose===!!n.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),gc("comparator",t,n),this.options=n,this.loose=!!n.loose,this.parse(t),this.semver===kr?this.value="":this.value=this.operator+this.semver.version,gc("comp",this)}parse(t){let n=this.options.loose?Wh[Hh.COMPARATORLOOSE]:Wh[Hh.COMPARATOR],r=t.match(n);if(!r)throw new TypeError(`Invalid comparator: ${t}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new Uh(r[2],this.options.loose):this.semver=kr}toString(){return this.value}test(t){if(gc("Comparator.test",t,this.options.loose),this.semver===kr||t===kr)return!0;if(typeof t=="string")try{t=new Uh(t,this.options)}catch{return!1}return hc(t,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Vh(t.value,n).test(this.value):t.operator===""?t.value===""?!0:new Vh(this.value,n).test(t.semver):(n=$h(n),n.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||hc(this.semver,"<",t.semver,n)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||hc(this.semver,">",t.semver,n)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};Bh.exports=mc;var $h=Eo(),{safeRe:Wh,t:Hh}=Qn(),hc=lc(),gc=xr(),Uh=$e(),Vh=ut()});var qr=x((cE,zh)=>{"use strict";var AD=ut(),OD=(e,t,n)=>{try{t=new AD(t,n)}catch{return!1}return t.test(e)};zh.exports=OD});var Xh=x((uE,Gh)=>{"use strict";var FD=ut(),MD=(e,t)=>new FD(e,t).set.map(n=>n.map(r=>r.value).join(" ").trim().split(" "));Gh.exports=MD});var Yh=x((lE,Jh)=>{"use strict";var LD=$e(),$D=ut(),WD=(e,t,n)=>{let r=null,i=null,o=null;try{o=new $D(t,n)}catch{return null}return e.forEach(s=>{o.test(s)&&(!r||i.compare(s)===-1)&&(r=s,i=new LD(r,n))}),r};Jh.exports=WD});var Zh=x((dE,Qh)=>{"use strict";var HD=$e(),UD=ut(),VD=(e,t,n)=>{let r=null,i=null,o=null;try{o=new UD(t,n)}catch{return null}return e.forEach(s=>{o.test(s)&&(!r||i.compare(s)===1)&&(r=s,i=new HD(r,n))}),r};Qh.exports=VD});var tg=x((fE,eg)=>{"use strict";var yc=$e(),BD=ut(),Kh=Sr(),zD=(e,t)=>{e=new BD(e,t);let n=new yc("0.0.0");if(e.test(n)||(n=new yc("0.0.0-0"),e.test(n)))return n;n=null;for(let r=0;r<e.set.length;++r){let i=e.set[r],o=null;i.forEach(s=>{let u=new yc(s.semver.version);switch(s.operator){case">":u.prerelease.length===0?u.patch++:u.prerelease.push(0),u.raw=u.format();case"":case">=":(!o||Kh(u,o))&&(o=u);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!n||Kh(n,o))&&(n=o)}return n&&e.test(n)?n:null};eg.exports=zD});var rg=x((pE,ng)=>{"use strict";var GD=ut(),XD=(e,t)=>{try{return new GD(e,t).range||"*"}catch{return null}};ng.exports=XD});var Fo=x((hE,ag)=>{"use strict";var JD=$e(),sg=Tr(),{ANY:YD}=sg,QD=ut(),ZD=qr(),ig=Sr(),og=jo(),KD=Io(),e_=No(),t_=(e,t,n,r)=>{e=new JD(e,r),t=new QD(t,r);let i,o,s,u,d;switch(n){case">":i=ig,o=KD,s=og,u=">",d=">=";break;case"<":i=og,o=e_,s=ig,u="<",d="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ZD(e,t,r))return!1;for(let p=0;p<t.set.length;++p){let _=t.set[p],w=null,T=null;if(_.forEach(P=>{P.semver===YD&&(P=new sg(">=0.0.0")),w=w||P,T=T||P,i(P.semver,w.semver,r)?w=P:s(P.semver,T.semver,r)&&(T=P)}),w.operator===u||w.operator===d||(!T.operator||T.operator===u)&&o(e,T.semver))return!1;if(T.operator===d&&s(e,T.semver))return!1}return!0};ag.exports=t_});var ug=x((gE,cg)=>{"use strict";var n_=Fo(),r_=(e,t,n)=>n_(e,t,">",n);cg.exports=r_});var dg=x((mE,lg)=>{"use strict";var i_=Fo(),o_=(e,t,n)=>i_(e,t,"<",n);lg.exports=o_});var hg=x((yE,pg)=>{"use strict";var fg=ut(),s_=(e,t,n)=>(e=new fg(e,n),t=new fg(t,n),e.intersects(t,n));pg.exports=s_});var mg=x((vE,gg)=>{"use strict";var a_=qr(),c_=ct();gg.exports=(e,t,n)=>{let r=[],i=null,o=null,s=e.sort((_,w)=>c_(_,w,n));for(let _ of s)a_(_,t,n)?(o=_,i||(i=_)):(o&&r.push([i,o]),o=null,i=null);i&&r.push([i,null]);let u=[];for(let[_,w]of r)_===w?u.push(_):!w&&_===s[0]?u.push("*"):w?_===s[0]?u.push(`<=${w}`):u.push(`${_} - ${w}`):u.push(`>=${_}`);let d=u.join(" || "),p=typeof t.raw=="string"?t.raw:String(t);return d.length<p.length?d:t}});var _g=x((bE,Dg)=>{"use strict";var yg=ut(),bc=Tr(),{ANY:vc}=bc,jr=qr(),Rc=ct(),u_=(e,t,n={})=>{if(e===t)return!0;e=new yg(e,n),t=new yg(t,n);let r=!1;e:for(let i of e.set){for(let o of t.set){let s=d_(i,o,n);if(r=r||s!==null,s)continue e}if(r)return!1}return!0},l_=[new bc(">=0.0.0-0")],vg=[new bc(">=0.0.0")],d_=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===vc){if(t.length===1&&t[0].semver===vc)return!0;n.includePrerelease?e=l_:e=vg}if(t.length===1&&t[0].semver===vc){if(n.includePrerelease)return!0;t=vg}let r=new Set,i,o;for(let P of e)P.operator===">"||P.operator===">="?i=bg(i,P,n):P.operator==="<"||P.operator==="<="?o=Rg(o,P,n):r.add(P.semver);if(r.size>1)return null;let s;if(i&&o){if(s=Rc(i.semver,o.semver,n),s>0)return null;if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(let P of r){if(i&&!jr(P,String(i),n)||o&&!jr(P,String(o),n))return null;for(let L of t)if(!jr(P,String(L),n))return!1;return!0}let u,d,p,_,w=o&&!n.includePrerelease&&o.semver.prerelease.length?o.semver:!1,T=i&&!n.includePrerelease&&i.semver.prerelease.length?i.semver:!1;w&&w.prerelease.length===1&&o.operator==="<"&&w.prerelease[0]===0&&(w=!1);for(let P of t){if(_=_||P.operator===">"||P.operator===">=",p=p||P.operator==="<"||P.operator==="<=",i){if(T&&P.semver.prerelease&&P.semver.prerelease.length&&P.semver.major===T.major&&P.semver.minor===T.minor&&P.semver.patch===T.patch&&(T=!1),P.operator===">"||P.operator===">="){if(u=bg(i,P,n),u===P&&u!==i)return!1}else if(i.operator===">="&&!jr(i.semver,String(P),n))return!1}if(o){if(w&&P.semver.prerelease&&P.semver.prerelease.length&&P.semver.major===w.major&&P.semver.minor===w.minor&&P.semver.patch===w.patch&&(w=!1),P.operator==="<"||P.operator==="<="){if(d=Rg(o,P,n),d===P&&d!==o)return!1}else if(o.operator==="<="&&!jr(o.semver,String(P),n))return!1}if(!P.operator&&(o||i)&&s!==0)return!1}return!(i&&p&&!o&&s!==0||o&&_&&!i&&s!==0||T||w)},bg=(e,t,n)=>{if(!e)return t;let r=Rc(e.semver,t.semver,n);return r>0?e:r<0||t.operator===">"&&e.operator===">="?t:e},Rg=(e,t,n)=>{if(!e)return t;let r=Rc(e.semver,t.semver,n);return r<0?e:r>0||t.operator==="<"&&e.operator==="<="?t:e};Dg.exports=u_});var Nr=x((RE,Cg)=>{"use strict";var Dc=Qn(),wg=Er(),f_=$e(),Pg=sc(),p_=yn(),h_=Yp(),g_=Zp(),m_=th(),y_=ih(),v_=sh(),b_=ch(),R_=lh(),D_=fh(),__=ct(),w_=mh(),P_=vh(),C_=qo(),E_=_h(),x_=Ph(),S_=Sr(),T_=jo(),k_=cc(),q_=uc(),j_=No(),N_=Io(),I_=lc(),A_=Nh(),O_=Tr(),F_=ut(),M_=qr(),L_=Xh(),$_=Yh(),W_=Zh(),H_=tg(),U_=rg(),V_=Fo(),B_=ug(),z_=dg(),G_=hg(),X_=mg(),J_=_g();Cg.exports={parse:p_,valid:h_,clean:g_,inc:m_,diff:y_,major:v_,minor:b_,patch:R_,prerelease:D_,compare:__,rcompare:w_,compareLoose:P_,compareBuild:C_,sort:E_,rsort:x_,gt:S_,lt:T_,eq:k_,neq:q_,gte:j_,lte:N_,cmp:I_,coerce:A_,Comparator:O_,Range:F_,satisfies:M_,toComparators:L_,maxSatisfying:$_,minSatisfying:W_,minVersion:H_,validRange:U_,outside:V_,gtr:B_,ltr:z_,intersects:G_,simplifyRange:X_,subset:J_,SemVer:f_,re:Dc.re,src:Dc.src,tokens:Dc.t,SEMVER_SPEC_VERSION:wg.SEMVER_SPEC_VERSION,RELEASE_TYPES:wg.RELEASE_TYPES,compareIdentifiers:Pg.compareIdentifiers,rcompareIdentifiers:Pg.rcompareIdentifiers}});var qy=te(require("fs")),jy=te(require("path"));var Rn=te(require("process")),I=te(pe()),rn=te(Fp()),rs=te(Ti()),oe=te(require("path")),su=te(Nr()),Se=te(require("fs")),tt=te(pe());var Mr=te(require("fs")),Ie=te(require("path"));var Ye=te(require("path"));var _c=process.arch=="arm64"?process.platform+process.arch:process.platform,W="2.0",Eg="rescript-editor-analysis.exe",wc=Ye.join(Ye.dirname(__dirname),"..",Eg),Pc=Ye.join(Ye.dirname(__dirname),"analysis_binaries",_c,Eg);var xg=Ye.join("node_modules",".bin"),Sg=".bsb.lock",Ir="bsconfig.json",Ar="rescript.json",nn=Ye.join("lib","bs"),Tg=Ye.join("lib","ocaml"),Cc=Ye.join("lib","bs",".compiler.log"),Mo=Ye.join("lib","bs","compiler-info.json"),Lo=Ye.join("lib","bs","build.ninja"),Ec=Ye.join("lib","rewatch.lock"),xc=Ye.join("lib","rescript.lock"),xt=".res",Or=".resi",kg=".cmi",Sc="Start Build",qg="commonjs",jg=".js",Tc="rescript_configuration_request",Ng=1e4;var Y_=e=>{switch(e){case"esmodule":case"es6":return"es6";case"es6-global":return"es6_global";case"commonjs":default:return"js"}},Wo=(e,t)=>{let n=Ie.basename(e,Ie.extname(e));return Ie.format({dir:Ie.dirname(e),name:n,ext:t})},Fr=(e,t)=>{if(e==null)return null;let n=Ie.join(e,t);if(Mr.existsSync(n))return n;let r=Ie.dirname(e);return r===e?null:Fr(r,t)},Ho=e=>{try{let t=Ie.join(e,Ar),n=Ie.join(e,Ir),r=Mr.readFileSync(Mr.existsSync(t)?t:n,{encoding:"utf-8"});return JSON.parse(r)}catch{return null}},Ig=e=>{let t=e["package-specs"],n="",r=qg,i={module:r},o=jg;return t&&(!Array.isArray(t)&&typeof t!="string"&&t.module?i=t:typeof t=="string"?r=t:Array.isArray(t)&&t[0]&&(typeof t[0]=="string"?r=t[0]:i=t[0])),i.module&&(r=i.module),i["in-source"]||(n="lib/"+Y_(r)),i.suffix?o=i.suffix:e.suffix&&(o=e.suffix),[o,n]},Ag=(e,t)=>{let n=Ho(e);if(!n)return null;let[r,i]=Ig(n),o=Wo(t,r);return Ie.join(e,i,o)},Og=(e,t)=>{let n=Fr(Ie.join("..",e),Ar);if(n||(n=Fr(Ie.join("..",e),Ir)),!n)return null;let r=Ho(Ie.dirname(n));if(!r)return null;let[i,o]=Ig(r),s=Wo(t,i);return Ie.join(e,o,s)};var Mt=te(require("child_process")),Re=te(require("path"));var Mg;(function(e){function t(n){return typeof n=="string"}e.is=t})(Mg||(Mg={}));var kc;(function(e){function t(n){return typeof n=="string"}e.is=t})(kc||(kc={}));var Lg;(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(n){return typeof n=="number"&&e.MIN_VALUE<=n&&n<=e.MAX_VALUE}e.is=t})(Lg||(Lg={}));var Uo;(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(n){return typeof n=="number"&&e.MIN_VALUE<=n&&n<=e.MAX_VALUE}e.is=t})(Uo||(Uo={}));var vt;(function(e){function t(r,i){return r===Number.MAX_VALUE&&(r=Uo.MAX_VALUE),i===Number.MAX_VALUE&&(i=Uo.MAX_VALUE),{line:r,character:i}}e.create=t;function n(r){let i=r;return D.objectLiteral(i)&&D.uinteger(i.line)&&D.uinteger(i.character)}e.is=n})(vt||(vt={}));var Ee;(function(e){function t(r,i,o,s){if(D.uinteger(r)&&D.uinteger(i)&&D.uinteger(o)&&D.uinteger(s))return{start:vt.create(r,i),end:vt.create(o,s)};if(vt.is(r)&&vt.is(i))return{start:r,end:i};throw new Error(`Range#create called with invalid arguments[${r}, ${i}, ${o}, ${s}]`)}e.create=t;function n(r){let i=r;return D.objectLiteral(i)&&vt.is(i.start)&&vt.is(i.end)}e.is=n})(Ee||(Ee={}));var Vo;(function(e){function t(r,i){return{uri:r,range:i}}e.create=t;function n(r){let i=r;return D.objectLiteral(i)&&Ee.is(i.range)&&(D.string(i.uri)||D.undefined(i.uri))}e.is=n})(Vo||(Vo={}));var $g;(function(e){function t(r,i,o,s){return{targetUri:r,targetRange:i,targetSelectionRange:o,originSelectionRange:s}}e.create=t;function n(r){let i=r;return D.objectLiteral(i)&&Ee.is(i.targetRange)&&D.string(i.targetUri)&&Ee.is(i.targetSelectionRange)&&(Ee.is(i.originSelectionRange)||D.undefined(i.originSelectionRange))}e.is=n})($g||($g={}));var qc;(function(e){function t(r,i,o,s){return{red:r,green:i,blue:o,alpha:s}}e.create=t;function n(r){let i=r;return D.objectLiteral(i)&&D.numberRange(i.red,0,1)&&D.numberRange(i.green,0,1)&&D.numberRange(i.blue,0,1)&&D.numberRange(i.alpha,0,1)}e.is=n})(qc||(qc={}));var Wg;(function(e){function t(r,i){return{range:r,color:i}}e.create=t;function n(r){let i=r;return D.objectLiteral(i)&&Ee.is(i.range)&&qc.is(i.color)}e.is=n})(Wg||(Wg={}));var Hg;(function(e){function t(r,i,o){return{label:r,textEdit:i,additionalTextEdits:o}}e.create=t;function n(r){let i=r;return D.objectLiteral(i)&&D.string(i.label)&&(D.undefined(i.textEdit)||er.is(i))&&(D.undefined(i.additionalTextEdits)||D.typedArray(i.additionalTextEdits,er.is))}e.is=n})(Hg||(Hg={}));var Ug;(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(Ug||(Ug={}));var Vg;(function(e){function t(r,i,o,s,u,d){let p={startLine:r,endLine:i};return D.defined(o)&&(p.startCharacter=o),D.defined(s)&&(p.endCharacter=s),D.defined(u)&&(p.kind=u),D.defined(d)&&(p.collapsedText=d),p}e.create=t;function n(r){let i=r;return D.objectLiteral(i)&&D.uinteger(i.startLine)&&D.uinteger(i.startLine)&&(D.undefined(i.startCharacter)||D.uinteger(i.startCharacter))&&(D.undefined(i.endCharacter)||D.uinteger(i.endCharacter))&&(D.undefined(i.kind)||D.string(i.kind))}e.is=n})(Vg||(Vg={}));var jc;(function(e){function t(r,i){return{location:r,message:i}}e.create=t;function n(r){let i=r;return D.defined(i)&&Vo.is(i.location)&&D.string(i.message)}e.is=n})(jc||(jc={}));var bt;(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(bt||(bt={}));var Lr;(function(e){e.Unnecessary=1,e.Deprecated=2})(Lr||(Lr={}));var Bg;(function(e){function t(n){let r=n;return D.objectLiteral(r)&&D.string(r.href)}e.is=t})(Bg||(Bg={}));var Bo;(function(e){function t(r,i,o,s,u,d){let p={range:r,message:i};return D.defined(o)&&(p.severity=o),D.defined(s)&&(p.code=s),D.defined(u)&&(p.source=u),D.defined(d)&&(p.relatedInformation=d),p}e.create=t;function n(r){var i;let o=r;return D.defined(o)&&Ee.is(o.range)&&D.string(o.message)&&(D.number(o.severity)||D.undefined(o.severity))&&(D.integer(o.code)||D.string(o.code)||D.undefined(o.code))&&(D.undefined(o.codeDescription)||D.string((i=o.codeDescription)===null||i===void 0?void 0:i.href))&&(D.string(o.source)||D.undefined(o.source))&&(D.undefined(o.relatedInformation)||D.typedArray(o.relatedInformation,jc.is))}e.is=n})(Bo||(Bo={}));var Kn;(function(e){function t(r,i,...o){let s={title:r,command:i};return D.defined(o)&&o.length>0&&(s.arguments=o),s}e.create=t;function n(r){let i=r;return D.defined(i)&&D.string(i.title)&&D.string(i.command)}e.is=n})(Kn||(Kn={}));var er;(function(e){function t(o,s){return{range:o,newText:s}}e.replace=t;function n(o,s){return{range:{start:o,end:o},newText:s}}e.insert=n;function r(o){return{range:o,newText:""}}e.del=r;function i(o){let s=o;return D.objectLiteral(s)&&D.string(s.newText)&&Ee.is(s.range)}e.is=i})(er||(er={}));var Nc;(function(e){function t(r,i,o){let s={label:r};return i!==void 0&&(s.needsConfirmation=i),o!==void 0&&(s.description=o),s}e.create=t;function n(r){let i=r;return D.objectLiteral(i)&&D.string(i.label)&&(D.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(D.string(i.description)||i.description===void 0)}e.is=n})(Nc||(Nc={}));var tr;(function(e){function t(n){let r=n;return D.string(r)}e.is=t})(tr||(tr={}));var zg;(function(e){function t(o,s,u){return{range:o,newText:s,annotationId:u}}e.replace=t;function n(o,s,u){return{range:{start:o,end:o},newText:s,annotationId:u}}e.insert=n;function r(o,s){return{range:o,newText:"",annotationId:s}}e.del=r;function i(o){let s=o;return er.is(s)&&(Nc.is(s.annotationId)||tr.is(s.annotationId))}e.is=i})(zg||(zg={}));var Ic;(function(e){function t(r,i){return{textDocument:r,edits:i}}e.create=t;function n(r){let i=r;return D.defined(i)&&Lc.is(i.textDocument)&&Array.isArray(i.edits)}e.is=n})(Ic||(Ic={}));var Ac;(function(e){function t(r,i,o){let s={kind:"create",uri:r};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(s.options=i),o!==void 0&&(s.annotationId=o),s}e.create=t;function n(r){let i=r;return i&&i.kind==="create"&&D.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||D.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||D.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||tr.is(i.annotationId))}e.is=n})(Ac||(Ac={}));var Oc;(function(e){function t(r,i,o,s){let u={kind:"rename",oldUri:r,newUri:i};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(u.options=o),s!==void 0&&(u.annotationId=s),u}e.create=t;function n(r){let i=r;return i&&i.kind==="rename"&&D.string(i.oldUri)&&D.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||D.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||D.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||tr.is(i.annotationId))}e.is=n})(Oc||(Oc={}));var Fc;(function(e){function t(r,i,o){let s={kind:"delete",uri:r};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(s.options=i),o!==void 0&&(s.annotationId=o),s}e.create=t;function n(r){let i=r;return i&&i.kind==="delete"&&D.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||D.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||D.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||tr.is(i.annotationId))}e.is=n})(Fc||(Fc={}));var Mc;(function(e){function t(n){let r=n;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(i=>D.string(i.kind)?Ac.is(i)||Oc.is(i)||Fc.is(i):Ic.is(i)))}e.is=t})(Mc||(Mc={}));var Gg;(function(e){function t(r){return{uri:r}}e.create=t;function n(r){let i=r;return D.defined(i)&&D.string(i.uri)}e.is=n})(Gg||(Gg={}));var Xg;(function(e){function t(r,i){return{uri:r,version:i}}e.create=t;function n(r){let i=r;return D.defined(i)&&D.string(i.uri)&&D.integer(i.version)}e.is=n})(Xg||(Xg={}));var Lc;(function(e){function t(r,i){return{uri:r,version:i}}e.create=t;function n(r){let i=r;return D.defined(i)&&D.string(i.uri)&&(i.version===null||D.integer(i.version))}e.is=n})(Lc||(Lc={}));var Jg;(function(e){function t(r,i,o,s){return{uri:r,languageId:i,version:o,text:s}}e.create=t;function n(r){let i=r;return D.defined(i)&&D.string(i.uri)&&D.string(i.languageId)&&D.integer(i.version)&&D.string(i.text)}e.is=n})(Jg||(Jg={}));var $c;(function(e){e.PlainText="plaintext",e.Markdown="markdown";function t(n){let r=n;return r===e.PlainText||r===e.Markdown}e.is=t})($c||($c={}));var $r;(function(e){function t(n){let r=n;return D.objectLiteral(n)&&$c.is(r.kind)&&D.string(r.value)}e.is=t})($r||($r={}));var Yg;(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(Yg||(Yg={}));var Qg;(function(e){e.PlainText=1,e.Snippet=2})(Qg||(Qg={}));var Zg;(function(e){e.Deprecated=1})(Zg||(Zg={}));var Kg;(function(e){function t(r,i,o){return{newText:r,insert:i,replace:o}}e.create=t;function n(r){let i=r;return i&&D.string(i.newText)&&Ee.is(i.insert)&&Ee.is(i.replace)}e.is=n})(Kg||(Kg={}));var em;(function(e){e.asIs=1,e.adjustIndentation=2})(em||(em={}));var tm;(function(e){function t(n){let r=n;return r&&(D.string(r.detail)||r.detail===void 0)&&(D.string(r.description)||r.description===void 0)}e.is=t})(tm||(tm={}));var nm;(function(e){function t(n){return{label:n}}e.create=t})(nm||(nm={}));var rm;(function(e){function t(n,r){return{items:n||[],isIncomplete:!!r}}e.create=t})(rm||(rm={}));var zo;(function(e){function t(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}e.fromPlainText=t;function n(r){let i=r;return D.string(i)||D.objectLiteral(i)&&D.string(i.language)&&D.string(i.value)}e.is=n})(zo||(zo={}));var im;(function(e){function t(n){let r=n;return!!r&&D.objectLiteral(r)&&($r.is(r.contents)||zo.is(r.contents)||D.typedArray(r.contents,zo.is))&&(n.range===void 0||Ee.is(n.range))}e.is=t})(im||(im={}));var om;(function(e){function t(n,r){return r?{label:n,documentation:r}:{label:n}}e.create=t})(om||(om={}));var sm;(function(e){function t(n,r,...i){let o={label:n};return D.defined(r)&&(o.documentation=r),D.defined(i)?o.parameters=i:o.parameters=[],o}e.create=t})(sm||(sm={}));var am;(function(e){e.Text=1,e.Read=2,e.Write=3})(am||(am={}));var cm;(function(e){function t(n,r){let i={range:n};return D.number(r)&&(i.kind=r),i}e.create=t})(cm||(cm={}));var um;(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(um||(um={}));var lm;(function(e){e.Deprecated=1})(lm||(lm={}));var dm;(function(e){function t(n,r,i,o,s){let u={name:n,kind:r,location:{uri:o,range:i}};return s&&(u.containerName=s),u}e.create=t})(dm||(dm={}));var fm;(function(e){function t(n,r,i,o){return o!==void 0?{name:n,kind:r,location:{uri:i,range:o}}:{name:n,kind:r,location:{uri:i}}}e.create=t})(fm||(fm={}));var pm;(function(e){function t(r,i,o,s,u,d){let p={name:r,detail:i,kind:o,range:s,selectionRange:u};return d!==void 0&&(p.children=d),p}e.create=t;function n(r){let i=r;return i&&D.string(i.name)&&D.number(i.kind)&&Ee.is(i.range)&&Ee.is(i.selectionRange)&&(i.detail===void 0||D.string(i.detail))&&(i.deprecated===void 0||D.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}e.is=n})(pm||(pm={}));var hm;(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(hm||(hm={}));var Go;(function(e){e.Invoked=1,e.Automatic=2})(Go||(Go={}));var gm;(function(e){function t(r,i,o){let s={diagnostics:r};return i!=null&&(s.only=i),o!=null&&(s.triggerKind=o),s}e.create=t;function n(r){let i=r;return D.defined(i)&&D.typedArray(i.diagnostics,Bo.is)&&(i.only===void 0||D.typedArray(i.only,D.string))&&(i.triggerKind===void 0||i.triggerKind===Go.Invoked||i.triggerKind===Go.Automatic)}e.is=n})(gm||(gm={}));var mm;(function(e){function t(r,i,o){let s={title:r},u=!0;return typeof i=="string"?(u=!1,s.kind=i):Kn.is(i)?s.command=i:s.edit=i,u&&o!==void 0&&(s.kind=o),s}e.create=t;function n(r){let i=r;return i&&D.string(i.title)&&(i.diagnostics===void 0||D.typedArray(i.diagnostics,Bo.is))&&(i.kind===void 0||D.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Kn.is(i.command))&&(i.isPreferred===void 0||D.boolean(i.isPreferred))&&(i.edit===void 0||Mc.is(i.edit))}e.is=n})(mm||(mm={}));var ym;(function(e){function t(r,i){let o={range:r};return D.defined(i)&&(o.data=i),o}e.create=t;function n(r){let i=r;return D.defined(i)&&Ee.is(i.range)&&(D.undefined(i.command)||Kn.is(i.command))}e.is=n})(ym||(ym={}));var vm;(function(e){function t(r,i){return{tabSize:r,insertSpaces:i}}e.create=t;function n(r){let i=r;return D.defined(i)&&D.uinteger(i.tabSize)&&D.boolean(i.insertSpaces)}e.is=n})(vm||(vm={}));var bm;(function(e){function t(r,i,o){return{range:r,target:i,data:o}}e.create=t;function n(r){let i=r;return D.defined(i)&&Ee.is(i.range)&&(D.undefined(i.target)||D.string(i.target))}e.is=n})(bm||(bm={}));var Rm;(function(e){function t(r,i){return{range:r,parent:i}}e.create=t;function n(r){let i=r;return D.objectLiteral(i)&&Ee.is(i.range)&&(i.parent===void 0||e.is(i.parent))}e.is=n})(Rm||(Rm={}));var Dm;(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"})(Dm||(Dm={}));var _m;(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(_m||(_m={}));var wm;(function(e){function t(n){let r=n;return D.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}e.is=t})(wm||(wm={}));var Pm;(function(e){function t(r,i){return{range:r,text:i}}e.create=t;function n(r){let i=r;return i!=null&&Ee.is(i.range)&&D.string(i.text)}e.is=n})(Pm||(Pm={}));var Cm;(function(e){function t(r,i,o){return{range:r,variableName:i,caseSensitiveLookup:o}}e.create=t;function n(r){let i=r;return i!=null&&Ee.is(i.range)&&D.boolean(i.caseSensitiveLookup)&&(D.string(i.variableName)||i.variableName===void 0)}e.is=n})(Cm||(Cm={}));var Em;(function(e){function t(r,i){return{range:r,expression:i}}e.create=t;function n(r){let i=r;return i!=null&&Ee.is(i.range)&&(D.string(i.expression)||i.expression===void 0)}e.is=n})(Em||(Em={}));var xm;(function(e){function t(r,i){return{frameId:r,stoppedLocation:i}}e.create=t;function n(r){let i=r;return D.defined(i)&&Ee.is(r.stoppedLocation)}e.is=n})(xm||(xm={}));var Wc;(function(e){e.Type=1,e.Parameter=2;function t(n){return n===1||n===2}e.is=t})(Wc||(Wc={}));var Hc;(function(e){function t(r){return{value:r}}e.create=t;function n(r){let i=r;return D.objectLiteral(i)&&(i.tooltip===void 0||D.string(i.tooltip)||$r.is(i.tooltip))&&(i.location===void 0||Vo.is(i.location))&&(i.command===void 0||Kn.is(i.command))}e.is=n})(Hc||(Hc={}));var Sm;(function(e){function t(r,i,o){let s={position:r,label:i};return o!==void 0&&(s.kind=o),s}e.create=t;function n(r){let i=r;return D.objectLiteral(i)&&vt.is(i.position)&&(D.string(i.label)||D.typedArray(i.label,Hc.is))&&(i.kind===void 0||Wc.is(i.kind))&&i.textEdits===void 0||D.typedArray(i.textEdits,er.is)&&(i.tooltip===void 0||D.string(i.tooltip)||$r.is(i.tooltip))&&(i.paddingLeft===void 0||D.boolean(i.paddingLeft))&&(i.paddingRight===void 0||D.boolean(i.paddingRight))}e.is=n})(Sm||(Sm={}));var Tm;(function(e){function t(n){return{kind:"snippet",value:n}}e.createSnippet=t})(Tm||(Tm={}));var km;(function(e){function t(n,r,i,o){return{insertText:n,filterText:r,range:i,command:o}}e.create=t})(km||(km={}));var qm;(function(e){function t(n){return{items:n}}e.create=t})(qm||(qm={}));var jm;(function(e){e.Invoked=0,e.Automatic=1})(jm||(jm={}));var Nm;(function(e){function t(n,r){return{range:n,text:r}}e.create=t})(Nm||(Nm={}));var Im;(function(e){function t(n,r){return{triggerKind:n,selectedCompletionInfo:r}}e.create=t})(Im||(Im={}));var Am;(function(e){function t(n){let r=n;return D.objectLiteral(r)&&kc.is(r.uri)&&D.string(r.name)}e.is=t})(Am||(Am={}));var Om;(function(e){function t(o,s,u,d){return new Uc(o,s,u,d)}e.create=t;function n(o){let s=o;return!!(D.defined(s)&&D.string(s.uri)&&(D.undefined(s.languageId)||D.string(s.languageId))&&D.uinteger(s.lineCount)&&D.func(s.getText)&&D.func(s.positionAt)&&D.func(s.offsetAt))}e.is=n;function r(o,s){let u=o.getText(),d=i(s,(_,w)=>{let T=_.range.start.line-w.range.start.line;return T===0?_.range.start.character-w.range.start.character:T}),p=u.length;for(let _=d.length-1;_>=0;_--){let w=d[_],T=o.offsetAt(w.range.start),P=o.offsetAt(w.range.end);if(P<=p)u=u.substring(0,T)+w.newText+u.substring(P,u.length);else throw new Error("Overlapping edit");p=T}return u}e.applyEdits=r;function i(o,s){if(o.length<=1)return o;let u=o.length/2|0,d=o.slice(0,u),p=o.slice(u);i(d,s),i(p,s);let _=0,w=0,T=0;for(;_<d.length&&w<p.length;)s(d[_],p[w])<=0?o[T++]=d[_++]:o[T++]=p[w++];for(;_<d.length;)o[T++]=d[_++];for(;w<p.length;)o[T++]=p[w++];return o}})(Om||(Om={}));var Uc=class{constructor(t,n,r,i){this._uri=t,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(t){if(t){let n=this.offsetAt(t.start),r=this.offsetAt(t.end);return this._content.substring(n,r)}return this._content}update(t,n){this._content=t.text,this._version=n,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let t=[],n=this._content,r=!0;for(let i=0;i<n.length;i++){r&&(t.push(i),r=!1);let o=n.charAt(i);r=o==="\r"||o===`
|
|
36
|
+
`&&a++}l&&m.length>0&&g.push(m.length),this._lineOffsets=g}return this._lineOffsets},c.prototype.positionAt=function(g){g=Math.max(Math.min(g,this._content.length),0);var m=this.getLineOffsets(),l=0,a=m.length;if(a===0)return s.create(0,g);for(;l<a;){var b=Math.floor((l+a)/2);m[b]>g?a=b:l=b+1}var S=l-1;return s.create(S,g-m[S])},c.prototype.offsetAt=function(g){var m=this.getLineOffsets();if(g.line>=m.length)return this._content.length;if(g.line<0)return 0;var l=m[g.line],a=g.line+1<m.length?m[g.line+1]:this._content.length;return Math.max(Math.min(l+g.character,a),l)},Object.defineProperty(c.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),c}(),R;(function(c){var g=Object.prototype.toString;function m(Q){return typeof Q<"u"}c.defined=m;function l(Q){return typeof Q>"u"}c.undefined=l;function a(Q){return Q===!0||Q===!1}c.boolean=a;function b(Q){return g.call(Q)==="[object String]"}c.string=b;function S(Q){return g.call(Q)==="[object Number]"}c.number=S;function B(Q,Sn,ai){return g.call(Q)==="[object Number]"&&Sn<=Q&&Q<=ai}c.numberRange=B;function Pe(Q){return g.call(Q)==="[object Number]"&&-2147483648<=Q&&Q<=2147483647}c.integer=Pe;function de(Q){return g.call(Q)==="[object Number]"&&0<=Q&&Q<=2147483647}c.uinteger=de;function ht(Q){return g.call(Q)==="[object Function]"}c.func=ht;function gt(Q){return Q!==null&&typeof Q=="object"}c.objectLiteral=gt;function Nt(Q,Sn){return Array.isArray(Q)&&Q.every(Sn)}c.typedArray=Nt})(R||(R={}))})});var be=x(Be=>{"use strict";Object.defineProperty(Be,"__esModule",{value:!0});Be.ProtocolNotificationType=Be.ProtocolNotificationType0=Be.ProtocolRequestType=Be.ProtocolRequestType0=Be.RegistrationType=Be.MessageDirection=void 0;var Fn=fn(),zu;(function(e){e.clientToServer="clientToServer",e.serverToClient="serverToClient",e.both="both"})(zu||(Be.MessageDirection=zu={}));var ya=class{constructor(t){this.method=t}};Be.RegistrationType=ya;var va=class extends Fn.RequestType0{constructor(t){super(t)}};Be.ProtocolRequestType0=va;var ba=class extends Fn.RequestType{constructor(t){super(t,Fn.ParameterStructures.byName)}};Be.ProtocolRequestType=ba;var Ra=class extends Fn.NotificationType0{constructor(t){super(t)}};Be.ProtocolNotificationType0=Ra;var Da=class extends Fn.NotificationType{constructor(t){super(t,Fn.ParameterStructures.byName)}};Be.ProtocolNotificationType=Da});var ji=x(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.objectLiteral=Te.typedArray=Te.stringArray=Te.array=Te.func=Te.error=Te.number=Te.string=Te.boolean=void 0;function Dv(e){return e===!0||e===!1}Te.boolean=Dv;function Gu(e){return typeof e=="string"||e instanceof String}Te.string=Gu;function _v(e){return typeof e=="number"||e instanceof Number}Te.number=_v;function wv(e){return e instanceof Error}Te.error=wv;function Pv(e){return typeof e=="function"}Te.func=Pv;function Xu(e){return Array.isArray(e)}Te.array=Xu;function Cv(e){return Xu(e)&&e.every(t=>Gu(t))}Te.stringArray=Cv;function Ev(e,t){return Array.isArray(e)&&e.every(t)}Te.typedArray=Ev;function xv(e){return e!==null&&typeof e=="object"}Te.objectLiteral=xv});var Qu=x(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.ImplementationRequest=void 0;var Ju=be(),Yu;(function(e){e.method="textDocument/implementation",e.messageDirection=Ju.MessageDirection.clientToServer,e.type=new Ju.ProtocolRequestType(e.method)})(Yu||(Ni.ImplementationRequest=Yu={}))});var el=x(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.TypeDefinitionRequest=void 0;var Zu=be(),Ku;(function(e){e.method="textDocument/typeDefinition",e.messageDirection=Zu.MessageDirection.clientToServer,e.type=new Zu.ProtocolRequestType(e.method)})(Ku||(Ii.TypeDefinitionRequest=Ku={}))});var rl=x(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.DidChangeWorkspaceFoldersNotification=Mn.WorkspaceFoldersRequest=void 0;var Ai=be(),tl;(function(e){e.method="workspace/workspaceFolders",e.messageDirection=Ai.MessageDirection.serverToClient,e.type=new Ai.ProtocolRequestType0(e.method)})(tl||(Mn.WorkspaceFoldersRequest=tl={}));var nl;(function(e){e.method="workspace/didChangeWorkspaceFolders",e.messageDirection=Ai.MessageDirection.clientToServer,e.type=new Ai.ProtocolNotificationType(e.method)})(nl||(Mn.DidChangeWorkspaceFoldersNotification=nl={}))});var sl=x(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.ConfigurationRequest=void 0;var il=be(),ol;(function(e){e.method="workspace/configuration",e.messageDirection=il.MessageDirection.serverToClient,e.type=new il.ProtocolRequestType(e.method)})(ol||(Oi.ConfigurationRequest=ol={}))});var ul=x(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.ColorPresentationRequest=Ln.DocumentColorRequest=void 0;var Fi=be(),al;(function(e){e.method="textDocument/documentColor",e.messageDirection=Fi.MessageDirection.clientToServer,e.type=new Fi.ProtocolRequestType(e.method)})(al||(Ln.DocumentColorRequest=al={}));var cl;(function(e){e.method="textDocument/colorPresentation",e.messageDirection=Fi.MessageDirection.clientToServer,e.type=new Fi.ProtocolRequestType(e.method)})(cl||(Ln.ColorPresentationRequest=cl={}))});var fl=x($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.FoldingRangeRefreshRequest=$n.FoldingRangeRequest=void 0;var Mi=be(),ll;(function(e){e.method="textDocument/foldingRange",e.messageDirection=Mi.MessageDirection.clientToServer,e.type=new Mi.ProtocolRequestType(e.method)})(ll||($n.FoldingRangeRequest=ll={}));var dl;(function(e){e.method="workspace/foldingRange/refresh",e.messageDirection=Mi.MessageDirection.serverToClient,e.type=new Mi.ProtocolRequestType0(e.method)})(dl||($n.FoldingRangeRefreshRequest=dl={}))});var gl=x(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.DeclarationRequest=void 0;var pl=be(),hl;(function(e){e.method="textDocument/declaration",e.messageDirection=pl.MessageDirection.clientToServer,e.type=new pl.ProtocolRequestType(e.method)})(hl||(Li.DeclarationRequest=hl={}))});var vl=x($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});$i.SelectionRangeRequest=void 0;var ml=be(),yl;(function(e){e.method="textDocument/selectionRange",e.messageDirection=ml.MessageDirection.clientToServer,e.type=new ml.ProtocolRequestType(e.method)})(yl||($i.SelectionRangeRequest=yl={}))});var _l=x(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.WorkDoneProgressCancelNotification=Xt.WorkDoneProgressCreateRequest=Xt.WorkDoneProgress=void 0;var Sv=fn(),Wi=be(),bl;(function(e){e.type=new Sv.ProgressType;function t(n){return n===e.type}e.is=t})(bl||(Xt.WorkDoneProgress=bl={}));var Rl;(function(e){e.method="window/workDoneProgress/create",e.messageDirection=Wi.MessageDirection.serverToClient,e.type=new Wi.ProtocolRequestType(e.method)})(Rl||(Xt.WorkDoneProgressCreateRequest=Rl={}));var Dl;(function(e){e.method="window/workDoneProgress/cancel",e.messageDirection=Wi.MessageDirection.clientToServer,e.type=new Wi.ProtocolNotificationType(e.method)})(Dl||(Xt.WorkDoneProgressCancelNotification=Dl={}))});var El=x(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.CallHierarchyOutgoingCallsRequest=Jt.CallHierarchyIncomingCallsRequest=Jt.CallHierarchyPrepareRequest=void 0;var Wn=be(),wl;(function(e){e.method="textDocument/prepareCallHierarchy",e.messageDirection=Wn.MessageDirection.clientToServer,e.type=new Wn.ProtocolRequestType(e.method)})(wl||(Jt.CallHierarchyPrepareRequest=wl={}));var Pl;(function(e){e.method="callHierarchy/incomingCalls",e.messageDirection=Wn.MessageDirection.clientToServer,e.type=new Wn.ProtocolRequestType(e.method)})(Pl||(Jt.CallHierarchyIncomingCallsRequest=Pl={}));var Cl;(function(e){e.method="callHierarchy/outgoingCalls",e.messageDirection=Wn.MessageDirection.clientToServer,e.type=new Wn.ProtocolRequestType(e.method)})(Cl||(Jt.CallHierarchyOutgoingCallsRequest=Cl={}))});var jl=x(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.SemanticTokensRefreshRequest=ze.SemanticTokensRangeRequest=ze.SemanticTokensDeltaRequest=ze.SemanticTokensRequest=ze.SemanticTokensRegistrationType=ze.TokenFormat=void 0;var At=be(),xl;(function(e){e.Relative="relative"})(xl||(ze.TokenFormat=xl={}));var yr;(function(e){e.method="textDocument/semanticTokens",e.type=new At.RegistrationType(e.method)})(yr||(ze.SemanticTokensRegistrationType=yr={}));var Sl;(function(e){e.method="textDocument/semanticTokens/full",e.messageDirection=At.MessageDirection.clientToServer,e.type=new At.ProtocolRequestType(e.method),e.registrationMethod=yr.method})(Sl||(ze.SemanticTokensRequest=Sl={}));var Tl;(function(e){e.method="textDocument/semanticTokens/full/delta",e.messageDirection=At.MessageDirection.clientToServer,e.type=new At.ProtocolRequestType(e.method),e.registrationMethod=yr.method})(Tl||(ze.SemanticTokensDeltaRequest=Tl={}));var kl;(function(e){e.method="textDocument/semanticTokens/range",e.messageDirection=At.MessageDirection.clientToServer,e.type=new At.ProtocolRequestType(e.method),e.registrationMethod=yr.method})(kl||(ze.SemanticTokensRangeRequest=kl={}));var ql;(function(e){e.method="workspace/semanticTokens/refresh",e.messageDirection=At.MessageDirection.serverToClient,e.type=new At.ProtocolRequestType0(e.method)})(ql||(ze.SemanticTokensRefreshRequest=ql={}))});var Al=x(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.ShowDocumentRequest=void 0;var Nl=be(),Il;(function(e){e.method="window/showDocument",e.messageDirection=Nl.MessageDirection.serverToClient,e.type=new Nl.ProtocolRequestType(e.method)})(Il||(Hi.ShowDocumentRequest=Il={}))});var Ml=x(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.LinkedEditingRangeRequest=void 0;var Ol=be(),Fl;(function(e){e.method="textDocument/linkedEditingRange",e.messageDirection=Ol.MessageDirection.clientToServer,e.type=new Ol.ProtocolRequestType(e.method)})(Fl||(Ui.LinkedEditingRangeRequest=Fl={}))});var zl=x(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.WillDeleteFilesRequest=Me.DidDeleteFilesNotification=Me.DidRenameFilesNotification=Me.WillRenameFilesRequest=Me.DidCreateFilesNotification=Me.WillCreateFilesRequest=Me.FileOperationPatternKind=void 0;var nt=be(),Ll;(function(e){e.file="file",e.folder="folder"})(Ll||(Me.FileOperationPatternKind=Ll={}));var $l;(function(e){e.method="workspace/willCreateFiles",e.messageDirection=nt.MessageDirection.clientToServer,e.type=new nt.ProtocolRequestType(e.method)})($l||(Me.WillCreateFilesRequest=$l={}));var Wl;(function(e){e.method="workspace/didCreateFiles",e.messageDirection=nt.MessageDirection.clientToServer,e.type=new nt.ProtocolNotificationType(e.method)})(Wl||(Me.DidCreateFilesNotification=Wl={}));var Hl;(function(e){e.method="workspace/willRenameFiles",e.messageDirection=nt.MessageDirection.clientToServer,e.type=new nt.ProtocolRequestType(e.method)})(Hl||(Me.WillRenameFilesRequest=Hl={}));var Ul;(function(e){e.method="workspace/didRenameFiles",e.messageDirection=nt.MessageDirection.clientToServer,e.type=new nt.ProtocolNotificationType(e.method)})(Ul||(Me.DidRenameFilesNotification=Ul={}));var Vl;(function(e){e.method="workspace/didDeleteFiles",e.messageDirection=nt.MessageDirection.clientToServer,e.type=new nt.ProtocolNotificationType(e.method)})(Vl||(Me.DidDeleteFilesNotification=Vl={}));var Bl;(function(e){e.method="workspace/willDeleteFiles",e.messageDirection=nt.MessageDirection.clientToServer,e.type=new nt.ProtocolRequestType(e.method)})(Bl||(Me.WillDeleteFilesRequest=Bl={}))});var Ql=x(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.MonikerRequest=Yt.MonikerKind=Yt.UniquenessLevel=void 0;var Gl=be(),Xl;(function(e){e.document="document",e.project="project",e.group="group",e.scheme="scheme",e.global="global"})(Xl||(Yt.UniquenessLevel=Xl={}));var Jl;(function(e){e.$import="import",e.$export="export",e.local="local"})(Jl||(Yt.MonikerKind=Jl={}));var Yl;(function(e){e.method="textDocument/moniker",e.messageDirection=Gl.MessageDirection.clientToServer,e.type=new Gl.ProtocolRequestType(e.method)})(Yl||(Yt.MonikerRequest=Yl={}))});var td=x(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.TypeHierarchySubtypesRequest=Qt.TypeHierarchySupertypesRequest=Qt.TypeHierarchyPrepareRequest=void 0;var Hn=be(),Zl;(function(e){e.method="textDocument/prepareTypeHierarchy",e.messageDirection=Hn.MessageDirection.clientToServer,e.type=new Hn.ProtocolRequestType(e.method)})(Zl||(Qt.TypeHierarchyPrepareRequest=Zl={}));var Kl;(function(e){e.method="typeHierarchy/supertypes",e.messageDirection=Hn.MessageDirection.clientToServer,e.type=new Hn.ProtocolRequestType(e.method)})(Kl||(Qt.TypeHierarchySupertypesRequest=Kl={}));var ed;(function(e){e.method="typeHierarchy/subtypes",e.messageDirection=Hn.MessageDirection.clientToServer,e.type=new Hn.ProtocolRequestType(e.method)})(ed||(Qt.TypeHierarchySubtypesRequest=ed={}))});var id=x(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.InlineValueRefreshRequest=Un.InlineValueRequest=void 0;var Vi=be(),nd;(function(e){e.method="textDocument/inlineValue",e.messageDirection=Vi.MessageDirection.clientToServer,e.type=new Vi.ProtocolRequestType(e.method)})(nd||(Un.InlineValueRequest=nd={}));var rd;(function(e){e.method="workspace/inlineValue/refresh",e.messageDirection=Vi.MessageDirection.serverToClient,e.type=new Vi.ProtocolRequestType0(e.method)})(rd||(Un.InlineValueRefreshRequest=rd={}))});var cd=x(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.InlayHintRefreshRequest=Zt.InlayHintResolveRequest=Zt.InlayHintRequest=void 0;var Vn=be(),od;(function(e){e.method="textDocument/inlayHint",e.messageDirection=Vn.MessageDirection.clientToServer,e.type=new Vn.ProtocolRequestType(e.method)})(od||(Zt.InlayHintRequest=od={}));var sd;(function(e){e.method="inlayHint/resolve",e.messageDirection=Vn.MessageDirection.clientToServer,e.type=new Vn.ProtocolRequestType(e.method)})(sd||(Zt.InlayHintResolveRequest=sd={}));var ad;(function(e){e.method="workspace/inlayHint/refresh",e.messageDirection=Vn.MessageDirection.serverToClient,e.type=new Vn.ProtocolRequestType0(e.method)})(ad||(Zt.InlayHintRefreshRequest=ad={}))});var gd=x(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.DiagnosticRefreshRequest=rt.WorkspaceDiagnosticRequest=rt.DocumentDiagnosticRequest=rt.DocumentDiagnosticReportKind=rt.DiagnosticServerCancellationData=void 0;var hd=fn(),Tv=ji(),Bn=be(),ud;(function(e){function t(n){let r=n;return r&&Tv.boolean(r.retriggerRequest)}e.is=t})(ud||(rt.DiagnosticServerCancellationData=ud={}));var ld;(function(e){e.Full="full",e.Unchanged="unchanged"})(ld||(rt.DocumentDiagnosticReportKind=ld={}));var dd;(function(e){e.method="textDocument/diagnostic",e.messageDirection=Bn.MessageDirection.clientToServer,e.type=new Bn.ProtocolRequestType(e.method),e.partialResult=new hd.ProgressType})(dd||(rt.DocumentDiagnosticRequest=dd={}));var fd;(function(e){e.method="workspace/diagnostic",e.messageDirection=Bn.MessageDirection.clientToServer,e.type=new Bn.ProtocolRequestType(e.method),e.partialResult=new hd.ProgressType})(fd||(rt.WorkspaceDiagnosticRequest=fd={}));var pd;(function(e){e.method="workspace/diagnostic/refresh",e.messageDirection=Bn.MessageDirection.serverToClient,e.type=new Bn.ProtocolRequestType0(e.method)})(pd||(rt.DiagnosticRefreshRequest=pd={}))});var _d=x(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.DidCloseNotebookDocumentNotification=Ce.DidSaveNotebookDocumentNotification=Ce.DidChangeNotebookDocumentNotification=Ce.NotebookCellArrayChange=Ce.DidOpenNotebookDocumentNotification=Ce.NotebookDocumentSyncRegistrationType=Ce.NotebookDocument=Ce.NotebookCell=Ce.ExecutionSummary=Ce.NotebookCellKind=void 0;var vr=qi(),yt=ji(),wt=be(),_a;(function(e){e.Markup=1,e.Code=2;function t(n){return n===1||n===2}e.is=t})(_a||(Ce.NotebookCellKind=_a={}));var wa;(function(e){function t(i,o){let s={executionOrder:i};return(o===!0||o===!1)&&(s.success=o),s}e.create=t;function n(i){let o=i;return yt.objectLiteral(o)&&vr.uinteger.is(o.executionOrder)&&(o.success===void 0||yt.boolean(o.success))}e.is=n;function r(i,o){return i===o?!0:i==null||o===null||o===void 0?!1:i.executionOrder===o.executionOrder&&i.success===o.success}e.equals=r})(wa||(Ce.ExecutionSummary=wa={}));var Bi;(function(e){function t(o,s){return{kind:o,document:s}}e.create=t;function n(o){let s=o;return yt.objectLiteral(s)&&_a.is(s.kind)&&vr.DocumentUri.is(s.document)&&(s.metadata===void 0||yt.objectLiteral(s.metadata))}e.is=n;function r(o,s){let u=new Set;return o.document!==s.document&&u.add("document"),o.kind!==s.kind&&u.add("kind"),o.executionSummary!==s.executionSummary&&u.add("executionSummary"),(o.metadata!==void 0||s.metadata!==void 0)&&!i(o.metadata,s.metadata)&&u.add("metadata"),(o.executionSummary!==void 0||s.executionSummary!==void 0)&&!wa.equals(o.executionSummary,s.executionSummary)&&u.add("executionSummary"),u}e.diff=r;function i(o,s){if(o===s)return!0;if(o==null||s===null||s===void 0||typeof o!=typeof s||typeof o!="object")return!1;let u=Array.isArray(o),d=Array.isArray(s);if(u!==d)return!1;if(u&&d){if(o.length!==s.length)return!1;for(let p=0;p<o.length;p++)if(!i(o[p],s[p]))return!1}if(yt.objectLiteral(o)&&yt.objectLiteral(s)){let p=Object.keys(o),_=Object.keys(s);if(p.length!==_.length||(p.sort(),_.sort(),!i(p,_)))return!1;for(let w=0;w<p.length;w++){let T=p[w];if(!i(o[T],s[T]))return!1}}return!0}})(Bi||(Ce.NotebookCell=Bi={}));var md;(function(e){function t(r,i,o,s){return{uri:r,notebookType:i,version:o,cells:s}}e.create=t;function n(r){let i=r;return yt.objectLiteral(i)&&yt.string(i.uri)&&vr.integer.is(i.version)&&yt.typedArray(i.cells,Bi.is)}e.is=n})(md||(Ce.NotebookDocument=md={}));var zn;(function(e){e.method="notebookDocument/sync",e.messageDirection=wt.MessageDirection.clientToServer,e.type=new wt.RegistrationType(e.method)})(zn||(Ce.NotebookDocumentSyncRegistrationType=zn={}));var yd;(function(e){e.method="notebookDocument/didOpen",e.messageDirection=wt.MessageDirection.clientToServer,e.type=new wt.ProtocolNotificationType(e.method),e.registrationMethod=zn.method})(yd||(Ce.DidOpenNotebookDocumentNotification=yd={}));var vd;(function(e){function t(r){let i=r;return yt.objectLiteral(i)&&vr.uinteger.is(i.start)&&vr.uinteger.is(i.deleteCount)&&(i.cells===void 0||yt.typedArray(i.cells,Bi.is))}e.is=t;function n(r,i,o){let s={start:r,deleteCount:i};return o!==void 0&&(s.cells=o),s}e.create=n})(vd||(Ce.NotebookCellArrayChange=vd={}));var bd;(function(e){e.method="notebookDocument/didChange",e.messageDirection=wt.MessageDirection.clientToServer,e.type=new wt.ProtocolNotificationType(e.method),e.registrationMethod=zn.method})(bd||(Ce.DidChangeNotebookDocumentNotification=bd={}));var Rd;(function(e){e.method="notebookDocument/didSave",e.messageDirection=wt.MessageDirection.clientToServer,e.type=new wt.ProtocolNotificationType(e.method),e.registrationMethod=zn.method})(Rd||(Ce.DidSaveNotebookDocumentNotification=Rd={}));var Dd;(function(e){e.method="notebookDocument/didClose",e.messageDirection=wt.MessageDirection.clientToServer,e.type=new wt.ProtocolNotificationType(e.method),e.registrationMethod=zn.method})(Dd||(Ce.DidCloseNotebookDocumentNotification=Dd={}))});var Cd=x(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.InlineCompletionRequest=void 0;var wd=be(),Pd;(function(e){e.method="textDocument/inlineCompletion",e.messageDirection=wd.MessageDirection.clientToServer,e.type=new wd.ProtocolRequestType(e.method)})(Pd||(zi.InlineCompletionRequest=Pd={}))});var Lf=x(f=>{"use strict";Object.defineProperty(f,"__esModule",{value:!0});f.WorkspaceSymbolRequest=f.CodeActionResolveRequest=f.CodeActionRequest=f.DocumentSymbolRequest=f.DocumentHighlightRequest=f.ReferencesRequest=f.DefinitionRequest=f.SignatureHelpRequest=f.SignatureHelpTriggerKind=f.HoverRequest=f.CompletionResolveRequest=f.CompletionRequest=f.CompletionTriggerKind=f.PublishDiagnosticsNotification=f.WatchKind=f.RelativePattern=f.FileChangeType=f.DidChangeWatchedFilesNotification=f.WillSaveTextDocumentWaitUntilRequest=f.WillSaveTextDocumentNotification=f.TextDocumentSaveReason=f.DidSaveTextDocumentNotification=f.DidCloseTextDocumentNotification=f.DidChangeTextDocumentNotification=f.TextDocumentContentChangeEvent=f.DidOpenTextDocumentNotification=f.TextDocumentSyncKind=f.TelemetryEventNotification=f.LogMessageNotification=f.ShowMessageRequest=f.ShowMessageNotification=f.MessageType=f.DidChangeConfigurationNotification=f.ExitNotification=f.ShutdownRequest=f.InitializedNotification=f.InitializeErrorCodes=f.InitializeRequest=f.WorkDoneProgressOptions=f.TextDocumentRegistrationOptions=f.StaticRegistrationOptions=f.PositionEncodingKind=f.FailureHandlingKind=f.ResourceOperationKind=f.UnregistrationRequest=f.RegistrationRequest=f.DocumentSelector=f.NotebookCellTextDocumentFilter=f.NotebookDocumentFilter=f.TextDocumentFilter=void 0;f.MonikerRequest=f.MonikerKind=f.UniquenessLevel=f.WillDeleteFilesRequest=f.DidDeleteFilesNotification=f.WillRenameFilesRequest=f.DidRenameFilesNotification=f.WillCreateFilesRequest=f.DidCreateFilesNotification=f.FileOperationPatternKind=f.LinkedEditingRangeRequest=f.ShowDocumentRequest=f.SemanticTokensRegistrationType=f.SemanticTokensRefreshRequest=f.SemanticTokensRangeRequest=f.SemanticTokensDeltaRequest=f.SemanticTokensRequest=f.TokenFormat=f.CallHierarchyPrepareRequest=f.CallHierarchyOutgoingCallsRequest=f.CallHierarchyIncomingCallsRequest=f.WorkDoneProgressCancelNotification=f.WorkDoneProgressCreateRequest=f.WorkDoneProgress=f.SelectionRangeRequest=f.DeclarationRequest=f.FoldingRangeRefreshRequest=f.FoldingRangeRequest=f.ColorPresentationRequest=f.DocumentColorRequest=f.ConfigurationRequest=f.DidChangeWorkspaceFoldersNotification=f.WorkspaceFoldersRequest=f.TypeDefinitionRequest=f.ImplementationRequest=f.ApplyWorkspaceEditRequest=f.ExecuteCommandRequest=f.PrepareRenameRequest=f.RenameRequest=f.PrepareSupportDefaultBehavior=f.DocumentOnTypeFormattingRequest=f.DocumentRangesFormattingRequest=f.DocumentRangeFormattingRequest=f.DocumentFormattingRequest=f.DocumentLinkResolveRequest=f.DocumentLinkRequest=f.CodeLensRefreshRequest=f.CodeLensResolveRequest=f.CodeLensRequest=f.WorkspaceSymbolResolveRequest=void 0;f.InlineCompletionRequest=f.DidCloseNotebookDocumentNotification=f.DidSaveNotebookDocumentNotification=f.DidChangeNotebookDocumentNotification=f.NotebookCellArrayChange=f.DidOpenNotebookDocumentNotification=f.NotebookDocumentSyncRegistrationType=f.NotebookDocument=f.NotebookCell=f.ExecutionSummary=f.NotebookCellKind=f.DiagnosticRefreshRequest=f.WorkspaceDiagnosticRequest=f.DocumentDiagnosticRequest=f.DocumentDiagnosticReportKind=f.DiagnosticServerCancellationData=f.InlayHintRefreshRequest=f.InlayHintResolveRequest=f.InlayHintRequest=f.InlineValueRefreshRequest=f.InlineValueRequest=f.TypeHierarchySupertypesRequest=f.TypeHierarchySubtypesRequest=f.TypeHierarchyPrepareRequest=void 0;var k=be(),Ed=qi(),Ne=ji(),kv=Qu();Object.defineProperty(f,"ImplementationRequest",{enumerable:!0,get:function(){return kv.ImplementationRequest}});var qv=el();Object.defineProperty(f,"TypeDefinitionRequest",{enumerable:!0,get:function(){return qv.TypeDefinitionRequest}});var Af=rl();Object.defineProperty(f,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return Af.WorkspaceFoldersRequest}});Object.defineProperty(f,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return Af.DidChangeWorkspaceFoldersNotification}});var jv=sl();Object.defineProperty(f,"ConfigurationRequest",{enumerable:!0,get:function(){return jv.ConfigurationRequest}});var Of=ul();Object.defineProperty(f,"DocumentColorRequest",{enumerable:!0,get:function(){return Of.DocumentColorRequest}});Object.defineProperty(f,"ColorPresentationRequest",{enumerable:!0,get:function(){return Of.ColorPresentationRequest}});var Ff=fl();Object.defineProperty(f,"FoldingRangeRequest",{enumerable:!0,get:function(){return Ff.FoldingRangeRequest}});Object.defineProperty(f,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return Ff.FoldingRangeRefreshRequest}});var Nv=gl();Object.defineProperty(f,"DeclarationRequest",{enumerable:!0,get:function(){return Nv.DeclarationRequest}});var Iv=vl();Object.defineProperty(f,"SelectionRangeRequest",{enumerable:!0,get:function(){return Iv.SelectionRangeRequest}});var Sa=_l();Object.defineProperty(f,"WorkDoneProgress",{enumerable:!0,get:function(){return Sa.WorkDoneProgress}});Object.defineProperty(f,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return Sa.WorkDoneProgressCreateRequest}});Object.defineProperty(f,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return Sa.WorkDoneProgressCancelNotification}});var Ta=El();Object.defineProperty(f,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return Ta.CallHierarchyIncomingCallsRequest}});Object.defineProperty(f,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return Ta.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(f,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return Ta.CallHierarchyPrepareRequest}});var Gn=jl();Object.defineProperty(f,"TokenFormat",{enumerable:!0,get:function(){return Gn.TokenFormat}});Object.defineProperty(f,"SemanticTokensRequest",{enumerable:!0,get:function(){return Gn.SemanticTokensRequest}});Object.defineProperty(f,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return Gn.SemanticTokensDeltaRequest}});Object.defineProperty(f,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return Gn.SemanticTokensRangeRequest}});Object.defineProperty(f,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return Gn.SemanticTokensRefreshRequest}});Object.defineProperty(f,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return Gn.SemanticTokensRegistrationType}});var Av=Al();Object.defineProperty(f,"ShowDocumentRequest",{enumerable:!0,get:function(){return Av.ShowDocumentRequest}});var Ov=Ml();Object.defineProperty(f,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return Ov.LinkedEditingRangeRequest}});var pn=zl();Object.defineProperty(f,"FileOperationPatternKind",{enumerable:!0,get:function(){return pn.FileOperationPatternKind}});Object.defineProperty(f,"DidCreateFilesNotification",{enumerable:!0,get:function(){return pn.DidCreateFilesNotification}});Object.defineProperty(f,"WillCreateFilesRequest",{enumerable:!0,get:function(){return pn.WillCreateFilesRequest}});Object.defineProperty(f,"DidRenameFilesNotification",{enumerable:!0,get:function(){return pn.DidRenameFilesNotification}});Object.defineProperty(f,"WillRenameFilesRequest",{enumerable:!0,get:function(){return pn.WillRenameFilesRequest}});Object.defineProperty(f,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return pn.DidDeleteFilesNotification}});Object.defineProperty(f,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return pn.WillDeleteFilesRequest}});var ka=Ql();Object.defineProperty(f,"UniquenessLevel",{enumerable:!0,get:function(){return ka.UniquenessLevel}});Object.defineProperty(f,"MonikerKind",{enumerable:!0,get:function(){return ka.MonikerKind}});Object.defineProperty(f,"MonikerRequest",{enumerable:!0,get:function(){return ka.MonikerRequest}});var qa=td();Object.defineProperty(f,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return qa.TypeHierarchyPrepareRequest}});Object.defineProperty(f,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return qa.TypeHierarchySubtypesRequest}});Object.defineProperty(f,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return qa.TypeHierarchySupertypesRequest}});var Mf=id();Object.defineProperty(f,"InlineValueRequest",{enumerable:!0,get:function(){return Mf.InlineValueRequest}});Object.defineProperty(f,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return Mf.InlineValueRefreshRequest}});var ja=cd();Object.defineProperty(f,"InlayHintRequest",{enumerable:!0,get:function(){return ja.InlayHintRequest}});Object.defineProperty(f,"InlayHintResolveRequest",{enumerable:!0,get:function(){return ja.InlayHintResolveRequest}});Object.defineProperty(f,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return ja.InlayHintRefreshRequest}});var br=gd();Object.defineProperty(f,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return br.DiagnosticServerCancellationData}});Object.defineProperty(f,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return br.DocumentDiagnosticReportKind}});Object.defineProperty(f,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return br.DocumentDiagnosticRequest}});Object.defineProperty(f,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return br.WorkspaceDiagnosticRequest}});Object.defineProperty(f,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return br.DiagnosticRefreshRequest}});var Pt=_d();Object.defineProperty(f,"NotebookCellKind",{enumerable:!0,get:function(){return Pt.NotebookCellKind}});Object.defineProperty(f,"ExecutionSummary",{enumerable:!0,get:function(){return Pt.ExecutionSummary}});Object.defineProperty(f,"NotebookCell",{enumerable:!0,get:function(){return Pt.NotebookCell}});Object.defineProperty(f,"NotebookDocument",{enumerable:!0,get:function(){return Pt.NotebookDocument}});Object.defineProperty(f,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return Pt.NotebookDocumentSyncRegistrationType}});Object.defineProperty(f,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return Pt.DidOpenNotebookDocumentNotification}});Object.defineProperty(f,"NotebookCellArrayChange",{enumerable:!0,get:function(){return Pt.NotebookCellArrayChange}});Object.defineProperty(f,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return Pt.DidChangeNotebookDocumentNotification}});Object.defineProperty(f,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return Pt.DidSaveNotebookDocumentNotification}});Object.defineProperty(f,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return Pt.DidCloseNotebookDocumentNotification}});var Fv=Cd();Object.defineProperty(f,"InlineCompletionRequest",{enumerable:!0,get:function(){return Fv.InlineCompletionRequest}});var Pa;(function(e){function t(n){let r=n;return Ne.string(r)||Ne.string(r.language)||Ne.string(r.scheme)||Ne.string(r.pattern)}e.is=t})(Pa||(f.TextDocumentFilter=Pa={}));var Ca;(function(e){function t(n){let r=n;return Ne.objectLiteral(r)&&(Ne.string(r.notebookType)||Ne.string(r.scheme)||Ne.string(r.pattern))}e.is=t})(Ca||(f.NotebookDocumentFilter=Ca={}));var Ea;(function(e){function t(n){let r=n;return Ne.objectLiteral(r)&&(Ne.string(r.notebook)||Ca.is(r.notebook))&&(r.language===void 0||Ne.string(r.language))}e.is=t})(Ea||(f.NotebookCellTextDocumentFilter=Ea={}));var xa;(function(e){function t(n){if(!Array.isArray(n))return!1;for(let r of n)if(!Ne.string(r)&&!Pa.is(r)&&!Ea.is(r))return!1;return!0}e.is=t})(xa||(f.DocumentSelector=xa={}));var xd;(function(e){e.method="client/registerCapability",e.messageDirection=k.MessageDirection.serverToClient,e.type=new k.ProtocolRequestType(e.method)})(xd||(f.RegistrationRequest=xd={}));var Sd;(function(e){e.method="client/unregisterCapability",e.messageDirection=k.MessageDirection.serverToClient,e.type=new k.ProtocolRequestType(e.method)})(Sd||(f.UnregistrationRequest=Sd={}));var Td;(function(e){e.Create="create",e.Rename="rename",e.Delete="delete"})(Td||(f.ResourceOperationKind=Td={}));var kd;(function(e){e.Abort="abort",e.Transactional="transactional",e.TextOnlyTransactional="textOnlyTransactional",e.Undo="undo"})(kd||(f.FailureHandlingKind=kd={}));var qd;(function(e){e.UTF8="utf-8",e.UTF16="utf-16",e.UTF32="utf-32"})(qd||(f.PositionEncodingKind=qd={}));var jd;(function(e){function t(n){let r=n;return r&&Ne.string(r.id)&&r.id.length>0}e.hasId=t})(jd||(f.StaticRegistrationOptions=jd={}));var Nd;(function(e){function t(n){let r=n;return r&&(r.documentSelector===null||xa.is(r.documentSelector))}e.is=t})(Nd||(f.TextDocumentRegistrationOptions=Nd={}));var Id;(function(e){function t(r){let i=r;return Ne.objectLiteral(i)&&(i.workDoneProgress===void 0||Ne.boolean(i.workDoneProgress))}e.is=t;function n(r){let i=r;return i&&Ne.boolean(i.workDoneProgress)}e.hasWorkDoneProgress=n})(Id||(f.WorkDoneProgressOptions=Id={}));var Ad;(function(e){e.method="initialize",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(Ad||(f.InitializeRequest=Ad={}));var Od;(function(e){e.unknownProtocolVersion=1})(Od||(f.InitializeErrorCodes=Od={}));var Fd;(function(e){e.method="initialized",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolNotificationType(e.method)})(Fd||(f.InitializedNotification=Fd={}));var Md;(function(e){e.method="shutdown",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType0(e.method)})(Md||(f.ShutdownRequest=Md={}));var Ld;(function(e){e.method="exit",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolNotificationType0(e.method)})(Ld||(f.ExitNotification=Ld={}));var $d;(function(e){e.method="workspace/didChangeConfiguration",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolNotificationType(e.method)})($d||(f.DidChangeConfigurationNotification=$d={}));var Wd;(function(e){e.Error=1,e.Warning=2,e.Info=3,e.Log=4,e.Debug=5})(Wd||(f.MessageType=Wd={}));var Hd;(function(e){e.method="window/showMessage",e.messageDirection=k.MessageDirection.serverToClient,e.type=new k.ProtocolNotificationType(e.method)})(Hd||(f.ShowMessageNotification=Hd={}));var Ud;(function(e){e.method="window/showMessageRequest",e.messageDirection=k.MessageDirection.serverToClient,e.type=new k.ProtocolRequestType(e.method)})(Ud||(f.ShowMessageRequest=Ud={}));var Vd;(function(e){e.method="window/logMessage",e.messageDirection=k.MessageDirection.serverToClient,e.type=new k.ProtocolNotificationType(e.method)})(Vd||(f.LogMessageNotification=Vd={}));var Bd;(function(e){e.method="telemetry/event",e.messageDirection=k.MessageDirection.serverToClient,e.type=new k.ProtocolNotificationType(e.method)})(Bd||(f.TelemetryEventNotification=Bd={}));var zd;(function(e){e.None=0,e.Full=1,e.Incremental=2})(zd||(f.TextDocumentSyncKind=zd={}));var Gd;(function(e){e.method="textDocument/didOpen",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolNotificationType(e.method)})(Gd||(f.DidOpenTextDocumentNotification=Gd={}));var Xd;(function(e){function t(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}e.isIncremental=t;function n(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}e.isFull=n})(Xd||(f.TextDocumentContentChangeEvent=Xd={}));var Jd;(function(e){e.method="textDocument/didChange",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolNotificationType(e.method)})(Jd||(f.DidChangeTextDocumentNotification=Jd={}));var Yd;(function(e){e.method="textDocument/didClose",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolNotificationType(e.method)})(Yd||(f.DidCloseTextDocumentNotification=Yd={}));var Qd;(function(e){e.method="textDocument/didSave",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolNotificationType(e.method)})(Qd||(f.DidSaveTextDocumentNotification=Qd={}));var Zd;(function(e){e.Manual=1,e.AfterDelay=2,e.FocusOut=3})(Zd||(f.TextDocumentSaveReason=Zd={}));var Kd;(function(e){e.method="textDocument/willSave",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolNotificationType(e.method)})(Kd||(f.WillSaveTextDocumentNotification=Kd={}));var ef;(function(e){e.method="textDocument/willSaveWaitUntil",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(ef||(f.WillSaveTextDocumentWaitUntilRequest=ef={}));var tf;(function(e){e.method="workspace/didChangeWatchedFiles",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolNotificationType(e.method)})(tf||(f.DidChangeWatchedFilesNotification=tf={}));var nf;(function(e){e.Created=1,e.Changed=2,e.Deleted=3})(nf||(f.FileChangeType=nf={}));var rf;(function(e){function t(n){let r=n;return Ne.objectLiteral(r)&&(Ed.URI.is(r.baseUri)||Ed.WorkspaceFolder.is(r.baseUri))&&Ne.string(r.pattern)}e.is=t})(rf||(f.RelativePattern=rf={}));var of;(function(e){e.Create=1,e.Change=2,e.Delete=4})(of||(f.WatchKind=of={}));var sf;(function(e){e.method="textDocument/publishDiagnostics",e.messageDirection=k.MessageDirection.serverToClient,e.type=new k.ProtocolNotificationType(e.method)})(sf||(f.PublishDiagnosticsNotification=sf={}));var af;(function(e){e.Invoked=1,e.TriggerCharacter=2,e.TriggerForIncompleteCompletions=3})(af||(f.CompletionTriggerKind=af={}));var cf;(function(e){e.method="textDocument/completion",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(cf||(f.CompletionRequest=cf={}));var uf;(function(e){e.method="completionItem/resolve",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(uf||(f.CompletionResolveRequest=uf={}));var lf;(function(e){e.method="textDocument/hover",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(lf||(f.HoverRequest=lf={}));var df;(function(e){e.Invoked=1,e.TriggerCharacter=2,e.ContentChange=3})(df||(f.SignatureHelpTriggerKind=df={}));var ff;(function(e){e.method="textDocument/signatureHelp",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(ff||(f.SignatureHelpRequest=ff={}));var pf;(function(e){e.method="textDocument/definition",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(pf||(f.DefinitionRequest=pf={}));var hf;(function(e){e.method="textDocument/references",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(hf||(f.ReferencesRequest=hf={}));var gf;(function(e){e.method="textDocument/documentHighlight",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(gf||(f.DocumentHighlightRequest=gf={}));var mf;(function(e){e.method="textDocument/documentSymbol",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(mf||(f.DocumentSymbolRequest=mf={}));var yf;(function(e){e.method="textDocument/codeAction",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(yf||(f.CodeActionRequest=yf={}));var vf;(function(e){e.method="codeAction/resolve",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(vf||(f.CodeActionResolveRequest=vf={}));var bf;(function(e){e.method="workspace/symbol",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(bf||(f.WorkspaceSymbolRequest=bf={}));var Rf;(function(e){e.method="workspaceSymbol/resolve",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(Rf||(f.WorkspaceSymbolResolveRequest=Rf={}));var Df;(function(e){e.method="textDocument/codeLens",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(Df||(f.CodeLensRequest=Df={}));var _f;(function(e){e.method="codeLens/resolve",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(_f||(f.CodeLensResolveRequest=_f={}));var wf;(function(e){e.method="workspace/codeLens/refresh",e.messageDirection=k.MessageDirection.serverToClient,e.type=new k.ProtocolRequestType0(e.method)})(wf||(f.CodeLensRefreshRequest=wf={}));var Pf;(function(e){e.method="textDocument/documentLink",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(Pf||(f.DocumentLinkRequest=Pf={}));var Cf;(function(e){e.method="documentLink/resolve",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(Cf||(f.DocumentLinkResolveRequest=Cf={}));var Ef;(function(e){e.method="textDocument/formatting",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(Ef||(f.DocumentFormattingRequest=Ef={}));var xf;(function(e){e.method="textDocument/rangeFormatting",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(xf||(f.DocumentRangeFormattingRequest=xf={}));var Sf;(function(e){e.method="textDocument/rangesFormatting",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(Sf||(f.DocumentRangesFormattingRequest=Sf={}));var Tf;(function(e){e.method="textDocument/onTypeFormatting",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(Tf||(f.DocumentOnTypeFormattingRequest=Tf={}));var kf;(function(e){e.Identifier=1})(kf||(f.PrepareSupportDefaultBehavior=kf={}));var qf;(function(e){e.method="textDocument/rename",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(qf||(f.RenameRequest=qf={}));var jf;(function(e){e.method="textDocument/prepareRename",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(jf||(f.PrepareRenameRequest=jf={}));var Nf;(function(e){e.method="workspace/executeCommand",e.messageDirection=k.MessageDirection.clientToServer,e.type=new k.ProtocolRequestType(e.method)})(Nf||(f.ExecuteCommandRequest=Nf={}));var If;(function(e){e.method="workspace/applyEdit",e.messageDirection=k.MessageDirection.serverToClient,e.type=new k.ProtocolRequestType("workspace/applyEdit")})(If||(f.ApplyWorkspaceEditRequest=If={}))});var Wf=x(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.createProtocolConnection=void 0;var $f=fn();function Mv(e,t,n,r){return $f.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,$f.createMessageConnection)(e,t,n,r)}Gi.createProtocolConnection=Mv});var Uf=x(Ge=>{"use strict";var Lv=Ge&&Ge.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),Xi=Ge&&Ge.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Lv(t,e,n)};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.LSPErrorCodes=Ge.createProtocolConnection=void 0;Xi(fn(),Ge);Xi(qi(),Ge);Xi(be(),Ge);Xi(Lf(),Ge);var $v=Wf();Object.defineProperty(Ge,"createProtocolConnection",{enumerable:!0,get:function(){return $v.createProtocolConnection}});var Hf;(function(e){e.lspReservedErrorRangeStart=-32899,e.RequestFailed=-32803,e.ServerCancelled=-32802,e.ContentModified=-32801,e.RequestCancelled=-32800,e.lspReservedErrorRangeEnd=-32800})(Hf||(Ge.LSPErrorCodes=Hf={}))});var pe=x(Ct=>{"use strict";var Wv=Ct&&Ct.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),Vf=Ct&&Ct.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Wv(t,e,n)};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.createProtocolConnection=void 0;var Hv=Ti();Vf(Ti(),Ct);Vf(Uf(),Ct);function Uv(e,t,n,r){return(0,Hv.createMessageConnection)(e,t,n,r)}Ct.createProtocolConnection=Uv});var Ji=x(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.thenable=ke.typedArray=ke.stringArray=ke.array=ke.func=ke.error=ke.number=ke.string=ke.boolean=void 0;function Vv(e){return e===!0||e===!1}ke.boolean=Vv;function Bf(e){return typeof e=="string"||e instanceof String}ke.string=Bf;function Bv(e){return typeof e=="number"||e instanceof Number}ke.number=Bv;function zv(e){return e instanceof Error}ke.error=zv;function zf(e){return typeof e=="function"}ke.func=zf;function Gf(e){return Array.isArray(e)}ke.array=Gf;function Gv(e){return Gf(e)&&e.every(t=>Bf(t))}ke.stringArray=Gv;function Xv(e,t){return Array.isArray(e)&&e.every(t)}ke.typedArray=Xv;function Jv(e){return e&&zf(e.then)}ke.thenable=Jv});var Na=x(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.generateUuid=it.parse=it.isUUID=it.v4=it.empty=void 0;var Rr=class{constructor(t){this._value=t}asHex(){return this._value}equals(t){return this.asHex()===t.asHex()}},Dr=class e extends Rr{static _oneOf(t){return t[Math.floor(t.length*Math.random())]}static _randomHex(){return e._oneOf(e._chars)}constructor(){super([e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),"-",e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),"-","4",e._randomHex(),e._randomHex(),e._randomHex(),"-",e._oneOf(e._timeHighBits),e._randomHex(),e._randomHex(),e._randomHex(),"-",e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex()].join(""))}};Dr._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];Dr._timeHighBits=["8","9","a","b"];it.empty=new Rr("00000000-0000-0000-0000-000000000000");function Xf(){return new Dr}it.v4=Xf;var Yv=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Jf(e){return Yv.test(e)}it.isUUID=Jf;function Qv(e){if(!Jf(e))throw new Error("invalid uuid");return new Rr(e)}it.parse=Qv;function Zv(){return Xf().asHex()}it.generateUuid=Zv});var Yf=x(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.attachPartialResult=en.ProgressFeature=en.attachWorkDone=void 0;var Kt=pe(),Kv=Na(),hn=class e{constructor(t,n){this._connection=t,this._token=n,e.Instances.set(this._token,this)}begin(t,n,r,i){let o={kind:"begin",title:t,percentage:n,message:r,cancellable:i};this._connection.sendProgress(Kt.WorkDoneProgress.type,this._token,o)}report(t,n){let r={kind:"report"};typeof t=="number"?(r.percentage=t,n!==void 0&&(r.message=n)):r.message=t,this._connection.sendProgress(Kt.WorkDoneProgress.type,this._token,r)}done(){e.Instances.delete(this._token),this._connection.sendProgress(Kt.WorkDoneProgress.type,this._token,{kind:"end"})}};hn.Instances=new Map;var Yi=class extends hn{constructor(t,n){super(t,n),this._source=new Kt.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},_r=class{constructor(){}begin(){}report(){}done(){}},Qi=class extends _r{constructor(){super(),this._source=new Kt.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function eb(e,t){if(t===void 0||t.workDoneToken===void 0)return new _r;let n=t.workDoneToken;return delete t.workDoneToken,new hn(e,n)}en.attachWorkDone=eb;var tb=e=>class extends e{constructor(){super(),this._progressSupported=!1}initialize(t){super.initialize(t),t?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(Kt.WorkDoneProgressCancelNotification.type,n=>{let r=hn.Instances.get(n.token);(r instanceof Yi||r instanceof Qi)&&r.cancel()}))}attachWorkDoneProgress(t){return t===void 0?new _r:new hn(this.connection,t)}createWorkDoneProgress(){if(this._progressSupported){let t=(0,Kv.generateUuid)();return this.connection.sendRequest(Kt.WorkDoneProgressCreateRequest.type,{token:t}).then(()=>new Yi(this.connection,t))}else return Promise.resolve(new Qi)}};en.ProgressFeature=tb;var Ia;(function(e){e.type=new Kt.ProgressType})(Ia||(Ia={}));var Aa=class{constructor(t,n){this._connection=t,this._token=n}report(t){this._connection.sendProgress(Ia.type,this._token,t)}};function nb(e,t){if(t===void 0||t.partialResultToken===void 0)return;let n=t.partialResultToken;return delete t.partialResultToken,new Aa(e,n)}en.attachPartialResult=nb});var Qf=x(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.ConfigurationFeature=void 0;var rb=pe(),ib=Ji(),ob=e=>class extends e{getConfiguration(t){return t?ib.string(t)?this._getConfiguration({section:t}):this._getConfiguration(t):this._getConfiguration({})}_getConfiguration(t){let n={items:Array.isArray(t)?t:[t]};return this.connection.sendRequest(rb.ConfigurationRequest.type,n).then(r=>Array.isArray(r)?Array.isArray(t)?r:r[0]:Array.isArray(t)?[]:null)}};Zi.ConfigurationFeature=ob});var Zf=x(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.WorkspaceFoldersFeature=void 0;var Ki=pe(),sb=e=>class extends e{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(t){super.initialize(t);let n=t.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Ki.Emitter,this.connection.onNotification(Ki.DidChangeWorkspaceFoldersNotification.type,r=>{this._onDidChangeWorkspaceFolders.fire(r.event)}))}fillServerCapabilities(t){super.fillServerCapabilities(t);let n=t.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=n===!0||typeof n=="string"}getWorkspaceFolders(){return this.connection.sendRequest(Ki.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(Ki.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};eo.WorkspaceFoldersFeature=sb});var Kf=x(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.CallHierarchyFeature=void 0;var Oa=pe(),ab=e=>class extends e{get callHierarchy(){return{onPrepare:t=>this.connection.onRequest(Oa.CallHierarchyPrepareRequest.type,(n,r)=>t(n,r,this.attachWorkDoneProgress(n),void 0)),onIncomingCalls:t=>{let n=Oa.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>t(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onOutgoingCalls:t=>{let n=Oa.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(n,(r,i)=>t(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};to.CallHierarchyFeature=ab});var Ma=x(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.SemanticTokensBuilder=tn.SemanticTokensDiff=tn.SemanticTokensFeature=void 0;var no=pe(),cb=e=>class extends e{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(no.SemanticTokensRefreshRequest.type),on:t=>{let n=no.SemanticTokensRequest.type;return this.connection.onRequest(n,(r,i)=>t(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onDelta:t=>{let n=no.SemanticTokensDeltaRequest.type;return this.connection.onRequest(n,(r,i)=>t(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onRange:t=>{let n=no.SemanticTokensRangeRequest.type;return this.connection.onRequest(n,(r,i)=>t(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};tn.SemanticTokensFeature=cb;var ro=class{constructor(t,n){this.originalSequence=t,this.modifiedSequence=n}computeDiff(){let t=this.originalSequence.length,n=this.modifiedSequence.length,r=0;for(;r<n&&r<t&&this.originalSequence[r]===this.modifiedSequence[r];)r++;if(r<n&&r<t){let i=t-1,o=n-1;for(;i>=r&&o>=r&&this.originalSequence[i]===this.modifiedSequence[o];)i--,o--;(i<r||o<r)&&(i++,o++);let s=i-r+1,u=this.modifiedSequence.slice(r,o+1);return u.length===1&&u[0]===this.originalSequence[i]?[{start:r,deleteCount:s-1}]:[{start:r,deleteCount:s,data:u}]}else return r<n?[{start:r,deleteCount:0,data:this.modifiedSequence.slice(r)}]:r<t?[{start:r,deleteCount:t-r}]:[]}};tn.SemanticTokensDiff=ro;var Fa=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(t,n,r,i,o){let s=t,u=n;this._dataLen>0&&(s-=this._prevLine,s===0&&(u-=this._prevChar)),this._data[this._dataLen++]=s,this._data[this._dataLen++]=u,this._data[this._dataLen++]=r,this._data[this._dataLen++]=i,this._data[this._dataLen++]=o,this._prevLine=t,this._prevChar=n}get id(){return this._id.toString()}previousResult(t){this.id===t&&(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 ro(this._prevData,this._data).computeDiff()}:this.build()}};tn.SemanticTokensBuilder=Fa});var ep=x(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.ShowDocumentFeature=void 0;var ub=pe(),lb=e=>class extends e{showDocument(t){return this.connection.sendRequest(ub.ShowDocumentRequest.type,t)}};io.ShowDocumentFeature=lb});var tp=x(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.FileOperationsFeature=void 0;var Xn=pe(),db=e=>class extends e{onDidCreateFiles(t){return this.connection.onNotification(Xn.DidCreateFilesNotification.type,n=>{t(n)})}onDidRenameFiles(t){return this.connection.onNotification(Xn.DidRenameFilesNotification.type,n=>{t(n)})}onDidDeleteFiles(t){return this.connection.onNotification(Xn.DidDeleteFilesNotification.type,n=>{t(n)})}onWillCreateFiles(t){return this.connection.onRequest(Xn.WillCreateFilesRequest.type,(n,r)=>t(n,r))}onWillRenameFiles(t){return this.connection.onRequest(Xn.WillRenameFilesRequest.type,(n,r)=>t(n,r))}onWillDeleteFiles(t){return this.connection.onRequest(Xn.WillDeleteFilesRequest.type,(n,r)=>t(n,r))}};oo.FileOperationsFeature=db});var np=x(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.LinkedEditingRangeFeature=void 0;var fb=pe(),pb=e=>class extends e{onLinkedEditingRange(t){return this.connection.onRequest(fb.LinkedEditingRangeRequest.type,(n,r)=>t(n,r,this.attachWorkDoneProgress(n),void 0))}};so.LinkedEditingRangeFeature=pb});var rp=x(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.TypeHierarchyFeature=void 0;var La=pe(),hb=e=>class extends e{get typeHierarchy(){return{onPrepare:t=>this.connection.onRequest(La.TypeHierarchyPrepareRequest.type,(n,r)=>t(n,r,this.attachWorkDoneProgress(n),void 0)),onSupertypes:t=>{let n=La.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(n,(r,i)=>t(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))},onSubtypes:t=>{let n=La.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(n,(r,i)=>t(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};ao.TypeHierarchyFeature=hb});var op=x(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.InlineValueFeature=void 0;var ip=pe(),gb=e=>class extends e{get inlineValue(){return{refresh:()=>this.connection.sendRequest(ip.InlineValueRefreshRequest.type),on:t=>this.connection.onRequest(ip.InlineValueRequest.type,(n,r)=>t(n,r,this.attachWorkDoneProgress(n)))}}};co.InlineValueFeature=gb});var ap=x(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.FoldingRangeFeature=void 0;var sp=pe(),mb=e=>class extends e{get foldingRange(){return{refresh:()=>this.connection.sendRequest(sp.FoldingRangeRefreshRequest.type),on:t=>{let n=sp.FoldingRangeRequest.type;return this.connection.onRequest(n,(r,i)=>t(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};uo.FoldingRangeFeature=mb});var cp=x(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.InlayHintFeature=void 0;var $a=pe(),yb=e=>class extends e{get inlayHint(){return{refresh:()=>this.connection.sendRequest($a.InlayHintRefreshRequest.type),on:t=>this.connection.onRequest($a.InlayHintRequest.type,(n,r)=>t(n,r,this.attachWorkDoneProgress(n))),resolve:t=>this.connection.onRequest($a.InlayHintResolveRequest.type,(n,r)=>t(n,r))}}};lo.InlayHintFeature=yb});var up=x(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.DiagnosticFeature=void 0;var wr=pe(),vb=e=>class extends e{get diagnostics(){return{refresh:()=>this.connection.sendRequest(wr.DiagnosticRefreshRequest.type),on:t=>this.connection.onRequest(wr.DocumentDiagnosticRequest.type,(n,r)=>t(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(wr.DocumentDiagnosticRequest.partialResult,n))),onWorkspace:t=>this.connection.onRequest(wr.WorkspaceDiagnosticRequest.type,(n,r)=>t(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(wr.WorkspaceDiagnosticRequest.partialResult,n)))}}};fo.DiagnosticFeature=vb});var Ha=x(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.TextDocuments=void 0;var gn=pe(),Wa=class{constructor(t){this._configuration=t,this._syncedDocuments=new Map,this._onDidChangeContent=new gn.Emitter,this._onDidOpen=new gn.Emitter,this._onDidClose=new gn.Emitter,this._onDidSave=new gn.Emitter,this._onWillSave=new gn.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(t){this._willSaveWaitUntil=t}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(t){return this._syncedDocuments.get(t)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(t){t.__textDocumentSync=gn.TextDocumentSyncKind.Incremental;let n=[];return n.push(t.onDidOpenTextDocument(r=>{let i=r.textDocument,o=this._configuration.create(i.uri,i.languageId,i.version,i.text);this._syncedDocuments.set(i.uri,o);let s=Object.freeze({document:o});this._onDidOpen.fire(s),this._onDidChangeContent.fire(s)})),n.push(t.onDidChangeTextDocument(r=>{let i=r.textDocument,o=r.contentChanges;if(o.length===0)return;let{version:s}=i;if(s==null)throw new Error(`Received document change event for ${i.uri} without valid version identifier`);let u=this._syncedDocuments.get(i.uri);u!==void 0&&(u=this._configuration.update(u,o,s),this._syncedDocuments.set(i.uri,u),this._onDidChangeContent.fire(Object.freeze({document:u})))})),n.push(t.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(t.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(t.onWillSaveTextDocumentWaitUntil((r,i)=>{let o=this._syncedDocuments.get(r.textDocument.uri);return o!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:o,reason:r.reason}),i):[]})),n.push(t.onDidSaveTextDocument(r=>{let i=this._syncedDocuments.get(r.textDocument.uri);i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),gn.Disposable.create(()=>{n.forEach(r=>r.dispose())})}};po.TextDocuments=Wa});var Va=x(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.NotebookDocuments=Jn.NotebookSyncFeature=void 0;var ot=pe(),lp=Ha(),bb=e=>class extends e{get synchronization(){return{onDidOpenNotebookDocument:t=>this.connection.onNotification(ot.DidOpenNotebookDocumentNotification.type,n=>{t(n)}),onDidChangeNotebookDocument:t=>this.connection.onNotification(ot.DidChangeNotebookDocumentNotification.type,n=>{t(n)}),onDidSaveNotebookDocument:t=>this.connection.onNotification(ot.DidSaveNotebookDocumentNotification.type,n=>{t(n)}),onDidCloseNotebookDocument:t=>this.connection.onNotification(ot.DidCloseNotebookDocumentNotification.type,n=>{t(n)})}}};Jn.NotebookSyncFeature=bb;var ho=class e{onDidOpenTextDocument(t){return this.openHandler=t,ot.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(t){this.openHandler&&this.openHandler(t)}onDidChangeTextDocument(t){return this.changeHandler=t,ot.Disposable.create(()=>{this.changeHandler=t})}changeTextDocument(t){this.changeHandler&&this.changeHandler(t)}onDidCloseTextDocument(t){return this.closeHandler=t,ot.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(t){this.closeHandler&&this.closeHandler(t)}onWillSaveTextDocument(){return e.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return e.NULL_DISPOSE}onDidSaveTextDocument(){return e.NULL_DISPOSE}};ho.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var Ua=class{constructor(t){t instanceof lp.TextDocuments?this._cellTextDocuments=t:this._cellTextDocuments=new lp.TextDocuments(t),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new ot.Emitter,this._onDidChange=new ot.Emitter,this._onDidSave=new ot.Emitter,this._onDidClose=new ot.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(t){return this._cellTextDocuments.get(t.document)}getNotebookDocument(t){return this.notebookDocuments.get(t)}getNotebookCell(t){let n=this.notebookCellMap.get(t);return n&&n[0]}findNotebookDocumentForCell(t){let n=typeof t=="string"?t:t.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(t){let n=new ho,r=[];return r.push(this.cellTextDocuments.listen(n)),r.push(t.notebooks.synchronization.onDidOpenNotebookDocument(i=>{this.notebookDocuments.set(i.notebookDocument.uri,i.notebookDocument);for(let o of i.cellTextDocuments)n.openTextDocument({textDocument:o});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument)})),r.push(t.notebooks.synchronization.onDidChangeNotebookDocument(i=>{let o=this.notebookDocuments.get(i.notebookDocument.uri);if(o===void 0)return;o.version=i.notebookDocument.version;let s=o.metadata,u=!1,d=i.change;d.metadata!==void 0&&(u=!0,o.metadata=d.metadata);let p=[],_=[],w=[],T=[];if(d.cells!==void 0){let U=d.cells;if(U.structure!==void 0){let y=U.structure.array;if(o.cells.splice(y.start,y.deleteCount,...y.cells!==void 0?y.cells:[]),U.structure.didOpen!==void 0)for(let v of U.structure.didOpen)n.openTextDocument({textDocument:v}),p.push(v.uri);if(U.structure.didClose)for(let v of U.structure.didClose)n.closeTextDocument({textDocument:v}),_.push(v.uri)}if(U.data!==void 0){let y=new Map(U.data.map(v=>[v.document,v]));for(let v=0;v<=o.cells.length;v++){let q=y.get(o.cells[v].document);if(q!==void 0){let J=o.cells.splice(v,1,q);if(w.push({old:J[0],new:q}),y.delete(q.document),y.size===0)break}}}if(U.textContent!==void 0)for(let y of U.textContent)n.changeTextDocument({textDocument:y.document,contentChanges:y.changes}),T.push(y.document.uri)}this.updateCellMap(o);let P={notebookDocument:o};u&&(P.metadata={old:s,new:o.metadata});let L=[];for(let U of p)L.push(this.getNotebookCell(U));let H=[];for(let U of _)H.push(this.getNotebookCell(U));let se=[];for(let U of T)se.push(this.getNotebookCell(U));(L.length>0||H.length>0||w.length>0||se.length>0)&&(P.cells={added:L,removed:H,changed:{data:w,textContent:se}}),(P.metadata!==void 0||P.cells!==void 0)&&this._onDidChange.fire(P)})),r.push(t.notebooks.synchronization.onDidSaveNotebookDocument(i=>{let o=this.notebookDocuments.get(i.notebookDocument.uri);o!==void 0&&this._onDidSave.fire(o)})),r.push(t.notebooks.synchronization.onDidCloseNotebookDocument(i=>{let o=this.notebookDocuments.get(i.notebookDocument.uri);if(o!==void 0){this._onDidClose.fire(o);for(let s of i.cellTextDocuments)n.closeTextDocument({textDocument:s});this.notebookDocuments.delete(i.notebookDocument.uri);for(let s of o.cells)this.notebookCellMap.delete(s.document)}})),ot.Disposable.create(()=>{r.forEach(i=>i.dispose())})}updateCellMap(t){for(let n of t.cells)this.notebookCellMap.set(n.document,[n,t])}};Jn.NotebookDocuments=Ua});var dp=x(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.MonikerFeature=void 0;var Rb=pe(),Db=e=>class extends e{get moniker(){return{on:t=>{let n=Rb.MonikerRequest.type;return this.connection.onRequest(n,(r,i)=>t(r,i,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(n,r)))}}}};go.MonikerFeature=Db});var Ya=x(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.createConnection=ne.combineFeatures=ne.combineNotebooksFeatures=ne.combineLanguagesFeatures=ne.combineWorkspaceFeatures=ne.combineWindowFeatures=ne.combineClientFeatures=ne.combineTracerFeatures=ne.combineTelemetryFeatures=ne.combineConsoleFeatures=ne._NotebooksImpl=ne._LanguagesImpl=ne.BulkUnregistration=ne.BulkRegistration=ne.ErrorMessageTracker=void 0;var N=pe(),st=Ji(),za=Na(),V=Yf(),_b=Qf(),wb=Zf(),Pb=Kf(),Cb=Ma(),Eb=ep(),xb=tp(),Sb=np(),Tb=rp(),kb=op(),qb=ap(),jb=cp(),Nb=up(),Ib=Va(),Ab=dp();function Ba(e){if(e!==null)return e}var Ga=class{constructor(){this._messages=Object.create(null)}add(t){let n=this._messages[t];n||(n=0),n++,this._messages[t]=n}sendErrors(t){Object.keys(this._messages).forEach(n=>{t.window.showErrorMessage(n)})}};ne.ErrorMessageTracker=Ga;var mo=class{constructor(){}rawAttach(t){this._rawConnection=t}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(t){}initialize(t){}error(t){this.send(N.MessageType.Error,t)}warn(t){this.send(N.MessageType.Warning,t)}info(t){this.send(N.MessageType.Info,t)}log(t){this.send(N.MessageType.Log,t)}debug(t){this.send(N.MessageType.Debug,t)}send(t,n){this._rawConnection&&this._rawConnection.sendNotification(N.LogMessageNotification.type,{type:t,message:n}).catch(()=>{(0,N.RAL)().console.error("Sending log message failed")})}},Xa=class{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}showErrorMessage(t,...n){let r={type:N.MessageType.Error,message:t,actions:n};return this.connection.sendRequest(N.ShowMessageRequest.type,r).then(Ba)}showWarningMessage(t,...n){let r={type:N.MessageType.Warning,message:t,actions:n};return this.connection.sendRequest(N.ShowMessageRequest.type,r).then(Ba)}showInformationMessage(t,...n){let r={type:N.MessageType.Info,message:t,actions:n};return this.connection.sendRequest(N.ShowMessageRequest.type,r).then(Ba)}},fp=(0,Eb.ShowDocumentFeature)((0,V.ProgressFeature)(Xa)),pp;(function(e){function t(){return new yo}e.create=t})(pp||(ne.BulkRegistration=pp={}));var yo=class{constructor(){this._registrations=[],this._registered=new Set}add(t,n){let r=st.string(t)?t:t.method;if(this._registered.has(r))throw new Error(`${r} is already added to this registration`);let i=za.generateUuid();this._registrations.push({id:i,method:r,registerOptions:n||{}}),this._registered.add(r)}asRegistrationParams(){return{registrations:this._registrations}}},hp;(function(e){function t(){return new Pr(void 0,[])}e.create=t})(hp||(ne.BulkUnregistration=hp={}));var Pr=class{constructor(t,n){this._connection=t,this._unregistrations=new Map,n.forEach(r=>{this._unregistrations.set(r.method,r)})}get isAttached(){return!!this._connection}attach(t){this._connection=t}add(t){this._unregistrations.set(t.method,t)}dispose(){let t=[];for(let r of this._unregistrations.values())t.push(r);let n={unregisterations:t};this._connection.sendRequest(N.UnregistrationRequest.type,n).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(t){let n=st.string(t)?t:t.method,r=this._unregistrations.get(n);if(!r)return!1;let i={unregisterations:[r]};return this._connection.sendRequest(N.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(n)},o=>{this._connection.console.info(`Un-registering request handler for ${r.id} failed.`)}),!0}},vo=class{attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}register(t,n,r){return t instanceof yo?this.registerMany(t):t instanceof Pr?this.registerSingle1(t,n,r):this.registerSingle2(t,n)}registerSingle1(t,n,r){let i=st.string(n)?n:n.method,o=za.generateUuid(),s={registrations:[{id:o,method:i,registerOptions:r||{}}]};return t.isAttached||t.attach(this.connection),this.connection.sendRequest(N.RegistrationRequest.type,s).then(u=>(t.add({id:o,method:i}),t),u=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(u)))}registerSingle2(t,n){let r=st.string(t)?t:t.method,i=za.generateUuid(),o={registrations:[{id:i,method:r,registerOptions:n||{}}]};return this.connection.sendRequest(N.RegistrationRequest.type,o).then(s=>N.Disposable.create(()=>{this.unregisterSingle(i,r).catch(()=>{this.connection.console.info(`Un-registering capability with id ${i} failed.`)})}),s=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(s)))}unregisterSingle(t,n){let r={unregisterations:[{id:t,method:n}]};return this.connection.sendRequest(N.UnregistrationRequest.type,r).catch(()=>{this.connection.console.info(`Un-registering request handler for ${t} failed.`)})}registerMany(t){let n=t.asRegistrationParams();return this.connection.sendRequest(N.RegistrationRequest.type,n).then(()=>new Pr(this._connection,n.registrations.map(r=>({id:r.id,method:r.method}))),r=>(this.connection.console.info("Bulk registration failed."),Promise.reject(r)))}},Ja=class{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}applyEdit(t){function n(i){return i&&!!i.edit}let r=n(t)?t:{edit:t};return this.connection.sendRequest(N.ApplyWorkspaceEditRequest.type,r)}},gp=(0,xb.FileOperationsFeature)((0,wb.WorkspaceFoldersFeature)((0,_b.ConfigurationFeature)(Ja))),bo=class{constructor(){this._trace=N.Trace.Off}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}set trace(t){this._trace=t}log(t,n){this._trace!==N.Trace.Off&&this.connection.sendNotification(N.LogTraceNotification.type,{message:t,verbose:this._trace===N.Trace.Verbose?n:void 0}).catch(()=>{})}},Ro=class{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}logEvent(t){this.connection.sendNotification(N.TelemetryEventNotification.type,t).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},Do=class{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}attachWorkDoneProgress(t){return(0,V.attachWorkDone)(this.connection,t)}attachPartialResultProgress(t,n){return(0,V.attachPartialResult)(this.connection,n)}};ne._LanguagesImpl=Do;var mp=(0,qb.FoldingRangeFeature)((0,Ab.MonikerFeature)((0,Nb.DiagnosticFeature)((0,jb.InlayHintFeature)((0,kb.InlineValueFeature)((0,Tb.TypeHierarchyFeature)((0,Sb.LinkedEditingRangeFeature)((0,Cb.SemanticTokensFeature)((0,Pb.CallHierarchyFeature)(Do))))))))),_o=class{constructor(){}attach(t){this._connection=t}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(t){}fillServerCapabilities(t){}attachWorkDoneProgress(t){return(0,V.attachWorkDone)(this.connection,t)}attachPartialResultProgress(t,n){return(0,V.attachPartialResult)(this.connection,n)}};ne._NotebooksImpl=_o;var yp=(0,Ib.NotebookSyncFeature)(_o);function vp(e,t){return function(n){return t(e(n))}}ne.combineConsoleFeatures=vp;function bp(e,t){return function(n){return t(e(n))}}ne.combineTelemetryFeatures=bp;function Rp(e,t){return function(n){return t(e(n))}}ne.combineTracerFeatures=Rp;function Dp(e,t){return function(n){return t(e(n))}}ne.combineClientFeatures=Dp;function _p(e,t){return function(n){return t(e(n))}}ne.combineWindowFeatures=_p;function wp(e,t){return function(n){return t(e(n))}}ne.combineWorkspaceFeatures=wp;function Pp(e,t){return function(n){return t(e(n))}}ne.combineLanguagesFeatures=Pp;function Cp(e,t){return function(n){return t(e(n))}}ne.combineNotebooksFeatures=Cp;function Ob(e,t){function n(i,o,s){return i&&o?s(i,o):i||o}return{__brand:"features",console:n(e.console,t.console,vp),tracer:n(e.tracer,t.tracer,Rp),telemetry:n(e.telemetry,t.telemetry,bp),client:n(e.client,t.client,Dp),window:n(e.window,t.window,_p),workspace:n(e.workspace,t.workspace,wp),languages:n(e.languages,t.languages,Pp),notebooks:n(e.notebooks,t.notebooks,Cp)}}ne.combineFeatures=Ob;function Fb(e,t,n){let r=n&&n.console?new(n.console(mo)):new mo,i=e(r);r.rawAttach(i);let o=n&&n.tracer?new(n.tracer(bo)):new bo,s=n&&n.telemetry?new(n.telemetry(Ro)):new Ro,u=n&&n.client?new(n.client(vo)):new vo,d=n&&n.window?new(n.window(fp)):new fp,p=n&&n.workspace?new(n.workspace(gp)):new gp,_=n&&n.languages?new(n.languages(mp)):new mp,w=n&&n.notebooks?new(n.notebooks(yp)):new yp,T=[r,o,s,u,d,p,_,w];function P(y){return y instanceof Promise?y:st.thenable(y)?new Promise((v,q)=>{y.then(J=>v(J),J=>q(J))}):Promise.resolve(y)}let L,H,se,U={listen:()=>i.listen(),sendRequest:(y,...v)=>i.sendRequest(st.string(y)?y:y.method,...v),onRequest:(y,v)=>i.onRequest(y,v),sendNotification:(y,v)=>{let q=st.string(y)?y:y.method;return i.sendNotification(q,v)},onNotification:(y,v)=>i.onNotification(y,v),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:y=>(H=y,{dispose:()=>{H=void 0}}),onInitialized:y=>i.onNotification(N.InitializedNotification.type,y),onShutdown:y=>(L=y,{dispose:()=>{L=void 0}}),onExit:y=>(se=y,{dispose:()=>{se=void 0}}),get console(){return r},get telemetry(){return s},get tracer(){return o},get client(){return u},get window(){return d},get workspace(){return p},get languages(){return _},get notebooks(){return w},onDidChangeConfiguration:y=>i.onNotification(N.DidChangeConfigurationNotification.type,y),onDidChangeWatchedFiles:y=>i.onNotification(N.DidChangeWatchedFilesNotification.type,y),__textDocumentSync:void 0,onDidOpenTextDocument:y=>i.onNotification(N.DidOpenTextDocumentNotification.type,y),onDidChangeTextDocument:y=>i.onNotification(N.DidChangeTextDocumentNotification.type,y),onDidCloseTextDocument:y=>i.onNotification(N.DidCloseTextDocumentNotification.type,y),onWillSaveTextDocument:y=>i.onNotification(N.WillSaveTextDocumentNotification.type,y),onWillSaveTextDocumentWaitUntil:y=>i.onRequest(N.WillSaveTextDocumentWaitUntilRequest.type,y),onDidSaveTextDocument:y=>i.onNotification(N.DidSaveTextDocumentNotification.type,y),sendDiagnostics:y=>i.sendNotification(N.PublishDiagnosticsNotification.type,y),onHover:y=>i.onRequest(N.HoverRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),void 0)),onCompletion:y=>i.onRequest(N.CompletionRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onCompletionResolve:y=>i.onRequest(N.CompletionResolveRequest.type,y),onSignatureHelp:y=>i.onRequest(N.SignatureHelpRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),void 0)),onDeclaration:y=>i.onRequest(N.DeclarationRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onDefinition:y=>i.onRequest(N.DefinitionRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onTypeDefinition:y=>i.onRequest(N.TypeDefinitionRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onImplementation:y=>i.onRequest(N.ImplementationRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onReferences:y=>i.onRequest(N.ReferencesRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onDocumentHighlight:y=>i.onRequest(N.DocumentHighlightRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onDocumentSymbol:y=>i.onRequest(N.DocumentSymbolRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onWorkspaceSymbol:y=>i.onRequest(N.WorkspaceSymbolRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onWorkspaceSymbolResolve:y=>i.onRequest(N.WorkspaceSymbolResolveRequest.type,y),onCodeAction:y=>i.onRequest(N.CodeActionRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onCodeActionResolve:y=>i.onRequest(N.CodeActionResolveRequest.type,(v,q)=>y(v,q)),onCodeLens:y=>i.onRequest(N.CodeLensRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onCodeLensResolve:y=>i.onRequest(N.CodeLensResolveRequest.type,(v,q)=>y(v,q)),onDocumentFormatting:y=>i.onRequest(N.DocumentFormattingRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),void 0)),onDocumentRangeFormatting:y=>i.onRequest(N.DocumentRangeFormattingRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),void 0)),onDocumentOnTypeFormatting:y=>i.onRequest(N.DocumentOnTypeFormattingRequest.type,(v,q)=>y(v,q)),onRenameRequest:y=>i.onRequest(N.RenameRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),void 0)),onPrepareRename:y=>i.onRequest(N.PrepareRenameRequest.type,(v,q)=>y(v,q)),onDocumentLinks:y=>i.onRequest(N.DocumentLinkRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onDocumentLinkResolve:y=>i.onRequest(N.DocumentLinkResolveRequest.type,(v,q)=>y(v,q)),onDocumentColor:y=>i.onRequest(N.DocumentColorRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onColorPresentation:y=>i.onRequest(N.ColorPresentationRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onFoldingRanges:y=>i.onRequest(N.FoldingRangeRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onSelectionRanges:y=>i.onRequest(N.SelectionRangeRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),(0,V.attachPartialResult)(i,v))),onExecuteCommand:y=>i.onRequest(N.ExecuteCommandRequest.type,(v,q)=>y(v,q,(0,V.attachWorkDone)(i,v),void 0)),dispose:()=>i.dispose()};for(let y of T)y.attach(U);return i.onRequest(N.InitializeRequest.type,y=>{t.initialize(y),st.string(y.trace)&&(o.trace=N.Trace.fromString(y.trace));for(let v of T)v.initialize(y.capabilities);if(H){let v=H(y,new N.CancellationTokenSource().token,(0,V.attachWorkDone)(i,y),void 0);return P(v).then(q=>{if(q instanceof N.ResponseError)return q;let J=q;J||(J={capabilities:{}});let le=J.capabilities;le||(le={},J.capabilities=le),le.textDocumentSync===void 0||le.textDocumentSync===null?le.textDocumentSync=st.number(U.__textDocumentSync)?U.__textDocumentSync:N.TextDocumentSyncKind.None:!st.number(le.textDocumentSync)&&!st.number(le.textDocumentSync.change)&&(le.textDocumentSync.change=st.number(U.__textDocumentSync)?U.__textDocumentSync:N.TextDocumentSyncKind.None);for(let _e of T)_e.fillServerCapabilities(le);return J})}else{let v={capabilities:{textDocumentSync:N.TextDocumentSyncKind.None}};for(let q of T)q.fillServerCapabilities(v.capabilities);return v}}),i.onRequest(N.ShutdownRequest.type,()=>{if(t.shutdownReceived=!0,L)return L(new N.CancellationTokenSource().token)}),i.onNotification(N.ExitNotification.type,()=>{try{se&&se()}finally{t.shutdownReceived?t.exit(0):t.exit(1)}}),i.onNotification(N.SetTraceNotification.type,y=>{o.trace=N.Trace.fromString(y.value)}),U}ne.createConnection=Fb});var Ep=x(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.resolveModulePath=Xe.FileSystem=Xe.resolveGlobalYarnPath=Xe.resolveGlobalNodePath=Xe.resolve=Xe.uriToFilePath=void 0;var Mb=require("url"),vt=require("path"),Qa=require("fs"),tc=require("child_process");function Lb(e){let t=Mb.parse(e);if(t.protocol!=="file:"||!t.path)return;let n=t.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 o=n[0],s=n[1];o.length===0&&s.length>1&&s[1]===":"&&n.shift()}return vt.normalize(n.join("/"))}Xe.uriToFilePath=Lb;function Za(){return process.platform==="win32"}function wo(e,t,n,r){let i="NODE_PATH",o=["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((s,u)=>{let d=process.env,p=Object.create(null);Object.keys(d).forEach(_=>p[_]=d[_]),t&&Qa.existsSync(t)&&(p[i]?p[i]=t+vt.delimiter+p[i]:p[i]=t,r&&r(`NODE_PATH value is: ${p[i]}`)),p.ELECTRON_RUN_AS_NODE="1";try{let _=(0,tc.fork)("",[],{cwd:n,env:p,execArgv:["-e",o]});if(_.pid===void 0){u(new Error(`Starting process to resolve node module ${e} failed`));return}_.on("error",T=>{u(T)}),_.on("message",T=>{T.c==="r"&&(_.send({c:"e"}),T.s?s(T.r):u(new Error(`Failed to resolve module: ${e}`)))});let w={c:"rs",a:e};_.send(w)}catch(_){u(_)}})}Xe.resolve=wo;function Ka(e){let t="npm",n=Object.create(null);Object.keys(process.env).forEach(o=>n[o]=process.env[o]),n.NO_UPDATE_NOTIFIER="true";let r={encoding:"utf8",env:n};Za()&&(t="npm.cmd",r.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let o=(0,tc.spawnSync)(t,["config","get","prefix"],r).stdout;if(!o){e&&e("'npm config get prefix' didn't return a value.");return}let s=o.trim();return e&&e(`'npm config get prefix' value is: ${s}`),s.length>0?Za()?vt.join(s,"node_modules"):vt.join(s,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i)}}Xe.resolveGlobalNodePath=Ka;function $b(e){let t="yarn",n={encoding:"utf8"};Za()&&(t="yarn.cmd",n.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let i=(0,tc.spawnSync)(t,["global","dir","--json"],n),o=i.stdout;if(!o){e&&(e("'yarn global dir' didn't return a value."),i.stderr&&e(i.stderr));return}let s=o.trim().split(/\r?\n/);for(let u of s)try{let d=JSON.parse(u);if(d.type==="log")return vt.join(d.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",r)}}Xe.resolveGlobalYarnPath=$b;var ec;(function(e){let t;function n(){return t!==void 0||(process.platform==="win32"?t=!1:t=!Qa.existsSync(__filename.toUpperCase())||!Qa.existsSync(__filename.toLowerCase())),t}e.isCaseSensitive=n;function r(i,o){return n()?vt.normalize(o).indexOf(vt.normalize(i))===0:vt.normalize(o).toLowerCase().indexOf(vt.normalize(i).toLowerCase())===0}e.isParent=r})(ec||(Xe.FileSystem=ec={}));function Wb(e,t,n,r){return n?(vt.isAbsolute(n)||(n=vt.join(e,n)),wo(t,n,n,r).then(i=>ec.isParent(n,i)?i:Promise.reject(new Error(`Failed to load ${t} from node path location.`))).then(void 0,i=>wo(t,Ka(r),e,r))):wo(t,Ka(r),e,r)}Xe.resolveModulePath=Wb});var nc=x((EC,xp)=>{"use strict";xp.exports=pe()});var Sp=x(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.InlineCompletionFeature=void 0;var Hb=pe(),Ub=e=>class extends e{get inlineCompletion(){return{on:t=>this.connection.onRequest(Hb.InlineCompletionRequest.type,(n,r)=>t(n,r,this.attachWorkDoneProgress(n)))}}};Po.InlineCompletionFeature=Ub});var qp=x(Le=>{"use strict";var Vb=Le&&Le.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),kp=Le&&Le.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Vb(t,e,n)};Object.defineProperty(Le,"__esModule",{value:!0});Le.ProposedFeatures=Le.NotebookDocuments=Le.TextDocuments=Le.SemanticTokensBuilder=void 0;var Bb=Ma();Object.defineProperty(Le,"SemanticTokensBuilder",{enumerable:!0,get:function(){return Bb.SemanticTokensBuilder}});var zb=Sp();kp(pe(),Le);var Gb=Ha();Object.defineProperty(Le,"TextDocuments",{enumerable:!0,get:function(){return Gb.TextDocuments}});var Xb=Va();Object.defineProperty(Le,"NotebookDocuments",{enumerable:!0,get:function(){return Xb.NotebookDocuments}});kp(Ya(),Le);var Tp;(function(e){e.all={__brand:"features",languages:zb.InlineCompletionFeature}})(Tp||(Le.ProposedFeatures=Tp={}))});var Fp=x(at=>{"use strict";var Jb=at&&at.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),Ap=at&&at.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Jb(t,e,n)};Object.defineProperty(at,"__esModule",{value:!0});at.createConnection=at.Files=void 0;var jp=require("node:util"),rc=Ji(),Yb=Ya(),Cr=Ep(),mn=nc();Ap(nc(),at);Ap(qp(),at);var Np;(function(e){e.uriToFilePath=Cr.uriToFilePath,e.resolveGlobalNodePath=Cr.resolveGlobalNodePath,e.resolveGlobalYarnPath=Cr.resolveGlobalYarnPath,e.resolve=Cr.resolve,e.resolveModulePath=Cr.resolveModulePath})(Np||(at.Files=Np={}));var Ip;function Co(){if(Ip!==void 0)try{Ip.end()}catch{}}var Yn=!1,Op;function Qb(){let e="--clientProcessId";function t(n){try{let r=parseInt(n);isNaN(r)||(Op=setInterval(()=>{try{process.kill(r,0)}catch{Co(),process.exit(Yn?0:1)}},3e3))}catch{}}for(let n=2;n<process.argv.length;n++){let r=process.argv[n];if(r===e&&n+1<process.argv.length){t(process.argv[n+1]);return}else{let i=r.split("=");i[0]===e&&t(i[1])}}}Qb();var Zb={initialize:e=>{let t=e.processId;rc.number(t)&&Op===void 0&&setInterval(()=>{try{process.kill(t,0)}catch{process.exit(Yn?0:1)}},3e3)},get shutdownReceived(){return Yn},set shutdownReceived(e){Yn=e},exit:e=>{Co(),process.exit(e)}};function Kb(e,t,n,r){let i,o,s,u;return e!==void 0&&e.__brand==="features"&&(i=e,e=t,t=n,n=r),mn.ConnectionStrategy.is(e)||mn.ConnectionOptions.is(e)?u=e:(o=e,s=t,u=n),eR(o,s,u,i)}at.createConnection=Kb;function eR(e,t,n,r){let i=!1;if(!e&&!t&&process.argv.length>2){let d,p,_=process.argv.slice(2);for(let w=0;w<_.length;w++){let T=_[w];if(T==="--node-ipc"){e=new mn.IPCMessageReader(process),t=new mn.IPCMessageWriter(process);break}else if(T==="--stdio"){i=!0,e=process.stdin,t=process.stdout;break}else if(T==="--socket"){d=parseInt(_[w+1]);break}else if(T==="--pipe"){p=_[w+1];break}else{var o=T.split("=");if(o[0]==="--socket"){d=parseInt(o[1]);break}else if(o[0]==="--pipe"){p=o[1];break}}}if(d){let w=(0,mn.createServerSocketTransport)(d);e=w[0],t=w[1]}else if(p){let w=(0,mn.createServerPipeTransport)(p);e=w[0],t=w[1]}}var s="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!e)throw new Error("Connection input stream is not set. "+s);if(!t)throw new Error("Connection output stream is not set. "+s);if(rc.func(e.read)&&rc.func(e.on)){let d=e;d.on("end",()=>{Co(),process.exit(Yn?0:1)}),d.on("close",()=>{Co(),process.exit(Yn?0:1)})}let u=d=>{let p=(0,mn.createProtocolConnection)(e,t,d,n);return i&&tR(d),p};return(0,Yb.createConnection)(u,Zb,r)}function tR(e){function t(r){return r.map(i=>typeof i=="string"?i:(0,jp.inspect)(i)).join(" ")}let n=new Map;console.assert=function(i,...o){if(!i)if(o.length===0)e.error("Assertion failed");else{let[s,...u]=o;e.error(`Assertion failed: ${s} ${t(u)}`)}},console.count=function(i="default"){let o=String(i),s=n.get(o)??0;s+=1,n.set(o,s),e.log(`${o}: ${o}`)},console.countReset=function(i){i===void 0?n.clear():n.delete(String(i))},console.debug=function(...i){e.log(t(i))},console.dir=function(i,o){e.log((0,jp.inspect)(i,o))},console.log=function(...i){e.log(t(i))},console.error=function(...i){e.error(t(i))},console.trace=function(...i){let o=new Error().stack.replace(/(.+\n){2}/,""),s="Trace";i.length!==0&&(s+=`: ${t(i)}`),e.log(`${s}
|
|
37
|
+
${o}`)},console.warn=function(...i){e.warn(t(i))}}});var Er=x((qC,Mp)=>{"use strict";var nR="2.0.0",rR=Number.MAX_SAFE_INTEGER||9007199254740991,iR=16,oR=250,sR=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Mp.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:iR,MAX_SAFE_BUILD_LENGTH:oR,MAX_SAFE_INTEGER:rR,RELEASE_TYPES:sR,SEMVER_SPEC_VERSION:nR,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var xr=x((jC,Lp)=>{"use strict";var aR=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};Lp.exports=aR});var Qn=x((Et,$p)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:ic,MAX_SAFE_BUILD_LENGTH:cR,MAX_LENGTH:uR}=Er(),lR=xr();Et=$p.exports={};var dR=Et.re=[],fR=Et.safeRe=[],A=Et.src=[],pR=Et.safeSrc=[],O=Et.t={},hR=0,oc="[a-zA-Z0-9-]",gR=[["\\s",1],["\\d",uR],[oc,cR]],mR=e=>{for(let[t,n]of gR)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},G=(e,t,n)=>{let r=mR(t),i=hR++;lR(e,i,t),O[e]=i,A[i]=t,pR[i]=r,dR[i]=new RegExp(t,n?"g":void 0),fR[i]=new RegExp(r,n?"g":void 0)};G("NUMERICIDENTIFIER","0|[1-9]\\d*");G("NUMERICIDENTIFIERLOOSE","\\d+");G("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${oc}*`);G("MAINVERSION",`(${A[O.NUMERICIDENTIFIER]})\\.(${A[O.NUMERICIDENTIFIER]})\\.(${A[O.NUMERICIDENTIFIER]})`);G("MAINVERSIONLOOSE",`(${A[O.NUMERICIDENTIFIERLOOSE]})\\.(${A[O.NUMERICIDENTIFIERLOOSE]})\\.(${A[O.NUMERICIDENTIFIERLOOSE]})`);G("PRERELEASEIDENTIFIER",`(?:${A[O.NONNUMERICIDENTIFIER]}|${A[O.NUMERICIDENTIFIER]})`);G("PRERELEASEIDENTIFIERLOOSE",`(?:${A[O.NONNUMERICIDENTIFIER]}|${A[O.NUMERICIDENTIFIERLOOSE]})`);G("PRERELEASE",`(?:-(${A[O.PRERELEASEIDENTIFIER]}(?:\\.${A[O.PRERELEASEIDENTIFIER]})*))`);G("PRERELEASELOOSE",`(?:-?(${A[O.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${A[O.PRERELEASEIDENTIFIERLOOSE]})*))`);G("BUILDIDENTIFIER",`${oc}+`);G("BUILD",`(?:\\+(${A[O.BUILDIDENTIFIER]}(?:\\.${A[O.BUILDIDENTIFIER]})*))`);G("FULLPLAIN",`v?${A[O.MAINVERSION]}${A[O.PRERELEASE]}?${A[O.BUILD]}?`);G("FULL",`^${A[O.FULLPLAIN]}$`);G("LOOSEPLAIN",`[v=\\s]*${A[O.MAINVERSIONLOOSE]}${A[O.PRERELEASELOOSE]}?${A[O.BUILD]}?`);G("LOOSE",`^${A[O.LOOSEPLAIN]}$`);G("GTLT","((?:<|>)?=?)");G("XRANGEIDENTIFIERLOOSE",`${A[O.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);G("XRANGEIDENTIFIER",`${A[O.NUMERICIDENTIFIER]}|x|X|\\*`);G("XRANGEPLAIN",`[v=\\s]*(${A[O.XRANGEIDENTIFIER]})(?:\\.(${A[O.XRANGEIDENTIFIER]})(?:\\.(${A[O.XRANGEIDENTIFIER]})(?:${A[O.PRERELEASE]})?${A[O.BUILD]}?)?)?`);G("XRANGEPLAINLOOSE",`[v=\\s]*(${A[O.XRANGEIDENTIFIERLOOSE]})(?:\\.(${A[O.XRANGEIDENTIFIERLOOSE]})(?:\\.(${A[O.XRANGEIDENTIFIERLOOSE]})(?:${A[O.PRERELEASELOOSE]})?${A[O.BUILD]}?)?)?`);G("XRANGE",`^${A[O.GTLT]}\\s*${A[O.XRANGEPLAIN]}$`);G("XRANGELOOSE",`^${A[O.GTLT]}\\s*${A[O.XRANGEPLAINLOOSE]}$`);G("COERCEPLAIN",`(^|[^\\d])(\\d{1,${ic}})(?:\\.(\\d{1,${ic}}))?(?:\\.(\\d{1,${ic}}))?`);G("COERCE",`${A[O.COERCEPLAIN]}(?:$|[^\\d])`);G("COERCEFULL",A[O.COERCEPLAIN]+`(?:${A[O.PRERELEASE]})?(?:${A[O.BUILD]})?(?:$|[^\\d])`);G("COERCERTL",A[O.COERCE],!0);G("COERCERTLFULL",A[O.COERCEFULL],!0);G("LONETILDE","(?:~>?)");G("TILDETRIM",`(\\s*)${A[O.LONETILDE]}\\s+`,!0);Et.tildeTrimReplace="$1~";G("TILDE",`^${A[O.LONETILDE]}${A[O.XRANGEPLAIN]}$`);G("TILDELOOSE",`^${A[O.LONETILDE]}${A[O.XRANGEPLAINLOOSE]}$`);G("LONECARET","(?:\\^)");G("CARETTRIM",`(\\s*)${A[O.LONECARET]}\\s+`,!0);Et.caretTrimReplace="$1^";G("CARET",`^${A[O.LONECARET]}${A[O.XRANGEPLAIN]}$`);G("CARETLOOSE",`^${A[O.LONECARET]}${A[O.XRANGEPLAINLOOSE]}$`);G("COMPARATORLOOSE",`^${A[O.GTLT]}\\s*(${A[O.LOOSEPLAIN]})$|^$`);G("COMPARATOR",`^${A[O.GTLT]}\\s*(${A[O.FULLPLAIN]})$|^$`);G("COMPARATORTRIM",`(\\s*)${A[O.GTLT]}\\s*(${A[O.LOOSEPLAIN]}|${A[O.XRANGEPLAIN]})`,!0);Et.comparatorTrimReplace="$1$2$3";G("HYPHENRANGE",`^\\s*(${A[O.XRANGEPLAIN]})\\s+-\\s+(${A[O.XRANGEPLAIN]})\\s*$`);G("HYPHENRANGELOOSE",`^\\s*(${A[O.XRANGEPLAINLOOSE]})\\s+-\\s+(${A[O.XRANGEPLAINLOOSE]})\\s*$`);G("STAR","(<|>)?=?\\s*\\*");G("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");G("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Eo=x((NC,Wp)=>{"use strict";var yR=Object.freeze({loose:!0}),vR=Object.freeze({}),bR=e=>e?typeof e!="object"?yR:e:vR;Wp.exports=bR});var sc=x((IC,Vp)=>{"use strict";var Hp=/^[0-9]+$/,Up=(e,t)=>{let n=Hp.test(e),r=Hp.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1},RR=(e,t)=>Up(t,e);Vp.exports={compareIdentifiers:Up,rcompareIdentifiers:RR}});var $e=x((AC,zp)=>{"use strict";var xo=xr(),{MAX_LENGTH:Bp,MAX_SAFE_INTEGER:So}=Er(),{safeRe:To,t:ko}=Qn(),DR=Eo(),{compareIdentifiers:Zn}=sc(),ac=class e{constructor(t,n){if(n=DR(n),t instanceof e){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>Bp)throw new TypeError(`version is longer than ${Bp} characters`);xo("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let r=t.trim().match(n.loose?To[ko.LOOSE]:To[ko.FULL]);if(!r)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>So||this.major<0)throw new TypeError("Invalid major version");if(this.minor>So||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>So||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let o=+i;if(o>=0&&o<So)return o}return i}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(xo("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if(typeof t=="string"&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),Zn(this.major,t.major)||Zn(this.minor,t.minor)||Zn(this.patch,t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{let r=this.prerelease[n],i=t.prerelease[n];if(xo("prerelease compare",n,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return Zn(r,i)}while(++n)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let n=0;do{let r=this.build[n],i=t.build[n];if(xo("build compare",n,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return Zn(r,i)}while(++n)}inc(t,n,r){if(t.startsWith("pre")){if(!n&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(n){let i=`-${n}`.match(this.options.loose?To[ko.PRERELEASELOOSE]:To[ko.PRERELEASE]);if(!i||i[1]!==n)throw new Error(`invalid identifier: ${n}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,r),this.inc("pre",n,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,r),this.inc("pre",n,r);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(n===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(n){let o=[n,i];r===!1&&(o=[n]),Zn(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};zp.exports=ac});var yn=x((OC,Xp)=>{"use strict";var Gp=$e(),_R=(e,t,n=!1)=>{if(e instanceof Gp)return e;try{return new Gp(e,t)}catch(r){if(!n)return null;throw r}};Xp.exports=_R});var Yp=x((FC,Jp)=>{"use strict";var wR=yn(),PR=(e,t)=>{let n=wR(e,t);return n?n.version:null};Jp.exports=PR});var Zp=x((MC,Qp)=>{"use strict";var CR=yn(),ER=(e,t)=>{let n=CR(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null};Qp.exports=ER});var th=x((LC,eh)=>{"use strict";var Kp=$e(),xR=(e,t,n,r,i)=>{typeof n=="string"&&(i=r,r=n,n=void 0);try{return new Kp(e instanceof Kp?e.version:e,n).inc(t,r,i).version}catch{return null}};eh.exports=xR});var ih=x(($C,rh)=>{"use strict";var nh=yn(),SR=(e,t)=>{let n=nh(e,null,!0),r=nh(t,null,!0),i=n.compare(r);if(i===0)return null;let o=i>0,s=o?n:r,u=o?r:n,d=!!s.prerelease.length;if(!!u.prerelease.length&&!d){if(!u.patch&&!u.minor)return"major";if(u.compareMain(s)===0)return u.minor&&!u.patch?"minor":"patch"}let _=d?"pre":"";return n.major!==r.major?_+"major":n.minor!==r.minor?_+"minor":n.patch!==r.patch?_+"patch":"prerelease"};rh.exports=SR});var sh=x((WC,oh)=>{"use strict";var TR=$e(),kR=(e,t)=>new TR(e,t).major;oh.exports=kR});var ch=x((HC,ah)=>{"use strict";var qR=$e(),jR=(e,t)=>new qR(e,t).minor;ah.exports=jR});var lh=x((UC,uh)=>{"use strict";var NR=$e(),IR=(e,t)=>new NR(e,t).patch;uh.exports=IR});var fh=x((VC,dh)=>{"use strict";var AR=yn(),OR=(e,t)=>{let n=AR(e,t);return n&&n.prerelease.length?n.prerelease:null};dh.exports=OR});var ct=x((BC,hh)=>{"use strict";var ph=$e(),FR=(e,t,n)=>new ph(e,n).compare(new ph(t,n));hh.exports=FR});var mh=x((zC,gh)=>{"use strict";var MR=ct(),LR=(e,t,n)=>MR(t,e,n);gh.exports=LR});var vh=x((GC,yh)=>{"use strict";var $R=ct(),WR=(e,t)=>$R(e,t,!0);yh.exports=WR});var qo=x((XC,Rh)=>{"use strict";var bh=$e(),HR=(e,t,n)=>{let r=new bh(e,n),i=new bh(t,n);return r.compare(i)||r.compareBuild(i)};Rh.exports=HR});var _h=x((JC,Dh)=>{"use strict";var UR=qo(),VR=(e,t)=>e.sort((n,r)=>UR(n,r,t));Dh.exports=VR});var Ph=x((YC,wh)=>{"use strict";var BR=qo(),zR=(e,t)=>e.sort((n,r)=>BR(r,n,t));wh.exports=zR});var Sr=x((QC,Ch)=>{"use strict";var GR=ct(),XR=(e,t,n)=>GR(e,t,n)>0;Ch.exports=XR});var jo=x((ZC,Eh)=>{"use strict";var JR=ct(),YR=(e,t,n)=>JR(e,t,n)<0;Eh.exports=YR});var cc=x((KC,xh)=>{"use strict";var QR=ct(),ZR=(e,t,n)=>QR(e,t,n)===0;xh.exports=ZR});var uc=x((eE,Sh)=>{"use strict";var KR=ct(),eD=(e,t,n)=>KR(e,t,n)!==0;Sh.exports=eD});var No=x((tE,Th)=>{"use strict";var tD=ct(),nD=(e,t,n)=>tD(e,t,n)>=0;Th.exports=nD});var Io=x((nE,kh)=>{"use strict";var rD=ct(),iD=(e,t,n)=>rD(e,t,n)<=0;kh.exports=iD});var lc=x((rE,qh)=>{"use strict";var oD=cc(),sD=uc(),aD=Sr(),cD=No(),uD=jo(),lD=Io(),dD=(e,t,n,r)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e===n;case"!==":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e!==n;case"":case"=":case"==":return oD(e,n,r);case"!=":return sD(e,n,r);case">":return aD(e,n,r);case">=":return cD(e,n,r);case"<":return uD(e,n,r);case"<=":return lD(e,n,r);default:throw new TypeError(`Invalid operator: ${t}`)}};qh.exports=dD});var Nh=x((iE,jh)=>{"use strict";var fD=$e(),pD=yn(),{safeRe:Ao,t:Oo}=Qn(),hD=(e,t)=>{if(e instanceof fD)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let n=null;if(!t.rtl)n=e.match(t.includePrerelease?Ao[Oo.COERCEFULL]:Ao[Oo.COERCE]);else{let d=t.includePrerelease?Ao[Oo.COERCERTLFULL]:Ao[Oo.COERCERTL],p;for(;(p=d.exec(e))&&(!n||n.index+n[0].length!==e.length);)(!n||p.index+p[0].length!==n.index+n[0].length)&&(n=p),d.lastIndex=p.index+p[1].length+p[2].length;d.lastIndex=-1}if(n===null)return null;let r=n[2],i=n[3]||"0",o=n[4]||"0",s=t.includePrerelease&&n[5]?`-${n[5]}`:"",u=t.includePrerelease&&n[6]?`+${n[6]}`:"";return pD(`${r}.${i}.${o}${s}${u}`,t)};jh.exports=hD});var Ah=x((oE,Ih)=>{"use strict";var dc=class{constructor(){this.max=1e3,this.map=new Map}get(t){let n=this.map.get(t);if(n!==void 0)return this.map.delete(t),this.map.set(t,n),n}delete(t){return this.map.delete(t)}set(t,n){if(!this.delete(t)&&n!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(t,n)}return this}};Ih.exports=dc});var ut=x((sE,Lh)=>{"use strict";var gD=/\s+/g,fc=class e{constructor(t,n){if(n=yD(n),t instanceof e)return t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease?t:new e(t.raw,n);if(t instanceof pc)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=t.trim().replace(gD," "),this.set=this.raw.split("||").map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter(i=>!Fh(i[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&PD(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t<this.set.length;t++){t>0&&(this.formatted+="||");let n=this.set[t];for(let r=0;r<n.length;r++)r>0&&(this.formatted+=" "),this.formatted+=n[r].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){let r=((this.options.includePrerelease&&_D)|(this.options.loose&&wD))+":"+t,i=Oh.get(r);if(i)return i;let o=this.options.loose,s=o?Je[We.HYPHENRANGELOOSE]:Je[We.HYPHENRANGE];t=t.replace(s,ID(this.options.includePrerelease)),me("hyphen replace",t),t=t.replace(Je[We.COMPARATORTRIM],bD),me("comparator trim",t),t=t.replace(Je[We.TILDETRIM],RD),me("tilde trim",t),t=t.replace(Je[We.CARETTRIM],DD),me("caret trim",t);let u=t.split(" ").map(w=>CD(w,this.options)).join(" ").split(/\s+/).map(w=>ND(w,this.options));o&&(u=u.filter(w=>(me("loose invalid filter",w,this.options),!!w.match(Je[We.COMPARATORLOOSE])))),me("range list",u);let d=new Map,p=u.map(w=>new pc(w,this.options));for(let w of p){if(Fh(w))return[w];d.set(w.value,w)}d.size>1&&d.has("")&&d.delete("");let _=[...d.values()];return Oh.set(r,_),_}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(r=>Mh(r,n)&&t.set.some(i=>Mh(i,n)&&r.every(o=>i.every(s=>o.intersects(s,n)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new vD(t,this.options)}catch{return!1}for(let n=0;n<this.set.length;n++)if(AD(this.set[n],t,this.options))return!0;return!1}};Lh.exports=fc;var mD=Ah(),Oh=new mD,yD=Eo(),pc=Tr(),me=xr(),vD=$e(),{safeRe:Je,t:We,comparatorTrimReplace:bD,tildeTrimReplace:RD,caretTrimReplace:DD}=Qn(),{FLAG_INCLUDE_PRERELEASE:_D,FLAG_LOOSE:wD}=Er(),Fh=e=>e.value==="<0.0.0-0",PD=e=>e.value==="",Mh=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(o=>i.intersects(o,t)),i=r.pop();return n},CD=(e,t)=>(me("comp",e,t),e=SD(e,t),me("caret",e),e=ED(e,t),me("tildes",e),e=kD(e,t),me("xrange",e),e=jD(e,t),me("stars",e),e),He=e=>!e||e.toLowerCase()==="x"||e==="*",ED=(e,t)=>e.trim().split(/\s+/).map(n=>xD(n,t)).join(" "),xD=(e,t)=>{let n=t.loose?Je[We.TILDELOOSE]:Je[We.TILDE];return e.replace(n,(r,i,o,s,u)=>{me("tilde",e,r,i,o,s,u);let d;return He(i)?d="":He(o)?d=`>=${i}.0.0 <${+i+1}.0.0-0`:He(s)?d=`>=${i}.${o}.0 <${i}.${+o+1}.0-0`:u?(me("replaceTilde pr",u),d=`>=${i}.${o}.${s}-${u} <${i}.${+o+1}.0-0`):d=`>=${i}.${o}.${s} <${i}.${+o+1}.0-0`,me("tilde return",d),d})},SD=(e,t)=>e.trim().split(/\s+/).map(n=>TD(n,t)).join(" "),TD=(e,t)=>{me("caret",e,t);let n=t.loose?Je[We.CARETLOOSE]:Je[We.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,(i,o,s,u,d)=>{me("caret",e,i,o,s,u,d);let p;return He(o)?p="":He(s)?p=`>=${o}.0.0${r} <${+o+1}.0.0-0`:He(u)?o==="0"?p=`>=${o}.${s}.0${r} <${o}.${+s+1}.0-0`:p=`>=${o}.${s}.0${r} <${+o+1}.0.0-0`:d?(me("replaceCaret pr",d),o==="0"?s==="0"?p=`>=${o}.${s}.${u}-${d} <${o}.${s}.${+u+1}-0`:p=`>=${o}.${s}.${u}-${d} <${o}.${+s+1}.0-0`:p=`>=${o}.${s}.${u}-${d} <${+o+1}.0.0-0`):(me("no pr"),o==="0"?s==="0"?p=`>=${o}.${s}.${u}${r} <${o}.${s}.${+u+1}-0`:p=`>=${o}.${s}.${u}${r} <${o}.${+s+1}.0-0`:p=`>=${o}.${s}.${u} <${+o+1}.0.0-0`),me("caret return",p),p})},kD=(e,t)=>(me("replaceXRanges",e,t),e.split(/\s+/).map(n=>qD(n,t)).join(" ")),qD=(e,t)=>{e=e.trim();let n=t.loose?Je[We.XRANGELOOSE]:Je[We.XRANGE];return e.replace(n,(r,i,o,s,u,d)=>{me("xRange",e,r,i,o,s,u,d);let p=He(o),_=p||He(s),w=_||He(u),T=w;return i==="="&&T&&(i=""),d=t.includePrerelease?"-0":"",p?i===">"||i==="<"?r="<0.0.0-0":r="*":i&&T?(_&&(s=0),u=0,i===">"?(i=">=",_?(o=+o+1,s=0,u=0):(s=+s+1,u=0)):i==="<="&&(i="<",_?o=+o+1:s=+s+1),i==="<"&&(d="-0"),r=`${i+o}.${s}.${u}${d}`):_?r=`>=${o}.0.0${d} <${+o+1}.0.0-0`:w&&(r=`>=${o}.${s}.0${d} <${o}.${+s+1}.0-0`),me("xRange return",r),r})},jD=(e,t)=>(me("replaceStars",e,t),e.trim().replace(Je[We.STAR],"")),ND=(e,t)=>(me("replaceGTE0",e,t),e.trim().replace(Je[t.includePrerelease?We.GTE0PRE:We.GTE0],"")),ID=e=>(t,n,r,i,o,s,u,d,p,_,w,T)=>(He(r)?n="":He(i)?n=`>=${r}.0.0${e?"-0":""}`:He(o)?n=`>=${r}.${i}.0${e?"-0":""}`:s?n=`>=${n}`:n=`>=${n}${e?"-0":""}`,He(p)?d="":He(_)?d=`<${+p+1}.0.0-0`:He(w)?d=`<${p}.${+_+1}.0-0`:T?d=`<=${p}.${_}.${w}-${T}`:e?d=`<${p}.${_}.${+w+1}-0`:d=`<=${d}`,`${n} ${d}`.trim()),AD=(e,t,n)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let r=0;r<e.length;r++)if(me(e[r].semver),e[r].semver!==pc.ANY&&e[r].semver.prerelease.length>0){let i=e[r].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}});var Tr=x((aE,Bh)=>{"use strict";var kr=Symbol("SemVer ANY"),mc=class e{static get ANY(){return kr}constructor(t,n){if(n=$h(n),t instanceof e){if(t.loose===!!n.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),gc("comparator",t,n),this.options=n,this.loose=!!n.loose,this.parse(t),this.semver===kr?this.value="":this.value=this.operator+this.semver.version,gc("comp",this)}parse(t){let n=this.options.loose?Wh[Hh.COMPARATORLOOSE]:Wh[Hh.COMPARATOR],r=t.match(n);if(!r)throw new TypeError(`Invalid comparator: ${t}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new Uh(r[2],this.options.loose):this.semver=kr}toString(){return this.value}test(t){if(gc("Comparator.test",t,this.options.loose),this.semver===kr||t===kr)return!0;if(typeof t=="string")try{t=new Uh(t,this.options)}catch{return!1}return hc(t,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Vh(t.value,n).test(this.value):t.operator===""?t.value===""?!0:new Vh(this.value,n).test(t.semver):(n=$h(n),n.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||hc(this.semver,"<",t.semver,n)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||hc(this.semver,">",t.semver,n)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};Bh.exports=mc;var $h=Eo(),{safeRe:Wh,t:Hh}=Qn(),hc=lc(),gc=xr(),Uh=$e(),Vh=ut()});var qr=x((cE,zh)=>{"use strict";var OD=ut(),FD=(e,t,n)=>{try{t=new OD(t,n)}catch{return!1}return t.test(e)};zh.exports=FD});var Xh=x((uE,Gh)=>{"use strict";var MD=ut(),LD=(e,t)=>new MD(e,t).set.map(n=>n.map(r=>r.value).join(" ").trim().split(" "));Gh.exports=LD});var Yh=x((lE,Jh)=>{"use strict";var $D=$e(),WD=ut(),HD=(e,t,n)=>{let r=null,i=null,o=null;try{o=new WD(t,n)}catch{return null}return e.forEach(s=>{o.test(s)&&(!r||i.compare(s)===-1)&&(r=s,i=new $D(r,n))}),r};Jh.exports=HD});var Zh=x((dE,Qh)=>{"use strict";var UD=$e(),VD=ut(),BD=(e,t,n)=>{let r=null,i=null,o=null;try{o=new VD(t,n)}catch{return null}return e.forEach(s=>{o.test(s)&&(!r||i.compare(s)===1)&&(r=s,i=new UD(r,n))}),r};Qh.exports=BD});var tg=x((fE,eg)=>{"use strict";var yc=$e(),zD=ut(),Kh=Sr(),GD=(e,t)=>{e=new zD(e,t);let n=new yc("0.0.0");if(e.test(n)||(n=new yc("0.0.0-0"),e.test(n)))return n;n=null;for(let r=0;r<e.set.length;++r){let i=e.set[r],o=null;i.forEach(s=>{let u=new yc(s.semver.version);switch(s.operator){case">":u.prerelease.length===0?u.patch++:u.prerelease.push(0),u.raw=u.format();case"":case">=":(!o||Kh(u,o))&&(o=u);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!n||Kh(n,o))&&(n=o)}return n&&e.test(n)?n:null};eg.exports=GD});var rg=x((pE,ng)=>{"use strict";var XD=ut(),JD=(e,t)=>{try{return new XD(e,t).range||"*"}catch{return null}};ng.exports=JD});var Fo=x((hE,ag)=>{"use strict";var YD=$e(),sg=Tr(),{ANY:QD}=sg,ZD=ut(),KD=qr(),ig=Sr(),og=jo(),e_=Io(),t_=No(),n_=(e,t,n,r)=>{e=new YD(e,r),t=new ZD(t,r);let i,o,s,u,d;switch(n){case">":i=ig,o=e_,s=og,u=">",d=">=";break;case"<":i=og,o=t_,s=ig,u="<",d="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(KD(e,t,r))return!1;for(let p=0;p<t.set.length;++p){let _=t.set[p],w=null,T=null;if(_.forEach(P=>{P.semver===QD&&(P=new sg(">=0.0.0")),w=w||P,T=T||P,i(P.semver,w.semver,r)?w=P:s(P.semver,T.semver,r)&&(T=P)}),w.operator===u||w.operator===d||(!T.operator||T.operator===u)&&o(e,T.semver))return!1;if(T.operator===d&&s(e,T.semver))return!1}return!0};ag.exports=n_});var ug=x((gE,cg)=>{"use strict";var r_=Fo(),i_=(e,t,n)=>r_(e,t,">",n);cg.exports=i_});var dg=x((mE,lg)=>{"use strict";var o_=Fo(),s_=(e,t,n)=>o_(e,t,"<",n);lg.exports=s_});var hg=x((yE,pg)=>{"use strict";var fg=ut(),a_=(e,t,n)=>(e=new fg(e,n),t=new fg(t,n),e.intersects(t,n));pg.exports=a_});var mg=x((vE,gg)=>{"use strict";var c_=qr(),u_=ct();gg.exports=(e,t,n)=>{let r=[],i=null,o=null,s=e.sort((_,w)=>u_(_,w,n));for(let _ of s)c_(_,t,n)?(o=_,i||(i=_)):(o&&r.push([i,o]),o=null,i=null);i&&r.push([i,null]);let u=[];for(let[_,w]of r)_===w?u.push(_):!w&&_===s[0]?u.push("*"):w?_===s[0]?u.push(`<=${w}`):u.push(`${_} - ${w}`):u.push(`>=${_}`);let d=u.join(" || "),p=typeof t.raw=="string"?t.raw:String(t);return d.length<p.length?d:t}});var _g=x((bE,Dg)=>{"use strict";var yg=ut(),bc=Tr(),{ANY:vc}=bc,jr=qr(),Rc=ct(),l_=(e,t,n={})=>{if(e===t)return!0;e=new yg(e,n),t=new yg(t,n);let r=!1;e:for(let i of e.set){for(let o of t.set){let s=f_(i,o,n);if(r=r||s!==null,s)continue e}if(r)return!1}return!0},d_=[new bc(">=0.0.0-0")],vg=[new bc(">=0.0.0")],f_=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===vc){if(t.length===1&&t[0].semver===vc)return!0;n.includePrerelease?e=d_:e=vg}if(t.length===1&&t[0].semver===vc){if(n.includePrerelease)return!0;t=vg}let r=new Set,i,o;for(let P of e)P.operator===">"||P.operator===">="?i=bg(i,P,n):P.operator==="<"||P.operator==="<="?o=Rg(o,P,n):r.add(P.semver);if(r.size>1)return null;let s;if(i&&o){if(s=Rc(i.semver,o.semver,n),s>0)return null;if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(let P of r){if(i&&!jr(P,String(i),n)||o&&!jr(P,String(o),n))return null;for(let L of t)if(!jr(P,String(L),n))return!1;return!0}let u,d,p,_,w=o&&!n.includePrerelease&&o.semver.prerelease.length?o.semver:!1,T=i&&!n.includePrerelease&&i.semver.prerelease.length?i.semver:!1;w&&w.prerelease.length===1&&o.operator==="<"&&w.prerelease[0]===0&&(w=!1);for(let P of t){if(_=_||P.operator===">"||P.operator===">=",p=p||P.operator==="<"||P.operator==="<=",i){if(T&&P.semver.prerelease&&P.semver.prerelease.length&&P.semver.major===T.major&&P.semver.minor===T.minor&&P.semver.patch===T.patch&&(T=!1),P.operator===">"||P.operator===">="){if(u=bg(i,P,n),u===P&&u!==i)return!1}else if(i.operator===">="&&!jr(i.semver,String(P),n))return!1}if(o){if(w&&P.semver.prerelease&&P.semver.prerelease.length&&P.semver.major===w.major&&P.semver.minor===w.minor&&P.semver.patch===w.patch&&(w=!1),P.operator==="<"||P.operator==="<="){if(d=Rg(o,P,n),d===P&&d!==o)return!1}else if(o.operator==="<="&&!jr(o.semver,String(P),n))return!1}if(!P.operator&&(o||i)&&s!==0)return!1}return!(i&&p&&!o&&s!==0||o&&_&&!i&&s!==0||T||w)},bg=(e,t,n)=>{if(!e)return t;let r=Rc(e.semver,t.semver,n);return r>0?e:r<0||t.operator===">"&&e.operator===">="?t:e},Rg=(e,t,n)=>{if(!e)return t;let r=Rc(e.semver,t.semver,n);return r<0?e:r>0||t.operator==="<"&&e.operator==="<="?t:e};Dg.exports=l_});var Nr=x((RE,Cg)=>{"use strict";var Dc=Qn(),wg=Er(),p_=$e(),Pg=sc(),h_=yn(),g_=Yp(),m_=Zp(),y_=th(),v_=ih(),b_=sh(),R_=ch(),D_=lh(),__=fh(),w_=ct(),P_=mh(),C_=vh(),E_=qo(),x_=_h(),S_=Ph(),T_=Sr(),k_=jo(),q_=cc(),j_=uc(),N_=No(),I_=Io(),A_=lc(),O_=Nh(),F_=Tr(),M_=ut(),L_=qr(),$_=Xh(),W_=Yh(),H_=Zh(),U_=tg(),V_=rg(),B_=Fo(),z_=ug(),G_=dg(),X_=hg(),J_=mg(),Y_=_g();Cg.exports={parse:h_,valid:g_,clean:m_,inc:y_,diff:v_,major:b_,minor:R_,patch:D_,prerelease:__,compare:w_,rcompare:P_,compareLoose:C_,compareBuild:E_,sort:x_,rsort:S_,gt:T_,lt:k_,eq:q_,neq:j_,gte:N_,lte:I_,cmp:A_,coerce:O_,Comparator:F_,Range:M_,satisfies:L_,toComparators:$_,maxSatisfying:W_,minSatisfying:H_,minVersion:U_,validRange:V_,outside:B_,gtr:z_,ltr:G_,intersects:X_,simplifyRange:J_,subset:Y_,SemVer:p_,re:Dc.re,src:Dc.src,tokens:Dc.t,SEMVER_SPEC_VERSION:wg.SEMVER_SPEC_VERSION,RELEASE_TYPES:wg.RELEASE_TYPES,compareIdentifiers:Pg.compareIdentifiers,rcompareIdentifiers:Pg.rcompareIdentifiers}});var jy=te(require("fs")),Ny=te(require("path"));var Rn=te(require("process")),I=te(pe()),rn=te(Fp()),rs=te(Ti()),oe=te(require("path")),su=te(Nr()),Se=te(require("fs")),tt=te(pe());var Mr=te(require("fs")),Ie=te(require("path"));var Ye=te(require("path"));var _c=process.arch=="arm64"?process.platform+process.arch:process.platform,W="2.0",Eg="rescript-editor-analysis.exe",wc=Ye.join(Ye.dirname(__dirname),"..",Eg),Pc=Ye.join(Ye.dirname(__dirname),"analysis_binaries",_c,Eg);var xg=Ye.join("node_modules",".bin"),Sg=".bsb.lock",Ir="bsconfig.json",Ar="rescript.json",nn=Ye.join("lib","bs"),Tg=Ye.join("lib","ocaml"),Cc=Ye.join("lib","bs",".compiler.log"),Mo=Ye.join("lib","bs","compiler-info.json"),Lo=Ye.join("lib","bs","build.ninja"),Ec=Ye.join("lib","rewatch.lock"),xc=Ye.join("lib","rescript.lock"),xt=".res",Or=".resi",kg=".cmi",Sc="Start Build",qg="commonjs",jg=".js",Tc="rescript_configuration_request",Ng=1e4;var Q_=e=>{switch(e){case"esmodule":case"es6":return"es6";case"es6-global":return"es6_global";case"commonjs":default:return"js"}},Wo=(e,t)=>{let n=Ie.basename(e,Ie.extname(e));return Ie.format({dir:Ie.dirname(e),name:n,ext:t})},Fr=(e,t)=>{if(e==null)return null;let n=Ie.join(e,t);if(Mr.existsSync(n))return n;let r=Ie.dirname(e);return r===e?null:Fr(r,t)},Ho=e=>{try{let t=Ie.join(e,Ar),n=Ie.join(e,Ir),r=Mr.readFileSync(Mr.existsSync(t)?t:n,{encoding:"utf-8"});return JSON.parse(r)}catch{return null}},Ig=e=>{let t=e["package-specs"],n="",r=qg,i={module:r},o=jg;return t&&(!Array.isArray(t)&&typeof t!="string"&&t.module?i=t:typeof t=="string"?r=t:Array.isArray(t)&&t[0]&&(typeof t[0]=="string"?r=t[0]:i=t[0])),i.module&&(r=i.module),i["in-source"]||(n="lib/"+Q_(r)),i.suffix?o=i.suffix:e.suffix&&(o=e.suffix),[o,n]},Ag=(e,t)=>{let n=Ho(e);if(!n)return null;let[r,i]=Ig(n),o=Wo(t,r);return Ie.join(e,i,o)},Og=(e,t)=>{let n=Fr(Ie.join("..",e),Ar);if(n||(n=Fr(Ie.join("..",e),Ir)),!n)return null;let r=Ho(Ie.dirname(n));if(!r)return null;let[i,o]=Ig(r),s=Wo(t,i);return Ie.join(e,o,s)};var Mt=te(require("child_process")),Re=te(require("path"));var Mg;(function(e){function t(n){return typeof n=="string"}e.is=t})(Mg||(Mg={}));var kc;(function(e){function t(n){return typeof n=="string"}e.is=t})(kc||(kc={}));var Lg;(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(n){return typeof n=="number"&&e.MIN_VALUE<=n&&n<=e.MAX_VALUE}e.is=t})(Lg||(Lg={}));var Uo;(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(n){return typeof n=="number"&&e.MIN_VALUE<=n&&n<=e.MAX_VALUE}e.is=t})(Uo||(Uo={}));var bt;(function(e){function t(r,i){return r===Number.MAX_VALUE&&(r=Uo.MAX_VALUE),i===Number.MAX_VALUE&&(i=Uo.MAX_VALUE),{line:r,character:i}}e.create=t;function n(r){let i=r;return D.objectLiteral(i)&&D.uinteger(i.line)&&D.uinteger(i.character)}e.is=n})(bt||(bt={}));var Ee;(function(e){function t(r,i,o,s){if(D.uinteger(r)&&D.uinteger(i)&&D.uinteger(o)&&D.uinteger(s))return{start:bt.create(r,i),end:bt.create(o,s)};if(bt.is(r)&&bt.is(i))return{start:r,end:i};throw new Error(`Range#create called with invalid arguments[${r}, ${i}, ${o}, ${s}]`)}e.create=t;function n(r){let i=r;return D.objectLiteral(i)&&bt.is(i.start)&&bt.is(i.end)}e.is=n})(Ee||(Ee={}));var Vo;(function(e){function t(r,i){return{uri:r,range:i}}e.create=t;function n(r){let i=r;return D.objectLiteral(i)&&Ee.is(i.range)&&(D.string(i.uri)||D.undefined(i.uri))}e.is=n})(Vo||(Vo={}));var $g;(function(e){function t(r,i,o,s){return{targetUri:r,targetRange:i,targetSelectionRange:o,originSelectionRange:s}}e.create=t;function n(r){let i=r;return D.objectLiteral(i)&&Ee.is(i.targetRange)&&D.string(i.targetUri)&&Ee.is(i.targetSelectionRange)&&(Ee.is(i.originSelectionRange)||D.undefined(i.originSelectionRange))}e.is=n})($g||($g={}));var qc;(function(e){function t(r,i,o,s){return{red:r,green:i,blue:o,alpha:s}}e.create=t;function n(r){let i=r;return D.objectLiteral(i)&&D.numberRange(i.red,0,1)&&D.numberRange(i.green,0,1)&&D.numberRange(i.blue,0,1)&&D.numberRange(i.alpha,0,1)}e.is=n})(qc||(qc={}));var Wg;(function(e){function t(r,i){return{range:r,color:i}}e.create=t;function n(r){let i=r;return D.objectLiteral(i)&&Ee.is(i.range)&&qc.is(i.color)}e.is=n})(Wg||(Wg={}));var Hg;(function(e){function t(r,i,o){return{label:r,textEdit:i,additionalTextEdits:o}}e.create=t;function n(r){let i=r;return D.objectLiteral(i)&&D.string(i.label)&&(D.undefined(i.textEdit)||er.is(i))&&(D.undefined(i.additionalTextEdits)||D.typedArray(i.additionalTextEdits,er.is))}e.is=n})(Hg||(Hg={}));var Ug;(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(Ug||(Ug={}));var Vg;(function(e){function t(r,i,o,s,u,d){let p={startLine:r,endLine:i};return D.defined(o)&&(p.startCharacter=o),D.defined(s)&&(p.endCharacter=s),D.defined(u)&&(p.kind=u),D.defined(d)&&(p.collapsedText=d),p}e.create=t;function n(r){let i=r;return D.objectLiteral(i)&&D.uinteger(i.startLine)&&D.uinteger(i.startLine)&&(D.undefined(i.startCharacter)||D.uinteger(i.startCharacter))&&(D.undefined(i.endCharacter)||D.uinteger(i.endCharacter))&&(D.undefined(i.kind)||D.string(i.kind))}e.is=n})(Vg||(Vg={}));var jc;(function(e){function t(r,i){return{location:r,message:i}}e.create=t;function n(r){let i=r;return D.defined(i)&&Vo.is(i.location)&&D.string(i.message)}e.is=n})(jc||(jc={}));var Rt;(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(Rt||(Rt={}));var Lr;(function(e){e.Unnecessary=1,e.Deprecated=2})(Lr||(Lr={}));var Bg;(function(e){function t(n){let r=n;return D.objectLiteral(r)&&D.string(r.href)}e.is=t})(Bg||(Bg={}));var Bo;(function(e){function t(r,i,o,s,u,d){let p={range:r,message:i};return D.defined(o)&&(p.severity=o),D.defined(s)&&(p.code=s),D.defined(u)&&(p.source=u),D.defined(d)&&(p.relatedInformation=d),p}e.create=t;function n(r){var i;let o=r;return D.defined(o)&&Ee.is(o.range)&&D.string(o.message)&&(D.number(o.severity)||D.undefined(o.severity))&&(D.integer(o.code)||D.string(o.code)||D.undefined(o.code))&&(D.undefined(o.codeDescription)||D.string((i=o.codeDescription)===null||i===void 0?void 0:i.href))&&(D.string(o.source)||D.undefined(o.source))&&(D.undefined(o.relatedInformation)||D.typedArray(o.relatedInformation,jc.is))}e.is=n})(Bo||(Bo={}));var Kn;(function(e){function t(r,i,...o){let s={title:r,command:i};return D.defined(o)&&o.length>0&&(s.arguments=o),s}e.create=t;function n(r){let i=r;return D.defined(i)&&D.string(i.title)&&D.string(i.command)}e.is=n})(Kn||(Kn={}));var er;(function(e){function t(o,s){return{range:o,newText:s}}e.replace=t;function n(o,s){return{range:{start:o,end:o},newText:s}}e.insert=n;function r(o){return{range:o,newText:""}}e.del=r;function i(o){let s=o;return D.objectLiteral(s)&&D.string(s.newText)&&Ee.is(s.range)}e.is=i})(er||(er={}));var Nc;(function(e){function t(r,i,o){let s={label:r};return i!==void 0&&(s.needsConfirmation=i),o!==void 0&&(s.description=o),s}e.create=t;function n(r){let i=r;return D.objectLiteral(i)&&D.string(i.label)&&(D.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(D.string(i.description)||i.description===void 0)}e.is=n})(Nc||(Nc={}));var tr;(function(e){function t(n){let r=n;return D.string(r)}e.is=t})(tr||(tr={}));var zg;(function(e){function t(o,s,u){return{range:o,newText:s,annotationId:u}}e.replace=t;function n(o,s,u){return{range:{start:o,end:o},newText:s,annotationId:u}}e.insert=n;function r(o,s){return{range:o,newText:"",annotationId:s}}e.del=r;function i(o){let s=o;return er.is(s)&&(Nc.is(s.annotationId)||tr.is(s.annotationId))}e.is=i})(zg||(zg={}));var Ic;(function(e){function t(r,i){return{textDocument:r,edits:i}}e.create=t;function n(r){let i=r;return D.defined(i)&&Lc.is(i.textDocument)&&Array.isArray(i.edits)}e.is=n})(Ic||(Ic={}));var Ac;(function(e){function t(r,i,o){let s={kind:"create",uri:r};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(s.options=i),o!==void 0&&(s.annotationId=o),s}e.create=t;function n(r){let i=r;return i&&i.kind==="create"&&D.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||D.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||D.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||tr.is(i.annotationId))}e.is=n})(Ac||(Ac={}));var Oc;(function(e){function t(r,i,o,s){let u={kind:"rename",oldUri:r,newUri:i};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(u.options=o),s!==void 0&&(u.annotationId=s),u}e.create=t;function n(r){let i=r;return i&&i.kind==="rename"&&D.string(i.oldUri)&&D.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||D.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||D.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||tr.is(i.annotationId))}e.is=n})(Oc||(Oc={}));var Fc;(function(e){function t(r,i,o){let s={kind:"delete",uri:r};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(s.options=i),o!==void 0&&(s.annotationId=o),s}e.create=t;function n(r){let i=r;return i&&i.kind==="delete"&&D.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||D.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||D.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||tr.is(i.annotationId))}e.is=n})(Fc||(Fc={}));var Mc;(function(e){function t(n){let r=n;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(i=>D.string(i.kind)?Ac.is(i)||Oc.is(i)||Fc.is(i):Ic.is(i)))}e.is=t})(Mc||(Mc={}));var Gg;(function(e){function t(r){return{uri:r}}e.create=t;function n(r){let i=r;return D.defined(i)&&D.string(i.uri)}e.is=n})(Gg||(Gg={}));var Xg;(function(e){function t(r,i){return{uri:r,version:i}}e.create=t;function n(r){let i=r;return D.defined(i)&&D.string(i.uri)&&D.integer(i.version)}e.is=n})(Xg||(Xg={}));var Lc;(function(e){function t(r,i){return{uri:r,version:i}}e.create=t;function n(r){let i=r;return D.defined(i)&&D.string(i.uri)&&(i.version===null||D.integer(i.version))}e.is=n})(Lc||(Lc={}));var Jg;(function(e){function t(r,i,o,s){return{uri:r,languageId:i,version:o,text:s}}e.create=t;function n(r){let i=r;return D.defined(i)&&D.string(i.uri)&&D.string(i.languageId)&&D.integer(i.version)&&D.string(i.text)}e.is=n})(Jg||(Jg={}));var $c;(function(e){e.PlainText="plaintext",e.Markdown="markdown";function t(n){let r=n;return r===e.PlainText||r===e.Markdown}e.is=t})($c||($c={}));var $r;(function(e){function t(n){let r=n;return D.objectLiteral(n)&&$c.is(r.kind)&&D.string(r.value)}e.is=t})($r||($r={}));var Yg;(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(Yg||(Yg={}));var Qg;(function(e){e.PlainText=1,e.Snippet=2})(Qg||(Qg={}));var Zg;(function(e){e.Deprecated=1})(Zg||(Zg={}));var Kg;(function(e){function t(r,i,o){return{newText:r,insert:i,replace:o}}e.create=t;function n(r){let i=r;return i&&D.string(i.newText)&&Ee.is(i.insert)&&Ee.is(i.replace)}e.is=n})(Kg||(Kg={}));var em;(function(e){e.asIs=1,e.adjustIndentation=2})(em||(em={}));var tm;(function(e){function t(n){let r=n;return r&&(D.string(r.detail)||r.detail===void 0)&&(D.string(r.description)||r.description===void 0)}e.is=t})(tm||(tm={}));var nm;(function(e){function t(n){return{label:n}}e.create=t})(nm||(nm={}));var rm;(function(e){function t(n,r){return{items:n||[],isIncomplete:!!r}}e.create=t})(rm||(rm={}));var zo;(function(e){function t(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}e.fromPlainText=t;function n(r){let i=r;return D.string(i)||D.objectLiteral(i)&&D.string(i.language)&&D.string(i.value)}e.is=n})(zo||(zo={}));var im;(function(e){function t(n){let r=n;return!!r&&D.objectLiteral(r)&&($r.is(r.contents)||zo.is(r.contents)||D.typedArray(r.contents,zo.is))&&(n.range===void 0||Ee.is(n.range))}e.is=t})(im||(im={}));var om;(function(e){function t(n,r){return r?{label:n,documentation:r}:{label:n}}e.create=t})(om||(om={}));var sm;(function(e){function t(n,r,...i){let o={label:n};return D.defined(r)&&(o.documentation=r),D.defined(i)?o.parameters=i:o.parameters=[],o}e.create=t})(sm||(sm={}));var am;(function(e){e.Text=1,e.Read=2,e.Write=3})(am||(am={}));var cm;(function(e){function t(n,r){let i={range:n};return D.number(r)&&(i.kind=r),i}e.create=t})(cm||(cm={}));var um;(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(um||(um={}));var lm;(function(e){e.Deprecated=1})(lm||(lm={}));var dm;(function(e){function t(n,r,i,o,s){let u={name:n,kind:r,location:{uri:o,range:i}};return s&&(u.containerName=s),u}e.create=t})(dm||(dm={}));var fm;(function(e){function t(n,r,i,o){return o!==void 0?{name:n,kind:r,location:{uri:i,range:o}}:{name:n,kind:r,location:{uri:i}}}e.create=t})(fm||(fm={}));var pm;(function(e){function t(r,i,o,s,u,d){let p={name:r,detail:i,kind:o,range:s,selectionRange:u};return d!==void 0&&(p.children=d),p}e.create=t;function n(r){let i=r;return i&&D.string(i.name)&&D.number(i.kind)&&Ee.is(i.range)&&Ee.is(i.selectionRange)&&(i.detail===void 0||D.string(i.detail))&&(i.deprecated===void 0||D.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}e.is=n})(pm||(pm={}));var hm;(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(hm||(hm={}));var Go;(function(e){e.Invoked=1,e.Automatic=2})(Go||(Go={}));var gm;(function(e){function t(r,i,o){let s={diagnostics:r};return i!=null&&(s.only=i),o!=null&&(s.triggerKind=o),s}e.create=t;function n(r){let i=r;return D.defined(i)&&D.typedArray(i.diagnostics,Bo.is)&&(i.only===void 0||D.typedArray(i.only,D.string))&&(i.triggerKind===void 0||i.triggerKind===Go.Invoked||i.triggerKind===Go.Automatic)}e.is=n})(gm||(gm={}));var mm;(function(e){function t(r,i,o){let s={title:r},u=!0;return typeof i=="string"?(u=!1,s.kind=i):Kn.is(i)?s.command=i:s.edit=i,u&&o!==void 0&&(s.kind=o),s}e.create=t;function n(r){let i=r;return i&&D.string(i.title)&&(i.diagnostics===void 0||D.typedArray(i.diagnostics,Bo.is))&&(i.kind===void 0||D.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Kn.is(i.command))&&(i.isPreferred===void 0||D.boolean(i.isPreferred))&&(i.edit===void 0||Mc.is(i.edit))}e.is=n})(mm||(mm={}));var ym;(function(e){function t(r,i){let o={range:r};return D.defined(i)&&(o.data=i),o}e.create=t;function n(r){let i=r;return D.defined(i)&&Ee.is(i.range)&&(D.undefined(i.command)||Kn.is(i.command))}e.is=n})(ym||(ym={}));var vm;(function(e){function t(r,i){return{tabSize:r,insertSpaces:i}}e.create=t;function n(r){let i=r;return D.defined(i)&&D.uinteger(i.tabSize)&&D.boolean(i.insertSpaces)}e.is=n})(vm||(vm={}));var bm;(function(e){function t(r,i,o){return{range:r,target:i,data:o}}e.create=t;function n(r){let i=r;return D.defined(i)&&Ee.is(i.range)&&(D.undefined(i.target)||D.string(i.target))}e.is=n})(bm||(bm={}));var Rm;(function(e){function t(r,i){return{range:r,parent:i}}e.create=t;function n(r){let i=r;return D.objectLiteral(i)&&Ee.is(i.range)&&(i.parent===void 0||e.is(i.parent))}e.is=n})(Rm||(Rm={}));var Dm;(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"})(Dm||(Dm={}));var _m;(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(_m||(_m={}));var wm;(function(e){function t(n){let r=n;return D.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}e.is=t})(wm||(wm={}));var Pm;(function(e){function t(r,i){return{range:r,text:i}}e.create=t;function n(r){let i=r;return i!=null&&Ee.is(i.range)&&D.string(i.text)}e.is=n})(Pm||(Pm={}));var Cm;(function(e){function t(r,i,o){return{range:r,variableName:i,caseSensitiveLookup:o}}e.create=t;function n(r){let i=r;return i!=null&&Ee.is(i.range)&&D.boolean(i.caseSensitiveLookup)&&(D.string(i.variableName)||i.variableName===void 0)}e.is=n})(Cm||(Cm={}));var Em;(function(e){function t(r,i){return{range:r,expression:i}}e.create=t;function n(r){let i=r;return i!=null&&Ee.is(i.range)&&(D.string(i.expression)||i.expression===void 0)}e.is=n})(Em||(Em={}));var xm;(function(e){function t(r,i){return{frameId:r,stoppedLocation:i}}e.create=t;function n(r){let i=r;return D.defined(i)&&Ee.is(r.stoppedLocation)}e.is=n})(xm||(xm={}));var Wc;(function(e){e.Type=1,e.Parameter=2;function t(n){return n===1||n===2}e.is=t})(Wc||(Wc={}));var Hc;(function(e){function t(r){return{value:r}}e.create=t;function n(r){let i=r;return D.objectLiteral(i)&&(i.tooltip===void 0||D.string(i.tooltip)||$r.is(i.tooltip))&&(i.location===void 0||Vo.is(i.location))&&(i.command===void 0||Kn.is(i.command))}e.is=n})(Hc||(Hc={}));var Sm;(function(e){function t(r,i,o){let s={position:r,label:i};return o!==void 0&&(s.kind=o),s}e.create=t;function n(r){let i=r;return D.objectLiteral(i)&&bt.is(i.position)&&(D.string(i.label)||D.typedArray(i.label,Hc.is))&&(i.kind===void 0||Wc.is(i.kind))&&i.textEdits===void 0||D.typedArray(i.textEdits,er.is)&&(i.tooltip===void 0||D.string(i.tooltip)||$r.is(i.tooltip))&&(i.paddingLeft===void 0||D.boolean(i.paddingLeft))&&(i.paddingRight===void 0||D.boolean(i.paddingRight))}e.is=n})(Sm||(Sm={}));var Tm;(function(e){function t(n){return{kind:"snippet",value:n}}e.createSnippet=t})(Tm||(Tm={}));var km;(function(e){function t(n,r,i,o){return{insertText:n,filterText:r,range:i,command:o}}e.create=t})(km||(km={}));var qm;(function(e){function t(n){return{items:n}}e.create=t})(qm||(qm={}));var jm;(function(e){e.Invoked=0,e.Automatic=1})(jm||(jm={}));var Nm;(function(e){function t(n,r){return{range:n,text:r}}e.create=t})(Nm||(Nm={}));var Im;(function(e){function t(n,r){return{triggerKind:n,selectedCompletionInfo:r}}e.create=t})(Im||(Im={}));var Am;(function(e){function t(n){let r=n;return D.objectLiteral(r)&&kc.is(r.uri)&&D.string(r.name)}e.is=t})(Am||(Am={}));var Om;(function(e){function t(o,s,u,d){return new Uc(o,s,u,d)}e.create=t;function n(o){let s=o;return!!(D.defined(s)&&D.string(s.uri)&&(D.undefined(s.languageId)||D.string(s.languageId))&&D.uinteger(s.lineCount)&&D.func(s.getText)&&D.func(s.positionAt)&&D.func(s.offsetAt))}e.is=n;function r(o,s){let u=o.getText(),d=i(s,(_,w)=>{let T=_.range.start.line-w.range.start.line;return T===0?_.range.start.character-w.range.start.character:T}),p=u.length;for(let _=d.length-1;_>=0;_--){let w=d[_],T=o.offsetAt(w.range.start),P=o.offsetAt(w.range.end);if(P<=p)u=u.substring(0,T)+w.newText+u.substring(P,u.length);else throw new Error("Overlapping edit");p=T}return u}e.applyEdits=r;function i(o,s){if(o.length<=1)return o;let u=o.length/2|0,d=o.slice(0,u),p=o.slice(u);i(d,s),i(p,s);let _=0,w=0,T=0;for(;_<d.length&&w<p.length;)s(d[_],p[w])<=0?o[T++]=d[_++]:o[T++]=p[w++];for(;_<d.length;)o[T++]=d[_++];for(;w<p.length;)o[T++]=p[w++];return o}})(Om||(Om={}));var Uc=class{constructor(t,n,r,i){this._uri=t,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(t){if(t){let n=this.offsetAt(t.start),r=this.offsetAt(t.end);return this._content.substring(n,r)}return this._content}update(t,n){this._content=t.text,this._version=n,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let t=[],n=this._content,r=!0;for(let i=0;i<n.length;i++){r&&(t.push(i),r=!1);let o=n.charAt(i);r=o==="\r"||o===`
|
|
38
38
|
`,o==="\r"&&i+1<n.length&&n.charAt(i+1)===`
|
|
39
|
-
`&&i++}r&&n.length>0&&t.push(n.length),this._lineOffsets=t}return this._lineOffsets}positionAt(t){t=Math.max(Math.min(t,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return
|
|
40
|
-
`}),u+=`${w}`}else r.end.character-r.start.character>2&&(u+=", "),u+=e.map(p=>`${p}: ${o}`).join(", ");let d={title:"Add missing record fields",edit:{changes:{[n]:Z_(r,u)}},diagnostics:[i],kind:Ot.CodeActionKind.QuickFix,isPreferred:!0};return t[n].push({range:r,codeAction:d}),!0}return!1},rw=async({array:e,codeActions:t,diagnostic:n,file:r,index:i,line:o,range:s})=>{if(o.startsWith("Some record fields are undefined:")){let u=o.trim().split("Some record fields are undefined: ")[1]?.split(" ");return e.slice(i+1).forEach(d=>{u.push(...d.trim().split(" "))}),Wm({recordFieldNames:u,codeActions:t,diagnostic:n,file:r,range:s,todoValue:'failwith("TODO")'})}return!1},iw=async({array:e,codeActions:t,diagnostic:n,file:r,index:i,line:o,range:s})=>{if(o.startsWith("Some required record fields are missing:")){let u=o;u.endsWith(".")&&(u=u.slice(0,u.length-1));let d=u.trim().split("Some required record fields are missing: ")[1]?.split(" "),p=!1;return e.slice(i+1).forEach(_=>{p||(d.push(..._.trim().split(".")[0].split(" ")),_.includes(".")&&(p=!0))}),Wm({recordFieldNames:d,codeActions:t,diagnostic:n,file:r,range:s,todoValue:"%todo"})}return!1},ow=async({line:e,codeActions:t,file:n,range:r,diagnostic:i})=>{if(e.startsWith("You can convert ")){let o=/You can convert (\w*) to (\w*) with ([\w.]*).$/,s=e.match(o);if(s===null)return!1;let[u,d,p,_]=s;if(d!=null&&p!=null&&_!=null){t[n]=t[n]||[];let w={title:`Convert ${d} to ${p} with ${_}`,edit:{changes:{[n]:Xo(r,`${_}(`,")")}},diagnostics:[i],kind:Ot.CodeActionKind.QuickFix,isPreferred:!0};return t[n].push({range:r,codeAction:w}),!0}}return!1},sw=async({line:e,codeActions:t,file:n,range:r,diagnostic:i})=>{if(e.startsWith("This is an uncurried ReScript function. It must be applied with a dot.")){let o={line:r.end.line,character:r.end.character+1};t[n]=t[n]||[];let s={title:"Apply uncurried function call with dot",edit:{changes:{[n]:[{range:{start:o,end:o},newText:". "}]}},diagnostics:[i],kind:Ot.CodeActionKind.QuickFix,isPreferred:!0};return t[n].push({range:r,codeAction:s}),!0}return!1},aw=async({line:e,codeActions:t,file:n,range:r,diagnostic:i,array:o,index:s})=>{if(e.startsWith("You forgot to handle a possible case here, for example:")){let u=o.slice(s+1).join("").trim(),d=(0,Lm.fileURLToPath)(n),p=await Rt(d,["codemod",d,r.start.line,r.start.character,"add-missing-cases",u]);t[n]=t[n]||[];let _={title:"Insert missing cases",edit:{changes:{[n]:K_(r,p)}},diagnostics:[i],kind:Ot.CodeActionKind.QuickFix,isPreferred:!0};return t[n].push({range:r,codeAction:_}),!0}return!1},cw=async({line:e,codeActions:t,file:n,range:r,diagnostic:i,array:o,index:s})=>{let u="This has type:";if(e.startsWith(u)){let d=ew([e.slice(u.length),...o.slice(s+1)],"Somewhere wanted:"),p=o.slice(s+d.length).map(T=>T.replace("Somewhere wanted:","")),_=Mm(d),w=Mm(p);if(_===`option<${w}>`){t[n]=t[n]||[];let T="assert false";switch(w){case"string":{T='"-"';break}case"bool":{T="false";break}case"int":{T="-1";break}case"float":{T="-1.";break}}let P={title:"Unwrap optional value",edit:{changes:{[n]:Xo(r,"switch ",` { | None => ${T} | Some(v) => v }`)}},diagnostics:[i],kind:Ot.CodeActionKind.QuickFix,isPreferred:!0};return t[n].push({range:r,codeAction:P}),!0}if(`option<${_}>`===w){t[n]=t[n]||[];let T={title:"Wrap value in Some",edit:{changes:{[n]:Xo(r,"Some(",")")}},diagnostics:[i],kind:Ot.CodeActionKind.QuickFix,isPreferred:!0};return t[n].push({range:r,codeAction:T}),!0}}return!1};var Yo=[],Vc={},Hm=e=>(Yo.push(e),()=>{Yo=Yo.filter(t=>t!==e)}),Um=(e,t)=>{(Vc[e]==null||Vc[e]<Date.now()-9e5)&&(Vc[e]=Date.now(),Yo.forEach(n=>n(t)))};var lw={extensionConfiguration:{askToStartBuild:!0,inlayHints:{enable:!1,maxLength:25},codeLens:!1,binaryPath:null,platformPath:null,signatureHelp:{enabled:!0,forConstructorPayloads:!0},incrementalTypechecking:{enable:!0,acrossFiles:!1,debugLogging:!1},cache:{projectConfig:{enable:!0}}}},K=lw;var xe=new Map;var St=require("fs/promises"),Ft=require("path");async function dw(e,t=12){let n=[],r=[{dir:e,depth:0}],i=new Set;for(;r.length;){let{dir:o,depth:s}=r.pop();if(s>t||i.has(o))continue;i.add(o);let u;try{u=await(0,St.readdir)(o)}catch{continue}if(u.includes("node_modules")){let d=(0,Ft.join)(o,"node_modules");try{if((await(0,St.stat)(d)).isDirectory()){n.push(d);continue}}catch{}}for(let d of u){if(d==="node_modules"||d.startsWith("."))continue;let p=(0,Ft.join)(o,d);try{(await(0,St.stat)(p)).isDirectory()&&r.push({dir:p,depth:s+1})}catch{}}}return n}async function Vm(e,t){let n=(0,Ft.join)(t,e),r;try{r=await(0,St.readdir)(n)}catch{return[]}let i=r.filter(s=>s.startsWith("@rescript+runtime@"));if(i.length===0)return[];let o=[];for(let s of i){let u=(0,Ft.join)(n,s,"node_modules","@rescript","runtime");try{(await(0,St.stat)(u)).isDirectory()&&o.push(u)}catch{}}return o}async function fw(e){let t=(0,Ft.resolve)(e,Mo);try{let i=await(0,St.readFile)(t,"utf8"),o=JSON.parse(i);if(o&&o.runtime_path)return[o.runtime_path]}catch{}let n=await dw(e);return(await Promise.all(n.map(async i=>{let o=[],s=(0,Ft.join)(i,"@rescript","runtime");try{if((await(0,St.stat)(s)).isDirectory())return o.push(s),o}catch{}let u=await Vm(".pnpm",i);if(o.push(...u),o.length>0)return o;let d=await Vm(".deno",i);return o.push(...d),o})).then(i=>i.flatMap(o=>o))).map(i=>(0,Ft.resolve)(i))}function pw(){let e=new Map;return async t=>{if(e.has(t))return e.get(t);let n=await fw(t);return e.set(t,n),n}}var Bm=pw();var hw="rescript_format_file_"+process.pid+"_",Bc=0,Lt=(e="")=>{let t=hw+Bc+e;return Bc=Bc+1,Re.join(Zo.tmpdir(),t)},Gm=e=>{let t=Re.dirname(e);return Tt.default.existsSync(Re.join(t,Ar))||Tt.default.existsSync(Re.join(t,Ir))?t:t===e?null:Gm(t)},et=(e,t)=>{let n=null;for(let r of xe.keys())e.startsWith(r)&&(!t||e!==r)&&(n==null||r.length>n.length)&&(n=r);if(n!=null)return n;{let r=Re.extname(e)==="";return Gm(r&&!t?Re.join(e,"dummy.res"):e)}},Ur=async(e,t)=>{if(K.extensionConfiguration.platformPath!=null)return Re.join(K.extensionConfiguration.platformPath,t);if(e!==null)try{let s=Re.resolve(e,Mo),u=await zc.default.readFile(s,"utf8"),d=JSON.parse(u);if(d&&d.bsc_path){let p=d.bsc_path;return t==="bsc.exe"?p:Re.join(Re.dirname(p),t)}}catch{}let n=Fr(e,Re.join("node_modules","rescript"));if(n==null)return null;let r=null,i=null;try{let s=Re.join(n,"package.json"),u=JSON.parse(await zc.default.readFile(s,"utf-8"));r=u.version,i=u.bin.rescript}catch{return null}let o=null;if(t=="rescript")o=Re.join(n,i);else if(Wr.default.gte(r,"12.0.0-alpha.13")){let s=`${process.platform}-${process.arch}`,u=Re.join(n,"..",`@rescript/${s}/bin.js`),{binPaths:d}=await import(u);t=="bsc.exe"?o=d.bsc_exe:t=="rescript-editor-analysis.exe"?o=d.rescript_editor_analysis_exe:t=="rewatch.exe"?o=d.rewatch_exe:t=="rescript.exe"&&(o=d.rescript_exe)}else o=Re.join(n,_c,t);return o!=null&&Tt.default.existsSync(o)?o:null},Xm=e=>Ur(e,"rescript"),Gc=e=>Ur(e,"bsc.exe"),Jm=e=>Ur(e,"rescript-editor-analysis.exe"),Ym=e=>Ur(e,"rewatch.exe"),Qm=e=>Ur(e,"rescript.exe"),Zm=(e,t,n)=>{let r=Re.extname(t),i=Lt(r);Tt.default.writeFileSync(i,n,{encoding:"utf-8"});try{if(e!=null)return{kind:"success",result:Mt.execFileSync(e,["-color","never","-format",i]).toString()};throw new Error("Could not find ReScript compiler for project.")}catch(o){return{kind:"error",error:o instanceof Error?o.message:String(o)}}finally{Tt.default.unlink(i,()=>null)}};async function Ko(e){if(e==null)return;let t=await Gc(e);if(t!=null)try{return Mt.execSync(`${t} -v`).toString().replace(/rescript/gi,"").trim()}catch{return}}var Qo=null;Tt.default.existsSync(wc)?Qo=wc:Tt.default.existsSync(Pc)&&(Qo=Pc);var Rt=async(e,t,n=!1)=>{let r=et(e);if(r==null&&n)return null;let i=xe.get(r??"")?.rescriptVersion??await Ko(r),o=Qo,s=r?xe.get(r):null,u=Wr.default.valid(i)&&Wr.default.lt(i,"12.0.0-alpha.5");if(!u&&s!=null)o=s.editorAnalysisLocation;else{if(!u&&s==null)return null;o=Qo}let d;Wr.default.gt(i,"12.0.0-rc.1")&&(d=await gw(r)??void 0);let p={cwd:r||void 0,maxBuffer:1/0,env:{...process.env,RESCRIPT_VERSION:i,RESCRIPT_INCREMENTAL_TYPECHECKING:K.extensionConfiguration.incrementalTypechecking?.enable===!0?"true":void 0,RESCRIPT_PROJECT_CONFIG_CACHE:K.extensionConfiguration.cache?.projectConfig?.enable===!0?"true":void 0,RESCRIPT_RUNTIME:d}};if(o==null)return null;let _="";try{return _=Mt.execFileSync(o,t,p).toString(),JSON.parse(_)}catch(w){return console.error(w),console.error("Original response: ",_),console.error("Args: ",t),Um(String(t[0]),String(w)),null}},lt=async(e,t,n,r=!0)=>{let i=await Rt(e,t,r);return{jsonrpc:W,id:n.id,result:i}},Xc=async(e,t)=>await Rt(e,["references",e,t.line,t.character]),zm=e=>e.replace(/(?:^\w|[A-Z]|\b\w)/g,t=>t.toUpperCase()).replace(/(\s|-)+/g,"");function Jc(e){return e==null||[...Array.from(nr).map(r=>Re.resolve(r,Ec)),...Array.from(nr).map(r=>Re.resolve(r,xc)),Re.resolve(e,Ec),Re.resolve(e,xc)].some(r=>Tt.default.existsSync(r))?null:et(e,!0)}var Dt=new Map;async function Yc(e){if(Dt.has(e))return Dt.get(e);let t=K.extensionConfiguration.runtimePath??null;if(t!==null)return Dt.set(e,t),t;let r=(await Bm(e)).at(0)??null;return Dt.set(e,r),r}async function gw(e){if(e==null)return null;if(Dt.has(e))return Dt.get(e);let t=Jc(e)??e;if(Dt.has(t)){let r=Dt.get(t);return Dt.set(e,r),r}let n=await Yc(t);return Dt.set(t,n),Dt.set(e,n),n}var Vr=e=>{let t=Ho(e),n="";return t?(t.namespace===!0?n=zm(t.name):typeof t.namespace=="string"&&(n=zm(t.namespace)),{kind:"success",result:n}):{kind:"error",error:"Could not read ReScript config file"}},Km=(e,t)=>{let n={kind:"error",error:"Could not read ReScript config file"},r=e.split(t)[1],i=Ag(t,r);if(!i)return n;let o=i;if(!Tt.default.existsSync(o)){let s=Og(t,r);if(!s)return n;o=s}return{kind:"success",result:o}},ey=(e,t)=>{let n={cwd:t};return process.platform==="win32"?Mt.exec(`"${e}".cmd build -w`,n):Mt.execFile(e,["build","-w"],n)},Hr=e=>process.platform==="win32"?`file:\\\\\\${e}`:`file://${e}`,mw=e=>{let t=/(.+)\:(\d+)\:(\d+)(-(\d+)(\:(\d+))?)?$/,n=e.trim(),r=n.match(t);if(r===null)return{file:Hr(n),range:{start:{line:0,character:0},end:{line:0,character:0}}};let[i,o,s,u,d,p,_,w]=r,T;if(d==null){let P={line:parseInt(s)-1,character:parseInt(u)};T={start:P,end:P}}else{let P=w==null,[L,H]=P?[s,p]:[p,w];T={start:{line:parseInt(s)-1,character:parseInt(u)-1},end:{line:parseInt(L)-1,character:parseInt(H)}}}return{file:Hr(o),range:T}},es=async e=>{let t=[],n=[],r=e.split(Zo.EOL),i=!1;for(let u=0;u<r.length;u++){let d=r[u];if(d.startsWith(" We've found a bug for you!"))t.push({code:void 0,severity:bt.Error,tag:void 0,content:[]});else if(!d.startsWith("FAILED: cannot make progress due to previous errors.")){if(!d.startsWith("FAILED: dependency cycle"))if(d.startsWith("FAILED:"))t.push({code:void 0,severity:bt.Error,tag:void 0,content:[d]});else if(d.startsWith("Fatal error:"))t.push({code:void 0,severity:bt.Error,tag:void 0,content:[d]});else if(d.startsWith(" Warning number ")){let p=parseInt(d.slice(17)),_;switch(p){case 11:case 20:case 26:case 27:case 32:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 60:case 66:case 67:case 101:_=Lr.Unnecessary;break;case 3:_=Lr.Deprecated;break}let w=d.includes("(configured as error)")?bt.Error:bt.Warning;t.push({code:Number.isNaN(p)?void 0:p,severity:w,tag:_,content:[]})}else d.startsWith(" Syntax error!")?t.push({code:void 0,severity:bt.Error,tag:void 0,content:[]}):d.startsWith(" Warning genType")?t.push({code:void 0,severity:bt.Error,tag:void 0,content:[]}):d.startsWith("#Start(")||(d.startsWith("#Done(")?i=!0:d.startsWith("File ")&&u+1<r.length&&r[u+1].startsWith("Warning ")?u++:d.startsWith("File ")&&u+1<r.length&&r[u+1].startsWith("Error: Syntax error")?(t.push({code:void 0,severity:bt.Error,tag:void 0,content:[r[u],r[u+1]]}),u++):/^ +([0-9]+| +|\.) (│|┆)/.test(d)||(d.startsWith(" ")?t[t.length-1]==null?n.push(d):t[t.length-1].content.push(d.slice(2)):d.trim()!=""&&(t[t.length-1]==null?n.push(d):t[t.length-1].content.push(d))))}}let o={},s={};for(let u of t){let[d,...p]=u.content,{file:_,range:w}=mw(d);o[_]==null&&(o[_]=[]);let T=p.join(`
|
|
41
|
-
`).trim();if(T!=""){let P={severity:u.severity,tags:u.tag===void 0?[]:[u.tag],code:u.code,range:w,source:"ReScript",message:T};await $m({addFoundActionsHere:s,diagnostic:P,diagnosticMessage:p,file:_,range:w}),o[_].push(P)}}return{done:i,result:o,codeActions:s,linesWithParseErrors:n}},
|
|
42
|
-
#Done()`),H=Object.values(L)[0]??[];H.forEach(y=>{if(y.codeAction.edit!=null&&y.codeAction.edit.changes!=null){let v=Object.values(y.codeAction.edit.changes)[0];y.codeAction.edit.changes={[(0,Zc.pathToFileURL)(e.file.sourceFilePath).toString()]:v}}}),e.codeActions=H;let se=(Object.values(P)[0]??[]).map(y=>({...y,message:bw(y.message)})).filter(y=>!y.message.startsWith("Uninterpreted extension 'rescript.")&&(!y.message.includes(`/${
|
|
39
|
+
`&&i++}r&&n.length>0&&t.push(n.length),this._lineOffsets=t}return this._lineOffsets}positionAt(t){t=Math.max(Math.min(t,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return bt.create(0,t);for(;r<i;){let s=Math.floor((r+i)/2);n[s]>t?i=s:r=s+1}let o=r-1;return bt.create(o,t-n[o])}offsetAt(t){let n=this.getLineOffsets();if(t.line>=n.length)return this._content.length;if(t.line<0)return 0;let r=n[t.line],i=t.line+1<n.length?n[t.line+1]:this._content.length;return Math.max(Math.min(r+t.character,i),r)}get lineCount(){return this.getLineOffsets().length}},D;(function(e){let t=Object.prototype.toString;function n(P){return typeof P<"u"}e.defined=n;function r(P){return typeof P>"u"}e.undefined=r;function i(P){return P===!0||P===!1}e.boolean=i;function o(P){return t.call(P)==="[object String]"}e.string=o;function s(P){return t.call(P)==="[object Number]"}e.number=s;function u(P,L,H){return t.call(P)==="[object Number]"&&L<=P&&P<=H}e.numberRange=u;function d(P){return t.call(P)==="[object Number]"&&-2147483648<=P&&P<=2147483647}e.integer=d;function p(P){return t.call(P)==="[object Number]"&&0<=P&&P<=2147483647}e.uinteger=p;function _(P){return t.call(P)==="[object Function]"}e.func=_;function w(P){return P!==null&&typeof P=="object"}e.objectLiteral=w;function T(P,L){return Array.isArray(P)&&P.every(L)}e.typedArray=T})(D||(D={}));var Tt=te(require("fs")),zc=te(require("fs/promises")),Zo=te(require("os")),Wr=te(Nr());var Ot=te(pe());var Lm=require("url"),Xo=(e,t,n)=>{let r=e.start.line===e.end.line&&e.start.character===e.end.character?1:0,i={start:{line:e.start.line,character:e.start.character-r},end:{line:e.start.line,character:e.start.character-r}},o={start:{line:e.end.line,character:e.end.character},end:{line:e.end.line,character:e.end.character}};return[{range:i,newText:t},{range:o,newText:n}]},K_=(e,t)=>{let n={line:e.end.line,character:e.end.character-1};return[{range:{start:n,end:n},newText:t}]},ew=(e,t)=>[{range:e,newText:t}],Fm=e=>{let t=e.trim();return t.endsWith(",")?t.slice(0,t.length-1):t},Mm=e=>{let t=[];for(let n=0;n<=e.length-1;n+=1){let r=e[n];if(r.includes("(defined as")){let[i,o]=r.split("(defined as");t.push(Fm(i));break}else t.push(Fm(r))}return t.join("").trim()},tw=(e,t)=>{let n=[],r=e.slice(),i=!1;return r.forEach(o=>{i||(o.startsWith(t)?i=!0:n.push(o))}),n},$m=async({diagnostic:e,diagnosticMessage:t,file:n,range:r,addFoundActionsHere:i})=>{for(let[o,s]of t.entries()){let u=[uw,nw,iw,ow,sw,aw,cw,rw];for(let d of u){let p=!1;try{p=await d({array:t,codeActions:i,diagnostic:e,file:n,index:o,line:s,range:r})}catch(_){console.error(_)}if(p)break}}},nw=async({codeActions:e,diagnostic:t,file:n,line:r,range:i})=>{if(r.startsWith("Hint: Did you mean")){let o=/Did you mean ([A-Za-z0-9_]*)?/,s=r.match(o);if(s===null)return!1;let[u,d]=s;if(d!=null){e[n]=e[n]||[];let p={title:`Replace with '${d}'`,edit:{changes:{[n]:[{range:i,newText:d}]}},diagnostics:[t],kind:Ot.CodeActionKind.QuickFix,isPreferred:!0};return e[n].push({range:i,codeAction:p}),!0}}return!1},rw=async({codeActions:e,diagnostic:t,file:n,line:r,range:i,array:o,index:s})=>{if(r.startsWith("This pattern matches values of type")){let u=/This pattern matches values of type (.*)$/,d=r.match(u);if(d===null)return!1;let[p,_]=d;if(!_.startsWith("option<")){let w=o.slice(s+1),T=w.findIndex(H=>H.trim().startsWith("but a pattern was expected which matches values of type"));if(T===-1)return!1;let[P,L=""]=w[T].split("but a pattern was expected which matches values of type");if(L.trim()===""&&(L=(w[T+1]??"").trim()),L.trim().startsWith("option<")){e[n]=e[n]||[];let H={title:"Wrap in option Some",edit:{changes:{[n]:Xo(i,"Some(",")")}},diagnostics:[t],kind:Ot.CodeActionKind.QuickFix,isPreferred:!0};return e[n].push({range:i,codeAction:H}),!0}}}return!1},Wm=({recordFieldNames:e,codeActions:t,file:n,range:r,diagnostic:i,todoValue:o})=>{if(e!=null){t[n]=t[n]||[];let s=r.start.line!==r.end.line,u="";if(s){let p=s?r.end.character+2:0,_=Array.from({length:p}).join(" "),w=Array.from({length:r.end.character}).join(" ");e.forEach((T,P)=>{P===0?u+=" ":u+=_,u+=`${T}: ${o},
|
|
40
|
+
`}),u+=`${w}`}else r.end.character-r.start.character>2&&(u+=", "),u+=e.map(p=>`${p}: ${o}`).join(", ");let d={title:"Add missing record fields",edit:{changes:{[n]:K_(r,u)}},diagnostics:[i],kind:Ot.CodeActionKind.QuickFix,isPreferred:!0};return t[n].push({range:r,codeAction:d}),!0}return!1},iw=async({array:e,codeActions:t,diagnostic:n,file:r,index:i,line:o,range:s})=>{if(o.startsWith("Some record fields are undefined:")){let u=o.trim().split("Some record fields are undefined: ")[1]?.split(" ");return e.slice(i+1).forEach(d=>{u.push(...d.trim().split(" "))}),Wm({recordFieldNames:u,codeActions:t,diagnostic:n,file:r,range:s,todoValue:'failwith("TODO")'})}return!1},ow=async({array:e,codeActions:t,diagnostic:n,file:r,index:i,line:o,range:s})=>{if(o.startsWith("Some required record fields are missing:")){let u=o;u.endsWith(".")&&(u=u.slice(0,u.length-1));let d=u.trim().split("Some required record fields are missing: ")[1]?.split(" "),p=!1;return e.slice(i+1).forEach(_=>{p||(d.push(..._.trim().split(".")[0].split(" ")),_.includes(".")&&(p=!0))}),Wm({recordFieldNames:d,codeActions:t,diagnostic:n,file:r,range:s,todoValue:"%todo"})}return!1},sw=async({line:e,codeActions:t,file:n,range:r,diagnostic:i})=>{if(e.startsWith("You can convert ")){let o=/You can convert (\w*) to (\w*) with ([\w.]*).$/,s=e.match(o);if(s===null)return!1;let[u,d,p,_]=s;if(d!=null&&p!=null&&_!=null){t[n]=t[n]||[];let w={title:`Convert ${d} to ${p} with ${_}`,edit:{changes:{[n]:Xo(r,`${_}(`,")")}},diagnostics:[i],kind:Ot.CodeActionKind.QuickFix,isPreferred:!0};return t[n].push({range:r,codeAction:w}),!0}}return!1},aw=async({line:e,codeActions:t,file:n,range:r,diagnostic:i})=>{if(e.startsWith("This is an uncurried ReScript function. It must be applied with a dot.")){let o={line:r.end.line,character:r.end.character+1};t[n]=t[n]||[];let s={title:"Apply uncurried function call with dot",edit:{changes:{[n]:[{range:{start:o,end:o},newText:". "}]}},diagnostics:[i],kind:Ot.CodeActionKind.QuickFix,isPreferred:!0};return t[n].push({range:r,codeAction:s}),!0}return!1},cw=async({line:e,codeActions:t,file:n,range:r,diagnostic:i,array:o,index:s})=>{if(e.startsWith("You forgot to handle a possible case here, for example:")){let u=o.slice(s+1).join("").trim(),d=(0,Lm.fileURLToPath)(n),p=await Dt(d,["codemod",d,r.start.line,r.start.character,"add-missing-cases",u]);t[n]=t[n]||[];let _={title:"Insert missing cases",edit:{changes:{[n]:ew(r,p)}},diagnostics:[i],kind:Ot.CodeActionKind.QuickFix,isPreferred:!0};return t[n].push({range:r,codeAction:_}),!0}return!1},uw=async({line:e,codeActions:t,file:n,range:r,diagnostic:i,array:o,index:s})=>{let u="This has type:";if(e.startsWith(u)){let d=tw([e.slice(u.length),...o.slice(s+1)],"Somewhere wanted:"),p=o.slice(s+d.length).map(T=>T.replace("Somewhere wanted:","")),_=Mm(d),w=Mm(p);if(_===`option<${w}>`){t[n]=t[n]||[];let T="assert false";switch(w){case"string":{T='"-"';break}case"bool":{T="false";break}case"int":{T="-1";break}case"float":{T="-1.";break}}let P={title:"Unwrap optional value",edit:{changes:{[n]:Xo(r,"switch ",` { | None => ${T} | Some(v) => v }`)}},diagnostics:[i],kind:Ot.CodeActionKind.QuickFix,isPreferred:!0};return t[n].push({range:r,codeAction:P}),!0}if(`option<${_}>`===w){t[n]=t[n]||[];let T={title:"Wrap value in Some",edit:{changes:{[n]:Xo(r,"Some(",")")}},diagnostics:[i],kind:Ot.CodeActionKind.QuickFix,isPreferred:!0};return t[n].push({range:r,codeAction:T}),!0}}return!1};var Yo=[],Vc={},Hm=e=>(Yo.push(e),()=>{Yo=Yo.filter(t=>t!==e)}),Um=(e,t)=>{(Vc[e]==null||Vc[e]<Date.now()-9e5)&&(Vc[e]=Date.now(),Yo.forEach(n=>n(t)))};var dw={extensionConfiguration:{askToStartBuild:!0,inlayHints:{enable:!1,maxLength:25},codeLens:!1,binaryPath:null,platformPath:null,signatureHelp:{enabled:!0,forConstructorPayloads:!0},incrementalTypechecking:{enable:!0,acrossFiles:!1,debugLogging:!1},cache:{projectConfig:{enable:!0}}}},K=dw;var xe=new Map;var St=require("fs/promises"),Ft=require("path");async function fw(e,t=12){let n=[],r=[{dir:e,depth:0}],i=new Set;for(;r.length;){let{dir:o,depth:s}=r.pop();if(s>t||i.has(o))continue;i.add(o);let u;try{u=await(0,St.readdir)(o)}catch{continue}if(u.includes("node_modules")){let d=(0,Ft.join)(o,"node_modules");try{if((await(0,St.stat)(d)).isDirectory()){n.push(d);continue}}catch{}}for(let d of u){if(d==="node_modules"||d.startsWith("."))continue;let p=(0,Ft.join)(o,d);try{(await(0,St.stat)(p)).isDirectory()&&r.push({dir:p,depth:s+1})}catch{}}}return n}async function Vm(e,t){let n=(0,Ft.join)(t,e),r;try{r=await(0,St.readdir)(n)}catch{return[]}let i=r.filter(s=>s.startsWith("@rescript+runtime@"));if(i.length===0)return[];let o=[];for(let s of i){let u=(0,Ft.join)(n,s,"node_modules","@rescript","runtime");try{(await(0,St.stat)(u)).isDirectory()&&o.push(u)}catch{}}return o}async function pw(e){let t=(0,Ft.resolve)(e,Mo);try{let i=await(0,St.readFile)(t,"utf8"),o=JSON.parse(i);if(o&&o.runtime_path)return[o.runtime_path]}catch{}let n=await fw(e);return(await Promise.all(n.map(async i=>{let o=[],s=(0,Ft.join)(i,"@rescript","runtime");try{if((await(0,St.stat)(s)).isDirectory())return o.push(s),o}catch{}let u=await Vm(".pnpm",i);if(o.push(...u),o.length>0)return o;let d=await Vm(".deno",i);return o.push(...d),o})).then(i=>i.flatMap(o=>o))).map(i=>(0,Ft.resolve)(i))}async function Bm(e){return await pw(e)}var hw="rescript_format_file_"+process.pid+"_",Bc=0,Lt=(e="")=>{let t=hw+Bc+e;return Bc=Bc+1,Re.join(Zo.tmpdir(),t)},Gm=e=>{let t=Re.dirname(e);return Tt.default.existsSync(Re.join(t,Ar))||Tt.default.existsSync(Re.join(t,Ir))?t:t===e?null:Gm(t)},et=(e,t)=>{let n=null;for(let r of xe.keys())e.startsWith(r)&&(!t||e!==r)&&(n==null||r.length>n.length)&&(n=r);if(n!=null)return n;{let r=Re.extname(e)==="";return Gm(r&&!t?Re.join(e,"dummy.res"):e)}},Ur=async(e,t)=>{if(K.extensionConfiguration.platformPath!=null)return Re.join(K.extensionConfiguration.platformPath,t);if(e!==null)try{let s=Re.resolve(e,Mo),u=await zc.default.readFile(s,"utf8"),d=JSON.parse(u);if(d&&d.bsc_path){let p=d.bsc_path;return t==="bsc.exe"?p:Re.join(Re.dirname(p),t)}}catch{}let n=Fr(e,Re.join("node_modules","rescript"));if(n==null)return null;let r=null,i=null;try{let s=Re.join(n,"package.json"),u=JSON.parse(await zc.default.readFile(s,"utf-8"));r=u.version,i=u.bin.rescript}catch{return null}let o=null;if(t=="rescript")o=Re.join(n,i);else if(Wr.default.gte(r,"12.0.0-alpha.13")){let s=`${process.platform}-${process.arch}`,u=Re.join(n,"..",`@rescript/${s}/bin.js`),{binPaths:d}=await import(u);t=="bsc.exe"?o=d.bsc_exe:t=="rescript-editor-analysis.exe"?o=d.rescript_editor_analysis_exe:t=="rewatch.exe"?o=d.rewatch_exe:t=="rescript.exe"&&(o=d.rescript_exe)}else o=Re.join(n,_c,t);return o!=null&&Tt.default.existsSync(o)?o:null},Xm=e=>Ur(e,"rescript"),Gc=e=>Ur(e,"bsc.exe"),Jm=e=>Ur(e,"rescript-editor-analysis.exe"),Ym=e=>Ur(e,"rewatch.exe"),Qm=e=>Ur(e,"rescript.exe"),Zm=(e,t,n)=>{let r=Re.extname(t),i=Lt(r);Tt.default.writeFileSync(i,n,{encoding:"utf-8"});try{if(e!=null)return{kind:"success",result:Mt.execFileSync(e,["-color","never","-format",i]).toString()};throw new Error("Could not find ReScript compiler for project.")}catch(o){return{kind:"error",error:o instanceof Error?o.message:String(o)}}finally{Tt.default.unlink(i,()=>null)}};async function Ko(e){if(e==null)return;let t=await Gc(e);if(t!=null)try{return Mt.execSync(`${t} -v`).toString().replace(/rescript/gi,"").trim()}catch{return}}var Qo=null;Tt.default.existsSync(wc)?Qo=wc:Tt.default.existsSync(Pc)&&(Qo=Pc);var Dt=async(e,t,n=!1)=>{let r=et(e);if(r==null&&n)return null;let i=xe.get(r??"")?.rescriptVersion??await Ko(r),o=Qo,s=r?xe.get(r):null,u=Wr.default.valid(i)&&Wr.default.lt(i,"12.0.0-alpha.5");if(!u&&s!=null)o=s.editorAnalysisLocation;else{if(!u&&s==null)return null;o=Qo}let d;Wr.default.gt(i,"12.0.0-rc.1")&&(d=await gw(r)??void 0);let p={cwd:r||void 0,maxBuffer:1/0,env:{...process.env,RESCRIPT_VERSION:i,RESCRIPT_INCREMENTAL_TYPECHECKING:K.extensionConfiguration.incrementalTypechecking?.enable===!0?"true":void 0,RESCRIPT_PROJECT_CONFIG_CACHE:K.extensionConfiguration.cache?.projectConfig?.enable===!0?"true":void 0,RESCRIPT_RUNTIME:d}};if(o==null)return null;let _="";try{return _=Mt.execFileSync(o,t,p).toString(),JSON.parse(_)}catch(w){return console.error(w),console.error("Original response: ",_),console.error("Args: ",t),Um(String(t[0]),String(w)),null}},dt=async(e,t,n,r=!0)=>{let i=await Dt(e,t,r);return{jsonrpc:W,id:n.id,result:i}},Xc=async(e,t)=>await Dt(e,["references",e,t.line,t.character]),zm=e=>e.replace(/(?:^\w|[A-Z]|\b\w)/g,t=>t.toUpperCase()).replace(/(\s|-)+/g,"");function Jc(e){return e==null||[...Array.from(nr).map(r=>Re.resolve(r,Ec)),...Array.from(nr).map(r=>Re.resolve(r,xc)),Re.resolve(e,Ec),Re.resolve(e,xc)].some(r=>Tt.default.existsSync(r))?null:et(e,!0)}var lt=new Map;async function Yc(e){if(lt.has(e))return lt.get(e);let t=K.extensionConfiguration.runtimePath??null;if(t!==null)return lt.set(e,t),t;let r=(await Bm(e)).at(0)??null;return lt.set(e,r),r}async function gw(e){if(e==null)return null;if(lt.has(e))return lt.get(e);let t=Jc(e)??e;if(lt.has(t)){let r=lt.get(t);return lt.set(e,r),r}let n=await Yc(t);return lt.set(t,n),lt.set(e,n),n}function Km(){return Object.fromEntries(lt)}var Vr=e=>{let t=Ho(e),n="";return t?(t.namespace===!0?n=zm(t.name):typeof t.namespace=="string"&&(n=zm(t.namespace)),{kind:"success",result:n}):{kind:"error",error:"Could not read ReScript config file"}},ey=(e,t)=>{let n={kind:"error",error:"Could not read ReScript config file"},r=e.split(t)[1],i=Ag(t,r);if(!i)return n;let o=i;if(!Tt.default.existsSync(o)){let s=Og(t,r);if(!s)return n;o=s}return{kind:"success",result:o}},ty=(e,t)=>{let n={cwd:t};return process.platform==="win32"?Mt.exec(`"${e}".cmd build -w`,n):Mt.execFile(e,["build","-w"],n)},Hr=e=>process.platform==="win32"?`file:\\\\\\${e}`:`file://${e}`,mw=e=>{let t=/(.+)\:(\d+)\:(\d+)(-(\d+)(\:(\d+))?)?$/,n=e.trim(),r=n.match(t);if(r===null)return{file:Hr(n),range:{start:{line:0,character:0},end:{line:0,character:0}}};let[i,o,s,u,d,p,_,w]=r,T;if(d==null){let P={line:parseInt(s)-1,character:parseInt(u)};T={start:P,end:P}}else{let P=w==null,[L,H]=P?[s,p]:[p,w];T={start:{line:parseInt(s)-1,character:parseInt(u)-1},end:{line:parseInt(L)-1,character:parseInt(H)}}}return{file:Hr(o),range:T}},es=async e=>{let t=[],n=[],r=e.split(Zo.EOL),i=!1;for(let u=0;u<r.length;u++){let d=r[u];if(d.startsWith(" We've found a bug for you!"))t.push({code:void 0,severity:Rt.Error,tag:void 0,content:[]});else if(!d.startsWith("FAILED: cannot make progress due to previous errors.")){if(!d.startsWith("FAILED: dependency cycle"))if(d.startsWith("FAILED:"))t.push({code:void 0,severity:Rt.Error,tag:void 0,content:[d]});else if(d.startsWith("Fatal error:"))t.push({code:void 0,severity:Rt.Error,tag:void 0,content:[d]});else if(d.startsWith(" Warning number ")){let p=parseInt(d.slice(17)),_;switch(p){case 11:case 20:case 26:case 27:case 32:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 60:case 66:case 67:case 101:_=Lr.Unnecessary;break;case 3:_=Lr.Deprecated;break}let w=d.includes("(configured as error)")?Rt.Error:Rt.Warning;t.push({code:Number.isNaN(p)?void 0:p,severity:w,tag:_,content:[]})}else d.startsWith(" Syntax error!")?t.push({code:void 0,severity:Rt.Error,tag:void 0,content:[]}):d.startsWith(" Warning genType")?t.push({code:void 0,severity:Rt.Error,tag:void 0,content:[]}):d.startsWith("#Start(")||(d.startsWith("#Done(")?i=!0:d.startsWith("File ")&&u+1<r.length&&r[u+1].startsWith("Warning ")?u++:d.startsWith("File ")&&u+1<r.length&&r[u+1].startsWith("Error: Syntax error")?(t.push({code:void 0,severity:Rt.Error,tag:void 0,content:[r[u],r[u+1]]}),u++):/^ +([0-9]+| +|\.) (│|┆)/.test(d)||(d.startsWith(" ")?t[t.length-1]==null?n.push(d):t[t.length-1].content.push(d.slice(2)):d.trim()!=""&&(t[t.length-1]==null?n.push(d):t[t.length-1].content.push(d))))}}let o={},s={};for(let u of t){let[d,...p]=u.content,{file:_,range:w}=mw(d);o[_]==null&&(o[_]=[]);let T=p.join(`
|
|
41
|
+
`).trim();if(T!=""){let P={severity:u.severity,tags:u.tag===void 0?[]:[u.tag],code:u.code,range:w,source:"ReScript",message:T};await $m({addFoundActionsHere:s,diagnostic:P,diagnosticMessage:p,file:_,range:w}),o[_].push(P)}}return{done:i,result:o,codeActions:s,linesWithParseErrors:n}},ny=(e,t)=>!(t.start.line<e.start.line||t.end.line<e.start.line||t.start.line>e.end.line||t.end.line>e.end.line||t.start.line===e.start.line&&t.start.character<e.start.character||t.end.line===e.end.line&&t.end.character>e.end.character);var cu=require("console"),ue=require("url");var ye=te(require("path")),$t=te(require("fs"));var Zc=require("url"),ts=require("perf_hooks"),dy=te(pe()),fy=te(require("node:child_process")),Kc=te(Nr()),py=te(require("os"));var ry=te(require("path"));var iy=te(require("node:child_process")),oy=te(pe()),vn=te(Nr());async function yw(e){return Yc(e.project.workspaceRootPath)}async function sy(e,t,n,r){let i=r.buildRewatch;if(i!=null&&i.lastFile===r.file.sourceFilePath)return Promise.resolve(i.compilerArgs);try{let o=n.get(r.project.rootPath);if(o?.rescriptVersion==null)return null;let s=ry.resolve(r.project.workspaceRootPath,"node_modules/@rolandpeelen/rewatch/rewatch"),u=null;vn.default.valid(o.rescriptVersion)&&vn.default.satisfies(o.rescriptVersion,">11",{includePrerelease:!0})&&(u=await Ym(r.project.workspaceRootPath)),vn.default.valid(o.rescriptVersion)&&vn.default.satisfies(o.rescriptVersion,">=12.0.0-beta.1",{includePrerelease:!0})&&(u=await Qm(r.project.workspaceRootPath)),u!=null?(s=u,qe()&&console.log(`Found rewatch binary bundled with v12: ${u}`)):qe()&&console.log("Did not find rewatch binary bundled with v12");let d=vn.default.satisfies(o.rescriptVersion,">=12.0.0-beta.2",{includePrerelease:!0})?["compiler-args",r.file.sourceFilePath]:["--rescript-version",o.rescriptVersion,"--compiler-args",r.file.sourceFilePath],p={};if(t!=null&&(p.RESCRIPT_BSC_EXE=t),vn.default.satisfies(o.rescriptVersion,">=12.0.0-beta.11",{includePrerelease:!0})){let w=await yw(r);if(w!==null)p.RESCRIPT_RUNTIME=w;else{let T={type:oy.MessageType.Error,message:"[Incremental type checking] The @rescript/runtime package was not found in your project. It is normally included with ReScript, but either it's missing or could not be detected. Check that it exists in your dependencies, or configure 'rescript.settings.runtimePath' to point to it. Without this package, incremental type checking may not work as expected."};e({jsonrpc:W,method:"window/showMessage",params:T})}}let _=JSON.parse(iy.execFileSync(s,d,{env:p}).toString().trim());return r.buildRewatch={lastFile:r.file.sourceFilePath,compilerArgs:_},_}catch(o){return console.error(o),null}}var ay=te(require("path")),Qc=te(require("fs"));async function cy(e){let t=ay.resolve(e.project.rootPath,Lo),n;try{n=await Qc.default.promises.stat(t)}catch{return null}let r=e.buildNinja;if(r&&r.fileMtime>=n.mtimeMs)return r.rawExtracted;let i=await Qc.default.promises.open(t,"r");try{let o=!1,s=!1,u=[];for await(let d of i.readLines()){let p=String(d).trim();if(o&&(u.push(p),o=!1,s&&u.length===2))break;p.startsWith("rule astj")?(o=!0,s=!0):p.startsWith("rule mij")&&(o=!0)}return u.length!==2?null:(e.buildNinja={fileMtime:n.mtimeMs,rawExtracted:u},u)}finally{await i.close()}}function qe(){return K.extensionConfiguration.incrementalTypechecking?.debugLogging??!1}var hy="___incremental",rr=ye.join(nn,hy),bn=new Map,uy=new Set,tu=new Map;function gy(e){let t=tu.get(e);if(t!=null){let n=bn.get(t);n!=null&&(qe()&&console.log("[watcher] Cleaning up incremental files for "+t),n.compilation!=null&&(qe()&&console.log("[watcher] Was compiling, killing"),clearTimeout(n.compilation.timeout),n.killCompilationListeners.forEach(r=>r()),n.compilation=null),yy(n.file.sourceFilePath,n.project.rootPath))}}function nu(e,t){$t.default.rm(ye.resolve(e,rr),{force:!0,recursive:!0},n=>{t?.()})}function my(e){qe()&&console.log("Recreating incremental file folder"),nu(e,()=>{$t.default.mkdir(ye.resolve(e,rr),{recursive:!0},t=>{})})}function yy(e,t){let n=e.endsWith(".resi")?".resi":".res",r=Vr(t),i=ye.basename(e,n),o=r.kind==="success"&&r.result!==""?`${i}-${r.result}`:i;qe()&&console.log("Cleaning up incremental file assets for: "+i),$t.default.unlink(ye.resolve(t,rr,ye.basename(e)),s=>{}),[o+".ast",o+".cmt",o+".cmti",o+".cmi",o+".cmj"].forEach(s=>{$t.default.unlink(ye.resolve(t,rr,s),u=>{})})}async function vw(e,t){return t.buildSystem==="bsb"?await cy(t):await sy(e,t.project.bscBinaryLocation,xe,t)}function eu(e){let t=[];for(let n=0;n<=e.length-1;n++){let r=e[n],i=n+1,o=e[i]??"";if(r.startsWith("-")&&o.startsWith("-"))t.push([r]);else if(r.startsWith("-")&&o.startsWith("'")){let s=[o.slice(1)];for(let u=i+1;u<=e.length-1;u++){let d=e[u],p=!1;if(d.endsWith("'")&&(d=d.slice(0,d.length-1),n=u,p=!0),s.push(d),p)break}t.push([r,s.join(" ")])}else r.startsWith("-")&&t.push([r,o])}return t}function ly(e){let t=e.trim().split("command = ")[1].split(" ").map(n=>n.trim()).filter(n=>n!=="");return eu(t)}function bw(e){let t=/\x1B[@-_][0-?]*[ -/]*[@-~]/g;return e.replace(t,"")}function Rw(e,t,n,r){let i=bn.get(e);if(i==null){let d=et(e);if(d==null){qe()&&console.log("Did not find project root path for "+e);return}let p=xe.get(d);if(p==null){qe()&&console.log("Did not find open project for "+e);return}let _=Jc(d),w=_??d,T=_==null&&d!=null&&et(d,!0)!=null;T&&qe()?console.log("Found rewatch/rescript lockfile in project root, treating as local package in workspace"):!T&&qe()&&console.log("Did not find rewatch/rescript lockfile in project root, assuming bsb");let P=p.bscBinaryLocation;if(P==null){qe()&&console.log("Could not find bsc binary location for "+e);return}let L=e.endsWith(".resi")?".resi":".res",H=ye.basename(e,L),se=p.namespaceName!=null?`${H}-${p.namespaceName}`:H,U=ye.join(d,rr),y=ye.resolve(d,nn,ye.relative(d,e)),v=ye.parse(y);v.ext=L===".res"?".cmt":".cmti",v.base="",y=ye.format(v),i={file:{originalTypeFileLocation:y,extension:L,moduleName:H,moduleNameNamespaced:se,sourceFileName:H+L,sourceFilePath:e,incrementalFilePath:ye.join(U,H+L)},project:{workspaceRootPath:w??d,rootPath:d,callArgs:Promise.resolve([]),bscBinaryLocation:P,incrementalFolderPath:U},buildSystem:T?"rewatch":"bsb",buildRewatch:null,buildNinja:null,compilation:null,killCompilationListeners:[],codeActions:[]},i.project.callArgs=vy(n,i),tu.set(i.file.originalTypeFileLocation,i.file.sourceFilePath),bn.set(e,i)}if(i==null)return;let o=i;o.compilation!=null&&(clearTimeout(o.compilation.timeout),o.killCompilationListeners.forEach(d=>d()),o.killCompilationListeners=[]);let s=ts.performance.now(),u=setTimeout(()=>{ww(o,t,n,r)},20);o.compilation!=null?(o.compilation.timeout=u,o.compilation.triggerToken=s):o.compilation={timeout:u,triggerToken:s}}function Dw(e,t){return bn.get(e)?.compilation?.triggerToken===t}var _w=py.platform()==="win32";async function vy(e,t){let n=xe.get(t.project.rootPath);if(n?.rescriptVersion==null)return qe()&&console.log("Found no project (or ReScript version) for "+t.file.sourceFilePath),null;let r=await vw(e,t);if(r==null)return null;let i=[],o=[],s=Array.isArray(r);if(Array.isArray(r)){let[d,p]=r;i=ly(d),o=ly(p)}else i=eu(r.parser_args),o=eu(r.compiler_args);let u=[];return K.extensionConfiguration.incrementalTypechecking?.acrossFiles&&u.push("-I",ye.resolve(t.project.rootPath,rr)),o.forEach(([d,p])=>{if(d==="-I")s?(p=p.startsWith('"')&&p.endsWith('"')?p.substring(1,p.length-1):p,_w&&p.includes(":\\")?u.push("-I",p):u.push("-I",ye.resolve(t.project.rootPath,nn,p))):p==="."?u.push("-I",ye.resolve(t.project.rootPath,Tg)):u.push("-I",p);else if(d==="-bs-v")u.push("-bs-v",Date.now().toString());else{if(d==="-bs-package-output")return;p==null||p===""?u.push(d):u.push(d,p)}}),i.forEach(([d,p])=>{(d.startsWith("-bs-jsx")||d.startsWith("-ppx"))&&u.push(d,p)}),u.push("-color","never"),Kc.default.valid(n.rescriptVersion)&&Kc.default.satisfies(n.rescriptVersion,">=11",{includePrerelease:!0})&&u.push("-ignore-parse-errors"),u=u.filter(d=>d!=null&&d!==""),u.push(t.file.incrementalFilePath),u}async function ww(e,t,n,r){let i=e.compilation?.triggerToken,o=await e.project.callArgs;if(o==null){let u=await vy(n,e);if(u!=null)o=u,e.project.callArgs=Promise.resolve(u);else{qe()&&console.log("Could not figure out call args. Maybe build.ninja does not exist yet?");return}}let s=ts.performance.now();if(!$t.default.existsSync(e.project.incrementalFolderPath))try{$t.default.mkdirSync(e.project.incrementalFolderPath,{recursive:!0})}catch{}try{$t.default.writeFileSync(e.file.incrementalFilePath,t);let u=e.buildSystem==="bsb"?e.project.rootPath:ye.resolve(e.project.rootPath,nn);qe()&&(console.log(`About to invoke bsc from "${u}", used ${e.buildSystem}`),console.log(`${e.project.bscBinaryLocation} ${o.map(p=>`"${p}"`).join(" ")}`));let d=fy.execFile(e.project.bscBinaryLocation,o,{cwd:u},async(p,_,w)=>{p?.killed?qe()&&console.log(`Compilation of ${e.file.sourceFileName} was killed.`):qe()&&console.log(`Recompiled ${e.file.sourceFileName} in ${(ts.performance.now()-s)/1e3}s`);let T=!1;if(!p?.killed&&i!=null&&Dw(e.file.sourceFilePath,i)){qe()&&console.log("Resetting compilation status."),e.compilation=null;let{result:P,codeActions:L}=await es(`${w}
|
|
42
|
+
#Done()`),H=Object.values(L)[0]??[];H.forEach(y=>{if(y.codeAction.edit!=null&&y.codeAction.edit.changes!=null){let v=Object.values(y.codeAction.edit.changes)[0];y.codeAction.edit.changes={[(0,Zc.pathToFileURL)(e.file.sourceFilePath).toString()]:v}}}),e.codeActions=H;let se=(Object.values(P)[0]??[]).map(y=>({...y,message:bw(y.message)})).filter(y=>!y.message.startsWith("Uninterpreted extension 'rescript.")&&(!y.message.includes(`/${hy}/${e.file.sourceFileName}`)||y.message.startsWith("Multiple definition of the")||y.message.startsWith("Signature mismatch")||y.message.startsWith("In this `with' constraint")||y.message.startsWith("This `with' constraint on"))?(T=!0,!0):!1);if(se.length===0&&w!==""&&!T&&!uy.has(e.project.rootPath))try{uy.add(e.project.rootPath);let y=ye.resolve(e.project.incrementalFolderPath,"error.log");$t.default.writeFileSync(y,`== BSC ARGS ==
|
|
43
43
|
${o?.join(" ")}
|
|
44
44
|
|
|
45
45
|
== OUTPUT ==
|
|
46
|
-
${w}`);let v={type:ly.MessageType.Warning,message:`[Incremental typechecking] Something might have gone wrong with incremental type checking. Check out the [error log](file://${y}) and report this issue please.`};n({jsonrpc:W,method:"window/showMessage",params:v})}catch(y){console.error(y)}let U={jsonrpc:W,method:"textDocument/publishDiagnostics",params:{uri:(0,Zc.pathToFileURL)(e.file.sourceFilePath),diagnostics:se}};n(U)}r?.()});e.killCompilationListeners.push(()=>{d.kill("SIGKILL")})}catch(u){console.error(u)}}function vy(e,t,n,r){qe()&&console.log("Updated: "+e),Rw(e,t,n,r)}function by(e){qe()&&console.log("Closed: "+e);let t=bn.get(e);t!=null&&(my(e,t.project.rootPath),bn.delete(e),tu.delete(t.file.originalTypeFileLocation))}function Ry(e){let t=bn.get(e);return t!=null?t.codeActions:null}var nr=new Set,au={},ru=null,iu=!1,is=0,ou=!1,Br=new Map,Py={},X=e=>{},ns=new Map,Cw=e=>{X({jsonrpc:W,method:"rescript/compilationStatus",params:e})},Cy=async e=>K.extensionConfiguration.binaryPath!=null&&Se.default.existsSync(oe.join(K.extensionConfiguration.binaryPath,"rescript"))?oe.join(K.extensionConfiguration.binaryPath,"rescript"):Xm(e),Ew=new rn.RequestType("textDocument/createInterface"),xw=new rn.RequestType("textDocument/openCompiled"),Sw=e=>{let t=null;return xe.forEach((n,r)=>{t==null&&n.filesDiagnostics[e]!=null&&(t=n.filesDiagnostics[e].slice())}),t??[]},Ey=async()=>{for(let[e,t]of xe){let{filesWithDiagnostics:n}=t,r=oe.join(e,Cc),i="";try{i=Se.default.readFileSync(r,{encoding:"utf-8"})}catch(p){console.error(`Error reading compiler log file ${r}: ${p}`)}let{done:o,result:s,codeActions:u,linesWithParseErrors:d}=await es(i);if(d.length>0){let p={type:I.MessageType.Warning,message:`There are more compiler warning/errors that we could not parse. You can help us fix this by opening an [issue on the repository](https://github.com/rescript-lang/rescript-vscode/issues/new?title=Compiler%20log%20parse%20error), pasting the contents of the file [lib/bs/.compiler.log](file://${r}).`};X({jsonrpc:W,method:"window/showMessage",params:p})}t.filesDiagnostics=s,Py=u,Object.keys(s).forEach(p=>{let _={uri:p,diagnostics:s[p]};X({jsonrpc:W,method:"textDocument/publishDiagnostics",params:_}),n.add(p)}),o&&n.forEach(p=>{s[p]==null&&(X({jsonrpc:W,method:"textDocument/publishDiagnostics",params:{uri:p,diagnostics:[]}}),n.delete(p))});try{let p=ns.get(e)??{active:!1,startAt:null,lastSent:null,timer:null},_=i.lastIndexOf("#Start"),w=i.lastIndexOf("#Done"),T=_>w,P=0,L=0;for(let[U,y]of Object.entries(s))if((0,ue.fileURLToPath)(U).startsWith(e))for(let q of y)q.severity===rn.DiagnosticSeverity.Error?P++:q.severity===rn.DiagnosticSeverity.Warning&&L++;let H=oe.basename(e),se=U=>{let y=p.lastSent;(y==null||y.status!==U||y.errorCount!==P||y.warningCount!==L)&&(Cw({project:H,projectRootPath:e,status:U,errorCount:P,warningCount:L}),p.lastSent={status:U,errorCount:P,warningCount:L})};T?p.active||(p.active=!0,p.startAt=Date.now(),p.timer&&clearTimeout(p.timer),p.timer=setTimeout(()=>{let U=ns.get(e);U&&U.active&&se("compiling")},100)):(p.timer&&(clearTimeout(p.timer),p.timer=null),p.active=!1,p.startAt=null,P>0?se("error"):L>0?se("warning"):se("success")),ns.set(e,p)}catch{}}},Tw=e=>{let t=xe.get(e);t!=null&&(t.filesWithDiagnostics.forEach(n=>{X({jsonrpc:W,method:"textDocument/publishDiagnostics",params:{uri:n,diagnostics:[]}})}),xe.delete(e),ns.delete(e),K.extensionConfiguration.incrementalTypechecking?.enable&&nu(e))},kw=()=>{X({jsonrpc:W,method:"rescript/compilationFinished"})},ir=!1,xy=async e=>{try{ir&&console.log("syncing project config cache for "+e),await Rt(e,["cache-project",e]),ir&&console.log("OK - synced project config cache for "+e)}catch(t){ir&&console.error(t)}},qw=async e=>{try{ir&&console.log("deleting project config cache for "+e),await Rt(e,["cache-delete",e]),ir&&console.log("OK - deleted project config cache for "+e)}catch(t){ir&&console.error(t)}};async function jw(e){await Promise.all(e.changes.map(async t=>{if(t.uri.includes("build.ninja")){if(K.extensionConfiguration.cache?.projectConfig?.enable===!0){let n=et(t.uri);n!=null&&await xy(n)}}else if(t.uri.includes("compiler.log"))try{await Ey(),kw(),K.extensionConfiguration.inlayHints?.enable===!0&&Sy(),K.extensionConfiguration.codeLens===!0&&Ty()}catch{console.log("Error while sending updated diagnostics")}else hy((0,ue.fileURLToPath)(t.uri))}))}var Nw=async(e,t)=>{let n=(0,ue.fileURLToPath)(e);Br.set(n,t);let r=et(n);if(r!=null){let i=xe.get(r);if(i==null){K.extensionConfiguration.incrementalTypechecking?.enable&&gy(r);let u=Vr(r);i={openFiles:new Set,filesWithDiagnostics:new Set,filesDiagnostics:{},namespaceName:u.kind==="success"?u.result:null,rescriptVersion:await Ko(r),bsbWatcherByEditor:null,bscBinaryLocation:await Gc(r),editorAnalysisLocation:await Jm(r),hasPromptedToStartBuild:/(\/|\\)node_modules(\/|\\)/.test(r)?"never":!1},xe.set(r,i),K.extensionConfiguration.cache?.projectConfig?.enable===!0&&await xy(r)}xe.get(r).openFiles.add(n);let s=oe.join(r,Sg);if(i.hasPromptedToStartBuild===!1&&K.extensionConfiguration.askToStartBuild===!0&&!Se.default.existsSync(s))if(await Cy(r)!=null){let u={title:Sc,projectRootPath:r},d={type:I.MessageType.Info,message:"Start a build for this project to get the freshest data?",actions:[u]},p={jsonrpc:W,id:is++,method:"window/showMessageRequest",params:d};X(p),i.hasPromptedToStartBuild=!0}else{let u={jsonrpc:W,method:"window/showMessage",params:{type:I.MessageType.Error,message:K.extensionConfiguration.binaryPath==null?`Can't find ReScript binary in ${oe.join(r,xg)} or parent directories. Did you install it? It's required to use "rescript" > 9.1`:`Can't find ReScript binary in the directory ${K.extensionConfiguration.binaryPath}`}};X(u)}}},Iw=async e=>{let t=(0,ue.fileURLToPath)(e);K.extensionConfiguration.incrementalTypechecking?.enable&&by(t),Br.delete(t);let n=et(t);if(n!=null){let r=xe.get(n);r!=null&&(r.openFiles.delete(t),r.openFiles.size===0&&(await qw(n),Tw(n),r.bsbWatcherByEditor!==null&&(r.bsbWatcherByEditor.kill(),r.bsbWatcherByEditor=null)))}},Aw=(e,t)=>{let n=(0,ue.fileURLToPath)(e);(0,cu.assert)(Br.has(n)),Br.set(n,t),K.extensionConfiguration.incrementalTypechecking?.enable&&vy(n,t,X,()=>{K.extensionConfiguration.codeLens&&Ty(),K.extensionConfiguration.inlayHints&&Sy()})},Dn=e=>{let t=(0,ue.fileURLToPath)(e),n=Br.get(t);return(0,cu.assert)(n!=null),n};function os(e=!1){if(e){let t=new rs.StreamMessageWriter(Rn.default.stdout),n=new rs.StreamMessageReader(Rn.default.stdin);X=r=>t.write(r),n.listen(wy)}else X=t=>Rn.default.send(t),Rn.default.on("message",wy)}async function Ow(e){let t=e.params,n=(0,ue.fileURLToPath)(t.textDocument.uri),r=Dn(t.textDocument.uri),i=Lt();Se.default.writeFileSync(i,r,{encoding:"utf-8"});let o=await lt(n,["hover",n,t.position.line,t.position.character,i,!!au.supportsMarkdownLinks],e);return Se.default.unlink(i,()=>null),o}async function Fw(e){let t=e.params,n=(0,ue.fileURLToPath)(t.textDocument.uri);return await lt(n,["inlayHint",n,t.range.start.line,t.range.end.line,K.extensionConfiguration.inlayHints?.maxLength],e)}function Sy(){let e={jsonrpc:W,method:I.InlayHintRefreshRequest.method,id:is++};X(e)}async function Mw(e){let t=e.params,n=(0,ue.fileURLToPath)(t.textDocument.uri);return await lt(n,["codeLens",n],e)}function Ty(){let e={jsonrpc:W,method:I.CodeLensRefreshRequest.method,id:is++};X(e)}async function Lw(e){let t=e.params,n=(0,ue.fileURLToPath)(t.textDocument.uri),r=Dn(t.textDocument.uri),i=Lt();Se.default.writeFileSync(i,r,{encoding:"utf-8"});let o=await lt(n,["signatureHelp",n,t.position.line,t.position.character,i,K.extensionConfiguration.signatureHelp?.forConstructorPayloads?"true":"false"],e);return Se.default.unlink(i,()=>null),o}async function $w(e){let t=e.params,n=(0,ue.fileURLToPath)(t.textDocument.uri);return await lt(n,["definition",n,t.position.line,t.position.character],e)}async function Ww(e){let t=e.params,n=(0,ue.fileURLToPath)(t.textDocument.uri);return await lt(n,["typeDefinition",n,t.position.line,t.position.character],e)}async function Hw(e){let t=e.params,n=(0,ue.fileURLToPath)(t.textDocument.uri),r=await Xc(n,t.position);return{jsonrpc:W,id:e.id,result:r}}async function Uw(e){let t=e.params,n=(0,ue.fileURLToPath)(t.textDocument.uri),r=et(n),i=r&&xe.get(r)?.rescriptVersion||await Ko(r??null),o=!1;if(i!=null&&(o=su.default.valid(i)!=null&&su.default.satisfies(i,">=12.0.0-beta.10",{includePrerelease:!0})),o){let d=await Rt(n,["prepareRename",n,t.position.line,t.position.character]);return{jsonrpc:W,id:e.id,result:d}}let s=await Xc(n,t.position),u=null;return s!==null&&s.forEach(d=>{if(oe.normalize((0,ue.fileURLToPath)(d.uri))===oe.normalize((0,ue.fileURLToPath)(t.textDocument.uri))){let{start:p,end:_}=d.range,w=t.position;p.character<=w.character&&p.line<=w.line&&_.character>=w.character&&_.line>=w.line&&(u=d.range)}}),{jsonrpc:W,id:e.id,result:u}}async function Vw(e){let t=e.params,n=(0,ue.fileURLToPath)(t.textDocument.uri),r=await Rt(n,["rename",n,t.position.line,t.position.character,t.newName]),i=null;return r!==null&&(i={documentChanges:r}),{jsonrpc:W,id:e.id,result:i}}async function Bw(e){let t=e.params,n=(0,ue.fileURLToPath)(t.textDocument.uri),r=oe.extname(t.textDocument.uri),i=Dn(t.textDocument.uri),o=Lt(r);Se.default.writeFileSync(o,i,{encoding:"utf-8"});let s=await lt(n,["documentSymbol",o],e,!1);return Se.default.unlink(o,()=>null),s}function Dy(){let e={items:[{section:"rescript.settings"}]},t={jsonrpc:W,id:Tc,method:I.ConfigurationRequest.type.method,params:e};X(t)}async function zw(e){let t=e.params,n=(0,ue.fileURLToPath)(t.textDocument.uri),r=oe.extname(t.textDocument.uri),i=Dn(t.textDocument.uri),o=Lt(r);Se.default.writeFileSync(o,i,{encoding:"utf-8"});let s=await lt(n,["semanticTokens",o],e,!1);return Se.default.unlink(o,()=>null),s}async function Gw(e){let t=e.params,n=(0,ue.fileURLToPath)(t.textDocument.uri),r=Dn(t.textDocument.uri),i=Lt();Se.default.writeFileSync(i,r,{encoding:"utf-8"});let o=await lt(n,["completion",n,t.position.line,t.position.character,i],e);return Se.default.unlink(i,()=>null),o}async function Xw(e){let t=e.params,n={jsonrpc:W,id:e.id,result:t};if(t.documentation==null&&t.data!=null){let r=t.data,i=await Rt(r.filePath,["completionResolve",r.filePath,r.modulePath],!0);t.documentation={kind:"markdown",value:i}}return n}async function Jw(e){let t=e.params,n=(0,ue.fileURLToPath)(t.textDocument.uri),r=Dn(t.textDocument.uri),i=oe.extname(t.textDocument.uri),o=Lt(i),s=[],u=Py[t.textDocument.uri]??[],d=Ry(n)??[];[...u,...d].forEach(({range:P,codeAction:L})=>{ty(P,t.range)&&s.push(L)}),Se.default.writeFileSync(o,r,{encoding:"utf-8"});let p=await lt(n,["codeAction",n,t.range.start.line,t.range.start.character,t.range.end.line,t.range.end.character,o],e);Se.default.unlink(o,()=>null);let{result:_}=p,w=_!=null&&Array.isArray(_)?[...s,..._]:s;return{jsonrpc:W,id:e.id,result:w.length>0?w:null}}function Yw(e){let t={jsonrpc:W,id:e.id,result:[]},n=e.params,r=(0,ue.fileURLToPath)(n.textDocument.uri),i=oe.extname(n.textDocument.uri);if(i!==xt&&i!==Or){let o={type:I.MessageType.Error,message:`Not a ${xt} or ${Or} file. Cannot format it.`};return[t,{jsonrpc:W,method:"window/showMessage",params:o}]}else{let o=Dn(n.textDocument.uri),s=et(r),d=(s!=null?xe.get(s):null)?.bscBinaryLocation??null,p=Zm(d,r,o);if(p.kind==="success"){let _=o.length,w=[{range:{start:{line:0,character:0},end:{line:_,character:_}},newText:p.result}];return[{jsonrpc:W,id:e.id,result:w}]}else return[t]}}var _y=async(e,t)=>{if(K.extensionConfiguration.incrementalTypechecking?.enable)return;let n=(0,ue.fileURLToPath)(e),r=oe.extname(n),i=Lt(r);Se.default.writeFileSync(i,t,{encoding:"utf-8"});let o=Sw(e),s=await Rt(n,["diagnosticSyntax",i]),u={jsonrpc:W,method:"textDocument/publishDiagnostics",params:{uri:e,diagnostics:[...s,...o]}};Se.default.unlink(i,()=>null),X(u)};async function Qw(e){let t=e.params,n=oe.extname(t.uri),r=(0,ue.fileURLToPath)(t.uri),i=et(r);if(i===null){let L={type:I.MessageType.Error,message:"Cannot locate project directory to generate the interface file."};return{jsonrpc:W,method:"window/showMessage",params:L}}if(n!==xt){let L={type:I.MessageType.Error,message:`Not a ${xt} file. Cannot create an interface for it.`};return{jsonrpc:W,method:"window/showMessage",params:L}}let o=r.split(i)[1],s=Vr(i);if(s.kind==="error"){let L={type:I.MessageType.Error,message:"Error reading ReScript config file."};return{jsonrpc:W,method:"window/showMessage",params:L}}let u=s.result,d=u.length>0?"-"+u:"",p=oe.join(oe.dirname(o),oe.basename(o,xt)+d+kg),_=oe.join(i,nn,p);if(!Se.default.existsSync(_)){let L={type:I.MessageType.Error,message:"No compiled interface file found. Please compile your project first."};return{jsonrpc:W,method:"window/showMessage",params:L}}let T=await lt(r,["createInterface",r,_],e),P=typeof T.result=="string"?T.result:"";try{let L=Wo(r,Or);return Se.default.writeFileSync(L,P,{encoding:"utf-8"}),{jsonrpc:W,id:e.id,result:{uri:Hr(L)}}}catch{return{jsonrpc:W,id:e.id,error:{code:I.ErrorCodes.InternalError,message:"Unable to create interface file."}}}}function Zw(e){let t=e.params,n=(0,ue.fileURLToPath)(t.uri),r=et(n);if(r===null){let s={type:I.MessageType.Error,message:"Cannot locate project directory."};return{jsonrpc:W,method:"window/showMessage",params:s}}let i=Km(n,r);if(i.kind==="error"||!Se.default.existsSync(i.result)){let s=i.kind==="success"?`No compiled file found. Expected it at: ${i.result}`:"No compiled file found. Please compile your project first.",u={type:I.MessageType.Error,message:s};return{jsonrpc:W,method:"window/showMessage",params:u}}return{jsonrpc:W,id:e.id,result:{uri:Hr(i.result)}}}async function wy(e){if(I.Message.isNotification(e)){if(!(!iu&&e.method!=="exit"))if(e.method==="exit")ou?Rn.default.exit(0):Rn.default.exit(1);else if(e.method===tt.InitializedNotification.method){let t=Array.from(nr).flatMap(i=>[{globPattern:oe.join(i,"**",Cc),kind:I.WatchKind.Change|I.WatchKind.Create|I.WatchKind.Delete},{globPattern:oe.join(i,"**",Lo),kind:I.WatchKind.Change|I.WatchKind.Create|I.WatchKind.Delete},{globPattern:`${oe.join(i,"**",nn)}/**/*.{cmt,cmi}`,kind:I.WatchKind.Change|I.WatchKind.Delete}]),n={registrations:[{id:"rescript_file_watcher",method:tt.DidChangeWatchedFilesNotification.method,registerOptions:{watchers:t}}]},r={jsonrpc:W,id:is++,method:I.RegistrationRequest.method,params:n};X(r)}else if(e.method===tt.DidChangeWatchedFilesNotification.method){let t=e.params;await jw(t)}else if(e.method===tt.DidOpenTextDocumentNotification.method){let t=e.params;await Nw(t.textDocument.uri,t.textDocument.text),await Ey(),await _y(t.textDocument.uri,t.textDocument.text)}else if(e.method===tt.DidChangeTextDocumentNotification.method){let t=e.params,n=oe.extname(t.textDocument.uri);if(n===xt||n===Or){let r=t.contentChanges;r.length===0||(Aw(t.textDocument.uri,r[r.length-1].text),await _y(t.textDocument.uri,r[r.length-1].text))}}else if(e.method===tt.DidCloseTextDocumentNotification.method){let t=e.params;await Iw(t.textDocument.uri)}else e.method===tt.DidChangeConfigurationNotification.type.method&&Dy()}else if(I.Message.isRequest(e))if(!iu&&e.method!=="initialize"){let t={jsonrpc:W,id:e.id,error:{code:I.ErrorCodes.ServerNotInitialized,message:"Server not initialized."}};X(t)}else if(e.method==="initialize"){let t=e.params;for(let s of t.workspaceFolders||[]){let u=(0,ue.fileURLToPath)(s.uri);nr.add(u)}let n=t.initializationOptions?.extensionConfiguration;n!=null&&(K.extensionConfiguration=n);let r=t.initializationOptions?.extensionClientCapabilities;r!=null&&(au=r),au.supportsSnippetSyntax=!!t.capabilities.textDocument?.completion?.completionItem?.snippetSupport;let i={capabilities:{textDocumentSync:rn.TextDocumentSyncKind.Full,documentFormattingProvider:!0,hoverProvider:!0,definitionProvider:!0,typeDefinitionProvider:!0,referencesProvider:!0,codeActionProvider:!0,renameProvider:{prepareProvider:!0},documentSymbolProvider:!0,completionProvider:{triggerCharacters:[".",">","@","~",'"',"=","("],resolveProvider:!0},semanticTokensProvider:{legend:{tokenTypes:["operator","variable","type","modifier","namespace","enumMember","property","interface"],tokenModifiers:[]},documentSelector:[{scheme:"file",language:"rescript"}],full:!0},inlayHintProvider:K.extensionConfiguration.inlayHints?.enable,codeLensProvider:K.extensionConfiguration.codeLens?{workDoneProgress:!1}:void 0,signatureHelpProvider:K.extensionConfiguration.signatureHelp?.enabled?{triggerCharacters:["("],retriggerCharacters:["=",","]}:void 0}},o={jsonrpc:W,id:e.id,result:i};iu=!0,ru=setInterval(()=>{Dy()},Ng),X(o)}else if(e.method==="initialized"){let t={jsonrpc:W,id:e.id,result:null};X(t)}else if(e.method==="shutdown")if(ou){let t={jsonrpc:W,id:e.id,error:{code:I.ErrorCodes.InvalidRequest,message:"Language server already received the shutdown request"}};X(t)}else{ou=!0,ru!=null&&clearInterval(ru);let t={jsonrpc:W,id:e.id,result:null};X(t)}else if(e.method===I.HoverRequest.method)X(await Ow(e));else if(e.method===I.DefinitionRequest.method)X(await $w(e));else if(e.method===I.TypeDefinitionRequest.method)X(await Ww(e));else if(e.method===I.ReferencesRequest.method)X(await Hw(e));else if(e.method===I.PrepareRenameRequest.method)X(await Uw(e));else if(e.method===I.RenameRequest.method)X(await Vw(e));else if(e.method===I.DocumentSymbolRequest.method)X(await Bw(e));else if(e.method===I.CompletionRequest.method)X(await Gw(e));else if(e.method===I.CompletionResolveRequest.method)X(await Xw(e));else if(e.method===I.SemanticTokensRequest.method)X(await zw(e));else if(e.method===I.CodeActionRequest.method)X(await Jw(e));else if(e.method===I.DocumentFormattingRequest.method)Yw(e).forEach(n=>X(n));else if(e.method===Ew.method)X(await Qw(e));else if(e.method===xw.method)X(Zw(e));else if(e.method===I.InlayHintRequest.method){let t=e.params;oe.extname(t.textDocument.uri)===xt&&X(await Fw(e))}else if(e.method===I.CodeLensRequest.method){let t=e.params;oe.extname(t.textDocument.uri)===xt&&X(await Mw(e))}else if(e.method===I.SignatureHelpRequest.method){let t=e.params;oe.extname(t.textDocument.uri)===xt&&X(await Lw(e))}else if(e.method==="rescript/dumpServerState")try{let t=Array.from(xe.entries()).map(([i,o])=>({projectRootPath:i,openFiles:Array.from(o.openFiles),filesWithDiagnostics:Array.from(o.filesWithDiagnostics),filesDiagnostics:o.filesDiagnostics,rescriptVersion:o.rescriptVersion,bscBinaryLocation:o.bscBinaryLocation,editorAnalysisLocation:o.editorAnalysisLocation,namespaceName:o.namespaceName,hasPromptedToStartBuild:o.hasPromptedToStartBuild,bsbWatcherByEditor:o.bsbWatcherByEditor!=null?{pid:o.bsbWatcherByEditor.pid??null}:null})),n={config:K.extensionConfiguration,projects:t,workspaceFolders:Array.from(nr)},r={jsonrpc:W,id:e.id,result:n};X(r)}catch(t){let n={jsonrpc:W,id:e.id,error:{code:I.ErrorCodes.InternalError,message:`Failed to dump server state: ${String(t)}`}};X(n)}else{let t={jsonrpc:W,id:e.id,error:{code:I.ErrorCodes.InvalidRequest,message:"Unrecognized editor request."}};X(t)}else if(I.Message.isResponse(e)){if(e.id===Tc){if(e.result!=null){let[t]=e.result;t!=null&&(K.extensionConfiguration=t)}}else if(e.result!=null&&e.result.title!=null&&e.result.title===Sc){let n=e.result.projectRootPath,r=await Cy(n);if(r!=null){let i=ey(r,n),o=xe.get(n);o.bsbWatcherByEditor=i}}}}Hm(e=>{let t={type:I.MessageType.Warning,message:`ReScript tooling: Internal error. Something broke. Here's the error message that you can report if you want:
|
|
46
|
+
${w}`);let v={type:dy.MessageType.Warning,message:`[Incremental typechecking] Something might have gone wrong with incremental type checking. Check out the [error log](file://${y}) and report this issue please.`};n({jsonrpc:W,method:"window/showMessage",params:v})}catch(y){console.error(y)}let U={jsonrpc:W,method:"textDocument/publishDiagnostics",params:{uri:(0,Zc.pathToFileURL)(e.file.sourceFilePath),diagnostics:se}};n(U)}r?.()});e.killCompilationListeners.push(()=>{d.kill("SIGKILL")})}catch(u){console.error(u)}}function by(e,t,n,r){qe()&&console.log("Updated: "+e),Rw(e,t,n,r)}function Ry(e){qe()&&console.log("Closed: "+e);let t=bn.get(e);t!=null&&(yy(e,t.project.rootPath),bn.delete(e),tu.delete(t.file.originalTypeFileLocation))}function Dy(e){let t=bn.get(e);return t!=null?t.codeActions:null}var nr=new Set,au={},ru=null,iu=!1,is=0,ou=!1,Br=new Map,Cy={},X=e=>{},ns=new Map,Cw=e=>{X({jsonrpc:W,method:"rescript/compilationStatus",params:e})},Ey=async e=>K.extensionConfiguration.binaryPath!=null&&Se.default.existsSync(oe.join(K.extensionConfiguration.binaryPath,"rescript"))?oe.join(K.extensionConfiguration.binaryPath,"rescript"):Xm(e),Ew=new rn.RequestType("textDocument/createInterface"),xw=new rn.RequestType("textDocument/openCompiled"),Sw=e=>{let t=null;return xe.forEach((n,r)=>{t==null&&n.filesDiagnostics[e]!=null&&(t=n.filesDiagnostics[e].slice())}),t??[]},xy=async()=>{for(let[e,t]of xe){let{filesWithDiagnostics:n}=t,r=oe.join(e,Cc),i="";try{i=Se.default.readFileSync(r,{encoding:"utf-8"})}catch(p){console.error(`Error reading compiler log file ${r}: ${p}`)}let{done:o,result:s,codeActions:u,linesWithParseErrors:d}=await es(i);if(d.length>0){let p={type:I.MessageType.Warning,message:`There are more compiler warning/errors that we could not parse. You can help us fix this by opening an [issue on the repository](https://github.com/rescript-lang/rescript-vscode/issues/new?title=Compiler%20log%20parse%20error), pasting the contents of the file [lib/bs/.compiler.log](file://${r}).`};X({jsonrpc:W,method:"window/showMessage",params:p})}t.filesDiagnostics=s,Cy=u,Object.keys(s).forEach(p=>{let _={uri:p,diagnostics:s[p]};X({jsonrpc:W,method:"textDocument/publishDiagnostics",params:_}),n.add(p)}),o&&n.forEach(p=>{s[p]==null&&(X({jsonrpc:W,method:"textDocument/publishDiagnostics",params:{uri:p,diagnostics:[]}}),n.delete(p))});try{let p=ns.get(e)??{active:!1,startAt:null,lastSent:null,timer:null},_=i.lastIndexOf("#Start"),w=i.lastIndexOf("#Done"),T=_>w,P=0,L=0;for(let[U,y]of Object.entries(s))if((0,ue.fileURLToPath)(U).startsWith(e))for(let q of y)q.severity===rn.DiagnosticSeverity.Error?P++:q.severity===rn.DiagnosticSeverity.Warning&&L++;let H=oe.basename(e),se=U=>{let y=p.lastSent;(y==null||y.status!==U||y.errorCount!==P||y.warningCount!==L)&&(Cw({project:H,projectRootPath:e,status:U,errorCount:P,warningCount:L}),p.lastSent={status:U,errorCount:P,warningCount:L})};T?p.active||(p.active=!0,p.startAt=Date.now(),p.timer&&clearTimeout(p.timer),p.timer=setTimeout(()=>{let U=ns.get(e);U&&U.active&&se("compiling")},100)):(p.timer&&(clearTimeout(p.timer),p.timer=null),p.active=!1,p.startAt=null,P>0?se("error"):L>0?se("warning"):se("success")),ns.set(e,p)}catch{}}},Tw=e=>{let t=xe.get(e);t!=null&&(t.filesWithDiagnostics.forEach(n=>{X({jsonrpc:W,method:"textDocument/publishDiagnostics",params:{uri:n,diagnostics:[]}})}),xe.delete(e),ns.delete(e),K.extensionConfiguration.incrementalTypechecking?.enable&&nu(e))},kw=()=>{X({jsonrpc:W,method:"rescript/compilationFinished"})},ir=!1,Sy=async e=>{try{ir&&console.log("syncing project config cache for "+e),await Dt(e,["cache-project",e]),ir&&console.log("OK - synced project config cache for "+e)}catch(t){ir&&console.error(t)}},qw=async e=>{try{ir&&console.log("deleting project config cache for "+e),await Dt(e,["cache-delete",e]),ir&&console.log("OK - deleted project config cache for "+e)}catch(t){ir&&console.error(t)}};async function jw(e){await Promise.all(e.changes.map(async t=>{if(t.uri.includes("build.ninja")){if(K.extensionConfiguration.cache?.projectConfig?.enable===!0){let n=et(t.uri);n!=null&&await Sy(n)}}else if(t.uri.includes("compiler.log"))try{await xy(),kw(),K.extensionConfiguration.inlayHints?.enable===!0&&Ty(),K.extensionConfiguration.codeLens===!0&&ky()}catch{console.log("Error while sending updated diagnostics")}else gy((0,ue.fileURLToPath)(t.uri))}))}var Nw=async(e,t)=>{let n=(0,ue.fileURLToPath)(e);Br.set(n,t);let r=et(n);if(r!=null){let i=xe.get(r);if(i==null){K.extensionConfiguration.incrementalTypechecking?.enable&&my(r);let u=Vr(r);i={openFiles:new Set,filesWithDiagnostics:new Set,filesDiagnostics:{},namespaceName:u.kind==="success"?u.result:null,rescriptVersion:await Ko(r),bsbWatcherByEditor:null,bscBinaryLocation:await Gc(r),editorAnalysisLocation:await Jm(r),hasPromptedToStartBuild:/(\/|\\)node_modules(\/|\\)/.test(r)?"never":!1},xe.set(r,i),K.extensionConfiguration.cache?.projectConfig?.enable===!0&&await Sy(r)}xe.get(r).openFiles.add(n);let s=oe.join(r,Sg);if(i.hasPromptedToStartBuild===!1&&K.extensionConfiguration.askToStartBuild===!0&&!Se.default.existsSync(s))if(await Ey(r)!=null){let u={title:Sc,projectRootPath:r},d={type:I.MessageType.Info,message:"Start a build for this project to get the freshest data?",actions:[u]},p={jsonrpc:W,id:is++,method:"window/showMessageRequest",params:d};X(p),i.hasPromptedToStartBuild=!0}else{let u={jsonrpc:W,method:"window/showMessage",params:{type:I.MessageType.Error,message:K.extensionConfiguration.binaryPath==null?`Can't find ReScript binary in ${oe.join(r,xg)} or parent directories. Did you install it? It's required to use "rescript" > 9.1`:`Can't find ReScript binary in the directory ${K.extensionConfiguration.binaryPath}`}};X(u)}}},Iw=async e=>{let t=(0,ue.fileURLToPath)(e);K.extensionConfiguration.incrementalTypechecking?.enable&&Ry(t),Br.delete(t);let n=et(t);if(n!=null){let r=xe.get(n);r!=null&&(r.openFiles.delete(t),r.openFiles.size===0&&(await qw(n),Tw(n),r.bsbWatcherByEditor!==null&&(r.bsbWatcherByEditor.kill(),r.bsbWatcherByEditor=null)))}},Aw=(e,t)=>{let n=(0,ue.fileURLToPath)(e);(0,cu.assert)(Br.has(n)),Br.set(n,t),K.extensionConfiguration.incrementalTypechecking?.enable&&by(n,t,X,()=>{K.extensionConfiguration.codeLens&&ky(),K.extensionConfiguration.inlayHints&&Ty()})},Dn=e=>{let t=(0,ue.fileURLToPath)(e),n=Br.get(t);return(0,cu.assert)(n!=null),n};function os(e=!1){if(e){let t=new rs.StreamMessageWriter(Rn.default.stdout),n=new rs.StreamMessageReader(Rn.default.stdin);X=r=>t.write(r),n.listen(Py)}else X=t=>Rn.default.send(t),Rn.default.on("message",Py)}async function Ow(e){let t=e.params,n=(0,ue.fileURLToPath)(t.textDocument.uri),r=Dn(t.textDocument.uri),i=Lt();Se.default.writeFileSync(i,r,{encoding:"utf-8"});let o=await dt(n,["hover",n,t.position.line,t.position.character,i,!!au.supportsMarkdownLinks],e);return Se.default.unlink(i,()=>null),o}async function Fw(e){let t=e.params,n=(0,ue.fileURLToPath)(t.textDocument.uri);return await dt(n,["inlayHint",n,t.range.start.line,t.range.end.line,K.extensionConfiguration.inlayHints?.maxLength],e)}function Ty(){let e={jsonrpc:W,method:I.InlayHintRefreshRequest.method,id:is++};X(e)}async function Mw(e){let t=e.params,n=(0,ue.fileURLToPath)(t.textDocument.uri);return await dt(n,["codeLens",n],e)}function ky(){let e={jsonrpc:W,method:I.CodeLensRefreshRequest.method,id:is++};X(e)}async function Lw(e){let t=e.params,n=(0,ue.fileURLToPath)(t.textDocument.uri),r=Dn(t.textDocument.uri),i=Lt();Se.default.writeFileSync(i,r,{encoding:"utf-8"});let o=await dt(n,["signatureHelp",n,t.position.line,t.position.character,i,K.extensionConfiguration.signatureHelp?.forConstructorPayloads?"true":"false"],e);return Se.default.unlink(i,()=>null),o}async function $w(e){let t=e.params,n=(0,ue.fileURLToPath)(t.textDocument.uri);return await dt(n,["definition",n,t.position.line,t.position.character],e)}async function Ww(e){let t=e.params,n=(0,ue.fileURLToPath)(t.textDocument.uri);return await dt(n,["typeDefinition",n,t.position.line,t.position.character],e)}async function Hw(e){let t=e.params,n=(0,ue.fileURLToPath)(t.textDocument.uri),r=await Xc(n,t.position);return{jsonrpc:W,id:e.id,result:r}}async function Uw(e){let t=e.params,n=(0,ue.fileURLToPath)(t.textDocument.uri),r=et(n),i=r&&xe.get(r)?.rescriptVersion||await Ko(r??null),o=!1;if(i!=null&&(o=su.default.valid(i)!=null&&su.default.satisfies(i,">=12.0.0-beta.10",{includePrerelease:!0})),o){let d=await Dt(n,["prepareRename",n,t.position.line,t.position.character]);return{jsonrpc:W,id:e.id,result:d}}let s=await Xc(n,t.position),u=null;return s!==null&&s.forEach(d=>{if(oe.normalize((0,ue.fileURLToPath)(d.uri))===oe.normalize((0,ue.fileURLToPath)(t.textDocument.uri))){let{start:p,end:_}=d.range,w=t.position;p.character<=w.character&&p.line<=w.line&&_.character>=w.character&&_.line>=w.line&&(u=d.range)}}),{jsonrpc:W,id:e.id,result:u}}async function Vw(e){let t=e.params,n=(0,ue.fileURLToPath)(t.textDocument.uri),r=await Dt(n,["rename",n,t.position.line,t.position.character,t.newName]),i=null;return r!==null&&(i={documentChanges:r}),{jsonrpc:W,id:e.id,result:i}}async function Bw(e){let t=e.params,n=(0,ue.fileURLToPath)(t.textDocument.uri),r=oe.extname(t.textDocument.uri),i=Dn(t.textDocument.uri),o=Lt(r);Se.default.writeFileSync(o,i,{encoding:"utf-8"});let s=await dt(n,["documentSymbol",o],e,!1);return Se.default.unlink(o,()=>null),s}function _y(){let e={items:[{section:"rescript.settings"}]},t={jsonrpc:W,id:Tc,method:I.ConfigurationRequest.type.method,params:e};X(t)}async function zw(e){let t=e.params,n=(0,ue.fileURLToPath)(t.textDocument.uri),r=oe.extname(t.textDocument.uri),i=Dn(t.textDocument.uri),o=Lt(r);Se.default.writeFileSync(o,i,{encoding:"utf-8"});let s=await dt(n,["semanticTokens",o],e,!1);return Se.default.unlink(o,()=>null),s}async function Gw(e){let t=e.params,n=(0,ue.fileURLToPath)(t.textDocument.uri),r=Dn(t.textDocument.uri),i=Lt();Se.default.writeFileSync(i,r,{encoding:"utf-8"});let o=await dt(n,["completion",n,t.position.line,t.position.character,i],e);return Se.default.unlink(i,()=>null),o}async function Xw(e){let t=e.params,n={jsonrpc:W,id:e.id,result:t};if(t.documentation==null&&t.data!=null){let r=t.data,i=await Dt(r.filePath,["completionResolve",r.filePath,r.modulePath],!0);t.documentation={kind:"markdown",value:i}}return n}async function Jw(e){let t=e.params,n=(0,ue.fileURLToPath)(t.textDocument.uri),r=Dn(t.textDocument.uri),i=oe.extname(t.textDocument.uri),o=Lt(i),s=[],u=Cy[t.textDocument.uri]??[],d=Dy(n)??[];[...u,...d].forEach(({range:P,codeAction:L})=>{ny(P,t.range)&&s.push(L)}),Se.default.writeFileSync(o,r,{encoding:"utf-8"});let p=await dt(n,["codeAction",n,t.range.start.line,t.range.start.character,t.range.end.line,t.range.end.character,o],e);Se.default.unlink(o,()=>null);let{result:_}=p,w=_!=null&&Array.isArray(_)?[...s,..._]:s;return{jsonrpc:W,id:e.id,result:w.length>0?w:null}}function Yw(e){let t={jsonrpc:W,id:e.id,result:[]},n=e.params,r=(0,ue.fileURLToPath)(n.textDocument.uri),i=oe.extname(n.textDocument.uri);if(i!==xt&&i!==Or){let o={type:I.MessageType.Error,message:`Not a ${xt} or ${Or} file. Cannot format it.`};return[t,{jsonrpc:W,method:"window/showMessage",params:o}]}else{let o=Dn(n.textDocument.uri),s=et(r),d=(s!=null?xe.get(s):null)?.bscBinaryLocation??null,p=Zm(d,r,o);if(p.kind==="success"){let _=o.length,w=[{range:{start:{line:0,character:0},end:{line:_,character:_}},newText:p.result}];return[{jsonrpc:W,id:e.id,result:w}]}else return[t]}}var wy=async(e,t)=>{if(K.extensionConfiguration.incrementalTypechecking?.enable)return;let n=(0,ue.fileURLToPath)(e),r=oe.extname(n),i=Lt(r);Se.default.writeFileSync(i,t,{encoding:"utf-8"});let o=Sw(e),s=await Dt(n,["diagnosticSyntax",i]),u={jsonrpc:W,method:"textDocument/publishDiagnostics",params:{uri:e,diagnostics:[...s,...o]}};Se.default.unlink(i,()=>null),X(u)};async function Qw(e){let t=e.params,n=oe.extname(t.uri),r=(0,ue.fileURLToPath)(t.uri),i=et(r);if(i===null){let L={type:I.MessageType.Error,message:"Cannot locate project directory to generate the interface file."};return{jsonrpc:W,method:"window/showMessage",params:L}}if(n!==xt){let L={type:I.MessageType.Error,message:`Not a ${xt} file. Cannot create an interface for it.`};return{jsonrpc:W,method:"window/showMessage",params:L}}let o=r.split(i)[1],s=Vr(i);if(s.kind==="error"){let L={type:I.MessageType.Error,message:"Error reading ReScript config file."};return{jsonrpc:W,method:"window/showMessage",params:L}}let u=s.result,d=u.length>0?"-"+u:"",p=oe.join(oe.dirname(o),oe.basename(o,xt)+d+kg),_=oe.join(i,nn,p);if(!Se.default.existsSync(_)){let L={type:I.MessageType.Error,message:"No compiled interface file found. Please compile your project first."};return{jsonrpc:W,method:"window/showMessage",params:L}}let T=await dt(r,["createInterface",r,_],e),P=typeof T.result=="string"?T.result:"";try{let L=Wo(r,Or);return Se.default.writeFileSync(L,P,{encoding:"utf-8"}),{jsonrpc:W,id:e.id,result:{uri:Hr(L)}}}catch{return{jsonrpc:W,id:e.id,error:{code:I.ErrorCodes.InternalError,message:"Unable to create interface file."}}}}function Zw(e){let t=e.params,n=(0,ue.fileURLToPath)(t.uri),r=et(n);if(r===null){let s={type:I.MessageType.Error,message:"Cannot locate project directory."};return{jsonrpc:W,method:"window/showMessage",params:s}}let i=ey(n,r);if(i.kind==="error"||!Se.default.existsSync(i.result)){let s=i.kind==="success"?`No compiled file found. Expected it at: ${i.result}`:"No compiled file found. Please compile your project first.",u={type:I.MessageType.Error,message:s};return{jsonrpc:W,method:"window/showMessage",params:u}}return{jsonrpc:W,id:e.id,result:{uri:Hr(i.result)}}}async function Py(e){if(I.Message.isNotification(e)){if(!(!iu&&e.method!=="exit"))if(e.method==="exit")ou?Rn.default.exit(0):Rn.default.exit(1);else if(e.method===tt.InitializedNotification.method){let t=Array.from(nr).flatMap(i=>[{globPattern:oe.join(i,"**",Cc),kind:I.WatchKind.Change|I.WatchKind.Create|I.WatchKind.Delete},{globPattern:oe.join(i,"**",Lo),kind:I.WatchKind.Change|I.WatchKind.Create|I.WatchKind.Delete},{globPattern:`${oe.join(i,"**",nn)}/**/*.{cmt,cmi}`,kind:I.WatchKind.Change|I.WatchKind.Delete}]),n={registrations:[{id:"rescript_file_watcher",method:tt.DidChangeWatchedFilesNotification.method,registerOptions:{watchers:t}}]},r={jsonrpc:W,id:is++,method:I.RegistrationRequest.method,params:n};X(r)}else if(e.method===tt.DidChangeWatchedFilesNotification.method){let t=e.params;await jw(t)}else if(e.method===tt.DidOpenTextDocumentNotification.method){let t=e.params;await Nw(t.textDocument.uri,t.textDocument.text),await xy(),await wy(t.textDocument.uri,t.textDocument.text)}else if(e.method===tt.DidChangeTextDocumentNotification.method){let t=e.params,n=oe.extname(t.textDocument.uri);if(n===xt||n===Or){let r=t.contentChanges;r.length===0||(Aw(t.textDocument.uri,r[r.length-1].text),await wy(t.textDocument.uri,r[r.length-1].text))}}else if(e.method===tt.DidCloseTextDocumentNotification.method){let t=e.params;await Iw(t.textDocument.uri)}else e.method===tt.DidChangeConfigurationNotification.type.method&&_y()}else if(I.Message.isRequest(e))if(!iu&&e.method!=="initialize"){let t={jsonrpc:W,id:e.id,error:{code:I.ErrorCodes.ServerNotInitialized,message:"Server not initialized."}};X(t)}else if(e.method==="initialize"){let t=e.params;for(let s of t.workspaceFolders||[]){let u=(0,ue.fileURLToPath)(s.uri);nr.add(u)}let n=t.initializationOptions?.extensionConfiguration;n!=null&&(K.extensionConfiguration=n);let r=t.initializationOptions?.extensionClientCapabilities;r!=null&&(au=r),au.supportsSnippetSyntax=!!t.capabilities.textDocument?.completion?.completionItem?.snippetSupport;let i={capabilities:{textDocumentSync:rn.TextDocumentSyncKind.Full,documentFormattingProvider:!0,hoverProvider:!0,definitionProvider:!0,typeDefinitionProvider:!0,referencesProvider:!0,codeActionProvider:!0,renameProvider:{prepareProvider:!0},documentSymbolProvider:!0,completionProvider:{triggerCharacters:[".",">","@","~",'"',"=","("],resolveProvider:!0},semanticTokensProvider:{legend:{tokenTypes:["operator","variable","type","modifier","namespace","enumMember","property","interface"],tokenModifiers:[]},documentSelector:[{scheme:"file",language:"rescript"}],full:!0},inlayHintProvider:K.extensionConfiguration.inlayHints?.enable,codeLensProvider:K.extensionConfiguration.codeLens?{workDoneProgress:!1}:void 0,signatureHelpProvider:K.extensionConfiguration.signatureHelp?.enabled?{triggerCharacters:["("],retriggerCharacters:["=",","]}:void 0}},o={jsonrpc:W,id:e.id,result:i};iu=!0,ru=setInterval(()=>{_y()},Ng),X(o)}else if(e.method==="initialized"){let t={jsonrpc:W,id:e.id,result:null};X(t)}else if(e.method==="shutdown")if(ou){let t={jsonrpc:W,id:e.id,error:{code:I.ErrorCodes.InvalidRequest,message:"Language server already received the shutdown request"}};X(t)}else{ou=!0,ru!=null&&clearInterval(ru);let t={jsonrpc:W,id:e.id,result:null};X(t)}else if(e.method===I.HoverRequest.method)X(await Ow(e));else if(e.method===I.DefinitionRequest.method)X(await $w(e));else if(e.method===I.TypeDefinitionRequest.method)X(await Ww(e));else if(e.method===I.ReferencesRequest.method)X(await Hw(e));else if(e.method===I.PrepareRenameRequest.method)X(await Uw(e));else if(e.method===I.RenameRequest.method)X(await Vw(e));else if(e.method===I.DocumentSymbolRequest.method)X(await Bw(e));else if(e.method===I.CompletionRequest.method)X(await Gw(e));else if(e.method===I.CompletionResolveRequest.method)X(await Xw(e));else if(e.method===I.SemanticTokensRequest.method)X(await zw(e));else if(e.method===I.CodeActionRequest.method)X(await Jw(e));else if(e.method===I.DocumentFormattingRequest.method)Yw(e).forEach(n=>X(n));else if(e.method===Ew.method)X(await Qw(e));else if(e.method===xw.method)X(Zw(e));else if(e.method===I.InlayHintRequest.method){let t=e.params;oe.extname(t.textDocument.uri)===xt&&X(await Fw(e))}else if(e.method===I.CodeLensRequest.method){let t=e.params;oe.extname(t.textDocument.uri)===xt&&X(await Mw(e))}else if(e.method===I.SignatureHelpRequest.method){let t=e.params;oe.extname(t.textDocument.uri)===xt&&X(await Lw(e))}else if(e.method==="rescript/dumpServerState")try{let t=Array.from(xe.entries()).map(([i,o])=>({projectRootPath:i,openFiles:Array.from(o.openFiles),filesWithDiagnostics:Array.from(o.filesWithDiagnostics),filesDiagnostics:o.filesDiagnostics,rescriptVersion:o.rescriptVersion,bscBinaryLocation:o.bscBinaryLocation,editorAnalysisLocation:o.editorAnalysisLocation,namespaceName:o.namespaceName,hasPromptedToStartBuild:o.hasPromptedToStartBuild,bsbWatcherByEditor:o.bsbWatcherByEditor!=null?{pid:o.bsbWatcherByEditor.pid??null}:null})),n={config:K.extensionConfiguration,projects:t,workspaceFolders:Array.from(nr),runtimePathCache:Km()},r={jsonrpc:W,id:e.id,result:n};X(r)}catch(t){let n={jsonrpc:W,id:e.id,error:{code:I.ErrorCodes.InternalError,message:`Failed to dump server state: ${String(t)}`}};X(n)}else{let t={jsonrpc:W,id:e.id,error:{code:I.ErrorCodes.InvalidRequest,message:"Unrecognized editor request."}};X(t)}else if(I.Message.isResponse(e)){if(e.id===Tc){if(e.result!=null){let[t]=e.result;t!=null&&(K.extensionConfiguration=t)}}else if(e.result!=null&&e.result.title!=null&&e.result.title===Sc){let n=e.result.projectRootPath,r=await Ey(n);if(r!=null){let i=ty(r,n),o=xe.get(n);o.bsbWatcherByEditor=i}}}}Hm(e=>{let t={type:I.MessageType.Warning,message:`ReScript tooling: Internal error. Something broke. Here's the error message that you can report if you want:
|
|
47
47
|
|
|
48
48
|
${e}
|
|
49
49
|
|
|
50
|
-
(this message will only be reported once every 15 minutes)`};X({jsonrpc:W,method:"window/showMessage",params:t})});var Kw=process.argv.slice(2),
|
|
50
|
+
(this message will only be reported once every 15 minutes)`};X({jsonrpc:W,method:"window/showMessage",params:t})});var Kw=process.argv.slice(2),qy=`ReScript Language Server
|
|
51
51
|
|
|
52
52
|
Usage: rescript-language-server [options]
|
|
53
53
|
|
|
@@ -56,5 +56,5 @@ Options:
|
|
|
56
56
|
--stdio Use stdio
|
|
57
57
|
--node-ipc Use node-ipc
|
|
58
58
|
-v, --version Print version
|
|
59
|
-
-h, --help Print help`;(()=>{switch(Kw[0]){case"--stdio":return os(!0);case"--node-ipc":return os(!1);case"--version":case"-v":let{version:e}=JSON.parse(
|
|
59
|
+
-h, --help Print help`;(()=>{switch(Kw[0]){case"--stdio":return os(!0);case"--node-ipc":return os(!1);case"--version":case"-v":let{version:e}=JSON.parse(jy.default.readFileSync(Ny.default.join(__dirname,"..","package.json")).toString());console.log(e),process.exit(0);case"--help":case"-h":console.log(qy),process.exit(0);default:console.log(qy),process.exit(1)}})();
|
|
60
60
|
//# sourceMappingURL=cli.js.map
|