dts-linter 0.0.0-alpha16 → 0.0.0-alpha18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/dts-linter.js +21 -22
  2. package/package.json +1 -1
@@ -3,75 +3,74 @@
3
3
  ${JSON.stringify(Object.fromEntries(n))}`));return}let s=parseInt(i);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=s}let r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let n=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(r):r,i=await this.options.contentTypeDecoder.decode(n,this.options);this.callback(i)}).catch(n=>{this.fireError(n)})}}catch(r){this.fireError(r)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,ao.default)().timer.setTimeout((e,r)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:r}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};Qt.ReadableStreamMessageReader=uo});var Mc=M(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.WriteableStreamMessageWriter=Xt.AbstractMessageWriter=Xt.MessageWriter=void 0;var Dc=Gt(),Ln=Kr(),hh=so(),Ec=tn(),ph="Content-Length: ",Oc=`\r
4
4
  `,Nc;(function(t){function e(r){let n=r;return n&&Ln.func(n.dispose)&&Ln.func(n.onClose)&&Ln.func(n.onError)&&Ln.func(n.write)}t.is=e})(Nc||(Xt.MessageWriter=Nc={}));var li=class{constructor(){this.errorEmitter=new Ec.Emitter,this.closeEmitter=new Ec.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,r,n){this.errorEmitter.fire([this.asError(e),r,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${Ln.string(e.message)?e.message:"unknown"}`)}};Xt.AbstractMessageWriter=li;var lo;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,Dc.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,Dc.default)().applicationJson.encoder}}t.fromOptions=e})(lo||(lo={}));var fo=class extends li{constructor(e,r){super(),this.writable=e,this.options=lo.fromOptions(r),this.errorCount=0,this.writeSemaphore=new hh.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let i=[];return i.push(ph,n.byteLength.toString(),Oc),i.push(Oc),this.doWrite(e,i,n)},n=>{throw this.fireError(n),n}))}async doWrite(e,r,n){try{return await this.writable.write(r.join(""),"ascii"),this.writable.write(n)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){this.writable.end()}};Xt.WriteableStreamMessageWriter=fo});var jc=M(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});fi.AbstractMessageBuffer=void 0;var mh=13,gh=10,yh=`\r
5
5
  `,ho=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let r=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let r=0,n=0,i=0,s=0;e:for(;n<this._chunks.length;){let T=this._chunks[n];for(i=0;i<T.length;){switch(T[i]){case mh:switch(r){case 0:r=1;break;case 2:r=3;break;default:r=0}break;case gh:switch(r){case 1:r=2;break;case 3:r=4,i++;break e;default:r=0}break;default:r=0}i++}s+=T.byteLength,n++}if(r!==4)return;let d=this._read(s+i),h=new Map,R=this.toString(d,"ascii").split(yh);if(R.length<2)return h;for(let T=0;T<R.length-2;T++){let P=R[T],Z=P.indexOf(":");if(Z===-1)throw new Error(`Message header must separate key and value using ':'
6
- ${P}`);let se=P.substr(0,Z),ce=P.substr(Z+1).trim();h.set(e?se.toLowerCase():se,ce)}return h}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],d=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,d}let r=this.allocNative(e),n=0,i=0;for(;e>0;){let s=this._chunks[i];if(s.byteLength>e){let d=s.slice(0,e);r.set(d,n),n+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e}else r.set(s,n),n+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return r}};fi.AbstractMessageBuffer=ho});var $c=M(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.createMessageConnection=G.ConnectionOptions=G.MessageStrategy=G.CancellationStrategy=G.CancellationSenderStrategy=G.CancellationReceiverStrategy=G.RequestCancellationReceiverStrategy=G.IdCancellationReceiverStrategy=G.ConnectionStrategy=G.ConnectionError=G.ConnectionErrors=G.LogTraceNotification=G.SetTraceNotification=G.TraceFormat=G.TraceValues=G.Trace=G.NullLogger=G.ProgressType=G.ProgressToken=void 0;var qc=Gt(),Re=Kr(),V=Bs(),Ic=Zs(),$n=tn(),po=ci(),Vn;(function(t){t.type=new V.NotificationType("$/cancelRequest")})(Vn||(Vn={}));var mo;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}t.is=e})(mo||(G.ProgressToken=mo={}));var Fn;(function(t){t.type=new V.NotificationType("$/progress")})(Fn||(Fn={}));var go=class{constructor(){}};G.ProgressType=go;var yo;(function(t){function e(r){return Re.func(r)}t.is=e})(yo||(yo={}));G.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var oe;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(oe||(G.Trace=oe={}));var Ac;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(Ac||(G.TraceValues=Ac={}));(function(t){function e(n){if(!Re.string(n))return t.Off;switch(n=n.toLowerCase(),n){case"off":return t.Off;case"messages":return t.Messages;case"compact":return t.Compact;case"verbose":return t.Verbose;default:return t.Off}}t.fromString=e;function r(n){switch(n){case t.Off:return"off";case t.Messages:return"messages";case t.Compact:return"compact";case t.Verbose:return"verbose";default:return"off"}}t.toString=r})(oe||(G.Trace=oe={}));var tt;(function(t){t.Text="text",t.JSON="json"})(tt||(G.TraceFormat=tt={}));(function(t){function e(r){return Re.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(tt||(G.TraceFormat=tt={}));var vo;(function(t){t.type=new V.NotificationType("$/setTrace")})(vo||(G.SetTraceNotification=vo={}));var hi;(function(t){t.type=new V.NotificationType("$/logTrace")})(hi||(G.LogTraceNotification=hi={}));var Wn;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(Wn||(G.ConnectionErrors=Wn={}));var on=class t extends Error{constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};G.ConnectionError=on;var _o;(function(t){function e(r){let n=r;return n&&Re.func(n.cancelUndispatched)}t.is=e})(_o||(G.ConnectionStrategy=_o={}));var pi;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&Re.func(n.createCancellationTokenSource)&&(n.dispose===void 0||Re.func(n.dispose))}t.is=e})(pi||(G.IdCancellationReceiverStrategy=pi={}));var bo;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&Re.func(n.createCancellationTokenSource)&&(n.dispose===void 0||Re.func(n.dispose))}t.is=e})(bo||(G.RequestCancellationReceiverStrategy=bo={}));var mi;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new po.CancellationTokenSource}});function e(r){return pi.is(r)||bo.is(r)}t.is=e})(mi||(G.CancellationReceiverStrategy=mi={}));var gi;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(Vn.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&Re.func(n.sendCancellation)&&Re.func(n.cleanup)}t.is=e})(gi||(G.CancellationSenderStrategy=gi={}));var yi;(function(t){t.Message=Object.freeze({receiver:mi.Message,sender:gi.Message});function e(r){let n=r;return n&&mi.is(n.receiver)&&gi.is(n.sender)}t.is=e})(yi||(G.CancellationStrategy=yi={}));var vi;(function(t){function e(r){let n=r;return n&&Re.func(n.handleMessage)}t.is=e})(vi||(G.MessageStrategy=vi={}));var Lc;(function(t){function e(r){let n=r;return n&&(yi.is(n.cancellationStrategy)||_o.is(n.connectionStrategy)||vi.is(n.messageStrategy))}t.is=e})(Lc||(G.ConnectionOptions=Lc={}));var mt;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(mt||(mt={}));function vh(t,e,r,n){let i=r!==void 0?r:G.NullLogger,s=0,d=0,h=0,R="2.0",T,P=new Map,Z,se=new Map,ce=new Map,Ue,Se=new Ic.LinkedMap,we=new Map,ue=new Set,de=new Map,O=oe.Off,le=tt.Text,$,ye=mt.New,ve=new $n.Emitter,Be=new $n.Emitter,_t=new $n.Emitter,lt=new $n.Emitter,ft=new $n.Emitter,Te=n&&n.cancellationStrategy?n.cancellationStrategy:yi.Message;function Dt(o){if(o===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+o.toString()}function Ft(o){return o===null?"res-unknown-"+(++h).toString():"res-"+o.toString()}function Ir(){return"not-"+(++d).toString()}function In(o,f){V.Message.isRequest(f)?o.set(Dt(f.id),f):V.Message.isResponse(f)?o.set(Ft(f.id),f):o.set(Ir(),f)}function Ar(o){}function Wt(){return ye===mt.Listening}function bt(){return ye===mt.Closed}function je(){return ye===mt.Disposed}function Et(){(ye===mt.New||ye===mt.Listening)&&(ye=mt.Closed,Be.fire(void 0))}function Ot(o){ve.fire([o,void 0,void 0])}function Lr(o){ve.fire(o)}t.onClose(Et),t.onError(Ot),e.onClose(Et),e.onError(Lr);function Vt(){Ue||Se.size===0||(Ue=(0,qc.default)().timer.setImmediate(()=>{Ue=void 0,$r()}))}function zt(o){V.Message.isRequest(o)?Wr(o):V.Message.isNotification(o)?zr(o):V.Message.isResponse(o)?Vr(o):Ut(o)}function $r(){if(Se.size===0)return;let o=Se.shift();try{let f=n?.messageStrategy;vi.is(f)?f.handleMessage(o,zt):zt(o)}finally{Vt()}}let Fr=o=>{try{if(V.Message.isNotification(o)&&o.method===Vn.type.method){let f=o.params.id,g=Dt(f),_=Se.get(g);if(V.Message.isRequest(_)){let q=n?.connectionStrategy,B=q&&q.cancelUndispatched?q.cancelUndispatched(_,Ar):void 0;if(B&&(B.error!==void 0||B.result!==void 0)){Se.delete(g),de.delete(f),B.id=_.id,st(B,o.method,Date.now()),e.write(B).catch(()=>i.error("Sending response for canceled message failed."));return}}let L=de.get(f);if(L!==void 0){L.cancel(),wt(o);return}else ue.add(f)}In(Se,o)}finally{Vt()}};function Wr(o){if(je())return;function f(D,F,N){let X={jsonrpc:R,id:o.id};D instanceof V.ResponseError?X.error=D.toJson():X.result=D===void 0?null:D,st(X,F,N),e.write(X).catch(()=>i.error("Sending response failed."))}function g(D,F,N){let X={jsonrpc:R,id:o.id,error:D.toJson()};st(X,F,N),e.write(X).catch(()=>i.error("Sending response failed."))}function _(D,F,N){D===void 0&&(D=null);let X={jsonrpc:R,id:o.id,result:D};st(X,F,N),e.write(X).catch(()=>i.error("Sending response failed."))}Hr(o);let L=P.get(o.method),q,B;L&&(q=L.type,B=L.handler);let H=Date.now();if(B||T){let D=o.id??String(Date.now()),F=pi.is(Te.receiver)?Te.receiver.createCancellationTokenSource(D):Te.receiver.createCancellationTokenSource(o);o.id!==null&&ue.has(o.id)&&F.cancel(),o.id!==null&&de.set(D,F);try{let N;if(B)if(o.params===void 0){if(q!==void 0&&q.numberOfParams!==0){g(new V.ResponseError(V.ErrorCodes.InvalidParams,`Request ${o.method} defines ${q.numberOfParams} params but received none.`),o.method,H);return}N=B(F.token)}else if(Array.isArray(o.params)){if(q!==void 0&&q.parameterStructures===V.ParameterStructures.byName){g(new V.ResponseError(V.ErrorCodes.InvalidParams,`Request ${o.method} defines parameters by name but received parameters by position`),o.method,H);return}N=B(...o.params,F.token)}else{if(q!==void 0&&q.parameterStructures===V.ParameterStructures.byPosition){g(new V.ResponseError(V.ErrorCodes.InvalidParams,`Request ${o.method} defines parameters by position but received parameters by name`),o.method,H);return}N=B(o.params,F.token)}else T&&(N=T(o.method,o.params,F.token));let X=N;N?X.then?X.then(ie=>{de.delete(D),f(ie,o.method,H)},ie=>{de.delete(D),ie instanceof V.ResponseError?g(ie,o.method,H):ie&&Re.string(ie.message)?g(new V.ResponseError(V.ErrorCodes.InternalError,`Request ${o.method} failed with message: ${ie.message}`),o.method,H):g(new V.ResponseError(V.ErrorCodes.InternalError,`Request ${o.method} failed unexpectedly without providing any details.`),o.method,H)}):(de.delete(D),f(N,o.method,H)):(de.delete(D),_(N,o.method,H))}catch(N){de.delete(D),N instanceof V.ResponseError?f(N,o.method,H):N&&Re.string(N.message)?g(new V.ResponseError(V.ErrorCodes.InternalError,`Request ${o.method} failed with message: ${N.message}`),o.method,H):g(new V.ResponseError(V.ErrorCodes.InternalError,`Request ${o.method} failed unexpectedly without providing any details.`),o.method,H)}}else g(new V.ResponseError(V.ErrorCodes.MethodNotFound,`Unhandled method ${o.method}`),o.method,H)}function Vr(o){if(!je())if(o.id===null)o.error?i.error(`Received response message without id: Error is:
6
+ ${P}`);let se=P.substr(0,Z),ce=P.substr(Z+1).trim();h.set(e?se.toLowerCase():se,ce)}return h}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],d=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,d}let r=this.allocNative(e),n=0,i=0;for(;e>0;){let s=this._chunks[i];if(s.byteLength>e){let d=s.slice(0,e);r.set(d,n),n+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e}else r.set(s,n),n+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return r}};fi.AbstractMessageBuffer=ho});var $c=M(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.createMessageConnection=G.ConnectionOptions=G.MessageStrategy=G.CancellationStrategy=G.CancellationSenderStrategy=G.CancellationReceiverStrategy=G.RequestCancellationReceiverStrategy=G.IdCancellationReceiverStrategy=G.ConnectionStrategy=G.ConnectionError=G.ConnectionErrors=G.LogTraceNotification=G.SetTraceNotification=G.TraceFormat=G.TraceValues=G.Trace=G.NullLogger=G.ProgressType=G.ProgressToken=void 0;var qc=Gt(),Re=Kr(),V=Bs(),Ic=Zs(),$n=tn(),po=ci(),Vn;(function(t){t.type=new V.NotificationType("$/cancelRequest")})(Vn||(Vn={}));var mo;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}t.is=e})(mo||(G.ProgressToken=mo={}));var Fn;(function(t){t.type=new V.NotificationType("$/progress")})(Fn||(Fn={}));var go=class{constructor(){}};G.ProgressType=go;var yo;(function(t){function e(r){return Re.func(r)}t.is=e})(yo||(yo={}));G.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var oe;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(oe||(G.Trace=oe={}));var Ac;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(Ac||(G.TraceValues=Ac={}));(function(t){function e(n){if(!Re.string(n))return t.Off;switch(n=n.toLowerCase(),n){case"off":return t.Off;case"messages":return t.Messages;case"compact":return t.Compact;case"verbose":return t.Verbose;default:return t.Off}}t.fromString=e;function r(n){switch(n){case t.Off:return"off";case t.Messages:return"messages";case t.Compact:return"compact";case t.Verbose:return"verbose";default:return"off"}}t.toString=r})(oe||(G.Trace=oe={}));var tt;(function(t){t.Text="text",t.JSON="json"})(tt||(G.TraceFormat=tt={}));(function(t){function e(r){return Re.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(tt||(G.TraceFormat=tt={}));var vo;(function(t){t.type=new V.NotificationType("$/setTrace")})(vo||(G.SetTraceNotification=vo={}));var hi;(function(t){t.type=new V.NotificationType("$/logTrace")})(hi||(G.LogTraceNotification=hi={}));var Wn;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(Wn||(G.ConnectionErrors=Wn={}));var on=class t extends Error{constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};G.ConnectionError=on;var _o;(function(t){function e(r){let n=r;return n&&Re.func(n.cancelUndispatched)}t.is=e})(_o||(G.ConnectionStrategy=_o={}));var pi;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&Re.func(n.createCancellationTokenSource)&&(n.dispose===void 0||Re.func(n.dispose))}t.is=e})(pi||(G.IdCancellationReceiverStrategy=pi={}));var bo;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&Re.func(n.createCancellationTokenSource)&&(n.dispose===void 0||Re.func(n.dispose))}t.is=e})(bo||(G.RequestCancellationReceiverStrategy=bo={}));var mi;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new po.CancellationTokenSource}});function e(r){return pi.is(r)||bo.is(r)}t.is=e})(mi||(G.CancellationReceiverStrategy=mi={}));var gi;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(Vn.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&Re.func(n.sendCancellation)&&Re.func(n.cleanup)}t.is=e})(gi||(G.CancellationSenderStrategy=gi={}));var yi;(function(t){t.Message=Object.freeze({receiver:mi.Message,sender:gi.Message});function e(r){let n=r;return n&&mi.is(n.receiver)&&gi.is(n.sender)}t.is=e})(yi||(G.CancellationStrategy=yi={}));var vi;(function(t){function e(r){let n=r;return n&&Re.func(n.handleMessage)}t.is=e})(vi||(G.MessageStrategy=vi={}));var Lc;(function(t){function e(r){let n=r;return n&&(yi.is(n.cancellationStrategy)||_o.is(n.connectionStrategy)||vi.is(n.messageStrategy))}t.is=e})(Lc||(G.ConnectionOptions=Lc={}));var mt;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(mt||(mt={}));function vh(t,e,r,n){let i=r!==void 0?r:G.NullLogger,s=0,d=0,h=0,R="2.0",T,P=new Map,Z,se=new Map,ce=new Map,Ue,Se=new Ic.LinkedMap,we=new Map,ue=new Set,de=new Map,O=oe.Off,pe=tt.Text,$,ye=mt.New,ve=new $n.Emitter,Be=new $n.Emitter,_t=new $n.Emitter,lt=new $n.Emitter,ft=new $n.Emitter,Te=n&&n.cancellationStrategy?n.cancellationStrategy:yi.Message;function Dt(o){if(o===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+o.toString()}function Ft(o){return o===null?"res-unknown-"+(++h).toString():"res-"+o.toString()}function Ir(){return"not-"+(++d).toString()}function In(o,f){V.Message.isRequest(f)?o.set(Dt(f.id),f):V.Message.isResponse(f)?o.set(Ft(f.id),f):o.set(Ir(),f)}function Ar(o){}function Wt(){return ye===mt.Listening}function bt(){return ye===mt.Closed}function je(){return ye===mt.Disposed}function Et(){(ye===mt.New||ye===mt.Listening)&&(ye=mt.Closed,Be.fire(void 0))}function Ot(o){ve.fire([o,void 0,void 0])}function Lr(o){ve.fire(o)}t.onClose(Et),t.onError(Ot),e.onClose(Et),e.onError(Lr);function Vt(){Ue||Se.size===0||(Ue=(0,qc.default)().timer.setImmediate(()=>{Ue=void 0,$r()}))}function zt(o){V.Message.isRequest(o)?Wr(o):V.Message.isNotification(o)?zr(o):V.Message.isResponse(o)?Vr(o):Ut(o)}function $r(){if(Se.size===0)return;let o=Se.shift();try{let f=n?.messageStrategy;vi.is(f)?f.handleMessage(o,zt):zt(o)}finally{Vt()}}let Fr=o=>{try{if(V.Message.isNotification(o)&&o.method===Vn.type.method){let f=o.params.id,g=Dt(f),_=Se.get(g);if(V.Message.isRequest(_)){let q=n?.connectionStrategy,B=q&&q.cancelUndispatched?q.cancelUndispatched(_,Ar):void 0;if(B&&(B.error!==void 0||B.result!==void 0)){Se.delete(g),de.delete(f),B.id=_.id,st(B,o.method,Date.now()),e.write(B).catch(()=>i.error("Sending response for canceled message failed."));return}}let L=de.get(f);if(L!==void 0){L.cancel(),wt(o);return}else ue.add(f)}In(Se,o)}finally{Vt()}};function Wr(o){if(je())return;function f(D,F,N){let X={jsonrpc:R,id:o.id};D instanceof V.ResponseError?X.error=D.toJson():X.result=D===void 0?null:D,st(X,F,N),e.write(X).catch(()=>i.error("Sending response failed."))}function g(D,F,N){let X={jsonrpc:R,id:o.id,error:D.toJson()};st(X,F,N),e.write(X).catch(()=>i.error("Sending response failed."))}function _(D,F,N){D===void 0&&(D=null);let X={jsonrpc:R,id:o.id,result:D};st(X,F,N),e.write(X).catch(()=>i.error("Sending response failed."))}Hr(o);let L=P.get(o.method),q,B;L&&(q=L.type,B=L.handler);let H=Date.now();if(B||T){let D=o.id??String(Date.now()),F=pi.is(Te.receiver)?Te.receiver.createCancellationTokenSource(D):Te.receiver.createCancellationTokenSource(o);o.id!==null&&ue.has(o.id)&&F.cancel(),o.id!==null&&de.set(D,F);try{let N;if(B)if(o.params===void 0){if(q!==void 0&&q.numberOfParams!==0){g(new V.ResponseError(V.ErrorCodes.InvalidParams,`Request ${o.method} defines ${q.numberOfParams} params but received none.`),o.method,H);return}N=B(F.token)}else if(Array.isArray(o.params)){if(q!==void 0&&q.parameterStructures===V.ParameterStructures.byName){g(new V.ResponseError(V.ErrorCodes.InvalidParams,`Request ${o.method} defines parameters by name but received parameters by position`),o.method,H);return}N=B(...o.params,F.token)}else{if(q!==void 0&&q.parameterStructures===V.ParameterStructures.byPosition){g(new V.ResponseError(V.ErrorCodes.InvalidParams,`Request ${o.method} defines parameters by position but received parameters by name`),o.method,H);return}N=B(o.params,F.token)}else T&&(N=T(o.method,o.params,F.token));let X=N;N?X.then?X.then(ie=>{de.delete(D),f(ie,o.method,H)},ie=>{de.delete(D),ie instanceof V.ResponseError?g(ie,o.method,H):ie&&Re.string(ie.message)?g(new V.ResponseError(V.ErrorCodes.InternalError,`Request ${o.method} failed with message: ${ie.message}`),o.method,H):g(new V.ResponseError(V.ErrorCodes.InternalError,`Request ${o.method} failed unexpectedly without providing any details.`),o.method,H)}):(de.delete(D),f(N,o.method,H)):(de.delete(D),_(N,o.method,H))}catch(N){de.delete(D),N instanceof V.ResponseError?f(N,o.method,H):N&&Re.string(N.message)?g(new V.ResponseError(V.ErrorCodes.InternalError,`Request ${o.method} failed with message: ${N.message}`),o.method,H):g(new V.ResponseError(V.ErrorCodes.InternalError,`Request ${o.method} failed unexpectedly without providing any details.`),o.method,H)}}else g(new V.ResponseError(V.ErrorCodes.MethodNotFound,`Unhandled method ${o.method}`),o.method,H)}function Vr(o){if(!je())if(o.id===null)o.error?i.error(`Received response message without id: Error is:
7
7
  ${JSON.stringify(o.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let f=o.id,g=we.get(f);if(Zr(o,g),g!==void 0){we.delete(f);try{if(o.error){let _=o.error;g.reject(new V.ResponseError(_.code,_.message,_.data))}else if(o.result!==void 0)g.resolve(o.result);else throw new Error("Should never happen.")}catch(_){_.message?i.error(`Response handler '${g.method}' failed with message: ${_.message}`):i.error(`Response handler '${g.method}' failed unexpectedly.`)}}}}function zr(o){if(je())return;let f,g;if(o.method===Vn.type.method){let _=o.params.id;ue.delete(_),wt(o);return}else{let _=se.get(o.method);_&&(g=_.handler,f=_.type)}if(g||Z)try{if(wt(o),g)if(o.params===void 0)f!==void 0&&f.numberOfParams!==0&&f.parameterStructures!==V.ParameterStructures.byName&&i.error(`Notification ${o.method} defines ${f.numberOfParams} params but received none.`),g();else if(Array.isArray(o.params)){let _=o.params;o.method===Fn.type.method&&_.length===2&&mo.is(_[0])?g({token:_[0],value:_[1]}):(f!==void 0&&(f.parameterStructures===V.ParameterStructures.byName&&i.error(`Notification ${o.method} defines parameters by name but received parameters by position`),f.numberOfParams!==o.params.length&&i.error(`Notification ${o.method} defines ${f.numberOfParams} params but received ${_.length} arguments`)),g(..._))}else f!==void 0&&f.parameterStructures===V.ParameterStructures.byPosition&&i.error(`Notification ${o.method} defines parameters by position but received parameters by name`),g(o.params);else Z&&Z(o.method,o.params)}catch(_){_.message?i.error(`Notification handler '${o.method}' failed with message: ${_.message}`):i.error(`Notification handler '${o.method}' failed unexpectedly.`)}else _t.fire(o)}function Ut(o){if(!o){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
8
- ${JSON.stringify(o,null,4)}`);let f=o;if(Re.string(f.id)||Re.number(f.id)){let g=f.id,_=we.get(g);_&&_.reject(new Error("The received response has neither a result nor an error property."))}}function xe(o){if(o!=null)switch(O){case oe.Verbose:return JSON.stringify(o,null,4);case oe.Compact:return JSON.stringify(o);default:return}}function Ur(o){if(!(O===oe.Off||!$))if(le===tt.Text){let f;(O===oe.Verbose||O===oe.Compact)&&o.params&&(f=`Params: ${xe(o.params)}
8
+ ${JSON.stringify(o,null,4)}`);let f=o;if(Re.string(f.id)||Re.number(f.id)){let g=f.id,_=we.get(g);_&&_.reject(new Error("The received response has neither a result nor an error property."))}}function xe(o){if(o!=null)switch(O){case oe.Verbose:return JSON.stringify(o,null,4);case oe.Compact:return JSON.stringify(o);default:return}}function Ur(o){if(!(O===oe.Off||!$))if(pe===tt.Text){let f;(O===oe.Verbose||O===oe.Compact)&&o.params&&(f=`Params: ${xe(o.params)}
9
9
 
10
- `),$.log(`Sending request '${o.method} - (${o.id})'.`,f)}else qe("send-request",o)}function Br(o){if(!(O===oe.Off||!$))if(le===tt.Text){let f;(O===oe.Verbose||O===oe.Compact)&&(o.params?f=`Params: ${xe(o.params)}
10
+ `),$.log(`Sending request '${o.method} - (${o.id})'.`,f)}else qe("send-request",o)}function Br(o){if(!(O===oe.Off||!$))if(pe===tt.Text){let f;(O===oe.Verbose||O===oe.Compact)&&(o.params?f=`Params: ${xe(o.params)}
11
11
 
12
12
  `:f=`No parameters provided.
13
13
 
14
- `),$.log(`Sending notification '${o.method}'.`,f)}else qe("send-notification",o)}function st(o,f,g){if(!(O===oe.Off||!$))if(le===tt.Text){let _;(O===oe.Verbose||O===oe.Compact)&&(o.error&&o.error.data?_=`Error data: ${xe(o.error.data)}
14
+ `),$.log(`Sending notification '${o.method}'.`,f)}else qe("send-notification",o)}function st(o,f,g){if(!(O===oe.Off||!$))if(pe===tt.Text){let _;(O===oe.Verbose||O===oe.Compact)&&(o.error&&o.error.data?_=`Error data: ${xe(o.error.data)}
15
15
 
16
16
  `:o.result?_=`Result: ${xe(o.result)}
17
17
 
18
18
  `:o.error===void 0&&(_=`No result returned.
19
19
 
20
- `)),$.log(`Sending response '${f} - (${o.id})'. Processing request took ${Date.now()-g}ms`,_)}else qe("send-response",o)}function Hr(o){if(!(O===oe.Off||!$))if(le===tt.Text){let f;(O===oe.Verbose||O===oe.Compact)&&o.params&&(f=`Params: ${xe(o.params)}
20
+ `)),$.log(`Sending response '${f} - (${o.id})'. Processing request took ${Date.now()-g}ms`,_)}else qe("send-response",o)}function Hr(o){if(!(O===oe.Off||!$))if(pe===tt.Text){let f;(O===oe.Verbose||O===oe.Compact)&&o.params&&(f=`Params: ${xe(o.params)}
21
21
 
22
- `),$.log(`Received request '${o.method} - (${o.id})'.`,f)}else qe("receive-request",o)}function wt(o){if(!(O===oe.Off||!$||o.method===hi.type.method))if(le===tt.Text){let f;(O===oe.Verbose||O===oe.Compact)&&(o.params?f=`Params: ${xe(o.params)}
22
+ `),$.log(`Received request '${o.method} - (${o.id})'.`,f)}else qe("receive-request",o)}function wt(o){if(!(O===oe.Off||!$||o.method===hi.type.method))if(pe===tt.Text){let f;(O===oe.Verbose||O===oe.Compact)&&(o.params?f=`Params: ${xe(o.params)}
23
23
 
24
24
  `:f=`No parameters provided.
25
25
 
26
- `),$.log(`Received notification '${o.method}'.`,f)}else qe("receive-notification",o)}function Zr(o,f){if(!(O===oe.Off||!$))if(le===tt.Text){let g;if((O===oe.Verbose||O===oe.Compact)&&(o.error&&o.error.data?g=`Error data: ${xe(o.error.data)}
26
+ `),$.log(`Received notification '${o.method}'.`,f)}else qe("receive-notification",o)}function Zr(o,f){if(!(O===oe.Off||!$))if(pe===tt.Text){let g;if((O===oe.Verbose||O===oe.Compact)&&(o.error&&o.error.data?g=`Error data: ${xe(o.error.data)}
27
27
 
28
28
  `:o.result?g=`Result: ${xe(o.result)}
29
29
 
30
30
  `:o.error===void 0&&(g=`No result returned.
31
31
 
32
- `)),f){let _=o.error?` Request failed: ${o.error.message} (${o.error.code}).`:"";$.log(`Received response '${f.method} - (${o.id})' in ${Date.now()-f.timerStart}ms.${_}`,g)}else $.log(`Received response ${o.id} without active response promise.`,g)}else qe("receive-response",o)}function qe(o,f){if(!$||O===oe.Off)return;let g={isLSPMessage:!0,type:o,message:f,timestamp:Date.now()};$.log(g)}function He(){if(bt())throw new on(Wn.Closed,"Connection is closed.");if(je())throw new on(Wn.Disposed,"Connection is disposed.")}function Jr(){if(Wt())throw new on(Wn.AlreadyListening,"Connection is already listening")}function Gr(){if(!Wt())throw new Error("Call listen() first.")}function Ie(o){return o===void 0?null:o}function Bt(o){if(o!==null)return o}function Ht(o){return o!=null&&!Array.isArray(o)&&typeof o=="object"}function Tt(o,f){switch(o){case V.ParameterStructures.auto:return Ht(f)?Bt(f):[Ie(f)];case V.ParameterStructures.byName:if(!Ht(f))throw new Error("Received parameters by name but param is not an object literal.");return Bt(f);case V.ParameterStructures.byPosition:return[Ie(f)];default:throw new Error(`Unknown parameter structure ${o.toString()}`)}}function Zt(o,f){let g,_=o.numberOfParams;switch(_){case 0:g=void 0;break;case 1:g=Tt(o.parameterStructures,f[0]);break;default:g=[];for(let L=0;L<f.length&&L<_;L++)g.push(Ie(f[L]));if(f.length<_)for(let L=f.length;L<_;L++)g.push(null);break}return g}let Ae={sendNotification:(o,...f)=>{He();let g,_;if(Re.string(o)){g=o;let q=f[0],B=0,H=V.ParameterStructures.auto;V.ParameterStructures.is(q)&&(B=1,H=q);let D=f.length,F=D-B;switch(F){case 0:_=void 0;break;case 1:_=Tt(H,f[B]);break;default:if(H===V.ParameterStructures.byName)throw new Error(`Received ${F} parameters for 'by Name' notification parameter structure.`);_=f.slice(B,D).map(N=>Ie(N));break}}else{let q=f;g=o.method,_=Zt(o,q)}let L={jsonrpc:R,method:g,params:_};return Br(L),e.write(L).catch(q=>{throw i.error("Sending notification failed."),q})},onNotification:(o,f)=>{He();let g;return Re.func(o)?Z=o:f&&(Re.string(o)?(g=o,se.set(o,{type:void 0,handler:f})):(g=o.method,se.set(o.method,{type:o,handler:f}))),{dispose:()=>{g!==void 0?se.delete(g):Z=void 0}}},onProgress:(o,f,g)=>{if(ce.has(f))throw new Error(`Progress handler for token ${f} already registered`);return ce.set(f,g),{dispose:()=>{ce.delete(f)}}},sendProgress:(o,f,g)=>Ae.sendNotification(Fn.type,{token:f,value:g}),onUnhandledProgress:lt.event,sendRequest:(o,...f)=>{He(),Gr();let g,_,L;if(Re.string(o)){g=o;let D=f[0],F=f[f.length-1],N=0,X=V.ParameterStructures.auto;V.ParameterStructures.is(D)&&(N=1,X=D);let ie=f.length;po.CancellationToken.is(F)&&(ie=ie-1,L=F);let _e=ie-N;switch(_e){case 0:_=void 0;break;case 1:_=Tt(X,f[N]);break;default:if(X===V.ParameterStructures.byName)throw new Error(`Received ${_e} parameters for 'by Name' request parameter structure.`);_=f.slice(N,ie).map(Qr=>Ie(Qr));break}}else{let D=f;g=o.method,_=Zt(o,D);let F=o.numberOfParams;L=po.CancellationToken.is(D[F])?D[F]:void 0}let q=s++,B;L&&(B=L.onCancellationRequested(()=>{let D=Te.sender.sendCancellation(Ae,q);return D===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${q}`),Promise.resolve()):D.catch(()=>{i.log(`Sending cancellation messages for id ${q} failed`)})}));let H={jsonrpc:R,id:q,method:g,params:_};return Ur(H),typeof Te.sender.enableCancellation=="function"&&Te.sender.enableCancellation(H),new Promise(async(D,F)=>{let N=_e=>{D(_e),Te.sender.cleanup(q),B?.dispose()},X=_e=>{F(_e),Te.sender.cleanup(q),B?.dispose()},ie={method:g,timerStart:Date.now(),resolve:N,reject:X};try{we.set(q,ie),await e.write(H)}catch(_e){throw we.delete(q),ie.reject(new V.ResponseError(V.ErrorCodes.MessageWriteError,_e.message?_e.message:"Unknown reason")),i.error("Sending request failed."),_e}})},onRequest:(o,f)=>{He();let g=null;return yo.is(o)?(g=void 0,T=o):Re.string(o)?(g=null,f!==void 0&&(g=o,P.set(o,{handler:f,type:void 0}))):f!==void 0&&(g=o.method,P.set(o.method,{type:o,handler:f})),{dispose:()=>{g!==null&&(g!==void 0?P.delete(g):T=void 0)}}},hasPendingResponse:()=>we.size>0,trace:async(o,f,g)=>{let _=!1,L=tt.Text;g!==void 0&&(Re.boolean(g)?_=g:(_=g.sendNotification||!1,L=g.traceFormat||tt.Text)),O=o,le=L,O===oe.Off?$=void 0:$=f,_&&!bt()&&!je()&&await Ae.sendNotification(vo.type,{value:oe.toString(o)})},onError:ve.event,onClose:Be.event,onUnhandledNotification:_t.event,onDispose:ft.event,end:()=>{e.end()},dispose:()=>{if(je())return;ye=mt.Disposed,ft.fire(void 0);let o=new V.ResponseError(V.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let f of we.values())f.reject(o);we=new Map,de=new Map,ue=new Set,Se=new Ic.LinkedMap,Re.func(e.dispose)&&e.dispose(),Re.func(t.dispose)&&t.dispose()},listen:()=>{He(),Jr(),ye=mt.Listening,t.listen(Fr)},inspect:()=>{(0,qc.default)().console.log("inspect")}};return Ae.onNotification(hi.type,o=>{if(O===oe.Off||!$)return;let f=O===oe.Verbose||O===oe.Compact;$.log(o.message,f?o.verbose:void 0)}),Ae.onNotification(Fn.type,o=>{let f=ce.get(o.token);f?f(o.value):lt.fire(o)}),Ae}G.createMessageConnection=vh});var _i=M(b=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});b.ProgressType=b.ProgressToken=b.createMessageConnection=b.NullLogger=b.ConnectionOptions=b.ConnectionStrategy=b.AbstractMessageBuffer=b.WriteableStreamMessageWriter=b.AbstractMessageWriter=b.MessageWriter=b.ReadableStreamMessageReader=b.AbstractMessageReader=b.MessageReader=b.SharedArrayReceiverStrategy=b.SharedArraySenderStrategy=b.CancellationToken=b.CancellationTokenSource=b.Emitter=b.Event=b.Disposable=b.LRUCache=b.Touch=b.LinkedMap=b.ParameterStructures=b.NotificationType9=b.NotificationType8=b.NotificationType7=b.NotificationType6=b.NotificationType5=b.NotificationType4=b.NotificationType3=b.NotificationType2=b.NotificationType1=b.NotificationType0=b.NotificationType=b.ErrorCodes=b.ResponseError=b.RequestType9=b.RequestType8=b.RequestType7=b.RequestType6=b.RequestType5=b.RequestType4=b.RequestType3=b.RequestType2=b.RequestType1=b.RequestType0=b.RequestType=b.Message=b.RAL=void 0;b.MessageStrategy=b.CancellationStrategy=b.CancellationSenderStrategy=b.CancellationReceiverStrategy=b.ConnectionError=b.ConnectionErrors=b.LogTraceNotification=b.SetTraceNotification=b.TraceFormat=b.TraceValues=b.Trace=void 0;var he=Bs();Object.defineProperty(b,"Message",{enumerable:!0,get:function(){return he.Message}});Object.defineProperty(b,"RequestType",{enumerable:!0,get:function(){return he.RequestType}});Object.defineProperty(b,"RequestType0",{enumerable:!0,get:function(){return he.RequestType0}});Object.defineProperty(b,"RequestType1",{enumerable:!0,get:function(){return he.RequestType1}});Object.defineProperty(b,"RequestType2",{enumerable:!0,get:function(){return he.RequestType2}});Object.defineProperty(b,"RequestType3",{enumerable:!0,get:function(){return he.RequestType3}});Object.defineProperty(b,"RequestType4",{enumerable:!0,get:function(){return he.RequestType4}});Object.defineProperty(b,"RequestType5",{enumerable:!0,get:function(){return he.RequestType5}});Object.defineProperty(b,"RequestType6",{enumerable:!0,get:function(){return he.RequestType6}});Object.defineProperty(b,"RequestType7",{enumerable:!0,get:function(){return he.RequestType7}});Object.defineProperty(b,"RequestType8",{enumerable:!0,get:function(){return he.RequestType8}});Object.defineProperty(b,"RequestType9",{enumerable:!0,get:function(){return he.RequestType9}});Object.defineProperty(b,"ResponseError",{enumerable:!0,get:function(){return he.ResponseError}});Object.defineProperty(b,"ErrorCodes",{enumerable:!0,get:function(){return he.ErrorCodes}});Object.defineProperty(b,"NotificationType",{enumerable:!0,get:function(){return he.NotificationType}});Object.defineProperty(b,"NotificationType0",{enumerable:!0,get:function(){return he.NotificationType0}});Object.defineProperty(b,"NotificationType1",{enumerable:!0,get:function(){return he.NotificationType1}});Object.defineProperty(b,"NotificationType2",{enumerable:!0,get:function(){return he.NotificationType2}});Object.defineProperty(b,"NotificationType3",{enumerable:!0,get:function(){return he.NotificationType3}});Object.defineProperty(b,"NotificationType4",{enumerable:!0,get:function(){return he.NotificationType4}});Object.defineProperty(b,"NotificationType5",{enumerable:!0,get:function(){return he.NotificationType5}});Object.defineProperty(b,"NotificationType6",{enumerable:!0,get:function(){return he.NotificationType6}});Object.defineProperty(b,"NotificationType7",{enumerable:!0,get:function(){return he.NotificationType7}});Object.defineProperty(b,"NotificationType8",{enumerable:!0,get:function(){return he.NotificationType8}});Object.defineProperty(b,"NotificationType9",{enumerable:!0,get:function(){return he.NotificationType9}});Object.defineProperty(b,"ParameterStructures",{enumerable:!0,get:function(){return he.ParameterStructures}});var wo=Zs();Object.defineProperty(b,"LinkedMap",{enumerable:!0,get:function(){return wo.LinkedMap}});Object.defineProperty(b,"LRUCache",{enumerable:!0,get:function(){return wo.LRUCache}});Object.defineProperty(b,"Touch",{enumerable:!0,get:function(){return wo.Touch}});var _h=kc();Object.defineProperty(b,"Disposable",{enumerable:!0,get:function(){return _h.Disposable}});var Fc=tn();Object.defineProperty(b,"Event",{enumerable:!0,get:function(){return Fc.Event}});Object.defineProperty(b,"Emitter",{enumerable:!0,get:function(){return Fc.Emitter}});var Wc=ci();Object.defineProperty(b,"CancellationTokenSource",{enumerable:!0,get:function(){return Wc.CancellationTokenSource}});Object.defineProperty(b,"CancellationToken",{enumerable:!0,get:function(){return Wc.CancellationToken}});var Vc=Cc();Object.defineProperty(b,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return Vc.SharedArraySenderStrategy}});Object.defineProperty(b,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return Vc.SharedArrayReceiverStrategy}});var To=xc();Object.defineProperty(b,"MessageReader",{enumerable:!0,get:function(){return To.MessageReader}});Object.defineProperty(b,"AbstractMessageReader",{enumerable:!0,get:function(){return To.AbstractMessageReader}});Object.defineProperty(b,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return To.ReadableStreamMessageReader}});var Ro=Mc();Object.defineProperty(b,"MessageWriter",{enumerable:!0,get:function(){return Ro.MessageWriter}});Object.defineProperty(b,"AbstractMessageWriter",{enumerable:!0,get:function(){return Ro.AbstractMessageWriter}});Object.defineProperty(b,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return Ro.WriteableStreamMessageWriter}});var bh=jc();Object.defineProperty(b,"AbstractMessageBuffer",{enumerable:!0,get:function(){return bh.AbstractMessageBuffer}});var Oe=$c();Object.defineProperty(b,"ConnectionStrategy",{enumerable:!0,get:function(){return Oe.ConnectionStrategy}});Object.defineProperty(b,"ConnectionOptions",{enumerable:!0,get:function(){return Oe.ConnectionOptions}});Object.defineProperty(b,"NullLogger",{enumerable:!0,get:function(){return Oe.NullLogger}});Object.defineProperty(b,"createMessageConnection",{enumerable:!0,get:function(){return Oe.createMessageConnection}});Object.defineProperty(b,"ProgressToken",{enumerable:!0,get:function(){return Oe.ProgressToken}});Object.defineProperty(b,"ProgressType",{enumerable:!0,get:function(){return Oe.ProgressType}});Object.defineProperty(b,"Trace",{enumerable:!0,get:function(){return Oe.Trace}});Object.defineProperty(b,"TraceValues",{enumerable:!0,get:function(){return Oe.TraceValues}});Object.defineProperty(b,"TraceFormat",{enumerable:!0,get:function(){return Oe.TraceFormat}});Object.defineProperty(b,"SetTraceNotification",{enumerable:!0,get:function(){return Oe.SetTraceNotification}});Object.defineProperty(b,"LogTraceNotification",{enumerable:!0,get:function(){return Oe.LogTraceNotification}});Object.defineProperty(b,"ConnectionErrors",{enumerable:!0,get:function(){return Oe.ConnectionErrors}});Object.defineProperty(b,"ConnectionError",{enumerable:!0,get:function(){return Oe.ConnectionError}});Object.defineProperty(b,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Oe.CancellationReceiverStrategy}});Object.defineProperty(b,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Oe.CancellationSenderStrategy}});Object.defineProperty(b,"CancellationStrategy",{enumerable:!0,get:function(){return Oe.CancellationStrategy}});Object.defineProperty(b,"MessageStrategy",{enumerable:!0,get:function(){return Oe.MessageStrategy}});var wh=Gt();b.RAL=wh.default});var Bc=M(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});var zc=require("util"),Mt=_i(),bi=class t extends Mt.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return t.emptyBuffer}fromString(e,r){return Buffer.from(e,r)}toString(e,r){return e instanceof Buffer?e.toString(r):new zc.TextDecoder(r).decode(e)}asNative(e,r){return r===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,r):Buffer.from(e,0,r)}allocNative(e){return Buffer.allocUnsafe(e)}};bi.emptyBuffer=Buffer.allocUnsafe(0);var ko=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Mt.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Mt.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Mt.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),Mt.Disposable.create(()=>this.stream.off("data",e))}},So=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Mt.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Mt.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Mt.Disposable.create(()=>this.stream.off("end",e))}write(e,r){return new Promise((n,i)=>{let s=d=>{d==null?n():i(d)};typeof e=="string"?this.stream.write(e,r,s):this.stream.write(e,s)})}end(){this.stream.end()}},Uc=Object.freeze({messageBuffer:Object.freeze({create:t=>new bi(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(r){return Promise.reject(r)}}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new zc.TextDecoder(e.charset).decode(t)))}catch(r){return Promise.reject(r)}}})}),stream:Object.freeze({asReadableStream:t=>new ko(t),asWritableStream:t=>new So(t)}),console,timer:Object.freeze({setTimeout(t,e,...r){let n=setTimeout(t,e,...r);return{dispose:()=>clearTimeout(n)}},setImmediate(t,...e){let r=setImmediate(t,...e);return{dispose:()=>clearImmediate(r)}},setInterval(t,e,...r){let n=setInterval(t,e,...r);return{dispose:()=>clearInterval(n)}}})});function Co(){return Uc}(function(t){function e(){Mt.RAL.install(Uc)}t.install=e})(Co||(Co={}));Po.default=Co});var No=M(re=>{"use strict";var Th=re&&re.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Rh=re&&re.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Th(e,t,r)};Object.defineProperty(re,"__esModule",{value:!0});re.createMessageConnection=re.createServerSocketTransport=re.createClientSocketTransport=re.createServerPipeTransport=re.createClientPipeTransport=re.generateRandomPipeName=re.StreamMessageWriter=re.StreamMessageReader=re.SocketMessageWriter=re.SocketMessageReader=re.PortMessageWriter=re.PortMessageReader=re.IPCMessageWriter=re.IPCMessageReader=void 0;var an=Bc();an.default.install();var Hc=require("path"),kh=require("os"),Sh=require("crypto"),Ri=require("net"),rt=_i();Rh(_i(),re);var xo=class extends rt.AbstractMessageReader{constructor(e){super(),this.process=e;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),rt.Disposable.create(()=>this.process.off("message",e))}};re.IPCMessageReader=xo;var Do=class extends rt.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,r=>{r?(this.errorCount++,this.handleError(r,e)):this.errorCount=0}),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};re.IPCMessageWriter=Do;var Eo=class extends rt.AbstractMessageReader{constructor(e){super(),this.onData=new rt.Emitter,e.on("close",()=>this.fireClose),e.on("error",r=>this.fireError(r)),e.on("message",r=>{this.onData.fire(r)})}listen(e){return this.onData.event(e)}};re.PortMessageReader=Eo;var Oo=class extends rt.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",r=>this.fireError(r))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};re.PortMessageWriter=Oo;var fr=class extends rt.ReadableStreamMessageReader{constructor(e,r="utf-8"){super((0,an.default)().stream.asReadableStream(e),r)}};re.SocketMessageReader=fr;var hr=class extends rt.WriteableStreamMessageWriter{constructor(e,r){super((0,an.default)().stream.asWritableStream(e),r),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};re.SocketMessageWriter=hr;var wi=class extends rt.ReadableStreamMessageReader{constructor(e,r){super((0,an.default)().stream.asReadableStream(e),r)}};re.StreamMessageReader=wi;var Ti=class extends rt.WriteableStreamMessageWriter{constructor(e,r){super((0,an.default)().stream.asWritableStream(e),r)}};re.StreamMessageWriter=Ti;var Zc=process.env.XDG_RUNTIME_DIR,Ch=new Map([["linux",107],["darwin",103]]);function Ph(){let t=(0,Sh.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;Zc?e=Hc.join(Zc,`vscode-ipc-${t}.sock`):e=Hc.join(kh.tmpdir(),`vscode-${t}.sock`);let r=Ch.get(process.platform);return r!==void 0&&e.length>r&&(0,an.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${r} characters.`),e}re.generateRandomPipeName=Ph;function xh(t,e="utf-8"){let r,n=new Promise((i,s)=>{r=i});return new Promise((i,s)=>{let d=(0,Ri.createServer)(h=>{d.close(),r([new fr(h,e),new hr(h,e)])});d.on("error",s),d.listen(t,()=>{d.removeListener("error",s),i({onConnected:()=>n})})})}re.createClientPipeTransport=xh;function Dh(t,e="utf-8"){let r=(0,Ri.createConnection)(t);return[new fr(r,e),new hr(r,e)]}re.createServerPipeTransport=Dh;function Eh(t,e="utf-8"){let r,n=new Promise((i,s)=>{r=i});return new Promise((i,s)=>{let d=(0,Ri.createServer)(h=>{d.close(),r([new fr(h,e),new hr(h,e)])});d.on("error",s),d.listen(t,"127.0.0.1",()=>{d.removeListener("error",s),i({onConnected:()=>n})})})}re.createClientSocketTransport=Eh;function Oh(t,e="utf-8"){let r=(0,Ri.createConnection)(t,"127.0.0.1");return[new fr(r,e),new hr(r,e)]}re.createServerSocketTransport=Oh;function Nh(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function Mh(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function jh(t,e,r,n){r||(r=rt.NullLogger);let i=Nh(t)?new wi(t):t,s=Mh(e)?new Ti(e):e;return rt.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,rt.createMessageConnection)(i,s,r,n)}re.createMessageConnection=jh});var Gc=M((Cg,Jc)=>{"use strict";Jc.exports=No()});var cn=M(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.stringArray=Fe.array=Fe.func=Fe.error=Fe.number=Fe.string=Fe.boolean=void 0;function qh(t){return t===!0||t===!1}Fe.boolean=qh;function Qc(t){return typeof t=="string"||t instanceof String}Fe.string=Qc;function Ih(t){return typeof t=="number"||t instanceof Number}Fe.number=Ih;function Ah(t){return t instanceof Error}Fe.error=Ah;function Lh(t){return typeof t=="function"}Fe.func=Lh;function Xc(t){return Array.isArray(t)}Fe.array=Xc;function $h(t){return Xc(t)&&t.every(e=>Qc(e))}Fe.stringArray=$h});var na=M(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.Message=A.NotificationType9=A.NotificationType8=A.NotificationType7=A.NotificationType6=A.NotificationType5=A.NotificationType4=A.NotificationType3=A.NotificationType2=A.NotificationType1=A.NotificationType0=A.NotificationType=A.RequestType9=A.RequestType8=A.RequestType7=A.RequestType6=A.RequestType5=A.RequestType4=A.RequestType3=A.RequestType2=A.RequestType1=A.RequestType=A.RequestType0=A.AbstractMessageSignature=A.ParameterStructures=A.ResponseError=A.ErrorCodes=void 0;var pr=cn(),Mo;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(Mo||(A.ErrorCodes=Mo={}));var jo=class t extends Error{constructor(e,r,n){super(r),this.code=pr.number(e)?e:Mo.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};A.ResponseError=jo;var Je=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};A.ParameterStructures=Je;Je.auto=new Je("auto");Je.byPosition=new Je("byPosition");Je.byName=new Je("byName");var ge=class{constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return Je.auto}};A.AbstractMessageSignature=ge;var qo=class extends ge{constructor(e){super(e,0)}};A.RequestType0=qo;var Io=class extends ge{constructor(e,r=Je.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};A.RequestType=Io;var Ao=class extends ge{constructor(e,r=Je.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};A.RequestType1=Ao;var Lo=class extends ge{constructor(e){super(e,2)}};A.RequestType2=Lo;var $o=class extends ge{constructor(e){super(e,3)}};A.RequestType3=$o;var Fo=class extends ge{constructor(e){super(e,4)}};A.RequestType4=Fo;var Wo=class extends ge{constructor(e){super(e,5)}};A.RequestType5=Wo;var Vo=class extends ge{constructor(e){super(e,6)}};A.RequestType6=Vo;var zo=class extends ge{constructor(e){super(e,7)}};A.RequestType7=zo;var Uo=class extends ge{constructor(e){super(e,8)}};A.RequestType8=Uo;var Bo=class extends ge{constructor(e){super(e,9)}};A.RequestType9=Bo;var Ho=class extends ge{constructor(e,r=Je.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};A.NotificationType=Ho;var Zo=class extends ge{constructor(e){super(e,0)}};A.NotificationType0=Zo;var Jo=class extends ge{constructor(e,r=Je.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};A.NotificationType1=Jo;var Go=class extends ge{constructor(e){super(e,2)}};A.NotificationType2=Go;var Qo=class extends ge{constructor(e){super(e,3)}};A.NotificationType3=Qo;var Xo=class extends ge{constructor(e){super(e,4)}};A.NotificationType4=Xo;var Yo=class extends ge{constructor(e){super(e,5)}};A.NotificationType5=Yo;var Ko=class extends ge{constructor(e){super(e,6)}};A.NotificationType6=Ko;var ea=class extends ge{constructor(e){super(e,7)}};A.NotificationType7=ea;var ta=class extends ge{constructor(e){super(e,8)}};A.NotificationType8=ta;var ra=class extends ge{constructor(e){super(e,9)}};A.NotificationType9=ra;var Yc;(function(t){function e(i){let s=i;return s&&pr.string(s.method)&&(pr.string(s.id)||pr.number(s.id))}t.isRequest=e;function r(i){let s=i;return s&&pr.string(s.method)&&i.id===void 0}t.isNotification=r;function n(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&(pr.string(s.id)||pr.number(s.id)||s.id===null)}t.isResponse=n})(Yc||(A.Message=Yc={}))});var sa=M(Yt=>{"use strict";var Kc;Object.defineProperty(Yt,"__esModule",{value:!0});Yt.LRUCache=Yt.LinkedMap=Yt.Touch=void 0;var We;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(We||(Yt.Touch=We={}));var ki=class{constructor(){this[Kc]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,r=We.None){let n=this._map.get(e);if(n)return r!==We.None&&this.touch(n,r),n.value}set(e,r,n=We.None){let i=this._map.get(e);if(i)i.value=r,n!==We.None&&this.touch(i,n);else{switch(i={key:e,value:r,next:void 0,previous:void 0},n){case We.None:this.addItemLast(i);break;case We.First:this.addItemFirst(i);break;case We.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,i=this._head;for(;i;){if(r?e.bind(r)(i.value,i.key,this):e(i.value,i.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.key,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}values(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.value,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}entries(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:[r.key,r.value],done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}[(Kc=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==We.First&&r!==We.Last)){if(r===We.First){if(e===this._head)return;let n=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(n.previous=i,i.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===We.Last){if(e===this._tail)return;let n=e.next,i=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=i,i.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};Yt.LinkedMap=ki;var ia=class extends ki{constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,r=We.AsNew){return super.get(e,r)}peek(e){return super.get(e,We.None)}set(e,r){return super.set(e,r,We.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Yt.LRUCache=ia});var tu=M(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.Disposable=void 0;var eu;(function(t){function e(r){return{dispose:r}}t.create=e})(eu||(Si.Disposable=eu={}))});var Kt=M(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});var oa;function aa(){if(oa===void 0)throw new Error("No runtime abstraction layer installed");return oa}(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");oa=r}t.install=e})(aa||(aa={}));ca.default=aa});var dn=M(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.Emitter=un.Event=void 0;var Fh=Kt(),ru;(function(t){let e={dispose(){}};t.None=function(){return e}})(ru||(un.Event=ru={}));var ua=class{add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,r)})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let i=0,s=this._callbacks.length;i<s;i++)if(this._callbacks[i]===e)if(this._contexts[i]===r){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else n=!0;if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let r=[],n=this._callbacks.slice(0),i=this._contexts.slice(0);for(let s=0,d=n.length;s<d;s++)try{r.push(n[s].apply(i[s],e))}catch(h){(0,Fh.default)().console.error(h)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Ci=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,r,n)=>{this._callbacks||(this._callbacks=new ua),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,r),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};un.Emitter=Ci;Ci._noop=function(){}});var Di=M(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.CancellationTokenSource=ln.CancellationToken=void 0;var Wh=Kt(),Vh=cn(),da=dn(),Pi;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:da.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:da.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||Vh.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.is=e})(Pi||(ln.CancellationToken=Pi={}));var zh=Object.freeze(function(t,e){let r=(0,Wh.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),xi=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?zh:(this._emitter||(this._emitter=new da.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},la=class{get token(){return this._token||(this._token=new xi),this._token}cancel(){this._token?this._token.cancel():this._token=Pi.Cancelled}dispose(){this._token?this._token instanceof xi&&this._token.dispose():this._token=Pi.None}};ln.CancellationTokenSource=la});var nu=M(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.SharedArrayReceiverStrategy=fn.SharedArraySenderStrategy=void 0;var Uh=Di(),zn;(function(t){t.Continue=0,t.Cancelled=1})(zn||(zn={}));var fa=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let r=new SharedArrayBuffer(4),n=new Int32Array(r,0,1);n[0]=zn.Continue,this.buffers.set(e.id,r),e.$cancellationData=r}async sendCancellation(e,r){let n=this.buffers.get(r);if(n===void 0)return;let i=new Int32Array(n,0,1);Atomics.store(i,0,zn.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};fn.SharedArraySenderStrategy=fa;var ha=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===zn.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},pa=class{constructor(e){this.token=new ha(e)}cancel(){}dispose(){}},ma=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new Uh.CancellationTokenSource:new pa(r)}};fn.SharedArrayReceiverStrategy=ma});var ya=M(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.Semaphore=void 0;var Bh=Kt(),ga=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((r,n)=>{this._waiting.push({thunk:e,resolve:r,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,Bh.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let r=e.thunk();r instanceof Promise?r.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(r),this.runNext())}catch(r){this._active--,e.reject(r),this.runNext()}}};Ei.Semaphore=ga});var su=M(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.ReadableStreamMessageReader=er.AbstractMessageReader=er.MessageReader=void 0;var _a=Kt(),hn=cn(),va=dn(),Hh=ya(),iu;(function(t){function e(r){let n=r;return n&&hn.func(n.listen)&&hn.func(n.dispose)&&hn.func(n.onError)&&hn.func(n.onClose)&&hn.func(n.onPartialMessage)}t.is=e})(iu||(er.MessageReader=iu={}));var Oi=class{constructor(){this.errorEmitter=new va.Emitter,this.closeEmitter=new va.Emitter,this.partialMessageEmitter=new va.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${hn.string(e.message)?e.message:"unknown"}`)}};er.AbstractMessageReader=Oi;var ba;(function(t){function e(r){let n,i,s,d=new Map,h,R=new Map;if(r===void 0||typeof r=="string")n=r??"utf-8";else{if(n=r.charset??"utf-8",r.contentDecoder!==void 0&&(s=r.contentDecoder,d.set(s.name,s)),r.contentDecoders!==void 0)for(let T of r.contentDecoders)d.set(T.name,T);if(r.contentTypeDecoder!==void 0&&(h=r.contentTypeDecoder,R.set(h.name,h)),r.contentTypeDecoders!==void 0)for(let T of r.contentTypeDecoders)R.set(T.name,T)}return h===void 0&&(h=(0,_a.default)().applicationJson.decoder,R.set(h.name,h)),{charset:n,contentDecoder:s,contentDecoders:d,contentTypeDecoder:h,contentTypeDecoders:R}}t.fromOptions=e})(ba||(ba={}));var wa=class extends Oi{constructor(e,r){super(),this.readable=e,this.options=ba.fromOptions(r),this.buffer=(0,_a.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new Hh.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let r=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders(!0);if(!n)return;let i=n.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
32
+ `)),f){let _=o.error?` Request failed: ${o.error.message} (${o.error.code}).`:"";$.log(`Received response '${f.method} - (${o.id})' in ${Date.now()-f.timerStart}ms.${_}`,g)}else $.log(`Received response ${o.id} without active response promise.`,g)}else qe("receive-response",o)}function qe(o,f){if(!$||O===oe.Off)return;let g={isLSPMessage:!0,type:o,message:f,timestamp:Date.now()};$.log(g)}function He(){if(bt())throw new on(Wn.Closed,"Connection is closed.");if(je())throw new on(Wn.Disposed,"Connection is disposed.")}function Jr(){if(Wt())throw new on(Wn.AlreadyListening,"Connection is already listening")}function Gr(){if(!Wt())throw new Error("Call listen() first.")}function Ie(o){return o===void 0?null:o}function Bt(o){if(o!==null)return o}function Ht(o){return o!=null&&!Array.isArray(o)&&typeof o=="object"}function Tt(o,f){switch(o){case V.ParameterStructures.auto:return Ht(f)?Bt(f):[Ie(f)];case V.ParameterStructures.byName:if(!Ht(f))throw new Error("Received parameters by name but param is not an object literal.");return Bt(f);case V.ParameterStructures.byPosition:return[Ie(f)];default:throw new Error(`Unknown parameter structure ${o.toString()}`)}}function Zt(o,f){let g,_=o.numberOfParams;switch(_){case 0:g=void 0;break;case 1:g=Tt(o.parameterStructures,f[0]);break;default:g=[];for(let L=0;L<f.length&&L<_;L++)g.push(Ie(f[L]));if(f.length<_)for(let L=f.length;L<_;L++)g.push(null);break}return g}let Ae={sendNotification:(o,...f)=>{He();let g,_;if(Re.string(o)){g=o;let q=f[0],B=0,H=V.ParameterStructures.auto;V.ParameterStructures.is(q)&&(B=1,H=q);let D=f.length,F=D-B;switch(F){case 0:_=void 0;break;case 1:_=Tt(H,f[B]);break;default:if(H===V.ParameterStructures.byName)throw new Error(`Received ${F} parameters for 'by Name' notification parameter structure.`);_=f.slice(B,D).map(N=>Ie(N));break}}else{let q=f;g=o.method,_=Zt(o,q)}let L={jsonrpc:R,method:g,params:_};return Br(L),e.write(L).catch(q=>{throw i.error("Sending notification failed."),q})},onNotification:(o,f)=>{He();let g;return Re.func(o)?Z=o:f&&(Re.string(o)?(g=o,se.set(o,{type:void 0,handler:f})):(g=o.method,se.set(o.method,{type:o,handler:f}))),{dispose:()=>{g!==void 0?se.delete(g):Z=void 0}}},onProgress:(o,f,g)=>{if(ce.has(f))throw new Error(`Progress handler for token ${f} already registered`);return ce.set(f,g),{dispose:()=>{ce.delete(f)}}},sendProgress:(o,f,g)=>Ae.sendNotification(Fn.type,{token:f,value:g}),onUnhandledProgress:lt.event,sendRequest:(o,...f)=>{He(),Gr();let g,_,L;if(Re.string(o)){g=o;let D=f[0],F=f[f.length-1],N=0,X=V.ParameterStructures.auto;V.ParameterStructures.is(D)&&(N=1,X=D);let ie=f.length;po.CancellationToken.is(F)&&(ie=ie-1,L=F);let _e=ie-N;switch(_e){case 0:_=void 0;break;case 1:_=Tt(X,f[N]);break;default:if(X===V.ParameterStructures.byName)throw new Error(`Received ${_e} parameters for 'by Name' request parameter structure.`);_=f.slice(N,ie).map(Qr=>Ie(Qr));break}}else{let D=f;g=o.method,_=Zt(o,D);let F=o.numberOfParams;L=po.CancellationToken.is(D[F])?D[F]:void 0}let q=s++,B;L&&(B=L.onCancellationRequested(()=>{let D=Te.sender.sendCancellation(Ae,q);return D===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${q}`),Promise.resolve()):D.catch(()=>{i.log(`Sending cancellation messages for id ${q} failed`)})}));let H={jsonrpc:R,id:q,method:g,params:_};return Ur(H),typeof Te.sender.enableCancellation=="function"&&Te.sender.enableCancellation(H),new Promise(async(D,F)=>{let N=_e=>{D(_e),Te.sender.cleanup(q),B?.dispose()},X=_e=>{F(_e),Te.sender.cleanup(q),B?.dispose()},ie={method:g,timerStart:Date.now(),resolve:N,reject:X};try{we.set(q,ie),await e.write(H)}catch(_e){throw we.delete(q),ie.reject(new V.ResponseError(V.ErrorCodes.MessageWriteError,_e.message?_e.message:"Unknown reason")),i.error("Sending request failed."),_e}})},onRequest:(o,f)=>{He();let g=null;return yo.is(o)?(g=void 0,T=o):Re.string(o)?(g=null,f!==void 0&&(g=o,P.set(o,{handler:f,type:void 0}))):f!==void 0&&(g=o.method,P.set(o.method,{type:o,handler:f})),{dispose:()=>{g!==null&&(g!==void 0?P.delete(g):T=void 0)}}},hasPendingResponse:()=>we.size>0,trace:async(o,f,g)=>{let _=!1,L=tt.Text;g!==void 0&&(Re.boolean(g)?_=g:(_=g.sendNotification||!1,L=g.traceFormat||tt.Text)),O=o,pe=L,O===oe.Off?$=void 0:$=f,_&&!bt()&&!je()&&await Ae.sendNotification(vo.type,{value:oe.toString(o)})},onError:ve.event,onClose:Be.event,onUnhandledNotification:_t.event,onDispose:ft.event,end:()=>{e.end()},dispose:()=>{if(je())return;ye=mt.Disposed,ft.fire(void 0);let o=new V.ResponseError(V.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let f of we.values())f.reject(o);we=new Map,de=new Map,ue=new Set,Se=new Ic.LinkedMap,Re.func(e.dispose)&&e.dispose(),Re.func(t.dispose)&&t.dispose()},listen:()=>{He(),Jr(),ye=mt.Listening,t.listen(Fr)},inspect:()=>{(0,qc.default)().console.log("inspect")}};return Ae.onNotification(hi.type,o=>{if(O===oe.Off||!$)return;let f=O===oe.Verbose||O===oe.Compact;$.log(o.message,f?o.verbose:void 0)}),Ae.onNotification(Fn.type,o=>{let f=ce.get(o.token);f?f(o.value):lt.fire(o)}),Ae}G.createMessageConnection=vh});var _i=M(b=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});b.ProgressType=b.ProgressToken=b.createMessageConnection=b.NullLogger=b.ConnectionOptions=b.ConnectionStrategy=b.AbstractMessageBuffer=b.WriteableStreamMessageWriter=b.AbstractMessageWriter=b.MessageWriter=b.ReadableStreamMessageReader=b.AbstractMessageReader=b.MessageReader=b.SharedArrayReceiverStrategy=b.SharedArraySenderStrategy=b.CancellationToken=b.CancellationTokenSource=b.Emitter=b.Event=b.Disposable=b.LRUCache=b.Touch=b.LinkedMap=b.ParameterStructures=b.NotificationType9=b.NotificationType8=b.NotificationType7=b.NotificationType6=b.NotificationType5=b.NotificationType4=b.NotificationType3=b.NotificationType2=b.NotificationType1=b.NotificationType0=b.NotificationType=b.ErrorCodes=b.ResponseError=b.RequestType9=b.RequestType8=b.RequestType7=b.RequestType6=b.RequestType5=b.RequestType4=b.RequestType3=b.RequestType2=b.RequestType1=b.RequestType0=b.RequestType=b.Message=b.RAL=void 0;b.MessageStrategy=b.CancellationStrategy=b.CancellationSenderStrategy=b.CancellationReceiverStrategy=b.ConnectionError=b.ConnectionErrors=b.LogTraceNotification=b.SetTraceNotification=b.TraceFormat=b.TraceValues=b.Trace=void 0;var fe=Bs();Object.defineProperty(b,"Message",{enumerable:!0,get:function(){return fe.Message}});Object.defineProperty(b,"RequestType",{enumerable:!0,get:function(){return fe.RequestType}});Object.defineProperty(b,"RequestType0",{enumerable:!0,get:function(){return fe.RequestType0}});Object.defineProperty(b,"RequestType1",{enumerable:!0,get:function(){return fe.RequestType1}});Object.defineProperty(b,"RequestType2",{enumerable:!0,get:function(){return fe.RequestType2}});Object.defineProperty(b,"RequestType3",{enumerable:!0,get:function(){return fe.RequestType3}});Object.defineProperty(b,"RequestType4",{enumerable:!0,get:function(){return fe.RequestType4}});Object.defineProperty(b,"RequestType5",{enumerable:!0,get:function(){return fe.RequestType5}});Object.defineProperty(b,"RequestType6",{enumerable:!0,get:function(){return fe.RequestType6}});Object.defineProperty(b,"RequestType7",{enumerable:!0,get:function(){return fe.RequestType7}});Object.defineProperty(b,"RequestType8",{enumerable:!0,get:function(){return fe.RequestType8}});Object.defineProperty(b,"RequestType9",{enumerable:!0,get:function(){return fe.RequestType9}});Object.defineProperty(b,"ResponseError",{enumerable:!0,get:function(){return fe.ResponseError}});Object.defineProperty(b,"ErrorCodes",{enumerable:!0,get:function(){return fe.ErrorCodes}});Object.defineProperty(b,"NotificationType",{enumerable:!0,get:function(){return fe.NotificationType}});Object.defineProperty(b,"NotificationType0",{enumerable:!0,get:function(){return fe.NotificationType0}});Object.defineProperty(b,"NotificationType1",{enumerable:!0,get:function(){return fe.NotificationType1}});Object.defineProperty(b,"NotificationType2",{enumerable:!0,get:function(){return fe.NotificationType2}});Object.defineProperty(b,"NotificationType3",{enumerable:!0,get:function(){return fe.NotificationType3}});Object.defineProperty(b,"NotificationType4",{enumerable:!0,get:function(){return fe.NotificationType4}});Object.defineProperty(b,"NotificationType5",{enumerable:!0,get:function(){return fe.NotificationType5}});Object.defineProperty(b,"NotificationType6",{enumerable:!0,get:function(){return fe.NotificationType6}});Object.defineProperty(b,"NotificationType7",{enumerable:!0,get:function(){return fe.NotificationType7}});Object.defineProperty(b,"NotificationType8",{enumerable:!0,get:function(){return fe.NotificationType8}});Object.defineProperty(b,"NotificationType9",{enumerable:!0,get:function(){return fe.NotificationType9}});Object.defineProperty(b,"ParameterStructures",{enumerable:!0,get:function(){return fe.ParameterStructures}});var wo=Zs();Object.defineProperty(b,"LinkedMap",{enumerable:!0,get:function(){return wo.LinkedMap}});Object.defineProperty(b,"LRUCache",{enumerable:!0,get:function(){return wo.LRUCache}});Object.defineProperty(b,"Touch",{enumerable:!0,get:function(){return wo.Touch}});var _h=kc();Object.defineProperty(b,"Disposable",{enumerable:!0,get:function(){return _h.Disposable}});var Fc=tn();Object.defineProperty(b,"Event",{enumerable:!0,get:function(){return Fc.Event}});Object.defineProperty(b,"Emitter",{enumerable:!0,get:function(){return Fc.Emitter}});var Wc=ci();Object.defineProperty(b,"CancellationTokenSource",{enumerable:!0,get:function(){return Wc.CancellationTokenSource}});Object.defineProperty(b,"CancellationToken",{enumerable:!0,get:function(){return Wc.CancellationToken}});var Vc=Cc();Object.defineProperty(b,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return Vc.SharedArraySenderStrategy}});Object.defineProperty(b,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return Vc.SharedArrayReceiverStrategy}});var To=xc();Object.defineProperty(b,"MessageReader",{enumerable:!0,get:function(){return To.MessageReader}});Object.defineProperty(b,"AbstractMessageReader",{enumerable:!0,get:function(){return To.AbstractMessageReader}});Object.defineProperty(b,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return To.ReadableStreamMessageReader}});var Ro=Mc();Object.defineProperty(b,"MessageWriter",{enumerable:!0,get:function(){return Ro.MessageWriter}});Object.defineProperty(b,"AbstractMessageWriter",{enumerable:!0,get:function(){return Ro.AbstractMessageWriter}});Object.defineProperty(b,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return Ro.WriteableStreamMessageWriter}});var bh=jc();Object.defineProperty(b,"AbstractMessageBuffer",{enumerable:!0,get:function(){return bh.AbstractMessageBuffer}});var Oe=$c();Object.defineProperty(b,"ConnectionStrategy",{enumerable:!0,get:function(){return Oe.ConnectionStrategy}});Object.defineProperty(b,"ConnectionOptions",{enumerable:!0,get:function(){return Oe.ConnectionOptions}});Object.defineProperty(b,"NullLogger",{enumerable:!0,get:function(){return Oe.NullLogger}});Object.defineProperty(b,"createMessageConnection",{enumerable:!0,get:function(){return Oe.createMessageConnection}});Object.defineProperty(b,"ProgressToken",{enumerable:!0,get:function(){return Oe.ProgressToken}});Object.defineProperty(b,"ProgressType",{enumerable:!0,get:function(){return Oe.ProgressType}});Object.defineProperty(b,"Trace",{enumerable:!0,get:function(){return Oe.Trace}});Object.defineProperty(b,"TraceValues",{enumerable:!0,get:function(){return Oe.TraceValues}});Object.defineProperty(b,"TraceFormat",{enumerable:!0,get:function(){return Oe.TraceFormat}});Object.defineProperty(b,"SetTraceNotification",{enumerable:!0,get:function(){return Oe.SetTraceNotification}});Object.defineProperty(b,"LogTraceNotification",{enumerable:!0,get:function(){return Oe.LogTraceNotification}});Object.defineProperty(b,"ConnectionErrors",{enumerable:!0,get:function(){return Oe.ConnectionErrors}});Object.defineProperty(b,"ConnectionError",{enumerable:!0,get:function(){return Oe.ConnectionError}});Object.defineProperty(b,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Oe.CancellationReceiverStrategy}});Object.defineProperty(b,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Oe.CancellationSenderStrategy}});Object.defineProperty(b,"CancellationStrategy",{enumerable:!0,get:function(){return Oe.CancellationStrategy}});Object.defineProperty(b,"MessageStrategy",{enumerable:!0,get:function(){return Oe.MessageStrategy}});var wh=Gt();b.RAL=wh.default});var Bc=M(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});var zc=require("util"),Mt=_i(),bi=class t extends Mt.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return t.emptyBuffer}fromString(e,r){return Buffer.from(e,r)}toString(e,r){return e instanceof Buffer?e.toString(r):new zc.TextDecoder(r).decode(e)}asNative(e,r){return r===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,r):Buffer.from(e,0,r)}allocNative(e){return Buffer.allocUnsafe(e)}};bi.emptyBuffer=Buffer.allocUnsafe(0);var ko=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Mt.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Mt.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Mt.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),Mt.Disposable.create(()=>this.stream.off("data",e))}},So=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Mt.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Mt.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Mt.Disposable.create(()=>this.stream.off("end",e))}write(e,r){return new Promise((n,i)=>{let s=d=>{d==null?n():i(d)};typeof e=="string"?this.stream.write(e,r,s):this.stream.write(e,s)})}end(){this.stream.end()}},Uc=Object.freeze({messageBuffer:Object.freeze({create:t=>new bi(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(r){return Promise.reject(r)}}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new zc.TextDecoder(e.charset).decode(t)))}catch(r){return Promise.reject(r)}}})}),stream:Object.freeze({asReadableStream:t=>new ko(t),asWritableStream:t=>new So(t)}),console,timer:Object.freeze({setTimeout(t,e,...r){let n=setTimeout(t,e,...r);return{dispose:()=>clearTimeout(n)}},setImmediate(t,...e){let r=setImmediate(t,...e);return{dispose:()=>clearImmediate(r)}},setInterval(t,e,...r){let n=setInterval(t,e,...r);return{dispose:()=>clearInterval(n)}}})});function Co(){return Uc}(function(t){function e(){Mt.RAL.install(Uc)}t.install=e})(Co||(Co={}));Po.default=Co});var No=M(re=>{"use strict";var Th=re&&re.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Rh=re&&re.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Th(e,t,r)};Object.defineProperty(re,"__esModule",{value:!0});re.createMessageConnection=re.createServerSocketTransport=re.createClientSocketTransport=re.createServerPipeTransport=re.createClientPipeTransport=re.generateRandomPipeName=re.StreamMessageWriter=re.StreamMessageReader=re.SocketMessageWriter=re.SocketMessageReader=re.PortMessageWriter=re.PortMessageReader=re.IPCMessageWriter=re.IPCMessageReader=void 0;var an=Bc();an.default.install();var Hc=require("path"),kh=require("os"),Sh=require("crypto"),Ri=require("net"),rt=_i();Rh(_i(),re);var xo=class extends rt.AbstractMessageReader{constructor(e){super(),this.process=e;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),rt.Disposable.create(()=>this.process.off("message",e))}};re.IPCMessageReader=xo;var Do=class extends rt.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,r=>{r?(this.errorCount++,this.handleError(r,e)):this.errorCount=0}),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};re.IPCMessageWriter=Do;var Eo=class extends rt.AbstractMessageReader{constructor(e){super(),this.onData=new rt.Emitter,e.on("close",()=>this.fireClose),e.on("error",r=>this.fireError(r)),e.on("message",r=>{this.onData.fire(r)})}listen(e){return this.onData.event(e)}};re.PortMessageReader=Eo;var Oo=class extends rt.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",r=>this.fireError(r))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};re.PortMessageWriter=Oo;var fr=class extends rt.ReadableStreamMessageReader{constructor(e,r="utf-8"){super((0,an.default)().stream.asReadableStream(e),r)}};re.SocketMessageReader=fr;var hr=class extends rt.WriteableStreamMessageWriter{constructor(e,r){super((0,an.default)().stream.asWritableStream(e),r),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};re.SocketMessageWriter=hr;var wi=class extends rt.ReadableStreamMessageReader{constructor(e,r){super((0,an.default)().stream.asReadableStream(e),r)}};re.StreamMessageReader=wi;var Ti=class extends rt.WriteableStreamMessageWriter{constructor(e,r){super((0,an.default)().stream.asWritableStream(e),r)}};re.StreamMessageWriter=Ti;var Zc=process.env.XDG_RUNTIME_DIR,Ch=new Map([["linux",107],["darwin",103]]);function Ph(){let t=(0,Sh.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;Zc?e=Hc.join(Zc,`vscode-ipc-${t}.sock`):e=Hc.join(kh.tmpdir(),`vscode-${t}.sock`);let r=Ch.get(process.platform);return r!==void 0&&e.length>r&&(0,an.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${r} characters.`),e}re.generateRandomPipeName=Ph;function xh(t,e="utf-8"){let r,n=new Promise((i,s)=>{r=i});return new Promise((i,s)=>{let d=(0,Ri.createServer)(h=>{d.close(),r([new fr(h,e),new hr(h,e)])});d.on("error",s),d.listen(t,()=>{d.removeListener("error",s),i({onConnected:()=>n})})})}re.createClientPipeTransport=xh;function Dh(t,e="utf-8"){let r=(0,Ri.createConnection)(t);return[new fr(r,e),new hr(r,e)]}re.createServerPipeTransport=Dh;function Eh(t,e="utf-8"){let r,n=new Promise((i,s)=>{r=i});return new Promise((i,s)=>{let d=(0,Ri.createServer)(h=>{d.close(),r([new fr(h,e),new hr(h,e)])});d.on("error",s),d.listen(t,"127.0.0.1",()=>{d.removeListener("error",s),i({onConnected:()=>n})})})}re.createClientSocketTransport=Eh;function Oh(t,e="utf-8"){let r=(0,Ri.createConnection)(t,"127.0.0.1");return[new fr(r,e),new hr(r,e)]}re.createServerSocketTransport=Oh;function Nh(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function Mh(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function jh(t,e,r,n){r||(r=rt.NullLogger);let i=Nh(t)?new wi(t):t,s=Mh(e)?new Ti(e):e;return rt.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,rt.createMessageConnection)(i,s,r,n)}re.createMessageConnection=jh});var Gc=M((Cg,Jc)=>{"use strict";Jc.exports=No()});var cn=M(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.stringArray=Fe.array=Fe.func=Fe.error=Fe.number=Fe.string=Fe.boolean=void 0;function qh(t){return t===!0||t===!1}Fe.boolean=qh;function Qc(t){return typeof t=="string"||t instanceof String}Fe.string=Qc;function Ih(t){return typeof t=="number"||t instanceof Number}Fe.number=Ih;function Ah(t){return t instanceof Error}Fe.error=Ah;function Lh(t){return typeof t=="function"}Fe.func=Lh;function Xc(t){return Array.isArray(t)}Fe.array=Xc;function $h(t){return Xc(t)&&t.every(e=>Qc(e))}Fe.stringArray=$h});var na=M(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.Message=A.NotificationType9=A.NotificationType8=A.NotificationType7=A.NotificationType6=A.NotificationType5=A.NotificationType4=A.NotificationType3=A.NotificationType2=A.NotificationType1=A.NotificationType0=A.NotificationType=A.RequestType9=A.RequestType8=A.RequestType7=A.RequestType6=A.RequestType5=A.RequestType4=A.RequestType3=A.RequestType2=A.RequestType1=A.RequestType=A.RequestType0=A.AbstractMessageSignature=A.ParameterStructures=A.ResponseError=A.ErrorCodes=void 0;var pr=cn(),Mo;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(Mo||(A.ErrorCodes=Mo={}));var jo=class t extends Error{constructor(e,r,n){super(r),this.code=pr.number(e)?e:Mo.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};A.ResponseError=jo;var Je=class t{constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};A.ParameterStructures=Je;Je.auto=new Je("auto");Je.byPosition=new Je("byPosition");Je.byName=new Je("byName");var ge=class{constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return Je.auto}};A.AbstractMessageSignature=ge;var qo=class extends ge{constructor(e){super(e,0)}};A.RequestType0=qo;var Io=class extends ge{constructor(e,r=Je.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};A.RequestType=Io;var Ao=class extends ge{constructor(e,r=Je.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};A.RequestType1=Ao;var Lo=class extends ge{constructor(e){super(e,2)}};A.RequestType2=Lo;var $o=class extends ge{constructor(e){super(e,3)}};A.RequestType3=$o;var Fo=class extends ge{constructor(e){super(e,4)}};A.RequestType4=Fo;var Wo=class extends ge{constructor(e){super(e,5)}};A.RequestType5=Wo;var Vo=class extends ge{constructor(e){super(e,6)}};A.RequestType6=Vo;var zo=class extends ge{constructor(e){super(e,7)}};A.RequestType7=zo;var Uo=class extends ge{constructor(e){super(e,8)}};A.RequestType8=Uo;var Bo=class extends ge{constructor(e){super(e,9)}};A.RequestType9=Bo;var Ho=class extends ge{constructor(e,r=Je.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};A.NotificationType=Ho;var Zo=class extends ge{constructor(e){super(e,0)}};A.NotificationType0=Zo;var Jo=class extends ge{constructor(e,r=Je.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};A.NotificationType1=Jo;var Go=class extends ge{constructor(e){super(e,2)}};A.NotificationType2=Go;var Qo=class extends ge{constructor(e){super(e,3)}};A.NotificationType3=Qo;var Xo=class extends ge{constructor(e){super(e,4)}};A.NotificationType4=Xo;var Yo=class extends ge{constructor(e){super(e,5)}};A.NotificationType5=Yo;var Ko=class extends ge{constructor(e){super(e,6)}};A.NotificationType6=Ko;var ea=class extends ge{constructor(e){super(e,7)}};A.NotificationType7=ea;var ta=class extends ge{constructor(e){super(e,8)}};A.NotificationType8=ta;var ra=class extends ge{constructor(e){super(e,9)}};A.NotificationType9=ra;var Yc;(function(t){function e(i){let s=i;return s&&pr.string(s.method)&&(pr.string(s.id)||pr.number(s.id))}t.isRequest=e;function r(i){let s=i;return s&&pr.string(s.method)&&i.id===void 0}t.isNotification=r;function n(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&(pr.string(s.id)||pr.number(s.id)||s.id===null)}t.isResponse=n})(Yc||(A.Message=Yc={}))});var sa=M(Yt=>{"use strict";var Kc;Object.defineProperty(Yt,"__esModule",{value:!0});Yt.LRUCache=Yt.LinkedMap=Yt.Touch=void 0;var We;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(We||(Yt.Touch=We={}));var ki=class{constructor(){this[Kc]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,r=We.None){let n=this._map.get(e);if(n)return r!==We.None&&this.touch(n,r),n.value}set(e,r,n=We.None){let i=this._map.get(e);if(i)i.value=r,n!==We.None&&this.touch(i,n);else{switch(i={key:e,value:r,next:void 0,previous:void 0},n){case We.None:this.addItemLast(i);break;case We.First:this.addItemFirst(i);break;case We.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,i=this._head;for(;i;){if(r?e.bind(r)(i.value,i.key,this):e(i.value,i.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.key,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}values(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.value,done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}entries(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:[r.key,r.value],done:!1};return r=r.next,i}else return{value:void 0,done:!0}}};return n}[(Kc=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==We.First&&r!==We.Last)){if(r===We.First){if(e===this._head)return;let n=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(n.previous=i,i.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===We.Last){if(e===this._tail)return;let n=e.next,i=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=i,i.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};Yt.LinkedMap=ki;var ia=class extends ki{constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,r=We.AsNew){return super.get(e,r)}peek(e){return super.get(e,We.None)}set(e,r){return super.set(e,r,We.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};Yt.LRUCache=ia});var tu=M(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.Disposable=void 0;var eu;(function(t){function e(r){return{dispose:r}}t.create=e})(eu||(Si.Disposable=eu={}))});var Kt=M(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});var oa;function aa(){if(oa===void 0)throw new Error("No runtime abstraction layer installed");return oa}(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");oa=r}t.install=e})(aa||(aa={}));ca.default=aa});var dn=M(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.Emitter=un.Event=void 0;var Fh=Kt(),ru;(function(t){let e={dispose(){}};t.None=function(){return e}})(ru||(un.Event=ru={}));var ua=class{add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,r)})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let i=0,s=this._callbacks.length;i<s;i++)if(this._callbacks[i]===e)if(this._contexts[i]===r){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else n=!0;if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let r=[],n=this._callbacks.slice(0),i=this._contexts.slice(0);for(let s=0,d=n.length;s<d;s++)try{r.push(n[s].apply(i[s],e))}catch(h){(0,Fh.default)().console.error(h)}return r}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Ci=class t{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,r,n)=>{this._callbacks||(this._callbacks=new ua),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,r),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};un.Emitter=Ci;Ci._noop=function(){}});var Di=M(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.CancellationTokenSource=ln.CancellationToken=void 0;var Wh=Kt(),Vh=cn(),da=dn(),Pi;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:da.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:da.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||Vh.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.is=e})(Pi||(ln.CancellationToken=Pi={}));var zh=Object.freeze(function(t,e){let r=(0,Wh.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),xi=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?zh:(this._emitter||(this._emitter=new da.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},la=class{get token(){return this._token||(this._token=new xi),this._token}cancel(){this._token?this._token.cancel():this._token=Pi.Cancelled}dispose(){this._token?this._token instanceof xi&&this._token.dispose():this._token=Pi.None}};ln.CancellationTokenSource=la});var nu=M(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.SharedArrayReceiverStrategy=fn.SharedArraySenderStrategy=void 0;var Uh=Di(),zn;(function(t){t.Continue=0,t.Cancelled=1})(zn||(zn={}));var fa=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let r=new SharedArrayBuffer(4),n=new Int32Array(r,0,1);n[0]=zn.Continue,this.buffers.set(e.id,r),e.$cancellationData=r}async sendCancellation(e,r){let n=this.buffers.get(r);if(n===void 0)return;let i=new Int32Array(n,0,1);Atomics.store(i,0,zn.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};fn.SharedArraySenderStrategy=fa;var ha=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===zn.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},pa=class{constructor(e){this.token=new ha(e)}cancel(){}dispose(){}},ma=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new Uh.CancellationTokenSource:new pa(r)}};fn.SharedArrayReceiverStrategy=ma});var ya=M(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.Semaphore=void 0;var Bh=Kt(),ga=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((r,n)=>{this._waiting.push({thunk:e,resolve:r,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,Bh.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let r=e.thunk();r instanceof Promise?r.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(r),this.runNext())}catch(r){this._active--,e.reject(r),this.runNext()}}};Ei.Semaphore=ga});var su=M(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.ReadableStreamMessageReader=er.AbstractMessageReader=er.MessageReader=void 0;var _a=Kt(),hn=cn(),va=dn(),Hh=ya(),iu;(function(t){function e(r){let n=r;return n&&hn.func(n.listen)&&hn.func(n.dispose)&&hn.func(n.onError)&&hn.func(n.onClose)&&hn.func(n.onPartialMessage)}t.is=e})(iu||(er.MessageReader=iu={}));var Oi=class{constructor(){this.errorEmitter=new va.Emitter,this.closeEmitter=new va.Emitter,this.partialMessageEmitter=new va.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${hn.string(e.message)?e.message:"unknown"}`)}};er.AbstractMessageReader=Oi;var ba;(function(t){function e(r){let n,i,s,d=new Map,h,R=new Map;if(r===void 0||typeof r=="string")n=r??"utf-8";else{if(n=r.charset??"utf-8",r.contentDecoder!==void 0&&(s=r.contentDecoder,d.set(s.name,s)),r.contentDecoders!==void 0)for(let T of r.contentDecoders)d.set(T.name,T);if(r.contentTypeDecoder!==void 0&&(h=r.contentTypeDecoder,R.set(h.name,h)),r.contentTypeDecoders!==void 0)for(let T of r.contentTypeDecoders)R.set(T.name,T)}return h===void 0&&(h=(0,_a.default)().applicationJson.decoder,R.set(h.name,h)),{charset:n,contentDecoder:s,contentDecoders:d,contentTypeDecoder:h,contentTypeDecoders:R}}t.fromOptions=e})(ba||(ba={}));var wa=class extends Oi{constructor(e,r){super(),this.readable=e,this.options=ba.fromOptions(r),this.buffer=(0,_a.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new Hh.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let r=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders(!0);if(!n)return;let i=n.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
33
33
  ${JSON.stringify(Object.fromEntries(n))}`));return}let s=parseInt(i);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=s}let r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let n=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(r):r,i=await this.options.contentTypeDecoder.decode(n,this.options);this.callback(i)}).catch(n=>{this.fireError(n)})}}catch(r){this.fireError(r)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,_a.default)().timer.setTimeout((e,r)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:r}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};er.ReadableStreamMessageReader=wa});var du=M(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.WriteableStreamMessageWriter=tr.AbstractMessageWriter=tr.MessageWriter=void 0;var ou=Kt(),Un=cn(),Zh=ya(),au=dn(),Jh="Content-Length: ",cu=`\r
34
34
  `,uu;(function(t){function e(r){let n=r;return n&&Un.func(n.dispose)&&Un.func(n.onClose)&&Un.func(n.onError)&&Un.func(n.write)}t.is=e})(uu||(tr.MessageWriter=uu={}));var Ni=class{constructor(){this.errorEmitter=new au.Emitter,this.closeEmitter=new au.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,r,n){this.errorEmitter.fire([this.asError(e),r,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${Un.string(e.message)?e.message:"unknown"}`)}};tr.AbstractMessageWriter=Ni;var Ta;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,ou.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,ou.default)().applicationJson.encoder}}t.fromOptions=e})(Ta||(Ta={}));var Ra=class extends Ni{constructor(e,r){super(),this.writable=e,this.options=Ta.fromOptions(r),this.errorCount=0,this.writeSemaphore=new Zh.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let i=[];return i.push(Jh,n.byteLength.toString(),cu),i.push(cu),this.doWrite(e,i,n)},n=>{throw this.fireError(n),n}))}async doWrite(e,r,n){try{return await this.writable.write(r.join(""),"ascii"),this.writable.write(n)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){this.writable.end()}};tr.WriteableStreamMessageWriter=Ra});var lu=M(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.AbstractMessageBuffer=void 0;var Gh=13,Qh=10,Xh=`\r
35
35
  `,ka=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let r=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let r=0,n=0,i=0,s=0;e:for(;n<this._chunks.length;){let T=this._chunks[n];for(i=0;i<T.length;){switch(T[i]){case Gh:switch(r){case 0:r=1;break;case 2:r=3;break;default:r=0}break;case Qh:switch(r){case 1:r=2;break;case 3:r=4,i++;break e;default:r=0}break;default:r=0}i++}s+=T.byteLength,n++}if(r!==4)return;let d=this._read(s+i),h=new Map,R=this.toString(d,"ascii").split(Xh);if(R.length<2)return h;for(let T=0;T<R.length-2;T++){let P=R[T],Z=P.indexOf(":");if(Z===-1)throw new Error(`Message header must separate key and value using ':'
36
- ${P}`);let se=P.substr(0,Z),ce=P.substr(Z+1).trim();h.set(e?se.toLowerCase():se,ce)}return h}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],d=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,d}let r=this.allocNative(e),n=0,i=0;for(;e>0;){let s=this._chunks[i];if(s.byteLength>e){let d=s.slice(0,e);r.set(d,n),n+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e}else r.set(s,n),n+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return r}};Mi.AbstractMessageBuffer=ka});var gu=M(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.createMessageConnection=Q.ConnectionOptions=Q.MessageStrategy=Q.CancellationStrategy=Q.CancellationSenderStrategy=Q.CancellationReceiverStrategy=Q.RequestCancellationReceiverStrategy=Q.IdCancellationReceiverStrategy=Q.ConnectionStrategy=Q.ConnectionError=Q.ConnectionErrors=Q.LogTraceNotification=Q.SetTraceNotification=Q.TraceFormat=Q.TraceValues=Q.Trace=Q.NullLogger=Q.ProgressType=Q.ProgressToken=void 0;var fu=Kt(),ke=cn(),z=na(),hu=sa(),Bn=dn(),Sa=Di(),Jn;(function(t){t.type=new z.NotificationType("$/cancelRequest")})(Jn||(Jn={}));var Ca;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}t.is=e})(Ca||(Q.ProgressToken=Ca={}));var Hn;(function(t){t.type=new z.NotificationType("$/progress")})(Hn||(Hn={}));var Pa=class{constructor(){}};Q.ProgressType=Pa;var xa;(function(t){function e(r){return ke.func(r)}t.is=e})(xa||(xa={}));Q.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var ae;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(ae||(Q.Trace=ae={}));var pu;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(pu||(Q.TraceValues=pu={}));(function(t){function e(n){if(!ke.string(n))return t.Off;switch(n=n.toLowerCase(),n){case"off":return t.Off;case"messages":return t.Messages;case"compact":return t.Compact;case"verbose":return t.Verbose;default:return t.Off}}t.fromString=e;function r(n){switch(n){case t.Off:return"off";case t.Messages:return"messages";case t.Compact:return"compact";case t.Verbose:return"verbose";default:return"off"}}t.toString=r})(ae||(Q.Trace=ae={}));var nt;(function(t){t.Text="text",t.JSON="json"})(nt||(Q.TraceFormat=nt={}));(function(t){function e(r){return ke.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(nt||(Q.TraceFormat=nt={}));var Da;(function(t){t.type=new z.NotificationType("$/setTrace")})(Da||(Q.SetTraceNotification=Da={}));var ji;(function(t){t.type=new z.NotificationType("$/logTrace")})(ji||(Q.LogTraceNotification=ji={}));var Zn;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(Zn||(Q.ConnectionErrors=Zn={}));var pn=class t extends Error{constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};Q.ConnectionError=pn;var Ea;(function(t){function e(r){let n=r;return n&&ke.func(n.cancelUndispatched)}t.is=e})(Ea||(Q.ConnectionStrategy=Ea={}));var qi;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&ke.func(n.createCancellationTokenSource)&&(n.dispose===void 0||ke.func(n.dispose))}t.is=e})(qi||(Q.IdCancellationReceiverStrategy=qi={}));var Oa;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&ke.func(n.createCancellationTokenSource)&&(n.dispose===void 0||ke.func(n.dispose))}t.is=e})(Oa||(Q.RequestCancellationReceiverStrategy=Oa={}));var Ii;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new Sa.CancellationTokenSource}});function e(r){return qi.is(r)||Oa.is(r)}t.is=e})(Ii||(Q.CancellationReceiverStrategy=Ii={}));var Ai;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(Jn.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&ke.func(n.sendCancellation)&&ke.func(n.cleanup)}t.is=e})(Ai||(Q.CancellationSenderStrategy=Ai={}));var Li;(function(t){t.Message=Object.freeze({receiver:Ii.Message,sender:Ai.Message});function e(r){let n=r;return n&&Ii.is(n.receiver)&&Ai.is(n.sender)}t.is=e})(Li||(Q.CancellationStrategy=Li={}));var $i;(function(t){function e(r){let n=r;return n&&ke.func(n.handleMessage)}t.is=e})($i||(Q.MessageStrategy=$i={}));var mu;(function(t){function e(r){let n=r;return n&&(Li.is(n.cancellationStrategy)||Ea.is(n.connectionStrategy)||$i.is(n.messageStrategy))}t.is=e})(mu||(Q.ConnectionOptions=mu={}));var gt;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(gt||(gt={}));function Yh(t,e,r,n){let i=r!==void 0?r:Q.NullLogger,s=0,d=0,h=0,R="2.0",T,P=new Map,Z,se=new Map,ce=new Map,Ue,Se=new hu.LinkedMap,we=new Map,ue=new Set,de=new Map,O=ae.Off,le=nt.Text,$,ye=gt.New,ve=new Bn.Emitter,Be=new Bn.Emitter,_t=new Bn.Emitter,lt=new Bn.Emitter,ft=new Bn.Emitter,Te=n&&n.cancellationStrategy?n.cancellationStrategy:Li.Message;function Dt(o){if(o===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+o.toString()}function Ft(o){return o===null?"res-unknown-"+(++h).toString():"res-"+o.toString()}function Ir(){return"not-"+(++d).toString()}function In(o,f){z.Message.isRequest(f)?o.set(Dt(f.id),f):z.Message.isResponse(f)?o.set(Ft(f.id),f):o.set(Ir(),f)}function Ar(o){}function Wt(){return ye===gt.Listening}function bt(){return ye===gt.Closed}function je(){return ye===gt.Disposed}function Et(){(ye===gt.New||ye===gt.Listening)&&(ye=gt.Closed,Be.fire(void 0))}function Ot(o){ve.fire([o,void 0,void 0])}function Lr(o){ve.fire(o)}t.onClose(Et),t.onError(Ot),e.onClose(Et),e.onError(Lr);function Vt(){Ue||Se.size===0||(Ue=(0,fu.default)().timer.setImmediate(()=>{Ue=void 0,$r()}))}function zt(o){z.Message.isRequest(o)?Wr(o):z.Message.isNotification(o)?zr(o):z.Message.isResponse(o)?Vr(o):Ut(o)}function $r(){if(Se.size===0)return;let o=Se.shift();try{let f=n?.messageStrategy;$i.is(f)?f.handleMessage(o,zt):zt(o)}finally{Vt()}}let Fr=o=>{try{if(z.Message.isNotification(o)&&o.method===Jn.type.method){let f=o.params.id,g=Dt(f),_=Se.get(g);if(z.Message.isRequest(_)){let q=n?.connectionStrategy,B=q&&q.cancelUndispatched?q.cancelUndispatched(_,Ar):void 0;if(B&&(B.error!==void 0||B.result!==void 0)){Se.delete(g),de.delete(f),B.id=_.id,st(B,o.method,Date.now()),e.write(B).catch(()=>i.error("Sending response for canceled message failed."));return}}let L=de.get(f);if(L!==void 0){L.cancel(),wt(o);return}else ue.add(f)}In(Se,o)}finally{Vt()}};function Wr(o){if(je())return;function f(D,F,N){let X={jsonrpc:R,id:o.id};D instanceof z.ResponseError?X.error=D.toJson():X.result=D===void 0?null:D,st(X,F,N),e.write(X).catch(()=>i.error("Sending response failed."))}function g(D,F,N){let X={jsonrpc:R,id:o.id,error:D.toJson()};st(X,F,N),e.write(X).catch(()=>i.error("Sending response failed."))}function _(D,F,N){D===void 0&&(D=null);let X={jsonrpc:R,id:o.id,result:D};st(X,F,N),e.write(X).catch(()=>i.error("Sending response failed."))}Hr(o);let L=P.get(o.method),q,B;L&&(q=L.type,B=L.handler);let H=Date.now();if(B||T){let D=o.id??String(Date.now()),F=qi.is(Te.receiver)?Te.receiver.createCancellationTokenSource(D):Te.receiver.createCancellationTokenSource(o);o.id!==null&&ue.has(o.id)&&F.cancel(),o.id!==null&&de.set(D,F);try{let N;if(B)if(o.params===void 0){if(q!==void 0&&q.numberOfParams!==0){g(new z.ResponseError(z.ErrorCodes.InvalidParams,`Request ${o.method} defines ${q.numberOfParams} params but received none.`),o.method,H);return}N=B(F.token)}else if(Array.isArray(o.params)){if(q!==void 0&&q.parameterStructures===z.ParameterStructures.byName){g(new z.ResponseError(z.ErrorCodes.InvalidParams,`Request ${o.method} defines parameters by name but received parameters by position`),o.method,H);return}N=B(...o.params,F.token)}else{if(q!==void 0&&q.parameterStructures===z.ParameterStructures.byPosition){g(new z.ResponseError(z.ErrorCodes.InvalidParams,`Request ${o.method} defines parameters by position but received parameters by name`),o.method,H);return}N=B(o.params,F.token)}else T&&(N=T(o.method,o.params,F.token));let X=N;N?X.then?X.then(ie=>{de.delete(D),f(ie,o.method,H)},ie=>{de.delete(D),ie instanceof z.ResponseError?g(ie,o.method,H):ie&&ke.string(ie.message)?g(new z.ResponseError(z.ErrorCodes.InternalError,`Request ${o.method} failed with message: ${ie.message}`),o.method,H):g(new z.ResponseError(z.ErrorCodes.InternalError,`Request ${o.method} failed unexpectedly without providing any details.`),o.method,H)}):(de.delete(D),f(N,o.method,H)):(de.delete(D),_(N,o.method,H))}catch(N){de.delete(D),N instanceof z.ResponseError?f(N,o.method,H):N&&ke.string(N.message)?g(new z.ResponseError(z.ErrorCodes.InternalError,`Request ${o.method} failed with message: ${N.message}`),o.method,H):g(new z.ResponseError(z.ErrorCodes.InternalError,`Request ${o.method} failed unexpectedly without providing any details.`),o.method,H)}}else g(new z.ResponseError(z.ErrorCodes.MethodNotFound,`Unhandled method ${o.method}`),o.method,H)}function Vr(o){if(!je())if(o.id===null)o.error?i.error(`Received response message without id: Error is:
36
+ ${P}`);let se=P.substr(0,Z),ce=P.substr(Z+1).trim();h.set(e?se.toLowerCase():se,ce)}return h}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],d=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,d}let r=this.allocNative(e),n=0,i=0;for(;e>0;){let s=this._chunks[i];if(s.byteLength>e){let d=s.slice(0,e);r.set(d,n),n+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e}else r.set(s,n),n+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return r}};Mi.AbstractMessageBuffer=ka});var gu=M(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.createMessageConnection=Q.ConnectionOptions=Q.MessageStrategy=Q.CancellationStrategy=Q.CancellationSenderStrategy=Q.CancellationReceiverStrategy=Q.RequestCancellationReceiverStrategy=Q.IdCancellationReceiverStrategy=Q.ConnectionStrategy=Q.ConnectionError=Q.ConnectionErrors=Q.LogTraceNotification=Q.SetTraceNotification=Q.TraceFormat=Q.TraceValues=Q.Trace=Q.NullLogger=Q.ProgressType=Q.ProgressToken=void 0;var fu=Kt(),ke=cn(),z=na(),hu=sa(),Bn=dn(),Sa=Di(),Jn;(function(t){t.type=new z.NotificationType("$/cancelRequest")})(Jn||(Jn={}));var Ca;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}t.is=e})(Ca||(Q.ProgressToken=Ca={}));var Hn;(function(t){t.type=new z.NotificationType("$/progress")})(Hn||(Hn={}));var Pa=class{constructor(){}};Q.ProgressType=Pa;var xa;(function(t){function e(r){return ke.func(r)}t.is=e})(xa||(xa={}));Q.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var ae;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(ae||(Q.Trace=ae={}));var pu;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(pu||(Q.TraceValues=pu={}));(function(t){function e(n){if(!ke.string(n))return t.Off;switch(n=n.toLowerCase(),n){case"off":return t.Off;case"messages":return t.Messages;case"compact":return t.Compact;case"verbose":return t.Verbose;default:return t.Off}}t.fromString=e;function r(n){switch(n){case t.Off:return"off";case t.Messages:return"messages";case t.Compact:return"compact";case t.Verbose:return"verbose";default:return"off"}}t.toString=r})(ae||(Q.Trace=ae={}));var nt;(function(t){t.Text="text",t.JSON="json"})(nt||(Q.TraceFormat=nt={}));(function(t){function e(r){return ke.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(nt||(Q.TraceFormat=nt={}));var Da;(function(t){t.type=new z.NotificationType("$/setTrace")})(Da||(Q.SetTraceNotification=Da={}));var ji;(function(t){t.type=new z.NotificationType("$/logTrace")})(ji||(Q.LogTraceNotification=ji={}));var Zn;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(Zn||(Q.ConnectionErrors=Zn={}));var pn=class t extends Error{constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};Q.ConnectionError=pn;var Ea;(function(t){function e(r){let n=r;return n&&ke.func(n.cancelUndispatched)}t.is=e})(Ea||(Q.ConnectionStrategy=Ea={}));var qi;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&ke.func(n.createCancellationTokenSource)&&(n.dispose===void 0||ke.func(n.dispose))}t.is=e})(qi||(Q.IdCancellationReceiverStrategy=qi={}));var Oa;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&ke.func(n.createCancellationTokenSource)&&(n.dispose===void 0||ke.func(n.dispose))}t.is=e})(Oa||(Q.RequestCancellationReceiverStrategy=Oa={}));var Ii;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new Sa.CancellationTokenSource}});function e(r){return qi.is(r)||Oa.is(r)}t.is=e})(Ii||(Q.CancellationReceiverStrategy=Ii={}));var Ai;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(Jn.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&ke.func(n.sendCancellation)&&ke.func(n.cleanup)}t.is=e})(Ai||(Q.CancellationSenderStrategy=Ai={}));var Li;(function(t){t.Message=Object.freeze({receiver:Ii.Message,sender:Ai.Message});function e(r){let n=r;return n&&Ii.is(n.receiver)&&Ai.is(n.sender)}t.is=e})(Li||(Q.CancellationStrategy=Li={}));var $i;(function(t){function e(r){let n=r;return n&&ke.func(n.handleMessage)}t.is=e})($i||(Q.MessageStrategy=$i={}));var mu;(function(t){function e(r){let n=r;return n&&(Li.is(n.cancellationStrategy)||Ea.is(n.connectionStrategy)||$i.is(n.messageStrategy))}t.is=e})(mu||(Q.ConnectionOptions=mu={}));var gt;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(gt||(gt={}));function Yh(t,e,r,n){let i=r!==void 0?r:Q.NullLogger,s=0,d=0,h=0,R="2.0",T,P=new Map,Z,se=new Map,ce=new Map,Ue,Se=new hu.LinkedMap,we=new Map,ue=new Set,de=new Map,O=ae.Off,pe=nt.Text,$,ye=gt.New,ve=new Bn.Emitter,Be=new Bn.Emitter,_t=new Bn.Emitter,lt=new Bn.Emitter,ft=new Bn.Emitter,Te=n&&n.cancellationStrategy?n.cancellationStrategy:Li.Message;function Dt(o){if(o===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+o.toString()}function Ft(o){return o===null?"res-unknown-"+(++h).toString():"res-"+o.toString()}function Ir(){return"not-"+(++d).toString()}function In(o,f){z.Message.isRequest(f)?o.set(Dt(f.id),f):z.Message.isResponse(f)?o.set(Ft(f.id),f):o.set(Ir(),f)}function Ar(o){}function Wt(){return ye===gt.Listening}function bt(){return ye===gt.Closed}function je(){return ye===gt.Disposed}function Et(){(ye===gt.New||ye===gt.Listening)&&(ye=gt.Closed,Be.fire(void 0))}function Ot(o){ve.fire([o,void 0,void 0])}function Lr(o){ve.fire(o)}t.onClose(Et),t.onError(Ot),e.onClose(Et),e.onError(Lr);function Vt(){Ue||Se.size===0||(Ue=(0,fu.default)().timer.setImmediate(()=>{Ue=void 0,$r()}))}function zt(o){z.Message.isRequest(o)?Wr(o):z.Message.isNotification(o)?zr(o):z.Message.isResponse(o)?Vr(o):Ut(o)}function $r(){if(Se.size===0)return;let o=Se.shift();try{let f=n?.messageStrategy;$i.is(f)?f.handleMessage(o,zt):zt(o)}finally{Vt()}}let Fr=o=>{try{if(z.Message.isNotification(o)&&o.method===Jn.type.method){let f=o.params.id,g=Dt(f),_=Se.get(g);if(z.Message.isRequest(_)){let q=n?.connectionStrategy,B=q&&q.cancelUndispatched?q.cancelUndispatched(_,Ar):void 0;if(B&&(B.error!==void 0||B.result!==void 0)){Se.delete(g),de.delete(f),B.id=_.id,st(B,o.method,Date.now()),e.write(B).catch(()=>i.error("Sending response for canceled message failed."));return}}let L=de.get(f);if(L!==void 0){L.cancel(),wt(o);return}else ue.add(f)}In(Se,o)}finally{Vt()}};function Wr(o){if(je())return;function f(D,F,N){let X={jsonrpc:R,id:o.id};D instanceof z.ResponseError?X.error=D.toJson():X.result=D===void 0?null:D,st(X,F,N),e.write(X).catch(()=>i.error("Sending response failed."))}function g(D,F,N){let X={jsonrpc:R,id:o.id,error:D.toJson()};st(X,F,N),e.write(X).catch(()=>i.error("Sending response failed."))}function _(D,F,N){D===void 0&&(D=null);let X={jsonrpc:R,id:o.id,result:D};st(X,F,N),e.write(X).catch(()=>i.error("Sending response failed."))}Hr(o);let L=P.get(o.method),q,B;L&&(q=L.type,B=L.handler);let H=Date.now();if(B||T){let D=o.id??String(Date.now()),F=qi.is(Te.receiver)?Te.receiver.createCancellationTokenSource(D):Te.receiver.createCancellationTokenSource(o);o.id!==null&&ue.has(o.id)&&F.cancel(),o.id!==null&&de.set(D,F);try{let N;if(B)if(o.params===void 0){if(q!==void 0&&q.numberOfParams!==0){g(new z.ResponseError(z.ErrorCodes.InvalidParams,`Request ${o.method} defines ${q.numberOfParams} params but received none.`),o.method,H);return}N=B(F.token)}else if(Array.isArray(o.params)){if(q!==void 0&&q.parameterStructures===z.ParameterStructures.byName){g(new z.ResponseError(z.ErrorCodes.InvalidParams,`Request ${o.method} defines parameters by name but received parameters by position`),o.method,H);return}N=B(...o.params,F.token)}else{if(q!==void 0&&q.parameterStructures===z.ParameterStructures.byPosition){g(new z.ResponseError(z.ErrorCodes.InvalidParams,`Request ${o.method} defines parameters by position but received parameters by name`),o.method,H);return}N=B(o.params,F.token)}else T&&(N=T(o.method,o.params,F.token));let X=N;N?X.then?X.then(ie=>{de.delete(D),f(ie,o.method,H)},ie=>{de.delete(D),ie instanceof z.ResponseError?g(ie,o.method,H):ie&&ke.string(ie.message)?g(new z.ResponseError(z.ErrorCodes.InternalError,`Request ${o.method} failed with message: ${ie.message}`),o.method,H):g(new z.ResponseError(z.ErrorCodes.InternalError,`Request ${o.method} failed unexpectedly without providing any details.`),o.method,H)}):(de.delete(D),f(N,o.method,H)):(de.delete(D),_(N,o.method,H))}catch(N){de.delete(D),N instanceof z.ResponseError?f(N,o.method,H):N&&ke.string(N.message)?g(new z.ResponseError(z.ErrorCodes.InternalError,`Request ${o.method} failed with message: ${N.message}`),o.method,H):g(new z.ResponseError(z.ErrorCodes.InternalError,`Request ${o.method} failed unexpectedly without providing any details.`),o.method,H)}}else g(new z.ResponseError(z.ErrorCodes.MethodNotFound,`Unhandled method ${o.method}`),o.method,H)}function Vr(o){if(!je())if(o.id===null)o.error?i.error(`Received response message without id: Error is:
37
37
  ${JSON.stringify(o.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let f=o.id,g=we.get(f);if(Zr(o,g),g!==void 0){we.delete(f);try{if(o.error){let _=o.error;g.reject(new z.ResponseError(_.code,_.message,_.data))}else if(o.result!==void 0)g.resolve(o.result);else throw new Error("Should never happen.")}catch(_){_.message?i.error(`Response handler '${g.method}' failed with message: ${_.message}`):i.error(`Response handler '${g.method}' failed unexpectedly.`)}}}}function zr(o){if(je())return;let f,g;if(o.method===Jn.type.method){let _=o.params.id;ue.delete(_),wt(o);return}else{let _=se.get(o.method);_&&(g=_.handler,f=_.type)}if(g||Z)try{if(wt(o),g)if(o.params===void 0)f!==void 0&&f.numberOfParams!==0&&f.parameterStructures!==z.ParameterStructures.byName&&i.error(`Notification ${o.method} defines ${f.numberOfParams} params but received none.`),g();else if(Array.isArray(o.params)){let _=o.params;o.method===Hn.type.method&&_.length===2&&Ca.is(_[0])?g({token:_[0],value:_[1]}):(f!==void 0&&(f.parameterStructures===z.ParameterStructures.byName&&i.error(`Notification ${o.method} defines parameters by name but received parameters by position`),f.numberOfParams!==o.params.length&&i.error(`Notification ${o.method} defines ${f.numberOfParams} params but received ${_.length} arguments`)),g(..._))}else f!==void 0&&f.parameterStructures===z.ParameterStructures.byPosition&&i.error(`Notification ${o.method} defines parameters by position but received parameters by name`),g(o.params);else Z&&Z(o.method,o.params)}catch(_){_.message?i.error(`Notification handler '${o.method}' failed with message: ${_.message}`):i.error(`Notification handler '${o.method}' failed unexpectedly.`)}else _t.fire(o)}function Ut(o){if(!o){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
38
- ${JSON.stringify(o,null,4)}`);let f=o;if(ke.string(f.id)||ke.number(f.id)){let g=f.id,_=we.get(g);_&&_.reject(new Error("The received response has neither a result nor an error property."))}}function xe(o){if(o!=null)switch(O){case ae.Verbose:return JSON.stringify(o,null,4);case ae.Compact:return JSON.stringify(o);default:return}}function Ur(o){if(!(O===ae.Off||!$))if(le===nt.Text){let f;(O===ae.Verbose||O===ae.Compact)&&o.params&&(f=`Params: ${xe(o.params)}
38
+ ${JSON.stringify(o,null,4)}`);let f=o;if(ke.string(f.id)||ke.number(f.id)){let g=f.id,_=we.get(g);_&&_.reject(new Error("The received response has neither a result nor an error property."))}}function xe(o){if(o!=null)switch(O){case ae.Verbose:return JSON.stringify(o,null,4);case ae.Compact:return JSON.stringify(o);default:return}}function Ur(o){if(!(O===ae.Off||!$))if(pe===nt.Text){let f;(O===ae.Verbose||O===ae.Compact)&&o.params&&(f=`Params: ${xe(o.params)}
39
39
 
40
- `),$.log(`Sending request '${o.method} - (${o.id})'.`,f)}else qe("send-request",o)}function Br(o){if(!(O===ae.Off||!$))if(le===nt.Text){let f;(O===ae.Verbose||O===ae.Compact)&&(o.params?f=`Params: ${xe(o.params)}
40
+ `),$.log(`Sending request '${o.method} - (${o.id})'.`,f)}else qe("send-request",o)}function Br(o){if(!(O===ae.Off||!$))if(pe===nt.Text){let f;(O===ae.Verbose||O===ae.Compact)&&(o.params?f=`Params: ${xe(o.params)}
41
41
 
42
42
  `:f=`No parameters provided.
43
43
 
44
- `),$.log(`Sending notification '${o.method}'.`,f)}else qe("send-notification",o)}function st(o,f,g){if(!(O===ae.Off||!$))if(le===nt.Text){let _;(O===ae.Verbose||O===ae.Compact)&&(o.error&&o.error.data?_=`Error data: ${xe(o.error.data)}
44
+ `),$.log(`Sending notification '${o.method}'.`,f)}else qe("send-notification",o)}function st(o,f,g){if(!(O===ae.Off||!$))if(pe===nt.Text){let _;(O===ae.Verbose||O===ae.Compact)&&(o.error&&o.error.data?_=`Error data: ${xe(o.error.data)}
45
45
 
46
46
  `:o.result?_=`Result: ${xe(o.result)}
47
47
 
48
48
  `:o.error===void 0&&(_=`No result returned.
49
49
 
50
- `)),$.log(`Sending response '${f} - (${o.id})'. Processing request took ${Date.now()-g}ms`,_)}else qe("send-response",o)}function Hr(o){if(!(O===ae.Off||!$))if(le===nt.Text){let f;(O===ae.Verbose||O===ae.Compact)&&o.params&&(f=`Params: ${xe(o.params)}
50
+ `)),$.log(`Sending response '${f} - (${o.id})'. Processing request took ${Date.now()-g}ms`,_)}else qe("send-response",o)}function Hr(o){if(!(O===ae.Off||!$))if(pe===nt.Text){let f;(O===ae.Verbose||O===ae.Compact)&&o.params&&(f=`Params: ${xe(o.params)}
51
51
 
52
- `),$.log(`Received request '${o.method} - (${o.id})'.`,f)}else qe("receive-request",o)}function wt(o){if(!(O===ae.Off||!$||o.method===ji.type.method))if(le===nt.Text){let f;(O===ae.Verbose||O===ae.Compact)&&(o.params?f=`Params: ${xe(o.params)}
52
+ `),$.log(`Received request '${o.method} - (${o.id})'.`,f)}else qe("receive-request",o)}function wt(o){if(!(O===ae.Off||!$||o.method===ji.type.method))if(pe===nt.Text){let f;(O===ae.Verbose||O===ae.Compact)&&(o.params?f=`Params: ${xe(o.params)}
53
53
 
54
54
  `:f=`No parameters provided.
55
55
 
56
- `),$.log(`Received notification '${o.method}'.`,f)}else qe("receive-notification",o)}function Zr(o,f){if(!(O===ae.Off||!$))if(le===nt.Text){let g;if((O===ae.Verbose||O===ae.Compact)&&(o.error&&o.error.data?g=`Error data: ${xe(o.error.data)}
56
+ `),$.log(`Received notification '${o.method}'.`,f)}else qe("receive-notification",o)}function Zr(o,f){if(!(O===ae.Off||!$))if(pe===nt.Text){let g;if((O===ae.Verbose||O===ae.Compact)&&(o.error&&o.error.data?g=`Error data: ${xe(o.error.data)}
57
57
 
58
58
  `:o.result?g=`Result: ${xe(o.result)}
59
59
 
60
60
  `:o.error===void 0&&(g=`No result returned.
61
61
 
62
- `)),f){let _=o.error?` Request failed: ${o.error.message} (${o.error.code}).`:"";$.log(`Received response '${f.method} - (${o.id})' in ${Date.now()-f.timerStart}ms.${_}`,g)}else $.log(`Received response ${o.id} without active response promise.`,g)}else qe("receive-response",o)}function qe(o,f){if(!$||O===ae.Off)return;let g={isLSPMessage:!0,type:o,message:f,timestamp:Date.now()};$.log(g)}function He(){if(bt())throw new pn(Zn.Closed,"Connection is closed.");if(je())throw new pn(Zn.Disposed,"Connection is disposed.")}function Jr(){if(Wt())throw new pn(Zn.AlreadyListening,"Connection is already listening")}function Gr(){if(!Wt())throw new Error("Call listen() first.")}function Ie(o){return o===void 0?null:o}function Bt(o){if(o!==null)return o}function Ht(o){return o!=null&&!Array.isArray(o)&&typeof o=="object"}function Tt(o,f){switch(o){case z.ParameterStructures.auto:return Ht(f)?Bt(f):[Ie(f)];case z.ParameterStructures.byName:if(!Ht(f))throw new Error("Received parameters by name but param is not an object literal.");return Bt(f);case z.ParameterStructures.byPosition:return[Ie(f)];default:throw new Error(`Unknown parameter structure ${o.toString()}`)}}function Zt(o,f){let g,_=o.numberOfParams;switch(_){case 0:g=void 0;break;case 1:g=Tt(o.parameterStructures,f[0]);break;default:g=[];for(let L=0;L<f.length&&L<_;L++)g.push(Ie(f[L]));if(f.length<_)for(let L=f.length;L<_;L++)g.push(null);break}return g}let Ae={sendNotification:(o,...f)=>{He();let g,_;if(ke.string(o)){g=o;let q=f[0],B=0,H=z.ParameterStructures.auto;z.ParameterStructures.is(q)&&(B=1,H=q);let D=f.length,F=D-B;switch(F){case 0:_=void 0;break;case 1:_=Tt(H,f[B]);break;default:if(H===z.ParameterStructures.byName)throw new Error(`Received ${F} parameters for 'by Name' notification parameter structure.`);_=f.slice(B,D).map(N=>Ie(N));break}}else{let q=f;g=o.method,_=Zt(o,q)}let L={jsonrpc:R,method:g,params:_};return Br(L),e.write(L).catch(q=>{throw i.error("Sending notification failed."),q})},onNotification:(o,f)=>{He();let g;return ke.func(o)?Z=o:f&&(ke.string(o)?(g=o,se.set(o,{type:void 0,handler:f})):(g=o.method,se.set(o.method,{type:o,handler:f}))),{dispose:()=>{g!==void 0?se.delete(g):Z=void 0}}},onProgress:(o,f,g)=>{if(ce.has(f))throw new Error(`Progress handler for token ${f} already registered`);return ce.set(f,g),{dispose:()=>{ce.delete(f)}}},sendProgress:(o,f,g)=>Ae.sendNotification(Hn.type,{token:f,value:g}),onUnhandledProgress:lt.event,sendRequest:(o,...f)=>{He(),Gr();let g,_,L;if(ke.string(o)){g=o;let D=f[0],F=f[f.length-1],N=0,X=z.ParameterStructures.auto;z.ParameterStructures.is(D)&&(N=1,X=D);let ie=f.length;Sa.CancellationToken.is(F)&&(ie=ie-1,L=F);let _e=ie-N;switch(_e){case 0:_=void 0;break;case 1:_=Tt(X,f[N]);break;default:if(X===z.ParameterStructures.byName)throw new Error(`Received ${_e} parameters for 'by Name' request parameter structure.`);_=f.slice(N,ie).map(Qr=>Ie(Qr));break}}else{let D=f;g=o.method,_=Zt(o,D);let F=o.numberOfParams;L=Sa.CancellationToken.is(D[F])?D[F]:void 0}let q=s++,B;L&&(B=L.onCancellationRequested(()=>{let D=Te.sender.sendCancellation(Ae,q);return D===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${q}`),Promise.resolve()):D.catch(()=>{i.log(`Sending cancellation messages for id ${q} failed`)})}));let H={jsonrpc:R,id:q,method:g,params:_};return Ur(H),typeof Te.sender.enableCancellation=="function"&&Te.sender.enableCancellation(H),new Promise(async(D,F)=>{let N=_e=>{D(_e),Te.sender.cleanup(q),B?.dispose()},X=_e=>{F(_e),Te.sender.cleanup(q),B?.dispose()},ie={method:g,timerStart:Date.now(),resolve:N,reject:X};try{await e.write(H),we.set(q,ie)}catch(_e){throw i.error("Sending request failed."),ie.reject(new z.ResponseError(z.ErrorCodes.MessageWriteError,_e.message?_e.message:"Unknown reason")),_e}})},onRequest:(o,f)=>{He();let g=null;return xa.is(o)?(g=void 0,T=o):ke.string(o)?(g=null,f!==void 0&&(g=o,P.set(o,{handler:f,type:void 0}))):f!==void 0&&(g=o.method,P.set(o.method,{type:o,handler:f})),{dispose:()=>{g!==null&&(g!==void 0?P.delete(g):T=void 0)}}},hasPendingResponse:()=>we.size>0,trace:async(o,f,g)=>{let _=!1,L=nt.Text;g!==void 0&&(ke.boolean(g)?_=g:(_=g.sendNotification||!1,L=g.traceFormat||nt.Text)),O=o,le=L,O===ae.Off?$=void 0:$=f,_&&!bt()&&!je()&&await Ae.sendNotification(Da.type,{value:ae.toString(o)})},onError:ve.event,onClose:Be.event,onUnhandledNotification:_t.event,onDispose:ft.event,end:()=>{e.end()},dispose:()=>{if(je())return;ye=gt.Disposed,ft.fire(void 0);let o=new z.ResponseError(z.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let f of we.values())f.reject(o);we=new Map,de=new Map,ue=new Set,Se=new hu.LinkedMap,ke.func(e.dispose)&&e.dispose(),ke.func(t.dispose)&&t.dispose()},listen:()=>{He(),Jr(),ye=gt.Listening,t.listen(Fr)},inspect:()=>{(0,fu.default)().console.log("inspect")}};return Ae.onNotification(ji.type,o=>{if(O===ae.Off||!$)return;let f=O===ae.Verbose||O===ae.Compact;$.log(o.message,f?o.verbose:void 0)}),Ae.onNotification(Hn.type,o=>{let f=ce.get(o.token);f?f(o.value):lt.fire(o)}),Ae}Q.createMessageConnection=Yh});var Fi=M(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.ProgressType=w.ProgressToken=w.createMessageConnection=w.NullLogger=w.ConnectionOptions=w.ConnectionStrategy=w.AbstractMessageBuffer=w.WriteableStreamMessageWriter=w.AbstractMessageWriter=w.MessageWriter=w.ReadableStreamMessageReader=w.AbstractMessageReader=w.MessageReader=w.SharedArrayReceiverStrategy=w.SharedArraySenderStrategy=w.CancellationToken=w.CancellationTokenSource=w.Emitter=w.Event=w.Disposable=w.LRUCache=w.Touch=w.LinkedMap=w.ParameterStructures=w.NotificationType9=w.NotificationType8=w.NotificationType7=w.NotificationType6=w.NotificationType5=w.NotificationType4=w.NotificationType3=w.NotificationType2=w.NotificationType1=w.NotificationType0=w.NotificationType=w.ErrorCodes=w.ResponseError=w.RequestType9=w.RequestType8=w.RequestType7=w.RequestType6=w.RequestType5=w.RequestType4=w.RequestType3=w.RequestType2=w.RequestType1=w.RequestType0=w.RequestType=w.Message=w.RAL=void 0;w.MessageStrategy=w.CancellationStrategy=w.CancellationSenderStrategy=w.CancellationReceiverStrategy=w.ConnectionError=w.ConnectionErrors=w.LogTraceNotification=w.SetTraceNotification=w.TraceFormat=w.TraceValues=w.Trace=void 0;var pe=na();Object.defineProperty(w,"Message",{enumerable:!0,get:function(){return pe.Message}});Object.defineProperty(w,"RequestType",{enumerable:!0,get:function(){return pe.RequestType}});Object.defineProperty(w,"RequestType0",{enumerable:!0,get:function(){return pe.RequestType0}});Object.defineProperty(w,"RequestType1",{enumerable:!0,get:function(){return pe.RequestType1}});Object.defineProperty(w,"RequestType2",{enumerable:!0,get:function(){return pe.RequestType2}});Object.defineProperty(w,"RequestType3",{enumerable:!0,get:function(){return pe.RequestType3}});Object.defineProperty(w,"RequestType4",{enumerable:!0,get:function(){return pe.RequestType4}});Object.defineProperty(w,"RequestType5",{enumerable:!0,get:function(){return pe.RequestType5}});Object.defineProperty(w,"RequestType6",{enumerable:!0,get:function(){return pe.RequestType6}});Object.defineProperty(w,"RequestType7",{enumerable:!0,get:function(){return pe.RequestType7}});Object.defineProperty(w,"RequestType8",{enumerable:!0,get:function(){return pe.RequestType8}});Object.defineProperty(w,"RequestType9",{enumerable:!0,get:function(){return pe.RequestType9}});Object.defineProperty(w,"ResponseError",{enumerable:!0,get:function(){return pe.ResponseError}});Object.defineProperty(w,"ErrorCodes",{enumerable:!0,get:function(){return pe.ErrorCodes}});Object.defineProperty(w,"NotificationType",{enumerable:!0,get:function(){return pe.NotificationType}});Object.defineProperty(w,"NotificationType0",{enumerable:!0,get:function(){return pe.NotificationType0}});Object.defineProperty(w,"NotificationType1",{enumerable:!0,get:function(){return pe.NotificationType1}});Object.defineProperty(w,"NotificationType2",{enumerable:!0,get:function(){return pe.NotificationType2}});Object.defineProperty(w,"NotificationType3",{enumerable:!0,get:function(){return pe.NotificationType3}});Object.defineProperty(w,"NotificationType4",{enumerable:!0,get:function(){return pe.NotificationType4}});Object.defineProperty(w,"NotificationType5",{enumerable:!0,get:function(){return pe.NotificationType5}});Object.defineProperty(w,"NotificationType6",{enumerable:!0,get:function(){return pe.NotificationType6}});Object.defineProperty(w,"NotificationType7",{enumerable:!0,get:function(){return pe.NotificationType7}});Object.defineProperty(w,"NotificationType8",{enumerable:!0,get:function(){return pe.NotificationType8}});Object.defineProperty(w,"NotificationType9",{enumerable:!0,get:function(){return pe.NotificationType9}});Object.defineProperty(w,"ParameterStructures",{enumerable:!0,get:function(){return pe.ParameterStructures}});var Na=sa();Object.defineProperty(w,"LinkedMap",{enumerable:!0,get:function(){return Na.LinkedMap}});Object.defineProperty(w,"LRUCache",{enumerable:!0,get:function(){return Na.LRUCache}});Object.defineProperty(w,"Touch",{enumerable:!0,get:function(){return Na.Touch}});var Kh=tu();Object.defineProperty(w,"Disposable",{enumerable:!0,get:function(){return Kh.Disposable}});var yu=dn();Object.defineProperty(w,"Event",{enumerable:!0,get:function(){return yu.Event}});Object.defineProperty(w,"Emitter",{enumerable:!0,get:function(){return yu.Emitter}});var vu=Di();Object.defineProperty(w,"CancellationTokenSource",{enumerable:!0,get:function(){return vu.CancellationTokenSource}});Object.defineProperty(w,"CancellationToken",{enumerable:!0,get:function(){return vu.CancellationToken}});var _u=nu();Object.defineProperty(w,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return _u.SharedArraySenderStrategy}});Object.defineProperty(w,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return _u.SharedArrayReceiverStrategy}});var Ma=su();Object.defineProperty(w,"MessageReader",{enumerable:!0,get:function(){return Ma.MessageReader}});Object.defineProperty(w,"AbstractMessageReader",{enumerable:!0,get:function(){return Ma.AbstractMessageReader}});Object.defineProperty(w,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return Ma.ReadableStreamMessageReader}});var ja=du();Object.defineProperty(w,"MessageWriter",{enumerable:!0,get:function(){return ja.MessageWriter}});Object.defineProperty(w,"AbstractMessageWriter",{enumerable:!0,get:function(){return ja.AbstractMessageWriter}});Object.defineProperty(w,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return ja.WriteableStreamMessageWriter}});var ep=lu();Object.defineProperty(w,"AbstractMessageBuffer",{enumerable:!0,get:function(){return ep.AbstractMessageBuffer}});var Ne=gu();Object.defineProperty(w,"ConnectionStrategy",{enumerable:!0,get:function(){return Ne.ConnectionStrategy}});Object.defineProperty(w,"ConnectionOptions",{enumerable:!0,get:function(){return Ne.ConnectionOptions}});Object.defineProperty(w,"NullLogger",{enumerable:!0,get:function(){return Ne.NullLogger}});Object.defineProperty(w,"createMessageConnection",{enumerable:!0,get:function(){return Ne.createMessageConnection}});Object.defineProperty(w,"ProgressToken",{enumerable:!0,get:function(){return Ne.ProgressToken}});Object.defineProperty(w,"ProgressType",{enumerable:!0,get:function(){return Ne.ProgressType}});Object.defineProperty(w,"Trace",{enumerable:!0,get:function(){return Ne.Trace}});Object.defineProperty(w,"TraceValues",{enumerable:!0,get:function(){return Ne.TraceValues}});Object.defineProperty(w,"TraceFormat",{enumerable:!0,get:function(){return Ne.TraceFormat}});Object.defineProperty(w,"SetTraceNotification",{enumerable:!0,get:function(){return Ne.SetTraceNotification}});Object.defineProperty(w,"LogTraceNotification",{enumerable:!0,get:function(){return Ne.LogTraceNotification}});Object.defineProperty(w,"ConnectionErrors",{enumerable:!0,get:function(){return Ne.ConnectionErrors}});Object.defineProperty(w,"ConnectionError",{enumerable:!0,get:function(){return Ne.ConnectionError}});Object.defineProperty(w,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Ne.CancellationReceiverStrategy}});Object.defineProperty(w,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Ne.CancellationSenderStrategy}});Object.defineProperty(w,"CancellationStrategy",{enumerable:!0,get:function(){return Ne.CancellationStrategy}});Object.defineProperty(w,"MessageStrategy",{enumerable:!0,get:function(){return Ne.MessageStrategy}});var tp=Kt();w.RAL=tp.default});var Tu=M(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});var bu=require("util"),jt=Fi(),Wi=class t extends jt.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return t.emptyBuffer}fromString(e,r){return Buffer.from(e,r)}toString(e,r){return e instanceof Buffer?e.toString(r):new bu.TextDecoder(r).decode(e)}asNative(e,r){return r===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,r):Buffer.from(e,0,r)}allocNative(e){return Buffer.allocUnsafe(e)}};Wi.emptyBuffer=Buffer.allocUnsafe(0);var qa=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),jt.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),jt.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),jt.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),jt.Disposable.create(()=>this.stream.off("data",e))}},Ia=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),jt.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),jt.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),jt.Disposable.create(()=>this.stream.off("end",e))}write(e,r){return new Promise((n,i)=>{let s=d=>{d==null?n():i(d)};typeof e=="string"?this.stream.write(e,r,s):this.stream.write(e,s)})}end(){this.stream.end()}},wu=Object.freeze({messageBuffer:Object.freeze({create:t=>new Wi(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(r){return Promise.reject(r)}}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new bu.TextDecoder(e.charset).decode(t)))}catch(r){return Promise.reject(r)}}})}),stream:Object.freeze({asReadableStream:t=>new qa(t),asWritableStream:t=>new Ia(t)}),console,timer:Object.freeze({setTimeout(t,e,...r){let n=setTimeout(t,e,...r);return{dispose:()=>clearTimeout(n)}},setImmediate(t,...e){let r=setImmediate(t,...e);return{dispose:()=>clearImmediate(r)}},setInterval(t,e,...r){let n=setInterval(t,e,...r);return{dispose:()=>clearInterval(n)}}})});function Aa(){return wu}(function(t){function e(){jt.RAL.install(wu)}t.install=e})(Aa||(Aa={}));La.default=Aa});var yr=M(ne=>{"use strict";var rp=ne&&ne.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),np=ne&&ne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&rp(e,t,r)};Object.defineProperty(ne,"__esModule",{value:!0});ne.createMessageConnection=ne.createServerSocketTransport=ne.createClientSocketTransport=ne.createServerPipeTransport=ne.createClientPipeTransport=ne.generateRandomPipeName=ne.StreamMessageWriter=ne.StreamMessageReader=ne.SocketMessageWriter=ne.SocketMessageReader=ne.PortMessageWriter=ne.PortMessageReader=ne.IPCMessageWriter=ne.IPCMessageReader=void 0;var mn=Tu();mn.default.install();var Ru=require("path"),ip=require("os"),sp=require("crypto"),Ui=require("net"),it=Fi();np(Fi(),ne);var $a=class extends it.AbstractMessageReader{constructor(e){super(),this.process=e;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),it.Disposable.create(()=>this.process.off("message",e))}};ne.IPCMessageReader=$a;var Fa=class extends it.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,r=>{r?(this.errorCount++,this.handleError(r,e)):this.errorCount=0}),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};ne.IPCMessageWriter=Fa;var Wa=class extends it.AbstractMessageReader{constructor(e){super(),this.onData=new it.Emitter,e.on("close",()=>this.fireClose),e.on("error",r=>this.fireError(r)),e.on("message",r=>{this.onData.fire(r)})}listen(e){return this.onData.event(e)}};ne.PortMessageReader=Wa;var Va=class extends it.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",r=>this.fireError(r))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};ne.PortMessageWriter=Va;var mr=class extends it.ReadableStreamMessageReader{constructor(e,r="utf-8"){super((0,mn.default)().stream.asReadableStream(e),r)}};ne.SocketMessageReader=mr;var gr=class extends it.WriteableStreamMessageWriter{constructor(e,r){super((0,mn.default)().stream.asWritableStream(e),r),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};ne.SocketMessageWriter=gr;var Vi=class extends it.ReadableStreamMessageReader{constructor(e,r){super((0,mn.default)().stream.asReadableStream(e),r)}};ne.StreamMessageReader=Vi;var zi=class extends it.WriteableStreamMessageWriter{constructor(e,r){super((0,mn.default)().stream.asWritableStream(e),r)}};ne.StreamMessageWriter=zi;var ku=process.env.XDG_RUNTIME_DIR,op=new Map([["linux",107],["darwin",103]]);function ap(){let t=(0,sp.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;ku?e=Ru.join(ku,`vscode-ipc-${t}.sock`):e=Ru.join(ip.tmpdir(),`vscode-${t}.sock`);let r=op.get(process.platform);return r!==void 0&&e.length>r&&(0,mn.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${r} characters.`),e}ne.generateRandomPipeName=ap;function cp(t,e="utf-8"){let r,n=new Promise((i,s)=>{r=i});return new Promise((i,s)=>{let d=(0,Ui.createServer)(h=>{d.close(),r([new mr(h,e),new gr(h,e)])});d.on("error",s),d.listen(t,()=>{d.removeListener("error",s),i({onConnected:()=>n})})})}ne.createClientPipeTransport=cp;function up(t,e="utf-8"){let r=(0,Ui.createConnection)(t);return[new mr(r,e),new gr(r,e)]}ne.createServerPipeTransport=up;function dp(t,e="utf-8"){let r,n=new Promise((i,s)=>{r=i});return new Promise((i,s)=>{let d=(0,Ui.createServer)(h=>{d.close(),r([new mr(h,e),new gr(h,e)])});d.on("error",s),d.listen(t,"127.0.0.1",()=>{d.removeListener("error",s),i({onConnected:()=>n})})})}ne.createClientSocketTransport=dp;function lp(t,e="utf-8"){let r=(0,Ui.createConnection)(t,"127.0.0.1");return[new mr(r,e),new gr(r,e)]}ne.createServerSocketTransport=lp;function fp(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function hp(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function pp(t,e,r,n){r||(r=it.NullLogger);let i=fp(t)?new Vi(t):t,s=hp(e)?new zi(e):e;return it.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,it.createMessageConnection)(i,s,r,n)}ne.createMessageConnection=pp});var za=M((zg,Su)=>{"use strict";Su.exports=yr()});var Hi=M((Cu,Bi)=>{(function(t){if(typeof Bi=="object"&&typeof Bi.exports=="object"){var e=t(require,Cu);e!==void 0&&(Bi.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],t)})(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.WorkspaceFolder=e.InlineCompletionContext=e.SelectedCompletionInfo=e.InlineCompletionTriggerKind=e.InlineCompletionList=e.InlineCompletionItem=e.StringValue=e.InlayHint=e.InlayHintLabelPart=e.InlayHintKind=e.InlineValueContext=e.InlineValueEvaluatableExpression=e.InlineValueVariableLookup=e.InlineValueText=e.SemanticTokens=e.SemanticTokenModifiers=e.SemanticTokenTypes=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionTriggerKind=e.CodeActionKind=e.DocumentSymbol=e.WorkspaceSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.CompletionItemLabelDetails=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=e.URI=e.DocumentUri=void 0;var r;(function(c){function p(m){return typeof m=="string"}c.is=p})(r||(e.DocumentUri=r={}));var n;(function(c){function p(m){return typeof m=="string"}c.is=p})(n||(e.URI=n={}));var i;(function(c){c.MIN_VALUE=-2147483648,c.MAX_VALUE=2147483647;function p(m){return typeof m=="number"&&c.MIN_VALUE<=m&&m<=c.MAX_VALUE}c.is=p})(i||(e.integer=i={}));var s;(function(c){c.MIN_VALUE=0,c.MAX_VALUE=2147483647;function p(m){return typeof m=="number"&&c.MIN_VALUE<=m&&m<=c.MAX_VALUE}c.is=p})(s||(e.uinteger=s={}));var d;(function(c){function p(u,a){return u===Number.MAX_VALUE&&(u=s.MAX_VALUE),a===Number.MAX_VALUE&&(a=s.MAX_VALUE),{line:u,character:a}}c.create=p;function m(u){var a=u;return v.objectLiteral(a)&&v.uinteger(a.line)&&v.uinteger(a.character)}c.is=m})(d||(e.Position=d={}));var h;(function(c){function p(u,a,y,k){if(v.uinteger(u)&&v.uinteger(a)&&v.uinteger(y)&&v.uinteger(k))return{start:d.create(u,a),end:d.create(y,k)};if(d.is(u)&&d.is(a))return{start:u,end:a};throw new Error("Range#create called with invalid arguments[".concat(u,", ").concat(a,", ").concat(y,", ").concat(k,"]"))}c.create=p;function m(u){var a=u;return v.objectLiteral(a)&&d.is(a.start)&&d.is(a.end)}c.is=m})(h||(e.Range=h={}));var R;(function(c){function p(u,a){return{uri:u,range:a}}c.create=p;function m(u){var a=u;return v.objectLiteral(a)&&h.is(a.range)&&(v.string(a.uri)||v.undefined(a.uri))}c.is=m})(R||(e.Location=R={}));var T;(function(c){function p(u,a,y,k){return{targetUri:u,targetRange:a,targetSelectionRange:y,originSelectionRange:k}}c.create=p;function m(u){var a=u;return v.objectLiteral(a)&&h.is(a.targetRange)&&v.string(a.targetUri)&&h.is(a.targetSelectionRange)&&(h.is(a.originSelectionRange)||v.undefined(a.originSelectionRange))}c.is=m})(T||(e.LocationLink=T={}));var P;(function(c){function p(u,a,y,k){return{red:u,green:a,blue:y,alpha:k}}c.create=p;function m(u){var a=u;return v.objectLiteral(a)&&v.numberRange(a.red,0,1)&&v.numberRange(a.green,0,1)&&v.numberRange(a.blue,0,1)&&v.numberRange(a.alpha,0,1)}c.is=m})(P||(e.Color=P={}));var Z;(function(c){function p(u,a){return{range:u,color:a}}c.create=p;function m(u){var a=u;return v.objectLiteral(a)&&h.is(a.range)&&P.is(a.color)}c.is=m})(Z||(e.ColorInformation=Z={}));var se;(function(c){function p(u,a,y){return{label:u,textEdit:a,additionalTextEdits:y}}c.create=p;function m(u){var a=u;return v.objectLiteral(a)&&v.string(a.label)&&(v.undefined(a.textEdit)||$.is(a))&&(v.undefined(a.additionalTextEdits)||v.typedArray(a.additionalTextEdits,$.is))}c.is=m})(se||(e.ColorPresentation=se={}));var ce;(function(c){c.Comment="comment",c.Imports="imports",c.Region="region"})(ce||(e.FoldingRangeKind=ce={}));var Ue;(function(c){function p(u,a,y,k,J,Ce){var fe={startLine:u,endLine:a};return v.defined(y)&&(fe.startCharacter=y),v.defined(k)&&(fe.endCharacter=k),v.defined(J)&&(fe.kind=J),v.defined(Ce)&&(fe.collapsedText=Ce),fe}c.create=p;function m(u){var a=u;return v.objectLiteral(a)&&v.uinteger(a.startLine)&&v.uinteger(a.startLine)&&(v.undefined(a.startCharacter)||v.uinteger(a.startCharacter))&&(v.undefined(a.endCharacter)||v.uinteger(a.endCharacter))&&(v.undefined(a.kind)||v.string(a.kind))}c.is=m})(Ue||(e.FoldingRange=Ue={}));var Se;(function(c){function p(u,a){return{location:u,message:a}}c.create=p;function m(u){var a=u;return v.defined(a)&&R.is(a.location)&&v.string(a.message)}c.is=m})(Se||(e.DiagnosticRelatedInformation=Se={}));var we;(function(c){c.Error=1,c.Warning=2,c.Information=3,c.Hint=4})(we||(e.DiagnosticSeverity=we={}));var ue;(function(c){c.Unnecessary=1,c.Deprecated=2})(ue||(e.DiagnosticTag=ue={}));var de;(function(c){function p(m){var u=m;return v.objectLiteral(u)&&v.string(u.href)}c.is=p})(de||(e.CodeDescription=de={}));var O;(function(c){function p(u,a,y,k,J,Ce){var fe={range:u,message:a};return v.defined(y)&&(fe.severity=y),v.defined(k)&&(fe.code=k),v.defined(J)&&(fe.source=J),v.defined(Ce)&&(fe.relatedInformation=Ce),fe}c.create=p;function m(u){var a,y=u;return v.defined(y)&&h.is(y.range)&&v.string(y.message)&&(v.number(y.severity)||v.undefined(y.severity))&&(v.integer(y.code)||v.string(y.code)||v.undefined(y.code))&&(v.undefined(y.codeDescription)||v.string((a=y.codeDescription)===null||a===void 0?void 0:a.href))&&(v.string(y.source)||v.undefined(y.source))&&(v.undefined(y.relatedInformation)||v.typedArray(y.relatedInformation,Se.is))}c.is=m})(O||(e.Diagnostic=O={}));var le;(function(c){function p(u,a){for(var y=[],k=2;k<arguments.length;k++)y[k-2]=arguments[k];var J={title:u,command:a};return v.defined(y)&&y.length>0&&(J.arguments=y),J}c.create=p;function m(u){var a=u;return v.defined(a)&&v.string(a.title)&&v.string(a.command)}c.is=m})(le||(e.Command=le={}));var $;(function(c){function p(y,k){return{range:y,newText:k}}c.replace=p;function m(y,k){return{range:{start:y,end:y},newText:k}}c.insert=m;function u(y){return{range:y,newText:""}}c.del=u;function a(y){var k=y;return v.objectLiteral(k)&&v.string(k.newText)&&h.is(k.range)}c.is=a})($||(e.TextEdit=$={}));var ye;(function(c){function p(u,a,y){var k={label:u};return a!==void 0&&(k.needsConfirmation=a),y!==void 0&&(k.description=y),k}c.create=p;function m(u){var a=u;return v.objectLiteral(a)&&v.string(a.label)&&(v.boolean(a.needsConfirmation)||a.needsConfirmation===void 0)&&(v.string(a.description)||a.description===void 0)}c.is=m})(ye||(e.ChangeAnnotation=ye={}));var ve;(function(c){function p(m){var u=m;return v.string(u)}c.is=p})(ve||(e.ChangeAnnotationIdentifier=ve={}));var Be;(function(c){function p(y,k,J){return{range:y,newText:k,annotationId:J}}c.replace=p;function m(y,k,J){return{range:{start:y,end:y},newText:k,annotationId:J}}c.insert=m;function u(y,k){return{range:y,newText:"",annotationId:k}}c.del=u;function a(y){var k=y;return $.is(k)&&(ye.is(k.annotationId)||ve.is(k.annotationId))}c.is=a})(Be||(e.AnnotatedTextEdit=Be={}));var _t;(function(c){function p(u,a){return{textDocument:u,edits:a}}c.create=p;function m(u){var a=u;return v.defined(a)&&bt.is(a.textDocument)&&Array.isArray(a.edits)}c.is=m})(_t||(e.TextDocumentEdit=_t={}));var lt;(function(c){function p(u,a,y){var k={kind:"create",uri:u};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(k.options=a),y!==void 0&&(k.annotationId=y),k}c.create=p;function m(u){var a=u;return a&&a.kind==="create"&&v.string(a.uri)&&(a.options===void 0||(a.options.overwrite===void 0||v.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||v.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||ve.is(a.annotationId))}c.is=m})(lt||(e.CreateFile=lt={}));var ft;(function(c){function p(u,a,y,k){var J={kind:"rename",oldUri:u,newUri:a};return y!==void 0&&(y.overwrite!==void 0||y.ignoreIfExists!==void 0)&&(J.options=y),k!==void 0&&(J.annotationId=k),J}c.create=p;function m(u){var a=u;return a&&a.kind==="rename"&&v.string(a.oldUri)&&v.string(a.newUri)&&(a.options===void 0||(a.options.overwrite===void 0||v.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||v.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||ve.is(a.annotationId))}c.is=m})(ft||(e.RenameFile=ft={}));var Te;(function(c){function p(u,a,y){var k={kind:"delete",uri:u};return a!==void 0&&(a.recursive!==void 0||a.ignoreIfNotExists!==void 0)&&(k.options=a),y!==void 0&&(k.annotationId=y),k}c.create=p;function m(u){var a=u;return a&&a.kind==="delete"&&v.string(a.uri)&&(a.options===void 0||(a.options.recursive===void 0||v.boolean(a.options.recursive))&&(a.options.ignoreIfNotExists===void 0||v.boolean(a.options.ignoreIfNotExists)))&&(a.annotationId===void 0||ve.is(a.annotationId))}c.is=m})(Te||(e.DeleteFile=Te={}));var Dt;(function(c){function p(m){var u=m;return u&&(u.changes!==void 0||u.documentChanges!==void 0)&&(u.documentChanges===void 0||u.documentChanges.every(function(a){return v.string(a.kind)?lt.is(a)||ft.is(a)||Te.is(a):_t.is(a)}))}c.is=p})(Dt||(e.WorkspaceEdit=Dt={}));var Ft=function(){function c(p,m){this.edits=p,this.changeAnnotations=m}return c.prototype.insert=function(p,m,u){var a,y;if(u===void 0?a=$.insert(p,m):ve.is(u)?(y=u,a=Be.insert(p,m,u)):(this.assertChangeAnnotations(this.changeAnnotations),y=this.changeAnnotations.manage(u),a=Be.insert(p,m,y)),this.edits.push(a),y!==void 0)return y},c.prototype.replace=function(p,m,u){var a,y;if(u===void 0?a=$.replace(p,m):ve.is(u)?(y=u,a=Be.replace(p,m,u)):(this.assertChangeAnnotations(this.changeAnnotations),y=this.changeAnnotations.manage(u),a=Be.replace(p,m,y)),this.edits.push(a),y!==void 0)return y},c.prototype.delete=function(p,m){var u,a;if(m===void 0?u=$.del(p):ve.is(m)?(a=m,u=Be.del(p,m)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(m),u=Be.del(p,a)),this.edits.push(u),a!==void 0)return a},c.prototype.add=function(p){this.edits.push(p)},c.prototype.all=function(){return this.edits},c.prototype.clear=function(){this.edits.splice(0,this.edits.length)},c.prototype.assertChangeAnnotations=function(p){if(p===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},c}(),Ir=function(){function c(p){this._annotations=p===void 0?Object.create(null):p,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(p,m){var u;if(ve.is(p)?u=p:(u=this.nextId(),m=p),this._annotations[u]!==void 0)throw new Error("Id ".concat(u," is already in use."));if(m===void 0)throw new Error("No annotation provided for id ".concat(u));return this._annotations[u]=m,this._size++,u},c.prototype.nextId=function(){return this._counter++,this._counter.toString()},c}(),In=function(){function c(p){var m=this;this._textEditChanges=Object.create(null),p!==void 0?(this._workspaceEdit=p,p.documentChanges?(this._changeAnnotations=new Ir(p.changeAnnotations),p.changeAnnotations=this._changeAnnotations.all(),p.documentChanges.forEach(function(u){if(_t.is(u)){var a=new Ft(u.edits,m._changeAnnotations);m._textEditChanges[u.textDocument.uri]=a}})):p.changes&&Object.keys(p.changes).forEach(function(u){var a=new Ft(p.changes[u]);m._textEditChanges[u]=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(p){if(bt.is(p)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m={uri:p.uri,version:p.version},u=this._textEditChanges[m.uri];if(!u){var a=[],y={textDocument:m,edits:a};this._workspaceEdit.documentChanges.push(y),u=new Ft(a,this._changeAnnotations),this._textEditChanges[m.uri]=u}return u}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var u=this._textEditChanges[p];if(!u){var a=[];this._workspaceEdit.changes[p]=a,u=new Ft(a),this._textEditChanges[p]=u}return u}},c.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Ir,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(p,m,u){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var a;ye.is(m)||ve.is(m)?a=m:u=m;var y,k;if(a===void 0?y=lt.create(p,u):(k=ve.is(a)?a:this._changeAnnotations.manage(a),y=lt.create(p,u,k)),this._workspaceEdit.documentChanges.push(y),k!==void 0)return k},c.prototype.renameFile=function(p,m,u,a){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var y;ye.is(u)||ve.is(u)?y=u:a=u;var k,J;if(y===void 0?k=ft.create(p,m,a):(J=ve.is(y)?y:this._changeAnnotations.manage(y),k=ft.create(p,m,a,J)),this._workspaceEdit.documentChanges.push(k),J!==void 0)return J},c.prototype.deleteFile=function(p,m,u){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var a;ye.is(m)||ve.is(m)?a=m:u=m;var y,k;if(a===void 0?y=Te.create(p,u):(k=ve.is(a)?a:this._changeAnnotations.manage(a),y=Te.create(p,u,k)),this._workspaceEdit.documentChanges.push(y),k!==void 0)return k},c}();e.WorkspaceChange=In;var Ar;(function(c){function p(u){return{uri:u}}c.create=p;function m(u){var a=u;return v.defined(a)&&v.string(a.uri)}c.is=m})(Ar||(e.TextDocumentIdentifier=Ar={}));var Wt;(function(c){function p(u,a){return{uri:u,version:a}}c.create=p;function m(u){var a=u;return v.defined(a)&&v.string(a.uri)&&v.integer(a.version)}c.is=m})(Wt||(e.VersionedTextDocumentIdentifier=Wt={}));var bt;(function(c){function p(u,a){return{uri:u,version:a}}c.create=p;function m(u){var a=u;return v.defined(a)&&v.string(a.uri)&&(a.version===null||v.integer(a.version))}c.is=m})(bt||(e.OptionalVersionedTextDocumentIdentifier=bt={}));var je;(function(c){function p(u,a,y,k){return{uri:u,languageId:a,version:y,text:k}}c.create=p;function m(u){var a=u;return v.defined(a)&&v.string(a.uri)&&v.string(a.languageId)&&v.integer(a.version)&&v.string(a.text)}c.is=m})(je||(e.TextDocumentItem=je={}));var Et;(function(c){c.PlainText="plaintext",c.Markdown="markdown";function p(m){var u=m;return u===c.PlainText||u===c.Markdown}c.is=p})(Et||(e.MarkupKind=Et={}));var Ot;(function(c){function p(m){var u=m;return v.objectLiteral(m)&&Et.is(u.kind)&&v.string(u.value)}c.is=p})(Ot||(e.MarkupContent=Ot={}));var Lr;(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})(Lr||(e.CompletionItemKind=Lr={}));var Vt;(function(c){c.PlainText=1,c.Snippet=2})(Vt||(e.InsertTextFormat=Vt={}));var zt;(function(c){c.Deprecated=1})(zt||(e.CompletionItemTag=zt={}));var $r;(function(c){function p(u,a,y){return{newText:u,insert:a,replace:y}}c.create=p;function m(u){var a=u;return a&&v.string(a.newText)&&h.is(a.insert)&&h.is(a.replace)}c.is=m})($r||(e.InsertReplaceEdit=$r={}));var Fr;(function(c){c.asIs=1,c.adjustIndentation=2})(Fr||(e.InsertTextMode=Fr={}));var Wr;(function(c){function p(m){var u=m;return u&&(v.string(u.detail)||u.detail===void 0)&&(v.string(u.description)||u.description===void 0)}c.is=p})(Wr||(e.CompletionItemLabelDetails=Wr={}));var Vr;(function(c){function p(m){return{label:m}}c.create=p})(Vr||(e.CompletionItem=Vr={}));var zr;(function(c){function p(m,u){return{items:m||[],isIncomplete:!!u}}c.create=p})(zr||(e.CompletionList=zr={}));var Ut;(function(c){function p(u){return u.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}c.fromPlainText=p;function m(u){var a=u;return v.string(a)||v.objectLiteral(a)&&v.string(a.language)&&v.string(a.value)}c.is=m})(Ut||(e.MarkedString=Ut={}));var xe;(function(c){function p(m){var u=m;return!!u&&v.objectLiteral(u)&&(Ot.is(u.contents)||Ut.is(u.contents)||v.typedArray(u.contents,Ut.is))&&(m.range===void 0||h.is(m.range))}c.is=p})(xe||(e.Hover=xe={}));var Ur;(function(c){function p(m,u){return u?{label:m,documentation:u}:{label:m}}c.create=p})(Ur||(e.ParameterInformation=Ur={}));var Br;(function(c){function p(m,u){for(var a=[],y=2;y<arguments.length;y++)a[y-2]=arguments[y];var k={label:m};return v.defined(u)&&(k.documentation=u),v.defined(a)?k.parameters=a:k.parameters=[],k}c.create=p})(Br||(e.SignatureInformation=Br={}));var st;(function(c){c.Text=1,c.Read=2,c.Write=3})(st||(e.DocumentHighlightKind=st={}));var Hr;(function(c){function p(m,u){var a={range:m};return v.number(u)&&(a.kind=u),a}c.create=p})(Hr||(e.DocumentHighlight=Hr={}));var wt;(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})(wt||(e.SymbolKind=wt={}));var Zr;(function(c){c.Deprecated=1})(Zr||(e.SymbolTag=Zr={}));var qe;(function(c){function p(m,u,a,y,k){var J={name:m,kind:u,location:{uri:y,range:a}};return k&&(J.containerName=k),J}c.create=p})(qe||(e.SymbolInformation=qe={}));var He;(function(c){function p(m,u,a,y){return y!==void 0?{name:m,kind:u,location:{uri:a,range:y}}:{name:m,kind:u,location:{uri:a}}}c.create=p})(He||(e.WorkspaceSymbol=He={}));var Jr;(function(c){function p(u,a,y,k,J,Ce){var fe={name:u,detail:a,kind:y,range:k,selectionRange:J};return Ce!==void 0&&(fe.children=Ce),fe}c.create=p;function m(u){var a=u;return a&&v.string(a.name)&&v.number(a.kind)&&h.is(a.range)&&h.is(a.selectionRange)&&(a.detail===void 0||v.string(a.detail))&&(a.deprecated===void 0||v.boolean(a.deprecated))&&(a.children===void 0||Array.isArray(a.children))&&(a.tags===void 0||Array.isArray(a.tags))}c.is=m})(Jr||(e.DocumentSymbol=Jr={}));var Gr;(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"})(Gr||(e.CodeActionKind=Gr={}));var Ie;(function(c){c.Invoked=1,c.Automatic=2})(Ie||(e.CodeActionTriggerKind=Ie={}));var Bt;(function(c){function p(u,a,y){var k={diagnostics:u};return a!=null&&(k.only=a),y!=null&&(k.triggerKind=y),k}c.create=p;function m(u){var a=u;return v.defined(a)&&v.typedArray(a.diagnostics,O.is)&&(a.only===void 0||v.typedArray(a.only,v.string))&&(a.triggerKind===void 0||a.triggerKind===Ie.Invoked||a.triggerKind===Ie.Automatic)}c.is=m})(Bt||(e.CodeActionContext=Bt={}));var Ht;(function(c){function p(u,a,y){var k={title:u},J=!0;return typeof a=="string"?(J=!1,k.kind=a):le.is(a)?k.command=a:k.edit=a,J&&y!==void 0&&(k.kind=y),k}c.create=p;function m(u){var a=u;return a&&v.string(a.title)&&(a.diagnostics===void 0||v.typedArray(a.diagnostics,O.is))&&(a.kind===void 0||v.string(a.kind))&&(a.edit!==void 0||a.command!==void 0)&&(a.command===void 0||le.is(a.command))&&(a.isPreferred===void 0||v.boolean(a.isPreferred))&&(a.edit===void 0||Dt.is(a.edit))}c.is=m})(Ht||(e.CodeAction=Ht={}));var Tt;(function(c){function p(u,a){var y={range:u};return v.defined(a)&&(y.data=a),y}c.create=p;function m(u){var a=u;return v.defined(a)&&h.is(a.range)&&(v.undefined(a.command)||le.is(a.command))}c.is=m})(Tt||(e.CodeLens=Tt={}));var Zt;(function(c){function p(u,a){return{tabSize:u,insertSpaces:a}}c.create=p;function m(u){var a=u;return v.defined(a)&&v.uinteger(a.tabSize)&&v.boolean(a.insertSpaces)}c.is=m})(Zt||(e.FormattingOptions=Zt={}));var Ae;(function(c){function p(u,a,y){return{range:u,target:a,data:y}}c.create=p;function m(u){var a=u;return v.defined(a)&&h.is(a.range)&&(v.undefined(a.target)||v.string(a.target))}c.is=m})(Ae||(e.DocumentLink=Ae={}));var o;(function(c){function p(u,a){return{range:u,parent:a}}c.create=p;function m(u){var a=u;return v.objectLiteral(a)&&h.is(a.range)&&(a.parent===void 0||c.is(a.parent))}c.is=m})(o||(e.SelectionRange=o={}));var f;(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"})(f||(e.SemanticTokenTypes=f={}));var g;(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"})(g||(e.SemanticTokenModifiers=g={}));var _;(function(c){function p(m){var u=m;return v.objectLiteral(u)&&(u.resultId===void 0||typeof u.resultId=="string")&&Array.isArray(u.data)&&(u.data.length===0||typeof u.data[0]=="number")}c.is=p})(_||(e.SemanticTokens=_={}));var L;(function(c){function p(u,a){return{range:u,text:a}}c.create=p;function m(u){var a=u;return a!=null&&h.is(a.range)&&v.string(a.text)}c.is=m})(L||(e.InlineValueText=L={}));var q;(function(c){function p(u,a,y){return{range:u,variableName:a,caseSensitiveLookup:y}}c.create=p;function m(u){var a=u;return a!=null&&h.is(a.range)&&v.boolean(a.caseSensitiveLookup)&&(v.string(a.variableName)||a.variableName===void 0)}c.is=m})(q||(e.InlineValueVariableLookup=q={}));var B;(function(c){function p(u,a){return{range:u,expression:a}}c.create=p;function m(u){var a=u;return a!=null&&h.is(a.range)&&(v.string(a.expression)||a.expression===void 0)}c.is=m})(B||(e.InlineValueEvaluatableExpression=B={}));var H;(function(c){function p(u,a){return{frameId:u,stoppedLocation:a}}c.create=p;function m(u){var a=u;return v.defined(a)&&h.is(u.stoppedLocation)}c.is=m})(H||(e.InlineValueContext=H={}));var D;(function(c){c.Type=1,c.Parameter=2;function p(m){return m===1||m===2}c.is=p})(D||(e.InlayHintKind=D={}));var F;(function(c){function p(u){return{value:u}}c.create=p;function m(u){var a=u;return v.objectLiteral(a)&&(a.tooltip===void 0||v.string(a.tooltip)||Ot.is(a.tooltip))&&(a.location===void 0||R.is(a.location))&&(a.command===void 0||le.is(a.command))}c.is=m})(F||(e.InlayHintLabelPart=F={}));var N;(function(c){function p(u,a,y){var k={position:u,label:a};return y!==void 0&&(k.kind=y),k}c.create=p;function m(u){var a=u;return v.objectLiteral(a)&&d.is(a.position)&&(v.string(a.label)||v.typedArray(a.label,F.is))&&(a.kind===void 0||D.is(a.kind))&&a.textEdits===void 0||v.typedArray(a.textEdits,$.is)&&(a.tooltip===void 0||v.string(a.tooltip)||Ot.is(a.tooltip))&&(a.paddingLeft===void 0||v.boolean(a.paddingLeft))&&(a.paddingRight===void 0||v.boolean(a.paddingRight))}c.is=m})(N||(e.InlayHint=N={}));var X;(function(c){function p(m){return{kind:"snippet",value:m}}c.createSnippet=p})(X||(e.StringValue=X={}));var ie;(function(c){function p(m,u,a,y){return{insertText:m,filterText:u,range:a,command:y}}c.create=p})(ie||(e.InlineCompletionItem=ie={}));var _e;(function(c){function p(m){return{items:m}}c.create=p})(_e||(e.InlineCompletionList=_e={}));var Qr;(function(c){c.Invoked=0,c.Automatic=1})(Qr||(e.InlineCompletionTriggerKind=Qr={}));var pc;(function(c){function p(m,u){return{range:m,text:u}}c.create=p})(pc||(e.SelectedCompletionInfo=pc={}));var mc;(function(c){function p(m,u){return{triggerKind:m,selectedCompletionInfo:u}}c.create=p})(mc||(e.InlineCompletionContext=mc={}));var gc;(function(c){function p(m){var u=m;return v.objectLiteral(u)&&n.is(u.uri)&&v.string(u.name)}c.is=p})(gc||(e.WorkspaceFolder=gc={})),e.EOL=[`
62
+ `)),f){let _=o.error?` Request failed: ${o.error.message} (${o.error.code}).`:"";$.log(`Received response '${f.method} - (${o.id})' in ${Date.now()-f.timerStart}ms.${_}`,g)}else $.log(`Received response ${o.id} without active response promise.`,g)}else qe("receive-response",o)}function qe(o,f){if(!$||O===ae.Off)return;let g={isLSPMessage:!0,type:o,message:f,timestamp:Date.now()};$.log(g)}function He(){if(bt())throw new pn(Zn.Closed,"Connection is closed.");if(je())throw new pn(Zn.Disposed,"Connection is disposed.")}function Jr(){if(Wt())throw new pn(Zn.AlreadyListening,"Connection is already listening")}function Gr(){if(!Wt())throw new Error("Call listen() first.")}function Ie(o){return o===void 0?null:o}function Bt(o){if(o!==null)return o}function Ht(o){return o!=null&&!Array.isArray(o)&&typeof o=="object"}function Tt(o,f){switch(o){case z.ParameterStructures.auto:return Ht(f)?Bt(f):[Ie(f)];case z.ParameterStructures.byName:if(!Ht(f))throw new Error("Received parameters by name but param is not an object literal.");return Bt(f);case z.ParameterStructures.byPosition:return[Ie(f)];default:throw new Error(`Unknown parameter structure ${o.toString()}`)}}function Zt(o,f){let g,_=o.numberOfParams;switch(_){case 0:g=void 0;break;case 1:g=Tt(o.parameterStructures,f[0]);break;default:g=[];for(let L=0;L<f.length&&L<_;L++)g.push(Ie(f[L]));if(f.length<_)for(let L=f.length;L<_;L++)g.push(null);break}return g}let Ae={sendNotification:(o,...f)=>{He();let g,_;if(ke.string(o)){g=o;let q=f[0],B=0,H=z.ParameterStructures.auto;z.ParameterStructures.is(q)&&(B=1,H=q);let D=f.length,F=D-B;switch(F){case 0:_=void 0;break;case 1:_=Tt(H,f[B]);break;default:if(H===z.ParameterStructures.byName)throw new Error(`Received ${F} parameters for 'by Name' notification parameter structure.`);_=f.slice(B,D).map(N=>Ie(N));break}}else{let q=f;g=o.method,_=Zt(o,q)}let L={jsonrpc:R,method:g,params:_};return Br(L),e.write(L).catch(q=>{throw i.error("Sending notification failed."),q})},onNotification:(o,f)=>{He();let g;return ke.func(o)?Z=o:f&&(ke.string(o)?(g=o,se.set(o,{type:void 0,handler:f})):(g=o.method,se.set(o.method,{type:o,handler:f}))),{dispose:()=>{g!==void 0?se.delete(g):Z=void 0}}},onProgress:(o,f,g)=>{if(ce.has(f))throw new Error(`Progress handler for token ${f} already registered`);return ce.set(f,g),{dispose:()=>{ce.delete(f)}}},sendProgress:(o,f,g)=>Ae.sendNotification(Hn.type,{token:f,value:g}),onUnhandledProgress:lt.event,sendRequest:(o,...f)=>{He(),Gr();let g,_,L;if(ke.string(o)){g=o;let D=f[0],F=f[f.length-1],N=0,X=z.ParameterStructures.auto;z.ParameterStructures.is(D)&&(N=1,X=D);let ie=f.length;Sa.CancellationToken.is(F)&&(ie=ie-1,L=F);let _e=ie-N;switch(_e){case 0:_=void 0;break;case 1:_=Tt(X,f[N]);break;default:if(X===z.ParameterStructures.byName)throw new Error(`Received ${_e} parameters for 'by Name' request parameter structure.`);_=f.slice(N,ie).map(Qr=>Ie(Qr));break}}else{let D=f;g=o.method,_=Zt(o,D);let F=o.numberOfParams;L=Sa.CancellationToken.is(D[F])?D[F]:void 0}let q=s++,B;L&&(B=L.onCancellationRequested(()=>{let D=Te.sender.sendCancellation(Ae,q);return D===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${q}`),Promise.resolve()):D.catch(()=>{i.log(`Sending cancellation messages for id ${q} failed`)})}));let H={jsonrpc:R,id:q,method:g,params:_};return Ur(H),typeof Te.sender.enableCancellation=="function"&&Te.sender.enableCancellation(H),new Promise(async(D,F)=>{let N=_e=>{D(_e),Te.sender.cleanup(q),B?.dispose()},X=_e=>{F(_e),Te.sender.cleanup(q),B?.dispose()},ie={method:g,timerStart:Date.now(),resolve:N,reject:X};try{await e.write(H),we.set(q,ie)}catch(_e){throw i.error("Sending request failed."),ie.reject(new z.ResponseError(z.ErrorCodes.MessageWriteError,_e.message?_e.message:"Unknown reason")),_e}})},onRequest:(o,f)=>{He();let g=null;return xa.is(o)?(g=void 0,T=o):ke.string(o)?(g=null,f!==void 0&&(g=o,P.set(o,{handler:f,type:void 0}))):f!==void 0&&(g=o.method,P.set(o.method,{type:o,handler:f})),{dispose:()=>{g!==null&&(g!==void 0?P.delete(g):T=void 0)}}},hasPendingResponse:()=>we.size>0,trace:async(o,f,g)=>{let _=!1,L=nt.Text;g!==void 0&&(ke.boolean(g)?_=g:(_=g.sendNotification||!1,L=g.traceFormat||nt.Text)),O=o,pe=L,O===ae.Off?$=void 0:$=f,_&&!bt()&&!je()&&await Ae.sendNotification(Da.type,{value:ae.toString(o)})},onError:ve.event,onClose:Be.event,onUnhandledNotification:_t.event,onDispose:ft.event,end:()=>{e.end()},dispose:()=>{if(je())return;ye=gt.Disposed,ft.fire(void 0);let o=new z.ResponseError(z.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let f of we.values())f.reject(o);we=new Map,de=new Map,ue=new Set,Se=new hu.LinkedMap,ke.func(e.dispose)&&e.dispose(),ke.func(t.dispose)&&t.dispose()},listen:()=>{He(),Jr(),ye=gt.Listening,t.listen(Fr)},inspect:()=>{(0,fu.default)().console.log("inspect")}};return Ae.onNotification(ji.type,o=>{if(O===ae.Off||!$)return;let f=O===ae.Verbose||O===ae.Compact;$.log(o.message,f?o.verbose:void 0)}),Ae.onNotification(Hn.type,o=>{let f=ce.get(o.token);f?f(o.value):lt.fire(o)}),Ae}Q.createMessageConnection=Yh});var Fi=M(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.ProgressType=w.ProgressToken=w.createMessageConnection=w.NullLogger=w.ConnectionOptions=w.ConnectionStrategy=w.AbstractMessageBuffer=w.WriteableStreamMessageWriter=w.AbstractMessageWriter=w.MessageWriter=w.ReadableStreamMessageReader=w.AbstractMessageReader=w.MessageReader=w.SharedArrayReceiverStrategy=w.SharedArraySenderStrategy=w.CancellationToken=w.CancellationTokenSource=w.Emitter=w.Event=w.Disposable=w.LRUCache=w.Touch=w.LinkedMap=w.ParameterStructures=w.NotificationType9=w.NotificationType8=w.NotificationType7=w.NotificationType6=w.NotificationType5=w.NotificationType4=w.NotificationType3=w.NotificationType2=w.NotificationType1=w.NotificationType0=w.NotificationType=w.ErrorCodes=w.ResponseError=w.RequestType9=w.RequestType8=w.RequestType7=w.RequestType6=w.RequestType5=w.RequestType4=w.RequestType3=w.RequestType2=w.RequestType1=w.RequestType0=w.RequestType=w.Message=w.RAL=void 0;w.MessageStrategy=w.CancellationStrategy=w.CancellationSenderStrategy=w.CancellationReceiverStrategy=w.ConnectionError=w.ConnectionErrors=w.LogTraceNotification=w.SetTraceNotification=w.TraceFormat=w.TraceValues=w.Trace=void 0;var he=na();Object.defineProperty(w,"Message",{enumerable:!0,get:function(){return he.Message}});Object.defineProperty(w,"RequestType",{enumerable:!0,get:function(){return he.RequestType}});Object.defineProperty(w,"RequestType0",{enumerable:!0,get:function(){return he.RequestType0}});Object.defineProperty(w,"RequestType1",{enumerable:!0,get:function(){return he.RequestType1}});Object.defineProperty(w,"RequestType2",{enumerable:!0,get:function(){return he.RequestType2}});Object.defineProperty(w,"RequestType3",{enumerable:!0,get:function(){return he.RequestType3}});Object.defineProperty(w,"RequestType4",{enumerable:!0,get:function(){return he.RequestType4}});Object.defineProperty(w,"RequestType5",{enumerable:!0,get:function(){return he.RequestType5}});Object.defineProperty(w,"RequestType6",{enumerable:!0,get:function(){return he.RequestType6}});Object.defineProperty(w,"RequestType7",{enumerable:!0,get:function(){return he.RequestType7}});Object.defineProperty(w,"RequestType8",{enumerable:!0,get:function(){return he.RequestType8}});Object.defineProperty(w,"RequestType9",{enumerable:!0,get:function(){return he.RequestType9}});Object.defineProperty(w,"ResponseError",{enumerable:!0,get:function(){return he.ResponseError}});Object.defineProperty(w,"ErrorCodes",{enumerable:!0,get:function(){return he.ErrorCodes}});Object.defineProperty(w,"NotificationType",{enumerable:!0,get:function(){return he.NotificationType}});Object.defineProperty(w,"NotificationType0",{enumerable:!0,get:function(){return he.NotificationType0}});Object.defineProperty(w,"NotificationType1",{enumerable:!0,get:function(){return he.NotificationType1}});Object.defineProperty(w,"NotificationType2",{enumerable:!0,get:function(){return he.NotificationType2}});Object.defineProperty(w,"NotificationType3",{enumerable:!0,get:function(){return he.NotificationType3}});Object.defineProperty(w,"NotificationType4",{enumerable:!0,get:function(){return he.NotificationType4}});Object.defineProperty(w,"NotificationType5",{enumerable:!0,get:function(){return he.NotificationType5}});Object.defineProperty(w,"NotificationType6",{enumerable:!0,get:function(){return he.NotificationType6}});Object.defineProperty(w,"NotificationType7",{enumerable:!0,get:function(){return he.NotificationType7}});Object.defineProperty(w,"NotificationType8",{enumerable:!0,get:function(){return he.NotificationType8}});Object.defineProperty(w,"NotificationType9",{enumerable:!0,get:function(){return he.NotificationType9}});Object.defineProperty(w,"ParameterStructures",{enumerable:!0,get:function(){return he.ParameterStructures}});var Na=sa();Object.defineProperty(w,"LinkedMap",{enumerable:!0,get:function(){return Na.LinkedMap}});Object.defineProperty(w,"LRUCache",{enumerable:!0,get:function(){return Na.LRUCache}});Object.defineProperty(w,"Touch",{enumerable:!0,get:function(){return Na.Touch}});var Kh=tu();Object.defineProperty(w,"Disposable",{enumerable:!0,get:function(){return Kh.Disposable}});var yu=dn();Object.defineProperty(w,"Event",{enumerable:!0,get:function(){return yu.Event}});Object.defineProperty(w,"Emitter",{enumerable:!0,get:function(){return yu.Emitter}});var vu=Di();Object.defineProperty(w,"CancellationTokenSource",{enumerable:!0,get:function(){return vu.CancellationTokenSource}});Object.defineProperty(w,"CancellationToken",{enumerable:!0,get:function(){return vu.CancellationToken}});var _u=nu();Object.defineProperty(w,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return _u.SharedArraySenderStrategy}});Object.defineProperty(w,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return _u.SharedArrayReceiverStrategy}});var Ma=su();Object.defineProperty(w,"MessageReader",{enumerable:!0,get:function(){return Ma.MessageReader}});Object.defineProperty(w,"AbstractMessageReader",{enumerable:!0,get:function(){return Ma.AbstractMessageReader}});Object.defineProperty(w,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return Ma.ReadableStreamMessageReader}});var ja=du();Object.defineProperty(w,"MessageWriter",{enumerable:!0,get:function(){return ja.MessageWriter}});Object.defineProperty(w,"AbstractMessageWriter",{enumerable:!0,get:function(){return ja.AbstractMessageWriter}});Object.defineProperty(w,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return ja.WriteableStreamMessageWriter}});var ep=lu();Object.defineProperty(w,"AbstractMessageBuffer",{enumerable:!0,get:function(){return ep.AbstractMessageBuffer}});var Ne=gu();Object.defineProperty(w,"ConnectionStrategy",{enumerable:!0,get:function(){return Ne.ConnectionStrategy}});Object.defineProperty(w,"ConnectionOptions",{enumerable:!0,get:function(){return Ne.ConnectionOptions}});Object.defineProperty(w,"NullLogger",{enumerable:!0,get:function(){return Ne.NullLogger}});Object.defineProperty(w,"createMessageConnection",{enumerable:!0,get:function(){return Ne.createMessageConnection}});Object.defineProperty(w,"ProgressToken",{enumerable:!0,get:function(){return Ne.ProgressToken}});Object.defineProperty(w,"ProgressType",{enumerable:!0,get:function(){return Ne.ProgressType}});Object.defineProperty(w,"Trace",{enumerable:!0,get:function(){return Ne.Trace}});Object.defineProperty(w,"TraceValues",{enumerable:!0,get:function(){return Ne.TraceValues}});Object.defineProperty(w,"TraceFormat",{enumerable:!0,get:function(){return Ne.TraceFormat}});Object.defineProperty(w,"SetTraceNotification",{enumerable:!0,get:function(){return Ne.SetTraceNotification}});Object.defineProperty(w,"LogTraceNotification",{enumerable:!0,get:function(){return Ne.LogTraceNotification}});Object.defineProperty(w,"ConnectionErrors",{enumerable:!0,get:function(){return Ne.ConnectionErrors}});Object.defineProperty(w,"ConnectionError",{enumerable:!0,get:function(){return Ne.ConnectionError}});Object.defineProperty(w,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return Ne.CancellationReceiverStrategy}});Object.defineProperty(w,"CancellationSenderStrategy",{enumerable:!0,get:function(){return Ne.CancellationSenderStrategy}});Object.defineProperty(w,"CancellationStrategy",{enumerable:!0,get:function(){return Ne.CancellationStrategy}});Object.defineProperty(w,"MessageStrategy",{enumerable:!0,get:function(){return Ne.MessageStrategy}});var tp=Kt();w.RAL=tp.default});var Tu=M(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});var bu=require("util"),jt=Fi(),Wi=class t extends jt.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return t.emptyBuffer}fromString(e,r){return Buffer.from(e,r)}toString(e,r){return e instanceof Buffer?e.toString(r):new bu.TextDecoder(r).decode(e)}asNative(e,r){return r===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,r):Buffer.from(e,0,r)}allocNative(e){return Buffer.allocUnsafe(e)}};Wi.emptyBuffer=Buffer.allocUnsafe(0);var qa=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),jt.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),jt.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),jt.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),jt.Disposable.create(()=>this.stream.off("data",e))}},Ia=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),jt.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),jt.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),jt.Disposable.create(()=>this.stream.off("end",e))}write(e,r){return new Promise((n,i)=>{let s=d=>{d==null?n():i(d)};typeof e=="string"?this.stream.write(e,r,s):this.stream.write(e,s)})}end(){this.stream.end()}},wu=Object.freeze({messageBuffer:Object.freeze({create:t=>new Wi(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(r){return Promise.reject(r)}}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new bu.TextDecoder(e.charset).decode(t)))}catch(r){return Promise.reject(r)}}})}),stream:Object.freeze({asReadableStream:t=>new qa(t),asWritableStream:t=>new Ia(t)}),console,timer:Object.freeze({setTimeout(t,e,...r){let n=setTimeout(t,e,...r);return{dispose:()=>clearTimeout(n)}},setImmediate(t,...e){let r=setImmediate(t,...e);return{dispose:()=>clearImmediate(r)}},setInterval(t,e,...r){let n=setInterval(t,e,...r);return{dispose:()=>clearInterval(n)}}})});function Aa(){return wu}(function(t){function e(){jt.RAL.install(wu)}t.install=e})(Aa||(Aa={}));La.default=Aa});var yr=M(ne=>{"use strict";var rp=ne&&ne.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),np=ne&&ne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&rp(e,t,r)};Object.defineProperty(ne,"__esModule",{value:!0});ne.createMessageConnection=ne.createServerSocketTransport=ne.createClientSocketTransport=ne.createServerPipeTransport=ne.createClientPipeTransport=ne.generateRandomPipeName=ne.StreamMessageWriter=ne.StreamMessageReader=ne.SocketMessageWriter=ne.SocketMessageReader=ne.PortMessageWriter=ne.PortMessageReader=ne.IPCMessageWriter=ne.IPCMessageReader=void 0;var mn=Tu();mn.default.install();var Ru=require("path"),ip=require("os"),sp=require("crypto"),Ui=require("net"),it=Fi();np(Fi(),ne);var $a=class extends it.AbstractMessageReader{constructor(e){super(),this.process=e;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),it.Disposable.create(()=>this.process.off("message",e))}};ne.IPCMessageReader=$a;var Fa=class extends it.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,r=>{r?(this.errorCount++,this.handleError(r,e)):this.errorCount=0}),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};ne.IPCMessageWriter=Fa;var Wa=class extends it.AbstractMessageReader{constructor(e){super(),this.onData=new it.Emitter,e.on("close",()=>this.fireClose),e.on("error",r=>this.fireError(r)),e.on("message",r=>{this.onData.fire(r)})}listen(e){return this.onData.event(e)}};ne.PortMessageReader=Wa;var Va=class extends it.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",r=>this.fireError(r))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};ne.PortMessageWriter=Va;var mr=class extends it.ReadableStreamMessageReader{constructor(e,r="utf-8"){super((0,mn.default)().stream.asReadableStream(e),r)}};ne.SocketMessageReader=mr;var gr=class extends it.WriteableStreamMessageWriter{constructor(e,r){super((0,mn.default)().stream.asWritableStream(e),r),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};ne.SocketMessageWriter=gr;var Vi=class extends it.ReadableStreamMessageReader{constructor(e,r){super((0,mn.default)().stream.asReadableStream(e),r)}};ne.StreamMessageReader=Vi;var zi=class extends it.WriteableStreamMessageWriter{constructor(e,r){super((0,mn.default)().stream.asWritableStream(e),r)}};ne.StreamMessageWriter=zi;var ku=process.env.XDG_RUNTIME_DIR,op=new Map([["linux",107],["darwin",103]]);function ap(){let t=(0,sp.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;ku?e=Ru.join(ku,`vscode-ipc-${t}.sock`):e=Ru.join(ip.tmpdir(),`vscode-${t}.sock`);let r=op.get(process.platform);return r!==void 0&&e.length>r&&(0,mn.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${r} characters.`),e}ne.generateRandomPipeName=ap;function cp(t,e="utf-8"){let r,n=new Promise((i,s)=>{r=i});return new Promise((i,s)=>{let d=(0,Ui.createServer)(h=>{d.close(),r([new mr(h,e),new gr(h,e)])});d.on("error",s),d.listen(t,()=>{d.removeListener("error",s),i({onConnected:()=>n})})})}ne.createClientPipeTransport=cp;function up(t,e="utf-8"){let r=(0,Ui.createConnection)(t);return[new mr(r,e),new gr(r,e)]}ne.createServerPipeTransport=up;function dp(t,e="utf-8"){let r,n=new Promise((i,s)=>{r=i});return new Promise((i,s)=>{let d=(0,Ui.createServer)(h=>{d.close(),r([new mr(h,e),new gr(h,e)])});d.on("error",s),d.listen(t,"127.0.0.1",()=>{d.removeListener("error",s),i({onConnected:()=>n})})})}ne.createClientSocketTransport=dp;function lp(t,e="utf-8"){let r=(0,Ui.createConnection)(t,"127.0.0.1");return[new mr(r,e),new gr(r,e)]}ne.createServerSocketTransport=lp;function fp(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function hp(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function pp(t,e,r,n){r||(r=it.NullLogger);let i=fp(t)?new Vi(t):t,s=hp(e)?new zi(e):e;return it.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,it.createMessageConnection)(i,s,r,n)}ne.createMessageConnection=pp});var za=M((zg,Su)=>{"use strict";Su.exports=yr()});var Hi=M((Cu,Bi)=>{(function(t){if(typeof Bi=="object"&&typeof Bi.exports=="object"){var e=t(require,Cu);e!==void 0&&(Bi.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],t)})(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.WorkspaceFolder=e.InlineCompletionContext=e.SelectedCompletionInfo=e.InlineCompletionTriggerKind=e.InlineCompletionList=e.InlineCompletionItem=e.StringValue=e.InlayHint=e.InlayHintLabelPart=e.InlayHintKind=e.InlineValueContext=e.InlineValueEvaluatableExpression=e.InlineValueVariableLookup=e.InlineValueText=e.SemanticTokens=e.SemanticTokenModifiers=e.SemanticTokenTypes=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionTriggerKind=e.CodeActionKind=e.DocumentSymbol=e.WorkspaceSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.CompletionItemLabelDetails=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=e.URI=e.DocumentUri=void 0;var r;(function(c){function p(m){return typeof m=="string"}c.is=p})(r||(e.DocumentUri=r={}));var n;(function(c){function p(m){return typeof m=="string"}c.is=p})(n||(e.URI=n={}));var i;(function(c){c.MIN_VALUE=-2147483648,c.MAX_VALUE=2147483647;function p(m){return typeof m=="number"&&c.MIN_VALUE<=m&&m<=c.MAX_VALUE}c.is=p})(i||(e.integer=i={}));var s;(function(c){c.MIN_VALUE=0,c.MAX_VALUE=2147483647;function p(m){return typeof m=="number"&&c.MIN_VALUE<=m&&m<=c.MAX_VALUE}c.is=p})(s||(e.uinteger=s={}));var d;(function(c){function p(u,a){return u===Number.MAX_VALUE&&(u=s.MAX_VALUE),a===Number.MAX_VALUE&&(a=s.MAX_VALUE),{line:u,character:a}}c.create=p;function m(u){var a=u;return v.objectLiteral(a)&&v.uinteger(a.line)&&v.uinteger(a.character)}c.is=m})(d||(e.Position=d={}));var h;(function(c){function p(u,a,y,k){if(v.uinteger(u)&&v.uinteger(a)&&v.uinteger(y)&&v.uinteger(k))return{start:d.create(u,a),end:d.create(y,k)};if(d.is(u)&&d.is(a))return{start:u,end:a};throw new Error("Range#create called with invalid arguments[".concat(u,", ").concat(a,", ").concat(y,", ").concat(k,"]"))}c.create=p;function m(u){var a=u;return v.objectLiteral(a)&&d.is(a.start)&&d.is(a.end)}c.is=m})(h||(e.Range=h={}));var R;(function(c){function p(u,a){return{uri:u,range:a}}c.create=p;function m(u){var a=u;return v.objectLiteral(a)&&h.is(a.range)&&(v.string(a.uri)||v.undefined(a.uri))}c.is=m})(R||(e.Location=R={}));var T;(function(c){function p(u,a,y,k){return{targetUri:u,targetRange:a,targetSelectionRange:y,originSelectionRange:k}}c.create=p;function m(u){var a=u;return v.objectLiteral(a)&&h.is(a.targetRange)&&v.string(a.targetUri)&&h.is(a.targetSelectionRange)&&(h.is(a.originSelectionRange)||v.undefined(a.originSelectionRange))}c.is=m})(T||(e.LocationLink=T={}));var P;(function(c){function p(u,a,y,k){return{red:u,green:a,blue:y,alpha:k}}c.create=p;function m(u){var a=u;return v.objectLiteral(a)&&v.numberRange(a.red,0,1)&&v.numberRange(a.green,0,1)&&v.numberRange(a.blue,0,1)&&v.numberRange(a.alpha,0,1)}c.is=m})(P||(e.Color=P={}));var Z;(function(c){function p(u,a){return{range:u,color:a}}c.create=p;function m(u){var a=u;return v.objectLiteral(a)&&h.is(a.range)&&P.is(a.color)}c.is=m})(Z||(e.ColorInformation=Z={}));var se;(function(c){function p(u,a,y){return{label:u,textEdit:a,additionalTextEdits:y}}c.create=p;function m(u){var a=u;return v.objectLiteral(a)&&v.string(a.label)&&(v.undefined(a.textEdit)||$.is(a))&&(v.undefined(a.additionalTextEdits)||v.typedArray(a.additionalTextEdits,$.is))}c.is=m})(se||(e.ColorPresentation=se={}));var ce;(function(c){c.Comment="comment",c.Imports="imports",c.Region="region"})(ce||(e.FoldingRangeKind=ce={}));var Ue;(function(c){function p(u,a,y,k,J,Ce){var le={startLine:u,endLine:a};return v.defined(y)&&(le.startCharacter=y),v.defined(k)&&(le.endCharacter=k),v.defined(J)&&(le.kind=J),v.defined(Ce)&&(le.collapsedText=Ce),le}c.create=p;function m(u){var a=u;return v.objectLiteral(a)&&v.uinteger(a.startLine)&&v.uinteger(a.startLine)&&(v.undefined(a.startCharacter)||v.uinteger(a.startCharacter))&&(v.undefined(a.endCharacter)||v.uinteger(a.endCharacter))&&(v.undefined(a.kind)||v.string(a.kind))}c.is=m})(Ue||(e.FoldingRange=Ue={}));var Se;(function(c){function p(u,a){return{location:u,message:a}}c.create=p;function m(u){var a=u;return v.defined(a)&&R.is(a.location)&&v.string(a.message)}c.is=m})(Se||(e.DiagnosticRelatedInformation=Se={}));var we;(function(c){c.Error=1,c.Warning=2,c.Information=3,c.Hint=4})(we||(e.DiagnosticSeverity=we={}));var ue;(function(c){c.Unnecessary=1,c.Deprecated=2})(ue||(e.DiagnosticTag=ue={}));var de;(function(c){function p(m){var u=m;return v.objectLiteral(u)&&v.string(u.href)}c.is=p})(de||(e.CodeDescription=de={}));var O;(function(c){function p(u,a,y,k,J,Ce){var le={range:u,message:a};return v.defined(y)&&(le.severity=y),v.defined(k)&&(le.code=k),v.defined(J)&&(le.source=J),v.defined(Ce)&&(le.relatedInformation=Ce),le}c.create=p;function m(u){var a,y=u;return v.defined(y)&&h.is(y.range)&&v.string(y.message)&&(v.number(y.severity)||v.undefined(y.severity))&&(v.integer(y.code)||v.string(y.code)||v.undefined(y.code))&&(v.undefined(y.codeDescription)||v.string((a=y.codeDescription)===null||a===void 0?void 0:a.href))&&(v.string(y.source)||v.undefined(y.source))&&(v.undefined(y.relatedInformation)||v.typedArray(y.relatedInformation,Se.is))}c.is=m})(O||(e.Diagnostic=O={}));var pe;(function(c){function p(u,a){for(var y=[],k=2;k<arguments.length;k++)y[k-2]=arguments[k];var J={title:u,command:a};return v.defined(y)&&y.length>0&&(J.arguments=y),J}c.create=p;function m(u){var a=u;return v.defined(a)&&v.string(a.title)&&v.string(a.command)}c.is=m})(pe||(e.Command=pe={}));var $;(function(c){function p(y,k){return{range:y,newText:k}}c.replace=p;function m(y,k){return{range:{start:y,end:y},newText:k}}c.insert=m;function u(y){return{range:y,newText:""}}c.del=u;function a(y){var k=y;return v.objectLiteral(k)&&v.string(k.newText)&&h.is(k.range)}c.is=a})($||(e.TextEdit=$={}));var ye;(function(c){function p(u,a,y){var k={label:u};return a!==void 0&&(k.needsConfirmation=a),y!==void 0&&(k.description=y),k}c.create=p;function m(u){var a=u;return v.objectLiteral(a)&&v.string(a.label)&&(v.boolean(a.needsConfirmation)||a.needsConfirmation===void 0)&&(v.string(a.description)||a.description===void 0)}c.is=m})(ye||(e.ChangeAnnotation=ye={}));var ve;(function(c){function p(m){var u=m;return v.string(u)}c.is=p})(ve||(e.ChangeAnnotationIdentifier=ve={}));var Be;(function(c){function p(y,k,J){return{range:y,newText:k,annotationId:J}}c.replace=p;function m(y,k,J){return{range:{start:y,end:y},newText:k,annotationId:J}}c.insert=m;function u(y,k){return{range:y,newText:"",annotationId:k}}c.del=u;function a(y){var k=y;return $.is(k)&&(ye.is(k.annotationId)||ve.is(k.annotationId))}c.is=a})(Be||(e.AnnotatedTextEdit=Be={}));var _t;(function(c){function p(u,a){return{textDocument:u,edits:a}}c.create=p;function m(u){var a=u;return v.defined(a)&&bt.is(a.textDocument)&&Array.isArray(a.edits)}c.is=m})(_t||(e.TextDocumentEdit=_t={}));var lt;(function(c){function p(u,a,y){var k={kind:"create",uri:u};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(k.options=a),y!==void 0&&(k.annotationId=y),k}c.create=p;function m(u){var a=u;return a&&a.kind==="create"&&v.string(a.uri)&&(a.options===void 0||(a.options.overwrite===void 0||v.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||v.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||ve.is(a.annotationId))}c.is=m})(lt||(e.CreateFile=lt={}));var ft;(function(c){function p(u,a,y,k){var J={kind:"rename",oldUri:u,newUri:a};return y!==void 0&&(y.overwrite!==void 0||y.ignoreIfExists!==void 0)&&(J.options=y),k!==void 0&&(J.annotationId=k),J}c.create=p;function m(u){var a=u;return a&&a.kind==="rename"&&v.string(a.oldUri)&&v.string(a.newUri)&&(a.options===void 0||(a.options.overwrite===void 0||v.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||v.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||ve.is(a.annotationId))}c.is=m})(ft||(e.RenameFile=ft={}));var Te;(function(c){function p(u,a,y){var k={kind:"delete",uri:u};return a!==void 0&&(a.recursive!==void 0||a.ignoreIfNotExists!==void 0)&&(k.options=a),y!==void 0&&(k.annotationId=y),k}c.create=p;function m(u){var a=u;return a&&a.kind==="delete"&&v.string(a.uri)&&(a.options===void 0||(a.options.recursive===void 0||v.boolean(a.options.recursive))&&(a.options.ignoreIfNotExists===void 0||v.boolean(a.options.ignoreIfNotExists)))&&(a.annotationId===void 0||ve.is(a.annotationId))}c.is=m})(Te||(e.DeleteFile=Te={}));var Dt;(function(c){function p(m){var u=m;return u&&(u.changes!==void 0||u.documentChanges!==void 0)&&(u.documentChanges===void 0||u.documentChanges.every(function(a){return v.string(a.kind)?lt.is(a)||ft.is(a)||Te.is(a):_t.is(a)}))}c.is=p})(Dt||(e.WorkspaceEdit=Dt={}));var Ft=function(){function c(p,m){this.edits=p,this.changeAnnotations=m}return c.prototype.insert=function(p,m,u){var a,y;if(u===void 0?a=$.insert(p,m):ve.is(u)?(y=u,a=Be.insert(p,m,u)):(this.assertChangeAnnotations(this.changeAnnotations),y=this.changeAnnotations.manage(u),a=Be.insert(p,m,y)),this.edits.push(a),y!==void 0)return y},c.prototype.replace=function(p,m,u){var a,y;if(u===void 0?a=$.replace(p,m):ve.is(u)?(y=u,a=Be.replace(p,m,u)):(this.assertChangeAnnotations(this.changeAnnotations),y=this.changeAnnotations.manage(u),a=Be.replace(p,m,y)),this.edits.push(a),y!==void 0)return y},c.prototype.delete=function(p,m){var u,a;if(m===void 0?u=$.del(p):ve.is(m)?(a=m,u=Be.del(p,m)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(m),u=Be.del(p,a)),this.edits.push(u),a!==void 0)return a},c.prototype.add=function(p){this.edits.push(p)},c.prototype.all=function(){return this.edits},c.prototype.clear=function(){this.edits.splice(0,this.edits.length)},c.prototype.assertChangeAnnotations=function(p){if(p===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},c}(),Ir=function(){function c(p){this._annotations=p===void 0?Object.create(null):p,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(p,m){var u;if(ve.is(p)?u=p:(u=this.nextId(),m=p),this._annotations[u]!==void 0)throw new Error("Id ".concat(u," is already in use."));if(m===void 0)throw new Error("No annotation provided for id ".concat(u));return this._annotations[u]=m,this._size++,u},c.prototype.nextId=function(){return this._counter++,this._counter.toString()},c}(),In=function(){function c(p){var m=this;this._textEditChanges=Object.create(null),p!==void 0?(this._workspaceEdit=p,p.documentChanges?(this._changeAnnotations=new Ir(p.changeAnnotations),p.changeAnnotations=this._changeAnnotations.all(),p.documentChanges.forEach(function(u){if(_t.is(u)){var a=new Ft(u.edits,m._changeAnnotations);m._textEditChanges[u.textDocument.uri]=a}})):p.changes&&Object.keys(p.changes).forEach(function(u){var a=new Ft(p.changes[u]);m._textEditChanges[u]=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(p){if(bt.is(p)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m={uri:p.uri,version:p.version},u=this._textEditChanges[m.uri];if(!u){var a=[],y={textDocument:m,edits:a};this._workspaceEdit.documentChanges.push(y),u=new Ft(a,this._changeAnnotations),this._textEditChanges[m.uri]=u}return u}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var u=this._textEditChanges[p];if(!u){var a=[];this._workspaceEdit.changes[p]=a,u=new Ft(a),this._textEditChanges[p]=u}return u}},c.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Ir,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(p,m,u){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var a;ye.is(m)||ve.is(m)?a=m:u=m;var y,k;if(a===void 0?y=lt.create(p,u):(k=ve.is(a)?a:this._changeAnnotations.manage(a),y=lt.create(p,u,k)),this._workspaceEdit.documentChanges.push(y),k!==void 0)return k},c.prototype.renameFile=function(p,m,u,a){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var y;ye.is(u)||ve.is(u)?y=u:a=u;var k,J;if(y===void 0?k=ft.create(p,m,a):(J=ve.is(y)?y:this._changeAnnotations.manage(y),k=ft.create(p,m,a,J)),this._workspaceEdit.documentChanges.push(k),J!==void 0)return J},c.prototype.deleteFile=function(p,m,u){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var a;ye.is(m)||ve.is(m)?a=m:u=m;var y,k;if(a===void 0?y=Te.create(p,u):(k=ve.is(a)?a:this._changeAnnotations.manage(a),y=Te.create(p,u,k)),this._workspaceEdit.documentChanges.push(y),k!==void 0)return k},c}();e.WorkspaceChange=In;var Ar;(function(c){function p(u){return{uri:u}}c.create=p;function m(u){var a=u;return v.defined(a)&&v.string(a.uri)}c.is=m})(Ar||(e.TextDocumentIdentifier=Ar={}));var Wt;(function(c){function p(u,a){return{uri:u,version:a}}c.create=p;function m(u){var a=u;return v.defined(a)&&v.string(a.uri)&&v.integer(a.version)}c.is=m})(Wt||(e.VersionedTextDocumentIdentifier=Wt={}));var bt;(function(c){function p(u,a){return{uri:u,version:a}}c.create=p;function m(u){var a=u;return v.defined(a)&&v.string(a.uri)&&(a.version===null||v.integer(a.version))}c.is=m})(bt||(e.OptionalVersionedTextDocumentIdentifier=bt={}));var je;(function(c){function p(u,a,y,k){return{uri:u,languageId:a,version:y,text:k}}c.create=p;function m(u){var a=u;return v.defined(a)&&v.string(a.uri)&&v.string(a.languageId)&&v.integer(a.version)&&v.string(a.text)}c.is=m})(je||(e.TextDocumentItem=je={}));var Et;(function(c){c.PlainText="plaintext",c.Markdown="markdown";function p(m){var u=m;return u===c.PlainText||u===c.Markdown}c.is=p})(Et||(e.MarkupKind=Et={}));var Ot;(function(c){function p(m){var u=m;return v.objectLiteral(m)&&Et.is(u.kind)&&v.string(u.value)}c.is=p})(Ot||(e.MarkupContent=Ot={}));var Lr;(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})(Lr||(e.CompletionItemKind=Lr={}));var Vt;(function(c){c.PlainText=1,c.Snippet=2})(Vt||(e.InsertTextFormat=Vt={}));var zt;(function(c){c.Deprecated=1})(zt||(e.CompletionItemTag=zt={}));var $r;(function(c){function p(u,a,y){return{newText:u,insert:a,replace:y}}c.create=p;function m(u){var a=u;return a&&v.string(a.newText)&&h.is(a.insert)&&h.is(a.replace)}c.is=m})($r||(e.InsertReplaceEdit=$r={}));var Fr;(function(c){c.asIs=1,c.adjustIndentation=2})(Fr||(e.InsertTextMode=Fr={}));var Wr;(function(c){function p(m){var u=m;return u&&(v.string(u.detail)||u.detail===void 0)&&(v.string(u.description)||u.description===void 0)}c.is=p})(Wr||(e.CompletionItemLabelDetails=Wr={}));var Vr;(function(c){function p(m){return{label:m}}c.create=p})(Vr||(e.CompletionItem=Vr={}));var zr;(function(c){function p(m,u){return{items:m||[],isIncomplete:!!u}}c.create=p})(zr||(e.CompletionList=zr={}));var Ut;(function(c){function p(u){return u.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}c.fromPlainText=p;function m(u){var a=u;return v.string(a)||v.objectLiteral(a)&&v.string(a.language)&&v.string(a.value)}c.is=m})(Ut||(e.MarkedString=Ut={}));var xe;(function(c){function p(m){var u=m;return!!u&&v.objectLiteral(u)&&(Ot.is(u.contents)||Ut.is(u.contents)||v.typedArray(u.contents,Ut.is))&&(m.range===void 0||h.is(m.range))}c.is=p})(xe||(e.Hover=xe={}));var Ur;(function(c){function p(m,u){return u?{label:m,documentation:u}:{label:m}}c.create=p})(Ur||(e.ParameterInformation=Ur={}));var Br;(function(c){function p(m,u){for(var a=[],y=2;y<arguments.length;y++)a[y-2]=arguments[y];var k={label:m};return v.defined(u)&&(k.documentation=u),v.defined(a)?k.parameters=a:k.parameters=[],k}c.create=p})(Br||(e.SignatureInformation=Br={}));var st;(function(c){c.Text=1,c.Read=2,c.Write=3})(st||(e.DocumentHighlightKind=st={}));var Hr;(function(c){function p(m,u){var a={range:m};return v.number(u)&&(a.kind=u),a}c.create=p})(Hr||(e.DocumentHighlight=Hr={}));var wt;(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})(wt||(e.SymbolKind=wt={}));var Zr;(function(c){c.Deprecated=1})(Zr||(e.SymbolTag=Zr={}));var qe;(function(c){function p(m,u,a,y,k){var J={name:m,kind:u,location:{uri:y,range:a}};return k&&(J.containerName=k),J}c.create=p})(qe||(e.SymbolInformation=qe={}));var He;(function(c){function p(m,u,a,y){return y!==void 0?{name:m,kind:u,location:{uri:a,range:y}}:{name:m,kind:u,location:{uri:a}}}c.create=p})(He||(e.WorkspaceSymbol=He={}));var Jr;(function(c){function p(u,a,y,k,J,Ce){var le={name:u,detail:a,kind:y,range:k,selectionRange:J};return Ce!==void 0&&(le.children=Ce),le}c.create=p;function m(u){var a=u;return a&&v.string(a.name)&&v.number(a.kind)&&h.is(a.range)&&h.is(a.selectionRange)&&(a.detail===void 0||v.string(a.detail))&&(a.deprecated===void 0||v.boolean(a.deprecated))&&(a.children===void 0||Array.isArray(a.children))&&(a.tags===void 0||Array.isArray(a.tags))}c.is=m})(Jr||(e.DocumentSymbol=Jr={}));var Gr;(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"})(Gr||(e.CodeActionKind=Gr={}));var Ie;(function(c){c.Invoked=1,c.Automatic=2})(Ie||(e.CodeActionTriggerKind=Ie={}));var Bt;(function(c){function p(u,a,y){var k={diagnostics:u};return a!=null&&(k.only=a),y!=null&&(k.triggerKind=y),k}c.create=p;function m(u){var a=u;return v.defined(a)&&v.typedArray(a.diagnostics,O.is)&&(a.only===void 0||v.typedArray(a.only,v.string))&&(a.triggerKind===void 0||a.triggerKind===Ie.Invoked||a.triggerKind===Ie.Automatic)}c.is=m})(Bt||(e.CodeActionContext=Bt={}));var Ht;(function(c){function p(u,a,y){var k={title:u},J=!0;return typeof a=="string"?(J=!1,k.kind=a):pe.is(a)?k.command=a:k.edit=a,J&&y!==void 0&&(k.kind=y),k}c.create=p;function m(u){var a=u;return a&&v.string(a.title)&&(a.diagnostics===void 0||v.typedArray(a.diagnostics,O.is))&&(a.kind===void 0||v.string(a.kind))&&(a.edit!==void 0||a.command!==void 0)&&(a.command===void 0||pe.is(a.command))&&(a.isPreferred===void 0||v.boolean(a.isPreferred))&&(a.edit===void 0||Dt.is(a.edit))}c.is=m})(Ht||(e.CodeAction=Ht={}));var Tt;(function(c){function p(u,a){var y={range:u};return v.defined(a)&&(y.data=a),y}c.create=p;function m(u){var a=u;return v.defined(a)&&h.is(a.range)&&(v.undefined(a.command)||pe.is(a.command))}c.is=m})(Tt||(e.CodeLens=Tt={}));var Zt;(function(c){function p(u,a){return{tabSize:u,insertSpaces:a}}c.create=p;function m(u){var a=u;return v.defined(a)&&v.uinteger(a.tabSize)&&v.boolean(a.insertSpaces)}c.is=m})(Zt||(e.FormattingOptions=Zt={}));var Ae;(function(c){function p(u,a,y){return{range:u,target:a,data:y}}c.create=p;function m(u){var a=u;return v.defined(a)&&h.is(a.range)&&(v.undefined(a.target)||v.string(a.target))}c.is=m})(Ae||(e.DocumentLink=Ae={}));var o;(function(c){function p(u,a){return{range:u,parent:a}}c.create=p;function m(u){var a=u;return v.objectLiteral(a)&&h.is(a.range)&&(a.parent===void 0||c.is(a.parent))}c.is=m})(o||(e.SelectionRange=o={}));var f;(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"})(f||(e.SemanticTokenTypes=f={}));var g;(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"})(g||(e.SemanticTokenModifiers=g={}));var _;(function(c){function p(m){var u=m;return v.objectLiteral(u)&&(u.resultId===void 0||typeof u.resultId=="string")&&Array.isArray(u.data)&&(u.data.length===0||typeof u.data[0]=="number")}c.is=p})(_||(e.SemanticTokens=_={}));var L;(function(c){function p(u,a){return{range:u,text:a}}c.create=p;function m(u){var a=u;return a!=null&&h.is(a.range)&&v.string(a.text)}c.is=m})(L||(e.InlineValueText=L={}));var q;(function(c){function p(u,a,y){return{range:u,variableName:a,caseSensitiveLookup:y}}c.create=p;function m(u){var a=u;return a!=null&&h.is(a.range)&&v.boolean(a.caseSensitiveLookup)&&(v.string(a.variableName)||a.variableName===void 0)}c.is=m})(q||(e.InlineValueVariableLookup=q={}));var B;(function(c){function p(u,a){return{range:u,expression:a}}c.create=p;function m(u){var a=u;return a!=null&&h.is(a.range)&&(v.string(a.expression)||a.expression===void 0)}c.is=m})(B||(e.InlineValueEvaluatableExpression=B={}));var H;(function(c){function p(u,a){return{frameId:u,stoppedLocation:a}}c.create=p;function m(u){var a=u;return v.defined(a)&&h.is(u.stoppedLocation)}c.is=m})(H||(e.InlineValueContext=H={}));var D;(function(c){c.Type=1,c.Parameter=2;function p(m){return m===1||m===2}c.is=p})(D||(e.InlayHintKind=D={}));var F;(function(c){function p(u){return{value:u}}c.create=p;function m(u){var a=u;return v.objectLiteral(a)&&(a.tooltip===void 0||v.string(a.tooltip)||Ot.is(a.tooltip))&&(a.location===void 0||R.is(a.location))&&(a.command===void 0||pe.is(a.command))}c.is=m})(F||(e.InlayHintLabelPart=F={}));var N;(function(c){function p(u,a,y){var k={position:u,label:a};return y!==void 0&&(k.kind=y),k}c.create=p;function m(u){var a=u;return v.objectLiteral(a)&&d.is(a.position)&&(v.string(a.label)||v.typedArray(a.label,F.is))&&(a.kind===void 0||D.is(a.kind))&&a.textEdits===void 0||v.typedArray(a.textEdits,$.is)&&(a.tooltip===void 0||v.string(a.tooltip)||Ot.is(a.tooltip))&&(a.paddingLeft===void 0||v.boolean(a.paddingLeft))&&(a.paddingRight===void 0||v.boolean(a.paddingRight))}c.is=m})(N||(e.InlayHint=N={}));var X;(function(c){function p(m){return{kind:"snippet",value:m}}c.createSnippet=p})(X||(e.StringValue=X={}));var ie;(function(c){function p(m,u,a,y){return{insertText:m,filterText:u,range:a,command:y}}c.create=p})(ie||(e.InlineCompletionItem=ie={}));var _e;(function(c){function p(m){return{items:m}}c.create=p})(_e||(e.InlineCompletionList=_e={}));var Qr;(function(c){c.Invoked=0,c.Automatic=1})(Qr||(e.InlineCompletionTriggerKind=Qr={}));var pc;(function(c){function p(m,u){return{range:m,text:u}}c.create=p})(pc||(e.SelectedCompletionInfo=pc={}));var mc;(function(c){function p(m,u){return{triggerKind:m,selectedCompletionInfo:u}}c.create=p})(mc||(e.InlineCompletionContext=mc={}));var gc;(function(c){function p(m){var u=m;return v.objectLiteral(u)&&n.is(u.uri)&&v.string(u.name)}c.is=p})(gc||(e.WorkspaceFolder=gc={})),e.EOL=[`
63
63
  `,`\r
64
- `,"\r"];var yc;(function(c){function p(y,k,J,Ce){return new Zf(y,k,J,Ce)}c.create=p;function m(y){var k=y;return!!(v.defined(k)&&v.string(k.uri)&&(v.undefined(k.languageId)||v.string(k.languageId))&&v.uinteger(k.lineCount)&&v.func(k.getText)&&v.func(k.positionAt)&&v.func(k.offsetAt))}c.is=m;function u(y,k){for(var J=y.getText(),Ce=a(k,function(Xr,ri){var vc=Xr.range.start.line-ri.range.start.line;return vc===0?Xr.range.start.character-ri.range.start.character:vc}),fe=J.length,ht=Ce.length-1;ht>=0;ht--){var pt=Ce[ht],Nt=y.offsetAt(pt.range.start),te=y.offsetAt(pt.range.end);if(te<=fe)J=J.substring(0,Nt)+pt.newText+J.substring(te,J.length);else throw new Error("Overlapping edit");fe=Nt}return J}c.applyEdits=u;function a(y,k){if(y.length<=1)return y;var J=y.length/2|0,Ce=y.slice(0,J),fe=y.slice(J);a(Ce,k),a(fe,k);for(var ht=0,pt=0,Nt=0;ht<Ce.length&&pt<fe.length;){var te=k(Ce[ht],fe[pt]);te<=0?y[Nt++]=Ce[ht++]:y[Nt++]=fe[pt++]}for(;ht<Ce.length;)y[Nt++]=Ce[ht++];for(;pt<fe.length;)y[Nt++]=fe[pt++];return y}})(yc||(e.TextDocument=yc={}));var Zf=function(){function c(p,m,u,a){this._uri=p,this._languageId=m,this._version=u,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(p){if(p){var m=this.offsetAt(p.start),u=this.offsetAt(p.end);return this._content.substring(m,u)}return this._content},c.prototype.update=function(p,m){this._content=p.text,this._version=m,this._lineOffsets=void 0},c.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var p=[],m=this._content,u=!0,a=0;a<m.length;a++){u&&(p.push(a),u=!1);var y=m.charAt(a);u=y==="\r"||y===`
64
+ `,"\r"];var yc;(function(c){function p(y,k,J,Ce){return new Zf(y,k,J,Ce)}c.create=p;function m(y){var k=y;return!!(v.defined(k)&&v.string(k.uri)&&(v.undefined(k.languageId)||v.string(k.languageId))&&v.uinteger(k.lineCount)&&v.func(k.getText)&&v.func(k.positionAt)&&v.func(k.offsetAt))}c.is=m;function u(y,k){for(var J=y.getText(),Ce=a(k,function(Xr,ri){var vc=Xr.range.start.line-ri.range.start.line;return vc===0?Xr.range.start.character-ri.range.start.character:vc}),le=J.length,ht=Ce.length-1;ht>=0;ht--){var pt=Ce[ht],Nt=y.offsetAt(pt.range.start),te=y.offsetAt(pt.range.end);if(te<=le)J=J.substring(0,Nt)+pt.newText+J.substring(te,J.length);else throw new Error("Overlapping edit");le=Nt}return J}c.applyEdits=u;function a(y,k){if(y.length<=1)return y;var J=y.length/2|0,Ce=y.slice(0,J),le=y.slice(J);a(Ce,k),a(le,k);for(var ht=0,pt=0,Nt=0;ht<Ce.length&&pt<le.length;){var te=k(Ce[ht],le[pt]);te<=0?y[Nt++]=Ce[ht++]:y[Nt++]=le[pt++]}for(;ht<Ce.length;)y[Nt++]=Ce[ht++];for(;pt<le.length;)y[Nt++]=le[pt++];return y}})(yc||(e.TextDocument=yc={}));var Zf=function(){function c(p,m,u,a){this._uri=p,this._languageId=m,this._version=u,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(p){if(p){var m=this.offsetAt(p.start),u=this.offsetAt(p.end);return this._content.substring(m,u)}return this._content},c.prototype.update=function(p,m){this._content=p.text,this._version=m,this._lineOffsets=void 0},c.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var p=[],m=this._content,u=!0,a=0;a<m.length;a++){u&&(p.push(a),u=!1);var y=m.charAt(a);u=y==="\r"||y===`
65
65
  `,y==="\r"&&a+1<m.length&&m.charAt(a+1)===`
66
- `&&a++}u&&m.length>0&&p.push(m.length),this._lineOffsets=p}return this._lineOffsets},c.prototype.positionAt=function(p){p=Math.max(Math.min(p,this._content.length),0);var m=this.getLineOffsets(),u=0,a=m.length;if(a===0)return d.create(0,p);for(;u<a;){var y=Math.floor((u+a)/2);m[y]>p?a=y:u=y+1}var k=u-1;return d.create(k,p-m[k])},c.prototype.offsetAt=function(p){var m=this.getLineOffsets();if(p.line>=m.length)return this._content.length;if(p.line<0)return 0;var u=m[p.line],a=p.line+1<m.length?m[p.line+1]:this._content.length;return Math.max(Math.min(u+p.character,a),u)},Object.defineProperty(c.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),c}(),v;(function(c){var p=Object.prototype.toString;function m(te){return typeof te<"u"}c.defined=m;function u(te){return typeof te>"u"}c.undefined=u;function a(te){return te===!0||te===!1}c.boolean=a;function y(te){return p.call(te)==="[object String]"}c.string=y;function k(te){return p.call(te)==="[object Number]"}c.number=k;function J(te,Xr,ri){return p.call(te)==="[object Number]"&&Xr<=te&&te<=ri}c.numberRange=J;function Ce(te){return p.call(te)==="[object Number]"&&-2147483648<=te&&te<=2147483647}c.integer=Ce;function fe(te){return p.call(te)==="[object Number]"&&0<=te&&te<=2147483647}c.uinteger=fe;function ht(te){return p.call(te)==="[object Function]"}c.func=ht;function pt(te){return te!==null&&typeof te=="object"}c.objectLiteral=pt;function Nt(te,Xr){return Array.isArray(te)&&te.every(Xr)}c.typedArray=Nt})(v||(v={}))})});var be=M(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.ProtocolNotificationType=Ge.ProtocolNotificationType0=Ge.ProtocolRequestType=Ge.ProtocolRequestType0=Ge.RegistrationType=Ge.MessageDirection=void 0;var gn=yr(),Pu;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(Pu||(Ge.MessageDirection=Pu={}));var Ua=class{constructor(e){this.method=e}};Ge.RegistrationType=Ua;var Ba=class extends gn.RequestType0{constructor(e){super(e)}};Ge.ProtocolRequestType0=Ba;var Ha=class extends gn.RequestType{constructor(e){super(e,gn.ParameterStructures.byName)}};Ge.ProtocolRequestType=Ha;var Za=class extends gn.NotificationType0{constructor(e){super(e)}};Ge.ProtocolNotificationType0=Za;var Ja=class extends gn.NotificationType{constructor(e){super(e,gn.ParameterStructures.byName)}};Ge.ProtocolNotificationType=Ja});var Zi=M(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.objectLiteral=De.typedArray=De.stringArray=De.array=De.func=De.error=De.number=De.string=De.boolean=void 0;function mp(t){return t===!0||t===!1}De.boolean=mp;function xu(t){return typeof t=="string"||t instanceof String}De.string=xu;function gp(t){return typeof t=="number"||t instanceof Number}De.number=gp;function yp(t){return t instanceof Error}De.error=yp;function vp(t){return typeof t=="function"}De.func=vp;function Du(t){return Array.isArray(t)}De.array=Du;function _p(t){return Du(t)&&t.every(e=>xu(e))}De.stringArray=_p;function bp(t,e){return Array.isArray(t)&&t.every(e)}De.typedArray=bp;function wp(t){return t!==null&&typeof t=="object"}De.objectLiteral=wp});var Nu=M(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.ImplementationRequest=void 0;var Eu=be(),Ou;(function(t){t.method="textDocument/implementation",t.messageDirection=Eu.MessageDirection.clientToServer,t.type=new Eu.ProtocolRequestType(t.method)})(Ou||(Ji.ImplementationRequest=Ou={}))});var qu=M(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.TypeDefinitionRequest=void 0;var Mu=be(),ju;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=Mu.MessageDirection.clientToServer,t.type=new Mu.ProtocolRequestType(t.method)})(ju||(Gi.TypeDefinitionRequest=ju={}))});var Lu=M(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.DidChangeWorkspaceFoldersNotification=yn.WorkspaceFoldersRequest=void 0;var Qi=be(),Iu;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=Qi.MessageDirection.serverToClient,t.type=new Qi.ProtocolRequestType0(t.method)})(Iu||(yn.WorkspaceFoldersRequest=Iu={}));var Au;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=Qi.MessageDirection.clientToServer,t.type=new Qi.ProtocolNotificationType(t.method)})(Au||(yn.DidChangeWorkspaceFoldersNotification=Au={}))});var Wu=M(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.ConfigurationRequest=void 0;var $u=be(),Fu;(function(t){t.method="workspace/configuration",t.messageDirection=$u.MessageDirection.serverToClient,t.type=new $u.ProtocolRequestType(t.method)})(Fu||(Xi.ConfigurationRequest=Fu={}))});var Uu=M(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.ColorPresentationRequest=vn.DocumentColorRequest=void 0;var Yi=be(),Vu;(function(t){t.method="textDocument/documentColor",t.messageDirection=Yi.MessageDirection.clientToServer,t.type=new Yi.ProtocolRequestType(t.method)})(Vu||(vn.DocumentColorRequest=Vu={}));var zu;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=Yi.MessageDirection.clientToServer,t.type=new Yi.ProtocolRequestType(t.method)})(zu||(vn.ColorPresentationRequest=zu={}))});var Zu=M(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.FoldingRangeRefreshRequest=_n.FoldingRangeRequest=void 0;var Ki=be(),Bu;(function(t){t.method="textDocument/foldingRange",t.messageDirection=Ki.MessageDirection.clientToServer,t.type=new Ki.ProtocolRequestType(t.method)})(Bu||(_n.FoldingRangeRequest=Bu={}));var Hu;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=Ki.MessageDirection.serverToClient,t.type=new Ki.ProtocolRequestType0(t.method)})(Hu||(_n.FoldingRangeRefreshRequest=Hu={}))});var Qu=M(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.DeclarationRequest=void 0;var Ju=be(),Gu;(function(t){t.method="textDocument/declaration",t.messageDirection=Ju.MessageDirection.clientToServer,t.type=new Ju.ProtocolRequestType(t.method)})(Gu||(es.DeclarationRequest=Gu={}))});var Ku=M(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.SelectionRangeRequest=void 0;var Xu=be(),Yu;(function(t){t.method="textDocument/selectionRange",t.messageDirection=Xu.MessageDirection.clientToServer,t.type=new Xu.ProtocolRequestType(t.method)})(Yu||(ts.SelectionRangeRequest=Yu={}))});var nd=M(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.WorkDoneProgressCancelNotification=rr.WorkDoneProgressCreateRequest=rr.WorkDoneProgress=void 0;var Tp=yr(),rs=be(),ed;(function(t){t.type=new Tp.ProgressType;function e(r){return r===t.type}t.is=e})(ed||(rr.WorkDoneProgress=ed={}));var td;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=rs.MessageDirection.serverToClient,t.type=new rs.ProtocolRequestType(t.method)})(td||(rr.WorkDoneProgressCreateRequest=td={}));var rd;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=rs.MessageDirection.clientToServer,t.type=new rs.ProtocolNotificationType(t.method)})(rd||(rr.WorkDoneProgressCancelNotification=rd={}))});var ad=M(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.CallHierarchyOutgoingCallsRequest=nr.CallHierarchyIncomingCallsRequest=nr.CallHierarchyPrepareRequest=void 0;var bn=be(),id;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=bn.MessageDirection.clientToServer,t.type=new bn.ProtocolRequestType(t.method)})(id||(nr.CallHierarchyPrepareRequest=id={}));var sd;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=bn.MessageDirection.clientToServer,t.type=new bn.ProtocolRequestType(t.method)})(sd||(nr.CallHierarchyIncomingCallsRequest=sd={}));var od;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=bn.MessageDirection.clientToServer,t.type=new bn.ProtocolRequestType(t.method)})(od||(nr.CallHierarchyOutgoingCallsRequest=od={}))});var hd=M(Qe=>{"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});Qe.SemanticTokensRefreshRequest=Qe.SemanticTokensRangeRequest=Qe.SemanticTokensDeltaRequest=Qe.SemanticTokensRequest=Qe.SemanticTokensRegistrationType=Qe.TokenFormat=void 0;var qt=be(),cd;(function(t){t.Relative="relative"})(cd||(Qe.TokenFormat=cd={}));var Gn;(function(t){t.method="textDocument/semanticTokens",t.type=new qt.RegistrationType(t.method)})(Gn||(Qe.SemanticTokensRegistrationType=Gn={}));var ud;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=qt.MessageDirection.clientToServer,t.type=new qt.ProtocolRequestType(t.method),t.registrationMethod=Gn.method})(ud||(Qe.SemanticTokensRequest=ud={}));var dd;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=qt.MessageDirection.clientToServer,t.type=new qt.ProtocolRequestType(t.method),t.registrationMethod=Gn.method})(dd||(Qe.SemanticTokensDeltaRequest=dd={}));var ld;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=qt.MessageDirection.clientToServer,t.type=new qt.ProtocolRequestType(t.method),t.registrationMethod=Gn.method})(ld||(Qe.SemanticTokensRangeRequest=ld={}));var fd;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=qt.MessageDirection.serverToClient,t.type=new qt.ProtocolRequestType0(t.method)})(fd||(Qe.SemanticTokensRefreshRequest=fd={}))});var gd=M(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.ShowDocumentRequest=void 0;var pd=be(),md;(function(t){t.method="window/showDocument",t.messageDirection=pd.MessageDirection.serverToClient,t.type=new pd.ProtocolRequestType(t.method)})(md||(ns.ShowDocumentRequest=md={}))});var _d=M(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.LinkedEditingRangeRequest=void 0;var yd=be(),vd;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=yd.MessageDirection.clientToServer,t.type=new yd.ProtocolRequestType(t.method)})(vd||(is.LinkedEditingRangeRequest=vd={}))});var Pd=M(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.WillDeleteFilesRequest=Ve.DidDeleteFilesNotification=Ve.DidRenameFilesNotification=Ve.WillRenameFilesRequest=Ve.DidCreateFilesNotification=Ve.WillCreateFilesRequest=Ve.FileOperationPatternKind=void 0;var ot=be(),bd;(function(t){t.file="file",t.folder="folder"})(bd||(Ve.FileOperationPatternKind=bd={}));var wd;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=ot.MessageDirection.clientToServer,t.type=new ot.ProtocolRequestType(t.method)})(wd||(Ve.WillCreateFilesRequest=wd={}));var Td;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=ot.MessageDirection.clientToServer,t.type=new ot.ProtocolNotificationType(t.method)})(Td||(Ve.DidCreateFilesNotification=Td={}));var Rd;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=ot.MessageDirection.clientToServer,t.type=new ot.ProtocolRequestType(t.method)})(Rd||(Ve.WillRenameFilesRequest=Rd={}));var kd;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=ot.MessageDirection.clientToServer,t.type=new ot.ProtocolNotificationType(t.method)})(kd||(Ve.DidRenameFilesNotification=kd={}));var Sd;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=ot.MessageDirection.clientToServer,t.type=new ot.ProtocolNotificationType(t.method)})(Sd||(Ve.DidDeleteFilesNotification=Sd={}));var Cd;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=ot.MessageDirection.clientToServer,t.type=new ot.ProtocolRequestType(t.method)})(Cd||(Ve.WillDeleteFilesRequest=Cd={}))});var Nd=M(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.MonikerRequest=ir.MonikerKind=ir.UniquenessLevel=void 0;var xd=be(),Dd;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(Dd||(ir.UniquenessLevel=Dd={}));var Ed;(function(t){t.$import="import",t.$export="export",t.local="local"})(Ed||(ir.MonikerKind=Ed={}));var Od;(function(t){t.method="textDocument/moniker",t.messageDirection=xd.MessageDirection.clientToServer,t.type=new xd.ProtocolRequestType(t.method)})(Od||(ir.MonikerRequest=Od={}))});var Id=M(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.TypeHierarchySubtypesRequest=sr.TypeHierarchySupertypesRequest=sr.TypeHierarchyPrepareRequest=void 0;var wn=be(),Md;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=wn.MessageDirection.clientToServer,t.type=new wn.ProtocolRequestType(t.method)})(Md||(sr.TypeHierarchyPrepareRequest=Md={}));var jd;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=wn.MessageDirection.clientToServer,t.type=new wn.ProtocolRequestType(t.method)})(jd||(sr.TypeHierarchySupertypesRequest=jd={}));var qd;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=wn.MessageDirection.clientToServer,t.type=new wn.ProtocolRequestType(t.method)})(qd||(sr.TypeHierarchySubtypesRequest=qd={}))});var $d=M(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.InlineValueRefreshRequest=Tn.InlineValueRequest=void 0;var ss=be(),Ad;(function(t){t.method="textDocument/inlineValue",t.messageDirection=ss.MessageDirection.clientToServer,t.type=new ss.ProtocolRequestType(t.method)})(Ad||(Tn.InlineValueRequest=Ad={}));var Ld;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=ss.MessageDirection.serverToClient,t.type=new ss.ProtocolRequestType0(t.method)})(Ld||(Tn.InlineValueRefreshRequest=Ld={}))});var zd=M(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.InlayHintRefreshRequest=or.InlayHintResolveRequest=or.InlayHintRequest=void 0;var Rn=be(),Fd;(function(t){t.method="textDocument/inlayHint",t.messageDirection=Rn.MessageDirection.clientToServer,t.type=new Rn.ProtocolRequestType(t.method)})(Fd||(or.InlayHintRequest=Fd={}));var Wd;(function(t){t.method="inlayHint/resolve",t.messageDirection=Rn.MessageDirection.clientToServer,t.type=new Rn.ProtocolRequestType(t.method)})(Wd||(or.InlayHintResolveRequest=Wd={}));var Vd;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=Rn.MessageDirection.serverToClient,t.type=new Rn.ProtocolRequestType0(t.method)})(Vd||(or.InlayHintRefreshRequest=Vd={}))});var Qd=M(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.DiagnosticRefreshRequest=at.WorkspaceDiagnosticRequest=at.DocumentDiagnosticRequest=at.DocumentDiagnosticReportKind=at.DiagnosticServerCancellationData=void 0;var Gd=yr(),Rp=Zi(),kn=be(),Ud;(function(t){function e(r){let n=r;return n&&Rp.boolean(n.retriggerRequest)}t.is=e})(Ud||(at.DiagnosticServerCancellationData=Ud={}));var Bd;(function(t){t.Full="full",t.Unchanged="unchanged"})(Bd||(at.DocumentDiagnosticReportKind=Bd={}));var Hd;(function(t){t.method="textDocument/diagnostic",t.messageDirection=kn.MessageDirection.clientToServer,t.type=new kn.ProtocolRequestType(t.method),t.partialResult=new Gd.ProgressType})(Hd||(at.DocumentDiagnosticRequest=Hd={}));var Zd;(function(t){t.method="workspace/diagnostic",t.messageDirection=kn.MessageDirection.clientToServer,t.type=new kn.ProtocolRequestType(t.method),t.partialResult=new Gd.ProgressType})(Zd||(at.WorkspaceDiagnosticRequest=Zd={}));var Jd;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=kn.MessageDirection.serverToClient,t.type=new kn.ProtocolRequestType0(t.method)})(Jd||(at.DiagnosticRefreshRequest=Jd={}))});var nl=M(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.DidCloseNotebookDocumentNotification=Pe.DidSaveNotebookDocumentNotification=Pe.DidChangeNotebookDocumentNotification=Pe.NotebookCellArrayChange=Pe.DidOpenNotebookDocumentNotification=Pe.NotebookDocumentSyncRegistrationType=Pe.NotebookDocument=Pe.NotebookCell=Pe.ExecutionSummary=Pe.NotebookCellKind=void 0;var Qn=Hi(),yt=Zi(),Rt=be(),Ga;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}t.is=e})(Ga||(Pe.NotebookCellKind=Ga={}));var Qa;(function(t){function e(i,s){let d={executionOrder:i};return(s===!0||s===!1)&&(d.success=s),d}t.create=e;function r(i){let s=i;return yt.objectLiteral(s)&&Qn.uinteger.is(s.executionOrder)&&(s.success===void 0||yt.boolean(s.success))}t.is=r;function n(i,s){return i===s?!0:i==null||s===null||s===void 0?!1:i.executionOrder===s.executionOrder&&i.success===s.success}t.equals=n})(Qa||(Pe.ExecutionSummary=Qa={}));var os;(function(t){function e(s,d){return{kind:s,document:d}}t.create=e;function r(s){let d=s;return yt.objectLiteral(d)&&Ga.is(d.kind)&&Qn.DocumentUri.is(d.document)&&(d.metadata===void 0||yt.objectLiteral(d.metadata))}t.is=r;function n(s,d){let h=new Set;return s.document!==d.document&&h.add("document"),s.kind!==d.kind&&h.add("kind"),s.executionSummary!==d.executionSummary&&h.add("executionSummary"),(s.metadata!==void 0||d.metadata!==void 0)&&!i(s.metadata,d.metadata)&&h.add("metadata"),(s.executionSummary!==void 0||d.executionSummary!==void 0)&&!Qa.equals(s.executionSummary,d.executionSummary)&&h.add("executionSummary"),h}t.diff=n;function i(s,d){if(s===d)return!0;if(s==null||d===null||d===void 0||typeof s!=typeof d||typeof s!="object")return!1;let h=Array.isArray(s),R=Array.isArray(d);if(h!==R)return!1;if(h&&R){if(s.length!==d.length)return!1;for(let T=0;T<s.length;T++)if(!i(s[T],d[T]))return!1}if(yt.objectLiteral(s)&&yt.objectLiteral(d)){let T=Object.keys(s),P=Object.keys(d);if(T.length!==P.length||(T.sort(),P.sort(),!i(T,P)))return!1;for(let Z=0;Z<T.length;Z++){let se=T[Z];if(!i(s[se],d[se]))return!1}}return!0}})(os||(Pe.NotebookCell=os={}));var Xd;(function(t){function e(n,i,s,d){return{uri:n,notebookType:i,version:s,cells:d}}t.create=e;function r(n){let i=n;return yt.objectLiteral(i)&&yt.string(i.uri)&&Qn.integer.is(i.version)&&yt.typedArray(i.cells,os.is)}t.is=r})(Xd||(Pe.NotebookDocument=Xd={}));var Sn;(function(t){t.method="notebookDocument/sync",t.messageDirection=Rt.MessageDirection.clientToServer,t.type=new Rt.RegistrationType(t.method)})(Sn||(Pe.NotebookDocumentSyncRegistrationType=Sn={}));var Yd;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=Rt.MessageDirection.clientToServer,t.type=new Rt.ProtocolNotificationType(t.method),t.registrationMethod=Sn.method})(Yd||(Pe.DidOpenNotebookDocumentNotification=Yd={}));var Kd;(function(t){function e(n){let i=n;return yt.objectLiteral(i)&&Qn.uinteger.is(i.start)&&Qn.uinteger.is(i.deleteCount)&&(i.cells===void 0||yt.typedArray(i.cells,os.is))}t.is=e;function r(n,i,s){let d={start:n,deleteCount:i};return s!==void 0&&(d.cells=s),d}t.create=r})(Kd||(Pe.NotebookCellArrayChange=Kd={}));var el;(function(t){t.method="notebookDocument/didChange",t.messageDirection=Rt.MessageDirection.clientToServer,t.type=new Rt.ProtocolNotificationType(t.method),t.registrationMethod=Sn.method})(el||(Pe.DidChangeNotebookDocumentNotification=el={}));var tl;(function(t){t.method="notebookDocument/didSave",t.messageDirection=Rt.MessageDirection.clientToServer,t.type=new Rt.ProtocolNotificationType(t.method),t.registrationMethod=Sn.method})(tl||(Pe.DidSaveNotebookDocumentNotification=tl={}));var rl;(function(t){t.method="notebookDocument/didClose",t.messageDirection=Rt.MessageDirection.clientToServer,t.type=new Rt.ProtocolNotificationType(t.method),t.registrationMethod=Sn.method})(rl||(Pe.DidCloseNotebookDocumentNotification=rl={}))});var ol=M(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.InlineCompletionRequest=void 0;var il=be(),sl;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=il.MessageDirection.clientToServer,t.type=new il.ProtocolRequestType(t.method)})(sl||(as.InlineCompletionRequest=sl={}))});var bf=M(l=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0});l.WorkspaceSymbolRequest=l.CodeActionResolveRequest=l.CodeActionRequest=l.DocumentSymbolRequest=l.DocumentHighlightRequest=l.ReferencesRequest=l.DefinitionRequest=l.SignatureHelpRequest=l.SignatureHelpTriggerKind=l.HoverRequest=l.CompletionResolveRequest=l.CompletionRequest=l.CompletionTriggerKind=l.PublishDiagnosticsNotification=l.WatchKind=l.RelativePattern=l.FileChangeType=l.DidChangeWatchedFilesNotification=l.WillSaveTextDocumentWaitUntilRequest=l.WillSaveTextDocumentNotification=l.TextDocumentSaveReason=l.DidSaveTextDocumentNotification=l.DidCloseTextDocumentNotification=l.DidChangeTextDocumentNotification=l.TextDocumentContentChangeEvent=l.DidOpenTextDocumentNotification=l.TextDocumentSyncKind=l.TelemetryEventNotification=l.LogMessageNotification=l.ShowMessageRequest=l.ShowMessageNotification=l.MessageType=l.DidChangeConfigurationNotification=l.ExitNotification=l.ShutdownRequest=l.InitializedNotification=l.InitializeErrorCodes=l.InitializeRequest=l.WorkDoneProgressOptions=l.TextDocumentRegistrationOptions=l.StaticRegistrationOptions=l.PositionEncodingKind=l.FailureHandlingKind=l.ResourceOperationKind=l.UnregistrationRequest=l.RegistrationRequest=l.DocumentSelector=l.NotebookCellTextDocumentFilter=l.NotebookDocumentFilter=l.TextDocumentFilter=void 0;l.MonikerRequest=l.MonikerKind=l.UniquenessLevel=l.WillDeleteFilesRequest=l.DidDeleteFilesNotification=l.WillRenameFilesRequest=l.DidRenameFilesNotification=l.WillCreateFilesRequest=l.DidCreateFilesNotification=l.FileOperationPatternKind=l.LinkedEditingRangeRequest=l.ShowDocumentRequest=l.SemanticTokensRegistrationType=l.SemanticTokensRefreshRequest=l.SemanticTokensRangeRequest=l.SemanticTokensDeltaRequest=l.SemanticTokensRequest=l.TokenFormat=l.CallHierarchyPrepareRequest=l.CallHierarchyOutgoingCallsRequest=l.CallHierarchyIncomingCallsRequest=l.WorkDoneProgressCancelNotification=l.WorkDoneProgressCreateRequest=l.WorkDoneProgress=l.SelectionRangeRequest=l.DeclarationRequest=l.FoldingRangeRefreshRequest=l.FoldingRangeRequest=l.ColorPresentationRequest=l.DocumentColorRequest=l.ConfigurationRequest=l.DidChangeWorkspaceFoldersNotification=l.WorkspaceFoldersRequest=l.TypeDefinitionRequest=l.ImplementationRequest=l.ApplyWorkspaceEditRequest=l.ExecuteCommandRequest=l.PrepareRenameRequest=l.RenameRequest=l.PrepareSupportDefaultBehavior=l.DocumentOnTypeFormattingRequest=l.DocumentRangesFormattingRequest=l.DocumentRangeFormattingRequest=l.DocumentFormattingRequest=l.DocumentLinkResolveRequest=l.DocumentLinkRequest=l.CodeLensRefreshRequest=l.CodeLensResolveRequest=l.CodeLensRequest=l.WorkspaceSymbolResolveRequest=void 0;l.InlineCompletionRequest=l.DidCloseNotebookDocumentNotification=l.DidSaveNotebookDocumentNotification=l.DidChangeNotebookDocumentNotification=l.NotebookCellArrayChange=l.DidOpenNotebookDocumentNotification=l.NotebookDocumentSyncRegistrationType=l.NotebookDocument=l.NotebookCell=l.ExecutionSummary=l.NotebookCellKind=l.DiagnosticRefreshRequest=l.WorkspaceDiagnosticRequest=l.DocumentDiagnosticRequest=l.DocumentDiagnosticReportKind=l.DiagnosticServerCancellationData=l.InlayHintRefreshRequest=l.InlayHintResolveRequest=l.InlayHintRequest=l.InlineValueRefreshRequest=l.InlineValueRequest=l.TypeHierarchySupertypesRequest=l.TypeHierarchySubtypesRequest=l.TypeHierarchyPrepareRequest=void 0;var C=be(),al=Hi(),Ee=Zi(),kp=Nu();Object.defineProperty(l,"ImplementationRequest",{enumerable:!0,get:function(){return kp.ImplementationRequest}});var Sp=qu();Object.defineProperty(l,"TypeDefinitionRequest",{enumerable:!0,get:function(){return Sp.TypeDefinitionRequest}});var gf=Lu();Object.defineProperty(l,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return gf.WorkspaceFoldersRequest}});Object.defineProperty(l,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return gf.DidChangeWorkspaceFoldersNotification}});var Cp=Wu();Object.defineProperty(l,"ConfigurationRequest",{enumerable:!0,get:function(){return Cp.ConfigurationRequest}});var yf=Uu();Object.defineProperty(l,"DocumentColorRequest",{enumerable:!0,get:function(){return yf.DocumentColorRequest}});Object.defineProperty(l,"ColorPresentationRequest",{enumerable:!0,get:function(){return yf.ColorPresentationRequest}});var vf=Zu();Object.defineProperty(l,"FoldingRangeRequest",{enumerable:!0,get:function(){return vf.FoldingRangeRequest}});Object.defineProperty(l,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return vf.FoldingRangeRefreshRequest}});var Pp=Qu();Object.defineProperty(l,"DeclarationRequest",{enumerable:!0,get:function(){return Pp.DeclarationRequest}});var xp=Ku();Object.defineProperty(l,"SelectionRangeRequest",{enumerable:!0,get:function(){return xp.SelectionRangeRequest}});var tc=nd();Object.defineProperty(l,"WorkDoneProgress",{enumerable:!0,get:function(){return tc.WorkDoneProgress}});Object.defineProperty(l,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return tc.WorkDoneProgressCreateRequest}});Object.defineProperty(l,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return tc.WorkDoneProgressCancelNotification}});var rc=ad();Object.defineProperty(l,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return rc.CallHierarchyIncomingCallsRequest}});Object.defineProperty(l,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return rc.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(l,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return rc.CallHierarchyPrepareRequest}});var Cn=hd();Object.defineProperty(l,"TokenFormat",{enumerable:!0,get:function(){return Cn.TokenFormat}});Object.defineProperty(l,"SemanticTokensRequest",{enumerable:!0,get:function(){return Cn.SemanticTokensRequest}});Object.defineProperty(l,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return Cn.SemanticTokensDeltaRequest}});Object.defineProperty(l,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return Cn.SemanticTokensRangeRequest}});Object.defineProperty(l,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return Cn.SemanticTokensRefreshRequest}});Object.defineProperty(l,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return Cn.SemanticTokensRegistrationType}});var Dp=gd();Object.defineProperty(l,"ShowDocumentRequest",{enumerable:!0,get:function(){return Dp.ShowDocumentRequest}});var Ep=_d();Object.defineProperty(l,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return Ep.LinkedEditingRangeRequest}});var vr=Pd();Object.defineProperty(l,"FileOperationPatternKind",{enumerable:!0,get:function(){return vr.FileOperationPatternKind}});Object.defineProperty(l,"DidCreateFilesNotification",{enumerable:!0,get:function(){return vr.DidCreateFilesNotification}});Object.defineProperty(l,"WillCreateFilesRequest",{enumerable:!0,get:function(){return vr.WillCreateFilesRequest}});Object.defineProperty(l,"DidRenameFilesNotification",{enumerable:!0,get:function(){return vr.DidRenameFilesNotification}});Object.defineProperty(l,"WillRenameFilesRequest",{enumerable:!0,get:function(){return vr.WillRenameFilesRequest}});Object.defineProperty(l,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return vr.DidDeleteFilesNotification}});Object.defineProperty(l,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return vr.WillDeleteFilesRequest}});var nc=Nd();Object.defineProperty(l,"UniquenessLevel",{enumerable:!0,get:function(){return nc.UniquenessLevel}});Object.defineProperty(l,"MonikerKind",{enumerable:!0,get:function(){return nc.MonikerKind}});Object.defineProperty(l,"MonikerRequest",{enumerable:!0,get:function(){return nc.MonikerRequest}});var ic=Id();Object.defineProperty(l,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return ic.TypeHierarchyPrepareRequest}});Object.defineProperty(l,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return ic.TypeHierarchySubtypesRequest}});Object.defineProperty(l,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return ic.TypeHierarchySupertypesRequest}});var _f=$d();Object.defineProperty(l,"InlineValueRequest",{enumerable:!0,get:function(){return _f.InlineValueRequest}});Object.defineProperty(l,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return _f.InlineValueRefreshRequest}});var sc=zd();Object.defineProperty(l,"InlayHintRequest",{enumerable:!0,get:function(){return sc.InlayHintRequest}});Object.defineProperty(l,"InlayHintResolveRequest",{enumerable:!0,get:function(){return sc.InlayHintResolveRequest}});Object.defineProperty(l,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return sc.InlayHintRefreshRequest}});var Xn=Qd();Object.defineProperty(l,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Xn.DiagnosticServerCancellationData}});Object.defineProperty(l,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Xn.DocumentDiagnosticReportKind}});Object.defineProperty(l,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Xn.DocumentDiagnosticRequest}});Object.defineProperty(l,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Xn.WorkspaceDiagnosticRequest}});Object.defineProperty(l,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Xn.DiagnosticRefreshRequest}});var kt=nl();Object.defineProperty(l,"NotebookCellKind",{enumerable:!0,get:function(){return kt.NotebookCellKind}});Object.defineProperty(l,"ExecutionSummary",{enumerable:!0,get:function(){return kt.ExecutionSummary}});Object.defineProperty(l,"NotebookCell",{enumerable:!0,get:function(){return kt.NotebookCell}});Object.defineProperty(l,"NotebookDocument",{enumerable:!0,get:function(){return kt.NotebookDocument}});Object.defineProperty(l,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return kt.NotebookDocumentSyncRegistrationType}});Object.defineProperty(l,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return kt.DidOpenNotebookDocumentNotification}});Object.defineProperty(l,"NotebookCellArrayChange",{enumerable:!0,get:function(){return kt.NotebookCellArrayChange}});Object.defineProperty(l,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return kt.DidChangeNotebookDocumentNotification}});Object.defineProperty(l,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return kt.DidSaveNotebookDocumentNotification}});Object.defineProperty(l,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return kt.DidCloseNotebookDocumentNotification}});var Op=ol();Object.defineProperty(l,"InlineCompletionRequest",{enumerable:!0,get:function(){return Op.InlineCompletionRequest}});var Xa;(function(t){function e(r){let n=r;return Ee.string(n)||Ee.string(n.language)||Ee.string(n.scheme)||Ee.string(n.pattern)}t.is=e})(Xa||(l.TextDocumentFilter=Xa={}));var Ya;(function(t){function e(r){let n=r;return Ee.objectLiteral(n)&&(Ee.string(n.notebookType)||Ee.string(n.scheme)||Ee.string(n.pattern))}t.is=e})(Ya||(l.NotebookDocumentFilter=Ya={}));var Ka;(function(t){function e(r){let n=r;return Ee.objectLiteral(n)&&(Ee.string(n.notebook)||Ya.is(n.notebook))&&(n.language===void 0||Ee.string(n.language))}t.is=e})(Ka||(l.NotebookCellTextDocumentFilter=Ka={}));var ec;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!Ee.string(n)&&!Xa.is(n)&&!Ka.is(n))return!1;return!0}t.is=e})(ec||(l.DocumentSelector=ec={}));var cl;(function(t){t.method="client/registerCapability",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolRequestType(t.method)})(cl||(l.RegistrationRequest=cl={}));var ul;(function(t){t.method="client/unregisterCapability",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolRequestType(t.method)})(ul||(l.UnregistrationRequest=ul={}));var dl;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(dl||(l.ResourceOperationKind=dl={}));var ll;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(ll||(l.FailureHandlingKind=ll={}));var fl;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(fl||(l.PositionEncodingKind=fl={}));var hl;(function(t){function e(r){let n=r;return n&&Ee.string(n.id)&&n.id.length>0}t.hasId=e})(hl||(l.StaticRegistrationOptions=hl={}));var pl;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||ec.is(n.documentSelector))}t.is=e})(pl||(l.TextDocumentRegistrationOptions=pl={}));var ml;(function(t){function e(n){let i=n;return Ee.objectLiteral(i)&&(i.workDoneProgress===void 0||Ee.boolean(i.workDoneProgress))}t.is=e;function r(n){let i=n;return i&&Ee.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=r})(ml||(l.WorkDoneProgressOptions=ml={}));var gl;(function(t){t.method="initialize",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(gl||(l.InitializeRequest=gl={}));var yl;(function(t){t.unknownProtocolVersion=1})(yl||(l.InitializeErrorCodes=yl={}));var vl;(function(t){t.method="initialized",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(vl||(l.InitializedNotification=vl={}));var _l;(function(t){t.method="shutdown",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType0(t.method)})(_l||(l.ShutdownRequest=_l={}));var bl;(function(t){t.method="exit",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType0(t.method)})(bl||(l.ExitNotification=bl={}));var wl;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(wl||(l.DidChangeConfigurationNotification=wl={}));var Tl;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(Tl||(l.MessageType=Tl={}));var Rl;(function(t){t.method="window/showMessage",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolNotificationType(t.method)})(Rl||(l.ShowMessageNotification=Rl={}));var kl;(function(t){t.method="window/showMessageRequest",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolRequestType(t.method)})(kl||(l.ShowMessageRequest=kl={}));var Sl;(function(t){t.method="window/logMessage",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolNotificationType(t.method)})(Sl||(l.LogMessageNotification=Sl={}));var Cl;(function(t){t.method="telemetry/event",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolNotificationType(t.method)})(Cl||(l.TelemetryEventNotification=Cl={}));var Pl;(function(t){t.None=0,t.Full=1,t.Incremental=2})(Pl||(l.TextDocumentSyncKind=Pl={}));var xl;(function(t){t.method="textDocument/didOpen",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(xl||(l.DidOpenTextDocumentNotification=xl={}));var Dl;(function(t){function e(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}t.isIncremental=e;function r(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}t.isFull=r})(Dl||(l.TextDocumentContentChangeEvent=Dl={}));var El;(function(t){t.method="textDocument/didChange",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(El||(l.DidChangeTextDocumentNotification=El={}));var Ol;(function(t){t.method="textDocument/didClose",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(Ol||(l.DidCloseTextDocumentNotification=Ol={}));var Nl;(function(t){t.method="textDocument/didSave",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(Nl||(l.DidSaveTextDocumentNotification=Nl={}));var Ml;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(Ml||(l.TextDocumentSaveReason=Ml={}));var jl;(function(t){t.method="textDocument/willSave",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(jl||(l.WillSaveTextDocumentNotification=jl={}));var ql;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(ql||(l.WillSaveTextDocumentWaitUntilRequest=ql={}));var Il;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(Il||(l.DidChangeWatchedFilesNotification=Il={}));var Al;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(Al||(l.FileChangeType=Al={}));var Ll;(function(t){function e(r){let n=r;return Ee.objectLiteral(n)&&(al.URI.is(n.baseUri)||al.WorkspaceFolder.is(n.baseUri))&&Ee.string(n.pattern)}t.is=e})(Ll||(l.RelativePattern=Ll={}));var $l;(function(t){t.Create=1,t.Change=2,t.Delete=4})($l||(l.WatchKind=$l={}));var Fl;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolNotificationType(t.method)})(Fl||(l.PublishDiagnosticsNotification=Fl={}));var Wl;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(Wl||(l.CompletionTriggerKind=Wl={}));var Vl;(function(t){t.method="textDocument/completion",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Vl||(l.CompletionRequest=Vl={}));var zl;(function(t){t.method="completionItem/resolve",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(zl||(l.CompletionResolveRequest=zl={}));var Ul;(function(t){t.method="textDocument/hover",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Ul||(l.HoverRequest=Ul={}));var Bl;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(Bl||(l.SignatureHelpTriggerKind=Bl={}));var Hl;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Hl||(l.SignatureHelpRequest=Hl={}));var Zl;(function(t){t.method="textDocument/definition",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Zl||(l.DefinitionRequest=Zl={}));var Jl;(function(t){t.method="textDocument/references",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Jl||(l.ReferencesRequest=Jl={}));var Gl;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Gl||(l.DocumentHighlightRequest=Gl={}));var Ql;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Ql||(l.DocumentSymbolRequest=Ql={}));var Xl;(function(t){t.method="textDocument/codeAction",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Xl||(l.CodeActionRequest=Xl={}));var Yl;(function(t){t.method="codeAction/resolve",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Yl||(l.CodeActionResolveRequest=Yl={}));var Kl;(function(t){t.method="workspace/symbol",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Kl||(l.WorkspaceSymbolRequest=Kl={}));var ef;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(ef||(l.WorkspaceSymbolResolveRequest=ef={}));var tf;(function(t){t.method="textDocument/codeLens",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(tf||(l.CodeLensRequest=tf={}));var rf;(function(t){t.method="codeLens/resolve",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(rf||(l.CodeLensResolveRequest=rf={}));var nf;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolRequestType0(t.method)})(nf||(l.CodeLensRefreshRequest=nf={}));var sf;(function(t){t.method="textDocument/documentLink",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(sf||(l.DocumentLinkRequest=sf={}));var of;(function(t){t.method="documentLink/resolve",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(of||(l.DocumentLinkResolveRequest=of={}));var af;(function(t){t.method="textDocument/formatting",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(af||(l.DocumentFormattingRequest=af={}));var cf;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(cf||(l.DocumentRangeFormattingRequest=cf={}));var uf;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(uf||(l.DocumentRangesFormattingRequest=uf={}));var df;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(df||(l.DocumentOnTypeFormattingRequest=df={}));var lf;(function(t){t.Identifier=1})(lf||(l.PrepareSupportDefaultBehavior=lf={}));var ff;(function(t){t.method="textDocument/rename",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(ff||(l.RenameRequest=ff={}));var hf;(function(t){t.method="textDocument/prepareRename",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(hf||(l.PrepareRenameRequest=hf={}));var pf;(function(t){t.method="workspace/executeCommand",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(pf||(l.ExecuteCommandRequest=pf={}));var mf;(function(t){t.method="workspace/applyEdit",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolRequestType("workspace/applyEdit")})(mf||(l.ApplyWorkspaceEditRequest=mf={}))});var Tf=M(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.createProtocolConnection=void 0;var wf=yr();function Np(t,e,r,n){return wf.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,wf.createMessageConnection)(t,e,r,n)}cs.createProtocolConnection=Np});var kf=M(Xe=>{"use strict";var Mp=Xe&&Xe.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),us=Xe&&Xe.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Mp(e,t,r)};Object.defineProperty(Xe,"__esModule",{value:!0});Xe.LSPErrorCodes=Xe.createProtocolConnection=void 0;us(yr(),Xe);us(Hi(),Xe);us(be(),Xe);us(bf(),Xe);var jp=Tf();Object.defineProperty(Xe,"createProtocolConnection",{enumerable:!0,get:function(){return jp.createProtocolConnection}});var Rf;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(Rf||(Xe.LSPErrorCodes=Rf={}))});var Cf=M(St=>{"use strict";var qp=St&&St.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Sf=St&&St.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&qp(e,t,r)};Object.defineProperty(St,"__esModule",{value:!0});St.createProtocolConnection=void 0;var Ip=za();Sf(za(),St);Sf(kf(),St);function Ap(t,e,r,n){return(0,Ip.createMessageConnection)(t,e,r,n)}St.createProtocolConnection=Ap});var Wf=Yr(require("child_process")),ti=Yr(require("fs")),vs=Yr(require("path")),Vf=Yr(No()),_s=Yr(Gc()),uc=Yr(Cf());var et={};Kf(et,{BRAND:()=>um,DIRTY:()=>_r,EMPTY_PATH:()=>Wp,INVALID:()=>W,NEVER:()=>Zm,OK:()=>ze,ParseStatus:()=>Me,Schema:()=>K,ZodAny:()=>ur,ZodArray:()=>$t,ZodBigInt:()=>wr,ZodBoolean:()=>Tr,ZodBranded:()=>Kn,ZodCatch:()=>Mr,ZodDate:()=>Rr,ZodDefault:()=>Nr,ZodDiscriminatedUnion:()=>fs,ZodEffects:()=>dt,ZodEnum:()=>Er,ZodError:()=>Ye,ZodFirstPartyTypeKind:()=>U,ZodFunction:()=>ps,ZodIntersection:()=>Pr,ZodIssueCode:()=>S,ZodLazy:()=>xr,ZodLiteral:()=>Dr,ZodMap:()=>Nn,ZodNaN:()=>jn,ZodNativeEnum:()=>Or,ZodNever:()=>vt,ZodNull:()=>Sr,ZodNullable:()=>xt,ZodNumber:()=>br,ZodObject:()=>Ke,ZodOptional:()=>ct,ZodParsedType:()=>E,ZodPipeline:()=>ei,ZodPromise:()=>dr,ZodReadonly:()=>jr,ZodRecord:()=>hs,ZodSchema:()=>K,ZodSet:()=>Mn,ZodString:()=>cr,ZodSymbol:()=>En,ZodTransformer:()=>dt,ZodTuple:()=>Pt,ZodType:()=>K,ZodUndefined:()=>kr,ZodUnion:()=>Cr,ZodUnknown:()=>Lt,ZodVoid:()=>On,addIssueToContext:()=>x,any:()=>vm,array:()=>Tm,bigint:()=>hm,boolean:()=>Af,coerce:()=>Hm,custom:()=>jf,date:()=>pm,datetimeRegex:()=>Nf,defaultErrorMap:()=>It,discriminatedUnion:()=>Cm,effect:()=>Lm,enum:()=>qm,function:()=>Nm,getErrorMap:()=>Pn,getParsedType:()=>Ct,instanceof:()=>lm,intersection:()=>Pm,isAborted:()=>ds,isAsync:()=>xn,isDirty:()=>ls,isValid:()=>ar,late:()=>dm,lazy:()=>Mm,literal:()=>jm,makeIssue:()=>Yn,map:()=>Em,nan:()=>fm,nativeEnum:()=>Im,never:()=>bm,null:()=>ym,nullable:()=>Fm,number:()=>If,object:()=>Rm,objectUtil:()=>oc,oboolean:()=>Bm,onumber:()=>Um,optional:()=>$m,ostring:()=>zm,pipeline:()=>Vm,preprocess:()=>Wm,promise:()=>Am,quotelessJson:()=>Lp,record:()=>Dm,set:()=>Om,setErrorMap:()=>Fp,strictObject:()=>km,string:()=>qf,symbol:()=>mm,transformer:()=>Lm,tuple:()=>xm,undefined:()=>gm,union:()=>Sm,unknown:()=>_m,util:()=>ee,void:()=>wm});var ee;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let s={};for(let d of i)s[d]=d;return s},t.getValidEnumValues=i=>{let s=t.objectKeys(i).filter(h=>typeof i[i[h]]!="number"),d={};for(let h of s)d[h]=i[h];return t.objectValues(d)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let s=[];for(let d in i)Object.prototype.hasOwnProperty.call(i,d)&&s.push(d);return s},t.find=(i,s)=>{for(let d of i)if(s(d))return d},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(d=>typeof d=="string"?`'${d}'`:d).join(s)}t.joinValues=n,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(ee||(ee={}));var oc;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(oc||(oc={}));var E=ee.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ct=t=>{switch(typeof t){case"undefined":return E.undefined;case"string":return E.string;case"number":return Number.isNaN(t)?E.nan:E.number;case"boolean":return E.boolean;case"function":return E.function;case"bigint":return E.bigint;case"symbol":return E.symbol;case"object":return Array.isArray(t)?E.array:t===null?E.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?E.promise:typeof Map<"u"&&t instanceof Map?E.map:typeof Set<"u"&&t instanceof Set?E.set:typeof Date<"u"&&t instanceof Date?E.date:E.object;default:return E.unknown}};var S=ee.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Lp=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Ye=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(s){return s.message},n={_errors:[]},i=s=>{for(let d of s.issues)if(d.code==="invalid_union")d.unionErrors.map(i);else if(d.code==="invalid_return_type")i(d.returnTypeError);else if(d.code==="invalid_arguments")i(d.argumentsError);else if(d.path.length===0)n._errors.push(r(d));else{let h=n,R=0;for(;R<d.path.length;){let T=d.path[R];R===d.path.length-1?(h[T]=h[T]||{_errors:[]},h[T]._errors.push(r(d))):h[T]=h[T]||{_errors:[]},h=h[T],R++}}};return i(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ee.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Ye.create=t=>new Ye(t);var $p=(t,e)=>{let r;switch(t.code){case S.invalid_type:t.received===E.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case S.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,ee.jsonStringifyReplacer)}`;break;case S.unrecognized_keys:r=`Unrecognized key(s) in object: ${ee.joinValues(t.keys,", ")}`;break;case S.invalid_union:r="Invalid input";break;case S.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ee.joinValues(t.options)}`;break;case S.invalid_enum_value:r=`Invalid enum value. Expected ${ee.joinValues(t.options)}, received '${t.received}'`;break;case S.invalid_arguments:r="Invalid function arguments";break;case S.invalid_return_type:r="Invalid function return type";break;case S.invalid_date:r="Invalid date";break;case S.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:ee.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case S.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case S.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case S.custom:r="Invalid input";break;case S.invalid_intersection_types:r="Intersection results could not be merged";break;case S.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case S.not_finite:r="Number must be finite";break;default:r=e.defaultError,ee.assertNever(t)}return{message:r}},It=$p;var Pf=It;function Fp(t){Pf=t}function Pn(){return Pf}var Yn=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,s=[...r,...i.path||[]],d={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let h="",R=n.filter(T=>!!T).slice().reverse();for(let T of R)h=T(d,{data:e,defaultError:h}).message;return{...i,path:s,message:h}},Wp=[];function x(t,e){let r=Pn(),n=Yn({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===It?void 0:It].filter(i=>!!i)});t.common.issues.push(n)}var Me=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return W;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r){let s=await i.key,d=await i.value;n.push({key:s,value:d})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:s,value:d}=i;if(s.status==="aborted"||d.status==="aborted")return W;s.status==="dirty"&&e.dirty(),d.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof d.value<"u"||i.alwaysSet)&&(n[s.value]=d.value)}return{status:e.value,value:n}}},W=Object.freeze({status:"aborted"}),_r=t=>({status:"dirty",value:t}),ze=t=>({status:"valid",value:t}),ds=t=>t.status==="aborted",ls=t=>t.status==="dirty",ar=t=>t.status==="valid",xn=t=>typeof Promise<"u"&&t instanceof Promise;var j;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(j||(j={}));var ut=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},xf=(t,e)=>{if(ar(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Ye(t.common.issues);return this._error=r,this._error}}};function Y(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(d,h)=>{let{message:R}=t;return d.code==="invalid_enum_value"?{message:R??h.defaultError}:typeof h.data>"u"?{message:R??n??h.defaultError}:d.code!=="invalid_type"?{message:h.defaultError}:{message:R??r??h.defaultError}},description:i}}var K=class{get description(){return this._def.description}_getType(e){return Ct(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Ct(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Me,ctx:{common:e.parent.common,data:e.data,parsedType:Ct(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(xn(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ct(e)},i=this._parseSync({data:e,path:n.path,parent:n});return xf(n,i)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ct(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return ar(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>ar(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ct(e)},i=this._parse({data:e,path:n.path,parent:n}),s=await(xn(i)?i:Promise.resolve(i));return xf(n,s)}refine(e,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,s)=>{let d=e(i),h=()=>s.addIssue({code:S.custom,...n(i)});return typeof Promise<"u"&&d instanceof Promise?d.then(R=>R?!0:(h(),!1)):d?!0:(h(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new dt({schema:this,typeName:U.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return ct.create(this,this._def)}nullable(){return xt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return $t.create(this)}promise(){return dr.create(this,this._def)}or(e){return Cr.create([this,e],this._def)}and(e){return Pr.create(this,e,this._def)}transform(e){return new dt({...Y(this._def),schema:this,typeName:U.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Nr({...Y(this._def),innerType:this,defaultValue:r,typeName:U.ZodDefault})}brand(){return new Kn({typeName:U.ZodBranded,type:this,...Y(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Mr({...Y(this._def),innerType:this,catchValue:r,typeName:U.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return ei.create(this,e)}readonly(){return jr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Vp=/^c[^\s-]{8,}$/i,zp=/^[0-9a-z]+$/,Up=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Bp=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Hp=/^[a-z0-9_-]{21}$/i,Zp=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Jp=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Gp=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Qp="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ac,Xp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Yp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Kp=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,em=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,tm=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,rm=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ef="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",nm=new RegExp(`^${Ef}$`);function Of(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function im(t){return new RegExp(`^${Of(t)}$`)}function Nf(t){let e=`${Ef}T${Of(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function sm(t,e){return!!((e==="v4"||!e)&&Xp.test(t)||(e==="v6"||!e)&&Kp.test(t))}function om(t,e){if(!Zp.test(t))return!1;try{let[r]=t.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function am(t,e){return!!((e==="v4"||!e)&&Yp.test(t)||(e==="v6"||!e)&&em.test(t))}var cr=class t extends K{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==E.string){let s=this._getOrReturnCtx(e);return x(s,{code:S.invalid_type,expected:E.string,received:s.parsedType}),W}let n=new Me,i;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),x(i,{code:S.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),x(i,{code:S.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let d=e.data.length>s.value,h=e.data.length<s.value;(d||h)&&(i=this._getOrReturnCtx(e,i),d?x(i,{code:S.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):h&&x(i,{code:S.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")Gp.test(e.data)||(i=this._getOrReturnCtx(e,i),x(i,{validation:"email",code:S.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")ac||(ac=new RegExp(Qp,"u")),ac.test(e.data)||(i=this._getOrReturnCtx(e,i),x(i,{validation:"emoji",code:S.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")Bp.test(e.data)||(i=this._getOrReturnCtx(e,i),x(i,{validation:"uuid",code:S.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")Hp.test(e.data)||(i=this._getOrReturnCtx(e,i),x(i,{validation:"nanoid",code:S.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")Vp.test(e.data)||(i=this._getOrReturnCtx(e,i),x(i,{validation:"cuid",code:S.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")zp.test(e.data)||(i=this._getOrReturnCtx(e,i),x(i,{validation:"cuid2",code:S.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")Up.test(e.data)||(i=this._getOrReturnCtx(e,i),x(i,{validation:"ulid",code:S.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),x(i,{validation:"url",code:S.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),x(i,{validation:"regex",code:S.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),x(i,{code:S.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),x(i,{code:S.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),x(i,{code:S.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Nf(s).test(e.data)||(i=this._getOrReturnCtx(e,i),x(i,{code:S.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?nm.test(e.data)||(i=this._getOrReturnCtx(e,i),x(i,{code:S.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?im(s).test(e.data)||(i=this._getOrReturnCtx(e,i),x(i,{code:S.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?Jp.test(e.data)||(i=this._getOrReturnCtx(e,i),x(i,{validation:"duration",code:S.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?sm(e.data,s.version)||(i=this._getOrReturnCtx(e,i),x(i,{validation:"ip",code:S.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?om(e.data,s.alg)||(i=this._getOrReturnCtx(e,i),x(i,{validation:"jwt",code:S.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?am(e.data,s.version)||(i=this._getOrReturnCtx(e,i),x(i,{validation:"cidr",code:S.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?tm.test(e.data)||(i=this._getOrReturnCtx(e,i),x(i,{validation:"base64",code:S.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?rm.test(e.data)||(i=this._getOrReturnCtx(e,i),x(i,{validation:"base64url",code:S.invalid_string,message:s.message}),n.dirty()):ee.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:S.invalid_string,...j.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...j.errToObj(e)})}url(e){return this._addCheck({kind:"url",...j.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...j.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...j.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...j.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...j.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...j.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...j.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...j.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...j.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...j.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...j.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...j.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...j.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...j.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...j.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...j.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...j.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...j.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...j.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...j.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...j.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...j.errToObj(r)})}nonempty(e){return this.min(1,j.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};cr.create=t=>new cr({checks:[],typeName:U.ZodString,coerce:t?.coerce??!1,...Y(t)});function cm(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,s=Number.parseInt(t.toFixed(i).replace(".","")),d=Number.parseInt(e.toFixed(i).replace(".",""));return s%d/10**i}var br=class t extends K{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==E.number){let s=this._getOrReturnCtx(e);return x(s,{code:S.invalid_type,expected:E.number,received:s.parsedType}),W}let n,i=new Me;for(let s of this._def.checks)s.kind==="int"?ee.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{code:S.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),x(n,{code:S.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),x(n,{code:S.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?cm(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),x(n,{code:S.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{code:S.not_finite,message:s.message}),i.dirty()):ee.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,j.toString(r))}gt(e,r){return this.setLimit("min",e,!1,j.toString(r))}lte(e,r){return this.setLimit("max",e,!0,j.toString(r))}lt(e,r){return this.setLimit("max",e,!1,j.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:j.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:j.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:j.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:j.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:j.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:j.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:j.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:j.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:j.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:j.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ee.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};br.create=t=>new br({checks:[],typeName:U.ZodNumber,coerce:t?.coerce||!1,...Y(t)});var wr=class t extends K{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==E.bigint)return this._getInvalidInput(e);let n,i=new Me;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),x(n,{code:S.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),x(n,{code:S.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),x(n,{code:S.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):ee.assertNever(s);return{status:i.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return x(r,{code:S.invalid_type,expected:E.bigint,received:r.parsedType}),W}gte(e,r){return this.setLimit("min",e,!0,j.toString(r))}gt(e,r){return this.setLimit("min",e,!1,j.toString(r))}lte(e,r){return this.setLimit("max",e,!0,j.toString(r))}lt(e,r){return this.setLimit("max",e,!1,j.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:j.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:j.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:j.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:j.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:j.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:j.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};wr.create=t=>new wr({checks:[],typeName:U.ZodBigInt,coerce:t?.coerce??!1,...Y(t)});var Tr=class extends K{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==E.boolean){let n=this._getOrReturnCtx(e);return x(n,{code:S.invalid_type,expected:E.boolean,received:n.parsedType}),W}return ze(e.data)}};Tr.create=t=>new Tr({typeName:U.ZodBoolean,coerce:t?.coerce||!1,...Y(t)});var Rr=class t extends K{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==E.date){let s=this._getOrReturnCtx(e);return x(s,{code:S.invalid_type,expected:E.date,received:s.parsedType}),W}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return x(s,{code:S.invalid_date}),W}let n=new Me,i;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),x(i,{code:S.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),x(i,{code:S.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):ee.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:j.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:j.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Rr.create=t=>new Rr({checks:[],coerce:t?.coerce||!1,typeName:U.ZodDate,...Y(t)});var En=class extends K{_parse(e){if(this._getType(e)!==E.symbol){let n=this._getOrReturnCtx(e);return x(n,{code:S.invalid_type,expected:E.symbol,received:n.parsedType}),W}return ze(e.data)}};En.create=t=>new En({typeName:U.ZodSymbol,...Y(t)});var kr=class extends K{_parse(e){if(this._getType(e)!==E.undefined){let n=this._getOrReturnCtx(e);return x(n,{code:S.invalid_type,expected:E.undefined,received:n.parsedType}),W}return ze(e.data)}};kr.create=t=>new kr({typeName:U.ZodUndefined,...Y(t)});var Sr=class extends K{_parse(e){if(this._getType(e)!==E.null){let n=this._getOrReturnCtx(e);return x(n,{code:S.invalid_type,expected:E.null,received:n.parsedType}),W}return ze(e.data)}};Sr.create=t=>new Sr({typeName:U.ZodNull,...Y(t)});var ur=class extends K{constructor(){super(...arguments),this._any=!0}_parse(e){return ze(e.data)}};ur.create=t=>new ur({typeName:U.ZodAny,...Y(t)});var Lt=class extends K{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ze(e.data)}};Lt.create=t=>new Lt({typeName:U.ZodUnknown,...Y(t)});var vt=class extends K{_parse(e){let r=this._getOrReturnCtx(e);return x(r,{code:S.invalid_type,expected:E.never,received:r.parsedType}),W}};vt.create=t=>new vt({typeName:U.ZodNever,...Y(t)});var On=class extends K{_parse(e){if(this._getType(e)!==E.undefined){let n=this._getOrReturnCtx(e);return x(n,{code:S.invalid_type,expected:E.void,received:n.parsedType}),W}return ze(e.data)}};On.create=t=>new On({typeName:U.ZodVoid,...Y(t)});var $t=class t extends K{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==E.array)return x(r,{code:S.invalid_type,expected:E.array,received:r.parsedType}),W;if(i.exactLength!==null){let d=r.data.length>i.exactLength.value,h=r.data.length<i.exactLength.value;(d||h)&&(x(r,{code:d?S.too_big:S.too_small,minimum:h?i.exactLength.value:void 0,maximum:d?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(x(r,{code:S.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(x(r,{code:S.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((d,h)=>i.type._parseAsync(new ut(r,d,r.path,h)))).then(d=>Me.mergeArray(n,d));let s=[...r.data].map((d,h)=>i.type._parseSync(new ut(r,d,r.path,h)));return Me.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:j.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:j.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:j.toString(r)}})}nonempty(e){return this.min(1,e)}};$t.create=(t,e)=>new $t({type:t,minLength:null,maxLength:null,exactLength:null,typeName:U.ZodArray,...Y(e)});function Dn(t){if(t instanceof Ke){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=ct.create(Dn(n))}return new Ke({...t._def,shape:()=>e})}else return t instanceof $t?new $t({...t._def,type:Dn(t.element)}):t instanceof ct?ct.create(Dn(t.unwrap())):t instanceof xt?xt.create(Dn(t.unwrap())):t instanceof Pt?Pt.create(t.items.map(e=>Dn(e))):t}var Ke=class t extends K{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=ee.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==E.object){let T=this._getOrReturnCtx(e);return x(T,{code:S.invalid_type,expected:E.object,received:T.parsedType}),W}let{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:d}=this._getCached(),h=[];if(!(this._def.catchall instanceof vt&&this._def.unknownKeys==="strip"))for(let T in i.data)d.includes(T)||h.push(T);let R=[];for(let T of d){let P=s[T],Z=i.data[T];R.push({key:{status:"valid",value:T},value:P._parse(new ut(i,Z,i.path,T)),alwaysSet:T in i.data})}if(this._def.catchall instanceof vt){let T=this._def.unknownKeys;if(T==="passthrough")for(let P of h)R.push({key:{status:"valid",value:P},value:{status:"valid",value:i.data[P]}});else if(T==="strict")h.length>0&&(x(i,{code:S.unrecognized_keys,keys:h}),n.dirty());else if(T!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let T=this._def.catchall;for(let P of h){let Z=i.data[P];R.push({key:{status:"valid",value:P},value:T._parse(new ut(i,Z,i.path,P)),alwaysSet:P in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let T=[];for(let P of R){let Z=await P.key,se=await P.value;T.push({key:Z,value:se,alwaysSet:P.alwaysSet})}return T}).then(T=>Me.mergeObjectSync(n,T)):Me.mergeObjectSync(n,R)}get shape(){return this._def.shape()}strict(e){return j.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{let i=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:j.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:U.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of ee.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let n of ee.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return Dn(this)}partial(e){let r={};for(let n of ee.objectKeys(this.shape)){let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let n of ee.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof ct;)s=s._def.innerType;r[n]=s}return new t({...this._def,shape:()=>r})}keyof(){return Mf(ee.objectKeys(this.shape))}};Ke.create=(t,e)=>new Ke({shape:()=>t,unknownKeys:"strip",catchall:vt.create(),typeName:U.ZodObject,...Y(e)});Ke.strictCreate=(t,e)=>new Ke({shape:()=>t,unknownKeys:"strict",catchall:vt.create(),typeName:U.ZodObject,...Y(e)});Ke.lazycreate=(t,e)=>new Ke({shape:t,unknownKeys:"strip",catchall:vt.create(),typeName:U.ZodObject,...Y(e)});var Cr=class extends K{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(s){for(let h of s)if(h.result.status==="valid")return h.result;for(let h of s)if(h.result.status==="dirty")return r.common.issues.push(...h.ctx.common.issues),h.result;let d=s.map(h=>new Ye(h.ctx.common.issues));return x(r,{code:S.invalid_union,unionErrors:d}),W}if(r.common.async)return Promise.all(n.map(async s=>{let d={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:d}),ctx:d}})).then(i);{let s,d=[];for(let R of n){let T={...r,common:{...r.common,issues:[]},parent:null},P=R._parseSync({data:r.data,path:r.path,parent:T});if(P.status==="valid")return P;P.status==="dirty"&&!s&&(s={result:P,ctx:T}),T.common.issues.length&&d.push(T.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let h=d.map(R=>new Ye(R));return x(r,{code:S.invalid_union,unionErrors:h}),W}}get options(){return this._def.options}};Cr.create=(t,e)=>new Cr({options:t,typeName:U.ZodUnion,...Y(e)});var At=t=>t instanceof xr?At(t.schema):t instanceof dt?At(t.innerType()):t instanceof Dr?[t.value]:t instanceof Er?t.options:t instanceof Or?ee.objectValues(t.enum):t instanceof Nr?At(t._def.innerType):t instanceof kr?[void 0]:t instanceof Sr?[null]:t instanceof ct?[void 0,...At(t.unwrap())]:t instanceof xt?[null,...At(t.unwrap())]:t instanceof Kn||t instanceof jr?At(t.unwrap()):t instanceof Mr?At(t._def.innerType):[],fs=class t extends K{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==E.object)return x(r,{code:S.invalid_type,expected:E.object,received:r.parsedType}),W;let n=this.discriminator,i=r.data[n],s=this.optionsMap.get(i);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(x(r,{code:S.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),W)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let s of r){let d=At(s.shape[e]);if(!d.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let h of d){if(i.has(h))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(h)}`);i.set(h,s)}}return new t({typeName:U.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Y(n)})}};function cc(t,e){let r=Ct(t),n=Ct(e);if(t===e)return{valid:!0,data:t};if(r===E.object&&n===E.object){let i=ee.objectKeys(e),s=ee.objectKeys(t).filter(h=>i.indexOf(h)!==-1),d={...t,...e};for(let h of s){let R=cc(t[h],e[h]);if(!R.valid)return{valid:!1};d[h]=R.data}return{valid:!0,data:d}}else if(r===E.array&&n===E.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let s=0;s<t.length;s++){let d=t[s],h=e[s],R=cc(d,h);if(!R.valid)return{valid:!1};i.push(R.data)}return{valid:!0,data:i}}else return r===E.date&&n===E.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Pr=class extends K{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(s,d)=>{if(ds(s)||ds(d))return W;let h=cc(s.value,d.value);return h.valid?((ls(s)||ls(d))&&r.dirty(),{status:r.value,value:h.data}):(x(n,{code:S.invalid_intersection_types}),W)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,d])=>i(s,d)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Pr.create=(t,e,r)=>new Pr({left:t,right:e,typeName:U.ZodIntersection,...Y(r)});var Pt=class t extends K{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==E.array)return x(n,{code:S.invalid_type,expected:E.array,received:n.parsedType}),W;if(n.data.length<this._def.items.length)return x(n,{code:S.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),W;!this._def.rest&&n.data.length>this._def.items.length&&(x(n,{code:S.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((d,h)=>{let R=this._def.items[h]||this._def.rest;return R?R._parse(new ut(n,d,n.path,h)):null}).filter(d=>!!d);return n.common.async?Promise.all(s).then(d=>Me.mergeArray(r,d)):Me.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Pt.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Pt({items:t,typeName:U.ZodTuple,rest:null,...Y(e)})};var hs=class t extends K{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==E.object)return x(n,{code:S.invalid_type,expected:E.object,received:n.parsedType}),W;let i=[],s=this._def.keyType,d=this._def.valueType;for(let h in n.data)i.push({key:s._parse(new ut(n,h,n.path,h)),value:d._parse(new ut(n,n.data[h],n.path,h)),alwaysSet:h in n.data});return n.common.async?Me.mergeObjectAsync(r,i):Me.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof K?new t({keyType:e,valueType:r,typeName:U.ZodRecord,...Y(n)}):new t({keyType:cr.create(),valueType:e,typeName:U.ZodRecord,...Y(r)})}},Nn=class extends K{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==E.map)return x(n,{code:S.invalid_type,expected:E.map,received:n.parsedType}),W;let i=this._def.keyType,s=this._def.valueType,d=[...n.data.entries()].map(([h,R],T)=>({key:i._parse(new ut(n,h,n.path,[T,"key"])),value:s._parse(new ut(n,R,n.path,[T,"value"]))}));if(n.common.async){let h=new Map;return Promise.resolve().then(async()=>{for(let R of d){let T=await R.key,P=await R.value;if(T.status==="aborted"||P.status==="aborted")return W;(T.status==="dirty"||P.status==="dirty")&&r.dirty(),h.set(T.value,P.value)}return{status:r.value,value:h}})}else{let h=new Map;for(let R of d){let T=R.key,P=R.value;if(T.status==="aborted"||P.status==="aborted")return W;(T.status==="dirty"||P.status==="dirty")&&r.dirty(),h.set(T.value,P.value)}return{status:r.value,value:h}}}};Nn.create=(t,e,r)=>new Nn({valueType:e,keyType:t,typeName:U.ZodMap,...Y(r)});var Mn=class t extends K{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==E.set)return x(n,{code:S.invalid_type,expected:E.set,received:n.parsedType}),W;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(x(n,{code:S.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(x(n,{code:S.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let s=this._def.valueType;function d(R){let T=new Set;for(let P of R){if(P.status==="aborted")return W;P.status==="dirty"&&r.dirty(),T.add(P.value)}return{status:r.value,value:T}}let h=[...n.data.values()].map((R,T)=>s._parse(new ut(n,R,n.path,T)));return n.common.async?Promise.all(h).then(R=>d(R)):d(h)}min(e,r){return new t({...this._def,minSize:{value:e,message:j.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:j.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};Mn.create=(t,e)=>new Mn({valueType:t,minSize:null,maxSize:null,typeName:U.ZodSet,...Y(e)});var ps=class t extends K{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==E.function)return x(r,{code:S.invalid_type,expected:E.function,received:r.parsedType}),W;function n(h,R){return Yn({data:h,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Pn(),It].filter(T=>!!T),issueData:{code:S.invalid_arguments,argumentsError:R}})}function i(h,R){return Yn({data:h,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Pn(),It].filter(T=>!!T),issueData:{code:S.invalid_return_type,returnTypeError:R}})}let s={errorMap:r.common.contextualErrorMap},d=r.data;if(this._def.returns instanceof dr){let h=this;return ze(async function(...R){let T=new Ye([]),P=await h._def.args.parseAsync(R,s).catch(ce=>{throw T.addIssue(n(R,ce)),T}),Z=await Reflect.apply(d,this,P);return await h._def.returns._def.type.parseAsync(Z,s).catch(ce=>{throw T.addIssue(i(Z,ce)),T})})}else{let h=this;return ze(function(...R){let T=h._def.args.safeParse(R,s);if(!T.success)throw new Ye([n(R,T.error)]);let P=Reflect.apply(d,this,T.data),Z=h._def.returns.safeParse(P,s);if(!Z.success)throw new Ye([i(P,Z.error)]);return Z.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Pt.create(e).rest(Lt.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||Pt.create([]).rest(Lt.create()),returns:r||Lt.create(),typeName:U.ZodFunction,...Y(n)})}},xr=class extends K{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};xr.create=(t,e)=>new xr({getter:t,typeName:U.ZodLazy,...Y(e)});var Dr=class extends K{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return x(r,{received:r.data,code:S.invalid_literal,expected:this._def.value}),W}return{status:"valid",value:e.data}}get value(){return this._def.value}};Dr.create=(t,e)=>new Dr({value:t,typeName:U.ZodLiteral,...Y(e)});function Mf(t,e){return new Er({values:t,typeName:U.ZodEnum,...Y(e)})}var Er=class t extends K{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return x(r,{expected:ee.joinValues(n),received:r.parsedType,code:S.invalid_type}),W}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return x(r,{received:r.data,code:S.invalid_enum_value,options:n}),W}return ze(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};Er.create=Mf;var Or=class extends K{_parse(e){let r=ee.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==E.string&&n.parsedType!==E.number){let i=ee.objectValues(r);return x(n,{expected:ee.joinValues(i),received:n.parsedType,code:S.invalid_type}),W}if(this._cache||(this._cache=new Set(ee.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=ee.objectValues(r);return x(n,{received:n.data,code:S.invalid_enum_value,options:i}),W}return ze(e.data)}get enum(){return this._def.values}};Or.create=(t,e)=>new Or({values:t,typeName:U.ZodNativeEnum,...Y(e)});var dr=class extends K{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==E.promise&&r.common.async===!1)return x(r,{code:S.invalid_type,expected:E.promise,received:r.parsedType}),W;let n=r.parsedType===E.promise?r.data:Promise.resolve(r.data);return ze(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};dr.create=(t,e)=>new dr({type:t,typeName:U.ZodPromise,...Y(e)});var dt=class extends K{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===U.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:d=>{x(n,d),d.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){let d=i.transform(n.data,s);if(n.common.async)return Promise.resolve(d).then(async h=>{if(r.value==="aborted")return W;let R=await this._def.schema._parseAsync({data:h,path:n.path,parent:n});return R.status==="aborted"?W:R.status==="dirty"?_r(R.value):r.value==="dirty"?_r(R.value):R});{if(r.value==="aborted")return W;let h=this._def.schema._parseSync({data:d,path:n.path,parent:n});return h.status==="aborted"?W:h.status==="dirty"?_r(h.value):r.value==="dirty"?_r(h.value):h}}if(i.type==="refinement"){let d=h=>{let R=i.refinement(h,s);if(n.common.async)return Promise.resolve(R);if(R instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return h};if(n.common.async===!1){let h=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return h.status==="aborted"?W:(h.status==="dirty"&&r.dirty(),d(h.value),{status:r.value,value:h.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(h=>h.status==="aborted"?W:(h.status==="dirty"&&r.dirty(),d(h.value).then(()=>({status:r.value,value:h.value}))))}if(i.type==="transform")if(n.common.async===!1){let d=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ar(d))return W;let h=i.transform(d.value,s);if(h instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:h}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(d=>ar(d)?Promise.resolve(i.transform(d.value,s)).then(h=>({status:r.value,value:h})):W);ee.assertNever(i)}};dt.create=(t,e,r)=>new dt({schema:t,typeName:U.ZodEffects,effect:e,...Y(r)});dt.createWithPreprocess=(t,e,r)=>new dt({schema:e,effect:{type:"preprocess",transform:t},typeName:U.ZodEffects,...Y(r)});var ct=class extends K{_parse(e){return this._getType(e)===E.undefined?ze(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ct.create=(t,e)=>new ct({innerType:t,typeName:U.ZodOptional,...Y(e)});var xt=class extends K{_parse(e){return this._getType(e)===E.null?ze(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};xt.create=(t,e)=>new xt({innerType:t,typeName:U.ZodNullable,...Y(e)});var Nr=class extends K{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===E.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Nr.create=(t,e)=>new Nr({innerType:t,typeName:U.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Y(e)});var Mr=class extends K{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return xn(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ye(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ye(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Mr.create=(t,e)=>new Mr({innerType:t,typeName:U.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Y(e)});var jn=class extends K{_parse(e){if(this._getType(e)!==E.nan){let n=this._getOrReturnCtx(e);return x(n,{code:S.invalid_type,expected:E.nan,received:n.parsedType}),W}return{status:"valid",value:e.data}}};jn.create=t=>new jn({typeName:U.ZodNaN,...Y(t)});var um=Symbol("zod_brand"),Kn=class extends K{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},ei=class t extends K{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?W:s.status==="dirty"?(r.dirty(),_r(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?W:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:U.ZodPipeline})}},jr=class extends K{_parse(e){let r=this._def.innerType._parse(e),n=i=>(ar(i)&&(i.value=Object.freeze(i.value)),i);return xn(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};jr.create=(t,e)=>new jr({innerType:t,typeName:U.ZodReadonly,...Y(e)});function Df(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function jf(t,e={},r){return t?ur.create().superRefine((n,i)=>{let s=t(n);if(s instanceof Promise)return s.then(d=>{if(!d){let h=Df(e,n),R=h.fatal??r??!0;i.addIssue({code:"custom",...h,fatal:R})}});if(!s){let d=Df(e,n),h=d.fatal??r??!0;i.addIssue({code:"custom",...d,fatal:h})}}):ur.create()}var dm={object:Ke.lazycreate},U;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(U||(U={}));var lm=(t,e={message:`Input not instance of ${t.name}`})=>jf(r=>r instanceof t,e),qf=cr.create,If=br.create,fm=jn.create,hm=wr.create,Af=Tr.create,pm=Rr.create,mm=En.create,gm=kr.create,ym=Sr.create,vm=ur.create,_m=Lt.create,bm=vt.create,wm=On.create,Tm=$t.create,Rm=Ke.create,km=Ke.strictCreate,Sm=Cr.create,Cm=fs.create,Pm=Pr.create,xm=Pt.create,Dm=hs.create,Em=Nn.create,Om=Mn.create,Nm=ps.create,Mm=xr.create,jm=Dr.create,qm=Er.create,Im=Or.create,Am=dr.create,Lm=dt.create,$m=ct.create,Fm=xt.create,Wm=dt.createWithPreprocess,Vm=ei.create,zm=()=>qf().optional(),Um=()=>If().optional(),Bm=()=>Af().optional(),Hm={string:t=>cr.create({...t,coerce:!0}),number:t=>br.create({...t,coerce:!0}),boolean:t=>Tr.create({...t,coerce:!0}),bigint:t=>wr.create({...t,coerce:!0}),date:t=>Rr.create({...t,coerce:!0})};var Zm=W;var zf=require("node:util"),Jm=__dirname.endsWith("src"),Gm=Jm?vs.default.join(__dirname,"..","dist","server.js"):vs.default.join(__dirname,"server.js");function Qm(t){let e=vs.default.resolve(t);return e=e.replace(/\\/g,"/"),e.startsWith("/")||(e="/"+e),`file://${e}`}function Xm(){let t=process.env;return!!(t.CI&&(t.GITHUB_ACTIONS||t.GITLAB_CI||t.BITBUCKET_BUILD_NUMBER||t.CIRCLECI||t.TRAVIS))}var Uf=Xm(),fc=()=>Uf?"::group::":"",hc=()=>Uf?"::endgroup::":"",Ym=et.object({files:et.array(et.string(),{required_error:"Missing --files"}),includes:et.array(et.string()).optional().default([]),bindings:et.array(et.string()).optional().default([]),logLevel:et.enum(["none","verbose"]).optional().default("none"),formatting:et.boolean().optional().default(!1),diagnostics:et.boolean().optional().default(!1),outFile:et.string().optional()}),{values:Km}=(0,zf.parseArgs)({options:{files:{type:"string",multiple:!0},includes:{type:"string",multiple:!0},bindings:{type:"string",multiple:!0},logLevel:{type:"string"},formatting:{type:"boolean"},diagnostics:{type:"boolean"},outFile:{type:"string"}},strict:!0}),dc=Ym.safeParse(Km);dc.success||(console.error(`\u274C Invalid CLI input:
67
- `,dc.error.format()),process.exit(1));var qr=dc.data,Bf=qr.files,eg=qr.includes,tg=qr.bindings,rg=qr.logLevel,Lf=qr.formatting,$f=qr.diagnostics,Hf=qr.outFile;ig(Bf,rg,eg,tg,Hf).catch(t=>{console.error("Error validating files:",t),process.exit(1)});var Ff=0,ng=Bf.length,ms=new Map,gs=[],qn=[];async function ig(t,e,r,n,i){let s=Wf.default.spawn(Gm,["--stdio"],{stdio:["pipe","pipe","pipe"]});s.stderr.on("data",P=>{console.error("LSP stderr:",P.toString())});let d=(0,Vf.createMessageConnection)(new _s.StreamMessageReader(s.stdout),new _s.StreamMessageWriter(s.stdin));e==="verbose"&&d.onNotification("window/logMessage",P=>{let se={1:"ERROR",2:"WARN",3:"INFO",4:"LOG"}[P.type]||"LOG";console.log(`[LSP ${se}] ${P.message}`)}),d.onRequest("workspace/workspaceFolders",()=>[{uri:`file://${process.cwd()}`,name:"root"}]),d.listen(),d.sendNotification("workspace/didChangeConfiguration",{settings:{devicetree:{defaultIncludePaths:r,defaultBindingType:"Zephyr",defaultZephyrBindings:n,autoChangeContext:!0,allowAdhocContexts:!0,defaultLockRenameEdits:[]}}});let h=[{uri:Qm(process.cwd()),name:"root"}];await d.sendRequest("initialize",{processId:process.pid,rootUri:`file://${process.cwd()}`,capabilities:{},workspaceFolders:h}),await d.sendNotification("initialized");let R=new Set,T=Array.from(new Set(t)).sort((P,Z)=>{let se=ce=>ce.endsWith(".dts")?0:ce.endsWith(".dtsi")?1:2;return se(P)-se(Z)});for(let P of T){Ff++;let Z=ti.default.readFileSync(P,"utf8"),se={uri:`file://${P}`,languageId:"devicetree",version:0,text:Z};d.sendNotification("textDocument/didOpen",{textDocument:se});let ce=await ag(d),Ue=P.endsWith(".overlay")?[ce.mainDtsPath.file]:[...lc(ce.mainDtsPath),...ce.overlays.flatMap(lc)].filter(ue=>!ue.endsWith(".h")&&(0,ti.existsSync)(ue)),Se=ue=>ue===P,we=(ue,de)=>ue?`[${Ff}/${ng}]`:`[${de}/${Ue.length-1}]`.padEnd((Ue.length-1).toString().length*2+3," ");Lf&&await Promise.all(Ue.map(async(ue,de)=>{let O=Se(ue),le=await sg(d,ue,O,we(O,de),ce);R.add(ue)})),$f&&await Promise.all(Ue.map(async(ue,de)=>{let O=Se(ue);if(P.endsWith(".dts")){let le=await og(d,ue,O,we(O,de));le?.length&&qn.push({file:ue,context:ce,message:le.map($=>`${$.message}: {${JSON.stringify($.range.start)}}-{${JSON.stringify($.range.end)}}`).join(`
68
- `)})}else console.log(`[${we}] \u26A0\uFE0F Skipping ${ue} diagnostic check. Check can only be done on full context!`);R.add(ue)})),d.sendNotification("textDocument/didClose",{textDocument:{uri:`file://${P}`}}),await cg(d)}i&&ti.default.writeFileSync(i,Array.from(ms.values()).join(`
66
+ `&&a++}u&&m.length>0&&p.push(m.length),this._lineOffsets=p}return this._lineOffsets},c.prototype.positionAt=function(p){p=Math.max(Math.min(p,this._content.length),0);var m=this.getLineOffsets(),u=0,a=m.length;if(a===0)return d.create(0,p);for(;u<a;){var y=Math.floor((u+a)/2);m[y]>p?a=y:u=y+1}var k=u-1;return d.create(k,p-m[k])},c.prototype.offsetAt=function(p){var m=this.getLineOffsets();if(p.line>=m.length)return this._content.length;if(p.line<0)return 0;var u=m[p.line],a=p.line+1<m.length?m[p.line+1]:this._content.length;return Math.max(Math.min(u+p.character,a),u)},Object.defineProperty(c.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),c}(),v;(function(c){var p=Object.prototype.toString;function m(te){return typeof te<"u"}c.defined=m;function u(te){return typeof te>"u"}c.undefined=u;function a(te){return te===!0||te===!1}c.boolean=a;function y(te){return p.call(te)==="[object String]"}c.string=y;function k(te){return p.call(te)==="[object Number]"}c.number=k;function J(te,Xr,ri){return p.call(te)==="[object Number]"&&Xr<=te&&te<=ri}c.numberRange=J;function Ce(te){return p.call(te)==="[object Number]"&&-2147483648<=te&&te<=2147483647}c.integer=Ce;function le(te){return p.call(te)==="[object Number]"&&0<=te&&te<=2147483647}c.uinteger=le;function ht(te){return p.call(te)==="[object Function]"}c.func=ht;function pt(te){return te!==null&&typeof te=="object"}c.objectLiteral=pt;function Nt(te,Xr){return Array.isArray(te)&&te.every(Xr)}c.typedArray=Nt})(v||(v={}))})});var be=M(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.ProtocolNotificationType=Ge.ProtocolNotificationType0=Ge.ProtocolRequestType=Ge.ProtocolRequestType0=Ge.RegistrationType=Ge.MessageDirection=void 0;var gn=yr(),Pu;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(Pu||(Ge.MessageDirection=Pu={}));var Ua=class{constructor(e){this.method=e}};Ge.RegistrationType=Ua;var Ba=class extends gn.RequestType0{constructor(e){super(e)}};Ge.ProtocolRequestType0=Ba;var Ha=class extends gn.RequestType{constructor(e){super(e,gn.ParameterStructures.byName)}};Ge.ProtocolRequestType=Ha;var Za=class extends gn.NotificationType0{constructor(e){super(e)}};Ge.ProtocolNotificationType0=Za;var Ja=class extends gn.NotificationType{constructor(e){super(e,gn.ParameterStructures.byName)}};Ge.ProtocolNotificationType=Ja});var Zi=M(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.objectLiteral=De.typedArray=De.stringArray=De.array=De.func=De.error=De.number=De.string=De.boolean=void 0;function mp(t){return t===!0||t===!1}De.boolean=mp;function xu(t){return typeof t=="string"||t instanceof String}De.string=xu;function gp(t){return typeof t=="number"||t instanceof Number}De.number=gp;function yp(t){return t instanceof Error}De.error=yp;function vp(t){return typeof t=="function"}De.func=vp;function Du(t){return Array.isArray(t)}De.array=Du;function _p(t){return Du(t)&&t.every(e=>xu(e))}De.stringArray=_p;function bp(t,e){return Array.isArray(t)&&t.every(e)}De.typedArray=bp;function wp(t){return t!==null&&typeof t=="object"}De.objectLiteral=wp});var Nu=M(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.ImplementationRequest=void 0;var Eu=be(),Ou;(function(t){t.method="textDocument/implementation",t.messageDirection=Eu.MessageDirection.clientToServer,t.type=new Eu.ProtocolRequestType(t.method)})(Ou||(Ji.ImplementationRequest=Ou={}))});var qu=M(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.TypeDefinitionRequest=void 0;var Mu=be(),ju;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=Mu.MessageDirection.clientToServer,t.type=new Mu.ProtocolRequestType(t.method)})(ju||(Gi.TypeDefinitionRequest=ju={}))});var Lu=M(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.DidChangeWorkspaceFoldersNotification=yn.WorkspaceFoldersRequest=void 0;var Qi=be(),Iu;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=Qi.MessageDirection.serverToClient,t.type=new Qi.ProtocolRequestType0(t.method)})(Iu||(yn.WorkspaceFoldersRequest=Iu={}));var Au;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=Qi.MessageDirection.clientToServer,t.type=new Qi.ProtocolNotificationType(t.method)})(Au||(yn.DidChangeWorkspaceFoldersNotification=Au={}))});var Wu=M(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.ConfigurationRequest=void 0;var $u=be(),Fu;(function(t){t.method="workspace/configuration",t.messageDirection=$u.MessageDirection.serverToClient,t.type=new $u.ProtocolRequestType(t.method)})(Fu||(Xi.ConfigurationRequest=Fu={}))});var Uu=M(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.ColorPresentationRequest=vn.DocumentColorRequest=void 0;var Yi=be(),Vu;(function(t){t.method="textDocument/documentColor",t.messageDirection=Yi.MessageDirection.clientToServer,t.type=new Yi.ProtocolRequestType(t.method)})(Vu||(vn.DocumentColorRequest=Vu={}));var zu;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=Yi.MessageDirection.clientToServer,t.type=new Yi.ProtocolRequestType(t.method)})(zu||(vn.ColorPresentationRequest=zu={}))});var Zu=M(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.FoldingRangeRefreshRequest=_n.FoldingRangeRequest=void 0;var Ki=be(),Bu;(function(t){t.method="textDocument/foldingRange",t.messageDirection=Ki.MessageDirection.clientToServer,t.type=new Ki.ProtocolRequestType(t.method)})(Bu||(_n.FoldingRangeRequest=Bu={}));var Hu;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=Ki.MessageDirection.serverToClient,t.type=new Ki.ProtocolRequestType0(t.method)})(Hu||(_n.FoldingRangeRefreshRequest=Hu={}))});var Qu=M(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.DeclarationRequest=void 0;var Ju=be(),Gu;(function(t){t.method="textDocument/declaration",t.messageDirection=Ju.MessageDirection.clientToServer,t.type=new Ju.ProtocolRequestType(t.method)})(Gu||(es.DeclarationRequest=Gu={}))});var Ku=M(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.SelectionRangeRequest=void 0;var Xu=be(),Yu;(function(t){t.method="textDocument/selectionRange",t.messageDirection=Xu.MessageDirection.clientToServer,t.type=new Xu.ProtocolRequestType(t.method)})(Yu||(ts.SelectionRangeRequest=Yu={}))});var nd=M(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.WorkDoneProgressCancelNotification=rr.WorkDoneProgressCreateRequest=rr.WorkDoneProgress=void 0;var Tp=yr(),rs=be(),ed;(function(t){t.type=new Tp.ProgressType;function e(r){return r===t.type}t.is=e})(ed||(rr.WorkDoneProgress=ed={}));var td;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=rs.MessageDirection.serverToClient,t.type=new rs.ProtocolRequestType(t.method)})(td||(rr.WorkDoneProgressCreateRequest=td={}));var rd;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=rs.MessageDirection.clientToServer,t.type=new rs.ProtocolNotificationType(t.method)})(rd||(rr.WorkDoneProgressCancelNotification=rd={}))});var ad=M(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.CallHierarchyOutgoingCallsRequest=nr.CallHierarchyIncomingCallsRequest=nr.CallHierarchyPrepareRequest=void 0;var bn=be(),id;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=bn.MessageDirection.clientToServer,t.type=new bn.ProtocolRequestType(t.method)})(id||(nr.CallHierarchyPrepareRequest=id={}));var sd;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=bn.MessageDirection.clientToServer,t.type=new bn.ProtocolRequestType(t.method)})(sd||(nr.CallHierarchyIncomingCallsRequest=sd={}));var od;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=bn.MessageDirection.clientToServer,t.type=new bn.ProtocolRequestType(t.method)})(od||(nr.CallHierarchyOutgoingCallsRequest=od={}))});var hd=M(Qe=>{"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});Qe.SemanticTokensRefreshRequest=Qe.SemanticTokensRangeRequest=Qe.SemanticTokensDeltaRequest=Qe.SemanticTokensRequest=Qe.SemanticTokensRegistrationType=Qe.TokenFormat=void 0;var qt=be(),cd;(function(t){t.Relative="relative"})(cd||(Qe.TokenFormat=cd={}));var Gn;(function(t){t.method="textDocument/semanticTokens",t.type=new qt.RegistrationType(t.method)})(Gn||(Qe.SemanticTokensRegistrationType=Gn={}));var ud;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=qt.MessageDirection.clientToServer,t.type=new qt.ProtocolRequestType(t.method),t.registrationMethod=Gn.method})(ud||(Qe.SemanticTokensRequest=ud={}));var dd;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=qt.MessageDirection.clientToServer,t.type=new qt.ProtocolRequestType(t.method),t.registrationMethod=Gn.method})(dd||(Qe.SemanticTokensDeltaRequest=dd={}));var ld;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=qt.MessageDirection.clientToServer,t.type=new qt.ProtocolRequestType(t.method),t.registrationMethod=Gn.method})(ld||(Qe.SemanticTokensRangeRequest=ld={}));var fd;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=qt.MessageDirection.serverToClient,t.type=new qt.ProtocolRequestType0(t.method)})(fd||(Qe.SemanticTokensRefreshRequest=fd={}))});var gd=M(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.ShowDocumentRequest=void 0;var pd=be(),md;(function(t){t.method="window/showDocument",t.messageDirection=pd.MessageDirection.serverToClient,t.type=new pd.ProtocolRequestType(t.method)})(md||(ns.ShowDocumentRequest=md={}))});var _d=M(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.LinkedEditingRangeRequest=void 0;var yd=be(),vd;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=yd.MessageDirection.clientToServer,t.type=new yd.ProtocolRequestType(t.method)})(vd||(is.LinkedEditingRangeRequest=vd={}))});var Pd=M(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.WillDeleteFilesRequest=Ve.DidDeleteFilesNotification=Ve.DidRenameFilesNotification=Ve.WillRenameFilesRequest=Ve.DidCreateFilesNotification=Ve.WillCreateFilesRequest=Ve.FileOperationPatternKind=void 0;var ot=be(),bd;(function(t){t.file="file",t.folder="folder"})(bd||(Ve.FileOperationPatternKind=bd={}));var wd;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=ot.MessageDirection.clientToServer,t.type=new ot.ProtocolRequestType(t.method)})(wd||(Ve.WillCreateFilesRequest=wd={}));var Td;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=ot.MessageDirection.clientToServer,t.type=new ot.ProtocolNotificationType(t.method)})(Td||(Ve.DidCreateFilesNotification=Td={}));var Rd;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=ot.MessageDirection.clientToServer,t.type=new ot.ProtocolRequestType(t.method)})(Rd||(Ve.WillRenameFilesRequest=Rd={}));var kd;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=ot.MessageDirection.clientToServer,t.type=new ot.ProtocolNotificationType(t.method)})(kd||(Ve.DidRenameFilesNotification=kd={}));var Sd;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=ot.MessageDirection.clientToServer,t.type=new ot.ProtocolNotificationType(t.method)})(Sd||(Ve.DidDeleteFilesNotification=Sd={}));var Cd;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=ot.MessageDirection.clientToServer,t.type=new ot.ProtocolRequestType(t.method)})(Cd||(Ve.WillDeleteFilesRequest=Cd={}))});var Nd=M(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.MonikerRequest=ir.MonikerKind=ir.UniquenessLevel=void 0;var xd=be(),Dd;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(Dd||(ir.UniquenessLevel=Dd={}));var Ed;(function(t){t.$import="import",t.$export="export",t.local="local"})(Ed||(ir.MonikerKind=Ed={}));var Od;(function(t){t.method="textDocument/moniker",t.messageDirection=xd.MessageDirection.clientToServer,t.type=new xd.ProtocolRequestType(t.method)})(Od||(ir.MonikerRequest=Od={}))});var Id=M(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.TypeHierarchySubtypesRequest=sr.TypeHierarchySupertypesRequest=sr.TypeHierarchyPrepareRequest=void 0;var wn=be(),Md;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=wn.MessageDirection.clientToServer,t.type=new wn.ProtocolRequestType(t.method)})(Md||(sr.TypeHierarchyPrepareRequest=Md={}));var jd;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=wn.MessageDirection.clientToServer,t.type=new wn.ProtocolRequestType(t.method)})(jd||(sr.TypeHierarchySupertypesRequest=jd={}));var qd;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=wn.MessageDirection.clientToServer,t.type=new wn.ProtocolRequestType(t.method)})(qd||(sr.TypeHierarchySubtypesRequest=qd={}))});var $d=M(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.InlineValueRefreshRequest=Tn.InlineValueRequest=void 0;var ss=be(),Ad;(function(t){t.method="textDocument/inlineValue",t.messageDirection=ss.MessageDirection.clientToServer,t.type=new ss.ProtocolRequestType(t.method)})(Ad||(Tn.InlineValueRequest=Ad={}));var Ld;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=ss.MessageDirection.serverToClient,t.type=new ss.ProtocolRequestType0(t.method)})(Ld||(Tn.InlineValueRefreshRequest=Ld={}))});var zd=M(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.InlayHintRefreshRequest=or.InlayHintResolveRequest=or.InlayHintRequest=void 0;var Rn=be(),Fd;(function(t){t.method="textDocument/inlayHint",t.messageDirection=Rn.MessageDirection.clientToServer,t.type=new Rn.ProtocolRequestType(t.method)})(Fd||(or.InlayHintRequest=Fd={}));var Wd;(function(t){t.method="inlayHint/resolve",t.messageDirection=Rn.MessageDirection.clientToServer,t.type=new Rn.ProtocolRequestType(t.method)})(Wd||(or.InlayHintResolveRequest=Wd={}));var Vd;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=Rn.MessageDirection.serverToClient,t.type=new Rn.ProtocolRequestType0(t.method)})(Vd||(or.InlayHintRefreshRequest=Vd={}))});var Qd=M(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.DiagnosticRefreshRequest=at.WorkspaceDiagnosticRequest=at.DocumentDiagnosticRequest=at.DocumentDiagnosticReportKind=at.DiagnosticServerCancellationData=void 0;var Gd=yr(),Rp=Zi(),kn=be(),Ud;(function(t){function e(r){let n=r;return n&&Rp.boolean(n.retriggerRequest)}t.is=e})(Ud||(at.DiagnosticServerCancellationData=Ud={}));var Bd;(function(t){t.Full="full",t.Unchanged="unchanged"})(Bd||(at.DocumentDiagnosticReportKind=Bd={}));var Hd;(function(t){t.method="textDocument/diagnostic",t.messageDirection=kn.MessageDirection.clientToServer,t.type=new kn.ProtocolRequestType(t.method),t.partialResult=new Gd.ProgressType})(Hd||(at.DocumentDiagnosticRequest=Hd={}));var Zd;(function(t){t.method="workspace/diagnostic",t.messageDirection=kn.MessageDirection.clientToServer,t.type=new kn.ProtocolRequestType(t.method),t.partialResult=new Gd.ProgressType})(Zd||(at.WorkspaceDiagnosticRequest=Zd={}));var Jd;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=kn.MessageDirection.serverToClient,t.type=new kn.ProtocolRequestType0(t.method)})(Jd||(at.DiagnosticRefreshRequest=Jd={}))});var nl=M(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.DidCloseNotebookDocumentNotification=Pe.DidSaveNotebookDocumentNotification=Pe.DidChangeNotebookDocumentNotification=Pe.NotebookCellArrayChange=Pe.DidOpenNotebookDocumentNotification=Pe.NotebookDocumentSyncRegistrationType=Pe.NotebookDocument=Pe.NotebookCell=Pe.ExecutionSummary=Pe.NotebookCellKind=void 0;var Qn=Hi(),yt=Zi(),Rt=be(),Ga;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}t.is=e})(Ga||(Pe.NotebookCellKind=Ga={}));var Qa;(function(t){function e(i,s){let d={executionOrder:i};return(s===!0||s===!1)&&(d.success=s),d}t.create=e;function r(i){let s=i;return yt.objectLiteral(s)&&Qn.uinteger.is(s.executionOrder)&&(s.success===void 0||yt.boolean(s.success))}t.is=r;function n(i,s){return i===s?!0:i==null||s===null||s===void 0?!1:i.executionOrder===s.executionOrder&&i.success===s.success}t.equals=n})(Qa||(Pe.ExecutionSummary=Qa={}));var os;(function(t){function e(s,d){return{kind:s,document:d}}t.create=e;function r(s){let d=s;return yt.objectLiteral(d)&&Ga.is(d.kind)&&Qn.DocumentUri.is(d.document)&&(d.metadata===void 0||yt.objectLiteral(d.metadata))}t.is=r;function n(s,d){let h=new Set;return s.document!==d.document&&h.add("document"),s.kind!==d.kind&&h.add("kind"),s.executionSummary!==d.executionSummary&&h.add("executionSummary"),(s.metadata!==void 0||d.metadata!==void 0)&&!i(s.metadata,d.metadata)&&h.add("metadata"),(s.executionSummary!==void 0||d.executionSummary!==void 0)&&!Qa.equals(s.executionSummary,d.executionSummary)&&h.add("executionSummary"),h}t.diff=n;function i(s,d){if(s===d)return!0;if(s==null||d===null||d===void 0||typeof s!=typeof d||typeof s!="object")return!1;let h=Array.isArray(s),R=Array.isArray(d);if(h!==R)return!1;if(h&&R){if(s.length!==d.length)return!1;for(let T=0;T<s.length;T++)if(!i(s[T],d[T]))return!1}if(yt.objectLiteral(s)&&yt.objectLiteral(d)){let T=Object.keys(s),P=Object.keys(d);if(T.length!==P.length||(T.sort(),P.sort(),!i(T,P)))return!1;for(let Z=0;Z<T.length;Z++){let se=T[Z];if(!i(s[se],d[se]))return!1}}return!0}})(os||(Pe.NotebookCell=os={}));var Xd;(function(t){function e(n,i,s,d){return{uri:n,notebookType:i,version:s,cells:d}}t.create=e;function r(n){let i=n;return yt.objectLiteral(i)&&yt.string(i.uri)&&Qn.integer.is(i.version)&&yt.typedArray(i.cells,os.is)}t.is=r})(Xd||(Pe.NotebookDocument=Xd={}));var Sn;(function(t){t.method="notebookDocument/sync",t.messageDirection=Rt.MessageDirection.clientToServer,t.type=new Rt.RegistrationType(t.method)})(Sn||(Pe.NotebookDocumentSyncRegistrationType=Sn={}));var Yd;(function(t){t.method="notebookDocument/didOpen",t.messageDirection=Rt.MessageDirection.clientToServer,t.type=new Rt.ProtocolNotificationType(t.method),t.registrationMethod=Sn.method})(Yd||(Pe.DidOpenNotebookDocumentNotification=Yd={}));var Kd;(function(t){function e(n){let i=n;return yt.objectLiteral(i)&&Qn.uinteger.is(i.start)&&Qn.uinteger.is(i.deleteCount)&&(i.cells===void 0||yt.typedArray(i.cells,os.is))}t.is=e;function r(n,i,s){let d={start:n,deleteCount:i};return s!==void 0&&(d.cells=s),d}t.create=r})(Kd||(Pe.NotebookCellArrayChange=Kd={}));var el;(function(t){t.method="notebookDocument/didChange",t.messageDirection=Rt.MessageDirection.clientToServer,t.type=new Rt.ProtocolNotificationType(t.method),t.registrationMethod=Sn.method})(el||(Pe.DidChangeNotebookDocumentNotification=el={}));var tl;(function(t){t.method="notebookDocument/didSave",t.messageDirection=Rt.MessageDirection.clientToServer,t.type=new Rt.ProtocolNotificationType(t.method),t.registrationMethod=Sn.method})(tl||(Pe.DidSaveNotebookDocumentNotification=tl={}));var rl;(function(t){t.method="notebookDocument/didClose",t.messageDirection=Rt.MessageDirection.clientToServer,t.type=new Rt.ProtocolNotificationType(t.method),t.registrationMethod=Sn.method})(rl||(Pe.DidCloseNotebookDocumentNotification=rl={}))});var ol=M(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.InlineCompletionRequest=void 0;var il=be(),sl;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=il.MessageDirection.clientToServer,t.type=new il.ProtocolRequestType(t.method)})(sl||(as.InlineCompletionRequest=sl={}))});var bf=M(l=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0});l.WorkspaceSymbolRequest=l.CodeActionResolveRequest=l.CodeActionRequest=l.DocumentSymbolRequest=l.DocumentHighlightRequest=l.ReferencesRequest=l.DefinitionRequest=l.SignatureHelpRequest=l.SignatureHelpTriggerKind=l.HoverRequest=l.CompletionResolveRequest=l.CompletionRequest=l.CompletionTriggerKind=l.PublishDiagnosticsNotification=l.WatchKind=l.RelativePattern=l.FileChangeType=l.DidChangeWatchedFilesNotification=l.WillSaveTextDocumentWaitUntilRequest=l.WillSaveTextDocumentNotification=l.TextDocumentSaveReason=l.DidSaveTextDocumentNotification=l.DidCloseTextDocumentNotification=l.DidChangeTextDocumentNotification=l.TextDocumentContentChangeEvent=l.DidOpenTextDocumentNotification=l.TextDocumentSyncKind=l.TelemetryEventNotification=l.LogMessageNotification=l.ShowMessageRequest=l.ShowMessageNotification=l.MessageType=l.DidChangeConfigurationNotification=l.ExitNotification=l.ShutdownRequest=l.InitializedNotification=l.InitializeErrorCodes=l.InitializeRequest=l.WorkDoneProgressOptions=l.TextDocumentRegistrationOptions=l.StaticRegistrationOptions=l.PositionEncodingKind=l.FailureHandlingKind=l.ResourceOperationKind=l.UnregistrationRequest=l.RegistrationRequest=l.DocumentSelector=l.NotebookCellTextDocumentFilter=l.NotebookDocumentFilter=l.TextDocumentFilter=void 0;l.MonikerRequest=l.MonikerKind=l.UniquenessLevel=l.WillDeleteFilesRequest=l.DidDeleteFilesNotification=l.WillRenameFilesRequest=l.DidRenameFilesNotification=l.WillCreateFilesRequest=l.DidCreateFilesNotification=l.FileOperationPatternKind=l.LinkedEditingRangeRequest=l.ShowDocumentRequest=l.SemanticTokensRegistrationType=l.SemanticTokensRefreshRequest=l.SemanticTokensRangeRequest=l.SemanticTokensDeltaRequest=l.SemanticTokensRequest=l.TokenFormat=l.CallHierarchyPrepareRequest=l.CallHierarchyOutgoingCallsRequest=l.CallHierarchyIncomingCallsRequest=l.WorkDoneProgressCancelNotification=l.WorkDoneProgressCreateRequest=l.WorkDoneProgress=l.SelectionRangeRequest=l.DeclarationRequest=l.FoldingRangeRefreshRequest=l.FoldingRangeRequest=l.ColorPresentationRequest=l.DocumentColorRequest=l.ConfigurationRequest=l.DidChangeWorkspaceFoldersNotification=l.WorkspaceFoldersRequest=l.TypeDefinitionRequest=l.ImplementationRequest=l.ApplyWorkspaceEditRequest=l.ExecuteCommandRequest=l.PrepareRenameRequest=l.RenameRequest=l.PrepareSupportDefaultBehavior=l.DocumentOnTypeFormattingRequest=l.DocumentRangesFormattingRequest=l.DocumentRangeFormattingRequest=l.DocumentFormattingRequest=l.DocumentLinkResolveRequest=l.DocumentLinkRequest=l.CodeLensRefreshRequest=l.CodeLensResolveRequest=l.CodeLensRequest=l.WorkspaceSymbolResolveRequest=void 0;l.InlineCompletionRequest=l.DidCloseNotebookDocumentNotification=l.DidSaveNotebookDocumentNotification=l.DidChangeNotebookDocumentNotification=l.NotebookCellArrayChange=l.DidOpenNotebookDocumentNotification=l.NotebookDocumentSyncRegistrationType=l.NotebookDocument=l.NotebookCell=l.ExecutionSummary=l.NotebookCellKind=l.DiagnosticRefreshRequest=l.WorkspaceDiagnosticRequest=l.DocumentDiagnosticRequest=l.DocumentDiagnosticReportKind=l.DiagnosticServerCancellationData=l.InlayHintRefreshRequest=l.InlayHintResolveRequest=l.InlayHintRequest=l.InlineValueRefreshRequest=l.InlineValueRequest=l.TypeHierarchySupertypesRequest=l.TypeHierarchySubtypesRequest=l.TypeHierarchyPrepareRequest=void 0;var C=be(),al=Hi(),Ee=Zi(),kp=Nu();Object.defineProperty(l,"ImplementationRequest",{enumerable:!0,get:function(){return kp.ImplementationRequest}});var Sp=qu();Object.defineProperty(l,"TypeDefinitionRequest",{enumerable:!0,get:function(){return Sp.TypeDefinitionRequest}});var gf=Lu();Object.defineProperty(l,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return gf.WorkspaceFoldersRequest}});Object.defineProperty(l,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return gf.DidChangeWorkspaceFoldersNotification}});var Cp=Wu();Object.defineProperty(l,"ConfigurationRequest",{enumerable:!0,get:function(){return Cp.ConfigurationRequest}});var yf=Uu();Object.defineProperty(l,"DocumentColorRequest",{enumerable:!0,get:function(){return yf.DocumentColorRequest}});Object.defineProperty(l,"ColorPresentationRequest",{enumerable:!0,get:function(){return yf.ColorPresentationRequest}});var vf=Zu();Object.defineProperty(l,"FoldingRangeRequest",{enumerable:!0,get:function(){return vf.FoldingRangeRequest}});Object.defineProperty(l,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return vf.FoldingRangeRefreshRequest}});var Pp=Qu();Object.defineProperty(l,"DeclarationRequest",{enumerable:!0,get:function(){return Pp.DeclarationRequest}});var xp=Ku();Object.defineProperty(l,"SelectionRangeRequest",{enumerable:!0,get:function(){return xp.SelectionRangeRequest}});var tc=nd();Object.defineProperty(l,"WorkDoneProgress",{enumerable:!0,get:function(){return tc.WorkDoneProgress}});Object.defineProperty(l,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return tc.WorkDoneProgressCreateRequest}});Object.defineProperty(l,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return tc.WorkDoneProgressCancelNotification}});var rc=ad();Object.defineProperty(l,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return rc.CallHierarchyIncomingCallsRequest}});Object.defineProperty(l,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return rc.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(l,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return rc.CallHierarchyPrepareRequest}});var Cn=hd();Object.defineProperty(l,"TokenFormat",{enumerable:!0,get:function(){return Cn.TokenFormat}});Object.defineProperty(l,"SemanticTokensRequest",{enumerable:!0,get:function(){return Cn.SemanticTokensRequest}});Object.defineProperty(l,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return Cn.SemanticTokensDeltaRequest}});Object.defineProperty(l,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return Cn.SemanticTokensRangeRequest}});Object.defineProperty(l,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return Cn.SemanticTokensRefreshRequest}});Object.defineProperty(l,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return Cn.SemanticTokensRegistrationType}});var Dp=gd();Object.defineProperty(l,"ShowDocumentRequest",{enumerable:!0,get:function(){return Dp.ShowDocumentRequest}});var Ep=_d();Object.defineProperty(l,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return Ep.LinkedEditingRangeRequest}});var vr=Pd();Object.defineProperty(l,"FileOperationPatternKind",{enumerable:!0,get:function(){return vr.FileOperationPatternKind}});Object.defineProperty(l,"DidCreateFilesNotification",{enumerable:!0,get:function(){return vr.DidCreateFilesNotification}});Object.defineProperty(l,"WillCreateFilesRequest",{enumerable:!0,get:function(){return vr.WillCreateFilesRequest}});Object.defineProperty(l,"DidRenameFilesNotification",{enumerable:!0,get:function(){return vr.DidRenameFilesNotification}});Object.defineProperty(l,"WillRenameFilesRequest",{enumerable:!0,get:function(){return vr.WillRenameFilesRequest}});Object.defineProperty(l,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return vr.DidDeleteFilesNotification}});Object.defineProperty(l,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return vr.WillDeleteFilesRequest}});var nc=Nd();Object.defineProperty(l,"UniquenessLevel",{enumerable:!0,get:function(){return nc.UniquenessLevel}});Object.defineProperty(l,"MonikerKind",{enumerable:!0,get:function(){return nc.MonikerKind}});Object.defineProperty(l,"MonikerRequest",{enumerable:!0,get:function(){return nc.MonikerRequest}});var ic=Id();Object.defineProperty(l,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return ic.TypeHierarchyPrepareRequest}});Object.defineProperty(l,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return ic.TypeHierarchySubtypesRequest}});Object.defineProperty(l,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return ic.TypeHierarchySupertypesRequest}});var _f=$d();Object.defineProperty(l,"InlineValueRequest",{enumerable:!0,get:function(){return _f.InlineValueRequest}});Object.defineProperty(l,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return _f.InlineValueRefreshRequest}});var sc=zd();Object.defineProperty(l,"InlayHintRequest",{enumerable:!0,get:function(){return sc.InlayHintRequest}});Object.defineProperty(l,"InlayHintResolveRequest",{enumerable:!0,get:function(){return sc.InlayHintResolveRequest}});Object.defineProperty(l,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return sc.InlayHintRefreshRequest}});var Xn=Qd();Object.defineProperty(l,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Xn.DiagnosticServerCancellationData}});Object.defineProperty(l,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Xn.DocumentDiagnosticReportKind}});Object.defineProperty(l,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Xn.DocumentDiagnosticRequest}});Object.defineProperty(l,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Xn.WorkspaceDiagnosticRequest}});Object.defineProperty(l,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Xn.DiagnosticRefreshRequest}});var kt=nl();Object.defineProperty(l,"NotebookCellKind",{enumerable:!0,get:function(){return kt.NotebookCellKind}});Object.defineProperty(l,"ExecutionSummary",{enumerable:!0,get:function(){return kt.ExecutionSummary}});Object.defineProperty(l,"NotebookCell",{enumerable:!0,get:function(){return kt.NotebookCell}});Object.defineProperty(l,"NotebookDocument",{enumerable:!0,get:function(){return kt.NotebookDocument}});Object.defineProperty(l,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return kt.NotebookDocumentSyncRegistrationType}});Object.defineProperty(l,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return kt.DidOpenNotebookDocumentNotification}});Object.defineProperty(l,"NotebookCellArrayChange",{enumerable:!0,get:function(){return kt.NotebookCellArrayChange}});Object.defineProperty(l,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return kt.DidChangeNotebookDocumentNotification}});Object.defineProperty(l,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return kt.DidSaveNotebookDocumentNotification}});Object.defineProperty(l,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return kt.DidCloseNotebookDocumentNotification}});var Op=ol();Object.defineProperty(l,"InlineCompletionRequest",{enumerable:!0,get:function(){return Op.InlineCompletionRequest}});var Xa;(function(t){function e(r){let n=r;return Ee.string(n)||Ee.string(n.language)||Ee.string(n.scheme)||Ee.string(n.pattern)}t.is=e})(Xa||(l.TextDocumentFilter=Xa={}));var Ya;(function(t){function e(r){let n=r;return Ee.objectLiteral(n)&&(Ee.string(n.notebookType)||Ee.string(n.scheme)||Ee.string(n.pattern))}t.is=e})(Ya||(l.NotebookDocumentFilter=Ya={}));var Ka;(function(t){function e(r){let n=r;return Ee.objectLiteral(n)&&(Ee.string(n.notebook)||Ya.is(n.notebook))&&(n.language===void 0||Ee.string(n.language))}t.is=e})(Ka||(l.NotebookCellTextDocumentFilter=Ka={}));var ec;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!Ee.string(n)&&!Xa.is(n)&&!Ka.is(n))return!1;return!0}t.is=e})(ec||(l.DocumentSelector=ec={}));var cl;(function(t){t.method="client/registerCapability",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolRequestType(t.method)})(cl||(l.RegistrationRequest=cl={}));var ul;(function(t){t.method="client/unregisterCapability",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolRequestType(t.method)})(ul||(l.UnregistrationRequest=ul={}));var dl;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(dl||(l.ResourceOperationKind=dl={}));var ll;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(ll||(l.FailureHandlingKind=ll={}));var fl;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(fl||(l.PositionEncodingKind=fl={}));var hl;(function(t){function e(r){let n=r;return n&&Ee.string(n.id)&&n.id.length>0}t.hasId=e})(hl||(l.StaticRegistrationOptions=hl={}));var pl;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||ec.is(n.documentSelector))}t.is=e})(pl||(l.TextDocumentRegistrationOptions=pl={}));var ml;(function(t){function e(n){let i=n;return Ee.objectLiteral(i)&&(i.workDoneProgress===void 0||Ee.boolean(i.workDoneProgress))}t.is=e;function r(n){let i=n;return i&&Ee.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=r})(ml||(l.WorkDoneProgressOptions=ml={}));var gl;(function(t){t.method="initialize",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(gl||(l.InitializeRequest=gl={}));var yl;(function(t){t.unknownProtocolVersion=1})(yl||(l.InitializeErrorCodes=yl={}));var vl;(function(t){t.method="initialized",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(vl||(l.InitializedNotification=vl={}));var _l;(function(t){t.method="shutdown",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType0(t.method)})(_l||(l.ShutdownRequest=_l={}));var bl;(function(t){t.method="exit",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType0(t.method)})(bl||(l.ExitNotification=bl={}));var wl;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(wl||(l.DidChangeConfigurationNotification=wl={}));var Tl;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(Tl||(l.MessageType=Tl={}));var Rl;(function(t){t.method="window/showMessage",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolNotificationType(t.method)})(Rl||(l.ShowMessageNotification=Rl={}));var kl;(function(t){t.method="window/showMessageRequest",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolRequestType(t.method)})(kl||(l.ShowMessageRequest=kl={}));var Sl;(function(t){t.method="window/logMessage",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolNotificationType(t.method)})(Sl||(l.LogMessageNotification=Sl={}));var Cl;(function(t){t.method="telemetry/event",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolNotificationType(t.method)})(Cl||(l.TelemetryEventNotification=Cl={}));var Pl;(function(t){t.None=0,t.Full=1,t.Incremental=2})(Pl||(l.TextDocumentSyncKind=Pl={}));var xl;(function(t){t.method="textDocument/didOpen",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(xl||(l.DidOpenTextDocumentNotification=xl={}));var Dl;(function(t){function e(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}t.isIncremental=e;function r(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}t.isFull=r})(Dl||(l.TextDocumentContentChangeEvent=Dl={}));var El;(function(t){t.method="textDocument/didChange",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(El||(l.DidChangeTextDocumentNotification=El={}));var Ol;(function(t){t.method="textDocument/didClose",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(Ol||(l.DidCloseTextDocumentNotification=Ol={}));var Nl;(function(t){t.method="textDocument/didSave",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(Nl||(l.DidSaveTextDocumentNotification=Nl={}));var Ml;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(Ml||(l.TextDocumentSaveReason=Ml={}));var jl;(function(t){t.method="textDocument/willSave",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(jl||(l.WillSaveTextDocumentNotification=jl={}));var ql;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(ql||(l.WillSaveTextDocumentWaitUntilRequest=ql={}));var Il;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolNotificationType(t.method)})(Il||(l.DidChangeWatchedFilesNotification=Il={}));var Al;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(Al||(l.FileChangeType=Al={}));var Ll;(function(t){function e(r){let n=r;return Ee.objectLiteral(n)&&(al.URI.is(n.baseUri)||al.WorkspaceFolder.is(n.baseUri))&&Ee.string(n.pattern)}t.is=e})(Ll||(l.RelativePattern=Ll={}));var $l;(function(t){t.Create=1,t.Change=2,t.Delete=4})($l||(l.WatchKind=$l={}));var Fl;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolNotificationType(t.method)})(Fl||(l.PublishDiagnosticsNotification=Fl={}));var Wl;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(Wl||(l.CompletionTriggerKind=Wl={}));var Vl;(function(t){t.method="textDocument/completion",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Vl||(l.CompletionRequest=Vl={}));var zl;(function(t){t.method="completionItem/resolve",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(zl||(l.CompletionResolveRequest=zl={}));var Ul;(function(t){t.method="textDocument/hover",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Ul||(l.HoverRequest=Ul={}));var Bl;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(Bl||(l.SignatureHelpTriggerKind=Bl={}));var Hl;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Hl||(l.SignatureHelpRequest=Hl={}));var Zl;(function(t){t.method="textDocument/definition",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Zl||(l.DefinitionRequest=Zl={}));var Jl;(function(t){t.method="textDocument/references",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Jl||(l.ReferencesRequest=Jl={}));var Gl;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Gl||(l.DocumentHighlightRequest=Gl={}));var Ql;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Ql||(l.DocumentSymbolRequest=Ql={}));var Xl;(function(t){t.method="textDocument/codeAction",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Xl||(l.CodeActionRequest=Xl={}));var Yl;(function(t){t.method="codeAction/resolve",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Yl||(l.CodeActionResolveRequest=Yl={}));var Kl;(function(t){t.method="workspace/symbol",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(Kl||(l.WorkspaceSymbolRequest=Kl={}));var ef;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(ef||(l.WorkspaceSymbolResolveRequest=ef={}));var tf;(function(t){t.method="textDocument/codeLens",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(tf||(l.CodeLensRequest=tf={}));var rf;(function(t){t.method="codeLens/resolve",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(rf||(l.CodeLensResolveRequest=rf={}));var nf;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolRequestType0(t.method)})(nf||(l.CodeLensRefreshRequest=nf={}));var sf;(function(t){t.method="textDocument/documentLink",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(sf||(l.DocumentLinkRequest=sf={}));var of;(function(t){t.method="documentLink/resolve",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(of||(l.DocumentLinkResolveRequest=of={}));var af;(function(t){t.method="textDocument/formatting",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(af||(l.DocumentFormattingRequest=af={}));var cf;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(cf||(l.DocumentRangeFormattingRequest=cf={}));var uf;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(uf||(l.DocumentRangesFormattingRequest=uf={}));var df;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(df||(l.DocumentOnTypeFormattingRequest=df={}));var lf;(function(t){t.Identifier=1})(lf||(l.PrepareSupportDefaultBehavior=lf={}));var ff;(function(t){t.method="textDocument/rename",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(ff||(l.RenameRequest=ff={}));var hf;(function(t){t.method="textDocument/prepareRename",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(hf||(l.PrepareRenameRequest=hf={}));var pf;(function(t){t.method="workspace/executeCommand",t.messageDirection=C.MessageDirection.clientToServer,t.type=new C.ProtocolRequestType(t.method)})(pf||(l.ExecuteCommandRequest=pf={}));var mf;(function(t){t.method="workspace/applyEdit",t.messageDirection=C.MessageDirection.serverToClient,t.type=new C.ProtocolRequestType("workspace/applyEdit")})(mf||(l.ApplyWorkspaceEditRequest=mf={}))});var Tf=M(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.createProtocolConnection=void 0;var wf=yr();function Np(t,e,r,n){return wf.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,wf.createMessageConnection)(t,e,r,n)}cs.createProtocolConnection=Np});var kf=M(Xe=>{"use strict";var Mp=Xe&&Xe.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),us=Xe&&Xe.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Mp(e,t,r)};Object.defineProperty(Xe,"__esModule",{value:!0});Xe.LSPErrorCodes=Xe.createProtocolConnection=void 0;us(yr(),Xe);us(Hi(),Xe);us(be(),Xe);us(bf(),Xe);var jp=Tf();Object.defineProperty(Xe,"createProtocolConnection",{enumerable:!0,get:function(){return jp.createProtocolConnection}});var Rf;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(Rf||(Xe.LSPErrorCodes=Rf={}))});var Cf=M(St=>{"use strict";var qp=St&&St.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Sf=St&&St.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&qp(e,t,r)};Object.defineProperty(St,"__esModule",{value:!0});St.createProtocolConnection=void 0;var Ip=za();Sf(za(),St);Sf(kf(),St);function Ap(t,e,r,n){return(0,Ip.createMessageConnection)(t,e,r,n)}St.createProtocolConnection=Ap});var Wf=Yr(require("child_process")),ti=Yr(require("fs")),vs=Yr(require("path")),Vf=Yr(No()),_s=Yr(Gc()),uc=Yr(Cf());var et={};Kf(et,{BRAND:()=>um,DIRTY:()=>_r,EMPTY_PATH:()=>Wp,INVALID:()=>W,NEVER:()=>Zm,OK:()=>ze,ParseStatus:()=>Me,Schema:()=>K,ZodAny:()=>ur,ZodArray:()=>$t,ZodBigInt:()=>wr,ZodBoolean:()=>Tr,ZodBranded:()=>Kn,ZodCatch:()=>Mr,ZodDate:()=>Rr,ZodDefault:()=>Nr,ZodDiscriminatedUnion:()=>fs,ZodEffects:()=>dt,ZodEnum:()=>Er,ZodError:()=>Ye,ZodFirstPartyTypeKind:()=>U,ZodFunction:()=>ps,ZodIntersection:()=>Pr,ZodIssueCode:()=>S,ZodLazy:()=>xr,ZodLiteral:()=>Dr,ZodMap:()=>Nn,ZodNaN:()=>jn,ZodNativeEnum:()=>Or,ZodNever:()=>vt,ZodNull:()=>Sr,ZodNullable:()=>xt,ZodNumber:()=>br,ZodObject:()=>Ke,ZodOptional:()=>ct,ZodParsedType:()=>E,ZodPipeline:()=>ei,ZodPromise:()=>dr,ZodReadonly:()=>jr,ZodRecord:()=>hs,ZodSchema:()=>K,ZodSet:()=>Mn,ZodString:()=>cr,ZodSymbol:()=>En,ZodTransformer:()=>dt,ZodTuple:()=>Pt,ZodType:()=>K,ZodUndefined:()=>kr,ZodUnion:()=>Cr,ZodUnknown:()=>Lt,ZodVoid:()=>On,addIssueToContext:()=>x,any:()=>vm,array:()=>Tm,bigint:()=>hm,boolean:()=>Af,coerce:()=>Hm,custom:()=>jf,date:()=>pm,datetimeRegex:()=>Nf,defaultErrorMap:()=>It,discriminatedUnion:()=>Cm,effect:()=>Lm,enum:()=>qm,function:()=>Nm,getErrorMap:()=>Pn,getParsedType:()=>Ct,instanceof:()=>lm,intersection:()=>Pm,isAborted:()=>ds,isAsync:()=>xn,isDirty:()=>ls,isValid:()=>ar,late:()=>dm,lazy:()=>Mm,literal:()=>jm,makeIssue:()=>Yn,map:()=>Em,nan:()=>fm,nativeEnum:()=>Im,never:()=>bm,null:()=>ym,nullable:()=>Fm,number:()=>If,object:()=>Rm,objectUtil:()=>oc,oboolean:()=>Bm,onumber:()=>Um,optional:()=>$m,ostring:()=>zm,pipeline:()=>Vm,preprocess:()=>Wm,promise:()=>Am,quotelessJson:()=>Lp,record:()=>Dm,set:()=>Om,setErrorMap:()=>Fp,strictObject:()=>km,string:()=>qf,symbol:()=>mm,transformer:()=>Lm,tuple:()=>xm,undefined:()=>gm,union:()=>Sm,unknown:()=>_m,util:()=>ee,void:()=>wm});var ee;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let s={};for(let d of i)s[d]=d;return s},t.getValidEnumValues=i=>{let s=t.objectKeys(i).filter(h=>typeof i[i[h]]!="number"),d={};for(let h of s)d[h]=i[h];return t.objectValues(d)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let s=[];for(let d in i)Object.prototype.hasOwnProperty.call(i,d)&&s.push(d);return s},t.find=(i,s)=>{for(let d of i)if(s(d))return d},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(d=>typeof d=="string"?`'${d}'`:d).join(s)}t.joinValues=n,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(ee||(ee={}));var oc;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(oc||(oc={}));var E=ee.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ct=t=>{switch(typeof t){case"undefined":return E.undefined;case"string":return E.string;case"number":return Number.isNaN(t)?E.nan:E.number;case"boolean":return E.boolean;case"function":return E.function;case"bigint":return E.bigint;case"symbol":return E.symbol;case"object":return Array.isArray(t)?E.array:t===null?E.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?E.promise:typeof Map<"u"&&t instanceof Map?E.map:typeof Set<"u"&&t instanceof Set?E.set:typeof Date<"u"&&t instanceof Date?E.date:E.object;default:return E.unknown}};var S=ee.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Lp=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Ye=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(s){return s.message},n={_errors:[]},i=s=>{for(let d of s.issues)if(d.code==="invalid_union")d.unionErrors.map(i);else if(d.code==="invalid_return_type")i(d.returnTypeError);else if(d.code==="invalid_arguments")i(d.argumentsError);else if(d.path.length===0)n._errors.push(r(d));else{let h=n,R=0;for(;R<d.path.length;){let T=d.path[R];R===d.path.length-1?(h[T]=h[T]||{_errors:[]},h[T]._errors.push(r(d))):h[T]=h[T]||{_errors:[]},h=h[T],R++}}};return i(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ee.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Ye.create=t=>new Ye(t);var $p=(t,e)=>{let r;switch(t.code){case S.invalid_type:t.received===E.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case S.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,ee.jsonStringifyReplacer)}`;break;case S.unrecognized_keys:r=`Unrecognized key(s) in object: ${ee.joinValues(t.keys,", ")}`;break;case S.invalid_union:r="Invalid input";break;case S.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ee.joinValues(t.options)}`;break;case S.invalid_enum_value:r=`Invalid enum value. Expected ${ee.joinValues(t.options)}, received '${t.received}'`;break;case S.invalid_arguments:r="Invalid function arguments";break;case S.invalid_return_type:r="Invalid function return type";break;case S.invalid_date:r="Invalid date";break;case S.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:ee.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case S.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case S.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case S.custom:r="Invalid input";break;case S.invalid_intersection_types:r="Intersection results could not be merged";break;case S.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case S.not_finite:r="Number must be finite";break;default:r=e.defaultError,ee.assertNever(t)}return{message:r}},It=$p;var Pf=It;function Fp(t){Pf=t}function Pn(){return Pf}var Yn=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,s=[...r,...i.path||[]],d={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let h="",R=n.filter(T=>!!T).slice().reverse();for(let T of R)h=T(d,{data:e,defaultError:h}).message;return{...i,path:s,message:h}},Wp=[];function x(t,e){let r=Pn(),n=Yn({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===It?void 0:It].filter(i=>!!i)});t.common.issues.push(n)}var Me=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return W;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r){let s=await i.key,d=await i.value;n.push({key:s,value:d})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:s,value:d}=i;if(s.status==="aborted"||d.status==="aborted")return W;s.status==="dirty"&&e.dirty(),d.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof d.value<"u"||i.alwaysSet)&&(n[s.value]=d.value)}return{status:e.value,value:n}}},W=Object.freeze({status:"aborted"}),_r=t=>({status:"dirty",value:t}),ze=t=>({status:"valid",value:t}),ds=t=>t.status==="aborted",ls=t=>t.status==="dirty",ar=t=>t.status==="valid",xn=t=>typeof Promise<"u"&&t instanceof Promise;var j;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(j||(j={}));var ut=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},xf=(t,e)=>{if(ar(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Ye(t.common.issues);return this._error=r,this._error}}};function Y(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(d,h)=>{let{message:R}=t;return d.code==="invalid_enum_value"?{message:R??h.defaultError}:typeof h.data>"u"?{message:R??n??h.defaultError}:d.code!=="invalid_type"?{message:h.defaultError}:{message:R??r??h.defaultError}},description:i}}var K=class{get description(){return this._def.description}_getType(e){return Ct(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Ct(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Me,ctx:{common:e.parent.common,data:e.data,parsedType:Ct(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(xn(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ct(e)},i=this._parseSync({data:e,path:n.path,parent:n});return xf(n,i)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ct(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return ar(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>ar(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ct(e)},i=this._parse({data:e,path:n.path,parent:n}),s=await(xn(i)?i:Promise.resolve(i));return xf(n,s)}refine(e,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,s)=>{let d=e(i),h=()=>s.addIssue({code:S.custom,...n(i)});return typeof Promise<"u"&&d instanceof Promise?d.then(R=>R?!0:(h(),!1)):d?!0:(h(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new dt({schema:this,typeName:U.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return ct.create(this,this._def)}nullable(){return xt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return $t.create(this)}promise(){return dr.create(this,this._def)}or(e){return Cr.create([this,e],this._def)}and(e){return Pr.create(this,e,this._def)}transform(e){return new dt({...Y(this._def),schema:this,typeName:U.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Nr({...Y(this._def),innerType:this,defaultValue:r,typeName:U.ZodDefault})}brand(){return new Kn({typeName:U.ZodBranded,type:this,...Y(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Mr({...Y(this._def),innerType:this,catchValue:r,typeName:U.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return ei.create(this,e)}readonly(){return jr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Vp=/^c[^\s-]{8,}$/i,zp=/^[0-9a-z]+$/,Up=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Bp=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Hp=/^[a-z0-9_-]{21}$/i,Zp=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Jp=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Gp=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Qp="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ac,Xp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Yp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Kp=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,em=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,tm=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,rm=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ef="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",nm=new RegExp(`^${Ef}$`);function Of(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function im(t){return new RegExp(`^${Of(t)}$`)}function Nf(t){let e=`${Ef}T${Of(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function sm(t,e){return!!((e==="v4"||!e)&&Xp.test(t)||(e==="v6"||!e)&&Kp.test(t))}function om(t,e){if(!Zp.test(t))return!1;try{let[r]=t.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function am(t,e){return!!((e==="v4"||!e)&&Yp.test(t)||(e==="v6"||!e)&&em.test(t))}var cr=class t extends K{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==E.string){let s=this._getOrReturnCtx(e);return x(s,{code:S.invalid_type,expected:E.string,received:s.parsedType}),W}let n=new Me,i;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),x(i,{code:S.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),x(i,{code:S.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let d=e.data.length>s.value,h=e.data.length<s.value;(d||h)&&(i=this._getOrReturnCtx(e,i),d?x(i,{code:S.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):h&&x(i,{code:S.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")Gp.test(e.data)||(i=this._getOrReturnCtx(e,i),x(i,{validation:"email",code:S.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")ac||(ac=new RegExp(Qp,"u")),ac.test(e.data)||(i=this._getOrReturnCtx(e,i),x(i,{validation:"emoji",code:S.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")Bp.test(e.data)||(i=this._getOrReturnCtx(e,i),x(i,{validation:"uuid",code:S.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")Hp.test(e.data)||(i=this._getOrReturnCtx(e,i),x(i,{validation:"nanoid",code:S.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")Vp.test(e.data)||(i=this._getOrReturnCtx(e,i),x(i,{validation:"cuid",code:S.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")zp.test(e.data)||(i=this._getOrReturnCtx(e,i),x(i,{validation:"cuid2",code:S.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")Up.test(e.data)||(i=this._getOrReturnCtx(e,i),x(i,{validation:"ulid",code:S.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),x(i,{validation:"url",code:S.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),x(i,{validation:"regex",code:S.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),x(i,{code:S.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),x(i,{code:S.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),x(i,{code:S.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Nf(s).test(e.data)||(i=this._getOrReturnCtx(e,i),x(i,{code:S.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?nm.test(e.data)||(i=this._getOrReturnCtx(e,i),x(i,{code:S.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?im(s).test(e.data)||(i=this._getOrReturnCtx(e,i),x(i,{code:S.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?Jp.test(e.data)||(i=this._getOrReturnCtx(e,i),x(i,{validation:"duration",code:S.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?sm(e.data,s.version)||(i=this._getOrReturnCtx(e,i),x(i,{validation:"ip",code:S.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?om(e.data,s.alg)||(i=this._getOrReturnCtx(e,i),x(i,{validation:"jwt",code:S.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?am(e.data,s.version)||(i=this._getOrReturnCtx(e,i),x(i,{validation:"cidr",code:S.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?tm.test(e.data)||(i=this._getOrReturnCtx(e,i),x(i,{validation:"base64",code:S.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?rm.test(e.data)||(i=this._getOrReturnCtx(e,i),x(i,{validation:"base64url",code:S.invalid_string,message:s.message}),n.dirty()):ee.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:S.invalid_string,...j.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...j.errToObj(e)})}url(e){return this._addCheck({kind:"url",...j.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...j.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...j.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...j.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...j.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...j.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...j.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...j.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...j.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...j.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...j.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...j.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...j.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...j.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...j.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...j.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...j.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...j.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...j.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...j.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...j.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...j.errToObj(r)})}nonempty(e){return this.min(1,j.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};cr.create=t=>new cr({checks:[],typeName:U.ZodString,coerce:t?.coerce??!1,...Y(t)});function cm(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,s=Number.parseInt(t.toFixed(i).replace(".","")),d=Number.parseInt(e.toFixed(i).replace(".",""));return s%d/10**i}var br=class t extends K{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==E.number){let s=this._getOrReturnCtx(e);return x(s,{code:S.invalid_type,expected:E.number,received:s.parsedType}),W}let n,i=new Me;for(let s of this._def.checks)s.kind==="int"?ee.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{code:S.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),x(n,{code:S.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),x(n,{code:S.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?cm(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),x(n,{code:S.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{code:S.not_finite,message:s.message}),i.dirty()):ee.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,j.toString(r))}gt(e,r){return this.setLimit("min",e,!1,j.toString(r))}lte(e,r){return this.setLimit("max",e,!0,j.toString(r))}lt(e,r){return this.setLimit("max",e,!1,j.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:j.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:j.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:j.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:j.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:j.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:j.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:j.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:j.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:j.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:j.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ee.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};br.create=t=>new br({checks:[],typeName:U.ZodNumber,coerce:t?.coerce||!1,...Y(t)});var wr=class t extends K{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==E.bigint)return this._getInvalidInput(e);let n,i=new Me;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),x(n,{code:S.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),x(n,{code:S.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),x(n,{code:S.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):ee.assertNever(s);return{status:i.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return x(r,{code:S.invalid_type,expected:E.bigint,received:r.parsedType}),W}gte(e,r){return this.setLimit("min",e,!0,j.toString(r))}gt(e,r){return this.setLimit("min",e,!1,j.toString(r))}lte(e,r){return this.setLimit("max",e,!0,j.toString(r))}lt(e,r){return this.setLimit("max",e,!1,j.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:j.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:j.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:j.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:j.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:j.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:j.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};wr.create=t=>new wr({checks:[],typeName:U.ZodBigInt,coerce:t?.coerce??!1,...Y(t)});var Tr=class extends K{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==E.boolean){let n=this._getOrReturnCtx(e);return x(n,{code:S.invalid_type,expected:E.boolean,received:n.parsedType}),W}return ze(e.data)}};Tr.create=t=>new Tr({typeName:U.ZodBoolean,coerce:t?.coerce||!1,...Y(t)});var Rr=class t extends K{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==E.date){let s=this._getOrReturnCtx(e);return x(s,{code:S.invalid_type,expected:E.date,received:s.parsedType}),W}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return x(s,{code:S.invalid_date}),W}let n=new Me,i;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),x(i,{code:S.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),x(i,{code:S.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):ee.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:j.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:j.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Rr.create=t=>new Rr({checks:[],coerce:t?.coerce||!1,typeName:U.ZodDate,...Y(t)});var En=class extends K{_parse(e){if(this._getType(e)!==E.symbol){let n=this._getOrReturnCtx(e);return x(n,{code:S.invalid_type,expected:E.symbol,received:n.parsedType}),W}return ze(e.data)}};En.create=t=>new En({typeName:U.ZodSymbol,...Y(t)});var kr=class extends K{_parse(e){if(this._getType(e)!==E.undefined){let n=this._getOrReturnCtx(e);return x(n,{code:S.invalid_type,expected:E.undefined,received:n.parsedType}),W}return ze(e.data)}};kr.create=t=>new kr({typeName:U.ZodUndefined,...Y(t)});var Sr=class extends K{_parse(e){if(this._getType(e)!==E.null){let n=this._getOrReturnCtx(e);return x(n,{code:S.invalid_type,expected:E.null,received:n.parsedType}),W}return ze(e.data)}};Sr.create=t=>new Sr({typeName:U.ZodNull,...Y(t)});var ur=class extends K{constructor(){super(...arguments),this._any=!0}_parse(e){return ze(e.data)}};ur.create=t=>new ur({typeName:U.ZodAny,...Y(t)});var Lt=class extends K{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ze(e.data)}};Lt.create=t=>new Lt({typeName:U.ZodUnknown,...Y(t)});var vt=class extends K{_parse(e){let r=this._getOrReturnCtx(e);return x(r,{code:S.invalid_type,expected:E.never,received:r.parsedType}),W}};vt.create=t=>new vt({typeName:U.ZodNever,...Y(t)});var On=class extends K{_parse(e){if(this._getType(e)!==E.undefined){let n=this._getOrReturnCtx(e);return x(n,{code:S.invalid_type,expected:E.void,received:n.parsedType}),W}return ze(e.data)}};On.create=t=>new On({typeName:U.ZodVoid,...Y(t)});var $t=class t extends K{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==E.array)return x(r,{code:S.invalid_type,expected:E.array,received:r.parsedType}),W;if(i.exactLength!==null){let d=r.data.length>i.exactLength.value,h=r.data.length<i.exactLength.value;(d||h)&&(x(r,{code:d?S.too_big:S.too_small,minimum:h?i.exactLength.value:void 0,maximum:d?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(x(r,{code:S.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(x(r,{code:S.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((d,h)=>i.type._parseAsync(new ut(r,d,r.path,h)))).then(d=>Me.mergeArray(n,d));let s=[...r.data].map((d,h)=>i.type._parseSync(new ut(r,d,r.path,h)));return Me.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:j.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:j.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:j.toString(r)}})}nonempty(e){return this.min(1,e)}};$t.create=(t,e)=>new $t({type:t,minLength:null,maxLength:null,exactLength:null,typeName:U.ZodArray,...Y(e)});function Dn(t){if(t instanceof Ke){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=ct.create(Dn(n))}return new Ke({...t._def,shape:()=>e})}else return t instanceof $t?new $t({...t._def,type:Dn(t.element)}):t instanceof ct?ct.create(Dn(t.unwrap())):t instanceof xt?xt.create(Dn(t.unwrap())):t instanceof Pt?Pt.create(t.items.map(e=>Dn(e))):t}var Ke=class t extends K{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=ee.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==E.object){let T=this._getOrReturnCtx(e);return x(T,{code:S.invalid_type,expected:E.object,received:T.parsedType}),W}let{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:d}=this._getCached(),h=[];if(!(this._def.catchall instanceof vt&&this._def.unknownKeys==="strip"))for(let T in i.data)d.includes(T)||h.push(T);let R=[];for(let T of d){let P=s[T],Z=i.data[T];R.push({key:{status:"valid",value:T},value:P._parse(new ut(i,Z,i.path,T)),alwaysSet:T in i.data})}if(this._def.catchall instanceof vt){let T=this._def.unknownKeys;if(T==="passthrough")for(let P of h)R.push({key:{status:"valid",value:P},value:{status:"valid",value:i.data[P]}});else if(T==="strict")h.length>0&&(x(i,{code:S.unrecognized_keys,keys:h}),n.dirty());else if(T!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let T=this._def.catchall;for(let P of h){let Z=i.data[P];R.push({key:{status:"valid",value:P},value:T._parse(new ut(i,Z,i.path,P)),alwaysSet:P in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let T=[];for(let P of R){let Z=await P.key,se=await P.value;T.push({key:Z,value:se,alwaysSet:P.alwaysSet})}return T}).then(T=>Me.mergeObjectSync(n,T)):Me.mergeObjectSync(n,R)}get shape(){return this._def.shape()}strict(e){return j.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{let i=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:j.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:U.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of ee.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let n of ee.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return Dn(this)}partial(e){let r={};for(let n of ee.objectKeys(this.shape)){let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let n of ee.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof ct;)s=s._def.innerType;r[n]=s}return new t({...this._def,shape:()=>r})}keyof(){return Mf(ee.objectKeys(this.shape))}};Ke.create=(t,e)=>new Ke({shape:()=>t,unknownKeys:"strip",catchall:vt.create(),typeName:U.ZodObject,...Y(e)});Ke.strictCreate=(t,e)=>new Ke({shape:()=>t,unknownKeys:"strict",catchall:vt.create(),typeName:U.ZodObject,...Y(e)});Ke.lazycreate=(t,e)=>new Ke({shape:t,unknownKeys:"strip",catchall:vt.create(),typeName:U.ZodObject,...Y(e)});var Cr=class extends K{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(s){for(let h of s)if(h.result.status==="valid")return h.result;for(let h of s)if(h.result.status==="dirty")return r.common.issues.push(...h.ctx.common.issues),h.result;let d=s.map(h=>new Ye(h.ctx.common.issues));return x(r,{code:S.invalid_union,unionErrors:d}),W}if(r.common.async)return Promise.all(n.map(async s=>{let d={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:d}),ctx:d}})).then(i);{let s,d=[];for(let R of n){let T={...r,common:{...r.common,issues:[]},parent:null},P=R._parseSync({data:r.data,path:r.path,parent:T});if(P.status==="valid")return P;P.status==="dirty"&&!s&&(s={result:P,ctx:T}),T.common.issues.length&&d.push(T.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let h=d.map(R=>new Ye(R));return x(r,{code:S.invalid_union,unionErrors:h}),W}}get options(){return this._def.options}};Cr.create=(t,e)=>new Cr({options:t,typeName:U.ZodUnion,...Y(e)});var At=t=>t instanceof xr?At(t.schema):t instanceof dt?At(t.innerType()):t instanceof Dr?[t.value]:t instanceof Er?t.options:t instanceof Or?ee.objectValues(t.enum):t instanceof Nr?At(t._def.innerType):t instanceof kr?[void 0]:t instanceof Sr?[null]:t instanceof ct?[void 0,...At(t.unwrap())]:t instanceof xt?[null,...At(t.unwrap())]:t instanceof Kn||t instanceof jr?At(t.unwrap()):t instanceof Mr?At(t._def.innerType):[],fs=class t extends K{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==E.object)return x(r,{code:S.invalid_type,expected:E.object,received:r.parsedType}),W;let n=this.discriminator,i=r.data[n],s=this.optionsMap.get(i);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(x(r,{code:S.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),W)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let s of r){let d=At(s.shape[e]);if(!d.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let h of d){if(i.has(h))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(h)}`);i.set(h,s)}}return new t({typeName:U.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Y(n)})}};function cc(t,e){let r=Ct(t),n=Ct(e);if(t===e)return{valid:!0,data:t};if(r===E.object&&n===E.object){let i=ee.objectKeys(e),s=ee.objectKeys(t).filter(h=>i.indexOf(h)!==-1),d={...t,...e};for(let h of s){let R=cc(t[h],e[h]);if(!R.valid)return{valid:!1};d[h]=R.data}return{valid:!0,data:d}}else if(r===E.array&&n===E.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let s=0;s<t.length;s++){let d=t[s],h=e[s],R=cc(d,h);if(!R.valid)return{valid:!1};i.push(R.data)}return{valid:!0,data:i}}else return r===E.date&&n===E.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Pr=class extends K{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(s,d)=>{if(ds(s)||ds(d))return W;let h=cc(s.value,d.value);return h.valid?((ls(s)||ls(d))&&r.dirty(),{status:r.value,value:h.data}):(x(n,{code:S.invalid_intersection_types}),W)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,d])=>i(s,d)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Pr.create=(t,e,r)=>new Pr({left:t,right:e,typeName:U.ZodIntersection,...Y(r)});var Pt=class t extends K{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==E.array)return x(n,{code:S.invalid_type,expected:E.array,received:n.parsedType}),W;if(n.data.length<this._def.items.length)return x(n,{code:S.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),W;!this._def.rest&&n.data.length>this._def.items.length&&(x(n,{code:S.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((d,h)=>{let R=this._def.items[h]||this._def.rest;return R?R._parse(new ut(n,d,n.path,h)):null}).filter(d=>!!d);return n.common.async?Promise.all(s).then(d=>Me.mergeArray(r,d)):Me.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Pt.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Pt({items:t,typeName:U.ZodTuple,rest:null,...Y(e)})};var hs=class t extends K{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==E.object)return x(n,{code:S.invalid_type,expected:E.object,received:n.parsedType}),W;let i=[],s=this._def.keyType,d=this._def.valueType;for(let h in n.data)i.push({key:s._parse(new ut(n,h,n.path,h)),value:d._parse(new ut(n,n.data[h],n.path,h)),alwaysSet:h in n.data});return n.common.async?Me.mergeObjectAsync(r,i):Me.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof K?new t({keyType:e,valueType:r,typeName:U.ZodRecord,...Y(n)}):new t({keyType:cr.create(),valueType:e,typeName:U.ZodRecord,...Y(r)})}},Nn=class extends K{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==E.map)return x(n,{code:S.invalid_type,expected:E.map,received:n.parsedType}),W;let i=this._def.keyType,s=this._def.valueType,d=[...n.data.entries()].map(([h,R],T)=>({key:i._parse(new ut(n,h,n.path,[T,"key"])),value:s._parse(new ut(n,R,n.path,[T,"value"]))}));if(n.common.async){let h=new Map;return Promise.resolve().then(async()=>{for(let R of d){let T=await R.key,P=await R.value;if(T.status==="aborted"||P.status==="aborted")return W;(T.status==="dirty"||P.status==="dirty")&&r.dirty(),h.set(T.value,P.value)}return{status:r.value,value:h}})}else{let h=new Map;for(let R of d){let T=R.key,P=R.value;if(T.status==="aborted"||P.status==="aborted")return W;(T.status==="dirty"||P.status==="dirty")&&r.dirty(),h.set(T.value,P.value)}return{status:r.value,value:h}}}};Nn.create=(t,e,r)=>new Nn({valueType:e,keyType:t,typeName:U.ZodMap,...Y(r)});var Mn=class t extends K{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==E.set)return x(n,{code:S.invalid_type,expected:E.set,received:n.parsedType}),W;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(x(n,{code:S.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(x(n,{code:S.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let s=this._def.valueType;function d(R){let T=new Set;for(let P of R){if(P.status==="aborted")return W;P.status==="dirty"&&r.dirty(),T.add(P.value)}return{status:r.value,value:T}}let h=[...n.data.values()].map((R,T)=>s._parse(new ut(n,R,n.path,T)));return n.common.async?Promise.all(h).then(R=>d(R)):d(h)}min(e,r){return new t({...this._def,minSize:{value:e,message:j.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:j.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};Mn.create=(t,e)=>new Mn({valueType:t,minSize:null,maxSize:null,typeName:U.ZodSet,...Y(e)});var ps=class t extends K{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==E.function)return x(r,{code:S.invalid_type,expected:E.function,received:r.parsedType}),W;function n(h,R){return Yn({data:h,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Pn(),It].filter(T=>!!T),issueData:{code:S.invalid_arguments,argumentsError:R}})}function i(h,R){return Yn({data:h,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Pn(),It].filter(T=>!!T),issueData:{code:S.invalid_return_type,returnTypeError:R}})}let s={errorMap:r.common.contextualErrorMap},d=r.data;if(this._def.returns instanceof dr){let h=this;return ze(async function(...R){let T=new Ye([]),P=await h._def.args.parseAsync(R,s).catch(ce=>{throw T.addIssue(n(R,ce)),T}),Z=await Reflect.apply(d,this,P);return await h._def.returns._def.type.parseAsync(Z,s).catch(ce=>{throw T.addIssue(i(Z,ce)),T})})}else{let h=this;return ze(function(...R){let T=h._def.args.safeParse(R,s);if(!T.success)throw new Ye([n(R,T.error)]);let P=Reflect.apply(d,this,T.data),Z=h._def.returns.safeParse(P,s);if(!Z.success)throw new Ye([i(P,Z.error)]);return Z.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Pt.create(e).rest(Lt.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||Pt.create([]).rest(Lt.create()),returns:r||Lt.create(),typeName:U.ZodFunction,...Y(n)})}},xr=class extends K{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};xr.create=(t,e)=>new xr({getter:t,typeName:U.ZodLazy,...Y(e)});var Dr=class extends K{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return x(r,{received:r.data,code:S.invalid_literal,expected:this._def.value}),W}return{status:"valid",value:e.data}}get value(){return this._def.value}};Dr.create=(t,e)=>new Dr({value:t,typeName:U.ZodLiteral,...Y(e)});function Mf(t,e){return new Er({values:t,typeName:U.ZodEnum,...Y(e)})}var Er=class t extends K{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return x(r,{expected:ee.joinValues(n),received:r.parsedType,code:S.invalid_type}),W}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return x(r,{received:r.data,code:S.invalid_enum_value,options:n}),W}return ze(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};Er.create=Mf;var Or=class extends K{_parse(e){let r=ee.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==E.string&&n.parsedType!==E.number){let i=ee.objectValues(r);return x(n,{expected:ee.joinValues(i),received:n.parsedType,code:S.invalid_type}),W}if(this._cache||(this._cache=new Set(ee.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=ee.objectValues(r);return x(n,{received:n.data,code:S.invalid_enum_value,options:i}),W}return ze(e.data)}get enum(){return this._def.values}};Or.create=(t,e)=>new Or({values:t,typeName:U.ZodNativeEnum,...Y(e)});var dr=class extends K{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==E.promise&&r.common.async===!1)return x(r,{code:S.invalid_type,expected:E.promise,received:r.parsedType}),W;let n=r.parsedType===E.promise?r.data:Promise.resolve(r.data);return ze(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};dr.create=(t,e)=>new dr({type:t,typeName:U.ZodPromise,...Y(e)});var dt=class extends K{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===U.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:d=>{x(n,d),d.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){let d=i.transform(n.data,s);if(n.common.async)return Promise.resolve(d).then(async h=>{if(r.value==="aborted")return W;let R=await this._def.schema._parseAsync({data:h,path:n.path,parent:n});return R.status==="aborted"?W:R.status==="dirty"?_r(R.value):r.value==="dirty"?_r(R.value):R});{if(r.value==="aborted")return W;let h=this._def.schema._parseSync({data:d,path:n.path,parent:n});return h.status==="aborted"?W:h.status==="dirty"?_r(h.value):r.value==="dirty"?_r(h.value):h}}if(i.type==="refinement"){let d=h=>{let R=i.refinement(h,s);if(n.common.async)return Promise.resolve(R);if(R instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return h};if(n.common.async===!1){let h=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return h.status==="aborted"?W:(h.status==="dirty"&&r.dirty(),d(h.value),{status:r.value,value:h.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(h=>h.status==="aborted"?W:(h.status==="dirty"&&r.dirty(),d(h.value).then(()=>({status:r.value,value:h.value}))))}if(i.type==="transform")if(n.common.async===!1){let d=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ar(d))return W;let h=i.transform(d.value,s);if(h instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:h}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(d=>ar(d)?Promise.resolve(i.transform(d.value,s)).then(h=>({status:r.value,value:h})):W);ee.assertNever(i)}};dt.create=(t,e,r)=>new dt({schema:t,typeName:U.ZodEffects,effect:e,...Y(r)});dt.createWithPreprocess=(t,e,r)=>new dt({schema:e,effect:{type:"preprocess",transform:t},typeName:U.ZodEffects,...Y(r)});var ct=class extends K{_parse(e){return this._getType(e)===E.undefined?ze(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ct.create=(t,e)=>new ct({innerType:t,typeName:U.ZodOptional,...Y(e)});var xt=class extends K{_parse(e){return this._getType(e)===E.null?ze(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};xt.create=(t,e)=>new xt({innerType:t,typeName:U.ZodNullable,...Y(e)});var Nr=class extends K{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===E.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Nr.create=(t,e)=>new Nr({innerType:t,typeName:U.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Y(e)});var Mr=class extends K{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return xn(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ye(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ye(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Mr.create=(t,e)=>new Mr({innerType:t,typeName:U.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Y(e)});var jn=class extends K{_parse(e){if(this._getType(e)!==E.nan){let n=this._getOrReturnCtx(e);return x(n,{code:S.invalid_type,expected:E.nan,received:n.parsedType}),W}return{status:"valid",value:e.data}}};jn.create=t=>new jn({typeName:U.ZodNaN,...Y(t)});var um=Symbol("zod_brand"),Kn=class extends K{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},ei=class t extends K{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?W:s.status==="dirty"?(r.dirty(),_r(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?W:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:U.ZodPipeline})}},jr=class extends K{_parse(e){let r=this._def.innerType._parse(e),n=i=>(ar(i)&&(i.value=Object.freeze(i.value)),i);return xn(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};jr.create=(t,e)=>new jr({innerType:t,typeName:U.ZodReadonly,...Y(e)});function Df(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function jf(t,e={},r){return t?ur.create().superRefine((n,i)=>{let s=t(n);if(s instanceof Promise)return s.then(d=>{if(!d){let h=Df(e,n),R=h.fatal??r??!0;i.addIssue({code:"custom",...h,fatal:R})}});if(!s){let d=Df(e,n),h=d.fatal??r??!0;i.addIssue({code:"custom",...d,fatal:h})}}):ur.create()}var dm={object:Ke.lazycreate},U;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(U||(U={}));var lm=(t,e={message:`Input not instance of ${t.name}`})=>jf(r=>r instanceof t,e),qf=cr.create,If=br.create,fm=jn.create,hm=wr.create,Af=Tr.create,pm=Rr.create,mm=En.create,gm=kr.create,ym=Sr.create,vm=ur.create,_m=Lt.create,bm=vt.create,wm=On.create,Tm=$t.create,Rm=Ke.create,km=Ke.strictCreate,Sm=Cr.create,Cm=fs.create,Pm=Pr.create,xm=Pt.create,Dm=hs.create,Em=Nn.create,Om=Mn.create,Nm=ps.create,Mm=xr.create,jm=Dr.create,qm=Er.create,Im=Or.create,Am=dr.create,Lm=dt.create,$m=ct.create,Fm=xt.create,Wm=dt.createWithPreprocess,Vm=ei.create,zm=()=>qf().optional(),Um=()=>If().optional(),Bm=()=>Af().optional(),Hm={string:t=>cr.create({...t,coerce:!0}),number:t=>br.create({...t,coerce:!0}),boolean:t=>Tr.create({...t,coerce:!0}),bigint:t=>wr.create({...t,coerce:!0}),date:t=>Rr.create({...t,coerce:!0})};var Zm=W;var zf=require("node:util"),Jm=__dirname.endsWith("src"),Gm=Jm?vs.default.join(__dirname,"..","dist","server.js"):vs.default.join(__dirname,"server.js");function Qm(t){let e=vs.default.resolve(t);return e=e.replace(/\\/g,"/"),e.startsWith("/")||(e="/"+e),`file://${e}`}function Xm(){let t=process.env;return!!(t.CI&&(t.GITHUB_ACTIONS||t.GITLAB_CI||t.BITBUCKET_BUILD_NUMBER||t.CIRCLECI||t.TRAVIS))}var Uf=Xm(),fc=()=>Uf?"::group::":"",hc=()=>Uf?"::endgroup::":"",Ym=et.object({files:et.array(et.string(),{required_error:"Missing --files"}),includes:et.array(et.string()).optional().default([]),bindings:et.array(et.string()).optional().default([]),logLevel:et.enum(["none","verbose"]).optional().default("none"),formatting:et.boolean().optional().default(!1),diagnostics:et.boolean().optional().default(!1),outFile:et.string().optional()}),{values:Km}=(0,zf.parseArgs)({options:{files:{type:"string",multiple:!0},includes:{type:"string",multiple:!0},bindings:{type:"string",multiple:!0},logLevel:{type:"string"},formatting:{type:"boolean"},diagnostics:{type:"boolean"},outFile:{type:"string"}},strict:!0}),dc=Ym.safeParse(Km);dc.success||(console.error(`\u274C Invalid CLI input:
67
+ `,dc.error.format()),process.exit(1));var qr=dc.data,Bf=qr.files,eg=qr.includes,tg=qr.bindings,rg=qr.logLevel,Lf=qr.formatting,$f=qr.diagnostics,Hf=qr.outFile;ig(Bf,rg,eg,tg,Hf).catch(t=>{console.error("Error validating files:",t),process.exit(1)});var Ff=0,ng=Bf.length,ms=new Map,gs=[],qn=[];async function ig(t,e,r,n,i){let s=Wf.default.spawn(Gm,["--stdio"],{stdio:["pipe","pipe","pipe"]});s.stderr.on("data",P=>{console.error("LSP stderr:",P.toString())});let d=(0,Vf.createMessageConnection)(new _s.StreamMessageReader(s.stdout),new _s.StreamMessageWriter(s.stdin));e==="verbose"&&d.onNotification("window/logMessage",P=>{let se={1:"ERROR",2:"WARN",3:"INFO",4:"LOG"}[P.type]||"LOG";console.log(`[LSP ${se}] ${P.message}`)}),d.onRequest("workspace/workspaceFolders",()=>[{uri:`file://${process.cwd()}`,name:"root"}]),d.listen(),d.sendNotification("workspace/didChangeConfiguration",{settings:{devicetree:{defaultIncludePaths:r,defaultBindingType:"Zephyr",defaultZephyrBindings:n,autoChangeContext:!0,allowAdhocContexts:!0,defaultLockRenameEdits:[]}}});let h=[{uri:Qm(process.cwd()),name:"root"}];await d.sendRequest("initialize",{processId:process.pid,rootUri:`file://${process.cwd()}`,capabilities:{},workspaceFolders:h}),await d.sendNotification("initialized");let R=new Set,T=Array.from(new Set(t)).sort((P,Z)=>{let se=ce=>ce.endsWith(".dts")?0:ce.endsWith(".dtsi")?1:2;return se(P)-se(Z)});for(let P of T){Ff++;let Z=ti.default.readFileSync(P,"utf8"),se={uri:`file://${P}`,languageId:"devicetree",version:0,text:Z};d.sendNotification("textDocument/didOpen",{textDocument:se});let ce=await ag(d),Ue=P.endsWith(".overlay")?[ce.mainDtsPath.file]:[...lc(ce.mainDtsPath),...ce.overlays.flatMap(lc)].filter(ue=>!ue.endsWith(".h")&&(0,ti.existsSync)(ue)),Se=ue=>ue===P,we=(ue,de)=>ue?`[${Ff}/${ng}]`:`[${de}/${Ue.length-1}]`.padEnd((Ue.length-1).toString().length*2+3," ");Lf&&await Promise.all(Ue.map(async(ue,de)=>{let O=Se(ue);await sg(d,ue,O,we(O,de),ce),R.add(ue)})),$f&&await Promise.all(Ue.map(async(ue,de)=>{let O=Se(ue);if(P.endsWith(".dts")){let pe=await og(d,ue,O,we(O,de));pe?.length&&qn.push({file:ue,context:ce,message:pe.map($=>`${$.message}: {${JSON.stringify($.range.start)}}-{${JSON.stringify($.range.end)}}`).join(`
68
+ `)})}else console.log(`[${we(O,de)}] \u26A0\uFE0F Skipping ${ue} diagnostic check. Check can only be done on full context!`);R.add(ue)})),d.sendNotification("textDocument/didClose",{textDocument:{uri:`file://${P}`}}),await cg(d)}i&&ti.default.writeFileSync(i,Array.from(ms.values()).join(`
69
69
 
70
70
  `)),console.log("Processed",R.size,"files"),d.dispose(),s.kill(),Lf&&(gs.length?console.log(`${gs.length} of ${R.size} Failed formatting checks`):console.log("All files passed formatting")),$f&&(console.log("Diagnostic issues summary"),qn.length&&(console.log(qn.map(P=>`${fc()}File: ${P.file}
71
71
  Board File: ${P.context.mainDtsPath.file}
72
72
  Issues:
73
73
  ${P.message}
74
74
  ${hc()}`).join(`
75
- `)),console.log(`${Array.from(qn.values()).map(P=>P.file).length} of ${R.size} Failed diagnostic checks`)),ys.size!==R.size&&console.log(`${R.size-ys.size} of ${R.size} Skipped diagnostic checks`),ys.size===R.size&&!qn.length&&console.log("All files passed diagnostic checks")),process.exit(gs.length||qn?1:0)}var lc=t=>[t.file,...t.includes.flatMap(e=>lc(e))],sg=async(t,e,r,n,i)=>{let s={textDocument:{uri:`file://${e}`},options:{tabSize:4,insertSpaces:!1,trimTrailingWhitespace:!0}},d=await t.sendRequest("devicetree/formatingDiff",s),h=r?"":" ";if(d)return console.error(`${fc()}${h}${n} \u274C ${e} is not correctly formatted.`),ms.has(e)?ms.get(e)!==d&&Hf&&console.log(`${h} \u26A0\uFE0F Multiple diffs for the same file. This diff will not be in the generated file!`):(gs.push({file:e,context:i}),ms.set(e,d)),console.log(`${d}
76
- ${hc()}`),d;console.log(`${h}${n} \u2705 ${e} is correctly formatted.`)},ys=new Set,og=async(t,e,r,n)=>{ys.add(e);let i=(await t.sendRequest("devicetree/diagnosticIssues",{uri:`file://${e}`})??[]).filter(d=>d.severity===uc.DiagnosticSeverity.Error||d.severity===uc.DiagnosticSeverity.Warning),s=r?"":" ";if(i.length)return console.log(`${fc()}${s}${n} \u274C ${e} has ${i.length} diagnostic errors!`),console.log(i.map(d=>`${s} ${d.message}: ${JSON.stringify(d.range.start)}${JSON.stringify(d.range.end)}`).join(`
75
+ `)),console.log(`${Array.from(qn.values()).map(P=>P.file).length} of ${R.size} Failed diagnostic checks`)),ys.size!==R.size&&console.log(`${R.size-ys.size} of ${R.size} Skipped diagnostic checks`),ys.size===R.size&&!qn.length&&console.log("All files passed diagnostic checks")),process.exit(gs.length||qn?1:0)}var lc=t=>[t.file,...t.includes.flatMap(e=>lc(e))],sg=async(t,e,r,n,i)=>{let s={textDocument:{uri:`file://${e}`},options:{tabSize:4,insertSpaces:!1,trimTrailingWhitespace:!0}},d=await t.sendRequest("devicetree/formatingDiff",s),h=r?"":" ";if(d)return console.log(`${fc()}${h}${n} \u274C ${e} is not correctly formatted.`),ms.has(e)?ms.get(e)!==d&&Hf&&console.log(`${h} \u26A0\uFE0F Multiple diffs for the same file. This diff will not be in the generated file!`):(gs.push({file:e,context:i}),ms.set(e,d)),console.log(d),console.log(hc()),d;console.log(`${h}${n} \u2705 ${e} is correctly formatted.`)},ys=new Set,og=async(t,e,r,n)=>{ys.add(e);let i=(await t.sendRequest("devicetree/diagnosticIssues",{uri:`file://${e}`})??[]).filter(d=>d.severity===uc.DiagnosticSeverity.Error||d.severity===uc.DiagnosticSeverity.Warning),s=r?"":" ";if(i.length)return console.log(`${fc()}${s}${n} \u274C ${e} has ${i.length} diagnostic errors!`),console.log(i.map(d=>`${s} ${d.message}: ${JSON.stringify(d.range.start)}${JSON.stringify(d.range.end)}`).join(`
77
76
  `)),console.log(hc()),i;console.log(`${s}${n} \u2705 ${e} has no diagnostic errors.`)};function ag(t,e=6e4){return new Promise((r,n)=>{let i=setTimeout(()=>{n(new Error("Timed out waiting for devicetree/newActiveContext")),s.dispose()},e),s=t.onNotification("devicetree/newActiveContext",d=>{clearTimeout(i),r(d),s.dispose()})})}function cg(t,e=5e3){return new Promise((r,n)=>{let i=setTimeout(()=>{n(new Error("Timed out waiting for devicetree/contextDeleted")),s.dispose()},e),s=t.onNotification("devicetree/contextDeleted",()=>{clearTimeout(i),r(),s.dispose()})})}