text: !function(e,t){for(var n in t)e[n]=t[n]}(exports,function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=20)}([function(e,t){e.exports=require("vscode")},function(e,t,n){"use strict";function i(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0});const r=n(2);t.ErrorCodes=r.ErrorCodes,t.ResponseError=r.ResponseError,t.CancellationToken=r.CancellationToken,t.CancellationTokenSource=r.CancellationTokenSource,t.Disposable=r.Disposable,t.Event=r.Event,t.Emitter=r.Emitter,t.Trace=r.Trace,t.TraceFormat=r.TraceFormat,t.SetTraceNotification=r.SetTraceNotification,t.LogTraceNotification=r.LogTraceNotification,t.RequestType=r.RequestType,t.RequestType0=r.RequestType0,t.NotificationType=r.NotificationType,t.NotificationType0=r.NotificationType0,t.MessageReader=r.MessageReader,t.MessageWriter=r.MessageWriter,t.ConnectionStrategy=r.ConnectionStrategy,t.StreamMessageReader=r.StreamMessageReader,t.StreamMessageWriter=r.StreamMessageWriter,t.IPCMessageReader=r.IPCMessageReader,t.IPCMessageWriter=r.IPCMessageWriter,t.createClientPipeTransport=r.createClientPipeTransport,t.createServerPipeTransport=r.createServerPipeTransport,t.generateRandomPipeName=r.generateRandomPipeName,t.createClientSocketTransport=r.createClientSocketTransport,t.createServerSocketTransport=r.createServerSocketTransport,t.ProgressType=r.ProgressType,i(n(30)),i(n(31));const o=n(13);!function(e){let t,n,i;!function(e){e.method=o.CallHierarchyPrepareRequest.method,e.type=o.CallHierarchyPrepareRequest.type}(t=e.CallHierarchyPrepareRequest||(e.CallHierarchyPrepareRequest={})),function(e){e.method=o.CallHierarchyIncomingCallsRequest.method,e.type=o.CallHierarchyIncomingCallsRequest,e.resultType=o.CallHierarchyIncomingCallsRequest.resultType}(n=e.CallHierarchyIncomingCallsRequest||(e.CallHierarchyIncomingCallsRequest={})),function(e){e.method=o.CallHierarchyOutgoingCallsRequest.method,e.type=o.CallHierarchyOutgoingCallsRequest,e.resultType=o.CallHierarchyOutgoingCallsRequest.resultType}(i=e.CallHierarchyOutgoingCallsRequest||(e.CallHierarchyOutgoingCallsRequest={}))}(t.Proposed||(t.Proposed={})),t.createProtocolConnection=function(e,t,n,i){return r.createMessageConnection(e,t,n,i)}},function(e,t,n){"use strict";function i(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0});const r=n(4),o=n(23);t.RequestType=o.RequestType,t.RequestType0=o.RequestType0,t.RequestType1=o.RequestType1,t.RequestType2=o.RequestType2,t.RequestType3=o.RequestType3,t.RequestType4=o.RequestType4,t.RequestType5=o.RequestType5,t.RequestType6=o.RequestType6,t.RequestType7=o.RequestType7,t.RequestType8=o.RequestType8,t.RequestType9=o.RequestType9,t.ResponseError=o.ResponseError,t.ErrorCodes=o.ErrorCodes,t.NotificationType=o.NotificationType,t.NotificationType0=o.NotificationType0,t.NotificationType1=o.NotificationType1,t.NotificationType2=o.NotificationType2,t.NotificationType3=o.NotificationType3,t.NotificationType4=o.NotificationType4,t.NotificationType5=o.NotificationType5,t.NotificationType6=o.NotificationType6,t.NotificationType7=o.NotificationType7,t.NotificationType8=o.NotificationType8,t.NotificationType9=o.NotificationType9;const s=n(9);t.MessageReader=s.MessageReader,t.StreamMessageReader=s.StreamMessageReader,t.IPCMessageReader=s.IPCMessageReader,t.SocketMessageReader=s.SocketMessageReader;const a=n(10);t.MessageWriter=a.MessageWriter,t.StreamMessageWriter=a.StreamMessageWriter,t.IPCMessageWriter=a.IPCMessageWriter,t.SocketMessageWriter=a.SocketMessageWriter;const c=n(7);t.Disposable=c.Disposable,t.Event=c.Event,t.Emitter=c.Emitter;const l=n(24);t.CancellationTokenSource=l.CancellationTokenSource,t.CancellationToken=l.CancellationToken;const u=n(25);var d,h,p,g,f,m,v,y;i(n(26)),i(n(29)),function(e){e.type=new o.NotificationType("$/cancelRequest")}(d||(d={})),function(e){e.type=new o.NotificationType("$/progress")}(h||(h={}));t.ProgressType=class{constructor(){this._=void 0}},t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}}),function(e){e[e.Off=0]="Off",e[e.Messages=1]="Messages",e[e.Verbose=2]="Verbose"}(p=t.Trace||(t.Trace={})),function(e){e.fromString=function(t){if(!r.string(t))return e.Off;switch(t=t.toLowerCase()){case"off":return e.Off;case"messages":return e.Messages;case"verbose":return e.Verbose;default:return e.Off}},e.toString=function(t){switch(t){case e.Off:return"off";case e.Messages:return"messages";case e.Verbose:return"verbose";default:return"off"}}}(p=t.Trace||(t.Trace={})),function(e){e.Text="text",e.JSON="json"}(g=t.TraceFormat||(t.TraceFormat={})),function(e){e.fromString=function(t){return"json"===(t=t.toLowerCase())?e.JSON:e.Text}}(g=t.TraceFormat||(t.TraceFormat={})),function(e){e.type=new o.NotificationType("$/setTraceNotification")}(f=t.SetTraceNotification||(t.SetTraceNotification={})),function(e){e.type=new o.NotificationType("$/logTraceNotification")}(m=t.LogTraceNotification||(t.LogTraceNotification={})),function(e){e[e.Closed=1]="Closed",e[e.Disposed=2]="Disposed",e[e.AlreadyListening=3]="AlreadyListening"}(v=t.ConnectionErrors||(t.ConnectionErrors={}));class C extends Error{constructor(e,t){super(t),this.code=e,Object.setPrototypeOf(this,C.prototype)}}function w(e,t,n,i){let s=0,a=0,w=0;const R="2.0";let S,_,E=void 0,T=Object.create(null),D=void 0,x=Object.create(null),b=new Map,k=new u.LinkedMap,P=Object.create(null),O=Object.create(null),I=p.Off,F=g.Text,N=y.New,q=new c.Emitter,L=new c.Emitter,M=new c.Emitter,A=new c.Emitter,j=new c.Emitter;function K(e){return"req-"+e.toString()}function H(e,t){var n;o.isRequestMessage(t)?e.set(K(t.id),t):o.isResponseMessage(t)?e.set(null===(n=t.id)?"res-unknown-"+(++w).toString():"res-"+n.toString(),t):e.set("not-"+(++a).toString(),t)}function W(e){}function U(){return N===y.Listening}function $(){return N===y.Closed}function z(){return N===y.Disposed}function G(){N!==y.New&&N!==y.Listening||(N=y.Closed,L.fire(void 0))}function V(){S||0===k.size||(S=setImmediate(()=>{S=void 0,function(){if(0===k.size)return;let e=k.shift();try{o.isRequestMessage(e)?function(e){if(z())return;function n(n,i,r){let s={jsonrpc:R,id:e.id};n instanceof o.ResponseError?s.error=n.toJson():s.result=void 0===n?null:n,X(s,i,r),t.write(s)}function i(n,i,r){let o={jsonrpc:R,id:e.id,error:n.toJson()};X(o,i,r),t.write(o)}!function(e){if(I===p.Off||!_)return;if(F===g.Text){let t=void 0;I===p.Verbose&&e.params&&(t=`Params: ${JSON.stringify(e.params,null,4)}\n\n`),_.log(`Received request '${e.method} - (${e.id})'.`,t)}else J("receive-request",e)}(e);let s,a,c=T[e.method];c&&(s=c.type,a=c.handler);let u=Date.now();if(a||E){let c=new l.CancellationTokenSource,d=String(e.id);O[d]=c;try{let l;l=void 0===e.params||void 0!==s&&0===s.numberOfParams?a?a(c.token):E(e.method,c.token):r.array(e.params)&&(void 0===s||s.numberOfParams>1)?a?a(...e.params,c.token):E(e.method,...e.params,c.token):a?a(e.params,c.token):E(e.method,e.params,c.token);let h=l;l?h.then?h.then(t=>{delete O[d],n(t,e.method,u)},t=>{delete O[d],t instanceof o.ResponseError?i(t,e.method,u):t&&r.string(t.message)?i(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${t.message}`),e.method,u):i(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,u)}):(delete O[d],n(l,e.method,u)):(delete O[d],function(n,i,r){void 0===n&&(n=null);let o={jsonrpc:R,id:e.id,result:n};X(o,i,r),t.write(o)}(l,e.method,u))}catch(t){delete O[d],t instanceof o.ResponseError?n(t,e.method,u):t&&r.string(t.message)?i(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${t.message}`),e.method,u):i(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,u)}}else i(new o.ResponseError(o.ErrorCodes.MethodNotFound,`Unhandled method ${e.method}`),e.method,u)}(e):o.isNotificationMessage(e)?function(e){if(z())return;let t,i=void 0;if(e.method===d.type.method)t=e=>{let t=e.id,n=O[String(t)];n&&n.cancel()};else{let n=x[e.method];n&&(t=n.handler,i=n.type)}if(t||D)try{!function(e){if(I===p.Off||!_||e.method===m.type.method)return;if(F===g.Text){let t=void 0;I===p.Verbose&&(t=e.params?`Params: ${JSON.stringify(e.params,null,4)}\n\n`:"No parameters provided.\n\n"),_.log(`Received notification '${e.method}'.`,t)}else J("receive-notification",e)}(e),void 0===e.params||void 0!==i&&0===i.numberOfParams?t?t():D(e.method):r.array(e.params)&&(void 0===i||i.numberOfParams>1)?t?t(...e.params):D(e.method,...e.params):t?t(e.params):D(e.method,e.params)}catch(t){t.message?n.error(`Notification handler '${e.method}' failed with message: ${t.message}`):n.error(`Notification handler '${e.method}' failed unexpectedly.`)}else M.fire(e)}(e):o.isResponseMessage(e)?function(e){if(z())return;if(null===e.id)e.error?n.error(`Received response message without id: Error is: \n${JSON.stringify(e.error,void 0,4)}`):n.error("Received response message without id. No further error information provided.");else{let t=String(e.id),i=P[t];if(function(e,t){if(I===p.Off||!_)return;if(F===g.Text){let n=void 0;if(I===p.Verbose&&(e.error&&e.error.data?n=`Error data: ${JSON.stringify(e.error.data,null,4)}\n\n`:e.result?n=`Result: ${JSON.stringify(e.result,null,4)}\n\n`:void 0===e.error&&(n="No result returned.\n\n")),t){let i=e.error?` Request failed: ${e.error.message} (${e.error.code}).`:"";_.log(`Received response '${t.method} - (${e.id})' in ${Date.now()-t.timerStart}ms.${i}`,n)}else _.log(`Received response ${e.id} without active response promise.`,n)}else J("receive-response",e)}(e,i),i){delete P[t];try{if(e.error){let t=e.error;i.reject(new o.ResponseError(t.code,t.message,t.data))}else{if(void 0===e.result)throw new Error("Should never happen.");i.resolve(e.result)}}catch(e){e.message?n.error(`Response handler '${i.method}' failed with message: ${e.message}`):n.error(`Response handler '${i.method}' failed unexpectedly.`)}}}}(e):function(e){if(!e)return void n.error("Received empty message.");n.error(`Received message which is neither a response nor a notification message:\n${JSON.stringify(e,null,4)}`);let t=e;if(r.string(t.id)||r.number(t.id)){let e=String(t.id),n=P[e];n&&n.reject(new Error("The received response has neither a result nor an error property."))}}(e)}finally{V()}}()}))}e.onClose(G),e.onError((function(e){q.fire([e,void 0,void 0])})),t.onClose(G),t.onError((function(e){q.fire(e)}));let B=e=>{try{if(o.isNotificationMessage(e)&&e.method===d.type.method){let n=K(e.params.id),r=k.get(n);if(o.isRequestMessage(r)){let o=i&&i.cancelUndispatched?i.cancelUndispatched(r,W):void 0;if(o&&(void 0!==o.error||void 0!==o.result))return k.delete(n),o.id=r.id,X(o,e.method,Date.now()),void t.write(o)}}H(k,e)}finally{V()}};function X(e,t,n){if(I!==p.Off&&_)if(F===g.Text){let i=void 0;I===p.Verbose&&(e.error&&e.error.data?i=`Error data: ${JSON.stringify(e.error.data,null,4)}\n\n`:e.result?i=`Result: ${JSON.stringify(e.result,null,4)}\n\n`:void 0===e.error&&(i="No result returned.\n\n")),_.log(`Sending response '${t} - (${e.id})'. Processing request took ${Date.now()-n}ms`,i)}else J("send-response",e)}function J(e,t){if(!_||I===p.Off)return;const n={isLSPMessage:!0,type:e,message:t,timestamp:Date.now()};_.log(n)}function Y(){if($())throw new C(v.Closed,"Connection is closed.");if(z())throw new C(v.Disposed,"Connection is disposed.")}function Q(e){return void 0===e?null:e}function Z(e,t){let n,i=e.numberOfParams;switch(i){case 0:n=null;break;case 1:n=Q(t[0]);break;default:n=[];for(let e=0;e<t.length&&e<i;e++)n.push(Q(t[e]));if(t.length<i)for(let e=t.length;e<i;e++)n.push(null)}return n}let ee={sendNotification:(e,...n)=>{let i,o;if(Y(),r.string(e))switch(i=e,n.length){case 0:o=null;break;case 1:o=n[0];break;default:o=n}else i=e.method,o=Z(e,n);let s={jsonrpc:R,method:i,params:o};!function(e){if(I!==p.Off&&_)if(F===g.Text){let t=void 0;I===p.Verbose&&(t=e.params?`Params: ${JSON.stringify(e.params,null,4)}\n\n`:"No parameters provided.\n\n"),_.log(`Sending notification '${e.method}'.`,t)}else J("send-notification",e)}(s),t.write(s)},onNotification:(e,t)=>{Y(),r.func(e)?D=e:t&&(r.string(e)?x[e]={type:void 0,handler:t}:x[e.method]={type:e,handler:t})},onProgress:(e,t,n)=>{if(b.has(t))throw new Error(`Progress handler for token ${t} already registered`);return b.set(t,n),{dispose:()=>{b.delete(t)}}},sendProgress:(e,t,n)=>{ee.sendNotification(h.type,{token:t,value:n})},onUnhandledProgress:A.event,sendRequest:(e,...n)=>{let i,a;Y(),function(){if(!U())throw new Error("Call listen() first.")}();let c=void 0;if(r.string(e))switch(i=e,n.length){case 0:a=null;break;case 1:l.CancellationToken.is(n[0])?(a=null,c=n[0]):a=Q(n[0]);break;default:const e=n.length-1;l.CancellationToken.is(n[e])?(c=n[e],a=2===n.length?Q(n[0]):n.slice(0,e).map(e=>Q(e))):a=n.map(e=>Q(e))}else{i=e.method,a=Z(e,n);let t=e.numberOfParams;c=l.CancellationToken.is(n[t])?n[t]:void 0}let u=s++,h=new Promise((e,n)=>{let r={jsonrpc:R,id:u,method:i,params:a},s={method:i,timerStart:Date.now(),resolve:e,reject:n};!function(e){if(I!==p.Off&&_)if(F===g.Text){let t=void 0;I===p.Verbose&&e.params&&(t=`Params: ${JSON.stringify(e.params,null,4)}\n\n`),_.log(`Sending request '${e.method} - (${e.id})'.`,t)}else J("send-request",e)}(r);try{t.write(r)}catch(e){s.reject(new o.ResponseError(o.ErrorCodes.MessageWriteError,e.message?e.message:"Unknown reason")),s=null}s&&(P[String(u)]=s)});return c&&c.onCancellationRequested(()=>{ee.sendNotification(d.type,{id:u})}),h},onRequest:(e,t)=>{Y(),r.func(e)?E=e:t&&(r.string(e)?T[e]={type:void 0,handler:t}:T[e.method]={type:e,handler:t})},trace:(e,t,n)=>{let i=!1,o=g.Text;void 0!==n&&(r.boolean(n)?i=n:(i=n.sendNotification||!1,o=n.traceFormat||g.Text)),I=e,F=o,_=I===p.Off?void 0:t,!i||$()||z()||ee.sendNotification(f.type,{value:p.toString(e)})},onError:q.event,onClose:L.event,onUnhandledNotification:M.event,onDispose:j.event,dispose:()=>{if(z())return;N=y.Disposed,j.fire(void 0);let n=new Error("Connection got disposed.");Object.keys(P).forEach(e=>{P[e].reject(n)}),P=Object.create(null),O=Object.create(null),k=new u.LinkedMap,r.func(t.dispose)&&t.dispose(),r.func(e.dispose)&&e.dispose()},listen:()=>{Y(),function(){if(U())throw new C(v.AlreadyListening,"Connection is already listening")}(),N=y.Listening,e.listen(B)},inspect:()=>{console.log("inspect")}};return ee.onNotification(m.type,e=>{I!==p.Off&&_&&_.log(e.message,I===p.Verbose?e.verbose:void 0)}),ee.onNotification(h.type,e=>{const t=b.get(e.token);t?t(e.value):A.fire(e)}),ee}t.ConnectionError=C,function(e){e.is=function(e){let t=e;return t&&r.func(t.cancelUndispatched)}}(t.ConnectionStrategy||(t.ConnectionStrategy={})),function(e){e[e.New=1]="New",e[e.Listening=2]="Listening",e[e.Closed=3]="Closed",e[e.Disposed=4]="Disposed"}(y||(y={})),t.createMessageConnection=function(e,n,i,r){var o;return i||(i=t.NullLogger),w(void 0!==(o=e).listen&&void 0===o.read?e:new s.StreamMessageReader(e),function(e){return void 0!==e.write&&void 0===e.end}(n)?n:new a.StreamMessageWriter(n),i,r)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(0),r=n(1),o=n(42),s=n(43),a=n(5),c=n(44),l=n(17),u=n(18);!function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(1));class d{error(e){console.error(e)}warn(e){console.warn(e)}info(e){console.info(e)}log(e){console.log(e)}}var h,p,g,f,m;!function(e){e[e.Continue=1]="Continue",e[e.Shutdown=2]="Shutdown"}(h=t.ErrorAction||(t.ErrorAction={})),function(e){e[e.DoNotRestart=1]="DoNotRestart",e[e.Restart=2]="Restart"}(p=t.CloseAction||(t.CloseAction={}));class v{constructor(e){this.name=e,this.restarts=[]}error(e,t,n){return n&&n<=3?h.Continue:h.Shutdown}closed(){if(this.restarts.push(Date.now()),this.restarts.length<5)return p.Restart;return this.restarts[this.restarts.length-1]-this.restarts[0]<=18e4?(i.window.showErrorMessage(`The ${this.name} server crashed 5 times in the last 3 minutes. The server will not be restarted.`),p.DoNotRestart):(this.restarts.shift(),p.Restart)}}!function(e){e[e.Info=1]="Info",e[e.Warn=2]="Warn",e[e.Error=3]="Error",e[e.Never=4]="Never"}(g=t.RevealOutputChannelOn||(t.RevealOutputChannelOn={})),function(e){e[e.Stopped=1]="Stopped",e[e.Starting=3]="Starting",e[e.Running=2]="Running"}(f=t.State||(t.State={})),function(e){e[e.Initial=0]="Initial",e[e.Starting=1]="Starting",e[e.StartFailed=2]="StartFailed",e[e.Running=3]="Running",e[e.Stopping=4]="Stopping",e[e.Stopped=5]="Stopped"}(m||(m={}));const y=[r.SymbolKind.File,r.SymbolKind.Module,r.SymbolKind.Namespace,r.SymbolKind.Package,r.SymbolKind.Class,r.SymbolKind.Method,r.SymbolKind.Property,r.SymbolKind.Field,r.SymbolKind.Constructor,r.SymbolKind.Enum,r.SymbolKind.Interface,r.SymbolKind.Function,r.SymbolKind.Variable,r.SymbolKind.Constant,r.SymbolKind.String,r.SymbolKind.Number,r.SymbolKind.Boolean,r.SymbolKind.Array,r.SymbolKind.Object,r.SymbolKind.Key,r.SymbolKind.Null,r.SymbolKind.EnumMember,r.SymbolKind.Struct,r.SymbolKind.Event,r.SymbolKind.Operator,r.SymbolKind.TypeParameter],C=[r.CompletionItemKind.Text,r.CompletionItemKind.Method,r.CompletionItemKind.Function,r.CompletionItemKind.Constructor,r.CompletionItemKind.Field,r.CompletionItemKind.Variable,r.CompletionItemKind.Class,r.CompletionItemKind.Interface,r.CompletionItemKind.Module,r.CompletionItemKind.Property,r.CompletionItemKind.Unit,r.CompletionItemKind.Value,r.CompletionItemKind.Enum,r.CompletionItemKind.Keyword,r.CompletionItemKind.Snippet,r.CompletionItemKind.Color,r.CompletionItemKind.File,r.CompletionItemKind.Reference,r.CompletionItemKind.Folder,r.CompletionItemKind.EnumMember,r.CompletionItemKind.Constant,r.CompletionItemKind.Struct,r.CompletionItemKind.Event,r.CompletionItemKind.Operator,r.CompletionItemKind.TypeParameter];function w(e,t){return void 0===e[t]&&(e[t]={}),e[t]}var R;!function(e){e.is=function(e){let t=e;return t&&a.func(t.register)&&a.func(t.unregister)&&a.func(t.dispose)&&void 0!==t.messages}}(R||(R={}));class S{constructor(e,t,n,i,r,o){this._client=e,this._event=t,this._type=n,this._middleware=i,this._createParams=r,this._selectorFilter=o,this._selectors=new Map}static textDocumentFilter(e,t){for(const n of e)if(i.languages.match(n,t))return!0;return!1}register(e,t){t.registerOptions.documentSelector&&(this._listener||(this._listener=this._event(this.callback,this)),this._selectors.set(t.id,t.registerOptions.documentSelector))}callback(e){this._selectorFilter&&!this._selectorFilter(this._selectors.values(),e)||(this._middleware?this._middleware(e,e=>this._client.sendNotification(this._type,this._createParams(e))):this._client.sendNotification(this._type,this._createParams(e)),this.notificationSent(e))}notificationSent(e){}unregister(e){this._selectors.delete(e),0===this._selectors.size&&this._listener&&(this._listener.dispose(),this._listener=void 0)}dispose(){this._selectors.clear(),this._listener&&(this._listener.dispose(),this._listener=void 0)}getProvider(e){for(const t of this._selectors.values())if(i.languages.match(t,e))return{send:e=>{this.callback(e)}};throw new Error("No provider available for the given text document")}}class _ extends S{constructor(e,t){super(e,i.workspace.onDidOpenTextDocument,r.DidOpenTextDocumentNotification.type,e.clientOptions.middleware.didOpen,t=>e.code2ProtocolConverter.asOpenTextDocumentParams(t),S.textDocumentFilter),this._syncedDocuments=t}get messages(){return r.DidOpenTextDocumentNotification.type}fillClientCapabilities(e){w(w(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let n=e.resolvedTextDocumentSync;t&&n&&n.openClose&&this.register(this.messages,{id:l.generateUuid(),registerOptions:{documentSelector:t}})}register(e,t){if(super.register(e,t),!t.registerOptions.documentSelector)return;let n=t.registerOptions.documentSelector;i.workspace.textDocuments.forEach(e=>{let t=e.uri.toString();if(!this._syncedDocuments.has(t)&&i.languages.match(n,e)){let n=this._client.clientOptions.middleware,i=e=>{this._client.sendNotification(this._type,this._createParams(e))};n.didOpen?n.didOpen(e,i):i(e),this._syncedDocuments.set(t,e)}})}notificationSent(e){super.notificationSent(e),this._syncedDocuments.set(e.uri.toString(),e)}}class E extends S{constructor(e,t){super(e,i.workspace.onDidCloseTextDocument,r.DidCloseTextDocumentNotification.type,e.clientOptions.middleware.didClose,t=>e.code2ProtocolConverter.asCloseTextDocumentParams(t),S.textDocumentFilter),this._syncedDocuments=t}get messages(){return r.DidCloseTextDocumentNotification.type}fillClientCapabilities(e){w(w(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let n=e.resolvedTextDocumentSync;t&&n&&n.openClose&&this.register(this.messages,{id:l.generateUuid(),registerOptions:{documentSelector:t}})}notificationSent(e){super.notificationSent(e),this._syncedDocuments.delete(e.uri.toString())}unregister(e){let t=this._selectors.get(e);super.unregister(e);let n=this._selectors.values();this._syncedDocuments.forEach(e=>{if(i.languages.match(t,e)&&!this._selectorFilter(n,e)){let t=this._client.clientOptions.middleware,n=e=>{this._client.sendNotification(this._type,this._createParams(e))};this._syncedDocuments.delete(e.uri.toString()),t.didClose?t.didClose(e,n):n(e)}})}}class T{constructor(e){this._client=e,this._changeData=new Map,this._forcingDelivery=!1}get messages(){return r.DidChangeTextDocumentNotification.type}fillClientCapabilities(e){w(w(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let n=e.resolvedTextDocumentSync;t&&n&&void 0!==n.change&&n.change!==r.TextDocumentSyncKind.None&&this.register(this.messages,{id:l.generateUuid(),registerOptions:Object.assign({},{documentSelector:t},{syncKind:n.change})})}register(e,t){t.registerOptions.documentSelector&&(this._listener||(this._listener=i.workspace.onDidChangeTextDocument(this.callback,this)),this._changeData.set(t.id,{documentSelector:t.registerOptions.documentSelector,syncKind:t.registerOptions.syncKind}))}callback(e){if(0!==e.contentChanges.length)for(const t of this._changeData.values())if(i.languages.match(t.documentSelector,e.document)){let n=this._client.clientOptions.middleware;if(t.syncKind===r.TextDocumentSyncKind.Incremental){let t=this._client.code2ProtocolConverter.asChangeTextDocumentParams(e);n.didChange?n.didChange(e,()=>this._client.sendNotification(r.DidChangeTextDocumentNotification.type,t)):this._client.sendNotification(r.DidChangeTextDocumentNotification.type,t)}else if(t.syncKind===r.TextDocumentSyncKind.Full){let t=e=>{this._changeDelayer?(this._changeDelayer.uri!==e.document.uri.toString()&&(this.forceDelivery(),this._changeDelayer.uri=e.document.uri.toString()),this._changeDelayer.delayer.trigger(()=>{this._client.sendNotification(r.DidChangeTextDocumentNotification.type,this._client.code2ProtocolConverter.asChangeTextDocumentParams(e.document))})):(this._changeDelayer={uri:e.document.uri.toString(),delayer:new c.Delayer(200)},this._changeDelayer.delayer.trigger(()=>{this._client.sendNotification(r.DidChangeTextDocumentNotification.type,this._client.code2ProtocolConverter.asChangeTextDocumentParams(e.document))},-1))};n.didChange?n.didChange(e,t):t(e)}}}unregister(e){this._changeData.delete(e),0===this._changeData.size&&this._listener&&(this._listener.dispose(),this._listener=void 0)}dispose(){this._changeDelayer=void 0,this._forcingDelivery=!1,this._changeData.clear(),this._listener&&(this._listener.dispose(),this._listener=void 0)}forceDelivery(){if(!this._forcingDelivery&&this._changeDelayer)try{this._forcingDelivery=!0,this._changeDelayer.delayer.forceDelivery()}finally{this._forcingDelivery=!1}}getProvider(e){for(const t of this._changeData.values())if(i.languages.match(t.documentSelector,e))return{send:e=>{this.callback(e)}};throw new Error("No provider available for the given text document")}}class D extends S{constructor(e){super(e,i.workspace.onWillSaveTextDocument,r.WillSaveTextDocumentNotification.type,e.clientOptions.middleware.willSave,t=>e.code2ProtocolConverter.asWillSaveTextDocumentParams(t),(e,t)=>S.textDocumentFilter(e,t.document))}get messages(){return r.WillSaveTextDocumentNotification.type}fillClientCapabilities(e){w(w(e,"textDocument"),"synchronization").willSave=!0}initialize(e,t){let n=e.resolvedTextDocumentSync;t&&n&&n.willSave&&this.register(this.messages,{id:l.generateUuid(),registerOptions:{documentSelector:t}})}}class x{constructor(e){this._client=e,this._selectors=new Map}get messages(){return r.WillSaveTextDocumentWaitUntilRequest.type}fillClientCapabilities(e){w(w(e,"textDocument"),"synchronization").willSaveWaitUntil=!0}initialize(e,t){let n=e.resolvedTextDocumentSync;t&&n&&n.willSaveWaitUntil&&this.register(this.messages,{id:l.generateUuid(),registerOptions:{documentSelector:t}})}register(e,t){t.registerOptions.documentSelector&&(this._listener||(this._listener=i.workspace.onWillSaveTextDocument(this.callback,this)),this._selectors.set(t.id,t.registerOptions.documentSelector))}callback(e){if(S.textDocumentFilter(this._selectors.values(),e.document)){let t=this._client.clientOptions.middleware,n=e=>this._client.sendRequest(r.WillSaveTextDocumentWaitUntilRequest.type,this._client.code2ProtocolConverter.asWillSaveTextDocumentParams(e)).then(e=>{let t=this._client.protocol2CodeConverter.asTextEdits(e);return void 0===t?[]:t});e.waitUntil(t.willSaveWaitUntil?t.willSaveWaitUntil(e,n):n(e))}}unregister(e){this._selectors.delete(e),0===this._selectors.size&&this._listener&&(this._listener.dispose(),this._listener=void 0)}dispose(){this._selectors.clear(),this._listener&&(this._listener.dispose(),this._listener=void 0)}}class b extends S{constructor(e){super(e,i.workspace.onDidSaveTextDocument,r.DidSaveTextDocumentNotification.type,e.clientOptions.middleware.didSave,t=>e.code2ProtocolConverter.asSaveTextDocumentParams(t,this._includeText),S.textDocumentFilter)}get messages(){return r.DidSaveTextDocumentNotification.type}fillClientCapabilities(e){w(w(e,"textDocument"),"synchronization").didSave=!0}initialize(e,t){let n=e.resolvedTextDocumentSync;t&&n&&n.save&&this.register(this.messages,{id:l.generateUuid(),registerOptions:Object.assign({},{documentSelector:t},{includeText:!!n.save.includeText})})}register(e,t){this._includeText=!!t.registerOptions.includeText,super.register(e,t)}}class k{constructor(e,t){this._client=e,this._notifyFileEvent=t,this._watchers=new Map}get messages(){return r.DidChangeWatchedFilesNotification.type}fillClientCapabilities(e){w(w(e,"workspace"),"didChangeWatchedFiles").dynamicRegistration=!0}initialize(e,t){}register(e,t){if(!Array.isArray(t.registerOptions.watchers))return;let n=[];for(let e of t.registerOptions.watchers){if(!a.string(e.globPattern))continue;let t=!0,o=!0,s=!0;void 0!==e.kind&&null!==e.kind&&(t=0!=(e.kind&r.WatchKind.Create),o=0!=(e.kind&r.WatchKind.Change),s=0!=(e.kind&r.WatchKind.Delete));let c=i.workspace.createFileSystemWatcher(e.globPattern,!t,!o,!s);this.hookListeners(c,t,o,s),n.push(c)}this._watchers.set(t.id,n)}registerRaw(e,t){let n=[];for(let e of t)this.hookListeners(e,!0,!0,!0,n);this._watchers.set(e,n)}hookListeners(e,t,n,i,o){t&&e.onDidCreate(e=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(e),type:r.FileChangeType.Created}),null,o),n&&e.onDidChange(e=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(e),type:r.FileChangeType.Changed}),null,o),i&&e.onDidDelete(e=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(e),type:r.FileChangeType.Deleted}),null,o)}unregister(e){let t=this._watchers.get(e);if(t)for(let e of t)e.dispose()}dispose(){this._watchers.forEach(e=>{for(let t of e)t.dispose()}),this._watchers.clear()}}class P{constructor(e,t){this._client=e,this._message=t,this._registrations=new Map}get messages(){return this._message}register(e,t){if(e.method!==this.messages.method)throw new Error(`Register called on wrong feature. Requested ${e.method} but reached feature ${this.messages.method}`);if(!t.registerOptions.documentSelector)return;let n=this.registerLanguageProvider(t.registerOptions);this._registrations.set(t.id,{disposable:n[0],data:t,provider:n[1]})}unregister(e){let t=this._registrations.get(e);void 0!==t&&t.disposable.dispose()}dispose(){this._registrations.forEach(e=>{e.disposable.dispose()}),this._registrations.clear()}getRegistration(e,t){if(!t)return[void 0,void 0];if(r.TextDocumentRegistrationOptions.is(t)){const n=r.StaticRegistrationOptions.hasId(t)?t.id:l.generateUuid(),i=t.documentSelector||e;if(i)return[n,Object.assign({},t,{documentSelector:i})]}else if(a.boolean(t)&&!0===t||r.WorkDoneProgressOptions.is(t)){if(!e)return[void 0,void 0];let n=a.boolean(t)&&!0===t?{documentSelector:e}:Object.assign({},t,{documentSelector:e});return[l.generateUuid(),n]}return[void 0,void 0]}getRegistrationOptions(e,t){if(e&&t)return a.boolean(t)&&!0===t?{documentSelector:e}:Object.assign({},t,{documentSelector:e})}getProvider(e){for(const t of this._registrations.values()){let n=t.data.registerOptions.documentSelector;if(null!==n&&i.languages.match(n,e))return t.provider}throw new Error(`The feature has no registration for the provided text document ${e.uri.toString()}`)}}t.TextDocumentFeature=P;class O{constructor(e,t){this._client=e,this._message=t,this._registrations=new Map}get messages(){return this._message}register(e,t){if(e.method!==this.messages.method)throw new Error(`Register called on wron feature. Requested ${e.method} but reached feature ${this.messages.method}`);const n=this.registerLanguageProvider(t.registerOptions);this._registrations.set(t.id,{disposable:n[0],provider:n[1]})}unregister(e){let t=this._registrations.get(e);void 0!==t&&t.disposable.dispose()}dispose(){this._registrations.forEach(e=>{e.disposable.dispose()}),this._registrations.clear()}getProviders(){const e=[];for(const t of this._registrations.values())e.push(t.provider);return e}}class I extends P{constructor(e){super(e,r.CompletionRequest.type)}fillClientCapabilities(e){let t=w(w(e,"textDocument"),"completion");t.dynamicRegistration=!0,t.contextSupport=!0,t.completionItem={snippetSupport:!0,commitCharactersSupport:!0,documentationFormat:[r.MarkupKind.Markdown,r.MarkupKind.PlainText],deprecatedSupport:!0,preselectSupport:!0,tagSupport:{valueSet:[r.CompletionItemTag.Deprecated]}},t.completionItemKind={valueSet:C}}initialize(e,t){const n=this.getRegistrationOptions(t,e.completionProvider);n&&this.register(this.messages,{id:l.generateUuid(),registerOptions:n})}registerLanguageProvider(e){const t=e.triggerCharacters||[],n={provideCompletionItems:(e,t,n,i)=>{const o=this._client,s=this._client.clientOptions.middleware,a=(e,t,n,i)=>o.sendRequest(r.CompletionRequest.type,o.code2ProtocolConverter.asCompletionParams(e,t,n),i).then(o.protocol2CodeConverter.asCompletionResult,e=>(o.logFailedRequest(r.CompletionRequest.type,e),Promise.resolve([])));return s.provideCompletionItem?s.provideCompletionItem(e,t,i,n,a):a(e,t,i,n)},resolveCompletionItem:e.resolveProvider?(e,t)=>{const n=this._client,i=this._client.clientOptions.middleware,o=(e,t)=>n.sendRequest(r.CompletionResolveRequest.type,n.code2ProtocolConverter.asCompletionItem(e),t).then(n.protocol2CodeConverter.asCompletionItem,t=>(n.logFailedRequest(r.CompletionResolveRequest.type,t),Promise.resolve(e)));return i.resolveCompletionItem?i.resolveCompletionItem(e,t,o):o(e,t)}:void 0};return[i.languages.registerCompletionItemProvider(e.documentSelector,n,...t),n]}}class F extends P{constructor(e){super(e,r.HoverRequest.type)}fillClientCapabilities(e){const t=w(w(e,"textDocument"),"hover");t.dynamicRegistration=!0,t.contentFormat=[r.MarkupKind.Markdown,r.MarkupKind.PlainText]}initialize(e,t){const n=this.getRegistrationOptions(t,e.hoverProvider);n&&this.register(this.messages,{id:l.generateUuid(),registerOptions:n})}registerLanguageProvider(e){const t={provideHover:(e,t,n)=>{const i=this._client,o=(e,t,n)=>i.sendRequest(r.HoverRequest.type,i.code2ProtocolConverter.asTextDocumentPositionParams(e,t),n).then(i.protocol2CodeConverter.asHover,e=>(i.logFailedRequest(r.HoverRequest.type,e),Promise.resolve(null))),s=i.clientOptions.middleware;return s.provideHover?s.provideHover(e,t,n,o):o(e,t,n)}};return[i.languages.registerHoverProvider(e.documentSelector,t),t]}}class N extends P{constructor(e){super(e,r.SignatureHelpRequest.type)}fillClientCapabilities(e){let t=w(w(e,"textDocument"),"signatureHelp");t.dynamicRegistration=!0,t.signatureInformation={documentationFormat:[r.MarkupKind.Markdown,r.MarkupKind.PlainText]},t.signatureInformation.parameterInformation={labelOffsetSupport:!0},t.contextSupport=!0}initialize(e,t){const n=this.getRegistrationOptions(t,e.signatureHelpProvider);n&&this.register(this.messages,{id:l.generateUuid(),registerOptions:n})}registerLanguageProvider(e){const t={provideSignatureHelp:(e,t,n,i)=>{const o=this._client,s=(e,t,n,i)=>o.sendRequest(r.SignatureHelpRequest.type,o.code2ProtocolConverter.asSignatureHelpParams(e,t,n),i).then(o.protocol2CodeConverter.asSignatureHelp,e=>(o.logFailedRequest(r.SignatureHelpRequest.type,e),Promise.resolve(null))),a=o.clientOptions.middleware;return a.provideSignatureHelp?a.provideSignatureHelp(e,t,i,n,s):s(e,t,i,n)}};let n;if(void 0===e.retriggerCharacters){const r=e.triggerCharacters||[];n=i.languages.registerSignatureHelpProvider(e.documentSelector,t,...r)}else{const r={triggerCharacters:e.triggerCharacters||[],retriggerCharacters:e.retriggerCharacters||[]};n=i.languages.registerSignatureHelpProvider(e.documentSelector,t,r)}return[n,t]}}class q extends P{constructor(e){super(e,r.DefinitionRequest.type)}fillClientCapabilities(e){let t=w(w(e,"textDocument"),"definition");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){const n=this.getRegistrationOptions(t,e.definitionProvider);n&&this.register(this.messages,{id:l.generateUuid(),registerOptions:n})}registerLanguageProvider(e){const t={provideDefinition:(e,t,n)=>{const i=this._client,o=(e,t,n)=>i.sendRequest(r.DefinitionRequest.type,i.code2ProtocolConverter.asTextDocumentPositionParams(e,t),n).then(i.protocol2CodeConverter.asDefinitionResult,e=>(i.logFailedRequest(r.DefinitionRequest.type,e),Promise.resolve(null))),s=i.clientOptions.middleware;return s.provideDefinition?s.provideDefinition(e,t,n,o):o(e,t,n)}};return[i.languages.registerDefinitionProvider(e.documentSelector,t),t]}}class L extends P{constructor(e){super(e,r.ReferencesRequest.type)}fillClientCapabilities(e){w(w(e,"textDocument"),"references").dynamicRegistration=!0}initialize(e,t){const n=this.getRegistrationOptions(t,e.referencesProvider);n&&this.register(this.messages,{id:l.generateUuid(),registerOptions:n})}registerLanguageProvider(e){const t={provideReferences:(e,t,n,i)=>{const o=this._client,s=(e,t,n,i)=>o.sendRequest(r.ReferencesRequest.type,o.code2ProtocolConverter.asReferenceParams(e,t,n),i).then(o.protocol2CodeConverter.asReferences,e=>(o.logFailedRequest(r.ReferencesRequest.type,e),Promise.resolve([]))),a=o.clientOptions.middleware;return a.provideReferences?a.provideReferences(e,t,n,i,s):s(e,t,n,i)}};return[i.languages.registerReferenceProvider(e.documentSelector,t),t]}}class M extends P{constructor(e){super(e,r.DocumentHighlightRequest.type)}fillClientCapabilities(e){w(w(e,"textDocument"),"documentHighlight").dynamicRegistration=!0}initialize(e,t){const n=this.getRegistrationOptions(t,e.documentHighlightProvider);n&&this.register(this.messages,{id:l.generateUuid(),registerOptions:n})}registerLanguageProvider(e){const t={provideDocumentHighlights:(e,t,n)=>{const i=this._client,o=(e,t,n)=>i.sendRequest(r.DocumentHighlightRequest.type,i.code2ProtocolConverter.asTextDocumentPositionParams(e,t),n).then(i.protocol2CodeConverter.asDocumentHighlights,e=>(i.logFailedRequest(r.DocumentHighlightRequest.type,e),Promise.resolve([]))),s=i.clientOptions.middleware;return s.provideDocumentHighlights?s.provideDocumentHighlights(e,t,n,o):o(e,t,n)}};return[i.languages.registerDocumentHighlightProvider(e.documentSelector,t),t]}}class A extends P{constructor(e){super(e,r.DocumentSymbolRequest.type)}fillClientCapabilities(e){let t=w(w(e,"textDocument"),"documentSymbol");t.dynamicRegistration=!0,t.symbolKind={valueSet:y},t.hierarchicalDocumentSymbolSupport=!0}initialize(e,t){const n=this.getRegistrationOptions(t,e.documentSymbolProvider);n&&this.register(this.messages,{id:l.generateUuid(),registerOptions:n})}registerLanguageProvider(e){const t={provideDocumentSymbols:(e,t)=>{const n=this._client,i=(e,t)=>n.sendRequest(r.DocumentSymbolRequest.type,n.code2ProtocolConverter.asDocumentSymbolParams(e),t).then(e=>{if(null!==e){if(0===e.length)return[];{let t=e[0];return r.DocumentSymbol.is(t)?n.protocol2CodeConverter.asDocumentSymbols(e):n.protocol2CodeConverter.asSymbolInformations(e)}}},e=>(n.logFailedRequest(r.DocumentSymbolRequest.type,e),Promise.resolve([]))),o=n.clientOptions.middleware;return o.provideDocumentSymbols?o.provideDocumentSymbols(e,t,i):i(e,t)}};return[i.languages.registerDocumentSymbolProvider(e.documentSelector,t),t]}}class j extends O{constructor(e){super(e,r.WorkspaceSymbolRequest.type)}fillClientCapabilities(e){let t=w(w(e,"workspace"),"symbol");t.dynamicRegistration=!0,t.symbolKind={valueSet:y}}initialize(e){e.workspaceSymbolProvider&&this.register(this.messages,{id:l.generateUuid(),registerOptions:!0===e.workspaceSymbolProvider?{workDoneProgress:!1}:e.workspaceSymbolProvider})}registerLanguageProvider(e){const t={provideWorkspaceSymbols:(e,t)=>{const n=this._client,i=(e,t)=>n.sendRequest(r.WorkspaceSymbolRequest.type,{query:e},t).then(n.protocol2CodeConverter.asSymbolInformations,e=>(n.logFailedRequest(r.WorkspaceSymbolRequest.type,e),Promise.resolve([]))),o=n.clientOptions.middleware;return o.provideWorkspaceSymbols?o.provideWorkspaceSymbols(e,t,i):i(e,t)}};return[i.languages.registerWorkspaceSymbolProvider(t),t]}}class K extends P{constructor(e){super(e,r.CodeActionRequest.type)}fillClientCapabilities(e){const t=w(w(e,"textDocument"),"codeAction");t.dynamicRegistration=!0,t.isPreferredSupport=!0,t.codeActionLiteralSupport={codeActionKind:{valueSet:[r.CodeActionKind.Empty,r.CodeActionKind.QuickFix,r.CodeActionKind.Refactor,r.CodeActionKind.RefactorExtract,r.CodeActionKind.RefactorInline,r.CodeActionKind.RefactorRewrite,r.CodeActionKind.Source,r.CodeActionKind.SourceOrganizeImports]}}}initialize(e,t){const n=this.getRegistrationOptions(t,e.codeActionProvider);n&&this.register(this.messages,{id:l.generateUuid(),registerOptions:n})}registerLanguageProvider(e){const t={provideCodeActions:(e,t,n,i)=>{const o=this._client,s=(e,t,n,i)=>{const s={textDocument:o.code2ProtocolConverter.asTextDocumentIdentifier(e),range:o.code2ProtocolConverter.asRange(t),context:o.code2ProtocolConverter.asCodeActionContext(n)};return o.sendRequest(r.CodeActionRequest.type,s,i).then(e=>{if(null===e)return;const t=[];for(let n of e)r.Command.is(n)?t.push(o.protocol2CodeConverter.asCommand(n)):t.push(o.protocol2CodeConverter.asCodeAction(n));return t},e=>(o.logFailedRequest(r.CodeActionRequest.type,e),Promise.resolve([])))},a=o.clientOptions.middleware;return a.provideCodeActions?a.provideCodeActions(e,t,n,i,s):s(e,t,n,i)}};return[i.languages.registerCodeActionsProvider(e.documentSelector,t,e.codeActionKinds?{providedCodeActionKinds:this._client.protocol2CodeConverter.asCodeActionKinds(e.codeActionKinds)}:void 0),t]}}class H extends P{constructor(e){super(e,r.CodeLensRequest.type)}fillClientCapabilities(e){w(w(e,"textDocument"),"codeLens").dynamicRegistration=!0}initialize(e,t){const n=this.getRegistrationOptions(t,e.codeLensProvider);n&&this.register(this.messages,{id:l.generateUuid(),registerOptions:n})}registerLanguageProvider(e){const t={provideCodeLenses:(e,t)=>{const n=this._client,i=(e,t)=>n.sendRequest(r.CodeLensRequest.type,n.code2ProtocolConverter.asCodeLensParams(e),t).then(n.protocol2CodeConverter.asCodeLenses,e=>(n.logFailedRequest(r.CodeLensRequest.type,e),Promise.resolve([]))),o=n.clientOptions.middleware;return o.provideCodeLenses?o.provideCodeLenses(e,t,i):i(e,t)},resolveCodeLens:e.resolveProvider?(e,t)=>{const n=this._client,i=(e,t)=>n.sendRequest(r.CodeLensResolveRequest.type,n.code2ProtocolConverter.asCodeLens(e),t).then(n.protocol2CodeConverter.asCodeLens,t=>(n.logFailedRequest(r.CodeLensResolveRequest.type,t),e)),o=n.clientOptions.middleware;return o.resolveCodeLens?o.resolveCodeLens(e,t,i):i(e,t)}:void 0};return[i.languages.registerCodeLensProvider(e.documentSelector,t),t]}}class W extends P{constructor(e){super(e,r.DocumentFormattingRequest.type)}fillClientCapabilities(e){w(w(e,"textDocument"),"formatting").dynamicRegistration=!0}initialize(e,t){const n=this.getRegistrationOptions(t,e.documentFormattingProvider);n&&this.register(this.messages,{id:l.generateUuid(),registerOptions:n})}registerLanguageProvider(e){const t={provideDocumentFormattingEdits:(e,t,n)=>{const i=this._client,o=(e,t,n)=>{const o={textDocument:i.code2ProtocolConverter.asTextDocumentIdentifier(e),options:i.code2ProtocolConverter.asFormattingOptions(t)};return i.sendRequest(r.DocumentFormattingRequest.type,o,n).then(i.protocol2CodeConverter.asTextEdits,e=>(i.logFailedRequest(r.DocumentFormattingRequest.type,e),Promise.resolve([])))},s=i.clientOptions.middleware;return s.provideDocumentFormattingEdits?s.provideDocumentFormattingEdits(e,t,n,o):o(e,t,n)}};return[i.languages.registerDocumentFormattingEditProvider(e.documentSelector,t),t]}}class U extends P{constructor(e){super(e,r.DocumentRangeFormattingRequest.type)}fillClientCapabilities(e){w(w(e,"textDocument"),"rangeFormatting").dynamicRegistration=!0}initialize(e,t){const n=this.getRegistrationOptions(t,e.documentRangeFormattingProvider);n&&this.register(this.messages,{id:l.generateUuid(),registerOptions:n})}registerLanguageProvider(e){const t={provideDocumentRangeFormattingEdits:(e,t,n,i)=>{const o=this._client,s=(e,t,n,i)=>{let s={textDocument:o.code2ProtocolConverter.asTextDocumentIdentifier(e),range:o.code2ProtocolConverter.asRange(t),options:o.code2ProtocolConverter.asFormattingOptions(n)};return o.sendRequest(r.DocumentRangeFormattingRequest.type,s,i).then(o.protocol2CodeConverter.asTextEdits,e=>(o.logFailedRequest(r.DocumentRangeFormattingRequest.type,e),Promise.resolve([])))};let a=o.clientOptions.middleware;return a.provideDocumentRangeFormattingEdits?a.provideDocumentRangeFormattingEdits(e,t,n,i,s):s(e,t,n,i)}};return[i.languages.registerDocumentRangeFormattingEditProvider(e.documentSelector,t),t]}}class $ extends P{constructor(e){super(e,r.DocumentOnTypeFormattingRequest.type)}fillClientCapabilities(e){w(w(e,"textDocument"),"onTypeFormatting").dynamicRegistration=!0}initialize(e,t){const n=this.getRegistrationOptions(t,e.documentOnTypeFormattingProvider);n&&this.register(this.messages,{id:l.generateUuid(),registerOptions:n})}registerLanguageProvider(e){const t={provideOnTypeFormattingEdits:(e,t,n,i,o)=>{const s=this._client,a=(e,t,n,i,o)=>{let a={textDocument:s.code2ProtocolConverter.asTextDocumentIdentifier(e),position:s.code2ProtocolConverter.asPosition(t),ch:n,options:s.code2ProtocolConverter.asFormattingOptions(i)};return s.sendRequest(r.DocumentOnTypeFormattingRequest.type,a,o).then(s.protocol2CodeConverter.asTextEdits,e=>(s.logFailedRequest(r.DocumentOnTypeFormattingRequest.type,e),Promise.resolve([])))},c=s.clientOptions.middleware;return c.provideOnTypeFormattingEdits?c.provideOnTypeFormattingEdits(e,t,n,i,o,a):a(e,t,n,i,o)}},n=e.moreTriggerCharacter||[];return[i.languages.registerOnTypeFormattingEditProvider(e.documentSelector,t,e.firstTriggerCharacter,...n),t]}}class z extends P{constructor(e){super(e,r.RenameRequest.type)}fillClientCapabilities(e){let t=w(w(e,"textDocument"),"rename");t.dynamicRegistration=!0,t.prepareSupport=!0}initialize(e,t){const n=this.getRegistrationOptions(t,e.renameProvider);n&&(a.boolean(e.renameProvider)&&(n.prepareProvider=!1),this.register(this.messages,{id:l.generateUuid(),registerOptions:n}))}registerLanguageProvider(e){const t={provideRenameEdits:(e,t,n,i)=>{const o=this._client,s=(e,t,n,i)=>{let s={textDocument:o.code2ProtocolConverter.asTextDocumentIdentifier(e),position:o.code2ProtocolConverter.asPosition(t),newName:n};return o.sendRequest(r.RenameRequest.type,s,i).then(o.protocol2CodeConverter.asWorkspaceEdit,e=>(o.logFailedRequest(r.RenameRequest.type,e),Promise.reject(new Error(e.message))))},a=o.clientOptions.middleware;return a.provideRenameEdits?a.provideRenameEdits(e,t,n,i,s):s(e,t,n,i)},prepareRename:e.prepareProvider?(e,t,n)=>{const i=this._client,o=(e,t,n)=>{let o={textDocument:i.code2ProtocolConverter.asTextDocumentIdentifier(e),position:i.code2ProtocolConverter.asPosition(t)};return i.sendRequest(r.PrepareRenameRequest.type,o,n).then(e=>r.Range.is(e)?i.protocol2CodeConverter.asRange(e):e&&r.Range.is(e.range)?{range:i.protocol2CodeConverter.asRange(e.range),placeholder:e.placeholder}:Promise.reject(new Error("The element can't be renamed.")),e=>(i.logFailedRequest(r.PrepareRenameRequest.type,e),Promise.reject(new Error(e.message))))},s=i.clientOptions.middleware;return s.prepareRename?s.prepareRename(e,t,n,o):o(e,t,n)}:void 0};return[i.languages.registerRenameProvider(e.documentSelector,t),t]}}class G extends P{constructor(e){super(e,r.DocumentLinkRequest.type)}fillClientCapabilities(e){const t=w(w(e,"textDocument"),"documentLink");t.dynamicRegistration=!0,t.tooltipSupport=!0}initialize(e,t){const n=this.getRegistrationOptions(t,e.documentLinkProvider);n&&this.register(this.messages,{id:l.generateUuid(),registerOptions:n})}registerLanguageProvider(e){const t={provideDocumentLinks:(e,t)=>{const n=this._client,i=(e,t)=>n.sendRequest(r.DocumentLinkRequest.type,n.code2ProtocolConverter.asDocumentLinkParams(e),t).then(n.protocol2CodeConverter.asDocumentLinks,e=>(n.logFailedRequest(r.DocumentLinkRequest.type,e),Promise.resolve([]))),o=n.clientOptions.middleware;return o.provideDocumentLinks?o.provideDocumentLinks(e,t,i):i(e,t)},resolveDocumentLink:e.resolveProvider?(e,t)=>{const n=this._client;let i=(e,t)=>n.sendRequest(r.DocumentLinkResolveRequest.type,n.code2ProtocolConverter.asDocumentLink(e),t).then(n.protocol2CodeConverter.asDocumentLink,t=>(n.logFailedRequest(r.DocumentLinkResolveRequest.type,t),Promise.resolve(e)));const o=n.clientOptions.middleware;return o.resolveDocumentLink?o.resolveDocumentLink(e,t,i):i(e,t)}:void 0};return[i.languages.registerDocumentLinkProvider(e.documentSelector,t),t]}}class V{constructor(e){this._client=e,this._listeners=new Map}get messages(){return r.DidChangeConfigurationNotification.type}fillClientCapabilities(e){w(w(e,"workspace"),"didChangeConfiguration").dynamicRegistration=!0}initialize(){let e=this._client.clientOptions.synchronize.configurationSection;void 0!==e&&this.register(this.messages,{id:l.generateUuid(),registerOptions:{section:e}})}register(e,t){let n=i.workspace.onDidChangeConfiguration(e=>{this.onDidChangeConfiguration(t.registerOptions.section,e)});this._listeners.set(t.id,n),void 0!==t.registerOptions.section&&this.onDidChangeConfiguration(t.registerOptions.section,void 0)}unregister(e){let t=this._listeners.get(e);t&&(this._listeners.delete(e),t.dispose())}dispose(){for(let e of this._listeners.values())e.dispose();this._listeners.clear()}onDidChangeConfiguration(e,t){let n;if(n=a.string(e)?[e]:e,void 0!==n&&void 0!==t){if(!n.some(e=>t.affectsConfiguration(e)))return}let i=e=>{void 0!==e?this._client.sendNotification(r.DidChangeConfigurationNotification.type,{settings:this.extractSettingsInformation(e)}):this._client.sendNotification(r.DidChangeConfigurationNotification.type,{settings:null})},o=this.getMiddleware();o?o(n,i):i(n)}extractSettingsInformation(e){function t(e,t){let n=e;for(let e=0;e<t.length-1;e++){let i=n[t[e]];i||(i=Object.create(null),n[t[e]]=i),n=i}return n}let n=this._client.clientOptions.workspaceFolder?this._client.clientOptions.workspaceFolder.uri:void 0,r=Object.create(null);for(let o=0;o<e.length;o++){let s=e[o],a=s.indexOf("."),c=null;if(c=a>=0?i.workspace.getConfiguration(s.substr(0,a),n).get(s.substr(a+1)):i.workspace.getConfiguration(s,n),c){let n=e[o].split(".");t(r,n)[n[n.length-1]]=c}}return r}getMiddleware(){let e=this._client.clientOptions.middleware;return e.workspace&&e.workspace.didChangeConfiguration?e.workspace.didChangeConfiguration:void 0}}class B{constructor(e){this._client=e,this._commands=new Map}get messages(){return r.ExecuteCommandRequest.type}fillClientCapabilities(e){w(w(e,"workspace"),"executeCommand").dynamicRegistration=!0}initialize(e){e.executeCommandProvider&&this.register(this.messages,{id:l.generateUuid(),registerOptions:Object.assign({},e.executeCommandProvider)})}register(e,t){const n=this._client,o=n.clientOptions.middleware,s=(e,t)=>{let i={command:e,arguments:t};return n.sendRequest(r.ExecuteCommandRequest.type,i).then(void 0,e=>{n.logFailedRequest(r.ExecuteCommandRequest.type,e)})};if(t.registerOptions.commands){const e=[];for(const n of t.registerOptions.commands)e.push(i.commands.registerCommand(n,(...e)=>o.executeCommand?o.executeCommand(n,e,s):s(n,e)));this._commands.set(t.id,e)}}unregister(e){let t=this._commands.get(e);t&&t.forEach(e=>e.dispose())}dispose(){this._commands.forEach(e=>{e.forEach(e=>e.dispose())}),this._commands.clear()}}!function(e){e.is=function(e){return e&&r.MessageReader.is(e.reader)&&r.MessageWriter.is(e.writer)}}(t.MessageTransports||(t.MessageTransports={}));class X{constructor(e,t){this._resolve=e,this._reject=t,this._used=!1}get isUsed(){return this._used}resolve(){this._used=!0,this._resolve()}reject(e){this._used=!0,this._reject(e)}}t.BaseLanguageClient=class{constructor(e,t,n){this._traceFormat=r.TraceFormat.Text,this._features=[],this._method2Message=new Map,this._dynamicFeatures=new Map,this._id=e,this._name=t,n=n||{},this._clientOptions={documentSelector:n.documentSelector||[],synchronize:n.synchronize||{},diagnosticCollectionName:n.diagnosticCollectionName,outputChannelName:n.outputChannelName||this._name,revealOutputChannelOn:n.revealOutputChannelOn||g.Error,stdioEncoding:n.stdioEncoding||"utf8",initializationOptions:n.initializationOptions,initializationFailedHandler:n.initializationFailedHandler,progressOnInitialization:!!n.progressOnInitialization,errorHandler:n.errorHandler||new v(this._name),middleware:n.middleware||{},uriConverters:n.uriConverters,workspaceFolder:n.workspaceFolder},this._clientOptions.synchronize=this._clientOptions.synchronize||{},this.state=m.Initial,this._connectionPromise=void 0,this._resolvedConnection=void 0,this._initializeResult=void 0,n.outputChannel?(this._outputChannel=n.outputChannel,this._disposeOutputChannel=!1):(this._outputChannel=void 0,this._disposeOutputChannel=!0),this._traceOutputChannel=n.traceOutputChannel,this._listeners=void 0,this._providers=void 0,this._diagnostics=void 0,this._fileEvents=[],this._fileEventDelayer=new c.Delayer(250),this._onReady=new Promise((e,t)=>{this._onReadyCallbacks=new X(e,t)}),this._onStop=void 0,this._telemetryEmitter=new r.Emitter,this._stateChangeEmitter=new r.Emitter,this._tracer={log:(e,t)=>{a.string(e)?this.logTrace(e,t):this.logObjectTrace(e)}},this._c2p=o.createConverter(n.uriConverters?n.uriConverters.code2Protocol:void 0),this._p2c=s.createConverter(n.uriConverters?n.uriConverters.protocol2Code:void 0),this._syncedDocuments=new Map,this.registerBuiltinFeatures()}get state(){return this._state}set state(e){let t=this.getPublicState();this._state=e;let n=this.getPublicState();n!==t&&this._stateChangeEmitter.fire({oldState:t,newState:n})}getPublicState(){return this.state===m.Running?f.Running:this.state===m.Starting?f.Starting:f.Stopped}get initializeResult(){return this._initializeResult}sendRequest(e,...t){if(!this.isConnectionActive())throw new Error("Language client is not ready yet");this.forceDocumentSync();try{return this._resolvedConnection.sendRequest(e,...t)}catch(t){throw this.error(`Sending request ${a.string(e)?e:e.method} failed.`,t),t}}onRequest(e,t){if(!this.isConnectionActive())throw new Error("Language client is not ready yet");try{this._resolvedConnection.onRequest(e,t)}catch(t){throw this.error(`Registering request handler ${a.string(e)?e:e.method} failed.`,t),t}}sendNotification(e,t){if(!this.isConnectionActive())throw new Error("Language client is not ready yet");this.forceDocumentSync();try{this._resolvedConnection.sendNotification(e,t)}catch(t){throw this.error(`Sending notification ${a.string(e)?e:e.method} failed.`,t),t}}onNotification(e,t){if(!this.isConnectionActive())throw new Error("Language client is not ready yet");try{this._resolvedConnection.onNotification(e,t)}catch(t){throw this.error(`Registering notification handler ${a.string(e)?e:e.method} failed.`,t),t}}onProgress(e,t,n){if(!this.isConnectionActive())throw new Error("Language client is not ready yet");try{return this._resolvedConnection.onProgress(e,t,n)}catch(e){throw this.error(`Registering progress handler for token ${t} failed.`,e),e}}sendProgress(e,t,n){if(!this.isConnectionActive())throw new Error("Language client is not ready yet");this.forceDocumentSync();try{this._resolvedConnection.sendProgress(e,t,n)}catch(e){throw this.error(`Sending progress for token ${t} failed.`,e),e}}get clientOptions(){return this._clientOptions}get protocol2CodeConverter(){return this._p2c}get code2ProtocolConverter(){return this._c2p}get onTelemetry(){return this._telemetryEmitter.event}get onDidChangeState(){return this._stateChangeEmitter.event}get outputChannel(){return this._outputChannel||(this._outputChannel=i.window.createOutputChannel(this._clientOptions.outputChannelName?this._clientOptions.outputChannelName:this._name)),this._outputChannel}get traceOutputChannel(){return this._traceOutputChannel?this._traceOutputChannel:this.outputChannel}get diagnostics(){return this._diagnostics}createDefaultErrorHandler(){return new v(this._name)}set trace(e){this._trace=e,this.onReady().then(()=>{this.resolveConnection().then(e=>{e.trace(this._trace,this._tracer,{sendNotification:!1,traceFormat:this._traceFormat})})},()=>{})}data2String(e){if(e instanceof r.ResponseError){const t=e;return`  Message: ${t.message}\n  Code: ${t.code} ${t.data?"\n"+t.data.toString():""}`}return e instanceof Error?a.string(e.stack)?e.stack:e.message:a.string(e)?e:e.toString()}info(e,t){this.outputChannel.appendLine(`[Info  - ${(new Date).toLocaleTimeString()}] ${e}`),t&&this.outputChannel.appendLine(this.data2String(t)),this._clientOptions.revealOutputChannelOn<=g.Info&&this.showNotificationMessage()}warn(e,t){this.outputChannel.appendLine(`[Warn  - ${(new Date).toLocaleTimeString()}] ${e}`),t&&this.outputChannel.appendLine(this.data2String(t)),this._clientOptions.revealOutputChannelOn<=g.Warn&&this.showNotificationMessage()}error(e,t){this.outputChannel.appendLine(`[Error - ${(new Date).toLocaleTimeString()}] ${e}`),t&&this.outputChannel.appendLine(this.data2String(t)),this._clientOptions.revealOutputChannelOn<=g.Error&&this.showNotificationMessage()}showNotificationMessage(){i.window.showInformationMessage("A request has failed. See the output for more information.","Go to output").then(()=>{this.outputChannel.show(!0)})}logTrace(e,t){this.traceOutputChannel.appendLine(`[Trace - ${(new Date).toLocaleTimeString()}] ${e}`),t&&this.traceOutputChannel.appendLine(this.data2String(t))}logObjectTrace(e){e.isLSPMessage&&e.type?this.traceOutputChannel.append(`[LSP   - ${(new Date).toLocaleTimeString()}] `):this.traceOutputChannel.append(`[Trace - ${(new Date).toLocaleTimeString()}] `),e&&this.traceOutputChannel.appendLine(`${JSON.stringify(e)}`)}needsStart(){return this.state===m.Initial||this.state===m.Stopping||this.state===m.Stopped}needsStop(){return this.state===m.Starting||this.state===m.Running}onReady(){return this._onReady}isConnectionActive(){return this.state===m.Running&&!!this._resolvedConnection}start(){return this._onReadyCallbacks.isUsed&&(this._onReady=new Promise((e,t)=>{this._onReadyCallbacks=new X(e,t)})),this._listeners=[],this._providers=[],this._diagnostics||(this._diagnostics=this._clientOptions.diagnosticCollectionName?i.languages.createDiagnosticCollection(this._clientOptions.diagnosticCollectionName):i.languages.createDiagnosticCollection()),this.state=m.Starting,this.resolveConnection().then(e=>(e.onLogMessage(e=>{switch(e.type){case r.MessageType.Error:this.error(e.message);break;case r.MessageType.Warning:this.warn(e.message);break;case r.MessageType.Info:this.info(e.message);break;default:this.outputChannel.appendLine(e.message)}}),e.onShowMessage(e=>{switch(e.type){case r.MessageType.Error:i.window.showErrorMessage(e.message);break;case r.MessageType.Warning:i.window.showWarningMessage(e.message);break;case r.MessageType.Info:i.window.showInformationMessage(e.message);break;default:i.window.showInformationMessage(e.message)}}),e.onRequest(r.ShowMessageRequest.type,e=>{let t;switch(e.type){case r.MessageType.Error:t=i.window.showErrorMessage;break;case r.MessageType.Warning:t=i.window.showWarningMessage;break;case r.MessageType.Info:t=i.window.showInformationMessage;break;default:t=i.window.showInformationMessage}let n=e.actions||[];return t(e.message,...n)}),e.onTelemetry(e=>{this._telemetryEmitter.fire(e)}),e.listen(),this.initialize(e))).then(void 0,e=>{this.state=m.StartFailed,this._onReadyCallbacks.reject(e),this.error("Starting client failed",e),i.window.showErrorMessage(`Couldn't start client ${this._name}`)}),new i.Disposable(()=>{this.needsStop()&&this.stop()})}resolveConnection(){return this._connectionPromise||(this._connectionPromise=this.createConnection()),this._connectionPromise}initialize(e){this.refreshTrace(e,!1);let t=this._clientOptions.initializationOptions,n=this._clientOptions.workspaceFolder?this._clientOptions.workspaceFolder.uri.fsPath:this._clientGetRootPath(),o={processId:process.pid,clientInfo:{name:"vscode",version:i.version},rootPath:n||null,rootUri:n?this._c2p.asUri(i.Uri.file(n)):null,capabilities:this.computeClientCapabilities(),initializationOptions:a.func(t)?t():t,trace:r.Trace.toString(this._trace),workspaceFolders:null};if(this.fillInitializeParams(o),this._clientOptions.progressOnInitialization){const t=l.generateUuid(),n=new u.ProgressPart(e,t);return o.workDoneToken=t,this.doInitialize(e,o).then(e=>(n.done(),e),e=>{throw n.cancel(),e})}return this.doInitialize(e,o)}doInitialize(e,t){return e.initialize(t).then(t=>{this._resolvedConnection=e,this._initializeResult=t,this.state=m.Running;let n=void 0;return a.number(t.capabilities.textDocumentSync)?n=t.capabilities.textDocumentSync===r.TextDocumentSyncKind.None?{openClose:!1,change:r.TextDocumentSyncKind.None,save:void 0}:{openClose:!0,change:t.capabilities.textDocumentSync,save:{includeText:!1}}:void 0!==t.capabilities.textDocumentSync&&null!==t.capabilities.textDocumentSync&&(n=t.capabilities.textDocumentSync),this._capabilities=Object.assign({},t.capabilities,{resolvedTextDocumentSync:n}),e.onDiagnostics(e=>this.handleDiagnostics(e)),e.onRequest(r.RegistrationRequest.type,e=>this.handleRegistrationRequest(e)),e.onRequest("client/registerFeature",e=>this.handleRegistrationRequest(e)),e.onRequest(r.UnregistrationRequest.type,e=>this.handleUnregistrationRequest(e)),e.onRequest("client/unregisterFeature",e=>this.handleUnregistrationRequest(e)),e.onRequest(r.ApplyWorkspaceEditRequest.type,e=>this.handleApplyWorkspaceEdit(e)),e.sendNotification(r.InitializedNotification.type,{}),this.hookFileEvents(e),this.hookConfigurationChanged(e),this.initializeFeatures(e),this._onReadyCallbacks.resolve(),t}).then(void 0,t=>{throw this._clientOptions.initializationFailedHandler?this._clientOptions.initializationFailedHandler(t)?this.initialize(e):(this.stop(),this._onReadyCallbacks.reject(t)):t instanceof r.ResponseError&&t.data&&t.data.retry?i.window.showErrorMessage(t.message,{title:"Retry",id:"retry"}).then(n=>{n&&"retry"===n.id?this.initialize(e):(this.stop(),this._onReadyCallbacks.reject(t))}):(t&&t.message&&i.window.showErrorMessage(t.message),this.error("Server initialization failed.",t),this.stop(),this._onReadyCallbacks.reject(t)),t})}_clientGetRootPath(){let e=i.workspace.workspaceFolders;if(!e||0===e.length)return;let t=e[0];return"file"===t.uri.scheme?t.uri.fsPath:void 0}stop(){return this._initializeResult=void 0,this._connectionPromise?this.state===m.Stopping&&this._onStop?this._onStop:(this.state=m.Stopping,this.cleanUp(!1),this._onStop=this.resolveConnection().then(e=>e.shutdown().then(()=>{e.exit(),e.dispose(),this.state=m.Stopped,this.cleanUpChannel(),this._onStop=void 0,this._connectionPromise=void 0,this._resolvedConnection=void 0}))):(this.state=m.Stopped,Promise.resolve())}cleanUp(e=!0,t=!0){this._listeners&&(this._listeners.forEach(e=>e.dispose()),this._listeners=void 0),this._providers&&(this._providers.forEach(e=>e.dispose()),this._providers=void 0),this._syncedDocuments&&this._syncedDocuments.clear();for(let e of this._dynamicFeatures.values())e.dispose();e&&this.cleanUpChannel(),t&&this._diagnostics&&(this._diagnostics.dispose(),this._diagnostics=void 0)}cleanUpChannel(){this._outputChannel&&this._disposeOutputChannel&&(this._outputChannel.dispose(),this._outputChannel=void 0)}notifyFileEvent(e){var t,n;const i=this;function r(e){i._fileEvents.push(e),i._fileEventDelayer.trigger(()=>{i.onReady().then(()=>{i.resolveConnection().then(e=>{i.isConnectionActive()&&(i.forceDocumentSync(),e.didChangeWatchedFiles({changes:i._fileEvents})),i._fileEvents=[]})},e=>{i.error("Notify file events failed.",e)})})}const o=null===(t=this.clientOptions.middleware)||void 0===t?void 0:t.workspace;(null===(n=o)||void 0===n?void 0:n.didChangeWatchedFile)?o.didChangeWatchedFile(e,r):r(e)}forceDocumentSync(){this._dynamicFeatures.get(r.DidChangeTextDocumentNotification.type.method).forceDelivery()}handleDiagnostics(e){if(!this._diagnostics)return;let t=this._p2c.asUri(e.uri),n=this._p2c.asDiagnostics(e.diagnostics),i=this.clientOptions.middleware;i.handleDiagnostics?i.handleDiagnostics(t,n,(e,t)=>this.setDiagnostics(e,t)):this.setDiagnostics(t,n)}setDiagnostics(e,t){this._diagnostics&&this._diagnostics.set(e,t)}createConnection(){let e=(e,t,n)=>{this.handleConnectionError(e,t,n)},t=()=>{this.handleConnectionClosed()};return this.createMessageTransports(this._clientOptions.stdioEncoding||"utf8").then(n=>(function(e,t,n,i){let o=new d,s=r.createProtocolConnection(e,t,o);return s.onError(e=>{n(e[0],e[1],e[2])}),s.onClose(i),{listen:()=>s.listen(),sendRequest:(e,...t)=>s.sendRequest(a.string(e)?e:e.method,...t),onRequest:(e,t)=>s.onRequest(a.string(e)?e:e.method,t),sendNotification:(e,t)=>s.sendNotification(a.string(e)?e:e.method,t),onNotification:(e,t)=>s.onNotification(a.string(e)?e:e.method,t),onProgress:s.onProgress,sendProgress:s.sendProgress,trace:(e,t,n)=>{const i={sendNotification:!1,traceFormat:r.TraceFormat.Text};void 0===n?s.trace(e,t,i):(a.boolean(n),s.trace(e,t,n))},initialize:e=>s.sendRequest(r.InitializeRequest.type,e),shutdown:()=>s.sendRequest(r.ShutdownRequest.type,void 0),exit:()=>s.sendNotification(r.ExitNotification.type),onLogMessage:e=>s.onNotification(r.LogMessageNotification.type,e),onShowMessage:e=>s.onNotification(r.ShowMessageNotification.type,e),onTelemetry:e=>s.onNotification(r.TelemetryEventNotification.type,e),didChangeConfiguration:e=>s.sendNotification(r.DidChangeConfigurationNotification.type,e),didChangeWatchedFiles:e=>s.sendNotification(r.DidChangeWatchedFilesNotification.type,e),didOpenTextDocument:e=>s.sendNotification(r.DidOpenTextDocumentNotification.type,e),didChangeTextDocument:e=>s.sendNotification(r.DidChangeTextDocumentNotification.type,e),didCloseTextDocument:e=>s.sendNotification(r.DidCloseTextDocumentNotification.type,e),didSaveTextDocument:e=>s.sendNotification(r.DidSaveTextDocumentNotification.type,e),onDiagnostics:e=>s.onNotification(r.PublishDiagnosticsNotification.type,e),dispose:()=>s.dispose()}})(n.reader,n.writer,e,t))}handleConnectionClosed(){if(this.state===m.Stopping||this.state===m.Stopped)return;try{this._resolvedConnection&&this._resolvedConnection.dispose()}catch(e){}let e=p.DoNotRestart;try{e=this._clientOptions.errorHandler.closed()}catch(e){}this._connectionPromise=void 0,this._resolvedConnection=void 0,e===p.DoNotRestart?(this.error("Connection to server got closed. Server will not be restarted."),this.state=m.Stopped,this.cleanUp(!1,!0)):e===p.Restart&&(this.info("Connection to server got closed. Server will restart."),this.cleanUp(!1,!1),this.state=m.Initial,this.start())}handleConnectionError(e,t,n){this._clientOptions.errorHandler.error(e,t,n)===h.Shutdown&&(this.error("Connection to server is erroring. Shutting down server."),this.stop())}hookConfigurationChanged(e){i.workspace.onDidChangeConfiguration(()=>{this.refreshTrace(e,!0)})}refreshTrace(e,t=!1){let n=i.workspace.getConfiguration(this._id),o=r.Trace.Off,s=r.TraceFormat.Text;if(n){const e=n.get("trace.server","off");"string"==typeof e?o=r.Trace.fromString(e):(o=r.Trace.fromString(n.get("trace.server.verbosity","off")),s=r.TraceFormat.fromString(n.get("trace.server.format","text")))}this._trace=o,this._traceFormat=s,e.trace(this._trace,this._tracer,{sendNotification:t,traceFormat:this._traceFormat})}hookFileEvents(e){let t,n=this._clientOptions.synchronize.fileEvents;n&&(t=a.array(n)?n:[n],t&&this._dynamicFeatures.get(r.DidChangeWatchedFilesNotification.type.method).registerRaw(l.generateUuid(),t))}registerFeatures(e){for(let t of e)this.registerFeature(t)}registerFeature(e){if(this._features.push(e),R.is(e)){let t=e.messages;if(Array.isArray(t))for(let n of t)this._method2Message.set(n.method,n),this._dynamicFeatures.set(n.method,e);else this._method2Message.set(t.method,t),this._dynamicFeatures.set(t.method,e)}}getFeature(e){return this._dynamicFeatures.get(e)}registerBuiltinFeatures(){this.registerFeature(new V(this)),this.registerFeature(new _(this,this._syncedDocuments)),this.registerFeature(new T(this)),this.registerFeature(new D(this)),this.registerFeature(new x(this)),this.registerFeature(new b(this)),this.registerFeature(new E(this,this._syncedDocuments)),this.registerFeature(new k(this,e=>this.notifyFileEvent(e))),this.registerFeature(new I(this)),this.registerFeature(new F(this)),this.registerFeature(new N(this)),this.registerFeature(new q(this)),this.registerFeature(new L(this)),this.registerFeature(new M(this)),this.registerFeature(new A(this)),this.registerFeature(new j(this)),this.registerFeature(new K(this)),this.registerFeature(new H(this)),this.registerFeature(new W(this)),this.registerFeature(new U(this)),this.registerFeature(new $(this)),this.registerFeature(new z(this)),this.registerFeature(new G(this)),this.registerFeature(new B(this))}fillInitializeParams(e){for(let t of this._features)a.func(t.fillInitializeParams)&&t.fillInitializeParams(e)}computeClientCapabilities(){let e={};w(e,"workspace").applyEdit=!0;let t=w(w(e,"workspace"),"workspaceEdit");t.documentChanges=!0,t.resourceOperations=[r.ResourceOperationKind.Create,r.ResourceOperationKind.Rename,r.ResourceOperationKind.Delete],t.failureHandling=r.FailureHandlingKind.TextOnlyTransactional;let n=w(w(e,"textDocument"),"publishDiagnostics");n.relatedInformation=!0,n.tagSupport={valueSet:[r.DiagnosticTag.Unnecessary,r.DiagnosticTag.Deprecated]};for(let t of this._features)t.fillClientCapabilities(e);return e}initializeFeatures(e){let t=this._clientOptions.documentSelector;for(let e of this._features)e.initialize(this._capabilities,t)}handleRegistrationRequest(e){return new Promise((t,n)=>{for(let t of e.registrations){const e=this._dynamicFeatures.get(t.method);if(!e)return void n(new Error(`No feature implementation for ${t.method} found. Registration failed.`));const i=t.registerOptions||{};i.documentSelector=i.documentSelector||this._clientOptions.documentSelector;const r={id:t.id,registerOptions:i};e.register(this._method2Message.get(t.method),r)}t()})}handleUnregistrationRequest(e){return new Promise((t,n)=>{for(let t of e.unregisterations){const e=this._dynamicFeatures.get(t.method);if(!e)return void n(new Error(`No feature implementation for ${t.method} found. Unregistration failed.`));e.unregister(t.id)}t()})}handleApplyWorkspaceEdit(e){let t=e.edit,n=new Map;i.workspace.textDocuments.forEach(e=>n.set(e.uri.toString(),e));let o=!1;if(t.documentChanges)for(const e of t.documentChanges)if(r.TextDocumentEdit.is(e)&&e.textDocument.version&&e.textDocument.version>=0){let t=n.get(e.textDocument.uri);if(t&&t.version!==e.textDocument.version){o=!0;break}}return o?Promise.resolve({applied:!1}):a.asPromise(i.workspace.applyEdit(this._p2c.asWorkspaceEdit(e.edit)).then(e=>({applied:e})))}logFailedRequest(e,t){t instanceof r.ResponseError&&(t.code===r.ErrorCodes.RequestCancelled||t.code===r.ErrorCodes.ContentModified)||this.error(`Request ${e.method} failed.`,t)}}},function(e,t,n){"use strict";function i(e){return"string"==typeof e||e instanceof String}function r(e){return Array.isArray(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.boolean=function(e){return!0===e||!1===e},t.string=i,t.number=function(e){return"number"==typeof e||e instanceof Number},t.error=function(e){return e instanceof Error},t.func=function(e){return"function"==typeof e},t.array=r,t.stringArray=function(e){return r(e)&&e.every(e=>i(e))}},function(e,t,n){"use strict";function i(e){return"string"==typeof e||e instanceof String}function r(e){return"function"==typeof e}function o(e){return Array.isArray(e)}function s(e){return e&&r(e.then)}Object.defineProperty(t,"__esModule",{value:!0}),t.boolean=function(e){return!0===e||!1===e},t.string=i,t.number=function(e){return"number"==typeof e||e instanceof Number},t.error=function(e){return e instanceof Error},t.func=r,t.array=o,t.stringArray=function(e){return o(e)&&e.every(e=>i(e))},t.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)},t.thenable=s,t.asPromise=function(e){return e instanceof Promise?e:s(e)?new Promise((t,n)=>{e.then(e=>t(e),e=>n(e))}):Promise.resolve(e)}},function(e,t){e.exports=require("path")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.create=function(e){return{dispose:e}}}(t.Disposable||(t.Disposable={})),function(e){const t={dispose(){}};e.None=function(){return t}}(t.Event||(t.Event={}));class i{add(e,t=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(this._callbacks){for(var n=!1,i=0,r=this._callbacks.length;i<r;i++)if(this._callbacks[i]===e){if(this._contexts[i]===t)return this._callbacks.splice(i,1),void this._contexts.splice(i,1);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[];for(var t=[],n=this._callbacks.slice(0),i=this._contexts.slice(0),r=0,o=n.length;r<o;r++)try{t.push(n[r].apply(i[r],e))}catch(e){console.error(e)}return t}isEmpty(){return!this._callbacks||0===this._callbacks.length}dispose(){this._callbacks=void 0,this._contexts=void 0}}class r{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,t,n)=>{let o;return this._callbacks||(this._callbacks=new i),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t),o={dispose:()=>{this._callbacks.remove(e,t),o.dispose=r._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this)}},Array.isArray(n)&&n.push(o),o}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}t.Emitter=r,r._noop=function(){}},function(e,t){e.exports=require("fs")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(7),r=n(4);let o=8192,s=Buffer.from("\r","ascii")[0],a=Buffer.from("\n","ascii")[0],c="\r\n";class l{constructor(e="utf8"){this.encoding=e,this.index=0,this.buffer=Buffer.allocUnsafe(o)}append(e){var t=e;if("string"==typeof e){var n=e,i=Buffer.byteLength(n,this.encoding);(t=Buffer.allocUnsafe(i)).write(n,0,i,this.encoding)}if(this.buffer.length-this.index>=t.length)t.copy(this.buffer,this.index,0,t.length);else{var r=(Math.ceil((this.index+t.length)/o)+1)*o;0===this.index?(this.buffer=Buffer.allocUnsafe(r),t.copy(this.buffer,0,0,t.length)):this.buffer=Buffer.concat([this.buffer.slice(0,this.index),t],r)}this.index+=t.length}tryReadHeaders(){let e=void 0,t=0;for(;t+3<this.index&&(this.buffer[t]!==s||this.buffer[t+1]!==a||this.buffer[t+2]!==s||this.buffer[t+3]!==a);)t++;if(t+3>=this.index)return e;e=Object.create(null),this.buffer.toString("ascii",0,t).split(c).forEach(t=>{let n=t.indexOf(":");if(-1===n)throw new Error("Message header must separate key and value using :");let i=t.substr(0,n),r=t.substr(n+1).trim();e[i]=r});let n=t+4;return this.buffer=this.buffer.slice(n),this.index=this.index-n,e}tryReadContent(e){if(this.index<e)return null;let t=this.buffer.toString(this.encoding,0,e),n=e;return this.buffer.copy(this.buffer,0,n),this.index=this.index-n,t}get numberOfBytes(){return this.index}}!function(e){e.is=function(e){let t=e;return t&&r.func(t.listen)&&r.func(t.dispose)&&r.func(t.onError)&&r.func(t.onClose)&&r.func(t.onPartialMessage)}}(t.MessageReader||(t.MessageReader={}));class u{constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter,this.partialMessageEmitter=new i.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: ${r.string(e.message)?e.message:"unknown"}`)}}t.AbstractMessageReader=u;class d extends u{constructor(e,t="utf8"){super(),this.readable=e,this.buffer=new l(t),this._partialMessageTimeout=1e4}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,this.readable.on("data",e=>{this.onData(e)}),this.readable.on("error",e=>this.fireError(e)),this.readable.on("close",()=>this.fireClose())}onData(e){for(this.buffer.append(e);;){if(-1===this.nextMessageLength){let e=this.buffer.tryReadHeaders();if(!e)return;let t=e["Content-Length"];if(!t)throw new Error("Header must provide a Content-Length property.");let n=parseInt(t);if(isNaN(n))throw new Error("Content-Length value must be a number.");this.nextMessageLength=n}var t=this.buffer.tryReadContent(this.nextMessageLength);if(null===t)return void this.setPartialMessageTimer();this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.messageToken++;var n=JSON.parse(t);this.callback(n)}}clearPartialMessageTimer(){this.partialMessageTimer&&(clearTimeout(this.partialMessageTimer),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),this._partialMessageTimeout<=0||(this.partialMessageTimer=setTimeout((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}t.StreamMessageReader=d;t.IPCMessageReader=class extends u{constructor(e){super(),this.process=e;let t=this.process;t.on("error",e=>this.fireError(e)),t.on("close",()=>this.fireClose())}listen(e){this.process.on("message",e)}};t.SocketMessageReader=class extends d{constructor(e,t="utf-8"){super(e,t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(7),r=n(4);let o="Content-Length: ",s="\r\n";!function(e){e.is=function(e){let t=e;return t&&r.func(t.dispose)&&r.func(t.onClose)&&r.func(t.onError)&&r.func(t.write)}}(t.MessageWriter||(t.MessageWriter={}));class a{constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,n){this.errorEmitter.fire([this.asError(e),t,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: ${r.string(e.message)?e.message:"unknown"}`)}}t.AbstractMessageWriter=a;t.StreamMessageWriter=class extends a{constructor(e,t="utf8"){super(),this.writable=e,this.encoding=t,this.errorCount=0,this.writable.on("error",e=>this.fireError(e)),this.writable.on("close",()=>this.fireClose())}write(e){let t=JSON.stringify(e),n=Buffer.byteLength(t,this.encoding),i=[o,n.toString(),s,s];try{this.writable.write(i.join(""),"ascii"),this.writable.write(t,this.encoding),this.errorCount=0}catch(t){this.errorCount++,this.fireError(t,e,this.errorCount)}}};t.IPCMessageWriter=class extends a{constructor(e){super(),this.process=e,this.errorCount=0,this.queue=[],this.sending=!1;let t=this.process;t.on("error",e=>this.fireError(e)),t.on("close",()=>this.fireClose)}write(e){this.sending||0!==this.queue.length?this.queue.push(e):this.doWriteMessage(e)}doWriteMessage(e){try{this.process.send&&(this.sending=!0,this.process.send(e,void 0,void 0,t=>{this.sending=!1,t?(this.errorCount++,this.fireError(t,e,this.errorCount)):this.errorCount=0,this.queue.length>0&&this.doWriteMessage(this.queue.shift())}))}catch(t){this.errorCount++,this.fireError(t,e,this.errorCount)}}};t.SocketMessageWriter=class extends a{constructor(e,t="utf8"){super(),this.socket=e,this.queue=[],this.sending=!1,this.encoding=t,this.errorCount=0,this.socket.on("error",e=>this.fireError(e)),this.socket.on("close",()=>this.fireClose())}dispose(){super.dispose(),this.socket.destroy()}write(e){this.sending||0!==this.queue.length?this.queue.push(e):this.doWriteMessage(e)}doWriteMessage(e){let t=JSON.stringify(e),n=Buffer.byteLength(t,this.encoding),i=[o,n.toString(),s,s];try{this.sending=!0,this.socket.write(i.join(""),"ascii",n=>{n&&this.handleError(n,e);try{this.socket.write(t,this.encoding,t=>{this.sending=!1,t?this.handleError(t,e):this.errorCount=0,this.queue.length>0&&this.doWriteMessage(this.queue.shift())})}catch(n){this.handleError(n,e)}})}catch(t){this.handleError(t,e)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}}},function(e,t){e.exports=require("child_process")},function(e,t){e.exports=require("net")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(2);!function(e){e.method="textDocument/prepareCallHierarchy",e.type=new i.RequestType(e.method)}(t.CallHierarchyPrepareRequest||(t.CallHierarchyPrepareRequest={})),function(e){e.method="callHierarchy/incomingCalls",e.type=new i.RequestType(e.method),e.resultType=new i.ProgressType}(t.CallHierarchyIncomingCallsRequest||(t.CallHierarchyIncomingCallsRequest={})),function(e){e.method="callHierarchy/outgoingCalls",e.type=new i.RequestType(e.method),e.resultType=new i.ProgressType}(t.CallHierarchyOutgoingCallsRequest||(t.CallHierarchyOutgoingCallsRequest={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(0);class r extends i.CompletionItem{constructor(e){super(e)}}t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(0);class r extends i.CodeLens{constructor(e){super(e)}}t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(0);class r extends i.DocumentLink{constructor(e,t){super(e,t)}}t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class i{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}}class r extends i{constructor(){super([r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),"-",r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),"-","4",r._randomHex(),r._randomHex(),r._randomHex(),"-",r._oneOf(r._timeHighBits),r._randomHex(),r._randomHex(),r._randomHex(),"-",r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex()].join(""))}static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return r._oneOf(r._chars)}}function o(){return new r}r._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"],r._timeHighBits=["8","9","a","b"],t.empty=new i("00000000-0000-0000-0000-000000000000"),t.v4=o;const s=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function a(e){return s.test(e)}t.isUUID=a,t.parse=function(e){if(!a(e))throw new Error("invalid uuid");return new i(e)},t.generateUuid=function(){return o().asHex()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(0),r=n(1),o=n(5);t.ProgressPart=class{constructor(e,t){this._client=e,this._token=t,this._reported=0,this._disposable=this._client.onProgress(r.WorkDoneProgress.type,this._token,e=>{switch(e.kind){case"begin":this.begin(e);break;case"report":this.report(e);break;case"end":this.done()}})}begin(e){let t=e.cancellable?i.ProgressLocation.Notification:i.ProgressLocation.Window;i.window.withProgress({location:t,cancellable:e.cancellable,title:e.title},async(t,n)=>(this._progress=t,this._infinite=void 0===e.percentage,this._cancellationToken=n,this._cancellationToken.onCancellationRequested(()=>{this._client.sendNotification(r.WorkDoneProgressCancelNotification.type,{token:this._token})}),this.report(e),new Promise((e,t)=>{this._resolve=e,this._reject=t})))}report(e){if(this._infinite&&o.string(e.message))this._progress.report({message:e.message});else if(o.number(e.percentage)){let t=Math.max(0,Math.min(e.percentage,100)),n=Math.max(0,t-this._reported);this._progress.report({message:e.message,increment:n}),this._reported+=n}}cancel(){this._disposable&&(this._disposable.dispose(),this._disposable=void 0),this._reject&&(this._reject(),this._resolve=void 0,this._reject=void 0)}done(){this._disposable&&(this._disposable.dispose(),this._disposable=void 0),this._resolve&&(this._resolve(),this._resolve=void 0,this._reject=void 0)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(8),r=n(6);function o(e){return new Promise((t,n)=>{i.exists(e,e=>{t(e)})})}var s;function a(e){return e.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}t.findEslint=async function(e){const t=process.platform;return"win32"===t&&await o(r.join(e,"node_modules",".bin","eslint.cmd"))?r.join(".","node_modules",".bin","eslint.cmd"):"linux"!==t&&"darwin"!==t||!await o(r.join(e,"node_modules",".bin","eslint"))?"eslint":r.join(".","node_modules",".bin","eslint")},function(e){e.text="text",e.separator="separator",e.brace="brace",e.bracket="bracket",e.questionMark="questionMark",e.star="star",e.globStar="globStar"}(s||(s={}));class c{constructor(e,t="pattern"){this.value=e,this.index=0,this.mode=t,this.stopChar="pattern"===t?void 0:"}"}makeTextNode(e){return{type:s.text,value:a(this.value.substring(e,this.index))}}next(){let e,t=this.index;for(;(e=this.value[this.index])!==this.stopChar;)switch(e){case"/":return t<this.index?this.makeTextNode(t):(this.index++,{type:s.separator});case"?":return this.index++,{type:s.questionMark};case"*":return"*"===this.value[this.index+1]?(this.index+=2,{type:s.globStar}):(this.index++,{type:s.star});case"{":if(t<this.index)return this.makeTextNode(t);{const e=new c(this.value.substring(this.index+1),"brace"),t=[];let n;for(;void 0!==(n=e.next());){if(n.type===s.globStar||n.type===s.separator)throw new Error(`Invalid glob pattern ${this.index}. Stopped at ${this.index}`);t.push(n)}return this.index=this.index+e.index+2,{type:s.brace,alternatives:t}}case",":if("brace"===this.mode&&t<this.index){let e=this.makeTextNode(t);return this.index++,e}this.index++;break;case"[":const e=[];this.index++;const n=this.index;for(;this.index<this.value.length;){const t=this.value[this.index];if(this.index===n)switch(t){case"]":e.push(t);break;case"!":case"^":e.push("^");break;default:e.push(a(t))}else if("-"===t)e.push(t);else{if("]"===t)return this.index++,{type:s.bracket,value:e.join("")};e.push(a(t))}this.index++}throw new Error(`Invalid glob pattern ${this.index}. Stopped at ${this.index}`);default:this.index++}return t===this.index?void 0:this.makeTextNode(t)}}t.convert2RegExp=function(e){const t="win32"===process.platform?"\\\\":"\\/",n=`[^${t}]`;function i(e){switch(e.type){case s.separator:return t;case s.text:return e.value;case s.questionMark:return n;case s.star:return`${n}*?`;case s.globStar:return`(?:${n}|(?:(?:${n}${t})+${n}))*?`;case s.bracket:return`[${e.value}]`;case s.brace:{let t=[];for(const n of e.alternatives)t.push(i(n));return`(?:${t.join("|")})`}}}try{const t=["^"];let n,r=new c(e);for(;void 0!==(n=r.next());)t.push(i(n));return t.length>0?new RegExp(t.join("")):void 0}catch(e){return void console.error(e)}},t.toOSPath=function(e){return"win32"===process.platform?(e=e.replace(/^\/(\w)\//,"$1:\\")).replace(/\//g,"\\"):e},t.toPosixPath=function(e){return"win32"!==process.platform?e:e.replace(/\\/g,"/")};t.Semaphore=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,n)=>{this._waiting.push({thunk:e,resolve:t,reject:n}),this.runNext()})}get active(){return this._active}runNext(){0!==this._waiting.length&&this._active!==this._capacity&&process.nextTick(()=>this.doRunNext())}doRunNext(){if(0===this._waiting.length||this._active===this._capacity)return;const e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const t=e.thunk();t instanceof Promise?t.then(t=>{this._active--,e.resolve(t),this.runNext()},t=>{this._active--,e.reject(t),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(6),r=n(8),o=n(0),s=n(21),a=n(19),c=n(56);var l,u,d,h,p,g,f,m,v,y,C,w,R,S,_,E;!function(e){const t=Object.prototype.toString;e.boolean=function(e){return!0===e||!1===e},e.string=function(e){return"[object String]"===t.call(e)}}(l||(l={})),function(e){e.is=function(e){const t=e;return t&&l.string(t.language)&&(l.boolean(t.autoFix)||void 0===t.autoFix)}}(u||(u={})),function(e){e.is=function(e){const t=e;return t&&l.string(t.directory)&&l.boolean(t.changeProcessCWD)}}(d||(d={})),function(e){e.auto="auto",e.location="location"}(h||(h={})),function(e){e.is=function(t){return t===e.auto||t===e.location}}(h||(h={})),function(e){e.is=function(e){const t=e;return t&&h.is(t.mode)}}(p||(p={})),function(e){e.is=function(e){const t=e;return t&&l.string(t.directory)&&(l.boolean(t["!cwd"])||void 0===t["!cwd"])}}(g||(g={})),function(e){e.is=function(e){const t=e;return t&&l.string(t.pattern)&&(l.boolean(t["!cwd"])||void 0===t["!cwd"])}}(f||(f={})),function(e){e.all="all",e.problems="problems"}(m||(m={})),function(e){e.from=function(t){switch(t.toLowerCase()){case e.problems:return e.problems;default:return e.all}}}(m||(m={})),function(e){e.on="on",e.off="off",e.probe="probe"}(v||(v={})),function(e){e.off="off",e.warn="warn",e.error="error"}(y||(y={})),function(e){e.from=function(t){switch(t.toLowerCase()){case e.off:return e.off;case e.warn:return e.warn;case e.error:return e.error;default:return e.off}}}(y||(y={})),function(e){e[e.ok=1]="ok",e[e.warn=2]="warn",e[e.error=3]="error"}(C||(C={})),function(e){e.type=new s.NotificationType("eslint/status")}(w||(w={})),function(e){e.type=new s.RequestType("eslint/noConfig")}(R||(R={})),function(e){e.type=new s.RequestType("eslint/noLibrary")}(S||(S={})),function(e){e.type=new s.RequestType("eslint/openDoc")}(_||(_={})),function(e){e.type=new s.RequestType("eslint/probleFailed")}(E||(E={}));const T=new s.NotificationType("eslint/exitCalled");async function D(e,t){if(1===e.length)return Promise.resolve(e[0]);const n=await o.window.showQuickPick(e.map(e=>({label:e.name,description:e.uri.fsPath,folder:e})),{placeHolder:t});return void 0!==n?n.folder:void 0}function x(){const e=o.workspace.workspaceFolders;if(!e)return void o.window.showWarningMessage("ESLint can only be enabled if VS Code is opened on a workspace folder.");const t=e.filter(e=>!o.workspace.getConfiguration("eslint",e.uri).get("enable",!0));0!==t.length?D(t,"Select a workspace folder to enable ESLint for").then(e=>{e&&o.workspace.getConfiguration("eslint",e.uri).update("enable",!0)}):1===e.length?o.window.showInformationMessage("ESLint is already enabled in the workspace."):o.window.showInformationMessage("ESLint is already enabled on all workspace folders.")}function b(){const e=o.workspace.workspaceFolders;if(!e)return void o.window.showErrorMessage("ESLint can only be disabled if VS Code is opened on a workspace folder.");const t=e.filter(e=>o.workspace.getConfiguration("eslint",e.uri).get("enable",!0));0!==t.length?D(t,"Select a workspace folder to disable ESLint for").then(e=>{e&&o.workspace.getConfiguration("eslint",e.uri).update("enable",!1)}):1===e.length?o.window.showInformationMessage("ESLint is already disabled in the workspace."):o.window.showInformationMessage("ESLint is already disabled on all workspace folders.")}function k(){const e=o.workspace.workspaceFolders;if(!e)return void o.window.showErrorMessage("An ESLint configuration can only be generated if VS Code is opened on a workspace folder.");const t=e.filter(e=>{const t=[".eslintrc.js",".eslintrc.yaml",".eslintrc.yml",".eslintrc",".eslintrc.json"];for(const n of t)if(r.existsSync(i.join(e.uri.fsPath,n)))return!1;return!0});0!==t.length?D(t,"Select a workspace folder to generate a ESLint configuration for").then(async e=>{if(!e)return;const t=e.uri.fsPath,n=o.window.createTerminal({name:"ESLint init",cwd:t}),i=await a.findEslint(t);n.sendText(`${i} --init`),n.show()}):1===e.length?o.window.showInformationMessage("The workspace already contains an ESLint configuration file."):o.window.showInformationMessage("All workspace folders already contain an ESLint configuration file.")}let P;const O=new Set;function I(e){const t=o.workspace.getConfiguration("eslint",e.uri);if(!t.get("enable",!0))return v.off;const n=e.languageId,i=t.get("validate");if(Array.isArray(i))for(const e of i){if(l.string(e)&&e===n)return v.on;if(u.is(e)&&e.language===n)return v.on}const r=e.uri.toString();if(O.has(r))return v.off;const s=t.get("probe");if(Array.isArray(s))for(const e of s)if(e===n)return v.probe;return v.off}let F;var N;t.activate=function(e){function t(){if(!n)for(const t of o.workspace.textDocuments)if(I(t)!==v.off)return i.dispose(),r.dispose(),n=!0,void L(e)}let n=!1;const i=o.workspace.onDidOpenTextDocument((function(t){n||I(t)!==v.off&&(i.dispose(),r.dispose(),n=!0,L(e))})),r=o.workspace.onDidChangeConfiguration(t),s=()=>o.window.showInformationMessage("ESLint is not running. By default only JavaScript files are validated. If you want to validate other file types please specify them in the 'eslint.validate' setting.");P=[o.commands.registerCommand("eslint.executeAutofix",s),o.commands.registerCommand("eslint.showOutputChannel",s)],e.subscriptions.push(o.commands.registerCommand("eslint.createConfig",k),o.commands.registerCommand("eslint.enable",x),o.commands.registerCommand("eslint.disable",b)),F=new c.TaskProvider,F.start(),t()},function(e){e.create=function(e){return void 0===e?{global:{value:void 0,changed:!1},workspace:{value:void 0,changed:!1},workspaceFolder:{value:void 0,changed:!1}}:{global:{value:e.globalValue,changed:!1},workspace:{value:e.workspaceValue,changed:!1},workspaceFolder:{value:e.workspaceFolderValue,changed:!1}}},e.needsUpdate=function(e){return e.global.changed||e.workspace.changed||e.workspaceFolder.changed}}(N||(N={}));class q{constructor(e){this.workspaceConfig=o.workspace.getConfiguration(void 0,e),this.eslintConfig=o.workspace.getConfiguration("eslint",e),this.editorConfig=o.workspace.getConfiguration("editor",e),this.codeActionOnSave=N.create(this.editorConfig.inspect("codeActionsOnSave")),this.autoFixOnSave=N.create(this.eslintConfig.inspect("autoFixOnSave")),this.validate=N.create(this.eslintConfig.inspect("validate")),this.workingDirectories=N.create(this.eslintConfig.inspect("workingDirectories")),this.languageSpecificSettings=new Map}record(){const e=this.recordAutoFixOnSave();this.recordValidate(e),this.recordWorkingDirectories()}captureDidChangeSetting(e){this.didChangeConfiguration=e}recordAutoFixOnSave(){function e(e,t){var n;if(!1===(null===(n=t.value)||void 0===n?void 0:n["source.fixAll.eslint"]))return!1;void 0===t.value&&(t.value={});const i=!!e.value;let r;return i!==!!t.value["source.fixAll"]&&i&&void 0===t.value["source.fixAll.eslint"]?(t.value["source.fixAll.eslint"]=e.value,t.changed=!0,r=!!t.value["source.fixAll.eslint"]):r=!!t.value["source.fixAll"],r}return[e(this.autoFixOnSave.global,this.codeActionOnSave.global),e(this.autoFixOnSave.workspace,this.codeActionOnSave.workspace),e(this.autoFixOnSave.workspaceFolder,this.codeActionOnSave.workspaceFolder)]}recordValidate(e){function t(e,t,n){if(void 0!==e.value)for(let i=0;i<e.value.length;i++){const r=e.value[i];if("string"!=typeof r&&(n&&!1===r.autoFix&&"string"==typeof r.language)){const e=t(r.language);void 0===e.value&&(e.value=Object.create(null)),!1!==e.value["source.fixAll.eslint"]&&(e.value["source.fixAll.eslint"]=!1,e.changed=!0)}}}const n=this.languageSpecificSettings,i=this.workspaceConfig;function r(e){var t,r,o;let s=n.get(e);if(void 0!==s)return s;const a=i.inspect(`[${e}]`);if(void 0===a)return N.create(void 0);const c=null===(t=a.globalValue)||void 0===t?void 0:t["editor.codeActionsOnSave"],l=null===(r=a.workspaceFolderValue)||void 0===r?void 0:r["editor.codeActionsOnSave"],u=null===(o=a.workspaceValue)||void 0===o?void 0:o["editor.codeActionsOnSave"];return s=N.create({globalValue:c,workspaceFolderValue:l,workspaceValue:u}),n.set(e,s),s}t(this.validate.global,e=>r(e).global,e[0]),t(this.validate.workspace,e=>r(e).workspace,e[1]?e[1]:e[0]),t(this.validate.workspaceFolder,e=>r(e).workspaceFolder,e[2]?e[2]:e[1]?e[1]:e[0])}recordWorkingDirectories(){function e(e){if(void 0!==e.value&&Array.isArray(e.value))for(let t=0;t<e.value.length;t++){const n=e.value[t];"string"==typeof n||p.is(n)||f.is(n)||(!g.is(n)||n["!cwd"])}}e(this.workingDirectories.global),e(this.workingDirectories.workspace),e(this.workingDirectories.workspaceFolder)}needsUpdate(){if(N.needsUpdate(this.autoFixOnSave)||N.needsUpdate(this.validate)||N.needsUpdate(this.codeActionOnSave)||N.needsUpdate(this.workingDirectories))return!0;for(const e of this.languageSpecificSettings.values())if(N.needsUpdate(e))return!0;return!1}async update(){var e,t,n;async function i(e,t,n,i){n.changed&&await e.update(t,n.value,i)}async function r(e,t,n,i,r){i.changed&&(void 0===n&&(n=Object.create(null)),void 0===n["editor.codeActionsOnSave"]&&(n["editor.codeActionsOnSave"]={}),n["editor.codeActionsOnSave"]=i.value,await e.update(t,n,r))}try{await i(this.editorConfig,"codeActionsOnSave",this.codeActionOnSave.global,o.ConfigurationTarget.Global),await i(this.editorConfig,"codeActionsOnSave",this.codeActionOnSave.workspace,o.ConfigurationTarget.Workspace),await i(this.editorConfig,"codeActionsOnSave",this.codeActionOnSave.workspaceFolder,o.ConfigurationTarget.WorkspaceFolder),await i(this.eslintConfig,"autoFixOnSave",this.autoFixOnSave.global,o.ConfigurationTarget.Global),await i(this.eslintConfig,"autoFixOnSave",this.autoFixOnSave.workspace,o.ConfigurationTarget.Workspace),await i(this.eslintConfig,"autoFixOnSave",this.autoFixOnSave.workspaceFolder,o.ConfigurationTarget.WorkspaceFolder),await i(this.eslintConfig,"validate",this.validate.global,o.ConfigurationTarget.Global),await i(this.eslintConfig,"validate",this.validate.workspace,o.ConfigurationTarget.Workspace),await i(this.eslintConfig,"validate",this.validate.workspaceFolder,o.ConfigurationTarget.WorkspaceFolder),await i(this.eslintConfig,"workingDirectories",this.workingDirectories.global,o.ConfigurationTarget.Global),await i(this.eslintConfig,"workingDirectories",this.workingDirectories.workspace,o.ConfigurationTarget.Workspace),await i(this.eslintConfig,"workingDirectories",this.workingDirectories.workspaceFolder,o.ConfigurationTarget.WorkspaceFolder);for(const i of this.languageSpecificSettings.keys()){const s=this.languageSpecificSettings.get(i);if(N.needsUpdate(s)){const a=`[${i}]`,c=this.workspaceConfig.inspect(a);await r(this.workspaceConfig,a,null===(e=c)||void 0===e?void 0:e.globalValue,s.global,o.ConfigurationTarget.Global),await r(this.workspaceConfig,a,null===(t=c)||void 0===t?void 0:t.workspaceValue,s.workspace,o.ConfigurationTarget.Workspace),await r(this.workspaceConfig,a,null===(n=c)||void 0===n?void 0:n.workspaceFolderValue,s.workspaceFolder,o.ConfigurationTarget.WorkspaceFolder)}}}finally{this.didChangeConfiguration&&(this.didChangeConfiguration(),this.didChangeConfiguration=void 0)}}}function L(e){const t=o.window.createStatusBarItem(o.StatusBarAlignment.Right,0);let n=C.ok,r=!1;function c(){r&&n!==C.ok||o.workspace.getConfiguration("eslint").get("alwaysShowStatus",!1)?t.show():t.hide()}function u(e){var t,n,i;let r=void 0;const s=o.workspace.getConfiguration(void 0,e.uri).get(`[${e.languageId}]`);if(void 0!==s){const e=null===(t=s)||void 0===t?void 0:t["editor.codeActionsOnSave"];void 0!==e&&(r=null!=(n=e["source.fixAll.eslint"])?n:e["source.fixAll"])}if(void 0===r){const t=o.workspace.getConfiguration("editor",e.uri).get("codeActionsOnSave");void 0!==t&&(r=null!=(i=t["source.fixAll.eslint"])?i:t["source.fixAll"])}return null!=r&&r}function h(e){var t;G.error(null!=(t=e.message)?t:"Unknown error",e),o.window.showErrorMessage("ESLint settings migration failed. Please see the ESLint output channel for further details","Open Channel").then(e=>{void 0!==e&&G.outputChannel.show()})}t.text="ESLint",t.command="eslint.showOutputChannel";const x=e.asAbsolutePath(i.join("server","out","eslintServer.js")),b=o.workspace.getConfiguration("eslint"),k=b.get("runtime",void 0);let F;b.get("debug")&&(F={DEBUG:"eslint:*,-eslint:code-path"});const N={run:{module:x,transport:s.TransportKind.ipc,runtime:k,options:{cwd:process.cwd(),env:F}},debug:{module:x,transport:s.TransportKind.ipc,runtime:k,options:{execArgv:["--nolazy","--inspect=6011"],cwd:process.cwd(),env:F}}};let L,M=!1;const A={scheme:"file",pattern:"**/package.json"},j={scheme:"file",pattern:"**/.eslintr{c.js,c.yaml,c.yml,c,c.json}"},K=new Map;let H;o.workspace.onDidChangeConfiguration(()=>{O.clear();for(const e of K.values())I(e)===v.off&&(K.delete(e.uri.toString()),G.sendNotification(s.DidCloseTextDocumentNotification.type,G.code2ProtocolConverter.asCloseTextDocumentParams(e)));for(const e of o.workspace.textDocuments)K.has(e.uri.toString())||I(e)===v.off||(G.sendNotification(s.DidOpenTextDocumentNotification.type,G.code2ProtocolConverter.asOpenTextDocumentParams(e)),K.set(e.uri.toString(),e))});const W=new a.Semaphore(1);let U=!1;const $=new Set([o.CodeActionKind.Source.value,o.CodeActionKind.SourceFixAll.value,`${o.CodeActionKind.SourceFixAll.value}.eslint`,o.CodeActionKind.QuickFix.value]),z={documentSelector:[{scheme:"file"},{scheme:"untitled"}],diagnosticCollectionName:"eslint",revealOutputChannelOn:s.RevealOutputChannelOn.Never,initializationOptions:{},progressOnInitialization:!0,synchronize:{fileEvents:[o.workspace.createFileSystemWatcher("**/.eslintr{c.js,c.yaml,c.yml,c,c.json}"),o.workspace.createFileSystemWatcher("**/.eslintignore"),o.workspace.createFileSystemWatcher("**/package.json")]},initializationFailedHandler:e=>(G.error("Server initialization failed.",e),G.outputChannel.show(!0),!1),errorHandler:{error:(e,t,n)=>L.error(e,t,n),closed:()=>M?s.CloseAction.DoNotRestart:L.closed()},middleware:{didOpen:(e,t)=>{if(o.languages.match(A,e)||o.languages.match(j,e)||I(e)!==v.off)return t(e),void K.set(e.uri.toString(),e)},didChange:(e,t)=>{K.has(e.document.uri.toString())&&t(e)},willSave:(e,t)=>{K.has(e.document.uri.toString())&&t(e)},willSaveWaitUntil:(e,t)=>K.has(e.document.uri.toString())?t(e):Promise.resolve([]),didSave:(e,t)=>{K.has(e.uri.toString())&&t(e)},didClose:(e,t)=>{const n=e.uri.toString();K.has(n)&&(K.delete(n),t(e))},provideCodeActions:(e,t,n,i,r)=>{if(!K.has(e.uri.toString()))return[];if(void 0!==n.only&&!$.has(n.only.value))return[];if(void 0===n.only&&(!n.diagnostics||0===n.diagnostics.length))return[];const o=[];for(const e of n.diagnostics)"eslint"===e.source&&o.push(e);return void 0===n.only&&0===o.length?[]:r(e,t,Object.assign({},n,{diagnostics:o}),i)},workspace:{didChangeWatchedFile:(e,t)=>{O.clear(),t(e)},didChangeConfiguration:(e,t)=>{void 0===H||void 0!==e&&0!==e.length?t(e):H.captureDidChangeSetting(()=>{t(e)})},configuration:async(e,t,n)=>{if(void 0===e.items)return[];const r=[];for(const t of e.items){if(t.section||!t.scopeUri){r.push(null);continue}const e=G.protocol2CodeConverter.asUri(t.scopeUri),n=o.workspace.getConfiguration("eslint",e),s=o.workspace.getWorkspaceFolder(e);await W.lock(async()=>{var t;const r=o.workspace.getConfiguration("eslint").get("migration.2_x","on");if(!1===U&&"on"===r)try{if(H=new q(e),H.record(),H.needsUpdate()){const r=null===(t=s)||void 0===t?void 0:t.name,a=i.basename(e.fsPath),c=await o.window.showInformationMessage(["The ESLint 'autoFixOnSave' setting needs to be migrated to the new 'editor.codeActionsOnSave' setting",void 0!==r?`for the workspace folder: ${r}.`:`for the file: ${a}.`,"For compatibility reasons the 'autoFixOnSave' remains and needs to be removed manually.","Do you want to migrate the setting?"].join(" "),{modal:!0},{id:"yes",title:"Yes"},{id:"global",title:"Never migrate Settings"},{id:"readme",title:"Open Readme"},{id:"no",title:"Not now",isCloseAffordance:!0});if(void 0!==c)if("yes"===c.id)try{await H.update()}catch(e){h(e)}else"no"===c.id?U=!0:"global"===c.id?await n.update("migration.2_x","off",o.ConfigurationTarget.Global):"readme"===c.id&&(U=!0,o.env.openExternal(o.Uri.parse("https://github.com/microsoft/vscode-eslint#settings-migration")))}}finally{H=void 0}});const c={validate:v.off,packageManager:n.get("packageManager","npm"),codeActionOnSave:{enable:!1,mode:m.all},format:!1,quiet:n.get("quiet",!1),onIgnoredFiles:y.from(n.get("onIgnoredFiles",y.off)),options:n.get("options",{}),run:n.get("run","onType"),nodePath:n.get("nodePath",null),workingDirectory:void 0,workspaceFolder:void 0,codeAction:{disableRuleComment:n.get("codeAction.disableRuleComment",{enable:!0,location:"separateLine"}),showDocumentation:n.get("codeAction.showDocumentation",{enable:!0})}},C=K.get(t.scopeUri);if(void 0===C){r.push(c);continue}n.get("enabled",!0)&&(c.validate=I(C)),c.validate!==v.off&&(c.format=!!n.get("format.enable",!1),c.codeActionOnSave.enable=u(C),c.codeActionOnSave.mode=m.from(n.get("codeActionsOnSave.mode",m.all))),void 0!==s&&(c.workspaceFolder={name:s.name,uri:G.code2ProtocolConverter.asUri(s.uri)});const w=n.get("workingDirectories",void 0);if(Array.isArray(w)){let e=void 0;const t=s&&"file"===s.uri.scheme?s.uri.fsPath:void 0;for(const n of w){let r,o,s,c=!1;if(l.string(n))r=n;else if(d.is(n))r=n.directory,c=!n.changeProcessCWD;else if(g.is(n))r=n.directory,void 0!==n["!cwd"]&&(c=n["!cwd"]);else if(f.is(n))o=n.pattern,void 0!==n["!cwd"]&&(c=n["!cwd"]);else if(p.is(n)){e=n;continue}if(void 0!==r||void 0!==o){const e="file"===C.uri.scheme?C.uri.fsPath:void 0;if(void 0!==e)if(void 0!==r)r=a.toOSPath(r),i.isAbsolute(r)||void 0===t||(r=i.join(t,r)),r.charAt(r.length-1)!==i.sep&&(r+=i.sep),e.startsWith(r)&&(s=r);else if(void 0!==o&&o.length>0){i.posix.isAbsolute(o)||void 0===t||(o=i.posix.join(a.toPosixPath(t),o)),o.charAt(o.length-1)!==i.posix.sep&&(o+=i.posix.sep);const n=a.convert2RegExp(o);if(void 0!==n){const t=n.exec(e);null!==t&&t.length>0&&(s=t[0])}}}void 0!==s&&(void 0===e||p.is(e)?e={directory:s,"!cwd":c}:e.directory.length<s.length&&(e.directory=s,e["!cwd"]=c))}c.workingDirectory=e}r.push(c)}return r}}}};let G;try{G=new s.LanguageClient("ESLint",N,z)}catch(e){return void o.window.showErrorMessage("The ESLint extension couldn't be started. See the ESLint output channel for details.")}G.registerProposedFeatures(),L=G.createDefaultErrorHandler();const V="ESLint server is running.",B="ESLint server stopped.";G.onDidChangeState(e=>{e.newState===s.State.Running?(G.info(V),t.tooltip=V,r=!0):(G.info(B),t.tooltip=B,r=!1),c()}),G.onReady().then(()=>{G.onNotification(w.type,e=>{!function(e){switch(n=e,e){case C.ok:t.text="ESLint";break;case C.warn:t.text="$(alert) ESLint";break;case C.error:t.text="$(issue-opened) ESLint";break;default:t.text="ESLint"}c()}(e.state)}),G.onNotification(T,e=>{M=!0,G.error(`Server process exited with code ${e[0]}. This usually indicates a misconfigured ESLint setup.`,e[1]),o.window.showErrorMessage("ESLint server shut down itself. See 'ESLint' output channel for details.")}),G.onRequest(R.type,e=>{const t=o.Uri.parse(e.document.uri),i=o.workspace.getWorkspaceFolder(t),r=t.fsPath;return i?G.warn(["",`No ESLint configuration (e.g .eslintrc) found for file: ${r}`,`File will not be validated. Consider running 'eslint --init' in the workspace folder ${i.name}`,"Alternatively you can disable ESLint by executing the 'Disable ESLint' command."].join("\n")):G.warn(["",`No ESLint configuration (e.g .eslintrc) found for file: ${r}`,"File will not be validated. Alternatively you can disable ESLint by executing the 'Disable ESLint' command."].join("\n")),n=C.warn,c(),{}}),G.onRequest(S.type,t=>{const n="noESLintMessageShown",i=e.globalState.get(n,{}),r=o.Uri.parse(t.source.uri),s=o.workspace.getWorkspaceFolder(r),a=o.workspace.getConfiguration("eslint",r).get("packageManager","npm"),c={npm:"npm install eslint",pnpm:"pnpm install eslint",yarn:"yarn add eslint"},l={npm:"npm install -g eslint",pnpm:"pnpm install -g eslint",yarn:"yarn global add eslint"},u="npm"===a,d={title:"Go to output",id:1};return s?(G.info(["",`Failed to load the ESLint library for the document ${r.fsPath}`,"",`To use ESLint please install eslint by running ${c[a]} in the workspace folder ${s.name}`,`or globally using '${l[a]}'. You need to reopen the workspace after installing eslint.`,"",u?"If you are using yarn or pnpm instead of npm set the setting `eslint.packageManager` to either `yarn` or `pnpm`":null,`Alternatively you can disable ESLint for the workspace folder ${s.name} by executing the 'Disable ESLint' command.`].filter(e=>null!==e).join("\n")),void 0===i.workspaces&&(i.workspaces={}),i.workspaces[s.uri.toString()]||(i.workspaces[s.uri.toString()]=!0,e.globalState.update(n,i),o.window.showInformationMessage(`Failed to load the ESLint library for the document ${r.fsPath}. See the output for more information.`,d).then(e=>{e&&1===e.id&&G.outputChannel.show(!0)}))):(G.info([`Failed to load the ESLint library for the document ${r.fsPath}`,`To use ESLint for single JavaScript file install eslint globally using '${l[a]}'.`,u?"If you are using yarn or pnpm instead of npm set the setting `eslint.packageManager` to either `yarn` or `pnpm`":null,"You need to reopen VS Code after installing eslint."].filter(e=>null!==e).join("\n")),i.global||(i.global=!0,e.globalState.update(n,i),o.window.showInformationMessage(`Failed to load the ESLint library for the document ${r.fsPath}. See the output for more information.`,d).then(e=>{e&&1===e.id&&G.outputChannel.show(!0)}))),{}}),G.onRequest(_.type,e=>(o.commands.executeCommand("vscode.open",o.Uri.parse(e.url)),{})),G.onRequest(E.type,e=>{O.add(e.textDocument.uri);const t=G.getFeature(s.DidCloseTextDocumentNotification.method);for(const n of o.workspace.textDocuments)n.uri.toString()===e.textDocument.uri&&t.getProvider(n).send(n)})}),P&&(P.forEach(e=>e.dispose()),P=void 0),c(),e.subscriptions.push(G.start(),o.commands.registerCommand("eslint.executeAutofix",()=>{const e=o.window.activeTextEditor;if(!e)return;const t={command:"eslint.applyAllFixes",arguments:[{uri:e.document.uri.toString(),version:e.document.version}]};G.sendRequest(s.ExecuteCommandRequest.type,t).then(void 0,()=>{o.window.showErrorMessage("Failed to apply ESLint fixes to the document. Please consider opening an issue with steps to reproduce.")})}),o.commands.registerCommand("eslint.showOutputChannel",()=>{G.outputChannel.show()}),o.commands.registerCommand("eslint.migrateSettings",()=>{!async function(){const e=o.workspace.workspaceFolders;if(void 0===e)return void o.window.showErrorMessage("ESLint settings can only be converted if VS Code is opened on a workspace folder.");const t=await D(e,"Pick a folder to convert its settings");if(void 0===t)return;const n=new q(t.uri);if(n.record(),n.needsUpdate())try{await n.update()}catch(e){h(e)}}()}),t)}t.deactivate=function(){P&&P.forEach(e=>e.dispose()),F&&F.dispose()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(11),r=n(8),o=n(22),s=n(3),a=n(0),c=n(1),l=n(45),u=n(46),d=n(47),h=n(48),p=n(49),g=n(50),f=n(51),m=n(52),v=n(53),y=n(54),C=n(5),w=n(55);!function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(3));const R="^1.40.0";var S,_,E,T,D,x,b;!function(e){e.is=function(e){return C.string(e.command)}}(S||(S={})),function(e){e[e.stdio=0]="stdio",e[e.ipc=1]="ipc",e[e.pipe=2]="pipe",e[e.socket=3]="socket"}(_=t.TransportKind||(t.TransportKind={})),function(e){e.isSocket=function(e){let t=e;return t&&t.kind===_.socket&&C.number(t.port)}}(E||(E={})),function(e){e.is=function(e){return C.string(e.module)}}(T||(T={})),function(e){e.is=function(e){let t=e;return t&&void 0!==t.writer&&void 0!==t.reader}}(D||(D={})),function(e){e.is=function(e){let t=e;return t&&void 0!==t.process&&"boolean"==typeof t.detached}}(x||(x={}));class k extends s.BaseLanguageClient{constructor(e,t,n,i,r){let o,s,a,c,l;C.string(t)?(o=e,s=t,a=n,c=i,l=!!r):(o=e.toLowerCase(),s=e,a=t,c=n,l=i),void 0===l&&(l=!1),super(o,s,c),this._serverOptions=a,this._forceDebug=l;try{this.checkVersion()}catch(e){throw C.string(e.message)&&this.outputChannel.appendLine(e.message),e}}checkVersion(){let e=o.parse(a.version);if(!e)throw new Error(`No valid VS Code version detected. Version string is: ${a.version}`);if(e.prerelease&&e.prerelease.length>0&&(e.prerelease=[]),!o.satisfies(e,R))throw new Error(`The language client requires VS Code version ${R} but received version ${a.version}`)}stop(){return super.stop().then(()=>{if(this._serverProcess){let e=this._serverProcess;this._serverProcess=void 0,void 0!==this._isDetached&&this._isDetached||this.checkProcessDied(e),this._isDetached=void 0}})}checkProcessDied(e){e&&setTimeout(()=>{try{process.kill(e.pid,0),w.terminate(e)}catch(e){}},2e3)}handleConnectionClosed(){this._serverProcess=void 0,super.handleConnectionClosed()}createMessageTransports(e){function t(e,t){if(!e&&!t)return;let n=Object.create(null);return Object.keys(process.env).forEach(e=>n[e]=process.env[e]),t&&(n.ELECTRON_RUN_AS_NODE="1",n.ELECTRON_NO_ASAR="1"),e&&Object.keys(e).forEach(t=>n[t]=e[t]),n}const n=["--debug=","--debug-brk=","--inspect=","--inspect-brk="],r=["--debug","--debug-brk","--inspect","--inspect-brk"];function o(e){if(null===e.stdin||null===e.stdout||null===e.stderr)throw new Error("Process created without stdio streams")}let a,l=this._serverOptions;if(C.func(l))return l().then(t=>{if(s.MessageTransports.is(t))return this._isDetached=!!t.detached,t;if(D.is(t))return this._isDetached=!!t.detached,{reader:new c.StreamMessageReader(t.reader),writer:new c.StreamMessageWriter(t.writer)};{let n;return x.is(t)?(n=t.process,this._isDetached=t.detached):(n=t,this._isDetached=!1),n.stderr.on("data",t=>this.outputChannel.append(C.string(t)?t:t.toString(e))),{reader:new c.StreamMessageReader(n.stdout),writer:new c.StreamMessageWriter(n.stdin)}}});let u=l;return a=u.run||u.debug?this._forceDebug||function(){let e=process.execArgv;return!!e&&e.some(e=>n.some(t=>e.startsWith(t))||r.some(t=>e===t))}()?u.debug:u.run:l,this._getServerWorkingDir(a.options).then(n=>{if(T.is(a)&&a.module){let r=a,s=r.transport||_.stdio;if(!r.runtime){let a=void 0;return new Promise((l,u)=>{let d=r.args&&r.args.slice()||[];s===_.ipc?d.push("--node-ipc"):s===_.stdio?d.push("--stdio"):s===_.pipe?(a=c.generateRandomPipeName(),d.push(`--pipe=${a}`)):E.isSocket(s)&&d.push(`--socket=${s.port}`),d.push(`--clientProcessId=${process.pid.toString()}`);let h=r.options||Object.create(null);if(h.env=t(h.env,!0),h.execArgv=h.execArgv||[],h.cwd=n,h.silent=!0,s===_.ipc||s===_.stdio){let t=i.fork(r.module,d||[],h);o(t),this._serverProcess=t,t.stderr.on("data",t=>this.outputChannel.append(C.string(t)?t:t.toString(e))),s===_.ipc?(t.stdout.on("data",t=>this.outputChannel.append(C.string(t)?t:t.toString(e))),l({reader:new c.IPCMessageReader(this._serverProcess),writer:new c.IPCMessageWriter(this._serverProcess)})):l({reader:new c.StreamMessageReader(t.stdout),writer:new c.StreamMessageWriter(t.stdin)})}else s===_.pipe?c.createClientPipeTransport(a).then(t=>{let n=i.fork(r.module,d||[],h);o(n),this._serverProcess=n,n.stderr.on("data",t=>this.outputChannel.append(C.string(t)?t:t.toString(e))),n.stdout.on("data",t=>this.outputChannel.append(C.string(t)?t:t.toString(e))),t.onConnected().then(e=>{l({reader:e[0],writer:e[1]})})}):E.isSocket(s)&&c.createClientSocketTransport(s.port).then(t=>{let n=i.fork(r.module,d||[],h);o(n),this._serverProcess=n,n.stderr.on("data",t=>this.outputChannel.append(C.string(t)?t:t.toString(e))),n.stdout.on("data",t=>this.outputChannel.append(C.string(t)?t:t.toString(e))),t.onConnected().then(e=>{l({reader:e[0],writer:e[1]})})})})}{let o=[],a=r.options||Object.create(null);a.execArgv&&a.execArgv.forEach(e=>o.push(e)),o.push(r.module),r.args&&r.args.forEach(e=>o.push(e));let l=Object.create(null);l.cwd=n,l.env=t(a.env,!1);let u=void 0;if(s===_.ipc?(l.stdio=[null,null,null,"ipc"],o.push("--node-ipc")):s===_.stdio?o.push("--stdio"):s===_.pipe?(u=c.generateRandomPipeName(),o.push(`--pipe=${u}`)):E.isSocket(s)&&o.push(`--socket=${s.port}`),o.push(`--clientProcessId=${process.pid.toString()}`),s===_.ipc||s===_.stdio){let t=i.spawn(r.runtime,o,l);return t&&t.pid?(this._serverProcess=t,t.stderr.on("data",t=>this.outputChannel.append(C.string(t)?t:t.toString(e))),s===_.ipc?(t.stdout.on("data",t=>this.outputChannel.append(C.string(t)?t:t.toString(e))),Promise.resolve({reader:new c.IPCMessageReader(t),writer:new c.IPCMessageWriter(t)})):Promise.resolve({reader:new c.StreamMessageReader(t.stdout),writer:new c.StreamMessageWriter(t.stdin)})):Promise.reject(`Launching server using runtime ${r.runtime} failed.`)}if(s===_.pipe)return c.createClientPipeTransport(u).then(t=>{let n=i.spawn(r.runtime,o,l);return n&&n.pid?(this._serverProcess=n,n.stderr.on("data",t=>this.outputChannel.append(C.string(t)?t:t.toString(e))),n.stdout.on("data",t=>this.outputChannel.append(C.string(t)?t:t.toString(e))),t.onConnected().then(e=>({reader:e[0],writer:e[1]}))):Promise.reject(`Launching server using runtime ${r.runtime} failed.`)});if(E.isSocket(s))return c.createClientSocketTransport(s.port).then(t=>{let n=i.spawn(r.runtime,o,l);return n&&n.pid?(this._serverProcess=n,n.stderr.on("data",t=>this.outputChannel.append(C.string(t)?t:t.toString(e))),n.stdout.on("data",t=>this.outputChannel.append(C.string(t)?t:t.toString(e))),t.onConnected().then(e=>({reader:e[0],writer:e[1]}))):Promise.reject(`Launching server using runtime ${r.runtime} failed.`)})}}else if(S.is(a)&&a.command){let t=a,r=t.args||[],o=Object.assign({},t.options);o.cwd=o.cwd||n;let s=i.spawn(t.command,r,o);return s&&s.pid?(s.stderr.on("data",t=>this.outputChannel.append(C.string(t)?t:t.toString(e))),this._serverProcess=s,this._isDetached=!!o.detached,Promise.resolve({reader:new c.StreamMessageReader(s.stdout),writer:new c.StreamMessageWriter(s.stdin)})):Promise.reject(`Launching server using command ${t.command} failed.`)}return Promise.reject(new Error("Unsupported server configuration "+JSON.stringify(l,null,4)))})}registerProposedFeatures(){this.registerFeatures(b.createAll(this))}registerBuiltinFeatures(){super.registerBuiltinFeatures(),this.registerFeature(new u.ConfigurationFeature(this)),this.registerFeature(new h.TypeDefinitionFeature(this)),this.registerFeature(new d.ImplementationFeature(this)),this.registerFeature(new l.ColorProviderFeature(this)),this.registerFeature(new p.WorkspaceFoldersFeature(this)),this.registerFeature(new g.FoldingRangeFeature(this)),this.registerFeature(new f.DeclarationFeature(this)),this.registerFeature(new m.SelectionRangeFeature(this)),this.registerFeature(new v.ProgressFeature(this))}_mainGetRootPath(){let e=a.workspace.workspaceFolders;if(!e||0===e.length)return;let t=e[0];return"file"===t.uri.scheme?t.uri.fsPath:void 0}_getServerWorkingDir(e){let t=e&&e.cwd;return t||(t=this.clientOptions.workspaceFolder?this.clientOptions.workspaceFolder.uri.fsPath:this._mainGetRootPath()),t?new Promise(e=>{r.lstat(t,(n,i)=>{e(!n&&i.isDirectory()?t:void 0)})}):Promise.resolve(void 0)}}t.LanguageClient=k;t.SettingMonitor=class{constructor(e,t){this._client=e,this._setting=t,this._listeners=[]}start(){return a.workspace.onDidChangeConfiguration(this.onDidChangeConfiguration,this,this._listeners),this.onDidChangeConfiguration(),new a.Disposable(()=>{this._client.needsStop()&&this._client.stop()})}onDidChangeConfiguration(){let e=this._setting.indexOf("."),t=e>=0?this._setting.substr(0,e):this._setting,n=e>=0?this._setting.substr(e+1):void 0,i=n?a.workspace.getConfiguration(t).get(n,!1):a.workspace.getConfiguration(t);i&&this._client.needsStart()?this._client.start():!i&&this._client.needsStop()&&this._client.stop()}},function(e){e.createAll=function(e){return[new y.CallHierarchyFeature(e)]}}(b=t.ProposedFeatures||(t.ProposedFeatures={}))},function(e,t){var n;t=e.exports=h,n="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var i=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,o=t.re=[],s=t.src=[],a=t.tokens={},c=0;function l(e){a[e]=c++}l("NUMERICIDENTIFIER"),s[a.NUMERICIDENTIFIER]="0|[1-9]\\d*",l("NUMERICIDENTIFIERLOOSE"),s[a.NUMERICIDENTIFIERLOOSE]="[0-9]+",l("NONNUMERICIDENTIFIER"),s[a.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-][a-zA-Z0-9-]*",l("MAINVERSION"),s[a.MAINVERSION]="("+s[a.NUMERICIDENTIFIER]+")\\.("+s[a.NUMERICIDENTIFIER]+")\\.("+s[a.NUMERICIDENTIFIER]+")",l("MAINVERSIONLOOSE"),s[a.MAINVERSIONLOOSE]="("+s[a.NUMERICIDENTIFIERLOOSE]+")\\.("+s[a.NUMERICIDENTIFIERLOOSE]+")\\.("+s[a.NUMERICIDENTIFIERLOOSE]+")",l("PRERELEASEIDENTIFIER"),s[a.PRERELEASEIDENTIFIER]="(?:"+s[a.NUMERICIDENTIFIER]+"|"+s[a.NONNUMERICIDENTIFIER]+")",l("PRERELEASEIDENTIFIERLOOSE"),s[a.PRERELEASEIDENTIFIERLOOSE]="(?:"+s[a.NUMERICIDENTIFIERLOOSE]+"|"+s[a.NONNUMERICIDENTIFIER]+")",l("PRERELEASE"),s[a.PRERELEASE]="(?:-("+s[a.PRERELEASEIDENTIFIER]+"(?:\\."+s[a.PRERELEASEIDENTIFIER]+")*))",l("PRERELEASELOOSE"),s[a.PRERELEASELOOSE]="(?:-?("+s[a.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+s[a.PRERELEASEIDENTIFIERLOOSE]+")*))",l("BUILDIDENTIFIER"),s[a.BUILDIDENTIFIER]="[0-9A-Za-z-]+",l("BUILD"),s[a.BUILD]="(?:\\+("+s[a.BUILDIDENTIFIER]+"(?:\\."+s[a.BUILDIDENTIFIER]+")*))",l("FULL"),l("FULLPLAIN"),s[a.FULLPLAIN]="v?"+s[a.MAINVERSION]+s[a.PRERELEASE]+"?"+s[a.BUILD]+"?",s[a.FULL]="^"+s[a.FULLPLAIN]+"$",l("LOOSEPLAIN"),s[a.LOOSEPLAIN]="[v=\\s]*"+s[a.MAINVERSIONLOOSE]+s[a.PRERELEASELOOSE]+"?"+s[a.BUILD]+"?",l("LOOSE"),s[a.LOOSE]="^"+s[a.LOOSEPLAIN]+"$",l("GTLT"),s[a.GTLT]="((?:<|>)?=?)",l("XRANGEIDENTIFIERLOOSE"),s[a.XRANGEIDENTIFIERLOOSE]=s[a.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",l("XRANGEIDENTIFIER"),s[a.XRANGEIDENTIFIER]=s[a.NUMERICIDENTIFIER]+"|x|X|\\*",l("XRANGEPLAIN"),s[a.XRANGEPLAIN]="[v=\\s]*("+s[a.XRANGEIDENTIFIER]+")(?:\\.("+s[a.XRANGEIDENTIFIER]+")(?:\\.("+s[a.XRANGEIDENTIFIER]+")(?:"+s[a.PRERELEASE]+")?"+s[a.BUILD]+"?)?)?",l("XRANGEPLAINLOOSE"),s[a.XRANGEPLAINLOOSE]="[v=\\s]*("+s[a.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+s[a.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+s[a.XRANGEIDENTIFIERLOOSE]+")(?:"+s[a.PRERELEASELOOSE]+")?"+s[a.BUILD]+"?)?)?",l("XRANGE"),s[a.XRANGE]="^"+s[a.GTLT]+"\\s*"+s[a.XRANGEPLAIN]+"$",l("XRANGELOOSE"),s[a.XRANGELOOSE]="^"+s[a.GTLT]+"\\s*"+s[a.XRANGEPLAINLOOSE]+"$",l("COERCE"),s[a.COERCE]="(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])",l("COERCERTL"),o[a.COERCERTL]=new RegExp(s[a.COERCE],"g"),l("LONETILDE"),s[a.LONETILDE]="(?:~>?)",l("TILDETRIM"),s[a.TILDETRIM]="(\\s*)"+s[a.LONETILDE]+"\\s+",o[a.TILDETRIM]=new RegExp(s[a.TILDETRIM],"g");l("TILDE"),s[a.TILDE]="^"+s[a.LONETILDE]+s[a.XRANGEPLAIN]+"$",l("TILDELOOSE"),s[a.TILDELOOSE]="^"+s[a.LONETILDE]+s[a.XRANGEPLAINLOOSE]+"$",l("LONECARET"),s[a.LONECARET]="(?:\\^)",l("CARETTRIM"),s[a.CARETTRIM]="(\\s*)"+s[a.LONECARET]+"\\s+",o[a.CARETTRIM]=new RegExp(s[a.CARETTRIM],"g");l("CARET"),s[a.CARET]="^"+s[a.LONECARET]+s[a.XRANGEPLAIN]+"$",l("CARETLOOSE"),s[a.CARETLOOSE]="^"+s[a.LONECARET]+s[a.XRANGEPLAINLOOSE]+"$",l("COMPARATORLOOSE"),s[a.COMPARATORLOOSE]="^"+s[a.GTLT]+"\\s*("+s[a.LOOSEPLAIN]+")$|^$",l("COMPARATOR"),s[a.COMPARATOR]="^"+s[a.GTLT]+"\\s*("+s[a.FULLPLAIN]+")$|^$",l("COMPARATORTRIM"),s[a.COMPARATORTRIM]="(\\s*)"+s[a.GTLT]+"\\s*("+s[a.LOOSEPLAIN]+"|"+s[a.XRANGEPLAIN]+")",o[a.COMPARATORTRIM]=new RegExp(s[a.COMPARATORTRIM],"g");l("HYPHENRANGE"),s[a.HYPHENRANGE]="^\\s*("+s[a.XRANGEPLAIN]+")\\s+-\\s+("+s[a.XRANGEPLAIN]+")\\s*$",l("HYPHENRANGELOOSE"),s[a.HYPHENRANGELOOSE]="^\\s*("+s[a.XRANGEPLAINLOOSE]+")\\s+-\\s+("+s[a.XRANGEPLAINLOOSE]+")\\s*$",l("STAR"),s[a.STAR]="(<|>)?=?\\s*\\*";for(var u=0;u<c;u++)n(u,s[u]),o[u]||(o[u]=new RegExp(s[u]));function d(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof h)return e;if("string"!=typeof e)return null;if(e.length>i)return null;if(!(t.loose?o[a.LOOSE]:o[a.FULL]).test(e))return null;try{return new h(e,t)}catch(e){return null}}function h(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof h){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>i)throw new TypeError("version is longer than "+i+" characters");if(!(this instanceof h))return new h(e,t);n("SemVer",e,t),this.options=t,this.loose=!!t.loose;var s=e.trim().match(t.loose?o[a.LOOSE]:o[a.FULL]);if(!s)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");s[4]?this.prerelease=s[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t<r)return t}return e})):this.prerelease=[],this.build=s[5]?s[5].split("."):[],this.format()}t.parse=d,t.valid=function(e,t){var n=d(e,t);return n?n.version:null},t.clean=function(e,t){var n=d(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null},t.SemVer=h,h.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},h.prototype.toString=function(){return this.version},h.prototype.compare=function(e){return n("SemVer.compare",this.version,this.options,e),e instanceof h||(e=new h(e,this.options)),this.compareMain(e)||this.comparePre(e)},h.prototype.compareMain=function(e){return e instanceof h||(e=new h(e,this.options)),g(this.major,e.major)||g(this.minor,e.minor)||g(this.patch,e.patch)},h.prototype.comparePre=function(e){if(e instanceof h||(e=new h(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;var t=0;do{var i=this.prerelease[t],r=e.prerelease[t];if(n("prerelease compare",t,i,r),void 0===i&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===i)return-1;if(i!==r)return g(i,r)}while(++t)},h.prototype.compareBuild=function(e){e instanceof h||(e=new h(e,this.options));var t=0;do{var i=this.build[t],r=e.build[t];if(n("prerelease compare",t,i,r),void 0===i&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===i)return-1;if(i!==r)return g(i,r)}while(++t)},h.prototype.inc=function(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var n=this.prerelease.length;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,n,i){"string"==typeof n&&(i=n,n=void 0);try{return new h(e,n).inc(t,i).version}catch(e){return null}},t.diff=function(e,t){if(y(e,t))return null;var n=d(e),i=d(t),r="";if(n.prerelease.length||i.prerelease.length){r="pre";var o="prerelease"}for(var s in n)if(("major"===s||"minor"===s||"patch"===s)&&n[s]!==i[s])return r+s;return o},t.compareIdentifiers=g;var p=/^[0-9]+$/;function g(e,t){var n=p.test(e),i=p.test(t);return n&&i&&(e=+e,t=+t),e===t?0:n&&!i?-1:i&&!n?1:e<t?-1:1}function f(e,t,n){return new h(e,n).compare(new h(t,n))}function m(e,t,n){return f(e,t,n)>0}function v(e,t,n){return f(e,t,n)<0}function y(e,t,n){return 0===f(e,t,n)}function C(e,t,n){return 0!==f(e,t,n)}function w(e,t,n){return f(e,t,n)>=0}function R(e,t,n){return f(e,t,n)<=0}function S(e,t,n,i){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return y(e,n,i);case"!=":return C(e,n,i);case">":return m(e,n,i);case">=":return w(e,n,i);case"<":return v(e,n,i);case"<=":return R(e,n,i);default:throw new TypeError("Invalid operator: "+t)}}function _(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof _){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof _))return new _(e,t);n("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===E?this.value="":this.value=this.operator+this.semver.version,n("comp",this)}t.rcompareIdentifiers=function(e,t){return g(t,e)},t.major=function(e,t){return new h(e,t).major},t.minor=function(e,t){return new h(e,t).minor},t.patch=function(e,t){return new h(e,t).patch},t.compare=f,t.compareLoose=function(e,t){return f(e,t,!0)},t.compareBuild=function(e,t,n){var i=new h(e,n),r=new h(t,n);return i.compare(r)||i.compareBuild(r)},t.rcompare=function(e,t,n){return f(t,e,n)},t.sort=function(e,n){return e.sort((function(e,i){return t.compareBuild(e,i,n)}))},t.rsort=function(e,n){return e.sort((function(e,i){return t.compareBuild(i,e,n)}))},t.gt=m,t.lt=v,t.eq=y,t.neq=C,t.gte=w,t.lte=R,t.cmp=S,t.Comparator=_;var E={};function T(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof T)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new T(e.raw,t);if(e instanceof _)return new T(e.value,t);if(!(this instanceof T))return new T(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function D(e,t){for(var n=!0,i=e.slice(),r=i.pop();n&&i.length;)n=i.every((function(e){return r.intersects(e,t)})),r=i.pop();return n}function x(e){return!e||"x"===e.toLowerCase()||"*"===e}function b(e,t,n,i,r,o,s,a,c,l,u,d,h){return((t=x(n)?"":x(i)?">="+n+".0.0":x(r)?">="+n+"."+i+".0":">="+t)+" "+(a=x(c)?"":x(l)?"<"+(+c+1)+".0.0":x(u)?"<"+c+"."+(+l+1)+".0":d?"<="+c+"."+l+"."+u+"-"+d:"<="+a)).trim()}function k(e,t,i){for(var r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!i.includePrerelease){for(r=0;r<e.length;r++)if(n(e[r].semver),e[r].semver!==E&&e[r].semver.prerelease.length>0){var o=e[r].semver;if(o.major===t.major&&o.minor===t.minor&&o.patch===t.patch)return!0}return!1}return!0}function P(e,t,n){try{t=new T(t,n)}catch(e){return!1}return t.test(e)}function O(e,t,n,i){var r,o,s,a,c;switch(e=new h(e,i),t=new T(t,i),n){case">":r=m,o=R,s=v,a=">",c=">=";break;case"<":r=v,o=w,s=m,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(P(e,t,i))return!1;for(var l=0;l<t.set.length;++l){var u=t.set[l],d=null,p=null;if(u.forEach((function(e){e.semver===E&&(e=new _(">=0.0.0")),d=d||e,p=p||e,r(e.semver,d.semver,i)?d=e:s(e.semver,p.semver,i)&&(p=e)})),d.operator===a||d.operator===c)return!1;if((!p.operator||p.operator===a)&&o(e,p.semver))return!1;if(p.operator===c&&s(e,p.semver))return!1}return!0}_.prototype.parse=function(e){var t=this.options.loose?o[a.COMPARATORLOOSE]:o[a.COMPARATOR],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new h(n[2],this.options.loose):this.semver=E},_.prototype.toString=function(){return this.value},_.prototype.test=function(e){if(n("Comparator.test",e,this.options.loose),this.semver===E||e===E)return!0;if("string"==typeof e)try{e=new h(e,this.options)}catch(e){return!1}return S(e,this.operator,this.semver,this.options)},_.prototype.intersects=function(e,t){if(!(e instanceof _))throw new TypeError("a Comparator is required");var n;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||(n=new T(e.value,t),P(this.value,n,t));if(""===e.operator)return""===e.value||(n=new T(this.value,t),P(e.semver,n,t));var i=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),r=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),o=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=S(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=S(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return i||r||o&&s||a||c},t.Range=T,T.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},T.prototype.toString=function(){return this.range},T.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var i=t?o[a.HYPHENRANGELOOSE]:o[a.HYPHENRANGE];e=e.replace(i,b),n("hyphen replace",e),e=e.replace(o[a.COMPARATORTRIM],"$1$2$3"),n("comparator trim",e,o[a.COMPARATORTRIM]),e=(e=(e=e.replace(o[a.TILDETRIM],"$1~")).replace(o[a.CARETTRIM],"$1^")).split(/\s+/).join(" ");var r=t?o[a.COMPARATORLOOSE]:o[a.COMPARATOR],s=e.split(" ").map((function(e){return function(e,t){return n("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){n("caret",e,t);var i=t.loose?o[a.CARETLOOSE]:o[a.CARET];return e.replace(i,(function(t,i,r,o,s){var a;return n("caret",e,t,i,r,o,s),x(i)?a="":x(r)?a=">="+i+".0.0 <"+(+i+1)+".0.0":x(o)?a="0"===i?">="+i+"."+r+".0 <"+i+"."+(+r+1)+".0":">="+i+"."+r+".0 <"+(+i+1)+".0.0":s?(n("replaceCaret pr",s),a="0"===i?"0"===r?">="+i+"."+r+"."+o+"-"+s+" <"+i+"."+r+"."+(+o+1):">="+i+"."+r+"."+o+"-"+s+" <"+i+"."+(+r+1)+".0":">="+i+"."+r+"."+o+"-"+s+" <"+(+i+1)+".0.0"):(n("no pr"),a="0"===i?"0"===r?">="+i+"."+r+"."+o+" <"+i+"."+r+"."+(+o+1):">="+i+"."+r+"."+o+" <"+i+"."+(+r+1)+".0":">="+i+"."+r+"."+o+" <"+(+i+1)+".0.0"),n("caret return",a),a}))}(e,t)})).join(" ")}(e,t),n("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var i=t.loose?o[a.TILDELOOSE]:o[a.TILDE];return e.replace(i,(function(t,i,r,o,s){var a;return n("tilde",e,t,i,r,o,s),x(i)?a="":x(r)?a=">="+i+".0.0 <"+(+i+1)+".0.0":x(o)?a=">="+i+"."+r+".0 <"+i+"."+(+r+1)+".0":s?(n("replaceTilde pr",s),a=">="+i+"."+r+"."+o+"-"+s+" <"+i+"."+(+r+1)+".0"):a=">="+i+"."+r+"."+o+" <"+i+"."+(+r+1)+".0",n("tilde return",a),a}))}(e,t)})).join(" ")}(e,t),n("tildes",e),e=function(e,t){return n("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var i=t.loose?o[a.XRANGELOOSE]:o[a.XRANGE];return e.replace(i,(function(i,r,o,s,a,c){n("xRange",e,i,r,o,s,a,c);var l=x(o),u=l||x(s),d=u||x(a),h=d;return"="===r&&h&&(r=""),c=t.includePrerelease?"-0":"",l?i=">"===r||"<"===r?"<0.0.0-0":"*":r&&h?(u&&(s=0),a=0,">"===r?(r=">=",u?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):"<="===r&&(r="<",u?o=+o+1:s=+s+1),i=r+o+"."+s+"."+a+c):u?i=">="+o+".0.0"+c+" <"+(+o+1)+".0.0"+c:d&&(i=">="+o+"."+s+".0"+c+" <"+o+"."+(+s+1)+".0"+c),n("xRange return",i),i}))}(e,t)})).join(" ")}(e,t),n("xrange",e),e=function(e,t){return n("replaceStars",e,t),e.trim().replace(o[a.STAR],"")}(e,t),n("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(s=s.filter((function(e){return!!e.match(r)}))),s=s.map((function(e){return new _(e,this.options)}),this)},T.prototype.intersects=function(e,t){if(!(e instanceof T))throw new TypeError("a Range is required");return this.set.some((function(n){return D(n,t)&&e.set.some((function(e){return D(e,t)&&n.every((function(n){return e.every((function(e){return n.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new T(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},T.prototype.test=function(e){if(!e)return!1;if("string"==typeof e)try{e=new h(e,this.options)}catch(e){return!1}for(var t=0;t<this.set.length;t++)if(k(this.set[t],e,this.options))return!0;return!1},t.satisfies=P,t.maxSatisfying=function(e,t,n){var i=null,r=null;try{var o=new T(t,n)}catch(e){return null}return e.forEach((function(e){o.test(e)&&(i&&-1!==r.compare(e)||(r=new h(i=e,n)))})),i},t.minSatisfying=function(e,t,n){var i=null,r=null;try{var o=new T(t,n)}catch(e){return null}return e.forEach((function(e){o.test(e)&&(i&&1!==r.compare(e)||(r=new h(i=e,n)))})),i},t.minVersion=function(e,t){e=new T(e,t);var n=new h("0.0.0");if(e.test(n))return n;if(n=new h("0.0.0-0"),e.test(n))return n;n=null;for(var i=0;i<e.set.length;++i){e.set[i].forEach((function(e){var t=new h(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":n&&!m(n,t)||(n=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}))}if(n&&e.test(n))return n;return null},t.validRange=function(e,t){try{return new T(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,n){return O(e,t,"<",n)},t.gtr=function(e,t,n){return O(e,t,">",n)},t.outside=O,t.prerelease=function(e,t){var n=d(e,t);return n&&n.prerelease.length?n.prerelease:null},t.intersects=function(e,t,n){return e=new T(e,n),t=new T(t,n),e.intersects(t)},t.coerce=function(e,t){if(e instanceof h)return e;"number"==typeof e&&(e=String(e));if("string"!=typeof e)return null;var n=null;if((t=t||{}).rtl){for(var i;(i=o[a.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&i.index+i[0].length===n.index+n[0].length||(n=i),o[a.COERCERTL].lastIndex=i.index+i[1].length+i[2].length;o[a.COERCERTL].lastIndex=-1}else n=e.match(o[a.COERCE]);if(null===n)return null;return d(n[2]+"."+(n[3]||"0")+"."+(n[4]||"0"),t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(4);var r;!function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.serverErrorStart=-32099,e.serverErrorEnd=-32e3,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.RequestCancelled=-32800,e.ContentModified=-32801,e.MessageWriteError=1,e.MessageReadError=2}(r=t.ErrorCodes||(t.ErrorCodes={}));class o extends Error{constructor(e,t,n){super(t),this.code=i.number(e)?e:r.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,o.prototype)}toJson(){return{code:this.code,message:this.message,data:this.data}}}t.ResponseError=o;class s{constructor(e,t){this._method=e,this._numberOfParams=t}get method(){return this._method}get numberOfParams(){return this._numberOfParams}}t.AbstractMessageType=s;t.RequestType0=class extends s{constructor(e){super(e,0),this._=void 0}};t.RequestType=class extends s{constructor(e){super(e,1),this._=void 0}};t.RequestType1=class extends s{constructor(e){super(e,1),this._=void 0}};t.RequestType2=class extends s{constructor(e){super(e,2),this._=void 0}};t.RequestType3=class extends s{constructor(e){super(e,3),this._=void 0}};t.RequestType4=class extends s{constructor(e){super(e,4),this._=void 0}};t.RequestType5=class extends s{constructor(e){super(e,5),this._=void 0}};t.RequestType6=class extends s{constructor(e){super(e,6),this._=void 0}};t.RequestType7=class extends s{constructor(e){super(e,7),this._=void 0}};t.RequestType8=class extends s{constructor(e){super(e,8),this._=void 0}};t.RequestType9=class extends s{constructor(e){super(e,9),this._=void 0}};t.NotificationType=class extends s{constructor(e){super(e,1),this._=void 0}};t.NotificationType0=class extends s{constructor(e){super(e,0),this._=void 0}};t.NotificationType1=class extends s{constructor(e){super(e,1),this._=void 0}};t.NotificationType2=class extends s{constructor(e){super(e,2),this._=void 0}};t.NotificationType3=class extends s{constructor(e){super(e,3),this._=void 0}};t.NotificationType4=class extends s{constructor(e){super(e,4),this._=void 0}};t.NotificationType5=class extends s{constructor(e){super(e,5),this._=void 0}};t.NotificationType6=class extends s{constructor(e){super(e,6),this._=void 0}};t.NotificationType7=class extends s{constructor(e){super(e,7),this._=void 0}};t.NotificationType8=class extends s{constructor(e){super(e,8),this._=void 0}};t.NotificationType9=class extends s{constructor(e){super(e,9),this._=void 0}},t.isRequestMessage=function(e){let t=e;return t&&i.string(t.method)&&(i.string(t.id)||i.number(t.id))},t.isNotificationMessage=function(e){let t=e;return t&&i.string(t.method)&&void 0===e.id},t.isResponseMessage=function(e){let t=e;return t&&(void 0!==t.result||!!t.error)&&(i.string(t.id)||i.number(t.id)||null===t.id)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(7),r=n(4);var o;!function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:i.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:i.Event.None}),e.is=function(t){let n=t;return n&&(n===e.None||n===e.Cancelled||r.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}}(o=t.CancellationToken||(t.CancellationToken={}));const s=Object.freeze((function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}));class a{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?s:(this._emitter||(this._emitter=new i.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}t.CancellationTokenSource=class{get token(){return this._token||(this._token=new a),this._token}cancel(){this._token?this._token.cancel():this._token=o.Cancelled}dispose(){this._token?this._token instanceof a&&this._token.dispose():this._token=o.None}}},function(e,t,n){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.None=0,e.First=1,e.Last=2}(i=t.Touch||(t.Touch={}));t.LinkedMap=class{constructor(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}has(e){return this._map.has(e)}get(e){const t=this._map.get(e);if(t)return t.value}set(e,t,n=i.None){let r=this._map.get(e);if(r)r.value=t,n!==i.None&&this.touch(r,n);else{switch(r={key:e,value:t,next:void 0,previous:void 0},n){case i.None:this.addItemLast(r);break;case i.First:this.addItemFirst(r);break;case i.Last:default:this.addItemLast(r)}this._map.set(e,r),this._size++}}delete(e){const t=this._map.get(e);return!!t&&(this._map.delete(e),this.removeItem(t),this._size--,!0)}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let n=this._head;for(;n;)t?e.bind(t)(n.value,n.key,this):e(n.value,n.key,this),n=n.next}forEachReverse(e,t){let n=this._tail;for(;n;)t?e.bind(t)(n.value,n.key,this):e(n.value,n.key,this),n=n.previous}values(){let e=[],t=this._head;for(;t;)e.push(t.value),t=t.next;return e}keys(){let e=[],t=this._head;for(;t;)e.push(t.key),t=t.next;return e}addItemFirst(e){if(this._head||this._tail){if(!this._head)throw new Error("Invalid list");e.next=this._head,this._head.previous=e}else this._tail=e;this._head=e}addItemLast(e){if(this._head||this._tail){if(!this._tail)throw new Error("Invalid list");e.previous=this._tail,this._tail.next=e}else this._head=e;this._tail=e}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head)this._head=e.next;else if(e===this._tail)this._tail=e.previous;else{const t=e.next,n=e.previous;if(!t||!n)throw new Error("Invalid list");t.previous=n,n.next=t}}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(t===i.First||t===i.Last)if(t===i.First){if(e===this._head)return;const t=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(t.previous=n,n.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e}else if(t===i.Last){if(e===this._tail)return;const t=e.next,n=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=n,n.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(6),r=n(27),o=n(28),s=n(12),a=n(9),c=n(10);t.generateRandomPipeName=function(){const e=o.randomBytes(21).toString("hex");return"win32"===process.platform?`\\\\.\\pipe\\vscode-jsonrpc-${e}-sock`:i.join(r.tmpdir(),`vscode-${e}.sock`)},t.createClientPipeTransport=function(e,t="utf-8"){let n,i=new Promise((e,t)=>{n=e});return new Promise((r,o)=>{let l=s.createServer(e=>{l.close(),n([new a.SocketMessageReader(e,t),new c.SocketMessageWriter(e,t)])});l.on("error",o),l.listen(e,()=>{l.removeListener("error",o),r({onConnected:()=>i})})})},t.createServerPipeTransport=function(e,t="utf-8"){const n=s.createConnection(e);return[new a.SocketMessageReader(n,t),new c.SocketMessageWriter(n,t)]}},function(e,t){e.exports=require("os")},function(e,t){e.exports=require("crypto")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(12),r=n(9),o=n(10);t.createClientSocketTransport=function(e,t="utf-8"){let n,s=new Promise((e,t)=>{n=e});return new Promise((a,c)=>{let l=i.createServer(e=>{l.close(),n([new r.SocketMessageReader(e,t),new o.SocketMessageWriter(e,t)])});l.on("error",c),l.listen(e,"127.0.0.1",()=>{l.removeListener("error",c),a({onConnected:()=>s})})})},t.createServerSocketTransport=function(e,t="utf-8"){const n=i.createConnection(e,"127.0.0.1");return[new r.SocketMessageReader(n,t),new o.SocketMessageWriter(n,t)]}},function(e,t,n){"use strict";var i,r,o,s,a,c,l,u,d,h,p,g,f,m,v,y,C,w,R,S;n.r(t),n.d(t,"Position",(function(){return i})),n.d(t,"Range",(function(){return r})),n.d(t,"Location",(function(){return o})),n.d(t,"LocationLink",(function(){return s})),n.d(t,"Color",(function(){return a})),n.d(t,"ColorInformation",(function(){return c})),n.d(t,"ColorPresentation",(function(){return l})),n.d(t,"FoldingRangeKind",(function(){return u})),n.d(t,"FoldingRange",(function(){return d})),n.d(t,"DiagnosticRelatedInformation",(function(){return h})),n.d(t,"DiagnosticSeverity",(function(){return p})),n.d(t,"DiagnosticTag",(function(){return g})),n.d(t,"Diagnostic",(function(){return f})),n.d(t,"Command",(function(){return m})),n.d(t,"TextEdit",(function(){return v})),n.d(t,"TextDocumentEdit",(function(){return y})),n.d(t,"CreateFile",(function(){return C})),n.d(t,"RenameFile",(function(){return w})),n.d(t,"DeleteFile",(function(){return R})),n.d(t,"WorkspaceEdit",(function(){return S})),n.d(t,"WorkspaceChange",(function(){return Y})),n.d(t,"TextDocumentIdentifier",(function(){return _})),n.d(t,"VersionedTextDocumentIdentifier",(function(){return E})),n.d(t,"TextDocumentItem",(function(){return T})),n.d(t,"MarkupKind",(function(){return D})),n.d(t,"MarkupContent",(function(){return x})),n.d(t,"CompletionItemKind",(function(){return b})),n.d(t,"InsertTextFormat",(function(){return k})),n.d(t,"CompletionItemTag",(function(){return P})),n.d(t,"CompletionItem",(function(){return O})),n.d(t,"CompletionList",(function(){return I})),n.d(t,"MarkedString",(function(){return F})),n.d(t,"Hover",(function(){return N})),n.d(t,"ParameterInformation",(function(){return q})),n.d(t,"SignatureInformation",(function(){return L})),n.d(t,"DocumentHighlightKind",(function(){return M})),n.d(t,"DocumentHighlight",(function(){return A})),n.d(t,"SymbolKind",(function(){return j})),n.d(t,"SymbolTag",(function(){return K})),n.d(t,"SymbolInformation",(function(){return H})),n.d(t,"DocumentSymbol",(function(){return W})),n.d(t,"CodeActionKind",(function(){return U})),n.d(t,"CodeActionContext",(function(){return $})),n.d(t,"CodeAction",(function(){return z})),n.d(t,"CodeLens",(function(){return G})),n.d(t,"FormattingOptions",(function(){return V})),n.d(t,"DocumentLink",(function(){return B})),n.d(t,"SelectionRange",(function(){return X})),n.d(t,"EOL",(function(){return Z})),n.d(t,"TextDocument",(function(){return Q})),function(e){e.create=function(e,t){return{line:e,character:t}},e.is=function(e){var t=e;return ee.objectLiteral(t)&&ee.number(t.line)&&ee.number(t.character)}}(i||(i={})),function(e){e.create=function(e,t,n,r){if(ee.number(e)&&ee.number(t)&&ee.number(n)&&ee.number(r))return{start:i.create(e,t),end:i.create(n,r)};if(i.is(e)&&i.is(t))return{start:e,end:t};throw new Error("Range#create called with invalid arguments["+e+", "+t+", "+n+", "+r+"]")},e.is=function(e){var t=e;return ee.objectLiteral(t)&&i.is(t.start)&&i.is(t.end)}}(r||(r={})),function(e){e.create=function(e,t){return{uri:e,range:t}},e.is=function(e){var t=e;return ee.defined(t)&&r.is(t.range)&&(ee.string(t.uri)||ee.undefined(t.uri))}}(o||(o={})),function(e){e.create=function(e,t,n,i){return{targetUri:e,targetRange:t,targetSelectionRange:n,originSelectionRange:i}},e.is=function(e){var t=e;return ee.defined(t)&&r.is(t.targetRange)&&ee.string(t.targetUri)&&(r.is(t.targetSelectionRange)||ee.undefined(t.targetSelectionRange))&&(r.is(t.originSelectionRange)||ee.undefined(t.originSelectionRange))}}(s||(s={})),function(e){e.create=function(e,t,n,i){return{red:e,green:t,blue:n,alpha:i}},e.is=function(e){var t=e;return ee.number(t.red)&&ee.number(t.green)&&ee.number(t.blue)&&ee.number(t.alpha)}}(a||(a={})),function(e){e.create=function(e,t){return{range:e,color:t}},e.is=function(e){var t=e;return r.is(t.range)&&a.is(t.color)}}(c||(c={})),function(e){e.create=function(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}},e.is=function(e){var t=e;return ee.string(t.label)&&(ee.undefined(t.textEdit)||v.is(t))&&(ee.undefined(t.additionalTextEdits)||ee.typedArray(t.additionalTextEdits,v.is))}}(l||(l={})),function(e){e.Comment="comment",e.Imports="imports",e.Region="region"}(u||(u={})),function(e){e.create=function(e,t,n,i,r){var o={startLine:e,endLine:t};return ee.defined(n)&&(o.startCharacter=n),ee.defined(i)&&(o.endCharacter=i),ee.defined(r)&&(o.kind=r),o},e.is=function(e){var t=e;return ee.number(t.startLine)&&ee.number(t.startLine)&&(ee.undefined(t.startCharacter)||ee.number(t.startCharacter))&&(ee.undefined(t.endCharacter)||ee.number(t.endCharacter))&&(ee.undefined(t.kind)||ee.string(t.kind))}}(d||(d={})),function(e){e.create=function(e,t){return{location:e,message:t}},e.is=function(e){var t=e;return ee.defined(t)&&o.is(t.location)&&ee.string(t.message)}}(h||(h={})),function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4}(p||(p={})),function(e){e.Unnecessary=1,e.Deprecated=2}(g||(g={})),function(e){e.create=function(e,t,n,i,r,o){var s={range:e,message:t};return ee.defined(n)&&(s.severity=n),ee.defined(i)&&(s.code=i),ee.defined(r)&&(s.source=r),ee.defined(o)&&(s.relatedInformation=o),s},e.is=function(e){var t=e;return ee.defined(t)&&r.is(t.range)&&ee.string(t.message)&&(ee.number(t.severity)||ee.undefined(t.severity))&&(ee.number(t.code)||ee.string(t.code)||ee.undefined(t.code))&&(ee.string(t.source)||ee.undefined(t.source))&&(ee.undefined(t.relatedInformation)||ee.typedArray(t.relatedInformation,h.is))}}(f||(f={})),function(e){e.create=function(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];var r={title:e,command:t};return ee.defined(n)&&n.length>0&&(r.arguments=n),r},e.is=function(e){var t=e;return ee.defined(t)&&ee.string(t.title)&&ee.string(t.command)}}(m||(m={})),function(e){e.replace=function(e,t){return{range:e,newText:t}},e.insert=function(e,t){return{range:{start:e,end:e},newText:t}},e.del=function(e){return{range:e,newText:""}},e.is=function(e){var t=e;return ee.objectLiteral(t)&&ee.string(t.newText)&&r.is(t.range)}}(v||(v={})),function(e){e.create=function(e,t){return{textDocument:e,edits:t}},e.is=function(e){var t=e;return ee.defined(t)&&E.is(t.textDocument)&&Array.isArray(t.edits)}}(y||(y={})),function(e){e.create=function(e,t){var n={kind:"create",uri:e};return void 0===t||void 0===t.overwrite&&void 0===t.ignoreIfExists||(n.options=t),n},e.is=function(e){var t=e;return t&&"create"===t.kind&&ee.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||ee.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||ee.boolean(t.options.ignoreIfExists)))}}(C||(C={})),function(e){e.create=function(e,t,n){var i={kind:"rename",oldUri:e,newUri:t};return void 0===n||void 0===n.overwrite&&void 0===n.ignoreIfExists||(i.options=n),i},e.is=function(e){var t=e;return t&&"rename"===t.kind&&ee.string(t.oldUri)&&ee.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||ee.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||ee.boolean(t.options.ignoreIfExists)))}}(w||(w={})),function(e){e.create=function(e,t){var n={kind:"delete",uri:e};return void 0===t||void 0===t.recursive&&void 0===t.ignoreIfNotExists||(n.options=t),n},e.is=function(e){var t=e;return t&&"delete"===t.kind&&ee.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||ee.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||ee.boolean(t.options.ignoreIfNotExists)))}}(R||(R={})),function(e){e.is=function(e){var t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||t.documentChanges.every((function(e){return ee.string(e.kind)?C.is(e)||w.is(e)||R.is(e):y.is(e)})))}}(S||(S={}));var _,E,T,D,x,b,k,P,O,I,F,N,q,L,M,A,j,K,H,W,U,$,z,G,V,B,X,J=function(){function e(e){this.edits=e}return e.prototype.insert=function(e,t){this.edits.push(v.insert(e,t))},e.prototype.replace=function(e,t){this.edits.push(v.replace(e,t))},e.prototype.delete=function(e){this.edits.push(v.del(e))},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e}(),Y=function(){function e(e){var t=this;this._textEditChanges=Object.create(null),e&&(this._workspaceEdit=e,e.documentChanges?e.documentChanges.forEach((function(e){if(y.is(e)){var n=new J(e.edits);t._textEditChanges[e.textDocument.uri]=n}})):e.changes&&Object.keys(e.changes).forEach((function(n){var i=new J(e.changes[n]);t._textEditChanges[n]=i})))}return Object.defineProperty(e.prototype,"edit",{get:function(){return this._workspaceEdit},enumerable:!0,configurable:!0}),e.prototype.getTextEditChange=function(e){if(E.is(e)){if(this._workspaceEdit||(this._workspaceEdit={documentChanges:[]}),!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var t=e;if(!(i=this._textEditChanges[t.uri])){var n={textDocument:t,edits:r=[]};this._workspaceEdit.documentChanges.push(n),i=new J(r),this._textEditChanges[t.uri]=i}return i}if(this._workspaceEdit||(this._workspaceEdit={changes:Object.create(null)}),!this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");var i;if(!(i=this._textEditChanges[e])){var r=[];this._workspaceEdit.changes[e]=r,i=new J(r),this._textEditChanges[e]=i}return i},e.prototype.createFile=function(e,t){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(C.create(e,t))},e.prototype.renameFile=function(e,t,n){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(w.create(e,t,n))},e.prototype.deleteFile=function(e,t){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(R.create(e,t))},e.prototype.checkDocumentChanges=function(){if(!this._workspaceEdit||!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.")},e}();!function(e){e.create=function(e){return{uri:e}},e.is=function(e){var t=e;return ee.defined(t)&&ee.string(t.uri)}}(_||(_={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return ee.defined(t)&&ee.string(t.uri)&&(null===t.version||ee.number(t.version))}}(E||(E={})),function(e){e.create=function(e,t,n,i){return{uri:e,languageId:t,version:n,text:i}},e.is=function(e){var t=e;return ee.defined(t)&&ee.string(t.uri)&&ee.string(t.languageId)&&ee.number(t.version)&&ee.string(t.text)}}(T||(T={})),function(e){e.PlainText="plaintext",e.Markdown="markdown"}(D||(D={})),function(e){e.is=function(t){var n=t;return n===e.PlainText||n===e.Markdown}}(D||(D={})),function(e){e.is=function(e){var t=e;return ee.objectLiteral(e)&&D.is(t.kind)&&ee.string(t.value)}}(x||(x={})),function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}(b||(b={})),function(e){e.PlainText=1,e.Snippet=2}(k||(k={})),function(e){e.Deprecated=1}(P||(P={})),function(e){e.create=function(e){return{label:e}}}(O||(O={})),function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}}(I||(I={})),function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},e.is=function(e){var t=e;return ee.string(t)||ee.objectLiteral(t)&&ee.string(t.language)&&ee.string(t.value)}}(F||(F={})),function(e){e.is=function(e){var t=e;return!!t&&ee.objectLiteral(t)&&(x.is(t.contents)||F.is(t.contents)||ee.typedArray(t.contents,F.is))&&(void 0===e.range||r.is(e.range))}}(N||(N={})),function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}}(q||(q={})),function(e){e.create=function(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];var r={label:e};return ee.defined(t)&&(r.documentation=t),ee.defined(n)?r.parameters=n:r.parameters=[],r}}(L||(L={})),function(e){e.Text=1,e.Read=2,e.Write=3}(M||(M={})),function(e){e.create=function(e,t){var n={range:e};return ee.number(t)&&(n.kind=t),n}}(A||(A={})),function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26}(j||(j={})),function(e){e.Deprecated=1}(K||(K={})),function(e){e.create=function(e,t,n,i,r){var o={name:e,kind:t,location:{uri:i,range:n}};return r&&(o.containerName=r),o}}(H||(H={})),function(e){e.create=function(e,t,n,i,r,o){var s={name:e,detail:t,kind:n,range:i,selectionRange:r};return void 0!==o&&(s.children=o),s},e.is=function(e){var t=e;return t&&ee.string(t.name)&&ee.number(t.kind)&&r.is(t.range)&&r.is(t.selectionRange)&&(void 0===t.detail||ee.string(t.detail))&&(void 0===t.deprecated||ee.boolean(t.deprecated))&&(void 0===t.children||Array.isArray(t.children))}}(W||(W={})),function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"}(U||(U={})),function(e){e.create=function(e,t){var n={diagnostics:e};return null!=t&&(n.only=t),n},e.is=function(e){var t=e;return ee.defined(t)&&ee.typedArray(t.diagnostics,f.is)&&(void 0===t.only||ee.typedArray(t.only,ee.string))}}($||($={})),function(e){e.create=function(e,t,n){var i={title:e};return m.is(t)?i.command=t:i.edit=t,void 0!==n&&(i.kind=n),i},e.is=function(e){var t=e;return t&&ee.string(t.title)&&(void 0===t.diagnostics||ee.typedArray(t.diagnostics,f.is))&&(void 0===t.kind||ee.string(t.kind))&&(void 0!==t.edit||void 0!==t.command)&&(void 0===t.command||m.is(t.command))&&(void 0===t.isPreferred||ee.boolean(t.isPreferred))&&(void 0===t.edit||S.is(t.edit))}}(z||(z={})),function(e){e.create=function(e,t){var n={range:e};return ee.defined(t)&&(n.data=t),n},e.is=function(e){var t=e;return ee.defined(t)&&r.is(t.range)&&(ee.undefined(t.command)||m.is(t.command))}}(G||(G={})),function(e){e.create=function(e,t){return{tabSize:e,insertSpaces:t}},e.is=function(e){var t=e;return ee.defined(t)&&ee.number(t.tabSize)&&ee.boolean(t.insertSpaces)}}(V||(V={})),function(e){e.create=function(e,t,n){return{range:e,target:t,data:n}},e.is=function(e){var t=e;return ee.defined(t)&&r.is(t.range)&&(ee.undefined(t.target)||ee.string(t.target))}}(B||(B={})),function(e){e.create=function(e,t){return{range:e,parent:t}},e.is=function(t){var n=t;return void 0!==n&&r.is(n.range)&&(void 0===n.parent||e.is(n.parent))}}(X||(X={}));var Q,Z=["\n","\r\n","\r"];!function(e){e.create=function(e,t,n,i){return new te(e,t,n,i)},e.is=function(e){var t=e;return!!(ee.defined(t)&&ee.string(t.uri)&&(ee.undefined(t.languageId)||ee.string(t.languageId))&&ee.number(t.lineCount)&&ee.func(t.getText)&&ee.func(t.positionAt)&&ee.func(t.offsetAt))},e.applyEdits=function(e,t){for(var n=e.getText(),i=function e(t,n){if(t.length<=1)return t;var i=t.length/2|0,r=t.slice(0,i),o=t.slice(i);e(r,n),e(o,n);var s=0,a=0,c=0;for(;s<r.length&&a<o.length;){var l=n(r[s],o[a]);t[c++]=l<=0?r[s++]:o[a++]}for(;s<r.length;)t[c++]=r[s++];for(;a<o.length;)t[c++]=o[a++];return t}(t,(function(e,t){var n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n})),r=n.length,o=i.length-1;o>=0;o--){var s=i[o],a=e.offsetAt(s.range.start),c=e.offsetAt(s.range.end);if(!(c<=r))throw new Error("Overlapping edit");n=n.substring(0,a)+s.newText+n.substring(c,n.length),r=a}return n}}(Q||(Q={}));var ee,te=function(){function e(e,t,n,i){this._uri=e,this._languageId=t,this._version=n,this._content=i,this._lineOffsets=void 0}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!0,configurable:!0}),e.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content},e.prototype.update=function(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0},e.prototype.getLineOffsets=function(){if(void 0===this._lineOffsets){for(var e=[],t=this._content,n=!0,i=0;i<t.length;i++){n&&(e.push(i),n=!1);var r=t.charAt(i);n="\r"===r||"\n"===r,"\r"===r&&i+1<t.length&&"\n"===t.charAt(i+1)&&i++}n&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return i.create(0,e);for(;n<r;){var o=Math.floor((n+r)/2);t[o]>e?r=o:n=o+1}var s=n-1;return i.create(s,e-t[s])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],i=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,i),n)},Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!0,configurable:!0}),e}();!function(e){var t=Object.prototype.toString;e.defined=function(e){return void 0!==e},e.undefined=function(e){return void 0===e},e.boolean=function(e){return!0===e||!1===e},e.string=function(e){return"[object String]"===t.call(e)},e.number=function(e){return"[object Number]"===t.call(e)},e.func=function(e){return"[object Function]"===t.call(e)},e.objectLiteral=function(e){return null!==e&&"object"==typeof e},e.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)}}(ee||(ee={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(32),r=n(2),o=n(33);t.ImplementationRequest=o.ImplementationRequest;const s=n(34);t.TypeDefinitionRequest=s.TypeDefinitionRequest;const a=n(35);t.WorkspaceFoldersRequest=a.WorkspaceFoldersRequest,t.DidChangeWorkspaceFoldersNotification=a.DidChangeWorkspaceFoldersNotification;const c=n(36);t.ConfigurationRequest=c.ConfigurationRequest;const l=n(37);t.DocumentColorRequest=l.DocumentColorRequest,t.ColorPresentationRequest=l.ColorPresentationRequest;const u=n(38);t.FoldingRangeRequest=u.FoldingRangeRequest;const d=n(39);t.DeclarationRequest=d.DeclarationRequest;const h=n(40);t.SelectionRangeRequest=h.SelectionRangeRequest;const p=n(41);var g,f;t.WorkDoneProgress=p.WorkDoneProgress,t.WorkDoneProgressCreateRequest=p.WorkDoneProgressCreateRequest,t.WorkDoneProgressCancelNotification=p.WorkDoneProgressCancelNotification,function(e){e.is=function(e){const t=e;return i.string(t.language)||i.string(t.scheme)||i.string(t.pattern)}}(g=t.DocumentFilter||(t.DocumentFilter={})),function(e){e.is=function(e){if(!Array.isArray(e))return!1;for(let t of e)if(!i.string(t)&&!g.is(t))return!1;return!0}}(f=t.DocumentSelector||(t.DocumentSelector={})),function(e){e.type=new r.RequestType("client/registerCapability")}(t.RegistrationRequest||(t.RegistrationRequest={})),function(e){e.type=new r.RequestType("client/unregisterCapability")}(t.UnregistrationRequest||(t.UnregistrationRequest={})),function(e){e.Create="create",e.Rename="rename",e.Delete="delete"}(t.ResourceOperationKind||(t.ResourceOperationKind={})),function(e){e.Abort="abort",e.Transactional="transactional",e.TextOnlyTransactional="textOnlyTransactional",e.Undo="undo"}(t.FailureHandlingKind||(t.FailureHandlingKind={})),function(e){e.hasId=function(e){const t=e;return t&&i.string(t.id)&&t.id.length>0}}(t.StaticRegistrationOptions||(t.StaticRegistrationOptions={})),function(e){e.is=function(e){const t=e;return t&&(null===t.documentSelector||f.is(t.documentSelector))}}(t.TextDocumentRegistrationOptions||(t.TextDocumentRegistrationOptions={})),function(e){e.is=function(e){const t=e;return i.objectLiteral(t)&&(void 0===t.workDoneProgress||i.boolean(t.workDoneProgress))},e.hasWorkDoneProgress=function(e){const t=e;return t&&i.boolean(t.workDoneProgress)}}(t.WorkDoneProgressOptions||(t.WorkDoneProgressOptions={})),function(e){e.type=new r.RequestType("initialize")}(t.InitializeRequest||(t.InitializeRequest={})),function(e){e.unknownProtocolVersion=1}(t.InitializeError||(t.InitializeError={})),function(e){e.type=new r.NotificationType("initialized")}(t.InitializedNotification||(t.InitializedNotification={})),function(e){e.type=new r.RequestType0("shutdown")}(t.ShutdownRequest||(t.ShutdownRequest={})),function(e){e.type=new r.NotificationType0("exit")}(t.ExitNotification||(t.ExitNotification={})),function(e){e.type=new r.NotificationType("workspace/didChangeConfiguration")}(t.DidChangeConfigurationNotification||(t.DidChangeConfigurationNotification={})),function(e){e.Error=1,e.Warning=2,e.Info=3,e.Log=4}(t.MessageType||(t.MessageType={})),function(e){e.type=new r.NotificationType("window/showMessage")}(t.ShowMessageNotification||(t.ShowMessageNotification={})),function(e){e.type=new r.RequestType("window/showMessageRequest")}(t.ShowMessageRequest||(t.ShowMessageRequest={})),function(e){e.type=new r.NotificationType("window/logMessage")}(t.LogMessageNotification||(t.LogMessageNotification={})),function(e){e.type=new r.NotificationType("telemetry/event")}(t.TelemetryEventNotification||(t.TelemetryEventNotification={})),function(e){e.None=0,e.Full=1,e.Incremental=2}(t.TextDocumentSyncKind||(t.TextDocumentSyncKind={})),function(e){e.method="textDocument/didOpen",e.type=new r.NotificationType(e.method)}(t.DidOpenTextDocumentNotification||(t.DidOpenTextDocumentNotification={})),function(e){e.method="textDocument/didChange",e.type=new r.NotificationType(e.method)}(t.DidChangeTextDocumentNotification||(t.DidChangeTextDocumentNotification={})),function(e){e.method="textDocument/didClose",e.type=new r.NotificationType(e.method)}(t.DidCloseTextDocumentNotification||(t.DidCloseTextDocumentNotification={})),function(e){e.method="textDocument/didSave",e.type=new r.NotificationType(e.method)}(t.DidSaveTextDocumentNotification||(t.DidSaveTextDocumentNotification={})),function(e){e.Manual=1,e.AfterDelay=2,e.FocusOut=3}(t.TextDocumentSaveReason||(t.TextDocumentSaveReason={})),function(e){e.method="textDocument/willSave",e.type=new r.NotificationType(e.method)}(t.WillSaveTextDocumentNotification||(t.WillSaveTextDocumentNotification={})),function(e){e.method="textDocument/willSaveWaitUntil",e.type=new r.RequestType(e.method)}(t.WillSaveTextDocumentWaitUntilRequest||(t.WillSaveTextDocumentWaitUntilRequest={})),function(e){e.type=new r.NotificationType("workspace/didChangeWatchedFiles")}(t.DidChangeWatchedFilesNotification||(t.DidChangeWatchedFilesNotification={})),function(e){e.Created=1,e.Changed=2,e.Deleted=3}(t.FileChangeType||(t.FileChangeType={})),function(e){e.Create=1,e.Change=2,e.Delete=4}(t.WatchKind||(t.WatchKind={})),function(e){e.type=new r.NotificationType("textDocument/publishDiagnostics")}(t.PublishDiagnosticsNotification||(t.PublishDiagnosticsNotification={})),function(e){e.Invoked=1,e.TriggerCharacter=2,e.TriggerForIncompleteCompletions=3}(t.CompletionTriggerKind||(t.CompletionTriggerKind={})),function(e){e.method="textDocument/completion",e.type=new r.RequestType(e.method),e.resultType=new r.ProgressType}(t.CompletionRequest||(t.CompletionRequest={})),function(e){e.method="completionItem/resolve",e.type=new r.RequestType(e.method)}(t.CompletionResolveRequest||(t.CompletionResolveRequest={})),function(e){e.method="textDocument/hover",e.type=new r.RequestType(e.method)}(t.HoverRequest||(t.HoverRequest={})),function(e){e.Invoked=1,e.TriggerCharacter=2,e.ContentChange=3}(t.SignatureHelpTriggerKind||(t.SignatureHelpTriggerKind={})),function(e){e.method="textDocument/signatureHelp",e.type=new r.RequestType(e.method)}(t.SignatureHelpRequest||(t.SignatureHelpRequest={})),function(e){e.method="textDocument/definition",e.type=new r.RequestType(e.method),e.resultType=new r.ProgressType}(t.DefinitionRequest||(t.DefinitionRequest={})),function(e){e.method="textDocument/references",e.type=new r.RequestType(e.method),e.resultType=new r.ProgressType}(t.ReferencesRequest||(t.ReferencesRequest={})),function(e){e.method="textDocument/documentHighlight",e.type=new r.RequestType(e.method),e.resultType=new r.ProgressType}(t.DocumentHighlightRequest||(t.DocumentHighlightRequest={})),function(e){e.method="textDocument/documentSymbol",e.type=new r.RequestType(e.method),e.resultType=new r.ProgressType}(t.DocumentSymbolRequest||(t.DocumentSymbolRequest={})),function(e){e.method="textDocument/codeAction",e.type=new r.RequestType(e.method),e.resultType=new r.ProgressType}(t.CodeActionRequest||(t.CodeActionRequest={})),function(e){e.method="workspace/symbol",e.type=new r.RequestType(e.method),e.resultType=new r.ProgressType}(t.WorkspaceSymbolRequest||(t.WorkspaceSymbolRequest={})),function(e){e.type=new r.RequestType("textDocument/codeLens"),e.resultType=new r.ProgressType}(t.CodeLensRequest||(t.CodeLensRequest={})),function(e){e.type=new r.RequestType("codeLens/resolve")}(t.CodeLensResolveRequest||(t.CodeLensResolveRequest={})),function(e){e.method="textDocument/documentLink",e.type=new r.RequestType(e.method),e.resultType=new r.ProgressType}(t.DocumentLinkRequest||(t.DocumentLinkRequest={})),function(e){e.type=new r.RequestType("documentLink/resolve")}(t.DocumentLinkResolveRequest||(t.DocumentLinkResolveRequest={})),function(e){e.method="textDocument/formatting",e.type=new r.RequestType(e.method)}(t.DocumentFormattingRequest||(t.DocumentFormattingRequest={})),function(e){e.method="textDocument/rangeFormatting",e.type=new r.RequestType(e.method)}(t.DocumentRangeFormattingRequest||(t.DocumentRangeFormattingRequest={})),function(e){e.method="textDocument/onTypeFormatting",e.type=new r.RequestType(e.method)}(t.DocumentOnTypeFormattingRequest||(t.DocumentOnTypeFormattingRequest={})),function(e){e.method="textDocument/rename",e.type=new r.RequestType(e.method)}(t.RenameRequest||(t.RenameRequest={})),function(e){e.method="textDocument/prepareRename",e.type=new r.RequestType(e.method)}(t.PrepareRenameRequest||(t.PrepareRenameRequest={})),function(e){e.type=new r.RequestType("workspace/executeCommand")}(t.ExecuteCommandRequest||(t.ExecuteCommandRequest={})),function(e){e.type=new r.RequestType("workspace/applyEdit")}(t.ApplyWorkspaceEditRequest||(t.ApplyWorkspaceEditRequest={}))},function(e,t,n){"use strict";function i(e){return"string"==typeof e||e instanceof String}function r(e){return Array.isArray(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.boolean=function(e){return!0===e||!1===e},t.string=i,t.number=function(e){return"number"==typeof e||e instanceof Number},t.error=function(e){return e instanceof Error},t.func=function(e){return"function"==typeof e},t.array=r,t.stringArray=function(e){return r(e)&&e.every(e=>i(e))},t.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)},t.objectLiteral=function(e){return null!==e&&"object"==typeof e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(2);!function(e){e.method="textDocument/implementation",e.type=new i.RequestType(e.method),e.resultType=new i.ProgressType}(t.ImplementationRequest||(t.ImplementationRequest={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(2);!function(e){e.method="textDocument/typeDefinition",e.type=new i.RequestType(e.method),e.resultType=new i.ProgressType}(t.TypeDefinitionRequest||(t.TypeDefinitionRequest={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(2);!function(e){e.type=new i.RequestType0("workspace/workspaceFolders")}(t.WorkspaceFoldersRequest||(t.WorkspaceFoldersRequest={})),function(e){e.type=new i.NotificationType("workspace/didChangeWorkspaceFolders")}(t.DidChangeWorkspaceFoldersNotification||(t.DidChangeWorkspaceFoldersNotification={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(2);!function(e){e.type=new i.RequestType("workspace/configuration")}(t.ConfigurationRequest||(t.ConfigurationRequest={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(2);!function(e){e.method="textDocument/documentColor",e.type=new i.RequestType(e.method),e.resultType=new i.ProgressType}(t.DocumentColorRequest||(t.DocumentColorRequest={})),function(e){e.type=new i.RequestType("textDocument/colorPresentation")}(t.ColorPresentationRequest||(t.ColorPresentationRequest={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(2);!function(e){e.Comment="comment",e.Imports="imports",e.Region="region"}(t.FoldingRangeKind||(t.FoldingRangeKind={})),function(e){e.method="textDocument/foldingRange",e.type=new i.RequestType(e.method),e.resultType=new i.ProgressType}(t.FoldingRangeRequest||(t.FoldingRangeRequest={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(2);!function(e){e.method="textDocument/declaration",e.type=new i.RequestType(e.method),e.resultType=new i.ProgressType}(t.DeclarationRequest||(t.DeclarationRequest={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(2);!function(e){e.method="textDocument/selectionRange",e.type=new i.RequestType(e.method),e.resultType=new i.ProgressType}(t.SelectionRangeRequest||(t.SelectionRangeRequest={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(2);!function(e){e.type=new i.ProgressType}(t.WorkDoneProgress||(t.WorkDoneProgress={})),function(e){e.type=new i.RequestType("window/workDoneProgress/create")}(t.WorkDoneProgressCreateRequest||(t.WorkDoneProgressCreateRequest={})),function(e){e.type=new i.NotificationType("window/workDoneProgress/cancel")}(t.WorkDoneProgressCancelNotification||(t.WorkDoneProgressCancelNotification={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(0),r=n(1),o=n(5),s=n(14),a=n(15),c=n(16);t.createConverter=function(e){const t=e||(e=>e.toString());function n(e){return t(e)}function l(e){return{uri:t(e.uri)}}function u(e){return{uri:t(e.uri),version:e.version}}function d(e){switch(e){case i.TextDocumentSaveReason.Manual:return r.TextDocumentSaveReason.Manual;case i.TextDocumentSaveReason.AfterDelay:return r.TextDocumentSaveReason.AfterDelay;case i.TextDocumentSaveReason.FocusOut:return r.TextDocumentSaveReason.FocusOut}return r.TextDocumentSaveReason.Manual}function h(e){switch(e){case i.CompletionTriggerKind.TriggerCharacter:return r.CompletionTriggerKind.TriggerCharacter;case i.CompletionTriggerKind.TriggerForIncompleteCompletions:return r.CompletionTriggerKind.TriggerForIncompleteCompletions;default:return r.CompletionTriggerKind.Invoked}}function p(e){switch(e){case i.SignatureHelpTriggerKind.Invoke:return r.SignatureHelpTriggerKind.Invoked;case i.SignatureHelpTriggerKind.TriggerCharacter:return r.SignatureHelpTriggerKind.TriggerCharacter;case i.SignatureHelpTriggerKind.ContentChange:return r.SignatureHelpTriggerKind.ContentChange}}function g(e){return{label:e.label}}function f(e){return{label:e.label,parameters:(t=e.parameters,t.map(g))};var t}function m(e){return{line:e.line,character:e.character}}function v(e){return null==e?e:{line:e.line,character:e.character}}function y(e){return null==e?e:{start:v(e.start),end:v(e.end)}}function C(e){return null==e?e:r.Location.create(n(e.uri),y(e.range))}function w(e){switch(e){case i.DiagnosticSeverity.Error:return r.DiagnosticSeverity.Error;case i.DiagnosticSeverity.Warning:return r.DiagnosticSeverity.Warning;case i.DiagnosticSeverity.Information:return r.DiagnosticSeverity.Information;case i.DiagnosticSeverity.Hint:return r.DiagnosticSeverity.Hint}}function R(e){switch(e){case i.DiagnosticTag.Unnecessary:return r.DiagnosticTag.Unnecessary;case i.DiagnosticTag.Deprecated:return r.DiagnosticTag.Deprecated;default:return}}function S(e){return{message:e.message,location:C(e.location)}}function _(e){let t=r.Diagnostic.create(y(e.range),e.message);return o.number(e.severity)&&(t.severity=w(e.severity)),(o.number(e.code)||o.string(e.code))&&(t.code=e.code),Array.isArray(e.tags)&&(t.tags=function(e){if(!e)return;let t=[];for(let n of e){let e=R(n);void 0!==e&&t.push(e)}return t.length>0?t:void 0}(e.tags)),e.relatedInformation&&(t.relatedInformation=e.relatedInformation.map(S)),e.source&&(t.source=e.source),t}function E(e){return null==e?e:e.map(_)}function T(e){switch(e){case i.CompletionItemTag.Deprecated:return r.CompletionItemTag.Deprecated}}function D(e){return{range:y(e.range),newText:e.newText}}function x(e){return e}function b(e){let t=r.Command.create(e.title,e.command);return e.arguments&&(t.arguments=e.arguments),t}return{asUri:n,asTextDocumentIdentifier:l,asVersionedTextDocumentIdentifier:u,asOpenTextDocumentParams:function(e){return{textDocument:{uri:t(e.uri),languageId:e.languageId,version:e.version,text:e.getText()}}},asChangeTextDocumentParams:function(e){if(function(e){let t=e;return!!t.uri&&!!t.version}(e)){return{textDocument:{uri:t(e.uri),version:e.version},contentChanges:[{text:e.getText()}]}}if(function(e){let t=e;return!!t.document&&!!t.contentChanges}(e)){let n=e.document;return{textDocument:{uri:t(n.uri),version:n.version},contentChanges:e.contentChanges.map(e=>{let t=e.range;return{range:{start:{line:t.start.line,character:t.start.character},end:{line:t.end.line,character:t.end.character}},rangeLength:e.rangeLength,text:e.text}})}}throw Error("Unsupported text document change parameter")},asCloseTextDocumentParams:function(e){return{textDocument:l(e)}},asSaveTextDocumentParams:function(e,t=!1){let n={textDocument:u(e)};return t&&(n.text=e.getText()),n},asWillSaveTextDocumentParams:function(e){return{textDocument:l(e.document),reason:d(e.reason)}},asTextDocumentPositionParams:function(e,t){return{textDocument:l(e),position:m(t)}},asCompletionParams:function(e,t,n){return{textDocument:l(e),position:m(t),context:{triggerKind:h(n.triggerKind),triggerCharacter:n.triggerCharacter}}},asSignatureHelpParams:function(e,t,n){return{textDocument:l(e),position:m(t),context:{isRetrigger:n.isRetrigger,triggerCharacter:n.triggerCharacter,triggerKind:p(n.triggerKind),activeSignatureHelp:(i=n.activeSignatureHelp,void 0===i?i:{signatures:(r=i.signatures,r.map(f)),activeSignature:i.activeSignature,activeParameter:i.activeParameter})}};var i,r},asWorkerPosition:m,asRange:y,asPosition:v,asPositions:function(e){let t=[];for(let n of e)t.push(v(n));return t},asLocation:C,asDiagnosticSeverity:w,asDiagnosticTag:R,asDiagnostic:_,asDiagnostics:E,asCompletionItem:function(e){let t={label:e.label},n=e instanceof s.default?e:void 0;var a,c;e.detail&&(t.detail=e.detail),e.documentation&&(n&&"$string"!==n.documentationFormat?t.documentation=function(e,t){switch(e){case"$string":return t;case r.MarkupKind.PlainText:return{kind:e,value:t};case r.MarkupKind.Markdown:return{kind:e,value:t.value};default:return`Unsupported Markup content received. Kind is: ${e}`}}(n.documentationFormat,e.documentation):t.documentation=e.documentation),e.filterText&&(t.filterText=e.filterText),function(e,t){let n=r.InsertTextFormat.PlainText,o=void 0,s=void 0;t.textEdit?(o=t.textEdit.newText,s=y(t.textEdit.range)):t.insertText instanceof i.SnippetString?(n=r.InsertTextFormat.Snippet,o=t.insertText.value):o=t.insertText;t.range&&(s=y(t.range));e.insertTextFormat=n,t.fromEdit&&void 0!==o&&void 0!==s?e.textEdit={newText:o,range:s}:e.insertText=o}(t,e),o.number(e.kind)&&(t.kind=(a=e.kind,void 0!==(c=n&&n.originalItemKind)?c:a+1)),e.sortText&&(t.sortText=e.sortText),e.additionalTextEdits&&(t.additionalTextEdits=function(e){if(null==e)return e;return e.map(D)}(e.additionalTextEdits)),e.commitCharacters&&(t.commitCharacters=e.commitCharacters.slice()),e.command&&(t.command=b(e.command)),!0!==e.preselect&&!1!==e.preselect||(t.preselect=e.preselect);const l=function(e){if(void 0===e)return e;const t=[];for(let n of e){const e=T(n);void 0!==e&&t.push(e)}return t}(e.tags);if(n&&(void 0!==n.data&&(t.data=n.data),!0===n.deprecated||!1===n.deprecated)){if(!0===n.deprecated&&void 0!==l&&l.length>0){const e=l.indexOf(i.CompletionItemTag.Deprecated);-1!==e&&l.splice(e,1)}t.deprecated=n.deprecated}return void 0!==l&&l.length>0&&(t.tags=l),t},asTextEdit:D,asSymbolKind:function(e){return e<=i.SymbolKind.TypeParameter?e+1:r.SymbolKind.Property},asSymbolTag:x,asSymbolTags:function(e){return e.map(x)},asReferenceParams:function(e,t,n){return{textDocument:l(e),position:m(t),context:{includeDeclaration:n.includeDeclaration}}},asCodeActionContext:function(e){if(null==e)return e;let t;return e.only&&o.string(e.only.value)&&(t=[e.only.value]),r.CodeActionContext.create(E(e.diagnostics),t)},asCommand:b,asCodeLens:function(e){let t=r.CodeLens.create(y(e.range));return e.command&&(t.command=b(e.command)),e instanceof a.default&&e.data&&(t.data=e.data),t},asFormattingOptions:function(e){return{tabSize:e.tabSize,insertSpaces:e.insertSpaces}},asDocumentSymbolParams:function(e){return{textDocument:l(e)}},asCodeLensParams:function(e){return{textDocument:l(e)}},asDocumentLink:function(e){let t=r.DocumentLink.create(y(e.range));e.target&&(t.target=n(e.target)),void 0!==e.tooltip&&(t.tooltip=e.tooltip);let i=e instanceof c.default?e:void 0;return i&&i.data&&(t.data=i.data),t},asDocumentLinkParams:function(e){return{textDocument:l(e)}}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(0),r=n(1),o=n(5),s=n(14),a=n(15),c=n(16);var l;!function(e){e.is=function(e){let t=e;return t&&o.string(t.language)&&o.string(t.value)}}(l||(l={})),t.createConverter=function(e){const t=e||(e=>i.Uri.parse(e));function n(e){return t(e)}function u(e){return e.map(d)}function d(e){let t=new i.Diagnostic(f(e.range),e.message,m(e.severity));return(o.number(e.code)||o.string(e.code))&&(t.code=e.code),e.source&&(t.source=e.source),e.relatedInformation&&(t.relatedInformation=e.relatedInformation.map(h)),Array.isArray(e.tags)&&(t.tags=function(e){if(!e)return;let t=[];for(let n of e){let e=p(n);void 0!==e&&t.push(e)}return t.length>0?t:void 0}(e.tags)),t}function h(e){return new i.DiagnosticRelatedInformation(D(e.location),e.message)}function p(e){switch(e){case r.DiagnosticTag.Unnecessary:return i.DiagnosticTag.Unnecessary;case r.DiagnosticTag.Deprecated:return i.DiagnosticTag.Deprecated;default:return}}function g(e){if(e)return new i.Position(e.line,e.character)}function f(e){if(e)return new i.Range(g(e.start),g(e.end))}function m(e){if(null==e)return i.DiagnosticSeverity.Error;switch(e){case r.DiagnosticSeverity.Error:return i.DiagnosticSeverity.Error;case r.DiagnosticSeverity.Warning:return i.DiagnosticSeverity.Warning;case r.DiagnosticSeverity.Information:return i.DiagnosticSeverity.Information;case r.DiagnosticSeverity.Hint:return i.DiagnosticSeverity.Hint}return i.DiagnosticSeverity.Error}function v(e){if(o.string(e))return e;switch(e.kind){case r.MarkupKind.Markdown:return new i.MarkdownString(e.value);case r.MarkupKind.PlainText:return e.value;default:return`Unsupported Markup content received. Kind is: ${e.kind}`}}function y(e){switch(e){case r.CompletionItemTag.Deprecated:return i.CompletionItemTag.Deprecated}}function C(e){let t=function(e){if(null==e)return[];const t=[];for(let n of e){const e=y(n);void 0!==e&&t.push(e)}return t}(e.tags),n=new s.default(e.label);e.detail&&(n.detail=e.detail),e.documentation&&(n.documentation=v(e.documentation),n.documentationFormat=o.string(e.documentation)?"$string":e.documentation.kind),e.filterText&&(n.filterText=e.filterText);let a=function(e){return e.textEdit?e.insertTextFormat===r.InsertTextFormat.Snippet?{text:new i.SnippetString(e.textEdit.newText),range:f(e.textEdit.range),fromEdit:!0}:{text:e.textEdit.newText,range:f(e.textEdit.range),fromEdit:!0}:e.insertText?e.insertTextFormat===r.InsertTextFormat.Snippet?{text:new i.SnippetString(e.insertText),fromEdit:!1}:{text:e.insertText,fromEdit:!1}:void 0}(e);if(a&&(n.insertText=a.text,n.range=a.range,n.fromEdit=a.fromEdit),o.number(e.kind)){let[t,o]=(c=e.kind,r.CompletionItemKind.Text<=c&&c<=r.CompletionItemKind.TypeParameter?[c-1,void 0]:[i.CompletionItemKind.Text,c]);n.kind=t,o&&(n.originalItemKind=o)}var c;return e.sortText&&(n.sortText=e.sortText),e.additionalTextEdits&&(n.additionalTextEdits=R(e.additionalTextEdits)),o.stringArray(e.commitCharacters)&&(n.commitCharacters=e.commitCharacters.slice()),e.command&&(n.command=q(e.command)),!0!==e.deprecated&&!1!==e.deprecated||(n.deprecated=e.deprecated,!0===e.deprecated&&t.push(i.CompletionItemTag.Deprecated)),!0!==e.preselect&&!1!==e.preselect||(n.preselect=e.preselect),void 0!==e.data&&(n.data=e.data),t.length>0&&(n.tags=t),n}function w(e){if(e)return new i.TextEdit(f(e.range),e.newText)}function R(e){if(e)return e.map(w)}function S(e){return e.map(_)}function _(e){let t=new i.SignatureInformation(e.label);return e.documentation&&(t.documentation=v(e.documentation)),e.parameters&&(t.parameters=E(e.parameters)),t}function E(e){return e.map(T)}function T(e){let t=new i.ParameterInformation(e.label);return e.documentation&&(t.documentation=v(e.documentation)),t}function D(e){if(e)return new i.Location(t(e.uri),f(e.range))}function x(e){if(!e)return;let n={targetUri:t(e.targetUri),targetRange:f(e.targetSelectionRange),originSelectionRange:f(e.originSelectionRange),targetSelectionRange:f(e.targetSelectionRange)};if(!n.targetSelectionRange)throw new Error("targetSelectionRange must not be undefined or null");return n}function b(e){if(e){if(o.array(e)){if(0===e.length)return[];if(r.LocationLink.is(e[0])){return e.map(e=>x(e))}return e.map(e=>D(e))}return r.LocationLink.is(e)?[x(e)]:D(e)}}function k(e){let t=new i.DocumentHighlight(f(e.range));return o.number(e.kind)&&(t.kind=P(e.kind)),t}function P(e){switch(e){case r.DocumentHighlightKind.Text:return i.DocumentHighlightKind.Text;case r.DocumentHighlightKind.Read:return i.DocumentHighlightKind.Read;case r.DocumentHighlightKind.Write:return i.DocumentHighlightKind.Write}return i.DocumentHighlightKind.Text}function O(e){return e<=r.SymbolKind.TypeParameter?e-1:i.SymbolKind.Property}function I(e){return e}function F(e,n){let r=new i.SymbolInformation(e.name,O(e.kind),f(e.location.range),e.location.uri?t(e.location.uri):n);return e.containerName&&(r.containerName=e.containerName),r}function N(e){let t=new i.DocumentSymbol(e.name,e.detail||"",O(e.kind),f(e.range),f(e.selectionRange));if(void 0!==e.children&&e.children.length>0){let n=[];for(let t of e.children)n.push(N(t));t.children=n}return t}function q(e){let t={title:e.title,command:e.command};return e.arguments&&(t.arguments=e.arguments),t}const L=new Map;function M(e){if(null==e)return;let t=L.get(e);if(t)return t;let n=e.split(".");t=i.CodeActionKind.Empty;for(let e of n)t=t.append(e);return t}function A(e){if(!e)return;let t=new a.default(f(e.range));return e.command&&(t.command=q(e.command)),void 0!==e.data&&null!==e.data&&(t.data=e.data),t}function j(e){if(!e)return;let n=new i.WorkspaceEdit;return e.documentChanges?e.documentChanges.forEach(e=>{r.CreateFile.is(e)?n.createFile(t(e.uri),e.options):r.RenameFile.is(e)?n.renameFile(t(e.oldUri),t(e.newUri),e.options):r.DeleteFile.is(e)?n.deleteFile(t(e.uri),e.options):r.TextDocumentEdit.is(e)?n.set(t(e.textDocument.uri),R(e.edits)):console.error(`Unknown workspace edit change received:\n${JSON.stringify(e,void 0,4)}`)}):e.changes&&Object.keys(e.changes).forEach(i=>{n.set(t(i),R(e.changes[i]))}),n}function K(e){let t=f(e.range),i=e.target?n(e.target):void 0,r=new c.default(t,i);return void 0!==e.tooltip&&(r.tooltip=e.tooltip),void 0!==e.data&&null!==e.data&&(r.data=e.data),r}function H(e){return new i.Color(e.red,e.green,e.blue,e.alpha)}function W(e){return new i.ColorInformation(f(e.range),H(e.color))}function U(e){let t=new i.ColorPresentation(e.label);return t.additionalTextEdits=R(e.additionalTextEdits),e.textEdit&&(t.textEdit=w(e.textEdit)),t}function $(e){if(e)switch(e){case r.FoldingRangeKind.Comment:return i.FoldingRangeKind.Comment;case r.FoldingRangeKind.Imports:return i.FoldingRangeKind.Imports;case r.FoldingRangeKind.Region:return i.FoldingRangeKind.Region}}function z(e){return new i.FoldingRange(e.startLine,e.endLine,$(e.kind))}function G(e){return new i.SelectionRange(f(e.range),e.parent?G(e.parent):void 0)}return L.set(r.CodeActionKind.Empty,i.CodeActionKind.Empty),L.set(r.CodeActionKind.QuickFix,i.CodeActionKind.QuickFix),L.set(r.CodeActionKind.Refactor,i.CodeActionKind.Refactor),L.set(r.CodeActionKind.RefactorExtract,i.CodeActionKind.RefactorExtract),L.set(r.CodeActionKind.RefactorInline,i.CodeActionKind.RefactorInline),L.set(r.CodeActionKind.RefactorRewrite,i.CodeActionKind.RefactorRewrite),L.set(r.CodeActionKind.Source,i.CodeActionKind.Source),L.set(r.CodeActionKind.SourceOrganizeImports,i.CodeActionKind.SourceOrganizeImports),{asUri:n,asDiagnostics:u,asDiagnostic:d,asRange:f,asRanges:function(e){return e.map(e=>f(e))},asPosition:g,asDiagnosticSeverity:m,asDiagnosticTag:p,asHover:function(e){if(e)return new i.Hover(function(e){if(o.string(e))return new i.MarkdownString(e);if(l.is(e)){return(new i.MarkdownString).appendCodeblock(e.value,e.language)}if(Array.isArray(e)){let t=[];for(let n of e){let e=new i.MarkdownString;l.is(n)?e.appendCodeblock(n.value,n.language):e.appendMarkdown(n),t.push(e)}return t}{let t;switch(e.kind){case r.MarkupKind.Markdown:return new i.MarkdownString(e.value);case r.MarkupKind.PlainText:return t=new i.MarkdownString,t.appendText(e.value),t;default:return t=new i.MarkdownString,t.appendText(`Unsupported Markup content received. Kind is: ${e.kind}`),t}}}(e.contents),f(e.range))},asCompletionResult:function(e){if(!e)return;if(Array.isArray(e)){return e.map(C)}let t=e;return new i.CompletionList(t.items.map(C),t.isIncomplete)},asCompletionItem:C,asTextEdit:w,asTextEdits:R,asSignatureHelp:function(e){if(!e)return;let t=new i.SignatureHelp;return o.number(e.activeSignature)?t.activeSignature=e.activeSignature:t.activeSignature=0,o.number(e.activeParameter)?t.activeParameter=e.activeParameter:t.activeParameter=0,e.signatures&&(t.signatures=S(e.signatures)),t},asSignatureInformations:S,asSignatureInformation:_,asParameterInformations:E,asParameterInformation:T,asDeclarationResult:function(e){if(e)return b(e)},asDefinitionResult:function(e){if(e)return b(e)},asLocation:D,asReferences:function(e){if(e)return e.map(e=>D(e))},asDocumentHighlights:function(e){if(e)return e.map(k)},asDocumentHighlight:k,asDocumentHighlightKind:P,asSymbolKind:O,asSymbolTag:I,asSymbolTags:function(e){if(null!=e)return e.map(I)},asSymbolInformations:function(e,t){if(e)return e.map(e=>F(e,t))},asSymbolInformation:F,asDocumentSymbols:function(e){if(null!=e)return e.map(N)},asDocumentSymbol:N,asCommand:q,asCommands:function(e){if(e)return e.map(q)},asCodeAction:function(e){if(null==e)return;let t=new i.CodeAction(e.title);return void 0!==e.kind&&(t.kind=M(e.kind)),e.diagnostics&&(t.diagnostics=u(e.diagnostics)),e.edit&&(t.edit=j(e.edit)),e.command&&(t.command=q(e.command)),void 0!==e.isPreferred&&(t.isPreferred=e.isPreferred),t},asCodeActionKind:M,asCodeActionKinds:function(e){if(null!=e)return e.map(e=>M(e))},asCodeLens:A,asCodeLenses:function(e){if(e)return e.map(e=>A(e))},asWorkspaceEdit:j,asDocumentLink:K,asDocumentLinks:function(e){if(e)return e.map(K)},asFoldingRangeKind:$,asFoldingRange:z,asFoldingRanges:function(e){if(Array.isArray(e))return e.map(z)},asColor:H,asColorInformation:W,asColorInformations:function(e){if(Array.isArray(e))return e.map(W)},asColorPresentation:U,asColorPresentations:function(e){if(Array.isArray(e))return e.map(U)},asSelectionRange:G,asSelectionRanges:function(e){if(!Array.isArray(e))return[];let t=[];for(let n of e)t.push(G(n));return t}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Delayer=class{constructor(e){this.defaultDelay=e,this.timeout=void 0,this.completionPromise=void 0,this.onSuccess=void 0,this.task=void 0}trigger(e,t=this.defaultDelay){return this.task=e,t>=0&&this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise(e=>{this.onSuccess=e}).then(()=>{this.completionPromise=void 0,this.onSuccess=void 0;var e=this.task();return this.task=void 0,e})),(t>=0||void 0===this.timeout)&&(this.timeout=setTimeout(()=>{this.timeout=void 0,this.onSuccess(void 0)},t>=0?t:this.defaultDelay)),this.completionPromise}forceDelivery(){if(!this.completionPromise)return;this.cancelTimeout();let e=this.task();return this.completionPromise=void 0,this.onSuccess=void 0,this.task=void 0,e}isTriggered(){return void 0!==this.timeout}cancel(){this.cancelTimeout(),this.completionPromise=void 0}cancelTimeout(){void 0!==this.timeout&&(clearTimeout(this.timeout),this.timeout=void 0)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(0),r=n(1),o=n(3);function s(e,t){return void 0===e[t]&&(e[t]={}),e[t]}class a extends o.TextDocumentFeature{constructor(e){super(e,r.DocumentColorRequest.type)}fillClientCapabilities(e){s(s(e,"textDocument"),"colorProvider").dynamicRegistration=!0}initialize(e,t){let[n,i]=this.getRegistration(t,e.colorProvider);n&&i&&this.register(this.messages,{id:n,registerOptions:i})}registerLanguageProvider(e){const t={provideColorPresentations:(e,t,n)=>{const i=this._client,o=(e,t,n)=>{const o={color:e,textDocument:i.code2ProtocolConverter.asTextDocumentIdentifier(t.document),range:i.code2ProtocolConverter.asRange(t.range)};return i.sendRequest(r.ColorPresentationRequest.type,o,n).then(this.asColorPresentations.bind(this),e=>(i.logFailedRequest(r.ColorPresentationRequest.type,e),Promise.resolve(null)))},s=i.clientOptions.middleware;return s.provideColorPresentations?s.provideColorPresentations(e,t,n,o):o(e,t,n)},provideDocumentColors:(e,t)=>{const n=this._client,i=(e,t)=>{const i={textDocument:n.code2ProtocolConverter.asTextDocumentIdentifier(e)};return n.sendRequest(r.DocumentColorRequest.type,i,t).then(this.asColorInformations.bind(this),e=>(n.logFailedRequest(r.ColorPresentationRequest.type,e),Promise.resolve(null)))},o=n.clientOptions.middleware;return o.provideDocumentColors?o.provideDocumentColors(e,t,i):i(e,t)}};return[i.languages.registerColorProvider(e.documentSelector,t),t]}asColor(e){return new i.Color(e.red,e.green,e.blue,e.alpha)}asColorInformations(e){return Array.isArray(e)?e.map(e=>new i.ColorInformation(this._client.protocol2CodeConverter.asRange(e.range),this.asColor(e.color))):[]}asColorPresentations(e){return Array.isArray(e)?e.map(e=>{let t=new i.ColorPresentation(e.label);return t.additionalTextEdits=this._client.protocol2CodeConverter.asTextEdits(e.additionalTextEdits),t.textEdit=this._client.protocol2CodeConverter.asTextEdit(e.textEdit),t}):[]}}t.ColorProviderFeature=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(0),r=n(1);t.ConfigurationFeature=class{constructor(e){this._client=e}fillClientCapabilities(e){e.workspace=e.workspace||{},e.workspace.configuration=!0}initialize(){let e=this._client;e.onRequest(r.ConfigurationRequest.type,(t,n)=>{let i=e=>{let t=[];for(let n of e.items){let e=void 0!==n.scopeUri&&null!==n.scopeUri?this._client.protocol2CodeConverter.asUri(n.scopeUri):void 0;t.push(this.getConfiguration(e,null!==n.section?n.section:void 0))}return t},r=e.clientOptions.middleware.workspace;return r&&r.configuration?r.configuration(t,n,i):i(t)})}getConfiguration(e,t){let n=null;if(t){let r=t.lastIndexOf(".");if(-1===r)n=i.workspace.getConfiguration(void 0,e).get(t);else{let o=i.workspace.getConfiguration(t.substr(0,r),e);o&&(n=o.get(t.substr(r+1)))}}else{let t=i.workspace.getConfiguration(void 0,e);n={};for(let e of Object.keys(t))t.has(e)&&(n[e]=t.get(e))}return n||null}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(0),r=n(1),o=n(3);function s(e,t){return void 0===e[t]&&(e[t]={}),e[t]}class a extends o.TextDocumentFeature{constructor(e){super(e,r.ImplementationRequest.type)}fillClientCapabilities(e){let t=s(s(e,"textDocument"),"implementation");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){let[n,i]=this.getRegistration(t,e.implementationProvider);n&&i&&this.register(this.messages,{id:n,registerOptions:i})}registerLanguageProvider(e){const t={provideImplementation:(e,t,n)=>{const i=this._client,o=(e,t,n)=>i.sendRequest(r.ImplementationRequest.type,i.code2ProtocolConverter.asTextDocumentPositionParams(e,t),n).then(i.protocol2CodeConverter.asDefinitionResult,e=>(i.logFailedRequest(r.ImplementationRequest.type,e),Promise.resolve(null))),s=i.clientOptions.middleware;return s.provideImplementation?s.provideImplementation(e,t,n,o):o(e,t,n)}};return[i.languages.registerImplementationProvider(e.documentSelector,t),t]}}t.ImplementationFeature=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(0),r=n(1),o=n(3);function s(e,t){return void 0===e[t]&&(e[t]={}),e[t]}class a extends o.TextDocumentFeature{constructor(e){super(e,r.TypeDefinitionRequest.type)}fillClientCapabilities(e){s(s(e,"textDocument"),"typeDefinition").dynamicRegistration=!0;let t=s(s(e,"textDocument"),"typeDefinition");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){let[n,i]=this.getRegistration(t,e.typeDefinitionProvider);n&&i&&this.register(this.messages,{id:n,registerOptions:i})}registerLanguageProvider(e){const t={provideTypeDefinition:(e,t,n)=>{const i=this._client,o=(e,t,n)=>i.sendRequest(r.TypeDefinitionRequest.type,i.code2ProtocolConverter.asTextDocumentPositionParams(e,t),n).then(i.protocol2CodeConverter.asDefinitionResult,e=>(i.logFailedRequest(r.TypeDefinitionRequest.type,e),Promise.resolve(null))),s=i.clientOptions.middleware;return s.provideTypeDefinition?s.provideTypeDefinition(e,t,n,o):o(e,t,n)}};return[i.languages.registerTypeDefinitionProvider(e.documentSelector,t),t]}}t.TypeDefinitionFeature=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(17),r=n(0),o=n(1);function s(e,t){if(void 0!==e)return e[t]}function a(e,t){return e.filter(e=>t.indexOf(e)<0)}t.arrayDiff=a;t.WorkspaceFoldersFeature=class{constructor(e){this._client=e,this._listeners=new Map}get messages(){return o.DidChangeWorkspaceFoldersNotification.type}fillInitializeParams(e){let t=r.workspace.workspaceFolders;this.initializeWithFolders(t),e.workspaceFolders=void 0===t?null:t.map(e=>this.asProtocol(e))}initializeWithFolders(e){this._initialFolders=e}fillClientCapabilities(e){e.workspace=e.workspace||{},e.workspace.workspaceFolders=!0}initialize(e){let t=this._client;t.onRequest(o.WorkspaceFoldersRequest.type,e=>{let n=()=>{let e=r.workspace.workspaceFolders;return void 0===e?null:e.map(e=>this.asProtocol(e))},i=t.clientOptions.middleware.workspace;return i&&i.workspaceFolders?i.workspaceFolders(e,n):n()});let n,a=s(s(s(e,"workspace"),"workspaceFolders"),"changeNotifications");"string"==typeof a?n=a:!0===a&&(n=i.generateUuid()),n&&this.register(this.messages,{id:n,registerOptions:void 0})}sendInitialEvent(e){if(this._initialFolders&&e){const t=a(this._initialFolders,e),n=a(e,this._initialFolders);(n.length>0||t.length>0)&&this.doSendEvent(n,t)}else this._initialFolders?this.doSendEvent([],this._initialFolders):e&&this.doSendEvent(e,[])}doSendEvent(e,t){let n={event:{added:e.map(e=>this.asProtocol(e)),removed:t.map(e=>this.asProtocol(e))}};this._client.sendNotification(o.DidChangeWorkspaceFoldersNotification.type,n)}register(e,t){let n=t.id,i=this._client,o=r.workspace.onDidChangeWorkspaceFolders(e=>{let t=e=>{this.doSendEvent(e.added,e.removed)},n=i.clientOptions.middleware.workspace;n&&n.didChangeWorkspaceFolders?n.didChangeWorkspaceFolders(e,t):t(e)});this._listeners.set(n,o),this.sendInitialEvent(r.workspace.workspaceFolders)}unregister(e){let t=this._listeners.get(e);void 0!==t&&(this._listeners.delete(e),t.dispose())}dispose(){for(let e of this._listeners.values())e.dispose();this._listeners.clear()}asProtocol(e){return void 0===e?null:{uri:this._client.code2ProtocolConverter.asUri(e.uri),name:e.name}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(0),r=n(1),o=n(3);function s(e,t){return void 0===e[t]&&(e[t]={}),e[t]}class a extends o.TextDocumentFeature{constructor(e){super(e,r.FoldingRangeRequest.type)}fillClientCapabilities(e){let t=s(s(e,"textDocument"),"foldingRange");t.dynamicRegistration=!0,t.rangeLimit=5e3,t.lineFoldingOnly=!0}initialize(e,t){let[n,i]=this.getRegistration(t,e.foldingRangeProvider);n&&i&&this.register(this.messages,{id:n,registerOptions:i})}registerLanguageProvider(e){const t={provideFoldingRanges:(e,t,n)=>{const i=this._client,o=(e,t,n)=>{const o={textDocument:i.code2ProtocolConverter.asTextDocumentIdentifier(e)};return i.sendRequest(r.FoldingRangeRequest.type,o,n).then(this.asFoldingRanges.bind(this),e=>(i.logFailedRequest(r.FoldingRangeRequest.type,e),Promise.resolve(null)))},s=i.clientOptions.middleware;return s.provideFoldingRanges?s.provideFoldingRanges(e,t,n,o):o(e,0,n)}};return[i.languages.registerFoldingRangeProvider(e.documentSelector,t),t]}asFoldingRangeKind(e){if(e)switch(e){case r.FoldingRangeKind.Comment:return i.FoldingRangeKind.Comment;case r.FoldingRangeKind.Imports:return i.FoldingRangeKind.Imports;case r.FoldingRangeKind.Region:return i.FoldingRangeKind.Region}}asFoldingRanges(e){return Array.isArray(e)?e.map(e=>new i.FoldingRange(e.startLine,e.endLine,this.asFoldingRangeKind(e.kind))):[]}}t.FoldingRangeFeature=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(0),r=n(1),o=n(3);function s(e,t){return void 0===e[t]&&(e[t]={}),e[t]}class a extends o.TextDocumentFeature{constructor(e){super(e,r.DeclarationRequest.type)}fillClientCapabilities(e){const t=s(s(e,"textDocument"),"declaration");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){const[n,i]=this.getRegistration(t,e.declarationProvider);n&&i&&this.register(this.messages,{id:n,registerOptions:i})}registerLanguageProvider(e){const t={provideDeclaration:(e,t,n)=>{const i=this._client,o=(e,t,n)=>i.sendRequest(r.DeclarationRequest.type,i.code2ProtocolConverter.asTextDocumentPositionParams(e,t),n).then(i.protocol2CodeConverter.asDeclarationResult,e=>(i.logFailedRequest(r.DeclarationRequest.type,e),Promise.resolve(null))),s=i.clientOptions.middleware;return s.provideDeclaration?s.provideDeclaration(e,t,n,o):o(e,t,n)}};return[i.languages.registerDeclarationProvider(e.documentSelector,t),t]}}t.DeclarationFeature=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(0),r=n(1),o=n(3);function s(e,t){return void 0===e[t]&&(e[t]=Object.create(null)),e[t]}class a extends o.TextDocumentFeature{constructor(e){super(e,r.SelectionRangeRequest.type)}fillClientCapabilities(e){s(s(e,"textDocument"),"selectionRange").dynamicRegistration=!0}initialize(e,t){let[n,i]=this.getRegistration(t,e.selectionRangeProvider);n&&i&&this.register(this.messages,{id:n,registerOptions:i})}registerLanguageProvider(e){const t={provideSelectionRanges:(e,t,n)=>{const i=this._client,o=(e,t,n)=>{const o={textDocument:i.code2ProtocolConverter.asTextDocumentIdentifier(e),positions:i.code2ProtocolConverter.asPositions(t)};return i.sendRequest(r.SelectionRangeRequest.type,o,n).then(e=>i.protocol2CodeConverter.asSelectionRanges(e),e=>(i.logFailedRequest(r.SelectionRangeRequest.type,e),Promise.resolve(null)))},s=i.clientOptions.middleware;return s.provideSelectionRanges?s.provideSelectionRanges(e,t,n,o):o(e,t,n)}};return[i.languages.registerSelectionRangeProvider(e.documentSelector,t),t]}}t.SelectionRangeFeature=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(1),r=n(18);t.ProgressFeature=class{constructor(e){this._client=e}fillClientCapabilities(e){var t,n;(t=e,n="window",void 0===t[n]&&(t[n]=Object.create(null)),t[n]).workDoneProgress=!0}initialize(){this._client.onRequest(i.WorkDoneProgressCreateRequest.type,e=>{new r.ProgressPart(this._client,e.token)})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(0),r=n(1),o=n(3),s=n(13);function a(e,t){return void 0===e[t]&&(e[t]={}),e[t]}var c,l;!function(e){function t(e,t){if(null===t)return;let n=new i.CallHierarchyItem(e.asSymbolKind(t.kind),t.name,t.detail||"",e.asUri(t.uri),e.asRange(t.range),e.asRange(t.selectionRange));return void 0!==t.tags&&(n.tags=e.asSymbolTags(t.tags)),n}function n(e,n){return new i.CallHierarchyIncomingCall(t(e,n.from),e.asRanges(n.fromRanges))}function r(e,n){return new i.CallHierarchyOutgoingCall(t(e,n.to),e.asRanges(n.fromRanges))}e.asCallHierarchyItem=t,e.asCallHierarchyItems=function(e,n){if(null===n)return;return n.map(n=>t(e,n))[0]},e.asCallHierarchyIncomingCall=n,e.asCallHierarchyIncomingCalls=function(e,t){if(null!==t)return t.map(t=>n(e,t))},e.asCallHierarchyOutgoingCall=r,e.asCallHierarchyOutgoingCalls=function(e,t){if(null!==t)return t.map(t=>r(e,t))}}(c||(c={})),function(e){e.asCallHierarchyItem=function(e,t){const n={name:t.name,kind:e.asSymbolKind(t.kind),uri:e.asUri(t.uri),range:e.asRange(t.range),selectionRange:e.asRange(t.selectionRange)};return void 0!==t.detail&&t.detail.length>0&&(n.detail=t.detail),void 0!==t.tags&&(n.tags=e.asSymbolTags(t.tags)),n}}(l||(l={}));class u{constructor(e){this.client=e,this.middleware=e.clientOptions.middleware}prepareCallHierarchy(e,t,n){const i=this.client,r=this.middleware,o=(e,t,n)=>{const r=i.code2ProtocolConverter.asTextDocumentPositionParams(e,t);return i.sendRequest(s.CallHierarchyPrepareRequest.type,r,n).then(e=>c.asCallHierarchyItems(this.client.protocol2CodeConverter,e),e=>(i.logFailedRequest(s.CallHierarchyPrepareRequest.type,e),Promise.resolve(null)))};return r.prepareCallHierarchy?r.prepareCallHierarchy(e,t,n,o):o(e,t,n)}provideCallHierarchyIncomingCalls(e,t){const n=this.client,i=this.middleware,r=(e,t)=>{const i={item:l.asCallHierarchyItem(n.code2ProtocolConverter,e)};return n.sendRequest(s.CallHierarchyIncomingCallsRequest.type,i,t).then(e=>c.asCallHierarchyIncomingCalls(n.protocol2CodeConverter,e),e=>(n.logFailedRequest(s.CallHierarchyIncomingCallsRequest.type,e),Promise.resolve(null)))};return i.callHierarchyIncomingCalls?i.callHierarchyIncomingCalls(e,t,r):r(e,t)}provideCallHierarchyOutgoingCalls(e,t){const n=this.client,i=this.middleware,r=(e,t)=>{const i={item:l.asCallHierarchyItem(n.code2ProtocolConverter,e)};return n.sendRequest(s.CallHierarchyOutgoingCallsRequest.type,i,t).then(e=>c.asCallHierarchyOutgoingCalls(n.protocol2CodeConverter,e),e=>(n.logFailedRequest(s.CallHierarchyOutgoingCallsRequest.type,e),Promise.resolve(null)))};return i.callHierarchyOutgingCalls?i.callHierarchyOutgingCalls(e,t,r):r(e,t)}}class d extends o.TextDocumentFeature{constructor(e){super(e,r.Proposed.CallHierarchyPrepareRequest.type)}fillClientCapabilities(e){a(a(e,"textDocument"),"callHierarchy").dynamicRegistration=!0}initialize(e,t){const n=e,[i,r]=this.getRegistration(t,n.callHierarchyProvider);i&&r&&this.register(this.messages,{id:i,registerOptions:r})}registerLanguageProvider(e){const t=this._client,n=new u(t);return[i.languages.registerCallHierarchyProvider(e.documentSelector,n),n]}}t.CallHierarchyFeature=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(11),r=n(6),o="win32"===process.platform,s="darwin"===process.platform,a="linux"===process.platform;t.terminate=function(e,t){if(o)try{let n={stdio:["pipe","pipe","ignore"]};return t&&(n.cwd=t),i.execFileSync("taskkill",["/T","/F","/PID",e.pid.toString()],n),!0}catch(e){return!1}else{if(!a&&!s)return e.kill("SIGKILL"),!0;try{var n=r.join(__dirname,"terminateProcess.sh");return!i.spawnSync(n,[e.pid.toString()]).error}catch(e){return!1}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(0),r=n(19);class o{constructor(e){this._workspaceFolder=e}get workspaceFolder(){return this._workspaceFolder}isEnabled(){var e;const t=i.workspace.getConfiguration("eslint",this._workspaceFolder.uri);return null!=(e=t.get("lintTask.enable",!1))?e:t.get("provideLintTask",!1)}start(){}dispose(){}async getTask(){const e="file"===this._workspaceFolder.uri.scheme?this._workspaceFolder.uri.fsPath:void 0;if(e)try{const t=await r.findEslint(e),n={type:"eslint"},o={cwd:this.workspaceFolder.uri.fsPath},s=i.workspace.getConfiguration("eslint",this._workspaceFolder.uri).get("lintTask.options",".");return new i.Task(n,this.workspaceFolder,"lint whole folder","eslint",new i.ShellExecution(`${t} ${s}`,o),"$eslint-stylish")}catch(e){return}}}t.TaskProvider=class{constructor(){this.providers=new Map}start(){const e=i.workspace.workspaceFolders;e&&this.updateWorkspaceFolders(e,[]),i.workspace.onDidChangeWorkspaceFolders(e=>this.updateWorkspaceFolders(e.added,e.removed)),i.workspace.onDidChangeConfiguration(this.updateConfiguration,this)}dispose(){this.taskProvider&&(this.taskProvider.dispose(),this.taskProvider=void 0),this.providers.clear()}updateWorkspaceFolders(e,t){for(let e of t){const t=this.providers.get(e.uri.toString());t&&(t.dispose(),this.providers.delete(e.uri.toString()))}for(let t of e){const e=new o(t);e.isEnabled()&&(this.providers.set(t.uri.toString(),e),e.start())}this.updateProvider()}updateConfiguration(){for(let e of this.providers.values())e.isEnabled()||(e.dispose(),this.providers.delete(e.workspaceFolder.uri.toString()));const e=i.workspace.workspaceFolders;if(e)for(let t of e)if(!this.providers.has(t.uri.toString())){let e=new o(t);e.isEnabled()&&(this.providers.set(t.uri.toString(),e),e.start())}this.updateProvider()}updateProvider(){!this.taskProvider&&this.providers.size>0?this.taskProvider=i.workspace.registerTaskProvider("eslint",{provideTasks:()=>this.getTasks(),resolveTask(e){}}):this.taskProvider&&0===this.providers.size&&(this.taskProvider.dispose(),this.taskProvider=void 0)}getTasks(){if(0===this.providers.size)return Promise.resolve([]);{const e=[];for(let t of this.providers.values())e.push(t.getTask());return Promise.all(e).then(e=>e.filter(e=>void 0!==e))}}}}]));
  //# sourceMappingURL=extension.js.map